UNPKG

vue-autocomplete-vee-validate-js

Version:
1 lines 419 kB
!function(n){function e(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return n[r].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var t={};e.m=n,e.c=t,e.i=function(n){return n},e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:r})},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},e.p="/build/",e(e.s=6)}([function(module,exports){eval("/* globals __VUE_SSR_CONTEXT__ */\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = injectStyles\n }\n\n if (hook) {\n var functional = options.functional\n var existing = functional\n ? options.render\n : options.beforeCreate\n if (!functional) {\n // inject component registration as beforeCreate hook\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n } else {\n // register for functioal component in vue file\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return existing(h, context)\n }\n }\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/component-normalizer.js\n// module id = 0\n// module chunks = 0\n\n//# sourceURL=webpack:///./~/vue-loader/lib/component-normalizer.js?")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval("/* unused harmony export install */\n/* unused harmony export use */\n/* unused harmony export directive */\n/* unused harmony export mixin */\n/* unused harmony export mapFields */\n/* unused harmony export Validator */\n/* unused harmony export ErrorBag */\n/* unused harmony export Rules */\n/* unused harmony export ErrorComponent */\n/* unused harmony export version */\n/**\n * vee-validate v2.0.9\n * (c) 2018 Abdelrahman Awad\n * @license MIT\n */\nvar supportsPassive = true;\nvar detectPassiveSupport = function () {\n try {\n var opts = Object.defineProperty({}, 'passive', {\n get: function get() {\n supportsPassive = true;\n }\n });\n window.addEventListener('testPassive', null, opts);\n window.removeEventListener('testPassive', null, opts);\n } catch (e) {\n supportsPassive = false;\n }\n return supportsPassive;\n};\nvar addEventListener = function (el, eventName, cb) {\n el.addEventListener(eventName, cb, supportsPassive ? {\n passive: true\n } : false);\n};\nvar isTextInput = function (el) { return ['text','number','password','search','email','tel',\n 'url','textarea'].indexOf(el.type) !== -1; };\nvar isCheckboxOrRadioInput = function (el) { return ['radio','checkbox'].indexOf(el.type) !== -1; };\nvar getDataAttribute = function (el, name) { return el.getAttribute((\"data-vv-\" + name)); };\nvar isNullOrUndefined = function (value) { return value === null || value === undefined; };\nvar createFlags = function () { return ({\n untouched: true,\n touched: false,\n dirty: false,\n pristine: true,\n valid: null,\n invalid: null,\n validated: false,\n pending: false,\n required: false,\n changed: false\n}); };\nvar isEqual = function (lhs, rhs) {\n if (lhs instanceof RegExp && rhs instanceof RegExp) {\n return isEqual(lhs.source, rhs.source) && isEqual(lhs.flags, rhs.flags);\n }\n if (Array.isArray(lhs) && Array.isArray(rhs)) {\n if (lhs.length !== rhs.length) \n { return false; }\n for (var i = 0;i < lhs.length; i++) {\n if (!isEqual(lhs[i], rhs[i])) {\n return false;\n }\n }\n return true;\n }\n if (isObject(lhs) && isObject(rhs)) {\n return Object.keys(lhs).every(function (key) { return isEqual(lhs[key], rhs[key]); }) && Object.keys(rhs).every(function (key) { return isEqual(lhs[key], rhs[key]); });\n }\n return lhs === rhs;\n};\nvar getScope = function (el) {\n var scope = getDataAttribute(el, 'scope');\n if (isNullOrUndefined(scope)) {\n var form = getForm(el);\n if (form) {\n scope = getDataAttribute(form, 'scope');\n }\n }\n return !isNullOrUndefined(scope) ? scope : null;\n};\nvar getForm = function (el) {\n if (isNullOrUndefined(el)) \n { return null; }\n if (el.tagName === \"FORM\") \n { return el; }\n if (!isNullOrUndefined(el.form)) \n { return el.form; }\n return !isNullOrUndefined(el.parentNode) ? getForm(el.parentNode) : null;\n};\nvar getPath = function (path, target, def) {\n if ( def === void 0 ) def = undefined;\n\n if (!path || !target) \n { return def; }\n var value = target;\n path.split('.').every(function (prop) {\n if (!Object.prototype.hasOwnProperty.call(value, prop) && value[prop] === undefined) {\n value = def;\n return false;\n }\n value = value[prop];\n return true;\n });\n return value;\n};\nvar hasPath = function (path, target) {\n var obj = target;\n return path.split('.').every(function (prop) {\n if (!Object.prototype.hasOwnProperty.call(obj, prop)) {\n return false;\n }\n obj = obj[prop];\n return true;\n });\n};\nvar parseRule = function (rule) {\n var params = [];\n var name = rule.split(':')[0];\n if (~rule.indexOf(':')) {\n params = rule.split(':').slice(1).join(':').split(',');\n }\n return {\n name: name,\n params: params\n };\n};\nvar debounce = function (fn, wait, immediate, token) {\n if ( wait === void 0 ) wait = 0;\n if ( immediate === void 0 ) immediate = false;\n if ( token === void 0 ) token = {\n cancelled: false\n};\n\n if (wait === 0) {\n return fn;\n }\n var timeout;\n return function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var later = function () {\n timeout = null;\n if (!immediate && !token.cancelled) \n { fn.apply(void 0, args); }\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) \n { fn.apply(void 0, args); }\n };\n};\nvar normalizeRules = function (rules) {\n if (!rules) {\n return {};\n }\n if (isObject(rules)) {\n return Object.keys(rules).reduce(function (prev, curr) {\n var params = [];\n if (rules[curr] === true) {\n params = [];\n } else if (Array.isArray(rules[curr])) {\n params = rules[curr];\n } else {\n params = [rules[curr]];\n }\n if (rules[curr] !== false) {\n prev[curr] = params;\n }\n return prev;\n }, {});\n }\n if (typeof rules !== 'string') {\n warn('rules must be either a string or an object.');\n return {};\n }\n return rules.split('|').reduce(function (prev, rule) {\n var parsedRule = parseRule(rule);\n if (!parsedRule.name) {\n return prev;\n }\n prev[parsedRule.name] = parsedRule.params;\n return prev;\n }, {});\n};\nvar warn = function (message) {\n console.warn((\"[vee-validate] \" + message));\n};\nvar createError = function (message) { return new Error((\"[vee-validate] \" + message)); };\nvar isObject = function (obj) { return obj !== null && obj && typeof obj === 'object' && !Array.isArray(obj); };\nvar isCallable = function (func) { return typeof func === 'function'; };\nvar hasClass = function (el, className) {\n if (el.classList) {\n return el.classList.contains(className);\n }\n return !(!el.className.match(new RegExp((\"(\\\\s|^)\" + className + \"(\\\\s|$)\"))));\n};\nvar addClass = function (el, className) {\n if (el.classList) {\n el.classList.add(className);\n return;\n }\n if (!hasClass(el, className)) {\n el.className += \" \" + className;\n }\n};\nvar removeClass = function (el, className) {\n if (el.classList) {\n el.classList.remove(className);\n return;\n }\n if (hasClass(el, className)) {\n var reg = new RegExp((\"(\\\\s|^)\" + className + \"(\\\\s|$)\"));\n el.className = el.className.replace(reg, ' ');\n }\n};\nvar toggleClass = function (el, className, status) {\n if (!el || !className) \n { return; }\n if (Array.isArray(className)) {\n className.forEach(function (item) { return toggleClass(el, item, status); });\n return;\n }\n if (status) {\n return addClass(el, className);\n }\n removeClass(el, className);\n};\nvar toArray = function (arrayLike) {\n if (isCallable(Array.from)) {\n return Array.from(arrayLike);\n }\n var array = [];\n var length = arrayLike.length;\n for (var i = 0;i < length; i++) {\n array.push(arrayLike[i]);\n }\n return array;\n};\nvar assign = function (target) {\n var others = [], len = arguments.length - 1;\n while ( len-- > 0 ) others[ len ] = arguments[ len + 1 ];\n\n if (isCallable(Object.assign)) {\n return Object.assign.apply(Object, [ target ].concat( others ));\n }\n if (target == null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n var to = Object(target);\n others.forEach(function (arg) {\n if (arg != null) {\n Object.keys(arg).forEach(function (key) {\n to[key] = arg[key];\n });\n }\n });\n return to;\n};\nvar id = 0;\nvar idTemplate = '{id}';\nvar uniqId = function () {\n if (id >= 9999) {\n id = 0;\n idTemplate = idTemplate.replace('{id}', '_{id}');\n }\n id++;\n var newId = idTemplate.replace('{id}', String(id));\n return newId;\n};\nvar find = function (arrayLike, predicate) {\n var array = Array.isArray(arrayLike) ? arrayLike : toArray(arrayLike);\n for (var i = 0;i < array.length; i++) {\n if (predicate(array[i])) {\n return array[i];\n }\n }\n return undefined;\n};\nvar isBuiltInComponent = function (vnode) {\n if (!vnode) {\n return false;\n }\n var tag = vnode.componentOptions.tag;\n return /keep-alive|transition|transition-group/.test(tag);\n};\nvar makeEventsArray = function (events) { return typeof events === 'string' && events.length ? events.split('|') : []; };\nvar makeDelayObject = function (events, delay, delayConfig) {\n if (typeof delay === 'number') {\n return events.reduce(function (prev, e) {\n prev[e] = delay;\n return prev;\n }, {});\n }\n return events.reduce(function (prev, e) {\n if (typeof delay === 'object' && e in delay) {\n prev[e] = delay[e];\n return prev;\n }\n if (typeof delayConfig === 'number') {\n prev[e] = delayConfig;\n return prev;\n }\n prev[e] = delayConfig && delayConfig[e] || 0;\n return prev;\n }, {});\n};\nvar deepParseInt = function (input) {\n if (typeof input === 'number') \n { return input; }\n if (typeof input === 'string') \n { return parseInt(input); }\n var map = {};\n for (var element in input) {\n map[element] = parseInt(input[element]);\n }\n return map;\n};\nvar merge = function (target, source) {\n if (!(isObject(target) && isObject(source))) {\n return target;\n }\n Object.keys(source).forEach(function (key) {\n var obj, obj$1;\n\n if (isObject(source[key])) {\n if (!target[key]) {\n assign(target, ( obj = {}, obj[key] = {}, obj ));\n }\n merge(target[key], source[key]);\n return;\n }\n assign(target, ( obj$1 = {}, obj$1[key] = source[key], obj$1 ));\n });\n return target;\n};\n\nvar ErrorBag = function ErrorBag() {\n this.items = [];\n};\nErrorBag.prototype[typeof Symbol === 'function' ? Symbol.iterator : '@@iterator'] = function () {\n var this$1 = this;\n\n var index = 0;\n return {\n next: function () { return ({\n value: this$1.items[index++],\n done: index > this$1.items.length\n }); }\n };\n};\nErrorBag.prototype.add = function add (error) {\n var ref;\n\n if (arguments.length > 1) {\n error = {\n field: arguments[0],\n msg: arguments[1],\n rule: arguments[2],\n scope: !isNullOrUndefined(arguments[3]) ? arguments[3] : null,\n regenerate: null\n };\n }\n (ref = this.items).push.apply(ref, this._normalizeError(error));\n};\nErrorBag.prototype._normalizeError = function _normalizeError (error) {\n if (Array.isArray(error)) {\n return error.map(function (e) {\n e.scope = !isNullOrUndefined(e.scope) ? e.scope : null;\n return e;\n });\n }\n error.scope = !isNullOrUndefined(error.scope) ? error.scope : null;\n return [error];\n};\nErrorBag.prototype.regenerate = function regenerate () {\n this.items.forEach(function (i) {\n i.msg = isCallable(i.regenerate) ? i.regenerate() : i.msg;\n });\n};\nErrorBag.prototype.update = function update (id, error) {\n var item = find(this.items, function (i) { return i.id === id; });\n if (!item) {\n return;\n }\n var idx = this.items.indexOf(item);\n this.items.splice(idx, 1);\n item.scope = error.scope;\n this.items.push(item);\n};\nErrorBag.prototype.all = function all (scope) {\n if (isNullOrUndefined(scope)) {\n return this.items.map(function (e) { return e.msg; });\n }\n return this.items.filter(function (e) { return e.scope === scope; }).map(function (e) { return e.msg; });\n};\nErrorBag.prototype.any = function any (scope) {\n if (isNullOrUndefined(scope)) {\n return !(!this.items.length);\n }\n return !(!this.items.filter(function (e) { return e.scope === scope; }).length);\n};\nErrorBag.prototype.clear = function clear (scope) {\n var this$1 = this;\n\n if (isNullOrUndefined(scope)) {\n scope = null;\n }\n for (var i = 0;i < this.items.length; ++i) {\n if (this$1.items[i].scope === scope) {\n this$1.items.splice(i, 1);\n --i;\n }\n }\n};\nErrorBag.prototype.collect = function collect (field, scope, map) {\n if ( map === void 0 ) map = true;\n\n if (!field) {\n var collection = {};\n this.items.forEach(function (e) {\n if (!collection[e.field]) {\n collection[e.field] = [];\n }\n collection[e.field].push(map ? e.msg : e);\n });\n return collection;\n }\n field = !isNullOrUndefined(field) ? String(field) : field;\n if (isNullOrUndefined(scope)) {\n return this.items.filter(function (e) { return e.field === field; }).map(function (e) { return map ? e.msg : e; });\n }\n return this.items.filter(function (e) { return e.field === field && e.scope === scope; }).map(function (e) { return map ? e.msg : e; });\n};\nErrorBag.prototype.count = function count () {\n return this.items.length;\n};\nErrorBag.prototype.firstById = function firstById (id) {\n var error = find(this.items, function (i) { return i.id === id; });\n return error ? error.msg : null;\n};\nErrorBag.prototype.first = function first (field, scope) {\n var this$1 = this;\n if ( scope === void 0 ) scope = null;\n\n if (isNullOrUndefined(field)) {\n return null;\n }\n field = String(field);\n var selector = this._selector(field);\n var scoped = this._scope(field);\n if (scoped) {\n var result = this.first(scoped.name, scoped.scope);\n if (result) {\n return result;\n }\n }\n if (selector) {\n return this.firstByRule(selector.name, selector.rule, scope);\n }\n for (var i = 0;i < this.items.length; ++i) {\n if (this$1.items[i].field === field && this$1.items[i].scope === scope) {\n return this$1.items[i].msg;\n }\n }\n return null;\n};\nErrorBag.prototype.firstRule = function firstRule (field, scope) {\n var errors = this.collect(field, scope, false);\n return errors.length && errors[0].rule || null;\n};\nErrorBag.prototype.has = function has (field, scope) {\n if ( scope === void 0 ) scope = null;\n\n return !(!this.first(field, scope));\n};\nErrorBag.prototype.firstByRule = function firstByRule (name, rule, scope) {\n if ( scope === void 0 ) scope = null;\n\n var error = this.collect(name, scope, false).filter(function (e) { return e.rule === rule; })[0];\n return error && error.msg || null;\n};\nErrorBag.prototype.firstNot = function firstNot (name, rule, scope) {\n if ( rule === void 0 ) rule = 'required';\n if ( scope === void 0 ) scope = null;\n\n var error = this.collect(name, scope, false).filter(function (e) { return e.rule !== rule; })[0];\n return error && error.msg || null;\n};\nErrorBag.prototype.removeById = function removeById (id) {\n var this$1 = this;\n\n if (Array.isArray(id)) {\n this.items = this.items.filter(function (i) { return id.indexOf(i.id) === -1; });\n return;\n }\n for (var i = 0;i < this.items.length; ++i) {\n if (this$1.items[i].id === id) {\n this$1.items.splice(i, 1);\n --i;\n }\n }\n};\nErrorBag.prototype.remove = function remove (field, scope) {\n var this$1 = this;\n\n field = !isNullOrUndefined(field) ? String(field) : field;\n var removeCondition = function (e) {\n if (!isNullOrUndefined(scope)) {\n return e.field === field && e.scope === scope;\n }\n return e.field === field && e.scope === null;\n };\n for (var i = 0;i < this.items.length; ++i) {\n if (removeCondition(this$1.items[i])) {\n this$1.items.splice(i, 1);\n --i;\n }\n }\n};\nErrorBag.prototype._selector = function _selector (field) {\n if (field.indexOf(':') > -1) {\n var ref = field.split(':');\n var name = ref[0];\n var rule = ref[1];\n return {\n name: name,\n rule: rule\n };\n }\n return null;\n};\nErrorBag.prototype._scope = function _scope (field) {\n if (field.indexOf('.') > -1) {\n var ref = field.split('.');\n var scope = ref[0];\n var name = ref.slice(1);\n return {\n name: name.join('.'),\n scope: scope\n };\n }\n return null;\n};\n\nvar LOCALE = 'en';\nvar Dictionary = function Dictionary(dictionary) {\n if ( dictionary === void 0 ) dictionary = {};\n\n this.container = {};\n this.merge(dictionary);\n};\n\nvar prototypeAccessors = { locale: { configurable: true } };\nprototypeAccessors.locale.get = function () {\n return LOCALE;\n};\nprototypeAccessors.locale.set = function (value) {\n LOCALE = value || 'en';\n};\nDictionary.prototype.hasLocale = function hasLocale (locale) {\n return !(!this.container[locale]);\n};\nDictionary.prototype.setDateFormat = function setDateFormat (locale, format) {\n if (!this.container[locale]) {\n this.container[locale] = {};\n }\n this.container[locale].dateFormat = format;\n};\nDictionary.prototype.getDateFormat = function getDateFormat (locale) {\n if (!this.container[locale] || !this.container[locale].dateFormat) {\n return null;\n }\n return this.container[locale].dateFormat;\n};\nDictionary.prototype.getMessage = function getMessage (locale, key, data) {\n var message = null;\n if (!this.hasMessage(locale, key)) {\n message = this._getDefaultMessage(locale);\n } else {\n message = this.container[locale].messages[key];\n }\n return isCallable(message) ? message.apply(void 0, data) : message;\n};\nDictionary.prototype.getFieldMessage = function getFieldMessage (locale, field, key, data) {\n if (!this.hasLocale(locale)) {\n return this.getMessage(locale, key, data);\n }\n var dict = this.container[locale].custom && this.container[locale].custom[field];\n if (!dict || !dict[key]) {\n return this.getMessage(locale, key, data);\n }\n var message = dict[key];\n return isCallable(message) ? message.apply(void 0, data) : message;\n};\nDictionary.prototype._getDefaultMessage = function _getDefaultMessage (locale) {\n if (this.hasMessage(locale, '_default')) {\n return this.container[locale].messages._default;\n }\n return this.container.en.messages._default;\n};\nDictionary.prototype.getAttribute = function getAttribute (locale, key, fallback) {\n if ( fallback === void 0 ) fallback = '';\n\n if (!this.hasAttribute(locale, key)) {\n return fallback;\n }\n return this.container[locale].attributes[key];\n};\nDictionary.prototype.hasMessage = function hasMessage (locale, key) {\n return !(!(this.hasLocale(locale) && this.container[locale].messages && this.container[locale].messages[key]));\n};\nDictionary.prototype.hasAttribute = function hasAttribute (locale, key) {\n return !(!(this.hasLocale(locale) && this.container[locale].attributes && this.container[locale].attributes[key]));\n};\nDictionary.prototype.merge = function merge$1 (dictionary) {\n merge(this.container, dictionary);\n};\nDictionary.prototype.setMessage = function setMessage (locale, key, message) {\n if (!this.hasLocale(locale)) {\n this.container[locale] = {\n messages: {},\n attributes: {}\n };\n }\n this.container[locale].messages[key] = message;\n};\nDictionary.prototype.setAttribute = function setAttribute (locale, key, attribute) {\n if (!this.hasLocale(locale)) {\n this.container[locale] = {\n messages: {},\n attributes: {}\n };\n }\n this.container[locale].attributes[key] = attribute;\n};\n\nObject.defineProperties( Dictionary.prototype, prototypeAccessors );\n\nvar normalizeValue = function (value) {\n if (isObject(value)) {\n return Object.keys(value).reduce(function (prev, key) {\n prev[key] = normalizeValue(value[key]);\n return prev;\n }, {});\n }\n if (isCallable(value)) {\n return value('{0}', ['{1}','{2}','{3}']);\n }\n return value;\n};\nvar normalizeFormat = function (locale) {\n var messages = normalizeValue(locale.messages);\n var custom = normalizeValue(locale.custom);\n return {\n messages: messages,\n custom: custom,\n attributes: locale.attributes,\n dateFormat: locale.dateFormat\n };\n};\nvar I18nDictionary = function I18nDictionary(i18n, rootKey) {\n this.i18n = i18n;\n this.rootKey = rootKey;\n};\n\nvar prototypeAccessors$1 = { locale: { configurable: true } };\nprototypeAccessors$1.locale.get = function () {\n return this.i18n.locale;\n};\nprototypeAccessors$1.locale.set = function (value) {\n warn('Cannot set locale from the validator when using vue-i18n, use i18n.locale setter instead');\n};\nI18nDictionary.prototype.getDateFormat = function getDateFormat (locale) {\n return this.i18n.getDateTimeFormat(locale || this.locale);\n};\nI18nDictionary.prototype.setDateFormat = function setDateFormat (locale, value) {\n this.i18n.setDateTimeFormat(locale || this.locale, value);\n};\nI18nDictionary.prototype.getMessage = function getMessage (locale, key, data) {\n var path = (this.rootKey) + \".messages.\" + key;\n if (!this.i18n.te(path)) {\n return this.i18n.t(((this.rootKey) + \".messages._default\"), locale, data);\n }\n return this.i18n.t(path, locale, data);\n};\nI18nDictionary.prototype.getAttribute = function getAttribute (locale, key, fallback) {\n if ( fallback === void 0 ) fallback = '';\n\n var path = (this.rootKey) + \".attributes.\" + key;\n if (!this.i18n.te(path)) {\n return fallback;\n }\n return this.i18n.t(path, locale);\n};\nI18nDictionary.prototype.getFieldMessage = function getFieldMessage (locale, field, key, data) {\n var path = (this.rootKey) + \".custom.\" + field + \".\" + key;\n if (this.i18n.te(path)) {\n return this.i18n.t(path);\n }\n return this.getMessage(locale, key, data);\n};\nI18nDictionary.prototype.merge = function merge$1 (dictionary) {\n var this$1 = this;\n\n Object.keys(dictionary).forEach(function (localeKey) {\n var obj;\n\n var clone = merge({}, getPath((localeKey + \".\" + (this$1.rootKey)), this$1.i18n.messages, {}));\n var locale = merge(clone, normalizeFormat(dictionary[localeKey]));\n this$1.i18n.mergeLocaleMessage(localeKey, ( obj = {}, obj[this$1.rootKey] = locale, obj ));\n if (locale.dateFormat) {\n this$1.i18n.setDateTimeFormat(localeKey, locale.dateFormat);\n }\n });\n};\nI18nDictionary.prototype.setMessage = function setMessage (locale, key, value) {\n var obj, obj$1;\n\n this.merge(( obj$1 = {}, obj$1[locale] = {\n messages: ( obj = {}, obj[key] = value, obj )\n }, obj$1 ));\n};\nI18nDictionary.prototype.setAttribute = function setAttribute (locale, key, value) {\n var obj, obj$1;\n\n this.merge(( obj$1 = {}, obj$1[locale] = {\n attributes: ( obj = {}, obj[key] = value, obj )\n }, obj$1 ));\n};\n\nObject.defineProperties( I18nDictionary.prototype, prototypeAccessors$1 );\n\nvar defaultConfig = {\n locale: 'en',\n delay: 0,\n errorBagName: 'errors',\n dictionary: null,\n strict: true,\n fieldsBagName: 'fields',\n classes: false,\n classNames: null,\n events: 'input|blur',\n inject: true,\n fastExit: true,\n aria: true,\n validity: false,\n i18n: null,\n i18nRootKey: 'validation'\n};\nvar currentConfig = assign({}, defaultConfig);\nvar dependencies = {\n dictionary: new Dictionary({\n en: {\n messages: {},\n attributes: {},\n custom: {}\n }\n })\n};\nvar Config = function Config () {};\n\nvar staticAccessors = { default: { configurable: true },current: { configurable: true } };\n\nstaticAccessors.default.get = function () {\n return defaultConfig;\n};\nstaticAccessors.current.get = function () {\n return currentConfig;\n};\nConfig.dependency = function dependency (key) {\n return dependencies[key];\n};\nConfig.merge = function merge$$1 (config) {\n currentConfig = assign({}, currentConfig, config);\n if (currentConfig.i18n) {\n Config.register('dictionary', new I18nDictionary(currentConfig.i18n, currentConfig.i18nRootKey));\n }\n};\nConfig.register = function register (key, value) {\n dependencies[key] = value;\n};\nConfig.resolve = function resolve (context) {\n var selfConfig = getPath('$options.$_veeValidate', context, {});\n return assign({}, Config.current, selfConfig);\n};\n\nObject.defineProperties( Config, staticAccessors );\n\nvar Generator = function Generator () {};\n\nGenerator.generate = function generate (el, binding, vnode) {\n var model = Generator.resolveModel(binding, vnode);\n var options = Config.resolve(vnode.context);\n return {\n name: Generator.resolveName(el, vnode),\n el: el,\n listen: !binding.modifiers.disable,\n scope: Generator.resolveScope(el, binding, vnode),\n vm: Generator.makeVM(vnode.context),\n expression: binding.value,\n component: vnode.componentInstance,\n classes: options.classes,\n classNames: options.classNames,\n getter: Generator.resolveGetter(el, vnode, model),\n events: Generator.resolveEvents(el, vnode) || options.events,\n model: model,\n delay: Generator.resolveDelay(el, vnode, options),\n rules: Generator.resolveRules(el, binding),\n initial: !(!binding.modifiers.initial),\n validity: options.validity,\n aria: options.aria,\n initialValue: Generator.resolveInitialValue(vnode)\n };\n};\nGenerator.getCtorConfig = function getCtorConfig (vnode) {\n if (!vnode.componentInstance) \n { return null; }\n var config = getPath('componentInstance.$options.$_veeValidate', vnode);\n return config;\n};\nGenerator.resolveRules = function resolveRules (el, binding) {\n if (!binding.value && (!binding || !binding.expression)) {\n return getDataAttribute(el, 'rules');\n }\n if (binding.value && ~['string','object'].indexOf(typeof binding.value.rules)) {\n return binding.value.rules;\n }\n return binding.value;\n};\nGenerator.resolveInitialValue = function resolveInitialValue (vnode) {\n var model = vnode.data.model || find(vnode.data.directives, function (d) { return d.name === 'model'; });\n return model && model.value;\n};\nGenerator.makeVM = function makeVM (vm) {\n return {\n get $el() {\n return vm.$el;\n },\n get $refs() {\n return vm.$refs;\n },\n $watch: vm.$watch ? vm.$watch.bind(vm) : function () {},\n $validator: vm.$validator ? {\n errors: vm.$validator.errors,\n validate: vm.$validator.validate.bind(vm.$validator),\n update: vm.$validator.update.bind(vm.$validator)\n } : null\n };\n};\nGenerator.resolveDelay = function resolveDelay (el, vnode, options) {\n var delay = getDataAttribute(el, 'delay');\n var globalDelay = options && 'delay' in options ? options.delay : 0;\n if (!delay && vnode.componentInstance && vnode.componentInstance.$attrs) {\n delay = vnode.componentInstance.$attrs['data-vv-delay'];\n }\n if (!isObject(globalDelay)) {\n return deepParseInt(delay || globalDelay);\n }\n if (!isNullOrUndefined(delay)) {\n globalDelay.input = delay;\n }\n return deepParseInt(globalDelay);\n};\nGenerator.resolveEvents = function resolveEvents (el, vnode) {\n var events = getDataAttribute(el, 'validate-on');\n if (!events && vnode.componentInstance && vnode.componentInstance.$attrs) {\n events = vnode.componentInstance.$attrs['data-vv-validate-on'];\n }\n if (!events && vnode.componentInstance) {\n var config = Generator.getCtorConfig(vnode);\n events = config && config.events;\n }\n return events;\n};\nGenerator.resolveScope = function resolveScope (el, binding, vnode) {\n if ( vnode === void 0 ) vnode = {};\n\n var scope = null;\n if (vnode.componentInstance && isNullOrUndefined(scope)) {\n scope = vnode.componentInstance.$attrs && vnode.componentInstance.$attrs['data-vv-scope'];\n }\n return !isNullOrUndefined(scope) ? scope : getScope(el);\n};\nGenerator.resolveModel = function resolveModel (binding, vnode) {\n if (binding.arg) {\n return {\n expression: binding.arg\n };\n }\n var model = vnode.data.model || find(vnode.data.directives, function (d) { return d.name === 'model'; });\n if (!model) {\n return null;\n }\n var watchable = !/[^\\w.$]/.test(model.expression) && hasPath(model.expression, vnode.context);\n var lazy = !(!(model.modifiers && model.modifiers.lazy));\n if (!watchable) {\n return {\n expression: null,\n lazy: lazy\n };\n }\n return {\n expression: model.expression,\n lazy: lazy\n };\n};\nGenerator.resolveName = function resolveName (el, vnode) {\n var name = getDataAttribute(el, 'name');\n if (!name && !vnode.componentInstance) {\n return el.name;\n }\n if (!name && vnode.componentInstance && vnode.componentInstance.$attrs) {\n name = vnode.componentInstance.$attrs['data-vv-name'] || vnode.componentInstance.$attrs['name'];\n }\n if (!name && vnode.componentInstance) {\n var config = Generator.getCtorConfig(vnode);\n if (config && isCallable(config.name)) {\n var boundGetter = config.name.bind(vnode.componentInstance);\n return boundGetter();\n }\n return vnode.componentInstance.name;\n }\n return name;\n};\nGenerator.resolveGetter = function resolveGetter (el, vnode, model) {\n if (model && model.expression) {\n return function () { return getPath(model.expression, vnode.context); };\n }\n if (vnode.componentInstance) {\n var path = getDataAttribute(el, 'value-path') || vnode.componentInstance.$attrs && vnode.componentInstance.$attrs['data-vv-value-path'];\n if (path) {\n return function () { return getPath(path, vnode.componentInstance); };\n }\n var config = Generator.getCtorConfig(vnode);\n if (config && isCallable(config.value)) {\n var boundGetter = config.value.bind(vnode.componentInstance);\n return function () { return boundGetter(); };\n }\n return function () { return vnode.componentInstance.value; };\n }\n switch (el.type) {\n case 'checkbox':\n return function () {\n var els = document.querySelectorAll((\"input[name=\\\"\" + (el.name) + \"\\\"]\"));\n els = toArray(els).filter(function (el) { return el.checked; });\n if (!els.length) \n { return undefined; }\n return els.map(function (checkbox) { return checkbox.value; });\n };\n case 'radio':\n return function () {\n var els = document.querySelectorAll((\"input[name=\\\"\" + (el.name) + \"\\\"]\"));\n var elm = find(els, function (el) { return el.checked; });\n return elm && elm.value;\n };\n case 'file':\n return function (context) { return toArray(el.files); };\n case 'select-multiple':\n return function () { return toArray(el.options).filter(function (opt) { return opt.selected; }).map(function (opt) { return opt.value; }); };\n default:\n return function () { return el && el.value; };\n }\n};\n\nvar DEFAULT_OPTIONS = {\n targetOf: null,\n initial: false,\n scope: null,\n listen: true,\n name: null,\n rules: {},\n vm: null,\n classes: false,\n validity: true,\n aria: true,\n events: 'input|blur',\n delay: 0,\n classNames: {\n touched: 'touched',\n untouched: 'untouched',\n valid: 'valid',\n invalid: 'invalid',\n pristine: 'pristine',\n dirty: 'dirty'\n }\n};\nvar Field = function Field(options) {\n if ( options === void 0 ) options = {};\n\n this.id = uniqId();\n this.el = options.el;\n this.updated = false;\n this.dependencies = [];\n this.watchers = [];\n this.events = [];\n this.delay = 0;\n this.rules = {};\n this._cacheId(options);\n this.classNames = assign({}, DEFAULT_OPTIONS.classNames);\n options = assign({}, DEFAULT_OPTIONS, options);\n this._delay = !isNullOrUndefined(options.delay) ? options.delay : 0;\n this.validity = options.validity;\n this.aria = options.aria;\n this.flags = createFlags();\n this.vm = options.vm;\n this.component = options.component;\n this.ctorConfig = this.component ? getPath('$options.$_veeValidate', this.component) : undefined;\n this.update(options);\n this.initialValue = this.value;\n this.updated = false;\n};\n\nvar prototypeAccessors$2 = { validator: { configurable: true },isRequired: { configurable: true },isDisabled: { configurable: true },alias: { configurable: true },value: { configurable: true },rejectsFalse: { configurable: true } };\nprototypeAccessors$2.validator.get = function () {\n if (!this.vm || !this.vm.$validator) {\n warn('No validator instance detected.');\n return {\n validate: function () {}\n };\n }\n return this.vm.$validator;\n};\nprototypeAccessors$2.isRequired.get = function () {\n return !(!this.rules.required);\n};\nprototypeAccessors$2.isDisabled.get = function () {\n return !(!(this.component && this.component.disabled)) || !(!(this.el && this.el.disabled));\n};\nprototypeAccessors$2.alias.get = function () {\n if (this._alias) {\n return this._alias;\n }\n var alias = null;\n if (this.el) {\n alias = getDataAttribute(this.el, 'as');\n }\n if (!alias && this.component) {\n return this.component.$attrs && this.component.$attrs['data-vv-as'];\n }\n return alias;\n};\nprototypeAccessors$2.value.get = function () {\n if (!isCallable(this.getter)) {\n return undefined;\n }\n return this.getter();\n};\nprototypeAccessors$2.rejectsFalse.get = function () {\n if (this.component && this.ctorConfig) {\n return !(!this.ctorConfig.rejectsFalse);\n }\n if (!this.el) {\n return false;\n }\n return this.el.type === 'checkbox';\n};\nField.prototype.matches = function matches (options) {\n if (!options) {\n return true;\n }\n if (options.id) {\n return this.id === options.id;\n }\n if (options.name === undefined && options.scope === undefined) {\n return true;\n }\n if (options.scope === undefined) {\n return this.name === options.name;\n }\n if (options.name === undefined) {\n return this.scope === options.scope;\n }\n return options.name === this.name && options.scope === this.scope;\n};\nField.prototype._cacheId = function _cacheId (options) {\n if (this.el && !options.targetOf) {\n this.el._veeValidateId = this.id;\n }\n};\nField.prototype.update = function update (options) {\n this.targetOf = options.targetOf || null;\n this.initial = options.initial || this.initial || false;\n if (!isNullOrUndefined(options.scope) && options.scope !== this.scope && isCallable(this.validator.update)) {\n this.validator.update(this.id, {\n scope: options.scope\n });\n }\n this.scope = !isNullOrUndefined(options.scope) ? options.scope : !isNullOrUndefined(this.scope) ? this.scope : null;\n this.name = (!isNullOrUndefined(options.name) ? String(options.name) : options.name) || this.name || null;\n this.rules = options.rules !== undefined ? normalizeRules(options.rules) : this.rules;\n this.model = options.model || this.model;\n this.listen = options.listen !== undefined ? options.listen : this.listen;\n this.classes = (options.classes || this.classes || false) && !this.component;\n this.classNames = isObject(options.classNames) ? merge(this.classNames, options.classNames) : this.classNames;\n this.getter = isCallable(options.getter) ? options.getter : this.getter;\n this._alias = options.alias || this._alias;\n this.events = options.events ? makeEventsArray(options.events) : this.events;\n this.delay = makeDelayObject(this.events, options.delay || this.delay, this._delay);\n this.updateDependencies();\n this.addActionListeners();\n if (!this.name && !this.targetOf) {\n warn('A field is missing a \"name\" or \"data-vv-name\" attribute');\n }\n if (options.rules !== undefined) {\n this.flags.required = this.isRequired;\n }\n if (this.flags.validated && options.rules !== undefined && this.updated) {\n this.validator.validate((\"#\" + (this.id)));\n }\n this.updated = true;\n this.addValueListeners();\n if (!this.el) {\n return;\n }\n this.updateClasses();\n this.updateAriaAttrs();\n};\nField.prototype.reset = function reset () {\n var this$1 = this;\n\n if (this._cancellationToken) {\n this._cancellationToken.cancelled = true;\n delete this._cancellationToken;\n }\n var defaults = createFlags();\n Object.keys(this.flags).filter(function (flag) { return flag !== 'required'; }).forEach(function (flag) {\n this$1.flags[flag] = defaults[flag];\n });\n this.addActionListeners();\n this.updateClasses();\n this.updateAriaAttrs();\n this.updateCustomValidity();\n};\nField.prototype.setFlags = function setFlags (flags) {\n var this$1 = this;\n\n var negated = {\n pristine: 'dirty',\n dirty: 'pristine',\n valid: 'invalid',\n invalid: 'valid',\n touched: 'untouched',\n untouched: 'touched'\n };\n Object.keys(flags).forEach(function (flag) {\n this$1.flags[flag] = flags[flag];\n if (negated[flag] && flags[negated[flag]] === undefined) {\n this$1.flags[negated[flag]] = !flags[flag];\n }\n });\n if (flags.untouched !== undefined || flags.touched !== undefined || flags.dirty !== undefined || flags.pristine !== undefined) {\n this.addActionListeners();\n }\n this.updateClasses();\n this.updateAriaAttrs();\n this.updateCustomValidity();\n};\nField.prototype.updateDependencies = function updateDependencies () {\n var this$1 = this;\n\n this.dependencies.forEach(function (d) { return d.field.destroy(); });\n this.dependencies = [];\n var fields = Object.keys(this.rules).reduce(function (prev, r) {\n if (Validator.isTargetRule(r)) {\n var selector = this$1.rules[r][0];\n if (r === 'confirmed' && !selector) {\n selector = (this$1.name) + \"_confirmation\";\n }\n prev.push({\n selector: selector,\n name: r\n });\n }\n return prev;\n }, []);\n if (!fields.length || !this.vm || !this.vm.$el) \n { return; }\n fields.forEach(function (ref) {\n var selector = ref.selector;\n var name = ref.name;\n\n var el = null;\n if (selector[0] === '$') {\n var ref$1 = this$1.vm.$refs[selector.slice(1)];\n el = Array.isArray(ref$1) ? ref$1[0] : ref$1;\n } else {\n try {\n el = this$1.vm.$el.querySelector(selector);\n } catch (err) {\n el = null;\n }\n }\n if (!el) {\n try {\n el = this$1.vm.$el.querySelector((\"input[name=\\\"\" + selector + \"\\\"]\"));\n } catch (err) {\n el = null;\n }\n }\n if (!el) {\n return;\n }\n var options = {\n vm: this$1.vm,\n classes: this$1.classes,\n classNames: this$1.classNames,\n delay: this$1.delay,\n scope: this$1.scope,\n events: this$1.events.join('|'),\n initial: this$1.initial,\n targetOf: this$1.id\n };\n if (isCallable(el.$watch)) {\n options.component = el;\n options.el = el.$el;\n options.getter = Generator.resolveGetter(el.$el, {\n child: el\n });\n } else {\n options.el = el;\n options.getter = Generator.resolveGetter(el, {});\n }\n this$1.dependencies.push({\n name: name,\n field: new Field(options)\n });\n });\n};\nField.prototype.unwatch = function unwatch (tag) {\n if ( tag === void 0 ) tag = null;\n\n if (!tag) {\n this.watchers.forEach(function (w) { return w.unwatch(); });\n this.watchers = [];\n return;\n }\n this.watchers.filter(function (w) { return tag.test(w.tag); }).forEach(function (w) { return w.unwatch(); });\n this.watchers = this.watchers.filter(function (w) { return !tag.test(w.tag); });\n};\nField.prototype.updateClasses = function updateClasses () {\n var this$1 = this;\n\n if (!this.classes || this.isDisabled) \n { return; }\n var applyClasses = function (el) {\n toggleClass(el, this$1.classNames.dirty, this$1.flags.dirty);\n toggleClass(el, this$1.classNames.pristine, this$1.flags.pristine);\n toggleClass(el, this$1.classNames.touched, this$1.flags.touched);\n toggleClass(el, this$1.classNames.untouched, this$1.flags.untouched);\n if (!isNullOrUndefined(this$1.flags.valid) && this$1.flags.validated) {\n toggleClass(el, this$1.classNames.valid, this$1.flags.valid);\n }\n if (!isNullOrUndefined(this$1.flags.invalid) && this$1.flags.validated) {\n toggleClass(el, this$1.classNames.invalid, this$1.flags.invalid);\n }\n };\n if (!isCheckboxOrRadioInput(this.el)) {\n applyClasses(this.el);\n return;\n }\n var els = document.querySelectorAll((\"input[name=\\\"\" + (this.el.name) + \"\\\"]\"));\n toArray(els).forEach(applyClasses);\n};\nField.prototype.addActionListeners = function addActionListeners () {\n var this$1 = this;\n\n this.unwatch(/class/);\n if (!this.el) \n { return; }\n var onBlur = function () {\n this$1.flags.touched = true;\n this$1.flags.untouched = false;\n if (this$1.classes) {\n toggleClass(this$1.el, this$1.classNames.touched, true);\n toggleClass(this$1.el, this$1.classNames.untouched, false);\n }\n this$1.unwatch(/^class_blur$/);\n };\n var inputEvent = isTextInput(this.el) ? 'input' : 'change';\n var onInput = function () {\n this$1.flags.dirty = true;\n this$1.flags.pristine = false;\n if (this$1.classes) {\n toggleClass(this$1.el, this$1.classNames.pristine, false);\n toggleClass(this$1.el, this$1.classNames.dirty, true);\n }\n this$1.unwatch(/^class_input$/);\n };\n if (this.component && isCallable(this.component.$once)) {\n this.component.$once('input', onInput);\n this.component.$once('blur', onBlur);\n this.watchers.push({\n tag: 'class_input',\n unwatch: function () {\n this$1.component.$off('input', onInput);\n }\n });\n this.watchers.push({\n tag: 'class_blur',\n unwatch: function () {\n this$1.component.$off('blur', onBlur);\n }\n });\n return;\n }\n if (!this.el) \n { return; }\n addEventListener(this.el, inputEvent, onInput);\n var blurEvent = isCheckboxOrRadioInput(this.el) ? 'change' : 'blur';\n addEventListener(this.el, blurEvent, onBlur);\n this.watchers.push({\n tag: 'class_input',\n unwatch: function () {\n this$1.el.removeEventListener(inputEvent, onInput);\n }\n });\n this.watchers.push({\n tag: 'class_blur',\n unwatch: function () {\n this$1.el.removeEventListener(blurEvent, onBlur);\n }\n });\n};\nField.prototype.checkValueChanged = function checkValueChanged () {\n if (this.initialValue === null && this.value === '' && isTextInput(this.el)) {\n return false;\n }\n return this.value !== this.initialValue;\n};\nField.prototype.addValueListeners = function addValueListeners () {\n var this$1 = this;\n\n this.unwatch(/^input_.+/);\n if (!this.listen || !this.el) \n { return; }\n var token = {\n cancelled: false\n };\n var fn = this.targetOf ? function () {\n this$1.flags.changed = this$1.checkValueChanged();\n this$1.validator.validate((\"#\" + (this$1.targetOf)));\n } : function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (args.length === 0 || isCallable(Event) && args[0] instanceof Event || args[0] && args[0].srcElement) {\n args[0] = this$1.value;\n }\n this$1.flags.changed = this$1.checkValueChanged();\n this$1.validator.validate((\"#\" + (this$1.id)), ar