選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

16201 行
422 KiB

  1. webpackJsonp([0],[
  2. /* 0 */,
  3. /* 1 */,
  4. /* 2 */,
  5. /* 3 */,
  6. /* 4 */
  7. /***/ function(module, exports, __webpack_require__) {
  8. "use strict";
  9. 'use strict';
  10. var bind = __webpack_require__(78);
  11. /*global toString:true*/
  12. // utils is a library of generic helper functions non-specific to axios
  13. var toString = Object.prototype.toString;
  14. /**
  15. * Determine if a value is an Array
  16. *
  17. * @param {Object} val The value to test
  18. * @returns {boolean} True if value is an Array, otherwise false
  19. */
  20. function isArray(val) {
  21. return toString.call(val) === '[object Array]';
  22. }
  23. /**
  24. * Determine if a value is an ArrayBuffer
  25. *
  26. * @param {Object} val The value to test
  27. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  28. */
  29. function isArrayBuffer(val) {
  30. return toString.call(val) === '[object ArrayBuffer]';
  31. }
  32. /**
  33. * Determine if a value is a FormData
  34. *
  35. * @param {Object} val The value to test
  36. * @returns {boolean} True if value is an FormData, otherwise false
  37. */
  38. function isFormData(val) {
  39. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  40. }
  41. /**
  42. * Determine if a value is a view on an ArrayBuffer
  43. *
  44. * @param {Object} val The value to test
  45. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  46. */
  47. function isArrayBufferView(val) {
  48. var result;
  49. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  50. result = ArrayBuffer.isView(val);
  51. } else {
  52. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  53. }
  54. return result;
  55. }
  56. /**
  57. * Determine if a value is a String
  58. *
  59. * @param {Object} val The value to test
  60. * @returns {boolean} True if value is a String, otherwise false
  61. */
  62. function isString(val) {
  63. return typeof val === 'string';
  64. }
  65. /**
  66. * Determine if a value is a Number
  67. *
  68. * @param {Object} val The value to test
  69. * @returns {boolean} True if value is a Number, otherwise false
  70. */
  71. function isNumber(val) {
  72. return typeof val === 'number';
  73. }
  74. /**
  75. * Determine if a value is undefined
  76. *
  77. * @param {Object} val The value to test
  78. * @returns {boolean} True if the value is undefined, otherwise false
  79. */
  80. function isUndefined(val) {
  81. return typeof val === 'undefined';
  82. }
  83. /**
  84. * Determine if a value is an Object
  85. *
  86. * @param {Object} val The value to test
  87. * @returns {boolean} True if value is an Object, otherwise false
  88. */
  89. function isObject(val) {
  90. return val !== null && typeof val === 'object';
  91. }
  92. /**
  93. * Determine if a value is a Date
  94. *
  95. * @param {Object} val The value to test
  96. * @returns {boolean} True if value is a Date, otherwise false
  97. */
  98. function isDate(val) {
  99. return toString.call(val) === '[object Date]';
  100. }
  101. /**
  102. * Determine if a value is a File
  103. *
  104. * @param {Object} val The value to test
  105. * @returns {boolean} True if value is a File, otherwise false
  106. */
  107. function isFile(val) {
  108. return toString.call(val) === '[object File]';
  109. }
  110. /**
  111. * Determine if a value is a Blob
  112. *
  113. * @param {Object} val The value to test
  114. * @returns {boolean} True if value is a Blob, otherwise false
  115. */
  116. function isBlob(val) {
  117. return toString.call(val) === '[object Blob]';
  118. }
  119. /**
  120. * Determine if a value is a Function
  121. *
  122. * @param {Object} val The value to test
  123. * @returns {boolean} True if value is a Function, otherwise false
  124. */
  125. function isFunction(val) {
  126. return toString.call(val) === '[object Function]';
  127. }
  128. /**
  129. * Determine if a value is a Stream
  130. *
  131. * @param {Object} val The value to test
  132. * @returns {boolean} True if value is a Stream, otherwise false
  133. */
  134. function isStream(val) {
  135. return isObject(val) && isFunction(val.pipe);
  136. }
  137. /**
  138. * Determine if a value is a URLSearchParams object
  139. *
  140. * @param {Object} val The value to test
  141. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  142. */
  143. function isURLSearchParams(val) {
  144. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  145. }
  146. /**
  147. * Trim excess whitespace off the beginning and end of a string
  148. *
  149. * @param {String} str The String to trim
  150. * @returns {String} The String freed of excess whitespace
  151. */
  152. function trim(str) {
  153. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  154. }
  155. /**
  156. * Determine if we're running in a standard browser environment
  157. *
  158. * This allows axios to run in a web worker, and react-native.
  159. * Both environments support XMLHttpRequest, but not fully standard globals.
  160. *
  161. * web workers:
  162. * typeof window -> undefined
  163. * typeof document -> undefined
  164. *
  165. * react-native:
  166. * typeof document.createElement -> undefined
  167. */
  168. function isStandardBrowserEnv() {
  169. return (
  170. typeof window !== 'undefined' &&
  171. typeof document !== 'undefined' &&
  172. typeof document.createElement === 'function'
  173. );
  174. }
  175. /**
  176. * Iterate over an Array or an Object invoking a function for each item.
  177. *
  178. * If `obj` is an Array callback will be called passing
  179. * the value, index, and complete array for each item.
  180. *
  181. * If 'obj' is an Object callback will be called passing
  182. * the value, key, and complete object for each property.
  183. *
  184. * @param {Object|Array} obj The object to iterate
  185. * @param {Function} fn The callback to invoke for each item
  186. */
  187. function forEach(obj, fn) {
  188. // Don't bother if no value provided
  189. if (obj === null || typeof obj === 'undefined') {
  190. return;
  191. }
  192. // Force an array if not already something iterable
  193. if (typeof obj !== 'object' && !isArray(obj)) {
  194. /*eslint no-param-reassign:0*/
  195. obj = [obj];
  196. }
  197. if (isArray(obj)) {
  198. // Iterate over array values
  199. for (var i = 0, l = obj.length; i < l; i++) {
  200. fn.call(null, obj[i], i, obj);
  201. }
  202. } else {
  203. // Iterate over object keys
  204. for (var key in obj) {
  205. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  206. fn.call(null, obj[key], key, obj);
  207. }
  208. }
  209. }
  210. }
  211. /**
  212. * Accepts varargs expecting each argument to be an object, then
  213. * immutably merges the properties of each object and returns result.
  214. *
  215. * When multiple objects contain the same key the later object in
  216. * the arguments list will take precedence.
  217. *
  218. * Example:
  219. *
  220. * ```js
  221. * var result = merge({foo: 123}, {foo: 456});
  222. * console.log(result.foo); // outputs 456
  223. * ```
  224. *
  225. * @param {Object} obj1 Object to merge
  226. * @returns {Object} Result of all merge properties
  227. */
  228. function merge(/* obj1, obj2, obj3, ... */) {
  229. var result = {};
  230. function assignValue(val, key) {
  231. if (typeof result[key] === 'object' && typeof val === 'object') {
  232. result[key] = merge(result[key], val);
  233. } else {
  234. result[key] = val;
  235. }
  236. }
  237. for (var i = 0, l = arguments.length; i < l; i++) {
  238. forEach(arguments[i], assignValue);
  239. }
  240. return result;
  241. }
  242. /**
  243. * Extends object a by mutably adding to it the properties of object b.
  244. *
  245. * @param {Object} a The object to be extended
  246. * @param {Object} b The object to copy properties from
  247. * @param {Object} thisArg The object to bind function to
  248. * @return {Object} The resulting value of object a
  249. */
  250. function extend(a, b, thisArg) {
  251. forEach(b, function assignValue(val, key) {
  252. if (thisArg && typeof val === 'function') {
  253. a[key] = bind(val, thisArg);
  254. } else {
  255. a[key] = val;
  256. }
  257. });
  258. return a;
  259. }
  260. module.exports = {
  261. isArray: isArray,
  262. isArrayBuffer: isArrayBuffer,
  263. isFormData: isFormData,
  264. isArrayBufferView: isArrayBufferView,
  265. isString: isString,
  266. isNumber: isNumber,
  267. isObject: isObject,
  268. isUndefined: isUndefined,
  269. isDate: isDate,
  270. isFile: isFile,
  271. isBlob: isBlob,
  272. isFunction: isFunction,
  273. isStream: isStream,
  274. isURLSearchParams: isURLSearchParams,
  275. isStandardBrowserEnv: isStandardBrowserEnv,
  276. forEach: forEach,
  277. merge: merge,
  278. extend: extend,
  279. trim: trim
  280. };
  281. /***/ },
  282. /* 5 */
  283. /***/ function(module, exports, __webpack_require__) {
  284. var store = __webpack_require__(100)('wks')
  285. , uid = __webpack_require__(104)
  286. , Symbol = __webpack_require__(6).Symbol
  287. , USE_SYMBOL = typeof Symbol == 'function';
  288. var $exports = module.exports = function(name){
  289. return store[name] || (store[name] =
  290. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  291. };
  292. $exports.store = store;
  293. /***/ },
  294. /* 6 */
  295. /***/ function(module, exports) {
  296. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  297. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  298. ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
  299. if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
  300. /***/ },
  301. /* 7 */,
  302. /* 8 */
  303. /***/ function(module, exports) {
  304. var core = module.exports = {version: '2.4.0'};
  305. if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
  306. /***/ },
  307. /* 9 */,
  308. /* 10 */,
  309. /* 11 */
  310. /***/ function(module, exports, __webpack_require__) {
  311. /**
  312. * vuex v2.0.0
  313. * (c) 2016 Evan You
  314. * @license MIT
  315. */
  316. (function (global, factory) {
  317. true ? module.exports = factory() :
  318. typeof define === 'function' && define.amd ? define(factory) :
  319. (global.Vuex = factory());
  320. }(this, (function () { 'use strict';
  321. var devtoolHook =
  322. typeof window !== 'undefined' &&
  323. window.__VUE_DEVTOOLS_GLOBAL_HOOK__
  324. function devtoolPlugin (store) {
  325. if (!devtoolHook) { return }
  326. store._devtoolHook = devtoolHook
  327. devtoolHook.emit('vuex:init', store)
  328. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  329. store.replaceState(targetState)
  330. })
  331. store.subscribe(function (mutation, state) {
  332. devtoolHook.emit('vuex:mutation', mutation, state)
  333. })
  334. }
  335. function applyMixin (Vue) {
  336. var version = Number(Vue.version.split('.')[0])
  337. if (version >= 2) {
  338. var usesInit = Vue.config._lifecycleHooks.indexOf('init') > -1
  339. Vue.mixin(usesInit ? { init: vuexInit } : { beforeCreate: vuexInit })
  340. } else {
  341. // override init and inject vuex init procedure
  342. // for 1.x backwards compatibility.
  343. var _init = Vue.prototype._init
  344. Vue.prototype._init = function (options) {
  345. if ( options === void 0 ) options = {};
  346. options.init = options.init
  347. ? [vuexInit].concat(options.init)
  348. : vuexInit
  349. _init.call(this, options)
  350. }
  351. }
  352. /**
  353. * Vuex init hook, injected into each instances init hooks list.
  354. */
  355. function vuexInit () {
  356. var options = this.$options
  357. // store injection
  358. if (options.store) {
  359. this.$store = options.store
  360. } else if (options.parent && options.parent.$store) {
  361. this.$store = options.parent.$store
  362. }
  363. }
  364. }
  365. function mapState (states) {
  366. var res = {}
  367. normalizeMap(states).forEach(function (ref) {
  368. var key = ref.key;
  369. var val = ref.val;
  370. res[key] = function mappedState () {
  371. return typeof val === 'function'
  372. ? val.call(this, this.$store.state, this.$store.getters)
  373. : this.$store.state[val]
  374. }
  375. })
  376. return res
  377. }
  378. function mapMutations (mutations) {
  379. var res = {}
  380. normalizeMap(mutations).forEach(function (ref) {
  381. var key = ref.key;
  382. var val = ref.val;
  383. res[key] = function mappedMutation () {
  384. var args = [], len = arguments.length;
  385. while ( len-- ) args[ len ] = arguments[ len ];
  386. return this.$store.commit.apply(this.$store, [val].concat(args))
  387. }
  388. })
  389. return res
  390. }
  391. function mapGetters (getters) {
  392. var res = {}
  393. normalizeMap(getters).forEach(function (ref) {
  394. var key = ref.key;
  395. var val = ref.val;
  396. res[key] = function mappedGetter () {
  397. if (!(val in this.$store.getters)) {
  398. console.error(("[vuex] unknown getter: " + val))
  399. }
  400. return this.$store.getters[val]
  401. }
  402. })
  403. return res
  404. }
  405. function mapActions (actions) {
  406. var res = {}
  407. normalizeMap(actions).forEach(function (ref) {
  408. var key = ref.key;
  409. var val = ref.val;
  410. res[key] = function mappedAction () {
  411. var args = [], len = arguments.length;
  412. while ( len-- ) args[ len ] = arguments[ len ];
  413. return this.$store.dispatch.apply(this.$store, [val].concat(args))
  414. }
  415. })
  416. return res
  417. }
  418. function normalizeMap (map) {
  419. return Array.isArray(map)
  420. ? map.map(function (key) { return ({ key: key, val: key }); })
  421. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  422. }
  423. function isObject (obj) {
  424. return obj !== null && typeof obj === 'object'
  425. }
  426. function isPromise (val) {
  427. return val && typeof val.then === 'function'
  428. }
  429. function assert (condition, msg) {
  430. if (!condition) { throw new Error(("[vuex] " + msg)) }
  431. }
  432. var Vue // bind on install
  433. var Store = function Store (options) {
  434. var this$1 = this;
  435. if ( options === void 0 ) options = {};
  436. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.")
  437. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.")
  438. var state = options.state; if ( state === void 0 ) state = {};
  439. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  440. var strict = options.strict; if ( strict === void 0 ) strict = false;
  441. // store internal state
  442. this._options = options
  443. this._committing = false
  444. this._actions = Object.create(null)
  445. this._mutations = Object.create(null)
  446. this._wrappedGetters = Object.create(null)
  447. this._runtimeModules = Object.create(null)
  448. this._subscribers = []
  449. this._watcherVM = new Vue()
  450. // bind commit and dispatch to self
  451. var store = this
  452. var ref = this;
  453. var dispatch = ref.dispatch;
  454. var commit = ref.commit;
  455. this.dispatch = function boundDispatch (type, payload) {
  456. return dispatch.call(store, type, payload)
  457. }
  458. this.commit = function boundCommit (type, payload, options) {
  459. return commit.call(store, type, payload, options)
  460. }
  461. // strict mode
  462. this.strict = strict
  463. // init root module.
  464. // this also recursively registers all sub-modules
  465. // and collects all module getters inside this._wrappedGetters
  466. installModule(this, state, [], options)
  467. // initialize the store vm, which is responsible for the reactivity
  468. // (also registers _wrappedGetters as computed properties)
  469. resetStoreVM(this, state)
  470. // apply plugins
  471. plugins.concat(devtoolPlugin).forEach(function (plugin) { return plugin(this$1); })
  472. };
  473. var prototypeAccessors = { state: {} };
  474. prototypeAccessors.state.get = function () {
  475. return this._vm.state
  476. };
  477. prototypeAccessors.state.set = function (v) {
  478. assert(false, "Use store.replaceState() to explicit replace store state.")
  479. };
  480. Store.prototype.commit = function commit (type, payload, options) {
  481. var this$1 = this;
  482. // check object-style commit
  483. if (isObject(type) && type.type) {
  484. options = payload
  485. payload = type
  486. type = type.type
  487. }
  488. var mutation = { type: type, payload: payload }
  489. var entry = this._mutations[type]
  490. if (!entry) {
  491. console.error(("[vuex] unknown mutation type: " + type))
  492. return
  493. }
  494. this._withCommit(function () {
  495. entry.forEach(function commitIterator (handler) {
  496. handler(payload)
  497. })
  498. })
  499. if (!options || !options.silent) {
  500. this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); })
  501. }
  502. };
  503. Store.prototype.dispatch = function dispatch (type, payload) {
  504. // check object-style dispatch
  505. if (isObject(type) && type.type) {
  506. payload = type
  507. type = type.type
  508. }
  509. var entry = this._actions[type]
  510. if (!entry) {
  511. console.error(("[vuex] unknown action type: " + type))
  512. return
  513. }
  514. return entry.length > 1
  515. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  516. : entry[0](payload)
  517. };
  518. Store.prototype.subscribe = function subscribe (fn) {
  519. var subs = this._subscribers
  520. if (subs.indexOf(fn) < 0) {
  521. subs.push(fn)
  522. }
  523. return function () {
  524. var i = subs.indexOf(fn)
  525. if (i > -1) {
  526. subs.splice(i, 1)
  527. }
  528. }
  529. };
  530. Store.prototype.watch = function watch (getter, cb, options) {
  531. var this$1 = this;
  532. assert(typeof getter === 'function', "store.watch only accepts a function.")
  533. return this._watcherVM.$watch(function () { return getter(this$1.state); }, cb, options)
  534. };
  535. Store.prototype.replaceState = function replaceState (state) {
  536. var this$1 = this;
  537. this._withCommit(function () {
  538. this$1._vm.state = state
  539. })
  540. };
  541. Store.prototype.registerModule = function registerModule (path, module) {
  542. if (typeof path === 'string') { path = [path] }
  543. assert(Array.isArray(path), "module path must be a string or an Array.")
  544. this._runtimeModules[path.join('.')] = module
  545. installModule(this, this.state, path, module)
  546. // reset store to update getters...
  547. resetStoreVM(this, this.state)
  548. };
  549. Store.prototype.unregisterModule = function unregisterModule (path) {
  550. var this$1 = this;
  551. if (typeof path === 'string') { path = [path] }
  552. assert(Array.isArray(path), "module path must be a string or an Array.")
  553. delete this._runtimeModules[path.join('.')]
  554. this._withCommit(function () {
  555. var parentState = getNestedState(this$1.state, path.slice(0, -1))
  556. Vue.delete(parentState, path[path.length - 1])
  557. })
  558. resetStore(this)
  559. };
  560. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  561. updateModule(this._options, newOptions)
  562. resetStore(this)
  563. };
  564. Store.prototype._withCommit = function _withCommit (fn) {
  565. var committing = this._committing
  566. this._committing = true
  567. fn()
  568. this._committing = committing
  569. };
  570. Object.defineProperties( Store.prototype, prototypeAccessors );
  571. function updateModule (targetModule, newModule) {
  572. if (newModule.actions) {
  573. targetModule.actions = newModule.actions
  574. }
  575. if (newModule.mutations) {
  576. targetModule.mutations = newModule.mutations
  577. }
  578. if (newModule.getters) {
  579. targetModule.getters = newModule.getters
  580. }
  581. if (newModule.modules) {
  582. for (var key in newModule.modules) {
  583. if (!(targetModule.modules && targetModule.modules[key])) {
  584. console.warn(
  585. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  586. 'manual reload is needed'
  587. )
  588. return
  589. }
  590. updateModule(targetModule.modules[key], newModule.modules[key])
  591. }
  592. }
  593. }
  594. function resetStore (store) {
  595. store._actions = Object.create(null)
  596. store._mutations = Object.create(null)
  597. store._wrappedGetters = Object.create(null)
  598. var state = store.state
  599. // init root module
  600. installModule(store, state, [], store._options, true)
  601. // init all runtime modules
  602. Object.keys(store._runtimeModules).forEach(function (key) {
  603. installModule(store, state, key.split('.'), store._runtimeModules[key], true)
  604. })
  605. // reset vm
  606. resetStoreVM(store, state)
  607. }
  608. function resetStoreVM (store, state) {
  609. var oldVm = store._vm
  610. // bind store public getters
  611. store.getters = {}
  612. var wrappedGetters = store._wrappedGetters
  613. var computed = {}
  614. Object.keys(wrappedGetters).forEach(function (key) {
  615. var fn = wrappedGetters[key]
  616. // use computed to leverage its lazy-caching mechanism
  617. computed[key] = function () { return fn(store); }
  618. Object.defineProperty(store.getters, key, {
  619. get: function () { return store._vm[key]; }
  620. })
  621. })
  622. // use a Vue instance to store the state tree
  623. // suppress warnings just in case the user has added
  624. // some funky global mixins
  625. var silent = Vue.config.silent
  626. Vue.config.silent = true
  627. store._vm = new Vue({
  628. data: { state: state },
  629. computed: computed
  630. })
  631. Vue.config.silent = silent
  632. // enable strict mode for new vm
  633. if (store.strict) {
  634. enableStrictMode(store)
  635. }
  636. if (oldVm) {
  637. // dispatch changes in all subscribed watchers
  638. // to force getter re-evaluation.
  639. store._withCommit(function () {
  640. oldVm.state = null
  641. })
  642. Vue.nextTick(function () { return oldVm.$destroy(); })
  643. }
  644. }
  645. function installModule (store, rootState, path, module, hot) {
  646. var isRoot = !path.length
  647. var state = module.state;
  648. var actions = module.actions;
  649. var mutations = module.mutations;
  650. var getters = module.getters;
  651. var modules = module.modules;
  652. // set state
  653. if (!isRoot && !hot) {
  654. var parentState = getNestedState(rootState, path.slice(0, -1))
  655. var moduleName = path[path.length - 1]
  656. store._withCommit(function () {
  657. Vue.set(parentState, moduleName, state || {})
  658. })
  659. }
  660. if (mutations) {
  661. Object.keys(mutations).forEach(function (key) {
  662. registerMutation(store, key, mutations[key], path)
  663. })
  664. }
  665. if (actions) {
  666. Object.keys(actions).forEach(function (key) {
  667. registerAction(store, key, actions[key], path)
  668. })
  669. }
  670. if (getters) {
  671. wrapGetters(store, getters, path)
  672. }
  673. if (modules) {
  674. Object.keys(modules).forEach(function (key) {
  675. installModule(store, rootState, path.concat(key), modules[key], hot)
  676. })
  677. }
  678. }
  679. function registerMutation (store, type, handler, path) {
  680. if ( path === void 0 ) path = [];
  681. var entry = store._mutations[type] || (store._mutations[type] = [])
  682. entry.push(function wrappedMutationHandler (payload) {
  683. handler(getNestedState(store.state, path), payload)
  684. })
  685. }
  686. function registerAction (store, type, handler, path) {
  687. if ( path === void 0 ) path = [];
  688. var entry = store._actions[type] || (store._actions[type] = [])
  689. var dispatch = store.dispatch;
  690. var commit = store.commit;
  691. entry.push(function wrappedActionHandler (payload, cb) {
  692. var res = handler({
  693. dispatch: dispatch,
  694. commit: commit,
  695. getters: store.getters,
  696. state: getNestedState(store.state, path),
  697. rootState: store.state
  698. }, payload, cb)
  699. if (!isPromise(res)) {
  700. res = Promise.resolve(res)
  701. }
  702. if (store._devtoolHook) {
  703. return res.catch(function (err) {
  704. store._devtoolHook.emit('vuex:error', err)
  705. throw err
  706. })
  707. } else {
  708. return res
  709. }
  710. })
  711. }
  712. function wrapGetters (store, moduleGetters, modulePath) {
  713. Object.keys(moduleGetters).forEach(function (getterKey) {
  714. var rawGetter = moduleGetters[getterKey]
  715. if (store._wrappedGetters[getterKey]) {
  716. console.error(("[vuex] duplicate getter key: " + getterKey))
  717. return
  718. }
  719. store._wrappedGetters[getterKey] = function wrappedGetter (store) {
  720. return rawGetter(
  721. getNestedState(store.state, modulePath), // local state
  722. store.getters, // getters
  723. store.state // root state
  724. )
  725. }
  726. })
  727. }
  728. function enableStrictMode (store) {
  729. store._vm.$watch('state', function () {
  730. assert(store._committing, "Do not mutate vuex store state outside mutation handlers.")
  731. }, { deep: true, sync: true })
  732. }
  733. function getNestedState (state, path) {
  734. return path.length
  735. ? path.reduce(function (state, key) { return state[key]; }, state)
  736. : state
  737. }
  738. function install (_Vue) {
  739. if (Vue) {
  740. console.error(
  741. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  742. )
  743. return
  744. }
  745. Vue = _Vue
  746. applyMixin(Vue)
  747. }
  748. // auto install in dist mode
  749. if (typeof window !== 'undefined' && window.Vue) {
  750. install(window.Vue)
  751. }
  752. var index = {
  753. Store: Store,
  754. install: install,
  755. mapState: mapState,
  756. mapMutations: mapMutations,
  757. mapGetters: mapGetters,
  758. mapActions: mapActions
  759. }
  760. return index;
  761. })));
  762. /***/ },
  763. /* 12 */,
  764. /* 13 */
  765. /***/ function(module, exports, __webpack_require__) {
  766. var isObject = __webpack_require__(42);
  767. module.exports = function(it){
  768. if(!isObject(it))throw TypeError(it + ' is not an object!');
  769. return it;
  770. };
  771. /***/ },
  772. /* 14 */
  773. /***/ function(module, exports, __webpack_require__) {
  774. // Thank's IE8 for his funny defineProperty
  775. module.exports = !__webpack_require__(55)(function(){
  776. return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
  777. });
  778. /***/ },
  779. /* 15 */
  780. /***/ function(module, exports, __webpack_require__) {
  781. var dP = __webpack_require__(28)
  782. , createDesc = __webpack_require__(99);
  783. module.exports = __webpack_require__(14) ? function(object, key, value){
  784. return dP.f(object, key, createDesc(1, value));
  785. } : function(object, key, value){
  786. object[key] = value;
  787. return object;
  788. };
  789. /***/ },
  790. /* 16 */,
  791. /* 17 */
  792. /***/ function(module, exports) {
  793. /*
  794. MIT License http://www.opensource.org/licenses/mit-license.php
  795. Author Tobias Koppers @sokra
  796. */
  797. // css base code, injected by the css-loader
  798. module.exports = function() {
  799. var list = [];
  800. // return the list of modules as css string
  801. list.toString = function toString() {
  802. var result = [];
  803. for(var i = 0; i < this.length; i++) {
  804. var item = this[i];
  805. if(item[2]) {
  806. result.push("@media " + item[2] + "{" + item[1] + "}");
  807. } else {
  808. result.push(item[1]);
  809. }
  810. }
  811. return result.join("");
  812. };
  813. // import a list of modules into the list
  814. list.i = function(modules, mediaQuery) {
  815. if(typeof modules === "string")
  816. modules = [[null, modules, ""]];
  817. var alreadyImportedModules = {};
  818. for(var i = 0; i < this.length; i++) {
  819. var id = this[i][0];
  820. if(typeof id === "number")
  821. alreadyImportedModules[id] = true;
  822. }
  823. for(i = 0; i < modules.length; i++) {
  824. var item = modules[i];
  825. // skip already imported module
  826. // this implementation is not 100% perfect for weird media query combinations
  827. // when a module is imported multiple times with different media queries.
  828. // I hope this will never occur (Hey this way we have smaller bundles)
  829. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  830. if(mediaQuery && !item[2]) {
  831. item[2] = mediaQuery;
  832. } else if(mediaQuery) {
  833. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  834. }
  835. list.push(item);
  836. }
  837. }
  838. };
  839. return list;
  840. };
  841. /***/ },
  842. /* 18 */,
  843. /* 19 */,
  844. /* 20 */
  845. /***/ function(module, exports) {
  846. /*
  847. MIT License http://www.opensource.org/licenses/mit-license.php
  848. Author Tobias Koppers @sokra
  849. */
  850. var stylesInDom = {},
  851. memoize = function(fn) {
  852. var memo;
  853. return function () {
  854. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  855. return memo;
  856. };
  857. },
  858. isOldIE = memoize(function() {
  859. return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
  860. }),
  861. getHeadElement = memoize(function () {
  862. return document.head || document.getElementsByTagName("head")[0];
  863. }),
  864. singletonElement = null,
  865. singletonCounter = 0,
  866. styleElementsInsertedAtTop = [];
  867. module.exports = function(list, options) {
  868. if(typeof DEBUG !== "undefined" && DEBUG) {
  869. if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  870. }
  871. options = options || {};
  872. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  873. // tags it will allow on a page
  874. if (typeof options.singleton === "undefined") options.singleton = isOldIE();
  875. // By default, add <style> tags to the bottom of <head>.
  876. if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
  877. var styles = listToStyles(list);
  878. addStylesToDom(styles, options);
  879. return function update(newList) {
  880. var mayRemove = [];
  881. for(var i = 0; i < styles.length; i++) {
  882. var item = styles[i];
  883. var domStyle = stylesInDom[item.id];
  884. domStyle.refs--;
  885. mayRemove.push(domStyle);
  886. }
  887. if(newList) {
  888. var newStyles = listToStyles(newList);
  889. addStylesToDom(newStyles, options);
  890. }
  891. for(var i = 0; i < mayRemove.length; i++) {
  892. var domStyle = mayRemove[i];
  893. if(domStyle.refs === 0) {
  894. for(var j = 0; j < domStyle.parts.length; j++)
  895. domStyle.parts[j]();
  896. delete stylesInDom[domStyle.id];
  897. }
  898. }
  899. };
  900. }
  901. function addStylesToDom(styles, options) {
  902. for(var i = 0; i < styles.length; i++) {
  903. var item = styles[i];
  904. var domStyle = stylesInDom[item.id];
  905. if(domStyle) {
  906. domStyle.refs++;
  907. for(var j = 0; j < domStyle.parts.length; j++) {
  908. domStyle.parts[j](item.parts[j]);
  909. }
  910. for(; j < item.parts.length; j++) {
  911. domStyle.parts.push(addStyle(item.parts[j], options));
  912. }
  913. } else {
  914. var parts = [];
  915. for(var j = 0; j < item.parts.length; j++) {
  916. parts.push(addStyle(item.parts[j], options));
  917. }
  918. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  919. }
  920. }
  921. }
  922. function listToStyles(list) {
  923. var styles = [];
  924. var newStyles = {};
  925. for(var i = 0; i < list.length; i++) {
  926. var item = list[i];
  927. var id = item[0];
  928. var css = item[1];
  929. var media = item[2];
  930. var sourceMap = item[3];
  931. var part = {css: css, media: media, sourceMap: sourceMap};
  932. if(!newStyles[id])
  933. styles.push(newStyles[id] = {id: id, parts: [part]});
  934. else
  935. newStyles[id].parts.push(part);
  936. }
  937. return styles;
  938. }
  939. function insertStyleElement(options, styleElement) {
  940. var head = getHeadElement();
  941. var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
  942. if (options.insertAt === "top") {
  943. if(!lastStyleElementInsertedAtTop) {
  944. head.insertBefore(styleElement, head.firstChild);
  945. } else if(lastStyleElementInsertedAtTop.nextSibling) {
  946. head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
  947. } else {
  948. head.appendChild(styleElement);
  949. }
  950. styleElementsInsertedAtTop.push(styleElement);
  951. } else if (options.insertAt === "bottom") {
  952. head.appendChild(styleElement);
  953. } else {
  954. throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
  955. }
  956. }
  957. function removeStyleElement(styleElement) {
  958. styleElement.parentNode.removeChild(styleElement);
  959. var idx = styleElementsInsertedAtTop.indexOf(styleElement);
  960. if(idx >= 0) {
  961. styleElementsInsertedAtTop.splice(idx, 1);
  962. }
  963. }
  964. function createStyleElement(options) {
  965. var styleElement = document.createElement("style");
  966. styleElement.type = "text/css";
  967. insertStyleElement(options, styleElement);
  968. return styleElement;
  969. }
  970. function addStyle(obj, options) {
  971. var styleElement, update, remove;
  972. if (options.singleton) {
  973. var styleIndex = singletonCounter++;
  974. styleElement = singletonElement || (singletonElement = createStyleElement(options));
  975. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
  976. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
  977. } else {
  978. styleElement = createStyleElement(options);
  979. update = applyToTag.bind(null, styleElement);
  980. remove = function() {
  981. removeStyleElement(styleElement);
  982. };
  983. }
  984. update(obj);
  985. return function updateStyle(newObj) {
  986. if(newObj) {
  987. if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
  988. return;
  989. update(obj = newObj);
  990. } else {
  991. remove();
  992. }
  993. };
  994. }
  995. var replaceText = (function () {
  996. var textStore = [];
  997. return function (index, replacement) {
  998. textStore[index] = replacement;
  999. return textStore.filter(Boolean).join('\n');
  1000. };
  1001. })();
  1002. function applyToSingletonTag(styleElement, index, remove, obj) {
  1003. var css = remove ? "" : obj.css;
  1004. if (styleElement.styleSheet) {
  1005. styleElement.styleSheet.cssText = replaceText(index, css);
  1006. } else {
  1007. var cssNode = document.createTextNode(css);
  1008. var childNodes = styleElement.childNodes;
  1009. if (childNodes[index]) styleElement.removeChild(childNodes[index]);
  1010. if (childNodes.length) {
  1011. styleElement.insertBefore(cssNode, childNodes[index]);
  1012. } else {
  1013. styleElement.appendChild(cssNode);
  1014. }
  1015. }
  1016. }
  1017. function applyToTag(styleElement, obj) {
  1018. var css = obj.css;
  1019. var media = obj.media;
  1020. var sourceMap = obj.sourceMap;
  1021. if (media) {
  1022. styleElement.setAttribute("media", media);
  1023. }
  1024. if (sourceMap) {
  1025. // https://developer.chrome.com/devtools/docs/javascript-debugging
  1026. // this makes source maps inside style tags work properly in Chrome
  1027. css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */';
  1028. // http://stackoverflow.com/a/26603875
  1029. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  1030. }
  1031. if (styleElement.styleSheet) {
  1032. styleElement.styleSheet.cssText = css;
  1033. } else {
  1034. while(styleElement.firstChild) {
  1035. styleElement.removeChild(styleElement.firstChild);
  1036. }
  1037. styleElement.appendChild(document.createTextNode(css));
  1038. }
  1039. }
  1040. /***/ },
  1041. /* 21 */,
  1042. /* 22 */
  1043. /***/ function(module, exports, __webpack_require__) {
  1044. "use strict";
  1045. 'use strict';
  1046. Object.defineProperty(exports, "__esModule", {
  1047. value: true
  1048. });
  1049. exports.TOKEN_KEY = exports.LOCAL_STORAGE_KEY = undefined;
  1050. var _defineProperty2 = __webpack_require__(164);
  1051. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  1052. var _stringify = __webpack_require__(163);
  1053. var _stringify2 = _interopRequireDefault(_stringify);
  1054. var _assign = __webpack_require__(48);
  1055. var _assign2 = _interopRequireDefault(_assign);
  1056. var _classCallCheck2 = __webpack_require__(23);
  1057. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  1058. var _createClass2 = __webpack_require__(24);
  1059. var _createClass3 = _interopRequireDefault(_createClass2);
  1060. var _token = __webpack_require__(160);
  1061. var _token2 = _interopRequireDefault(_token);
  1062. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1063. var LOCAL_STORAGE_KEY = exports.LOCAL_STORAGE_KEY = 'lesspass';
  1064. var TOKEN_KEY = exports.TOKEN_KEY = 'jwt';
  1065. var Storage = function () {
  1066. function Storage() {
  1067. var storage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.localStorage;
  1068. (0, _classCallCheck3.default)(this, Storage);
  1069. this.storage = storage;
  1070. }
  1071. (0, _createClass3.default)(Storage, [{
  1072. key: '_getLocalStorage',
  1073. value: function _getLocalStorage() {
  1074. return JSON.parse(this.storage.getItem(LOCAL_STORAGE_KEY) || '{}');
  1075. }
  1076. }, {
  1077. key: 'json',
  1078. value: function json() {
  1079. var defaultStorage = {
  1080. baseURL: 'https://lesspass.com',
  1081. timeout: 5000
  1082. };
  1083. var localStorage = this._getLocalStorage();
  1084. return (0, _assign2.default)(defaultStorage, localStorage);
  1085. }
  1086. }, {
  1087. key: 'save',
  1088. value: function save(data) {
  1089. var newData = (0, _assign2.default)(this._getLocalStorage(), data);
  1090. this.storage.setItem(LOCAL_STORAGE_KEY, (0, _stringify2.default)(newData));
  1091. }
  1092. }, {
  1093. key: 'clear',
  1094. value: function clear() {
  1095. this.storage.clear();
  1096. }
  1097. }, {
  1098. key: 'getToken',
  1099. value: function getToken() {
  1100. var storage = this.json();
  1101. if (TOKEN_KEY in storage) {
  1102. return new _token2.default(storage[TOKEN_KEY]);
  1103. }
  1104. return new _token2.default();
  1105. }
  1106. }, {
  1107. key: 'saveToken',
  1108. value: function saveToken(token) {
  1109. this.save((0, _defineProperty3.default)({}, TOKEN_KEY, token));
  1110. }
  1111. }]);
  1112. return Storage;
  1113. }();
  1114. exports.default = Storage;
  1115. /***/ },
  1116. /* 23 */
  1117. /***/ function(module, exports) {
  1118. "use strict";
  1119. "use strict";
  1120. exports.__esModule = true;
  1121. exports.default = function (instance, Constructor) {
  1122. if (!(instance instanceof Constructor)) {
  1123. throw new TypeError("Cannot call a class as a function");
  1124. }
  1125. };
  1126. /***/ },
  1127. /* 24 */
  1128. /***/ function(module, exports, __webpack_require__) {
  1129. "use strict";
  1130. "use strict";
  1131. exports.__esModule = true;
  1132. var _defineProperty = __webpack_require__(80);
  1133. var _defineProperty2 = _interopRequireDefault(_defineProperty);
  1134. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1135. exports.default = function () {
  1136. function defineProperties(target, props) {
  1137. for (var i = 0; i < props.length; i++) {
  1138. var descriptor = props[i];
  1139. descriptor.enumerable = descriptor.enumerable || false;
  1140. descriptor.configurable = true;
  1141. if ("value" in descriptor) descriptor.writable = true;
  1142. (0, _defineProperty2.default)(target, descriptor.key, descriptor);
  1143. }
  1144. }
  1145. return function (Constructor, protoProps, staticProps) {
  1146. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  1147. if (staticProps) defineProperties(Constructor, staticProps);
  1148. return Constructor;
  1149. };
  1150. }();
  1151. /***/ },
  1152. /* 25 */
  1153. /***/ function(module, exports, __webpack_require__) {
  1154. "use strict";
  1155. "use strict";
  1156. exports.__esModule = true;
  1157. var _assign = __webpack_require__(48);
  1158. var _assign2 = _interopRequireDefault(_assign);
  1159. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1160. exports.default = _assign2.default || function (target) {
  1161. for (var i = 1; i < arguments.length; i++) {
  1162. var source = arguments[i];
  1163. for (var key in source) {
  1164. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1165. target[key] = source[key];
  1166. }
  1167. }
  1168. }
  1169. return target;
  1170. };
  1171. /***/ },
  1172. /* 26 */,
  1173. /* 27 */
  1174. /***/ function(module, exports) {
  1175. module.exports = {};
  1176. /***/ },
  1177. /* 28 */
  1178. /***/ function(module, exports, __webpack_require__) {
  1179. var anObject = __webpack_require__(13)
  1180. , IE8_DOM_DEFINE = __webpack_require__(185)
  1181. , toPrimitive = __webpack_require__(206)
  1182. , dP = Object.defineProperty;
  1183. exports.f = __webpack_require__(14) ? Object.defineProperty : function defineProperty(O, P, Attributes){
  1184. anObject(O);
  1185. P = toPrimitive(P, true);
  1186. anObject(Attributes);
  1187. if(IE8_DOM_DEFINE)try {
  1188. return dP(O, P, Attributes);
  1189. } catch(e){ /* empty */ }
  1190. if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
  1191. if('value' in Attributes)O[P] = Attributes.value;
  1192. return O;
  1193. };
  1194. /***/ },
  1195. /* 29 */,
  1196. /* 30 */,
  1197. /* 31 */,
  1198. /* 32 */,
  1199. /* 33 */,
  1200. /* 34 */
  1201. /***/ function(module, exports, __webpack_require__) {
  1202. "use strict";
  1203. 'use strict';
  1204. Object.defineProperty(exports, "__esModule", {
  1205. value: true
  1206. });
  1207. var _promise = __webpack_require__(81);
  1208. var _promise2 = _interopRequireDefault(_promise);
  1209. var _classCallCheck2 = __webpack_require__(23);
  1210. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  1211. var _createClass2 = __webpack_require__(24);
  1212. var _createClass3 = _interopRequireDefault(_createClass2);
  1213. var _axios = __webpack_require__(72);
  1214. var _axios2 = _interopRequireDefault(_axios);
  1215. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1216. var Auth = function () {
  1217. function Auth(storage) {
  1218. (0, _classCallCheck3.default)(this, Auth);
  1219. this.user = {
  1220. authenticated: false
  1221. };
  1222. this.storage = storage;
  1223. }
  1224. (0, _createClass3.default)(Auth, [{
  1225. key: 'isAuthenticated',
  1226. value: function isAuthenticated() {
  1227. var token = this.storage.getToken();
  1228. if (token.stillValid()) {
  1229. this.user.authenticated = true;
  1230. return true;
  1231. }
  1232. this.user.authenticated = false;
  1233. return false;
  1234. }
  1235. }, {
  1236. key: 'isGuest',
  1237. value: function isGuest() {
  1238. return !this.isAuthenticated();
  1239. }
  1240. }, {
  1241. key: 'logout',
  1242. value: function logout() {
  1243. var _this = this;
  1244. return new _promise2.default(function (resolve) {
  1245. _this.storage.clear();
  1246. _this.user.authenticated = false;
  1247. resolve();
  1248. });
  1249. }
  1250. }, {
  1251. key: 'login',
  1252. value: function login(user, baseURL) {
  1253. var _this2 = this;
  1254. var config = this.storage.json();
  1255. if (baseURL) {
  1256. config.baseURL = baseURL;
  1257. }
  1258. return Auth._requestToken(user, config).then(function (token) {
  1259. _this2.storage.saveToken(token);
  1260. });
  1261. }
  1262. }, {
  1263. key: 'refreshToken',
  1264. value: function refreshToken() {
  1265. var _this3 = this;
  1266. var config = this.storage.json();
  1267. var token = this.storage.getToken();
  1268. return Auth._requestNewToken({ token: token.name }, config).then(function (token) {
  1269. _this3.storage.saveToken(token);
  1270. });
  1271. }
  1272. }, {
  1273. key: 'register',
  1274. value: function register(user, baseURL) {
  1275. var config = this.storage.json();
  1276. if (baseURL) {
  1277. config.baseURL = baseURL;
  1278. }
  1279. return _axios2.default.post('/api/auth/register/', user, config).then(function (response) {
  1280. return response.data;
  1281. });
  1282. }
  1283. }, {
  1284. key: 'resetPassword',
  1285. value: function resetPassword(email, baseURL) {
  1286. var config = this.storage.json();
  1287. if (baseURL) {
  1288. config.baseURL = baseURL;
  1289. }
  1290. return _axios2.default.post('/api/auth/password/reset/', email, config);
  1291. }
  1292. }, {
  1293. key: 'confirmResetPassword',
  1294. value: function confirmResetPassword(password, baseURL) {
  1295. var config = this.storage.json();
  1296. if (baseURL) {
  1297. config.baseURL = baseURL;
  1298. }
  1299. return _axios2.default.post('/api/auth/password/reset/confirm/', password, config);
  1300. }
  1301. }], [{
  1302. key: '_requestToken',
  1303. value: function _requestToken(user) {
  1304. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1305. return _axios2.default.post('/api/tokens/auth/', user, config).then(function (response) {
  1306. return response.data.token;
  1307. });
  1308. }
  1309. }, {
  1310. key: '_requestNewToken',
  1311. value: function _requestNewToken(token) {
  1312. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1313. return _axios2.default.post('/api/tokens/refresh/', token, config).then(function (response) {
  1314. return response.data.token;
  1315. });
  1316. }
  1317. }]);
  1318. return Auth;
  1319. }();
  1320. exports.default = Auth;
  1321. /***/ },
  1322. /* 35 */,
  1323. /* 36 */,
  1324. /* 37 */,
  1325. /* 38 */
  1326. /***/ function(module, exports) {
  1327. var toString = {}.toString;
  1328. module.exports = function(it){
  1329. return toString.call(it).slice(8, -1);
  1330. };
  1331. /***/ },
  1332. /* 39 */
  1333. /***/ function(module, exports, __webpack_require__) {
  1334. // optional / simple context binding
  1335. var aFunction = __webpack_require__(52);
  1336. module.exports = function(fn, that, length){
  1337. aFunction(fn);
  1338. if(that === undefined)return fn;
  1339. switch(length){
  1340. case 1: return function(a){
  1341. return fn.call(that, a);
  1342. };
  1343. case 2: return function(a, b){
  1344. return fn.call(that, a, b);
  1345. };
  1346. case 3: return function(a, b, c){
  1347. return fn.call(that, a, b, c);
  1348. };
  1349. }
  1350. return function(/* ...args */){
  1351. return fn.apply(that, arguments);
  1352. };
  1353. };
  1354. /***/ },
  1355. /* 40 */
  1356. /***/ function(module, exports, __webpack_require__) {
  1357. var global = __webpack_require__(6)
  1358. , core = __webpack_require__(8)
  1359. , ctx = __webpack_require__(39)
  1360. , hide = __webpack_require__(15)
  1361. , PROTOTYPE = 'prototype';
  1362. var $export = function(type, name, source){
  1363. var IS_FORCED = type & $export.F
  1364. , IS_GLOBAL = type & $export.G
  1365. , IS_STATIC = type & $export.S
  1366. , IS_PROTO = type & $export.P
  1367. , IS_BIND = type & $export.B
  1368. , IS_WRAP = type & $export.W
  1369. , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
  1370. , expProto = exports[PROTOTYPE]
  1371. , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
  1372. , key, own, out;
  1373. if(IS_GLOBAL)source = name;
  1374. for(key in source){
  1375. // contains in native
  1376. own = !IS_FORCED && target && target[key] !== undefined;
  1377. if(own && key in exports)continue;
  1378. // export native or passed
  1379. out = own ? target[key] : source[key];
  1380. // prevent global pollution for namespaces
  1381. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  1382. // bind timers to global for call from export context
  1383. : IS_BIND && own ? ctx(out, global)
  1384. // wrap global constructors for prevent change them in library
  1385. : IS_WRAP && target[key] == out ? (function(C){
  1386. var F = function(a, b, c){
  1387. if(this instanceof C){
  1388. switch(arguments.length){
  1389. case 0: return new C;
  1390. case 1: return new C(a);
  1391. case 2: return new C(a, b);
  1392. } return new C(a, b, c);
  1393. } return C.apply(this, arguments);
  1394. };
  1395. F[PROTOTYPE] = C[PROTOTYPE];
  1396. return F;
  1397. // make static versions for prototype methods
  1398. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  1399. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  1400. if(IS_PROTO){
  1401. (exports.virtual || (exports.virtual = {}))[key] = out;
  1402. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  1403. if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
  1404. }
  1405. }
  1406. };
  1407. // type bitmap
  1408. $export.F = 1; // forced
  1409. $export.G = 2; // global
  1410. $export.S = 4; // static
  1411. $export.P = 8; // proto
  1412. $export.B = 16; // bind
  1413. $export.W = 32; // wrap
  1414. $export.U = 64; // safe
  1415. $export.R = 128; // real proto method for `library`
  1416. module.exports = $export;
  1417. /***/ },
  1418. /* 41 */
  1419. /***/ function(module, exports) {
  1420. var hasOwnProperty = {}.hasOwnProperty;
  1421. module.exports = function(it, key){
  1422. return hasOwnProperty.call(it, key);
  1423. };
  1424. /***/ },
  1425. /* 42 */
  1426. /***/ function(module, exports) {
  1427. module.exports = function(it){
  1428. return typeof it === 'object' ? it !== null : typeof it === 'function';
  1429. };
  1430. /***/ },
  1431. /* 43 */,
  1432. /* 44 */,
  1433. /* 45 */,
  1434. /* 46 */,
  1435. /* 47 */
  1436. /***/ function(module, exports, __webpack_require__) {
  1437. "use strict";
  1438. /* WEBPACK VAR INJECTION */(function(process) {/*!
  1439. * Vue.js v2.0.3
  1440. * (c) 2014-2016 Evan You
  1441. * Released under the MIT License.
  1442. */
  1443. 'use strict';
  1444. /* */
  1445. /**
  1446. * Convert a value to a string that is actually rendered.
  1447. */
  1448. function _toString (val) {
  1449. return val == null
  1450. ? ''
  1451. : typeof val === 'object'
  1452. ? JSON.stringify(val, null, 2)
  1453. : String(val)
  1454. }
  1455. /**
  1456. * Convert a input value to a number for persistence.
  1457. * If the conversion fails, return original string.
  1458. */
  1459. function toNumber (val) {
  1460. var n = parseFloat(val, 10);
  1461. return (n || n === 0) ? n : val
  1462. }
  1463. /**
  1464. * Make a map and return a function for checking if a key
  1465. * is in that map.
  1466. */
  1467. function makeMap (
  1468. str,
  1469. expectsLowerCase
  1470. ) {
  1471. var map = Object.create(null);
  1472. var list = str.split(',');
  1473. for (var i = 0; i < list.length; i++) {
  1474. map[list[i]] = true;
  1475. }
  1476. return expectsLowerCase
  1477. ? function (val) { return map[val.toLowerCase()]; }
  1478. : function (val) { return map[val]; }
  1479. }
  1480. /**
  1481. * Check if a tag is a built-in tag.
  1482. */
  1483. var isBuiltInTag = makeMap('slot,component', true);
  1484. /**
  1485. * Remove an item from an array
  1486. */
  1487. function remove$1 (arr, item) {
  1488. if (arr.length) {
  1489. var index = arr.indexOf(item);
  1490. if (index > -1) {
  1491. return arr.splice(index, 1)
  1492. }
  1493. }
  1494. }
  1495. /**
  1496. * Check whether the object has the property.
  1497. */
  1498. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1499. function hasOwn (obj, key) {
  1500. return hasOwnProperty.call(obj, key)
  1501. }
  1502. /**
  1503. * Check if value is primitive
  1504. */
  1505. function isPrimitive (value) {
  1506. return typeof value === 'string' || typeof value === 'number'
  1507. }
  1508. /**
  1509. * Create a cached version of a pure function.
  1510. */
  1511. function cached (fn) {
  1512. var cache = Object.create(null);
  1513. return function cachedFn (str) {
  1514. var hit = cache[str];
  1515. return hit || (cache[str] = fn(str))
  1516. }
  1517. }
  1518. /**
  1519. * Camelize a hyphen-delmited string.
  1520. */
  1521. var camelizeRE = /-(\w)/g;
  1522. var camelize = cached(function (str) {
  1523. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1524. });
  1525. /**
  1526. * Capitalize a string.
  1527. */
  1528. var capitalize = cached(function (str) {
  1529. return str.charAt(0).toUpperCase() + str.slice(1)
  1530. });
  1531. /**
  1532. * Hyphenate a camelCase string.
  1533. */
  1534. var hyphenateRE = /([^-])([A-Z])/g;
  1535. var hyphenate = cached(function (str) {
  1536. return str
  1537. .replace(hyphenateRE, '$1-$2')
  1538. .replace(hyphenateRE, '$1-$2')
  1539. .toLowerCase()
  1540. });
  1541. /**
  1542. * Simple bind, faster than native
  1543. */
  1544. function bind$1 (fn, ctx) {
  1545. function boundFn (a) {
  1546. var l = arguments.length;
  1547. return l
  1548. ? l > 1
  1549. ? fn.apply(ctx, arguments)
  1550. : fn.call(ctx, a)
  1551. : fn.call(ctx)
  1552. }
  1553. // record original fn length
  1554. boundFn._length = fn.length;
  1555. return boundFn
  1556. }
  1557. /**
  1558. * Convert an Array-like object to a real Array.
  1559. */
  1560. function toArray (list, start) {
  1561. start = start || 0;
  1562. var i = list.length - start;
  1563. var ret = new Array(i);
  1564. while (i--) {
  1565. ret[i] = list[i + start];
  1566. }
  1567. return ret
  1568. }
  1569. /**
  1570. * Mix properties into target object.
  1571. */
  1572. function extend (to, _from) {
  1573. for (var key in _from) {
  1574. to[key] = _from[key];
  1575. }
  1576. return to
  1577. }
  1578. /**
  1579. * Quick object check - this is primarily used to tell
  1580. * Objects from primitive values when we know the value
  1581. * is a JSON-compliant type.
  1582. */
  1583. function isObject (obj) {
  1584. return obj !== null && typeof obj === 'object'
  1585. }
  1586. /**
  1587. * Strict object type check. Only returns true
  1588. * for plain JavaScript objects.
  1589. */
  1590. var toString = Object.prototype.toString;
  1591. var OBJECT_STRING = '[object Object]';
  1592. function isPlainObject (obj) {
  1593. return toString.call(obj) === OBJECT_STRING
  1594. }
  1595. /**
  1596. * Merge an Array of Objects into a single Object.
  1597. */
  1598. function toObject (arr) {
  1599. var res = {};
  1600. for (var i = 0; i < arr.length; i++) {
  1601. if (arr[i]) {
  1602. extend(res, arr[i]);
  1603. }
  1604. }
  1605. return res
  1606. }
  1607. /**
  1608. * Perform no operation.
  1609. */
  1610. function noop () {}
  1611. /**
  1612. * Always return false.
  1613. */
  1614. var no = function () { return false; };
  1615. /**
  1616. * Generate a static keys string from compiler modules.
  1617. */
  1618. function genStaticKeys (modules) {
  1619. return modules.reduce(function (keys, m) {
  1620. return keys.concat(m.staticKeys || [])
  1621. }, []).join(',')
  1622. }
  1623. /**
  1624. * Check if two values are loosely equal - that is,
  1625. * if they are plain objects, do they have the same shape?
  1626. */
  1627. function looseEqual (a, b) {
  1628. /* eslint-disable eqeqeq */
  1629. return a == b || (
  1630. isObject(a) && isObject(b)
  1631. ? JSON.stringify(a) === JSON.stringify(b)
  1632. : false
  1633. )
  1634. /* eslint-enable eqeqeq */
  1635. }
  1636. function looseIndexOf (arr, val) {
  1637. for (var i = 0; i < arr.length; i++) {
  1638. if (looseEqual(arr[i], val)) { return i }
  1639. }
  1640. return -1
  1641. }
  1642. /* */
  1643. var config = {
  1644. /**
  1645. * Option merge strategies (used in core/util/options)
  1646. */
  1647. optionMergeStrategies: Object.create(null),
  1648. /**
  1649. * Whether to suppress warnings.
  1650. */
  1651. silent: false,
  1652. /**
  1653. * Whether to enable devtools
  1654. */
  1655. devtools: process.env.NODE_ENV !== 'production',
  1656. /**
  1657. * Error handler for watcher errors
  1658. */
  1659. errorHandler: null,
  1660. /**
  1661. * Ignore certain custom elements
  1662. */
  1663. ignoredElements: null,
  1664. /**
  1665. * Custom user key aliases for v-on
  1666. */
  1667. keyCodes: Object.create(null),
  1668. /**
  1669. * Check if a tag is reserved so that it cannot be registered as a
  1670. * component. This is platform-dependent and may be overwritten.
  1671. */
  1672. isReservedTag: no,
  1673. /**
  1674. * Check if a tag is an unknown element.
  1675. * Platform-dependent.
  1676. */
  1677. isUnknownElement: no,
  1678. /**
  1679. * Get the namespace of an element
  1680. */
  1681. getTagNamespace: noop,
  1682. /**
  1683. * Check if an attribute must be bound using property, e.g. value
  1684. * Platform-dependent.
  1685. */
  1686. mustUseProp: no,
  1687. /**
  1688. * List of asset types that a component can own.
  1689. */
  1690. _assetTypes: [
  1691. 'component',
  1692. 'directive',
  1693. 'filter'
  1694. ],
  1695. /**
  1696. * List of lifecycle hooks.
  1697. */
  1698. _lifecycleHooks: [
  1699. 'beforeCreate',
  1700. 'created',
  1701. 'beforeMount',
  1702. 'mounted',
  1703. 'beforeUpdate',
  1704. 'updated',
  1705. 'beforeDestroy',
  1706. 'destroyed',
  1707. 'activated',
  1708. 'deactivated'
  1709. ],
  1710. /**
  1711. * Max circular updates allowed in a scheduler flush cycle.
  1712. */
  1713. _maxUpdateCount: 100,
  1714. /**
  1715. * Server rendering?
  1716. */
  1717. _isServer: process.env.VUE_ENV === 'server'
  1718. };
  1719. /* */
  1720. /**
  1721. * Check if a string starts with $ or _
  1722. */
  1723. function isReserved (str) {
  1724. var c = (str + '').charCodeAt(0);
  1725. return c === 0x24 || c === 0x5F
  1726. }
  1727. /**
  1728. * Define a property.
  1729. */
  1730. function def (obj, key, val, enumerable) {
  1731. Object.defineProperty(obj, key, {
  1732. value: val,
  1733. enumerable: !!enumerable,
  1734. writable: true,
  1735. configurable: true
  1736. });
  1737. }
  1738. /**
  1739. * Parse simple path.
  1740. */
  1741. var bailRE = /[^\w\.\$]/;
  1742. function parsePath (path) {
  1743. if (bailRE.test(path)) {
  1744. return
  1745. } else {
  1746. var segments = path.split('.');
  1747. return function (obj) {
  1748. for (var i = 0; i < segments.length; i++) {
  1749. if (!obj) { return }
  1750. obj = obj[segments[i]];
  1751. }
  1752. return obj
  1753. }
  1754. }
  1755. }
  1756. /* */
  1757. /* globals MutationObserver */
  1758. // can we use __proto__?
  1759. var hasProto = '__proto__' in {};
  1760. // Browser environment sniffing
  1761. var inBrowser =
  1762. typeof window !== 'undefined' &&
  1763. Object.prototype.toString.call(window) !== '[object Object]';
  1764. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  1765. var isIE = UA && /msie|trident/.test(UA);
  1766. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  1767. var isEdge = UA && UA.indexOf('edge/') > 0;
  1768. var isAndroid = UA && UA.indexOf('android') > 0;
  1769. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  1770. // detect devtools
  1771. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  1772. /* istanbul ignore next */
  1773. function isNative (Ctor) {
  1774. return /native code/.test(Ctor.toString())
  1775. }
  1776. /**
  1777. * Defer a task to execute it asynchronously.
  1778. */
  1779. var nextTick = (function () {
  1780. var callbacks = [];
  1781. var pending = false;
  1782. var timerFunc;
  1783. function nextTickHandler () {
  1784. pending = false;
  1785. var copies = callbacks.slice(0);
  1786. callbacks.length = 0;
  1787. for (var i = 0; i < copies.length; i++) {
  1788. copies[i]();
  1789. }
  1790. }
  1791. // the nextTick behavior leverages the microtask queue, which can be accessed
  1792. // via either native Promise.then or MutationObserver.
  1793. // MutationObserver has wider support, however it is seriously bugged in
  1794. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  1795. // completely stops working after triggering a few times... so, if native
  1796. // Promise is available, we will use it:
  1797. /* istanbul ignore if */
  1798. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  1799. var p = Promise.resolve();
  1800. timerFunc = function () {
  1801. p.then(nextTickHandler);
  1802. // in problematic UIWebViews, Promise.then doesn't completely break, but
  1803. // it can get stuck in a weird state where callbacks are pushed into the
  1804. // microtask queue but the queue isn't being flushed, until the browser
  1805. // needs to do some other work, e.g. handle a timer. Therefore we can
  1806. // "force" the microtask queue to be flushed by adding an empty timer.
  1807. if (isIOS) { setTimeout(noop); }
  1808. };
  1809. } else if (typeof MutationObserver !== 'undefined' && (
  1810. isNative(MutationObserver) ||
  1811. // PhantomJS and iOS 7.x
  1812. MutationObserver.toString() === '[object MutationObserverConstructor]'
  1813. )) {
  1814. // use MutationObserver where native Promise is not available,
  1815. // e.g. PhantomJS IE11, iOS7, Android 4.4
  1816. var counter = 1;
  1817. var observer = new MutationObserver(nextTickHandler);
  1818. var textNode = document.createTextNode(String(counter));
  1819. observer.observe(textNode, {
  1820. characterData: true
  1821. });
  1822. timerFunc = function () {
  1823. counter = (counter + 1) % 2;
  1824. textNode.data = String(counter);
  1825. };
  1826. } else {
  1827. // fallback to setTimeout
  1828. /* istanbul ignore next */
  1829. timerFunc = function () {
  1830. setTimeout(nextTickHandler, 0);
  1831. };
  1832. }
  1833. return function queueNextTick (cb, ctx) {
  1834. var func = ctx
  1835. ? function () { cb.call(ctx); }
  1836. : cb;
  1837. callbacks.push(func);
  1838. if (!pending) {
  1839. pending = true;
  1840. timerFunc();
  1841. }
  1842. }
  1843. })();
  1844. var _Set;
  1845. /* istanbul ignore if */
  1846. if (typeof Set !== 'undefined' && isNative(Set)) {
  1847. // use native Set when available.
  1848. _Set = Set;
  1849. } else {
  1850. // a non-standard Set polyfill that only works with primitive keys.
  1851. _Set = (function () {
  1852. function Set () {
  1853. this.set = Object.create(null);
  1854. }
  1855. Set.prototype.has = function has (key) {
  1856. return this.set[key] !== undefined
  1857. };
  1858. Set.prototype.add = function add (key) {
  1859. this.set[key] = 1;
  1860. };
  1861. Set.prototype.clear = function clear () {
  1862. this.set = Object.create(null);
  1863. };
  1864. return Set;
  1865. }());
  1866. }
  1867. /* not type checking this file because flow doesn't play well with Proxy */
  1868. var hasProxy;
  1869. var proxyHandlers;
  1870. var initProxy;
  1871. if (process.env.NODE_ENV !== 'production') {
  1872. var allowedGlobals = makeMap(
  1873. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  1874. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  1875. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  1876. 'require' // for Webpack/Browserify
  1877. );
  1878. hasProxy =
  1879. typeof Proxy !== 'undefined' &&
  1880. Proxy.toString().match(/native code/);
  1881. proxyHandlers = {
  1882. has: function has (target, key) {
  1883. var has = key in target;
  1884. var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
  1885. if (!has && !isAllowed) {
  1886. warn(
  1887. "Property or method \"" + key + "\" is not defined on the instance but " +
  1888. "referenced during render. Make sure to declare reactive data " +
  1889. "properties in the data option.",
  1890. target
  1891. );
  1892. }
  1893. return has || !isAllowed
  1894. }
  1895. };
  1896. initProxy = function initProxy (vm) {
  1897. if (hasProxy) {
  1898. vm._renderProxy = new Proxy(vm, proxyHandlers);
  1899. } else {
  1900. vm._renderProxy = vm;
  1901. }
  1902. };
  1903. }
  1904. /* */
  1905. var uid$2 = 0;
  1906. /**
  1907. * A dep is an observable that can have multiple
  1908. * directives subscribing to it.
  1909. */
  1910. var Dep = function Dep () {
  1911. this.id = uid$2++;
  1912. this.subs = [];
  1913. };
  1914. Dep.prototype.addSub = function addSub (sub) {
  1915. this.subs.push(sub);
  1916. };
  1917. Dep.prototype.removeSub = function removeSub (sub) {
  1918. remove$1(this.subs, sub);
  1919. };
  1920. Dep.prototype.depend = function depend () {
  1921. if (Dep.target) {
  1922. Dep.target.addDep(this);
  1923. }
  1924. };
  1925. Dep.prototype.notify = function notify () {
  1926. // stablize the subscriber list first
  1927. var subs = this.subs.slice();
  1928. for (var i = 0, l = subs.length; i < l; i++) {
  1929. subs[i].update();
  1930. }
  1931. };
  1932. // the current target watcher being evaluated.
  1933. // this is globally unique because there could be only one
  1934. // watcher being evaluated at any time.
  1935. Dep.target = null;
  1936. var targetStack = [];
  1937. function pushTarget (_target) {
  1938. if (Dep.target) { targetStack.push(Dep.target); }
  1939. Dep.target = _target;
  1940. }
  1941. function popTarget () {
  1942. Dep.target = targetStack.pop();
  1943. }
  1944. /* */
  1945. var queue = [];
  1946. var has$1 = {};
  1947. var circular = {};
  1948. var waiting = false;
  1949. var flushing = false;
  1950. var index = 0;
  1951. /**
  1952. * Reset the scheduler's state.
  1953. */
  1954. function resetSchedulerState () {
  1955. queue.length = 0;
  1956. has$1 = {};
  1957. if (process.env.NODE_ENV !== 'production') {
  1958. circular = {};
  1959. }
  1960. waiting = flushing = false;
  1961. }
  1962. /**
  1963. * Flush both queues and run the watchers.
  1964. */
  1965. function flushSchedulerQueue () {
  1966. flushing = true;
  1967. // Sort queue before flush.
  1968. // This ensures that:
  1969. // 1. Components are updated from parent to child. (because parent is always
  1970. // created before the child)
  1971. // 2. A component's user watchers are run before its render watcher (because
  1972. // user watchers are created before the render watcher)
  1973. // 3. If a component is destroyed during a parent component's watcher run,
  1974. // its watchers can be skipped.
  1975. queue.sort(function (a, b) { return a.id - b.id; });
  1976. // do not cache length because more watchers might be pushed
  1977. // as we run existing watchers
  1978. for (index = 0; index < queue.length; index++) {
  1979. var watcher = queue[index];
  1980. var id = watcher.id;
  1981. has$1[id] = null;
  1982. watcher.run();
  1983. // in dev build, check and stop circular updates.
  1984. if (process.env.NODE_ENV !== 'production' && has$1[id] != null) {
  1985. circular[id] = (circular[id] || 0) + 1;
  1986. if (circular[id] > config._maxUpdateCount) {
  1987. warn(
  1988. 'You may have an infinite update loop ' + (
  1989. watcher.user
  1990. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  1991. : "in a component render function."
  1992. ),
  1993. watcher.vm
  1994. );
  1995. break
  1996. }
  1997. }
  1998. }
  1999. // devtool hook
  2000. /* istanbul ignore if */
  2001. if (devtools && config.devtools) {
  2002. devtools.emit('flush');
  2003. }
  2004. resetSchedulerState();
  2005. }
  2006. /**
  2007. * Push a watcher into the watcher queue.
  2008. * Jobs with duplicate IDs will be skipped unless it's
  2009. * pushed when the queue is being flushed.
  2010. */
  2011. function queueWatcher (watcher) {
  2012. var id = watcher.id;
  2013. if (has$1[id] == null) {
  2014. has$1[id] = true;
  2015. if (!flushing) {
  2016. queue.push(watcher);
  2017. } else {
  2018. // if already flushing, splice the watcher based on its id
  2019. // if already past its id, it will be run next immediately.
  2020. var i = queue.length - 1;
  2021. while (i >= 0 && queue[i].id > watcher.id) {
  2022. i--;
  2023. }
  2024. queue.splice(Math.max(i, index) + 1, 0, watcher);
  2025. }
  2026. // queue the flush
  2027. if (!waiting) {
  2028. waiting = true;
  2029. nextTick(flushSchedulerQueue);
  2030. }
  2031. }
  2032. }
  2033. /* */
  2034. var uid$1 = 0;
  2035. /**
  2036. * A watcher parses an expression, collects dependencies,
  2037. * and fires callback when the expression value changes.
  2038. * This is used for both the $watch() api and directives.
  2039. */
  2040. var Watcher = function Watcher (
  2041. vm,
  2042. expOrFn,
  2043. cb,
  2044. options
  2045. ) {
  2046. if ( options === void 0 ) options = {};
  2047. this.vm = vm;
  2048. vm._watchers.push(this);
  2049. // options
  2050. this.deep = !!options.deep;
  2051. this.user = !!options.user;
  2052. this.lazy = !!options.lazy;
  2053. this.sync = !!options.sync;
  2054. this.expression = expOrFn.toString();
  2055. this.cb = cb;
  2056. this.id = ++uid$1; // uid for batching
  2057. this.active = true;
  2058. this.dirty = this.lazy; // for lazy watchers
  2059. this.deps = [];
  2060. this.newDeps = [];
  2061. this.depIds = new _Set();
  2062. this.newDepIds = new _Set();
  2063. // parse expression for getter
  2064. if (typeof expOrFn === 'function') {
  2065. this.getter = expOrFn;
  2066. } else {
  2067. this.getter = parsePath(expOrFn);
  2068. if (!this.getter) {
  2069. this.getter = function () {};
  2070. process.env.NODE_ENV !== 'production' && warn(
  2071. "Failed watching path: \"" + expOrFn + "\" " +
  2072. 'Watcher only accepts simple dot-delimited paths. ' +
  2073. 'For full control, use a function instead.',
  2074. vm
  2075. );
  2076. }
  2077. }
  2078. this.value = this.lazy
  2079. ? undefined
  2080. : this.get();
  2081. };
  2082. /**
  2083. * Evaluate the getter, and re-collect dependencies.
  2084. */
  2085. Watcher.prototype.get = function get () {
  2086. pushTarget(this);
  2087. var value = this.getter.call(this.vm, this.vm);
  2088. // "touch" every property so they are all tracked as
  2089. // dependencies for deep watching
  2090. if (this.deep) {
  2091. traverse(value);
  2092. }
  2093. popTarget();
  2094. this.cleanupDeps();
  2095. return value
  2096. };
  2097. /**
  2098. * Add a dependency to this directive.
  2099. */
  2100. Watcher.prototype.addDep = function addDep (dep) {
  2101. var id = dep.id;
  2102. if (!this.newDepIds.has(id)) {
  2103. this.newDepIds.add(id);
  2104. this.newDeps.push(dep);
  2105. if (!this.depIds.has(id)) {
  2106. dep.addSub(this);
  2107. }
  2108. }
  2109. };
  2110. /**
  2111. * Clean up for dependency collection.
  2112. */
  2113. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  2114. var this$1 = this;
  2115. var i = this.deps.length;
  2116. while (i--) {
  2117. var dep = this$1.deps[i];
  2118. if (!this$1.newDepIds.has(dep.id)) {
  2119. dep.removeSub(this$1);
  2120. }
  2121. }
  2122. var tmp = this.depIds;
  2123. this.depIds = this.newDepIds;
  2124. this.newDepIds = tmp;
  2125. this.newDepIds.clear();
  2126. tmp = this.deps;
  2127. this.deps = this.newDeps;
  2128. this.newDeps = tmp;
  2129. this.newDeps.length = 0;
  2130. };
  2131. /**
  2132. * Subscriber interface.
  2133. * Will be called when a dependency changes.
  2134. */
  2135. Watcher.prototype.update = function update () {
  2136. /* istanbul ignore else */
  2137. if (this.lazy) {
  2138. this.dirty = true;
  2139. } else if (this.sync) {
  2140. this.run();
  2141. } else {
  2142. queueWatcher(this);
  2143. }
  2144. };
  2145. /**
  2146. * Scheduler job interface.
  2147. * Will be called by the scheduler.
  2148. */
  2149. Watcher.prototype.run = function run () {
  2150. if (this.active) {
  2151. var value = this.get();
  2152. if (
  2153. value !== this.value ||
  2154. // Deep watchers and watchers on Object/Arrays should fire even
  2155. // when the value is the same, because the value may
  2156. // have mutated.
  2157. isObject(value) ||
  2158. this.deep
  2159. ) {
  2160. // set new value
  2161. var oldValue = this.value;
  2162. this.value = value;
  2163. if (this.user) {
  2164. try {
  2165. this.cb.call(this.vm, value, oldValue);
  2166. } catch (e) {
  2167. process.env.NODE_ENV !== 'production' && warn(
  2168. ("Error in watcher \"" + (this.expression) + "\""),
  2169. this.vm
  2170. );
  2171. /* istanbul ignore else */
  2172. if (config.errorHandler) {
  2173. config.errorHandler.call(null, e, this.vm);
  2174. } else {
  2175. throw e
  2176. }
  2177. }
  2178. } else {
  2179. this.cb.call(this.vm, value, oldValue);
  2180. }
  2181. }
  2182. }
  2183. };
  2184. /**
  2185. * Evaluate the value of the watcher.
  2186. * This only gets called for lazy watchers.
  2187. */
  2188. Watcher.prototype.evaluate = function evaluate () {
  2189. this.value = this.get();
  2190. this.dirty = false;
  2191. };
  2192. /**
  2193. * Depend on all deps collected by this watcher.
  2194. */
  2195. Watcher.prototype.depend = function depend () {
  2196. var this$1 = this;
  2197. var i = this.deps.length;
  2198. while (i--) {
  2199. this$1.deps[i].depend();
  2200. }
  2201. };
  2202. /**
  2203. * Remove self from all dependencies' subcriber list.
  2204. */
  2205. Watcher.prototype.teardown = function teardown () {
  2206. var this$1 = this;
  2207. if (this.active) {
  2208. // remove self from vm's watcher list
  2209. // this is a somewhat expensive operation so we skip it
  2210. // if the vm is being destroyed or is performing a v-for
  2211. // re-render (the watcher list is then filtered by v-for).
  2212. if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {
  2213. remove$1(this.vm._watchers, this);
  2214. }
  2215. var i = this.deps.length;
  2216. while (i--) {
  2217. this$1.deps[i].removeSub(this$1);
  2218. }
  2219. this.active = false;
  2220. }
  2221. };
  2222. /**
  2223. * Recursively traverse an object to evoke all converted
  2224. * getters, so that every nested property inside the object
  2225. * is collected as a "deep" dependency.
  2226. */
  2227. var seenObjects = new _Set();
  2228. function traverse (val, seen) {
  2229. var i, keys;
  2230. if (!seen) {
  2231. seen = seenObjects;
  2232. seen.clear();
  2233. }
  2234. var isA = Array.isArray(val);
  2235. var isO = isObject(val);
  2236. if ((isA || isO) && Object.isExtensible(val)) {
  2237. if (val.__ob__) {
  2238. var depId = val.__ob__.dep.id;
  2239. if (seen.has(depId)) {
  2240. return
  2241. } else {
  2242. seen.add(depId);
  2243. }
  2244. }
  2245. if (isA) {
  2246. i = val.length;
  2247. while (i--) { traverse(val[i], seen); }
  2248. } else if (isO) {
  2249. keys = Object.keys(val);
  2250. i = keys.length;
  2251. while (i--) { traverse(val[keys[i]], seen); }
  2252. }
  2253. }
  2254. }
  2255. /*
  2256. * not type checking this file because flow doesn't play well with
  2257. * dynamically accessing methods on Array prototype
  2258. */
  2259. var arrayProto = Array.prototype;
  2260. var arrayMethods = Object.create(arrayProto);[
  2261. 'push',
  2262. 'pop',
  2263. 'shift',
  2264. 'unshift',
  2265. 'splice',
  2266. 'sort',
  2267. 'reverse'
  2268. ]
  2269. .forEach(function (method) {
  2270. // cache original method
  2271. var original = arrayProto[method];
  2272. def(arrayMethods, method, function mutator () {
  2273. var arguments$1 = arguments;
  2274. // avoid leaking arguments:
  2275. // http://jsperf.com/closure-with-arguments
  2276. var i = arguments.length;
  2277. var args = new Array(i);
  2278. while (i--) {
  2279. args[i] = arguments$1[i];
  2280. }
  2281. var result = original.apply(this, args);
  2282. var ob = this.__ob__;
  2283. var inserted;
  2284. switch (method) {
  2285. case 'push':
  2286. inserted = args;
  2287. break
  2288. case 'unshift':
  2289. inserted = args;
  2290. break
  2291. case 'splice':
  2292. inserted = args.slice(2);
  2293. break
  2294. }
  2295. if (inserted) { ob.observeArray(inserted); }
  2296. // notify change
  2297. ob.dep.notify();
  2298. return result
  2299. });
  2300. });
  2301. /* */
  2302. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2303. /**
  2304. * By default, when a reactive property is set, the new value is
  2305. * also converted to become reactive. However when passing down props,
  2306. * we don't want to force conversion because the value may be a nested value
  2307. * under a frozen data structure. Converting it would defeat the optimization.
  2308. */
  2309. var observerState = {
  2310. shouldConvert: true,
  2311. isSettingProps: false
  2312. };
  2313. /**
  2314. * Observer class that are attached to each observed
  2315. * object. Once attached, the observer converts target
  2316. * object's property keys into getter/setters that
  2317. * collect dependencies and dispatches updates.
  2318. */
  2319. var Observer = function Observer (value) {
  2320. this.value = value;
  2321. this.dep = new Dep();
  2322. this.vmCount = 0;
  2323. def(value, '__ob__', this);
  2324. if (Array.isArray(value)) {
  2325. var augment = hasProto
  2326. ? protoAugment
  2327. : copyAugment;
  2328. augment(value, arrayMethods, arrayKeys);
  2329. this.observeArray(value);
  2330. } else {
  2331. this.walk(value);
  2332. }
  2333. };
  2334. /**
  2335. * Walk through each property and convert them into
  2336. * getter/setters. This method should only be called when
  2337. * value type is Object.
  2338. */
  2339. Observer.prototype.walk = function walk (obj) {
  2340. var keys = Object.keys(obj);
  2341. for (var i = 0; i < keys.length; i++) {
  2342. defineReactive$$1(obj, keys[i], obj[keys[i]]);
  2343. }
  2344. };
  2345. /**
  2346. * Observe a list of Array items.
  2347. */
  2348. Observer.prototype.observeArray = function observeArray (items) {
  2349. for (var i = 0, l = items.length; i < l; i++) {
  2350. observe(items[i]);
  2351. }
  2352. };
  2353. // helpers
  2354. /**
  2355. * Augment an target Object or Array by intercepting
  2356. * the prototype chain using __proto__
  2357. */
  2358. function protoAugment (target, src) {
  2359. /* eslint-disable no-proto */
  2360. target.__proto__ = src;
  2361. /* eslint-enable no-proto */
  2362. }
  2363. /**
  2364. * Augment an target Object or Array by defining
  2365. * hidden properties.
  2366. *
  2367. * istanbul ignore next
  2368. */
  2369. function copyAugment (target, src, keys) {
  2370. for (var i = 0, l = keys.length; i < l; i++) {
  2371. var key = keys[i];
  2372. def(target, key, src[key]);
  2373. }
  2374. }
  2375. /**
  2376. * Attempt to create an observer instance for a value,
  2377. * returns the new observer if successfully observed,
  2378. * or the existing observer if the value already has one.
  2379. */
  2380. function observe (value) {
  2381. if (!isObject(value)) {
  2382. return
  2383. }
  2384. var ob;
  2385. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2386. ob = value.__ob__;
  2387. } else if (
  2388. observerState.shouldConvert &&
  2389. !config._isServer &&
  2390. (Array.isArray(value) || isPlainObject(value)) &&
  2391. Object.isExtensible(value) &&
  2392. !value._isVue
  2393. ) {
  2394. ob = new Observer(value);
  2395. }
  2396. return ob
  2397. }
  2398. /**
  2399. * Define a reactive property on an Object.
  2400. */
  2401. function defineReactive$$1 (
  2402. obj,
  2403. key,
  2404. val,
  2405. customSetter
  2406. ) {
  2407. var dep = new Dep();
  2408. var property = Object.getOwnPropertyDescriptor(obj, key);
  2409. if (property && property.configurable === false) {
  2410. return
  2411. }
  2412. // cater for pre-defined getter/setters
  2413. var getter = property && property.get;
  2414. var setter = property && property.set;
  2415. var childOb = observe(val);
  2416. Object.defineProperty(obj, key, {
  2417. enumerable: true,
  2418. configurable: true,
  2419. get: function reactiveGetter () {
  2420. var value = getter ? getter.call(obj) : val;
  2421. if (Dep.target) {
  2422. dep.depend();
  2423. if (childOb) {
  2424. childOb.dep.depend();
  2425. }
  2426. if (Array.isArray(value)) {
  2427. dependArray(value);
  2428. }
  2429. }
  2430. return value
  2431. },
  2432. set: function reactiveSetter (newVal) {
  2433. var value = getter ? getter.call(obj) : val;
  2434. if (newVal === value) {
  2435. return
  2436. }
  2437. if (process.env.NODE_ENV !== 'production' && customSetter) {
  2438. customSetter();
  2439. }
  2440. if (setter) {
  2441. setter.call(obj, newVal);
  2442. } else {
  2443. val = newVal;
  2444. }
  2445. childOb = observe(newVal);
  2446. dep.notify();
  2447. }
  2448. });
  2449. }
  2450. /**
  2451. * Set a property on an object. Adds the new property and
  2452. * triggers change notification if the property doesn't
  2453. * already exist.
  2454. */
  2455. function set (obj, key, val) {
  2456. if (Array.isArray(obj)) {
  2457. obj.splice(key, 1, val);
  2458. return val
  2459. }
  2460. if (hasOwn(obj, key)) {
  2461. obj[key] = val;
  2462. return
  2463. }
  2464. var ob = obj.__ob__;
  2465. if (obj._isVue || (ob && ob.vmCount)) {
  2466. process.env.NODE_ENV !== 'production' && warn(
  2467. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2468. 'at runtime - declare it upfront in the data option.'
  2469. );
  2470. return
  2471. }
  2472. if (!ob) {
  2473. obj[key] = val;
  2474. return
  2475. }
  2476. defineReactive$$1(ob.value, key, val);
  2477. ob.dep.notify();
  2478. return val
  2479. }
  2480. /**
  2481. * Delete a property and trigger change if necessary.
  2482. */
  2483. function del (obj, key) {
  2484. var ob = obj.__ob__;
  2485. if (obj._isVue || (ob && ob.vmCount)) {
  2486. process.env.NODE_ENV !== 'production' && warn(
  2487. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2488. '- just set it to null.'
  2489. );
  2490. return
  2491. }
  2492. if (!hasOwn(obj, key)) {
  2493. return
  2494. }
  2495. delete obj[key];
  2496. if (!ob) {
  2497. return
  2498. }
  2499. ob.dep.notify();
  2500. }
  2501. /**
  2502. * Collect dependencies on array elements when the array is touched, since
  2503. * we cannot intercept array element access like property getters.
  2504. */
  2505. function dependArray (value) {
  2506. for (var e = void 0, i = 0, l = value.length; i < l; i++) {
  2507. e = value[i];
  2508. e && e.__ob__ && e.__ob__.dep.depend();
  2509. if (Array.isArray(e)) {
  2510. dependArray(e);
  2511. }
  2512. }
  2513. }
  2514. /* */
  2515. function initState (vm) {
  2516. vm._watchers = [];
  2517. initProps(vm);
  2518. initData(vm);
  2519. initComputed(vm);
  2520. initMethods(vm);
  2521. initWatch(vm);
  2522. }
  2523. function initProps (vm) {
  2524. var props = vm.$options.props;
  2525. if (props) {
  2526. var propsData = vm.$options.propsData || {};
  2527. var keys = vm.$options._propKeys = Object.keys(props);
  2528. var isRoot = !vm.$parent;
  2529. // root instance props should be converted
  2530. observerState.shouldConvert = isRoot;
  2531. var loop = function ( i ) {
  2532. var key = keys[i];
  2533. /* istanbul ignore else */
  2534. if (process.env.NODE_ENV !== 'production') {
  2535. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {
  2536. if (vm.$parent && !observerState.isSettingProps) {
  2537. warn(
  2538. "Avoid mutating a prop directly since the value will be " +
  2539. "overwritten whenever the parent component re-renders. " +
  2540. "Instead, use a data or computed property based on the prop's " +
  2541. "value. Prop being mutated: \"" + key + "\"",
  2542. vm
  2543. );
  2544. }
  2545. });
  2546. } else {
  2547. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm));
  2548. }
  2549. };
  2550. for (var i = 0; i < keys.length; i++) loop( i );
  2551. observerState.shouldConvert = true;
  2552. }
  2553. }
  2554. function initData (vm) {
  2555. var data = vm.$options.data;
  2556. data = vm._data = typeof data === 'function'
  2557. ? data.call(vm)
  2558. : data || {};
  2559. if (!isPlainObject(data)) {
  2560. data = {};
  2561. process.env.NODE_ENV !== 'production' && warn(
  2562. 'data functions should return an object.',
  2563. vm
  2564. );
  2565. }
  2566. // proxy data on instance
  2567. var keys = Object.keys(data);
  2568. var props = vm.$options.props;
  2569. var i = keys.length;
  2570. while (i--) {
  2571. if (props && hasOwn(props, keys[i])) {
  2572. process.env.NODE_ENV !== 'production' && warn(
  2573. "The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
  2574. "Use prop default value instead.",
  2575. vm
  2576. );
  2577. } else {
  2578. proxy(vm, keys[i]);
  2579. }
  2580. }
  2581. // observe data
  2582. observe(data);
  2583. data.__ob__ && data.__ob__.vmCount++;
  2584. }
  2585. var computedSharedDefinition = {
  2586. enumerable: true,
  2587. configurable: true,
  2588. get: noop,
  2589. set: noop
  2590. };
  2591. function initComputed (vm) {
  2592. var computed = vm.$options.computed;
  2593. if (computed) {
  2594. for (var key in computed) {
  2595. var userDef = computed[key];
  2596. if (typeof userDef === 'function') {
  2597. computedSharedDefinition.get = makeComputedGetter(userDef, vm);
  2598. computedSharedDefinition.set = noop;
  2599. } else {
  2600. computedSharedDefinition.get = userDef.get
  2601. ? userDef.cache !== false
  2602. ? makeComputedGetter(userDef.get, vm)
  2603. : bind$1(userDef.get, vm)
  2604. : noop;
  2605. computedSharedDefinition.set = userDef.set
  2606. ? bind$1(userDef.set, vm)
  2607. : noop;
  2608. }
  2609. Object.defineProperty(vm, key, computedSharedDefinition);
  2610. }
  2611. }
  2612. }
  2613. function makeComputedGetter (getter, owner) {
  2614. var watcher = new Watcher(owner, getter, noop, {
  2615. lazy: true
  2616. });
  2617. return function computedGetter () {
  2618. if (watcher.dirty) {
  2619. watcher.evaluate();
  2620. }
  2621. if (Dep.target) {
  2622. watcher.depend();
  2623. }
  2624. return watcher.value
  2625. }
  2626. }
  2627. function initMethods (vm) {
  2628. var methods = vm.$options.methods;
  2629. if (methods) {
  2630. for (var key in methods) {
  2631. vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);
  2632. if (process.env.NODE_ENV !== 'production' && methods[key] == null) {
  2633. warn(
  2634. "method \"" + key + "\" has an undefined value in the component definition. " +
  2635. "Did you reference the function correctly?",
  2636. vm
  2637. );
  2638. }
  2639. }
  2640. }
  2641. }
  2642. function initWatch (vm) {
  2643. var watch = vm.$options.watch;
  2644. if (watch) {
  2645. for (var key in watch) {
  2646. var handler = watch[key];
  2647. if (Array.isArray(handler)) {
  2648. for (var i = 0; i < handler.length; i++) {
  2649. createWatcher(vm, key, handler[i]);
  2650. }
  2651. } else {
  2652. createWatcher(vm, key, handler);
  2653. }
  2654. }
  2655. }
  2656. }
  2657. function createWatcher (vm, key, handler) {
  2658. var options;
  2659. if (isPlainObject(handler)) {
  2660. options = handler;
  2661. handler = handler.handler;
  2662. }
  2663. if (typeof handler === 'string') {
  2664. handler = vm[handler];
  2665. }
  2666. vm.$watch(key, handler, options);
  2667. }
  2668. function stateMixin (Vue) {
  2669. // flow somehow has problems with directly declared definition object
  2670. // when using Object.defineProperty, so we have to procedurally build up
  2671. // the object here.
  2672. var dataDef = {};
  2673. dataDef.get = function () {
  2674. return this._data
  2675. };
  2676. if (process.env.NODE_ENV !== 'production') {
  2677. dataDef.set = function (newData) {
  2678. warn(
  2679. 'Avoid replacing instance root $data. ' +
  2680. 'Use nested data properties instead.',
  2681. this
  2682. );
  2683. };
  2684. }
  2685. Object.defineProperty(Vue.prototype, '$data', dataDef);
  2686. Vue.prototype.$set = set;
  2687. Vue.prototype.$delete = del;
  2688. Vue.prototype.$watch = function (
  2689. expOrFn,
  2690. cb,
  2691. options
  2692. ) {
  2693. var vm = this;
  2694. options = options || {};
  2695. options.user = true;
  2696. var watcher = new Watcher(vm, expOrFn, cb, options);
  2697. if (options.immediate) {
  2698. cb.call(vm, watcher.value);
  2699. }
  2700. return function unwatchFn () {
  2701. watcher.teardown();
  2702. }
  2703. };
  2704. }
  2705. function proxy (vm, key) {
  2706. if (!isReserved(key)) {
  2707. Object.defineProperty(vm, key, {
  2708. configurable: true,
  2709. enumerable: true,
  2710. get: function proxyGetter () {
  2711. return vm._data[key]
  2712. },
  2713. set: function proxySetter (val) {
  2714. vm._data[key] = val;
  2715. }
  2716. });
  2717. }
  2718. }
  2719. /* */
  2720. var VNode = function VNode (
  2721. tag,
  2722. data,
  2723. children,
  2724. text,
  2725. elm,
  2726. ns,
  2727. context,
  2728. componentOptions
  2729. ) {
  2730. this.tag = tag;
  2731. this.data = data;
  2732. this.children = children;
  2733. this.text = text;
  2734. this.elm = elm;
  2735. this.ns = ns;
  2736. this.context = context;
  2737. this.functionalContext = undefined;
  2738. this.key = data && data.key;
  2739. this.componentOptions = componentOptions;
  2740. this.child = undefined;
  2741. this.parent = undefined;
  2742. this.raw = false;
  2743. this.isStatic = false;
  2744. this.isRootInsert = true;
  2745. this.isComment = false;
  2746. this.isCloned = false;
  2747. };
  2748. var emptyVNode = function () {
  2749. var node = new VNode();
  2750. node.text = '';
  2751. node.isComment = true;
  2752. return node
  2753. };
  2754. // optimized shallow clone
  2755. // used for static nodes and slot nodes because they may be reused across
  2756. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2757. // on their elm reference.
  2758. function cloneVNode (vnode) {
  2759. var cloned = new VNode(
  2760. vnode.tag,
  2761. vnode.data,
  2762. vnode.children,
  2763. vnode.text,
  2764. vnode.elm,
  2765. vnode.ns,
  2766. vnode.context,
  2767. vnode.componentOptions
  2768. );
  2769. cloned.isStatic = vnode.isStatic;
  2770. cloned.key = vnode.key;
  2771. cloned.isCloned = true;
  2772. return cloned
  2773. }
  2774. function cloneVNodes (vnodes) {
  2775. var res = new Array(vnodes.length);
  2776. for (var i = 0; i < vnodes.length; i++) {
  2777. res[i] = cloneVNode(vnodes[i]);
  2778. }
  2779. return res
  2780. }
  2781. /* */
  2782. function mergeVNodeHook (def, hookKey, hook, key) {
  2783. key = key + hookKey;
  2784. var injectedHash = def.__injected || (def.__injected = {});
  2785. if (!injectedHash[key]) {
  2786. injectedHash[key] = true;
  2787. var oldHook = def[hookKey];
  2788. if (oldHook) {
  2789. def[hookKey] = function () {
  2790. oldHook.apply(this, arguments);
  2791. hook.apply(this, arguments);
  2792. };
  2793. } else {
  2794. def[hookKey] = hook;
  2795. }
  2796. }
  2797. }
  2798. /* */
  2799. function updateListeners (
  2800. on,
  2801. oldOn,
  2802. add,
  2803. remove$$1,
  2804. vm
  2805. ) {
  2806. var name, cur, old, fn, event, capture;
  2807. for (name in on) {
  2808. cur = on[name];
  2809. old = oldOn[name];
  2810. if (!cur) {
  2811. process.env.NODE_ENV !== 'production' && warn(
  2812. "Invalid handler for event \"" + name + "\": got " + String(cur),
  2813. vm
  2814. );
  2815. } else if (!old) {
  2816. capture = name.charAt(0) === '!';
  2817. event = capture ? name.slice(1) : name;
  2818. if (Array.isArray(cur)) {
  2819. add(event, (cur.invoker = arrInvoker(cur)), capture);
  2820. } else {
  2821. if (!cur.invoker) {
  2822. fn = cur;
  2823. cur = on[name] = {};
  2824. cur.fn = fn;
  2825. cur.invoker = fnInvoker(cur);
  2826. }
  2827. add(event, cur.invoker, capture);
  2828. }
  2829. } else if (cur !== old) {
  2830. if (Array.isArray(old)) {
  2831. old.length = cur.length;
  2832. for (var i = 0; i < old.length; i++) { old[i] = cur[i]; }
  2833. on[name] = old;
  2834. } else {
  2835. old.fn = cur;
  2836. on[name] = old;
  2837. }
  2838. }
  2839. }
  2840. for (name in oldOn) {
  2841. if (!on[name]) {
  2842. event = name.charAt(0) === '!' ? name.slice(1) : name;
  2843. remove$$1(event, oldOn[name].invoker);
  2844. }
  2845. }
  2846. }
  2847. function arrInvoker (arr) {
  2848. return function (ev) {
  2849. var arguments$1 = arguments;
  2850. var single = arguments.length === 1;
  2851. for (var i = 0; i < arr.length; i++) {
  2852. single ? arr[i](ev) : arr[i].apply(null, arguments$1);
  2853. }
  2854. }
  2855. }
  2856. function fnInvoker (o) {
  2857. return function (ev) {
  2858. var single = arguments.length === 1;
  2859. single ? o.fn(ev) : o.fn.apply(null, arguments);
  2860. }
  2861. }
  2862. /* */
  2863. function normalizeChildren (
  2864. children,
  2865. ns,
  2866. nestedIndex
  2867. ) {
  2868. if (isPrimitive(children)) {
  2869. return [createTextVNode(children)]
  2870. }
  2871. if (Array.isArray(children)) {
  2872. var res = [];
  2873. for (var i = 0, l = children.length; i < l; i++) {
  2874. var c = children[i];
  2875. var last = res[res.length - 1];
  2876. // nested
  2877. if (Array.isArray(c)) {
  2878. res.push.apply(res, normalizeChildren(c, ns, ((nestedIndex || '') + "_" + i)));
  2879. } else if (isPrimitive(c)) {
  2880. if (last && last.text) {
  2881. last.text += String(c);
  2882. } else if (c !== '') {
  2883. // convert primitive to vnode
  2884. res.push(createTextVNode(c));
  2885. }
  2886. } else if (c instanceof VNode) {
  2887. if (c.text && last && last.text) {
  2888. last.text += c.text;
  2889. } else {
  2890. // inherit parent namespace
  2891. if (ns) {
  2892. applyNS(c, ns);
  2893. }
  2894. // default key for nested array children (likely generated by v-for)
  2895. if (c.tag && c.key == null && nestedIndex != null) {
  2896. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  2897. }
  2898. res.push(c);
  2899. }
  2900. }
  2901. }
  2902. return res
  2903. }
  2904. }
  2905. function createTextVNode (val) {
  2906. return new VNode(undefined, undefined, undefined, String(val))
  2907. }
  2908. function applyNS (vnode, ns) {
  2909. if (vnode.tag && !vnode.ns) {
  2910. vnode.ns = ns;
  2911. if (vnode.children) {
  2912. for (var i = 0, l = vnode.children.length; i < l; i++) {
  2913. applyNS(vnode.children[i], ns);
  2914. }
  2915. }
  2916. }
  2917. }
  2918. /* */
  2919. function getFirstComponentChild (children) {
  2920. return children && children.filter(function (c) { return c && c.componentOptions; })[0]
  2921. }
  2922. /* */
  2923. var activeInstance = null;
  2924. function initLifecycle (vm) {
  2925. var options = vm.$options;
  2926. // locate first non-abstract parent
  2927. var parent = options.parent;
  2928. if (parent && !options.abstract) {
  2929. while (parent.$options.abstract && parent.$parent) {
  2930. parent = parent.$parent;
  2931. }
  2932. parent.$children.push(vm);
  2933. }
  2934. vm.$parent = parent;
  2935. vm.$root = parent ? parent.$root : vm;
  2936. vm.$children = [];
  2937. vm.$refs = {};
  2938. vm._watcher = null;
  2939. vm._inactive = false;
  2940. vm._isMounted = false;
  2941. vm._isDestroyed = false;
  2942. vm._isBeingDestroyed = false;
  2943. }
  2944. function lifecycleMixin (Vue) {
  2945. Vue.prototype._mount = function (
  2946. el,
  2947. hydrating
  2948. ) {
  2949. var vm = this;
  2950. vm.$el = el;
  2951. if (!vm.$options.render) {
  2952. vm.$options.render = emptyVNode;
  2953. if (process.env.NODE_ENV !== 'production') {
  2954. /* istanbul ignore if */
  2955. if (vm.$options.template) {
  2956. warn(
  2957. 'You are using the runtime-only build of Vue where the template ' +
  2958. 'option is not available. Either pre-compile the templates into ' +
  2959. 'render functions, or use the compiler-included build.',
  2960. vm
  2961. );
  2962. } else {
  2963. warn(
  2964. 'Failed to mount component: template or render function not defined.',
  2965. vm
  2966. );
  2967. }
  2968. }
  2969. }
  2970. callHook(vm, 'beforeMount');
  2971. vm._watcher = new Watcher(vm, function () {
  2972. vm._update(vm._render(), hydrating);
  2973. }, noop);
  2974. hydrating = false;
  2975. // manually mounted instance, call mounted on self
  2976. // mounted is called for render-created child components in its inserted hook
  2977. if (vm.$vnode == null) {
  2978. vm._isMounted = true;
  2979. callHook(vm, 'mounted');
  2980. }
  2981. return vm
  2982. };
  2983. Vue.prototype._update = function (vnode, hydrating) {
  2984. var vm = this;
  2985. if (vm._isMounted) {
  2986. callHook(vm, 'beforeUpdate');
  2987. }
  2988. var prevEl = vm.$el;
  2989. var prevActiveInstance = activeInstance;
  2990. activeInstance = vm;
  2991. var prevVnode = vm._vnode;
  2992. vm._vnode = vnode;
  2993. if (!prevVnode) {
  2994. // Vue.prototype.__patch__ is injected in entry points
  2995. // based on the rendering backend used.
  2996. vm.$el = vm.__patch__(vm.$el, vnode, hydrating);
  2997. } else {
  2998. vm.$el = vm.__patch__(prevVnode, vnode);
  2999. }
  3000. activeInstance = prevActiveInstance;
  3001. // update __vue__ reference
  3002. if (prevEl) {
  3003. prevEl.__vue__ = null;
  3004. }
  3005. if (vm.$el) {
  3006. vm.$el.__vue__ = vm;
  3007. }
  3008. // if parent is an HOC, update its $el as well
  3009. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  3010. vm.$parent.$el = vm.$el;
  3011. }
  3012. if (vm._isMounted) {
  3013. callHook(vm, 'updated');
  3014. }
  3015. };
  3016. Vue.prototype._updateFromParent = function (
  3017. propsData,
  3018. listeners,
  3019. parentVnode,
  3020. renderChildren
  3021. ) {
  3022. var vm = this;
  3023. var hasChildren = !!(vm.$options._renderChildren || renderChildren);
  3024. vm.$options._parentVnode = parentVnode;
  3025. vm.$options._renderChildren = renderChildren;
  3026. // update props
  3027. if (propsData && vm.$options.props) {
  3028. observerState.shouldConvert = false;
  3029. if (process.env.NODE_ENV !== 'production') {
  3030. observerState.isSettingProps = true;
  3031. }
  3032. var propKeys = vm.$options._propKeys || [];
  3033. for (var i = 0; i < propKeys.length; i++) {
  3034. var key = propKeys[i];
  3035. vm[key] = validateProp(key, vm.$options.props, propsData, vm);
  3036. }
  3037. observerState.shouldConvert = true;
  3038. if (process.env.NODE_ENV !== 'production') {
  3039. observerState.isSettingProps = false;
  3040. }
  3041. }
  3042. // update listeners
  3043. if (listeners) {
  3044. var oldListeners = vm.$options._parentListeners;
  3045. vm.$options._parentListeners = listeners;
  3046. vm._updateListeners(listeners, oldListeners);
  3047. }
  3048. // resolve slots + force update if has children
  3049. if (hasChildren) {
  3050. vm.$slots = resolveSlots(renderChildren, vm._renderContext);
  3051. vm.$forceUpdate();
  3052. }
  3053. };
  3054. Vue.prototype.$forceUpdate = function () {
  3055. var vm = this;
  3056. if (vm._watcher) {
  3057. vm._watcher.update();
  3058. }
  3059. };
  3060. Vue.prototype.$destroy = function () {
  3061. var vm = this;
  3062. if (vm._isBeingDestroyed) {
  3063. return
  3064. }
  3065. callHook(vm, 'beforeDestroy');
  3066. vm._isBeingDestroyed = true;
  3067. // remove self from parent
  3068. var parent = vm.$parent;
  3069. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  3070. remove$1(parent.$children, vm);
  3071. }
  3072. // teardown watchers
  3073. if (vm._watcher) {
  3074. vm._watcher.teardown();
  3075. }
  3076. var i = vm._watchers.length;
  3077. while (i--) {
  3078. vm._watchers[i].teardown();
  3079. }
  3080. // remove reference from data ob
  3081. // frozen object may not have observer.
  3082. if (vm._data.__ob__) {
  3083. vm._data.__ob__.vmCount--;
  3084. }
  3085. // call the last hook...
  3086. vm._isDestroyed = true;
  3087. callHook(vm, 'destroyed');
  3088. // turn off all instance listeners.
  3089. vm.$off();
  3090. // remove __vue__ reference
  3091. if (vm.$el) {
  3092. vm.$el.__vue__ = null;
  3093. }
  3094. // invoke destroy hooks on current rendered tree
  3095. vm.__patch__(vm._vnode, null);
  3096. };
  3097. }
  3098. function callHook (vm, hook) {
  3099. var handlers = vm.$options[hook];
  3100. if (handlers) {
  3101. for (var i = 0, j = handlers.length; i < j; i++) {
  3102. handlers[i].call(vm);
  3103. }
  3104. }
  3105. vm.$emit('hook:' + hook);
  3106. }
  3107. /* */
  3108. var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };
  3109. var hooksToMerge = Object.keys(hooks);
  3110. function createComponent (
  3111. Ctor,
  3112. data,
  3113. context,
  3114. children,
  3115. tag
  3116. ) {
  3117. if (!Ctor) {
  3118. return
  3119. }
  3120. if (isObject(Ctor)) {
  3121. Ctor = Vue$2.extend(Ctor);
  3122. }
  3123. if (typeof Ctor !== 'function') {
  3124. if (process.env.NODE_ENV !== 'production') {
  3125. warn(("Invalid Component definition: " + (String(Ctor))), context);
  3126. }
  3127. return
  3128. }
  3129. // async component
  3130. if (!Ctor.cid) {
  3131. if (Ctor.resolved) {
  3132. Ctor = Ctor.resolved;
  3133. } else {
  3134. Ctor = resolveAsyncComponent(Ctor, function () {
  3135. // it's ok to queue this on every render because
  3136. // $forceUpdate is buffered by the scheduler.
  3137. context.$forceUpdate();
  3138. });
  3139. if (!Ctor) {
  3140. // return nothing if this is indeed an async component
  3141. // wait for the callback to trigger parent update.
  3142. return
  3143. }
  3144. }
  3145. }
  3146. data = data || {};
  3147. // extract props
  3148. var propsData = extractProps(data, Ctor);
  3149. // functional component
  3150. if (Ctor.options.functional) {
  3151. return createFunctionalComponent(Ctor, propsData, data, context, children)
  3152. }
  3153. // extract listeners, since these needs to be treated as
  3154. // child component listeners instead of DOM listeners
  3155. var listeners = data.on;
  3156. // replace with listeners with .native modifier
  3157. data.on = data.nativeOn;
  3158. if (Ctor.options.abstract) {
  3159. // abstract components do not keep anything
  3160. // other than props & listeners
  3161. data = {};
  3162. }
  3163. // merge component management hooks onto the placeholder node
  3164. mergeHooks(data);
  3165. // return a placeholder vnode
  3166. var name = Ctor.options.name || tag;
  3167. var vnode = new VNode(
  3168. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  3169. data, undefined, undefined, undefined, undefined, context,
  3170. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
  3171. );
  3172. return vnode
  3173. }
  3174. function createFunctionalComponent (
  3175. Ctor,
  3176. propsData,
  3177. data,
  3178. context,
  3179. children
  3180. ) {
  3181. var props = {};
  3182. var propOptions = Ctor.options.props;
  3183. if (propOptions) {
  3184. for (var key in propOptions) {
  3185. props[key] = validateProp(key, propOptions, propsData);
  3186. }
  3187. }
  3188. var vnode = Ctor.options.render.call(
  3189. null,
  3190. // ensure the createElement function in functional components
  3191. // gets a unique context - this is necessary for correct named slot check
  3192. bind$1(createElement, { _self: Object.create(context) }),
  3193. {
  3194. props: props,
  3195. data: data,
  3196. parent: context,
  3197. children: normalizeChildren(children),
  3198. slots: function () { return resolveSlots(children, context); }
  3199. }
  3200. );
  3201. if (vnode instanceof VNode) {
  3202. vnode.functionalContext = context;
  3203. if (data.slot) {
  3204. (vnode.data || (vnode.data = {})).slot = data.slot;
  3205. }
  3206. }
  3207. return vnode
  3208. }
  3209. function createComponentInstanceForVnode (
  3210. vnode, // we know it's MountedComponentVNode but flow doesn't
  3211. parent // activeInstance in lifecycle state
  3212. ) {
  3213. var vnodeComponentOptions = vnode.componentOptions;
  3214. var options = {
  3215. _isComponent: true,
  3216. parent: parent,
  3217. propsData: vnodeComponentOptions.propsData,
  3218. _componentTag: vnodeComponentOptions.tag,
  3219. _parentVnode: vnode,
  3220. _parentListeners: vnodeComponentOptions.listeners,
  3221. _renderChildren: vnodeComponentOptions.children
  3222. };
  3223. // check inline-template render functions
  3224. var inlineTemplate = vnode.data.inlineTemplate;
  3225. if (inlineTemplate) {
  3226. options.render = inlineTemplate.render;
  3227. options.staticRenderFns = inlineTemplate.staticRenderFns;
  3228. }
  3229. return new vnodeComponentOptions.Ctor(options)
  3230. }
  3231. function init (vnode, hydrating) {
  3232. if (!vnode.child || vnode.child._isDestroyed) {
  3233. var child = vnode.child = createComponentInstanceForVnode(vnode, activeInstance);
  3234. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  3235. }
  3236. }
  3237. function prepatch (
  3238. oldVnode,
  3239. vnode
  3240. ) {
  3241. var options = vnode.componentOptions;
  3242. var child = vnode.child = oldVnode.child;
  3243. child._updateFromParent(
  3244. options.propsData, // updated props
  3245. options.listeners, // updated listeners
  3246. vnode, // new parent vnode
  3247. options.children // new children
  3248. );
  3249. }
  3250. function insert (vnode) {
  3251. if (!vnode.child._isMounted) {
  3252. vnode.child._isMounted = true;
  3253. callHook(vnode.child, 'mounted');
  3254. }
  3255. if (vnode.data.keepAlive) {
  3256. vnode.child._inactive = false;
  3257. callHook(vnode.child, 'activated');
  3258. }
  3259. }
  3260. function destroy$1 (vnode) {
  3261. if (!vnode.child._isDestroyed) {
  3262. if (!vnode.data.keepAlive) {
  3263. vnode.child.$destroy();
  3264. } else {
  3265. vnode.child._inactive = true;
  3266. callHook(vnode.child, 'deactivated');
  3267. }
  3268. }
  3269. }
  3270. function resolveAsyncComponent (
  3271. factory,
  3272. cb
  3273. ) {
  3274. if (factory.requested) {
  3275. // pool callbacks
  3276. factory.pendingCallbacks.push(cb);
  3277. } else {
  3278. factory.requested = true;
  3279. var cbs = factory.pendingCallbacks = [cb];
  3280. var sync = true;
  3281. var resolve = function (res) {
  3282. if (isObject(res)) {
  3283. res = Vue$2.extend(res);
  3284. }
  3285. // cache resolved
  3286. factory.resolved = res;
  3287. // invoke callbacks only if this is not a synchronous resolve
  3288. // (async resolves are shimmed as synchronous during SSR)
  3289. if (!sync) {
  3290. for (var i = 0, l = cbs.length; i < l; i++) {
  3291. cbs[i](res);
  3292. }
  3293. }
  3294. };
  3295. var reject = function (reason) {
  3296. process.env.NODE_ENV !== 'production' && warn(
  3297. "Failed to resolve async component: " + (String(factory)) +
  3298. (reason ? ("\nReason: " + reason) : '')
  3299. );
  3300. };
  3301. var res = factory(resolve, reject);
  3302. // handle promise
  3303. if (res && typeof res.then === 'function' && !factory.resolved) {
  3304. res.then(resolve, reject);
  3305. }
  3306. sync = false;
  3307. // return in case resolved synchronously
  3308. return factory.resolved
  3309. }
  3310. }
  3311. function extractProps (data, Ctor) {
  3312. // we are only extrating raw values here.
  3313. // validation and default values are handled in the child
  3314. // component itself.
  3315. var propOptions = Ctor.options.props;
  3316. if (!propOptions) {
  3317. return
  3318. }
  3319. var res = {};
  3320. var attrs = data.attrs;
  3321. var props = data.props;
  3322. var domProps = data.domProps;
  3323. if (attrs || props || domProps) {
  3324. for (var key in propOptions) {
  3325. var altKey = hyphenate(key);
  3326. checkProp(res, props, key, altKey, true) ||
  3327. checkProp(res, attrs, key, altKey) ||
  3328. checkProp(res, domProps, key, altKey);
  3329. }
  3330. }
  3331. return res
  3332. }
  3333. function checkProp (
  3334. res,
  3335. hash,
  3336. key,
  3337. altKey,
  3338. preserve
  3339. ) {
  3340. if (hash) {
  3341. if (hasOwn(hash, key)) {
  3342. res[key] = hash[key];
  3343. if (!preserve) {
  3344. delete hash[key];
  3345. }
  3346. return true
  3347. } else if (hasOwn(hash, altKey)) {
  3348. res[key] = hash[altKey];
  3349. if (!preserve) {
  3350. delete hash[altKey];
  3351. }
  3352. return true
  3353. }
  3354. }
  3355. return false
  3356. }
  3357. function mergeHooks (data) {
  3358. if (!data.hook) {
  3359. data.hook = {};
  3360. }
  3361. for (var i = 0; i < hooksToMerge.length; i++) {
  3362. var key = hooksToMerge[i];
  3363. var fromParent = data.hook[key];
  3364. var ours = hooks[key];
  3365. data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
  3366. }
  3367. }
  3368. function mergeHook$1 (a, b) {
  3369. // since all hooks have at most two args, use fixed args
  3370. // to avoid having to use fn.apply().
  3371. return function (_, __) {
  3372. a(_, __);
  3373. b(_, __);
  3374. }
  3375. }
  3376. /* */
  3377. // wrapper function for providing a more flexible interface
  3378. // without getting yelled at by flow
  3379. function createElement (
  3380. tag,
  3381. data,
  3382. children
  3383. ) {
  3384. if (data && (Array.isArray(data) || typeof data !== 'object')) {
  3385. children = data;
  3386. data = undefined;
  3387. }
  3388. // make sure to use real instance instead of proxy as context
  3389. return _createElement(this._self, tag, data, children)
  3390. }
  3391. function _createElement (
  3392. context,
  3393. tag,
  3394. data,
  3395. children
  3396. ) {
  3397. if (data && data.__ob__) {
  3398. process.env.NODE_ENV !== 'production' && warn(
  3399. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  3400. 'Always create fresh vnode data objects in each render!',
  3401. context
  3402. );
  3403. return
  3404. }
  3405. if (!tag) {
  3406. // in case of component :is set to falsy value
  3407. return emptyVNode()
  3408. }
  3409. if (typeof tag === 'string') {
  3410. var Ctor;
  3411. var ns = config.getTagNamespace(tag);
  3412. if (config.isReservedTag(tag)) {
  3413. // platform built-in elements
  3414. return new VNode(
  3415. tag, data, normalizeChildren(children, ns),
  3416. undefined, undefined, ns, context
  3417. )
  3418. } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {
  3419. // component
  3420. return createComponent(Ctor, data, context, children, tag)
  3421. } else {
  3422. // unknown or unlisted namespaced elements
  3423. // check at runtime because it may get assigned a namespace when its
  3424. // parent normalizes children
  3425. return new VNode(
  3426. tag, data, normalizeChildren(children, ns),
  3427. undefined, undefined, ns, context
  3428. )
  3429. }
  3430. } else {
  3431. // direct component options / constructor
  3432. return createComponent(tag, data, context, children)
  3433. }
  3434. }
  3435. /* */
  3436. function initRender (vm) {
  3437. vm.$vnode = null; // the placeholder node in parent tree
  3438. vm._vnode = null; // the root of the child tree
  3439. vm._staticTrees = null;
  3440. vm._renderContext = vm.$options._parentVnode && vm.$options._parentVnode.context;
  3441. vm.$slots = resolveSlots(vm.$options._renderChildren, vm._renderContext);
  3442. // bind the public createElement fn to this instance
  3443. // so that we get proper render context inside it.
  3444. vm.$createElement = bind$1(createElement, vm);
  3445. if (vm.$options.el) {
  3446. vm.$mount(vm.$options.el);
  3447. }
  3448. }
  3449. function renderMixin (Vue) {
  3450. Vue.prototype.$nextTick = function (fn) {
  3451. nextTick(fn, this);
  3452. };
  3453. Vue.prototype._render = function () {
  3454. var vm = this;
  3455. var ref = vm.$options;
  3456. var render = ref.render;
  3457. var staticRenderFns = ref.staticRenderFns;
  3458. var _parentVnode = ref._parentVnode;
  3459. if (vm._isMounted) {
  3460. // clone slot nodes on re-renders
  3461. for (var key in vm.$slots) {
  3462. vm.$slots[key] = cloneVNodes(vm.$slots[key]);
  3463. }
  3464. }
  3465. if (staticRenderFns && !vm._staticTrees) {
  3466. vm._staticTrees = [];
  3467. }
  3468. // set parent vnode. this allows render functions to have access
  3469. // to the data on the placeholder node.
  3470. vm.$vnode = _parentVnode;
  3471. // render self
  3472. var vnode;
  3473. try {
  3474. vnode = render.call(vm._renderProxy, vm.$createElement);
  3475. } catch (e) {
  3476. if (process.env.NODE_ENV !== 'production') {
  3477. warn(("Error when rendering " + (formatComponentName(vm)) + ":"));
  3478. }
  3479. /* istanbul ignore else */
  3480. if (config.errorHandler) {
  3481. config.errorHandler.call(null, e, vm);
  3482. } else {
  3483. if (config._isServer) {
  3484. throw e
  3485. } else {
  3486. setTimeout(function () { throw e }, 0);
  3487. }
  3488. }
  3489. // return previous vnode to prevent render error causing blank component
  3490. vnode = vm._vnode;
  3491. }
  3492. // return empty vnode in case the render function errored out
  3493. if (!(vnode instanceof VNode)) {
  3494. if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
  3495. warn(
  3496. 'Multiple root nodes returned from render function. Render function ' +
  3497. 'should return a single root node.',
  3498. vm
  3499. );
  3500. }
  3501. vnode = emptyVNode();
  3502. }
  3503. // set parent
  3504. vnode.parent = _parentVnode;
  3505. return vnode
  3506. };
  3507. // shorthands used in render functions
  3508. Vue.prototype._h = createElement;
  3509. // toString for mustaches
  3510. Vue.prototype._s = _toString;
  3511. // number conversion
  3512. Vue.prototype._n = toNumber;
  3513. // empty vnode
  3514. Vue.prototype._e = emptyVNode;
  3515. // loose equal
  3516. Vue.prototype._q = looseEqual;
  3517. // loose indexOf
  3518. Vue.prototype._i = looseIndexOf;
  3519. // render static tree by index
  3520. Vue.prototype._m = function renderStatic (
  3521. index,
  3522. isInFor
  3523. ) {
  3524. var tree = this._staticTrees[index];
  3525. // if has already-rendered static tree and not inside v-for,
  3526. // we can reuse the same tree by doing a shallow clone.
  3527. if (tree && !isInFor) {
  3528. return Array.isArray(tree)
  3529. ? cloneVNodes(tree)
  3530. : cloneVNode(tree)
  3531. }
  3532. // otherwise, render a fresh tree.
  3533. tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);
  3534. if (Array.isArray(tree)) {
  3535. for (var i = 0; i < tree.length; i++) {
  3536. if (typeof tree[i] !== 'string') {
  3537. tree[i].isStatic = true;
  3538. tree[i].key = "__static__" + index + "_" + i;
  3539. }
  3540. }
  3541. } else {
  3542. tree.isStatic = true;
  3543. tree.key = "__static__" + index;
  3544. }
  3545. return tree
  3546. };
  3547. // filter resolution helper
  3548. var identity = function (_) { return _; };
  3549. Vue.prototype._f = function resolveFilter (id) {
  3550. return resolveAsset(this.$options, 'filters', id, true) || identity
  3551. };
  3552. // render v-for
  3553. Vue.prototype._l = function renderList (
  3554. val,
  3555. render
  3556. ) {
  3557. var ret, i, l, keys, key;
  3558. if (Array.isArray(val)) {
  3559. ret = new Array(val.length);
  3560. for (i = 0, l = val.length; i < l; i++) {
  3561. ret[i] = render(val[i], i);
  3562. }
  3563. } else if (typeof val === 'number') {
  3564. ret = new Array(val);
  3565. for (i = 0; i < val; i++) {
  3566. ret[i] = render(i + 1, i);
  3567. }
  3568. } else if (isObject(val)) {
  3569. keys = Object.keys(val);
  3570. ret = new Array(keys.length);
  3571. for (i = 0, l = keys.length; i < l; i++) {
  3572. key = keys[i];
  3573. ret[i] = render(val[key], key, i);
  3574. }
  3575. }
  3576. return ret
  3577. };
  3578. // renderSlot
  3579. Vue.prototype._t = function (
  3580. name,
  3581. fallback
  3582. ) {
  3583. var slotNodes = this.$slots[name];
  3584. // warn duplicate slot usage
  3585. if (slotNodes && process.env.NODE_ENV !== 'production') {
  3586. slotNodes._rendered && warn(
  3587. "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
  3588. "- this will likely cause render errors.",
  3589. this
  3590. );
  3591. slotNodes._rendered = true;
  3592. }
  3593. return slotNodes || fallback
  3594. };
  3595. // apply v-bind object
  3596. Vue.prototype._b = function bindProps (
  3597. data,
  3598. value,
  3599. asProp
  3600. ) {
  3601. if (value) {
  3602. if (!isObject(value)) {
  3603. process.env.NODE_ENV !== 'production' && warn(
  3604. 'v-bind without argument expects an Object or Array value',
  3605. this
  3606. );
  3607. } else {
  3608. if (Array.isArray(value)) {
  3609. value = toObject(value);
  3610. }
  3611. for (var key in value) {
  3612. if (key === 'class' || key === 'style') {
  3613. data[key] = value[key];
  3614. } else {
  3615. var hash = asProp || config.mustUseProp(key)
  3616. ? data.domProps || (data.domProps = {})
  3617. : data.attrs || (data.attrs = {});
  3618. hash[key] = value[key];
  3619. }
  3620. }
  3621. }
  3622. }
  3623. return data
  3624. };
  3625. // expose v-on keyCodes
  3626. Vue.prototype._k = function getKeyCodes (key) {
  3627. return config.keyCodes[key]
  3628. };
  3629. }
  3630. function resolveSlots (
  3631. renderChildren,
  3632. context
  3633. ) {
  3634. var slots = {};
  3635. if (!renderChildren) {
  3636. return slots
  3637. }
  3638. var children = normalizeChildren(renderChildren) || [];
  3639. var defaultSlot = [];
  3640. var name, child;
  3641. for (var i = 0, l = children.length; i < l; i++) {
  3642. child = children[i];
  3643. // named slots should only be respected if the vnode was rendered in the
  3644. // same context.
  3645. if ((child.context === context || child.functionalContext === context) &&
  3646. child.data && (name = child.data.slot)) {
  3647. var slot = (slots[name] || (slots[name] = []));
  3648. if (child.tag === 'template') {
  3649. slot.push.apply(slot, child.children);
  3650. } else {
  3651. slot.push(child);
  3652. }
  3653. } else {
  3654. defaultSlot.push(child);
  3655. }
  3656. }
  3657. // ignore single whitespace
  3658. if (defaultSlot.length && !(
  3659. defaultSlot.length === 1 &&
  3660. (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)
  3661. )) {
  3662. slots.default = defaultSlot;
  3663. }
  3664. return slots
  3665. }
  3666. /* */
  3667. function initEvents (vm) {
  3668. vm._events = Object.create(null);
  3669. // init parent attached events
  3670. var listeners = vm.$options._parentListeners;
  3671. var on = bind$1(vm.$on, vm);
  3672. var off = bind$1(vm.$off, vm);
  3673. vm._updateListeners = function (listeners, oldListeners) {
  3674. updateListeners(listeners, oldListeners || {}, on, off, vm);
  3675. };
  3676. if (listeners) {
  3677. vm._updateListeners(listeners);
  3678. }
  3679. }
  3680. function eventsMixin (Vue) {
  3681. Vue.prototype.$on = function (event, fn) {
  3682. var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);
  3683. return vm
  3684. };
  3685. Vue.prototype.$once = function (event, fn) {
  3686. var vm = this;
  3687. function on () {
  3688. vm.$off(event, on);
  3689. fn.apply(vm, arguments);
  3690. }
  3691. on.fn = fn;
  3692. vm.$on(event, on);
  3693. return vm
  3694. };
  3695. Vue.prototype.$off = function (event, fn) {
  3696. var vm = this;
  3697. // all
  3698. if (!arguments.length) {
  3699. vm._events = Object.create(null);
  3700. return vm
  3701. }
  3702. // specific event
  3703. var cbs = vm._events[event];
  3704. if (!cbs) {
  3705. return vm
  3706. }
  3707. if (arguments.length === 1) {
  3708. vm._events[event] = null;
  3709. return vm
  3710. }
  3711. // specific handler
  3712. var cb;
  3713. var i = cbs.length;
  3714. while (i--) {
  3715. cb = cbs[i];
  3716. if (cb === fn || cb.fn === fn) {
  3717. cbs.splice(i, 1);
  3718. break
  3719. }
  3720. }
  3721. return vm
  3722. };
  3723. Vue.prototype.$emit = function (event) {
  3724. var vm = this;
  3725. var cbs = vm._events[event];
  3726. if (cbs) {
  3727. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  3728. var args = toArray(arguments, 1);
  3729. for (var i = 0, l = cbs.length; i < l; i++) {
  3730. cbs[i].apply(vm, args);
  3731. }
  3732. }
  3733. return vm
  3734. };
  3735. }
  3736. /* */
  3737. var uid = 0;
  3738. function initMixin (Vue) {
  3739. Vue.prototype._init = function (options) {
  3740. var vm = this;
  3741. // a uid
  3742. vm._uid = uid++;
  3743. // a flag to avoid this being observed
  3744. vm._isVue = true;
  3745. // merge options
  3746. if (options && options._isComponent) {
  3747. // optimize internal component instantiation
  3748. // since dynamic options merging is pretty slow, and none of the
  3749. // internal component options needs special treatment.
  3750. initInternalComponent(vm, options);
  3751. } else {
  3752. vm.$options = mergeOptions(
  3753. resolveConstructorOptions(vm),
  3754. options || {},
  3755. vm
  3756. );
  3757. }
  3758. /* istanbul ignore else */
  3759. if (process.env.NODE_ENV !== 'production') {
  3760. initProxy(vm);
  3761. } else {
  3762. vm._renderProxy = vm;
  3763. }
  3764. // expose real self
  3765. vm._self = vm;
  3766. initLifecycle(vm);
  3767. initEvents(vm);
  3768. callHook(vm, 'beforeCreate');
  3769. initState(vm);
  3770. callHook(vm, 'created');
  3771. initRender(vm);
  3772. };
  3773. function initInternalComponent (vm, options) {
  3774. var opts = vm.$options = Object.create(resolveConstructorOptions(vm));
  3775. // doing this because it's faster than dynamic enumeration.
  3776. opts.parent = options.parent;
  3777. opts.propsData = options.propsData;
  3778. opts._parentVnode = options._parentVnode;
  3779. opts._parentListeners = options._parentListeners;
  3780. opts._renderChildren = options._renderChildren;
  3781. opts._componentTag = options._componentTag;
  3782. if (options.render) {
  3783. opts.render = options.render;
  3784. opts.staticRenderFns = options.staticRenderFns;
  3785. }
  3786. }
  3787. function resolveConstructorOptions (vm) {
  3788. var Ctor = vm.constructor;
  3789. var options = Ctor.options;
  3790. if (Ctor.super) {
  3791. var superOptions = Ctor.super.options;
  3792. var cachedSuperOptions = Ctor.superOptions;
  3793. if (superOptions !== cachedSuperOptions) {
  3794. // super option changed
  3795. Ctor.superOptions = superOptions;
  3796. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  3797. if (options.name) {
  3798. options.components[options.name] = Ctor;
  3799. }
  3800. }
  3801. }
  3802. return options
  3803. }
  3804. }
  3805. function Vue$2 (options) {
  3806. if (process.env.NODE_ENV !== 'production' &&
  3807. !(this instanceof Vue$2)) {
  3808. warn('Vue is a constructor and should be called with the `new` keyword');
  3809. }
  3810. this._init(options);
  3811. }
  3812. initMixin(Vue$2);
  3813. stateMixin(Vue$2);
  3814. eventsMixin(Vue$2);
  3815. lifecycleMixin(Vue$2);
  3816. renderMixin(Vue$2);
  3817. var warn = noop;
  3818. var formatComponentName;
  3819. if (process.env.NODE_ENV !== 'production') {
  3820. var hasConsole = typeof console !== 'undefined';
  3821. warn = function (msg, vm) {
  3822. if (hasConsole && (!config.silent)) {
  3823. console.error("[Vue warn]: " + msg + " " + (
  3824. vm ? formatLocation(formatComponentName(vm)) : ''
  3825. ));
  3826. }
  3827. };
  3828. formatComponentName = function (vm) {
  3829. if (vm.$root === vm) {
  3830. return 'root instance'
  3831. }
  3832. var name = vm._isVue
  3833. ? vm.$options.name || vm.$options._componentTag
  3834. : vm.name;
  3835. return (
  3836. (name ? ("component <" + name + ">") : "anonymous component") +
  3837. (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '')
  3838. )
  3839. };
  3840. var formatLocation = function (str) {
  3841. if (str === 'anonymous component') {
  3842. str += " - use the \"name\" option for better debugging messages.";
  3843. }
  3844. return ("\n(found in " + str + ")")
  3845. };
  3846. }
  3847. /* */
  3848. /**
  3849. * Option overwriting strategies are functions that handle
  3850. * how to merge a parent option value and a child option
  3851. * value into the final value.
  3852. */
  3853. var strats = config.optionMergeStrategies;
  3854. /**
  3855. * Options with restrictions
  3856. */
  3857. if (process.env.NODE_ENV !== 'production') {
  3858. strats.el = strats.propsData = function (parent, child, vm, key) {
  3859. if (!vm) {
  3860. warn(
  3861. "option \"" + key + "\" can only be used during instance " +
  3862. 'creation with the `new` keyword.'
  3863. );
  3864. }
  3865. return defaultStrat(parent, child)
  3866. };
  3867. }
  3868. /**
  3869. * Helper that recursively merges two data objects together.
  3870. */
  3871. function mergeData (to, from) {
  3872. var key, toVal, fromVal;
  3873. for (key in from) {
  3874. toVal = to[key];
  3875. fromVal = from[key];
  3876. if (!hasOwn(to, key)) {
  3877. set(to, key, fromVal);
  3878. } else if (isObject(toVal) && isObject(fromVal)) {
  3879. mergeData(toVal, fromVal);
  3880. }
  3881. }
  3882. return to
  3883. }
  3884. /**
  3885. * Data
  3886. */
  3887. strats.data = function (
  3888. parentVal,
  3889. childVal,
  3890. vm
  3891. ) {
  3892. if (!vm) {
  3893. // in a Vue.extend merge, both should be functions
  3894. if (!childVal) {
  3895. return parentVal
  3896. }
  3897. if (typeof childVal !== 'function') {
  3898. process.env.NODE_ENV !== 'production' && warn(
  3899. 'The "data" option should be a function ' +
  3900. 'that returns a per-instance value in component ' +
  3901. 'definitions.',
  3902. vm
  3903. );
  3904. return parentVal
  3905. }
  3906. if (!parentVal) {
  3907. return childVal
  3908. }
  3909. // when parentVal & childVal are both present,
  3910. // we need to return a function that returns the
  3911. // merged result of both functions... no need to
  3912. // check if parentVal is a function here because
  3913. // it has to be a function to pass previous merges.
  3914. return function mergedDataFn () {
  3915. return mergeData(
  3916. childVal.call(this),
  3917. parentVal.call(this)
  3918. )
  3919. }
  3920. } else if (parentVal || childVal) {
  3921. return function mergedInstanceDataFn () {
  3922. // instance merge
  3923. var instanceData = typeof childVal === 'function'
  3924. ? childVal.call(vm)
  3925. : childVal;
  3926. var defaultData = typeof parentVal === 'function'
  3927. ? parentVal.call(vm)
  3928. : undefined;
  3929. if (instanceData) {
  3930. return mergeData(instanceData, defaultData)
  3931. } else {
  3932. return defaultData
  3933. }
  3934. }
  3935. }
  3936. };
  3937. /**
  3938. * Hooks and param attributes are merged as arrays.
  3939. */
  3940. function mergeHook (
  3941. parentVal,
  3942. childVal
  3943. ) {
  3944. return childVal
  3945. ? parentVal
  3946. ? parentVal.concat(childVal)
  3947. : Array.isArray(childVal)
  3948. ? childVal
  3949. : [childVal]
  3950. : parentVal
  3951. }
  3952. config._lifecycleHooks.forEach(function (hook) {
  3953. strats[hook] = mergeHook;
  3954. });
  3955. /**
  3956. * Assets
  3957. *
  3958. * When a vm is present (instance creation), we need to do
  3959. * a three-way merge between constructor options, instance
  3960. * options and parent options.
  3961. */
  3962. function mergeAssets (parentVal, childVal) {
  3963. var res = Object.create(parentVal || null);
  3964. return childVal
  3965. ? extend(res, childVal)
  3966. : res
  3967. }
  3968. config._assetTypes.forEach(function (type) {
  3969. strats[type + 's'] = mergeAssets;
  3970. });
  3971. /**
  3972. * Watchers.
  3973. *
  3974. * Watchers hashes should not overwrite one
  3975. * another, so we merge them as arrays.
  3976. */
  3977. strats.watch = function (parentVal, childVal) {
  3978. /* istanbul ignore if */
  3979. if (!childVal) { return parentVal }
  3980. if (!parentVal) { return childVal }
  3981. var ret = {};
  3982. extend(ret, parentVal);
  3983. for (var key in childVal) {
  3984. var parent = ret[key];
  3985. var child = childVal[key];
  3986. if (parent && !Array.isArray(parent)) {
  3987. parent = [parent];
  3988. }
  3989. ret[key] = parent
  3990. ? parent.concat(child)
  3991. : [child];
  3992. }
  3993. return ret
  3994. };
  3995. /**
  3996. * Other object hashes.
  3997. */
  3998. strats.props =
  3999. strats.methods =
  4000. strats.computed = function (parentVal, childVal) {
  4001. if (!childVal) { return parentVal }
  4002. if (!parentVal) { return childVal }
  4003. var ret = Object.create(null);
  4004. extend(ret, parentVal);
  4005. extend(ret, childVal);
  4006. return ret
  4007. };
  4008. /**
  4009. * Default strategy.
  4010. */
  4011. var defaultStrat = function (parentVal, childVal) {
  4012. return childVal === undefined
  4013. ? parentVal
  4014. : childVal
  4015. };
  4016. /**
  4017. * Make sure component options get converted to actual
  4018. * constructors.
  4019. */
  4020. function normalizeComponents (options) {
  4021. if (options.components) {
  4022. var components = options.components;
  4023. var def;
  4024. for (var key in components) {
  4025. var lower = key.toLowerCase();
  4026. if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
  4027. process.env.NODE_ENV !== 'production' && warn(
  4028. 'Do not use built-in or reserved HTML elements as component ' +
  4029. 'id: ' + key
  4030. );
  4031. continue
  4032. }
  4033. def = components[key];
  4034. if (isPlainObject(def)) {
  4035. components[key] = Vue$2.extend(def);
  4036. }
  4037. }
  4038. }
  4039. }
  4040. /**
  4041. * Ensure all props option syntax are normalized into the
  4042. * Object-based format.
  4043. */
  4044. function normalizeProps (options) {
  4045. var props = options.props;
  4046. if (!props) { return }
  4047. var res = {};
  4048. var i, val, name;
  4049. if (Array.isArray(props)) {
  4050. i = props.length;
  4051. while (i--) {
  4052. val = props[i];
  4053. if (typeof val === 'string') {
  4054. name = camelize(val);
  4055. res[name] = { type: null };
  4056. } else if (process.env.NODE_ENV !== 'production') {
  4057. warn('props must be strings when using array syntax.');
  4058. }
  4059. }
  4060. } else if (isPlainObject(props)) {
  4061. for (var key in props) {
  4062. val = props[key];
  4063. name = camelize(key);
  4064. res[name] = isPlainObject(val)
  4065. ? val
  4066. : { type: val };
  4067. }
  4068. }
  4069. options.props = res;
  4070. }
  4071. /**
  4072. * Normalize raw function directives into object format.
  4073. */
  4074. function normalizeDirectives (options) {
  4075. var dirs = options.directives;
  4076. if (dirs) {
  4077. for (var key in dirs) {
  4078. var def = dirs[key];
  4079. if (typeof def === 'function') {
  4080. dirs[key] = { bind: def, update: def };
  4081. }
  4082. }
  4083. }
  4084. }
  4085. /**
  4086. * Merge two option objects into a new one.
  4087. * Core utility used in both instantiation and inheritance.
  4088. */
  4089. function mergeOptions (
  4090. parent,
  4091. child,
  4092. vm
  4093. ) {
  4094. normalizeComponents(child);
  4095. normalizeProps(child);
  4096. normalizeDirectives(child);
  4097. var extendsFrom = child.extends;
  4098. if (extendsFrom) {
  4099. parent = typeof extendsFrom === 'function'
  4100. ? mergeOptions(parent, extendsFrom.options, vm)
  4101. : mergeOptions(parent, extendsFrom, vm);
  4102. }
  4103. if (child.mixins) {
  4104. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4105. var mixin = child.mixins[i];
  4106. if (mixin.prototype instanceof Vue$2) {
  4107. mixin = mixin.options;
  4108. }
  4109. parent = mergeOptions(parent, mixin, vm);
  4110. }
  4111. }
  4112. var options = {};
  4113. var key;
  4114. for (key in parent) {
  4115. mergeField(key);
  4116. }
  4117. for (key in child) {
  4118. if (!hasOwn(parent, key)) {
  4119. mergeField(key);
  4120. }
  4121. }
  4122. function mergeField (key) {
  4123. var strat = strats[key] || defaultStrat;
  4124. options[key] = strat(parent[key], child[key], vm, key);
  4125. }
  4126. return options
  4127. }
  4128. /**
  4129. * Resolve an asset.
  4130. * This function is used because child instances need access
  4131. * to assets defined in its ancestor chain.
  4132. */
  4133. function resolveAsset (
  4134. options,
  4135. type,
  4136. id,
  4137. warnMissing
  4138. ) {
  4139. /* istanbul ignore if */
  4140. if (typeof id !== 'string') {
  4141. return
  4142. }
  4143. var assets = options[type];
  4144. var res = assets[id] ||
  4145. // camelCase ID
  4146. assets[camelize(id)] ||
  4147. // Pascal Case ID
  4148. assets[capitalize(camelize(id))];
  4149. if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
  4150. warn(
  4151. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4152. options
  4153. );
  4154. }
  4155. return res
  4156. }
  4157. /* */
  4158. function validateProp (
  4159. key,
  4160. propOptions,
  4161. propsData,
  4162. vm
  4163. ) {
  4164. var prop = propOptions[key];
  4165. var absent = !hasOwn(propsData, key);
  4166. var value = propsData[key];
  4167. // handle boolean props
  4168. if (isBooleanType(prop.type)) {
  4169. if (absent && !hasOwn(prop, 'default')) {
  4170. value = false;
  4171. } else if (value === '' || value === hyphenate(key)) {
  4172. value = true;
  4173. }
  4174. }
  4175. // check default value
  4176. if (value === undefined) {
  4177. value = getPropDefaultValue(vm, prop, key);
  4178. // since the default value is a fresh copy,
  4179. // make sure to observe it.
  4180. var prevShouldConvert = observerState.shouldConvert;
  4181. observerState.shouldConvert = true;
  4182. observe(value);
  4183. observerState.shouldConvert = prevShouldConvert;
  4184. }
  4185. if (process.env.NODE_ENV !== 'production') {
  4186. assertProp(prop, key, value, vm, absent);
  4187. }
  4188. return value
  4189. }
  4190. /**
  4191. * Get the default value of a prop.
  4192. */
  4193. function getPropDefaultValue (vm, prop, name) {
  4194. // no default, return undefined
  4195. if (!hasOwn(prop, 'default')) {
  4196. return undefined
  4197. }
  4198. var def = prop.default;
  4199. // warn against non-factory defaults for Object & Array
  4200. if (isObject(def)) {
  4201. process.env.NODE_ENV !== 'production' && warn(
  4202. 'Invalid default value for prop "' + name + '": ' +
  4203. 'Props with type Object/Array must use a factory function ' +
  4204. 'to return the default value.',
  4205. vm
  4206. );
  4207. }
  4208. // call factory function for non-Function types
  4209. return typeof def === 'function' && prop.type !== Function
  4210. ? def.call(vm)
  4211. : def
  4212. }
  4213. /**
  4214. * Assert whether a prop is valid.
  4215. */
  4216. function assertProp (
  4217. prop,
  4218. name,
  4219. value,
  4220. vm,
  4221. absent
  4222. ) {
  4223. if (prop.required && absent) {
  4224. warn(
  4225. 'Missing required prop: "' + name + '"',
  4226. vm
  4227. );
  4228. return
  4229. }
  4230. if (value == null && !prop.required) {
  4231. return
  4232. }
  4233. var type = prop.type;
  4234. var valid = !type || type === true;
  4235. var expectedTypes = [];
  4236. if (type) {
  4237. if (!Array.isArray(type)) {
  4238. type = [type];
  4239. }
  4240. for (var i = 0; i < type.length && !valid; i++) {
  4241. var assertedType = assertType(value, type[i]);
  4242. expectedTypes.push(assertedType.expectedType);
  4243. valid = assertedType.valid;
  4244. }
  4245. }
  4246. if (!valid) {
  4247. warn(
  4248. 'Invalid prop: type check failed for prop "' + name + '".' +
  4249. ' Expected ' + expectedTypes.map(capitalize).join(', ') +
  4250. ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
  4251. vm
  4252. );
  4253. return
  4254. }
  4255. var validator = prop.validator;
  4256. if (validator) {
  4257. if (!validator(value)) {
  4258. warn(
  4259. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4260. vm
  4261. );
  4262. }
  4263. }
  4264. }
  4265. /**
  4266. * Assert the type of a value
  4267. */
  4268. function assertType (value, type) {
  4269. var valid;
  4270. var expectedType = getType(type);
  4271. if (expectedType === 'String') {
  4272. valid = typeof value === (expectedType = 'string');
  4273. } else if (expectedType === 'Number') {
  4274. valid = typeof value === (expectedType = 'number');
  4275. } else if (expectedType === 'Boolean') {
  4276. valid = typeof value === (expectedType = 'boolean');
  4277. } else if (expectedType === 'Function') {
  4278. valid = typeof value === (expectedType = 'function');
  4279. } else if (expectedType === 'Object') {
  4280. valid = isPlainObject(value);
  4281. } else if (expectedType === 'Array') {
  4282. valid = Array.isArray(value);
  4283. } else {
  4284. valid = value instanceof type;
  4285. }
  4286. return {
  4287. valid: valid,
  4288. expectedType: expectedType
  4289. }
  4290. }
  4291. /**
  4292. * Use function string name to check built-in types,
  4293. * because a simple equality check will fail when running
  4294. * across different vms / iframes.
  4295. */
  4296. function getType (fn) {
  4297. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4298. return match && match[1]
  4299. }
  4300. function isBooleanType (fn) {
  4301. if (!Array.isArray(fn)) {
  4302. return getType(fn) === 'Boolean'
  4303. }
  4304. for (var i = 0, len = fn.length; i < len; i++) {
  4305. if (getType(fn[i]) === 'Boolean') {
  4306. return true
  4307. }
  4308. }
  4309. /* istanbul ignore next */
  4310. return false
  4311. }
  4312. var util = Object.freeze({
  4313. defineReactive: defineReactive$$1,
  4314. _toString: _toString,
  4315. toNumber: toNumber,
  4316. makeMap: makeMap,
  4317. isBuiltInTag: isBuiltInTag,
  4318. remove: remove$1,
  4319. hasOwn: hasOwn,
  4320. isPrimitive: isPrimitive,
  4321. cached: cached,
  4322. camelize: camelize,
  4323. capitalize: capitalize,
  4324. hyphenate: hyphenate,
  4325. bind: bind$1,
  4326. toArray: toArray,
  4327. extend: extend,
  4328. isObject: isObject,
  4329. isPlainObject: isPlainObject,
  4330. toObject: toObject,
  4331. noop: noop,
  4332. no: no,
  4333. genStaticKeys: genStaticKeys,
  4334. looseEqual: looseEqual,
  4335. looseIndexOf: looseIndexOf,
  4336. isReserved: isReserved,
  4337. def: def,
  4338. parsePath: parsePath,
  4339. hasProto: hasProto,
  4340. inBrowser: inBrowser,
  4341. UA: UA,
  4342. isIE: isIE,
  4343. isIE9: isIE9,
  4344. isEdge: isEdge,
  4345. isAndroid: isAndroid,
  4346. isIOS: isIOS,
  4347. devtools: devtools,
  4348. nextTick: nextTick,
  4349. get _Set () { return _Set; },
  4350. mergeOptions: mergeOptions,
  4351. resolveAsset: resolveAsset,
  4352. get warn () { return warn; },
  4353. get formatComponentName () { return formatComponentName; },
  4354. validateProp: validateProp
  4355. });
  4356. /* */
  4357. function initUse (Vue) {
  4358. Vue.use = function (plugin) {
  4359. /* istanbul ignore if */
  4360. if (plugin.installed) {
  4361. return
  4362. }
  4363. // additional parameters
  4364. var args = toArray(arguments, 1);
  4365. args.unshift(this);
  4366. if (typeof plugin.install === 'function') {
  4367. plugin.install.apply(plugin, args);
  4368. } else {
  4369. plugin.apply(null, args);
  4370. }
  4371. plugin.installed = true;
  4372. return this
  4373. };
  4374. }
  4375. /* */
  4376. function initMixin$1 (Vue) {
  4377. Vue.mixin = function (mixin) {
  4378. Vue.options = mergeOptions(Vue.options, mixin);
  4379. };
  4380. }
  4381. /* */
  4382. function initExtend (Vue) {
  4383. /**
  4384. * Each instance constructor, including Vue, has a unique
  4385. * cid. This enables us to create wrapped "child
  4386. * constructors" for prototypal inheritance and cache them.
  4387. */
  4388. Vue.cid = 0;
  4389. var cid = 1;
  4390. /**
  4391. * Class inheritance
  4392. */
  4393. Vue.extend = function (extendOptions) {
  4394. extendOptions = extendOptions || {};
  4395. var Super = this;
  4396. var isFirstExtend = Super.cid === 0;
  4397. if (isFirstExtend && extendOptions._Ctor) {
  4398. return extendOptions._Ctor
  4399. }
  4400. var name = extendOptions.name || Super.options.name;
  4401. if (process.env.NODE_ENV !== 'production') {
  4402. if (!/^[a-zA-Z][\w-]*$/.test(name)) {
  4403. warn(
  4404. 'Invalid component name: "' + name + '". Component names ' +
  4405. 'can only contain alphanumeric characaters and the hyphen.'
  4406. );
  4407. name = null;
  4408. }
  4409. }
  4410. var Sub = function VueComponent (options) {
  4411. this._init(options);
  4412. };
  4413. Sub.prototype = Object.create(Super.prototype);
  4414. Sub.prototype.constructor = Sub;
  4415. Sub.cid = cid++;
  4416. Sub.options = mergeOptions(
  4417. Super.options,
  4418. extendOptions
  4419. );
  4420. Sub['super'] = Super;
  4421. // allow further extension
  4422. Sub.extend = Super.extend;
  4423. // create asset registers, so extended classes
  4424. // can have their private assets too.
  4425. config._assetTypes.forEach(function (type) {
  4426. Sub[type] = Super[type];
  4427. });
  4428. // enable recursive self-lookup
  4429. if (name) {
  4430. Sub.options.components[name] = Sub;
  4431. }
  4432. // keep a reference to the super options at extension time.
  4433. // later at instantiation we can check if Super's options have
  4434. // been updated.
  4435. Sub.superOptions = Super.options;
  4436. Sub.extendOptions = extendOptions;
  4437. // cache constructor
  4438. if (isFirstExtend) {
  4439. extendOptions._Ctor = Sub;
  4440. }
  4441. return Sub
  4442. };
  4443. }
  4444. /* */
  4445. function initAssetRegisters (Vue) {
  4446. /**
  4447. * Create asset registration methods.
  4448. */
  4449. config._assetTypes.forEach(function (type) {
  4450. Vue[type] = function (
  4451. id,
  4452. definition
  4453. ) {
  4454. if (!definition) {
  4455. return this.options[type + 's'][id]
  4456. } else {
  4457. /* istanbul ignore if */
  4458. if (process.env.NODE_ENV !== 'production') {
  4459. if (type === 'component' && config.isReservedTag(id)) {
  4460. warn(
  4461. 'Do not use built-in or reserved HTML elements as component ' +
  4462. 'id: ' + id
  4463. );
  4464. }
  4465. }
  4466. if (type === 'component' && isPlainObject(definition)) {
  4467. definition.name = definition.name || id;
  4468. definition = Vue.extend(definition);
  4469. }
  4470. if (type === 'directive' && typeof definition === 'function') {
  4471. definition = { bind: definition, update: definition };
  4472. }
  4473. this.options[type + 's'][id] = definition;
  4474. return definition
  4475. }
  4476. };
  4477. });
  4478. }
  4479. var KeepAlive = {
  4480. name: 'keep-alive',
  4481. abstract: true,
  4482. created: function created () {
  4483. this.cache = Object.create(null);
  4484. },
  4485. render: function render () {
  4486. var vnode = getFirstComponentChild(this.$slots.default);
  4487. if (vnode && vnode.componentOptions) {
  4488. var opts = vnode.componentOptions;
  4489. var key = vnode.key == null
  4490. // same constructor may get registered as different local components
  4491. // so cid alone is not enough (#3269)
  4492. ? opts.Ctor.cid + '::' + opts.tag
  4493. : vnode.key;
  4494. if (this.cache[key]) {
  4495. vnode.child = this.cache[key].child;
  4496. } else {
  4497. this.cache[key] = vnode;
  4498. }
  4499. vnode.data.keepAlive = true;
  4500. }
  4501. return vnode
  4502. },
  4503. destroyed: function destroyed () {
  4504. var this$1 = this;
  4505. for (var key in this.cache) {
  4506. var vnode = this$1.cache[key];
  4507. callHook(vnode.child, 'deactivated');
  4508. vnode.child.$destroy();
  4509. }
  4510. }
  4511. };
  4512. var builtInComponents = {
  4513. KeepAlive: KeepAlive
  4514. };
  4515. /* */
  4516. function initGlobalAPI (Vue) {
  4517. // config
  4518. var configDef = {};
  4519. configDef.get = function () { return config; };
  4520. if (process.env.NODE_ENV !== 'production') {
  4521. configDef.set = function () {
  4522. warn(
  4523. 'Do not replace the Vue.config object, set individual fields instead.'
  4524. );
  4525. };
  4526. }
  4527. Object.defineProperty(Vue, 'config', configDef);
  4528. Vue.util = util;
  4529. Vue.set = set;
  4530. Vue.delete = del;
  4531. Vue.nextTick = nextTick;
  4532. Vue.options = Object.create(null);
  4533. config._assetTypes.forEach(function (type) {
  4534. Vue.options[type + 's'] = Object.create(null);
  4535. });
  4536. extend(Vue.options.components, builtInComponents);
  4537. initUse(Vue);
  4538. initMixin$1(Vue);
  4539. initExtend(Vue);
  4540. initAssetRegisters(Vue);
  4541. }
  4542. initGlobalAPI(Vue$2);
  4543. Object.defineProperty(Vue$2.prototype, '$isServer', {
  4544. get: function () { return config._isServer; }
  4545. });
  4546. Vue$2.version = '2.0.3';
  4547. /* */
  4548. // attributes that should be using props for binding
  4549. var mustUseProp = makeMap('value,selected,checked,muted');
  4550. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  4551. var isBooleanAttr = makeMap(
  4552. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  4553. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  4554. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  4555. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  4556. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  4557. 'truespeed,typemustmatch,visible'
  4558. );
  4559. var isAttr = makeMap(
  4560. 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' +
  4561. 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' +
  4562. 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,' +
  4563. 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,' +
  4564. 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,' +
  4565. 'form,formaction,headers,<th>,height,hidden,high,href,hreflang,http-equiv,' +
  4566. 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' +
  4567. 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' +
  4568. 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' +
  4569. 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' +
  4570. 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' +
  4571. 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' +
  4572. 'target,title,type,usemap,value,width,wrap'
  4573. );
  4574. var xlinkNS = 'http://www.w3.org/1999/xlink';
  4575. var isXlink = function (name) {
  4576. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  4577. };
  4578. var getXlinkProp = function (name) {
  4579. return isXlink(name) ? name.slice(6, name.length) : ''
  4580. };
  4581. var isFalsyAttrValue = function (val) {
  4582. return val == null || val === false
  4583. };
  4584. /* */
  4585. function genClassForVnode (vnode) {
  4586. var data = vnode.data;
  4587. var parentNode = vnode;
  4588. var childNode = vnode;
  4589. while (childNode.child) {
  4590. childNode = childNode.child._vnode;
  4591. if (childNode.data) {
  4592. data = mergeClassData(childNode.data, data);
  4593. }
  4594. }
  4595. while ((parentNode = parentNode.parent)) {
  4596. if (parentNode.data) {
  4597. data = mergeClassData(data, parentNode.data);
  4598. }
  4599. }
  4600. return genClassFromData(data)
  4601. }
  4602. function mergeClassData (child, parent) {
  4603. return {
  4604. staticClass: concat(child.staticClass, parent.staticClass),
  4605. class: child.class
  4606. ? [child.class, parent.class]
  4607. : parent.class
  4608. }
  4609. }
  4610. function genClassFromData (data) {
  4611. var dynamicClass = data.class;
  4612. var staticClass = data.staticClass;
  4613. if (staticClass || dynamicClass) {
  4614. return concat(staticClass, stringifyClass(dynamicClass))
  4615. }
  4616. /* istanbul ignore next */
  4617. return ''
  4618. }
  4619. function concat (a, b) {
  4620. return a ? b ? (a + ' ' + b) : a : (b || '')
  4621. }
  4622. function stringifyClass (value) {
  4623. var res = '';
  4624. if (!value) {
  4625. return res
  4626. }
  4627. if (typeof value === 'string') {
  4628. return value
  4629. }
  4630. if (Array.isArray(value)) {
  4631. var stringified;
  4632. for (var i = 0, l = value.length; i < l; i++) {
  4633. if (value[i]) {
  4634. if ((stringified = stringifyClass(value[i]))) {
  4635. res += stringified + ' ';
  4636. }
  4637. }
  4638. }
  4639. return res.slice(0, -1)
  4640. }
  4641. if (isObject(value)) {
  4642. for (var key in value) {
  4643. if (value[key]) { res += key + ' '; }
  4644. }
  4645. return res.slice(0, -1)
  4646. }
  4647. /* istanbul ignore next */
  4648. return res
  4649. }
  4650. /* */
  4651. var namespaceMap = {
  4652. svg: 'http://www.w3.org/2000/svg',
  4653. math: 'http://www.w3.org/1998/Math/MathML'
  4654. };
  4655. var isHTMLTag = makeMap(
  4656. 'html,body,base,head,link,meta,style,title,' +
  4657. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  4658. 'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
  4659. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  4660. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  4661. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  4662. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  4663. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  4664. 'output,progress,select,textarea,' +
  4665. 'details,dialog,menu,menuitem,summary,' +
  4666. 'content,element,shadow,template'
  4667. );
  4668. var isUnaryTag = makeMap(
  4669. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  4670. 'link,meta,param,source,track,wbr',
  4671. true
  4672. );
  4673. // Elements that you can, intentionally, leave open
  4674. // (and which close themselves)
  4675. var canBeLeftOpenTag = makeMap(
  4676. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',
  4677. true
  4678. );
  4679. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  4680. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  4681. var isNonPhrasingTag = makeMap(
  4682. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  4683. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  4684. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  4685. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  4686. 'title,tr,track',
  4687. true
  4688. );
  4689. // this map is intentionally selective, only covering SVG elements that may
  4690. // contain child elements.
  4691. var isSVG = makeMap(
  4692. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' +
  4693. 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  4694. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  4695. true
  4696. );
  4697. var isReservedTag = function (tag) {
  4698. return isHTMLTag(tag) || isSVG(tag)
  4699. };
  4700. function getTagNamespace (tag) {
  4701. if (isSVG(tag)) {
  4702. return 'svg'
  4703. }
  4704. // basic support for MathML
  4705. // note it doesn't support other MathML elements being component roots
  4706. if (tag === 'math') {
  4707. return 'math'
  4708. }
  4709. }
  4710. var unknownElementCache = Object.create(null);
  4711. function isUnknownElement (tag) {
  4712. /* istanbul ignore if */
  4713. if (!inBrowser) {
  4714. return true
  4715. }
  4716. if (isReservedTag(tag)) {
  4717. return false
  4718. }
  4719. tag = tag.toLowerCase();
  4720. /* istanbul ignore if */
  4721. if (unknownElementCache[tag] != null) {
  4722. return unknownElementCache[tag]
  4723. }
  4724. var el = document.createElement(tag);
  4725. if (tag.indexOf('-') > -1) {
  4726. // http://stackoverflow.com/a/28210364/1070244
  4727. return (unknownElementCache[tag] = (
  4728. el.constructor === window.HTMLUnknownElement ||
  4729. el.constructor === window.HTMLElement
  4730. ))
  4731. } else {
  4732. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  4733. }
  4734. }
  4735. /* */
  4736. /**
  4737. * Query an element selector if it's not an element already.
  4738. */
  4739. function query (el) {
  4740. if (typeof el === 'string') {
  4741. var selector = el;
  4742. el = document.querySelector(el);
  4743. if (!el) {
  4744. process.env.NODE_ENV !== 'production' && warn(
  4745. 'Cannot find element: ' + selector
  4746. );
  4747. return document.createElement('div')
  4748. }
  4749. }
  4750. return el
  4751. }
  4752. /* */
  4753. function createElement$1 (tagName, vnode) {
  4754. var elm = document.createElement(tagName);
  4755. if (tagName !== 'select') {
  4756. return elm
  4757. }
  4758. if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {
  4759. elm.setAttribute('multiple', 'multiple');
  4760. }
  4761. return elm
  4762. }
  4763. function createElementNS (namespace, tagName) {
  4764. return document.createElementNS(namespaceMap[namespace], tagName)
  4765. }
  4766. function createTextNode (text) {
  4767. return document.createTextNode(text)
  4768. }
  4769. function createComment (text) {
  4770. return document.createComment(text)
  4771. }
  4772. function insertBefore (parentNode, newNode, referenceNode) {
  4773. parentNode.insertBefore(newNode, referenceNode);
  4774. }
  4775. function removeChild (node, child) {
  4776. node.removeChild(child);
  4777. }
  4778. function appendChild (node, child) {
  4779. node.appendChild(child);
  4780. }
  4781. function parentNode (node) {
  4782. return node.parentNode
  4783. }
  4784. function nextSibling (node) {
  4785. return node.nextSibling
  4786. }
  4787. function tagName (node) {
  4788. return node.tagName
  4789. }
  4790. function setTextContent (node, text) {
  4791. node.textContent = text;
  4792. }
  4793. function childNodes (node) {
  4794. return node.childNodes
  4795. }
  4796. function setAttribute (node, key, val) {
  4797. node.setAttribute(key, val);
  4798. }
  4799. var nodeOps = Object.freeze({
  4800. createElement: createElement$1,
  4801. createElementNS: createElementNS,
  4802. createTextNode: createTextNode,
  4803. createComment: createComment,
  4804. insertBefore: insertBefore,
  4805. removeChild: removeChild,
  4806. appendChild: appendChild,
  4807. parentNode: parentNode,
  4808. nextSibling: nextSibling,
  4809. tagName: tagName,
  4810. setTextContent: setTextContent,
  4811. childNodes: childNodes,
  4812. setAttribute: setAttribute
  4813. });
  4814. /* */
  4815. var ref = {
  4816. create: function create (_, vnode) {
  4817. registerRef(vnode);
  4818. },
  4819. update: function update (oldVnode, vnode) {
  4820. if (oldVnode.data.ref !== vnode.data.ref) {
  4821. registerRef(oldVnode, true);
  4822. registerRef(vnode);
  4823. }
  4824. },
  4825. destroy: function destroy (vnode) {
  4826. registerRef(vnode, true);
  4827. }
  4828. };
  4829. function registerRef (vnode, isRemoval) {
  4830. var key = vnode.data.ref;
  4831. if (!key) { return }
  4832. var vm = vnode.context;
  4833. var ref = vnode.child || vnode.elm;
  4834. var refs = vm.$refs;
  4835. if (isRemoval) {
  4836. if (Array.isArray(refs[key])) {
  4837. remove$1(refs[key], ref);
  4838. } else if (refs[key] === ref) {
  4839. refs[key] = undefined;
  4840. }
  4841. } else {
  4842. if (vnode.data.refInFor) {
  4843. if (Array.isArray(refs[key])) {
  4844. refs[key].push(ref);
  4845. } else {
  4846. refs[key] = [ref];
  4847. }
  4848. } else {
  4849. refs[key] = ref;
  4850. }
  4851. }
  4852. }
  4853. /**
  4854. * Virtual DOM patching algorithm based on Snabbdom by
  4855. * Simon Friis Vindum (@paldepind)
  4856. * Licensed under the MIT License
  4857. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  4858. *
  4859. * modified by Evan You (@yyx990803)
  4860. *
  4861. /*
  4862. * Not type-checking this because this file is perf-critical and the cost
  4863. * of making flow understand it is not worth it.
  4864. */
  4865. var emptyNode = new VNode('', {}, []);
  4866. var hooks$1 = ['create', 'update', 'remove', 'destroy'];
  4867. function isUndef (s) {
  4868. return s == null
  4869. }
  4870. function isDef (s) {
  4871. return s != null
  4872. }
  4873. function sameVnode (vnode1, vnode2) {
  4874. return (
  4875. vnode1.key === vnode2.key &&
  4876. vnode1.tag === vnode2.tag &&
  4877. vnode1.isComment === vnode2.isComment &&
  4878. !vnode1.data === !vnode2.data
  4879. )
  4880. }
  4881. function createKeyToOldIdx (children, beginIdx, endIdx) {
  4882. var i, key;
  4883. var map = {};
  4884. for (i = beginIdx; i <= endIdx; ++i) {
  4885. key = children[i].key;
  4886. if (isDef(key)) { map[key] = i; }
  4887. }
  4888. return map
  4889. }
  4890. function createPatchFunction (backend) {
  4891. var i, j;
  4892. var cbs = {};
  4893. var modules = backend.modules;
  4894. var nodeOps = backend.nodeOps;
  4895. for (i = 0; i < hooks$1.length; ++i) {
  4896. cbs[hooks$1[i]] = [];
  4897. for (j = 0; j < modules.length; ++j) {
  4898. if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }
  4899. }
  4900. }
  4901. function emptyNodeAt (elm) {
  4902. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  4903. }
  4904. function createRmCb (childElm, listeners) {
  4905. function remove$$1 () {
  4906. if (--remove$$1.listeners === 0) {
  4907. removeElement(childElm);
  4908. }
  4909. }
  4910. remove$$1.listeners = listeners;
  4911. return remove$$1
  4912. }
  4913. function removeElement (el) {
  4914. var parent = nodeOps.parentNode(el);
  4915. nodeOps.removeChild(parent, el);
  4916. }
  4917. function createElm (vnode, insertedVnodeQueue, nested) {
  4918. var i;
  4919. var data = vnode.data;
  4920. vnode.isRootInsert = !nested;
  4921. if (isDef(data)) {
  4922. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode); }
  4923. // after calling the init hook, if the vnode is a child component
  4924. // it should've created a child instance and mounted it. the child
  4925. // component also has set the placeholder vnode's elm.
  4926. // in that case we can just return the element and be done.
  4927. if (isDef(i = vnode.child)) {
  4928. initComponent(vnode, insertedVnodeQueue);
  4929. return vnode.elm
  4930. }
  4931. }
  4932. var children = vnode.children;
  4933. var tag = vnode.tag;
  4934. if (isDef(tag)) {
  4935. if (process.env.NODE_ENV !== 'production') {
  4936. if (
  4937. !vnode.ns &&
  4938. !(config.ignoredElements && config.ignoredElements.indexOf(tag) > -1) &&
  4939. config.isUnknownElement(tag)
  4940. ) {
  4941. warn(
  4942. 'Unknown custom element: <' + tag + '> - did you ' +
  4943. 'register the component correctly? For recursive components, ' +
  4944. 'make sure to provide the "name" option.',
  4945. vnode.context
  4946. );
  4947. }
  4948. }
  4949. vnode.elm = vnode.ns
  4950. ? nodeOps.createElementNS(vnode.ns, tag)
  4951. : nodeOps.createElement(tag, vnode);
  4952. setScope(vnode);
  4953. createChildren(vnode, children, insertedVnodeQueue);
  4954. if (isDef(data)) {
  4955. invokeCreateHooks(vnode, insertedVnodeQueue);
  4956. }
  4957. } else if (vnode.isComment) {
  4958. vnode.elm = nodeOps.createComment(vnode.text);
  4959. } else {
  4960. vnode.elm = nodeOps.createTextNode(vnode.text);
  4961. }
  4962. return vnode.elm
  4963. }
  4964. function createChildren (vnode, children, insertedVnodeQueue) {
  4965. if (Array.isArray(children)) {
  4966. for (var i = 0; i < children.length; ++i) {
  4967. nodeOps.appendChild(vnode.elm, createElm(children[i], insertedVnodeQueue, true));
  4968. }
  4969. } else if (isPrimitive(vnode.text)) {
  4970. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
  4971. }
  4972. }
  4973. function isPatchable (vnode) {
  4974. while (vnode.child) {
  4975. vnode = vnode.child._vnode;
  4976. }
  4977. return isDef(vnode.tag)
  4978. }
  4979. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  4980. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  4981. cbs.create[i$1](emptyNode, vnode);
  4982. }
  4983. i = vnode.data.hook; // Reuse variable
  4984. if (isDef(i)) {
  4985. if (i.create) { i.create(emptyNode, vnode); }
  4986. if (i.insert) { insertedVnodeQueue.push(vnode); }
  4987. }
  4988. }
  4989. function initComponent (vnode, insertedVnodeQueue) {
  4990. if (vnode.data.pendingInsert) {
  4991. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  4992. }
  4993. vnode.elm = vnode.child.$el;
  4994. if (isPatchable(vnode)) {
  4995. invokeCreateHooks(vnode, insertedVnodeQueue);
  4996. setScope(vnode);
  4997. } else {
  4998. // empty component root.
  4999. // skip all element-related modules except for ref (#3455)
  5000. registerRef(vnode);
  5001. // make sure to invoke the insert hook
  5002. insertedVnodeQueue.push(vnode);
  5003. }
  5004. }
  5005. // set scope id attribute for scoped CSS.
  5006. // this is implemented as a special case to avoid the overhead
  5007. // of going through the normal attribute patching process.
  5008. function setScope (vnode) {
  5009. var i;
  5010. if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {
  5011. nodeOps.setAttribute(vnode.elm, i, '');
  5012. }
  5013. if (isDef(i = activeInstance) &&
  5014. i !== vnode.context &&
  5015. isDef(i = i.$options._scopeId)) {
  5016. nodeOps.setAttribute(vnode.elm, i, '');
  5017. }
  5018. }
  5019. function addVnodes (parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  5020. for (; startIdx <= endIdx; ++startIdx) {
  5021. nodeOps.insertBefore(parentElm, createElm(vnodes[startIdx], insertedVnodeQueue), before);
  5022. }
  5023. }
  5024. function invokeDestroyHook (vnode) {
  5025. var i, j;
  5026. var data = vnode.data;
  5027. if (isDef(data)) {
  5028. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  5029. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  5030. }
  5031. if (isDef(i = vnode.children)) {
  5032. for (j = 0; j < vnode.children.length; ++j) {
  5033. invokeDestroyHook(vnode.children[j]);
  5034. }
  5035. }
  5036. }
  5037. function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
  5038. for (; startIdx <= endIdx; ++startIdx) {
  5039. var ch = vnodes[startIdx];
  5040. if (isDef(ch)) {
  5041. if (isDef(ch.tag)) {
  5042. removeAndInvokeRemoveHook(ch);
  5043. invokeDestroyHook(ch);
  5044. } else { // Text node
  5045. nodeOps.removeChild(parentElm, ch.elm);
  5046. }
  5047. }
  5048. }
  5049. }
  5050. function removeAndInvokeRemoveHook (vnode, rm) {
  5051. if (rm || isDef(vnode.data)) {
  5052. var listeners = cbs.remove.length + 1;
  5053. if (!rm) {
  5054. // directly removing
  5055. rm = createRmCb(vnode.elm, listeners);
  5056. } else {
  5057. // we have a recursively passed down rm callback
  5058. // increase the listeners count
  5059. rm.listeners += listeners;
  5060. }
  5061. // recursively invoke hooks on child component root node
  5062. if (isDef(i = vnode.child) && isDef(i = i._vnode) && isDef(i.data)) {
  5063. removeAndInvokeRemoveHook(i, rm);
  5064. }
  5065. for (i = 0; i < cbs.remove.length; ++i) {
  5066. cbs.remove[i](vnode, rm);
  5067. }
  5068. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  5069. i(vnode, rm);
  5070. } else {
  5071. rm();
  5072. }
  5073. } else {
  5074. removeElement(vnode.elm);
  5075. }
  5076. }
  5077. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  5078. var oldStartIdx = 0;
  5079. var newStartIdx = 0;
  5080. var oldEndIdx = oldCh.length - 1;
  5081. var oldStartVnode = oldCh[0];
  5082. var oldEndVnode = oldCh[oldEndIdx];
  5083. var newEndIdx = newCh.length - 1;
  5084. var newStartVnode = newCh[0];
  5085. var newEndVnode = newCh[newEndIdx];
  5086. var oldKeyToIdx, idxInOld, elmToMove, before;
  5087. // removeOnly is a special flag used only by <transition-group>
  5088. // to ensure removed elements stay in correct relative positions
  5089. // during leaving transitions
  5090. var canMove = !removeOnly;
  5091. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  5092. if (isUndef(oldStartVnode)) {
  5093. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  5094. } else if (isUndef(oldEndVnode)) {
  5095. oldEndVnode = oldCh[--oldEndIdx];
  5096. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  5097. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
  5098. oldStartVnode = oldCh[++oldStartIdx];
  5099. newStartVnode = newCh[++newStartIdx];
  5100. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  5101. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
  5102. oldEndVnode = oldCh[--oldEndIdx];
  5103. newEndVnode = newCh[--newEndIdx];
  5104. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  5105. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
  5106. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  5107. oldStartVnode = oldCh[++oldStartIdx];
  5108. newEndVnode = newCh[--newEndIdx];
  5109. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  5110. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
  5111. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  5112. oldEndVnode = oldCh[--oldEndIdx];
  5113. newStartVnode = newCh[++newStartIdx];
  5114. } else {
  5115. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  5116. idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
  5117. if (isUndef(idxInOld)) { // New element
  5118. nodeOps.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
  5119. newStartVnode = newCh[++newStartIdx];
  5120. } else {
  5121. elmToMove = oldCh[idxInOld];
  5122. /* istanbul ignore if */
  5123. if (process.env.NODE_ENV !== 'production' && !elmToMove) {
  5124. warn(
  5125. 'It seems there are duplicate keys that is causing an update error. ' +
  5126. 'Make sure each v-for item has a unique key.'
  5127. );
  5128. }
  5129. if (elmToMove.tag !== newStartVnode.tag) {
  5130. // same key but different element. treat as new element
  5131. nodeOps.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
  5132. newStartVnode = newCh[++newStartIdx];
  5133. } else {
  5134. patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
  5135. oldCh[idxInOld] = undefined;
  5136. canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);
  5137. newStartVnode = newCh[++newStartIdx];
  5138. }
  5139. }
  5140. }
  5141. }
  5142. if (oldStartIdx > oldEndIdx) {
  5143. before = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  5144. addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  5145. } else if (newStartIdx > newEndIdx) {
  5146. removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
  5147. }
  5148. }
  5149. function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
  5150. if (oldVnode === vnode) {
  5151. return
  5152. }
  5153. // reuse element for static trees.
  5154. // note we only do this if the vnode is cloned -
  5155. // if the new node is not cloned it means the render functions have been
  5156. // reset by the hot-reload-api and we need to do a proper re-render.
  5157. if (vnode.isStatic &&
  5158. oldVnode.isStatic &&
  5159. vnode.key === oldVnode.key &&
  5160. vnode.isCloned) {
  5161. vnode.elm = oldVnode.elm;
  5162. return
  5163. }
  5164. var i;
  5165. var data = vnode.data;
  5166. var hasData = isDef(data);
  5167. if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  5168. i(oldVnode, vnode);
  5169. }
  5170. var elm = vnode.elm = oldVnode.elm;
  5171. var oldCh = oldVnode.children;
  5172. var ch = vnode.children;
  5173. if (hasData && isPatchable(vnode)) {
  5174. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  5175. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  5176. }
  5177. if (isUndef(vnode.text)) {
  5178. if (isDef(oldCh) && isDef(ch)) {
  5179. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  5180. } else if (isDef(ch)) {
  5181. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  5182. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  5183. } else if (isDef(oldCh)) {
  5184. removeVnodes(elm, oldCh, 0, oldCh.length - 1);
  5185. } else if (isDef(oldVnode.text)) {
  5186. nodeOps.setTextContent(elm, '');
  5187. }
  5188. } else if (oldVnode.text !== vnode.text) {
  5189. nodeOps.setTextContent(elm, vnode.text);
  5190. }
  5191. if (hasData) {
  5192. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  5193. }
  5194. }
  5195. function invokeInsertHook (vnode, queue, initial) {
  5196. // delay insert hooks for component root nodes, invoke them after the
  5197. // element is really inserted
  5198. if (initial && vnode.parent) {
  5199. vnode.parent.data.pendingInsert = queue;
  5200. } else {
  5201. for (var i = 0; i < queue.length; ++i) {
  5202. queue[i].data.hook.insert(queue[i]);
  5203. }
  5204. }
  5205. }
  5206. var bailed = false;
  5207. function hydrate (elm, vnode, insertedVnodeQueue) {
  5208. if (process.env.NODE_ENV !== 'production') {
  5209. if (!assertNodeMatch(elm, vnode)) {
  5210. return false
  5211. }
  5212. }
  5213. vnode.elm = elm;
  5214. var tag = vnode.tag;
  5215. var data = vnode.data;
  5216. var children = vnode.children;
  5217. if (isDef(data)) {
  5218. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  5219. if (isDef(i = vnode.child)) {
  5220. // child component. it should have hydrated its own tree.
  5221. initComponent(vnode, insertedVnodeQueue);
  5222. return true
  5223. }
  5224. }
  5225. if (isDef(tag)) {
  5226. if (isDef(children)) {
  5227. var childNodes = nodeOps.childNodes(elm);
  5228. // empty element, allow client to pick up and populate children
  5229. if (!childNodes.length) {
  5230. createChildren(vnode, children, insertedVnodeQueue);
  5231. } else {
  5232. var childrenMatch = true;
  5233. if (childNodes.length !== children.length) {
  5234. childrenMatch = false;
  5235. } else {
  5236. for (var i$1 = 0; i$1 < children.length; i$1++) {
  5237. if (!hydrate(childNodes[i$1], children[i$1], insertedVnodeQueue)) {
  5238. childrenMatch = false;
  5239. break
  5240. }
  5241. }
  5242. }
  5243. if (!childrenMatch) {
  5244. if (process.env.NODE_ENV !== 'production' &&
  5245. typeof console !== 'undefined' &&
  5246. !bailed) {
  5247. bailed = true;
  5248. console.warn('Parent: ', elm);
  5249. console.warn('Mismatching childNodes vs. VNodes: ', childNodes, children);
  5250. }
  5251. return false
  5252. }
  5253. }
  5254. }
  5255. if (isDef(data)) {
  5256. invokeCreateHooks(vnode, insertedVnodeQueue);
  5257. }
  5258. }
  5259. return true
  5260. }
  5261. function assertNodeMatch (node, vnode) {
  5262. if (vnode.tag) {
  5263. return (
  5264. vnode.tag.indexOf('vue-component') === 0 ||
  5265. vnode.tag === nodeOps.tagName(node).toLowerCase()
  5266. )
  5267. } else {
  5268. return _toString(vnode.text) === node.data
  5269. }
  5270. }
  5271. return function patch (oldVnode, vnode, hydrating, removeOnly) {
  5272. if (!vnode) {
  5273. if (oldVnode) { invokeDestroyHook(oldVnode); }
  5274. return
  5275. }
  5276. var elm, parent;
  5277. var isInitialPatch = false;
  5278. var insertedVnodeQueue = [];
  5279. if (!oldVnode) {
  5280. // empty mount, create new root element
  5281. isInitialPatch = true;
  5282. createElm(vnode, insertedVnodeQueue);
  5283. } else {
  5284. var isRealElement = isDef(oldVnode.nodeType);
  5285. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  5286. patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
  5287. } else {
  5288. if (isRealElement) {
  5289. // mounting to a real element
  5290. // check if this is server-rendered content and if we can perform
  5291. // a successful hydration.
  5292. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {
  5293. oldVnode.removeAttribute('server-rendered');
  5294. hydrating = true;
  5295. }
  5296. if (hydrating) {
  5297. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  5298. invokeInsertHook(vnode, insertedVnodeQueue, true);
  5299. return oldVnode
  5300. } else if (process.env.NODE_ENV !== 'production') {
  5301. warn(
  5302. 'The client-side rendered virtual DOM tree is not matching ' +
  5303. 'server-rendered content. This is likely caused by incorrect ' +
  5304. 'HTML markup, for example nesting block-level elements inside ' +
  5305. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  5306. 'full client-side render.'
  5307. );
  5308. }
  5309. }
  5310. // either not server-rendered, or hydration failed.
  5311. // create an empty node and replace it
  5312. oldVnode = emptyNodeAt(oldVnode);
  5313. }
  5314. elm = oldVnode.elm;
  5315. parent = nodeOps.parentNode(elm);
  5316. createElm(vnode, insertedVnodeQueue);
  5317. // component root element replaced.
  5318. // update parent placeholder node element.
  5319. if (vnode.parent) {
  5320. vnode.parent.elm = vnode.elm;
  5321. if (isPatchable(vnode)) {
  5322. for (var i = 0; i < cbs.create.length; ++i) {
  5323. cbs.create[i](emptyNode, vnode.parent);
  5324. }
  5325. }
  5326. }
  5327. if (parent !== null) {
  5328. nodeOps.insertBefore(parent, vnode.elm, nodeOps.nextSibling(elm));
  5329. removeVnodes(parent, [oldVnode], 0, 0);
  5330. } else if (isDef(oldVnode.tag)) {
  5331. invokeDestroyHook(oldVnode);
  5332. }
  5333. }
  5334. }
  5335. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  5336. return vnode.elm
  5337. }
  5338. }
  5339. /* */
  5340. var directives = {
  5341. create: updateDirectives,
  5342. update: updateDirectives,
  5343. destroy: function unbindDirectives (vnode) {
  5344. updateDirectives(vnode, emptyNode);
  5345. }
  5346. };
  5347. function updateDirectives (
  5348. oldVnode,
  5349. vnode
  5350. ) {
  5351. if (!oldVnode.data.directives && !vnode.data.directives) {
  5352. return
  5353. }
  5354. var isCreate = oldVnode === emptyNode;
  5355. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  5356. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  5357. var dirsWithInsert = [];
  5358. var dirsWithPostpatch = [];
  5359. var key, oldDir, dir;
  5360. for (key in newDirs) {
  5361. oldDir = oldDirs[key];
  5362. dir = newDirs[key];
  5363. if (!oldDir) {
  5364. // new directive, bind
  5365. callHook$1(dir, 'bind', vnode, oldVnode);
  5366. if (dir.def && dir.def.inserted) {
  5367. dirsWithInsert.push(dir);
  5368. }
  5369. } else {
  5370. // existing directive, update
  5371. dir.oldValue = oldDir.value;
  5372. callHook$1(dir, 'update', vnode, oldVnode);
  5373. if (dir.def && dir.def.componentUpdated) {
  5374. dirsWithPostpatch.push(dir);
  5375. }
  5376. }
  5377. }
  5378. if (dirsWithInsert.length) {
  5379. var callInsert = function () {
  5380. dirsWithInsert.forEach(function (dir) {
  5381. callHook$1(dir, 'inserted', vnode, oldVnode);
  5382. });
  5383. };
  5384. if (isCreate) {
  5385. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');
  5386. } else {
  5387. callInsert();
  5388. }
  5389. }
  5390. if (dirsWithPostpatch.length) {
  5391. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
  5392. dirsWithPostpatch.forEach(function (dir) {
  5393. callHook$1(dir, 'componentUpdated', vnode, oldVnode);
  5394. });
  5395. }, 'dir-postpatch');
  5396. }
  5397. if (!isCreate) {
  5398. for (key in oldDirs) {
  5399. if (!newDirs[key]) {
  5400. // no longer present, unbind
  5401. callHook$1(oldDirs[key], 'unbind', oldVnode);
  5402. }
  5403. }
  5404. }
  5405. }
  5406. var emptyModifiers = Object.create(null);
  5407. function normalizeDirectives$1 (
  5408. dirs,
  5409. vm
  5410. ) {
  5411. var res = Object.create(null);
  5412. if (!dirs) {
  5413. return res
  5414. }
  5415. var i, dir;
  5416. for (i = 0; i < dirs.length; i++) {
  5417. dir = dirs[i];
  5418. if (!dir.modifiers) {
  5419. dir.modifiers = emptyModifiers;
  5420. }
  5421. res[getRawDirName(dir)] = dir;
  5422. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  5423. }
  5424. return res
  5425. }
  5426. function getRawDirName (dir) {
  5427. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  5428. }
  5429. function callHook$1 (dir, hook, vnode, oldVnode) {
  5430. var fn = dir.def && dir.def[hook];
  5431. if (fn) {
  5432. fn(vnode.elm, dir, vnode, oldVnode);
  5433. }
  5434. }
  5435. var baseModules = [
  5436. ref,
  5437. directives
  5438. ];
  5439. /* */
  5440. function updateAttrs (oldVnode, vnode) {
  5441. if (!oldVnode.data.attrs && !vnode.data.attrs) {
  5442. return
  5443. }
  5444. var key, cur, old;
  5445. var elm = vnode.elm;
  5446. var oldAttrs = oldVnode.data.attrs || {};
  5447. var attrs = vnode.data.attrs || {};
  5448. // clone observed objects, as the user probably wants to mutate it
  5449. if (attrs.__ob__) {
  5450. attrs = vnode.data.attrs = extend({}, attrs);
  5451. }
  5452. for (key in attrs) {
  5453. cur = attrs[key];
  5454. old = oldAttrs[key];
  5455. if (old !== cur) {
  5456. setAttr(elm, key, cur);
  5457. }
  5458. }
  5459. for (key in oldAttrs) {
  5460. if (attrs[key] == null) {
  5461. if (isXlink(key)) {
  5462. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  5463. } else if (!isEnumeratedAttr(key)) {
  5464. elm.removeAttribute(key);
  5465. }
  5466. }
  5467. }
  5468. }
  5469. function setAttr (el, key, value) {
  5470. if (isBooleanAttr(key)) {
  5471. // set attribute for blank value
  5472. // e.g. <option disabled>Select one</option>
  5473. if (isFalsyAttrValue(value)) {
  5474. el.removeAttribute(key);
  5475. } else {
  5476. el.setAttribute(key, key);
  5477. }
  5478. } else if (isEnumeratedAttr(key)) {
  5479. el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
  5480. } else if (isXlink(key)) {
  5481. if (isFalsyAttrValue(value)) {
  5482. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  5483. } else {
  5484. el.setAttributeNS(xlinkNS, key, value);
  5485. }
  5486. } else {
  5487. if (isFalsyAttrValue(value)) {
  5488. el.removeAttribute(key);
  5489. } else {
  5490. el.setAttribute(key, value);
  5491. }
  5492. }
  5493. }
  5494. var attrs = {
  5495. create: updateAttrs,
  5496. update: updateAttrs
  5497. };
  5498. /* */
  5499. function updateClass (oldVnode, vnode) {
  5500. var el = vnode.elm;
  5501. var data = vnode.data;
  5502. var oldData = oldVnode.data;
  5503. if (!data.staticClass && !data.class &&
  5504. (!oldData || (!oldData.staticClass && !oldData.class))) {
  5505. return
  5506. }
  5507. var cls = genClassForVnode(vnode);
  5508. // handle transition classes
  5509. var transitionClass = el._transitionClasses;
  5510. if (transitionClass) {
  5511. cls = concat(cls, stringifyClass(transitionClass));
  5512. }
  5513. // set the class
  5514. if (cls !== el._prevClass) {
  5515. el.setAttribute('class', cls);
  5516. el._prevClass = cls;
  5517. }
  5518. }
  5519. var klass = {
  5520. create: updateClass,
  5521. update: updateClass
  5522. };
  5523. // skip type checking this file because we need to attach private properties
  5524. // to elements
  5525. function updateDOMListeners (oldVnode, vnode) {
  5526. if (!oldVnode.data.on && !vnode.data.on) {
  5527. return
  5528. }
  5529. var on = vnode.data.on || {};
  5530. var oldOn = oldVnode.data.on || {};
  5531. var add = vnode.elm._v_add || (vnode.elm._v_add = function (event, handler, capture) {
  5532. vnode.elm.addEventListener(event, handler, capture);
  5533. });
  5534. var remove = vnode.elm._v_remove || (vnode.elm._v_remove = function (event, handler) {
  5535. vnode.elm.removeEventListener(event, handler);
  5536. });
  5537. updateListeners(on, oldOn, add, remove, vnode.context);
  5538. }
  5539. var events = {
  5540. create: updateDOMListeners,
  5541. update: updateDOMListeners
  5542. };
  5543. /* */
  5544. function updateDOMProps (oldVnode, vnode) {
  5545. if (!oldVnode.data.domProps && !vnode.data.domProps) {
  5546. return
  5547. }
  5548. var key, cur;
  5549. var elm = vnode.elm;
  5550. var oldProps = oldVnode.data.domProps || {};
  5551. var props = vnode.data.domProps || {};
  5552. // clone observed objects, as the user probably wants to mutate it
  5553. if (props.__ob__) {
  5554. props = vnode.data.domProps = extend({}, props);
  5555. }
  5556. for (key in oldProps) {
  5557. if (props[key] == null) {
  5558. elm[key] = undefined;
  5559. }
  5560. }
  5561. for (key in props) {
  5562. // ignore children if the node has textContent or innerHTML,
  5563. // as these will throw away existing DOM nodes and cause removal errors
  5564. // on subsequent patches (#3360)
  5565. if ((key === 'textContent' || key === 'innerHTML') && vnode.children) {
  5566. vnode.children.length = 0;
  5567. }
  5568. cur = props[key];
  5569. if (key === 'value') {
  5570. // store value as _value as well since
  5571. // non-string values will be stringified
  5572. elm._value = cur;
  5573. // avoid resetting cursor position when value is the same
  5574. var strCur = cur == null ? '' : String(cur);
  5575. if (elm.value !== strCur && !elm.composing) {
  5576. elm.value = strCur;
  5577. }
  5578. } else {
  5579. elm[key] = cur;
  5580. }
  5581. }
  5582. }
  5583. var domProps = {
  5584. create: updateDOMProps,
  5585. update: updateDOMProps
  5586. };
  5587. /* */
  5588. var prefixes = ['Webkit', 'Moz', 'ms'];
  5589. var testEl;
  5590. var normalize = cached(function (prop) {
  5591. testEl = testEl || document.createElement('div');
  5592. prop = camelize(prop);
  5593. if (prop !== 'filter' && (prop in testEl.style)) {
  5594. return prop
  5595. }
  5596. var upper = prop.charAt(0).toUpperCase() + prop.slice(1);
  5597. for (var i = 0; i < prefixes.length; i++) {
  5598. var prefixed = prefixes[i] + upper;
  5599. if (prefixed in testEl.style) {
  5600. return prefixed
  5601. }
  5602. }
  5603. });
  5604. function updateStyle (oldVnode, vnode) {
  5605. if ((!oldVnode.data || !oldVnode.data.style) && !vnode.data.style) {
  5606. return
  5607. }
  5608. var cur, name;
  5609. var el = vnode.elm;
  5610. var oldStyle = oldVnode.data.style || {};
  5611. var style = vnode.data.style || {};
  5612. // handle string
  5613. if (typeof style === 'string') {
  5614. el.style.cssText = style;
  5615. return
  5616. }
  5617. var needClone = style.__ob__;
  5618. // handle array syntax
  5619. if (Array.isArray(style)) {
  5620. style = vnode.data.style = toObject(style);
  5621. }
  5622. // clone the style for future updates,
  5623. // in case the user mutates the style object in-place.
  5624. if (needClone) {
  5625. style = vnode.data.style = extend({}, style);
  5626. }
  5627. for (name in oldStyle) {
  5628. if (style[name] == null) {
  5629. el.style[normalize(name)] = '';
  5630. }
  5631. }
  5632. for (name in style) {
  5633. cur = style[name];
  5634. if (cur !== oldStyle[name]) {
  5635. // ie9 setting to null has no effect, must use empty string
  5636. el.style[normalize(name)] = cur == null ? '' : cur;
  5637. }
  5638. }
  5639. }
  5640. var style = {
  5641. create: updateStyle,
  5642. update: updateStyle
  5643. };
  5644. /* */
  5645. /**
  5646. * Add class with compatibility for SVG since classList is not supported on
  5647. * SVG elements in IE
  5648. */
  5649. function addClass (el, cls) {
  5650. /* istanbul ignore else */
  5651. if (el.classList) {
  5652. if (cls.indexOf(' ') > -1) {
  5653. cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
  5654. } else {
  5655. el.classList.add(cls);
  5656. }
  5657. } else {
  5658. var cur = ' ' + el.getAttribute('class') + ' ';
  5659. if (cur.indexOf(' ' + cls + ' ') < 0) {
  5660. el.setAttribute('class', (cur + cls).trim());
  5661. }
  5662. }
  5663. }
  5664. /**
  5665. * Remove class with compatibility for SVG since classList is not supported on
  5666. * SVG elements in IE
  5667. */
  5668. function removeClass (el, cls) {
  5669. /* istanbul ignore else */
  5670. if (el.classList) {
  5671. if (cls.indexOf(' ') > -1) {
  5672. cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
  5673. } else {
  5674. el.classList.remove(cls);
  5675. }
  5676. } else {
  5677. var cur = ' ' + el.getAttribute('class') + ' ';
  5678. var tar = ' ' + cls + ' ';
  5679. while (cur.indexOf(tar) >= 0) {
  5680. cur = cur.replace(tar, ' ');
  5681. }
  5682. el.setAttribute('class', cur.trim());
  5683. }
  5684. }
  5685. /* */
  5686. var hasTransition = inBrowser && !isIE9;
  5687. var TRANSITION = 'transition';
  5688. var ANIMATION = 'animation';
  5689. // Transition property/event sniffing
  5690. var transitionProp = 'transition';
  5691. var transitionEndEvent = 'transitionend';
  5692. var animationProp = 'animation';
  5693. var animationEndEvent = 'animationend';
  5694. if (hasTransition) {
  5695. /* istanbul ignore if */
  5696. if (window.ontransitionend === undefined &&
  5697. window.onwebkittransitionend !== undefined) {
  5698. transitionProp = 'WebkitTransition';
  5699. transitionEndEvent = 'webkitTransitionEnd';
  5700. }
  5701. if (window.onanimationend === undefined &&
  5702. window.onwebkitanimationend !== undefined) {
  5703. animationProp = 'WebkitAnimation';
  5704. animationEndEvent = 'webkitAnimationEnd';
  5705. }
  5706. }
  5707. var raf = (inBrowser && window.requestAnimationFrame) || setTimeout;
  5708. function nextFrame (fn) {
  5709. raf(function () {
  5710. raf(fn);
  5711. });
  5712. }
  5713. function addTransitionClass (el, cls) {
  5714. (el._transitionClasses || (el._transitionClasses = [])).push(cls);
  5715. addClass(el, cls);
  5716. }
  5717. function removeTransitionClass (el, cls) {
  5718. if (el._transitionClasses) {
  5719. remove$1(el._transitionClasses, cls);
  5720. }
  5721. removeClass(el, cls);
  5722. }
  5723. function whenTransitionEnds (
  5724. el,
  5725. expectedType,
  5726. cb
  5727. ) {
  5728. var ref = getTransitionInfo(el, expectedType);
  5729. var type = ref.type;
  5730. var timeout = ref.timeout;
  5731. var propCount = ref.propCount;
  5732. if (!type) { return cb() }
  5733. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  5734. var ended = 0;
  5735. var end = function () {
  5736. el.removeEventListener(event, onEnd);
  5737. cb();
  5738. };
  5739. var onEnd = function (e) {
  5740. if (e.target === el) {
  5741. if (++ended >= propCount) {
  5742. end();
  5743. }
  5744. }
  5745. };
  5746. setTimeout(function () {
  5747. if (ended < propCount) {
  5748. end();
  5749. }
  5750. }, timeout + 1);
  5751. el.addEventListener(event, onEnd);
  5752. }
  5753. var transformRE = /\b(transform|all)(,|$)/;
  5754. function getTransitionInfo (el, expectedType) {
  5755. var styles = window.getComputedStyle(el);
  5756. var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');
  5757. var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
  5758. var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);
  5759. var animationDelays = styles[animationProp + 'Delay'].split(', ');
  5760. var animationDurations = styles[animationProp + 'Duration'].split(', ');
  5761. var animationTimeout = getTimeout(animationDelays, animationDurations);
  5762. var type;
  5763. var timeout = 0;
  5764. var propCount = 0;
  5765. /* istanbul ignore if */
  5766. if (expectedType === TRANSITION) {
  5767. if (transitionTimeout > 0) {
  5768. type = TRANSITION;
  5769. timeout = transitionTimeout;
  5770. propCount = transitionDurations.length;
  5771. }
  5772. } else if (expectedType === ANIMATION) {
  5773. if (animationTimeout > 0) {
  5774. type = ANIMATION;
  5775. timeout = animationTimeout;
  5776. propCount = animationDurations.length;
  5777. }
  5778. } else {
  5779. timeout = Math.max(transitionTimeout, animationTimeout);
  5780. type = timeout > 0
  5781. ? transitionTimeout > animationTimeout
  5782. ? TRANSITION
  5783. : ANIMATION
  5784. : null;
  5785. propCount = type
  5786. ? type === TRANSITION
  5787. ? transitionDurations.length
  5788. : animationDurations.length
  5789. : 0;
  5790. }
  5791. var hasTransform =
  5792. type === TRANSITION &&
  5793. transformRE.test(styles[transitionProp + 'Property']);
  5794. return {
  5795. type: type,
  5796. timeout: timeout,
  5797. propCount: propCount,
  5798. hasTransform: hasTransform
  5799. }
  5800. }
  5801. function getTimeout (delays, durations) {
  5802. return Math.max.apply(null, durations.map(function (d, i) {
  5803. return toMs(d) + toMs(delays[i])
  5804. }))
  5805. }
  5806. function toMs (s) {
  5807. return Number(s.slice(0, -1)) * 1000
  5808. }
  5809. /* */
  5810. function enter (vnode) {
  5811. var el = vnode.elm;
  5812. // call leave callback now
  5813. if (el._leaveCb) {
  5814. el._leaveCb.cancelled = true;
  5815. el._leaveCb();
  5816. }
  5817. var data = resolveTransition(vnode.data.transition);
  5818. if (!data) {
  5819. return
  5820. }
  5821. /* istanbul ignore if */
  5822. if (el._enterCb || el.nodeType !== 1) {
  5823. return
  5824. }
  5825. var css = data.css;
  5826. var type = data.type;
  5827. var enterClass = data.enterClass;
  5828. var enterActiveClass = data.enterActiveClass;
  5829. var appearClass = data.appearClass;
  5830. var appearActiveClass = data.appearActiveClass;
  5831. var beforeEnter = data.beforeEnter;
  5832. var enter = data.enter;
  5833. var afterEnter = data.afterEnter;
  5834. var enterCancelled = data.enterCancelled;
  5835. var beforeAppear = data.beforeAppear;
  5836. var appear = data.appear;
  5837. var afterAppear = data.afterAppear;
  5838. var appearCancelled = data.appearCancelled;
  5839. // activeInstance will always be the <transition> component managing this
  5840. // transition. One edge case to check is when the <transition> is placed
  5841. // as the root node of a child component. In that case we need to check
  5842. // <transition>'s parent for appear check.
  5843. var transitionNode = activeInstance.$vnode;
  5844. var context = transitionNode && transitionNode.parent
  5845. ? transitionNode.parent.context
  5846. : activeInstance;
  5847. var isAppear = !context._isMounted || !vnode.isRootInsert;
  5848. if (isAppear && !appear && appear !== '') {
  5849. return
  5850. }
  5851. var startClass = isAppear ? appearClass : enterClass;
  5852. var activeClass = isAppear ? appearActiveClass : enterActiveClass;
  5853. var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;
  5854. var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;
  5855. var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;
  5856. var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;
  5857. var expectsCSS = css !== false && !isIE9;
  5858. var userWantsControl =
  5859. enterHook &&
  5860. // enterHook may be a bound method which exposes
  5861. // the length of original fn as _length
  5862. (enterHook._length || enterHook.length) > 1;
  5863. var cb = el._enterCb = once(function () {
  5864. if (expectsCSS) {
  5865. removeTransitionClass(el, activeClass);
  5866. }
  5867. if (cb.cancelled) {
  5868. if (expectsCSS) {
  5869. removeTransitionClass(el, startClass);
  5870. }
  5871. enterCancelledHook && enterCancelledHook(el);
  5872. } else {
  5873. afterEnterHook && afterEnterHook(el);
  5874. }
  5875. el._enterCb = null;
  5876. });
  5877. if (!vnode.data.show) {
  5878. // remove pending leave element on enter by injecting an insert hook
  5879. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
  5880. var parent = el.parentNode;
  5881. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  5882. if (pendingNode && pendingNode.tag === vnode.tag && pendingNode.elm._leaveCb) {
  5883. pendingNode.elm._leaveCb();
  5884. }
  5885. enterHook && enterHook(el, cb);
  5886. }, 'transition-insert');
  5887. }
  5888. // start enter transition
  5889. beforeEnterHook && beforeEnterHook(el);
  5890. if (expectsCSS) {
  5891. addTransitionClass(el, startClass);
  5892. addTransitionClass(el, activeClass);
  5893. nextFrame(function () {
  5894. removeTransitionClass(el, startClass);
  5895. if (!cb.cancelled && !userWantsControl) {
  5896. whenTransitionEnds(el, type, cb);
  5897. }
  5898. });
  5899. }
  5900. if (vnode.data.show) {
  5901. enterHook && enterHook(el, cb);
  5902. }
  5903. if (!expectsCSS && !userWantsControl) {
  5904. cb();
  5905. }
  5906. }
  5907. function leave (vnode, rm) {
  5908. var el = vnode.elm;
  5909. // call enter callback now
  5910. if (el._enterCb) {
  5911. el._enterCb.cancelled = true;
  5912. el._enterCb();
  5913. }
  5914. var data = resolveTransition(vnode.data.transition);
  5915. if (!data) {
  5916. return rm()
  5917. }
  5918. /* istanbul ignore if */
  5919. if (el._leaveCb || el.nodeType !== 1) {
  5920. return
  5921. }
  5922. var css = data.css;
  5923. var type = data.type;
  5924. var leaveClass = data.leaveClass;
  5925. var leaveActiveClass = data.leaveActiveClass;
  5926. var beforeLeave = data.beforeLeave;
  5927. var leave = data.leave;
  5928. var afterLeave = data.afterLeave;
  5929. var leaveCancelled = data.leaveCancelled;
  5930. var delayLeave = data.delayLeave;
  5931. var expectsCSS = css !== false && !isIE9;
  5932. var userWantsControl =
  5933. leave &&
  5934. // leave hook may be a bound method which exposes
  5935. // the length of original fn as _length
  5936. (leave._length || leave.length) > 1;
  5937. var cb = el._leaveCb = once(function () {
  5938. if (el.parentNode && el.parentNode._pending) {
  5939. el.parentNode._pending[vnode.key] = null;
  5940. }
  5941. if (expectsCSS) {
  5942. removeTransitionClass(el, leaveActiveClass);
  5943. }
  5944. if (cb.cancelled) {
  5945. if (expectsCSS) {
  5946. removeTransitionClass(el, leaveClass);
  5947. }
  5948. leaveCancelled && leaveCancelled(el);
  5949. } else {
  5950. rm();
  5951. afterLeave && afterLeave(el);
  5952. }
  5953. el._leaveCb = null;
  5954. });
  5955. if (delayLeave) {
  5956. delayLeave(performLeave);
  5957. } else {
  5958. performLeave();
  5959. }
  5960. function performLeave () {
  5961. // the delayed leave may have already been cancelled
  5962. if (cb.cancelled) {
  5963. return
  5964. }
  5965. // record leaving element
  5966. if (!vnode.data.show) {
  5967. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
  5968. }
  5969. beforeLeave && beforeLeave(el);
  5970. if (expectsCSS) {
  5971. addTransitionClass(el, leaveClass);
  5972. addTransitionClass(el, leaveActiveClass);
  5973. nextFrame(function () {
  5974. removeTransitionClass(el, leaveClass);
  5975. if (!cb.cancelled && !userWantsControl) {
  5976. whenTransitionEnds(el, type, cb);
  5977. }
  5978. });
  5979. }
  5980. leave && leave(el, cb);
  5981. if (!expectsCSS && !userWantsControl) {
  5982. cb();
  5983. }
  5984. }
  5985. }
  5986. function resolveTransition (def$$1) {
  5987. if (!def$$1) {
  5988. return
  5989. }
  5990. /* istanbul ignore else */
  5991. if (typeof def$$1 === 'object') {
  5992. var res = {};
  5993. if (def$$1.css !== false) {
  5994. extend(res, autoCssTransition(def$$1.name || 'v'));
  5995. }
  5996. extend(res, def$$1);
  5997. return res
  5998. } else if (typeof def$$1 === 'string') {
  5999. return autoCssTransition(def$$1)
  6000. }
  6001. }
  6002. var autoCssTransition = cached(function (name) {
  6003. return {
  6004. enterClass: (name + "-enter"),
  6005. leaveClass: (name + "-leave"),
  6006. appearClass: (name + "-enter"),
  6007. enterActiveClass: (name + "-enter-active"),
  6008. leaveActiveClass: (name + "-leave-active"),
  6009. appearActiveClass: (name + "-enter-active")
  6010. }
  6011. });
  6012. function once (fn) {
  6013. var called = false;
  6014. return function () {
  6015. if (!called) {
  6016. called = true;
  6017. fn();
  6018. }
  6019. }
  6020. }
  6021. var transition = inBrowser ? {
  6022. create: function create (_, vnode) {
  6023. if (!vnode.data.show) {
  6024. enter(vnode);
  6025. }
  6026. },
  6027. remove: function remove (vnode, rm) {
  6028. /* istanbul ignore else */
  6029. if (!vnode.data.show) {
  6030. leave(vnode, rm);
  6031. } else {
  6032. rm();
  6033. }
  6034. }
  6035. } : {};
  6036. var platformModules = [
  6037. attrs,
  6038. klass,
  6039. events,
  6040. domProps,
  6041. style,
  6042. transition
  6043. ];
  6044. /* */
  6045. // the directive module should be applied last, after all
  6046. // built-in modules have been applied.
  6047. var modules = platformModules.concat(baseModules);
  6048. var patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  6049. /**
  6050. * Not type checking this file because flow doesn't like attaching
  6051. * properties to Elements.
  6052. */
  6053. var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_\-]*)?$/;
  6054. /* istanbul ignore if */
  6055. if (isIE9) {
  6056. // http://www.matts411.com/post/internet-explorer-9-oninput/
  6057. document.addEventListener('selectionchange', function () {
  6058. var el = document.activeElement;
  6059. if (el && el.vmodel) {
  6060. trigger(el, 'input');
  6061. }
  6062. });
  6063. }
  6064. var model = {
  6065. inserted: function inserted (el, binding, vnode) {
  6066. if (process.env.NODE_ENV !== 'production') {
  6067. if (!modelableTagRE.test(vnode.tag)) {
  6068. warn(
  6069. "v-model is not supported on element type: <" + (vnode.tag) + ">. " +
  6070. 'If you are working with contenteditable, it\'s recommended to ' +
  6071. 'wrap a library dedicated for that purpose inside a custom component.',
  6072. vnode.context
  6073. );
  6074. }
  6075. }
  6076. if (vnode.tag === 'select') {
  6077. var cb = function () {
  6078. setSelected(el, binding, vnode.context);
  6079. };
  6080. cb();
  6081. /* istanbul ignore if */
  6082. if (isIE || isEdge) {
  6083. setTimeout(cb, 0);
  6084. }
  6085. } else if (
  6086. (vnode.tag === 'textarea' || el.type === 'text') &&
  6087. !binding.modifiers.lazy
  6088. ) {
  6089. if (!isAndroid) {
  6090. el.addEventListener('compositionstart', onCompositionStart);
  6091. el.addEventListener('compositionend', onCompositionEnd);
  6092. }
  6093. /* istanbul ignore if */
  6094. if (isIE9) {
  6095. el.vmodel = true;
  6096. }
  6097. }
  6098. },
  6099. componentUpdated: function componentUpdated (el, binding, vnode) {
  6100. if (vnode.tag === 'select') {
  6101. setSelected(el, binding, vnode.context);
  6102. // in case the options rendered by v-for have changed,
  6103. // it's possible that the value is out-of-sync with the rendered options.
  6104. // detect such cases and filter out values that no longer has a matchig
  6105. // option in the DOM.
  6106. var needReset = el.multiple
  6107. ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
  6108. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
  6109. if (needReset) {
  6110. trigger(el, 'change');
  6111. }
  6112. }
  6113. }
  6114. };
  6115. function setSelected (el, binding, vm) {
  6116. var value = binding.value;
  6117. var isMultiple = el.multiple;
  6118. if (isMultiple && !Array.isArray(value)) {
  6119. process.env.NODE_ENV !== 'production' && warn(
  6120. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  6121. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  6122. vm
  6123. );
  6124. return
  6125. }
  6126. var selected, option;
  6127. for (var i = 0, l = el.options.length; i < l; i++) {
  6128. option = el.options[i];
  6129. if (isMultiple) {
  6130. selected = looseIndexOf(value, getValue(option)) > -1;
  6131. if (option.selected !== selected) {
  6132. option.selected = selected;
  6133. }
  6134. } else {
  6135. if (looseEqual(getValue(option), value)) {
  6136. if (el.selectedIndex !== i) {
  6137. el.selectedIndex = i;
  6138. }
  6139. return
  6140. }
  6141. }
  6142. }
  6143. if (!isMultiple) {
  6144. el.selectedIndex = -1;
  6145. }
  6146. }
  6147. function hasNoMatchingOption (value, options) {
  6148. for (var i = 0, l = options.length; i < l; i++) {
  6149. if (looseEqual(getValue(options[i]), value)) {
  6150. return false
  6151. }
  6152. }
  6153. return true
  6154. }
  6155. function getValue (option) {
  6156. return '_value' in option
  6157. ? option._value
  6158. : option.value
  6159. }
  6160. function onCompositionStart (e) {
  6161. e.target.composing = true;
  6162. }
  6163. function onCompositionEnd (e) {
  6164. e.target.composing = false;
  6165. trigger(e.target, 'input');
  6166. }
  6167. function trigger (el, type) {
  6168. var e = document.createEvent('HTMLEvents');
  6169. e.initEvent(type, true, true);
  6170. el.dispatchEvent(e);
  6171. }
  6172. /* */
  6173. // recursively search for possible transition defined inside the component root
  6174. function locateNode (vnode) {
  6175. return vnode.child && (!vnode.data || !vnode.data.transition)
  6176. ? locateNode(vnode.child._vnode)
  6177. : vnode
  6178. }
  6179. var show = {
  6180. bind: function bind (el, ref, vnode) {
  6181. var value = ref.value;
  6182. vnode = locateNode(vnode);
  6183. var transition = vnode.data && vnode.data.transition;
  6184. if (value && transition && !isIE9) {
  6185. enter(vnode);
  6186. }
  6187. var originalDisplay = el.style.display === 'none' ? '' : el.style.display;
  6188. el.style.display = value ? originalDisplay : 'none';
  6189. el.__vOriginalDisplay = originalDisplay;
  6190. },
  6191. update: function update (el, ref, vnode) {
  6192. var value = ref.value;
  6193. var oldValue = ref.oldValue;
  6194. /* istanbul ignore if */
  6195. if (value === oldValue) { return }
  6196. vnode = locateNode(vnode);
  6197. var transition = vnode.data && vnode.data.transition;
  6198. if (transition && !isIE9) {
  6199. if (value) {
  6200. enter(vnode);
  6201. el.style.display = el.__vOriginalDisplay;
  6202. } else {
  6203. leave(vnode, function () {
  6204. el.style.display = 'none';
  6205. });
  6206. }
  6207. } else {
  6208. el.style.display = value ? el.__vOriginalDisplay : 'none';
  6209. }
  6210. }
  6211. };
  6212. var platformDirectives = {
  6213. model: model,
  6214. show: show
  6215. };
  6216. /* */
  6217. // Provides transition support for a single element/component.
  6218. // supports transition mode (out-in / in-out)
  6219. var transitionProps = {
  6220. name: String,
  6221. appear: Boolean,
  6222. css: Boolean,
  6223. mode: String,
  6224. type: String,
  6225. enterClass: String,
  6226. leaveClass: String,
  6227. enterActiveClass: String,
  6228. leaveActiveClass: String,
  6229. appearClass: String,
  6230. appearActiveClass: String
  6231. };
  6232. // in case the child is also an abstract component, e.g. <keep-alive>
  6233. // we want to recrusively retrieve the real component to be rendered
  6234. function getRealChild (vnode) {
  6235. var compOptions = vnode && vnode.componentOptions;
  6236. if (compOptions && compOptions.Ctor.options.abstract) {
  6237. return getRealChild(getFirstComponentChild(compOptions.children))
  6238. } else {
  6239. return vnode
  6240. }
  6241. }
  6242. function extractTransitionData (comp) {
  6243. var data = {};
  6244. var options = comp.$options;
  6245. // props
  6246. for (var key in options.propsData) {
  6247. data[key] = comp[key];
  6248. }
  6249. // events.
  6250. // extract listeners and pass them directly to the transition methods
  6251. var listeners = options._parentListeners;
  6252. for (var key$1 in listeners) {
  6253. data[camelize(key$1)] = listeners[key$1].fn;
  6254. }
  6255. return data
  6256. }
  6257. function placeholder (h, rawChild) {
  6258. return /\d-keep-alive$/.test(rawChild.tag)
  6259. ? h('keep-alive')
  6260. : null
  6261. }
  6262. function hasParentTransition (vnode) {
  6263. while ((vnode = vnode.parent)) {
  6264. if (vnode.data.transition) {
  6265. return true
  6266. }
  6267. }
  6268. }
  6269. var Transition = {
  6270. name: 'transition',
  6271. props: transitionProps,
  6272. abstract: true,
  6273. render: function render (h) {
  6274. var this$1 = this;
  6275. var children = this.$slots.default;
  6276. if (!children) {
  6277. return
  6278. }
  6279. // filter out text nodes (possible whitespaces)
  6280. children = children.filter(function (c) { return c.tag; });
  6281. /* istanbul ignore if */
  6282. if (!children.length) {
  6283. return
  6284. }
  6285. // warn multiple elements
  6286. if (process.env.NODE_ENV !== 'production' && children.length > 1) {
  6287. warn(
  6288. '<transition> can only be used on a single element. Use ' +
  6289. '<transition-group> for lists.',
  6290. this.$parent
  6291. );
  6292. }
  6293. var mode = this.mode;
  6294. // warn invalid mode
  6295. if (process.env.NODE_ENV !== 'production' &&
  6296. mode && mode !== 'in-out' && mode !== 'out-in') {
  6297. warn(
  6298. 'invalid <transition> mode: ' + mode,
  6299. this.$parent
  6300. );
  6301. }
  6302. var rawChild = children[0];
  6303. // if this is a component root node and the component's
  6304. // parent container node also has transition, skip.
  6305. if (hasParentTransition(this.$vnode)) {
  6306. return rawChild
  6307. }
  6308. // apply transition data to child
  6309. // use getRealChild() to ignore abstract components e.g. keep-alive
  6310. var child = getRealChild(rawChild);
  6311. /* istanbul ignore if */
  6312. if (!child) {
  6313. return rawChild
  6314. }
  6315. if (this._leaving) {
  6316. return placeholder(h, rawChild)
  6317. }
  6318. var key = child.key = child.key == null || child.isStatic
  6319. ? ("__v" + (child.tag + this._uid) + "__")
  6320. : child.key;
  6321. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  6322. var oldRawChild = this._vnode;
  6323. var oldChild = getRealChild(oldRawChild);
  6324. // mark v-show
  6325. // so that the transition module can hand over the control to the directive
  6326. if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
  6327. child.data.show = true;
  6328. }
  6329. if (oldChild && oldChild.data && oldChild.key !== key) {
  6330. // replace old child transition data with fresh one
  6331. // important for dynamic transitions!
  6332. var oldData = oldChild.data.transition = extend({}, data);
  6333. // handle transition mode
  6334. if (mode === 'out-in') {
  6335. // return placeholder node and queue update when leave finishes
  6336. this._leaving = true;
  6337. mergeVNodeHook(oldData, 'afterLeave', function () {
  6338. this$1._leaving = false;
  6339. this$1.$forceUpdate();
  6340. }, key);
  6341. return placeholder(h, rawChild)
  6342. } else if (mode === 'in-out') {
  6343. var delayedLeave;
  6344. var performLeave = function () { delayedLeave(); };
  6345. mergeVNodeHook(data, 'afterEnter', performLeave, key);
  6346. mergeVNodeHook(data, 'enterCancelled', performLeave, key);
  6347. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  6348. delayedLeave = leave;
  6349. }, key);
  6350. }
  6351. }
  6352. return rawChild
  6353. }
  6354. };
  6355. /* */
  6356. // Provides transition support for list items.
  6357. // supports move transitions using the FLIP technique.
  6358. // Because the vdom's children update algorithm is "unstable" - i.e.
  6359. // it doesn't guarantee the relative positioning of removed elements,
  6360. // we force transition-group to update its children into two passes:
  6361. // in the first pass, we remove all nodes that need to be removed,
  6362. // triggering their leaving transition; in the second pass, we insert/move
  6363. // into the final disired state. This way in the second pass removed
  6364. // nodes will remain where they should be.
  6365. var props = extend({
  6366. tag: String,
  6367. moveClass: String
  6368. }, transitionProps);
  6369. delete props.mode;
  6370. var TransitionGroup = {
  6371. props: props,
  6372. render: function render (h) {
  6373. var tag = this.tag || this.$vnode.data.tag || 'span';
  6374. var map = Object.create(null);
  6375. var prevChildren = this.prevChildren = this.children;
  6376. var rawChildren = this.$slots.default || [];
  6377. var children = this.children = [];
  6378. var transitionData = extractTransitionData(this);
  6379. for (var i = 0; i < rawChildren.length; i++) {
  6380. var c = rawChildren[i];
  6381. if (c.tag) {
  6382. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  6383. children.push(c);
  6384. map[c.key] = c
  6385. ;(c.data || (c.data = {})).transition = transitionData;
  6386. } else if (process.env.NODE_ENV !== 'production') {
  6387. var opts = c.componentOptions;
  6388. var name = opts
  6389. ? (opts.Ctor.options.name || opts.tag)
  6390. : c.tag;
  6391. warn(("<transition-group> children must be keyed: <" + name + ">"));
  6392. }
  6393. }
  6394. }
  6395. if (prevChildren) {
  6396. var kept = [];
  6397. var removed = [];
  6398. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  6399. var c$1 = prevChildren[i$1];
  6400. c$1.data.transition = transitionData;
  6401. c$1.data.pos = c$1.elm.getBoundingClientRect();
  6402. if (map[c$1.key]) {
  6403. kept.push(c$1);
  6404. } else {
  6405. removed.push(c$1);
  6406. }
  6407. }
  6408. this.kept = h(tag, null, kept);
  6409. this.removed = removed;
  6410. }
  6411. return h(tag, null, children)
  6412. },
  6413. beforeUpdate: function beforeUpdate () {
  6414. // force removing pass
  6415. this.__patch__(
  6416. this._vnode,
  6417. this.kept,
  6418. false, // hydrating
  6419. true // removeOnly (!important, avoids unnecessary moves)
  6420. );
  6421. this._vnode = this.kept;
  6422. },
  6423. updated: function updated () {
  6424. var children = this.prevChildren;
  6425. var moveClass = this.moveClass || (this.name + '-move');
  6426. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  6427. return
  6428. }
  6429. // we divide the work into three loops to avoid mixing DOM reads and writes
  6430. // in each iteration - which helps prevent layout thrashing.
  6431. children.forEach(callPendingCbs);
  6432. children.forEach(recordPosition);
  6433. children.forEach(applyTranslation);
  6434. // force reflow to put everything in position
  6435. var f = document.body.offsetHeight; // eslint-disable-line
  6436. children.forEach(function (c) {
  6437. if (c.data.moved) {
  6438. var el = c.elm;
  6439. var s = el.style;
  6440. addTransitionClass(el, moveClass);
  6441. s.transform = s.WebkitTransform = s.transitionDuration = '';
  6442. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  6443. if (!e || /transform$/.test(e.propertyName)) {
  6444. el.removeEventListener(transitionEndEvent, cb);
  6445. el._moveCb = null;
  6446. removeTransitionClass(el, moveClass);
  6447. }
  6448. });
  6449. }
  6450. });
  6451. },
  6452. methods: {
  6453. hasMove: function hasMove (el, moveClass) {
  6454. /* istanbul ignore if */
  6455. if (!hasTransition) {
  6456. return false
  6457. }
  6458. if (this._hasMove != null) {
  6459. return this._hasMove
  6460. }
  6461. addTransitionClass(el, moveClass);
  6462. var info = getTransitionInfo(el);
  6463. removeTransitionClass(el, moveClass);
  6464. return (this._hasMove = info.hasTransform)
  6465. }
  6466. }
  6467. };
  6468. function callPendingCbs (c) {
  6469. /* istanbul ignore if */
  6470. if (c.elm._moveCb) {
  6471. c.elm._moveCb();
  6472. }
  6473. /* istanbul ignore if */
  6474. if (c.elm._enterCb) {
  6475. c.elm._enterCb();
  6476. }
  6477. }
  6478. function recordPosition (c) {
  6479. c.data.newPos = c.elm.getBoundingClientRect();
  6480. }
  6481. function applyTranslation (c) {
  6482. var oldPos = c.data.pos;
  6483. var newPos = c.data.newPos;
  6484. var dx = oldPos.left - newPos.left;
  6485. var dy = oldPos.top - newPos.top;
  6486. if (dx || dy) {
  6487. c.data.moved = true;
  6488. var s = c.elm.style;
  6489. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  6490. s.transitionDuration = '0s';
  6491. }
  6492. }
  6493. var platformComponents = {
  6494. Transition: Transition,
  6495. TransitionGroup: TransitionGroup
  6496. };
  6497. /* */
  6498. // install platform specific utils
  6499. Vue$2.config.isUnknownElement = isUnknownElement;
  6500. Vue$2.config.isReservedTag = isReservedTag;
  6501. Vue$2.config.getTagNamespace = getTagNamespace;
  6502. Vue$2.config.mustUseProp = mustUseProp;
  6503. // install platform runtime directives & components
  6504. extend(Vue$2.options.directives, platformDirectives);
  6505. extend(Vue$2.options.components, platformComponents);
  6506. // install platform patch function
  6507. Vue$2.prototype.__patch__ = config._isServer ? noop : patch$1;
  6508. // wrap mount
  6509. Vue$2.prototype.$mount = function (
  6510. el,
  6511. hydrating
  6512. ) {
  6513. el = el && !config._isServer ? query(el) : undefined;
  6514. return this._mount(el, hydrating)
  6515. };
  6516. // devtools global hook
  6517. /* istanbul ignore next */
  6518. setTimeout(function () {
  6519. if (config.devtools) {
  6520. if (devtools) {
  6521. devtools.emit('init', Vue$2);
  6522. } else if (
  6523. process.env.NODE_ENV !== 'production' &&
  6524. inBrowser && /Chrome\/\d+/.test(window.navigator.userAgent)
  6525. ) {
  6526. console.log(
  6527. 'Download the Vue Devtools for a better development experience:\n' +
  6528. 'https://github.com/vuejs/vue-devtools'
  6529. );
  6530. }
  6531. }
  6532. }, 0);
  6533. module.exports = Vue$2;
  6534. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
  6535. /***/ },
  6536. /* 48 */
  6537. /***/ function(module, exports, __webpack_require__) {
  6538. module.exports = { "default": __webpack_require__(178), __esModule: true };
  6539. /***/ },
  6540. /* 49 */,
  6541. /* 50 */,
  6542. /* 51 */,
  6543. /* 52 */
  6544. /***/ function(module, exports) {
  6545. module.exports = function(it){
  6546. if(typeof it != 'function')throw TypeError(it + ' is not a function!');
  6547. return it;
  6548. };
  6549. /***/ },
  6550. /* 53 */
  6551. /***/ function(module, exports) {
  6552. // 7.2.1 RequireObjectCoercible(argument)
  6553. module.exports = function(it){
  6554. if(it == undefined)throw TypeError("Can't call method on " + it);
  6555. return it;
  6556. };
  6557. /***/ },
  6558. /* 54 */
  6559. /***/ function(module, exports, __webpack_require__) {
  6560. var isObject = __webpack_require__(42)
  6561. , document = __webpack_require__(6).document
  6562. // in old IE typeof document.createElement is 'object'
  6563. , is = isObject(document) && isObject(document.createElement);
  6564. module.exports = function(it){
  6565. return is ? document.createElement(it) : {};
  6566. };
  6567. /***/ },
  6568. /* 55 */
  6569. /***/ function(module, exports) {
  6570. module.exports = function(exec){
  6571. try {
  6572. return !!exec();
  6573. } catch(e){
  6574. return true;
  6575. }
  6576. };
  6577. /***/ },
  6578. /* 56 */
  6579. /***/ function(module, exports, __webpack_require__) {
  6580. var def = __webpack_require__(28).f
  6581. , has = __webpack_require__(41)
  6582. , TAG = __webpack_require__(5)('toStringTag');
  6583. module.exports = function(it, tag, stat){
  6584. if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
  6585. };
  6586. /***/ },
  6587. /* 57 */
  6588. /***/ function(module, exports, __webpack_require__) {
  6589. var shared = __webpack_require__(100)('keys')
  6590. , uid = __webpack_require__(104);
  6591. module.exports = function(key){
  6592. return shared[key] || (shared[key] = uid(key));
  6593. };
  6594. /***/ },
  6595. /* 58 */
  6596. /***/ function(module, exports) {
  6597. // 7.1.4 ToInteger
  6598. var ceil = Math.ceil
  6599. , floor = Math.floor;
  6600. module.exports = function(it){
  6601. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  6602. };
  6603. /***/ },
  6604. /* 59 */
  6605. /***/ function(module, exports, __webpack_require__) {
  6606. // to indexed object, toObject with fallback for non-array-like ES3 strings
  6607. var IObject = __webpack_require__(95)
  6608. , defined = __webpack_require__(53);
  6609. module.exports = function(it){
  6610. return IObject(defined(it));
  6611. };
  6612. /***/ },
  6613. /* 60 */,
  6614. /* 61 */,
  6615. /* 62 */,
  6616. /* 63 */,
  6617. /* 64 */,
  6618. /* 65 */,
  6619. /* 66 */,
  6620. /* 67 */,
  6621. /* 68 */,
  6622. /* 69 */,
  6623. /* 70 */,
  6624. /* 71 */,
  6625. /* 72 */
  6626. /***/ function(module, exports, __webpack_require__) {
  6627. module.exports = __webpack_require__(133);
  6628. /***/ },
  6629. /* 73 */
  6630. /***/ function(module, exports, __webpack_require__) {
  6631. "use strict";
  6632. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  6633. var utils = __webpack_require__(4);
  6634. var settle = __webpack_require__(139);
  6635. var buildURL = __webpack_require__(142);
  6636. var parseHeaders = __webpack_require__(148);
  6637. var isURLSameOrigin = __webpack_require__(146);
  6638. var createError = __webpack_require__(76);
  6639. var btoa = (typeof window !== 'undefined' && window.btoa) || __webpack_require__(141);
  6640. module.exports = function xhrAdapter(config) {
  6641. return new Promise(function dispatchXhrRequest(resolve, reject) {
  6642. var requestData = config.data;
  6643. var requestHeaders = config.headers;
  6644. if (utils.isFormData(requestData)) {
  6645. delete requestHeaders['Content-Type']; // Let the browser set it
  6646. }
  6647. var request = new XMLHttpRequest();
  6648. var loadEvent = 'onreadystatechange';
  6649. var xDomain = false;
  6650. // For IE 8/9 CORS support
  6651. // Only supports POST and GET calls and doesn't returns the response headers.
  6652. // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
  6653. if (process.env.NODE_ENV !== 'test' &&
  6654. typeof window !== 'undefined' &&
  6655. window.XDomainRequest && !('withCredentials' in request) &&
  6656. !isURLSameOrigin(config.url)) {
  6657. request = new window.XDomainRequest();
  6658. loadEvent = 'onload';
  6659. xDomain = true;
  6660. request.onprogress = function handleProgress() {};
  6661. request.ontimeout = function handleTimeout() {};
  6662. }
  6663. // HTTP basic authentication
  6664. if (config.auth) {
  6665. var username = config.auth.username || '';
  6666. var password = config.auth.password || '';
  6667. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  6668. }
  6669. request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
  6670. // Set the request timeout in MS
  6671. request.timeout = config.timeout;
  6672. // Listen for ready state
  6673. request[loadEvent] = function handleLoad() {
  6674. if (!request || (request.readyState !== 4 && !xDomain)) {
  6675. return;
  6676. }
  6677. // The request errored out and we didn't get a response, this will be
  6678. // handled by onerror instead
  6679. // With one exception: request that using file: protocol, most browsers
  6680. // will return status as 0 even though it's a successful request
  6681. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  6682. return;
  6683. }
  6684. // Prepare the response
  6685. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  6686. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  6687. var response = {
  6688. data: responseData,
  6689. // IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201)
  6690. status: request.status === 1223 ? 204 : request.status,
  6691. statusText: request.status === 1223 ? 'No Content' : request.statusText,
  6692. headers: responseHeaders,
  6693. config: config,
  6694. request: request
  6695. };
  6696. settle(resolve, reject, response);
  6697. // Clean up request
  6698. request = null;
  6699. };
  6700. // Handle low level network errors
  6701. request.onerror = function handleError() {
  6702. // Real errors are hidden from us by the browser
  6703. // onerror should only fire if it's a network error
  6704. reject(createError('Network Error', config));
  6705. // Clean up request
  6706. request = null;
  6707. };
  6708. // Handle timeout
  6709. request.ontimeout = function handleTimeout() {
  6710. reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED'));
  6711. // Clean up request
  6712. request = null;
  6713. };
  6714. // Add xsrf header
  6715. // This is only done if running in a standard browser environment.
  6716. // Specifically not if we're in a web worker, or react-native.
  6717. if (utils.isStandardBrowserEnv()) {
  6718. var cookies = __webpack_require__(144);
  6719. // Add xsrf header
  6720. var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
  6721. cookies.read(config.xsrfCookieName) :
  6722. undefined;
  6723. if (xsrfValue) {
  6724. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  6725. }
  6726. }
  6727. // Add headers to the request
  6728. if ('setRequestHeader' in request) {
  6729. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  6730. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  6731. // Remove Content-Type if data is undefined
  6732. delete requestHeaders[key];
  6733. } else {
  6734. // Otherwise add header to the request
  6735. request.setRequestHeader(key, val);
  6736. }
  6737. });
  6738. }
  6739. // Add withCredentials to request if needed
  6740. if (config.withCredentials) {
  6741. request.withCredentials = true;
  6742. }
  6743. // Add responseType to request if needed
  6744. if (config.responseType) {
  6745. try {
  6746. request.responseType = config.responseType;
  6747. } catch (e) {
  6748. if (request.responseType !== 'json') {
  6749. throw e;
  6750. }
  6751. }
  6752. }
  6753. // Handle progress if needed
  6754. if (typeof config.onDownloadProgress === 'function') {
  6755. request.addEventListener('progress', config.onDownloadProgress);
  6756. }
  6757. // Not all browsers support upload events
  6758. if (typeof config.onUploadProgress === 'function' && request.upload) {
  6759. request.upload.addEventListener('progress', config.onUploadProgress);
  6760. }
  6761. if (config.cancelToken) {
  6762. // Handle cancellation
  6763. config.cancelToken.promise.then(function onCanceled(cancel) {
  6764. if (!request) {
  6765. return;
  6766. }
  6767. request.abort();
  6768. reject(cancel);
  6769. // Clean up request
  6770. request = null;
  6771. });
  6772. }
  6773. if (requestData === undefined) {
  6774. requestData = null;
  6775. }
  6776. // Send the request
  6777. request.send(requestData);
  6778. });
  6779. };
  6780. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
  6781. /***/ },
  6782. /* 74 */
  6783. /***/ function(module, exports) {
  6784. "use strict";
  6785. 'use strict';
  6786. /**
  6787. * A `Cancel` is an object that is thrown when an operation is canceled.
  6788. *
  6789. * @class
  6790. * @param {string=} message The message.
  6791. */
  6792. function Cancel(message) {
  6793. this.message = message;
  6794. }
  6795. Cancel.prototype.toString = function toString() {
  6796. return 'Cancel' + (this.message ? ': ' + this.message : '');
  6797. };
  6798. Cancel.prototype.__CANCEL__ = true;
  6799. module.exports = Cancel;
  6800. /***/ },
  6801. /* 75 */
  6802. /***/ function(module, exports) {
  6803. "use strict";
  6804. 'use strict';
  6805. module.exports = function isCancel(value) {
  6806. return !!(value && value.__CANCEL__);
  6807. };
  6808. /***/ },
  6809. /* 76 */
  6810. /***/ function(module, exports, __webpack_require__) {
  6811. "use strict";
  6812. 'use strict';
  6813. var enhanceError = __webpack_require__(138);
  6814. /**
  6815. * Create an Error with the specified message, config, error code, and response.
  6816. *
  6817. * @param {string} message The error message.
  6818. * @param {Object} config The config.
  6819. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  6820. @ @param {Object} [response] The response.
  6821. * @returns {Error} The created error.
  6822. */
  6823. module.exports = function createError(message, config, code, response) {
  6824. var error = new Error(message);
  6825. return enhanceError(error, config, code, response);
  6826. };
  6827. /***/ },
  6828. /* 77 */
  6829. /***/ function(module, exports, __webpack_require__) {
  6830. "use strict";
  6831. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  6832. var utils = __webpack_require__(4);
  6833. var normalizeHeaderName = __webpack_require__(147);
  6834. var PROTECTION_PREFIX = /^\)\]\}',?\n/;
  6835. var DEFAULT_CONTENT_TYPE = {
  6836. 'Content-Type': 'application/x-www-form-urlencoded'
  6837. };
  6838. function setContentTypeIfUnset(headers, value) {
  6839. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  6840. headers['Content-Type'] = value;
  6841. }
  6842. }
  6843. function getDefaultAdapter() {
  6844. var adapter;
  6845. if (typeof XMLHttpRequest !== 'undefined') {
  6846. // For browsers use XHR adapter
  6847. adapter = __webpack_require__(73);
  6848. } else if (typeof process !== 'undefined') {
  6849. // For node use HTTP adapter
  6850. adapter = __webpack_require__(73);
  6851. }
  6852. return adapter;
  6853. }
  6854. module.exports = {
  6855. adapter: getDefaultAdapter(),
  6856. transformRequest: [function transformRequest(data, headers) {
  6857. normalizeHeaderName(headers, 'Content-Type');
  6858. if (utils.isFormData(data) ||
  6859. utils.isArrayBuffer(data) ||
  6860. utils.isStream(data) ||
  6861. utils.isFile(data) ||
  6862. utils.isBlob(data)
  6863. ) {
  6864. return data;
  6865. }
  6866. if (utils.isArrayBufferView(data)) {
  6867. return data.buffer;
  6868. }
  6869. if (utils.isURLSearchParams(data)) {
  6870. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  6871. return data.toString();
  6872. }
  6873. if (utils.isObject(data)) {
  6874. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  6875. return JSON.stringify(data);
  6876. }
  6877. return data;
  6878. }],
  6879. transformResponse: [function transformResponse(data) {
  6880. /*eslint no-param-reassign:0*/
  6881. if (typeof data === 'string') {
  6882. data = data.replace(PROTECTION_PREFIX, '');
  6883. try {
  6884. data = JSON.parse(data);
  6885. } catch (e) { /* Ignore */ }
  6886. }
  6887. return data;
  6888. }],
  6889. headers: {
  6890. common: {
  6891. 'Accept': 'application/json, text/plain, */*'
  6892. },
  6893. patch: utils.merge(DEFAULT_CONTENT_TYPE),
  6894. post: utils.merge(DEFAULT_CONTENT_TYPE),
  6895. put: utils.merge(DEFAULT_CONTENT_TYPE)
  6896. },
  6897. timeout: 0,
  6898. xsrfCookieName: 'XSRF-TOKEN',
  6899. xsrfHeaderName: 'X-XSRF-TOKEN',
  6900. maxContentLength: -1,
  6901. validateStatus: function validateStatus(status) {
  6902. return status >= 200 && status < 300;
  6903. }
  6904. };
  6905. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
  6906. /***/ },
  6907. /* 78 */
  6908. /***/ function(module, exports) {
  6909. "use strict";
  6910. 'use strict';
  6911. module.exports = function bind(fn, thisArg) {
  6912. return function wrap() {
  6913. var args = new Array(arguments.length);
  6914. for (var i = 0; i < args.length; i++) {
  6915. args[i] = arguments[i];
  6916. }
  6917. return fn.apply(thisArg, args);
  6918. };
  6919. };
  6920. /***/ },
  6921. /* 79 */
  6922. /***/ function(module, exports, __webpack_require__) {
  6923. "use strict";
  6924. "use strict";
  6925. Object.defineProperty(exports, "__esModule", {
  6926. value: true
  6927. });
  6928. var _classCallCheck2 = __webpack_require__(23);
  6929. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  6930. var _createClass2 = __webpack_require__(24);
  6931. var _createClass3 = _interopRequireDefault(_createClass2);
  6932. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  6933. var Password = function () {
  6934. function Password(password) {
  6935. (0, _classCallCheck3.default)(this, Password);
  6936. this.password = password;
  6937. this.options = {
  6938. uppercase: password.uppercase,
  6939. lowercase: password.lowercase,
  6940. numbers: password.numbers,
  6941. symbols: password.symbols,
  6942. length: password.length,
  6943. counter: password.counter
  6944. };
  6945. }
  6946. (0, _createClass3.default)(Password, [{
  6947. key: "isNewPassword",
  6948. value: function isNewPassword(passwords) {
  6949. var _this = this;
  6950. var isNew = true;
  6951. passwords.forEach(function (pwd) {
  6952. if (pwd.site === _this.password.site && pwd.login === _this.password.login) {
  6953. isNew = false;
  6954. }
  6955. });
  6956. return isNew;
  6957. }
  6958. }, {
  6959. key: "json",
  6960. value: function json() {
  6961. return this.password;
  6962. }
  6963. }]);
  6964. return Password;
  6965. }();
  6966. exports.default = Password;
  6967. /***/ },
  6968. /* 80 */
  6969. /***/ function(module, exports, __webpack_require__) {
  6970. module.exports = { "default": __webpack_require__(179), __esModule: true };
  6971. /***/ },
  6972. /* 81 */
  6973. /***/ function(module, exports, __webpack_require__) {
  6974. module.exports = { "default": __webpack_require__(180), __esModule: true };
  6975. /***/ },
  6976. /* 82 */,
  6977. /* 83 */,
  6978. /* 84 */,
  6979. /* 85 */,
  6980. /* 86 */,
  6981. /* 87 */,
  6982. /* 88 */,
  6983. /* 89 */,
  6984. /* 90 */,
  6985. /* 91 */,
  6986. /* 92 */
  6987. /***/ function(module, exports, __webpack_require__) {
  6988. // getting tag from 19.1.3.6 Object.prototype.toString()
  6989. var cof = __webpack_require__(38)
  6990. , TAG = __webpack_require__(5)('toStringTag')
  6991. // ES3 wrong here
  6992. , ARG = cof(function(){ return arguments; }()) == 'Arguments';
  6993. // fallback for IE11 Script Access Denied error
  6994. var tryGet = function(it, key){
  6995. try {
  6996. return it[key];
  6997. } catch(e){ /* empty */ }
  6998. };
  6999. module.exports = function(it){
  7000. var O, T, B;
  7001. return it === undefined ? 'Undefined' : it === null ? 'Null'
  7002. // @@toStringTag case
  7003. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  7004. // builtinTag case
  7005. : ARG ? cof(O)
  7006. // ES3 arguments fallback
  7007. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  7008. };
  7009. /***/ },
  7010. /* 93 */
  7011. /***/ function(module, exports) {
  7012. // IE 8- don't enum bug keys
  7013. module.exports = (
  7014. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  7015. ).split(',');
  7016. /***/ },
  7017. /* 94 */
  7018. /***/ function(module, exports, __webpack_require__) {
  7019. module.exports = __webpack_require__(6).document && document.documentElement;
  7020. /***/ },
  7021. /* 95 */
  7022. /***/ function(module, exports, __webpack_require__) {
  7023. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  7024. var cof = __webpack_require__(38);
  7025. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
  7026. return cof(it) == 'String' ? it.split('') : Object(it);
  7027. };
  7028. /***/ },
  7029. /* 96 */
  7030. /***/ function(module, exports, __webpack_require__) {
  7031. "use strict";
  7032. 'use strict';
  7033. var LIBRARY = __webpack_require__(97)
  7034. , $export = __webpack_require__(40)
  7035. , redefine = __webpack_require__(201)
  7036. , hide = __webpack_require__(15)
  7037. , has = __webpack_require__(41)
  7038. , Iterators = __webpack_require__(27)
  7039. , $iterCreate = __webpack_require__(189)
  7040. , setToStringTag = __webpack_require__(56)
  7041. , getPrototypeOf = __webpack_require__(197)
  7042. , ITERATOR = __webpack_require__(5)('iterator')
  7043. , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
  7044. , FF_ITERATOR = '@@iterator'
  7045. , KEYS = 'keys'
  7046. , VALUES = 'values';
  7047. var returnThis = function(){ return this; };
  7048. module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
  7049. $iterCreate(Constructor, NAME, next);
  7050. var getMethod = function(kind){
  7051. if(!BUGGY && kind in proto)return proto[kind];
  7052. switch(kind){
  7053. case KEYS: return function keys(){ return new Constructor(this, kind); };
  7054. case VALUES: return function values(){ return new Constructor(this, kind); };
  7055. } return function entries(){ return new Constructor(this, kind); };
  7056. };
  7057. var TAG = NAME + ' Iterator'
  7058. , DEF_VALUES = DEFAULT == VALUES
  7059. , VALUES_BUG = false
  7060. , proto = Base.prototype
  7061. , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
  7062. , $default = $native || getMethod(DEFAULT)
  7063. , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
  7064. , $anyNative = NAME == 'Array' ? proto.entries || $native : $native
  7065. , methods, key, IteratorPrototype;
  7066. // Fix native
  7067. if($anyNative){
  7068. IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
  7069. if(IteratorPrototype !== Object.prototype){
  7070. // Set @@toStringTag to native iterators
  7071. setToStringTag(IteratorPrototype, TAG, true);
  7072. // fix for some old engines
  7073. if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
  7074. }
  7075. }
  7076. // fix Array#{values, @@iterator}.name in V8 / FF
  7077. if(DEF_VALUES && $native && $native.name !== VALUES){
  7078. VALUES_BUG = true;
  7079. $default = function values(){ return $native.call(this); };
  7080. }
  7081. // Define iterator
  7082. if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
  7083. hide(proto, ITERATOR, $default);
  7084. }
  7085. // Plug for library
  7086. Iterators[NAME] = $default;
  7087. Iterators[TAG] = returnThis;
  7088. if(DEFAULT){
  7089. methods = {
  7090. values: DEF_VALUES ? $default : getMethod(VALUES),
  7091. keys: IS_SET ? $default : getMethod(KEYS),
  7092. entries: $entries
  7093. };
  7094. if(FORCED)for(key in methods){
  7095. if(!(key in proto))redefine(proto, key, methods[key]);
  7096. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  7097. }
  7098. return methods;
  7099. };
  7100. /***/ },
  7101. /* 97 */
  7102. /***/ function(module, exports) {
  7103. module.exports = true;
  7104. /***/ },
  7105. /* 98 */
  7106. /***/ function(module, exports, __webpack_require__) {
  7107. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  7108. var $keys = __webpack_require__(198)
  7109. , enumBugKeys = __webpack_require__(93);
  7110. module.exports = Object.keys || function keys(O){
  7111. return $keys(O, enumBugKeys);
  7112. };
  7113. /***/ },
  7114. /* 99 */
  7115. /***/ function(module, exports) {
  7116. module.exports = function(bitmap, value){
  7117. return {
  7118. enumerable : !(bitmap & 1),
  7119. configurable: !(bitmap & 2),
  7120. writable : !(bitmap & 4),
  7121. value : value
  7122. };
  7123. };
  7124. /***/ },
  7125. /* 100 */
  7126. /***/ function(module, exports, __webpack_require__) {
  7127. var global = __webpack_require__(6)
  7128. , SHARED = '__core-js_shared__'
  7129. , store = global[SHARED] || (global[SHARED] = {});
  7130. module.exports = function(key){
  7131. return store[key] || (store[key] = {});
  7132. };
  7133. /***/ },
  7134. /* 101 */
  7135. /***/ function(module, exports, __webpack_require__) {
  7136. var ctx = __webpack_require__(39)
  7137. , invoke = __webpack_require__(186)
  7138. , html = __webpack_require__(94)
  7139. , cel = __webpack_require__(54)
  7140. , global = __webpack_require__(6)
  7141. , process = global.process
  7142. , setTask = global.setImmediate
  7143. , clearTask = global.clearImmediate
  7144. , MessageChannel = global.MessageChannel
  7145. , counter = 0
  7146. , queue = {}
  7147. , ONREADYSTATECHANGE = 'onreadystatechange'
  7148. , defer, channel, port;
  7149. var run = function(){
  7150. var id = +this;
  7151. if(queue.hasOwnProperty(id)){
  7152. var fn = queue[id];
  7153. delete queue[id];
  7154. fn();
  7155. }
  7156. };
  7157. var listener = function(event){
  7158. run.call(event.data);
  7159. };
  7160. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  7161. if(!setTask || !clearTask){
  7162. setTask = function setImmediate(fn){
  7163. var args = [], i = 1;
  7164. while(arguments.length > i)args.push(arguments[i++]);
  7165. queue[++counter] = function(){
  7166. invoke(typeof fn == 'function' ? fn : Function(fn), args);
  7167. };
  7168. defer(counter);
  7169. return counter;
  7170. };
  7171. clearTask = function clearImmediate(id){
  7172. delete queue[id];
  7173. };
  7174. // Node.js 0.8-
  7175. if(__webpack_require__(38)(process) == 'process'){
  7176. defer = function(id){
  7177. process.nextTick(ctx(run, id, 1));
  7178. };
  7179. // Browsers with MessageChannel, includes WebWorkers
  7180. } else if(MessageChannel){
  7181. channel = new MessageChannel;
  7182. port = channel.port2;
  7183. channel.port1.onmessage = listener;
  7184. defer = ctx(port.postMessage, port, 1);
  7185. // Browsers with postMessage, skip WebWorkers
  7186. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  7187. } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){
  7188. defer = function(id){
  7189. global.postMessage(id + '', '*');
  7190. };
  7191. global.addEventListener('message', listener, false);
  7192. // IE8-
  7193. } else if(ONREADYSTATECHANGE in cel('script')){
  7194. defer = function(id){
  7195. html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){
  7196. html.removeChild(this);
  7197. run.call(id);
  7198. };
  7199. };
  7200. // Rest old browsers
  7201. } else {
  7202. defer = function(id){
  7203. setTimeout(ctx(run, id, 1), 0);
  7204. };
  7205. }
  7206. }
  7207. module.exports = {
  7208. set: setTask,
  7209. clear: clearTask
  7210. };
  7211. /***/ },
  7212. /* 102 */
  7213. /***/ function(module, exports, __webpack_require__) {
  7214. // 7.1.15 ToLength
  7215. var toInteger = __webpack_require__(58)
  7216. , min = Math.min;
  7217. module.exports = function(it){
  7218. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  7219. };
  7220. /***/ },
  7221. /* 103 */
  7222. /***/ function(module, exports, __webpack_require__) {
  7223. // 7.1.13 ToObject(argument)
  7224. var defined = __webpack_require__(53);
  7225. module.exports = function(it){
  7226. return Object(defined(it));
  7227. };
  7228. /***/ },
  7229. /* 104 */
  7230. /***/ function(module, exports) {
  7231. var id = 0
  7232. , px = Math.random();
  7233. module.exports = function(key){
  7234. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  7235. };
  7236. /***/ },
  7237. /* 105 */,
  7238. /* 106 */,
  7239. /* 107 */,
  7240. /* 108 */,
  7241. /* 109 */
  7242. /***/ function(module, exports, __webpack_require__) {
  7243. "use strict";
  7244. 'use strict';
  7245. var _crypto = __webpack_require__(67);
  7246. var _crypto2 = _interopRequireDefault(_crypto);
  7247. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  7248. module.exports = {
  7249. encryptLogin: _encryptLogin,
  7250. renderPassword: _renderPassword,
  7251. createFingerprint: createFingerprint,
  7252. _deriveEncryptedLogin: _deriveEncryptedLogin,
  7253. _getPasswordTemplate: _getPasswordTemplate,
  7254. _prettyPrint: _prettyPrint,
  7255. _string2charCodes: _string2charCodes,
  7256. _getCharType: _getCharType,
  7257. _getPasswordChar: _getPasswordChar,
  7258. _createHmac: _createHmac
  7259. };
  7260. function _encryptLogin(login, masterPassword) {
  7261. return new Promise(function (resolve, reject) {
  7262. if (!login || !masterPassword) {
  7263. reject('login and master password parameters could not be empty');
  7264. }
  7265. var iterations = 8192;
  7266. var keylen = 32;
  7267. _crypto2.default.pbkdf2(masterPassword, login, iterations, keylen, 'sha256', function (error, key) {
  7268. if (error) {
  7269. reject('error in pbkdf2');
  7270. } else {
  7271. resolve(key.toString('hex'));
  7272. }
  7273. });
  7274. });
  7275. }
  7276. function _renderPassword(encryptedLogin, site, passwordOptions) {
  7277. return _deriveEncryptedLogin(encryptedLogin, site, passwordOptions).then(function (derivedEncryptedLogin) {
  7278. var template = _getPasswordTemplate(passwordOptions);
  7279. return _prettyPrint(derivedEncryptedLogin, template);
  7280. });
  7281. }
  7282. function _createHmac(encryptedLogin, salt) {
  7283. return new Promise(function (resolve) {
  7284. resolve(_crypto2.default.createHmac('sha256', encryptedLogin).update(salt).digest('hex'));
  7285. });
  7286. }
  7287. function _deriveEncryptedLogin(encryptedLogin, site) {
  7288. var passwordOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { length: 12, counter: 1 };
  7289. var salt = site + passwordOptions.counter.toString();
  7290. return _createHmac(encryptedLogin, salt).then(function (derivedHash) {
  7291. return derivedHash.substring(0, passwordOptions.length);
  7292. });
  7293. }
  7294. function _getPasswordTemplate(passwordTypes) {
  7295. var templates = {
  7296. lowercase: 'vc',
  7297. uppercase: 'VC',
  7298. numbers: 'n',
  7299. symbols: 's'
  7300. };
  7301. var template = '';
  7302. for (var templateKey in templates) {
  7303. if (passwordTypes.hasOwnProperty(templateKey) && passwordTypes[templateKey]) {
  7304. template += templates[templateKey];
  7305. }
  7306. }
  7307. return template;
  7308. }
  7309. function _prettyPrint(hash, template) {
  7310. var password = '';
  7311. _string2charCodes(hash).forEach(function (charCode, index) {
  7312. var charType = _getCharType(template, index);
  7313. password += _getPasswordChar(charType, charCode);
  7314. });
  7315. return password;
  7316. }
  7317. function _string2charCodes(text) {
  7318. var charCodes = [];
  7319. for (var i = 0; i < text.length; i++) {
  7320. charCodes.push(text.charCodeAt(i));
  7321. }
  7322. return charCodes;
  7323. }
  7324. function _getCharType(template, index) {
  7325. return template[index % template.length];
  7326. }
  7327. function _getPasswordChar(charType, index) {
  7328. var passwordsChars = {
  7329. V: 'AEIOUY',
  7330. C: 'BCDFGHJKLMNPQRSTVWXZ',
  7331. v: 'aeiouy',
  7332. c: 'bcdfghjklmnpqrstvwxz',
  7333. A: 'AEIOUYBCDFGHJKLMNPQRSTVWXZ',
  7334. a: 'AEIOUYaeiouyBCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz',
  7335. n: '0123456789',
  7336. s: '@&%?,=[]_:-+*$#!\'^~;()/.',
  7337. x: 'AEIOUYaeiouyBCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz0123456789@&%?,=[]_:-+*$#!\'^~;()/.'
  7338. };
  7339. var passwordChar = passwordsChars[charType];
  7340. return passwordChar[index % passwordChar.length];
  7341. }
  7342. function createFingerprint(str) {
  7343. return new Promise(function (resolve) {
  7344. resolve(_crypto2.default.createHmac('sha256', str).digest('hex'));
  7345. });
  7346. }
  7347. /***/ },
  7348. /* 110 */,
  7349. /* 111 */,
  7350. /* 112 */,
  7351. /* 113 */,
  7352. /* 114 */,
  7353. /* 115 */,
  7354. /* 116 */,
  7355. /* 117 */,
  7356. /* 118 */,
  7357. /* 119 */
  7358. /***/ function(module, exports, __webpack_require__) {
  7359. "use strict";
  7360. 'use strict';
  7361. Object.defineProperty(exports, "__esModule", {
  7362. value: true
  7363. });
  7364. var _vue = __webpack_require__(47);
  7365. var _vue2 = _interopRequireDefault(_vue);
  7366. var _vueRouter = __webpack_require__(303);
  7367. var _vueRouter2 = _interopRequireDefault(_vueRouter);
  7368. var _PasswordGenerator = __webpack_require__(289);
  7369. var _PasswordGenerator2 = _interopRequireDefault(_PasswordGenerator);
  7370. var _Login = __webpack_require__(288);
  7371. var _Login2 = _interopRequireDefault(_Login);
  7372. var _PasswordReset = __webpack_require__(290);
  7373. var _PasswordReset2 = _interopRequireDefault(_PasswordReset);
  7374. var _PasswordResetConfirm = __webpack_require__(291);
  7375. var _PasswordResetConfirm2 = _interopRequireDefault(_PasswordResetConfirm);
  7376. var _Passwords = __webpack_require__(292);
  7377. var _Passwords2 = _interopRequireDefault(_Passwords);
  7378. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  7379. _vue2.default.use(_vueRouter2.default);
  7380. var routes = [{ path: '/', name: 'home', component: _PasswordGenerator2.default }, { path: '/login', name: 'login', component: _Login2.default }, { path: '/passwords/', name: 'passwords', component: _Passwords2.default }, { path: '/passwords/:id', name: 'password', component: _PasswordGenerator2.default }, { path: '/password/reset', name: 'passwordReset', component: _PasswordReset2.default }, { path: '/password/reset/confirm/:uid/:token', name: 'passwordResetConfirm', component: _PasswordResetConfirm2.default }];
  7381. var router = new _vueRouter2.default({
  7382. routes: routes
  7383. });
  7384. exports.default = router;
  7385. /***/ },
  7386. /* 120 */
  7387. /***/ function(module, exports, __webpack_require__) {
  7388. "use strict";
  7389. 'use strict';
  7390. Object.defineProperty(exports, "__esModule", {
  7391. value: true
  7392. });
  7393. var _assign = __webpack_require__(48);
  7394. var _assign2 = _interopRequireDefault(_assign);
  7395. var _extends2 = __webpack_require__(25);
  7396. var _extends3 = _interopRequireDefault(_extends2);
  7397. var _vue = __webpack_require__(47);
  7398. var _vue2 = _interopRequireDefault(_vue);
  7399. var _vuex = __webpack_require__(11);
  7400. var _vuex2 = _interopRequireDefault(_vuex);
  7401. var _auth = __webpack_require__(34);
  7402. var _auth2 = _interopRequireDefault(_auth);
  7403. var _http = __webpack_require__(159);
  7404. var _http2 = _interopRequireDefault(_http);
  7405. var _storage = __webpack_require__(22);
  7406. var _storage2 = _interopRequireDefault(_storage);
  7407. var _password = __webpack_require__(79);
  7408. var _password2 = _interopRequireDefault(_password);
  7409. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  7410. _vue2.default.use(_vuex2.default);
  7411. var storage = new _storage2.default();
  7412. var auth = new _auth2.default(storage);
  7413. var PasswordsAPI = new _http2.default('passwords', storage);
  7414. var defaultPassword = {
  7415. id: '',
  7416. site: '',
  7417. login: '',
  7418. uppercase: true,
  7419. lowercase: true,
  7420. numbers: true,
  7421. symbols: true,
  7422. length: 12,
  7423. counter: 1
  7424. };
  7425. var state = {
  7426. authenticated: auth.isAuthenticated(),
  7427. email: '',
  7428. passwordStatus: 'CLEAN',
  7429. passwords: [],
  7430. baseURL: 'https://lesspass.com',
  7431. password: (0, _extends3.default)({}, defaultPassword)
  7432. };
  7433. var mutations = {
  7434. LOGOUT: function LOGOUT(state) {
  7435. state.authenticated = false;
  7436. },
  7437. USER_AUTHENTICATED: function USER_AUTHENTICATED(state, user) {
  7438. state.authenticated = true;
  7439. state.email = user.email;
  7440. },
  7441. SET_PASSWORDS: function SET_PASSWORDS(state, passwords) {
  7442. state.passwords = passwords;
  7443. },
  7444. SET_PASSWORD: function SET_PASSWORD(state, _ref) {
  7445. var password = _ref.password;
  7446. state.password = password;
  7447. },
  7448. DELETE_PASSWORD: function DELETE_PASSWORD(state, _ref2) {
  7449. var id = _ref2.id;
  7450. var passwords = state.passwords;
  7451. state.passwords = passwords.filter(function (password) {
  7452. return password.id !== id;
  7453. });
  7454. if (state.password.id === id) {
  7455. state.password = state.defaultPassword;
  7456. }
  7457. },
  7458. PASSWORD_CLEAN: function PASSWORD_CLEAN(state) {
  7459. setTimeout(function () {
  7460. state.passwordStatus = 'CLEAN';
  7461. }, 5000);
  7462. },
  7463. CHANGE_PASSWORD_STATUS: function CHANGE_PASSWORD_STATUS(state, status) {
  7464. state.passwordStatus = status;
  7465. },
  7466. SET_DEFAULT_PASSWORD: function SET_DEFAULT_PASSWORD(state) {
  7467. state.password = (0, _assign2.default)({}, defaultPassword);
  7468. },
  7469. UPDATE_SITE: function UPDATE_SITE(state, _ref3) {
  7470. var site = _ref3.site;
  7471. state.password.site = site;
  7472. },
  7473. UPDATE_BASE_URL: function UPDATE_BASE_URL(state, _ref4) {
  7474. var baseURL = _ref4.baseURL;
  7475. state.baseURL = baseURL;
  7476. },
  7477. UPDATE_EMAIL: function UPDATE_EMAIL(state, _ref5) {
  7478. var email = _ref5.email;
  7479. state.email = email;
  7480. }
  7481. };
  7482. var actions = {
  7483. USER_AUTHENTICATED: function USER_AUTHENTICATED(_ref6, user) {
  7484. var commit = _ref6.commit;
  7485. return commit('USER_AUTHENTICATED', user);
  7486. },
  7487. LOGOUT: function LOGOUT(_ref7) {
  7488. var commit = _ref7.commit;
  7489. auth.logout();
  7490. commit('LOGOUT');
  7491. },
  7492. SAVE_OR_UPDATE_PASSWORD: function SAVE_OR_UPDATE_PASSWORD(_ref8) {
  7493. var commit = _ref8.commit,
  7494. state = _ref8.state,
  7495. dispatch = _ref8.dispatch;
  7496. var password = new _password2.default(state.password);
  7497. if (password.isNewPassword(state.passwords)) {
  7498. PasswordsAPI.create(password.json()).then(function () {
  7499. commit('CHANGE_PASSWORD_STATUS', 'CREATED');
  7500. commit('PASSWORD_CLEAN');
  7501. dispatch('FETCH_PASSWORDS');
  7502. });
  7503. } else {
  7504. PasswordsAPI.update(password.json()).then(function () {
  7505. commit('CHANGE_PASSWORD_STATUS', 'UPDATED');
  7506. commit('PASSWORD_CLEAN');
  7507. dispatch('FETCH_PASSWORDS');
  7508. });
  7509. }
  7510. },
  7511. REFRESH_TOKEN: function REFRESH_TOKEN(_ref9) {
  7512. var commit = _ref9.commit;
  7513. if (auth.isAuthenticated()) {
  7514. auth.refreshToken().catch(function () {
  7515. commit('LOGOUT');
  7516. });
  7517. }
  7518. },
  7519. PASSWORD_CHANGE: function PASSWORD_CHANGE(_ref10, _ref11) {
  7520. var commit = _ref10.commit;
  7521. var password = _ref11.password;
  7522. commit('SET_PASSWORD', { password: password });
  7523. },
  7524. PASSWORD_GENERATED: function PASSWORD_GENERATED(_ref12) {
  7525. var commit = _ref12.commit;
  7526. commit('CHANGE_PASSWORD_STATUS', 'DIRTY');
  7527. },
  7528. FETCH_PASSWORDS: function FETCH_PASSWORDS(_ref13) {
  7529. var commit = _ref13.commit;
  7530. if (auth.isAuthenticated()) {
  7531. PasswordsAPI.all().then(function (response) {
  7532. return commit('SET_PASSWORDS', response.data.results);
  7533. });
  7534. }
  7535. },
  7536. FETCH_PASSWORD: function FETCH_PASSWORD(_ref14, _ref15) {
  7537. var commit = _ref14.commit;
  7538. var id = _ref15.id;
  7539. PasswordsAPI.get({ id: id }).then(function (response) {
  7540. return commit('SET_PASSWORD', { password: response.data });
  7541. });
  7542. },
  7543. DELETE_PASSWORD: function DELETE_PASSWORD(_ref16, _ref17) {
  7544. var commit = _ref16.commit;
  7545. var id = _ref17.id;
  7546. PasswordsAPI.remove({ id: id }).then(function () {
  7547. commit('DELETE_PASSWORD', { id: id });
  7548. });
  7549. },
  7550. LOAD_DEFAULT_PASSWORD: function LOAD_DEFAULT_PASSWORD(_ref18) {
  7551. var commit = _ref18.commit;
  7552. commit('SET_DEFAULT_PASSWORD');
  7553. }
  7554. };
  7555. var getters = {
  7556. passwords: function passwords(state) {
  7557. return state.passwords;
  7558. },
  7559. password: function password(state) {
  7560. return state.password;
  7561. },
  7562. isAuthenticated: function isAuthenticated(state) {
  7563. return state.authenticated;
  7564. },
  7565. isGuest: function isGuest(state) {
  7566. return !state.authenticated;
  7567. },
  7568. passwordStatus: function passwordStatus(state) {
  7569. return state.passwordStatus;
  7570. },
  7571. email: function email(state) {
  7572. return state.email;
  7573. }
  7574. };
  7575. exports.default = new _vuex2.default.Store({
  7576. state: (0, _assign2.default)(state, storage.json()),
  7577. getters: getters,
  7578. actions: actions,
  7579. mutations: mutations
  7580. });
  7581. /***/ },
  7582. /* 121 */
  7583. /***/ function(module, exports) {
  7584. // removed by extract-text-webpack-plugin
  7585. /***/ },
  7586. /* 122 */
  7587. 121,
  7588. /* 123 */
  7589. 121,
  7590. /* 124 */
  7591. /***/ function(module, exports, __webpack_require__) {
  7592. var __vue_exports__, __vue_options__
  7593. /* styles */
  7594. __webpack_require__(307)
  7595. /* script */
  7596. __vue_exports__ = __webpack_require__(150)
  7597. /* template */
  7598. var __vue_template__ = __webpack_require__(298)
  7599. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  7600. if (
  7601. typeof __vue_exports__.default === "object" ||
  7602. typeof __vue_exports__.default === "function"
  7603. ) {
  7604. __vue_options__ = __vue_exports__ = __vue_exports__.default
  7605. }
  7606. if (typeof __vue_options__ === "function") {
  7607. __vue_options__ = __vue_options__.options
  7608. }
  7609. __vue_options__.render = __vue_template__.render
  7610. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  7611. module.exports = __vue_exports__
  7612. /***/ },
  7613. /* 125 */,
  7614. /* 126 */,
  7615. /* 127 */,
  7616. /* 128 */,
  7617. /* 129 */,
  7618. /* 130 */,
  7619. /* 131 */,
  7620. /* 132 */,
  7621. /* 133 */
  7622. /***/ function(module, exports, __webpack_require__) {
  7623. "use strict";
  7624. 'use strict';
  7625. var utils = __webpack_require__(4);
  7626. var bind = __webpack_require__(78);
  7627. var Axios = __webpack_require__(135);
  7628. /**
  7629. * Create an instance of Axios
  7630. *
  7631. * @param {Object} defaultConfig The default config for the instance
  7632. * @return {Axios} A new instance of Axios
  7633. */
  7634. function createInstance(defaultConfig) {
  7635. var context = new Axios(defaultConfig);
  7636. var instance = bind(Axios.prototype.request, context);
  7637. // Copy axios.prototype to instance
  7638. utils.extend(instance, Axios.prototype, context);
  7639. // Copy context to instance
  7640. utils.extend(instance, context);
  7641. return instance;
  7642. }
  7643. // Create the default instance to be exported
  7644. var axios = createInstance();
  7645. // Expose Axios class to allow class inheritance
  7646. axios.Axios = Axios;
  7647. // Factory for creating new instances
  7648. axios.create = function create(defaultConfig) {
  7649. return createInstance(defaultConfig);
  7650. };
  7651. // Expose Cancel & CancelToken
  7652. axios.Cancel = __webpack_require__(74);
  7653. axios.CancelToken = __webpack_require__(134);
  7654. axios.isCancel = __webpack_require__(75);
  7655. // Expose all/spread
  7656. axios.all = function all(promises) {
  7657. return Promise.all(promises);
  7658. };
  7659. axios.spread = __webpack_require__(149);
  7660. module.exports = axios;
  7661. // Allow use of default import syntax in TypeScript
  7662. module.exports.default = axios;
  7663. /***/ },
  7664. /* 134 */
  7665. /***/ function(module, exports, __webpack_require__) {
  7666. "use strict";
  7667. 'use strict';
  7668. var Cancel = __webpack_require__(74);
  7669. /**
  7670. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  7671. *
  7672. * @class
  7673. * @param {Function} executor The executor function.
  7674. */
  7675. function CancelToken(executor) {
  7676. if (typeof executor !== 'function') {
  7677. throw new TypeError('executor must be a function.');
  7678. }
  7679. var resolvePromise;
  7680. this.promise = new Promise(function promiseExecutor(resolve) {
  7681. resolvePromise = resolve;
  7682. });
  7683. var token = this;
  7684. executor(function cancel(message) {
  7685. if (token.reason) {
  7686. // Cancellation has already been requested
  7687. return;
  7688. }
  7689. token.reason = new Cancel(message);
  7690. resolvePromise(token.reason);
  7691. });
  7692. }
  7693. /**
  7694. * Throws a `Cancel` if cancellation has been requested.
  7695. */
  7696. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  7697. if (this.reason) {
  7698. throw this.reason;
  7699. }
  7700. };
  7701. /**
  7702. * Returns an object that contains a new `CancelToken` and a function that, when called,
  7703. * cancels the `CancelToken`.
  7704. */
  7705. CancelToken.source = function source() {
  7706. var cancel;
  7707. var token = new CancelToken(function executor(c) {
  7708. cancel = c;
  7709. });
  7710. return {
  7711. token: token,
  7712. cancel: cancel
  7713. };
  7714. };
  7715. module.exports = CancelToken;
  7716. /***/ },
  7717. /* 135 */
  7718. /***/ function(module, exports, __webpack_require__) {
  7719. "use strict";
  7720. 'use strict';
  7721. var defaults = __webpack_require__(77);
  7722. var utils = __webpack_require__(4);
  7723. var InterceptorManager = __webpack_require__(136);
  7724. var dispatchRequest = __webpack_require__(137);
  7725. var isAbsoluteURL = __webpack_require__(145);
  7726. var combineURLs = __webpack_require__(143);
  7727. /**
  7728. * Create a new instance of Axios
  7729. *
  7730. * @param {Object} defaultConfig The default config for the instance
  7731. */
  7732. function Axios(defaultConfig) {
  7733. this.defaults = utils.merge(defaults, defaultConfig);
  7734. this.interceptors = {
  7735. request: new InterceptorManager(),
  7736. response: new InterceptorManager()
  7737. };
  7738. }
  7739. /**
  7740. * Dispatch a request
  7741. *
  7742. * @param {Object} config The config specific for this request (merged with this.defaults)
  7743. */
  7744. Axios.prototype.request = function request(config) {
  7745. /*eslint no-param-reassign:0*/
  7746. // Allow for axios('example/url'[, config]) a la fetch API
  7747. if (typeof config === 'string') {
  7748. config = utils.merge({
  7749. url: arguments[0]
  7750. }, arguments[1]);
  7751. }
  7752. config = utils.merge(defaults, this.defaults, { method: 'get' }, config);
  7753. // Support baseURL config
  7754. if (config.baseURL && !isAbsoluteURL(config.url)) {
  7755. config.url = combineURLs(config.baseURL, config.url);
  7756. }
  7757. // Hook up interceptors middleware
  7758. var chain = [dispatchRequest, undefined];
  7759. var promise = Promise.resolve(config);
  7760. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  7761. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  7762. });
  7763. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  7764. chain.push(interceptor.fulfilled, interceptor.rejected);
  7765. });
  7766. while (chain.length) {
  7767. promise = promise.then(chain.shift(), chain.shift());
  7768. }
  7769. return promise;
  7770. };
  7771. // Provide aliases for supported request methods
  7772. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  7773. /*eslint func-names:0*/
  7774. Axios.prototype[method] = function(url, config) {
  7775. return this.request(utils.merge(config || {}, {
  7776. method: method,
  7777. url: url
  7778. }));
  7779. };
  7780. });
  7781. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  7782. /*eslint func-names:0*/
  7783. Axios.prototype[method] = function(url, data, config) {
  7784. return this.request(utils.merge(config || {}, {
  7785. method: method,
  7786. url: url,
  7787. data: data
  7788. }));
  7789. };
  7790. });
  7791. module.exports = Axios;
  7792. /***/ },
  7793. /* 136 */
  7794. /***/ function(module, exports, __webpack_require__) {
  7795. "use strict";
  7796. 'use strict';
  7797. var utils = __webpack_require__(4);
  7798. function InterceptorManager() {
  7799. this.handlers = [];
  7800. }
  7801. /**
  7802. * Add a new interceptor to the stack
  7803. *
  7804. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  7805. * @param {Function} rejected The function to handle `reject` for a `Promise`
  7806. *
  7807. * @return {Number} An ID used to remove interceptor later
  7808. */
  7809. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  7810. this.handlers.push({
  7811. fulfilled: fulfilled,
  7812. rejected: rejected
  7813. });
  7814. return this.handlers.length - 1;
  7815. };
  7816. /**
  7817. * Remove an interceptor from the stack
  7818. *
  7819. * @param {Number} id The ID that was returned by `use`
  7820. */
  7821. InterceptorManager.prototype.eject = function eject(id) {
  7822. if (this.handlers[id]) {
  7823. this.handlers[id] = null;
  7824. }
  7825. };
  7826. /**
  7827. * Iterate over all the registered interceptors
  7828. *
  7829. * This method is particularly useful for skipping over any
  7830. * interceptors that may have become `null` calling `eject`.
  7831. *
  7832. * @param {Function} fn The function to call for each interceptor
  7833. */
  7834. InterceptorManager.prototype.forEach = function forEach(fn) {
  7835. utils.forEach(this.handlers, function forEachHandler(h) {
  7836. if (h !== null) {
  7837. fn(h);
  7838. }
  7839. });
  7840. };
  7841. module.exports = InterceptorManager;
  7842. /***/ },
  7843. /* 137 */
  7844. /***/ function(module, exports, __webpack_require__) {
  7845. "use strict";
  7846. 'use strict';
  7847. var utils = __webpack_require__(4);
  7848. var transformData = __webpack_require__(140);
  7849. var isCancel = __webpack_require__(75);
  7850. var defaults = __webpack_require__(77);
  7851. /**
  7852. * Throws a `Cancel` if cancellation has been requested.
  7853. */
  7854. function throwIfCancellationRequested(config) {
  7855. if (config.cancelToken) {
  7856. config.cancelToken.throwIfRequested();
  7857. }
  7858. }
  7859. /**
  7860. * Dispatch a request to the server using the configured adapter.
  7861. *
  7862. * @param {object} config The config that is to be used for the request
  7863. * @returns {Promise} The Promise to be fulfilled
  7864. */
  7865. module.exports = function dispatchRequest(config) {
  7866. throwIfCancellationRequested(config);
  7867. // Ensure headers exist
  7868. config.headers = config.headers || {};
  7869. // Transform request data
  7870. config.data = transformData(
  7871. config.data,
  7872. config.headers,
  7873. config.transformRequest
  7874. );
  7875. // Flatten headers
  7876. config.headers = utils.merge(
  7877. config.headers.common || {},
  7878. config.headers[config.method] || {},
  7879. config.headers || {}
  7880. );
  7881. utils.forEach(
  7882. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  7883. function cleanHeaderConfig(method) {
  7884. delete config.headers[method];
  7885. }
  7886. );
  7887. var adapter = config.adapter || defaults.adapter;
  7888. return adapter(config).then(function onAdapterResolution(response) {
  7889. throwIfCancellationRequested(config);
  7890. // Transform response data
  7891. response.data = transformData(
  7892. response.data,
  7893. response.headers,
  7894. config.transformResponse
  7895. );
  7896. return response;
  7897. }, function onAdapterRejection(reason) {
  7898. if (!isCancel(reason)) {
  7899. throwIfCancellationRequested(config);
  7900. // Transform response data
  7901. if (reason && reason.response) {
  7902. reason.response.data = transformData(
  7903. reason.response.data,
  7904. reason.response.headers,
  7905. config.transformResponse
  7906. );
  7907. }
  7908. }
  7909. return Promise.reject(reason);
  7910. });
  7911. };
  7912. /***/ },
  7913. /* 138 */
  7914. /***/ function(module, exports) {
  7915. "use strict";
  7916. 'use strict';
  7917. /**
  7918. * Update an Error with the specified config, error code, and response.
  7919. *
  7920. * @param {Error} error The error to update.
  7921. * @param {Object} config The config.
  7922. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  7923. @ @param {Object} [response] The response.
  7924. * @returns {Error} The error.
  7925. */
  7926. module.exports = function enhanceError(error, config, code, response) {
  7927. error.config = config;
  7928. if (code) {
  7929. error.code = code;
  7930. }
  7931. error.response = response;
  7932. return error;
  7933. };
  7934. /***/ },
  7935. /* 139 */
  7936. /***/ function(module, exports, __webpack_require__) {
  7937. "use strict";
  7938. 'use strict';
  7939. var createError = __webpack_require__(76);
  7940. /**
  7941. * Resolve or reject a Promise based on response status.
  7942. *
  7943. * @param {Function} resolve A function that resolves the promise.
  7944. * @param {Function} reject A function that rejects the promise.
  7945. * @param {object} response The response.
  7946. */
  7947. module.exports = function settle(resolve, reject, response) {
  7948. var validateStatus = response.config.validateStatus;
  7949. // Note: status is not exposed by XDomainRequest
  7950. if (!response.status || !validateStatus || validateStatus(response.status)) {
  7951. resolve(response);
  7952. } else {
  7953. reject(createError(
  7954. 'Request failed with status code ' + response.status,
  7955. response.config,
  7956. null,
  7957. response
  7958. ));
  7959. }
  7960. };
  7961. /***/ },
  7962. /* 140 */
  7963. /***/ function(module, exports, __webpack_require__) {
  7964. "use strict";
  7965. 'use strict';
  7966. var utils = __webpack_require__(4);
  7967. /**
  7968. * Transform the data for a request or a response
  7969. *
  7970. * @param {Object|String} data The data to be transformed
  7971. * @param {Array} headers The headers for the request or response
  7972. * @param {Array|Function} fns A single function or Array of functions
  7973. * @returns {*} The resulting transformed data
  7974. */
  7975. module.exports = function transformData(data, headers, fns) {
  7976. /*eslint no-param-reassign:0*/
  7977. utils.forEach(fns, function transform(fn) {
  7978. data = fn(data, headers);
  7979. });
  7980. return data;
  7981. };
  7982. /***/ },
  7983. /* 141 */
  7984. /***/ function(module, exports) {
  7985. "use strict";
  7986. 'use strict';
  7987. // btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js
  7988. var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  7989. function E() {
  7990. this.message = 'String contains an invalid character';
  7991. }
  7992. E.prototype = new Error;
  7993. E.prototype.code = 5;
  7994. E.prototype.name = 'InvalidCharacterError';
  7995. function btoa(input) {
  7996. var str = String(input);
  7997. var output = '';
  7998. for (
  7999. // initialize result and counter
  8000. var block, charCode, idx = 0, map = chars;
  8001. // if the next str index does not exist:
  8002. // change the mapping table to "="
  8003. // check if d has no fractional digits
  8004. str.charAt(idx | 0) || (map = '=', idx % 1);
  8005. // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
  8006. output += map.charAt(63 & block >> 8 - idx % 1 * 8)
  8007. ) {
  8008. charCode = str.charCodeAt(idx += 3 / 4);
  8009. if (charCode > 0xFF) {
  8010. throw new E();
  8011. }
  8012. block = block << 8 | charCode;
  8013. }
  8014. return output;
  8015. }
  8016. module.exports = btoa;
  8017. /***/ },
  8018. /* 142 */
  8019. /***/ function(module, exports, __webpack_require__) {
  8020. "use strict";
  8021. 'use strict';
  8022. var utils = __webpack_require__(4);
  8023. function encode(val) {
  8024. return encodeURIComponent(val).
  8025. replace(/%40/gi, '@').
  8026. replace(/%3A/gi, ':').
  8027. replace(/%24/g, '$').
  8028. replace(/%2C/gi, ',').
  8029. replace(/%20/g, '+').
  8030. replace(/%5B/gi, '[').
  8031. replace(/%5D/gi, ']');
  8032. }
  8033. /**
  8034. * Build a URL by appending params to the end
  8035. *
  8036. * @param {string} url The base of the url (e.g., http://www.google.com)
  8037. * @param {object} [params] The params to be appended
  8038. * @returns {string} The formatted url
  8039. */
  8040. module.exports = function buildURL(url, params, paramsSerializer) {
  8041. /*eslint no-param-reassign:0*/
  8042. if (!params) {
  8043. return url;
  8044. }
  8045. var serializedParams;
  8046. if (paramsSerializer) {
  8047. serializedParams = paramsSerializer(params);
  8048. } else if (utils.isURLSearchParams(params)) {
  8049. serializedParams = params.toString();
  8050. } else {
  8051. var parts = [];
  8052. utils.forEach(params, function serialize(val, key) {
  8053. if (val === null || typeof val === 'undefined') {
  8054. return;
  8055. }
  8056. if (utils.isArray(val)) {
  8057. key = key + '[]';
  8058. }
  8059. if (!utils.isArray(val)) {
  8060. val = [val];
  8061. }
  8062. utils.forEach(val, function parseValue(v) {
  8063. if (utils.isDate(v)) {
  8064. v = v.toISOString();
  8065. } else if (utils.isObject(v)) {
  8066. v = JSON.stringify(v);
  8067. }
  8068. parts.push(encode(key) + '=' + encode(v));
  8069. });
  8070. });
  8071. serializedParams = parts.join('&');
  8072. }
  8073. if (serializedParams) {
  8074. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  8075. }
  8076. return url;
  8077. };
  8078. /***/ },
  8079. /* 143 */
  8080. /***/ function(module, exports) {
  8081. "use strict";
  8082. 'use strict';
  8083. /**
  8084. * Creates a new URL by combining the specified URLs
  8085. *
  8086. * @param {string} baseURL The base URL
  8087. * @param {string} relativeURL The relative URL
  8088. * @returns {string} The combined URL
  8089. */
  8090. module.exports = function combineURLs(baseURL, relativeURL) {
  8091. return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '');
  8092. };
  8093. /***/ },
  8094. /* 144 */
  8095. /***/ function(module, exports, __webpack_require__) {
  8096. "use strict";
  8097. 'use strict';
  8098. var utils = __webpack_require__(4);
  8099. module.exports = (
  8100. utils.isStandardBrowserEnv() ?
  8101. // Standard browser envs support document.cookie
  8102. (function standardBrowserEnv() {
  8103. return {
  8104. write: function write(name, value, expires, path, domain, secure) {
  8105. var cookie = [];
  8106. cookie.push(name + '=' + encodeURIComponent(value));
  8107. if (utils.isNumber(expires)) {
  8108. cookie.push('expires=' + new Date(expires).toGMTString());
  8109. }
  8110. if (utils.isString(path)) {
  8111. cookie.push('path=' + path);
  8112. }
  8113. if (utils.isString(domain)) {
  8114. cookie.push('domain=' + domain);
  8115. }
  8116. if (secure === true) {
  8117. cookie.push('secure');
  8118. }
  8119. document.cookie = cookie.join('; ');
  8120. },
  8121. read: function read(name) {
  8122. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  8123. return (match ? decodeURIComponent(match[3]) : null);
  8124. },
  8125. remove: function remove(name) {
  8126. this.write(name, '', Date.now() - 86400000);
  8127. }
  8128. };
  8129. })() :
  8130. // Non standard browser env (web workers, react-native) lack needed support.
  8131. (function nonStandardBrowserEnv() {
  8132. return {
  8133. write: function write() {},
  8134. read: function read() { return null; },
  8135. remove: function remove() {}
  8136. };
  8137. })()
  8138. );
  8139. /***/ },
  8140. /* 145 */
  8141. /***/ function(module, exports) {
  8142. "use strict";
  8143. 'use strict';
  8144. /**
  8145. * Determines whether the specified URL is absolute
  8146. *
  8147. * @param {string} url The URL to test
  8148. * @returns {boolean} True if the specified URL is absolute, otherwise false
  8149. */
  8150. module.exports = function isAbsoluteURL(url) {
  8151. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  8152. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  8153. // by any combination of letters, digits, plus, period, or hyphen.
  8154. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  8155. };
  8156. /***/ },
  8157. /* 146 */
  8158. /***/ function(module, exports, __webpack_require__) {
  8159. "use strict";
  8160. 'use strict';
  8161. var utils = __webpack_require__(4);
  8162. module.exports = (
  8163. utils.isStandardBrowserEnv() ?
  8164. // Standard browser envs have full support of the APIs needed to test
  8165. // whether the request URL is of the same origin as current location.
  8166. (function standardBrowserEnv() {
  8167. var msie = /(msie|trident)/i.test(navigator.userAgent);
  8168. var urlParsingNode = document.createElement('a');
  8169. var originURL;
  8170. /**
  8171. * Parse a URL to discover it's components
  8172. *
  8173. * @param {String} url The URL to be parsed
  8174. * @returns {Object}
  8175. */
  8176. function resolveURL(url) {
  8177. var href = url;
  8178. if (msie) {
  8179. // IE needs attribute set twice to normalize properties
  8180. urlParsingNode.setAttribute('href', href);
  8181. href = urlParsingNode.href;
  8182. }
  8183. urlParsingNode.setAttribute('href', href);
  8184. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  8185. return {
  8186. href: urlParsingNode.href,
  8187. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  8188. host: urlParsingNode.host,
  8189. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  8190. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  8191. hostname: urlParsingNode.hostname,
  8192. port: urlParsingNode.port,
  8193. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  8194. urlParsingNode.pathname :
  8195. '/' + urlParsingNode.pathname
  8196. };
  8197. }
  8198. originURL = resolveURL(window.location.href);
  8199. /**
  8200. * Determine if a URL shares the same origin as the current location
  8201. *
  8202. * @param {String} requestURL The URL to test
  8203. * @returns {boolean} True if URL shares the same origin, otherwise false
  8204. */
  8205. return function isURLSameOrigin(requestURL) {
  8206. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  8207. return (parsed.protocol === originURL.protocol &&
  8208. parsed.host === originURL.host);
  8209. };
  8210. })() :
  8211. // Non standard browser envs (web workers, react-native) lack needed support.
  8212. (function nonStandardBrowserEnv() {
  8213. return function isURLSameOrigin() {
  8214. return true;
  8215. };
  8216. })()
  8217. );
  8218. /***/ },
  8219. /* 147 */
  8220. /***/ function(module, exports, __webpack_require__) {
  8221. "use strict";
  8222. 'use strict';
  8223. var utils = __webpack_require__(4);
  8224. module.exports = function normalizeHeaderName(headers, normalizedName) {
  8225. utils.forEach(headers, function processHeader(value, name) {
  8226. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  8227. headers[normalizedName] = value;
  8228. delete headers[name];
  8229. }
  8230. });
  8231. };
  8232. /***/ },
  8233. /* 148 */
  8234. /***/ function(module, exports, __webpack_require__) {
  8235. "use strict";
  8236. 'use strict';
  8237. var utils = __webpack_require__(4);
  8238. /**
  8239. * Parse headers into an object
  8240. *
  8241. * ```
  8242. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  8243. * Content-Type: application/json
  8244. * Connection: keep-alive
  8245. * Transfer-Encoding: chunked
  8246. * ```
  8247. *
  8248. * @param {String} headers Headers needing to be parsed
  8249. * @returns {Object} Headers parsed into an object
  8250. */
  8251. module.exports = function parseHeaders(headers) {
  8252. var parsed = {};
  8253. var key;
  8254. var val;
  8255. var i;
  8256. if (!headers) { return parsed; }
  8257. utils.forEach(headers.split('\n'), function parser(line) {
  8258. i = line.indexOf(':');
  8259. key = utils.trim(line.substr(0, i)).toLowerCase();
  8260. val = utils.trim(line.substr(i + 1));
  8261. if (key) {
  8262. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  8263. }
  8264. });
  8265. return parsed;
  8266. };
  8267. /***/ },
  8268. /* 149 */
  8269. /***/ function(module, exports) {
  8270. "use strict";
  8271. 'use strict';
  8272. /**
  8273. * Syntactic sugar for invoking a function and expanding an array for arguments.
  8274. *
  8275. * Common use case would be to use `Function.prototype.apply`.
  8276. *
  8277. * ```js
  8278. * function f(x, y, z) {}
  8279. * var args = [1, 2, 3];
  8280. * f.apply(null, args);
  8281. * ```
  8282. *
  8283. * With `spread` this example can be re-written.
  8284. *
  8285. * ```js
  8286. * spread(function(x, y, z) {})([1, 2, 3]);
  8287. * ```
  8288. *
  8289. * @param {Function} callback
  8290. * @returns {Function}
  8291. */
  8292. module.exports = function spread(callback) {
  8293. return function wrap(arr) {
  8294. return callback.apply(null, arr);
  8295. };
  8296. };
  8297. /***/ },
  8298. /* 150 */
  8299. /***/ function(module, exports, __webpack_require__) {
  8300. "use strict";
  8301. 'use strict';
  8302. Object.defineProperty(exports, "__esModule", {
  8303. value: true
  8304. });
  8305. var _Menu = __webpack_require__(286);
  8306. var _Menu2 = _interopRequireDefault(_Menu);
  8307. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8308. exports.default = {
  8309. name: 'LessPass',
  8310. components: {
  8311. 'lesspass-menu': _Menu2.default
  8312. },
  8313. created: function created() {
  8314. var _this = this;
  8315. var fiveMinutes = 1000 * 60 * 5;
  8316. this.$store.dispatch('REFRESH_TOKEN');
  8317. setInterval(function () {
  8318. _this.$store.dispatch('REFRESH_TOKEN');
  8319. }, fiveMinutes);
  8320. }
  8321. };
  8322. /***/ },
  8323. /* 151 */
  8324. /***/ function(module, exports) {
  8325. "use strict";
  8326. "use strict";
  8327. Object.defineProperty(exports, "__esModule", {
  8328. value: true
  8329. });
  8330. exports.default = {
  8331. data: function data() {
  8332. return {
  8333. pending: false
  8334. };
  8335. },
  8336. props: {
  8337. action: { type: Function, required: true },
  8338. text: { type: String, required: true },
  8339. object: { type: Object, required: true }
  8340. },
  8341. methods: {
  8342. confirm: function (_confirm) {
  8343. function confirm() {
  8344. return _confirm.apply(this, arguments);
  8345. }
  8346. confirm.toString = function () {
  8347. return _confirm.toString();
  8348. };
  8349. return confirm;
  8350. }(function () {
  8351. this.pending = true;
  8352. var response = confirm(this.text);
  8353. if (response == true) {
  8354. this.action(this.object);
  8355. }
  8356. })
  8357. }
  8358. };
  8359. /***/ },
  8360. /* 152 */
  8361. /***/ function(module, exports, __webpack_require__) {
  8362. "use strict";
  8363. 'use strict';
  8364. Object.defineProperty(exports, "__esModule", {
  8365. value: true
  8366. });
  8367. var _lesspass = __webpack_require__(109);
  8368. var _lesspass2 = _interopRequireDefault(_lesspass);
  8369. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8370. exports.default = {
  8371. data: function data() {
  8372. return {
  8373. icon1: '',
  8374. icon2: '',
  8375. icon3: '',
  8376. color1: '',
  8377. color2: '',
  8378. color3: ''
  8379. };
  8380. },
  8381. props: ['fingerprint'],
  8382. watch: {
  8383. fingerprint: function fingerprint(newFingerprint) {
  8384. var _this = this;
  8385. if (!newFingerprint) {
  8386. return;
  8387. }
  8388. _lesspass2.default.createFingerprint(newFingerprint).then(function (sha256) {
  8389. var hash1 = sha256.substring(0, 6);
  8390. var hash2 = sha256.substring(6, 12);
  8391. var hash3 = sha256.substring(12, 18);
  8392. _this.icon1 = _this.getIcon(hash1);
  8393. _this.icon2 = _this.getIcon(hash2);
  8394. _this.icon3 = _this.getIcon(hash3);
  8395. _this.color1 = _this.getColor(hash1);
  8396. _this.color2 = _this.getColor(hash2);
  8397. _this.color3 = _this.getColor(hash3);
  8398. });
  8399. }
  8400. },
  8401. methods: {
  8402. getColor: function getColor(color) {
  8403. var colors = ['#000000', '#074750', '#009191', '#FF6CB6', '#FFB5DA', '#490092', '#006CDB', '#B66DFF', '#6DB5FE', '#B5DAFE', '#920000', '#924900', '#DB6D00', '#24FE23'];
  8404. var index = parseInt(color, 16) % colors.length;
  8405. return colors[index];
  8406. },
  8407. getIcon: function getIcon(hash) {
  8408. var icons = ['fa-hashtag', 'fa-heart', 'fa-hotel', 'fa-university', 'fa-plug', 'fa-ambulance', 'fa-bus', 'fa-car', 'fa-plane', 'fa-rocket', 'fa-ship', 'fa-subway', 'fa-truck', 'fa-jpy', 'fa-eur', 'fa-btc', 'fa-usd', 'fa-gbp', 'fa-archive', 'fa-area-chart', 'fa-bed', 'fa-beer', 'fa-bell', 'fa-binoculars', 'fa-birthday-cake', 'fa-bomb', 'fa-briefcase', 'fa-bug', 'fa-camera', 'fa-cart-plus', 'fa-certificate', 'fa-coffee', 'fa-cloud', 'fa-coffee', 'fa-comment', 'fa-cube', 'fa-cutlery', 'fa-database', 'fa-diamond', 'fa-exclamation-circle', 'fa-eye', 'fa-flag', 'fa-flask', 'fa-futbol-o', 'fa-gamepad', 'fa-graduation-cap'];
  8409. var index = parseInt(hash, 16) % icons.length;
  8410. return icons[index];
  8411. }
  8412. }
  8413. };
  8414. /***/ },
  8415. /* 153 */
  8416. /***/ function(module, exports, __webpack_require__) {
  8417. "use strict";
  8418. 'use strict';
  8419. Object.defineProperty(exports, "__esModule", {
  8420. value: true
  8421. });
  8422. var _vuex = __webpack_require__(11);
  8423. exports.default = {
  8424. methods: {
  8425. logout: function logout() {
  8426. this.$store.dispatch('LOGOUT');
  8427. this.$router.push({ name: 'home' });
  8428. },
  8429. saveOrUpdatePassword: function saveOrUpdatePassword() {
  8430. this.$store.dispatch('SAVE_OR_UPDATE_PASSWORD');
  8431. }
  8432. },
  8433. computed: (0, _vuex.mapGetters)(['isAuthenticated', 'isGuest', 'email', 'passwordStatus'])
  8434. };
  8435. /***/ },
  8436. /* 154 */
  8437. /***/ function(module, exports, __webpack_require__) {
  8438. "use strict";
  8439. 'use strict';
  8440. Object.defineProperty(exports, "__esModule", {
  8441. value: true
  8442. });
  8443. var _extends2 = __webpack_require__(25);
  8444. var _extends3 = _interopRequireDefault(_extends2);
  8445. var _auth = __webpack_require__(34);
  8446. var _auth2 = _interopRequireDefault(_auth);
  8447. var _storage = __webpack_require__(22);
  8448. var _storage2 = _interopRequireDefault(_storage);
  8449. var _vuex = __webpack_require__(11);
  8450. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8451. var defaultErrors = {
  8452. userNameAlreadyExist: false,
  8453. baseURLRequired: false,
  8454. emailRequired: false,
  8455. passwordRequired: false
  8456. };
  8457. exports.default = {
  8458. data: function data() {
  8459. var storage = new _storage2.default();
  8460. var auth = new _auth2.default(storage);
  8461. return {
  8462. auth: auth,
  8463. storage: storage,
  8464. password: '',
  8465. showError: false,
  8466. errorMessage: '',
  8467. loadingRegister: false,
  8468. loadingSignIn: false,
  8469. errors: (0, _extends3.default)({}, defaultErrors)
  8470. };
  8471. },
  8472. methods: {
  8473. noErrors: function noErrors() {
  8474. return !(this.errors.userNameAlreadyExist || this.errors.emailRequired || this.errors.passwordRequired || this.errors.baseURLRequired || this.showError);
  8475. },
  8476. formIsValid: function formIsValid() {
  8477. this.cleanErrors();
  8478. var formIsValid = true;
  8479. if (!this.email) {
  8480. this.errors.emailRequired = true;
  8481. formIsValid = false;
  8482. }
  8483. if (!this.password) {
  8484. this.errors.passwordRequired = true;
  8485. formIsValid = false;
  8486. }
  8487. if (!this.baseURL) {
  8488. this.errors.baseURLRequired = true;
  8489. formIsValid = false;
  8490. }
  8491. return formIsValid;
  8492. },
  8493. cleanErrors: function cleanErrors() {
  8494. this.loadingRegister = false;
  8495. this.loadingSignIn = false;
  8496. this.showError = false;
  8497. this.errorMessage = '';
  8498. this.errors = (0, _extends3.default)({}, defaultErrors);
  8499. },
  8500. signIn: function signIn() {
  8501. var _this = this;
  8502. if (this.formIsValid()) {
  8503. (function () {
  8504. _this.loadingSignIn = true;
  8505. var email = _this.email;
  8506. var password = _this.password;
  8507. var baseURL = _this.baseURL;
  8508. _this.auth.login({ email: email, password: password }, baseURL).then(function () {
  8509. _this.loadingSignIn = false;
  8510. _this.storage.save({ baseURL: baseURL, email: email });
  8511. _this.$store.dispatch('USER_AUTHENTICATED', { email: email });
  8512. _this.$router.push({ name: 'home' });
  8513. }).catch(function (err) {
  8514. _this.cleanErrors();
  8515. if (err.response === undefined) {
  8516. if (baseURL === "https://lesspass.com") {
  8517. _this.showErrorMessage();
  8518. } else {
  8519. _this.showErrorMessage('Your LessPass Database is not running');
  8520. }
  8521. } else if (err.response.status === 400) {
  8522. _this.showErrorMessage('Your email and/or password is not good. Do you have an account ?');
  8523. } else {
  8524. _this.showErrorMessage();
  8525. }
  8526. });
  8527. })();
  8528. }
  8529. },
  8530. register: function register() {
  8531. var _this2 = this;
  8532. if (this.formIsValid()) {
  8533. this.loadingRegister = true;
  8534. var email = this.email;
  8535. var password = this.password;
  8536. var baseURL = this.baseURL;
  8537. this.auth.register({ email: email, password: password }, baseURL).then(function () {
  8538. _this2.loadingRegister = false;
  8539. _this2.signIn();
  8540. }).catch(function (err) {
  8541. _this2.cleanErrors();
  8542. if (err.response && err.response.data.email[0].indexOf('already exists') !== -1) {
  8543. _this2.errors.userNameAlreadyExist = true;
  8544. } else {
  8545. _this2.showErrorMessage();
  8546. }
  8547. });
  8548. }
  8549. },
  8550. showErrorMessage: function showErrorMessage() {
  8551. var errorMessage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Oops! Something went wrong. Retry in a few minutes.';
  8552. this.errorMessage = errorMessage;
  8553. this.showError = true;
  8554. }
  8555. },
  8556. computed: {
  8557. baseURL: {
  8558. get: function get() {
  8559. return this.$store.state.baseURL;
  8560. },
  8561. set: function set(baseURL) {
  8562. this.$store.commit('UPDATE_BASE_URL', { baseURL: baseURL });
  8563. }
  8564. },
  8565. email: {
  8566. get: function get() {
  8567. return this.$store.state.email;
  8568. },
  8569. set: function set(email) {
  8570. this.$store.commit('UPDATE_EMAIL', { email: email });
  8571. }
  8572. }
  8573. }
  8574. };
  8575. /***/ },
  8576. /* 155 */
  8577. /***/ function(module, exports, __webpack_require__) {
  8578. "use strict";
  8579. 'use strict';
  8580. Object.defineProperty(exports, "__esModule", {
  8581. value: true
  8582. });
  8583. var _extends2 = __webpack_require__(25);
  8584. var _extends3 = _interopRequireDefault(_extends2);
  8585. var _lesspass = __webpack_require__(109);
  8586. var _lesspass2 = _interopRequireDefault(_lesspass);
  8587. var _vuex = __webpack_require__(11);
  8588. var _clipboard = __webpack_require__(176);
  8589. var _clipboard2 = _interopRequireDefault(_clipboard);
  8590. var _lodash = __webpack_require__(261);
  8591. var _lodash2 = _interopRequireDefault(_lodash);
  8592. var _tooltip = __webpack_require__(161);
  8593. var _password = __webpack_require__(79);
  8594. var _password2 = _interopRequireDefault(_password);
  8595. var _urlParser = __webpack_require__(162);
  8596. var _RemoveAutoComplete = __webpack_require__(287);
  8597. var _RemoveAutoComplete2 = _interopRequireDefault(_RemoveAutoComplete);
  8598. var _Fingerprint = __webpack_require__(285);
  8599. var _Fingerprint2 = _interopRequireDefault(_Fingerprint);
  8600. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8601. function fetchPasswords(store) {
  8602. return store.dispatch('FETCH_PASSWORDS');
  8603. }
  8604. exports.default = {
  8605. name: 'password-generator-view',
  8606. components: {
  8607. RemoveAutoComplete: _RemoveAutoComplete2.default,
  8608. Fingerprint: _Fingerprint2.default
  8609. },
  8610. computed: (0, _vuex.mapGetters)(['passwords', 'password']),
  8611. preFetch: fetchPasswords,
  8612. beforeMount: function beforeMount() {
  8613. var _this = this;
  8614. var id = this.$route.params.id;
  8615. if (id) {
  8616. this.$store.dispatch('FETCH_PASSWORD', { id: id });
  8617. } else {
  8618. fetchPasswords(this.$store);
  8619. }
  8620. (0, _urlParser.getSite)().then(function (site) {
  8621. if (site) {
  8622. _this.$store.commit('UPDATE_SITE', { site: site });
  8623. }
  8624. });
  8625. var clipboard = new _clipboard2.default('#copyPasswordButton');
  8626. clipboard.on('success', function (event) {
  8627. if (event.text) {
  8628. (0, _tooltip.showTooltip)(event.trigger, 'copied !');
  8629. }
  8630. });
  8631. },
  8632. data: function data() {
  8633. return {
  8634. masterPassword: '',
  8635. encryptedLogin: '',
  8636. generatedPassword: '',
  8637. cleanTimeout: null
  8638. };
  8639. },
  8640. watch: {
  8641. 'password.site': function passwordSite(newValue) {
  8642. var values = newValue.split(" | ");
  8643. if (values.length === 2) {
  8644. var site = values[0];
  8645. var login = values[1];
  8646. var passwords = this.passwords;
  8647. for (var i = 0; i < passwords.length; i++) {
  8648. var password = passwords[i];
  8649. if (password.site === site && password.login === login) {
  8650. this.$store.dispatch('PASSWORD_CHANGE', { password: (0, _extends3.default)({}, password) });
  8651. this.$refs.masterPassword.focus();
  8652. break;
  8653. }
  8654. }
  8655. return site;
  8656. }
  8657. return newValue;
  8658. },
  8659. 'password.login': function passwordLogin() {
  8660. this.encryptedLogin = '';
  8661. this.encryptLogin();
  8662. },
  8663. 'masterPassword': function masterPassword() {
  8664. this.encryptedLogin = '';
  8665. this.encryptLogin();
  8666. },
  8667. 'generatedPassword': function generatedPassword() {
  8668. this.cleanFormInSeconds(30);
  8669. },
  8670. 'encryptedLogin': function encryptedLogin() {
  8671. var _this2 = this;
  8672. if (!this.encryptedLogin || !this.password.site) {
  8673. this.generatedPassword = '';
  8674. return;
  8675. }
  8676. var password = new _password2.default(this.password);
  8677. _lesspass2.default.renderPassword(this.encryptedLogin, this.password.site, password.options).then(function (generatedPassword) {
  8678. _this2.$store.dispatch('PASSWORD_GENERATED');
  8679. _this2.generatedPassword = generatedPassword;
  8680. });
  8681. }
  8682. },
  8683. methods: {
  8684. encryptLogin: (0, _lodash2.default)(function () {
  8685. var _this3 = this;
  8686. if (this.password.login && this.masterPassword) {
  8687. _lesspass2.default.encryptLogin(this.password.login, this.masterPassword).then(function (encryptedLogin) {
  8688. _this3.encryptedLogin = encryptedLogin;
  8689. });
  8690. }
  8691. }, 500),
  8692. showMasterPassword: function showMasterPassword() {
  8693. if (this.$refs.masterPassword.type === 'password') {
  8694. this.$refs.masterPassword.type = 'text';
  8695. } else {
  8696. this.$refs.masterPassword.type = 'password';
  8697. }
  8698. },
  8699. cleanFormInSeconds: function cleanFormInSeconds(seconds) {
  8700. var _this4 = this;
  8701. clearTimeout(this.cleanTimeout);
  8702. this.cleanTimeout = setTimeout(function () {
  8703. _this4.masterPassword = '';
  8704. _this4.encryptedLogin = '';
  8705. _this4.generatedPassword = '';
  8706. }, 1000 * seconds);
  8707. }
  8708. }
  8709. };
  8710. /***/ },
  8711. /* 156 */
  8712. /***/ function(module, exports, __webpack_require__) {
  8713. "use strict";
  8714. 'use strict';
  8715. Object.defineProperty(exports, "__esModule", {
  8716. value: true
  8717. });
  8718. var _auth = __webpack_require__(34);
  8719. var _auth2 = _interopRequireDefault(_auth);
  8720. var _storage = __webpack_require__(22);
  8721. var _storage2 = _interopRequireDefault(_storage);
  8722. var _vuex = __webpack_require__(11);
  8723. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8724. exports.default = {
  8725. data: function data() {
  8726. var storage = new _storage2.default();
  8727. var auth = new _auth2.default(storage);
  8728. return {
  8729. auth: auth,
  8730. storage: storage,
  8731. email: '',
  8732. emailRequired: false,
  8733. showError: false,
  8734. loading: false,
  8735. successMessage: false
  8736. };
  8737. },
  8738. methods: {
  8739. cleanErrors: function cleanErrors() {
  8740. this.loading = false;
  8741. this.emailRequired = false;
  8742. this.showError = false;
  8743. this.successMessage = false;
  8744. },
  8745. noErrors: function noErrors() {
  8746. return !(this.emailRequired || this.showError);
  8747. },
  8748. resetPassword: function resetPassword() {
  8749. var _this = this;
  8750. this.cleanErrors();
  8751. if (!this.email) {
  8752. this.emailRequired = true;
  8753. return;
  8754. }
  8755. this.loading = true;
  8756. this.auth.resetPassword({ email: this.email }).then(function () {
  8757. _this.cleanErrors();
  8758. _this.successMessage = true;
  8759. }).catch(function () {
  8760. _this.cleanErrors();
  8761. _this.showError = true;
  8762. });
  8763. }
  8764. }
  8765. };
  8766. /***/ },
  8767. /* 157 */
  8768. /***/ function(module, exports, __webpack_require__) {
  8769. "use strict";
  8770. 'use strict';
  8771. Object.defineProperty(exports, "__esModule", {
  8772. value: true
  8773. });
  8774. var _auth = __webpack_require__(34);
  8775. var _auth2 = _interopRequireDefault(_auth);
  8776. var _storage = __webpack_require__(22);
  8777. var _storage2 = _interopRequireDefault(_storage);
  8778. var _vuex = __webpack_require__(11);
  8779. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8780. exports.default = {
  8781. data: function data() {
  8782. var storage = new _storage2.default();
  8783. var auth = new _auth2.default(storage);
  8784. return {
  8785. auth: auth,
  8786. storage: storage,
  8787. new_password: '',
  8788. passwordRequired: false,
  8789. showError: false,
  8790. successMessage: false,
  8791. errorMessage: 'Oops! Something went wrong. Retry in a few minutes.'
  8792. };
  8793. },
  8794. methods: {
  8795. cleanErrors: function cleanErrors() {
  8796. this.passwordRequired = false;
  8797. this.showError = false;
  8798. this.successMessage = false;
  8799. },
  8800. noErrors: function noErrors() {
  8801. return !(this.passwordRequired || this.showError);
  8802. },
  8803. resetPasswordConfirm: function resetPasswordConfirm() {
  8804. var _this = this;
  8805. this.cleanErrors();
  8806. if (!this.new_password) {
  8807. this.passwordRequired = true;
  8808. return;
  8809. }
  8810. this.auth.confirmResetPassword({
  8811. uid: this.$route.params.uid,
  8812. token: this.$route.params.token,
  8813. new_password: this.new_password
  8814. }).then(function () {
  8815. _this.successMessage = true;
  8816. }).catch(function (err) {
  8817. if (err.response.status === 400) {
  8818. _this.errorMessage = 'This password reset link become invalid.';
  8819. }
  8820. _this.showError = true;
  8821. });
  8822. }
  8823. }
  8824. };
  8825. /***/ },
  8826. /* 158 */
  8827. /***/ function(module, exports, __webpack_require__) {
  8828. "use strict";
  8829. 'use strict';
  8830. Object.defineProperty(exports, "__esModule", {
  8831. value: true
  8832. });
  8833. var _extends2 = __webpack_require__(25);
  8834. var _extends3 = _interopRequireDefault(_extends2);
  8835. var _DeleteButton = __webpack_require__(284);
  8836. var _DeleteButton2 = _interopRequireDefault(_DeleteButton);
  8837. var _vuex = __webpack_require__(11);
  8838. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8839. function fetchPasswords(store) {
  8840. return store.dispatch('FETCH_PASSWORDS');
  8841. }
  8842. exports.default = {
  8843. name: 'passwords-view',
  8844. data: function data() {
  8845. return {
  8846. searchQuery: ''
  8847. };
  8848. },
  8849. components: { DeleteButton: _DeleteButton2.default },
  8850. computed: (0, _extends3.default)({}, (0, _vuex.mapGetters)(['passwords', 'email']), {
  8851. filteredPasswords: function filteredPasswords() {
  8852. var _this = this;
  8853. return this.passwords.filter(function (password) {
  8854. return password.site.indexOf(_this.searchQuery) > -1 || password.login.indexOf(_this.searchQuery) > -1;
  8855. });
  8856. }
  8857. }),
  8858. preFetch: fetchPasswords,
  8859. beforeMount: function beforeMount() {
  8860. fetchPasswords(this.$store);
  8861. },
  8862. methods: {
  8863. deletePassword: function deletePassword(password) {
  8864. return this.$store.dispatch('DELETE_PASSWORD', { id: password.id });
  8865. }
  8866. }
  8867. };
  8868. /***/ },
  8869. /* 159 */
  8870. /***/ function(module, exports, __webpack_require__) {
  8871. "use strict";
  8872. 'use strict';
  8873. Object.defineProperty(exports, "__esModule", {
  8874. value: true
  8875. });
  8876. var _extends2 = __webpack_require__(25);
  8877. var _extends3 = _interopRequireDefault(_extends2);
  8878. var _classCallCheck2 = __webpack_require__(23);
  8879. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  8880. var _createClass2 = __webpack_require__(24);
  8881. var _createClass3 = _interopRequireDefault(_createClass2);
  8882. var _axios = __webpack_require__(72);
  8883. var _axios2 = _interopRequireDefault(_axios);
  8884. var _storage = __webpack_require__(22);
  8885. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8886. var HTTP = function () {
  8887. function HTTP(resource, storage) {
  8888. (0, _classCallCheck3.default)(this, HTTP);
  8889. this.storage = storage;
  8890. this.resource = resource;
  8891. }
  8892. (0, _createClass3.default)(HTTP, [{
  8893. key: 'getRequestConfig',
  8894. value: function getRequestConfig() {
  8895. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8896. var config = this.storage.json();
  8897. return (0, _extends3.default)({}, params, {
  8898. baseURL: config.baseURL,
  8899. headers: { Authorization: 'JWT ' + config[_storage.TOKEN_KEY] }
  8900. });
  8901. }
  8902. }, {
  8903. key: 'create',
  8904. value: function create(resource) {
  8905. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8906. return _axios2.default.post('/api/' + this.resource + '/', resource, this.getRequestConfig(params));
  8907. }
  8908. }, {
  8909. key: 'all',
  8910. value: function all() {
  8911. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8912. return _axios2.default.get('/api/' + this.resource + '/', this.getRequestConfig(params));
  8913. }
  8914. }, {
  8915. key: 'get',
  8916. value: function get(resource) {
  8917. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8918. return _axios2.default.get('/api/' + this.resource + '/' + resource.id + '/', this.getRequestConfig(params));
  8919. }
  8920. }, {
  8921. key: 'update',
  8922. value: function update(resource) {
  8923. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8924. return _axios2.default.put('/api/' + this.resource + '/' + resource.id + '/', resource, this.getRequestConfig(params));
  8925. }
  8926. }, {
  8927. key: 'remove',
  8928. value: function remove(resource) {
  8929. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8930. return _axios2.default.delete('/api/' + this.resource + '/' + resource.id + '/', this.getRequestConfig(params));
  8931. }
  8932. }]);
  8933. return HTTP;
  8934. }();
  8935. exports.default = HTTP;
  8936. /***/ },
  8937. /* 160 */
  8938. /***/ function(module, exports, __webpack_require__) {
  8939. "use strict";
  8940. 'use strict';
  8941. Object.defineProperty(exports, "__esModule", {
  8942. value: true
  8943. });
  8944. exports.TOKEN_KEY = undefined;
  8945. var _classCallCheck2 = __webpack_require__(23);
  8946. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  8947. var _createClass2 = __webpack_require__(24);
  8948. var _createClass3 = _interopRequireDefault(_createClass2);
  8949. var _jwtDecode = __webpack_require__(260);
  8950. var _jwtDecode2 = _interopRequireDefault(_jwtDecode);
  8951. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8952. var TOKEN_KEY = exports.TOKEN_KEY = 'jwt';
  8953. var Token = function () {
  8954. function Token(tokenName) {
  8955. (0, _classCallCheck3.default)(this, Token);
  8956. this.name = tokenName;
  8957. }
  8958. (0, _createClass3.default)(Token, [{
  8959. key: 'stillValid',
  8960. value: function stillValid() {
  8961. var now = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
  8962. try {
  8963. return this._expirationDateSuperiorTo(now);
  8964. } catch (err) {
  8965. return false;
  8966. }
  8967. }
  8968. }, {
  8969. key: 'expiresInMinutes',
  8970. value: function expiresInMinutes(minutes) {
  8971. var now = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date();
  8972. try {
  8973. var nowPlusDuration = new Date(now.getTime() + minutes * 60000);
  8974. return this._expirationDateInferiorTo(nowPlusDuration);
  8975. } catch (err) {
  8976. return false;
  8977. }
  8978. }
  8979. }, {
  8980. key: '_expirationDateInferiorTo',
  8981. value: function _expirationDateInferiorTo(date) {
  8982. var expireDate = this._getTokenExpirationDate();
  8983. return expireDate < date;
  8984. }
  8985. }, {
  8986. key: '_expirationDateSuperiorTo',
  8987. value: function _expirationDateSuperiorTo(date) {
  8988. return !this._expirationDateInferiorTo(date);
  8989. }
  8990. }, {
  8991. key: '_getTokenExpirationDate',
  8992. value: function _getTokenExpirationDate() {
  8993. var decodedToken = (0, _jwtDecode2.default)(this.name);
  8994. return new Date(decodedToken.exp * 1000);
  8995. }
  8996. }]);
  8997. return Token;
  8998. }();
  8999. exports.default = Token;
  9000. /***/ },
  9001. /* 161 */
  9002. /***/ function(module, exports) {
  9003. "use strict";
  9004. 'use strict';
  9005. Object.defineProperty(exports, "__esModule", {
  9006. value: true
  9007. });
  9008. exports.showTooltip = showTooltip;
  9009. function showTooltip(elem, msg) {
  9010. var classNames = elem.className;
  9011. elem.setAttribute('class', classNames + ' hint--top');
  9012. elem.setAttribute('aria-label', msg);
  9013. setTimeout(function () {
  9014. elem.setAttribute('class', classNames);
  9015. }, 2000);
  9016. }
  9017. /***/ },
  9018. /* 162 */
  9019. /***/ function(module, exports, __webpack_require__) {
  9020. "use strict";
  9021. 'use strict';
  9022. Object.defineProperty(exports, "__esModule", {
  9023. value: true
  9024. });
  9025. exports.getSite = exports.getCurrentUrl = exports.isWebExtension = exports._ipIsValid = exports.getDomainName = undefined;
  9026. var _promise = __webpack_require__(81);
  9027. var _promise2 = _interopRequireDefault(_promise);
  9028. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9029. function _ipIsValid(ipAddress) {
  9030. return Boolean(/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipAddress));
  9031. }
  9032. function getDomainName(urlStr) {
  9033. var matches = urlStr.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
  9034. return matches && matches[1];
  9035. }
  9036. function isWebExtension() {
  9037. if (typeof chrome !== 'undefined' && typeof chrome.tabs !== 'undefined') {
  9038. return typeof chrome.tabs.query === 'function';
  9039. }
  9040. return false;
  9041. }
  9042. function getCurrentUrl() {
  9043. return new _promise2.default(function (resolve) {
  9044. chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
  9045. resolve(tabs[0].url);
  9046. });
  9047. });
  9048. }
  9049. function getSite() {
  9050. if (isWebExtension()) {
  9051. return getCurrentUrl().then(function (currentUrl) {
  9052. return getDomainName(currentUrl);
  9053. });
  9054. }
  9055. return new _promise2.default(function (resolve) {
  9056. resolve('');
  9057. });
  9058. }
  9059. exports.getDomainName = getDomainName;
  9060. exports._ipIsValid = _ipIsValid;
  9061. exports.isWebExtension = isWebExtension;
  9062. exports.getCurrentUrl = getCurrentUrl;
  9063. exports.getSite = getSite;
  9064. /***/ },
  9065. /* 163 */
  9066. /***/ function(module, exports, __webpack_require__) {
  9067. module.exports = { "default": __webpack_require__(177), __esModule: true };
  9068. /***/ },
  9069. /* 164 */
  9070. /***/ function(module, exports, __webpack_require__) {
  9071. "use strict";
  9072. "use strict";
  9073. exports.__esModule = true;
  9074. var _defineProperty = __webpack_require__(80);
  9075. var _defineProperty2 = _interopRequireDefault(_defineProperty);
  9076. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9077. exports.default = function (obj, key, value) {
  9078. if (key in obj) {
  9079. (0, _defineProperty2.default)(obj, key, {
  9080. value: value,
  9081. enumerable: true,
  9082. configurable: true,
  9083. writable: true
  9084. });
  9085. } else {
  9086. obj[key] = value;
  9087. }
  9088. return obj;
  9089. };
  9090. /***/ },
  9091. /* 165 */,
  9092. /* 166 */,
  9093. /* 167 */,
  9094. /* 168 */,
  9095. /* 169 */,
  9096. /* 170 */,
  9097. /* 171 */,
  9098. /* 172 */,
  9099. /* 173 */,
  9100. /* 174 */,
  9101. /* 175 */
  9102. /***/ function(module, exports, __webpack_require__) {
  9103. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  9104. if (true) {
  9105. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, __webpack_require__(275)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  9106. } else if (typeof exports !== "undefined") {
  9107. factory(module, require('select'));
  9108. } else {
  9109. var mod = {
  9110. exports: {}
  9111. };
  9112. factory(mod, global.select);
  9113. global.clipboardAction = mod.exports;
  9114. }
  9115. })(this, function (module, _select) {
  9116. 'use strict';
  9117. var _select2 = _interopRequireDefault(_select);
  9118. function _interopRequireDefault(obj) {
  9119. return obj && obj.__esModule ? obj : {
  9120. default: obj
  9121. };
  9122. }
  9123. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  9124. return typeof obj;
  9125. } : function (obj) {
  9126. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  9127. };
  9128. function _classCallCheck(instance, Constructor) {
  9129. if (!(instance instanceof Constructor)) {
  9130. throw new TypeError("Cannot call a class as a function");
  9131. }
  9132. }
  9133. var _createClass = function () {
  9134. function defineProperties(target, props) {
  9135. for (var i = 0; i < props.length; i++) {
  9136. var descriptor = props[i];
  9137. descriptor.enumerable = descriptor.enumerable || false;
  9138. descriptor.configurable = true;
  9139. if ("value" in descriptor) descriptor.writable = true;
  9140. Object.defineProperty(target, descriptor.key, descriptor);
  9141. }
  9142. }
  9143. return function (Constructor, protoProps, staticProps) {
  9144. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  9145. if (staticProps) defineProperties(Constructor, staticProps);
  9146. return Constructor;
  9147. };
  9148. }();
  9149. var ClipboardAction = function () {
  9150. /**
  9151. * @param {Object} options
  9152. */
  9153. function ClipboardAction(options) {
  9154. _classCallCheck(this, ClipboardAction);
  9155. this.resolveOptions(options);
  9156. this.initSelection();
  9157. }
  9158. /**
  9159. * Defines base properties passed from constructor.
  9160. * @param {Object} options
  9161. */
  9162. _createClass(ClipboardAction, [{
  9163. key: 'resolveOptions',
  9164. value: function resolveOptions() {
  9165. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9166. this.action = options.action;
  9167. this.emitter = options.emitter;
  9168. this.target = options.target;
  9169. this.text = options.text;
  9170. this.trigger = options.trigger;
  9171. this.selectedText = '';
  9172. }
  9173. }, {
  9174. key: 'initSelection',
  9175. value: function initSelection() {
  9176. if (this.text) {
  9177. this.selectFake();
  9178. } else if (this.target) {
  9179. this.selectTarget();
  9180. }
  9181. }
  9182. }, {
  9183. key: 'selectFake',
  9184. value: function selectFake() {
  9185. var _this = this;
  9186. var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
  9187. this.removeFake();
  9188. this.fakeHandlerCallback = function () {
  9189. return _this.removeFake();
  9190. };
  9191. this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
  9192. this.fakeElem = document.createElement('textarea');
  9193. // Prevent zooming on iOS
  9194. this.fakeElem.style.fontSize = '12pt';
  9195. // Reset box model
  9196. this.fakeElem.style.border = '0';
  9197. this.fakeElem.style.padding = '0';
  9198. this.fakeElem.style.margin = '0';
  9199. // Move element out of screen horizontally
  9200. this.fakeElem.style.position = 'absolute';
  9201. this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
  9202. // Move element to the same position vertically
  9203. var yPosition = window.pageYOffset || document.documentElement.scrollTop;
  9204. this.fakeElem.addEventListener('focus', window.scrollTo(0, yPosition));
  9205. this.fakeElem.style.top = yPosition + 'px';
  9206. this.fakeElem.setAttribute('readonly', '');
  9207. this.fakeElem.value = this.text;
  9208. document.body.appendChild(this.fakeElem);
  9209. this.selectedText = (0, _select2.default)(this.fakeElem);
  9210. this.copyText();
  9211. }
  9212. }, {
  9213. key: 'removeFake',
  9214. value: function removeFake() {
  9215. if (this.fakeHandler) {
  9216. document.body.removeEventListener('click', this.fakeHandlerCallback);
  9217. this.fakeHandler = null;
  9218. this.fakeHandlerCallback = null;
  9219. }
  9220. if (this.fakeElem) {
  9221. document.body.removeChild(this.fakeElem);
  9222. this.fakeElem = null;
  9223. }
  9224. }
  9225. }, {
  9226. key: 'selectTarget',
  9227. value: function selectTarget() {
  9228. this.selectedText = (0, _select2.default)(this.target);
  9229. this.copyText();
  9230. }
  9231. }, {
  9232. key: 'copyText',
  9233. value: function copyText() {
  9234. var succeeded = void 0;
  9235. try {
  9236. succeeded = document.execCommand(this.action);
  9237. } catch (err) {
  9238. succeeded = false;
  9239. }
  9240. this.handleResult(succeeded);
  9241. }
  9242. }, {
  9243. key: 'handleResult',
  9244. value: function handleResult(succeeded) {
  9245. this.emitter.emit(succeeded ? 'success' : 'error', {
  9246. action: this.action,
  9247. text: this.selectedText,
  9248. trigger: this.trigger,
  9249. clearSelection: this.clearSelection.bind(this)
  9250. });
  9251. }
  9252. }, {
  9253. key: 'clearSelection',
  9254. value: function clearSelection() {
  9255. if (this.target) {
  9256. this.target.blur();
  9257. }
  9258. window.getSelection().removeAllRanges();
  9259. }
  9260. }, {
  9261. key: 'destroy',
  9262. value: function destroy() {
  9263. this.removeFake();
  9264. }
  9265. }, {
  9266. key: 'action',
  9267. set: function set() {
  9268. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
  9269. this._action = action;
  9270. if (this._action !== 'copy' && this._action !== 'cut') {
  9271. throw new Error('Invalid "action" value, use either "copy" or "cut"');
  9272. }
  9273. },
  9274. get: function get() {
  9275. return this._action;
  9276. }
  9277. }, {
  9278. key: 'target',
  9279. set: function set(target) {
  9280. if (target !== undefined) {
  9281. if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
  9282. if (this.action === 'copy' && target.hasAttribute('disabled')) {
  9283. throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
  9284. }
  9285. if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
  9286. throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
  9287. }
  9288. this._target = target;
  9289. } else {
  9290. throw new Error('Invalid "target" value, use a valid Element');
  9291. }
  9292. }
  9293. },
  9294. get: function get() {
  9295. return this._target;
  9296. }
  9297. }]);
  9298. return ClipboardAction;
  9299. }();
  9300. module.exports = ClipboardAction;
  9301. });
  9302. /***/ },
  9303. /* 176 */
  9304. /***/ function(module, exports, __webpack_require__) {
  9305. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  9306. if (true) {
  9307. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, __webpack_require__(175), __webpack_require__(281), __webpack_require__(247)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  9308. } else if (typeof exports !== "undefined") {
  9309. factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener'));
  9310. } else {
  9311. var mod = {
  9312. exports: {}
  9313. };
  9314. factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener);
  9315. global.clipboard = mod.exports;
  9316. }
  9317. })(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) {
  9318. 'use strict';
  9319. var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
  9320. var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
  9321. var _goodListener2 = _interopRequireDefault(_goodListener);
  9322. function _interopRequireDefault(obj) {
  9323. return obj && obj.__esModule ? obj : {
  9324. default: obj
  9325. };
  9326. }
  9327. function _classCallCheck(instance, Constructor) {
  9328. if (!(instance instanceof Constructor)) {
  9329. throw new TypeError("Cannot call a class as a function");
  9330. }
  9331. }
  9332. var _createClass = function () {
  9333. function defineProperties(target, props) {
  9334. for (var i = 0; i < props.length; i++) {
  9335. var descriptor = props[i];
  9336. descriptor.enumerable = descriptor.enumerable || false;
  9337. descriptor.configurable = true;
  9338. if ("value" in descriptor) descriptor.writable = true;
  9339. Object.defineProperty(target, descriptor.key, descriptor);
  9340. }
  9341. }
  9342. return function (Constructor, protoProps, staticProps) {
  9343. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  9344. if (staticProps) defineProperties(Constructor, staticProps);
  9345. return Constructor;
  9346. };
  9347. }();
  9348. function _possibleConstructorReturn(self, call) {
  9349. if (!self) {
  9350. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  9351. }
  9352. return call && (typeof call === "object" || typeof call === "function") ? call : self;
  9353. }
  9354. function _inherits(subClass, superClass) {
  9355. if (typeof superClass !== "function" && superClass !== null) {
  9356. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  9357. }
  9358. subClass.prototype = Object.create(superClass && superClass.prototype, {
  9359. constructor: {
  9360. value: subClass,
  9361. enumerable: false,
  9362. writable: true,
  9363. configurable: true
  9364. }
  9365. });
  9366. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  9367. }
  9368. var Clipboard = function (_Emitter) {
  9369. _inherits(Clipboard, _Emitter);
  9370. /**
  9371. * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
  9372. * @param {Object} options
  9373. */
  9374. function Clipboard(trigger, options) {
  9375. _classCallCheck(this, Clipboard);
  9376. var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
  9377. _this.resolveOptions(options);
  9378. _this.listenClick(trigger);
  9379. return _this;
  9380. }
  9381. /**
  9382. * Defines if attributes would be resolved using internal setter functions
  9383. * or custom functions that were passed in the constructor.
  9384. * @param {Object} options
  9385. */
  9386. _createClass(Clipboard, [{
  9387. key: 'resolveOptions',
  9388. value: function resolveOptions() {
  9389. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9390. this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
  9391. this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
  9392. this.text = typeof options.text === 'function' ? options.text : this.defaultText;
  9393. }
  9394. }, {
  9395. key: 'listenClick',
  9396. value: function listenClick(trigger) {
  9397. var _this2 = this;
  9398. this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {
  9399. return _this2.onClick(e);
  9400. });
  9401. }
  9402. }, {
  9403. key: 'onClick',
  9404. value: function onClick(e) {
  9405. var trigger = e.delegateTarget || e.currentTarget;
  9406. if (this.clipboardAction) {
  9407. this.clipboardAction = null;
  9408. }
  9409. this.clipboardAction = new _clipboardAction2.default({
  9410. action: this.action(trigger),
  9411. target: this.target(trigger),
  9412. text: this.text(trigger),
  9413. trigger: trigger,
  9414. emitter: this
  9415. });
  9416. }
  9417. }, {
  9418. key: 'defaultAction',
  9419. value: function defaultAction(trigger) {
  9420. return getAttributeValue('action', trigger);
  9421. }
  9422. }, {
  9423. key: 'defaultTarget',
  9424. value: function defaultTarget(trigger) {
  9425. var selector = getAttributeValue('target', trigger);
  9426. if (selector) {
  9427. return document.querySelector(selector);
  9428. }
  9429. }
  9430. }, {
  9431. key: 'defaultText',
  9432. value: function defaultText(trigger) {
  9433. return getAttributeValue('text', trigger);
  9434. }
  9435. }, {
  9436. key: 'destroy',
  9437. value: function destroy() {
  9438. this.listener.destroy();
  9439. if (this.clipboardAction) {
  9440. this.clipboardAction.destroy();
  9441. this.clipboardAction = null;
  9442. }
  9443. }
  9444. }]);
  9445. return Clipboard;
  9446. }(_tinyEmitter2.default);
  9447. /**
  9448. * Helper function to retrieve attribute value.
  9449. * @param {String} suffix
  9450. * @param {Element} element
  9451. */
  9452. function getAttributeValue(suffix, element) {
  9453. var attribute = 'data-clipboard-' + suffix;
  9454. if (!element.hasAttribute(attribute)) {
  9455. return;
  9456. }
  9457. return element.getAttribute(attribute);
  9458. }
  9459. module.exports = Clipboard;
  9460. });
  9461. /***/ },
  9462. /* 177 */
  9463. /***/ function(module, exports, __webpack_require__) {
  9464. var core = __webpack_require__(8)
  9465. , $JSON = core.JSON || (core.JSON = {stringify: JSON.stringify});
  9466. module.exports = function stringify(it){ // eslint-disable-line no-unused-vars
  9467. return $JSON.stringify.apply($JSON, arguments);
  9468. };
  9469. /***/ },
  9470. /* 178 */
  9471. /***/ function(module, exports, __webpack_require__) {
  9472. __webpack_require__(209);
  9473. module.exports = __webpack_require__(8).Object.assign;
  9474. /***/ },
  9475. /* 179 */
  9476. /***/ function(module, exports, __webpack_require__) {
  9477. __webpack_require__(210);
  9478. var $Object = __webpack_require__(8).Object;
  9479. module.exports = function defineProperty(it, key, desc){
  9480. return $Object.defineProperty(it, key, desc);
  9481. };
  9482. /***/ },
  9483. /* 180 */
  9484. /***/ function(module, exports, __webpack_require__) {
  9485. __webpack_require__(211);
  9486. __webpack_require__(213);
  9487. __webpack_require__(214);
  9488. __webpack_require__(212);
  9489. module.exports = __webpack_require__(8).Promise;
  9490. /***/ },
  9491. /* 181 */
  9492. /***/ function(module, exports) {
  9493. module.exports = function(){ /* empty */ };
  9494. /***/ },
  9495. /* 182 */
  9496. /***/ function(module, exports) {
  9497. module.exports = function(it, Constructor, name, forbiddenField){
  9498. if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){
  9499. throw TypeError(name + ': incorrect invocation!');
  9500. } return it;
  9501. };
  9502. /***/ },
  9503. /* 183 */
  9504. /***/ function(module, exports, __webpack_require__) {
  9505. // false -> Array#indexOf
  9506. // true -> Array#includes
  9507. var toIObject = __webpack_require__(59)
  9508. , toLength = __webpack_require__(102)
  9509. , toIndex = __webpack_require__(205);
  9510. module.exports = function(IS_INCLUDES){
  9511. return function($this, el, fromIndex){
  9512. var O = toIObject($this)
  9513. , length = toLength(O.length)
  9514. , index = toIndex(fromIndex, length)
  9515. , value;
  9516. // Array#includes uses SameValueZero equality algorithm
  9517. if(IS_INCLUDES && el != el)while(length > index){
  9518. value = O[index++];
  9519. if(value != value)return true;
  9520. // Array#toIndex ignores holes, Array#includes - not
  9521. } else for(;length > index; index++)if(IS_INCLUDES || index in O){
  9522. if(O[index] === el)return IS_INCLUDES || index || 0;
  9523. } return !IS_INCLUDES && -1;
  9524. };
  9525. };
  9526. /***/ },
  9527. /* 184 */
  9528. /***/ function(module, exports, __webpack_require__) {
  9529. var ctx = __webpack_require__(39)
  9530. , call = __webpack_require__(188)
  9531. , isArrayIter = __webpack_require__(187)
  9532. , anObject = __webpack_require__(13)
  9533. , toLength = __webpack_require__(102)
  9534. , getIterFn = __webpack_require__(207)
  9535. , BREAK = {}
  9536. , RETURN = {};
  9537. var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){
  9538. var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)
  9539. , f = ctx(fn, that, entries ? 2 : 1)
  9540. , index = 0
  9541. , length, step, iterator, result;
  9542. if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
  9543. // fast case for arrays with default iterator
  9544. if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
  9545. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  9546. if(result === BREAK || result === RETURN)return result;
  9547. } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
  9548. result = call(iterator, f, step.value, entries);
  9549. if(result === BREAK || result === RETURN)return result;
  9550. }
  9551. };
  9552. exports.BREAK = BREAK;
  9553. exports.RETURN = RETURN;
  9554. /***/ },
  9555. /* 185 */
  9556. /***/ function(module, exports, __webpack_require__) {
  9557. module.exports = !__webpack_require__(14) && !__webpack_require__(55)(function(){
  9558. return Object.defineProperty(__webpack_require__(54)('div'), 'a', {get: function(){ return 7; }}).a != 7;
  9559. });
  9560. /***/ },
  9561. /* 186 */
  9562. /***/ function(module, exports) {
  9563. // fast apply, http://jsperf.lnkit.com/fast-apply/5
  9564. module.exports = function(fn, args, that){
  9565. var un = that === undefined;
  9566. switch(args.length){
  9567. case 0: return un ? fn()
  9568. : fn.call(that);
  9569. case 1: return un ? fn(args[0])
  9570. : fn.call(that, args[0]);
  9571. case 2: return un ? fn(args[0], args[1])
  9572. : fn.call(that, args[0], args[1]);
  9573. case 3: return un ? fn(args[0], args[1], args[2])
  9574. : fn.call(that, args[0], args[1], args[2]);
  9575. case 4: return un ? fn(args[0], args[1], args[2], args[3])
  9576. : fn.call(that, args[0], args[1], args[2], args[3]);
  9577. } return fn.apply(that, args);
  9578. };
  9579. /***/ },
  9580. /* 187 */
  9581. /***/ function(module, exports, __webpack_require__) {
  9582. // check on default Array iterator
  9583. var Iterators = __webpack_require__(27)
  9584. , ITERATOR = __webpack_require__(5)('iterator')
  9585. , ArrayProto = Array.prototype;
  9586. module.exports = function(it){
  9587. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  9588. };
  9589. /***/ },
  9590. /* 188 */
  9591. /***/ function(module, exports, __webpack_require__) {
  9592. // call something on iterator step with safe closing on error
  9593. var anObject = __webpack_require__(13);
  9594. module.exports = function(iterator, fn, value, entries){
  9595. try {
  9596. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  9597. // 7.4.6 IteratorClose(iterator, completion)
  9598. } catch(e){
  9599. var ret = iterator['return'];
  9600. if(ret !== undefined)anObject(ret.call(iterator));
  9601. throw e;
  9602. }
  9603. };
  9604. /***/ },
  9605. /* 189 */
  9606. /***/ function(module, exports, __webpack_require__) {
  9607. "use strict";
  9608. 'use strict';
  9609. var create = __webpack_require__(194)
  9610. , descriptor = __webpack_require__(99)
  9611. , setToStringTag = __webpack_require__(56)
  9612. , IteratorPrototype = {};
  9613. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  9614. __webpack_require__(15)(IteratorPrototype, __webpack_require__(5)('iterator'), function(){ return this; });
  9615. module.exports = function(Constructor, NAME, next){
  9616. Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
  9617. setToStringTag(Constructor, NAME + ' Iterator');
  9618. };
  9619. /***/ },
  9620. /* 190 */
  9621. /***/ function(module, exports, __webpack_require__) {
  9622. var ITERATOR = __webpack_require__(5)('iterator')
  9623. , SAFE_CLOSING = false;
  9624. try {
  9625. var riter = [7][ITERATOR]();
  9626. riter['return'] = function(){ SAFE_CLOSING = true; };
  9627. Array.from(riter, function(){ throw 2; });
  9628. } catch(e){ /* empty */ }
  9629. module.exports = function(exec, skipClosing){
  9630. if(!skipClosing && !SAFE_CLOSING)return false;
  9631. var safe = false;
  9632. try {
  9633. var arr = [7]
  9634. , iter = arr[ITERATOR]();
  9635. iter.next = function(){ return {done: safe = true}; };
  9636. arr[ITERATOR] = function(){ return iter; };
  9637. exec(arr);
  9638. } catch(e){ /* empty */ }
  9639. return safe;
  9640. };
  9641. /***/ },
  9642. /* 191 */
  9643. /***/ function(module, exports) {
  9644. module.exports = function(done, value){
  9645. return {value: value, done: !!done};
  9646. };
  9647. /***/ },
  9648. /* 192 */
  9649. /***/ function(module, exports, __webpack_require__) {
  9650. var global = __webpack_require__(6)
  9651. , macrotask = __webpack_require__(101).set
  9652. , Observer = global.MutationObserver || global.WebKitMutationObserver
  9653. , process = global.process
  9654. , Promise = global.Promise
  9655. , isNode = __webpack_require__(38)(process) == 'process';
  9656. module.exports = function(){
  9657. var head, last, notify;
  9658. var flush = function(){
  9659. var parent, fn;
  9660. if(isNode && (parent = process.domain))parent.exit();
  9661. while(head){
  9662. fn = head.fn;
  9663. head = head.next;
  9664. try {
  9665. fn();
  9666. } catch(e){
  9667. if(head)notify();
  9668. else last = undefined;
  9669. throw e;
  9670. }
  9671. } last = undefined;
  9672. if(parent)parent.enter();
  9673. };
  9674. // Node.js
  9675. if(isNode){
  9676. notify = function(){
  9677. process.nextTick(flush);
  9678. };
  9679. // browsers with MutationObserver
  9680. } else if(Observer){
  9681. var toggle = true
  9682. , node = document.createTextNode('');
  9683. new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new
  9684. notify = function(){
  9685. node.data = toggle = !toggle;
  9686. };
  9687. // environments with maybe non-completely correct, but existent Promise
  9688. } else if(Promise && Promise.resolve){
  9689. var promise = Promise.resolve();
  9690. notify = function(){
  9691. promise.then(flush);
  9692. };
  9693. // for other environments - macrotask based on:
  9694. // - setImmediate
  9695. // - MessageChannel
  9696. // - window.postMessag
  9697. // - onreadystatechange
  9698. // - setTimeout
  9699. } else {
  9700. notify = function(){
  9701. // strange IE + webpack dev server bug - use .call(global)
  9702. macrotask.call(global, flush);
  9703. };
  9704. }
  9705. return function(fn){
  9706. var task = {fn: fn, next: undefined};
  9707. if(last)last.next = task;
  9708. if(!head){
  9709. head = task;
  9710. notify();
  9711. } last = task;
  9712. };
  9713. };
  9714. /***/ },
  9715. /* 193 */
  9716. /***/ function(module, exports, __webpack_require__) {
  9717. "use strict";
  9718. 'use strict';
  9719. // 19.1.2.1 Object.assign(target, source, ...)
  9720. var getKeys = __webpack_require__(98)
  9721. , gOPS = __webpack_require__(196)
  9722. , pIE = __webpack_require__(199)
  9723. , toObject = __webpack_require__(103)
  9724. , IObject = __webpack_require__(95)
  9725. , $assign = Object.assign;
  9726. // should work with symbols and should have deterministic property order (V8 bug)
  9727. module.exports = !$assign || __webpack_require__(55)(function(){
  9728. var A = {}
  9729. , B = {}
  9730. , S = Symbol()
  9731. , K = 'abcdefghijklmnopqrst';
  9732. A[S] = 7;
  9733. K.split('').forEach(function(k){ B[k] = k; });
  9734. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  9735. }) ? function assign(target, source){ // eslint-disable-line no-unused-vars
  9736. var T = toObject(target)
  9737. , aLen = arguments.length
  9738. , index = 1
  9739. , getSymbols = gOPS.f
  9740. , isEnum = pIE.f;
  9741. while(aLen > index){
  9742. var S = IObject(arguments[index++])
  9743. , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
  9744. , length = keys.length
  9745. , j = 0
  9746. , key;
  9747. while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
  9748. } return T;
  9749. } : $assign;
  9750. /***/ },
  9751. /* 194 */
  9752. /***/ function(module, exports, __webpack_require__) {
  9753. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  9754. var anObject = __webpack_require__(13)
  9755. , dPs = __webpack_require__(195)
  9756. , enumBugKeys = __webpack_require__(93)
  9757. , IE_PROTO = __webpack_require__(57)('IE_PROTO')
  9758. , Empty = function(){ /* empty */ }
  9759. , PROTOTYPE = 'prototype';
  9760. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  9761. var createDict = function(){
  9762. // Thrash, waste and sodomy: IE GC bug
  9763. var iframe = __webpack_require__(54)('iframe')
  9764. , i = enumBugKeys.length
  9765. , lt = '<'
  9766. , gt = '>'
  9767. , iframeDocument;
  9768. iframe.style.display = 'none';
  9769. __webpack_require__(94).appendChild(iframe);
  9770. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  9771. // createDict = iframe.contentWindow.Object;
  9772. // html.removeChild(iframe);
  9773. iframeDocument = iframe.contentWindow.document;
  9774. iframeDocument.open();
  9775. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  9776. iframeDocument.close();
  9777. createDict = iframeDocument.F;
  9778. while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
  9779. return createDict();
  9780. };
  9781. module.exports = Object.create || function create(O, Properties){
  9782. var result;
  9783. if(O !== null){
  9784. Empty[PROTOTYPE] = anObject(O);
  9785. result = new Empty;
  9786. Empty[PROTOTYPE] = null;
  9787. // add "__proto__" for Object.getPrototypeOf polyfill
  9788. result[IE_PROTO] = O;
  9789. } else result = createDict();
  9790. return Properties === undefined ? result : dPs(result, Properties);
  9791. };
  9792. /***/ },
  9793. /* 195 */
  9794. /***/ function(module, exports, __webpack_require__) {
  9795. var dP = __webpack_require__(28)
  9796. , anObject = __webpack_require__(13)
  9797. , getKeys = __webpack_require__(98);
  9798. module.exports = __webpack_require__(14) ? Object.defineProperties : function defineProperties(O, Properties){
  9799. anObject(O);
  9800. var keys = getKeys(Properties)
  9801. , length = keys.length
  9802. , i = 0
  9803. , P;
  9804. while(length > i)dP.f(O, P = keys[i++], Properties[P]);
  9805. return O;
  9806. };
  9807. /***/ },
  9808. /* 196 */
  9809. /***/ function(module, exports) {
  9810. exports.f = Object.getOwnPropertySymbols;
  9811. /***/ },
  9812. /* 197 */
  9813. /***/ function(module, exports, __webpack_require__) {
  9814. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  9815. var has = __webpack_require__(41)
  9816. , toObject = __webpack_require__(103)
  9817. , IE_PROTO = __webpack_require__(57)('IE_PROTO')
  9818. , ObjectProto = Object.prototype;
  9819. module.exports = Object.getPrototypeOf || function(O){
  9820. O = toObject(O);
  9821. if(has(O, IE_PROTO))return O[IE_PROTO];
  9822. if(typeof O.constructor == 'function' && O instanceof O.constructor){
  9823. return O.constructor.prototype;
  9824. } return O instanceof Object ? ObjectProto : null;
  9825. };
  9826. /***/ },
  9827. /* 198 */
  9828. /***/ function(module, exports, __webpack_require__) {
  9829. var has = __webpack_require__(41)
  9830. , toIObject = __webpack_require__(59)
  9831. , arrayIndexOf = __webpack_require__(183)(false)
  9832. , IE_PROTO = __webpack_require__(57)('IE_PROTO');
  9833. module.exports = function(object, names){
  9834. var O = toIObject(object)
  9835. , i = 0
  9836. , result = []
  9837. , key;
  9838. for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
  9839. // Don't enum bug & hidden keys
  9840. while(names.length > i)if(has(O, key = names[i++])){
  9841. ~arrayIndexOf(result, key) || result.push(key);
  9842. }
  9843. return result;
  9844. };
  9845. /***/ },
  9846. /* 199 */
  9847. /***/ function(module, exports) {
  9848. exports.f = {}.propertyIsEnumerable;
  9849. /***/ },
  9850. /* 200 */
  9851. /***/ function(module, exports, __webpack_require__) {
  9852. var hide = __webpack_require__(15);
  9853. module.exports = function(target, src, safe){
  9854. for(var key in src){
  9855. if(safe && target[key])target[key] = src[key];
  9856. else hide(target, key, src[key]);
  9857. } return target;
  9858. };
  9859. /***/ },
  9860. /* 201 */
  9861. /***/ function(module, exports, __webpack_require__) {
  9862. module.exports = __webpack_require__(15);
  9863. /***/ },
  9864. /* 202 */
  9865. /***/ function(module, exports, __webpack_require__) {
  9866. "use strict";
  9867. 'use strict';
  9868. var global = __webpack_require__(6)
  9869. , core = __webpack_require__(8)
  9870. , dP = __webpack_require__(28)
  9871. , DESCRIPTORS = __webpack_require__(14)
  9872. , SPECIES = __webpack_require__(5)('species');
  9873. module.exports = function(KEY){
  9874. var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
  9875. if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {
  9876. configurable: true,
  9877. get: function(){ return this; }
  9878. });
  9879. };
  9880. /***/ },
  9881. /* 203 */
  9882. /***/ function(module, exports, __webpack_require__) {
  9883. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  9884. var anObject = __webpack_require__(13)
  9885. , aFunction = __webpack_require__(52)
  9886. , SPECIES = __webpack_require__(5)('species');
  9887. module.exports = function(O, D){
  9888. var C = anObject(O).constructor, S;
  9889. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  9890. };
  9891. /***/ },
  9892. /* 204 */
  9893. /***/ function(module, exports, __webpack_require__) {
  9894. var toInteger = __webpack_require__(58)
  9895. , defined = __webpack_require__(53);
  9896. // true -> String#at
  9897. // false -> String#codePointAt
  9898. module.exports = function(TO_STRING){
  9899. return function(that, pos){
  9900. var s = String(defined(that))
  9901. , i = toInteger(pos)
  9902. , l = s.length
  9903. , a, b;
  9904. if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
  9905. a = s.charCodeAt(i);
  9906. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  9907. ? TO_STRING ? s.charAt(i) : a
  9908. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  9909. };
  9910. };
  9911. /***/ },
  9912. /* 205 */
  9913. /***/ function(module, exports, __webpack_require__) {
  9914. var toInteger = __webpack_require__(58)
  9915. , max = Math.max
  9916. , min = Math.min;
  9917. module.exports = function(index, length){
  9918. index = toInteger(index);
  9919. return index < 0 ? max(index + length, 0) : min(index, length);
  9920. };
  9921. /***/ },
  9922. /* 206 */
  9923. /***/ function(module, exports, __webpack_require__) {
  9924. // 7.1.1 ToPrimitive(input [, PreferredType])
  9925. var isObject = __webpack_require__(42);
  9926. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  9927. // and the second argument - flag - preferred type is a string
  9928. module.exports = function(it, S){
  9929. if(!isObject(it))return it;
  9930. var fn, val;
  9931. if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
  9932. if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
  9933. if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
  9934. throw TypeError("Can't convert object to primitive value");
  9935. };
  9936. /***/ },
  9937. /* 207 */
  9938. /***/ function(module, exports, __webpack_require__) {
  9939. var classof = __webpack_require__(92)
  9940. , ITERATOR = __webpack_require__(5)('iterator')
  9941. , Iterators = __webpack_require__(27);
  9942. module.exports = __webpack_require__(8).getIteratorMethod = function(it){
  9943. if(it != undefined)return it[ITERATOR]
  9944. || it['@@iterator']
  9945. || Iterators[classof(it)];
  9946. };
  9947. /***/ },
  9948. /* 208 */
  9949. /***/ function(module, exports, __webpack_require__) {
  9950. "use strict";
  9951. 'use strict';
  9952. var addToUnscopables = __webpack_require__(181)
  9953. , step = __webpack_require__(191)
  9954. , Iterators = __webpack_require__(27)
  9955. , toIObject = __webpack_require__(59);
  9956. // 22.1.3.4 Array.prototype.entries()
  9957. // 22.1.3.13 Array.prototype.keys()
  9958. // 22.1.3.29 Array.prototype.values()
  9959. // 22.1.3.30 Array.prototype[@@iterator]()
  9960. module.exports = __webpack_require__(96)(Array, 'Array', function(iterated, kind){
  9961. this._t = toIObject(iterated); // target
  9962. this._i = 0; // next index
  9963. this._k = kind; // kind
  9964. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  9965. }, function(){
  9966. var O = this._t
  9967. , kind = this._k
  9968. , index = this._i++;
  9969. if(!O || index >= O.length){
  9970. this._t = undefined;
  9971. return step(1);
  9972. }
  9973. if(kind == 'keys' )return step(0, index);
  9974. if(kind == 'values')return step(0, O[index]);
  9975. return step(0, [index, O[index]]);
  9976. }, 'values');
  9977. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  9978. Iterators.Arguments = Iterators.Array;
  9979. addToUnscopables('keys');
  9980. addToUnscopables('values');
  9981. addToUnscopables('entries');
  9982. /***/ },
  9983. /* 209 */
  9984. /***/ function(module, exports, __webpack_require__) {
  9985. // 19.1.3.1 Object.assign(target, source)
  9986. var $export = __webpack_require__(40);
  9987. $export($export.S + $export.F, 'Object', {assign: __webpack_require__(193)});
  9988. /***/ },
  9989. /* 210 */
  9990. /***/ function(module, exports, __webpack_require__) {
  9991. var $export = __webpack_require__(40);
  9992. // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  9993. $export($export.S + $export.F * !__webpack_require__(14), 'Object', {defineProperty: __webpack_require__(28).f});
  9994. /***/ },
  9995. /* 211 */
  9996. /***/ function(module, exports) {
  9997. /***/ },
  9998. /* 212 */
  9999. /***/ function(module, exports, __webpack_require__) {
  10000. "use strict";
  10001. 'use strict';
  10002. var LIBRARY = __webpack_require__(97)
  10003. , global = __webpack_require__(6)
  10004. , ctx = __webpack_require__(39)
  10005. , classof = __webpack_require__(92)
  10006. , $export = __webpack_require__(40)
  10007. , isObject = __webpack_require__(42)
  10008. , aFunction = __webpack_require__(52)
  10009. , anInstance = __webpack_require__(182)
  10010. , forOf = __webpack_require__(184)
  10011. , speciesConstructor = __webpack_require__(203)
  10012. , task = __webpack_require__(101).set
  10013. , microtask = __webpack_require__(192)()
  10014. , PROMISE = 'Promise'
  10015. , TypeError = global.TypeError
  10016. , process = global.process
  10017. , $Promise = global[PROMISE]
  10018. , process = global.process
  10019. , isNode = classof(process) == 'process'
  10020. , empty = function(){ /* empty */ }
  10021. , Internal, GenericPromiseCapability, Wrapper;
  10022. var USE_NATIVE = !!function(){
  10023. try {
  10024. // correct subclassing with @@species support
  10025. var promise = $Promise.resolve(1)
  10026. , FakePromise = (promise.constructor = {})[__webpack_require__(5)('species')] = function(exec){ exec(empty, empty); };
  10027. // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  10028. return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
  10029. } catch(e){ /* empty */ }
  10030. }();
  10031. // helpers
  10032. var sameConstructor = function(a, b){
  10033. // with library wrapper special case
  10034. return a === b || a === $Promise && b === Wrapper;
  10035. };
  10036. var isThenable = function(it){
  10037. var then;
  10038. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  10039. };
  10040. var newPromiseCapability = function(C){
  10041. return sameConstructor($Promise, C)
  10042. ? new PromiseCapability(C)
  10043. : new GenericPromiseCapability(C);
  10044. };
  10045. var PromiseCapability = GenericPromiseCapability = function(C){
  10046. var resolve, reject;
  10047. this.promise = new C(function($$resolve, $$reject){
  10048. if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');
  10049. resolve = $$resolve;
  10050. reject = $$reject;
  10051. });
  10052. this.resolve = aFunction(resolve);
  10053. this.reject = aFunction(reject);
  10054. };
  10055. var perform = function(exec){
  10056. try {
  10057. exec();
  10058. } catch(e){
  10059. return {error: e};
  10060. }
  10061. };
  10062. var notify = function(promise, isReject){
  10063. if(promise._n)return;
  10064. promise._n = true;
  10065. var chain = promise._c;
  10066. microtask(function(){
  10067. var value = promise._v
  10068. , ok = promise._s == 1
  10069. , i = 0;
  10070. var run = function(reaction){
  10071. var handler = ok ? reaction.ok : reaction.fail
  10072. , resolve = reaction.resolve
  10073. , reject = reaction.reject
  10074. , domain = reaction.domain
  10075. , result, then;
  10076. try {
  10077. if(handler){
  10078. if(!ok){
  10079. if(promise._h == 2)onHandleUnhandled(promise);
  10080. promise._h = 1;
  10081. }
  10082. if(handler === true)result = value;
  10083. else {
  10084. if(domain)domain.enter();
  10085. result = handler(value);
  10086. if(domain)domain.exit();
  10087. }
  10088. if(result === reaction.promise){
  10089. reject(TypeError('Promise-chain cycle'));
  10090. } else if(then = isThenable(result)){
  10091. then.call(result, resolve, reject);
  10092. } else resolve(result);
  10093. } else reject(value);
  10094. } catch(e){
  10095. reject(e);
  10096. }
  10097. };
  10098. while(chain.length > i)run(chain[i++]); // variable length - can't use forEach
  10099. promise._c = [];
  10100. promise._n = false;
  10101. if(isReject && !promise._h)onUnhandled(promise);
  10102. });
  10103. };
  10104. var onUnhandled = function(promise){
  10105. task.call(global, function(){
  10106. var value = promise._v
  10107. , abrupt, handler, console;
  10108. if(isUnhandled(promise)){
  10109. abrupt = perform(function(){
  10110. if(isNode){
  10111. process.emit('unhandledRejection', value, promise);
  10112. } else if(handler = global.onunhandledrejection){
  10113. handler({promise: promise, reason: value});
  10114. } else if((console = global.console) && console.error){
  10115. console.error('Unhandled promise rejection', value);
  10116. }
  10117. });
  10118. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  10119. promise._h = isNode || isUnhandled(promise) ? 2 : 1;
  10120. } promise._a = undefined;
  10121. if(abrupt)throw abrupt.error;
  10122. });
  10123. };
  10124. var isUnhandled = function(promise){
  10125. if(promise._h == 1)return false;
  10126. var chain = promise._a || promise._c
  10127. , i = 0
  10128. , reaction;
  10129. while(chain.length > i){
  10130. reaction = chain[i++];
  10131. if(reaction.fail || !isUnhandled(reaction.promise))return false;
  10132. } return true;
  10133. };
  10134. var onHandleUnhandled = function(promise){
  10135. task.call(global, function(){
  10136. var handler;
  10137. if(isNode){
  10138. process.emit('rejectionHandled', promise);
  10139. } else if(handler = global.onrejectionhandled){
  10140. handler({promise: promise, reason: promise._v});
  10141. }
  10142. });
  10143. };
  10144. var $reject = function(value){
  10145. var promise = this;
  10146. if(promise._d)return;
  10147. promise._d = true;
  10148. promise = promise._w || promise; // unwrap
  10149. promise._v = value;
  10150. promise._s = 2;
  10151. if(!promise._a)promise._a = promise._c.slice();
  10152. notify(promise, true);
  10153. };
  10154. var $resolve = function(value){
  10155. var promise = this
  10156. , then;
  10157. if(promise._d)return;
  10158. promise._d = true;
  10159. promise = promise._w || promise; // unwrap
  10160. try {
  10161. if(promise === value)throw TypeError("Promise can't be resolved itself");
  10162. if(then = isThenable(value)){
  10163. microtask(function(){
  10164. var wrapper = {_w: promise, _d: false}; // wrap
  10165. try {
  10166. then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
  10167. } catch(e){
  10168. $reject.call(wrapper, e);
  10169. }
  10170. });
  10171. } else {
  10172. promise._v = value;
  10173. promise._s = 1;
  10174. notify(promise, false);
  10175. }
  10176. } catch(e){
  10177. $reject.call({_w: promise, _d: false}, e); // wrap
  10178. }
  10179. };
  10180. // constructor polyfill
  10181. if(!USE_NATIVE){
  10182. // 25.4.3.1 Promise(executor)
  10183. $Promise = function Promise(executor){
  10184. anInstance(this, $Promise, PROMISE, '_h');
  10185. aFunction(executor);
  10186. Internal.call(this);
  10187. try {
  10188. executor(ctx($resolve, this, 1), ctx($reject, this, 1));
  10189. } catch(err){
  10190. $reject.call(this, err);
  10191. }
  10192. };
  10193. Internal = function Promise(executor){
  10194. this._c = []; // <- awaiting reactions
  10195. this._a = undefined; // <- checked in isUnhandled reactions
  10196. this._s = 0; // <- state
  10197. this._d = false; // <- done
  10198. this._v = undefined; // <- value
  10199. this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
  10200. this._n = false; // <- notify
  10201. };
  10202. Internal.prototype = __webpack_require__(200)($Promise.prototype, {
  10203. // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
  10204. then: function then(onFulfilled, onRejected){
  10205. var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
  10206. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  10207. reaction.fail = typeof onRejected == 'function' && onRejected;
  10208. reaction.domain = isNode ? process.domain : undefined;
  10209. this._c.push(reaction);
  10210. if(this._a)this._a.push(reaction);
  10211. if(this._s)notify(this, false);
  10212. return reaction.promise;
  10213. },
  10214. // 25.4.5.1 Promise.prototype.catch(onRejected)
  10215. 'catch': function(onRejected){
  10216. return this.then(undefined, onRejected);
  10217. }
  10218. });
  10219. PromiseCapability = function(){
  10220. var promise = new Internal;
  10221. this.promise = promise;
  10222. this.resolve = ctx($resolve, promise, 1);
  10223. this.reject = ctx($reject, promise, 1);
  10224. };
  10225. }
  10226. $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});
  10227. __webpack_require__(56)($Promise, PROMISE);
  10228. __webpack_require__(202)(PROMISE);
  10229. Wrapper = __webpack_require__(8)[PROMISE];
  10230. // statics
  10231. $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  10232. // 25.4.4.5 Promise.reject(r)
  10233. reject: function reject(r){
  10234. var capability = newPromiseCapability(this)
  10235. , $$reject = capability.reject;
  10236. $$reject(r);
  10237. return capability.promise;
  10238. }
  10239. });
  10240. $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  10241. // 25.4.4.6 Promise.resolve(x)
  10242. resolve: function resolve(x){
  10243. // instanceof instead of internal slot check because we should fix it without replacement native Promise core
  10244. if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;
  10245. var capability = newPromiseCapability(this)
  10246. , $$resolve = capability.resolve;
  10247. $$resolve(x);
  10248. return capability.promise;
  10249. }
  10250. });
  10251. $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(190)(function(iter){
  10252. $Promise.all(iter)['catch'](empty);
  10253. })), PROMISE, {
  10254. // 25.4.4.1 Promise.all(iterable)
  10255. all: function all(iterable){
  10256. var C = this
  10257. , capability = newPromiseCapability(C)
  10258. , resolve = capability.resolve
  10259. , reject = capability.reject;
  10260. var abrupt = perform(function(){
  10261. var values = []
  10262. , index = 0
  10263. , remaining = 1;
  10264. forOf(iterable, false, function(promise){
  10265. var $index = index++
  10266. , alreadyCalled = false;
  10267. values.push(undefined);
  10268. remaining++;
  10269. C.resolve(promise).then(function(value){
  10270. if(alreadyCalled)return;
  10271. alreadyCalled = true;
  10272. values[$index] = value;
  10273. --remaining || resolve(values);
  10274. }, reject);
  10275. });
  10276. --remaining || resolve(values);
  10277. });
  10278. if(abrupt)reject(abrupt.error);
  10279. return capability.promise;
  10280. },
  10281. // 25.4.4.4 Promise.race(iterable)
  10282. race: function race(iterable){
  10283. var C = this
  10284. , capability = newPromiseCapability(C)
  10285. , reject = capability.reject;
  10286. var abrupt = perform(function(){
  10287. forOf(iterable, false, function(promise){
  10288. C.resolve(promise).then(capability.resolve, reject);
  10289. });
  10290. });
  10291. if(abrupt)reject(abrupt.error);
  10292. return capability.promise;
  10293. }
  10294. });
  10295. /***/ },
  10296. /* 213 */
  10297. /***/ function(module, exports, __webpack_require__) {
  10298. "use strict";
  10299. 'use strict';
  10300. var $at = __webpack_require__(204)(true);
  10301. // 21.1.3.27 String.prototype[@@iterator]()
  10302. __webpack_require__(96)(String, 'String', function(iterated){
  10303. this._t = String(iterated); // target
  10304. this._i = 0; // next index
  10305. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  10306. }, function(){
  10307. var O = this._t
  10308. , index = this._i
  10309. , point;
  10310. if(index >= O.length)return {value: undefined, done: true};
  10311. point = $at(O, index);
  10312. this._i += point.length;
  10313. return {value: point, done: false};
  10314. });
  10315. /***/ },
  10316. /* 214 */
  10317. /***/ function(module, exports, __webpack_require__) {
  10318. __webpack_require__(208);
  10319. var global = __webpack_require__(6)
  10320. , hide = __webpack_require__(15)
  10321. , Iterators = __webpack_require__(27)
  10322. , TO_STRING_TAG = __webpack_require__(5)('toStringTag');
  10323. for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
  10324. var NAME = collections[i]
  10325. , Collection = global[NAME]
  10326. , proto = Collection && Collection.prototype;
  10327. if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
  10328. Iterators[NAME] = Iterators.Array;
  10329. }
  10330. /***/ },
  10331. /* 215 */,
  10332. /* 216 */,
  10333. /* 217 */
  10334. /***/ function(module, exports, __webpack_require__) {
  10335. exports = module.exports = __webpack_require__(17)();
  10336. // imports
  10337. // module
  10338. exports.push([module.i, "\n#fingerprint {\n min-width: 90px;\n text-align: center;\n background-color: transparent;\n color: white;\n}\n#fingerprint i {\n color: black;\n position: relative;\n padding: 0;\n text-shadow: 1px 1px 0 white;\n font-size: 1.3em;\n}\n", ""]);
  10339. // exports
  10340. /***/ },
  10341. /* 218 */
  10342. /***/ function(module, exports, __webpack_require__) {
  10343. exports = module.exports = __webpack_require__(17)();
  10344. // imports
  10345. // module
  10346. exports.push([module.i, "\n#passwords {\n max-height: 320px;\n overflow-y: scroll;\n overflow-x: hidden;\n}\n", ""]);
  10347. // exports
  10348. /***/ },
  10349. /* 219 */
  10350. /***/ function(module, exports, __webpack_require__) {
  10351. exports = module.exports = __webpack_require__(17)();
  10352. // imports
  10353. // module
  10354. exports.push([module.i, "\n#password-generator {\n color: #555;\n}\n.inner-addon i {\n position: absolute;\n padding: 10px;\n pointer-events: none;\n z-index: 10;\n}\n.inner-addon {\n position: relative;\n}\n.left-addon i {\n left: 0;\n}\n.right-addon i {\n right: 0;\n}\n.left-addon input {\n padding-left: 30px;\n}\n.right-addon input {\n padding-right: 30px;\n}\n", ""]);
  10355. // exports
  10356. /***/ },
  10357. /* 220 */
  10358. /***/ function(module, exports, __webpack_require__) {
  10359. exports = module.exports = __webpack_require__(17)();
  10360. // imports
  10361. // module
  10362. exports.push([module.i, "\n#lesspass .white-link {\n color: white;\n}\n#lesspass .white-link:hover, #lesspass .white-link:focus, #lesspass .white-link:active {\n text-decoration: none;\n color: white;\n}\n#lesspass, #lesspass * {\n border-radius: 0 !important;\n}\n", ""]);
  10363. // exports
  10364. /***/ },
  10365. /* 221 */
  10366. /***/ function(module, exports, __webpack_require__) {
  10367. exports = module.exports = __webpack_require__(17)();
  10368. // imports
  10369. // module
  10370. exports.push([module.i, "\n.fa-white {\n color: #ffffff;\n}\n", ""]);
  10371. // exports
  10372. /***/ },
  10373. /* 222 */
  10374. /***/ function(module, exports, __webpack_require__) {
  10375. exports = module.exports = __webpack_require__(17)();
  10376. // imports
  10377. // module
  10378. exports.push([module.i, "\n.card-header-dark {\n background-color: #555;\n border-color: #555;\n color: #FFF;\n}\n.grey-link {\n color: #373a3c;\n text-decoration: none;\n}\n.grey-link:hover, .grey-link:focus, .grey-link:active {\n color: #373a3c;\n text-decoration: none;\n}\n.white-link {\n color: white;\n}\n.white-link:hover, .white-link:focus, .white-link:active {\n text-decoration: none;\n color: white;\n}\n.fa-clickable {\n cursor: pointer;\n}\n", ""]);
  10379. // exports
  10380. /***/ },
  10381. /* 223 */
  10382. /***/ function(module, exports) {
  10383. /**
  10384. * A polyfill for Element.matches()
  10385. */
  10386. if (Element && !Element.prototype.matches) {
  10387. var proto = Element.prototype;
  10388. proto.matches = proto.matchesSelector ||
  10389. proto.mozMatchesSelector ||
  10390. proto.msMatchesSelector ||
  10391. proto.oMatchesSelector ||
  10392. proto.webkitMatchesSelector;
  10393. }
  10394. /**
  10395. * Finds the closest parent that matches a selector.
  10396. *
  10397. * @param {Element} element
  10398. * @param {String} selector
  10399. * @return {Function}
  10400. */
  10401. function closest (element, selector) {
  10402. while (element && element !== document) {
  10403. if (element.matches(selector)) return element;
  10404. element = element.parentNode;
  10405. }
  10406. }
  10407. module.exports = closest;
  10408. /***/ },
  10409. /* 224 */
  10410. /***/ function(module, exports, __webpack_require__) {
  10411. var closest = __webpack_require__(223);
  10412. /**
  10413. * Delegates event to a selector.
  10414. *
  10415. * @param {Element} element
  10416. * @param {String} selector
  10417. * @param {String} type
  10418. * @param {Function} callback
  10419. * @param {Boolean} useCapture
  10420. * @return {Object}
  10421. */
  10422. function delegate(element, selector, type, callback, useCapture) {
  10423. var listenerFn = listener.apply(this, arguments);
  10424. element.addEventListener(type, listenerFn, useCapture);
  10425. return {
  10426. destroy: function() {
  10427. element.removeEventListener(type, listenerFn, useCapture);
  10428. }
  10429. }
  10430. }
  10431. /**
  10432. * Finds closest match and invokes callback.
  10433. *
  10434. * @param {Element} element
  10435. * @param {String} selector
  10436. * @param {String} type
  10437. * @param {Function} callback
  10438. * @return {Function}
  10439. */
  10440. function listener(element, selector, type, callback) {
  10441. return function(e) {
  10442. e.delegateTarget = closest(e.target, selector);
  10443. if (e.delegateTarget) {
  10444. callback.call(element, e);
  10445. }
  10446. }
  10447. }
  10448. module.exports = delegate;
  10449. /***/ },
  10450. /* 225 */,
  10451. /* 226 */,
  10452. /* 227 */,
  10453. /* 228 */,
  10454. /* 229 */,
  10455. /* 230 */,
  10456. /* 231 */,
  10457. /* 232 */,
  10458. /* 233 */,
  10459. /* 234 */,
  10460. /* 235 */,
  10461. /* 236 */,
  10462. /* 237 */,
  10463. /* 238 */,
  10464. /* 239 */,
  10465. /* 240 */,
  10466. /* 241 */,
  10467. /* 242 */,
  10468. /* 243 */,
  10469. /* 244 */,
  10470. /* 245 */,
  10471. /* 246 */
  10472. /***/ function(module, exports) {
  10473. /**
  10474. * Check if argument is a HTML element.
  10475. *
  10476. * @param {Object} value
  10477. * @return {Boolean}
  10478. */
  10479. exports.node = function(value) {
  10480. return value !== undefined
  10481. && value instanceof HTMLElement
  10482. && value.nodeType === 1;
  10483. };
  10484. /**
  10485. * Check if argument is a list of HTML elements.
  10486. *
  10487. * @param {Object} value
  10488. * @return {Boolean}
  10489. */
  10490. exports.nodeList = function(value) {
  10491. var type = Object.prototype.toString.call(value);
  10492. return value !== undefined
  10493. && (type === '[object NodeList]' || type === '[object HTMLCollection]')
  10494. && ('length' in value)
  10495. && (value.length === 0 || exports.node(value[0]));
  10496. };
  10497. /**
  10498. * Check if argument is a string.
  10499. *
  10500. * @param {Object} value
  10501. * @return {Boolean}
  10502. */
  10503. exports.string = function(value) {
  10504. return typeof value === 'string'
  10505. || value instanceof String;
  10506. };
  10507. /**
  10508. * Check if argument is a function.
  10509. *
  10510. * @param {Object} value
  10511. * @return {Boolean}
  10512. */
  10513. exports.fn = function(value) {
  10514. var type = Object.prototype.toString.call(value);
  10515. return type === '[object Function]';
  10516. };
  10517. /***/ },
  10518. /* 247 */
  10519. /***/ function(module, exports, __webpack_require__) {
  10520. var is = __webpack_require__(246);
  10521. var delegate = __webpack_require__(224);
  10522. /**
  10523. * Validates all params and calls the right
  10524. * listener function based on its target type.
  10525. *
  10526. * @param {String|HTMLElement|HTMLCollection|NodeList} target
  10527. * @param {String} type
  10528. * @param {Function} callback
  10529. * @return {Object}
  10530. */
  10531. function listen(target, type, callback) {
  10532. if (!target && !type && !callback) {
  10533. throw new Error('Missing required arguments');
  10534. }
  10535. if (!is.string(type)) {
  10536. throw new TypeError('Second argument must be a String');
  10537. }
  10538. if (!is.fn(callback)) {
  10539. throw new TypeError('Third argument must be a Function');
  10540. }
  10541. if (is.node(target)) {
  10542. return listenNode(target, type, callback);
  10543. }
  10544. else if (is.nodeList(target)) {
  10545. return listenNodeList(target, type, callback);
  10546. }
  10547. else if (is.string(target)) {
  10548. return listenSelector(target, type, callback);
  10549. }
  10550. else {
  10551. throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
  10552. }
  10553. }
  10554. /**
  10555. * Adds an event listener to a HTML element
  10556. * and returns a remove listener function.
  10557. *
  10558. * @param {HTMLElement} node
  10559. * @param {String} type
  10560. * @param {Function} callback
  10561. * @return {Object}
  10562. */
  10563. function listenNode(node, type, callback) {
  10564. node.addEventListener(type, callback);
  10565. return {
  10566. destroy: function() {
  10567. node.removeEventListener(type, callback);
  10568. }
  10569. }
  10570. }
  10571. /**
  10572. * Add an event listener to a list of HTML elements
  10573. * and returns a remove listener function.
  10574. *
  10575. * @param {NodeList|HTMLCollection} nodeList
  10576. * @param {String} type
  10577. * @param {Function} callback
  10578. * @return {Object}
  10579. */
  10580. function listenNodeList(nodeList, type, callback) {
  10581. Array.prototype.forEach.call(nodeList, function(node) {
  10582. node.addEventListener(type, callback);
  10583. });
  10584. return {
  10585. destroy: function() {
  10586. Array.prototype.forEach.call(nodeList, function(node) {
  10587. node.removeEventListener(type, callback);
  10588. });
  10589. }
  10590. }
  10591. }
  10592. /**
  10593. * Add an event listener to a selector
  10594. * and returns a remove listener function.
  10595. *
  10596. * @param {String} selector
  10597. * @param {String} type
  10598. * @param {Function} callback
  10599. * @return {Object}
  10600. */
  10601. function listenSelector(selector, type, callback) {
  10602. return delegate(document.body, selector, type, callback);
  10603. }
  10604. module.exports = listen;
  10605. /***/ },
  10606. /* 248 */,
  10607. /* 249 */,
  10608. /* 250 */,
  10609. /* 251 */,
  10610. /* 252 */,
  10611. /* 253 */,
  10612. /* 254 */,
  10613. /* 255 */,
  10614. /* 256 */,
  10615. /* 257 */,
  10616. /* 258 */
  10617. /***/ function(module, exports) {
  10618. /**
  10619. * The code was extracted from:
  10620. * https://github.com/davidchambers/Base64.js
  10621. */
  10622. var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  10623. function InvalidCharacterError(message) {
  10624. this.message = message;
  10625. }
  10626. InvalidCharacterError.prototype = new Error();
  10627. InvalidCharacterError.prototype.name = 'InvalidCharacterError';
  10628. function polyfill (input) {
  10629. var str = String(input).replace(/=+$/, '');
  10630. if (str.length % 4 == 1) {
  10631. throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");
  10632. }
  10633. for (
  10634. // initialize result and counters
  10635. var bc = 0, bs, buffer, idx = 0, output = '';
  10636. // get next character
  10637. buffer = str.charAt(idx++);
  10638. // character found in table? initialize bit storage and add its ascii value;
  10639. ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
  10640. // and if not first of each 4 characters,
  10641. // convert the first 8 bits to one ascii character
  10642. bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
  10643. ) {
  10644. // try to find character in table (0-63, not found => -1)
  10645. buffer = chars.indexOf(buffer);
  10646. }
  10647. return output;
  10648. }
  10649. module.exports = typeof window !== 'undefined' && window.atob && window.atob.bind(window) || polyfill;
  10650. /***/ },
  10651. /* 259 */
  10652. /***/ function(module, exports, __webpack_require__) {
  10653. var atob = __webpack_require__(258);
  10654. function b64DecodeUnicode(str) {
  10655. return decodeURIComponent(atob(str).replace(/(.)/g, function (m, p) {
  10656. var code = p.charCodeAt(0).toString(16).toUpperCase();
  10657. if (code.length < 2) {
  10658. code = '0' + code;
  10659. }
  10660. return '%' + code;
  10661. }));
  10662. }
  10663. module.exports = function(str) {
  10664. var output = str.replace(/-/g, "+").replace(/_/g, "/");
  10665. switch (output.length % 4) {
  10666. case 0:
  10667. break;
  10668. case 2:
  10669. output += "==";
  10670. break;
  10671. case 3:
  10672. output += "=";
  10673. break;
  10674. default:
  10675. throw "Illegal base64url string!";
  10676. }
  10677. try{
  10678. return b64DecodeUnicode(output);
  10679. } catch (err) {
  10680. return atob(output);
  10681. }
  10682. };
  10683. /***/ },
  10684. /* 260 */
  10685. /***/ function(module, exports, __webpack_require__) {
  10686. "use strict";
  10687. 'use strict';
  10688. var base64_url_decode = __webpack_require__(259);
  10689. module.exports = function (token,options) {
  10690. if (typeof token !== 'string') {
  10691. throw new Error('Invalid token specified');
  10692. }
  10693. options = options || {};
  10694. var pos = options.header === true ? 0 : 1;
  10695. return JSON.parse(base64_url_decode(token.split('.')[pos]));
  10696. };
  10697. /***/ },
  10698. /* 261 */
  10699. /***/ function(module, exports, __webpack_require__) {
  10700. /* WEBPACK VAR INJECTION */(function(global) {/**
  10701. * lodash (Custom Build) <https://lodash.com/>
  10702. * Build: `lodash modularize exports="npm" -o ./`
  10703. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  10704. * Released under MIT license <https://lodash.com/license>
  10705. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  10706. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  10707. */
  10708. /** Used as the `TypeError` message for "Functions" methods. */
  10709. var FUNC_ERROR_TEXT = 'Expected a function';
  10710. /** Used as references for various `Number` constants. */
  10711. var NAN = 0 / 0;
  10712. /** `Object#toString` result references. */
  10713. var symbolTag = '[object Symbol]';
  10714. /** Used to match leading and trailing whitespace. */
  10715. var reTrim = /^\s+|\s+$/g;
  10716. /** Used to detect bad signed hexadecimal string values. */
  10717. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  10718. /** Used to detect binary string values. */
  10719. var reIsBinary = /^0b[01]+$/i;
  10720. /** Used to detect octal string values. */
  10721. var reIsOctal = /^0o[0-7]+$/i;
  10722. /** Built-in method references without a dependency on `root`. */
  10723. var freeParseInt = parseInt;
  10724. /** Detect free variable `global` from Node.js. */
  10725. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  10726. /** Detect free variable `self`. */
  10727. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  10728. /** Used as a reference to the global object. */
  10729. var root = freeGlobal || freeSelf || Function('return this')();
  10730. /** Used for built-in method references. */
  10731. var objectProto = Object.prototype;
  10732. /**
  10733. * Used to resolve the
  10734. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  10735. * of values.
  10736. */
  10737. var objectToString = objectProto.toString;
  10738. /* Built-in method references for those with the same name as other `lodash` methods. */
  10739. var nativeMax = Math.max,
  10740. nativeMin = Math.min;
  10741. /**
  10742. * Gets the timestamp of the number of milliseconds that have elapsed since
  10743. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10744. *
  10745. * @static
  10746. * @memberOf _
  10747. * @since 2.4.0
  10748. * @category Date
  10749. * @returns {number} Returns the timestamp.
  10750. * @example
  10751. *
  10752. * _.defer(function(stamp) {
  10753. * console.log(_.now() - stamp);
  10754. * }, _.now());
  10755. * // => Logs the number of milliseconds it took for the deferred invocation.
  10756. */
  10757. var now = function() {
  10758. return root.Date.now();
  10759. };
  10760. /**
  10761. * Creates a debounced function that delays invoking `func` until after `wait`
  10762. * milliseconds have elapsed since the last time the debounced function was
  10763. * invoked. The debounced function comes with a `cancel` method to cancel
  10764. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10765. * Provide `options` to indicate whether `func` should be invoked on the
  10766. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10767. * with the last arguments provided to the debounced function. Subsequent
  10768. * calls to the debounced function return the result of the last `func`
  10769. * invocation.
  10770. *
  10771. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10772. * invoked on the trailing edge of the timeout only if the debounced function
  10773. * is invoked more than once during the `wait` timeout.
  10774. *
  10775. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10776. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10777. *
  10778. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10779. * for details over the differences between `_.debounce` and `_.throttle`.
  10780. *
  10781. * @static
  10782. * @memberOf _
  10783. * @since 0.1.0
  10784. * @category Function
  10785. * @param {Function} func The function to debounce.
  10786. * @param {number} [wait=0] The number of milliseconds to delay.
  10787. * @param {Object} [options={}] The options object.
  10788. * @param {boolean} [options.leading=false]
  10789. * Specify invoking on the leading edge of the timeout.
  10790. * @param {number} [options.maxWait]
  10791. * The maximum time `func` is allowed to be delayed before it's invoked.
  10792. * @param {boolean} [options.trailing=true]
  10793. * Specify invoking on the trailing edge of the timeout.
  10794. * @returns {Function} Returns the new debounced function.
  10795. * @example
  10796. *
  10797. * // Avoid costly calculations while the window size is in flux.
  10798. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10799. *
  10800. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10801. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10802. * 'leading': true,
  10803. * 'trailing': false
  10804. * }));
  10805. *
  10806. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10807. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10808. * var source = new EventSource('/stream');
  10809. * jQuery(source).on('message', debounced);
  10810. *
  10811. * // Cancel the trailing debounced invocation.
  10812. * jQuery(window).on('popstate', debounced.cancel);
  10813. */
  10814. function debounce(func, wait, options) {
  10815. var lastArgs,
  10816. lastThis,
  10817. maxWait,
  10818. result,
  10819. timerId,
  10820. lastCallTime,
  10821. lastInvokeTime = 0,
  10822. leading = false,
  10823. maxing = false,
  10824. trailing = true;
  10825. if (typeof func != 'function') {
  10826. throw new TypeError(FUNC_ERROR_TEXT);
  10827. }
  10828. wait = toNumber(wait) || 0;
  10829. if (isObject(options)) {
  10830. leading = !!options.leading;
  10831. maxing = 'maxWait' in options;
  10832. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10833. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10834. }
  10835. function invokeFunc(time) {
  10836. var args = lastArgs,
  10837. thisArg = lastThis;
  10838. lastArgs = lastThis = undefined;
  10839. lastInvokeTime = time;
  10840. result = func.apply(thisArg, args);
  10841. return result;
  10842. }
  10843. function leadingEdge(time) {
  10844. // Reset any `maxWait` timer.
  10845. lastInvokeTime = time;
  10846. // Start the timer for the trailing edge.
  10847. timerId = setTimeout(timerExpired, wait);
  10848. // Invoke the leading edge.
  10849. return leading ? invokeFunc(time) : result;
  10850. }
  10851. function remainingWait(time) {
  10852. var timeSinceLastCall = time - lastCallTime,
  10853. timeSinceLastInvoke = time - lastInvokeTime,
  10854. result = wait - timeSinceLastCall;
  10855. return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
  10856. }
  10857. function shouldInvoke(time) {
  10858. var timeSinceLastCall = time - lastCallTime,
  10859. timeSinceLastInvoke = time - lastInvokeTime;
  10860. // Either this is the first call, activity has stopped and we're at the
  10861. // trailing edge, the system time has gone backwards and we're treating
  10862. // it as the trailing edge, or we've hit the `maxWait` limit.
  10863. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10864. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10865. }
  10866. function timerExpired() {
  10867. var time = now();
  10868. if (shouldInvoke(time)) {
  10869. return trailingEdge(time);
  10870. }
  10871. // Restart the timer.
  10872. timerId = setTimeout(timerExpired, remainingWait(time));
  10873. }
  10874. function trailingEdge(time) {
  10875. timerId = undefined;
  10876. // Only invoke if we have `lastArgs` which means `func` has been
  10877. // debounced at least once.
  10878. if (trailing && lastArgs) {
  10879. return invokeFunc(time);
  10880. }
  10881. lastArgs = lastThis = undefined;
  10882. return result;
  10883. }
  10884. function cancel() {
  10885. if (timerId !== undefined) {
  10886. clearTimeout(timerId);
  10887. }
  10888. lastInvokeTime = 0;
  10889. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10890. }
  10891. function flush() {
  10892. return timerId === undefined ? result : trailingEdge(now());
  10893. }
  10894. function debounced() {
  10895. var time = now(),
  10896. isInvoking = shouldInvoke(time);
  10897. lastArgs = arguments;
  10898. lastThis = this;
  10899. lastCallTime = time;
  10900. if (isInvoking) {
  10901. if (timerId === undefined) {
  10902. return leadingEdge(lastCallTime);
  10903. }
  10904. if (maxing) {
  10905. // Handle invocations in a tight loop.
  10906. timerId = setTimeout(timerExpired, wait);
  10907. return invokeFunc(lastCallTime);
  10908. }
  10909. }
  10910. if (timerId === undefined) {
  10911. timerId = setTimeout(timerExpired, wait);
  10912. }
  10913. return result;
  10914. }
  10915. debounced.cancel = cancel;
  10916. debounced.flush = flush;
  10917. return debounced;
  10918. }
  10919. /**
  10920. * Checks if `value` is the
  10921. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  10922. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  10923. *
  10924. * @static
  10925. * @memberOf _
  10926. * @since 0.1.0
  10927. * @category Lang
  10928. * @param {*} value The value to check.
  10929. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  10930. * @example
  10931. *
  10932. * _.isObject({});
  10933. * // => true
  10934. *
  10935. * _.isObject([1, 2, 3]);
  10936. * // => true
  10937. *
  10938. * _.isObject(_.noop);
  10939. * // => true
  10940. *
  10941. * _.isObject(null);
  10942. * // => false
  10943. */
  10944. function isObject(value) {
  10945. var type = typeof value;
  10946. return !!value && (type == 'object' || type == 'function');
  10947. }
  10948. /**
  10949. * Checks if `value` is object-like. A value is object-like if it's not `null`
  10950. * and has a `typeof` result of "object".
  10951. *
  10952. * @static
  10953. * @memberOf _
  10954. * @since 4.0.0
  10955. * @category Lang
  10956. * @param {*} value The value to check.
  10957. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  10958. * @example
  10959. *
  10960. * _.isObjectLike({});
  10961. * // => true
  10962. *
  10963. * _.isObjectLike([1, 2, 3]);
  10964. * // => true
  10965. *
  10966. * _.isObjectLike(_.noop);
  10967. * // => false
  10968. *
  10969. * _.isObjectLike(null);
  10970. * // => false
  10971. */
  10972. function isObjectLike(value) {
  10973. return !!value && typeof value == 'object';
  10974. }
  10975. /**
  10976. * Checks if `value` is classified as a `Symbol` primitive or object.
  10977. *
  10978. * @static
  10979. * @memberOf _
  10980. * @since 4.0.0
  10981. * @category Lang
  10982. * @param {*} value The value to check.
  10983. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  10984. * @example
  10985. *
  10986. * _.isSymbol(Symbol.iterator);
  10987. * // => true
  10988. *
  10989. * _.isSymbol('abc');
  10990. * // => false
  10991. */
  10992. function isSymbol(value) {
  10993. return typeof value == 'symbol' ||
  10994. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  10995. }
  10996. /**
  10997. * Converts `value` to a number.
  10998. *
  10999. * @static
  11000. * @memberOf _
  11001. * @since 4.0.0
  11002. * @category Lang
  11003. * @param {*} value The value to process.
  11004. * @returns {number} Returns the number.
  11005. * @example
  11006. *
  11007. * _.toNumber(3.2);
  11008. * // => 3.2
  11009. *
  11010. * _.toNumber(Number.MIN_VALUE);
  11011. * // => 5e-324
  11012. *
  11013. * _.toNumber(Infinity);
  11014. * // => Infinity
  11015. *
  11016. * _.toNumber('3.2');
  11017. * // => 3.2
  11018. */
  11019. function toNumber(value) {
  11020. if (typeof value == 'number') {
  11021. return value;
  11022. }
  11023. if (isSymbol(value)) {
  11024. return NAN;
  11025. }
  11026. if (isObject(value)) {
  11027. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  11028. value = isObject(other) ? (other + '') : other;
  11029. }
  11030. if (typeof value != 'string') {
  11031. return value === 0 ? value : +value;
  11032. }
  11033. value = value.replace(reTrim, '');
  11034. var isBinary = reIsBinary.test(value);
  11035. return (isBinary || reIsOctal.test(value))
  11036. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  11037. : (reIsBadHex.test(value) ? NAN : +value);
  11038. }
  11039. module.exports = debounce;
  11040. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))
  11041. /***/ },
  11042. /* 262 */,
  11043. /* 263 */,
  11044. /* 264 */,
  11045. /* 265 */,
  11046. /* 266 */,
  11047. /* 267 */,
  11048. /* 268 */,
  11049. /* 269 */,
  11050. /* 270 */,
  11051. /* 271 */,
  11052. /* 272 */,
  11053. /* 273 */,
  11054. /* 274 */,
  11055. /* 275 */
  11056. /***/ function(module, exports) {
  11057. function select(element) {
  11058. var selectedText;
  11059. if (element.nodeName === 'SELECT') {
  11060. element.focus();
  11061. selectedText = element.value;
  11062. }
  11063. else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
  11064. element.focus();
  11065. element.setSelectionRange(0, element.value.length);
  11066. selectedText = element.value;
  11067. }
  11068. else {
  11069. if (element.hasAttribute('contenteditable')) {
  11070. element.focus();
  11071. }
  11072. var selection = window.getSelection();
  11073. var range = document.createRange();
  11074. range.selectNodeContents(element);
  11075. selection.removeAllRanges();
  11076. selection.addRange(range);
  11077. selectedText = selection.toString();
  11078. }
  11079. return selectedText;
  11080. }
  11081. module.exports = select;
  11082. /***/ },
  11083. /* 276 */,
  11084. /* 277 */,
  11085. /* 278 */,
  11086. /* 279 */,
  11087. /* 280 */,
  11088. /* 281 */
  11089. /***/ function(module, exports) {
  11090. function E () {
  11091. // Keep this empty so it's easier to inherit from
  11092. // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
  11093. }
  11094. E.prototype = {
  11095. on: function (name, callback, ctx) {
  11096. var e = this.e || (this.e = {});
  11097. (e[name] || (e[name] = [])).push({
  11098. fn: callback,
  11099. ctx: ctx
  11100. });
  11101. return this;
  11102. },
  11103. once: function (name, callback, ctx) {
  11104. var self = this;
  11105. function listener () {
  11106. self.off(name, listener);
  11107. callback.apply(ctx, arguments);
  11108. };
  11109. listener._ = callback
  11110. return this.on(name, listener, ctx);
  11111. },
  11112. emit: function (name) {
  11113. var data = [].slice.call(arguments, 1);
  11114. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  11115. var i = 0;
  11116. var len = evtArr.length;
  11117. for (i; i < len; i++) {
  11118. evtArr[i].fn.apply(evtArr[i].ctx, data);
  11119. }
  11120. return this;
  11121. },
  11122. off: function (name, callback) {
  11123. var e = this.e || (this.e = {});
  11124. var evts = e[name];
  11125. var liveEvents = [];
  11126. if (evts && callback) {
  11127. for (var i = 0, len = evts.length; i < len; i++) {
  11128. if (evts[i].fn !== callback && evts[i].fn._ !== callback)
  11129. liveEvents.push(evts[i]);
  11130. }
  11131. }
  11132. // Remove event from queue to prevent memory leak
  11133. // Suggested by https://github.com/lazd
  11134. // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
  11135. (liveEvents.length)
  11136. ? e[name] = liveEvents
  11137. : delete e[name];
  11138. return this;
  11139. }
  11140. };
  11141. module.exports = E;
  11142. /***/ },
  11143. /* 282 */,
  11144. /* 283 */,
  11145. /* 284 */
  11146. /***/ function(module, exports, __webpack_require__) {
  11147. var __vue_exports__, __vue_options__
  11148. /* styles */
  11149. __webpack_require__(308)
  11150. /* script */
  11151. __vue_exports__ = __webpack_require__(151)
  11152. /* template */
  11153. var __vue_template__ = __webpack_require__(300)
  11154. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  11155. if (
  11156. typeof __vue_exports__.default === "object" ||
  11157. typeof __vue_exports__.default === "function"
  11158. ) {
  11159. __vue_options__ = __vue_exports__ = __vue_exports__.default
  11160. }
  11161. if (typeof __vue_options__ === "function") {
  11162. __vue_options__ = __vue_options__.options
  11163. }
  11164. __vue_options__.render = __vue_template__.render
  11165. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  11166. module.exports = __vue_exports__
  11167. /***/ },
  11168. /* 285 */
  11169. /***/ function(module, exports, __webpack_require__) {
  11170. var __vue_exports__, __vue_options__
  11171. /* styles */
  11172. __webpack_require__(304)
  11173. /* script */
  11174. __vue_exports__ = __webpack_require__(152)
  11175. /* template */
  11176. var __vue_template__ = __webpack_require__(295)
  11177. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  11178. if (
  11179. typeof __vue_exports__.default === "object" ||
  11180. typeof __vue_exports__.default === "function"
  11181. ) {
  11182. __vue_options__ = __vue_exports__ = __vue_exports__.default
  11183. }
  11184. if (typeof __vue_options__ === "function") {
  11185. __vue_options__ = __vue_options__.options
  11186. }
  11187. __vue_options__.render = __vue_template__.render
  11188. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  11189. module.exports = __vue_exports__
  11190. /***/ },
  11191. /* 286 */
  11192. /***/ function(module, exports, __webpack_require__) {
  11193. var __vue_exports__, __vue_options__
  11194. /* styles */
  11195. __webpack_require__(309)
  11196. /* script */
  11197. __vue_exports__ = __webpack_require__(153)
  11198. /* template */
  11199. var __vue_template__ = __webpack_require__(302)
  11200. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  11201. if (
  11202. typeof __vue_exports__.default === "object" ||
  11203. typeof __vue_exports__.default === "function"
  11204. ) {
  11205. __vue_options__ = __vue_exports__ = __vue_exports__.default
  11206. }
  11207. if (typeof __vue_options__ === "function") {
  11208. __vue_options__ = __vue_options__.options
  11209. }
  11210. __vue_options__.render = __vue_template__.render
  11211. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  11212. module.exports = __vue_exports__
  11213. /***/ },
  11214. /* 287 */
  11215. /***/ function(module, exports, __webpack_require__) {
  11216. var __vue_exports__, __vue_options__
  11217. /* template */
  11218. var __vue_template__ = __webpack_require__(293)
  11219. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  11220. if (
  11221. typeof __vue_exports__.default === "object" ||
  11222. typeof __vue_exports__.default === "function"
  11223. ) {
  11224. __vue_options__ = __vue_exports__ = __vue_exports__.default
  11225. }
  11226. if (typeof __vue_options__ === "function") {
  11227. __vue_options__ = __vue_options__.options
  11228. }
  11229. __vue_options__.render = __vue_template__.render
  11230. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  11231. module.exports = __vue_exports__
  11232. /***/ },
  11233. /* 288 */
  11234. /***/ function(module, exports, __webpack_require__) {
  11235. var __vue_exports__, __vue_options__
  11236. /* script */
  11237. __vue_exports__ = __webpack_require__(154)
  11238. /* template */
  11239. var __vue_template__ = __webpack_require__(294)
  11240. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  11241. if (
  11242. typeof __vue_exports__.default === "object" ||
  11243. typeof __vue_exports__.default === "function"
  11244. ) {
  11245. __vue_options__ = __vue_exports__ = __vue_exports__.default
  11246. }
  11247. if (typeof __vue_options__ === "function") {
  11248. __vue_options__ = __vue_options__.options
  11249. }
  11250. __vue_options__.render = __vue_template__.render
  11251. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  11252. module.exports = __vue_exports__
  11253. /***/ },
  11254. /* 289 */
  11255. /***/ function(module, exports, __webpack_require__) {
  11256. var __vue_exports__, __vue_options__
  11257. /* styles */
  11258. __webpack_require__(306)
  11259. /* script */
  11260. __vue_exports__ = __webpack_require__(155)
  11261. /* template */
  11262. var __vue_template__ = __webpack_require__(297)
  11263. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  11264. if (
  11265. typeof __vue_exports__.default === "object" ||
  11266. typeof __vue_exports__.default === "function"
  11267. ) {
  11268. __vue_options__ = __vue_exports__ = __vue_exports__.default
  11269. }
  11270. if (typeof __vue_options__ === "function") {
  11271. __vue_options__ = __vue_options__.options
  11272. }
  11273. __vue_options__.render = __vue_template__.render
  11274. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  11275. module.exports = __vue_exports__
  11276. /***/ },
  11277. /* 290 */
  11278. /***/ function(module, exports, __webpack_require__) {
  11279. var __vue_exports__, __vue_options__
  11280. /* script */
  11281. __vue_exports__ = __webpack_require__(156)
  11282. /* template */
  11283. var __vue_template__ = __webpack_require__(299)
  11284. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  11285. if (
  11286. typeof __vue_exports__.default === "object" ||
  11287. typeof __vue_exports__.default === "function"
  11288. ) {
  11289. __vue_options__ = __vue_exports__ = __vue_exports__.default
  11290. }
  11291. if (typeof __vue_options__ === "function") {
  11292. __vue_options__ = __vue_options__.options
  11293. }
  11294. __vue_options__.render = __vue_template__.render
  11295. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  11296. module.exports = __vue_exports__
  11297. /***/ },
  11298. /* 291 */
  11299. /***/ function(module, exports, __webpack_require__) {
  11300. var __vue_exports__, __vue_options__
  11301. /* script */
  11302. __vue_exports__ = __webpack_require__(157)
  11303. /* template */
  11304. var __vue_template__ = __webpack_require__(301)
  11305. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  11306. if (
  11307. typeof __vue_exports__.default === "object" ||
  11308. typeof __vue_exports__.default === "function"
  11309. ) {
  11310. __vue_options__ = __vue_exports__ = __vue_exports__.default
  11311. }
  11312. if (typeof __vue_options__ === "function") {
  11313. __vue_options__ = __vue_options__.options
  11314. }
  11315. __vue_options__.render = __vue_template__.render
  11316. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  11317. module.exports = __vue_exports__
  11318. /***/ },
  11319. /* 292 */
  11320. /***/ function(module, exports, __webpack_require__) {
  11321. var __vue_exports__, __vue_options__
  11322. /* styles */
  11323. __webpack_require__(305)
  11324. /* script */
  11325. __vue_exports__ = __webpack_require__(158)
  11326. /* template */
  11327. var __vue_template__ = __webpack_require__(296)
  11328. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  11329. if (
  11330. typeof __vue_exports__.default === "object" ||
  11331. typeof __vue_exports__.default === "function"
  11332. ) {
  11333. __vue_options__ = __vue_exports__ = __vue_exports__.default
  11334. }
  11335. if (typeof __vue_options__ === "function") {
  11336. __vue_options__ = __vue_options__.options
  11337. }
  11338. __vue_options__.render = __vue_template__.render
  11339. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  11340. module.exports = __vue_exports__
  11341. /***/ },
  11342. /* 293 */
  11343. /***/ function(module, exports) {
  11344. module.exports={render:function (){with(this) {
  11345. return _m(0)
  11346. }},staticRenderFns: [function (){with(this) {
  11347. return _h('div', {
  11348. attrs: {
  11349. "style": "display: none;"
  11350. }
  11351. }, [_h('label', {
  11352. attrs: {
  11353. "for": "username"
  11354. }
  11355. }, [_h('input', {
  11356. attrs: {
  11357. "type": "text",
  11358. "id": "username",
  11359. "name": "username",
  11360. "autocomplete": "username"
  11361. }
  11362. })]), " ", _h('label', {
  11363. attrs: {
  11364. "for": "password"
  11365. }
  11366. }, [_h('input', {
  11367. attrs: {
  11368. "type": "password",
  11369. "id": "password",
  11370. "name": "password",
  11371. "autocomplete": "current-password"
  11372. }
  11373. })])])
  11374. }}]}
  11375. /***/ },
  11376. /* 294 */
  11377. /***/ function(module, exports) {
  11378. module.exports={render:function (){with(this) {
  11379. return _h('form', [(showError) ? _h('div', {
  11380. staticClass: "form-group row"
  11381. }, [_h('div', {
  11382. staticClass: "col-xs-12 text-muted text-danger"
  11383. }, ["\n " + _s(errorMessage) + "\n "])]) : _e(), " ", _h('div', {
  11384. staticClass: "form-group row"
  11385. }, [_h('div', {
  11386. staticClass: "col-xs-12"
  11387. }, [_h('div', {
  11388. staticClass: "inner-addon left-addon"
  11389. }, [_m(0), " ", _h('input', {
  11390. directives: [{
  11391. name: "model",
  11392. rawName: "v-model",
  11393. value: (email),
  11394. expression: "email"
  11395. }],
  11396. staticClass: "form-control",
  11397. attrs: {
  11398. "id": "email",
  11399. "name": "login",
  11400. "type": "email",
  11401. "placeholder": "Email",
  11402. "required": ""
  11403. },
  11404. domProps: {
  11405. "value": _s(email)
  11406. },
  11407. on: {
  11408. "input": function($event) {
  11409. if ($event.target.composing) return;
  11410. email = $event.target.value
  11411. }
  11412. }
  11413. }), " ", _h('small', {
  11414. staticClass: "form-text text-muted text-danger"
  11415. }, [(errors.userNameAlreadyExist) ? _h('span', ["Someone already use that username. Do you want to sign in ?"]) : _e(), " ", (errors.emailRequired) ? _h('span', ["An email is required"]) : _e()])])])]), " ", _h('div', {
  11416. staticClass: "form-group row"
  11417. }, [_h('div', {
  11418. staticClass: "col-xs-12"
  11419. }, [_h('div', {
  11420. staticClass: "inner-addon left-addon"
  11421. }, [_m(1), " ", _h('input', {
  11422. directives: [{
  11423. name: "model",
  11424. rawName: "v-model",
  11425. value: (password),
  11426. expression: "password"
  11427. }],
  11428. staticClass: "form-control",
  11429. attrs: {
  11430. "id": "password",
  11431. "name": "password",
  11432. "type": "password",
  11433. "required": "",
  11434. "placeholder": "LessPass password"
  11435. },
  11436. domProps: {
  11437. "value": _s(password)
  11438. },
  11439. on: {
  11440. "input": function($event) {
  11441. if ($event.target.composing) return;
  11442. password = $event.target.value
  11443. }
  11444. }
  11445. }), " ", _h('small', {
  11446. staticClass: "form-text text-muted"
  11447. }, [(noErrors()) ? _h('span', {
  11448. staticClass: "text-warning"
  11449. }, ["Do not use your master password here"]) : _e(), " ", (errors.passwordRequired) ? _h('span', {
  11450. staticClass: "text-danger"
  11451. }, ["A password is required"]) : _e()])])])]), " ", _h('div', {
  11452. staticClass: "form-group row"
  11453. }, [_h('div', {
  11454. staticClass: "col-xs-12 hint--bottom",
  11455. attrs: {
  11456. "aria-label": "You can use your self hosted LessPass Database"
  11457. }
  11458. }, [_h('div', {
  11459. staticClass: "inner-addon left-addon"
  11460. }, [_m(2), " ", _h('input', {
  11461. directives: [{
  11462. name: "model",
  11463. rawName: "v-model",
  11464. value: (baseURL),
  11465. expression: "baseURL"
  11466. }],
  11467. staticClass: "form-control",
  11468. attrs: {
  11469. "id": "baseURL",
  11470. "type": "text",
  11471. "placeholder": "LessPass Database (https://...)"
  11472. },
  11473. domProps: {
  11474. "value": _s(baseURL)
  11475. },
  11476. on: {
  11477. "input": function($event) {
  11478. if ($event.target.composing) return;
  11479. baseURL = $event.target.value
  11480. }
  11481. }
  11482. }), " ", _h('small', {
  11483. staticClass: "form-text text-muted"
  11484. }, [(noErrors()) ? _h('span', ["You can use your self hosted LessPass Database"]) : _e(), " ", (errors.baseURLRequired) ? _h('span', {
  11485. staticClass: "text-danger"
  11486. }, ["\n A LessPass database url is required\n "]) : _e()])])])]), " ", _h('div', {
  11487. staticClass: "form-group row"
  11488. }, [_h('div', {
  11489. staticClass: "col-xs-12"
  11490. }, [_h('button', {
  11491. staticClass: "btn btn-primary",
  11492. attrs: {
  11493. "id": "signInButton",
  11494. "type": "button"
  11495. },
  11496. on: {
  11497. "click": signIn
  11498. }
  11499. }, [(loadingSignIn) ? _h('span', [_m(3)]) : _e(), "\n Sign In\n "]), " ", _h('button', {
  11500. staticClass: "btn btn-secondary",
  11501. attrs: {
  11502. "id": "registerButton",
  11503. "type": "button"
  11504. },
  11505. on: {
  11506. "click": register
  11507. }
  11508. }, [(loadingRegister) ? _h('span', [_m(4)]) : _e(), "\n Register\n "])])]), " ", _h('div', {
  11509. staticClass: "form-group row"
  11510. }, [_h('div', {
  11511. staticClass: "col-xs-12"
  11512. }, [_h('router-link', {
  11513. attrs: {
  11514. "to": {
  11515. name: 'passwordReset'
  11516. }
  11517. }
  11518. }, ["\n Forgot you password ?\n "])])])])
  11519. }},staticRenderFns: [function (){with(this) {
  11520. return _h('i', {
  11521. staticClass: "fa fa-user"
  11522. })
  11523. }},function (){with(this) {
  11524. return _h('i', {
  11525. staticClass: "fa fa-lock"
  11526. })
  11527. }},function (){with(this) {
  11528. return _h('i', {
  11529. staticClass: "fa fa-globe"
  11530. })
  11531. }},function (){with(this) {
  11532. return _h('i', {
  11533. staticClass: "fa fa-spinner fa-pulse fa-fw"
  11534. })
  11535. }},function (){with(this) {
  11536. return _h('i', {
  11537. staticClass: "fa fa-spinner fa-pulse fa-fw"
  11538. })
  11539. }}]}
  11540. /***/ },
  11541. /* 295 */
  11542. /***/ function(module, exports) {
  11543. module.exports={render:function (){with(this) {
  11544. return (fingerprint) ? _h('span', {
  11545. staticClass: "input-group-btn"
  11546. }, [_h('button', {
  11547. staticClass: "btn",
  11548. attrs: {
  11549. "id": "fingerprint",
  11550. "type": "button",
  11551. "tabindex": "-1"
  11552. }
  11553. }, [_h('small', {
  11554. staticClass: "hint--left",
  11555. attrs: {
  11556. "aria-label": "master password fingerprint"
  11557. }
  11558. }, [_h('i', {
  11559. staticClass: "fa fa-fw",
  11560. class: [icon1],
  11561. style: ({
  11562. color: color1
  11563. })
  11564. }), " ", _h('i', {
  11565. staticClass: "fa fa-fw",
  11566. class: [icon2],
  11567. style: ({
  11568. color: color2
  11569. })
  11570. }), " ", _h('i', {
  11571. staticClass: "fa fa-fw",
  11572. class: [icon3],
  11573. style: ({
  11574. color: color3
  11575. })
  11576. })])])]) : _e()
  11577. }},staticRenderFns: []}
  11578. /***/ },
  11579. /* 296 */
  11580. /***/ function(module, exports) {
  11581. module.exports={render:function (){with(this) {
  11582. return _h('div', [_h('form', [_h('div', {
  11583. staticClass: "form-group row"
  11584. }, [_h('div', {
  11585. staticClass: "col-sm-7"
  11586. }, [_h('div', {
  11587. staticClass: "inner-addon left-addon"
  11588. }, [_m(0), " ", _h('input', {
  11589. directives: [{
  11590. name: "model",
  11591. rawName: "v-model",
  11592. value: (searchQuery),
  11593. expression: "searchQuery"
  11594. }],
  11595. staticClass: "form-control",
  11596. attrs: {
  11597. "name": "search",
  11598. "placeholder": "Search"
  11599. },
  11600. domProps: {
  11601. "value": _s(searchQuery)
  11602. },
  11603. on: {
  11604. "input": function($event) {
  11605. if ($event.target.composing) return;
  11606. searchQuery = $event.target.value
  11607. }
  11608. }
  11609. })])])])]), " ", _h('div', {
  11610. staticClass: "row",
  11611. attrs: {
  11612. "id": "passwords"
  11613. }
  11614. }, [_h('div', {
  11615. staticClass: "col-xs-12"
  11616. }, [_h('table', {
  11617. staticClass: "table"
  11618. }, [_h('tbody', [(passwords.length === 0) ? _h('tr', [_h('td', ["\n You don't have any passwords saved in your database.\n ", _m(1), " ", _h('router-link', {
  11619. attrs: {
  11620. "to": {
  11621. name: 'home'
  11622. }
  11623. }
  11624. }, ["Would you like to create one ?"])])]) : _e(), " ", _l((passwords), function(password) {
  11625. return _h('tr', [_h('td', [_h('router-link', {
  11626. attrs: {
  11627. "to": {
  11628. name: 'password',
  11629. params: {
  11630. id: password.id
  11631. }
  11632. }
  11633. }
  11634. }, ["\n " + _s(password.site) + "\n "]), " ", _m(2, true), "\n " + _s(password.login) + "\n "]), " ", _h('td', {
  11635. staticClass: "text-xs-right"
  11636. }, [_h('delete-button', {
  11637. attrs: {
  11638. "action": deletePassword,
  11639. "object": password,
  11640. "text": "Are you sure you want to delete this password ?"
  11641. }
  11642. })])])
  11643. })])])])])])
  11644. }},staticRenderFns: [function (){with(this) {
  11645. return _h('i', {
  11646. staticClass: "fa fa-search"
  11647. })
  11648. }},function (){with(this) {
  11649. return _h('br')
  11650. }},function (){with(this) {
  11651. return _h('br')
  11652. }}]}
  11653. /***/ },
  11654. /* 297 */
  11655. /***/ function(module, exports) {
  11656. module.exports={render:function (){with(this) {
  11657. return _h('form', {
  11658. attrs: {
  11659. "id": "password-generator"
  11660. }
  11661. }, [_h('div', {
  11662. staticClass: "form-group row"
  11663. }, [_h('div', {
  11664. staticClass: "col-xs-12"
  11665. }, [_h('div', {
  11666. staticClass: "inner-addon left-addon"
  11667. }, [_m(0), " ", _h('input', {
  11668. directives: [{
  11669. name: "model",
  11670. rawName: "v-model",
  11671. value: (password.site),
  11672. expression: "password.site"
  11673. }],
  11674. ref: "site",
  11675. staticClass: "form-control",
  11676. attrs: {
  11677. "id": "site",
  11678. "name": "site",
  11679. "type": "text",
  11680. "placeholder": "Site",
  11681. "list": "savedSites",
  11682. "autocorrect": "off",
  11683. "autocapitalize": "none"
  11684. },
  11685. domProps: {
  11686. "value": _s(password.site)
  11687. },
  11688. on: {
  11689. "input": function($event) {
  11690. if ($event.target.composing) return;
  11691. password.site = $event.target.value
  11692. }
  11693. }
  11694. }), " ", _h('datalist', {
  11695. attrs: {
  11696. "id": "savedSites"
  11697. }
  11698. }, [_l((passwords), function(pwd) {
  11699. return _h('option', ["\n " + _s(pwd.site) + " | " + _s(pwd.login) + "\n "])
  11700. })])])])]), " ", _h('remove-auto-complete'), " ", _h('div', {
  11701. staticClass: "form-group row"
  11702. }, [_h('div', {
  11703. staticClass: "col-xs-12"
  11704. }, [_h('div', {
  11705. staticClass: "inner-addon left-addon"
  11706. }, [_m(1), " ", _m(2), " ", _h('input', {
  11707. directives: [{
  11708. name: "model",
  11709. rawName: "v-model",
  11710. value: (password.login),
  11711. expression: "password.login"
  11712. }],
  11713. staticClass: "form-control",
  11714. attrs: {
  11715. "id": "login",
  11716. "name": "login",
  11717. "type": "text",
  11718. "placeholder": "Login",
  11719. "autocomplete": "off",
  11720. "autocorrect": "off",
  11721. "autocapitalize": "none"
  11722. },
  11723. domProps: {
  11724. "value": _s(password.login)
  11725. },
  11726. on: {
  11727. "input": function($event) {
  11728. if ($event.target.composing) return;
  11729. password.login = $event.target.value
  11730. }
  11731. }
  11732. })])])]), " ", _h('div', {
  11733. staticClass: "form-group row"
  11734. }, [_h('div', {
  11735. staticClass: "col-xs-12"
  11736. }, [_h('div', {
  11737. staticClass: "inner-addon left-addon input-group"
  11738. }, [_m(3), " ", _m(4), " ", _h('input', {
  11739. directives: [{
  11740. name: "model",
  11741. rawName: "v-model",
  11742. value: (masterPassword),
  11743. expression: "masterPassword"
  11744. }],
  11745. ref: "masterPassword",
  11746. staticClass: "form-control",
  11747. attrs: {
  11748. "id": "masterPassword",
  11749. "name": "masterPassword",
  11750. "type": "password",
  11751. "placeholder": "Master password",
  11752. "autocomplete": "new-password",
  11753. "autocorrect": "off",
  11754. "autocapitalize": "none"
  11755. },
  11756. domProps: {
  11757. "value": _s(masterPassword)
  11758. },
  11759. on: {
  11760. "input": function($event) {
  11761. if ($event.target.composing) return;
  11762. masterPassword = $event.target.value
  11763. }
  11764. }
  11765. }), " ", _h('fingerprint', {
  11766. attrs: {
  11767. "fingerprint": masterPassword
  11768. },
  11769. nativeOn: {
  11770. "click": function($event) {
  11771. showMasterPassword($event)
  11772. }
  11773. }
  11774. })])])]), " ", _h('div', {
  11775. staticClass: "form-group row"
  11776. }, [_h('div', {
  11777. staticClass: "col-xs-12"
  11778. }, [_h('div', {
  11779. staticClass: "input-group"
  11780. }, [_m(5), " ", _h('input', {
  11781. directives: [{
  11782. name: "model",
  11783. rawName: "v-model",
  11784. value: (generatedPassword),
  11785. expression: "generatedPassword"
  11786. }],
  11787. staticClass: "form-control",
  11788. attrs: {
  11789. "id": "generatedPassword",
  11790. "name": "generatedPassword",
  11791. "type": "text",
  11792. "tabindex": "-1",
  11793. "readonly": ""
  11794. },
  11795. domProps: {
  11796. "value": _s(generatedPassword)
  11797. },
  11798. on: {
  11799. "input": function($event) {
  11800. if ($event.target.composing) return;
  11801. generatedPassword = $event.target.value
  11802. }
  11803. }
  11804. }), " ", _h('span', {
  11805. staticClass: "input-group-btn"
  11806. }, [_h('button', {
  11807. staticClass: "btn-copy btn btn-primary",
  11808. attrs: {
  11809. "id": "copyPasswordButton",
  11810. "disabled": !generatedPassword,
  11811. "type": "button",
  11812. "data-clipboard-target": "#generatedPassword"
  11813. },
  11814. on: {
  11815. "click": function($event) {
  11816. cleanFormInSeconds(10)
  11817. }
  11818. }
  11819. }, [_m(6), " Copy\n "])])])])]), " ", _m(7), " ", _h('div', {
  11820. staticClass: "form-group row"
  11821. }, [_h('div', {
  11822. staticClass: "col-xs-12"
  11823. }, [_h('label', {
  11824. staticClass: "form-check-inline"
  11825. }, [_h('input', {
  11826. directives: [{
  11827. name: "model",
  11828. rawName: "v-model",
  11829. value: (password.lowercase),
  11830. expression: "password.lowercase"
  11831. }],
  11832. staticClass: "form-check-input",
  11833. attrs: {
  11834. "type": "checkbox",
  11835. "id": "lowercase"
  11836. },
  11837. domProps: {
  11838. "checked": Array.isArray(password.lowercase) ? _i(password.lowercase, null) > -1 : _q(password.lowercase, true)
  11839. },
  11840. on: {
  11841. "change": function($event) {
  11842. var $$a = password.lowercase,
  11843. $$el = $event.target,
  11844. $$c = $$el.checked ? (true) : (false);
  11845. if (Array.isArray($$a)) {
  11846. var $$v = null,
  11847. $$i = _i($$a, $$v);
  11848. if ($$c) {
  11849. $$i < 0 && (password.lowercase = $$a.concat($$v))
  11850. } else {
  11851. $$i > -1 && (password.lowercase = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  11852. }
  11853. } else {
  11854. password.lowercase = $$c
  11855. }
  11856. }
  11857. }
  11858. }), " abc\n "]), " ", _h('label', {
  11859. staticClass: "form-check-inline"
  11860. }, [_h('input', {
  11861. directives: [{
  11862. name: "model",
  11863. rawName: "v-model",
  11864. value: (password.uppercase),
  11865. expression: "password.uppercase"
  11866. }],
  11867. staticClass: "form-check-input",
  11868. attrs: {
  11869. "type": "checkbox",
  11870. "id": "uppercase"
  11871. },
  11872. domProps: {
  11873. "checked": Array.isArray(password.uppercase) ? _i(password.uppercase, null) > -1 : _q(password.uppercase, true)
  11874. },
  11875. on: {
  11876. "change": function($event) {
  11877. var $$a = password.uppercase,
  11878. $$el = $event.target,
  11879. $$c = $$el.checked ? (true) : (false);
  11880. if (Array.isArray($$a)) {
  11881. var $$v = null,
  11882. $$i = _i($$a, $$v);
  11883. if ($$c) {
  11884. $$i < 0 && (password.uppercase = $$a.concat($$v))
  11885. } else {
  11886. $$i > -1 && (password.uppercase = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  11887. }
  11888. } else {
  11889. password.uppercase = $$c
  11890. }
  11891. }
  11892. }
  11893. }), " ABC\n "]), " ", _h('label', {
  11894. staticClass: "form-check-inline"
  11895. }, [_h('input', {
  11896. directives: [{
  11897. name: "model",
  11898. rawName: "v-model",
  11899. value: (password.numbers),
  11900. expression: "password.numbers"
  11901. }],
  11902. staticClass: "form-check-input",
  11903. attrs: {
  11904. "type": "checkbox",
  11905. "id": "numbers"
  11906. },
  11907. domProps: {
  11908. "checked": Array.isArray(password.numbers) ? _i(password.numbers, null) > -1 : _q(password.numbers, true)
  11909. },
  11910. on: {
  11911. "change": function($event) {
  11912. var $$a = password.numbers,
  11913. $$el = $event.target,
  11914. $$c = $$el.checked ? (true) : (false);
  11915. if (Array.isArray($$a)) {
  11916. var $$v = null,
  11917. $$i = _i($$a, $$v);
  11918. if ($$c) {
  11919. $$i < 0 && (password.numbers = $$a.concat($$v))
  11920. } else {
  11921. $$i > -1 && (password.numbers = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  11922. }
  11923. } else {
  11924. password.numbers = $$c
  11925. }
  11926. }
  11927. }
  11928. }), "\n 123\n "]), " ", _h('label', {
  11929. staticClass: "form-check-inline"
  11930. }, [_h('input', {
  11931. directives: [{
  11932. name: "model",
  11933. rawName: "v-model",
  11934. value: (password.symbols),
  11935. expression: "password.symbols"
  11936. }],
  11937. staticClass: "form-check-input",
  11938. attrs: {
  11939. "type": "checkbox",
  11940. "id": "symbols"
  11941. },
  11942. domProps: {
  11943. "checked": Array.isArray(password.symbols) ? _i(password.symbols, null) > -1 : _q(password.symbols, true)
  11944. },
  11945. on: {
  11946. "change": function($event) {
  11947. var $$a = password.symbols,
  11948. $$el = $event.target,
  11949. $$c = $$el.checked ? (true) : (false);
  11950. if (Array.isArray($$a)) {
  11951. var $$v = null,
  11952. $$i = _i($$a, $$v);
  11953. if ($$c) {
  11954. $$i < 0 && (password.symbols = $$a.concat($$v))
  11955. } else {
  11956. $$i > -1 && (password.symbols = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  11957. }
  11958. } else {
  11959. password.symbols = $$c
  11960. }
  11961. }
  11962. }
  11963. }), "\n %!@\n "])])]), " ", _h('div', {
  11964. staticClass: "form-group row"
  11965. }, [_m(8), " ", _h('div', {
  11966. staticClass: "col-xs-3 pl-0"
  11967. }, [_h('input', {
  11968. directives: [{
  11969. name: "model",
  11970. rawName: "v-model",
  11971. value: (password.length),
  11972. expression: "password.length"
  11973. }],
  11974. staticClass: "form-control",
  11975. attrs: {
  11976. "type": "number",
  11977. "id": "passwordLength",
  11978. "min": "6"
  11979. },
  11980. domProps: {
  11981. "value": _s(password.length)
  11982. },
  11983. on: {
  11984. "input": function($event) {
  11985. if ($event.target.composing) return;
  11986. password.length = _n($event.target.value)
  11987. }
  11988. }
  11989. })]), " ", _m(9), " ", _h('div', {
  11990. staticClass: "col-xs-3 pl-0"
  11991. }, [_h('input', {
  11992. directives: [{
  11993. name: "model",
  11994. rawName: "v-model",
  11995. value: (password.counter),
  11996. expression: "password.counter"
  11997. }],
  11998. staticClass: "form-control",
  11999. attrs: {
  12000. "type": "number",
  12001. "id": "passwordCounter",
  12002. "min": "1"
  12003. },
  12004. domProps: {
  12005. "value": _s(password.counter)
  12006. },
  12007. on: {
  12008. "input": function($event) {
  12009. if ($event.target.composing) return;
  12010. password.counter = _n($event.target.value)
  12011. }
  12012. }
  12013. })])])])
  12014. }},staticRenderFns: [function (){with(this) {
  12015. return _h('i', {
  12016. staticClass: "fa fa-globe"
  12017. })
  12018. }},function (){with(this) {
  12019. return _h('i', {
  12020. staticClass: "fa fa-user"
  12021. })
  12022. }},function (){with(this) {
  12023. return _h('label', {
  12024. staticClass: "sr-only",
  12025. attrs: {
  12026. "for": "login"
  12027. }
  12028. }, ["Login"])
  12029. }},function (){with(this) {
  12030. return _h('label', {
  12031. staticClass: "sr-only",
  12032. attrs: {
  12033. "for": "masterPassword"
  12034. }
  12035. }, ["Password"])
  12036. }},function (){with(this) {
  12037. return _h('i', {
  12038. staticClass: "fa fa-lock"
  12039. })
  12040. }},function (){with(this) {
  12041. return _h('label', {
  12042. staticClass: "sr-only",
  12043. attrs: {
  12044. "for": "generatedPassword"
  12045. }
  12046. }, ["Password Generated"])
  12047. }},function (){with(this) {
  12048. return _h('i', {
  12049. staticClass: "fa fa-clipboard white"
  12050. })
  12051. }},function (){with(this) {
  12052. return _h('div', {
  12053. staticClass: "form-group row"
  12054. }, [_h('div', {
  12055. staticClass: "col-xs-12"
  12056. }, ["\n Password options\n ", _h('hr', {
  12057. attrs: {
  12058. "style": "margin:0;"
  12059. }
  12060. })])])
  12061. }},function (){with(this) {
  12062. return _h('label', {
  12063. staticClass: "col-xs-3 col-form-label",
  12064. attrs: {
  12065. "for": "passwordLength"
  12066. }
  12067. }, ["Length"])
  12068. }},function (){with(this) {
  12069. return _h('label', {
  12070. staticClass: "col-xs-3 col-form-label",
  12071. attrs: {
  12072. "for": "passwordCounter"
  12073. }
  12074. }, ["Counter"])
  12075. }}]}
  12076. /***/ },
  12077. /* 298 */
  12078. /***/ function(module, exports) {
  12079. module.exports={render:function (){with(this) {
  12080. return _h('div', {
  12081. staticClass: "card",
  12082. attrs: {
  12083. "id": "lesspass",
  12084. "style": "border:none;"
  12085. }
  12086. }, [_h('lesspass-menu'), " ", _h('div', {
  12087. staticClass: "card-block",
  12088. attrs: {
  12089. "style": "min-height: 400px;"
  12090. }
  12091. }, [_h('router-view')])])
  12092. }},staticRenderFns: []}
  12093. /***/ },
  12094. /* 299 */
  12095. /***/ function(module, exports) {
  12096. module.exports={render:function (){with(this) {
  12097. return _h('form', {
  12098. on: {
  12099. "submit": function($event) {
  12100. $event.preventDefault();
  12101. resetPassword($event)
  12102. }
  12103. }
  12104. }, [(showError) ? _h('div', {
  12105. staticClass: "form-group row"
  12106. }, [_m(0)]) : _e(), " ", (successMessage) ? _h('div', {
  12107. staticClass: "form-group row"
  12108. }, [_m(1)]) : _e(), " ", _h('div', {
  12109. staticClass: "form-group row"
  12110. }, [_h('div', {
  12111. staticClass: "col-xs-12"
  12112. }, [_h('div', {
  12113. staticClass: "inner-addon left-addon"
  12114. }, [_m(2), " ", _h('input', {
  12115. directives: [{
  12116. name: "model",
  12117. rawName: "v-model",
  12118. value: (email),
  12119. expression: "email"
  12120. }],
  12121. staticClass: "form-control",
  12122. attrs: {
  12123. "id": "email",
  12124. "name": "email",
  12125. "type": "email",
  12126. "placeholder": "Email"
  12127. },
  12128. domProps: {
  12129. "value": _s(email)
  12130. },
  12131. on: {
  12132. "input": function($event) {
  12133. if ($event.target.composing) return;
  12134. email = $event.target.value
  12135. }
  12136. }
  12137. }), " ", _h('small', {
  12138. staticClass: "form-text text-muted text-danger"
  12139. }, [(emailRequired) ? _h('span', ["An email is required"]) : _e()])])])]), " ", _h('div', {
  12140. staticClass: "form-group row"
  12141. }, [_h('div', {
  12142. staticClass: "col-xs-12"
  12143. }, [_h('button', {
  12144. staticClass: "btn btn-primary",
  12145. attrs: {
  12146. "id": "loginButton",
  12147. "type": "submit"
  12148. }
  12149. }, [(loading) ? _h('span', [_m(3)]) : _e(), "\n Send me a reset link\n "])])])])
  12150. }},staticRenderFns: [function (){with(this) {
  12151. return _h('div', {
  12152. staticClass: "col-xs-12 text-muted text-danger"
  12153. }, ["\n Oops! Something went wrong. Retry in a few minutes.\n "])
  12154. }},function (){with(this) {
  12155. return _h('div', {
  12156. staticClass: "col-xs-12 text-muted text-success"
  12157. }, ["\n If a matching account was found an email was sent to allow you to reset your password.\n "])
  12158. }},function (){with(this) {
  12159. return _h('i', {
  12160. staticClass: "fa fa-user"
  12161. })
  12162. }},function (){with(this) {
  12163. return _h('i', {
  12164. staticClass: "fa fa-spinner fa-pulse fa-fw"
  12165. })
  12166. }}]}
  12167. /***/ },
  12168. /* 300 */
  12169. /***/ function(module, exports) {
  12170. module.exports={render:function (){with(this) {
  12171. return _h('div', {
  12172. attrs: {
  12173. "id": "delete-button"
  12174. }
  12175. }, [_h('button', {
  12176. staticClass: "btn btn-danger",
  12177. attrs: {
  12178. "type": "button"
  12179. },
  12180. on: {
  12181. "click": confirm
  12182. }
  12183. }, [_m(0)])])
  12184. }},staticRenderFns: [function (){with(this) {
  12185. return _h('i', {
  12186. staticClass: "fa-white fa fa-trash"
  12187. })
  12188. }}]}
  12189. /***/ },
  12190. /* 301 */
  12191. /***/ function(module, exports) {
  12192. module.exports={render:function (){with(this) {
  12193. return _h('form', {
  12194. on: {
  12195. "submit": function($event) {
  12196. $event.preventDefault();
  12197. resetPasswordConfirm($event)
  12198. }
  12199. }
  12200. }, [(showError) ? _h('div', {
  12201. staticClass: "form-group row"
  12202. }, [_h('div', {
  12203. staticClass: "col-xs-12 text-muted text-danger"
  12204. }, ["\n " + _s(errorMessage) + "\n "])]) : _e(), " ", (successMessage) ? _h('div', {
  12205. staticClass: "form-group row"
  12206. }, [_h('div', {
  12207. staticClass: "col-xs-12 text-muted text-success"
  12208. }, ["\n You're password was reset successfully.\n ", _h('router-link', {
  12209. attrs: {
  12210. "to": {
  12211. name: 'login'
  12212. }
  12213. }
  12214. }, ["Do you want to login ?"])])]) : _e(), " ", _h('div', {
  12215. staticClass: "form-group row"
  12216. }, [_h('div', {
  12217. staticClass: "col-xs-12"
  12218. }, [_h('div', {
  12219. staticClass: "inner-addon left-addon"
  12220. }, [_m(0), " ", _h('input', {
  12221. directives: [{
  12222. name: "model",
  12223. rawName: "v-model",
  12224. value: (new_password),
  12225. expression: "new_password"
  12226. }],
  12227. staticClass: "form-control",
  12228. attrs: {
  12229. "id": "new-password",
  12230. "name": "new-password",
  12231. "type": "password",
  12232. "autocomplete": "new-password",
  12233. "placeholder": "New Password"
  12234. },
  12235. domProps: {
  12236. "value": _s(new_password)
  12237. },
  12238. on: {
  12239. "input": function($event) {
  12240. if ($event.target.composing) return;
  12241. new_password = $event.target.value
  12242. }
  12243. }
  12244. }), " ", _h('small', {
  12245. staticClass: "form-text text-muted text-danger"
  12246. }, [(passwordRequired) ? _h('span', ["A password is required"]) : _e()])])])]), " ", _m(1)])
  12247. }},staticRenderFns: [function (){with(this) {
  12248. return _h('i', {
  12249. staticClass: "fa fa-lock"
  12250. })
  12251. }},function (){with(this) {
  12252. return _h('div', {
  12253. staticClass: "form-group row"
  12254. }, [_h('div', {
  12255. staticClass: "col-xs-12"
  12256. }, [_h('button', {
  12257. staticClass: "btn btn-primary",
  12258. attrs: {
  12259. "id": "loginButton",
  12260. "type": "submit"
  12261. }
  12262. }, ["\n Reset my password\n "])])])
  12263. }}]}
  12264. /***/ },
  12265. /* 302 */
  12266. /***/ function(module, exports) {
  12267. module.exports={render:function (){with(this) {
  12268. return _h('div', {
  12269. attrs: {
  12270. "id": "menu"
  12271. }
  12272. }, [_h('div', {
  12273. directives: [{
  12274. name: "show",
  12275. rawName: "v-show",
  12276. value: (isAuthenticated),
  12277. expression: "isAuthenticated"
  12278. }],
  12279. staticClass: "card-header"
  12280. }, [_h('div', {
  12281. staticClass: "row"
  12282. }, [_h('div', {
  12283. staticClass: "col-xs-6"
  12284. }, [_h('router-link', {
  12285. staticClass: "grey-link",
  12286. attrs: {
  12287. "to": {
  12288. name: 'home'
  12289. }
  12290. }
  12291. }, ["LessPass"]), " ", _h('span', {
  12292. staticClass: " hint--right",
  12293. attrs: {
  12294. "aria-label": "Save password"
  12295. },
  12296. on: {
  12297. "click": saveOrUpdatePassword
  12298. }
  12299. }, [(passwordStatus == 'DIRTY') ? _h('i', {
  12300. staticClass: "fa fa-save ml-1 fa-clickable"
  12301. }) : _e()]), " ", (passwordStatus == 'CREATED') ? _h('span', {
  12302. staticClass: "text-success"
  12303. }, [_m(0), " saved\n "]) : _e(), " ", (passwordStatus == 'UPDATED') ? _h('span', {
  12304. staticClass: "text-success"
  12305. }, [_m(1), " updated\n "]) : _e()]), " ", _h('div', {
  12306. staticClass: "col-xs-6 text-xs-right"
  12307. }, [_h('router-link', {
  12308. staticClass: "grey-link ml-1",
  12309. attrs: {
  12310. "to": {
  12311. name: 'passwords'
  12312. }
  12313. }
  12314. }, [_m(2)]), " ", _h('button', {
  12315. staticClass: "grey-link ml-1 btn btn-link p-0 m-0",
  12316. attrs: {
  12317. "type": "button"
  12318. },
  12319. on: {
  12320. "click": logout
  12321. }
  12322. }, [_m(3)])])])]), " ", _h('div', {
  12323. directives: [{
  12324. name: "show",
  12325. rawName: "v-show",
  12326. value: (isGuest),
  12327. expression: "isGuest"
  12328. }],
  12329. staticClass: "card-header card-header-dark"
  12330. }, [_h('div', {
  12331. staticClass: "row"
  12332. }, [_h('div', {
  12333. staticClass: "index-header"
  12334. }, [_h('div', {
  12335. staticClass: "col-xs-6"
  12336. }, [_h('router-link', {
  12337. staticClass: "white-link",
  12338. attrs: {
  12339. "to": {
  12340. name: 'home'
  12341. }
  12342. }
  12343. }, ["LessPass"])]), " ", _h('div', {
  12344. staticClass: "col-xs-6 text-xs-right"
  12345. }, [_h('router-link', {
  12346. staticClass: "white-link",
  12347. attrs: {
  12348. "to": {
  12349. name: 'login'
  12350. }
  12351. }
  12352. }, [_m(4)])])])])])])
  12353. }},staticRenderFns: [function (){with(this) {
  12354. return _h('i', {
  12355. staticClass: "fa fa-check ml-1 text-success"
  12356. })
  12357. }},function (){with(this) {
  12358. return _h('i', {
  12359. staticClass: "fa fa-check ml-1 text-success"
  12360. })
  12361. }},function (){with(this) {
  12362. return _h('i', {
  12363. staticClass: "fa fa-key",
  12364. attrs: {
  12365. "aria-hidden": "true"
  12366. }
  12367. })
  12368. }},function (){with(this) {
  12369. return _h('i', {
  12370. staticClass: "fa fa-sign-out",
  12371. attrs: {
  12372. "aria-hidden": "true"
  12373. }
  12374. })
  12375. }},function (){with(this) {
  12376. return _h('i', {
  12377. staticClass: "fa fa-user-secret white",
  12378. attrs: {
  12379. "aria-hidden": "true"
  12380. }
  12381. })
  12382. }}]}
  12383. /***/ },
  12384. /* 303 */
  12385. /***/ function(module, exports, __webpack_require__) {
  12386. /**
  12387. * vue-router v2.0.1
  12388. * (c) 2016 Evan You
  12389. * @license MIT
  12390. */
  12391. (function (global, factory) {
  12392. true ? module.exports = factory() :
  12393. typeof define === 'function' && define.amd ? define(factory) :
  12394. (global.VueRouter = factory());
  12395. }(this, (function () { 'use strict';
  12396. var View = {
  12397. name: 'router-view',
  12398. functional: true,
  12399. props: {
  12400. name: {
  12401. type: String,
  12402. default: 'default'
  12403. }
  12404. },
  12405. render: function render (h, ref) {
  12406. var props = ref.props;
  12407. var children = ref.children;
  12408. var parent = ref.parent;
  12409. var data = ref.data;
  12410. data.routerView = true
  12411. var route = parent.$route
  12412. var cache = parent._routerViewCache || (parent._routerViewCache = {})
  12413. var depth = 0
  12414. var inactive = false
  12415. while (parent) {
  12416. if (parent.$vnode && parent.$vnode.data.routerView) {
  12417. depth++
  12418. }
  12419. if (parent._inactive) {
  12420. inactive = true
  12421. }
  12422. parent = parent.$parent
  12423. }
  12424. data.routerViewDepth = depth
  12425. var matched = route.matched[depth]
  12426. if (!matched) {
  12427. return h()
  12428. }
  12429. var name = props.name
  12430. var component = inactive
  12431. ? cache[name]
  12432. : (cache[name] = matched.components[name])
  12433. if (!inactive) {
  12434. var hooks = data.hook || (data.hook = {})
  12435. hooks.init = function (vnode) {
  12436. matched.instances[name] = vnode.child
  12437. }
  12438. hooks.destroy = function (vnode) {
  12439. if (matched.instances[name] === vnode.child) {
  12440. matched.instances[name] = undefined
  12441. }
  12442. }
  12443. }
  12444. return h(component, data, children)
  12445. }
  12446. }
  12447. /* */
  12448. function resolvePath (
  12449. relative,
  12450. base,
  12451. append
  12452. ) {
  12453. if (relative.charAt(0) === '/') {
  12454. return relative
  12455. }
  12456. if (relative.charAt(0) === '?' || relative.charAt(0) === '#') {
  12457. return base + relative
  12458. }
  12459. var stack = base.split('/')
  12460. // remove trailing segment if:
  12461. // - not appending
  12462. // - appending to trailing slash (last segment is empty)
  12463. if (!append || !stack[stack.length - 1]) {
  12464. stack.pop()
  12465. }
  12466. // resolve relative path
  12467. var segments = relative.replace(/^\//, '').split('/')
  12468. for (var i = 0; i < segments.length; i++) {
  12469. var segment = segments[i]
  12470. if (segment === '.') {
  12471. continue
  12472. } else if (segment === '..') {
  12473. stack.pop()
  12474. } else {
  12475. stack.push(segment)
  12476. }
  12477. }
  12478. // ensure leading slash
  12479. if (stack[0] !== '') {
  12480. stack.unshift('')
  12481. }
  12482. return stack.join('/')
  12483. }
  12484. function parsePath (path) {
  12485. var hash = ''
  12486. var query = ''
  12487. var hashIndex = path.indexOf('#')
  12488. if (hashIndex >= 0) {
  12489. hash = path.slice(hashIndex)
  12490. path = path.slice(0, hashIndex)
  12491. }
  12492. var queryIndex = path.indexOf('?')
  12493. if (queryIndex >= 0) {
  12494. query = path.slice(queryIndex + 1)
  12495. path = path.slice(0, queryIndex)
  12496. }
  12497. return {
  12498. path: path,
  12499. query: query,
  12500. hash: hash
  12501. }
  12502. }
  12503. function cleanPath (path) {
  12504. return path.replace(/\/\//g, '/')
  12505. }
  12506. /* */
  12507. function assert (condition, message) {
  12508. if (!condition) {
  12509. throw new Error(("[vue-router] " + message))
  12510. }
  12511. }
  12512. function warn (condition, message) {
  12513. if (!condition) {
  12514. typeof console !== 'undefined' && console.warn(("[vue-router] " + message))
  12515. }
  12516. }
  12517. /* */
  12518. var encode = encodeURIComponent
  12519. var decode = decodeURIComponent
  12520. function resolveQuery (
  12521. query,
  12522. extraQuery
  12523. ) {
  12524. if ( extraQuery === void 0 ) extraQuery = {};
  12525. if (query) {
  12526. var parsedQuery
  12527. try {
  12528. parsedQuery = parseQuery(query)
  12529. } catch (e) {
  12530. warn(false, e.message)
  12531. parsedQuery = {}
  12532. }
  12533. for (var key in extraQuery) {
  12534. parsedQuery[key] = extraQuery[key]
  12535. }
  12536. return parsedQuery
  12537. } else {
  12538. return extraQuery
  12539. }
  12540. }
  12541. function parseQuery (query) {
  12542. var res = Object.create(null)
  12543. query = query.trim().replace(/^(\?|#|&)/, '')
  12544. if (!query) {
  12545. return res
  12546. }
  12547. query.split('&').forEach(function (param) {
  12548. var parts = param.replace(/\+/g, ' ').split('=')
  12549. var key = decode(parts.shift())
  12550. var val = parts.length > 0
  12551. ? decode(parts.join('='))
  12552. : null
  12553. if (res[key] === undefined) {
  12554. res[key] = val
  12555. } else if (Array.isArray(res[key])) {
  12556. res[key].push(val)
  12557. } else {
  12558. res[key] = [res[key], val]
  12559. }
  12560. })
  12561. return res
  12562. }
  12563. function stringifyQuery (obj) {
  12564. var res = obj ? Object.keys(obj).sort().map(function (key) {
  12565. var val = obj[key]
  12566. if (val === undefined) {
  12567. return ''
  12568. }
  12569. if (val === null) {
  12570. return encode(key)
  12571. }
  12572. if (Array.isArray(val)) {
  12573. var result = []
  12574. val.slice().forEach(function (val2) {
  12575. if (val2 === undefined) {
  12576. return
  12577. }
  12578. if (val2 === null) {
  12579. result.push(encode(key))
  12580. } else {
  12581. result.push(encode(key) + '=' + encode(val2))
  12582. }
  12583. })
  12584. return result.join('&')
  12585. }
  12586. return encode(key) + '=' + encode(val)
  12587. }).filter(function (x) { return x.length > 0; }).join('&') : null
  12588. return res ? ("?" + res) : ''
  12589. }
  12590. /* */
  12591. function createRoute (
  12592. record,
  12593. location,
  12594. redirectedFrom
  12595. ) {
  12596. var route = {
  12597. name: location.name || (record && record.name),
  12598. meta: (record && record.meta) || {},
  12599. path: location.path || '/',
  12600. hash: location.hash || '',
  12601. query: location.query || {},
  12602. params: location.params || {},
  12603. fullPath: getFullPath(location),
  12604. matched: record ? formatMatch(record) : []
  12605. }
  12606. if (redirectedFrom) {
  12607. route.redirectedFrom = getFullPath(redirectedFrom)
  12608. }
  12609. return Object.freeze(route)
  12610. }
  12611. // the starting route that represents the initial state
  12612. var START = createRoute(null, {
  12613. path: '/'
  12614. })
  12615. function formatMatch (record) {
  12616. var res = []
  12617. while (record) {
  12618. res.unshift(record)
  12619. record = record.parent
  12620. }
  12621. return res
  12622. }
  12623. function getFullPath (ref) {
  12624. var path = ref.path;
  12625. var query = ref.query; if ( query === void 0 ) query = {};
  12626. var hash = ref.hash; if ( hash === void 0 ) hash = '';
  12627. return (path || '/') + stringifyQuery(query) + hash
  12628. }
  12629. var trailingSlashRE = /\/$/
  12630. function isSameRoute (a, b) {
  12631. if (b === START) {
  12632. return a === b
  12633. } else if (!b) {
  12634. return false
  12635. } else if (a.path && b.path) {
  12636. return (
  12637. a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&
  12638. a.hash === b.hash &&
  12639. isObjectEqual(a.query, b.query)
  12640. )
  12641. } else if (a.name && b.name) {
  12642. return (
  12643. a.name === b.name &&
  12644. a.hash === b.hash &&
  12645. isObjectEqual(a.query, b.query) &&
  12646. isObjectEqual(a.params, b.params)
  12647. )
  12648. } else {
  12649. return false
  12650. }
  12651. }
  12652. function isObjectEqual (a, b) {
  12653. if ( a === void 0 ) a = {};
  12654. if ( b === void 0 ) b = {};
  12655. var aKeys = Object.keys(a)
  12656. var bKeys = Object.keys(b)
  12657. if (aKeys.length !== bKeys.length) {
  12658. return false
  12659. }
  12660. return aKeys.every(function (key) { return String(a[key]) === String(b[key]); })
  12661. }
  12662. function isIncludedRoute (current, target) {
  12663. return (
  12664. current.path.indexOf(target.path) === 0 &&
  12665. (!target.hash || current.hash === target.hash) &&
  12666. queryIncludes(current.query, target.query)
  12667. )
  12668. }
  12669. function queryIncludes (current, target) {
  12670. for (var key in target) {
  12671. if (!(key in current)) {
  12672. return false
  12673. }
  12674. }
  12675. return true
  12676. }
  12677. /* */
  12678. function normalizeLocation (
  12679. raw,
  12680. current,
  12681. append
  12682. ) {
  12683. var next = typeof raw === 'string' ? { path: raw } : raw
  12684. if (next.name || next._normalized) {
  12685. return next
  12686. }
  12687. var parsedPath = parsePath(next.path || '')
  12688. var basePath = (current && current.path) || '/'
  12689. var path = parsedPath.path
  12690. ? resolvePath(parsedPath.path, basePath, append)
  12691. : (current && current.path) || '/'
  12692. var query = resolveQuery(parsedPath.query, next.query)
  12693. var hash = next.hash || parsedPath.hash
  12694. if (hash && hash.charAt(0) !== '#') {
  12695. hash = "#" + hash
  12696. }
  12697. return {
  12698. _normalized: true,
  12699. path: path,
  12700. query: query,
  12701. hash: hash
  12702. }
  12703. }
  12704. /* */
  12705. // work around weird flow bug
  12706. var toTypes = [String, Object]
  12707. var Link = {
  12708. name: 'router-link',
  12709. props: {
  12710. to: {
  12711. type: toTypes,
  12712. required: true
  12713. },
  12714. tag: {
  12715. type: String,
  12716. default: 'a'
  12717. },
  12718. exact: Boolean,
  12719. append: Boolean,
  12720. replace: Boolean,
  12721. activeClass: String
  12722. },
  12723. render: function render (h) {
  12724. var this$1 = this;
  12725. var router = this.$router
  12726. var current = this.$route
  12727. var to = normalizeLocation(this.to, current, this.append)
  12728. var resolved = router.match(to)
  12729. var fullPath = resolved.redirectedFrom || resolved.fullPath
  12730. var base = router.history.base
  12731. var href = base ? cleanPath(base + fullPath) : fullPath
  12732. var classes = {}
  12733. var activeClass = this.activeClass || router.options.linkActiveClass || 'router-link-active'
  12734. var compareTarget = to.path ? createRoute(null, to) : resolved
  12735. classes[activeClass] = this.exact
  12736. ? isSameRoute(current, compareTarget)
  12737. : isIncludedRoute(current, compareTarget)
  12738. var on = {
  12739. click: function (e) {
  12740. // don't redirect with control keys
  12741. /* istanbul ignore if */
  12742. if (e.metaKey || e.ctrlKey || e.shiftKey) { return }
  12743. // don't redirect when preventDefault called
  12744. /* istanbul ignore if */
  12745. if (e.defaultPrevented) { return }
  12746. // don't redirect on right click
  12747. /* istanbul ignore if */
  12748. if (e.button !== 0) { return }
  12749. e.preventDefault()
  12750. if (this$1.replace) {
  12751. router.replace(to)
  12752. } else {
  12753. router.push(to)
  12754. }
  12755. }
  12756. }
  12757. var data = {
  12758. class: classes
  12759. }
  12760. if (this.tag === 'a') {
  12761. data.on = on
  12762. data.attrs = { href: href }
  12763. } else {
  12764. // find the first <a> child and apply listener and href
  12765. var a = findAnchor(this.$slots.default)
  12766. if (a) {
  12767. var aData = a.data || (a.data = {})
  12768. aData.on = on
  12769. var aAttrs = aData.attrs || (aData.attrs = {})
  12770. aAttrs.href = href
  12771. } else {
  12772. // doesn't have <a> child, apply listener to self
  12773. data.on = on
  12774. }
  12775. }
  12776. return h(this.tag, data, this.$slots.default)
  12777. }
  12778. }
  12779. function findAnchor (children) {
  12780. if (children) {
  12781. var child
  12782. for (var i = 0; i < children.length; i++) {
  12783. child = children[i]
  12784. if (child.tag === 'a') {
  12785. return child
  12786. }
  12787. if (child.children && (child = findAnchor(child.children))) {
  12788. return child
  12789. }
  12790. }
  12791. }
  12792. }
  12793. function install (Vue) {
  12794. if (install.installed) { return }
  12795. install.installed = true
  12796. Object.defineProperty(Vue.prototype, '$router', {
  12797. get: function get () { return this.$root._router }
  12798. })
  12799. Object.defineProperty(Vue.prototype, '$route', {
  12800. get: function get$1 () { return this.$root._route }
  12801. })
  12802. Vue.mixin({
  12803. beforeCreate: function beforeCreate () {
  12804. if (this.$options.router) {
  12805. this._router = this.$options.router
  12806. this._router.init(this)
  12807. Vue.util.defineReactive(this, '_route', this._router.history.current)
  12808. }
  12809. }
  12810. })
  12811. Vue.component('router-view', View)
  12812. Vue.component('router-link', Link)
  12813. }
  12814. var __moduleExports = Array.isArray || function (arr) {
  12815. return Object.prototype.toString.call(arr) == '[object Array]';
  12816. };
  12817. var isarray = __moduleExports
  12818. /**
  12819. * Expose `pathToRegexp`.
  12820. */
  12821. var index = pathToRegexp
  12822. var parse_1 = parse
  12823. var compile_1 = compile
  12824. var tokensToFunction_1 = tokensToFunction
  12825. var tokensToRegExp_1 = tokensToRegExp
  12826. /**
  12827. * The main path matching regexp utility.
  12828. *
  12829. * @type {RegExp}
  12830. */
  12831. var PATH_REGEXP = new RegExp([
  12832. // Match escaped characters that would otherwise appear in future matches.
  12833. // This allows the user to escape special characters that won't transform.
  12834. '(\\\\.)',
  12835. // Match Express-style parameters and un-named parameters with a prefix
  12836. // and optional suffixes. Matches appear as:
  12837. //
  12838. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  12839. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  12840. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  12841. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  12842. ].join('|'), 'g')
  12843. /**
  12844. * Parse a string for the raw tokens.
  12845. *
  12846. * @param {string} str
  12847. * @return {!Array}
  12848. */
  12849. function parse (str) {
  12850. var tokens = []
  12851. var key = 0
  12852. var index = 0
  12853. var path = ''
  12854. var res
  12855. while ((res = PATH_REGEXP.exec(str)) != null) {
  12856. var m = res[0]
  12857. var escaped = res[1]
  12858. var offset = res.index
  12859. path += str.slice(index, offset)
  12860. index = offset + m.length
  12861. // Ignore already escaped sequences.
  12862. if (escaped) {
  12863. path += escaped[1]
  12864. continue
  12865. }
  12866. var next = str[index]
  12867. var prefix = res[2]
  12868. var name = res[3]
  12869. var capture = res[4]
  12870. var group = res[5]
  12871. var modifier = res[6]
  12872. var asterisk = res[7]
  12873. // Push the current path onto the tokens.
  12874. if (path) {
  12875. tokens.push(path)
  12876. path = ''
  12877. }
  12878. var partial = prefix != null && next != null && next !== prefix
  12879. var repeat = modifier === '+' || modifier === '*'
  12880. var optional = modifier === '?' || modifier === '*'
  12881. var delimiter = res[2] || '/'
  12882. var pattern = capture || group || (asterisk ? '.*' : '[^' + delimiter + ']+?')
  12883. tokens.push({
  12884. name: name || key++,
  12885. prefix: prefix || '',
  12886. delimiter: delimiter,
  12887. optional: optional,
  12888. repeat: repeat,
  12889. partial: partial,
  12890. asterisk: !!asterisk,
  12891. pattern: escapeGroup(pattern)
  12892. })
  12893. }
  12894. // Match any characters still remaining.
  12895. if (index < str.length) {
  12896. path += str.substr(index)
  12897. }
  12898. // If the path exists, push it onto the end.
  12899. if (path) {
  12900. tokens.push(path)
  12901. }
  12902. return tokens
  12903. }
  12904. /**
  12905. * Compile a string to a template function for the path.
  12906. *
  12907. * @param {string} str
  12908. * @return {!function(Object=, Object=)}
  12909. */
  12910. function compile (str) {
  12911. return tokensToFunction(parse(str))
  12912. }
  12913. /**
  12914. * Prettier encoding of URI path segments.
  12915. *
  12916. * @param {string}
  12917. * @return {string}
  12918. */
  12919. function encodeURIComponentPretty (str) {
  12920. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  12921. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  12922. })
  12923. }
  12924. /**
  12925. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  12926. *
  12927. * @param {string}
  12928. * @return {string}
  12929. */
  12930. function encodeAsterisk (str) {
  12931. return encodeURI(str).replace(/[?#]/g, function (c) {
  12932. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  12933. })
  12934. }
  12935. /**
  12936. * Expose a method for transforming tokens into the path function.
  12937. */
  12938. function tokensToFunction (tokens) {
  12939. // Compile all the tokens into regexps.
  12940. var matches = new Array(tokens.length)
  12941. // Compile all the patterns before compilation.
  12942. for (var i = 0; i < tokens.length; i++) {
  12943. if (typeof tokens[i] === 'object') {
  12944. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')
  12945. }
  12946. }
  12947. return function (obj, opts) {
  12948. var path = ''
  12949. var data = obj || {}
  12950. var options = opts || {}
  12951. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
  12952. for (var i = 0; i < tokens.length; i++) {
  12953. var token = tokens[i]
  12954. if (typeof token === 'string') {
  12955. path += token
  12956. continue
  12957. }
  12958. var value = data[token.name]
  12959. var segment
  12960. if (value == null) {
  12961. if (token.optional) {
  12962. // Prepend partial segment prefixes.
  12963. if (token.partial) {
  12964. path += token.prefix
  12965. }
  12966. continue
  12967. } else {
  12968. throw new TypeError('Expected "' + token.name + '" to be defined')
  12969. }
  12970. }
  12971. if (isarray(value)) {
  12972. if (!token.repeat) {
  12973. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  12974. }
  12975. if (value.length === 0) {
  12976. if (token.optional) {
  12977. continue
  12978. } else {
  12979. throw new TypeError('Expected "' + token.name + '" to not be empty')
  12980. }
  12981. }
  12982. for (var j = 0; j < value.length; j++) {
  12983. segment = encode(value[j])
  12984. if (!matches[i].test(segment)) {
  12985. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  12986. }
  12987. path += (j === 0 ? token.prefix : token.delimiter) + segment
  12988. }
  12989. continue
  12990. }
  12991. segment = token.asterisk ? encodeAsterisk(value) : encode(value)
  12992. if (!matches[i].test(segment)) {
  12993. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  12994. }
  12995. path += token.prefix + segment
  12996. }
  12997. return path
  12998. }
  12999. }
  13000. /**
  13001. * Escape a regular expression string.
  13002. *
  13003. * @param {string} str
  13004. * @return {string}
  13005. */
  13006. function escapeString (str) {
  13007. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  13008. }
  13009. /**
  13010. * Escape the capturing group by escaping special characters and meaning.
  13011. *
  13012. * @param {string} group
  13013. * @return {string}
  13014. */
  13015. function escapeGroup (group) {
  13016. return group.replace(/([=!:$\/()])/g, '\\$1')
  13017. }
  13018. /**
  13019. * Attach the keys as a property of the regexp.
  13020. *
  13021. * @param {!RegExp} re
  13022. * @param {Array} keys
  13023. * @return {!RegExp}
  13024. */
  13025. function attachKeys (re, keys) {
  13026. re.keys = keys
  13027. return re
  13028. }
  13029. /**
  13030. * Get the flags for a regexp from the options.
  13031. *
  13032. * @param {Object} options
  13033. * @return {string}
  13034. */
  13035. function flags (options) {
  13036. return options.sensitive ? '' : 'i'
  13037. }
  13038. /**
  13039. * Pull out keys from a regexp.
  13040. *
  13041. * @param {!RegExp} path
  13042. * @param {!Array} keys
  13043. * @return {!RegExp}
  13044. */
  13045. function regexpToRegexp (path, keys) {
  13046. // Use a negative lookahead to match only capturing groups.
  13047. var groups = path.source.match(/\((?!\?)/g)
  13048. if (groups) {
  13049. for (var i = 0; i < groups.length; i++) {
  13050. keys.push({
  13051. name: i,
  13052. prefix: null,
  13053. delimiter: null,
  13054. optional: false,
  13055. repeat: false,
  13056. partial: false,
  13057. asterisk: false,
  13058. pattern: null
  13059. })
  13060. }
  13061. }
  13062. return attachKeys(path, keys)
  13063. }
  13064. /**
  13065. * Transform an array into a regexp.
  13066. *
  13067. * @param {!Array} path
  13068. * @param {Array} keys
  13069. * @param {!Object} options
  13070. * @return {!RegExp}
  13071. */
  13072. function arrayToRegexp (path, keys, options) {
  13073. var parts = []
  13074. for (var i = 0; i < path.length; i++) {
  13075. parts.push(pathToRegexp(path[i], keys, options).source)
  13076. }
  13077. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
  13078. return attachKeys(regexp, keys)
  13079. }
  13080. /**
  13081. * Create a path regexp from string input.
  13082. *
  13083. * @param {string} path
  13084. * @param {!Array} keys
  13085. * @param {!Object} options
  13086. * @return {!RegExp}
  13087. */
  13088. function stringToRegexp (path, keys, options) {
  13089. var tokens = parse(path)
  13090. var re = tokensToRegExp(tokens, options)
  13091. // Attach keys back to the regexp.
  13092. for (var i = 0; i < tokens.length; i++) {
  13093. if (typeof tokens[i] !== 'string') {
  13094. keys.push(tokens[i])
  13095. }
  13096. }
  13097. return attachKeys(re, keys)
  13098. }
  13099. /**
  13100. * Expose a function for taking tokens and returning a RegExp.
  13101. *
  13102. * @param {!Array} tokens
  13103. * @param {Object=} options
  13104. * @return {!RegExp}
  13105. */
  13106. function tokensToRegExp (tokens, options) {
  13107. options = options || {}
  13108. var strict = options.strict
  13109. var end = options.end !== false
  13110. var route = ''
  13111. var lastToken = tokens[tokens.length - 1]
  13112. var endsWithSlash = typeof lastToken === 'string' && /\/$/.test(lastToken)
  13113. // Iterate over the tokens and create our regexp string.
  13114. for (var i = 0; i < tokens.length; i++) {
  13115. var token = tokens[i]
  13116. if (typeof token === 'string') {
  13117. route += escapeString(token)
  13118. } else {
  13119. var prefix = escapeString(token.prefix)
  13120. var capture = '(?:' + token.pattern + ')'
  13121. if (token.repeat) {
  13122. capture += '(?:' + prefix + capture + ')*'
  13123. }
  13124. if (token.optional) {
  13125. if (!token.partial) {
  13126. capture = '(?:' + prefix + '(' + capture + '))?'
  13127. } else {
  13128. capture = prefix + '(' + capture + ')?'
  13129. }
  13130. } else {
  13131. capture = prefix + '(' + capture + ')'
  13132. }
  13133. route += capture
  13134. }
  13135. }
  13136. // In non-strict mode we allow a slash at the end of match. If the path to
  13137. // match already ends with a slash, we remove it for consistency. The slash
  13138. // is valid at the end of a path match, not in the middle. This is important
  13139. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  13140. if (!strict) {
  13141. route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?'
  13142. }
  13143. if (end) {
  13144. route += '$'
  13145. } else {
  13146. // In non-ending mode, we need the capturing groups to match as much as
  13147. // possible by using a positive lookahead to the end or next path segment.
  13148. route += strict && endsWithSlash ? '' : '(?=\\/|$)'
  13149. }
  13150. return new RegExp('^' + route, flags(options))
  13151. }
  13152. /**
  13153. * Normalize the given path string, returning a regular expression.
  13154. *
  13155. * An empty array can be passed in for the keys, which will hold the
  13156. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  13157. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  13158. *
  13159. * @param {(string|RegExp|Array)} path
  13160. * @param {(Array|Object)=} keys
  13161. * @param {Object=} options
  13162. * @return {!RegExp}
  13163. */
  13164. function pathToRegexp (path, keys, options) {
  13165. keys = keys || []
  13166. if (!isarray(keys)) {
  13167. options = /** @type {!Object} */ (keys)
  13168. keys = []
  13169. } else if (!options) {
  13170. options = {}
  13171. }
  13172. if (path instanceof RegExp) {
  13173. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  13174. }
  13175. if (isarray(path)) {
  13176. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  13177. }
  13178. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  13179. }
  13180. index.parse = parse_1;
  13181. index.compile = compile_1;
  13182. index.tokensToFunction = tokensToFunction_1;
  13183. index.tokensToRegExp = tokensToRegExp_1;
  13184. /* */
  13185. function createRouteMap (routes) {
  13186. var pathMap = Object.create(null)
  13187. var nameMap = Object.create(null)
  13188. routes.forEach(function (route) {
  13189. addRouteRecord(pathMap, nameMap, route)
  13190. })
  13191. return {
  13192. pathMap: pathMap,
  13193. nameMap: nameMap
  13194. }
  13195. }
  13196. function addRouteRecord (
  13197. pathMap,
  13198. nameMap,
  13199. route,
  13200. parent,
  13201. matchAs
  13202. ) {
  13203. var path = route.path;
  13204. var name = route.name;
  13205. assert(path != null, "\"path\" is required in a route configuration.")
  13206. var record = {
  13207. path: normalizePath(path, parent),
  13208. components: route.components || { default: route.component },
  13209. instances: {},
  13210. name: name,
  13211. parent: parent,
  13212. matchAs: matchAs,
  13213. redirect: route.redirect,
  13214. beforeEnter: route.beforeEnter,
  13215. meta: route.meta || {}
  13216. }
  13217. if (route.children) {
  13218. // Warn if route is named and has a default child route.
  13219. // If users navigate to this route by name, the default child will
  13220. // not be rendered (GH Issue #629)
  13221. if (false) {}
  13222. route.children.forEach(function (child) {
  13223. addRouteRecord(pathMap, nameMap, child, record)
  13224. })
  13225. }
  13226. if (route.alias) {
  13227. if (Array.isArray(route.alias)) {
  13228. route.alias.forEach(function (alias) {
  13229. addRouteRecord(pathMap, nameMap, { path: alias }, parent, record.path)
  13230. })
  13231. } else {
  13232. addRouteRecord(pathMap, nameMap, { path: route.alias }, parent, record.path)
  13233. }
  13234. }
  13235. pathMap[record.path] = record
  13236. if (name) { nameMap[name] = record }
  13237. }
  13238. function normalizePath (path, parent) {
  13239. path = path.replace(/\/$/, '')
  13240. if (path[0] === '/') { return path }
  13241. if (parent == null) { return path }
  13242. return cleanPath(((parent.path) + "/" + path))
  13243. }
  13244. /* */
  13245. var regexpCache = Object.create(null)
  13246. var regexpCompileCache = Object.create(null)
  13247. function createMatcher (routes) {
  13248. var ref = createRouteMap(routes);
  13249. var pathMap = ref.pathMap;
  13250. var nameMap = ref.nameMap;
  13251. function match (
  13252. raw,
  13253. currentRoute,
  13254. redirectedFrom
  13255. ) {
  13256. var location = normalizeLocation(raw, currentRoute)
  13257. var name = location.name;
  13258. if (name) {
  13259. var record = nameMap[name]
  13260. if (record) {
  13261. location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""))
  13262. return _createRoute(record, location, redirectedFrom)
  13263. }
  13264. } else if (location.path) {
  13265. location.params = {}
  13266. for (var path in pathMap) {
  13267. if (matchRoute(path, location.params, location.path)) {
  13268. return _createRoute(pathMap[path], location, redirectedFrom)
  13269. }
  13270. }
  13271. }
  13272. // no match
  13273. return _createRoute(null, location)
  13274. }
  13275. function redirect (
  13276. record,
  13277. location
  13278. ) {
  13279. var originalRedirect = record.redirect
  13280. var redirect = typeof originalRedirect === 'function'
  13281. ? originalRedirect(createRoute(record, location))
  13282. : originalRedirect
  13283. if (typeof redirect === 'string') {
  13284. redirect = { path: redirect }
  13285. }
  13286. if (!redirect || typeof redirect !== 'object') {
  13287. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))))
  13288. return _createRoute(null, location)
  13289. }
  13290. var re = redirect
  13291. var name = re.name;
  13292. var path = re.path;
  13293. var query = location.query;
  13294. var hash = location.hash;
  13295. var params = location.params;
  13296. query = re.hasOwnProperty('query') ? re.query : query
  13297. hash = re.hasOwnProperty('hash') ? re.hash : hash
  13298. params = re.hasOwnProperty('params') ? re.params : params
  13299. if (name) {
  13300. // resolved named direct
  13301. var targetRecord = nameMap[name]
  13302. assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."))
  13303. return match({
  13304. _normalized: true,
  13305. name: name,
  13306. query: query,
  13307. hash: hash,
  13308. params: params
  13309. }, undefined, location)
  13310. } else if (path) {
  13311. // 1. resolve relative redirect
  13312. var rawPath = resolveRecordPath(path, record)
  13313. // 2. resolve params
  13314. var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""))
  13315. // 3. rematch with existing query and hash
  13316. return match({
  13317. _normalized: true,
  13318. path: resolvedPath,
  13319. query: query,
  13320. hash: hash
  13321. }, undefined, location)
  13322. } else {
  13323. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))))
  13324. return _createRoute(null, location)
  13325. }
  13326. }
  13327. function alias (
  13328. record,
  13329. location,
  13330. matchAs
  13331. ) {
  13332. var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""))
  13333. var aliasedMatch = match({
  13334. _normalized: true,
  13335. path: aliasedPath
  13336. })
  13337. if (aliasedMatch) {
  13338. var matched = aliasedMatch.matched
  13339. var aliasedRecord = matched[matched.length - 1]
  13340. location.params = aliasedMatch.params
  13341. return _createRoute(aliasedRecord, location)
  13342. }
  13343. return _createRoute(null, location)
  13344. }
  13345. function _createRoute (
  13346. record,
  13347. location,
  13348. redirectedFrom
  13349. ) {
  13350. if (record && record.redirect) {
  13351. return redirect(record, redirectedFrom || location)
  13352. }
  13353. if (record && record.matchAs) {
  13354. return alias(record, location, record.matchAs)
  13355. }
  13356. return createRoute(record, location, redirectedFrom)
  13357. }
  13358. return match
  13359. }
  13360. function matchRoute (
  13361. path,
  13362. params,
  13363. pathname
  13364. ) {
  13365. var keys, regexp
  13366. var hit = regexpCache[path]
  13367. if (hit) {
  13368. keys = hit.keys
  13369. regexp = hit.regexp
  13370. } else {
  13371. keys = []
  13372. regexp = index(path, keys)
  13373. regexpCache[path] = { keys: keys, regexp: regexp }
  13374. }
  13375. var m = pathname.match(regexp)
  13376. if (!m) {
  13377. return false
  13378. } else if (!params) {
  13379. return true
  13380. }
  13381. for (var i = 1, len = m.length; i < len; ++i) {
  13382. var key = keys[i - 1]
  13383. var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]
  13384. if (key) { params[key.name] = val }
  13385. }
  13386. return true
  13387. }
  13388. function fillParams (
  13389. path,
  13390. params,
  13391. routeMsg
  13392. ) {
  13393. try {
  13394. var filler =
  13395. regexpCompileCache[path] ||
  13396. (regexpCompileCache[path] = index.compile(path))
  13397. return filler(params || {}, { pretty: true })
  13398. } catch (e) {
  13399. assert(false, ("missing param for " + routeMsg + ": " + (e.message)))
  13400. return ''
  13401. }
  13402. }
  13403. function resolveRecordPath (path, record) {
  13404. return resolvePath(path, record.parent ? record.parent.path : '/', true)
  13405. }
  13406. /* */
  13407. var inBrowser = typeof window !== 'undefined'
  13408. var supportsHistory = inBrowser && (function () {
  13409. var ua = window.navigator.userAgent
  13410. if (
  13411. (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
  13412. ua.indexOf('Mobile Safari') !== -1 &&
  13413. ua.indexOf('Chrome') === -1 &&
  13414. ua.indexOf('Windows Phone') === -1
  13415. ) {
  13416. return false
  13417. }
  13418. return window.history && 'pushState' in window.history
  13419. })()
  13420. /* */
  13421. function runQueue (queue, fn, cb) {
  13422. var step = function (index) {
  13423. if (index >= queue.length) {
  13424. cb()
  13425. } else {
  13426. if (queue[index]) {
  13427. fn(queue[index], function () {
  13428. step(index + 1)
  13429. })
  13430. } else {
  13431. step(index + 1)
  13432. }
  13433. }
  13434. }
  13435. step(0)
  13436. }
  13437. /* */
  13438. var History = function History (router, base) {
  13439. this.router = router
  13440. this.base = normalizeBase(base)
  13441. // start with a route object that stands for "nowhere"
  13442. this.current = START
  13443. this.pending = null
  13444. };
  13445. History.prototype.listen = function listen (cb) {
  13446. this.cb = cb
  13447. };
  13448. History.prototype.transitionTo = function transitionTo (location, cb) {
  13449. var this$1 = this;
  13450. var route = this.router.match(location, this.current)
  13451. this.confirmTransition(route, function () {
  13452. this$1.updateRoute(route)
  13453. cb && cb(route)
  13454. this$1.ensureURL()
  13455. })
  13456. };
  13457. History.prototype.confirmTransition = function confirmTransition (route, cb) {
  13458. var this$1 = this;
  13459. var current = this.current
  13460. if (isSameRoute(route, current)) {
  13461. this.ensureURL()
  13462. return
  13463. }
  13464. var ref = resolveQueue(this.current.matched, route.matched);
  13465. var deactivated = ref.deactivated;
  13466. var activated = ref.activated;
  13467. var queue = [].concat(
  13468. // in-component leave guards
  13469. extractLeaveGuards(deactivated),
  13470. // global before hooks
  13471. this.router.beforeHooks,
  13472. // enter guards
  13473. activated.map(function (m) { return m.beforeEnter; }),
  13474. // async components
  13475. resolveAsyncComponents(activated)
  13476. )
  13477. this.pending = route
  13478. var iterator = function (hook, next) {
  13479. if (this$1.pending !== route) { return }
  13480. hook(route, current, function (to) {
  13481. if (to === false) {
  13482. // next(false) -> abort navigation, ensure current URL
  13483. this$1.ensureURL()
  13484. } else if (typeof to === 'string' || typeof to === 'object') {
  13485. // next('/') or next({ path: '/' }) -> redirect
  13486. this$1.push(to)
  13487. } else {
  13488. // confirm transition and pass on the value
  13489. next(to)
  13490. }
  13491. })
  13492. }
  13493. runQueue(queue, iterator, function () {
  13494. var postEnterCbs = []
  13495. var enterGuards = extractEnterGuards(activated, postEnterCbs, function () {
  13496. return this$1.current === route
  13497. })
  13498. // wait until async components are resolved before
  13499. // extracting in-component enter guards
  13500. runQueue(enterGuards, iterator, function () {
  13501. if (this$1.pending === route) {
  13502. this$1.pending = null
  13503. cb(route)
  13504. this$1.router.app.$nextTick(function () {
  13505. postEnterCbs.forEach(function (cb) { return cb(); })
  13506. })
  13507. }
  13508. })
  13509. })
  13510. };
  13511. History.prototype.updateRoute = function updateRoute (route) {
  13512. var prev = this.current
  13513. this.current = route
  13514. this.cb && this.cb(route)
  13515. this.router.afterHooks.forEach(function (hook) {
  13516. hook && hook(route, prev)
  13517. })
  13518. };
  13519. function normalizeBase (base) {
  13520. if (!base) {
  13521. if (inBrowser) {
  13522. // respect <base> tag
  13523. var baseEl = document.querySelector('base')
  13524. base = baseEl ? baseEl.getAttribute('href') : '/'
  13525. } else {
  13526. base = '/'
  13527. }
  13528. }
  13529. // make sure there's the starting slash
  13530. if (base.charAt(0) !== '/') {
  13531. base = '/' + base
  13532. }
  13533. // remove trailing slash
  13534. return base.replace(/\/$/, '')
  13535. }
  13536. function resolveQueue (
  13537. current,
  13538. next
  13539. ) {
  13540. var i
  13541. var max = Math.max(current.length, next.length)
  13542. for (i = 0; i < max; i++) {
  13543. if (current[i] !== next[i]) {
  13544. break
  13545. }
  13546. }
  13547. return {
  13548. activated: next.slice(i),
  13549. deactivated: current.slice(i)
  13550. }
  13551. }
  13552. function extractLeaveGuards (matched) {
  13553. return flatMapComponents(matched, function (def, instance) {
  13554. var guard = def && def.beforeRouteLeave
  13555. if (guard) {
  13556. return function routeLeaveGuard () {
  13557. return guard.apply(instance, arguments)
  13558. }
  13559. }
  13560. }).reverse()
  13561. }
  13562. function extractEnterGuards (
  13563. matched,
  13564. cbs,
  13565. isValid
  13566. ) {
  13567. return flatMapComponents(matched, function (def, _, match, key) {
  13568. var guard = def && def.beforeRouteEnter
  13569. if (guard) {
  13570. return function routeEnterGuard (to, from, next) {
  13571. return guard(to, from, function (cb) {
  13572. next(cb)
  13573. if (typeof cb === 'function') {
  13574. cbs.push(function () {
  13575. // #750
  13576. // if a router-view is wrapped with an out-in transition,
  13577. // the instance may not have been registered at this time.
  13578. // we will need to poll for registration until current route
  13579. // is no longer valid.
  13580. poll(cb, match.instances, key, isValid)
  13581. })
  13582. }
  13583. })
  13584. }
  13585. }
  13586. })
  13587. }
  13588. function poll (cb, instances, key, isValid) {
  13589. if (instances[key]) {
  13590. cb(instances[key])
  13591. } else if (isValid()) {
  13592. setTimeout(function () {
  13593. poll(cb, instances, key, isValid)
  13594. }, 16)
  13595. }
  13596. }
  13597. function resolveAsyncComponents (matched) {
  13598. return flatMapComponents(matched, function (def, _, match, key) {
  13599. // if it's a function and doesn't have Vue options attached,
  13600. // assume it's an async component resolve function.
  13601. // we are not using Vue's default async resolving mechanism because
  13602. // we want to halt the navigation until the incoming component has been
  13603. // resolved.
  13604. if (typeof def === 'function' && !def.options) {
  13605. return function (to, from, next) {
  13606. var resolve = function (resolvedDef) {
  13607. match.components[key] = resolvedDef
  13608. next()
  13609. }
  13610. var reject = function (reason) {
  13611. warn(false, ("Failed to resolve async component " + key + ": " + reason))
  13612. next(false)
  13613. }
  13614. var res = def(resolve, reject)
  13615. if (res && typeof res.then === 'function') {
  13616. res.then(resolve, reject)
  13617. }
  13618. }
  13619. }
  13620. })
  13621. }
  13622. function flatMapComponents (
  13623. matched,
  13624. fn
  13625. ) {
  13626. return Array.prototype.concat.apply([], matched.map(function (m) {
  13627. return Object.keys(m.components).map(function (key) { return fn(
  13628. m.components[key],
  13629. m.instances[key],
  13630. m, key
  13631. ); })
  13632. }))
  13633. }
  13634. /* */
  13635. function saveScrollPosition (key) {
  13636. if (!key) { return }
  13637. window.sessionStorage.setItem(key, JSON.stringify({
  13638. x: window.pageXOffset,
  13639. y: window.pageYOffset
  13640. }))
  13641. }
  13642. function getScrollPosition (key) {
  13643. if (!key) { return }
  13644. return JSON.parse(window.sessionStorage.getItem(key))
  13645. }
  13646. function getElementPosition (el) {
  13647. var docRect = document.documentElement.getBoundingClientRect()
  13648. var elRect = el.getBoundingClientRect()
  13649. return {
  13650. x: elRect.left - docRect.left,
  13651. y: elRect.top - docRect.top
  13652. }
  13653. }
  13654. function isValidPosition (obj) {
  13655. return isNumber(obj.x) || isNumber(obj.y)
  13656. }
  13657. function normalizePosition (obj) {
  13658. return {
  13659. x: isNumber(obj.x) ? obj.x : window.pageXOffset,
  13660. y: isNumber(obj.y) ? obj.y : window.pageYOffset
  13661. }
  13662. }
  13663. function isNumber (v) {
  13664. return typeof v === 'number'
  13665. }
  13666. /* */
  13667. var genKey = function () { return String(Date.now()); }
  13668. var _key = genKey()
  13669. var HTML5History = (function (History) {
  13670. function HTML5History (router, base) {
  13671. var this$1 = this;
  13672. History.call(this, router, base)
  13673. this.transitionTo(getLocation(this.base))
  13674. var expectScroll = router.options.scrollBehavior
  13675. window.addEventListener('popstate', function (e) {
  13676. _key = e.state && e.state.key
  13677. var current = this$1.current
  13678. this$1.transitionTo(getLocation(this$1.base), function (next) {
  13679. if (expectScroll) {
  13680. this$1.handleScroll(next, current, true)
  13681. }
  13682. })
  13683. })
  13684. if (expectScroll) {
  13685. window.addEventListener('scroll', function () {
  13686. saveScrollPosition(_key)
  13687. })
  13688. }
  13689. }
  13690. if ( History ) HTML5History.__proto__ = History;
  13691. HTML5History.prototype = Object.create( History && History.prototype );
  13692. HTML5History.prototype.constructor = HTML5History;
  13693. HTML5History.prototype.go = function go (n) {
  13694. window.history.go(n)
  13695. };
  13696. HTML5History.prototype.push = function push (location) {
  13697. var this$1 = this;
  13698. var current = this.current
  13699. this.transitionTo(location, function (route) {
  13700. pushState(cleanPath(this$1.base + route.fullPath))
  13701. this$1.handleScroll(route, current, false)
  13702. })
  13703. };
  13704. HTML5History.prototype.replace = function replace (location) {
  13705. var this$1 = this;
  13706. var current = this.current
  13707. this.transitionTo(location, function (route) {
  13708. replaceState(cleanPath(this$1.base + route.fullPath))
  13709. this$1.handleScroll(route, current, false)
  13710. })
  13711. };
  13712. HTML5History.prototype.ensureURL = function ensureURL () {
  13713. if (getLocation(this.base) !== this.current.fullPath) {
  13714. replaceState(cleanPath(this.base + this.current.fullPath))
  13715. }
  13716. };
  13717. HTML5History.prototype.handleScroll = function handleScroll (to, from, isPop) {
  13718. var router = this.router
  13719. if (!router.app) {
  13720. return
  13721. }
  13722. var behavior = router.options.scrollBehavior
  13723. if (!behavior) {
  13724. return
  13725. }
  13726. assert(typeof behavior === 'function', "scrollBehavior must be a function")
  13727. // wait until re-render finishes before scrolling
  13728. router.app.$nextTick(function () {
  13729. var position = getScrollPosition(_key)
  13730. var shouldScroll = behavior(to, from, isPop ? position : null)
  13731. if (!shouldScroll) {
  13732. return
  13733. }
  13734. var isObject = typeof shouldScroll === 'object'
  13735. if (isObject && typeof shouldScroll.selector === 'string') {
  13736. var el = document.querySelector(shouldScroll.selector)
  13737. if (el) {
  13738. position = getElementPosition(el)
  13739. } else if (isValidPosition(shouldScroll)) {
  13740. position = normalizePosition(shouldScroll)
  13741. }
  13742. } else if (isObject && isValidPosition(shouldScroll)) {
  13743. position = normalizePosition(shouldScroll)
  13744. }
  13745. if (position) {
  13746. window.scrollTo(position.x, position.y)
  13747. }
  13748. })
  13749. };
  13750. return HTML5History;
  13751. }(History));
  13752. function getLocation (base) {
  13753. var path = window.location.pathname
  13754. if (base && path.indexOf(base) === 0) {
  13755. path = path.slice(base.length)
  13756. }
  13757. return (path || '/') + window.location.search + window.location.hash
  13758. }
  13759. function pushState (url, replace) {
  13760. // try...catch the pushState call to get around Safari
  13761. // DOM Exception 18 where it limits to 100 pushState calls
  13762. var history = window.history
  13763. try {
  13764. if (replace) {
  13765. history.replaceState({ key: _key }, '', url)
  13766. } else {
  13767. _key = genKey()
  13768. history.pushState({ key: _key }, '', url)
  13769. }
  13770. saveScrollPosition(_key)
  13771. } catch (e) {
  13772. window.location[replace ? 'assign' : 'replace'](url)
  13773. }
  13774. }
  13775. function replaceState (url) {
  13776. pushState(url, true)
  13777. }
  13778. /* */
  13779. var HashHistory = (function (History) {
  13780. function HashHistory (router, base, fallback) {
  13781. var this$1 = this;
  13782. History.call(this, router, base)
  13783. // check history fallback deeplinking
  13784. if (fallback && this.checkFallback()) {
  13785. return
  13786. }
  13787. ensureSlash()
  13788. this.transitionTo(getHash(), function () {
  13789. window.addEventListener('hashchange', function () {
  13790. this$1.onHashChange()
  13791. })
  13792. })
  13793. }
  13794. if ( History ) HashHistory.__proto__ = History;
  13795. HashHistory.prototype = Object.create( History && History.prototype );
  13796. HashHistory.prototype.constructor = HashHistory;
  13797. HashHistory.prototype.checkFallback = function checkFallback () {
  13798. var location = getLocation(this.base)
  13799. if (!/^\/#/.test(location)) {
  13800. window.location.replace(
  13801. cleanPath(this.base + '/#' + location)
  13802. )
  13803. return true
  13804. }
  13805. };
  13806. HashHistory.prototype.onHashChange = function onHashChange () {
  13807. if (!ensureSlash()) {
  13808. return
  13809. }
  13810. this.transitionTo(getHash(), function (route) {
  13811. replaceHash(route.fullPath)
  13812. })
  13813. };
  13814. HashHistory.prototype.push = function push (location) {
  13815. this.transitionTo(location, function (route) {
  13816. pushHash(route.fullPath)
  13817. })
  13818. };
  13819. HashHistory.prototype.replace = function replace (location) {
  13820. this.transitionTo(location, function (route) {
  13821. replaceHash(route.fullPath)
  13822. })
  13823. };
  13824. HashHistory.prototype.go = function go (n) {
  13825. window.history.go(n)
  13826. };
  13827. HashHistory.prototype.ensureURL = function ensureURL () {
  13828. if (getHash() !== this.current.fullPath) {
  13829. replaceHash(this.current.fullPath)
  13830. }
  13831. };
  13832. return HashHistory;
  13833. }(History));
  13834. function ensureSlash () {
  13835. var path = getHash()
  13836. if (path.charAt(0) === '/') {
  13837. return true
  13838. }
  13839. replaceHash('/' + path)
  13840. return false
  13841. }
  13842. function getHash () {
  13843. // We can't use window.location.hash here because it's not
  13844. // consistent across browsers - Firefox will pre-decode it!
  13845. var href = window.location.href
  13846. var index = href.indexOf('#')
  13847. return index === -1 ? '' : href.slice(index + 1)
  13848. }
  13849. function pushHash (path) {
  13850. window.location.hash = path
  13851. }
  13852. function replaceHash (path) {
  13853. var i = window.location.href.indexOf('#')
  13854. window.location.replace(
  13855. window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path
  13856. )
  13857. }
  13858. /* */
  13859. var AbstractHistory = (function (History) {
  13860. function AbstractHistory (router) {
  13861. History.call(this, router)
  13862. this.stack = []
  13863. this.index = -1
  13864. }
  13865. if ( History ) AbstractHistory.__proto__ = History;
  13866. AbstractHistory.prototype = Object.create( History && History.prototype );
  13867. AbstractHistory.prototype.constructor = AbstractHistory;
  13868. AbstractHistory.prototype.push = function push (location) {
  13869. var this$1 = this;
  13870. this.transitionTo(location, function (route) {
  13871. this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route)
  13872. this$1.index++
  13873. })
  13874. };
  13875. AbstractHistory.prototype.replace = function replace (location) {
  13876. var this$1 = this;
  13877. this.transitionTo(location, function (route) {
  13878. this$1.stack = this$1.stack.slice(0, this$1.index).concat(route)
  13879. })
  13880. };
  13881. AbstractHistory.prototype.go = function go (n) {
  13882. var this$1 = this;
  13883. var targetIndex = this.index + n
  13884. if (targetIndex < 0 || targetIndex >= this.stack.length) {
  13885. return
  13886. }
  13887. var route = this.stack[targetIndex]
  13888. this.confirmTransition(route, function () {
  13889. this$1.index = targetIndex
  13890. this$1.updateRoute(route)
  13891. })
  13892. };
  13893. AbstractHistory.prototype.ensureURL = function ensureURL () {
  13894. // noop
  13895. };
  13896. return AbstractHistory;
  13897. }(History));
  13898. /* */
  13899. var VueRouter = function VueRouter (options) {
  13900. if ( options === void 0 ) options = {};
  13901. this.app = null
  13902. this.options = options
  13903. this.beforeHooks = []
  13904. this.afterHooks = []
  13905. this.match = createMatcher(options.routes || [])
  13906. var mode = options.mode || 'hash'
  13907. this.fallback = mode === 'history' && !supportsHistory
  13908. if (this.fallback) {
  13909. mode = 'hash'
  13910. }
  13911. if (!inBrowser) {
  13912. mode = 'abstract'
  13913. }
  13914. this.mode = mode
  13915. };
  13916. var prototypeAccessors = { currentRoute: {} };
  13917. prototypeAccessors.currentRoute.get = function () {
  13918. return this.history && this.history.current
  13919. };
  13920. VueRouter.prototype.init = function init (app /* Vue component instance */) {
  13921. var this$1 = this;
  13922. assert(
  13923. install.installed,
  13924. "not installed. Make sure to call `Vue.use(VueRouter)` " +
  13925. "before creating root instance."
  13926. )
  13927. this.app = app
  13928. var ref = this;
  13929. var mode = ref.mode;
  13930. var options = ref.options;
  13931. var fallback = ref.fallback;
  13932. switch (mode) {
  13933. case 'history':
  13934. this.history = new HTML5History(this, options.base)
  13935. break
  13936. case 'hash':
  13937. this.history = new HashHistory(this, options.base, fallback)
  13938. break
  13939. case 'abstract':
  13940. this.history = new AbstractHistory(this)
  13941. break
  13942. default:
  13943. assert(false, ("invalid mode: " + mode))
  13944. }
  13945. this.history.listen(function (route) {
  13946. this$1.app._route = route
  13947. })
  13948. };
  13949. VueRouter.prototype.beforeEach = function beforeEach (fn) {
  13950. this.beforeHooks.push(fn)
  13951. };
  13952. VueRouter.prototype.afterEach = function afterEach (fn) {
  13953. this.afterHooks.push(fn)
  13954. };
  13955. VueRouter.prototype.push = function push (location) {
  13956. this.history.push(location)
  13957. };
  13958. VueRouter.prototype.replace = function replace (location) {
  13959. this.history.replace(location)
  13960. };
  13961. VueRouter.prototype.go = function go (n) {
  13962. this.history.go(n)
  13963. };
  13964. VueRouter.prototype.back = function back () {
  13965. this.go(-1)
  13966. };
  13967. VueRouter.prototype.forward = function forward () {
  13968. this.go(1)
  13969. };
  13970. VueRouter.prototype.getMatchedComponents = function getMatchedComponents () {
  13971. if (!this.currentRoute) {
  13972. return []
  13973. }
  13974. return [].concat.apply([], this.currentRoute.matched.map(function (m) {
  13975. return Object.keys(m.components).map(function (key) {
  13976. return m.components[key]
  13977. })
  13978. }))
  13979. };
  13980. Object.defineProperties( VueRouter.prototype, prototypeAccessors );
  13981. VueRouter.install = install
  13982. if (inBrowser && window.Vue) {
  13983. window.Vue.use(VueRouter)
  13984. }
  13985. return VueRouter;
  13986. })));
  13987. /***/ },
  13988. /* 304 */
  13989. /***/ function(module, exports, __webpack_require__) {
  13990. // style-loader: Adds some css to the DOM by adding a <style> tag
  13991. // load the styles
  13992. var content = __webpack_require__(217);
  13993. if(typeof content === 'string') content = [[module.i, content, '']];
  13994. // add the styles to the DOM
  13995. var update = __webpack_require__(20)(content, {});
  13996. if(content.locals) module.exports = content.locals;
  13997. // Hot Module Replacement
  13998. if(false) {
  13999. // When the styles change, update the <style> tags
  14000. if(!content.locals) {
  14001. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-28c275d9!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Fingerprint.vue", function() {
  14002. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-28c275d9!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Fingerprint.vue");
  14003. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  14004. update(newContent);
  14005. });
  14006. }
  14007. // When the module is disposed, remove the <style> tags
  14008. module.hot.dispose(function() { update(); });
  14009. }
  14010. /***/ },
  14011. /* 305 */
  14012. /***/ function(module, exports, __webpack_require__) {
  14013. // style-loader: Adds some css to the DOM by adding a <style> tag
  14014. // load the styles
  14015. var content = __webpack_require__(218);
  14016. if(typeof content === 'string') content = [[module.i, content, '']];
  14017. // add the styles to the DOM
  14018. var update = __webpack_require__(20)(content, {});
  14019. if(content.locals) module.exports = content.locals;
  14020. // Hot Module Replacement
  14021. if(false) {
  14022. // When the styles change, update the <style> tags
  14023. if(!content.locals) {
  14024. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-3e659d19!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Passwords.vue", function() {
  14025. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-3e659d19!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Passwords.vue");
  14026. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  14027. update(newContent);
  14028. });
  14029. }
  14030. // When the module is disposed, remove the <style> tags
  14031. module.hot.dispose(function() { update(); });
  14032. }
  14033. /***/ },
  14034. /* 306 */
  14035. /***/ function(module, exports, __webpack_require__) {
  14036. // style-loader: Adds some css to the DOM by adding a <style> tag
  14037. // load the styles
  14038. var content = __webpack_require__(219);
  14039. if(typeof content === 'string') content = [[module.i, content, '']];
  14040. // add the styles to the DOM
  14041. var update = __webpack_require__(20)(content, {});
  14042. if(content.locals) module.exports = content.locals;
  14043. // Hot Module Replacement
  14044. if(false) {
  14045. // When the styles change, update the <style> tags
  14046. if(!content.locals) {
  14047. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-4e146d4e!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./PasswordGenerator.vue", function() {
  14048. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-4e146d4e!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./PasswordGenerator.vue");
  14049. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  14050. update(newContent);
  14051. });
  14052. }
  14053. // When the module is disposed, remove the <style> tags
  14054. module.hot.dispose(function() { update(); });
  14055. }
  14056. /***/ },
  14057. /* 307 */
  14058. /***/ function(module, exports, __webpack_require__) {
  14059. // style-loader: Adds some css to the DOM by adding a <style> tag
  14060. // load the styles
  14061. var content = __webpack_require__(220);
  14062. if(typeof content === 'string') content = [[module.i, content, '']];
  14063. // add the styles to the DOM
  14064. var update = __webpack_require__(20)(content, {});
  14065. if(content.locals) module.exports = content.locals;
  14066. // Hot Module Replacement
  14067. if(false) {
  14068. // When the styles change, update the <style> tags
  14069. if(!content.locals) {
  14070. module.hot.accept("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-7d2a5ef8!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./LessPass.vue", function() {
  14071. var newContent = require("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-7d2a5ef8!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./LessPass.vue");
  14072. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  14073. update(newContent);
  14074. });
  14075. }
  14076. // When the module is disposed, remove the <style> tags
  14077. module.hot.dispose(function() { update(); });
  14078. }
  14079. /***/ },
  14080. /* 308 */
  14081. /***/ function(module, exports, __webpack_require__) {
  14082. // style-loader: Adds some css to the DOM by adding a <style> tag
  14083. // load the styles
  14084. var content = __webpack_require__(221);
  14085. if(typeof content === 'string') content = [[module.i, content, '']];
  14086. // add the styles to the DOM
  14087. var update = __webpack_require__(20)(content, {});
  14088. if(content.locals) module.exports = content.locals;
  14089. // Hot Module Replacement
  14090. if(false) {
  14091. // When the styles change, update the <style> tags
  14092. if(!content.locals) {
  14093. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-e2e1cfd0!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DeleteButton.vue", function() {
  14094. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-e2e1cfd0!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DeleteButton.vue");
  14095. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  14096. update(newContent);
  14097. });
  14098. }
  14099. // When the module is disposed, remove the <style> tags
  14100. module.hot.dispose(function() { update(); });
  14101. }
  14102. /***/ },
  14103. /* 309 */
  14104. /***/ function(module, exports, __webpack_require__) {
  14105. // style-loader: Adds some css to the DOM by adding a <style> tag
  14106. // load the styles
  14107. var content = __webpack_require__(222);
  14108. if(typeof content === 'string') content = [[module.i, content, '']];
  14109. // add the styles to the DOM
  14110. var update = __webpack_require__(20)(content, {});
  14111. if(content.locals) module.exports = content.locals;
  14112. // Hot Module Replacement
  14113. if(false) {
  14114. // When the styles change, update the <style> tags
  14115. if(!content.locals) {
  14116. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-eabada8c!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Menu.vue", function() {
  14117. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-eabada8c!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Menu.vue");
  14118. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  14119. update(newContent);
  14120. });
  14121. }
  14122. // When the module is disposed, remove the <style> tags
  14123. module.hot.dispose(function() { update(); });
  14124. }
  14125. /***/ },
  14126. /* 310 */,
  14127. /* 311 */,
  14128. /* 312 */,
  14129. /* 313 */
  14130. /***/ function(module, exports, __webpack_require__) {
  14131. "use strict";
  14132. 'use strict';
  14133. var _vue = __webpack_require__(47);
  14134. var _vue2 = _interopRequireDefault(_vue);
  14135. __webpack_require__(121);
  14136. __webpack_require__(122);
  14137. __webpack_require__(123);
  14138. var _LessPass = __webpack_require__(124);
  14139. var _LessPass2 = _interopRequireDefault(_LessPass);
  14140. var _store = __webpack_require__(120);
  14141. var _store2 = _interopRequireDefault(_store);
  14142. var _router = __webpack_require__(119);
  14143. var _router2 = _interopRequireDefault(_router);
  14144. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14145. new _vue2.default({
  14146. el: '#lesspass',
  14147. store: _store2.default,
  14148. router: _router2.default,
  14149. render: function render(h) {
  14150. return h(_LessPass2.default);
  14151. }
  14152. });
  14153. /***/ }
  14154. ],[313]);