37519 lines
1.2 MiB
37519 lines
1.2 MiB
/******/ (() => { // webpackBootstrap
|
||
/******/ var __webpack_modules__ = ({
|
||
|
||
/***/ "./node_modules/@nextcloud/event-bus/node_modules/semver/classes/semver.js":
|
||
/*!*********************************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/event-bus/node_modules/semver/classes/semver.js ***!
|
||
\*********************************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
const debug = __webpack_require__(/*! ../internal/debug */ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/debug.js")
|
||
const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(/*! ../internal/constants */ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/constants.js")
|
||
const { safeRe: re, t } = __webpack_require__(/*! ../internal/re */ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/re.js")
|
||
|
||
const parseOptions = __webpack_require__(/*! ../internal/parse-options */ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/parse-options.js")
|
||
const { compareIdentifiers } = __webpack_require__(/*! ../internal/identifiers */ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/identifiers.js")
|
||
class SemVer {
|
||
constructor (version, options) {
|
||
options = parseOptions(options)
|
||
|
||
if (version instanceof SemVer) {
|
||
if (version.loose === !!options.loose &&
|
||
version.includePrerelease === !!options.includePrerelease) {
|
||
return version
|
||
} else {
|
||
version = version.version
|
||
}
|
||
} else if (typeof version !== 'string') {
|
||
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
|
||
}
|
||
|
||
if (version.length > MAX_LENGTH) {
|
||
throw new TypeError(
|
||
`version is longer than ${MAX_LENGTH} characters`
|
||
)
|
||
}
|
||
|
||
debug('SemVer', version, options)
|
||
this.options = options
|
||
this.loose = !!options.loose
|
||
// this isn't actually relevant for versions, but keep it so that we
|
||
// don't run into trouble passing this.options around.
|
||
this.includePrerelease = !!options.includePrerelease
|
||
|
||
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
|
||
|
||
if (!m) {
|
||
throw new TypeError(`Invalid Version: ${version}`)
|
||
}
|
||
|
||
this.raw = version
|
||
|
||
// these are actually numbers
|
||
this.major = +m[1]
|
||
this.minor = +m[2]
|
||
this.patch = +m[3]
|
||
|
||
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
||
throw new TypeError('Invalid major version')
|
||
}
|
||
|
||
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
||
throw new TypeError('Invalid minor version')
|
||
}
|
||
|
||
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
||
throw new TypeError('Invalid patch version')
|
||
}
|
||
|
||
// numberify any prerelease numeric ids
|
||
if (!m[4]) {
|
||
this.prerelease = []
|
||
} else {
|
||
this.prerelease = m[4].split('.').map((id) => {
|
||
if (/^[0-9]+$/.test(id)) {
|
||
const num = +id
|
||
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
||
return num
|
||
}
|
||
}
|
||
return id
|
||
})
|
||
}
|
||
|
||
this.build = m[5] ? m[5].split('.') : []
|
||
this.format()
|
||
}
|
||
|
||
format () {
|
||
this.version = `${this.major}.${this.minor}.${this.patch}`
|
||
if (this.prerelease.length) {
|
||
this.version += `-${this.prerelease.join('.')}`
|
||
}
|
||
return this.version
|
||
}
|
||
|
||
toString () {
|
||
return this.version
|
||
}
|
||
|
||
compare (other) {
|
||
debug('SemVer.compare', this.version, this.options, other)
|
||
if (!(other instanceof SemVer)) {
|
||
if (typeof other === 'string' && other === this.version) {
|
||
return 0
|
||
}
|
||
other = new SemVer(other, this.options)
|
||
}
|
||
|
||
if (other.version === this.version) {
|
||
return 0
|
||
}
|
||
|
||
return this.compareMain(other) || this.comparePre(other)
|
||
}
|
||
|
||
compareMain (other) {
|
||
if (!(other instanceof SemVer)) {
|
||
other = new SemVer(other, this.options)
|
||
}
|
||
|
||
return (
|
||
compareIdentifiers(this.major, other.major) ||
|
||
compareIdentifiers(this.minor, other.minor) ||
|
||
compareIdentifiers(this.patch, other.patch)
|
||
)
|
||
}
|
||
|
||
comparePre (other) {
|
||
if (!(other instanceof SemVer)) {
|
||
other = new SemVer(other, this.options)
|
||
}
|
||
|
||
// NOT having a prerelease is > having one
|
||
if (this.prerelease.length && !other.prerelease.length) {
|
||
return -1
|
||
} else if (!this.prerelease.length && other.prerelease.length) {
|
||
return 1
|
||
} else if (!this.prerelease.length && !other.prerelease.length) {
|
||
return 0
|
||
}
|
||
|
||
let i = 0
|
||
do {
|
||
const a = this.prerelease[i]
|
||
const b = other.prerelease[i]
|
||
debug('prerelease compare', i, a, b)
|
||
if (a === undefined && b === undefined) {
|
||
return 0
|
||
} else if (b === undefined) {
|
||
return 1
|
||
} else if (a === undefined) {
|
||
return -1
|
||
} else if (a === b) {
|
||
continue
|
||
} else {
|
||
return compareIdentifiers(a, b)
|
||
}
|
||
} while (++i)
|
||
}
|
||
|
||
compareBuild (other) {
|
||
if (!(other instanceof SemVer)) {
|
||
other = new SemVer(other, this.options)
|
||
}
|
||
|
||
let i = 0
|
||
do {
|
||
const a = this.build[i]
|
||
const b = other.build[i]
|
||
debug('prerelease compare', i, a, b)
|
||
if (a === undefined && b === undefined) {
|
||
return 0
|
||
} else if (b === undefined) {
|
||
return 1
|
||
} else if (a === undefined) {
|
||
return -1
|
||
} else if (a === b) {
|
||
continue
|
||
} else {
|
||
return compareIdentifiers(a, b)
|
||
}
|
||
} while (++i)
|
||
}
|
||
|
||
// preminor will bump the version up to the next minor release, and immediately
|
||
// down to pre-release. premajor and prepatch work the same way.
|
||
inc (release, identifier, identifierBase) {
|
||
switch (release) {
|
||
case 'premajor':
|
||
this.prerelease.length = 0
|
||
this.patch = 0
|
||
this.minor = 0
|
||
this.major++
|
||
this.inc('pre', identifier, identifierBase)
|
||
break
|
||
case 'preminor':
|
||
this.prerelease.length = 0
|
||
this.patch = 0
|
||
this.minor++
|
||
this.inc('pre', identifier, identifierBase)
|
||
break
|
||
case 'prepatch':
|
||
// If this is already a prerelease, it will bump to the next version
|
||
// drop any prereleases that might already exist, since they are not
|
||
// relevant at this point.
|
||
this.prerelease.length = 0
|
||
this.inc('patch', identifier, identifierBase)
|
||
this.inc('pre', identifier, identifierBase)
|
||
break
|
||
// If the input is a non-prerelease version, this acts the same as
|
||
// prepatch.
|
||
case 'prerelease':
|
||
if (this.prerelease.length === 0) {
|
||
this.inc('patch', identifier, identifierBase)
|
||
}
|
||
this.inc('pre', identifier, identifierBase)
|
||
break
|
||
|
||
case 'major':
|
||
// If this is a pre-major version, bump up to the same major version.
|
||
// Otherwise increment major.
|
||
// 1.0.0-5 bumps to 1.0.0
|
||
// 1.1.0 bumps to 2.0.0
|
||
if (
|
||
this.minor !== 0 ||
|
||
this.patch !== 0 ||
|
||
this.prerelease.length === 0
|
||
) {
|
||
this.major++
|
||
}
|
||
this.minor = 0
|
||
this.patch = 0
|
||
this.prerelease = []
|
||
break
|
||
case 'minor':
|
||
// If this is a pre-minor version, bump up to the same minor version.
|
||
// Otherwise increment minor.
|
||
// 1.2.0-5 bumps to 1.2.0
|
||
// 1.2.1 bumps to 1.3.0
|
||
if (this.patch !== 0 || this.prerelease.length === 0) {
|
||
this.minor++
|
||
}
|
||
this.patch = 0
|
||
this.prerelease = []
|
||
break
|
||
case 'patch':
|
||
// If this is not a pre-release version, it will increment the patch.
|
||
// If it is a pre-release it will bump up to the same patch version.
|
||
// 1.2.0-5 patches to 1.2.0
|
||
// 1.2.0 patches to 1.2.1
|
||
if (this.prerelease.length === 0) {
|
||
this.patch++
|
||
}
|
||
this.prerelease = []
|
||
break
|
||
// This probably shouldn't be used publicly.
|
||
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
||
case 'pre': {
|
||
const base = Number(identifierBase) ? 1 : 0
|
||
|
||
if (!identifier && identifierBase === false) {
|
||
throw new Error('invalid increment argument: identifier is empty')
|
||
}
|
||
|
||
if (this.prerelease.length === 0) {
|
||
this.prerelease = [base]
|
||
} else {
|
||
let i = this.prerelease.length
|
||
while (--i >= 0) {
|
||
if (typeof this.prerelease[i] === 'number') {
|
||
this.prerelease[i]++
|
||
i = -2
|
||
}
|
||
}
|
||
if (i === -1) {
|
||
// didn't increment anything
|
||
if (identifier === this.prerelease.join('.') && identifierBase === false) {
|
||
throw new Error('invalid increment argument: identifier already exists')
|
||
}
|
||
this.prerelease.push(base)
|
||
}
|
||
}
|
||
if (identifier) {
|
||
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
|
||
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
|
||
let prerelease = [identifier, base]
|
||
if (identifierBase === false) {
|
||
prerelease = [identifier]
|
||
}
|
||
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
||
if (isNaN(this.prerelease[1])) {
|
||
this.prerelease = prerelease
|
||
}
|
||
} else {
|
||
this.prerelease = prerelease
|
||
}
|
||
}
|
||
break
|
||
}
|
||
default:
|
||
throw new Error(`invalid increment argument: ${release}`)
|
||
}
|
||
this.raw = this.format()
|
||
if (this.build.length) {
|
||
this.raw += `+${this.build.join('.')}`
|
||
}
|
||
return this
|
||
}
|
||
}
|
||
|
||
module.exports = SemVer
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/event-bus/node_modules/semver/functions/major.js":
|
||
/*!**********************************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/event-bus/node_modules/semver/functions/major.js ***!
|
||
\**********************************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
const SemVer = __webpack_require__(/*! ../classes/semver */ "./node_modules/@nextcloud/event-bus/node_modules/semver/classes/semver.js")
|
||
const major = (a, loose) => new SemVer(a, loose).major
|
||
module.exports = major
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/event-bus/node_modules/semver/functions/parse.js":
|
||
/*!**********************************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/event-bus/node_modules/semver/functions/parse.js ***!
|
||
\**********************************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
const SemVer = __webpack_require__(/*! ../classes/semver */ "./node_modules/@nextcloud/event-bus/node_modules/semver/classes/semver.js")
|
||
const parse = (version, options, throwErrors = false) => {
|
||
if (version instanceof SemVer) {
|
||
return version
|
||
}
|
||
try {
|
||
return new SemVer(version, options)
|
||
} catch (er) {
|
||
if (!throwErrors) {
|
||
return null
|
||
}
|
||
throw er
|
||
}
|
||
}
|
||
|
||
module.exports = parse
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/event-bus/node_modules/semver/functions/valid.js":
|
||
/*!**********************************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/event-bus/node_modules/semver/functions/valid.js ***!
|
||
\**********************************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
const parse = __webpack_require__(/*! ./parse */ "./node_modules/@nextcloud/event-bus/node_modules/semver/functions/parse.js")
|
||
const valid = (version, options) => {
|
||
const v = parse(version, options)
|
||
return v ? v.version : null
|
||
}
|
||
module.exports = valid
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/constants.js":
|
||
/*!*************************************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/event-bus/node_modules/semver/internal/constants.js ***!
|
||
\*************************************************************************************/
|
||
/***/ ((module) => {
|
||
|
||
// Note: this is the semver.org version of the spec that it implements
|
||
// Not necessarily the package version of this code.
|
||
const SEMVER_SPEC_VERSION = '2.0.0'
|
||
|
||
const MAX_LENGTH = 256
|
||
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
||
/* istanbul ignore next */ 9007199254740991
|
||
|
||
// Max safe segment length for coercion.
|
||
const MAX_SAFE_COMPONENT_LENGTH = 16
|
||
|
||
// Max safe length for a build identifier. The max length minus 6 characters for
|
||
// the shortest version with a build 0.0.0+BUILD.
|
||
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
|
||
|
||
const RELEASE_TYPES = [
|
||
'major',
|
||
'premajor',
|
||
'minor',
|
||
'preminor',
|
||
'patch',
|
||
'prepatch',
|
||
'prerelease',
|
||
]
|
||
|
||
module.exports = {
|
||
MAX_LENGTH,
|
||
MAX_SAFE_COMPONENT_LENGTH,
|
||
MAX_SAFE_BUILD_LENGTH,
|
||
MAX_SAFE_INTEGER,
|
||
RELEASE_TYPES,
|
||
SEMVER_SPEC_VERSION,
|
||
FLAG_INCLUDE_PRERELEASE: 0b001,
|
||
FLAG_LOOSE: 0b010,
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/debug.js":
|
||
/*!*********************************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/event-bus/node_modules/semver/internal/debug.js ***!
|
||
\*********************************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
/* provided dependency */ var process = __webpack_require__(/*! ./node_modules/process/browser.js */ "./node_modules/process/browser.js");
|
||
const debug = (
|
||
typeof process === 'object' &&
|
||
process.env &&
|
||
process.env.NODE_DEBUG &&
|
||
/\bsemver\b/i.test(process.env.NODE_DEBUG)
|
||
) ? (...args) => console.error('SEMVER', ...args)
|
||
: () => {}
|
||
|
||
module.exports = debug
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/identifiers.js":
|
||
/*!***************************************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/event-bus/node_modules/semver/internal/identifiers.js ***!
|
||
\***************************************************************************************/
|
||
/***/ ((module) => {
|
||
|
||
const numeric = /^[0-9]+$/
|
||
const compareIdentifiers = (a, b) => {
|
||
const anum = numeric.test(a)
|
||
const bnum = numeric.test(b)
|
||
|
||
if (anum && bnum) {
|
||
a = +a
|
||
b = +b
|
||
}
|
||
|
||
return a === b ? 0
|
||
: (anum && !bnum) ? -1
|
||
: (bnum && !anum) ? 1
|
||
: a < b ? -1
|
||
: 1
|
||
}
|
||
|
||
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
|
||
|
||
module.exports = {
|
||
compareIdentifiers,
|
||
rcompareIdentifiers,
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/parse-options.js":
|
||
/*!*****************************************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/event-bus/node_modules/semver/internal/parse-options.js ***!
|
||
\*****************************************************************************************/
|
||
/***/ ((module) => {
|
||
|
||
// parse out just the options we care about
|
||
const looseOption = Object.freeze({ loose: true })
|
||
const emptyOpts = Object.freeze({ })
|
||
const parseOptions = options => {
|
||
if (!options) {
|
||
return emptyOpts
|
||
}
|
||
|
||
if (typeof options !== 'object') {
|
||
return looseOption
|
||
}
|
||
|
||
return options
|
||
}
|
||
module.exports = parseOptions
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/re.js":
|
||
/*!******************************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/event-bus/node_modules/semver/internal/re.js ***!
|
||
\******************************************************************************/
|
||
/***/ ((module, exports, __webpack_require__) => {
|
||
|
||
const {
|
||
MAX_SAFE_COMPONENT_LENGTH,
|
||
MAX_SAFE_BUILD_LENGTH,
|
||
MAX_LENGTH,
|
||
} = __webpack_require__(/*! ./constants */ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/constants.js")
|
||
const debug = __webpack_require__(/*! ./debug */ "./node_modules/@nextcloud/event-bus/node_modules/semver/internal/debug.js")
|
||
exports = module.exports = {}
|
||
|
||
// The actual regexps go on exports.re
|
||
const re = exports.re = []
|
||
const safeRe = exports.safeRe = []
|
||
const src = exports.src = []
|
||
const t = exports.t = {}
|
||
let R = 0
|
||
|
||
const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
|
||
|
||
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
|
||
// used internally via the safeRe object since all inputs in this library get
|
||
// normalized first to trim and collapse all extra whitespace. The original
|
||
// regexes are exported for userland consumption and lower level usage. A
|
||
// future breaking change could export the safer regex only with a note that
|
||
// all input should have extra whitespace removed.
|
||
const safeRegexReplacements = [
|
||
['\\s', 1],
|
||
['\\d', MAX_LENGTH],
|
||
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
|
||
]
|
||
|
||
const makeSafeRegex = (value) => {
|
||
for (const [token, max] of safeRegexReplacements) {
|
||
value = value
|
||
.split(`${token}*`).join(`${token}{0,${max}}`)
|
||
.split(`${token}+`).join(`${token}{1,${max}}`)
|
||
}
|
||
return value
|
||
}
|
||
|
||
const createToken = (name, value, isGlobal) => {
|
||
const safe = makeSafeRegex(value)
|
||
const index = R++
|
||
debug(name, index, value)
|
||
t[name] = index
|
||
src[index] = value
|
||
re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
|
||
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
|
||
}
|
||
|
||
// The following Regular Expressions can be used for tokenizing,
|
||
// validating, and parsing SemVer version strings.
|
||
|
||
// ## Numeric Identifier
|
||
// A single `0`, or a non-zero digit followed by zero or more digits.
|
||
|
||
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
|
||
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
|
||
|
||
// ## Non-numeric Identifier
|
||
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
||
// more letters, digits, or hyphens.
|
||
|
||
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
|
||
|
||
// ## Main Version
|
||
// Three dot-separated numeric identifiers.
|
||
|
||
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
|
||
`(${src[t.NUMERICIDENTIFIER]})\\.` +
|
||
`(${src[t.NUMERICIDENTIFIER]})`)
|
||
|
||
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
||
`(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
||
`(${src[t.NUMERICIDENTIFIERLOOSE]})`)
|
||
|
||
// ## Pre-release Version Identifier
|
||
// A numeric identifier, or a non-numeric identifier.
|
||
|
||
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
|
||
}|${src[t.NONNUMERICIDENTIFIER]})`)
|
||
|
||
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
|
||
}|${src[t.NONNUMERICIDENTIFIER]})`)
|
||
|
||
// ## Pre-release Version
|
||
// Hyphen, followed by one or more dot-separated pre-release version
|
||
// identifiers.
|
||
|
||
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
|
||
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)
|
||
|
||
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
|
||
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)
|
||
|
||
// ## Build Metadata Identifier
|
||
// Any combination of digits, letters, or hyphens.
|
||
|
||
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
|
||
|
||
// ## Build Metadata
|
||
// Plus sign, followed by one or more period-separated build metadata
|
||
// identifiers.
|
||
|
||
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
|
||
}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)
|
||
|
||
// ## Full Version String
|
||
// A main version, followed optionally by a pre-release version and
|
||
// build metadata.
|
||
|
||
// Note that the only major, minor, patch, and pre-release sections of
|
||
// the version string are capturing groups. The build metadata is not a
|
||
// capturing group, because it should not ever be used in version
|
||
// comparison.
|
||
|
||
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
|
||
}${src[t.PRERELEASE]}?${
|
||
src[t.BUILD]}?`)
|
||
|
||
createToken('FULL', `^${src[t.FULLPLAIN]}$`)
|
||
|
||
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
|
||
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
|
||
// common in the npm registry.
|
||
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
|
||
}${src[t.PRERELEASELOOSE]}?${
|
||
src[t.BUILD]}?`)
|
||
|
||
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
|
||
|
||
createToken('GTLT', '((?:<|>)?=?)')
|
||
|
||
// Something like "2.*" or "1.2.x".
|
||
// Note that "x.x" is a valid xRange identifer, meaning "any version"
|
||
// Only the first item is strictly required.
|
||
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
|
||
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
|
||
|
||
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
|
||
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
||
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
||
`(?:${src[t.PRERELEASE]})?${
|
||
src[t.BUILD]}?` +
|
||
`)?)?`)
|
||
|
||
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||
`(?:${src[t.PRERELEASELOOSE]})?${
|
||
src[t.BUILD]}?` +
|
||
`)?)?`)
|
||
|
||
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
|
||
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
|
||
|
||
// Coercion.
|
||
// Extract anything that could conceivably be a part of a valid semver
|
||
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
|
||
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
|
||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
|
||
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
|
||
createToken('COERCEFULL', src[t.COERCEPLAIN] +
|
||
`(?:${src[t.PRERELEASE]})?` +
|
||
`(?:${src[t.BUILD]})?` +
|
||
`(?:$|[^\\d])`)
|
||
createToken('COERCERTL', src[t.COERCE], true)
|
||
createToken('COERCERTLFULL', src[t.COERCEFULL], true)
|
||
|
||
// Tilde ranges.
|
||
// Meaning is "reasonably at or greater than"
|
||
createToken('LONETILDE', '(?:~>?)')
|
||
|
||
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
|
||
exports.tildeTrimReplace = '$1~'
|
||
|
||
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
|
||
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)
|
||
|
||
// Caret ranges.
|
||
// Meaning is "at least and backwards compatible with"
|
||
createToken('LONECARET', '(?:\\^)')
|
||
|
||
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
|
||
exports.caretTrimReplace = '$1^'
|
||
|
||
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
|
||
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)
|
||
|
||
// A simple gt/lt/eq thing, or just "" to indicate "any version"
|
||
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
|
||
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)
|
||
|
||
// An expression to strip any whitespace between the gtlt and the thing
|
||
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
|
||
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
|
||
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
|
||
exports.comparatorTrimReplace = '$1$2$3'
|
||
|
||
// Something like `1.2.3 - 1.2.4`
|
||
// Note that these all use the loose form, because they'll be
|
||
// checked against either the strict or loose comparator form
|
||
// later.
|
||
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
|
||
`\\s+-\\s+` +
|
||
`(${src[t.XRANGEPLAIN]})` +
|
||
`\\s*$`)
|
||
|
||
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
|
||
`\\s+-\\s+` +
|
||
`(${src[t.XRANGEPLAINLOOSE]})` +
|
||
`\\s*$`)
|
||
|
||
// Star ranges basically just allow anything at all.
|
||
createToken('STAR', '(<|>)?=?\\s*\\*')
|
||
// >=0.0.0 is like a star
|
||
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
|
||
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/l10n/node_modules/@nextcloud/router/dist/index.js":
|
||
/*!***********************************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/l10n/node_modules/@nextcloud/router/dist/index.js ***!
|
||
\***********************************************************************************/
|
||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({
|
||
value: true
|
||
}));
|
||
exports.generateUrl = exports.generateRemoteUrl = exports.generateOcsUrl = exports.generateFilePath = void 0;
|
||
exports.getAppRootUrl = getAppRootUrl;
|
||
exports.getRootUrl = getRootUrl;
|
||
exports.linkTo = exports.imagePath = void 0;
|
||
__webpack_require__(/*! core-js/modules/es.string.replace.js */ "./node_modules/core-js/modules/es.string.replace.js");
|
||
/**
|
||
* Get an url with webroot to a file in an app
|
||
*
|
||
* @param {string} app the id of the app the file belongs to
|
||
* @param {string} file the file path relative to the app folder
|
||
* @return {string} URL with webroot to a file
|
||
*/
|
||
const linkTo = (app, file) => generateFilePath(app, '', file);
|
||
|
||
/**
|
||
* Creates a relative url for remote use
|
||
*
|
||
* @param {string} service id
|
||
* @return {string} the url
|
||
*/
|
||
exports.linkTo = linkTo;
|
||
const linkToRemoteBase = service => getRootUrl() + '/remote.php/' + service;
|
||
|
||
/**
|
||
* @brief Creates an absolute url for remote use
|
||
* @param {string} service id
|
||
* @return {string} the url
|
||
*/
|
||
const generateRemoteUrl = service => window.location.protocol + '//' + window.location.host + linkToRemoteBase(service);
|
||
|
||
/**
|
||
* Get the base path for the given OCS API service
|
||
*
|
||
* @param {string} url OCS API service url
|
||
* @param {object} params parameters to be replaced into the service url
|
||
* @param {UrlOptions} options options for the parameter replacement
|
||
* @param {boolean} options.escape Set to false if parameters should not be URL encoded (default true)
|
||
* @param {Number} options.ocsVersion OCS version to use (defaults to 2)
|
||
* @return {string} Absolute path for the OCS URL
|
||
*/
|
||
exports.generateRemoteUrl = generateRemoteUrl;
|
||
const generateOcsUrl = (url, params, options) => {
|
||
const allOptions = Object.assign({
|
||
ocsVersion: 2
|
||
}, options || {});
|
||
const version = allOptions.ocsVersion === 1 ? 1 : 2;
|
||
return window.location.protocol + '//' + window.location.host + getRootUrl() + '/ocs/v' + version + '.php' + _generateUrlPath(url, params, options);
|
||
};
|
||
exports.generateOcsUrl = generateOcsUrl;
|
||
/**
|
||
* Generate a url path, which can contain parameters
|
||
*
|
||
* Parameters will be URL encoded automatically
|
||
*
|
||
* @param {string} url address (can contain placeholders e.g. /call/{token} would replace {token} with the value of params.token
|
||
* @param {object} params parameters to be replaced into the address
|
||
* @param {UrlOptions} options options for the parameter replacement
|
||
* @return {string} Path part for the given URL
|
||
*/
|
||
const _generateUrlPath = (url, params, options) => {
|
||
const allOptions = Object.assign({
|
||
escape: true
|
||
}, options || {});
|
||
const _build = function (text, vars) {
|
||
vars = vars || {};
|
||
return text.replace(/{([^{}]*)}/g, function (a, b) {
|
||
var r = vars[b];
|
||
if (allOptions.escape) {
|
||
return typeof r === 'string' || typeof r === 'number' ? encodeURIComponent(r.toString()) : encodeURIComponent(a);
|
||
} else {
|
||
return typeof r === 'string' || typeof r === 'number' ? r.toString() : a;
|
||
}
|
||
});
|
||
};
|
||
if (url.charAt(0) !== '/') {
|
||
url = '/' + url;
|
||
}
|
||
return _build(url, params || {});
|
||
};
|
||
|
||
/**
|
||
* Generate the url with webroot for the given relative url, which can contain parameters
|
||
*
|
||
* Parameters will be URL encoded automatically
|
||
*
|
||
* @param {string} url address (can contain placeholders e.g. /call/{token} would replace {token} with the value of params.token
|
||
* @param {object} params parameters to be replaced into the url
|
||
* @param {UrlOptions} options options for the parameter replacement
|
||
* @param {boolean} options.noRewrite True if you want to force index.php being added
|
||
* @param {boolean} options.escape Set to false if parameters should not be URL encoded (default true)
|
||
* @return {string} URL with webroot for the given relative URL
|
||
*/
|
||
const generateUrl = (url, params, options) => {
|
||
var _window;
|
||
const allOptions = Object.assign({
|
||
noRewrite: false
|
||
}, options || {});
|
||
if (((_window = window) === null || _window === void 0 || (_window = _window.OC) === null || _window === void 0 || (_window = _window.config) === null || _window === void 0 ? void 0 : _window.modRewriteWorking) === true && !allOptions.noRewrite) {
|
||
return getRootUrl() + _generateUrlPath(url, params, options);
|
||
}
|
||
return getRootUrl() + '/index.php' + _generateUrlPath(url, params, options);
|
||
};
|
||
|
||
/**
|
||
* Get the path with webroot to an image file
|
||
* if no extension is given for the image, it will automatically decide
|
||
* between .png and .svg based on what the browser supports
|
||
*
|
||
* @param {string} app the app id to which the image belongs
|
||
* @param {string} file the name of the image file
|
||
* @return {string}
|
||
*/
|
||
exports.generateUrl = generateUrl;
|
||
const imagePath = (app, file) => {
|
||
if (file.indexOf('.') === -1) {
|
||
//if no extension is given, use svg
|
||
return generateFilePath(app, 'img', file + '.svg');
|
||
}
|
||
return generateFilePath(app, 'img', file);
|
||
};
|
||
|
||
/**
|
||
* Get the url with webroot for a file in an app
|
||
*
|
||
* @param {string} app the id of the app
|
||
* @param {string} type the type of the file to link to (e.g. css,img,ajax.template)
|
||
* @param {string} file the filename
|
||
* @return {string} URL with webroot for a file in an app
|
||
*/
|
||
exports.imagePath = imagePath;
|
||
const generateFilePath = (app, type, file) => {
|
||
var _window2;
|
||
const isCore = ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.OC) === null || _window2 === void 0 || (_window2 = _window2.coreApps) === null || _window2 === void 0 ? void 0 : _window2.indexOf(app)) !== -1;
|
||
let link = getRootUrl();
|
||
if (file.substring(file.length - 3) === 'php' && !isCore) {
|
||
link += '/index.php/apps/' + app;
|
||
if (file !== 'index.php') {
|
||
link += '/';
|
||
if (type) {
|
||
link += encodeURI(type + '/');
|
||
}
|
||
link += file;
|
||
}
|
||
} else if (file.substring(file.length - 3) !== 'php' && !isCore) {
|
||
link = getAppRootUrl(app);
|
||
if (type) {
|
||
link += '/' + type + '/';
|
||
}
|
||
if (link.substring(link.length - 1) !== '/') {
|
||
link += '/';
|
||
}
|
||
link += file;
|
||
} else {
|
||
if ((app === 'settings' || app === 'core' || app === 'search') && type === 'ajax') {
|
||
link += '/index.php/';
|
||
} else {
|
||
link += '/';
|
||
}
|
||
if (!isCore) {
|
||
link += 'apps/';
|
||
}
|
||
if (app !== '') {
|
||
app += '/';
|
||
link += app;
|
||
}
|
||
if (type) {
|
||
link += type + '/';
|
||
}
|
||
link += file;
|
||
}
|
||
return link;
|
||
};
|
||
|
||
/**
|
||
* Return the web root path where this Nextcloud instance
|
||
* is accessible, with a leading slash.
|
||
* For example "/nextcloud".
|
||
*
|
||
* @return {string} web root path
|
||
*/
|
||
exports.generateFilePath = generateFilePath;
|
||
function getRootUrl() {
|
||
let webroot = window._oc_webroot;
|
||
if (typeof webroot === 'undefined') {
|
||
webroot = location.pathname;
|
||
const pos = webroot.indexOf('/index.php/');
|
||
if (pos !== -1) {
|
||
webroot = webroot.substr(0, pos);
|
||
} else {
|
||
webroot = webroot.substr(0, webroot.lastIndexOf('/'));
|
||
}
|
||
}
|
||
return webroot;
|
||
}
|
||
|
||
/**
|
||
* Return the web root path for a given app
|
||
* @param {string} app The ID of the app
|
||
*/
|
||
function getAppRootUrl(app) {
|
||
var _window$_oc_appswebro, _webroots$app;
|
||
const webroots = (_window$_oc_appswebro = window._oc_appswebroots) !== null && _window$_oc_appswebro !== void 0 ? _window$_oc_appswebro : {};
|
||
return (_webroots$app = webroots[app]) !== null && _webroots$app !== void 0 ? _webroots$app : '';
|
||
}
|
||
//# sourceMappingURL=index.js.map
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/Appointments/Confirmation.vue?vue&type=script&lang=js":
|
||
/*!*****************************************************************************************************************************************************************************!*\
|
||
!*** ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/Appointments/Confirmation.vue?vue&type=script&lang=js ***!
|
||
\*****************************************************************************************************************************************************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||
/* harmony export */ });
|
||
/* harmony import */ var _nextcloud_moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/moment */ "./node_modules/@nextcloud/moment/dist/index.mjs");
|
||
|
||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
||
name: 'Confirmation',
|
||
props: {
|
||
booking: {
|
||
required: true,
|
||
type: Object
|
||
}
|
||
},
|
||
computed: {
|
||
startDate() {
|
||
return (0,_nextcloud_moment__WEBPACK_IMPORTED_MODULE_0__["default"])(this.booking.start * 1000).format('LLL');
|
||
},
|
||
endDate() {
|
||
return (0,_nextcloud_moment__WEBPACK_IMPORTED_MODULE_0__["default"])(this.booking.end * 1000).format('LLL');
|
||
}
|
||
}
|
||
});
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/Appointments/Confirmation.vue?vue&type=template&id=74f5bdf4":
|
||
/*!****************************************************************************************************************************************************************************************************************************************************************!*\
|
||
!*** ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/Appointments/Confirmation.vue?vue&type=template&id=74f5bdf4 ***!
|
||
\****************************************************************************************************************************************************************************************************************************************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ render: () => (/* binding */ render),
|
||
/* harmony export */ staticRenderFns: () => (/* binding */ staticRenderFns)
|
||
/* harmony export */ });
|
||
var render = function render() {
|
||
var _vm = this,
|
||
_c = _vm._self._c;
|
||
return _c("div", {
|
||
staticClass: "update"
|
||
}, [_vm._v("\n\t" + _vm._s(_vm.$t("calendar", "The slot for your appointment has been confirmed")) + "\n\t"), _c("br"), _vm._v(" "), _c("br"), _vm._v("\n\t" + _vm._s(_vm.$t("calendar", "Appointment Details:")) + "\n\t"), _c("br"), _vm._v("\n\t" + _vm._s(_vm.$t("calendar", "Time:")) + " "), _c("b", [_vm._v(_vm._s(_vm.startDate))]), _vm._v(" - "), _c("b", [_vm._v(_vm._s(_vm.endDate))]), _vm._v(" "), _c("br"), _vm._v("\n\t" + _vm._s(_vm.$t("calendar", "Booked for:")) + " " + _vm._s(_vm.booking.displayName) + " (" + _vm._s(_vm.booking.email) + ")\n\t"), _c("br"), _vm._v(" "), _c("br")]);
|
||
};
|
||
var staticRenderFns = [];
|
||
render._withStripped = true;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/dompurify/dist/purify.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/dompurify/dist/purify.js ***!
|
||
\***********************************************/
|
||
/***/ (function(module) {
|
||
|
||
/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */
|
||
|
||
(function (global, factory) {
|
||
true ? module.exports = factory() :
|
||
0;
|
||
})(this, (function () { 'use strict';
|
||
|
||
const {
|
||
entries,
|
||
setPrototypeOf,
|
||
isFrozen,
|
||
getPrototypeOf,
|
||
getOwnPropertyDescriptor
|
||
} = Object;
|
||
let {
|
||
freeze,
|
||
seal,
|
||
create
|
||
} = Object; // eslint-disable-line import/no-mutable-exports
|
||
let {
|
||
apply,
|
||
construct
|
||
} = typeof Reflect !== 'undefined' && Reflect;
|
||
if (!freeze) {
|
||
freeze = function freeze(x) {
|
||
return x;
|
||
};
|
||
}
|
||
if (!seal) {
|
||
seal = function seal(x) {
|
||
return x;
|
||
};
|
||
}
|
||
if (!apply) {
|
||
apply = function apply(fun, thisValue, args) {
|
||
return fun.apply(thisValue, args);
|
||
};
|
||
}
|
||
if (!construct) {
|
||
construct = function construct(Func, args) {
|
||
return new Func(...args);
|
||
};
|
||
}
|
||
const arrayForEach = unapply(Array.prototype.forEach);
|
||
const arrayPop = unapply(Array.prototype.pop);
|
||
const arrayPush = unapply(Array.prototype.push);
|
||
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
||
const stringToString = unapply(String.prototype.toString);
|
||
const stringMatch = unapply(String.prototype.match);
|
||
const stringReplace = unapply(String.prototype.replace);
|
||
const stringIndexOf = unapply(String.prototype.indexOf);
|
||
const stringTrim = unapply(String.prototype.trim);
|
||
const regExpTest = unapply(RegExp.prototype.test);
|
||
const typeErrorCreate = unconstruct(TypeError);
|
||
|
||
/**
|
||
* Creates a new function that calls the given function with a specified thisArg and arguments.
|
||
*
|
||
* @param {Function} func - The function to be wrapped and called.
|
||
* @returns {Function} A new function that calls the given function with a specified thisArg and arguments.
|
||
*/
|
||
function unapply(func) {
|
||
return function (thisArg) {
|
||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||
args[_key - 1] = arguments[_key];
|
||
}
|
||
return apply(func, thisArg, args);
|
||
};
|
||
}
|
||
|
||
/**
|
||
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
|
||
*
|
||
* @param {Function} func - The constructor function to be wrapped and called.
|
||
* @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.
|
||
*/
|
||
function unconstruct(func) {
|
||
return function () {
|
||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||
args[_key2] = arguments[_key2];
|
||
}
|
||
return construct(func, args);
|
||
};
|
||
}
|
||
|
||
/**
|
||
* Add properties to a lookup table
|
||
*
|
||
* @param {Object} set - The set to which elements will be added.
|
||
* @param {Array} array - The array containing elements to be added to the set.
|
||
* @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.
|
||
* @returns {Object} The modified set with added elements.
|
||
*/
|
||
function addToSet(set, array) {
|
||
let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
|
||
if (setPrototypeOf) {
|
||
// Make 'in' and truthy checks like Boolean(set.constructor)
|
||
// independent of any properties defined on Object.prototype.
|
||
// Prevent prototype setters from intercepting set as a this value.
|
||
setPrototypeOf(set, null);
|
||
}
|
||
let l = array.length;
|
||
while (l--) {
|
||
let element = array[l];
|
||
if (typeof element === 'string') {
|
||
const lcElement = transformCaseFunc(element);
|
||
if (lcElement !== element) {
|
||
// Config presets (e.g. tags.js, attrs.js) are immutable.
|
||
if (!isFrozen(array)) {
|
||
array[l] = lcElement;
|
||
}
|
||
element = lcElement;
|
||
}
|
||
}
|
||
set[element] = true;
|
||
}
|
||
return set;
|
||
}
|
||
|
||
/**
|
||
* Clean up an array to harden against CSPP
|
||
*
|
||
* @param {Array} array - The array to be cleaned.
|
||
* @returns {Array} The cleaned version of the array
|
||
*/
|
||
function cleanArray(array) {
|
||
for (let index = 0; index < array.length; index++) {
|
||
if (getOwnPropertyDescriptor(array, index) === undefined) {
|
||
array[index] = null;
|
||
}
|
||
}
|
||
return array;
|
||
}
|
||
|
||
/**
|
||
* Shallow clone an object
|
||
*
|
||
* @param {Object} object - The object to be cloned.
|
||
* @returns {Object} A new object that copies the original.
|
||
*/
|
||
function clone(object) {
|
||
const newObject = create(null);
|
||
for (const [property, value] of entries(object)) {
|
||
if (getOwnPropertyDescriptor(object, property) !== undefined) {
|
||
if (Array.isArray(value)) {
|
||
newObject[property] = cleanArray(value);
|
||
} else if (value && typeof value === 'object' && value.constructor === Object) {
|
||
newObject[property] = clone(value);
|
||
} else {
|
||
newObject[property] = value;
|
||
}
|
||
}
|
||
}
|
||
return newObject;
|
||
}
|
||
|
||
/**
|
||
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
||
*
|
||
* @param {Object} object - The object to look up the getter function in its prototype chain.
|
||
* @param {String} prop - The property name for which to find the getter function.
|
||
* @returns {Function} The getter function found in the prototype chain or a fallback function.
|
||
*/
|
||
function lookupGetter(object, prop) {
|
||
while (object !== null) {
|
||
const desc = getOwnPropertyDescriptor(object, prop);
|
||
if (desc) {
|
||
if (desc.get) {
|
||
return unapply(desc.get);
|
||
}
|
||
if (typeof desc.value === 'function') {
|
||
return unapply(desc.value);
|
||
}
|
||
}
|
||
object = getPrototypeOf(object);
|
||
}
|
||
function fallbackValue(element) {
|
||
console.warn('fallback value for', element);
|
||
return null;
|
||
}
|
||
return fallbackValue;
|
||
}
|
||
|
||
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
||
|
||
// SVG
|
||
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
||
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
||
|
||
// List of SVG elements that are disallowed by default.
|
||
// We still need to know them so that we can do namespace
|
||
// checks properly in case one wants to add them to
|
||
// allow-list.
|
||
const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
|
||
const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
|
||
|
||
// Similarly to SVG, we want to know all MathML elements,
|
||
// even those that we disallow by default.
|
||
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
||
const text = freeze(['#text']);
|
||
|
||
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);
|
||
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
||
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
||
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
||
|
||
// eslint-disable-next-line unicorn/better-regex
|
||
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
||
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
||
const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
|
||
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
|
||
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
||
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
||
);
|
||
|
||
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
||
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
||
);
|
||
|
||
const DOCTYPE_NAME = seal(/^html$/i);
|
||
|
||
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
||
__proto__: null,
|
||
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
||
ERB_EXPR: ERB_EXPR,
|
||
TMPLIT_EXPR: TMPLIT_EXPR,
|
||
DATA_ATTR: DATA_ATTR,
|
||
ARIA_ATTR: ARIA_ATTR,
|
||
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
||
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
||
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
||
DOCTYPE_NAME: DOCTYPE_NAME
|
||
});
|
||
|
||
const getGlobal = function getGlobal() {
|
||
return typeof window === 'undefined' ? null : window;
|
||
};
|
||
|
||
/**
|
||
* Creates a no-op policy for internal use only.
|
||
* Don't export this function outside this module!
|
||
* @param {TrustedTypePolicyFactory} trustedTypes The policy factory.
|
||
* @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
|
||
* @return {TrustedTypePolicy} The policy created (or null, if Trusted Types
|
||
* are not supported or creating the policy failed).
|
||
*/
|
||
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
|
||
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
||
return null;
|
||
}
|
||
|
||
// Allow the callers to control the unique policy name
|
||
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
||
// Policy creation with duplicate names throws in Trusted Types.
|
||
let suffix = null;
|
||
const ATTR_NAME = 'data-tt-policy-suffix';
|
||
if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
|
||
suffix = purifyHostElement.getAttribute(ATTR_NAME);
|
||
}
|
||
const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
|
||
try {
|
||
return trustedTypes.createPolicy(policyName, {
|
||
createHTML(html) {
|
||
return html;
|
||
},
|
||
createScriptURL(scriptUrl) {
|
||
return scriptUrl;
|
||
}
|
||
});
|
||
} catch (_) {
|
||
// Policy creation failed (most likely another DOMPurify script has
|
||
// already run). Skip creating the policy, as this will only cause errors
|
||
// if TT are enforced.
|
||
console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
|
||
return null;
|
||
}
|
||
};
|
||
function createDOMPurify() {
|
||
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
||
const DOMPurify = root => createDOMPurify(root);
|
||
|
||
/**
|
||
* Version label, exposed for easier checks
|
||
* if DOMPurify is up to date or not
|
||
*/
|
||
DOMPurify.version = '3.0.8';
|
||
|
||
/**
|
||
* Array of elements that DOMPurify removed during sanitation.
|
||
* Empty if nothing was removed.
|
||
*/
|
||
DOMPurify.removed = [];
|
||
if (!window || !window.document || window.document.nodeType !== 9) {
|
||
// Not running in a browser, provide a factory function
|
||
// so that you can pass your own Window
|
||
DOMPurify.isSupported = false;
|
||
return DOMPurify;
|
||
}
|
||
let {
|
||
document
|
||
} = window;
|
||
const originalDocument = document;
|
||
const currentScript = originalDocument.currentScript;
|
||
const {
|
||
DocumentFragment,
|
||
HTMLTemplateElement,
|
||
Node,
|
||
Element,
|
||
NodeFilter,
|
||
NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
|
||
HTMLFormElement,
|
||
DOMParser,
|
||
trustedTypes
|
||
} = window;
|
||
const ElementPrototype = Element.prototype;
|
||
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
||
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
||
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
||
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
||
|
||
// As per issue #47, the web-components registry is inherited by a
|
||
// new document created via createHTMLDocument. As per the spec
|
||
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
||
// a new empty registry is used when creating a template contents owner
|
||
// document, so we use that as our parent document to ensure nothing
|
||
// is inherited.
|
||
if (typeof HTMLTemplateElement === 'function') {
|
||
const template = document.createElement('template');
|
||
if (template.content && template.content.ownerDocument) {
|
||
document = template.content.ownerDocument;
|
||
}
|
||
}
|
||
let trustedTypesPolicy;
|
||
let emptyHTML = '';
|
||
const {
|
||
implementation,
|
||
createNodeIterator,
|
||
createDocumentFragment,
|
||
getElementsByTagName
|
||
} = document;
|
||
const {
|
||
importNode
|
||
} = originalDocument;
|
||
let hooks = {};
|
||
|
||
/**
|
||
* Expose whether this browser supports running the full DOMPurify.
|
||
*/
|
||
DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
|
||
const {
|
||
MUSTACHE_EXPR,
|
||
ERB_EXPR,
|
||
TMPLIT_EXPR,
|
||
DATA_ATTR,
|
||
ARIA_ATTR,
|
||
IS_SCRIPT_OR_DATA,
|
||
ATTR_WHITESPACE
|
||
} = EXPRESSIONS;
|
||
let {
|
||
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
||
} = EXPRESSIONS;
|
||
|
||
/**
|
||
* We consider the elements and attributes below to be safe. Ideally
|
||
* don't add any new ones but feel free to remove unwanted ones.
|
||
*/
|
||
|
||
/* allowed element names */
|
||
let ALLOWED_TAGS = null;
|
||
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
|
||
|
||
/* Allowed attribute names */
|
||
let ALLOWED_ATTR = null;
|
||
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
|
||
|
||
/*
|
||
* Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.
|
||
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
|
||
* @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
|
||
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
|
||
*/
|
||
let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
|
||
tagNameCheck: {
|
||
writable: true,
|
||
configurable: false,
|
||
enumerable: true,
|
||
value: null
|
||
},
|
||
attributeNameCheck: {
|
||
writable: true,
|
||
configurable: false,
|
||
enumerable: true,
|
||
value: null
|
||
},
|
||
allowCustomizedBuiltInElements: {
|
||
writable: true,
|
||
configurable: false,
|
||
enumerable: true,
|
||
value: false
|
||
}
|
||
}));
|
||
|
||
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
||
let FORBID_TAGS = null;
|
||
|
||
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
||
let FORBID_ATTR = null;
|
||
|
||
/* Decide if ARIA attributes are okay */
|
||
let ALLOW_ARIA_ATTR = true;
|
||
|
||
/* Decide if custom data attributes are okay */
|
||
let ALLOW_DATA_ATTR = true;
|
||
|
||
/* Decide if unknown protocols are okay */
|
||
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
||
|
||
/* Decide if self-closing tags in attributes are allowed.
|
||
* Usually removed due to a mXSS issue in jQuery 3.0 */
|
||
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
||
|
||
/* Output should be safe for common template engines.
|
||
* This means, DOMPurify removes data attributes, mustaches and ERB
|
||
*/
|
||
let SAFE_FOR_TEMPLATES = false;
|
||
|
||
/* Decide if document with <html>... should be returned */
|
||
let WHOLE_DOCUMENT = false;
|
||
|
||
/* Track whether config is already set on this instance of DOMPurify. */
|
||
let SET_CONFIG = false;
|
||
|
||
/* Decide if all elements (e.g. style, script) must be children of
|
||
* document.body. By default, browsers might move them to document.head */
|
||
let FORCE_BODY = false;
|
||
|
||
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
||
* string (or a TrustedHTML object if Trusted Types are supported).
|
||
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
||
*/
|
||
let RETURN_DOM = false;
|
||
|
||
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
||
* string (or a TrustedHTML object if Trusted Types are supported) */
|
||
let RETURN_DOM_FRAGMENT = false;
|
||
|
||
/* Try to return a Trusted Type object instead of a string, return a string in
|
||
* case Trusted Types are not supported */
|
||
let RETURN_TRUSTED_TYPE = false;
|
||
|
||
/* Output should be free from DOM clobbering attacks?
|
||
* This sanitizes markups named with colliding, clobberable built-in DOM APIs.
|
||
*/
|
||
let SANITIZE_DOM = true;
|
||
|
||
/* Achieve full DOM Clobbering protection by isolating the namespace of named
|
||
* properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
|
||
*
|
||
* HTML/DOM spec rules that enable DOM Clobbering:
|
||
* - Named Access on Window (§7.3.3)
|
||
* - DOM Tree Accessors (§3.1.5)
|
||
* - Form Element Parent-Child Relations (§4.10.3)
|
||
* - Iframe srcdoc / Nested WindowProxies (§4.8.5)
|
||
* - HTMLCollection (§4.2.10.2)
|
||
*
|
||
* Namespace isolation is implemented by prefixing `id` and `name` attributes
|
||
* with a constant string, i.e., `user-content-`
|
||
*/
|
||
let SANITIZE_NAMED_PROPS = false;
|
||
const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
|
||
|
||
/* Keep element content when removing element? */
|
||
let KEEP_CONTENT = true;
|
||
|
||
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
||
* of importing it into a new Document and returning a sanitized copy */
|
||
let IN_PLACE = false;
|
||
|
||
/* Allow usage of profiles like html, svg and mathMl */
|
||
let USE_PROFILES = {};
|
||
|
||
/* Tags to ignore content of when KEEP_CONTENT is true */
|
||
let FORBID_CONTENTS = null;
|
||
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
||
|
||
/* Tags that are safe for data: URIs */
|
||
let DATA_URI_TAGS = null;
|
||
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
||
|
||
/* Attributes safe for values like "javascript:" */
|
||
let URI_SAFE_ATTRIBUTES = null;
|
||
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
|
||
const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
||
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
||
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
||
/* Document namespace */
|
||
let NAMESPACE = HTML_NAMESPACE;
|
||
let IS_EMPTY_INPUT = false;
|
||
|
||
/* Allowed XHTML+XML namespaces */
|
||
let ALLOWED_NAMESPACES = null;
|
||
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
||
|
||
/* Parsing of strict XHTML documents */
|
||
let PARSER_MEDIA_TYPE = null;
|
||
const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
|
||
const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
|
||
let transformCaseFunc = null;
|
||
|
||
/* Keep a reference to config to pass to hooks */
|
||
let CONFIG = null;
|
||
|
||
/* Ideally, do not touch anything below this line */
|
||
/* ______________________________________________ */
|
||
|
||
const formElement = document.createElement('form');
|
||
const isRegexOrFunction = function isRegexOrFunction(testValue) {
|
||
return testValue instanceof RegExp || testValue instanceof Function;
|
||
};
|
||
|
||
/**
|
||
* _parseConfig
|
||
*
|
||
* @param {Object} cfg optional config literal
|
||
*/
|
||
// eslint-disable-next-line complexity
|
||
const _parseConfig = function _parseConfig() {
|
||
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||
if (CONFIG && CONFIG === cfg) {
|
||
return;
|
||
}
|
||
|
||
/* Shield configuration object from tampering */
|
||
if (!cfg || typeof cfg !== 'object') {
|
||
cfg = {};
|
||
}
|
||
|
||
/* Shield configuration object from prototype pollution */
|
||
cfg = clone(cfg);
|
||
PARSER_MEDIA_TYPE =
|
||
// eslint-disable-next-line unicorn/prefer-includes
|
||
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
||
|
||
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
||
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
||
|
||
/* Set configuration parameters */
|
||
ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
||
ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
||
ALLOWED_NAMESPACES = 'ALLOWED_NAMESPACES' in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
||
URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),
|
||
// eslint-disable-line indent
|
||
cfg.ADD_URI_SAFE_ATTR,
|
||
// eslint-disable-line indent
|
||
transformCaseFunc // eslint-disable-line indent
|
||
) // eslint-disable-line indent
|
||
: DEFAULT_URI_SAFE_ATTRIBUTES;
|
||
DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS),
|
||
// eslint-disable-line indent
|
||
cfg.ADD_DATA_URI_TAGS,
|
||
// eslint-disable-line indent
|
||
transformCaseFunc // eslint-disable-line indent
|
||
) // eslint-disable-line indent
|
||
: DEFAULT_DATA_URI_TAGS;
|
||
FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
||
FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
|
||
FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
|
||
USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;
|
||
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
||
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
||
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
|
||
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
|
||
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
|
||
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
|
||
RETURN_DOM = cfg.RETURN_DOM || false; // Default false
|
||
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
|
||
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
|
||
FORCE_BODY = cfg.FORCE_BODY || false; // Default false
|
||
SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
|
||
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
|
||
KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
|
||
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
||
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
||
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
||
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
||
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
||
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
||
}
|
||
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
|
||
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
|
||
}
|
||
if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
|
||
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
|
||
}
|
||
if (SAFE_FOR_TEMPLATES) {
|
||
ALLOW_DATA_ATTR = false;
|
||
}
|
||
if (RETURN_DOM_FRAGMENT) {
|
||
RETURN_DOM = true;
|
||
}
|
||
|
||
/* Parse profile info */
|
||
if (USE_PROFILES) {
|
||
ALLOWED_TAGS = addToSet({}, text);
|
||
ALLOWED_ATTR = [];
|
||
if (USE_PROFILES.html === true) {
|
||
addToSet(ALLOWED_TAGS, html$1);
|
||
addToSet(ALLOWED_ATTR, html);
|
||
}
|
||
if (USE_PROFILES.svg === true) {
|
||
addToSet(ALLOWED_TAGS, svg$1);
|
||
addToSet(ALLOWED_ATTR, svg);
|
||
addToSet(ALLOWED_ATTR, xml);
|
||
}
|
||
if (USE_PROFILES.svgFilters === true) {
|
||
addToSet(ALLOWED_TAGS, svgFilters);
|
||
addToSet(ALLOWED_ATTR, svg);
|
||
addToSet(ALLOWED_ATTR, xml);
|
||
}
|
||
if (USE_PROFILES.mathMl === true) {
|
||
addToSet(ALLOWED_TAGS, mathMl$1);
|
||
addToSet(ALLOWED_ATTR, mathMl);
|
||
addToSet(ALLOWED_ATTR, xml);
|
||
}
|
||
}
|
||
|
||
/* Merge configuration parameters */
|
||
if (cfg.ADD_TAGS) {
|
||
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
||
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
||
}
|
||
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
||
}
|
||
if (cfg.ADD_ATTR) {
|
||
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
||
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
||
}
|
||
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
||
}
|
||
if (cfg.ADD_URI_SAFE_ATTR) {
|
||
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
||
}
|
||
if (cfg.FORBID_CONTENTS) {
|
||
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
||
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
||
}
|
||
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
||
}
|
||
|
||
/* Add #text in case KEEP_CONTENT is set to true */
|
||
if (KEEP_CONTENT) {
|
||
ALLOWED_TAGS['#text'] = true;
|
||
}
|
||
|
||
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
|
||
if (WHOLE_DOCUMENT) {
|
||
addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
|
||
}
|
||
|
||
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
|
||
if (ALLOWED_TAGS.table) {
|
||
addToSet(ALLOWED_TAGS, ['tbody']);
|
||
delete FORBID_TAGS.tbody;
|
||
}
|
||
if (cfg.TRUSTED_TYPES_POLICY) {
|
||
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
|
||
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
||
}
|
||
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
||
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
||
}
|
||
|
||
// Overwrite existing TrustedTypes policy.
|
||
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
||
|
||
// Sign local variables required by `sanitize`.
|
||
emptyHTML = trustedTypesPolicy.createHTML('');
|
||
} else {
|
||
// Uninitialized policy, attempt to initialize the internal dompurify policy.
|
||
if (trustedTypesPolicy === undefined) {
|
||
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
||
}
|
||
|
||
// If creating the internal policy succeeded sign internal variables.
|
||
if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
|
||
emptyHTML = trustedTypesPolicy.createHTML('');
|
||
}
|
||
}
|
||
|
||
// Prevent further manipulation of configuration.
|
||
// Not available in IE8, Safari 5, etc.
|
||
if (freeze) {
|
||
freeze(cfg);
|
||
}
|
||
CONFIG = cfg;
|
||
};
|
||
const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
||
const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);
|
||
|
||
// Certain elements are allowed in both SVG and HTML
|
||
// namespace. We need to specify them explicitly
|
||
// so that they don't get erroneously deleted from
|
||
// HTML namespace.
|
||
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
||
|
||
/* Keep track of all possible SVG and MathML tags
|
||
* so that we can perform the namespace checks
|
||
* correctly. */
|
||
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
||
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
||
|
||
/**
|
||
* @param {Element} element a DOM element whose namespace is being checked
|
||
* @returns {boolean} Return false if the element has a
|
||
* namespace that a spec-compliant parser would never
|
||
* return. Return true otherwise.
|
||
*/
|
||
const _checkValidNamespace = function _checkValidNamespace(element) {
|
||
let parent = getParentNode(element);
|
||
|
||
// In JSDOM, if we're inside shadow DOM, then parentNode
|
||
// can be null. We just simulate parent in this case.
|
||
if (!parent || !parent.tagName) {
|
||
parent = {
|
||
namespaceURI: NAMESPACE,
|
||
tagName: 'template'
|
||
};
|
||
}
|
||
const tagName = stringToLowerCase(element.tagName);
|
||
const parentTagName = stringToLowerCase(parent.tagName);
|
||
if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
|
||
return false;
|
||
}
|
||
if (element.namespaceURI === SVG_NAMESPACE) {
|
||
// The only way to switch from HTML namespace to SVG
|
||
// is via <svg>. If it happens via any other tag, then
|
||
// it should be killed.
|
||
if (parent.namespaceURI === HTML_NAMESPACE) {
|
||
return tagName === 'svg';
|
||
}
|
||
|
||
// The only way to switch from MathML to SVG is via`
|
||
// svg if parent is either <annotation-xml> or MathML
|
||
// text integration points.
|
||
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
||
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
||
}
|
||
|
||
// We only allow elements that are defined in SVG
|
||
// spec. All others are disallowed in SVG namespace.
|
||
return Boolean(ALL_SVG_TAGS[tagName]);
|
||
}
|
||
if (element.namespaceURI === MATHML_NAMESPACE) {
|
||
// The only way to switch from HTML namespace to MathML
|
||
// is via <math>. If it happens via any other tag, then
|
||
// it should be killed.
|
||
if (parent.namespaceURI === HTML_NAMESPACE) {
|
||
return tagName === 'math';
|
||
}
|
||
|
||
// The only way to switch from SVG to MathML is via
|
||
// <math> and HTML integration points
|
||
if (parent.namespaceURI === SVG_NAMESPACE) {
|
||
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
||
}
|
||
|
||
// We only allow elements that are defined in MathML
|
||
// spec. All others are disallowed in MathML namespace.
|
||
return Boolean(ALL_MATHML_TAGS[tagName]);
|
||
}
|
||
if (element.namespaceURI === HTML_NAMESPACE) {
|
||
// The only way to switch from SVG to HTML is via
|
||
// HTML integration points, and from MathML to HTML
|
||
// is via MathML text integration points
|
||
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
||
return false;
|
||
}
|
||
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
||
return false;
|
||
}
|
||
|
||
// We disallow tags that are specific for MathML
|
||
// or SVG and should never appear in HTML namespace
|
||
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
||
}
|
||
|
||
// For XHTML and XML documents that support custom namespaces
|
||
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
||
return true;
|
||
}
|
||
|
||
// The code should never reach this place (this means
|
||
// that the element somehow got namespace that is not
|
||
// HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
|
||
// Return false just in case.
|
||
return false;
|
||
};
|
||
|
||
/**
|
||
* _forceRemove
|
||
*
|
||
* @param {Node} node a DOM node
|
||
*/
|
||
const _forceRemove = function _forceRemove(node) {
|
||
arrayPush(DOMPurify.removed, {
|
||
element: node
|
||
});
|
||
try {
|
||
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
||
node.parentNode.removeChild(node);
|
||
} catch (_) {
|
||
node.remove();
|
||
}
|
||
};
|
||
|
||
/**
|
||
* _removeAttribute
|
||
*
|
||
* @param {String} name an Attribute name
|
||
* @param {Node} node a DOM node
|
||
*/
|
||
const _removeAttribute = function _removeAttribute(name, node) {
|
||
try {
|
||
arrayPush(DOMPurify.removed, {
|
||
attribute: node.getAttributeNode(name),
|
||
from: node
|
||
});
|
||
} catch (_) {
|
||
arrayPush(DOMPurify.removed, {
|
||
attribute: null,
|
||
from: node
|
||
});
|
||
}
|
||
node.removeAttribute(name);
|
||
|
||
// We void attribute values for unremovable "is"" attributes
|
||
if (name === 'is' && !ALLOWED_ATTR[name]) {
|
||
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
||
try {
|
||
_forceRemove(node);
|
||
} catch (_) {}
|
||
} else {
|
||
try {
|
||
node.setAttribute(name, '');
|
||
} catch (_) {}
|
||
}
|
||
}
|
||
};
|
||
|
||
/**
|
||
* _initDocument
|
||
*
|
||
* @param {String} dirty a string of dirty markup
|
||
* @return {Document} a DOM, filled with the dirty markup
|
||
*/
|
||
const _initDocument = function _initDocument(dirty) {
|
||
/* Create a HTML document */
|
||
let doc = null;
|
||
let leadingWhitespace = null;
|
||
if (FORCE_BODY) {
|
||
dirty = '<remove></remove>' + dirty;
|
||
} else {
|
||
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
|
||
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
||
leadingWhitespace = matches && matches[0];
|
||
}
|
||
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
|
||
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
|
||
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
||
}
|
||
const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
||
/*
|
||
* Use the DOMParser API by default, fallback later if needs be
|
||
* DOMParser not work for svg when has multiple root element.
|
||
*/
|
||
if (NAMESPACE === HTML_NAMESPACE) {
|
||
try {
|
||
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
||
} catch (_) {}
|
||
}
|
||
|
||
/* Use createHTMLDocument in case DOMParser is not available */
|
||
if (!doc || !doc.documentElement) {
|
||
doc = implementation.createDocument(NAMESPACE, 'template', null);
|
||
try {
|
||
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
|
||
} catch (_) {
|
||
// Syntax error if dirtyPayload is invalid xml
|
||
}
|
||
}
|
||
const body = doc.body || doc.documentElement;
|
||
if (dirty && leadingWhitespace) {
|
||
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
||
}
|
||
|
||
/* Work on whole document or just its body */
|
||
if (NAMESPACE === HTML_NAMESPACE) {
|
||
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
|
||
}
|
||
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
||
};
|
||
|
||
/**
|
||
* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
|
||
*
|
||
* @param {Node} root The root element or node to start traversing on.
|
||
* @return {NodeIterator} The created NodeIterator
|
||
*/
|
||
const _createNodeIterator = function _createNodeIterator(root) {
|
||
return createNodeIterator.call(root.ownerDocument || root, root,
|
||
// eslint-disable-next-line no-bitwise
|
||
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null);
|
||
};
|
||
|
||
/**
|
||
* _isClobbered
|
||
*
|
||
* @param {Node} elm element to check for clobbering attacks
|
||
* @return {Boolean} true if clobbered, false if safe
|
||
*/
|
||
const _isClobbered = function _isClobbered(elm) {
|
||
return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');
|
||
};
|
||
|
||
/**
|
||
* Checks whether the given object is a DOM node.
|
||
*
|
||
* @param {Node} object object to check whether it's a DOM node
|
||
* @return {Boolean} true is object is a DOM node
|
||
*/
|
||
const _isNode = function _isNode(object) {
|
||
return typeof Node === 'function' && object instanceof Node;
|
||
};
|
||
|
||
/**
|
||
* _executeHook
|
||
* Execute user configurable hooks
|
||
*
|
||
* @param {String} entryPoint Name of the hook's entry point
|
||
* @param {Node} currentNode node to work on with the hook
|
||
* @param {Object} data additional hook parameters
|
||
*/
|
||
const _executeHook = function _executeHook(entryPoint, currentNode, data) {
|
||
if (!hooks[entryPoint]) {
|
||
return;
|
||
}
|
||
arrayForEach(hooks[entryPoint], hook => {
|
||
hook.call(DOMPurify, currentNode, data, CONFIG);
|
||
});
|
||
};
|
||
|
||
/**
|
||
* _sanitizeElements
|
||
*
|
||
* @protect nodeName
|
||
* @protect textContent
|
||
* @protect removeChild
|
||
*
|
||
* @param {Node} currentNode to check for permission to exist
|
||
* @return {Boolean} true if node was killed, false if left alive
|
||
*/
|
||
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
||
let content = null;
|
||
|
||
/* Execute a hook if present */
|
||
_executeHook('beforeSanitizeElements', currentNode, null);
|
||
|
||
/* Check if element is clobbered or can clobber */
|
||
if (_isClobbered(currentNode)) {
|
||
_forceRemove(currentNode);
|
||
return true;
|
||
}
|
||
|
||
/* Now let's check the element's type and name */
|
||
const tagName = transformCaseFunc(currentNode.nodeName);
|
||
|
||
/* Execute a hook if present */
|
||
_executeHook('uponSanitizeElement', currentNode, {
|
||
tagName,
|
||
allowedTags: ALLOWED_TAGS
|
||
});
|
||
|
||
/* Detect mXSS attempts abusing namespace confusion */
|
||
if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
|
||
_forceRemove(currentNode);
|
||
return true;
|
||
}
|
||
|
||
/* Remove element if anything forbids its presence */
|
||
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
||
/* Check if we have a custom element to handle */
|
||
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
||
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
||
return false;
|
||
}
|
||
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
||
return false;
|
||
}
|
||
}
|
||
|
||
/* Keep content except for bad-listed elements */
|
||
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
||
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
||
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
||
if (childNodes && parentNode) {
|
||
const childCount = childNodes.length;
|
||
for (let i = childCount - 1; i >= 0; --i) {
|
||
parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
|
||
}
|
||
}
|
||
}
|
||
_forceRemove(currentNode);
|
||
return true;
|
||
}
|
||
|
||
/* Check whether element has a valid namespace */
|
||
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
||
_forceRemove(currentNode);
|
||
return true;
|
||
}
|
||
|
||
/* Make sure that older browsers don't get fallback-tag mXSS */
|
||
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
|
||
_forceRemove(currentNode);
|
||
return true;
|
||
}
|
||
|
||
/* Sanitize element content to be template-safe */
|
||
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
|
||
/* Get the element's text content */
|
||
content = currentNode.textContent;
|
||
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
||
content = stringReplace(content, expr, ' ');
|
||
});
|
||
if (currentNode.textContent !== content) {
|
||
arrayPush(DOMPurify.removed, {
|
||
element: currentNode.cloneNode()
|
||
});
|
||
currentNode.textContent = content;
|
||
}
|
||
}
|
||
|
||
/* Execute a hook if present */
|
||
_executeHook('afterSanitizeElements', currentNode, null);
|
||
return false;
|
||
};
|
||
|
||
/**
|
||
* _isValidAttribute
|
||
*
|
||
* @param {string} lcTag Lowercase tag name of containing element.
|
||
* @param {string} lcName Lowercase attribute name.
|
||
* @param {string} value Attribute value.
|
||
* @return {Boolean} Returns true if `value` is valid, otherwise false.
|
||
*/
|
||
// eslint-disable-next-line complexity
|
||
const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
||
/* Make sure attribute cannot clobber */
|
||
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
||
return false;
|
||
}
|
||
|
||
/* Allow valid data-* attributes: At least one character after "-"
|
||
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
||
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
||
We don't need to check the value; it's always URI safe. */
|
||
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
||
if (
|
||
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
||
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
||
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
||
_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
|
||
// Alternative, second condition checks if it's an `is`-attribute, AND
|
||
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
||
lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
|
||
return false;
|
||
}
|
||
/* Check value is safe. First, is attr inert? If so, is safe */
|
||
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
|
||
return false;
|
||
} else ;
|
||
return true;
|
||
};
|
||
|
||
/**
|
||
* _isBasicCustomElement
|
||
* checks if at least one dash is included in tagName, and it's not the first char
|
||
* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
|
||
*
|
||
* @param {string} tagName name of the tag of the node to sanitize
|
||
* @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
||
*/
|
||
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
||
return tagName.indexOf('-') > 0;
|
||
};
|
||
|
||
/**
|
||
* _sanitizeAttributes
|
||
*
|
||
* @protect attributes
|
||
* @protect nodeName
|
||
* @protect removeAttribute
|
||
* @protect setAttribute
|
||
*
|
||
* @param {Node} currentNode to sanitize
|
||
*/
|
||
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
||
/* Execute a hook if present */
|
||
_executeHook('beforeSanitizeAttributes', currentNode, null);
|
||
const {
|
||
attributes
|
||
} = currentNode;
|
||
|
||
/* Check if we have attributes; if not we might have a text node */
|
||
if (!attributes) {
|
||
return;
|
||
}
|
||
const hookEvent = {
|
||
attrName: '',
|
||
attrValue: '',
|
||
keepAttr: true,
|
||
allowedAttributes: ALLOWED_ATTR
|
||
};
|
||
let l = attributes.length;
|
||
|
||
/* Go backwards over all attributes; safely remove bad ones */
|
||
while (l--) {
|
||
const attr = attributes[l];
|
||
const {
|
||
name,
|
||
namespaceURI,
|
||
value: attrValue
|
||
} = attr;
|
||
const lcName = transformCaseFunc(name);
|
||
let value = name === 'value' ? attrValue : stringTrim(attrValue);
|
||
|
||
/* Execute a hook if present */
|
||
hookEvent.attrName = lcName;
|
||
hookEvent.attrValue = value;
|
||
hookEvent.keepAttr = true;
|
||
hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
|
||
_executeHook('uponSanitizeAttribute', currentNode, hookEvent);
|
||
value = hookEvent.attrValue;
|
||
/* Did the hooks approve of the attribute? */
|
||
if (hookEvent.forceKeepAttr) {
|
||
continue;
|
||
}
|
||
|
||
/* Remove attribute */
|
||
_removeAttribute(name, currentNode);
|
||
|
||
/* Did the hooks approve of the attribute? */
|
||
if (!hookEvent.keepAttr) {
|
||
continue;
|
||
}
|
||
|
||
/* Work around a security issue in jQuery 3.0 */
|
||
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
||
_removeAttribute(name, currentNode);
|
||
continue;
|
||
}
|
||
|
||
/* Sanitize attribute content to be template-safe */
|
||
if (SAFE_FOR_TEMPLATES) {
|
||
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
||
value = stringReplace(value, expr, ' ');
|
||
});
|
||
}
|
||
|
||
/* Is `value` valid for this attribute? */
|
||
const lcTag = transformCaseFunc(currentNode.nodeName);
|
||
if (!_isValidAttribute(lcTag, lcName, value)) {
|
||
continue;
|
||
}
|
||
|
||
/* Full DOM Clobbering protection via namespace isolation,
|
||
* Prefix id and name attributes with `user-content-`
|
||
*/
|
||
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
||
// Remove the attribute with this value
|
||
_removeAttribute(name, currentNode);
|
||
|
||
// Prefix the value and later re-create the attribute with the sanitized value
|
||
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
||
}
|
||
|
||
/* Handle attributes that require Trusted Types */
|
||
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
||
if (namespaceURI) ; else {
|
||
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
||
case 'TrustedHTML':
|
||
{
|
||
value = trustedTypesPolicy.createHTML(value);
|
||
break;
|
||
}
|
||
case 'TrustedScriptURL':
|
||
{
|
||
value = trustedTypesPolicy.createScriptURL(value);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/* Handle invalid data-* attribute set by try-catching it */
|
||
try {
|
||
if (namespaceURI) {
|
||
currentNode.setAttributeNS(namespaceURI, name, value);
|
||
} else {
|
||
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
||
currentNode.setAttribute(name, value);
|
||
}
|
||
arrayPop(DOMPurify.removed);
|
||
} catch (_) {}
|
||
}
|
||
|
||
/* Execute a hook if present */
|
||
_executeHook('afterSanitizeAttributes', currentNode, null);
|
||
};
|
||
|
||
/**
|
||
* _sanitizeShadowDOM
|
||
*
|
||
* @param {DocumentFragment} fragment to iterate over recursively
|
||
*/
|
||
const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
||
let shadowNode = null;
|
||
const shadowIterator = _createNodeIterator(fragment);
|
||
|
||
/* Execute a hook if present */
|
||
_executeHook('beforeSanitizeShadowDOM', fragment, null);
|
||
while (shadowNode = shadowIterator.nextNode()) {
|
||
/* Execute a hook if present */
|
||
_executeHook('uponSanitizeShadowNode', shadowNode, null);
|
||
|
||
/* Sanitize tags and elements */
|
||
if (_sanitizeElements(shadowNode)) {
|
||
continue;
|
||
}
|
||
|
||
/* Deep shadow DOM detected */
|
||
if (shadowNode.content instanceof DocumentFragment) {
|
||
_sanitizeShadowDOM(shadowNode.content);
|
||
}
|
||
|
||
/* Check attributes, sanitize if necessary */
|
||
_sanitizeAttributes(shadowNode);
|
||
}
|
||
|
||
/* Execute a hook if present */
|
||
_executeHook('afterSanitizeShadowDOM', fragment, null);
|
||
};
|
||
|
||
/**
|
||
* Sanitize
|
||
* Public method providing core sanitation functionality
|
||
*
|
||
* @param {String|Node} dirty string or DOM node
|
||
* @param {Object} cfg object
|
||
*/
|
||
// eslint-disable-next-line complexity
|
||
DOMPurify.sanitize = function (dirty) {
|
||
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||
let body = null;
|
||
let importedNode = null;
|
||
let currentNode = null;
|
||
let returnNode = null;
|
||
/* Make sure we have a string to sanitize.
|
||
DO NOT return early, as this will return the wrong type if
|
||
the user has requested a DOM object rather than a string */
|
||
IS_EMPTY_INPUT = !dirty;
|
||
if (IS_EMPTY_INPUT) {
|
||
dirty = '<!-->';
|
||
}
|
||
|
||
/* Stringify, in case dirty is an object */
|
||
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
||
if (typeof dirty.toString === 'function') {
|
||
dirty = dirty.toString();
|
||
if (typeof dirty !== 'string') {
|
||
throw typeErrorCreate('dirty is not a string, aborting');
|
||
}
|
||
} else {
|
||
throw typeErrorCreate('toString is not a function');
|
||
}
|
||
}
|
||
|
||
/* Return dirty HTML if DOMPurify cannot run */
|
||
if (!DOMPurify.isSupported) {
|
||
return dirty;
|
||
}
|
||
|
||
/* Assign config vars */
|
||
if (!SET_CONFIG) {
|
||
_parseConfig(cfg);
|
||
}
|
||
|
||
/* Clean up removed elements */
|
||
DOMPurify.removed = [];
|
||
|
||
/* Check if dirty is correctly typed for IN_PLACE */
|
||
if (typeof dirty === 'string') {
|
||
IN_PLACE = false;
|
||
}
|
||
if (IN_PLACE) {
|
||
/* Do some early pre-sanitization to avoid unsafe root nodes */
|
||
if (dirty.nodeName) {
|
||
const tagName = transformCaseFunc(dirty.nodeName);
|
||
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
||
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
||
}
|
||
}
|
||
} else if (dirty instanceof Node) {
|
||
/* If dirty is a DOM element, append to an empty document to avoid
|
||
elements being stripped by the parser */
|
||
body = _initDocument('<!---->');
|
||
importedNode = body.ownerDocument.importNode(dirty, true);
|
||
if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {
|
||
/* Node is already a body, use as is */
|
||
body = importedNode;
|
||
} else if (importedNode.nodeName === 'HTML') {
|
||
body = importedNode;
|
||
} else {
|
||
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
||
body.appendChild(importedNode);
|
||
}
|
||
} else {
|
||
/* Exit directly if we have nothing to do */
|
||
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
||
// eslint-disable-next-line unicorn/prefer-includes
|
||
dirty.indexOf('<') === -1) {
|
||
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
||
}
|
||
|
||
/* Initialize the document to work on */
|
||
body = _initDocument(dirty);
|
||
|
||
/* Check we have a DOM node from the data */
|
||
if (!body) {
|
||
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
|
||
}
|
||
}
|
||
|
||
/* Remove first element node (ours) if FORCE_BODY is set */
|
||
if (body && FORCE_BODY) {
|
||
_forceRemove(body.firstChild);
|
||
}
|
||
|
||
/* Get node iterator */
|
||
const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
||
|
||
/* Now start iterating over the created document */
|
||
while (currentNode = nodeIterator.nextNode()) {
|
||
/* Sanitize tags and elements */
|
||
if (_sanitizeElements(currentNode)) {
|
||
continue;
|
||
}
|
||
|
||
/* Shadow DOM detected, sanitize it */
|
||
if (currentNode.content instanceof DocumentFragment) {
|
||
_sanitizeShadowDOM(currentNode.content);
|
||
}
|
||
|
||
/* Check attributes, sanitize if necessary */
|
||
_sanitizeAttributes(currentNode);
|
||
}
|
||
|
||
/* If we sanitized `dirty` in-place, return it. */
|
||
if (IN_PLACE) {
|
||
return dirty;
|
||
}
|
||
|
||
/* Return sanitized string or DOM */
|
||
if (RETURN_DOM) {
|
||
if (RETURN_DOM_FRAGMENT) {
|
||
returnNode = createDocumentFragment.call(body.ownerDocument);
|
||
while (body.firstChild) {
|
||
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
||
returnNode.appendChild(body.firstChild);
|
||
}
|
||
} else {
|
||
returnNode = body;
|
||
}
|
||
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
|
||
/*
|
||
AdoptNode() is not used because internal state is not reset
|
||
(e.g. the past names map of a HTMLFormElement), this is safe
|
||
in theory but we would rather not risk another attack vector.
|
||
The state that is cloned by importNode() is explicitly defined
|
||
by the specs.
|
||
*/
|
||
returnNode = importNode.call(originalDocument, returnNode, true);
|
||
}
|
||
return returnNode;
|
||
}
|
||
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
||
|
||
/* Serialize doctype if allowed */
|
||
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
||
serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
|
||
}
|
||
|
||
/* Sanitize final string template-safe */
|
||
if (SAFE_FOR_TEMPLATES) {
|
||
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
||
serializedHTML = stringReplace(serializedHTML, expr, ' ');
|
||
});
|
||
}
|
||
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
||
};
|
||
|
||
/**
|
||
* Public method to set the configuration once
|
||
* setConfig
|
||
*
|
||
* @param {Object} cfg configuration object
|
||
*/
|
||
DOMPurify.setConfig = function () {
|
||
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||
_parseConfig(cfg);
|
||
SET_CONFIG = true;
|
||
};
|
||
|
||
/**
|
||
* Public method to remove the configuration
|
||
* clearConfig
|
||
*
|
||
*/
|
||
DOMPurify.clearConfig = function () {
|
||
CONFIG = null;
|
||
SET_CONFIG = false;
|
||
};
|
||
|
||
/**
|
||
* Public method to check if an attribute value is valid.
|
||
* Uses last set config, if any. Otherwise, uses config defaults.
|
||
* isValidAttribute
|
||
*
|
||
* @param {String} tag Tag name of containing element.
|
||
* @param {String} attr Attribute name.
|
||
* @param {String} value Attribute value.
|
||
* @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
|
||
*/
|
||
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
||
/* Initialize shared config vars if necessary. */
|
||
if (!CONFIG) {
|
||
_parseConfig({});
|
||
}
|
||
const lcTag = transformCaseFunc(tag);
|
||
const lcName = transformCaseFunc(attr);
|
||
return _isValidAttribute(lcTag, lcName, value);
|
||
};
|
||
|
||
/**
|
||
* AddHook
|
||
* Public method to add DOMPurify hooks
|
||
*
|
||
* @param {String} entryPoint entry point for the hook to add
|
||
* @param {Function} hookFunction function to execute
|
||
*/
|
||
DOMPurify.addHook = function (entryPoint, hookFunction) {
|
||
if (typeof hookFunction !== 'function') {
|
||
return;
|
||
}
|
||
hooks[entryPoint] = hooks[entryPoint] || [];
|
||
arrayPush(hooks[entryPoint], hookFunction);
|
||
};
|
||
|
||
/**
|
||
* RemoveHook
|
||
* Public method to remove a DOMPurify hook at a given entryPoint
|
||
* (pops it from the stack of hooks if more are present)
|
||
*
|
||
* @param {String} entryPoint entry point for the hook to remove
|
||
* @return {Function} removed(popped) hook
|
||
*/
|
||
DOMPurify.removeHook = function (entryPoint) {
|
||
if (hooks[entryPoint]) {
|
||
return arrayPop(hooks[entryPoint]);
|
||
}
|
||
};
|
||
|
||
/**
|
||
* RemoveHooks
|
||
* Public method to remove all DOMPurify hooks at a given entryPoint
|
||
*
|
||
* @param {String} entryPoint entry point for the hooks to remove
|
||
*/
|
||
DOMPurify.removeHooks = function (entryPoint) {
|
||
if (hooks[entryPoint]) {
|
||
hooks[entryPoint] = [];
|
||
}
|
||
};
|
||
|
||
/**
|
||
* RemoveAllHooks
|
||
* Public method to remove all DOMPurify hooks
|
||
*/
|
||
DOMPurify.removeAllHooks = function () {
|
||
hooks = {};
|
||
};
|
||
return DOMPurify;
|
||
}
|
||
var purify = createDOMPurify();
|
||
|
||
return purify;
|
||
|
||
}));
|
||
//# sourceMappingURL=purify.js.map
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/escape-html/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/escape-html/index.js ***!
|
||
\*******************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
/*!
|
||
* escape-html
|
||
* Copyright(c) 2012-2013 TJ Holowaychuk
|
||
* Copyright(c) 2015 Andreas Lubbe
|
||
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
||
* MIT Licensed
|
||
*/
|
||
|
||
|
||
|
||
/**
|
||
* Module variables.
|
||
* @private
|
||
*/
|
||
|
||
var matchHtmlRegExp = /["'&<>]/;
|
||
|
||
/**
|
||
* Module exports.
|
||
* @public
|
||
*/
|
||
|
||
module.exports = escapeHtml;
|
||
|
||
/**
|
||
* Escape special characters in the given string of html.
|
||
*
|
||
* @param {string} string The string to escape for inserting into HTML
|
||
* @return {string}
|
||
* @public
|
||
*/
|
||
|
||
function escapeHtml(string) {
|
||
var str = '' + string;
|
||
var match = matchHtmlRegExp.exec(str);
|
||
|
||
if (!match) {
|
||
return str;
|
||
}
|
||
|
||
var escape;
|
||
var html = '';
|
||
var index = 0;
|
||
var lastIndex = 0;
|
||
|
||
for (index = match.index; index < str.length; index++) {
|
||
switch (str.charCodeAt(index)) {
|
||
case 34: // "
|
||
escape = '"';
|
||
break;
|
||
case 38: // &
|
||
escape = '&';
|
||
break;
|
||
case 39: // '
|
||
escape = ''';
|
||
break;
|
||
case 60: // <
|
||
escape = '<';
|
||
break;
|
||
case 62: // >
|
||
escape = '>';
|
||
break;
|
||
default:
|
||
continue;
|
||
}
|
||
|
||
if (lastIndex !== index) {
|
||
html += str.substring(lastIndex, index);
|
||
}
|
||
|
||
lastIndex = index + 1;
|
||
html += escape;
|
||
}
|
||
|
||
return lastIndex !== index
|
||
? html + str.substring(lastIndex, index)
|
||
: html;
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/lodash.get/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/lodash.get/index.js ***!
|
||
\******************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
/**
|
||
* lodash (Custom Build) <https://lodash.com/>
|
||
* Build: `lodash modularize exports="npm" -o ./`
|
||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/
|
||
|
||
/** Used as the `TypeError` message for "Functions" methods. */
|
||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||
|
||
/** Used to stand-in for `undefined` hash values. */
|
||
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
||
|
||
/** Used as references for various `Number` constants. */
|
||
var INFINITY = 1 / 0;
|
||
|
||
/** `Object#toString` result references. */
|
||
var funcTag = '[object Function]',
|
||
genTag = '[object GeneratorFunction]',
|
||
symbolTag = '[object Symbol]';
|
||
|
||
/** Used to match property names within property paths. */
|
||
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
||
reIsPlainProp = /^\w*$/,
|
||
reLeadingDot = /^\./,
|
||
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
||
|
||
/**
|
||
* Used to match `RegExp`
|
||
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
||
*/
|
||
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
||
|
||
/** Used to match backslashes in property paths. */
|
||
var reEscapeChar = /\\(\\)?/g;
|
||
|
||
/** Used to detect host constructors (Safari). */
|
||
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
||
|
||
/** Detect free variable `global` from Node.js. */
|
||
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
|
||
|
||
/** Detect free variable `self`. */
|
||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
||
|
||
/** Used as a reference to the global object. */
|
||
var root = freeGlobal || freeSelf || Function('return this')();
|
||
|
||
/**
|
||
* Gets the value at `key` of `object`.
|
||
*
|
||
* @private
|
||
* @param {Object} [object] The object to query.
|
||
* @param {string} key The key of the property to get.
|
||
* @returns {*} Returns the property value.
|
||
*/
|
||
function getValue(object, key) {
|
||
return object == null ? undefined : object[key];
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is a host object in IE < 9.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
||
*/
|
||
function isHostObject(value) {
|
||
// Many host objects are `Object` objects that can coerce to strings
|
||
// despite having improperly defined `toString` methods.
|
||
var result = false;
|
||
if (value != null && typeof value.toString != 'function') {
|
||
try {
|
||
result = !!(value + '');
|
||
} catch (e) {}
|
||
}
|
||
return result;
|
||
}
|
||
|
||
/** Used for built-in method references. */
|
||
var arrayProto = Array.prototype,
|
||
funcProto = Function.prototype,
|
||
objectProto = Object.prototype;
|
||
|
||
/** Used to detect overreaching core-js shims. */
|
||
var coreJsData = root['__core-js_shared__'];
|
||
|
||
/** Used to detect methods masquerading as native. */
|
||
var maskSrcKey = (function() {
|
||
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
||
return uid ? ('Symbol(src)_1.' + uid) : '';
|
||
}());
|
||
|
||
/** Used to resolve the decompiled source of functions. */
|
||
var funcToString = funcProto.toString;
|
||
|
||
/** Used to check objects for own properties. */
|
||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||
|
||
/**
|
||
* Used to resolve the
|
||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||
* of values.
|
||
*/
|
||
var objectToString = objectProto.toString;
|
||
|
||
/** Used to detect if a method is native. */
|
||
var reIsNative = RegExp('^' +
|
||
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
||
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
||
);
|
||
|
||
/** Built-in value references. */
|
||
var Symbol = root.Symbol,
|
||
splice = arrayProto.splice;
|
||
|
||
/* Built-in method references that are verified to be native. */
|
||
var Map = getNative(root, 'Map'),
|
||
nativeCreate = getNative(Object, 'create');
|
||
|
||
/** Used to convert symbols to primitives and strings. */
|
||
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
||
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
||
|
||
/**
|
||
* Creates a hash object.
|
||
*
|
||
* @private
|
||
* @constructor
|
||
* @param {Array} [entries] The key-value pairs to cache.
|
||
*/
|
||
function Hash(entries) {
|
||
var index = -1,
|
||
length = entries ? entries.length : 0;
|
||
|
||
this.clear();
|
||
while (++index < length) {
|
||
var entry = entries[index];
|
||
this.set(entry[0], entry[1]);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Removes all key-value entries from the hash.
|
||
*
|
||
* @private
|
||
* @name clear
|
||
* @memberOf Hash
|
||
*/
|
||
function hashClear() {
|
||
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
||
}
|
||
|
||
/**
|
||
* Removes `key` and its value from the hash.
|
||
*
|
||
* @private
|
||
* @name delete
|
||
* @memberOf Hash
|
||
* @param {Object} hash The hash to modify.
|
||
* @param {string} key The key of the value to remove.
|
||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||
*/
|
||
function hashDelete(key) {
|
||
return this.has(key) && delete this.__data__[key];
|
||
}
|
||
|
||
/**
|
||
* Gets the hash value for `key`.
|
||
*
|
||
* @private
|
||
* @name get
|
||
* @memberOf Hash
|
||
* @param {string} key The key of the value to get.
|
||
* @returns {*} Returns the entry value.
|
||
*/
|
||
function hashGet(key) {
|
||
var data = this.__data__;
|
||
if (nativeCreate) {
|
||
var result = data[key];
|
||
return result === HASH_UNDEFINED ? undefined : result;
|
||
}
|
||
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
||
}
|
||
|
||
/**
|
||
* Checks if a hash value for `key` exists.
|
||
*
|
||
* @private
|
||
* @name has
|
||
* @memberOf Hash
|
||
* @param {string} key The key of the entry to check.
|
||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||
*/
|
||
function hashHas(key) {
|
||
var data = this.__data__;
|
||
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
||
}
|
||
|
||
/**
|
||
* Sets the hash `key` to `value`.
|
||
*
|
||
* @private
|
||
* @name set
|
||
* @memberOf Hash
|
||
* @param {string} key The key of the value to set.
|
||
* @param {*} value The value to set.
|
||
* @returns {Object} Returns the hash instance.
|
||
*/
|
||
function hashSet(key, value) {
|
||
var data = this.__data__;
|
||
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
||
return this;
|
||
}
|
||
|
||
// Add methods to `Hash`.
|
||
Hash.prototype.clear = hashClear;
|
||
Hash.prototype['delete'] = hashDelete;
|
||
Hash.prototype.get = hashGet;
|
||
Hash.prototype.has = hashHas;
|
||
Hash.prototype.set = hashSet;
|
||
|
||
/**
|
||
* Creates an list cache object.
|
||
*
|
||
* @private
|
||
* @constructor
|
||
* @param {Array} [entries] The key-value pairs to cache.
|
||
*/
|
||
function ListCache(entries) {
|
||
var index = -1,
|
||
length = entries ? entries.length : 0;
|
||
|
||
this.clear();
|
||
while (++index < length) {
|
||
var entry = entries[index];
|
||
this.set(entry[0], entry[1]);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Removes all key-value entries from the list cache.
|
||
*
|
||
* @private
|
||
* @name clear
|
||
* @memberOf ListCache
|
||
*/
|
||
function listCacheClear() {
|
||
this.__data__ = [];
|
||
}
|
||
|
||
/**
|
||
* Removes `key` and its value from the list cache.
|
||
*
|
||
* @private
|
||
* @name delete
|
||
* @memberOf ListCache
|
||
* @param {string} key The key of the value to remove.
|
||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||
*/
|
||
function listCacheDelete(key) {
|
||
var data = this.__data__,
|
||
index = assocIndexOf(data, key);
|
||
|
||
if (index < 0) {
|
||
return false;
|
||
}
|
||
var lastIndex = data.length - 1;
|
||
if (index == lastIndex) {
|
||
data.pop();
|
||
} else {
|
||
splice.call(data, index, 1);
|
||
}
|
||
return true;
|
||
}
|
||
|
||
/**
|
||
* Gets the list cache value for `key`.
|
||
*
|
||
* @private
|
||
* @name get
|
||
* @memberOf ListCache
|
||
* @param {string} key The key of the value to get.
|
||
* @returns {*} Returns the entry value.
|
||
*/
|
||
function listCacheGet(key) {
|
||
var data = this.__data__,
|
||
index = assocIndexOf(data, key);
|
||
|
||
return index < 0 ? undefined : data[index][1];
|
||
}
|
||
|
||
/**
|
||
* Checks if a list cache value for `key` exists.
|
||
*
|
||
* @private
|
||
* @name has
|
||
* @memberOf ListCache
|
||
* @param {string} key The key of the entry to check.
|
||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||
*/
|
||
function listCacheHas(key) {
|
||
return assocIndexOf(this.__data__, key) > -1;
|
||
}
|
||
|
||
/**
|
||
* Sets the list cache `key` to `value`.
|
||
*
|
||
* @private
|
||
* @name set
|
||
* @memberOf ListCache
|
||
* @param {string} key The key of the value to set.
|
||
* @param {*} value The value to set.
|
||
* @returns {Object} Returns the list cache instance.
|
||
*/
|
||
function listCacheSet(key, value) {
|
||
var data = this.__data__,
|
||
index = assocIndexOf(data, key);
|
||
|
||
if (index < 0) {
|
||
data.push([key, value]);
|
||
} else {
|
||
data[index][1] = value;
|
||
}
|
||
return this;
|
||
}
|
||
|
||
// Add methods to `ListCache`.
|
||
ListCache.prototype.clear = listCacheClear;
|
||
ListCache.prototype['delete'] = listCacheDelete;
|
||
ListCache.prototype.get = listCacheGet;
|
||
ListCache.prototype.has = listCacheHas;
|
||
ListCache.prototype.set = listCacheSet;
|
||
|
||
/**
|
||
* Creates a map cache object to store key-value pairs.
|
||
*
|
||
* @private
|
||
* @constructor
|
||
* @param {Array} [entries] The key-value pairs to cache.
|
||
*/
|
||
function MapCache(entries) {
|
||
var index = -1,
|
||
length = entries ? entries.length : 0;
|
||
|
||
this.clear();
|
||
while (++index < length) {
|
||
var entry = entries[index];
|
||
this.set(entry[0], entry[1]);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Removes all key-value entries from the map.
|
||
*
|
||
* @private
|
||
* @name clear
|
||
* @memberOf MapCache
|
||
*/
|
||
function mapCacheClear() {
|
||
this.__data__ = {
|
||
'hash': new Hash,
|
||
'map': new (Map || ListCache),
|
||
'string': new Hash
|
||
};
|
||
}
|
||
|
||
/**
|
||
* Removes `key` and its value from the map.
|
||
*
|
||
* @private
|
||
* @name delete
|
||
* @memberOf MapCache
|
||
* @param {string} key The key of the value to remove.
|
||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||
*/
|
||
function mapCacheDelete(key) {
|
||
return getMapData(this, key)['delete'](key);
|
||
}
|
||
|
||
/**
|
||
* Gets the map value for `key`.
|
||
*
|
||
* @private
|
||
* @name get
|
||
* @memberOf MapCache
|
||
* @param {string} key The key of the value to get.
|
||
* @returns {*} Returns the entry value.
|
||
*/
|
||
function mapCacheGet(key) {
|
||
return getMapData(this, key).get(key);
|
||
}
|
||
|
||
/**
|
||
* Checks if a map value for `key` exists.
|
||
*
|
||
* @private
|
||
* @name has
|
||
* @memberOf MapCache
|
||
* @param {string} key The key of the entry to check.
|
||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||
*/
|
||
function mapCacheHas(key) {
|
||
return getMapData(this, key).has(key);
|
||
}
|
||
|
||
/**
|
||
* Sets the map `key` to `value`.
|
||
*
|
||
* @private
|
||
* @name set
|
||
* @memberOf MapCache
|
||
* @param {string} key The key of the value to set.
|
||
* @param {*} value The value to set.
|
||
* @returns {Object} Returns the map cache instance.
|
||
*/
|
||
function mapCacheSet(key, value) {
|
||
getMapData(this, key).set(key, value);
|
||
return this;
|
||
}
|
||
|
||
// Add methods to `MapCache`.
|
||
MapCache.prototype.clear = mapCacheClear;
|
||
MapCache.prototype['delete'] = mapCacheDelete;
|
||
MapCache.prototype.get = mapCacheGet;
|
||
MapCache.prototype.has = mapCacheHas;
|
||
MapCache.prototype.set = mapCacheSet;
|
||
|
||
/**
|
||
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
||
*
|
||
* @private
|
||
* @param {Array} array The array to inspect.
|
||
* @param {*} key The key to search for.
|
||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||
*/
|
||
function assocIndexOf(array, key) {
|
||
var length = array.length;
|
||
while (length--) {
|
||
if (eq(array[length][0], key)) {
|
||
return length;
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
/**
|
||
* The base implementation of `_.get` without support for default values.
|
||
*
|
||
* @private
|
||
* @param {Object} object The object to query.
|
||
* @param {Array|string} path The path of the property to get.
|
||
* @returns {*} Returns the resolved value.
|
||
*/
|
||
function baseGet(object, path) {
|
||
path = isKey(path, object) ? [path] : castPath(path);
|
||
|
||
var index = 0,
|
||
length = path.length;
|
||
|
||
while (object != null && index < length) {
|
||
object = object[toKey(path[index++])];
|
||
}
|
||
return (index && index == length) ? object : undefined;
|
||
}
|
||
|
||
/**
|
||
* The base implementation of `_.isNative` without bad shim checks.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is a native function,
|
||
* else `false`.
|
||
*/
|
||
function baseIsNative(value) {
|
||
if (!isObject(value) || isMasked(value)) {
|
||
return false;
|
||
}
|
||
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
||
return pattern.test(toSource(value));
|
||
}
|
||
|
||
/**
|
||
* The base implementation of `_.toString` which doesn't convert nullish
|
||
* values to empty strings.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to process.
|
||
* @returns {string} Returns the string.
|
||
*/
|
||
function baseToString(value) {
|
||
// Exit early for strings to avoid a performance hit in some environments.
|
||
if (typeof value == 'string') {
|
||
return value;
|
||
}
|
||
if (isSymbol(value)) {
|
||
return symbolToString ? symbolToString.call(value) : '';
|
||
}
|
||
var result = (value + '');
|
||
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
||
}
|
||
|
||
/**
|
||
* Casts `value` to a path array if it's not one.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to inspect.
|
||
* @returns {Array} Returns the cast property path array.
|
||
*/
|
||
function castPath(value) {
|
||
return isArray(value) ? value : stringToPath(value);
|
||
}
|
||
|
||
/**
|
||
* Gets the data for `map`.
|
||
*
|
||
* @private
|
||
* @param {Object} map The map to query.
|
||
* @param {string} key The reference key.
|
||
* @returns {*} Returns the map data.
|
||
*/
|
||
function getMapData(map, key) {
|
||
var data = map.__data__;
|
||
return isKeyable(key)
|
||
? data[typeof key == 'string' ? 'string' : 'hash']
|
||
: data.map;
|
||
}
|
||
|
||
/**
|
||
* Gets the native function at `key` of `object`.
|
||
*
|
||
* @private
|
||
* @param {Object} object The object to query.
|
||
* @param {string} key The key of the method to get.
|
||
* @returns {*} Returns the function if it's native, else `undefined`.
|
||
*/
|
||
function getNative(object, key) {
|
||
var value = getValue(object, key);
|
||
return baseIsNative(value) ? value : undefined;
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is a property name and not a property path.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to check.
|
||
* @param {Object} [object] The object to query keys on.
|
||
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
||
*/
|
||
function isKey(value, object) {
|
||
if (isArray(value)) {
|
||
return false;
|
||
}
|
||
var type = typeof value;
|
||
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
||
value == null || isSymbol(value)) {
|
||
return true;
|
||
}
|
||
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
||
(object != null && value in Object(object));
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is suitable for use as unique object key.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
||
*/
|
||
function isKeyable(value) {
|
||
var type = typeof value;
|
||
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
||
? (value !== '__proto__')
|
||
: (value === null);
|
||
}
|
||
|
||
/**
|
||
* Checks if `func` has its source masked.
|
||
*
|
||
* @private
|
||
* @param {Function} func The function to check.
|
||
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
||
*/
|
||
function isMasked(func) {
|
||
return !!maskSrcKey && (maskSrcKey in func);
|
||
}
|
||
|
||
/**
|
||
* Converts `string` to a property path array.
|
||
*
|
||
* @private
|
||
* @param {string} string The string to convert.
|
||
* @returns {Array} Returns the property path array.
|
||
*/
|
||
var stringToPath = memoize(function(string) {
|
||
string = toString(string);
|
||
|
||
var result = [];
|
||
if (reLeadingDot.test(string)) {
|
||
result.push('');
|
||
}
|
||
string.replace(rePropName, function(match, number, quote, string) {
|
||
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
|
||
});
|
||
return result;
|
||
});
|
||
|
||
/**
|
||
* Converts `value` to a string key if it's not a string or symbol.
|
||
*
|
||
* @private
|
||
* @param {*} value The value to inspect.
|
||
* @returns {string|symbol} Returns the key.
|
||
*/
|
||
function toKey(value) {
|
||
if (typeof value == 'string' || isSymbol(value)) {
|
||
return value;
|
||
}
|
||
var result = (value + '');
|
||
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
||
}
|
||
|
||
/**
|
||
* Converts `func` to its source code.
|
||
*
|
||
* @private
|
||
* @param {Function} func The function to process.
|
||
* @returns {string} Returns the source code.
|
||
*/
|
||
function toSource(func) {
|
||
if (func != null) {
|
||
try {
|
||
return funcToString.call(func);
|
||
} catch (e) {}
|
||
try {
|
||
return (func + '');
|
||
} catch (e) {}
|
||
}
|
||
return '';
|
||
}
|
||
|
||
/**
|
||
* Creates a function that memoizes the result of `func`. If `resolver` is
|
||
* provided, it determines the cache key for storing the result based on the
|
||
* arguments provided to the memoized function. By default, the first argument
|
||
* provided to the memoized function is used as the map cache key. The `func`
|
||
* is invoked with the `this` binding of the memoized function.
|
||
*
|
||
* **Note:** The cache is exposed as the `cache` property on the memoized
|
||
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
||
* constructor with one whose instances implement the
|
||
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
||
* method interface of `delete`, `get`, `has`, and `set`.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 0.1.0
|
||
* @category Function
|
||
* @param {Function} func The function to have its output memoized.
|
||
* @param {Function} [resolver] The function to resolve the cache key.
|
||
* @returns {Function} Returns the new memoized function.
|
||
* @example
|
||
*
|
||
* var object = { 'a': 1, 'b': 2 };
|
||
* var other = { 'c': 3, 'd': 4 };
|
||
*
|
||
* var values = _.memoize(_.values);
|
||
* values(object);
|
||
* // => [1, 2]
|
||
*
|
||
* values(other);
|
||
* // => [3, 4]
|
||
*
|
||
* object.a = 2;
|
||
* values(object);
|
||
* // => [1, 2]
|
||
*
|
||
* // Modify the result cache.
|
||
* values.cache.set(object, ['a', 'b']);
|
||
* values(object);
|
||
* // => ['a', 'b']
|
||
*
|
||
* // Replace `_.memoize.Cache`.
|
||
* _.memoize.Cache = WeakMap;
|
||
*/
|
||
function memoize(func, resolver) {
|
||
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
|
||
throw new TypeError(FUNC_ERROR_TEXT);
|
||
}
|
||
var memoized = function() {
|
||
var args = arguments,
|
||
key = resolver ? resolver.apply(this, args) : args[0],
|
||
cache = memoized.cache;
|
||
|
||
if (cache.has(key)) {
|
||
return cache.get(key);
|
||
}
|
||
var result = func.apply(this, args);
|
||
memoized.cache = cache.set(key, result);
|
||
return result;
|
||
};
|
||
memoized.cache = new (memoize.Cache || MapCache);
|
||
return memoized;
|
||
}
|
||
|
||
// Assign cache to `_.memoize`.
|
||
memoize.Cache = MapCache;
|
||
|
||
/**
|
||
* Performs a
|
||
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
||
* comparison between two values to determine if they are equivalent.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 4.0.0
|
||
* @category Lang
|
||
* @param {*} value The value to compare.
|
||
* @param {*} other The other value to compare.
|
||
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
||
* @example
|
||
*
|
||
* var object = { 'a': 1 };
|
||
* var other = { 'a': 1 };
|
||
*
|
||
* _.eq(object, object);
|
||
* // => true
|
||
*
|
||
* _.eq(object, other);
|
||
* // => false
|
||
*
|
||
* _.eq('a', 'a');
|
||
* // => true
|
||
*
|
||
* _.eq('a', Object('a'));
|
||
* // => false
|
||
*
|
||
* _.eq(NaN, NaN);
|
||
* // => true
|
||
*/
|
||
function eq(value, other) {
|
||
return value === other || (value !== value && other !== other);
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is classified as an `Array` object.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 0.1.0
|
||
* @category Lang
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
||
* @example
|
||
*
|
||
* _.isArray([1, 2, 3]);
|
||
* // => true
|
||
*
|
||
* _.isArray(document.body.children);
|
||
* // => false
|
||
*
|
||
* _.isArray('abc');
|
||
* // => false
|
||
*
|
||
* _.isArray(_.noop);
|
||
* // => false
|
||
*/
|
||
var isArray = Array.isArray;
|
||
|
||
/**
|
||
* Checks if `value` is classified as a `Function` object.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 0.1.0
|
||
* @category Lang
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
||
* @example
|
||
*
|
||
* _.isFunction(_);
|
||
* // => true
|
||
*
|
||
* _.isFunction(/abc/);
|
||
* // => false
|
||
*/
|
||
function isFunction(value) {
|
||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
||
var tag = isObject(value) ? objectToString.call(value) : '';
|
||
return tag == funcTag || tag == genTag;
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is the
|
||
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
||
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 0.1.0
|
||
* @category Lang
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
||
* @example
|
||
*
|
||
* _.isObject({});
|
||
* // => true
|
||
*
|
||
* _.isObject([1, 2, 3]);
|
||
* // => true
|
||
*
|
||
* _.isObject(_.noop);
|
||
* // => true
|
||
*
|
||
* _.isObject(null);
|
||
* // => false
|
||
*/
|
||
function isObject(value) {
|
||
var type = typeof value;
|
||
return !!value && (type == 'object' || type == 'function');
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
||
* and has a `typeof` result of "object".
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 4.0.0
|
||
* @category Lang
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
||
* @example
|
||
*
|
||
* _.isObjectLike({});
|
||
* // => true
|
||
*
|
||
* _.isObjectLike([1, 2, 3]);
|
||
* // => true
|
||
*
|
||
* _.isObjectLike(_.noop);
|
||
* // => false
|
||
*
|
||
* _.isObjectLike(null);
|
||
* // => false
|
||
*/
|
||
function isObjectLike(value) {
|
||
return !!value && typeof value == 'object';
|
||
}
|
||
|
||
/**
|
||
* Checks if `value` is classified as a `Symbol` primitive or object.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 4.0.0
|
||
* @category Lang
|
||
* @param {*} value The value to check.
|
||
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
||
* @example
|
||
*
|
||
* _.isSymbol(Symbol.iterator);
|
||
* // => true
|
||
*
|
||
* _.isSymbol('abc');
|
||
* // => false
|
||
*/
|
||
function isSymbol(value) {
|
||
return typeof value == 'symbol' ||
|
||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
||
}
|
||
|
||
/**
|
||
* Converts `value` to a string. An empty string is returned for `null`
|
||
* and `undefined` values. The sign of `-0` is preserved.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 4.0.0
|
||
* @category Lang
|
||
* @param {*} value The value to process.
|
||
* @returns {string} Returns the string.
|
||
* @example
|
||
*
|
||
* _.toString(null);
|
||
* // => ''
|
||
*
|
||
* _.toString(-0);
|
||
* // => '-0'
|
||
*
|
||
* _.toString([1, 2, 3]);
|
||
* // => '1,2,3'
|
||
*/
|
||
function toString(value) {
|
||
return value == null ? '' : baseToString(value);
|
||
}
|
||
|
||
/**
|
||
* Gets the value at `path` of `object`. If the resolved value is
|
||
* `undefined`, the `defaultValue` is returned in its place.
|
||
*
|
||
* @static
|
||
* @memberOf _
|
||
* @since 3.7.0
|
||
* @category Object
|
||
* @param {Object} object The object to query.
|
||
* @param {Array|string} path The path of the property to get.
|
||
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
||
* @returns {*} Returns the resolved value.
|
||
* @example
|
||
*
|
||
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
||
*
|
||
* _.get(object, 'a[0].b.c');
|
||
* // => 3
|
||
*
|
||
* _.get(object, ['a', '0', 'b', 'c']);
|
||
* // => 3
|
||
*
|
||
* _.get(object, 'a.b.c', 'default');
|
||
* // => 'default'
|
||
*/
|
||
function get(object, path, defaultValue) {
|
||
var result = object == null ? undefined : baseGet(object, path);
|
||
return result === undefined ? defaultValue : result;
|
||
}
|
||
|
||
module.exports = get;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/moment/min/moment-with-locales.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/moment/min/moment-with-locales.js ***!
|
||
\********************************************************/
|
||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
||
|
||
/* module decorator */ module = __webpack_require__.nmd(module);
|
||
;(function (global, factory) {
|
||
true ? module.exports = factory() :
|
||
0
|
||
}(this, (function () { 'use strict';
|
||
|
||
var hookCallback;
|
||
|
||
function hooks() {
|
||
return hookCallback.apply(null, arguments);
|
||
}
|
||
|
||
// This is done to register the method called with moment()
|
||
// without creating circular dependencies.
|
||
function setHookCallback(callback) {
|
||
hookCallback = callback;
|
||
}
|
||
|
||
function isArray(input) {
|
||
return (
|
||
input instanceof Array ||
|
||
Object.prototype.toString.call(input) === '[object Array]'
|
||
);
|
||
}
|
||
|
||
function isObject(input) {
|
||
// IE8 will treat undefined and null as object if it wasn't for
|
||
// input != null
|
||
return (
|
||
input != null &&
|
||
Object.prototype.toString.call(input) === '[object Object]'
|
||
);
|
||
}
|
||
|
||
function hasOwnProp(a, b) {
|
||
return Object.prototype.hasOwnProperty.call(a, b);
|
||
}
|
||
|
||
function isObjectEmpty(obj) {
|
||
if (Object.getOwnPropertyNames) {
|
||
return Object.getOwnPropertyNames(obj).length === 0;
|
||
} else {
|
||
var k;
|
||
for (k in obj) {
|
||
if (hasOwnProp(obj, k)) {
|
||
return false;
|
||
}
|
||
}
|
||
return true;
|
||
}
|
||
}
|
||
|
||
function isUndefined(input) {
|
||
return input === void 0;
|
||
}
|
||
|
||
function isNumber(input) {
|
||
return (
|
||
typeof input === 'number' ||
|
||
Object.prototype.toString.call(input) === '[object Number]'
|
||
);
|
||
}
|
||
|
||
function isDate(input) {
|
||
return (
|
||
input instanceof Date ||
|
||
Object.prototype.toString.call(input) === '[object Date]'
|
||
);
|
||
}
|
||
|
||
function map(arr, fn) {
|
||
var res = [],
|
||
i,
|
||
arrLen = arr.length;
|
||
for (i = 0; i < arrLen; ++i) {
|
||
res.push(fn(arr[i], i));
|
||
}
|
||
return res;
|
||
}
|
||
|
||
function extend(a, b) {
|
||
for (var i in b) {
|
||
if (hasOwnProp(b, i)) {
|
||
a[i] = b[i];
|
||
}
|
||
}
|
||
|
||
if (hasOwnProp(b, 'toString')) {
|
||
a.toString = b.toString;
|
||
}
|
||
|
||
if (hasOwnProp(b, 'valueOf')) {
|
||
a.valueOf = b.valueOf;
|
||
}
|
||
|
||
return a;
|
||
}
|
||
|
||
function createUTC(input, format, locale, strict) {
|
||
return createLocalOrUTC(input, format, locale, strict, true).utc();
|
||
}
|
||
|
||
function defaultParsingFlags() {
|
||
// We need to deep clone this object.
|
||
return {
|
||
empty: false,
|
||
unusedTokens: [],
|
||
unusedInput: [],
|
||
overflow: -2,
|
||
charsLeftOver: 0,
|
||
nullInput: false,
|
||
invalidEra: null,
|
||
invalidMonth: null,
|
||
invalidFormat: false,
|
||
userInvalidated: false,
|
||
iso: false,
|
||
parsedDateParts: [],
|
||
era: null,
|
||
meridiem: null,
|
||
rfc2822: false,
|
||
weekdayMismatch: false,
|
||
};
|
||
}
|
||
|
||
function getParsingFlags(m) {
|
||
if (m._pf == null) {
|
||
m._pf = defaultParsingFlags();
|
||
}
|
||
return m._pf;
|
||
}
|
||
|
||
var some;
|
||
if (Array.prototype.some) {
|
||
some = Array.prototype.some;
|
||
} else {
|
||
some = function (fun) {
|
||
var t = Object(this),
|
||
len = t.length >>> 0,
|
||
i;
|
||
|
||
for (i = 0; i < len; i++) {
|
||
if (i in t && fun.call(this, t[i], i, t)) {
|
||
return true;
|
||
}
|
||
}
|
||
|
||
return false;
|
||
};
|
||
}
|
||
|
||
function isValid(m) {
|
||
var flags = null,
|
||
parsedParts = false,
|
||
isNowValid = m._d && !isNaN(m._d.getTime());
|
||
if (isNowValid) {
|
||
flags = getParsingFlags(m);
|
||
parsedParts = some.call(flags.parsedDateParts, function (i) {
|
||
return i != null;
|
||
});
|
||
isNowValid =
|
||
flags.overflow < 0 &&
|
||
!flags.empty &&
|
||
!flags.invalidEra &&
|
||
!flags.invalidMonth &&
|
||
!flags.invalidWeekday &&
|
||
!flags.weekdayMismatch &&
|
||
!flags.nullInput &&
|
||
!flags.invalidFormat &&
|
||
!flags.userInvalidated &&
|
||
(!flags.meridiem || (flags.meridiem && parsedParts));
|
||
if (m._strict) {
|
||
isNowValid =
|
||
isNowValid &&
|
||
flags.charsLeftOver === 0 &&
|
||
flags.unusedTokens.length === 0 &&
|
||
flags.bigHour === undefined;
|
||
}
|
||
}
|
||
if (Object.isFrozen == null || !Object.isFrozen(m)) {
|
||
m._isValid = isNowValid;
|
||
} else {
|
||
return isNowValid;
|
||
}
|
||
return m._isValid;
|
||
}
|
||
|
||
function createInvalid(flags) {
|
||
var m = createUTC(NaN);
|
||
if (flags != null) {
|
||
extend(getParsingFlags(m), flags);
|
||
} else {
|
||
getParsingFlags(m).userInvalidated = true;
|
||
}
|
||
|
||
return m;
|
||
}
|
||
|
||
// Plugins that add properties should also add the key here (null value),
|
||
// so we can properly clone ourselves.
|
||
var momentProperties = (hooks.momentProperties = []),
|
||
updateInProgress = false;
|
||
|
||
function copyConfig(to, from) {
|
||
var i,
|
||
prop,
|
||
val,
|
||
momentPropertiesLen = momentProperties.length;
|
||
|
||
if (!isUndefined(from._isAMomentObject)) {
|
||
to._isAMomentObject = from._isAMomentObject;
|
||
}
|
||
if (!isUndefined(from._i)) {
|
||
to._i = from._i;
|
||
}
|
||
if (!isUndefined(from._f)) {
|
||
to._f = from._f;
|
||
}
|
||
if (!isUndefined(from._l)) {
|
||
to._l = from._l;
|
||
}
|
||
if (!isUndefined(from._strict)) {
|
||
to._strict = from._strict;
|
||
}
|
||
if (!isUndefined(from._tzm)) {
|
||
to._tzm = from._tzm;
|
||
}
|
||
if (!isUndefined(from._isUTC)) {
|
||
to._isUTC = from._isUTC;
|
||
}
|
||
if (!isUndefined(from._offset)) {
|
||
to._offset = from._offset;
|
||
}
|
||
if (!isUndefined(from._pf)) {
|
||
to._pf = getParsingFlags(from);
|
||
}
|
||
if (!isUndefined(from._locale)) {
|
||
to._locale = from._locale;
|
||
}
|
||
|
||
if (momentPropertiesLen > 0) {
|
||
for (i = 0; i < momentPropertiesLen; i++) {
|
||
prop = momentProperties[i];
|
||
val = from[prop];
|
||
if (!isUndefined(val)) {
|
||
to[prop] = val;
|
||
}
|
||
}
|
||
}
|
||
|
||
return to;
|
||
}
|
||
|
||
// Moment prototype object
|
||
function Moment(config) {
|
||
copyConfig(this, config);
|
||
this._d = new Date(config._d != null ? config._d.getTime() : NaN);
|
||
if (!this.isValid()) {
|
||
this._d = new Date(NaN);
|
||
}
|
||
// Prevent infinite loop in case updateOffset creates new moment
|
||
// objects.
|
||
if (updateInProgress === false) {
|
||
updateInProgress = true;
|
||
hooks.updateOffset(this);
|
||
updateInProgress = false;
|
||
}
|
||
}
|
||
|
||
function isMoment(obj) {
|
||
return (
|
||
obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
|
||
);
|
||
}
|
||
|
||
function warn(msg) {
|
||
if (
|
||
hooks.suppressDeprecationWarnings === false &&
|
||
typeof console !== 'undefined' &&
|
||
console.warn
|
||
) {
|
||
console.warn('Deprecation warning: ' + msg);
|
||
}
|
||
}
|
||
|
||
function deprecate(msg, fn) {
|
||
var firstTime = true;
|
||
|
||
return extend(function () {
|
||
if (hooks.deprecationHandler != null) {
|
||
hooks.deprecationHandler(null, msg);
|
||
}
|
||
if (firstTime) {
|
||
var args = [],
|
||
arg,
|
||
i,
|
||
key,
|
||
argLen = arguments.length;
|
||
for (i = 0; i < argLen; i++) {
|
||
arg = '';
|
||
if (typeof arguments[i] === 'object') {
|
||
arg += '\n[' + i + '] ';
|
||
for (key in arguments[0]) {
|
||
if (hasOwnProp(arguments[0], key)) {
|
||
arg += key + ': ' + arguments[0][key] + ', ';
|
||
}
|
||
}
|
||
arg = arg.slice(0, -2); // Remove trailing comma and space
|
||
} else {
|
||
arg = arguments[i];
|
||
}
|
||
args.push(arg);
|
||
}
|
||
warn(
|
||
msg +
|
||
'\nArguments: ' +
|
||
Array.prototype.slice.call(args).join('') +
|
||
'\n' +
|
||
new Error().stack
|
||
);
|
||
firstTime = false;
|
||
}
|
||
return fn.apply(this, arguments);
|
||
}, fn);
|
||
}
|
||
|
||
var deprecations = {};
|
||
|
||
function deprecateSimple(name, msg) {
|
||
if (hooks.deprecationHandler != null) {
|
||
hooks.deprecationHandler(name, msg);
|
||
}
|
||
if (!deprecations[name]) {
|
||
warn(msg);
|
||
deprecations[name] = true;
|
||
}
|
||
}
|
||
|
||
hooks.suppressDeprecationWarnings = false;
|
||
hooks.deprecationHandler = null;
|
||
|
||
function isFunction(input) {
|
||
return (
|
||
(typeof Function !== 'undefined' && input instanceof Function) ||
|
||
Object.prototype.toString.call(input) === '[object Function]'
|
||
);
|
||
}
|
||
|
||
function set(config) {
|
||
var prop, i;
|
||
for (i in config) {
|
||
if (hasOwnProp(config, i)) {
|
||
prop = config[i];
|
||
if (isFunction(prop)) {
|
||
this[i] = prop;
|
||
} else {
|
||
this['_' + i] = prop;
|
||
}
|
||
}
|
||
}
|
||
this._config = config;
|
||
// Lenient ordinal parsing accepts just a number in addition to
|
||
// number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
|
||
// TODO: Remove "ordinalParse" fallback in next major release.
|
||
this._dayOfMonthOrdinalParseLenient = new RegExp(
|
||
(this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
|
||
'|' +
|
||
/\d{1,2}/.source
|
||
);
|
||
}
|
||
|
||
function mergeConfigs(parentConfig, childConfig) {
|
||
var res = extend({}, parentConfig),
|
||
prop;
|
||
for (prop in childConfig) {
|
||
if (hasOwnProp(childConfig, prop)) {
|
||
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
|
||
res[prop] = {};
|
||
extend(res[prop], parentConfig[prop]);
|
||
extend(res[prop], childConfig[prop]);
|
||
} else if (childConfig[prop] != null) {
|
||
res[prop] = childConfig[prop];
|
||
} else {
|
||
delete res[prop];
|
||
}
|
||
}
|
||
}
|
||
for (prop in parentConfig) {
|
||
if (
|
||
hasOwnProp(parentConfig, prop) &&
|
||
!hasOwnProp(childConfig, prop) &&
|
||
isObject(parentConfig[prop])
|
||
) {
|
||
// make sure changes to properties don't modify parent config
|
||
res[prop] = extend({}, res[prop]);
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
|
||
function Locale(config) {
|
||
if (config != null) {
|
||
this.set(config);
|
||
}
|
||
}
|
||
|
||
var keys;
|
||
|
||
if (Object.keys) {
|
||
keys = Object.keys;
|
||
} else {
|
||
keys = function (obj) {
|
||
var i,
|
||
res = [];
|
||
for (i in obj) {
|
||
if (hasOwnProp(obj, i)) {
|
||
res.push(i);
|
||
}
|
||
}
|
||
return res;
|
||
};
|
||
}
|
||
|
||
var defaultCalendar = {
|
||
sameDay: '[Today at] LT',
|
||
nextDay: '[Tomorrow at] LT',
|
||
nextWeek: 'dddd [at] LT',
|
||
lastDay: '[Yesterday at] LT',
|
||
lastWeek: '[Last] dddd [at] LT',
|
||
sameElse: 'L',
|
||
};
|
||
|
||
function calendar(key, mom, now) {
|
||
var output = this._calendar[key] || this._calendar['sameElse'];
|
||
return isFunction(output) ? output.call(mom, now) : output;
|
||
}
|
||
|
||
function zeroFill(number, targetLength, forceSign) {
|
||
var absNumber = '' + Math.abs(number),
|
||
zerosToFill = targetLength - absNumber.length,
|
||
sign = number >= 0;
|
||
return (
|
||
(sign ? (forceSign ? '+' : '') : '-') +
|
||
Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
|
||
absNumber
|
||
);
|
||
}
|
||
|
||
var formattingTokens =
|
||
/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
|
||
localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
|
||
formatFunctions = {},
|
||
formatTokenFunctions = {};
|
||
|
||
// token: 'M'
|
||
// padded: ['MM', 2]
|
||
// ordinal: 'Mo'
|
||
// callback: function () { this.month() + 1 }
|
||
function addFormatToken(token, padded, ordinal, callback) {
|
||
var func = callback;
|
||
if (typeof callback === 'string') {
|
||
func = function () {
|
||
return this[callback]();
|
||
};
|
||
}
|
||
if (token) {
|
||
formatTokenFunctions[token] = func;
|
||
}
|
||
if (padded) {
|
||
formatTokenFunctions[padded[0]] = function () {
|
||
return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
|
||
};
|
||
}
|
||
if (ordinal) {
|
||
formatTokenFunctions[ordinal] = function () {
|
||
return this.localeData().ordinal(
|
||
func.apply(this, arguments),
|
||
token
|
||
);
|
||
};
|
||
}
|
||
}
|
||
|
||
function removeFormattingTokens(input) {
|
||
if (input.match(/\[[\s\S]/)) {
|
||
return input.replace(/^\[|\]$/g, '');
|
||
}
|
||
return input.replace(/\\/g, '');
|
||
}
|
||
|
||
function makeFormatFunction(format) {
|
||
var array = format.match(formattingTokens),
|
||
i,
|
||
length;
|
||
|
||
for (i = 0, length = array.length; i < length; i++) {
|
||
if (formatTokenFunctions[array[i]]) {
|
||
array[i] = formatTokenFunctions[array[i]];
|
||
} else {
|
||
array[i] = removeFormattingTokens(array[i]);
|
||
}
|
||
}
|
||
|
||
return function (mom) {
|
||
var output = '',
|
||
i;
|
||
for (i = 0; i < length; i++) {
|
||
output += isFunction(array[i])
|
||
? array[i].call(mom, format)
|
||
: array[i];
|
||
}
|
||
return output;
|
||
};
|
||
}
|
||
|
||
// format date using native date object
|
||
function formatMoment(m, format) {
|
||
if (!m.isValid()) {
|
||
return m.localeData().invalidDate();
|
||
}
|
||
|
||
format = expandFormat(format, m.localeData());
|
||
formatFunctions[format] =
|
||
formatFunctions[format] || makeFormatFunction(format);
|
||
|
||
return formatFunctions[format](m);
|
||
}
|
||
|
||
function expandFormat(format, locale) {
|
||
var i = 5;
|
||
|
||
function replaceLongDateFormatTokens(input) {
|
||
return locale.longDateFormat(input) || input;
|
||
}
|
||
|
||
localFormattingTokens.lastIndex = 0;
|
||
while (i >= 0 && localFormattingTokens.test(format)) {
|
||
format = format.replace(
|
||
localFormattingTokens,
|
||
replaceLongDateFormatTokens
|
||
);
|
||
localFormattingTokens.lastIndex = 0;
|
||
i -= 1;
|
||
}
|
||
|
||
return format;
|
||
}
|
||
|
||
var defaultLongDateFormat = {
|
||
LTS: 'h:mm:ss A',
|
||
LT: 'h:mm A',
|
||
L: 'MM/DD/YYYY',
|
||
LL: 'MMMM D, YYYY',
|
||
LLL: 'MMMM D, YYYY h:mm A',
|
||
LLLL: 'dddd, MMMM D, YYYY h:mm A',
|
||
};
|
||
|
||
function longDateFormat(key) {
|
||
var format = this._longDateFormat[key],
|
||
formatUpper = this._longDateFormat[key.toUpperCase()];
|
||
|
||
if (format || !formatUpper) {
|
||
return format;
|
||
}
|
||
|
||
this._longDateFormat[key] = formatUpper
|
||
.match(formattingTokens)
|
||
.map(function (tok) {
|
||
if (
|
||
tok === 'MMMM' ||
|
||
tok === 'MM' ||
|
||
tok === 'DD' ||
|
||
tok === 'dddd'
|
||
) {
|
||
return tok.slice(1);
|
||
}
|
||
return tok;
|
||
})
|
||
.join('');
|
||
|
||
return this._longDateFormat[key];
|
||
}
|
||
|
||
var defaultInvalidDate = 'Invalid date';
|
||
|
||
function invalidDate() {
|
||
return this._invalidDate;
|
||
}
|
||
|
||
var defaultOrdinal = '%d',
|
||
defaultDayOfMonthOrdinalParse = /\d{1,2}/;
|
||
|
||
function ordinal(number) {
|
||
return this._ordinal.replace('%d', number);
|
||
}
|
||
|
||
var defaultRelativeTime = {
|
||
future: 'in %s',
|
||
past: '%s ago',
|
||
s: 'a few seconds',
|
||
ss: '%d seconds',
|
||
m: 'a minute',
|
||
mm: '%d minutes',
|
||
h: 'an hour',
|
||
hh: '%d hours',
|
||
d: 'a day',
|
||
dd: '%d days',
|
||
w: 'a week',
|
||
ww: '%d weeks',
|
||
M: 'a month',
|
||
MM: '%d months',
|
||
y: 'a year',
|
||
yy: '%d years',
|
||
};
|
||
|
||
function relativeTime(number, withoutSuffix, string, isFuture) {
|
||
var output = this._relativeTime[string];
|
||
return isFunction(output)
|
||
? output(number, withoutSuffix, string, isFuture)
|
||
: output.replace(/%d/i, number);
|
||
}
|
||
|
||
function pastFuture(diff, output) {
|
||
var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
|
||
return isFunction(format) ? format(output) : format.replace(/%s/i, output);
|
||
}
|
||
|
||
var aliases = {
|
||
D: 'date',
|
||
dates: 'date',
|
||
date: 'date',
|
||
d: 'day',
|
||
days: 'day',
|
||
day: 'day',
|
||
e: 'weekday',
|
||
weekdays: 'weekday',
|
||
weekday: 'weekday',
|
||
E: 'isoWeekday',
|
||
isoweekdays: 'isoWeekday',
|
||
isoweekday: 'isoWeekday',
|
||
DDD: 'dayOfYear',
|
||
dayofyears: 'dayOfYear',
|
||
dayofyear: 'dayOfYear',
|
||
h: 'hour',
|
||
hours: 'hour',
|
||
hour: 'hour',
|
||
ms: 'millisecond',
|
||
milliseconds: 'millisecond',
|
||
millisecond: 'millisecond',
|
||
m: 'minute',
|
||
minutes: 'minute',
|
||
minute: 'minute',
|
||
M: 'month',
|
||
months: 'month',
|
||
month: 'month',
|
||
Q: 'quarter',
|
||
quarters: 'quarter',
|
||
quarter: 'quarter',
|
||
s: 'second',
|
||
seconds: 'second',
|
||
second: 'second',
|
||
gg: 'weekYear',
|
||
weekyears: 'weekYear',
|
||
weekyear: 'weekYear',
|
||
GG: 'isoWeekYear',
|
||
isoweekyears: 'isoWeekYear',
|
||
isoweekyear: 'isoWeekYear',
|
||
w: 'week',
|
||
weeks: 'week',
|
||
week: 'week',
|
||
W: 'isoWeek',
|
||
isoweeks: 'isoWeek',
|
||
isoweek: 'isoWeek',
|
||
y: 'year',
|
||
years: 'year',
|
||
year: 'year',
|
||
};
|
||
|
||
function normalizeUnits(units) {
|
||
return typeof units === 'string'
|
||
? aliases[units] || aliases[units.toLowerCase()]
|
||
: undefined;
|
||
}
|
||
|
||
function normalizeObjectUnits(inputObject) {
|
||
var normalizedInput = {},
|
||
normalizedProp,
|
||
prop;
|
||
|
||
for (prop in inputObject) {
|
||
if (hasOwnProp(inputObject, prop)) {
|
||
normalizedProp = normalizeUnits(prop);
|
||
if (normalizedProp) {
|
||
normalizedInput[normalizedProp] = inputObject[prop];
|
||
}
|
||
}
|
||
}
|
||
|
||
return normalizedInput;
|
||
}
|
||
|
||
var priorities = {
|
||
date: 9,
|
||
day: 11,
|
||
weekday: 11,
|
||
isoWeekday: 11,
|
||
dayOfYear: 4,
|
||
hour: 13,
|
||
millisecond: 16,
|
||
minute: 14,
|
||
month: 8,
|
||
quarter: 7,
|
||
second: 15,
|
||
weekYear: 1,
|
||
isoWeekYear: 1,
|
||
week: 5,
|
||
isoWeek: 5,
|
||
year: 1,
|
||
};
|
||
|
||
function getPrioritizedUnits(unitsObj) {
|
||
var units = [],
|
||
u;
|
||
for (u in unitsObj) {
|
||
if (hasOwnProp(unitsObj, u)) {
|
||
units.push({ unit: u, priority: priorities[u] });
|
||
}
|
||
}
|
||
units.sort(function (a, b) {
|
||
return a.priority - b.priority;
|
||
});
|
||
return units;
|
||
}
|
||
|
||
var match1 = /\d/, // 0 - 9
|
||
match2 = /\d\d/, // 00 - 99
|
||
match3 = /\d{3}/, // 000 - 999
|
||
match4 = /\d{4}/, // 0000 - 9999
|
||
match6 = /[+-]?\d{6}/, // -999999 - 999999
|
||
match1to2 = /\d\d?/, // 0 - 99
|
||
match3to4 = /\d\d\d\d?/, // 999 - 9999
|
||
match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999
|
||
match1to3 = /\d{1,3}/, // 0 - 999
|
||
match1to4 = /\d{1,4}/, // 0 - 9999
|
||
match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
|
||
matchUnsigned = /\d+/, // 0 - inf
|
||
matchSigned = /[+-]?\d+/, // -inf - inf
|
||
matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
|
||
matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
|
||
matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
|
||
// any word (or two) characters or numbers including two/three word month in arabic.
|
||
// includes scottish gaelic two word and hyphenated months
|
||
matchWord =
|
||
/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
|
||
match1to2NoLeadingZero = /^[1-9]\d?/, // 1-99
|
||
match1to2HasZero = /^([1-9]\d|\d)/, // 0-99
|
||
regexes;
|
||
|
||
regexes = {};
|
||
|
||
function addRegexToken(token, regex, strictRegex) {
|
||
regexes[token] = isFunction(regex)
|
||
? regex
|
||
: function (isStrict, localeData) {
|
||
return isStrict && strictRegex ? strictRegex : regex;
|
||
};
|
||
}
|
||
|
||
function getParseRegexForToken(token, config) {
|
||
if (!hasOwnProp(regexes, token)) {
|
||
return new RegExp(unescapeFormat(token));
|
||
}
|
||
|
||
return regexes[token](config._strict, config._locale);
|
||
}
|
||
|
||
// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
|
||
function unescapeFormat(s) {
|
||
return regexEscape(
|
||
s
|
||
.replace('\\', '')
|
||
.replace(
|
||
/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
|
||
function (matched, p1, p2, p3, p4) {
|
||
return p1 || p2 || p3 || p4;
|
||
}
|
||
)
|
||
);
|
||
}
|
||
|
||
function regexEscape(s) {
|
||
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
||
}
|
||
|
||
function absFloor(number) {
|
||
if (number < 0) {
|
||
// -0 -> 0
|
||
return Math.ceil(number) || 0;
|
||
} else {
|
||
return Math.floor(number);
|
||
}
|
||
}
|
||
|
||
function toInt(argumentForCoercion) {
|
||
var coercedNumber = +argumentForCoercion,
|
||
value = 0;
|
||
|
||
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
|
||
value = absFloor(coercedNumber);
|
||
}
|
||
|
||
return value;
|
||
}
|
||
|
||
var tokens = {};
|
||
|
||
function addParseToken(token, callback) {
|
||
var i,
|
||
func = callback,
|
||
tokenLen;
|
||
if (typeof token === 'string') {
|
||
token = [token];
|
||
}
|
||
if (isNumber(callback)) {
|
||
func = function (input, array) {
|
||
array[callback] = toInt(input);
|
||
};
|
||
}
|
||
tokenLen = token.length;
|
||
for (i = 0; i < tokenLen; i++) {
|
||
tokens[token[i]] = func;
|
||
}
|
||
}
|
||
|
||
function addWeekParseToken(token, callback) {
|
||
addParseToken(token, function (input, array, config, token) {
|
||
config._w = config._w || {};
|
||
callback(input, config._w, config, token);
|
||
});
|
||
}
|
||
|
||
function addTimeToArrayFromToken(token, input, config) {
|
||
if (input != null && hasOwnProp(tokens, token)) {
|
||
tokens[token](input, config._a, config, token);
|
||
}
|
||
}
|
||
|
||
function isLeapYear(year) {
|
||
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
||
}
|
||
|
||
var YEAR = 0,
|
||
MONTH = 1,
|
||
DATE = 2,
|
||
HOUR = 3,
|
||
MINUTE = 4,
|
||
SECOND = 5,
|
||
MILLISECOND = 6,
|
||
WEEK = 7,
|
||
WEEKDAY = 8;
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('Y', 0, 0, function () {
|
||
var y = this.year();
|
||
return y <= 9999 ? zeroFill(y, 4) : '+' + y;
|
||
});
|
||
|
||
addFormatToken(0, ['YY', 2], 0, function () {
|
||
return this.year() % 100;
|
||
});
|
||
|
||
addFormatToken(0, ['YYYY', 4], 0, 'year');
|
||
addFormatToken(0, ['YYYYY', 5], 0, 'year');
|
||
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('Y', matchSigned);
|
||
addRegexToken('YY', match1to2, match2);
|
||
addRegexToken('YYYY', match1to4, match4);
|
||
addRegexToken('YYYYY', match1to6, match6);
|
||
addRegexToken('YYYYYY', match1to6, match6);
|
||
|
||
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
|
||
addParseToken('YYYY', function (input, array) {
|
||
array[YEAR] =
|
||
input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
|
||
});
|
||
addParseToken('YY', function (input, array) {
|
||
array[YEAR] = hooks.parseTwoDigitYear(input);
|
||
});
|
||
addParseToken('Y', function (input, array) {
|
||
array[YEAR] = parseInt(input, 10);
|
||
});
|
||
|
||
// HELPERS
|
||
|
||
function daysInYear(year) {
|
||
return isLeapYear(year) ? 366 : 365;
|
||
}
|
||
|
||
// HOOKS
|
||
|
||
hooks.parseTwoDigitYear = function (input) {
|
||
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
|
||
};
|
||
|
||
// MOMENTS
|
||
|
||
var getSetYear = makeGetSet('FullYear', true);
|
||
|
||
function getIsLeapYear() {
|
||
return isLeapYear(this.year());
|
||
}
|
||
|
||
function makeGetSet(unit, keepTime) {
|
||
return function (value) {
|
||
if (value != null) {
|
||
set$1(this, unit, value);
|
||
hooks.updateOffset(this, keepTime);
|
||
return this;
|
||
} else {
|
||
return get(this, unit);
|
||
}
|
||
};
|
||
}
|
||
|
||
function get(mom, unit) {
|
||
if (!mom.isValid()) {
|
||
return NaN;
|
||
}
|
||
|
||
var d = mom._d,
|
||
isUTC = mom._isUTC;
|
||
|
||
switch (unit) {
|
||
case 'Milliseconds':
|
||
return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
|
||
case 'Seconds':
|
||
return isUTC ? d.getUTCSeconds() : d.getSeconds();
|
||
case 'Minutes':
|
||
return isUTC ? d.getUTCMinutes() : d.getMinutes();
|
||
case 'Hours':
|
||
return isUTC ? d.getUTCHours() : d.getHours();
|
||
case 'Date':
|
||
return isUTC ? d.getUTCDate() : d.getDate();
|
||
case 'Day':
|
||
return isUTC ? d.getUTCDay() : d.getDay();
|
||
case 'Month':
|
||
return isUTC ? d.getUTCMonth() : d.getMonth();
|
||
case 'FullYear':
|
||
return isUTC ? d.getUTCFullYear() : d.getFullYear();
|
||
default:
|
||
return NaN; // Just in case
|
||
}
|
||
}
|
||
|
||
function set$1(mom, unit, value) {
|
||
var d, isUTC, year, month, date;
|
||
|
||
if (!mom.isValid() || isNaN(value)) {
|
||
return;
|
||
}
|
||
|
||
d = mom._d;
|
||
isUTC = mom._isUTC;
|
||
|
||
switch (unit) {
|
||
case 'Milliseconds':
|
||
return void (isUTC
|
||
? d.setUTCMilliseconds(value)
|
||
: d.setMilliseconds(value));
|
||
case 'Seconds':
|
||
return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
|
||
case 'Minutes':
|
||
return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
|
||
case 'Hours':
|
||
return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
|
||
case 'Date':
|
||
return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
|
||
// case 'Day': // Not real
|
||
// return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
|
||
// case 'Month': // Not used because we need to pass two variables
|
||
// return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
|
||
case 'FullYear':
|
||
break; // See below ...
|
||
default:
|
||
return; // Just in case
|
||
}
|
||
|
||
year = value;
|
||
month = mom.month();
|
||
date = mom.date();
|
||
date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
|
||
void (isUTC
|
||
? d.setUTCFullYear(year, month, date)
|
||
: d.setFullYear(year, month, date));
|
||
}
|
||
|
||
// MOMENTS
|
||
|
||
function stringGet(units) {
|
||
units = normalizeUnits(units);
|
||
if (isFunction(this[units])) {
|
||
return this[units]();
|
||
}
|
||
return this;
|
||
}
|
||
|
||
function stringSet(units, value) {
|
||
if (typeof units === 'object') {
|
||
units = normalizeObjectUnits(units);
|
||
var prioritized = getPrioritizedUnits(units),
|
||
i,
|
||
prioritizedLen = prioritized.length;
|
||
for (i = 0; i < prioritizedLen; i++) {
|
||
this[prioritized[i].unit](units[prioritized[i].unit]);
|
||
}
|
||
} else {
|
||
units = normalizeUnits(units);
|
||
if (isFunction(this[units])) {
|
||
return this[units](value);
|
||
}
|
||
}
|
||
return this;
|
||
}
|
||
|
||
function mod(n, x) {
|
||
return ((n % x) + x) % x;
|
||
}
|
||
|
||
var indexOf;
|
||
|
||
if (Array.prototype.indexOf) {
|
||
indexOf = Array.prototype.indexOf;
|
||
} else {
|
||
indexOf = function (o) {
|
||
// I know
|
||
var i;
|
||
for (i = 0; i < this.length; ++i) {
|
||
if (this[i] === o) {
|
||
return i;
|
||
}
|
||
}
|
||
return -1;
|
||
};
|
||
}
|
||
|
||
function daysInMonth(year, month) {
|
||
if (isNaN(year) || isNaN(month)) {
|
||
return NaN;
|
||
}
|
||
var modMonth = mod(month, 12);
|
||
year += (month - modMonth) / 12;
|
||
return modMonth === 1
|
||
? isLeapYear(year)
|
||
? 29
|
||
: 28
|
||
: 31 - ((modMonth % 7) % 2);
|
||
}
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('M', ['MM', 2], 'Mo', function () {
|
||
return this.month() + 1;
|
||
});
|
||
|
||
addFormatToken('MMM', 0, 0, function (format) {
|
||
return this.localeData().monthsShort(this, format);
|
||
});
|
||
|
||
addFormatToken('MMMM', 0, 0, function (format) {
|
||
return this.localeData().months(this, format);
|
||
});
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('M', match1to2, match1to2NoLeadingZero);
|
||
addRegexToken('MM', match1to2, match2);
|
||
addRegexToken('MMM', function (isStrict, locale) {
|
||
return locale.monthsShortRegex(isStrict);
|
||
});
|
||
addRegexToken('MMMM', function (isStrict, locale) {
|
||
return locale.monthsRegex(isStrict);
|
||
});
|
||
|
||
addParseToken(['M', 'MM'], function (input, array) {
|
||
array[MONTH] = toInt(input) - 1;
|
||
});
|
||
|
||
addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
|
||
var month = config._locale.monthsParse(input, token, config._strict);
|
||
// if we didn't find a month name, mark the date as invalid.
|
||
if (month != null) {
|
||
array[MONTH] = month;
|
||
} else {
|
||
getParsingFlags(config).invalidMonth = input;
|
||
}
|
||
});
|
||
|
||
// LOCALES
|
||
|
||
var defaultLocaleMonths =
|
||
'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
||
'_'
|
||
),
|
||
defaultLocaleMonthsShort =
|
||
'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
||
MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
|
||
defaultMonthsShortRegex = matchWord,
|
||
defaultMonthsRegex = matchWord;
|
||
|
||
function localeMonths(m, format) {
|
||
if (!m) {
|
||
return isArray(this._months)
|
||
? this._months
|
||
: this._months['standalone'];
|
||
}
|
||
return isArray(this._months)
|
||
? this._months[m.month()]
|
||
: this._months[
|
||
(this._months.isFormat || MONTHS_IN_FORMAT).test(format)
|
||
? 'format'
|
||
: 'standalone'
|
||
][m.month()];
|
||
}
|
||
|
||
function localeMonthsShort(m, format) {
|
||
if (!m) {
|
||
return isArray(this._monthsShort)
|
||
? this._monthsShort
|
||
: this._monthsShort['standalone'];
|
||
}
|
||
return isArray(this._monthsShort)
|
||
? this._monthsShort[m.month()]
|
||
: this._monthsShort[
|
||
MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
|
||
][m.month()];
|
||
}
|
||
|
||
function handleStrictParse(monthName, format, strict) {
|
||
var i,
|
||
ii,
|
||
mom,
|
||
llc = monthName.toLocaleLowerCase();
|
||
if (!this._monthsParse) {
|
||
// this is not used
|
||
this._monthsParse = [];
|
||
this._longMonthsParse = [];
|
||
this._shortMonthsParse = [];
|
||
for (i = 0; i < 12; ++i) {
|
||
mom = createUTC([2000, i]);
|
||
this._shortMonthsParse[i] = this.monthsShort(
|
||
mom,
|
||
''
|
||
).toLocaleLowerCase();
|
||
this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
|
||
}
|
||
}
|
||
|
||
if (strict) {
|
||
if (format === 'MMM') {
|
||
ii = indexOf.call(this._shortMonthsParse, llc);
|
||
return ii !== -1 ? ii : null;
|
||
} else {
|
||
ii = indexOf.call(this._longMonthsParse, llc);
|
||
return ii !== -1 ? ii : null;
|
||
}
|
||
} else {
|
||
if (format === 'MMM') {
|
||
ii = indexOf.call(this._shortMonthsParse, llc);
|
||
if (ii !== -1) {
|
||
return ii;
|
||
}
|
||
ii = indexOf.call(this._longMonthsParse, llc);
|
||
return ii !== -1 ? ii : null;
|
||
} else {
|
||
ii = indexOf.call(this._longMonthsParse, llc);
|
||
if (ii !== -1) {
|
||
return ii;
|
||
}
|
||
ii = indexOf.call(this._shortMonthsParse, llc);
|
||
return ii !== -1 ? ii : null;
|
||
}
|
||
}
|
||
}
|
||
|
||
function localeMonthsParse(monthName, format, strict) {
|
||
var i, mom, regex;
|
||
|
||
if (this._monthsParseExact) {
|
||
return handleStrictParse.call(this, monthName, format, strict);
|
||
}
|
||
|
||
if (!this._monthsParse) {
|
||
this._monthsParse = [];
|
||
this._longMonthsParse = [];
|
||
this._shortMonthsParse = [];
|
||
}
|
||
|
||
// TODO: add sorting
|
||
// Sorting makes sure if one month (or abbr) is a prefix of another
|
||
// see sorting in computeMonthsParse
|
||
for (i = 0; i < 12; i++) {
|
||
// make the regex if we don't have it already
|
||
mom = createUTC([2000, i]);
|
||
if (strict && !this._longMonthsParse[i]) {
|
||
this._longMonthsParse[i] = new RegExp(
|
||
'^' + this.months(mom, '').replace('.', '') + '$',
|
||
'i'
|
||
);
|
||
this._shortMonthsParse[i] = new RegExp(
|
||
'^' + this.monthsShort(mom, '').replace('.', '') + '$',
|
||
'i'
|
||
);
|
||
}
|
||
if (!strict && !this._monthsParse[i]) {
|
||
regex =
|
||
'^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
|
||
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
|
||
}
|
||
// test the regex
|
||
if (
|
||
strict &&
|
||
format === 'MMMM' &&
|
||
this._longMonthsParse[i].test(monthName)
|
||
) {
|
||
return i;
|
||
} else if (
|
||
strict &&
|
||
format === 'MMM' &&
|
||
this._shortMonthsParse[i].test(monthName)
|
||
) {
|
||
return i;
|
||
} else if (!strict && this._monthsParse[i].test(monthName)) {
|
||
return i;
|
||
}
|
||
}
|
||
}
|
||
|
||
// MOMENTS
|
||
|
||
function setMonth(mom, value) {
|
||
if (!mom.isValid()) {
|
||
// No op
|
||
return mom;
|
||
}
|
||
|
||
if (typeof value === 'string') {
|
||
if (/^\d+$/.test(value)) {
|
||
value = toInt(value);
|
||
} else {
|
||
value = mom.localeData().monthsParse(value);
|
||
// TODO: Another silent failure?
|
||
if (!isNumber(value)) {
|
||
return mom;
|
||
}
|
||
}
|
||
}
|
||
|
||
var month = value,
|
||
date = mom.date();
|
||
|
||
date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
|
||
void (mom._isUTC
|
||
? mom._d.setUTCMonth(month, date)
|
||
: mom._d.setMonth(month, date));
|
||
return mom;
|
||
}
|
||
|
||
function getSetMonth(value) {
|
||
if (value != null) {
|
||
setMonth(this, value);
|
||
hooks.updateOffset(this, true);
|
||
return this;
|
||
} else {
|
||
return get(this, 'Month');
|
||
}
|
||
}
|
||
|
||
function getDaysInMonth() {
|
||
return daysInMonth(this.year(), this.month());
|
||
}
|
||
|
||
function monthsShortRegex(isStrict) {
|
||
if (this._monthsParseExact) {
|
||
if (!hasOwnProp(this, '_monthsRegex')) {
|
||
computeMonthsParse.call(this);
|
||
}
|
||
if (isStrict) {
|
||
return this._monthsShortStrictRegex;
|
||
} else {
|
||
return this._monthsShortRegex;
|
||
}
|
||
} else {
|
||
if (!hasOwnProp(this, '_monthsShortRegex')) {
|
||
this._monthsShortRegex = defaultMonthsShortRegex;
|
||
}
|
||
return this._monthsShortStrictRegex && isStrict
|
||
? this._monthsShortStrictRegex
|
||
: this._monthsShortRegex;
|
||
}
|
||
}
|
||
|
||
function monthsRegex(isStrict) {
|
||
if (this._monthsParseExact) {
|
||
if (!hasOwnProp(this, '_monthsRegex')) {
|
||
computeMonthsParse.call(this);
|
||
}
|
||
if (isStrict) {
|
||
return this._monthsStrictRegex;
|
||
} else {
|
||
return this._monthsRegex;
|
||
}
|
||
} else {
|
||
if (!hasOwnProp(this, '_monthsRegex')) {
|
||
this._monthsRegex = defaultMonthsRegex;
|
||
}
|
||
return this._monthsStrictRegex && isStrict
|
||
? this._monthsStrictRegex
|
||
: this._monthsRegex;
|
||
}
|
||
}
|
||
|
||
function computeMonthsParse() {
|
||
function cmpLenRev(a, b) {
|
||
return b.length - a.length;
|
||
}
|
||
|
||
var shortPieces = [],
|
||
longPieces = [],
|
||
mixedPieces = [],
|
||
i,
|
||
mom,
|
||
shortP,
|
||
longP;
|
||
for (i = 0; i < 12; i++) {
|
||
// make the regex if we don't have it already
|
||
mom = createUTC([2000, i]);
|
||
shortP = regexEscape(this.monthsShort(mom, ''));
|
||
longP = regexEscape(this.months(mom, ''));
|
||
shortPieces.push(shortP);
|
||
longPieces.push(longP);
|
||
mixedPieces.push(longP);
|
||
mixedPieces.push(shortP);
|
||
}
|
||
// Sorting makes sure if one month (or abbr) is a prefix of another it
|
||
// will match the longer piece.
|
||
shortPieces.sort(cmpLenRev);
|
||
longPieces.sort(cmpLenRev);
|
||
mixedPieces.sort(cmpLenRev);
|
||
|
||
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
||
this._monthsShortRegex = this._monthsRegex;
|
||
this._monthsStrictRegex = new RegExp(
|
||
'^(' + longPieces.join('|') + ')',
|
||
'i'
|
||
);
|
||
this._monthsShortStrictRegex = new RegExp(
|
||
'^(' + shortPieces.join('|') + ')',
|
||
'i'
|
||
);
|
||
}
|
||
|
||
function createDate(y, m, d, h, M, s, ms) {
|
||
// can't just apply() to create a date:
|
||
// https://stackoverflow.com/q/181348
|
||
var date;
|
||
// the date constructor remaps years 0-99 to 1900-1999
|
||
if (y < 100 && y >= 0) {
|
||
// preserve leap years using a full 400 year cycle, then reset
|
||
date = new Date(y + 400, m, d, h, M, s, ms);
|
||
if (isFinite(date.getFullYear())) {
|
||
date.setFullYear(y);
|
||
}
|
||
} else {
|
||
date = new Date(y, m, d, h, M, s, ms);
|
||
}
|
||
|
||
return date;
|
||
}
|
||
|
||
function createUTCDate(y) {
|
||
var date, args;
|
||
// the Date.UTC function remaps years 0-99 to 1900-1999
|
||
if (y < 100 && y >= 0) {
|
||
args = Array.prototype.slice.call(arguments);
|
||
// preserve leap years using a full 400 year cycle, then reset
|
||
args[0] = y + 400;
|
||
date = new Date(Date.UTC.apply(null, args));
|
||
if (isFinite(date.getUTCFullYear())) {
|
||
date.setUTCFullYear(y);
|
||
}
|
||
} else {
|
||
date = new Date(Date.UTC.apply(null, arguments));
|
||
}
|
||
|
||
return date;
|
||
}
|
||
|
||
// start-of-first-week - start-of-year
|
||
function firstWeekOffset(year, dow, doy) {
|
||
var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
|
||
fwd = 7 + dow - doy,
|
||
// first-week day local weekday -- which local weekday is fwd
|
||
fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
|
||
|
||
return -fwdlw + fwd - 1;
|
||
}
|
||
|
||
// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
|
||
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
|
||
var localWeekday = (7 + weekday - dow) % 7,
|
||
weekOffset = firstWeekOffset(year, dow, doy),
|
||
dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
|
||
resYear,
|
||
resDayOfYear;
|
||
|
||
if (dayOfYear <= 0) {
|
||
resYear = year - 1;
|
||
resDayOfYear = daysInYear(resYear) + dayOfYear;
|
||
} else if (dayOfYear > daysInYear(year)) {
|
||
resYear = year + 1;
|
||
resDayOfYear = dayOfYear - daysInYear(year);
|
||
} else {
|
||
resYear = year;
|
||
resDayOfYear = dayOfYear;
|
||
}
|
||
|
||
return {
|
||
year: resYear,
|
||
dayOfYear: resDayOfYear,
|
||
};
|
||
}
|
||
|
||
function weekOfYear(mom, dow, doy) {
|
||
var weekOffset = firstWeekOffset(mom.year(), dow, doy),
|
||
week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
|
||
resWeek,
|
||
resYear;
|
||
|
||
if (week < 1) {
|
||
resYear = mom.year() - 1;
|
||
resWeek = week + weeksInYear(resYear, dow, doy);
|
||
} else if (week > weeksInYear(mom.year(), dow, doy)) {
|
||
resWeek = week - weeksInYear(mom.year(), dow, doy);
|
||
resYear = mom.year() + 1;
|
||
} else {
|
||
resYear = mom.year();
|
||
resWeek = week;
|
||
}
|
||
|
||
return {
|
||
week: resWeek,
|
||
year: resYear,
|
||
};
|
||
}
|
||
|
||
function weeksInYear(year, dow, doy) {
|
||
var weekOffset = firstWeekOffset(year, dow, doy),
|
||
weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
|
||
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
|
||
}
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('w', ['ww', 2], 'wo', 'week');
|
||
addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('w', match1to2, match1to2NoLeadingZero);
|
||
addRegexToken('ww', match1to2, match2);
|
||
addRegexToken('W', match1to2, match1to2NoLeadingZero);
|
||
addRegexToken('WW', match1to2, match2);
|
||
|
||
addWeekParseToken(
|
||
['w', 'ww', 'W', 'WW'],
|
||
function (input, week, config, token) {
|
||
week[token.substr(0, 1)] = toInt(input);
|
||
}
|
||
);
|
||
|
||
// HELPERS
|
||
|
||
// LOCALES
|
||
|
||
function localeWeek(mom) {
|
||
return weekOfYear(mom, this._week.dow, this._week.doy).week;
|
||
}
|
||
|
||
var defaultLocaleWeek = {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
};
|
||
|
||
function localeFirstDayOfWeek() {
|
||
return this._week.dow;
|
||
}
|
||
|
||
function localeFirstDayOfYear() {
|
||
return this._week.doy;
|
||
}
|
||
|
||
// MOMENTS
|
||
|
||
function getSetWeek(input) {
|
||
var week = this.localeData().week(this);
|
||
return input == null ? week : this.add((input - week) * 7, 'd');
|
||
}
|
||
|
||
function getSetISOWeek(input) {
|
||
var week = weekOfYear(this, 1, 4).week;
|
||
return input == null ? week : this.add((input - week) * 7, 'd');
|
||
}
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('d', 0, 'do', 'day');
|
||
|
||
addFormatToken('dd', 0, 0, function (format) {
|
||
return this.localeData().weekdaysMin(this, format);
|
||
});
|
||
|
||
addFormatToken('ddd', 0, 0, function (format) {
|
||
return this.localeData().weekdaysShort(this, format);
|
||
});
|
||
|
||
addFormatToken('dddd', 0, 0, function (format) {
|
||
return this.localeData().weekdays(this, format);
|
||
});
|
||
|
||
addFormatToken('e', 0, 0, 'weekday');
|
||
addFormatToken('E', 0, 0, 'isoWeekday');
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('d', match1to2);
|
||
addRegexToken('e', match1to2);
|
||
addRegexToken('E', match1to2);
|
||
addRegexToken('dd', function (isStrict, locale) {
|
||
return locale.weekdaysMinRegex(isStrict);
|
||
});
|
||
addRegexToken('ddd', function (isStrict, locale) {
|
||
return locale.weekdaysShortRegex(isStrict);
|
||
});
|
||
addRegexToken('dddd', function (isStrict, locale) {
|
||
return locale.weekdaysRegex(isStrict);
|
||
});
|
||
|
||
addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
|
||
var weekday = config._locale.weekdaysParse(input, token, config._strict);
|
||
// if we didn't get a weekday name, mark the date as invalid
|
||
if (weekday != null) {
|
||
week.d = weekday;
|
||
} else {
|
||
getParsingFlags(config).invalidWeekday = input;
|
||
}
|
||
});
|
||
|
||
addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
|
||
week[token] = toInt(input);
|
||
});
|
||
|
||
// HELPERS
|
||
|
||
function parseWeekday(input, locale) {
|
||
if (typeof input !== 'string') {
|
||
return input;
|
||
}
|
||
|
||
if (!isNaN(input)) {
|
||
return parseInt(input, 10);
|
||
}
|
||
|
||
input = locale.weekdaysParse(input);
|
||
if (typeof input === 'number') {
|
||
return input;
|
||
}
|
||
|
||
return null;
|
||
}
|
||
|
||
function parseIsoWeekday(input, locale) {
|
||
if (typeof input === 'string') {
|
||
return locale.weekdaysParse(input) % 7 || 7;
|
||
}
|
||
return isNaN(input) ? null : input;
|
||
}
|
||
|
||
// LOCALES
|
||
function shiftWeekdays(ws, n) {
|
||
return ws.slice(n, 7).concat(ws.slice(0, n));
|
||
}
|
||
|
||
var defaultLocaleWeekdays =
|
||
'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
|
||
defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
||
defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
||
defaultWeekdaysRegex = matchWord,
|
||
defaultWeekdaysShortRegex = matchWord,
|
||
defaultWeekdaysMinRegex = matchWord;
|
||
|
||
function localeWeekdays(m, format) {
|
||
var weekdays = isArray(this._weekdays)
|
||
? this._weekdays
|
||
: this._weekdays[
|
||
m && m !== true && this._weekdays.isFormat.test(format)
|
||
? 'format'
|
||
: 'standalone'
|
||
];
|
||
return m === true
|
||
? shiftWeekdays(weekdays, this._week.dow)
|
||
: m
|
||
? weekdays[m.day()]
|
||
: weekdays;
|
||
}
|
||
|
||
function localeWeekdaysShort(m) {
|
||
return m === true
|
||
? shiftWeekdays(this._weekdaysShort, this._week.dow)
|
||
: m
|
||
? this._weekdaysShort[m.day()]
|
||
: this._weekdaysShort;
|
||
}
|
||
|
||
function localeWeekdaysMin(m) {
|
||
return m === true
|
||
? shiftWeekdays(this._weekdaysMin, this._week.dow)
|
||
: m
|
||
? this._weekdaysMin[m.day()]
|
||
: this._weekdaysMin;
|
||
}
|
||
|
||
function handleStrictParse$1(weekdayName, format, strict) {
|
||
var i,
|
||
ii,
|
||
mom,
|
||
llc = weekdayName.toLocaleLowerCase();
|
||
if (!this._weekdaysParse) {
|
||
this._weekdaysParse = [];
|
||
this._shortWeekdaysParse = [];
|
||
this._minWeekdaysParse = [];
|
||
|
||
for (i = 0; i < 7; ++i) {
|
||
mom = createUTC([2000, 1]).day(i);
|
||
this._minWeekdaysParse[i] = this.weekdaysMin(
|
||
mom,
|
||
''
|
||
).toLocaleLowerCase();
|
||
this._shortWeekdaysParse[i] = this.weekdaysShort(
|
||
mom,
|
||
''
|
||
).toLocaleLowerCase();
|
||
this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
|
||
}
|
||
}
|
||
|
||
if (strict) {
|
||
if (format === 'dddd') {
|
||
ii = indexOf.call(this._weekdaysParse, llc);
|
||
return ii !== -1 ? ii : null;
|
||
} else if (format === 'ddd') {
|
||
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
||
return ii !== -1 ? ii : null;
|
||
} else {
|
||
ii = indexOf.call(this._minWeekdaysParse, llc);
|
||
return ii !== -1 ? ii : null;
|
||
}
|
||
} else {
|
||
if (format === 'dddd') {
|
||
ii = indexOf.call(this._weekdaysParse, llc);
|
||
if (ii !== -1) {
|
||
return ii;
|
||
}
|
||
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
||
if (ii !== -1) {
|
||
return ii;
|
||
}
|
||
ii = indexOf.call(this._minWeekdaysParse, llc);
|
||
return ii !== -1 ? ii : null;
|
||
} else if (format === 'ddd') {
|
||
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
||
if (ii !== -1) {
|
||
return ii;
|
||
}
|
||
ii = indexOf.call(this._weekdaysParse, llc);
|
||
if (ii !== -1) {
|
||
return ii;
|
||
}
|
||
ii = indexOf.call(this._minWeekdaysParse, llc);
|
||
return ii !== -1 ? ii : null;
|
||
} else {
|
||
ii = indexOf.call(this._minWeekdaysParse, llc);
|
||
if (ii !== -1) {
|
||
return ii;
|
||
}
|
||
ii = indexOf.call(this._weekdaysParse, llc);
|
||
if (ii !== -1) {
|
||
return ii;
|
||
}
|
||
ii = indexOf.call(this._shortWeekdaysParse, llc);
|
||
return ii !== -1 ? ii : null;
|
||
}
|
||
}
|
||
}
|
||
|
||
function localeWeekdaysParse(weekdayName, format, strict) {
|
||
var i, mom, regex;
|
||
|
||
if (this._weekdaysParseExact) {
|
||
return handleStrictParse$1.call(this, weekdayName, format, strict);
|
||
}
|
||
|
||
if (!this._weekdaysParse) {
|
||
this._weekdaysParse = [];
|
||
this._minWeekdaysParse = [];
|
||
this._shortWeekdaysParse = [];
|
||
this._fullWeekdaysParse = [];
|
||
}
|
||
|
||
for (i = 0; i < 7; i++) {
|
||
// make the regex if we don't have it already
|
||
|
||
mom = createUTC([2000, 1]).day(i);
|
||
if (strict && !this._fullWeekdaysParse[i]) {
|
||
this._fullWeekdaysParse[i] = new RegExp(
|
||
'^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
|
||
'i'
|
||
);
|
||
this._shortWeekdaysParse[i] = new RegExp(
|
||
'^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
|
||
'i'
|
||
);
|
||
this._minWeekdaysParse[i] = new RegExp(
|
||
'^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
|
||
'i'
|
||
);
|
||
}
|
||
if (!this._weekdaysParse[i]) {
|
||
regex =
|
||
'^' +
|
||
this.weekdays(mom, '') +
|
||
'|^' +
|
||
this.weekdaysShort(mom, '') +
|
||
'|^' +
|
||
this.weekdaysMin(mom, '');
|
||
this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
|
||
}
|
||
// test the regex
|
||
if (
|
||
strict &&
|
||
format === 'dddd' &&
|
||
this._fullWeekdaysParse[i].test(weekdayName)
|
||
) {
|
||
return i;
|
||
} else if (
|
||
strict &&
|
||
format === 'ddd' &&
|
||
this._shortWeekdaysParse[i].test(weekdayName)
|
||
) {
|
||
return i;
|
||
} else if (
|
||
strict &&
|
||
format === 'dd' &&
|
||
this._minWeekdaysParse[i].test(weekdayName)
|
||
) {
|
||
return i;
|
||
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
|
||
return i;
|
||
}
|
||
}
|
||
}
|
||
|
||
// MOMENTS
|
||
|
||
function getSetDayOfWeek(input) {
|
||
if (!this.isValid()) {
|
||
return input != null ? this : NaN;
|
||
}
|
||
|
||
var day = get(this, 'Day');
|
||
if (input != null) {
|
||
input = parseWeekday(input, this.localeData());
|
||
return this.add(input - day, 'd');
|
||
} else {
|
||
return day;
|
||
}
|
||
}
|
||
|
||
function getSetLocaleDayOfWeek(input) {
|
||
if (!this.isValid()) {
|
||
return input != null ? this : NaN;
|
||
}
|
||
var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
|
||
return input == null ? weekday : this.add(input - weekday, 'd');
|
||
}
|
||
|
||
function getSetISODayOfWeek(input) {
|
||
if (!this.isValid()) {
|
||
return input != null ? this : NaN;
|
||
}
|
||
|
||
// behaves the same as moment#day except
|
||
// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
|
||
// as a setter, sunday should belong to the previous week.
|
||
|
||
if (input != null) {
|
||
var weekday = parseIsoWeekday(input, this.localeData());
|
||
return this.day(this.day() % 7 ? weekday : weekday - 7);
|
||
} else {
|
||
return this.day() || 7;
|
||
}
|
||
}
|
||
|
||
function weekdaysRegex(isStrict) {
|
||
if (this._weekdaysParseExact) {
|
||
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
||
computeWeekdaysParse.call(this);
|
||
}
|
||
if (isStrict) {
|
||
return this._weekdaysStrictRegex;
|
||
} else {
|
||
return this._weekdaysRegex;
|
||
}
|
||
} else {
|
||
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
||
this._weekdaysRegex = defaultWeekdaysRegex;
|
||
}
|
||
return this._weekdaysStrictRegex && isStrict
|
||
? this._weekdaysStrictRegex
|
||
: this._weekdaysRegex;
|
||
}
|
||
}
|
||
|
||
function weekdaysShortRegex(isStrict) {
|
||
if (this._weekdaysParseExact) {
|
||
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
||
computeWeekdaysParse.call(this);
|
||
}
|
||
if (isStrict) {
|
||
return this._weekdaysShortStrictRegex;
|
||
} else {
|
||
return this._weekdaysShortRegex;
|
||
}
|
||
} else {
|
||
if (!hasOwnProp(this, '_weekdaysShortRegex')) {
|
||
this._weekdaysShortRegex = defaultWeekdaysShortRegex;
|
||
}
|
||
return this._weekdaysShortStrictRegex && isStrict
|
||
? this._weekdaysShortStrictRegex
|
||
: this._weekdaysShortRegex;
|
||
}
|
||
}
|
||
|
||
function weekdaysMinRegex(isStrict) {
|
||
if (this._weekdaysParseExact) {
|
||
if (!hasOwnProp(this, '_weekdaysRegex')) {
|
||
computeWeekdaysParse.call(this);
|
||
}
|
||
if (isStrict) {
|
||
return this._weekdaysMinStrictRegex;
|
||
} else {
|
||
return this._weekdaysMinRegex;
|
||
}
|
||
} else {
|
||
if (!hasOwnProp(this, '_weekdaysMinRegex')) {
|
||
this._weekdaysMinRegex = defaultWeekdaysMinRegex;
|
||
}
|
||
return this._weekdaysMinStrictRegex && isStrict
|
||
? this._weekdaysMinStrictRegex
|
||
: this._weekdaysMinRegex;
|
||
}
|
||
}
|
||
|
||
function computeWeekdaysParse() {
|
||
function cmpLenRev(a, b) {
|
||
return b.length - a.length;
|
||
}
|
||
|
||
var minPieces = [],
|
||
shortPieces = [],
|
||
longPieces = [],
|
||
mixedPieces = [],
|
||
i,
|
||
mom,
|
||
minp,
|
||
shortp,
|
||
longp;
|
||
for (i = 0; i < 7; i++) {
|
||
// make the regex if we don't have it already
|
||
mom = createUTC([2000, 1]).day(i);
|
||
minp = regexEscape(this.weekdaysMin(mom, ''));
|
||
shortp = regexEscape(this.weekdaysShort(mom, ''));
|
||
longp = regexEscape(this.weekdays(mom, ''));
|
||
minPieces.push(minp);
|
||
shortPieces.push(shortp);
|
||
longPieces.push(longp);
|
||
mixedPieces.push(minp);
|
||
mixedPieces.push(shortp);
|
||
mixedPieces.push(longp);
|
||
}
|
||
// Sorting makes sure if one weekday (or abbr) is a prefix of another it
|
||
// will match the longer piece.
|
||
minPieces.sort(cmpLenRev);
|
||
shortPieces.sort(cmpLenRev);
|
||
longPieces.sort(cmpLenRev);
|
||
mixedPieces.sort(cmpLenRev);
|
||
|
||
this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
||
this._weekdaysShortRegex = this._weekdaysRegex;
|
||
this._weekdaysMinRegex = this._weekdaysRegex;
|
||
|
||
this._weekdaysStrictRegex = new RegExp(
|
||
'^(' + longPieces.join('|') + ')',
|
||
'i'
|
||
);
|
||
this._weekdaysShortStrictRegex = new RegExp(
|
||
'^(' + shortPieces.join('|') + ')',
|
||
'i'
|
||
);
|
||
this._weekdaysMinStrictRegex = new RegExp(
|
||
'^(' + minPieces.join('|') + ')',
|
||
'i'
|
||
);
|
||
}
|
||
|
||
// FORMATTING
|
||
|
||
function hFormat() {
|
||
return this.hours() % 12 || 12;
|
||
}
|
||
|
||
function kFormat() {
|
||
return this.hours() || 24;
|
||
}
|
||
|
||
addFormatToken('H', ['HH', 2], 0, 'hour');
|
||
addFormatToken('h', ['hh', 2], 0, hFormat);
|
||
addFormatToken('k', ['kk', 2], 0, kFormat);
|
||
|
||
addFormatToken('hmm', 0, 0, function () {
|
||
return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
|
||
});
|
||
|
||
addFormatToken('hmmss', 0, 0, function () {
|
||
return (
|
||
'' +
|
||
hFormat.apply(this) +
|
||
zeroFill(this.minutes(), 2) +
|
||
zeroFill(this.seconds(), 2)
|
||
);
|
||
});
|
||
|
||
addFormatToken('Hmm', 0, 0, function () {
|
||
return '' + this.hours() + zeroFill(this.minutes(), 2);
|
||
});
|
||
|
||
addFormatToken('Hmmss', 0, 0, function () {
|
||
return (
|
||
'' +
|
||
this.hours() +
|
||
zeroFill(this.minutes(), 2) +
|
||
zeroFill(this.seconds(), 2)
|
||
);
|
||
});
|
||
|
||
function meridiem(token, lowercase) {
|
||
addFormatToken(token, 0, 0, function () {
|
||
return this.localeData().meridiem(
|
||
this.hours(),
|
||
this.minutes(),
|
||
lowercase
|
||
);
|
||
});
|
||
}
|
||
|
||
meridiem('a', true);
|
||
meridiem('A', false);
|
||
|
||
// PARSING
|
||
|
||
function matchMeridiem(isStrict, locale) {
|
||
return locale._meridiemParse;
|
||
}
|
||
|
||
addRegexToken('a', matchMeridiem);
|
||
addRegexToken('A', matchMeridiem);
|
||
addRegexToken('H', match1to2, match1to2HasZero);
|
||
addRegexToken('h', match1to2, match1to2NoLeadingZero);
|
||
addRegexToken('k', match1to2, match1to2NoLeadingZero);
|
||
addRegexToken('HH', match1to2, match2);
|
||
addRegexToken('hh', match1to2, match2);
|
||
addRegexToken('kk', match1to2, match2);
|
||
|
||
addRegexToken('hmm', match3to4);
|
||
addRegexToken('hmmss', match5to6);
|
||
addRegexToken('Hmm', match3to4);
|
||
addRegexToken('Hmmss', match5to6);
|
||
|
||
addParseToken(['H', 'HH'], HOUR);
|
||
addParseToken(['k', 'kk'], function (input, array, config) {
|
||
var kInput = toInt(input);
|
||
array[HOUR] = kInput === 24 ? 0 : kInput;
|
||
});
|
||
addParseToken(['a', 'A'], function (input, array, config) {
|
||
config._isPm = config._locale.isPM(input);
|
||
config._meridiem = input;
|
||
});
|
||
addParseToken(['h', 'hh'], function (input, array, config) {
|
||
array[HOUR] = toInt(input);
|
||
getParsingFlags(config).bigHour = true;
|
||
});
|
||
addParseToken('hmm', function (input, array, config) {
|
||
var pos = input.length - 2;
|
||
array[HOUR] = toInt(input.substr(0, pos));
|
||
array[MINUTE] = toInt(input.substr(pos));
|
||
getParsingFlags(config).bigHour = true;
|
||
});
|
||
addParseToken('hmmss', function (input, array, config) {
|
||
var pos1 = input.length - 4,
|
||
pos2 = input.length - 2;
|
||
array[HOUR] = toInt(input.substr(0, pos1));
|
||
array[MINUTE] = toInt(input.substr(pos1, 2));
|
||
array[SECOND] = toInt(input.substr(pos2));
|
||
getParsingFlags(config).bigHour = true;
|
||
});
|
||
addParseToken('Hmm', function (input, array, config) {
|
||
var pos = input.length - 2;
|
||
array[HOUR] = toInt(input.substr(0, pos));
|
||
array[MINUTE] = toInt(input.substr(pos));
|
||
});
|
||
addParseToken('Hmmss', function (input, array, config) {
|
||
var pos1 = input.length - 4,
|
||
pos2 = input.length - 2;
|
||
array[HOUR] = toInt(input.substr(0, pos1));
|
||
array[MINUTE] = toInt(input.substr(pos1, 2));
|
||
array[SECOND] = toInt(input.substr(pos2));
|
||
});
|
||
|
||
// LOCALES
|
||
|
||
function localeIsPM(input) {
|
||
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
|
||
// Using charAt should be more compatible.
|
||
return (input + '').toLowerCase().charAt(0) === 'p';
|
||
}
|
||
|
||
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
|
||
// Setting the hour should keep the time, because the user explicitly
|
||
// specified which hour they want. So trying to maintain the same hour (in
|
||
// a new timezone) makes sense. Adding/subtracting hours does not follow
|
||
// this rule.
|
||
getSetHour = makeGetSet('Hours', true);
|
||
|
||
function localeMeridiem(hours, minutes, isLower) {
|
||
if (hours > 11) {
|
||
return isLower ? 'pm' : 'PM';
|
||
} else {
|
||
return isLower ? 'am' : 'AM';
|
||
}
|
||
}
|
||
|
||
var baseConfig = {
|
||
calendar: defaultCalendar,
|
||
longDateFormat: defaultLongDateFormat,
|
||
invalidDate: defaultInvalidDate,
|
||
ordinal: defaultOrdinal,
|
||
dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
|
||
relativeTime: defaultRelativeTime,
|
||
|
||
months: defaultLocaleMonths,
|
||
monthsShort: defaultLocaleMonthsShort,
|
||
|
||
week: defaultLocaleWeek,
|
||
|
||
weekdays: defaultLocaleWeekdays,
|
||
weekdaysMin: defaultLocaleWeekdaysMin,
|
||
weekdaysShort: defaultLocaleWeekdaysShort,
|
||
|
||
meridiemParse: defaultLocaleMeridiemParse,
|
||
};
|
||
|
||
// internal storage for locale config files
|
||
var locales = {},
|
||
localeFamilies = {},
|
||
globalLocale;
|
||
|
||
function commonPrefix(arr1, arr2) {
|
||
var i,
|
||
minl = Math.min(arr1.length, arr2.length);
|
||
for (i = 0; i < minl; i += 1) {
|
||
if (arr1[i] !== arr2[i]) {
|
||
return i;
|
||
}
|
||
}
|
||
return minl;
|
||
}
|
||
|
||
function normalizeLocale(key) {
|
||
return key ? key.toLowerCase().replace('_', '-') : key;
|
||
}
|
||
|
||
// pick the locale from the array
|
||
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
|
||
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
|
||
function chooseLocale(names) {
|
||
var i = 0,
|
||
j,
|
||
next,
|
||
locale,
|
||
split;
|
||
|
||
while (i < names.length) {
|
||
split = normalizeLocale(names[i]).split('-');
|
||
j = split.length;
|
||
next = normalizeLocale(names[i + 1]);
|
||
next = next ? next.split('-') : null;
|
||
while (j > 0) {
|
||
locale = loadLocale(split.slice(0, j).join('-'));
|
||
if (locale) {
|
||
return locale;
|
||
}
|
||
if (
|
||
next &&
|
||
next.length >= j &&
|
||
commonPrefix(split, next) >= j - 1
|
||
) {
|
||
//the next array item is better than a shallower substring of this one
|
||
break;
|
||
}
|
||
j--;
|
||
}
|
||
i++;
|
||
}
|
||
return globalLocale;
|
||
}
|
||
|
||
function isLocaleNameSane(name) {
|
||
// Prevent names that look like filesystem paths, i.e contain '/' or '\'
|
||
// Ensure name is available and function returns boolean
|
||
return !!(name && name.match('^[^/\\\\]*$'));
|
||
}
|
||
|
||
function loadLocale(name) {
|
||
var oldLocale = null,
|
||
aliasedRequire;
|
||
// TODO: Find a better way to register and load all the locales in Node
|
||
if (
|
||
locales[name] === undefined &&
|
||
"object" !== 'undefined' &&
|
||
module &&
|
||
module.exports &&
|
||
isLocaleNameSane(name)
|
||
) {
|
||
try {
|
||
oldLocale = globalLocale._abbr;
|
||
aliasedRequire = undefined;
|
||
Object(function webpackMissingModule() { var e = new Error("Cannot find module 'undefined'"); e.code = 'MODULE_NOT_FOUND'; throw e; }());
|
||
getSetGlobalLocale(oldLocale);
|
||
} catch (e) {
|
||
// mark as not found to avoid repeating expensive file require call causing high CPU
|
||
// when trying to find en-US, en_US, en-us for every format call
|
||
locales[name] = null; // null means not found
|
||
}
|
||
}
|
||
return locales[name];
|
||
}
|
||
|
||
// This function will load locale and then set the global locale. If
|
||
// no arguments are passed in, it will simply return the current global
|
||
// locale key.
|
||
function getSetGlobalLocale(key, values) {
|
||
var data;
|
||
if (key) {
|
||
if (isUndefined(values)) {
|
||
data = getLocale(key);
|
||
} else {
|
||
data = defineLocale(key, values);
|
||
}
|
||
|
||
if (data) {
|
||
// moment.duration._locale = moment._locale = data;
|
||
globalLocale = data;
|
||
} else {
|
||
if (typeof console !== 'undefined' && console.warn) {
|
||
//warn user if arguments are passed but the locale could not be set
|
||
console.warn(
|
||
'Locale ' + key + ' not found. Did you forget to load it?'
|
||
);
|
||
}
|
||
}
|
||
}
|
||
|
||
return globalLocale._abbr;
|
||
}
|
||
|
||
function defineLocale(name, config) {
|
||
if (config !== null) {
|
||
var locale,
|
||
parentConfig = baseConfig;
|
||
config.abbr = name;
|
||
if (locales[name] != null) {
|
||
deprecateSimple(
|
||
'defineLocaleOverride',
|
||
'use moment.updateLocale(localeName, config) to change ' +
|
||
'an existing locale. moment.defineLocale(localeName, ' +
|
||
'config) should only be used for creating a new locale ' +
|
||
'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
|
||
);
|
||
parentConfig = locales[name]._config;
|
||
} else if (config.parentLocale != null) {
|
||
if (locales[config.parentLocale] != null) {
|
||
parentConfig = locales[config.parentLocale]._config;
|
||
} else {
|
||
locale = loadLocale(config.parentLocale);
|
||
if (locale != null) {
|
||
parentConfig = locale._config;
|
||
} else {
|
||
if (!localeFamilies[config.parentLocale]) {
|
||
localeFamilies[config.parentLocale] = [];
|
||
}
|
||
localeFamilies[config.parentLocale].push({
|
||
name: name,
|
||
config: config,
|
||
});
|
||
return null;
|
||
}
|
||
}
|
||
}
|
||
locales[name] = new Locale(mergeConfigs(parentConfig, config));
|
||
|
||
if (localeFamilies[name]) {
|
||
localeFamilies[name].forEach(function (x) {
|
||
defineLocale(x.name, x.config);
|
||
});
|
||
}
|
||
|
||
// backwards compat for now: also set the locale
|
||
// make sure we set the locale AFTER all child locales have been
|
||
// created, so we won't end up with the child locale set.
|
||
getSetGlobalLocale(name);
|
||
|
||
return locales[name];
|
||
} else {
|
||
// useful for testing
|
||
delete locales[name];
|
||
return null;
|
||
}
|
||
}
|
||
|
||
function updateLocale(name, config) {
|
||
if (config != null) {
|
||
var locale,
|
||
tmpLocale,
|
||
parentConfig = baseConfig;
|
||
|
||
if (locales[name] != null && locales[name].parentLocale != null) {
|
||
// Update existing child locale in-place to avoid memory-leaks
|
||
locales[name].set(mergeConfigs(locales[name]._config, config));
|
||
} else {
|
||
// MERGE
|
||
tmpLocale = loadLocale(name);
|
||
if (tmpLocale != null) {
|
||
parentConfig = tmpLocale._config;
|
||
}
|
||
config = mergeConfigs(parentConfig, config);
|
||
if (tmpLocale == null) {
|
||
// updateLocale is called for creating a new locale
|
||
// Set abbr so it will have a name (getters return
|
||
// undefined otherwise).
|
||
config.abbr = name;
|
||
}
|
||
locale = new Locale(config);
|
||
locale.parentLocale = locales[name];
|
||
locales[name] = locale;
|
||
}
|
||
|
||
// backwards compat for now: also set the locale
|
||
getSetGlobalLocale(name);
|
||
} else {
|
||
// pass null for config to unupdate, useful for tests
|
||
if (locales[name] != null) {
|
||
if (locales[name].parentLocale != null) {
|
||
locales[name] = locales[name].parentLocale;
|
||
if (name === getSetGlobalLocale()) {
|
||
getSetGlobalLocale(name);
|
||
}
|
||
} else if (locales[name] != null) {
|
||
delete locales[name];
|
||
}
|
||
}
|
||
}
|
||
return locales[name];
|
||
}
|
||
|
||
// returns locale data
|
||
function getLocale(key) {
|
||
var locale;
|
||
|
||
if (key && key._locale && key._locale._abbr) {
|
||
key = key._locale._abbr;
|
||
}
|
||
|
||
if (!key) {
|
||
return globalLocale;
|
||
}
|
||
|
||
if (!isArray(key)) {
|
||
//short-circuit everything else
|
||
locale = loadLocale(key);
|
||
if (locale) {
|
||
return locale;
|
||
}
|
||
key = [key];
|
||
}
|
||
|
||
return chooseLocale(key);
|
||
}
|
||
|
||
function listLocales() {
|
||
return keys(locales);
|
||
}
|
||
|
||
function checkOverflow(m) {
|
||
var overflow,
|
||
a = m._a;
|
||
|
||
if (a && getParsingFlags(m).overflow === -2) {
|
||
overflow =
|
||
a[MONTH] < 0 || a[MONTH] > 11
|
||
? MONTH
|
||
: a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
|
||
? DATE
|
||
: a[HOUR] < 0 ||
|
||
a[HOUR] > 24 ||
|
||
(a[HOUR] === 24 &&
|
||
(a[MINUTE] !== 0 ||
|
||
a[SECOND] !== 0 ||
|
||
a[MILLISECOND] !== 0))
|
||
? HOUR
|
||
: a[MINUTE] < 0 || a[MINUTE] > 59
|
||
? MINUTE
|
||
: a[SECOND] < 0 || a[SECOND] > 59
|
||
? SECOND
|
||
: a[MILLISECOND] < 0 || a[MILLISECOND] > 999
|
||
? MILLISECOND
|
||
: -1;
|
||
|
||
if (
|
||
getParsingFlags(m)._overflowDayOfYear &&
|
||
(overflow < YEAR || overflow > DATE)
|
||
) {
|
||
overflow = DATE;
|
||
}
|
||
if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
|
||
overflow = WEEK;
|
||
}
|
||
if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
|
||
overflow = WEEKDAY;
|
||
}
|
||
|
||
getParsingFlags(m).overflow = overflow;
|
||
}
|
||
|
||
return m;
|
||
}
|
||
|
||
// iso 8601 regex
|
||
// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
|
||
var extendedIsoRegex =
|
||
/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
|
||
basicIsoRegex =
|
||
/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
|
||
tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
|
||
isoDates = [
|
||
['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
|
||
['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
|
||
['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
|
||
['GGGG-[W]WW', /\d{4}-W\d\d/, false],
|
||
['YYYY-DDD', /\d{4}-\d{3}/],
|
||
['YYYY-MM', /\d{4}-\d\d/, false],
|
||
['YYYYYYMMDD', /[+-]\d{10}/],
|
||
['YYYYMMDD', /\d{8}/],
|
||
['GGGG[W]WWE', /\d{4}W\d{3}/],
|
||
['GGGG[W]WW', /\d{4}W\d{2}/, false],
|
||
['YYYYDDD', /\d{7}/],
|
||
['YYYYMM', /\d{6}/, false],
|
||
['YYYY', /\d{4}/, false],
|
||
],
|
||
// iso time formats and regexes
|
||
isoTimes = [
|
||
['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
|
||
['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
|
||
['HH:mm:ss', /\d\d:\d\d:\d\d/],
|
||
['HH:mm', /\d\d:\d\d/],
|
||
['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
|
||
['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
|
||
['HHmmss', /\d\d\d\d\d\d/],
|
||
['HHmm', /\d\d\d\d/],
|
||
['HH', /\d\d/],
|
||
],
|
||
aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
|
||
// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
|
||
rfc2822 =
|
||
/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
|
||
obsOffsets = {
|
||
UT: 0,
|
||
GMT: 0,
|
||
EDT: -4 * 60,
|
||
EST: -5 * 60,
|
||
CDT: -5 * 60,
|
||
CST: -6 * 60,
|
||
MDT: -6 * 60,
|
||
MST: -7 * 60,
|
||
PDT: -7 * 60,
|
||
PST: -8 * 60,
|
||
};
|
||
|
||
// date from iso format
|
||
function configFromISO(config) {
|
||
var i,
|
||
l,
|
||
string = config._i,
|
||
match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
|
||
allowTime,
|
||
dateFormat,
|
||
timeFormat,
|
||
tzFormat,
|
||
isoDatesLen = isoDates.length,
|
||
isoTimesLen = isoTimes.length;
|
||
|
||
if (match) {
|
||
getParsingFlags(config).iso = true;
|
||
for (i = 0, l = isoDatesLen; i < l; i++) {
|
||
if (isoDates[i][1].exec(match[1])) {
|
||
dateFormat = isoDates[i][0];
|
||
allowTime = isoDates[i][2] !== false;
|
||
break;
|
||
}
|
||
}
|
||
if (dateFormat == null) {
|
||
config._isValid = false;
|
||
return;
|
||
}
|
||
if (match[3]) {
|
||
for (i = 0, l = isoTimesLen; i < l; i++) {
|
||
if (isoTimes[i][1].exec(match[3])) {
|
||
// match[2] should be 'T' or space
|
||
timeFormat = (match[2] || ' ') + isoTimes[i][0];
|
||
break;
|
||
}
|
||
}
|
||
if (timeFormat == null) {
|
||
config._isValid = false;
|
||
return;
|
||
}
|
||
}
|
||
if (!allowTime && timeFormat != null) {
|
||
config._isValid = false;
|
||
return;
|
||
}
|
||
if (match[4]) {
|
||
if (tzRegex.exec(match[4])) {
|
||
tzFormat = 'Z';
|
||
} else {
|
||
config._isValid = false;
|
||
return;
|
||
}
|
||
}
|
||
config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
|
||
configFromStringAndFormat(config);
|
||
} else {
|
||
config._isValid = false;
|
||
}
|
||
}
|
||
|
||
function extractFromRFC2822Strings(
|
||
yearStr,
|
||
monthStr,
|
||
dayStr,
|
||
hourStr,
|
||
minuteStr,
|
||
secondStr
|
||
) {
|
||
var result = [
|
||
untruncateYear(yearStr),
|
||
defaultLocaleMonthsShort.indexOf(monthStr),
|
||
parseInt(dayStr, 10),
|
||
parseInt(hourStr, 10),
|
||
parseInt(minuteStr, 10),
|
||
];
|
||
|
||
if (secondStr) {
|
||
result.push(parseInt(secondStr, 10));
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
function untruncateYear(yearStr) {
|
||
var year = parseInt(yearStr, 10);
|
||
if (year <= 49) {
|
||
return 2000 + year;
|
||
} else if (year <= 999) {
|
||
return 1900 + year;
|
||
}
|
||
return year;
|
||
}
|
||
|
||
function preprocessRFC2822(s) {
|
||
// Remove comments and folding whitespace and replace multiple-spaces with a single space
|
||
return s
|
||
.replace(/\([^()]*\)|[\n\t]/g, ' ')
|
||
.replace(/(\s\s+)/g, ' ')
|
||
.replace(/^\s\s*/, '')
|
||
.replace(/\s\s*$/, '');
|
||
}
|
||
|
||
function checkWeekday(weekdayStr, parsedInput, config) {
|
||
if (weekdayStr) {
|
||
// TODO: Replace the vanilla JS Date object with an independent day-of-week check.
|
||
var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
|
||
weekdayActual = new Date(
|
||
parsedInput[0],
|
||
parsedInput[1],
|
||
parsedInput[2]
|
||
).getDay();
|
||
if (weekdayProvided !== weekdayActual) {
|
||
getParsingFlags(config).weekdayMismatch = true;
|
||
config._isValid = false;
|
||
return false;
|
||
}
|
||
}
|
||
return true;
|
||
}
|
||
|
||
function calculateOffset(obsOffset, militaryOffset, numOffset) {
|
||
if (obsOffset) {
|
||
return obsOffsets[obsOffset];
|
||
} else if (militaryOffset) {
|
||
// the only allowed military tz is Z
|
||
return 0;
|
||
} else {
|
||
var hm = parseInt(numOffset, 10),
|
||
m = hm % 100,
|
||
h = (hm - m) / 100;
|
||
return h * 60 + m;
|
||
}
|
||
}
|
||
|
||
// date and time from ref 2822 format
|
||
function configFromRFC2822(config) {
|
||
var match = rfc2822.exec(preprocessRFC2822(config._i)),
|
||
parsedArray;
|
||
if (match) {
|
||
parsedArray = extractFromRFC2822Strings(
|
||
match[4],
|
||
match[3],
|
||
match[2],
|
||
match[5],
|
||
match[6],
|
||
match[7]
|
||
);
|
||
if (!checkWeekday(match[1], parsedArray, config)) {
|
||
return;
|
||
}
|
||
|
||
config._a = parsedArray;
|
||
config._tzm = calculateOffset(match[8], match[9], match[10]);
|
||
|
||
config._d = createUTCDate.apply(null, config._a);
|
||
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
||
|
||
getParsingFlags(config).rfc2822 = true;
|
||
} else {
|
||
config._isValid = false;
|
||
}
|
||
}
|
||
|
||
// date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
|
||
function configFromString(config) {
|
||
var matched = aspNetJsonRegex.exec(config._i);
|
||
if (matched !== null) {
|
||
config._d = new Date(+matched[1]);
|
||
return;
|
||
}
|
||
|
||
configFromISO(config);
|
||
if (config._isValid === false) {
|
||
delete config._isValid;
|
||
} else {
|
||
return;
|
||
}
|
||
|
||
configFromRFC2822(config);
|
||
if (config._isValid === false) {
|
||
delete config._isValid;
|
||
} else {
|
||
return;
|
||
}
|
||
|
||
if (config._strict) {
|
||
config._isValid = false;
|
||
} else {
|
||
// Final attempt, use Input Fallback
|
||
hooks.createFromInputFallback(config);
|
||
}
|
||
}
|
||
|
||
hooks.createFromInputFallback = deprecate(
|
||
'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
|
||
'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
|
||
'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',
|
||
function (config) {
|
||
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
|
||
}
|
||
);
|
||
|
||
// Pick the first defined of two or three arguments.
|
||
function defaults(a, b, c) {
|
||
if (a != null) {
|
||
return a;
|
||
}
|
||
if (b != null) {
|
||
return b;
|
||
}
|
||
return c;
|
||
}
|
||
|
||
function currentDateArray(config) {
|
||
// hooks is actually the exported moment object
|
||
var nowValue = new Date(hooks.now());
|
||
if (config._useUTC) {
|
||
return [
|
||
nowValue.getUTCFullYear(),
|
||
nowValue.getUTCMonth(),
|
||
nowValue.getUTCDate(),
|
||
];
|
||
}
|
||
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
|
||
}
|
||
|
||
// convert an array to a date.
|
||
// the array should mirror the parameters below
|
||
// note: all values past the year are optional and will default to the lowest possible value.
|
||
// [year, month, day , hour, minute, second, millisecond]
|
||
function configFromArray(config) {
|
||
var i,
|
||
date,
|
||
input = [],
|
||
currentDate,
|
||
expectedWeekday,
|
||
yearToUse;
|
||
|
||
if (config._d) {
|
||
return;
|
||
}
|
||
|
||
currentDate = currentDateArray(config);
|
||
|
||
//compute day of the year from weeks and weekdays
|
||
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
|
||
dayOfYearFromWeekInfo(config);
|
||
}
|
||
|
||
//if the day of the year is set, figure out what it is
|
||
if (config._dayOfYear != null) {
|
||
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
|
||
|
||
if (
|
||
config._dayOfYear > daysInYear(yearToUse) ||
|
||
config._dayOfYear === 0
|
||
) {
|
||
getParsingFlags(config)._overflowDayOfYear = true;
|
||
}
|
||
|
||
date = createUTCDate(yearToUse, 0, config._dayOfYear);
|
||
config._a[MONTH] = date.getUTCMonth();
|
||
config._a[DATE] = date.getUTCDate();
|
||
}
|
||
|
||
// Default to current date.
|
||
// * if no year, month, day of month are given, default to today
|
||
// * if day of month is given, default month and year
|
||
// * if month is given, default only year
|
||
// * if year is given, don't default anything
|
||
for (i = 0; i < 3 && config._a[i] == null; ++i) {
|
||
config._a[i] = input[i] = currentDate[i];
|
||
}
|
||
|
||
// Zero out whatever was not defaulted, including time
|
||
for (; i < 7; i++) {
|
||
config._a[i] = input[i] =
|
||
config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
|
||
}
|
||
|
||
// Check for 24:00:00.000
|
||
if (
|
||
config._a[HOUR] === 24 &&
|
||
config._a[MINUTE] === 0 &&
|
||
config._a[SECOND] === 0 &&
|
||
config._a[MILLISECOND] === 0
|
||
) {
|
||
config._nextDay = true;
|
||
config._a[HOUR] = 0;
|
||
}
|
||
|
||
config._d = (config._useUTC ? createUTCDate : createDate).apply(
|
||
null,
|
||
input
|
||
);
|
||
expectedWeekday = config._useUTC
|
||
? config._d.getUTCDay()
|
||
: config._d.getDay();
|
||
|
||
// Apply timezone offset from input. The actual utcOffset can be changed
|
||
// with parseZone.
|
||
if (config._tzm != null) {
|
||
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
|
||
}
|
||
|
||
if (config._nextDay) {
|
||
config._a[HOUR] = 24;
|
||
}
|
||
|
||
// check for mismatching day of week
|
||
if (
|
||
config._w &&
|
||
typeof config._w.d !== 'undefined' &&
|
||
config._w.d !== expectedWeekday
|
||
) {
|
||
getParsingFlags(config).weekdayMismatch = true;
|
||
}
|
||
}
|
||
|
||
function dayOfYearFromWeekInfo(config) {
|
||
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
|
||
|
||
w = config._w;
|
||
if (w.GG != null || w.W != null || w.E != null) {
|
||
dow = 1;
|
||
doy = 4;
|
||
|
||
// TODO: We need to take the current isoWeekYear, but that depends on
|
||
// how we interpret now (local, utc, fixed offset). So create
|
||
// a now version of current config (take local/utc/offset flags, and
|
||
// create now).
|
||
weekYear = defaults(
|
||
w.GG,
|
||
config._a[YEAR],
|
||
weekOfYear(createLocal(), 1, 4).year
|
||
);
|
||
week = defaults(w.W, 1);
|
||
weekday = defaults(w.E, 1);
|
||
if (weekday < 1 || weekday > 7) {
|
||
weekdayOverflow = true;
|
||
}
|
||
} else {
|
||
dow = config._locale._week.dow;
|
||
doy = config._locale._week.doy;
|
||
|
||
curWeek = weekOfYear(createLocal(), dow, doy);
|
||
|
||
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
|
||
|
||
// Default to current week.
|
||
week = defaults(w.w, curWeek.week);
|
||
|
||
if (w.d != null) {
|
||
// weekday -- low day numbers are considered next week
|
||
weekday = w.d;
|
||
if (weekday < 0 || weekday > 6) {
|
||
weekdayOverflow = true;
|
||
}
|
||
} else if (w.e != null) {
|
||
// local weekday -- counting starts from beginning of week
|
||
weekday = w.e + dow;
|
||
if (w.e < 0 || w.e > 6) {
|
||
weekdayOverflow = true;
|
||
}
|
||
} else {
|
||
// default to beginning of week
|
||
weekday = dow;
|
||
}
|
||
}
|
||
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
|
||
getParsingFlags(config)._overflowWeeks = true;
|
||
} else if (weekdayOverflow != null) {
|
||
getParsingFlags(config)._overflowWeekday = true;
|
||
} else {
|
||
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
|
||
config._a[YEAR] = temp.year;
|
||
config._dayOfYear = temp.dayOfYear;
|
||
}
|
||
}
|
||
|
||
// constant that refers to the ISO standard
|
||
hooks.ISO_8601 = function () {};
|
||
|
||
// constant that refers to the RFC 2822 form
|
||
hooks.RFC_2822 = function () {};
|
||
|
||
// date from string and format string
|
||
function configFromStringAndFormat(config) {
|
||
// TODO: Move this to another part of the creation flow to prevent circular deps
|
||
if (config._f === hooks.ISO_8601) {
|
||
configFromISO(config);
|
||
return;
|
||
}
|
||
if (config._f === hooks.RFC_2822) {
|
||
configFromRFC2822(config);
|
||
return;
|
||
}
|
||
config._a = [];
|
||
getParsingFlags(config).empty = true;
|
||
|
||
// This array is used to make a Date, either with `new Date` or `Date.UTC`
|
||
var string = '' + config._i,
|
||
i,
|
||
parsedInput,
|
||
tokens,
|
||
token,
|
||
skipped,
|
||
stringLength = string.length,
|
||
totalParsedInputLength = 0,
|
||
era,
|
||
tokenLen;
|
||
|
||
tokens =
|
||
expandFormat(config._f, config._locale).match(formattingTokens) || [];
|
||
tokenLen = tokens.length;
|
||
for (i = 0; i < tokenLen; i++) {
|
||
token = tokens[i];
|
||
parsedInput = (string.match(getParseRegexForToken(token, config)) ||
|
||
[])[0];
|
||
if (parsedInput) {
|
||
skipped = string.substr(0, string.indexOf(parsedInput));
|
||
if (skipped.length > 0) {
|
||
getParsingFlags(config).unusedInput.push(skipped);
|
||
}
|
||
string = string.slice(
|
||
string.indexOf(parsedInput) + parsedInput.length
|
||
);
|
||
totalParsedInputLength += parsedInput.length;
|
||
}
|
||
// don't parse if it's not a known token
|
||
if (formatTokenFunctions[token]) {
|
||
if (parsedInput) {
|
||
getParsingFlags(config).empty = false;
|
||
} else {
|
||
getParsingFlags(config).unusedTokens.push(token);
|
||
}
|
||
addTimeToArrayFromToken(token, parsedInput, config);
|
||
} else if (config._strict && !parsedInput) {
|
||
getParsingFlags(config).unusedTokens.push(token);
|
||
}
|
||
}
|
||
|
||
// add remaining unparsed input length to the string
|
||
getParsingFlags(config).charsLeftOver =
|
||
stringLength - totalParsedInputLength;
|
||
if (string.length > 0) {
|
||
getParsingFlags(config).unusedInput.push(string);
|
||
}
|
||
|
||
// clear _12h flag if hour is <= 12
|
||
if (
|
||
config._a[HOUR] <= 12 &&
|
||
getParsingFlags(config).bigHour === true &&
|
||
config._a[HOUR] > 0
|
||
) {
|
||
getParsingFlags(config).bigHour = undefined;
|
||
}
|
||
|
||
getParsingFlags(config).parsedDateParts = config._a.slice(0);
|
||
getParsingFlags(config).meridiem = config._meridiem;
|
||
// handle meridiem
|
||
config._a[HOUR] = meridiemFixWrap(
|
||
config._locale,
|
||
config._a[HOUR],
|
||
config._meridiem
|
||
);
|
||
|
||
// handle era
|
||
era = getParsingFlags(config).era;
|
||
if (era !== null) {
|
||
config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
|
||
}
|
||
|
||
configFromArray(config);
|
||
checkOverflow(config);
|
||
}
|
||
|
||
function meridiemFixWrap(locale, hour, meridiem) {
|
||
var isPm;
|
||
|
||
if (meridiem == null) {
|
||
// nothing to do
|
||
return hour;
|
||
}
|
||
if (locale.meridiemHour != null) {
|
||
return locale.meridiemHour(hour, meridiem);
|
||
} else if (locale.isPM != null) {
|
||
// Fallback
|
||
isPm = locale.isPM(meridiem);
|
||
if (isPm && hour < 12) {
|
||
hour += 12;
|
||
}
|
||
if (!isPm && hour === 12) {
|
||
hour = 0;
|
||
}
|
||
return hour;
|
||
} else {
|
||
// this is not supposed to happen
|
||
return hour;
|
||
}
|
||
}
|
||
|
||
// date from string and array of format strings
|
||
function configFromStringAndArray(config) {
|
||
var tempConfig,
|
||
bestMoment,
|
||
scoreToBeat,
|
||
i,
|
||
currentScore,
|
||
validFormatFound,
|
||
bestFormatIsValid = false,
|
||
configfLen = config._f.length;
|
||
|
||
if (configfLen === 0) {
|
||
getParsingFlags(config).invalidFormat = true;
|
||
config._d = new Date(NaN);
|
||
return;
|
||
}
|
||
|
||
for (i = 0; i < configfLen; i++) {
|
||
currentScore = 0;
|
||
validFormatFound = false;
|
||
tempConfig = copyConfig({}, config);
|
||
if (config._useUTC != null) {
|
||
tempConfig._useUTC = config._useUTC;
|
||
}
|
||
tempConfig._f = config._f[i];
|
||
configFromStringAndFormat(tempConfig);
|
||
|
||
if (isValid(tempConfig)) {
|
||
validFormatFound = true;
|
||
}
|
||
|
||
// if there is any input that was not parsed add a penalty for that format
|
||
currentScore += getParsingFlags(tempConfig).charsLeftOver;
|
||
|
||
//or tokens
|
||
currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
|
||
|
||
getParsingFlags(tempConfig).score = currentScore;
|
||
|
||
if (!bestFormatIsValid) {
|
||
if (
|
||
scoreToBeat == null ||
|
||
currentScore < scoreToBeat ||
|
||
validFormatFound
|
||
) {
|
||
scoreToBeat = currentScore;
|
||
bestMoment = tempConfig;
|
||
if (validFormatFound) {
|
||
bestFormatIsValid = true;
|
||
}
|
||
}
|
||
} else {
|
||
if (currentScore < scoreToBeat) {
|
||
scoreToBeat = currentScore;
|
||
bestMoment = tempConfig;
|
||
}
|
||
}
|
||
}
|
||
|
||
extend(config, bestMoment || tempConfig);
|
||
}
|
||
|
||
function configFromObject(config) {
|
||
if (config._d) {
|
||
return;
|
||
}
|
||
|
||
var i = normalizeObjectUnits(config._i),
|
||
dayOrDate = i.day === undefined ? i.date : i.day;
|
||
config._a = map(
|
||
[i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
|
||
function (obj) {
|
||
return obj && parseInt(obj, 10);
|
||
}
|
||
);
|
||
|
||
configFromArray(config);
|
||
}
|
||
|
||
function createFromConfig(config) {
|
||
var res = new Moment(checkOverflow(prepareConfig(config)));
|
||
if (res._nextDay) {
|
||
// Adding is smart enough around DST
|
||
res.add(1, 'd');
|
||
res._nextDay = undefined;
|
||
}
|
||
|
||
return res;
|
||
}
|
||
|
||
function prepareConfig(config) {
|
||
var input = config._i,
|
||
format = config._f;
|
||
|
||
config._locale = config._locale || getLocale(config._l);
|
||
|
||
if (input === null || (format === undefined && input === '')) {
|
||
return createInvalid({ nullInput: true });
|
||
}
|
||
|
||
if (typeof input === 'string') {
|
||
config._i = input = config._locale.preparse(input);
|
||
}
|
||
|
||
if (isMoment(input)) {
|
||
return new Moment(checkOverflow(input));
|
||
} else if (isDate(input)) {
|
||
config._d = input;
|
||
} else if (isArray(format)) {
|
||
configFromStringAndArray(config);
|
||
} else if (format) {
|
||
configFromStringAndFormat(config);
|
||
} else {
|
||
configFromInput(config);
|
||
}
|
||
|
||
if (!isValid(config)) {
|
||
config._d = null;
|
||
}
|
||
|
||
return config;
|
||
}
|
||
|
||
function configFromInput(config) {
|
||
var input = config._i;
|
||
if (isUndefined(input)) {
|
||
config._d = new Date(hooks.now());
|
||
} else if (isDate(input)) {
|
||
config._d = new Date(input.valueOf());
|
||
} else if (typeof input === 'string') {
|
||
configFromString(config);
|
||
} else if (isArray(input)) {
|
||
config._a = map(input.slice(0), function (obj) {
|
||
return parseInt(obj, 10);
|
||
});
|
||
configFromArray(config);
|
||
} else if (isObject(input)) {
|
||
configFromObject(config);
|
||
} else if (isNumber(input)) {
|
||
// from milliseconds
|
||
config._d = new Date(input);
|
||
} else {
|
||
hooks.createFromInputFallback(config);
|
||
}
|
||
}
|
||
|
||
function createLocalOrUTC(input, format, locale, strict, isUTC) {
|
||
var c = {};
|
||
|
||
if (format === true || format === false) {
|
||
strict = format;
|
||
format = undefined;
|
||
}
|
||
|
||
if (locale === true || locale === false) {
|
||
strict = locale;
|
||
locale = undefined;
|
||
}
|
||
|
||
if (
|
||
(isObject(input) && isObjectEmpty(input)) ||
|
||
(isArray(input) && input.length === 0)
|
||
) {
|
||
input = undefined;
|
||
}
|
||
// object construction must be done this way.
|
||
// https://github.com/moment/moment/issues/1423
|
||
c._isAMomentObject = true;
|
||
c._useUTC = c._isUTC = isUTC;
|
||
c._l = locale;
|
||
c._i = input;
|
||
c._f = format;
|
||
c._strict = strict;
|
||
|
||
return createFromConfig(c);
|
||
}
|
||
|
||
function createLocal(input, format, locale, strict) {
|
||
return createLocalOrUTC(input, format, locale, strict, false);
|
||
}
|
||
|
||
var prototypeMin = deprecate(
|
||
'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
|
||
function () {
|
||
var other = createLocal.apply(null, arguments);
|
||
if (this.isValid() && other.isValid()) {
|
||
return other < this ? this : other;
|
||
} else {
|
||
return createInvalid();
|
||
}
|
||
}
|
||
),
|
||
prototypeMax = deprecate(
|
||
'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
|
||
function () {
|
||
var other = createLocal.apply(null, arguments);
|
||
if (this.isValid() && other.isValid()) {
|
||
return other > this ? this : other;
|
||
} else {
|
||
return createInvalid();
|
||
}
|
||
}
|
||
);
|
||
|
||
// Pick a moment m from moments so that m[fn](other) is true for all
|
||
// other. This relies on the function fn to be transitive.
|
||
//
|
||
// moments should either be an array of moment objects or an array, whose
|
||
// first element is an array of moment objects.
|
||
function pickBy(fn, moments) {
|
||
var res, i;
|
||
if (moments.length === 1 && isArray(moments[0])) {
|
||
moments = moments[0];
|
||
}
|
||
if (!moments.length) {
|
||
return createLocal();
|
||
}
|
||
res = moments[0];
|
||
for (i = 1; i < moments.length; ++i) {
|
||
if (!moments[i].isValid() || moments[i][fn](res)) {
|
||
res = moments[i];
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
|
||
// TODO: Use [].sort instead?
|
||
function min() {
|
||
var args = [].slice.call(arguments, 0);
|
||
|
||
return pickBy('isBefore', args);
|
||
}
|
||
|
||
function max() {
|
||
var args = [].slice.call(arguments, 0);
|
||
|
||
return pickBy('isAfter', args);
|
||
}
|
||
|
||
var now = function () {
|
||
return Date.now ? Date.now() : +new Date();
|
||
};
|
||
|
||
var ordering = [
|
||
'year',
|
||
'quarter',
|
||
'month',
|
||
'week',
|
||
'day',
|
||
'hour',
|
||
'minute',
|
||
'second',
|
||
'millisecond',
|
||
];
|
||
|
||
function isDurationValid(m) {
|
||
var key,
|
||
unitHasDecimal = false,
|
||
i,
|
||
orderLen = ordering.length;
|
||
for (key in m) {
|
||
if (
|
||
hasOwnProp(m, key) &&
|
||
!(
|
||
indexOf.call(ordering, key) !== -1 &&
|
||
(m[key] == null || !isNaN(m[key]))
|
||
)
|
||
) {
|
||
return false;
|
||
}
|
||
}
|
||
|
||
for (i = 0; i < orderLen; ++i) {
|
||
if (m[ordering[i]]) {
|
||
if (unitHasDecimal) {
|
||
return false; // only allow non-integers for smallest unit
|
||
}
|
||
if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
|
||
unitHasDecimal = true;
|
||
}
|
||
}
|
||
}
|
||
|
||
return true;
|
||
}
|
||
|
||
function isValid$1() {
|
||
return this._isValid;
|
||
}
|
||
|
||
function createInvalid$1() {
|
||
return createDuration(NaN);
|
||
}
|
||
|
||
function Duration(duration) {
|
||
var normalizedInput = normalizeObjectUnits(duration),
|
||
years = normalizedInput.year || 0,
|
||
quarters = normalizedInput.quarter || 0,
|
||
months = normalizedInput.month || 0,
|
||
weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
|
||
days = normalizedInput.day || 0,
|
||
hours = normalizedInput.hour || 0,
|
||
minutes = normalizedInput.minute || 0,
|
||
seconds = normalizedInput.second || 0,
|
||
milliseconds = normalizedInput.millisecond || 0;
|
||
|
||
this._isValid = isDurationValid(normalizedInput);
|
||
|
||
// representation for dateAddRemove
|
||
this._milliseconds =
|
||
+milliseconds +
|
||
seconds * 1e3 + // 1000
|
||
minutes * 6e4 + // 1000 * 60
|
||
hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
|
||
// Because of dateAddRemove treats 24 hours as different from a
|
||
// day when working around DST, we need to store them separately
|
||
this._days = +days + weeks * 7;
|
||
// It is impossible to translate months into days without knowing
|
||
// which months you are are talking about, so we have to store
|
||
// it separately.
|
||
this._months = +months + quarters * 3 + years * 12;
|
||
|
||
this._data = {};
|
||
|
||
this._locale = getLocale();
|
||
|
||
this._bubble();
|
||
}
|
||
|
||
function isDuration(obj) {
|
||
return obj instanceof Duration;
|
||
}
|
||
|
||
function absRound(number) {
|
||
if (number < 0) {
|
||
return Math.round(-1 * number) * -1;
|
||
} else {
|
||
return Math.round(number);
|
||
}
|
||
}
|
||
|
||
// compare two arrays, return the number of differences
|
||
function compareArrays(array1, array2, dontConvert) {
|
||
var len = Math.min(array1.length, array2.length),
|
||
lengthDiff = Math.abs(array1.length - array2.length),
|
||
diffs = 0,
|
||
i;
|
||
for (i = 0; i < len; i++) {
|
||
if (
|
||
(dontConvert && array1[i] !== array2[i]) ||
|
||
(!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
|
||
) {
|
||
diffs++;
|
||
}
|
||
}
|
||
return diffs + lengthDiff;
|
||
}
|
||
|
||
// FORMATTING
|
||
|
||
function offset(token, separator) {
|
||
addFormatToken(token, 0, 0, function () {
|
||
var offset = this.utcOffset(),
|
||
sign = '+';
|
||
if (offset < 0) {
|
||
offset = -offset;
|
||
sign = '-';
|
||
}
|
||
return (
|
||
sign +
|
||
zeroFill(~~(offset / 60), 2) +
|
||
separator +
|
||
zeroFill(~~offset % 60, 2)
|
||
);
|
||
});
|
||
}
|
||
|
||
offset('Z', ':');
|
||
offset('ZZ', '');
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('Z', matchShortOffset);
|
||
addRegexToken('ZZ', matchShortOffset);
|
||
addParseToken(['Z', 'ZZ'], function (input, array, config) {
|
||
config._useUTC = true;
|
||
config._tzm = offsetFromString(matchShortOffset, input);
|
||
});
|
||
|
||
// HELPERS
|
||
|
||
// timezone chunker
|
||
// '+10:00' > ['10', '00']
|
||
// '-1530' > ['-15', '30']
|
||
var chunkOffset = /([\+\-]|\d\d)/gi;
|
||
|
||
function offsetFromString(matcher, string) {
|
||
var matches = (string || '').match(matcher),
|
||
chunk,
|
||
parts,
|
||
minutes;
|
||
|
||
if (matches === null) {
|
||
return null;
|
||
}
|
||
|
||
chunk = matches[matches.length - 1] || [];
|
||
parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
|
||
minutes = +(parts[1] * 60) + toInt(parts[2]);
|
||
|
||
return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
|
||
}
|
||
|
||
// Return a moment from input, that is local/utc/zone equivalent to model.
|
||
function cloneWithOffset(input, model) {
|
||
var res, diff;
|
||
if (model._isUTC) {
|
||
res = model.clone();
|
||
diff =
|
||
(isMoment(input) || isDate(input)
|
||
? input.valueOf()
|
||
: createLocal(input).valueOf()) - res.valueOf();
|
||
// Use low-level api, because this fn is low-level api.
|
||
res._d.setTime(res._d.valueOf() + diff);
|
||
hooks.updateOffset(res, false);
|
||
return res;
|
||
} else {
|
||
return createLocal(input).local();
|
||
}
|
||
}
|
||
|
||
function getDateOffset(m) {
|
||
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
|
||
// https://github.com/moment/moment/pull/1871
|
||
return -Math.round(m._d.getTimezoneOffset());
|
||
}
|
||
|
||
// HOOKS
|
||
|
||
// This function will be called whenever a moment is mutated.
|
||
// It is intended to keep the offset in sync with the timezone.
|
||
hooks.updateOffset = function () {};
|
||
|
||
// MOMENTS
|
||
|
||
// keepLocalTime = true means only change the timezone, without
|
||
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
|
||
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
|
||
// +0200, so we adjust the time as needed, to be valid.
|
||
//
|
||
// Keeping the time actually adds/subtracts (one hour)
|
||
// from the actual represented time. That is why we call updateOffset
|
||
// a second time. In case it wants us to change the offset again
|
||
// _changeInProgress == true case, then we have to adjust, because
|
||
// there is no such time in the given timezone.
|
||
function getSetOffset(input, keepLocalTime, keepMinutes) {
|
||
var offset = this._offset || 0,
|
||
localAdjust;
|
||
if (!this.isValid()) {
|
||
return input != null ? this : NaN;
|
||
}
|
||
if (input != null) {
|
||
if (typeof input === 'string') {
|
||
input = offsetFromString(matchShortOffset, input);
|
||
if (input === null) {
|
||
return this;
|
||
}
|
||
} else if (Math.abs(input) < 16 && !keepMinutes) {
|
||
input = input * 60;
|
||
}
|
||
if (!this._isUTC && keepLocalTime) {
|
||
localAdjust = getDateOffset(this);
|
||
}
|
||
this._offset = input;
|
||
this._isUTC = true;
|
||
if (localAdjust != null) {
|
||
this.add(localAdjust, 'm');
|
||
}
|
||
if (offset !== input) {
|
||
if (!keepLocalTime || this._changeInProgress) {
|
||
addSubtract(
|
||
this,
|
||
createDuration(input - offset, 'm'),
|
||
1,
|
||
false
|
||
);
|
||
} else if (!this._changeInProgress) {
|
||
this._changeInProgress = true;
|
||
hooks.updateOffset(this, true);
|
||
this._changeInProgress = null;
|
||
}
|
||
}
|
||
return this;
|
||
} else {
|
||
return this._isUTC ? offset : getDateOffset(this);
|
||
}
|
||
}
|
||
|
||
function getSetZone(input, keepLocalTime) {
|
||
if (input != null) {
|
||
if (typeof input !== 'string') {
|
||
input = -input;
|
||
}
|
||
|
||
this.utcOffset(input, keepLocalTime);
|
||
|
||
return this;
|
||
} else {
|
||
return -this.utcOffset();
|
||
}
|
||
}
|
||
|
||
function setOffsetToUTC(keepLocalTime) {
|
||
return this.utcOffset(0, keepLocalTime);
|
||
}
|
||
|
||
function setOffsetToLocal(keepLocalTime) {
|
||
if (this._isUTC) {
|
||
this.utcOffset(0, keepLocalTime);
|
||
this._isUTC = false;
|
||
|
||
if (keepLocalTime) {
|
||
this.subtract(getDateOffset(this), 'm');
|
||
}
|
||
}
|
||
return this;
|
||
}
|
||
|
||
function setOffsetToParsedOffset() {
|
||
if (this._tzm != null) {
|
||
this.utcOffset(this._tzm, false, true);
|
||
} else if (typeof this._i === 'string') {
|
||
var tZone = offsetFromString(matchOffset, this._i);
|
||
if (tZone != null) {
|
||
this.utcOffset(tZone);
|
||
} else {
|
||
this.utcOffset(0, true);
|
||
}
|
||
}
|
||
return this;
|
||
}
|
||
|
||
function hasAlignedHourOffset(input) {
|
||
if (!this.isValid()) {
|
||
return false;
|
||
}
|
||
input = input ? createLocal(input).utcOffset() : 0;
|
||
|
||
return (this.utcOffset() - input) % 60 === 0;
|
||
}
|
||
|
||
function isDaylightSavingTime() {
|
||
return (
|
||
this.utcOffset() > this.clone().month(0).utcOffset() ||
|
||
this.utcOffset() > this.clone().month(5).utcOffset()
|
||
);
|
||
}
|
||
|
||
function isDaylightSavingTimeShifted() {
|
||
if (!isUndefined(this._isDSTShifted)) {
|
||
return this._isDSTShifted;
|
||
}
|
||
|
||
var c = {},
|
||
other;
|
||
|
||
copyConfig(c, this);
|
||
c = prepareConfig(c);
|
||
|
||
if (c._a) {
|
||
other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
|
||
this._isDSTShifted =
|
||
this.isValid() && compareArrays(c._a, other.toArray()) > 0;
|
||
} else {
|
||
this._isDSTShifted = false;
|
||
}
|
||
|
||
return this._isDSTShifted;
|
||
}
|
||
|
||
function isLocal() {
|
||
return this.isValid() ? !this._isUTC : false;
|
||
}
|
||
|
||
function isUtcOffset() {
|
||
return this.isValid() ? this._isUTC : false;
|
||
}
|
||
|
||
function isUtc() {
|
||
return this.isValid() ? this._isUTC && this._offset === 0 : false;
|
||
}
|
||
|
||
// ASP.NET json date format regex
|
||
var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
|
||
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
|
||
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
|
||
// and further modified to allow for strings containing both week and day
|
||
isoRegex =
|
||
/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
||
|
||
function createDuration(input, key) {
|
||
var duration = input,
|
||
// matching against regexp is expensive, do it on demand
|
||
match = null,
|
||
sign,
|
||
ret,
|
||
diffRes;
|
||
|
||
if (isDuration(input)) {
|
||
duration = {
|
||
ms: input._milliseconds,
|
||
d: input._days,
|
||
M: input._months,
|
||
};
|
||
} else if (isNumber(input) || !isNaN(+input)) {
|
||
duration = {};
|
||
if (key) {
|
||
duration[key] = +input;
|
||
} else {
|
||
duration.milliseconds = +input;
|
||
}
|
||
} else if ((match = aspNetRegex.exec(input))) {
|
||
sign = match[1] === '-' ? -1 : 1;
|
||
duration = {
|
||
y: 0,
|
||
d: toInt(match[DATE]) * sign,
|
||
h: toInt(match[HOUR]) * sign,
|
||
m: toInt(match[MINUTE]) * sign,
|
||
s: toInt(match[SECOND]) * sign,
|
||
ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
|
||
};
|
||
} else if ((match = isoRegex.exec(input))) {
|
||
sign = match[1] === '-' ? -1 : 1;
|
||
duration = {
|
||
y: parseIso(match[2], sign),
|
||
M: parseIso(match[3], sign),
|
||
w: parseIso(match[4], sign),
|
||
d: parseIso(match[5], sign),
|
||
h: parseIso(match[6], sign),
|
||
m: parseIso(match[7], sign),
|
||
s: parseIso(match[8], sign),
|
||
};
|
||
} else if (duration == null) {
|
||
// checks for null or undefined
|
||
duration = {};
|
||
} else if (
|
||
typeof duration === 'object' &&
|
||
('from' in duration || 'to' in duration)
|
||
) {
|
||
diffRes = momentsDifference(
|
||
createLocal(duration.from),
|
||
createLocal(duration.to)
|
||
);
|
||
|
||
duration = {};
|
||
duration.ms = diffRes.milliseconds;
|
||
duration.M = diffRes.months;
|
||
}
|
||
|
||
ret = new Duration(duration);
|
||
|
||
if (isDuration(input) && hasOwnProp(input, '_locale')) {
|
||
ret._locale = input._locale;
|
||
}
|
||
|
||
if (isDuration(input) && hasOwnProp(input, '_isValid')) {
|
||
ret._isValid = input._isValid;
|
||
}
|
||
|
||
return ret;
|
||
}
|
||
|
||
createDuration.fn = Duration.prototype;
|
||
createDuration.invalid = createInvalid$1;
|
||
|
||
function parseIso(inp, sign) {
|
||
// We'd normally use ~~inp for this, but unfortunately it also
|
||
// converts floats to ints.
|
||
// inp may be undefined, so careful calling replace on it.
|
||
var res = inp && parseFloat(inp.replace(',', '.'));
|
||
// apply sign while we're at it
|
||
return (isNaN(res) ? 0 : res) * sign;
|
||
}
|
||
|
||
function positiveMomentsDifference(base, other) {
|
||
var res = {};
|
||
|
||
res.months =
|
||
other.month() - base.month() + (other.year() - base.year()) * 12;
|
||
if (base.clone().add(res.months, 'M').isAfter(other)) {
|
||
--res.months;
|
||
}
|
||
|
||
res.milliseconds = +other - +base.clone().add(res.months, 'M');
|
||
|
||
return res;
|
||
}
|
||
|
||
function momentsDifference(base, other) {
|
||
var res;
|
||
if (!(base.isValid() && other.isValid())) {
|
||
return { milliseconds: 0, months: 0 };
|
||
}
|
||
|
||
other = cloneWithOffset(other, base);
|
||
if (base.isBefore(other)) {
|
||
res = positiveMomentsDifference(base, other);
|
||
} else {
|
||
res = positiveMomentsDifference(other, base);
|
||
res.milliseconds = -res.milliseconds;
|
||
res.months = -res.months;
|
||
}
|
||
|
||
return res;
|
||
}
|
||
|
||
// TODO: remove 'name' arg after deprecation is removed
|
||
function createAdder(direction, name) {
|
||
return function (val, period) {
|
||
var dur, tmp;
|
||
//invert the arguments, but complain about it
|
||
if (period !== null && !isNaN(+period)) {
|
||
deprecateSimple(
|
||
name,
|
||
'moment().' +
|
||
name +
|
||
'(period, number) is deprecated. Please use moment().' +
|
||
name +
|
||
'(number, period). ' +
|
||
'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
|
||
);
|
||
tmp = val;
|
||
val = period;
|
||
period = tmp;
|
||
}
|
||
|
||
dur = createDuration(val, period);
|
||
addSubtract(this, dur, direction);
|
||
return this;
|
||
};
|
||
}
|
||
|
||
function addSubtract(mom, duration, isAdding, updateOffset) {
|
||
var milliseconds = duration._milliseconds,
|
||
days = absRound(duration._days),
|
||
months = absRound(duration._months);
|
||
|
||
if (!mom.isValid()) {
|
||
// No op
|
||
return;
|
||
}
|
||
|
||
updateOffset = updateOffset == null ? true : updateOffset;
|
||
|
||
if (months) {
|
||
setMonth(mom, get(mom, 'Month') + months * isAdding);
|
||
}
|
||
if (days) {
|
||
set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
|
||
}
|
||
if (milliseconds) {
|
||
mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
|
||
}
|
||
if (updateOffset) {
|
||
hooks.updateOffset(mom, days || months);
|
||
}
|
||
}
|
||
|
||
var add = createAdder(1, 'add'),
|
||
subtract = createAdder(-1, 'subtract');
|
||
|
||
function isString(input) {
|
||
return typeof input === 'string' || input instanceof String;
|
||
}
|
||
|
||
// type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
|
||
function isMomentInput(input) {
|
||
return (
|
||
isMoment(input) ||
|
||
isDate(input) ||
|
||
isString(input) ||
|
||
isNumber(input) ||
|
||
isNumberOrStringArray(input) ||
|
||
isMomentInputObject(input) ||
|
||
input === null ||
|
||
input === undefined
|
||
);
|
||
}
|
||
|
||
function isMomentInputObject(input) {
|
||
var objectTest = isObject(input) && !isObjectEmpty(input),
|
||
propertyTest = false,
|
||
properties = [
|
||
'years',
|
||
'year',
|
||
'y',
|
||
'months',
|
||
'month',
|
||
'M',
|
||
'days',
|
||
'day',
|
||
'd',
|
||
'dates',
|
||
'date',
|
||
'D',
|
||
'hours',
|
||
'hour',
|
||
'h',
|
||
'minutes',
|
||
'minute',
|
||
'm',
|
||
'seconds',
|
||
'second',
|
||
's',
|
||
'milliseconds',
|
||
'millisecond',
|
||
'ms',
|
||
],
|
||
i,
|
||
property,
|
||
propertyLen = properties.length;
|
||
|
||
for (i = 0; i < propertyLen; i += 1) {
|
||
property = properties[i];
|
||
propertyTest = propertyTest || hasOwnProp(input, property);
|
||
}
|
||
|
||
return objectTest && propertyTest;
|
||
}
|
||
|
||
function isNumberOrStringArray(input) {
|
||
var arrayTest = isArray(input),
|
||
dataTypeTest = false;
|
||
if (arrayTest) {
|
||
dataTypeTest =
|
||
input.filter(function (item) {
|
||
return !isNumber(item) && isString(input);
|
||
}).length === 0;
|
||
}
|
||
return arrayTest && dataTypeTest;
|
||
}
|
||
|
||
function isCalendarSpec(input) {
|
||
var objectTest = isObject(input) && !isObjectEmpty(input),
|
||
propertyTest = false,
|
||
properties = [
|
||
'sameDay',
|
||
'nextDay',
|
||
'lastDay',
|
||
'nextWeek',
|
||
'lastWeek',
|
||
'sameElse',
|
||
],
|
||
i,
|
||
property;
|
||
|
||
for (i = 0; i < properties.length; i += 1) {
|
||
property = properties[i];
|
||
propertyTest = propertyTest || hasOwnProp(input, property);
|
||
}
|
||
|
||
return objectTest && propertyTest;
|
||
}
|
||
|
||
function getCalendarFormat(myMoment, now) {
|
||
var diff = myMoment.diff(now, 'days', true);
|
||
return diff < -6
|
||
? 'sameElse'
|
||
: diff < -1
|
||
? 'lastWeek'
|
||
: diff < 0
|
||
? 'lastDay'
|
||
: diff < 1
|
||
? 'sameDay'
|
||
: diff < 2
|
||
? 'nextDay'
|
||
: diff < 7
|
||
? 'nextWeek'
|
||
: 'sameElse';
|
||
}
|
||
|
||
function calendar$1(time, formats) {
|
||
// Support for single parameter, formats only overload to the calendar function
|
||
if (arguments.length === 1) {
|
||
if (!arguments[0]) {
|
||
time = undefined;
|
||
formats = undefined;
|
||
} else if (isMomentInput(arguments[0])) {
|
||
time = arguments[0];
|
||
formats = undefined;
|
||
} else if (isCalendarSpec(arguments[0])) {
|
||
formats = arguments[0];
|
||
time = undefined;
|
||
}
|
||
}
|
||
// We want to compare the start of today, vs this.
|
||
// Getting start-of-today depends on whether we're local/utc/offset or not.
|
||
var now = time || createLocal(),
|
||
sod = cloneWithOffset(now, this).startOf('day'),
|
||
format = hooks.calendarFormat(this, sod) || 'sameElse',
|
||
output =
|
||
formats &&
|
||
(isFunction(formats[format])
|
||
? formats[format].call(this, now)
|
||
: formats[format]);
|
||
|
||
return this.format(
|
||
output || this.localeData().calendar(format, this, createLocal(now))
|
||
);
|
||
}
|
||
|
||
function clone() {
|
||
return new Moment(this);
|
||
}
|
||
|
||
function isAfter(input, units) {
|
||
var localInput = isMoment(input) ? input : createLocal(input);
|
||
if (!(this.isValid() && localInput.isValid())) {
|
||
return false;
|
||
}
|
||
units = normalizeUnits(units) || 'millisecond';
|
||
if (units === 'millisecond') {
|
||
return this.valueOf() > localInput.valueOf();
|
||
} else {
|
||
return localInput.valueOf() < this.clone().startOf(units).valueOf();
|
||
}
|
||
}
|
||
|
||
function isBefore(input, units) {
|
||
var localInput = isMoment(input) ? input : createLocal(input);
|
||
if (!(this.isValid() && localInput.isValid())) {
|
||
return false;
|
||
}
|
||
units = normalizeUnits(units) || 'millisecond';
|
||
if (units === 'millisecond') {
|
||
return this.valueOf() < localInput.valueOf();
|
||
} else {
|
||
return this.clone().endOf(units).valueOf() < localInput.valueOf();
|
||
}
|
||
}
|
||
|
||
function isBetween(from, to, units, inclusivity) {
|
||
var localFrom = isMoment(from) ? from : createLocal(from),
|
||
localTo = isMoment(to) ? to : createLocal(to);
|
||
if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
|
||
return false;
|
||
}
|
||
inclusivity = inclusivity || '()';
|
||
return (
|
||
(inclusivity[0] === '('
|
||
? this.isAfter(localFrom, units)
|
||
: !this.isBefore(localFrom, units)) &&
|
||
(inclusivity[1] === ')'
|
||
? this.isBefore(localTo, units)
|
||
: !this.isAfter(localTo, units))
|
||
);
|
||
}
|
||
|
||
function isSame(input, units) {
|
||
var localInput = isMoment(input) ? input : createLocal(input),
|
||
inputMs;
|
||
if (!(this.isValid() && localInput.isValid())) {
|
||
return false;
|
||
}
|
||
units = normalizeUnits(units) || 'millisecond';
|
||
if (units === 'millisecond') {
|
||
return this.valueOf() === localInput.valueOf();
|
||
} else {
|
||
inputMs = localInput.valueOf();
|
||
return (
|
||
this.clone().startOf(units).valueOf() <= inputMs &&
|
||
inputMs <= this.clone().endOf(units).valueOf()
|
||
);
|
||
}
|
||
}
|
||
|
||
function isSameOrAfter(input, units) {
|
||
return this.isSame(input, units) || this.isAfter(input, units);
|
||
}
|
||
|
||
function isSameOrBefore(input, units) {
|
||
return this.isSame(input, units) || this.isBefore(input, units);
|
||
}
|
||
|
||
function diff(input, units, asFloat) {
|
||
var that, zoneDelta, output;
|
||
|
||
if (!this.isValid()) {
|
||
return NaN;
|
||
}
|
||
|
||
that = cloneWithOffset(input, this);
|
||
|
||
if (!that.isValid()) {
|
||
return NaN;
|
||
}
|
||
|
||
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
|
||
|
||
units = normalizeUnits(units);
|
||
|
||
switch (units) {
|
||
case 'year':
|
||
output = monthDiff(this, that) / 12;
|
||
break;
|
||
case 'month':
|
||
output = monthDiff(this, that);
|
||
break;
|
||
case 'quarter':
|
||
output = monthDiff(this, that) / 3;
|
||
break;
|
||
case 'second':
|
||
output = (this - that) / 1e3;
|
||
break; // 1000
|
||
case 'minute':
|
||
output = (this - that) / 6e4;
|
||
break; // 1000 * 60
|
||
case 'hour':
|
||
output = (this - that) / 36e5;
|
||
break; // 1000 * 60 * 60
|
||
case 'day':
|
||
output = (this - that - zoneDelta) / 864e5;
|
||
break; // 1000 * 60 * 60 * 24, negate dst
|
||
case 'week':
|
||
output = (this - that - zoneDelta) / 6048e5;
|
||
break; // 1000 * 60 * 60 * 24 * 7, negate dst
|
||
default:
|
||
output = this - that;
|
||
}
|
||
|
||
return asFloat ? output : absFloor(output);
|
||
}
|
||
|
||
function monthDiff(a, b) {
|
||
if (a.date() < b.date()) {
|
||
// end-of-month calculations work correct when the start month has more
|
||
// days than the end month.
|
||
return -monthDiff(b, a);
|
||
}
|
||
// difference in months
|
||
var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
|
||
// b is in (anchor - 1 month, anchor + 1 month)
|
||
anchor = a.clone().add(wholeMonthDiff, 'months'),
|
||
anchor2,
|
||
adjust;
|
||
|
||
if (b - anchor < 0) {
|
||
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
|
||
// linear across the month
|
||
adjust = (b - anchor) / (anchor - anchor2);
|
||
} else {
|
||
anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
|
||
// linear across the month
|
||
adjust = (b - anchor) / (anchor2 - anchor);
|
||
}
|
||
|
||
//check for negative zero, return zero if negative zero
|
||
return -(wholeMonthDiff + adjust) || 0;
|
||
}
|
||
|
||
hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
|
||
hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
|
||
|
||
function toString() {
|
||
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
|
||
}
|
||
|
||
function toISOString(keepOffset) {
|
||
if (!this.isValid()) {
|
||
return null;
|
||
}
|
||
var utc = keepOffset !== true,
|
||
m = utc ? this.clone().utc() : this;
|
||
if (m.year() < 0 || m.year() > 9999) {
|
||
return formatMoment(
|
||
m,
|
||
utc
|
||
? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
|
||
: 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
|
||
);
|
||
}
|
||
if (isFunction(Date.prototype.toISOString)) {
|
||
// native implementation is ~50x faster, use it when we can
|
||
if (utc) {
|
||
return this.toDate().toISOString();
|
||
} else {
|
||
return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
|
||
.toISOString()
|
||
.replace('Z', formatMoment(m, 'Z'));
|
||
}
|
||
}
|
||
return formatMoment(
|
||
m,
|
||
utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
|
||
);
|
||
}
|
||
|
||
/**
|
||
* Return a human readable representation of a moment that can
|
||
* also be evaluated to get a new moment which is the same
|
||
*
|
||
* @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
|
||
*/
|
||
function inspect() {
|
||
if (!this.isValid()) {
|
||
return 'moment.invalid(/* ' + this._i + ' */)';
|
||
}
|
||
var func = 'moment',
|
||
zone = '',
|
||
prefix,
|
||
year,
|
||
datetime,
|
||
suffix;
|
||
if (!this.isLocal()) {
|
||
func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
|
||
zone = 'Z';
|
||
}
|
||
prefix = '[' + func + '("]';
|
||
year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
|
||
datetime = '-MM-DD[T]HH:mm:ss.SSS';
|
||
suffix = zone + '[")]';
|
||
|
||
return this.format(prefix + year + datetime + suffix);
|
||
}
|
||
|
||
function format(inputString) {
|
||
if (!inputString) {
|
||
inputString = this.isUtc()
|
||
? hooks.defaultFormatUtc
|
||
: hooks.defaultFormat;
|
||
}
|
||
var output = formatMoment(this, inputString);
|
||
return this.localeData().postformat(output);
|
||
}
|
||
|
||
function from(time, withoutSuffix) {
|
||
if (
|
||
this.isValid() &&
|
||
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
|
||
) {
|
||
return createDuration({ to: this, from: time })
|
||
.locale(this.locale())
|
||
.humanize(!withoutSuffix);
|
||
} else {
|
||
return this.localeData().invalidDate();
|
||
}
|
||
}
|
||
|
||
function fromNow(withoutSuffix) {
|
||
return this.from(createLocal(), withoutSuffix);
|
||
}
|
||
|
||
function to(time, withoutSuffix) {
|
||
if (
|
||
this.isValid() &&
|
||
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
|
||
) {
|
||
return createDuration({ from: this, to: time })
|
||
.locale(this.locale())
|
||
.humanize(!withoutSuffix);
|
||
} else {
|
||
return this.localeData().invalidDate();
|
||
}
|
||
}
|
||
|
||
function toNow(withoutSuffix) {
|
||
return this.to(createLocal(), withoutSuffix);
|
||
}
|
||
|
||
// If passed a locale key, it will set the locale for this
|
||
// instance. Otherwise, it will return the locale configuration
|
||
// variables for this instance.
|
||
function locale(key) {
|
||
var newLocaleData;
|
||
|
||
if (key === undefined) {
|
||
return this._locale._abbr;
|
||
} else {
|
||
newLocaleData = getLocale(key);
|
||
if (newLocaleData != null) {
|
||
this._locale = newLocaleData;
|
||
}
|
||
return this;
|
||
}
|
||
}
|
||
|
||
var lang = deprecate(
|
||
'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
|
||
function (key) {
|
||
if (key === undefined) {
|
||
return this.localeData();
|
||
} else {
|
||
return this.locale(key);
|
||
}
|
||
}
|
||
);
|
||
|
||
function localeData() {
|
||
return this._locale;
|
||
}
|
||
|
||
var MS_PER_SECOND = 1000,
|
||
MS_PER_MINUTE = 60 * MS_PER_SECOND,
|
||
MS_PER_HOUR = 60 * MS_PER_MINUTE,
|
||
MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
|
||
|
||
// actual modulo - handles negative numbers (for dates before 1970):
|
||
function mod$1(dividend, divisor) {
|
||
return ((dividend % divisor) + divisor) % divisor;
|
||
}
|
||
|
||
function localStartOfDate(y, m, d) {
|
||
// the date constructor remaps years 0-99 to 1900-1999
|
||
if (y < 100 && y >= 0) {
|
||
// preserve leap years using a full 400 year cycle, then reset
|
||
return new Date(y + 400, m, d) - MS_PER_400_YEARS;
|
||
} else {
|
||
return new Date(y, m, d).valueOf();
|
||
}
|
||
}
|
||
|
||
function utcStartOfDate(y, m, d) {
|
||
// Date.UTC remaps years 0-99 to 1900-1999
|
||
if (y < 100 && y >= 0) {
|
||
// preserve leap years using a full 400 year cycle, then reset
|
||
return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
|
||
} else {
|
||
return Date.UTC(y, m, d);
|
||
}
|
||
}
|
||
|
||
function startOf(units) {
|
||
var time, startOfDate;
|
||
units = normalizeUnits(units);
|
||
if (units === undefined || units === 'millisecond' || !this.isValid()) {
|
||
return this;
|
||
}
|
||
|
||
startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
||
|
||
switch (units) {
|
||
case 'year':
|
||
time = startOfDate(this.year(), 0, 1);
|
||
break;
|
||
case 'quarter':
|
||
time = startOfDate(
|
||
this.year(),
|
||
this.month() - (this.month() % 3),
|
||
1
|
||
);
|
||
break;
|
||
case 'month':
|
||
time = startOfDate(this.year(), this.month(), 1);
|
||
break;
|
||
case 'week':
|
||
time = startOfDate(
|
||
this.year(),
|
||
this.month(),
|
||
this.date() - this.weekday()
|
||
);
|
||
break;
|
||
case 'isoWeek':
|
||
time = startOfDate(
|
||
this.year(),
|
||
this.month(),
|
||
this.date() - (this.isoWeekday() - 1)
|
||
);
|
||
break;
|
||
case 'day':
|
||
case 'date':
|
||
time = startOfDate(this.year(), this.month(), this.date());
|
||
break;
|
||
case 'hour':
|
||
time = this._d.valueOf();
|
||
time -= mod$1(
|
||
time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
|
||
MS_PER_HOUR
|
||
);
|
||
break;
|
||
case 'minute':
|
||
time = this._d.valueOf();
|
||
time -= mod$1(time, MS_PER_MINUTE);
|
||
break;
|
||
case 'second':
|
||
time = this._d.valueOf();
|
||
time -= mod$1(time, MS_PER_SECOND);
|
||
break;
|
||
}
|
||
|
||
this._d.setTime(time);
|
||
hooks.updateOffset(this, true);
|
||
return this;
|
||
}
|
||
|
||
function endOf(units) {
|
||
var time, startOfDate;
|
||
units = normalizeUnits(units);
|
||
if (units === undefined || units === 'millisecond' || !this.isValid()) {
|
||
return this;
|
||
}
|
||
|
||
startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
|
||
|
||
switch (units) {
|
||
case 'year':
|
||
time = startOfDate(this.year() + 1, 0, 1) - 1;
|
||
break;
|
||
case 'quarter':
|
||
time =
|
||
startOfDate(
|
||
this.year(),
|
||
this.month() - (this.month() % 3) + 3,
|
||
1
|
||
) - 1;
|
||
break;
|
||
case 'month':
|
||
time = startOfDate(this.year(), this.month() + 1, 1) - 1;
|
||
break;
|
||
case 'week':
|
||
time =
|
||
startOfDate(
|
||
this.year(),
|
||
this.month(),
|
||
this.date() - this.weekday() + 7
|
||
) - 1;
|
||
break;
|
||
case 'isoWeek':
|
||
time =
|
||
startOfDate(
|
||
this.year(),
|
||
this.month(),
|
||
this.date() - (this.isoWeekday() - 1) + 7
|
||
) - 1;
|
||
break;
|
||
case 'day':
|
||
case 'date':
|
||
time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
|
||
break;
|
||
case 'hour':
|
||
time = this._d.valueOf();
|
||
time +=
|
||
MS_PER_HOUR -
|
||
mod$1(
|
||
time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
|
||
MS_PER_HOUR
|
||
) -
|
||
1;
|
||
break;
|
||
case 'minute':
|
||
time = this._d.valueOf();
|
||
time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
|
||
break;
|
||
case 'second':
|
||
time = this._d.valueOf();
|
||
time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
|
||
break;
|
||
}
|
||
|
||
this._d.setTime(time);
|
||
hooks.updateOffset(this, true);
|
||
return this;
|
||
}
|
||
|
||
function valueOf() {
|
||
return this._d.valueOf() - (this._offset || 0) * 60000;
|
||
}
|
||
|
||
function unix() {
|
||
return Math.floor(this.valueOf() / 1000);
|
||
}
|
||
|
||
function toDate() {
|
||
return new Date(this.valueOf());
|
||
}
|
||
|
||
function toArray() {
|
||
var m = this;
|
||
return [
|
||
m.year(),
|
||
m.month(),
|
||
m.date(),
|
||
m.hour(),
|
||
m.minute(),
|
||
m.second(),
|
||
m.millisecond(),
|
||
];
|
||
}
|
||
|
||
function toObject() {
|
||
var m = this;
|
||
return {
|
||
years: m.year(),
|
||
months: m.month(),
|
||
date: m.date(),
|
||
hours: m.hours(),
|
||
minutes: m.minutes(),
|
||
seconds: m.seconds(),
|
||
milliseconds: m.milliseconds(),
|
||
};
|
||
}
|
||
|
||
function toJSON() {
|
||
// new Date(NaN).toJSON() === null
|
||
return this.isValid() ? this.toISOString() : null;
|
||
}
|
||
|
||
function isValid$2() {
|
||
return isValid(this);
|
||
}
|
||
|
||
function parsingFlags() {
|
||
return extend({}, getParsingFlags(this));
|
||
}
|
||
|
||
function invalidAt() {
|
||
return getParsingFlags(this).overflow;
|
||
}
|
||
|
||
function creationData() {
|
||
return {
|
||
input: this._i,
|
||
format: this._f,
|
||
locale: this._locale,
|
||
isUTC: this._isUTC,
|
||
strict: this._strict,
|
||
};
|
||
}
|
||
|
||
addFormatToken('N', 0, 0, 'eraAbbr');
|
||
addFormatToken('NN', 0, 0, 'eraAbbr');
|
||
addFormatToken('NNN', 0, 0, 'eraAbbr');
|
||
addFormatToken('NNNN', 0, 0, 'eraName');
|
||
addFormatToken('NNNNN', 0, 0, 'eraNarrow');
|
||
|
||
addFormatToken('y', ['y', 1], 'yo', 'eraYear');
|
||
addFormatToken('y', ['yy', 2], 0, 'eraYear');
|
||
addFormatToken('y', ['yyy', 3], 0, 'eraYear');
|
||
addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
|
||
|
||
addRegexToken('N', matchEraAbbr);
|
||
addRegexToken('NN', matchEraAbbr);
|
||
addRegexToken('NNN', matchEraAbbr);
|
||
addRegexToken('NNNN', matchEraName);
|
||
addRegexToken('NNNNN', matchEraNarrow);
|
||
|
||
addParseToken(
|
||
['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],
|
||
function (input, array, config, token) {
|
||
var era = config._locale.erasParse(input, token, config._strict);
|
||
if (era) {
|
||
getParsingFlags(config).era = era;
|
||
} else {
|
||
getParsingFlags(config).invalidEra = input;
|
||
}
|
||
}
|
||
);
|
||
|
||
addRegexToken('y', matchUnsigned);
|
||
addRegexToken('yy', matchUnsigned);
|
||
addRegexToken('yyy', matchUnsigned);
|
||
addRegexToken('yyyy', matchUnsigned);
|
||
addRegexToken('yo', matchEraYearOrdinal);
|
||
|
||
addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
|
||
addParseToken(['yo'], function (input, array, config, token) {
|
||
var match;
|
||
if (config._locale._eraYearOrdinalRegex) {
|
||
match = input.match(config._locale._eraYearOrdinalRegex);
|
||
}
|
||
|
||
if (config._locale.eraYearOrdinalParse) {
|
||
array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
|
||
} else {
|
||
array[YEAR] = parseInt(input, 10);
|
||
}
|
||
});
|
||
|
||
function localeEras(m, format) {
|
||
var i,
|
||
l,
|
||
date,
|
||
eras = this._eras || getLocale('en')._eras;
|
||
for (i = 0, l = eras.length; i < l; ++i) {
|
||
switch (typeof eras[i].since) {
|
||
case 'string':
|
||
// truncate time
|
||
date = hooks(eras[i].since).startOf('day');
|
||
eras[i].since = date.valueOf();
|
||
break;
|
||
}
|
||
|
||
switch (typeof eras[i].until) {
|
||
case 'undefined':
|
||
eras[i].until = +Infinity;
|
||
break;
|
||
case 'string':
|
||
// truncate time
|
||
date = hooks(eras[i].until).startOf('day').valueOf();
|
||
eras[i].until = date.valueOf();
|
||
break;
|
||
}
|
||
}
|
||
return eras;
|
||
}
|
||
|
||
function localeErasParse(eraName, format, strict) {
|
||
var i,
|
||
l,
|
||
eras = this.eras(),
|
||
name,
|
||
abbr,
|
||
narrow;
|
||
eraName = eraName.toUpperCase();
|
||
|
||
for (i = 0, l = eras.length; i < l; ++i) {
|
||
name = eras[i].name.toUpperCase();
|
||
abbr = eras[i].abbr.toUpperCase();
|
||
narrow = eras[i].narrow.toUpperCase();
|
||
|
||
if (strict) {
|
||
switch (format) {
|
||
case 'N':
|
||
case 'NN':
|
||
case 'NNN':
|
||
if (abbr === eraName) {
|
||
return eras[i];
|
||
}
|
||
break;
|
||
|
||
case 'NNNN':
|
||
if (name === eraName) {
|
||
return eras[i];
|
||
}
|
||
break;
|
||
|
||
case 'NNNNN':
|
||
if (narrow === eraName) {
|
||
return eras[i];
|
||
}
|
||
break;
|
||
}
|
||
} else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
|
||
return eras[i];
|
||
}
|
||
}
|
||
}
|
||
|
||
function localeErasConvertYear(era, year) {
|
||
var dir = era.since <= era.until ? +1 : -1;
|
||
if (year === undefined) {
|
||
return hooks(era.since).year();
|
||
} else {
|
||
return hooks(era.since).year() + (year - era.offset) * dir;
|
||
}
|
||
}
|
||
|
||
function getEraName() {
|
||
var i,
|
||
l,
|
||
val,
|
||
eras = this.localeData().eras();
|
||
for (i = 0, l = eras.length; i < l; ++i) {
|
||
// truncate time
|
||
val = this.clone().startOf('day').valueOf();
|
||
|
||
if (eras[i].since <= val && val <= eras[i].until) {
|
||
return eras[i].name;
|
||
}
|
||
if (eras[i].until <= val && val <= eras[i].since) {
|
||
return eras[i].name;
|
||
}
|
||
}
|
||
|
||
return '';
|
||
}
|
||
|
||
function getEraNarrow() {
|
||
var i,
|
||
l,
|
||
val,
|
||
eras = this.localeData().eras();
|
||
for (i = 0, l = eras.length; i < l; ++i) {
|
||
// truncate time
|
||
val = this.clone().startOf('day').valueOf();
|
||
|
||
if (eras[i].since <= val && val <= eras[i].until) {
|
||
return eras[i].narrow;
|
||
}
|
||
if (eras[i].until <= val && val <= eras[i].since) {
|
||
return eras[i].narrow;
|
||
}
|
||
}
|
||
|
||
return '';
|
||
}
|
||
|
||
function getEraAbbr() {
|
||
var i,
|
||
l,
|
||
val,
|
||
eras = this.localeData().eras();
|
||
for (i = 0, l = eras.length; i < l; ++i) {
|
||
// truncate time
|
||
val = this.clone().startOf('day').valueOf();
|
||
|
||
if (eras[i].since <= val && val <= eras[i].until) {
|
||
return eras[i].abbr;
|
||
}
|
||
if (eras[i].until <= val && val <= eras[i].since) {
|
||
return eras[i].abbr;
|
||
}
|
||
}
|
||
|
||
return '';
|
||
}
|
||
|
||
function getEraYear() {
|
||
var i,
|
||
l,
|
||
dir,
|
||
val,
|
||
eras = this.localeData().eras();
|
||
for (i = 0, l = eras.length; i < l; ++i) {
|
||
dir = eras[i].since <= eras[i].until ? +1 : -1;
|
||
|
||
// truncate time
|
||
val = this.clone().startOf('day').valueOf();
|
||
|
||
if (
|
||
(eras[i].since <= val && val <= eras[i].until) ||
|
||
(eras[i].until <= val && val <= eras[i].since)
|
||
) {
|
||
return (
|
||
(this.year() - hooks(eras[i].since).year()) * dir +
|
||
eras[i].offset
|
||
);
|
||
}
|
||
}
|
||
|
||
return this.year();
|
||
}
|
||
|
||
function erasNameRegex(isStrict) {
|
||
if (!hasOwnProp(this, '_erasNameRegex')) {
|
||
computeErasParse.call(this);
|
||
}
|
||
return isStrict ? this._erasNameRegex : this._erasRegex;
|
||
}
|
||
|
||
function erasAbbrRegex(isStrict) {
|
||
if (!hasOwnProp(this, '_erasAbbrRegex')) {
|
||
computeErasParse.call(this);
|
||
}
|
||
return isStrict ? this._erasAbbrRegex : this._erasRegex;
|
||
}
|
||
|
||
function erasNarrowRegex(isStrict) {
|
||
if (!hasOwnProp(this, '_erasNarrowRegex')) {
|
||
computeErasParse.call(this);
|
||
}
|
||
return isStrict ? this._erasNarrowRegex : this._erasRegex;
|
||
}
|
||
|
||
function matchEraAbbr(isStrict, locale) {
|
||
return locale.erasAbbrRegex(isStrict);
|
||
}
|
||
|
||
function matchEraName(isStrict, locale) {
|
||
return locale.erasNameRegex(isStrict);
|
||
}
|
||
|
||
function matchEraNarrow(isStrict, locale) {
|
||
return locale.erasNarrowRegex(isStrict);
|
||
}
|
||
|
||
function matchEraYearOrdinal(isStrict, locale) {
|
||
return locale._eraYearOrdinalRegex || matchUnsigned;
|
||
}
|
||
|
||
function computeErasParse() {
|
||
var abbrPieces = [],
|
||
namePieces = [],
|
||
narrowPieces = [],
|
||
mixedPieces = [],
|
||
i,
|
||
l,
|
||
erasName,
|
||
erasAbbr,
|
||
erasNarrow,
|
||
eras = this.eras();
|
||
|
||
for (i = 0, l = eras.length; i < l; ++i) {
|
||
erasName = regexEscape(eras[i].name);
|
||
erasAbbr = regexEscape(eras[i].abbr);
|
||
erasNarrow = regexEscape(eras[i].narrow);
|
||
|
||
namePieces.push(erasName);
|
||
abbrPieces.push(erasAbbr);
|
||
narrowPieces.push(erasNarrow);
|
||
mixedPieces.push(erasName);
|
||
mixedPieces.push(erasAbbr);
|
||
mixedPieces.push(erasNarrow);
|
||
}
|
||
|
||
this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
|
||
this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
|
||
this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
|
||
this._erasNarrowRegex = new RegExp(
|
||
'^(' + narrowPieces.join('|') + ')',
|
||
'i'
|
||
);
|
||
}
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken(0, ['gg', 2], 0, function () {
|
||
return this.weekYear() % 100;
|
||
});
|
||
|
||
addFormatToken(0, ['GG', 2], 0, function () {
|
||
return this.isoWeekYear() % 100;
|
||
});
|
||
|
||
function addWeekYearFormatToken(token, getter) {
|
||
addFormatToken(0, [token, token.length], 0, getter);
|
||
}
|
||
|
||
addWeekYearFormatToken('gggg', 'weekYear');
|
||
addWeekYearFormatToken('ggggg', 'weekYear');
|
||
addWeekYearFormatToken('GGGG', 'isoWeekYear');
|
||
addWeekYearFormatToken('GGGGG', 'isoWeekYear');
|
||
|
||
// ALIASES
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('G', matchSigned);
|
||
addRegexToken('g', matchSigned);
|
||
addRegexToken('GG', match1to2, match2);
|
||
addRegexToken('gg', match1to2, match2);
|
||
addRegexToken('GGGG', match1to4, match4);
|
||
addRegexToken('gggg', match1to4, match4);
|
||
addRegexToken('GGGGG', match1to6, match6);
|
||
addRegexToken('ggggg', match1to6, match6);
|
||
|
||
addWeekParseToken(
|
||
['gggg', 'ggggg', 'GGGG', 'GGGGG'],
|
||
function (input, week, config, token) {
|
||
week[token.substr(0, 2)] = toInt(input);
|
||
}
|
||
);
|
||
|
||
addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
|
||
week[token] = hooks.parseTwoDigitYear(input);
|
||
});
|
||
|
||
// MOMENTS
|
||
|
||
function getSetWeekYear(input) {
|
||
return getSetWeekYearHelper.call(
|
||
this,
|
||
input,
|
||
this.week(),
|
||
this.weekday() + this.localeData()._week.dow,
|
||
this.localeData()._week.dow,
|
||
this.localeData()._week.doy
|
||
);
|
||
}
|
||
|
||
function getSetISOWeekYear(input) {
|
||
return getSetWeekYearHelper.call(
|
||
this,
|
||
input,
|
||
this.isoWeek(),
|
||
this.isoWeekday(),
|
||
1,
|
||
4
|
||
);
|
||
}
|
||
|
||
function getISOWeeksInYear() {
|
||
return weeksInYear(this.year(), 1, 4);
|
||
}
|
||
|
||
function getISOWeeksInISOWeekYear() {
|
||
return weeksInYear(this.isoWeekYear(), 1, 4);
|
||
}
|
||
|
||
function getWeeksInYear() {
|
||
var weekInfo = this.localeData()._week;
|
||
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
|
||
}
|
||
|
||
function getWeeksInWeekYear() {
|
||
var weekInfo = this.localeData()._week;
|
||
return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
|
||
}
|
||
|
||
function getSetWeekYearHelper(input, week, weekday, dow, doy) {
|
||
var weeksTarget;
|
||
if (input == null) {
|
||
return weekOfYear(this, dow, doy).year;
|
||
} else {
|
||
weeksTarget = weeksInYear(input, dow, doy);
|
||
if (week > weeksTarget) {
|
||
week = weeksTarget;
|
||
}
|
||
return setWeekAll.call(this, input, week, weekday, dow, doy);
|
||
}
|
||
}
|
||
|
||
function setWeekAll(weekYear, week, weekday, dow, doy) {
|
||
var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
|
||
date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
|
||
|
||
this.year(date.getUTCFullYear());
|
||
this.month(date.getUTCMonth());
|
||
this.date(date.getUTCDate());
|
||
return this;
|
||
}
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('Q', 0, 'Qo', 'quarter');
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('Q', match1);
|
||
addParseToken('Q', function (input, array) {
|
||
array[MONTH] = (toInt(input) - 1) * 3;
|
||
});
|
||
|
||
// MOMENTS
|
||
|
||
function getSetQuarter(input) {
|
||
return input == null
|
||
? Math.ceil((this.month() + 1) / 3)
|
||
: this.month((input - 1) * 3 + (this.month() % 3));
|
||
}
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('D', ['DD', 2], 'Do', 'date');
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('D', match1to2, match1to2NoLeadingZero);
|
||
addRegexToken('DD', match1to2, match2);
|
||
addRegexToken('Do', function (isStrict, locale) {
|
||
// TODO: Remove "ordinalParse" fallback in next major release.
|
||
return isStrict
|
||
? locale._dayOfMonthOrdinalParse || locale._ordinalParse
|
||
: locale._dayOfMonthOrdinalParseLenient;
|
||
});
|
||
|
||
addParseToken(['D', 'DD'], DATE);
|
||
addParseToken('Do', function (input, array) {
|
||
array[DATE] = toInt(input.match(match1to2)[0]);
|
||
});
|
||
|
||
// MOMENTS
|
||
|
||
var getSetDayOfMonth = makeGetSet('Date', true);
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('DDD', match1to3);
|
||
addRegexToken('DDDD', match3);
|
||
addParseToken(['DDD', 'DDDD'], function (input, array, config) {
|
||
config._dayOfYear = toInt(input);
|
||
});
|
||
|
||
// HELPERS
|
||
|
||
// MOMENTS
|
||
|
||
function getSetDayOfYear(input) {
|
||
var dayOfYear =
|
||
Math.round(
|
||
(this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
|
||
) + 1;
|
||
return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
|
||
}
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('m', ['mm', 2], 0, 'minute');
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('m', match1to2, match1to2HasZero);
|
||
addRegexToken('mm', match1to2, match2);
|
||
addParseToken(['m', 'mm'], MINUTE);
|
||
|
||
// MOMENTS
|
||
|
||
var getSetMinute = makeGetSet('Minutes', false);
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('s', ['ss', 2], 0, 'second');
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('s', match1to2, match1to2HasZero);
|
||
addRegexToken('ss', match1to2, match2);
|
||
addParseToken(['s', 'ss'], SECOND);
|
||
|
||
// MOMENTS
|
||
|
||
var getSetSecond = makeGetSet('Seconds', false);
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('S', 0, 0, function () {
|
||
return ~~(this.millisecond() / 100);
|
||
});
|
||
|
||
addFormatToken(0, ['SS', 2], 0, function () {
|
||
return ~~(this.millisecond() / 10);
|
||
});
|
||
|
||
addFormatToken(0, ['SSS', 3], 0, 'millisecond');
|
||
addFormatToken(0, ['SSSS', 4], 0, function () {
|
||
return this.millisecond() * 10;
|
||
});
|
||
addFormatToken(0, ['SSSSS', 5], 0, function () {
|
||
return this.millisecond() * 100;
|
||
});
|
||
addFormatToken(0, ['SSSSSS', 6], 0, function () {
|
||
return this.millisecond() * 1000;
|
||
});
|
||
addFormatToken(0, ['SSSSSSS', 7], 0, function () {
|
||
return this.millisecond() * 10000;
|
||
});
|
||
addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
|
||
return this.millisecond() * 100000;
|
||
});
|
||
addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
|
||
return this.millisecond() * 1000000;
|
||
});
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('S', match1to3, match1);
|
||
addRegexToken('SS', match1to3, match2);
|
||
addRegexToken('SSS', match1to3, match3);
|
||
|
||
var token, getSetMillisecond;
|
||
for (token = 'SSSS'; token.length <= 9; token += 'S') {
|
||
addRegexToken(token, matchUnsigned);
|
||
}
|
||
|
||
function parseMs(input, array) {
|
||
array[MILLISECOND] = toInt(('0.' + input) * 1000);
|
||
}
|
||
|
||
for (token = 'S'; token.length <= 9; token += 'S') {
|
||
addParseToken(token, parseMs);
|
||
}
|
||
|
||
getSetMillisecond = makeGetSet('Milliseconds', false);
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('z', 0, 0, 'zoneAbbr');
|
||
addFormatToken('zz', 0, 0, 'zoneName');
|
||
|
||
// MOMENTS
|
||
|
||
function getZoneAbbr() {
|
||
return this._isUTC ? 'UTC' : '';
|
||
}
|
||
|
||
function getZoneName() {
|
||
return this._isUTC ? 'Coordinated Universal Time' : '';
|
||
}
|
||
|
||
var proto = Moment.prototype;
|
||
|
||
proto.add = add;
|
||
proto.calendar = calendar$1;
|
||
proto.clone = clone;
|
||
proto.diff = diff;
|
||
proto.endOf = endOf;
|
||
proto.format = format;
|
||
proto.from = from;
|
||
proto.fromNow = fromNow;
|
||
proto.to = to;
|
||
proto.toNow = toNow;
|
||
proto.get = stringGet;
|
||
proto.invalidAt = invalidAt;
|
||
proto.isAfter = isAfter;
|
||
proto.isBefore = isBefore;
|
||
proto.isBetween = isBetween;
|
||
proto.isSame = isSame;
|
||
proto.isSameOrAfter = isSameOrAfter;
|
||
proto.isSameOrBefore = isSameOrBefore;
|
||
proto.isValid = isValid$2;
|
||
proto.lang = lang;
|
||
proto.locale = locale;
|
||
proto.localeData = localeData;
|
||
proto.max = prototypeMax;
|
||
proto.min = prototypeMin;
|
||
proto.parsingFlags = parsingFlags;
|
||
proto.set = stringSet;
|
||
proto.startOf = startOf;
|
||
proto.subtract = subtract;
|
||
proto.toArray = toArray;
|
||
proto.toObject = toObject;
|
||
proto.toDate = toDate;
|
||
proto.toISOString = toISOString;
|
||
proto.inspect = inspect;
|
||
if (typeof Symbol !== 'undefined' && Symbol.for != null) {
|
||
proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
|
||
return 'Moment<' + this.format() + '>';
|
||
};
|
||
}
|
||
proto.toJSON = toJSON;
|
||
proto.toString = toString;
|
||
proto.unix = unix;
|
||
proto.valueOf = valueOf;
|
||
proto.creationData = creationData;
|
||
proto.eraName = getEraName;
|
||
proto.eraNarrow = getEraNarrow;
|
||
proto.eraAbbr = getEraAbbr;
|
||
proto.eraYear = getEraYear;
|
||
proto.year = getSetYear;
|
||
proto.isLeapYear = getIsLeapYear;
|
||
proto.weekYear = getSetWeekYear;
|
||
proto.isoWeekYear = getSetISOWeekYear;
|
||
proto.quarter = proto.quarters = getSetQuarter;
|
||
proto.month = getSetMonth;
|
||
proto.daysInMonth = getDaysInMonth;
|
||
proto.week = proto.weeks = getSetWeek;
|
||
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
|
||
proto.weeksInYear = getWeeksInYear;
|
||
proto.weeksInWeekYear = getWeeksInWeekYear;
|
||
proto.isoWeeksInYear = getISOWeeksInYear;
|
||
proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
|
||
proto.date = getSetDayOfMonth;
|
||
proto.day = proto.days = getSetDayOfWeek;
|
||
proto.weekday = getSetLocaleDayOfWeek;
|
||
proto.isoWeekday = getSetISODayOfWeek;
|
||
proto.dayOfYear = getSetDayOfYear;
|
||
proto.hour = proto.hours = getSetHour;
|
||
proto.minute = proto.minutes = getSetMinute;
|
||
proto.second = proto.seconds = getSetSecond;
|
||
proto.millisecond = proto.milliseconds = getSetMillisecond;
|
||
proto.utcOffset = getSetOffset;
|
||
proto.utc = setOffsetToUTC;
|
||
proto.local = setOffsetToLocal;
|
||
proto.parseZone = setOffsetToParsedOffset;
|
||
proto.hasAlignedHourOffset = hasAlignedHourOffset;
|
||
proto.isDST = isDaylightSavingTime;
|
||
proto.isLocal = isLocal;
|
||
proto.isUtcOffset = isUtcOffset;
|
||
proto.isUtc = isUtc;
|
||
proto.isUTC = isUtc;
|
||
proto.zoneAbbr = getZoneAbbr;
|
||
proto.zoneName = getZoneName;
|
||
proto.dates = deprecate(
|
||
'dates accessor is deprecated. Use date instead.',
|
||
getSetDayOfMonth
|
||
);
|
||
proto.months = deprecate(
|
||
'months accessor is deprecated. Use month instead',
|
||
getSetMonth
|
||
);
|
||
proto.years = deprecate(
|
||
'years accessor is deprecated. Use year instead',
|
||
getSetYear
|
||
);
|
||
proto.zone = deprecate(
|
||
'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
|
||
getSetZone
|
||
);
|
||
proto.isDSTShifted = deprecate(
|
||
'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
|
||
isDaylightSavingTimeShifted
|
||
);
|
||
|
||
function createUnix(input) {
|
||
return createLocal(input * 1000);
|
||
}
|
||
|
||
function createInZone() {
|
||
return createLocal.apply(null, arguments).parseZone();
|
||
}
|
||
|
||
function preParsePostFormat(string) {
|
||
return string;
|
||
}
|
||
|
||
var proto$1 = Locale.prototype;
|
||
|
||
proto$1.calendar = calendar;
|
||
proto$1.longDateFormat = longDateFormat;
|
||
proto$1.invalidDate = invalidDate;
|
||
proto$1.ordinal = ordinal;
|
||
proto$1.preparse = preParsePostFormat;
|
||
proto$1.postformat = preParsePostFormat;
|
||
proto$1.relativeTime = relativeTime;
|
||
proto$1.pastFuture = pastFuture;
|
||
proto$1.set = set;
|
||
proto$1.eras = localeEras;
|
||
proto$1.erasParse = localeErasParse;
|
||
proto$1.erasConvertYear = localeErasConvertYear;
|
||
proto$1.erasAbbrRegex = erasAbbrRegex;
|
||
proto$1.erasNameRegex = erasNameRegex;
|
||
proto$1.erasNarrowRegex = erasNarrowRegex;
|
||
|
||
proto$1.months = localeMonths;
|
||
proto$1.monthsShort = localeMonthsShort;
|
||
proto$1.monthsParse = localeMonthsParse;
|
||
proto$1.monthsRegex = monthsRegex;
|
||
proto$1.monthsShortRegex = monthsShortRegex;
|
||
proto$1.week = localeWeek;
|
||
proto$1.firstDayOfYear = localeFirstDayOfYear;
|
||
proto$1.firstDayOfWeek = localeFirstDayOfWeek;
|
||
|
||
proto$1.weekdays = localeWeekdays;
|
||
proto$1.weekdaysMin = localeWeekdaysMin;
|
||
proto$1.weekdaysShort = localeWeekdaysShort;
|
||
proto$1.weekdaysParse = localeWeekdaysParse;
|
||
|
||
proto$1.weekdaysRegex = weekdaysRegex;
|
||
proto$1.weekdaysShortRegex = weekdaysShortRegex;
|
||
proto$1.weekdaysMinRegex = weekdaysMinRegex;
|
||
|
||
proto$1.isPM = localeIsPM;
|
||
proto$1.meridiem = localeMeridiem;
|
||
|
||
function get$1(format, index, field, setter) {
|
||
var locale = getLocale(),
|
||
utc = createUTC().set(setter, index);
|
||
return locale[field](utc, format);
|
||
}
|
||
|
||
function listMonthsImpl(format, index, field) {
|
||
if (isNumber(format)) {
|
||
index = format;
|
||
format = undefined;
|
||
}
|
||
|
||
format = format || '';
|
||
|
||
if (index != null) {
|
||
return get$1(format, index, field, 'month');
|
||
}
|
||
|
||
var i,
|
||
out = [];
|
||
for (i = 0; i < 12; i++) {
|
||
out[i] = get$1(format, i, field, 'month');
|
||
}
|
||
return out;
|
||
}
|
||
|
||
// ()
|
||
// (5)
|
||
// (fmt, 5)
|
||
// (fmt)
|
||
// (true)
|
||
// (true, 5)
|
||
// (true, fmt, 5)
|
||
// (true, fmt)
|
||
function listWeekdaysImpl(localeSorted, format, index, field) {
|
||
if (typeof localeSorted === 'boolean') {
|
||
if (isNumber(format)) {
|
||
index = format;
|
||
format = undefined;
|
||
}
|
||
|
||
format = format || '';
|
||
} else {
|
||
format = localeSorted;
|
||
index = format;
|
||
localeSorted = false;
|
||
|
||
if (isNumber(format)) {
|
||
index = format;
|
||
format = undefined;
|
||
}
|
||
|
||
format = format || '';
|
||
}
|
||
|
||
var locale = getLocale(),
|
||
shift = localeSorted ? locale._week.dow : 0,
|
||
i,
|
||
out = [];
|
||
|
||
if (index != null) {
|
||
return get$1(format, (index + shift) % 7, field, 'day');
|
||
}
|
||
|
||
for (i = 0; i < 7; i++) {
|
||
out[i] = get$1(format, (i + shift) % 7, field, 'day');
|
||
}
|
||
return out;
|
||
}
|
||
|
||
function listMonths(format, index) {
|
||
return listMonthsImpl(format, index, 'months');
|
||
}
|
||
|
||
function listMonthsShort(format, index) {
|
||
return listMonthsImpl(format, index, 'monthsShort');
|
||
}
|
||
|
||
function listWeekdays(localeSorted, format, index) {
|
||
return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
|
||
}
|
||
|
||
function listWeekdaysShort(localeSorted, format, index) {
|
||
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
|
||
}
|
||
|
||
function listWeekdaysMin(localeSorted, format, index) {
|
||
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
|
||
}
|
||
|
||
getSetGlobalLocale('en', {
|
||
eras: [
|
||
{
|
||
since: '0001-01-01',
|
||
until: +Infinity,
|
||
offset: 1,
|
||
name: 'Anno Domini',
|
||
narrow: 'AD',
|
||
abbr: 'AD',
|
||
},
|
||
{
|
||
since: '0000-12-31',
|
||
until: -Infinity,
|
||
offset: 1,
|
||
name: 'Before Christ',
|
||
narrow: 'BC',
|
||
abbr: 'BC',
|
||
},
|
||
],
|
||
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
toInt((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
});
|
||
|
||
// Side effect imports
|
||
|
||
hooks.lang = deprecate(
|
||
'moment.lang is deprecated. Use moment.locale instead.',
|
||
getSetGlobalLocale
|
||
);
|
||
hooks.langData = deprecate(
|
||
'moment.langData is deprecated. Use moment.localeData instead.',
|
||
getLocale
|
||
);
|
||
|
||
var mathAbs = Math.abs;
|
||
|
||
function abs() {
|
||
var data = this._data;
|
||
|
||
this._milliseconds = mathAbs(this._milliseconds);
|
||
this._days = mathAbs(this._days);
|
||
this._months = mathAbs(this._months);
|
||
|
||
data.milliseconds = mathAbs(data.milliseconds);
|
||
data.seconds = mathAbs(data.seconds);
|
||
data.minutes = mathAbs(data.minutes);
|
||
data.hours = mathAbs(data.hours);
|
||
data.months = mathAbs(data.months);
|
||
data.years = mathAbs(data.years);
|
||
|
||
return this;
|
||
}
|
||
|
||
function addSubtract$1(duration, input, value, direction) {
|
||
var other = createDuration(input, value);
|
||
|
||
duration._milliseconds += direction * other._milliseconds;
|
||
duration._days += direction * other._days;
|
||
duration._months += direction * other._months;
|
||
|
||
return duration._bubble();
|
||
}
|
||
|
||
// supports only 2.0-style add(1, 's') or add(duration)
|
||
function add$1(input, value) {
|
||
return addSubtract$1(this, input, value, 1);
|
||
}
|
||
|
||
// supports only 2.0-style subtract(1, 's') or subtract(duration)
|
||
function subtract$1(input, value) {
|
||
return addSubtract$1(this, input, value, -1);
|
||
}
|
||
|
||
function absCeil(number) {
|
||
if (number < 0) {
|
||
return Math.floor(number);
|
||
} else {
|
||
return Math.ceil(number);
|
||
}
|
||
}
|
||
|
||
function bubble() {
|
||
var milliseconds = this._milliseconds,
|
||
days = this._days,
|
||
months = this._months,
|
||
data = this._data,
|
||
seconds,
|
||
minutes,
|
||
hours,
|
||
years,
|
||
monthsFromDays;
|
||
|
||
// if we have a mix of positive and negative values, bubble down first
|
||
// check: https://github.com/moment/moment/issues/2166
|
||
if (
|
||
!(
|
||
(milliseconds >= 0 && days >= 0 && months >= 0) ||
|
||
(milliseconds <= 0 && days <= 0 && months <= 0)
|
||
)
|
||
) {
|
||
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
|
||
days = 0;
|
||
months = 0;
|
||
}
|
||
|
||
// The following code bubbles up values, see the tests for
|
||
// examples of what that means.
|
||
data.milliseconds = milliseconds % 1000;
|
||
|
||
seconds = absFloor(milliseconds / 1000);
|
||
data.seconds = seconds % 60;
|
||
|
||
minutes = absFloor(seconds / 60);
|
||
data.minutes = minutes % 60;
|
||
|
||
hours = absFloor(minutes / 60);
|
||
data.hours = hours % 24;
|
||
|
||
days += absFloor(hours / 24);
|
||
|
||
// convert days to months
|
||
monthsFromDays = absFloor(daysToMonths(days));
|
||
months += monthsFromDays;
|
||
days -= absCeil(monthsToDays(monthsFromDays));
|
||
|
||
// 12 months -> 1 year
|
||
years = absFloor(months / 12);
|
||
months %= 12;
|
||
|
||
data.days = days;
|
||
data.months = months;
|
||
data.years = years;
|
||
|
||
return this;
|
||
}
|
||
|
||
function daysToMonths(days) {
|
||
// 400 years have 146097 days (taking into account leap year rules)
|
||
// 400 years have 12 months === 4800
|
||
return (days * 4800) / 146097;
|
||
}
|
||
|
||
function monthsToDays(months) {
|
||
// the reverse of daysToMonths
|
||
return (months * 146097) / 4800;
|
||
}
|
||
|
||
function as(units) {
|
||
if (!this.isValid()) {
|
||
return NaN;
|
||
}
|
||
var days,
|
||
months,
|
||
milliseconds = this._milliseconds;
|
||
|
||
units = normalizeUnits(units);
|
||
|
||
if (units === 'month' || units === 'quarter' || units === 'year') {
|
||
days = this._days + milliseconds / 864e5;
|
||
months = this._months + daysToMonths(days);
|
||
switch (units) {
|
||
case 'month':
|
||
return months;
|
||
case 'quarter':
|
||
return months / 3;
|
||
case 'year':
|
||
return months / 12;
|
||
}
|
||
} else {
|
||
// handle milliseconds separately because of floating point math errors (issue #1867)
|
||
days = this._days + Math.round(monthsToDays(this._months));
|
||
switch (units) {
|
||
case 'week':
|
||
return days / 7 + milliseconds / 6048e5;
|
||
case 'day':
|
||
return days + milliseconds / 864e5;
|
||
case 'hour':
|
||
return days * 24 + milliseconds / 36e5;
|
||
case 'minute':
|
||
return days * 1440 + milliseconds / 6e4;
|
||
case 'second':
|
||
return days * 86400 + milliseconds / 1000;
|
||
// Math.floor prevents floating point math errors here
|
||
case 'millisecond':
|
||
return Math.floor(days * 864e5) + milliseconds;
|
||
default:
|
||
throw new Error('Unknown unit ' + units);
|
||
}
|
||
}
|
||
}
|
||
|
||
function makeAs(alias) {
|
||
return function () {
|
||
return this.as(alias);
|
||
};
|
||
}
|
||
|
||
var asMilliseconds = makeAs('ms'),
|
||
asSeconds = makeAs('s'),
|
||
asMinutes = makeAs('m'),
|
||
asHours = makeAs('h'),
|
||
asDays = makeAs('d'),
|
||
asWeeks = makeAs('w'),
|
||
asMonths = makeAs('M'),
|
||
asQuarters = makeAs('Q'),
|
||
asYears = makeAs('y'),
|
||
valueOf$1 = asMilliseconds;
|
||
|
||
function clone$1() {
|
||
return createDuration(this);
|
||
}
|
||
|
||
function get$2(units) {
|
||
units = normalizeUnits(units);
|
||
return this.isValid() ? this[units + 's']() : NaN;
|
||
}
|
||
|
||
function makeGetter(name) {
|
||
return function () {
|
||
return this.isValid() ? this._data[name] : NaN;
|
||
};
|
||
}
|
||
|
||
var milliseconds = makeGetter('milliseconds'),
|
||
seconds = makeGetter('seconds'),
|
||
minutes = makeGetter('minutes'),
|
||
hours = makeGetter('hours'),
|
||
days = makeGetter('days'),
|
||
months = makeGetter('months'),
|
||
years = makeGetter('years');
|
||
|
||
function weeks() {
|
||
return absFloor(this.days() / 7);
|
||
}
|
||
|
||
var round = Math.round,
|
||
thresholds = {
|
||
ss: 44, // a few seconds to seconds
|
||
s: 45, // seconds to minute
|
||
m: 45, // minutes to hour
|
||
h: 22, // hours to day
|
||
d: 26, // days to month/week
|
||
w: null, // weeks to month
|
||
M: 11, // months to year
|
||
};
|
||
|
||
// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
|
||
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
|
||
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
|
||
}
|
||
|
||
function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
|
||
var duration = createDuration(posNegDuration).abs(),
|
||
seconds = round(duration.as('s')),
|
||
minutes = round(duration.as('m')),
|
||
hours = round(duration.as('h')),
|
||
days = round(duration.as('d')),
|
||
months = round(duration.as('M')),
|
||
weeks = round(duration.as('w')),
|
||
years = round(duration.as('y')),
|
||
a =
|
||
(seconds <= thresholds.ss && ['s', seconds]) ||
|
||
(seconds < thresholds.s && ['ss', seconds]) ||
|
||
(minutes <= 1 && ['m']) ||
|
||
(minutes < thresholds.m && ['mm', minutes]) ||
|
||
(hours <= 1 && ['h']) ||
|
||
(hours < thresholds.h && ['hh', hours]) ||
|
||
(days <= 1 && ['d']) ||
|
||
(days < thresholds.d && ['dd', days]);
|
||
|
||
if (thresholds.w != null) {
|
||
a =
|
||
a ||
|
||
(weeks <= 1 && ['w']) ||
|
||
(weeks < thresholds.w && ['ww', weeks]);
|
||
}
|
||
a = a ||
|
||
(months <= 1 && ['M']) ||
|
||
(months < thresholds.M && ['MM', months]) ||
|
||
(years <= 1 && ['y']) || ['yy', years];
|
||
|
||
a[2] = withoutSuffix;
|
||
a[3] = +posNegDuration > 0;
|
||
a[4] = locale;
|
||
return substituteTimeAgo.apply(null, a);
|
||
}
|
||
|
||
// This function allows you to set the rounding function for relative time strings
|
||
function getSetRelativeTimeRounding(roundingFunction) {
|
||
if (roundingFunction === undefined) {
|
||
return round;
|
||
}
|
||
if (typeof roundingFunction === 'function') {
|
||
round = roundingFunction;
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|
||
|
||
// This function allows you to set a threshold for relative time strings
|
||
function getSetRelativeTimeThreshold(threshold, limit) {
|
||
if (thresholds[threshold] === undefined) {
|
||
return false;
|
||
}
|
||
if (limit === undefined) {
|
||
return thresholds[threshold];
|
||
}
|
||
thresholds[threshold] = limit;
|
||
if (threshold === 's') {
|
||
thresholds.ss = limit - 1;
|
||
}
|
||
return true;
|
||
}
|
||
|
||
function humanize(argWithSuffix, argThresholds) {
|
||
if (!this.isValid()) {
|
||
return this.localeData().invalidDate();
|
||
}
|
||
|
||
var withSuffix = false,
|
||
th = thresholds,
|
||
locale,
|
||
output;
|
||
|
||
if (typeof argWithSuffix === 'object') {
|
||
argThresholds = argWithSuffix;
|
||
argWithSuffix = false;
|
||
}
|
||
if (typeof argWithSuffix === 'boolean') {
|
||
withSuffix = argWithSuffix;
|
||
}
|
||
if (typeof argThresholds === 'object') {
|
||
th = Object.assign({}, thresholds, argThresholds);
|
||
if (argThresholds.s != null && argThresholds.ss == null) {
|
||
th.ss = argThresholds.s - 1;
|
||
}
|
||
}
|
||
|
||
locale = this.localeData();
|
||
output = relativeTime$1(this, !withSuffix, th, locale);
|
||
|
||
if (withSuffix) {
|
||
output = locale.pastFuture(+this, output);
|
||
}
|
||
|
||
return locale.postformat(output);
|
||
}
|
||
|
||
var abs$1 = Math.abs;
|
||
|
||
function sign(x) {
|
||
return (x > 0) - (x < 0) || +x;
|
||
}
|
||
|
||
function toISOString$1() {
|
||
// for ISO strings we do not use the normal bubbling rules:
|
||
// * milliseconds bubble up until they become hours
|
||
// * days do not bubble at all
|
||
// * months bubble up until they become years
|
||
// This is because there is no context-free conversion between hours and days
|
||
// (think of clock changes)
|
||
// and also not between days and months (28-31 days per month)
|
||
if (!this.isValid()) {
|
||
return this.localeData().invalidDate();
|
||
}
|
||
|
||
var seconds = abs$1(this._milliseconds) / 1000,
|
||
days = abs$1(this._days),
|
||
months = abs$1(this._months),
|
||
minutes,
|
||
hours,
|
||
years,
|
||
s,
|
||
total = this.asSeconds(),
|
||
totalSign,
|
||
ymSign,
|
||
daysSign,
|
||
hmsSign;
|
||
|
||
if (!total) {
|
||
// this is the same as C#'s (Noda) and python (isodate)...
|
||
// but not other JS (goog.date)
|
||
return 'P0D';
|
||
}
|
||
|
||
// 3600 seconds -> 60 minutes -> 1 hour
|
||
minutes = absFloor(seconds / 60);
|
||
hours = absFloor(minutes / 60);
|
||
seconds %= 60;
|
||
minutes %= 60;
|
||
|
||
// 12 months -> 1 year
|
||
years = absFloor(months / 12);
|
||
months %= 12;
|
||
|
||
// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
|
||
s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
|
||
|
||
totalSign = total < 0 ? '-' : '';
|
||
ymSign = sign(this._months) !== sign(total) ? '-' : '';
|
||
daysSign = sign(this._days) !== sign(total) ? '-' : '';
|
||
hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
|
||
|
||
return (
|
||
totalSign +
|
||
'P' +
|
||
(years ? ymSign + years + 'Y' : '') +
|
||
(months ? ymSign + months + 'M' : '') +
|
||
(days ? daysSign + days + 'D' : '') +
|
||
(hours || minutes || seconds ? 'T' : '') +
|
||
(hours ? hmsSign + hours + 'H' : '') +
|
||
(minutes ? hmsSign + minutes + 'M' : '') +
|
||
(seconds ? hmsSign + s + 'S' : '')
|
||
);
|
||
}
|
||
|
||
var proto$2 = Duration.prototype;
|
||
|
||
proto$2.isValid = isValid$1;
|
||
proto$2.abs = abs;
|
||
proto$2.add = add$1;
|
||
proto$2.subtract = subtract$1;
|
||
proto$2.as = as;
|
||
proto$2.asMilliseconds = asMilliseconds;
|
||
proto$2.asSeconds = asSeconds;
|
||
proto$2.asMinutes = asMinutes;
|
||
proto$2.asHours = asHours;
|
||
proto$2.asDays = asDays;
|
||
proto$2.asWeeks = asWeeks;
|
||
proto$2.asMonths = asMonths;
|
||
proto$2.asQuarters = asQuarters;
|
||
proto$2.asYears = asYears;
|
||
proto$2.valueOf = valueOf$1;
|
||
proto$2._bubble = bubble;
|
||
proto$2.clone = clone$1;
|
||
proto$2.get = get$2;
|
||
proto$2.milliseconds = milliseconds;
|
||
proto$2.seconds = seconds;
|
||
proto$2.minutes = minutes;
|
||
proto$2.hours = hours;
|
||
proto$2.days = days;
|
||
proto$2.weeks = weeks;
|
||
proto$2.months = months;
|
||
proto$2.years = years;
|
||
proto$2.humanize = humanize;
|
||
proto$2.toISOString = toISOString$1;
|
||
proto$2.toString = toISOString$1;
|
||
proto$2.toJSON = toISOString$1;
|
||
proto$2.locale = locale;
|
||
proto$2.localeData = localeData;
|
||
|
||
proto$2.toIsoString = deprecate(
|
||
'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
|
||
toISOString$1
|
||
);
|
||
proto$2.lang = lang;
|
||
|
||
// FORMATTING
|
||
|
||
addFormatToken('X', 0, 0, 'unix');
|
||
addFormatToken('x', 0, 0, 'valueOf');
|
||
|
||
// PARSING
|
||
|
||
addRegexToken('x', matchSigned);
|
||
addRegexToken('X', matchTimestamp);
|
||
addParseToken('X', function (input, array, config) {
|
||
config._d = new Date(parseFloat(input) * 1000);
|
||
});
|
||
addParseToken('x', function (input, array, config) {
|
||
config._d = new Date(toInt(input));
|
||
});
|
||
|
||
//! moment.js
|
||
|
||
hooks.version = '2.30.1';
|
||
|
||
setHookCallback(createLocal);
|
||
|
||
hooks.fn = proto;
|
||
hooks.min = min;
|
||
hooks.max = max;
|
||
hooks.now = now;
|
||
hooks.utc = createUTC;
|
||
hooks.unix = createUnix;
|
||
hooks.months = listMonths;
|
||
hooks.isDate = isDate;
|
||
hooks.locale = getSetGlobalLocale;
|
||
hooks.invalid = createInvalid;
|
||
hooks.duration = createDuration;
|
||
hooks.isMoment = isMoment;
|
||
hooks.weekdays = listWeekdays;
|
||
hooks.parseZone = createInZone;
|
||
hooks.localeData = getLocale;
|
||
hooks.isDuration = isDuration;
|
||
hooks.monthsShort = listMonthsShort;
|
||
hooks.weekdaysMin = listWeekdaysMin;
|
||
hooks.defineLocale = defineLocale;
|
||
hooks.updateLocale = updateLocale;
|
||
hooks.locales = listLocales;
|
||
hooks.weekdaysShort = listWeekdaysShort;
|
||
hooks.normalizeUnits = normalizeUnits;
|
||
hooks.relativeTimeRounding = getSetRelativeTimeRounding;
|
||
hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
|
||
hooks.calendarFormat = getCalendarFormat;
|
||
hooks.prototype = proto;
|
||
|
||
// currently HTML5 input type only supports 24-hour formats
|
||
hooks.HTML5_FMT = {
|
||
DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
|
||
DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
|
||
DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
|
||
DATE: 'YYYY-MM-DD', // <input type="date" />
|
||
TIME: 'HH:mm', // <input type="time" />
|
||
TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
|
||
TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
|
||
WEEK: 'GGGG-[W]WW', // <input type="week" />
|
||
MONTH: 'YYYY-MM', // <input type="month" />
|
||
};
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('af', {
|
||
months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
|
||
weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
|
||
weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
|
||
meridiemParse: /vm|nm/i,
|
||
isPM: function (input) {
|
||
return /^nm$/i.test(input);
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours < 12) {
|
||
return isLower ? 'vm' : 'VM';
|
||
} else {
|
||
return isLower ? 'nm' : 'NM';
|
||
}
|
||
},
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Vandag om] LT',
|
||
nextDay: '[Môre om] LT',
|
||
nextWeek: 'dddd [om] LT',
|
||
lastDay: '[Gister om] LT',
|
||
lastWeek: '[Laas] dddd [om] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'oor %s',
|
||
past: '%s gelede',
|
||
s: "'n paar sekondes",
|
||
ss: '%d sekondes',
|
||
m: "'n minuut",
|
||
mm: '%d minute',
|
||
h: "'n uur",
|
||
hh: '%d ure',
|
||
d: "'n dag",
|
||
dd: '%d dae',
|
||
M: "'n maand",
|
||
MM: '%d maande',
|
||
y: "'n jaar",
|
||
yy: '%d jaar',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
|
||
ordinal: function (number) {
|
||
return (
|
||
number +
|
||
(number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
|
||
); // Thanks to Joris Röling : https://github.com/jjupiter
|
||
},
|
||
week: {
|
||
dow: 1, // Maandag is die eerste dag van die week.
|
||
doy: 4, // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var pluralForm = function (n) {
|
||
return n === 0
|
||
? 0
|
||
: n === 1
|
||
? 1
|
||
: n === 2
|
||
? 2
|
||
: n % 100 >= 3 && n % 100 <= 10
|
||
? 3
|
||
: n % 100 >= 11
|
||
? 4
|
||
: 5;
|
||
},
|
||
plurals = {
|
||
s: [
|
||
'أقل من ثانية',
|
||
'ثانية واحدة',
|
||
['ثانيتان', 'ثانيتين'],
|
||
'%d ثوان',
|
||
'%d ثانية',
|
||
'%d ثانية',
|
||
],
|
||
m: [
|
||
'أقل من دقيقة',
|
||
'دقيقة واحدة',
|
||
['دقيقتان', 'دقيقتين'],
|
||
'%d دقائق',
|
||
'%d دقيقة',
|
||
'%d دقيقة',
|
||
],
|
||
h: [
|
||
'أقل من ساعة',
|
||
'ساعة واحدة',
|
||
['ساعتان', 'ساعتين'],
|
||
'%d ساعات',
|
||
'%d ساعة',
|
||
'%d ساعة',
|
||
],
|
||
d: [
|
||
'أقل من يوم',
|
||
'يوم واحد',
|
||
['يومان', 'يومين'],
|
||
'%d أيام',
|
||
'%d يومًا',
|
||
'%d يوم',
|
||
],
|
||
M: [
|
||
'أقل من شهر',
|
||
'شهر واحد',
|
||
['شهران', 'شهرين'],
|
||
'%d أشهر',
|
||
'%d شهرا',
|
||
'%d شهر',
|
||
],
|
||
y: [
|
||
'أقل من عام',
|
||
'عام واحد',
|
||
['عامان', 'عامين'],
|
||
'%d أعوام',
|
||
'%d عامًا',
|
||
'%d عام',
|
||
],
|
||
},
|
||
pluralize = function (u) {
|
||
return function (number, withoutSuffix, string, isFuture) {
|
||
var f = pluralForm(number),
|
||
str = plurals[u][pluralForm(number)];
|
||
if (f === 2) {
|
||
str = str[withoutSuffix ? 0 : 1];
|
||
}
|
||
return str.replace(/%d/i, number);
|
||
};
|
||
},
|
||
months$1 = [
|
||
'جانفي',
|
||
'فيفري',
|
||
'مارس',
|
||
'أفريل',
|
||
'ماي',
|
||
'جوان',
|
||
'جويلية',
|
||
'أوت',
|
||
'سبتمبر',
|
||
'أكتوبر',
|
||
'نوفمبر',
|
||
'ديسمبر',
|
||
];
|
||
|
||
hooks.defineLocale('ar-dz', {
|
||
months: months$1,
|
||
monthsShort: months$1,
|
||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'D/\u200FM/\u200FYYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /ص|م/,
|
||
isPM: function (input) {
|
||
return 'م' === input;
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'ص';
|
||
} else {
|
||
return 'م';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[اليوم عند الساعة] LT',
|
||
nextDay: '[غدًا عند الساعة] LT',
|
||
nextWeek: 'dddd [عند الساعة] LT',
|
||
lastDay: '[أمس عند الساعة] LT',
|
||
lastWeek: 'dddd [عند الساعة] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'بعد %s',
|
||
past: 'منذ %s',
|
||
s: pluralize('s'),
|
||
ss: pluralize('s'),
|
||
m: pluralize('m'),
|
||
mm: pluralize('m'),
|
||
h: pluralize('h'),
|
||
hh: pluralize('h'),
|
||
d: pluralize('d'),
|
||
dd: pluralize('d'),
|
||
M: pluralize('M'),
|
||
MM: pluralize('M'),
|
||
y: pluralize('y'),
|
||
yy: pluralize('y'),
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/,/g, '،');
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ar-kw', {
|
||
months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||
weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
|
||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[اليوم على الساعة] LT',
|
||
nextDay: '[غدا على الساعة] LT',
|
||
nextWeek: 'dddd [على الساعة] LT',
|
||
lastDay: '[أمس على الساعة] LT',
|
||
lastWeek: 'dddd [على الساعة] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'في %s',
|
||
past: 'منذ %s',
|
||
s: 'ثوان',
|
||
ss: '%d ثانية',
|
||
m: 'دقيقة',
|
||
mm: '%d دقائق',
|
||
h: 'ساعة',
|
||
hh: '%d ساعات',
|
||
d: 'يوم',
|
||
dd: '%d أيام',
|
||
M: 'شهر',
|
||
MM: '%d أشهر',
|
||
y: 'سنة',
|
||
yy: '%d سنوات',
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 12, // The week that contains Jan 12th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap = {
|
||
1: '1',
|
||
2: '2',
|
||
3: '3',
|
||
4: '4',
|
||
5: '5',
|
||
6: '6',
|
||
7: '7',
|
||
8: '8',
|
||
9: '9',
|
||
0: '0',
|
||
},
|
||
pluralForm$1 = function (n) {
|
||
return n === 0
|
||
? 0
|
||
: n === 1
|
||
? 1
|
||
: n === 2
|
||
? 2
|
||
: n % 100 >= 3 && n % 100 <= 10
|
||
? 3
|
||
: n % 100 >= 11
|
||
? 4
|
||
: 5;
|
||
},
|
||
plurals$1 = {
|
||
s: [
|
||
'أقل من ثانية',
|
||
'ثانية واحدة',
|
||
['ثانيتان', 'ثانيتين'],
|
||
'%d ثوان',
|
||
'%d ثانية',
|
||
'%d ثانية',
|
||
],
|
||
m: [
|
||
'أقل من دقيقة',
|
||
'دقيقة واحدة',
|
||
['دقيقتان', 'دقيقتين'],
|
||
'%d دقائق',
|
||
'%d دقيقة',
|
||
'%d دقيقة',
|
||
],
|
||
h: [
|
||
'أقل من ساعة',
|
||
'ساعة واحدة',
|
||
['ساعتان', 'ساعتين'],
|
||
'%d ساعات',
|
||
'%d ساعة',
|
||
'%d ساعة',
|
||
],
|
||
d: [
|
||
'أقل من يوم',
|
||
'يوم واحد',
|
||
['يومان', 'يومين'],
|
||
'%d أيام',
|
||
'%d يومًا',
|
||
'%d يوم',
|
||
],
|
||
M: [
|
||
'أقل من شهر',
|
||
'شهر واحد',
|
||
['شهران', 'شهرين'],
|
||
'%d أشهر',
|
||
'%d شهرا',
|
||
'%d شهر',
|
||
],
|
||
y: [
|
||
'أقل من عام',
|
||
'عام واحد',
|
||
['عامان', 'عامين'],
|
||
'%d أعوام',
|
||
'%d عامًا',
|
||
'%d عام',
|
||
],
|
||
},
|
||
pluralize$1 = function (u) {
|
||
return function (number, withoutSuffix, string, isFuture) {
|
||
var f = pluralForm$1(number),
|
||
str = plurals$1[u][pluralForm$1(number)];
|
||
if (f === 2) {
|
||
str = str[withoutSuffix ? 0 : 1];
|
||
}
|
||
return str.replace(/%d/i, number);
|
||
};
|
||
},
|
||
months$2 = [
|
||
'يناير',
|
||
'فبراير',
|
||
'مارس',
|
||
'أبريل',
|
||
'مايو',
|
||
'يونيو',
|
||
'يوليو',
|
||
'أغسطس',
|
||
'سبتمبر',
|
||
'أكتوبر',
|
||
'نوفمبر',
|
||
'ديسمبر',
|
||
];
|
||
|
||
hooks.defineLocale('ar-ly', {
|
||
months: months$2,
|
||
monthsShort: months$2,
|
||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'D/\u200FM/\u200FYYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /ص|م/,
|
||
isPM: function (input) {
|
||
return 'م' === input;
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'ص';
|
||
} else {
|
||
return 'م';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[اليوم عند الساعة] LT',
|
||
nextDay: '[غدًا عند الساعة] LT',
|
||
nextWeek: 'dddd [عند الساعة] LT',
|
||
lastDay: '[أمس عند الساعة] LT',
|
||
lastWeek: 'dddd [عند الساعة] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'بعد %s',
|
||
past: 'منذ %s',
|
||
s: pluralize$1('s'),
|
||
ss: pluralize$1('s'),
|
||
m: pluralize$1('m'),
|
||
mm: pluralize$1('m'),
|
||
h: pluralize$1('h'),
|
||
hh: pluralize$1('h'),
|
||
d: pluralize$1('d'),
|
||
dd: pluralize$1('d'),
|
||
M: pluralize$1('M'),
|
||
MM: pluralize$1('M'),
|
||
y: pluralize$1('y'),
|
||
yy: pluralize$1('y'),
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/،/g, ',');
|
||
},
|
||
postformat: function (string) {
|
||
return string
|
||
.replace(/\d/g, function (match) {
|
||
return symbolMap[match];
|
||
})
|
||
.replace(/,/g, '،');
|
||
},
|
||
week: {
|
||
dow: 6, // Saturday is the first day of the week.
|
||
doy: 12, // The week that contains Jan 12th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ar-ma', {
|
||
months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||
weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
|
||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[اليوم على الساعة] LT',
|
||
nextDay: '[غدا على الساعة] LT',
|
||
nextWeek: 'dddd [على الساعة] LT',
|
||
lastDay: '[أمس على الساعة] LT',
|
||
lastWeek: 'dddd [على الساعة] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'في %s',
|
||
past: 'منذ %s',
|
||
s: 'ثوان',
|
||
ss: '%d ثانية',
|
||
m: 'دقيقة',
|
||
mm: '%d دقائق',
|
||
h: 'ساعة',
|
||
hh: '%d ساعات',
|
||
d: 'يوم',
|
||
dd: '%d أيام',
|
||
M: 'شهر',
|
||
MM: '%d أشهر',
|
||
y: 'سنة',
|
||
yy: '%d سنوات',
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$1 = {
|
||
1: '١',
|
||
2: '٢',
|
||
3: '٣',
|
||
4: '٤',
|
||
5: '٥',
|
||
6: '٦',
|
||
7: '٧',
|
||
8: '٨',
|
||
9: '٩',
|
||
0: '٠',
|
||
},
|
||
numberMap = {
|
||
'١': '1',
|
||
'٢': '2',
|
||
'٣': '3',
|
||
'٤': '4',
|
||
'٥': '5',
|
||
'٦': '6',
|
||
'٧': '7',
|
||
'٨': '8',
|
||
'٩': '9',
|
||
'٠': '0',
|
||
};
|
||
|
||
hooks.defineLocale('ar-ps', {
|
||
months: 'كانون الثاني_شباط_آذار_نيسان_أيّار_حزيران_تمّوز_آب_أيلول_تشري الأوّل_تشرين الثاني_كانون الأوّل'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ك٢_شباط_آذار_نيسان_أيّار_حزيران_تمّوز_آب_أيلول_ت١_ت٢_ك١'.split('_'),
|
||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /ص|م/,
|
||
isPM: function (input) {
|
||
return 'م' === input;
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'ص';
|
||
} else {
|
||
return 'م';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[اليوم على الساعة] LT',
|
||
nextDay: '[غدا على الساعة] LT',
|
||
nextWeek: 'dddd [على الساعة] LT',
|
||
lastDay: '[أمس على الساعة] LT',
|
||
lastWeek: 'dddd [على الساعة] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'في %s',
|
||
past: 'منذ %s',
|
||
s: 'ثوان',
|
||
ss: '%d ثانية',
|
||
m: 'دقيقة',
|
||
mm: '%d دقائق',
|
||
h: 'ساعة',
|
||
hh: '%d ساعات',
|
||
d: 'يوم',
|
||
dd: '%d أيام',
|
||
M: 'شهر',
|
||
MM: '%d أشهر',
|
||
y: 'سنة',
|
||
yy: '%d سنوات',
|
||
},
|
||
preparse: function (string) {
|
||
return string
|
||
.replace(/[٣٤٥٦٧٨٩٠]/g, function (match) {
|
||
return numberMap[match];
|
||
})
|
||
.split('') // reversed since negative lookbehind not supported everywhere
|
||
.reverse()
|
||
.join('')
|
||
.replace(/[١٢](?![\u062a\u0643])/g, function (match) {
|
||
return numberMap[match];
|
||
})
|
||
.split('')
|
||
.reverse()
|
||
.join('')
|
||
.replace(/،/g, ',');
|
||
},
|
||
postformat: function (string) {
|
||
return string
|
||
.replace(/\d/g, function (match) {
|
||
return symbolMap$1[match];
|
||
})
|
||
.replace(/,/g, '،');
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$2 = {
|
||
1: '١',
|
||
2: '٢',
|
||
3: '٣',
|
||
4: '٤',
|
||
5: '٥',
|
||
6: '٦',
|
||
7: '٧',
|
||
8: '٨',
|
||
9: '٩',
|
||
0: '٠',
|
||
},
|
||
numberMap$1 = {
|
||
'١': '1',
|
||
'٢': '2',
|
||
'٣': '3',
|
||
'٤': '4',
|
||
'٥': '5',
|
||
'٦': '6',
|
||
'٧': '7',
|
||
'٨': '8',
|
||
'٩': '9',
|
||
'٠': '0',
|
||
};
|
||
|
||
hooks.defineLocale('ar-sa', {
|
||
months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /ص|م/,
|
||
isPM: function (input) {
|
||
return 'م' === input;
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'ص';
|
||
} else {
|
||
return 'م';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[اليوم على الساعة] LT',
|
||
nextDay: '[غدا على الساعة] LT',
|
||
nextWeek: 'dddd [على الساعة] LT',
|
||
lastDay: '[أمس على الساعة] LT',
|
||
lastWeek: 'dddd [على الساعة] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'في %s',
|
||
past: 'منذ %s',
|
||
s: 'ثوان',
|
||
ss: '%d ثانية',
|
||
m: 'دقيقة',
|
||
mm: '%d دقائق',
|
||
h: 'ساعة',
|
||
hh: '%d ساعات',
|
||
d: 'يوم',
|
||
dd: '%d أيام',
|
||
M: 'شهر',
|
||
MM: '%d أشهر',
|
||
y: 'سنة',
|
||
yy: '%d سنوات',
|
||
},
|
||
preparse: function (string) {
|
||
return string
|
||
.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
|
||
return numberMap$1[match];
|
||
})
|
||
.replace(/،/g, ',');
|
||
},
|
||
postformat: function (string) {
|
||
return string
|
||
.replace(/\d/g, function (match) {
|
||
return symbolMap$2[match];
|
||
})
|
||
.replace(/,/g, '،');
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ar-tn', {
|
||
months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[اليوم على الساعة] LT',
|
||
nextDay: '[غدا على الساعة] LT',
|
||
nextWeek: 'dddd [على الساعة] LT',
|
||
lastDay: '[أمس على الساعة] LT',
|
||
lastWeek: 'dddd [على الساعة] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'في %s',
|
||
past: 'منذ %s',
|
||
s: 'ثوان',
|
||
ss: '%d ثانية',
|
||
m: 'دقيقة',
|
||
mm: '%d دقائق',
|
||
h: 'ساعة',
|
||
hh: '%d ساعات',
|
||
d: 'يوم',
|
||
dd: '%d أيام',
|
||
M: 'شهر',
|
||
MM: '%d أشهر',
|
||
y: 'سنة',
|
||
yy: '%d سنوات',
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$3 = {
|
||
1: '١',
|
||
2: '٢',
|
||
3: '٣',
|
||
4: '٤',
|
||
5: '٥',
|
||
6: '٦',
|
||
7: '٧',
|
||
8: '٨',
|
||
9: '٩',
|
||
0: '٠',
|
||
},
|
||
numberMap$2 = {
|
||
'١': '1',
|
||
'٢': '2',
|
||
'٣': '3',
|
||
'٤': '4',
|
||
'٥': '5',
|
||
'٦': '6',
|
||
'٧': '7',
|
||
'٨': '8',
|
||
'٩': '9',
|
||
'٠': '0',
|
||
},
|
||
pluralForm$2 = function (n) {
|
||
return n === 0
|
||
? 0
|
||
: n === 1
|
||
? 1
|
||
: n === 2
|
||
? 2
|
||
: n % 100 >= 3 && n % 100 <= 10
|
||
? 3
|
||
: n % 100 >= 11
|
||
? 4
|
||
: 5;
|
||
},
|
||
plurals$2 = {
|
||
s: [
|
||
'أقل من ثانية',
|
||
'ثانية واحدة',
|
||
['ثانيتان', 'ثانيتين'],
|
||
'%d ثوان',
|
||
'%d ثانية',
|
||
'%d ثانية',
|
||
],
|
||
m: [
|
||
'أقل من دقيقة',
|
||
'دقيقة واحدة',
|
||
['دقيقتان', 'دقيقتين'],
|
||
'%d دقائق',
|
||
'%d دقيقة',
|
||
'%d دقيقة',
|
||
],
|
||
h: [
|
||
'أقل من ساعة',
|
||
'ساعة واحدة',
|
||
['ساعتان', 'ساعتين'],
|
||
'%d ساعات',
|
||
'%d ساعة',
|
||
'%d ساعة',
|
||
],
|
||
d: [
|
||
'أقل من يوم',
|
||
'يوم واحد',
|
||
['يومان', 'يومين'],
|
||
'%d أيام',
|
||
'%d يومًا',
|
||
'%d يوم',
|
||
],
|
||
M: [
|
||
'أقل من شهر',
|
||
'شهر واحد',
|
||
['شهران', 'شهرين'],
|
||
'%d أشهر',
|
||
'%d شهرا',
|
||
'%d شهر',
|
||
],
|
||
y: [
|
||
'أقل من عام',
|
||
'عام واحد',
|
||
['عامان', 'عامين'],
|
||
'%d أعوام',
|
||
'%d عامًا',
|
||
'%d عام',
|
||
],
|
||
},
|
||
pluralize$2 = function (u) {
|
||
return function (number, withoutSuffix, string, isFuture) {
|
||
var f = pluralForm$2(number),
|
||
str = plurals$2[u][pluralForm$2(number)];
|
||
if (f === 2) {
|
||
str = str[withoutSuffix ? 0 : 1];
|
||
}
|
||
return str.replace(/%d/i, number);
|
||
};
|
||
},
|
||
months$3 = [
|
||
'يناير',
|
||
'فبراير',
|
||
'مارس',
|
||
'أبريل',
|
||
'مايو',
|
||
'يونيو',
|
||
'يوليو',
|
||
'أغسطس',
|
||
'سبتمبر',
|
||
'أكتوبر',
|
||
'نوفمبر',
|
||
'ديسمبر',
|
||
];
|
||
|
||
hooks.defineLocale('ar', {
|
||
months: months$3,
|
||
monthsShort: months$3,
|
||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'D/\u200FM/\u200FYYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /ص|م/,
|
||
isPM: function (input) {
|
||
return 'م' === input;
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'ص';
|
||
} else {
|
||
return 'م';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[اليوم عند الساعة] LT',
|
||
nextDay: '[غدًا عند الساعة] LT',
|
||
nextWeek: 'dddd [عند الساعة] LT',
|
||
lastDay: '[أمس عند الساعة] LT',
|
||
lastWeek: 'dddd [عند الساعة] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'بعد %s',
|
||
past: 'منذ %s',
|
||
s: pluralize$2('s'),
|
||
ss: pluralize$2('s'),
|
||
m: pluralize$2('m'),
|
||
mm: pluralize$2('m'),
|
||
h: pluralize$2('h'),
|
||
hh: pluralize$2('h'),
|
||
d: pluralize$2('d'),
|
||
dd: pluralize$2('d'),
|
||
M: pluralize$2('M'),
|
||
MM: pluralize$2('M'),
|
||
y: pluralize$2('y'),
|
||
yy: pluralize$2('y'),
|
||
},
|
||
preparse: function (string) {
|
||
return string
|
||
.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
|
||
return numberMap$2[match];
|
||
})
|
||
.replace(/،/g, ',');
|
||
},
|
||
postformat: function (string) {
|
||
return string
|
||
.replace(/\d/g, function (match) {
|
||
return symbolMap$3[match];
|
||
})
|
||
.replace(/,/g, '،');
|
||
},
|
||
week: {
|
||
dow: 6, // Saturday is the first day of the week.
|
||
doy: 12, // The week that contains Jan 12th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var suffixes = {
|
||
1: '-inci',
|
||
5: '-inci',
|
||
8: '-inci',
|
||
70: '-inci',
|
||
80: '-inci',
|
||
2: '-nci',
|
||
7: '-nci',
|
||
20: '-nci',
|
||
50: '-nci',
|
||
3: '-üncü',
|
||
4: '-üncü',
|
||
100: '-üncü',
|
||
6: '-ncı',
|
||
9: '-uncu',
|
||
10: '-uncu',
|
||
30: '-uncu',
|
||
60: '-ıncı',
|
||
90: '-ıncı',
|
||
};
|
||
|
||
hooks.defineLocale('az', {
|
||
months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
|
||
weekdays:
|
||
'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
|
||
weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[bugün saat] LT',
|
||
nextDay: '[sabah saat] LT',
|
||
nextWeek: '[gələn həftə] dddd [saat] LT',
|
||
lastDay: '[dünən] LT',
|
||
lastWeek: '[keçən həftə] dddd [saat] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s sonra',
|
||
past: '%s əvvəl',
|
||
s: 'bir neçə saniyə',
|
||
ss: '%d saniyə',
|
||
m: 'bir dəqiqə',
|
||
mm: '%d dəqiqə',
|
||
h: 'bir saat',
|
||
hh: '%d saat',
|
||
d: 'bir gün',
|
||
dd: '%d gün',
|
||
M: 'bir ay',
|
||
MM: '%d ay',
|
||
y: 'bir il',
|
||
yy: '%d il',
|
||
},
|
||
meridiemParse: /gecə|səhər|gündüz|axşam/,
|
||
isPM: function (input) {
|
||
return /^(gündüz|axşam)$/.test(input);
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'gecə';
|
||
} else if (hour < 12) {
|
||
return 'səhər';
|
||
} else if (hour < 17) {
|
||
return 'gündüz';
|
||
} else {
|
||
return 'axşam';
|
||
}
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
|
||
ordinal: function (number) {
|
||
if (number === 0) {
|
||
// special case for zero
|
||
return number + '-ıncı';
|
||
}
|
||
var a = number % 10,
|
||
b = (number % 100) - a,
|
||
c = number >= 100 ? 100 : null;
|
||
return number + (suffixes[a] || suffixes[b] || suffixes[c]);
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function plural(word, num) {
|
||
var forms = word.split('_');
|
||
return num % 10 === 1 && num % 100 !== 11
|
||
? forms[0]
|
||
: num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
|
||
? forms[1]
|
||
: forms[2];
|
||
}
|
||
function relativeTimeWithPlural(number, withoutSuffix, key) {
|
||
var format = {
|
||
ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
|
||
mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
|
||
hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
|
||
dd: 'дзень_дні_дзён',
|
||
MM: 'месяц_месяцы_месяцаў',
|
||
yy: 'год_гады_гадоў',
|
||
};
|
||
if (key === 'm') {
|
||
return withoutSuffix ? 'хвіліна' : 'хвіліну';
|
||
} else if (key === 'h') {
|
||
return withoutSuffix ? 'гадзіна' : 'гадзіну';
|
||
} else {
|
||
return number + ' ' + plural(format[key], +number);
|
||
}
|
||
}
|
||
|
||
hooks.defineLocale('be', {
|
||
months: {
|
||
format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split(
|
||
'_'
|
||
),
|
||
},
|
||
monthsShort:
|
||
'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
|
||
weekdays: {
|
||
format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split(
|
||
'_'
|
||
),
|
||
isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/,
|
||
},
|
||
weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
|
||
weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY г.',
|
||
LLL: 'D MMMM YYYY г., HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY г., HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Сёння ў] LT',
|
||
nextDay: '[Заўтра ў] LT',
|
||
lastDay: '[Учора ў] LT',
|
||
nextWeek: function () {
|
||
return '[У] dddd [ў] LT';
|
||
},
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
case 3:
|
||
case 5:
|
||
case 6:
|
||
return '[У мінулую] dddd [ў] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
return '[У мінулы] dddd [ў] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'праз %s',
|
||
past: '%s таму',
|
||
s: 'некалькі секунд',
|
||
m: relativeTimeWithPlural,
|
||
mm: relativeTimeWithPlural,
|
||
h: relativeTimeWithPlural,
|
||
hh: relativeTimeWithPlural,
|
||
d: 'дзень',
|
||
dd: relativeTimeWithPlural,
|
||
M: 'месяц',
|
||
MM: relativeTimeWithPlural,
|
||
y: 'год',
|
||
yy: relativeTimeWithPlural,
|
||
},
|
||
meridiemParse: /ночы|раніцы|дня|вечара/,
|
||
isPM: function (input) {
|
||
return /^(дня|вечара)$/.test(input);
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'ночы';
|
||
} else if (hour < 12) {
|
||
return 'раніцы';
|
||
} else if (hour < 17) {
|
||
return 'дня';
|
||
} else {
|
||
return 'вечара';
|
||
}
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'M':
|
||
case 'd':
|
||
case 'DDD':
|
||
case 'w':
|
||
case 'W':
|
||
return (number % 10 === 2 || number % 10 === 3) &&
|
||
number % 100 !== 12 &&
|
||
number % 100 !== 13
|
||
? number + '-і'
|
||
: number + '-ы';
|
||
case 'D':
|
||
return number + '-га';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('bg', {
|
||
months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
|
||
weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
|
||
weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'D.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY H:mm',
|
||
LLLL: 'dddd, D MMMM YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Днес в] LT',
|
||
nextDay: '[Утре в] LT',
|
||
nextWeek: 'dddd [в] LT',
|
||
lastDay: '[Вчера в] LT',
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
case 3:
|
||
case 6:
|
||
return '[Миналата] dddd [в] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[Миналия] dddd [в] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'след %s',
|
||
past: 'преди %s',
|
||
s: 'няколко секунди',
|
||
ss: '%d секунди',
|
||
m: 'минута',
|
||
mm: '%d минути',
|
||
h: 'час',
|
||
hh: '%d часа',
|
||
d: 'ден',
|
||
dd: '%d дена',
|
||
w: 'седмица',
|
||
ww: '%d седмици',
|
||
M: 'месец',
|
||
MM: '%d месеца',
|
||
y: 'година',
|
||
yy: '%d години',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
|
||
ordinal: function (number) {
|
||
var lastDigit = number % 10,
|
||
last2Digits = number % 100;
|
||
if (number === 0) {
|
||
return number + '-ев';
|
||
} else if (last2Digits === 0) {
|
||
return number + '-ен';
|
||
} else if (last2Digits > 10 && last2Digits < 20) {
|
||
return number + '-ти';
|
||
} else if (lastDigit === 1) {
|
||
return number + '-ви';
|
||
} else if (lastDigit === 2) {
|
||
return number + '-ри';
|
||
} else if (lastDigit === 7 || lastDigit === 8) {
|
||
return number + '-ми';
|
||
} else {
|
||
return number + '-ти';
|
||
}
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('bm', {
|
||
months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
|
||
weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
|
||
weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
|
||
weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'MMMM [tile] D [san] YYYY',
|
||
LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
|
||
LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Bi lɛrɛ] LT',
|
||
nextDay: '[Sini lɛrɛ] LT',
|
||
nextWeek: 'dddd [don lɛrɛ] LT',
|
||
lastDay: '[Kunu lɛrɛ] LT',
|
||
lastWeek: 'dddd [tɛmɛnen lɛrɛ] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s kɔnɔ',
|
||
past: 'a bɛ %s bɔ',
|
||
s: 'sanga dama dama',
|
||
ss: 'sekondi %d',
|
||
m: 'miniti kelen',
|
||
mm: 'miniti %d',
|
||
h: 'lɛrɛ kelen',
|
||
hh: 'lɛrɛ %d',
|
||
d: 'tile kelen',
|
||
dd: 'tile %d',
|
||
M: 'kalo kelen',
|
||
MM: 'kalo %d',
|
||
y: 'san kelen',
|
||
yy: 'san %d',
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$4 = {
|
||
1: '১',
|
||
2: '২',
|
||
3: '৩',
|
||
4: '৪',
|
||
5: '৫',
|
||
6: '৬',
|
||
7: '৭',
|
||
8: '৮',
|
||
9: '৯',
|
||
0: '০',
|
||
},
|
||
numberMap$3 = {
|
||
'১': '1',
|
||
'২': '2',
|
||
'৩': '3',
|
||
'৪': '4',
|
||
'৫': '5',
|
||
'৬': '6',
|
||
'৭': '7',
|
||
'৮': '8',
|
||
'৯': '9',
|
||
'০': '0',
|
||
};
|
||
|
||
hooks.defineLocale('bn-bd', {
|
||
months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
|
||
weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm সময়',
|
||
LTS: 'A h:mm:ss সময়',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, A h:mm সময়',
|
||
LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',
|
||
},
|
||
calendar: {
|
||
sameDay: '[আজ] LT',
|
||
nextDay: '[আগামীকাল] LT',
|
||
nextWeek: 'dddd, LT',
|
||
lastDay: '[গতকাল] LT',
|
||
lastWeek: '[গত] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s পরে',
|
||
past: '%s আগে',
|
||
s: 'কয়েক সেকেন্ড',
|
||
ss: '%d সেকেন্ড',
|
||
m: 'এক মিনিট',
|
||
mm: '%d মিনিট',
|
||
h: 'এক ঘন্টা',
|
||
hh: '%d ঘন্টা',
|
||
d: 'এক দিন',
|
||
dd: '%d দিন',
|
||
M: 'এক মাস',
|
||
MM: '%d মাস',
|
||
y: 'এক বছর',
|
||
yy: '%d বছর',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
|
||
return numberMap$3[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$4[match];
|
||
});
|
||
},
|
||
|
||
meridiemParse: /রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'রাত') {
|
||
return hour < 4 ? hour : hour + 12;
|
||
} else if (meridiem === 'ভোর') {
|
||
return hour;
|
||
} else if (meridiem === 'সকাল') {
|
||
return hour;
|
||
} else if (meridiem === 'দুপুর') {
|
||
return hour >= 3 ? hour : hour + 12;
|
||
} else if (meridiem === 'বিকাল') {
|
||
return hour + 12;
|
||
} else if (meridiem === 'সন্ধ্যা') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'রাত';
|
||
} else if (hour < 6) {
|
||
return 'ভোর';
|
||
} else if (hour < 12) {
|
||
return 'সকাল';
|
||
} else if (hour < 15) {
|
||
return 'দুপুর';
|
||
} else if (hour < 18) {
|
||
return 'বিকাল';
|
||
} else if (hour < 20) {
|
||
return 'সন্ধ্যা';
|
||
} else {
|
||
return 'রাত';
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$5 = {
|
||
1: '১',
|
||
2: '২',
|
||
3: '৩',
|
||
4: '৪',
|
||
5: '৫',
|
||
6: '৬',
|
||
7: '৭',
|
||
8: '৮',
|
||
9: '৯',
|
||
0: '০',
|
||
},
|
||
numberMap$4 = {
|
||
'১': '1',
|
||
'২': '2',
|
||
'৩': '3',
|
||
'৪': '4',
|
||
'৫': '5',
|
||
'৬': '6',
|
||
'৭': '7',
|
||
'৮': '8',
|
||
'৯': '9',
|
||
'০': '0',
|
||
};
|
||
|
||
hooks.defineLocale('bn', {
|
||
months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
|
||
weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm সময়',
|
||
LTS: 'A h:mm:ss সময়',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, A h:mm সময়',
|
||
LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',
|
||
},
|
||
calendar: {
|
||
sameDay: '[আজ] LT',
|
||
nextDay: '[আগামীকাল] LT',
|
||
nextWeek: 'dddd, LT',
|
||
lastDay: '[গতকাল] LT',
|
||
lastWeek: '[গত] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s পরে',
|
||
past: '%s আগে',
|
||
s: 'কয়েক সেকেন্ড',
|
||
ss: '%d সেকেন্ড',
|
||
m: 'এক মিনিট',
|
||
mm: '%d মিনিট',
|
||
h: 'এক ঘন্টা',
|
||
hh: '%d ঘন্টা',
|
||
d: 'এক দিন',
|
||
dd: '%d দিন',
|
||
M: 'এক মাস',
|
||
MM: '%d মাস',
|
||
y: 'এক বছর',
|
||
yy: '%d বছর',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
|
||
return numberMap$4[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$5[match];
|
||
});
|
||
},
|
||
meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (
|
||
(meridiem === 'রাত' && hour >= 4) ||
|
||
(meridiem === 'দুপুর' && hour < 5) ||
|
||
meridiem === 'বিকাল'
|
||
) {
|
||
return hour + 12;
|
||
} else {
|
||
return hour;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'রাত';
|
||
} else if (hour < 10) {
|
||
return 'সকাল';
|
||
} else if (hour < 17) {
|
||
return 'দুপুর';
|
||
} else if (hour < 20) {
|
||
return 'বিকাল';
|
||
} else {
|
||
return 'রাত';
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$6 = {
|
||
1: '༡',
|
||
2: '༢',
|
||
3: '༣',
|
||
4: '༤',
|
||
5: '༥',
|
||
6: '༦',
|
||
7: '༧',
|
||
8: '༨',
|
||
9: '༩',
|
||
0: '༠',
|
||
},
|
||
numberMap$5 = {
|
||
'༡': '1',
|
||
'༢': '2',
|
||
'༣': '3',
|
||
'༤': '4',
|
||
'༥': '5',
|
||
'༦': '6',
|
||
'༧': '7',
|
||
'༨': '8',
|
||
'༩': '9',
|
||
'༠': '0',
|
||
};
|
||
|
||
hooks.defineLocale('bo', {
|
||
months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split(
|
||
'_'
|
||
),
|
||
monthsShortRegex: /^(ཟླ་\d{1,2})/,
|
||
monthsParseExact: true,
|
||
weekdays:
|
||
'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split(
|
||
'_'
|
||
),
|
||
weekdaysMin: 'ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm',
|
||
LTS: 'A h:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, A h:mm',
|
||
LLLL: 'dddd, D MMMM YYYY, A h:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[དི་རིང] LT',
|
||
nextDay: '[སང་ཉིན] LT',
|
||
nextWeek: '[བདུན་ཕྲག་རྗེས་མ], LT',
|
||
lastDay: '[ཁ་སང] LT',
|
||
lastWeek: '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s ལ་',
|
||
past: '%s སྔན་ལ',
|
||
s: 'ལམ་སང',
|
||
ss: '%d སྐར་ཆ།',
|
||
m: 'སྐར་མ་གཅིག',
|
||
mm: '%d སྐར་མ',
|
||
h: 'ཆུ་ཚོད་གཅིག',
|
||
hh: '%d ཆུ་ཚོད',
|
||
d: 'ཉིན་གཅིག',
|
||
dd: '%d ཉིན་',
|
||
M: 'ཟླ་བ་གཅིག',
|
||
MM: '%d ཟླ་བ',
|
||
y: 'ལོ་གཅིག',
|
||
yy: '%d ལོ',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
|
||
return numberMap$5[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$6[match];
|
||
});
|
||
},
|
||
meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (
|
||
(meridiem === 'མཚན་མོ' && hour >= 4) ||
|
||
(meridiem === 'ཉིན་གུང' && hour < 5) ||
|
||
meridiem === 'དགོང་དག'
|
||
) {
|
||
return hour + 12;
|
||
} else {
|
||
return hour;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'མཚན་མོ';
|
||
} else if (hour < 10) {
|
||
return 'ཞོགས་ཀས';
|
||
} else if (hour < 17) {
|
||
return 'ཉིན་གུང';
|
||
} else if (hour < 20) {
|
||
return 'དགོང་དག';
|
||
} else {
|
||
return 'མཚན་མོ';
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function relativeTimeWithMutation(number, withoutSuffix, key) {
|
||
var format = {
|
||
mm: 'munutenn',
|
||
MM: 'miz',
|
||
dd: 'devezh',
|
||
};
|
||
return number + ' ' + mutation(format[key], number);
|
||
}
|
||
function specialMutationForYears(number) {
|
||
switch (lastNumber(number)) {
|
||
case 1:
|
||
case 3:
|
||
case 4:
|
||
case 5:
|
||
case 9:
|
||
return number + ' bloaz';
|
||
default:
|
||
return number + ' vloaz';
|
||
}
|
||
}
|
||
function lastNumber(number) {
|
||
if (number > 9) {
|
||
return lastNumber(number % 10);
|
||
}
|
||
return number;
|
||
}
|
||
function mutation(text, number) {
|
||
if (number === 2) {
|
||
return softMutation(text);
|
||
}
|
||
return text;
|
||
}
|
||
function softMutation(text) {
|
||
var mutationTable = {
|
||
m: 'v',
|
||
b: 'v',
|
||
d: 'z',
|
||
};
|
||
if (mutationTable[text.charAt(0)] === undefined) {
|
||
return text;
|
||
}
|
||
return mutationTable[text.charAt(0)] + text.substring(1);
|
||
}
|
||
|
||
var monthsParse = [
|
||
/^gen/i,
|
||
/^c[ʼ\']hwe/i,
|
||
/^meu/i,
|
||
/^ebr/i,
|
||
/^mae/i,
|
||
/^(mez|eve)/i,
|
||
/^gou/i,
|
||
/^eos/i,
|
||
/^gwe/i,
|
||
/^her/i,
|
||
/^du/i,
|
||
/^ker/i,
|
||
],
|
||
monthsRegex$1 =
|
||
/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
|
||
monthsStrictRegex =
|
||
/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,
|
||
monthsShortStrictRegex =
|
||
/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
|
||
fullWeekdaysParse = [
|
||
/^sul/i,
|
||
/^lun/i,
|
||
/^meurzh/i,
|
||
/^merc[ʼ\']her/i,
|
||
/^yaou/i,
|
||
/^gwener/i,
|
||
/^sadorn/i,
|
||
],
|
||
shortWeekdaysParse = [
|
||
/^Sul/i,
|
||
/^Lun/i,
|
||
/^Meu/i,
|
||
/^Mer/i,
|
||
/^Yao/i,
|
||
/^Gwe/i,
|
||
/^Sad/i,
|
||
],
|
||
minWeekdaysParse = [
|
||
/^Su/i,
|
||
/^Lu/i,
|
||
/^Me([^r]|$)/i,
|
||
/^Mer/i,
|
||
/^Ya/i,
|
||
/^Gw/i,
|
||
/^Sa/i,
|
||
];
|
||
|
||
hooks.defineLocale('br', {
|
||
months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
|
||
weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),
|
||
weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
|
||
weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
|
||
weekdaysParse: minWeekdaysParse,
|
||
fullWeekdaysParse: fullWeekdaysParse,
|
||
shortWeekdaysParse: shortWeekdaysParse,
|
||
minWeekdaysParse: minWeekdaysParse,
|
||
|
||
monthsRegex: monthsRegex$1,
|
||
monthsShortRegex: monthsRegex$1,
|
||
monthsStrictRegex: monthsStrictRegex,
|
||
monthsShortStrictRegex: monthsShortStrictRegex,
|
||
monthsParse: monthsParse,
|
||
longMonthsParse: monthsParse,
|
||
shortMonthsParse: monthsParse,
|
||
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D [a viz] MMMM YYYY',
|
||
LLL: 'D [a viz] MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D [a viz] MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Hiziv da] LT',
|
||
nextDay: '[Warcʼhoazh da] LT',
|
||
nextWeek: 'dddd [da] LT',
|
||
lastDay: '[Decʼh da] LT',
|
||
lastWeek: 'dddd [paset da] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'a-benn %s',
|
||
past: '%s ʼzo',
|
||
s: 'un nebeud segondennoù',
|
||
ss: '%d eilenn',
|
||
m: 'ur vunutenn',
|
||
mm: relativeTimeWithMutation,
|
||
h: 'un eur',
|
||
hh: '%d eur',
|
||
d: 'un devezh',
|
||
dd: relativeTimeWithMutation,
|
||
M: 'ur miz',
|
||
MM: relativeTimeWithMutation,
|
||
y: 'ur bloaz',
|
||
yy: specialMutationForYears,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/,
|
||
ordinal: function (number) {
|
||
var output = number === 1 ? 'añ' : 'vet';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
meridiemParse: /a.m.|g.m./, // goude merenn | a-raok merenn
|
||
isPM: function (token) {
|
||
return token === 'g.m.';
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
return hour < 12 ? 'a.m.' : 'g.m.';
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function processRelativeTime(number, withoutSuffix, key, isFuture) {
|
||
switch (key) {
|
||
case 'm':
|
||
return withoutSuffix
|
||
? 'jedna minuta'
|
||
: isFuture
|
||
? 'jednu minutu'
|
||
: 'jedne minute';
|
||
}
|
||
}
|
||
|
||
function translate(number, withoutSuffix, key) {
|
||
var result = number + ' ';
|
||
switch (key) {
|
||
case 'ss':
|
||
if (number === 1) {
|
||
result += 'sekunda';
|
||
} else if (number === 2 || number === 3 || number === 4) {
|
||
result += 'sekunde';
|
||
} else {
|
||
result += 'sekundi';
|
||
}
|
||
return result;
|
||
case 'mm':
|
||
if (number === 1) {
|
||
result += 'minuta';
|
||
} else if (number === 2 || number === 3 || number === 4) {
|
||
result += 'minute';
|
||
} else {
|
||
result += 'minuta';
|
||
}
|
||
return result;
|
||
case 'h':
|
||
return withoutSuffix ? 'jedan sat' : 'jedan sat';
|
||
case 'hh':
|
||
if (number === 1) {
|
||
result += 'sat';
|
||
} else if (number === 2 || number === 3 || number === 4) {
|
||
result += 'sata';
|
||
} else {
|
||
result += 'sati';
|
||
}
|
||
return result;
|
||
case 'dd':
|
||
if (number === 1) {
|
||
result += 'dan';
|
||
} else {
|
||
result += 'dana';
|
||
}
|
||
return result;
|
||
case 'MM':
|
||
if (number === 1) {
|
||
result += 'mjesec';
|
||
} else if (number === 2 || number === 3 || number === 4) {
|
||
result += 'mjeseca';
|
||
} else {
|
||
result += 'mjeseci';
|
||
}
|
||
return result;
|
||
case 'yy':
|
||
if (number === 1) {
|
||
result += 'godina';
|
||
} else if (number === 2 || number === 3 || number === 4) {
|
||
result += 'godine';
|
||
} else {
|
||
result += 'godina';
|
||
}
|
||
return result;
|
||
}
|
||
}
|
||
|
||
hooks.defineLocale('bs', {
|
||
months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
|
||
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY H:mm',
|
||
LLLL: 'dddd, D. MMMM YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[danas u] LT',
|
||
nextDay: '[sutra u] LT',
|
||
nextWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[u] [nedjelju] [u] LT';
|
||
case 3:
|
||
return '[u] [srijedu] [u] LT';
|
||
case 6:
|
||
return '[u] [subotu] [u] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[u] dddd [u] LT';
|
||
}
|
||
},
|
||
lastDay: '[jučer u] LT',
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
case 3:
|
||
return '[prošlu] dddd [u] LT';
|
||
case 6:
|
||
return '[prošle] [subote] [u] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[prošli] dddd [u] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'za %s',
|
||
past: 'prije %s',
|
||
s: 'par sekundi',
|
||
ss: translate,
|
||
m: processRelativeTime,
|
||
mm: translate,
|
||
h: translate,
|
||
hh: translate,
|
||
d: 'dan',
|
||
dd: translate,
|
||
M: 'mjesec',
|
||
MM: translate,
|
||
y: 'godinu',
|
||
yy: translate,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ca', {
|
||
months: {
|
||
standalone:
|
||
'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split(
|
||
'_'
|
||
),
|
||
format: "de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split(
|
||
'_'
|
||
),
|
||
isFormat: /D[oD]?(\s)+MMMM/,
|
||
},
|
||
monthsShort:
|
||
'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays:
|
||
'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
|
||
weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM [de] YYYY',
|
||
ll: 'D MMM YYYY',
|
||
LLL: 'D MMMM [de] YYYY [a les] H:mm',
|
||
lll: 'D MMM YYYY, H:mm',
|
||
LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',
|
||
llll: 'ddd D MMM YYYY, H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: function () {
|
||
return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
|
||
},
|
||
nextDay: function () {
|
||
return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
|
||
},
|
||
nextWeek: function () {
|
||
return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
|
||
},
|
||
lastDay: function () {
|
||
return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
|
||
},
|
||
lastWeek: function () {
|
||
return (
|
||
'[el] dddd [passat a ' +
|
||
(this.hours() !== 1 ? 'les' : 'la') +
|
||
'] LT'
|
||
);
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: "d'aquí %s",
|
||
past: 'fa %s',
|
||
s: 'uns segons',
|
||
ss: '%d segons',
|
||
m: 'un minut',
|
||
mm: '%d minuts',
|
||
h: 'una hora',
|
||
hh: '%d hores',
|
||
d: 'un dia',
|
||
dd: '%d dies',
|
||
M: 'un mes',
|
||
MM: '%d mesos',
|
||
y: 'un any',
|
||
yy: '%d anys',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
|
||
ordinal: function (number, period) {
|
||
var output =
|
||
number === 1
|
||
? 'r'
|
||
: number === 2
|
||
? 'n'
|
||
: number === 3
|
||
? 'r'
|
||
: number === 4
|
||
? 't'
|
||
: 'è';
|
||
if (period === 'w' || period === 'W') {
|
||
output = 'a';
|
||
}
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var months$4 = {
|
||
standalone:
|
||
'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split(
|
||
'_'
|
||
),
|
||
format: 'ledna_února_března_dubna_května_června_července_srpna_září_října_listopadu_prosince'.split(
|
||
'_'
|
||
),
|
||
isFormat: /DD?[o.]?(\[[^\[\]]*\]|\s)+MMMM/,
|
||
},
|
||
monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'),
|
||
monthsParse$1 = [
|
||
/^led/i,
|
||
/^úno/i,
|
||
/^bře/i,
|
||
/^dub/i,
|
||
/^kvě/i,
|
||
/^(čvn|červen$|června)/i,
|
||
/^(čvc|červenec|července)/i,
|
||
/^srp/i,
|
||
/^zář/i,
|
||
/^říj/i,
|
||
/^lis/i,
|
||
/^pro/i,
|
||
],
|
||
// NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
|
||
// Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
|
||
monthsRegex$2 =
|
||
/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;
|
||
|
||
function plural$1(n) {
|
||
return n > 1 && n < 5 && ~~(n / 10) !== 1;
|
||
}
|
||
function translate$1(number, withoutSuffix, key, isFuture) {
|
||
var result = number + ' ';
|
||
switch (key) {
|
||
case 's': // a few seconds / in a few seconds / a few seconds ago
|
||
return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';
|
||
case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$1(number) ? 'sekundy' : 'sekund');
|
||
} else {
|
||
return result + 'sekundami';
|
||
}
|
||
case 'm': // a minute / in a minute / a minute ago
|
||
return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou';
|
||
case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$1(number) ? 'minuty' : 'minut');
|
||
} else {
|
||
return result + 'minutami';
|
||
}
|
||
case 'h': // an hour / in an hour / an hour ago
|
||
return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
|
||
case 'hh': // 9 hours / in 9 hours / 9 hours ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$1(number) ? 'hodiny' : 'hodin');
|
||
} else {
|
||
return result + 'hodinami';
|
||
}
|
||
case 'd': // a day / in a day / a day ago
|
||
return withoutSuffix || isFuture ? 'den' : 'dnem';
|
||
case 'dd': // 9 days / in 9 days / 9 days ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$1(number) ? 'dny' : 'dní');
|
||
} else {
|
||
return result + 'dny';
|
||
}
|
||
case 'M': // a month / in a month / a month ago
|
||
return withoutSuffix || isFuture ? 'měsíc' : 'měsícem';
|
||
case 'MM': // 9 months / in 9 months / 9 months ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$1(number) ? 'měsíce' : 'měsíců');
|
||
} else {
|
||
return result + 'měsíci';
|
||
}
|
||
case 'y': // a year / in a year / a year ago
|
||
return withoutSuffix || isFuture ? 'rok' : 'rokem';
|
||
case 'yy': // 9 years / in 9 years / 9 years ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$1(number) ? 'roky' : 'let');
|
||
} else {
|
||
return result + 'lety';
|
||
}
|
||
}
|
||
}
|
||
|
||
hooks.defineLocale('cs', {
|
||
months: months$4,
|
||
monthsShort: monthsShort,
|
||
monthsRegex: monthsRegex$2,
|
||
monthsShortRegex: monthsRegex$2,
|
||
// NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
|
||
// Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
|
||
monthsStrictRegex:
|
||
/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,
|
||
monthsShortStrictRegex:
|
||
/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,
|
||
monthsParse: monthsParse$1,
|
||
longMonthsParse: monthsParse$1,
|
||
shortMonthsParse: monthsParse$1,
|
||
weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
|
||
weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),
|
||
weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY H:mm',
|
||
LLLL: 'dddd D. MMMM YYYY H:mm',
|
||
l: 'D. M. YYYY',
|
||
},
|
||
calendar: {
|
||
sameDay: '[dnes v] LT',
|
||
nextDay: '[zítra v] LT',
|
||
nextWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[v neděli v] LT';
|
||
case 1:
|
||
case 2:
|
||
return '[v] dddd [v] LT';
|
||
case 3:
|
||
return '[ve středu v] LT';
|
||
case 4:
|
||
return '[ve čtvrtek v] LT';
|
||
case 5:
|
||
return '[v pátek v] LT';
|
||
case 6:
|
||
return '[v sobotu v] LT';
|
||
}
|
||
},
|
||
lastDay: '[včera v] LT',
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[minulou neděli v] LT';
|
||
case 1:
|
||
case 2:
|
||
return '[minulé] dddd [v] LT';
|
||
case 3:
|
||
return '[minulou středu v] LT';
|
||
case 4:
|
||
case 5:
|
||
return '[minulý] dddd [v] LT';
|
||
case 6:
|
||
return '[minulou sobotu v] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'za %s',
|
||
past: 'před %s',
|
||
s: translate$1,
|
||
ss: translate$1,
|
||
m: translate$1,
|
||
mm: translate$1,
|
||
h: translate$1,
|
||
hh: translate$1,
|
||
d: translate$1,
|
||
dd: translate$1,
|
||
M: translate$1,
|
||
MM: translate$1,
|
||
y: translate$1,
|
||
yy: translate$1,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('cv', {
|
||
months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
|
||
weekdays:
|
||
'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
|
||
weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD-MM-YYYY',
|
||
LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
|
||
LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
|
||
LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Паян] LT [сехетре]',
|
||
nextDay: '[Ыран] LT [сехетре]',
|
||
lastDay: '[Ӗнер] LT [сехетре]',
|
||
nextWeek: '[Ҫитес] dddd LT [сехетре]',
|
||
lastWeek: '[Иртнӗ] dddd LT [сехетре]',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: function (output) {
|
||
var affix = /сехет$/i.exec(output)
|
||
? 'рен'
|
||
: /ҫул$/i.exec(output)
|
||
? 'тан'
|
||
: 'ран';
|
||
return output + affix;
|
||
},
|
||
past: '%s каялла',
|
||
s: 'пӗр-ик ҫеккунт',
|
||
ss: '%d ҫеккунт',
|
||
m: 'пӗр минут',
|
||
mm: '%d минут',
|
||
h: 'пӗр сехет',
|
||
hh: '%d сехет',
|
||
d: 'пӗр кун',
|
||
dd: '%d кун',
|
||
M: 'пӗр уйӑх',
|
||
MM: '%d уйӑх',
|
||
y: 'пӗр ҫул',
|
||
yy: '%d ҫул',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-мӗш/,
|
||
ordinal: '%d-мӗш',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('cy', {
|
||
months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split(
|
||
'_'
|
||
),
|
||
weekdays:
|
||
'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
|
||
weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
|
||
weekdaysParseExact: true,
|
||
// time formats are the same as en-gb
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Heddiw am] LT',
|
||
nextDay: '[Yfory am] LT',
|
||
nextWeek: 'dddd [am] LT',
|
||
lastDay: '[Ddoe am] LT',
|
||
lastWeek: 'dddd [diwethaf am] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'mewn %s',
|
||
past: '%s yn ôl',
|
||
s: 'ychydig eiliadau',
|
||
ss: '%d eiliad',
|
||
m: 'munud',
|
||
mm: '%d munud',
|
||
h: 'awr',
|
||
hh: '%d awr',
|
||
d: 'diwrnod',
|
||
dd: '%d diwrnod',
|
||
M: 'mis',
|
||
MM: '%d mis',
|
||
y: 'blwyddyn',
|
||
yy: '%d flynedd',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
|
||
// traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
|
||
ordinal: function (number) {
|
||
var b = number,
|
||
output = '',
|
||
lookup = [
|
||
'',
|
||
'af',
|
||
'il',
|
||
'ydd',
|
||
'ydd',
|
||
'ed',
|
||
'ed',
|
||
'ed',
|
||
'fed',
|
||
'fed',
|
||
'fed', // 1af to 10fed
|
||
'eg',
|
||
'fed',
|
||
'eg',
|
||
'eg',
|
||
'fed',
|
||
'eg',
|
||
'eg',
|
||
'fed',
|
||
'eg',
|
||
'fed', // 11eg to 20fed
|
||
];
|
||
if (b > 20) {
|
||
if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
|
||
output = 'fed'; // not 30ain, 70ain or 90ain
|
||
} else {
|
||
output = 'ain';
|
||
}
|
||
} else if (b > 0) {
|
||
output = lookup[b];
|
||
}
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('da', {
|
||
months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
|
||
weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
|
||
weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'),
|
||
weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY HH:mm',
|
||
LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[i dag kl.] LT',
|
||
nextDay: '[i morgen kl.] LT',
|
||
nextWeek: 'på dddd [kl.] LT',
|
||
lastDay: '[i går kl.] LT',
|
||
lastWeek: '[i] dddd[s kl.] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'om %s',
|
||
past: '%s siden',
|
||
s: 'få sekunder',
|
||
ss: '%d sekunder',
|
||
m: 'et minut',
|
||
mm: '%d minutter',
|
||
h: 'en time',
|
||
hh: '%d timer',
|
||
d: 'en dag',
|
||
dd: '%d dage',
|
||
M: 'en måned',
|
||
MM: '%d måneder',
|
||
y: 'et år',
|
||
yy: '%d år',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function processRelativeTime$1(number, withoutSuffix, key, isFuture) {
|
||
var format = {
|
||
m: ['eine Minute', 'einer Minute'],
|
||
h: ['eine Stunde', 'einer Stunde'],
|
||
d: ['ein Tag', 'einem Tag'],
|
||
dd: [number + ' Tage', number + ' Tagen'],
|
||
w: ['eine Woche', 'einer Woche'],
|
||
M: ['ein Monat', 'einem Monat'],
|
||
MM: [number + ' Monate', number + ' Monaten'],
|
||
y: ['ein Jahr', 'einem Jahr'],
|
||
yy: [number + ' Jahre', number + ' Jahren'],
|
||
};
|
||
return withoutSuffix ? format[key][0] : format[key][1];
|
||
}
|
||
|
||
hooks.defineLocale('de-at', {
|
||
months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
|
||
monthsParseExact: true,
|
||
weekdays:
|
||
'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
|
||
weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D. MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[heute um] LT [Uhr]',
|
||
sameElse: 'L',
|
||
nextDay: '[morgen um] LT [Uhr]',
|
||
nextWeek: 'dddd [um] LT [Uhr]',
|
||
lastDay: '[gestern um] LT [Uhr]',
|
||
lastWeek: '[letzten] dddd [um] LT [Uhr]',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: 'vor %s',
|
||
s: 'ein paar Sekunden',
|
||
ss: '%d Sekunden',
|
||
m: processRelativeTime$1,
|
||
mm: '%d Minuten',
|
||
h: processRelativeTime$1,
|
||
hh: '%d Stunden',
|
||
d: processRelativeTime$1,
|
||
dd: processRelativeTime$1,
|
||
w: processRelativeTime$1,
|
||
ww: '%d Wochen',
|
||
M: processRelativeTime$1,
|
||
MM: processRelativeTime$1,
|
||
y: processRelativeTime$1,
|
||
yy: processRelativeTime$1,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function processRelativeTime$2(number, withoutSuffix, key, isFuture) {
|
||
var format = {
|
||
m: ['eine Minute', 'einer Minute'],
|
||
h: ['eine Stunde', 'einer Stunde'],
|
||
d: ['ein Tag', 'einem Tag'],
|
||
dd: [number + ' Tage', number + ' Tagen'],
|
||
w: ['eine Woche', 'einer Woche'],
|
||
M: ['ein Monat', 'einem Monat'],
|
||
MM: [number + ' Monate', number + ' Monaten'],
|
||
y: ['ein Jahr', 'einem Jahr'],
|
||
yy: [number + ' Jahre', number + ' Jahren'],
|
||
};
|
||
return withoutSuffix ? format[key][0] : format[key][1];
|
||
}
|
||
|
||
hooks.defineLocale('de-ch', {
|
||
months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
|
||
monthsParseExact: true,
|
||
weekdays:
|
||
'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
|
||
weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D. MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[heute um] LT [Uhr]',
|
||
sameElse: 'L',
|
||
nextDay: '[morgen um] LT [Uhr]',
|
||
nextWeek: 'dddd [um] LT [Uhr]',
|
||
lastDay: '[gestern um] LT [Uhr]',
|
||
lastWeek: '[letzten] dddd [um] LT [Uhr]',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: 'vor %s',
|
||
s: 'ein paar Sekunden',
|
||
ss: '%d Sekunden',
|
||
m: processRelativeTime$2,
|
||
mm: '%d Minuten',
|
||
h: processRelativeTime$2,
|
||
hh: '%d Stunden',
|
||
d: processRelativeTime$2,
|
||
dd: processRelativeTime$2,
|
||
w: processRelativeTime$2,
|
||
ww: '%d Wochen',
|
||
M: processRelativeTime$2,
|
||
MM: processRelativeTime$2,
|
||
y: processRelativeTime$2,
|
||
yy: processRelativeTime$2,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function processRelativeTime$3(number, withoutSuffix, key, isFuture) {
|
||
var format = {
|
||
m: ['eine Minute', 'einer Minute'],
|
||
h: ['eine Stunde', 'einer Stunde'],
|
||
d: ['ein Tag', 'einem Tag'],
|
||
dd: [number + ' Tage', number + ' Tagen'],
|
||
w: ['eine Woche', 'einer Woche'],
|
||
M: ['ein Monat', 'einem Monat'],
|
||
MM: [number + ' Monate', number + ' Monaten'],
|
||
y: ['ein Jahr', 'einem Jahr'],
|
||
yy: [number + ' Jahre', number + ' Jahren'],
|
||
};
|
||
return withoutSuffix ? format[key][0] : format[key][1];
|
||
}
|
||
|
||
hooks.defineLocale('de', {
|
||
months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
|
||
monthsParseExact: true,
|
||
weekdays:
|
||
'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
|
||
weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D. MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[heute um] LT [Uhr]',
|
||
sameElse: 'L',
|
||
nextDay: '[morgen um] LT [Uhr]',
|
||
nextWeek: 'dddd [um] LT [Uhr]',
|
||
lastDay: '[gestern um] LT [Uhr]',
|
||
lastWeek: '[letzten] dddd [um] LT [Uhr]',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: 'vor %s',
|
||
s: 'ein paar Sekunden',
|
||
ss: '%d Sekunden',
|
||
m: processRelativeTime$3,
|
||
mm: '%d Minuten',
|
||
h: processRelativeTime$3,
|
||
hh: '%d Stunden',
|
||
d: processRelativeTime$3,
|
||
dd: processRelativeTime$3,
|
||
w: processRelativeTime$3,
|
||
ww: '%d Wochen',
|
||
M: processRelativeTime$3,
|
||
MM: processRelativeTime$3,
|
||
y: processRelativeTime$3,
|
||
yy: processRelativeTime$3,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var months$5 = [
|
||
'ޖެނުއަރީ',
|
||
'ފެބްރުއަރީ',
|
||
'މާރިޗު',
|
||
'އޭޕްރީލު',
|
||
'މޭ',
|
||
'ޖޫން',
|
||
'ޖުލައި',
|
||
'އޯގަސްޓު',
|
||
'ސެޕްޓެމްބަރު',
|
||
'އޮކްޓޯބަރު',
|
||
'ނޮވެމްބަރު',
|
||
'ޑިސެމްބަރު',
|
||
],
|
||
weekdays = [
|
||
'އާދިއްތަ',
|
||
'ހޯމަ',
|
||
'އަންގާރަ',
|
||
'ބުދަ',
|
||
'ބުރާސްފަތި',
|
||
'ހުކުރު',
|
||
'ހޮނިހިރު',
|
||
];
|
||
|
||
hooks.defineLocale('dv', {
|
||
months: months$5,
|
||
monthsShort: months$5,
|
||
weekdays: weekdays,
|
||
weekdaysShort: weekdays,
|
||
weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'D/M/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /މކ|މފ/,
|
||
isPM: function (input) {
|
||
return 'މފ' === input;
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'މކ';
|
||
} else {
|
||
return 'މފ';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[މިއަދު] LT',
|
||
nextDay: '[މާދަމާ] LT',
|
||
nextWeek: 'dddd LT',
|
||
lastDay: '[އިއްޔެ] LT',
|
||
lastWeek: '[ފާއިތުވި] dddd LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'ތެރޭގައި %s',
|
||
past: 'ކުރިން %s',
|
||
s: 'ސިކުންތުކޮޅެއް',
|
||
ss: 'd% ސިކުންތު',
|
||
m: 'މިނިޓެއް',
|
||
mm: 'މިނިޓު %d',
|
||
h: 'ގަޑިއިރެއް',
|
||
hh: 'ގަޑިއިރު %d',
|
||
d: 'ދުވަހެއް',
|
||
dd: 'ދުވަސް %d',
|
||
M: 'މަހެއް',
|
||
MM: 'މަސް %d',
|
||
y: 'އަހަރެއް',
|
||
yy: 'އަހަރު %d',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/،/g, ',');
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/,/g, '،');
|
||
},
|
||
week: {
|
||
dow: 7, // Sunday is the first day of the week.
|
||
doy: 12, // The week that contains Jan 12th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function isFunction$1(input) {
|
||
return (
|
||
(typeof Function !== 'undefined' && input instanceof Function) ||
|
||
Object.prototype.toString.call(input) === '[object Function]'
|
||
);
|
||
}
|
||
|
||
hooks.defineLocale('el', {
|
||
monthsNominativeEl:
|
||
'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split(
|
||
'_'
|
||
),
|
||
monthsGenitiveEl:
|
||
'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split(
|
||
'_'
|
||
),
|
||
months: function (momentToFormat, format) {
|
||
if (!momentToFormat) {
|
||
return this._monthsNominativeEl;
|
||
} else if (
|
||
typeof format === 'string' &&
|
||
/D/.test(format.substring(0, format.indexOf('MMMM')))
|
||
) {
|
||
// if there is a day number before 'MMMM'
|
||
return this._monthsGenitiveEl[momentToFormat.month()];
|
||
} else {
|
||
return this._monthsNominativeEl[momentToFormat.month()];
|
||
}
|
||
},
|
||
monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
|
||
weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
|
||
weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours > 11) {
|
||
return isLower ? 'μμ' : 'ΜΜ';
|
||
} else {
|
||
return isLower ? 'πμ' : 'ΠΜ';
|
||
}
|
||
},
|
||
isPM: function (input) {
|
||
return (input + '').toLowerCase()[0] === 'μ';
|
||
},
|
||
meridiemParse: /[ΠΜ]\.?Μ?\.?/i,
|
||
longDateFormat: {
|
||
LT: 'h:mm A',
|
||
LTS: 'h:mm:ss A',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY h:mm A',
|
||
LLLL: 'dddd, D MMMM YYYY h:mm A',
|
||
},
|
||
calendarEl: {
|
||
sameDay: '[Σήμερα {}] LT',
|
||
nextDay: '[Αύριο {}] LT',
|
||
nextWeek: 'dddd [{}] LT',
|
||
lastDay: '[Χθες {}] LT',
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 6:
|
||
return '[το προηγούμενο] dddd [{}] LT';
|
||
default:
|
||
return '[την προηγούμενη] dddd [{}] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
calendar: function (key, mom) {
|
||
var output = this._calendarEl[key],
|
||
hours = mom && mom.hours();
|
||
if (isFunction$1(output)) {
|
||
output = output.apply(mom);
|
||
}
|
||
return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις');
|
||
},
|
||
relativeTime: {
|
||
future: 'σε %s',
|
||
past: '%s πριν',
|
||
s: 'λίγα δευτερόλεπτα',
|
||
ss: '%d δευτερόλεπτα',
|
||
m: 'ένα λεπτό',
|
||
mm: '%d λεπτά',
|
||
h: 'μία ώρα',
|
||
hh: '%d ώρες',
|
||
d: 'μία μέρα',
|
||
dd: '%d μέρες',
|
||
M: 'ένας μήνας',
|
||
MM: '%d μήνες',
|
||
y: 'ένας χρόνος',
|
||
yy: '%d χρόνια',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}η/,
|
||
ordinal: '%dη',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4st is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('en-au', {
|
||
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
||
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
||
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'h:mm A',
|
||
LTS: 'h:mm:ss A',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY h:mm A',
|
||
LLLL: 'dddd, D MMMM YYYY h:mm A',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Today at] LT',
|
||
nextDay: '[Tomorrow at] LT',
|
||
nextWeek: 'dddd [at] LT',
|
||
lastDay: '[Yesterday at] LT',
|
||
lastWeek: '[Last] dddd [at] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: '%s ago',
|
||
s: 'a few seconds',
|
||
ss: '%d seconds',
|
||
m: 'a minute',
|
||
mm: '%d minutes',
|
||
h: 'an hour',
|
||
hh: '%d hours',
|
||
d: 'a day',
|
||
dd: '%d days',
|
||
M: 'a month',
|
||
MM: '%d months',
|
||
y: 'a year',
|
||
yy: '%d years',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('en-ca', {
|
||
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
||
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
||
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'h:mm A',
|
||
LTS: 'h:mm:ss A',
|
||
L: 'YYYY-MM-DD',
|
||
LL: 'MMMM D, YYYY',
|
||
LLL: 'MMMM D, YYYY h:mm A',
|
||
LLLL: 'dddd, MMMM D, YYYY h:mm A',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Today at] LT',
|
||
nextDay: '[Tomorrow at] LT',
|
||
nextWeek: 'dddd [at] LT',
|
||
lastDay: '[Yesterday at] LT',
|
||
lastWeek: '[Last] dddd [at] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: '%s ago',
|
||
s: 'a few seconds',
|
||
ss: '%d seconds',
|
||
m: 'a minute',
|
||
mm: '%d minutes',
|
||
h: 'an hour',
|
||
hh: '%d hours',
|
||
d: 'a day',
|
||
dd: '%d days',
|
||
M: 'a month',
|
||
MM: '%d months',
|
||
y: 'a year',
|
||
yy: '%d years',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('en-gb', {
|
||
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
||
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
||
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Today at] LT',
|
||
nextDay: '[Tomorrow at] LT',
|
||
nextWeek: 'dddd [at] LT',
|
||
lastDay: '[Yesterday at] LT',
|
||
lastWeek: '[Last] dddd [at] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: '%s ago',
|
||
s: 'a few seconds',
|
||
ss: '%d seconds',
|
||
m: 'a minute',
|
||
mm: '%d minutes',
|
||
h: 'an hour',
|
||
hh: '%d hours',
|
||
d: 'a day',
|
||
dd: '%d days',
|
||
M: 'a month',
|
||
MM: '%d months',
|
||
y: 'a year',
|
||
yy: '%d years',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('en-ie', {
|
||
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
||
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
||
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Today at] LT',
|
||
nextDay: '[Tomorrow at] LT',
|
||
nextWeek: 'dddd [at] LT',
|
||
lastDay: '[Yesterday at] LT',
|
||
lastWeek: '[Last] dddd [at] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: '%s ago',
|
||
s: 'a few seconds',
|
||
ss: '%d seconds',
|
||
m: 'a minute',
|
||
mm: '%d minutes',
|
||
h: 'an hour',
|
||
hh: '%d hours',
|
||
d: 'a day',
|
||
dd: '%d days',
|
||
M: 'a month',
|
||
MM: '%d months',
|
||
y: 'a year',
|
||
yy: '%d years',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('en-il', {
|
||
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
||
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
||
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Today at] LT',
|
||
nextDay: '[Tomorrow at] LT',
|
||
nextWeek: 'dddd [at] LT',
|
||
lastDay: '[Yesterday at] LT',
|
||
lastWeek: '[Last] dddd [at] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: '%s ago',
|
||
s: 'a few seconds',
|
||
ss: '%d seconds',
|
||
m: 'a minute',
|
||
mm: '%d minutes',
|
||
h: 'an hour',
|
||
hh: '%d hours',
|
||
d: 'a day',
|
||
dd: '%d days',
|
||
M: 'a month',
|
||
MM: '%d months',
|
||
y: 'a year',
|
||
yy: '%d years',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('en-in', {
|
||
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
||
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
||
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'h:mm A',
|
||
LTS: 'h:mm:ss A',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY h:mm A',
|
||
LLLL: 'dddd, D MMMM YYYY h:mm A',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Today at] LT',
|
||
nextDay: '[Tomorrow at] LT',
|
||
nextWeek: 'dddd [at] LT',
|
||
lastDay: '[Yesterday at] LT',
|
||
lastWeek: '[Last] dddd [at] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: '%s ago',
|
||
s: 'a few seconds',
|
||
ss: '%d seconds',
|
||
m: 'a minute',
|
||
mm: '%d minutes',
|
||
h: 'an hour',
|
||
hh: '%d hours',
|
||
d: 'a day',
|
||
dd: '%d days',
|
||
M: 'a month',
|
||
MM: '%d months',
|
||
y: 'a year',
|
||
yy: '%d years',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 1st is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('en-nz', {
|
||
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
||
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
||
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'h:mm A',
|
||
LTS: 'h:mm:ss A',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY h:mm A',
|
||
LLLL: 'dddd, D MMMM YYYY h:mm A',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Today at] LT',
|
||
nextDay: '[Tomorrow at] LT',
|
||
nextWeek: 'dddd [at] LT',
|
||
lastDay: '[Yesterday at] LT',
|
||
lastWeek: '[Last] dddd [at] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: '%s ago',
|
||
s: 'a few seconds',
|
||
ss: '%d seconds',
|
||
m: 'a minute',
|
||
mm: '%d minutes',
|
||
h: 'an hour',
|
||
hh: '%d hours',
|
||
d: 'a day',
|
||
dd: '%d days',
|
||
M: 'a month',
|
||
MM: '%d months',
|
||
y: 'a year',
|
||
yy: '%d years',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('en-sg', {
|
||
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
||
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
||
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Today at] LT',
|
||
nextDay: '[Tomorrow at] LT',
|
||
nextWeek: 'dddd [at] LT',
|
||
lastDay: '[Yesterday at] LT',
|
||
lastWeek: '[Last] dddd [at] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'in %s',
|
||
past: '%s ago',
|
||
s: 'a few seconds',
|
||
ss: '%d seconds',
|
||
m: 'a minute',
|
||
mm: '%d minutes',
|
||
h: 'an hour',
|
||
hh: '%d hours',
|
||
d: 'a day',
|
||
dd: '%d days',
|
||
M: 'a month',
|
||
MM: '%d months',
|
||
y: 'a year',
|
||
yy: '%d years',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('eo', {
|
||
months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec'.split('_'),
|
||
weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),
|
||
weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),
|
||
weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY-MM-DD',
|
||
LL: '[la] D[-an de] MMMM, YYYY',
|
||
LLL: '[la] D[-an de] MMMM, YYYY HH:mm',
|
||
LLLL: 'dddd[n], [la] D[-an de] MMMM, YYYY HH:mm',
|
||
llll: 'ddd, [la] D[-an de] MMM, YYYY HH:mm',
|
||
},
|
||
meridiemParse: /[ap]\.t\.m/i,
|
||
isPM: function (input) {
|
||
return input.charAt(0).toLowerCase() === 'p';
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours > 11) {
|
||
return isLower ? 'p.t.m.' : 'P.T.M.';
|
||
} else {
|
||
return isLower ? 'a.t.m.' : 'A.T.M.';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[Hodiaŭ je] LT',
|
||
nextDay: '[Morgaŭ je] LT',
|
||
nextWeek: 'dddd[n je] LT',
|
||
lastDay: '[Hieraŭ je] LT',
|
||
lastWeek: '[pasintan] dddd[n je] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'post %s',
|
||
past: 'antaŭ %s',
|
||
s: 'kelkaj sekundoj',
|
||
ss: '%d sekundoj',
|
||
m: 'unu minuto',
|
||
mm: '%d minutoj',
|
||
h: 'unu horo',
|
||
hh: '%d horoj',
|
||
d: 'unu tago', //ne 'diurno', ĉar estas uzita por proksimumo
|
||
dd: '%d tagoj',
|
||
M: 'unu monato',
|
||
MM: '%d monatoj',
|
||
y: 'unu jaro',
|
||
yy: '%d jaroj',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}a/,
|
||
ordinal: '%da',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var monthsShortDot =
|
||
'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
|
||
'_'
|
||
),
|
||
monthsShort$1 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
|
||
monthsParse$2 = [
|
||
/^ene/i,
|
||
/^feb/i,
|
||
/^mar/i,
|
||
/^abr/i,
|
||
/^may/i,
|
||
/^jun/i,
|
||
/^jul/i,
|
||
/^ago/i,
|
||
/^sep/i,
|
||
/^oct/i,
|
||
/^nov/i,
|
||
/^dic/i,
|
||
],
|
||
monthsRegex$3 =
|
||
/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
|
||
|
||
hooks.defineLocale('es-do', {
|
||
months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort: function (m, format) {
|
||
if (!m) {
|
||
return monthsShortDot;
|
||
} else if (/-MMM-/.test(format)) {
|
||
return monthsShort$1[m.month()];
|
||
} else {
|
||
return monthsShortDot[m.month()];
|
||
}
|
||
},
|
||
monthsRegex: monthsRegex$3,
|
||
monthsShortRegex: monthsRegex$3,
|
||
monthsStrictRegex:
|
||
/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
|
||
monthsShortStrictRegex:
|
||
/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
|
||
monthsParse: monthsParse$2,
|
||
longMonthsParse: monthsParse$2,
|
||
shortMonthsParse: monthsParse$2,
|
||
weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
|
||
weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
|
||
weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'h:mm A',
|
||
LTS: 'h:mm:ss A',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D [de] MMMM [de] YYYY',
|
||
LLL: 'D [de] MMMM [de] YYYY h:mm A',
|
||
LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',
|
||
},
|
||
calendar: {
|
||
sameDay: function () {
|
||
return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
nextDay: function () {
|
||
return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
nextWeek: function () {
|
||
return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
lastDay: function () {
|
||
return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
lastWeek: function () {
|
||
return (
|
||
'[el] dddd [pasado a la' +
|
||
(this.hours() !== 1 ? 's' : '') +
|
||
'] LT'
|
||
);
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'en %s',
|
||
past: 'hace %s',
|
||
s: 'unos segundos',
|
||
ss: '%d segundos',
|
||
m: 'un minuto',
|
||
mm: '%d minutos',
|
||
h: 'una hora',
|
||
hh: '%d horas',
|
||
d: 'un día',
|
||
dd: '%d días',
|
||
w: 'una semana',
|
||
ww: '%d semanas',
|
||
M: 'un mes',
|
||
MM: '%d meses',
|
||
y: 'un año',
|
||
yy: '%d años',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var monthsShortDot$1 =
|
||
'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
|
||
'_'
|
||
),
|
||
monthsShort$2 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
|
||
monthsParse$3 = [
|
||
/^ene/i,
|
||
/^feb/i,
|
||
/^mar/i,
|
||
/^abr/i,
|
||
/^may/i,
|
||
/^jun/i,
|
||
/^jul/i,
|
||
/^ago/i,
|
||
/^sep/i,
|
||
/^oct/i,
|
||
/^nov/i,
|
||
/^dic/i,
|
||
],
|
||
monthsRegex$4 =
|
||
/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
|
||
|
||
hooks.defineLocale('es-mx', {
|
||
months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort: function (m, format) {
|
||
if (!m) {
|
||
return monthsShortDot$1;
|
||
} else if (/-MMM-/.test(format)) {
|
||
return monthsShort$2[m.month()];
|
||
} else {
|
||
return monthsShortDot$1[m.month()];
|
||
}
|
||
},
|
||
monthsRegex: monthsRegex$4,
|
||
monthsShortRegex: monthsRegex$4,
|
||
monthsStrictRegex:
|
||
/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
|
||
monthsShortStrictRegex:
|
||
/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
|
||
monthsParse: monthsParse$3,
|
||
longMonthsParse: monthsParse$3,
|
||
shortMonthsParse: monthsParse$3,
|
||
weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
|
||
weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
|
||
weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D [de] MMMM [de] YYYY',
|
||
LLL: 'D [de] MMMM [de] YYYY H:mm',
|
||
LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: function () {
|
||
return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
nextDay: function () {
|
||
return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
nextWeek: function () {
|
||
return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
lastDay: function () {
|
||
return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
lastWeek: function () {
|
||
return (
|
||
'[el] dddd [pasado a la' +
|
||
(this.hours() !== 1 ? 's' : '') +
|
||
'] LT'
|
||
);
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'en %s',
|
||
past: 'hace %s',
|
||
s: 'unos segundos',
|
||
ss: '%d segundos',
|
||
m: 'un minuto',
|
||
mm: '%d minutos',
|
||
h: 'una hora',
|
||
hh: '%d horas',
|
||
d: 'un día',
|
||
dd: '%d días',
|
||
w: 'una semana',
|
||
ww: '%d semanas',
|
||
M: 'un mes',
|
||
MM: '%d meses',
|
||
y: 'un año',
|
||
yy: '%d años',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
invalidDate: 'Fecha inválida',
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var monthsShortDot$2 =
|
||
'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
|
||
'_'
|
||
),
|
||
monthsShort$3 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
|
||
monthsParse$4 = [
|
||
/^ene/i,
|
||
/^feb/i,
|
||
/^mar/i,
|
||
/^abr/i,
|
||
/^may/i,
|
||
/^jun/i,
|
||
/^jul/i,
|
||
/^ago/i,
|
||
/^sep/i,
|
||
/^oct/i,
|
||
/^nov/i,
|
||
/^dic/i,
|
||
],
|
||
monthsRegex$5 =
|
||
/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
|
||
|
||
hooks.defineLocale('es-us', {
|
||
months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort: function (m, format) {
|
||
if (!m) {
|
||
return monthsShortDot$2;
|
||
} else if (/-MMM-/.test(format)) {
|
||
return monthsShort$3[m.month()];
|
||
} else {
|
||
return monthsShortDot$2[m.month()];
|
||
}
|
||
},
|
||
monthsRegex: monthsRegex$5,
|
||
monthsShortRegex: monthsRegex$5,
|
||
monthsStrictRegex:
|
||
/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
|
||
monthsShortStrictRegex:
|
||
/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
|
||
monthsParse: monthsParse$4,
|
||
longMonthsParse: monthsParse$4,
|
||
shortMonthsParse: monthsParse$4,
|
||
weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
|
||
weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
|
||
weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'h:mm A',
|
||
LTS: 'h:mm:ss A',
|
||
L: 'MM/DD/YYYY',
|
||
LL: 'D [de] MMMM [de] YYYY',
|
||
LLL: 'D [de] MMMM [de] YYYY h:mm A',
|
||
LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',
|
||
},
|
||
calendar: {
|
||
sameDay: function () {
|
||
return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
nextDay: function () {
|
||
return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
nextWeek: function () {
|
||
return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
lastDay: function () {
|
||
return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
lastWeek: function () {
|
||
return (
|
||
'[el] dddd [pasado a la' +
|
||
(this.hours() !== 1 ? 's' : '') +
|
||
'] LT'
|
||
);
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'en %s',
|
||
past: 'hace %s',
|
||
s: 'unos segundos',
|
||
ss: '%d segundos',
|
||
m: 'un minuto',
|
||
mm: '%d minutos',
|
||
h: 'una hora',
|
||
hh: '%d horas',
|
||
d: 'un día',
|
||
dd: '%d días',
|
||
w: 'una semana',
|
||
ww: '%d semanas',
|
||
M: 'un mes',
|
||
MM: '%d meses',
|
||
y: 'un año',
|
||
yy: '%d años',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var monthsShortDot$3 =
|
||
'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
|
||
'_'
|
||
),
|
||
monthsShort$4 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
|
||
monthsParse$5 = [
|
||
/^ene/i,
|
||
/^feb/i,
|
||
/^mar/i,
|
||
/^abr/i,
|
||
/^may/i,
|
||
/^jun/i,
|
||
/^jul/i,
|
||
/^ago/i,
|
||
/^sep/i,
|
||
/^oct/i,
|
||
/^nov/i,
|
||
/^dic/i,
|
||
],
|
||
monthsRegex$6 =
|
||
/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
|
||
|
||
hooks.defineLocale('es', {
|
||
months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort: function (m, format) {
|
||
if (!m) {
|
||
return monthsShortDot$3;
|
||
} else if (/-MMM-/.test(format)) {
|
||
return monthsShort$4[m.month()];
|
||
} else {
|
||
return monthsShortDot$3[m.month()];
|
||
}
|
||
},
|
||
monthsRegex: monthsRegex$6,
|
||
monthsShortRegex: monthsRegex$6,
|
||
monthsStrictRegex:
|
||
/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
|
||
monthsShortStrictRegex:
|
||
/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
|
||
monthsParse: monthsParse$5,
|
||
longMonthsParse: monthsParse$5,
|
||
shortMonthsParse: monthsParse$5,
|
||
weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
|
||
weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
|
||
weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D [de] MMMM [de] YYYY',
|
||
LLL: 'D [de] MMMM [de] YYYY H:mm',
|
||
LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: function () {
|
||
return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
nextDay: function () {
|
||
return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
nextWeek: function () {
|
||
return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
lastDay: function () {
|
||
return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
|
||
},
|
||
lastWeek: function () {
|
||
return (
|
||
'[el] dddd [pasado a la' +
|
||
(this.hours() !== 1 ? 's' : '') +
|
||
'] LT'
|
||
);
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'en %s',
|
||
past: 'hace %s',
|
||
s: 'unos segundos',
|
||
ss: '%d segundos',
|
||
m: 'un minuto',
|
||
mm: '%d minutos',
|
||
h: 'una hora',
|
||
hh: '%d horas',
|
||
d: 'un día',
|
||
dd: '%d días',
|
||
w: 'una semana',
|
||
ww: '%d semanas',
|
||
M: 'un mes',
|
||
MM: '%d meses',
|
||
y: 'un año',
|
||
yy: '%d años',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
invalidDate: 'Fecha inválida',
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function processRelativeTime$4(number, withoutSuffix, key, isFuture) {
|
||
var format = {
|
||
s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
|
||
ss: [number + 'sekundi', number + 'sekundit'],
|
||
m: ['ühe minuti', 'üks minut'],
|
||
mm: [number + ' minuti', number + ' minutit'],
|
||
h: ['ühe tunni', 'tund aega', 'üks tund'],
|
||
hh: [number + ' tunni', number + ' tundi'],
|
||
d: ['ühe päeva', 'üks päev'],
|
||
M: ['kuu aja', 'kuu aega', 'üks kuu'],
|
||
MM: [number + ' kuu', number + ' kuud'],
|
||
y: ['ühe aasta', 'aasta', 'üks aasta'],
|
||
yy: [number + ' aasta', number + ' aastat'],
|
||
};
|
||
if (withoutSuffix) {
|
||
return format[key][2] ? format[key][2] : format[key][1];
|
||
}
|
||
return isFuture ? format[key][0] : format[key][1];
|
||
}
|
||
|
||
hooks.defineLocale('et', {
|
||
months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
|
||
weekdays:
|
||
'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),
|
||
weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY H:mm',
|
||
LLLL: 'dddd, D. MMMM YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Täna,] LT',
|
||
nextDay: '[Homme,] LT',
|
||
nextWeek: '[Järgmine] dddd LT',
|
||
lastDay: '[Eile,] LT',
|
||
lastWeek: '[Eelmine] dddd LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s pärast',
|
||
past: '%s tagasi',
|
||
s: processRelativeTime$4,
|
||
ss: processRelativeTime$4,
|
||
m: processRelativeTime$4,
|
||
mm: processRelativeTime$4,
|
||
h: processRelativeTime$4,
|
||
hh: processRelativeTime$4,
|
||
d: processRelativeTime$4,
|
||
dd: '%d päeva',
|
||
M: processRelativeTime$4,
|
||
MM: processRelativeTime$4,
|
||
y: processRelativeTime$4,
|
||
yy: processRelativeTime$4,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('eu', {
|
||
months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays:
|
||
'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'),
|
||
weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY-MM-DD',
|
||
LL: 'YYYY[ko] MMMM[ren] D[a]',
|
||
LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm',
|
||
LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
|
||
l: 'YYYY-M-D',
|
||
ll: 'YYYY[ko] MMM D[a]',
|
||
lll: 'YYYY[ko] MMM D[a] HH:mm',
|
||
llll: 'ddd, YYYY[ko] MMM D[a] HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[gaur] LT[etan]',
|
||
nextDay: '[bihar] LT[etan]',
|
||
nextWeek: 'dddd LT[etan]',
|
||
lastDay: '[atzo] LT[etan]',
|
||
lastWeek: '[aurreko] dddd LT[etan]',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s barru',
|
||
past: 'duela %s',
|
||
s: 'segundo batzuk',
|
||
ss: '%d segundo',
|
||
m: 'minutu bat',
|
||
mm: '%d minutu',
|
||
h: 'ordu bat',
|
||
hh: '%d ordu',
|
||
d: 'egun bat',
|
||
dd: '%d egun',
|
||
M: 'hilabete bat',
|
||
MM: '%d hilabete',
|
||
y: 'urte bat',
|
||
yy: '%d urte',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$7 = {
|
||
1: '۱',
|
||
2: '۲',
|
||
3: '۳',
|
||
4: '۴',
|
||
5: '۵',
|
||
6: '۶',
|
||
7: '۷',
|
||
8: '۸',
|
||
9: '۹',
|
||
0: '۰',
|
||
},
|
||
numberMap$6 = {
|
||
'۱': '1',
|
||
'۲': '2',
|
||
'۳': '3',
|
||
'۴': '4',
|
||
'۵': '5',
|
||
'۶': '6',
|
||
'۷': '7',
|
||
'۸': '8',
|
||
'۹': '9',
|
||
'۰': '0',
|
||
};
|
||
|
||
hooks.defineLocale('fa', {
|
||
months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
|
||
'_'
|
||
),
|
||
weekdays:
|
||
'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort:
|
||
'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
|
||
'_'
|
||
),
|
||
weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /قبل از ظهر|بعد از ظهر/,
|
||
isPM: function (input) {
|
||
return /بعد از ظهر/.test(input);
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'قبل از ظهر';
|
||
} else {
|
||
return 'بعد از ظهر';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[امروز ساعت] LT',
|
||
nextDay: '[فردا ساعت] LT',
|
||
nextWeek: 'dddd [ساعت] LT',
|
||
lastDay: '[دیروز ساعت] LT',
|
||
lastWeek: 'dddd [پیش] [ساعت] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'در %s',
|
||
past: '%s پیش',
|
||
s: 'چند ثانیه',
|
||
ss: '%d ثانیه',
|
||
m: 'یک دقیقه',
|
||
mm: '%d دقیقه',
|
||
h: 'یک ساعت',
|
||
hh: '%d ساعت',
|
||
d: 'یک روز',
|
||
dd: '%d روز',
|
||
M: 'یک ماه',
|
||
MM: '%d ماه',
|
||
y: 'یک سال',
|
||
yy: '%d سال',
|
||
},
|
||
preparse: function (string) {
|
||
return string
|
||
.replace(/[۰-۹]/g, function (match) {
|
||
return numberMap$6[match];
|
||
})
|
||
.replace(/،/g, ',');
|
||
},
|
||
postformat: function (string) {
|
||
return string
|
||
.replace(/\d/g, function (match) {
|
||
return symbolMap$7[match];
|
||
})
|
||
.replace(/,/g, '،');
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}م/,
|
||
ordinal: '%dم',
|
||
week: {
|
||
dow: 6, // Saturday is the first day of the week.
|
||
doy: 12, // The week that contains Jan 12th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var numbersPast =
|
||
'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(
|
||
' '
|
||
),
|
||
numbersFuture = [
|
||
'nolla',
|
||
'yhden',
|
||
'kahden',
|
||
'kolmen',
|
||
'neljän',
|
||
'viiden',
|
||
'kuuden',
|
||
numbersPast[7],
|
||
numbersPast[8],
|
||
numbersPast[9],
|
||
];
|
||
function translate$2(number, withoutSuffix, key, isFuture) {
|
||
var result = '';
|
||
switch (key) {
|
||
case 's':
|
||
return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
|
||
case 'ss':
|
||
result = isFuture ? 'sekunnin' : 'sekuntia';
|
||
break;
|
||
case 'm':
|
||
return isFuture ? 'minuutin' : 'minuutti';
|
||
case 'mm':
|
||
result = isFuture ? 'minuutin' : 'minuuttia';
|
||
break;
|
||
case 'h':
|
||
return isFuture ? 'tunnin' : 'tunti';
|
||
case 'hh':
|
||
result = isFuture ? 'tunnin' : 'tuntia';
|
||
break;
|
||
case 'd':
|
||
return isFuture ? 'päivän' : 'päivä';
|
||
case 'dd':
|
||
result = isFuture ? 'päivän' : 'päivää';
|
||
break;
|
||
case 'M':
|
||
return isFuture ? 'kuukauden' : 'kuukausi';
|
||
case 'MM':
|
||
result = isFuture ? 'kuukauden' : 'kuukautta';
|
||
break;
|
||
case 'y':
|
||
return isFuture ? 'vuoden' : 'vuosi';
|
||
case 'yy':
|
||
result = isFuture ? 'vuoden' : 'vuotta';
|
||
break;
|
||
}
|
||
result = verbalNumber(number, isFuture) + ' ' + result;
|
||
return result;
|
||
}
|
||
function verbalNumber(number, isFuture) {
|
||
return number < 10
|
||
? isFuture
|
||
? numbersFuture[number]
|
||
: numbersPast[number]
|
||
: number;
|
||
}
|
||
|
||
hooks.defineLocale('fi', {
|
||
months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split(
|
||
'_'
|
||
),
|
||
weekdays:
|
||
'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),
|
||
weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH.mm',
|
||
LTS: 'HH.mm.ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'Do MMMM[ta] YYYY',
|
||
LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',
|
||
LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
|
||
l: 'D.M.YYYY',
|
||
ll: 'Do MMM YYYY',
|
||
lll: 'Do MMM YYYY, [klo] HH.mm',
|
||
llll: 'ddd, Do MMM YYYY, [klo] HH.mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[tänään] [klo] LT',
|
||
nextDay: '[huomenna] [klo] LT',
|
||
nextWeek: 'dddd [klo] LT',
|
||
lastDay: '[eilen] [klo] LT',
|
||
lastWeek: '[viime] dddd[na] [klo] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s päästä',
|
||
past: '%s sitten',
|
||
s: translate$2,
|
||
ss: translate$2,
|
||
m: translate$2,
|
||
mm: translate$2,
|
||
h: translate$2,
|
||
hh: translate$2,
|
||
d: translate$2,
|
||
dd: translate$2,
|
||
M: translate$2,
|
||
MM: translate$2,
|
||
y: translate$2,
|
||
yy: translate$2,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('fil', {
|
||
months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
|
||
weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
|
||
weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'MM/D/YYYY',
|
||
LL: 'MMMM D, YYYY',
|
||
LLL: 'MMMM D, YYYY HH:mm',
|
||
LLLL: 'dddd, MMMM DD, YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: 'LT [ngayong araw]',
|
||
nextDay: '[Bukas ng] LT',
|
||
nextWeek: 'LT [sa susunod na] dddd',
|
||
lastDay: 'LT [kahapon]',
|
||
lastWeek: 'LT [noong nakaraang] dddd',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'sa loob ng %s',
|
||
past: '%s ang nakalipas',
|
||
s: 'ilang segundo',
|
||
ss: '%d segundo',
|
||
m: 'isang minuto',
|
||
mm: '%d minuto',
|
||
h: 'isang oras',
|
||
hh: '%d oras',
|
||
d: 'isang araw',
|
||
dd: '%d araw',
|
||
M: 'isang buwan',
|
||
MM: '%d buwan',
|
||
y: 'isang taon',
|
||
yy: '%d taon',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}/,
|
||
ordinal: function (number) {
|
||
return number;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('fo', {
|
||
months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
|
||
weekdays:
|
||
'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
|
||
weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D. MMMM, YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Í dag kl.] LT',
|
||
nextDay: '[Í morgin kl.] LT',
|
||
nextWeek: 'dddd [kl.] LT',
|
||
lastDay: '[Í gjár kl.] LT',
|
||
lastWeek: '[síðstu] dddd [kl] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'um %s',
|
||
past: '%s síðani',
|
||
s: 'fá sekund',
|
||
ss: '%d sekundir',
|
||
m: 'ein minuttur',
|
||
mm: '%d minuttir',
|
||
h: 'ein tími',
|
||
hh: '%d tímar',
|
||
d: 'ein dagur',
|
||
dd: '%d dagar',
|
||
M: 'ein mánaður',
|
||
MM: '%d mánaðir',
|
||
y: 'eitt ár',
|
||
yy: '%d ár',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('fr-ca', {
|
||
months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
|
||
weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
|
||
weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY-MM-DD',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Aujourd’hui à] LT',
|
||
nextDay: '[Demain à] LT',
|
||
nextWeek: 'dddd [à] LT',
|
||
lastDay: '[Hier à] LT',
|
||
lastWeek: 'dddd [dernier à] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'dans %s',
|
||
past: 'il y a %s',
|
||
s: 'quelques secondes',
|
||
ss: '%d secondes',
|
||
m: 'une minute',
|
||
mm: '%d minutes',
|
||
h: 'une heure',
|
||
hh: '%d heures',
|
||
d: 'un jour',
|
||
dd: '%d jours',
|
||
M: 'un mois',
|
||
MM: '%d mois',
|
||
y: 'un an',
|
||
yy: '%d ans',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
// Words with masculine grammatical gender: mois, trimestre, jour
|
||
default:
|
||
case 'M':
|
||
case 'Q':
|
||
case 'D':
|
||
case 'DDD':
|
||
case 'd':
|
||
return number + (number === 1 ? 'er' : 'e');
|
||
|
||
// Words with feminine grammatical gender: semaine
|
||
case 'w':
|
||
case 'W':
|
||
return number + (number === 1 ? 're' : 'e');
|
||
}
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('fr-ch', {
|
||
months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
|
||
weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
|
||
weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Aujourd’hui à] LT',
|
||
nextDay: '[Demain à] LT',
|
||
nextWeek: 'dddd [à] LT',
|
||
lastDay: '[Hier à] LT',
|
||
lastWeek: 'dddd [dernier à] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'dans %s',
|
||
past: 'il y a %s',
|
||
s: 'quelques secondes',
|
||
ss: '%d secondes',
|
||
m: 'une minute',
|
||
mm: '%d minutes',
|
||
h: 'une heure',
|
||
hh: '%d heures',
|
||
d: 'un jour',
|
||
dd: '%d jours',
|
||
M: 'un mois',
|
||
MM: '%d mois',
|
||
y: 'un an',
|
||
yy: '%d ans',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
// Words with masculine grammatical gender: mois, trimestre, jour
|
||
default:
|
||
case 'M':
|
||
case 'Q':
|
||
case 'D':
|
||
case 'DDD':
|
||
case 'd':
|
||
return number + (number === 1 ? 'er' : 'e');
|
||
|
||
// Words with feminine grammatical gender: semaine
|
||
case 'w':
|
||
case 'W':
|
||
return number + (number === 1 ? 're' : 'e');
|
||
}
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var monthsStrictRegex$1 =
|
||
/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
|
||
monthsShortStrictRegex$1 =
|
||
/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,
|
||
monthsRegex$7 =
|
||
/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
|
||
monthsParse$6 = [
|
||
/^janv/i,
|
||
/^févr/i,
|
||
/^mars/i,
|
||
/^avr/i,
|
||
/^mai/i,
|
||
/^juin/i,
|
||
/^juil/i,
|
||
/^août/i,
|
||
/^sept/i,
|
||
/^oct/i,
|
||
/^nov/i,
|
||
/^déc/i,
|
||
];
|
||
|
||
hooks.defineLocale('fr', {
|
||
months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
|
||
'_'
|
||
),
|
||
monthsRegex: monthsRegex$7,
|
||
monthsShortRegex: monthsRegex$7,
|
||
monthsStrictRegex: monthsStrictRegex$1,
|
||
monthsShortStrictRegex: monthsShortStrictRegex$1,
|
||
monthsParse: monthsParse$6,
|
||
longMonthsParse: monthsParse$6,
|
||
shortMonthsParse: monthsParse$6,
|
||
weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
|
||
weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
|
||
weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Aujourd’hui à] LT',
|
||
nextDay: '[Demain à] LT',
|
||
nextWeek: 'dddd [à] LT',
|
||
lastDay: '[Hier à] LT',
|
||
lastWeek: 'dddd [dernier à] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'dans %s',
|
||
past: 'il y a %s',
|
||
s: 'quelques secondes',
|
||
ss: '%d secondes',
|
||
m: 'une minute',
|
||
mm: '%d minutes',
|
||
h: 'une heure',
|
||
hh: '%d heures',
|
||
d: 'un jour',
|
||
dd: '%d jours',
|
||
w: 'une semaine',
|
||
ww: '%d semaines',
|
||
M: 'un mois',
|
||
MM: '%d mois',
|
||
y: 'un an',
|
||
yy: '%d ans',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
// TODO: Return 'e' when day of month > 1. Move this case inside
|
||
// block for masculine words below.
|
||
// See https://github.com/moment/moment/issues/3375
|
||
case 'D':
|
||
return number + (number === 1 ? 'er' : '');
|
||
|
||
// Words with masculine grammatical gender: mois, trimestre, jour
|
||
default:
|
||
case 'M':
|
||
case 'Q':
|
||
case 'DDD':
|
||
case 'd':
|
||
return number + (number === 1 ? 'er' : 'e');
|
||
|
||
// Words with feminine grammatical gender: semaine
|
||
case 'w':
|
||
case 'W':
|
||
return number + (number === 1 ? 're' : 'e');
|
||
}
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var monthsShortWithDots =
|
||
'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),
|
||
monthsShortWithoutDots =
|
||
'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');
|
||
|
||
hooks.defineLocale('fy', {
|
||
months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split(
|
||
'_'
|
||
),
|
||
monthsShort: function (m, format) {
|
||
if (!m) {
|
||
return monthsShortWithDots;
|
||
} else if (/-MMM-/.test(format)) {
|
||
return monthsShortWithoutDots[m.month()];
|
||
} else {
|
||
return monthsShortWithDots[m.month()];
|
||
}
|
||
},
|
||
monthsParseExact: true,
|
||
weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),
|
||
weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD-MM-YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[hjoed om] LT',
|
||
nextDay: '[moarn om] LT',
|
||
nextWeek: 'dddd [om] LT',
|
||
lastDay: '[juster om] LT',
|
||
lastWeek: '[ôfrûne] dddd [om] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'oer %s',
|
||
past: '%s lyn',
|
||
s: 'in pear sekonden',
|
||
ss: '%d sekonden',
|
||
m: 'ien minút',
|
||
mm: '%d minuten',
|
||
h: 'ien oere',
|
||
hh: '%d oeren',
|
||
d: 'ien dei',
|
||
dd: '%d dagen',
|
||
M: 'ien moanne',
|
||
MM: '%d moannen',
|
||
y: 'ien jier',
|
||
yy: '%d jierren',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
|
||
ordinal: function (number) {
|
||
return (
|
||
number +
|
||
(number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
|
||
);
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var months$6 = [
|
||
'Eanáir',
|
||
'Feabhra',
|
||
'Márta',
|
||
'Aibreán',
|
||
'Bealtaine',
|
||
'Meitheamh',
|
||
'Iúil',
|
||
'Lúnasa',
|
||
'Meán Fómhair',
|
||
'Deireadh Fómhair',
|
||
'Samhain',
|
||
'Nollaig',
|
||
],
|
||
monthsShort$5 = [
|
||
'Ean',
|
||
'Feabh',
|
||
'Márt',
|
||
'Aib',
|
||
'Beal',
|
||
'Meith',
|
||
'Iúil',
|
||
'Lún',
|
||
'M.F.',
|
||
'D.F.',
|
||
'Samh',
|
||
'Noll',
|
||
],
|
||
weekdays$1 = [
|
||
'Dé Domhnaigh',
|
||
'Dé Luain',
|
||
'Dé Máirt',
|
||
'Dé Céadaoin',
|
||
'Déardaoin',
|
||
'Dé hAoine',
|
||
'Dé Sathairn',
|
||
],
|
||
weekdaysShort = ['Domh', 'Luan', 'Máirt', 'Céad', 'Déar', 'Aoine', 'Sath'],
|
||
weekdaysMin = ['Do', 'Lu', 'Má', 'Cé', 'Dé', 'A', 'Sa'];
|
||
|
||
hooks.defineLocale('ga', {
|
||
months: months$6,
|
||
monthsShort: monthsShort$5,
|
||
monthsParseExact: true,
|
||
weekdays: weekdays$1,
|
||
weekdaysShort: weekdaysShort,
|
||
weekdaysMin: weekdaysMin,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Inniu ag] LT',
|
||
nextDay: '[Amárach ag] LT',
|
||
nextWeek: 'dddd [ag] LT',
|
||
lastDay: '[Inné ag] LT',
|
||
lastWeek: 'dddd [seo caite] [ag] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'i %s',
|
||
past: '%s ó shin',
|
||
s: 'cúpla soicind',
|
||
ss: '%d soicind',
|
||
m: 'nóiméad',
|
||
mm: '%d nóiméad',
|
||
h: 'uair an chloig',
|
||
hh: '%d uair an chloig',
|
||
d: 'lá',
|
||
dd: '%d lá',
|
||
M: 'mí',
|
||
MM: '%d míonna',
|
||
y: 'bliain',
|
||
yy: '%d bliain',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
|
||
ordinal: function (number) {
|
||
var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var months$7 = [
|
||
'Am Faoilleach',
|
||
'An Gearran',
|
||
'Am Màrt',
|
||
'An Giblean',
|
||
'An Cèitean',
|
||
'An t-Ògmhios',
|
||
'An t-Iuchar',
|
||
'An Lùnastal',
|
||
'An t-Sultain',
|
||
'An Dàmhair',
|
||
'An t-Samhain',
|
||
'An Dùbhlachd',
|
||
],
|
||
monthsShort$6 = [
|
||
'Faoi',
|
||
'Gear',
|
||
'Màrt',
|
||
'Gibl',
|
||
'Cèit',
|
||
'Ògmh',
|
||
'Iuch',
|
||
'Lùn',
|
||
'Sult',
|
||
'Dàmh',
|
||
'Samh',
|
||
'Dùbh',
|
||
],
|
||
weekdays$2 = [
|
||
'Didòmhnaich',
|
||
'Diluain',
|
||
'Dimàirt',
|
||
'Diciadain',
|
||
'Diardaoin',
|
||
'Dihaoine',
|
||
'Disathairne',
|
||
],
|
||
weekdaysShort$1 = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'],
|
||
weekdaysMin$1 = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];
|
||
|
||
hooks.defineLocale('gd', {
|
||
months: months$7,
|
||
monthsShort: monthsShort$6,
|
||
monthsParseExact: true,
|
||
weekdays: weekdays$2,
|
||
weekdaysShort: weekdaysShort$1,
|
||
weekdaysMin: weekdaysMin$1,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[An-diugh aig] LT',
|
||
nextDay: '[A-màireach aig] LT',
|
||
nextWeek: 'dddd [aig] LT',
|
||
lastDay: '[An-dè aig] LT',
|
||
lastWeek: 'dddd [seo chaidh] [aig] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'ann an %s',
|
||
past: 'bho chionn %s',
|
||
s: 'beagan diogan',
|
||
ss: '%d diogan',
|
||
m: 'mionaid',
|
||
mm: '%d mionaidean',
|
||
h: 'uair',
|
||
hh: '%d uairean',
|
||
d: 'latha',
|
||
dd: '%d latha',
|
||
M: 'mìos',
|
||
MM: '%d mìosan',
|
||
y: 'bliadhna',
|
||
yy: '%d bliadhna',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
|
||
ordinal: function (number) {
|
||
var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('gl', {
|
||
months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
|
||
weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
|
||
weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D [de] MMMM [de] YYYY',
|
||
LLL: 'D [de] MMMM [de] YYYY H:mm',
|
||
LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: function () {
|
||
return '[hoxe ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
|
||
},
|
||
nextDay: function () {
|
||
return '[mañá ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
|
||
},
|
||
nextWeek: function () {
|
||
return 'dddd [' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT';
|
||
},
|
||
lastDay: function () {
|
||
return '[onte ' + (this.hours() !== 1 ? 'á' : 'a') + '] LT';
|
||
},
|
||
lastWeek: function () {
|
||
return (
|
||
'[o] dddd [pasado ' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT'
|
||
);
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: function (str) {
|
||
if (str.indexOf('un') === 0) {
|
||
return 'n' + str;
|
||
}
|
||
return 'en ' + str;
|
||
},
|
||
past: 'hai %s',
|
||
s: 'uns segundos',
|
||
ss: '%d segundos',
|
||
m: 'un minuto',
|
||
mm: '%d minutos',
|
||
h: 'unha hora',
|
||
hh: '%d horas',
|
||
d: 'un día',
|
||
dd: '%d días',
|
||
M: 'un mes',
|
||
MM: '%d meses',
|
||
y: 'un ano',
|
||
yy: '%d anos',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function processRelativeTime$5(number, withoutSuffix, key, isFuture) {
|
||
var format = {
|
||
s: ['थोडया सॅकंडांनी', 'थोडे सॅकंड'],
|
||
ss: [number + ' सॅकंडांनी', number + ' सॅकंड'],
|
||
m: ['एका मिणटान', 'एक मिनूट'],
|
||
mm: [number + ' मिणटांनी', number + ' मिणटां'],
|
||
h: ['एका वरान', 'एक वर'],
|
||
hh: [number + ' वरांनी', number + ' वरां'],
|
||
d: ['एका दिसान', 'एक दीस'],
|
||
dd: [number + ' दिसांनी', number + ' दीस'],
|
||
M: ['एका म्हयन्यान', 'एक म्हयनो'],
|
||
MM: [number + ' म्हयन्यानी', number + ' म्हयने'],
|
||
y: ['एका वर्सान', 'एक वर्स'],
|
||
yy: [number + ' वर्सांनी', number + ' वर्सां'],
|
||
};
|
||
return isFuture ? format[key][0] : format[key][1];
|
||
}
|
||
|
||
hooks.defineLocale('gom-deva', {
|
||
months: {
|
||
standalone:
|
||
'जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(
|
||
'_'
|
||
),
|
||
format: 'जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या'.split(
|
||
'_'
|
||
),
|
||
isFormat: /MMMM(\s)+D[oD]?/,
|
||
},
|
||
monthsShort:
|
||
'जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार'.split('_'),
|
||
weekdaysShort: 'आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.'.split('_'),
|
||
weekdaysMin: 'आ_सो_मं_बु_ब्रे_सु_शे'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'A h:mm [वाजतां]',
|
||
LTS: 'A h:mm:ss [वाजतां]',
|
||
L: 'DD-MM-YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY A h:mm [वाजतां]',
|
||
LLLL: 'dddd, MMMM Do, YYYY, A h:mm [वाजतां]',
|
||
llll: 'ddd, D MMM YYYY, A h:mm [वाजतां]',
|
||
},
|
||
calendar: {
|
||
sameDay: '[आयज] LT',
|
||
nextDay: '[फाल्यां] LT',
|
||
nextWeek: '[फुडलो] dddd[,] LT',
|
||
lastDay: '[काल] LT',
|
||
lastWeek: '[फाटलो] dddd[,] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s',
|
||
past: '%s आदीं',
|
||
s: processRelativeTime$5,
|
||
ss: processRelativeTime$5,
|
||
m: processRelativeTime$5,
|
||
mm: processRelativeTime$5,
|
||
h: processRelativeTime$5,
|
||
hh: processRelativeTime$5,
|
||
d: processRelativeTime$5,
|
||
dd: processRelativeTime$5,
|
||
M: processRelativeTime$5,
|
||
MM: processRelativeTime$5,
|
||
y: processRelativeTime$5,
|
||
yy: processRelativeTime$5,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(वेर)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
// the ordinal 'वेर' only applies to day of the month
|
||
case 'D':
|
||
return number + 'वेर';
|
||
default:
|
||
case 'M':
|
||
case 'Q':
|
||
case 'DDD':
|
||
case 'd':
|
||
case 'w':
|
||
case 'W':
|
||
return number;
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week
|
||
doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)
|
||
},
|
||
meridiemParse: /राती|सकाळीं|दनपारां|सांजे/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'राती') {
|
||
return hour < 4 ? hour : hour + 12;
|
||
} else if (meridiem === 'सकाळीं') {
|
||
return hour;
|
||
} else if (meridiem === 'दनपारां') {
|
||
return hour > 12 ? hour : hour + 12;
|
||
} else if (meridiem === 'सांजे') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'राती';
|
||
} else if (hour < 12) {
|
||
return 'सकाळीं';
|
||
} else if (hour < 16) {
|
||
return 'दनपारां';
|
||
} else if (hour < 20) {
|
||
return 'सांजे';
|
||
} else {
|
||
return 'राती';
|
||
}
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function processRelativeTime$6(number, withoutSuffix, key, isFuture) {
|
||
var format = {
|
||
s: ['thoddea sekondamni', 'thodde sekond'],
|
||
ss: [number + ' sekondamni', number + ' sekond'],
|
||
m: ['eka mintan', 'ek minut'],
|
||
mm: [number + ' mintamni', number + ' mintam'],
|
||
h: ['eka voran', 'ek vor'],
|
||
hh: [number + ' voramni', number + ' voram'],
|
||
d: ['eka disan', 'ek dis'],
|
||
dd: [number + ' disamni', number + ' dis'],
|
||
M: ['eka mhoinean', 'ek mhoino'],
|
||
MM: [number + ' mhoineamni', number + ' mhoine'],
|
||
y: ['eka vorsan', 'ek voros'],
|
||
yy: [number + ' vorsamni', number + ' vorsam'],
|
||
};
|
||
return isFuture ? format[key][0] : format[key][1];
|
||
}
|
||
|
||
hooks.defineLocale('gom-latn', {
|
||
months: {
|
||
standalone:
|
||
'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split(
|
||
'_'
|
||
),
|
||
format: 'Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea'.split(
|
||
'_'
|
||
),
|
||
isFormat: /MMMM(\s)+D[oD]?/,
|
||
},
|
||
monthsShort:
|
||
'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'),
|
||
monthsParseExact: true,
|
||
weekdays: "Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split('_'),
|
||
weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
|
||
weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'A h:mm [vazta]',
|
||
LTS: 'A h:mm:ss [vazta]',
|
||
L: 'DD-MM-YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY A h:mm [vazta]',
|
||
LLLL: 'dddd, MMMM Do, YYYY, A h:mm [vazta]',
|
||
llll: 'ddd, D MMM YYYY, A h:mm [vazta]',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Aiz] LT',
|
||
nextDay: '[Faleam] LT',
|
||
nextWeek: '[Fuddlo] dddd[,] LT',
|
||
lastDay: '[Kal] LT',
|
||
lastWeek: '[Fattlo] dddd[,] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s',
|
||
past: '%s adim',
|
||
s: processRelativeTime$6,
|
||
ss: processRelativeTime$6,
|
||
m: processRelativeTime$6,
|
||
mm: processRelativeTime$6,
|
||
h: processRelativeTime$6,
|
||
hh: processRelativeTime$6,
|
||
d: processRelativeTime$6,
|
||
dd: processRelativeTime$6,
|
||
M: processRelativeTime$6,
|
||
MM: processRelativeTime$6,
|
||
y: processRelativeTime$6,
|
||
yy: processRelativeTime$6,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(er)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
// the ordinal 'er' only applies to day of the month
|
||
case 'D':
|
||
return number + 'er';
|
||
default:
|
||
case 'M':
|
||
case 'Q':
|
||
case 'DDD':
|
||
case 'd':
|
||
case 'w':
|
||
case 'W':
|
||
return number;
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week
|
||
doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)
|
||
},
|
||
meridiemParse: /rati|sokallim|donparam|sanje/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'rati') {
|
||
return hour < 4 ? hour : hour + 12;
|
||
} else if (meridiem === 'sokallim') {
|
||
return hour;
|
||
} else if (meridiem === 'donparam') {
|
||
return hour > 12 ? hour : hour + 12;
|
||
} else if (meridiem === 'sanje') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'rati';
|
||
} else if (hour < 12) {
|
||
return 'sokallim';
|
||
} else if (hour < 16) {
|
||
return 'donparam';
|
||
} else if (hour < 20) {
|
||
return 'sanje';
|
||
} else {
|
||
return 'rati';
|
||
}
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$8 = {
|
||
1: '૧',
|
||
2: '૨',
|
||
3: '૩',
|
||
4: '૪',
|
||
5: '૫',
|
||
6: '૬',
|
||
7: '૭',
|
||
8: '૮',
|
||
9: '૯',
|
||
0: '૦',
|
||
},
|
||
numberMap$7 = {
|
||
'૧': '1',
|
||
'૨': '2',
|
||
'૩': '3',
|
||
'૪': '4',
|
||
'૫': '5',
|
||
'૬': '6',
|
||
'૭': '7',
|
||
'૮': '8',
|
||
'૯': '9',
|
||
'૦': '0',
|
||
};
|
||
|
||
hooks.defineLocale('gu', {
|
||
months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
|
||
weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm વાગ્યે',
|
||
LTS: 'A h:mm:ss વાગ્યે',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
|
||
LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે',
|
||
},
|
||
calendar: {
|
||
sameDay: '[આજ] LT',
|
||
nextDay: '[કાલે] LT',
|
||
nextWeek: 'dddd, LT',
|
||
lastDay: '[ગઇકાલે] LT',
|
||
lastWeek: '[પાછલા] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s મા',
|
||
past: '%s પહેલા',
|
||
s: 'અમુક પળો',
|
||
ss: '%d સેકંડ',
|
||
m: 'એક મિનિટ',
|
||
mm: '%d મિનિટ',
|
||
h: 'એક કલાક',
|
||
hh: '%d કલાક',
|
||
d: 'એક દિવસ',
|
||
dd: '%d દિવસ',
|
||
M: 'એક મહિનો',
|
||
MM: '%d મહિનો',
|
||
y: 'એક વર્ષ',
|
||
yy: '%d વર્ષ',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {
|
||
return numberMap$7[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$8[match];
|
||
});
|
||
},
|
||
// Gujarati notation for meridiems are quite fuzzy in practice. While there exists
|
||
// a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.
|
||
meridiemParse: /રાત|બપોર|સવાર|સાંજ/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'રાત') {
|
||
return hour < 4 ? hour : hour + 12;
|
||
} else if (meridiem === 'સવાર') {
|
||
return hour;
|
||
} else if (meridiem === 'બપોર') {
|
||
return hour >= 10 ? hour : hour + 12;
|
||
} else if (meridiem === 'સાંજ') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'રાત';
|
||
} else if (hour < 10) {
|
||
return 'સવાર';
|
||
} else if (hour < 17) {
|
||
return 'બપોર';
|
||
} else if (hour < 20) {
|
||
return 'સાંજ';
|
||
} else {
|
||
return 'રાત';
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('he', {
|
||
months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
|
||
weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
|
||
weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
|
||
weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D [ב]MMMM YYYY',
|
||
LLL: 'D [ב]MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
|
||
l: 'D/M/YYYY',
|
||
ll: 'D MMM YYYY',
|
||
lll: 'D MMM YYYY HH:mm',
|
||
llll: 'ddd, D MMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[היום ב־]LT',
|
||
nextDay: '[מחר ב־]LT',
|
||
nextWeek: 'dddd [בשעה] LT',
|
||
lastDay: '[אתמול ב־]LT',
|
||
lastWeek: '[ביום] dddd [האחרון בשעה] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'בעוד %s',
|
||
past: 'לפני %s',
|
||
s: 'מספר שניות',
|
||
ss: '%d שניות',
|
||
m: 'דקה',
|
||
mm: '%d דקות',
|
||
h: 'שעה',
|
||
hh: function (number) {
|
||
if (number === 2) {
|
||
return 'שעתיים';
|
||
}
|
||
return number + ' שעות';
|
||
},
|
||
d: 'יום',
|
||
dd: function (number) {
|
||
if (number === 2) {
|
||
return 'יומיים';
|
||
}
|
||
return number + ' ימים';
|
||
},
|
||
M: 'חודש',
|
||
MM: function (number) {
|
||
if (number === 2) {
|
||
return 'חודשיים';
|
||
}
|
||
return number + ' חודשים';
|
||
},
|
||
y: 'שנה',
|
||
yy: function (number) {
|
||
if (number === 2) {
|
||
return 'שנתיים';
|
||
} else if (number % 10 === 0 && number !== 10) {
|
||
return number + ' שנה';
|
||
}
|
||
return number + ' שנים';
|
||
},
|
||
},
|
||
meridiemParse:
|
||
/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
|
||
isPM: function (input) {
|
||
return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 5) {
|
||
return 'לפנות בוקר';
|
||
} else if (hour < 10) {
|
||
return 'בבוקר';
|
||
} else if (hour < 12) {
|
||
return isLower ? 'לפנה"צ' : 'לפני הצהריים';
|
||
} else if (hour < 18) {
|
||
return isLower ? 'אחה"צ' : 'אחרי הצהריים';
|
||
} else {
|
||
return 'בערב';
|
||
}
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$9 = {
|
||
1: '१',
|
||
2: '२',
|
||
3: '३',
|
||
4: '४',
|
||
5: '५',
|
||
6: '६',
|
||
7: '७',
|
||
8: '८',
|
||
9: '९',
|
||
0: '०',
|
||
},
|
||
numberMap$8 = {
|
||
'१': '1',
|
||
'२': '2',
|
||
'३': '3',
|
||
'४': '4',
|
||
'५': '5',
|
||
'६': '6',
|
||
'७': '7',
|
||
'८': '8',
|
||
'९': '9',
|
||
'०': '0',
|
||
},
|
||
monthsParse$7 = [
|
||
/^जन/i,
|
||
/^फ़र|फर/i,
|
||
/^मार्च/i,
|
||
/^अप्रै/i,
|
||
/^मई/i,
|
||
/^जून/i,
|
||
/^जुल/i,
|
||
/^अग/i,
|
||
/^सितं|सित/i,
|
||
/^अक्टू/i,
|
||
/^नव|नवं/i,
|
||
/^दिसं|दिस/i,
|
||
],
|
||
shortMonthsParse = [
|
||
/^जन/i,
|
||
/^फ़र/i,
|
||
/^मार्च/i,
|
||
/^अप्रै/i,
|
||
/^मई/i,
|
||
/^जून/i,
|
||
/^जुल/i,
|
||
/^अग/i,
|
||
/^सित/i,
|
||
/^अक्टू/i,
|
||
/^नव/i,
|
||
/^दिस/i,
|
||
];
|
||
|
||
hooks.defineLocale('hi', {
|
||
months: {
|
||
format: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर'.split(
|
||
'_'
|
||
),
|
||
},
|
||
monthsShort:
|
||
'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
|
||
weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
|
||
weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
|
||
weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm बजे',
|
||
LTS: 'A h:mm:ss बजे',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, A h:mm बजे',
|
||
LLLL: 'dddd, D MMMM YYYY, A h:mm बजे',
|
||
},
|
||
|
||
monthsParse: monthsParse$7,
|
||
longMonthsParse: monthsParse$7,
|
||
shortMonthsParse: shortMonthsParse,
|
||
|
||
monthsRegex:
|
||
/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,
|
||
|
||
monthsShortRegex:
|
||
/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,
|
||
|
||
monthsStrictRegex:
|
||
/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,
|
||
|
||
monthsShortStrictRegex:
|
||
/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,
|
||
|
||
calendar: {
|
||
sameDay: '[आज] LT',
|
||
nextDay: '[कल] LT',
|
||
nextWeek: 'dddd, LT',
|
||
lastDay: '[कल] LT',
|
||
lastWeek: '[पिछले] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s में',
|
||
past: '%s पहले',
|
||
s: 'कुछ ही क्षण',
|
||
ss: '%d सेकंड',
|
||
m: 'एक मिनट',
|
||
mm: '%d मिनट',
|
||
h: 'एक घंटा',
|
||
hh: '%d घंटे',
|
||
d: 'एक दिन',
|
||
dd: '%d दिन',
|
||
M: 'एक महीने',
|
||
MM: '%d महीने',
|
||
y: 'एक वर्ष',
|
||
yy: '%d वर्ष',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[१२३४५६७८९०]/g, function (match) {
|
||
return numberMap$8[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$9[match];
|
||
});
|
||
},
|
||
// Hindi notation for meridiems are quite fuzzy in practice. While there exists
|
||
// a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
|
||
meridiemParse: /रात|सुबह|दोपहर|शाम/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'रात') {
|
||
return hour < 4 ? hour : hour + 12;
|
||
} else if (meridiem === 'सुबह') {
|
||
return hour;
|
||
} else if (meridiem === 'दोपहर') {
|
||
return hour >= 10 ? hour : hour + 12;
|
||
} else if (meridiem === 'शाम') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'रात';
|
||
} else if (hour < 10) {
|
||
return 'सुबह';
|
||
} else if (hour < 17) {
|
||
return 'दोपहर';
|
||
} else if (hour < 20) {
|
||
return 'शाम';
|
||
} else {
|
||
return 'रात';
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function translate$3(number, withoutSuffix, key) {
|
||
var result = number + ' ';
|
||
switch (key) {
|
||
case 'ss':
|
||
if (number === 1) {
|
||
result += 'sekunda';
|
||
} else if (number === 2 || number === 3 || number === 4) {
|
||
result += 'sekunde';
|
||
} else {
|
||
result += 'sekundi';
|
||
}
|
||
return result;
|
||
case 'm':
|
||
return withoutSuffix ? 'jedna minuta' : 'jedne minute';
|
||
case 'mm':
|
||
if (number === 1) {
|
||
result += 'minuta';
|
||
} else if (number === 2 || number === 3 || number === 4) {
|
||
result += 'minute';
|
||
} else {
|
||
result += 'minuta';
|
||
}
|
||
return result;
|
||
case 'h':
|
||
return withoutSuffix ? 'jedan sat' : 'jednog sata';
|
||
case 'hh':
|
||
if (number === 1) {
|
||
result += 'sat';
|
||
} else if (number === 2 || number === 3 || number === 4) {
|
||
result += 'sata';
|
||
} else {
|
||
result += 'sati';
|
||
}
|
||
return result;
|
||
case 'dd':
|
||
if (number === 1) {
|
||
result += 'dan';
|
||
} else {
|
||
result += 'dana';
|
||
}
|
||
return result;
|
||
case 'MM':
|
||
if (number === 1) {
|
||
result += 'mjesec';
|
||
} else if (number === 2 || number === 3 || number === 4) {
|
||
result += 'mjeseca';
|
||
} else {
|
||
result += 'mjeseci';
|
||
}
|
||
return result;
|
||
case 'yy':
|
||
if (number === 1) {
|
||
result += 'godina';
|
||
} else if (number === 2 || number === 3 || number === 4) {
|
||
result += 'godine';
|
||
} else {
|
||
result += 'godina';
|
||
}
|
||
return result;
|
||
}
|
||
}
|
||
|
||
hooks.defineLocale('hr', {
|
||
months: {
|
||
format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split(
|
||
'_'
|
||
),
|
||
},
|
||
monthsShort:
|
||
'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
|
||
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'Do MMMM YYYY',
|
||
LLL: 'Do MMMM YYYY H:mm',
|
||
LLLL: 'dddd, Do MMMM YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[danas u] LT',
|
||
nextDay: '[sutra u] LT',
|
||
nextWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[u] [nedjelju] [u] LT';
|
||
case 3:
|
||
return '[u] [srijedu] [u] LT';
|
||
case 6:
|
||
return '[u] [subotu] [u] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[u] dddd [u] LT';
|
||
}
|
||
},
|
||
lastDay: '[jučer u] LT',
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[prošlu] [nedjelju] [u] LT';
|
||
case 3:
|
||
return '[prošlu] [srijedu] [u] LT';
|
||
case 6:
|
||
return '[prošle] [subote] [u] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[prošli] dddd [u] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'za %s',
|
||
past: 'prije %s',
|
||
s: 'par sekundi',
|
||
ss: translate$3,
|
||
m: translate$3,
|
||
mm: translate$3,
|
||
h: translate$3,
|
||
hh: translate$3,
|
||
d: 'dan',
|
||
dd: translate$3,
|
||
M: 'mjesec',
|
||
MM: translate$3,
|
||
y: 'godinu',
|
||
yy: translate$3,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var weekEndings =
|
||
'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
|
||
function translate$4(number, withoutSuffix, key, isFuture) {
|
||
var num = number;
|
||
switch (key) {
|
||
case 's':
|
||
return isFuture || withoutSuffix
|
||
? 'néhány másodperc'
|
||
: 'néhány másodperce';
|
||
case 'ss':
|
||
return num + (isFuture || withoutSuffix)
|
||
? ' másodperc'
|
||
: ' másodperce';
|
||
case 'm':
|
||
return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
|
||
case 'mm':
|
||
return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
|
||
case 'h':
|
||
return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
|
||
case 'hh':
|
||
return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
|
||
case 'd':
|
||
return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
|
||
case 'dd':
|
||
return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
|
||
case 'M':
|
||
return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
|
||
case 'MM':
|
||
return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
|
||
case 'y':
|
||
return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
|
||
case 'yy':
|
||
return num + (isFuture || withoutSuffix ? ' év' : ' éve');
|
||
}
|
||
return '';
|
||
}
|
||
function week(isFuture) {
|
||
return (
|
||
(isFuture ? '' : '[múlt] ') +
|
||
'[' +
|
||
weekEndings[this.day()] +
|
||
'] LT[-kor]'
|
||
);
|
||
}
|
||
|
||
hooks.defineLocale('hu', {
|
||
months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
|
||
weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
|
||
weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'YYYY.MM.DD.',
|
||
LL: 'YYYY. MMMM D.',
|
||
LLL: 'YYYY. MMMM D. H:mm',
|
||
LLLL: 'YYYY. MMMM D., dddd H:mm',
|
||
},
|
||
meridiemParse: /de|du/i,
|
||
isPM: function (input) {
|
||
return input.charAt(1).toLowerCase() === 'u';
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours < 12) {
|
||
return isLower === true ? 'de' : 'DE';
|
||
} else {
|
||
return isLower === true ? 'du' : 'DU';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[ma] LT[-kor]',
|
||
nextDay: '[holnap] LT[-kor]',
|
||
nextWeek: function () {
|
||
return week.call(this, true);
|
||
},
|
||
lastDay: '[tegnap] LT[-kor]',
|
||
lastWeek: function () {
|
||
return week.call(this, false);
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s múlva',
|
||
past: '%s',
|
||
s: translate$4,
|
||
ss: translate$4,
|
||
m: translate$4,
|
||
mm: translate$4,
|
||
h: translate$4,
|
||
hh: translate$4,
|
||
d: translate$4,
|
||
dd: translate$4,
|
||
M: translate$4,
|
||
MM: translate$4,
|
||
y: translate$4,
|
||
yy: translate$4,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('hy-am', {
|
||
months: {
|
||
format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split(
|
||
'_'
|
||
),
|
||
},
|
||
monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
|
||
weekdays:
|
||
'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
|
||
weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY թ.',
|
||
LLL: 'D MMMM YYYY թ., HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY թ., HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[այսօր] LT',
|
||
nextDay: '[վաղը] LT',
|
||
lastDay: '[երեկ] LT',
|
||
nextWeek: function () {
|
||
return 'dddd [օրը ժամը] LT';
|
||
},
|
||
lastWeek: function () {
|
||
return '[անցած] dddd [օրը ժամը] LT';
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s հետո',
|
||
past: '%s առաջ',
|
||
s: 'մի քանի վայրկյան',
|
||
ss: '%d վայրկյան',
|
||
m: 'րոպե',
|
||
mm: '%d րոպե',
|
||
h: 'ժամ',
|
||
hh: '%d ժամ',
|
||
d: 'օր',
|
||
dd: '%d օր',
|
||
M: 'ամիս',
|
||
MM: '%d ամիս',
|
||
y: 'տարի',
|
||
yy: '%d տարի',
|
||
},
|
||
meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
|
||
isPM: function (input) {
|
||
return /^(ցերեկվա|երեկոյան)$/.test(input);
|
||
},
|
||
meridiem: function (hour) {
|
||
if (hour < 4) {
|
||
return 'գիշերվա';
|
||
} else if (hour < 12) {
|
||
return 'առավոտվա';
|
||
} else if (hour < 17) {
|
||
return 'ցերեկվա';
|
||
} else {
|
||
return 'երեկոյան';
|
||
}
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'DDD':
|
||
case 'w':
|
||
case 'W':
|
||
case 'DDDo':
|
||
if (number === 1) {
|
||
return number + '-ին';
|
||
}
|
||
return number + '-րդ';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('id', {
|
||
months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),
|
||
weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
|
||
weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
|
||
weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH.mm',
|
||
LTS: 'HH.mm.ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY [pukul] HH.mm',
|
||
LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
|
||
},
|
||
meridiemParse: /pagi|siang|sore|malam/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'pagi') {
|
||
return hour;
|
||
} else if (meridiem === 'siang') {
|
||
return hour >= 11 ? hour : hour + 12;
|
||
} else if (meridiem === 'sore' || meridiem === 'malam') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours < 11) {
|
||
return 'pagi';
|
||
} else if (hours < 15) {
|
||
return 'siang';
|
||
} else if (hours < 19) {
|
||
return 'sore';
|
||
} else {
|
||
return 'malam';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[Hari ini pukul] LT',
|
||
nextDay: '[Besok pukul] LT',
|
||
nextWeek: 'dddd [pukul] LT',
|
||
lastDay: '[Kemarin pukul] LT',
|
||
lastWeek: 'dddd [lalu pukul] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'dalam %s',
|
||
past: '%s yang lalu',
|
||
s: 'beberapa detik',
|
||
ss: '%d detik',
|
||
m: 'semenit',
|
||
mm: '%d menit',
|
||
h: 'sejam',
|
||
hh: '%d jam',
|
||
d: 'sehari',
|
||
dd: '%d hari',
|
||
M: 'sebulan',
|
||
MM: '%d bulan',
|
||
y: 'setahun',
|
||
yy: '%d tahun',
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function plural$2(n) {
|
||
if (n % 100 === 11) {
|
||
return true;
|
||
} else if (n % 10 === 1) {
|
||
return false;
|
||
}
|
||
return true;
|
||
}
|
||
function translate$5(number, withoutSuffix, key, isFuture) {
|
||
var result = number + ' ';
|
||
switch (key) {
|
||
case 's':
|
||
return withoutSuffix || isFuture
|
||
? 'nokkrar sekúndur'
|
||
: 'nokkrum sekúndum';
|
||
case 'ss':
|
||
if (plural$2(number)) {
|
||
return (
|
||
result +
|
||
(withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum')
|
||
);
|
||
}
|
||
return result + 'sekúnda';
|
||
case 'm':
|
||
return withoutSuffix ? 'mínúta' : 'mínútu';
|
||
case 'mm':
|
||
if (plural$2(number)) {
|
||
return (
|
||
result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum')
|
||
);
|
||
} else if (withoutSuffix) {
|
||
return result + 'mínúta';
|
||
}
|
||
return result + 'mínútu';
|
||
case 'hh':
|
||
if (plural$2(number)) {
|
||
return (
|
||
result +
|
||
(withoutSuffix || isFuture
|
||
? 'klukkustundir'
|
||
: 'klukkustundum')
|
||
);
|
||
}
|
||
return result + 'klukkustund';
|
||
case 'd':
|
||
if (withoutSuffix) {
|
||
return 'dagur';
|
||
}
|
||
return isFuture ? 'dag' : 'degi';
|
||
case 'dd':
|
||
if (plural$2(number)) {
|
||
if (withoutSuffix) {
|
||
return result + 'dagar';
|
||
}
|
||
return result + (isFuture ? 'daga' : 'dögum');
|
||
} else if (withoutSuffix) {
|
||
return result + 'dagur';
|
||
}
|
||
return result + (isFuture ? 'dag' : 'degi');
|
||
case 'M':
|
||
if (withoutSuffix) {
|
||
return 'mánuður';
|
||
}
|
||
return isFuture ? 'mánuð' : 'mánuði';
|
||
case 'MM':
|
||
if (plural$2(number)) {
|
||
if (withoutSuffix) {
|
||
return result + 'mánuðir';
|
||
}
|
||
return result + (isFuture ? 'mánuði' : 'mánuðum');
|
||
} else if (withoutSuffix) {
|
||
return result + 'mánuður';
|
||
}
|
||
return result + (isFuture ? 'mánuð' : 'mánuði');
|
||
case 'y':
|
||
return withoutSuffix || isFuture ? 'ár' : 'ári';
|
||
case 'yy':
|
||
if (plural$2(number)) {
|
||
return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
|
||
}
|
||
return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
|
||
}
|
||
}
|
||
|
||
hooks.defineLocale('is', {
|
||
months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
|
||
weekdays:
|
||
'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
|
||
weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY [kl.] H:mm',
|
||
LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[í dag kl.] LT',
|
||
nextDay: '[á morgun kl.] LT',
|
||
nextWeek: 'dddd [kl.] LT',
|
||
lastDay: '[í gær kl.] LT',
|
||
lastWeek: '[síðasta] dddd [kl.] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'eftir %s',
|
||
past: 'fyrir %s síðan',
|
||
s: translate$5,
|
||
ss: translate$5,
|
||
m: translate$5,
|
||
mm: translate$5,
|
||
h: 'klukkustund',
|
||
hh: translate$5,
|
||
d: translate$5,
|
||
dd: translate$5,
|
||
M: translate$5,
|
||
MM: translate$5,
|
||
y: translate$5,
|
||
yy: translate$5,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('it-ch', {
|
||
months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
|
||
weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
|
||
weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Oggi alle] LT',
|
||
nextDay: '[Domani alle] LT',
|
||
nextWeek: 'dddd [alle] LT',
|
||
lastDay: '[Ieri alle] LT',
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[la scorsa] dddd [alle] LT';
|
||
default:
|
||
return '[lo scorso] dddd [alle] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: function (s) {
|
||
return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;
|
||
},
|
||
past: '%s fa',
|
||
s: 'alcuni secondi',
|
||
ss: '%d secondi',
|
||
m: 'un minuto',
|
||
mm: '%d minuti',
|
||
h: "un'ora",
|
||
hh: '%d ore',
|
||
d: 'un giorno',
|
||
dd: '%d giorni',
|
||
M: 'un mese',
|
||
MM: '%d mesi',
|
||
y: 'un anno',
|
||
yy: '%d anni',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('it', {
|
||
months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
|
||
weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
|
||
weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: function () {
|
||
return (
|
||
'[Oggi a' +
|
||
(this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
|
||
']LT'
|
||
);
|
||
},
|
||
nextDay: function () {
|
||
return (
|
||
'[Domani a' +
|
||
(this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
|
||
']LT'
|
||
);
|
||
},
|
||
nextWeek: function () {
|
||
return (
|
||
'dddd [a' +
|
||
(this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
|
||
']LT'
|
||
);
|
||
},
|
||
lastDay: function () {
|
||
return (
|
||
'[Ieri a' +
|
||
(this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
|
||
']LT'
|
||
);
|
||
},
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return (
|
||
'[La scorsa] dddd [a' +
|
||
(this.hours() > 1
|
||
? 'lle '
|
||
: this.hours() === 0
|
||
? ' '
|
||
: "ll'") +
|
||
']LT'
|
||
);
|
||
default:
|
||
return (
|
||
'[Lo scorso] dddd [a' +
|
||
(this.hours() > 1
|
||
? 'lle '
|
||
: this.hours() === 0
|
||
? ' '
|
||
: "ll'") +
|
||
']LT'
|
||
);
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'tra %s',
|
||
past: '%s fa',
|
||
s: 'alcuni secondi',
|
||
ss: '%d secondi',
|
||
m: 'un minuto',
|
||
mm: '%d minuti',
|
||
h: "un'ora",
|
||
hh: '%d ore',
|
||
d: 'un giorno',
|
||
dd: '%d giorni',
|
||
w: 'una settimana',
|
||
ww: '%d settimane',
|
||
M: 'un mese',
|
||
MM: '%d mesi',
|
||
y: 'un anno',
|
||
yy: '%d anni',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ja', {
|
||
eras: [
|
||
{
|
||
since: '2019-05-01',
|
||
offset: 1,
|
||
name: '令和',
|
||
narrow: '㋿',
|
||
abbr: 'R',
|
||
},
|
||
{
|
||
since: '1989-01-08',
|
||
until: '2019-04-30',
|
||
offset: 1,
|
||
name: '平成',
|
||
narrow: '㍻',
|
||
abbr: 'H',
|
||
},
|
||
{
|
||
since: '1926-12-25',
|
||
until: '1989-01-07',
|
||
offset: 1,
|
||
name: '昭和',
|
||
narrow: '㍼',
|
||
abbr: 'S',
|
||
},
|
||
{
|
||
since: '1912-07-30',
|
||
until: '1926-12-24',
|
||
offset: 1,
|
||
name: '大正',
|
||
narrow: '㍽',
|
||
abbr: 'T',
|
||
},
|
||
{
|
||
since: '1873-01-01',
|
||
until: '1912-07-29',
|
||
offset: 6,
|
||
name: '明治',
|
||
narrow: '㍾',
|
||
abbr: 'M',
|
||
},
|
||
{
|
||
since: '0001-01-01',
|
||
until: '1873-12-31',
|
||
offset: 1,
|
||
name: '西暦',
|
||
narrow: 'AD',
|
||
abbr: 'AD',
|
||
},
|
||
{
|
||
since: '0000-12-31',
|
||
until: -Infinity,
|
||
offset: 1,
|
||
name: '紀元前',
|
||
narrow: 'BC',
|
||
abbr: 'BC',
|
||
},
|
||
],
|
||
eraYearOrdinalRegex: /(元|\d+)年/,
|
||
eraYearOrdinalParse: function (input, match) {
|
||
return match[1] === '元' ? 1 : parseInt(match[1] || input, 10);
|
||
},
|
||
months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
|
||
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
|
||
'_'
|
||
),
|
||
weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
|
||
weekdaysShort: '日_月_火_水_木_金_土'.split('_'),
|
||
weekdaysMin: '日_月_火_水_木_金_土'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY/MM/DD',
|
||
LL: 'YYYY年M月D日',
|
||
LLL: 'YYYY年M月D日 HH:mm',
|
||
LLLL: 'YYYY年M月D日 dddd HH:mm',
|
||
l: 'YYYY/MM/DD',
|
||
ll: 'YYYY年M月D日',
|
||
lll: 'YYYY年M月D日 HH:mm',
|
||
llll: 'YYYY年M月D日(ddd) HH:mm',
|
||
},
|
||
meridiemParse: /午前|午後/i,
|
||
isPM: function (input) {
|
||
return input === '午後';
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return '午前';
|
||
} else {
|
||
return '午後';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[今日] LT',
|
||
nextDay: '[明日] LT',
|
||
nextWeek: function (now) {
|
||
if (now.week() !== this.week()) {
|
||
return '[来週]dddd LT';
|
||
} else {
|
||
return 'dddd LT';
|
||
}
|
||
},
|
||
lastDay: '[昨日] LT',
|
||
lastWeek: function (now) {
|
||
if (this.week() !== now.week()) {
|
||
return '[先週]dddd LT';
|
||
} else {
|
||
return 'dddd LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}日/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'y':
|
||
return number === 1 ? '元年' : number + '年';
|
||
case 'd':
|
||
case 'D':
|
||
case 'DDD':
|
||
return number + '日';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
relativeTime: {
|
||
future: '%s後',
|
||
past: '%s前',
|
||
s: '数秒',
|
||
ss: '%d秒',
|
||
m: '1分',
|
||
mm: '%d分',
|
||
h: '1時間',
|
||
hh: '%d時間',
|
||
d: '1日',
|
||
dd: '%d日',
|
||
M: '1ヶ月',
|
||
MM: '%dヶ月',
|
||
y: '1年',
|
||
yy: '%d年',
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('jv', {
|
||
months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
|
||
weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
|
||
weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
|
||
weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH.mm',
|
||
LTS: 'HH.mm.ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY [pukul] HH.mm',
|
||
LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
|
||
},
|
||
meridiemParse: /enjing|siyang|sonten|ndalu/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'enjing') {
|
||
return hour;
|
||
} else if (meridiem === 'siyang') {
|
||
return hour >= 11 ? hour : hour + 12;
|
||
} else if (meridiem === 'sonten' || meridiem === 'ndalu') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours < 11) {
|
||
return 'enjing';
|
||
} else if (hours < 15) {
|
||
return 'siyang';
|
||
} else if (hours < 19) {
|
||
return 'sonten';
|
||
} else {
|
||
return 'ndalu';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[Dinten puniko pukul] LT',
|
||
nextDay: '[Mbenjang pukul] LT',
|
||
nextWeek: 'dddd [pukul] LT',
|
||
lastDay: '[Kala wingi pukul] LT',
|
||
lastWeek: 'dddd [kepengker pukul] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'wonten ing %s',
|
||
past: '%s ingkang kepengker',
|
||
s: 'sawetawis detik',
|
||
ss: '%d detik',
|
||
m: 'setunggal menit',
|
||
mm: '%d menit',
|
||
h: 'setunggal jam',
|
||
hh: '%d jam',
|
||
d: 'sedinten',
|
||
dd: '%d dinten',
|
||
M: 'sewulan',
|
||
MM: '%d wulan',
|
||
y: 'setaun',
|
||
yy: '%d taun',
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ka', {
|
||
months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
|
||
weekdays: {
|
||
standalone:
|
||
'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split(
|
||
'_'
|
||
),
|
||
format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split(
|
||
'_'
|
||
),
|
||
isFormat: /(წინა|შემდეგ)/,
|
||
},
|
||
weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
|
||
weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[დღეს] LT[-ზე]',
|
||
nextDay: '[ხვალ] LT[-ზე]',
|
||
lastDay: '[გუშინ] LT[-ზე]',
|
||
nextWeek: '[შემდეგ] dddd LT[-ზე]',
|
||
lastWeek: '[წინა] dddd LT-ზე',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: function (s) {
|
||
return s.replace(
|
||
/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,
|
||
function ($0, $1, $2) {
|
||
return $2 === 'ი' ? $1 + 'ში' : $1 + $2 + 'ში';
|
||
}
|
||
);
|
||
},
|
||
past: function (s) {
|
||
if (/(წამი|წუთი|საათი|დღე|თვე)/.test(s)) {
|
||
return s.replace(/(ი|ე)$/, 'ის წინ');
|
||
}
|
||
if (/წელი/.test(s)) {
|
||
return s.replace(/წელი$/, 'წლის წინ');
|
||
}
|
||
return s;
|
||
},
|
||
s: 'რამდენიმე წამი',
|
||
ss: '%d წამი',
|
||
m: 'წუთი',
|
||
mm: '%d წუთი',
|
||
h: 'საათი',
|
||
hh: '%d საათი',
|
||
d: 'დღე',
|
||
dd: '%d დღე',
|
||
M: 'თვე',
|
||
MM: '%d თვე',
|
||
y: 'წელი',
|
||
yy: '%d წელი',
|
||
},
|
||
dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
|
||
ordinal: function (number) {
|
||
if (number === 0) {
|
||
return number;
|
||
}
|
||
if (number === 1) {
|
||
return number + '-ლი';
|
||
}
|
||
if (
|
||
number < 20 ||
|
||
(number <= 100 && number % 20 === 0) ||
|
||
number % 100 === 0
|
||
) {
|
||
return 'მე-' + number;
|
||
}
|
||
return number + '-ე';
|
||
},
|
||
week: {
|
||
dow: 1,
|
||
doy: 7,
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var suffixes$1 = {
|
||
0: '-ші',
|
||
1: '-ші',
|
||
2: '-ші',
|
||
3: '-ші',
|
||
4: '-ші',
|
||
5: '-ші',
|
||
6: '-шы',
|
||
7: '-ші',
|
||
8: '-ші',
|
||
9: '-шы',
|
||
10: '-шы',
|
||
20: '-шы',
|
||
30: '-шы',
|
||
40: '-шы',
|
||
50: '-ші',
|
||
60: '-шы',
|
||
70: '-ші',
|
||
80: '-ші',
|
||
90: '-шы',
|
||
100: '-ші',
|
||
};
|
||
|
||
hooks.defineLocale('kk', {
|
||
months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
|
||
weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
|
||
weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Бүгін сағат] LT',
|
||
nextDay: '[Ертең сағат] LT',
|
||
nextWeek: 'dddd [сағат] LT',
|
||
lastDay: '[Кеше сағат] LT',
|
||
lastWeek: '[Өткен аптаның] dddd [сағат] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s ішінде',
|
||
past: '%s бұрын',
|
||
s: 'бірнеше секунд',
|
||
ss: '%d секунд',
|
||
m: 'бір минут',
|
||
mm: '%d минут',
|
||
h: 'бір сағат',
|
||
hh: '%d сағат',
|
||
d: 'бір күн',
|
||
dd: '%d күн',
|
||
M: 'бір ай',
|
||
MM: '%d ай',
|
||
y: 'бір жыл',
|
||
yy: '%d жыл',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/,
|
||
ordinal: function (number) {
|
||
var a = number % 10,
|
||
b = number >= 100 ? 100 : null;
|
||
return number + (suffixes$1[number] || suffixes$1[a] || suffixes$1[b]);
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$a = {
|
||
1: '១',
|
||
2: '២',
|
||
3: '៣',
|
||
4: '៤',
|
||
5: '៥',
|
||
6: '៦',
|
||
7: '៧',
|
||
8: '៨',
|
||
9: '៩',
|
||
0: '០',
|
||
},
|
||
numberMap$9 = {
|
||
'១': '1',
|
||
'២': '2',
|
||
'៣': '3',
|
||
'៤': '4',
|
||
'៥': '5',
|
||
'៦': '6',
|
||
'៧': '7',
|
||
'៨': '8',
|
||
'៩': '9',
|
||
'០': '0',
|
||
};
|
||
|
||
hooks.defineLocale('km', {
|
||
months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
|
||
weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
|
||
weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /ព្រឹក|ល្ងាច/,
|
||
isPM: function (input) {
|
||
return input === 'ល្ងាច';
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'ព្រឹក';
|
||
} else {
|
||
return 'ល្ងាច';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
|
||
nextDay: '[ស្អែក ម៉ោង] LT',
|
||
nextWeek: 'dddd [ម៉ោង] LT',
|
||
lastDay: '[ម្សិលមិញ ម៉ោង] LT',
|
||
lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%sទៀត',
|
||
past: '%sមុន',
|
||
s: 'ប៉ុន្មានវិនាទី',
|
||
ss: '%d វិនាទី',
|
||
m: 'មួយនាទី',
|
||
mm: '%d នាទី',
|
||
h: 'មួយម៉ោង',
|
||
hh: '%d ម៉ោង',
|
||
d: 'មួយថ្ងៃ',
|
||
dd: '%d ថ្ងៃ',
|
||
M: 'មួយខែ',
|
||
MM: '%d ខែ',
|
||
y: 'មួយឆ្នាំ',
|
||
yy: '%d ឆ្នាំ',
|
||
},
|
||
dayOfMonthOrdinalParse: /ទី\d{1,2}/,
|
||
ordinal: 'ទី%d',
|
||
preparse: function (string) {
|
||
return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) {
|
||
return numberMap$9[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$a[match];
|
||
});
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$b = {
|
||
1: '೧',
|
||
2: '೨',
|
||
3: '೩',
|
||
4: '೪',
|
||
5: '೫',
|
||
6: '೬',
|
||
7: '೭',
|
||
8: '೮',
|
||
9: '೯',
|
||
0: '೦',
|
||
},
|
||
numberMap$a = {
|
||
'೧': '1',
|
||
'೨': '2',
|
||
'೩': '3',
|
||
'೪': '4',
|
||
'೫': '5',
|
||
'೬': '6',
|
||
'೭': '7',
|
||
'೮': '8',
|
||
'೯': '9',
|
||
'೦': '0',
|
||
};
|
||
|
||
hooks.defineLocale('kn', {
|
||
months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),
|
||
weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm',
|
||
LTS: 'A h:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, A h:mm',
|
||
LLLL: 'dddd, D MMMM YYYY, A h:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[ಇಂದು] LT',
|
||
nextDay: '[ನಾಳೆ] LT',
|
||
nextWeek: 'dddd, LT',
|
||
lastDay: '[ನಿನ್ನೆ] LT',
|
||
lastWeek: '[ಕೊನೆಯ] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s ನಂತರ',
|
||
past: '%s ಹಿಂದೆ',
|
||
s: 'ಕೆಲವು ಕ್ಷಣಗಳು',
|
||
ss: '%d ಸೆಕೆಂಡುಗಳು',
|
||
m: 'ಒಂದು ನಿಮಿಷ',
|
||
mm: '%d ನಿಮಿಷ',
|
||
h: 'ಒಂದು ಗಂಟೆ',
|
||
hh: '%d ಗಂಟೆ',
|
||
d: 'ಒಂದು ದಿನ',
|
||
dd: '%d ದಿನ',
|
||
M: 'ಒಂದು ತಿಂಗಳು',
|
||
MM: '%d ತಿಂಗಳು',
|
||
y: 'ಒಂದು ವರ್ಷ',
|
||
yy: '%d ವರ್ಷ',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) {
|
||
return numberMap$a[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$b[match];
|
||
});
|
||
},
|
||
meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'ರಾತ್ರಿ') {
|
||
return hour < 4 ? hour : hour + 12;
|
||
} else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') {
|
||
return hour;
|
||
} else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') {
|
||
return hour >= 10 ? hour : hour + 12;
|
||
} else if (meridiem === 'ಸಂಜೆ') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'ರಾತ್ರಿ';
|
||
} else if (hour < 10) {
|
||
return 'ಬೆಳಿಗ್ಗೆ';
|
||
} else if (hour < 17) {
|
||
return 'ಮಧ್ಯಾಹ್ನ';
|
||
} else if (hour < 20) {
|
||
return 'ಸಂಜೆ';
|
||
} else {
|
||
return 'ರಾತ್ರಿ';
|
||
}
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(ನೇ)/,
|
||
ordinal: function (number) {
|
||
return number + 'ನೇ';
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ko', {
|
||
months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
|
||
monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split(
|
||
'_'
|
||
),
|
||
weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
|
||
weekdaysShort: '일_월_화_수_목_금_토'.split('_'),
|
||
weekdaysMin: '일_월_화_수_목_금_토'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm',
|
||
LTS: 'A h:mm:ss',
|
||
L: 'YYYY.MM.DD.',
|
||
LL: 'YYYY년 MMMM D일',
|
||
LLL: 'YYYY년 MMMM D일 A h:mm',
|
||
LLLL: 'YYYY년 MMMM D일 dddd A h:mm',
|
||
l: 'YYYY.MM.DD.',
|
||
ll: 'YYYY년 MMMM D일',
|
||
lll: 'YYYY년 MMMM D일 A h:mm',
|
||
llll: 'YYYY년 MMMM D일 dddd A h:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '오늘 LT',
|
||
nextDay: '내일 LT',
|
||
nextWeek: 'dddd LT',
|
||
lastDay: '어제 LT',
|
||
lastWeek: '지난주 dddd LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s 후',
|
||
past: '%s 전',
|
||
s: '몇 초',
|
||
ss: '%d초',
|
||
m: '1분',
|
||
mm: '%d분',
|
||
h: '한 시간',
|
||
hh: '%d시간',
|
||
d: '하루',
|
||
dd: '%d일',
|
||
M: '한 달',
|
||
MM: '%d달',
|
||
y: '일 년',
|
||
yy: '%d년',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(일|월|주)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'd':
|
||
case 'D':
|
||
case 'DDD':
|
||
return number + '일';
|
||
case 'M':
|
||
return number + '월';
|
||
case 'w':
|
||
case 'W':
|
||
return number + '주';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
meridiemParse: /오전|오후/,
|
||
isPM: function (token) {
|
||
return token === '오후';
|
||
},
|
||
meridiem: function (hour, minute, isUpper) {
|
||
return hour < 12 ? '오전' : '오후';
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function processRelativeTime$7(num, withoutSuffix, key, isFuture) {
|
||
var format = {
|
||
s: ['çend sanîye', 'çend sanîyeyan'],
|
||
ss: [num + ' sanîye', num + ' sanîyeyan'],
|
||
m: ['deqîqeyek', 'deqîqeyekê'],
|
||
mm: [num + ' deqîqe', num + ' deqîqeyan'],
|
||
h: ['saetek', 'saetekê'],
|
||
hh: [num + ' saet', num + ' saetan'],
|
||
d: ['rojek', 'rojekê'],
|
||
dd: [num + ' roj', num + ' rojan'],
|
||
w: ['hefteyek', 'hefteyekê'],
|
||
ww: [num + ' hefte', num + ' hefteyan'],
|
||
M: ['mehek', 'mehekê'],
|
||
MM: [num + ' meh', num + ' mehan'],
|
||
y: ['salek', 'salekê'],
|
||
yy: [num + ' sal', num + ' salan'],
|
||
};
|
||
return withoutSuffix ? format[key][0] : format[key][1];
|
||
}
|
||
// function obliqueNumSuffix(num) {
|
||
// if(num.includes(':'))
|
||
// num = parseInt(num.split(':')[0]);
|
||
// else
|
||
// num = parseInt(num);
|
||
// return num == 0 || num % 10 == 1 ? 'ê'
|
||
// : (num > 10 && num % 10 == 0 ? 'î' : 'an');
|
||
// }
|
||
function ezafeNumSuffix(num) {
|
||
num = '' + num;
|
||
var l = num.substring(num.length - 1),
|
||
ll = num.length > 1 ? num.substring(num.length - 2) : '';
|
||
if (
|
||
!(ll == 12 || ll == 13) &&
|
||
(l == '2' || l == '3' || ll == '50' || l == '70' || l == '80')
|
||
)
|
||
return 'yê';
|
||
return 'ê';
|
||
}
|
||
|
||
hooks.defineLocale('ku-kmr', {
|
||
// According to the spelling rules defined by the work group of Weqfa Mezopotamyayê (Mesopotamia Foundation)
|
||
// this should be: 'Kanûna Paşîn_Sibat_Adar_Nîsan_Gulan_Hezîran_Tîrmeh_Tebax_Îlon_Çirîya Pêşîn_Çirîya Paşîn_Kanûna Pêşîn'
|
||
// But the names below are more well known and handy
|
||
months: 'Rêbendan_Sibat_Adar_Nîsan_Gulan_Hezîran_Tîrmeh_Tebax_Îlon_Cotmeh_Mijdar_Berfanbar'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Rêb_Sib_Ada_Nîs_Gul_Hez_Tîr_Teb_Îlo_Cot_Mij_Ber'.split('_'),
|
||
monthsParseExact: true,
|
||
weekdays: 'Yekşem_Duşem_Sêşem_Çarşem_Pêncşem_În_Şemî'.split('_'),
|
||
weekdaysShort: 'Yek_Du_Sê_Çar_Pên_În_Şem'.split('_'),
|
||
weekdaysMin: 'Ye_Du_Sê_Ça_Pê_În_Şe'.split('_'),
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours < 12) {
|
||
return isLower ? 'bn' : 'BN';
|
||
} else {
|
||
return isLower ? 'pn' : 'PN';
|
||
}
|
||
},
|
||
meridiemParse: /bn|BN|pn|PN/,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'Do MMMM[a] YYYY[an]',
|
||
LLL: 'Do MMMM[a] YYYY[an] HH:mm',
|
||
LLLL: 'dddd, Do MMMM[a] YYYY[an] HH:mm',
|
||
ll: 'Do MMM[.] YYYY[an]',
|
||
lll: 'Do MMM[.] YYYY[an] HH:mm',
|
||
llll: 'ddd[.], Do MMM[.] YYYY[an] HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Îro di saet] LT [de]',
|
||
nextDay: '[Sibê di saet] LT [de]',
|
||
nextWeek: 'dddd [di saet] LT [de]',
|
||
lastDay: '[Duh di saet] LT [de]',
|
||
lastWeek: 'dddd[a borî di saet] LT [de]',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'di %s de',
|
||
past: 'berî %s',
|
||
s: processRelativeTime$7,
|
||
ss: processRelativeTime$7,
|
||
m: processRelativeTime$7,
|
||
mm: processRelativeTime$7,
|
||
h: processRelativeTime$7,
|
||
hh: processRelativeTime$7,
|
||
d: processRelativeTime$7,
|
||
dd: processRelativeTime$7,
|
||
w: processRelativeTime$7,
|
||
ww: processRelativeTime$7,
|
||
M: processRelativeTime$7,
|
||
MM: processRelativeTime$7,
|
||
y: processRelativeTime$7,
|
||
yy: processRelativeTime$7,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(?:yê|ê|\.)/,
|
||
ordinal: function (num, period) {
|
||
var p = period.toLowerCase();
|
||
if (p.includes('w') || p.includes('m')) return num + '.';
|
||
|
||
return num + ezafeNumSuffix(num);
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$c = {
|
||
1: '١',
|
||
2: '٢',
|
||
3: '٣',
|
||
4: '٤',
|
||
5: '٥',
|
||
6: '٦',
|
||
7: '٧',
|
||
8: '٨',
|
||
9: '٩',
|
||
0: '٠',
|
||
},
|
||
numberMap$b = {
|
||
'١': '1',
|
||
'٢': '2',
|
||
'٣': '3',
|
||
'٤': '4',
|
||
'٥': '5',
|
||
'٦': '6',
|
||
'٧': '7',
|
||
'٨': '8',
|
||
'٩': '9',
|
||
'٠': '0',
|
||
},
|
||
months$8 = [
|
||
'کانونی دووەم',
|
||
'شوبات',
|
||
'ئازار',
|
||
'نیسان',
|
||
'ئایار',
|
||
'حوزەیران',
|
||
'تەمموز',
|
||
'ئاب',
|
||
'ئەیلوول',
|
||
'تشرینی یەكەم',
|
||
'تشرینی دووەم',
|
||
'كانونی یەکەم',
|
||
];
|
||
|
||
hooks.defineLocale('ku', {
|
||
months: months$8,
|
||
monthsShort: months$8,
|
||
weekdays:
|
||
'یهكشهممه_دووشهممه_سێشهممه_چوارشهممه_پێنجشهممه_ههینی_شهممه'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort:
|
||
'یهكشهم_دووشهم_سێشهم_چوارشهم_پێنجشهم_ههینی_شهممه'.split('_'),
|
||
weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /ئێواره|بهیانی/,
|
||
isPM: function (input) {
|
||
return /ئێواره/.test(input);
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'بهیانی';
|
||
} else {
|
||
return 'ئێواره';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[ئهمرۆ كاتژمێر] LT',
|
||
nextDay: '[بهیانی كاتژمێر] LT',
|
||
nextWeek: 'dddd [كاتژمێر] LT',
|
||
lastDay: '[دوێنێ كاتژمێر] LT',
|
||
lastWeek: 'dddd [كاتژمێر] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'له %s',
|
||
past: '%s',
|
||
s: 'چهند چركهیهك',
|
||
ss: 'چركه %d',
|
||
m: 'یهك خولهك',
|
||
mm: '%d خولهك',
|
||
h: 'یهك كاتژمێر',
|
||
hh: '%d كاتژمێر',
|
||
d: 'یهك ڕۆژ',
|
||
dd: '%d ڕۆژ',
|
||
M: 'یهك مانگ',
|
||
MM: '%d مانگ',
|
||
y: 'یهك ساڵ',
|
||
yy: '%d ساڵ',
|
||
},
|
||
preparse: function (string) {
|
||
return string
|
||
.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
|
||
return numberMap$b[match];
|
||
})
|
||
.replace(/،/g, ',');
|
||
},
|
||
postformat: function (string) {
|
||
return string
|
||
.replace(/\d/g, function (match) {
|
||
return symbolMap$c[match];
|
||
})
|
||
.replace(/,/g, '،');
|
||
},
|
||
week: {
|
||
dow: 6, // Saturday is the first day of the week.
|
||
doy: 12, // The week that contains Jan 12th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var suffixes$2 = {
|
||
0: '-чү',
|
||
1: '-чи',
|
||
2: '-чи',
|
||
3: '-чү',
|
||
4: '-чү',
|
||
5: '-чи',
|
||
6: '-чы',
|
||
7: '-чи',
|
||
8: '-чи',
|
||
9: '-чу',
|
||
10: '-чу',
|
||
20: '-чы',
|
||
30: '-чу',
|
||
40: '-чы',
|
||
50: '-чү',
|
||
60: '-чы',
|
||
70: '-чи',
|
||
80: '-чи',
|
||
90: '-чу',
|
||
100: '-чү',
|
||
};
|
||
|
||
hooks.defineLocale('ky', {
|
||
months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
|
||
weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Бүгүн саат] LT',
|
||
nextDay: '[Эртең саат] LT',
|
||
nextWeek: 'dddd [саат] LT',
|
||
lastDay: '[Кечээ саат] LT',
|
||
lastWeek: '[Өткөн аптанын] dddd [күнү] [саат] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s ичинде',
|
||
past: '%s мурун',
|
||
s: 'бирнече секунд',
|
||
ss: '%d секунд',
|
||
m: 'бир мүнөт',
|
||
mm: '%d мүнөт',
|
||
h: 'бир саат',
|
||
hh: '%d саат',
|
||
d: 'бир күн',
|
||
dd: '%d күн',
|
||
M: 'бир ай',
|
||
MM: '%d ай',
|
||
y: 'бир жыл',
|
||
yy: '%d жыл',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
|
||
ordinal: function (number) {
|
||
var a = number % 10,
|
||
b = number >= 100 ? 100 : null;
|
||
return number + (suffixes$2[number] || suffixes$2[a] || suffixes$2[b]);
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function processRelativeTime$8(number, withoutSuffix, key, isFuture) {
|
||
var format = {
|
||
m: ['eng Minutt', 'enger Minutt'],
|
||
h: ['eng Stonn', 'enger Stonn'],
|
||
d: ['een Dag', 'engem Dag'],
|
||
M: ['ee Mount', 'engem Mount'],
|
||
y: ['ee Joer', 'engem Joer'],
|
||
};
|
||
return withoutSuffix ? format[key][0] : format[key][1];
|
||
}
|
||
function processFutureTime(string) {
|
||
var number = string.substr(0, string.indexOf(' '));
|
||
if (eifelerRegelAppliesToNumber(number)) {
|
||
return 'a ' + string;
|
||
}
|
||
return 'an ' + string;
|
||
}
|
||
function processPastTime(string) {
|
||
var number = string.substr(0, string.indexOf(' '));
|
||
if (eifelerRegelAppliesToNumber(number)) {
|
||
return 'viru ' + string;
|
||
}
|
||
return 'virun ' + string;
|
||
}
|
||
/**
|
||
* Returns true if the word before the given number loses the '-n' ending.
|
||
* e.g. 'an 10 Deeg' but 'a 5 Deeg'
|
||
*
|
||
* @param number {integer}
|
||
* @returns {boolean}
|
||
*/
|
||
function eifelerRegelAppliesToNumber(number) {
|
||
number = parseInt(number, 10);
|
||
if (isNaN(number)) {
|
||
return false;
|
||
}
|
||
if (number < 0) {
|
||
// Negative Number --> always true
|
||
return true;
|
||
} else if (number < 10) {
|
||
// Only 1 digit
|
||
if (4 <= number && number <= 7) {
|
||
return true;
|
||
}
|
||
return false;
|
||
} else if (number < 100) {
|
||
// 2 digits
|
||
var lastDigit = number % 10,
|
||
firstDigit = number / 10;
|
||
if (lastDigit === 0) {
|
||
return eifelerRegelAppliesToNumber(firstDigit);
|
||
}
|
||
return eifelerRegelAppliesToNumber(lastDigit);
|
||
} else if (number < 10000) {
|
||
// 3 or 4 digits --> recursively check first digit
|
||
while (number >= 10) {
|
||
number = number / 10;
|
||
}
|
||
return eifelerRegelAppliesToNumber(number);
|
||
} else {
|
||
// Anything larger than 4 digits: recursively check first n-3 digits
|
||
number = number / 1000;
|
||
return eifelerRegelAppliesToNumber(number);
|
||
}
|
||
}
|
||
|
||
hooks.defineLocale('lb', {
|
||
months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays:
|
||
'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
|
||
weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm [Auer]',
|
||
LTS: 'H:mm:ss [Auer]',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY H:mm [Auer]',
|
||
LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Haut um] LT',
|
||
sameElse: 'L',
|
||
nextDay: '[Muer um] LT',
|
||
nextWeek: 'dddd [um] LT',
|
||
lastDay: '[Gëschter um] LT',
|
||
lastWeek: function () {
|
||
// Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
|
||
switch (this.day()) {
|
||
case 2:
|
||
case 4:
|
||
return '[Leschten] dddd [um] LT';
|
||
default:
|
||
return '[Leschte] dddd [um] LT';
|
||
}
|
||
},
|
||
},
|
||
relativeTime: {
|
||
future: processFutureTime,
|
||
past: processPastTime,
|
||
s: 'e puer Sekonnen',
|
||
ss: '%d Sekonnen',
|
||
m: processRelativeTime$8,
|
||
mm: '%d Minutten',
|
||
h: processRelativeTime$8,
|
||
hh: '%d Stonnen',
|
||
d: processRelativeTime$8,
|
||
dd: '%d Deeg',
|
||
M: processRelativeTime$8,
|
||
MM: '%d Méint',
|
||
y: processRelativeTime$8,
|
||
yy: '%d Joer',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('lo', {
|
||
months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
|
||
weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
|
||
weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'ວັນdddd D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
|
||
isPM: function (input) {
|
||
return input === 'ຕອນແລງ';
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'ຕອນເຊົ້າ';
|
||
} else {
|
||
return 'ຕອນແລງ';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[ມື້ນີ້ເວລາ] LT',
|
||
nextDay: '[ມື້ອື່ນເວລາ] LT',
|
||
nextWeek: '[ວັນ]dddd[ໜ້າເວລາ] LT',
|
||
lastDay: '[ມື້ວານນີ້ເວລາ] LT',
|
||
lastWeek: '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'ອີກ %s',
|
||
past: '%sຜ່ານມາ',
|
||
s: 'ບໍ່ເທົ່າໃດວິນາທີ',
|
||
ss: '%d ວິນາທີ',
|
||
m: '1 ນາທີ',
|
||
mm: '%d ນາທີ',
|
||
h: '1 ຊົ່ວໂມງ',
|
||
hh: '%d ຊົ່ວໂມງ',
|
||
d: '1 ມື້',
|
||
dd: '%d ມື້',
|
||
M: '1 ເດືອນ',
|
||
MM: '%d ເດືອນ',
|
||
y: '1 ປີ',
|
||
yy: '%d ປີ',
|
||
},
|
||
dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/,
|
||
ordinal: function (number) {
|
||
return 'ທີ່' + number;
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var units = {
|
||
ss: 'sekundė_sekundžių_sekundes',
|
||
m: 'minutė_minutės_minutę',
|
||
mm: 'minutės_minučių_minutes',
|
||
h: 'valanda_valandos_valandą',
|
||
hh: 'valandos_valandų_valandas',
|
||
d: 'diena_dienos_dieną',
|
||
dd: 'dienos_dienų_dienas',
|
||
M: 'mėnuo_mėnesio_mėnesį',
|
||
MM: 'mėnesiai_mėnesių_mėnesius',
|
||
y: 'metai_metų_metus',
|
||
yy: 'metai_metų_metus',
|
||
};
|
||
function translateSeconds(number, withoutSuffix, key, isFuture) {
|
||
if (withoutSuffix) {
|
||
return 'kelios sekundės';
|
||
} else {
|
||
return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
|
||
}
|
||
}
|
||
function translateSingular(number, withoutSuffix, key, isFuture) {
|
||
return withoutSuffix
|
||
? forms(key)[0]
|
||
: isFuture
|
||
? forms(key)[1]
|
||
: forms(key)[2];
|
||
}
|
||
function special(number) {
|
||
return number % 10 === 0 || (number > 10 && number < 20);
|
||
}
|
||
function forms(key) {
|
||
return units[key].split('_');
|
||
}
|
||
function translate$6(number, withoutSuffix, key, isFuture) {
|
||
var result = number + ' ';
|
||
if (number === 1) {
|
||
return (
|
||
result + translateSingular(number, withoutSuffix, key[0], isFuture)
|
||
);
|
||
} else if (withoutSuffix) {
|
||
return result + (special(number) ? forms(key)[1] : forms(key)[0]);
|
||
} else {
|
||
if (isFuture) {
|
||
return result + forms(key)[1];
|
||
} else {
|
||
return result + (special(number) ? forms(key)[1] : forms(key)[2]);
|
||
}
|
||
}
|
||
}
|
||
hooks.defineLocale('lt', {
|
||
months: {
|
||
format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split(
|
||
'_'
|
||
),
|
||
isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,
|
||
},
|
||
monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
|
||
weekdays: {
|
||
format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split(
|
||
'_'
|
||
),
|
||
isFormat: /dddd HH:mm/,
|
||
},
|
||
weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
|
||
weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY-MM-DD',
|
||
LL: 'YYYY [m.] MMMM D [d.]',
|
||
LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
|
||
LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
|
||
l: 'YYYY-MM-DD',
|
||
ll: 'YYYY [m.] MMMM D [d.]',
|
||
lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
|
||
llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Šiandien] LT',
|
||
nextDay: '[Rytoj] LT',
|
||
nextWeek: 'dddd LT',
|
||
lastDay: '[Vakar] LT',
|
||
lastWeek: '[Praėjusį] dddd LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'po %s',
|
||
past: 'prieš %s',
|
||
s: translateSeconds,
|
||
ss: translate$6,
|
||
m: translateSingular,
|
||
mm: translate$6,
|
||
h: translateSingular,
|
||
hh: translate$6,
|
||
d: translateSingular,
|
||
dd: translate$6,
|
||
M: translateSingular,
|
||
MM: translate$6,
|
||
y: translateSingular,
|
||
yy: translate$6,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-oji/,
|
||
ordinal: function (number) {
|
||
return number + '-oji';
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var units$1 = {
|
||
ss: 'sekundes_sekundēm_sekunde_sekundes'.split('_'),
|
||
m: 'minūtes_minūtēm_minūte_minūtes'.split('_'),
|
||
mm: 'minūtes_minūtēm_minūte_minūtes'.split('_'),
|
||
h: 'stundas_stundām_stunda_stundas'.split('_'),
|
||
hh: 'stundas_stundām_stunda_stundas'.split('_'),
|
||
d: 'dienas_dienām_diena_dienas'.split('_'),
|
||
dd: 'dienas_dienām_diena_dienas'.split('_'),
|
||
M: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
|
||
MM: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
|
||
y: 'gada_gadiem_gads_gadi'.split('_'),
|
||
yy: 'gada_gadiem_gads_gadi'.split('_'),
|
||
};
|
||
/**
|
||
* @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
|
||
*/
|
||
function format$1(forms, number, withoutSuffix) {
|
||
if (withoutSuffix) {
|
||
// E.g. "21 minūte", "3 minūtes".
|
||
return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];
|
||
} else {
|
||
// E.g. "21 minūtes" as in "pēc 21 minūtes".
|
||
// E.g. "3 minūtēm" as in "pēc 3 minūtēm".
|
||
return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];
|
||
}
|
||
}
|
||
function relativeTimeWithPlural$1(number, withoutSuffix, key) {
|
||
return number + ' ' + format$1(units$1[key], number, withoutSuffix);
|
||
}
|
||
function relativeTimeWithSingular(number, withoutSuffix, key) {
|
||
return format$1(units$1[key], number, withoutSuffix);
|
||
}
|
||
function relativeSeconds(number, withoutSuffix) {
|
||
return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
|
||
}
|
||
|
||
hooks.defineLocale('lv', {
|
||
months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
|
||
weekdays:
|
||
'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),
|
||
weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY.',
|
||
LL: 'YYYY. [gada] D. MMMM',
|
||
LLL: 'YYYY. [gada] D. MMMM, HH:mm',
|
||
LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Šodien pulksten] LT',
|
||
nextDay: '[Rīt pulksten] LT',
|
||
nextWeek: 'dddd [pulksten] LT',
|
||
lastDay: '[Vakar pulksten] LT',
|
||
lastWeek: '[Pagājušā] dddd [pulksten] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'pēc %s',
|
||
past: 'pirms %s',
|
||
s: relativeSeconds,
|
||
ss: relativeTimeWithPlural$1,
|
||
m: relativeTimeWithSingular,
|
||
mm: relativeTimeWithPlural$1,
|
||
h: relativeTimeWithSingular,
|
||
hh: relativeTimeWithPlural$1,
|
||
d: relativeTimeWithSingular,
|
||
dd: relativeTimeWithPlural$1,
|
||
M: relativeTimeWithSingular,
|
||
MM: relativeTimeWithPlural$1,
|
||
y: relativeTimeWithSingular,
|
||
yy: relativeTimeWithPlural$1,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var translator = {
|
||
words: {
|
||
//Different grammatical cases
|
||
ss: ['sekund', 'sekunda', 'sekundi'],
|
||
m: ['jedan minut', 'jednog minuta'],
|
||
mm: ['minut', 'minuta', 'minuta'],
|
||
h: ['jedan sat', 'jednog sata'],
|
||
hh: ['sat', 'sata', 'sati'],
|
||
dd: ['dan', 'dana', 'dana'],
|
||
MM: ['mjesec', 'mjeseca', 'mjeseci'],
|
||
yy: ['godina', 'godine', 'godina'],
|
||
},
|
||
correctGrammaticalCase: function (number, wordKey) {
|
||
return number === 1
|
||
? wordKey[0]
|
||
: number >= 2 && number <= 4
|
||
? wordKey[1]
|
||
: wordKey[2];
|
||
},
|
||
translate: function (number, withoutSuffix, key) {
|
||
var wordKey = translator.words[key];
|
||
if (key.length === 1) {
|
||
return withoutSuffix ? wordKey[0] : wordKey[1];
|
||
} else {
|
||
return (
|
||
number +
|
||
' ' +
|
||
translator.correctGrammaticalCase(number, wordKey)
|
||
);
|
||
}
|
||
},
|
||
};
|
||
|
||
hooks.defineLocale('me', {
|
||
months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
|
||
monthsParseExact: true,
|
||
weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
|
||
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY H:mm',
|
||
LLLL: 'dddd, D. MMMM YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[danas u] LT',
|
||
nextDay: '[sjutra u] LT',
|
||
|
||
nextWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[u] [nedjelju] [u] LT';
|
||
case 3:
|
||
return '[u] [srijedu] [u] LT';
|
||
case 6:
|
||
return '[u] [subotu] [u] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[u] dddd [u] LT';
|
||
}
|
||
},
|
||
lastDay: '[juče u] LT',
|
||
lastWeek: function () {
|
||
var lastWeekDays = [
|
||
'[prošle] [nedjelje] [u] LT',
|
||
'[prošlog] [ponedjeljka] [u] LT',
|
||
'[prošlog] [utorka] [u] LT',
|
||
'[prošle] [srijede] [u] LT',
|
||
'[prošlog] [četvrtka] [u] LT',
|
||
'[prošlog] [petka] [u] LT',
|
||
'[prošle] [subote] [u] LT',
|
||
];
|
||
return lastWeekDays[this.day()];
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'za %s',
|
||
past: 'prije %s',
|
||
s: 'nekoliko sekundi',
|
||
ss: translator.translate,
|
||
m: translator.translate,
|
||
mm: translator.translate,
|
||
h: translator.translate,
|
||
hh: translator.translate,
|
||
d: 'dan',
|
||
dd: translator.translate,
|
||
M: 'mjesec',
|
||
MM: translator.translate,
|
||
y: 'godinu',
|
||
yy: translator.translate,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('mi', {
|
||
months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split(
|
||
'_'
|
||
),
|
||
monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
|
||
monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
|
||
monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
|
||
monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,
|
||
weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
|
||
weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
|
||
weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY [i] HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY [i] HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[i teie mahana, i] LT',
|
||
nextDay: '[apopo i] LT',
|
||
nextWeek: 'dddd [i] LT',
|
||
lastDay: '[inanahi i] LT',
|
||
lastWeek: 'dddd [whakamutunga i] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'i roto i %s',
|
||
past: '%s i mua',
|
||
s: 'te hēkona ruarua',
|
||
ss: '%d hēkona',
|
||
m: 'he meneti',
|
||
mm: '%d meneti',
|
||
h: 'te haora',
|
||
hh: '%d haora',
|
||
d: 'he ra',
|
||
dd: '%d ra',
|
||
M: 'he marama',
|
||
MM: '%d marama',
|
||
y: 'he tau',
|
||
yy: '%d tau',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('mk', {
|
||
months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
|
||
weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
|
||
weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'D.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY H:mm',
|
||
LLLL: 'dddd, D MMMM YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Денес во] LT',
|
||
nextDay: '[Утре во] LT',
|
||
nextWeek: '[Во] dddd [во] LT',
|
||
lastDay: '[Вчера во] LT',
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
case 3:
|
||
case 6:
|
||
return '[Изминатата] dddd [во] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[Изминатиот] dddd [во] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'за %s',
|
||
past: 'пред %s',
|
||
s: 'неколку секунди',
|
||
ss: '%d секунди',
|
||
m: 'една минута',
|
||
mm: '%d минути',
|
||
h: 'еден час',
|
||
hh: '%d часа',
|
||
d: 'еден ден',
|
||
dd: '%d дена',
|
||
M: 'еден месец',
|
||
MM: '%d месеци',
|
||
y: 'една година',
|
||
yy: '%d години',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
|
||
ordinal: function (number) {
|
||
var lastDigit = number % 10,
|
||
last2Digits = number % 100;
|
||
if (number === 0) {
|
||
return number + '-ев';
|
||
} else if (last2Digits === 0) {
|
||
return number + '-ен';
|
||
} else if (last2Digits > 10 && last2Digits < 20) {
|
||
return number + '-ти';
|
||
} else if (lastDigit === 1) {
|
||
return number + '-ви';
|
||
} else if (lastDigit === 2) {
|
||
return number + '-ри';
|
||
} else if (lastDigit === 7 || lastDigit === 8) {
|
||
return number + '-ми';
|
||
} else {
|
||
return number + '-ти';
|
||
}
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ml', {
|
||
months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays:
|
||
'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
|
||
weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm -നു',
|
||
LTS: 'A h:mm:ss -നു',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, A h:mm -നു',
|
||
LLLL: 'dddd, D MMMM YYYY, A h:mm -നു',
|
||
},
|
||
calendar: {
|
||
sameDay: '[ഇന്ന്] LT',
|
||
nextDay: '[നാളെ] LT',
|
||
nextWeek: 'dddd, LT',
|
||
lastDay: '[ഇന്നലെ] LT',
|
||
lastWeek: '[കഴിഞ്ഞ] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s കഴിഞ്ഞ്',
|
||
past: '%s മുൻപ്',
|
||
s: 'അൽപ നിമിഷങ്ങൾ',
|
||
ss: '%d സെക്കൻഡ്',
|
||
m: 'ഒരു മിനിറ്റ്',
|
||
mm: '%d മിനിറ്റ്',
|
||
h: 'ഒരു മണിക്കൂർ',
|
||
hh: '%d മണിക്കൂർ',
|
||
d: 'ഒരു ദിവസം',
|
||
dd: '%d ദിവസം',
|
||
M: 'ഒരു മാസം',
|
||
MM: '%d മാസം',
|
||
y: 'ഒരു വർഷം',
|
||
yy: '%d വർഷം',
|
||
},
|
||
meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (
|
||
(meridiem === 'രാത്രി' && hour >= 4) ||
|
||
meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||
|
||
meridiem === 'വൈകുന്നേരം'
|
||
) {
|
||
return hour + 12;
|
||
} else {
|
||
return hour;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'രാത്രി';
|
||
} else if (hour < 12) {
|
||
return 'രാവിലെ';
|
||
} else if (hour < 17) {
|
||
return 'ഉച്ച കഴിഞ്ഞ്';
|
||
} else if (hour < 20) {
|
||
return 'വൈകുന്നേരം';
|
||
} else {
|
||
return 'രാത്രി';
|
||
}
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function translate$7(number, withoutSuffix, key, isFuture) {
|
||
switch (key) {
|
||
case 's':
|
||
return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';
|
||
case 'ss':
|
||
return number + (withoutSuffix ? ' секунд' : ' секундын');
|
||
case 'm':
|
||
case 'mm':
|
||
return number + (withoutSuffix ? ' минут' : ' минутын');
|
||
case 'h':
|
||
case 'hh':
|
||
return number + (withoutSuffix ? ' цаг' : ' цагийн');
|
||
case 'd':
|
||
case 'dd':
|
||
return number + (withoutSuffix ? ' өдөр' : ' өдрийн');
|
||
case 'M':
|
||
case 'MM':
|
||
return number + (withoutSuffix ? ' сар' : ' сарын');
|
||
case 'y':
|
||
case 'yy':
|
||
return number + (withoutSuffix ? ' жил' : ' жилийн');
|
||
default:
|
||
return number;
|
||
}
|
||
}
|
||
|
||
hooks.defineLocale('mn', {
|
||
months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),
|
||
weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
|
||
weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY-MM-DD',
|
||
LL: 'YYYY оны MMMMын D',
|
||
LLL: 'YYYY оны MMMMын D HH:mm',
|
||
LLLL: 'dddd, YYYY оны MMMMын D HH:mm',
|
||
},
|
||
meridiemParse: /ҮӨ|ҮХ/i,
|
||
isPM: function (input) {
|
||
return input === 'ҮХ';
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'ҮӨ';
|
||
} else {
|
||
return 'ҮХ';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[Өнөөдөр] LT',
|
||
nextDay: '[Маргааш] LT',
|
||
nextWeek: '[Ирэх] dddd LT',
|
||
lastDay: '[Өчигдөр] LT',
|
||
lastWeek: '[Өнгөрсөн] dddd LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s дараа',
|
||
past: '%s өмнө',
|
||
s: translate$7,
|
||
ss: translate$7,
|
||
m: translate$7,
|
||
mm: translate$7,
|
||
h: translate$7,
|
||
hh: translate$7,
|
||
d: translate$7,
|
||
dd: translate$7,
|
||
M: translate$7,
|
||
MM: translate$7,
|
||
y: translate$7,
|
||
yy: translate$7,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2} өдөр/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'd':
|
||
case 'D':
|
||
case 'DDD':
|
||
return number + ' өдөр';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$d = {
|
||
1: '१',
|
||
2: '२',
|
||
3: '३',
|
||
4: '४',
|
||
5: '५',
|
||
6: '६',
|
||
7: '७',
|
||
8: '८',
|
||
9: '९',
|
||
0: '०',
|
||
},
|
||
numberMap$c = {
|
||
'१': '1',
|
||
'२': '2',
|
||
'३': '3',
|
||
'४': '4',
|
||
'५': '5',
|
||
'६': '6',
|
||
'७': '7',
|
||
'८': '8',
|
||
'९': '9',
|
||
'०': '0',
|
||
};
|
||
|
||
function relativeTimeMr(number, withoutSuffix, string, isFuture) {
|
||
var output = '';
|
||
if (withoutSuffix) {
|
||
switch (string) {
|
||
case 's':
|
||
output = 'काही सेकंद';
|
||
break;
|
||
case 'ss':
|
||
output = '%d सेकंद';
|
||
break;
|
||
case 'm':
|
||
output = 'एक मिनिट';
|
||
break;
|
||
case 'mm':
|
||
output = '%d मिनिटे';
|
||
break;
|
||
case 'h':
|
||
output = 'एक तास';
|
||
break;
|
||
case 'hh':
|
||
output = '%d तास';
|
||
break;
|
||
case 'd':
|
||
output = 'एक दिवस';
|
||
break;
|
||
case 'dd':
|
||
output = '%d दिवस';
|
||
break;
|
||
case 'M':
|
||
output = 'एक महिना';
|
||
break;
|
||
case 'MM':
|
||
output = '%d महिने';
|
||
break;
|
||
case 'y':
|
||
output = 'एक वर्ष';
|
||
break;
|
||
case 'yy':
|
||
output = '%d वर्षे';
|
||
break;
|
||
}
|
||
} else {
|
||
switch (string) {
|
||
case 's':
|
||
output = 'काही सेकंदां';
|
||
break;
|
||
case 'ss':
|
||
output = '%d सेकंदां';
|
||
break;
|
||
case 'm':
|
||
output = 'एका मिनिटा';
|
||
break;
|
||
case 'mm':
|
||
output = '%d मिनिटां';
|
||
break;
|
||
case 'h':
|
||
output = 'एका तासा';
|
||
break;
|
||
case 'hh':
|
||
output = '%d तासां';
|
||
break;
|
||
case 'd':
|
||
output = 'एका दिवसा';
|
||
break;
|
||
case 'dd':
|
||
output = '%d दिवसां';
|
||
break;
|
||
case 'M':
|
||
output = 'एका महिन्या';
|
||
break;
|
||
case 'MM':
|
||
output = '%d महिन्यां';
|
||
break;
|
||
case 'y':
|
||
output = 'एका वर्षा';
|
||
break;
|
||
case 'yy':
|
||
output = '%d वर्षां';
|
||
break;
|
||
}
|
||
}
|
||
return output.replace(/%d/i, number);
|
||
}
|
||
|
||
hooks.defineLocale('mr', {
|
||
months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
|
||
weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
|
||
weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm वाजता',
|
||
LTS: 'A h:mm:ss वाजता',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, A h:mm वाजता',
|
||
LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता',
|
||
},
|
||
calendar: {
|
||
sameDay: '[आज] LT',
|
||
nextDay: '[उद्या] LT',
|
||
nextWeek: 'dddd, LT',
|
||
lastDay: '[काल] LT',
|
||
lastWeek: '[मागील] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%sमध्ये',
|
||
past: '%sपूर्वी',
|
||
s: relativeTimeMr,
|
||
ss: relativeTimeMr,
|
||
m: relativeTimeMr,
|
||
mm: relativeTimeMr,
|
||
h: relativeTimeMr,
|
||
hh: relativeTimeMr,
|
||
d: relativeTimeMr,
|
||
dd: relativeTimeMr,
|
||
M: relativeTimeMr,
|
||
MM: relativeTimeMr,
|
||
y: relativeTimeMr,
|
||
yy: relativeTimeMr,
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[१२३४५६७८९०]/g, function (match) {
|
||
return numberMap$c[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$d[match];
|
||
});
|
||
},
|
||
meridiemParse: /पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'पहाटे' || meridiem === 'सकाळी') {
|
||
return hour;
|
||
} else if (
|
||
meridiem === 'दुपारी' ||
|
||
meridiem === 'सायंकाळी' ||
|
||
meridiem === 'रात्री'
|
||
) {
|
||
return hour >= 12 ? hour : hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour >= 0 && hour < 6) {
|
||
return 'पहाटे';
|
||
} else if (hour < 12) {
|
||
return 'सकाळी';
|
||
} else if (hour < 17) {
|
||
return 'दुपारी';
|
||
} else if (hour < 20) {
|
||
return 'सायंकाळी';
|
||
} else {
|
||
return 'रात्री';
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ms-my', {
|
||
months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
|
||
weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
|
||
weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
|
||
weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH.mm',
|
||
LTS: 'HH.mm.ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY [pukul] HH.mm',
|
||
LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
|
||
},
|
||
meridiemParse: /pagi|tengahari|petang|malam/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'pagi') {
|
||
return hour;
|
||
} else if (meridiem === 'tengahari') {
|
||
return hour >= 11 ? hour : hour + 12;
|
||
} else if (meridiem === 'petang' || meridiem === 'malam') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours < 11) {
|
||
return 'pagi';
|
||
} else if (hours < 15) {
|
||
return 'tengahari';
|
||
} else if (hours < 19) {
|
||
return 'petang';
|
||
} else {
|
||
return 'malam';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[Hari ini pukul] LT',
|
||
nextDay: '[Esok pukul] LT',
|
||
nextWeek: 'dddd [pukul] LT',
|
||
lastDay: '[Kelmarin pukul] LT',
|
||
lastWeek: 'dddd [lepas pukul] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'dalam %s',
|
||
past: '%s yang lepas',
|
||
s: 'beberapa saat',
|
||
ss: '%d saat',
|
||
m: 'seminit',
|
||
mm: '%d minit',
|
||
h: 'sejam',
|
||
hh: '%d jam',
|
||
d: 'sehari',
|
||
dd: '%d hari',
|
||
M: 'sebulan',
|
||
MM: '%d bulan',
|
||
y: 'setahun',
|
||
yy: '%d tahun',
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ms', {
|
||
months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
|
||
weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
|
||
weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
|
||
weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH.mm',
|
||
LTS: 'HH.mm.ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY [pukul] HH.mm',
|
||
LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
|
||
},
|
||
meridiemParse: /pagi|tengahari|petang|malam/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'pagi') {
|
||
return hour;
|
||
} else if (meridiem === 'tengahari') {
|
||
return hour >= 11 ? hour : hour + 12;
|
||
} else if (meridiem === 'petang' || meridiem === 'malam') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours < 11) {
|
||
return 'pagi';
|
||
} else if (hours < 15) {
|
||
return 'tengahari';
|
||
} else if (hours < 19) {
|
||
return 'petang';
|
||
} else {
|
||
return 'malam';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[Hari ini pukul] LT',
|
||
nextDay: '[Esok pukul] LT',
|
||
nextWeek: 'dddd [pukul] LT',
|
||
lastDay: '[Kelmarin pukul] LT',
|
||
lastWeek: 'dddd [lepas pukul] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'dalam %s',
|
||
past: '%s yang lepas',
|
||
s: 'beberapa saat',
|
||
ss: '%d saat',
|
||
m: 'seminit',
|
||
mm: '%d minit',
|
||
h: 'sejam',
|
||
hh: '%d jam',
|
||
d: 'sehari',
|
||
dd: '%d hari',
|
||
M: 'sebulan',
|
||
MM: '%d bulan',
|
||
y: 'setahun',
|
||
yy: '%d tahun',
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('mt', {
|
||
months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),
|
||
weekdays:
|
||
'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),
|
||
weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Illum fil-]LT',
|
||
nextDay: '[Għada fil-]LT',
|
||
nextWeek: 'dddd [fil-]LT',
|
||
lastDay: '[Il-bieraħ fil-]LT',
|
||
lastWeek: 'dddd [li għadda] [fil-]LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'f’ %s',
|
||
past: '%s ilu',
|
||
s: 'ftit sekondi',
|
||
ss: '%d sekondi',
|
||
m: 'minuta',
|
||
mm: '%d minuti',
|
||
h: 'siegħa',
|
||
hh: '%d siegħat',
|
||
d: 'ġurnata',
|
||
dd: '%d ġranet',
|
||
M: 'xahar',
|
||
MM: '%d xhur',
|
||
y: 'sena',
|
||
yy: '%d sni',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$e = {
|
||
1: '၁',
|
||
2: '၂',
|
||
3: '၃',
|
||
4: '၄',
|
||
5: '၅',
|
||
6: '၆',
|
||
7: '၇',
|
||
8: '၈',
|
||
9: '၉',
|
||
0: '၀',
|
||
},
|
||
numberMap$d = {
|
||
'၁': '1',
|
||
'၂': '2',
|
||
'၃': '3',
|
||
'၄': '4',
|
||
'၅': '5',
|
||
'၆': '6',
|
||
'၇': '7',
|
||
'၈': '8',
|
||
'၉': '9',
|
||
'၀': '0',
|
||
};
|
||
|
||
hooks.defineLocale('my', {
|
||
months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
|
||
weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
|
||
weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
|
||
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[ယနေ.] LT [မှာ]',
|
||
nextDay: '[မနက်ဖြန်] LT [မှာ]',
|
||
nextWeek: 'dddd LT [မှာ]',
|
||
lastDay: '[မနေ.က] LT [မှာ]',
|
||
lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'လာမည့် %s မှာ',
|
||
past: 'လွန်ခဲ့သော %s က',
|
||
s: 'စက္ကန်.အနည်းငယ်',
|
||
ss: '%d စက္ကန့်',
|
||
m: 'တစ်မိနစ်',
|
||
mm: '%d မိနစ်',
|
||
h: 'တစ်နာရီ',
|
||
hh: '%d နာရီ',
|
||
d: 'တစ်ရက်',
|
||
dd: '%d ရက်',
|
||
M: 'တစ်လ',
|
||
MM: '%d လ',
|
||
y: 'တစ်နှစ်',
|
||
yy: '%d နှစ်',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
|
||
return numberMap$d[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$e[match];
|
||
});
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('nb', {
|
||
months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
|
||
monthsParseExact: true,
|
||
weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
|
||
weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),
|
||
weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY [kl.] HH:mm',
|
||
LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[i dag kl.] LT',
|
||
nextDay: '[i morgen kl.] LT',
|
||
nextWeek: 'dddd [kl.] LT',
|
||
lastDay: '[i går kl.] LT',
|
||
lastWeek: '[forrige] dddd [kl.] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'om %s',
|
||
past: '%s siden',
|
||
s: 'noen sekunder',
|
||
ss: '%d sekunder',
|
||
m: 'ett minutt',
|
||
mm: '%d minutter',
|
||
h: 'én time',
|
||
hh: '%d timer',
|
||
d: 'én dag',
|
||
dd: '%d dager',
|
||
w: 'én uke',
|
||
ww: '%d uker',
|
||
M: 'én måned',
|
||
MM: '%d måneder',
|
||
y: 'ett år',
|
||
yy: '%d år',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$f = {
|
||
1: '१',
|
||
2: '२',
|
||
3: '३',
|
||
4: '४',
|
||
5: '५',
|
||
6: '६',
|
||
7: '७',
|
||
8: '८',
|
||
9: '९',
|
||
0: '०',
|
||
},
|
||
numberMap$e = {
|
||
'१': '1',
|
||
'२': '2',
|
||
'३': '3',
|
||
'४': '4',
|
||
'५': '5',
|
||
'६': '6',
|
||
'७': '7',
|
||
'८': '8',
|
||
'९': '9',
|
||
'०': '0',
|
||
};
|
||
|
||
hooks.defineLocale('ne', {
|
||
months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
|
||
weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'Aको h:mm बजे',
|
||
LTS: 'Aको h:mm:ss बजे',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, Aको h:mm बजे',
|
||
LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[१२३४५६७८९०]/g, function (match) {
|
||
return numberMap$e[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$f[match];
|
||
});
|
||
},
|
||
meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'राति') {
|
||
return hour < 4 ? hour : hour + 12;
|
||
} else if (meridiem === 'बिहान') {
|
||
return hour;
|
||
} else if (meridiem === 'दिउँसो') {
|
||
return hour >= 10 ? hour : hour + 12;
|
||
} else if (meridiem === 'साँझ') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 3) {
|
||
return 'राति';
|
||
} else if (hour < 12) {
|
||
return 'बिहान';
|
||
} else if (hour < 16) {
|
||
return 'दिउँसो';
|
||
} else if (hour < 20) {
|
||
return 'साँझ';
|
||
} else {
|
||
return 'राति';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[आज] LT',
|
||
nextDay: '[भोलि] LT',
|
||
nextWeek: '[आउँदो] dddd[,] LT',
|
||
lastDay: '[हिजो] LT',
|
||
lastWeek: '[गएको] dddd[,] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%sमा',
|
||
past: '%s अगाडि',
|
||
s: 'केही क्षण',
|
||
ss: '%d सेकेण्ड',
|
||
m: 'एक मिनेट',
|
||
mm: '%d मिनेट',
|
||
h: 'एक घण्टा',
|
||
hh: '%d घण्टा',
|
||
d: 'एक दिन',
|
||
dd: '%d दिन',
|
||
M: 'एक महिना',
|
||
MM: '%d महिना',
|
||
y: 'एक बर्ष',
|
||
yy: '%d बर्ष',
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var monthsShortWithDots$1 =
|
||
'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),
|
||
monthsShortWithoutDots$1 =
|
||
'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'),
|
||
monthsParse$8 = [
|
||
/^jan/i,
|
||
/^feb/i,
|
||
/^(maart|mrt\.?)$/i,
|
||
/^apr/i,
|
||
/^mei$/i,
|
||
/^jun[i.]?$/i,
|
||
/^jul[i.]?$/i,
|
||
/^aug/i,
|
||
/^sep/i,
|
||
/^okt/i,
|
||
/^nov/i,
|
||
/^dec/i,
|
||
],
|
||
monthsRegex$8 =
|
||
/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
|
||
|
||
hooks.defineLocale('nl-be', {
|
||
months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(
|
||
'_'
|
||
),
|
||
monthsShort: function (m, format) {
|
||
if (!m) {
|
||
return monthsShortWithDots$1;
|
||
} else if (/-MMM-/.test(format)) {
|
||
return monthsShortWithoutDots$1[m.month()];
|
||
} else {
|
||
return monthsShortWithDots$1[m.month()];
|
||
}
|
||
},
|
||
|
||
monthsRegex: monthsRegex$8,
|
||
monthsShortRegex: monthsRegex$8,
|
||
monthsStrictRegex:
|
||
/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
|
||
monthsShortStrictRegex:
|
||
/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
|
||
|
||
monthsParse: monthsParse$8,
|
||
longMonthsParse: monthsParse$8,
|
||
shortMonthsParse: monthsParse$8,
|
||
|
||
weekdays:
|
||
'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
|
||
weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
|
||
weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[vandaag om] LT',
|
||
nextDay: '[morgen om] LT',
|
||
nextWeek: 'dddd [om] LT',
|
||
lastDay: '[gisteren om] LT',
|
||
lastWeek: '[afgelopen] dddd [om] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'over %s',
|
||
past: '%s geleden',
|
||
s: 'een paar seconden',
|
||
ss: '%d seconden',
|
||
m: 'één minuut',
|
||
mm: '%d minuten',
|
||
h: 'één uur',
|
||
hh: '%d uur',
|
||
d: 'één dag',
|
||
dd: '%d dagen',
|
||
M: 'één maand',
|
||
MM: '%d maanden',
|
||
y: 'één jaar',
|
||
yy: '%d jaar',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
|
||
ordinal: function (number) {
|
||
return (
|
||
number +
|
||
(number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
|
||
);
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var monthsShortWithDots$2 =
|
||
'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),
|
||
monthsShortWithoutDots$2 =
|
||
'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'),
|
||
monthsParse$9 = [
|
||
/^jan/i,
|
||
/^feb/i,
|
||
/^(maart|mrt\.?)$/i,
|
||
/^apr/i,
|
||
/^mei$/i,
|
||
/^jun[i.]?$/i,
|
||
/^jul[i.]?$/i,
|
||
/^aug/i,
|
||
/^sep/i,
|
||
/^okt/i,
|
||
/^nov/i,
|
||
/^dec/i,
|
||
],
|
||
monthsRegex$9 =
|
||
/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
|
||
|
||
hooks.defineLocale('nl', {
|
||
months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(
|
||
'_'
|
||
),
|
||
monthsShort: function (m, format) {
|
||
if (!m) {
|
||
return monthsShortWithDots$2;
|
||
} else if (/-MMM-/.test(format)) {
|
||
return monthsShortWithoutDots$2[m.month()];
|
||
} else {
|
||
return monthsShortWithDots$2[m.month()];
|
||
}
|
||
},
|
||
|
||
monthsRegex: monthsRegex$9,
|
||
monthsShortRegex: monthsRegex$9,
|
||
monthsStrictRegex:
|
||
/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
|
||
monthsShortStrictRegex:
|
||
/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
|
||
|
||
monthsParse: monthsParse$9,
|
||
longMonthsParse: monthsParse$9,
|
||
shortMonthsParse: monthsParse$9,
|
||
|
||
weekdays:
|
||
'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
|
||
weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
|
||
weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD-MM-YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[vandaag om] LT',
|
||
nextDay: '[morgen om] LT',
|
||
nextWeek: 'dddd [om] LT',
|
||
lastDay: '[gisteren om] LT',
|
||
lastWeek: '[afgelopen] dddd [om] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'over %s',
|
||
past: '%s geleden',
|
||
s: 'een paar seconden',
|
||
ss: '%d seconden',
|
||
m: 'één minuut',
|
||
mm: '%d minuten',
|
||
h: 'één uur',
|
||
hh: '%d uur',
|
||
d: 'één dag',
|
||
dd: '%d dagen',
|
||
w: 'één week',
|
||
ww: '%d weken',
|
||
M: 'één maand',
|
||
MM: '%d maanden',
|
||
y: 'één jaar',
|
||
yy: '%d jaar',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
|
||
ordinal: function (number) {
|
||
return (
|
||
number +
|
||
(number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
|
||
);
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('nn', {
|
||
months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
|
||
monthsParseExact: true,
|
||
weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
|
||
weekdaysShort: 'su._må._ty._on._to._fr._lau.'.split('_'),
|
||
weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY [kl.] H:mm',
|
||
LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[I dag klokka] LT',
|
||
nextDay: '[I morgon klokka] LT',
|
||
nextWeek: 'dddd [klokka] LT',
|
||
lastDay: '[I går klokka] LT',
|
||
lastWeek: '[Føregåande] dddd [klokka] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'om %s',
|
||
past: '%s sidan',
|
||
s: 'nokre sekund',
|
||
ss: '%d sekund',
|
||
m: 'eit minutt',
|
||
mm: '%d minutt',
|
||
h: 'ein time',
|
||
hh: '%d timar',
|
||
d: 'ein dag',
|
||
dd: '%d dagar',
|
||
w: 'ei veke',
|
||
ww: '%d veker',
|
||
M: 'ein månad',
|
||
MM: '%d månader',
|
||
y: 'eit år',
|
||
yy: '%d år',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('oc-lnc', {
|
||
months: {
|
||
standalone:
|
||
'genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre'.split(
|
||
'_'
|
||
),
|
||
format: "de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split(
|
||
'_'
|
||
),
|
||
isFormat: /D[oD]?(\s)+MMMM/,
|
||
},
|
||
monthsShort:
|
||
'gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'dg._dl._dm._dc._dj._dv._ds.'.split('_'),
|
||
weekdaysMin: 'dg_dl_dm_dc_dj_dv_ds'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM [de] YYYY',
|
||
ll: 'D MMM YYYY',
|
||
LLL: 'D MMMM [de] YYYY [a] H:mm',
|
||
lll: 'D MMM YYYY, H:mm',
|
||
LLLL: 'dddd D MMMM [de] YYYY [a] H:mm',
|
||
llll: 'ddd D MMM YYYY, H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[uèi a] LT',
|
||
nextDay: '[deman a] LT',
|
||
nextWeek: 'dddd [a] LT',
|
||
lastDay: '[ièr a] LT',
|
||
lastWeek: 'dddd [passat a] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: "d'aquí %s",
|
||
past: 'fa %s',
|
||
s: 'unas segondas',
|
||
ss: '%d segondas',
|
||
m: 'una minuta',
|
||
mm: '%d minutas',
|
||
h: 'una ora',
|
||
hh: '%d oras',
|
||
d: 'un jorn',
|
||
dd: '%d jorns',
|
||
M: 'un mes',
|
||
MM: '%d meses',
|
||
y: 'un an',
|
||
yy: '%d ans',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
|
||
ordinal: function (number, period) {
|
||
var output =
|
||
number === 1
|
||
? 'r'
|
||
: number === 2
|
||
? 'n'
|
||
: number === 3
|
||
? 'r'
|
||
: number === 4
|
||
? 't'
|
||
: 'è';
|
||
if (period === 'w' || period === 'W') {
|
||
output = 'a';
|
||
}
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4,
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$g = {
|
||
1: '੧',
|
||
2: '੨',
|
||
3: '੩',
|
||
4: '੪',
|
||
5: '੫',
|
||
6: '੬',
|
||
7: '੭',
|
||
8: '੮',
|
||
9: '੯',
|
||
0: '੦',
|
||
},
|
||
numberMap$f = {
|
||
'੧': '1',
|
||
'੨': '2',
|
||
'੩': '3',
|
||
'੪': '4',
|
||
'੫': '5',
|
||
'੬': '6',
|
||
'੭': '7',
|
||
'੮': '8',
|
||
'੯': '9',
|
||
'੦': '0',
|
||
};
|
||
|
||
hooks.defineLocale('pa-in', {
|
||
// There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi.
|
||
months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
|
||
weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm ਵਜੇ',
|
||
LTS: 'A h:mm:ss ਵਜੇ',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, A h:mm ਵਜੇ',
|
||
LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ',
|
||
},
|
||
calendar: {
|
||
sameDay: '[ਅਜ] LT',
|
||
nextDay: '[ਕਲ] LT',
|
||
nextWeek: '[ਅਗਲਾ] dddd, LT',
|
||
lastDay: '[ਕਲ] LT',
|
||
lastWeek: '[ਪਿਛਲੇ] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s ਵਿੱਚ',
|
||
past: '%s ਪਿਛਲੇ',
|
||
s: 'ਕੁਝ ਸਕਿੰਟ',
|
||
ss: '%d ਸਕਿੰਟ',
|
||
m: 'ਇਕ ਮਿੰਟ',
|
||
mm: '%d ਮਿੰਟ',
|
||
h: 'ਇੱਕ ਘੰਟਾ',
|
||
hh: '%d ਘੰਟੇ',
|
||
d: 'ਇੱਕ ਦਿਨ',
|
||
dd: '%d ਦਿਨ',
|
||
M: 'ਇੱਕ ਮਹੀਨਾ',
|
||
MM: '%d ਮਹੀਨੇ',
|
||
y: 'ਇੱਕ ਸਾਲ',
|
||
yy: '%d ਸਾਲ',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
|
||
return numberMap$f[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$g[match];
|
||
});
|
||
},
|
||
// Punjabi notation for meridiems are quite fuzzy in practice. While there exists
|
||
// a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
|
||
meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'ਰਾਤ') {
|
||
return hour < 4 ? hour : hour + 12;
|
||
} else if (meridiem === 'ਸਵੇਰ') {
|
||
return hour;
|
||
} else if (meridiem === 'ਦੁਪਹਿਰ') {
|
||
return hour >= 10 ? hour : hour + 12;
|
||
} else if (meridiem === 'ਸ਼ਾਮ') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'ਰਾਤ';
|
||
} else if (hour < 10) {
|
||
return 'ਸਵੇਰ';
|
||
} else if (hour < 17) {
|
||
return 'ਦੁਪਹਿਰ';
|
||
} else if (hour < 20) {
|
||
return 'ਸ਼ਾਮ';
|
||
} else {
|
||
return 'ਰਾਤ';
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var monthsNominative =
|
||
'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split(
|
||
'_'
|
||
),
|
||
monthsSubjective =
|
||
'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split(
|
||
'_'
|
||
),
|
||
monthsParse$a = [
|
||
/^sty/i,
|
||
/^lut/i,
|
||
/^mar/i,
|
||
/^kwi/i,
|
||
/^maj/i,
|
||
/^cze/i,
|
||
/^lip/i,
|
||
/^sie/i,
|
||
/^wrz/i,
|
||
/^paź/i,
|
||
/^lis/i,
|
||
/^gru/i,
|
||
];
|
||
function plural$3(n) {
|
||
return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;
|
||
}
|
||
function translate$8(number, withoutSuffix, key) {
|
||
var result = number + ' ';
|
||
switch (key) {
|
||
case 'ss':
|
||
return result + (plural$3(number) ? 'sekundy' : 'sekund');
|
||
case 'm':
|
||
return withoutSuffix ? 'minuta' : 'minutę';
|
||
case 'mm':
|
||
return result + (plural$3(number) ? 'minuty' : 'minut');
|
||
case 'h':
|
||
return withoutSuffix ? 'godzina' : 'godzinę';
|
||
case 'hh':
|
||
return result + (plural$3(number) ? 'godziny' : 'godzin');
|
||
case 'ww':
|
||
return result + (plural$3(number) ? 'tygodnie' : 'tygodni');
|
||
case 'MM':
|
||
return result + (plural$3(number) ? 'miesiące' : 'miesięcy');
|
||
case 'yy':
|
||
return result + (plural$3(number) ? 'lata' : 'lat');
|
||
}
|
||
}
|
||
|
||
hooks.defineLocale('pl', {
|
||
months: function (momentToFormat, format) {
|
||
if (!momentToFormat) {
|
||
return monthsNominative;
|
||
} else if (/D MMMM/.test(format)) {
|
||
return monthsSubjective[momentToFormat.month()];
|
||
} else {
|
||
return monthsNominative[momentToFormat.month()];
|
||
}
|
||
},
|
||
monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
|
||
monthsParse: monthsParse$a,
|
||
longMonthsParse: monthsParse$a,
|
||
shortMonthsParse: monthsParse$a,
|
||
weekdays:
|
||
'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
|
||
weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
|
||
weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Dziś o] LT',
|
||
nextDay: '[Jutro o] LT',
|
||
nextWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[W niedzielę o] LT';
|
||
|
||
case 2:
|
||
return '[We wtorek o] LT';
|
||
|
||
case 3:
|
||
return '[W środę o] LT';
|
||
|
||
case 6:
|
||
return '[W sobotę o] LT';
|
||
|
||
default:
|
||
return '[W] dddd [o] LT';
|
||
}
|
||
},
|
||
lastDay: '[Wczoraj o] LT',
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[W zeszłą niedzielę o] LT';
|
||
case 3:
|
||
return '[W zeszłą środę o] LT';
|
||
case 6:
|
||
return '[W zeszłą sobotę o] LT';
|
||
default:
|
||
return '[W zeszły] dddd [o] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'za %s',
|
||
past: '%s temu',
|
||
s: 'kilka sekund',
|
||
ss: translate$8,
|
||
m: translate$8,
|
||
mm: translate$8,
|
||
h: translate$8,
|
||
hh: translate$8,
|
||
d: '1 dzień',
|
||
dd: '%d dni',
|
||
w: 'tydzień',
|
||
ww: translate$8,
|
||
M: 'miesiąc',
|
||
MM: translate$8,
|
||
y: 'rok',
|
||
yy: translate$8,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('pt-br', {
|
||
months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
|
||
weekdays:
|
||
'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),
|
||
weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D [de] MMMM [de] YYYY',
|
||
LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
|
||
LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Hoje às] LT',
|
||
nextDay: '[Amanhã às] LT',
|
||
nextWeek: 'dddd [às] LT',
|
||
lastDay: '[Ontem às] LT',
|
||
lastWeek: function () {
|
||
return this.day() === 0 || this.day() === 6
|
||
? '[Último] dddd [às] LT' // Saturday + Sunday
|
||
: '[Última] dddd [às] LT'; // Monday - Friday
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'em %s',
|
||
past: 'há %s',
|
||
s: 'poucos segundos',
|
||
ss: '%d segundos',
|
||
m: 'um minuto',
|
||
mm: '%d minutos',
|
||
h: 'uma hora',
|
||
hh: '%d horas',
|
||
d: 'um dia',
|
||
dd: '%d dias',
|
||
M: 'um mês',
|
||
MM: '%d meses',
|
||
y: 'um ano',
|
||
yy: '%d anos',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
invalidDate: 'Data inválida',
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('pt', {
|
||
months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
|
||
weekdays:
|
||
'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
|
||
weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D [de] MMMM [de] YYYY',
|
||
LLL: 'D [de] MMMM [de] YYYY HH:mm',
|
||
LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Hoje às] LT',
|
||
nextDay: '[Amanhã às] LT',
|
||
nextWeek: 'dddd [às] LT',
|
||
lastDay: '[Ontem às] LT',
|
||
lastWeek: function () {
|
||
return this.day() === 0 || this.day() === 6
|
||
? '[Último] dddd [às] LT' // Saturday + Sunday
|
||
: '[Última] dddd [às] LT'; // Monday - Friday
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'em %s',
|
||
past: 'há %s',
|
||
s: 'segundos',
|
||
ss: '%d segundos',
|
||
m: 'um minuto',
|
||
mm: '%d minutos',
|
||
h: 'uma hora',
|
||
hh: '%d horas',
|
||
d: 'um dia',
|
||
dd: '%d dias',
|
||
w: 'uma semana',
|
||
ww: '%d semanas',
|
||
M: 'um mês',
|
||
MM: '%d meses',
|
||
y: 'um ano',
|
||
yy: '%d anos',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
||
ordinal: '%dº',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function relativeTimeWithPlural$2(number, withoutSuffix, key) {
|
||
var format = {
|
||
ss: 'secunde',
|
||
mm: 'minute',
|
||
hh: 'ore',
|
||
dd: 'zile',
|
||
ww: 'săptămâni',
|
||
MM: 'luni',
|
||
yy: 'ani',
|
||
},
|
||
separator = ' ';
|
||
if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
|
||
separator = ' de ';
|
||
}
|
||
return number + separator + format[key];
|
||
}
|
||
|
||
hooks.defineLocale('ro', {
|
||
months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
|
||
weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
|
||
weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY H:mm',
|
||
LLLL: 'dddd, D MMMM YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[azi la] LT',
|
||
nextDay: '[mâine la] LT',
|
||
nextWeek: 'dddd [la] LT',
|
||
lastDay: '[ieri la] LT',
|
||
lastWeek: '[fosta] dddd [la] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'peste %s',
|
||
past: '%s în urmă',
|
||
s: 'câteva secunde',
|
||
ss: relativeTimeWithPlural$2,
|
||
m: 'un minut',
|
||
mm: relativeTimeWithPlural$2,
|
||
h: 'o oră',
|
||
hh: relativeTimeWithPlural$2,
|
||
d: 'o zi',
|
||
dd: relativeTimeWithPlural$2,
|
||
w: 'o săptămână',
|
||
ww: relativeTimeWithPlural$2,
|
||
M: 'o lună',
|
||
MM: relativeTimeWithPlural$2,
|
||
y: 'un an',
|
||
yy: relativeTimeWithPlural$2,
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function plural$4(word, num) {
|
||
var forms = word.split('_');
|
||
return num % 10 === 1 && num % 100 !== 11
|
||
? forms[0]
|
||
: num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
|
||
? forms[1]
|
||
: forms[2];
|
||
}
|
||
function relativeTimeWithPlural$3(number, withoutSuffix, key) {
|
||
var format = {
|
||
ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
|
||
mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
|
||
hh: 'час_часа_часов',
|
||
dd: 'день_дня_дней',
|
||
ww: 'неделя_недели_недель',
|
||
MM: 'месяц_месяца_месяцев',
|
||
yy: 'год_года_лет',
|
||
};
|
||
if (key === 'm') {
|
||
return withoutSuffix ? 'минута' : 'минуту';
|
||
} else {
|
||
return number + ' ' + plural$4(format[key], +number);
|
||
}
|
||
}
|
||
var monthsParse$b = [
|
||
/^янв/i,
|
||
/^фев/i,
|
||
/^мар/i,
|
||
/^апр/i,
|
||
/^ма[йя]/i,
|
||
/^июн/i,
|
||
/^июл/i,
|
||
/^авг/i,
|
||
/^сен/i,
|
||
/^окт/i,
|
||
/^ноя/i,
|
||
/^дек/i,
|
||
];
|
||
|
||
// http://new.gramota.ru/spravka/rules/139-prop : § 103
|
||
// Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
|
||
// CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
|
||
hooks.defineLocale('ru', {
|
||
months: {
|
||
format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(
|
||
'_'
|
||
),
|
||
},
|
||
monthsShort: {
|
||
// по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку?
|
||
format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split(
|
||
'_'
|
||
),
|
||
},
|
||
weekdays: {
|
||
standalone:
|
||
'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split(
|
||
'_'
|
||
),
|
||
format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split(
|
||
'_'
|
||
),
|
||
isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/,
|
||
},
|
||
weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
|
||
weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
|
||
monthsParse: monthsParse$b,
|
||
longMonthsParse: monthsParse$b,
|
||
shortMonthsParse: monthsParse$b,
|
||
|
||
// полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
|
||
monthsRegex:
|
||
/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
|
||
|
||
// копия предыдущего
|
||
monthsShortRegex:
|
||
/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
|
||
|
||
// полные названия с падежами
|
||
monthsStrictRegex:
|
||
/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
|
||
|
||
// Выражение, которое соответствует только сокращённым формам
|
||
monthsShortStrictRegex:
|
||
/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY г.',
|
||
LLL: 'D MMMM YYYY г., H:mm',
|
||
LLLL: 'dddd, D MMMM YYYY г., H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Сегодня, в] LT',
|
||
nextDay: '[Завтра, в] LT',
|
||
lastDay: '[Вчера, в] LT',
|
||
nextWeek: function (now) {
|
||
if (now.week() !== this.week()) {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[В следующее] dddd, [в] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
return '[В следующий] dddd, [в] LT';
|
||
case 3:
|
||
case 5:
|
||
case 6:
|
||
return '[В следующую] dddd, [в] LT';
|
||
}
|
||
} else {
|
||
if (this.day() === 2) {
|
||
return '[Во] dddd, [в] LT';
|
||
} else {
|
||
return '[В] dddd, [в] LT';
|
||
}
|
||
}
|
||
},
|
||
lastWeek: function (now) {
|
||
if (now.week() !== this.week()) {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[В прошлое] dddd, [в] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
return '[В прошлый] dddd, [в] LT';
|
||
case 3:
|
||
case 5:
|
||
case 6:
|
||
return '[В прошлую] dddd, [в] LT';
|
||
}
|
||
} else {
|
||
if (this.day() === 2) {
|
||
return '[Во] dddd, [в] LT';
|
||
} else {
|
||
return '[В] dddd, [в] LT';
|
||
}
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'через %s',
|
||
past: '%s назад',
|
||
s: 'несколько секунд',
|
||
ss: relativeTimeWithPlural$3,
|
||
m: relativeTimeWithPlural$3,
|
||
mm: relativeTimeWithPlural$3,
|
||
h: 'час',
|
||
hh: relativeTimeWithPlural$3,
|
||
d: 'день',
|
||
dd: relativeTimeWithPlural$3,
|
||
w: 'неделя',
|
||
ww: relativeTimeWithPlural$3,
|
||
M: 'месяц',
|
||
MM: relativeTimeWithPlural$3,
|
||
y: 'год',
|
||
yy: relativeTimeWithPlural$3,
|
||
},
|
||
meridiemParse: /ночи|утра|дня|вечера/i,
|
||
isPM: function (input) {
|
||
return /^(дня|вечера)$/.test(input);
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'ночи';
|
||
} else if (hour < 12) {
|
||
return 'утра';
|
||
} else if (hour < 17) {
|
||
return 'дня';
|
||
} else {
|
||
return 'вечера';
|
||
}
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'M':
|
||
case 'd':
|
||
case 'DDD':
|
||
return number + '-й';
|
||
case 'D':
|
||
return number + '-го';
|
||
case 'w':
|
||
case 'W':
|
||
return number + '-я';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var months$9 = [
|
||
'جنوري',
|
||
'فيبروري',
|
||
'مارچ',
|
||
'اپريل',
|
||
'مئي',
|
||
'جون',
|
||
'جولاءِ',
|
||
'آگسٽ',
|
||
'سيپٽمبر',
|
||
'آڪٽوبر',
|
||
'نومبر',
|
||
'ڊسمبر',
|
||
],
|
||
days$1 = ['آچر', 'سومر', 'اڱارو', 'اربع', 'خميس', 'جمع', 'ڇنڇر'];
|
||
|
||
hooks.defineLocale('sd', {
|
||
months: months$9,
|
||
monthsShort: months$9,
|
||
weekdays: days$1,
|
||
weekdaysShort: days$1,
|
||
weekdaysMin: days$1,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd، D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /صبح|شام/,
|
||
isPM: function (input) {
|
||
return 'شام' === input;
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'صبح';
|
||
}
|
||
return 'شام';
|
||
},
|
||
calendar: {
|
||
sameDay: '[اڄ] LT',
|
||
nextDay: '[سڀاڻي] LT',
|
||
nextWeek: 'dddd [اڳين هفتي تي] LT',
|
||
lastDay: '[ڪالهه] LT',
|
||
lastWeek: '[گزريل هفتي] dddd [تي] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s پوء',
|
||
past: '%s اڳ',
|
||
s: 'چند سيڪنڊ',
|
||
ss: '%d سيڪنڊ',
|
||
m: 'هڪ منٽ',
|
||
mm: '%d منٽ',
|
||
h: 'هڪ ڪلاڪ',
|
||
hh: '%d ڪلاڪ',
|
||
d: 'هڪ ڏينهن',
|
||
dd: '%d ڏينهن',
|
||
M: 'هڪ مهينو',
|
||
MM: '%d مهينا',
|
||
y: 'هڪ سال',
|
||
yy: '%d سال',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/،/g, ',');
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/,/g, '،');
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('se', {
|
||
months: 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),
|
||
weekdays:
|
||
'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
|
||
weekdaysMin: 's_v_m_g_d_b_L'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'MMMM D. [b.] YYYY',
|
||
LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',
|
||
LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[otne ti] LT',
|
||
nextDay: '[ihttin ti] LT',
|
||
nextWeek: 'dddd [ti] LT',
|
||
lastDay: '[ikte ti] LT',
|
||
lastWeek: '[ovddit] dddd [ti] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s geažes',
|
||
past: 'maŋit %s',
|
||
s: 'moadde sekunddat',
|
||
ss: '%d sekunddat',
|
||
m: 'okta minuhta',
|
||
mm: '%d minuhtat',
|
||
h: 'okta diimmu',
|
||
hh: '%d diimmut',
|
||
d: 'okta beaivi',
|
||
dd: '%d beaivvit',
|
||
M: 'okta mánnu',
|
||
MM: '%d mánut',
|
||
y: 'okta jahki',
|
||
yy: '%d jagit',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
/*jshint -W100*/
|
||
hooks.defineLocale('si', {
|
||
months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split(
|
||
'_'
|
||
),
|
||
weekdays:
|
||
'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන'.split('_'),
|
||
weekdaysMin: 'ඉ_ස_අ_බ_බ්ර_සි_සෙ'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'a h:mm',
|
||
LTS: 'a h:mm:ss',
|
||
L: 'YYYY/MM/DD',
|
||
LL: 'YYYY MMMM D',
|
||
LLL: 'YYYY MMMM D, a h:mm',
|
||
LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss',
|
||
},
|
||
calendar: {
|
||
sameDay: '[අද] LT[ට]',
|
||
nextDay: '[හෙට] LT[ට]',
|
||
nextWeek: 'dddd LT[ට]',
|
||
lastDay: '[ඊයේ] LT[ට]',
|
||
lastWeek: '[පසුගිය] dddd LT[ට]',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%sකින්',
|
||
past: '%sකට පෙර',
|
||
s: 'තත්පර කිහිපය',
|
||
ss: 'තත්පර %d',
|
||
m: 'මිනිත්තුව',
|
||
mm: 'මිනිත්තු %d',
|
||
h: 'පැය',
|
||
hh: 'පැය %d',
|
||
d: 'දිනය',
|
||
dd: 'දින %d',
|
||
M: 'මාසය',
|
||
MM: 'මාස %d',
|
||
y: 'වසර',
|
||
yy: 'වසර %d',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2} වැනි/,
|
||
ordinal: function (number) {
|
||
return number + ' වැනි';
|
||
},
|
||
meridiemParse: /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
|
||
isPM: function (input) {
|
||
return input === 'ප.ව.' || input === 'පස් වරු';
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours > 11) {
|
||
return isLower ? 'ප.ව.' : 'පස් වරු';
|
||
} else {
|
||
return isLower ? 'පෙ.ව.' : 'පෙර වරු';
|
||
}
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var months$a =
|
||
'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(
|
||
'_'
|
||
),
|
||
monthsShort$7 = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
|
||
function plural$5(n) {
|
||
return n > 1 && n < 5;
|
||
}
|
||
function translate$9(number, withoutSuffix, key, isFuture) {
|
||
var result = number + ' ';
|
||
switch (key) {
|
||
case 's': // a few seconds / in a few seconds / a few seconds ago
|
||
return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
|
||
case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$5(number) ? 'sekundy' : 'sekúnd');
|
||
} else {
|
||
return result + 'sekundami';
|
||
}
|
||
case 'm': // a minute / in a minute / a minute ago
|
||
return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';
|
||
case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$5(number) ? 'minúty' : 'minút');
|
||
} else {
|
||
return result + 'minútami';
|
||
}
|
||
case 'h': // an hour / in an hour / an hour ago
|
||
return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
|
||
case 'hh': // 9 hours / in 9 hours / 9 hours ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$5(number) ? 'hodiny' : 'hodín');
|
||
} else {
|
||
return result + 'hodinami';
|
||
}
|
||
case 'd': // a day / in a day / a day ago
|
||
return withoutSuffix || isFuture ? 'deň' : 'dňom';
|
||
case 'dd': // 9 days / in 9 days / 9 days ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$5(number) ? 'dni' : 'dní');
|
||
} else {
|
||
return result + 'dňami';
|
||
}
|
||
case 'M': // a month / in a month / a month ago
|
||
return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';
|
||
case 'MM': // 9 months / in 9 months / 9 months ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$5(number) ? 'mesiace' : 'mesiacov');
|
||
} else {
|
||
return result + 'mesiacmi';
|
||
}
|
||
case 'y': // a year / in a year / a year ago
|
||
return withoutSuffix || isFuture ? 'rok' : 'rokom';
|
||
case 'yy': // 9 years / in 9 years / 9 years ago
|
||
if (withoutSuffix || isFuture) {
|
||
return result + (plural$5(number) ? 'roky' : 'rokov');
|
||
} else {
|
||
return result + 'rokmi';
|
||
}
|
||
}
|
||
}
|
||
|
||
hooks.defineLocale('sk', {
|
||
months: months$a,
|
||
monthsShort: monthsShort$7,
|
||
weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
|
||
weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
|
||
weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY H:mm',
|
||
LLLL: 'dddd D. MMMM YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[dnes o] LT',
|
||
nextDay: '[zajtra o] LT',
|
||
nextWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[v nedeľu o] LT';
|
||
case 1:
|
||
case 2:
|
||
return '[v] dddd [o] LT';
|
||
case 3:
|
||
return '[v stredu o] LT';
|
||
case 4:
|
||
return '[vo štvrtok o] LT';
|
||
case 5:
|
||
return '[v piatok o] LT';
|
||
case 6:
|
||
return '[v sobotu o] LT';
|
||
}
|
||
},
|
||
lastDay: '[včera o] LT',
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[minulú nedeľu o] LT';
|
||
case 1:
|
||
case 2:
|
||
return '[minulý] dddd [o] LT';
|
||
case 3:
|
||
return '[minulú stredu o] LT';
|
||
case 4:
|
||
case 5:
|
||
return '[minulý] dddd [o] LT';
|
||
case 6:
|
||
return '[minulú sobotu o] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'za %s',
|
||
past: 'pred %s',
|
||
s: translate$9,
|
||
ss: translate$9,
|
||
m: translate$9,
|
||
mm: translate$9,
|
||
h: translate$9,
|
||
hh: translate$9,
|
||
d: translate$9,
|
||
dd: translate$9,
|
||
M: translate$9,
|
||
MM: translate$9,
|
||
y: translate$9,
|
||
yy: translate$9,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function processRelativeTime$9(number, withoutSuffix, key, isFuture) {
|
||
var result = number + ' ';
|
||
switch (key) {
|
||
case 's':
|
||
return withoutSuffix || isFuture
|
||
? 'nekaj sekund'
|
||
: 'nekaj sekundami';
|
||
case 'ss':
|
||
if (number === 1) {
|
||
result += withoutSuffix ? 'sekundo' : 'sekundi';
|
||
} else if (number === 2) {
|
||
result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
|
||
} else if (number < 5) {
|
||
result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
|
||
} else {
|
||
result += 'sekund';
|
||
}
|
||
return result;
|
||
case 'm':
|
||
return withoutSuffix ? 'ena minuta' : 'eno minuto';
|
||
case 'mm':
|
||
if (number === 1) {
|
||
result += withoutSuffix ? 'minuta' : 'minuto';
|
||
} else if (number === 2) {
|
||
result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
|
||
} else if (number < 5) {
|
||
result += withoutSuffix || isFuture ? 'minute' : 'minutami';
|
||
} else {
|
||
result += withoutSuffix || isFuture ? 'minut' : 'minutami';
|
||
}
|
||
return result;
|
||
case 'h':
|
||
return withoutSuffix ? 'ena ura' : 'eno uro';
|
||
case 'hh':
|
||
if (number === 1) {
|
||
result += withoutSuffix ? 'ura' : 'uro';
|
||
} else if (number === 2) {
|
||
result += withoutSuffix || isFuture ? 'uri' : 'urama';
|
||
} else if (number < 5) {
|
||
result += withoutSuffix || isFuture ? 'ure' : 'urami';
|
||
} else {
|
||
result += withoutSuffix || isFuture ? 'ur' : 'urami';
|
||
}
|
||
return result;
|
||
case 'd':
|
||
return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
|
||
case 'dd':
|
||
if (number === 1) {
|
||
result += withoutSuffix || isFuture ? 'dan' : 'dnem';
|
||
} else if (number === 2) {
|
||
result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
|
||
} else {
|
||
result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
|
||
}
|
||
return result;
|
||
case 'M':
|
||
return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
|
||
case 'MM':
|
||
if (number === 1) {
|
||
result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
|
||
} else if (number === 2) {
|
||
result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
|
||
} else if (number < 5) {
|
||
result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
|
||
} else {
|
||
result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
|
||
}
|
||
return result;
|
||
case 'y':
|
||
return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
|
||
case 'yy':
|
||
if (number === 1) {
|
||
result += withoutSuffix || isFuture ? 'leto' : 'letom';
|
||
} else if (number === 2) {
|
||
result += withoutSuffix || isFuture ? 'leti' : 'letoma';
|
||
} else if (number < 5) {
|
||
result += withoutSuffix || isFuture ? 'leta' : 'leti';
|
||
} else {
|
||
result += withoutSuffix || isFuture ? 'let' : 'leti';
|
||
}
|
||
return result;
|
||
}
|
||
}
|
||
|
||
hooks.defineLocale('sl', {
|
||
months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
|
||
weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
|
||
weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD. MM. YYYY',
|
||
LL: 'D. MMMM YYYY',
|
||
LLL: 'D. MMMM YYYY H:mm',
|
||
LLLL: 'dddd, D. MMMM YYYY H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[danes ob] LT',
|
||
nextDay: '[jutri ob] LT',
|
||
|
||
nextWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[v] [nedeljo] [ob] LT';
|
||
case 3:
|
||
return '[v] [sredo] [ob] LT';
|
||
case 6:
|
||
return '[v] [soboto] [ob] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[v] dddd [ob] LT';
|
||
}
|
||
},
|
||
lastDay: '[včeraj ob] LT',
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[prejšnjo] [nedeljo] [ob] LT';
|
||
case 3:
|
||
return '[prejšnjo] [sredo] [ob] LT';
|
||
case 6:
|
||
return '[prejšnjo] [soboto] [ob] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[prejšnji] dddd [ob] LT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'čez %s',
|
||
past: 'pred %s',
|
||
s: processRelativeTime$9,
|
||
ss: processRelativeTime$9,
|
||
m: processRelativeTime$9,
|
||
mm: processRelativeTime$9,
|
||
h: processRelativeTime$9,
|
||
hh: processRelativeTime$9,
|
||
d: processRelativeTime$9,
|
||
dd: processRelativeTime$9,
|
||
M: processRelativeTime$9,
|
||
MM: processRelativeTime$9,
|
||
y: processRelativeTime$9,
|
||
yy: processRelativeTime$9,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('sq', {
|
||
months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
|
||
weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
|
||
weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'),
|
||
weekdaysParseExact: true,
|
||
meridiemParse: /PD|MD/,
|
||
isPM: function (input) {
|
||
return input.charAt(0) === 'M';
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
return hours < 12 ? 'PD' : 'MD';
|
||
},
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Sot në] LT',
|
||
nextDay: '[Nesër në] LT',
|
||
nextWeek: 'dddd [në] LT',
|
||
lastDay: '[Dje në] LT',
|
||
lastWeek: 'dddd [e kaluar në] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'në %s',
|
||
past: '%s më parë',
|
||
s: 'disa sekonda',
|
||
ss: '%d sekonda',
|
||
m: 'një minutë',
|
||
mm: '%d minuta',
|
||
h: 'një orë',
|
||
hh: '%d orë',
|
||
d: 'një ditë',
|
||
dd: '%d ditë',
|
||
M: 'një muaj',
|
||
MM: '%d muaj',
|
||
y: 'një vit',
|
||
yy: '%d vite',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var translator$1 = {
|
||
words: {
|
||
//Different grammatical cases
|
||
ss: ['секунда', 'секунде', 'секунди'],
|
||
m: ['један минут', 'једног минута'],
|
||
mm: ['минут', 'минута', 'минута'],
|
||
h: ['један сат', 'једног сата'],
|
||
hh: ['сат', 'сата', 'сати'],
|
||
d: ['један дан', 'једног дана'],
|
||
dd: ['дан', 'дана', 'дана'],
|
||
M: ['један месец', 'једног месеца'],
|
||
MM: ['месец', 'месеца', 'месеци'],
|
||
y: ['једну годину', 'једне године'],
|
||
yy: ['годину', 'године', 'година'],
|
||
},
|
||
correctGrammaticalCase: function (number, wordKey) {
|
||
if (
|
||
number % 10 >= 1 &&
|
||
number % 10 <= 4 &&
|
||
(number % 100 < 10 || number % 100 >= 20)
|
||
) {
|
||
return number % 10 === 1 ? wordKey[0] : wordKey[1];
|
||
}
|
||
return wordKey[2];
|
||
},
|
||
translate: function (number, withoutSuffix, key, isFuture) {
|
||
var wordKey = translator$1.words[key],
|
||
word;
|
||
|
||
if (key.length === 1) {
|
||
// Nominativ
|
||
if (key === 'y' && withoutSuffix) return 'једна година';
|
||
return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];
|
||
}
|
||
|
||
word = translator$1.correctGrammaticalCase(number, wordKey);
|
||
// Nominativ
|
||
if (key === 'yy' && withoutSuffix && word === 'годину') {
|
||
return number + ' година';
|
||
}
|
||
|
||
return number + ' ' + word;
|
||
},
|
||
};
|
||
|
||
hooks.defineLocale('sr-cyrl', {
|
||
months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),
|
||
monthsParseExact: true,
|
||
weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
|
||
weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
|
||
weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'D. M. YYYY.',
|
||
LL: 'D. MMMM YYYY.',
|
||
LLL: 'D. MMMM YYYY. H:mm',
|
||
LLLL: 'dddd, D. MMMM YYYY. H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[данас у] LT',
|
||
nextDay: '[сутра у] LT',
|
||
nextWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[у] [недељу] [у] LT';
|
||
case 3:
|
||
return '[у] [среду] [у] LT';
|
||
case 6:
|
||
return '[у] [суботу] [у] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[у] dddd [у] LT';
|
||
}
|
||
},
|
||
lastDay: '[јуче у] LT',
|
||
lastWeek: function () {
|
||
var lastWeekDays = [
|
||
'[прошле] [недеље] [у] LT',
|
||
'[прошлог] [понедељка] [у] LT',
|
||
'[прошлог] [уторка] [у] LT',
|
||
'[прошле] [среде] [у] LT',
|
||
'[прошлог] [четвртка] [у] LT',
|
||
'[прошлог] [петка] [у] LT',
|
||
'[прошле] [суботе] [у] LT',
|
||
];
|
||
return lastWeekDays[this.day()];
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'за %s',
|
||
past: 'пре %s',
|
||
s: 'неколико секунди',
|
||
ss: translator$1.translate,
|
||
m: translator$1.translate,
|
||
mm: translator$1.translate,
|
||
h: translator$1.translate,
|
||
hh: translator$1.translate,
|
||
d: translator$1.translate,
|
||
dd: translator$1.translate,
|
||
M: translator$1.translate,
|
||
MM: translator$1.translate,
|
||
y: translator$1.translate,
|
||
yy: translator$1.translate,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 1st is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var translator$2 = {
|
||
words: {
|
||
//Different grammatical cases
|
||
ss: ['sekunda', 'sekunde', 'sekundi'],
|
||
m: ['jedan minut', 'jednog minuta'],
|
||
mm: ['minut', 'minuta', 'minuta'],
|
||
h: ['jedan sat', 'jednog sata'],
|
||
hh: ['sat', 'sata', 'sati'],
|
||
d: ['jedan dan', 'jednog dana'],
|
||
dd: ['dan', 'dana', 'dana'],
|
||
M: ['jedan mesec', 'jednog meseca'],
|
||
MM: ['mesec', 'meseca', 'meseci'],
|
||
y: ['jednu godinu', 'jedne godine'],
|
||
yy: ['godinu', 'godine', 'godina'],
|
||
},
|
||
correctGrammaticalCase: function (number, wordKey) {
|
||
if (
|
||
number % 10 >= 1 &&
|
||
number % 10 <= 4 &&
|
||
(number % 100 < 10 || number % 100 >= 20)
|
||
) {
|
||
return number % 10 === 1 ? wordKey[0] : wordKey[1];
|
||
}
|
||
return wordKey[2];
|
||
},
|
||
translate: function (number, withoutSuffix, key, isFuture) {
|
||
var wordKey = translator$2.words[key],
|
||
word;
|
||
|
||
if (key.length === 1) {
|
||
// Nominativ
|
||
if (key === 'y' && withoutSuffix) return 'jedna godina';
|
||
return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];
|
||
}
|
||
|
||
word = translator$2.correctGrammaticalCase(number, wordKey);
|
||
// Nominativ
|
||
if (key === 'yy' && withoutSuffix && word === 'godinu') {
|
||
return number + ' godina';
|
||
}
|
||
|
||
return number + ' ' + word;
|
||
},
|
||
};
|
||
|
||
hooks.defineLocale('sr', {
|
||
months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
|
||
monthsParseExact: true,
|
||
weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
|
||
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'D. M. YYYY.',
|
||
LL: 'D. MMMM YYYY.',
|
||
LLL: 'D. MMMM YYYY. H:mm',
|
||
LLLL: 'dddd, D. MMMM YYYY. H:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[danas u] LT',
|
||
nextDay: '[sutra u] LT',
|
||
nextWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
return '[u] [nedelju] [u] LT';
|
||
case 3:
|
||
return '[u] [sredu] [u] LT';
|
||
case 6:
|
||
return '[u] [subotu] [u] LT';
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
case 5:
|
||
return '[u] dddd [u] LT';
|
||
}
|
||
},
|
||
lastDay: '[juče u] LT',
|
||
lastWeek: function () {
|
||
var lastWeekDays = [
|
||
'[prošle] [nedelje] [u] LT',
|
||
'[prošlog] [ponedeljka] [u] LT',
|
||
'[prošlog] [utorka] [u] LT',
|
||
'[prošle] [srede] [u] LT',
|
||
'[prošlog] [četvrtka] [u] LT',
|
||
'[prošlog] [petka] [u] LT',
|
||
'[prošle] [subote] [u] LT',
|
||
];
|
||
return lastWeekDays[this.day()];
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'za %s',
|
||
past: 'pre %s',
|
||
s: 'nekoliko sekundi',
|
||
ss: translator$2.translate,
|
||
m: translator$2.translate,
|
||
mm: translator$2.translate,
|
||
h: translator$2.translate,
|
||
hh: translator$2.translate,
|
||
d: translator$2.translate,
|
||
dd: translator$2.translate,
|
||
M: translator$2.translate,
|
||
MM: translator$2.translate,
|
||
y: translator$2.translate,
|
||
yy: translator$2.translate,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ss', {
|
||
months: "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
|
||
weekdays:
|
||
'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
|
||
weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'h:mm A',
|
||
LTS: 'h:mm:ss A',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY h:mm A',
|
||
LLLL: 'dddd, D MMMM YYYY h:mm A',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Namuhla nga] LT',
|
||
nextDay: '[Kusasa nga] LT',
|
||
nextWeek: 'dddd [nga] LT',
|
||
lastDay: '[Itolo nga] LT',
|
||
lastWeek: 'dddd [leliphelile] [nga] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'nga %s',
|
||
past: 'wenteka nga %s',
|
||
s: 'emizuzwana lomcane',
|
||
ss: '%d mzuzwana',
|
||
m: 'umzuzu',
|
||
mm: '%d emizuzu',
|
||
h: 'lihora',
|
||
hh: '%d emahora',
|
||
d: 'lilanga',
|
||
dd: '%d emalanga',
|
||
M: 'inyanga',
|
||
MM: '%d tinyanga',
|
||
y: 'umnyaka',
|
||
yy: '%d iminyaka',
|
||
},
|
||
meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours < 11) {
|
||
return 'ekuseni';
|
||
} else if (hours < 15) {
|
||
return 'emini';
|
||
} else if (hours < 19) {
|
||
return 'entsambama';
|
||
} else {
|
||
return 'ebusuku';
|
||
}
|
||
},
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'ekuseni') {
|
||
return hour;
|
||
} else if (meridiem === 'emini') {
|
||
return hour >= 11 ? hour : hour + 12;
|
||
} else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
|
||
if (hour === 0) {
|
||
return 0;
|
||
}
|
||
return hour + 12;
|
||
}
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}/,
|
||
ordinal: '%d',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('sv', {
|
||
months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
|
||
weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
|
||
weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
|
||
weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY-MM-DD',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY [kl.] HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',
|
||
lll: 'D MMM YYYY HH:mm',
|
||
llll: 'ddd D MMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Idag] LT',
|
||
nextDay: '[Imorgon] LT',
|
||
lastDay: '[Igår] LT',
|
||
nextWeek: '[På] dddd LT',
|
||
lastWeek: '[I] dddd[s] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'om %s',
|
||
past: 'för %s sedan',
|
||
s: 'några sekunder',
|
||
ss: '%d sekunder',
|
||
m: 'en minut',
|
||
mm: '%d minuter',
|
||
h: 'en timme',
|
||
hh: '%d timmar',
|
||
d: 'en dag',
|
||
dd: '%d dagar',
|
||
M: 'en månad',
|
||
MM: '%d månader',
|
||
y: 'ett år',
|
||
yy: '%d år',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(\:e|\:a)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? ':e'
|
||
: b === 1
|
||
? ':a'
|
||
: b === 2
|
||
? ':a'
|
||
: b === 3
|
||
? ':e'
|
||
: ':e';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('sw', {
|
||
months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
|
||
weekdays:
|
||
'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
|
||
weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'hh:mm A',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[leo saa] LT',
|
||
nextDay: '[kesho saa] LT',
|
||
nextWeek: '[wiki ijayo] dddd [saat] LT',
|
||
lastDay: '[jana] LT',
|
||
lastWeek: '[wiki iliyopita] dddd [saat] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s baadaye',
|
||
past: 'tokea %s',
|
||
s: 'hivi punde',
|
||
ss: 'sekunde %d',
|
||
m: 'dakika moja',
|
||
mm: 'dakika %d',
|
||
h: 'saa limoja',
|
||
hh: 'masaa %d',
|
||
d: 'siku moja',
|
||
dd: 'siku %d',
|
||
M: 'mwezi mmoja',
|
||
MM: 'miezi %d',
|
||
y: 'mwaka mmoja',
|
||
yy: 'miaka %d',
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var symbolMap$h = {
|
||
1: '௧',
|
||
2: '௨',
|
||
3: '௩',
|
||
4: '௪',
|
||
5: '௫',
|
||
6: '௬',
|
||
7: '௭',
|
||
8: '௮',
|
||
9: '௯',
|
||
0: '௦',
|
||
},
|
||
numberMap$g = {
|
||
'௧': '1',
|
||
'௨': '2',
|
||
'௩': '3',
|
||
'௪': '4',
|
||
'௫': '5',
|
||
'௬': '6',
|
||
'௭': '7',
|
||
'௮': '8',
|
||
'௯': '9',
|
||
'௦': '0',
|
||
};
|
||
|
||
hooks.defineLocale('ta', {
|
||
months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(
|
||
'_'
|
||
),
|
||
weekdays:
|
||
'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split(
|
||
'_'
|
||
),
|
||
weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY, HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[இன்று] LT',
|
||
nextDay: '[நாளை] LT',
|
||
nextWeek: 'dddd, LT',
|
||
lastDay: '[நேற்று] LT',
|
||
lastWeek: '[கடந்த வாரம்] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s இல்',
|
||
past: '%s முன்',
|
||
s: 'ஒரு சில விநாடிகள்',
|
||
ss: '%d விநாடிகள்',
|
||
m: 'ஒரு நிமிடம்',
|
||
mm: '%d நிமிடங்கள்',
|
||
h: 'ஒரு மணி நேரம்',
|
||
hh: '%d மணி நேரம்',
|
||
d: 'ஒரு நாள்',
|
||
dd: '%d நாட்கள்',
|
||
M: 'ஒரு மாதம்',
|
||
MM: '%d மாதங்கள்',
|
||
y: 'ஒரு வருடம்',
|
||
yy: '%d ஆண்டுகள்',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}வது/,
|
||
ordinal: function (number) {
|
||
return number + 'வது';
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
|
||
return numberMap$g[match];
|
||
});
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/\d/g, function (match) {
|
||
return symbolMap$h[match];
|
||
});
|
||
},
|
||
// refer http://ta.wikipedia.org/s/1er1
|
||
meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 2) {
|
||
return ' யாமம்';
|
||
} else if (hour < 6) {
|
||
return ' வைகறை'; // வைகறை
|
||
} else if (hour < 10) {
|
||
return ' காலை'; // காலை
|
||
} else if (hour < 14) {
|
||
return ' நண்பகல்'; // நண்பகல்
|
||
} else if (hour < 18) {
|
||
return ' எற்பாடு'; // எற்பாடு
|
||
} else if (hour < 22) {
|
||
return ' மாலை'; // மாலை
|
||
} else {
|
||
return ' யாமம்';
|
||
}
|
||
},
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'யாமம்') {
|
||
return hour < 2 ? hour : hour + 12;
|
||
} else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
|
||
return hour;
|
||
} else if (meridiem === 'நண்பகல்') {
|
||
return hour >= 10 ? hour : hour + 12;
|
||
} else {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('te', {
|
||
months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays:
|
||
'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
|
||
weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'A h:mm',
|
||
LTS: 'A h:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY, A h:mm',
|
||
LLLL: 'dddd, D MMMM YYYY, A h:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[నేడు] LT',
|
||
nextDay: '[రేపు] LT',
|
||
nextWeek: 'dddd, LT',
|
||
lastDay: '[నిన్న] LT',
|
||
lastWeek: '[గత] dddd, LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s లో',
|
||
past: '%s క్రితం',
|
||
s: 'కొన్ని క్షణాలు',
|
||
ss: '%d సెకన్లు',
|
||
m: 'ఒక నిమిషం',
|
||
mm: '%d నిమిషాలు',
|
||
h: 'ఒక గంట',
|
||
hh: '%d గంటలు',
|
||
d: 'ఒక రోజు',
|
||
dd: '%d రోజులు',
|
||
M: 'ఒక నెల',
|
||
MM: '%d నెలలు',
|
||
y: 'ఒక సంవత్సరం',
|
||
yy: '%d సంవత్సరాలు',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}వ/,
|
||
ordinal: '%dవ',
|
||
meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'రాత్రి') {
|
||
return hour < 4 ? hour : hour + 12;
|
||
} else if (meridiem === 'ఉదయం') {
|
||
return hour;
|
||
} else if (meridiem === 'మధ్యాహ్నం') {
|
||
return hour >= 10 ? hour : hour + 12;
|
||
} else if (meridiem === 'సాయంత్రం') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'రాత్రి';
|
||
} else if (hour < 10) {
|
||
return 'ఉదయం';
|
||
} else if (hour < 17) {
|
||
return 'మధ్యాహ్నం';
|
||
} else if (hour < 20) {
|
||
return 'సాయంత్రం';
|
||
} else {
|
||
return 'రాత్రి';
|
||
}
|
||
},
|
||
week: {
|
||
dow: 0, // Sunday is the first day of the week.
|
||
doy: 6, // The week that contains Jan 6th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('tet', {
|
||
months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
|
||
weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'),
|
||
weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),
|
||
weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Ohin iha] LT',
|
||
nextDay: '[Aban iha] LT',
|
||
nextWeek: 'dddd [iha] LT',
|
||
lastDay: '[Horiseik iha] LT',
|
||
lastWeek: 'dddd [semana kotuk] [iha] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'iha %s',
|
||
past: '%s liuba',
|
||
s: 'segundu balun',
|
||
ss: 'segundu %d',
|
||
m: 'minutu ida',
|
||
mm: 'minutu %d',
|
||
h: 'oras ida',
|
||
hh: 'oras %d',
|
||
d: 'loron ida',
|
||
dd: 'loron %d',
|
||
M: 'fulan ida',
|
||
MM: 'fulan %d',
|
||
y: 'tinan ida',
|
||
yy: 'tinan %d',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var suffixes$3 = {
|
||
0: '-ум',
|
||
1: '-ум',
|
||
2: '-юм',
|
||
3: '-юм',
|
||
4: '-ум',
|
||
5: '-ум',
|
||
6: '-ум',
|
||
7: '-ум',
|
||
8: '-ум',
|
||
9: '-ум',
|
||
10: '-ум',
|
||
12: '-ум',
|
||
13: '-ум',
|
||
20: '-ум',
|
||
30: '-юм',
|
||
40: '-ум',
|
||
50: '-ум',
|
||
60: '-ум',
|
||
70: '-ум',
|
||
80: '-ум',
|
||
90: '-ум',
|
||
100: '-ум',
|
||
};
|
||
|
||
hooks.defineLocale('tg', {
|
||
months: {
|
||
format: 'январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(
|
||
'_'
|
||
),
|
||
},
|
||
monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
|
||
weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),
|
||
weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Имрӯз соати] LT',
|
||
nextDay: '[Фардо соати] LT',
|
||
lastDay: '[Дирӯз соати] LT',
|
||
nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT',
|
||
lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'баъди %s',
|
||
past: '%s пеш',
|
||
s: 'якчанд сония',
|
||
m: 'як дақиқа',
|
||
mm: '%d дақиқа',
|
||
h: 'як соат',
|
||
hh: '%d соат',
|
||
d: 'як рӯз',
|
||
dd: '%d рӯз',
|
||
M: 'як моҳ',
|
||
MM: '%d моҳ',
|
||
y: 'як сол',
|
||
yy: '%d сол',
|
||
},
|
||
meridiemParse: /шаб|субҳ|рӯз|бегоҳ/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === 'шаб') {
|
||
return hour < 4 ? hour : hour + 12;
|
||
} else if (meridiem === 'субҳ') {
|
||
return hour;
|
||
} else if (meridiem === 'рӯз') {
|
||
return hour >= 11 ? hour : hour + 12;
|
||
} else if (meridiem === 'бегоҳ') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'шаб';
|
||
} else if (hour < 11) {
|
||
return 'субҳ';
|
||
} else if (hour < 16) {
|
||
return 'рӯз';
|
||
} else if (hour < 19) {
|
||
return 'бегоҳ';
|
||
} else {
|
||
return 'шаб';
|
||
}
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-(ум|юм)/,
|
||
ordinal: function (number) {
|
||
var a = number % 10,
|
||
b = number >= 100 ? 100 : null;
|
||
return number + (suffixes$3[number] || suffixes$3[a] || suffixes$3[b]);
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 1th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('th', {
|
||
months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
|
||
weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
|
||
weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'H:mm',
|
||
LTS: 'H:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY เวลา H:mm',
|
||
LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm',
|
||
},
|
||
meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
|
||
isPM: function (input) {
|
||
return input === 'หลังเที่ยง';
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'ก่อนเที่ยง';
|
||
} else {
|
||
return 'หลังเที่ยง';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[วันนี้ เวลา] LT',
|
||
nextDay: '[พรุ่งนี้ เวลา] LT',
|
||
nextWeek: 'dddd[หน้า เวลา] LT',
|
||
lastDay: '[เมื่อวานนี้ เวลา] LT',
|
||
lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'อีก %s',
|
||
past: '%sที่แล้ว',
|
||
s: 'ไม่กี่วินาที',
|
||
ss: '%d วินาที',
|
||
m: '1 นาที',
|
||
mm: '%d นาที',
|
||
h: '1 ชั่วโมง',
|
||
hh: '%d ชั่วโมง',
|
||
d: '1 วัน',
|
||
dd: '%d วัน',
|
||
w: '1 สัปดาห์',
|
||
ww: '%d สัปดาห์',
|
||
M: '1 เดือน',
|
||
MM: '%d เดือน',
|
||
y: '1 ปี',
|
||
yy: '%d ปี',
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var suffixes$4 = {
|
||
1: "'inji",
|
||
5: "'inji",
|
||
8: "'inji",
|
||
70: "'inji",
|
||
80: "'inji",
|
||
2: "'nji",
|
||
7: "'nji",
|
||
20: "'nji",
|
||
50: "'nji",
|
||
3: "'ünji",
|
||
4: "'ünji",
|
||
100: "'ünji",
|
||
6: "'njy",
|
||
9: "'unjy",
|
||
10: "'unjy",
|
||
30: "'unjy",
|
||
60: "'ynjy",
|
||
90: "'ynjy",
|
||
};
|
||
|
||
hooks.defineLocale('tk', {
|
||
months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek'.split('_'),
|
||
weekdays: 'Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Ýek_Duş_Siş_Çar_Pen_Ann_Şen'.split('_'),
|
||
weekdaysMin: 'Ýk_Dş_Sş_Çr_Pn_An_Şn'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[bugün sagat] LT',
|
||
nextDay: '[ertir sagat] LT',
|
||
nextWeek: '[indiki] dddd [sagat] LT',
|
||
lastDay: '[düýn] LT',
|
||
lastWeek: '[geçen] dddd [sagat] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s soň',
|
||
past: '%s öň',
|
||
s: 'birnäçe sekunt',
|
||
m: 'bir minut',
|
||
mm: '%d minut',
|
||
h: 'bir sagat',
|
||
hh: '%d sagat',
|
||
d: 'bir gün',
|
||
dd: '%d gün',
|
||
M: 'bir aý',
|
||
MM: '%d aý',
|
||
y: 'bir ýyl',
|
||
yy: '%d ýyl',
|
||
},
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'd':
|
||
case 'D':
|
||
case 'Do':
|
||
case 'DD':
|
||
return number;
|
||
default:
|
||
if (number === 0) {
|
||
// special case for zero
|
||
return number + "'unjy";
|
||
}
|
||
var a = number % 10,
|
||
b = (number % 100) - a,
|
||
c = number >= 100 ? 100 : null;
|
||
return number + (suffixes$4[a] || suffixes$4[b] || suffixes$4[c]);
|
||
}
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('tl-ph', {
|
||
months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
|
||
weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
|
||
weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'MM/D/YYYY',
|
||
LL: 'MMMM D, YYYY',
|
||
LLL: 'MMMM D, YYYY HH:mm',
|
||
LLLL: 'dddd, MMMM DD, YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: 'LT [ngayong araw]',
|
||
nextDay: '[Bukas ng] LT',
|
||
nextWeek: 'LT [sa susunod na] dddd',
|
||
lastDay: 'LT [kahapon]',
|
||
lastWeek: 'LT [noong nakaraang] dddd',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'sa loob ng %s',
|
||
past: '%s ang nakalipas',
|
||
s: 'ilang segundo',
|
||
ss: '%d segundo',
|
||
m: 'isang minuto',
|
||
mm: '%d minuto',
|
||
h: 'isang oras',
|
||
hh: '%d oras',
|
||
d: 'isang araw',
|
||
dd: '%d araw',
|
||
M: 'isang buwan',
|
||
MM: '%d buwan',
|
||
y: 'isang taon',
|
||
yy: '%d taon',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}/,
|
||
ordinal: function (number) {
|
||
return number;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
|
||
|
||
function translateFuture(output) {
|
||
var time = output;
|
||
time =
|
||
output.indexOf('jaj') !== -1
|
||
? time.slice(0, -3) + 'leS'
|
||
: output.indexOf('jar') !== -1
|
||
? time.slice(0, -3) + 'waQ'
|
||
: output.indexOf('DIS') !== -1
|
||
? time.slice(0, -3) + 'nem'
|
||
: time + ' pIq';
|
||
return time;
|
||
}
|
||
|
||
function translatePast(output) {
|
||
var time = output;
|
||
time =
|
||
output.indexOf('jaj') !== -1
|
||
? time.slice(0, -3) + 'Hu’'
|
||
: output.indexOf('jar') !== -1
|
||
? time.slice(0, -3) + 'wen'
|
||
: output.indexOf('DIS') !== -1
|
||
? time.slice(0, -3) + 'ben'
|
||
: time + ' ret';
|
||
return time;
|
||
}
|
||
|
||
function translate$a(number, withoutSuffix, string, isFuture) {
|
||
var numberNoun = numberAsNoun(number);
|
||
switch (string) {
|
||
case 'ss':
|
||
return numberNoun + ' lup';
|
||
case 'mm':
|
||
return numberNoun + ' tup';
|
||
case 'hh':
|
||
return numberNoun + ' rep';
|
||
case 'dd':
|
||
return numberNoun + ' jaj';
|
||
case 'MM':
|
||
return numberNoun + ' jar';
|
||
case 'yy':
|
||
return numberNoun + ' DIS';
|
||
}
|
||
}
|
||
|
||
function numberAsNoun(number) {
|
||
var hundred = Math.floor((number % 1000) / 100),
|
||
ten = Math.floor((number % 100) / 10),
|
||
one = number % 10,
|
||
word = '';
|
||
if (hundred > 0) {
|
||
word += numbersNouns[hundred] + 'vatlh';
|
||
}
|
||
if (ten > 0) {
|
||
word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH';
|
||
}
|
||
if (one > 0) {
|
||
word += (word !== '' ? ' ' : '') + numbersNouns[one];
|
||
}
|
||
return word === '' ? 'pagh' : word;
|
||
}
|
||
|
||
hooks.defineLocale('tlh', {
|
||
months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort:
|
||
'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
|
||
weekdaysMin:
|
||
'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[DaHjaj] LT',
|
||
nextDay: '[wa’leS] LT',
|
||
nextWeek: 'LLL',
|
||
lastDay: '[wa’Hu’] LT',
|
||
lastWeek: 'LLL',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: translateFuture,
|
||
past: translatePast,
|
||
s: 'puS lup',
|
||
ss: translate$a,
|
||
m: 'wa’ tup',
|
||
mm: translate$a,
|
||
h: 'wa’ rep',
|
||
hh: translate$a,
|
||
d: 'wa’ jaj',
|
||
dd: translate$a,
|
||
M: 'wa’ jar',
|
||
MM: translate$a,
|
||
y: 'wa’ DIS',
|
||
yy: translate$a,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var suffixes$5 = {
|
||
1: "'inci",
|
||
5: "'inci",
|
||
8: "'inci",
|
||
70: "'inci",
|
||
80: "'inci",
|
||
2: "'nci",
|
||
7: "'nci",
|
||
20: "'nci",
|
||
50: "'nci",
|
||
3: "'üncü",
|
||
4: "'üncü",
|
||
100: "'üncü",
|
||
6: "'ncı",
|
||
9: "'uncu",
|
||
10: "'uncu",
|
||
30: "'uncu",
|
||
60: "'ıncı",
|
||
90: "'ıncı",
|
||
};
|
||
|
||
hooks.defineLocale('tr', {
|
||
months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
|
||
weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Paz_Pzt_Sal_Çar_Per_Cum_Cmt'.split('_'),
|
||
weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours < 12) {
|
||
return isLower ? 'öö' : 'ÖÖ';
|
||
} else {
|
||
return isLower ? 'ös' : 'ÖS';
|
||
}
|
||
},
|
||
meridiemParse: /öö|ÖÖ|ös|ÖS/,
|
||
isPM: function (input) {
|
||
return input === 'ös' || input === 'ÖS';
|
||
},
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[bugün saat] LT',
|
||
nextDay: '[yarın saat] LT',
|
||
nextWeek: '[gelecek] dddd [saat] LT',
|
||
lastDay: '[dün] LT',
|
||
lastWeek: '[geçen] dddd [saat] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s sonra',
|
||
past: '%s önce',
|
||
s: 'birkaç saniye',
|
||
ss: '%d saniye',
|
||
m: 'bir dakika',
|
||
mm: '%d dakika',
|
||
h: 'bir saat',
|
||
hh: '%d saat',
|
||
d: 'bir gün',
|
||
dd: '%d gün',
|
||
w: 'bir hafta',
|
||
ww: '%d hafta',
|
||
M: 'bir ay',
|
||
MM: '%d ay',
|
||
y: 'bir yıl',
|
||
yy: '%d yıl',
|
||
},
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'd':
|
||
case 'D':
|
||
case 'Do':
|
||
case 'DD':
|
||
return number;
|
||
default:
|
||
if (number === 0) {
|
||
// special case for zero
|
||
return number + "'ıncı";
|
||
}
|
||
var a = number % 10,
|
||
b = (number % 100) - a,
|
||
c = number >= 100 ? 100 : null;
|
||
return number + (suffixes$5[a] || suffixes$5[b] || suffixes$5[c]);
|
||
}
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
// After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
|
||
// This is currently too difficult (maybe even impossible) to add.
|
||
hooks.defineLocale('tzl', {
|
||
months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
|
||
weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
|
||
weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
|
||
weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH.mm',
|
||
LTS: 'HH.mm.ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D. MMMM [dallas] YYYY',
|
||
LLL: 'D. MMMM [dallas] YYYY HH.mm',
|
||
LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm',
|
||
},
|
||
meridiemParse: /d\'o|d\'a/i,
|
||
isPM: function (input) {
|
||
return "d'o" === input.toLowerCase();
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours > 11) {
|
||
return isLower ? "d'o" : "D'O";
|
||
} else {
|
||
return isLower ? "d'a" : "D'A";
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[oxhi à] LT',
|
||
nextDay: '[demà à] LT',
|
||
nextWeek: 'dddd [à] LT',
|
||
lastDay: '[ieiri à] LT',
|
||
lastWeek: '[sür el] dddd [lasteu à] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'osprei %s',
|
||
past: 'ja%s',
|
||
s: processRelativeTime$a,
|
||
ss: processRelativeTime$a,
|
||
m: processRelativeTime$a,
|
||
mm: processRelativeTime$a,
|
||
h: processRelativeTime$a,
|
||
hh: processRelativeTime$a,
|
||
d: processRelativeTime$a,
|
||
dd: processRelativeTime$a,
|
||
M: processRelativeTime$a,
|
||
MM: processRelativeTime$a,
|
||
y: processRelativeTime$a,
|
||
yy: processRelativeTime$a,
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}\./,
|
||
ordinal: '%d.',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
function processRelativeTime$a(number, withoutSuffix, key, isFuture) {
|
||
var format = {
|
||
s: ['viensas secunds', "'iensas secunds"],
|
||
ss: [number + ' secunds', '' + number + ' secunds'],
|
||
m: ["'n míut", "'iens míut"],
|
||
mm: [number + ' míuts', '' + number + ' míuts'],
|
||
h: ["'n þora", "'iensa þora"],
|
||
hh: [number + ' þoras', '' + number + ' þoras'],
|
||
d: ["'n ziua", "'iensa ziua"],
|
||
dd: [number + ' ziuas', '' + number + ' ziuas'],
|
||
M: ["'n mes", "'iens mes"],
|
||
MM: [number + ' mesen', '' + number + ' mesen'],
|
||
y: ["'n ar", "'iens ar"],
|
||
yy: [number + ' ars', '' + number + ' ars'],
|
||
};
|
||
return isFuture
|
||
? format[key][0]
|
||
: withoutSuffix
|
||
? format[key][0]
|
||
: format[key][1];
|
||
}
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('tzm-latn', {
|
||
months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
|
||
weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
|
||
weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[asdkh g] LT',
|
||
nextDay: '[aska g] LT',
|
||
nextWeek: 'dddd [g] LT',
|
||
lastDay: '[assant g] LT',
|
||
lastWeek: 'dddd [g] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'dadkh s yan %s',
|
||
past: 'yan %s',
|
||
s: 'imik',
|
||
ss: '%d imik',
|
||
m: 'minuḍ',
|
||
mm: '%d minuḍ',
|
||
h: 'saɛa',
|
||
hh: '%d tassaɛin',
|
||
d: 'ass',
|
||
dd: '%d ossan',
|
||
M: 'ayowr',
|
||
MM: '%d iyyirn',
|
||
y: 'asgas',
|
||
yy: '%d isgasn',
|
||
},
|
||
week: {
|
||
dow: 6, // Saturday is the first day of the week.
|
||
doy: 12, // The week that contains Jan 12th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('tzm', {
|
||
months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
|
||
weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
|
||
weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
|
||
nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
|
||
nextWeek: 'dddd [ⴴ] LT',
|
||
lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
|
||
lastWeek: 'dddd [ⴴ] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
|
||
past: 'ⵢⴰⵏ %s',
|
||
s: 'ⵉⵎⵉⴽ',
|
||
ss: '%d ⵉⵎⵉⴽ',
|
||
m: 'ⵎⵉⵏⵓⴺ',
|
||
mm: '%d ⵎⵉⵏⵓⴺ',
|
||
h: 'ⵙⴰⵄⴰ',
|
||
hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
|
||
d: 'ⴰⵙⵙ',
|
||
dd: '%d oⵙⵙⴰⵏ',
|
||
M: 'ⴰⵢoⵓⵔ',
|
||
MM: '%d ⵉⵢⵢⵉⵔⵏ',
|
||
y: 'ⴰⵙⴳⴰⵙ',
|
||
yy: '%d ⵉⵙⴳⴰⵙⵏ',
|
||
},
|
||
week: {
|
||
dow: 6, // Saturday is the first day of the week.
|
||
doy: 12, // The week that contains Jan 12th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('ug-cn', {
|
||
months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
|
||
'_'
|
||
),
|
||
weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
|
||
weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY-MM-DD',
|
||
LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',
|
||
LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
|
||
LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
|
||
},
|
||
meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (
|
||
meridiem === 'يېرىم كېچە' ||
|
||
meridiem === 'سەھەر' ||
|
||
meridiem === 'چۈشتىن بۇرۇن'
|
||
) {
|
||
return hour;
|
||
} else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') {
|
||
return hour + 12;
|
||
} else {
|
||
return hour >= 11 ? hour : hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
var hm = hour * 100 + minute;
|
||
if (hm < 600) {
|
||
return 'يېرىم كېچە';
|
||
} else if (hm < 900) {
|
||
return 'سەھەر';
|
||
} else if (hm < 1130) {
|
||
return 'چۈشتىن بۇرۇن';
|
||
} else if (hm < 1230) {
|
||
return 'چۈش';
|
||
} else if (hm < 1800) {
|
||
return 'چۈشتىن كېيىن';
|
||
} else {
|
||
return 'كەچ';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[بۈگۈن سائەت] LT',
|
||
nextDay: '[ئەتە سائەت] LT',
|
||
nextWeek: '[كېلەركى] dddd [سائەت] LT',
|
||
lastDay: '[تۆنۈگۈن] LT',
|
||
lastWeek: '[ئالدىنقى] dddd [سائەت] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s كېيىن',
|
||
past: '%s بۇرۇن',
|
||
s: 'نەچچە سېكونت',
|
||
ss: '%d سېكونت',
|
||
m: 'بىر مىنۇت',
|
||
mm: '%d مىنۇت',
|
||
h: 'بىر سائەت',
|
||
hh: '%d سائەت',
|
||
d: 'بىر كۈن',
|
||
dd: '%d كۈن',
|
||
M: 'بىر ئاي',
|
||
MM: '%d ئاي',
|
||
y: 'بىر يىل',
|
||
yy: '%d يىل',
|
||
},
|
||
|
||
dayOfMonthOrdinalParse: /\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'd':
|
||
case 'D':
|
||
case 'DDD':
|
||
return number + '-كۈنى';
|
||
case 'w':
|
||
case 'W':
|
||
return number + '-ھەپتە';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/،/g, ',');
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/,/g, '،');
|
||
},
|
||
week: {
|
||
// GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 1st is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
function plural$6(word, num) {
|
||
var forms = word.split('_');
|
||
return num % 10 === 1 && num % 100 !== 11
|
||
? forms[0]
|
||
: num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
|
||
? forms[1]
|
||
: forms[2];
|
||
}
|
||
function relativeTimeWithPlural$4(number, withoutSuffix, key) {
|
||
var format = {
|
||
ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
|
||
mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
|
||
hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
|
||
dd: 'день_дні_днів',
|
||
MM: 'місяць_місяці_місяців',
|
||
yy: 'рік_роки_років',
|
||
};
|
||
if (key === 'm') {
|
||
return withoutSuffix ? 'хвилина' : 'хвилину';
|
||
} else if (key === 'h') {
|
||
return withoutSuffix ? 'година' : 'годину';
|
||
} else {
|
||
return number + ' ' + plural$6(format[key], +number);
|
||
}
|
||
}
|
||
function weekdaysCaseReplace(m, format) {
|
||
var weekdays = {
|
||
nominative:
|
||
'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split(
|
||
'_'
|
||
),
|
||
accusative:
|
||
'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split(
|
||
'_'
|
||
),
|
||
genitive:
|
||
'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split(
|
||
'_'
|
||
),
|
||
},
|
||
nounCase;
|
||
|
||
if (m === true) {
|
||
return weekdays['nominative']
|
||
.slice(1, 7)
|
||
.concat(weekdays['nominative'].slice(0, 1));
|
||
}
|
||
if (!m) {
|
||
return weekdays['nominative'];
|
||
}
|
||
|
||
nounCase = /(\[[ВвУу]\]) ?dddd/.test(format)
|
||
? 'accusative'
|
||
: /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format)
|
||
? 'genitive'
|
||
: 'nominative';
|
||
return weekdays[nounCase][m.day()];
|
||
}
|
||
function processHoursFunction(str) {
|
||
return function () {
|
||
return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
|
||
};
|
||
}
|
||
|
||
hooks.defineLocale('uk', {
|
||
months: {
|
||
format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split(
|
||
'_'
|
||
),
|
||
standalone:
|
||
'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split(
|
||
'_'
|
||
),
|
||
},
|
||
monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split(
|
||
'_'
|
||
),
|
||
weekdays: weekdaysCaseReplace,
|
||
weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
|
||
weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD.MM.YYYY',
|
||
LL: 'D MMMM YYYY р.',
|
||
LLL: 'D MMMM YYYY р., HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY р., HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: processHoursFunction('[Сьогодні '),
|
||
nextDay: processHoursFunction('[Завтра '),
|
||
lastDay: processHoursFunction('[Вчора '),
|
||
nextWeek: processHoursFunction('[У] dddd ['),
|
||
lastWeek: function () {
|
||
switch (this.day()) {
|
||
case 0:
|
||
case 3:
|
||
case 5:
|
||
case 6:
|
||
return processHoursFunction('[Минулої] dddd [').call(this);
|
||
case 1:
|
||
case 2:
|
||
case 4:
|
||
return processHoursFunction('[Минулого] dddd [').call(this);
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'за %s',
|
||
past: '%s тому',
|
||
s: 'декілька секунд',
|
||
ss: relativeTimeWithPlural$4,
|
||
m: relativeTimeWithPlural$4,
|
||
mm: relativeTimeWithPlural$4,
|
||
h: 'годину',
|
||
hh: relativeTimeWithPlural$4,
|
||
d: 'день',
|
||
dd: relativeTimeWithPlural$4,
|
||
M: 'місяць',
|
||
MM: relativeTimeWithPlural$4,
|
||
y: 'рік',
|
||
yy: relativeTimeWithPlural$4,
|
||
},
|
||
// M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
|
||
meridiemParse: /ночі|ранку|дня|вечора/,
|
||
isPM: function (input) {
|
||
return /^(дня|вечора)$/.test(input);
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 4) {
|
||
return 'ночі';
|
||
} else if (hour < 12) {
|
||
return 'ранку';
|
||
} else if (hour < 17) {
|
||
return 'дня';
|
||
} else {
|
||
return 'вечора';
|
||
}
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'M':
|
||
case 'd':
|
||
case 'DDD':
|
||
case 'w':
|
||
case 'W':
|
||
return number + '-й';
|
||
case 'D':
|
||
return number + '-го';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
var months$b = [
|
||
'جنوری',
|
||
'فروری',
|
||
'مارچ',
|
||
'اپریل',
|
||
'مئی',
|
||
'جون',
|
||
'جولائی',
|
||
'اگست',
|
||
'ستمبر',
|
||
'اکتوبر',
|
||
'نومبر',
|
||
'دسمبر',
|
||
],
|
||
days$2 = ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ'];
|
||
|
||
hooks.defineLocale('ur', {
|
||
months: months$b,
|
||
monthsShort: months$b,
|
||
weekdays: days$2,
|
||
weekdaysShort: days$2,
|
||
weekdaysMin: days$2,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd، D MMMM YYYY HH:mm',
|
||
},
|
||
meridiemParse: /صبح|شام/,
|
||
isPM: function (input) {
|
||
return 'شام' === input;
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
if (hour < 12) {
|
||
return 'صبح';
|
||
}
|
||
return 'شام';
|
||
},
|
||
calendar: {
|
||
sameDay: '[آج بوقت] LT',
|
||
nextDay: '[کل بوقت] LT',
|
||
nextWeek: 'dddd [بوقت] LT',
|
||
lastDay: '[گذشتہ روز بوقت] LT',
|
||
lastWeek: '[گذشتہ] dddd [بوقت] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s بعد',
|
||
past: '%s قبل',
|
||
s: 'چند سیکنڈ',
|
||
ss: '%d سیکنڈ',
|
||
m: 'ایک منٹ',
|
||
mm: '%d منٹ',
|
||
h: 'ایک گھنٹہ',
|
||
hh: '%d گھنٹے',
|
||
d: 'ایک دن',
|
||
dd: '%d دن',
|
||
M: 'ایک ماہ',
|
||
MM: '%d ماہ',
|
||
y: 'ایک سال',
|
||
yy: '%d سال',
|
||
},
|
||
preparse: function (string) {
|
||
return string.replace(/،/g, ',');
|
||
},
|
||
postformat: function (string) {
|
||
return string.replace(/,/g, '،');
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('uz-latn', {
|
||
months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
|
||
weekdays:
|
||
'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
|
||
weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'D MMMM YYYY, dddd HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Bugun soat] LT [da]',
|
||
nextDay: '[Ertaga] LT [da]',
|
||
nextWeek: 'dddd [kuni soat] LT [da]',
|
||
lastDay: '[Kecha soat] LT [da]',
|
||
lastWeek: "[O'tgan] dddd [kuni soat] LT [da]",
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'Yaqin %s ichida',
|
||
past: 'Bir necha %s oldin',
|
||
s: 'soniya',
|
||
ss: '%d soniya',
|
||
m: 'bir daqiqa',
|
||
mm: '%d daqiqa',
|
||
h: 'bir soat',
|
||
hh: '%d soat',
|
||
d: 'bir kun',
|
||
dd: '%d kun',
|
||
M: 'bir oy',
|
||
MM: '%d oy',
|
||
y: 'bir yil',
|
||
yy: '%d yil',
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 7th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('uz', {
|
||
months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
|
||
weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
|
||
weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
|
||
weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'D MMMM YYYY, dddd HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Бугун соат] LT [да]',
|
||
nextDay: '[Эртага] LT [да]',
|
||
nextWeek: 'dddd [куни соат] LT [да]',
|
||
lastDay: '[Кеча соат] LT [да]',
|
||
lastWeek: '[Утган] dddd [куни соат] LT [да]',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'Якин %s ичида',
|
||
past: 'Бир неча %s олдин',
|
||
s: 'фурсат',
|
||
ss: '%d фурсат',
|
||
m: 'бир дакика',
|
||
mm: '%d дакика',
|
||
h: 'бир соат',
|
||
hh: '%d соат',
|
||
d: 'бир кун',
|
||
dd: '%d кун',
|
||
M: 'бир ой',
|
||
MM: '%d ой',
|
||
y: 'бир йил',
|
||
yy: '%d йил',
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 7, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('vi', {
|
||
months: 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
|
||
weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
|
||
weekdaysParseExact: true,
|
||
meridiemParse: /sa|ch/i,
|
||
isPM: function (input) {
|
||
return /^ch$/i.test(input);
|
||
},
|
||
meridiem: function (hours, minutes, isLower) {
|
||
if (hours < 12) {
|
||
return isLower ? 'sa' : 'SA';
|
||
} else {
|
||
return isLower ? 'ch' : 'CH';
|
||
}
|
||
},
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM [năm] YYYY',
|
||
LLL: 'D MMMM [năm] YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',
|
||
l: 'DD/M/YYYY',
|
||
ll: 'D MMM YYYY',
|
||
lll: 'D MMM YYYY HH:mm',
|
||
llll: 'ddd, D MMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Hôm nay lúc] LT',
|
||
nextDay: '[Ngày mai lúc] LT',
|
||
nextWeek: 'dddd [tuần tới lúc] LT',
|
||
lastDay: '[Hôm qua lúc] LT',
|
||
lastWeek: 'dddd [tuần trước lúc] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: '%s tới',
|
||
past: '%s trước',
|
||
s: 'vài giây',
|
||
ss: '%d giây',
|
||
m: 'một phút',
|
||
mm: '%d phút',
|
||
h: 'một giờ',
|
||
hh: '%d giờ',
|
||
d: 'một ngày',
|
||
dd: '%d ngày',
|
||
w: 'một tuần',
|
||
ww: '%d tuần',
|
||
M: 'một tháng',
|
||
MM: '%d tháng',
|
||
y: 'một năm',
|
||
yy: '%d năm',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}/,
|
||
ordinal: function (number) {
|
||
return number;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('x-pseudo', {
|
||
months: 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split(
|
||
'_'
|
||
),
|
||
monthsShort:
|
||
'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split(
|
||
'_'
|
||
),
|
||
monthsParseExact: true,
|
||
weekdays:
|
||
'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split(
|
||
'_'
|
||
),
|
||
weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
|
||
weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
|
||
weekdaysParseExact: true,
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY HH:mm',
|
||
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
||
},
|
||
calendar: {
|
||
sameDay: '[T~ódá~ý át] LT',
|
||
nextDay: '[T~ómó~rró~w át] LT',
|
||
nextWeek: 'dddd [át] LT',
|
||
lastDay: '[Ý~ést~érdá~ý át] LT',
|
||
lastWeek: '[L~ást] dddd [át] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'í~ñ %s',
|
||
past: '%s á~gó',
|
||
s: 'á ~féw ~sécó~ñds',
|
||
ss: '%d s~écóñ~ds',
|
||
m: 'á ~míñ~úté',
|
||
mm: '%d m~íñú~tés',
|
||
h: 'á~ñ hó~úr',
|
||
hh: '%d h~óúrs',
|
||
d: 'á ~dáý',
|
||
dd: '%d d~áýs',
|
||
M: 'á ~móñ~th',
|
||
MM: '%d m~óñt~hs',
|
||
y: 'á ~ýéár',
|
||
yy: '%d ý~éárs',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
|
||
ordinal: function (number) {
|
||
var b = number % 10,
|
||
output =
|
||
~~((number % 100) / 10) === 1
|
||
? 'th'
|
||
: b === 1
|
||
? 'st'
|
||
: b === 2
|
||
? 'nd'
|
||
: b === 3
|
||
? 'rd'
|
||
: 'th';
|
||
return number + output;
|
||
},
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('yo', {
|
||
months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split(
|
||
'_'
|
||
),
|
||
monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
|
||
weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
|
||
weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
|
||
weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'h:mm A',
|
||
LTS: 'h:mm:ss A',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'D MMMM YYYY',
|
||
LLL: 'D MMMM YYYY h:mm A',
|
||
LLLL: 'dddd, D MMMM YYYY h:mm A',
|
||
},
|
||
calendar: {
|
||
sameDay: '[Ònì ni] LT',
|
||
nextDay: '[Ọ̀la ni] LT',
|
||
nextWeek: "dddd [Ọsẹ̀ tón'bọ] [ni] LT",
|
||
lastDay: '[Àna ni] LT',
|
||
lastWeek: 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
|
||
sameElse: 'L',
|
||
},
|
||
relativeTime: {
|
||
future: 'ní %s',
|
||
past: '%s kọjá',
|
||
s: 'ìsẹjú aayá die',
|
||
ss: 'aayá %d',
|
||
m: 'ìsẹjú kan',
|
||
mm: 'ìsẹjú %d',
|
||
h: 'wákati kan',
|
||
hh: 'wákati %d',
|
||
d: 'ọjọ́ kan',
|
||
dd: 'ọjọ́ %d',
|
||
M: 'osù kan',
|
||
MM: 'osù %d',
|
||
y: 'ọdún kan',
|
||
yy: 'ọdún %d',
|
||
},
|
||
dayOfMonthOrdinalParse: /ọjọ́\s\d{1,2}/,
|
||
ordinal: 'ọjọ́ %d',
|
||
week: {
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('zh-cn', {
|
||
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
|
||
'_'
|
||
),
|
||
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
|
||
'_'
|
||
),
|
||
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
|
||
weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
|
||
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY/MM/DD',
|
||
LL: 'YYYY年M月D日',
|
||
LLL: 'YYYY年M月D日Ah点mm分',
|
||
LLLL: 'YYYY年M月D日ddddAh点mm分',
|
||
l: 'YYYY/M/D',
|
||
ll: 'YYYY年M月D日',
|
||
lll: 'YYYY年M月D日 HH:mm',
|
||
llll: 'YYYY年M月D日dddd HH:mm',
|
||
},
|
||
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
|
||
return hour;
|
||
} else if (meridiem === '下午' || meridiem === '晚上') {
|
||
return hour + 12;
|
||
} else {
|
||
// '中午'
|
||
return hour >= 11 ? hour : hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
var hm = hour * 100 + minute;
|
||
if (hm < 600) {
|
||
return '凌晨';
|
||
} else if (hm < 900) {
|
||
return '早上';
|
||
} else if (hm < 1130) {
|
||
return '上午';
|
||
} else if (hm < 1230) {
|
||
return '中午';
|
||
} else if (hm < 1800) {
|
||
return '下午';
|
||
} else {
|
||
return '晚上';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[今天]LT',
|
||
nextDay: '[明天]LT',
|
||
nextWeek: function (now) {
|
||
if (now.week() !== this.week()) {
|
||
return '[下]dddLT';
|
||
} else {
|
||
return '[本]dddLT';
|
||
}
|
||
},
|
||
lastDay: '[昨天]LT',
|
||
lastWeek: function (now) {
|
||
if (this.week() !== now.week()) {
|
||
return '[上]dddLT';
|
||
} else {
|
||
return '[本]dddLT';
|
||
}
|
||
},
|
||
sameElse: 'L',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'd':
|
||
case 'D':
|
||
case 'DDD':
|
||
return number + '日';
|
||
case 'M':
|
||
return number + '月';
|
||
case 'w':
|
||
case 'W':
|
||
return number + '周';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
relativeTime: {
|
||
future: '%s后',
|
||
past: '%s前',
|
||
s: '几秒',
|
||
ss: '%d 秒',
|
||
m: '1 分钟',
|
||
mm: '%d 分钟',
|
||
h: '1 小时',
|
||
hh: '%d 小时',
|
||
d: '1 天',
|
||
dd: '%d 天',
|
||
w: '1 周',
|
||
ww: '%d 周',
|
||
M: '1 个月',
|
||
MM: '%d 个月',
|
||
y: '1 年',
|
||
yy: '%d 年',
|
||
},
|
||
week: {
|
||
// GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
|
||
dow: 1, // Monday is the first day of the week.
|
||
doy: 4, // The week that contains Jan 4th is the first week of the year.
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('zh-hk', {
|
||
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
|
||
'_'
|
||
),
|
||
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
|
||
'_'
|
||
),
|
||
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
|
||
weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
|
||
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY/MM/DD',
|
||
LL: 'YYYY年M月D日',
|
||
LLL: 'YYYY年M月D日 HH:mm',
|
||
LLLL: 'YYYY年M月D日dddd HH:mm',
|
||
l: 'YYYY/M/D',
|
||
ll: 'YYYY年M月D日',
|
||
lll: 'YYYY年M月D日 HH:mm',
|
||
llll: 'YYYY年M月D日dddd HH:mm',
|
||
},
|
||
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
|
||
return hour;
|
||
} else if (meridiem === '中午') {
|
||
return hour >= 11 ? hour : hour + 12;
|
||
} else if (meridiem === '下午' || meridiem === '晚上') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
var hm = hour * 100 + minute;
|
||
if (hm < 600) {
|
||
return '凌晨';
|
||
} else if (hm < 900) {
|
||
return '早上';
|
||
} else if (hm < 1200) {
|
||
return '上午';
|
||
} else if (hm === 1200) {
|
||
return '中午';
|
||
} else if (hm < 1800) {
|
||
return '下午';
|
||
} else {
|
||
return '晚上';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[今天]LT',
|
||
nextDay: '[明天]LT',
|
||
nextWeek: '[下]ddddLT',
|
||
lastDay: '[昨天]LT',
|
||
lastWeek: '[上]ddddLT',
|
||
sameElse: 'L',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'd':
|
||
case 'D':
|
||
case 'DDD':
|
||
return number + '日';
|
||
case 'M':
|
||
return number + '月';
|
||
case 'w':
|
||
case 'W':
|
||
return number + '週';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
relativeTime: {
|
||
future: '%s後',
|
||
past: '%s前',
|
||
s: '幾秒',
|
||
ss: '%d 秒',
|
||
m: '1 分鐘',
|
||
mm: '%d 分鐘',
|
||
h: '1 小時',
|
||
hh: '%d 小時',
|
||
d: '1 天',
|
||
dd: '%d 天',
|
||
M: '1 個月',
|
||
MM: '%d 個月',
|
||
y: '1 年',
|
||
yy: '%d 年',
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('zh-mo', {
|
||
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
|
||
'_'
|
||
),
|
||
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
|
||
'_'
|
||
),
|
||
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
|
||
weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
|
||
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'DD/MM/YYYY',
|
||
LL: 'YYYY年M月D日',
|
||
LLL: 'YYYY年M月D日 HH:mm',
|
||
LLLL: 'YYYY年M月D日dddd HH:mm',
|
||
l: 'D/M/YYYY',
|
||
ll: 'YYYY年M月D日',
|
||
lll: 'YYYY年M月D日 HH:mm',
|
||
llll: 'YYYY年M月D日dddd HH:mm',
|
||
},
|
||
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
|
||
return hour;
|
||
} else if (meridiem === '中午') {
|
||
return hour >= 11 ? hour : hour + 12;
|
||
} else if (meridiem === '下午' || meridiem === '晚上') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
var hm = hour * 100 + minute;
|
||
if (hm < 600) {
|
||
return '凌晨';
|
||
} else if (hm < 900) {
|
||
return '早上';
|
||
} else if (hm < 1130) {
|
||
return '上午';
|
||
} else if (hm < 1230) {
|
||
return '中午';
|
||
} else if (hm < 1800) {
|
||
return '下午';
|
||
} else {
|
||
return '晚上';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[今天] LT',
|
||
nextDay: '[明天] LT',
|
||
nextWeek: '[下]dddd LT',
|
||
lastDay: '[昨天] LT',
|
||
lastWeek: '[上]dddd LT',
|
||
sameElse: 'L',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'd':
|
||
case 'D':
|
||
case 'DDD':
|
||
return number + '日';
|
||
case 'M':
|
||
return number + '月';
|
||
case 'w':
|
||
case 'W':
|
||
return number + '週';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
relativeTime: {
|
||
future: '%s內',
|
||
past: '%s前',
|
||
s: '幾秒',
|
||
ss: '%d 秒',
|
||
m: '1 分鐘',
|
||
mm: '%d 分鐘',
|
||
h: '1 小時',
|
||
hh: '%d 小時',
|
||
d: '1 天',
|
||
dd: '%d 天',
|
||
M: '1 個月',
|
||
MM: '%d 個月',
|
||
y: '1 年',
|
||
yy: '%d 年',
|
||
},
|
||
});
|
||
|
||
//! moment.js locale configuration
|
||
|
||
hooks.defineLocale('zh-tw', {
|
||
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
|
||
'_'
|
||
),
|
||
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
|
||
'_'
|
||
),
|
||
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
|
||
weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
|
||
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
|
||
longDateFormat: {
|
||
LT: 'HH:mm',
|
||
LTS: 'HH:mm:ss',
|
||
L: 'YYYY/MM/DD',
|
||
LL: 'YYYY年M月D日',
|
||
LLL: 'YYYY年M月D日 HH:mm',
|
||
LLLL: 'YYYY年M月D日dddd HH:mm',
|
||
l: 'YYYY/M/D',
|
||
ll: 'YYYY年M月D日',
|
||
lll: 'YYYY年M月D日 HH:mm',
|
||
llll: 'YYYY年M月D日dddd HH:mm',
|
||
},
|
||
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
|
||
meridiemHour: function (hour, meridiem) {
|
||
if (hour === 12) {
|
||
hour = 0;
|
||
}
|
||
if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
|
||
return hour;
|
||
} else if (meridiem === '中午') {
|
||
return hour >= 11 ? hour : hour + 12;
|
||
} else if (meridiem === '下午' || meridiem === '晚上') {
|
||
return hour + 12;
|
||
}
|
||
},
|
||
meridiem: function (hour, minute, isLower) {
|
||
var hm = hour * 100 + minute;
|
||
if (hm < 600) {
|
||
return '凌晨';
|
||
} else if (hm < 900) {
|
||
return '早上';
|
||
} else if (hm < 1130) {
|
||
return '上午';
|
||
} else if (hm < 1230) {
|
||
return '中午';
|
||
} else if (hm < 1800) {
|
||
return '下午';
|
||
} else {
|
||
return '晚上';
|
||
}
|
||
},
|
||
calendar: {
|
||
sameDay: '[今天] LT',
|
||
nextDay: '[明天] LT',
|
||
nextWeek: '[下]dddd LT',
|
||
lastDay: '[昨天] LT',
|
||
lastWeek: '[上]dddd LT',
|
||
sameElse: 'L',
|
||
},
|
||
dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
|
||
ordinal: function (number, period) {
|
||
switch (period) {
|
||
case 'd':
|
||
case 'D':
|
||
case 'DDD':
|
||
return number + '日';
|
||
case 'M':
|
||
return number + '月';
|
||
case 'w':
|
||
case 'W':
|
||
return number + '週';
|
||
default:
|
||
return number;
|
||
}
|
||
},
|
||
relativeTime: {
|
||
future: '%s後',
|
||
past: '%s前',
|
||
s: '幾秒',
|
||
ss: '%d 秒',
|
||
m: '1 分鐘',
|
||
mm: '%d 分鐘',
|
||
h: '1 小時',
|
||
hh: '%d 小時',
|
||
d: '1 天',
|
||
dd: '%d 天',
|
||
M: '1 個月',
|
||
MM: '%d 個月',
|
||
y: '1 年',
|
||
yy: '%d 年',
|
||
},
|
||
});
|
||
|
||
hooks.locale('en');
|
||
|
||
return hooks;
|
||
|
||
})));
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-gettext/lib/gettext.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/node-gettext/lib/gettext.js ***!
|
||
\**************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
|
||
var get = __webpack_require__(/*! lodash.get */ "./node_modules/lodash.get/index.js");
|
||
var plurals = __webpack_require__(/*! ./plurals */ "./node_modules/node-gettext/lib/plurals.js");
|
||
|
||
module.exports = Gettext;
|
||
|
||
/**
|
||
* Creates and returns a new Gettext instance.
|
||
*
|
||
* @constructor
|
||
* @param {Object} [options] A set of options
|
||
* @param {String} options.sourceLocale The locale that the source code and its
|
||
* texts are written in. Translations for
|
||
* this locale is not necessary.
|
||
* @param {Boolean} options.debug Whether to output debug info into the
|
||
* console.
|
||
* @return {Object} A Gettext instance
|
||
*/
|
||
function Gettext(options) {
|
||
options = options || {};
|
||
|
||
this.catalogs = {};
|
||
this.locale = '';
|
||
this.domain = 'messages';
|
||
|
||
this.listeners = [];
|
||
|
||
// Set source locale
|
||
this.sourceLocale = '';
|
||
if (options.sourceLocale) {
|
||
if (typeof options.sourceLocale === 'string') {
|
||
this.sourceLocale = options.sourceLocale;
|
||
}
|
||
else {
|
||
this.warn('The `sourceLocale` option should be a string');
|
||
}
|
||
}
|
||
|
||
// Set debug flag
|
||
this.debug = 'debug' in options && options.debug === true;
|
||
}
|
||
|
||
/**
|
||
* Adds an event listener.
|
||
*
|
||
* @param {String} eventName An event name
|
||
* @param {Function} callback An event handler function
|
||
*/
|
||
Gettext.prototype.on = function(eventName, callback) {
|
||
this.listeners.push({
|
||
eventName: eventName,
|
||
callback: callback
|
||
});
|
||
};
|
||
|
||
/**
|
||
* Removes an event listener.
|
||
*
|
||
* @param {String} eventName An event name
|
||
* @param {Function} callback A previously registered event handler function
|
||
*/
|
||
Gettext.prototype.off = function(eventName, callback) {
|
||
this.listeners = this.listeners.filter(function(listener) {
|
||
return (
|
||
listener.eventName === eventName &&
|
||
listener.callback === callback
|
||
) === false;
|
||
});
|
||
};
|
||
|
||
/**
|
||
* Emits an event to all registered event listener.
|
||
*
|
||
* @private
|
||
* @param {String} eventName An event name
|
||
* @param {any} eventData Data to pass to event listeners
|
||
*/
|
||
Gettext.prototype.emit = function(eventName, eventData) {
|
||
for (var i = 0; i < this.listeners.length; i++) {
|
||
var listener = this.listeners[i];
|
||
if (listener.eventName === eventName) {
|
||
listener.callback(eventData);
|
||
}
|
||
}
|
||
};
|
||
|
||
/**
|
||
* Logs a warning to the console if debug mode is enabled.
|
||
*
|
||
* @ignore
|
||
* @param {String} message A warning message
|
||
*/
|
||
Gettext.prototype.warn = function(message) {
|
||
if (this.debug) {
|
||
console.warn(message);
|
||
}
|
||
|
||
this.emit('error', new Error(message));
|
||
};
|
||
|
||
/**
|
||
* Stores a set of translations in the set of gettext
|
||
* catalogs.
|
||
*
|
||
* @example
|
||
* gt.addTranslations('sv-SE', 'messages', translationsObject)
|
||
*
|
||
* @param {String} locale A locale string
|
||
* @param {String} domain A domain name
|
||
* @param {Object} translations An object of gettext-parser JSON shape
|
||
*/
|
||
Gettext.prototype.addTranslations = function(locale, domain, translations) {
|
||
if (!this.catalogs[locale]) {
|
||
this.catalogs[locale] = {};
|
||
}
|
||
|
||
this.catalogs[locale][domain] = translations;
|
||
};
|
||
|
||
/**
|
||
* Sets the locale to get translated messages for.
|
||
*
|
||
* @example
|
||
* gt.setLocale('sv-SE')
|
||
*
|
||
* @param {String} locale A locale
|
||
*/
|
||
Gettext.prototype.setLocale = function(locale) {
|
||
if (typeof locale !== 'string') {
|
||
this.warn(
|
||
'You called setLocale() with an argument of type ' + (typeof locale) + '. ' +
|
||
'The locale must be a string.'
|
||
);
|
||
return;
|
||
}
|
||
|
||
if (locale.trim() === '') {
|
||
this.warn('You called setLocale() with an empty value, which makes little sense.');
|
||
}
|
||
|
||
if (locale !== this.sourceLocale && !this.catalogs[locale]) {
|
||
this.warn('You called setLocale() with "' + locale + '", but no translations for that locale has been added.');
|
||
}
|
||
|
||
this.locale = locale;
|
||
};
|
||
|
||
/**
|
||
* Sets the default gettext domain.
|
||
*
|
||
* @example
|
||
* gt.setTextDomain('domainname')
|
||
*
|
||
* @param {String} domain A gettext domain name
|
||
*/
|
||
Gettext.prototype.setTextDomain = function(domain) {
|
||
if (typeof domain !== 'string') {
|
||
this.warn(
|
||
'You called setTextDomain() with an argument of type ' + (typeof domain) + '. ' +
|
||
'The domain must be a string.'
|
||
);
|
||
return;
|
||
}
|
||
|
||
if (domain.trim() === '') {
|
||
this.warn('You called setTextDomain() with an empty `domain` value.');
|
||
}
|
||
|
||
this.domain = domain;
|
||
};
|
||
|
||
/**
|
||
* Translates a string using the default textdomain
|
||
*
|
||
* @example
|
||
* gt.gettext('Some text')
|
||
*
|
||
* @param {String} msgid String to be translated
|
||
* @return {String} Translation or the original string if no translation was found
|
||
*/
|
||
Gettext.prototype.gettext = function(msgid) {
|
||
return this.dnpgettext(this.domain, '', msgid);
|
||
};
|
||
|
||
/**
|
||
* Translates a string using a specific domain
|
||
*
|
||
* @example
|
||
* gt.dgettext('domainname', 'Some text')
|
||
*
|
||
* @param {String} domain A gettext domain name
|
||
* @param {String} msgid String to be translated
|
||
* @return {String} Translation or the original string if no translation was found
|
||
*/
|
||
Gettext.prototype.dgettext = function(domain, msgid) {
|
||
return this.dnpgettext(domain, '', msgid);
|
||
};
|
||
|
||
/**
|
||
* Translates a plural string using the default textdomain
|
||
*
|
||
* @example
|
||
* gt.ngettext('One thing', 'Many things', numberOfThings)
|
||
*
|
||
* @param {String} msgid String to be translated when count is not plural
|
||
* @param {String} msgidPlural String to be translated when count is plural
|
||
* @param {Number} count Number count for the plural
|
||
* @return {String} Translation or the original string if no translation was found
|
||
*/
|
||
Gettext.prototype.ngettext = function(msgid, msgidPlural, count) {
|
||
return this.dnpgettext(this.domain, '', msgid, msgidPlural, count);
|
||
};
|
||
|
||
/**
|
||
* Translates a plural string using a specific textdomain
|
||
*
|
||
* @example
|
||
* gt.dngettext('domainname', 'One thing', 'Many things', numberOfThings)
|
||
*
|
||
* @param {String} domain A gettext domain name
|
||
* @param {String} msgid String to be translated when count is not plural
|
||
* @param {String} msgidPlural String to be translated when count is plural
|
||
* @param {Number} count Number count for the plural
|
||
* @return {String} Translation or the original string if no translation was found
|
||
*/
|
||
Gettext.prototype.dngettext = function(domain, msgid, msgidPlural, count) {
|
||
return this.dnpgettext(domain, '', msgid, msgidPlural, count);
|
||
};
|
||
|
||
/**
|
||
* Translates a string from a specific context using the default textdomain
|
||
*
|
||
* @example
|
||
* gt.pgettext('sports', 'Back')
|
||
*
|
||
* @param {String} msgctxt Translation context
|
||
* @param {String} msgid String to be translated
|
||
* @return {String} Translation or the original string if no translation was found
|
||
*/
|
||
Gettext.prototype.pgettext = function(msgctxt, msgid) {
|
||
return this.dnpgettext(this.domain, msgctxt, msgid);
|
||
};
|
||
|
||
/**
|
||
* Translates a string from a specific context using s specific textdomain
|
||
*
|
||
* @example
|
||
* gt.dpgettext('domainname', 'sports', 'Back')
|
||
*
|
||
* @param {String} domain A gettext domain name
|
||
* @param {String} msgctxt Translation context
|
||
* @param {String} msgid String to be translated
|
||
* @return {String} Translation or the original string if no translation was found
|
||
*/
|
||
Gettext.prototype.dpgettext = function(domain, msgctxt, msgid) {
|
||
return this.dnpgettext(domain, msgctxt, msgid);
|
||
};
|
||
|
||
/**
|
||
* Translates a plural string from a specific context using the default textdomain
|
||
*
|
||
* @example
|
||
* gt.npgettext('sports', 'Back', '%d backs', numberOfBacks)
|
||
*
|
||
* @param {String} msgctxt Translation context
|
||
* @param {String} msgid String to be translated when count is not plural
|
||
* @param {String} msgidPlural String to be translated when count is plural
|
||
* @param {Number} count Number count for the plural
|
||
* @return {String} Translation or the original string if no translation was found
|
||
*/
|
||
Gettext.prototype.npgettext = function(msgctxt, msgid, msgidPlural, count) {
|
||
return this.dnpgettext(this.domain, msgctxt, msgid, msgidPlural, count);
|
||
};
|
||
|
||
/**
|
||
* Translates a plural string from a specifi context using a specific textdomain
|
||
*
|
||
* @example
|
||
* gt.dnpgettext('domainname', 'sports', 'Back', '%d backs', numberOfBacks)
|
||
*
|
||
* @param {String} domain A gettext domain name
|
||
* @param {String} msgctxt Translation context
|
||
* @param {String} msgid String to be translated
|
||
* @param {String} msgidPlural If no translation was found, return this on count!=1
|
||
* @param {Number} count Number count for the plural
|
||
* @return {String} Translation or the original string if no translation was found
|
||
*/
|
||
Gettext.prototype.dnpgettext = function(domain, msgctxt, msgid, msgidPlural, count) {
|
||
var defaultTranslation = msgid;
|
||
var translation;
|
||
var index;
|
||
|
||
msgctxt = msgctxt || '';
|
||
|
||
if (!isNaN(count) && count !== 1) {
|
||
defaultTranslation = msgidPlural || msgid;
|
||
}
|
||
|
||
translation = this._getTranslation(domain, msgctxt, msgid);
|
||
|
||
if (translation) {
|
||
if (typeof count === 'number') {
|
||
var pluralsFunc = plurals[Gettext.getLanguageCode(this.locale)].pluralsFunc;
|
||
index = pluralsFunc(count);
|
||
if (typeof index === 'boolean') {
|
||
index = index ? 1 : 0;
|
||
}
|
||
} else {
|
||
index = 0;
|
||
}
|
||
|
||
return translation.msgstr[index] || defaultTranslation;
|
||
}
|
||
else if (!this.sourceLocale || this.locale !== this.sourceLocale) {
|
||
this.warn('No translation was found for msgid "' + msgid + '" in msgctxt "' + msgctxt + '" and domain "' + domain + '"');
|
||
}
|
||
|
||
return defaultTranslation;
|
||
};
|
||
|
||
/**
|
||
* Retrieves comments object for a translation. The comments object
|
||
* has the shape `{ translator, extracted, reference, flag, previous }`.
|
||
*
|
||
* @example
|
||
* const comment = gt.getComment('domainname', 'sports', 'Backs')
|
||
*
|
||
* @private
|
||
* @param {String} domain A gettext domain name
|
||
* @param {String} msgctxt Translation context
|
||
* @param {String} msgid String to be translated
|
||
* @return {Object} Comments object or false if not found
|
||
*/
|
||
Gettext.prototype.getComment = function(domain, msgctxt, msgid) {
|
||
var translation;
|
||
|
||
translation = this._getTranslation(domain, msgctxt, msgid);
|
||
if (translation) {
|
||
return translation.comments || {};
|
||
}
|
||
|
||
return {};
|
||
};
|
||
|
||
/**
|
||
* Retrieves translation object from the domain and context
|
||
*
|
||
* @private
|
||
* @param {String} domain A gettext domain name
|
||
* @param {String} msgctxt Translation context
|
||
* @param {String} msgid String to be translated
|
||
* @return {Object} Translation object or false if not found
|
||
*/
|
||
Gettext.prototype._getTranslation = function(domain, msgctxt, msgid) {
|
||
msgctxt = msgctxt || '';
|
||
|
||
return get(this.catalogs, [this.locale, domain, 'translations', msgctxt, msgid]);
|
||
};
|
||
|
||
/**
|
||
* Returns the language code part of a locale
|
||
*
|
||
* @example
|
||
* Gettext.getLanguageCode('sv-SE')
|
||
* // -> "sv"
|
||
*
|
||
* @private
|
||
* @param {String} locale A case-insensitive locale string
|
||
* @returns {String} A language code
|
||
*/
|
||
Gettext.getLanguageCode = function(locale) {
|
||
return locale.split(/[\-_]/)[0].toLowerCase();
|
||
};
|
||
|
||
/* C-style aliases */
|
||
|
||
/**
|
||
* C-style alias for [setTextDomain](#gettextsettextdomaindomain)
|
||
*
|
||
* @see Gettext#setTextDomain
|
||
*/
|
||
Gettext.prototype.textdomain = function(domain) {
|
||
if (this.debug) {
|
||
console.warn('textdomain(domain) was used to set locales in node-gettext v1. ' +
|
||
'Make sure you are using it for domains, and switch to setLocale(locale) if you are not.\n\n ' +
|
||
'To read more about the migration from node-gettext v1 to v2, ' +
|
||
'see https://github.com/alexanderwallin/node-gettext/#migrating-from-1x-to-2x\n\n' +
|
||
'This warning will be removed in the final 2.0.0');
|
||
}
|
||
|
||
this.setTextDomain(domain);
|
||
};
|
||
|
||
/**
|
||
* C-style alias for [setLocale](#gettextsetlocalelocale)
|
||
*
|
||
* @see Gettext#setLocale
|
||
*/
|
||
Gettext.prototype.setlocale = function(locale) {
|
||
this.setLocale(locale);
|
||
};
|
||
|
||
/* Deprecated functions */
|
||
|
||
/**
|
||
* This function will be removed in the final 2.0.0 release.
|
||
*
|
||
* @deprecated
|
||
*/
|
||
Gettext.prototype.addTextdomain = function() {
|
||
console.error('addTextdomain() is deprecated.\n\n' +
|
||
'* To add translations, use addTranslations()\n' +
|
||
'* To set the default domain, use setTextDomain() (or its alias textdomain())\n' +
|
||
'\n' +
|
||
'To read more about the migration from node-gettext v1 to v2, ' +
|
||
'see https://github.com/alexanderwallin/node-gettext/#migrating-from-1x-to-2x');
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/node-gettext/lib/plurals.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/node-gettext/lib/plurals.js ***!
|
||
\**************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
|
||
module.exports = {
|
||
ach: {
|
||
name: 'Acholi',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
af: {
|
||
name: 'Afrikaans',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ak: {
|
||
name: 'Akan',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
am: {
|
||
name: 'Amharic',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
an: {
|
||
name: 'Aragonese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ar: {
|
||
name: 'Arabic',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 0
|
||
}, {
|
||
plural: 1,
|
||
sample: 1
|
||
}, {
|
||
plural: 2,
|
||
sample: 2
|
||
}, {
|
||
plural: 3,
|
||
sample: 3
|
||
}, {
|
||
plural: 4,
|
||
sample: 11
|
||
}, {
|
||
plural: 5,
|
||
sample: 100
|
||
}],
|
||
nplurals: 6,
|
||
pluralsText: 'nplurals = 6; plural = (n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5);
|
||
}
|
||
},
|
||
arn: {
|
||
name: 'Mapudungun',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
ast: {
|
||
name: 'Asturian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ay: {
|
||
name: 'Aymará',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
az: {
|
||
name: 'Azerbaijani',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
be: {
|
||
name: 'Belarusian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 5
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
||
}
|
||
},
|
||
bg: {
|
||
name: 'Bulgarian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
bn: {
|
||
name: 'Bengali',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
bo: {
|
||
name: 'Tibetan',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
br: {
|
||
name: 'Breton',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
brx: {
|
||
name: 'Bodo',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
bs: {
|
||
name: 'Bosnian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 5
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
||
}
|
||
},
|
||
ca: {
|
||
name: 'Catalan',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
cgg: {
|
||
name: 'Chiga',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
cs: {
|
||
name: 'Czech',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 5
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n === 1 ? 0 : (n >= 2 && n <= 4) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 1 ? 0 : (n >= 2 && n <= 4) ? 1 : 2);
|
||
}
|
||
},
|
||
csb: {
|
||
name: 'Kashubian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 5
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n === 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
||
}
|
||
},
|
||
cy: {
|
||
name: 'Welsh',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 3
|
||
}, {
|
||
plural: 3,
|
||
sample: 8
|
||
}],
|
||
nplurals: 4,
|
||
pluralsText: 'nplurals = 4; plural = (n === 1 ? 0 : n === 2 ? 1 : (n !== 8 && n !== 11) ? 2 : 3)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 1 ? 0 : n === 2 ? 1 : (n !== 8 && n !== 11) ? 2 : 3);
|
||
}
|
||
},
|
||
da: {
|
||
name: 'Danish',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
de: {
|
||
name: 'German',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
doi: {
|
||
name: 'Dogri',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
dz: {
|
||
name: 'Dzongkha',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
el: {
|
||
name: 'Greek',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
en: {
|
||
name: 'English',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
eo: {
|
||
name: 'Esperanto',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
es: {
|
||
name: 'Spanish',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
et: {
|
||
name: 'Estonian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
eu: {
|
||
name: 'Basque',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
fa: {
|
||
name: 'Persian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
ff: {
|
||
name: 'Fulah',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
fi: {
|
||
name: 'Finnish',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
fil: {
|
||
name: 'Filipino',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
fo: {
|
||
name: 'Faroese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
fr: {
|
||
name: 'French',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
fur: {
|
||
name: 'Friulian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
fy: {
|
||
name: 'Frisian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ga: {
|
||
name: 'Irish',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 3
|
||
}, {
|
||
plural: 3,
|
||
sample: 7
|
||
}, {
|
||
plural: 4,
|
||
sample: 11
|
||
}],
|
||
nplurals: 5,
|
||
pluralsText: 'nplurals = 5; plural = (n === 1 ? 0 : n === 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 1 ? 0 : n === 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4);
|
||
}
|
||
},
|
||
gd: {
|
||
name: 'Scottish Gaelic',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 3
|
||
}, {
|
||
plural: 3,
|
||
sample: 20
|
||
}],
|
||
nplurals: 4,
|
||
pluralsText: 'nplurals = 4; plural = ((n === 1 || n === 11) ? 0 : (n === 2 || n === 12) ? 1 : (n > 2 && n < 20) ? 2 : 3)',
|
||
pluralsFunc: function(n) {
|
||
return ((n === 1 || n === 11) ? 0 : (n === 2 || n === 12) ? 1 : (n > 2 && n < 20) ? 2 : 3);
|
||
}
|
||
},
|
||
gl: {
|
||
name: 'Galician',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
gu: {
|
||
name: 'Gujarati',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
gun: {
|
||
name: 'Gun',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
ha: {
|
||
name: 'Hausa',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
he: {
|
||
name: 'Hebrew',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
hi: {
|
||
name: 'Hindi',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
hne: {
|
||
name: 'Chhattisgarhi',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
hr: {
|
||
name: 'Croatian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 5
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
||
}
|
||
},
|
||
hu: {
|
||
name: 'Hungarian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
hy: {
|
||
name: 'Armenian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
id: {
|
||
name: 'Indonesian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
is: {
|
||
name: 'Icelandic',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n % 10 !== 1 || n % 100 === 11)',
|
||
pluralsFunc: function(n) {
|
||
return (n % 10 !== 1 || n % 100 === 11);
|
||
}
|
||
},
|
||
it: {
|
||
name: 'Italian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ja: {
|
||
name: 'Japanese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
jbo: {
|
||
name: 'Lojban',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
jv: {
|
||
name: 'Javanese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 0
|
||
}, {
|
||
plural: 1,
|
||
sample: 1
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 0)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 0);
|
||
}
|
||
},
|
||
ka: {
|
||
name: 'Georgian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
kk: {
|
||
name: 'Kazakh',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
km: {
|
||
name: 'Khmer',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
kn: {
|
||
name: 'Kannada',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ko: {
|
||
name: 'Korean',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
ku: {
|
||
name: 'Kurdish',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
kw: {
|
||
name: 'Cornish',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 3
|
||
}, {
|
||
plural: 3,
|
||
sample: 4
|
||
}],
|
||
nplurals: 4,
|
||
pluralsText: 'nplurals = 4; plural = (n === 1 ? 0 : n === 2 ? 1 : n === 3 ? 2 : 3)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 1 ? 0 : n === 2 ? 1 : n === 3 ? 2 : 3);
|
||
}
|
||
},
|
||
ky: {
|
||
name: 'Kyrgyz',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
lb: {
|
||
name: 'Letzeburgesch',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ln: {
|
||
name: 'Lingala',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
lo: {
|
||
name: 'Lao',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
lt: {
|
||
name: 'Lithuanian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 10
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
||
}
|
||
},
|
||
lv: {
|
||
name: 'Latvian',
|
||
examples: [{
|
||
plural: 2,
|
||
sample: 0
|
||
}, {
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n % 10 === 1 && n % 100 !== 11 ? 0 : n !== 0 ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n % 10 === 1 && n % 100 !== 11 ? 0 : n !== 0 ? 1 : 2);
|
||
}
|
||
},
|
||
mai: {
|
||
name: 'Maithili',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
mfe: {
|
||
name: 'Mauritian Creole',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
mg: {
|
||
name: 'Malagasy',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
mi: {
|
||
name: 'Maori',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
mk: {
|
||
name: 'Macedonian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n === 1 || n % 10 === 1 ? 0 : 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 1 || n % 10 === 1 ? 0 : 1);
|
||
}
|
||
},
|
||
ml: {
|
||
name: 'Malayalam',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
mn: {
|
||
name: 'Mongolian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
mni: {
|
||
name: 'Manipuri',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
mnk: {
|
||
name: 'Mandinka',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 0
|
||
}, {
|
||
plural: 1,
|
||
sample: 1
|
||
}, {
|
||
plural: 2,
|
||
sample: 2
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n === 0 ? 0 : n === 1 ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 0 ? 0 : n === 1 ? 1 : 2);
|
||
}
|
||
},
|
||
mr: {
|
||
name: 'Marathi',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ms: {
|
||
name: 'Malay',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
mt: {
|
||
name: 'Maltese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 11
|
||
}, {
|
||
plural: 3,
|
||
sample: 20
|
||
}],
|
||
nplurals: 4,
|
||
pluralsText: 'nplurals = 4; plural = (n === 1 ? 0 : n === 0 || ( n % 100 > 1 && n % 100 < 11) ? 1 : (n % 100 > 10 && n % 100 < 20 ) ? 2 : 3)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 1 ? 0 : n === 0 || (n % 100 > 1 && n % 100 < 11) ? 1 : (n % 100 > 10 && n % 100 < 20) ? 2 : 3);
|
||
}
|
||
},
|
||
my: {
|
||
name: 'Burmese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
nah: {
|
||
name: 'Nahuatl',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
nap: {
|
||
name: 'Neapolitan',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
nb: {
|
||
name: 'Norwegian Bokmal',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ne: {
|
||
name: 'Nepali',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
nl: {
|
||
name: 'Dutch',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
nn: {
|
||
name: 'Norwegian Nynorsk',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
no: {
|
||
name: 'Norwegian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
nso: {
|
||
name: 'Northern Sotho',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
oc: {
|
||
name: 'Occitan',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
or: {
|
||
name: 'Oriya',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
pa: {
|
||
name: 'Punjabi',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
pap: {
|
||
name: 'Papiamento',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
pl: {
|
||
name: 'Polish',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 5
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n === 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
||
}
|
||
},
|
||
pms: {
|
||
name: 'Piemontese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ps: {
|
||
name: 'Pashto',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
pt: {
|
||
name: 'Portuguese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
rm: {
|
||
name: 'Romansh',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ro: {
|
||
name: 'Romanian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 20
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n === 1 ? 0 : (n === 0 || (n % 100 > 0 && n % 100 < 20)) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 1 ? 0 : (n === 0 || (n % 100 > 0 && n % 100 < 20)) ? 1 : 2);
|
||
}
|
||
},
|
||
ru: {
|
||
name: 'Russian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 5
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
||
}
|
||
},
|
||
rw: {
|
||
name: 'Kinyarwanda',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
sah: {
|
||
name: 'Yakut',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
sat: {
|
||
name: 'Santali',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
sco: {
|
||
name: 'Scots',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
sd: {
|
||
name: 'Sindhi',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
se: {
|
||
name: 'Northern Sami',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
si: {
|
||
name: 'Sinhala',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
sk: {
|
||
name: 'Slovak',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 5
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n === 1 ? 0 : (n >= 2 && n <= 4) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n === 1 ? 0 : (n >= 2 && n <= 4) ? 1 : 2);
|
||
}
|
||
},
|
||
sl: {
|
||
name: 'Slovenian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 3
|
||
}, {
|
||
plural: 3,
|
||
sample: 5
|
||
}],
|
||
nplurals: 4,
|
||
pluralsText: 'nplurals = 4; plural = (n % 100 === 1 ? 0 : n % 100 === 2 ? 1 : n % 100 === 3 || n % 100 === 4 ? 2 : 3)',
|
||
pluralsFunc: function(n) {
|
||
return (n % 100 === 1 ? 0 : n % 100 === 2 ? 1 : n % 100 === 3 || n % 100 === 4 ? 2 : 3);
|
||
}
|
||
},
|
||
so: {
|
||
name: 'Somali',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
son: {
|
||
name: 'Songhay',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
sq: {
|
||
name: 'Albanian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
sr: {
|
||
name: 'Serbian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 5
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
||
}
|
||
},
|
||
su: {
|
||
name: 'Sundanese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
sv: {
|
||
name: 'Swedish',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
sw: {
|
||
name: 'Swahili',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
ta: {
|
||
name: 'Tamil',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
te: {
|
||
name: 'Telugu',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
tg: {
|
||
name: 'Tajik',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
th: {
|
||
name: 'Thai',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
ti: {
|
||
name: 'Tigrinya',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
tk: {
|
||
name: 'Turkmen',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
tr: {
|
||
name: 'Turkish',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
tt: {
|
||
name: 'Tatar',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
ug: {
|
||
name: 'Uyghur',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
uk: {
|
||
name: 'Ukrainian',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}, {
|
||
plural: 2,
|
||
sample: 5
|
||
}],
|
||
nplurals: 3,
|
||
pluralsText: 'nplurals = 3; plural = (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2)',
|
||
pluralsFunc: function(n) {
|
||
return (n % 10 === 1 && n % 100 !== 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
||
}
|
||
},
|
||
ur: {
|
||
name: 'Urdu',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
uz: {
|
||
name: 'Uzbek',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
vi: {
|
||
name: 'Vietnamese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
wa: {
|
||
name: 'Walloon',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n > 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n > 1);
|
||
}
|
||
},
|
||
wo: {
|
||
name: 'Wolof',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
},
|
||
yo: {
|
||
name: 'Yoruba',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}, {
|
||
plural: 1,
|
||
sample: 2
|
||
}],
|
||
nplurals: 2,
|
||
pluralsText: 'nplurals = 2; plural = (n !== 1)',
|
||
pluralsFunc: function(n) {
|
||
return (n !== 1);
|
||
}
|
||
},
|
||
zh: {
|
||
name: 'Chinese',
|
||
examples: [{
|
||
plural: 0,
|
||
sample: 1
|
||
}],
|
||
nplurals: 1,
|
||
pluralsText: 'nplurals = 1; plural = 0',
|
||
pluralsFunc: function() {
|
||
return 0;
|
||
}
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/process/browser.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/process/browser.js ***!
|
||
\*****************************************/
|
||
/***/ ((module) => {
|
||
|
||
// shim for using process in browser
|
||
var process = module.exports = {};
|
||
|
||
// cached from whatever global is present so that test runners that stub it
|
||
// don't break things. But we need to wrap it in a try catch in case it is
|
||
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
||
// function because try/catches deoptimize in certain engines.
|
||
|
||
var cachedSetTimeout;
|
||
var cachedClearTimeout;
|
||
|
||
function defaultSetTimout() {
|
||
throw new Error('setTimeout has not been defined');
|
||
}
|
||
function defaultClearTimeout () {
|
||
throw new Error('clearTimeout has not been defined');
|
||
}
|
||
(function () {
|
||
try {
|
||
if (typeof setTimeout === 'function') {
|
||
cachedSetTimeout = setTimeout;
|
||
} else {
|
||
cachedSetTimeout = defaultSetTimout;
|
||
}
|
||
} catch (e) {
|
||
cachedSetTimeout = defaultSetTimout;
|
||
}
|
||
try {
|
||
if (typeof clearTimeout === 'function') {
|
||
cachedClearTimeout = clearTimeout;
|
||
} else {
|
||
cachedClearTimeout = defaultClearTimeout;
|
||
}
|
||
} catch (e) {
|
||
cachedClearTimeout = defaultClearTimeout;
|
||
}
|
||
} ())
|
||
function runTimeout(fun) {
|
||
if (cachedSetTimeout === setTimeout) {
|
||
//normal enviroments in sane situations
|
||
return setTimeout(fun, 0);
|
||
}
|
||
// if setTimeout wasn't available but was latter defined
|
||
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
||
cachedSetTimeout = setTimeout;
|
||
return setTimeout(fun, 0);
|
||
}
|
||
try {
|
||
// when when somebody has screwed with setTimeout but no I.E. maddness
|
||
return cachedSetTimeout(fun, 0);
|
||
} catch(e){
|
||
try {
|
||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
||
return cachedSetTimeout.call(null, fun, 0);
|
||
} catch(e){
|
||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
||
return cachedSetTimeout.call(this, fun, 0);
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
function runClearTimeout(marker) {
|
||
if (cachedClearTimeout === clearTimeout) {
|
||
//normal enviroments in sane situations
|
||
return clearTimeout(marker);
|
||
}
|
||
// if clearTimeout wasn't available but was latter defined
|
||
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
||
cachedClearTimeout = clearTimeout;
|
||
return clearTimeout(marker);
|
||
}
|
||
try {
|
||
// when when somebody has screwed with setTimeout but no I.E. maddness
|
||
return cachedClearTimeout(marker);
|
||
} catch (e){
|
||
try {
|
||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
||
return cachedClearTimeout.call(null, marker);
|
||
} catch (e){
|
||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
||
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
||
return cachedClearTimeout.call(this, marker);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
}
|
||
var queue = [];
|
||
var draining = false;
|
||
var currentQueue;
|
||
var queueIndex = -1;
|
||
|
||
function cleanUpNextTick() {
|
||
if (!draining || !currentQueue) {
|
||
return;
|
||
}
|
||
draining = false;
|
||
if (currentQueue.length) {
|
||
queue = currentQueue.concat(queue);
|
||
} else {
|
||
queueIndex = -1;
|
||
}
|
||
if (queue.length) {
|
||
drainQueue();
|
||
}
|
||
}
|
||
|
||
function drainQueue() {
|
||
if (draining) {
|
||
return;
|
||
}
|
||
var timeout = runTimeout(cleanUpNextTick);
|
||
draining = true;
|
||
|
||
var len = queue.length;
|
||
while(len) {
|
||
currentQueue = queue;
|
||
queue = [];
|
||
while (++queueIndex < len) {
|
||
if (currentQueue) {
|
||
currentQueue[queueIndex].run();
|
||
}
|
||
}
|
||
queueIndex = -1;
|
||
len = queue.length;
|
||
}
|
||
currentQueue = null;
|
||
draining = false;
|
||
runClearTimeout(timeout);
|
||
}
|
||
|
||
process.nextTick = function (fun) {
|
||
var args = new Array(arguments.length - 1);
|
||
if (arguments.length > 1) {
|
||
for (var i = 1; i < arguments.length; i++) {
|
||
args[i - 1] = arguments[i];
|
||
}
|
||
}
|
||
queue.push(new Item(fun, args));
|
||
if (queue.length === 1 && !draining) {
|
||
runTimeout(drainQueue);
|
||
}
|
||
};
|
||
|
||
// v8 likes predictible objects
|
||
function Item(fun, array) {
|
||
this.fun = fun;
|
||
this.array = array;
|
||
}
|
||
Item.prototype.run = function () {
|
||
this.fun.apply(null, this.array);
|
||
};
|
||
process.title = 'browser';
|
||
process.browser = true;
|
||
process.env = {};
|
||
process.argv = [];
|
||
process.version = ''; // empty string to avoid regexp issues
|
||
process.versions = {};
|
||
|
||
function noop() {}
|
||
|
||
process.on = noop;
|
||
process.addListener = noop;
|
||
process.once = noop;
|
||
process.off = noop;
|
||
process.removeListener = noop;
|
||
process.removeAllListeners = noop;
|
||
process.emit = noop;
|
||
process.prependListener = noop;
|
||
process.prependOnceListener = noop;
|
||
|
||
process.listeners = function (name) { return [] }
|
||
|
||
process.binding = function (name) {
|
||
throw new Error('process.binding is not supported');
|
||
};
|
||
|
||
process.cwd = function () { return '/' };
|
||
process.chdir = function (dir) {
|
||
throw new Error('process.chdir is not supported');
|
||
};
|
||
process.umask = function() { return 0; };
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/views/Appointments/Confirmation.vue":
|
||
/*!*************************************************!*\
|
||
!*** ./src/views/Appointments/Confirmation.vue ***!
|
||
\*************************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||
/* harmony export */ });
|
||
/* harmony import */ var _Confirmation_vue_vue_type_template_id_74f5bdf4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Confirmation.vue?vue&type=template&id=74f5bdf4 */ "./src/views/Appointments/Confirmation.vue?vue&type=template&id=74f5bdf4");
|
||
/* harmony import */ var _Confirmation_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Confirmation.vue?vue&type=script&lang=js */ "./src/views/Appointments/Confirmation.vue?vue&type=script&lang=js");
|
||
/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
|
||
|
||
|
||
|
||
|
||
|
||
/* normalize component */
|
||
;
|
||
var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
|
||
_Confirmation_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"],
|
||
_Confirmation_vue_vue_type_template_id_74f5bdf4__WEBPACK_IMPORTED_MODULE_0__.render,
|
||
_Confirmation_vue_vue_type_template_id_74f5bdf4__WEBPACK_IMPORTED_MODULE_0__.staticRenderFns,
|
||
false,
|
||
null,
|
||
null,
|
||
null
|
||
|
||
)
|
||
|
||
/* hot reload */
|
||
if (false) { var api; }
|
||
component.options.__file = "src/views/Appointments/Confirmation.vue"
|
||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports);
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/views/Appointments/Confirmation.vue?vue&type=script&lang=js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./src/views/Appointments/Confirmation.vue?vue&type=script&lang=js ***!
|
||
\*************************************************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||
/* harmony export */ });
|
||
/* harmony import */ var _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_Confirmation_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Confirmation.vue?vue&type=script&lang=js */ "./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/Appointments/Confirmation.vue?vue&type=script&lang=js");
|
||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_Confirmation_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./src/views/Appointments/Confirmation.vue?vue&type=template&id=74f5bdf4":
|
||
/*!*******************************************************************************!*\
|
||
!*** ./src/views/Appointments/Confirmation.vue?vue&type=template&id=74f5bdf4 ***!
|
||
\*******************************************************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ render: () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Confirmation_vue_vue_type_template_id_74f5bdf4__WEBPACK_IMPORTED_MODULE_0__.render),
|
||
/* harmony export */ staticRenderFns: () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Confirmation_vue_vue_type_template_id_74f5bdf4__WEBPACK_IMPORTED_MODULE_0__.staticRenderFns)
|
||
/* harmony export */ });
|
||
/* harmony import */ var _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Confirmation_vue_vue_type_template_id_74f5bdf4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Confirmation.vue?vue&type=template&id=74f5bdf4 */ "./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/Appointments/Confirmation.vue?vue&type=template&id=74f5bdf4");
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js":
|
||
/*!********************************************************************!*\
|
||
!*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***!
|
||
\********************************************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ "default": () => (/* binding */ normalizeComponent)
|
||
/* harmony export */ });
|
||
/* globals __VUE_SSR_CONTEXT__ */
|
||
|
||
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
||
// This module is a runtime utility for cleaner component module output and will
|
||
// be included in the final webpack user bundle.
|
||
|
||
function normalizeComponent(
|
||
scriptExports,
|
||
render,
|
||
staticRenderFns,
|
||
functionalTemplate,
|
||
injectStyles,
|
||
scopeId,
|
||
moduleIdentifier /* server only */,
|
||
shadowMode /* vue-cli only */
|
||
) {
|
||
// Vue.extend constructor export interop
|
||
var options =
|
||
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
||
|
||
// render functions
|
||
if (render) {
|
||
options.render = render
|
||
options.staticRenderFns = staticRenderFns
|
||
options._compiled = true
|
||
}
|
||
|
||
// functional template
|
||
if (functionalTemplate) {
|
||
options.functional = true
|
||
}
|
||
|
||
// scopedId
|
||
if (scopeId) {
|
||
options._scopeId = 'data-v-' + scopeId
|
||
}
|
||
|
||
var hook
|
||
if (moduleIdentifier) {
|
||
// server build
|
||
hook = function (context) {
|
||
// 2.3 injection
|
||
context =
|
||
context || // cached call
|
||
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
||
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
||
// 2.2 with runInNewContext: true
|
||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
||
context = __VUE_SSR_CONTEXT__
|
||
}
|
||
// inject component styles
|
||
if (injectStyles) {
|
||
injectStyles.call(this, context)
|
||
}
|
||
// register component module identifier for async chunk inferrence
|
||
if (context && context._registeredComponents) {
|
||
context._registeredComponents.add(moduleIdentifier)
|
||
}
|
||
}
|
||
// used by ssr in case component is cached and beforeCreate
|
||
// never gets called
|
||
options._ssrRegister = hook
|
||
} else if (injectStyles) {
|
||
hook = shadowMode
|
||
? function () {
|
||
injectStyles.call(
|
||
this,
|
||
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
||
)
|
||
}
|
||
: injectStyles
|
||
}
|
||
|
||
if (hook) {
|
||
if (options.functional) {
|
||
// for template-only hot-reload because in that case the render fn doesn't
|
||
// go through the normalizer
|
||
options._injectStyles = hook
|
||
// register for functional component in vue file
|
||
var originalRender = options.render
|
||
options.render = function renderWithStyleInjection(h, context) {
|
||
hook.call(context)
|
||
return originalRender(h, context)
|
||
}
|
||
} else {
|
||
// inject component registration as beforeCreate hook
|
||
var existing = options.beforeCreate
|
||
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
||
}
|
||
}
|
||
|
||
return {
|
||
exports: scriptExports,
|
||
options: options
|
||
}
|
||
}
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/vue/dist/vue.runtime.esm.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/vue/dist/vue.runtime.esm.js ***!
|
||
\**************************************************/
|
||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ EffectScope: () => (/* binding */ EffectScope),
|
||
/* harmony export */ computed: () => (/* binding */ computed),
|
||
/* harmony export */ customRef: () => (/* binding */ customRef),
|
||
/* harmony export */ "default": () => (/* binding */ Vue),
|
||
/* harmony export */ defineAsyncComponent: () => (/* binding */ defineAsyncComponent),
|
||
/* harmony export */ defineComponent: () => (/* binding */ defineComponent),
|
||
/* harmony export */ del: () => (/* binding */ del),
|
||
/* harmony export */ effectScope: () => (/* binding */ effectScope),
|
||
/* harmony export */ getCurrentInstance: () => (/* binding */ getCurrentInstance),
|
||
/* harmony export */ getCurrentScope: () => (/* binding */ getCurrentScope),
|
||
/* harmony export */ h: () => (/* binding */ h),
|
||
/* harmony export */ inject: () => (/* binding */ inject),
|
||
/* harmony export */ isProxy: () => (/* binding */ isProxy),
|
||
/* harmony export */ isReactive: () => (/* binding */ isReactive),
|
||
/* harmony export */ isReadonly: () => (/* binding */ isReadonly),
|
||
/* harmony export */ isRef: () => (/* binding */ isRef),
|
||
/* harmony export */ isShallow: () => (/* binding */ isShallow),
|
||
/* harmony export */ markRaw: () => (/* binding */ markRaw),
|
||
/* harmony export */ mergeDefaults: () => (/* binding */ mergeDefaults),
|
||
/* harmony export */ nextTick: () => (/* binding */ nextTick),
|
||
/* harmony export */ onActivated: () => (/* binding */ onActivated),
|
||
/* harmony export */ onBeforeMount: () => (/* binding */ onBeforeMount),
|
||
/* harmony export */ onBeforeUnmount: () => (/* binding */ onBeforeUnmount),
|
||
/* harmony export */ onBeforeUpdate: () => (/* binding */ onBeforeUpdate),
|
||
/* harmony export */ onDeactivated: () => (/* binding */ onDeactivated),
|
||
/* harmony export */ onErrorCaptured: () => (/* binding */ onErrorCaptured),
|
||
/* harmony export */ onMounted: () => (/* binding */ onMounted),
|
||
/* harmony export */ onRenderTracked: () => (/* binding */ onRenderTracked),
|
||
/* harmony export */ onRenderTriggered: () => (/* binding */ onRenderTriggered),
|
||
/* harmony export */ onScopeDispose: () => (/* binding */ onScopeDispose),
|
||
/* harmony export */ onServerPrefetch: () => (/* binding */ onServerPrefetch),
|
||
/* harmony export */ onUnmounted: () => (/* binding */ onUnmounted),
|
||
/* harmony export */ onUpdated: () => (/* binding */ onUpdated),
|
||
/* harmony export */ provide: () => (/* binding */ provide),
|
||
/* harmony export */ proxyRefs: () => (/* binding */ proxyRefs),
|
||
/* harmony export */ reactive: () => (/* binding */ reactive),
|
||
/* harmony export */ readonly: () => (/* binding */ readonly),
|
||
/* harmony export */ ref: () => (/* binding */ ref$1),
|
||
/* harmony export */ set: () => (/* binding */ set),
|
||
/* harmony export */ shallowReactive: () => (/* binding */ shallowReactive),
|
||
/* harmony export */ shallowReadonly: () => (/* binding */ shallowReadonly),
|
||
/* harmony export */ shallowRef: () => (/* binding */ shallowRef),
|
||
/* harmony export */ toRaw: () => (/* binding */ toRaw),
|
||
/* harmony export */ toRef: () => (/* binding */ toRef),
|
||
/* harmony export */ toRefs: () => (/* binding */ toRefs),
|
||
/* harmony export */ triggerRef: () => (/* binding */ triggerRef),
|
||
/* harmony export */ unref: () => (/* binding */ unref),
|
||
/* harmony export */ useAttrs: () => (/* binding */ useAttrs),
|
||
/* harmony export */ useCssModule: () => (/* binding */ useCssModule),
|
||
/* harmony export */ useCssVars: () => (/* binding */ useCssVars),
|
||
/* harmony export */ useListeners: () => (/* binding */ useListeners),
|
||
/* harmony export */ useSlots: () => (/* binding */ useSlots),
|
||
/* harmony export */ version: () => (/* binding */ version),
|
||
/* harmony export */ watch: () => (/* binding */ watch),
|
||
/* harmony export */ watchEffect: () => (/* binding */ watchEffect),
|
||
/* harmony export */ watchPostEffect: () => (/* binding */ watchPostEffect),
|
||
/* harmony export */ watchSyncEffect: () => (/* binding */ watchSyncEffect)
|
||
/* harmony export */ });
|
||
/*!
|
||
* Vue.js v2.7.16
|
||
* (c) 2014-2023 Evan You
|
||
* Released under the MIT License.
|
||
*/
|
||
var emptyObject = Object.freeze({});
|
||
var isArray = Array.isArray;
|
||
// These helpers produce better VM code in JS engines due to their
|
||
// explicitness and function inlining.
|
||
function isUndef(v) {
|
||
return v === undefined || v === null;
|
||
}
|
||
function isDef(v) {
|
||
return v !== undefined && v !== null;
|
||
}
|
||
function isTrue(v) {
|
||
return v === true;
|
||
}
|
||
function isFalse(v) {
|
||
return v === false;
|
||
}
|
||
/**
|
||
* Check if value is primitive.
|
||
*/
|
||
function isPrimitive(value) {
|
||
return (typeof value === 'string' ||
|
||
typeof value === 'number' ||
|
||
// $flow-disable-line
|
||
typeof value === 'symbol' ||
|
||
typeof value === 'boolean');
|
||
}
|
||
function isFunction(value) {
|
||
return typeof value === 'function';
|
||
}
|
||
/**
|
||
* Quick object check - this is primarily used to tell
|
||
* objects from primitive values when we know the value
|
||
* is a JSON-compliant type.
|
||
*/
|
||
function isObject(obj) {
|
||
return obj !== null && typeof obj === 'object';
|
||
}
|
||
/**
|
||
* Get the raw type string of a value, e.g., [object Object].
|
||
*/
|
||
var _toString = Object.prototype.toString;
|
||
function toRawType(value) {
|
||
return _toString.call(value).slice(8, -1);
|
||
}
|
||
/**
|
||
* Strict object type check. Only returns true
|
||
* for plain JavaScript objects.
|
||
*/
|
||
function isPlainObject(obj) {
|
||
return _toString.call(obj) === '[object Object]';
|
||
}
|
||
function isRegExp(v) {
|
||
return _toString.call(v) === '[object RegExp]';
|
||
}
|
||
/**
|
||
* Check if val is a valid array index.
|
||
*/
|
||
function isValidArrayIndex(val) {
|
||
var n = parseFloat(String(val));
|
||
return n >= 0 && Math.floor(n) === n && isFinite(val);
|
||
}
|
||
function isPromise(val) {
|
||
return (isDef(val) &&
|
||
typeof val.then === 'function' &&
|
||
typeof val.catch === 'function');
|
||
}
|
||
/**
|
||
* Convert a value to a string that is actually rendered.
|
||
*/
|
||
function toString(val) {
|
||
return val == null
|
||
? ''
|
||
: Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
|
||
? JSON.stringify(val, replacer, 2)
|
||
: String(val);
|
||
}
|
||
function replacer(_key, val) {
|
||
// avoid circular deps from v3
|
||
if (val && val.__v_isRef) {
|
||
return val.value;
|
||
}
|
||
return val;
|
||
}
|
||
/**
|
||
* Convert an input value to a number for persistence.
|
||
* If the conversion fails, return original string.
|
||
*/
|
||
function toNumber(val) {
|
||
var n = parseFloat(val);
|
||
return isNaN(n) ? val : n;
|
||
}
|
||
/**
|
||
* Make a map and return a function for checking if a key
|
||
* is in that map.
|
||
*/
|
||
function makeMap(str, expectsLowerCase) {
|
||
var map = Object.create(null);
|
||
var list = str.split(',');
|
||
for (var i = 0; i < list.length; i++) {
|
||
map[list[i]] = true;
|
||
}
|
||
return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };
|
||
}
|
||
/**
|
||
* Check if a tag is a built-in tag.
|
||
*/
|
||
var isBuiltInTag = makeMap('slot,component', true);
|
||
/**
|
||
* Check if an attribute is a reserved attribute.
|
||
*/
|
||
var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
|
||
/**
|
||
* Remove an item from an array.
|
||
*/
|
||
function remove$2(arr, item) {
|
||
var len = arr.length;
|
||
if (len) {
|
||
// fast path for the only / last item
|
||
if (item === arr[len - 1]) {
|
||
arr.length = len - 1;
|
||
return;
|
||
}
|
||
var index = arr.indexOf(item);
|
||
if (index > -1) {
|
||
return arr.splice(index, 1);
|
||
}
|
||
}
|
||
}
|
||
/**
|
||
* Check whether an object has the property.
|
||
*/
|
||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||
function hasOwn(obj, key) {
|
||
return hasOwnProperty.call(obj, key);
|
||
}
|
||
/**
|
||
* Create a cached version of a pure function.
|
||
*/
|
||
function cached(fn) {
|
||
var cache = Object.create(null);
|
||
return function cachedFn(str) {
|
||
var hit = cache[str];
|
||
return hit || (cache[str] = fn(str));
|
||
};
|
||
}
|
||
/**
|
||
* Camelize a hyphen-delimited string.
|
||
*/
|
||
var camelizeRE = /-(\w)/g;
|
||
var camelize = cached(function (str) {
|
||
return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });
|
||
});
|
||
/**
|
||
* Capitalize a string.
|
||
*/
|
||
var capitalize = cached(function (str) {
|
||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||
});
|
||
/**
|
||
* Hyphenate a camelCase string.
|
||
*/
|
||
var hyphenateRE = /\B([A-Z])/g;
|
||
var hyphenate = cached(function (str) {
|
||
return str.replace(hyphenateRE, '-$1').toLowerCase();
|
||
});
|
||
/**
|
||
* Simple bind polyfill for environments that do not support it,
|
||
* e.g., PhantomJS 1.x. Technically, we don't need this anymore
|
||
* since native bind is now performant enough in most browsers.
|
||
* But removing it would mean breaking code that was able to run in
|
||
* PhantomJS 1.x, so this must be kept for backward compatibility.
|
||
*/
|
||
/* istanbul ignore next */
|
||
function polyfillBind(fn, ctx) {
|
||
function boundFn(a) {
|
||
var l = arguments.length;
|
||
return l
|
||
? l > 1
|
||
? fn.apply(ctx, arguments)
|
||
: fn.call(ctx, a)
|
||
: fn.call(ctx);
|
||
}
|
||
boundFn._length = fn.length;
|
||
return boundFn;
|
||
}
|
||
function nativeBind(fn, ctx) {
|
||
return fn.bind(ctx);
|
||
}
|
||
// @ts-expect-error bind cannot be `undefined`
|
||
var bind = Function.prototype.bind ? nativeBind : polyfillBind;
|
||
/**
|
||
* Convert an Array-like object to a real Array.
|
||
*/
|
||
function toArray(list, start) {
|
||
start = start || 0;
|
||
var i = list.length - start;
|
||
var ret = new Array(i);
|
||
while (i--) {
|
||
ret[i] = list[i + start];
|
||
}
|
||
return ret;
|
||
}
|
||
/**
|
||
* Mix properties into target object.
|
||
*/
|
||
function extend(to, _from) {
|
||
for (var key in _from) {
|
||
to[key] = _from[key];
|
||
}
|
||
return to;
|
||
}
|
||
/**
|
||
* Merge an Array of Objects into a single Object.
|
||
*/
|
||
function toObject(arr) {
|
||
var res = {};
|
||
for (var i = 0; i < arr.length; i++) {
|
||
if (arr[i]) {
|
||
extend(res, arr[i]);
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
/* eslint-disable no-unused-vars */
|
||
/**
|
||
* Perform no operation.
|
||
* Stubbing args to make Flow happy without leaving useless transpiled code
|
||
* with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
|
||
*/
|
||
function noop(a, b, c) { }
|
||
/**
|
||
* Always return false.
|
||
*/
|
||
var no = function (a, b, c) { return false; };
|
||
/* eslint-enable no-unused-vars */
|
||
/**
|
||
* Return the same value.
|
||
*/
|
||
var identity = function (_) { return _; };
|
||
/**
|
||
* Check if two values are loosely equal - that is,
|
||
* if they are plain objects, do they have the same shape?
|
||
*/
|
||
function looseEqual(a, b) {
|
||
if (a === b)
|
||
return true;
|
||
var isObjectA = isObject(a);
|
||
var isObjectB = isObject(b);
|
||
if (isObjectA && isObjectB) {
|
||
try {
|
||
var isArrayA = Array.isArray(a);
|
||
var isArrayB = Array.isArray(b);
|
||
if (isArrayA && isArrayB) {
|
||
return (a.length === b.length &&
|
||
a.every(function (e, i) {
|
||
return looseEqual(e, b[i]);
|
||
}));
|
||
}
|
||
else if (a instanceof Date && b instanceof Date) {
|
||
return a.getTime() === b.getTime();
|
||
}
|
||
else if (!isArrayA && !isArrayB) {
|
||
var keysA = Object.keys(a);
|
||
var keysB = Object.keys(b);
|
||
return (keysA.length === keysB.length &&
|
||
keysA.every(function (key) {
|
||
return looseEqual(a[key], b[key]);
|
||
}));
|
||
}
|
||
else {
|
||
/* istanbul ignore next */
|
||
return false;
|
||
}
|
||
}
|
||
catch (e) {
|
||
/* istanbul ignore next */
|
||
return false;
|
||
}
|
||
}
|
||
else if (!isObjectA && !isObjectB) {
|
||
return String(a) === String(b);
|
||
}
|
||
else {
|
||
return false;
|
||
}
|
||
}
|
||
/**
|
||
* Return the first index at which a loosely equal value can be
|
||
* found in the array (if value is a plain object, the array must
|
||
* contain an object of the same shape), or -1 if it is not present.
|
||
*/
|
||
function looseIndexOf(arr, val) {
|
||
for (var i = 0; i < arr.length; i++) {
|
||
if (looseEqual(arr[i], val))
|
||
return i;
|
||
}
|
||
return -1;
|
||
}
|
||
/**
|
||
* Ensure a function is called only once.
|
||
*/
|
||
function once(fn) {
|
||
var called = false;
|
||
return function () {
|
||
if (!called) {
|
||
called = true;
|
||
fn.apply(this, arguments);
|
||
}
|
||
};
|
||
}
|
||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill
|
||
function hasChanged(x, y) {
|
||
if (x === y) {
|
||
return x === 0 && 1 / x !== 1 / y;
|
||
}
|
||
else {
|
||
return x === x || y === y;
|
||
}
|
||
}
|
||
|
||
var SSR_ATTR = 'data-server-rendered';
|
||
var ASSET_TYPES = ['component', 'directive', 'filter'];
|
||
var LIFECYCLE_HOOKS = [
|
||
'beforeCreate',
|
||
'created',
|
||
'beforeMount',
|
||
'mounted',
|
||
'beforeUpdate',
|
||
'updated',
|
||
'beforeDestroy',
|
||
'destroyed',
|
||
'activated',
|
||
'deactivated',
|
||
'errorCaptured',
|
||
'serverPrefetch',
|
||
'renderTracked',
|
||
'renderTriggered'
|
||
];
|
||
|
||
var config = {
|
||
/**
|
||
* Option merge strategies (used in core/util/options)
|
||
*/
|
||
// $flow-disable-line
|
||
optionMergeStrategies: Object.create(null),
|
||
/**
|
||
* Whether to suppress warnings.
|
||
*/
|
||
silent: false,
|
||
/**
|
||
* Show production mode tip message on boot?
|
||
*/
|
||
productionTip: "development" !== 'production',
|
||
/**
|
||
* Whether to enable devtools
|
||
*/
|
||
devtools: "development" !== 'production',
|
||
/**
|
||
* Whether to record perf
|
||
*/
|
||
performance: false,
|
||
/**
|
||
* Error handler for watcher errors
|
||
*/
|
||
errorHandler: null,
|
||
/**
|
||
* Warn handler for watcher warns
|
||
*/
|
||
warnHandler: null,
|
||
/**
|
||
* Ignore certain custom elements
|
||
*/
|
||
ignoredElements: [],
|
||
/**
|
||
* Custom user key aliases for v-on
|
||
*/
|
||
// $flow-disable-line
|
||
keyCodes: Object.create(null),
|
||
/**
|
||
* Check if a tag is reserved so that it cannot be registered as a
|
||
* component. This is platform-dependent and may be overwritten.
|
||
*/
|
||
isReservedTag: no,
|
||
/**
|
||
* Check if an attribute is reserved so that it cannot be used as a component
|
||
* prop. This is platform-dependent and may be overwritten.
|
||
*/
|
||
isReservedAttr: no,
|
||
/**
|
||
* Check if a tag is an unknown element.
|
||
* Platform-dependent.
|
||
*/
|
||
isUnknownElement: no,
|
||
/**
|
||
* Get the namespace of an element
|
||
*/
|
||
getTagNamespace: noop,
|
||
/**
|
||
* Parse the real tag name for the specific platform.
|
||
*/
|
||
parsePlatformTagName: identity,
|
||
/**
|
||
* Check if an attribute must be bound using property, e.g. value
|
||
* Platform-dependent.
|
||
*/
|
||
mustUseProp: no,
|
||
/**
|
||
* Perform updates asynchronously. Intended to be used by Vue Test Utils
|
||
* This will significantly reduce performance if set to false.
|
||
*/
|
||
async: true,
|
||
/**
|
||
* Exposed for legacy reasons
|
||
*/
|
||
_lifecycleHooks: LIFECYCLE_HOOKS
|
||
};
|
||
|
||
/**
|
||
* unicode letters used for parsing html tags, component names and property paths.
|
||
* using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
|
||
* skipping \u10000-\uEFFFF due to it freezing up PhantomJS
|
||
*/
|
||
var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
|
||
/**
|
||
* Check if a string starts with $ or _
|
||
*/
|
||
function isReserved(str) {
|
||
var c = (str + '').charCodeAt(0);
|
||
return c === 0x24 || c === 0x5f;
|
||
}
|
||
/**
|
||
* Define a property.
|
||
*/
|
||
function def(obj, key, val, enumerable) {
|
||
Object.defineProperty(obj, key, {
|
||
value: val,
|
||
enumerable: !!enumerable,
|
||
writable: true,
|
||
configurable: true
|
||
});
|
||
}
|
||
/**
|
||
* Parse simple path.
|
||
*/
|
||
var bailRE = new RegExp("[^".concat(unicodeRegExp.source, ".$_\\d]"));
|
||
function parsePath(path) {
|
||
if (bailRE.test(path)) {
|
||
return;
|
||
}
|
||
var segments = path.split('.');
|
||
return function (obj) {
|
||
for (var i = 0; i < segments.length; i++) {
|
||
if (!obj)
|
||
return;
|
||
obj = obj[segments[i]];
|
||
}
|
||
return obj;
|
||
};
|
||
}
|
||
|
||
// can we use __proto__?
|
||
var hasProto = '__proto__' in {};
|
||
// Browser environment sniffing
|
||
var inBrowser = typeof window !== 'undefined';
|
||
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
|
||
var isIE = UA && /msie|trident/.test(UA);
|
||
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
|
||
var isEdge = UA && UA.indexOf('edge/') > 0;
|
||
UA && UA.indexOf('android') > 0;
|
||
var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
|
||
UA && /chrome\/\d+/.test(UA) && !isEdge;
|
||
UA && /phantomjs/.test(UA);
|
||
var isFF = UA && UA.match(/firefox\/(\d+)/);
|
||
// Firefox has a "watch" function on Object.prototype...
|
||
// @ts-expect-error firebox support
|
||
var nativeWatch = {}.watch;
|
||
var supportsPassive = false;
|
||
if (inBrowser) {
|
||
try {
|
||
var opts = {};
|
||
Object.defineProperty(opts, 'passive', {
|
||
get: function () {
|
||
/* istanbul ignore next */
|
||
supportsPassive = true;
|
||
}
|
||
}); // https://github.com/facebook/flow/issues/285
|
||
window.addEventListener('test-passive', null, opts);
|
||
}
|
||
catch (e) { }
|
||
}
|
||
// this needs to be lazy-evaled because vue may be required before
|
||
// vue-server-renderer can set VUE_ENV
|
||
var _isServer;
|
||
var isServerRendering = function () {
|
||
if (_isServer === undefined) {
|
||
/* istanbul ignore if */
|
||
if (!inBrowser && typeof __webpack_require__.g !== 'undefined') {
|
||
// detect presence of vue-server-renderer and avoid
|
||
// Webpack shimming the process
|
||
_isServer =
|
||
__webpack_require__.g['process'] && __webpack_require__.g['process'].env.VUE_ENV === 'server';
|
||
}
|
||
else {
|
||
_isServer = false;
|
||
}
|
||
}
|
||
return _isServer;
|
||
};
|
||
// detect devtools
|
||
var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
||
/* istanbul ignore next */
|
||
function isNative(Ctor) {
|
||
return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
|
||
}
|
||
var hasSymbol = typeof Symbol !== 'undefined' &&
|
||
isNative(Symbol) &&
|
||
typeof Reflect !== 'undefined' &&
|
||
isNative(Reflect.ownKeys);
|
||
var _Set; // $flow-disable-line
|
||
/* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {
|
||
// use native Set when available.
|
||
_Set = Set;
|
||
}
|
||
else {
|
||
// a non-standard Set polyfill that only works with primitive keys.
|
||
_Set = /** @class */ (function () {
|
||
function Set() {
|
||
this.set = Object.create(null);
|
||
}
|
||
Set.prototype.has = function (key) {
|
||
return this.set[key] === true;
|
||
};
|
||
Set.prototype.add = function (key) {
|
||
this.set[key] = true;
|
||
};
|
||
Set.prototype.clear = function () {
|
||
this.set = Object.create(null);
|
||
};
|
||
return Set;
|
||
}());
|
||
}
|
||
|
||
var currentInstance = null;
|
||
/**
|
||
* This is exposed for compatibility with v3 (e.g. some functions in VueUse
|
||
* relies on it). Do not use this internally, just use `currentInstance`.
|
||
*
|
||
* @internal this function needs manual type declaration because it relies
|
||
* on previously manually authored types from Vue 2
|
||
*/
|
||
function getCurrentInstance() {
|
||
return currentInstance && { proxy: currentInstance };
|
||
}
|
||
/**
|
||
* @internal
|
||
*/
|
||
function setCurrentInstance(vm) {
|
||
if (vm === void 0) { vm = null; }
|
||
if (!vm)
|
||
currentInstance && currentInstance._scope.off();
|
||
currentInstance = vm;
|
||
vm && vm._scope.on();
|
||
}
|
||
|
||
/**
|
||
* @internal
|
||
*/
|
||
var VNode = /** @class */ (function () {
|
||
function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
|
||
this.tag = tag;
|
||
this.data = data;
|
||
this.children = children;
|
||
this.text = text;
|
||
this.elm = elm;
|
||
this.ns = undefined;
|
||
this.context = context;
|
||
this.fnContext = undefined;
|
||
this.fnOptions = undefined;
|
||
this.fnScopeId = undefined;
|
||
this.key = data && data.key;
|
||
this.componentOptions = componentOptions;
|
||
this.componentInstance = undefined;
|
||
this.parent = undefined;
|
||
this.raw = false;
|
||
this.isStatic = false;
|
||
this.isRootInsert = true;
|
||
this.isComment = false;
|
||
this.isCloned = false;
|
||
this.isOnce = false;
|
||
this.asyncFactory = asyncFactory;
|
||
this.asyncMeta = undefined;
|
||
this.isAsyncPlaceholder = false;
|
||
}
|
||
Object.defineProperty(VNode.prototype, "child", {
|
||
// DEPRECATED: alias for componentInstance for backwards compat.
|
||
/* istanbul ignore next */
|
||
get: function () {
|
||
return this.componentInstance;
|
||
},
|
||
enumerable: false,
|
||
configurable: true
|
||
});
|
||
return VNode;
|
||
}());
|
||
var createEmptyVNode = function (text) {
|
||
if (text === void 0) { text = ''; }
|
||
var node = new VNode();
|
||
node.text = text;
|
||
node.isComment = true;
|
||
return node;
|
||
};
|
||
function createTextVNode(val) {
|
||
return new VNode(undefined, undefined, undefined, String(val));
|
||
}
|
||
// optimized shallow clone
|
||
// used for static nodes and slot nodes because they may be reused across
|
||
// multiple renders, cloning them avoids errors when DOM manipulations rely
|
||
// on their elm reference.
|
||
function cloneVNode(vnode) {
|
||
var cloned = new VNode(vnode.tag, vnode.data,
|
||
// #7975
|
||
// clone children array to avoid mutating original in case of cloning
|
||
// a child.
|
||
vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
|
||
cloned.ns = vnode.ns;
|
||
cloned.isStatic = vnode.isStatic;
|
||
cloned.key = vnode.key;
|
||
cloned.isComment = vnode.isComment;
|
||
cloned.fnContext = vnode.fnContext;
|
||
cloned.fnOptions = vnode.fnOptions;
|
||
cloned.fnScopeId = vnode.fnScopeId;
|
||
cloned.asyncMeta = vnode.asyncMeta;
|
||
cloned.isCloned = true;
|
||
return cloned;
|
||
}
|
||
|
||
/******************************************************************************
|
||
Copyright (c) Microsoft Corporation.
|
||
|
||
Permission to use, copy, modify, and/or distribute this software for any
|
||
purpose with or without fee is hereby granted.
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
PERFORMANCE OF THIS SOFTWARE.
|
||
***************************************************************************** */
|
||
|
||
var __assign = function() {
|
||
__assign = Object.assign || function __assign(t) {
|
||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||
s = arguments[i];
|
||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||
}
|
||
return t;
|
||
};
|
||
return __assign.apply(this, arguments);
|
||
};
|
||
|
||
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||
var e = new Error(message);
|
||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||
};
|
||
|
||
var uid$2 = 0;
|
||
var pendingCleanupDeps = [];
|
||
var cleanupDeps = function () {
|
||
for (var i = 0; i < pendingCleanupDeps.length; i++) {
|
||
var dep = pendingCleanupDeps[i];
|
||
dep.subs = dep.subs.filter(function (s) { return s; });
|
||
dep._pending = false;
|
||
}
|
||
pendingCleanupDeps.length = 0;
|
||
};
|
||
/**
|
||
* A dep is an observable that can have multiple
|
||
* directives subscribing to it.
|
||
* @internal
|
||
*/
|
||
var Dep = /** @class */ (function () {
|
||
function Dep() {
|
||
// pending subs cleanup
|
||
this._pending = false;
|
||
this.id = uid$2++;
|
||
this.subs = [];
|
||
}
|
||
Dep.prototype.addSub = function (sub) {
|
||
this.subs.push(sub);
|
||
};
|
||
Dep.prototype.removeSub = function (sub) {
|
||
// #12696 deps with massive amount of subscribers are extremely slow to
|
||
// clean up in Chromium
|
||
// to workaround this, we unset the sub for now, and clear them on
|
||
// next scheduler flush.
|
||
this.subs[this.subs.indexOf(sub)] = null;
|
||
if (!this._pending) {
|
||
this._pending = true;
|
||
pendingCleanupDeps.push(this);
|
||
}
|
||
};
|
||
Dep.prototype.depend = function (info) {
|
||
if (Dep.target) {
|
||
Dep.target.addDep(this);
|
||
if ( true && info && Dep.target.onTrack) {
|
||
Dep.target.onTrack(__assign({ effect: Dep.target }, info));
|
||
}
|
||
}
|
||
};
|
||
Dep.prototype.notify = function (info) {
|
||
// stabilize the subscriber list first
|
||
var subs = this.subs.filter(function (s) { return s; });
|
||
if ( true && !config.async) {
|
||
// subs aren't sorted in scheduler if not running async
|
||
// we need to sort them now to make sure they fire in correct
|
||
// order
|
||
subs.sort(function (a, b) { return a.id - b.id; });
|
||
}
|
||
for (var i = 0, l = subs.length; i < l; i++) {
|
||
var sub = subs[i];
|
||
if ( true && info) {
|
||
sub.onTrigger &&
|
||
sub.onTrigger(__assign({ effect: subs[i] }, info));
|
||
}
|
||
sub.update();
|
||
}
|
||
};
|
||
return Dep;
|
||
}());
|
||
// The current target watcher being evaluated.
|
||
// This is globally unique because only one watcher
|
||
// can be evaluated at a time.
|
||
Dep.target = null;
|
||
var targetStack = [];
|
||
function pushTarget(target) {
|
||
targetStack.push(target);
|
||
Dep.target = target;
|
||
}
|
||
function popTarget() {
|
||
targetStack.pop();
|
||
Dep.target = targetStack[targetStack.length - 1];
|
||
}
|
||
|
||
/*
|
||
* not type checking this file because flow doesn't play well with
|
||
* dynamically accessing methods on Array prototype
|
||
*/
|
||
var arrayProto = Array.prototype;
|
||
var arrayMethods = Object.create(arrayProto);
|
||
var methodsToPatch = [
|
||
'push',
|
||
'pop',
|
||
'shift',
|
||
'unshift',
|
||
'splice',
|
||
'sort',
|
||
'reverse'
|
||
];
|
||
/**
|
||
* Intercept mutating methods and emit events
|
||
*/
|
||
methodsToPatch.forEach(function (method) {
|
||
// cache original method
|
||
var original = arrayProto[method];
|
||
def(arrayMethods, method, function mutator() {
|
||
var args = [];
|
||
for (var _i = 0; _i < arguments.length; _i++) {
|
||
args[_i] = arguments[_i];
|
||
}
|
||
var result = original.apply(this, args);
|
||
var ob = this.__ob__;
|
||
var inserted;
|
||
switch (method) {
|
||
case 'push':
|
||
case 'unshift':
|
||
inserted = args;
|
||
break;
|
||
case 'splice':
|
||
inserted = args.slice(2);
|
||
break;
|
||
}
|
||
if (inserted)
|
||
ob.observeArray(inserted);
|
||
// notify change
|
||
if (true) {
|
||
ob.dep.notify({
|
||
type: "array mutation" /* TriggerOpTypes.ARRAY_MUTATION */,
|
||
target: this,
|
||
key: method
|
||
});
|
||
}
|
||
else {}
|
||
return result;
|
||
});
|
||
});
|
||
|
||
var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
|
||
var NO_INITIAL_VALUE = {};
|
||
/**
|
||
* In some cases we may want to disable observation inside a component's
|
||
* update computation.
|
||
*/
|
||
var shouldObserve = true;
|
||
function toggleObserving(value) {
|
||
shouldObserve = value;
|
||
}
|
||
// ssr mock dep
|
||
var mockDep = {
|
||
notify: noop,
|
||
depend: noop,
|
||
addSub: noop,
|
||
removeSub: noop
|
||
};
|
||
/**
|
||
* Observer class that is attached to each observed
|
||
* object. Once attached, the observer converts the target
|
||
* object's property keys into getter/setters that
|
||
* collect dependencies and dispatch updates.
|
||
*/
|
||
var Observer = /** @class */ (function () {
|
||
function Observer(value, shallow, mock) {
|
||
if (shallow === void 0) { shallow = false; }
|
||
if (mock === void 0) { mock = false; }
|
||
this.value = value;
|
||
this.shallow = shallow;
|
||
this.mock = mock;
|
||
// this.value = value
|
||
this.dep = mock ? mockDep : new Dep();
|
||
this.vmCount = 0;
|
||
def(value, '__ob__', this);
|
||
if (isArray(value)) {
|
||
if (!mock) {
|
||
if (hasProto) {
|
||
value.__proto__ = arrayMethods;
|
||
/* eslint-enable no-proto */
|
||
}
|
||
else {
|
||
for (var i = 0, l = arrayKeys.length; i < l; i++) {
|
||
var key = arrayKeys[i];
|
||
def(value, key, arrayMethods[key]);
|
||
}
|
||
}
|
||
}
|
||
if (!shallow) {
|
||
this.observeArray(value);
|
||
}
|
||
}
|
||
else {
|
||
/**
|
||
* Walk through all properties and convert them into
|
||
* getter/setters. This method should only be called when
|
||
* value type is Object.
|
||
*/
|
||
var keys = Object.keys(value);
|
||
for (var i = 0; i < keys.length; i++) {
|
||
var key = keys[i];
|
||
defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);
|
||
}
|
||
}
|
||
}
|
||
/**
|
||
* Observe a list of Array items.
|
||
*/
|
||
Observer.prototype.observeArray = function (value) {
|
||
for (var i = 0, l = value.length; i < l; i++) {
|
||
observe(value[i], false, this.mock);
|
||
}
|
||
};
|
||
return Observer;
|
||
}());
|
||
// helpers
|
||
/**
|
||
* Attempt to create an observer instance for a value,
|
||
* returns the new observer if successfully observed,
|
||
* or the existing observer if the value already has one.
|
||
*/
|
||
function observe(value, shallow, ssrMockReactivity) {
|
||
if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
|
||
return value.__ob__;
|
||
}
|
||
if (shouldObserve &&
|
||
(ssrMockReactivity || !isServerRendering()) &&
|
||
(isArray(value) || isPlainObject(value)) &&
|
||
Object.isExtensible(value) &&
|
||
!value.__v_skip /* ReactiveFlags.SKIP */ &&
|
||
!isRef(value) &&
|
||
!(value instanceof VNode)) {
|
||
return new Observer(value, shallow, ssrMockReactivity);
|
||
}
|
||
}
|
||
/**
|
||
* Define a reactive property on an Object.
|
||
*/
|
||
function defineReactive(obj, key, val, customSetter, shallow, mock, observeEvenIfShallow) {
|
||
if (observeEvenIfShallow === void 0) { observeEvenIfShallow = false; }
|
||
var dep = new Dep();
|
||
var property = Object.getOwnPropertyDescriptor(obj, key);
|
||
if (property && property.configurable === false) {
|
||
return;
|
||
}
|
||
// cater for pre-defined getter/setters
|
||
var getter = property && property.get;
|
||
var setter = property && property.set;
|
||
if ((!getter || setter) &&
|
||
(val === NO_INITIAL_VALUE || arguments.length === 2)) {
|
||
val = obj[key];
|
||
}
|
||
var childOb = shallow ? val && val.__ob__ : observe(val, false, mock);
|
||
Object.defineProperty(obj, key, {
|
||
enumerable: true,
|
||
configurable: true,
|
||
get: function reactiveGetter() {
|
||
var value = getter ? getter.call(obj) : val;
|
||
if (Dep.target) {
|
||
if (true) {
|
||
dep.depend({
|
||
target: obj,
|
||
type: "get" /* TrackOpTypes.GET */,
|
||
key: key
|
||
});
|
||
}
|
||
else {}
|
||
if (childOb) {
|
||
childOb.dep.depend();
|
||
if (isArray(value)) {
|
||
dependArray(value);
|
||
}
|
||
}
|
||
}
|
||
return isRef(value) && !shallow ? value.value : value;
|
||
},
|
||
set: function reactiveSetter(newVal) {
|
||
var value = getter ? getter.call(obj) : val;
|
||
if (!hasChanged(value, newVal)) {
|
||
return;
|
||
}
|
||
if ( true && customSetter) {
|
||
customSetter();
|
||
}
|
||
if (setter) {
|
||
setter.call(obj, newVal);
|
||
}
|
||
else if (getter) {
|
||
// #7981: for accessor properties without setter
|
||
return;
|
||
}
|
||
else if (!shallow && isRef(value) && !isRef(newVal)) {
|
||
value.value = newVal;
|
||
return;
|
||
}
|
||
else {
|
||
val = newVal;
|
||
}
|
||
childOb = shallow ? newVal && newVal.__ob__ : observe(newVal, false, mock);
|
||
if (true) {
|
||
dep.notify({
|
||
type: "set" /* TriggerOpTypes.SET */,
|
||
target: obj,
|
||
key: key,
|
||
newValue: newVal,
|
||
oldValue: value
|
||
});
|
||
}
|
||
else {}
|
||
}
|
||
});
|
||
return dep;
|
||
}
|
||
function set(target, key, val) {
|
||
if ( true && (isUndef(target) || isPrimitive(target))) {
|
||
warn("Cannot set reactive property on undefined, null, or primitive value: ".concat(target));
|
||
}
|
||
if (isReadonly(target)) {
|
||
true && warn("Set operation on key \"".concat(key, "\" failed: target is readonly."));
|
||
return;
|
||
}
|
||
var ob = target.__ob__;
|
||
if (isArray(target) && isValidArrayIndex(key)) {
|
||
target.length = Math.max(target.length, key);
|
||
target.splice(key, 1, val);
|
||
// when mocking for SSR, array methods are not hijacked
|
||
if (ob && !ob.shallow && ob.mock) {
|
||
observe(val, false, true);
|
||
}
|
||
return val;
|
||
}
|
||
if (key in target && !(key in Object.prototype)) {
|
||
target[key] = val;
|
||
return val;
|
||
}
|
||
if (target._isVue || (ob && ob.vmCount)) {
|
||
true &&
|
||
warn('Avoid adding reactive properties to a Vue instance or its root $data ' +
|
||
'at runtime - declare it upfront in the data option.');
|
||
return val;
|
||
}
|
||
if (!ob) {
|
||
target[key] = val;
|
||
return val;
|
||
}
|
||
defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);
|
||
if (true) {
|
||
ob.dep.notify({
|
||
type: "add" /* TriggerOpTypes.ADD */,
|
||
target: target,
|
||
key: key,
|
||
newValue: val,
|
||
oldValue: undefined
|
||
});
|
||
}
|
||
else {}
|
||
return val;
|
||
}
|
||
function del(target, key) {
|
||
if ( true && (isUndef(target) || isPrimitive(target))) {
|
||
warn("Cannot delete reactive property on undefined, null, or primitive value: ".concat(target));
|
||
}
|
||
if (isArray(target) && isValidArrayIndex(key)) {
|
||
target.splice(key, 1);
|
||
return;
|
||
}
|
||
var ob = target.__ob__;
|
||
if (target._isVue || (ob && ob.vmCount)) {
|
||
true &&
|
||
warn('Avoid deleting properties on a Vue instance or its root $data ' +
|
||
'- just set it to null.');
|
||
return;
|
||
}
|
||
if (isReadonly(target)) {
|
||
true &&
|
||
warn("Delete operation on key \"".concat(key, "\" failed: target is readonly."));
|
||
return;
|
||
}
|
||
if (!hasOwn(target, key)) {
|
||
return;
|
||
}
|
||
delete target[key];
|
||
if (!ob) {
|
||
return;
|
||
}
|
||
if (true) {
|
||
ob.dep.notify({
|
||
type: "delete" /* TriggerOpTypes.DELETE */,
|
||
target: target,
|
||
key: key
|
||
});
|
||
}
|
||
else {}
|
||
}
|
||
/**
|
||
* Collect dependencies on array elements when the array is touched, since
|
||
* we cannot intercept array element access like property getters.
|
||
*/
|
||
function dependArray(value) {
|
||
for (var e = void 0, i = 0, l = value.length; i < l; i++) {
|
||
e = value[i];
|
||
if (e && e.__ob__) {
|
||
e.__ob__.dep.depend();
|
||
}
|
||
if (isArray(e)) {
|
||
dependArray(e);
|
||
}
|
||
}
|
||
}
|
||
|
||
function reactive(target) {
|
||
makeReactive(target, false);
|
||
return target;
|
||
}
|
||
/**
|
||
* Return a shallowly-reactive copy of the original object, where only the root
|
||
* level properties are reactive. It also does not auto-unwrap refs (even at the
|
||
* root level).
|
||
*/
|
||
function shallowReactive(target) {
|
||
makeReactive(target, true);
|
||
def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
|
||
return target;
|
||
}
|
||
function makeReactive(target, shallow) {
|
||
// if trying to observe a readonly proxy, return the readonly version.
|
||
if (!isReadonly(target)) {
|
||
if (true) {
|
||
if (isArray(target)) {
|
||
warn("Avoid using Array as root value for ".concat(shallow ? "shallowReactive()" : "reactive()", " as it cannot be tracked in watch() or watchEffect(). Use ").concat(shallow ? "shallowRef()" : "ref()", " instead. This is a Vue-2-only limitation."));
|
||
}
|
||
var existingOb = target && target.__ob__;
|
||
if (existingOb && existingOb.shallow !== shallow) {
|
||
warn("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
|
||
}
|
||
}
|
||
var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
|
||
if ( true && !ob) {
|
||
if (target == null || isPrimitive(target)) {
|
||
warn("value cannot be made reactive: ".concat(String(target)));
|
||
}
|
||
if (isCollectionType(target)) {
|
||
warn("Vue 2 does not support reactive collection types such as Map or Set.");
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function isReactive(value) {
|
||
if (isReadonly(value)) {
|
||
return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
|
||
}
|
||
return !!(value && value.__ob__);
|
||
}
|
||
function isShallow(value) {
|
||
return !!(value && value.__v_isShallow);
|
||
}
|
||
function isReadonly(value) {
|
||
return !!(value && value.__v_isReadonly);
|
||
}
|
||
function isProxy(value) {
|
||
return isReactive(value) || isReadonly(value);
|
||
}
|
||
function toRaw(observed) {
|
||
var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
|
||
return raw ? toRaw(raw) : observed;
|
||
}
|
||
function markRaw(value) {
|
||
// non-extensible objects won't be observed anyway
|
||
if (Object.isExtensible(value)) {
|
||
def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
|
||
}
|
||
return value;
|
||
}
|
||
/**
|
||
* @internal
|
||
*/
|
||
function isCollectionType(value) {
|
||
var type = toRawType(value);
|
||
return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
|
||
}
|
||
|
||
/**
|
||
* @internal
|
||
*/
|
||
var RefFlag = "__v_isRef";
|
||
function isRef(r) {
|
||
return !!(r && r.__v_isRef === true);
|
||
}
|
||
function ref$1(value) {
|
||
return createRef(value, false);
|
||
}
|
||
function shallowRef(value) {
|
||
return createRef(value, true);
|
||
}
|
||
function createRef(rawValue, shallow) {
|
||
if (isRef(rawValue)) {
|
||
return rawValue;
|
||
}
|
||
var ref = {};
|
||
def(ref, RefFlag, true);
|
||
def(ref, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, shallow);
|
||
def(ref, 'dep', defineReactive(ref, 'value', rawValue, null, shallow, isServerRendering()));
|
||
return ref;
|
||
}
|
||
function triggerRef(ref) {
|
||
if ( true && !ref.dep) {
|
||
warn("received object is not a triggerable ref.");
|
||
}
|
||
if (true) {
|
||
ref.dep &&
|
||
ref.dep.notify({
|
||
type: "set" /* TriggerOpTypes.SET */,
|
||
target: ref,
|
||
key: 'value'
|
||
});
|
||
}
|
||
else {}
|
||
}
|
||
function unref(ref) {
|
||
return isRef(ref) ? ref.value : ref;
|
||
}
|
||
function proxyRefs(objectWithRefs) {
|
||
if (isReactive(objectWithRefs)) {
|
||
return objectWithRefs;
|
||
}
|
||
var proxy = {};
|
||
var keys = Object.keys(objectWithRefs);
|
||
for (var i = 0; i < keys.length; i++) {
|
||
proxyWithRefUnwrap(proxy, objectWithRefs, keys[i]);
|
||
}
|
||
return proxy;
|
||
}
|
||
function proxyWithRefUnwrap(target, source, key) {
|
||
Object.defineProperty(target, key, {
|
||
enumerable: true,
|
||
configurable: true,
|
||
get: function () {
|
||
var val = source[key];
|
||
if (isRef(val)) {
|
||
return val.value;
|
||
}
|
||
else {
|
||
var ob = val && val.__ob__;
|
||
if (ob)
|
||
ob.dep.depend();
|
||
return val;
|
||
}
|
||
},
|
||
set: function (value) {
|
||
var oldValue = source[key];
|
||
if (isRef(oldValue) && !isRef(value)) {
|
||
oldValue.value = value;
|
||
}
|
||
else {
|
||
source[key] = value;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
function customRef(factory) {
|
||
var dep = new Dep();
|
||
var _a = factory(function () {
|
||
if (true) {
|
||
dep.depend({
|
||
target: ref,
|
||
type: "get" /* TrackOpTypes.GET */,
|
||
key: 'value'
|
||
});
|
||
}
|
||
else {}
|
||
}, function () {
|
||
if (true) {
|
||
dep.notify({
|
||
target: ref,
|
||
type: "set" /* TriggerOpTypes.SET */,
|
||
key: 'value'
|
||
});
|
||
}
|
||
else {}
|
||
}), get = _a.get, set = _a.set;
|
||
var ref = {
|
||
get value() {
|
||
return get();
|
||
},
|
||
set value(newVal) {
|
||
set(newVal);
|
||
}
|
||
};
|
||
def(ref, RefFlag, true);
|
||
return ref;
|
||
}
|
||
function toRefs(object) {
|
||
if ( true && !isReactive(object)) {
|
||
warn("toRefs() expects a reactive object but received a plain one.");
|
||
}
|
||
var ret = isArray(object) ? new Array(object.length) : {};
|
||
for (var key in object) {
|
||
ret[key] = toRef(object, key);
|
||
}
|
||
return ret;
|
||
}
|
||
function toRef(object, key, defaultValue) {
|
||
var val = object[key];
|
||
if (isRef(val)) {
|
||
return val;
|
||
}
|
||
var ref = {
|
||
get value() {
|
||
var val = object[key];
|
||
return val === undefined ? defaultValue : val;
|
||
},
|
||
set value(newVal) {
|
||
object[key] = newVal;
|
||
}
|
||
};
|
||
def(ref, RefFlag, true);
|
||
return ref;
|
||
}
|
||
|
||
var rawToReadonlyFlag = "__v_rawToReadonly";
|
||
var rawToShallowReadonlyFlag = "__v_rawToShallowReadonly";
|
||
function readonly(target) {
|
||
return createReadonly(target, false);
|
||
}
|
||
function createReadonly(target, shallow) {
|
||
if (!isPlainObject(target)) {
|
||
if (true) {
|
||
if (isArray(target)) {
|
||
warn("Vue 2 does not support readonly arrays.");
|
||
}
|
||
else if (isCollectionType(target)) {
|
||
warn("Vue 2 does not support readonly collection types such as Map or Set.");
|
||
}
|
||
else {
|
||
warn("value cannot be made readonly: ".concat(typeof target));
|
||
}
|
||
}
|
||
return target;
|
||
}
|
||
if ( true && !Object.isExtensible(target)) {
|
||
warn("Vue 2 does not support creating readonly proxy for non-extensible object.");
|
||
}
|
||
// already a readonly object
|
||
if (isReadonly(target)) {
|
||
return target;
|
||
}
|
||
// already has a readonly proxy
|
||
var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;
|
||
var existingProxy = target[existingFlag];
|
||
if (existingProxy) {
|
||
return existingProxy;
|
||
}
|
||
var proxy = Object.create(Object.getPrototypeOf(target));
|
||
def(target, existingFlag, proxy);
|
||
def(proxy, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, true);
|
||
def(proxy, "__v_raw" /* ReactiveFlags.RAW */, target);
|
||
if (isRef(target)) {
|
||
def(proxy, RefFlag, true);
|
||
}
|
||
if (shallow || isShallow(target)) {
|
||
def(proxy, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
|
||
}
|
||
var keys = Object.keys(target);
|
||
for (var i = 0; i < keys.length; i++) {
|
||
defineReadonlyProperty(proxy, target, keys[i], shallow);
|
||
}
|
||
return proxy;
|
||
}
|
||
function defineReadonlyProperty(proxy, target, key, shallow) {
|
||
Object.defineProperty(proxy, key, {
|
||
enumerable: true,
|
||
configurable: true,
|
||
get: function () {
|
||
var val = target[key];
|
||
return shallow || !isPlainObject(val) ? val : readonly(val);
|
||
},
|
||
set: function () {
|
||
true &&
|
||
warn("Set operation on key \"".concat(key, "\" failed: target is readonly."));
|
||
}
|
||
});
|
||
}
|
||
/**
|
||
* Returns a reactive-copy of the original object, where only the root level
|
||
* properties are readonly, and does NOT unwrap refs nor recursively convert
|
||
* returned properties.
|
||
* This is used for creating the props proxy object for stateful components.
|
||
*/
|
||
function shallowReadonly(target) {
|
||
return createReadonly(target, true);
|
||
}
|
||
|
||
function computed(getterOrOptions, debugOptions) {
|
||
var getter;
|
||
var setter;
|
||
var onlyGetter = isFunction(getterOrOptions);
|
||
if (onlyGetter) {
|
||
getter = getterOrOptions;
|
||
setter = true
|
||
? function () {
|
||
warn('Write operation failed: computed value is readonly');
|
||
}
|
||
: 0;
|
||
}
|
||
else {
|
||
getter = getterOrOptions.get;
|
||
setter = getterOrOptions.set;
|
||
}
|
||
var watcher = isServerRendering()
|
||
? null
|
||
: new Watcher(currentInstance, getter, noop, { lazy: true });
|
||
if ( true && watcher && debugOptions) {
|
||
watcher.onTrack = debugOptions.onTrack;
|
||
watcher.onTrigger = debugOptions.onTrigger;
|
||
}
|
||
var ref = {
|
||
// some libs rely on the presence effect for checking computed refs
|
||
// from normal refs, but the implementation doesn't matter
|
||
effect: watcher,
|
||
get value() {
|
||
if (watcher) {
|
||
if (watcher.dirty) {
|
||
watcher.evaluate();
|
||
}
|
||
if (Dep.target) {
|
||
if ( true && Dep.target.onTrack) {
|
||
Dep.target.onTrack({
|
||
effect: Dep.target,
|
||
target: ref,
|
||
type: "get" /* TrackOpTypes.GET */,
|
||
key: 'value'
|
||
});
|
||
}
|
||
watcher.depend();
|
||
}
|
||
return watcher.value;
|
||
}
|
||
else {
|
||
return getter();
|
||
}
|
||
},
|
||
set value(newVal) {
|
||
setter(newVal);
|
||
}
|
||
};
|
||
def(ref, RefFlag, true);
|
||
def(ref, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, onlyGetter);
|
||
return ref;
|
||
}
|
||
|
||
var WATCHER = "watcher";
|
||
var WATCHER_CB = "".concat(WATCHER, " callback");
|
||
var WATCHER_GETTER = "".concat(WATCHER, " getter");
|
||
var WATCHER_CLEANUP = "".concat(WATCHER, " cleanup");
|
||
// Simple effect.
|
||
function watchEffect(effect, options) {
|
||
return doWatch(effect, null, options);
|
||
}
|
||
function watchPostEffect(effect, options) {
|
||
return doWatch(effect, null, ( true
|
||
? __assign(__assign({}, options), { flush: 'post' }) : 0));
|
||
}
|
||
function watchSyncEffect(effect, options) {
|
||
return doWatch(effect, null, ( true
|
||
? __assign(__assign({}, options), { flush: 'sync' }) : 0));
|
||
}
|
||
// initial value for watchers to trigger on undefined initial values
|
||
var INITIAL_WATCHER_VALUE = {};
|
||
// implementation
|
||
function watch(source, cb, options) {
|
||
if ( true && typeof cb !== 'function') {
|
||
warn("`watch(fn, options?)` signature has been moved to a separate API. " +
|
||
"Use `watchEffect(fn, options?)` instead. `watch` now only " +
|
||
"supports `watch(source, cb, options?) signature.");
|
||
}
|
||
return doWatch(source, cb, options);
|
||
}
|
||
function doWatch(source, cb, _a) {
|
||
var _b = _a === void 0 ? emptyObject : _a, immediate = _b.immediate, deep = _b.deep, _c = _b.flush, flush = _c === void 0 ? 'pre' : _c, onTrack = _b.onTrack, onTrigger = _b.onTrigger;
|
||
if ( true && !cb) {
|
||
if (immediate !== undefined) {
|
||
warn("watch() \"immediate\" option is only respected when using the " +
|
||
"watch(source, callback, options?) signature.");
|
||
}
|
||
if (deep !== undefined) {
|
||
warn("watch() \"deep\" option is only respected when using the " +
|
||
"watch(source, callback, options?) signature.");
|
||
}
|
||
}
|
||
var warnInvalidSource = function (s) {
|
||
warn("Invalid watch source: ".concat(s, ". A watch source can only be a getter/effect ") +
|
||
"function, a ref, a reactive object, or an array of these types.");
|
||
};
|
||
var instance = currentInstance;
|
||
var call = function (fn, type, args) {
|
||
if (args === void 0) { args = null; }
|
||
var res = invokeWithErrorHandling(fn, null, args, instance, type);
|
||
if (deep && res && res.__ob__)
|
||
res.__ob__.dep.depend();
|
||
return res;
|
||
};
|
||
var getter;
|
||
var forceTrigger = false;
|
||
var isMultiSource = false;
|
||
if (isRef(source)) {
|
||
getter = function () { return source.value; };
|
||
forceTrigger = isShallow(source);
|
||
}
|
||
else if (isReactive(source)) {
|
||
getter = function () {
|
||
source.__ob__.dep.depend();
|
||
return source;
|
||
};
|
||
deep = true;
|
||
}
|
||
else if (isArray(source)) {
|
||
isMultiSource = true;
|
||
forceTrigger = source.some(function (s) { return isReactive(s) || isShallow(s); });
|
||
getter = function () {
|
||
return source.map(function (s) {
|
||
if (isRef(s)) {
|
||
return s.value;
|
||
}
|
||
else if (isReactive(s)) {
|
||
s.__ob__.dep.depend();
|
||
return traverse(s);
|
||
}
|
||
else if (isFunction(s)) {
|
||
return call(s, WATCHER_GETTER);
|
||
}
|
||
else {
|
||
true && warnInvalidSource(s);
|
||
}
|
||
});
|
||
};
|
||
}
|
||
else if (isFunction(source)) {
|
||
if (cb) {
|
||
// getter with cb
|
||
getter = function () { return call(source, WATCHER_GETTER); };
|
||
}
|
||
else {
|
||
// no cb -> simple effect
|
||
getter = function () {
|
||
if (instance && instance._isDestroyed) {
|
||
return;
|
||
}
|
||
if (cleanup) {
|
||
cleanup();
|
||
}
|
||
return call(source, WATCHER, [onCleanup]);
|
||
};
|
||
}
|
||
}
|
||
else {
|
||
getter = noop;
|
||
true && warnInvalidSource(source);
|
||
}
|
||
if (cb && deep) {
|
||
var baseGetter_1 = getter;
|
||
getter = function () { return traverse(baseGetter_1()); };
|
||
}
|
||
var cleanup;
|
||
var onCleanup = function (fn) {
|
||
cleanup = watcher.onStop = function () {
|
||
call(fn, WATCHER_CLEANUP);
|
||
};
|
||
};
|
||
// in SSR there is no need to setup an actual effect, and it should be noop
|
||
// unless it's eager
|
||
if (isServerRendering()) {
|
||
// we will also not call the invalidate callback (+ runner is not set up)
|
||
onCleanup = noop;
|
||
if (!cb) {
|
||
getter();
|
||
}
|
||
else if (immediate) {
|
||
call(cb, WATCHER_CB, [
|
||
getter(),
|
||
isMultiSource ? [] : undefined,
|
||
onCleanup
|
||
]);
|
||
}
|
||
return noop;
|
||
}
|
||
var watcher = new Watcher(currentInstance, getter, noop, {
|
||
lazy: true
|
||
});
|
||
watcher.noRecurse = !cb;
|
||
var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
||
// overwrite default run
|
||
watcher.run = function () {
|
||
if (!watcher.active) {
|
||
return;
|
||
}
|
||
if (cb) {
|
||
// watch(source, cb)
|
||
var newValue = watcher.get();
|
||
if (deep ||
|
||
forceTrigger ||
|
||
(isMultiSource
|
||
? newValue.some(function (v, i) {
|
||
return hasChanged(v, oldValue[i]);
|
||
})
|
||
: hasChanged(newValue, oldValue))) {
|
||
// cleanup before running cb again
|
||
if (cleanup) {
|
||
cleanup();
|
||
}
|
||
call(cb, WATCHER_CB, [
|
||
newValue,
|
||
// pass undefined as the old value when it's changed for the first time
|
||
oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
|
||
onCleanup
|
||
]);
|
||
oldValue = newValue;
|
||
}
|
||
}
|
||
else {
|
||
// watchEffect
|
||
watcher.get();
|
||
}
|
||
};
|
||
if (flush === 'sync') {
|
||
watcher.update = watcher.run;
|
||
}
|
||
else if (flush === 'post') {
|
||
watcher.post = true;
|
||
watcher.update = function () { return queueWatcher(watcher); };
|
||
}
|
||
else {
|
||
// pre
|
||
watcher.update = function () {
|
||
if (instance && instance === currentInstance && !instance._isMounted) {
|
||
// pre-watcher triggered before
|
||
var buffer = instance._preWatchers || (instance._preWatchers = []);
|
||
if (buffer.indexOf(watcher) < 0)
|
||
buffer.push(watcher);
|
||
}
|
||
else {
|
||
queueWatcher(watcher);
|
||
}
|
||
};
|
||
}
|
||
if (true) {
|
||
watcher.onTrack = onTrack;
|
||
watcher.onTrigger = onTrigger;
|
||
}
|
||
// initial run
|
||
if (cb) {
|
||
if (immediate) {
|
||
watcher.run();
|
||
}
|
||
else {
|
||
oldValue = watcher.get();
|
||
}
|
||
}
|
||
else if (flush === 'post' && instance) {
|
||
instance.$once('hook:mounted', function () { return watcher.get(); });
|
||
}
|
||
else {
|
||
watcher.get();
|
||
}
|
||
return function () {
|
||
watcher.teardown();
|
||
};
|
||
}
|
||
|
||
var activeEffectScope;
|
||
var EffectScope = /** @class */ (function () {
|
||
function EffectScope(detached) {
|
||
if (detached === void 0) { detached = false; }
|
||
this.detached = detached;
|
||
/**
|
||
* @internal
|
||
*/
|
||
this.active = true;
|
||
/**
|
||
* @internal
|
||
*/
|
||
this.effects = [];
|
||
/**
|
||
* @internal
|
||
*/
|
||
this.cleanups = [];
|
||
this.parent = activeEffectScope;
|
||
if (!detached && activeEffectScope) {
|
||
this.index =
|
||
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
||
}
|
||
}
|
||
EffectScope.prototype.run = function (fn) {
|
||
if (this.active) {
|
||
var currentEffectScope = activeEffectScope;
|
||
try {
|
||
activeEffectScope = this;
|
||
return fn();
|
||
}
|
||
finally {
|
||
activeEffectScope = currentEffectScope;
|
||
}
|
||
}
|
||
else if (true) {
|
||
warn("cannot run an inactive effect scope.");
|
||
}
|
||
};
|
||
/**
|
||
* This should only be called on non-detached scopes
|
||
* @internal
|
||
*/
|
||
EffectScope.prototype.on = function () {
|
||
activeEffectScope = this;
|
||
};
|
||
/**
|
||
* This should only be called on non-detached scopes
|
||
* @internal
|
||
*/
|
||
EffectScope.prototype.off = function () {
|
||
activeEffectScope = this.parent;
|
||
};
|
||
EffectScope.prototype.stop = function (fromParent) {
|
||
if (this.active) {
|
||
var i = void 0, l = void 0;
|
||
for (i = 0, l = this.effects.length; i < l; i++) {
|
||
this.effects[i].teardown();
|
||
}
|
||
for (i = 0, l = this.cleanups.length; i < l; i++) {
|
||
this.cleanups[i]();
|
||
}
|
||
if (this.scopes) {
|
||
for (i = 0, l = this.scopes.length; i < l; i++) {
|
||
this.scopes[i].stop(true);
|
||
}
|
||
}
|
||
// nested scope, dereference from parent to avoid memory leaks
|
||
if (!this.detached && this.parent && !fromParent) {
|
||
// optimized O(1) removal
|
||
var last = this.parent.scopes.pop();
|
||
if (last && last !== this) {
|
||
this.parent.scopes[this.index] = last;
|
||
last.index = this.index;
|
||
}
|
||
}
|
||
this.parent = undefined;
|
||
this.active = false;
|
||
}
|
||
};
|
||
return EffectScope;
|
||
}());
|
||
function effectScope(detached) {
|
||
return new EffectScope(detached);
|
||
}
|
||
/**
|
||
* @internal
|
||
*/
|
||
function recordEffectScope(effect, scope) {
|
||
if (scope === void 0) { scope = activeEffectScope; }
|
||
if (scope && scope.active) {
|
||
scope.effects.push(effect);
|
||
}
|
||
}
|
||
function getCurrentScope() {
|
||
return activeEffectScope;
|
||
}
|
||
function onScopeDispose(fn) {
|
||
if (activeEffectScope) {
|
||
activeEffectScope.cleanups.push(fn);
|
||
}
|
||
else if (true) {
|
||
warn("onScopeDispose() is called when there is no active effect scope" +
|
||
" to be associated with.");
|
||
}
|
||
}
|
||
|
||
function provide(key, value) {
|
||
if (!currentInstance) {
|
||
if (true) {
|
||
warn("provide() can only be used inside setup().");
|
||
}
|
||
}
|
||
else {
|
||
// TS doesn't allow symbol as index type
|
||
resolveProvided(currentInstance)[key] = value;
|
||
}
|
||
}
|
||
function resolveProvided(vm) {
|
||
// by default an instance inherits its parent's provides object
|
||
// but when it needs to provide values of its own, it creates its
|
||
// own provides object using parent provides object as prototype.
|
||
// this way in `inject` we can simply look up injections from direct
|
||
// parent and let the prototype chain do the work.
|
||
var existing = vm._provided;
|
||
var parentProvides = vm.$parent && vm.$parent._provided;
|
||
if (parentProvides === existing) {
|
||
return (vm._provided = Object.create(parentProvides));
|
||
}
|
||
else {
|
||
return existing;
|
||
}
|
||
}
|
||
function inject(key, defaultValue, treatDefaultAsFactory) {
|
||
if (treatDefaultAsFactory === void 0) { treatDefaultAsFactory = false; }
|
||
// fallback to `currentRenderingInstance` so that this can be called in
|
||
// a functional component
|
||
var instance = currentInstance;
|
||
if (instance) {
|
||
// #2400
|
||
// to support `app.use` plugins,
|
||
// fallback to appContext's `provides` if the instance is at root
|
||
var provides = instance.$parent && instance.$parent._provided;
|
||
if (provides && key in provides) {
|
||
// TS doesn't allow symbol as index type
|
||
return provides[key];
|
||
}
|
||
else if (arguments.length > 1) {
|
||
return treatDefaultAsFactory && isFunction(defaultValue)
|
||
? defaultValue.call(instance)
|
||
: defaultValue;
|
||
}
|
||
else if (true) {
|
||
warn("injection \"".concat(String(key), "\" not found."));
|
||
}
|
||
}
|
||
else if (true) {
|
||
warn("inject() can only be used inside setup() or functional components.");
|
||
}
|
||
}
|
||
|
||
var normalizeEvent = cached(function (name) {
|
||
var passive = name.charAt(0) === '&';
|
||
name = passive ? name.slice(1) : name;
|
||
var once = name.charAt(0) === '~'; // Prefixed last, checked first
|
||
name = once ? name.slice(1) : name;
|
||
var capture = name.charAt(0) === '!';
|
||
name = capture ? name.slice(1) : name;
|
||
return {
|
||
name: name,
|
||
once: once,
|
||
capture: capture,
|
||
passive: passive
|
||
};
|
||
});
|
||
function createFnInvoker(fns, vm) {
|
||
function invoker() {
|
||
var fns = invoker.fns;
|
||
if (isArray(fns)) {
|
||
var cloned = fns.slice();
|
||
for (var i = 0; i < cloned.length; i++) {
|
||
invokeWithErrorHandling(cloned[i], null, arguments, vm, "v-on handler");
|
||
}
|
||
}
|
||
else {
|
||
// return handler return value for single handlers
|
||
return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler");
|
||
}
|
||
}
|
||
invoker.fns = fns;
|
||
return invoker;
|
||
}
|
||
function updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {
|
||
var name, cur, old, event;
|
||
for (name in on) {
|
||
cur = on[name];
|
||
old = oldOn[name];
|
||
event = normalizeEvent(name);
|
||
if (isUndef(cur)) {
|
||
true &&
|
||
warn("Invalid handler for event \"".concat(event.name, "\": got ") + String(cur), vm);
|
||
}
|
||
else if (isUndef(old)) {
|
||
if (isUndef(cur.fns)) {
|
||
cur = on[name] = createFnInvoker(cur, vm);
|
||
}
|
||
if (isTrue(event.once)) {
|
||
cur = on[name] = createOnceHandler(event.name, cur, event.capture);
|
||
}
|
||
add(event.name, cur, event.capture, event.passive, event.params);
|
||
}
|
||
else if (cur !== old) {
|
||
old.fns = cur;
|
||
on[name] = old;
|
||
}
|
||
}
|
||
for (name in oldOn) {
|
||
if (isUndef(on[name])) {
|
||
event = normalizeEvent(name);
|
||
remove(event.name, oldOn[name], event.capture);
|
||
}
|
||
}
|
||
}
|
||
|
||
function mergeVNodeHook(def, hookKey, hook) {
|
||
if (def instanceof VNode) {
|
||
def = def.data.hook || (def.data.hook = {});
|
||
}
|
||
var invoker;
|
||
var oldHook = def[hookKey];
|
||
function wrappedHook() {
|
||
hook.apply(this, arguments);
|
||
// important: remove merged hook to ensure it's called only once
|
||
// and prevent memory leak
|
||
remove$2(invoker.fns, wrappedHook);
|
||
}
|
||
if (isUndef(oldHook)) {
|
||
// no existing hook
|
||
invoker = createFnInvoker([wrappedHook]);
|
||
}
|
||
else {
|
||
/* istanbul ignore if */
|
||
if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
|
||
// already a merged invoker
|
||
invoker = oldHook;
|
||
invoker.fns.push(wrappedHook);
|
||
}
|
||
else {
|
||
// existing plain hook
|
||
invoker = createFnInvoker([oldHook, wrappedHook]);
|
||
}
|
||
}
|
||
invoker.merged = true;
|
||
def[hookKey] = invoker;
|
||
}
|
||
|
||
function extractPropsFromVNodeData(data, Ctor, tag) {
|
||
// we are only extracting raw values here.
|
||
// validation and default values are handled in the child
|
||
// component itself.
|
||
var propOptions = Ctor.options.props;
|
||
if (isUndef(propOptions)) {
|
||
return;
|
||
}
|
||
var res = {};
|
||
var attrs = data.attrs, props = data.props;
|
||
if (isDef(attrs) || isDef(props)) {
|
||
for (var key in propOptions) {
|
||
var altKey = hyphenate(key);
|
||
if (true) {
|
||
var keyInLowerCase = key.toLowerCase();
|
||
if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {
|
||
tip("Prop \"".concat(keyInLowerCase, "\" is passed to component ") +
|
||
"".concat(formatComponentName(
|
||
// @ts-expect-error tag is string
|
||
tag || Ctor), ", but the declared prop name is") +
|
||
" \"".concat(key, "\". ") +
|
||
"Note that HTML attributes are case-insensitive and camelCased " +
|
||
"props need to use their kebab-case equivalents when using in-DOM " +
|
||
"templates. You should probably use \"".concat(altKey, "\" instead of \"").concat(key, "\"."));
|
||
}
|
||
}
|
||
checkProp(res, props, key, altKey, true) ||
|
||
checkProp(res, attrs, key, altKey, false);
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
function checkProp(res, hash, key, altKey, preserve) {
|
||
if (isDef(hash)) {
|
||
if (hasOwn(hash, key)) {
|
||
res[key] = hash[key];
|
||
if (!preserve) {
|
||
delete hash[key];
|
||
}
|
||
return true;
|
||
}
|
||
else if (hasOwn(hash, altKey)) {
|
||
res[key] = hash[altKey];
|
||
if (!preserve) {
|
||
delete hash[altKey];
|
||
}
|
||
return true;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
|
||
// The template compiler attempts to minimize the need for normalization by
|
||
// statically analyzing the template at compile time.
|
||
//
|
||
// For plain HTML markup, normalization can be completely skipped because the
|
||
// generated render function is guaranteed to return Array<VNode>. There are
|
||
// two cases where extra normalization is needed:
|
||
// 1. When the children contains components - because a functional component
|
||
// may return an Array instead of a single root. In this case, just a simple
|
||
// normalization is needed - if any child is an Array, we flatten the whole
|
||
// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
|
||
// because functional components already normalize their own children.
|
||
function simpleNormalizeChildren(children) {
|
||
for (var i = 0; i < children.length; i++) {
|
||
if (isArray(children[i])) {
|
||
return Array.prototype.concat.apply([], children);
|
||
}
|
||
}
|
||
return children;
|
||
}
|
||
// 2. When the children contains constructs that always generated nested Arrays,
|
||
// e.g. <template>, <slot>, v-for, or when the children is provided by user
|
||
// with hand-written render functions / JSX. In such cases a full normalization
|
||
// is needed to cater to all possible types of children values.
|
||
function normalizeChildren(children) {
|
||
return isPrimitive(children)
|
||
? [createTextVNode(children)]
|
||
: isArray(children)
|
||
? normalizeArrayChildren(children)
|
||
: undefined;
|
||
}
|
||
function isTextNode(node) {
|
||
return isDef(node) && isDef(node.text) && isFalse(node.isComment);
|
||
}
|
||
function normalizeArrayChildren(children, nestedIndex) {
|
||
var res = [];
|
||
var i, c, lastIndex, last;
|
||
for (i = 0; i < children.length; i++) {
|
||
c = children[i];
|
||
if (isUndef(c) || typeof c === 'boolean')
|
||
continue;
|
||
lastIndex = res.length - 1;
|
||
last = res[lastIndex];
|
||
// nested
|
||
if (isArray(c)) {
|
||
if (c.length > 0) {
|
||
c = normalizeArrayChildren(c, "".concat(nestedIndex || '', "_").concat(i));
|
||
// merge adjacent text nodes
|
||
if (isTextNode(c[0]) && isTextNode(last)) {
|
||
res[lastIndex] = createTextVNode(last.text + c[0].text);
|
||
c.shift();
|
||
}
|
||
res.push.apply(res, c);
|
||
}
|
||
}
|
||
else if (isPrimitive(c)) {
|
||
if (isTextNode(last)) {
|
||
// merge adjacent text nodes
|
||
// this is necessary for SSR hydration because text nodes are
|
||
// essentially merged when rendered to HTML strings
|
||
res[lastIndex] = createTextVNode(last.text + c);
|
||
}
|
||
else if (c !== '') {
|
||
// convert primitive to vnode
|
||
res.push(createTextVNode(c));
|
||
}
|
||
}
|
||
else {
|
||
if (isTextNode(c) && isTextNode(last)) {
|
||
// merge adjacent text nodes
|
||
res[lastIndex] = createTextVNode(last.text + c.text);
|
||
}
|
||
else {
|
||
// default key for nested array children (likely generated by v-for)
|
||
if (isTrue(children._isVList) &&
|
||
isDef(c.tag) &&
|
||
isUndef(c.key) &&
|
||
isDef(nestedIndex)) {
|
||
c.key = "__vlist".concat(nestedIndex, "_").concat(i, "__");
|
||
}
|
||
res.push(c);
|
||
}
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
|
||
/**
|
||
* Runtime helper for rendering v-for lists.
|
||
*/
|
||
function renderList(val, render) {
|
||
var ret = null, i, l, keys, key;
|
||
if (isArray(val) || typeof val === 'string') {
|
||
ret = new Array(val.length);
|
||
for (i = 0, l = val.length; i < l; i++) {
|
||
ret[i] = render(val[i], i);
|
||
}
|
||
}
|
||
else if (typeof val === 'number') {
|
||
ret = new Array(val);
|
||
for (i = 0; i < val; i++) {
|
||
ret[i] = render(i + 1, i);
|
||
}
|
||
}
|
||
else if (isObject(val)) {
|
||
if (hasSymbol && val[Symbol.iterator]) {
|
||
ret = [];
|
||
var iterator = val[Symbol.iterator]();
|
||
var result = iterator.next();
|
||
while (!result.done) {
|
||
ret.push(render(result.value, ret.length));
|
||
result = iterator.next();
|
||
}
|
||
}
|
||
else {
|
||
keys = Object.keys(val);
|
||
ret = new Array(keys.length);
|
||
for (i = 0, l = keys.length; i < l; i++) {
|
||
key = keys[i];
|
||
ret[i] = render(val[key], key, i);
|
||
}
|
||
}
|
||
}
|
||
if (!isDef(ret)) {
|
||
ret = [];
|
||
}
|
||
ret._isVList = true;
|
||
return ret;
|
||
}
|
||
|
||
/**
|
||
* Runtime helper for rendering <slot>
|
||
*/
|
||
function renderSlot(name, fallbackRender, props, bindObject) {
|
||
var scopedSlotFn = this.$scopedSlots[name];
|
||
var nodes;
|
||
if (scopedSlotFn) {
|
||
// scoped slot
|
||
props = props || {};
|
||
if (bindObject) {
|
||
if ( true && !isObject(bindObject)) {
|
||
warn('slot v-bind without argument expects an Object', this);
|
||
}
|
||
props = extend(extend({}, bindObject), props);
|
||
}
|
||
nodes =
|
||
scopedSlotFn(props) ||
|
||
(isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
|
||
}
|
||
else {
|
||
nodes =
|
||
this.$slots[name] ||
|
||
(isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
|
||
}
|
||
var target = props && props.slot;
|
||
if (target) {
|
||
return this.$createElement('template', { slot: target }, nodes);
|
||
}
|
||
else {
|
||
return nodes;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Runtime helper for resolving filters
|
||
*/
|
||
function resolveFilter(id) {
|
||
return resolveAsset(this.$options, 'filters', id, true) || identity;
|
||
}
|
||
|
||
function isKeyNotMatch(expect, actual) {
|
||
if (isArray(expect)) {
|
||
return expect.indexOf(actual) === -1;
|
||
}
|
||
else {
|
||
return expect !== actual;
|
||
}
|
||
}
|
||
/**
|
||
* Runtime helper for checking keyCodes from config.
|
||
* exposed as Vue.prototype._k
|
||
* passing in eventKeyName as last argument separately for backwards compat
|
||
*/
|
||
function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {
|
||
var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
|
||
if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
|
||
return isKeyNotMatch(builtInKeyName, eventKeyName);
|
||
}
|
||
else if (mappedKeyCode) {
|
||
return isKeyNotMatch(mappedKeyCode, eventKeyCode);
|
||
}
|
||
else if (eventKeyName) {
|
||
return hyphenate(eventKeyName) !== key;
|
||
}
|
||
return eventKeyCode === undefined;
|
||
}
|
||
|
||
/**
|
||
* Runtime helper for merging v-bind="object" into a VNode's data.
|
||
*/
|
||
function bindObjectProps(data, tag, value, asProp, isSync) {
|
||
if (value) {
|
||
if (!isObject(value)) {
|
||
true &&
|
||
warn('v-bind without argument expects an Object or Array value', this);
|
||
}
|
||
else {
|
||
if (isArray(value)) {
|
||
value = toObject(value);
|
||
}
|
||
var hash = void 0;
|
||
var _loop_1 = function (key) {
|
||
if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
|
||
hash = data;
|
||
}
|
||
else {
|
||
var type = data.attrs && data.attrs.type;
|
||
hash =
|
||
asProp || config.mustUseProp(tag, type, key)
|
||
? data.domProps || (data.domProps = {})
|
||
: data.attrs || (data.attrs = {});
|
||
}
|
||
var camelizedKey = camelize(key);
|
||
var hyphenatedKey = hyphenate(key);
|
||
if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
|
||
hash[key] = value[key];
|
||
if (isSync) {
|
||
var on = data.on || (data.on = {});
|
||
on["update:".concat(key)] = function ($event) {
|
||
value[key] = $event;
|
||
};
|
||
}
|
||
}
|
||
};
|
||
for (var key in value) {
|
||
_loop_1(key);
|
||
}
|
||
}
|
||
}
|
||
return data;
|
||
}
|
||
|
||
/**
|
||
* Runtime helper for rendering static trees.
|
||
*/
|
||
function renderStatic(index, isInFor) {
|
||
var cached = this._staticTrees || (this._staticTrees = []);
|
||
var tree = cached[index];
|
||
// if has already-rendered static tree and not inside v-for,
|
||
// we can reuse the same tree.
|
||
if (tree && !isInFor) {
|
||
return tree;
|
||
}
|
||
// otherwise, render a fresh tree.
|
||
tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates
|
||
);
|
||
markStatic(tree, "__static__".concat(index), false);
|
||
return tree;
|
||
}
|
||
/**
|
||
* Runtime helper for v-once.
|
||
* Effectively it means marking the node as static with a unique key.
|
||
*/
|
||
function markOnce(tree, index, key) {
|
||
markStatic(tree, "__once__".concat(index).concat(key ? "_".concat(key) : ""), true);
|
||
return tree;
|
||
}
|
||
function markStatic(tree, key, isOnce) {
|
||
if (isArray(tree)) {
|
||
for (var i = 0; i < tree.length; i++) {
|
||
if (tree[i] && typeof tree[i] !== 'string') {
|
||
markStaticNode(tree[i], "".concat(key, "_").concat(i), isOnce);
|
||
}
|
||
}
|
||
}
|
||
else {
|
||
markStaticNode(tree, key, isOnce);
|
||
}
|
||
}
|
||
function markStaticNode(node, key, isOnce) {
|
||
node.isStatic = true;
|
||
node.key = key;
|
||
node.isOnce = isOnce;
|
||
}
|
||
|
||
function bindObjectListeners(data, value) {
|
||
if (value) {
|
||
if (!isPlainObject(value)) {
|
||
true && warn('v-on without argument expects an Object value', this);
|
||
}
|
||
else {
|
||
var on = (data.on = data.on ? extend({}, data.on) : {});
|
||
for (var key in value) {
|
||
var existing = on[key];
|
||
var ours = value[key];
|
||
on[key] = existing ? [].concat(existing, ours) : ours;
|
||
}
|
||
}
|
||
}
|
||
return data;
|
||
}
|
||
|
||
function resolveScopedSlots(fns, res,
|
||
// the following are added in 2.6
|
||
hasDynamicKeys, contentHashKey) {
|
||
res = res || { $stable: !hasDynamicKeys };
|
||
for (var i = 0; i < fns.length; i++) {
|
||
var slot = fns[i];
|
||
if (isArray(slot)) {
|
||
resolveScopedSlots(slot, res, hasDynamicKeys);
|
||
}
|
||
else if (slot) {
|
||
// marker for reverse proxying v-slot without scope on this.$slots
|
||
// @ts-expect-error
|
||
if (slot.proxy) {
|
||
// @ts-expect-error
|
||
slot.fn.proxy = true;
|
||
}
|
||
res[slot.key] = slot.fn;
|
||
}
|
||
}
|
||
if (contentHashKey) {
|
||
res.$key = contentHashKey;
|
||
}
|
||
return res;
|
||
}
|
||
|
||
// helper to process dynamic keys for dynamic arguments in v-bind and v-on.
|
||
function bindDynamicKeys(baseObj, values) {
|
||
for (var i = 0; i < values.length; i += 2) {
|
||
var key = values[i];
|
||
if (typeof key === 'string' && key) {
|
||
baseObj[values[i]] = values[i + 1];
|
||
}
|
||
else if ( true && key !== '' && key !== null) {
|
||
// null is a special value for explicitly removing a binding
|
||
warn("Invalid value for dynamic directive argument (expected string or null): ".concat(key), this);
|
||
}
|
||
}
|
||
return baseObj;
|
||
}
|
||
// helper to dynamically append modifier runtime markers to event names.
|
||
// ensure only append when value is already string, otherwise it will be cast
|
||
// to string and cause the type check to miss.
|
||
function prependModifier(value, symbol) {
|
||
return typeof value === 'string' ? symbol + value : value;
|
||
}
|
||
|
||
function installRenderHelpers(target) {
|
||
target._o = markOnce;
|
||
target._n = toNumber;
|
||
target._s = toString;
|
||
target._l = renderList;
|
||
target._t = renderSlot;
|
||
target._q = looseEqual;
|
||
target._i = looseIndexOf;
|
||
target._m = renderStatic;
|
||
target._f = resolveFilter;
|
||
target._k = checkKeyCodes;
|
||
target._b = bindObjectProps;
|
||
target._v = createTextVNode;
|
||
target._e = createEmptyVNode;
|
||
target._u = resolveScopedSlots;
|
||
target._g = bindObjectListeners;
|
||
target._d = bindDynamicKeys;
|
||
target._p = prependModifier;
|
||
}
|
||
|
||
/**
|
||
* Runtime helper for resolving raw children VNodes into a slot object.
|
||
*/
|
||
function resolveSlots(children, context) {
|
||
if (!children || !children.length) {
|
||
return {};
|
||
}
|
||
var slots = {};
|
||
for (var i = 0, l = children.length; i < l; i++) {
|
||
var child = children[i];
|
||
var data = child.data;
|
||
// remove slot attribute if the node is resolved as a Vue slot node
|
||
if (data && data.attrs && data.attrs.slot) {
|
||
delete data.attrs.slot;
|
||
}
|
||
// named slots should only be respected if the vnode was rendered in the
|
||
// same context.
|
||
if ((child.context === context || child.fnContext === context) &&
|
||
data &&
|
||
data.slot != null) {
|
||
var name_1 = data.slot;
|
||
var slot = slots[name_1] || (slots[name_1] = []);
|
||
if (child.tag === 'template') {
|
||
slot.push.apply(slot, child.children || []);
|
||
}
|
||
else {
|
||
slot.push(child);
|
||
}
|
||
}
|
||
else {
|
||
(slots.default || (slots.default = [])).push(child);
|
||
}
|
||
}
|
||
// ignore slots that contains only whitespace
|
||
for (var name_2 in slots) {
|
||
if (slots[name_2].every(isWhitespace)) {
|
||
delete slots[name_2];
|
||
}
|
||
}
|
||
return slots;
|
||
}
|
||
function isWhitespace(node) {
|
||
return (node.isComment && !node.asyncFactory) || node.text === ' ';
|
||
}
|
||
|
||
function isAsyncPlaceholder(node) {
|
||
// @ts-expect-error not really boolean type
|
||
return node.isComment && node.asyncFactory;
|
||
}
|
||
|
||
function normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {
|
||
var res;
|
||
var hasNormalSlots = Object.keys(normalSlots).length > 0;
|
||
var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;
|
||
var key = scopedSlots && scopedSlots.$key;
|
||
if (!scopedSlots) {
|
||
res = {};
|
||
}
|
||
else if (scopedSlots._normalized) {
|
||
// fast path 1: child component re-render only, parent did not change
|
||
return scopedSlots._normalized;
|
||
}
|
||
else if (isStable &&
|
||
prevScopedSlots &&
|
||
prevScopedSlots !== emptyObject &&
|
||
key === prevScopedSlots.$key &&
|
||
!hasNormalSlots &&
|
||
!prevScopedSlots.$hasNormal) {
|
||
// fast path 2: stable scoped slots w/ no normal slots to proxy,
|
||
// only need to normalize once
|
||
return prevScopedSlots;
|
||
}
|
||
else {
|
||
res = {};
|
||
for (var key_1 in scopedSlots) {
|
||
if (scopedSlots[key_1] && key_1[0] !== '$') {
|
||
res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);
|
||
}
|
||
}
|
||
}
|
||
// expose normal slots on scopedSlots
|
||
for (var key_2 in normalSlots) {
|
||
if (!(key_2 in res)) {
|
||
res[key_2] = proxyNormalSlot(normalSlots, key_2);
|
||
}
|
||
}
|
||
// avoriaz seems to mock a non-extensible $scopedSlots object
|
||
// and when that is passed down this would cause an error
|
||
if (scopedSlots && Object.isExtensible(scopedSlots)) {
|
||
scopedSlots._normalized = res;
|
||
}
|
||
def(res, '$stable', isStable);
|
||
def(res, '$key', key);
|
||
def(res, '$hasNormal', hasNormalSlots);
|
||
return res;
|
||
}
|
||
function normalizeScopedSlot(vm, normalSlots, key, fn) {
|
||
var normalized = function () {
|
||
var cur = currentInstance;
|
||
setCurrentInstance(vm);
|
||
var res = arguments.length ? fn.apply(null, arguments) : fn({});
|
||
res =
|
||
res && typeof res === 'object' && !isArray(res)
|
||
? [res] // single vnode
|
||
: normalizeChildren(res);
|
||
var vnode = res && res[0];
|
||
setCurrentInstance(cur);
|
||
return res &&
|
||
(!vnode ||
|
||
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391
|
||
? undefined
|
||
: res;
|
||
};
|
||
// this is a slot using the new v-slot syntax without scope. although it is
|
||
// compiled as a scoped slot, render fn users would expect it to be present
|
||
// on this.$slots because the usage is semantically a normal slot.
|
||
if (fn.proxy) {
|
||
Object.defineProperty(normalSlots, key, {
|
||
get: normalized,
|
||
enumerable: true,
|
||
configurable: true
|
||
});
|
||
}
|
||
return normalized;
|
||
}
|
||
function proxyNormalSlot(slots, key) {
|
||
return function () { return slots[key]; };
|
||
}
|
||
|
||
function initSetup(vm) {
|
||
var options = vm.$options;
|
||
var setup = options.setup;
|
||
if (setup) {
|
||
var ctx = (vm._setupContext = createSetupContext(vm));
|
||
setCurrentInstance(vm);
|
||
pushTarget();
|
||
var setupResult = invokeWithErrorHandling(setup, null, [vm._props || shallowReactive({}), ctx], vm, "setup");
|
||
popTarget();
|
||
setCurrentInstance();
|
||
if (isFunction(setupResult)) {
|
||
// render function
|
||
// @ts-ignore
|
||
options.render = setupResult;
|
||
}
|
||
else if (isObject(setupResult)) {
|
||
// bindings
|
||
if ( true && setupResult instanceof VNode) {
|
||
warn("setup() should not return VNodes directly - " +
|
||
"return a render function instead.");
|
||
}
|
||
vm._setupState = setupResult;
|
||
// __sfc indicates compiled bindings from <script setup>
|
||
if (!setupResult.__sfc) {
|
||
for (var key in setupResult) {
|
||
if (!isReserved(key)) {
|
||
proxyWithRefUnwrap(vm, setupResult, key);
|
||
}
|
||
else if (true) {
|
||
warn("Avoid using variables that start with _ or $ in setup().");
|
||
}
|
||
}
|
||
}
|
||
else {
|
||
// exposed for compiled render fn
|
||
var proxy = (vm._setupProxy = {});
|
||
for (var key in setupResult) {
|
||
if (key !== '__sfc') {
|
||
proxyWithRefUnwrap(proxy, setupResult, key);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
else if ( true && setupResult !== undefined) {
|
||
warn("setup() should return an object. Received: ".concat(setupResult === null ? 'null' : typeof setupResult));
|
||
}
|
||
}
|
||
}
|
||
function createSetupContext(vm) {
|
||
var exposeCalled = false;
|
||
return {
|
||
get attrs() {
|
||
if (!vm._attrsProxy) {
|
||
var proxy = (vm._attrsProxy = {});
|
||
def(proxy, '_v_attr_proxy', true);
|
||
syncSetupProxy(proxy, vm.$attrs, emptyObject, vm, '$attrs');
|
||
}
|
||
return vm._attrsProxy;
|
||
},
|
||
get listeners() {
|
||
if (!vm._listenersProxy) {
|
||
var proxy = (vm._listenersProxy = {});
|
||
syncSetupProxy(proxy, vm.$listeners, emptyObject, vm, '$listeners');
|
||
}
|
||
return vm._listenersProxy;
|
||
},
|
||
get slots() {
|
||
return initSlotsProxy(vm);
|
||
},
|
||
emit: bind(vm.$emit, vm),
|
||
expose: function (exposed) {
|
||
if (true) {
|
||
if (exposeCalled) {
|
||
warn("expose() should be called only once per setup().", vm);
|
||
}
|
||
exposeCalled = true;
|
||
}
|
||
if (exposed) {
|
||
Object.keys(exposed).forEach(function (key) {
|
||
return proxyWithRefUnwrap(vm, exposed, key);
|
||
});
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function syncSetupProxy(to, from, prev, instance, type) {
|
||
var changed = false;
|
||
for (var key in from) {
|
||
if (!(key in to)) {
|
||
changed = true;
|
||
defineProxyAttr(to, key, instance, type);
|
||
}
|
||
else if (from[key] !== prev[key]) {
|
||
changed = true;
|
||
}
|
||
}
|
||
for (var key in to) {
|
||
if (!(key in from)) {
|
||
changed = true;
|
||
delete to[key];
|
||
}
|
||
}
|
||
return changed;
|
||
}
|
||
function defineProxyAttr(proxy, key, instance, type) {
|
||
Object.defineProperty(proxy, key, {
|
||
enumerable: true,
|
||
configurable: true,
|
||
get: function () {
|
||
return instance[type][key];
|
||
}
|
||
});
|
||
}
|
||
function initSlotsProxy(vm) {
|
||
if (!vm._slotsProxy) {
|
||
syncSetupSlots((vm._slotsProxy = {}), vm.$scopedSlots);
|
||
}
|
||
return vm._slotsProxy;
|
||
}
|
||
function syncSetupSlots(to, from) {
|
||
for (var key in from) {
|
||
to[key] = from[key];
|
||
}
|
||
for (var key in to) {
|
||
if (!(key in from)) {
|
||
delete to[key];
|
||
}
|
||
}
|
||
}
|
||
/**
|
||
* @internal use manual type def because public setup context type relies on
|
||
* legacy VNode types
|
||
*/
|
||
function useSlots() {
|
||
return getContext().slots;
|
||
}
|
||
/**
|
||
* @internal use manual type def because public setup context type relies on
|
||
* legacy VNode types
|
||
*/
|
||
function useAttrs() {
|
||
return getContext().attrs;
|
||
}
|
||
/**
|
||
* Vue 2 only
|
||
* @internal use manual type def because public setup context type relies on
|
||
* legacy VNode types
|
||
*/
|
||
function useListeners() {
|
||
return getContext().listeners;
|
||
}
|
||
function getContext() {
|
||
if ( true && !currentInstance) {
|
||
warn("useContext() called without active instance.");
|
||
}
|
||
var vm = currentInstance;
|
||
return vm._setupContext || (vm._setupContext = createSetupContext(vm));
|
||
}
|
||
/**
|
||
* Runtime helper for merging default declarations. Imported by compiled code
|
||
* only.
|
||
* @internal
|
||
*/
|
||
function mergeDefaults(raw, defaults) {
|
||
var props = isArray(raw)
|
||
? raw.reduce(function (normalized, p) { return ((normalized[p] = {}), normalized); }, {})
|
||
: raw;
|
||
for (var key in defaults) {
|
||
var opt = props[key];
|
||
if (opt) {
|
||
if (isArray(opt) || isFunction(opt)) {
|
||
props[key] = { type: opt, default: defaults[key] };
|
||
}
|
||
else {
|
||
opt.default = defaults[key];
|
||
}
|
||
}
|
||
else if (opt === null) {
|
||
props[key] = { default: defaults[key] };
|
||
}
|
||
else if (true) {
|
||
warn("props default key \"".concat(key, "\" has no corresponding declaration."));
|
||
}
|
||
}
|
||
return props;
|
||
}
|
||
|
||
function initRender(vm) {
|
||
vm._vnode = null; // the root of the child tree
|
||
vm._staticTrees = null; // v-once cached trees
|
||
var options = vm.$options;
|
||
var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
|
||
var renderContext = parentVnode && parentVnode.context;
|
||
vm.$slots = resolveSlots(options._renderChildren, renderContext);
|
||
vm.$scopedSlots = parentVnode
|
||
? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
|
||
: emptyObject;
|
||
// bind the createElement fn to this instance
|
||
// so that we get proper render context inside it.
|
||
// args order: tag, data, children, normalizationType, alwaysNormalize
|
||
// internal version is used by render functions compiled from templates
|
||
// @ts-expect-error
|
||
vm._c = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, false); };
|
||
// normalization is always applied for the public version, used in
|
||
// user-written render functions.
|
||
// @ts-expect-error
|
||
vm.$createElement = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, true); };
|
||
// $attrs & $listeners are exposed for easier HOC creation.
|
||
// they need to be reactive so that HOCs using them are always updated
|
||
var parentData = parentVnode && parentVnode.data;
|
||
/* istanbul ignore else */
|
||
if (true) {
|
||
defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, function () {
|
||
!isUpdatingChildComponent && warn("$attrs is readonly.", vm);
|
||
}, true);
|
||
defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () {
|
||
!isUpdatingChildComponent && warn("$listeners is readonly.", vm);
|
||
}, true);
|
||
}
|
||
else {}
|
||
}
|
||
var currentRenderingInstance = null;
|
||
function renderMixin(Vue) {
|
||
// install runtime convenience helpers
|
||
installRenderHelpers(Vue.prototype);
|
||
Vue.prototype.$nextTick = function (fn) {
|
||
return nextTick(fn, this);
|
||
};
|
||
Vue.prototype._render = function () {
|
||
var vm = this;
|
||
var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
|
||
if (_parentVnode && vm._isMounted) {
|
||
vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
|
||
if (vm._slotsProxy) {
|
||
syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
|
||
}
|
||
}
|
||
// set parent vnode. this allows render functions to have access
|
||
// to the data on the placeholder node.
|
||
vm.$vnode = _parentVnode;
|
||
// render self
|
||
var prevInst = currentInstance;
|
||
var prevRenderInst = currentRenderingInstance;
|
||
var vnode;
|
||
try {
|
||
setCurrentInstance(vm);
|
||
currentRenderingInstance = vm;
|
||
vnode = render.call(vm._renderProxy, vm.$createElement);
|
||
}
|
||
catch (e) {
|
||
handleError(e, vm, "render");
|
||
// return error render result,
|
||
// or previous vnode to prevent render error causing blank component
|
||
/* istanbul ignore else */
|
||
if ( true && vm.$options.renderError) {
|
||
try {
|
||
vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
|
||
}
|
||
catch (e) {
|
||
handleError(e, vm, "renderError");
|
||
vnode = vm._vnode;
|
||
}
|
||
}
|
||
else {
|
||
vnode = vm._vnode;
|
||
}
|
||
}
|
||
finally {
|
||
currentRenderingInstance = prevRenderInst;
|
||
setCurrentInstance(prevInst);
|
||
}
|
||
// if the returned array contains only a single node, allow it
|
||
if (isArray(vnode) && vnode.length === 1) {
|
||
vnode = vnode[0];
|
||
}
|
||
// return empty vnode in case the render function errored out
|
||
if (!(vnode instanceof VNode)) {
|
||
if ( true && isArray(vnode)) {
|
||
warn('Multiple root nodes returned from render function. Render function ' +
|
||
'should return a single root node.', vm);
|
||
}
|
||
vnode = createEmptyVNode();
|
||
}
|
||
// set parent
|
||
vnode.parent = _parentVnode;
|
||
return vnode;
|
||
};
|
||
}
|
||
|
||
function ensureCtor(comp, base) {
|
||
if (comp.__esModule || (hasSymbol && comp[Symbol.toStringTag] === 'Module')) {
|
||
comp = comp.default;
|
||
}
|
||
return isObject(comp) ? base.extend(comp) : comp;
|
||
}
|
||
function createAsyncPlaceholder(factory, data, context, children, tag) {
|
||
var node = createEmptyVNode();
|
||
node.asyncFactory = factory;
|
||
node.asyncMeta = { data: data, context: context, children: children, tag: tag };
|
||
return node;
|
||
}
|
||
function resolveAsyncComponent(factory, baseCtor) {
|
||
if (isTrue(factory.error) && isDef(factory.errorComp)) {
|
||
return factory.errorComp;
|
||
}
|
||
if (isDef(factory.resolved)) {
|
||
return factory.resolved;
|
||
}
|
||
var owner = currentRenderingInstance;
|
||
if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
|
||
// already pending
|
||
factory.owners.push(owner);
|
||
}
|
||
if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
|
||
return factory.loadingComp;
|
||
}
|
||
if (owner && !isDef(factory.owners)) {
|
||
var owners_1 = (factory.owners = [owner]);
|
||
var sync_1 = true;
|
||
var timerLoading_1 = null;
|
||
var timerTimeout_1 = null;
|
||
owner.$on('hook:destroyed', function () { return remove$2(owners_1, owner); });
|
||
var forceRender_1 = function (renderCompleted) {
|
||
for (var i = 0, l = owners_1.length; i < l; i++) {
|
||
owners_1[i].$forceUpdate();
|
||
}
|
||
if (renderCompleted) {
|
||
owners_1.length = 0;
|
||
if (timerLoading_1 !== null) {
|
||
clearTimeout(timerLoading_1);
|
||
timerLoading_1 = null;
|
||
}
|
||
if (timerTimeout_1 !== null) {
|
||
clearTimeout(timerTimeout_1);
|
||
timerTimeout_1 = null;
|
||
}
|
||
}
|
||
};
|
||
var resolve = once(function (res) {
|
||
// cache resolved
|
||
factory.resolved = ensureCtor(res, baseCtor);
|
||
// invoke callbacks only if this is not a synchronous resolve
|
||
// (async resolves are shimmed as synchronous during SSR)
|
||
if (!sync_1) {
|
||
forceRender_1(true);
|
||
}
|
||
else {
|
||
owners_1.length = 0;
|
||
}
|
||
});
|
||
var reject_1 = once(function (reason) {
|
||
true &&
|
||
warn("Failed to resolve async component: ".concat(String(factory)) +
|
||
(reason ? "\nReason: ".concat(reason) : ''));
|
||
if (isDef(factory.errorComp)) {
|
||
factory.error = true;
|
||
forceRender_1(true);
|
||
}
|
||
});
|
||
var res_1 = factory(resolve, reject_1);
|
||
if (isObject(res_1)) {
|
||
if (isPromise(res_1)) {
|
||
// () => Promise
|
||
if (isUndef(factory.resolved)) {
|
||
res_1.then(resolve, reject_1);
|
||
}
|
||
}
|
||
else if (isPromise(res_1.component)) {
|
||
res_1.component.then(resolve, reject_1);
|
||
if (isDef(res_1.error)) {
|
||
factory.errorComp = ensureCtor(res_1.error, baseCtor);
|
||
}
|
||
if (isDef(res_1.loading)) {
|
||
factory.loadingComp = ensureCtor(res_1.loading, baseCtor);
|
||
if (res_1.delay === 0) {
|
||
factory.loading = true;
|
||
}
|
||
else {
|
||
// @ts-expect-error NodeJS timeout type
|
||
timerLoading_1 = setTimeout(function () {
|
||
timerLoading_1 = null;
|
||
if (isUndef(factory.resolved) && isUndef(factory.error)) {
|
||
factory.loading = true;
|
||
forceRender_1(false);
|
||
}
|
||
}, res_1.delay || 200);
|
||
}
|
||
}
|
||
if (isDef(res_1.timeout)) {
|
||
// @ts-expect-error NodeJS timeout type
|
||
timerTimeout_1 = setTimeout(function () {
|
||
timerTimeout_1 = null;
|
||
if (isUndef(factory.resolved)) {
|
||
reject_1( true ? "timeout (".concat(res_1.timeout, "ms)") : 0);
|
||
}
|
||
}, res_1.timeout);
|
||
}
|
||
}
|
||
}
|
||
sync_1 = false;
|
||
// return in case resolved synchronously
|
||
return factory.loading ? factory.loadingComp : factory.resolved;
|
||
}
|
||
}
|
||
|
||
function getFirstComponentChild(children) {
|
||
if (isArray(children)) {
|
||
for (var i = 0; i < children.length; i++) {
|
||
var c = children[i];
|
||
if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
|
||
return c;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
var SIMPLE_NORMALIZE = 1;
|
||
var ALWAYS_NORMALIZE = 2;
|
||
// wrapper function for providing a more flexible interface
|
||
// without getting yelled at by flow
|
||
function createElement$1(context, tag, data, children, normalizationType, alwaysNormalize) {
|
||
if (isArray(data) || isPrimitive(data)) {
|
||
normalizationType = children;
|
||
children = data;
|
||
data = undefined;
|
||
}
|
||
if (isTrue(alwaysNormalize)) {
|
||
normalizationType = ALWAYS_NORMALIZE;
|
||
}
|
||
return _createElement(context, tag, data, children, normalizationType);
|
||
}
|
||
function _createElement(context, tag, data, children, normalizationType) {
|
||
if (isDef(data) && isDef(data.__ob__)) {
|
||
true &&
|
||
warn("Avoid using observed data object as vnode data: ".concat(JSON.stringify(data), "\n") + 'Always create fresh vnode data objects in each render!', context);
|
||
return createEmptyVNode();
|
||
}
|
||
// object syntax in v-bind
|
||
if (isDef(data) && isDef(data.is)) {
|
||
tag = data.is;
|
||
}
|
||
if (!tag) {
|
||
// in case of component :is set to falsy value
|
||
return createEmptyVNode();
|
||
}
|
||
// warn against non-primitive key
|
||
if ( true && isDef(data) && isDef(data.key) && !isPrimitive(data.key)) {
|
||
warn('Avoid using non-primitive value as key, ' +
|
||
'use string/number value instead.', context);
|
||
}
|
||
// support single function children as default scoped slot
|
||
if (isArray(children) && isFunction(children[0])) {
|
||
data = data || {};
|
||
data.scopedSlots = { default: children[0] };
|
||
children.length = 0;
|
||
}
|
||
if (normalizationType === ALWAYS_NORMALIZE) {
|
||
children = normalizeChildren(children);
|
||
}
|
||
else if (normalizationType === SIMPLE_NORMALIZE) {
|
||
children = simpleNormalizeChildren(children);
|
||
}
|
||
var vnode, ns;
|
||
if (typeof tag === 'string') {
|
||
var Ctor = void 0;
|
||
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
|
||
if (config.isReservedTag(tag)) {
|
||
// platform built-in elements
|
||
if ( true &&
|
||
isDef(data) &&
|
||
isDef(data.nativeOn) &&
|
||
data.tag !== 'component') {
|
||
warn("The .native modifier for v-on is only valid on components but it was used on <".concat(tag, ">."), context);
|
||
}
|
||
vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);
|
||
}
|
||
else if ((!data || !data.pre) &&
|
||
isDef((Ctor = resolveAsset(context.$options, 'components', tag)))) {
|
||
// component
|
||
vnode = createComponent(Ctor, data, context, children, tag);
|
||
}
|
||
else {
|
||
// unknown or unlisted namespaced elements
|
||
// check at runtime because it may get assigned a namespace when its
|
||
// parent normalizes children
|
||
vnode = new VNode(tag, data, children, undefined, undefined, context);
|
||
}
|
||
}
|
||
else {
|
||
// direct component options / constructor
|
||
vnode = createComponent(tag, data, context, children);
|
||
}
|
||
if (isArray(vnode)) {
|
||
return vnode;
|
||
}
|
||
else if (isDef(vnode)) {
|
||
if (isDef(ns))
|
||
applyNS(vnode, ns);
|
||
if (isDef(data))
|
||
registerDeepBindings(data);
|
||
return vnode;
|
||
}
|
||
else {
|
||
return createEmptyVNode();
|
||
}
|
||
}
|
||
function applyNS(vnode, ns, force) {
|
||
vnode.ns = ns;
|
||
if (vnode.tag === 'foreignObject') {
|
||
// use default namespace inside foreignObject
|
||
ns = undefined;
|
||
force = true;
|
||
}
|
||
if (isDef(vnode.children)) {
|
||
for (var i = 0, l = vnode.children.length; i < l; i++) {
|
||
var child = vnode.children[i];
|
||
if (isDef(child.tag) &&
|
||
(isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
|
||
applyNS(child, ns, force);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
// ref #5318
|
||
// necessary to ensure parent re-render when deep bindings like :style and
|
||
// :class are used on slot nodes
|
||
function registerDeepBindings(data) {
|
||
if (isObject(data.style)) {
|
||
traverse(data.style);
|
||
}
|
||
if (isObject(data.class)) {
|
||
traverse(data.class);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* @internal this function needs manual public type declaration because it relies
|
||
* on previously manually authored types from Vue 2
|
||
*/
|
||
function h(type, props, children) {
|
||
if (!currentInstance) {
|
||
true &&
|
||
warn("globally imported h() can only be invoked when there is an active " +
|
||
"component instance, e.g. synchronously in a component's render or setup function.");
|
||
}
|
||
return createElement$1(currentInstance, type, props, children, 2, true);
|
||
}
|
||
|
||
function handleError(err, vm, info) {
|
||
// Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
|
||
// See: https://github.com/vuejs/vuex/issues/1505
|
||
pushTarget();
|
||
try {
|
||
if (vm) {
|
||
var cur = vm;
|
||
while ((cur = cur.$parent)) {
|
||
var hooks = cur.$options.errorCaptured;
|
||
if (hooks) {
|
||
for (var i = 0; i < hooks.length; i++) {
|
||
try {
|
||
var capture = hooks[i].call(cur, err, vm, info) === false;
|
||
if (capture)
|
||
return;
|
||
}
|
||
catch (e) {
|
||
globalHandleError(e, cur, 'errorCaptured hook');
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
globalHandleError(err, vm, info);
|
||
}
|
||
finally {
|
||
popTarget();
|
||
}
|
||
}
|
||
function invokeWithErrorHandling(handler, context, args, vm, info) {
|
||
var res;
|
||
try {
|
||
res = args ? handler.apply(context, args) : handler.call(context);
|
||
if (res && !res._isVue && isPromise(res) && !res._handled) {
|
||
res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
|
||
res._handled = true;
|
||
}
|
||
}
|
||
catch (e) {
|
||
handleError(e, vm, info);
|
||
}
|
||
return res;
|
||
}
|
||
function globalHandleError(err, vm, info) {
|
||
if (config.errorHandler) {
|
||
try {
|
||
return config.errorHandler.call(null, err, vm, info);
|
||
}
|
||
catch (e) {
|
||
// if the user intentionally throws the original error in the handler,
|
||
// do not log it twice
|
||
if (e !== err) {
|
||
logError(e, null, 'config.errorHandler');
|
||
}
|
||
}
|
||
}
|
||
logError(err, vm, info);
|
||
}
|
||
function logError(err, vm, info) {
|
||
if (true) {
|
||
warn("Error in ".concat(info, ": \"").concat(err.toString(), "\""), vm);
|
||
}
|
||
/* istanbul ignore else */
|
||
if (inBrowser && typeof console !== 'undefined') {
|
||
console.error(err);
|
||
}
|
||
else {
|
||
throw err;
|
||
}
|
||
}
|
||
|
||
/* globals MutationObserver */
|
||
var isUsingMicroTask = false;
|
||
var callbacks = [];
|
||
var pending = false;
|
||
function flushCallbacks() {
|
||
pending = false;
|
||
var copies = callbacks.slice(0);
|
||
callbacks.length = 0;
|
||
for (var i = 0; i < copies.length; i++) {
|
||
copies[i]();
|
||
}
|
||
}
|
||
// Here we have async deferring wrappers using microtasks.
|
||
// In 2.5 we used (macro) tasks (in combination with microtasks).
|
||
// However, it has subtle problems when state is changed right before repaint
|
||
// (e.g. #6813, out-in transitions).
|
||
// Also, using (macro) tasks in event handler would cause some weird behaviors
|
||
// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
|
||
// So we now use microtasks everywhere, again.
|
||
// A major drawback of this tradeoff is that there are some scenarios
|
||
// where microtasks have too high a priority and fire in between supposedly
|
||
// sequential events (e.g. #4521, #6690, which have workarounds)
|
||
// or even between bubbling of the same event (#6566).
|
||
var timerFunc;
|
||
// The nextTick behavior leverages the microtask queue, which can be accessed
|
||
// via either native Promise.then or MutationObserver.
|
||
// MutationObserver has wider support, however it is seriously bugged in
|
||
// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
|
||
// completely stops working after triggering a few times... so, if native
|
||
// Promise is available, we will use it:
|
||
/* istanbul ignore next, $flow-disable-line */
|
||
if (typeof Promise !== 'undefined' && isNative(Promise)) {
|
||
var p_1 = Promise.resolve();
|
||
timerFunc = function () {
|
||
p_1.then(flushCallbacks);
|
||
// In problematic UIWebViews, Promise.then doesn't completely break, but
|
||
// it can get stuck in a weird state where callbacks are pushed into the
|
||
// microtask queue but the queue isn't being flushed, until the browser
|
||
// needs to do some other work, e.g. handle a timer. Therefore we can
|
||
// "force" the microtask queue to be flushed by adding an empty timer.
|
||
if (isIOS)
|
||
setTimeout(noop);
|
||
};
|
||
isUsingMicroTask = true;
|
||
}
|
||
else if (!isIE &&
|
||
typeof MutationObserver !== 'undefined' &&
|
||
(isNative(MutationObserver) ||
|
||
// PhantomJS and iOS 7.x
|
||
MutationObserver.toString() === '[object MutationObserverConstructor]')) {
|
||
// Use MutationObserver where native Promise is not available,
|
||
// e.g. PhantomJS, iOS7, Android 4.4
|
||
// (#6466 MutationObserver is unreliable in IE11)
|
||
var counter_1 = 1;
|
||
var observer = new MutationObserver(flushCallbacks);
|
||
var textNode_1 = document.createTextNode(String(counter_1));
|
||
observer.observe(textNode_1, {
|
||
characterData: true
|
||
});
|
||
timerFunc = function () {
|
||
counter_1 = (counter_1 + 1) % 2;
|
||
textNode_1.data = String(counter_1);
|
||
};
|
||
isUsingMicroTask = true;
|
||
}
|
||
else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
|
||
// Fallback to setImmediate.
|
||
// Technically it leverages the (macro) task queue,
|
||
// but it is still a better choice than setTimeout.
|
||
timerFunc = function () {
|
||
setImmediate(flushCallbacks);
|
||
};
|
||
}
|
||
else {
|
||
// Fallback to setTimeout.
|
||
timerFunc = function () {
|
||
setTimeout(flushCallbacks, 0);
|
||
};
|
||
}
|
||
/**
|
||
* @internal
|
||
*/
|
||
function nextTick(cb, ctx) {
|
||
var _resolve;
|
||
callbacks.push(function () {
|
||
if (cb) {
|
||
try {
|
||
cb.call(ctx);
|
||
}
|
||
catch (e) {
|
||
handleError(e, ctx, 'nextTick');
|
||
}
|
||
}
|
||
else if (_resolve) {
|
||
_resolve(ctx);
|
||
}
|
||
});
|
||
if (!pending) {
|
||
pending = true;
|
||
timerFunc();
|
||
}
|
||
// $flow-disable-line
|
||
if (!cb && typeof Promise !== 'undefined') {
|
||
return new Promise(function (resolve) {
|
||
_resolve = resolve;
|
||
});
|
||
}
|
||
}
|
||
|
||
function useCssModule(name) {
|
||
if (name === void 0) { name = '$style'; }
|
||
/* istanbul ignore else */
|
||
{
|
||
if (!currentInstance) {
|
||
true && warn("useCssModule must be called inside setup()");
|
||
return emptyObject;
|
||
}
|
||
var mod = currentInstance[name];
|
||
if (!mod) {
|
||
true &&
|
||
warn("Current instance does not have CSS module named \"".concat(name, "\"."));
|
||
return emptyObject;
|
||
}
|
||
return mod;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Runtime helper for SFC's CSS variable injection feature.
|
||
* @private
|
||
*/
|
||
function useCssVars(getter) {
|
||
if (!inBrowser && !false)
|
||
return;
|
||
var instance = currentInstance;
|
||
if (!instance) {
|
||
true &&
|
||
warn("useCssVars is called without current active component instance.");
|
||
return;
|
||
}
|
||
watchPostEffect(function () {
|
||
var el = instance.$el;
|
||
var vars = getter(instance, instance._setupProxy);
|
||
if (el && el.nodeType === 1) {
|
||
var style = el.style;
|
||
for (var key in vars) {
|
||
style.setProperty("--".concat(key), vars[key]);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
/**
|
||
* v3-compatible async component API.
|
||
* @internal the type is manually declared in <root>/types/v3-define-async-component.d.ts
|
||
* because it relies on existing manual types
|
||
*/
|
||
function defineAsyncComponent(source) {
|
||
if (isFunction(source)) {
|
||
source = { loader: source };
|
||
}
|
||
var loader = source.loader, loadingComponent = source.loadingComponent, errorComponent = source.errorComponent, _a = source.delay, delay = _a === void 0 ? 200 : _a, timeout = source.timeout, // undefined = never times out
|
||
_b = source.suspensible, // undefined = never times out
|
||
suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true
|
||
userOnError = source.onError;
|
||
if ( true && suspensible) {
|
||
warn("The suspensible option for async components is not supported in Vue2. It is ignored.");
|
||
}
|
||
var pendingRequest = null;
|
||
var retries = 0;
|
||
var retry = function () {
|
||
retries++;
|
||
pendingRequest = null;
|
||
return load();
|
||
};
|
||
var load = function () {
|
||
var thisRequest;
|
||
return (pendingRequest ||
|
||
(thisRequest = pendingRequest =
|
||
loader()
|
||
.catch(function (err) {
|
||
err = err instanceof Error ? err : new Error(String(err));
|
||
if (userOnError) {
|
||
return new Promise(function (resolve, reject) {
|
||
var userRetry = function () { return resolve(retry()); };
|
||
var userFail = function () { return reject(err); };
|
||
userOnError(err, userRetry, userFail, retries + 1);
|
||
});
|
||
}
|
||
else {
|
||
throw err;
|
||
}
|
||
})
|
||
.then(function (comp) {
|
||
if (thisRequest !== pendingRequest && pendingRequest) {
|
||
return pendingRequest;
|
||
}
|
||
if ( true && !comp) {
|
||
warn("Async component loader resolved to undefined. " +
|
||
"If you are using retry(), make sure to return its return value.");
|
||
}
|
||
// interop module default
|
||
if (comp &&
|
||
(comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {
|
||
comp = comp.default;
|
||
}
|
||
if ( true && comp && !isObject(comp) && !isFunction(comp)) {
|
||
throw new Error("Invalid async component load result: ".concat(comp));
|
||
}
|
||
return comp;
|
||
})));
|
||
};
|
||
return function () {
|
||
var component = load();
|
||
return {
|
||
component: component,
|
||
delay: delay,
|
||
timeout: timeout,
|
||
error: errorComponent,
|
||
loading: loadingComponent
|
||
};
|
||
};
|
||
}
|
||
|
||
function createLifeCycle(hookName) {
|
||
return function (fn, target) {
|
||
if (target === void 0) { target = currentInstance; }
|
||
if (!target) {
|
||
true &&
|
||
warn("".concat(formatName(hookName), " is called when there is no active component instance to be ") +
|
||
"associated with. " +
|
||
"Lifecycle injection APIs can only be used during execution of setup().");
|
||
return;
|
||
}
|
||
return injectHook(target, hookName, fn);
|
||
};
|
||
}
|
||
function formatName(name) {
|
||
if (name === 'beforeDestroy') {
|
||
name = 'beforeUnmount';
|
||
}
|
||
else if (name === 'destroyed') {
|
||
name = 'unmounted';
|
||
}
|
||
return "on".concat(name[0].toUpperCase() + name.slice(1));
|
||
}
|
||
function injectHook(instance, hookName, fn) {
|
||
var options = instance.$options;
|
||
options[hookName] = mergeLifecycleHook(options[hookName], fn);
|
||
}
|
||
var onBeforeMount = createLifeCycle('beforeMount');
|
||
var onMounted = createLifeCycle('mounted');
|
||
var onBeforeUpdate = createLifeCycle('beforeUpdate');
|
||
var onUpdated = createLifeCycle('updated');
|
||
var onBeforeUnmount = createLifeCycle('beforeDestroy');
|
||
var onUnmounted = createLifeCycle('destroyed');
|
||
var onActivated = createLifeCycle('activated');
|
||
var onDeactivated = createLifeCycle('deactivated');
|
||
var onServerPrefetch = createLifeCycle('serverPrefetch');
|
||
var onRenderTracked = createLifeCycle('renderTracked');
|
||
var onRenderTriggered = createLifeCycle('renderTriggered');
|
||
var injectErrorCapturedHook = createLifeCycle('errorCaptured');
|
||
function onErrorCaptured(hook, target) {
|
||
if (target === void 0) { target = currentInstance; }
|
||
injectErrorCapturedHook(hook, target);
|
||
}
|
||
|
||
/**
|
||
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
|
||
*/
|
||
var version = '2.7.16';
|
||
/**
|
||
* @internal type is manually declared in <root>/types/v3-define-component.d.ts
|
||
*/
|
||
function defineComponent(options) {
|
||
return options;
|
||
}
|
||
|
||
var seenObjects = new _Set();
|
||
/**
|
||
* Recursively traverse an object to evoke all converted
|
||
* getters, so that every nested property inside the object
|
||
* is collected as a "deep" dependency.
|
||
*/
|
||
function traverse(val) {
|
||
_traverse(val, seenObjects);
|
||
seenObjects.clear();
|
||
return val;
|
||
}
|
||
function _traverse(val, seen) {
|
||
var i, keys;
|
||
var isA = isArray(val);
|
||
if ((!isA && !isObject(val)) ||
|
||
val.__v_skip /* ReactiveFlags.SKIP */ ||
|
||
Object.isFrozen(val) ||
|
||
val instanceof VNode) {
|
||
return;
|
||
}
|
||
if (val.__ob__) {
|
||
var depId = val.__ob__.dep.id;
|
||
if (seen.has(depId)) {
|
||
return;
|
||
}
|
||
seen.add(depId);
|
||
}
|
||
if (isA) {
|
||
i = val.length;
|
||
while (i--)
|
||
_traverse(val[i], seen);
|
||
}
|
||
else if (isRef(val)) {
|
||
_traverse(val.value, seen);
|
||
}
|
||
else {
|
||
keys = Object.keys(val);
|
||
i = keys.length;
|
||
while (i--)
|
||
_traverse(val[keys[i]], seen);
|
||
}
|
||
}
|
||
|
||
var uid$1 = 0;
|
||
/**
|
||
* A watcher parses an expression, collects dependencies,
|
||
* and fires callback when the expression value changes.
|
||
* This is used for both the $watch() api and directives.
|
||
* @internal
|
||
*/
|
||
var Watcher = /** @class */ (function () {
|
||
function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
|
||
recordEffectScope(this,
|
||
// if the active effect scope is manually created (not a component scope),
|
||
// prioritize it
|
||
activeEffectScope && !activeEffectScope._vm
|
||
? activeEffectScope
|
||
: vm
|
||
? vm._scope
|
||
: undefined);
|
||
if ((this.vm = vm) && isRenderWatcher) {
|
||
vm._watcher = this;
|
||
}
|
||
// options
|
||
if (options) {
|
||
this.deep = !!options.deep;
|
||
this.user = !!options.user;
|
||
this.lazy = !!options.lazy;
|
||
this.sync = !!options.sync;
|
||
this.before = options.before;
|
||
if (true) {
|
||
this.onTrack = options.onTrack;
|
||
this.onTrigger = options.onTrigger;
|
||
}
|
||
}
|
||
else {
|
||
this.deep = this.user = this.lazy = this.sync = false;
|
||
}
|
||
this.cb = cb;
|
||
this.id = ++uid$1; // uid for batching
|
||
this.active = true;
|
||
this.post = false;
|
||
this.dirty = this.lazy; // for lazy watchers
|
||
this.deps = [];
|
||
this.newDeps = [];
|
||
this.depIds = new _Set();
|
||
this.newDepIds = new _Set();
|
||
this.expression = true ? expOrFn.toString() : 0;
|
||
// parse expression for getter
|
||
if (isFunction(expOrFn)) {
|
||
this.getter = expOrFn;
|
||
}
|
||
else {
|
||
this.getter = parsePath(expOrFn);
|
||
if (!this.getter) {
|
||
this.getter = noop;
|
||
true &&
|
||
warn("Failed watching path: \"".concat(expOrFn, "\" ") +
|
||
'Watcher only accepts simple dot-delimited paths. ' +
|
||
'For full control, use a function instead.', vm);
|
||
}
|
||
}
|
||
this.value = this.lazy ? undefined : this.get();
|
||
}
|
||
/**
|
||
* Evaluate the getter, and re-collect dependencies.
|
||
*/
|
||
Watcher.prototype.get = function () {
|
||
pushTarget(this);
|
||
var value;
|
||
var vm = this.vm;
|
||
try {
|
||
value = this.getter.call(vm, vm);
|
||
}
|
||
catch (e) {
|
||
if (this.user) {
|
||
handleError(e, vm, "getter for watcher \"".concat(this.expression, "\""));
|
||
}
|
||
else {
|
||
throw e;
|
||
}
|
||
}
|
||
finally {
|
||
// "touch" every property so they are all tracked as
|
||
// dependencies for deep watching
|
||
if (this.deep) {
|
||
traverse(value);
|
||
}
|
||
popTarget();
|
||
this.cleanupDeps();
|
||
}
|
||
return value;
|
||
};
|
||
/**
|
||
* Add a dependency to this directive.
|
||
*/
|
||
Watcher.prototype.addDep = function (dep) {
|
||
var id = dep.id;
|
||
if (!this.newDepIds.has(id)) {
|
||
this.newDepIds.add(id);
|
||
this.newDeps.push(dep);
|
||
if (!this.depIds.has(id)) {
|
||
dep.addSub(this);
|
||
}
|
||
}
|
||
};
|
||
/**
|
||
* Clean up for dependency collection.
|
||
*/
|
||
Watcher.prototype.cleanupDeps = function () {
|
||
var i = this.deps.length;
|
||
while (i--) {
|
||
var dep = this.deps[i];
|
||
if (!this.newDepIds.has(dep.id)) {
|
||
dep.removeSub(this);
|
||
}
|
||
}
|
||
var tmp = this.depIds;
|
||
this.depIds = this.newDepIds;
|
||
this.newDepIds = tmp;
|
||
this.newDepIds.clear();
|
||
tmp = this.deps;
|
||
this.deps = this.newDeps;
|
||
this.newDeps = tmp;
|
||
this.newDeps.length = 0;
|
||
};
|
||
/**
|
||
* Subscriber interface.
|
||
* Will be called when a dependency changes.
|
||
*/
|
||
Watcher.prototype.update = function () {
|
||
/* istanbul ignore else */
|
||
if (this.lazy) {
|
||
this.dirty = true;
|
||
}
|
||
else if (this.sync) {
|
||
this.run();
|
||
}
|
||
else {
|
||
queueWatcher(this);
|
||
}
|
||
};
|
||
/**
|
||
* Scheduler job interface.
|
||
* Will be called by the scheduler.
|
||
*/
|
||
Watcher.prototype.run = function () {
|
||
if (this.active) {
|
||
var value = this.get();
|
||
if (value !== this.value ||
|
||
// Deep watchers and watchers on Object/Arrays should fire even
|
||
// when the value is the same, because the value may
|
||
// have mutated.
|
||
isObject(value) ||
|
||
this.deep) {
|
||
// set new value
|
||
var oldValue = this.value;
|
||
this.value = value;
|
||
if (this.user) {
|
||
var info = "callback for watcher \"".concat(this.expression, "\"");
|
||
invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
|
||
}
|
||
else {
|
||
this.cb.call(this.vm, value, oldValue);
|
||
}
|
||
}
|
||
}
|
||
};
|
||
/**
|
||
* Evaluate the value of the watcher.
|
||
* This only gets called for lazy watchers.
|
||
*/
|
||
Watcher.prototype.evaluate = function () {
|
||
this.value = this.get();
|
||
this.dirty = false;
|
||
};
|
||
/**
|
||
* Depend on all deps collected by this watcher.
|
||
*/
|
||
Watcher.prototype.depend = function () {
|
||
var i = this.deps.length;
|
||
while (i--) {
|
||
this.deps[i].depend();
|
||
}
|
||
};
|
||
/**
|
||
* Remove self from all dependencies' subscriber list.
|
||
*/
|
||
Watcher.prototype.teardown = function () {
|
||
if (this.vm && !this.vm._isBeingDestroyed) {
|
||
remove$2(this.vm._scope.effects, this);
|
||
}
|
||
if (this.active) {
|
||
var i = this.deps.length;
|
||
while (i--) {
|
||
this.deps[i].removeSub(this);
|
||
}
|
||
this.active = false;
|
||
if (this.onStop) {
|
||
this.onStop();
|
||
}
|
||
}
|
||
};
|
||
return Watcher;
|
||
}());
|
||
|
||
var mark;
|
||
var measure;
|
||
if (true) {
|
||
var perf_1 = inBrowser && window.performance;
|
||
/* istanbul ignore if */
|
||
if (perf_1 &&
|
||
// @ts-ignore
|
||
perf_1.mark &&
|
||
// @ts-ignore
|
||
perf_1.measure &&
|
||
// @ts-ignore
|
||
perf_1.clearMarks &&
|
||
// @ts-ignore
|
||
perf_1.clearMeasures) {
|
||
mark = function (tag) { return perf_1.mark(tag); };
|
||
measure = function (name, startTag, endTag) {
|
||
perf_1.measure(name, startTag, endTag);
|
||
perf_1.clearMarks(startTag);
|
||
perf_1.clearMarks(endTag);
|
||
// perf.clearMeasures(name)
|
||
};
|
||
}
|
||
}
|
||
|
||
function initEvents(vm) {
|
||
vm._events = Object.create(null);
|
||
vm._hasHookEvent = false;
|
||
// init parent attached events
|
||
var listeners = vm.$options._parentListeners;
|
||
if (listeners) {
|
||
updateComponentListeners(vm, listeners);
|
||
}
|
||
}
|
||
var target$1;
|
||
function add$1(event, fn) {
|
||
target$1.$on(event, fn);
|
||
}
|
||
function remove$1(event, fn) {
|
||
target$1.$off(event, fn);
|
||
}
|
||
function createOnceHandler$1(event, fn) {
|
||
var _target = target$1;
|
||
return function onceHandler() {
|
||
var res = fn.apply(null, arguments);
|
||
if (res !== null) {
|
||
_target.$off(event, onceHandler);
|
||
}
|
||
};
|
||
}
|
||
function updateComponentListeners(vm, listeners, oldListeners) {
|
||
target$1 = vm;
|
||
updateListeners(listeners, oldListeners || {}, add$1, remove$1, createOnceHandler$1, vm);
|
||
target$1 = undefined;
|
||
}
|
||
function eventsMixin(Vue) {
|
||
var hookRE = /^hook:/;
|
||
Vue.prototype.$on = function (event, fn) {
|
||
var vm = this;
|
||
if (isArray(event)) {
|
||
for (var i = 0, l = event.length; i < l; i++) {
|
||
vm.$on(event[i], fn);
|
||
}
|
||
}
|
||
else {
|
||
(vm._events[event] || (vm._events[event] = [])).push(fn);
|
||
// optimize hook:event cost by using a boolean flag marked at registration
|
||
// instead of a hash lookup
|
||
if (hookRE.test(event)) {
|
||
vm._hasHookEvent = true;
|
||
}
|
||
}
|
||
return vm;
|
||
};
|
||
Vue.prototype.$once = function (event, fn) {
|
||
var vm = this;
|
||
function on() {
|
||
vm.$off(event, on);
|
||
fn.apply(vm, arguments);
|
||
}
|
||
on.fn = fn;
|
||
vm.$on(event, on);
|
||
return vm;
|
||
};
|
||
Vue.prototype.$off = function (event, fn) {
|
||
var vm = this;
|
||
// all
|
||
if (!arguments.length) {
|
||
vm._events = Object.create(null);
|
||
return vm;
|
||
}
|
||
// array of events
|
||
if (isArray(event)) {
|
||
for (var i_1 = 0, l = event.length; i_1 < l; i_1++) {
|
||
vm.$off(event[i_1], fn);
|
||
}
|
||
return vm;
|
||
}
|
||
// specific event
|
||
var cbs = vm._events[event];
|
||
if (!cbs) {
|
||
return vm;
|
||
}
|
||
if (!fn) {
|
||
vm._events[event] = null;
|
||
return vm;
|
||
}
|
||
// specific handler
|
||
var cb;
|
||
var i = cbs.length;
|
||
while (i--) {
|
||
cb = cbs[i];
|
||
if (cb === fn || cb.fn === fn) {
|
||
cbs.splice(i, 1);
|
||
break;
|
||
}
|
||
}
|
||
return vm;
|
||
};
|
||
Vue.prototype.$emit = function (event) {
|
||
var vm = this;
|
||
if (true) {
|
||
var lowerCaseEvent = event.toLowerCase();
|
||
if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
|
||
tip("Event \"".concat(lowerCaseEvent, "\" is emitted in component ") +
|
||
"".concat(formatComponentName(vm), " but the handler is registered for \"").concat(event, "\". ") +
|
||
"Note that HTML attributes are case-insensitive and you cannot use " +
|
||
"v-on to listen to camelCase events when using in-DOM templates. " +
|
||
"You should probably use \"".concat(hyphenate(event), "\" instead of \"").concat(event, "\"."));
|
||
}
|
||
}
|
||
var cbs = vm._events[event];
|
||
if (cbs) {
|
||
cbs = cbs.length > 1 ? toArray(cbs) : cbs;
|
||
var args = toArray(arguments, 1);
|
||
var info = "event handler for \"".concat(event, "\"");
|
||
for (var i = 0, l = cbs.length; i < l; i++) {
|
||
invokeWithErrorHandling(cbs[i], vm, args, vm, info);
|
||
}
|
||
}
|
||
return vm;
|
||
};
|
||
}
|
||
|
||
var activeInstance = null;
|
||
var isUpdatingChildComponent = false;
|
||
function setActiveInstance(vm) {
|
||
var prevActiveInstance = activeInstance;
|
||
activeInstance = vm;
|
||
return function () {
|
||
activeInstance = prevActiveInstance;
|
||
};
|
||
}
|
||
function initLifecycle(vm) {
|
||
var options = vm.$options;
|
||
// locate first non-abstract parent
|
||
var parent = options.parent;
|
||
if (parent && !options.abstract) {
|
||
while (parent.$options.abstract && parent.$parent) {
|
||
parent = parent.$parent;
|
||
}
|
||
parent.$children.push(vm);
|
||
}
|
||
vm.$parent = parent;
|
||
vm.$root = parent ? parent.$root : vm;
|
||
vm.$children = [];
|
||
vm.$refs = {};
|
||
vm._provided = parent ? parent._provided : Object.create(null);
|
||
vm._watcher = null;
|
||
vm._inactive = null;
|
||
vm._directInactive = false;
|
||
vm._isMounted = false;
|
||
vm._isDestroyed = false;
|
||
vm._isBeingDestroyed = false;
|
||
}
|
||
function lifecycleMixin(Vue) {
|
||
Vue.prototype._update = function (vnode, hydrating) {
|
||
var vm = this;
|
||
var prevEl = vm.$el;
|
||
var prevVnode = vm._vnode;
|
||
var restoreActiveInstance = setActiveInstance(vm);
|
||
vm._vnode = vnode;
|
||
// Vue.prototype.__patch__ is injected in entry points
|
||
// based on the rendering backend used.
|
||
if (!prevVnode) {
|
||
// initial render
|
||
vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
|
||
}
|
||
else {
|
||
// updates
|
||
vm.$el = vm.__patch__(prevVnode, vnode);
|
||
}
|
||
restoreActiveInstance();
|
||
// update __vue__ reference
|
||
if (prevEl) {
|
||
prevEl.__vue__ = null;
|
||
}
|
||
if (vm.$el) {
|
||
vm.$el.__vue__ = vm;
|
||
}
|
||
// if parent is an HOC, update its $el as well
|
||
var wrapper = vm;
|
||
while (wrapper &&
|
||
wrapper.$vnode &&
|
||
wrapper.$parent &&
|
||
wrapper.$vnode === wrapper.$parent._vnode) {
|
||
wrapper.$parent.$el = wrapper.$el;
|
||
wrapper = wrapper.$parent;
|
||
}
|
||
// updated hook is called by the scheduler to ensure that children are
|
||
// updated in a parent's updated hook.
|
||
};
|
||
Vue.prototype.$forceUpdate = function () {
|
||
var vm = this;
|
||
if (vm._watcher) {
|
||
vm._watcher.update();
|
||
}
|
||
};
|
||
Vue.prototype.$destroy = function () {
|
||
var vm = this;
|
||
if (vm._isBeingDestroyed) {
|
||
return;
|
||
}
|
||
callHook$1(vm, 'beforeDestroy');
|
||
vm._isBeingDestroyed = true;
|
||
// remove self from parent
|
||
var parent = vm.$parent;
|
||
if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
|
||
remove$2(parent.$children, vm);
|
||
}
|
||
// teardown scope. this includes both the render watcher and other
|
||
// watchers created
|
||
vm._scope.stop();
|
||
// remove reference from data ob
|
||
// frozen object may not have observer.
|
||
if (vm._data.__ob__) {
|
||
vm._data.__ob__.vmCount--;
|
||
}
|
||
// call the last hook...
|
||
vm._isDestroyed = true;
|
||
// invoke destroy hooks on current rendered tree
|
||
vm.__patch__(vm._vnode, null);
|
||
// fire destroyed hook
|
||
callHook$1(vm, 'destroyed');
|
||
// turn off all instance listeners.
|
||
vm.$off();
|
||
// remove __vue__ reference
|
||
if (vm.$el) {
|
||
vm.$el.__vue__ = null;
|
||
}
|
||
// release circular reference (#6759)
|
||
if (vm.$vnode) {
|
||
vm.$vnode.parent = null;
|
||
}
|
||
};
|
||
}
|
||
function mountComponent(vm, el, hydrating) {
|
||
vm.$el = el;
|
||
if (!vm.$options.render) {
|
||
// @ts-expect-error invalid type
|
||
vm.$options.render = createEmptyVNode;
|
||
if (true) {
|
||
/* istanbul ignore if */
|
||
if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
|
||
vm.$options.el ||
|
||
el) {
|
||
warn('You are using the runtime-only build of Vue where the template ' +
|
||
'compiler is not available. Either pre-compile the templates into ' +
|
||
'render functions, or use the compiler-included build.', vm);
|
||
}
|
||
else {
|
||
warn('Failed to mount component: template or render function not defined.', vm);
|
||
}
|
||
}
|
||
}
|
||
callHook$1(vm, 'beforeMount');
|
||
var updateComponent;
|
||
/* istanbul ignore if */
|
||
if ( true && config.performance && mark) {
|
||
updateComponent = function () {
|
||
var name = vm._name;
|
||
var id = vm._uid;
|
||
var startTag = "vue-perf-start:".concat(id);
|
||
var endTag = "vue-perf-end:".concat(id);
|
||
mark(startTag);
|
||
var vnode = vm._render();
|
||
mark(endTag);
|
||
measure("vue ".concat(name, " render"), startTag, endTag);
|
||
mark(startTag);
|
||
vm._update(vnode, hydrating);
|
||
mark(endTag);
|
||
measure("vue ".concat(name, " patch"), startTag, endTag);
|
||
};
|
||
}
|
||
else {
|
||
updateComponent = function () {
|
||
vm._update(vm._render(), hydrating);
|
||
};
|
||
}
|
||
var watcherOptions = {
|
||
before: function () {
|
||
if (vm._isMounted && !vm._isDestroyed) {
|
||
callHook$1(vm, 'beforeUpdate');
|
||
}
|
||
}
|
||
};
|
||
if (true) {
|
||
watcherOptions.onTrack = function (e) { return callHook$1(vm, 'renderTracked', [e]); };
|
||
watcherOptions.onTrigger = function (e) { return callHook$1(vm, 'renderTriggered', [e]); };
|
||
}
|
||
// we set this to vm._watcher inside the watcher's constructor
|
||
// since the watcher's initial patch may call $forceUpdate (e.g. inside child
|
||
// component's mounted hook), which relies on vm._watcher being already defined
|
||
new Watcher(vm, updateComponent, noop, watcherOptions, true /* isRenderWatcher */);
|
||
hydrating = false;
|
||
// flush buffer for flush: "pre" watchers queued in setup()
|
||
var preWatchers = vm._preWatchers;
|
||
if (preWatchers) {
|
||
for (var i = 0; i < preWatchers.length; i++) {
|
||
preWatchers[i].run();
|
||
}
|
||
}
|
||
// manually mounted instance, call mounted on self
|
||
// mounted is called for render-created child components in its inserted hook
|
||
if (vm.$vnode == null) {
|
||
vm._isMounted = true;
|
||
callHook$1(vm, 'mounted');
|
||
}
|
||
return vm;
|
||
}
|
||
function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
|
||
if (true) {
|
||
isUpdatingChildComponent = true;
|
||
}
|
||
// determine whether component has slot children
|
||
// we need to do this before overwriting $options._renderChildren.
|
||
// check if there are dynamic scopedSlots (hand-written or compiled but with
|
||
// dynamic slot names). Static scoped slots compiled from template has the
|
||
// "$stable" marker.
|
||
var newScopedSlots = parentVnode.data.scopedSlots;
|
||
var oldScopedSlots = vm.$scopedSlots;
|
||
var hasDynamicScopedSlot = !!((newScopedSlots && !newScopedSlots.$stable) ||
|
||
(oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
|
||
(newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
|
||
(!newScopedSlots && vm.$scopedSlots.$key));
|
||
// Any static slot children from the parent may have changed during parent's
|
||
// update. Dynamic scoped slots may also have changed. In such cases, a forced
|
||
// update is necessary to ensure correctness.
|
||
var needsForceUpdate = !!(renderChildren || // has new static slots
|
||
vm.$options._renderChildren || // has old static slots
|
||
hasDynamicScopedSlot);
|
||
var prevVNode = vm.$vnode;
|
||
vm.$options._parentVnode = parentVnode;
|
||
vm.$vnode = parentVnode; // update vm's placeholder node without re-render
|
||
if (vm._vnode) {
|
||
// update child tree's parent
|
||
vm._vnode.parent = parentVnode;
|
||
}
|
||
vm.$options._renderChildren = renderChildren;
|
||
// update $attrs and $listeners hash
|
||
// these are also reactive so they may trigger child update if the child
|
||
// used them during render
|
||
var attrs = parentVnode.data.attrs || emptyObject;
|
||
if (vm._attrsProxy) {
|
||
// force update if attrs are accessed and has changed since it may be
|
||
// passed to a child component.
|
||
if (syncSetupProxy(vm._attrsProxy, attrs, (prevVNode.data && prevVNode.data.attrs) || emptyObject, vm, '$attrs')) {
|
||
needsForceUpdate = true;
|
||
}
|
||
}
|
||
vm.$attrs = attrs;
|
||
// update listeners
|
||
listeners = listeners || emptyObject;
|
||
var prevListeners = vm.$options._parentListeners;
|
||
if (vm._listenersProxy) {
|
||
syncSetupProxy(vm._listenersProxy, listeners, prevListeners || emptyObject, vm, '$listeners');
|
||
}
|
||
vm.$listeners = vm.$options._parentListeners = listeners;
|
||
updateComponentListeners(vm, listeners, prevListeners);
|
||
// update props
|
||
if (propsData && vm.$options.props) {
|
||
toggleObserving(false);
|
||
var props = vm._props;
|
||
var propKeys = vm.$options._propKeys || [];
|
||
for (var i = 0; i < propKeys.length; i++) {
|
||
var key = propKeys[i];
|
||
var propOptions = vm.$options.props; // wtf flow?
|
||
props[key] = validateProp(key, propOptions, propsData, vm);
|
||
}
|
||
toggleObserving(true);
|
||
// keep a copy of raw propsData
|
||
vm.$options.propsData = propsData;
|
||
}
|
||
// resolve slots + force update if has children
|
||
if (needsForceUpdate) {
|
||
vm.$slots = resolveSlots(renderChildren, parentVnode.context);
|
||
vm.$forceUpdate();
|
||
}
|
||
if (true) {
|
||
isUpdatingChildComponent = false;
|
||
}
|
||
}
|
||
function isInInactiveTree(vm) {
|
||
while (vm && (vm = vm.$parent)) {
|
||
if (vm._inactive)
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|
||
function activateChildComponent(vm, direct) {
|
||
if (direct) {
|
||
vm._directInactive = false;
|
||
if (isInInactiveTree(vm)) {
|
||
return;
|
||
}
|
||
}
|
||
else if (vm._directInactive) {
|
||
return;
|
||
}
|
||
if (vm._inactive || vm._inactive === null) {
|
||
vm._inactive = false;
|
||
for (var i = 0; i < vm.$children.length; i++) {
|
||
activateChildComponent(vm.$children[i]);
|
||
}
|
||
callHook$1(vm, 'activated');
|
||
}
|
||
}
|
||
function deactivateChildComponent(vm, direct) {
|
||
if (direct) {
|
||
vm._directInactive = true;
|
||
if (isInInactiveTree(vm)) {
|
||
return;
|
||
}
|
||
}
|
||
if (!vm._inactive) {
|
||
vm._inactive = true;
|
||
for (var i = 0; i < vm.$children.length; i++) {
|
||
deactivateChildComponent(vm.$children[i]);
|
||
}
|
||
callHook$1(vm, 'deactivated');
|
||
}
|
||
}
|
||
function callHook$1(vm, hook, args, setContext) {
|
||
if (setContext === void 0) { setContext = true; }
|
||
// #7573 disable dep collection when invoking lifecycle hooks
|
||
pushTarget();
|
||
var prevInst = currentInstance;
|
||
var prevScope = getCurrentScope();
|
||
setContext && setCurrentInstance(vm);
|
||
var handlers = vm.$options[hook];
|
||
var info = "".concat(hook, " hook");
|
||
if (handlers) {
|
||
for (var i = 0, j = handlers.length; i < j; i++) {
|
||
invokeWithErrorHandling(handlers[i], vm, args || null, vm, info);
|
||
}
|
||
}
|
||
if (vm._hasHookEvent) {
|
||
vm.$emit('hook:' + hook);
|
||
}
|
||
if (setContext) {
|
||
setCurrentInstance(prevInst);
|
||
prevScope && prevScope.on();
|
||
}
|
||
popTarget();
|
||
}
|
||
|
||
var MAX_UPDATE_COUNT = 100;
|
||
var queue = [];
|
||
var activatedChildren = [];
|
||
var has = {};
|
||
var circular = {};
|
||
var waiting = false;
|
||
var flushing = false;
|
||
var index = 0;
|
||
/**
|
||
* Reset the scheduler's state.
|
||
*/
|
||
function resetSchedulerState() {
|
||
index = queue.length = activatedChildren.length = 0;
|
||
has = {};
|
||
if (true) {
|
||
circular = {};
|
||
}
|
||
waiting = flushing = false;
|
||
}
|
||
// Async edge case #6566 requires saving the timestamp when event listeners are
|
||
// attached. However, calling performance.now() has a perf overhead especially
|
||
// if the page has thousands of event listeners. Instead, we take a timestamp
|
||
// every time the scheduler flushes and use that for all event listeners
|
||
// attached during that flush.
|
||
var currentFlushTimestamp = 0;
|
||
// Async edge case fix requires storing an event listener's attach timestamp.
|
||
var getNow = Date.now;
|
||
// Determine what event timestamp the browser is using. Annoyingly, the
|
||
// timestamp can either be hi-res (relative to page load) or low-res
|
||
// (relative to UNIX epoch), so in order to compare time we have to use the
|
||
// same timestamp type when saving the flush timestamp.
|
||
// All IE versions use low-res event timestamps, and have problematic clock
|
||
// implementations (#9632)
|
||
if (inBrowser && !isIE) {
|
||
var performance_1 = window.performance;
|
||
if (performance_1 &&
|
||
typeof performance_1.now === 'function' &&
|
||
getNow() > document.createEvent('Event').timeStamp) {
|
||
// if the event timestamp, although evaluated AFTER the Date.now(), is
|
||
// smaller than it, it means the event is using a hi-res timestamp,
|
||
// and we need to use the hi-res version for event listener timestamps as
|
||
// well.
|
||
getNow = function () { return performance_1.now(); };
|
||
}
|
||
}
|
||
var sortCompareFn = function (a, b) {
|
||
if (a.post) {
|
||
if (!b.post)
|
||
return 1;
|
||
}
|
||
else if (b.post) {
|
||
return -1;
|
||
}
|
||
return a.id - b.id;
|
||
};
|
||
/**
|
||
* Flush both queues and run the watchers.
|
||
*/
|
||
function flushSchedulerQueue() {
|
||
currentFlushTimestamp = getNow();
|
||
flushing = true;
|
||
var watcher, id;
|
||
// Sort queue before flush.
|
||
// This ensures that:
|
||
// 1. Components are updated from parent to child. (because parent is always
|
||
// created before the child)
|
||
// 2. A component's user watchers are run before its render watcher (because
|
||
// user watchers are created before the render watcher)
|
||
// 3. If a component is destroyed during a parent component's watcher run,
|
||
// its watchers can be skipped.
|
||
queue.sort(sortCompareFn);
|
||
// do not cache length because more watchers might be pushed
|
||
// as we run existing watchers
|
||
for (index = 0; index < queue.length; index++) {
|
||
watcher = queue[index];
|
||
if (watcher.before) {
|
||
watcher.before();
|
||
}
|
||
id = watcher.id;
|
||
has[id] = null;
|
||
watcher.run();
|
||
// in dev build, check and stop circular updates.
|
||
if ( true && has[id] != null) {
|
||
circular[id] = (circular[id] || 0) + 1;
|
||
if (circular[id] > MAX_UPDATE_COUNT) {
|
||
warn('You may have an infinite update loop ' +
|
||
(watcher.user
|
||
? "in watcher with expression \"".concat(watcher.expression, "\"")
|
||
: "in a component render function."), watcher.vm);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
// keep copies of post queues before resetting state
|
||
var activatedQueue = activatedChildren.slice();
|
||
var updatedQueue = queue.slice();
|
||
resetSchedulerState();
|
||
// call component updated and activated hooks
|
||
callActivatedHooks(activatedQueue);
|
||
callUpdatedHooks(updatedQueue);
|
||
cleanupDeps();
|
||
// devtool hook
|
||
/* istanbul ignore if */
|
||
if (devtools && config.devtools) {
|
||
devtools.emit('flush');
|
||
}
|
||
}
|
||
function callUpdatedHooks(queue) {
|
||
var i = queue.length;
|
||
while (i--) {
|
||
var watcher = queue[i];
|
||
var vm = watcher.vm;
|
||
if (vm && vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
|
||
callHook$1(vm, 'updated');
|
||
}
|
||
}
|
||
}
|
||
/**
|
||
* Queue a kept-alive component that was activated during patch.
|
||
* The queue will be processed after the entire tree has been patched.
|
||
*/
|
||
function queueActivatedComponent(vm) {
|
||
// setting _inactive to false here so that a render function can
|
||
// rely on checking whether it's in an inactive tree (e.g. router-view)
|
||
vm._inactive = false;
|
||
activatedChildren.push(vm);
|
||
}
|
||
function callActivatedHooks(queue) {
|
||
for (var i = 0; i < queue.length; i++) {
|
||
queue[i]._inactive = true;
|
||
activateChildComponent(queue[i], true /* true */);
|
||
}
|
||
}
|
||
/**
|
||
* Push a watcher into the watcher queue.
|
||
* Jobs with duplicate IDs will be skipped unless it's
|
||
* pushed when the queue is being flushed.
|
||
*/
|
||
function queueWatcher(watcher) {
|
||
var id = watcher.id;
|
||
if (has[id] != null) {
|
||
return;
|
||
}
|
||
if (watcher === Dep.target && watcher.noRecurse) {
|
||
return;
|
||
}
|
||
has[id] = true;
|
||
if (!flushing) {
|
||
queue.push(watcher);
|
||
}
|
||
else {
|
||
// if already flushing, splice the watcher based on its id
|
||
// if already past its id, it will be run next immediately.
|
||
var i = queue.length - 1;
|
||
while (i > index && queue[i].id > watcher.id) {
|
||
i--;
|
||
}
|
||
queue.splice(i + 1, 0, watcher);
|
||
}
|
||
// queue the flush
|
||
if (!waiting) {
|
||
waiting = true;
|
||
if ( true && !config.async) {
|
||
flushSchedulerQueue();
|
||
return;
|
||
}
|
||
nextTick(flushSchedulerQueue);
|
||
}
|
||
}
|
||
|
||
function initProvide(vm) {
|
||
var provideOption = vm.$options.provide;
|
||
if (provideOption) {
|
||
var provided = isFunction(provideOption)
|
||
? provideOption.call(vm)
|
||
: provideOption;
|
||
if (!isObject(provided)) {
|
||
return;
|
||
}
|
||
var source = resolveProvided(vm);
|
||
// IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
|
||
// iterate the keys ourselves.
|
||
var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
|
||
for (var i = 0; i < keys.length; i++) {
|
||
var key = keys[i];
|
||
Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
|
||
}
|
||
}
|
||
}
|
||
function initInjections(vm) {
|
||
var result = resolveInject(vm.$options.inject, vm);
|
||
if (result) {
|
||
toggleObserving(false);
|
||
Object.keys(result).forEach(function (key) {
|
||
/* istanbul ignore else */
|
||
if (true) {
|
||
defineReactive(vm, key, result[key], function () {
|
||
warn("Avoid mutating an injected value directly since the changes will be " +
|
||
"overwritten whenever the provided component re-renders. " +
|
||
"injection being mutated: \"".concat(key, "\""), vm);
|
||
});
|
||
}
|
||
else {}
|
||
});
|
||
toggleObserving(true);
|
||
}
|
||
}
|
||
function resolveInject(inject, vm) {
|
||
if (inject) {
|
||
// inject is :any because flow is not smart enough to figure out cached
|
||
var result = Object.create(null);
|
||
var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
|
||
for (var i = 0; i < keys.length; i++) {
|
||
var key = keys[i];
|
||
// #6574 in case the inject object is observed...
|
||
if (key === '__ob__')
|
||
continue;
|
||
var provideKey = inject[key].from;
|
||
if (provideKey in vm._provided) {
|
||
result[key] = vm._provided[provideKey];
|
||
}
|
||
else if ('default' in inject[key]) {
|
||
var provideDefault = inject[key].default;
|
||
result[key] = isFunction(provideDefault)
|
||
? provideDefault.call(vm)
|
||
: provideDefault;
|
||
}
|
||
else if (true) {
|
||
warn("Injection \"".concat(key, "\" not found"), vm);
|
||
}
|
||
}
|
||
return result;
|
||
}
|
||
}
|
||
|
||
function FunctionalRenderContext(data, props, children, parent, Ctor) {
|
||
var _this = this;
|
||
var options = Ctor.options;
|
||
// ensure the createElement function in functional components
|
||
// gets a unique context - this is necessary for correct named slot check
|
||
var contextVm;
|
||
if (hasOwn(parent, '_uid')) {
|
||
contextVm = Object.create(parent);
|
||
contextVm._original = parent;
|
||
}
|
||
else {
|
||
// the context vm passed in is a functional context as well.
|
||
// in this case we want to make sure we are able to get a hold to the
|
||
// real context instance.
|
||
contextVm = parent;
|
||
// @ts-ignore
|
||
parent = parent._original;
|
||
}
|
||
var isCompiled = isTrue(options._compiled);
|
||
var needNormalization = !isCompiled;
|
||
this.data = data;
|
||
this.props = props;
|
||
this.children = children;
|
||
this.parent = parent;
|
||
this.listeners = data.on || emptyObject;
|
||
this.injections = resolveInject(options.inject, parent);
|
||
this.slots = function () {
|
||
if (!_this.$slots) {
|
||
normalizeScopedSlots(parent, data.scopedSlots, (_this.$slots = resolveSlots(children, parent)));
|
||
}
|
||
return _this.$slots;
|
||
};
|
||
Object.defineProperty(this, 'scopedSlots', {
|
||
enumerable: true,
|
||
get: function () {
|
||
return normalizeScopedSlots(parent, data.scopedSlots, this.slots());
|
||
}
|
||
});
|
||
// support for compiled functional template
|
||
if (isCompiled) {
|
||
// exposing $options for renderStatic()
|
||
this.$options = options;
|
||
// pre-resolve slots for renderSlot()
|
||
this.$slots = this.slots();
|
||
this.$scopedSlots = normalizeScopedSlots(parent, data.scopedSlots, this.$slots);
|
||
}
|
||
if (options._scopeId) {
|
||
this._c = function (a, b, c, d) {
|
||
var vnode = createElement$1(contextVm, a, b, c, d, needNormalization);
|
||
if (vnode && !isArray(vnode)) {
|
||
vnode.fnScopeId = options._scopeId;
|
||
vnode.fnContext = parent;
|
||
}
|
||
return vnode;
|
||
};
|
||
}
|
||
else {
|
||
this._c = function (a, b, c, d) {
|
||
return createElement$1(contextVm, a, b, c, d, needNormalization);
|
||
};
|
||
}
|
||
}
|
||
installRenderHelpers(FunctionalRenderContext.prototype);
|
||
function createFunctionalComponent(Ctor, propsData, data, contextVm, children) {
|
||
var options = Ctor.options;
|
||
var props = {};
|
||
var propOptions = options.props;
|
||
if (isDef(propOptions)) {
|
||
for (var key in propOptions) {
|
||
props[key] = validateProp(key, propOptions, propsData || emptyObject);
|
||
}
|
||
}
|
||
else {
|
||
if (isDef(data.attrs))
|
||
mergeProps(props, data.attrs);
|
||
if (isDef(data.props))
|
||
mergeProps(props, data.props);
|
||
}
|
||
var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);
|
||
var vnode = options.render.call(null, renderContext._c, renderContext);
|
||
if (vnode instanceof VNode) {
|
||
return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext);
|
||
}
|
||
else if (isArray(vnode)) {
|
||
var vnodes = normalizeChildren(vnode) || [];
|
||
var res = new Array(vnodes.length);
|
||
for (var i = 0; i < vnodes.length; i++) {
|
||
res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
|
||
}
|
||
return res;
|
||
}
|
||
}
|
||
function cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {
|
||
// #7817 clone node before setting fnContext, otherwise if the node is reused
|
||
// (e.g. it was from a cached normal slot) the fnContext causes named slots
|
||
// that should not be matched to match.
|
||
var clone = cloneVNode(vnode);
|
||
clone.fnContext = contextVm;
|
||
clone.fnOptions = options;
|
||
if (true) {
|
||
(clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext =
|
||
renderContext;
|
||
}
|
||
if (data.slot) {
|
||
(clone.data || (clone.data = {})).slot = data.slot;
|
||
}
|
||
return clone;
|
||
}
|
||
function mergeProps(to, from) {
|
||
for (var key in from) {
|
||
to[camelize(key)] = from[key];
|
||
}
|
||
}
|
||
|
||
function getComponentName(options) {
|
||
return options.name || options.__name || options._componentTag;
|
||
}
|
||
// inline hooks to be invoked on component VNodes during patch
|
||
var componentVNodeHooks = {
|
||
init: function (vnode, hydrating) {
|
||
if (vnode.componentInstance &&
|
||
!vnode.componentInstance._isDestroyed &&
|
||
vnode.data.keepAlive) {
|
||
// kept-alive components, treat as a patch
|
||
var mountedNode = vnode; // work around flow
|
||
componentVNodeHooks.prepatch(mountedNode, mountedNode);
|
||
}
|
||
else {
|
||
var child = (vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance));
|
||
child.$mount(hydrating ? vnode.elm : undefined, hydrating);
|
||
}
|
||
},
|
||
prepatch: function (oldVnode, vnode) {
|
||
var options = vnode.componentOptions;
|
||
var child = (vnode.componentInstance = oldVnode.componentInstance);
|
||
updateChildComponent(child, options.propsData, // updated props
|
||
options.listeners, // updated listeners
|
||
vnode, // new parent vnode
|
||
options.children // new children
|
||
);
|
||
},
|
||
insert: function (vnode) {
|
||
var context = vnode.context, componentInstance = vnode.componentInstance;
|
||
if (!componentInstance._isMounted) {
|
||
componentInstance._isMounted = true;
|
||
callHook$1(componentInstance, 'mounted');
|
||
}
|
||
if (vnode.data.keepAlive) {
|
||
if (context._isMounted) {
|
||
// vue-router#1212
|
||
// During updates, a kept-alive component's child components may
|
||
// change, so directly walking the tree here may call activated hooks
|
||
// on incorrect children. Instead we push them into a queue which will
|
||
// be processed after the whole patch process ended.
|
||
queueActivatedComponent(componentInstance);
|
||
}
|
||
else {
|
||
activateChildComponent(componentInstance, true /* direct */);
|
||
}
|
||
}
|
||
},
|
||
destroy: function (vnode) {
|
||
var componentInstance = vnode.componentInstance;
|
||
if (!componentInstance._isDestroyed) {
|
||
if (!vnode.data.keepAlive) {
|
||
componentInstance.$destroy();
|
||
}
|
||
else {
|
||
deactivateChildComponent(componentInstance, true /* direct */);
|
||
}
|
||
}
|
||
}
|
||
};
|
||
var hooksToMerge = Object.keys(componentVNodeHooks);
|
||
function createComponent(Ctor, data, context, children, tag) {
|
||
if (isUndef(Ctor)) {
|
||
return;
|
||
}
|
||
var baseCtor = context.$options._base;
|
||
// plain options object: turn it into a constructor
|
||
if (isObject(Ctor)) {
|
||
Ctor = baseCtor.extend(Ctor);
|
||
}
|
||
// if at this stage it's not a constructor or an async component factory,
|
||
// reject.
|
||
if (typeof Ctor !== 'function') {
|
||
if (true) {
|
||
warn("Invalid Component definition: ".concat(String(Ctor)), context);
|
||
}
|
||
return;
|
||
}
|
||
// async component
|
||
var asyncFactory;
|
||
// @ts-expect-error
|
||
if (isUndef(Ctor.cid)) {
|
||
asyncFactory = Ctor;
|
||
Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
|
||
if (Ctor === undefined) {
|
||
// return a placeholder node for async component, which is rendered
|
||
// as a comment node but preserves all the raw information for the node.
|
||
// the information will be used for async server-rendering and hydration.
|
||
return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
|
||
}
|
||
}
|
||
data = data || {};
|
||
// resolve constructor options in case global mixins are applied after
|
||
// component constructor creation
|
||
resolveConstructorOptions(Ctor);
|
||
// transform component v-model data into props & events
|
||
if (isDef(data.model)) {
|
||
// @ts-expect-error
|
||
transformModel(Ctor.options, data);
|
||
}
|
||
// extract props
|
||
// @ts-expect-error
|
||
var propsData = extractPropsFromVNodeData(data, Ctor, tag);
|
||
// functional component
|
||
// @ts-expect-error
|
||
if (isTrue(Ctor.options.functional)) {
|
||
return createFunctionalComponent(Ctor, propsData, data, context, children);
|
||
}
|
||
// extract listeners, since these needs to be treated as
|
||
// child component listeners instead of DOM listeners
|
||
var listeners = data.on;
|
||
// replace with listeners with .native modifier
|
||
// so it gets processed during parent component patch.
|
||
data.on = data.nativeOn;
|
||
// @ts-expect-error
|
||
if (isTrue(Ctor.options.abstract)) {
|
||
// abstract components do not keep anything
|
||
// other than props & listeners & slot
|
||
// work around flow
|
||
var slot = data.slot;
|
||
data = {};
|
||
if (slot) {
|
||
data.slot = slot;
|
||
}
|
||
}
|
||
// install component management hooks onto the placeholder node
|
||
installComponentHooks(data);
|
||
// return a placeholder vnode
|
||
// @ts-expect-error
|
||
var name = getComponentName(Ctor.options) || tag;
|
||
var vnode = new VNode(
|
||
// @ts-expect-error
|
||
"vue-component-".concat(Ctor.cid).concat(name ? "-".concat(name) : ''), data, undefined, undefined, undefined, context,
|
||
// @ts-expect-error
|
||
{ Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, asyncFactory);
|
||
return vnode;
|
||
}
|
||
function createComponentInstanceForVnode(
|
||
// we know it's MountedComponentVNode but flow doesn't
|
||
vnode,
|
||
// activeInstance in lifecycle state
|
||
parent) {
|
||
var options = {
|
||
_isComponent: true,
|
||
_parentVnode: vnode,
|
||
parent: parent
|
||
};
|
||
// check inline-template render functions
|
||
var inlineTemplate = vnode.data.inlineTemplate;
|
||
if (isDef(inlineTemplate)) {
|
||
options.render = inlineTemplate.render;
|
||
options.staticRenderFns = inlineTemplate.staticRenderFns;
|
||
}
|
||
return new vnode.componentOptions.Ctor(options);
|
||
}
|
||
function installComponentHooks(data) {
|
||
var hooks = data.hook || (data.hook = {});
|
||
for (var i = 0; i < hooksToMerge.length; i++) {
|
||
var key = hooksToMerge[i];
|
||
var existing = hooks[key];
|
||
var toMerge = componentVNodeHooks[key];
|
||
// @ts-expect-error
|
||
if (existing !== toMerge && !(existing && existing._merged)) {
|
||
hooks[key] = existing ? mergeHook(toMerge, existing) : toMerge;
|
||
}
|
||
}
|
||
}
|
||
function mergeHook(f1, f2) {
|
||
var merged = function (a, b) {
|
||
// flow complains about extra args which is why we use any
|
||
f1(a, b);
|
||
f2(a, b);
|
||
};
|
||
merged._merged = true;
|
||
return merged;
|
||
}
|
||
// transform component v-model info (value and callback) into
|
||
// prop and event handler respectively.
|
||
function transformModel(options, data) {
|
||
var prop = (options.model && options.model.prop) || 'value';
|
||
var event = (options.model && options.model.event) || 'input';
|
||
(data.attrs || (data.attrs = {}))[prop] = data.model.value;
|
||
var on = data.on || (data.on = {});
|
||
var existing = on[event];
|
||
var callback = data.model.callback;
|
||
if (isDef(existing)) {
|
||
if (isArray(existing)
|
||
? existing.indexOf(callback) === -1
|
||
: existing !== callback) {
|
||
on[event] = [callback].concat(existing);
|
||
}
|
||
}
|
||
else {
|
||
on[event] = callback;
|
||
}
|
||
}
|
||
|
||
var warn = noop;
|
||
var tip = noop;
|
||
var generateComponentTrace; // work around flow check
|
||
var formatComponentName;
|
||
if (true) {
|
||
var hasConsole_1 = typeof console !== 'undefined';
|
||
var classifyRE_1 = /(?:^|[-_])(\w)/g;
|
||
var classify_1 = function (str) {
|
||
return str.replace(classifyRE_1, function (c) { return c.toUpperCase(); }).replace(/[-_]/g, '');
|
||
};
|
||
warn = function (msg, vm) {
|
||
if (vm === void 0) { vm = currentInstance; }
|
||
var trace = vm ? generateComponentTrace(vm) : '';
|
||
if (config.warnHandler) {
|
||
config.warnHandler.call(null, msg, vm, trace);
|
||
}
|
||
else if (hasConsole_1 && !config.silent) {
|
||
console.error("[Vue warn]: ".concat(msg).concat(trace));
|
||
}
|
||
};
|
||
tip = function (msg, vm) {
|
||
if (hasConsole_1 && !config.silent) {
|
||
console.warn("[Vue tip]: ".concat(msg) + (vm ? generateComponentTrace(vm) : ''));
|
||
}
|
||
};
|
||
formatComponentName = function (vm, includeFile) {
|
||
if (vm.$root === vm) {
|
||
return '<Root>';
|
||
}
|
||
var options = isFunction(vm) && vm.cid != null
|
||
? vm.options
|
||
: vm._isVue
|
||
? vm.$options || vm.constructor.options
|
||
: vm;
|
||
var name = getComponentName(options);
|
||
var file = options.__file;
|
||
if (!name && file) {
|
||
var match = file.match(/([^/\\]+)\.vue$/);
|
||
name = match && match[1];
|
||
}
|
||
return ((name ? "<".concat(classify_1(name), ">") : "<Anonymous>") +
|
||
(file && includeFile !== false ? " at ".concat(file) : ''));
|
||
};
|
||
var repeat_1 = function (str, n) {
|
||
var res = '';
|
||
while (n) {
|
||
if (n % 2 === 1)
|
||
res += str;
|
||
if (n > 1)
|
||
str += str;
|
||
n >>= 1;
|
||
}
|
||
return res;
|
||
};
|
||
generateComponentTrace = function (vm) {
|
||
if (vm._isVue && vm.$parent) {
|
||
var tree = [];
|
||
var currentRecursiveSequence = 0;
|
||
while (vm) {
|
||
if (tree.length > 0) {
|
||
var last = tree[tree.length - 1];
|
||
if (last.constructor === vm.constructor) {
|
||
currentRecursiveSequence++;
|
||
vm = vm.$parent;
|
||
continue;
|
||
}
|
||
else if (currentRecursiveSequence > 0) {
|
||
tree[tree.length - 1] = [last, currentRecursiveSequence];
|
||
currentRecursiveSequence = 0;
|
||
}
|
||
}
|
||
tree.push(vm);
|
||
vm = vm.$parent;
|
||
}
|
||
return ('\n\nfound in\n\n' +
|
||
tree
|
||
.map(function (vm, i) {
|
||
return "".concat(i === 0 ? '---> ' : repeat_1(' ', 5 + i * 2)).concat(isArray(vm)
|
||
? "".concat(formatComponentName(vm[0]), "... (").concat(vm[1], " recursive calls)")
|
||
: formatComponentName(vm));
|
||
})
|
||
.join('\n'));
|
||
}
|
||
else {
|
||
return "\n\n(found in ".concat(formatComponentName(vm), ")");
|
||
}
|
||
};
|
||
}
|
||
|
||
/**
|
||
* Option overwriting strategies are functions that handle
|
||
* how to merge a parent option value and a child option
|
||
* value into the final value.
|
||
*/
|
||
var strats = config.optionMergeStrategies;
|
||
/**
|
||
* Options with restrictions
|
||
*/
|
||
if (true) {
|
||
strats.el = strats.propsData = function (parent, child, vm, key) {
|
||
if (!vm) {
|
||
warn("option \"".concat(key, "\" can only be used during instance ") +
|
||
'creation with the `new` keyword.');
|
||
}
|
||
return defaultStrat(parent, child);
|
||
};
|
||
}
|
||
/**
|
||
* Helper that recursively merges two data objects together.
|
||
*/
|
||
function mergeData(to, from, recursive) {
|
||
if (recursive === void 0) { recursive = true; }
|
||
if (!from)
|
||
return to;
|
||
var key, toVal, fromVal;
|
||
var keys = hasSymbol
|
||
? Reflect.ownKeys(from)
|
||
: Object.keys(from);
|
||
for (var i = 0; i < keys.length; i++) {
|
||
key = keys[i];
|
||
// in case the object is already observed...
|
||
if (key === '__ob__')
|
||
continue;
|
||
toVal = to[key];
|
||
fromVal = from[key];
|
||
if (!recursive || !hasOwn(to, key)) {
|
||
set(to, key, fromVal);
|
||
}
|
||
else if (toVal !== fromVal &&
|
||
isPlainObject(toVal) &&
|
||
isPlainObject(fromVal)) {
|
||
mergeData(toVal, fromVal);
|
||
}
|
||
}
|
||
return to;
|
||
}
|
||
/**
|
||
* Data
|
||
*/
|
||
function mergeDataOrFn(parentVal, childVal, vm) {
|
||
if (!vm) {
|
||
// in a Vue.extend merge, both should be functions
|
||
if (!childVal) {
|
||
return parentVal;
|
||
}
|
||
if (!parentVal) {
|
||
return childVal;
|
||
}
|
||
// when parentVal & childVal are both present,
|
||
// we need to return a function that returns the
|
||
// merged result of both functions... no need to
|
||
// check if parentVal is a function here because
|
||
// it has to be a function to pass previous merges.
|
||
return function mergedDataFn() {
|
||
return mergeData(isFunction(childVal) ? childVal.call(this, this) : childVal, isFunction(parentVal) ? parentVal.call(this, this) : parentVal);
|
||
};
|
||
}
|
||
else {
|
||
return function mergedInstanceDataFn() {
|
||
// instance merge
|
||
var instanceData = isFunction(childVal)
|
||
? childVal.call(vm, vm)
|
||
: childVal;
|
||
var defaultData = isFunction(parentVal)
|
||
? parentVal.call(vm, vm)
|
||
: parentVal;
|
||
if (instanceData) {
|
||
return mergeData(instanceData, defaultData);
|
||
}
|
||
else {
|
||
return defaultData;
|
||
}
|
||
};
|
||
}
|
||
}
|
||
strats.data = function (parentVal, childVal, vm) {
|
||
if (!vm) {
|
||
if (childVal && typeof childVal !== 'function') {
|
||
true &&
|
||
warn('The "data" option should be a function ' +
|
||
'that returns a per-instance value in component ' +
|
||
'definitions.', vm);
|
||
return parentVal;
|
||
}
|
||
return mergeDataOrFn(parentVal, childVal);
|
||
}
|
||
return mergeDataOrFn(parentVal, childVal, vm);
|
||
};
|
||
/**
|
||
* Hooks and props are merged as arrays.
|
||
*/
|
||
function mergeLifecycleHook(parentVal, childVal) {
|
||
var res = childVal
|
||
? parentVal
|
||
? parentVal.concat(childVal)
|
||
: isArray(childVal)
|
||
? childVal
|
||
: [childVal]
|
||
: parentVal;
|
||
return res ? dedupeHooks(res) : res;
|
||
}
|
||
function dedupeHooks(hooks) {
|
||
var res = [];
|
||
for (var i = 0; i < hooks.length; i++) {
|
||
if (res.indexOf(hooks[i]) === -1) {
|
||
res.push(hooks[i]);
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
LIFECYCLE_HOOKS.forEach(function (hook) {
|
||
strats[hook] = mergeLifecycleHook;
|
||
});
|
||
/**
|
||
* Assets
|
||
*
|
||
* When a vm is present (instance creation), we need to do
|
||
* a three-way merge between constructor options, instance
|
||
* options and parent options.
|
||
*/
|
||
function mergeAssets(parentVal, childVal, vm, key) {
|
||
var res = Object.create(parentVal || null);
|
||
if (childVal) {
|
||
true && assertObjectType(key, childVal, vm);
|
||
return extend(res, childVal);
|
||
}
|
||
else {
|
||
return res;
|
||
}
|
||
}
|
||
ASSET_TYPES.forEach(function (type) {
|
||
strats[type + 's'] = mergeAssets;
|
||
});
|
||
/**
|
||
* Watchers.
|
||
*
|
||
* Watchers hashes should not overwrite one
|
||
* another, so we merge them as arrays.
|
||
*/
|
||
strats.watch = function (parentVal, childVal, vm, key) {
|
||
// work around Firefox's Object.prototype.watch...
|
||
//@ts-expect-error work around
|
||
if (parentVal === nativeWatch)
|
||
parentVal = undefined;
|
||
//@ts-expect-error work around
|
||
if (childVal === nativeWatch)
|
||
childVal = undefined;
|
||
/* istanbul ignore if */
|
||
if (!childVal)
|
||
return Object.create(parentVal || null);
|
||
if (true) {
|
||
assertObjectType(key, childVal, vm);
|
||
}
|
||
if (!parentVal)
|
||
return childVal;
|
||
var ret = {};
|
||
extend(ret, parentVal);
|
||
for (var key_1 in childVal) {
|
||
var parent_1 = ret[key_1];
|
||
var child = childVal[key_1];
|
||
if (parent_1 && !isArray(parent_1)) {
|
||
parent_1 = [parent_1];
|
||
}
|
||
ret[key_1] = parent_1 ? parent_1.concat(child) : isArray(child) ? child : [child];
|
||
}
|
||
return ret;
|
||
};
|
||
/**
|
||
* Other object hashes.
|
||
*/
|
||
strats.props =
|
||
strats.methods =
|
||
strats.inject =
|
||
strats.computed =
|
||
function (parentVal, childVal, vm, key) {
|
||
if (childVal && "development" !== 'production') {
|
||
assertObjectType(key, childVal, vm);
|
||
}
|
||
if (!parentVal)
|
||
return childVal;
|
||
var ret = Object.create(null);
|
||
extend(ret, parentVal);
|
||
if (childVal)
|
||
extend(ret, childVal);
|
||
return ret;
|
||
};
|
||
strats.provide = function (parentVal, childVal) {
|
||
if (!parentVal)
|
||
return childVal;
|
||
return function () {
|
||
var ret = Object.create(null);
|
||
mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
|
||
if (childVal) {
|
||
mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
|
||
);
|
||
}
|
||
return ret;
|
||
};
|
||
};
|
||
/**
|
||
* Default strategy.
|
||
*/
|
||
var defaultStrat = function (parentVal, childVal) {
|
||
return childVal === undefined ? parentVal : childVal;
|
||
};
|
||
/**
|
||
* Validate component names
|
||
*/
|
||
function checkComponents(options) {
|
||
for (var key in options.components) {
|
||
validateComponentName(key);
|
||
}
|
||
}
|
||
function validateComponentName(name) {
|
||
if (!new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(unicodeRegExp.source, "]*$")).test(name)) {
|
||
warn('Invalid component name: "' +
|
||
name +
|
||
'". Component names ' +
|
||
'should conform to valid custom element name in html5 specification.');
|
||
}
|
||
if (isBuiltInTag(name) || config.isReservedTag(name)) {
|
||
warn('Do not use built-in or reserved HTML elements as component ' +
|
||
'id: ' +
|
||
name);
|
||
}
|
||
}
|
||
/**
|
||
* Ensure all props option syntax are normalized into the
|
||
* Object-based format.
|
||
*/
|
||
function normalizeProps(options, vm) {
|
||
var props = options.props;
|
||
if (!props)
|
||
return;
|
||
var res = {};
|
||
var i, val, name;
|
||
if (isArray(props)) {
|
||
i = props.length;
|
||
while (i--) {
|
||
val = props[i];
|
||
if (typeof val === 'string') {
|
||
name = camelize(val);
|
||
res[name] = { type: null };
|
||
}
|
||
else if (true) {
|
||
warn('props must be strings when using array syntax.');
|
||
}
|
||
}
|
||
}
|
||
else if (isPlainObject(props)) {
|
||
for (var key in props) {
|
||
val = props[key];
|
||
name = camelize(key);
|
||
res[name] = isPlainObject(val) ? val : { type: val };
|
||
}
|
||
}
|
||
else if (true) {
|
||
warn("Invalid value for option \"props\": expected an Array or an Object, " +
|
||
"but got ".concat(toRawType(props), "."), vm);
|
||
}
|
||
options.props = res;
|
||
}
|
||
/**
|
||
* Normalize all injections into Object-based format
|
||
*/
|
||
function normalizeInject(options, vm) {
|
||
var inject = options.inject;
|
||
if (!inject)
|
||
return;
|
||
var normalized = (options.inject = {});
|
||
if (isArray(inject)) {
|
||
for (var i = 0; i < inject.length; i++) {
|
||
normalized[inject[i]] = { from: inject[i] };
|
||
}
|
||
}
|
||
else if (isPlainObject(inject)) {
|
||
for (var key in inject) {
|
||
var val = inject[key];
|
||
normalized[key] = isPlainObject(val)
|
||
? extend({ from: key }, val)
|
||
: { from: val };
|
||
}
|
||
}
|
||
else if (true) {
|
||
warn("Invalid value for option \"inject\": expected an Array or an Object, " +
|
||
"but got ".concat(toRawType(inject), "."), vm);
|
||
}
|
||
}
|
||
/**
|
||
* Normalize raw function directives into object format.
|
||
*/
|
||
function normalizeDirectives$1(options) {
|
||
var dirs = options.directives;
|
||
if (dirs) {
|
||
for (var key in dirs) {
|
||
var def = dirs[key];
|
||
if (isFunction(def)) {
|
||
dirs[key] = { bind: def, update: def };
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function assertObjectType(name, value, vm) {
|
||
if (!isPlainObject(value)) {
|
||
warn("Invalid value for option \"".concat(name, "\": expected an Object, ") +
|
||
"but got ".concat(toRawType(value), "."), vm);
|
||
}
|
||
}
|
||
/**
|
||
* Merge two option objects into a new one.
|
||
* Core utility used in both instantiation and inheritance.
|
||
*/
|
||
function mergeOptions(parent, child, vm) {
|
||
if (true) {
|
||
checkComponents(child);
|
||
}
|
||
if (isFunction(child)) {
|
||
// @ts-expect-error
|
||
child = child.options;
|
||
}
|
||
normalizeProps(child, vm);
|
||
normalizeInject(child, vm);
|
||
normalizeDirectives$1(child);
|
||
// Apply extends and mixins on the child options,
|
||
// but only if it is a raw options object that isn't
|
||
// the result of another mergeOptions call.
|
||
// Only merged options has the _base property.
|
||
if (!child._base) {
|
||
if (child.extends) {
|
||
parent = mergeOptions(parent, child.extends, vm);
|
||
}
|
||
if (child.mixins) {
|
||
for (var i = 0, l = child.mixins.length; i < l; i++) {
|
||
parent = mergeOptions(parent, child.mixins[i], vm);
|
||
}
|
||
}
|
||
}
|
||
var options = {};
|
||
var key;
|
||
for (key in parent) {
|
||
mergeField(key);
|
||
}
|
||
for (key in child) {
|
||
if (!hasOwn(parent, key)) {
|
||
mergeField(key);
|
||
}
|
||
}
|
||
function mergeField(key) {
|
||
var strat = strats[key] || defaultStrat;
|
||
options[key] = strat(parent[key], child[key], vm, key);
|
||
}
|
||
return options;
|
||
}
|
||
/**
|
||
* Resolve an asset.
|
||
* This function is used because child instances need access
|
||
* to assets defined in its ancestor chain.
|
||
*/
|
||
function resolveAsset(options, type, id, warnMissing) {
|
||
/* istanbul ignore if */
|
||
if (typeof id !== 'string') {
|
||
return;
|
||
}
|
||
var assets = options[type];
|
||
// check local registration variations first
|
||
if (hasOwn(assets, id))
|
||
return assets[id];
|
||
var camelizedId = camelize(id);
|
||
if (hasOwn(assets, camelizedId))
|
||
return assets[camelizedId];
|
||
var PascalCaseId = capitalize(camelizedId);
|
||
if (hasOwn(assets, PascalCaseId))
|
||
return assets[PascalCaseId];
|
||
// fallback to prototype chain
|
||
var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
|
||
if ( true && warnMissing && !res) {
|
||
warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id);
|
||
}
|
||
return res;
|
||
}
|
||
|
||
function validateProp(key, propOptions, propsData, vm) {
|
||
var prop = propOptions[key];
|
||
var absent = !hasOwn(propsData, key);
|
||
var value = propsData[key];
|
||
// boolean casting
|
||
var booleanIndex = getTypeIndex(Boolean, prop.type);
|
||
if (booleanIndex > -1) {
|
||
if (absent && !hasOwn(prop, 'default')) {
|
||
value = false;
|
||
}
|
||
else if (value === '' || value === hyphenate(key)) {
|
||
// only cast empty string / same name to boolean if
|
||
// boolean has higher priority
|
||
var stringIndex = getTypeIndex(String, prop.type);
|
||
if (stringIndex < 0 || booleanIndex < stringIndex) {
|
||
value = true;
|
||
}
|
||
}
|
||
}
|
||
// check default value
|
||
if (value === undefined) {
|
||
value = getPropDefaultValue(vm, prop, key);
|
||
// since the default value is a fresh copy,
|
||
// make sure to observe it.
|
||
var prevShouldObserve = shouldObserve;
|
||
toggleObserving(true);
|
||
observe(value);
|
||
toggleObserving(prevShouldObserve);
|
||
}
|
||
if (true) {
|
||
assertProp(prop, key, value, vm, absent);
|
||
}
|
||
return value;
|
||
}
|
||
/**
|
||
* Get the default value of a prop.
|
||
*/
|
||
function getPropDefaultValue(vm, prop, key) {
|
||
// no default, return undefined
|
||
if (!hasOwn(prop, 'default')) {
|
||
return undefined;
|
||
}
|
||
var def = prop.default;
|
||
// warn against non-factory defaults for Object & Array
|
||
if ( true && isObject(def)) {
|
||
warn('Invalid default value for prop "' +
|
||
key +
|
||
'": ' +
|
||
'Props with type Object/Array must use a factory function ' +
|
||
'to return the default value.', vm);
|
||
}
|
||
// the raw prop value was also undefined from previous render,
|
||
// return previous default value to avoid unnecessary watcher trigger
|
||
if (vm &&
|
||
vm.$options.propsData &&
|
||
vm.$options.propsData[key] === undefined &&
|
||
vm._props[key] !== undefined) {
|
||
return vm._props[key];
|
||
}
|
||
// call factory function for non-Function types
|
||
// a value is Function if its prototype is function even across different execution context
|
||
return isFunction(def) && getType(prop.type) !== 'Function'
|
||
? def.call(vm)
|
||
: def;
|
||
}
|
||
/**
|
||
* Assert whether a prop is valid.
|
||
*/
|
||
function assertProp(prop, name, value, vm, absent) {
|
||
if (prop.required && absent) {
|
||
warn('Missing required prop: "' + name + '"', vm);
|
||
return;
|
||
}
|
||
if (value == null && !prop.required) {
|
||
return;
|
||
}
|
||
var type = prop.type;
|
||
var valid = !type || type === true;
|
||
var expectedTypes = [];
|
||
if (type) {
|
||
if (!isArray(type)) {
|
||
type = [type];
|
||
}
|
||
for (var i = 0; i < type.length && !valid; i++) {
|
||
var assertedType = assertType(value, type[i], vm);
|
||
expectedTypes.push(assertedType.expectedType || '');
|
||
valid = assertedType.valid;
|
||
}
|
||
}
|
||
var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
|
||
if (!valid && haveExpectedTypes) {
|
||
warn(getInvalidTypeMessage(name, value, expectedTypes), vm);
|
||
return;
|
||
}
|
||
var validator = prop.validator;
|
||
if (validator) {
|
||
if (!validator(value)) {
|
||
warn('Invalid prop: custom validator check failed for prop "' + name + '".', vm);
|
||
}
|
||
}
|
||
}
|
||
var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
|
||
function assertType(value, type, vm) {
|
||
var valid;
|
||
var expectedType = getType(type);
|
||
if (simpleCheckRE.test(expectedType)) {
|
||
var t = typeof value;
|
||
valid = t === expectedType.toLowerCase();
|
||
// for primitive wrapper objects
|
||
if (!valid && t === 'object') {
|
||
valid = value instanceof type;
|
||
}
|
||
}
|
||
else if (expectedType === 'Object') {
|
||
valid = isPlainObject(value);
|
||
}
|
||
else if (expectedType === 'Array') {
|
||
valid = isArray(value);
|
||
}
|
||
else {
|
||
try {
|
||
valid = value instanceof type;
|
||
}
|
||
catch (e) {
|
||
warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
|
||
valid = false;
|
||
}
|
||
}
|
||
return {
|
||
valid: valid,
|
||
expectedType: expectedType
|
||
};
|
||
}
|
||
var functionTypeCheckRE = /^\s*function (\w+)/;
|
||
/**
|
||
* Use function string name to check built-in types,
|
||
* because a simple equality check will fail when running
|
||
* across different vms / iframes.
|
||
*/
|
||
function getType(fn) {
|
||
var match = fn && fn.toString().match(functionTypeCheckRE);
|
||
return match ? match[1] : '';
|
||
}
|
||
function isSameType(a, b) {
|
||
return getType(a) === getType(b);
|
||
}
|
||
function getTypeIndex(type, expectedTypes) {
|
||
if (!isArray(expectedTypes)) {
|
||
return isSameType(expectedTypes, type) ? 0 : -1;
|
||
}
|
||
for (var i = 0, len = expectedTypes.length; i < len; i++) {
|
||
if (isSameType(expectedTypes[i], type)) {
|
||
return i;
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
function getInvalidTypeMessage(name, value, expectedTypes) {
|
||
var message = "Invalid prop: type check failed for prop \"".concat(name, "\".") +
|
||
" Expected ".concat(expectedTypes.map(capitalize).join(', '));
|
||
var expectedType = expectedTypes[0];
|
||
var receivedType = toRawType(value);
|
||
// check if we need to specify expected value
|
||
if (expectedTypes.length === 1 &&
|
||
isExplicable(expectedType) &&
|
||
isExplicable(typeof value) &&
|
||
!isBoolean(expectedType, receivedType)) {
|
||
message += " with value ".concat(styleValue(value, expectedType));
|
||
}
|
||
message += ", got ".concat(receivedType, " ");
|
||
// check if we need to specify received value
|
||
if (isExplicable(receivedType)) {
|
||
message += "with value ".concat(styleValue(value, receivedType), ".");
|
||
}
|
||
return message;
|
||
}
|
||
function styleValue(value, type) {
|
||
if (type === 'String') {
|
||
return "\"".concat(value, "\"");
|
||
}
|
||
else if (type === 'Number') {
|
||
return "".concat(Number(value));
|
||
}
|
||
else {
|
||
return "".concat(value);
|
||
}
|
||
}
|
||
var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
|
||
function isExplicable(value) {
|
||
return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; });
|
||
}
|
||
function isBoolean() {
|
||
var args = [];
|
||
for (var _i = 0; _i < arguments.length; _i++) {
|
||
args[_i] = arguments[_i];
|
||
}
|
||
return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; });
|
||
}
|
||
|
||
/* not type checking this file because flow doesn't play well with Proxy */
|
||
var initProxy;
|
||
if (true) {
|
||
var allowedGlobals_1 = makeMap('Infinity,undefined,NaN,isFinite,isNaN,' +
|
||
'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
|
||
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
|
||
'require' // for Webpack/Browserify
|
||
);
|
||
var warnNonPresent_1 = function (target, key) {
|
||
warn("Property or method \"".concat(key, "\" is not defined on the instance but ") +
|
||
'referenced during render. Make sure that this property is reactive, ' +
|
||
'either in the data option, or for class-based components, by ' +
|
||
'initializing the property. ' +
|
||
'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
|
||
};
|
||
var warnReservedPrefix_1 = function (target, key) {
|
||
warn("Property \"".concat(key, "\" must be accessed with \"$data.").concat(key, "\" because ") +
|
||
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
|
||
'prevent conflicts with Vue internals. ' +
|
||
'See: https://v2.vuejs.org/v2/api/#data', target);
|
||
};
|
||
var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);
|
||
if (hasProxy_1) {
|
||
var isBuiltInModifier_1 = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
|
||
config.keyCodes = new Proxy(config.keyCodes, {
|
||
set: function (target, key, value) {
|
||
if (isBuiltInModifier_1(key)) {
|
||
warn("Avoid overwriting built-in modifier in config.keyCodes: .".concat(key));
|
||
return false;
|
||
}
|
||
else {
|
||
target[key] = value;
|
||
return true;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
var hasHandler_1 = {
|
||
has: function (target, key) {
|
||
var has = key in target;
|
||
var isAllowed = allowedGlobals_1(key) ||
|
||
(typeof key === 'string' &&
|
||
key.charAt(0) === '_' &&
|
||
!(key in target.$data));
|
||
if (!has && !isAllowed) {
|
||
if (key in target.$data)
|
||
warnReservedPrefix_1(target, key);
|
||
else
|
||
warnNonPresent_1(target, key);
|
||
}
|
||
return has || !isAllowed;
|
||
}
|
||
};
|
||
var getHandler_1 = {
|
||
get: function (target, key) {
|
||
if (typeof key === 'string' && !(key in target)) {
|
||
if (key in target.$data)
|
||
warnReservedPrefix_1(target, key);
|
||
else
|
||
warnNonPresent_1(target, key);
|
||
}
|
||
return target[key];
|
||
}
|
||
};
|
||
initProxy = function initProxy(vm) {
|
||
if (hasProxy_1) {
|
||
// determine which proxy handler to use
|
||
var options = vm.$options;
|
||
var handlers = options.render && options.render._withStripped ? getHandler_1 : hasHandler_1;
|
||
vm._renderProxy = new Proxy(vm, handlers);
|
||
}
|
||
else {
|
||
vm._renderProxy = vm;
|
||
}
|
||
};
|
||
}
|
||
|
||
var sharedPropertyDefinition = {
|
||
enumerable: true,
|
||
configurable: true,
|
||
get: noop,
|
||
set: noop
|
||
};
|
||
function proxy(target, sourceKey, key) {
|
||
sharedPropertyDefinition.get = function proxyGetter() {
|
||
return this[sourceKey][key];
|
||
};
|
||
sharedPropertyDefinition.set = function proxySetter(val) {
|
||
this[sourceKey][key] = val;
|
||
};
|
||
Object.defineProperty(target, key, sharedPropertyDefinition);
|
||
}
|
||
function initState(vm) {
|
||
var opts = vm.$options;
|
||
if (opts.props)
|
||
initProps$1(vm, opts.props);
|
||
// Composition API
|
||
initSetup(vm);
|
||
if (opts.methods)
|
||
initMethods(vm, opts.methods);
|
||
if (opts.data) {
|
||
initData(vm);
|
||
}
|
||
else {
|
||
var ob = observe((vm._data = {}));
|
||
ob && ob.vmCount++;
|
||
}
|
||
if (opts.computed)
|
||
initComputed$1(vm, opts.computed);
|
||
if (opts.watch && opts.watch !== nativeWatch) {
|
||
initWatch(vm, opts.watch);
|
||
}
|
||
}
|
||
function initProps$1(vm, propsOptions) {
|
||
var propsData = vm.$options.propsData || {};
|
||
var props = (vm._props = shallowReactive({}));
|
||
// cache prop keys so that future props updates can iterate using Array
|
||
// instead of dynamic object key enumeration.
|
||
var keys = (vm.$options._propKeys = []);
|
||
var isRoot = !vm.$parent;
|
||
// root instance props should be converted
|
||
if (!isRoot) {
|
||
toggleObserving(false);
|
||
}
|
||
var _loop_1 = function (key) {
|
||
keys.push(key);
|
||
var value = validateProp(key, propsOptions, propsData, vm);
|
||
/* istanbul ignore else */
|
||
if (true) {
|
||
var hyphenatedKey = hyphenate(key);
|
||
if (isReservedAttribute(hyphenatedKey) ||
|
||
config.isReservedAttr(hyphenatedKey)) {
|
||
warn("\"".concat(hyphenatedKey, "\" is a reserved attribute and cannot be used as component prop."), vm);
|
||
}
|
||
defineReactive(props, key, value, function () {
|
||
if (!isRoot && !isUpdatingChildComponent) {
|
||
warn("Avoid mutating a prop directly since the value will be " +
|
||
"overwritten whenever the parent component re-renders. " +
|
||
"Instead, use a data or computed property based on the prop's " +
|
||
"value. Prop being mutated: \"".concat(key, "\""), vm);
|
||
}
|
||
}, true /* shallow */);
|
||
}
|
||
else {}
|
||
// static props are already proxied on the component's prototype
|
||
// during Vue.extend(). We only need to proxy props defined at
|
||
// instantiation here.
|
||
if (!(key in vm)) {
|
||
proxy(vm, "_props", key);
|
||
}
|
||
};
|
||
for (var key in propsOptions) {
|
||
_loop_1(key);
|
||
}
|
||
toggleObserving(true);
|
||
}
|
||
function initData(vm) {
|
||
var data = vm.$options.data;
|
||
data = vm._data = isFunction(data) ? getData(data, vm) : data || {};
|
||
if (!isPlainObject(data)) {
|
||
data = {};
|
||
true &&
|
||
warn('data functions should return an object:\n' +
|
||
'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
|
||
}
|
||
// proxy data on instance
|
||
var keys = Object.keys(data);
|
||
var props = vm.$options.props;
|
||
var methods = vm.$options.methods;
|
||
var i = keys.length;
|
||
while (i--) {
|
||
var key = keys[i];
|
||
if (true) {
|
||
if (methods && hasOwn(methods, key)) {
|
||
warn("Method \"".concat(key, "\" has already been defined as a data property."), vm);
|
||
}
|
||
}
|
||
if (props && hasOwn(props, key)) {
|
||
true &&
|
||
warn("The data property \"".concat(key, "\" is already declared as a prop. ") +
|
||
"Use prop default value instead.", vm);
|
||
}
|
||
else if (!isReserved(key)) {
|
||
proxy(vm, "_data", key);
|
||
}
|
||
}
|
||
// observe data
|
||
var ob = observe(data);
|
||
ob && ob.vmCount++;
|
||
}
|
||
function getData(data, vm) {
|
||
// #7573 disable dep collection when invoking data getters
|
||
pushTarget();
|
||
try {
|
||
return data.call(vm, vm);
|
||
}
|
||
catch (e) {
|
||
handleError(e, vm, "data()");
|
||
return {};
|
||
}
|
||
finally {
|
||
popTarget();
|
||
}
|
||
}
|
||
var computedWatcherOptions = { lazy: true };
|
||
function initComputed$1(vm, computed) {
|
||
// $flow-disable-line
|
||
var watchers = (vm._computedWatchers = Object.create(null));
|
||
// computed properties are just getters during SSR
|
||
var isSSR = isServerRendering();
|
||
for (var key in computed) {
|
||
var userDef = computed[key];
|
||
var getter = isFunction(userDef) ? userDef : userDef.get;
|
||
if ( true && getter == null) {
|
||
warn("Getter is missing for computed property \"".concat(key, "\"."), vm);
|
||
}
|
||
if (!isSSR) {
|
||
// create internal watcher for the computed property.
|
||
watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);
|
||
}
|
||
// component-defined computed properties are already defined on the
|
||
// component prototype. We only need to define computed properties defined
|
||
// at instantiation here.
|
||
if (!(key in vm)) {
|
||
defineComputed(vm, key, userDef);
|
||
}
|
||
else if (true) {
|
||
if (key in vm.$data) {
|
||
warn("The computed property \"".concat(key, "\" is already defined in data."), vm);
|
||
}
|
||
else if (vm.$options.props && key in vm.$options.props) {
|
||
warn("The computed property \"".concat(key, "\" is already defined as a prop."), vm);
|
||
}
|
||
else if (vm.$options.methods && key in vm.$options.methods) {
|
||
warn("The computed property \"".concat(key, "\" is already defined as a method."), vm);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function defineComputed(target, key, userDef) {
|
||
var shouldCache = !isServerRendering();
|
||
if (isFunction(userDef)) {
|
||
sharedPropertyDefinition.get = shouldCache
|
||
? createComputedGetter(key)
|
||
: createGetterInvoker(userDef);
|
||
sharedPropertyDefinition.set = noop;
|
||
}
|
||
else {
|
||
sharedPropertyDefinition.get = userDef.get
|
||
? shouldCache && userDef.cache !== false
|
||
? createComputedGetter(key)
|
||
: createGetterInvoker(userDef.get)
|
||
: noop;
|
||
sharedPropertyDefinition.set = userDef.set || noop;
|
||
}
|
||
if ( true && sharedPropertyDefinition.set === noop) {
|
||
sharedPropertyDefinition.set = function () {
|
||
warn("Computed property \"".concat(key, "\" was assigned to but it has no setter."), this);
|
||
};
|
||
}
|
||
Object.defineProperty(target, key, sharedPropertyDefinition);
|
||
}
|
||
function createComputedGetter(key) {
|
||
return function computedGetter() {
|
||
var watcher = this._computedWatchers && this._computedWatchers[key];
|
||
if (watcher) {
|
||
if (watcher.dirty) {
|
||
watcher.evaluate();
|
||
}
|
||
if (Dep.target) {
|
||
if ( true && Dep.target.onTrack) {
|
||
Dep.target.onTrack({
|
||
effect: Dep.target,
|
||
target: this,
|
||
type: "get" /* TrackOpTypes.GET */,
|
||
key: key
|
||
});
|
||
}
|
||
watcher.depend();
|
||
}
|
||
return watcher.value;
|
||
}
|
||
};
|
||
}
|
||
function createGetterInvoker(fn) {
|
||
return function computedGetter() {
|
||
return fn.call(this, this);
|
||
};
|
||
}
|
||
function initMethods(vm, methods) {
|
||
var props = vm.$options.props;
|
||
for (var key in methods) {
|
||
if (true) {
|
||
if (typeof methods[key] !== 'function') {
|
||
warn("Method \"".concat(key, "\" has type \"").concat(typeof methods[key], "\" in the component definition. ") +
|
||
"Did you reference the function correctly?", vm);
|
||
}
|
||
if (props && hasOwn(props, key)) {
|
||
warn("Method \"".concat(key, "\" has already been defined as a prop."), vm);
|
||
}
|
||
if (key in vm && isReserved(key)) {
|
||
warn("Method \"".concat(key, "\" conflicts with an existing Vue instance method. ") +
|
||
"Avoid defining component methods that start with _ or $.");
|
||
}
|
||
}
|
||
vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
|
||
}
|
||
}
|
||
function initWatch(vm, watch) {
|
||
for (var key in watch) {
|
||
var handler = watch[key];
|
||
if (isArray(handler)) {
|
||
for (var i = 0; i < handler.length; i++) {
|
||
createWatcher(vm, key, handler[i]);
|
||
}
|
||
}
|
||
else {
|
||
createWatcher(vm, key, handler);
|
||
}
|
||
}
|
||
}
|
||
function createWatcher(vm, expOrFn, handler, options) {
|
||
if (isPlainObject(handler)) {
|
||
options = handler;
|
||
handler = handler.handler;
|
||
}
|
||
if (typeof handler === 'string') {
|
||
handler = vm[handler];
|
||
}
|
||
return vm.$watch(expOrFn, handler, options);
|
||
}
|
||
function stateMixin(Vue) {
|
||
// flow somehow has problems with directly declared definition object
|
||
// when using Object.defineProperty, so we have to procedurally build up
|
||
// the object here.
|
||
var dataDef = {};
|
||
dataDef.get = function () {
|
||
return this._data;
|
||
};
|
||
var propsDef = {};
|
||
propsDef.get = function () {
|
||
return this._props;
|
||
};
|
||
if (true) {
|
||
dataDef.set = function () {
|
||
warn('Avoid replacing instance root $data. ' +
|
||
'Use nested data properties instead.', this);
|
||
};
|
||
propsDef.set = function () {
|
||
warn("$props is readonly.", this);
|
||
};
|
||
}
|
||
Object.defineProperty(Vue.prototype, '$data', dataDef);
|
||
Object.defineProperty(Vue.prototype, '$props', propsDef);
|
||
Vue.prototype.$set = set;
|
||
Vue.prototype.$delete = del;
|
||
Vue.prototype.$watch = function (expOrFn, cb, options) {
|
||
var vm = this;
|
||
if (isPlainObject(cb)) {
|
||
return createWatcher(vm, expOrFn, cb, options);
|
||
}
|
||
options = options || {};
|
||
options.user = true;
|
||
var watcher = new Watcher(vm, expOrFn, cb, options);
|
||
if (options.immediate) {
|
||
var info = "callback for immediate watcher \"".concat(watcher.expression, "\"");
|
||
pushTarget();
|
||
invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
|
||
popTarget();
|
||
}
|
||
return function unwatchFn() {
|
||
watcher.teardown();
|
||
};
|
||
};
|
||
}
|
||
|
||
var uid = 0;
|
||
function initMixin$1(Vue) {
|
||
Vue.prototype._init = function (options) {
|
||
var vm = this;
|
||
// a uid
|
||
vm._uid = uid++;
|
||
var startTag, endTag;
|
||
/* istanbul ignore if */
|
||
if ( true && config.performance && mark) {
|
||
startTag = "vue-perf-start:".concat(vm._uid);
|
||
endTag = "vue-perf-end:".concat(vm._uid);
|
||
mark(startTag);
|
||
}
|
||
// a flag to mark this as a Vue instance without having to do instanceof
|
||
// check
|
||
vm._isVue = true;
|
||
// avoid instances from being observed
|
||
vm.__v_skip = true;
|
||
// effect scope
|
||
vm._scope = new EffectScope(true /* detached */);
|
||
// #13134 edge case where a child component is manually created during the
|
||
// render of a parent component
|
||
vm._scope.parent = undefined;
|
||
vm._scope._vm = true;
|
||
// merge options
|
||
if (options && options._isComponent) {
|
||
// optimize internal component instantiation
|
||
// since dynamic options merging is pretty slow, and none of the
|
||
// internal component options needs special treatment.
|
||
initInternalComponent(vm, options);
|
||
}
|
||
else {
|
||
vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);
|
||
}
|
||
/* istanbul ignore else */
|
||
if (true) {
|
||
initProxy(vm);
|
||
}
|
||
else {}
|
||
// expose real self
|
||
vm._self = vm;
|
||
initLifecycle(vm);
|
||
initEvents(vm);
|
||
initRender(vm);
|
||
callHook$1(vm, 'beforeCreate', undefined, false /* setContext */);
|
||
initInjections(vm); // resolve injections before data/props
|
||
initState(vm);
|
||
initProvide(vm); // resolve provide after data/props
|
||
callHook$1(vm, 'created');
|
||
/* istanbul ignore if */
|
||
if ( true && config.performance && mark) {
|
||
vm._name = formatComponentName(vm, false);
|
||
mark(endTag);
|
||
measure("vue ".concat(vm._name, " init"), startTag, endTag);
|
||
}
|
||
if (vm.$options.el) {
|
||
vm.$mount(vm.$options.el);
|
||
}
|
||
};
|
||
}
|
||
function initInternalComponent(vm, options) {
|
||
var opts = (vm.$options = Object.create(vm.constructor.options));
|
||
// doing this because it's faster than dynamic enumeration.
|
||
var parentVnode = options._parentVnode;
|
||
opts.parent = options.parent;
|
||
opts._parentVnode = parentVnode;
|
||
var vnodeComponentOptions = parentVnode.componentOptions;
|
||
opts.propsData = vnodeComponentOptions.propsData;
|
||
opts._parentListeners = vnodeComponentOptions.listeners;
|
||
opts._renderChildren = vnodeComponentOptions.children;
|
||
opts._componentTag = vnodeComponentOptions.tag;
|
||
if (options.render) {
|
||
opts.render = options.render;
|
||
opts.staticRenderFns = options.staticRenderFns;
|
||
}
|
||
}
|
||
function resolveConstructorOptions(Ctor) {
|
||
var options = Ctor.options;
|
||
if (Ctor.super) {
|
||
var superOptions = resolveConstructorOptions(Ctor.super);
|
||
var cachedSuperOptions = Ctor.superOptions;
|
||
if (superOptions !== cachedSuperOptions) {
|
||
// super option changed,
|
||
// need to resolve new options.
|
||
Ctor.superOptions = superOptions;
|
||
// check if there are any late-modified/attached options (#4976)
|
||
var modifiedOptions = resolveModifiedOptions(Ctor);
|
||
// update base extend options
|
||
if (modifiedOptions) {
|
||
extend(Ctor.extendOptions, modifiedOptions);
|
||
}
|
||
options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
|
||
if (options.name) {
|
||
options.components[options.name] = Ctor;
|
||
}
|
||
}
|
||
}
|
||
return options;
|
||
}
|
||
function resolveModifiedOptions(Ctor) {
|
||
var modified;
|
||
var latest = Ctor.options;
|
||
var sealed = Ctor.sealedOptions;
|
||
for (var key in latest) {
|
||
if (latest[key] !== sealed[key]) {
|
||
if (!modified)
|
||
modified = {};
|
||
modified[key] = latest[key];
|
||
}
|
||
}
|
||
return modified;
|
||
}
|
||
|
||
function Vue(options) {
|
||
if ( true && !(this instanceof Vue)) {
|
||
warn('Vue is a constructor and should be called with the `new` keyword');
|
||
}
|
||
this._init(options);
|
||
}
|
||
//@ts-expect-error Vue has function type
|
||
initMixin$1(Vue);
|
||
//@ts-expect-error Vue has function type
|
||
stateMixin(Vue);
|
||
//@ts-expect-error Vue has function type
|
||
eventsMixin(Vue);
|
||
//@ts-expect-error Vue has function type
|
||
lifecycleMixin(Vue);
|
||
//@ts-expect-error Vue has function type
|
||
renderMixin(Vue);
|
||
|
||
function initUse(Vue) {
|
||
Vue.use = function (plugin) {
|
||
var installedPlugins = this._installedPlugins || (this._installedPlugins = []);
|
||
if (installedPlugins.indexOf(plugin) > -1) {
|
||
return this;
|
||
}
|
||
// additional parameters
|
||
var args = toArray(arguments, 1);
|
||
args.unshift(this);
|
||
if (isFunction(plugin.install)) {
|
||
plugin.install.apply(plugin, args);
|
||
}
|
||
else if (isFunction(plugin)) {
|
||
plugin.apply(null, args);
|
||
}
|
||
installedPlugins.push(plugin);
|
||
return this;
|
||
};
|
||
}
|
||
|
||
function initMixin(Vue) {
|
||
Vue.mixin = function (mixin) {
|
||
this.options = mergeOptions(this.options, mixin);
|
||
return this;
|
||
};
|
||
}
|
||
|
||
function initExtend(Vue) {
|
||
/**
|
||
* Each instance constructor, including Vue, has a unique
|
||
* cid. This enables us to create wrapped "child
|
||
* constructors" for prototypal inheritance and cache them.
|
||
*/
|
||
Vue.cid = 0;
|
||
var cid = 1;
|
||
/**
|
||
* Class inheritance
|
||
*/
|
||
Vue.extend = function (extendOptions) {
|
||
extendOptions = extendOptions || {};
|
||
var Super = this;
|
||
var SuperId = Super.cid;
|
||
var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
|
||
if (cachedCtors[SuperId]) {
|
||
return cachedCtors[SuperId];
|
||
}
|
||
var name = getComponentName(extendOptions) || getComponentName(Super.options);
|
||
if ( true && name) {
|
||
validateComponentName(name);
|
||
}
|
||
var Sub = function VueComponent(options) {
|
||
this._init(options);
|
||
};
|
||
Sub.prototype = Object.create(Super.prototype);
|
||
Sub.prototype.constructor = Sub;
|
||
Sub.cid = cid++;
|
||
Sub.options = mergeOptions(Super.options, extendOptions);
|
||
Sub['super'] = Super;
|
||
// For props and computed properties, we define the proxy getters on
|
||
// the Vue instances at extension time, on the extended prototype. This
|
||
// avoids Object.defineProperty calls for each instance created.
|
||
if (Sub.options.props) {
|
||
initProps(Sub);
|
||
}
|
||
if (Sub.options.computed) {
|
||
initComputed(Sub);
|
||
}
|
||
// allow further extension/mixin/plugin usage
|
||
Sub.extend = Super.extend;
|
||
Sub.mixin = Super.mixin;
|
||
Sub.use = Super.use;
|
||
// create asset registers, so extended classes
|
||
// can have their private assets too.
|
||
ASSET_TYPES.forEach(function (type) {
|
||
Sub[type] = Super[type];
|
||
});
|
||
// enable recursive self-lookup
|
||
if (name) {
|
||
Sub.options.components[name] = Sub;
|
||
}
|
||
// keep a reference to the super options at extension time.
|
||
// later at instantiation we can check if Super's options have
|
||
// been updated.
|
||
Sub.superOptions = Super.options;
|
||
Sub.extendOptions = extendOptions;
|
||
Sub.sealedOptions = extend({}, Sub.options);
|
||
// cache constructor
|
||
cachedCtors[SuperId] = Sub;
|
||
return Sub;
|
||
};
|
||
}
|
||
function initProps(Comp) {
|
||
var props = Comp.options.props;
|
||
for (var key in props) {
|
||
proxy(Comp.prototype, "_props", key);
|
||
}
|
||
}
|
||
function initComputed(Comp) {
|
||
var computed = Comp.options.computed;
|
||
for (var key in computed) {
|
||
defineComputed(Comp.prototype, key, computed[key]);
|
||
}
|
||
}
|
||
|
||
function initAssetRegisters(Vue) {
|
||
/**
|
||
* Create asset registration methods.
|
||
*/
|
||
ASSET_TYPES.forEach(function (type) {
|
||
// @ts-expect-error function is not exact same type
|
||
Vue[type] = function (id, definition) {
|
||
if (!definition) {
|
||
return this.options[type + 's'][id];
|
||
}
|
||
else {
|
||
/* istanbul ignore if */
|
||
if ( true && type === 'component') {
|
||
validateComponentName(id);
|
||
}
|
||
if (type === 'component' && isPlainObject(definition)) {
|
||
// @ts-expect-error
|
||
definition.name = definition.name || id;
|
||
definition = this.options._base.extend(definition);
|
||
}
|
||
if (type === 'directive' && isFunction(definition)) {
|
||
definition = { bind: definition, update: definition };
|
||
}
|
||
this.options[type + 's'][id] = definition;
|
||
return definition;
|
||
}
|
||
};
|
||
});
|
||
}
|
||
|
||
function _getComponentName(opts) {
|
||
return opts && (getComponentName(opts.Ctor.options) || opts.tag);
|
||
}
|
||
function matches(pattern, name) {
|
||
if (isArray(pattern)) {
|
||
return pattern.indexOf(name) > -1;
|
||
}
|
||
else if (typeof pattern === 'string') {
|
||
return pattern.split(',').indexOf(name) > -1;
|
||
}
|
||
else if (isRegExp(pattern)) {
|
||
return pattern.test(name);
|
||
}
|
||
/* istanbul ignore next */
|
||
return false;
|
||
}
|
||
function pruneCache(keepAliveInstance, filter) {
|
||
var cache = keepAliveInstance.cache, keys = keepAliveInstance.keys, _vnode = keepAliveInstance._vnode, $vnode = keepAliveInstance.$vnode;
|
||
for (var key in cache) {
|
||
var entry = cache[key];
|
||
if (entry) {
|
||
var name_1 = entry.name;
|
||
if (name_1 && !filter(name_1)) {
|
||
pruneCacheEntry(cache, key, keys, _vnode);
|
||
}
|
||
}
|
||
}
|
||
$vnode.componentOptions.children = undefined;
|
||
}
|
||
function pruneCacheEntry(cache, key, keys, current) {
|
||
var entry = cache[key];
|
||
if (entry && (!current || entry.tag !== current.tag)) {
|
||
// @ts-expect-error can be undefined
|
||
entry.componentInstance.$destroy();
|
||
}
|
||
cache[key] = null;
|
||
remove$2(keys, key);
|
||
}
|
||
var patternTypes = [String, RegExp, Array];
|
||
// TODO defineComponent
|
||
var KeepAlive = {
|
||
name: 'keep-alive',
|
||
abstract: true,
|
||
props: {
|
||
include: patternTypes,
|
||
exclude: patternTypes,
|
||
max: [String, Number]
|
||
},
|
||
methods: {
|
||
cacheVNode: function () {
|
||
var _a = this, cache = _a.cache, keys = _a.keys, vnodeToCache = _a.vnodeToCache, keyToCache = _a.keyToCache;
|
||
if (vnodeToCache) {
|
||
var tag = vnodeToCache.tag, componentInstance = vnodeToCache.componentInstance, componentOptions = vnodeToCache.componentOptions;
|
||
cache[keyToCache] = {
|
||
name: _getComponentName(componentOptions),
|
||
tag: tag,
|
||
componentInstance: componentInstance
|
||
};
|
||
keys.push(keyToCache);
|
||
// prune oldest entry
|
||
if (this.max && keys.length > parseInt(this.max)) {
|
||
pruneCacheEntry(cache, keys[0], keys, this._vnode);
|
||
}
|
||
this.vnodeToCache = null;
|
||
}
|
||
}
|
||
},
|
||
created: function () {
|
||
this.cache = Object.create(null);
|
||
this.keys = [];
|
||
},
|
||
destroyed: function () {
|
||
for (var key in this.cache) {
|
||
pruneCacheEntry(this.cache, key, this.keys);
|
||
}
|
||
},
|
||
mounted: function () {
|
||
var _this = this;
|
||
this.cacheVNode();
|
||
this.$watch('include', function (val) {
|
||
pruneCache(_this, function (name) { return matches(val, name); });
|
||
});
|
||
this.$watch('exclude', function (val) {
|
||
pruneCache(_this, function (name) { return !matches(val, name); });
|
||
});
|
||
},
|
||
updated: function () {
|
||
this.cacheVNode();
|
||
},
|
||
render: function () {
|
||
var slot = this.$slots.default;
|
||
var vnode = getFirstComponentChild(slot);
|
||
var componentOptions = vnode && vnode.componentOptions;
|
||
if (componentOptions) {
|
||
// check pattern
|
||
var name_2 = _getComponentName(componentOptions);
|
||
var _a = this, include = _a.include, exclude = _a.exclude;
|
||
if (
|
||
// not included
|
||
(include && (!name_2 || !matches(include, name_2))) ||
|
||
// excluded
|
||
(exclude && name_2 && matches(exclude, name_2))) {
|
||
return vnode;
|
||
}
|
||
var _b = this, cache = _b.cache, keys = _b.keys;
|
||
var key = vnode.key == null
|
||
? // same constructor may get registered as different local components
|
||
// so cid alone is not enough (#3269)
|
||
componentOptions.Ctor.cid +
|
||
(componentOptions.tag ? "::".concat(componentOptions.tag) : '')
|
||
: vnode.key;
|
||
if (cache[key]) {
|
||
vnode.componentInstance = cache[key].componentInstance;
|
||
// make current key freshest
|
||
remove$2(keys, key);
|
||
keys.push(key);
|
||
}
|
||
else {
|
||
// delay setting the cache until update
|
||
this.vnodeToCache = vnode;
|
||
this.keyToCache = key;
|
||
}
|
||
// @ts-expect-error can vnode.data can be undefined
|
||
vnode.data.keepAlive = true;
|
||
}
|
||
return vnode || (slot && slot[0]);
|
||
}
|
||
};
|
||
|
||
var builtInComponents = {
|
||
KeepAlive: KeepAlive
|
||
};
|
||
|
||
function initGlobalAPI(Vue) {
|
||
// config
|
||
var configDef = {};
|
||
configDef.get = function () { return config; };
|
||
if (true) {
|
||
configDef.set = function () {
|
||
warn('Do not replace the Vue.config object, set individual fields instead.');
|
||
};
|
||
}
|
||
Object.defineProperty(Vue, 'config', configDef);
|
||
// exposed util methods.
|
||
// NOTE: these are not considered part of the public API - avoid relying on
|
||
// them unless you are aware of the risk.
|
||
Vue.util = {
|
||
warn: warn,
|
||
extend: extend,
|
||
mergeOptions: mergeOptions,
|
||
defineReactive: defineReactive
|
||
};
|
||
Vue.set = set;
|
||
Vue.delete = del;
|
||
Vue.nextTick = nextTick;
|
||
// 2.6 explicit observable API
|
||
Vue.observable = function (obj) {
|
||
observe(obj);
|
||
return obj;
|
||
};
|
||
Vue.options = Object.create(null);
|
||
ASSET_TYPES.forEach(function (type) {
|
||
Vue.options[type + 's'] = Object.create(null);
|
||
});
|
||
// this is used to identify the "base" constructor to extend all plain-object
|
||
// components with in Weex's multi-instance scenarios.
|
||
Vue.options._base = Vue;
|
||
extend(Vue.options.components, builtInComponents);
|
||
initUse(Vue);
|
||
initMixin(Vue);
|
||
initExtend(Vue);
|
||
initAssetRegisters(Vue);
|
||
}
|
||
|
||
initGlobalAPI(Vue);
|
||
Object.defineProperty(Vue.prototype, '$isServer', {
|
||
get: isServerRendering
|
||
});
|
||
Object.defineProperty(Vue.prototype, '$ssrContext', {
|
||
get: function () {
|
||
/* istanbul ignore next */
|
||
return this.$vnode && this.$vnode.ssrContext;
|
||
}
|
||
});
|
||
// expose FunctionalRenderContext for ssr runtime helper installation
|
||
Object.defineProperty(Vue, 'FunctionalRenderContext', {
|
||
value: FunctionalRenderContext
|
||
});
|
||
Vue.version = version;
|
||
|
||
// these are reserved for web because they are directly compiled away
|
||
// during template compilation
|
||
var isReservedAttr = makeMap('style,class');
|
||
// attributes that should be using props for binding
|
||
var acceptValue = makeMap('input,textarea,option,select,progress');
|
||
var mustUseProp = function (tag, type, attr) {
|
||
return ((attr === 'value' && acceptValue(tag) && type !== 'button') ||
|
||
(attr === 'selected' && tag === 'option') ||
|
||
(attr === 'checked' && tag === 'input') ||
|
||
(attr === 'muted' && tag === 'video'));
|
||
};
|
||
var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
|
||
var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
|
||
var convertEnumeratedValue = function (key, value) {
|
||
return isFalsyAttrValue(value) || value === 'false'
|
||
? 'false'
|
||
: // allow arbitrary string value for contenteditable
|
||
key === 'contenteditable' && isValidContentEditableValue(value)
|
||
? value
|
||
: 'true';
|
||
};
|
||
var isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
|
||
'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
|
||
'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
|
||
'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
|
||
'required,reversed,scoped,seamless,selected,sortable,' +
|
||
'truespeed,typemustmatch,visible');
|
||
var xlinkNS = 'http://www.w3.org/1999/xlink';
|
||
var isXlink = function (name) {
|
||
return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';
|
||
};
|
||
var getXlinkProp = function (name) {
|
||
return isXlink(name) ? name.slice(6, name.length) : '';
|
||
};
|
||
var isFalsyAttrValue = function (val) {
|
||
return val == null || val === false;
|
||
};
|
||
|
||
function genClassForVnode(vnode) {
|
||
var data = vnode.data;
|
||
var parentNode = vnode;
|
||
var childNode = vnode;
|
||
while (isDef(childNode.componentInstance)) {
|
||
childNode = childNode.componentInstance._vnode;
|
||
if (childNode && childNode.data) {
|
||
data = mergeClassData(childNode.data, data);
|
||
}
|
||
}
|
||
// @ts-expect-error parentNode.parent not VNodeWithData
|
||
while (isDef((parentNode = parentNode.parent))) {
|
||
if (parentNode && parentNode.data) {
|
||
data = mergeClassData(data, parentNode.data);
|
||
}
|
||
}
|
||
return renderClass(data.staticClass, data.class);
|
||
}
|
||
function mergeClassData(child, parent) {
|
||
return {
|
||
staticClass: concat(child.staticClass, parent.staticClass),
|
||
class: isDef(child.class) ? [child.class, parent.class] : parent.class
|
||
};
|
||
}
|
||
function renderClass(staticClass, dynamicClass) {
|
||
if (isDef(staticClass) || isDef(dynamicClass)) {
|
||
return concat(staticClass, stringifyClass(dynamicClass));
|
||
}
|
||
/* istanbul ignore next */
|
||
return '';
|
||
}
|
||
function concat(a, b) {
|
||
return a ? (b ? a + ' ' + b : a) : b || '';
|
||
}
|
||
function stringifyClass(value) {
|
||
if (Array.isArray(value)) {
|
||
return stringifyArray(value);
|
||
}
|
||
if (isObject(value)) {
|
||
return stringifyObject(value);
|
||
}
|
||
if (typeof value === 'string') {
|
||
return value;
|
||
}
|
||
/* istanbul ignore next */
|
||
return '';
|
||
}
|
||
function stringifyArray(value) {
|
||
var res = '';
|
||
var stringified;
|
||
for (var i = 0, l = value.length; i < l; i++) {
|
||
if (isDef((stringified = stringifyClass(value[i]))) && stringified !== '') {
|
||
if (res)
|
||
res += ' ';
|
||
res += stringified;
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
function stringifyObject(value) {
|
||
var res = '';
|
||
for (var key in value) {
|
||
if (value[key]) {
|
||
if (res)
|
||
res += ' ';
|
||
res += key;
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
|
||
var namespaceMap = {
|
||
svg: 'http://www.w3.org/2000/svg',
|
||
math: 'http://www.w3.org/1998/Math/MathML'
|
||
};
|
||
var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' +
|
||
'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
|
||
'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
|
||
'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
|
||
's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
|
||
'embed,object,param,source,canvas,script,noscript,del,ins,' +
|
||
'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
|
||
'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
|
||
'output,progress,select,textarea,' +
|
||
'details,dialog,menu,menuitem,summary,' +
|
||
'content,element,shadow,template,blockquote,iframe,tfoot');
|
||
// this map is intentionally selective, only covering SVG elements that may
|
||
// contain child elements.
|
||
var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
|
||
'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
|
||
'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
|
||
var isReservedTag = function (tag) {
|
||
return isHTMLTag(tag) || isSVG(tag);
|
||
};
|
||
function getTagNamespace(tag) {
|
||
if (isSVG(tag)) {
|
||
return 'svg';
|
||
}
|
||
// basic support for MathML
|
||
// note it doesn't support other MathML elements being component roots
|
||
if (tag === 'math') {
|
||
return 'math';
|
||
}
|
||
}
|
||
var unknownElementCache = Object.create(null);
|
||
function isUnknownElement(tag) {
|
||
/* istanbul ignore if */
|
||
if (!inBrowser) {
|
||
return true;
|
||
}
|
||
if (isReservedTag(tag)) {
|
||
return false;
|
||
}
|
||
tag = tag.toLowerCase();
|
||
/* istanbul ignore if */
|
||
if (unknownElementCache[tag] != null) {
|
||
return unknownElementCache[tag];
|
||
}
|
||
var el = document.createElement(tag);
|
||
if (tag.indexOf('-') > -1) {
|
||
// https://stackoverflow.com/a/28210364/1070244
|
||
return (unknownElementCache[tag] =
|
||
el.constructor === window.HTMLUnknownElement ||
|
||
el.constructor === window.HTMLElement);
|
||
}
|
||
else {
|
||
return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()));
|
||
}
|
||
}
|
||
var isTextInputType = makeMap('text,number,password,search,email,tel,url');
|
||
|
||
/**
|
||
* Query an element selector if it's not an element already.
|
||
*/
|
||
function query(el) {
|
||
if (typeof el === 'string') {
|
||
var selected = document.querySelector(el);
|
||
if (!selected) {
|
||
true && warn('Cannot find element: ' + el);
|
||
return document.createElement('div');
|
||
}
|
||
return selected;
|
||
}
|
||
else {
|
||
return el;
|
||
}
|
||
}
|
||
|
||
function createElement(tagName, vnode) {
|
||
var elm = document.createElement(tagName);
|
||
if (tagName !== 'select') {
|
||
return elm;
|
||
}
|
||
// false or null will remove the attribute but undefined will not
|
||
if (vnode.data &&
|
||
vnode.data.attrs &&
|
||
vnode.data.attrs.multiple !== undefined) {
|
||
elm.setAttribute('multiple', 'multiple');
|
||
}
|
||
return elm;
|
||
}
|
||
function createElementNS(namespace, tagName) {
|
||
return document.createElementNS(namespaceMap[namespace], tagName);
|
||
}
|
||
function createTextNode(text) {
|
||
return document.createTextNode(text);
|
||
}
|
||
function createComment(text) {
|
||
return document.createComment(text);
|
||
}
|
||
function insertBefore(parentNode, newNode, referenceNode) {
|
||
parentNode.insertBefore(newNode, referenceNode);
|
||
}
|
||
function removeChild(node, child) {
|
||
node.removeChild(child);
|
||
}
|
||
function appendChild(node, child) {
|
||
node.appendChild(child);
|
||
}
|
||
function parentNode(node) {
|
||
return node.parentNode;
|
||
}
|
||
function nextSibling(node) {
|
||
return node.nextSibling;
|
||
}
|
||
function tagName(node) {
|
||
return node.tagName;
|
||
}
|
||
function setTextContent(node, text) {
|
||
node.textContent = text;
|
||
}
|
||
function setStyleScope(node, scopeId) {
|
||
node.setAttribute(scopeId, '');
|
||
}
|
||
|
||
var nodeOps = /*#__PURE__*/Object.freeze({
|
||
__proto__: null,
|
||
createElement: createElement,
|
||
createElementNS: createElementNS,
|
||
createTextNode: createTextNode,
|
||
createComment: createComment,
|
||
insertBefore: insertBefore,
|
||
removeChild: removeChild,
|
||
appendChild: appendChild,
|
||
parentNode: parentNode,
|
||
nextSibling: nextSibling,
|
||
tagName: tagName,
|
||
setTextContent: setTextContent,
|
||
setStyleScope: setStyleScope
|
||
});
|
||
|
||
var ref = {
|
||
create: function (_, vnode) {
|
||
registerRef(vnode);
|
||
},
|
||
update: function (oldVnode, vnode) {
|
||
if (oldVnode.data.ref !== vnode.data.ref) {
|
||
registerRef(oldVnode, true);
|
||
registerRef(vnode);
|
||
}
|
||
},
|
||
destroy: function (vnode) {
|
||
registerRef(vnode, true);
|
||
}
|
||
};
|
||
function registerRef(vnode, isRemoval) {
|
||
var ref = vnode.data.ref;
|
||
if (!isDef(ref))
|
||
return;
|
||
var vm = vnode.context;
|
||
var refValue = vnode.componentInstance || vnode.elm;
|
||
var value = isRemoval ? null : refValue;
|
||
var $refsValue = isRemoval ? undefined : refValue;
|
||
if (isFunction(ref)) {
|
||
invokeWithErrorHandling(ref, vm, [value], vm, "template ref function");
|
||
return;
|
||
}
|
||
var isFor = vnode.data.refInFor;
|
||
var _isString = typeof ref === 'string' || typeof ref === 'number';
|
||
var _isRef = isRef(ref);
|
||
var refs = vm.$refs;
|
||
if (_isString || _isRef) {
|
||
if (isFor) {
|
||
var existing = _isString ? refs[ref] : ref.value;
|
||
if (isRemoval) {
|
||
isArray(existing) && remove$2(existing, refValue);
|
||
}
|
||
else {
|
||
if (!isArray(existing)) {
|
||
if (_isString) {
|
||
refs[ref] = [refValue];
|
||
setSetupRef(vm, ref, refs[ref]);
|
||
}
|
||
else {
|
||
ref.value = [refValue];
|
||
}
|
||
}
|
||
else if (!existing.includes(refValue)) {
|
||
existing.push(refValue);
|
||
}
|
||
}
|
||
}
|
||
else if (_isString) {
|
||
if (isRemoval && refs[ref] !== refValue) {
|
||
return;
|
||
}
|
||
refs[ref] = $refsValue;
|
||
setSetupRef(vm, ref, value);
|
||
}
|
||
else if (_isRef) {
|
||
if (isRemoval && ref.value !== refValue) {
|
||
return;
|
||
}
|
||
ref.value = value;
|
||
}
|
||
else if (true) {
|
||
warn("Invalid template ref type: ".concat(typeof ref));
|
||
}
|
||
}
|
||
}
|
||
function setSetupRef(_a, key, val) {
|
||
var _setupState = _a._setupState;
|
||
if (_setupState && hasOwn(_setupState, key)) {
|
||
if (isRef(_setupState[key])) {
|
||
_setupState[key].value = val;
|
||
}
|
||
else {
|
||
_setupState[key] = val;
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Virtual DOM patching algorithm based on Snabbdom by
|
||
* Simon Friis Vindum (@paldepind)
|
||
* Licensed under the MIT License
|
||
* https://github.com/paldepind/snabbdom/blob/master/LICENSE
|
||
*
|
||
* modified by Evan You (@yyx990803)
|
||
*
|
||
* Not type-checking this because this file is perf-critical and the cost
|
||
* of making flow understand it is not worth it.
|
||
*/
|
||
var emptyNode = new VNode('', {}, []);
|
||
var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
|
||
function sameVnode(a, b) {
|
||
return (a.key === b.key &&
|
||
a.asyncFactory === b.asyncFactory &&
|
||
((a.tag === b.tag &&
|
||
a.isComment === b.isComment &&
|
||
isDef(a.data) === isDef(b.data) &&
|
||
sameInputType(a, b)) ||
|
||
(isTrue(a.isAsyncPlaceholder) && isUndef(b.asyncFactory.error))));
|
||
}
|
||
function sameInputType(a, b) {
|
||
if (a.tag !== 'input')
|
||
return true;
|
||
var i;
|
||
var typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type;
|
||
var typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type;
|
||
return typeA === typeB || (isTextInputType(typeA) && isTextInputType(typeB));
|
||
}
|
||
function createKeyToOldIdx(children, beginIdx, endIdx) {
|
||
var i, key;
|
||
var map = {};
|
||
for (i = beginIdx; i <= endIdx; ++i) {
|
||
key = children[i].key;
|
||
if (isDef(key))
|
||
map[key] = i;
|
||
}
|
||
return map;
|
||
}
|
||
function createPatchFunction(backend) {
|
||
var i, j;
|
||
var cbs = {};
|
||
var modules = backend.modules, nodeOps = backend.nodeOps;
|
||
for (i = 0; i < hooks.length; ++i) {
|
||
cbs[hooks[i]] = [];
|
||
for (j = 0; j < modules.length; ++j) {
|
||
if (isDef(modules[j][hooks[i]])) {
|
||
cbs[hooks[i]].push(modules[j][hooks[i]]);
|
||
}
|
||
}
|
||
}
|
||
function emptyNodeAt(elm) {
|
||
return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);
|
||
}
|
||
function createRmCb(childElm, listeners) {
|
||
function remove() {
|
||
if (--remove.listeners === 0) {
|
||
removeNode(childElm);
|
||
}
|
||
}
|
||
remove.listeners = listeners;
|
||
return remove;
|
||
}
|
||
function removeNode(el) {
|
||
var parent = nodeOps.parentNode(el);
|
||
// element may have already been removed due to v-html / v-text
|
||
if (isDef(parent)) {
|
||
nodeOps.removeChild(parent, el);
|
||
}
|
||
}
|
||
function isUnknownElement(vnode, inVPre) {
|
||
return (!inVPre &&
|
||
!vnode.ns &&
|
||
!(config.ignoredElements.length &&
|
||
config.ignoredElements.some(function (ignore) {
|
||
return isRegExp(ignore)
|
||
? ignore.test(vnode.tag)
|
||
: ignore === vnode.tag;
|
||
})) &&
|
||
config.isUnknownElement(vnode.tag));
|
||
}
|
||
var creatingElmInVPre = 0;
|
||
function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested, ownerArray, index) {
|
||
if (isDef(vnode.elm) && isDef(ownerArray)) {
|
||
// This vnode was used in a previous render!
|
||
// now it's used as a new node, overwriting its elm would cause
|
||
// potential patch errors down the road when it's used as an insertion
|
||
// reference node. Instead, we clone the node on-demand before creating
|
||
// associated DOM element for it.
|
||
vnode = ownerArray[index] = cloneVNode(vnode);
|
||
}
|
||
vnode.isRootInsert = !nested; // for transition enter check
|
||
if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
|
||
return;
|
||
}
|
||
var data = vnode.data;
|
||
var children = vnode.children;
|
||
var tag = vnode.tag;
|
||
if (isDef(tag)) {
|
||
if (true) {
|
||
if (data && data.pre) {
|
||
creatingElmInVPre++;
|
||
}
|
||
if (isUnknownElement(vnode, creatingElmInVPre)) {
|
||
warn('Unknown custom element: <' +
|
||
tag +
|
||
'> - did you ' +
|
||
'register the component correctly? For recursive components, ' +
|
||
'make sure to provide the "name" option.', vnode.context);
|
||
}
|
||
}
|
||
vnode.elm = vnode.ns
|
||
? nodeOps.createElementNS(vnode.ns, tag)
|
||
: nodeOps.createElement(tag, vnode);
|
||
setScope(vnode);
|
||
createChildren(vnode, children, insertedVnodeQueue);
|
||
if (isDef(data)) {
|
||
invokeCreateHooks(vnode, insertedVnodeQueue);
|
||
}
|
||
insert(parentElm, vnode.elm, refElm);
|
||
if ( true && data && data.pre) {
|
||
creatingElmInVPre--;
|
||
}
|
||
}
|
||
else if (isTrue(vnode.isComment)) {
|
||
vnode.elm = nodeOps.createComment(vnode.text);
|
||
insert(parentElm, vnode.elm, refElm);
|
||
}
|
||
else {
|
||
vnode.elm = nodeOps.createTextNode(vnode.text);
|
||
insert(parentElm, vnode.elm, refElm);
|
||
}
|
||
}
|
||
function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
|
||
var i = vnode.data;
|
||
if (isDef(i)) {
|
||
var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
|
||
if (isDef((i = i.hook)) && isDef((i = i.init))) {
|
||
i(vnode, false /* hydrating */);
|
||
}
|
||
// after calling the init hook, if the vnode is a child component
|
||
// it should've created a child instance and mounted it. the child
|
||
// component also has set the placeholder vnode's elm.
|
||
// in that case we can just return the element and be done.
|
||
if (isDef(vnode.componentInstance)) {
|
||
initComponent(vnode, insertedVnodeQueue);
|
||
insert(parentElm, vnode.elm, refElm);
|
||
if (isTrue(isReactivated)) {
|
||
reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
|
||
}
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
function initComponent(vnode, insertedVnodeQueue) {
|
||
if (isDef(vnode.data.pendingInsert)) {
|
||
insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
|
||
vnode.data.pendingInsert = null;
|
||
}
|
||
vnode.elm = vnode.componentInstance.$el;
|
||
if (isPatchable(vnode)) {
|
||
invokeCreateHooks(vnode, insertedVnodeQueue);
|
||
setScope(vnode);
|
||
}
|
||
else {
|
||
// empty component root.
|
||
// skip all element-related modules except for ref (#3455)
|
||
registerRef(vnode);
|
||
// make sure to invoke the insert hook
|
||
insertedVnodeQueue.push(vnode);
|
||
}
|
||
}
|
||
function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
|
||
var i;
|
||
// hack for #4339: a reactivated component with inner transition
|
||
// does not trigger because the inner node's created hooks are not called
|
||
// again. It's not ideal to involve module-specific logic in here but
|
||
// there doesn't seem to be a better way to do it.
|
||
var innerNode = vnode;
|
||
while (innerNode.componentInstance) {
|
||
innerNode = innerNode.componentInstance._vnode;
|
||
if (isDef((i = innerNode.data)) && isDef((i = i.transition))) {
|
||
for (i = 0; i < cbs.activate.length; ++i) {
|
||
cbs.activate[i](emptyNode, innerNode);
|
||
}
|
||
insertedVnodeQueue.push(innerNode);
|
||
break;
|
||
}
|
||
}
|
||
// unlike a newly created component,
|
||
// a reactivated keep-alive component doesn't insert itself
|
||
insert(parentElm, vnode.elm, refElm);
|
||
}
|
||
function insert(parent, elm, ref) {
|
||
if (isDef(parent)) {
|
||
if (isDef(ref)) {
|
||
if (nodeOps.parentNode(ref) === parent) {
|
||
nodeOps.insertBefore(parent, elm, ref);
|
||
}
|
||
}
|
||
else {
|
||
nodeOps.appendChild(parent, elm);
|
||
}
|
||
}
|
||
}
|
||
function createChildren(vnode, children, insertedVnodeQueue) {
|
||
if (isArray(children)) {
|
||
if (true) {
|
||
checkDuplicateKeys(children);
|
||
}
|
||
for (var i_1 = 0; i_1 < children.length; ++i_1) {
|
||
createElm(children[i_1], insertedVnodeQueue, vnode.elm, null, true, children, i_1);
|
||
}
|
||
}
|
||
else if (isPrimitive(vnode.text)) {
|
||
nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
|
||
}
|
||
}
|
||
function isPatchable(vnode) {
|
||
while (vnode.componentInstance) {
|
||
vnode = vnode.componentInstance._vnode;
|
||
}
|
||
return isDef(vnode.tag);
|
||
}
|
||
function invokeCreateHooks(vnode, insertedVnodeQueue) {
|
||
for (var i_2 = 0; i_2 < cbs.create.length; ++i_2) {
|
||
cbs.create[i_2](emptyNode, vnode);
|
||
}
|
||
i = vnode.data.hook; // Reuse variable
|
||
if (isDef(i)) {
|
||
if (isDef(i.create))
|
||
i.create(emptyNode, vnode);
|
||
if (isDef(i.insert))
|
||
insertedVnodeQueue.push(vnode);
|
||
}
|
||
}
|
||
// set scope id attribute for scoped CSS.
|
||
// this is implemented as a special case to avoid the overhead
|
||
// of going through the normal attribute patching process.
|
||
function setScope(vnode) {
|
||
var i;
|
||
if (isDef((i = vnode.fnScopeId))) {
|
||
nodeOps.setStyleScope(vnode.elm, i);
|
||
}
|
||
else {
|
||
var ancestor = vnode;
|
||
while (ancestor) {
|
||
if (isDef((i = ancestor.context)) && isDef((i = i.$options._scopeId))) {
|
||
nodeOps.setStyleScope(vnode.elm, i);
|
||
}
|
||
ancestor = ancestor.parent;
|
||
}
|
||
}
|
||
// for slot content they should also get the scopeId from the host instance.
|
||
if (isDef((i = activeInstance)) &&
|
||
i !== vnode.context &&
|
||
i !== vnode.fnContext &&
|
||
isDef((i = i.$options._scopeId))) {
|
||
nodeOps.setStyleScope(vnode.elm, i);
|
||
}
|
||
}
|
||
function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
|
||
for (; startIdx <= endIdx; ++startIdx) {
|
||
createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
|
||
}
|
||
}
|
||
function invokeDestroyHook(vnode) {
|
||
var i, j;
|
||
var data = vnode.data;
|
||
if (isDef(data)) {
|
||
if (isDef((i = data.hook)) && isDef((i = i.destroy)))
|
||
i(vnode);
|
||
for (i = 0; i < cbs.destroy.length; ++i)
|
||
cbs.destroy[i](vnode);
|
||
}
|
||
if (isDef((i = vnode.children))) {
|
||
for (j = 0; j < vnode.children.length; ++j) {
|
||
invokeDestroyHook(vnode.children[j]);
|
||
}
|
||
}
|
||
}
|
||
function removeVnodes(vnodes, startIdx, endIdx) {
|
||
for (; startIdx <= endIdx; ++startIdx) {
|
||
var ch = vnodes[startIdx];
|
||
if (isDef(ch)) {
|
||
if (isDef(ch.tag)) {
|
||
removeAndInvokeRemoveHook(ch);
|
||
invokeDestroyHook(ch);
|
||
}
|
||
else {
|
||
// Text node
|
||
removeNode(ch.elm);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function removeAndInvokeRemoveHook(vnode, rm) {
|
||
if (isDef(rm) || isDef(vnode.data)) {
|
||
var i_3;
|
||
var listeners = cbs.remove.length + 1;
|
||
if (isDef(rm)) {
|
||
// we have a recursively passed down rm callback
|
||
// increase the listeners count
|
||
rm.listeners += listeners;
|
||
}
|
||
else {
|
||
// directly removing
|
||
rm = createRmCb(vnode.elm, listeners);
|
||
}
|
||
// recursively invoke hooks on child component root node
|
||
if (isDef((i_3 = vnode.componentInstance)) &&
|
||
isDef((i_3 = i_3._vnode)) &&
|
||
isDef(i_3.data)) {
|
||
removeAndInvokeRemoveHook(i_3, rm);
|
||
}
|
||
for (i_3 = 0; i_3 < cbs.remove.length; ++i_3) {
|
||
cbs.remove[i_3](vnode, rm);
|
||
}
|
||
if (isDef((i_3 = vnode.data.hook)) && isDef((i_3 = i_3.remove))) {
|
||
i_3(vnode, rm);
|
||
}
|
||
else {
|
||
rm();
|
||
}
|
||
}
|
||
else {
|
||
removeNode(vnode.elm);
|
||
}
|
||
}
|
||
function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
|
||
var oldStartIdx = 0;
|
||
var newStartIdx = 0;
|
||
var oldEndIdx = oldCh.length - 1;
|
||
var oldStartVnode = oldCh[0];
|
||
var oldEndVnode = oldCh[oldEndIdx];
|
||
var newEndIdx = newCh.length - 1;
|
||
var newStartVnode = newCh[0];
|
||
var newEndVnode = newCh[newEndIdx];
|
||
var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
|
||
// removeOnly is a special flag used only by <transition-group>
|
||
// to ensure removed elements stay in correct relative positions
|
||
// during leaving transitions
|
||
var canMove = !removeOnly;
|
||
if (true) {
|
||
checkDuplicateKeys(newCh);
|
||
}
|
||
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
||
if (isUndef(oldStartVnode)) {
|
||
oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
|
||
}
|
||
else if (isUndef(oldEndVnode)) {
|
||
oldEndVnode = oldCh[--oldEndIdx];
|
||
}
|
||
else if (sameVnode(oldStartVnode, newStartVnode)) {
|
||
patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
|
||
oldStartVnode = oldCh[++oldStartIdx];
|
||
newStartVnode = newCh[++newStartIdx];
|
||
}
|
||
else if (sameVnode(oldEndVnode, newEndVnode)) {
|
||
patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
|
||
oldEndVnode = oldCh[--oldEndIdx];
|
||
newEndVnode = newCh[--newEndIdx];
|
||
}
|
||
else if (sameVnode(oldStartVnode, newEndVnode)) {
|
||
// Vnode moved right
|
||
patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
|
||
canMove &&
|
||
nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
|
||
oldStartVnode = oldCh[++oldStartIdx];
|
||
newEndVnode = newCh[--newEndIdx];
|
||
}
|
||
else if (sameVnode(oldEndVnode, newStartVnode)) {
|
||
// Vnode moved left
|
||
patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
|
||
canMove &&
|
||
nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
|
||
oldEndVnode = oldCh[--oldEndIdx];
|
||
newStartVnode = newCh[++newStartIdx];
|
||
}
|
||
else {
|
||
if (isUndef(oldKeyToIdx))
|
||
oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
|
||
idxInOld = isDef(newStartVnode.key)
|
||
? oldKeyToIdx[newStartVnode.key]
|
||
: findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
|
||
if (isUndef(idxInOld)) {
|
||
// New element
|
||
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
|
||
}
|
||
else {
|
||
vnodeToMove = oldCh[idxInOld];
|
||
if (sameVnode(vnodeToMove, newStartVnode)) {
|
||
patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
|
||
oldCh[idxInOld] = undefined;
|
||
canMove &&
|
||
nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
|
||
}
|
||
else {
|
||
// same key but different element. treat as new element
|
||
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
|
||
}
|
||
}
|
||
newStartVnode = newCh[++newStartIdx];
|
||
}
|
||
}
|
||
if (oldStartIdx > oldEndIdx) {
|
||
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
|
||
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
|
||
}
|
||
else if (newStartIdx > newEndIdx) {
|
||
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
||
}
|
||
}
|
||
function checkDuplicateKeys(children) {
|
||
var seenKeys = {};
|
||
for (var i_4 = 0; i_4 < children.length; i_4++) {
|
||
var vnode = children[i_4];
|
||
var key = vnode.key;
|
||
if (isDef(key)) {
|
||
if (seenKeys[key]) {
|
||
warn("Duplicate keys detected: '".concat(key, "'. This may cause an update error."), vnode.context);
|
||
}
|
||
else {
|
||
seenKeys[key] = true;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function findIdxInOld(node, oldCh, start, end) {
|
||
for (var i_5 = start; i_5 < end; i_5++) {
|
||
var c = oldCh[i_5];
|
||
if (isDef(c) && sameVnode(node, c))
|
||
return i_5;
|
||
}
|
||
}
|
||
function patchVnode(oldVnode, vnode, insertedVnodeQueue, ownerArray, index, removeOnly) {
|
||
if (oldVnode === vnode) {
|
||
return;
|
||
}
|
||
if (isDef(vnode.elm) && isDef(ownerArray)) {
|
||
// clone reused vnode
|
||
vnode = ownerArray[index] = cloneVNode(vnode);
|
||
}
|
||
var elm = (vnode.elm = oldVnode.elm);
|
||
if (isTrue(oldVnode.isAsyncPlaceholder)) {
|
||
if (isDef(vnode.asyncFactory.resolved)) {
|
||
hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
|
||
}
|
||
else {
|
||
vnode.isAsyncPlaceholder = true;
|
||
}
|
||
return;
|
||
}
|
||
// reuse element for static trees.
|
||
// note we only do this if the vnode is cloned -
|
||
// if the new node is not cloned it means the render functions have been
|
||
// reset by the hot-reload-api and we need to do a proper re-render.
|
||
if (isTrue(vnode.isStatic) &&
|
||
isTrue(oldVnode.isStatic) &&
|
||
vnode.key === oldVnode.key &&
|
||
(isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {
|
||
vnode.componentInstance = oldVnode.componentInstance;
|
||
return;
|
||
}
|
||
var i;
|
||
var data = vnode.data;
|
||
if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) {
|
||
i(oldVnode, vnode);
|
||
}
|
||
var oldCh = oldVnode.children;
|
||
var ch = vnode.children;
|
||
if (isDef(data) && isPatchable(vnode)) {
|
||
for (i = 0; i < cbs.update.length; ++i)
|
||
cbs.update[i](oldVnode, vnode);
|
||
if (isDef((i = data.hook)) && isDef((i = i.update)))
|
||
i(oldVnode, vnode);
|
||
}
|
||
if (isUndef(vnode.text)) {
|
||
if (isDef(oldCh) && isDef(ch)) {
|
||
if (oldCh !== ch)
|
||
updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);
|
||
}
|
||
else if (isDef(ch)) {
|
||
if (true) {
|
||
checkDuplicateKeys(ch);
|
||
}
|
||
if (isDef(oldVnode.text))
|
||
nodeOps.setTextContent(elm, '');
|
||
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
|
||
}
|
||
else if (isDef(oldCh)) {
|
||
removeVnodes(oldCh, 0, oldCh.length - 1);
|
||
}
|
||
else if (isDef(oldVnode.text)) {
|
||
nodeOps.setTextContent(elm, '');
|
||
}
|
||
}
|
||
else if (oldVnode.text !== vnode.text) {
|
||
nodeOps.setTextContent(elm, vnode.text);
|
||
}
|
||
if (isDef(data)) {
|
||
if (isDef((i = data.hook)) && isDef((i = i.postpatch)))
|
||
i(oldVnode, vnode);
|
||
}
|
||
}
|
||
function invokeInsertHook(vnode, queue, initial) {
|
||
// delay insert hooks for component root nodes, invoke them after the
|
||
// element is really inserted
|
||
if (isTrue(initial) && isDef(vnode.parent)) {
|
||
vnode.parent.data.pendingInsert = queue;
|
||
}
|
||
else {
|
||
for (var i_6 = 0; i_6 < queue.length; ++i_6) {
|
||
queue[i_6].data.hook.insert(queue[i_6]);
|
||
}
|
||
}
|
||
}
|
||
var hydrationBailed = false;
|
||
// list of modules that can skip create hook during hydration because they
|
||
// are already rendered on the client or has no need for initialization
|
||
// Note: style is excluded because it relies on initial clone for future
|
||
// deep updates (#7063).
|
||
var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
|
||
// Note: this is a browser-only function so we can assume elms are DOM nodes.
|
||
function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {
|
||
var i;
|
||
var tag = vnode.tag, data = vnode.data, children = vnode.children;
|
||
inVPre = inVPre || (data && data.pre);
|
||
vnode.elm = elm;
|
||
if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
|
||
vnode.isAsyncPlaceholder = true;
|
||
return true;
|
||
}
|
||
// assert node match
|
||
if (true) {
|
||
if (!assertNodeMatch(elm, vnode, inVPre)) {
|
||
return false;
|
||
}
|
||
}
|
||
if (isDef(data)) {
|
||
if (isDef((i = data.hook)) && isDef((i = i.init)))
|
||
i(vnode, true /* hydrating */);
|
||
if (isDef((i = vnode.componentInstance))) {
|
||
// child component. it should have hydrated its own tree.
|
||
initComponent(vnode, insertedVnodeQueue);
|
||
return true;
|
||
}
|
||
}
|
||
if (isDef(tag)) {
|
||
if (isDef(children)) {
|
||
// empty element, allow client to pick up and populate children
|
||
if (!elm.hasChildNodes()) {
|
||
createChildren(vnode, children, insertedVnodeQueue);
|
||
}
|
||
else {
|
||
// v-html and domProps: innerHTML
|
||
if (isDef((i = data)) &&
|
||
isDef((i = i.domProps)) &&
|
||
isDef((i = i.innerHTML))) {
|
||
if (i !== elm.innerHTML) {
|
||
/* istanbul ignore if */
|
||
if ( true &&
|
||
typeof console !== 'undefined' &&
|
||
!hydrationBailed) {
|
||
hydrationBailed = true;
|
||
console.warn('Parent: ', elm);
|
||
console.warn('server innerHTML: ', i);
|
||
console.warn('client innerHTML: ', elm.innerHTML);
|
||
}
|
||
return false;
|
||
}
|
||
}
|
||
else {
|
||
// iterate and compare children lists
|
||
var childrenMatch = true;
|
||
var childNode = elm.firstChild;
|
||
for (var i_7 = 0; i_7 < children.length; i_7++) {
|
||
if (!childNode ||
|
||
!hydrate(childNode, children[i_7], insertedVnodeQueue, inVPre)) {
|
||
childrenMatch = false;
|
||
break;
|
||
}
|
||
childNode = childNode.nextSibling;
|
||
}
|
||
// if childNode is not null, it means the actual childNodes list is
|
||
// longer than the virtual children list.
|
||
if (!childrenMatch || childNode) {
|
||
/* istanbul ignore if */
|
||
if ( true &&
|
||
typeof console !== 'undefined' &&
|
||
!hydrationBailed) {
|
||
hydrationBailed = true;
|
||
console.warn('Parent: ', elm);
|
||
console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
|
||
}
|
||
return false;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if (isDef(data)) {
|
||
var fullInvoke = false;
|
||
for (var key in data) {
|
||
if (!isRenderedModule(key)) {
|
||
fullInvoke = true;
|
||
invokeCreateHooks(vnode, insertedVnodeQueue);
|
||
break;
|
||
}
|
||
}
|
||
if (!fullInvoke && data['class']) {
|
||
// ensure collecting deps for deep class bindings for future updates
|
||
traverse(data['class']);
|
||
}
|
||
}
|
||
}
|
||
else if (elm.data !== vnode.text) {
|
||
elm.data = vnode.text;
|
||
}
|
||
return true;
|
||
}
|
||
function assertNodeMatch(node, vnode, inVPre) {
|
||
if (isDef(vnode.tag)) {
|
||
return (vnode.tag.indexOf('vue-component') === 0 ||
|
||
(!isUnknownElement(vnode, inVPre) &&
|
||
vnode.tag.toLowerCase() ===
|
||
(node.tagName && node.tagName.toLowerCase())));
|
||
}
|
||
else {
|
||
return node.nodeType === (vnode.isComment ? 8 : 3);
|
||
}
|
||
}
|
||
return function patch(oldVnode, vnode, hydrating, removeOnly) {
|
||
if (isUndef(vnode)) {
|
||
if (isDef(oldVnode))
|
||
invokeDestroyHook(oldVnode);
|
||
return;
|
||
}
|
||
var isInitialPatch = false;
|
||
var insertedVnodeQueue = [];
|
||
if (isUndef(oldVnode)) {
|
||
// empty mount (likely as component), create new root element
|
||
isInitialPatch = true;
|
||
createElm(vnode, insertedVnodeQueue);
|
||
}
|
||
else {
|
||
var isRealElement = isDef(oldVnode.nodeType);
|
||
if (!isRealElement && sameVnode(oldVnode, vnode)) {
|
||
// patch existing root node
|
||
patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
|
||
}
|
||
else {
|
||
if (isRealElement) {
|
||
// mounting to a real element
|
||
// check if this is server-rendered content and if we can perform
|
||
// a successful hydration.
|
||
if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
|
||
oldVnode.removeAttribute(SSR_ATTR);
|
||
hydrating = true;
|
||
}
|
||
if (isTrue(hydrating)) {
|
||
if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
|
||
invokeInsertHook(vnode, insertedVnodeQueue, true);
|
||
return oldVnode;
|
||
}
|
||
else if (true) {
|
||
warn('The client-side rendered virtual DOM tree is not matching ' +
|
||
'server-rendered content. This is likely caused by incorrect ' +
|
||
'HTML markup, for example nesting block-level elements inside ' +
|
||
'<p>, or missing <tbody>. Bailing hydration and performing ' +
|
||
'full client-side render.');
|
||
}
|
||
}
|
||
// either not server-rendered, or hydration failed.
|
||
// create an empty node and replace it
|
||
oldVnode = emptyNodeAt(oldVnode);
|
||
}
|
||
// replacing existing element
|
||
var oldElm = oldVnode.elm;
|
||
var parentElm = nodeOps.parentNode(oldElm);
|
||
// create new node
|
||
createElm(vnode, insertedVnodeQueue,
|
||
// extremely rare edge case: do not insert if old element is in a
|
||
// leaving transition. Only happens when combining transition +
|
||
// keep-alive + HOCs. (#4590)
|
||
oldElm._leaveCb ? null : parentElm, nodeOps.nextSibling(oldElm));
|
||
// update parent placeholder node element, recursively
|
||
if (isDef(vnode.parent)) {
|
||
var ancestor = vnode.parent;
|
||
var patchable = isPatchable(vnode);
|
||
while (ancestor) {
|
||
for (var i_8 = 0; i_8 < cbs.destroy.length; ++i_8) {
|
||
cbs.destroy[i_8](ancestor);
|
||
}
|
||
ancestor.elm = vnode.elm;
|
||
if (patchable) {
|
||
for (var i_9 = 0; i_9 < cbs.create.length; ++i_9) {
|
||
cbs.create[i_9](emptyNode, ancestor);
|
||
}
|
||
// #6513
|
||
// invoke insert hooks that may have been merged by create hooks.
|
||
// e.g. for directives that uses the "inserted" hook.
|
||
var insert_1 = ancestor.data.hook.insert;
|
||
if (insert_1.merged) {
|
||
// start at index 1 to avoid re-invoking component mounted hook
|
||
// clone insert hooks to avoid being mutated during iteration.
|
||
// e.g. for customed directives under transition group.
|
||
var cloned = insert_1.fns.slice(1);
|
||
for (var i_10 = 0; i_10 < cloned.length; i_10++) {
|
||
cloned[i_10]();
|
||
}
|
||
}
|
||
}
|
||
else {
|
||
registerRef(ancestor);
|
||
}
|
||
ancestor = ancestor.parent;
|
||
}
|
||
}
|
||
// destroy old node
|
||
if (isDef(parentElm)) {
|
||
removeVnodes([oldVnode], 0, 0);
|
||
}
|
||
else if (isDef(oldVnode.tag)) {
|
||
invokeDestroyHook(oldVnode);
|
||
}
|
||
}
|
||
}
|
||
invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
|
||
return vnode.elm;
|
||
};
|
||
}
|
||
|
||
var directives = {
|
||
create: updateDirectives,
|
||
update: updateDirectives,
|
||
destroy: function unbindDirectives(vnode) {
|
||
// @ts-expect-error emptyNode is not VNodeWithData
|
||
updateDirectives(vnode, emptyNode);
|
||
}
|
||
};
|
||
function updateDirectives(oldVnode, vnode) {
|
||
if (oldVnode.data.directives || vnode.data.directives) {
|
||
_update(oldVnode, vnode);
|
||
}
|
||
}
|
||
function _update(oldVnode, vnode) {
|
||
var isCreate = oldVnode === emptyNode;
|
||
var isDestroy = vnode === emptyNode;
|
||
var oldDirs = normalizeDirectives(oldVnode.data.directives, oldVnode.context);
|
||
var newDirs = normalizeDirectives(vnode.data.directives, vnode.context);
|
||
var dirsWithInsert = [];
|
||
var dirsWithPostpatch = [];
|
||
var key, oldDir, dir;
|
||
for (key in newDirs) {
|
||
oldDir = oldDirs[key];
|
||
dir = newDirs[key];
|
||
if (!oldDir) {
|
||
// new directive, bind
|
||
callHook(dir, 'bind', vnode, oldVnode);
|
||
if (dir.def && dir.def.inserted) {
|
||
dirsWithInsert.push(dir);
|
||
}
|
||
}
|
||
else {
|
||
// existing directive, update
|
||
dir.oldValue = oldDir.value;
|
||
dir.oldArg = oldDir.arg;
|
||
callHook(dir, 'update', vnode, oldVnode);
|
||
if (dir.def && dir.def.componentUpdated) {
|
||
dirsWithPostpatch.push(dir);
|
||
}
|
||
}
|
||
}
|
||
if (dirsWithInsert.length) {
|
||
var callInsert = function () {
|
||
for (var i = 0; i < dirsWithInsert.length; i++) {
|
||
callHook(dirsWithInsert[i], 'inserted', vnode, oldVnode);
|
||
}
|
||
};
|
||
if (isCreate) {
|
||
mergeVNodeHook(vnode, 'insert', callInsert);
|
||
}
|
||
else {
|
||
callInsert();
|
||
}
|
||
}
|
||
if (dirsWithPostpatch.length) {
|
||
mergeVNodeHook(vnode, 'postpatch', function () {
|
||
for (var i = 0; i < dirsWithPostpatch.length; i++) {
|
||
callHook(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
|
||
}
|
||
});
|
||
}
|
||
if (!isCreate) {
|
||
for (key in oldDirs) {
|
||
if (!newDirs[key]) {
|
||
// no longer present, unbind
|
||
callHook(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
var emptyModifiers = Object.create(null);
|
||
function normalizeDirectives(dirs, vm) {
|
||
var res = Object.create(null);
|
||
if (!dirs) {
|
||
// $flow-disable-line
|
||
return res;
|
||
}
|
||
var i, dir;
|
||
for (i = 0; i < dirs.length; i++) {
|
||
dir = dirs[i];
|
||
if (!dir.modifiers) {
|
||
// $flow-disable-line
|
||
dir.modifiers = emptyModifiers;
|
||
}
|
||
res[getRawDirName(dir)] = dir;
|
||
if (vm._setupState && vm._setupState.__sfc) {
|
||
var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
|
||
if (typeof setupDef === 'function') {
|
||
dir.def = {
|
||
bind: setupDef,
|
||
update: setupDef,
|
||
};
|
||
}
|
||
else {
|
||
dir.def = setupDef;
|
||
}
|
||
}
|
||
dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
|
||
}
|
||
// $flow-disable-line
|
||
return res;
|
||
}
|
||
function getRawDirName(dir) {
|
||
return (dir.rawName || "".concat(dir.name, ".").concat(Object.keys(dir.modifiers || {}).join('.')));
|
||
}
|
||
function callHook(dir, hook, vnode, oldVnode, isDestroy) {
|
||
var fn = dir.def && dir.def[hook];
|
||
if (fn) {
|
||
try {
|
||
fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
|
||
}
|
||
catch (e) {
|
||
handleError(e, vnode.context, "directive ".concat(dir.name, " ").concat(hook, " hook"));
|
||
}
|
||
}
|
||
}
|
||
|
||
var baseModules = [ref, directives];
|
||
|
||
function updateAttrs(oldVnode, vnode) {
|
||
var opts = vnode.componentOptions;
|
||
if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
|
||
return;
|
||
}
|
||
if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
|
||
return;
|
||
}
|
||
var key, cur, old;
|
||
var elm = vnode.elm;
|
||
var oldAttrs = oldVnode.data.attrs || {};
|
||
var attrs = vnode.data.attrs || {};
|
||
// clone observed objects, as the user probably wants to mutate it
|
||
if (isDef(attrs.__ob__) || isTrue(attrs._v_attr_proxy)) {
|
||
attrs = vnode.data.attrs = extend({}, attrs);
|
||
}
|
||
for (key in attrs) {
|
||
cur = attrs[key];
|
||
old = oldAttrs[key];
|
||
if (old !== cur) {
|
||
setAttr(elm, key, cur, vnode.data.pre);
|
||
}
|
||
}
|
||
// #4391: in IE9, setting type can reset value for input[type=radio]
|
||
// #6666: IE/Edge forces progress value down to 1 before setting a max
|
||
/* istanbul ignore if */
|
||
if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
|
||
setAttr(elm, 'value', attrs.value);
|
||
}
|
||
for (key in oldAttrs) {
|
||
if (isUndef(attrs[key])) {
|
||
if (isXlink(key)) {
|
||
elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
|
||
}
|
||
else if (!isEnumeratedAttr(key)) {
|
||
elm.removeAttribute(key);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function setAttr(el, key, value, isInPre) {
|
||
if (isInPre || el.tagName.indexOf('-') > -1) {
|
||
baseSetAttr(el, key, value);
|
||
}
|
||
else if (isBooleanAttr(key)) {
|
||
// set attribute for blank value
|
||
// e.g. <option disabled>Select one</option>
|
||
if (isFalsyAttrValue(value)) {
|
||
el.removeAttribute(key);
|
||
}
|
||
else {
|
||
// technically allowfullscreen is a boolean attribute for <iframe>,
|
||
// but Flash expects a value of "true" when used on <embed> tag
|
||
value = key === 'allowfullscreen' && el.tagName === 'EMBED' ? 'true' : key;
|
||
el.setAttribute(key, value);
|
||
}
|
||
}
|
||
else if (isEnumeratedAttr(key)) {
|
||
el.setAttribute(key, convertEnumeratedValue(key, value));
|
||
}
|
||
else if (isXlink(key)) {
|
||
if (isFalsyAttrValue(value)) {
|
||
el.removeAttributeNS(xlinkNS, getXlinkProp(key));
|
||
}
|
||
else {
|
||
el.setAttributeNS(xlinkNS, key, value);
|
||
}
|
||
}
|
||
else {
|
||
baseSetAttr(el, key, value);
|
||
}
|
||
}
|
||
function baseSetAttr(el, key, value) {
|
||
if (isFalsyAttrValue(value)) {
|
||
el.removeAttribute(key);
|
||
}
|
||
else {
|
||
// #7138: IE10 & 11 fires input event when setting placeholder on
|
||
// <textarea>... block the first input event and remove the blocker
|
||
// immediately.
|
||
/* istanbul ignore if */
|
||
if (isIE &&
|
||
!isIE9 &&
|
||
el.tagName === 'TEXTAREA' &&
|
||
key === 'placeholder' &&
|
||
value !== '' &&
|
||
!el.__ieph) {
|
||
var blocker_1 = function (e) {
|
||
e.stopImmediatePropagation();
|
||
el.removeEventListener('input', blocker_1);
|
||
};
|
||
el.addEventListener('input', blocker_1);
|
||
// $flow-disable-line
|
||
el.__ieph = true; /* IE placeholder patched */
|
||
}
|
||
el.setAttribute(key, value);
|
||
}
|
||
}
|
||
var attrs = {
|
||
create: updateAttrs,
|
||
update: updateAttrs
|
||
};
|
||
|
||
function updateClass(oldVnode, vnode) {
|
||
var el = vnode.elm;
|
||
var data = vnode.data;
|
||
var oldData = oldVnode.data;
|
||
if (isUndef(data.staticClass) &&
|
||
isUndef(data.class) &&
|
||
(isUndef(oldData) ||
|
||
(isUndef(oldData.staticClass) && isUndef(oldData.class)))) {
|
||
return;
|
||
}
|
||
var cls = genClassForVnode(vnode);
|
||
// handle transition classes
|
||
var transitionClass = el._transitionClasses;
|
||
if (isDef(transitionClass)) {
|
||
cls = concat(cls, stringifyClass(transitionClass));
|
||
}
|
||
// set the class
|
||
if (cls !== el._prevClass) {
|
||
el.setAttribute('class', cls);
|
||
el._prevClass = cls;
|
||
}
|
||
}
|
||
var klass = {
|
||
create: updateClass,
|
||
update: updateClass
|
||
};
|
||
|
||
// in some cases, the event used has to be determined at runtime
|
||
// so we used some reserved tokens during compile.
|
||
var RANGE_TOKEN = '__r';
|
||
var CHECKBOX_RADIO_TOKEN = '__c';
|
||
|
||
// normalize v-model event tokens that can only be determined at runtime.
|
||
// it's important to place the event as the first in the array because
|
||
// the whole point is ensuring the v-model callback gets called before
|
||
// user-attached handlers.
|
||
function normalizeEvents(on) {
|
||
/* istanbul ignore if */
|
||
if (isDef(on[RANGE_TOKEN])) {
|
||
// IE input[type=range] only supports `change` event
|
||
var event_1 = isIE ? 'change' : 'input';
|
||
on[event_1] = [].concat(on[RANGE_TOKEN], on[event_1] || []);
|
||
delete on[RANGE_TOKEN];
|
||
}
|
||
// This was originally intended to fix #4521 but no longer necessary
|
||
// after 2.5. Keeping it for backwards compat with generated code from < 2.4
|
||
/* istanbul ignore if */
|
||
if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
|
||
on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
|
||
delete on[CHECKBOX_RADIO_TOKEN];
|
||
}
|
||
}
|
||
var target;
|
||
function createOnceHandler(event, handler, capture) {
|
||
var _target = target; // save current target element in closure
|
||
return function onceHandler() {
|
||
var res = handler.apply(null, arguments);
|
||
if (res !== null) {
|
||
remove(event, onceHandler, capture, _target);
|
||
}
|
||
};
|
||
}
|
||
// #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
|
||
// implementation and does not fire microtasks in between event propagation, so
|
||
// safe to exclude.
|
||
var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
|
||
function add(name, handler, capture, passive) {
|
||
// async edge case #6566: inner click event triggers patch, event handler
|
||
// attached to outer element during patch, and triggered again. This
|
||
// happens because browsers fire microtask ticks between event propagation.
|
||
// the solution is simple: we save the timestamp when a handler is attached,
|
||
// and the handler would only fire if the event passed to it was fired
|
||
// AFTER it was attached.
|
||
if (useMicrotaskFix) {
|
||
var attachedTimestamp_1 = currentFlushTimestamp;
|
||
var original_1 = handler;
|
||
//@ts-expect-error
|
||
handler = original_1._wrapper = function (e) {
|
||
if (
|
||
// no bubbling, should always fire.
|
||
// this is just a safety net in case event.timeStamp is unreliable in
|
||
// certain weird environments...
|
||
e.target === e.currentTarget ||
|
||
// event is fired after handler attachment
|
||
e.timeStamp >= attachedTimestamp_1 ||
|
||
// bail for environments that have buggy event.timeStamp implementations
|
||
// #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
|
||
// #9681 QtWebEngine event.timeStamp is negative value
|
||
e.timeStamp <= 0 ||
|
||
// #9448 bail if event is fired in another document in a multi-page
|
||
// electron/nw.js app, since event.timeStamp will be using a different
|
||
// starting reference
|
||
e.target.ownerDocument !== document) {
|
||
return original_1.apply(this, arguments);
|
||
}
|
||
};
|
||
}
|
||
target.addEventListener(name, handler, supportsPassive ? { capture: capture, passive: passive } : capture);
|
||
}
|
||
function remove(name, handler, capture, _target) {
|
||
(_target || target).removeEventListener(name,
|
||
//@ts-expect-error
|
||
handler._wrapper || handler, capture);
|
||
}
|
||
function updateDOMListeners(oldVnode, vnode) {
|
||
if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
|
||
return;
|
||
}
|
||
var on = vnode.data.on || {};
|
||
var oldOn = oldVnode.data.on || {};
|
||
// vnode is empty when removing all listeners,
|
||
// and use old vnode dom element
|
||
target = vnode.elm || oldVnode.elm;
|
||
normalizeEvents(on);
|
||
updateListeners(on, oldOn, add, remove, createOnceHandler, vnode.context);
|
||
target = undefined;
|
||
}
|
||
var events = {
|
||
create: updateDOMListeners,
|
||
update: updateDOMListeners,
|
||
// @ts-expect-error emptyNode has actually data
|
||
destroy: function (vnode) { return updateDOMListeners(vnode, emptyNode); }
|
||
};
|
||
|
||
var svgContainer;
|
||
function updateDOMProps(oldVnode, vnode) {
|
||
if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
|
||
return;
|
||
}
|
||
var key, cur;
|
||
var elm = vnode.elm;
|
||
var oldProps = oldVnode.data.domProps || {};
|
||
var props = vnode.data.domProps || {};
|
||
// clone observed objects, as the user probably wants to mutate it
|
||
if (isDef(props.__ob__) || isTrue(props._v_attr_proxy)) {
|
||
props = vnode.data.domProps = extend({}, props);
|
||
}
|
||
for (key in oldProps) {
|
||
if (!(key in props)) {
|
||
elm[key] = '';
|
||
}
|
||
}
|
||
for (key in props) {
|
||
cur = props[key];
|
||
// ignore children if the node has textContent or innerHTML,
|
||
// as these will throw away existing DOM nodes and cause removal errors
|
||
// on subsequent patches (#3360)
|
||
if (key === 'textContent' || key === 'innerHTML') {
|
||
if (vnode.children)
|
||
vnode.children.length = 0;
|
||
if (cur === oldProps[key])
|
||
continue;
|
||
// #6601 work around Chrome version <= 55 bug where single textNode
|
||
// replaced by innerHTML/textContent retains its parentNode property
|
||
if (elm.childNodes.length === 1) {
|
||
elm.removeChild(elm.childNodes[0]);
|
||
}
|
||
}
|
||
if (key === 'value' && elm.tagName !== 'PROGRESS') {
|
||
// store value as _value as well since
|
||
// non-string values will be stringified
|
||
elm._value = cur;
|
||
// avoid resetting cursor position when value is the same
|
||
var strCur = isUndef(cur) ? '' : String(cur);
|
||
if (shouldUpdateValue(elm, strCur)) {
|
||
elm.value = strCur;
|
||
}
|
||
}
|
||
else if (key === 'innerHTML' &&
|
||
isSVG(elm.tagName) &&
|
||
isUndef(elm.innerHTML)) {
|
||
// IE doesn't support innerHTML for SVG elements
|
||
svgContainer = svgContainer || document.createElement('div');
|
||
svgContainer.innerHTML = "<svg>".concat(cur, "</svg>");
|
||
var svg = svgContainer.firstChild;
|
||
while (elm.firstChild) {
|
||
elm.removeChild(elm.firstChild);
|
||
}
|
||
while (svg.firstChild) {
|
||
elm.appendChild(svg.firstChild);
|
||
}
|
||
}
|
||
else if (
|
||
// skip the update if old and new VDOM state is the same.
|
||
// `value` is handled separately because the DOM value may be temporarily
|
||
// out of sync with VDOM state due to focus, composition and modifiers.
|
||
// This #4521 by skipping the unnecessary `checked` update.
|
||
cur !== oldProps[key]) {
|
||
// some property updates can throw
|
||
// e.g. `value` on <progress> w/ non-finite value
|
||
try {
|
||
elm[key] = cur;
|
||
}
|
||
catch (e) { }
|
||
}
|
||
}
|
||
}
|
||
function shouldUpdateValue(elm, checkVal) {
|
||
return (
|
||
//@ts-expect-error
|
||
!elm.composing &&
|
||
(elm.tagName === 'OPTION' ||
|
||
isNotInFocusAndDirty(elm, checkVal) ||
|
||
isDirtyWithModifiers(elm, checkVal)));
|
||
}
|
||
function isNotInFocusAndDirty(elm, checkVal) {
|
||
// return true when textbox (.number and .trim) loses focus and its value is
|
||
// not equal to the updated value
|
||
var notInFocus = true;
|
||
// #6157
|
||
// work around IE bug when accessing document.activeElement in an iframe
|
||
try {
|
||
notInFocus = document.activeElement !== elm;
|
||
}
|
||
catch (e) { }
|
||
return notInFocus && elm.value !== checkVal;
|
||
}
|
||
function isDirtyWithModifiers(elm, newVal) {
|
||
var value = elm.value;
|
||
var modifiers = elm._vModifiers; // injected by v-model runtime
|
||
if (isDef(modifiers)) {
|
||
if (modifiers.number) {
|
||
return toNumber(value) !== toNumber(newVal);
|
||
}
|
||
if (modifiers.trim) {
|
||
return value.trim() !== newVal.trim();
|
||
}
|
||
}
|
||
return value !== newVal;
|
||
}
|
||
var domProps = {
|
||
create: updateDOMProps,
|
||
update: updateDOMProps
|
||
};
|
||
|
||
var parseStyleText = cached(function (cssText) {
|
||
var res = {};
|
||
var listDelimiter = /;(?![^(]*\))/g;
|
||
var propertyDelimiter = /:(.+)/;
|
||
cssText.split(listDelimiter).forEach(function (item) {
|
||
if (item) {
|
||
var tmp = item.split(propertyDelimiter);
|
||
tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
|
||
}
|
||
});
|
||
return res;
|
||
});
|
||
// merge static and dynamic style data on the same vnode
|
||
function normalizeStyleData(data) {
|
||
var style = normalizeStyleBinding(data.style);
|
||
// static style is pre-processed into an object during compilation
|
||
// and is always a fresh object, so it's safe to merge into it
|
||
return data.staticStyle ? extend(data.staticStyle, style) : style;
|
||
}
|
||
// normalize possible array / string values into Object
|
||
function normalizeStyleBinding(bindingStyle) {
|
||
if (Array.isArray(bindingStyle)) {
|
||
return toObject(bindingStyle);
|
||
}
|
||
if (typeof bindingStyle === 'string') {
|
||
return parseStyleText(bindingStyle);
|
||
}
|
||
return bindingStyle;
|
||
}
|
||
/**
|
||
* parent component style should be after child's
|
||
* so that parent component's style could override it
|
||
*/
|
||
function getStyle(vnode, checkChild) {
|
||
var res = {};
|
||
var styleData;
|
||
if (checkChild) {
|
||
var childNode = vnode;
|
||
while (childNode.componentInstance) {
|
||
childNode = childNode.componentInstance._vnode;
|
||
if (childNode &&
|
||
childNode.data &&
|
||
(styleData = normalizeStyleData(childNode.data))) {
|
||
extend(res, styleData);
|
||
}
|
||
}
|
||
}
|
||
if ((styleData = normalizeStyleData(vnode.data))) {
|
||
extend(res, styleData);
|
||
}
|
||
var parentNode = vnode;
|
||
// @ts-expect-error parentNode.parent not VNodeWithData
|
||
while ((parentNode = parentNode.parent)) {
|
||
if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
|
||
extend(res, styleData);
|
||
}
|
||
}
|
||
return res;
|
||
}
|
||
|
||
var cssVarRE = /^--/;
|
||
var importantRE = /\s*!important$/;
|
||
var setProp = function (el, name, val) {
|
||
/* istanbul ignore if */
|
||
if (cssVarRE.test(name)) {
|
||
el.style.setProperty(name, val);
|
||
}
|
||
else if (importantRE.test(val)) {
|
||
el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
|
||
}
|
||
else {
|
||
var normalizedName = normalize(name);
|
||
if (Array.isArray(val)) {
|
||
// Support values array created by autoprefixer, e.g.
|
||
// {display: ["-webkit-box", "-ms-flexbox", "flex"]}
|
||
// Set them one by one, and the browser will only set those it can recognize
|
||
for (var i = 0, len = val.length; i < len; i++) {
|
||
el.style[normalizedName] = val[i];
|
||
}
|
||
}
|
||
else {
|
||
el.style[normalizedName] = val;
|
||
}
|
||
}
|
||
};
|
||
var vendorNames = ['Webkit', 'Moz', 'ms'];
|
||
var emptyStyle;
|
||
var normalize = cached(function (prop) {
|
||
emptyStyle = emptyStyle || document.createElement('div').style;
|
||
prop = camelize(prop);
|
||
if (prop !== 'filter' && prop in emptyStyle) {
|
||
return prop;
|
||
}
|
||
var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
|
||
for (var i = 0; i < vendorNames.length; i++) {
|
||
var name_1 = vendorNames[i] + capName;
|
||
if (name_1 in emptyStyle) {
|
||
return name_1;
|
||
}
|
||
}
|
||
});
|
||
function updateStyle(oldVnode, vnode) {
|
||
var data = vnode.data;
|
||
var oldData = oldVnode.data;
|
||
if (isUndef(data.staticStyle) &&
|
||
isUndef(data.style) &&
|
||
isUndef(oldData.staticStyle) &&
|
||
isUndef(oldData.style)) {
|
||
return;
|
||
}
|
||
var cur, name;
|
||
var el = vnode.elm;
|
||
var oldStaticStyle = oldData.staticStyle;
|
||
var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
|
||
// if static style exists, stylebinding already merged into it when doing normalizeStyleData
|
||
var oldStyle = oldStaticStyle || oldStyleBinding;
|
||
var style = normalizeStyleBinding(vnode.data.style) || {};
|
||
// store normalized style under a different key for next diff
|
||
// make sure to clone it if it's reactive, since the user likely wants
|
||
// to mutate it.
|
||
vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;
|
||
var newStyle = getStyle(vnode, true);
|
||
for (name in oldStyle) {
|
||
if (isUndef(newStyle[name])) {
|
||
setProp(el, name, '');
|
||
}
|
||
}
|
||
for (name in newStyle) {
|
||
cur = newStyle[name];
|
||
// ie9 setting to null has no effect, must use empty string
|
||
setProp(el, name, cur == null ? '' : cur);
|
||
}
|
||
}
|
||
var style = {
|
||
create: updateStyle,
|
||
update: updateStyle
|
||
};
|
||
|
||
var whitespaceRE = /\s+/;
|
||
/**
|
||
* Add class with compatibility for SVG since classList is not supported on
|
||
* SVG elements in IE
|
||
*/
|
||
function addClass(el, cls) {
|
||
/* istanbul ignore if */
|
||
if (!cls || !(cls = cls.trim())) {
|
||
return;
|
||
}
|
||
/* istanbul ignore else */
|
||
if (el.classList) {
|
||
if (cls.indexOf(' ') > -1) {
|
||
cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
|
||
}
|
||
else {
|
||
el.classList.add(cls);
|
||
}
|
||
}
|
||
else {
|
||
var cur = " ".concat(el.getAttribute('class') || '', " ");
|
||
if (cur.indexOf(' ' + cls + ' ') < 0) {
|
||
el.setAttribute('class', (cur + cls).trim());
|
||
}
|
||
}
|
||
}
|
||
/**
|
||
* Remove class with compatibility for SVG since classList is not supported on
|
||
* SVG elements in IE
|
||
*/
|
||
function removeClass(el, cls) {
|
||
/* istanbul ignore if */
|
||
if (!cls || !(cls = cls.trim())) {
|
||
return;
|
||
}
|
||
/* istanbul ignore else */
|
||
if (el.classList) {
|
||
if (cls.indexOf(' ') > -1) {
|
||
cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
|
||
}
|
||
else {
|
||
el.classList.remove(cls);
|
||
}
|
||
if (!el.classList.length) {
|
||
el.removeAttribute('class');
|
||
}
|
||
}
|
||
else {
|
||
var cur = " ".concat(el.getAttribute('class') || '', " ");
|
||
var tar = ' ' + cls + ' ';
|
||
while (cur.indexOf(tar) >= 0) {
|
||
cur = cur.replace(tar, ' ');
|
||
}
|
||
cur = cur.trim();
|
||
if (cur) {
|
||
el.setAttribute('class', cur);
|
||
}
|
||
else {
|
||
el.removeAttribute('class');
|
||
}
|
||
}
|
||
}
|
||
|
||
function resolveTransition(def) {
|
||
if (!def) {
|
||
return;
|
||
}
|
||
/* istanbul ignore else */
|
||
if (typeof def === 'object') {
|
||
var res = {};
|
||
if (def.css !== false) {
|
||
extend(res, autoCssTransition(def.name || 'v'));
|
||
}
|
||
extend(res, def);
|
||
return res;
|
||
}
|
||
else if (typeof def === 'string') {
|
||
return autoCssTransition(def);
|
||
}
|
||
}
|
||
var autoCssTransition = cached(function (name) {
|
||
return {
|
||
enterClass: "".concat(name, "-enter"),
|
||
enterToClass: "".concat(name, "-enter-to"),
|
||
enterActiveClass: "".concat(name, "-enter-active"),
|
||
leaveClass: "".concat(name, "-leave"),
|
||
leaveToClass: "".concat(name, "-leave-to"),
|
||
leaveActiveClass: "".concat(name, "-leave-active")
|
||
};
|
||
});
|
||
var hasTransition = inBrowser && !isIE9;
|
||
var TRANSITION = 'transition';
|
||
var ANIMATION = 'animation';
|
||
// Transition property/event sniffing
|
||
var transitionProp = 'transition';
|
||
var transitionEndEvent = 'transitionend';
|
||
var animationProp = 'animation';
|
||
var animationEndEvent = 'animationend';
|
||
if (hasTransition) {
|
||
/* istanbul ignore if */
|
||
if (window.ontransitionend === undefined &&
|
||
window.onwebkittransitionend !== undefined) {
|
||
transitionProp = 'WebkitTransition';
|
||
transitionEndEvent = 'webkitTransitionEnd';
|
||
}
|
||
if (window.onanimationend === undefined &&
|
||
window.onwebkitanimationend !== undefined) {
|
||
animationProp = 'WebkitAnimation';
|
||
animationEndEvent = 'webkitAnimationEnd';
|
||
}
|
||
}
|
||
// binding to window is necessary to make hot reload work in IE in strict mode
|
||
var raf = inBrowser
|
||
? window.requestAnimationFrame
|
||
? window.requestAnimationFrame.bind(window)
|
||
: setTimeout
|
||
: /* istanbul ignore next */ function (/* istanbul ignore next */ fn) { return fn(); };
|
||
function nextFrame(fn) {
|
||
raf(function () {
|
||
// @ts-expect-error
|
||
raf(fn);
|
||
});
|
||
}
|
||
function addTransitionClass(el, cls) {
|
||
var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
|
||
if (transitionClasses.indexOf(cls) < 0) {
|
||
transitionClasses.push(cls);
|
||
addClass(el, cls);
|
||
}
|
||
}
|
||
function removeTransitionClass(el, cls) {
|
||
if (el._transitionClasses) {
|
||
remove$2(el._transitionClasses, cls);
|
||
}
|
||
removeClass(el, cls);
|
||
}
|
||
function whenTransitionEnds(el, expectedType, cb) {
|
||
var _a = getTransitionInfo(el, expectedType), type = _a.type, timeout = _a.timeout, propCount = _a.propCount;
|
||
if (!type)
|
||
return cb();
|
||
var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
|
||
var ended = 0;
|
||
var end = function () {
|
||
el.removeEventListener(event, onEnd);
|
||
cb();
|
||
};
|
||
var onEnd = function (e) {
|
||
if (e.target === el) {
|
||
if (++ended >= propCount) {
|
||
end();
|
||
}
|
||
}
|
||
};
|
||
setTimeout(function () {
|
||
if (ended < propCount) {
|
||
end();
|
||
}
|
||
}, timeout + 1);
|
||
el.addEventListener(event, onEnd);
|
||
}
|
||
var transformRE = /\b(transform|all)(,|$)/;
|
||
function getTransitionInfo(el, expectedType) {
|
||
var styles = window.getComputedStyle(el);
|
||
// JSDOM may return undefined for transition properties
|
||
var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
|
||
var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
|
||
var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
|
||
var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
|
||
var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
|
||
var animationTimeout = getTimeout(animationDelays, animationDurations);
|
||
var type;
|
||
var timeout = 0;
|
||
var propCount = 0;
|
||
/* istanbul ignore if */
|
||
if (expectedType === TRANSITION) {
|
||
if (transitionTimeout > 0) {
|
||
type = TRANSITION;
|
||
timeout = transitionTimeout;
|
||
propCount = transitionDurations.length;
|
||
}
|
||
}
|
||
else if (expectedType === ANIMATION) {
|
||
if (animationTimeout > 0) {
|
||
type = ANIMATION;
|
||
timeout = animationTimeout;
|
||
propCount = animationDurations.length;
|
||
}
|
||
}
|
||
else {
|
||
timeout = Math.max(transitionTimeout, animationTimeout);
|
||
type =
|
||
timeout > 0
|
||
? transitionTimeout > animationTimeout
|
||
? TRANSITION
|
||
: ANIMATION
|
||
: null;
|
||
propCount = type
|
||
? type === TRANSITION
|
||
? transitionDurations.length
|
||
: animationDurations.length
|
||
: 0;
|
||
}
|
||
var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);
|
||
return {
|
||
type: type,
|
||
timeout: timeout,
|
||
propCount: propCount,
|
||
hasTransform: hasTransform
|
||
};
|
||
}
|
||
function getTimeout(delays, durations) {
|
||
/* istanbul ignore next */
|
||
while (delays.length < durations.length) {
|
||
delays = delays.concat(delays);
|
||
}
|
||
return Math.max.apply(null, durations.map(function (d, i) {
|
||
return toMs(d) + toMs(delays[i]);
|
||
}));
|
||
}
|
||
// Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
|
||
// in a locale-dependent way, using a comma instead of a dot.
|
||
// If comma is not replaced with a dot, the input will be rounded down (i.e. acting
|
||
// as a floor function) causing unexpected behaviors
|
||
function toMs(s) {
|
||
return Number(s.slice(0, -1).replace(',', '.')) * 1000;
|
||
}
|
||
|
||
function enter(vnode, toggleDisplay) {
|
||
var el = vnode.elm;
|
||
// call leave callback now
|
||
if (isDef(el._leaveCb)) {
|
||
el._leaveCb.cancelled = true;
|
||
el._leaveCb();
|
||
}
|
||
var data = resolveTransition(vnode.data.transition);
|
||
if (isUndef(data)) {
|
||
return;
|
||
}
|
||
/* istanbul ignore if */
|
||
if (isDef(el._enterCb) || el.nodeType !== 1) {
|
||
return;
|
||
}
|
||
var css = data.css, type = data.type, enterClass = data.enterClass, enterToClass = data.enterToClass, enterActiveClass = data.enterActiveClass, appearClass = data.appearClass, appearToClass = data.appearToClass, appearActiveClass = data.appearActiveClass, beforeEnter = data.beforeEnter, enter = data.enter, afterEnter = data.afterEnter, enterCancelled = data.enterCancelled, beforeAppear = data.beforeAppear, appear = data.appear, afterAppear = data.afterAppear, appearCancelled = data.appearCancelled, duration = data.duration;
|
||
// activeInstance will always be the <transition> component managing this
|
||
// transition. One edge case to check is when the <transition> is placed
|
||
// as the root node of a child component. In that case we need to check
|
||
// <transition>'s parent for appear check.
|
||
var context = activeInstance;
|
||
var transitionNode = activeInstance.$vnode;
|
||
while (transitionNode && transitionNode.parent) {
|
||
context = transitionNode.context;
|
||
transitionNode = transitionNode.parent;
|
||
}
|
||
var isAppear = !context._isMounted || !vnode.isRootInsert;
|
||
if (isAppear && !appear && appear !== '') {
|
||
return;
|
||
}
|
||
var startClass = isAppear && appearClass ? appearClass : enterClass;
|
||
var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;
|
||
var toClass = isAppear && appearToClass ? appearToClass : enterToClass;
|
||
var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;
|
||
var enterHook = isAppear ? (isFunction(appear) ? appear : enter) : enter;
|
||
var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;
|
||
var enterCancelledHook = isAppear
|
||
? appearCancelled || enterCancelled
|
||
: enterCancelled;
|
||
var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);
|
||
if ( true && explicitEnterDuration != null) {
|
||
checkDuration(explicitEnterDuration, 'enter', vnode);
|
||
}
|
||
var expectsCSS = css !== false && !isIE9;
|
||
var userWantsControl = getHookArgumentsLength(enterHook);
|
||
var cb = (el._enterCb = once(function () {
|
||
if (expectsCSS) {
|
||
removeTransitionClass(el, toClass);
|
||
removeTransitionClass(el, activeClass);
|
||
}
|
||
// @ts-expect-error
|
||
if (cb.cancelled) {
|
||
if (expectsCSS) {
|
||
removeTransitionClass(el, startClass);
|
||
}
|
||
enterCancelledHook && enterCancelledHook(el);
|
||
}
|
||
else {
|
||
afterEnterHook && afterEnterHook(el);
|
||
}
|
||
el._enterCb = null;
|
||
}));
|
||
if (!vnode.data.show) {
|
||
// remove pending leave element on enter by injecting an insert hook
|
||
mergeVNodeHook(vnode, 'insert', function () {
|
||
var parent = el.parentNode;
|
||
var pendingNode = parent && parent._pending && parent._pending[vnode.key];
|
||
if (pendingNode &&
|
||
pendingNode.tag === vnode.tag &&
|
||
pendingNode.elm._leaveCb) {
|
||
pendingNode.elm._leaveCb();
|
||
}
|
||
enterHook && enterHook(el, cb);
|
||
});
|
||
}
|
||
// start enter transition
|
||
beforeEnterHook && beforeEnterHook(el);
|
||
if (expectsCSS) {
|
||
addTransitionClass(el, startClass);
|
||
addTransitionClass(el, activeClass);
|
||
nextFrame(function () {
|
||
removeTransitionClass(el, startClass);
|
||
// @ts-expect-error
|
||
if (!cb.cancelled) {
|
||
addTransitionClass(el, toClass);
|
||
if (!userWantsControl) {
|
||
if (isValidDuration(explicitEnterDuration)) {
|
||
setTimeout(cb, explicitEnterDuration);
|
||
}
|
||
else {
|
||
whenTransitionEnds(el, type, cb);
|
||
}
|
||
}
|
||
}
|
||
});
|
||
}
|
||
if (vnode.data.show) {
|
||
toggleDisplay && toggleDisplay();
|
||
enterHook && enterHook(el, cb);
|
||
}
|
||
if (!expectsCSS && !userWantsControl) {
|
||
cb();
|
||
}
|
||
}
|
||
function leave(vnode, rm) {
|
||
var el = vnode.elm;
|
||
// call enter callback now
|
||
if (isDef(el._enterCb)) {
|
||
el._enterCb.cancelled = true;
|
||
el._enterCb();
|
||
}
|
||
var data = resolveTransition(vnode.data.transition);
|
||
if (isUndef(data) || el.nodeType !== 1) {
|
||
return rm();
|
||
}
|
||
/* istanbul ignore if */
|
||
if (isDef(el._leaveCb)) {
|
||
return;
|
||
}
|
||
var css = data.css, type = data.type, leaveClass = data.leaveClass, leaveToClass = data.leaveToClass, leaveActiveClass = data.leaveActiveClass, beforeLeave = data.beforeLeave, leave = data.leave, afterLeave = data.afterLeave, leaveCancelled = data.leaveCancelled, delayLeave = data.delayLeave, duration = data.duration;
|
||
var expectsCSS = css !== false && !isIE9;
|
||
var userWantsControl = getHookArgumentsLength(leave);
|
||
var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);
|
||
if ( true && isDef(explicitLeaveDuration)) {
|
||
checkDuration(explicitLeaveDuration, 'leave', vnode);
|
||
}
|
||
var cb = (el._leaveCb = once(function () {
|
||
if (el.parentNode && el.parentNode._pending) {
|
||
el.parentNode._pending[vnode.key] = null;
|
||
}
|
||
if (expectsCSS) {
|
||
removeTransitionClass(el, leaveToClass);
|
||
removeTransitionClass(el, leaveActiveClass);
|
||
}
|
||
// @ts-expect-error
|
||
if (cb.cancelled) {
|
||
if (expectsCSS) {
|
||
removeTransitionClass(el, leaveClass);
|
||
}
|
||
leaveCancelled && leaveCancelled(el);
|
||
}
|
||
else {
|
||
rm();
|
||
afterLeave && afterLeave(el);
|
||
}
|
||
el._leaveCb = null;
|
||
}));
|
||
if (delayLeave) {
|
||
delayLeave(performLeave);
|
||
}
|
||
else {
|
||
performLeave();
|
||
}
|
||
function performLeave() {
|
||
// the delayed leave may have already been cancelled
|
||
// @ts-expect-error
|
||
if (cb.cancelled) {
|
||
return;
|
||
}
|
||
// record leaving element
|
||
if (!vnode.data.show && el.parentNode) {
|
||
(el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] =
|
||
vnode;
|
||
}
|
||
beforeLeave && beforeLeave(el);
|
||
if (expectsCSS) {
|
||
addTransitionClass(el, leaveClass);
|
||
addTransitionClass(el, leaveActiveClass);
|
||
nextFrame(function () {
|
||
removeTransitionClass(el, leaveClass);
|
||
// @ts-expect-error
|
||
if (!cb.cancelled) {
|
||
addTransitionClass(el, leaveToClass);
|
||
if (!userWantsControl) {
|
||
if (isValidDuration(explicitLeaveDuration)) {
|
||
setTimeout(cb, explicitLeaveDuration);
|
||
}
|
||
else {
|
||
whenTransitionEnds(el, type, cb);
|
||
}
|
||
}
|
||
}
|
||
});
|
||
}
|
||
leave && leave(el, cb);
|
||
if (!expectsCSS && !userWantsControl) {
|
||
cb();
|
||
}
|
||
}
|
||
}
|
||
// only used in dev mode
|
||
function checkDuration(val, name, vnode) {
|
||
if (typeof val !== 'number') {
|
||
warn("<transition> explicit ".concat(name, " duration is not a valid number - ") +
|
||
"got ".concat(JSON.stringify(val), "."), vnode.context);
|
||
}
|
||
else if (isNaN(val)) {
|
||
warn("<transition> explicit ".concat(name, " duration is NaN - ") +
|
||
'the duration expression might be incorrect.', vnode.context);
|
||
}
|
||
}
|
||
function isValidDuration(val) {
|
||
return typeof val === 'number' && !isNaN(val);
|
||
}
|
||
/**
|
||
* Normalize a transition hook's argument length. The hook may be:
|
||
* - a merged hook (invoker) with the original in .fns
|
||
* - a wrapped component method (check ._length)
|
||
* - a plain function (.length)
|
||
*/
|
||
function getHookArgumentsLength(fn) {
|
||
if (isUndef(fn)) {
|
||
return false;
|
||
}
|
||
// @ts-expect-error
|
||
var invokerFns = fn.fns;
|
||
if (isDef(invokerFns)) {
|
||
// invoker
|
||
return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);
|
||
}
|
||
else {
|
||
// @ts-expect-error
|
||
return (fn._length || fn.length) > 1;
|
||
}
|
||
}
|
||
function _enter(_, vnode) {
|
||
if (vnode.data.show !== true) {
|
||
enter(vnode);
|
||
}
|
||
}
|
||
var transition = inBrowser
|
||
? {
|
||
create: _enter,
|
||
activate: _enter,
|
||
remove: function (vnode, rm) {
|
||
/* istanbul ignore else */
|
||
if (vnode.data.show !== true) {
|
||
// @ts-expect-error
|
||
leave(vnode, rm);
|
||
}
|
||
else {
|
||
rm();
|
||
}
|
||
}
|
||
}
|
||
: {};
|
||
|
||
var platformModules = [attrs, klass, events, domProps, style, transition];
|
||
|
||
// the directive module should be applied last, after all
|
||
// built-in modules have been applied.
|
||
var modules = platformModules.concat(baseModules);
|
||
var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
|
||
|
||
/**
|
||
* Not type checking this file because flow doesn't like attaching
|
||
* properties to Elements.
|
||
*/
|
||
/* istanbul ignore if */
|
||
if (isIE9) {
|
||
// http://www.matts411.com/post/internet-explorer-9-oninput/
|
||
document.addEventListener('selectionchange', function () {
|
||
var el = document.activeElement;
|
||
// @ts-expect-error
|
||
if (el && el.vmodel) {
|
||
trigger(el, 'input');
|
||
}
|
||
});
|
||
}
|
||
var directive = {
|
||
inserted: function (el, binding, vnode, oldVnode) {
|
||
if (vnode.tag === 'select') {
|
||
// #6903
|
||
if (oldVnode.elm && !oldVnode.elm._vOptions) {
|
||
mergeVNodeHook(vnode, 'postpatch', function () {
|
||
directive.componentUpdated(el, binding, vnode);
|
||
});
|
||
}
|
||
else {
|
||
setSelected(el, binding, vnode.context);
|
||
}
|
||
el._vOptions = [].map.call(el.options, getValue);
|
||
}
|
||
else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
|
||
el._vModifiers = binding.modifiers;
|
||
if (!binding.modifiers.lazy) {
|
||
el.addEventListener('compositionstart', onCompositionStart);
|
||
el.addEventListener('compositionend', onCompositionEnd);
|
||
// Safari < 10.2 & UIWebView doesn't fire compositionend when
|
||
// switching focus before confirming composition choice
|
||
// this also fixes the issue where some browsers e.g. iOS Chrome
|
||
// fires "change" instead of "input" on autocomplete.
|
||
el.addEventListener('change', onCompositionEnd);
|
||
/* istanbul ignore if */
|
||
if (isIE9) {
|
||
el.vmodel = true;
|
||
}
|
||
}
|
||
}
|
||
},
|
||
componentUpdated: function (el, binding, vnode) {
|
||
if (vnode.tag === 'select') {
|
||
setSelected(el, binding, vnode.context);
|
||
// in case the options rendered by v-for have changed,
|
||
// it's possible that the value is out-of-sync with the rendered options.
|
||
// detect such cases and filter out values that no longer has a matching
|
||
// option in the DOM.
|
||
var prevOptions_1 = el._vOptions;
|
||
var curOptions_1 = (el._vOptions = [].map.call(el.options, getValue));
|
||
if (curOptions_1.some(function (o, i) { return !looseEqual(o, prevOptions_1[i]); })) {
|
||
// trigger change event if
|
||
// no matching option found for at least one value
|
||
var needReset = el.multiple
|
||
? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions_1); })
|
||
: binding.value !== binding.oldValue &&
|
||
hasNoMatchingOption(binding.value, curOptions_1);
|
||
if (needReset) {
|
||
trigger(el, 'change');
|
||
}
|
||
}
|
||
}
|
||
}
|
||
};
|
||
function setSelected(el, binding, vm) {
|
||
actuallySetSelected(el, binding, vm);
|
||
/* istanbul ignore if */
|
||
if (isIE || isEdge) {
|
||
setTimeout(function () {
|
||
actuallySetSelected(el, binding, vm);
|
||
}, 0);
|
||
}
|
||
}
|
||
function actuallySetSelected(el, binding, vm) {
|
||
var value = binding.value;
|
||
var isMultiple = el.multiple;
|
||
if (isMultiple && !Array.isArray(value)) {
|
||
true &&
|
||
warn("<select multiple v-model=\"".concat(binding.expression, "\"> ") +
|
||
"expects an Array value for its binding, but got ".concat(Object.prototype.toString
|
||
.call(value)
|
||
.slice(8, -1)), vm);
|
||
return;
|
||
}
|
||
var selected, option;
|
||
for (var i = 0, l = el.options.length; i < l; i++) {
|
||
option = el.options[i];
|
||
if (isMultiple) {
|
||
selected = looseIndexOf(value, getValue(option)) > -1;
|
||
if (option.selected !== selected) {
|
||
option.selected = selected;
|
||
}
|
||
}
|
||
else {
|
||
if (looseEqual(getValue(option), value)) {
|
||
if (el.selectedIndex !== i) {
|
||
el.selectedIndex = i;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
if (!isMultiple) {
|
||
el.selectedIndex = -1;
|
||
}
|
||
}
|
||
function hasNoMatchingOption(value, options) {
|
||
return options.every(function (o) { return !looseEqual(o, value); });
|
||
}
|
||
function getValue(option) {
|
||
return '_value' in option ? option._value : option.value;
|
||
}
|
||
function onCompositionStart(e) {
|
||
e.target.composing = true;
|
||
}
|
||
function onCompositionEnd(e) {
|
||
// prevent triggering an input event for no reason
|
||
if (!e.target.composing)
|
||
return;
|
||
e.target.composing = false;
|
||
trigger(e.target, 'input');
|
||
}
|
||
function trigger(el, type) {
|
||
var e = document.createEvent('HTMLEvents');
|
||
e.initEvent(type, true, true);
|
||
el.dispatchEvent(e);
|
||
}
|
||
|
||
// recursively search for possible transition defined inside the component root
|
||
function locateNode(vnode) {
|
||
// @ts-expect-error
|
||
return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
|
||
? locateNode(vnode.componentInstance._vnode)
|
||
: vnode;
|
||
}
|
||
var show = {
|
||
bind: function (el, _a, vnode) {
|
||
var value = _a.value;
|
||
vnode = locateNode(vnode);
|
||
var transition = vnode.data && vnode.data.transition;
|
||
var originalDisplay = (el.__vOriginalDisplay =
|
||
el.style.display === 'none' ? '' : el.style.display);
|
||
if (value && transition) {
|
||
vnode.data.show = true;
|
||
enter(vnode, function () {
|
||
el.style.display = originalDisplay;
|
||
});
|
||
}
|
||
else {
|
||
el.style.display = value ? originalDisplay : 'none';
|
||
}
|
||
},
|
||
update: function (el, _a, vnode) {
|
||
var value = _a.value, oldValue = _a.oldValue;
|
||
/* istanbul ignore if */
|
||
if (!value === !oldValue)
|
||
return;
|
||
vnode = locateNode(vnode);
|
||
var transition = vnode.data && vnode.data.transition;
|
||
if (transition) {
|
||
vnode.data.show = true;
|
||
if (value) {
|
||
enter(vnode, function () {
|
||
el.style.display = el.__vOriginalDisplay;
|
||
});
|
||
}
|
||
else {
|
||
leave(vnode, function () {
|
||
el.style.display = 'none';
|
||
});
|
||
}
|
||
}
|
||
else {
|
||
el.style.display = value ? el.__vOriginalDisplay : 'none';
|
||
}
|
||
},
|
||
unbind: function (el, binding, vnode, oldVnode, isDestroy) {
|
||
if (!isDestroy) {
|
||
el.style.display = el.__vOriginalDisplay;
|
||
}
|
||
}
|
||
};
|
||
|
||
var platformDirectives = {
|
||
model: directive,
|
||
show: show
|
||
};
|
||
|
||
// Provides transition support for a single element/component.
|
||
var transitionProps = {
|
||
name: String,
|
||
appear: Boolean,
|
||
css: Boolean,
|
||
mode: String,
|
||
type: String,
|
||
enterClass: String,
|
||
leaveClass: String,
|
||
enterToClass: String,
|
||
leaveToClass: String,
|
||
enterActiveClass: String,
|
||
leaveActiveClass: String,
|
||
appearClass: String,
|
||
appearActiveClass: String,
|
||
appearToClass: String,
|
||
duration: [Number, String, Object]
|
||
};
|
||
// in case the child is also an abstract component, e.g. <keep-alive>
|
||
// we want to recursively retrieve the real component to be rendered
|
||
function getRealChild(vnode) {
|
||
var compOptions = vnode && vnode.componentOptions;
|
||
if (compOptions && compOptions.Ctor.options.abstract) {
|
||
return getRealChild(getFirstComponentChild(compOptions.children));
|
||
}
|
||
else {
|
||
return vnode;
|
||
}
|
||
}
|
||
function extractTransitionData(comp) {
|
||
var data = {};
|
||
var options = comp.$options;
|
||
// props
|
||
for (var key in options.propsData) {
|
||
data[key] = comp[key];
|
||
}
|
||
// events.
|
||
// extract listeners and pass them directly to the transition methods
|
||
var listeners = options._parentListeners;
|
||
for (var key in listeners) {
|
||
data[camelize(key)] = listeners[key];
|
||
}
|
||
return data;
|
||
}
|
||
function placeholder(h, rawChild) {
|
||
// @ts-expect-error
|
||
if (/\d-keep-alive$/.test(rawChild.tag)) {
|
||
return h('keep-alive', {
|
||
props: rawChild.componentOptions.propsData
|
||
});
|
||
}
|
||
}
|
||
function hasParentTransition(vnode) {
|
||
while ((vnode = vnode.parent)) {
|
||
if (vnode.data.transition) {
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
function isSameChild(child, oldChild) {
|
||
return oldChild.key === child.key && oldChild.tag === child.tag;
|
||
}
|
||
var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
|
||
var isVShowDirective = function (d) { return d.name === 'show'; };
|
||
var Transition = {
|
||
name: 'transition',
|
||
props: transitionProps,
|
||
abstract: true,
|
||
render: function (h) {
|
||
var _this = this;
|
||
var children = this.$slots.default;
|
||
if (!children) {
|
||
return;
|
||
}
|
||
// filter out text nodes (possible whitespaces)
|
||
children = children.filter(isNotTextNode);
|
||
/* istanbul ignore if */
|
||
if (!children.length) {
|
||
return;
|
||
}
|
||
// warn multiple elements
|
||
if ( true && children.length > 1) {
|
||
warn('<transition> can only be used on a single element. Use ' +
|
||
'<transition-group> for lists.', this.$parent);
|
||
}
|
||
var mode = this.mode;
|
||
// warn invalid mode
|
||
if ( true && mode && mode !== 'in-out' && mode !== 'out-in') {
|
||
warn('invalid <transition> mode: ' + mode, this.$parent);
|
||
}
|
||
var rawChild = children[0];
|
||
// if this is a component root node and the component's
|
||
// parent container node also has transition, skip.
|
||
if (hasParentTransition(this.$vnode)) {
|
||
return rawChild;
|
||
}
|
||
// apply transition data to child
|
||
// use getRealChild() to ignore abstract components e.g. keep-alive
|
||
var child = getRealChild(rawChild);
|
||
/* istanbul ignore if */
|
||
if (!child) {
|
||
return rawChild;
|
||
}
|
||
if (this._leaving) {
|
||
return placeholder(h, rawChild);
|
||
}
|
||
// ensure a key that is unique to the vnode type and to this transition
|
||
// component instance. This key will be used to remove pending leaving nodes
|
||
// during entering.
|
||
var id = "__transition-".concat(this._uid, "-");
|
||
child.key =
|
||
child.key == null
|
||
? child.isComment
|
||
? id + 'comment'
|
||
: id + child.tag
|
||
: isPrimitive(child.key)
|
||
? String(child.key).indexOf(id) === 0
|
||
? child.key
|
||
: id + child.key
|
||
: child.key;
|
||
var data = ((child.data || (child.data = {})).transition =
|
||
extractTransitionData(this));
|
||
var oldRawChild = this._vnode;
|
||
var oldChild = getRealChild(oldRawChild);
|
||
// mark v-show
|
||
// so that the transition module can hand over the control to the directive
|
||
if (child.data.directives && child.data.directives.some(isVShowDirective)) {
|
||
child.data.show = true;
|
||
}
|
||
if (oldChild &&
|
||
oldChild.data &&
|
||
!isSameChild(child, oldChild) &&
|
||
!isAsyncPlaceholder(oldChild) &&
|
||
// #6687 component root is a comment node
|
||
!(oldChild.componentInstance &&
|
||
oldChild.componentInstance._vnode.isComment)) {
|
||
// replace old child transition data with fresh one
|
||
// important for dynamic transitions!
|
||
var oldData = (oldChild.data.transition = extend({}, data));
|
||
// handle transition mode
|
||
if (mode === 'out-in') {
|
||
// return placeholder node and queue update when leave finishes
|
||
this._leaving = true;
|
||
mergeVNodeHook(oldData, 'afterLeave', function () {
|
||
_this._leaving = false;
|
||
_this.$forceUpdate();
|
||
});
|
||
return placeholder(h, rawChild);
|
||
}
|
||
else if (mode === 'in-out') {
|
||
if (isAsyncPlaceholder(child)) {
|
||
return oldRawChild;
|
||
}
|
||
var delayedLeave_1;
|
||
var performLeave = function () {
|
||
delayedLeave_1();
|
||
};
|
||
mergeVNodeHook(data, 'afterEnter', performLeave);
|
||
mergeVNodeHook(data, 'enterCancelled', performLeave);
|
||
mergeVNodeHook(oldData, 'delayLeave', function (leave) {
|
||
delayedLeave_1 = leave;
|
||
});
|
||
}
|
||
}
|
||
return rawChild;
|
||
}
|
||
};
|
||
|
||
// Provides transition support for list items.
|
||
var props = extend({
|
||
tag: String,
|
||
moveClass: String
|
||
}, transitionProps);
|
||
delete props.mode;
|
||
var TransitionGroup = {
|
||
props: props,
|
||
beforeMount: function () {
|
||
var _this = this;
|
||
var update = this._update;
|
||
this._update = function (vnode, hydrating) {
|
||
var restoreActiveInstance = setActiveInstance(_this);
|
||
// force removing pass
|
||
_this.__patch__(_this._vnode, _this.kept, false, // hydrating
|
||
true // removeOnly (!important, avoids unnecessary moves)
|
||
);
|
||
_this._vnode = _this.kept;
|
||
restoreActiveInstance();
|
||
update.call(_this, vnode, hydrating);
|
||
};
|
||
},
|
||
render: function (h) {
|
||
var tag = this.tag || this.$vnode.data.tag || 'span';
|
||
var map = Object.create(null);
|
||
var prevChildren = (this.prevChildren = this.children);
|
||
var rawChildren = this.$slots.default || [];
|
||
var children = (this.children = []);
|
||
var transitionData = extractTransitionData(this);
|
||
for (var i = 0; i < rawChildren.length; i++) {
|
||
var c = rawChildren[i];
|
||
if (c.tag) {
|
||
if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
|
||
children.push(c);
|
||
map[c.key] = c;
|
||
(c.data || (c.data = {})).transition = transitionData;
|
||
}
|
||
else if (true) {
|
||
var opts = c.componentOptions;
|
||
var name_1 = opts
|
||
? getComponentName(opts.Ctor.options) || opts.tag || ''
|
||
: c.tag;
|
||
warn("<transition-group> children must be keyed: <".concat(name_1, ">"));
|
||
}
|
||
}
|
||
}
|
||
if (prevChildren) {
|
||
var kept = [];
|
||
var removed = [];
|
||
for (var i = 0; i < prevChildren.length; i++) {
|
||
var c = prevChildren[i];
|
||
c.data.transition = transitionData;
|
||
// @ts-expect-error .getBoundingClientRect is not typed in Node
|
||
c.data.pos = c.elm.getBoundingClientRect();
|
||
if (map[c.key]) {
|
||
kept.push(c);
|
||
}
|
||
else {
|
||
removed.push(c);
|
||
}
|
||
}
|
||
this.kept = h(tag, null, kept);
|
||
this.removed = removed;
|
||
}
|
||
return h(tag, null, children);
|
||
},
|
||
updated: function () {
|
||
var children = this.prevChildren;
|
||
var moveClass = this.moveClass || (this.name || 'v') + '-move';
|
||
if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
|
||
return;
|
||
}
|
||
// we divide the work into three loops to avoid mixing DOM reads and writes
|
||
// in each iteration - which helps prevent layout thrashing.
|
||
children.forEach(callPendingCbs);
|
||
children.forEach(recordPosition);
|
||
children.forEach(applyTranslation);
|
||
// force reflow to put everything in position
|
||
// assign to this to avoid being removed in tree-shaking
|
||
// $flow-disable-line
|
||
this._reflow = document.body.offsetHeight;
|
||
children.forEach(function (c) {
|
||
if (c.data.moved) {
|
||
var el_1 = c.elm;
|
||
var s = el_1.style;
|
||
addTransitionClass(el_1, moveClass);
|
||
s.transform = s.WebkitTransform = s.transitionDuration = '';
|
||
el_1.addEventListener(transitionEndEvent, (el_1._moveCb = function cb(e) {
|
||
if (e && e.target !== el_1) {
|
||
return;
|
||
}
|
||
if (!e || /transform$/.test(e.propertyName)) {
|
||
el_1.removeEventListener(transitionEndEvent, cb);
|
||
el_1._moveCb = null;
|
||
removeTransitionClass(el_1, moveClass);
|
||
}
|
||
}));
|
||
}
|
||
});
|
||
},
|
||
methods: {
|
||
hasMove: function (el, moveClass) {
|
||
/* istanbul ignore if */
|
||
if (!hasTransition) {
|
||
return false;
|
||
}
|
||
/* istanbul ignore if */
|
||
if (this._hasMove) {
|
||
return this._hasMove;
|
||
}
|
||
// Detect whether an element with the move class applied has
|
||
// CSS transitions. Since the element may be inside an entering
|
||
// transition at this very moment, we make a clone of it and remove
|
||
// all other transition classes applied to ensure only the move class
|
||
// is applied.
|
||
var clone = el.cloneNode();
|
||
if (el._transitionClasses) {
|
||
el._transitionClasses.forEach(function (cls) {
|
||
removeClass(clone, cls);
|
||
});
|
||
}
|
||
addClass(clone, moveClass);
|
||
clone.style.display = 'none';
|
||
this.$el.appendChild(clone);
|
||
var info = getTransitionInfo(clone);
|
||
this.$el.removeChild(clone);
|
||
return (this._hasMove = info.hasTransform);
|
||
}
|
||
}
|
||
};
|
||
function callPendingCbs(c) {
|
||
/* istanbul ignore if */
|
||
if (c.elm._moveCb) {
|
||
c.elm._moveCb();
|
||
}
|
||
/* istanbul ignore if */
|
||
if (c.elm._enterCb) {
|
||
c.elm._enterCb();
|
||
}
|
||
}
|
||
function recordPosition(c) {
|
||
c.data.newPos = c.elm.getBoundingClientRect();
|
||
}
|
||
function applyTranslation(c) {
|
||
var oldPos = c.data.pos;
|
||
var newPos = c.data.newPos;
|
||
var dx = oldPos.left - newPos.left;
|
||
var dy = oldPos.top - newPos.top;
|
||
if (dx || dy) {
|
||
c.data.moved = true;
|
||
var s = c.elm.style;
|
||
s.transform = s.WebkitTransform = "translate(".concat(dx, "px,").concat(dy, "px)");
|
||
s.transitionDuration = '0s';
|
||
}
|
||
}
|
||
|
||
var platformComponents = {
|
||
Transition: Transition,
|
||
TransitionGroup: TransitionGroup
|
||
};
|
||
|
||
// install platform specific utils
|
||
Vue.config.mustUseProp = mustUseProp;
|
||
Vue.config.isReservedTag = isReservedTag;
|
||
Vue.config.isReservedAttr = isReservedAttr;
|
||
Vue.config.getTagNamespace = getTagNamespace;
|
||
Vue.config.isUnknownElement = isUnknownElement;
|
||
// install platform runtime directives & components
|
||
extend(Vue.options.directives, platformDirectives);
|
||
extend(Vue.options.components, platformComponents);
|
||
// install platform patch function
|
||
Vue.prototype.__patch__ = inBrowser ? patch : noop;
|
||
// public mount method
|
||
Vue.prototype.$mount = function (el, hydrating) {
|
||
el = el && inBrowser ? query(el) : undefined;
|
||
return mountComponent(this, el, hydrating);
|
||
};
|
||
// devtools global hook
|
||
/* istanbul ignore next */
|
||
if (inBrowser) {
|
||
setTimeout(function () {
|
||
if (config.devtools) {
|
||
if (devtools) {
|
||
devtools.emit('init', Vue);
|
||
}
|
||
else if (true) {
|
||
// @ts-expect-error
|
||
console[console.info ? 'info' : 'log']('Download the Vue Devtools extension for a better development experience:\n' +
|
||
'https://github.com/vuejs/vue-devtools');
|
||
}
|
||
}
|
||
if ( true &&
|
||
config.productionTip !== false &&
|
||
typeof console !== 'undefined') {
|
||
// @ts-expect-error
|
||
console[console.info ? 'info' : 'log']("You are running Vue in development mode.\n" +
|
||
"Make sure to turn on production mode when deploying for production.\n" +
|
||
"See more tips at https://vuejs.org/guide/deployment.html");
|
||
}
|
||
}, 0);
|
||
}
|
||
|
||
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/a-callable.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/core-js/internals/a-callable.js ***!
|
||
\******************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
var tryToString = __webpack_require__(/*! ../internals/try-to-string */ "./node_modules/core-js/internals/try-to-string.js");
|
||
|
||
var $TypeError = TypeError;
|
||
|
||
// `Assert: IsCallable(argument) is true`
|
||
module.exports = function (argument) {
|
||
if (isCallable(argument)) return argument;
|
||
throw new $TypeError(tryToString(argument) + ' is not a function');
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/advance-string-index.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/advance-string-index.js ***!
|
||
\****************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var charAt = (__webpack_require__(/*! ../internals/string-multibyte */ "./node_modules/core-js/internals/string-multibyte.js").charAt);
|
||
|
||
// `AdvanceStringIndex` abstract operation
|
||
// https://tc39.es/ecma262/#sec-advancestringindex
|
||
module.exports = function (S, index, unicode) {
|
||
return index + (unicode ? charAt(S, index).length : 1);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/an-object.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/core-js/internals/an-object.js ***!
|
||
\*****************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
|
||
|
||
var $String = String;
|
||
var $TypeError = TypeError;
|
||
|
||
// `Assert: Type(argument) is Object`
|
||
module.exports = function (argument) {
|
||
if (isObject(argument)) return argument;
|
||
throw new $TypeError($String(argument) + ' is not an object');
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/array-includes.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/array-includes.js ***!
|
||
\**********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
|
||
var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js");
|
||
var lengthOfArrayLike = __webpack_require__(/*! ../internals/length-of-array-like */ "./node_modules/core-js/internals/length-of-array-like.js");
|
||
|
||
// `Array.prototype.{ indexOf, includes }` methods implementation
|
||
var createMethod = function (IS_INCLUDES) {
|
||
return function ($this, el, fromIndex) {
|
||
var O = toIndexedObject($this);
|
||
var length = lengthOfArrayLike(O);
|
||
if (length === 0) return !IS_INCLUDES && -1;
|
||
var index = toAbsoluteIndex(fromIndex, length);
|
||
var value;
|
||
// Array#includes uses SameValueZero equality algorithm
|
||
// eslint-disable-next-line no-self-compare -- NaN check
|
||
if (IS_INCLUDES && el !== el) while (length > index) {
|
||
value = O[index++];
|
||
// eslint-disable-next-line no-self-compare -- NaN check
|
||
if (value !== value) return true;
|
||
// Array#indexOf ignores holes, Array#includes - not
|
||
} else for (;length > index; index++) {
|
||
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
||
} return !IS_INCLUDES && -1;
|
||
};
|
||
};
|
||
|
||
module.exports = {
|
||
// `Array.prototype.includes` method
|
||
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
||
includes: createMethod(true),
|
||
// `Array.prototype.indexOf` method
|
||
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
||
indexOf: createMethod(false)
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/classof-raw.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/core-js/internals/classof-raw.js ***!
|
||
\*******************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
|
||
var toString = uncurryThis({}.toString);
|
||
var stringSlice = uncurryThis(''.slice);
|
||
|
||
module.exports = function (it) {
|
||
return stringSlice(toString(it), 8, -1);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/classof.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/core-js/internals/classof.js ***!
|
||
\***************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "./node_modules/core-js/internals/to-string-tag-support.js");
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
var classofRaw = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
|
||
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
|
||
|
||
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
||
var $Object = Object;
|
||
|
||
// ES3 wrong here
|
||
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
||
|
||
// fallback for IE11 Script Access Denied error
|
||
var tryGet = function (it, key) {
|
||
try {
|
||
return it[key];
|
||
} catch (error) { /* empty */ }
|
||
};
|
||
|
||
// getting tag from ES6+ `Object.prototype.toString`
|
||
module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
||
var O, tag, result;
|
||
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
||
// @@toStringTag case
|
||
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
||
// builtinTag case
|
||
: CORRECT_ARGUMENTS ? classofRaw(O)
|
||
// ES3 arguments fallback
|
||
: (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/copy-constructor-properties.js":
|
||
/*!***********************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/copy-constructor-properties.js ***!
|
||
\***********************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js");
|
||
var ownKeys = __webpack_require__(/*! ../internals/own-keys */ "./node_modules/core-js/internals/own-keys.js");
|
||
var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js");
|
||
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
|
||
|
||
module.exports = function (target, source, exceptions) {
|
||
var keys = ownKeys(source);
|
||
var defineProperty = definePropertyModule.f;
|
||
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
||
for (var i = 0; i < keys.length; i++) {
|
||
var key = keys[i];
|
||
if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
|
||
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
||
}
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/create-non-enumerable-property.js":
|
||
/*!**************************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/create-non-enumerable-property.js ***!
|
||
\**************************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
|
||
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
|
||
var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
|
||
|
||
module.exports = DESCRIPTORS ? function (object, key, value) {
|
||
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
||
} : function (object, key, value) {
|
||
object[key] = value;
|
||
return object;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/create-property-descriptor.js":
|
||
/*!**********************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/create-property-descriptor.js ***!
|
||
\**********************************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
module.exports = function (bitmap, value) {
|
||
return {
|
||
enumerable: !(bitmap & 1),
|
||
configurable: !(bitmap & 2),
|
||
writable: !(bitmap & 4),
|
||
value: value
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/define-built-in.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/define-built-in.js ***!
|
||
\***********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
|
||
var makeBuiltIn = __webpack_require__(/*! ../internals/make-built-in */ "./node_modules/core-js/internals/make-built-in.js");
|
||
var defineGlobalProperty = __webpack_require__(/*! ../internals/define-global-property */ "./node_modules/core-js/internals/define-global-property.js");
|
||
|
||
module.exports = function (O, key, value, options) {
|
||
if (!options) options = {};
|
||
var simple = options.enumerable;
|
||
var name = options.name !== undefined ? options.name : key;
|
||
if (isCallable(value)) makeBuiltIn(value, name, options);
|
||
if (options.global) {
|
||
if (simple) O[key] = value;
|
||
else defineGlobalProperty(key, value);
|
||
} else {
|
||
try {
|
||
if (!options.unsafe) delete O[key];
|
||
else if (O[key]) simple = true;
|
||
} catch (error) { /* empty */ }
|
||
if (simple) O[key] = value;
|
||
else definePropertyModule.f(O, key, {
|
||
value: value,
|
||
enumerable: false,
|
||
configurable: !options.nonConfigurable,
|
||
writable: !options.nonWritable
|
||
});
|
||
} return O;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/define-global-property.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/define-global-property.js ***!
|
||
\******************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
|
||
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
||
var defineProperty = Object.defineProperty;
|
||
|
||
module.exports = function (key, value) {
|
||
try {
|
||
defineProperty(global, key, { value: value, configurable: true, writable: true });
|
||
} catch (error) {
|
||
global[key] = value;
|
||
} return value;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/descriptors.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/core-js/internals/descriptors.js ***!
|
||
\*******************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
|
||
// Detect IE8's incomplete defineProperty implementation
|
||
module.exports = !fails(function () {
|
||
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
||
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/document-create-element.js":
|
||
/*!*******************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/document-create-element.js ***!
|
||
\*******************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
|
||
|
||
var document = global.document;
|
||
// typeof document.createElement is 'object' in old IE
|
||
var EXISTS = isObject(document) && isObject(document.createElement);
|
||
|
||
module.exports = function (it) {
|
||
return EXISTS ? document.createElement(it) : {};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/engine-user-agent.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/engine-user-agent.js ***!
|
||
\*************************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/engine-v8-version.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/engine-v8-version.js ***!
|
||
\*************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "./node_modules/core-js/internals/engine-user-agent.js");
|
||
|
||
var process = global.process;
|
||
var Deno = global.Deno;
|
||
var versions = process && process.versions || Deno && Deno.version;
|
||
var v8 = versions && versions.v8;
|
||
var match, version;
|
||
|
||
if (v8) {
|
||
match = v8.split('.');
|
||
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
||
// but their correct versions are not interesting for us
|
||
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
||
}
|
||
|
||
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
||
// so check `userAgent` even if `.v8` exists, but 0
|
||
if (!version && userAgent) {
|
||
match = userAgent.match(/Edge\/(\d+)/);
|
||
if (!match || match[1] >= 74) {
|
||
match = userAgent.match(/Chrome\/(\d+)/);
|
||
if (match) version = +match[1];
|
||
}
|
||
}
|
||
|
||
module.exports = version;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/enum-bug-keys.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/enum-bug-keys.js ***!
|
||
\*********************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
// IE8- don't enum bug keys
|
||
module.exports = [
|
||
'constructor',
|
||
'hasOwnProperty',
|
||
'isPrototypeOf',
|
||
'propertyIsEnumerable',
|
||
'toLocaleString',
|
||
'toString',
|
||
'valueOf'
|
||
];
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/export.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/core-js/internals/export.js ***!
|
||
\**************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
var getOwnPropertyDescriptor = (__webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js").f);
|
||
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
|
||
var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "./node_modules/core-js/internals/define-built-in.js");
|
||
var defineGlobalProperty = __webpack_require__(/*! ../internals/define-global-property */ "./node_modules/core-js/internals/define-global-property.js");
|
||
var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "./node_modules/core-js/internals/copy-constructor-properties.js");
|
||
var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js");
|
||
|
||
/*
|
||
options.target - name of the target object
|
||
options.global - target is the global object
|
||
options.stat - export as static methods of target
|
||
options.proto - export as prototype methods of target
|
||
options.real - real prototype method for the `pure` version
|
||
options.forced - export even if the native feature is available
|
||
options.bind - bind methods to the target, required for the `pure` version
|
||
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
||
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
||
options.sham - add a flag to not completely full polyfills
|
||
options.enumerable - export as enumerable property
|
||
options.dontCallGetSet - prevent calling a getter on target
|
||
options.name - the .name of the function if it does not match the key
|
||
*/
|
||
module.exports = function (options, source) {
|
||
var TARGET = options.target;
|
||
var GLOBAL = options.global;
|
||
var STATIC = options.stat;
|
||
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
||
if (GLOBAL) {
|
||
target = global;
|
||
} else if (STATIC) {
|
||
target = global[TARGET] || defineGlobalProperty(TARGET, {});
|
||
} else {
|
||
target = global[TARGET] && global[TARGET].prototype;
|
||
}
|
||
if (target) for (key in source) {
|
||
sourceProperty = source[key];
|
||
if (options.dontCallGetSet) {
|
||
descriptor = getOwnPropertyDescriptor(target, key);
|
||
targetProperty = descriptor && descriptor.value;
|
||
} else targetProperty = target[key];
|
||
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
||
// contained in target
|
||
if (!FORCED && targetProperty !== undefined) {
|
||
if (typeof sourceProperty == typeof targetProperty) continue;
|
||
copyConstructorProperties(sourceProperty, targetProperty);
|
||
}
|
||
// add a flag to not completely full polyfills
|
||
if (options.sham || (targetProperty && targetProperty.sham)) {
|
||
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
||
}
|
||
defineBuiltIn(target, key, sourceProperty, options);
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/fails.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/core-js/internals/fails.js ***!
|
||
\*************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
module.exports = function (exec) {
|
||
try {
|
||
return !!exec();
|
||
} catch (error) {
|
||
return true;
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js":
|
||
/*!******************************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js ***!
|
||
\******************************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
// TODO: Remove from `core-js@4` since it's moved to entry points
|
||
__webpack_require__(/*! ../modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js");
|
||
var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js");
|
||
var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "./node_modules/core-js/internals/define-built-in.js");
|
||
var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
|
||
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
|
||
|
||
var SPECIES = wellKnownSymbol('species');
|
||
var RegExpPrototype = RegExp.prototype;
|
||
|
||
module.exports = function (KEY, exec, FORCED, SHAM) {
|
||
var SYMBOL = wellKnownSymbol(KEY);
|
||
|
||
var DELEGATES_TO_SYMBOL = !fails(function () {
|
||
// String methods call symbol-named RegExp methods
|
||
var O = {};
|
||
O[SYMBOL] = function () { return 7; };
|
||
return ''[KEY](O) !== 7;
|
||
});
|
||
|
||
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
||
// Symbol-named RegExp methods call .exec
|
||
var execCalled = false;
|
||
var re = /a/;
|
||
|
||
if (KEY === 'split') {
|
||
// We can't use real regex here since it causes deoptimization
|
||
// and serious performance degradation in V8
|
||
// https://github.com/zloirock/core-js/issues/306
|
||
re = {};
|
||
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
||
// a new one. We need to return the patched regex when creating the new one.
|
||
re.constructor = {};
|
||
re.constructor[SPECIES] = function () { return re; };
|
||
re.flags = '';
|
||
re[SYMBOL] = /./[SYMBOL];
|
||
}
|
||
|
||
re.exec = function () {
|
||
execCalled = true;
|
||
return null;
|
||
};
|
||
|
||
re[SYMBOL]('');
|
||
return !execCalled;
|
||
});
|
||
|
||
if (
|
||
!DELEGATES_TO_SYMBOL ||
|
||
!DELEGATES_TO_EXEC ||
|
||
FORCED
|
||
) {
|
||
var nativeRegExpMethod = /./[SYMBOL];
|
||
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
||
var $exec = regexp.exec;
|
||
if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
|
||
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
||
// The native String method already delegates to @@method (this
|
||
// polyfilled function), leasing to infinite recursion.
|
||
// We avoid it by directly calling the native @@method method.
|
||
return { done: true, value: call(nativeRegExpMethod, regexp, str, arg2) };
|
||
}
|
||
return { done: true, value: call(nativeMethod, str, regexp, arg2) };
|
||
}
|
||
return { done: false };
|
||
});
|
||
|
||
defineBuiltIn(String.prototype, KEY, methods[0]);
|
||
defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
|
||
}
|
||
|
||
if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/function-apply.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/function-apply.js ***!
|
||
\**********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ "./node_modules/core-js/internals/function-bind-native.js");
|
||
|
||
var FunctionPrototype = Function.prototype;
|
||
var apply = FunctionPrototype.apply;
|
||
var call = FunctionPrototype.call;
|
||
|
||
// eslint-disable-next-line es/no-reflect -- safe
|
||
module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
|
||
return call.apply(apply, arguments);
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/function-bind-native.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/function-bind-native.js ***!
|
||
\****************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
|
||
module.exports = !fails(function () {
|
||
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
||
var test = (function () { /* empty */ }).bind();
|
||
// eslint-disable-next-line no-prototype-builtins -- safe
|
||
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/function-call.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/function-call.js ***!
|
||
\*********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ "./node_modules/core-js/internals/function-bind-native.js");
|
||
|
||
var call = Function.prototype.call;
|
||
|
||
module.exports = NATIVE_BIND ? call.bind(call) : function () {
|
||
return call.apply(call, arguments);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/function-name.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/function-name.js ***!
|
||
\*********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
|
||
var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js");
|
||
|
||
var FunctionPrototype = Function.prototype;
|
||
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
||
var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
|
||
|
||
var EXISTS = hasOwn(FunctionPrototype, 'name');
|
||
// additional protection from minified / mangled / dropped function names
|
||
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
||
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
|
||
|
||
module.exports = {
|
||
EXISTS: EXISTS,
|
||
PROPER: PROPER,
|
||
CONFIGURABLE: CONFIGURABLE
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/function-uncurry-this.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/function-uncurry-this.js ***!
|
||
\*****************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ "./node_modules/core-js/internals/function-bind-native.js");
|
||
|
||
var FunctionPrototype = Function.prototype;
|
||
var call = FunctionPrototype.call;
|
||
var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
|
||
|
||
module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
|
||
return function () {
|
||
return call.apply(fn, arguments);
|
||
};
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/get-built-in.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/get-built-in.js ***!
|
||
\********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
|
||
var aFunction = function (argument) {
|
||
return isCallable(argument) ? argument : undefined;
|
||
};
|
||
|
||
module.exports = function (namespace, method) {
|
||
return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/get-method.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/core-js/internals/get-method.js ***!
|
||
\******************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var aCallable = __webpack_require__(/*! ../internals/a-callable */ "./node_modules/core-js/internals/a-callable.js");
|
||
var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "./node_modules/core-js/internals/is-null-or-undefined.js");
|
||
|
||
// `GetMethod` abstract operation
|
||
// https://tc39.es/ecma262/#sec-getmethod
|
||
module.exports = function (V, P) {
|
||
var func = V[P];
|
||
return isNullOrUndefined(func) ? undefined : aCallable(func);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/get-substitution.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/get-substitution.js ***!
|
||
\************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
|
||
|
||
var floor = Math.floor;
|
||
var charAt = uncurryThis(''.charAt);
|
||
var replace = uncurryThis(''.replace);
|
||
var stringSlice = uncurryThis(''.slice);
|
||
// eslint-disable-next-line redos/no-vulnerable -- safe
|
||
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
||
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
||
|
||
// `GetSubstitution` abstract operation
|
||
// https://tc39.es/ecma262/#sec-getsubstitution
|
||
module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
|
||
var tailPos = position + matched.length;
|
||
var m = captures.length;
|
||
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
||
if (namedCaptures !== undefined) {
|
||
namedCaptures = toObject(namedCaptures);
|
||
symbols = SUBSTITUTION_SYMBOLS;
|
||
}
|
||
return replace(replacement, symbols, function (match, ch) {
|
||
var capture;
|
||
switch (charAt(ch, 0)) {
|
||
case '$': return '$';
|
||
case '&': return matched;
|
||
case '`': return stringSlice(str, 0, position);
|
||
case "'": return stringSlice(str, tailPos);
|
||
case '<':
|
||
capture = namedCaptures[stringSlice(ch, 1, -1)];
|
||
break;
|
||
default: // \d\d?
|
||
var n = +ch;
|
||
if (n === 0) return match;
|
||
if (n > m) {
|
||
var f = floor(n / 10);
|
||
if (f === 0) return match;
|
||
if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
|
||
return match;
|
||
}
|
||
capture = captures[n - 1];
|
||
}
|
||
return capture === undefined ? '' : capture;
|
||
});
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/global.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/core-js/internals/global.js ***!
|
||
\**************************************************/
|
||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
||
|
||
"use strict";
|
||
|
||
var check = function (it) {
|
||
return it && it.Math === Math && it;
|
||
};
|
||
|
||
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
||
module.exports =
|
||
// eslint-disable-next-line es/no-global-this -- safe
|
||
check(typeof globalThis == 'object' && globalThis) ||
|
||
check(typeof window == 'object' && window) ||
|
||
// eslint-disable-next-line no-restricted-globals -- safe
|
||
check(typeof self == 'object' && self) ||
|
||
check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) ||
|
||
check(typeof this == 'object' && this) ||
|
||
// eslint-disable-next-line no-new-func -- fallback
|
||
(function () { return this; })() || Function('return this')();
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/has-own-property.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/has-own-property.js ***!
|
||
\************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
|
||
|
||
var hasOwnProperty = uncurryThis({}.hasOwnProperty);
|
||
|
||
// `HasOwnProperty` abstract operation
|
||
// https://tc39.es/ecma262/#sec-hasownproperty
|
||
// eslint-disable-next-line es/no-object-hasown -- safe
|
||
module.exports = Object.hasOwn || function hasOwn(it, key) {
|
||
return hasOwnProperty(toObject(it), key);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/hidden-keys.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/core-js/internals/hidden-keys.js ***!
|
||
\*******************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
module.exports = {};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/html.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/core-js/internals/html.js ***!
|
||
\************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
|
||
|
||
module.exports = getBuiltIn('document', 'documentElement');
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/ie8-dom-define.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/ie8-dom-define.js ***!
|
||
\**********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
var createElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js");
|
||
|
||
// Thanks to IE8 for its funny defineProperty
|
||
module.exports = !DESCRIPTORS && !fails(function () {
|
||
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
||
return Object.defineProperty(createElement('div'), 'a', {
|
||
get: function () { return 7; }
|
||
}).a !== 7;
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/indexed-object.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/indexed-object.js ***!
|
||
\**********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
|
||
|
||
var $Object = Object;
|
||
var split = uncurryThis(''.split);
|
||
|
||
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
||
module.exports = fails(function () {
|
||
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
||
// eslint-disable-next-line no-prototype-builtins -- safe
|
||
return !$Object('z').propertyIsEnumerable(0);
|
||
}) ? function (it) {
|
||
return classof(it) === 'String' ? split(it, '') : $Object(it);
|
||
} : $Object;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/inspect-source.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/inspect-source.js ***!
|
||
\**********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js");
|
||
|
||
var functionToString = uncurryThis(Function.toString);
|
||
|
||
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
||
if (!isCallable(store.inspectSource)) {
|
||
store.inspectSource = function (it) {
|
||
return functionToString(it);
|
||
};
|
||
}
|
||
|
||
module.exports = store.inspectSource;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/internal-state.js":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/internal-state.js ***!
|
||
\**********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var NATIVE_WEAK_MAP = __webpack_require__(/*! ../internals/weak-map-basic-detection */ "./node_modules/core-js/internals/weak-map-basic-detection.js");
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
|
||
var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
|
||
var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js");
|
||
var shared = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js");
|
||
var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
|
||
var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
|
||
|
||
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
||
var TypeError = global.TypeError;
|
||
var WeakMap = global.WeakMap;
|
||
var set, get, has;
|
||
|
||
var enforce = function (it) {
|
||
return has(it) ? get(it) : set(it, {});
|
||
};
|
||
|
||
var getterFor = function (TYPE) {
|
||
return function (it) {
|
||
var state;
|
||
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
||
throw new TypeError('Incompatible receiver, ' + TYPE + ' required');
|
||
} return state;
|
||
};
|
||
};
|
||
|
||
if (NATIVE_WEAK_MAP || shared.state) {
|
||
var store = shared.state || (shared.state = new WeakMap());
|
||
/* eslint-disable no-self-assign -- prototype methods protection */
|
||
store.get = store.get;
|
||
store.has = store.has;
|
||
store.set = store.set;
|
||
/* eslint-enable no-self-assign -- prototype methods protection */
|
||
set = function (it, metadata) {
|
||
if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
||
metadata.facade = it;
|
||
store.set(it, metadata);
|
||
return metadata;
|
||
};
|
||
get = function (it) {
|
||
return store.get(it) || {};
|
||
};
|
||
has = function (it) {
|
||
return store.has(it);
|
||
};
|
||
} else {
|
||
var STATE = sharedKey('state');
|
||
hiddenKeys[STATE] = true;
|
||
set = function (it, metadata) {
|
||
if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
||
metadata.facade = it;
|
||
createNonEnumerableProperty(it, STATE, metadata);
|
||
return metadata;
|
||
};
|
||
get = function (it) {
|
||
return hasOwn(it, STATE) ? it[STATE] : {};
|
||
};
|
||
has = function (it) {
|
||
return hasOwn(it, STATE);
|
||
};
|
||
}
|
||
|
||
module.exports = {
|
||
set: set,
|
||
get: get,
|
||
has: has,
|
||
enforce: enforce,
|
||
getterFor: getterFor
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/is-callable.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/core-js/internals/is-callable.js ***!
|
||
\*******************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
||
var documentAll = typeof document == 'object' && document.all;
|
||
|
||
// `IsCallable` abstract operation
|
||
// https://tc39.es/ecma262/#sec-iscallable
|
||
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
||
module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
||
return typeof argument == 'function' || argument === documentAll;
|
||
} : function (argument) {
|
||
return typeof argument == 'function';
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/is-forced.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/core-js/internals/is-forced.js ***!
|
||
\*****************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
|
||
var replacement = /#|\.prototype\./;
|
||
|
||
var isForced = function (feature, detection) {
|
||
var value = data[normalize(feature)];
|
||
return value === POLYFILL ? true
|
||
: value === NATIVE ? false
|
||
: isCallable(detection) ? fails(detection)
|
||
: !!detection;
|
||
};
|
||
|
||
var normalize = isForced.normalize = function (string) {
|
||
return String(string).replace(replacement, '.').toLowerCase();
|
||
};
|
||
|
||
var data = isForced.data = {};
|
||
var NATIVE = isForced.NATIVE = 'N';
|
||
var POLYFILL = isForced.POLYFILL = 'P';
|
||
|
||
module.exports = isForced;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/is-null-or-undefined.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/is-null-or-undefined.js ***!
|
||
\****************************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
// we can't use just `it == null` since of `document.all` special case
|
||
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
||
module.exports = function (it) {
|
||
return it === null || it === undefined;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/is-object.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/core-js/internals/is-object.js ***!
|
||
\*****************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
|
||
module.exports = function (it) {
|
||
return typeof it == 'object' ? it !== null : isCallable(it);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/is-pure.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/core-js/internals/is-pure.js ***!
|
||
\***************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
module.exports = false;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/is-symbol.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/core-js/internals/is-symbol.js ***!
|
||
\*****************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
var isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ "./node_modules/core-js/internals/object-is-prototype-of.js");
|
||
var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "./node_modules/core-js/internals/use-symbol-as-uid.js");
|
||
|
||
var $Object = Object;
|
||
|
||
module.exports = USE_SYMBOL_AS_UID ? function (it) {
|
||
return typeof it == 'symbol';
|
||
} : function (it) {
|
||
var $Symbol = getBuiltIn('Symbol');
|
||
return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/length-of-array-like.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/length-of-array-like.js ***!
|
||
\****************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
|
||
|
||
// `LengthOfArrayLike` abstract operation
|
||
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
||
module.exports = function (obj) {
|
||
return toLength(obj.length);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/make-built-in.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/make-built-in.js ***!
|
||
\*********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js");
|
||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
|
||
var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(/*! ../internals/function-name */ "./node_modules/core-js/internals/function-name.js").CONFIGURABLE);
|
||
var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/core-js/internals/inspect-source.js");
|
||
var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
|
||
|
||
var enforceInternalState = InternalStateModule.enforce;
|
||
var getInternalState = InternalStateModule.get;
|
||
var $String = String;
|
||
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
||
var defineProperty = Object.defineProperty;
|
||
var stringSlice = uncurryThis(''.slice);
|
||
var replace = uncurryThis(''.replace);
|
||
var join = uncurryThis([].join);
|
||
|
||
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
|
||
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
||
});
|
||
|
||
var TEMPLATE = String(String).split('String');
|
||
|
||
var makeBuiltIn = module.exports = function (value, name, options) {
|
||
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
||
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
||
}
|
||
if (options && options.getter) name = 'get ' + name;
|
||
if (options && options.setter) name = 'set ' + name;
|
||
if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
||
if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
|
||
else value.name = name;
|
||
}
|
||
if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
|
||
defineProperty(value, 'length', { value: options.arity });
|
||
}
|
||
try {
|
||
if (options && hasOwn(options, 'constructor') && options.constructor) {
|
||
if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });
|
||
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
||
} else if (value.prototype) value.prototype = undefined;
|
||
} catch (error) { /* empty */ }
|
||
var state = enforceInternalState(value);
|
||
if (!hasOwn(state, 'source')) {
|
||
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
||
} return value;
|
||
};
|
||
|
||
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
||
// eslint-disable-next-line no-extend-native -- required
|
||
Function.prototype.toString = makeBuiltIn(function toString() {
|
||
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
||
}, 'toString');
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/math-trunc.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/core-js/internals/math-trunc.js ***!
|
||
\******************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
var ceil = Math.ceil;
|
||
var floor = Math.floor;
|
||
|
||
// `Math.trunc` method
|
||
// https://tc39.es/ecma262/#sec-math.trunc
|
||
// eslint-disable-next-line es/no-math-trunc -- safe
|
||
module.exports = Math.trunc || function trunc(x) {
|
||
var n = +x;
|
||
return (n > 0 ? floor : ceil)(n);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/object-create.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/object-create.js ***!
|
||
\*********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
/* global ActiveXObject -- old IE, WSH */
|
||
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
|
||
var definePropertiesModule = __webpack_require__(/*! ../internals/object-define-properties */ "./node_modules/core-js/internals/object-define-properties.js");
|
||
var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js");
|
||
var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
|
||
var html = __webpack_require__(/*! ../internals/html */ "./node_modules/core-js/internals/html.js");
|
||
var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js");
|
||
var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
|
||
|
||
var GT = '>';
|
||
var LT = '<';
|
||
var PROTOTYPE = 'prototype';
|
||
var SCRIPT = 'script';
|
||
var IE_PROTO = sharedKey('IE_PROTO');
|
||
|
||
var EmptyConstructor = function () { /* empty */ };
|
||
|
||
var scriptTag = function (content) {
|
||
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
||
};
|
||
|
||
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
||
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
||
activeXDocument.write(scriptTag(''));
|
||
activeXDocument.close();
|
||
var temp = activeXDocument.parentWindow.Object;
|
||
activeXDocument = null; // avoid memory leak
|
||
return temp;
|
||
};
|
||
|
||
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
||
var NullProtoObjectViaIFrame = function () {
|
||
// Thrash, waste and sodomy: IE GC bug
|
||
var iframe = documentCreateElement('iframe');
|
||
var JS = 'java' + SCRIPT + ':';
|
||
var iframeDocument;
|
||
iframe.style.display = 'none';
|
||
html.appendChild(iframe);
|
||
// https://github.com/zloirock/core-js/issues/475
|
||
iframe.src = String(JS);
|
||
iframeDocument = iframe.contentWindow.document;
|
||
iframeDocument.open();
|
||
iframeDocument.write(scriptTag('document.F=Object'));
|
||
iframeDocument.close();
|
||
return iframeDocument.F;
|
||
};
|
||
|
||
// Check for document.domain and active x support
|
||
// No need to use active x approach when document.domain is not set
|
||
// see https://github.com/es-shims/es5-shim/issues/150
|
||
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
||
// avoid IE GC bug
|
||
var activeXDocument;
|
||
var NullProtoObject = function () {
|
||
try {
|
||
activeXDocument = new ActiveXObject('htmlfile');
|
||
} catch (error) { /* ignore */ }
|
||
NullProtoObject = typeof document != 'undefined'
|
||
? document.domain && activeXDocument
|
||
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
||
: NullProtoObjectViaIFrame()
|
||
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
||
var length = enumBugKeys.length;
|
||
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
||
return NullProtoObject();
|
||
};
|
||
|
||
hiddenKeys[IE_PROTO] = true;
|
||
|
||
// `Object.create` method
|
||
// https://tc39.es/ecma262/#sec-object.create
|
||
// eslint-disable-next-line es/no-object-create -- safe
|
||
module.exports = Object.create || function create(O, Properties) {
|
||
var result;
|
||
if (O !== null) {
|
||
EmptyConstructor[PROTOTYPE] = anObject(O);
|
||
result = new EmptyConstructor();
|
||
EmptyConstructor[PROTOTYPE] = null;
|
||
// add "__proto__" for Object.getPrototypeOf polyfill
|
||
result[IE_PROTO] = O;
|
||
} else result = NullProtoObject();
|
||
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/object-define-properties.js":
|
||
/*!********************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/object-define-properties.js ***!
|
||
\********************************************************************/
|
||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
|
||
var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(/*! ../internals/v8-prototype-define-bug */ "./node_modules/core-js/internals/v8-prototype-define-bug.js");
|
||
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
|
||
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
|
||
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
|
||
var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
|
||
|
||
// `Object.defineProperties` method
|
||
// https://tc39.es/ecma262/#sec-object.defineproperties
|
||
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
||
exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
||
anObject(O);
|
||
var props = toIndexedObject(Properties);
|
||
var keys = objectKeys(Properties);
|
||
var length = keys.length;
|
||
var index = 0;
|
||
var key;
|
||
while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
||
return O;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/object-define-property.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/object-define-property.js ***!
|
||
\******************************************************************/
|
||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
|
||
var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/core-js/internals/ie8-dom-define.js");
|
||
var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(/*! ../internals/v8-prototype-define-bug */ "./node_modules/core-js/internals/v8-prototype-define-bug.js");
|
||
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
|
||
var toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ "./node_modules/core-js/internals/to-property-key.js");
|
||
|
||
var $TypeError = TypeError;
|
||
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
||
var $defineProperty = Object.defineProperty;
|
||
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
||
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
||
var ENUMERABLE = 'enumerable';
|
||
var CONFIGURABLE = 'configurable';
|
||
var WRITABLE = 'writable';
|
||
|
||
// `Object.defineProperty` method
|
||
// https://tc39.es/ecma262/#sec-object.defineproperty
|
||
exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
|
||
anObject(O);
|
||
P = toPropertyKey(P);
|
||
anObject(Attributes);
|
||
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
||
var current = $getOwnPropertyDescriptor(O, P);
|
||
if (current && current[WRITABLE]) {
|
||
O[P] = Attributes.value;
|
||
Attributes = {
|
||
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
|
||
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
||
writable: false
|
||
};
|
||
}
|
||
} return $defineProperty(O, P, Attributes);
|
||
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
||
anObject(O);
|
||
P = toPropertyKey(P);
|
||
anObject(Attributes);
|
||
if (IE8_DOM_DEFINE) try {
|
||
return $defineProperty(O, P, Attributes);
|
||
} catch (error) { /* empty */ }
|
||
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');
|
||
if ('value' in Attributes) O[P] = Attributes.value;
|
||
return O;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/object-get-own-property-descriptor.js":
|
||
/*!******************************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/object-get-own-property-descriptor.js ***!
|
||
\******************************************************************************/
|
||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
|
||
var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js");
|
||
var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js");
|
||
var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
|
||
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
|
||
var toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ "./node_modules/core-js/internals/to-property-key.js");
|
||
var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js");
|
||
var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/core-js/internals/ie8-dom-define.js");
|
||
|
||
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
||
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
||
|
||
// `Object.getOwnPropertyDescriptor` method
|
||
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
||
exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
||
O = toIndexedObject(O);
|
||
P = toPropertyKey(P);
|
||
if (IE8_DOM_DEFINE) try {
|
||
return $getOwnPropertyDescriptor(O, P);
|
||
} catch (error) { /* empty */ }
|
||
if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/object-get-own-property-names.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/object-get-own-property-names.js ***!
|
||
\*************************************************************************/
|
||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/core-js/internals/object-keys-internal.js");
|
||
var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js");
|
||
|
||
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
||
|
||
// `Object.getOwnPropertyNames` method
|
||
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
||
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
||
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
||
return internalObjectKeys(O, hiddenKeys);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/object-get-own-property-symbols.js":
|
||
/*!***************************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/object-get-own-property-symbols.js ***!
|
||
\***************************************************************************/
|
||
/***/ ((__unused_webpack_module, exports) => {
|
||
|
||
"use strict";
|
||
|
||
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
||
exports.f = Object.getOwnPropertySymbols;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/object-is-prototype-of.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/object-is-prototype-of.js ***!
|
||
\******************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
|
||
module.exports = uncurryThis({}.isPrototypeOf);
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/object-keys-internal.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/object-keys-internal.js ***!
|
||
\****************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js");
|
||
var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
|
||
var indexOf = (__webpack_require__(/*! ../internals/array-includes */ "./node_modules/core-js/internals/array-includes.js").indexOf);
|
||
var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
|
||
|
||
var push = uncurryThis([].push);
|
||
|
||
module.exports = function (object, names) {
|
||
var O = toIndexedObject(object);
|
||
var i = 0;
|
||
var result = [];
|
||
var key;
|
||
for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
|
||
// Don't enum bug & hidden keys
|
||
while (names.length > i) if (hasOwn(O, key = names[i++])) {
|
||
~indexOf(result, key) || push(result, key);
|
||
}
|
||
return result;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/object-keys.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/core-js/internals/object-keys.js ***!
|
||
\*******************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/core-js/internals/object-keys-internal.js");
|
||
var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js");
|
||
|
||
// `Object.keys` method
|
||
// https://tc39.es/ecma262/#sec-object.keys
|
||
// eslint-disable-next-line es/no-object-keys -- safe
|
||
module.exports = Object.keys || function keys(O) {
|
||
return internalObjectKeys(O, enumBugKeys);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/object-property-is-enumerable.js":
|
||
/*!*************************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/object-property-is-enumerable.js ***!
|
||
\*************************************************************************/
|
||
/***/ ((__unused_webpack_module, exports) => {
|
||
|
||
"use strict";
|
||
|
||
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
||
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
||
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
||
|
||
// Nashorn ~ JDK8 bug
|
||
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
||
|
||
// `Object.prototype.propertyIsEnumerable` method implementation
|
||
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
||
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
||
var descriptor = getOwnPropertyDescriptor(this, V);
|
||
return !!descriptor && descriptor.enumerable;
|
||
} : $propertyIsEnumerable;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/ordinary-to-primitive.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/ordinary-to-primitive.js ***!
|
||
\*****************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js");
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
|
||
|
||
var $TypeError = TypeError;
|
||
|
||
// `OrdinaryToPrimitive` abstract operation
|
||
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
||
module.exports = function (input, pref) {
|
||
var fn, val;
|
||
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
||
if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
|
||
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
||
throw new $TypeError("Can't convert object to primitive value");
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/own-keys.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/core-js/internals/own-keys.js ***!
|
||
\****************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js");
|
||
var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/core-js/internals/object-get-own-property-symbols.js");
|
||
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
|
||
|
||
var concat = uncurryThis([].concat);
|
||
|
||
// all object keys, includes non-enumerable and symbols
|
||
module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
||
var keys = getOwnPropertyNamesModule.f(anObject(it));
|
||
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
||
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/regexp-exec-abstract.js":
|
||
/*!****************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/regexp-exec-abstract.js ***!
|
||
\****************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js");
|
||
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
|
||
var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
|
||
|
||
var $TypeError = TypeError;
|
||
|
||
// `RegExpExec` abstract operation
|
||
// https://tc39.es/ecma262/#sec-regexpexec
|
||
module.exports = function (R, S) {
|
||
var exec = R.exec;
|
||
if (isCallable(exec)) {
|
||
var result = call(exec, R, S);
|
||
if (result !== null) anObject(result);
|
||
return result;
|
||
}
|
||
if (classof(R) === 'RegExp') return call(regexpExec, R, S);
|
||
throw new $TypeError('RegExp#exec called on incompatible receiver');
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/regexp-exec.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/core-js/internals/regexp-exec.js ***!
|
||
\*******************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
||
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
||
var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js");
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
var toString = __webpack_require__(/*! ../internals/to-string */ "./node_modules/core-js/internals/to-string.js");
|
||
var regexpFlags = __webpack_require__(/*! ../internals/regexp-flags */ "./node_modules/core-js/internals/regexp-flags.js");
|
||
var stickyHelpers = __webpack_require__(/*! ../internals/regexp-sticky-helpers */ "./node_modules/core-js/internals/regexp-sticky-helpers.js");
|
||
var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js");
|
||
var create = __webpack_require__(/*! ../internals/object-create */ "./node_modules/core-js/internals/object-create.js");
|
||
var getInternalState = (__webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js").get);
|
||
var UNSUPPORTED_DOT_ALL = __webpack_require__(/*! ../internals/regexp-unsupported-dot-all */ "./node_modules/core-js/internals/regexp-unsupported-dot-all.js");
|
||
var UNSUPPORTED_NCG = __webpack_require__(/*! ../internals/regexp-unsupported-ncg */ "./node_modules/core-js/internals/regexp-unsupported-ncg.js");
|
||
|
||
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
||
var nativeExec = RegExp.prototype.exec;
|
||
var patchedExec = nativeExec;
|
||
var charAt = uncurryThis(''.charAt);
|
||
var indexOf = uncurryThis(''.indexOf);
|
||
var replace = uncurryThis(''.replace);
|
||
var stringSlice = uncurryThis(''.slice);
|
||
|
||
var UPDATES_LAST_INDEX_WRONG = (function () {
|
||
var re1 = /a/;
|
||
var re2 = /b*/g;
|
||
call(nativeExec, re1, 'a');
|
||
call(nativeExec, re2, 'a');
|
||
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
||
})();
|
||
|
||
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
|
||
|
||
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
||
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
||
|
||
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
||
|
||
if (PATCH) {
|
||
patchedExec = function exec(string) {
|
||
var re = this;
|
||
var state = getInternalState(re);
|
||
var str = toString(string);
|
||
var raw = state.raw;
|
||
var result, reCopy, lastIndex, match, i, object, group;
|
||
|
||
if (raw) {
|
||
raw.lastIndex = re.lastIndex;
|
||
result = call(patchedExec, raw, str);
|
||
re.lastIndex = raw.lastIndex;
|
||
return result;
|
||
}
|
||
|
||
var groups = state.groups;
|
||
var sticky = UNSUPPORTED_Y && re.sticky;
|
||
var flags = call(regexpFlags, re);
|
||
var source = re.source;
|
||
var charsAdded = 0;
|
||
var strCopy = str;
|
||
|
||
if (sticky) {
|
||
flags = replace(flags, 'y', '');
|
||
if (indexOf(flags, 'g') === -1) {
|
||
flags += 'g';
|
||
}
|
||
|
||
strCopy = stringSlice(str, re.lastIndex);
|
||
// Support anchored sticky behavior.
|
||
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
|
||
source = '(?: ' + source + ')';
|
||
strCopy = ' ' + strCopy;
|
||
charsAdded++;
|
||
}
|
||
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
||
// simulate the 'y' flag.
|
||
reCopy = new RegExp('^(?:' + source + ')', flags);
|
||
}
|
||
|
||
if (NPCG_INCLUDED) {
|
||
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
||
}
|
||
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
||
|
||
match = call(nativeExec, sticky ? reCopy : re, strCopy);
|
||
|
||
if (sticky) {
|
||
if (match) {
|
||
match.input = stringSlice(match.input, charsAdded);
|
||
match[0] = stringSlice(match[0], charsAdded);
|
||
match.index = re.lastIndex;
|
||
re.lastIndex += match[0].length;
|
||
} else re.lastIndex = 0;
|
||
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
||
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
||
}
|
||
if (NPCG_INCLUDED && match && match.length > 1) {
|
||
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
||
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
|
||
call(nativeReplace, match[0], reCopy, function () {
|
||
for (i = 1; i < arguments.length - 2; i++) {
|
||
if (arguments[i] === undefined) match[i] = undefined;
|
||
}
|
||
});
|
||
}
|
||
|
||
if (match && groups) {
|
||
match.groups = object = create(null);
|
||
for (i = 0; i < groups.length; i++) {
|
||
group = groups[i];
|
||
object[group[0]] = match[group[1]];
|
||
}
|
||
}
|
||
|
||
return match;
|
||
};
|
||
}
|
||
|
||
module.exports = patchedExec;
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/regexp-flags.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/regexp-flags.js ***!
|
||
\********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
|
||
|
||
// `RegExp.prototype.flags` getter implementation
|
||
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
||
module.exports = function () {
|
||
var that = anObject(this);
|
||
var result = '';
|
||
if (that.hasIndices) result += 'd';
|
||
if (that.global) result += 'g';
|
||
if (that.ignoreCase) result += 'i';
|
||
if (that.multiline) result += 'm';
|
||
if (that.dotAll) result += 's';
|
||
if (that.unicode) result += 'u';
|
||
if (that.unicodeSets) result += 'v';
|
||
if (that.sticky) result += 'y';
|
||
return result;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/regexp-sticky-helpers.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/regexp-sticky-helpers.js ***!
|
||
\*****************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
|
||
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
||
var $RegExp = global.RegExp;
|
||
|
||
var UNSUPPORTED_Y = fails(function () {
|
||
var re = $RegExp('a', 'y');
|
||
re.lastIndex = 2;
|
||
return re.exec('abcd') !== null;
|
||
});
|
||
|
||
// UC Browser bug
|
||
// https://github.com/zloirock/core-js/issues/1008
|
||
var MISSED_STICKY = UNSUPPORTED_Y || fails(function () {
|
||
return !$RegExp('a', 'y').sticky;
|
||
});
|
||
|
||
var BROKEN_CARET = UNSUPPORTED_Y || fails(function () {
|
||
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
||
var re = $RegExp('^r', 'gy');
|
||
re.lastIndex = 2;
|
||
return re.exec('str') !== null;
|
||
});
|
||
|
||
module.exports = {
|
||
BROKEN_CARET: BROKEN_CARET,
|
||
MISSED_STICKY: MISSED_STICKY,
|
||
UNSUPPORTED_Y: UNSUPPORTED_Y
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/regexp-unsupported-dot-all.js":
|
||
/*!**********************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/regexp-unsupported-dot-all.js ***!
|
||
\**********************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
|
||
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
||
var $RegExp = global.RegExp;
|
||
|
||
module.exports = fails(function () {
|
||
var re = $RegExp('.', 's');
|
||
return !(re.dotAll && re.test('\n') && re.flags === 's');
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/regexp-unsupported-ncg.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/regexp-unsupported-ncg.js ***!
|
||
\******************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
|
||
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
||
var $RegExp = global.RegExp;
|
||
|
||
module.exports = fails(function () {
|
||
var re = $RegExp('(?<a>b)', 'g');
|
||
return re.exec('b').groups.a !== 'b' ||
|
||
'b'.replace(re, '$<a>c') !== 'bc';
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/require-object-coercible.js":
|
||
/*!********************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/require-object-coercible.js ***!
|
||
\********************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "./node_modules/core-js/internals/is-null-or-undefined.js");
|
||
|
||
var $TypeError = TypeError;
|
||
|
||
// `RequireObjectCoercible` abstract operation
|
||
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
||
module.exports = function (it) {
|
||
if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it);
|
||
return it;
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/shared-key.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/core-js/internals/shared-key.js ***!
|
||
\******************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js");
|
||
var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
|
||
|
||
var keys = shared('keys');
|
||
|
||
module.exports = function (key) {
|
||
return keys[key] || (keys[key] = uid(key));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/shared-store.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/shared-store.js ***!
|
||
\********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
|
||
var globalThis = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
var defineGlobalProperty = __webpack_require__(/*! ../internals/define-global-property */ "./node_modules/core-js/internals/define-global-property.js");
|
||
|
||
var SHARED = '__core-js_shared__';
|
||
var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
|
||
|
||
(store.versions || (store.versions = [])).push({
|
||
version: '3.36.1',
|
||
mode: IS_PURE ? 'pure' : 'global',
|
||
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
||
license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
|
||
source: 'https://github.com/zloirock/core-js'
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/shared.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/core-js/internals/shared.js ***!
|
||
\**************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js");
|
||
|
||
module.exports = function (key, value) {
|
||
return store[key] || (store[key] = value || {});
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/string-multibyte.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/string-multibyte.js ***!
|
||
\************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
var toIntegerOrInfinity = __webpack_require__(/*! ../internals/to-integer-or-infinity */ "./node_modules/core-js/internals/to-integer-or-infinity.js");
|
||
var toString = __webpack_require__(/*! ../internals/to-string */ "./node_modules/core-js/internals/to-string.js");
|
||
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
|
||
|
||
var charAt = uncurryThis(''.charAt);
|
||
var charCodeAt = uncurryThis(''.charCodeAt);
|
||
var stringSlice = uncurryThis(''.slice);
|
||
|
||
var createMethod = function (CONVERT_TO_STRING) {
|
||
return function ($this, pos) {
|
||
var S = toString(requireObjectCoercible($this));
|
||
var position = toIntegerOrInfinity(pos);
|
||
var size = S.length;
|
||
var first, second;
|
||
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
||
first = charCodeAt(S, position);
|
||
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
||
|| (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
||
? CONVERT_TO_STRING
|
||
? charAt(S, position)
|
||
: first
|
||
: CONVERT_TO_STRING
|
||
? stringSlice(S, position, position + 2)
|
||
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
||
};
|
||
};
|
||
|
||
module.exports = {
|
||
// `String.prototype.codePointAt` method
|
||
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
||
codeAt: createMethod(false),
|
||
// `String.prototype.at` method
|
||
// https://github.com/mathiasbynens/String.prototype.at
|
||
charAt: createMethod(true)
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/symbol-constructor-detection.js":
|
||
/*!************************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/symbol-constructor-detection.js ***!
|
||
\************************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
/* eslint-disable es/no-symbol -- required for testing */
|
||
var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "./node_modules/core-js/internals/engine-v8-version.js");
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
|
||
var $String = global.String;
|
||
|
||
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
||
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
||
var symbol = Symbol('symbol detection');
|
||
// Chrome 38 Symbol has incorrect toString conversion
|
||
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
||
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
||
// of course, fail.
|
||
return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
||
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
||
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/to-absolute-index.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/to-absolute-index.js ***!
|
||
\*************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var toIntegerOrInfinity = __webpack_require__(/*! ../internals/to-integer-or-infinity */ "./node_modules/core-js/internals/to-integer-or-infinity.js");
|
||
|
||
var max = Math.max;
|
||
var min = Math.min;
|
||
|
||
// Helper for a popular repeating case of the spec:
|
||
// Let integer be ? ToInteger(index).
|
||
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
||
module.exports = function (index, length) {
|
||
var integer = toIntegerOrInfinity(index);
|
||
return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/to-indexed-object.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/to-indexed-object.js ***!
|
||
\*************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
// toObject with fallback for non-array-like ES3 strings
|
||
var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
|
||
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
|
||
|
||
module.exports = function (it) {
|
||
return IndexedObject(requireObjectCoercible(it));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/to-integer-or-infinity.js":
|
||
/*!******************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/to-integer-or-infinity.js ***!
|
||
\******************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var trunc = __webpack_require__(/*! ../internals/math-trunc */ "./node_modules/core-js/internals/math-trunc.js");
|
||
|
||
// `ToIntegerOrInfinity` abstract operation
|
||
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
||
module.exports = function (argument) {
|
||
var number = +argument;
|
||
// eslint-disable-next-line no-self-compare -- NaN check
|
||
return number !== number || number === 0 ? 0 : trunc(number);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/to-length.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/core-js/internals/to-length.js ***!
|
||
\*****************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var toIntegerOrInfinity = __webpack_require__(/*! ../internals/to-integer-or-infinity */ "./node_modules/core-js/internals/to-integer-or-infinity.js");
|
||
|
||
var min = Math.min;
|
||
|
||
// `ToLength` abstract operation
|
||
// https://tc39.es/ecma262/#sec-tolength
|
||
module.exports = function (argument) {
|
||
var len = toIntegerOrInfinity(argument);
|
||
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/to-object.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/core-js/internals/to-object.js ***!
|
||
\*****************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
|
||
|
||
var $Object = Object;
|
||
|
||
// `ToObject` abstract operation
|
||
// https://tc39.es/ecma262/#sec-toobject
|
||
module.exports = function (argument) {
|
||
return $Object(requireObjectCoercible(argument));
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/to-primitive.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/to-primitive.js ***!
|
||
\********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js");
|
||
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
|
||
var isSymbol = __webpack_require__(/*! ../internals/is-symbol */ "./node_modules/core-js/internals/is-symbol.js");
|
||
var getMethod = __webpack_require__(/*! ../internals/get-method */ "./node_modules/core-js/internals/get-method.js");
|
||
var ordinaryToPrimitive = __webpack_require__(/*! ../internals/ordinary-to-primitive */ "./node_modules/core-js/internals/ordinary-to-primitive.js");
|
||
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
|
||
|
||
var $TypeError = TypeError;
|
||
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
||
|
||
// `ToPrimitive` abstract operation
|
||
// https://tc39.es/ecma262/#sec-toprimitive
|
||
module.exports = function (input, pref) {
|
||
if (!isObject(input) || isSymbol(input)) return input;
|
||
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
||
var result;
|
||
if (exoticToPrim) {
|
||
if (pref === undefined) pref = 'default';
|
||
result = call(exoticToPrim, input, pref);
|
||
if (!isObject(result) || isSymbol(result)) return result;
|
||
throw new $TypeError("Can't convert object to primitive value");
|
||
}
|
||
if (pref === undefined) pref = 'number';
|
||
return ordinaryToPrimitive(input, pref);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/to-property-key.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/to-property-key.js ***!
|
||
\***********************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
|
||
var isSymbol = __webpack_require__(/*! ../internals/is-symbol */ "./node_modules/core-js/internals/is-symbol.js");
|
||
|
||
// `ToPropertyKey` abstract operation
|
||
// https://tc39.es/ecma262/#sec-topropertykey
|
||
module.exports = function (argument) {
|
||
var key = toPrimitive(argument, 'string');
|
||
return isSymbol(key) ? key : key + '';
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/to-string-tag-support.js":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/to-string-tag-support.js ***!
|
||
\*****************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
|
||
|
||
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
||
var test = {};
|
||
|
||
test[TO_STRING_TAG] = 'z';
|
||
|
||
module.exports = String(test) === '[object z]';
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/to-string.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/core-js/internals/to-string.js ***!
|
||
\*****************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var classof = __webpack_require__(/*! ../internals/classof */ "./node_modules/core-js/internals/classof.js");
|
||
|
||
var $String = String;
|
||
|
||
module.exports = function (argument) {
|
||
if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
||
return $String(argument);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/try-to-string.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/core-js/internals/try-to-string.js ***!
|
||
\*********************************************************/
|
||
/***/ ((module) => {
|
||
|
||
"use strict";
|
||
|
||
var $String = String;
|
||
|
||
module.exports = function (argument) {
|
||
try {
|
||
return $String(argument);
|
||
} catch (error) {
|
||
return 'Object';
|
||
}
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/uid.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/core-js/internals/uid.js ***!
|
||
\***********************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
|
||
var id = 0;
|
||
var postfix = Math.random();
|
||
var toString = uncurryThis(1.0.toString);
|
||
|
||
module.exports = function (key) {
|
||
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/use-symbol-as-uid.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/use-symbol-as-uid.js ***!
|
||
\*************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
/* eslint-disable es/no-symbol -- required for testing */
|
||
var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ "./node_modules/core-js/internals/symbol-constructor-detection.js");
|
||
|
||
module.exports = NATIVE_SYMBOL
|
||
&& !Symbol.sham
|
||
&& typeof Symbol.iterator == 'symbol';
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/v8-prototype-define-bug.js":
|
||
/*!*******************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/v8-prototype-define-bug.js ***!
|
||
\*******************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
|
||
// V8 ~ Chrome 36-
|
||
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
||
module.exports = DESCRIPTORS && fails(function () {
|
||
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
||
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
||
value: 42,
|
||
writable: false
|
||
}).prototype !== 42;
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/weak-map-basic-detection.js":
|
||
/*!********************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/weak-map-basic-detection.js ***!
|
||
\********************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
|
||
var WeakMap = global.WeakMap;
|
||
|
||
module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/internals/well-known-symbol.js":
|
||
/*!*************************************************************!*\
|
||
!*** ./node_modules/core-js/internals/well-known-symbol.js ***!
|
||
\*************************************************************/
|
||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
|
||
var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js");
|
||
var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "./node_modules/core-js/internals/has-own-property.js");
|
||
var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
|
||
var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ "./node_modules/core-js/internals/symbol-constructor-detection.js");
|
||
var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "./node_modules/core-js/internals/use-symbol-as-uid.js");
|
||
|
||
var Symbol = global.Symbol;
|
||
var WellKnownSymbolsStore = shared('wks');
|
||
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;
|
||
|
||
module.exports = function (name) {
|
||
if (!hasOwn(WellKnownSymbolsStore, name)) {
|
||
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)
|
||
? Symbol[name]
|
||
: createWellKnownSymbol('Symbol.' + name);
|
||
} return WellKnownSymbolsStore[name];
|
||
};
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/modules/es.regexp.exec.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/core-js/modules/es.regexp.exec.js ***!
|
||
\********************************************************/
|
||
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
|
||
var exec = __webpack_require__(/*! ../internals/regexp-exec */ "./node_modules/core-js/internals/regexp-exec.js");
|
||
|
||
// `RegExp.prototype.exec` method
|
||
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
||
$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
||
exec: exec
|
||
});
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/core-js/modules/es.string.replace.js":
|
||
/*!***********************************************************!*\
|
||
!*** ./node_modules/core-js/modules/es.string.replace.js ***!
|
||
\***********************************************************/
|
||
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
|
||
var apply = __webpack_require__(/*! ../internals/function-apply */ "./node_modules/core-js/internals/function-apply.js");
|
||
var call = __webpack_require__(/*! ../internals/function-call */ "./node_modules/core-js/internals/function-call.js");
|
||
var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "./node_modules/core-js/internals/function-uncurry-this.js");
|
||
var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
|
||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
||
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
|
||
var isCallable = __webpack_require__(/*! ../internals/is-callable */ "./node_modules/core-js/internals/is-callable.js");
|
||
var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "./node_modules/core-js/internals/is-null-or-undefined.js");
|
||
var toIntegerOrInfinity = __webpack_require__(/*! ../internals/to-integer-or-infinity */ "./node_modules/core-js/internals/to-integer-or-infinity.js");
|
||
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
|
||
var toString = __webpack_require__(/*! ../internals/to-string */ "./node_modules/core-js/internals/to-string.js");
|
||
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
|
||
var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js");
|
||
var getMethod = __webpack_require__(/*! ../internals/get-method */ "./node_modules/core-js/internals/get-method.js");
|
||
var getSubstitution = __webpack_require__(/*! ../internals/get-substitution */ "./node_modules/core-js/internals/get-substitution.js");
|
||
var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js");
|
||
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js");
|
||
|
||
var REPLACE = wellKnownSymbol('replace');
|
||
var max = Math.max;
|
||
var min = Math.min;
|
||
var concat = uncurryThis([].concat);
|
||
var push = uncurryThis([].push);
|
||
var stringIndexOf = uncurryThis(''.indexOf);
|
||
var stringSlice = uncurryThis(''.slice);
|
||
|
||
var maybeToString = function (it) {
|
||
return it === undefined ? it : String(it);
|
||
};
|
||
|
||
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
||
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
||
var REPLACE_KEEPS_$0 = (function () {
|
||
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
|
||
return 'a'.replace(/./, '$0') === '$0';
|
||
})();
|
||
|
||
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
|
||
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
||
if (/./[REPLACE]) {
|
||
return /./[REPLACE]('a', '$0') === '';
|
||
}
|
||
return false;
|
||
})();
|
||
|
||
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
||
var re = /./;
|
||
re.exec = function () {
|
||
var result = [];
|
||
result.groups = { a: '7' };
|
||
return result;
|
||
};
|
||
// eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
|
||
return ''.replace(re, '$<a>') !== '7';
|
||
});
|
||
|
||
// @@replace logic
|
||
fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
|
||
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
||
|
||
return [
|
||
// `String.prototype.replace` method
|
||
// https://tc39.es/ecma262/#sec-string.prototype.replace
|
||
function replace(searchValue, replaceValue) {
|
||
var O = requireObjectCoercible(this);
|
||
var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);
|
||
return replacer
|
||
? call(replacer, searchValue, O, replaceValue)
|
||
: call(nativeReplace, toString(O), searchValue, replaceValue);
|
||
},
|
||
// `RegExp.prototype[@@replace]` method
|
||
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
|
||
function (string, replaceValue) {
|
||
var rx = anObject(this);
|
||
var S = toString(string);
|
||
|
||
if (
|
||
typeof replaceValue == 'string' &&
|
||
stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
|
||
stringIndexOf(replaceValue, '$<') === -1
|
||
) {
|
||
var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
|
||
if (res.done) return res.value;
|
||
}
|
||
|
||
var functionalReplace = isCallable(replaceValue);
|
||
if (!functionalReplace) replaceValue = toString(replaceValue);
|
||
|
||
var global = rx.global;
|
||
var fullUnicode;
|
||
if (global) {
|
||
fullUnicode = rx.unicode;
|
||
rx.lastIndex = 0;
|
||
}
|
||
|
||
var results = [];
|
||
var result;
|
||
while (true) {
|
||
result = regExpExec(rx, S);
|
||
if (result === null) break;
|
||
|
||
push(results, result);
|
||
if (!global) break;
|
||
|
||
var matchStr = toString(result[0]);
|
||
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
||
}
|
||
|
||
var accumulatedResult = '';
|
||
var nextSourcePosition = 0;
|
||
for (var i = 0; i < results.length; i++) {
|
||
result = results[i];
|
||
|
||
var matched = toString(result[0]);
|
||
var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
|
||
var captures = [];
|
||
var replacement;
|
||
// NOTE: This is equivalent to
|
||
// captures = result.slice(1).map(maybeToString)
|
||
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
|
||
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
|
||
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
|
||
for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
|
||
var namedCaptures = result.groups;
|
||
if (functionalReplace) {
|
||
var replacerArgs = concat([matched], captures, position, S);
|
||
if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
|
||
replacement = toString(apply(replaceValue, undefined, replacerArgs));
|
||
} else {
|
||
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
||
}
|
||
if (position >= nextSourcePosition) {
|
||
accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
|
||
nextSourcePosition = position + matched.length;
|
||
}
|
||
}
|
||
|
||
return accumulatedResult + stringSlice(S, nextSourcePosition);
|
||
}
|
||
];
|
||
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/auth/dist/index.es.mjs":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/@nextcloud/auth/dist/index.es.mjs ***!
|
||
\********************************************************/
|
||
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ getCurrentUser: () => (/* binding */ getCurrentUser),
|
||
/* harmony export */ getRequestToken: () => (/* binding */ getRequestToken),
|
||
/* harmony export */ onRequestTokenUpdate: () => (/* binding */ onRequestTokenUpdate)
|
||
/* harmony export */ });
|
||
/* harmony import */ var _nextcloud_event_bus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/event-bus */ "./node_modules/@nextcloud/event-bus/dist/index.mjs");
|
||
|
||
|
||
let token = undefined;
|
||
const observers = [];
|
||
/**
|
||
* Get current request token
|
||
*
|
||
* @return {string|null} Current request token or null if not set
|
||
*/
|
||
function getRequestToken() {
|
||
if (token === undefined) {
|
||
// Only on first load, try to get token from document
|
||
const tokenElement = document?.getElementsByTagName('head')[0];
|
||
token = tokenElement ? tokenElement.getAttribute('data-requesttoken') : null;
|
||
}
|
||
return token;
|
||
}
|
||
/**
|
||
* Add an observer which is called when the CSRF token changes
|
||
*
|
||
* @param observer The observer
|
||
*/
|
||
function onRequestTokenUpdate(observer) {
|
||
observers.push(observer);
|
||
}
|
||
// Listen to server event and keep token in sync
|
||
(0,_nextcloud_event_bus__WEBPACK_IMPORTED_MODULE_0__.subscribe)('csrf-token-update', e => {
|
||
token = e.token;
|
||
observers.forEach(observer => {
|
||
try {
|
||
observer(e.token);
|
||
}
|
||
catch (e) {
|
||
console.error('error updating CSRF token observer', e);
|
||
}
|
||
});
|
||
});
|
||
|
||
const getAttribute = (el, attribute) => {
|
||
if (el) {
|
||
return el.getAttribute(attribute);
|
||
}
|
||
return null;
|
||
};
|
||
let currentUser = undefined;
|
||
function getCurrentUser() {
|
||
if (currentUser !== undefined) {
|
||
return currentUser;
|
||
}
|
||
const head = document?.getElementsByTagName('head')[0];
|
||
if (!head) {
|
||
return null;
|
||
}
|
||
// No user logged in so cache and return null
|
||
const uid = getAttribute(head, 'data-user');
|
||
if (uid === null) {
|
||
currentUser = null;
|
||
return currentUser;
|
||
}
|
||
currentUser = {
|
||
uid,
|
||
displayName: getAttribute(head, 'data-user-displayname'),
|
||
isAdmin: !!window._oc_isadmin,
|
||
};
|
||
return currentUser;
|
||
}
|
||
|
||
|
||
//# sourceMappingURL=index.es.mjs.map
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/event-bus/dist/index.mjs":
|
||
/*!**********************************************************!*\
|
||
!*** ./node_modules/@nextcloud/event-bus/dist/index.mjs ***!
|
||
\**********************************************************/
|
||
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ ProxyBus: () => (/* binding */ ProxyBus),
|
||
/* harmony export */ SimpleBus: () => (/* binding */ SimpleBus),
|
||
/* harmony export */ emit: () => (/* binding */ emit),
|
||
/* harmony export */ subscribe: () => (/* binding */ subscribe),
|
||
/* harmony export */ unsubscribe: () => (/* binding */ unsubscribe)
|
||
/* harmony export */ });
|
||
/* harmony import */ var semver_functions_valid_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! semver/functions/valid.js */ "./node_modules/@nextcloud/event-bus/node_modules/semver/functions/valid.js");
|
||
/* harmony import */ var semver_functions_major_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! semver/functions/major.js */ "./node_modules/@nextcloud/event-bus/node_modules/semver/functions/major.js");
|
||
|
||
|
||
|
||
class ProxyBus {
|
||
bus;
|
||
constructor(bus) {
|
||
if (typeof bus.getVersion !== 'function' || !semver_functions_valid_js__WEBPACK_IMPORTED_MODULE_0__(bus.getVersion())) {
|
||
console.warn('Proxying an event bus with an unknown or invalid version');
|
||
}
|
||
else if (semver_functions_major_js__WEBPACK_IMPORTED_MODULE_1__(bus.getVersion()) !== semver_functions_major_js__WEBPACK_IMPORTED_MODULE_1__(this.getVersion())) {
|
||
console.warn('Proxying an event bus of version ' + bus.getVersion() + ' with ' + this.getVersion());
|
||
}
|
||
this.bus = bus;
|
||
}
|
||
getVersion() {
|
||
return "3.1.0";
|
||
}
|
||
subscribe(name, handler) {
|
||
this.bus.subscribe(name, handler);
|
||
}
|
||
unsubscribe(name, handler) {
|
||
this.bus.unsubscribe(name, handler);
|
||
}
|
||
emit(name, event) {
|
||
this.bus.emit(name, event);
|
||
}
|
||
}
|
||
|
||
class SimpleBus {
|
||
handlers = new Map();
|
||
getVersion() {
|
||
return "3.1.0";
|
||
}
|
||
subscribe(name, handler) {
|
||
this.handlers.set(name, (this.handlers.get(name) || []).concat(handler));
|
||
}
|
||
unsubscribe(name, handler) {
|
||
this.handlers.set(name, (this.handlers.get(name) || []).filter(h => h != handler));
|
||
}
|
||
emit(name, event) {
|
||
(this.handlers.get(name) || []).forEach(h => {
|
||
try {
|
||
h(event);
|
||
}
|
||
catch (e) {
|
||
console.error('could not invoke event listener', e);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
let bus = null;
|
||
function getBus() {
|
||
if (bus !== null) {
|
||
return bus;
|
||
}
|
||
if (typeof window === 'undefined') {
|
||
// testing or SSR
|
||
return new Proxy({}, {
|
||
get: () => {
|
||
return () => console.error('Window not available, EventBus can not be established!');
|
||
}
|
||
});
|
||
}
|
||
if (typeof window.OC !== 'undefined' && window.OC._eventBus && typeof window._nc_event_bus === 'undefined') {
|
||
console.warn('found old event bus instance at OC._eventBus. Update your version!');
|
||
window._nc_event_bus = window.OC._eventBus;
|
||
}
|
||
// Either use an existing event bus instance or create one
|
||
if (typeof window?._nc_event_bus !== 'undefined') {
|
||
bus = new ProxyBus(window._nc_event_bus);
|
||
}
|
||
else {
|
||
bus = window._nc_event_bus = new SimpleBus();
|
||
}
|
||
return bus;
|
||
}
|
||
/**
|
||
* Register an event listener
|
||
*
|
||
* @param name name of the event
|
||
* @param handler callback invoked for every matching event emitted on the bus
|
||
*/
|
||
function subscribe(name, handler) {
|
||
getBus().subscribe(name, handler);
|
||
}
|
||
/**
|
||
* Unregister a previously registered event listener
|
||
*
|
||
* Note: doesn't work with anonymous functions (closures). Use method of an object or store listener function in variable.
|
||
*
|
||
* @param name name of the event
|
||
* @param handler callback passed to `subscribed`
|
||
*/
|
||
function unsubscribe(name, handler) {
|
||
getBus().unsubscribe(name, handler);
|
||
}
|
||
/**
|
||
* Emit an event
|
||
*
|
||
* @param name name of the event
|
||
* @param event event payload
|
||
*/
|
||
function emit(name, event) {
|
||
getBus().emit(name, event);
|
||
}
|
||
|
||
|
||
//# sourceMappingURL=index.mjs.map
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/initial-state/dist/index.es.mjs":
|
||
/*!*****************************************************************!*\
|
||
!*** ./node_modules/@nextcloud/initial-state/dist/index.es.mjs ***!
|
||
\*****************************************************************/
|
||
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ loadState: () => (/* binding */ loadState)
|
||
/* harmony export */ });
|
||
/**
|
||
* @param app app ID, e.g. "mail"
|
||
* @param key name of the property
|
||
* @param fallback optional parameter to use as default value
|
||
* @throws if the key can't be found
|
||
*/
|
||
function loadState(app, key, fallback) {
|
||
const elem = document.querySelector(`#initial-state-${app}-${key}`);
|
||
if (elem === null) {
|
||
if (fallback !== undefined) {
|
||
return fallback;
|
||
}
|
||
throw new Error(`Could not find initial state ${key} of ${app}`);
|
||
}
|
||
try {
|
||
return JSON.parse(atob(elem.value));
|
||
}
|
||
catch (e) {
|
||
throw new Error(`Could not parse initial state ${key} of ${app}`);
|
||
}
|
||
}
|
||
|
||
|
||
//# sourceMappingURL=index.es.mjs.map
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/l10n/dist/index.mjs":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/@nextcloud/l10n/dist/index.mjs ***!
|
||
\*****************************************************/
|
||
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ getCanonicalLocale: () => (/* binding */ getCanonicalLocale),
|
||
/* harmony export */ getDayNames: () => (/* binding */ getDayNames),
|
||
/* harmony export */ getDayNamesMin: () => (/* binding */ getDayNamesMin),
|
||
/* harmony export */ getDayNamesShort: () => (/* binding */ getDayNamesShort),
|
||
/* harmony export */ getFirstDay: () => (/* binding */ getFirstDay),
|
||
/* harmony export */ getLanguage: () => (/* binding */ getLanguage),
|
||
/* harmony export */ getLocale: () => (/* binding */ getLocale),
|
||
/* harmony export */ getMonthNames: () => (/* binding */ getMonthNames),
|
||
/* harmony export */ getMonthNamesShort: () => (/* binding */ getMonthNamesShort),
|
||
/* harmony export */ getPlural: () => (/* binding */ getPlural),
|
||
/* harmony export */ isRTL: () => (/* binding */ isRTL),
|
||
/* harmony export */ loadTranslations: () => (/* binding */ loadTranslations),
|
||
/* harmony export */ register: () => (/* binding */ register),
|
||
/* harmony export */ translate: () => (/* binding */ translate),
|
||
/* harmony export */ translatePlural: () => (/* binding */ translatePlural),
|
||
/* harmony export */ unregister: () => (/* binding */ unregister)
|
||
/* harmony export */ });
|
||
/* harmony import */ var _nextcloud_router__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/router */ "./node_modules/@nextcloud/l10n/node_modules/@nextcloud/router/dist/index.js");
|
||
/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.js");
|
||
/* harmony import */ var escape_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! escape-html */ "./node_modules/escape-html/index.js");
|
||
|
||
|
||
|
||
|
||
/// <reference types="@nextcloud/typings" />
|
||
/**
|
||
* Get the first day of the week
|
||
*
|
||
* @return {number}
|
||
*/
|
||
function getFirstDay() {
|
||
if (typeof window.firstDay === 'undefined') {
|
||
console.warn('No firstDay found');
|
||
return 1;
|
||
}
|
||
return window.firstDay;
|
||
}
|
||
/**
|
||
* Get a list of day names (full names)
|
||
*
|
||
* @return {string[]}
|
||
*/
|
||
function getDayNames() {
|
||
if (typeof window.dayNames === 'undefined') {
|
||
console.warn('No dayNames found');
|
||
return [
|
||
'Sunday',
|
||
'Monday',
|
||
'Tuesday',
|
||
'Wednesday',
|
||
'Thursday',
|
||
'Friday',
|
||
'Saturday',
|
||
];
|
||
}
|
||
return window.dayNames;
|
||
}
|
||
/**
|
||
* Get a list of day names (short names)
|
||
*
|
||
* @return {string[]}
|
||
*/
|
||
function getDayNamesShort() {
|
||
if (typeof window.dayNamesShort === 'undefined') {
|
||
console.warn('No dayNamesShort found');
|
||
return ['Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'];
|
||
}
|
||
return window.dayNamesShort;
|
||
}
|
||
/**
|
||
* Get a list of day names (minified names)
|
||
*
|
||
* @return {string[]}
|
||
*/
|
||
function getDayNamesMin() {
|
||
if (typeof window.dayNamesMin === 'undefined') {
|
||
console.warn('No dayNamesMin found');
|
||
return ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
||
}
|
||
return window.dayNamesMin;
|
||
}
|
||
/**
|
||
* Get a list of month names (full names)
|
||
*
|
||
* @return {string[]}
|
||
*/
|
||
function getMonthNames() {
|
||
if (typeof window.monthNames === 'undefined') {
|
||
console.warn('No monthNames found');
|
||
return [
|
||
'January',
|
||
'February',
|
||
'March',
|
||
'April',
|
||
'May',
|
||
'June',
|
||
'July',
|
||
'August',
|
||
'September',
|
||
'October',
|
||
'November',
|
||
'December',
|
||
];
|
||
}
|
||
return window.monthNames;
|
||
}
|
||
/**
|
||
* Get a list of month names (short names)
|
||
*
|
||
* @return {string[]}
|
||
*/
|
||
function getMonthNamesShort() {
|
||
if (typeof window.monthNamesShort === 'undefined') {
|
||
console.warn('No monthNamesShort found');
|
||
return [
|
||
'Jan.',
|
||
'Feb.',
|
||
'Mar.',
|
||
'Apr.',
|
||
'May.',
|
||
'Jun.',
|
||
'Jul.',
|
||
'Aug.',
|
||
'Sep.',
|
||
'Oct.',
|
||
'Nov.',
|
||
'Dec.',
|
||
];
|
||
}
|
||
return window.monthNamesShort;
|
||
}
|
||
|
||
/**
|
||
* Returns the user's locale
|
||
*/
|
||
function getLocale() {
|
||
return document.documentElement.dataset.locale || 'en';
|
||
}
|
||
/**
|
||
* Returns user's locale in canonical form
|
||
* E.g. `en-US` instead of `en_US`
|
||
*/
|
||
function getCanonicalLocale() {
|
||
return getLocale().replace(/_/g, '-');
|
||
}
|
||
/**
|
||
* Returns the user's language
|
||
*/
|
||
function getLanguage() {
|
||
return document.documentElement.lang || 'en';
|
||
}
|
||
/**
|
||
* Check whether the current, or a given, language is read right-to-left
|
||
*
|
||
* @param language Language code to check, defaults to current language
|
||
*/
|
||
function isRTL(language) {
|
||
const languageCode = language || getLanguage();
|
||
// Source: https://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code
|
||
const rtlLanguages = [
|
||
/* eslint-disable no-multi-spaces */
|
||
'ae',
|
||
'ar',
|
||
'arc',
|
||
'arz',
|
||
'bcc',
|
||
'bqi',
|
||
'ckb',
|
||
'dv',
|
||
'fa',
|
||
'glk',
|
||
'ha',
|
||
'he',
|
||
'khw',
|
||
'ks',
|
||
'ku',
|
||
'mzn',
|
||
'nqo',
|
||
'pnb',
|
||
'ps',
|
||
'sd',
|
||
'ug',
|
||
'ur',
|
||
'uzs',
|
||
'yi', // 'ייִדיש', Yiddish
|
||
/* eslint-enable no-multi-spaces */
|
||
];
|
||
// special case for Uzbek Afghan
|
||
if ((language || getCanonicalLocale()).startsWith('uz-AF')) {
|
||
return true;
|
||
}
|
||
return rtlLanguages.includes(languageCode);
|
||
}
|
||
|
||
/// <reference types="@nextcloud/typings" />
|
||
/**
|
||
* Check if translations and plural function are set for given app
|
||
*
|
||
* @param {string} appId the app id
|
||
* @return {boolean}
|
||
*/
|
||
function hasAppTranslations(appId) {
|
||
var _a, _b;
|
||
return (((_a = window._oc_l10n_registry_translations) === null || _a === void 0 ? void 0 : _a[appId]) !== undefined
|
||
&& ((_b = window._oc_l10n_registry_plural_functions) === null || _b === void 0 ? void 0 : _b[appId]) !== undefined);
|
||
}
|
||
/**
|
||
* Register new, or extend available, translations for an app
|
||
*
|
||
* @param {string} appId the app id
|
||
* @param {object} translations the translations list
|
||
* @param {Function} pluralFunction the plural function
|
||
*/
|
||
function registerAppTranslations(appId, translations, pluralFunction) {
|
||
var _a;
|
||
window._oc_l10n_registry_translations = Object.assign(window._oc_l10n_registry_translations || {}, {
|
||
[appId]: Object.assign(((_a = window._oc_l10n_registry_translations) === null || _a === void 0 ? void 0 : _a[appId]) || {}, translations),
|
||
});
|
||
window._oc_l10n_registry_plural_functions = Object.assign(window._oc_l10n_registry_plural_functions || {}, {
|
||
[appId]: pluralFunction,
|
||
});
|
||
}
|
||
/**
|
||
* Unregister all translations and plural function for given app
|
||
*
|
||
* @param {string} appId the app id
|
||
*/
|
||
function unregisterAppTranslations(appId) {
|
||
var _a, _b;
|
||
(_a = window._oc_l10n_registry_translations) === null || _a === void 0 ? true : delete _a[appId];
|
||
(_b = window._oc_l10n_registry_plural_functions) === null || _b === void 0 ? true : delete _b[appId];
|
||
}
|
||
/**
|
||
* Get translations bundle for given app and current locale
|
||
*
|
||
* @param {string} appId the app id
|
||
* @return {object}
|
||
*/
|
||
function getAppTranslations(appId) {
|
||
var _a, _b, _c, _d;
|
||
return {
|
||
translations: (_b = (_a = window._oc_l10n_registry_translations) === null || _a === void 0 ? void 0 : _a[appId]) !== null && _b !== void 0 ? _b : {},
|
||
pluralFunction: (_d = (_c = window._oc_l10n_registry_plural_functions) === null || _c === void 0 ? void 0 : _c[appId]) !== null && _d !== void 0 ? _d : ((number) => number),
|
||
};
|
||
}
|
||
|
||
/**
|
||
* Translate a string
|
||
*
|
||
* @param {string} app the id of the app for which to translate the string
|
||
* @param {string} text the string to translate
|
||
* @param {object} vars map of placeholder key to value
|
||
* @param {number} number to replace %n with
|
||
* @param {object} [options] options object
|
||
* @return {string}
|
||
*/
|
||
function translate(app, text, vars, number, options) {
|
||
const defaultOptions = {
|
||
escape: true,
|
||
sanitize: true,
|
||
};
|
||
const allOptions = Object.assign({}, defaultOptions, options || {});
|
||
const identity = (value) => value;
|
||
const optSanitize = allOptions.sanitize ? dompurify__WEBPACK_IMPORTED_MODULE_1__.sanitize : identity;
|
||
const optEscape = allOptions.escape ? escape_html__WEBPACK_IMPORTED_MODULE_2__ : identity;
|
||
// TODO: cache this function to avoid inline recreation
|
||
// of the same function over and over again in case
|
||
// translate() is used in a loop
|
||
const _build = (text, vars, number) => {
|
||
return text.replace(/%n/g, '' + number).replace(/{([^{}]*)}/g, (match, key) => {
|
||
if (vars === undefined || !(key in vars)) {
|
||
return optSanitize(match);
|
||
}
|
||
const r = vars[key];
|
||
if (typeof r === 'string' || typeof r === 'number') {
|
||
return optSanitize(optEscape(r));
|
||
}
|
||
else {
|
||
return optSanitize(match);
|
||
}
|
||
});
|
||
};
|
||
const bundle = getAppTranslations(app);
|
||
let translation = bundle.translations[text] || text;
|
||
translation = Array.isArray(translation) ? translation[0] : translation;
|
||
if (typeof vars === 'object' || number !== undefined) {
|
||
return optSanitize(_build(translation, vars, number));
|
||
}
|
||
else {
|
||
return optSanitize(translation);
|
||
}
|
||
}
|
||
/**
|
||
* Translate a string containing an object which possibly requires a plural form
|
||
*
|
||
* @param {string} app the id of the app for which to translate the string
|
||
* @param {string} textSingular the string to translate for exactly one object
|
||
* @param {string} textPlural the string to translate for n objects
|
||
* @param {number} number number to determine whether to use singular or plural
|
||
* @param {object} vars of placeholder key to value
|
||
* @param {object} options options object
|
||
*/
|
||
function translatePlural(app, textSingular, textPlural, number, vars, options) {
|
||
const identifier = '_' + textSingular + '_::_' + textPlural + '_';
|
||
const bundle = getAppTranslations(app);
|
||
const value = bundle.translations[identifier];
|
||
if (typeof value !== 'undefined') {
|
||
const translation = value;
|
||
if (Array.isArray(translation)) {
|
||
const plural = bundle.pluralFunction(number);
|
||
return translate(app, translation[plural], vars, number, options);
|
||
}
|
||
}
|
||
if (number === 1) {
|
||
return translate(app, textSingular, vars, number, options);
|
||
}
|
||
else {
|
||
return translate(app, textPlural, vars, number, options);
|
||
}
|
||
}
|
||
/**
|
||
* Load an app's translation bundle if not loaded already.
|
||
*
|
||
* @param {string} appName name of the app
|
||
* @param {Function} callback callback to be called when
|
||
* the translations are loaded
|
||
* @return {Promise} promise
|
||
*/
|
||
function loadTranslations(appName, callback) {
|
||
if (hasAppTranslations(appName) || getLocale() === 'en') {
|
||
return Promise.resolve().then(callback);
|
||
}
|
||
const url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_0__.generateFilePath)(appName, 'l10n', getLocale() + '.json');
|
||
const promise = new Promise((resolve, reject) => {
|
||
const request = new XMLHttpRequest();
|
||
request.open('GET', url, true);
|
||
request.onerror = () => {
|
||
reject(new Error(request.statusText || 'Network error'));
|
||
};
|
||
request.onload = () => {
|
||
if (request.status >= 200 && request.status < 300) {
|
||
try {
|
||
const bundle = JSON.parse(request.responseText);
|
||
if (typeof bundle.translations === 'object')
|
||
resolve(bundle);
|
||
}
|
||
catch (error) {
|
||
// error is probably a SyntaxError due to invalid response text, this is handled by next line
|
||
}
|
||
reject(new Error('Invalid content of translation bundle'));
|
||
}
|
||
else {
|
||
reject(new Error(request.statusText));
|
||
}
|
||
};
|
||
request.send();
|
||
});
|
||
// load JSON translation bundle per AJAX
|
||
return promise
|
||
.then((result) => {
|
||
register(appName, result.translations);
|
||
return result;
|
||
})
|
||
.then(callback);
|
||
}
|
||
/**
|
||
* Register an app's translation bundle.
|
||
*
|
||
* @param {string} appName name of the app
|
||
* @param {Object<string, string>} bundle translation bundle
|
||
*/
|
||
function register(appName, bundle) {
|
||
registerAppTranslations(appName, bundle, getPlural);
|
||
}
|
||
/**
|
||
* Unregister all translations of an app
|
||
*
|
||
* @param appName name of the app
|
||
* @since 2.1.0
|
||
*/
|
||
function unregister(appName) {
|
||
return unregisterAppTranslations(appName);
|
||
}
|
||
/**
|
||
* Get array index of translations for a plural form
|
||
*
|
||
*
|
||
* @param {number} number the number of elements
|
||
* @return {number} 0 for the singular form(, 1 for the first plural form, ...)
|
||
*/
|
||
function getPlural(number) {
|
||
let language = getLanguage();
|
||
if (language === 'pt-BR') {
|
||
// temporary set a locale for brazilian
|
||
language = 'xbr';
|
||
}
|
||
if (language.length > 3) {
|
||
language = language.substring(0, language.lastIndexOf('-'));
|
||
}
|
||
/*
|
||
* The plural rules are derived from code of the Zend Framework (2010-09-25),
|
||
* which is subject to the new BSD license (http://framework.zend.com/license/new-bsd).
|
||
* Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||
*/
|
||
switch (language) {
|
||
case 'az':
|
||
case 'bo':
|
||
case 'dz':
|
||
case 'id':
|
||
case 'ja':
|
||
case 'jv':
|
||
case 'ka':
|
||
case 'km':
|
||
case 'kn':
|
||
case 'ko':
|
||
case 'ms':
|
||
case 'th':
|
||
case 'tr':
|
||
case 'vi':
|
||
case 'zh':
|
||
return 0;
|
||
case 'af':
|
||
case 'bn':
|
||
case 'bg':
|
||
case 'ca':
|
||
case 'da':
|
||
case 'de':
|
||
case 'el':
|
||
case 'en':
|
||
case 'eo':
|
||
case 'es':
|
||
case 'et':
|
||
case 'eu':
|
||
case 'fa':
|
||
case 'fi':
|
||
case 'fo':
|
||
case 'fur':
|
||
case 'fy':
|
||
case 'gl':
|
||
case 'gu':
|
||
case 'ha':
|
||
case 'he':
|
||
case 'hu':
|
||
case 'is':
|
||
case 'it':
|
||
case 'ku':
|
||
case 'lb':
|
||
case 'ml':
|
||
case 'mn':
|
||
case 'mr':
|
||
case 'nah':
|
||
case 'nb':
|
||
case 'ne':
|
||
case 'nl':
|
||
case 'nn':
|
||
case 'no':
|
||
case 'oc':
|
||
case 'om':
|
||
case 'or':
|
||
case 'pa':
|
||
case 'pap':
|
||
case 'ps':
|
||
case 'pt':
|
||
case 'so':
|
||
case 'sq':
|
||
case 'sv':
|
||
case 'sw':
|
||
case 'ta':
|
||
case 'te':
|
||
case 'tk':
|
||
case 'ur':
|
||
case 'zu':
|
||
return number === 1 ? 0 : 1;
|
||
case 'am':
|
||
case 'bh':
|
||
case 'fil':
|
||
case 'fr':
|
||
case 'gun':
|
||
case 'hi':
|
||
case 'hy':
|
||
case 'ln':
|
||
case 'mg':
|
||
case 'nso':
|
||
case 'xbr':
|
||
case 'ti':
|
||
case 'wa':
|
||
return number === 0 || number === 1 ? 0 : 1;
|
||
case 'be':
|
||
case 'bs':
|
||
case 'hr':
|
||
case 'ru':
|
||
case 'sh':
|
||
case 'sr':
|
||
case 'uk':
|
||
return number % 10 === 1 && number % 100 !== 11
|
||
? 0
|
||
: number % 10 >= 2
|
||
&& number % 10 <= 4
|
||
&& (number % 100 < 10 || number % 100 >= 20)
|
||
? 1
|
||
: 2;
|
||
case 'cs':
|
||
case 'sk':
|
||
return number === 1 ? 0 : number >= 2 && number <= 4 ? 1 : 2;
|
||
case 'ga':
|
||
return number === 1 ? 0 : number === 2 ? 1 : 2;
|
||
case 'lt':
|
||
return number % 10 === 1 && number % 100 !== 11
|
||
? 0
|
||
: number % 10 >= 2 && (number % 100 < 10 || number % 100 >= 20)
|
||
? 1
|
||
: 2;
|
||
case 'sl':
|
||
return number % 100 === 1
|
||
? 0
|
||
: number % 100 === 2
|
||
? 1
|
||
: number % 100 === 3 || number % 100 === 4
|
||
? 2
|
||
: 3;
|
||
case 'mk':
|
||
return number % 10 === 1 ? 0 : 1;
|
||
case 'mt':
|
||
return number === 1
|
||
? 0
|
||
: number === 0 || (number % 100 > 1 && number % 100 < 11)
|
||
? 1
|
||
: number % 100 > 10 && number % 100 < 20
|
||
? 2
|
||
: 3;
|
||
case 'lv':
|
||
return number === 0
|
||
? 0
|
||
: number % 10 === 1 && number % 100 !== 11
|
||
? 1
|
||
: 2;
|
||
case 'pl':
|
||
return number === 1
|
||
? 0
|
||
: number % 10 >= 2
|
||
&& number % 10 <= 4
|
||
&& (number % 100 < 12 || number % 100 > 14)
|
||
? 1
|
||
: 2;
|
||
case 'cy':
|
||
return number === 1
|
||
? 0
|
||
: number === 2
|
||
? 1
|
||
: number === 8 || number === 11
|
||
? 2
|
||
: 3;
|
||
case 'ro':
|
||
return number === 1
|
||
? 0
|
||
: number === 0 || (number % 100 > 0 && number % 100 < 20)
|
||
? 1
|
||
: 2;
|
||
case 'ar':
|
||
return number === 0
|
||
? 0
|
||
: number === 1
|
||
? 1
|
||
: number === 2
|
||
? 2
|
||
: number % 100 >= 3 && number % 100 <= 10
|
||
? 3
|
||
: number % 100 >= 11 && number % 100 <= 99
|
||
? 4
|
||
: 5;
|
||
default:
|
||
return 0;
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/moment/dist/index.mjs":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/@nextcloud/moment/dist/index.mjs ***!
|
||
\*******************************************************/
|
||
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ "default": () => (/* reexport default export from named module */ moment_min_moment_with_locales_js__WEBPACK_IMPORTED_MODULE_0__)
|
||
/* harmony export */ });
|
||
/* harmony import */ var moment_min_moment_with_locales_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment/min/moment-with-locales.js */ "./node_modules/moment/min/moment-with-locales.js");
|
||
/* harmony import */ var node_gettext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-gettext */ "./node_modules/node-gettext/lib/gettext.js");
|
||
/* harmony import */ var _nextcloud_l10n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @nextcloud/l10n */ "./node_modules/@nextcloud/l10n/dist/index.mjs");
|
||
|
||
|
||
|
||
|
||
const s = (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_2__.getLocale)(), e = { ar: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["ثوانٍ"] } } } }, ast: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["segundos"] } } } }, az: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["saniyə"] } } } }, br: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["eilennoù"] } } } }, ca: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["segons"] } } } }, cs_CZ: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekund(y)"] } } } }, da: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekunder"] } } } }, de: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["Sekunden"] } } } }, de_DE: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["Sekunden"] } } } }, el: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["δευτερόλεπτα"] } } } }, en_GB: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["seconds"] } } } }, eo: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekundoj"] } } } }, es: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["segundos"] } } } }, es_AR: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["segundos"] } } } }, es_MX: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["segundos"] } } } }, et_EE: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekundid"] } } } }, eu: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["segundo"] } } } }, fa: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["ثانیه"] } } } }, fi_FI: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekuntia"] } } } }, fr: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["secondes"] } } } }, gl: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["segundos"] } } } }, he: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["שניות"] } } } }, hu_HU: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["másodperc"] } } } }, id: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["detik"] } } } }, is: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekúndur"] } } } }, it: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["secondi"] } } } }, ja_JP: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["秒"] } } } }, kab: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["tasinin"] } } } }, ko: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["초"] } } } }, lo: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["ວິນາທີ"] } } } }, lt_LT: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sek."] } } } }, lv: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekundes"] } } } }, mk: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["секунди"] } } } }, mn: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["секунд"] } } } }, my: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["စက္ကန့်"] } } } }, nb_NO: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekunder"] } } } }, nl: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["seconden"] } } } }, oc: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["segondas"] } } } }, pl: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekundy"] } } } }, pt_BR: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["segundos"] } } } }, pt_PT: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["segundos"] } } } }, ro: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["secunde"] } } } }, ru: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["секунды"] } } } }, si: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["තත්පර"] } } } }, sk_SK: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekundy"] } } } }, sl: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekunde"] } } } }, sq: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekonda"] } } } }, sr: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["секунде"] } } } }, sv: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["sekunder"] } } } }, th_TH: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["วินาที"] } } } }, tr: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["saniye"] } } } }, uk: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["секунд"] } } } }, vi: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["giây"] } } } }, zh_CN: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["秒"] } } } }, zh_HK: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["秒"] } } } }, zh_TW: { charset: "utf-8", translations: { "": { seconds: { msgid: "seconds", msgstr: ["秒"] } } } } };
|
||
moment_min_moment_with_locales_js__WEBPACK_IMPORTED_MODULE_0__.locale(s);
|
||
if (s === "en" || s in e) {
|
||
const t = new node_gettext__WEBPACK_IMPORTED_MODULE_1__();
|
||
t.addTranslations(s, "messages", e[s]), t.setLocale(s), moment_min_moment_with_locales_js__WEBPACK_IMPORTED_MODULE_0__.updateLocale(moment_min_moment_with_locales_js__WEBPACK_IMPORTED_MODULE_0__.locale(), {
|
||
relativeTime: {
|
||
s: t.gettext("seconds")
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/@nextcloud/router/dist/index.mjs":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/@nextcloud/router/dist/index.mjs ***!
|
||
\*******************************************************/
|
||
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||
|
||
"use strict";
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ generateFilePath: () => (/* binding */ u),
|
||
/* harmony export */ generateOcsUrl: () => (/* binding */ v),
|
||
/* harmony export */ generateRemoteUrl: () => (/* binding */ U),
|
||
/* harmony export */ generateUrl: () => (/* binding */ _),
|
||
/* harmony export */ getAppRootUrl: () => (/* binding */ b),
|
||
/* harmony export */ getBaseUrl: () => (/* binding */ w),
|
||
/* harmony export */ getRootUrl: () => (/* binding */ f),
|
||
/* harmony export */ imagePath: () => (/* binding */ h),
|
||
/* harmony export */ linkTo: () => (/* binding */ R)
|
||
/* harmony export */ });
|
||
const R = (n, e) => u(n, "", e), g = (n) => "/remote.php/" + n, U = (n, e) => {
|
||
var o;
|
||
return ((o = e == null ? void 0 : e.baseURL) != null ? o : w()) + g(n);
|
||
}, v = (n, e, o) => {
|
||
var c;
|
||
const i = Object.assign({
|
||
ocsVersion: 2
|
||
}, o || {}).ocsVersion === 1 ? 1 : 2;
|
||
return ((c = o == null ? void 0 : o.baseURL) != null ? c : w()) + "/ocs/v" + i + ".php" + d(n, e, o);
|
||
}, d = (n, e, o) => {
|
||
const c = Object.assign({
|
||
escape: !0
|
||
}, o || {}), s = function(i, r) {
|
||
return r = r || {}, i.replace(
|
||
/{([^{}]*)}/g,
|
||
function(l, t) {
|
||
const a = r[t];
|
||
return c.escape ? encodeURIComponent(typeof a == "string" || typeof a == "number" ? a.toString() : l) : typeof a == "string" || typeof a == "number" ? a.toString() : l;
|
||
}
|
||
);
|
||
};
|
||
return n.charAt(0) !== "/" && (n = "/" + n), s(n, e || {});
|
||
}, _ = (n, e, o) => {
|
||
var c, s, i;
|
||
const r = Object.assign({
|
||
noRewrite: !1
|
||
}, o || {}), l = (c = o == null ? void 0 : o.baseURL) != null ? c : f();
|
||
return ((i = (s = window == null ? void 0 : window.OC) == null ? void 0 : s.config) == null ? void 0 : i.modRewriteWorking) === !0 && !r.noRewrite ? l + d(n, e, o) : l + "/index.php" + d(n, e, o);
|
||
}, h = (n, e) => e.indexOf(".") === -1 ? u(n, "img", e + ".svg") : u(n, "img", e), u = (n, e, o) => {
|
||
var c, s, i;
|
||
const r = (i = (s = (c = window == null ? void 0 : window.OC) == null ? void 0 : c.coreApps) == null ? void 0 : s.includes(n)) != null ? i : !1, l = o.slice(-3) === "php";
|
||
let t = f();
|
||
return l && !r ? (t += "/index.php/apps/".concat(n), e && (t += "/".concat(encodeURI(e))), o !== "index.php" && (t += "/".concat(o))) : !l && !r ? (t = b(n), e && (t += "/".concat(e, "/")), t.at(-1) !== "/" && (t += "/"), t += o) : ((n === "settings" || n === "core" || n === "search") && e === "ajax" && (t += "/index.php"), n && (t += "/".concat(n)), e && (t += "/".concat(e)), t += "/".concat(o)), t;
|
||
}, w = () => window.location.protocol + "//" + window.location.host + f();
|
||
function f() {
|
||
let n = window._oc_webroot;
|
||
if (typeof n > "u") {
|
||
n = location.pathname;
|
||
const e = n.indexOf("/index.php/");
|
||
if (e !== -1)
|
||
n = n.slice(0, e);
|
||
else {
|
||
const o = n.indexOf("/", 1);
|
||
n = n.slice(0, o > 0 ? o : void 0);
|
||
}
|
||
}
|
||
return n;
|
||
}
|
||
function b(n) {
|
||
var e, o;
|
||
return (o = ((e = window._oc_appswebroots) != null ? e : {})[n]) != null ? o : "";
|
||
}
|
||
|
||
|
||
|
||
/***/ })
|
||
|
||
/******/ });
|
||
/************************************************************************/
|
||
/******/ // The module cache
|
||
/******/ var __webpack_module_cache__ = {};
|
||
/******/
|
||
/******/ // The require function
|
||
/******/ function __webpack_require__(moduleId) {
|
||
/******/ // Check if module is in cache
|
||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||
/******/ if (cachedModule !== undefined) {
|
||
/******/ return cachedModule.exports;
|
||
/******/ }
|
||
/******/ // Create a new module (and put it into the cache)
|
||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||
/******/ id: moduleId,
|
||
/******/ loaded: false,
|
||
/******/ exports: {}
|
||
/******/ };
|
||
/******/
|
||
/******/ // Execute the module function
|
||
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
/******/
|
||
/******/ // Flag the module as loaded
|
||
/******/ module.loaded = true;
|
||
/******/
|
||
/******/ // Return the exports of the module
|
||
/******/ return module.exports;
|
||
/******/ }
|
||
/******/
|
||
/************************************************************************/
|
||
/******/ /* webpack/runtime/define property getters */
|
||
/******/ (() => {
|
||
/******/ // define getter functions for harmony exports
|
||
/******/ __webpack_require__.d = (exports, definition) => {
|
||
/******/ for(var key in definition) {
|
||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||
/******/ }
|
||
/******/ }
|
||
/******/ };
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/global */
|
||
/******/ (() => {
|
||
/******/ __webpack_require__.g = (function() {
|
||
/******/ if (typeof globalThis === 'object') return globalThis;
|
||
/******/ try {
|
||
/******/ return this || new Function('return this')();
|
||
/******/ } catch (e) {
|
||
/******/ if (typeof window === 'object') return window;
|
||
/******/ }
|
||
/******/ })();
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||
/******/ (() => {
|
||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/make namespace object */
|
||
/******/ (() => {
|
||
/******/ // define __esModule on exports
|
||
/******/ __webpack_require__.r = (exports) => {
|
||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||
/******/ }
|
||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||
/******/ };
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/node module decorator */
|
||
/******/ (() => {
|
||
/******/ __webpack_require__.nmd = (module) => {
|
||
/******/ module.paths = [];
|
||
/******/ if (!module.children) module.children = [];
|
||
/******/ return module;
|
||
/******/ };
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/publicPath */
|
||
/******/ (() => {
|
||
/******/ __webpack_require__.p = "\\apps\\calendar\\js\\";
|
||
/******/ })();
|
||
/******/
|
||
/******/ /* webpack/runtime/nonce */
|
||
/******/ (() => {
|
||
/******/ __webpack_require__.nc = undefined;
|
||
/******/ })();
|
||
/******/
|
||
/************************************************************************/
|
||
var __webpack_exports__ = {};
|
||
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
||
(() => {
|
||
"use strict";
|
||
/*!***********************************************!*\
|
||
!*** ./src/appointments/main-confirmation.js ***!
|
||
\***********************************************/
|
||
__webpack_require__.r(__webpack_exports__);
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||
/* harmony export */ });
|
||
/* harmony import */ var _nextcloud_auth__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/auth */ "./node_modules/@nextcloud/auth/dist/index.es.mjs");
|
||
/* harmony import */ var _nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @nextcloud/initial-state */ "./node_modules/@nextcloud/initial-state/dist/index.es.mjs");
|
||
/* harmony import */ var _nextcloud_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @nextcloud/router */ "./node_modules/@nextcloud/router/dist/index.mjs");
|
||
/* harmony import */ var _nextcloud_l10n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @nextcloud/l10n */ "./node_modules/@nextcloud/l10n/dist/index.mjs");
|
||
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.runtime.esm.js");
|
||
/* harmony import */ var _views_Appointments_Confirmation_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../views/Appointments/Confirmation.vue */ "./src/views/Appointments/Confirmation.vue");
|
||
/**
|
||
* @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
|
||
*
|
||
* @author 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
|
||
*
|
||
* @license AGPL-3.0-or-later
|
||
*
|
||
* This program is free software: you can redistribute it and/or modify
|
||
* it under the terms of the GNU Affero General Public License as
|
||
* published by the Free Software Foundation, either version 3 of the
|
||
* License, or (at your option) any later version.
|
||
*
|
||
* This program is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU Affero General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU Affero General Public License
|
||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
*
|
||
*/
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
// CSP config for webpack dynamic chunk loading
|
||
// eslint-disable-next-line
|
||
__webpack_require__.nc = btoa((0,_nextcloud_auth__WEBPACK_IMPORTED_MODULE_0__.getRequestToken)());
|
||
|
||
// Correct the root of the app for chunk loading
|
||
// OC.linkTo matches the apps folders
|
||
// OC.generateUrl ensure the index.php (or not)
|
||
// We do not want the index.php since we're loading files
|
||
// eslint-disable-next-line
|
||
__webpack_require__.p = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_2__.linkTo)('calendar', 'js/');
|
||
vue__WEBPACK_IMPORTED_MODULE_5__["default"].prototype.$t = _nextcloud_l10n__WEBPACK_IMPORTED_MODULE_3__.translate;
|
||
vue__WEBPACK_IMPORTED_MODULE_5__["default"].prototype.$n = _nextcloud_l10n__WEBPACK_IMPORTED_MODULE_3__.translatePlural;
|
||
const booking = (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_1__.loadState)('calendar', 'booking');
|
||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (new vue__WEBPACK_IMPORTED_MODULE_5__["default"]({
|
||
el: '#appointment-confirmation',
|
||
render: h => h(_views_Appointments_Confirmation_vue__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
||
props: {
|
||
booking
|
||
}
|
||
})
|
||
}));
|
||
})();
|
||
|
||
/******/ })()
|
||
;
|
||
//# sourceMappingURL=calendar-appointments-confirmation.js.map?v=89b4f5ac684ec7582afa |