1/** 2 * @license 3 * Lodash (Custom Build) <https://lodash.com/> 4 * Build: `lodash core -o ./dist/lodash.core.js` 5 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 6 * Released under MIT license <https://lodash.com/license> 7 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 8 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 9 */ 10 ;(function() { 11 12 /** Used as a safe reference for `undefined` in pre-ES5 environments. */ 13 var undefined; 14 15 /** Used as the semantic version number. */ 16 var VERSION = '4.17.2
vendor: 49,404 bytes, lines 16-1480
161'; 17 18 /** Error message constants. */ 19 var FUNC_ERROR_TEXT = 'Expected a function'; 20 21 /** Used to compose bitmasks for value comparisons. */ 22 var COMPARE_PARTIAL_FLAG = 1, 23 COMPARE_UNORDERED_FLAG = 2; 24 25 /** Used to compose bitmasks for function metadata. */ 26 var WRAP_BIND_FLAG = 1, 27 WRAP_PARTIAL_FLAG = 32; 28 29 /** Used as references for various `Number` constants. */ 30 var INFINITY = 1 / 0, 31 MAX_SAFE_INTEGER = 9007199254740991; 32 33 /** `Object#toString` result references. */ 34 var argsTag = '[object Arguments]', 35 arrayTag = '[object Array]', 36 asyncTag = '[object AsyncFunction]', 37 boolTag = '[object Boolean]', 38 dateTag = '[object Date]', 39 errorTag = '[object Error]', 40 funcTag = '[object Function]', 41 genTag = '[object GeneratorFunction]', 42 numberTag = '[object Number]', 43 objectTag = '[object Object]', 44 proxyTag = '[object Proxy]', 45 regexpTag = '[object RegExp]', 46 stringTag = '[object String]'; 47 48 /** Used to match HTML entities and HTML characters. */ 49 var reUnescapedHtml = /[&<>"']/g, 50 reHasUnescapedHtml = RegExp(reUnescapedHtml.source); 51 52 /** Used to detect unsigned integer values. */ 53 var reIsUint = /^(?:0|[1-9]\d*)$/; 54 55 /** Used to map characters to HTML entities. */ 56 var htmlEscapes = { 57 '&': '&', 58 '<': '<', 59 '>': '>', 60 '"': '"', 61 "'": ''' 62 }; 63 64 /** Detect free variable `global` from Node.js. */ 65 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 66 67 /** Detect free variable `self`. */ 68 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 69 70 /** Used as a reference to the global object. */ 71 var root = freeGlobal || freeSelf || Function('return this')(); 72 73 /** Detect free variable `exports`. */ 74 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; 75 76 /** Detect free variable `module`. */ 77 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; 78 79 /*--------------------------------------------------------------------------*/ 80 81 /** 82 * Appends the elements of `values` to `array`. 83 * 84 * @private 85 * @param {Array} array The array to modify. 86 * @param {Array} values The values to append. 87 * @returns {Array} Returns `array`. 88 */ 89 function arrayPush(array, values) { 90 array.push.apply(array, values); 91 return array; 92 } 93 94 /** 95 * The base implementation of `_.findIndex` and `_.findLastIndex` without 96 * support for iteratee shorthands. 97 * 98 * @private 99 * @param {Array} array The array to inspect. 100 * @param {Function} predicate The function invoked per iteration. 101 * @param {number} fromIndex The index to search from. 102 * @param {boolean} [fromRight] Specify iterating from right to left. 103 * @returns {number} Returns the index of the matched value, else `-1`. 104 */ 105 function baseFindIndex(array, predicate, fromIndex, fromRight) { 106 var length = array.length, 107 index = fromIndex + (fromRight ? 1 : -1); 108 109 while ((fromRight ? index-- : ++index < length)) { 110 if (predicate(array[index], index, array)) { 111 return index; 112 } 113 } 114 return -1; 115 } 116 117 /** 118 * The base implementation of `_.property` without support for deep paths. 119 * 120 * @private 121 * @param {string} key The key of the property to get. 122 * @returns {Function} Returns the new accessor function. 123 */ 124 function baseProperty(key) { 125 return function(object) { 126 return object == null ? undefined : object[key]; 127 }; 128 } 129 130 /** 131 * The base implementation of `_.propertyOf` without support for deep paths. 132 * 133 * @private 134 * @param {Object} object The object to query. 135 * @returns {Function} Returns the new accessor function. 136 */ 137 function basePropertyOf(object) { 138 return function(key) { 139 return object == null ? undefined : object[key]; 140 }; 141 } 142 143 /** 144 * The base implementation of `_.reduce` and `_.reduceRight`, without support 145 * for iteratee shorthands, which iterates over `collection` using `eachFunc`. 146 * 147 * @private 148 * @param {Array|Object} collection The collection to iterate over. 149 * @param {Function} iteratee The function invoked per iteration. 150 * @param {*} accumulator The initial value. 151 * @param {boolean} initAccum Specify using the first or last element of 152 * `collection` as the initial value. 153 * @param {Function} eachFunc The function to iterate over `collection`. 154 * @returns {*} Returns the accumulated value. 155 */ 156 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { 157 eachFunc(collection, function(value, index, collection) { 158 accumulator = initAccum 159 ? (initAccum = false, value) 160 : iteratee(accumulator, value, index, collection); 161 }); 162 return accumulator; 163 } 164 165 /** 166 * The base implementation of `_.values` and `_.valuesIn` which creates an 167 * array of `object` property values corresponding to the property names 168 * of `props`. 169 * 170 * @private 171 * @param {Object} object The object to query. 172 * @param {Array} props The property names to get values for. 173 * @returns {Object} Returns the array of property values. 174 */ 175 function baseValues(object, props) { 176 return baseMap(props, function(key) { 177 return object[key]; 178 }); 179 } 180 181 /** 182 * Used by `_.escape` to convert characters to HTML entities. 183 * 184 * @private 185 * @param {string} chr The matched character to escape. 186 * @returns {string} Returns the escaped character. 187 */ 188 var escapeHtmlChar = basePropertyOf(htmlEscapes); 189 190 /** 191 * Creates a unary function that invokes `func` with its argument transformed. 192 * 193 * @private 194 * @param {Function} func The function to wrap. 195 * @param {Function} transform The argument transform. 196 * @returns {Function} Returns the new function. 197 */ 198 function overArg(func, transform) { 199 return function(arg) { 200 return func(transform(arg)); 201 }; 202 } 203 204 /*--------------------------------------------------------------------------*/ 205 206 /** Used for built-in method references. */ 207 var arrayProto = Array.prototype, 208 objectProto = Object.prototype; 209 210 /** Used to check objects for own properties. */ 211 var hasOwnProperty = objectProto.hasOwnProperty; 212 213 /** Used to generate unique IDs. */ 214 var idCounter = 0; 215 216 /** 217 * Used to resolve the 218 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 219 * of values. 220 */ 221 var nativeObjectToString = objectProto.toString; 222 223 /** Used to restore the original `_` reference in `_.noConflict`. */ 224 var oldDash = root._; 225 226 /** Built-in value references. */ 227 var objectCreate = Object.create, 228 propertyIsEnumerable = objectProto.propertyIsEnumerable; 229 230 /* Built-in method references for those with the same name as other `lodash` methods. */ 231 var nativeIsFinite = root.isFinite, 232 nativeKeys = overArg(Object.keys, Object), 233 nativeMax = Math.max; 234 235 /*------------------------------------------------------------------------*/ 236 237 /** 238 * Creates a `lodash` object which wraps `value` to enable implicit method 239 * chain sequences. Methods that operate on and return arrays, collections, 240 * and functions can be chained together. Methods that retrieve a single value 241 * or may return a primitive value will automatically end the chain sequence 242 * and return the unwrapped value. Otherwise, the value must be unwrapped 243 * with `_#value`. 244 * 245 * Explicit chain sequences, which must be unwrapped with `_#value`, may be 246 * enabled using `_.chain`. 247 * 248 * The execution of chained methods is lazy, that is, it's deferred until 249 * `_#value` is implicitly or explicitly called. 250 * 251 * Lazy evaluation allows several methods to support shortcut fusion. 252 * Shortcut fusion is an optimization to merge iteratee calls; this avoids 253 * the creation of intermediate arrays and can greatly reduce the number of 254 * iteratee executions. Sections of a chain sequence qualify for shortcut 255 * fusion if the section is applied to an array and iteratees accept only 256 * one argument. The heuristic for whether a section qualifies for shortcut 257 * fusion is subject to change. 258 * 259 * Chaining is supported in custom builds as long as the `_#value` method is 260 * directly or indirectly included in the build. 261 * 262 * In addition to lodash methods, wrappers have `Array` and `String` methods. 263 * 264 * The wrapper `Array` methods are: 265 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` 266 * 267 * The wrapper `String` methods are: 268 * `replace` and `split` 269 * 270 * The wrapper methods that support shortcut fusion are: 271 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, 272 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, 273 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` 274 * 275 * The chainable wrapper methods are: 276 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, 277 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, 278 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, 279 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, 280 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, 281 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, 282 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, 283 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, 284 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, 285 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, 286 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, 287 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, 288 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, 289 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, 290 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, 291 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, 292 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, 293 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, 294 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, 295 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, 296 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, 297 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, 298 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, 299 * `zipObject`, `zipObjectDeep`, and `zipWith` 300 * 301 * The wrapper methods that are **not** chainable by default are: 302 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, 303 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, 304 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, 305 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, 306 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, 307 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, 308 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, 309 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, 310 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, 311 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, 312 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, 313 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, 314 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, 315 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, 316 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, 317 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, 318 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, 319 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, 320 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, 321 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, 322 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, 323 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, 324 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, 325 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, 326 * `upperFirst`, `value`, and `words` 327 * 328 * @name _ 329 * @constructor 330 * @category Seq 331 * @param {*} value The value to wrap in a `lodash` instance. 332 * @returns {Object} Returns the new `lodash` wrapper instance. 333 * @example 334 * 335 * function square(n) { 336 * return n * n; 337 * } 338 * 339 * var wrapped = _([1, 2, 3]); 340 * 341 * // Returns an unwrapped value. 342 * wrapped.reduce(_.add); 343 * // => 6 344 * 345 * // Returns a wrapped value. 346 * var squares = wrapped.map(square); 347 * 348 * _.isArray(squares); 349 * // => false 350 * 351 * _.isArray(squares.value()); 352 * // => true 353 */ 354 function lodash(value) { 355 return value instanceof LodashWrapper 356 ? value 357 : new LodashWrapper(value); 358 } 359 360 /** 361 * The base implementation of `_.create` without support for assigning 362 * properties to the created object. 363 * 364 * @private 365 * @param {Object} proto The object to inherit from. 366 * @returns {Object} Returns the new object. 367 */ 368 var baseCreate = (function() { 369 function object() {} 370 return function(proto) { 371 if (!isObject(proto)) { 372 return {}; 373 } 374 if (objectCreate) { 375 return objectCreate(proto); 376 } 377 object.prototype = proto; 378 var result = new object; 379 object.prototype = undefined; 380 return result; 381 }; 382 }()); 383 384 /** 385 * The base constructor for creating `lodash` wrapper objects. 386 * 387 * @private 388 * @param {*} value The value to wrap. 389 * @param {boolean} [chainAll] Enable explicit method chain sequences. 390 */ 391 function LodashWrapper(value, chainAll) { 392 this.__wrapped__ = value; 393 this.__actions__ = []; 394 this.__chain__ = !!chainAll; 395 } 396 397 LodashWrapper.prototype = baseCreate(lodash.prototype); 398 LodashWrapper.prototype.constructor = LodashWrapper; 399 400 /*------------------------------------------------------------------------*/ 401 402 /** 403 * Assigns `value` to `key` of `object` if the existing value is not equivalent 404 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 405 * for equality comparisons. 406 * 407 * @private 408 * @param {Object} object The object to modify. 409 * @param {string} key The key of the property to assign. 410 * @param {*} value The value to assign. 411 */ 412 function assignValue(object, key, value) { 413 var objValue = object[key]; 414 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || 415 (value === undefined && !(key in object))) { 416 baseAssignValue(object, key, value); 417 } 418 } 419 420 /** 421 * The base implementation of `assignValue` and `assignMergeValue` without 422 * value checks. 423 * 424 * @private 425 * @param {Object} object The object to modify. 426 * @param {string} key The key of the property to assign. 427 * @param {*} value The value to assign. 428 */ 429 function baseAssignValue(object, key, value) { 430 object[key] = value; 431 } 432 433 /** 434 * The base implementation of `_.delay` and `_.defer` which accepts `args` 435 * to provide to `func`. 436 * 437 * @private 438 * @param {Function} func The function to delay. 439 * @param {number} wait The number of milliseconds to delay invocation. 440 * @param {Array} args The arguments to provide to `func`. 441 * @returns {number|Object} Returns the timer id or timeout object. 442 */ 443 function baseDelay(func, wait, args) { 444 if (typeof func != 'function') { 445 throw new TypeError(FUNC_ERROR_TEXT); 446 } 447 return setTimeout(function() { func.apply(undefined, args); }, wait); 448 } 449 450 /** 451 * The base implementation of `_.forEach` without support for iteratee shorthands. 452 * 453 * @private 454 * @param {Array|Object} collection The collection to iterate over. 455 * @param {Function} iteratee The function invoked per iteration. 456 * @returns {Array|Object} Returns `collection`. 457 */ 458 var baseEach = createBaseEach(baseForOwn); 459 460 /** 461 * The base implementation of `_.every` without support for iteratee shorthands. 462 * 463 * @private 464 * @param {Array|Object} collection The collection to iterate over. 465 * @param {Function} predicate The function invoked per iteration. 466 * @returns {boolean} Returns `true` if all elements pass the predicate check, 467 * else `false` 468 */ 469 function baseEvery(collection, predicate) { 470 var result = true; 471 baseEach(collection, function(value, index, collection) { 472 result = !!predicate(value, index, collection); 473 return result; 474 }); 475 return result; 476 } 477 478 /** 479 * The base implementation of methods like `_.max` and `_.min` which accepts a 480 * `comparator` to determine the extremum value. 481 * 482 * @private 483 * @param {Array} array The array to iterate over. 484 * @param {Function} iteratee The iteratee invoked per iteration. 485 * @param {Function} comparator The comparator used to compare values. 486 * @returns {*} Returns the extremum value. 487 */ 488 function baseExtremum(array, iteratee, comparator) { 489 var index = -1, 490 length = array.length; 491 492 while (++index < length) { 493 var value = array[index], 494 current = iteratee(value); 495 496 if (current != null && (computed === undefined 497 ? (current === current && !false) 498 : comparator(current, computed) 499 )) { 500 var computed = current, 501 result = value; 502 } 503 } 504 return result; 505 } 506 507 /** 508 * The base implementation of `_.filter` without support for iteratee shorthands. 509 * 510 * @private 511 * @param {Array|Object} collection The collection to iterate over. 512 * @param {Function} predicate The function invoked per iteration. 513 * @returns {Array} Returns the new filtered array. 514 */ 515 function baseFilter(collection, predicate) { 516 var result = []; 517 baseEach(collection, function(value, index, collection) { 518 if (predicate(value, index, collection)) { 519 result.push(value); 520 } 521 }); 522 return result; 523 } 524 525 /** 526 * The base implementation of `_.flatten` with support for restricting flattening. 527 * 528 * @private 529 * @param {Array} array The array to flatten. 530 * @param {number} depth The maximum recursion depth. 531 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 532 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 533 * @param {Array} [result=[]] The initial result value. 534 * @returns {Array} Returns the new flattened array. 535 */ 536 function baseFlatten(array, depth, predicate, isStrict, result) { 537 var index = -1, 538 length = array.length; 539 540 predicate || (predicate = isFlattenable); 541 result || (result = []); 542 543 while (++index < length) { 544 var value = array[index]; 545 if (depth > 0 && predicate(value)) { 546 if (depth > 1) { 547 // Recursively flatten arrays (susceptible to call stack limits). 548 baseFlatten(value, depth - 1, predicate, isStrict, result); 549 } else { 550 arrayPush(result, value); 551 } 552 } else if (!isStrict) { 553 result[result.length] = value; 554 } 555 } 556 return result; 557 } 558 559 /** 560 * The base implementation of `baseForOwn` which iterates over `object` 561 * properties returned by `keysFunc` and invokes `iteratee` for each property. 562 * Iteratee functions may exit iteration early by explicitly returning `false`. 563 * 564 * @private 565 * @param {Object} object The object to iterate over. 566 * @param {Function} iteratee The function invoked per iteration. 567 * @param {Function} keysFunc The function to get the keys of `object`. 568 * @returns {Object} Returns `object`. 569 */ 570 var baseFor = createBaseFor(); 571 572 /** 573 * The base implementation of `_.forOwn` without support for iteratee shorthands. 574 * 575 * @private 576 * @param {Object} object The object to iterate over. 577 * @param {Function} iteratee The function invoked per iteration. 578 * @returns {Object} Returns `object`. 579 */ 580 function baseForOwn(object, iteratee) { 581 return object && baseFor(object, iteratee, keys); 582 } 583 584 /** 585 * The base implementation of `_.functions` which creates an array of 586 * `object` function property names filtered from `props`. 587 * 588 * @private 589 * @param {Object} object The object to inspect. 590 * @param {Array} props The property names to filter. 591 * @returns {Array} Returns the function names. 592 */ 593 function baseFunctions(object, props) { 594 return baseFilter(props, function(key) { 595 return isFunction(object[key]); 596 }); 597 } 598 599 /** 600 * The base implementation of `getTag` without fallbacks for buggy environments. 601 * 602 * @private 603 * @param {*} value The value to query. 604 * @returns {string} Returns the `toStringTag`. 605 */ 606 function baseGetTag(value) { 607 return objectToString(value); 608 } 609 610 /** 611 * The base implementation of `_.gt` which doesn't coerce arguments. 612 * 613 * @private 614 * @param {*} value The value to compare. 615 * @param {*} other The other value to compare. 616 * @returns {boolean} Returns `true` if `value` is greater than `other`, 617 * else `false`. 618 */ 619 function baseGt(value, other) { 620 return value > other; 621 } 622 623 /** 624 * The base implementation of `_.isArguments`. 625 * 626 * @private 627 * @param {*} value The value to check. 628 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 629 */ 630 var baseIsArguments = noop; 631 632 /** 633 * The base implementation of `_.isDate` without Node.js optimizations. 634 * 635 * @private 636 * @param {*} value The value to check. 637 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 638 */ 639 function baseIsDate(value) { 640 return isObjectLike(value) && baseGetTag(value) == dateTag; 641 } 642 643 /** 644 * The base implementation of `_.isEqual` which supports partial comparisons 645 * and tracks traversed objects. 646 * 647 * @private 648 * @param {*} value The value to compare. 649 * @param {*} other The other value to compare. 650 * @param {boolean} bitmask The bitmask flags. 651 * 1 - Unordered comparison 652 * 2 - Partial comparison 653 * @param {Function} [customizer] The function to customize comparisons. 654 * @param {Object} [stack] Tracks traversed `value` and `other` objects. 655 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 656 */ 657 function baseIsEqual(value, other, bitmask, customizer, stack) { 658 if (value === other) { 659 return true; 660 } 661 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { 662 return value !== value && other !== other; 663 } 664 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); 665 } 666 667 /** 668 * A specialized version of `baseIsEqual` for arrays and objects which performs 669 * deep comparisons and tracks traversed objects enabling objects with circular 670 * references to be compared. 671 * 672 * @private 673 * @param {Object} object The object to compare. 674 * @param {Object} other The other object to compare. 675 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 676 * @param {Function} customizer The function to customize comparisons. 677 * @param {Function} equalFunc The function to determine equivalents of values. 678 * @param {Object} [stack] Tracks traversed `object` and `other` objects. 679 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 680 */ 681 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { 682 var objIsArr = isArray(object), 683 othIsArr = isArray(other), 684 objTag = objIsArr ? arrayTag : baseGetTag(object), 685 othTag = othIsArr ? arrayTag : baseGetTag(other); 686 687 objTag = objTag == argsTag ? objectTag : objTag; 688 othTag = othTag == argsTag ? objectTag : othTag; 689 690 var objIsObj = objTag == objectTag, 691 othIsObj = othTag == objectTag, 692 isSameTag = objTag == othTag; 693 694 stack || (stack = []); 695 var objStack = find(stack, function(entry) { 696 return entry[0] == object; 697 }); 698 var othStack = find(stack, function(entry) { 699 return entry[0] == other; 700 }); 701 if (objStack && othStack) { 702 return objStack[1] == other; 703 } 704 stack.push([object, other]); 705 stack.push([other, object]); 706 if (isSameTag && !objIsObj) { 707 var result = (objIsArr) 708 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) 709 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); 710 stack.pop(); 711 return result; 712 } 713 if (!(bitmask & COMPARE_PARTIAL_FLAG)) { 714 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), 715 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); 716 717 if (objIsWrapped || othIsWrapped) { 718 var objUnwrapped = objIsWrapped ? object.value() : object, 719 othUnwrapped = othIsWrapped ? other.value() : other; 720 721 var result = equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); 722 stack.pop(); 723 return result; 724 } 725 } 726 if (!isSameTag) { 727 return false; 728 } 729 var result = equalObjects(object, other, bitmask, customizer, equalFunc, stack); 730 stack.pop(); 731 return result; 732 } 733 734 /** 735 * The base implementation of `_.isRegExp` without Node.js optimizations. 736 * 737 * @private 738 * @param {*} value The value to check. 739 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 740 */ 741 function baseIsRegExp(value) { 742 return isObjectLike(value) && baseGetTag(value) == regexpTag; 743 } 744 745 /** 746 * The base implementation of `_.iteratee`. 747 * 748 * @private 749 * @param {*} [value=_.identity] The value to convert to an iteratee. 750 * @returns {Function} Returns the iteratee. 751 */ 752 function baseIteratee(func) { 753 if (typeof func == 'function') { 754 return func; 755 } 756 if (func == null) { 757 return identity; 758 } 759 return (typeof func == 'object' ? baseMatches : baseProperty)(func); 760 } 761 762 /** 763 * The base implementation of `_.lt` which doesn't coerce arguments. 764 * 765 * @private 766 * @param {*} value The value to compare. 767 * @param {*} other The other value to compare. 768 * @returns {boolean} Returns `true` if `value` is less than `other`, 769 * else `false`. 770 */ 771 function baseLt(value, other) { 772 return value < other; 773 } 774 775 /** 776 * The base implementation of `_.map` without support for iteratee shorthands. 777 * 778 * @private 779 * @param {Array|Object} collection The collection to iterate over. 780 * @param {Function} iteratee The function invoked per iteration. 781 * @returns {Array} Returns the new mapped array. 782 */ 783 function baseMap(collection, iteratee) { 784 var index = -1, 785 result = isArrayLike(collection) ? Array(collection.length) : []; 786 787 baseEach(collection, function(value, key, collection) { 788 result[++index] = iteratee(value, key, collection); 789 }); 790 return result; 791 } 792 793 /** 794 * The base implementation of `_.matches` which doesn't clone `source`. 795 * 796 * @private 797 * @param {Object} source The object of property values to match. 798 * @returns {Function} Returns the new spec function. 799 */ 800 function baseMatches(source) { 801 var props = nativeKeys(source); 802 return function(object) { 803 var length = props.length; 804 if (object == null) { 805 return !length; 806 } 807 object = Object(object); 808 while (length--) { 809 var key = props[length]; 810 if (!(key in object && 811 baseIsEqual(source[key], object[key], COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG) 812 )) { 813 return false; 814 } 815 } 816 return true; 817 }; 818 } 819 820 /** 821 * The base implementation of `_.pick` without support for individual 822 * property identifiers. 823 * 824 * @private 825 * @param {Object} object The source object. 826 * @param {string[]} paths The property paths to pick. 827 * @returns {Object} Returns the new object. 828 */ 829 function basePick(object, props) { 830 object = Object(object); 831 return reduce(props, function(result, key) { 832 if (key in object) { 833 result[key] = object[key]; 834 } 835 return result; 836 }, {}); 837 } 838 839 /** 840 * The base implementation of `_.rest` which doesn't validate or coerce arguments. 841 * 842 * @private 843 * @param {Function} func The function to apply a rest parameter to. 844 * @param {number} [start=func.length-1] The start position of the rest parameter. 845 * @returns {Function} Returns the new function. 846 */ 847 function baseRest(func, start) { 848 return setToString(overRest(func, start, identity), func + ''); 849 } 850 851 /** 852 * The base implementation of `_.slice` without an iteratee call guard. 853 * 854 * @private 855 * @param {Array} array The array to slice. 856 * @param {number} [start=0] The start position. 857 * @param {number} [end=array.length] The end position. 858 * @returns {Array} Returns the slice of `array`. 859 */ 860 function baseSlice(array, start, end) { 861 var index = -1, 862 length = array.length; 863 864 if (start < 0) { 865 start = -start > length ? 0 : (length + start); 866 } 867 end = end > length ? length : end; 868 if (end < 0) { 869 end += length; 870 } 871 length = start > end ? 0 : ((end - start) >>> 0); 872 start >>>= 0; 873 874 var result = Array(length); 875 while (++index < length) { 876 result[index] = array[index + start]; 877 } 878 return result; 879 } 880 881 /** 882 * Copies the values of `source` to `array`. 883 * 884 * @private 885 * @param {Array} source The array to copy values from. 886 * @param {Array} [array=[]] The array to copy values to. 887 * @returns {Array} Returns `array`. 888 */ 889 function copyArray(source) { 890 return baseSlice(source, 0, source.length); 891 } 892 893 /** 894 * The base implementation of `_.some` without support for iteratee shorthands. 895 * 896 * @private 897 * @param {Array|Object} collection The collection to iterate over. 898 * @param {Function} predicate The function invoked per iteration. 899 * @returns {boolean} Returns `true` if any element passes the predicate check, 900 * else `false`. 901 */ 902 function baseSome(collection, predicate) { 903 var result; 904 905 baseEach(collection, function(value, index, collection) { 906 result = predicate(value, index, collection); 907 return !result; 908 }); 909 return !!result; 910 } 911 912 /** 913 * The base implementation of `wrapperValue` which returns the result of 914 * performing a sequence of actions on the unwrapped `value`, where each 915 * successive action is supplied the return value of the previous. 916 * 917 * @private 918 * @param {*} value The unwrapped value. 919 * @param {Array} actions Actions to perform to resolve the unwrapped value. 920 * @returns {*} Returns the resolved value. 921 */ 922 function baseWrapperValue(value, actions) { 923 var result = value; 924 return reduce(actions, function(result, action) { 925 return action.func.apply(action.thisArg, arrayPush([result], action.args)); 926 }, result); 927 } 928 929 /** 930 * Compares values to sort them in ascending order. 931 * 932 * @private 933 * @param {*} value The value to compare. 934 * @param {*} other The other value to compare. 935 * @returns {number} Returns the sort order indicator for `value`. 936 */ 937 function compareAscending(value, other) { 938 if (value !== other) { 939 var valIsDefined = value !== undefined, 940 valIsNull = value === null, 941 valIsReflexive = value === value, 942 valIsSymbol = false; 943 944 var othIsDefined = other !== undefined, 945 othIsNull = other === null, 946 othIsReflexive = other === other, 947 othIsSymbol = false; 948 949 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || 950 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || 951 (valIsNull && othIsDefined && othIsReflexive) || 952 (!valIsDefined && othIsReflexive) || 953 !valIsReflexive) { 954 return 1; 955 } 956 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || 957 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || 958 (othIsNull && valIsDefined && valIsReflexive) || 959 (!othIsDefined && valIsReflexive) || 960 !othIsReflexive) { 961 return -1; 962 } 963 } 964 return 0; 965 } 966 967 /** 968 * Copies properties of `source` to `object`. 969 * 970 * @private 971 * @param {Object} source The object to copy properties from. 972 * @param {Array} props The property identifiers to copy. 973 * @param {Object} [object={}] The object to copy properties to. 974 * @param {Function} [customizer] The function to customize copied values. 975 * @returns {Object} Returns `object`. 976 */ 977 function copyObject(source, props, object, customizer) { 978 var isNew = !object; 979 object || (object = {}); 980 981 var index = -1, 982 length = props.length; 983 984 while (++index < length) { 985 var key = props[index]; 986 987 var newValue = customizer 988 ? customizer(object[key], source[key], key, object, source) 989 : undefined; 990 991 if (newValue === undefined) { 992 newValue = source[key]; 993 } 994 if (isNew) { 995 baseAssignValue(object, key, newValue); 996 } else { 997 assignValue(object, key, newValue); 998 } 999 } 1000 return object; 1001 } 1002 1003 /** 1004 * Creates a function like `_.assign`. 1005 * 1006 * @private 1007 * @param {Function} assigner The function to assign values. 1008 * @returns {Function} Returns the new assigner function. 1009 */ 1010 function createAssigner(assigner) { 1011 return baseRest(function(object, sources) { 1012 var index = -1, 1013 length = sources.length, 1014 customizer = length > 1 ? sources[length - 1] : undefined; 1015 1016 customizer = (assigner.length > 3 && typeof customizer == 'function') 1017 ? (length--, customizer) 1018 : undefined; 1019 1020 object = Object(object); 1021 while (++index < length) { 1022 var source = sources[index]; 1023 if (source) { 1024 assigner(object, source, index, customizer); 1025 } 1026 } 1027 return object; 1028 }); 1029 } 1030 1031 /** 1032 * Creates a `baseEach` or `baseEachRight` function. 1033 * 1034 * @private 1035 * @param {Function} eachFunc The function to iterate over a collection. 1036 * @param {boolean} [fromRight] Specify iterating from right to left. 1037 * @returns {Function} Returns the new base function. 1038 */ 1039 function createBaseEach(eachFunc, fromRight) { 1040 return function(collection, iteratee) { 1041 if (collection == null) { 1042 return collection; 1043 } 1044 if (!isArrayLike(collection)) { 1045 return eachFunc(collection, iteratee); 1046 } 1047 var length = collection.length, 1048 index = fromRight ? length : -1, 1049 iterable = Object(collection); 1050 1051 while ((fromRight ? index-- : ++index < length)) { 1052 if (iteratee(iterable[index], index, iterable) === false) { 1053 break; 1054 } 1055 } 1056 return collection; 1057 }; 1058 } 1059 1060 /** 1061 * Creates a base function for methods like `_.forIn` and `_.forOwn`. 1062 * 1063 * @private 1064 * @param {boolean} [fromRight] Specify iterating from right to left. 1065 * @returns {Function} Returns the new base function. 1066 */ 1067 function createBaseFor(fromRight) { 1068 return function(object, iteratee, keysFunc) { 1069 var index = -1, 1070 iterable = Object(object), 1071 props = keysFunc(object), 1072 length = props.length; 1073 1074 while (length--) { 1075 var key = props[fromRight ? length : ++index]; 1076 if (iteratee(iterable[key], key, iterable) === false) { 1077 break; 1078 } 1079 } 1080 return object; 1081 }; 1082 } 1083 1084 /** 1085 * Creates a function that produces an instance of `Ctor` regardless of 1086 * whether it was invoked as part of a `new` expression or by `call` or `apply`. 1087 * 1088 * @private 1089 * @param {Function} Ctor The constructor to wrap. 1090 * @returns {Function} Returns the new wrapped function. 1091 */ 1092 function createCtor(Ctor) { 1093 return function() { 1094 // Use a `switch` statement to work with class constructors. See 1095 // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist 1096 // for more details. 1097 var args = arguments; 1098 var thisBinding = baseCreate(Ctor.prototype), 1099 result = Ctor.apply(thisBinding, args); 1100 1101 // Mimic the constructor's `return` behavior. 1102 // See https://es5.github.io/#x13.2.2 for more details. 1103 return isObject(result) ? result : thisBinding; 1104 }; 1105 } 1106 1107 /** 1108 * Creates a `_.find` or `_.findLast` function. 1109 * 1110 * @private 1111 * @param {Function} findIndexFunc The function to find the collection index. 1112 * @returns {Function} Returns the new find function. 1113 */ 1114 function createFind(findIndexFunc) { 1115 return function(collection, predicate, fromIndex) { 1116 var iterable = Object(collection); 1117 if (!isArrayLike(collection)) { 1118 var iteratee = baseIteratee(predicate, 3); 1119 collection = keys(collection); 1120 predicate = function(key) { return iteratee(iterable[key], key, iterable); }; 1121 } 1122 var index = findIndexFunc(collection, predicate, fromIndex); 1123 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; 1124 }; 1125 } 1126 1127 /** 1128 * Creates a function that wraps `func` to invoke it with the `this` binding 1129 * of `thisArg` and `partials` prepended to the arguments it receives. 1130 * 1131 * @private 1132 * @param {Function} func The function to wrap. 1133 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 1134 * @param {*} thisArg The `this` binding of `func`. 1135 * @param {Array} partials The arguments to prepend to those provided to 1136 * the new function. 1137 * @returns {Function} Returns the new wrapped function. 1138 */ 1139 function createPartial(func, bitmask, thisArg, partials) { 1140 if (typeof func != 'function') { 1141 throw new TypeError(FUNC_ERROR_TEXT); 1142 } 1143 var isBind = bitmask & WRAP_BIND_FLAG, 1144 Ctor = createCtor(func); 1145 1146 function wrapper() { 1147 var argsIndex = -1, 1148 argsLength = arguments.length, 1149 leftIndex = -1, 1150 leftLength = partials.length, 1151 args = Array(leftLength + argsLength), 1152 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 1153 1154 while (++leftIndex < leftLength) { 1155 args[leftIndex] = partials[leftIndex]; 1156 } 1157 while (argsLength--) { 1158 args[leftIndex++] = arguments[++argsIndex]; 1159 } 1160 return fn.apply(isBind ? thisArg : this, args); 1161 } 1162 return wrapper; 1163 } 1164 1165 /** 1166 * A specialized version of `baseIsEqualDeep` for arrays with support for 1167 * partial deep comparisons. 1168 * 1169 * @private 1170 * @param {Array} array The array to compare. 1171 * @param {Array} other The other array to compare. 1172 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 1173 * @param {Function} customizer The function to customize comparisons. 1174 * @param {Function} equalFunc The function to determine equivalents of values. 1175 * @param {Object} stack Tracks traversed `array` and `other` objects. 1176 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. 1177 */ 1178 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { 1179 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 1180 arrLength = array.length, 1181 othLength = other.length; 1182 1183 if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 1184 return false; 1185 } 1186 // Check that cyclic values are equal. 1187 var arrStacked = stack.get(array); 1188 var othStacked = stack.get(other); 1189 if (arrStacked && othStacked) { 1190 return arrStacked == other && othStacked == array; 1191 } 1192 var index = -1, 1193 result = true, 1194 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? [] : undefined; 1195 1196 // Ignore non-index properties. 1197 while (++index < arrLength) { 1198 var arrValue = array[index], 1199 othValue = other[index]; 1200 1201 var compared; 1202 if (compared !== undefined) { 1203 if (compared) { 1204 continue; 1205 } 1206 result = false; 1207 break; 1208 } 1209 // Recursively compare arrays (susceptible to call stack limits). 1210 if (seen) { 1211 if (!baseSome(other, function(othValue, othIndex) { 1212 if (!indexOf(seen, othIndex) && 1213 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 1214 return seen.push(othIndex); 1215 } 1216 })) { 1217 result = false; 1218 break; 1219 } 1220 } else if (!( 1221 arrValue === othValue || 1222 equalFunc(arrValue, othValue, bitmask, customizer, stack) 1223 )) { 1224 result = false; 1225 break; 1226 } 1227 } 1228 return result; 1229 } 1230 1231 /** 1232 * A specialized version of `baseIsEqualDeep` for comparing objects of 1233 * the same `toStringTag`. 1234 * 1235 * **Note:** This function only supports comparing values with tags of 1236 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 1237 * 1238 * @private 1239 * @param {Object} object The object to compare. 1240 * @param {Object} other The other object to compare. 1241 * @param {string} tag The `toStringTag` of the objects to compare. 1242 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 1243 * @param {Function} customizer The function to customize comparisons. 1244 * @param {Function} equalFunc The function to determine equivalents of values. 1245 * @param {Object} stack Tracks traversed `object` and `other` objects. 1246 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 1247 */ 1248 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { 1249 switch (tag) { 1250 1251 case boolTag: 1252 case dateTag: 1253 case numberTag: 1254 // Coerce booleans to `1` or `0` and dates to milliseconds. 1255 // Invalid dates are coerced to `NaN`. 1256 return eq(+object, +other); 1257 1258 case errorTag: 1259 return object.name == other.name && object.message == other.message; 1260 1261 case regexpTag: 1262 case stringTag: 1263 // Coerce regexes to strings and treat strings, primitives and objects, 1264 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring 1265 // for more details. 1266 return object == (other + ''); 1267 1268 } 1269 return false; 1270 } 1271 1272 /** 1273 * A specialized version of `baseIsEqualDeep` for objects with support for 1274 * partial deep comparisons. 1275 * 1276 * @private 1277 * @param {Object} object The object to compare. 1278 * @param {Object} other The other object to compare. 1279 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 1280 * @param {Function} customizer The function to customize comparisons. 1281 * @param {Function} equalFunc The function to determine equivalents of values. 1282 * @param {Object} stack Tracks traversed `object` and `other` objects. 1283 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 1284 */ 1285 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { 1286 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 1287 objProps = keys(object), 1288 objLength = objProps.length, 1289 othProps = keys(other), 1290 othLength = othProps.length; 1291 1292 if (objLength != othLength && !isPartial) { 1293 return false; 1294 } 1295 var index = objLength; 1296 while (index--) { 1297 var key = objProps[index]; 1298 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { 1299 return false; 1300 } 1301 } 1302 // Check that cyclic values are equal. 1303 var objStacked = stack.get(object); 1304 var othStacked = stack.get(other); 1305 if (objStacked && othStacked) { 1306 return objStacked == other && othStacked == object; 1307 } 1308 var result = true; 1309 1310 var skipCtor = isPartial; 1311 while (++index < objLength) { 1312 key = objProps[index]; 1313 var objValue = object[key], 1314 othValue = other[key]; 1315 1316 var compared; 1317 // Recursively compare objects (susceptible to call stack limits). 1318 if (!(compared === undefined 1319 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) 1320 : compared 1321 )) { 1322 result = false; 1323 break; 1324 } 1325 skipCtor || (skipCtor = key == 'constructor'); 1326 } 1327 if (result && !skipCtor) { 1328 var objCtor = object.constructor, 1329 othCtor = other.constructor; 1330 1331 // Non `Object` object instances with different constructors are not equal. 1332 if (objCtor != othCtor && 1333 ('constructor' in object && 'constructor' in other) && 1334 !(typeof objCtor == 'function' && objCtor instanceof objCtor && 1335 typeof othCtor == 'function' && othCtor instanceof othCtor)) { 1336 result = false; 1337 } 1338 } 1339 return result; 1340 } 1341 1342 /** 1343 * A specialized version of `baseRest` which flattens the rest array. 1344 * 1345 * @private 1346 * @param {Function} func The function to apply a rest parameter to. 1347 * @returns {Function} Returns the new function. 1348 */ 1349 function flatRest(func) { 1350 return setToString(overRest(func, undefined, flatten), func + ''); 1351 } 1352 1353 /** 1354 * Checks if `value` is a flattenable `arguments` object or array. 1355 * 1356 * @private 1357 * @param {*} value The value to check. 1358 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 1359 */ 1360 function isFlattenable(value) { 1361 return isArray(value) || isArguments(value); 1362 } 1363 1364 /** 1365 * Checks if `value` is a valid array-like index. 1366 * 1367 * @private 1368 * @param {*} value The value to check. 1369 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 1370 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 1371 */ 1372 function isIndex(value, length) { 1373 var type = typeof value; 1374 length = length == null ? MAX_SAFE_INTEGER : length; 1375 1376 return !!length && 1377 (type == 'number' || 1378 (type != 'symbol' && reIsUint.test(value))) && 1379 (value > -1 && value % 1 == 0 && value < length); 1380 } 1381 1382 /** 1383 * Checks if the given arguments are from an iteratee call. 1384 * 1385 * @private 1386 * @param {*} value The potential iteratee value argument. 1387 * @param {*} index The potential iteratee index or key argument. 1388 * @param {*} object The potential iteratee object argument. 1389 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, 1390 * else `false`. 1391 */ 1392 function isIterateeCall(value, index, object) { 1393 if (!isObject(object)) { 1394 return false; 1395 } 1396 var type = typeof index; 1397 if (type == 'number' 1398 ? (isArrayLike(object) && isIndex(index, object.length)) 1399 : (type == 'string' && index in object) 1400 ) { 1401 return eq(object[index], value); 1402 } 1403 return false; 1404 } 1405 1406 /** 1407 * This function is like 1408 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 1409 * except that it includes inherited enumerable properties. 1410 * 1411 * @private 1412 * @param {Object} object The object to query. 1413 * @returns {Array} Returns the array of property names. 1414 */ 1415 function nativeKeysIn(object) { 1416 var result = []; 1417 if (object != null) { 1418 for (var key in Object(object)) { 1419 result.push(key); 1420 } 1421 } 1422 return result; 1423 } 1424 1425 /** 1426 * Converts `value` to a string using `Object.prototype.toString`. 1427 * 1428 * @private 1429 * @param {*} value The value to convert. 1430 * @returns {string} Returns the converted string. 1431 */ 1432 function objectToString(value) { 1433 return nativeObjectToString.call(value); 1434 } 1435 1436 /** 1437 * A specialized version of `baseRest` which transforms the rest array. 1438 * 1439 * @private 1440 * @param {Function} func The function to apply a rest parameter to. 1441 * @param {number} [start=func.length-1] The start position of the rest parameter. 1442 * @param {Function} transform The rest array transform. 1443 * @returns {Function} Returns the new function. 1444 */ 1445 function overRest(func, start, transform) { 1446 start = nativeMax(start === undefined ? (func.length - 1) : start, 0); 1447 return function() { 1448 var args = arguments, 1449 index = -1, 1450 length = nativeMax(args.length - start, 0), 1451 array = Array(length); 1452 1453 while (++index < length) { 1454 array[index] = args[start + index]; 1455 } 1456 index = -1; 1457 var otherArgs = Array(start + 1); 1458 while (++index < start) { 1459 otherArgs[index] = args[index]; 1460 } 1461 otherArgs[start] = transform(array); 1462 return func.apply(this, otherArgs); 1463 }; 1464 } 1465 1466 /** 1467 * Sets the `toString` method of `func` to return `string`. 1468 * 1469 * @private 1470 * @param {Function} func The function to modify. 1471 * @param {Function} string The `toString` result. 1472 * @returns {Function} Returns `func`. 1473 */ 1474 var setToString = identity; 1475 1476 /*------------------------------------------------------------------------*/ 1477 1478 /** 1479 * Creates an array with all falsey values removed. The values `false`, `null`, 1480 * `0`, `
1480""`, `undefined`, and `NaN` are false
vendor: 65,938 bytes, lines 1480-3877
1480y. 1481 * 1482 * @static 1483 * @memberOf _ 1484 * @since 0.1.0 1485 * @category Array 1486 * @param {Array} array The array to compact. 1487 * @returns {Array} Returns the new array of filtered values. 1488 * @example 1489 * 1490 * _.compact([0, 1, false, 2, '', 3]); 1491 * // => [1, 2, 3] 1492 */ 1493 function compact(array) { 1494 return baseFilter(array, Boolean); 1495 } 1496 1497 /** 1498 * Creates a new array concatenating `array` with any additional arrays 1499 * and/or values. 1500 * 1501 * @static 1502 * @memberOf _ 1503 * @since 4.0.0 1504 * @category Array 1505 * @param {Array} array The array to concatenate. 1506 * @param {...*} [values] The values to concatenate. 1507 * @returns {Array} Returns the new concatenated array. 1508 * @example 1509 * 1510 * var array = [1]; 1511 * var other = _.concat(array, 2, [3], [[4]]); 1512 * 1513 * console.log(other); 1514 * // => [1, 2, 3, [4]] 1515 * 1516 * console.log(array); 1517 * // => [1] 1518 */ 1519 function concat() { 1520 var length = arguments.length; 1521 if (!length) { 1522 return []; 1523 } 1524 var args = Array(length - 1), 1525 array = arguments[0], 1526 index = length; 1527 1528 while (index--) { 1529 args[index - 1] = arguments[index]; 1530 } 1531 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); 1532 } 1533 1534 /** 1535 * This method is like `_.find` except that it returns the index of the first 1536 * element `predicate` returns truthy for instead of the element itself. 1537 * 1538 * @static 1539 * @memberOf _ 1540 * @since 1.1.0 1541 * @category Array 1542 * @param {Array} array The array to inspect. 1543 * @param {Function} [predicate=_.identity] The function invoked per iteration. 1544 * @param {number} [fromIndex=0] The index to search from. 1545 * @returns {number} Returns the index of the found element, else `-1`. 1546 * @example 1547 * 1548 * var users = [ 1549 * { 'user': 'barney', 'active': false }, 1550 * { 'user': 'fred', 'active': false }, 1551 * { 'user': 'pebbles', 'active': true } 1552 * ]; 1553 * 1554 * _.findIndex(users, function(o) { return o.user == 'barney'; }); 1555 * // => 0 1556 * 1557 * // The `_.matches` iteratee shorthand. 1558 * _.findIndex(users, { 'user': 'fred', 'active': false }); 1559 * // => 1 1560 * 1561 * // The `_.matchesProperty` iteratee shorthand. 1562 * _.findIndex(users, ['active', false]); 1563 * // => 0 1564 * 1565 * // The `_.property` iteratee shorthand. 1566 * _.findIndex(users, 'active'); 1567 * // => 2 1568 */ 1569 function findIndex(array, predicate, fromIndex) { 1570 var length = array == null ? 0 : array.length; 1571 if (!length) { 1572 return -1; 1573 } 1574 var index = fromIndex == null ? 0 : toInteger(fromIndex); 1575 if (index < 0) { 1576 index = nativeMax(length + index, 0); 1577 } 1578 return baseFindIndex(array, baseIteratee(predicate, 3), index); 1579 } 1580 1581 /** 1582 * Flattens `array` a single level deep. 1583 * 1584 * @static 1585 * @memberOf _ 1586 * @since 0.1.0 1587 * @category Array 1588 * @param {Array} array The array to flatten. 1589 * @returns {Array} Returns the new flattened array. 1590 * @example 1591 * 1592 * _.flatten([1, [2, [3, [4]], 5]]); 1593 * // => [1, 2, [3, [4]], 5] 1594 */ 1595 function flatten(array) { 1596 var length = array == null ? 0 : array.length; 1597 return length ? baseFlatten(array, 1) : []; 1598 } 1599 1600 /** 1601 * Recursively flattens `array`. 1602 * 1603 * @static 1604 * @memberOf _ 1605 * @since 3.0.0 1606 * @category Array 1607 * @param {Array} array The array to flatten. 1608 * @returns {Array} Returns the new flattened array. 1609 * @example 1610 * 1611 * _.flattenDeep([1, [2, [3, [4]], 5]]); 1612 * // => [1, 2, 3, 4, 5] 1613 */ 1614 function flattenDeep(array) { 1615 var length = array == null ? 0 : array.length; 1616 return length ? baseFlatten(array, INFINITY) : []; 1617 } 1618 1619 /** 1620 * Gets the first element of `array`. 1621 * 1622 * @static 1623 * @memberOf _ 1624 * @since 0.1.0 1625 * @alias first 1626 * @category Array 1627 * @param {Array} array The array to query. 1628 * @returns {*} Returns the first element of `array`. 1629 * @example 1630 * 1631 * _.head([1, 2, 3]); 1632 * // => 1 1633 * 1634 * _.head([]); 1635 * // => undefined 1636 */ 1637 function head(array) { 1638 return (array && array.length) ? array[0] : undefined; 1639 } 1640 1641 /** 1642 * Gets the index at which the first occurrence of `value` is found in `array` 1643 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 1644 * for equality comparisons. If `fromIndex` is negative, it's used as the 1645 * offset from the end of `array`. 1646 * 1647 * @static 1648 * @memberOf _ 1649 * @since 0.1.0 1650 * @category Array 1651 * @param {Array} array The array to inspect. 1652 * @param {*} value The value to search for. 1653 * @param {number} [fromIndex=0] The index to search from. 1654 * @returns {number} Returns the index of the matched value, else `-1`. 1655 * @example 1656 * 1657 * _.indexOf([1, 2, 1, 2], 2); 1658 * // => 1 1659 * 1660 * // Search from the `fromIndex`. 1661 * _.indexOf([1, 2, 1, 2], 2, 2); 1662 * // => 3 1663 */ 1664 function indexOf(array, value, fromIndex) { 1665 var length = array == null ? 0 : array.length; 1666 if (typeof fromIndex == 'number') { 1667 fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; 1668 } else { 1669 fromIndex = 0; 1670 } 1671 var index = (fromIndex || 0) - 1, 1672 isReflexive = value === value; 1673 1674 while (++index < length) { 1675 var other = array[index]; 1676 if ((isReflexive ? other === value : other !== other)) { 1677 return index; 1678 } 1679 } 1680 return -1; 1681 } 1682 1683 /** 1684 * Gets the last element of `array`. 1685 * 1686 * @static 1687 * @memberOf _ 1688 * @since 0.1.0 1689 * @category Array 1690 * @param {Array} array The array to query. 1691 * @returns {*} Returns the last element of `array`. 1692 * @example 1693 * 1694 * _.last([1, 2, 3]); 1695 * // => 3 1696 */ 1697 function last(array) { 1698 var length = array == null ? 0 : array.length; 1699 return length ? array[length - 1] : undefined; 1700 } 1701 1702 /** 1703 * Creates a slice of `array` from `start` up to, but not including, `end`. 1704 * 1705 * **Note:** This method is used instead of 1706 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are 1707 * returned. 1708 * 1709 * @static 1710 * @memberOf _ 1711 * @since 3.0.0 1712 * @category Array 1713 * @param {Array} array The array to slice. 1714 * @param {number} [start=0] The start position. 1715 * @param {number} [end=array.length] The end position. 1716 * @returns {Array} Returns the slice of `array`. 1717 */ 1718 function slice(array, start, end) { 1719 var length = array == null ? 0 : array.length; 1720 start = start == null ? 0 : +start; 1721 end = end === undefined ? length : +end; 1722 return length ? baseSlice(array, start, end) : []; 1723 } 1724 1725 /*------------------------------------------------------------------------*/ 1726 1727 /** 1728 * Creates a `lodash` wrapper instance that wraps `value` with explicit method 1729 * chain sequences enabled. The result of such sequences must be unwrapped 1730 * with `_#value`. 1731 * 1732 * @static 1733 * @memberOf _ 1734 * @since 1.3.0 1735 * @category Seq 1736 * @param {*} value The value to wrap. 1737 * @returns {Object} Returns the new `lodash` wrapper instance. 1738 * @example 1739 * 1740 * var users = [ 1741 * { 'user': 'barney', 'age': 36 }, 1742 * { 'user': 'fred', 'age': 40 }, 1743 * { 'user': 'pebbles', 'age': 1 } 1744 * ]; 1745 * 1746 * var youngest = _ 1747 * .chain(users) 1748 * .sortBy('age') 1749 * .map(function(o) { 1750 * return o.user + ' is ' + o.age; 1751 * }) 1752 * .head() 1753 * .value(); 1754 * // => 'pebbles is 1' 1755 */ 1756 function chain(value) { 1757 var result = lodash(value); 1758 result.__chain__ = true; 1759 return result; 1760 } 1761 1762 /** 1763 * This method invokes `interceptor` and returns `value`. The interceptor 1764 * is invoked with one argument; (value). The purpose of this method is to 1765 * "tap into" a method chain sequence in order to modify intermediate results. 1766 * 1767 * @static 1768 * @memberOf _ 1769 * @since 0.1.0 1770 * @category Seq 1771 * @param {*} value The value to provide to `interceptor`. 1772 * @param {Function} interceptor The function to invoke. 1773 * @returns {*} Returns `value`. 1774 * @example 1775 * 1776 * _([1, 2, 3]) 1777 * .tap(function(array) { 1778 * // Mutate input array. 1779 * array.pop(); 1780 * }) 1781 * .reverse() 1782 * .value(); 1783 * // => [2, 1] 1784 */ 1785 function tap(value, interceptor) { 1786 interceptor(value); 1787 return value; 1788 } 1789 1790 /** 1791 * This method is like `_.tap` except that it returns the result of `interceptor`. 1792 * The purpose of this method is to "pass thru" values replacing intermediate 1793 * results in a method chain sequence. 1794 * 1795 * @static 1796 * @memberOf _ 1797 * @since 3.0.0 1798 * @category Seq 1799 * @param {*} value The value to provide to `interceptor`. 1800 * @param {Function} interceptor The function to invoke. 1801 * @returns {*} Returns the result of `interceptor`. 1802 * @example 1803 * 1804 * _(' abc ') 1805 * .chain() 1806 * .trim() 1807 * .thru(function(value) { 1808 * return [value]; 1809 * }) 1810 * .value(); 1811 * // => ['abc'] 1812 */ 1813 function thru(value, interceptor) { 1814 return interceptor(value); 1815 } 1816 1817 /** 1818 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. 1819 * 1820 * @name chain 1821 * @memberOf _ 1822 * @since 0.1.0 1823 * @category Seq 1824 * @returns {Object} Returns the new `lodash` wrapper instance. 1825 * @example 1826 * 1827 * var users = [ 1828 * { 'user': 'barney', 'age': 36 }, 1829 * { 'user': 'fred', 'age': 40 } 1830 * ]; 1831 * 1832 * // A sequence without explicit chaining. 1833 * _(users).head(); 1834 * // => { 'user': 'barney', 'age': 36 } 1835 * 1836 * // A sequence with explicit chaining. 1837 * _(users) 1838 * .chain() 1839 * .head() 1840 * .pick('user') 1841 * .value(); 1842 * // => { 'user': 'barney' } 1843 */ 1844 function wrapperChain() { 1845 return chain(this); 1846 } 1847 1848 /** 1849 * Executes the chain sequence to resolve the unwrapped value. 1850 * 1851 * @name value 1852 * @memberOf _ 1853 * @since 0.1.0 1854 * @alias toJSON, valueOf 1855 * @category Seq 1856 * @returns {*} Returns the resolved unwrapped value. 1857 * @example 1858 * 1859 * _([1, 2, 3]).value(); 1860 * // => [1, 2, 3] 1861 */ 1862 function wrapperValue() { 1863 return baseWrapperValue(this.__wrapped__, this.__actions__); 1864 } 1865 1866 /*------------------------------------------------------------------------*/ 1867 1868 /** 1869 * Checks if `predicate` returns truthy for **all** elements of `collection`. 1870 * Iteration is stopped once `predicate` returns falsey. The predicate is 1871 * invoked with three arguments: (value, index|key, collection). 1872 * 1873 * **Note:** This method returns `true` for 1874 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because 1875 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of 1876 * elements of empty collections. 1877 * 1878 * @static 1879 * @memberOf _ 1880 * @since 0.1.0 1881 * @category Collection 1882 * @param {Array|Object} collection The collection to iterate over. 1883 * @param {Function} [predicate=_.identity] The function invoked per iteration. 1884 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 1885 * @returns {boolean} Returns `true` if all elements pass the predicate check, 1886 * else `false`. 1887 * @example 1888 * 1889 * _.every([true, 1, null, 'yes'], Boolean); 1890 * // => false 1891 * 1892 * var users = [ 1893 * { 'user': 'barney', 'age': 36, 'active': false }, 1894 * { 'user': 'fred', 'age': 40, 'active': false } 1895 * ]; 1896 * 1897 * // The `_.matches` iteratee shorthand. 1898 * _.every(users, { 'user': 'barney', 'active': false }); 1899 * // => false 1900 * 1901 * // The `_.matchesProperty` iteratee shorthand. 1902 * _.every(users, ['active', false]); 1903 * // => true 1904 * 1905 * // The `_.property` iteratee shorthand. 1906 * _.every(users, 'active'); 1907 * // => false 1908 */ 1909 function every(collection, predicate, guard) { 1910 predicate = guard ? undefined : predicate; 1911 return baseEvery(collection, baseIteratee(predicate)); 1912 } 1913 1914 /** 1915 * Iterates over elements of `collection`, returning an array of all elements 1916 * `predicate` returns truthy for. The predicate is invoked with three 1917 * arguments: (value, index|key, collection). 1918 * 1919 * **Note:** Unlike `_.remove`, this method returns a new array. 1920 * 1921 * @static 1922 * @memberOf _ 1923 * @since 0.1.0 1924 * @category Collection 1925 * @param {Array|Object} collection The collection to iterate over. 1926 * @param {Function} [predicate=_.identity] The function invoked per iteration. 1927 * @returns {Array} Returns the new filtered array. 1928 * @see _.reject 1929 * @example 1930 * 1931 * var users = [ 1932 * { 'user': 'barney', 'age': 36, 'active': true }, 1933 * { 'user': 'fred', 'age': 40, 'active': false } 1934 * ]; 1935 * 1936 * _.filter(users, function(o) { return !o.active; }); 1937 * // => objects for ['fred'] 1938 * 1939 * // The `_.matches` iteratee shorthand. 1940 * _.filter(users, { 'age': 36, 'active': true }); 1941 * // => objects for ['barney'] 1942 * 1943 * // The `_.matchesProperty` iteratee shorthand. 1944 * _.filter(users, ['active', false]); 1945 * // => objects for ['fred'] 1946 * 1947 * // The `_.property` iteratee shorthand. 1948 * _.filter(users, 'active'); 1949 * // => objects for ['barney'] 1950 * 1951 * // Combining several predicates using `_.overEvery` or `_.overSome`. 1952 * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); 1953 * // => objects for ['fred', 'barney'] 1954 */ 1955 function filter(collection, predicate) { 1956 return baseFilter(collection, baseIteratee(predicate)); 1957 } 1958 1959 /** 1960 * Iterates over elements of `collection`, returning the first element 1961 * `predicate` returns truthy for. The predicate is invoked with three 1962 * arguments: (value, index|key, collection). 1963 * 1964 * @static 1965 * @memberOf _ 1966 * @since 0.1.0 1967 * @category Collection 1968 * @param {Array|Object} collection The collection to inspect. 1969 * @param {Function} [predicate=_.identity] The function invoked per iteration. 1970 * @param {number} [fromIndex=0] The index to search from. 1971 * @returns {*} Returns the matched element, else `undefined`. 1972 * @example 1973 * 1974 * var users = [ 1975 * { 'user': 'barney', 'age': 36, 'active': true }, 1976 * { 'user': 'fred', 'age': 40, 'active': false }, 1977 * { 'user': 'pebbles', 'age': 1, 'active': true } 1978 * ]; 1979 * 1980 * _.find(users, function(o) { return o.age < 40; }); 1981 * // => object for 'barney' 1982 * 1983 * // The `_.matches` iteratee shorthand. 1984 * _.find(users, { 'age': 1, 'active': true }); 1985 * // => object for 'pebbles' 1986 * 1987 * // The `_.matchesProperty` iteratee shorthand. 1988 * _.find(users, ['active', false]); 1989 * // => object for 'fred' 1990 * 1991 * // The `_.property` iteratee shorthand. 1992 * _.find(users, 'active'); 1993 * // => object for 'barney' 1994 */ 1995 var find = createFind(findIndex); 1996 1997 /** 1998 * Iterates over elements of `collection` and invokes `iteratee` for each element. 1999 * The iteratee is invoked with three arguments: (value, index|key, collection). 2000 * Iteratee functions may exit iteration early by explicitly returning `false`. 2001 * 2002 * **Note:** As with other "Collections" methods, objects with a "length" 2003 * property are iterated like arrays. To avoid this behavior use `_.forIn` 2004 * or `_.forOwn` for object iteration. 2005 * 2006 * @static 2007 * @memberOf _ 2008 * @since 0.1.0 2009 * @alias each 2010 * @category Collection 2011 * @param {Array|Object} collection The collection to iterate over. 2012 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 2013 * @returns {Array|Object} Returns `collection`. 2014 * @see _.forEachRight 2015 * @example 2016 * 2017 * _.forEach([1, 2], function(value) { 2018 * console.log(value); 2019 * }); 2020 * // => Logs `1` then `2`. 2021 * 2022 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { 2023 * console.log(key); 2024 * }); 2025 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 2026 */ 2027 function forEach(collection, iteratee) { 2028 return baseEach(collection, baseIteratee(iteratee)); 2029 } 2030 2031 /** 2032 * Creates an array of values by running each element in `collection` thru 2033 * `iteratee`. The iteratee is invoked with three arguments: 2034 * (value, index|key, collection). 2035 * 2036 * Many lodash methods are guarded to work as iteratees for methods like 2037 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. 2038 * 2039 * The guarded methods are: 2040 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, 2041 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, 2042 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, 2043 * `template`, `trim`, `trimEnd`, `trimStart`, and `words` 2044 * 2045 * @static 2046 * @memberOf _ 2047 * @since 0.1.0 2048 * @category Collection 2049 * @param {Array|Object} collection The collection to iterate over. 2050 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 2051 * @returns {Array} Returns the new mapped array. 2052 * @example 2053 * 2054 * function square(n) { 2055 * return n * n; 2056 * } 2057 * 2058 * _.map([4, 8], square); 2059 * // => [16, 64] 2060 * 2061 * _.map({ 'a': 4, 'b': 8 }, square); 2062 * // => [16, 64] (iteration order is not guaranteed) 2063 * 2064 * var users = [ 2065 * { 'user': 'barney' }, 2066 * { 'user': 'fred' } 2067 * ]; 2068 * 2069 * // The `_.property` iteratee shorthand. 2070 * _.map(users, 'user'); 2071 * // => ['barney', 'fred'] 2072 */ 2073 function map(collection, iteratee) { 2074 return baseMap(collection, baseIteratee(iteratee)); 2075 } 2076 2077 /** 2078 * Reduces `collection` to a value which is the accumulated result of running 2079 * each element in `collection` thru `iteratee`, where each successive 2080 * invocation is supplied the return value of the previous. If `accumulator` 2081 * is not given, the first element of `collection` is used as the initial 2082 * value. The iteratee is invoked with four arguments: 2083 * (accumulator, value, index|key, collection). 2084 * 2085 * Many lodash methods are guarded to work as iteratees for methods like 2086 * `_.reduce`, `_.reduceRight`, and `_.transform`. 2087 * 2088 * The guarded methods are: 2089 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, 2090 * and `sortBy` 2091 * 2092 * @static 2093 * @memberOf _ 2094 * @since 0.1.0 2095 * @category Collection 2096 * @param {Array|Object} collection The collection to iterate over. 2097 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 2098 * @param {*} [accumulator] The initial value. 2099 * @returns {*} Returns the accumulated value. 2100 * @see _.reduceRight 2101 * @example 2102 * 2103 * _.reduce([1, 2], function(sum, n) { 2104 * return sum + n; 2105 * }, 0); 2106 * // => 3 2107 * 2108 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 2109 * (result[value] || (result[value] = [])).push(key); 2110 * return result; 2111 * }, {}); 2112 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) 2113 */ 2114 function reduce(collection, iteratee, accumulator) { 2115 return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach); 2116 } 2117 2118 /** 2119 * Gets the size of `collection` by returning its length for array-like 2120 * values or the number of own enumerable string keyed properties for objects. 2121 * 2122 * @static 2123 * @memberOf _ 2124 * @since 0.1.0 2125 * @category Collection 2126 * @param {Array|Object|string} collection The collection to inspect. 2127 * @returns {number} Returns the collection size. 2128 * @example 2129 * 2130 * _.size([1, 2, 3]); 2131 * // => 3 2132 * 2133 * _.size({ 'a': 1, 'b': 2 }); 2134 * // => 2 2135 * 2136 * _.size('pebbles'); 2137 * // => 7 2138 */ 2139 function size(collection) { 2140 if (collection == null) { 2141 return 0; 2142 } 2143 collection = isArrayLike(collection) ? collection : nativeKeys(collection); 2144 return collection.length; 2145 } 2146 2147 /** 2148 * Checks if `predicate` returns truthy for **any** element of `collection`. 2149 * Iteration is stopped once `predicate` returns truthy. The predicate is 2150 * invoked with three arguments: (value, index|key, collection). 2151 * 2152 * @static 2153 * @memberOf _ 2154 * @since 0.1.0 2155 * @category Collection 2156 * @param {Array|Object} collection The collection to iterate over. 2157 * @param {Function} [predicate=_.identity] The function invoked per iteration. 2158 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 2159 * @returns {boolean} Returns `true` if any element passes the predicate check, 2160 * else `false`. 2161 * @example 2162 * 2163 * _.some([null, 0, 'yes', false], Boolean); 2164 * // => true 2165 * 2166 * var users = [ 2167 * { 'user': 'barney', 'active': true }, 2168 * { 'user': 'fred', 'active': false } 2169 * ]; 2170 * 2171 * // The `_.matches` iteratee shorthand. 2172 * _.some(users, { 'user': 'barney', 'active': false }); 2173 * // => false 2174 * 2175 * // The `_.matchesProperty` iteratee shorthand. 2176 * _.some(users, ['active', false]); 2177 * // => true 2178 * 2179 * // The `_.property` iteratee shorthand. 2180 * _.some(users, 'active'); 2181 * // => true 2182 */ 2183 function some(collection, predicate, guard) { 2184 predicate = guard ? undefined : predicate; 2185 return baseSome(collection, baseIteratee(predicate)); 2186 } 2187 2188 /** 2189 * Creates an array of elements, sorted in ascending order by the results of 2190 * running each element in a collection thru each iteratee. This method 2191 * performs a stable sort, that is, it preserves the original sort order of 2192 * equal elements. The iteratees are invoked with one argument: (value). 2193 * 2194 * @static 2195 * @memberOf _ 2196 * @since 0.1.0 2197 * @category Collection 2198 * @param {Array|Object} collection The collection to iterate over. 2199 * @param {...(Function|Function[])} [iteratees=[_.identity]] 2200 * The iteratees to sort by. 2201 * @returns {Array} Returns the new sorted array. 2202 * @example 2203 * 2204 * var users = [ 2205 * { 'user': 'fred', 'age': 48 }, 2206 * { 'user': 'barney', 'age': 36 }, 2207 * { 'user': 'fred', 'age': 30 }, 2208 * { 'user': 'barney', 'age': 34 } 2209 * ]; 2210 * 2211 * _.sortBy(users, [function(o) { return o.user; }]); 2212 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] 2213 * 2214 * _.sortBy(users, ['user', 'age']); 2215 * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] 2216 */ 2217 function sortBy(collection, iteratee) { 2218 var index = 0; 2219 iteratee = baseIteratee(iteratee); 2220 2221 return baseMap(baseMap(collection, function(value, key, collection) { 2222 return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) }; 2223 }).sort(function(object, other) { 2224 return compareAscending(object.criteria, other.criteria) || (object.index - other.index); 2225 }), baseProperty('value')); 2226 } 2227 2228 /*------------------------------------------------------------------------*/ 2229 2230 /** 2231 * Creates a function that invokes `func`, with the `this` binding and arguments 2232 * of the created function, while it's called less than `n` times. Subsequent 2233 * calls to the created function return the result of the last `func` invocation. 2234 * 2235 * @static 2236 * @memberOf _ 2237 * @since 3.0.0 2238 * @category Function 2239 * @param {number} n The number of calls at which `func` is no longer invoked. 2240 * @param {Function} func The function to restrict. 2241 * @returns {Function} Returns the new restricted function. 2242 * @example 2243 * 2244 * jQuery(element).on('click', _.before(5, addContactToList)); 2245 * // => Allows adding up to 4 contacts to the list. 2246 */ 2247 function before(n, func) { 2248 var result; 2249 if (typeof func != 'function') { 2250 throw new TypeError(FUNC_ERROR_TEXT); 2251 } 2252 n = toInteger(n); 2253 return function() { 2254 if (--n > 0) { 2255 result = func.apply(this, arguments); 2256 } 2257 if (n <= 1) { 2258 func = undefined; 2259 } 2260 return result; 2261 }; 2262 } 2263 2264 /** 2265 * Creates a function that invokes `func` with the `this` binding of `thisArg` 2266 * and `partials` prepended to the arguments it receives. 2267 * 2268 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 2269 * may be used as a placeholder for partially applied arguments. 2270 * 2271 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" 2272 * property of bound functions. 2273 * 2274 * @static 2275 * @memberOf _ 2276 * @since 0.1.0 2277 * @category Function 2278 * @param {Function} func The function to bind. 2279 * @param {*} thisArg The `this` binding of `func`. 2280 * @param {...*} [partials] The arguments to be partially applied. 2281 * @returns {Function} Returns the new bound function. 2282 * @example 2283 * 2284 * function greet(greeting, punctuation) { 2285 * return greeting + ' ' + this.user + punctuation; 2286 * } 2287 * 2288 * var object = { 'user': 'fred' }; 2289 * 2290 * var bound = _.bind(greet, object, 'hi'); 2291 * bound('!'); 2292 * // => 'hi fred!' 2293 * 2294 * // Bound with placeholders. 2295 * var bound = _.bind(greet, object, _, '!'); 2296 * bound('hi'); 2297 * // => 'hi fred!' 2298 */ 2299 var bind = baseRest(function(func, thisArg, partials) { 2300 return createPartial(func, WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG, thisArg, partials); 2301 }); 2302 2303 /** 2304 * Defers invoking the `func` until the current call stack has cleared. Any 2305 * additional arguments are provided to `func` when it's invoked. 2306 * 2307 * @static 2308 * @memberOf _ 2309 * @since 0.1.0 2310 * @category Function 2311 * @param {Function} func The function to defer. 2312 * @param {...*} [args] The arguments to invoke `func` with. 2313 * @returns {number} Returns the timer id. 2314 * @example 2315 * 2316 * _.defer(function(text) { 2317 * console.log(text); 2318 * }, 'deferred'); 2319 * // => Logs 'deferred' after one millisecond. 2320 */ 2321 var defer = baseRest(function(func, args) { 2322 return baseDelay(func, 1, args); 2323 }); 2324 2325 /** 2326 * Invokes `func` after `wait` milliseconds. Any additional arguments are 2327 * provided to `func` when it's invoked. 2328 * 2329 * @static 2330 * @memberOf _ 2331 * @since 0.1.0 2332 * @category Function 2333 * @param {Function} func The function to delay. 2334 * @param {number} wait The number of milliseconds to delay invocation. 2335 * @param {...*} [args] The arguments to invoke `func` with. 2336 * @returns {number} Returns the timer id. 2337 * @example 2338 * 2339 * _.delay(function(text) { 2340 * console.log(text); 2341 * }, 1000, 'later'); 2342 * // => Logs 'later' after one second. 2343 */ 2344 var delay = baseRest(function(func, wait, args) { 2345 return baseDelay(func, toNumber(wait) || 0, args); 2346 }); 2347 2348 /** 2349 * Creates a function that negates the result of the predicate `func`. The 2350 * `func` predicate is invoked with the `this` binding and arguments of the 2351 * created function. 2352 * 2353 * @static 2354 * @memberOf _ 2355 * @since 3.0.0 2356 * @category Function 2357 * @param {Function} predicate The predicate to negate. 2358 * @returns {Function} Returns the new negated function. 2359 * @example 2360 * 2361 * function isEven(n) { 2362 * return n % 2 == 0; 2363 * } 2364 * 2365 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); 2366 * // => [1, 3, 5] 2367 */ 2368 function negate(predicate) { 2369 if (typeof predicate != 'function') { 2370 throw new TypeError(FUNC_ERROR_TEXT); 2371 } 2372 return function() { 2373 var args = arguments; 2374 return !predicate.apply(this, args); 2375 }; 2376 } 2377 2378 /** 2379 * Creates a function that is restricted to invoking `func` once. Repeat calls 2380 * to the function return the value of the first invocation. The `func` is 2381 * invoked with the `this` binding and arguments of the created function. 2382 * 2383 * @static 2384 * @memberOf _ 2385 * @since 0.1.0 2386 * @category Function 2387 * @param {Function} func The function to restrict. 2388 * @returns {Function} Returns the new restricted function. 2389 * @example 2390 * 2391 * var initialize = _.once(createApplication); 2392 * initialize(); 2393 * initialize(); 2394 * // => `createApplication` is invoked once 2395 */ 2396 function once(func) { 2397 return before(2, func); 2398 } 2399 2400 /*------------------------------------------------------------------------*/ 2401 2402 /** 2403 * Creates a shallow clone of `value`. 2404 * 2405 * **Note:** This method is loosely based on the 2406 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) 2407 * and supports cloning arrays, array buffers, booleans, date objects, maps, 2408 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed 2409 * arrays. The own enumerable properties of `arguments` objects are cloned 2410 * as plain objects. An empty object is returned for uncloneable values such 2411 * as error objects, functions, DOM nodes, and WeakMaps. 2412 * 2413 * @static 2414 * @memberOf _ 2415 * @since 0.1.0 2416 * @category Lang 2417 * @param {*} value The value to clone. 2418 * @returns {*} Returns the cloned value. 2419 * @see _.cloneDeep 2420 * @example 2421 * 2422 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 2423 * 2424 * var shallow = _.clone(objects); 2425 * console.log(shallow[0] === objects[0]); 2426 * // => true 2427 */ 2428 function clone(value) { 2429 if (!isObject(value)) { 2430 return value; 2431 } 2432 return isArray(value) ? copyArray(value) : copyObject(value, nativeKeys(value)); 2433 } 2434 2435 /** 2436 * Performs a 2437 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 2438 * comparison between two values to determine if they are equivalent. 2439 * 2440 * @static 2441 * @memberOf _ 2442 * @since 4.0.0 2443 * @category Lang 2444 * @param {*} value The value to compare. 2445 * @param {*} other The other value to compare. 2446 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 2447 * @example 2448 * 2449 * var object = { 'a': 1 }; 2450 * var other = { 'a': 1 }; 2451 * 2452 * _.eq(object, object); 2453 * // => true 2454 * 2455 * _.eq(object, other); 2456 * // => false 2457 * 2458 * _.eq('a', 'a'); 2459 * // => true 2460 * 2461 * _.eq('a', Object('a')); 2462 * // => false 2463 * 2464 * _.eq(NaN, NaN); 2465 * // => true 2466 */ 2467 function eq(value, other) { 2468 return value === other || (value !== value && other !== other); 2469 } 2470 2471 /** 2472 * Checks if `value` is likely an `arguments` object. 2473 * 2474 * @static 2475 * @memberOf _ 2476 * @since 0.1.0 2477 * @category Lang 2478 * @param {*} value The value to check. 2479 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 2480 * else `false`. 2481 * @example 2482 * 2483 * _.isArguments(function() { return arguments; }()); 2484 * // => true 2485 * 2486 * _.isArguments([1, 2, 3]); 2487 * // => false 2488 */ 2489 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { 2490 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && 2491 !propertyIsEnumerable.call(value, 'callee'); 2492 }; 2493 2494 /** 2495 * Checks if `value` is classified as an `Array` object. 2496 * 2497 * @static 2498 * @memberOf _ 2499 * @since 0.1.0 2500 * @category Lang 2501 * @param {*} value The value to check. 2502 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 2503 * @example 2504 * 2505 * _.isArray([1, 2, 3]); 2506 * // => true 2507 * 2508 * _.isArray(document.body.children); 2509 * // => false 2510 * 2511 * _.isArray('abc'); 2512 * // => false 2513 * 2514 * _.isArray(_.noop); 2515 * // => false 2516 */ 2517 var isArray = Array.isArray; 2518 2519 /** 2520 * Checks if `value` is array-like. A value is considered array-like if it's 2521 * not a function and has a `value.length` that's an integer greater than or 2522 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 2523 * 2524 * @static 2525 * @memberOf _ 2526 * @since 4.0.0 2527 * @category Lang 2528 * @param {*} value The value to check. 2529 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 2530 * @example 2531 * 2532 * _.isArrayLike([1, 2, 3]); 2533 * // => true 2534 * 2535 * _.isArrayLike(document.body.children); 2536 * // => true 2537 * 2538 * _.isArrayLike('abc'); 2539 * // => true 2540 * 2541 * _.isArrayLike(_.noop); 2542 * // => false 2543 */ 2544 function isArrayLike(value) { 2545 return value != null && isLength(value.length) && !isFunction(value); 2546 } 2547 2548 /** 2549 * Checks if `value` is classified as a boolean primitive or object. 2550 * 2551 * @static 2552 * @memberOf _ 2553 * @since 0.1.0 2554 * @category Lang 2555 * @param {*} value The value to check. 2556 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. 2557 * @example 2558 * 2559 * _.isBoolean(false); 2560 * // => true 2561 * 2562 * _.isBoolean(null); 2563 * // => false 2564 */ 2565 function isBoolean(value) { 2566 return value === true || value === false || 2567 (isObjectLike(value) && baseGetTag(value) == boolTag); 2568 } 2569 2570 /** 2571 * Checks if `value` is classified as a `Date` object. 2572 * 2573 * @static 2574 * @memberOf _ 2575 * @since 0.1.0 2576 * @category Lang 2577 * @param {*} value The value to check. 2578 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 2579 * @example 2580 * 2581 * _.isDate(new Date); 2582 * // => true 2583 * 2584 * _.isDate('Mon April 23 2012'); 2585 * // => false 2586 */ 2587 var isDate = baseIsDate; 2588 2589 /** 2590 * Checks if `value` is an empty object, collection, map, or set. 2591 * 2592 * Objects are considered empty if they have no own enumerable string keyed 2593 * properties. 2594 * 2595 * Array-like values such as `arguments` objects, arrays, buffers, strings, or 2596 * jQuery-like collections are considered empty if they have a `length` of `0`. 2597 * Similarly, maps and sets are considered empty if they have a `size` of `0`. 2598 * 2599 * @static 2600 * @memberOf _ 2601 * @since 0.1.0 2602 * @category Lang 2603 * @param {*} value The value to check. 2604 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 2605 * @example 2606 * 2607 * _.isEmpty(null); 2608 * // => true 2609 * 2610 * _.isEmpty(true); 2611 * // => true 2612 * 2613 * _.isEmpty(1); 2614 * // => true 2615 * 2616 * _.isEmpty([1, 2, 3]); 2617 * // => false 2618 * 2619 * _.isEmpty({ 'a': 1 }); 2620 * // => false 2621 */ 2622 function isEmpty(value) { 2623 if (isArrayLike(value) && 2624 (isArray(value) || isString(value) || 2625 isFunction(value.splice) || isArguments(value))) { 2626 return !value.length; 2627 } 2628 return !nativeKeys(value).length; 2629 } 2630 2631 /** 2632 * Performs a deep comparison between two values to determine if they are 2633 * equivalent. 2634 * 2635 * **Note:** This method supports comparing arrays, array buffers, booleans, 2636 * date objects, error objects, maps, numbers, `Object` objects, regexes, 2637 * sets, strings, symbols, and typed arrays. `Object` objects are compared 2638 * by their own, not inherited, enumerable properties. Functions and DOM 2639 * nodes are compared by strict equality, i.e. `===`. 2640 * 2641 * @static 2642 * @memberOf _ 2643 * @since 0.1.0 2644 * @category Lang 2645 * @param {*} value The value to compare. 2646 * @param {*} other The other value to compare. 2647 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 2648 * @example 2649 * 2650 * var object = { 'a': 1 }; 2651 * var other = { 'a': 1 }; 2652 * 2653 * _.isEqual(object, other); 2654 * // => true 2655 * 2656 * object === other; 2657 * // => false 2658 */ 2659 function isEqual(value, other) { 2660 return baseIsEqual(value, other); 2661 } 2662 2663 /** 2664 * Checks if `value` is a finite primitive number. 2665 * 2666 * **Note:** This method is based on 2667 * [`Number.isFinite`](https://mdn.io/Number/isFinite). 2668 * 2669 * @static 2670 * @memberOf _ 2671 * @since 0.1.0 2672 * @category Lang 2673 * @param {*} value The value to check. 2674 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. 2675 * @example 2676 * 2677 * _.isFinite(3); 2678 * // => true 2679 * 2680 * _.isFinite(Number.MIN_VALUE); 2681 * // => true 2682 * 2683 * _.isFinite(Infinity); 2684 * // => false 2685 * 2686 * _.isFinite('3'); 2687 * // => false 2688 */ 2689 function isFinite(value) { 2690 return typeof value == 'number' && nativeIsFinite(value); 2691 } 2692 2693 /** 2694 * Checks if `value` is classified as a `Function` object. 2695 * 2696 * @static 2697 * @memberOf _ 2698 * @since 0.1.0 2699 * @category Lang 2700 * @param {*} value The value to check. 2701 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 2702 * @example 2703 * 2704 * _.isFunction(_); 2705 * // => true 2706 * 2707 * _.isFunction(/abc/); 2708 * // => false 2709 */ 2710 function isFunction(value) { 2711 if (!isObject(value)) { 2712 return false; 2713 } 2714 // The use of `Object#toString` avoids issues with the `typeof` operator 2715 // in Safari 9 which returns 'object' for typed arrays and other constructors. 2716 var tag = baseGetTag(value); 2717 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 2718 } 2719 2720 /** 2721 * Checks if `value` is a valid array-like length. 2722 * 2723 * **Note:** This method is loosely based on 2724 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 2725 * 2726 * @static 2727 * @memberOf _ 2728 * @since 4.0.0 2729 * @category Lang 2730 * @param {*} value The value to check. 2731 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 2732 * @example 2733 * 2734 * _.isLength(3); 2735 * // => true 2736 * 2737 * _.isLength(Number.MIN_VALUE); 2738 * // => false 2739 * 2740 * _.isLength(Infinity); 2741 * // => false 2742 * 2743 * _.isLength('3'); 2744 * // => false 2745 */ 2746 function isLength(value) { 2747 return typeof value == 'number' && 2748 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 2749 } 2750 2751 /** 2752 * Checks if `value` is the 2753 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 2754 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 2755 * 2756 * @static 2757 * @memberOf _ 2758 * @since 0.1.0 2759 * @category Lang 2760 * @param {*} value The value to check. 2761 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 2762 * @example 2763 * 2764 * _.isObject({}); 2765 * // => true 2766 * 2767 * _.isObject([1, 2, 3]); 2768 * // => true 2769 * 2770 * _.isObject(_.noop); 2771 * // => true 2772 * 2773 * _.isObject(null); 2774 * // => false 2775 */ 2776 function isObject(value) { 2777 var type = typeof value; 2778 return value != null && (type == 'object' || type == 'function'); 2779 } 2780 2781 /** 2782 * Checks if `value` is object-like. A value is object-like if it's not `null` 2783 * and has a `typeof` result of "object". 2784 * 2785 * @static 2786 * @memberOf _ 2787 * @since 4.0.0 2788 * @category Lang 2789 * @param {*} value The value to check. 2790 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 2791 * @example 2792 * 2793 * _.isObjectLike({}); 2794 * // => true 2795 * 2796 * _.isObjectLike([1, 2, 3]); 2797 * // => true 2798 * 2799 * _.isObjectLike(_.noop); 2800 * // => false 2801 * 2802 * _.isObjectLike(null); 2803 * // => false 2804 */ 2805 function isObjectLike(value) { 2806 return value != null && typeof value == 'object'; 2807 } 2808 2809 /** 2810 * Checks if `value` is `NaN`. 2811 * 2812 * **Note:** This method is based on 2813 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as 2814 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for 2815 * `undefined` and other non-number values. 2816 * 2817 * @static 2818 * @memberOf _ 2819 * @since 0.1.0 2820 * @category Lang 2821 * @param {*} value The value to check. 2822 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 2823 * @example 2824 * 2825 * _.isNaN(NaN); 2826 * // => true 2827 * 2828 * _.isNaN(new Number(NaN)); 2829 * // => true 2830 * 2831 * isNaN(undefined); 2832 * // => true 2833 * 2834 * _.isNaN(undefined); 2835 * // => false 2836 */ 2837 function isNaN(value) { 2838 // An `NaN` primitive is the only value that is not equal to itself. 2839 // Perform the `toStringTag` check first to avoid errors with some 2840 // ActiveX objects in IE. 2841 return isNumber(value) && value != +value; 2842 } 2843 2844 /** 2845 * Checks if `value` is `null`. 2846 * 2847 * @static 2848 * @memberOf _ 2849 * @since 0.1.0 2850 * @category Lang 2851 * @param {*} value The value to check. 2852 * @returns {boolean} Returns `true` if `value` is `null`, else `false`. 2853 * @example 2854 * 2855 * _.isNull(null); 2856 * // => true 2857 * 2858 * _.isNull(void 0); 2859 * // => false 2860 */ 2861 function isNull(value) { 2862 return value === null; 2863 } 2864 2865 /** 2866 * Checks if `value` is classified as a `Number` primitive or object. 2867 * 2868 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are 2869 * classified as numbers, use the `_.isFinite` method. 2870 * 2871 * @static 2872 * @memberOf _ 2873 * @since 0.1.0 2874 * @category Lang 2875 * @param {*} value The value to check. 2876 * @returns {boolean} Returns `true` if `value` is a number, else `false`. 2877 * @example 2878 * 2879 * _.isNumber(3); 2880 * // => true 2881 * 2882 * _.isNumber(Number.MIN_VALUE); 2883 * // => true 2884 * 2885 * _.isNumber(Infinity); 2886 * // => true 2887 * 2888 * _.isNumber('3'); 2889 * // => false 2890 */ 2891 function isNumber(value) { 2892 return typeof value == 'number' || 2893 (isObjectLike(value) && baseGetTag(value) == numberTag); 2894 } 2895 2896 /** 2897 * Checks if `value` is classified as a `RegExp` object. 2898 * 2899 * @static 2900 * @memberOf _ 2901 * @since 0.1.0 2902 * @category Lang 2903 * @param {*} value The value to check. 2904 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 2905 * @example 2906 * 2907 * _.isRegExp(/abc/); 2908 * // => true 2909 * 2910 * _.isRegExp('/abc/'); 2911 * // => false 2912 */ 2913 var isRegExp = baseIsRegExp; 2914 2915 /** 2916 * Checks if `value` is classified as a `String` primitive or object. 2917 * 2918 * @static 2919 * @since 0.1.0 2920 * @memberOf _ 2921 * @category Lang 2922 * @param {*} value The value to check. 2923 * @returns {boolean} Returns `true` if `value` is a string, else `false`. 2924 * @example 2925 * 2926 * _.isString('abc'); 2927 * // => true 2928 * 2929 * _.isString(1); 2930 * // => false 2931 */ 2932 function isString(value) { 2933 return typeof value == 'string' || 2934 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); 2935 } 2936 2937 /** 2938 * Checks if `value` is `undefined`. 2939 * 2940 * @static 2941 * @since 0.1.0 2942 * @memberOf _ 2943 * @category Lang 2944 * @param {*} value The value to check. 2945 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 2946 * @example 2947 * 2948 * _.isUndefined(void 0); 2949 * // => true 2950 * 2951 * _.isUndefined(null); 2952 * // => false 2953 */ 2954 function isUndefined(value) { 2955 return value === undefined; 2956 } 2957 2958 /** 2959 * Converts `value` to an array. 2960 * 2961 * @static 2962 * @since 0.1.0 2963 * @memberOf _ 2964 * @category Lang 2965 * @param {*} value The value to convert. 2966 * @returns {Array} Returns the converted array. 2967 * @example 2968 * 2969 * _.toArray({ 'a': 1, 'b': 2 }); 2970 * // => [1, 2] 2971 * 2972 * _.toArray('abc'); 2973 * // => ['a', 'b', 'c'] 2974 * 2975 * _.toArray(1); 2976 * // => [] 2977 * 2978 * _.toArray(null); 2979 * // => [] 2980 */ 2981 function toArray(value) { 2982 if (!isArrayLike(value)) { 2983 return values(value); 2984 } 2985 return value.length ? copyArray(value) : []; 2986 } 2987 2988 /** 2989 * Converts `value` to an integer. 2990 * 2991 * **Note:** This method is loosely based on 2992 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). 2993 * 2994 * @static 2995 * @memberOf _ 2996 * @since 4.0.0 2997 * @category Lang 2998 * @param {*} value The value to convert. 2999 * @returns {number} Returns the converted integer. 3000 * @example 3001 * 3002 * _.toInteger(3.2); 3003 * // => 3 3004 * 3005 * _.toInteger(Number.MIN_VALUE); 3006 * // => 0 3007 * 3008 * _.toInteger(Infinity); 3009 * // => 1.7976931348623157e+308 3010 * 3011 * _.toInteger('3.2'); 3012 * // => 3 3013 */ 3014 var toInteger = Number; 3015 3016 /** 3017 * Converts `value` to a number. 3018 * 3019 * @static 3020 * @memberOf _ 3021 * @since 4.0.0 3022 * @category Lang 3023 * @param {*} value The value to process. 3024 * @returns {number} Returns the number. 3025 * @example 3026 * 3027 * _.toNumber(3.2); 3028 * // => 3.2 3029 * 3030 * _.toNumber(Number.MIN_VALUE); 3031 * // => 5e-324 3032 * 3033 * _.toNumber(Infinity); 3034 * // => Infinity 3035 * 3036 * _.toNumber('3.2'); 3037 * // => 3.2 3038 */ 3039 var toNumber = Number; 3040 3041 /** 3042 * Converts `value` to a string. An empty string is returned for `null` 3043 * and `undefined` values. The sign of `-0` is preserved. 3044 * 3045 * @static 3046 * @memberOf _ 3047 * @since 4.0.0 3048 * @category Lang 3049 * @param {*} value The value to convert. 3050 * @returns {string} Returns the converted string. 3051 * @example 3052 * 3053 * _.toString(null); 3054 * // => '' 3055 * 3056 * _.toString(-0); 3057 * // => '-0' 3058 * 3059 * _.toString([1, 2, 3]); 3060 * // => '1,2,3' 3061 */ 3062 function toString(value) { 3063 if (typeof value == 'string') { 3064 return value; 3065 } 3066 return value == null ? '' : (value + ''); 3067 } 3068 3069 /*------------------------------------------------------------------------*/ 3070 3071 /** 3072 * Assigns own enumerable string keyed properties of source objects to the 3073 * destination object. Source objects are applied from left to right. 3074 * Subsequent sources overwrite property assignments of previous sources. 3075 * 3076 * **Note:** This method mutates `object` and is loosely based on 3077 * [`Object.assign`](https://mdn.io/Object/assign). 3078 * 3079 * @static 3080 * @memberOf _ 3081 * @since 0.10.0 3082 * @category Object 3083 * @param {Object} object The destination object. 3084 * @param {...Object} [sources] The source objects. 3085 * @returns {Object} Returns `object`. 3086 * @see _.assignIn 3087 * @example 3088 * 3089 * function Foo() { 3090 * this.a = 1; 3091 * } 3092 * 3093 * function Bar() { 3094 * this.c = 3; 3095 * } 3096 * 3097 * Foo.prototype.b = 2; 3098 * Bar.prototype.d = 4; 3099 * 3100 * _.assign({ 'a': 0 }, new Foo, new Bar); 3101 * // => { 'a': 1, 'c': 3 } 3102 */ 3103 var assign = createAssigner(function(object, source) { 3104 copyObject(source, nativeKeys(source), object); 3105 }); 3106 3107 /** 3108 * This method is like `_.assign` except that it iterates over own and 3109 * inherited source properties. 3110 * 3111 * **Note:** This method mutates `object`. 3112 * 3113 * @static 3114 * @memberOf _ 3115 * @since 4.0.0 3116 * @alias extend 3117 * @category Object 3118 * @param {Object} object The destination object. 3119 * @param {...Object} [sources] The source objects. 3120 * @returns {Object} Returns `object`. 3121 * @see _.assign 3122 * @example 3123 * 3124 * function Foo() { 3125 * this.a = 1; 3126 * } 3127 * 3128 * function Bar() { 3129 * this.c = 3; 3130 * } 3131 * 3132 * Foo.prototype.b = 2; 3133 * Bar.prototype.d = 4; 3134 * 3135 * _.assignIn({ 'a': 0 }, new Foo, new Bar); 3136 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } 3137 */ 3138 var assignIn = createAssigner(function(object, source) { 3139 copyObject(source, nativeKeysIn(source), object); 3140 }); 3141 3142 /** 3143 * Creates an object that inherits from the `prototype` object. If a 3144 * `properties` object is given, its own enumerable string keyed properties 3145 * are assigned to the created object. 3146 * 3147 * @static 3148 * @memberOf _ 3149 * @since 2.3.0 3150 * @category Object 3151 * @param {Object} prototype The object to inherit from. 3152 * @param {Object} [properties] The properties to assign to the object. 3153 * @returns {Object} Returns the new object. 3154 * @example 3155 * 3156 * function Shape() { 3157 * this.x = 0; 3158 * this.y = 0; 3159 * } 3160 * 3161 * function Circle() { 3162 * Shape.call(this); 3163 * } 3164 * 3165 * Circle.prototype = _.create(Shape.prototype, { 3166 * 'constructor': Circle 3167 * }); 3168 * 3169 * var circle = new Circle; 3170 * circle instanceof Circle; 3171 * // => true 3172 * 3173 * circle instanceof Shape; 3174 * // => true 3175 */ 3176 function create(prototype, properties) { 3177 var result = baseCreate(prototype); 3178 return properties == null ? result : assign(result, properties); 3179 } 3180 3181 /** 3182 * Assigns own and inherited enumerable string keyed properties of source 3183 * objects to the destination object for all destination properties that 3184 * resolve to `undefined`. Source objects are applied from left to right. 3185 * Once a property is set, additional values of the same property are ignored. 3186 * 3187 * **Note:** This method mutates `object`. 3188 * 3189 * @static 3190 * @since 0.1.0 3191 * @memberOf _ 3192 * @category Object 3193 * @param {Object} object The destination object. 3194 * @param {...Object} [sources] The source objects. 3195 * @returns {Object} Returns `object`. 3196 * @see _.defaultsDeep 3197 * @example 3198 * 3199 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 3200 * // => { 'a': 1, 'b': 2 } 3201 */ 3202 var defaults = baseRest(function(object, sources) { 3203 object = Object(object); 3204 3205 var index = -1; 3206 var length = sources.length; 3207 var guard = length > 2 ? sources[2] : undefined; 3208 3209 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 3210 length = 1; 3211 } 3212 3213 while (++index < length) { 3214 var source = sources[index]; 3215 var props = keysIn(source); 3216 var propsIndex = -1; 3217 var propsLength = props.length; 3218 3219 while (++propsIndex < propsLength) { 3220 var key = props[propsIndex]; 3221 var value = object[key]; 3222 3223 if (value === undefined || 3224 (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { 3225 object[key] = source[key]; 3226 } 3227 } 3228 } 3229 3230 return object; 3231 }); 3232 3233 /** 3234 * Checks if `path` is a direct property of `object`. 3235 * 3236 * @static 3237 * @since 0.1.0 3238 * @memberOf _ 3239 * @category Object 3240 * @param {Object} object The object to query. 3241 * @param {Array|string} path The path to check. 3242 * @returns {boolean} Returns `true` if `path` exists, else `false`. 3243 * @example 3244 * 3245 * var object = { 'a': { 'b': 2 } }; 3246 * var other = _.create({ 'a': _.create({ 'b': 2 }) }); 3247 * 3248 * _.has(object, 'a'); 3249 * // => true 3250 * 3251 * _.has(object, 'a.b'); 3252 * // => true 3253 * 3254 * _.has(object, ['a', 'b']); 3255 * // => true 3256 * 3257 * _.has(other, 'a'); 3258 * // => false 3259 */ 3260 function has(object, path) { 3261 return object != null && hasOwnProperty.call(object, path); 3262 } 3263 3264 /** 3265 * Creates an array of the own enumerable property names of `object`. 3266 * 3267 * **Note:** Non-object values are coerced to objects. See the 3268 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 3269 * for more details. 3270 * 3271 * @static 3272 * @since 0.1.0 3273 * @memberOf _ 3274 * @category Object 3275 * @param {Object} object The object to query. 3276 * @returns {Array} Returns the array of property names. 3277 * @example 3278 * 3279 * function Foo() { 3280 * this.a = 1; 3281 * this.b = 2; 3282 * } 3283 * 3284 * Foo.prototype.c = 3; 3285 * 3286 * _.keys(new Foo); 3287 * // => ['a', 'b'] (iteration order is not guaranteed) 3288 * 3289 * _.keys('hi'); 3290 * // => ['0', '1'] 3291 */ 3292 var keys = nativeKeys; 3293 3294 /** 3295 * Creates an array of the own and inherited enumerable property names of `object`. 3296 * 3297 * **Note:** Non-object values are coerced to objects. 3298 * 3299 * @static 3300 * @memberOf _ 3301 * @since 3.0.0 3302 * @category Object 3303 * @param {Object} object The object to query. 3304 * @returns {Array} Returns the array of property names. 3305 * @example 3306 * 3307 * function Foo() { 3308 * this.a = 1; 3309 * this.b = 2; 3310 * } 3311 * 3312 * Foo.prototype.c = 3; 3313 * 3314 * _.keysIn(new Foo); 3315 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 3316 */ 3317 var keysIn = nativeKeysIn; 3318 3319 /** 3320 * Creates an object composed of the picked `object` properties. 3321 * 3322 * @static 3323 * @since 0.1.0 3324 * @memberOf _ 3325 * @category Object 3326 * @param {Object} object The source object. 3327 * @param {...(string|string[])} [paths] The property paths to pick. 3328 * @returns {Object} Returns the new object. 3329 * @example 3330 * 3331 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 3332 * 3333 * _.pick(object, ['a', 'c']); 3334 * // => { 'a': 1, 'c': 3 } 3335 */ 3336 var pick = flatRest(function(object, paths) { 3337 return object == null ? {} : basePick(object, paths); 3338 }); 3339 3340 /** 3341 * This method is like `_.get` except that if the resolved value is a 3342 * function it's invoked with the `this` binding of its parent object and 3343 * its result is returned. 3344 * 3345 * @static 3346 * @since 0.1.0 3347 * @memberOf _ 3348 * @category Object 3349 * @param {Object} object The object to query. 3350 * @param {Array|string} path The path of the property to resolve. 3351 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 3352 * @returns {*} Returns the resolved value. 3353 * @example 3354 * 3355 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; 3356 * 3357 * _.result(object, 'a[0].b.c1'); 3358 * // => 3 3359 * 3360 * _.result(object, 'a[0].b.c2'); 3361 * // => 4 3362 * 3363 * _.result(object, 'a[0].b.c3', 'default'); 3364 * // => 'default' 3365 * 3366 * _.result(object, 'a[0].b.c3', _.constant('default')); 3367 * // => 'default' 3368 */ 3369 function result(object, path, defaultValue) { 3370 var value = object == null ? undefined : object[path]; 3371 if (value === undefined) { 3372 value = defaultValue; 3373 } 3374 return isFunction(value) ? value.call(object) : value; 3375 } 3376 3377 /** 3378 * Creates an array of the own enumerable string keyed property values of `object`. 3379 * 3380 * **Note:** Non-object values are coerced to objects. 3381 * 3382 * @static 3383 * @since 0.1.0 3384 * @memberOf _ 3385 * @category Object 3386 * @param {Object} object The object to query. 3387 * @returns {Array} Returns the array of property values. 3388 * @example 3389 * 3390 * function Foo() { 3391 * this.a = 1; 3392 * this.b = 2; 3393 * } 3394 * 3395 * Foo.prototype.c = 3; 3396 * 3397 * _.values(new Foo); 3398 * // => [1, 2] (iteration order is not guaranteed) 3399 * 3400 * _.values('hi'); 3401 * // => ['h', 'i'] 3402 */ 3403 function values(object) { 3404 return object == null ? [] : baseValues(object, keys(object)); 3405 } 3406 3407 /*------------------------------------------------------------------------*/ 3408 3409 /** 3410 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their 3411 * corresponding HTML entities. 3412 * 3413 * **Note:** No other characters are escaped. To escape additional 3414 * characters use a third-party library like [_he_](https://mths.be/he). 3415 * 3416 * Though the ">" character is escaped for symmetry, characters like 3417 * ">" and "/" don't need escaping in HTML and have no special meaning 3418 * unless they're part of a tag or unquoted attribute value. See 3419 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) 3420 * (under "semi-related fun fact") for more details. 3421 * 3422 * When working with HTML you should always 3423 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce 3424 * XSS vectors. 3425 * 3426 * @static 3427 * @since 0.1.0 3428 * @memberOf _ 3429 * @category String 3430 * @param {string} [string=''] The string to escape. 3431 * @returns {string} Returns the escaped string. 3432 * @example 3433 * 3434 * _.escape('fred, barney, & pebbles'); 3435 * // => 'fred, barney, & pebbles' 3436 */ 3437 function escape(string) { 3438 string = toString(string); 3439 return (string && reHasUnescapedHtml.test(string)) 3440 ? string.replace(reUnescapedHtml, escapeHtmlChar) 3441 : string; 3442 } 3443 3444 /*------------------------------------------------------------------------*/ 3445 3446 /** 3447 * This method returns the first argument it receives. 3448 * 3449 * @static 3450 * @since 0.1.0 3451 * @memberOf _ 3452 * @category Util 3453 * @param {*} value Any value. 3454 * @returns {*} Returns `value`. 3455 * @example 3456 * 3457 * var object = { 'a': 1 }; 3458 * 3459 * console.log(_.identity(object) === object); 3460 * // => true 3461 */ 3462 function identity(value) { 3463 return value; 3464 } 3465 3466 /** 3467 * Creates a function that invokes `func` with the arguments of the created 3468 * function. If `func` is a property name, the created function returns the 3469 * property value for a given element. If `func` is an array or object, the 3470 * created function returns `true` for elements that contain the equivalent 3471 * source properties, otherwise it returns `false`. 3472 * 3473 * @static 3474 * @since 4.0.0 3475 * @memberOf _ 3476 * @category Util 3477 * @param {*} [func=_.identity] The value to convert to a callback. 3478 * @returns {Function} Returns the callback. 3479 * @example 3480 * 3481 * var users = [ 3482 * { 'user': 'barney', 'age': 36, 'active': true }, 3483 * { 'user': 'fred', 'age': 40, 'active': false } 3484 * ]; 3485 * 3486 * // The `_.matches` iteratee shorthand. 3487 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); 3488 * // => [{ 'user': 'barney', 'age': 36, 'active': true }] 3489 * 3490 * // The `_.matchesProperty` iteratee shorthand. 3491 * _.filter(users, _.iteratee(['user', 'fred'])); 3492 * // => [{ 'user': 'fred', 'age': 40 }] 3493 * 3494 * // The `_.property` iteratee shorthand. 3495 * _.map(users, _.iteratee('user')); 3496 * // => ['barney', 'fred'] 3497 * 3498 * // Create custom iteratee shorthands. 3499 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { 3500 * return !_.isRegExp(func) ? iteratee(func) : function(string) { 3501 * return func.test(string); 3502 * }; 3503 * }); 3504 * 3505 * _.filter(['abc', 'def'], /ef/); 3506 * // => ['def'] 3507 */ 3508 var iteratee = baseIteratee; 3509 3510 /** 3511 * Creates a function that performs a partial deep comparison between a given 3512 * object and `source`, returning `true` if the given object has equivalent 3513 * property values, else `false`. 3514 * 3515 * **Note:** The created function is equivalent to `_.isMatch` with `source` 3516 * partially applied. 3517 * 3518 * Partial comparisons will match empty array and empty object `source` 3519 * values against any array or object value, respectively. See `_.isEqual` 3520 * for a list of supported value comparisons. 3521 * 3522 * **Note:** Multiple values can be checked by combining several matchers 3523 * using `_.overSome` 3524 * 3525 * @static 3526 * @memberOf _ 3527 * @since 3.0.0 3528 * @category Util 3529 * @param {Object} source The object of property values to match. 3530 * @returns {Function} Returns the new spec function. 3531 * @example 3532 * 3533 * var objects = [ 3534 * { 'a': 1, 'b': 2, 'c': 3 }, 3535 * { 'a': 4, 'b': 5, 'c': 6 } 3536 * ]; 3537 * 3538 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); 3539 * // => [{ 'a': 4, 'b': 5, 'c': 6 }] 3540 * 3541 * // Checking for several possible values 3542 * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); 3543 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 3544 */ 3545 function matches(source) { 3546 return baseMatches(assign({}, source)); 3547 } 3548 3549 /** 3550 * Adds all own enumerable string keyed function properties of a source 3551 * object to the destination object. If `object` is a function, then methods 3552 * are added to its prototype as well. 3553 * 3554 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to 3555 * avoid conflicts caused by modifying the original. 3556 * 3557 * @static 3558 * @since 0.1.0 3559 * @memberOf _ 3560 * @category Util 3561 * @param {Function|Object} [object=lodash] The destination object. 3562 * @param {Object} source The object of functions to add. 3563 * @param {Object} [options={}] The options object. 3564 * @param {boolean} [options.chain=true] Specify whether mixins are chainable. 3565 * @returns {Function|Object} Returns `object`. 3566 * @example 3567 * 3568 * function vowels(string) { 3569 * return _.filter(string, function(v) { 3570 * return /[aeiou]/i.test(v); 3571 * }); 3572 * } 3573 * 3574 * _.mixin({ 'vowels': vowels }); 3575 * _.vowels('fred'); 3576 * // => ['e'] 3577 * 3578 * _('fred').vowels().value(); 3579 * // => ['e'] 3580 * 3581 * _.mixin({ 'vowels': vowels }, { 'chain': false }); 3582 * _('fred').vowels(); 3583 * // => ['e'] 3584 */ 3585 function mixin(object, source, options) { 3586 var props = keys(source), 3587 methodNames = baseFunctions(source, props); 3588 3589 if (options == null && 3590 !(isObject(source) && (methodNames.length || !props.length))) { 3591 options = source; 3592 source = object; 3593 object = this; 3594 methodNames = baseFunctions(source, keys(source)); 3595 } 3596 var chain = !(isObject(options) && 'chain' in options) || !!options.chain, 3597 isFunc = isFunction(object); 3598 3599 baseEach(methodNames, function(methodName) { 3600 var func = source[methodName]; 3601 object[methodName] = func; 3602 if (isFunc) { 3603 object.prototype[methodName] = function() { 3604 var chainAll = this.__chain__; 3605 if (chain || chainAll) { 3606 var result = object(this.__wrapped__), 3607 actions = result.__actions__ = copyArray(this.__actions__); 3608 3609 actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); 3610 result.__chain__ = chainAll; 3611 return result; 3612 } 3613 return func.apply(object, arrayPush([this.value()], arguments)); 3614 }; 3615 } 3616 }); 3617 3618 return object; 3619 } 3620 3621 /** 3622 * Reverts the `_` variable to its previous value and returns a reference to 3623 * the `lodash` function. 3624 * 3625 * @static 3626 * @since 0.1.0 3627 * @memberOf _ 3628 * @category Util 3629 * @returns {Function} Returns the `lodash` function. 3630 * @example 3631 * 3632 * var lodash = _.noConflict(); 3633 */ 3634 function noConflict() { 3635 if (root._ === this) { 3636 root._ = oldDash; 3637 } 3638 return this; 3639 } 3640 3641 /** 3642 * This method returns `undefined`. 3643 * 3644 * @static 3645 * @memberOf _ 3646 * @since 2.3.0 3647 * @category Util 3648 * @example 3649 * 3650 * _.times(2, _.noop); 3651 * // => [undefined, undefined] 3652 */ 3653 function noop() { 3654 // No operation performed. 3655 } 3656 3657 /** 3658 * Generates a unique ID. If `prefix` is given, the ID is appended to it. 3659 * 3660 * @static 3661 * @since 0.1.0 3662 * @memberOf _ 3663 * @category Util 3664 * @param {string} [prefix=''] The value to prefix the ID with. 3665 * @returns {string} Returns the unique ID. 3666 * @example 3667 * 3668 * _.uniqueId('contact_'); 3669 * // => 'contact_104' 3670 * 3671 * _.uniqueId(); 3672 * // => '105' 3673 */ 3674 function uniqueId(prefix) { 3675 var id = ++idCounter; 3676 return toString(prefix) + id; 3677 } 3678 3679 /*------------------------------------------------------------------------*/ 3680 3681 /** 3682 * Computes the maximum value of `array`. If `array` is empty or falsey, 3683 * `undefined` is returned. 3684 * 3685 * @static 3686 * @since 0.1.0 3687 * @memberOf _ 3688 * @category Math 3689 * @param {Array} array The array to iterate over. 3690 * @returns {*} Returns the maximum value. 3691 * @example 3692 * 3693 * _.max([4, 2, 8, 6]); 3694 * // => 8 3695 * 3696 * _.max([]); 3697 * // => undefined 3698 */ 3699 function max(array) { 3700 return (array && array.length) 3701 ? baseExtremum(array, identity, baseGt) 3702 : undefined; 3703 } 3704 3705 /** 3706 * Computes the minimum value of `array`. If `array` is empty or falsey, 3707 * `undefined` is returned. 3708 * 3709 * @static 3710 * @since 0.1.0 3711 * @memberOf _ 3712 * @category Math 3713 * @param {Array} array The array to iterate over. 3714 * @returns {*} Returns the minimum value. 3715 * @example 3716 * 3717 * _.min([4, 2, 8, 6]); 3718 * // => 2 3719 * 3720 * _.min([]); 3721 * // => undefined 3722 */ 3723 function min(array) { 3724 return (array && array.length) 3725 ? baseExtremum(array, identity, baseLt) 3726 : undefined; 3727 } 3728 3729 /*------------------------------------------------------------------------*/ 3730 3731 // Add methods that return wrapped values in chain sequences. 3732 lodash.assignIn = assignIn; 3733 lodash.before = before; 3734 lodash.bind = bind; 3735 lodash.chain = chain; 3736 lodash.compact = compact; 3737 lodash.concat = concat; 3738 lodash.create = create; 3739 lodash.defaults = defaults; 3740 lodash.defer = defer; 3741 lodash.delay = delay; 3742 lodash.filter = filter; 3743 lodash.flatten = flatten; 3744 lodash.flattenDeep = flattenDeep; 3745 lodash.iteratee = iteratee; 3746 lodash.keys = keys; 3747 lodash.map = map; 3748 lodash.matches = matches; 3749 lodash.mixin = mixin; 3750 lodash.negate = negate; 3751 lodash.once = once; 3752 lodash.pick = pick; 3753 lodash.slice = slice; 3754 lodash.sortBy = sortBy; 3755 lodash.tap = tap; 3756 lodash.thru = thru; 3757 lodash.toArray = toArray; 3758 lodash.values = values; 3759 3760 // Add aliases. 3761 lodash.extend = assignIn; 3762 3763 // Add methods to `lodash.prototype`. 3764 mixin(lodash, lodash); 3765 3766 /*------------------------------------------------------------------------*/ 3767 3768 // Add methods that return unwrapped values in chain sequences. 3769 lodash.clone = clone; 3770 lodash.escape = escape; 3771 lodash.every = every; 3772 lodash.find = find; 3773 lodash.forEach = forEach; 3774 lodash.has = has; 3775 lodash.head = head; 3776 lodash.identity = identity; 3777 lodash.indexOf = indexOf; 3778 lodash.isArguments = isArguments; 3779 lodash.isArray = isArray; 3780 lodash.isBoolean = isBoolean; 3781 lodash.isDate = isDate; 3782 lodash.isEmpty = isEmpty; 3783 lodash.isEqual = isEqual; 3784 lodash.isFinite = isFinite; 3785 lodash.isFunction = isFunction; 3786 lodash.isNaN = isNaN; 3787 lodash.isNull = isNull; 3788 lodash.isNumber = isNumber; 3789 lodash.isObject = isObject; 3790 lodash.isRegExp = isRegExp; 3791 lodash.isString = isString; 3792 lodash.isUndefined = isUndefined; 3793 lodash.last = last; 3794 lodash.max = max; 3795 lodash.min = min; 3796 lodash.noConflict = noConflict; 3797 lodash.noop = noop; 3798 lodash.reduce = reduce; 3799 lodash.result = result; 3800 lodash.size = size; 3801 lodash.some = some; 3802 lodash.uniqueId = uniqueId; 3803 3804 // Add aliases. 3805 lodash.each = forEach; 3806 lodash.first = head; 3807 3808 mixin(lodash, (function() { 3809 var source = {}; 3810 baseForOwn(lodash, function(func, methodName) { 3811 if (!hasOwnProperty.call(lodash.prototype, methodName)) { 3812 source[methodName] = func; 3813 } 3814 }); 3815 return source; 3816 }()), { 'chain': false }); 3817 3818 /*------------------------------------------------------------------------*/ 3819 3820 /** 3821 * The semantic version number. 3822 * 3823 * @static 3824 * @memberOf _ 3825 * @type {string} 3826 */ 3827 lodash.VERSION = VERSION; 3828 3829 // Add `Array` methods to `lodash.prototype`. 3830 baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { 3831 var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], 3832 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', 3833 retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName); 3834 3835 lodash.prototype[methodName] = function() { 3836 var args = arguments; 3837 if (retUnwrapped && !this.__chain__) { 3838 var value = this.value(); 3839 return func.apply(isArray(value) ? value : [], args); 3840 } 3841 return this[chainName](function(value) { 3842 return func.apply(isArray(value) ? value : [], args); 3843 }); 3844 }; 3845 }); 3846 3847 // Add chain sequence methods to the `lodash` wrapper. 3848 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; 3849 3850 /*--------------------------------------------------------------------------*/ 3851 3852 // Some AMD build optimizers, like r.js, check for condition patterns like: 3853 if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { 3854 // Expose Lodash on the global object to prevent errors when Lodash is 3855 // loaded by a script tag in the presence of an AMD loader. 3856 // See http://requirejs.org/docs/errors.html#mismatch for more details. 3857 // Use `_.noConflict` to remove Lodash from the global object. 3858 root._ = lodash; 3859 3860 // Define as an anonymous module so, through path mapping, it can be 3861 // referenced as the "underscore" module. 3862 define(function() { 3863 return lodash; 3864 }); 3865 } 3866 // Check for `exports` after `define` in case a build optimizer adds it. 3867 else if (freeModule) { 3868 // Export for Node.js. 3869 (freeModule.exports = lodash)._ = lodash; 3870 // Export for CommonJS support. 3871 freeExports._ = lodash; 3872 } 3873 else { 3874 // Export to the global object. 3875 root._ = lodash; 3876 } 3877}.call(this));
3878/** 3879 * isMobile.js v0.4.0 3880 * 3881 * A simple library to detect Apple phones and tablets, 3882 * Android phones and tablets, other mobile devices (like blackberry, mini-opera and windows phone), 3883 * and any kind of seven inch device, via user agent sniffing. 3884 * 3885 * @author: Kai Mallea ([email protected]) 3886 * 3887 * @license: http://creativecommons.org/publicdomain/zero/1.0/ 3888 */ 3889(function (global) { 3890 3891 var apple_phone = /iPhone/i, 3892 apple_ipod = /iPod/i, 3893 apple_tablet = /iPad/i, 3894 android_phone = /(?=.*\bAndroid\b)(?=.*\bMobile\b)/i, // Match 'Android' AND 'Mobile' 3895 android_tablet = /Android/i, 3896 amazon_phone = /(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i, 3897 amazon_tablet = /(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i, 3898 windows_phone = /IEMobile/i, 3899 windows_tablet = /(?=.*\bWindows\b)(?=.*\bARM\b)/i, // Match 'Windows' AND 'ARM' 3900 other_blackberry = /BlackBerry/i, 3901 other_blackberry_10 = /BB10/i, 3902 other_opera = /Opera Mini/i, 3903 other_chrome = /(CriOS|Chrome)(?=.*\bMobile\b)/i, 3904 other_firefox = /(?=.*\bFirefox\b)(?=.*\bMobile\b)/i, // Match 'Firefox' AND 'Mobile' 3905 seven_inch = new RegExp( 3906 '(?:' + // Non-capturing group 3907 3908 'Nexus 7' + // Nexus 7 3909 3910 '|' + // OR 3911 3912 'BNTV250' + // B&N Nook Tablet 7 inch 3913 3914 '|' + // OR 3915 3916 'Kindle Fire' + // Kindle Fire 3917 3918 '|' + // OR 3919 3920 'Silk' + // Kindle Fire, Silk Accelerated 3921 3922 '|' + // OR 3923 3924 'GT-P1000' + // Galaxy Tab 7 inch 3925 3926 ')', // End non-capturing group 3927 3928 'i'); // Case-insensitive matching 3929 3930 var match = function(regex, userAgent) { 3931 return regex.test(userAgent); 3932 }; 3933 3934 var IsMobileClass = function(userAgent) { 3935 var ua = userAgent || navigator.userAgent; 3936 3937 // Facebook mobile app's integrated browser adds a bunch of strings that 3938 // match everything. Strip it out if it exists. 3939 var tmp = ua.split('[FBAN'); 3940 if (typeof tmp[1] !== 'undefined') { 3941 ua = tmp[0]; 3942 } 3943 3944 // Twitter mobile app's integrated browser on iPad adds a "Twitter for 3945 // iPhone" string. Same probable happens on other tablet platforms. 3946 // This will confuse detection so strip it out if it exists. 3947 tmp = ua.split('Twitter'); 3948 if (typeof tmp[1] !== 'undefined') { 3949 ua = tmp[0]; 3950 } 3951 3952 this.apple = { 3953 phone: match(apple_phone, ua), 3954 ipod: match(apple_ipod, ua), 3955 tablet: !match(apple_phone, ua) && match(apple_tablet, ua), 3956 device: match(apple_phone, ua) || match(apple_ipod, ua) || match(apple_tablet, ua) 3957 }; 3958 this.amazon = { 3959 phone: match(amazon_phone, ua), 3960 tablet: !match(amazon_phone, ua) && match(amazon_tablet, ua), 3961 device: match(amazon_phone, ua) || match(amazon_tablet, ua) 3962 }; 3963 this.android = { 3964 phone: match(amazon_phone, ua) || match(android_phone, ua), 3965 tablet: !match(amazon_phone, ua) && !match(android_phone, ua) && (match(amazon_tablet, ua) || match(android_tablet, ua)), 3966 device: match(amazon_phone, ua) || match(amazon_tablet, ua) || match(android_phone, ua) || match(android_tablet, ua) 3967 }; 3968 this.windows = { 3969 phone: match(windows_phone, ua), 3970 tablet: match(windows_tablet, ua), 3971 device: match(windows_phone, ua) || match(windows_tablet, ua) 3972 }; 3973 this.other = { 3974 blackberry: match(other_blackberry, ua), 3975 blackberry10: match(other_blackberry_10, ua), 3976 opera: match(other_opera, ua), 3977 firefox: match(other_firefox, ua), 3978 chrome: match(other_chrome, ua), 3979 device: match(other_blackberry, ua) || match(other_blackberry_10, ua) || match(other_opera, ua) || match(other_firefox, ua) || match(other_chrome, ua) 3980 }; 3981 this.seven_inch = match(seven_inch, ua); 3982 this.any = this.apple.device || this.android.device || this.windows.device || this.other.device || this.seven_inch; 3983 3984 // excludes 'other' devices and ipods, targeting touchscreen phones 3985 this.phone = this.apple.phone || this.android.phone || this.windows.phone; 3986 3987 // excludes 7 inch devices, classifying as phone or tablet is left to the user 3988 this.tablet = this.apple.tablet || this.android.tablet || this.windows.tablet; 3989 3990 if (typeof window === 'undefined') { 3991 return this; 3992 } 3993 }; 3994 3995 var instantiate = function() { 3996 var IM = new IsMobileClass(); 3997 IM.Class = IsMobileClass; 3998 return IM; 3999 }; 4000 4001 if (typeof module !== 'undefined' && module.exports && typeof window === 'undefined') { 4002 //node 4003 module.exports = IsMobileClass; 4004 } else if (typeof module !== 'undefined' && module.exports && typeof window !== 'undefined') { 4005 //browserify 4006 module.exports = instantiate(); 4007 } else if (typeof define === 'function' && define.amd) { 4008 //AMD 4009 define('isMobile', [], global.isMobile = instantiate()); 4010 } else { 4011 global.isMobile = instantiate(); 4012 } 4013 4014})(this); 4015 4016/*! jquery.livequery - v1.3.6 - 2013-08-26 4017 * Copyright (c) 4018 * (c) 2010, Brandon Aaron (http://brandonaaron.net) 4019 * (c) 2012 - 2013, Alexander Zaytsev (http://hazzik.ru/en) 4020 * Dual licensed under the MIT (MIT_LICENSE.txt) 4021 * and GPL Version 2 (GPL_LICENSE.txt) licenses. 4022 */ 4023!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a,b){function c(a,b,c,d){return!(a.selector!=b.selector||a.context!=b.context||c&&c.$lqguid!=b.fn.$lqguid||d&&d.$lqguid!=b.fn2.$lqguid)}a.extend(a.fn,{livequery:function(b,e){var f,g=this;return a.each(d.queries,function(a,d){return c(g,d,b,e)?(f=d)&&!1:void 0}),f=f||new d(g.selector,g.context,b,e),f.stopped=!1,f.run(),g},expire:function(b,e){var f=this;return a.each(d.queries,function(a,g){c(f,g,b,e)&&!f.stopped&&d.stop(g.id)}),f}});var d=a.livequery=function(b,c,e,f){var g=this;return g.selector=b,g.context=c,g.fn=e,g.fn2=f,g.elements=a([]),g.stopped=!1,g.id=d.queries.push(g)-1,e.$lqguid=e.$lqguid||d.guid++,f&&(f.$lqguid=f.$lqguid||d.guid++),g};d.prototype={stop:function(){var b=this;b.stopped||(b.fn2&&b.elements.each(b.fn2),b.elements=a([]),b.stopped=!0)},run:function(){var b=this;if(!b.stopped){var c=b.elements,d=a(b.selector,b.context),e=d.not(c),f=c.not(d);b.elements=d,e.each(b.fn),b.fn2&&f.each(b.fn2)}}},a.extend(d,{guid:0,queries:[],queue:[],running:!1,timeout:null,registered:[],checkQueue:function(){if(d.running&&d.queue.length)for(var a=d.queue.length;a--;)d.queries[d.queue.shift()].run()},pause:function(){d.running=!1},play:function(){d.running=!0,d.run()},registerPlugin:function(){a.each(arguments,function(b,c){if(a.fn[c]&&!(a.inArray(c,d.registered)>0)){var e=a.fn[c];a.fn[c]=function(){var a=e.apply(this,arguments);return d.run(),a},d.registered.push(c)}})},run:function(c){c!==b?a.inArray(c,d.queue)<0&&d.queue.push(c):a.each(d.queries,function(b){a.inArray(b,d.queue)<0&&d.queue.push(b)}),d.timeout&&clearTimeout(d.timeout),d.timeout=setTimeout(d.checkQueue,20)},stop:function(c){c!==b?d.queries[c].stop():a.each(d.queries,d.prototype.stop)}}
4023),d.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove","html","prop","removeProp"),a(function(){d.play()})}); 4024/*! 4025 * jquery.confirm 4026 * 4027 * @version 2.3.1 4028 * 4029 * @author My C-Labs 4030 * @author Matthieu Napoli <[email protected]> 4031 * @author Russel Vela 4032 * @author Marcus Schwarz <[email protected]> 4033 * 4034 * @license MIT 4035 * @url https://myclabs.github.io/jquery.confirm/ 4036 */ 4037(function(a){a.fn.confirm=function(b){if(typeof b==="undefined"){b={}}this.click(function(c){c.preventDefault();var d=a.extend({button:a(this)},b);a.confirm(d,c)});return this};a.confirm=function(f,i){if(a(".confirmation-modal").length>0){return}var j={};if(f.button){var b={title:"title",text:"text","confirm-button":"confirmButton","submit-form":"submitForm","cancel-button":"cancelButton","confirm-button-class":"confirmButtonClass","cancel-button-class":"cancelButtonClass","dialog-class":"dialogClass"};a.each(b,function(e,k){var l=f.button.data(e);if(l){j[k]=l}})}var g=a.extend({},a.confirm.options,{confirm:function(){if(j.submitForm){i.target.closest("form").submit()}
4037else{var e=i&&(("string"===typeof i&&i)||(i.currentTarget&&i.currentTarget.attributes.href.value));if(e){if(f.post){var k=a('<form method="post" class="hide" action="'+e+'"></form>');a("body").append(k);k.submit()}else{window.location=e}}}},cancel:function(e){},button:null},j,f);var c="";if(g.title!==""){c='<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h4 class="modal-title">'+g.title+"</h4></div>"}var d='<div class="confirmation-modal modal fade" tabindex="-1" role="dialog"><div class="'+g.dialogClass+'"><div class="modal-content">'+c+'<div class="modal-body">'+g.text+'</div><div class="modal-footer"><button class="confirm btn '+g.confirmButtonClass+'" type="button" data-dismiss="modal">'+g.confirmButton+'</button><button class="cancel btn '+g.cancelButtonClass+'" type="button" data-dismiss="modal">'+g.cancelButton+"</button></div></div></div></div>";var h=a(d);h.on("shown.bs.modal",function(){h.find(".btn-primary:first").focus()});h.on("hidden.bs.modal",function(){h.remove()});h.find(".confirm").click(function(){g.confirm(g.button)});h.find(".cancel").click(function(){g.cancel(g.button)});a("body").append(h);h.modal("show")};a.confirm.options={text:"An error has occured. Please contact us.",title:"",confirmButton:"Yes",cancelButton:"Cancel",post:false,submitForm:false,confirmButtonClass:"btn-primary",cancelButtonClass:"btn-default",dialogClass:"modal-dialog"}})(jQuery); 4038/* 4039 Copyright (C) Federico Zivolo 2018 4040 Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). 4041 */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}
vendor: 8,562 bytes, line 4041
4041function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function r(e){return 11===e?pe:10===e?se:pe||se}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',n=e.nodeName;if('BODY'===n||'HTML'===n){var i=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||i;return r[o]}return e[o]}function f(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=l(t,'top'),i=l(t,'left'),r=o?-1:1;return e.top+=n*r,e.bottom+=n*r,e.left+=i*r,e.right+=i*r,e}function m(e,t){var o='x'===t?'Left':'Top',n='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'],10)+parseFloat(e['border'+n+'Width'],10)}function h(e,t,o,n){return ee(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],r(10)?parseInt(o['offset'+e])+parseInt(n['margin'+('Height'===e?'Top':'Left')])+parseInt(n['margin'+('Height'===e?'Bottom':'Right')]):0)}function c(e){var t=e.body,o=e.documentElement,n=r(10)&&getComputedStyle(o);return{height:h('Height',t,o,n),width:h('Width',t,o,n)}}function g(e){return fe({},e,{right:e.left+e.width,bottom:e.top+e.height})}function u(e){var o={};try{if(r(10)){o=e.getBoundingClientRect();var n=l(e,'top'),i=l(e,'left');o.top+=n,o.left+=i,o.bottom+=n,o.right+=i}else o=e.getBoundingClientRect()}catch(t){}var p={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},s='HTML'===e.nodeName?c(e.ownerDocument):{},d=s.width||e.clientWidth||p.right-p.left,a=s.height||e.clientHeight||p.bottom-p.top,f=e.offsetWidth-d,h=e.offsetHeight-a;if(f||h){var u=t(e);f-=m(u,'x'),h-=m(u,'y'),p.width-=f,p.height-=h}return g(p)}function b(e,o){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],p=r(10),s='HTML'===o.nodeName,d=u(e),a=u(o),l=n(e),m=t(o),h=parseFloat(m.borderTopWidth,10),c=parseFloat(m.borderLeftWidth,10);i&&s&&(a.top=ee(a.top,0),a.left=ee(a.left,0));var b=g({top:d.top-a.top-h,left:d.left-a.left-c,width:d.width,height:d.height});if(b.marginTop=0,b.marginLeft=0,!p&&s){var w=parseFloat(m.marginTop,10),y=parseFloat(m.marginLeft,10);b.top-=h-w,b.bottom-=h-w,b.left-=c-y,b.right-=c-y,b.marginTop=w,b.marginLeft=y}return(p&&!i?o.contains(l):o===l&&'BODY'!==l.nodeName)&&(b=f(b,o)),b}function w(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=e.ownerDocument.documentElement,n=b(e,o),i=ee(o.clientWidth,window.innerWidth||0),r=ee(o.clientHeight,window.innerHeight||0),p=t?0:l(o),s=t?0:l(o,'left'),d={top:p-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r};return g(d)}function y(e){var n=e.nodeName;return'BODY'===n||'HTML'===n?!1:'fixed'===t(e,'position')||y(o(e))}function E(e){if(!e||!e.parentElement||r())return document.documentElement;for(var o=e.parentElement;o&&'none'===t(o,'transform');)o=o.parentElement;return o||document.documentElement}function v(e,t,i,r){var p=4<arguments.length&&void 0!==arguments[4]&&arguments[4],s={top:0,left:0},d=p?E(e):a(e,t);if('viewport'===r)s=w(d,p);else{var l;'scrollParent'===r?(l=n(o(t)),'BODY'===l.nodeName&&(l=e.ownerDocument.documentElement)):'window'===r?l=e.ownerDocument.documentElement:l=r;var f=b(l,d,p);if('HTML'===l.nodeName&&!y(d)){var m=c(e.ownerDocument),h=m.height,g=m.width;s.top+=f.top-f.marginTop,s.bottom=h+f.top,s.left+=f.left-f.marginLeft,s.right=g+f.left}else s=f}i=i||0;var u='number'==typeof i;return s.left+=u?i:i.left||0,s.top+=u?i:i.top||0,s.right-=u?i:i.right||0,s.bottom-=u?i:i.bottom||0,s}function x(e){var t=e.width,o=e.height;return t*o}function O(e,t,o,n,i){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var p=v(o,n,r,i),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return fe({key:e},s[e],{area:x(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,n=e.height;return t>=o.clientWidth&&n>=o.clientHeight}),l=0<a.length?a[0].key:d[0].key,f=e.split('-')[1];return l+(f?'-'+f:'')}function L(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,i=n?E(t):a(t,o);return b(o,i,n)}function S(e){var t=e.ownerDocument.defaultView,o=t.getComputedStyle(e),n=parseFloat(o.marginTop||0)+parseFloat(o.marginBottom||0),i=parseFloat(o.marginLeft||0)+parseFloat(o.marginRight||0),r={width:e.offsetWidth+i,height:e.offsetHeight+n};return r}function T(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function D(e,t,o){o=o.split('-')[0];var n=S(e),i={width:n.width,height:n.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',s=r?'left':'top',d=r?'height':'width',a=r?'width':'height';return i[p]=t[p]+t[d]/2-n[d]/2,i[s]=o===s?t[s]-n[a]:t[T(s)],i}function C(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function N(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var n=C(e,function(e){return e[t]===o});return e.indexOf(n)}function P(t,o,n){var i=void 0===n?t:t.slice(0,N(t,'name',n));return i.forEach(function(t){t['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var n=t['function']||t.fn;t.enabled&&e(n)&&(o.offsets.popper=g(o.offsets.popper),o.offsets.reference=g(o.offsets.reference),o=n(o,t))}),o}function k(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=O(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=D(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?'fixed':'absolute',e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var o=e.name,n=e.enabled;return n&&o===t})}function H(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof document.body.style[r])return r}return null}function B(){return this.state.isDestroyed=!0,W(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.position='',this.popper.style.top='',this.popper.style.left='',this.popper.style.right='',this.popper.style.bottom='',this.popper.style.willChange='',this.popper.style[H('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function A(e){var t=e.ownerDocument;return t?t.defaultView:window}function M(e,t,o,i){var r='BODY'===e.nodeName,p=r?e.ownerDocument.defaultView:e;p.addEventListener(t,o,{passive:!0}),r||M(n(p.parentNode),t,o,i),i.push(p)}function F(e,t,o,i){o.updateBound=i,A(e).addEventListener('resize',o.updateBound,{passive:!0});var r=n(e);return M(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function I(){this.state.eventsEnabled||(this.state=F(this.reference,this.options,this.state,this.scheduleUpdate))}function R(e,t){return A(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEac
4041h(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function U(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=R(this.reference,this.state))}function Y(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function j(e,t){Object.keys(t).forEach(function(o){var n='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&Y(t[o])&&(n='px'),e.style[o]=t[o]+n})}function V(e,t){Object.keys(t).forEach(function(o){var n=t[o];!1===n?e.removeAttribute(o):e.setAttribute(o,t[o])})}function q(e,t){var o=e.offsets,n=o.popper,i=o.reference,r=-1!==['left','right'].indexOf(e.placement),p=-1!==e.placement.indexOf('-'),s=i.width%2==n.width%2,d=1==i.width%2&&1==n.width%2,a=function(e){return e},l=t?r||p||s?$:Z:a,f=t?$:a;return{left:l(d&&!p&&t?n.left-1:n.left),top:f(n.top),bottom:f(n.bottom),right:l
vendor: 10,946 bytes, line 4041
4041(n.right)}}function K(e,t,o){var n=C(e,function(e){var o=e.name;return o===t}),i=!!n&&e.some(function(e){return e.name===o&&e.enabled&&e.order<n.order});if(!i){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return i}function z(e){return'end'===e?'start':'start'===e?'end':e}function G(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=ce.indexOf(e),n=ce.slice(o+1).concat(ce.slice(0,o));return t?n.reverse():n}function _(e,t,o,n){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+i[1],p=i[2];if(!r)return e;if(0===p.indexOf('%')){var s;switch(p){case'%p':s=o;break;case'%':case'%r':default:s=n;}var d=g(s);return d[t]/100*r}if('vh'===p||'vw'===p){var a;return a='vh'===p?ee(document.documentElement.clientHeight,window.innerHeight||0):ee(document.documentElement.clientWidth,window.innerWidth||0),a/100*r}return r}function X(e,t,o,n){var i=[0,0],r=-1!==['right','left'].indexOf(n),p=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=p.indexOf(C(p,function(e){return-1!==e.search(/,|\s/)}));p[s]&&-1===p[s].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var d=/\s*,\s*|\s+/,a=-1===s?[p]:[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))];return a=a.map(function(e,n){var i=(1===n?!r:r)?'height':'width',p=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t)},[]).map(function(e){return _(e,i,t,o)})}),a.forEach(function(e,t){e.forEach(function(o,n){Y(o)&&(i[t]+=o*('-'===e[n-1]?-1:1))})}),i}function J(e,t){var o,n=t.offset,i=e.placement,r=e.offsets,p=r.popper,s=r.reference,d=i.split('-')[0];return o=Y(+n)?[+n,0]:X(n,p,s,d),'left'===d?(p.top+=o[0],p.left-=o[1]):'right'===d?(p.top+=o[0],p.left+=o[1]):'top'===d?(p.left+=o[0],p.top-=o[1]):'bottom'===d&&(p.left+=o[0],p.top+=o[1]),e.popper=p,e}for(var Q=Math.min,Z=Math.floor,$=Math.round,ee=Math.max,te='undefined'!=typeof window&&'undefined'!=typeof document,oe=['Edge','Trident','Firefox'],ne=0,ie=0;ie<oe.length;ie+=1)if(te&&0<=navigator.userAgent.indexOf(oe[ie])){ne=1;break}var i=te&&window.Promise,re=i?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},ne))}},pe=te&&!!(window.MSInputMethodContext&&document.documentMode),se=te&&/MSIE 10/.test(navigator.userAgent),de=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},ae=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),le=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},fe=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},me=te&&/Firefox/i.test(navigator.userAgent),he=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],ce=he.slice(3),ge={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},ue=function(){function t(o,n){var i=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};de(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=re(this.update.bind(this)),this.options=fe({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=o&&o.jquery?o[0]:o,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(fe({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=fe({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return fe({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var p=this.options.eventsEnabled;p&&this.enableEventListeners(),this.state.eventsEnabled=p}return ae(t,[{key:'update',value:function(){return k.call(this)}},{key:'destroy',value:function(){return B.call(this)}},{key:'enableEventListeners',value:function(){return I.call(this)}},{key:'disableEventListeners',value:function(){return U.call(this)}}]),t}();return ue.Utils=('undefined'==typeof window?global:window).PopperUtils,ue.placements=he,ue.Defaults={placement:'bottom',positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],n=t.split('-')[1];if(n){var i=e.offsets,r=i.reference,p=i.popper,s=-1!==['bottom','top'].indexOf(o),d=s?'left':'top',a=s?'width':'height',l={start:le({},d,r[d]),end:le({},d,r[d]+r[a]-p[a])};e.offsets.popper=fe({},p,l[n])}return e}},offset:{order:200,enabled:!0,fn:J,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||p(e.instance.popper);e.instance.reference===o&&(o=p(o));var n=H('transform'),i=e.instance.popper.style,r=i.top,s=i.left,d=i[n];i.top='',i.left='',i[n]='';var a=v(e.instance.popper,e.instance.reference,t.padding,o,e.positionFixed);i.top=r,i.left=s,i[n]=d,t.boundaries=a;var l=t.priority,f=e.offsets.popper,m={primary:function(e){var o=f[e];return f[e]<a[e]&&!t.escapeWithReference&&(o=ee(f[e],a[e])),le({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=f[o];return f[e]>a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),le({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=fe({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]<r(n[d])&&(e.offsets.popper[d]=r(n[d])-o[a]),o[d]>r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-u<s[m]&&(e.offsets.popper[m]-=s[m]-(d[c]-u)),d[m]+u>s[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f],10),E=parseFloat(w['border'+f+'Width'],10),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},le(n,m,$(v)),le(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ge.FLIP:p=[n,i];break;case ge.CLOCKWISE:p=G(n);break;case ge.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)<f(l.right)||'top'===n&&f(a.bottom)>f(l.top)||'bottom'===n&&f(a.top)<f(l.bottom),h=f(a.left)<f(o.left),c=f(a.right)>f(o.right),g=f(a.top)<f(o.top),u=f(a.bottom)>f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u);(m||b||y)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),y&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=fe({},e.offsets.popper,D(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=C(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,n=t.y,i=e.offsets.popper,r=C(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,d,a=void 0===r?t.gpuAcceleration:r,l=p(e.instance.popper),f=u(l),m={position:i.position},h=q(e,2>window.devicePixelRatio||!me),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=H('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={"x-placement":e.placement};return e.attributes=fe({},E,e.attributes),e.styles=fe({},m,e.styles),e.arrowStyles=fe({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return j(e.instance.popper,e.styles),V(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&j(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),j(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ue});
4041 4042/*! 4043 * Bootstrap v4.3.1 (https://getbootstrap.com/) 4044 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4045 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 4046 */ 4047!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(t){var e,n,i;e=o,i=r[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return o}g=g&&g.hasOwnProperty("default")?g.default:g,u=u&&u.hasOwnProperty("default")?u.default:u;var e="transitionend";function n(t){var e=this,n=!1;return g(this).one(_.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||_.triggerTransitionEnd(e)},t),this}var _={TRANSITION_END:"bsTransitionEnd",getUID:function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=g(t).css("transition-duration"),n=g(t).css("transition-delay"),i=parseFloat(e),o=parseFloat(n);return i||o?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){g(t).trigger(e)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&_.isElement(r)?"element":(a=r,{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"!=typeof t.getRootNode)return t instanceof ShadowRoot?t:t.parentNode?_.findShadowRoot(t.parentNode):null;var e=t.getRootNode();return e instanceof ShadowRoot?e:null}};g.fn.emulateTransitionEnd=n,g.event.special[_.TRANSITION_END]={bindType:e,delegateType:e,handle:function(t){if(g(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var o="alert",r="bs.alert",a="."+r,c=g.fn[o],h={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+".data-api"},f="alert",d="fade",m="show",p=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},t.dispose=function(){g.removeData(this._element,r),this._element=null},t._getRootElement=function(t){var e=_.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=g(t).closest("."+f)[0]),n},t._triggerCloseEvent=function(t){var e=g.Event(h.CLOSE);return g(t).trigger(e),e},t._removeElement=function(e){var n=this;if(g(e).removeClass(m),g(e).hasClass(d)){var t=_.getTransitionDurationFromElement(e);g(e).one(_.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function(t){g(t).detach().trigger(h.CLOSED).remove()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(r);e||(e=new i(this),t.data(r,e)),"close"===n&&e[n](this)})},i._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();
4047g(document).on(h.CLICK_DATA_API,'[data-dismiss="alert"]',p._handleDismiss(new p)),g.fn[o]=p._jQueryInterface,g.fn[o].Constructor=p,g.fn[o].noConflict=function(){return g.fn[o]=c,p._jQueryInterface};var v="button",y="bs.button",E="."+y,C=".data-api",T=g.fn[v],S="active",b="btn",I="focus",D='[data-toggle^="button"]',w='[data-toggle="buttons"]',A='input:not([type="hidden"])',N=".active",O=".btn",k={CLICK_DATA_API:"click"+E+C,FOCUS_BLUR_DATA_API:"focus"+E+C+" blur"+E+C},P=function(){function n(t){this._element=t}var t=n.prototype;return t.toggle=function(){var t=!0,e=!0,n=g(this._element).closest(w)[0];if(n){var i=this._element.querySelector(A);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(S))t=!1;else{var o=n.querySelector(N);o&&g(o).removeClass(S)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!this._element.classList.contains(S),g(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(S)),t&&g(this._element).toggleClass(S)},t.dispose=function(){g.removeData(this._element,y),this._element=null},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(y);t||(t=new n(this),g(this).data(y,t)),"toggle"===e&&t[e]()})},s(n,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),n}();g(document).on(k.CLICK_DATA_API,D,function(t){t.preventDefault();var e=t.target;g(e).hasClass(b)||(e=g(e).closest(O)),P._jQueryInterface.call(g(e),"toggle")}).on(k.FOCUS_BLUR_DATA_API,D,function(t){var e=g(t.target).closest(O)[0];g(e).toggleClass(I,/^focus(in)?$/.test(t.type))}),g.fn[v]=P._jQueryInterface,g.fn[v].Constructor=P,g.fn[v].noConflict=function(){return g.fn[v]=T,P._jQueryInterface};var L="carousel",j="bs.carousel",H="."+j,R=".data-api",x=g.fn[L],F={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},U={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},W="next",q="prev",M="left",K="right",Q={SLIDE:"slide"+H,SLID:"slid"+H,KEYDOWN:"keydown"+H,MOUSEENTER:"mouseenter"+H,MOUSELEAVE:"mouseleave"+H,TOUCHSTART:"touchstart"+H,TOUCHMOVE:"touchmove"+H,TOUCHEND:"touchend"+H,POINTERDOWN:"pointerdown"+H,POINTERUP:"pointerup"+H,DRAG_START:"dragstart"+H,LOAD_DATA_API:"load"+H+R,CLICK_DATA_API:"click"+H+R},B="carousel",V="active",Y="slide",z="carousel-item-right",X="carousel-item-left",$="carousel-item-next",G="carousel-item-prev",J="pointer-event",Z=".active",tt=".active.carousel-item",et=".carousel-item",nt=".carousel-item img",it=".carousel-item-next, .carousel-item-prev",ot=".carousel-indicators",rt="[data-slide], [data-slide-to]",st='[data-ride="carousel"]',at={TOUCH:"touch",PEN:"pen"},lt=function(){function r(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(ot),this._touchSupported="ontouchstart"in document.documentElement||0<navigator.maxTouchPoints,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var t=r.prototype;return t.next=function(){this._isSliding||this._slide(W)},t.nextWhenVisible=function(){!document.hidden&&g(this._element).is(":visible")&&"hidden"!==g(this._element).css("visibility")&&this.next()},t.prev=function(){this._isSliding||this._slide(q)},t.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(it)&&(_.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},t.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},t.to=function(t){var e=this;this._activeElement=this._element.querySelector(tt);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=n<t?W:q;this._slide(i,this._items[t])}},t.dispose=function(){g(this._element).off(H),g.removeData(this._element,j),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},t._getConfig=function(t){return t=l({},F,t),_.typeCheckConfig(L,t,U),t},t._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;0<e&&this.prev(),e<0&&this.next()}},t._addEventListeners=function(){var e=this;this._config.keyboard&&g(this._element).on(Q.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&g(this._element).on(Q.MOUSEENTER,function(t){return e.pause(t)}).on(Q.MOUSELEAVE,function(t){return e.cycle(t)}),this._config.touch&&this._addTouchEventListeners()},t._addTouchEventListeners=function(){var n=this;if(this._touchSupported){var e=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]?n.touchStartX=t.originalEvent.clientX:n._pointerEvent||(n.touchStartX=t.originalEvent.touches[0].clientX)},i=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]&&(n.touchDeltaX=t.originalEvent.clientX-n.touchStartX),n._handleSwipe(),"hover"===n._config.pause&&(n.pause(),n.touchTimeout&&clearTimeout(n.touchTimeout),n.touchTimeout=setTimeout(function(t){return n.cycle(t)},500+n._config.interval))};g(this._element.querySelectorAll(nt)).on(Q.DRAG_START,function(t){return t.preventDefault()}),this._pointerEvent?(g(this._element).on(Q.POINTERDOWN,function(t){return e(t)}),g(this._element).on(Q.POINTERUP,function(t){return i(t)}),this._element.classList.add(J)):(g(this._element).on(Q.TOUCHSTART,function(t){return e(t)}),g(this._element).on(Q.TOUCHMOVE,function(t){var e;(e=t).originalEvent.touches&&1<e.originalEvent.touches.length?n.touchDeltaX=0:n.touchDeltaX=e.originalEvent.touches[0].clientX-n.touchStartX}),g(this._element).on(Q.TOUCHEND,function(t){return i(t)}))}},t._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},t._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(et)):[],this._items.indexOf(t)},t._getItemByDirection=function(t,e){var n=t===W,i=t===q,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+(t===q?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},t._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(this._element.querySelector(tt)),o=g.Event(Q.SLIDE,{relatedTarget:t,direction:e,from:i,to:n});return g(this._element).trigger(o),o},t._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(Z));g(e).removeClass(V);var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&g(n).addClass(V)}},t._slide=function(t,e){var n,i,o,r=this,s=this._element.querySelector(tt),a=this._getItemIndex(s),l=e||s&&this._getItemByDirection(t,s),c=this._getItemIndex(l),h=Boolean(this._interval);if(o=t===W?(n=X,i=$,M):(n=z,i=G,K),l&&g(l).hasClass(V))this._isSliding=!1;else if(!this._triggerSlideEvent(l,o).isDefaultPrevented()&&s&&l){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(l);var u=g.Event(Q.SLID,{relatedTarget:l,direction:o,from:a,to:c});if(g(this._element).hasClass(Y)){g(l).addClass(i),_.reflow(l),g(s).addClass(n),g(l).addClass(n);var f=parseInt(l.getAttribute("data-interval"),10);this._config.interval=f?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,f):this._config.defaultInterval||this._config.interval;var d=_.getTransitionDurationFromElement(s);g(s).one(_.TRANSITION_END,function(){g(l).removeClass(n+" "+i).addClass(V),g(s).removeClass(V+" "+i+" "+n),r._isSliding=!1,setTimeout(function(){return g(r._element).trigger(u)},0)}).emulateTransitionEnd(d)}else g(s).removeClass(V),g(l).addClass(V),this._isSliding=!1,g(this._element).trigger(u);h&&this.cycle()}},r._jQueryInterface=function(i){return this.each(function(){var t=g(this).data(j),e=l({},F,g(this).data());"object"==typeof i&&(e=l({},e,i));var n="string"==typeof i?i:e.slide;if(t||(t=new r(this,e),g(this).data(j,t)),"number"==typeof i)t.to(i);else if("string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method n
4047amed "'+n+'"');t[n]()}else e.interval&&e.ride&&(t.pause(),t.cycle())})},r._dataApiClickHandler=function(t){var e=_.getSelectorFromElement(this);if(e){var n=g(e)[0];if(n&&g(n).hasClass(B)){var i=l({},g(n).data(),g(this).data()),o=this.getAttribute("data-slide-to");o&&(i.interval=!1),r._jQueryInterface.call(g(n),i),o&&g(n).data(j).to(o),t.preventDefault()}}},s(r,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return F}}]),r}();g(document).on(Q.CLICK_DATA_API,rt,lt._dataApiClickHandler),g(window).on(Q.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(st)),e=0,n=t.length;e<n;e++){var i=g(t[e]);lt._jQueryInterface.call(i,i.data())}}),g.fn[L]=lt._jQueryInterface,g.fn[L].Constructor=lt,g.fn[L].noConflict=function(){return g.fn[L]=x,lt._jQueryInterface};var ct="collapse",ht="bs.collapse",ut="."+ht,ft=g.fn[ct],dt={toggle:!0,parent:""},gt={toggle:"boolean",parent:"(string|element)"},_t={SHOW:"show"+ut,SHOWN:"shown"+ut,HIDE:"hide"+ut,HIDDEN:"hidden"+ut,CLICK_DATA_API:"click"+ut+".data-api"},mt="show",pt="collapse",vt="collapsing",yt="collapsed",Et="width",Ct="height",Tt=".show, .collapsing",St='[data-toggle="collapse"]',bt=function(){function a(e,t){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(t),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var n=[].slice.call(document.querySelectorAll(St)),i=0,o=n.length;i<o;i++){var r=n[i],s=_.getSelectorFromElement(r),a=[].slice.call(document.querySelectorAll(s)).filter(function(t){return t===e});null!==s&&0<a.length&&(this._selector=s,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var t=a.prototype;return t.toggle=function(){g(this._element).hasClass(mt)?this.hide():this.show()},t.show=function(){var t,e,n=this;if(!this._isTransitioning&&!g(this._element).hasClass(mt)&&(this._parent&&0===(t=[].slice.call(this._parent.querySelectorAll(Tt)).filter(function(t){return"string"==typeof n._config.parent?t.getAttribute("data-parent")===n._config.parent:t.classList.contains(pt)})).length&&(t=null),!(t&&(e=g(t).not(this._selector).data(ht))&&e._isTransitioning))){var i=g.Event(_t.SHOW);if(g(this._element).trigger(i),!i.isDefaultPrevented()){t&&(a._jQueryInterface.call(g(t).not(this._selector),"hide"),e||g(t).data(ht,null));var o=this._getDimension();g(this._element).removeClass(pt).addClass(vt),this._element.style[o]=0,this._triggerArray.length&&g(this._triggerArray).removeClass(yt).attr("aria-expanded",!0),this.setTransitioning(!0);var r="scroll"+(o[0].toUpperCase()+o.slice(1)),s=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){g(n._element).removeClass(vt).addClass(pt).addClass(mt),n._element.style[o]="",n.setTransitioning(!1),g(n._element).trigger(_t.SHOWN)}).emulateTransitionEnd(s),this._element.style[o]=this._element[r]+"px"}}},t.hide=function(){var t=this;if(!this._isTransitioning&&g(this._element).hasClass(mt)){var e=g.Event(_t.HIDE);if(g(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",_.reflow(this._element),g(this._element).addClass(vt).removeClass(pt).removeClass(mt);var i=this._triggerArray.length;if(0<i)for(var o=0;o<i;o++){var r=this._triggerArray[o],s=_.getSelectorFromElement(r);if(null!==s)g([].slice.call(document.querySelectorAll(s))).hasClass(mt)||g(r).addClass(yt).attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[n]="";var a=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){t.setTransitioning(!1),g(t._element).removeClass(vt).addClass(pt).trigger(_t.HIDDEN)}).emulateTransitionEnd(a)}}},t.setTransitioning=function(t){this._isTransitioning=t},t.dispose=function(){g.removeData(this._element,ht),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},t._getConfig=function(t){return(t=l({},dt,t)).toggle=Boolean(t.toggle),_.typeCheckConfig(ct,t,gt),t},t._getDimension=function(){return g(this._element).hasClass(Et)?Et:Ct},t._getParent=function(){var t,n=this;_.isElement(this._config.parent)?(t=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(t=this._config.parent[0])):t=document.querySelector(this._config.parent);var e='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',i=[].slice.call(t.querySelectorAll(e));return g(i).each(function(t,e){n._addAriaAndCollapsedClass(a._getTargetFromElement(e),[e])}),t},t._addAriaAndCollapsedClass=function(t,e){var n=g(t).hasClass(mt);e.length&&g(e).toggleClass(yt,!n).attr("aria-expanded",n)},a._getTargetFromElement=function(t){var e=_.getSelectorFromElement(t);return e?document.querySelector(e):null},a._jQueryInterface=function(i){return this.each(function(){var t=g(this),e=t.data(ht),n=l({},dt,t.data(),"object"==typeof i&&i?i:{});if(!e&&n.toggle&&/show|hide/.test(i)&&(n.toggle=!1),e||(e=new a(this,n),t.data(ht,e)),"string"==typeof i){if("undefined"==typeof e[i])throw new TypeError('No method n
4047amed "'+i+'"');e[i]()}})},s(a,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return dt}}]),a}();g(document).on(_t.CLICK_DATA_API,St,function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=g(this),e=_.getSelectorFromElement(this),i=[].slice.call(document.querySelectorAll(e));g(i).each(function(){var t=g(this),e=t.data(ht)?"toggle":n.data();bt._jQueryInterface.call(t,e)})}),g.fn[ct]=bt._jQueryInterface,g.fn[ct].Constructor=bt,g.fn[ct].noConflict=function(){return g.fn[ct]=ft,bt._jQueryInterface};var It="dropdown",Dt="bs.dropdown",wt="."+Dt,At=".data-api",Nt=g.fn[It],Ot=new RegExp("38|40|27"),kt={HIDE:"hide"+wt,HIDDEN:"hidden"+wt,SHOW:"show"+wt,SHOWN:"shown"+wt,CLICK:"click"+wt,CLICK_DATA_API:"click"+wt+At,KEYDOWN_DATA_API:"keydown"+wt+At,KEYUP_DATA_API:"keyup"+wt+At},Pt="disabled",Lt="show",jt="dropup",Ht="dropright",Rt="dropleft",xt="dropdown-menu-right",Ft="position-static",Ut='[data-toggle="dropdown"]',Wt=".dropdown form",qt=".dropdown-menu",Mt=".navbar-nav",Kt=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Qt="top-start",Bt="top-end",Vt="bottom-start",Yt="bottom-end",zt="right-start",Xt="left-start",$t={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic"},Gt={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string"},Jt=function(){function c(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var t=c.prototype;return t.toggle=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)){var t=c._getParentFromElement(this._element),e=g(this._menu).hasClass(Lt);if(c._clearMenus(),!e){var n={relatedTarget:this._element},i=g.Event(kt.SHOW,n);if(g(t).trigger(i),!i.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof u)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var o=this._element;"parent"===this._config.reference?o=t:_.isElement(this._config.reference)&&(o=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(o=this._config.reference[0])),"scrollParent"!==this._config.boundary&&g(t).addClass(Ft),this._popper=new u(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===g(t).closest(Mt).length&&g(document.body).children().on("mouseover",null,g.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),g(this._menu).toggleClass(Lt),g(t).toggleClass(Lt).trigger(g.Event(kt.SHOWN,n))}}}},t.show=function(){if(!(this._element.disabled||g(this._element).hasClass(Pt)||g(this._menu).hasClass(Lt))){var t={relatedTarget:this._element},e=g.Event(kt.SHOW,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.SHOWN,t)))}},t.hide=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)&&g(this._menu).hasClass(Lt)){var t={relatedTarget:this._element},e=g.Event(kt.HIDE,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.HIDDEN,t)))}},t.dispose=function(){g.removeData(this._element,Dt),g(this._element).off(wt),this._element=null,(this._menu=null)!==this._popper&&(this._popper.destroy(),this._popper=null)},t.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},t._addEventListeners=function(){var e=this;g(this._element).on(kt.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},t._getConfig=function(t){return t=l({},this.constructor.Default,g(this._element).data(),t),_.typeCheckConfig(It,t,this.constructor.DefaultType),t},t._getMenuElement=function(){if(!this._menu){var t=c._getParentFromElement(this._element);t&&(this._menu=t.querySelector(qt))}return this._menu},t._getPlacement=function(){var t=g(this._element.parentNode),e=Vt;return t.hasClass(jt)?(e=Qt,g(this._menu).hasClass(xt)&&(e=Bt)):t.hasClass(Ht)?e=zt:t.hasClass(Rt)?e=Xt:g(this._menu).hasClass(xt)&&(e=Yt),e},t._detectNavbar=function(){return 0<g(this._element).closest(".
4047navbar").length},t._getOffset=function(){var e=this,t={};return"function"==typeof this._config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e._config.offset(t.offsets,e._element)||{}),t}:t.offset=this._config.offset,t},t._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),t},c._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(Dt);if(t||(t=new c(this,"object"==typeof e?e:null),g(this).data(Dt,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},c._clearMenus=function(t){if(!t||3!==t.which&&("keyup"!==t.type||9===t.which))for(var e=[].slice.call(document.querySelectorAll(Ut)),n=0,i=e.length;n<i;n++){var o=c._getParentFromElement(e[n]),r=g(e[n]).data(Dt),s={relatedTarget:e[n]};if(t&&"click"===t.type&&(s.clickEvent=t),r){var a=r._menu;if(g(o).hasClass(Lt)&&!(t&&("click"===t.type&&/input|textarea/i.test(t.target.tagName)||"keyup"===t.type&&9===t.which)&&g.contains(o,t.target))){var l=g.Event(kt.HIDE,s);g(o).trigger(l),l.isDefaultPrevented()||("ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),e[n].setAttribute("aria-expanded","false"),g(a).removeClass(Lt),g(o).removeClass(Lt).trigger(g.Event(kt.HIDDEN,s)))}}}},c._getParentFromElement=function(t){var e,n=_.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},c._dataApiKeydownHandler=function(t){if((/input|textarea/i.test(t.target.tagName)?!(32===t.which||27!==t.which&&(40!==t.which&&38!==t.which||g(t.target).closest(qt).length)):Ot.test(t.which))&&(t.preventDefault(),t.stopPropagation(),!this.disabled&&!g(this).hasClass(Pt))){var e=c._getParentFromElement(this),n=g(e).hasClass(Lt);if(n&&(!n||27!==t.which&&32!==t.which)){var i=[].slice.call(e.querySelectorAll(Kt));if(0!==i.length){var o=i.indexOf(t.target);38===t.which&&0<o&&o--,40===t.which&&o<i.length-1&&o++,o<0&&(o=0),i[o].focus()}}else{if(27===t.which){var r=e.querySelector(Ut);g(r).trigger("focus")}g(this).trigger("click")}}},s(c,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return $t}},{key:"DefaultType",get:function(){return Gt}}]),c}();g(document).on(kt.KEYDOWN_DATA_API,Ut,Jt._dataApiKeydownHandler).on(kt.KEYDOWN_DATA_API,qt,Jt._dataApiKeydownHandler).on(kt.CLICK_DATA_API+" "+kt.KEYUP_DATA_API,Jt._clearMenus).on(kt.CLICK_DATA_API,Ut,function(t){t.preventDefault(),t.stopPropagation(),Jt._jQueryInterface.call(g(this),"toggle")}).on(kt.CLICK_DATA_API,Wt,function(t){t.stopPropagation()}),g.fn[It]=Jt._jQueryInterface,g.fn[It].Constructor=Jt,g.fn[It].noConflict=function(){return g.fn[It]=Nt,Jt._jQueryInterface};var Zt="modal",te="bs.modal",ee="."+te,ne=g.fn[Zt],ie={backdrop:!0,keyboard:!0,focus:!0,show:!0},oe={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},re={HIDE:"hide"+ee,HIDDEN:"hidden"+ee,SHOW:"show"+ee,SHOWN:"shown"+ee,FOCUSIN:"focusin"+ee,RESIZE:"resize"+ee,CLICK_DISMISS:"click.dismiss"+ee,KEYDOWN_DISMISS:"keydown.dismiss"+ee,MOUSEUP_DISMISS:"mouseup.dismiss"+ee,MOUSEDOWN_DISMISS:"mousedown.dismiss"+ee,CLICK_DATA_API:"click"+ee+".data-api"},se="modal-dialog-scrollable",ae="modal-scrollbar-measure",le="modal-backdrop",ce="modal-open",he="fade",ue="show",fe=".modal-dialog",de=".modal-body",ge='[data-toggle="modal"]',_e='[data-dismiss="modal"]',me=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",pe=".sticky-top",ve=function(){function o(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(fe),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var t=o.prototype;return t.toggle=function(t){return this._isShown?this.hide():this.show(t)},t.show=function(t){var e=this;if(!this._isShown&&!this._isTransitioning){g(this._element).hasClass(he)&&(this._isTransitioning=!0);var n=g.Event(re.SHOW,{relatedTarget:t});g(this._element).trigger(n),this._isShown||n.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),g(this._element).on(re.CLICK_DISMISS,_e,function(t){return e.hide(t)}),g(this._dialog).on(re.MOUSEDOWN_DISMISS,function(){g(e._element).one(re.MOUSEUP_DISMISS,function(t){g(t.target).is(e._element)&&(e._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return e._showElement(t)}))}},t.hide=function(t){var e=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var n=g.Event(re.HIDE);if(g(this._element).trigger(n),this._isShown&&!n.isDefaultPrevented()){this._isShown=!1;var i=g(this._element).hasClass(he);if(i&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),g(document).off(re.FOCUSIN),g(this._element).removeClass(ue),g(this._element).off(re.CLICK_DISMISS),g(this._dialog).off(re.MOUSEDOWN_DISMISS),i){var o=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(t){return e._hideModal(t)}).emulateTransitionEnd(o)}else this._hideModal()}}},t.dispose=function(){[window,this._element,this._dialog].forEach(function(t){return g(t).off(ee)}),g(document).off(re.FOCUSIN),g.removeData(this._element,te),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},t.handleUpdate=function(){this._adjustDialog()},t._getConfig=function(t){return t=l({},ie,t),_.typeCheckConfig(Zt,t,oe),t},t._showElement=function(t){var e=this,n=g(this._element).hasClass(he);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),g(this._dialog).hasClass(se)?this._dialog.querySelector(de).scrollTop=0:this._element.scrollTop=0,n&&_.reflow(this._element),g(this._element).addClass(ue),this._config.focus&&this._enforceFocus();
4047var i=g.Event(re.SHOWN,{relatedTarget:t}),o=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,g(e._element).trigger(i)};if(n){var r=_.getTransitionDurationFromElement(this._dialog);g(this._dialog).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()},t._enforceFocus=function(){var e=this;g(document).off(re.FOCUSIN).on(re.FOCUSIN,function(t){document!==t.target&&e._element!==t.target&&0===g(e._element).has(t.target).length&&e._element.focus()})},t._setEscapeEvent=function(){var e=this;this._isShown&&this._config.keyboard?g(this._element).on(re.KEYDOWN_DISMISS,function(t){27===t.which&&(t.preventDefault(),e.hide())}):this._isShown||g(this._element).off(re.KEYDOWN_DISMISS)},t._setResizeEvent=function(){var e=this;this._isShown?g(window).on(re.RESIZE,function(t){return e.handleUpdate(t)}):g(window).off(re.RESIZE)},t._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop(function(){g(document.body).removeClass(ce),t._resetAdjustments(),t._resetScrollbar(),g(t._element).trigger(re.HIDDEN)})},t._removeBackdrop=function(){this._backdrop&&(g(this._backdrop).remove(),this._backdrop=null)},t._showBackdrop=function(t){var e=this,n=g(this._element).hasClass(he)?he:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className=le,n&&this._backdrop.classList.add(n),g(this._backdrop).appendTo(document.body),g(this._element).on(re.CLICK_DISMISS,function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._element.focus():e.hide())}),n&&_.reflow(this._backdrop),g(this._backdrop).addClass(ue),!t)return;if(!n)return void t();var i=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,t).emulateTransitionEnd(i)}else if(!this._isShown&&this._backdrop){g(this._backdrop).removeClass(ue);var o=function(){e._removeBackdrop(),t&&t()};if(g(this._element).hasClass(he)){var r=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()}else t&&t()},t._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},t._setScrollbar=function(){var o=this;if(this._isBodyOverflowing){var t=[].slice.call(document.querySelectorAll(me)),e=[].slice.call(document.querySelectorAll(pe));g(t).each(function(t,e){var n=e.style.paddingRight,i=g(e).css("padding-right");g(e).data("padding-right",n).css("padding-right",parseFloat(i)+o._scrollbarWidth+"px")}),g(e).each(function(t,e){var n=e.style.marginRight,i=g(e).css("margin-right");g(e).data("margin-right",n).css("margin-right",parseFloat(i)-o._scrollbarWidth+"px")});var n=document.body.style.paddingRight,i=g(document.body).css("padding-right");g(document.body).data("padding-right",n).css("padding-right",parseFloat(i)+this._scrollbarWidth+"px")}g(document.body).addClass(ce)},t._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(me));g(t).each(function(t,e){var n=g(e).data("padding-right");g(e).removeData("padding-right"),e.style.paddingRight=n||""});var e=[].slice.call(document.querySelectorAll(""+pe));g(e).each(function(t,e){var n=g(e).data("margin-right");"undefined"!=typeof n&&g(e).css("margin-right",n).removeData("margin-right")});var n=g(document.body).data("padding-right");g(document.body).removeData("padding-right"),document.body.style.paddingRight=n||""},t._getScrollbarWidth=function(){var t=document.createElement("div");t.className=ae,document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},o._jQueryInterface=function(n,i){return this.each(function(){var t=g(this).data(te),e=l({},ie,g(this).data(),"object"==typeof n&&n?n:{});if(t||(t=new o(this,e),g(this).data(te,t)),"string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method n
4047amed "'+n+'"');t[n](i)}else e.show&&t.show(i)})},s(o,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return ie}}]),o}();g(document).on(re.CLICK_DATA_API,ge,function(t){var e,n=this,i=_.getSelectorFromElement(this);i&&(e=document.querySelector(i));var o=g(e).data(te)?"toggle":l({},g(e).data(),g(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var r=g(e).one(re.SHOW,function(t){t.isDefaultPrevented()||r.one(re.HIDDEN,function(){g(n).is(":visible")&&n.focus()})});ve._jQueryInterface.call(g(e),o,this)}),g.fn[Zt]=ve._jQueryInterface,g.fn[Zt].Constructor=ve,g.fn[Zt].noConflict=function(){return g.fn[Zt]=ne,ve._jQueryInterface};var ye=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],Ee={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ce=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,Te=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function Se(t,s,e){if(0===t.length)return t;if(e&&"function"==typeof e)return e(t);for(var n=(new window.DOMParser).parseFromString(t,"text/html"),a=Object.keys(s),l=[].slice.call(n.body.querySelectorAll("*")),i=function(t,e){var n=l[t],i=n.nodeName.toLowerCase();if(-1===a.indexOf(n.nodeName.toLowerCase()))return n.parentNode.removeChild(n),"continue";var o=[].slice.call(n.attributes),r=[].concat(s["*"]||[],s[i]||[]);o.forEach(function(t){(function(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===ye.indexOf(n)||Boolean(t.nodeValue.match(Ce)||t.nodeValue.match(Te));for(var i=e.filter(function(t){return t instanceof RegExp}),o=0,r=i.length;o<r;o++)if(n.match(i[o]))return!0;return!1})(t,r)||n.removeAttribute(t.nodeName)})},o=0,r=l.length;o<r;o++)i(o);return n.body.innerHTML}var be="tooltip",Ie="bs.tooltip",De="."+Ie,we=g.fn[be],Ae="bs-tooltip",Ne=new RegExp("(^|\\s)"+Ae+"\\S+","g"),Oe=["sanitize","whiteList","sanitizeFn"],ke={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object"},Pe={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},Le={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We}
4047,preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method n
4047amed "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0<e.length&&t.removeClass(e.join(""))},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ye),e="object"==typeof n?n:null;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ye,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Je}},{key:"NAME",get:function(){return Ve}},{key:"DATA_KEY",get:function(){return Ye}},{key:"Event",get:function(){return rn}},{key:"EVENT_KEY",get:function(){return ze}},{key:"DefaultType",get:function(){return Ze}}]),i}(Be);g.fn[Ve]=sn._jQueryInterface,g.fn[Ve].Constructor=sn,g.fn[Ve].noConflict=function(){return g.fn[Ve]=Xe,sn._jQueryInterface};var an="scrollspy",ln="bs.scrollspy",cn="."+ln,hn=g.fn[an],un={offset:10,method:"auto",target:""},fn={offset:"number",method:"string",target:"(string|element)"},dn={ACTIVATE:"activate"+cn,SCROLL:"scroll"+cn,LOAD_DATA_API:"load"+cn+".data-api"},gn="dropdown-item",_n="active",mn='[data-spy="scroll"]',pn=".nav, .list-group",vn=".nav-link",yn=".nav-item",En=".list-group-item",Cn=".dropdown",Tn=".dropdown-item",Sn=".dropdown-toggle",bn="offset",In="position",Dn=function(){function n(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" "+vn+","+this._config.target+" "+En+","+this._config.target+" "+Tn,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,g(this._scrollElement).on(dn.SCROLL,function(t){return n._process(t)}),this.refresh(),this._process()}var t=n.prototype;return t.refresh=function(){var e=this,t=this._scrollElement===this._scrollElement.window?bn:In,o="auto"===this._config.method?t:this._config.method,r=o===In?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(function(t){var e,n=_.getSelectorFromElement(t);if(n&&(e=document.querySelector(n)),e){var i=e.getBoundingClientRect();if(i.width||i.height)return[g(e)[o]().top+r,n]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}
4047).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},t.dispose=function(){g.removeData(this._element,ln),g(this._scrollElement).off(cn),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},t._getConfig=function(t){if("string"!=typeof(t=l({},un,"object"==typeof t&&t?t:{})).target){var e=g(t.target).attr("id");e||(e=_.getUID(an),g(t.target).attr("id",e)),t.target="#"+e}return _.typeCheckConfig(an,t,fn),t},t._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},t._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},t._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),n<=t){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&0<this._offsets[0])return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}},t._activate=function(e){this._activeTarget=e,this._clear();var t=this._selector.split(",").map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'}),n=g([].slice.call(document.querySelectorAll(t.join(","))));n.hasClass(gn)?(n.closest(Cn).find(Sn).addClass(_n),n.addClass(_n)):(n.addClass(_n),n.parents(pn).prev(vn+", "+En).addClass(_n),n.parents(pn).prev(yn).children(vn).addClass(_n)),g(this._scrollElement).trigger(dn.ACTIVATE,{relatedTarget:e})},t._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(t){return t.classList.contains(_n)}).forEach(function(t){return t.classList.remove(_n)})},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(ln);if(t||(t=new n(this,"object"==typeof e&&e),g(this).data(ln,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},s(n,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return un}}]),n}();g(window).on(dn.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(mn)),e=t.length;e--;){var n=g(t[e]);Dn._jQueryInterface.call(n,n.data())}}),g.fn[an]=Dn._jQueryInterface,g.fn[an].Constructor=Dn,g.fn[an].noConflict=function(){return g.fn[an]=hn,Dn._jQueryInterface};var wn="bs.tab",An="."+wn,Nn=g.fn.tab,On={HIDE:"hide"+An,HIDDEN:"hidden"+An,SHOW:"show"+An,SHOWN:"shown"+An,CLICK_DATA_API:"click"+An+".data-api"},kn="dropdown-menu",Pn="active",Ln="disabled",jn="fade",Hn="show",Rn=".dropdown",xn=".nav, .list-group",Fn=".active",Un="> li > .active",Wn='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',qn=".dropdown-toggle",Mn="> .dropdown-menu .active",Kn=function(){function i(t){this._element=t}var t=i.prototype;return t.show=function(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&g(this._element).hasClass(Pn)||g(this._element).hasClass(Ln))){var t,i,e=g(this._element).closest(xn)[0],o=_.getSelectorFromElement(this._element);if(e){var r="UL"===e.nodeName||"OL"===e.nodeName?Un:Fn;i=(i=g.makeArray(g(e).find(r)))[i.length-1]}var s=g.Event(On.HIDE,{relatedTarget:this._element}),a=g.Event(On.SHOW,{relatedTarget:i});if(i&&g(i).trigger(s),g(this._element).trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){o&&(t=document.querySelector(o)),this._activate(this._element,e);var l=function(){var t=g.Event(On.HIDDEN,{relatedTarget:n._element}),e=g.Event(On.SHOWN,{relatedTarget:i});g(i).trigger(t),g(n._element).trigger(e)};t?this._activate(t,t.parentNode,l):l()}}},t.dispose=function(){g.removeData(this._element,wn),this._element=null},t._activate=function(t,e,n){var i=this,o=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?g(e).children(Fn):g(e).find(Un))[0],r=n&&o&&g(o).hasClass(jn),s=function(){return i._transitionComplete(t,o,n)};if(o&&r){var a=_.getTransitionDurationFromElement(o);g(o).removeClass(Hn).one(_.TRANSITION_END,s).emulateTransitionEnd(a)}else s()},t._transitionComplete=function(t,e,n){if(e){g(e).removeClass(Pn);var i=g(e.parentNode).find(Mn)[0];i&&g(i).removeClass(Pn),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}if(g(t).addClass(Pn),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),_.reflow(t),t.classList.contains(jn)&&t.classList.add(Hn),t.parentNode&&g(t.parentNode).hasClass(kn)){var o=g(t).closest(Rn)[0];if(o){var r=[].slice.call(o.querySelectorAll(qn));g(r).addClass(Pn)}t.setAttribute("aria-expanded",!0)}n&&n()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(wn);if(e||(e=new i(this),t.data(wn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method n
vendor: 12,071 bytes, lines 4047-4049
4047amed "'+n+'"');e[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();g(document).on(On.CLICK_DATA_API,Wn,function(t){t.preventDefault(),Kn._jQueryInterface.call(g(this),"show")}),g.fn.tab=Kn._jQueryInterface,g.fn.tab.Constructor=Kn,g.fn.tab.noConflict=function(){return g.fn.tab=Nn,Kn._jQueryInterface};var Qn="toast",Bn="bs.toast",Vn="."+Bn,Yn=g.fn[Qn],zn={CLICK_DISMISS:"click.dismiss"+Vn,HIDE:"hide"+Vn,HIDDEN:"hidden"+Vn,SHOW:"show"+Vn,SHOWN:"shown"+Vn},Xn="fade",$n="hide",Gn="show",Jn="showing",Zn={animation:"boolean",autohide:"boolean",delay:"number"},ti={animation:!0,autohide:!0,delay:500},ei='[data-dismiss="toast"]',ni=function(){function i(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var t=i.prototype;return t.show=function(){var t=this;g(this._element).trigger(zn.SHOW),this._config.animation&&this._element.classList.add(Xn);var e=function(){t._element.classList.remove(Jn),t._element.classList.add(Gn),g(t._element).trigger(zn.SHOWN),t._config.autohide&&t.hide()};if(this._element.classList.remove($n),this._element.classList.add(Jn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},t.hide=function(t){var e=this;this._element.classList.contains(Gn)&&(g(this._element).trigger(zn.HIDE),t?this._close():this._timeout=setTimeout(function(){e._close()},this._config.delay))},t.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains(Gn)&&this._element.classList.remove(Gn),g(this._element).off(zn.CLICK_DISMISS),g.removeData(this._element,Bn),this._element=null,this._config=null},t._getConfig=function(t){return t=l({},ti,g(this._element).data(),"object"==typeof t&&t?t:{}),_.typeCheckConfig(Qn,t,this.constructor.DefaultType),t},t._setListeners=function(){var t=this;g(this._element).on(zn.CLICK_DISMISS,ei,function(){return t.hide(!0)})},t._close=function(){var t=this,e=function(){t._element.classList.add($n),g(t._element).trigger(zn.HIDDEN)};if(this._element.classList.remove(Gn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(Bn);if(e||(e=new i(this,"object"==typeof n&&n),t.data(Bn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n](this)}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"DefaultType",get:function(){return Zn}},{key:"Default",get:function(){return ti}}]),i}();g.fn[Qn]=ni._jQueryInterface,g.fn[Qn].Constructor=ni,g.fn[Qn].noConflict=function(){return g.fn[Qn]=Yn,ni._jQueryInterface},function(){if("undefined"==typeof g)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=g.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||4<=t[0])throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(),t.Util=_,t.Alert=p,t.Button=P,t.Carousel=lt,t.Collapse=bt,t.Dropdown=Jt,t.Modal=ve,t.Popover=sn,t.Scrollspy=Dn,t.Tab=Kn,t.Toast=ni,t.Tooltip=Be,Object.defineProperty(t,"__esModule",{value:!0})}); 4048/*! vanilla-lazyload v17.8.7 | MIT */ 4049!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).LazyLoad=t()}(this,(function(){"use strict";function n(){return n=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},n.apply(this,arguments)}var t="undefined"!=typeof window,e=t&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),i=t&&"IntersectionObserver"in window,o=t&&"classList"in document.createElement("p"),a=t&&window.devicePixelRatio>1,r={elements_selector:".lazy",container:e||t?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},c=function(t){return n({},r,t)},l=function(n,t){var e,i="LazyLoad::Initialized",o=new n(t);try{e=new CustomEvent(i,{detail:{instance:o}})}catch(n){(e=document.createEvent("CustomEvent")).initCustomEvent(i,!1,!1,{instance:o})}window.dispatchEvent(e)},u="src",s="srcset",d="sizes",f="poster",_="llOriginalAttrs",g="data",v="loading",b="loaded",p="applied",m="error",h="native",E="data-",I="ll-status",y=function(n,t){return n.getAttribute(E+t)},k=function(n){return y(n,I)},w=function(n,t){return function(n,t,e){var i="data-ll-status";null!==e?n.setAttribute(i,e):n.removeAttribute(i)}(n,0,t)},A=function(n){return w(n,null)},L=function(n){return null===k(n)},O=function(n){return k(n)===h},x=[v,b,p,m],C=function(n,t,e,i){n&&"function"==typeof n&&(void 0===i?void 0===e?n(t):n(t,e):n(t,e,i))},N=function(n,t){o?n.classList.add(t):n.className+=(n.className?" ":"")+t},M=function(n,t){o?n.classList.remove(t):n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},z=function(n){return n.llTempImage},T=function(n,t){if(t){var e=t._observer;e&&e.unobserve(n)}},R=function(n,t){n&&(n.loadingCount+=t)},G=function(n,t){n&&(n.toLoadCount=t)},j=function(n){for(var t,e=[],i=0;t=n.children[i];i+=1)"SOURCE"===t.tagName&&e.push(t);return e},D=function(n,t){var e=n.parentNode;e&&"PICTURE"===e.tagName&&j(e).forEach(t)},H=function(n,t){j(n).forEach(t)},V=[u],F=[u,f],B=[u,s,d],J=[g],P=function(n){return!!n[_]},S=function(n){return n[_]},U=function(n){return delete n[_]},$=function(n,t){if(!P(n)){var e={};t.forEach((function(t){e[t]=n.getAttribute(t)})),n[_]=e}},q=function(n,t){if(P(n)){var e=S(n);t.forEach((function(t){!function(n,t,e){e?n.setAttribute(t,e):n.removeAttribute(t)}(n,t,e[t])}))}},K=function(n,t,e){N(n,t.class_applied),w(n,p),e&&(t.unobserve_completed&&T(n,t),C(t.callback_applied,n,e))},Q=function(n,t,e){N(n,t.class_loading),w(n,v),e&&(R(e,1),C(t.callback_loading,n,e))},W=function(n,t,e){e&&n.setAttribute(t,e)},X=function(n,t){W(n,d,y(n,t.data_sizes)),W(n,s,y(n,t.data_srcset)),W(n,u,y(n,t.data_src))},Y={IMG:function(n,t){D(n,(function(n){$(n,B),X(n,t)})),$(n,B),X(n,t)},IFRAME:function(n,t){$(n,V),W(n,u,y(n,t.data_src))},VIDEO:function(n,t){H(n,(function(n){$(n,V),W(n,u,y(n,t.data_src))})),$(n,F),W(n,f,y(n,t.data_poster)),W(n,u,y(n,t.data_src)),n.load()},OBJECT:function(n,t){$(n,J),W(n,g,y(n,t.data_src))}},Z=["IMG","IFRAME","VIDEO","OBJECT"],nn=function(n,t){!t||function(n){return n.loadingCount>0}(t)||function(n){return n.toLoadCount>0}(t)||C(n.callback_finish,t)},tn=function(n,t,e){n.addEventListener(t,e),n.llEvLisnrs[t]=e},en=function(n,t,e){n.removeEventListener(t,e)},on=function(n){return!!n.llEvLisnrs},an=function(n){if(on(n)){var t=n.llEvLisnrs;for(var e in t){var i=t[e];en(n,e,i)}delete n.llEvLisnrs}},rn=function(n,t,e){!function(n){delete n.llTempImage}(n),R(e,-1),function(n){n&&(n.toLoadCount-=1)}(e),M(n,t.class_loading),t.unobserve_completed&&T(n,e)},cn=function(n,t,e){var i=z(n)||n;on(i)||function(n,t,e){on(n)||(n.llEvLisnrs={});var i="VIDEO"===n.tagName?"loadeddata":"load";tn(n,i,t),tn(n,"error",e)}(i,(function(o){!function(n,t,e,i){var o=O(t);rn(t,e,i),N(t,e.class_loaded),w(t,b),C(e.callback_loaded,t,i),o||nn(e,i)}(0,n,t,e),an(i)}),(function(o){!function(n,t,e,i){var o=O(t);rn(t,e,i),N(t,e.class_error),w(t,m),C(e.callback_error,t,i),e.restore_on_error&&q(t,B),o||nn(e,i)}(0,n,t,e),an(i)}))},ln=function(n,t,e){!function(n){return Z.indexOf(n.tagName)>-1}(n)?function(n,t,e){!function(n){n.llTempImage=document.createElement("IMG")}(n),cn(n,t,e),function(n){P(n)||(n[_]={backgroundImage:n.style.backgroundImage})}(n),function(n,t,e){var i=y(n,t.data_bg),o=y(n,t.data_bg_hidpi),r=a&&o?o:i;r&&(n.style.backgroundImage='url("'.concat(r,'")'),z(n).setAttribute(u,r),Q(n,t,e))}(n,t,e),function(n,t,e){var i=y(n,t.data_bg_multi),o=y(n,t.data_bg_multi_hidpi),r=a&&o?o:i;r&&(n.style.backgroundImage=r,K(n,t,e))}(n,t,e),function(n,t,e){var i=y(n,t.data_bg_set);if(i){var o=i.split("|"),a=o.map((function(n){return"image-set(".concat(n,")")}));n.style.backgroundImage=a.join(),""===n.style.backgroundImage&&(a=o.map((function(n){return"-webkit-image-set(".concat(n,")")})),n.style.backgroundImage=a.join()),K(n,t,e)}}(n,t,e)}(n,t,e):function(n,t,e){cn(n,t,e),function(n,t,e){var i=Y[n.tagName];i&&(i(n,t),Q(n,t,e))}(n,t,e)}(n,t,e)},un=function(n){n.removeAttribute(u),n.removeAttribute(s),n.removeAttribute(d)},sn=function(n){D(n,(function(n){q(n,B)})),q(n,B)},dn={IMG:sn,IFRAME:function(n){q(n,V)},VIDEO:function(n){H(n,(function(n){q(n,V)})),q(n,F),n.load()},OBJECT:function(n){q(n,J)}},fn=function(n,t){(function(n){var t=dn[n.tagName];t?t(n):function(n){if(P(n)){var t=S(n);n.style.backgroundImage=t.backgroundImage}}(n)})(n),function(n,t){L(n)||O(n)||(M(n,t.class_entered),M(n,t.class_exited),M(n,t.class_applied),M(n,t.class_loading),M(n,t.class_loaded),M(n,t.class_error))}(n,t),A(n),U(n)},_n=["IMG","IFRAME","VIDEO"],gn=function(n){return n.use_native&&"loading"in HTMLImageElement.prototype},vn=function(n,t,e){n.forEach((function(n){return function(n){return n.isIntersecting||n.intersectionRatio>0}(n)?function(n,t,e,i){var o=function(n){return x.indexOf(k(n))>=0}(n);w(n,"entered"),N(n,e.class_entered),M(n,e.class_exited),function(n,t,e){t.unobserve_entered&&T(n,e)}(n,e,i),C(e.callback_enter,n,t,i),o||ln(n,e,i)}(n.target,n,t,e):function(n,t,e,i){L(n)||(N(n,e.class_exited),function(n,t,e,i){e.cancel_on_exit&&function(n){return k(n)===v}(n)&&"IMG"===n.tagName&&(an(n),function(n){D(n,(function(n){un(n)})),un(n)}(n),sn(n),M(n,e.class_loading),R(i,-1),A(n),C(e.callback_cancel,n,t,i))}(n,t,e,i),C(e.callback_exit,n,t,i))}(n.target,n,t,e)}))},bn=function(n){return Array.prototype.slice.call(n)},pn=function(n){return n.container.querySelectorAll(n.elements_selector)},mn=function(n){return function(n){return k(n)===m}(n)},hn=function(n,t){return function(n){return bn(n).filter(L)}(n||pn(t))},En=function(n,e){var o=c(n);this._settings=o,this.loadingCount=0,function(n,t){i&&!gn(n)&&(t._observer=new IntersectionObserver((function(e){vn(e,n,t)}),function(n){return{root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}}(n)))}(o,this),function(n,e){t&&(e._onlineHandler=function(){!function(n,t){var e;(e=pn(n),bn(e).filter(mn)).forEach((function(t){M(t,n.class_error),A(t)})),t.update()}(n,e)},window.addEventListener("online",e._onlineHandler))}(o,this),this.update(e)};return En.prototype={update:function(n){var t,o,a=this._settings,r=hn(n,a);G(this,r.length),!e&&i?gn(a)?function(n,t,e){n.forEach((function(n){-1!==_n.indexOf(n.tagName)&&function(n,t,e){n.setAttribute("loading","lazy"),cn(n,t,e),function(n,t){var e=Y[n.tagName];e&&e(n,t)}(n,t),w(n,h)}(n,t,e)})),G(e,0)}(r,a,this):(o=r,function(n){n.disconnect()}(t=this._observer),function(n,t){t.forEach((function(t){n.observe(t)}))}(t,o)):this.loadAll(r)},destroy:function(){this._observer&&this._observer.disconnect(),t&&window.removeEventListener("online",this._onlineHandler),pn(this._settings).forEach((function(n){U(n)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(n){var t=this,e=this._settings;hn(n,e).forEach((function(n){T(n,t),ln(n,e,t)}))},restoreAll:function(){var n=this._settings;
vendor: 15,681 bytes, lines 4049-4612
4049pn(n).forEach((function(t){fn(t,n)}))}},En.load=function(n,t){var e=c(t);ln(n,e)},En.resetStatus=function(n){A(n)},t&&function(n,t){if(t)if(t.length)for(var e,i=0;e=t[i];i+=1)l(n,e);else l(n,t)}(En,window.lazyLoadOptions),En})); 4050/* Notify.js - http://notifyjs.com/ Copyright (c) 2015 MIT */ 4051(function (factory) { 4052 // UMD start 4053 // https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js 4054 if (typeof define === 'function' && define.amd) { 4055 // AMD. Register as an anonymous module. 4056 define(['jquery'], factory); 4057 } else if (typeof module === 'object' && module.exports) { 4058 // Node/CommonJS 4059 module.exports = function( root, jQuery ) { 4060 if ( jQuery === undefined ) { 4061 // require('jQuery') returns a factory that requires window to 4062 // build a jQuery instance, we normalize how we use modules 4063 // that require this pattern but the window provided is a noop 4064 // if it's defined (how jquery works) 4065 if ( typeof window !== 'undefined' ) { 4066 jQuery = require('jquery'); 4067 } 4068 else { 4069 jQuery = require('jquery')(root); 4070 } 4071 } 4072 factory(jQuery); 4073 return jQuery; 4074 }; 4075 } else { 4076 // Browser globals 4077 factory(jQuery); 4078 } 4079}(function ($) { 4080 //IE8 indexOf polyfill 4081 var indexOf = [].indexOf || function(item) { 4082 for (var i = 0, l = this.length; i < l; i++) { 4083 if (i in this && this[i] === item) { 4084 return i; 4085 } 4086 } 4087 return -1; 4088 }; 4089 4090 var pluginName = "notify"; 4091 var pluginClassName = pluginName + "js"; 4092 var blankFieldName = pluginName + "!blank"; 4093 4094 var positions = { 4095 t: "top", 4096 m: "middle", 4097 b: "bottom", 4098 l: "left", 4099 c: "center", 4100 r: "right" 4101 }; 4102 var hAligns = ["l", "c", "r"]; 4103 var vAligns = ["t", "m", "b"]; 4104 var mainPositions = ["t", "b", "l", "r"]; 4105 var opposites = { 4106 t: "b", 4107 m: null, 4108 b: "t", 4109 l: "r", 4110 c: null, 4111 r: "l" 4112 }; 4113 4114 var parsePosition = function(str) { 4115 var pos; 4116 pos = []; 4117 $.each(str.split(/\W+/), function(i, word) { 4118 var w; 4119 w = word.toLowerCase().charAt(0); 4120 if (positions[w]) { 4121 return pos.push(w); 4122 } 4123 }); 4124 return pos; 4125 }; 4126 4127 var styles = {}; 4128 4129 var coreStyle = { 4130 name: "core", 4131 html: "<div class=\"" + pluginClassName + "-wrapper\">\n <div class=\"" + pluginClassName + "-arrow\"></div>\n <div class=\"" + pluginClassName + "-container\"></div>\n</div>", 4132 css: "." + pluginClassName + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + pluginClassName + "-corner ." + pluginClassName + "-wrapper,\n." + pluginClassName + "-corner ." + pluginClassName + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + pluginClassName + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + pluginClassName + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n." + pluginClassName + "-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + pluginClassName + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}" 4133 }; 4134 4135 var stylePrefixes = { 4136 "border-radius": ["-webkit-", "-moz-"] 4137 }; 4138 4139 var getStyle = function(name) { 4140 return styles[name]; 4141 }; 4142 4143 var removeStyle = function(name) { 4144 if (!name) { 4145 throw "Missing Style name"; 4146 } 4147 if (styles[name]) { 4148 delete styles[name]; 4149 } 4150 }; 4151 4152 var addStyle = function(name, def) { 4153 if (!name) { 4154 throw "Missing Style name"; 4155 } 4156 if (!def) { 4157 throw "Missing Style definition"; 4158 } 4159 if (!def.html) { 4160 throw "Missing Style HTML"; 4161 } 4162 //remove existing style 4163 var existing = styles[name]; 4164 if (existing && existing.cssElem) { 4165 if (window.console) { 4166 console.warn(pluginName + ": overwriting style '" + name + "'"); 4167 } 4168 styles[name].cssElem.remove(); 4169 } 4170 def.name = name; 4171 styles[name] = def; 4172 var cssText = ""; 4173 if (def.classes) { 4174 $.each(def.classes, function(className, props) { 4175 cssText += "." + pluginClassName + "-" + def.name + "-" + className + " {\n"; 4176 $.each(props, function(name, val) { 4177 if (stylePrefixes[name]) { 4178 $.each(stylePrefixes[name], function(i, prefix) { 4179 return cssText += " " + prefix + name + ": " + val + ";\n"; 4180 }); 4181 } 4182 return cssText += " " + name + ": " + val + ";\n"; 4183 }); 4184 return cssText += "}\n"; 4185 }); 4186 } 4187 if (def.css) { 4188 cssText += "/* styles for " + def.name + " */\n" + def.css; 4189 } 4190 if (cssText) { 4191 def.cssElem = insertCSS(cssText); 4192 def.cssElem.attr("id", "notify-" + def.name); 4193 } 4194 var fields = {}; 4195 var elem = $(def.html); 4196 findFields("html", elem, fields); 4197 findFields("text", elem, fields); 4198 def.fields = fields; 4199 }; 4200 4201 var insertCSS = function(cssText) { 4202 var e, elem, error; 4203 elem = createElem("style"); 4204 elem.attr("type", 'text/css'); 4205 $("head").append(elem); 4206 try { 4207 elem.html(cssText); 4208 } catch (_) { 4209 elem[0].styleSheet.cssText = cssText; 4210 } 4211 return elem; 4212 }; 4213 4214 var findFields = function(type, elem, fields) { 4215 var attr; 4216 if (type !== "html") { 4217 type = "text"; 4218 } 4219 attr = "data-notify-" + type; 4220 return find(elem, "[" + attr + "]").each(function() { 4221 var name; 4222 name = $(this).attr(attr); 4223 if (!name) { 4224 name = blankFieldName; 4225 } 4226 fields[name] = type; 4227 }); 4228 }; 4229 4230 var find = function(elem, selector) { 4231 if (elem.is(selector)) { 4232 return elem; 4233 } else { 4234 return elem.find(selector); 4235 } 4236 }; 4237 4238 var pluginOptions = { 4239 clickToHide: true, 4240 autoHide: true, 4241 autoHideDelay: 5000, 4242 arrowShow: true, 4243 arrowSize: 5, 4244 breakNewLines: true, 4245 elementPosition: "bottom", 4246 globalPosition: "top right", 4247 style: "bootstrap", 4248 className: "error", 4249 showAnimation: "slideDown", 4250 showDuration: 400, 4251 hideAnimation: "slideUp", 4252 hideDuration: 200, 4253 gap: 5 4254 }; 4255 4256 var inherit = function(a, b) { 4257 var F; 4258 F = function() {}; 4259 F.prototype = a; 4260 return $.extend(true, new F(), b); 4261 }; 4262 4263 var defaults = function(opts) { 4264 return $.extend(pluginOptions, opts); 4265 }; 4266 4267 var createElem = function(tag) { 4268 return $("<" + tag + "></" + tag + ">"); 4269 }; 4270 4271 var globalAnchors = {}; 4272 4273 var getAnchorElement = function(element) { 4274 var radios; 4275 if (element.is('[type=radio]')) { 4276 radios = element.parents('form:first').find('[type=radio]').filter(function(i, e) { 4277 return $(e).attr("name") === element.attr("name"); 4278 }); 4279 element = radios.first(); 4280 } 4281 return element; 4282 }; 4283 4284 var incr = function(obj, pos, val) { 4285 var opp, temp; 4286 if (typeof val === "string") { 4287 val = parseInt(val, 10); 4288 } else if (typeof val !== "number") { 4289 return; 4290 } 4291 if (isNaN(val)) { 4292 return; 4293 } 4294 opp = positions[opposites[pos.charAt(0)]]; 4295 temp = pos; 4296 if (obj[opp] !== undefined) { 4297 pos = positions[opp.charAt(0)]; 4298 val = -val; 4299 } 4300 if (obj[pos] === undefined) { 4301 obj[pos] = val; 4302 } else { 4303 obj[pos] += val; 4304 } 4305 return null; 4306 }; 4307 4308 var realign = function(alignment, inner, outer) { 4309 if (alignment === "l" || alignment === "t") { 4310 return 0; 4311 } else if (alignment === "c" || alignment === "m") { 4312 return outer / 2 - inner / 2; 4313 } else if (alignment === "r" || alignment === "b") { 4314 return outer - inner; 4315 } 4316 throw "Invalid alignment"; 4317 }; 4318 4319 var encode = function(text) { 4320 encode.e = encode.e || createElem("div"); 4321 return encode.e.text(text).html(); 4322 }; 4323 4324 function Notification(elem, data, options) { 4325 if (typeof options === "string") { 4326 options = { 4327 className: options 4328 }; 4329 } 4330 this.options = inherit(pluginOptions, $.isPlainObject(options) ? options : {}); 4331 this.loadHTML(); 4332 this.wrapper = $(coreStyle.html); 4333 if (this.options.clickToHide) { 4334 this.wrapper.addClass(pluginClassName + "-hidable"); 4335 } 4336 this.wrapper.data(pluginClassName, this); 4337 this.arrow = this.wrapper.find("." + pluginClassName + "-arrow"); 4338 this.container = this.wrapper.find("." + pluginClassName + "-container"); 4339 this.container.append(this.userContainer); 4340 if (elem && elem.length) { 4341 this.elementType = elem.attr("type"); 4342 this.originalElement = elem; 4343 this.elem = getAnchorElement(elem); 4344 this.elem.data(pluginClassName, this); 4345 this.elem.before(this.wrapper); 4346 } 4347 this.container.hide(); 4348 this.run(data); 4349 } 4350 4351 Notification.prototype.loadHTML = function() { 4352 var style; 4353 style = this.getStyle(); 4354 this.userContainer = $(style.html); 4355 this.userFields = style.fields; 4356 }; 4357 4358 Notification.prototype.show = function(show, userCallback) { 4359 var args, callback, elems, fn, hidden; 4360 callback = (function(_this) { 4361 return function() { 4362 if (!show && !_this.elem) { 4363 _this.destroy(); 4364 } 4365 if (userCallback) { 4366 return userCallback(); 4367 } 4368 }; 4369 })(this); 4370 hidden = this.container.parent().parents(':hidden').length > 0; 4371 elems = this.container.add(this.arrow); 4372 args = []; 4373 if (hidden && show) { 4374 fn = "show"; 4375 } else if (hidden && !show) { 4376 fn = "hide"; 4377 } else if (!hidden && show) { 4378 fn = this.options.showAnimation; 4379 args.push(this.options.showDuration); 4380 } else if (!hidden && !show) { 4381 fn = this.options.hideAnimation; 4382 args.push(this.options.hideDuration); 4383 } else { 4384 return callback(); 4385 } 4386 args.push(callback); 4387 return elems[fn].apply(elems, args); 4388 }; 4389 4390 Notification.prototype.setGlobalPosition = function() { 4391 var p = this.getPosition(); 4392 var pMain = p[0]; 4393 var pAlign = p[1]; 4394 var main = positions[pMain]; 4395 var align = positions[pAlign]; 4396 var key = pMain + "|" + pAlign; 4397 var anchor = globalAnchors[key]; 4398 if (!anchor || !document.body.contains(anchor[0])) { 4399 anchor = globalAnchors[key] = createElem("div"); 4400 var css = {}; 4401 css[main] = 0; 4402 if (align === "middle") { 4403 css.top = '45%'; 4404 } else if (align === "center") { 4405 css.left = '45%'; 4406 } else { 4407 css[align] = 0; 4408 } 4409 anchor.css(css).addClass(pluginClassName + "-corner"); 4410 $("body").append(anchor); 4411 } 4412 return anchor.prepend(this.wrapper); 4413 }; 4414 4415 Notification.prototype.setElementPosition = function() { 4416 var arrowColor, arrowCss, arrowSize, color, contH, contW, css, elemH, elemIH, elemIW, elemPos, elemW, gap, j, k, len, len1, mainFull, margin, opp, oppFull, pAlign, pArrow, pMain, pos, posFull, position, ref, wrapPos; 4417 position = this.getPosition(); 4418 pMain = position[0]; 4419 pAlign = position[1]; 4420 pArrow = position[2]; 4421 elemPos = this.elem.position(); 4422 elemH = this.elem.outerHeight(); 4423 elemW = this.elem.outerWidth(); 4424 elemIH = this.elem.innerHeight(); 4425 elemIW = this.elem.innerWidth(); 4426 wrapPos = this.wrapper.position(); 4427 contH = this.container.height(); 4428 contW = this.container.width(); 4429 mainFull = positions[pMain]; 4430 opp = opposites[pMain]; 4431 oppFull = positions[opp]; 4432 css = {}; 4433 css[oppFull] = pMain === "b" ? elemH : pMain === "r" ? elemW : 0; 4434 incr(css, "top", elemPos.top - wrapPos.top); 4435 incr(css, "left", elemPos.left - wrapPos.left); 4436 ref = ["top", "left"]; 4437 for (j = 0, len = ref.length; j < len; j++) { 4438 pos = ref[j]; 4439 margin = parseInt(this.elem.css("margin-" + pos), 10); 4440 if (margin) { 4441 incr(css, pos, margin); 4442 } 4443 } 4444 gap = Math.max(0, this.options.gap - (this.options.arrowShow ? arrowSize : 0)); 4445 incr(css, oppFull, gap); 4446 if (!this.options.arrowShow) { 4447 this.arrow.hide(); 4448 } else { 4449 arrowSize = this.options.arrowSize; 4450 arrowCss = $.extend({}, css); 4451 arrowColor = this.userContainer.css("border-color") || this.userContainer.css("border-top-color") || this.userContainer.css("background-color") || "white"; 4452 for (k = 0, len1 = mainPositions.length; k < len1; k++) { 4453 pos = mainPositions[k]; 4454 posFull = positions[pos]; 4455 if (pos === opp) { 4456 continue; 4457 } 4458 color = posFull === mainFull ? arrowColor : "transparent"; 4459 arrowCss["border-" + posFull] = arrowSize + "px solid " + color; 4460 } 4461 incr(css, positions[opp], arrowSize); 4462 if (indexOf.call(mainPositions, pAlign) >= 0) { 4463 incr(arrowCss, positions[pAlign], arrowSize * 2); 4464 } 4465 } 4466 if (indexOf.call(vAligns, pMain) >= 0) { 4467 incr(css, "left", realign(pAlign, contW, elemW)); 4468 if (arrowCss) { 4469 incr(arrowCss, "left", realign(pAlign, arrowSize, elemIW)); 4470 } 4471 } else if (indexOf.call(hAligns, pMain) >= 0) { 4472 incr(css, "top", realign(pAlign, contH, elemH)); 4473 if (arrowCss) { 4474 incr(arrowCss, "top", realign(pAlign, arrowSize, elemIH)); 4475 } 4476 } 4477 if (this.container.is(":visible")) { 4478 css.display = "block"; 4479 } 4480 this.container.removeAttr("style").css(css); 4481 if (arrowCss) { 4482 return this.arrow.removeAttr("style").css(arrowCss); 4483 } 4484 }; 4485 4486 Notification.prototype.getPosition = function() { 4487 var pos, ref, ref1, ref2, ref3, ref4, ref5, text; 4488 text = this.options.position || (this.elem ? this.options.elementPosition : this.options.globalPosition); 4489 pos = parsePosition(text); 4490 if (pos.length === 0) { 4491 pos[0] = "b"; 4492 } 4493 if (ref = pos[0], indexOf.call(mainPositions, ref) < 0) { 4494 throw "Must be one of [" + mainPositions + "]"; 4495 } 4496 if (pos.length === 1 || ((ref1 = pos[0], indexOf.call(vAligns, ref1) >= 0) && (ref2 = pos[1], indexOf.call(hAligns, ref2) < 0)) || ((ref3 = pos[0], indexOf.call(hAligns, ref3) >= 0) && (ref4 = pos[1], indexOf.call(vAligns, ref4) < 0))) { 4497 pos[1] = (ref5 = pos[0], indexOf.call(hAligns, ref5) >= 0) ? "m" : "l"; 4498 } 4499 if (pos.length === 2) { 4500 pos[2] = pos[1]; 4501 } 4502 return pos; 4503 }; 4504 4505 Notification.prototype.getStyle = function(name) { 4506 var style; 4507 if (!name) { 4508 name = this.options.style; 4509 } 4510 if (!name) { 4511 name = "default"; 4512 } 4513 style = styles[name]; 4514 if (!style) { 4515 throw "Missing style: " + name; 4516 } 4517 return style; 4518 }; 4519 4520 Notification.prototype.updateClasses = function() { 4521 var classes, style; 4522 classes = ["base"]; 4523 if ($.isArray(this.options.className)) { 4524 classes = classes.concat(this.options.className); 4525 } else if (this.options.className) { 4526 classes.push(this.options.className); 4527 } 4528 style = this.getStyle(); 4529 classes = $.map(classes, function(n) { 4530 return pluginClassName + "-" + style.name + "-" + n; 4531 }).join(" "); 4532 return this.userContainer.attr("class", classes); 4533 }; 4534 4535 Notification.prototype.run = function(data, options) { 4536 var d, datas, name, type, value; 4537 if ($.isPlainObject(options)) { 4538 $.extend(this.options, options); 4539 } else if ($.type(options) === "string") { 4540 this.options.className = options; 4541 } 4542 if (this.container && !data) { 4543 this.show(false); 4544 return; 4545 } else if (!this.container && !data) { 4546 return; 4547 } 4548 datas = {}; 4549 if ($.isPlainObject(data)) { 4550 datas = data; 4551 } else { 4552 datas[blankFieldName] = data; 4553 } 4554 for (name in datas) { 4555 d = datas[name]; 4556 type = this.userFields[name]; 4557 if (!type) { 4558 continue; 4559 } 4560 if (type === "text") { 4561 d = encode(d); 4562 if (this.options.breakNewLines) { 4563 d = d.replace(/\n/g, '<br/>'); 4564 } 4565 } 4566 value = name === blankFieldName ? '' : '=' + name; 4567 find(this.userContainer, "[data-notify-" + type + value + "]").html(d); 4568 } 4569 this.updateClasses(); 4570 if (this.elem) { 4571 this.setElementPosition(); 4572 } else { 4573 this.setGlobalPosition(); 4574 } 4575 this.show(true); 4576 if (this.options.autoHide) { 4577 clearTimeout(this.autohideTimer); 4578 this.autohideTimer = setTimeout(this.show.bind(this, false), this.options.autoHideDelay); 4579 } 4580 }; 4581 4582 Notification.prototype.destroy = function() { 4583 this.wrapper.data(pluginClassName, null); 4584 this.wrapper.remove(); 4585 }; 4586 4587 $[pluginName] = function(elem, data, options) { 4588 if ((elem && elem.nodeName) || elem.jquery) { 4589 $(elem)[pluginName](data, options); 4590 } else { 4591 options = data; 4592 data = elem; 4593 new Notification(null, data, options); 4594 } 4595 return elem; 4596 }; 4597 4598 $.fn[pluginName] = function(data, options) { 4599 $(this).each(function() { 4600 var prev = getAnchorElement($(this)).data(pluginClassName); 4601 if (prev) { 4602 prev.destroy(); 4603 } 4604 var curr = new Notification($(this), data, options); 4605 }); 4606 return this; 4607 }; 4608 4609 $.extend($[pluginName], { 4610 defaults: defaults, 4611 addStyle: addStyle, 4612 removeStyle: remove
vendor: 6,057 bytes, lines 4612-4674
4612Style, 4613 pluginOptions: pluginOptions, 4614 getStyle: getStyle, 4615 insertCSS: insertCSS 4616 }); 4617 4618 //always include the default bootstrap style 4619 addStyle("bootstrap", { 4620 html: "<div>\n<span data-notify-text></span>\n</div>", 4621 classes: { 4622 base: { 4623 "font-weight": "bold", 4624 "padding": "8px 15px 8px 14px", 4625 "text-shadow": "0 1px 0 rgba(255, 255, 255, 0.5)", 4626 "background-color": "#fcf8e3", 4627 "border": "1px solid #fbeed5", 4628 "border-radius": "4px", 4629 "white-space": "nowrap", 4630 "padding-left": "25px", 4631 "background-repeat": "no-repeat", 4632 "background-position": "3px 7px" 4633 }, 4634 error: { 4635 "color": "#B94A48", 4636 "background-color": "#F2DEDE", 4637 "border-color": "#EED3D7", 4638 "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)" 4639 }, 4640 success: { 4641 "color": "#468847", 4642 "background-color": "#DFF0D8", 4643 "border-color": "#D6E9C6", 4644 "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)" 4645 }, 4646 info: { 4647 "color": "#3A87AD", 4648 "background-color": "#D9EDF7", 4649 "border-color": "#BCE8F1", 4650 "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)" 4651 }, 4652 warn: { 4653 "color": "#C09853", 4654 "background-color": "#FCF8E3", 4655 "border-color": "#FBEED5", 4656 "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)" 4657 } 4658 } 4659 }); 4660 4661 $(function() { 4662 insertCSS(coreStyle.css).attr("id", "core-notify"); 4663 $(document).on("click", "." + pluginClassName + "-hidable", function(e) { 4664 $(this).trigger("notify-hide"); 4665 }); 4666 $(document).on("notify-hide", "." + pluginClassName + "-wrapper", function(e) { 4667 var elem = $(this).data(pluginClassName); 4668 if(elem) { 4669 elem.show(false); 4670 } 4671 }); 4672 }); 4673 4674}));
vendor: 7,894 bytes, lines 4675-4688
4675 4676/** 4677 * Swiper 7.4.1 4678 * Most modern mobile touch slider and framework with hardware accelerated transitions 4679 * https://swiperjs.com 4680 * 4681 * Copyright 2014-2021 Vladimir Kharlampidi 4682 * 4683 * Released under the MIT License 4684 * 4685 * Released on: December 24, 2021 4686 */ 4687 4688!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Swiper=t()}(this,(function(){"use strict";function e(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function t(s={},a={}){Object.keys(a).forEach((i=>{void 0===s[i]?s[i]=a[i]:e(a[i])&&e(s[i])&&Object.keys(a[i]).length>0&&t(s[i],a[i])}))}const s={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function a(){const e="undefined"!=typeof document?document:{};return t(e,s),e}const i={document:s,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function r(){const e="undefined"!=typeof window?window:{};return t(e,i),e}class n extends Array{constructor(e){super(...e||[]),function(e){const t=e.__proto__;Object.defineProperty(e,"__proto__",{get:()=>t,set(e){t.__proto__=e}})}(this)}}function l(e=[]){const t=[];return e.forEach((e=>{Array.isArray(e)?t.push(...l(e)):t.push(e)})),t}function o(e,t){return Array.prototype.filter.call(e,t)}function d(e,t){const s=r(),i=a();let l=[];if(!t&&e instanceof n)return e;if(!e)return new n(l);if("string"==typeof e){const s=e.trim();if(s.indexOf("<")>=0&&s.indexOf(">")>=0){let e="div";0===s.indexOf("<li")&&(e="ul"),0===s.indexOf("<tr")&&(e="tbody"),0!==s.indexOf("<td")&&0!==s.indexOf("<th")||(e="tr"),0===s.indexOf("<tbody")&&(e="table"),0===s.indexOf("<option")&&(e="select");const t=i.createElement(e);t.innerHTML=s;for(let e=0;e<t.childNodes.length;e+=1)l.push(t.childNodes[e])}else l=function(e,t){if("string"!=typeof e)return[e];const s=[],a=t.querySelectorAll(e);for(let e=0;e<a.length;e+=1)s.push(a[e]);return s}(e.trim(),t||i)}else if(e.nodeType||e===s||e===i)l.push(e);else if(Array.isArray(e)){if(e instanceof n)return e;l=e}return new n(function(e){const t=[];for(let s=0;s<e.length;s+=1)-1===t.indexOf(e[s])&&t.push(e[s]);return t}(l))}d.fn=n.prototype;const p={addClass:function(...e){const t=l(e.map((e=>e.split(" "))));return this.forEach((e=>{e.classList.add(...t)})),this},removeClass:function(...e){const t=l(e.map((e=>e.split(" "))));return this.forEach((e=>{e.classList.remove(...t)})),this},hasClass:function(...e){const t=l(e.map((e=>e.split(" "))));return o(this,(e=>t.filter((t=>e.classList.contains(t))).length>0)).length>0},toggleClass:function(...e){const t=l(e.map((e=>e.split(" "))));this.forEach((e=>{t.forEach((t=>{e.classList.toggle(t)}))}))},attr:function(e,t){if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(let s=0;s<this.length;s+=1)if(2===arguments.length)this[s].setAttribute(e,t);else for(const t in e)this[s][t]=e[t],this[s].setAttribute(t,e[t]);return this},removeAttr:function(e){for(let t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this},transform:function(e){for(let t=0;t<this.length;t+=1)this[t].style.transform=e;return this},transition:function(e){for(let t=0;t<this.length;t+=1)this[t].style.transitionDuration="string"!=typeof e?`${e}ms`:e;return this},on:function(...e){let[t,s,a,i]=e;function r(e){const t=e.target;if(!t)return;const i=e.target.dom7EventData||[];if(i.indexOf(e)<0&&i.unshift(e),d(t).is(s))a.apply(t,i);else{const e=d(t).parents();for(let t=0;t<e.length;t+=1)d(e[t]).is(s)&&a.apply(e[t],i)}}function n(e){const t=e&&e.target&&e.target.dom7EventData||[];t.indexOf(e)<0&&t.unshift(e),a.apply(this,t)}"function"==typeof e[1]&&([t,a,i]=e,s=void 0),i||(i=!1);const l=t.split(" ");let o;for(let e=0;e<this.length;e+=1){const t=this[e];if(s)for(o=0;o<l.length;o+=1){const e=l[o];t.dom7LiveListeners||(t.dom7LiveListeners={}),t.dom7LiveListeners[e]||(t.dom7LiveListeners[e]=[]),t.dom7LiveListeners[e].push({listener:a,proxyListener:r}),t.addEventListener(e,r,i)}else for(o=0;o<l.length;o+=1){const e=l[o];t.dom7Listeners||(t.dom7Listeners={}),t.dom7Listeners[e]||(t.dom7Listeners[e]=[]),t.dom7Listeners[e].push({listener:a,proxyListener:n}),t.addEventListener(e,n,i)}}return this},off:function(...e){let[t,s,a,i]=e;"function"==typeof e[1]&&([t,a,i]=e,s=void 0),i||(i=!1);const r=t.split(" ");for(let e=0;e<r.length;e+=1){const t=r[e];for(let e=0;e<this.length;e+=1){const r=this[e];let n;if(!s&&r.dom7Listeners?n=r.dom7Listeners[t]:s&&r.dom7LiveListeners&&(n=r.dom7LiveListeners[t]),n&&n.length)for(let e=n.length-1;e>=0;e-=1){const s=n[e];a&&s.listener===a||a&&s.listener&&s.listener.dom7proxy&&s.listener.dom7proxy===a?(r.removeEventListener(t,s.proxyListener,i),n.splice(e,1)):a||(r.removeEventListener(t,s.proxyListener,i),n.splice(e,1))}}}return this},trigger:function(...e){const t=r(),s=e[0].split(" "),a=e[1];for(let i=0;i<s.length;i+=1){const r=s[i];for(let s=0;s<this.length;s+=1){const i=this[s];if(t.CustomEvent){const s=new t.CustomEvent(r,{detail:a,bubbles:!0,cancelable:!0});i.dom7EventData=e.filter(((e,t)=>t>0)),i.dispatchEvent(s),i.dom7EventData=[],delete i.dom7EventData}}}return this},transitionEnd:function(e){const t=this;return e&&t.on("transitionend",(function s(a){a.target===this&&(e.call(this,a),t.off("transitionend",s))})),this},outerWidth:function(e){if(this.length>0){if(e){const e=this.styles();return this[0].offsetWidth+parseFloat(e.getPropertyValue("margin-right"))+parseFloat(e.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},outerHeight:function(e){if(this.length>0){if(e){const e=this.styles();return this[0].offsetHeight+parseFloat(e.getPropertyValue("margin-top"))+parseFloat(e.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},styles:function(){const e=r();return this[0]?e.getComputedStyle(this[0],null):{}},offset:function(){if(this.length>0){const e=r(),t=a(),s=this[0],i=s.getBoundingClientRect(),n=t.body,l=s.clientTop||n.clientTop||0,o=s.clientLeft||n.clientLeft||0,d=s===e?e.scrollY:s.scrollTop,p=s===e?e.scrollX:s.scrollLeft;return{top:i.top+d-l,left:i.left+p-o}}return null},css:function(e,t){const s=r();let a;if(1===arguments.length){if("string"!=typeof e){for(a=0;a<this.length;a+=1)for(const t in e)this[a].style[t]=e[t];return this}if(this[0])return s.getComputedStyle(this[0],null).getPropertyValue(e)}if(2===arguments.length&&"string"==typeof e){for(a=0;a<this.length;a+=1)this[a].style[e]=t;return this}return this},each:function(e){return e?(this.forEach(((t,s)=>{e.apply(t,[t,s])})),this):this},html:function(e){if(void 0===e)return this[0]?this[0].innerHTML:null;for(let t=0;t<this.length;t+=1)this[t].innerHTML=e;return this},text:function(e){if(void 0===e)return this[0]?this[0].textContent.trim():null;for(let t=0;t<this.length;t+=1)this[t].textContent=e;return this},is:function(e){const t=r(),s=a(),i=this[0];let l,o;if(!i||void 0===e)return!1;if("string"==typeof e){if(i.matches)return i.matches(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e);
vendor: 4,317 bytes, line 4688
4688if(i.msMatchesSelector)return i.msMatchesSelector(e);for(l=d(e),o=0;o<l.length;o+=1)if(l[o]===i)return!0;return!1}if(e===s)return i===s;if(e===t)return i===t;if(e.nodeType||e instanceof n){for(l=e.nodeType?[e]:e,o=0;o<l.length;o+=1)if(l[o]===i)return!0;return!1}return!1},index:function(){let e,t=this[0];if(t){for(e=0;null!==(t=t.previousSibling);)1===t.nodeType&&(e+=1);return e}},eq:function(e){if(void 0===e)return this;const t=this.length;if(e>t-1)return d([]);if(e<0){const s=t+e;return d(s<0?[]:[this[s]])}return d([this[e]])},append:function(...e){let t;const s=a();for(let a=0;a<e.length;a+=1){t=e[a];for(let e=0;e<this.length;e+=1)if("string"==typeof t){const a=s.createElement("div");for(a.innerHTML=t;a.firstChild;)this[e].appendChild(a.firstChild)}else if(t instanceof n)for(let s=0;s<t.length;s+=1)this[e].appendChild(t[s]);else this[e].appendChild(t)}return this},prepend:function(e){const t=a();let s,i;for(s=0;s<this.length;s+=1)if("string"==typeof e){const a=t.createElement("div");for(a.innerHTML=e,i=a.childNodes.length-1;i>=0;i-=1)this[s].insertBefore(a.childNodes[i],this[s].childNodes[0])}else if(e instanceof n)for(i=0;i<e.length;i+=1)this[s].insertBefore(e[i],this[s].childNodes[0]);else this[s].insertBefore(e,this[s].childNodes[0]);return this},next:function(e){return this.length>0?e?this[0].nextElementSibling&&d(this[0].nextElementSibling).is(e)?d([this[0].nextElementSibling]):d([]):this[0].nextElementSibling?d([this[0].nextElementSibling]):d([]):d([])},nextAll:function(e){const t=[];let s=this[0];if(!s)return d([]);for(;s.nextElementSibling;){const a=s.nextElementSibling;e?d(a).is(e)&&t.push(a):t.push(a),s=a}return d(t)},prev:function(e){if(this.length>0){const t=this[0];return e?t.previousElementSibling&&d(t.previousElementSibling).is(e)?d([t.previousElementSibling]):d([]):t.previousElementSibling?d([t.previousElementSibling]):d([])}return d([])},prevAll:function(e){const t=[];let s=this[0];if(!s)return d([]);for(;s.previousElementSibling;){const a=s.previousElementSibling;e?d(a).is(e)&&t.push(a):t.push(a),s=a}return d(t)},parent:function(e){const t=[];for(let s=0;s<this.length;s+=1)null!==this[s].parentNode&&(e?d(this[s].parentNode).is(e)&&t.push(this[s].parentNode):t.push(this[s].parentNode));return d(t)},parents:function(e){const t=[];for(let s=0;s<this.length;s+=1){let a=this[s].parentNode;for(;a;)e?d(a).is(e)&&t.push(a):t.push(a),a=a.parentNode}return d(t)},closest:function(e){let t=this;return void 0===e?d([]):(t.is(e)||(t=t.parents(e).eq(0)),t)},find:function(e){const t=[];for(let s=0;s<this.length;s+=1){const a=this[s].querySelectorAll(e);for(let e=0;e<a.length;e+=1)t.push(a[e])}return d(t)},children:function(e){const t=[];for(let s=0;s<this.length;s+=1){const a=this[s].children;for(let s=0;s<a.length;s+=1)e&&!d(a[s]).is(e)||t.push(a[s])}return d(t)},filter:function(e){return d(o(this,e))},remove:function(){for(let e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this}};function c(e,t=0){return setTimeout(e,t)}function u(){return Date.now()}function h(e,t="x"){const s=r();let a,i,n;const l=function(e){const t=r();let s;return t.getComputedStyle&&(s=t.getComputedStyle(e,null)),!s&&e.currentStyle&&(s=e.currentStyle),s||(s=e.style),s}(e);return s.WebKitCSSMatrix?(i=l.transform||l.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map((e=>e.replace(",","."))).join(", ")),n=new s.WebKitCSSMatrix("none"===i?"":i)):(n=l.MozTransform||l.OTransform||l.MsTransform||l.msTransform||l.transform||l.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),a=n.toString().split(",")),"x"===t&&(i=s.WebKitCSSMatrix?n.m41:16===a.length?parseFloat(a[12]):parseFloat(a[4])),"y"===t&&(i=s.WebKitCSSMatrix?n.m42:16===a.length?parseFloat(a[13]):parseFloat(a[5])),i||0}function m(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function f(...e){const t=Object(e[0]),s=["__proto__","constructor","prototype"];for(let i=1;i<e.length;i+=1){const r=e[i];if(null!=r&&(a=r,!("undefined"!=typeof window&&void 0!==window.HTMLElement?a instanceof HTMLElement:a&&(1===a.nodeType||11===a.nodeType)))){const e=Object.keys(Object(r)).filter((e=>s.indexOf(e)<0));for(let s=0,a=e.length;s<a;s+=1){const a=e[s],i=Object.getOwnPropertyDescriptor(r,a);
vendor: 4,717 bytes, line 4688
4688void 0!==i&&i.enumerable&&(m(t[a])&&m(r[a])?r[a].__swiper__?t[a]=r[a]:f(t[a],r[a]):!m(t[a])&&m(r[a])?(t[a]={},r[a].__swiper__?t[a]=r[a]:f(t[a],r[a])):t[a]=r[a])}}}var a;return t}function g(e,t,s){e.style.setProperty(t,s)}function v({swiper:e,targetPosition:t,side:s}){const a=r(),i=-e.translate;let n,l=null;const o=e.params.speed;e.wrapperEl.style.scrollSnapType="none",a.cancelAnimationFrame(e.cssModeFrameID);const d=t>i?"next":"prev",p=(e,t)=>"next"===d&&e>=t||"prev"===d&&e<=t,c=()=>{n=(new Date).getTime(),null===l&&(l=n);const r=Math.max(Math.min((n-l)/o,1),0),d=.5-Math.cos(r*Math.PI)/2;let u=i+d*(t-i);if(p(u,t)&&(u=t),e.wrapperEl.scrollTo({[s]:u}),p(u,t))return e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout((()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[s]:u})})),void a.cancelAnimationFrame(e.cssModeFrameID);e.cssModeFrameID=a.requestAnimationFrame(c)};c()}let w,b,x;function y(){return w||(w=function(){const e=r(),t=a();return{smoothScroll:t.documentElement&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch),passiveListener:function(){let t=!1;try{const s=Object.defineProperty({},"passive",{get(){t=!0}});e.addEventListener("testPassiveListener",null,s)}catch(e){}return t}(),gestures:"ongesturestart"in e}}()),w}function E(e={}){return b||(b=function({userAgent:e}={}){const t=y(),s=r(),a=s.navigator.platform,i=e||s.navigator.userAgent,n={ios:!1,android:!1},l=s.screen.width,o=s.screen.height,d=i.match(/(Android);?[\s\/]+([\d.]+)?/);let p=i.match(/(iPad).*OS\s([\d_]+)/);const c=i.match(/(iPod)(.*OS\s([\d_]+))?/),u=!p&&i.match(/(iPhone\sOS|iOS)\s([\d_]+)/),h="Win32"===a;let m="MacIntel"===a;return!p&&m&&t.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${l}x${o}`)>=0&&(p=i.match(/(Version)\/([\d.]+)/),p||(p=[0,1,"13_0_0"]),m=!1),d&&!h&&(n.os="android",n.android=!0),(p||u||c)&&(n.os="ios",n.ios=!0),n}(e)),b}function T(){return x||(x=function(){const e=r();return{isSafari:function(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}(),isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)}}()),x}Object.keys(p).forEach((e=>{Object.defineProperty(d.fn,e,{value:p[e],writable:!0})}));var C={on(e,t,s){const a=this;if("function"!=typeof t)return a;const i=s?"unshift":"push";return e.split(" ").forEach((e=>{a.eventsListeners[e]||(a.eventsListeners[e]=[]),a.eventsListeners[e][i](t)})),a},once(e,t,s){const a=this;if("function"!=typeof t)return a;function i(...s){a.off(e,i),i.__emitterProxy&&delete i.__emitterProxy,t.apply(a,s)}return i.__emitterProxy=t,a.on(e,i,s)},onAny(e,t){const s=this;if("function"!=typeof e)return s;const a=t?"unshift":"push";return s.eventsAnyListeners.indexOf(e)<0&&s.eventsAnyListeners[a](e),s},offAny(e){const t=this;if(!t.eventsAnyListeners)return t;const s=t.eventsAnyListeners.indexOf(e);return s>=0&&t.eventsAnyListeners.splice(s,1),t},off(e,t){const s=this;return s.eventsListeners?(e.split(" ").forEach((e=>{void 0===t?s.eventsListeners[e]=[]:s.eventsListeners[e]&&s.eventsListeners[e].forEach(((a,i)=>{(a===t||a.__emitterProxy&&a.__emitterProxy===t)&&s.eventsListeners[e].splice(i,1)}))})),s):s},emit(...e){const t=this;if(!t.eventsListeners)return t;let s,a,i;"string"==typeof e[0]||Array.isArray(e[0])?(s=e[0],a=e.slice(1,e.length),i=t):(s=e[0].events,a=e[0].data,i=e[0].context||t),a.unshift(i);return(Array.isArray(s)?s:s.split(" ")).forEach((e=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach((t=>{t.apply(i,[e,...a])})),t.eventsListeners&&t.eventsListeners[e]&&t.eventsListeners[e].forEach((e=>{e.apply(i,a)}))})),t}};function $({swiper:e,runCallbacks:t,direction:s,step:a}){const{activeIndex:i,previousIndex:r}=e;let n=s;if(n||(n=i>r?"next":i<r?"prev":"reset"),e.emit(`transition${a}`),t&&i!==r){if("reset"===n)return void e.emit(`slideResetTransition${a}`);e.emit(`slideChangeTransition${a}`),"next"===n?e.emit(`slideNextTransition${a}`):e.emit(`slidePrevTransition${a}`)}}function S(e){const t=this,s=a(),i=r(),n=t.touchEventsData,{params:l,touches:o,enabled:p}=t;if(!p)return;if(t.animating&&l.preventInteractionOnTransition)return;!t.animating&&l.cssMode&&l.loop&&t.loopFix();let c=e;c.originalEvent&&(c=c.originalEvent);let h=d(c.target);if("wrapper"===l.touchEventsTarget&&!h.closest(t.wrapperEl).length)return;if(n.isTouchEvent="touchstart"===c.type,!n.isTouchEvent&&"which"in c&&3===c.which)return;if(!n.isTouchEvent&&"button"in c&&c.button>0)return;if(n.isTouched&&n.isMoved)return;
vendor: 4,646 bytes, line 4688
4688!!l.noSwipingClass&&""!==l.noSwipingClass&&c.target&&c.target.shadowRoot&&e.path&&e.path[0]&&(h=d(e.path[0]));const m=l.noSwipingSelector?l.noSwipingSelector:`.${l.noSwipingClass}`,f=!(!c.target||!c.target.shadowRoot);if(l.noSwiping&&(f?function(e,t=this){return function t(s){return s&&s!==a()&&s!==r()?(s.assignedSlot&&(s=s.assignedSlot),s.closest(e)||t(s.getRootNode().host)):null}(t)}(m,c.target):h.closest(m)[0]))return void(t.allowClick=!0);if(l.swipeHandler&&!h.closest(l.swipeHandler)[0])return;o.currentX="touchstart"===c.type?c.targetTouches[0].pageX:c.pageX,o.currentY="touchstart"===c.type?c.targetTouches[0].pageY:c.pageY;const g=o.currentX,v=o.currentY,w=l.edgeSwipeDetection||l.iOSEdgeSwipeDetection,b=l.edgeSwipeThreshold||l.iOSEdgeSwipeThreshold;if(w&&(g<=b||g>=i.innerWidth-b)){if("prevent"!==w)return;e.preventDefault()}if(Object.assign(n,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=g,o.startY=v,n.touchStartTime=u(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,l.threshold>0&&(n.allowThresholdMove=!1),"touchstart"!==c.type){let e=!0;h.is(n.focusableElements)&&(e=!1),s.activeElement&&d(s.activeElement).is(n.focusableElements)&&s.activeElement!==h[0]&&s.activeElement.blur();const a=e&&t.allowTouchMove&&l.touchStartPreventDefault;!l.touchStartForcePreventDefault&&!a||h[0].isContentEditable||c.preventDefault()}t.emit("touchStart",c)}function M(e){const t=a(),s=this,i=s.touchEventsData,{params:r,touches:n,rtlTranslate:l,enabled:o}=s;if(!o)return;let p=e;if(p.originalEvent&&(p=p.originalEvent),!i.isTouched)return void(i.startMoving&&i.isScrolling&&s.emit("touchMoveOpposite",p));if(i.isTouchEvent&&"touchmove"!==p.type)return;const c="touchmove"===p.type&&p.targetTouches&&(p.targetTouches[0]||p.changedTouches[0]),h="touchmove"===p.type?c.pageX:p.pageX,m="touchmove"===p.type?c.pageY:p.pageY;if(p.preventedByNestedSwiper)return n.startX=h,void(n.startY=m);if(!s.allowTouchMove)return s.allowClick=!1,void(i.isTouched&&(Object.assign(n,{startX:h,startY:m,currentX:h,currentY:m}),i.touchStartTime=u()));if(i.isTouchEvent&&r.touchReleaseOnEdges&&!r.loop)if(s.isVertical()){if(m<n.startY&&s.translate<=s.maxTranslate()||m>n.startY&&s.translate>=s.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(h<n.startX&&s.translate<=s.maxTranslate()||h>n.startX&&s.translate>=s.minTranslate())return;if(i.isTouchEvent&&t.activeElement&&p.target===t.activeElement&&d(p.target).is(i.focusableElements))return i.isMoved=!0,void(s.allowClick=!1);if(i.allowTouchCallbacks&&s.emit("touchMove",p),p.targetTouches&&p.targetTouches.length>1)return;n.currentX=h,n.currentY=m;const f=n.currentX-n.startX,g=n.currentY-n.startY;if(s.params.threshold&&Math.sqrt(f**2+g**2)<s.params.threshold)return;if(void 0===i.isScrolling){let e;s.isHorizontal()&&n.currentY===n.startY||s.isVertical()&&n.currentX===n.startX?i.isScrolling=!1:f*f+g*g>=25&&(e=180*Math.atan2(Math.abs(g),Math.abs(f))/Math.PI,i.isScrolling=s.isHorizontal()?e>r.touchAngle:90-e>r.touchAngle)}if(i.isScrolling&&s.emit("touchMoveOpposite",p),void 0===i.startMoving&&(n.currentX===n.startX&&n.currentY===n.startY||(i.startMoving=!0)),i.isScrolling)return void(i.isTouched=!1);if(!i.startMoving)return;s.allowClick=!1,!r.cssMode&&p.cancelable&&p.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&p.stopPropagation(),i.isMoved||(r.loop&&!r.cssMode&&s.loopFix(),i.startTranslate=s.getTranslate(),s.setTransition(0),s.animating&&s.$wrapperEl.trigger("webkitTransitionEnd transitionend"),i.allowMomentumBounce=!1,!r.grabCursor||!0!==s.allowSlideNext&&!0!==s.allowSlidePrev||s.setGrabCursor(!0),s.emit("sliderFirstMove",p)),s.emit("sliderMove",p),i.isMoved=!0;let v=s.isHorizontal()?f:g;n.diff=v,v*=r.touchRatio,l&&(v=-v),s.swipeDirection=v>0?"prev":"next",i.currentTranslate=v+i.startTranslate;let w=!0,b=r.resistanceRatio;if(r.touchReleaseOnEdges&&(b=0),v>0&&i.currentTranslate>s.minTranslate()?(w=!1,r.resistance&&(i.currentTranslate=s.minTranslate()-1+(-s.minTranslate()+i.startTranslate+v)**b)):v<0&&i.currentTranslate<s.maxTranslate()&&(w=!1,r.resistance&&(i.currentTranslate=s.maxTranslate()+1-(s.maxTranslate()-i.startTranslate-v)**b)),w&&(p.preventedByNestedSwiper=!0),!s.allowSlideNext&&"next"===s.swipeDirection&&i.currentTranslate<i.startTranslate&&(i.currentTranslate=i.startTranslate),!s.allowSlidePrev&&"prev"===s.swipeDirection&&i.currentTranslate>i.startTranslate&&(i.currentTranslate=i.startTranslate),s.allowSlidePrev||s.allowSlideNext||(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(v)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);
vendor: 16,002 bytes, line 4688
4688if(!i.allowThresholdMove)return i.allowThresholdMove=!0,n.startX=n.currentX,n.startY=n.currentY,i.currentTranslate=i.startTranslate,void(n.diff=s.isHorizontal()?n.currentX-n.startX:n.currentY-n.startY)}r.followFinger&&!r.cssMode&&((r.freeMode&&r.freeMode.enabled&&s.freeMode||r.watchSlidesProgress)&&(s.updateActiveIndex(),s.updateSlidesClasses()),s.params.freeMode&&r.freeMode.enabled&&s.freeMode&&s.freeMode.onTouchMove(),s.updateProgress(i.currentTranslate),s.setTranslate(i.currentTranslate))}function P(e){const t=this,s=t.touchEventsData,{params:a,touches:i,rtlTranslate:r,slidesGrid:n,enabled:l}=t;if(!l)return;let o=e;if(o.originalEvent&&(o=o.originalEvent),s.allowTouchCallbacks&&t.emit("touchEnd",o),s.allowTouchCallbacks=!1,!s.isTouched)return s.isMoved&&a.grabCursor&&t.setGrabCursor(!1),s.isMoved=!1,void(s.startMoving=!1);a.grabCursor&&s.isMoved&&s.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const d=u(),p=d-s.touchStartTime;if(t.allowClick){const e=o.path||o.composedPath&&o.composedPath();t.updateClickedSlide(e&&e[0]||o.target),t.emit("tap click",o),p<300&&d-s.lastClickTime<300&&t.emit("doubleTap doubleClick",o)}if(s.lastClickTime=u(),c((()=>{t.destroyed||(t.allowClick=!0)})),!s.isTouched||!s.isMoved||!t.swipeDirection||0===i.diff||s.currentTranslate===s.startTranslate)return s.isTouched=!1,s.isMoved=!1,void(s.startMoving=!1);let h;if(s.isTouched=!1,s.isMoved=!1,s.startMoving=!1,h=a.followFinger?r?t.translate:-t.translate:-s.currentTranslate,a.cssMode)return;if(t.params.freeMode&&a.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:h});let m=0,f=t.slidesSizesGrid[0];for(let e=0;e<n.length;e+=e<a.slidesPerGroupSkip?1:a.slidesPerGroup){const t=e<a.slidesPerGroupSkip-1?1:a.slidesPerGroup;void 0!==n[e+t]?h>=n[e]&&h<n[e+t]&&(m=e,f=n[e+t]-n[e]):h>=n[e]&&(m=e,f=n[n.length-1]-n[n.length-2])}const g=(h-n[m])/f,v=m<a.slidesPerGroupSkip-1?1:a.slidesPerGroup;if(p>a.longSwipesMs){if(!a.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(g>=a.longSwipesRatio?t.slideTo(m+v):t.slideTo(m)),"prev"===t.swipeDirection&&(g>1-a.longSwipesRatio?t.slideTo(m+v):t.slideTo(m))}else{if(!a.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(o.target===t.navigation.nextEl||o.target===t.navigation.prevEl)?o.target===t.navigation.nextEl?t.slideTo(m+v):t.slideTo(m):("next"===t.swipeDirection&&t.slideTo(m+v),"prev"===t.swipeDirection&&t.slideTo(m))}}function k(){const e=this,{params:t,el:s}=e;if(s&&0===s.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:a,allowSlidePrev:i,snapGrid:r}=e;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses(),("auto"===t.slidesPerView||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides?e.slideTo(e.slides.length-1,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.run(),e.allowSlidePrev=i,e.allowSlideNext=a,e.params.watchOverflow&&r!==e.snapGrid&&e.checkOverflow()}function z(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function O(){const e=this,{wrapperEl:t,rtlTranslate:s,enabled:a}=e;if(!a)return;let i;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,-0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const r=e.maxTranslate()-e.minTranslate();i=0===r?0:(e.translate-e.minTranslate())/r,i!==e.progress&&e.updateProgress(s?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}let I=!1;function L(){}const A=(e,t)=>{const s=a(),{params:i,touchEvents:r,el:n,wrapperEl:l,device:o,support:d}=e,p=!!i.nested,c="on"===t?"addEventListener":"removeEventListener",u=t;if(d.touch){const t=!("touchstart"!==r.start||!d.passiveListener||!i.passiveListeners)&&{passive:!0,capture:!1};n[c](r.start,e.onTouchStart,t),n[c](r.move,e.onTouchMove,d.passiveListener?{passive:!1,capture:p}:p),n[c](r.end,e.onTouchEnd,t),r.cancel&&n[c](r.cancel,e.onTouchEnd,t)}else n[c](r.start,e.onTouchStart,!1),s[c](r.move,e.onTouchMove,p),s[c](r.end,e.onTouchEnd,!1);(i.preventClicks||i.preventClicksPropagation)&&n[c]("click",e.onClick,!0),i.cssMode&&l[c]("scroll",e.onScroll),i.updateOnWindowResize?e[u](o.ios||o.android?"resize orientationchange observerUpdate":"resize observerUpdate",k,!0):e[u]("observerUpdate",k,!0)};const D=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;var G={init:!0,direction:"horizontal",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,loopPreventsSlide:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0,_emitClasses:!1};function N(e,t){return function(s={}){const a=Object.keys(s)[0],i=s[a];"object"==typeof i&&null!==i?(["navigation","pagination","scrollbar"].indexOf(a)>=0&&!0===e[a]&&(e[a]={auto:!0}),a in e&&"enabled"in i?(!0===e[a]&&(e[a]={enabled:!0}),"object"!=typeof e[a]||"enabled"in e[a]||(e[a].enabled=!0),e[a]||(e[a]={enabled:!1}),f(t,s)):f(t,s)):f(t,s)}}const B={eventsEmitter:C,update:{updateSize:function(){const e=this;let t,s;const a=e.$el;t=void 0!==e.params.width&&null!==e.params.width?e.params.width:a[0].clientWidth,s=void 0!==e.params.height&&null!==e.params.height?e.params.height:a[0].clientHeight,0===t&&e.isHorizontal()||0===s&&e.isVertical()||(t=t-parseInt(a.css("padding-left")||0,10)-parseInt(a.css("padding-right")||0,10),s=s-parseInt(a.css("padding-top")||0,10)-parseInt(a.css("padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(s)&&(s=0),Object.assign(e,{width:t,height:s,size:e.isHorizontal()?t:s}))},updateSlides:function(){const e=this;function t(t){return e.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}function s(e,s){return parseFloat(e.getPropertyValue(t(s))||0)}const a=e.params,{$wrapperEl:i,size:r,rtlTranslate:n,wrongRTL:l}=e,o=e.virtual&&a.virtual.enabled,d=o?e.virtual.slides.length:e.slides.length,p=i.children(`.${e.params.slideClass}`),c=o?e.virtual.slides.length:p.length;let u=[];const h=[],m=[];let f=a.slidesOffsetBefore;"function"==typeof f&&(f=a.slidesOffsetBefore.call(e));let v=a.slidesOffsetAfter;"function"==typeof v&&(v=a.slidesOffsetAfter.call(e));const w=e.snapGrid.length,b=e.slidesGrid.length;let x=a.spaceBetween,y=-f,E=0,T=0;if(void 0===r)return;"string"==typeof x&&x.indexOf("%")>=0&&(x=parseFloat(x.replace("%",""))/100*r),e.virtualSize=-x,n?p.css({marginLeft:"",marginBottom:"",marginTop:""}):p.css({marginRight:"",marginBottom:"",marginTop:""}),a.centeredSlides&&a.cssMode&&(g(e.wrapperEl,"--swiper-centered-offset-before",""),g(e.wrapperEl,"--swiper-centered-offset-after",""));const C=a.grid&&a.grid.rows>1&&e.grid;let $;C&&e.grid.initSlides(c);const S="auto"===a.slidesPerView&&a.breakpoints&&Object.keys(a.breakpoints).filter((e=>void 0!==a.breakpoints[e].slidesPerView)).length>0;for(let i=0;i<c;i+=1){$=0;const n=p.eq(i);if(C&&e.grid.updateSlide(i,n,c,t),"none"!==n.css("display")){if("auto"===a.slidesPerView){S&&(p[i].style[t("width")]="");const r=getComputedStyle(n[0]),l=n[0].style.transform,o=n[0].style.webkitTransform;if(l&&(n[0].style.transform="none"),o&&(n[0].style.webkitTransform="none"),a.roundLengths)$=e.isHorizontal()?n.outerWidth(!0):n.outerHeight(!0);else{const e=s(r,"width"),t=s(r,"padding-left"),a=s(r,"padding-right"),i=s(r,"margin-left"),l=s(r,"margin-right"),o=r.getPropertyValue("box-sizing");if(o&&"border-box"===o)$=e+i+l;else{const{clientWidth:s,offsetWidth:r}=n[0];$=e+t+a+i+l+(r-s)}}l&&(n[0].style.transform=l),o&&(n[0].style.webkitTransform=o),a.roundLengths&&($=Math.floor($))}else $=(r-(a.slidesPerView-1)*x)/a.slidesPerView,a.roundLengths&&($=Math.floor($)),p[i]&&(p[i].style[t("width")]=`${$}px`);p[i]&&(p[i].swiperSlideSize=$),m.push($),a.centeredSlides?(y=y+$/2+E/2+x,0===E&&0!==i&&(y=y-r/2-x),0===i&&(y=y-r/2-x),Math.abs(y)<.001&&(y=0),a.roundLengths&&(y=Math.floor(y)),T%a.slidesPerGroup==0&&u.push(y),h.push(y)):(a.roundLengths&&(y=Math.floor(y)),(T-Math.min(e.params.slidesPerGroupSkip,T))%e.params.slidesPerGroup==0&&u.push(y),h.push(y),y=y+$+x),e.virtualSize+=$+x,E=$,T+=1}}if(e.virtualSize=Math.max(e.virtualSize,r)+v,n&&l&&("slide"===a.effect||"coverflow"===a.effect)&&i.css({width:`${e.virtualSize+a.spaceBetween}px`}),a.setWrapperSize&&i.css({[t("width")]:`${e.virtualSize+a.spaceBetween}px`}),C&&e.grid.updateWrapperSize($,u,t),!a.centeredSlides){const t=[];for(let s=0;s<u.length;s+=1){let i=u[s];a.roundLengths&&(i=Math.floor(i)),u[s]<=e.virtualSize-r&&t.push(i)}u=t,Math.floor(e.virtualSize-r)-Math.floor(u[u.length-1])>1&&u.push(e.virtualSize-r)}if(0===u.length&&(u=[0]),0!==a.spaceBetween){const s=e.isHorizontal()&&n?"marginLeft":t("marginRight");p.filter(((e,t)=>!a.cssMode||t!==p.length-1)).css({[s]:`${x}px`})}if(a.centeredSlides&&a.centeredSlidesBounds){let e=0;m.forEach((t=>{e+=t+(a.spaceBetween?a.spaceBetween:0)})),e-=a.spaceBetween;const t=e-r;u=u.map((e=>e<0?-f:e>t?t+v:e))}if(a.centerInsufficientSlides){let e=0;if(m.forEach((t=>{e+=t+(a.spaceBetween?a.spaceBetween:0)})),e-=a.spaceBetween,e<r){const t=(r-e)/2;u.forEach(((e,s)=>{u[s]=e-t})),h.forEach(((e,s)=>{h[s]=e+t}))}}if(Object.assign(e,{slides:p,snapGrid:u,slidesGrid:h,slidesSizesGrid:m}),a.centeredSlides&&a.cssMode&&!a.centeredSlidesBounds){g(e.wrapperEl,"--swiper-centered-offset-before",-u[0]+"px"),g(e.wrapperEl,"--swiper-centered-offset-after",e.size/2-m[m.length-1]/2+"px");const t=-e.snapGrid[0],s=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map((e=>e+t)),e.slidesGrid=e.slidesGrid.map((e=>e+s))}c!==d&&e.emit("slidesLengthChange"),u.length!==w&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),h.length!==b&&e.emit("slidesGridLengthChange"),a.watchSlidesProgress&&e.updateSlidesOffset()},updateAutoHeight:function(e){const t=this,s=[],a=t.virtual&&t.params.virtual.enabled;let i,r=0;"number"==typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const n=e=>a?t.slides.filter((t=>parseInt(t.getAttribute("data-swiper-slide-index"),10)===e))[0]:t.slides.eq(e)[0];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)t.visibleSlides.each((e=>{s.push(e)}));else for(i=0;i<Math.ceil(t.params.slidesPerView);i+=1){const e=t.activeIndex+i;if(e>t.slides.length&&!a)break;s.push(n(e))}else s.push(n(t.activeIndex));for(i=0;i<s.length;i+=1)if(void 0!==s[i]){const e=s[i].offsetHeight;r=e>r?e:r}(r||0===r)&&t.$wrapperEl.css("height",`${r}px`)},updateSlidesOffset:function(){const e=this,t=e.slides;for(let s=0;s<t.length;s+=1)t[s].swiperSlideOffset=e.isHorizontal()?t[s].offsetLeft:t[s].offsetTop},updateSlidesProgress:function(e=this&&this.translate||0){const t=this,s=t.params,{slides:a,rtlTranslate:i,snapGrid:r}=t;if(0===a.length)return;void 0===a[0].swiperSlideOffset&&t.updateSlidesOffset();let n=-e;i&&(n=e),a.removeClass(s.slideVisibleClass),t.visibleSlidesIndexes=[],t.visibleSlides=[];for(let e=0;e<a.length;e+=1){const l=a[e];let o=l.swiperSlideOffset;s.cssMode&&s.centeredSlides&&(o-=a[0].swiperSlideOffset);const d=(n+(s.centeredSlides?t.minTranslate():0)-o)/(l.swiperSlideSize+s.spaceBetween),p=(n-r[0]+(s.centeredSlides?t.minTranslate():0)-o)/(l.swiperSlideSize+s.spaceBetween),c=-(n-o),u=c+t.slidesSizesGrid[e];(c>=0&&c<t.size-1||u>1&&u<=t.size||c<=0&&u>=t.size)&&(t.visibleSlides.push(l),t.visibleSlidesIndexes.push(e),a.eq(e).addClass(s.slideVisibleClass)),l.progress=i?-d:d,l.originalProgress=i?-p:p}t.visibleSlides=d(t.visibleSlides)},updateProgress:function(e){const t=this;if(void 0===e){const s=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*s||0}const s=t.params,a=t.maxTranslate()-t.minTranslate();let{progress:i,isBeginning:r,isEnd:n}=t;const l=r,o=n;0===a?(i=0,r=!0,n=!0):(i=(e-t.minTranslate())/a,r=i<=0,n=i>=1),Object.assign(t,{progress:i,isBeginning:r,isEnd:n}),(s.watchSlidesProgress||s.centeredSlides&&s.autoHeight)&&t.updateSlidesProgress(e),r&&!l&&t.emit("reachBeginning toEdge"),n&&!o&&t.emit("reachEnd toEdge"),(l&&!r||o&&!n)&&t.emit("fromEdge"),t.emit("progress",i)},updateSlidesClasses:function(){const e=this,{slides:t,params:s,$wrapperEl:a,activeIndex:i,realIndex:r}=e,n=e.virtual&&s.virtual.enabled;let l;t.removeClass(`${s.slideActiveClass} ${s.slideNextClass} ${s.slidePrevClass} ${s.slideDuplicateActiveClass} ${s.slideDuplicateNextClass} ${s.slideDuplicatePrevClass}`),l=n?e.$wrapperEl.find(`.${s.slideClass}[data-swiper-slide-index="${i}"]`):t.eq(i),l.addClass(s.slideActiveClass),s.loop&&(l.hasClass(s.slideDuplicateClass)?a.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${r}"]`).addClass(s.slideDuplicateActiveClass):a.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${r}"]`).addClass(s.slideDuplicateActiveClass));let o=l.nextAll(`.${s.slideClass}`).eq(0).addClass(s.slideNextClass);s.loop&&0===o.length&&(o=t.eq(0),o.addClass(s.slideNextClass));let d=l.prevAll(`.${s.slideClass}`).eq(0).addClass(s.slidePrevClass);s.loop&&0===d.length&&(d=t.eq(-1),d.addClass(s.slidePrevClass)),s.loop&&(o.hasClass(s.slideDuplicateClass)?a.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${o.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicateNextClass):a.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${o.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicateNextClass),d.hasClass(s.slideDuplicateClass)?a.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${d.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicatePrevClass):a.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${d.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicatePrevClass)),e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,s=t.rtlTranslate?t.translate:-t.translate,{slidesGrid:a,snapGrid:i,params:r,activeIndex:n,realIndex:l,snapIndex:o}=t;let d,p=e;if(void 0===p){for(let e=0;e<a.length;e+=1)void 0!==a[e+1]?s>=a[e]&&s<a[e+1]-(a[e+1]-a[e])/2?p=e:s>
vendor: 5,221 bytes, line 4688
4688=a[e]&&s<a[e+1]&&(p=e+1):s>=a[e]&&(p=e);r.normalizeSlideIndex&&(p<0||void 0===p)&&(p=0)}if(i.indexOf(s)>=0)d=i.indexOf(s);else{const e=Math.min(r.slidesPerGroupSkip,p);d=e+Math.floor((p-e)/r.slidesPerGroup)}if(d>=i.length&&(d=i.length-1),p===n)return void(d!==o&&(t.snapIndex=d,t.emit("snapIndexChange")));const c=parseInt(t.slides.eq(p).attr("data-swiper-slide-index")||p,10);Object.assign(t,{snapIndex:d,realIndex:c,previousIndex:n,activeIndex:p}),t.emit("activeIndexChange"),t.emit("snapIndexChange"),l!==c&&t.emit("realIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&t.emit("slideChange")},updateClickedSlide:function(e){const t=this,s=t.params,a=d(e).closest(`.${s.slideClass}`)[0];let i,r=!1;if(a)for(let e=0;e<t.slides.length;e+=1)if(t.slides[e]===a){r=!0,i=e;break}if(!a||!r)return t.clickedSlide=void 0,void(t.clickedIndex=void 0);t.clickedSlide=a,t.virtual&&t.params.virtual.enabled?t.clickedIndex=parseInt(d(a).attr("data-swiper-slide-index"),10):t.clickedIndex=i,s.slideToClickedSlide&&void 0!==t.clickedIndex&&t.clickedIndex!==t.activeIndex&&t.slideToClickedSlide()}},translate:{getTranslate:function(e=(this.isHorizontal()?"x":"y")){const{params:t,rtlTranslate:s,translate:a,$wrapperEl:i}=this;if(t.virtualTranslate)return s?-a:a;if(t.cssMode)return a;let r=h(i[0],e);return s&&(r=-r),r||0},setTranslate:function(e,t){const s=this,{rtlTranslate:a,params:i,$wrapperEl:r,wrapperEl:n,progress:l}=s;let o,d=0,p=0;s.isHorizontal()?d=a?-e:e:p=e,i.roundLengths&&(d=Math.floor(d),p=Math.floor(p)),i.cssMode?n[s.isHorizontal()?"scrollLeft":"scrollTop"]=s.isHorizontal()?-d:-p:i.virtualTranslate||r.transform(`translate3d(${d}px, ${p}px, 0px)`),s.previousTranslate=s.translate,s.translate=s.isHorizontal()?d:p;const c=s.maxTranslate()-s.minTranslate();o=0===c?0:(e-s.minTranslate())/c,o!==l&&s.updateProgress(e),s.emit("setTranslate",s.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e=0,t=this.params.speed,s=!0,a=!0,i){const r=this,{params:n,wrapperEl:l}=r;if(r.animating&&n.preventInteractionOnTransition)return!1;const o=r.minTranslate(),d=r.maxTranslate();let p;if(p=a&&e>o?o:a&&e<d?d:e,r.updateProgress(p),n.cssMode){const e=r.isHorizontal();if(0===t)l[e?"scrollLeft":"scrollTop"]=-p;else{if(!r.support.smoothScroll)return v({swiper:r,targetPosition:-p,side:e?"left":"top"}),!0;l.scrollTo({[e?"left":"top"]:-p,behavior:"smooth"})}return!0}return 0===t?(r.setTransition(0),r.setTranslate(p),s&&(r.emit("beforeTransitionStart",t,i),r.emit("transitionEnd"))):(r.setTransition(t),r.setTranslate(p),s&&(r.emit("beforeTransitionStart",t,i),r.emit("transitionStart")),r.animating||(r.animating=!0,r.onTranslateToWrapperTransitionEnd||(r.onTranslateToWrapperTransitionEnd=function(e){r&&!r.destroyed&&e.target===this&&(r.$wrapperEl[0].removeEventListener("transitionend",r.onTranslateToWrapperTransitionEnd),r.$wrapperEl[0].removeEventListener("webkitTransitionEnd",r.onTranslateToWrapperTransitionEnd),r.onTranslateToWrapperTransitionEnd=null,delete r.onTranslateToWrapperTransitionEnd,s&&r.emit("transitionEnd"))}),r.$wrapperEl[0].addEventListener("transitionend",r.onTranslateToWrapperTransitionEnd),r.$wrapperEl[0].addEventListener("webkitTransitionEnd",r.onTranslateToWrapperTransitionEnd))),!0}},transition:{setTransition:function(e,t){const s=this;s.params.cssMode||s.$wrapperEl.transition(e),s.emit("setTransition",e,t)},transitionStart:function(e=!0,t){const s=this,{params:a}=s;a.cssMode||(a.autoHeight&&s.updateAutoHeight(),$({swiper:s,runCallbacks:e,direction:t,step:"Start"}))},transitionEnd:function(e=!0,t){const s=this,{params:a}=s;s.animating=!1,a.cssMode||(s.setTransition(0),$({swiper:s,runCallbacks:e,direction:t,step:"End"}))}},slide:{slideTo:function(e=0,t=this.params.speed,s=!0,a,i){if("number"!=typeof e&&"string"!=typeof e)throw new Error(`The 'index' argument cannot have type other than 'number' or 'string'. [${typeof e}] given.`);if("string"==typeof e){const t=parseInt(e,10);if(!isFinite(t))throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${e}] given.`);e=t}const r=this;let n=e;n<0&&(n=0);const{params:l,snapGrid:o,slidesGrid:d,previousIndex:p,activeIndex:c,rtlTranslate:u,wrapperEl:h,enabled:m}=r;if(r.animating&&l.preventInteractionOnTransition||!m&&!a&&!i)return!1;const f=Math.min(r.params.slidesPerGroupSkip,n);let g=f+Math.floor((n-f)/r.params.slidesPerGroup);g>=o.length&&(g=o.length-1),(c||l.initialSlide||0)===(p||0)&&s&&r.emit("beforeSlideChangeStart");const w=-o[g];if(r.updateProgress(w),l.normalizeSlideIndex)for(let e=0;e<d.length;e+=1){const t=-Math.floor(100*w),s=Math.floor(100*d[e]),a=Math.floor(100*d[e+1]);void 0!==d[e+1]?t>=s&&t<a-(a-s)/2?n=e:t>=s&&t<a&&(n=e+1):t>=s&&(n=e)}if(r.initialized&&n!==c){if(!r.allowSlideNext&&w<r.translate&&w<r.minTranslate())return!1;if(!r.allowSlidePrev&&w>r.translate&&w>r.maxTranslate()&&(c||0)!==n)return!1}let b;if(b=n>c?"next":n<c?"prev":"reset",u&&-w===r.translate||!u&&w===r.translate)return r.updateActiveIndex(n),l.autoHeight&&r.updateAutoHeight(),r.updateSlidesClasses(),"slide"!==l.effect&&r.setTranslate(w),"reset"!==b&&(r.transitionStart(s,b),r.transitionEnd(s,b)),!1;
vendor: 33,740 bytes, line 4688
4688if(l.cssMode){const e=r.isHorizontal(),s=u?w:-w;if(0===t){const t=r.virtual&&r.params.virtual.enabled;t&&(r.wrapperEl.style.scrollSnapType="none",r._immediateVirtual=!0),h[e?"scrollLeft":"scrollTop"]=s,t&&requestAnimationFrame((()=>{r.wrapperEl.style.scrollSnapType="",r._swiperImmediateVirtual=!1}))}else{if(!r.support.smoothScroll)return v({swiper:r,targetPosition:s,side:e?"left":"top"}),!0;h.scrollTo({[e?"left":"top"]:s,behavior:"smooth"})}return!0}return r.setTransition(t),r.setTranslate(w),r.updateActiveIndex(n),r.updateSlidesClasses(),r.emit("beforeTransitionStart",t,a),r.transitionStart(s,b),0===t?r.transitionEnd(s,b):r.animating||(r.animating=!0,r.onSlideToWrapperTransitionEnd||(r.onSlideToWrapperTransitionEnd=function(e){r&&!r.destroyed&&e.target===this&&(r.$wrapperEl[0].removeEventListener("transitionend",r.onSlideToWrapperTransitionEnd),r.$wrapperEl[0].removeEventListener("webkitTransitionEnd",r.onSlideToWrapperTransitionEnd),r.onSlideToWrapperTransitionEnd=null,delete r.onSlideToWrapperTransitionEnd,r.transitionEnd(s,b))}),r.$wrapperEl[0].addEventListener("transitionend",r.onSlideToWrapperTransitionEnd),r.$wrapperEl[0].addEventListener("webkitTransitionEnd",r.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e=0,t=this.params.speed,s=!0,a){const i=this;let r=e;return i.params.loop&&(r+=i.loopedSlides),i.slideTo(r,t,s,a)},slideNext:function(e=this.params.speed,t=!0,s){const a=this,{animating:i,enabled:r,params:n}=a;if(!r)return a;let l=n.slidesPerGroup;"auto"===n.slidesPerView&&1===n.slidesPerGroup&&n.slidesPerGroupAuto&&(l=Math.max(a.slidesPerViewDynamic("current",!0),1));const o=a.activeIndex<n.slidesPerGroupSkip?1:l;if(n.loop){if(i&&n.loopPreventsSlide)return!1;a.loopFix(),a._clientLeft=a.$wrapperEl[0].clientLeft}return n.rewind&&a.isEnd?a.slideTo(0,e,t,s):a.slideTo(a.activeIndex+o,e,t,s)},slidePrev:function(e=this.params.speed,t=!0,s){const a=this,{params:i,animating:r,snapGrid:n,slidesGrid:l,rtlTranslate:o,enabled:d}=a;if(!d)return a;if(i.loop){if(r&&i.loopPreventsSlide)return!1;a.loopFix(),a._clientLeft=a.$wrapperEl[0].clientLeft}function p(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const c=p(o?a.translate:-a.translate),u=n.map((e=>p(e)));let h=n[u.indexOf(c)-1];if(void 0===h&&i.cssMode){let e;n.forEach(((t,s)=>{c>=t&&(e=s)})),void 0!==e&&(h=n[e>0?e-1:e])}let m=0;return void 0!==h&&(m=l.indexOf(h),m<0&&(m=a.activeIndex-1),"auto"===i.slidesPerView&&1===i.slidesPerGroup&&i.slidesPerGroupAuto&&(m=m-a.slidesPerViewDynamic("previous",!0)+1,m=Math.max(m,0))),i.rewind&&a.isBeginning?a.slideTo(a.slides.length-1,e,t,s):a.slideTo(m,e,t,s)},slideReset:function(e=this.params.speed,t=!0,s){return this.slideTo(this.activeIndex,e,t,s)},slideToClosest:function(e=this.params.speed,t=!0,s,a=.5){const i=this;let r=i.activeIndex;const n=Math.min(i.params.slidesPerGroupSkip,r),l=n+Math.floor((r-n)/i.params.slidesPerGroup),o=i.rtlTranslate?i.translate:-i.translate;if(o>=i.snapGrid[l]){const e=i.snapGrid[l];o-e>(i.snapGrid[l+1]-e)*a&&(r+=i.params.slidesPerGroup)}else{const e=i.snapGrid[l-1];o-e<=(i.snapGrid[l]-e)*a&&(r-=i.params.slidesPerGroup)}return r=Math.max(r,0),r=Math.min(r,i.slidesGrid.length-1),i.slideTo(r,e,t,s)},slideToClickedSlide:function(){const e=this,{params:t,$wrapperEl:s}=e,a="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let i,r=e.clickedIndex;if(t.loop){if(e.animating)return;i=parseInt(d(e.clickedSlide).attr("data-swiper-slide-index"),10),t.centeredSlides?r<e.loopedSlides-a/2||r>e.slides.length-e.loopedSlides+a/2?(e.loopFix(),r=s.children(`.${t.slideClass}[data-swiper-slide-index="${i}"]:not(.${t.slideDuplicateClass})`).eq(0).index(),c((()=>{e.slideTo(r)}))):e.slideTo(r):r>e.slides.length-a?(e.loopFix(),r=s.children(`.${t.slideClass}[data-swiper-slide-index="${i}"]:not(.${t.slideDuplicateClass})`).eq(0).index(),c((()=>{e.slideTo(r)}))):e.slideTo(r)}else e.slideTo(r)}},loop:{loopCreate:function(){const e=this,t=a(),{params:s,$wrapperEl:i}=e,r=i.children().length>0?d(i.children()[0].parentNode):i;r.children(`.${s.slideClass}.${s.slideDuplicateClass}`).remove();let n=r.children(`.${s.slideClass}`);if(s.loopFillGroupWithBlank){const e=s.slidesPerGroup-n.length%s.slidesPerGroup;if(e!==s.slidesPerGroup){for(let a=0;a<e;a+=1){const e=d(t.createElement("div")).addClass(`${s.slideClass} ${s.slideBlankClass}`);r.append(e)}n=r.children(`.${s.slideClass}`)}}"auto"!==s.slidesPerView||s.loopedSlides||(s.loopedSlides=n.length),e.loopedSlides=Math.ceil(parseFloat(s.loopedSlides||s.slidesPerView,10)),e.loopedSlides+=s.loopAdditionalSlides,e.loopedSlides>n.length&&(e.loopedSlides=n.length);const l=[],o=[];n.each(((t,s)=>{const a=d(t);s<e.loopedSlides&&o.push(t),s<n.length&&s>=n.length-e.loopedSlides&&l.push(t),a.attr("data-swiper-slide-index",s)}));for(let e=0;e<o.length;e+=1)r.append(d(o[e].cloneNode(!0)).addClass(s.slideDuplicateClass));for(let e=l.length-1;e>=0;e-=1)r.prepend(d(l[e].cloneNode(!0)).addClass(s.slideDuplicateClass))},loopFix:function(){const e=this;e.emit("beforeLoopFix");const{activeIndex:t,slides:s,loopedSlides:a,allowSlidePrev:i,allowSlideNext:r,snapGrid:n,rtlTranslate:l}=e;let o;e.allowSlidePrev=!0,e.allowSlideNext=!0;const d=-n[t]-e.getTranslate();if(t<a){o=s.length-3*a+t,o+=a;e.slideTo(o,0,!1,!0)&&0!==d&&e.setTranslate((l?-e.translate:e.translate)-d)}else if(t>=s.length-a){o=-s.length+t+a,o+=a;e.slideTo(o,0,!1,!0)&&0!==d&&e.setTranslate((l?-e.translate:e.translate)-d)}e.allowSlidePrev=i,e.allowSlideNext=r,e.emit("loopFix")},loopDestroy:function(){const{$wrapperEl:e,params:t,slides:s}=this;e.children(`.${t.slideClass}.${t.slideDuplicateClass},.${t.slideClass}.${t.slideBlankClass}`).remove(),s.removeAttr("data-swiper-slide-index")}},grabCursor:{setGrabCursor:function(e){const t=this;if(t.support.touch||!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const s="container"===t.params.touchEventsTarget?t.el:t.wrapperEl;s.style.cursor="move",s.style.cursor=e?"-webkit-grabbing":"-webkit-grab",s.style.cursor=e?"-moz-grabbin":"-moz-grab",s.style.cursor=e?"grabbing":"grab"},unsetGrabCursor:function(){const e=this;e.support.touch||e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e["container"===e.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="")}},events:{attachEvents:function(){const e=this,t=a(),{params:s,support:i}=e;e.onTouchStart=S.bind(e),e.onTouchMove=M.bind(e),e.onTouchEnd=P.bind(e),s.cssMode&&(e.onScroll=O.bind(e)),e.onClick=z.bind(e),i.touch&&!I&&(t.addEventListener("touchstart",L),I=!0),A(e,"on")},detachEvents:function(){A(this,"off")}},breakpoints:{setBreakpoint:function(){const e=this,{activeIndex:t,initialized:s,loopedSlides:a=0,params:i,$el:r}=e,n=i.breakpoints;if(!n||n&&0===Object.keys(n).length)return;const l=e.getBreakpoint(n,e.params.breakpointsBase,e.el);if(!l||e.currentBreakpoint===l)return;const o=(l in n?n[l]:void 0)||e.originalParams,d=D(e,i),p=D(e,o),c=i.enabled;d&&!p?(r.removeClass(`${i.containerModifierClass}grid ${i.containerModifierClass}grid-column`),e.emitContainerClasses()):!d&&p&&(r.addClass(`${i.containerModifierClass}grid`),(o.grid.fill&&"column"===o.grid.fill||!o.grid.fill&&"column"===i.grid.fill)&&r.addClass(`${i.containerModifierClass}grid-column`),e.emitContainerClasses());const u=o.direction&&o.direction!==i.direction,h=i.loop&&(o.slidesPerView!==i.slidesPerView||u);u&&s&&e.changeDirection(),f(e.params,o);const m=e.params.enabled;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),c&&!m?e.disable():!c&&m&&e.enable(),e.currentBreakpoint=l,e.emit("_beforeBreakpoint",o),h&&s&&(e.loopDestroy(),e.loopCreate(),e.updateSlides(),e.slideTo(t-a+e.loopedSlides,0,!1)),e.emit("breakpoint",o)},getBreakpoint:function(e,t="window",s){if(!e||"container"===t&&!s)return;let a=!1;const i=r(),n="window"===t?i.innerHeight:s.clientHeight,l=Object.keys(e).map((e=>{if("string"==typeof e&&0===e.indexOf("@")){const t=parseFloat(e.substr(1));return{value:n*t,point:e}}return{value:e,point:e}}));l.sort(((e,t)=>parseInt(e.value,10)-parseInt(t.value,10)));for(let e=0;e<l.length;e+=1){const{point:r,value:n}=l[e];"window"===t?i.matchMedia(`(min-width: ${n}px)`).matches&&(a=r):n<=s.clientWidth&&(a=r)}return a||"max"}},checkOverflow:{checkOverflow:function(){const e=this,{isLocked:t,params:s}=e,{slidesOffsetBefore:a}=s;if(a){const t=e.slides.length-1,s=e.slidesGrid[t]+e.slidesSizesGrid[t]+2*a;e.isLocked=e.size>s}else e.isLocked=1===e.snapGrid.length;!0===s.allowSlideNext&&(e.allowSlideNext=!e.isLocked),!0===s.allowSlidePrev&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}},classes:{addClasses:function(){const e=this,{classNames:t,params:s,rtl:a,$el:i,device:r,support:n}=e,l=function(e,t){const s=[];return e.forEach((e=>{"object"==typeof e?Object.keys(e).forEach((a=>{e[a]&&s.push(t+a)})):"string"==typeof e&&s.push(t+e)})),s}(["initialized",s.direction,{"pointer-events":!n.touch},{"free-mode":e.params.freeMode&&s.freeMode.enabled},{autoheight:s.autoHeight},{rtl:a},{grid:s.grid&&s.grid.rows>1},{"grid-column":s.grid&&s.grid.rows>1&&"column"===s.grid.fill},{android:r.android},{ios:r.ios},{"css-mode":s.cssMode},{centered:s.cssMode&&s.centeredSlides}],s.containerModifierClass);t.push(...l),i.addClass([...t].join(" ")),e.emitContainerClasses()},removeClasses:function(){const{$el:e,classNames:t}=this;e.removeClass(t.join(" ")),this.emitContainerClasses()}},images:{loadImage:function(e,t,s,a,i,n){const l=r();let o;function p(){n&&n()}d(e).parent("picture")[0]||e.complete&&i?p():t?(o=new l.Image,o.onload=p,o.onerror=p,a&&(o.sizes=a),s&&(o.srcset=s),t&&(o.src=t)):p()},preloadImages:function(){const e=this;function t(){null!=e&&e&&!e.destroyed&&(void 0!==e.imagesLoaded&&(e.imagesLoaded+=1),e.imagesLoaded===e.imagesToLoad.length&&(e.params.updateOnImagesReady&&e.update(),e.emit("imagesReady")))}e.imagesToLoad=e.$el.find("img");for(let s=0;s<e.imagesToLoad.length;s+=1){const a=e.imagesToLoad[s];e.loadImage(a,a.currentSrc||a.getAttribute("src"),a.srcset||a.getAttribute("srcset"),a.sizes||a.getAttribute("sizes"),!0,t)}}}},X={};class H{constructor(...e){let t,s;if(1===e.length&&e[0].constructor&&"Object"===Object.prototype.toString.call(e[0]).slice(8,-1)?s=e[0]:[t,s]=e,s||(s={}),s=f({},s),t&&!s.el&&(s.el=t),s.el&&d(s.el).length>1){const e=[];return d(s.el).each((t=>{const a=f({},s,{el:t});e.push(new H(a))})),e}const a=this;a.__swiper__=!0,a.support=y(),a.device=E({userAgent:s.userAgent}),a.browser=T(),a.eventsListeners={},a.eventsAnyListeners=[],a.modules=[...a.__modules__],s.modules&&Array.isArray(s.modules)&&a.modules.push(...s.modules);const i={};a.modules.forEach((e=>{e({swiper:a,extendParams:N(s,i),on:a.on.bind(a),once:a.once.bind(a),off:a.off.bind(a),emit:a.emit.bind(a)})}));const r=f({},G,i);return a.params=f({},r,X,s),a.originalParams=f({},a.params),a.passedParams=f({},s),a.params&&a.params.on&&Object.keys(a.params.on).forEach((e=>{a.on(e,a.params.on[e])})),a.params&&a.params.onAny&&a.onAny(a.params.onAny),a.$=d,Object.assign(a,{enabled:a.params.enabled,el:t,classNames:[],slides:d(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===a.params.direction,isVertical:()=>"vertical"===a.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEvents:function(){const e=["touchstart","touchmove","touchend","touchcancel"],t=["pointerdown","pointermove","pointerup"];return a.touchEventsTouch={start:e[0],move:e[1],end:e[2],cancel:e[3]},a.touchEventsDesktop={start:t[0],move:t[1],end:t[2]},a.support.touch||!a.params.simulateTouch?a.touchEventsTouch:a.touchEventsDesktop}(),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:u(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.emit("_swiper"),a.params.init&&a.init(),a}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const s=this;e=Math.min(Math.max(e,0),1);const a=s.minTranslate(),i=(s.maxTranslate()-a)*e+a;s.translateTo(i,void 0===t?0:t),s.updateActiveIndex(),s.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter((t=>0===t.indexOf("swiper")||0===t.indexOf(e.params.containerModifierClass)));e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return e.className.split(" ").filter((e=>0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass))).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.each((s=>{const a=e.getSlideClasses(s);t.push({slideEl:s,classNames:a}),e.emit("_slideClass",s,a)})),e.emit("_slideClasses",t)}slidesPerViewDynamic(e="current",t=!1){const{params:s,slides:a,slidesGrid:i,slidesSizesGrid:r,size:n,activeIndex:l}=this;let o=1;if(s.centeredSlides){let e,t=a[l].swiperSlideSize;for(let s=l+1;s<a.length;s+=1)a[s]&&!e&&(t+=a[s].swiperSlideSize,o+=1,t>n&&(e=!0));for(let s=l-1;s>=0;s-=1)a[s]&&!e&&(t+=a[s].swiperSlideSize,o+=1,t>n&&(e=!0))}else if("current"===e)for(let e=l+1;e<a.length;e+=1){(t?i[e]+r[e]-i[l]<n:i[e]-i[l]<n)&&(o+=1)}else for(let e=l-1;e>=0;e-=1){i[l]-i[e]<n&&(o+=1)}return o}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:s}=e;function a(){const t=e.rtlTranslate?-1*e.translate:e.translate,s=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(s),e.updateActiveIndex(),e.updateSlidesClasses()}let i;s.breakpoints&&e.setBreakpoint(),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.params.freeMode&&e.params.freeMode.enabled?(a(),e.params.autoHeight&&e.updateAutoHeight()):(i=("auto"===e.params.slidesPerView||e.params.slidesPerView>1)&&e.isEnd&&!e.params.centeredSlides?e.slideTo(e.slides.length-1,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0),i||a()),s.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t=!0){const s=this,a=s.params.direction;return e||(e="horizontal"===a?"vertical":"horizontal"),e===a||"horizontal"!==e&&"vertical"!==e||(s.$el.removeClass(`${s.params.containerModifierClass}${a}`).addClass(`${s.params.containerModifierClass}${e}`),s.emitContainerClasses(),s.params.direction=e,s.slides.each((t=>{"vertical"===e?t.style.width="":t.style.height=""})),s.emit("changeDirection"),t&&s.update()),s}mount(e){const t=this;if(t.mounted)return!0;const s=d(e||t.params.el);if(!(e=s[0]))return!1;e.swiper=t;const i=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let r=(()=>{if(e&&e.shadowRoot&&e.shadowRoot.querySelector){const t=d(e.shadowRoot.querySelector(i()));return t.children=e=>s.children(e),t}return s.children(i())})();if(0===r.length&&t.params.createElements){const e=a().createElement("div");r=d(e),e.className=t.params.wrapperClass,s.append(e),s.children(`.${t.params.slideClass}`).each((e=>{r.append(e)}))}return Object.assign(t,{$el:s,el:e,$wrapperEl:r,wrapperEl:r[0],mounted:!0,rtl:"rtl"===e.dir.toLowerCase()||"rtl"===s.css("direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===e.dir.toLowerCase()||"rtl"===s.css("direction")),wrongRTL:"-webkit-box"===r.css("display")}),!0}init(e){const t=this;if(t.initialized)return t;return!1===t.mount(e)||(t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.params.loop&&t.loopCreate(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.preloadImages&&t.preloadImages(),t.params.loop?t.slideTo(t.params.initialSlide+t.loopedSlides,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.attachEvents(),t.initialized=!0,t.emit("init"),t.emit("afterInit")),t}destroy(e=!0,t=!0){const s=this,{params:a,$el:i,$wrapperEl:r,slides:n}=s;return void 0===s.params||s.destroyed||(s.emit("beforeDestroy"),s.initialized=!1,s.detachEvents(),a.loop&&s.loopDestroy(),t&&(s.removeClasses(),i.removeAttr("style"),r.removeAttr("style"),n&&n.length&&n.removeClass([a.slideVisibleClass,a.slideActiveClass,a.slideNextClass,a.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")),s.emit("destroy"),Object.keys(s.eventsListeners).forEach((e=>{s.off(e)})),!1!==e&&(s.$el[0].swiper=null,function(e){const t=e;Object.keys(t).forEach((e=>{try{t[e]=null}catch(e){}try{delete t[e]}catch(e){}}))}(s)),s.destroyed=!0),null}static extendDefaults(e){f(X,e)}static get extendedDefaults(){return X}static get defaults(){return G}static installModule(e){H.prototype.__modules__||(H.prototype.__modules__=[]);const t=H.prototype.__modules__;"function"==typeof e&&t.indexOf(e)<0&&t.push(e)}static use(e){return Array.isArray(e)?(e.forEach((e=>H.installModule(e))),H):(H.installModule(e),H)}}function Y(e,t,s,i){const r=a();return e.params.createElements&&Object.keys(i).forEach((a=>{if(!s[a]&&!0===s.auto){let n=e.$el.children(`.${i[a]}`)[0];n||(n=r.createElement("div"),n.className=i[a],e.$el.append(n)),s[a]=n,t[a]=n}})),s}function W(e=""){return`.${e.trim().replace(/([\.:!\/])/g,"\\$1").replace(/ /g,".")}`}function R(e){const t=this,{$wrapperEl:s,params:a}=t;if(a.loop&&t.loopDestroy(),"object"==typeof e&&"length"in e)for(let t=0;t<e.length;t+=1)e[t]&&s.append(e[t]);else s.append(e);a.loop&&t.loopCreate(),a.observer||t.update()}function j(e){const t=this,{params:s,$wrapperEl:a,activeIndex:i}=t;s.loop&&t.loopDestroy();let r=i+1;if("object"==typeof e&&"length"in e){for(let t=0;t<e.length;t+=1)e[t]&&a.prepend(e[t]);r=i+e.length}else a.prepend(e);s.loop&&t.loopCreate(),s.observer||t.update(),t.slideTo(r,0,!1)}function _(e,t){const s=this,{$wrapperEl:a,params:i,activeIndex:r}=s;let n=r;i.loop&&(n-=s.loopedSlides,s.loopDestroy(),s.slides=a.children(`.${i.slideClass}`));const l=s.slides.length;if(e<=0)return void s.prependSlide(t);if(e>=l)return void s.appendSlide(t);let o=n>e?n+1:n;const d=[];for(let t=l-1;t>=e;t-=1){const e=s.slides.eq(t);e.remove(),d.unshift(e)}if("object"==typeof t&&"length"in t){for(let e=0;e<t.length;e+=1)t[e]&&a.append(t[e]);o=n>e?n+t.length:n}else a.append(t);for(let e=0;e<d.length;e+=1)a.append(d[e]);i.loop&&s.loopCreate(),i.observer||s.update(),i.loop?s.slideTo(o+s.loopedSlides,0,!1):s.slideTo(o,0,!1)}function V(e){const t=this,{params:s,$wrapperEl:a,activeIndex:i}=t;let r=i;s.loop&&(r-=t.loopedSlides,t.loopDestroy(),t.slides=a.children(`.${s.slideClass}`));let n,l=r;if("object"==typeof e&&"length"in e){for(let s=0;s<e.length;s+=1)n=e[s],t.slides[n]&&t.slides.eq(n).remove(),n<l&&(l-=1);l=Math.max(l,0)}else n=e,t.slides[n]&&t.slides.eq(n).remove(),n<l&&(l-=1),l=Math.max(l,0);s.loop&&t.loopCreate(),s.observer||t.update(),s.loop?t.slideTo(l+t.loopedSlides,0,!1):t.slideTo(l,0,!1)}function q(){const e=this,t=[];for(let s=0;s<e.slides.length;s+=1)t.push(s);e.removeSlide(t)}function F(e){const{effect:t,swiper:s,on:a,setTranslate:i,setTransition:r,overwriteParams:n,perspective:l}=e;a("beforeInit",(()=>{if(s.params.effect!==t)return;s.classNames.push(`${s.params.containerModifierClass}${t}`),l&&l()&&s.classNames.push(`${s.params.containerModifierClass}3d`);const e=n?n():{};Object.assign(s.params,e),Object.assign(s.originalParams,e)})),a("setTranslate",(()=>{s.params.effect===t&&i()})),a("setTransition",((e,a)=>{s.params.effect===t&&r(a)}))}function U(e,t){return e.transformEl?t.find(e.transformEl).css({"backface-visibility":"hidden","-webkit-backface-visibility":"hidden"}):t}function K({swiper:e,duration:t,transformEl:s,allSlides:a}){const{slides:i,activeIndex:r,$wrapperEl:n}=e;if(e.params.virtualTranslate&&0!==t){let t,l=!1;t=a?s?i.find(s):i:s?i.eq(r).find(s):i.eq(r),t.transitionEnd((()=>{if(l)return;if(!e||e.destroyed)return;l=!0,e.animating=!1;const t=["webkitTransitionEnd","transitionend"];for(let e=0;e<t.length;e+=1)n.trigger(t[e])}))}}function Z(e,t,s){const a="swiper-slide-shadow"+(s?`-${s}`:""),i=e.transformEl?t.find(e.transformEl):t;let r=i.children(`.${a}`);return r.length||(r=d(`<div class="swiper-slide-shadow${s?`-${s}`:""}"></div>`),i.append(r)),r}Object.keys(B).forEach((e=>{Object.keys(B[e]).forEach((t=>{H.prototype[t]=B[e][t]}))})),H.use([function({swiper:e,on:t,emit:s}){const a=r();let i=null;const n=()=>{e&&!e.destroyed&&e.initialized&&(s("beforeResize"),s("resize"))},l=()=>{e&&!e.destroyed&&e.initialized&&s("orientationchange")};t("init",(()=>{e.params.resizeObserver&&void 0!==a.ResizeObserver?e&&!e.destroyed&&e.initialized&&(i=new ResizeObserver((t=>{const{width:s,height:a}=e;let i=s,r=a;t.forEach((({contentBoxSize:t,contentRect:s,target:a})=>{a&&a!==e.el||(i=s?s.width:(t[0]||t).inlineSize,r=s?s.height:(t[0]||t).blockSize)})),i===s&&r===a||n()})),i.observe(e.el)):(a.addEventListener("resize",n),a.addEventListener("orientationchange",l))})),t("destroy",(()=>{i&&i.unobserve&&e.el&&(i.unobserve(e.el),i=null),a.removeEventListener("resize",n),a.removeEventListener("orientationchange",l)}))},function({swiper:e,extendParams:t,on:s,emit:a}){const i=[],n=r(),l=(e,t={})=>{const s=new(n.MutationObserver||n.WebkitMutationObserver)((e=>{if(1===e.length)return void a("observerUpdate",e[0]);const t=function(){a("observerUpdate",e[0])};n.requestAnimationFrame?n.requestAnimationFrame(t):n.setTimeout(t,0)}));s.observe(e,{attributes:void 0===t.attributes||t.attributes,childList:void 0===t.childList||t.childList,characterData:void 0===t.characterData||t.characterData}),i.push(s)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),s("init",(()=>{if(e.params.observer){if(e.params.observeParents){const t=e.$el.parents();for(let e=0;e<t.length;e+=1)l(t[e])}l(e.$el[0],{childList:e.params.observeSlideChildren}),l(e.$wrapperEl[0],{attributes:!1})}})),s("destroy",(()=>{i.forEach((e=>{e.disconnect()})),i.splice(0,i.length)}))}]);const J=[function({swiper:e,extendParams:t,on:s}){let a;function i(t,s){const a=e.params.virtual;if(a.cache&&e.virtual.cache[s])return e.virtual.cache[s];const i=a.renderSlide?d(a.renderSlide.call(e,t,s)):d(`<div class="${e.params.slideClass}" data-swiper-slide-index="${s}">${t}</div>`);return i.attr("data-swiper-slide-index")||i.attr("data-swiper-slide-index",s),a.cache&&(e.virtual.cache[s]=i),i}function r(t){const{slidesPerView:s,slidesPerGroup:a,centeredSlides:r}=e.params,{addSlidesBefore:n,addSlidesAfter:l}=e.params.virtual,{from:o,to:d,slides:p,slidesGrid:c,offset:u}=e.virtual;e.params.cssMode||e.updateActiveIndex();const h=e.activeIndex||0;let m,f,g;m=e.rtlTranslate?"right":e.isHorizontal()?"left":"top",r?(f=Math.floor(s/2)+a+l,g=Math.floor(s/2)+a+n):(f=s+(a-1)+l,g=a+n);const v=Math.max((h||0)-g,0),w=Math.min((h||0)+f,p.length-1),b=(e.slidesGrid[v]||0)-(e.slidesGrid[0]||0);function x(){e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.lazy&&e.params.lazy.enabled&&e.lazy.load()}if(Object.assign(e.virtual,{from:v,to:w,offset:b,slidesGrid:e.slidesGrid}),o===v&&d===w&&!t)return e.slidesGrid!==c&&b!==u&&e.slides.css(m,`${b}px`),void e.updateProgress();if(e.params.virtual.renderExternal)return e.params.virtual.renderExternal.call(e,{offset:b,from:v,to:w,slides:function(){const e=[];for(let t=v;t<=w;t+=1)e.push(p[t]);return e}()}),void(e.params.virtual.renderExternalUpdate&&x());const y=[],E=[];if(t)e.$wrapperEl.find(`.${e.params.slideClass}`).remove();else for(let t=o;t<=d;t+=1)(t<v||t>w)&&e.$wrapperEl.find(`.${e.params.slideClass}[data-swiper-slide-index="${t}"]`).remove();for(let e=0;e<p.length;e+=1)e>=v&&e<=w&&(void 0===d||t?E.push(e):(e>d&&E.push(e),e<o&&y.push(e)));E.forEach((t=>{e.$wrapperEl.append(i(p[t],t))})),y.sort(((e,t)=>t-e)).forEach((t=>{e.$wrapperEl.prepend(i(p[t],t))})),e.$wrapperEl.children(".swiper-slide").css(m,`${b}px`),x()}t({virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}}),e.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]},s("beforeInit",(()=>{e.params.virtual.enabled&&(e.virtual.slides=e.params.virtual.slides,e.classNames.push(`${e.params.containerModifierClass}virtual`),e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0,e.params.initialSlide||r())})),s("setTranslate",(()=>{e.params.virtual.enabled&&(e.params.cssMode&&!e._immediateVirtual?(clearTimeout(a),a=setTimeout((()=>{r()}),100)):r())})),s("init update resize",(()=>{e.params.virtual.enabled&&e.params.cssMode&&g(e.wrapperEl,"--swiper-virtual-size",`${e.virtualSize}px`)})),Object.assign(e.virtual,{appendSlide:function(t){if("object"==typeof t&&"length"in t)for(let s=0;s<t.length;s+=1)t[s]&&e.virtual.slides.push(t[s]);else e.virtual.slides.push(t);r(!0)},prependSlide:function(t){const s=e.activeIndex;let a=s+1,i=1;if(Array.isArray(t)){for(let s=0;s<t.length;s+=1)t[s]&&e.virtual.slides.unshift(t[s]);a=s+t.length,i=t.length}else e.virtual.slides.unshift(t);if(e.params.virtual.cache){const t=e.virtual.cache,s={};Object.keys(t).forEach((e=>{const a=t[e],r=a.attr("data-swiper-slide-index");r&&a.attr("data-swiper-slide-index",parseInt(r,10)+i),s[parseInt(e,10)+i]=a})),e.virtual.cache=s}r(!0),e.slideTo(a,0)},removeSlide:function(t){if(null==t)return;let s=e.activeIndex;if(Array.isArray(t))for(let a=t.length-1;a>=0;a-=1)e.virtual.slides.splice(t[a],1),e.params.virtual.cache&&delete e.virtual.cache[t[a]],t[a]<s&&(s-=1),s=Math.max(s,0);else e.virtual.slides.splice(t,1),e.params.virtual.cache&&delete e.virtual.cache[t],t<s&&(s-=1),s=Math.max(s,0);r(!0),e.slideTo(s,0)},removeAllSlides:function(){e.virtual.slides=[],e.params.virtual.cache&&(e.virtual.cache={}),r(!0),e.slideTo(0,0)},update:r})},function({swiper:e,extendParams:t,on:s,emit:i}){const n=a(),l=r();function o(t){if(!e.enabled)return;const{rtlTranslate:s}=e;let a=t;a.originalEvent&&(a=a.originalEvent);const r=a.keyCode||a.charCode,o=e.params.keyboard.pageUpDown,d=o&&33===r,p=o&&34===r,c=37===r,u=39===r,h=38===r,m=40===r;if(!e.allowSlideNext&&(e.isHorizontal()&&u||e.isVertical()&&m||p))return!1;if(!e.allowSlidePrev&&(e.isHorizontal()&&c||e.isVertical()&&h||d))return!1;if(!(a.shiftKey||a.altKey||a.ctrlKey||a.metaKey||n.activeElement&&n.activeElement.nodeName&&("input"===n.activeElement.nodeName.toLowerCase()||"textarea"===n.activeElement.nodeName.toLowerCase()))){if(e.params.keyboard.onlyInViewport&&(d||p||c||u||h||m)){let t=!1;if(e.$el.parents(`.${e.params.slideClass}`).length>0&&0===e.$el.parents(`.${e.params.slideActiveClass}`).length)return;const a=e.$el,i=a[0].clientWidth,r=a[0].clientHeight,n=l.innerWidth,o=l.innerHeight,d=e.$el.offset();s&&(d.left-=e.$el[0].scrollLeft);const p=[[d.left,d.top],[d.left+i,d.top],[d.left,d.top+r],[d.left+i,d.top+r]];for(let e=0;e<p.length;e+=1){const s=p[e];if(s[0]>=0&&s[0]<=n&&s[1]>=0&&s[1]<=o){if(0===s[0]&&0===s[1])continue;t=!0}}if(!t)return}e.isHorizontal()?((d||p||c||u)&&(a.preventDefault?a.preventDefault():a.returnValue=!1),((p||u)&&!s||(d||c)&&s)&&e.slideNext(),((d||c)&&!s||(p||u)&&s)&&e.slidePrev()):((d||p||h||m)&&(a.preventDefault?a.preventDefault():a.returnValue=!1),(p||m)&&e.slideNext(),(d||h)&&e.slidePrev()),i("keyPress",r)}}function p(){e.keyboard.enabled||(d(n).on("keydown",o),e.keyboard.enabled=!0)}function c(){e.keyboard.enabled&&(d(n).off("keydown",o),e.keyboard.enabled=!1)}e.keyboard={enabled:!1},t({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}}),s("init",(()=>{e.params.keyboard.enabled&&p()})),s("destroy",(()=>{e.keyboard.enabled&&c()})),Object.assign(e.keyboard,{enable:p,disable:c})},function({swiper:e,extendParams:t,on:s,emit:a}){const i=r();let n;t({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null}}),e.mousewheel={enabled:!1};let l,o=u();const p=[];function h(){e.enabled&&(e.mouseEntered=!0)}function m(){e.enabled&&(e.mouseEntered=!1)}function f(t){return!(e.params.mousewheel.thresholdDelta&&t.delta<e.params.mousewheel.thresholdDelta)&&(!(e.params.mousewheel.thresholdTime&&u()-o<e.params.mousewheel.thresholdTime)&&(t.delta>=6&&u()-o<60||(t.direction<0?e.isEnd&&!e.params.loop||e.animating||(e.slideNext(),a("scroll",t.raw)):e.isBeginning&&!e.params.loop||e.animating||(e.slidePrev(),a("scroll",t.raw)),o=(new i.Date).getTime(),!1)))}function g(t){let s=t,i=!0;if(!e.enabled)return;const r=e.params.mousewheel;e.params.cssMode&&s.preventDefault();let o=e.$el;if("container"!==e.params.mousewheel.eventsTarget&&(o=d(e.params.mousewheel.eventsTarget)),!e.mouseEntered&&!o[0].contains(s.target)&&!r.releaseOnEdges)return!0;s.originalEvent&&(s=s.originalEvent);let h=0;const m=e.rtlTranslate?-1:1,g=function(e){let t=0,s=0,a=0,i=0;return"detail"in e&&(s=e.detail),"wheelDelta"in e&&(s=-e.wheelDelta/120),"wheelDeltaY"in e&&(s=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=s,s=0),a=10*t,i=10*s,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(a=e.deltaX),e.shiftKey&&!a&&(a=i,i=0),(a||i)&&e.deltaMode&&(1===e.deltaMode?(a*=40,i*=40):(a*=800,i*=800)),a&&!t&&(t=a<1?-1:1),i&&!s&&(s=i<1?-1:1),{spinX:t,spinY:s,pixelX:a,pixelY:i}}(s);if(r.forceToAxis)if(e.isHorizontal()){if(!(Math.abs(g.pixelX)>Math.abs(g.pixelY)))return!0;h=-g.pixelX*m}else{if(!(Math.abs(g.pixelY)>Math.abs(g.pixelX)))return!0;h=-g.pixelY}else h=Math.abs(g.pixelX)>Math.abs(g.pixelY)?-g.pixelX*m:-g.pixelY;if(0===h)return!0;r.invert&&(h=-h);let v=e.getTranslate()+h*r.sensitivity;if(v>=e.minTranslate()&&(v=e.minTranslate()),v<=e.maxTranslate()&&(v=e.maxTranslate()),i=!!e.params.loop||!(v===e.minTranslate()||v===e.maxTranslate()),i&&e.params.nested&&s.stopPropagation(),e.params.freeMode&&e.params.freeMode.enabled){const t={time:u(),delta:Math.abs(h),direction:Math.sign(h)},i=l&&t.time<l.time+500&&t.delta<=l.delta&&t.direction===l.direction;if(!i){l=void 0,e.params.loop&&e.loopFix();let o=e.getTranslate()+h*r.sensitivity;const d=e.isBeginning,u=e.isEnd;if(o>=e.minTranslate()&&(o=e.minTranslate()),o<=e.maxTranslate()&&(o=e.maxTranslate()),e.setTransition(0),e.setTranslate(o),e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses(),(!d&&e.isBeginning||!u&&e.isEnd)&&e.updateSlidesClasses(),e.params.freeMode.sticky){clearTimeout(n),n=void 0,p.length>=15&&p.shift();const s=p.length?p[p.length-1]:void 0,a=p[0];if(p.push(t),s&&(t.delta>s.delta||t.direction!==s.direction))p.splice(0);else if(p.length>=15&&t.time-a.time<500&&a.delta-t.delta>=1&&t.delta<=6){const s=h>0?.8:.2;l=t,p.splice(0),n=c((()=>{e.slideToClosest(e.params.speed,!0,void 0,s)}),0)}n||(n=c((()=>{l=t,p.splice(0),e.slideToClosest(e.params.speed,!0,void 0,.5)}),500))}if(i||a("scroll",s),e.params.autoplay&&e.params.autoplayDisableOnInteraction&&e.autoplay.stop(),o===e.minTranslate()||o===e.maxTranslate())return!0}}else{const s={time:u(),delta:Math.abs(h),direction:Math.sign(h),raw:t};p.length>=2&&p.shift();const a=p.length?p[p.length-1]:void 0;if(p.push(s),a?(s.direction!==a.direction||s.delta>a.delta||s.time>a.time+150)&&f(s):f(s),function(t){const s=e.params.mousewheel;if(t.direction<0){if(e.isEnd&&!e.params.loop&&s.releaseOnEdges)return!0}else if(e.isBeginning&&!e.params.loop&&s.releaseOnEdges)return!0;return!1}(s))return!0}return s.preventDefault?s.preventDefault():s.returnValue=!1,!1}function v(t){let s=e.$el;"container"!==e.params.mousewheel.eventsTarget&&(s=d(e.params.mousewheel.eventsTarget)),s[t]("mouseenter",h),s[t]("mouseleave",m),s[t]("wheel",g)}function w(){return e.params.cssMode?(e.wrapperEl.removeEventListener("wheel",g),!0):!e.mousewheel.enabled&&(v("on"),e.mousewheel.enabled=!0,!0)}function b(){return e.params.cssMode?(e.wrapperEl.addEventListener(event,g),!0):!!e.mousewheel.enabled&&(v("off"),e.mousewheel.enabled=!1,!0)}s("init",(()=>{!e.params.mousewheel.enabled&&e.params.cssMode&&b(),e.params.mousewheel.enabled&&w()})),s("destroy",(()=>{e.params.cssMode&&w(),e.mousewheel.enabled&&b()})),Object.assign(e.mousewheel,{enable:w,disable:b})},function({swiper:e,extendParams:t,on:s,emit:a}){function i(t){let s;return t&&(s=d(t),e.params.uniqueNavElements&&"string"==typeof t&&s.length>1&&1===e.$el.find(t).length&&(s=e.$el.find(t))),s}function r(t,s){const a=e.params.navigation;t&&t.length>0&&(t[s?"addClass":"removeClass"](a.disabledClass),t[0]&&"BUTTON"===t[0].tagName&&(t[0].disabled=s),e.params.watchOverflow&&e.enabled&&t[e.isLocked?"addClass":"removeClass"](a.lockClass))}function n(){if(e.params.loop)return;const{$nextEl:t,$prevEl:s}=e.navigation;r(s,e.isBeginning&&!e.params.rewind),r(t,e.isEnd&&!e.params.rewind)}function l(t){t.preventDefault(),(!e.isBeginning||e.params.loop||e.params.rewind)&&e.slidePrev()}function o(t){t.preventDefault(),(!e.isEnd||e.params.loop||e.params.rewind)&&e.slideNext()}function p(){const t=e.params.navigation;if(e.params.navigation=Y(e,e.originalParams.navigation,e.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!t.nextEl&&!t.prevEl)return;const s=i(t.nextEl),a=i(t.prevEl);s&&s.length>0&&s.on("click",o),a&&a.length>0&&a.on("click",l),Object.assign(e.navigation,{$nextEl:s,nextEl:s&&s[0],$prevEl:a,prevEl:a&&a[0]}),e.enabled||(s&&s.addClass(t.lockClass),a&&a.addClass(t.lockClass))}function c(){const{$nextEl:t,$prevEl:s}=e.navigation;t&&t.length&&(t.off("click",o),t.removeClass(e.params.navigation.disabledClass)),s&&s.length&&(s.off("
4688click",l),s.removeClass(e.params.navigation.disabledClass))}t({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock"}}),e.navigation={nextEl:null,$nextEl:null,prevEl:null,$prevEl:null},s("init",(()=>{p(),n()})),s("toEdge fromEdge lock unlock",(()=>{n()})),s("destroy",(()=>{c()})),s("enable disable",(()=>{const{$nextEl:t,$prevEl:s}=e.navigation;t&&t[e.enabled?"removeClass":"addClass"](e.params.navigation.lockClass),s&&s[e.enabled?"removeClass":"addClass"](e.params.navigation.lockClass)})),s("click",((t,s)=>{const{$nextEl:i,$prevEl:r}=e.navigation,n=s.target;if(e.params.navigation.hideOnClick&&!d(n).is(r)&&!d(n).is(i)){if(e.pagination&&e.params.pagination&&e.params.pagination.clickable&&(e.pagination.el===n||e.pagination.el.contains(n)))return;let t;i?t=i.hasClass(e.params.navigation.hiddenClass):r&&(t=r.hasClass(e.params.navigation.hiddenClass)),a(!0===t?"navigationShow":"navigationHide"),i&&i.toggleClass(e.params.navigation.hiddenClass),r&&r.toggleClass(e.params.navigation.hiddenClass)}})),Object.assign(e.navigation,{update:n,init:p,destroy:c})},function({swiper:e,extendParams:t,on:s,emit:a}){const i="swiper-pagination";let r;t({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:e=>e,formatFractionTotal:e=>e,bulletClass:`${i}-bullet`,bulletActiveClass:`${i}-bullet-active`,modifierClass:`${i}-`,currentClass:`${i}-current`,totalClass:`${i}-total`,hiddenClass:`${i}-hidden`,progressbarFillClass:`${i}-progressbar-fill`,progressbarOppositeClass:`${i}-progressbar-opposite`,clickableClass:`${i}-clickable`,lockClass:`${i}-lock`,horizontalClass:`${i}-horizontal`,verticalClass:`${i}-vertical`}}),e.pagination={el:null,$el:null,bullets:[]};let n=0;function l(){return!e.params.pagination.el||!e.pagination.el||!e.pagination.$el||0===e.pagination.$el.length}function o(t,s){const{bulletActiveClass:a}=e.params.pagination;t[s]().addClass(`${a}-${s}`)[s]().addClass(`${a}-${s}-${s}`)}function p(){const t=e.rtl,s=e.params.pagination;if(l())return;const i=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,p=e.pagination.$el;let c;const u=e.params.loop?Math.ceil((i-2*e.loopedSlides)/e.params.slidesPerGroup):e.snapGrid.length;if(e.params.loop?(c=Math.ceil((e.activeIndex-e.loopedSlides)/e.params.slidesPerGroup),c>i-1-2*e.loopedSlides&&(c-=i-2*e.loopedSlides),c>u-1&&(c-=u),c<0&&"bullets"!==e.params.paginationType&&(c=u+c)):c=void 0!==e.snapIndex?e.snapIndex:e.activeIndex||0,"bullets"===s.type&&e.pagination.bullets&&e.pagination.bullets.length>0){const a=e.pagination.bullets;let i,l,u;if(s.dynamicBullets&&(r=a.eq(0)[e.isHorizontal()?"outerWidth":"outerHeight"](!0),p.css(e.isHorizontal()?"width":"height",r*(s.dynamicMainBullets+4)+"px"),s.dynamicMainBullets>1&&void 0!==e.previousIndex&&(n+=c-(e.previousIndex-e.loopedSlides||0),n>s.dynamicMainBullets-1?n=s.dynamicMainBullets-1:n<0&&(n=0)),i=Math.max(c-n,0),l=i+(Math.min(a.length,s.dynamicMainBullets)-1),u=(l+i)/2),a.removeClass(["","-next","-next-next","-prev","-prev-prev","-main"].map((e=>`${s.bulletActiveClass}${e}`)).join(" ")),p.length>1)a.each((e=>{const t=d(e),a=t.index();a===c&&t.addClass(s.bulletActiveClass),s.dynamicBullets&&(a>=i&&a<=l&&t.addClass(`${s.bulletActiveClass}-main`),a===i&&o(t,"prev"),a===l&&o(t,"next"))}));else{const t=a.eq(c),r=t.index();if(t.addClass(s.bulletActiveClass),s.dynamicBullets){const t=a.eq(i),n=a.eq(l);for(let e=i;e<=l;e+=1)a.eq(e).addClass(`${s.bulletActiveClass}-main`);if(e.params.loop)if(r>=a.length){for(let e=s.dynamicMainBullets;e>=0;e-=1)a.eq(a.length-e).addClass(`${s.bulletActiveClass}-main`);a.eq(a.length-s.dynamicMainBullets-1).addClass(`${s.bulletActiveClass}-prev`)}else o(t,"prev"),o(n,"next");else o(t,"prev"),o(n,"next")}}if(s.dynamicBullets){const i=Math.min(a.length,s.dynamicMainBullets+4),n=(r*i-r)/2-u*r,l=t?"right":"left";a.css(e.isHorizontal()?l:"top",`${n}px`)}}if("fraction"===s.type&&(p.find(W(s.currentClass)).text(s.formatFractionCurrent(c+1)),p.find(W(s.totalClass)).text(s.formatFractionTotal(u))),"progressbar"===s.type){let t;t=s.progressbarOpposite?e.isHorizontal()?"vertical":"horizontal":e.isHorizontal()?"horizontal":"vertical";const a=(c+1)/u;let i=1,r=1;"horizontal"===t?i=a:r=a,p.find(W(s.progressbarFillClass)).transform(`translate3d(0,
vendor: 5,552 bytes, line 4688
46880,0) scaleX(${i}) scaleY(${r})`).transition(e.params.speed)}"custom"===s.type&&s.renderCustom?(p.html(s.renderCustom(e,c+1,u)),a("paginationRender",p[0])):a("paginationUpdate",p[0]),e.params.watchOverflow&&e.enabled&&p[e.isLocked?"addClass":"removeClass"](s.lockClass)}function c(){const t=e.params.pagination;if(l())return;const s=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,i=e.pagination.$el;let r="";if("bullets"===t.type){let a=e.params.loop?Math.ceil((s-2*e.loopedSlides)/e.params.slidesPerGroup):e.snapGrid.length;e.params.freeMode&&e.params.freeMode.enabled&&!e.params.loop&&a>s&&(a=s);for(let s=0;s<a;s+=1)t.renderBullet?r+=t.renderBullet.call(e,s,t.bulletClass):r+=`<${t.bulletElement} class="${t.bulletClass}"></${t.bulletElement}>`;i.html(r),e.pagination.bullets=i.find(W(t.bulletClass))}"fraction"===t.type&&(r=t.renderFraction?t.renderFraction.call(e,t.currentClass,t.totalClass):`<span class="${t.currentClass}"></span> / <span class="${t.totalClass}"></span>`,i.html(r)),"progressbar"===t.type&&(r=t.renderProgressbar?t.renderProgressbar.call(e,t.progressbarFillClass):`<span class="${t.progressbarFillClass}"></span>`,i.html(r)),"custom"!==t.type&&a("paginationRender",e.pagination.$el[0])}function u(){e.params.pagination=Y(e,e.originalParams.pagination,e.params.pagination,{el:"swiper-pagination"});const t=e.params.pagination;if(!t.el)return;let s=d(t.el);0!==s.length&&(e.params.uniqueNavElements&&"string"==typeof t.el&&s.length>1&&(s=e.$el.find(t.el),s.length>1&&(s=s.filter((t=>d(t).parents(".swiper")[0]===e.el)))),"bullets"===t.type&&t.clickable&&s.addClass(t.clickableClass),s.addClass(t.modifierClass+t.type),s.addClass(t.modifierClass+e.params.direction),"bullets"===t.type&&t.dynamicBullets&&(s.addClass(`${t.modifierClass}${t.type}-dynamic`),n=0,t.dynamicMainBullets<1&&(t.dynamicMainBullets=1)),"progressbar"===t.type&&t.progressbarOpposite&&s.addClass(t.progressbarOppositeClass),t.clickable&&s.on("click",W(t.bulletClass),(function(t){t.preventDefault();let s=d(this).index()*e.params.slidesPerGroup;e.params.loop&&(s+=e.loopedSlides),e.slideTo(s)})),Object.assign(e.pagination,{$el:s,el:s[0]}),e.enabled||s.addClass(t.lockClass))}function h(){const t=e.params.pagination;if(l())return;const s=e.pagination.$el;s.removeClass(t.hiddenClass),s.removeClass(t.modifierClass+t.type),s.removeClass(t.modifierClass+e.params.direction),e.pagination.bullets&&e.pagination.bullets.removeClass&&e.pagination.bullets.removeClass(t.bulletActiveClass),t.clickable&&s.off("click",W(t.bulletClass))}s("init",(()=>{u(),c(),p()})),s("activeIndexChange",(()=>{(e.params.loop||void 0===e.snapIndex)&&p()})),s("snapIndexChange",(()=>{e.params.loop||p()})),s("slidesLengthChange",(()=>{e.params.loop&&(c(),p())})),s("snapGridLengthChange",(()=>{e.params.loop||(c(),p())})),s("destroy",(()=>{h()})),s("enable disable",(()=>{const{$el:t}=e.pagination;t&&t[e.enabled?"removeClass":"addClass"](e.params.pagination.lockClass)})),s("lock unlock",(()=>{p()})),s("click",((t,s)=>{const i=s.target,{$el:r}=e.pagination;if(e.params.pagination.el&&e.params.pagination.hideOnClick&&r.length>0&&!d(i).hasClass(e.params.pagination.bulletClass)){if(e.navigation&&(e.navigation.nextEl&&i===e.navigation.nextEl||e.navigation.prevEl&&i===e.navigation.prevEl))return;const t=r.hasClass(e.params.pagination.hiddenClass);a(!0===t?"paginationShow":"paginationHide"),r.toggleClass(e.params.pagination.hiddenClass)}})),Object.assign(e.pagination,{render:c,update:p,init:u,destroy:h})},function({swiper:e,extendParams:t,on:s,emit:i}){const r=a();let n,l,o,p,u=!1,h=null,m=null;function f(){if(!e.params.scrollbar.el||!e.scrollbar.el)return;const{scrollbar:t,rtlTranslate:s,progress:a}=e,{$dragEl:i,$el:r}=t,n=e.params.scrollbar;let d=l,p=(o-l)*a;s?(p=-p,p>0?(d=l-p,p=0):-p+l>o&&(d=o+p)):p<0?(d=l+p,p=0):p+l>o&&(d=o-p),e.isHorizontal()?(i.transform(`translate3d(${p}px, 0, 0)`),i[0].style.width=`${d}px`):(i.transform(`translate3d(0px, ${p}px, 0)`),i[0].style.height=`${d}px`),n.hide&&(clearTimeout(h),r[0].style.opacity=1,h=setTimeout((()=>{r[0].style.opacity=0,r.transition(400)}),1e3))}function g(){if(!e.params.scrollbar.el||!e.scrollbar.el)return;const{scrollbar:t}=e,{$dragEl:s,$el:a}=t;s[0].style.width="",s[0].style.height="",o=e.isHorizontal()?a[0].offsetWidth:a[0].offsetHeight,p=e.size/(e.virtualSize+e.params.slidesOffsetBefore-(e.params.centeredSlides?e.snapGrid[0]:0)),l="auto"===e.params.scrollbar.dragSize?o*p:parseInt(e.params.scrollbar.dragSize,10),e.isHorizontal()?s[0].style.width=`${l}px`:s[0].style.height=`${l}px`,a[0].style.display=p>=1?"none":"",e.params.scrollbar.hide&&(a[0].style.opacity=0),e.params.watchOverflow&&e.enabled&&t.$el[e.isLocked?"addClass":"removeClass"](e.params.scrollbar.lockClass)}function v(t){return e.isHorizontal()?"touchstart"===t.type||"touchmove"===t.type?t.targetTouches[0].clientX:t.clientX:"touchstart"===t.type||"touchmove"===t.type?t.targetTouches[0].clientY:t.clientY}function w(t){const{scrollbar:s,rtlTranslate:a}=e,{$el:i}=s;let r;r=(v(t)-i.offset()[e.isHorizontal()?"left":"top"]-(null!==n?n:l/2))/(o-l),r=Math.max(Math.min(r,1),0),a&&(r=1-r);const d=e.minTranslate()+(e.maxTranslate()-e.minTranslate())*r;e.updateProgress(d),e.setTranslate(d),e.updateActiveIndex(),e.updateSlidesClasses()}function b(t){const s=e.params.scrollbar,{scrollbar:a,$wrapperEl:r}=e,{$el:l,$dragEl:o}=a;u=!0,n=t.target===o[0]||t.target===o?v(t)-t.target.getBoundingClientRect()[e.isHorizontal()?"left":"top"]:null,t.preventDefault(),t.stopPropagation(),r.transition(100),o.transition(100),w(t),
vendor: 6,191 bytes, line 4688
4688clearTimeout(m),l.transition(0),s.hide&&l.css("opacity",1),e.params.cssMode&&e.$wrapperEl.css("scroll-snap-type","none"),i("scrollbarDragStart",t)}function x(t){const{scrollbar:s,$wrapperEl:a}=e,{$el:r,$dragEl:n}=s;u&&(t.preventDefault?t.preventDefault():t.returnValue=!1,w(t),a.transition(0),r.transition(0),n.transition(0),i("scrollbarDragMove",t))}function y(t){const s=e.params.scrollbar,{scrollbar:a,$wrapperEl:r}=e,{$el:n}=a;u&&(u=!1,e.params.cssMode&&(e.$wrapperEl.css("scroll-snap-type",""),r.transition("")),s.hide&&(clearTimeout(m),m=c((()=>{n.css("opacity",0),n.transition(400)}),1e3)),i("scrollbarDragEnd",t),s.snapOnRelease&&e.slideToClosest())}function E(t){const{scrollbar:s,touchEventsTouch:a,touchEventsDesktop:i,params:n,support:l}=e,o=s.$el[0],d=!(!l.passiveListener||!n.passiveListeners)&&{passive:!1,capture:!1},p=!(!l.passiveListener||!n.passiveListeners)&&{passive:!0,capture:!1};if(!o)return;const c="on"===t?"addEventListener":"removeEventListener";l.touch?(o[c](a.start,b,d),o[c](a.move,x,d),o[c](a.end,y,p)):(o[c](i.start,b,d),r[c](i.move,x,d),r[c](i.end,y,p))}function T(){const{scrollbar:t,$el:s}=e;e.params.scrollbar=Y(e,e.originalParams.scrollbar,e.params.scrollbar,{el:"swiper-scrollbar"});const a=e.params.scrollbar;if(!a.el)return;let i=d(a.el);e.params.uniqueNavElements&&"string"==typeof a.el&&i.length>1&&1===s.find(a.el).length&&(i=s.find(a.el));let r=i.find(`.${e.params.scrollbar.dragClass}`);0===r.length&&(r=d(`<div class="${e.params.scrollbar.dragClass}"></div>`),i.append(r)),Object.assign(t,{$el:i,el:i[0],$dragEl:r,dragEl:r[0]}),a.draggable&&e.params.scrollbar.el&&E("on"),i&&i[e.enabled?"removeClass":"addClass"](e.params.scrollbar.lockClass)}function C(){e.params.scrollbar.el&&E("off")}t({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag"}}),e.scrollbar={el:null,dragEl:null,$el:null,$dragEl:null},s("init",(()=>{T(),g(),f()})),s("update resize observerUpdate lock unlock",(()=>{g()})),s("setTranslate",(()=>{f()})),s("setTransition",((t,s)=>{!function(t){e.params.scrollbar.el&&e.scrollbar.el&&e.scrollbar.$dragEl.transition(t)}(s)})),s("enable disable",(()=>{const{$el:t}=e.scrollbar;t&&t[e.enabled?"removeClass":"addClass"](e.params.scrollbar.lockClass)})),s("destroy",(()=>{C()})),Object.assign(e.scrollbar,{updateSize:g,setTranslate:f,init:T,destroy:C})},function({swiper:e,extendParams:t,on:s}){t({parallax:{enabled:!1}});const a=(t,s)=>{const{rtl:a}=e,i=d(t),r=a?-1:1,n=i.attr("data-swiper-parallax")||"0";let l=i.attr("data-swiper-parallax-x"),o=i.attr("data-swiper-parallax-y");const p=i.attr("data-swiper-parallax-scale"),c=i.attr("data-swiper-parallax-opacity");if(l||o?(l=l||"0",o=o||"0"):e.isHorizontal()?(l=n,o="0"):(o=n,l="0"),l=l.indexOf("%")>=0?parseInt(l,10)*s*r+"%":l*s*r+"px",o=o.indexOf("%")>=0?parseInt(o,10)*s+"%":o*s+"px",null!=c){const e=c-(c-1)*(1-Math.abs(s));i[0].style.opacity=e}if(null==p)i.transform(`translate3d(${l}, ${o}, 0px)`);else{const e=p-(p-1)*(1-Math.abs(s));i.transform(`translate3d(${l}, ${o}, 0px) scale(${e})`)}},i=()=>{const{$el:t,slides:s,progress:i,snapGrid:r}=e;t.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((e=>{a(e,i)})),s.each(((t,s)=>{let n=t.progress;e.params.slidesPerGroup>1&&"auto"!==e.params.slidesPerView&&(n+=Math.ceil(s/2)-i*(r.length-1)),n=Math.min(Math.max(n,-1),1),d(t).find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((e=>{a(e,n)}))}))};s("beforeInit",(()=>{e.params.parallax.enabled&&(e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0)})),s("init",(()=>{e.params.parallax.enabled&&i()})),s("setTranslate",(()=>{e.params.parallax.enabled&&i()})),s("setTransition",((t,s)=>{e.params.parallax.enabled&&((t=e.params.speed)=>{const{$el:s}=e;s.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((e=>{const s=d(e);let a=parseInt(s.attr("data-swiper-parallax-duration"),10)||t;0===t&&(a=0),s.transition(a)}))})(s)}))},function({swiper:e,extendParams:t,on:s,emit:a}){const i=r();t({zoom:{enabled:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),e.zoom={enabled:!1};let n,l,o,p=1,c=!1;const u={$slideEl:void 0,slideWidth:void 0,slideHeight:void 0,$imageEl:void 0,$imageWrapEl:void 0,maxRatio:3},m={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},f={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let g=1;function v(e){if(e.targetTouches.length<2)return 1;const t=e.targetTouches[0].pageX,s=e.targetTouches[0].pageY,a=e.targetTouches[1].pageX,i=e.targetTouches[1].pageY;return Math.sqrt((a-t)**2+(i-s)**2)}function w(t){const s=e.support,a=e.params.zoom;if(l=!1,o=!1,!s.gestures){if("touchstart"!==t.type||"touchstart"===t.type&&t.targetTouches.length<2)return;l=!0,u.scaleStart=v(t)}u.$slideEl&&u.$slideEl.length||(u.$slideEl=d(t.target).closest(`.${e.params.slideClass}`),0===u.$slideEl.length&&(u.$slideEl=e.slides.eq(e.activeIndex)),u.$imageEl=u.$slideEl.find(`.${a.containerClass}`).eq(0).find("picture, img, svg, canvas, .swiper-zoom-target").eq(0),u.$imageWrapEl=u.$imageEl.parent(`.${a.containerClass}`),u.maxRatio=u.$imageWrapEl.attr("data-swiper-zoom")||a.maxRatio,0!==u.$imageWrapEl.length)?(u.$imageEl&&u.$imageEl.transition(0),c=!0):u.$imageEl=void 0}function b(t){const s=e.support,a=e.params.zoom,i=e.zoom;if(!s.gestures){if("touchmove"!==t.type||"touchmove"===t.type&&t.targetTouches.length<2)return;o=!0,u.scaleMove=v(t)}u.$imageEl&&0!==u.$imageEl.length?(s.gestures?i.scale=t.scale*p:i.scale=u.scaleMove/u.scaleStart*p,i.scale>u.maxRatio&&(i.scale=u.maxRatio-1+(i.scale-u.maxRatio+1)**.5),i.scale<a.minRatio&&(i.scale=a.minRatio+1-(a.minRatio-i.scale+1)**.5),u.$imageEl.transform(`translate3d(0,
46880,0) scale(${i.scale})`)):"gesturechange"===t.type&&w(t)}function x(t){const s=e.device,a=e.support,i=e.params.zoom,r=e.zoom;if(!a.gestures){if(!l||!o)return;if("touchend"!==t.type||"touchend"===t.type&&t.changedTouches.length<2&&!s.android)return;l=!1,o=!1}u.$imageEl&&0!==u.$imageEl.length&&(r.scale=Math.max(Math.min(r.scale,u.maxRatio),i.minRatio),u.$imageEl.transition(e.params.speed).transform(`translate3d(0,0,0) scale(${r.scale})`),p=r.scale,c=!1,1===r.scale&&(u.$slideEl=void 0))}function y(t){const s=e.zoom;if(!u.$imageEl||0===u.$imageEl.length)return;if(e.allowClick=!1,!m.isTouched||!u.$slideEl)return;m.isMoved||(m.width=u.$imageEl[0].offsetWidth,m.height=u.$imageEl[0].offsetHeight,m.startX=h(u.$imageWrapEl[0],"x")||0,m.startY=h(u.$imageWrapEl[0],"y")||0,u.slideWidth=u.$slideEl[0].offsetWidth,u.slideHeight=u.$slideEl[0].offsetHeight,u.$imageWrapEl.transition(0));const a=m.width*s.scale,i=m.height*s.scale;if(!(a<u.slideWidth&&i<u.slideHeight)){if(m.minX=Math.min(u.slideWidth/2-a/2,0),m.maxX=-m.minX,m.minY=Math.min(u.slideHeight/2-i/2,0),m.maxY=-m.minY,m.touchesCurrent.x="touchmove"===t.type?t.targetTouches[0].pageX:t.pageX,m.touchesCurrent.y="touchmove"===t.type?t.targetTouches[0].pageY:t.pageY,!m.isMoved&&!c){if(e.isHorizontal()&&(Math.floor(m.minX)===Math.floor(m.startX)&&m.touchesCurrent.x<m.touchesStart.x||Math.floor(m.maxX)===Math.floor(m.startX)&&m.touchesCurrent.x>m.touchesStart.x))return void(m.isTouched=!1);if(!e.isHorizontal()&&(Math.floor(m.minY)===Math.floor(m.startY)&&m.touchesCurrent.y<m.touchesStart.y||Math.floor(m.maxY)===Math.floor(m.startY)&&m.touchesCurrent.y>m.touchesStart.y))return void(m.isTouched=!1)}t.cancelable&&t.preventDefault(),t.stopPropagation(),m.isMoved=!0,m.currentX=m.touchesCurrent.x-m.touchesStart.x+m.startX,m.currentY=m.touchesCurrent.y-m.touchesStart.y+m.startY,m.currentX<m.minX&&(m.currentX=m.minX+1-(m.minX-m.currentX+1)**.8),m.currentX>m.maxX&&(m.currentX=m.maxX-1+(m.currentX-m.maxX+1)**.8),m.currentY<m.minY&&(m.currentY=m.minY+1-(m.minY-m.currentY+1)**.8),m.currentY>m.maxY&&(m.currentY=m.maxY-1+(m.currentY-m.maxY+1)**.8),f.prevPositionX||(f.prevPositionX=m.touchesCurrent.x),f.prevPositionY||(f.prevPositionY=m.touchesCurrent.y),f.prevTime||(f.prevTime=Date.now()),f.x=(m.touchesCurrent.x-f.prevPositionX)/(Date.now()-f.prevTime)/2,f.y=(m.touchesCurrent.y-f.prevPositionY)/(Date.now()-f.prevTime)/2,Math.abs(m.touchesCurrent.x-f.prevPositionX)<2&&(f.x=0),Math.abs(m.touchesCurrent.y-f.prevPositionY)<2&&(f.y=0),f.prevPositionX=m.touchesCurrent.x,f.prevPositionY=m.touchesCurrent.y,f.prevTime=Date.now(),u.$imageWrapEl.transform(`translate3d(${m.currentX}px, ${m.currentY}px,0)`)}}function E(){const t=e.zoom;u.$slideEl&&e.previousIndex!==e.activeIndex&&(u.$imageEl&&u.$imageEl.transform("translate3d(0,0,0) scale(1)"),u.$imageWrapEl&&u.$imageWrapEl.transform("translate3d(0,0,0)"),t.scale=1,p=1,u.$slideEl=void 0,u.$imageEl=void 0,u.$imageWrapEl=void 0)}function T(t){const s=e.zoom,a=e.params.zoom;if(u.$slideEl||(t&&t.target&&(u.$slideEl=d(t.target).closest(`.${e.params.slideClass}`)),u.$slideEl||(e.params.virtual&&e.params.virtual.enabled&&e.virtual?u.$slideEl=e.$wrapperEl.children(`.${e.params.slideActiveClass}`):u.$slideEl=e.slides.eq(e.activeIndex)),u.$imageEl=u.$slideEl.find(`.${a.containerClass}`).eq(0).find("picture, img, svg, canvas, .swiper-zoom-target").eq(0),u.$imageWrapEl=u.$imageEl.parent(`.${a.containerClass}`)),!u.$imageEl||0===u.$imageEl.length||!u.$imageWrapEl||0===u.$imageWrapEl.length)return;let r,n,l,o,c,h,f,g,v,w,b,x,y,E,T,C,$,S;e.params.cssMode&&(e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.touchAction="none"),u.$slideEl.addClass(`${a.zoomedSlideClass}`),void 0===m.touchesStart.x&&t?(r="touchend"===t.type?t.changedTouches[0].pageX:t.pageX,n="touchend"===t.type?t.changedTouches[0].pageY:t.pageY):(r=m.touchesStart.x,n=m.touchesStart.y),s.scale=u.$imageWrapEl.attr("data-swiper-zoom")||a.maxRatio,p=u.$imageWrapEl.attr("data-swiper-zoom")||a.maxRatio,t?($=u.$slideEl[0].offsetWidth,S=u.$slideEl[0].offsetHeight,l=u.$slideEl.offset().left+i.scrollX,o=u.$slideEl.offset().top+i.scrollY,c=l+$/2-r,h=o+S/2-n,v=u.$imageEl[0].offsetWidth,w=u.$imageEl[0].offsetHeight,b=v*s.scale,x=w*s.scale,y=Math.min($/2-b/2,0),E=Math.min(S/2-x/2,0),T=-y,C=-E,f=c*s.scale,g=h*s.scale,f<y&&(f=y),f>T&&(f=T),g<E&&(g=E),g>C&&(g=C)):(f=0,g=0),u.$imageWrapEl.transition(300).transform(`translate3d(${f}px, ${g}
4688px,0)`),u.$imageEl.transition(300).transform(`translate3d(0,0,0) scale(${s.scale})`)}function C(){const t=e.zoom,s=e.params.zoom;u.$slideEl||(e.params.virtual&&e.params.virtual.enabled&&e.virtual?u.$slideEl=e.$wrapperEl.children(`.${e.params.slideActiveClass}`):u.$slideEl=e.slides.eq(e.activeIndex),u.$imageEl=u.$slideEl.find(`.${s.containerClass}`).eq(0).find("picture, img, svg, canvas, .swiper-zoom-target").eq(0),u.$imageWrapEl=u.$imageEl.parent(`.${s.containerClass}`)),u.$imageEl&&0!==u.$imageEl.length&&u.$imageWrapEl&&0!==u.$imageWrapEl.length&&(e.params.cssMode&&(e.wrapperEl.style.overflow="",e.wrapperEl.style.touchAction=""),t.scale=1,p=1,u.$imageWrapEl.transition(300).transform("translate3d(0,0,0)"),u.$imageEl.transition(300).transform("translate3d(0,0,0) scale(1)"),u.$slideEl.removeClass(`${s.zoomedSlideClass}`),u.$slideEl=void 0)}function $(t){const s=e.zoom;s.scale&&1!==s.scale?C():T(t)}function S(){const t=e.support;return{passiveListener:!("touchstart"!==e.touchEvents.start||!t.passiveListener||!e.params.passiveListeners)&&{passive:!0,capture:!1},activeListenerWithCapture:!t.passiveListener||{passive:!1,capture:!0}}}function M(){return`.${e.params.slideClass}`}function P(t){const{passiveListener:s}=S(),a=M();e.$wrapperEl[t]("gesturestart",a,w,s),e.$wrapperEl[t]("gesturechange",a,b,s),e.$wrapperEl[t]("gestureend",a,x,s)}function k(){n||(n=!0,P("on"))}function z(){n&&(n=!1,P("off"))}function O(){const t=e.zoom;if(t.enabled)return;t.enabled=!0;const s=e.support,{passiveListener:a,activeListenerWithCapture:i}=S(),r=M();s.gestures?(e.$wrapperEl.on(e.touchEvents.start,k,a),e.$wrapperEl.on(e.touchEvents.end,z,a)):"touchstart"===e.touchEvents.start&&(e.$wrapperEl.on(e.touchEvents.start,r,w,a),e.$wrapperEl.on(e.touchEvents.move,r,b,i),e.$wrapperEl.on(e.touchEvents.end,r,x,a),e.touchEvents.cancel&&e.$wrapperEl.on(e.touchEvents.cancel,r,x,a)),e.$wrapperEl.on(e.touchEvents.move,`.${e.params.zoom.containerClass}`,y,i)}function I(){const t=e.zoom;if(!t.enabled)return;const s=e.support;t.enabled=!1;const{passiveListener:a,activeListenerWithCapture:i}=S(),r=M();s.gestures?(e.$wrapperEl.off(e.touchEvents.start,k,a),e.$wrapperEl.off(e.touchEvents.end,z,a)):"touchstart"===e.touchEvents.start&&(e.$wrapperEl.off(e.touchEvents.start,r,w,a),e.$wrapperEl.off(e.touchEvents.move,r,b,i),e.$wrapperEl.off(e.touchEvents.end,r,x,a),e.touchEvents.cancel&&e.$wrapperEl.off(e.touchEvents.cancel,r,x,a)),e.$wrapperEl.off(e.touchEvents.move,`.${e.params.zoom.containerClass}`,y,i)}Object.defineProperty(e.zoom,"scale",{get:()=>g,set(e){if(g!==e){const t=u.$imageEl?u.$imageEl[0]:void 0,s=u.$slideEl?u.$slideEl[0]:void 0;a("zoomChange",e,t,s)}g=e}}),s("init",(()=>{e.params.zoom.enabled&&O()})),s("destroy",(()=>{I()})),s("touchStart",((t,s)=>{e.zoom.enabled&&function(t){const s=e.device;u.$imageEl&&0!==u.$imageEl.length&&(m.isTouched||(s.android&&t.cancelable&&t.preventDefault(),m.isTouched=!0,m.touchesStart.x="touchstart"===t.type?t.targetTouches[0].pageX:t.pageX,m.touchesStart.y="touchstart"===t.type?t.targetTouches[0].pageY:t.pageY))}(s)})),s("touchEnd",((t,s)=>{e.zoom.enabled&&function(){const t=e.zoom;if(!u.$imageEl||0===u.$imageEl.length)return;if(!m.isTouched||!m.isMoved)return m.isTouched=!1,void(m.isMoved=!1);m.isTouched=!1,m.isMoved=!1;let s=300,a=300;const i=f.x*s,r=m.currentX+i,n=f.y*a,l=m.currentY+n;0!==f.x&&(s=Math.abs((r-m.currentX)/f.x)),0!==f.y&&(a=Math.abs((l-m.currentY)/f.y));const o=Math.max(s,a);m.currentX=r,m.currentY=l;const d=m.width*t.scale,p=m.height*t.scale;m.minX=Math.min(u.slideWidth/2-d/2,0),m.maxX=-m.minX,m.minY=Math.min(u.slideHeight/2-p/2,0),m.maxY=-m.minY,m.currentX=Math.max(Math.min(m.currentX,m.maxX),m.minX),m.currentY=Math.max(Math.min(m.currentY,m.maxY),m.minY),u.$imageWrapEl.transition(o).transform(`translate3d(${m.currentX}px, ${m.currentY}px,0)`)}()})),s("doubleTap",((t,s)=>{!e.animating&&e.params.zoom.enabled&&e.zoom.enabled&&e.params.zoom.toggle&&$(s)})),s("transitionEnd",(()=>{e.zoom.enabled&&e.params.zoom.enabled&&E()})),s("slideChange",(()=>{e.zoom.enabled&&e.params.zoom.enabled&&e.params.cssMode&&E()})),Object.assign(e.zoom,{enable:O,disable:I,in:T,out:C,toggle:$})},function({swiper:e,extendParams:t,on:s,emit:a}){t({lazy:{checkInView:!1,enabled:!1,loadPrevNext:!1,loadPrevNextAmount:1,loadOnTransitionStart:!1,scrollingElement:"",elementClass:"swiper-lazy",loadingClass:"swiper-lazy-loading",loadedClass:"swiper-lazy-loaded",preloaderClass:"swiper-lazy-preloader"}}),e.lazy={};let i=!1,n=!1;function l(t,s=!0){const i=e.params.lazy;if(void 0===t)return;if(0===e.slides.length)return;const r=e.virtual&&e.params.virtual.enabled?e.$wrapperEl.children(`.${e.params.slideClass}[data-swiper-slide-index="${t}"]`):e.slides.eq(t),n=r.find(`.${i.elementClass}:not(.${i.loadedClass}):not(.${i.loadingClass})`);!r.hasClass(i.elementClass)||r.hasClass(i.loadedClass)||r.hasClass(i.loadingClass)||n.push(r[0]),0!==n.length&&n.each((t=>{const n=d(t);n.addClass(i.loadingClass);const o=n.attr("data-background"),p=n.attr("data-src"),c=n.attr("data-srcset"),u=n.attr("data-sizes"),h=n.parent("picture");e.loadImage(n[0],p||o,c,u,!1,(()=>
vendor: 34,792 bytes, lines 4688-4730
4688{if(null!=e&&e&&(!e||e.params)&&!e.destroyed){if(o?(n.css("background-image",`url("${o}")`),n.removeAttr("data-background")):(c&&(n.attr("srcset",c),n.removeAttr("data-srcset")),u&&(n.attr("sizes",u),n.removeAttr("data-sizes")),h.length&&h.children("source").each((e=>{const t=d(e);t.attr("data-srcset")&&(t.attr("srcset",t.attr("data-srcset")),t.removeAttr("data-srcset"))})),p&&(n.attr("src",p),n.removeAttr("data-src"))),n.addClass(i.loadedClass).removeClass(i.loadingClass),r.find(`.${i.preloaderClass}`).remove(),e.params.loop&&s){const t=r.attr("data-swiper-slide-index");if(r.hasClass(e.params.slideDuplicateClass)){l(e.$wrapperEl.children(`[data-swiper-slide-index="${t}"]:not(.${e.params.slideDuplicateClass})`).index(),!1)}else{l(e.$wrapperEl.children(`.${e.params.slideDuplicateClass}[data-swiper-slide-index="${t}"]`).index(),!1)}}a("lazyImageReady",r[0],n[0]),e.params.autoHeight&&e.updateAutoHeight()}})),a("lazyImageLoad",r[0],n[0])}))}function o(){const{$wrapperEl:t,params:s,slides:a,activeIndex:i}=e,r=e.virtual&&s.virtual.enabled,o=s.lazy;let p=s.slidesPerView;function c(e){if(r){if(t.children(`.${s.slideClass}[data-swiper-slide-index="${e}"]`).length)return!0}else if(a[e])return!0;return!1}function u(e){return r?d(e).attr("data-swiper-slide-index"):d(e).index()}if("auto"===p&&(p=0),n||(n=!0),e.params.watchSlidesProgress)t.children(`.${s.slideVisibleClass}`).each((e=>{l(r?d(e).attr("data-swiper-slide-index"):d(e).index())}));else if(p>1)for(let e=i;e<i+p;e+=1)c(e)&&l(e);else l(i);if(o.loadPrevNext)if(p>1||o.loadPrevNextAmount&&o.loadPrevNextAmount>1){const e=o.loadPrevNextAmount,t=p,s=Math.min(i+t+Math.max(e,t),a.length),r=Math.max(i-Math.max(t,e),0);for(let e=i+p;e<s;e+=1)c(e)&&l(e);for(let e=r;e<i;e+=1)c(e)&&l(e)}else{const e=t.children(`.${s.slideNextClass}`);e.length>0&&l(u(e));const a=t.children(`.${s.slidePrevClass}`);a.length>0&&l(u(a))}}function p(){const t=r();if(!e||e.destroyed)return;const s=e.params.lazy.scrollingElement?d(e.params.lazy.scrollingElement):d(t),a=s[0]===t,n=a?t.innerWidth:s[0].offsetWidth,l=a?t.innerHeight:s[0].offsetHeight,c=e.$el.offset(),{rtlTranslate:u}=e;let h=!1;u&&(c.left-=e.$el[0].scrollLeft);const m=[[c.left,c.top],[c.left+e.width,c.top],[c.left,c.top+e.height],[c.left+e.width,c.top+e.height]];for(let e=0;e<m.length;e+=1){const t=m[e];if(t[0]>=0&&t[0]<=n&&t[1]>=0&&t[1]<=l){if(0===t[0]&&0===t[1])continue;h=!0}}const f=!("touchstart"!==e.touchEvents.start||!e.support.passiveListener||!e.params.passiveListeners)&&{passive:!0,capture:!1};h?(o(),s.off("scroll",p,f)):i||(i=!0,s.on("scroll",p,f))}s("beforeInit",(()=>{e.params.lazy.enabled&&e.params.preloadImages&&(e.params.preloadImages=!1)})),s("init",(()=>{e.params.lazy.enabled&&(e.params.lazy.checkInView?p():o())})),s("scroll",(()=>{e.params.freeMode&&e.params.freeMode.enabled&&!e.params.freeMode.sticky&&o()})),s("scrollbarDragMove resize _freeModeNoMomentumRelease",(()=>{e.params.lazy.enabled&&(e.params.lazy.checkInView?p():o())})),s("transitionStart",(()=>{e.params.lazy.enabled&&(e.params.lazy.loadOnTransitionStart||!e.params.lazy.loadOnTransitionStart&&!n)&&(e.params.lazy.checkInView?p():o())})),s("transitionEnd",(()=>{e.params.lazy.enabled&&!e.params.lazy.loadOnTransitionStart&&(e.params.lazy.checkInView?p():o())})),s("slideChange",(()=>{const{lazy:t,cssMode:s,watchSlidesProgress:a,touchReleaseOnEdges:i,resistanceRatio:r}=e.params;t.enabled&&(s||a&&(i||0===r))&&o()})),Object.assign(e.lazy,{load:o,loadInSlide:l})},function({swiper:e,extendParams:t,on:s}){function a(e,t){const s=function(){let e,t,s;return(a,i)=>{for(t=-1,e=a.length;e-t>1;)s=e+t>>1,a[s]<=i?t=s:e=s;return e}}();let a,i;return this.x=e,this.y=t,this.lastIndex=e.length-1,this.interpolate=function(e){return e?(i=s(this.x,e),a=i-1,(e-this.x[a])*(this.y[i]-this.y[a])/(this.x[i]-this.x[a])+this.y[a]):0},this}function i(){e.controller.control&&e.controller.spline&&(e.controller.spline=void 0,delete e.controller.spline)}t({controller:{control:void 0,inverse:!1,by:"slide"}}),e.controller={control:void 0},s("beforeInit",(()=>{e.controller.control=e.params.controller.control})),s("update",(()=>{i()})),s("resize",(()=>{i()})),s("observerUpdate",(()=>{i()})),s("setTranslate",((t,s,a)=>{e.controller.control&&e.controller.setTranslate(s,a)})),s("setTransition",((t,s,a)=>{e.controller.control&&e.controller.setTransition(s,a)})),Object.assign(e.controller,{setTranslate:function(t,s){const i=e.controller.control;let r,n;const l=e.constructor;function o(t){const s=e.rtlTranslate?-e.translate:e.translate;"slide"===e.params.controller.by&&(!function(t){e.controller.spline||(e.controller.spline=e.params.loop?new a(e.slidesGrid,t.slidesGrid):new a(e.snapGrid,t.snapGrid))}(t),n=-e.controller.spline.interpolate(-s)),n&&"container"!==e.params.controller.by||(r=(t.maxTranslate()-t.minTranslate())/(e.maxTranslate()-e.minTranslate()),n=(s-e.minTranslate())*r+t.minTranslate()),e.params.controller.inverse&&(n=t.maxTranslate()-n),t.updateProgress(n),t.setTranslate(n,e),t.updateActiveIndex(),t.updateSlidesClasses()}if(Array.isArray(i))for(let e=0;e<i.length;e+=1)i[e]!==s&&i[e]instanceof l&&o(i[e]);else i instanceof l&&s!==i&&o(i)},setTransition:function(t,s){const a=e.constructor,i=e.controller.control;let r;function n(s){s.setTransition(t,e),0!==t&&(s.transitionStart(),s.params.autoHeight&&c((()=>{s.updateAutoHeight()})),s.$wrapperEl.transitionEnd((()=>{i&&(s.params.loop&&"slide"===e.params.controller.by&&s.loopFix(),s.transitionEnd())})))}if(Array.isArray(i))for(r=0;r<i.length;r+=1)i[r]!==s&&i[r]instanceof a&&n(i[r]);else i instanceof a&&s!==i&&n(i)}})},function({swiper:e,extendParams:t,on:s}){t({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,itemRoleDescriptionMessage:null,slideRole:"group"}});let a=null;function i(e){const t=a;0!==t.length&&(t.html(""),t.html(e))}function r(e){e.attr("tabIndex","0")}function n(e){e.attr("tabIndex","-1")}function l(e,t){e.attr("role",t)}function o(e,t){e.attr("aria-roledescription",t)}function p(e,t){e.attr("aria-label",t)}function c(e){e.attr("aria-disabled",!0)}function u(e){e.attr("aria-disabled",!1)}function h(t){if(13!==t.keyCode&&32!==t.keyCode)return;const s=e.params.a11y,a=d(t.target);e.navigation&&e.navigation.$nextEl&&a.is(e.navigation.$nextEl)&&(e.isEnd&&!e.params.loop||e.slideNext(),e.isEnd?i(s.lastSlideMessage):i(s.nextSlideMessage)),e.navigation&&e.navigation.$prevEl&&a.is(e.navigation.$prevEl)&&(e.isBeginning&&!e.params.loop||e.slidePrev(),e.isBeginning?i(s.firstSlideMessage):i(s.prevSlideMessage)),e.pagination&&a.is(W(e.params.pagination.bulletClass))&&a[0].click()}function m(){if(e.params.loop||e.params.rewind||!e.navigation)return;const{$nextEl:t,$prevEl:s}=e.navigation;s&&s.length>0&&(e.isBeginning?(c(s),n(s)):(u(s),r(s))),t&&t.length>0&&(e.isEnd?(c(t),n(t)):(u(t),r(t)))}function f(){return e.pagination&&e.pagination.bullets&&e.pagination.bullets.length}function g(){return f()&&e.params.pagination.clickable}const v=(e,t,s)=>{r(e),"BUTTON"!==e[0].tagName&&(l(e,"button"),e.on("keydown",h)),p(e,s),function(e,t){e.attr("aria-controls",t)}(e,t)};function w(){const t=e.params.a11y;e.$el.append(a);const s=e.$el;t.containerRoleDescriptionMessage&&o(s,t.containerRoleDescriptionMessage),t.containerMessage&&p(s,t.containerMessage);const i=e.$wrapperEl,r=i.attr("id")||`swiper-wrapper-${function(e=16){return"x".repeat(e).replace(/x/g,(()=>Math.round(16*Math.random()).toString(16)))}(16)}`,n=e.params.autoplay&&e.params.autoplay.enabled?"off":"polite";var c;c=r,i.attr("id",c),function(e,t){e.attr("aria-live",t)}(i,n),t.itemRoleDescriptionMessage&&o(d(e.slides),t.itemRoleDescriptionMessage),l(d(e.slides),t.slideRole);const u=e.params.loop?e.slides.filter((t=>!t.classList.contains(e.params.slideDuplicateClass))).length:e.slides.length;let m,f;e.slides.each(((s,a)=>{const i=d(s),r=e.params.loop?parseInt(i.attr("data-swiper-slide-index"),10):a;p(i,t.slideLabelMessage.replace(/\{\{index\}\}/,r+1).replace(/\{\{slidesLength\}\}/,u))})),e.navigation&&e.navigation.$nextEl&&(m=e.navigation.$nextEl),e.navigation&&e.navigation.$prevEl&&(f=e.navigation.$prevEl),m&&m.length&&v(m,r,t.nextSlideMessage),f&&f.length&&v(f,r,t.prevSlideMessage),g()&&e.pagination.$el.on("keydown",W(e.params.pagination.bulletClass),h)}s("beforeInit",(()=>{a=d(`<span class="${e.params.a11y.notificationClass}" aria-live="assertive" aria-atomic="true"></span>`)})),s("afterInit",(()=>{e.params.a11y.enabled&&(w(),m())})),s("toEdge",(()=>{e.params.a11y.enabled&&m()})),s("fromEdge",(()=>{e.params.a11y.enabled&&m()})),s("paginationUpdate",(()=>{e.params.a11y.enabled&&function(){const t=e.params.a11y;f()&&e.pagination.bullets.each((s=>{const a=d(s);e.params.pagination.clickable&&(r(a),e.params.pagination.renderBullet||(l(a,"button"),p(a,t.paginationBulletMessage.replace(/\{\{index\}\}/,a.index()+1)))),a.is(`.${e.params.pagination.bulletActiveClass}`)?a.attr("aria-current","true"):a.removeAttr("aria-current")}))}()})),s("destroy",(()=>{e.params.a11y.enabled&&function(){let t,s;a&&a.length>0&&a.remove(),e.navigation&&e.navigation.$nextEl&&(t=e.navigation.$nextEl),e.navigation&&e.navigation.$prevEl&&(s=e.navigation.$prevEl),t&&t.off("keydown",h),s&&s.off("keydown",h),g()&&e.pagination.$el.off("keydown",W(e.params.pagination.bulletClass),h)}()}))},function({swiper:e,extendParams:t,on:s}){t({history:{enabled:!1,root:"",replaceState:!1,key:"slides"}});let a=!1,i={};const n=e=>e.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),l=e=>{const t=r();let s;s=e?new URL(e):t.location;const a=s.pathname.slice(1).split("/").filter((e=>""!==e)),i=a.length;return{key:a[i-2],value:a[i-1]}},o=(t,s)=>{const i=r();if(!a||!e.params.history.enabled)return;let l;l=e.params.url?new URL(e.params.url):i.location;const o=e.slides.eq(s);let d=n(o.attr("data-history"));if(e.params.history.root.length>0){let s=e.params.history.root;"/"===s[s.length-1]&&(s=s.slice(0,s.length-1)),d=`${s}/${t}/${d}`}else l.pathname.includes(t)||(d=`${t}/${d}`);const p=i.history.state;p&&p.value===d||(e.params.history.replaceState?i.history.replaceState({value:d},null,d):i.history.pushState({value:d},null,d))},d=(t,s,a)=>{if(s)for(let i=0,r=e.slides.length;i<r;i+=1){const r=e.slides.eq(i);if(n(r.attr("data-history"))===s&&!r.hasClass(e.params.slideDuplicateClass)){const s=r.index();e.slideTo(s,t,a)}}else e.slideTo(0,t,a)},p=()=>{i=l(e.params.url),d(e.params.speed,e.paths.value,!1)};s("init",(()=>{e.params.history.enabled&&(()=>{const t=r();if(e.params.history){if(!t.history||!t.history.pushState)return e.params.history.enabled=!1,void(e.params.hashNavigation.enabled=!0);a=!0,i=l(e.params.url),(i.key||i.value)&&(d(0,i.value,e.params.runCallbacksOnInit),e.params.history.replaceState||t.addEventListener("popstate",p))}})()})),s("destroy",(()=>{e.params.history.enabled&&(()=>{const t=r();e.params.history.replaceState||t.removeEventListener("popstate",p)})()})),s("transitionEnd _freeModeNoMomentumRelease",(()=>{a&&o(e.params.history.key,e.activeIndex)})),s("slideChange",(()=>{a&&e.params.cssMode&&o(e.params.history.key,e.activeIndex)}))},function({swiper:e,extendParams:t,emit:s,on:i}){let n=!1;const l=a(),o=r();t({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1}});const p=()=>{s("hashChange");const t=l.location.hash.replace("#","");if(t!==e.slides.eq(e.activeIndex).attr("data-hash")){const s=e.$wrapperEl.children(`.${e.params.slideClass}[data-hash="${t}"]`).index();if(void 0===s)return;e.slideTo(s)}},c=()=>{if(n&&e.params.hashNavigation.enabled)if(e.params.hashNavigation.replaceState&&o.history&&o.history.replaceState)o.history.replaceState(null,null,`#${e.slides.eq(e.activeIndex).attr("data-hash")}`||""),s("hashSet");else{const t=e.slides.eq(e.activeIndex),a=t.attr("data-hash")||t.attr("data-history");l.location.hash=a||"",s("hashSet")}};i("init",(()=>{e.params.hashNavigation.enabled&&(()=>{if(!e.params.hashNavigation.enabled||e.params.history&&e.params.history.enabled)return;n=!0;const t=l.location.hash.replace("#","");if(t){const s=0;for(let a=0,i=e.slides.length;a<i;a+=1){const i=e.slides.eq(a);if((i.attr("data-hash")||i.attr("data-history"))===t&&!i.hasClass(e.params.slideDuplicateClass)){const t=i.index();e.slideTo(t,s,e.params.runCallbacksOnInit,!0)}}}e.params.hashNavigation.watchState&&d(o).on("hashchange",p)})()})),i("destroy",(()=>{e.params.hashNavigation.enabled&&e.params.hashNavigation.watchState&&d(o).off("hashchange",p)})),i("transitionEnd _freeModeNoMomentumRelease",(()=>{n&&c()})),i("slideChange",(()=>{n&&e.params.cssMode&&c()}))},function({swiper:e,extendParams:t,on:s,emit:i}){let r;function n(){const t=e.slides.eq(e.activeIndex);let s=e.params.autoplay.delay;t.attr("data-swiper-autoplay")&&(s=t.attr("data-swiper-autoplay")||e.params.autoplay.delay),clearTimeout(r),r=c((()=>{let t;e.params.autoplay.reverseDirection?e.params.loop?(e.loopFix(),t=e.slidePrev(e.params.speed,!0,!0),i("autoplay")):e.isBeginning?e.params.autoplay.stopOnLastSlide?o():(t=e.slideTo(e.slides.length-1,e.params.speed,!0,!0),i("autoplay")):(t=e.slidePrev(e.params.speed,!0,!0),i("autoplay")):e.params.loop?(e.loopFix(),t=e.slideNext(e.params.speed,!0,!0),i("autoplay")):e.isEnd?e.params.autoplay.stopOnLastSlide?o():(t=e.slideTo(0,e.params.speed,!0,!0),i("autoplay")):(t=e.slideNext(e.params.speed,!0,!0),i("autoplay")),(e.params.cssMode&&e.autoplay.running||!1===t)&&n()}),s)}function l(){return void 0===r&&(!e.autoplay.running&&(e.autoplay.running=!0,i("autoplayStart"),n(),!0))}function o(){return!!e.autoplay.running&&(void 0!==r&&(r&&(clearTimeout(r),r=void 0),e.autoplay.running=!1,i("autoplayStop"),!0))}function d(t){e.autoplay.running&&(e.autoplay.paused||(r&&clearTimeout(r),e.autoplay.paused=!0,0!==t&&e.params.autoplay.waitForTransition?["transitionend","webkitTransitionEnd"].forEach((t=>{e.$wrapperEl[0].addEventListener(t,u)})):(e.autoplay.paused=!1,n())))}function p(){const t=a();"hidden"===t.visibilityState&&e.autoplay.running&&d(),"visible"===t.visibilityState&&e.autoplay.paused&&(n(),e.autoplay.paused=!1)}function u(t){e&&!e.destroyed&&e.$wrapperEl&&t.target===e.$wrapperEl[0]&&(["transitionend","webkitTransitionEnd"].forEach((t=>{e.$wrapperEl[0].removeEventListener(t,u)})),e.autoplay.paused=!1,e.autoplay.running?n():o())}function h(){e.params.autoplay.disableOnInteraction?o():d(),["transitionend","webkitTransitionEnd"].forEach((t=>{e.$wrapperEl[0].removeEventListener(t,u)}))}function m(){e.params.autoplay.disableOnInteraction||(e.autoplay.paused=!1,n())}e.autoplay={running:!1,paused:!1},t({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}}),s("init",(()=>{if(e.params.autoplay.enabled){l();a().addEventListener("visibilitychange",p),e.params.autoplay.pauseOnMouseEnter&&(e.$el.on("mouseenter",h),e.$el.on("mouseleave",m))}})),s("beforeTransitionStart",((t,s,a)=>{e.autoplay.running&&(a||!e.params.autoplay.disableOnInteraction?e.autoplay.pause(s):o())})),s("sliderFirstMove",(()=>{e.autoplay.running&&(e.params.autoplay.disableOnInteraction?o():d())})),s("touchEnd",(()=>{e.params.cssMode&&e.autoplay.paused&&!e.params.autoplay.disableOnInteraction&&n()})),s("destroy",(()=>{e.$el.off("mouseenter",h),e.$el.off("mouseleave",m),e.autoplay.running&&o();a().removeEventListener("visibilitychange",p)})),Object.assign(e.autoplay,{pause:d,run:n,start:l,stop:o})},function({swiper:e,extendParams:t,on:s}){t({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let a=!1,i=!1;function r(){const t=e.thumbs.swiper;if(!t)return;const s=t.clickedIndex,a=t.clickedSlide;if(a&&d(a).hasClass(e.params.thumbs.slideThumbActiveClass))return;if(null==s)return;let i;if(i=t.params.loop?parseInt(d(t.clickedSlide).attr("data-swiper-slide-index"),10):s,e.params.loop){let t=e.activeIndex;e.slides.eq(t).hasClass(e.params.slideDuplicateClass)&&(e.loopFix(),e._clientLeft=e.$wrapperEl[0].clientLeft,t=e.activeIndex);const s=e.slides.eq(t).prevAll(`[data-swiper-slide-index="${i}"]`).eq(0).index(),a=e.slides.eq(t).nextAll(`[data-swiper-slide-index="${i}"]`).eq(0).index();i=void 0===s?a:void 0===a?s:a-t<t-s?a:s}e.slideTo(i)}function n(){const{thumbs:t}=e.params;if(a)return!1;a=!0;const s=e.constructor;if(t.swiper instanceof s)e.thumbs.swiper=t.swiper,Object.assign(e.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(e.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1});else if(m(t.swiper)){const a=Object.assign({},t.swiper);Object.assign(a,{watchSlidesProgress:!0,slideToClickedSlide:!1}),e.thumbs.swiper=new s(a),i=!0}return e.thumbs.swiper.$el.addClass(e.params.thumbs.thumbsContainerClass),e.thumbs.swiper.on("tap",r),!0}function l(t){const s=e.thumbs.swiper;if(!s)return;const a="auto"===s.params.slidesPerView?s.slidesPerViewDynamic():s.params.slidesPerView,i=e.params.thumbs.autoScrollOffset,r=i&&!s.params.loop;if(e.realIndex!==s.realIndex||r){let n,l,o=s.activeIndex;if(s.params.loop){s.slides.eq(o).hasClass(s.params.slideDuplicateClass)&&(s.loopFix(),s._clientLeft=s.$wrapperEl[0].clientLeft,o=s.activeIndex);const t=s.slides.eq(o).prevAll(`[data-swiper-slide-index="${e.realIndex}"]`).eq(0).index(),a=s.slides.eq(o).nextAll(`[data-swiper-slide-index="${e.realIndex}"]`).eq(0).index();n=void 0===t?a:void 0===a?t:a-o==o-t?s.params.slidesPerGroup>1?a:o:a-o<o-t?a:t,l=e.activeIndex>e.previousIndex?"next":"prev"}else n=e.realIndex,l=n>e.previousIndex?"next":"prev";r&&(n+="next"===l?i:-1*i),s.visibleSlidesIndexes&&s.visibleSlidesIndexes.indexOf(n)<0&&(s.params.centeredSlides?n=n>o?n-Math.floor(a/2)+1:n+Math.floor(a/2)-1:n>o&&s.params.slidesPerGroup,s.slideTo(n,t?0:void 0))}let n=1;const l=e.params.thumbs.slideThumbActiveClass;if(e.params.slidesPerView>1&&!e.params.centeredSlides&&(n=e.params.slidesPerView),e.params.thumbs.multipleActiveThumbs||(n=1),n=Math.floor(n),s.slides.removeClass(l),s.params.loop||s.params.virtual&&s.params.virtual.enabled)for(let t=0;t<n;t+=1)s.$wrapperEl.children(`[data-swiper-slide-index="${e.realIndex+t}"]`).addClass(l);else for(let t=0;t<n;t+=1)s.slides.eq(e.realIndex+t).addClass(l)}e.thumbs={swiper:null},s("beforeInit",(()=>{const{thumbs:t}=e.params;t&&t.swiper&&(n(),l(!0))})),s("slideChange update resize observerUpdate",(()=>{e.thumbs.swiper&&l()})),s("setTransition",((t,s)=>{const a=e.thumbs.swiper;a&&a.setTransition(s)})),s("beforeDestroy",(()=>{const t=e.thumbs.swiper;t&&i&&t&&t.destroy()})),Object.assign(e.thumbs,{init:n,update:l})},function({swiper:e,extendParams:t,emit:s,once:a}){t({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}}),Object.assign(e,{freeMode:{onTouchMove:function(){const{touchEventsData:t,touches:s}=e;0===t.velocities.length&&t.velocities.push({position:s[e.isHorizontal()?"startX":"startY"],time:t.touchStartTime}),t.velocities.push({position:s[e.isHorizontal()?"currentX":"currentY"],time:u()})},onTouchEnd:function({currentPos:t}){const{params:i,$wrapperEl:r,rtlTranslate:n,snapGrid:l,touchEventsData:o}=e,d=u()-o.touchStartTime;if(t<-e.minTranslate())e.slideTo(e.activeIndex);else if(t>-e.maxTranslate())e.slides.length<l.length?e.slideTo(l.length-1):e.slideTo(e.slides.length-1);else{if(i.freeMode.momentum){if(o.velocities.length>1){const t=o.velocities.pop(),s=o.velocities.pop(),a=t.position-s.position,r=t.time-s.time;e.velocity=a/r,e.velocity/=2,Math.abs(e.velocity)<i.freeMode.minimumVelocity&&(e.velocity=0),(r>150||u()-t.time>300)&&(e.velocity=0)}else e.velocity=0;e.velocity*=i.freeMode.momentumVelocityRatio,o.velocities.length=0;let t=1e3*i.freeMode.momentumRatio;const d=e.velocity*t;let p=e.translate+d;n&&(p=-p);let c,h=!1;const m=20*Math.abs(e.velocity)*i.freeMode.momentumBounceRatio;let f;if(p<e.maxTranslate())i.freeMode.momentumBounce?(p+e.maxTranslate()<-m&&(p=e.maxTranslate()-m),c=e.maxTranslate(),h=!0,o.allowMomentumBounce=!0):p=e.maxTranslate(),i.loop&&i.centeredSlides&&(f=!0);else if(p>e.minTranslate())i.freeMode.momentumBounce?(p-e.minTranslate()>m&&(p=e.minTranslate()+m),c=e.minTranslate(),h=!0,o.allowMomentumBounce=!0):p=e.minTranslate(),i.loop&&i.centeredSlides&&(f=!0);else if(i.freeMode.sticky){let t;for(let e=0;e<l.length;e+=1)if(l[e]>-p){t=e;break}p=Math.abs(l[t]-p)<Math.abs(l[t-1]-p)||"next"===e.swipeDirection?l[t]:l[t-1],p=-p}if(f&&a("transitionEnd",(()=>{e.loopFix()})),0!==e.velocity){if(t=n?Math.abs((-p-e.translate)/e.velocity):Math.abs((p-e.translate)/e.velocity),i.freeMode.sticky){const s=Math.abs((n?-p:p)-e.translate),a=e.slidesSizesGrid[e.activeIndex];t=s<a?i.speed:s<2*a?1.5*i.speed:2.5*i.speed}}else if(i.freeMode.sticky)return void e.slideToClosest();i.freeMode.momentumBounce&&h?(e.updateProgress(c),e.setTransition(t),e.setTranslate(p),e.transitionStart(!0,e.swipeDirection),e.animating=!0,r.transitionEnd((()=>{e&&!e.destroyed&&o.allowMomentumBounce&&(s("momentumBounce"),e.setTransition(i.speed),setTimeout((()=>{e.setTranslate(c),r.transitionEnd((()=>{e&&!e.destroyed&&e.transitionEnd()}))}),0))}))):e.velocity?(s("_freeModeNoMomentumRelease"),e.updateProgress(p),e.setTransition(t),e.setTranslate(p),e.transitionStart(!0,e.swipeDirection),e.animating||(e.animating=!0,r.transitionEnd((()=>{e&&!e.destroyed&&e.transitionEnd()})))):e.updateProgress(p),e.updateActiveIndex(),e.updateSlidesClasses()}else{if(i.freeMode.sticky)return void e.slideToClosest();i.freeMode&&s("_freeModeNoMomentumRelease")}(!i.freeMode.momentum||d>=i.longSwipesMs)&&(e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses())}}}})},function({swiper:e,extendParams:t}){let s,a,i;t({grid:{rows:1,fill:"column"}}),e.grid={initSlides:t=>{const{slidesPerView:r}=e.params,{rows:n,fill:l}=e.params.grid;a=s/n,i=Math.floor(t/n),s=Math.floor(t/n)===t/n?t:Math.ceil(t/n)*n,"auto"!==r&&"row"===l&&(s=Math.max(s,r*n))},updateSlide:(t,r,n,l)=>{const{slidesPerGroup:o,spaceBetween:d}=e.params,{rows:p,fill:c}=e.params.grid;let u,h,m;if("row"===c&&o>1){const e=Math.floor(t/(o*p)),a=t-p*o*e,i=0===e?o:Math.min(Math.ceil((n-e*p*o)/p),o);m=Math.floor(a/i),h=a-m*i+e*o,u=h+m*s/p,r.css({"-webkit-order":u,order:u})}else"column"===c?(h=Math.floor(t/p),m=t-h*p,(h>i||h===i&&m===p-1)&&(m+=1,m>=p&&(m=0,h+=1))):(m=Math.floor(t/a),h=t-m*a);r.css(l("margin-top"),0!==m?d&&`${d}px`:"")},updateWrapperSize:(t,a,i)=>{const{spaceBetween:r,centeredSlides:n,roundLengths:l}=e.params,{rows:o}=e.params.grid;if(e.virtualSize=(t+r)*s,e.virtualSize=Math.ceil(e.virtualSize/o)-r,e.$wrapperEl.css({[i("width")]:`${e.virtualSize+r}px`}),n){a.splice(0,a.length);const t=[];for(let s=0;s<a.length;s+=1){let i=a[s];l&&(i=Math.floor(i)),a[s]<e.virtualSize+a[0]&&t.push(i)}a.push(...t)}}}},function({swiper:e}){Object.assign(e,{appendSlide:R.bind(e),prependSlide:j.bind(e),addSlide:_.bind(e),removeSlide:V.bind(e),removeAllSlides:q.bind(e)})},function({swiper:e,extendParams:t,on:s}){t({fadeEffect:{crossFade:!1,transformEl:null}}),F({effect:"fade",swiper:e,on:s,setTranslate:()=>{const{slides:t}=e,s=e.params.fadeEffect;for(let a=0;a<t.length;a+=1){const t=e.slides.eq(a);let i=-t[0].swiperSlideOffset;e.params.virtualTranslate||(i-=e.translate);let r=0;e.isHorizontal()||(r=i,i=0);const n=e.params.fadeEffect.crossFade?Math.max(1-Math.abs(t[0].progress),0):1+Math.min(Math.max(t[0].progress,-1),0);U(s,t).css({opacity:n}).transform(`translate3d(${i}px, ${r}px, 0px)`)}},setTransition:t=>{const{transformEl:s}=e.params.fadeEffect;(s?e.slides.find(s):e.slides).transition(t),K({swiper:e,duration:t,transformEl:s,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!e.params.cssMode})})},function({swiper:e,extendParams:t,on:s}){t({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}}),F({effect:"cube",swiper:e,on:s,setTranslate:()=>{const{$el:t,$wrapperEl:s,slides:a,width:i,height:r,rtlTranslate:n,size:l,browser:o}=e,p=e.params.cubeEffect,c=e.isHorizontal(),u=e.virtual&&e.params.virtual.enabled;let h,m=0;p.shadow&&(c?(h=s.find(".swiper-cube-shadow"),0===h.length&&(h=d('<div class="swiper-cube-shadow"></div>'),s.append(h)),h.css({height:`${i}px`})):(h=t.find(".swiper-cube-shadow"),0===h.length&&(h=d('<div class="swiper-cube-shadow"></div>'),t.append(h))));for(let e=0;e<a.length;e+=1){const t=a.eq(e);let s=e;u&&(s=parseInt(t.attr("data-swiper-slide-index"),10));let i=90*s,r=Math.floor(i/360);n&&(i=-i,r=Math.floor(-i/360));const o=Math.max(Math.min(t[0].progress,1),-1);let h=0,f=0,g=0;s%4==0?(h=4*-r*l,g=0):(s-1)%4==0?(h=0,g=4*-r*l):(s-2)%4==0?(h=l+4*r*l,g=l):(s-3)%4==0&&(h=-l,g=3*l+4*l*r),n&&(h=-h),c||(f=h,h=0);const v=`rotateX(${c?0:-i}deg) rotateY(${c?i:0}deg) translate3d(${h}px, ${f}px, ${g}px)`;if(o<=1&&o>-1&&(m=90*s+90*o,n&&(m=90*-s-90*o)),t.transform(v),p.slideShadows){let e=c?t.find(".swiper-slide-shadow-left"):t.find(".swiper-slide-shadow-top"),s=c?t.find(".swiper-slide-shadow-right"):t.find(".swiper-slide-shadow-bottom");0===e.length&&(e=d(`<div class="swiper-slide-shadow-${c?"left":"top"}"></div>`),t.append(e)),0===s.length&&(s=d(`<div class="swiper-slide-shadow-${c?"right":"bottom"}"></div>`),t.append(s)),e.length&&(e[0].style.opacity=Math.max(-o,0)),s.length&&(s[0].style.opacity=Math.max(o,0))}}if(s.css({"-webkit-transform-origin":`50% 50% -${l/2}px`,"transform-origin":`50% 50% -${l/2}px`}),p.shadow)if(c)h.transform(`translate3d(0px, ${i/2+p.shadowOffset}px, ${-i/2}px) rotateX(90deg) rotateZ(0deg) scale(${p.shadowScale})`);else{const e=Math.abs(m)-90*Math.floor(Math.abs(m)/90),t=1.5-(Math.sin(2*e*Math.PI/360)/2+Math.cos(2*e*Math.PI/360)/2),s=p.shadowScale,a=p.shadowScale/t,i=p.shadowOffset;h.transform(`scale3d(${s}, 1, ${a}) translate3d(0px, ${r/2+i}px, ${-r/2/a}px) rotateX(-90deg)`)}const f=o.isSafari||o.isWebView?-l/2:0;s.transform(`translate3d(0px,0,${f}px) rotateX(${e.isHorizontal()?0:m}deg) rotateY(${e.isHorizontal()?-m:0}deg)`)},setTransition:t=>{const{$el:s,slides:a}=e;a.transition(t).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(t),e.params.cubeEffect.shadow&&!e.isHorizontal()&&s.find(".swiper-cube-shadow").transition(t)},perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})},function({swiper:e,extendParams:t,on:s}){t({flipEffect:{slideShadows:!0,limitRotation:!0,transformEl:null}}),F({effect:"flip",swiper:e,on:s,setTranslate:()=>{const{slides:t,rtlTranslate:s}=e,a=e.params.flipEffect;for(let i=0;i<t.length;i+=1){const r=t.eq(i);let n=r[0].progress;e.params.flipEffect.limitRotation&&(n=Math.max(Math.min(r[0].progress,1),-1));const l=r[0].swiperSlideOffset;let o=-180*n,d=0,p=e.params.cssMode?-l-e.translate:-l,c=0;if(e.isHorizontal()?s&&(o=-o):(c=p,p=0,d=-o,o=0),r[0].style.zIndex=-Math.abs(Math.round(n))+t.length,a.slideShadows){let t=e.isHorizontal()?r.find(".swiper-slide-shadow-left"):r.find(".swiper-slide-shadow-top"),s=e.isHorizontal()?r.find(".swiper-slide-shadow-right"):r.find(".swiper-slide-shadow-bottom");0===t.length&&(t=Z(a,r,e.isHorizontal()?"left":"top")),0===s.length&&(s=Z(a,r,e.isHorizontal()?"right":"bottom")),t.length&&(t[0].style.opacity=Math.max(-n,0)),s.length&&(s[0].style.opacity=Math.max(n,0))}const u=`translate3d(${p}px, ${c}px, 0px) rotateX(${d}deg) rotateY(${o}deg)`;U(a,r).transform(u)}},setTransition:t=>{const{transformEl:s}=e.params.flipEffect;(s?e.slides.find(s):e.slides).transition(t).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(t),K({swiper:e,duration:t,transformEl:s})},perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!e.params.cssMode})})},function({swiper:e,extendParams:t,on:s}){t({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0,transformEl:null}}),F({effect:"coverflow",swiper:e,on:s,setTranslate:()=>{const{width:t,height:s,slides:a,slidesSizesGrid:i}=e,r=e.params.coverflowEffect,n=e.isHorizontal(),l=e.translate,o=n?t/2-l:s/2-l,d=n?r.rotate:-r.rotate,p=r.depth;for(let e=0,t=a.length;e<t;e+=1){const t=a.eq(e),s=i[e],l=(o-t[0].swiperSlideOffset-s/2)/s*r.modifier;let c=n?d*l:0,u=n?0:d*l,h=-p*Math.abs(l),m=r.stretch;"string"==typeof m&&-1!==m.indexOf("%")&&(m=parseFloat(r.stretch)/100*s);let f=n?0:m*l,g=n?m*l:0,v=1-(1-r.scale)*Math.abs(l);Math.abs(g)<.001&&(g=0),Math.abs(f)<.001&&(f=0),Math.abs(h)<.001&&(h=0),Math.abs(c)<.001&&(c=0),Math.abs(u)<.001&&(u=0),Math.abs(v)<.001&&(v=0);const w=`translate3d(${g}px,${f}px,${h}px) rotateX(${u}deg) rotateY(${c}deg) scale(${v})`;if(U(r,t).transform(w),t[0].style.zIndex=1-Math.abs(Math.round(l)),r.slideShadows){let e=n?t.find(".swiper-slide-shadow-left"):t.find(".swiper-slide-shadow-top"),s=n?t.find(".swiper-slide-shadow-right"):t.find(".swiper-slide-shadow-bottom");0===e.length&&(e=Z(r,t,n?"left":"top")),0===s.length&&(s=Z(r,t,n?"right":"bottom")),e.length&&(e[0].style.opacity=l>0?l:0),s.length&&(s[0].style.opacity=-l>0?-l:0)}}},setTransition:t=>{const{transformEl:s}=e.params.coverflowEffect;(s?e.slides.find(s):e.slides).transition(t).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(t)},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})},function({swiper:e,extendParams:t,on:s}){t({creativeEffect:{transformEl:null,limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const a=e=>"string"==typeof e?e:`${e}px`;F({effect:"creative",swiper:e,on:s,setTranslate:()=>{const{slides:t,$wrapperEl:s,slidesSizesGrid:i}=e,r=e.params.creativeEffect,{progressMultiplier:n}=r,l=e.params.centeredSlides;if(l){const t=i[0]/2-e.params.slidesOffsetBefore||0;s.transform(`translateX(calc(50% - ${t}px))`)}for(let s=0;s<t.length;s+=1){const i=t.eq(s),o=i[0].progress,d=Math.min(Math.max(i[0].progress,-r.limitProgress),r.limitProgress);let p=d;l||(p=Math.min(Math.max(i[0].originalProgress,-r.limitProgress),r.limitProgress));const c=i[0].swiperSlideOffset,u=[e.params.cssMode?-c-e.translate:-c,0,0],h=[0,0,0];let m=!1;e.isHorizontal()||(u[1]=u[0],u[0]=0);let f={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};d<0?(f=r.next,m=!0):d>0&&(f=r.prev,m=!0),u.forEach(((e,t)=>{u[t]=`calc(${e}px + (${a(f.translate[t])} * ${Math.abs(d*n)}))`})),h.forEach(((e,t)=>{h[t]=f.rotate[t]*Math.abs(d*n)})),i[0].style.zIndex=-Math.abs(Math.round(o))+t.length;const g=u.join(", "),v=`rotateX(${h[0]}deg) rotateY(${h[1]}deg) rotateZ(${h[2]}deg)`,w=p<0?`scale(${1+(1-f.scale)*p*n})`:`scale(${1-(1-f.scale)*p*n})`,b=p<0?1+(1-f.opacity)*p*n:1-(1-f.opacity)*p*n,x=`translate3d(${g}) ${v} ${w}`;if(m&&f.shadow||!m){let e=i.children(".swiper-slide-shadow");if(0===e.length&&f.shadow&&(e=Z(r,i)),e.length){const t=r.shadowPerProgress?d*(1/r.limitProgress):d;e[0].style.opacity=Math.min(Math.max(Math.abs(t),0),1)}}const y=U(r,i);y.transform(x).css({opacity:b}),f.origin&&y.css("transform-origin",f.origin)}},setTransition:t=>{const{transformEl:s}=e.params.creativeEffect;(s?e.slides.find(s):e.slides).transition(t).find(".swiper-slide-shadow").transition(t),K({swiper:e,duration:t,transformEl:s,allSlides:!0})},perspective:()=>e.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!e.params.cssMode})})},function({swiper:e,extendParams:t,on:s}){t({cardsEffect:{slideShadows:!0,transformEl:null}}),F({effect:"cards",swiper:e,on:s,setTranslate:()=>{const{slides:t,activeIndex:s}=e,a=e.params.cardsEffect,{startTranslate:i,isTouched:r}=e.touchEventsData,n=e.translate;for(let l=0;l<t.length;l+=1){const o=t.eq(l),d=o[0].progress,p=Math.min(Math.max(d,-4),4);let c=o[0].swiperSlideOffset;e.params.centeredSlides&&!e.params.cssMode&&e.$wrapperEl.transform(`translateX(${e.minTranslate()}px)`),e.params.centeredSlides&&e.params.cssMode&&(c-=t[0].swiperSlideOffset);let u=e.params.cssMode?-c-e.translate:-c,h=0;const m=-100*Math.abs(p);let f=1,g=-2*p,v=8-.75*Math.abs(p);const w=(l===s||l===s-1)&&p>0&&p<1&&(r||e.params.cssMode)&&n<i,b=(l===s||l===s+1)&&p<0&&p>-1&&(r||e.params.cssMode)&&n>i;if(w||b){const e=(1-Math.abs((Math.abs(p)-.5)/.5))**.5;g+=-28*p*e,f+=-.5*e,v+=96*e,h=-25*e*Math.abs(p)+"%"}if(u=p<0?`calc(${u}px + (${v*Math.abs(p)}%))`:p>0?`calc(${u}px + (-${v*Math.abs(p)}%))`:`${u}px`,!e.isHorizontal()){const e=h;h=u,u=e}const x=`\n translate3d(${u}, ${h}, ${m}px)\n rotateZ(${g}deg)\n scale(${p<0?""+(1+(1-f)*p):""+(1-(1-f)*p)})\n `;if(a.slideShadows){let e=o.find(".swiper-slide-shadow");0===e.length&&(e=Z(a,o)),e.length&&(e[0].style.opacity=Math.min(Math.max((Math.abs(p)-.5)/.5,0),1))}o[0].style.zIndex=-Math.abs(Math.round(d))+t.length;U(a,o).transform(x)}},setTransition:t=>{const{transformEl:s}=e.params.cardsEffect;(s?e.slides.find(s):e.slides).transition(t).find(".swiper-slide-shadow").transition(t),K({swiper:e,duration:t,transformEl:s})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!e.params.cssMode})})}];return H.use(J),H})); 4689 4690/*! 4691 * headroom.js v0.8.0 - Give your page some headroom. Hide your header until you need it 4692 * Copyright (c) 2016 Nick Williams - http://wicky.nillia.ms/headroom.js 4693 * License: MIT 4694 */ 4695 4696(function(root, factory) { 4697 'use strict'; 4698 4699 if (typeof define === 'function' && define.amd) { 4700 // AMD. Register as an anonymous module. 4701 define([], factory); 4702 } 4703 else if (typeof exports === 'object') { 4704 // COMMONJS 4705 module.exports = factory(); 4706 } 4707 else { 4708 // BROWSER 4709 root.Headroom = factory(); 4710 } 4711}(this, function() { 4712 'use strict'; 4713 4714 /* exported features */ 4715 4716 var features = { 4717 bind : !!(function(){}.bind), 4718 classList : 'classList' in document.documentElement, 4719 rAF : !!(window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame) 4720 }; 4721 window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; 4722 4723 /** 4724 * Handles debouncing of events via requestAnimationFrame 4725 * @see http://www.html5rocks.com/en/tutorials/speed/animations/ 4726 * @param {Function} callback The callback to handle whichever event 4727 */ 4728 function Debouncer (callback) { 4729 this.callback = callback; 4730 this.ticking = false;
4731 } 4732 Debouncer.prototype = { 4733 constructor : Debouncer, 4734 4735 /** 4736 * dispatches the event to the supplied callback 4737 * @private 4738 */ 4739 update : function() { 4740 this.callback && this.callback(); 4741 this.ticking = false; 4742 }, 4743 4744 /** 4745 * ensures events don't get stacked 4746 * @private 4747 */ 4748 requestTick : function() { 4749 if(!this.ticking) { 4750 requestAnimationFrame(this.rafCallback || (this.rafCallback = this.update.bind(this))); 4751 this.ticking = true; 4752 } 4753 }, 4754 4755 /** 4756 * Attach this as the event listeners 4757 */ 4758 handleEvent : function() { 4759 this.requestTick(); 4760 } 4761 }; 4762 /** 4763 * Check if object is part of the DOM 4764 * @constructor 4765 * @param {Object} obj element to check 4766 */ 4767 function isDOMElement(obj) { 4768 return obj && typeof window !== 'undefined' && (obj === window || obj.nodeType); 4769 } 4770 4771 /** 4772 * Helper function for extending objects 4773 */ 4774 function extend (object /*, objectN ... */) { 4775 if(arguments.length <= 0) { 4776 throw new Error('Missing arguments in extend function'); 4777 } 4778 4779 var result = object || {}, 4780 key, 4781 i; 4782 4783 for (i = 1; i < arguments.length; i++) { 4784 var replacement = arguments[i] || {}; 4785 4786 for (key in replacement) { 4787 // Recurse into object except if the object is a DOM element 4788 if(typeof result[key] === 'object' && ! isDOMElement(result[key])) { 4789 result[key] = extend(result[key], replacement[key]); 4790 } 4791 else { 4792 result[key] = result[key] || replacement[key]; 4793 } 4794 } 4795 } 4796 4797 return result; 4798 } 4799 4800 /** 4801 * Helper function for normalizing tolerance option to object format 4802 */ 4803 function normalizeTolerance (t) { 4804 return t === Object(t) ? t : { down : t, up : t }; 4805 } 4806 4807 /** 4808 * UI enhancement for fixed headers. 4809 * Hides header when scrolling down 4810 * Shows header when scrolling up 4811 * @constructor 4812 * @param {DOMElement} elem the header element 4813 * @param {Object} options options for the widget 4814 */ 4815 function Headroom (elem, options) { 4816 options = extend(options, Headroom.options); 4817 4818 this.lastKnownScrollY = 0; 4819 this.elem = elem; 4820 this.tolerance = normalizeTolerance(options.tolerance); 4821 this.classes = options.classes; 4822 this.offset = options.offset; 4823 this.scroller = options.scroller; 4824 this.initialised = false; 4825 this.onPin = options.onPin; 4826 this.onUnpin = options.onUnpin; 4827 this.onTop = options.onTop; 4828 this.onNotTop = options.onNotTop; 4829 this.onBottom = options.onBottom; 4830 this.onNotBottom = options.onNotBottom; 4831 } 4832 Headroom.prototype = { 4833 constructor : Headroom, 4834 4835 /** 4836 * Initialises the widget 4837 */ 4838 init : function() { 4839 if(!Headroom.cutsTheMustard) { 4840 return; 4841 } 4842 4843 this.debouncer = new Debouncer(this.update.bind(this)); 4844 this.elem.classList.add(this.classes.initial); 4845 4846 // defer event registration to handle browser 4847 // potentially restoring previous scroll position 4848 setTimeout(this.attachEvent.bind(this), 100); 4849 4850 return this; 4851 }, 4852 4853 /** 4854 * Unattaches events and removes any classes that were added 4855 */ 4856 destroy : function() { 4857 var classes = this.classes; 4858 4859 this.initialised = false; 4860 this.elem.classList.remove(classes.unpinned, classes.pinned, classes.top, classes.notTop, classes.initial); 4861 this.scroller.removeEventListener('scroll', this.debouncer, false); 4862 }, 4863 4864 /** 4865 * Attaches the scroll event 4866 * @private 4867 */ 4868 attachEvent : function() { 4869 if(!this.initialised){ 4870 this.lastKnownScrollY = this.getScrollY(); 4871 this.initialised = true; 4872 this.scroller.addEventListener('scroll', this.debouncer, false); 4873 4874 this.debouncer.handleEvent(); 4875 } 4876 }, 4877 4878 /** 4879 * Unpins the header if it's currently pinned 4880 */ 4881 unpin : function() { 4882 var classList = this.elem.classList, 4883 classes = this.classes; 4884
4885 if(classList.contains(classes.pinned) || !classList.contains(classes.unpinned)) { 4886 classList.add(classes.unpinned); 4887 classList.remove(classes.pinned); 4888 this.onUnpin && this.onUnpin.call(this); 4889 } 4890 }, 4891 4892 /** 4893 * Pins the header if it's currently unpinned 4894 */ 4895 pin : function() { 4896 var classList = this.elem.classList, 4897 classes = this.classes; 4898 4899 if(classList.contains(classes.unpinned)) { 4900 classList.remove(classes.unpinned); 4901 classList.add(classes.pinned); 4902 this.onPin && this.onPin.call(this); 4903 } 4904 }, 4905 4906 /** 4907 * Handles the top states 4908 */ 4909 top : function() { 4910 var classList = this.elem.classList, 4911 classes = this.classes; 4912 4913 if(!classList.contains(classes.top)) { 4914 classList.add(classes.top); 4915 classList.remove(classes.notTop); 4916 this.onTop && this.onTop.call(this); 4917 } 4918 }, 4919 4920 /** 4921 * Handles the not top state 4922 */ 4923 notTop : function() { 4924 var classList = this.elem.classList, 4925 classes = this.classes; 4926 4927 if(!classList.contains(classes.notTop)) { 4928 classList.add(classes.notTop); 4929 classList.remove(classes.top); 4930 this.onNotTop && this.onNotTop.call(this); 4931 } 4932 }, 4933 4934 bottom : function() { 4935 var classList = this.elem.classList, 4936 classes = this.classes; 4937 4938 if(!classList.contains(classes.bottom)) { 4939 classList.add(classes.bottom); 4940 classList.remove(classes.notBottom); 4941 this.onBottom && this.onBottom.call(this); 4942 } 4943 }, 4944 4945 /** 4946 * Handles the not top state 4947 */ 4948 notBottom : function() { 4949 var classList = this.elem.classList, 4950 classes = this.classes; 4951 4952 if(!classList.contains(classes.notBottom)) { 4953 classList.add(classes.notBottom); 4954 classList.remove(classes.bottom); 4955 this.onNotBottom && this.onNotBottom.call(this); 4956 } 4957 }, 4958 4959 /** 4960 * Gets the Y scroll position 4961 * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY 4962 * @return {Number} pixels the page has scrolled along the Y-axis 4963 */ 4964 getScrollY : function() { 4965 return (this.scroller.pageYOffset !== undefined) 4966 ? this.scroller.pageYOffset 4967 : (this.scroller.scrollTop !== undefined) 4968 ? this.scroller.scrollTop 4969 : (document.documentElement || document.body.parentNode || document.body).scrollTop; 4970 }, 4971 4972 /** 4973 * Gets the height of the viewport 4974 * @see http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript 4975 * @return {int} the height of the viewport in pixels 4976 */ 4977 getViewportHeight : function () { 4978 return window.innerHeight 4979 || document.documentElement.clientHeight 4980 || document.body.clientHeight; 4981 }, 4982 4983 /** 4984 * Gets the physical height of the DOM element 4985 * @param {Object} elm the element to calculate the physical height of which 4986 * @return {int} the physical height of the element in pixels 4987 */ 4988 getElementPhysicalHeight : function (elm) { 4989 return Math.max( 4990 elm.offsetHeight, 4991 elm.clientHeight 4992 ); 4993 }, 4994 4995 /** 4996 * Gets the physical height of the scroller element 4997 * @return {int} the physical height of the scroller element in pixels 4998 */ 4999 getScrollerPhysicalHeight : function () { 5000 return (this.scroller === window || this.scroller === document.body) 5001 ? this.getViewportHeight() 5002 : this.getElementPhysicalHeight(this.scroller); 5003 }, 5004 5005 /** 5006 * Gets the height of the document 5007 * @see http://james.padolsey.com/javascript/get-document-height-cross-browser/ 5008 * @return {int} the height of the document in pixels 5009 */ 5010 getDocumentHeight : function () { 5011 var body = document.body, 5012 documentElement = document.documentElement; 5013 5014 return Math.max( 5015 body.scrollHeight, documentElement.scrollHeight, 5016 body.offsetHeight, documentElement.offsetHeight, 5017 body.clientHeight, documentElement.clientHeight 5018 ); 5019 }, 5020 5021 /** 5022 * Gets the height of the DOM element 5023 * @param {Object} elm the element to calculate the height of which 5024 * @return {int} the height of the element in pixels 5025 */ 5026 getElementHeight : function (elm) { 5027 return Math.max( 5028 elm.scrollHeight, 5029 elm.offsetHeight, 5030 elm.clientHeight 5031 ); 5032 }, 5033 5034 /** 5035 * Gets the height of the scroller element 5036 * @return {int} the height of the scroller element in pixels 5037 */ 5038 getScrollerHeight : function () { 5039 return (this.scroller === window || this.scroller === document.body) 5040 ? this.getDocumentHeight() 5041 : this.getElementHeight(this.scroller); 5042 }, 5043 5044 /** 5045 * determines if the scroll position is outside of document boundaries 5046 * @param {int} currentScrollY the current y scroll position 5047 * @return {bool} true if out of bounds, false otherwise 5048 */ 5049 isOutOfBounds : function (currentScrollY) { 5050 var pastTop = currentScrollY < 0,
5051 pastBottom = currentScrollY + this.getScrollerPhysicalHeight() > this.getScrollerHeight(); 5052 5053 return pastTop || pastBottom; 5054 }, 5055 5056 /** 5057 * determines if the tolerance has been exceeded 5058 * @param {int} currentScrollY the current scroll y position 5059 * @return {bool} true if tolerance exceeded, false otherwise 5060 */ 5061 toleranceExceeded : function (currentScrollY, direction) { 5062 return Math.abs(currentScrollY-this.lastKnownScrollY) >= this.tolerance[direction]; 5063 }, 5064 5065 /** 5066 * determine if it is appropriate to unpin 5067 * @param {int} currentScrollY the current y scroll position 5068 * @param {bool} toleranceExceeded has the tolerance been exceeded? 5069 * @return {bool} true if should unpin, false otherwise 5070 */ 5071 shouldUnpin : function (currentScrollY, toleranceExceeded) { 5072 var scrollingDown = currentScrollY > this.lastKnownScrollY, 5073 pastOffset = currentScrollY >= this.offset; 5074 5075 return scrollingDown && pastOffset && toleranceExceeded; 5076 }, 5077 5078 /** 5079 * determine if it is appropriate to pin 5080 * @param {int} currentScrollY the current y scroll position 5081 * @param {bool} toleranceExceeded has the tolerance been exceeded? 5082 * @return {bool} true if should pin, false otherwise 5083 */ 5084 shouldPin : function (currentScrollY, toleranceExceeded) { 5085 var scrollingUp = currentScrollY < this.lastKnownScrollY, 5086 pastOffset = currentScrollY <= this.offset; 5087 5088 return (scrollingUp && toleranceExceeded) || pastOffset; 5089 }, 5090 5091 /** 5092 * Handles updating the state of the widget 5093 */ 5094 update : function() { 5095 var currentScrollY = this.getScrollY(), 5096 scrollDirection = currentScrollY > this.lastKnownScrollY ? 'down' : 'up', 5097 toleranceExceeded = this.toleranceExceeded(currentScrollY, scrollDirection); 5098 5099 if(this.isOutOfBounds(currentScrollY)) { // Ignore bouncy scrolling in OSX 5100 return; 5101 } 5102 5103 if (currentScrollY <= this.offset ) { 5104 this.top(); 5105 } else { 5106 this.notTop(); 5107 } 5108 5109 if(currentScrollY + this.getViewportHeight() >= this.getScrollerHeight()) { 5110 this.bottom(); 5111 } 5112 else { 5113 this.notBottom(); 5114 } 5115 5116 if(this.shouldUnpin(currentScrollY, toleranceExceeded)) { 5117 this.unpin(); 5118 } 5119 else if(this.shouldPin(currentScrollY, toleranceExceeded)) { 5120 this.pin(); 5121 } 5122 5123 this.lastKnownScrollY = currentScrollY; 5124 } 5125 }; 5126 /** 5127 * Default options 5128 * @type {Object} 5129 */ 5130 Headroom.options = { 5131 tolerance : { 5132 up : 0, 5133 down : 0 5134 }, 5135 offset : 0, 5136 scroller: window, 5137 classes : { 5138 pinned : 'headroom--pinned', 5139 unpinned : 'headroom--unpinned', 5140 top : 'headroom--top', 5141 notTop : 'headroom--not-top', 5142 bottom : 'headroom--bottom', 5143 notBottom : 'headroom--not-bottom', 5144 initial : 'headroom' 5145 } 5146 }; 5147 Headroom.cutsTheMustard = typeof features !== 'undefined' && features.rAF && features.bind && features.classList; 5148 5149 return Headroom; 5150})); 5151(function($) { 5152 5153 if(!$) { 5154 return; 5155 } 5156 5157 //////////// 5158 // Plugin // 5159 //////////// 5160 5161 $.fn.headroom = function(option) { 5162 return this.each(function() { 5163 var $this = $(this), 5164 data = $this.data('headroom'), 5165 options = typeof option === 'object' && option; 5166 5167 options = $.extend(true, {}, Headroom.options, options); 5168 5169 if (!data) { 5170 data = new Headroom(this, options); 5171 data.init(); 5172 $this.data('headroom', data); 5173 } 5174 if (typeof option === 'string') { 5175 data[option](); 5176 5177 if(option === 'destroy'){ 5178 $this.removeData('headroom'); 5179 } 5180 } 5181 }); 5182 }; 5183 5184 ////////////// 5185 // Data API // 5186 ////////////// 5187 5188 $('[data-headroom]').each(function() { 5189 var $this = $(this); 5190 $this.headroom($this.data()); 5191 }); 5192 5193}(window.Zepto || window.jQuery)); 5194(function(b){function a(){if("undefined"==typeof jQuery){throw new Error("HoldOn.js requires jQuery")}var c={};c.open=function(e){$("#holdon-overlay").remove();var h="sk-rect";var g="";var f="";if(e){if(e.hasOwnProperty("theme")){h=e.theme}if(e.hasOwnProperty("message")){f=e.message}}
vendor: 5,769 bytes, lines 5194-5202
5194switch(h){case"custom":g='<div style="text-align: center;">'+e.content+"</div>";break;case"sk-dot":g='<div class="sk-dot"> <div class="sk-dot1"></div> <div class="sk-dot2"></div> </div>';break;case"sk-rect":g='<div class="sk-rect"> <div class="rect1"></div> <div class="rect2"></div> <div class="rect3"></div> <div class="rect4"></div> <div class="rect5"></div> </div>';break;case"sk-cube":g='<div class="sk-cube"> <div class="sk-cube1"></div> <div class="sk-cube2"></div> </div>';break;case"sk-bounce":g='<div class="sk-bounce"> <div class="bounce1"></div> <div class="bounce2"></div> <div class="bounce3"></div> </div>';break;case"sk-circle":g='<div class="sk-circle"> <div class="sk-circle1 sk-child"></div> <div class="sk-circle2 sk-child"></div> <div class="sk-circle3 sk-child"></div> <div class="sk-circle4 sk-child"></div> <div class="sk-circle5 sk-child"></div> <div class="sk-circle6 sk-child"></div> <div class="sk-circle7 sk-child"></div> <div class="sk-circle8 sk-child"></div> <div class="sk-circle9 sk-child"></div> <div class="sk-circle10 sk-child"></div> <div class="sk-circle11 sk-child"></div> <div class="sk-circle12 sk-child"></div> </div>';break;case"sk-cube-grid":g='<div class="sk-cube-grid"> <div class="sk-cube-child sk-cube-grid1"></div> <div class="sk-cube-child sk-cube-grid2"></div> <div class="sk-cube-child sk-cube-grid3"></div> <div class="sk-cube-child sk-cube-grid4"></div> <div class="sk-cube-child sk-cube-grid5"></div> <div class="sk-cube-child sk-cube-grid6"></div> <div class="sk-cube-child sk-cube-grid7"></div> <div class="sk-cube-child sk-cube-grid8"></div> <div class="sk-cube-child sk-cube-grid9"></div> </div>';break;case"sk-folding-cube":g='<div class="sk-folding-cube"> <div class="sk-cubechild1 sk-cube-parent"></div> <div class="sk-cubechild2 sk-cube-parent"></div> <div class="sk-cubechild4 sk-cube-parent"></div> <div class="sk-cubechild3 sk-cube-parent"></div> </div>';break;case"sk-fading-circle":g='<div class="sk-fading-circle"> <div class="sk-fading-circle1 sk-circle-child"></div> <div class="sk-fading-circle2 sk-circle-child"></div> <div class="sk-fading-circle3 sk-circle-child"></div> <div class="sk-fading-circle4 sk-circle-child"></div> <div class="sk-fading-circle5 sk-circle-child"></div> <div class="sk-fading-circle6 sk-circle-child"></div> <div class="sk-fading-circle7 sk-circle-child"></div> <div class="sk-fading-circle8 sk-circle-child"></div> <div class="sk-fading-circle9 sk-circle-child"></div> <div class="sk-fading-circle10 sk-circle-child"></div> <div class="sk-fading-circle11 sk-circle-child"></div> <div class="sk-fading-circle12 sk-circle-child"></div> </div>';break;default:g='<div class="sk-rect"> <div class="rect1"></div> <div class="rect2"></div> <div class="rect3"></div> <div class="rect4"></div> <div class="rect5"></div> </div>';console.warn(h+" doesn't exist for HoldOn.js");break}var d='<div id="holdon-overlay" style="display: none;">\n <div id="holdon-content-container">\n <div id="holdon-content">'+g+'</div>\n <div id="holdon-message">'+f+"</div>\n </div>\n </div>";$(d).appendTo("body").show();if(e){if(e.backgroundColor){$("#holdon-overlay").css("backgroundColor",e.backgroundColor)}if(e.backgroundColor){$("#holdon-message").css("color",e.textColor)}}};c.close=function(){$("#holdon-overlay").fadeOut(300,function(){$(this).remove()})};return c}if(typeof(HoldOn)==="undefined"){b.HoldOn=a()}})(window); 5195 5196/*! 5197 * imagesLoaded PACKAGED v4.1.4 5198 * JavaScript is all like "You images are done yet or what?" 5199 * MIT License 5200 */ 5201 5202!function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEac
vendor: 4,848 bytes, lines 5202-5254
5202h(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(h=t,h.fn.imagesLoaded=function(e,t){var i=new o(this,e,t);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o}); 5203//! moment.js 5204//! version : 2.29.4 5205//! authors : Tim Wood, Iskren Chernev, Moment.js contributors 5206//! license : MIT 5207//! momentjs.com 5208 5209;(function (global, factory) { 5210 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 5211 typeof define === 'function' && define.amd ? define(factory) : 5212 global.moment = factory() 5213}(this, (function () { 'use strict'; 5214 5215 var hookCallback; 5216 5217 function hooks() { 5218 return hookCallback.apply(null, arguments); 5219 } 5220 5221 // This is done to register the method called with moment() 5222 // without creating circular dependencies. 5223 function setHookCallback(callback) { 5224 hookCallback = callback; 5225 } 5226 5227 function isArray(input) { 5228 return ( 5229 input instanceof Array || 5230 Object.prototype.toString.call(input) === '[object Array]' 5231 ); 5232 } 5233 5234 function isObject(input) { 5235 // IE8 will treat undefined and null as object if it wasn't for 5236 // input != null 5237 return ( 5238 input != null && 5239 Object.prototype.toString.call(input) === '[object Object]' 5240 ); 5241 } 5242 5243 function hasOwnProp(a, b) { 5244 return Object.prototype.hasOwnProperty.call(a, b); 5245 } 5246 5247 function isObjectEmpty(obj) { 5248 if (Object.getOwnPropertyNames) { 5249 return Object.getOwnPropertyNames(obj).length === 0; 5250 } else { 5251 var k; 5252 for (k in obj) { 5253 if (hasOwnProp(obj, k)) { 5254 return false;
vendor: 54,955 bytes, lines 5255-7190
5255 } 5256 } 5257 return true; 5258 } 5259 } 5260 5261 function isUndefined(input) { 5262 return input === void 0; 5263 } 5264 5265 function isNumber(input) { 5266 return ( 5267 typeof input === 'number' || 5268 Object.prototype.toString.call(input) === '[object Number]' 5269 ); 5270 } 5271 5272 function isDate(input) { 5273 return ( 5274 input instanceof Date || 5275 Object.prototype.toString.call(input) === '[object Date]' 5276 ); 5277 } 5278 5279 function map(arr, fn) { 5280 var res = [], 5281 i, 5282 arrLen = arr.length; 5283 for (i = 0; i < arrLen; ++i) { 5284 res.push(fn(arr[i], i)); 5285 } 5286 return res; 5287 } 5288 5289 function extend(a, b) { 5290 for (var i in b) { 5291 if (hasOwnProp(b, i)) { 5292 a[i] = b[i]; 5293 } 5294 } 5295 5296 if (hasOwnProp(b, 'toString')) { 5297 a.toString = b.toString; 5298 } 5299 5300 if (hasOwnProp(b, 'valueOf')) { 5301 a.valueOf = b.valueOf; 5302 } 5303 5304 return a; 5305 } 5306 5307 function createUTC(input, format, locale, strict) { 5308 return createLocalOrUTC(input, format, locale, strict, true).utc(); 5309 } 5310 5311 function defaultParsingFlags() { 5312 // We need to deep clone this object. 5313 return { 5314 empty: false, 5315 unusedTokens: [], 5316 unusedInput: [], 5317 overflow: -2, 5318 charsLeftOver: 0, 5319 nullInput: false, 5320 invalidEra: null, 5321 invalidMonth: null, 5322 invalidFormat: false, 5323 userInvalidated: false, 5324 iso: false, 5325 parsedDateParts: [], 5326 era: null, 5327 meridiem: null, 5328 rfc2822: false, 5329 weekdayMismatch: false, 5330 }; 5331 } 5332 5333 function getParsingFlags(m) { 5334 if (m._pf == null) { 5335 m._pf = defaultParsingFlags(); 5336 } 5337 return m._pf; 5338 } 5339 5340 var some; 5341 if (Array.prototype.some) { 5342 some = Array.prototype.some; 5343 } else { 5344 some = function (fun) { 5345 var t = Object(this), 5346 len = t.length >>> 0, 5347 i; 5348 5349 for (i = 0; i < len; i++) { 5350 if (i in t && fun.call(this, t[i], i, t)) { 5351 return true; 5352 } 5353 } 5354 5355 return false; 5356 }; 5357 } 5358 5359 function isValid(m) { 5360 if (m._isValid == null) { 5361 var flags = getParsingFlags(m), 5362 parsedParts = some.call(flags.parsedDateParts, function (i) { 5363 return i != null; 5364 }), 5365 isNowValid = 5366 !isNaN(m._d.getTime()) && 5367 flags.overflow < 0 && 5368 !flags.empty && 5369 !flags.invalidEra && 5370 !flags.invalidMonth && 5371 !flags.invalidWeekday && 5372 !flags.weekdayMismatch && 5373 !flags.nullInput && 5374 !flags.invalidFormat && 5375 !flags.userInvalidated && 5376 (!flags.meridiem || (flags.meridiem && parsedParts)); 5377 5378 if (m._strict) { 5379 isNowValid = 5380 isNowValid && 5381 flags.charsLeftOver === 0 && 5382 flags.unusedTokens.length === 0 && 5383 flags.bigHour === undefined; 5384 } 5385 5386 if (Object.isFrozen == null || !Object.isFrozen(m)) { 5387 m._isValid = isNowValid; 5388 } else { 5389 return isNowValid; 5390 } 5391 } 5392 return m._isValid; 5393 } 5394 5395 function createInvalid(flags) { 5396 var m = createUTC(NaN); 5397 if (flags != null) { 5398 extend(getParsingFlags(m), flags); 5399 } else { 5400 getParsingFlags(m).userInvalidated = true; 5401 } 5402 5403 return m; 5404 } 5405 5406 // Plugins that add properties should also add the key here (null value), 5407 // so we can properly clone ourselves. 5408 var momentProperties = (hooks.momentProperties = []), 5409 updateInProgress = false; 5410 5411 function copyConfig(to, from) { 5412 var i, 5413 prop, 5414 val, 5415 momentPropertiesLen = momentProperties.length; 5416 5417 if (!isUndefined(from._isAMomentObject)) { 5418 to._isAMomentObject = from._isAMomentObject; 5419 } 5420 if (!isUndefined(from._i)) { 5421 to._i = from._i; 5422 } 5423 if (!isUndefined(from._f)) { 5424 to._f = from._f; 5425 } 5426 if (!isUndefined(from._l)) { 5427 to._l = from._l; 5428 } 5429 if (!isUndefined(from._strict)) { 5430 to._strict = from._strict; 5431 } 5432 if (!isUndefined(from._tzm)) { 5433 to._tzm = from._tzm; 5434 } 5435 if (!isUndefined(from._isUTC)) { 5436 to._isUTC = from._isUTC; 5437 } 5438 if (!isUndefined(from._offset)) { 5439 to._offset = from._offset; 5440 } 5441 if (!isUndefined(from._pf)) { 5442 to._pf = getParsingFlags(from); 5443 } 5444 if (!isUndefined(from._locale)) { 5445 to._locale = from._locale; 5446 } 5447 5448 if (momentPropertiesLen > 0) { 5449 for (i = 0; i < momentPropertiesLen; i++) { 5450 prop = momentProperties[i]; 5451 val = from[prop]; 5452 if (!isUndefined(val)) { 5453 to[prop] = val; 5454 } 5455 } 5456 } 5457 5458 return to; 5459 } 5460 5461 // Moment prototype object 5462 function Moment(config) { 5463 copyConfig(this, config); 5464 this._d = new Date(config._d != null ? config._d.getTime() : NaN); 5465 if (!this.isValid()) { 5466 this._d = new Date(NaN); 5467 } 5468 // Prevent infinite loop in case updateOffset creates new moment 5469 // objects. 5470 if (updateInProgress === false) { 5471 updateInProgress = true; 5472 hooks.updateOffset(this); 5473 updateInProgress = false; 5474 } 5475 } 5476 5477 function isMoment(obj) { 5478 return ( 5479 obj instanceof Moment || (obj != null && obj._isAMomentObject != null) 5480 ); 5481 } 5482 5483 function warn(msg) { 5484 if ( 5485 hooks.suppressDeprecationWarnings === false && 5486 typeof console !== 'undefined' && 5487 console.warn 5488 ) { 5489 console.warn('Deprecation warning: ' + msg); 5490 } 5491 } 5492 5493 function deprecate(msg, fn) { 5494 var firstTime = true; 5495 5496 return extend(function () { 5497 if (hooks.deprecationHandler != null) { 5498 hooks.deprecationHandler(null, msg); 5499 } 5500 if (firstTime) { 5501 var args = [], 5502 arg, 5503 i, 5504 key, 5505 argLen = arguments.length; 5506 for (i = 0; i < argLen; i++) { 5507 arg = ''; 5508 if (typeof arguments[i] === 'object') { 5509 arg += '\n[' + i + '] '; 5510 for (key in arguments[0]) { 5511 if (hasOwnProp(arguments[0], key)) { 5512 arg += key + ': ' + arguments[0][key] + ', '; 5513 } 5514 } 5515 arg = arg.slice(0, -2); // Remove trailing comma and space 5516 } else { 5517 arg = arguments[i]; 5518 } 5519 args.push(arg); 5520 } 5521 warn( 5522 msg + 5523 '\nArguments: ' + 5524 Array.prototype.slice.call(args).join('') + 5525 '\n' + 5526 new Error().stack 5527 ); 5528 firstTime = false; 5529 } 5530 return fn.apply(this, arguments); 5531 }, fn); 5532 } 5533 5534 var deprecations = {}; 5535 5536 function deprecateSimple(name, msg) { 5537 if (hooks.deprecationHandler != null) { 5538 hooks.deprecationHandler(name, msg); 5539 } 5540 if (!deprecations[name]) { 5541 warn(msg); 5542 deprecations[name] = true; 5543 } 5544 } 5545 5546 hooks.suppressDeprecationWarnings = false; 5547 hooks.deprecationHandler = null; 5548 5549 function isFunction(input) { 5550 return ( 5551 (typeof Function !== 'undefined' && input instanceof Function) || 5552 Object.prototype.toString.call(input) === '[object Function]' 5553 ); 5554 } 5555 5556 function set(config) { 5557 var prop, i; 5558 for (i in config) { 5559 if (hasOwnProp(config, i)) { 5560 prop = config[i]; 5561 if (isFunction(prop)) { 5562 this[i] = prop; 5563 } else { 5564 this['_' + i] = prop; 5565 } 5566 } 5567 } 5568 this._config = config; 5569 // Lenient ordinal parsing accepts just a number in addition to 5570 // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. 5571 // TODO: Remove "ordinalParse" fallback in next major release. 5572 this._dayOfMonthOrdinalParseLenient = new RegExp( 5573 (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + 5574 '|' + 5575 /\d{1,2}/.source 5576 ); 5577 } 5578 5579 function mergeConfigs(parentConfig, childConfig) { 5580 var res = extend({}, parentConfig), 5581 prop; 5582 for (prop in childConfig) { 5583 if (hasOwnProp(childConfig, prop)) { 5584 if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { 5585 res[prop] = {}; 5586 extend(res[prop], parentConfig[prop]); 5587 extend(res[prop], childConfig[prop]); 5588 } else if (childConfig[prop] != null) { 5589 res[prop] = childConfig[prop]; 5590 } else { 5591 delete res[prop]; 5592 } 5593 } 5594 } 5595 for (prop in parentConfig) { 5596 if ( 5597 hasOwnProp(parentConfig, prop) && 5598 !hasOwnProp(childConfig, prop) && 5599 isObject(parentConfig[prop]) 5600 ) { 5601 // make sure changes to properties don't modify parent config 5602 res[prop] = extend({}, res[prop]); 5603 } 5604 } 5605 return res; 5606 } 5607 5608 function Locale(config) { 5609 if (config != null) { 5610 this.set(config); 5611 } 5612 } 5613 5614 var keys; 5615 5616 if (Object.keys) { 5617 keys = Object.keys; 5618 } else { 5619 keys = function (obj) { 5620 var i, 5621 res = []; 5622 for (i in obj) { 5623 if (hasOwnProp(obj, i)) { 5624 res.push(i); 5625 } 5626 } 5627 return res; 5628 }; 5629 } 5630 5631 var defaultCalendar = { 5632 sameDay: '[Today at] LT', 5633 nextDay: '[Tomorrow at] LT', 5634 nextWeek: 'dddd [at] LT', 5635 lastDay: '[Yesterday at] LT', 5636 lastWeek: '[Last] dddd [at] LT', 5637 sameElse: 'L', 5638 }; 5639 5640 function calendar(key, mom, now) { 5641 var output = this._calendar[key] || this._calendar['sameElse']; 5642 return isFunction(output) ? output.call(mom, now) : output; 5643 } 5644 5645 function zeroFill(number, targetLength, forceSign) { 5646 var absNumber = '' + Math.abs(number), 5647 zerosToFill = targetLength - absNumber.length, 5648 sign = number >= 0; 5649 return ( 5650 (sign ? (forceSign ? '+' : '') : '-') + 5651 Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + 5652 absNumber 5653 ); 5654 } 5655 5656 var formattingTokens = 5657 /(\[[^\[]*\])|(\\)?([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, 5658 localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, 5659 formatFunctions = {}, 5660 formatTokenFunctions = {}; 5661 5662 // token: 'M' 5663 // padded: ['MM', 2] 5664 // ordinal: 'Mo' 5665 // callback: function () { this.month() + 1 } 5666 function addFormatToken(token, padded, ordinal, callback) { 5667 var func = callback; 5668 if (typeof callback === 'string') { 5669 func = function () { 5670 return this[callback](); 5671 }; 5672 } 5673 if (token) { 5674 formatTokenFunctions[token] = func; 5675 } 5676 if (padded) { 5677 formatTokenFunctions[padded[0]] = function () { 5678 return zeroFill(func.apply(this, arguments), padded[1], padded[2]); 5679 }; 5680 } 5681 if (ordinal) { 5682 formatTokenFunctions[ordinal] = function () { 5683 return this.localeData().ordinal( 5684 func.apply(this, arguments), 5685 token 5686 ); 5687 }; 5688 } 5689 } 5690 5691 function removeFormattingTokens(input) { 5692 if (input.match(/\[[\s\S]/)) { 5693 return input.replace(/^\[|\]$/g, ''); 5694 } 5695 return input.replace(/\\/g, ''); 5696 } 5697 5698 function makeFormatFunction(format) { 5699 var array = format.match(formattingTokens), 5700 i, 5701 length; 5702 5703 for (i = 0, length = array.length; i < length; i++) { 5704 if (formatTokenFunctions[array[i]]) { 5705 array[i] = formatTokenFunctions[array[i]]; 5706 } else { 5707 array[i] = removeFormattingTokens(array[i]); 5708 } 5709 } 5710 5711 return function (mom) { 5712 var output = '', 5713 i; 5714 for (i = 0; i < length; i++) { 5715 output += isFunction(array[i]) 5716 ? array[i].call(mom, format) 5717 : array[i]; 5718 } 5719 return output; 5720 }; 5721 } 5722 5723 // format date using native date object 5724 function formatMoment(m, format) { 5725 if (!m.isValid()) { 5726 return m.localeData().invalidDate(); 5727 } 5728 5729 format = expandFormat(format, m.localeData()); 5730 formatFunctions[format] = 5731 formatFunctions[format] || makeFormatFunction(format); 5732 5733 return formatFunctions[format](m); 5734 } 5735 5736 function expandFormat(format, locale) { 5737 var i = 5; 5738 5739 function replaceLongDateFormatTokens(input) { 5740 return locale.longDateFormat(input) || input; 5741 } 5742 5743 localFormattingTokens.lastIndex = 0; 5744 while (i >= 0 && localFormattingTokens.test(format)) { 5745 format = format.replace( 5746 localFormattingTokens, 5747 replaceLongDateFormatTokens 5748 ); 5749 localFormattingTokens.lastIndex = 0; 5750 i -= 1; 5751 } 5752 5753 return format; 5754 } 5755 5756 var defaultLongDateFormat = { 5757 LTS: 'h:mm:ss A', 5758 LT: 'h:mm A', 5759 L: 'MM/DD/YYYY', 5760 LL: 'MMMM D, YYYY', 5761 LLL: 'MMMM D, YYYY h:mm A', 5762 LLLL: 'dddd, MMMM D, YYYY h:mm A', 5763 }; 5764 5765 function longDateFormat(key) { 5766 var format = this._longDateFormat[key], 5767 formatUpper = this._longDateFormat[key.toUpperCase()]; 5768 5769 if (format || !formatUpper) { 5770 return format; 5771 } 5772 5773 this._longDateFormat[key] = formatUpper 5774 .match(formattingTokens) 5775 .map(function (tok) { 5776 if ( 5777 tok === 'MMMM' || 5778 tok === 'MM' || 5779 tok === 'DD' || 5780 tok === 'dddd' 5781 ) { 5782 return tok.slice(1); 5783 } 5784 return tok; 5785 }) 5786 .join(''); 5787 5788 return this._longDateFormat[key]; 5789 } 5790 5791 var defaultInvalidDate = 'Invalid date'; 5792 5793 function invalidDate() { 5794 return this._invalidDate; 5795 } 5796 5797 var defaultOrdinal = '%d', 5798 defaultDayOfMonthOrdinalParse = /\d{1,2}/; 5799 5800 function ordinal(number) { 5801 return this._ordinal.replace('%d', number); 5802 } 5803 5804 var defaultRelativeTime = { 5805 future: 'in %s', 5806 past: '%s ago', 5807 s: 'a few seconds', 5808 ss: '%d seconds', 5809 m: 'a minute', 5810 mm: '%d minutes', 5811 h: 'an hour', 5812 hh: '%d hours', 5813 d: 'a day', 5814 dd: '%d days', 5815 w: 'a week', 5816 ww: '%d weeks', 5817 M: 'a month', 5818 MM: '%d months', 5819 y: 'a year', 5820 yy: '%d years', 5821 }; 5822 5823 function relativeTime(number, withoutSuffix, string, isFuture) { 5824 var output = this._relativeTime[string]; 5825 return isFunction(output) 5826 ? output(number, withoutSuffix, string, isFuture) 5827 : output.replace(/%d/i, number); 5828 } 5829 5830 function pastFuture(diff, output) { 5831 var format = this._relativeTime[diff > 0 ? 'future' : 'past']; 5832 return isFunction(format) ? format(output) : format.replace(/%s/i, output); 5833 } 5834 5835 var aliases = {}; 5836 5837 function addUnitAlias(unit, shorthand) { 5838 var lowerCase = unit.toLowerCase(); 5839 aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; 5840 } 5841 5842 function normalizeUnits(units) { 5843 return typeof units === 'string' 5844 ? aliases[units] || aliases[units.toLowerCase()] 5845 : undefined; 5846 } 5847 5848 function normalizeObjectUnits(inputObject) { 5849 var normalizedInput = {}, 5850 normalizedProp, 5851 prop; 5852 5853 for (prop in inputObject) { 5854 if (hasOwnProp(inputObject, prop)) { 5855 normalizedProp = normalizeUnits(prop); 5856 if (normalizedProp) { 5857 normalizedInput[normalizedProp] = inputObject[prop]; 5858 } 5859 } 5860 } 5861 5862 return normalizedInput; 5863 } 5864 5865 var priorities = {}; 5866 5867 function addUnitPriority(unit, priority) { 5868 priorities[unit] = priority; 5869 } 5870 5871 function getPrioritizedUnits(unitsObj) { 5872 var units = [], 5873 u; 5874 for (u in unitsObj) { 5875 if (hasOwnProp(unitsObj, u)) { 5876 units.push({ unit: u, priority: priorities[u] }); 5877 } 5878 } 5879 units.sort(function (a, b) { 5880 return a.priority - b.priority; 5881 }); 5882 return units; 5883 } 5884 5885 function isLeapYear(year) { 5886 return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; 5887 } 5888 5889 function absFloor(number) { 5890 if (number < 0) { 5891 // -0 -> 0 5892 return Math.ceil(number) || 0; 5893 } else { 5894 return Math.floor(number); 5895 } 5896 } 5897 5898 function toInt(argumentForCoercion) { 5899 var coercedNumber = +argumentForCoercion, 5900 value = 0; 5901 5902 if (coercedNumber !== 0 && isFinite(coercedNumber)) { 5903 value = absFloor(coercedNumber); 5904 } 5905 5906 return value; 5907 } 5908 5909 function makeGetSet(unit, keepTime) { 5910 return function (value) { 5911 if (value != null) { 5912 set$1(this, unit, value); 5913 hooks.updateOffset(this, keepTime); 5914 return this; 5915 } else { 5916 return get(this, unit); 5917 } 5918 }; 5919 } 5920 5921 function get(mom, unit) { 5922 return mom.isValid() 5923 ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() 5924 : NaN; 5925 } 5926 5927 function set$1(mom, unit, value) { 5928 if (mom.isValid() && !isNaN(value)) { 5929 if ( 5930 unit === 'FullYear' && 5931 isLeapYear(mom.year()) && 5932 mom.month() === 1 && 5933 mom.date() === 29 5934 ) { 5935 value = toInt(value); 5936 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit]( 5937 value, 5938 mom.month(), 5939 daysInMonth(value, mom.month()) 5940 ); 5941 } else { 5942 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); 5943 } 5944 } 5945 } 5946 5947 // MOMENTS 5948 5949 function stringGet(units) { 5950 units = normalizeUnits(units); 5951 if (isFunction(this[units])) { 5952 return this[units](); 5953 } 5954 return this; 5955 } 5956 5957 function stringSet(units, value) { 5958 if (typeof units === 'object') { 5959 units = normalizeObjectUnits(units); 5960 var prioritized = getPrioritizedUnits(units), 5961 i, 5962 prioritizedLen = prioritized.length; 5963 for (i = 0; i < prioritizedLen; i++) { 5964 this[prioritized[i].unit](units[prioritized[i].unit]); 5965 } 5966 } else { 5967 units = normalizeUnits(units); 5968 if (isFunction(this[units])) { 5969 return this[units](value); 5970 } 5971 } 5972 return this; 5973 } 5974 5975 var match1 = /\d/, // 0 - 9 5976 match2 = /\d\d/, // 00 - 99 5977 match3 = /\d{3}/, // 000 - 999 5978 match4 = /\d{4}/, // 0000 - 9999 5979 match6 = /[+-]?\d{6}/, // -999999 - 999999 5980 match1to2 = /\d\d?/, // 0 - 99 5981 match3to4 = /\d\d\d\d?/, // 999 - 9999 5982 match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999 5983 match1to3 = /\d{1,3}/, // 0 - 999 5984 match1to4 = /\d{1,4}/, // 0 - 9999 5985 match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999 5986 matchUnsigned = /\d+/, // 0 - inf 5987 matchSigned = /[+-]?\d+/, // -inf - inf 5988 matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z 5989 matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z 5990 matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 5991 // any word (or two) characters or numbers including two/three word month in arabic. 5992 // includes scottish gaelic two word and hyphenated months 5993 matchWord = 5994 /[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, 5995 regexes; 5996 5997 regexes = {}; 5998 5999 function addRegexToken(token, regex, strictRegex) { 6000 regexes[token] = isFunction(regex) 6001 ? regex 6002 : function (isStrict, localeData) { 6003 return isStrict && strictRegex ? strictRegex : regex; 6004 }; 6005 } 6006 6007 function getParseRegexForToken(token, config) { 6008 if (!hasOwnProp(regexes, token)) { 6009 return new RegExp(unescapeFormat(token)); 6010 } 6011 6012 return regexes[token](config._strict, config._locale); 6013 } 6014 6015 // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript 6016 function unescapeFormat(s) { 6017 return regexEscape( 6018 s 6019 .replace('\\', '') 6020 .replace( 6021 /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, 6022 function (matched, p1, p2, p3, p4) { 6023 return p1 || p2 || p3 || p4; 6024 } 6025 ) 6026 ); 6027 } 6028 6029 function regexEscape(s) { 6030 return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); 6031 } 6032 6033 var tokens = {}; 6034 6035 function addParseToken(token, callback) { 6036 var i, 6037 func = callback, 6038 tokenLen; 6039 if (typeof token === 'string') { 6040 token = [token]; 6041 } 6042 if (isNumber(callback)) { 6043 func = function (input, array) { 6044 array[callback] = toInt(input); 6045 }; 6046 } 6047 tokenLen = token.length; 6048 for (i = 0; i < tokenLen; i++) { 6049 tokens[token[i]] = func; 6050 } 6051 } 6052 6053 function addWeekParseToken(token, callback) { 6054 addParseToken(token, function (input, array, config, token) { 6055 config._w = config._w || {}; 6056 callback(input, config._w, config, token); 6057 }); 6058 } 6059 6060 function addTimeToArrayFromToken(token, input, config) { 6061 if (input != null && hasOwnProp(tokens, token)) { 6062 tokens[token](input, config._a, config, token); 6063 } 6064 } 6065 6066 var YEAR = 0, 6067 MONTH = 1, 6068 DATE = 2, 6069 HOUR = 3, 6070 MINUTE = 4, 6071 SECOND = 5, 6072 MILLISECOND = 6, 6073 WEEK = 7, 6074 WEEKDAY = 8; 6075 6076 function mod(n, x) { 6077 return ((n % x) + x) % x; 6078 } 6079 6080 var indexOf; 6081 6082 if (Array.prototype.indexOf) { 6083 indexOf = Array.prototype.indexOf; 6084 } else { 6085 indexOf = function (o) { 6086 // I know 6087 var i; 6088 for (i = 0; i < this.length; ++i) { 6089 if (this[i] === o) { 6090 return i; 6091 } 6092 } 6093 return -1; 6094 }; 6095 } 6096 6097 function daysInMonth(year, month) { 6098 if (isNaN(year) || isNaN(month)) { 6099 return NaN; 6100 } 6101 var modMonth = mod(month, 12); 6102 year += (month - modMonth) / 12; 6103 return modMonth === 1 6104 ? isLeapYear(year) 6105 ? 29 6106 : 28 6107 : 31 - ((modMonth % 7) % 2); 6108 } 6109 6110 // FORMATTING 6111 6112 addFormatToken('M', ['MM', 2], 'Mo', function () { 6113 return this.month() + 1; 6114 }); 6115 6116 addFormatToken('MMM', 0, 0, function (format) { 6117 return this.localeData().monthsShort(this, format); 6118 }); 6119 6120 addFormatToken('MMMM', 0, 0, function (format) { 6121 return this.localeData().months(this, format); 6122 }); 6123 6124 // ALIASES 6125 6126 addUnitAlias('month', 'M'); 6127 6128 // PRIORITY 6129 6130 addUnitPriority('month', 8); 6131 6132 // PARSING 6133 6134 addRegexToken('M', match1to2); 6135 addRegexToken('MM', match1to2, match2); 6136 addRegexToken('MMM', function (isStrict, locale) { 6137 return locale.monthsShortRegex(isStrict); 6138 }); 6139 addRegexToken('MMMM', function (isStrict, locale) { 6140 return locale.monthsRegex(isStrict); 6141 }); 6142 6143 addParseToken(['M', 'MM'], function (input, array) { 6144 array[MONTH] = toInt(input) - 1; 6145 }); 6146 6147 addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { 6148 var month = config._locale.monthsParse(input, token, config._strict); 6149 // if we didn't find a month name, mark the date as invalid. 6150 if (month != null) { 6151 array[MONTH] = month; 6152 } else { 6153 getParsingFlags(config).invalidMonth = input; 6154 } 6155 }); 6156 6157 // LOCALES 6158 6159 var defaultLocaleMonths = 6160 'January_February_March_April_May_June_July_August_September_October_November_December'.split( 6161 '_' 6162 ), 6163 defaultLocaleMonthsShort = 6164 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), 6165 MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, 6166 defaultMonthsShortRegex = matchWord, 6167 defaultMonthsRegex = matchWord; 6168 6169 function localeMonths(m, format) { 6170 if (!m) { 6171 return isArray(this._months) 6172 ? this._months 6173 : this._months['standalone']; 6174 } 6175 return isArray(this._months) 6176 ? this._months[m.month()] 6177 : this._months[ 6178 (this._months.isFormat || MONTHS_IN_FORMAT).test(format) 6179 ? 'format' 6180 : 'standalone' 6181 ][m.month()]; 6182 } 6183 6184 function localeMonthsShort(m, format) { 6185 if (!m) { 6186 return isArray(this._monthsShort) 6187 ? this._monthsShort 6188 : this._monthsShort['standalone']; 6189 } 6190 return isArray(this._monthsShort) 6191 ? this._monthsShort[m.month()] 6192 : this._monthsShort[ 6193 MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone' 6194 ][m.month()]; 6195 } 6196 6197 function handleStrictParse(monthName, format, strict) { 6198 var i, 6199 ii, 6200 mom, 6201 llc = monthName.toLocaleLowerCase(); 6202 if (!this._monthsParse) { 6203 // this is not used 6204 this._monthsParse = []; 6205 this._longMonthsParse = []; 6206 this._shortMonthsParse = []; 6207 for (i = 0; i < 12; ++i) { 6208 mom = createUTC([2000, i]); 6209 this._shortMonthsParse[i] = this.monthsShort( 6210 mom, 6211 '' 6212 ).toLocaleLowerCase(); 6213 this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); 6214 } 6215 } 6216 6217 if (strict) { 6218 if (format === 'MMM') { 6219 ii = indexOf.call(this._shortMonthsParse, llc); 6220 return ii !== -1 ? ii : null; 6221 } else { 6222 ii = indexOf.call(this._longMonthsParse, llc); 6223 return ii !== -1 ? ii : null; 6224 } 6225 } else { 6226 if (format === 'MMM') { 6227 ii = indexOf.call(this._shortMonthsParse, llc); 6228 if (ii !== -1) { 6229 return ii; 6230 } 6231 ii = indexOf.call(this._longMonthsParse, llc); 6232 return ii !== -1 ? ii : null; 6233 } else { 6234 ii = indexOf.call(this._longMonthsParse, llc); 6235 if (ii !== -1) { 6236 return ii; 6237 } 6238 ii = indexOf.call(this._shortMonthsParse, llc); 6239 return ii !== -1 ? ii : null; 6240 } 6241 } 6242 } 6243 6244 function localeMonthsParse(monthName, format, strict) { 6245 var i, mom, regex; 6246 6247 if (this._monthsParseExact) { 6248 return handleStrictParse.call(this, monthName, format, strict); 6249 } 6250 6251 if (!this._monthsParse) { 6252 this._monthsParse = []; 6253 this._longMonthsParse = []; 6254 this._shortMonthsParse = []; 6255 } 6256 6257 // TODO: add sorting 6258 // Sorting makes sure if one month (or abbr) is a prefix of another 6259 // see sorting in computeMonthsParse 6260 for (i = 0; i < 12; i++) { 6261 // make the regex if we don't have it already 6262 mom = createUTC([2000, i]); 6263 if (strict && !this._longMonthsParse[i]) { 6264 this._longMonthsParse[i] = new RegExp( 6265 '^' + this.months(mom, '').replace('.', '') + '$', 6266 'i' 6267 ); 6268 this._shortMonthsParse[i] = new RegExp( 6269 '^' + this.monthsShort(mom, '').replace('.', '') + '$', 6270 'i' 6271 ); 6272 } 6273 if (!strict && !this._monthsParse[i]) { 6274 regex = 6275 '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); 6276 this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); 6277 } 6278 // test the regex 6279 if ( 6280 strict && 6281 format === 'MMMM' && 6282 this._longMonthsParse[i].test(monthName) 6283 ) { 6284 return i; 6285 } else if ( 6286 strict && 6287 format === 'MMM' && 6288 this._shortMonthsParse[i].test(monthName) 6289 ) { 6290 return i; 6291 } else if (!strict && this._monthsParse[i].test(monthName)) { 6292 return i; 6293 } 6294 } 6295 } 6296 6297 // MOMENTS 6298 6299 function setMonth(mom, value) { 6300 var dayOfMonth; 6301 6302 if (!mom.isValid()) { 6303 // No op 6304 return mom; 6305 } 6306 6307 if (typeof value === 'string') { 6308 if (/^\d+$/.test(value)) { 6309 value = toInt(value); 6310 } else { 6311 value = mom.localeData().monthsParse(value); 6312 // TODO: Another silent failure? 6313 if (!isNumber(value)) { 6314 return mom; 6315 } 6316 } 6317 } 6318 6319 dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); 6320 mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); 6321 return mom; 6322 } 6323 6324 function getSetMonth(value) { 6325 if (value != null) { 6326 setMonth(this, value); 6327 hooks.updateOffset(this, true); 6328 return this; 6329 } else { 6330 return get(this, 'Month'); 6331 } 6332 } 6333 6334 function getDaysInMonth() { 6335 return daysInMonth(this.year(), this.month()); 6336 } 6337 6338 function monthsShortRegex(isStrict) { 6339 if (this._monthsParseExact) { 6340 if (!hasOwnProp(this, '_monthsRegex')) { 6341 computeMonthsParse.call(this); 6342 } 6343 if (isStrict) { 6344 return this._monthsShortStrictRegex; 6345 } else { 6346 return this._monthsShortRegex; 6347 } 6348 } else { 6349 if (!hasOwnProp(this, '_monthsShortRegex')) { 6350 this._monthsShortRegex = defaultMonthsShortRegex; 6351 } 6352 return this._monthsShortStrictRegex && isStrict 6353 ? this._monthsShortStrictRegex 6354 : this._monthsShortRegex; 6355 } 6356 } 6357 6358 function monthsRegex(isStrict) { 6359 if (this._monthsParseExact) { 6360 if (!hasOwnProp(this, '_monthsRegex')) { 6361 computeMonthsParse.call(this); 6362 } 6363 if (isStrict) { 6364 return this._monthsStrictRegex; 6365 } else { 6366 return this._monthsRegex; 6367 } 6368 } else { 6369 if (!hasOwnProp(this, '_monthsRegex')) { 6370 this._monthsRegex = defaultMonthsRegex; 6371 } 6372 return this._monthsStrictRegex && isStrict 6373 ? this._monthsStrictRegex 6374 : this._monthsRegex; 6375 } 6376 } 6377 6378 function computeMonthsParse() { 6379 function cmpLenRev(a, b) { 6380 return b.length - a.length; 6381 } 6382 6383 var shortPieces = [], 6384 longPieces = [], 6385 mixedPieces = [], 6386 i, 6387 mom; 6388 for (i = 0; i < 12; i++) { 6389 // make the regex if we don't have it already 6390 mom = createUTC([2000, i]); 6391 shortPieces.push(this.monthsShort(mom, '')); 6392 longPieces.push(this.months(mom, '')); 6393 mixedPieces.push(this.months(mom, '')); 6394 mixedPieces.push(this.monthsShort(mom, '')); 6395 } 6396 // Sorting makes sure if one month (or abbr) is a prefix of another it 6397 // will match the longer piece. 6398 shortPieces.sort(cmpLenRev); 6399 longPieces.sort(cmpLenRev); 6400 mixedPieces.sort(cmpLenRev); 6401 for (i = 0; i < 12; i++) { 6402 shortPieces[i] = regexEscape(shortPieces[i]); 6403 longPieces[i] = regexEscape(longPieces[i]); 6404 } 6405 for (i = 0; i < 24; i++) { 6406 mixedPieces[i] = regexEscape(mixedPieces[i]); 6407 } 6408 6409 this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 6410 this._monthsShortRegex = this._monthsRegex; 6411 this._monthsStrictRegex = new RegExp( 6412 '^(' + longPieces.join('|') + ')', 6413 'i' 6414 ); 6415 this._monthsShortStrictRegex = new RegExp( 6416 '^(' + shortPieces.join('|') + ')', 6417 'i' 6418 ); 6419 } 6420 6421 // FORMATTING 6422 6423 addFormatToken('Y', 0, 0, function () { 6424 var y = this.year(); 6425 return y <= 9999 ? zeroFill(y, 4) : '+' + y; 6426 }); 6427 6428 addFormatToken(0, ['YY', 2], 0, function () { 6429 return this.year() % 100; 6430 }); 6431 6432 addFormatToken(0, ['YYYY', 4], 0, 'year'); 6433 addFormatToken(0, ['YYYYY', 5], 0, 'year'); 6434 addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); 6435 6436 // ALIASES 6437 6438 addUnitAlias('year', 'y'); 6439 6440 // PRIORITIES 6441 6442 addUnitPriority('year', 1); 6443 6444 // PARSING 6445 6446 addRegexToken('Y', matchSigned); 6447 addRegexToken('YY', match1to2, match2); 6448 addRegexToken('YYYY', match1to4, match4); 6449 addRegexToken('YYYYY', match1to6, match6); 6450 addRegexToken('YYYYYY', match1to6, match6); 6451 6452 addParseToken(['YYYYY', 'YYYYYY'], YEAR); 6453 addParseToken('YYYY', function (input, array) { 6454 array[YEAR] = 6455 input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); 6456 }); 6457 addParseToken('YY', function (input, array) { 6458 array[YEAR] = hooks.parseTwoDigitYear(input); 6459 }); 6460 addParseToken('Y', function (input, array) { 6461 array[YEAR] = parseInt(input, 10); 6462 }); 6463 6464 // HELPERS 6465 6466 function daysInYear(year) { 6467 return isLeapYear(year) ? 366 : 365; 6468 } 6469 6470 // HOOKS 6471 6472 hooks.parseTwoDigitYear = function (input) { 6473 return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); 6474 }; 6475 6476 // MOMENTS 6477 6478 var getSetYear = makeGetSet('FullYear', true); 6479 6480 function getIsLeapYear() { 6481 return isLeapYear(this.year()); 6482 } 6483 6484 function createDate(y, m, d, h, M, s, ms) { 6485 // can't just apply() to create a date: 6486 // https://stackoverflow.com/q/181348 6487 var date; 6488 // the date constructor remaps years 0-99 to 1900-1999 6489 if (y < 100 && y >= 0) { 6490 // preserve leap years using a full 400 year cycle, then reset 6491 date = new Date(y + 400, m, d, h, M, s, ms); 6492 if (isFinite(date.getFullYear())) { 6493 date.setFullYear(y); 6494 } 6495 } else { 6496 date = new Date(y, m, d, h, M, s, ms); 6497 } 6498 6499 return date; 6500 } 6501 6502 function createUTCDate(y) { 6503 var date, args; 6504 // the Date.UTC function remaps years 0-99 to 1900-1999 6505 if (y < 100 && y >= 0) { 6506 args = Array.prototype.slice.call(arguments); 6507 // preserve leap years using a full 400 year cycle, then reset 6508 args[0] = y + 400; 6509 date = new Date(Date.UTC.apply(null, args)); 6510 if (isFinite(date.getUTCFullYear())) { 6511 date.setUTCFullYear(y); 6512 } 6513 } else { 6514 date = new Date(Date.UTC.apply(null, arguments)); 6515 } 6516 6517 return date; 6518 } 6519 6520 // start-of-first-week - start-of-year 6521 function firstWeekOffset(year, dow, doy) { 6522 var // first-week day -- which january is always in the first week (4 for iso, 1 for other) 6523 fwd = 7 + dow - doy, 6524 // first-week day local weekday -- which local weekday is fwd 6525 fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; 6526 6527 return -fwdlw + fwd - 1; 6528 } 6529 6530 // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday 6531 function dayOfYearFromWeeks(year, week, weekday, dow, doy) { 6532 var localWeekday = (7 + weekday - dow) % 7, 6533 weekOffset = firstWeekOffset(year, dow, doy), 6534 dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, 6535 resYear, 6536 resDayOfYear; 6537 6538 if (dayOfYear <= 0) { 6539 resYear = year - 1; 6540 resDayOfYear = daysInYear(resYear) + dayOfYear; 6541 } else if (dayOfYear > daysInYear(year)) { 6542 resYear = year + 1; 6543 resDayOfYear = dayOfYear - daysInYear(year); 6544 } else { 6545 resYear = year; 6546 resDayOfYear = dayOfYear; 6547 } 6548 6549 return { 6550 year: resYear, 6551 dayOfYear: resDayOfYear, 6552 }; 6553 } 6554 6555 function weekOfYear(mom, dow, doy) { 6556 var weekOffset = firstWeekOffset(mom.year(), dow, doy), 6557 week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, 6558 resWeek, 6559 resYear; 6560 6561 if (week < 1) { 6562 resYear = mom.year() - 1; 6563 resWeek = week + weeksInYear(resYear, dow, doy); 6564 } else if (week > weeksInYear(mom.year(), dow, doy)) { 6565 resWeek = week - weeksInYear(mom.year(), dow, doy); 6566 resYear = mom.year() + 1; 6567 } else { 6568 resYear = mom.year(); 6569 resWeek = week; 6570 } 6571 6572 return { 6573 week: resWeek, 6574 year: resYear, 6575 }; 6576 } 6577 6578 function weeksInYear(year, dow, doy) { 6579 var weekOffset = firstWeekOffset(year, dow, doy), 6580 weekOffsetNext = firstWeekOffset(year + 1, dow, doy); 6581 return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; 6582 } 6583 6584 // FORMATTING 6585 6586 addFormatToken('w', ['ww', 2], 'wo', 'week'); 6587 addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); 6588 6589 // ALIASES 6590 6591 addUnitAlias('week', 'w'); 6592 addUnitAlias('isoWeek', 'W'); 6593 6594 // PRIORITIES 6595 6596 addUnitPriority('week', 5); 6597 addUnitPriority('isoWeek', 5); 6598 6599 // PARSING 6600 6601 addRegexToken('w', match1to2); 6602 addRegexToken('ww', match1to2, match2); 6603 addRegexToken('W', match1to2); 6604 addRegexToken('WW', match1to2, match2); 6605 6606 addWeekParseToken( 6607 ['w', 'ww', 'W', 'WW'], 6608 function (input, week, config, token) { 6609 week[token.substr(0, 1)] = toInt(input); 6610 } 6611 ); 6612 6613 // HELPERS 6614 6615 // LOCALES 6616 6617 function localeWeek(mom) { 6618 return weekOfYear(mom, this._week.dow, this._week.doy).week; 6619 } 6620 6621 var defaultLocaleWeek = { 6622 dow: 0, // Sunday is the first day of the week. 6623 doy: 6, // The week that contains Jan 6th is the first week of the year. 6624 }; 6625 6626 function localeFirstDayOfWeek() { 6627 return this._week.dow; 6628 } 6629 6630 function localeFirstDayOfYear() { 6631 return this._week.doy; 6632 } 6633 6634 // MOMENTS 6635 6636 function getSetWeek(input) { 6637 var week = this.localeData().week(this); 6638 return input == null ? week : this.add((input - week) * 7, 'd'); 6639 } 6640 6641 function getSetISOWeek(input) { 6642 var week = weekOfYear(this, 1, 4).week; 6643 return input == null ? week : this.add((input - week) * 7, 'd'); 6644 } 6645 6646 // FORMATTING 6647 6648 addFormatToken('d', 0, 'do', 'day'); 6649 6650 addFormatToken('dd', 0, 0, function (format) { 6651 return this.localeData().weekdaysMin(this, format); 6652 }); 6653 6654 addFormatToken('ddd', 0, 0, function (format) { 6655 return this.localeData().weekdaysShort(this, format); 6656 }); 6657 6658 addFormatToken('dddd', 0, 0, function (format) { 6659 return this.localeData().weekdays(this, format); 6660 }); 6661 6662 addFormatToken('e', 0, 0, 'weekday'); 6663 addFormatToken('E', 0, 0, 'isoWeekday'); 6664 6665 // ALIASES 6666 6667 addUnitAlias('day', 'd'); 6668 addUnitAlias('weekday', 'e'); 6669 addUnitAlias('isoWeekday', 'E'); 6670 6671 // PRIORITY 6672 addUnitPriority('day', 11); 6673 addUnitPriority('weekday', 11); 6674 addUnitPriority('isoWeekday', 11); 6675 6676 // PARSING 6677 6678 addRegexToken('d', match1to2); 6679 addRegexToken('e', match1to2); 6680 addRegexToken('E', match1to2); 6681 addRegexToken('dd', function (isStrict, locale) { 6682 return locale.weekdaysMinRegex(isStrict); 6683 }); 6684 addRegexToken('ddd', function (isStrict, locale) { 6685 return locale.weekdaysShortRegex(isStrict); 6686 }); 6687 addRegexToken('dddd', function (isStrict, locale) { 6688 return locale.weekdaysRegex(isStrict); 6689 }); 6690 6691 addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { 6692 var weekday = config._locale.weekdaysParse(input, token, config._strict); 6693 // if we didn't get a weekday name, mark the date as invalid 6694 if (weekday != null) { 6695 week.d = weekday; 6696 } else { 6697 getParsingFlags(config).invalidWeekday = input; 6698 } 6699 }); 6700 6701 addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { 6702 week[token] = toInt(input); 6703 }); 6704 6705 // HELPERS 6706 6707 function parseWeekday(input, locale) { 6708 if (typeof input !== 'string') { 6709 return input; 6710 } 6711 6712 if (!isNaN(input)) { 6713 return parseInt(input, 10); 6714 } 6715 6716 input = locale.weekdaysParse(input); 6717 if (typeof input === 'number') { 6718 return input; 6719 } 6720 6721 return null; 6722 } 6723 6724 function parseIsoWeekday(input, locale) { 6725 if (typeof input === 'string') { 6726 return locale.weekdaysParse(input) % 7 || 7; 6727 } 6728 return isNaN(input) ? null : input; 6729 } 6730 6731 // LOCALES 6732 function shiftWeekdays(ws, n) { 6733 return ws.slice(n, 7).concat(ws.slice(0, n)); 6734 } 6735 6736 var defaultLocaleWeekdays = 6737 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), 6738 defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), 6739 defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), 6740 defaultWeekdaysRegex = matchWord, 6741 defaultWeekdaysShortRegex = matchWord, 6742 defaultWeekdaysMinRegex = matchWord; 6743 6744 function localeWeekdays(m, format) { 6745 var weekdays = isArray(this._weekdays) 6746 ? this._weekdays 6747 : this._weekdays[ 6748 m && m !== true && this._weekdays.isFormat.test(format) 6749 ? 'format' 6750 : 'standalone' 6751 ]; 6752 return m === true 6753 ? shiftWeekdays(weekdays, this._week.dow) 6754 : m 6755 ? weekdays[m.day()] 6756 : weekdays; 6757 } 6758 6759 function localeWeekdaysShort(m) { 6760 return m === true 6761 ? shiftWeekdays(this._weekdaysShort, this._week.dow) 6762 : m 6763 ? this._weekdaysShort[m.day()] 6764 : this._weekdaysShort; 6765 } 6766 6767 function localeWeekdaysMin(m) { 6768 return m === true 6769 ? shiftWeekdays(this._weekdaysMin, this._week.dow) 6770 : m 6771 ? this._weekdaysMin[m.day()] 6772 : this._weekdaysMin; 6773 } 6774 6775 function handleStrictParse$1(weekdayName, format, strict) { 6776 var i, 6777 ii, 6778 mom, 6779 llc = weekdayName.toLocaleLowerCase(); 6780 if (!this._weekdaysParse) { 6781 this._weekdaysParse = []; 6782 this._shortWeekdaysParse = []; 6783 this._minWeekdaysParse = []; 6784 6785 for (i = 0; i < 7; ++i) { 6786 mom = createUTC([2000, 1]).day(i); 6787 this._minWeekdaysParse[i] = this.weekdaysMin( 6788 mom, 6789 '' 6790 ).toLocaleLowerCase(); 6791 this._shortWeekdaysParse[i] = this.weekdaysShort( 6792 mom, 6793 '' 6794 ).toLocaleLowerCase(); 6795 this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); 6796 } 6797 } 6798 6799 if (strict) { 6800 if (format === 'dddd') { 6801 ii = indexOf.call(this._weekdaysParse, llc); 6802 return ii !== -1 ? ii : null; 6803 } else if (format === 'ddd') { 6804 ii = indexOf.call(this._shortWeekdaysParse, llc); 6805 return ii !== -1 ? ii : null; 6806 } else { 6807 ii = indexOf.call(this._minWeekdaysParse, llc); 6808 return ii !== -1 ? ii : null; 6809 } 6810 } else { 6811 if (format === 'dddd') { 6812 ii = indexOf.call(this._weekdaysParse, llc); 6813 if (ii !== -1) { 6814 return ii; 6815 } 6816 ii = indexOf.call(this._shortWeekdaysParse, llc); 6817 if (ii !== -1) { 6818 return ii; 6819 } 6820 ii = indexOf.call(this._minWeekdaysParse, llc); 6821 return ii !== -1 ? ii : null; 6822 } else if (format === 'ddd') { 6823 ii = indexOf.call(this._shortWeekdaysParse, llc); 6824 if (ii !== -1) { 6825 return ii; 6826 } 6827 ii = indexOf.call(this._weekdaysParse, llc); 6828 if (ii !== -1) { 6829 return ii; 6830 } 6831 ii = indexOf.call(this._minWeekdaysParse, llc); 6832 return ii !== -1 ? ii : null; 6833 } else { 6834 ii = indexOf.call(this._minWeekdaysParse, llc); 6835 if (ii !== -1) { 6836 return ii; 6837 } 6838 ii = indexOf.call(this._weekdaysParse, llc); 6839 if (ii !== -1) { 6840 return ii; 6841 } 6842 ii = indexOf.call(this._shortWeekdaysParse, llc); 6843 return ii !== -1 ? ii : null; 6844 } 6845 } 6846 } 6847 6848 function localeWeekdaysParse(weekdayName, format, strict) { 6849 var i, mom, regex; 6850 6851 if (this._weekdaysParseExact) { 6852 return handleStrictParse$1.call(this, weekdayName, format, strict); 6853 } 6854 6855 if (!this._weekdaysParse) { 6856 this._weekdaysParse = []; 6857 this._minWeekdaysParse = []; 6858 this._shortWeekdaysParse = []; 6859 this._fullWeekdaysParse = []; 6860 } 6861 6862 for (i = 0; i < 7; i++) { 6863 // make the regex if we don't have it already 6864 6865 mom = createUTC([2000, 1]).day(i); 6866 if (strict && !this._fullWeekdaysParse[i]) { 6867 this._fullWeekdaysParse[i] = new RegExp( 6868 '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 6869 'i' 6870 ); 6871 this._shortWeekdaysParse[i] = new RegExp( 6872 '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 6873 'i' 6874 ); 6875 this._minWeekdaysParse[i] = new RegExp( 6876 '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 6877 'i' 6878 ); 6879 } 6880 if (!this._weekdaysParse[i]) { 6881 regex = 6882 '^' + 6883 this.weekdays(mom, '') + 6884 '|^' + 6885 this.weekdaysShort(mom, '') + 6886 '|^' + 6887 this.weekdaysMin(mom, ''); 6888 this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); 6889 } 6890 // test the regex 6891 if ( 6892 strict && 6893 format === 'dddd' && 6894 this._fullWeekdaysParse[i].test(weekdayName) 6895 ) { 6896 return i; 6897 } else if ( 6898 strict && 6899 format === 'ddd' && 6900 this._shortWeekdaysParse[i].test(weekdayName) 6901 ) { 6902 return i; 6903 } else if ( 6904 strict && 6905 format === 'dd' && 6906 this._minWeekdaysParse[i].test(weekdayName) 6907 ) { 6908 return i; 6909 } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { 6910 return i; 6911 } 6912 } 6913 } 6914 6915 // MOMENTS 6916 6917 function getSetDayOfWeek(input) { 6918 if (!this.isValid()) { 6919 return input != null ? this : NaN; 6920 } 6921 var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); 6922 if (input != null) { 6923 input = parseWeekday(input, this.localeData()); 6924 return this.add(input - day, 'd'); 6925 } else { 6926 return day; 6927 } 6928 } 6929 6930 function getSetLocaleDayOfWeek(input) { 6931 if (!this.isValid()) { 6932 return input != null ? this : NaN; 6933 } 6934 var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; 6935 return input == null ? weekday : this.add(input - weekday, 'd'); 6936 } 6937 6938 function getSetISODayOfWeek(input) { 6939 if (!this.isValid()) { 6940 return input != null ? this : NaN; 6941 } 6942 6943 // behaves the same as moment#day except 6944 // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) 6945 // as a setter, sunday should belong to the previous week. 6946 6947 if (input != null) { 6948 var weekday = parseIsoWeekday(input, this.localeData()); 6949 return this.day(this.day() % 7 ? weekday : weekday - 7); 6950 } else { 6951 return this.day() || 7; 6952 } 6953 } 6954 6955 function weekdaysRegex(isStrict) { 6956 if (this._weekdaysParseExact) { 6957 if (!hasOwnProp(this, '_weekdaysRegex')) { 6958 computeWeekdaysParse.call(this); 6959 } 6960 if (isStrict) { 6961 return this._weekdaysStrictRegex; 6962 } else { 6963 return this._weekdaysRegex; 6964 } 6965 } else { 6966 if (!hasOwnProp(this, '_weekdaysRegex')) { 6967 this._weekdaysRegex = defaultWeekdaysRegex; 6968 } 6969 return this._weekdaysStrictRegex && isStrict 6970 ? this._weekdaysStrictRegex 6971 : this._weekdaysRegex; 6972 } 6973 } 6974 6975 function weekdaysShortRegex(isStrict) { 6976 if (this._weekdaysParseExact) { 6977 if (!hasOwnProp(this, '_weekdaysRegex')) { 6978 computeWeekdaysParse.call(this); 6979 } 6980 if (isStrict) { 6981 return this._weekdaysShortStrictRegex; 6982 } else { 6983 return this._weekdaysShortRegex; 6984 } 6985 } else { 6986 if (!hasOwnProp(this, '_weekdaysShortRegex')) { 6987 this._weekdaysShortRegex = defaultWeekdaysShortRegex; 6988 } 6989 return this._weekdaysShortStrictRegex && isStrict 6990 ? this._weekdaysShortStrictRegex 6991 : this._weekdaysShortRegex; 6992 } 6993 } 6994 6995 function weekdaysMinRegex(isStrict) { 6996 if (this._weekdaysParseExact) { 6997 if (!hasOwnProp(this, '_weekdaysRegex')) { 6998 computeWeekdaysParse.call(this); 6999 } 7000 if (isStrict) { 7001 return this._weekdaysMinStrictRegex; 7002 } else { 7003 return this._weekdaysMinRegex; 7004 } 7005 } else { 7006 if (!hasOwnProp(this, '_weekdaysMinRegex')) { 7007 this._weekdaysMinRegex = defaultWeekdaysMinRegex; 7008 } 7009 return this._weekdaysMinStrictRegex && isStrict 7010 ? this._weekdaysMinStrictRegex 7011 : this._weekdaysMinRegex; 7012 } 7013 } 7014 7015 function computeWeekdaysParse() { 7016 function cmpLenRev(a, b) { 7017 return b.length - a.length; 7018 } 7019 7020 var minPieces = [], 7021 shortPieces = [], 7022 longPieces = [], 7023 mixedPieces = [], 7024 i, 7025 mom, 7026 minp, 7027 shortp, 7028 longp; 7029 for (i = 0; i < 7; i++) { 7030 // make the regex if we don't have it already 7031 mom = createUTC([2000, 1]).day(i); 7032 minp = regexEscape(this.weekdaysMin(mom, '')); 7033 shortp = regexEscape(this.weekdaysShort(mom, '')); 7034 longp = regexEscape(this.weekdays(mom, '')); 7035 minPieces.push(minp); 7036 shortPieces.push(shortp); 7037 longPieces.push(longp); 7038 mixedPieces.push(minp); 7039 mixedPieces.push(shortp); 7040 mixedPieces.push(longp); 7041 } 7042 // Sorting makes sure if one weekday (or abbr) is a prefix of another it 7043 // will match the longer piece. 7044 minPieces.sort(cmpLenRev); 7045 shortPieces.sort(cmpLenRev); 7046 longPieces.sort(cmpLenRev); 7047 mixedPieces.sort(cmpLenRev); 7048 7049 this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 7050 this._weekdaysShortRegex = this._weekdaysRegex; 7051 this._weekdaysMinRegex = this._weekdaysRegex; 7052 7053 this._weekdaysStrictRegex = new RegExp( 7054 '^(' + longPieces.join('|') + ')', 7055 'i' 7056 ); 7057 this._weekdaysShortStrictRegex = new RegExp( 7058 '^(' + shortPieces.join('|') + ')', 7059 'i' 7060 ); 7061 this._weekdaysMinStrictRegex = new RegExp( 7062 '^(' + minPieces.join('|') + ')', 7063 'i' 7064 ); 7065 } 7066 7067 // FORMATTING 7068 7069 function hFormat() { 7070 return this.hours() % 12 || 12; 7071 } 7072 7073 function kFormat() { 7074 return this.hours() || 24; 7075 } 7076 7077 addFormatToken('H', ['HH', 2], 0, 'hour'); 7078 addFormatToken('h', ['hh', 2], 0, hFormat); 7079 addFormatToken('k', ['kk', 2], 0, kFormat); 7080 7081 addFormatToken('hmm', 0, 0, function () { 7082 return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); 7083 }); 7084 7085 addFormatToken('hmmss', 0, 0, function () { 7086 return ( 7087 '' + 7088 hFormat.apply(this) + 7089 zeroFill(this.minutes(), 2) + 7090 zeroFill(this.seconds(), 2) 7091 ); 7092 }); 7093 7094 addFormatToken('Hmm', 0, 0, function () { 7095 return '' + this.hours() + zeroFill(this.minutes(), 2); 7096 }); 7097 7098 addFormatToken('Hmmss', 0, 0, function () { 7099 return ( 7100 '' + 7101 this.hours() + 7102 zeroFill(this.minutes(), 2) + 7103 zeroFill(this.seconds(), 2) 7104 ); 7105 }); 7106 7107 function meridiem(token, lowercase) { 7108 addFormatToken(token, 0, 0, function () { 7109 return this.localeData().meridiem( 7110 this.hours(), 7111 this.minutes(), 7112 lowercase 7113 ); 7114 }); 7115 } 7116 7117 meridiem('a', true); 7118 meridiem('A', false); 7119 7120 // ALIASES 7121 7122 addUnitAlias('hour', 'h'); 7123 7124 // PRIORITY 7125 addUnitPriority('hour', 13); 7126 7127 // PARSING 7128 7129 function matchMeridiem(isStrict, locale) { 7130 return locale._meridiemParse; 7131 } 7132 7133 addRegexToken('a', matchMeridiem); 7134 addRegexToken('A', matchMeridiem); 7135 addRegexToken('H', match1to2); 7136 addRegexToken('h', match1to2); 7137 addRegexToken('k', match1to2); 7138 addRegexToken('HH', match1to2, match2); 7139 addRegexToken('hh', match1to2, match2); 7140 addRegexToken('kk', match1to2, match2); 7141 7142 addRegexToken('hmm', match3to4); 7143 addRegexToken('hmmss', match5to6); 7144 addRegexToken('Hmm', match3to4); 7145 addRegexToken('Hmmss', match5to6); 7146 7147 addParseToken(['H', 'HH'], HOUR); 7148 addParseToken(['k', 'kk'], function (input, array, config) { 7149 var kInput = toInt(input); 7150 array[HOUR] = kInput === 24 ? 0 : kInput; 7151 }); 7152 addParseToken(['a', 'A'], function (input, array, config) { 7153 config._isPm = config._locale.isPM(input); 7154 config._meridiem = input; 7155 }); 7156 addParseToken(['h', 'hh'], function (input, array, config) { 7157 array[HOUR] = toInt(input); 7158 getParsingFlags(config).bigHour = true; 7159 }); 7160 addParseToken('hmm', function (input, array, config) { 7161 var pos = input.length - 2; 7162 array[HOUR] = toInt(input.substr(0, pos)); 7163 array[MINUTE] = toInt(input.substr(pos)); 7164 getParsingFlags(config).bigHour = true; 7165 }); 7166 addParseToken('hmmss', function (input, array, config) { 7167 var pos1 = input.length - 4, 7168 pos2 = input.length - 2; 7169 array[HOUR] = toInt(input.substr(0, pos1)); 7170 array[MINUTE] = toInt(input.substr(pos1, 2)); 7171 array[SECOND] = toInt(input.substr(pos2)); 7172 getParsingFlags(config).bigHour = true; 7173 }); 7174 addParseToken('Hmm', function (input, array, config) { 7175 var pos = input.length - 2; 7176 array[HOUR] = toInt(input.substr(0, pos)); 7177 array[MINUTE] = toInt(input.substr(pos)); 7178 }); 7179 addParseToken('Hmmss', function (input, array, config) { 7180 var pos1 = input.length - 4, 7181 pos2 = input.length - 2; 7182 array[HOUR] = toInt(input.substr(0, pos1)); 7183 array[MINUTE] = toInt(input.substr(pos1, 2)); 7184 array[SECOND] = toInt(input.substr(pos2)); 7185 }); 7186 7187 // LOCALES 7188 7189 function localeIsPM(input) { 7190 // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing str
vendor: 12,414 bytes, lines 7190-7556
7190ings like arrays 7191 // Using charAt should be more compatible. 7192 return (input + '').toLowerCase().charAt(0) === 'p'; 7193 } 7194 7195 var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, 7196 // Setting the hour should keep the time, because the user explicitly 7197 // specified which hour they want. So trying to maintain the same hour (in 7198 // a new timezone) makes sense. Adding/subtracting hours does not follow 7199 // this rule. 7200 getSetHour = makeGetSet('Hours', true); 7201 7202 function localeMeridiem(hours, minutes, isLower) { 7203 if (hours > 11) { 7204 return isLower ? 'pm' : 'PM'; 7205 } else { 7206 return isLower ? 'am' : 'AM'; 7207 } 7208 } 7209 7210 var baseConfig = { 7211 calendar: defaultCalendar, 7212 longDateFormat: defaultLongDateFormat, 7213 invalidDate: defaultInvalidDate, 7214 ordinal: defaultOrdinal, 7215 dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, 7216 relativeTime: defaultRelativeTime, 7217 7218 months: defaultLocaleMonths, 7219 monthsShort: defaultLocaleMonthsShort, 7220 7221 week: defaultLocaleWeek, 7222 7223 weekdays: defaultLocaleWeekdays, 7224 weekdaysMin: defaultLocaleWeekdaysMin, 7225 weekdaysShort: defaultLocaleWeekdaysShort, 7226 7227 meridiemParse: defaultLocaleMeridiemParse, 7228 }; 7229 7230 // internal storage for locale config files 7231 var locales = {}, 7232 localeFamilies = {}, 7233 globalLocale; 7234 7235 function commonPrefix(arr1, arr2) { 7236 var i, 7237 minl = Math.min(arr1.length, arr2.length); 7238 for (i = 0; i < minl; i += 1) { 7239 if (arr1[i] !== arr2[i]) { 7240 return i; 7241 } 7242 } 7243 return minl; 7244 } 7245 7246 function normalizeLocale(key) { 7247 return key ? key.toLowerCase().replace('_', '-') : key; 7248 } 7249 7250 // pick the locale from the array 7251 // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each 7252 // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root 7253 function chooseLocale(names) { 7254 var i = 0, 7255 j, 7256 next, 7257 locale, 7258 split; 7259 7260 while (i < names.length) { 7261 split = normalizeLocale(names[i]).split('-'); 7262 j = split.length; 7263 next = normalizeLocale(names[i + 1]); 7264 next = next ? next.split('-') : null; 7265 while (j > 0) { 7266 locale = loadLocale(split.slice(0, j).join('-')); 7267 if (locale) { 7268 return locale; 7269 } 7270 if ( 7271 next && 7272 next.length >= j && 7273 commonPrefix(split, next) >= j - 1 7274 ) { 7275 //the next array item is better than a shallower substring of this one 7276 break; 7277 } 7278 j--; 7279 } 7280 i++; 7281 } 7282 return globalLocale; 7283 } 7284 7285 function isLocaleNameSane(name) { 7286 // Prevent names that look like filesystem paths, i.e contain '/' or '\' 7287 return name.match('^[^/\\\\]*$') != null; 7288 } 7289 7290 function loadLocale(name) { 7291 var oldLocale = null, 7292 aliasedRequire; 7293 // TODO: Find a better way to register and load all the locales in Node 7294 if ( 7295 locales[name] === undefined && 7296 typeof module !== 'undefined' && 7297 module && 7298 module.exports && 7299 isLocaleNameSane(name) 7300 ) { 7301 try { 7302 oldLocale = globalLocale._abbr; 7303 aliasedRequire = require; 7304 aliasedRequire('./locale/' + name); 7305 getSetGlobalLocale(oldLocale); 7306 } catch (e) { 7307 // mark as not found to avoid repeating expensive file require call causing high CPU 7308 // when trying to find en-US, en_US, en-us for every format call 7309 locales[name] = null; // null means not found 7310 } 7311 } 7312 return locales[name]; 7313 } 7314 7315 // This function will load locale and then set the global locale. If 7316 // no arguments are passed in, it will simply return the current global 7317 // locale key. 7318 function getSetGlobalLocale(key, values) { 7319 var data; 7320 if (key) { 7321 if (isUndefined(values)) { 7322 data = getLocale(key); 7323 } else { 7324 data = defineLocale(key, values); 7325 } 7326 7327 if (data) { 7328 // moment.duration._locale = moment._locale = data; 7329 globalLocale = data; 7330 } else { 7331 if (typeof console !== 'undefined' && console.warn) { 7332 //warn user if arguments are passed but the locale could not be set 7333 console.warn( 7334 'Locale ' + key + ' not found. Did you forget to load it?' 7335 ); 7336 } 7337 } 7338 } 7339 7340 return globalLocale._abbr; 7341 } 7342 7343 function defineLocale(name, config) { 7344 if (config !== null) { 7345 var locale, 7346 parentConfig = baseConfig; 7347 config.abbr = name; 7348 if (locales[name] != null) { 7349 deprecateSimple( 7350 'defineLocaleOverride', 7351 'use moment.updateLocale(localeName, config) to change ' + 7352 'an existing locale. moment.defineLocale(localeName, ' + 7353 'config) should only be used for creating a new locale ' + 7354 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.' 7355 ); 7356 parentConfig = locales[name]._config; 7357 } else if (config.parentLocale != null) { 7358 if (locales[config.parentLocale] != null) { 7359 parentConfig = locales[config.parentLocale]._config; 7360 } else { 7361 locale = loadLocale(config.parentLocale); 7362 if (locale != null) { 7363 parentConfig = locale._config; 7364 } else { 7365 if (!localeFamilies[config.parentLocale]) { 7366 localeFamilies[config.parentLocale] = []; 7367 } 7368 localeFamilies[config.parentLocale].push({ 7369 name: name, 7370 config: config, 7371 }); 7372 return null; 7373 } 7374 } 7375 } 7376 locales[name] = new Locale(mergeConfigs(parentConfig, config)); 7377 7378 if (localeFamilies[name]) { 7379 localeFamilies[name].forEach(function (x) { 7380 defineLocale(x.name, x.config); 7381 }); 7382 } 7383 7384 // backwards compat for now: also set the locale 7385 // make sure we set the locale AFTER all child locales have been 7386 // created, so we won't end up with the child locale set. 7387 getSetGlobalLocale(name); 7388 7389 return locales[name]; 7390 } else { 7391 // useful for testing 7392 delete locales[name]; 7393 return null; 7394 } 7395 } 7396 7397 function updateLocale(name, config) { 7398 if (config != null) { 7399 var locale, 7400 tmpLocale, 7401 parentConfig = baseConfig; 7402 7403 if (locales[name] != null && locales[name].parentLocale != null) { 7404 // Update existing child locale in-place to avoid memory-leaks 7405 locales[name].set(mergeConfigs(locales[name]._config, config)); 7406 } else { 7407 // MERGE 7408 tmpLocale = loadLocale(name); 7409 if (tmpLocale != null) { 7410 parentConfig = tmpLocale._config; 7411 } 7412 config = mergeConfigs(parentConfig, config); 7413 if (tmpLocale == null) { 7414 // updateLocale is called for creating a new locale 7415 // Set abbr so it will have a name (getters return 7416 // undefined otherwise). 7417 config.abbr = name; 7418 } 7419 locale = new Locale(config); 7420 locale.parentLocale = locales[name]; 7421 locales[name] = locale; 7422 } 7423 7424 // backwards compat for now: also set the locale 7425 getSetGlobalLocale(name); 7426 } else { 7427 // pass null for config to unupdate, useful for tests 7428 if (locales[name] != null) { 7429 if (locales[name].parentLocale != null) { 7430 locales[name] = locales[name].parentLocale; 7431 if (name === getSetGlobalLocale()) { 7432 getSetGlobalLocale(name); 7433 } 7434 } else if (locales[name] != null) { 7435 delete locales[name]; 7436 } 7437 } 7438 } 7439 return locales[name]; 7440 } 7441 7442 // returns locale data 7443 function getLocale(key) { 7444 var locale; 7445 7446 if (key && key._locale && key._locale._abbr) { 7447 key = key._locale._abbr; 7448 } 7449 7450 if (!key) { 7451 return globalLocale; 7452 } 7453 7454 if (!isArray(key)) { 7455 //short-circuit everything else 7456 locale = loadLocale(key); 7457 if (locale) { 7458 return locale; 7459 } 7460 key = [key]; 7461 } 7462 7463 return chooseLocale(key); 7464 } 7465 7466 function listLocales() { 7467 return keys(locales); 7468 } 7469 7470 function checkOverflow(m) { 7471 var overflow, 7472 a = m._a; 7473 7474 if (a && getParsingFlags(m).overflow === -2) { 7475 overflow = 7476 a[MONTH] < 0 || a[MONTH] > 11 7477 ? MONTH 7478 : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) 7479 ? DATE 7480 : a[HOUR] < 0 || 7481 a[HOUR] > 24 || 7482 (a[HOUR] === 24 && 7483 (a[MINUTE] !== 0 || 7484 a[SECOND] !== 0 || 7485 a[MILLISECOND] !== 0)) 7486 ? HOUR 7487 : a[MINUTE] < 0 || a[MINUTE] > 59 7488 ? MINUTE 7489 : a[SECOND] < 0 || a[SECOND] > 59 7490 ? SECOND 7491 : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 7492 ? MILLISECOND 7493 : -1; 7494 7495 if ( 7496 getParsingFlags(m)._overflowDayOfYear && 7497 (overflow < YEAR || overflow > DATE) 7498 ) { 7499 overflow = DATE; 7500 } 7501 if (getParsingFlags(m)._overflowWeeks && overflow === -1) { 7502 overflow = WEEK; 7503 } 7504 if (getParsingFlags(m)._overflowWeekday && overflow === -1) { 7505 overflow = WEEKDAY; 7506 } 7507 7508 getParsingFlags(m).overflow = overflow; 7509 } 7510 7511 return m; 7512 } 7513 7514 // iso 8601 regex 7515 // 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) 7516 var extendedIsoRegex = 7517 /^\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)?)?$/, 7518 basicIsoRegex = 7519 /^\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)?)?$/, 7520 tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, 7521 isoDates = [ 7522 ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], 7523 ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], 7524 ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], 7525 ['GGGG-[W]WW', /\d{4}-W\d\d/, false], 7526 ['YYYY-DDD', /\d{4}-\d{3}/], 7527 ['YYYY-MM', /\d{4}-\d\d/, false], 7528 ['YYYYYYMMDD', /[+-]\d{10}/], 7529 ['YYYYMMDD', /\d{8}/], 7530 ['GGGG[W]WWE', /\d{4}W\d{3}/], 7531 ['GGGG[W]WW', /\d{4}W\d{2}/, false], 7532 ['YYYYDDD', /\d{7}/], 7533 ['YYYYMM', /\d{6}/, false], 7534 ['YYYY', /\d{4}/, false], 7535 ], 7536 // iso time formats and regexes 7537 isoTimes = [ 7538 ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], 7539 ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], 7540 ['HH:mm:ss', /\d\d:\d\d:\d\d/], 7541 ['HH:mm', /\d\d:\d\d/], 7542 ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], 7543 ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], 7544 ['HHmmss', /\d\d\d\d\d\d/], 7545 ['HHmm', /\d\d\d\d/], 7546 ['HH', /\d\d/], 7547 ], 7548 aspNetJsonRegex = /^\/?Date\((-?\d+)/i, 7549 // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 7550 rfc2822 = 7551 /^(?:(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}))$/, 7552 obsOffsets = { 7553 UT: 0, 7554 GMT: 0, 7555 EDT: -4 * 60, 7556 EST: -5 * 60,
vendor: 19,622 bytes, lines 7557-8210
7557 CDT: -5 * 60, 7558 CST: -6 * 60, 7559 MDT: -6 * 60, 7560 MST: -7 * 60, 7561 PDT: -7 * 60, 7562 PST: -8 * 60, 7563 }; 7564 7565 // date from iso format 7566 function configFromISO(config) { 7567 var i, 7568 l, 7569 string = config._i, 7570 match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), 7571 allowTime, 7572 dateFormat, 7573 timeFormat, 7574 tzFormat, 7575 isoDatesLen = isoDates.length, 7576 isoTimesLen = isoTimes.length; 7577 7578 if (match) { 7579 getParsingFlags(config).iso = true; 7580 for (i = 0, l = isoDatesLen; i < l; i++) { 7581 if (isoDates[i][1].exec(match[1])) { 7582 dateFormat = isoDates[i][0]; 7583 allowTime = isoDates[i][2] !== false; 7584 break; 7585 } 7586 } 7587 if (dateFormat == null) { 7588 config._isValid = false; 7589 return; 7590 } 7591 if (match[3]) { 7592 for (i = 0, l = isoTimesLen; i < l; i++) { 7593 if (isoTimes[i][1].exec(match[3])) { 7594 // match[2] should be 'T' or space 7595 timeFormat = (match[2] || ' ') + isoTimes[i][0]; 7596 break; 7597 } 7598 } 7599 if (timeFormat == null) { 7600 config._isValid = false; 7601 return; 7602 } 7603 } 7604 if (!allowTime && timeFormat != null) { 7605 config._isValid = false; 7606 return; 7607 } 7608 if (match[4]) { 7609 if (tzRegex.exec(match[4])) { 7610 tzFormat = 'Z'; 7611 } else { 7612 config._isValid = false; 7613 return; 7614 } 7615 } 7616 config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); 7617 configFromStringAndFormat(config); 7618 } else { 7619 config._isValid = false; 7620 } 7621 } 7622 7623 function extractFromRFC2822Strings( 7624 yearStr, 7625 monthStr, 7626 dayStr, 7627 hourStr, 7628 minuteStr, 7629 secondStr 7630 ) { 7631 var result = [ 7632 untruncateYear(yearStr), 7633 defaultLocaleMonthsShort.indexOf(monthStr), 7634 parseInt(dayStr, 10), 7635 parseInt(hourStr, 10), 7636 parseInt(minuteStr, 10), 7637 ]; 7638 7639 if (secondStr) { 7640 result.push(parseInt(secondStr, 10)); 7641 } 7642 7643 return result; 7644 } 7645 7646 function untruncateYear(yearStr) { 7647 var year = parseInt(yearStr, 10); 7648 if (year <= 49) { 7649 return 2000 + year; 7650 } else if (year <= 999) { 7651 return 1900 + year; 7652 } 7653 return year; 7654 } 7655 7656 function preprocessRFC2822(s) { 7657 // Remove comments and folding whitespace and replace multiple-spaces with a single space 7658 return s 7659 .replace(/\([^()]*\)|[\n\t]/g, ' ') 7660 .replace(/(\s\s+)/g, ' ') 7661 .replace(/^\s\s*/, '') 7662 .replace(/\s\s*$/, ''); 7663 } 7664 7665 function checkWeekday(weekdayStr, parsedInput, config) { 7666 if (weekdayStr) { 7667 // TODO: Replace the vanilla JS Date object with an independent day-of-week check. 7668 var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), 7669 weekdayActual = new Date( 7670 parsedInput[0], 7671 parsedInput[1], 7672 parsedInput[2] 7673 ).getDay(); 7674 if (weekdayProvided !== weekdayActual) { 7675 getParsingFlags(config).weekdayMismatch = true; 7676 config._isValid = false; 7677 return false; 7678 } 7679 } 7680 return true; 7681 } 7682 7683 function calculateOffset(obsOffset, militaryOffset, numOffset) { 7684 if (obsOffset) { 7685 return obsOffsets[obsOffset]; 7686 } else if (militaryOffset) { 7687 // the only allowed military tz is Z 7688 return 0; 7689 } else { 7690 var hm = parseInt(numOffset, 10), 7691 m = hm % 100, 7692 h = (hm - m) / 100; 7693 return h * 60 + m; 7694 } 7695 } 7696 7697 // date and time from ref 2822 format 7698 function configFromRFC2822(config) { 7699 var match = rfc2822.exec(preprocessRFC2822(config._i)), 7700 parsedArray; 7701 if (match) { 7702 parsedArray = extractFromRFC2822Strings( 7703 match[4], 7704 match[3], 7705 match[2], 7706 match[5], 7707 match[6], 7708 match[7] 7709 ); 7710 if (!checkWeekday(match[1], parsedArray, config)) { 7711 return; 7712 } 7713 7714 config._a = parsedArray; 7715 config._tzm = calculateOffset(match[8], match[9], match[10]); 7716 7717 config._d = createUTCDate.apply(null, config._a); 7718 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); 7719 7720 getParsingFlags(config).rfc2822 = true; 7721 } else { 7722 config._isValid = false; 7723 } 7724 } 7725 7726 // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict 7727 function configFromString(config) { 7728 var matched = aspNetJsonRegex.exec(config._i); 7729 if (matched !== null) { 7730 config._d = new Date(+matched[1]); 7731 return; 7732 } 7733 7734 configFromISO(config); 7735 if (config._isValid === false) { 7736 delete config._isValid; 7737 } else { 7738 return; 7739 } 7740 7741 configFromRFC2822(config); 7742 if (config._isValid === false) { 7743 delete config._isValid; 7744 } else { 7745 return; 7746 } 7747 7748 if (config._strict) { 7749 config._isValid = false; 7750 } else { 7751 // Final attempt, use Input Fallback 7752 hooks.createFromInputFallback(config); 7753 } 7754 } 7755 7756 hooks.createFromInputFallback = deprecate( 7757 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 7758 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 7759 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', 7760 function (config) { 7761 config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); 7762 } 7763 ); 7764 7765 // Pick the first defined of two or three arguments. 7766 function defaults(a, b, c) { 7767 if (a != null) { 7768 return a; 7769 } 7770 if (b != null) { 7771 return b; 7772 } 7773 return c; 7774 } 7775 7776 function currentDateArray(config) { 7777 // hooks is actually the exported moment object 7778 var nowValue = new Date(hooks.now()); 7779 if (config._useUTC) { 7780 return [ 7781 nowValue.getUTCFullYear(), 7782 nowValue.getUTCMonth(), 7783 nowValue.getUTCDate(), 7784 ]; 7785 } 7786 return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; 7787 } 7788 7789 // convert an array to a date. 7790 // the array should mirror the parameters below 7791 // note: all values past the year are optional and will default to the lowest possible value. 7792 // [year, month, day , hour, minute, second, millisecond] 7793 function configFromArray(config) { 7794 var i, 7795 date, 7796 input = [], 7797 currentDate, 7798 expectedWeekday, 7799 yearToUse; 7800 7801 if (config._d) { 7802 return; 7803 } 7804 7805 currentDate = currentDateArray(config); 7806 7807 //compute day of the year from weeks and weekdays 7808 if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { 7809 dayOfYearFromWeekInfo(config); 7810 } 7811 7812 //if the day of the year is set, figure out what it is 7813 if (config._dayOfYear != null) { 7814 yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); 7815 7816 if ( 7817 config._dayOfYear > daysInYear(yearToUse) || 7818 config._dayOfYear === 0 7819 ) { 7820 getParsingFlags(config)._overflowDayOfYear = true; 7821 } 7822 7823 date = createUTCDate(yearToUse, 0, config._dayOfYear); 7824 config._a[MONTH] = date.getUTCMonth(); 7825 config._a[DATE] = date.getUTCDate(); 7826 } 7827 7828 // Default to current date. 7829 // * if no year, month, day of month are given, default to today 7830 // * if day of month is given, default month and year 7831 // * if month is given, default only year 7832 // * if year is given, don't default anything 7833 for (i = 0; i < 3 && config._a[i] == null; ++i) { 7834 config._a[i] = input[i] = currentDate[i]; 7835 } 7836 7837 // Zero out whatever was not defaulted, including time 7838 for (; i < 7; i++) { 7839 config._a[i] = input[i] = 7840 config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i]; 7841 } 7842 7843 // Check for 24:00:00.000 7844 if ( 7845 config._a[HOUR] === 24 && 7846 config._a[MINUTE] === 0 && 7847 config._a[SECOND] === 0 && 7848 config._a[MILLISECOND] === 0 7849 ) { 7850 config._nextDay = true; 7851 config._a[HOUR] = 0; 7852 } 7853 7854 config._d = (config._useUTC ? createUTCDate : createDate).apply( 7855 null, 7856 input 7857 ); 7858 expectedWeekday = config._useUTC 7859 ? config._d.getUTCDay() 7860 : config._d.getDay(); 7861 7862 // Apply timezone offset from input. The actual utcOffset can be changed 7863 // with parseZone. 7864 if (config._tzm != null) { 7865 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); 7866 } 7867 7868 if (config._nextDay) { 7869 config._a[HOUR] = 24; 7870 } 7871 7872 // check for mismatching day of week 7873 if ( 7874 config._w && 7875 typeof config._w.d !== 'undefined' && 7876 config._w.d !== expectedWeekday 7877 ) { 7878 getParsingFlags(config).weekdayMismatch = true; 7879 } 7880 } 7881 7882 function dayOfYearFromWeekInfo(config) { 7883 var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; 7884 7885 w = config._w; 7886 if (w.GG != null || w.W != null || w.E != null) { 7887 dow = 1; 7888 doy = 4; 7889 7890 // TODO: We need to take the current isoWeekYear, but that depends on 7891 // how we interpret now (local, utc, fixed offset). So create 7892 // a now version of current config (take local/utc/offset flags, and 7893 // create now). 7894 weekYear = defaults( 7895 w.GG, 7896 config._a[YEAR], 7897 weekOfYear(createLocal(), 1, 4).year 7898 ); 7899 week = defaults(w.W, 1); 7900 weekday = defaults(w.E, 1); 7901 if (weekday < 1 || weekday > 7) { 7902 weekdayOverflow = true; 7903 } 7904 } else { 7905 dow = config._locale._week.dow; 7906 doy = config._locale._week.doy; 7907 7908 curWeek = weekOfYear(createLocal(), dow, doy); 7909 7910 weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); 7911 7912 // Default to current week. 7913 week = defaults(w.w, curWeek.week); 7914 7915 if (w.d != null) { 7916 // weekday -- low day numbers are considered next week 7917 weekday = w.d; 7918 if (weekday < 0 || weekday > 6) { 7919 weekdayOverflow = true; 7920 } 7921 } else if (w.e != null) { 7922 // local weekday -- counting starts from beginning of week 7923 weekday = w.e + dow; 7924 if (w.e < 0 || w.e > 6) { 7925 weekdayOverflow = true; 7926 } 7927 } else { 7928 // default to beginning of week 7929 weekday = dow; 7930 } 7931 } 7932 if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { 7933 getParsingFlags(config)._overflowWeeks = true; 7934 } else if (weekdayOverflow != null) { 7935 getParsingFlags(config)._overflowWeekday = true; 7936 } else { 7937 temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); 7938 config._a[YEAR] = temp.year; 7939 config._dayOfYear = temp.dayOfYear; 7940 } 7941 } 7942 7943 // constant that refers to the ISO standard 7944 hooks.ISO_8601 = function () {}; 7945 7946 // constant that refers to the RFC 2822 form 7947 hooks.RFC_2822 = function () {}; 7948 7949 // date from string and format string 7950 function configFromStringAndFormat(config) { 7951 // TODO: Move this to another part of the creation flow to prevent circular deps 7952 if (config._f === hooks.ISO_8601) { 7953 configFromISO(config); 7954 return; 7955 } 7956 if (config._f === hooks.RFC_2822) { 7957 configFromRFC2822(config); 7958 return; 7959 } 7960 config._a = []; 7961 getParsingFlags(config).empty = true; 7962 7963 // This array is used to make a Date, either with `new Date` or `Date.UTC` 7964 var string = '' + config._i, 7965 i, 7966 parsedInput, 7967 tokens, 7968 token, 7969 skipped, 7970 stringLength = string.length, 7971 totalParsedInputLength = 0, 7972 era, 7973 tokenLen; 7974 7975 tokens = 7976 expandFormat(config._f, config._locale).match(formattingTokens) || []; 7977 tokenLen = tokens.length; 7978 for (i = 0; i < tokenLen; i++) { 7979 token = tokens[i]; 7980 parsedInput = (string.match(getParseRegexForToken(token, config)) || 7981 [])[0]; 7982 if (parsedInput) { 7983 skipped = string.substr(0, string.indexOf(parsedInput)); 7984 if (skipped.length > 0) { 7985 getParsingFlags(config).unusedInput.push(skipped); 7986 } 7987 string = string.slice( 7988 string.indexOf(parsedInput) + parsedInput.length 7989 ); 7990 totalParsedInputLength += parsedInput.length; 7991 } 7992 // don't parse if it's not a known token 7993 if (formatTokenFunctions[token]) { 7994 if (parsedInput) { 7995 getParsingFlags(config).empty = false; 7996 } else { 7997 getParsingFlags(config).unusedTokens.push(token); 7998 } 7999 addTimeToArrayFromToken(token, parsedInput, config); 8000 } else if (config._strict && !parsedInput) { 8001 getParsingFlags(config).unusedTokens.push(token); 8002 } 8003 } 8004 8005 // add remaining unparsed input length to the string 8006 getParsingFlags(config).charsLeftOver = 8007 stringLength - totalParsedInputLength; 8008 if (string.length > 0) { 8009 getParsingFlags(config).unusedInput.push(string); 8010 } 8011 8012 // clear _12h flag if hour is <= 12 8013 if ( 8014 config._a[HOUR] <= 12 && 8015 getParsingFlags(config).bigHour === true && 8016 config._a[HOUR] > 0 8017 ) { 8018 getParsingFlags(config).bigHour = undefined; 8019 } 8020 8021 getParsingFlags(config).parsedDateParts = config._a.slice(0); 8022 getParsingFlags(config).meridiem = config._meridiem; 8023 // handle meridiem 8024 config._a[HOUR] = meridiemFixWrap( 8025 config._locale, 8026 config._a[HOUR], 8027 config._meridiem 8028 ); 8029 8030 // handle era 8031 era = getParsingFlags(config).era; 8032 if (era !== null) { 8033 config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); 8034 } 8035 8036 configFromArray(config); 8037 checkOverflow(config); 8038 } 8039 8040 function meridiemFixWrap(locale, hour, meridiem) { 8041 var isPm; 8042 8043 if (meridiem == null) { 8044 // nothing to do 8045 return hour; 8046 } 8047 if (locale.meridiemHour != null) { 8048 return locale.meridiemHour(hour, meridiem); 8049 } else if (locale.isPM != null) { 8050 // Fallback 8051 isPm = locale.isPM(meridiem); 8052 if (isPm && hour < 12) { 8053 hour += 12; 8054 } 8055 if (!isPm && hour === 12) { 8056 hour = 0; 8057 } 8058 return hour; 8059 } else { 8060 // this is not supposed to happen 8061 return hour; 8062 } 8063 } 8064 8065 // date from string and array of format strings 8066 function configFromStringAndArray(config) { 8067 var tempConfig, 8068 bestMoment, 8069 scoreToBeat, 8070 i, 8071 currentScore, 8072 validFormatFound, 8073 bestFormatIsValid = false, 8074 configfLen = config._f.length; 8075 8076 if (configfLen === 0) { 8077 getParsingFlags(config).invalidFormat = true; 8078 config._d = new Date(NaN); 8079 return; 8080 } 8081 8082 for (i = 0; i < configfLen; i++) { 8083 currentScore = 0; 8084 validFormatFound = false; 8085 tempConfig = copyConfig({}, config); 8086 if (config._useUTC != null) { 8087 tempConfig._useUTC = config._useUTC; 8088 } 8089 tempConfig._f = config._f[i]; 8090 configFromStringAndFormat(tempConfig); 8091 8092 if (isValid(tempConfig)) { 8093 validFormatFound = true; 8094 } 8095 8096 // if there is any input that was not parsed add a penalty for that format 8097 currentScore += getParsingFlags(tempConfig).charsLeftOver; 8098 8099 //or tokens 8100 currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; 8101 8102 getParsingFlags(tempConfig).score = currentScore; 8103 8104 if (!bestFormatIsValid) { 8105 if ( 8106 scoreToBeat == null || 8107 currentScore < scoreToBeat || 8108 validFormatFound 8109 ) { 8110 scoreToBeat = currentScore; 8111 bestMoment = tempConfig; 8112 if (validFormatFound) { 8113 bestFormatIsValid = true; 8114 } 8115 } 8116 } else { 8117 if (currentScore < scoreToBeat) { 8118 scoreToBeat = currentScore; 8119 bestMoment = tempConfig; 8120 } 8121 } 8122 } 8123 8124 extend(config, bestMoment || tempConfig); 8125 } 8126 8127 function configFromObject(config) { 8128 if (config._d) { 8129 return; 8130 } 8131 8132 var i = normalizeObjectUnits(config._i), 8133 dayOrDate = i.day === undefined ? i.date : i.day; 8134 config._a = map( 8135 [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], 8136 function (obj) { 8137 return obj && parseInt(obj, 10); 8138 } 8139 ); 8140 8141 configFromArray(config); 8142 } 8143 8144 function createFromConfig(config) { 8145 var res = new Moment(checkOverflow(prepareConfig(config))); 8146 if (res._nextDay) { 8147 // Adding is smart enough around DST 8148 res.add(1, 'd'); 8149 res._nextDay = undefined; 8150 } 8151 8152 return res; 8153 } 8154 8155 function prepareConfig(config) { 8156 var input = config._i, 8157 format = config._f; 8158 8159 config._locale = config._locale || getLocale(config._l); 8160 8161 if (input === null || (format === undefined && input === '')) { 8162 return createInvalid({ nullInput: true }); 8163 } 8164 8165 if (typeof input === 'string') { 8166 config._i = input = config._locale.preparse(input); 8167 } 8168 8169 if (isMoment(input)) { 8170 return new Moment(checkOverflow(input)); 8171 } else if (isDate(input)) { 8172 config._d = input; 8173 } else if (isArray(format)) { 8174 configFromStringAndArray(config); 8175 } else if (format) { 8176 configFromStringAndFormat(config); 8177 } else { 8178 configFromInput(config); 8179 } 8180 8181 if (!isValid(config)) { 8182 config._d = null; 8183 } 8184 8185 return config; 8186 } 8187 8188 function configFromInput(config) { 8189 var input = config._i; 8190 if (isUndefined(input)) { 8191 config._d = new Date(hooks.now()); 8192 } else if (isDate(input)) { 8193 config._d = new Date(input.valueOf()); 8194 } else if (typeof input === 'string') { 8195 configFromString(config); 8196 } else if (isArray(input)) { 8197 config._a = map(input.slice(0), function (obj) { 8198 return parseInt(obj, 10); 8199 }); 8200 configFromArray(config); 8201 } else if (isObject(input)) { 8202 configFromObject(config); 8203 } else if (isNumber(input)) { 8204 // from milliseconds 8205 config._d = new Date(input); 8206 } else { 8207 hooks.createFromInputFallback(config); 8208 } 8209 } 8210
vendor: 8,794 bytes, lines 8211-8515
8211 function createLocalOrUTC(input, format, locale, strict, isUTC) { 8212 var c = {}; 8213 8214 if (format === true || format === false) { 8215 strict = format; 8216 format = undefined; 8217 } 8218 8219 if (locale === true || locale === false) { 8220 strict = locale; 8221 locale = undefined; 8222 } 8223 8224 if ( 8225 (isObject(input) && isObjectEmpty(input)) || 8226 (isArray(input) && input.length === 0) 8227 ) { 8228 input = undefined; 8229 } 8230 // object construction must be done this way. 8231 // https://github.com/moment/moment/issues/1423 8232 c._isAMomentObject = true; 8233 c._useUTC = c._isUTC = isUTC; 8234 c._l = locale; 8235 c._i = input; 8236 c._f = format; 8237 c._strict = strict; 8238 8239 return createFromConfig(c); 8240 } 8241 8242 function createLocal(input, format, locale, strict) { 8243 return createLocalOrUTC(input, format, locale, strict, false); 8244 } 8245 8246 var prototypeMin = deprecate( 8247 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', 8248 function () { 8249 var other = createLocal.apply(null, arguments); 8250 if (this.isValid() && other.isValid()) { 8251 return other < this ? this : other; 8252 } else { 8253 return createInvalid(); 8254 } 8255 } 8256 ), 8257 prototypeMax = deprecate( 8258 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', 8259 function () { 8260 var other = createLocal.apply(null, arguments); 8261 if (this.isValid() && other.isValid()) { 8262 return other > this ? this : other; 8263 } else { 8264 return createInvalid(); 8265 } 8266 } 8267 ); 8268 8269 // Pick a moment m from moments so that m[fn](other) is true for all 8270 // other. This relies on the function fn to be transitive. 8271 // 8272 // moments should either be an array of moment objects or an array, whose 8273 // first element is an array of moment objects. 8274 function pickBy(fn, moments) { 8275 var res, i; 8276 if (moments.length === 1 && isArray(moments[0])) { 8277 moments = moments[0]; 8278 } 8279 if (!moments.length) { 8280 return createLocal(); 8281 } 8282 res = moments[0]; 8283 for (i = 1; i < moments.length; ++i) { 8284 if (!moments[i].isValid() || moments[i][fn](res)) { 8285 res = moments[i]; 8286 } 8287 } 8288 return res; 8289 } 8290 8291 // TODO: Use [].sort instead? 8292 function min() { 8293 var args = [].slice.call(arguments, 0); 8294 8295 return pickBy('isBefore', args); 8296 } 8297 8298 function max() { 8299 var args = [].slice.call(arguments, 0); 8300 8301 return pickBy('isAfter', args); 8302 } 8303 8304 var now = function () { 8305 return Date.now ? Date.now() : +new Date(); 8306 }; 8307 8308 var ordering = [ 8309 'year', 8310 'quarter', 8311 'month', 8312 'week', 8313 'day', 8314 'hour', 8315 'minute', 8316 'second', 8317 'millisecond', 8318 ]; 8319 8320 function isDurationValid(m) { 8321 var key, 8322 unitHasDecimal = false, 8323 i, 8324 orderLen = ordering.length; 8325 for (key in m) { 8326 if ( 8327 hasOwnProp(m, key) && 8328 !( 8329 indexOf.call(ordering, key) !== -1 && 8330 (m[key] == null || !isNaN(m[key])) 8331 ) 8332 ) { 8333 return false; 8334 } 8335 } 8336 8337 for (i = 0; i < orderLen; ++i) { 8338 if (m[ordering[i]]) { 8339 if (unitHasDecimal) { 8340 return false; // only allow non-integers for smallest unit 8341 } 8342 if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { 8343 unitHasDecimal = true; 8344 } 8345 } 8346 } 8347 8348 return true; 8349 } 8350 8351 function isValid$1() { 8352 return this._isValid; 8353 } 8354 8355 function createInvalid$1() { 8356 return createDuration(NaN); 8357 } 8358 8359 function Duration(duration) { 8360 var normalizedInput = normalizeObjectUnits(duration), 8361 years = normalizedInput.year || 0, 8362 quarters = normalizedInput.quarter || 0, 8363 months = normalizedInput.month || 0, 8364 weeks = normalizedInput.week || normalizedInput.isoWeek || 0, 8365 days = normalizedInput.day || 0, 8366 hours = normalizedInput.hour || 0, 8367 minutes = normalizedInput.minute || 0, 8368 seconds = normalizedInput.second || 0, 8369 milliseconds = normalizedInput.millisecond || 0; 8370 8371 this._isValid = isDurationValid(normalizedInput); 8372 8373 // representation for dateAddRemove 8374 this._milliseconds = 8375 +milliseconds + 8376 seconds * 1e3 + // 1000 8377 minutes * 6e4 + // 1000 * 60 8378 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 8379 // Because of dateAddRemove treats 24 hours as different from a 8380 // day when working around DST, we need to store them separately 8381 this._days = +days + weeks * 7; 8382 // It is impossible to translate months into days without knowing 8383 // which months you are are talking about, so we have to store 8384 // it separately. 8385 this._months = +months + quarters * 3 + years * 12; 8386 8387 this._data = {}; 8388 8389 this._locale = getLocale(); 8390 8391 this._bubble(); 8392 } 8393 8394 function isDuration(obj) { 8395 return obj instanceof Duration; 8396 } 8397 8398 function absRound(number) { 8399 if (number < 0) { 8400 return Math.round(-1 * number) * -1; 8401 } else { 8402 return Math.round(number); 8403 } 8404 } 8405 8406 // compare two arrays, return the number of differences 8407 function compareArrays(array1, array2, dontConvert) { 8408 var len = Math.min(array1.length, array2.length), 8409 lengthDiff = Math.abs(array1.length - array2.length), 8410 diffs = 0, 8411 i; 8412 for (i = 0; i < len; i++) { 8413 if ( 8414 (dontConvert && array1[i] !== array2[i]) || 8415 (!dontConvert && toInt(array1[i]) !== toInt(array2[i])) 8416 ) { 8417 diffs++; 8418 } 8419 } 8420 return diffs + lengthDiff; 8421 } 8422 8423 // FORMATTING 8424 8425 function offset(token, separator) { 8426 addFormatToken(token, 0, 0, function () { 8427 var offset = this.utcOffset(), 8428 sign = '+'; 8429 if (offset < 0) { 8430 offset = -offset; 8431 sign = '-'; 8432 } 8433 return ( 8434 sign + 8435 zeroFill(~~(offset / 60), 2) + 8436 separator + 8437 zeroFill(~~offset % 60, 2) 8438 ); 8439 }); 8440 } 8441 8442 offset('Z', ':'); 8443 offset('ZZ', ''); 8444 8445 // PARSING 8446 8447 addRegexToken('Z', matchShortOffset); 8448 addRegexToken('ZZ', matchShortOffset); 8449 addParseToken(['Z', 'ZZ'], function (input, array, config) { 8450 config._useUTC = true; 8451 config._tzm = offsetFromString(matchShortOffset, input); 8452 }); 8453 8454 // HELPERS 8455 8456 // timezone chunker 8457 // '+10:00' > ['10', '00'] 8458 // '-1530' > ['-15', '30'] 8459 var chunkOffset = /([\+\-]|\d\d)/gi; 8460 8461 function offsetFromString(matcher, string) { 8462 var matches = (string || '').match(matcher), 8463 chunk, 8464 parts, 8465 minutes; 8466 8467 if (matches === null) { 8468 return null; 8469 } 8470 8471 chunk = matches[matches.length - 1] || []; 8472 parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; 8473 minutes = +(parts[1] * 60) + toInt(parts[2]); 8474 8475 return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes; 8476 } 8477 8478 // Return a moment from input, that is local/utc/zone equivalent to model. 8479 function cloneWithOffset(input, model) { 8480 var res, diff; 8481 if (model._isUTC) { 8482 res = model.clone(); 8483 diff = 8484 (isMoment(input) || isDate(input) 8485 ? input.valueOf() 8486 : createLocal(input).valueOf()) - res.valueOf(); 8487 // Use low-level api, because this fn is low-level api. 8488 res._d.setTime(res._d.valueOf() + diff); 8489 hooks.updateOffset(res, false); 8490 return res; 8491 } else { 8492 return createLocal(input).local(); 8493 } 8494 } 8495 8496 function getDateOffset(m) { 8497 // On Firefox.24 Date#getTimezoneOffset returns a floating point. 8498 // https://github.com/moment/moment/pull/1871 8499 return -Math.round(m._d.getTimezoneOffset()); 8500 } 8501 8502 // HOOKS 8503 8504 // This function will be called whenever a moment is mutated. 8505 // It is intended to keep the offset in sync with the timezone. 8506 hooks.updateOffset = function () {}; 8507 8508 // MOMENTS 8509 8510 // keepLocalTime = true means only change the timezone, without 8511 // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> 8512 // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset 8513 // +0200, so we adjust the time as needed, to be valid. 8514 // 8515 // Keeping the time actually adds/subtracts (one hour)
vendor: 28,562 bytes, lines 8516-9478
8516 // from the actual represented time. That is why we call updateOffset 8517 // a second time. In case it wants us to change the offset again 8518 // _changeInProgress == true case, then we have to adjust, because 8519 // there is no such time in the given timezone. 8520 function getSetOffset(input, keepLocalTime, keepMinutes) { 8521 var offset = this._offset || 0, 8522 localAdjust; 8523 if (!this.isValid()) { 8524 return input != null ? this : NaN; 8525 } 8526 if (input != null) { 8527 if (typeof input === 'string') { 8528 input = offsetFromString(matchShortOffset, input); 8529 if (input === null) { 8530 return this; 8531 } 8532 } else if (Math.abs(input) < 16 && !keepMinutes) { 8533 input = input * 60; 8534 } 8535 if (!this._isUTC && keepLocalTime) { 8536 localAdjust = getDateOffset(this); 8537 } 8538 this._offset = input; 8539 this._isUTC = true; 8540 if (localAdjust != null) { 8541 this.add(localAdjust, 'm'); 8542 } 8543 if (offset !== input) { 8544 if (!keepLocalTime || this._changeInProgress) { 8545 addSubtract( 8546 this, 8547 createDuration(input - offset, 'm'), 8548 1, 8549 false 8550 ); 8551 } else if (!this._changeInProgress) { 8552 this._changeInProgress = true; 8553 hooks.updateOffset(this, true); 8554 this._changeInProgress = null; 8555 } 8556 } 8557 return this; 8558 } else { 8559 return this._isUTC ? offset : getDateOffset(this); 8560 } 8561 } 8562 8563 function getSetZone(input, keepLocalTime) { 8564 if (input != null) { 8565 if (typeof input !== 'string') { 8566 input = -input; 8567 } 8568 8569 this.utcOffset(input, keepLocalTime); 8570 8571 return this; 8572 } else { 8573 return -this.utcOffset(); 8574 } 8575 } 8576 8577 function setOffsetToUTC(keepLocalTime) { 8578 return this.utcOffset(0, keepLocalTime); 8579 } 8580 8581 function setOffsetToLocal(keepLocalTime) { 8582 if (this._isUTC) { 8583 this.utcOffset(0, keepLocalTime); 8584 this._isUTC = false; 8585 8586 if (keepLocalTime) { 8587 this.subtract(getDateOffset(this), 'm'); 8588 } 8589 } 8590 return this; 8591 } 8592 8593 function setOffsetToParsedOffset() { 8594 if (this._tzm != null) { 8595 this.utcOffset(this._tzm, false, true); 8596 } else if (typeof this._i === 'string') { 8597 var tZone = offsetFromString(matchOffset, this._i); 8598 if (tZone != null) { 8599 this.utcOffset(tZone); 8600 } else { 8601 this.utcOffset(0, true); 8602 } 8603 } 8604 return this; 8605 } 8606 8607 function hasAlignedHourOffset(input) { 8608 if (!this.isValid()) { 8609 return false; 8610 } 8611 input = input ? createLocal(input).utcOffset() : 0; 8612 8613 return (this.utcOffset() - input) % 60 === 0; 8614 } 8615 8616 function isDaylightSavingTime() { 8617 return ( 8618 this.utcOffset() > this.clone().month(0).utcOffset() || 8619 this.utcOffset() > this.clone().month(5).utcOffset() 8620 ); 8621 } 8622 8623 function isDaylightSavingTimeShifted() { 8624 if (!isUndefined(this._isDSTShifted)) { 8625 return this._isDSTShifted; 8626 } 8627 8628 var c = {}, 8629 other; 8630 8631 copyConfig(c, this); 8632 c = prepareConfig(c); 8633 8634 if (c._a) { 8635 other = c._isUTC ? createUTC(c._a) : createLocal(c._a); 8636 this._isDSTShifted = 8637 this.isValid() && compareArrays(c._a, other.toArray()) > 0; 8638 } else { 8639 this._isDSTShifted = false; 8640 } 8641 8642 return this._isDSTShifted; 8643 } 8644 8645 function isLocal() { 8646 return this.isValid() ? !this._isUTC : false; 8647 } 8648 8649 function isUtcOffset() { 8650 return this.isValid() ? this._isUTC : false; 8651 } 8652 8653 function isUtc() { 8654 return this.isValid() ? this._isUTC && this._offset === 0 : false; 8655 } 8656 8657 // ASP.NET json date format regex 8658 var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, 8659 // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html 8660 // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere 8661 // and further modified to allow for strings containing both week and day 8662 isoRegex = 8663 /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; 8664 8665 function createDuration(input, key) { 8666 var duration = input, 8667 // matching against regexp is expensive, do it on demand 8668 match = null, 8669 sign, 8670 ret, 8671 diffRes; 8672 8673 if (isDuration(input)) { 8674 duration = { 8675 ms: input._milliseconds, 8676 d: input._days, 8677 M: input._months, 8678 }; 8679 } else if (isNumber(input) || !isNaN(+input)) { 8680 duration = {}; 8681 if (key) { 8682 duration[key] = +input; 8683 } else { 8684 duration.milliseconds = +input; 8685 } 8686 } else if ((match = aspNetRegex.exec(input))) { 8687 sign = match[1] === '-' ? -1 : 1; 8688 duration = { 8689 y: 0, 8690 d: toInt(match[DATE]) * sign, 8691 h: toInt(match[HOUR]) * sign, 8692 m: toInt(match[MINUTE]) * sign, 8693 s: toInt(match[SECOND]) * sign, 8694 ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match 8695 }; 8696 } else if ((match = isoRegex.exec(input))) { 8697 sign = match[1] === '-' ? -1 : 1; 8698 duration = { 8699 y: parseIso(match[2], sign), 8700 M: parseIso(match[3], sign), 8701 w: parseIso(match[4], sign), 8702 d: parseIso(match[5], sign), 8703 h: parseIso(match[6], sign), 8704 m: parseIso(match[7], sign), 8705 s: parseIso(match[8], sign), 8706 }; 8707 } else if (duration == null) { 8708 // checks for null or undefined 8709 duration = {}; 8710 } else if ( 8711 typeof duration === 'object' && 8712 ('from' in duration || 'to' in duration) 8713 ) { 8714 diffRes = momentsDifference( 8715 createLocal(duration.from), 8716 createLocal(duration.to) 8717 ); 8718 8719 duration = {}; 8720 duration.ms = diffRes.milliseconds; 8721 duration.M = diffRes.months; 8722 } 8723 8724 ret = new Duration(duration); 8725 8726 if (isDuration(input) && hasOwnProp(input, '_locale')) { 8727 ret._locale = input._locale; 8728 } 8729 8730 if (isDuration(input) && hasOwnProp(input, '_isValid')) { 8731 ret._isValid = input._isValid; 8732 } 8733 8734 return ret; 8735 } 8736 8737 createDuration.fn = Duration.prototype; 8738 createDuration.invalid = createInvalid$1; 8739 8740 function parseIso(inp, sign) { 8741 // We'd normally use ~~inp for this, but unfortunately it also 8742 // converts floats to ints. 8743 // inp may be undefined, so careful calling replace on it. 8744 var res = inp && parseFloat(inp.replace(',', '.')); 8745 // apply sign while we're at it 8746 return (isNaN(res) ? 0 : res) * sign; 8747 } 8748 8749 function positiveMomentsDifference(base, other) { 8750 var res = {}; 8751 8752 res.months = 8753 other.month() - base.month() + (other.year() - base.year()) * 12; 8754 if (base.clone().add(res.months, 'M').isAfter(other)) { 8755 --res.months; 8756 } 8757 8758 res.milliseconds = +other - +base.clone().add(res.months, 'M'); 8759 8760 return res; 8761 } 8762 8763 function momentsDifference(base, other) { 8764 var res; 8765 if (!(base.isValid() && other.isValid())) { 8766 return { milliseconds: 0, months: 0 }; 8767 } 8768 8769 other = cloneWithOffset(other, base); 8770 if (base.isBefore(other)) { 8771 res = positiveMomentsDifference(base, other); 8772 } else { 8773 res = positiveMomentsDifference(other, base); 8774 res.milliseconds = -res.milliseconds; 8775 res.months = -res.months; 8776 } 8777 8778 return res; 8779 } 8780 8781 // TODO: remove 'name' arg after deprecation is removed 8782 function createAdder(direction, name) { 8783 return function (val, period) { 8784 var dur, tmp; 8785 //invert the arguments, but complain about it 8786 if (period !== null && !isNaN(+period)) { 8787 deprecateSimple( 8788 name, 8789 'moment().' + 8790 name + 8791 '(period, number) is deprecated. Please use moment().' + 8792 name + 8793 '(number, period). ' + 8794 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.' 8795 ); 8796 tmp = val; 8797 val = period; 8798 period = tmp; 8799 } 8800 8801 dur = createDuration(val, period); 8802 addSubtract(this, dur, direction); 8803 return this; 8804 }; 8805 } 8806 8807 function addSubtract(mom, duration, isAdding, updateOffset) { 8808 var milliseconds = duration._milliseconds, 8809 days = absRound(duration._days), 8810 months = absRound(duration._months); 8811 8812 if (!mom.isValid()) { 8813 // No op 8814 return; 8815 } 8816 8817 updateOffset = updateOffset == null ? true : updateOffset; 8818 8819 if (months) { 8820 setMonth(mom, get(mom, 'Month') + months * isAdding); 8821 } 8822 if (days) { 8823 set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); 8824 } 8825 if (milliseconds) { 8826 mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); 8827 } 8828 if (updateOffset) { 8829 hooks.updateOffset(mom, days || months); 8830 } 8831 } 8832 8833 var add = createAdder(1, 'add'), 8834 subtract = createAdder(-1, 'subtract'); 8835 8836 function isString(input) { 8837 return typeof input === 'string' || input instanceof String; 8838 } 8839 8840 // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined 8841 function isMomentInput(input) { 8842 return ( 8843 isMoment(input) || 8844 isDate(input) || 8845 isString(input) || 8846 isNumber(input) || 8847 isNumberOrStringArray(input) || 8848 isMomentInputObject(input) || 8849 input === null || 8850 input === undefined 8851 ); 8852 } 8853 8854 function isMomentInputObject(input) { 8855 var objectTest = isObject(input) && !isObjectEmpty(input), 8856 propertyTest = false, 8857 properties = [ 8858 'years', 8859 'year', 8860 'y', 8861 'months', 8862 'month', 8863 'M', 8864 'days', 8865 'day', 8866 'd', 8867 'dates', 8868 'date', 8869 'D', 8870 'hours', 8871 'hour', 8872 'h', 8873 'minutes', 8874 'minute', 8875 'm', 8876 'seconds', 8877 'second', 8878 's', 8879 'milliseconds', 8880 'millisecond', 8881 'ms', 8882 ], 8883 i, 8884 property, 8885 propertyLen = properties.length; 8886 8887 for (i = 0; i < propertyLen; i += 1) { 8888 property = properties[i]; 8889 propertyTest = propertyTest || hasOwnProp(input, property); 8890 } 8891 8892 return objectTest && propertyTest; 8893 } 8894 8895 function isNumberOrStringArray(input) { 8896 var arrayTest = isArray(input), 8897 dataTypeTest = false; 8898 if (arrayTest) { 8899 dataTypeTest = 8900 input.filter(function (item) { 8901 return !isNumber(item) && isString(input); 8902 }).length === 0; 8903 } 8904 return arrayTest && dataTypeTest; 8905 } 8906 8907 function isCalendarSpec(input) { 8908 var objectTest = isObject(input) && !isObjectEmpty(input), 8909 propertyTest = false, 8910 properties = [ 8911 'sameDay', 8912 'nextDay', 8913 'lastDay', 8914 'nextWeek', 8915 'lastWeek', 8916 'sameElse', 8917 ], 8918 i, 8919 property; 8920 8921 for (i = 0; i < properties.length; i += 1) { 8922 property = properties[i]; 8923 propertyTest = propertyTest || hasOwnProp(input, property); 8924 } 8925 8926 return objectTest && propertyTest; 8927 } 8928 8929 function getCalendarFormat(myMoment, now) { 8930 var diff = myMoment.diff(now, 'days', true); 8931 return diff < -6 8932 ? 'sameElse' 8933 : diff < -1 8934 ? 'lastWeek' 8935 : diff < 0 8936 ? 'lastDay' 8937 : diff < 1 8938 ? 'sameDay' 8939 : diff < 2 8940 ? 'nextDay' 8941 : diff < 7 8942 ? 'nextWeek' 8943 : 'sameElse'; 8944 } 8945 8946 function calendar$1(time, formats) { 8947 // Support for single parameter, formats only overload to the calendar function 8948 if (arguments.length === 1) { 8949 if (!arguments[0]) { 8950 time = undefined; 8951 formats = undefined; 8952 } else if (isMomentInput(arguments[0])) { 8953 time = arguments[0]; 8954 formats = undefined; 8955 } else if (isCalendarSpec(arguments[0])) { 8956 formats = arguments[0]; 8957 time = undefined; 8958 } 8959 } 8960 // We want to compare the start of today, vs this. 8961 // Getting start-of-today depends on whether we're local/utc/offset or not. 8962 var now = time || createLocal(), 8963 sod = cloneWithOffset(now, this).startOf('day'), 8964 format = hooks.calendarFormat(this, sod) || 'sameElse', 8965 output = 8966 formats && 8967 (isFunction(formats[format]) 8968 ? formats[format].call(this, now) 8969 : formats[format]); 8970 8971 return this.format( 8972 output || this.localeData().calendar(format, this, createLocal(now)) 8973 ); 8974 } 8975 8976 function clone() { 8977 return new Moment(this); 8978 } 8979 8980 function isAfter(input, units) { 8981 var localInput = isMoment(input) ? input : createLocal(input); 8982 if (!(this.isValid() && localInput.isValid())) { 8983 return false; 8984 } 8985 units = normalizeUnits(units) || 'millisecond'; 8986 if (units === 'millisecond') { 8987 return this.valueOf() > localInput.valueOf(); 8988 } else { 8989 return localInput.valueOf() < this.clone().startOf(units).valueOf(); 8990 } 8991 } 8992 8993 function isBefore(input, units) { 8994 var localInput = isMoment(input) ? input : createLocal(input); 8995 if (!(this.isValid() && localInput.isValid())) { 8996 return false; 8997 } 8998 units = normalizeUnits(units) || 'millisecond'; 8999 if (units === 'millisecond') { 9000 return this.valueOf() < localInput.valueOf(); 9001 } else { 9002 return this.clone().endOf(units).valueOf() < localInput.valueOf(); 9003 } 9004 } 9005 9006 function isBetween(from, to, units, inclusivity) { 9007 var localFrom = isMoment(from) ? from : createLocal(from), 9008 localTo = isMoment(to) ? to : createLocal(to); 9009 if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { 9010 return false; 9011 } 9012 inclusivity = inclusivity || '()'; 9013 return ( 9014 (inclusivity[0] === '(' 9015 ? this.isAfter(localFrom, units) 9016 : !this.isBefore(localFrom, units)) && 9017 (inclusivity[1] === ')' 9018 ? this.isBefore(localTo, units) 9019 : !this.isAfter(localTo, units)) 9020 ); 9021 } 9022 9023 function isSame(input, units) { 9024 var localInput = isMoment(input) ? input : createLocal(input), 9025 inputMs; 9026 if (!(this.isValid() && localInput.isValid())) { 9027 return false; 9028 } 9029 units = normalizeUnits(units) || 'millisecond'; 9030 if (units === 'millisecond') { 9031 return this.valueOf() === localInput.valueOf(); 9032 } else { 9033 inputMs = localInput.valueOf(); 9034 return ( 9035 this.clone().startOf(units).valueOf() <= inputMs && 9036 inputMs <= this.clone().endOf(units).valueOf() 9037 ); 9038 } 9039 } 9040 9041 function isSameOrAfter(input, units) { 9042 return this.isSame(input, units) || this.isAfter(input, units); 9043 } 9044 9045 function isSameOrBefore(input, units) { 9046 return this.isSame(input, units) || this.isBefore(input, units); 9047 } 9048 9049 function diff(input, units, asFloat) { 9050 var that, zoneDelta, output; 9051 9052 if (!this.isValid()) { 9053 return NaN; 9054 } 9055 9056 that = cloneWithOffset(input, this); 9057 9058 if (!that.isValid()) { 9059 return NaN; 9060 } 9061 9062 zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; 9063 9064 units = normalizeUnits(units); 9065 9066 switch (units) { 9067 case 'year': 9068 output = monthDiff(this, that) / 12; 9069 break; 9070 case 'month': 9071 output = monthDiff(this, that); 9072 break; 9073 case 'quarter': 9074 output = monthDiff(this, that) / 3; 9075 break; 9076 case 'second': 9077 output = (this - that) / 1e3; 9078 break; // 1000 9079 case 'minute': 9080 output = (this - that) / 6e4; 9081 break; // 1000 * 60 9082 case 'hour': 9083 output = (this - that) / 36e5; 9084 break; // 1000 * 60 * 60 9085 case 'day': 9086 output = (this - that - zoneDelta) / 864e5; 9087 break; // 1000 * 60 * 60 * 24, negate dst 9088 case 'week': 9089 output = (this - that - zoneDelta) / 6048e5; 9090 break; // 1000 * 60 * 60 * 24 * 7, negate dst 9091 default: 9092 output = this - that; 9093 } 9094 9095 return asFloat ? output : absFloor(output); 9096 } 9097 9098 function monthDiff(a, b) { 9099 if (a.date() < b.date()) { 9100 // end-of-month calculations work correct when the start month has more 9101 // days than the end month. 9102 return -monthDiff(b, a); 9103 } 9104 // difference in months 9105 var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), 9106 // b is in (anchor - 1 month, anchor + 1 month) 9107 anchor = a.clone().add(wholeMonthDiff, 'months'), 9108 anchor2, 9109 adjust; 9110 9111 if (b - anchor < 0) { 9112 anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); 9113 // linear across the month 9114 adjust = (b - anchor) / (anchor - anchor2); 9115 } else { 9116 anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); 9117 // linear across the month 9118 adjust = (b - anchor) / (anchor2 - anchor); 9119 } 9120 9121 //check for negative zero, return zero if negative zero 9122 return -(wholeMonthDiff + adjust) || 0; 9123 } 9124 9125 hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; 9126 hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; 9127 9128 function toString() { 9129 return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); 9130 } 9131 9132 function toISOString(keepOffset) { 9133 if (!this.isValid()) { 9134 return null; 9135 } 9136 var utc = keepOffset !== true, 9137 m = utc ? this.clone().utc() : this; 9138 if (m.year() < 0 || m.year() > 9999) { 9139 return formatMoment( 9140 m, 9141 utc 9142 ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' 9143 : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ' 9144 ); 9145 } 9146 if (isFunction(Date.prototype.toISOString)) { 9147 // native implementation is ~50x faster, use it when we can 9148 if (utc) { 9149 return this.toDate().toISOString(); 9150 } else { 9151 return new Date(this.valueOf() + this.utcOffset() * 60 * 1000) 9152 .toISOString() 9153 .replace('Z', formatMoment(m, 'Z')); 9154 } 9155 } 9156 return formatMoment( 9157 m, 9158 utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ' 9159 ); 9160 } 9161 9162 /** 9163 * Return a human readable representation of a moment that can 9164 * also be evaluated to get a new moment which is the same 9165 * 9166 * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects 9167 */ 9168 function inspect() { 9169 if (!this.isValid()) { 9170 return 'moment.invalid(/* ' + this._i + ' */)'; 9171 } 9172 var func = 'moment', 9173 zone = '', 9174 prefix, 9175 year, 9176 datetime, 9177 suffix; 9178 if (!this.isLocal()) { 9179 func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; 9180 zone = 'Z'; 9181 } 9182 prefix = '[' + func + '("]'; 9183 year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; 9184 datetime = '-MM-DD[T]HH:mm:ss.SSS'; 9185 suffix = zone + '[")]'; 9186 9187 return this.format(prefix + year + datetime + suffix); 9188 } 9189 9190 function format(inputString) { 9191 if (!inputString) { 9192 inputString = this.isUtc() 9193 ? hooks.defaultFormatUtc 9194 : hooks.defaultFormat; 9195 } 9196 var output = formatMoment(this, inputString); 9197 return this.localeData().postformat(output); 9198 } 9199 9200 function from(time, withoutSuffix) { 9201 if ( 9202 this.isValid() && 9203 ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) 9204 ) { 9205 return createDuration({ to: this, from: time }) 9206 .locale(this.locale()) 9207 .humanize(!withoutSuffix); 9208 } else { 9209 return this.localeData().invalidDate(); 9210 } 9211 } 9212 9213 function fromNow(withoutSuffix) { 9214 return this.from(createLocal(), withoutSuffix); 9215 } 9216 9217 function to(time, withoutSuffix) { 9218 if ( 9219 this.isValid() && 9220 ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) 9221 ) { 9222 return createDuration({ from: this, to: time }) 9223 .locale(this.locale()) 9224 .humanize(!withoutSuffix); 9225 } else { 9226 return this.localeData().invalidDate(); 9227 } 9228 } 9229 9230 function toNow(withoutSuffix) { 9231 return this.to(createLocal(), withoutSuffix); 9232 } 9233 9234 // If passed a locale key, it will set the locale for this 9235 // instance. Otherwise, it will return the locale configuration 9236 // variables for this instance. 9237 function locale(key) { 9238 var newLocaleData; 9239 9240 if (key === undefined) { 9241 return this._locale._abbr; 9242 } else { 9243 newLocaleData = getLocale(key); 9244 if (newLocaleData != null) { 9245 this._locale = newLocaleData; 9246 } 9247 return this; 9248 } 9249 } 9250 9251 var lang = deprecate( 9252 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', 9253 function (key) { 9254 if (key === undefined) { 9255 return this.localeData(); 9256 } else { 9257 return this.locale(key); 9258 } 9259 } 9260 ); 9261 9262 function localeData() { 9263 return this._locale; 9264 } 9265 9266 var MS_PER_SECOND = 1000, 9267 MS_PER_MINUTE = 60 * MS_PER_SECOND, 9268 MS_PER_HOUR = 60 * MS_PER_MINUTE, 9269 MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; 9270 9271 // actual modulo - handles negative numbers (for dates before 1970): 9272 function mod$1(dividend, divisor) { 9273 return ((dividend % divisor) + divisor) % divisor; 9274 } 9275 9276 function localStartOfDate(y, m, d) { 9277 // the date constructor remaps years 0-99 to 1900-1999 9278 if (y < 100 && y >= 0) { 9279 // preserve leap years using a full 400 year cycle, then reset 9280 return new Date(y + 400, m, d) - MS_PER_400_YEARS; 9281 } else { 9282 return new Date(y, m, d).valueOf(); 9283 } 9284 } 9285 9286 function utcStartOfDate(y, m, d) { 9287 // Date.UTC remaps years 0-99 to 1900-1999 9288 if (y < 100 && y >= 0) { 9289 // preserve leap years using a full 400 year cycle, then reset 9290 return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; 9291 } else { 9292 return Date.UTC(y, m, d); 9293 } 9294 } 9295 9296 function startOf(units) { 9297 var time, startOfDate; 9298 units = normalizeUnits(units); 9299 if (units === undefined || units === 'millisecond' || !this.isValid()) { 9300 return this; 9301 } 9302 9303 startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; 9304 9305 switch (units) { 9306 case 'year': 9307 time = startOfDate(this.year(), 0, 1); 9308 break; 9309 case 'quarter': 9310 time = startOfDate( 9311 this.year(), 9312 this.month() - (this.month() % 3), 9313 1 9314 ); 9315 break; 9316 case 'month': 9317 time = startOfDate(this.year(), this.month(), 1); 9318 break; 9319 case 'week': 9320 time = startOfDate( 9321 this.year(), 9322 this.month(), 9323 this.date() - this.weekday() 9324 ); 9325 break; 9326 case 'isoWeek': 9327 time = startOfDate( 9328 this.year(), 9329 this.month(), 9330 this.date() - (this.isoWeekday() - 1) 9331 ); 9332 break; 9333 case 'day': 9334 case 'date': 9335 time = startOfDate(this.year(), this.month(), this.date()); 9336 break; 9337 case 'hour': 9338 time = this._d.valueOf(); 9339 time -= mod$1( 9340 time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), 9341 MS_PER_HOUR 9342 ); 9343 break; 9344 case 'minute': 9345 time = this._d.valueOf(); 9346 time -= mod$1(time, MS_PER_MINUTE); 9347 break; 9348 case 'second': 9349 time = this._d.valueOf(); 9350 time -= mod$1(time, MS_PER_SECOND); 9351 break; 9352 } 9353 9354 this._d.setTime(time); 9355 hooks.updateOffset(this, true); 9356 return this; 9357 } 9358 9359 function endOf(units) { 9360 var time, startOfDate; 9361 units = normalizeUnits(units); 9362 if (units === undefined || units === 'millisecond' || !this.isValid()) { 9363 return this; 9364 } 9365 9366 startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; 9367 9368 switch (units) { 9369 case 'year': 9370 time = startOfDate(this.year() + 1, 0, 1) - 1; 9371 break; 9372 case 'quarter': 9373 time = 9374 startOfDate( 9375 this.year(), 9376 this.month() - (this.month() % 3) + 3, 9377 1 9378 ) - 1; 9379 break; 9380 case 'month': 9381 time = startOfDate(this.year(), this.month() + 1, 1) - 1; 9382 break; 9383 case 'week': 9384 time = 9385 startOfDate( 9386 this.year(), 9387 this.month(), 9388 this.date() - this.weekday() + 7 9389 ) - 1; 9390 break; 9391 case 'isoWeek': 9392 time = 9393 startOfDate( 9394 this.year(), 9395 this.month(), 9396 this.date() - (this.isoWeekday() - 1) + 7 9397 ) - 1; 9398 break; 9399 case 'day': 9400 case 'date': 9401 time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; 9402 break; 9403 case 'hour': 9404 time = this._d.valueOf(); 9405 time += 9406 MS_PER_HOUR - 9407 mod$1( 9408 time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), 9409 MS_PER_HOUR 9410 ) - 9411 1; 9412 break; 9413 case 'minute': 9414 time = this._d.valueOf(); 9415 time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; 9416 break; 9417 case 'second': 9418 time = this._d.valueOf(); 9419 time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; 9420 break; 9421 } 9422 9423 this._d.setTime(time); 9424 hooks.updateOffset(this, true); 9425 return this; 9426 } 9427 9428 function valueOf() { 9429 return this._d.valueOf() - (this._offset || 0) * 60000; 9430 } 9431 9432 function unix() { 9433 return Math.floor(this.valueOf() / 1000); 9434 } 9435 9436 function toDate() { 9437 return new Date(this.valueOf()); 9438 } 9439 9440 function toArray() { 9441 var m = this; 9442 return [ 9443 m.year(), 9444 m.month(), 9445 m.date(), 9446 m.hour(), 9447 m.minute(), 9448 m.second(), 9449 m.millisecond(), 9450 ]; 9451 } 9452 9453 function toObject() { 9454 var m = this; 9455 return { 9456 years: m.year(), 9457 months: m.month(), 9458 date: m.date(), 9459 hours: m.hours(), 9460 minutes: m.minutes(), 9461 seconds: m.seconds(), 9462 milliseconds: m.milliseconds(), 9463 }; 9464 } 9465 9466 function toJSON() { 9467 // new Date(NaN).toJSON() === null 9468 return this.isValid() ? this.toISOString() : null; 9469 } 9470 9471 function isValid$2() { 9472 return isValid(this); 9473 } 9474 9475 function parsingFlags() { 9476 return extend({}, getParsingFlags(this)); 9477 } 9478
vendor: 9,804 bytes, lines 9479-9831
9479 function invalidAt() { 9480 return getParsingFlags(this).overflow; 9481 } 9482 9483 function creationData() { 9484 return { 9485 input: this._i, 9486 format: this._f, 9487 locale: this._locale, 9488 isUTC: this._isUTC, 9489 strict: this._strict, 9490 }; 9491 } 9492 9493 addFormatToken('N', 0, 0, 'eraAbbr'); 9494 addFormatToken('NN', 0, 0, 'eraAbbr'); 9495 addFormatToken('NNN', 0, 0, 'eraAbbr'); 9496 addFormatToken('NNNN', 0, 0, 'eraName'); 9497 addFormatToken('NNNNN', 0, 0, 'eraNarrow'); 9498 9499 addFormatToken('y', ['y', 1], 'yo', 'eraYear'); 9500 addFormatToken('y', ['yy', 2], 0, 'eraYear'); 9501 addFormatToken('y', ['yyy', 3], 0, 'eraYear'); 9502 addFormatToken('y', ['yyyy', 4], 0, 'eraYear'); 9503 9504 addRegexToken('N', matchEraAbbr); 9505 addRegexToken('NN', matchEraAbbr); 9506 addRegexToken('NNN', matchEraAbbr); 9507 addRegexToken('NNNN', matchEraName); 9508 addRegexToken('NNNNN', matchEraNarrow); 9509 9510 addParseToken( 9511 ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], 9512 function (input, array, config, token) { 9513 var era = config._locale.erasParse(input, token, config._strict); 9514 if (era) { 9515 getParsingFlags(config).era = era; 9516 } else { 9517 getParsingFlags(config).invalidEra = input; 9518 } 9519 } 9520 ); 9521 9522 addRegexToken('y', matchUnsigned); 9523 addRegexToken('yy', matchUnsigned); 9524 addRegexToken('yyy', matchUnsigned); 9525 addRegexToken('yyyy', matchUnsigned); 9526 addRegexToken('yo', matchEraYearOrdinal); 9527 9528 addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR); 9529 addParseToken(['yo'], function (input, array, config, token) { 9530 var match; 9531 if (config._locale._eraYearOrdinalRegex) { 9532 match = input.match(config._locale._eraYearOrdinalRegex); 9533 } 9534 9535 if (config._locale.eraYearOrdinalParse) { 9536 array[YEAR] = config._locale.eraYearOrdinalParse(input, match); 9537 } else { 9538 array[YEAR] = parseInt(input, 10); 9539 } 9540 }); 9541 9542 function localeEras(m, format) { 9543 var i, 9544 l, 9545 date, 9546 eras = this._eras || getLocale('en')._eras; 9547 for (i = 0, l = eras.length; i < l; ++i) { 9548 switch (typeof eras[i].since) { 9549 case 'string': 9550 // truncate time 9551 date = hooks(eras[i].since).startOf('day'); 9552 eras[i].since = date.valueOf(); 9553 break; 9554 } 9555 9556 switch (typeof eras[i].until) { 9557 case 'undefined': 9558 eras[i].until = +Infinity; 9559 break; 9560 case 'string': 9561 // truncate time 9562 date = hooks(eras[i].until).startOf('day').valueOf(); 9563 eras[i].until = date.valueOf(); 9564 break; 9565 } 9566 } 9567 return eras; 9568 } 9569 9570 function localeErasParse(eraName, format, strict) { 9571 var i, 9572 l, 9573 eras = this.eras(), 9574 name, 9575 abbr, 9576 narrow; 9577 eraName = eraName.toUpperCase(); 9578 9579 for (i = 0, l = eras.length; i < l; ++i) { 9580 name = eras[i].name.toUpperCase(); 9581 abbr = eras[i].abbr.toUpperCase(); 9582 narrow = eras[i].narrow.toUpperCase(); 9583 9584 if (strict) { 9585 switch (format) { 9586 case 'N': 9587 case 'NN': 9588 case 'NNN': 9589 if (abbr === eraName) { 9590 return eras[i]; 9591 } 9592 break; 9593 9594 case 'NNNN': 9595 if (name === eraName) { 9596 return eras[i]; 9597 } 9598 break; 9599 9600 case 'NNNNN': 9601 if (narrow === eraName) { 9602 return eras[i]; 9603 } 9604 break; 9605 } 9606 } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { 9607 return eras[i]; 9608 } 9609 } 9610 } 9611 9612 function localeErasConvertYear(era, year) { 9613 var dir = era.since <= era.until ? +1 : -1; 9614 if (year === undefined) { 9615 return hooks(era.since).year(); 9616 } else { 9617 return hooks(era.since).year() + (year - era.offset) * dir; 9618 } 9619 } 9620 9621 function getEraName() { 9622 var i, 9623 l, 9624 val, 9625 eras = this.localeData().eras(); 9626 for (i = 0, l = eras.length; i < l; ++i) { 9627 // truncate time 9628 val = this.clone().startOf('day').valueOf(); 9629 9630 if (eras[i].since <= val && val <= eras[i].until) { 9631 return eras[i].name; 9632 } 9633 if (eras[i].until <= val && val <= eras[i].since) { 9634 return eras[i].name; 9635 } 9636 } 9637 9638 return ''; 9639 } 9640 9641 function getEraNarrow() { 9642 var i, 9643 l, 9644 val, 9645 eras = this.localeData().eras(); 9646 for (i = 0, l = eras.length; i < l; ++i) { 9647 // truncate time 9648 val = this.clone().startOf('day').valueOf(); 9649 9650 if (eras[i].since <= val && val <= eras[i].until) { 9651 return eras[i].narrow; 9652 } 9653 if (eras[i].until <= val && val <= eras[i].since) { 9654 return eras[i].narrow; 9655 } 9656 } 9657 9658 return ''; 9659 } 9660 9661 function getEraAbbr() { 9662 var i, 9663 l, 9664 val, 9665 eras = this.localeData().eras(); 9666 for (i = 0, l = eras.length; i < l; ++i) { 9667 // truncate time 9668 val = this.clone().startOf('day').valueOf(); 9669 9670 if (eras[i].since <= val && val <= eras[i].until) { 9671 return eras[i].abbr; 9672 } 9673 if (eras[i].until <= val && val <= eras[i].since) { 9674 return eras[i].abbr; 9675 } 9676 } 9677 9678 return ''; 9679 } 9680 9681 function getEraYear() { 9682 var i, 9683 l, 9684 dir, 9685 val, 9686 eras = this.localeData().eras(); 9687 for (i = 0, l = eras.length; i < l; ++i) { 9688 dir = eras[i].since <= eras[i].until ? +1 : -1; 9689 9690 // truncate time 9691 val = this.clone().startOf('day').valueOf(); 9692 9693 if ( 9694 (eras[i].since <= val && val <= eras[i].until) || 9695 (eras[i].until <= val && val <= eras[i].since) 9696 ) { 9697 return ( 9698 (this.year() - hooks(eras[i].since).year()) * dir + 9699 eras[i].offset 9700 ); 9701 } 9702 } 9703 9704 return this.year(); 9705 } 9706 9707 function erasNameRegex(isStrict) { 9708 if (!hasOwnProp(this, '_erasNameRegex')) { 9709 computeErasParse.call(this); 9710 } 9711 return isStrict ? this._erasNameRegex : this._erasRegex; 9712 } 9713 9714 function erasAbbrRegex(isStrict) { 9715 if (!hasOwnProp(this, '_erasAbbrRegex')) { 9716 computeErasParse.call(this); 9717 } 9718 return isStrict ? this._erasAbbrRegex : this._erasRegex; 9719 } 9720 9721 function erasNarrowRegex(isStrict) { 9722 if (!hasOwnProp(this, '_erasNarrowRegex')) { 9723 computeErasParse.call(this); 9724 } 9725 return isStrict ? this._erasNarrowRegex : this._erasRegex; 9726 } 9727 9728 function matchEraAbbr(isStrict, locale) { 9729 return locale.erasAbbrRegex(isStrict); 9730 } 9731 9732 function matchEraName(isStrict, locale) { 9733 return locale.erasNameRegex(isStrict); 9734 } 9735 9736 function matchEraNarrow(isStrict, locale) { 9737 return locale.erasNarrowRegex(isStrict); 9738 } 9739 9740 function matchEraYearOrdinal(isStrict, locale) { 9741 return locale._eraYearOrdinalRegex || matchUnsigned; 9742 } 9743 9744 function computeErasParse() { 9745 var abbrPieces = [], 9746 namePieces = [], 9747 narrowPieces = [], 9748 mixedPieces = [], 9749 i, 9750 l, 9751 eras = this.eras(); 9752 9753 for (i = 0, l = eras.length; i < l; ++i) { 9754 namePieces.push(regexEscape(eras[i].name)); 9755 abbrPieces.push(regexEscape(eras[i].abbr)); 9756 narrowPieces.push(regexEscape(eras[i].narrow)); 9757 9758 mixedPieces.push(regexEscape(eras[i].name)); 9759 mixedPieces.push(regexEscape(eras[i].abbr)); 9760 mixedPieces.push(regexEscape(eras[i].narrow)); 9761 } 9762 9763 this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); 9764 this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i'); 9765 this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i'); 9766 this._erasNarrowRegex = new RegExp( 9767 '^(' + narrowPieces.join('|') + ')', 9768 'i' 9769 ); 9770 } 9771 9772 // FORMATTING 9773 9774 addFormatToken(0, ['gg', 2], 0, function () { 9775 return this.weekYear() % 100; 9776 }); 9777 9778 addFormatToken(0, ['GG', 2], 0, function () { 9779 return this.isoWeekYear() % 100; 9780 }); 9781 9782 function addWeekYearFormatToken(token, getter) { 9783 addFormatToken(0, [token, token.length], 0, getter); 9784 } 9785 9786 addWeekYearFormatToken('gggg', 'weekYear'); 9787 addWeekYearFormatToken('ggggg', 'weekYear'); 9788 addWeekYearFormatToken('GGGG', 'isoWeekYear'); 9789 addWeekYearFormatToken('GGGGG', 'isoWeekYear'); 9790 9791 // ALIASES 9792 9793 addUnitAlias('weekYear', 'gg'); 9794 addUnitAlias('isoWeekYear', 'GG'); 9795 9796 // PRIORITY 9797 9798 addUnitPriority('weekYear', 1); 9799 addUnitPriority('isoWeekYear', 1); 9800 9801 // PARSING 9802 9803 addRegexToken('G', matchSigned); 9804 addRegexToken('g', matchSigned); 9805 addRegexToken('GG', match1to2, match2); 9806 addRegexToken('gg', match1to2, match2); 9807 addRegexToken('GGGG', match1to4, match4); 9808 addRegexToken('gggg', match1to4, match4); 9809 addRegexToken('GGGGG', match1to6, match6); 9810 addRegexToken('ggggg', match1to6, match6); 9811 9812 addWeekParseToken( 9813 ['gggg', 'ggggg', 'GGGG', 'GGGGG'], 9814 function (input, week, config, token) { 9815 week[token.substr(0, 2)] = toInt(input); 9816 } 9817 ); 9818 9819 addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { 9820 week[token] = hooks.parseTwoDigitYear(input); 9821 }); 9822 9823 // MOMENTS 9824 9825 function getSetWeekYear(input) { 9826 return getSetWeekYearHelper.call( 9827 this, 9828 input, 9829 this.week(), 9830 this.weekday(), 9831 this.localeData()._week.dow,
vendor: 22,110 bytes, lines 9832-10652
9832 this.localeData()._week.doy 9833 ); 9834 } 9835 9836 function getSetISOWeekYear(input) { 9837 return getSetWeekYearHelper.call( 9838 this, 9839 input, 9840 this.isoWeek(), 9841 this.isoWeekday(), 9842 1, 9843 4 9844 ); 9845 } 9846 9847 function getISOWeeksInYear() { 9848 return weeksInYear(this.year(), 1, 4); 9849 } 9850 9851 function getISOWeeksInISOWeekYear() { 9852 return weeksInYear(this.isoWeekYear(), 1, 4); 9853 } 9854 9855 function getWeeksInYear() { 9856 var weekInfo = this.localeData()._week; 9857 return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); 9858 } 9859 9860 function getWeeksInWeekYear() { 9861 var weekInfo = this.localeData()._week; 9862 return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); 9863 } 9864 9865 function getSetWeekYearHelper(input, week, weekday, dow, doy) { 9866 var weeksTarget; 9867 if (input == null) { 9868 return weekOfYear(this, dow, doy).year; 9869 } else { 9870 weeksTarget = weeksInYear(input, dow, doy); 9871 if (week > weeksTarget) { 9872 week = weeksTarget; 9873 } 9874 return setWeekAll.call(this, input, week, weekday, dow, doy); 9875 } 9876 } 9877 9878 function setWeekAll(weekYear, week, weekday, dow, doy) { 9879 var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), 9880 date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); 9881 9882 this.year(date.getUTCFullYear()); 9883 this.month(date.getUTCMonth()); 9884 this.date(date.getUTCDate()); 9885 return this; 9886 } 9887 9888 // FORMATTING 9889 9890 addFormatToken('Q', 0, 'Qo', 'quarter'); 9891 9892 // ALIASES 9893 9894 addUnitAlias('quarter', 'Q'); 9895 9896 // PRIORITY 9897 9898 addUnitPriority('quarter', 7); 9899 9900 // PARSING 9901 9902 addRegexToken('Q', match1); 9903 addParseToken('Q', function (input, array) { 9904 array[MONTH] = (toInt(input) - 1) * 3; 9905 }); 9906 9907 // MOMENTS 9908 9909 function getSetQuarter(input) { 9910 return input == null 9911 ? Math.ceil((this.month() + 1) / 3) 9912 : this.month((input - 1) * 3 + (this.month() % 3)); 9913 } 9914 9915 // FORMATTING 9916 9917 addFormatToken('D', ['DD', 2], 'Do', 'date'); 9918 9919 // ALIASES 9920 9921 addUnitAlias('date', 'D'); 9922 9923 // PRIORITY 9924 addUnitPriority('date', 9); 9925 9926 // PARSING 9927 9928 addRegexToken('D', match1to2); 9929 addRegexToken('DD', match1to2, match2); 9930 addRegexToken('Do', function (isStrict, locale) { 9931 // TODO: Remove "ordinalParse" fallback in next major release. 9932 return isStrict 9933 ? locale._dayOfMonthOrdinalParse || locale._ordinalParse 9934 : locale._dayOfMonthOrdinalParseLenient; 9935 }); 9936 9937 addParseToken(['D', 'DD'], DATE); 9938 addParseToken('Do', function (input, array) { 9939 array[DATE] = toInt(input.match(match1to2)[0]); 9940 }); 9941 9942 // MOMENTS 9943 9944 var getSetDayOfMonth = makeGetSet('Date', true); 9945 9946 // FORMATTING 9947 9948 addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); 9949 9950 // ALIASES 9951 9952 addUnitAlias('dayOfYear', 'DDD'); 9953 9954 // PRIORITY 9955 addUnitPriority('dayOfYear', 4); 9956 9957 // PARSING 9958 9959 addRegexToken('DDD', match1to3); 9960 addRegexToken('DDDD', match3); 9961 addParseToken(['DDD', 'DDDD'], function (input, array, config) { 9962 config._dayOfYear = toInt(input); 9963 }); 9964 9965 // HELPERS 9966 9967 // MOMENTS 9968 9969 function getSetDayOfYear(input) { 9970 var dayOfYear = 9971 Math.round( 9972 (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5 9973 ) + 1; 9974 return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); 9975 } 9976 9977 // FORMATTING 9978 9979 addFormatToken('m', ['mm', 2], 0, 'minute'); 9980 9981 // ALIASES 9982 9983 addUnitAlias('minute', 'm'); 9984 9985 // PRIORITY 9986 9987 addUnitPriority('minute', 14); 9988 9989 // PARSING 9990 9991 addRegexToken('m', match1to2); 9992 addRegexToken('mm', match1to2, match2); 9993 addParseToken(['m', 'mm'], MINUTE); 9994 9995 // MOMENTS 9996 9997 var getSetMinute = makeGetSet('Minutes', false); 9998 9999 // FORMATTING 10000 10001 addFormatToken('s', ['ss', 2], 0, 'second'); 10002 10003 // ALIASES 10004 10005 addUnitAlias('second', 's'); 10006 10007 // PRIORITY 10008 10009 addUnitPriority('second', 15); 10010 10011 // PARSING 10012 10013 addRegexToken('s', match1to2); 10014 addRegexToken('ss', match1to2, match2); 10015 addParseToken(['s', 'ss'], SECOND); 10016 10017 // MOMENTS 10018 10019 var getSetSecond = makeGetSet('Seconds', false); 10020 10021 // FORMATTING 10022 10023 addFormatToken('S', 0, 0, function () { 10024 return ~~(this.millisecond() / 100); 10025 }); 10026 10027 addFormatToken(0, ['SS', 2], 0, function () { 10028 return ~~(this.millisecond() / 10); 10029 }); 10030 10031 addFormatToken(0, ['SSS', 3], 0, 'millisecond'); 10032 addFormatToken(0, ['SSSS', 4], 0, function () { 10033 return this.millisecond() * 10; 10034 }); 10035 addFormatToken(0, ['SSSSS', 5], 0, function () { 10036 return this.millisecond() * 100; 10037 }); 10038 addFormatToken(0, ['SSSSSS', 6], 0, function () { 10039 return this.millisecond() * 1000; 10040 }); 10041 addFormatToken(0, ['SSSSSSS', 7], 0, function () { 10042 return this.millisecond() * 10000; 10043 }); 10044 addFormatToken(0, ['SSSSSSSS', 8], 0, function () { 10045 return this.millisecond() * 100000; 10046 }); 10047 addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { 10048 return this.millisecond() * 1000000; 10049 }); 10050 10051 // ALIASES 10052 10053 addUnitAlias('millisecond', 'ms'); 10054 10055 // PRIORITY 10056 10057 addUnitPriority('millisecond', 16); 10058 10059 // PARSING 10060 10061 addRegexToken('S', match1to3, match1); 10062 addRegexToken('SS', match1to3, match2); 10063 addRegexToken('SSS', match1to3, match3); 10064 10065 var token, getSetMillisecond; 10066 for (token = 'SSSS'; token.length <= 9; token += 'S') { 10067 addRegexToken(token, matchUnsigned); 10068 } 10069 10070 function parseMs(input, array) { 10071 array[MILLISECOND] = toInt(('0.' + input) * 1000); 10072 } 10073 10074 for (token = 'S'; token.length <= 9; token += 'S') { 10075 addParseToken(token, parseMs); 10076 } 10077 10078 getSetMillisecond = makeGetSet('Milliseconds', false); 10079 10080 // FORMATTING 10081 10082 addFormatToken('z', 0, 0, 'zoneAbbr'); 10083 addFormatToken('zz', 0, 0, 'zoneName'); 10084 10085 // MOMENTS 10086 10087 function getZoneAbbr() { 10088 return this._isUTC ? 'UTC' : ''; 10089 } 10090 10091 function getZoneName() { 10092 return this._isUTC ? 'Coordinated Universal Time' : ''; 10093 } 10094 10095 var proto = Moment.prototype; 10096 10097 proto.add = add; 10098 proto.calendar = calendar$1; 10099 proto.clone = clone; 10100 proto.diff = diff; 10101 proto.endOf = endOf; 10102 proto.format = format; 10103 proto.from = from; 10104 proto.fromNow = fromNow; 10105 proto.to = to; 10106 proto.toNow = toNow; 10107 proto.get = stringGet; 10108 proto.invalidAt = invalidAt; 10109 proto.isAfter = isAfter; 10110 proto.isBefore = isBefore; 10111 proto.isBetween = isBetween; 10112 proto.isSame = isSame; 10113 proto.isSameOrAfter = isSameOrAfter; 10114 proto.isSameOrBefore = isSameOrBefore; 10115 proto.isValid = isValid$2; 10116 proto.lang = lang; 10117 proto.locale = locale; 10118 proto.localeData = localeData; 10119 proto.max = prototypeMax; 10120 proto.min = prototypeMin; 10121 proto.parsingFlags = parsingFlags; 10122 proto.set = stringSet; 10123 proto.startOf = startOf; 10124 proto.subtract = subtract; 10125 proto.toArray = toArray; 10126 proto.toObject = toObject; 10127 proto.toDate = toDate; 10128 proto.toISOString = toISOString; 10129 proto.inspect = inspect; 10130 if (typeof Symbol !== 'undefined' && Symbol.for != null) { 10131 proto[Symbol.for('nodejs.util.inspect.custom')] = function () { 10132 return 'Moment<' + this.format() + '>'; 10133 }; 10134 } 10135 proto.toJSON = toJSON; 10136 proto.toString = toString; 10137 proto.unix = unix; 10138 proto.valueOf = valueOf; 10139 proto.creationData = creationData; 10140 proto.eraName = getEraName; 10141 proto.eraNarrow = getEraNarrow; 10142 proto.eraAbbr = getEraAbbr; 10143 proto.eraYear = getEraYear; 10144 proto.year = getSetYear; 10145 proto.isLeapYear = getIsLeapYear; 10146 proto.weekYear = getSetWeekYear; 10147 proto.isoWeekYear = getSetISOWeekYear; 10148 proto.quarter = proto.quarters = getSetQuarter; 10149 proto.month = getSetMonth; 10150 proto.daysInMonth = getDaysInMonth; 10151 proto.week = proto.weeks = getSetWeek; 10152 proto.isoWeek = proto.isoWeeks = getSetISOWeek; 10153 proto.weeksInYear = getWeeksInYear; 10154 proto.weeksInWeekYear = getWeeksInWeekYear; 10155 proto.isoWeeksInYear = getISOWeeksInYear; 10156 proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; 10157 proto.date = getSetDayOfMonth; 10158 proto.day = proto.days = getSetDayOfWeek; 10159 proto.weekday = getSetLocaleDayOfWeek; 10160 proto.isoWeekday = getSetISODayOfWeek; 10161 proto.dayOfYear = getSetDayOfYear; 10162 proto.hour = proto.hours = getSetHour; 10163 proto.minute = proto.minutes = getSetMinute; 10164 proto.second = proto.seconds = getSetSecond; 10165 proto.millisecond = proto.milliseconds = getSetMillisecond; 10166 proto.utcOffset = getSetOffset; 10167 proto.utc = setOffsetToUTC; 10168 proto.local = setOffsetToLocal; 10169 proto.parseZone = setOffsetToParsedOffset; 10170 proto.hasAlignedHourOffset = hasAlignedHourOffset; 10171 proto.isDST = isDaylightSavingTime; 10172 proto.isLocal = isLocal; 10173 proto.isUtcOffset = isUtcOffset; 10174 proto.isUtc = isUtc; 10175 proto.isUTC = isUtc; 10176 proto.zoneAbbr = getZoneAbbr; 10177 proto.zoneName = getZoneName; 10178 proto.dates = deprecate( 10179 'dates accessor is deprecated. Use date instead.', 10180 getSetDayOfMonth 10181 ); 10182 proto.months = deprecate( 10183 'months accessor is deprecated. Use month instead', 10184 getSetMonth 10185 ); 10186 proto.years = deprecate( 10187 'years accessor is deprecated. Use year instead', 10188 getSetYear 10189 ); 10190 proto.zone = deprecate( 10191 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', 10192 getSetZone 10193 ); 10194 proto.isDSTShifted = deprecate( 10195 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', 10196 isDaylightSavingTimeShifted 10197 ); 10198 10199 function createUnix(input) { 10200 return createLocal(input * 1000); 10201 } 10202 10203 function createInZone() { 10204 return createLocal.apply(null, arguments).parseZone(); 10205 } 10206 10207 function preParsePostFormat(string) { 10208 return string; 10209 } 10210 10211 var proto$1 = Locale.prototype; 10212 10213 proto$1.calendar = calendar; 10214 proto$1.longDateFormat = longDateFormat; 10215 proto$1.invalidDate = invalidDate; 10216 proto$1.ordinal = ordinal; 10217 proto$1.preparse = preParsePostFormat; 10218 proto$1.postformat = preParsePostFormat; 10219 proto$1.relativeTime = relativeTime; 10220 proto$1.pastFuture = pastFuture; 10221 proto$1.set = set; 10222 proto$1.eras = localeEras; 10223 proto$1.erasParse = localeErasParse; 10224 proto$1.erasConvertYear = localeErasConvertYear; 10225 proto$1.erasAbbrRegex = erasAbbrRegex; 10226 proto$1.erasNameRegex = erasNameRegex; 10227 proto$1.erasNarrowRegex = erasNarrowRegex; 10228 10229 proto$1.months = localeMonths; 10230 proto$1.monthsShort = localeMonthsShort; 10231 proto$1.monthsParse = localeMonthsParse; 10232 proto$1.monthsRegex = monthsRegex; 10233 proto$1.monthsShortRegex = monthsShortRegex; 10234 proto$1.week = localeWeek; 10235 proto$1.firstDayOfYear = localeFirstDayOfYear; 10236 proto$1.firstDayOfWeek = localeFirstDayOfWeek; 10237 10238 proto$1.weekdays = localeWeekdays; 10239 proto$1.weekdaysMin = localeWeekdaysMin; 10240 proto$1.weekdaysShort = localeWeekdaysShort; 10241 proto$1.weekdaysParse = localeWeekdaysParse; 10242 10243 proto$1.weekdaysRegex = weekdaysRegex; 10244 proto$1.weekdaysShortRegex = weekdaysShortRegex; 10245 proto$1.weekdaysMinRegex = weekdaysMinRegex; 10246 10247 proto$1.isPM = localeIsPM; 10248 proto$1.meridiem = localeMeridiem; 10249 10250 function get$1(format, index, field, setter) { 10251 var locale = getLocale(), 10252 utc = createUTC().set(setter, index); 10253 return locale[field](utc, format); 10254 } 10255 10256 function listMonthsImpl(format, index, field) { 10257 if (isNumber(format)) { 10258 index = format; 10259 format = undefined; 10260 } 10261 10262 format = format || ''; 10263 10264 if (index != null) { 10265 return get$1(format, index, field, 'month'); 10266 } 10267 10268 var i, 10269 out = []; 10270 for (i = 0; i < 12; i++) { 10271 out[i] = get$1(format, i, field, 'month'); 10272 } 10273 return out; 10274 } 10275 10276 // () 10277 // (5) 10278 // (fmt, 5) 10279 // (fmt) 10280 // (true) 10281 // (true, 5) 10282 // (true, fmt, 5) 10283 // (true, fmt) 10284 function listWeekdaysImpl(localeSorted, format, index, field) { 10285 if (typeof localeSorted === 'boolean') { 10286 if (isNumber(format)) { 10287 index = format; 10288 format = undefined; 10289 } 10290 10291 format = format || ''; 10292 } else { 10293 format = localeSorted; 10294 index = format; 10295 localeSorted = false; 10296 10297 if (isNumber(format)) { 10298 index = format; 10299 format = undefined; 10300 } 10301 10302 format = format || ''; 10303 } 10304 10305 var locale = getLocale(), 10306 shift = localeSorted ? locale._week.dow : 0, 10307 i, 10308 out = []; 10309 10310 if (index != null) { 10311 return get$1(format, (index + shift) % 7, field, 'day'); 10312 } 10313 10314 for (i = 0; i < 7; i++) { 10315 out[i] = get$1(format, (i + shift) % 7, field, 'day'); 10316 } 10317 return out; 10318 } 10319 10320 function listMonths(format, index) { 10321 return listMonthsImpl(format, index, 'months'); 10322 } 10323 10324 function listMonthsShort(format, index) { 10325 return listMonthsImpl(format, index, 'monthsShort'); 10326 } 10327 10328 function listWeekdays(localeSorted, format, index) { 10329 return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); 10330 } 10331 10332 function listWeekdaysShort(localeSorted, format, index) { 10333 return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); 10334 } 10335 10336 function listWeekdaysMin(localeSorted, format, index) { 10337 return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); 10338 } 10339 10340 getSetGlobalLocale('en', { 10341 eras: [ 10342 { 10343 since: '0001-01-01', 10344 until: +Infinity, 10345 offset: 1, 10346 name: 'Anno Domini', 10347 narrow: 'AD', 10348 abbr: 'AD', 10349 }, 10350 { 10351 since: '0000-12-31', 10352 until: -Infinity, 10353 offset: 1, 10354 name: 'Before Christ', 10355 narrow: 'BC', 10356 abbr: 'BC', 10357 }, 10358 ], 10359 dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, 10360 ordinal: function (number) { 10361 var b = number % 10, 10362 output = 10363 toInt((number % 100) / 10) === 1 10364 ? 'th' 10365 : b === 1 10366 ? 'st' 10367 : b === 2 10368 ? 'nd' 10369 : b === 3 10370 ? 'rd' 10371 : 'th'; 10372 return number + output; 10373 }, 10374 }); 10375 10376 // Side effect imports 10377 10378 hooks.lang = deprecate( 10379 'moment.lang is deprecated. Use moment.locale instead.', 10380 getSetGlobalLocale 10381 ); 10382 hooks.langData = deprecate( 10383 'moment.langData is deprecated. Use moment.localeData instead.', 10384 getLocale 10385 ); 10386 10387 var mathAbs = Math.abs; 10388 10389 function abs() { 10390 var data = this._data; 10391 10392 this._milliseconds = mathAbs(this._milliseconds); 10393 this._days = mathAbs(this._days); 10394 this._months = mathAbs(this._months); 10395 10396 data.milliseconds = mathAbs(data.milliseconds); 10397 data.seconds = mathAbs(data.seconds); 10398 data.minutes = mathAbs(data.minutes); 10399 data.hours = mathAbs(data.hours); 10400 data.months = mathAbs(data.months); 10401 data.years = mathAbs(data.years); 10402 10403 return this; 10404 } 10405 10406 function addSubtract$1(duration, input, value, direction) { 10407 var other = createDuration(input, value); 10408 10409 duration._milliseconds += direction * other._milliseconds; 10410 duration._days += direction * other._days; 10411 duration._months += direction * other._months; 10412 10413 return duration._bubble(); 10414 } 10415 10416 // supports only 2.0-style add(1, 's') or add(duration) 10417 function add$1(input, value) { 10418 return addSubtract$1(this, input, value, 1); 10419 } 10420 10421 // supports only 2.0-style subtract(1, 's') or subtract(duration) 10422 function subtract$1(input, value) { 10423 return addSubtract$1(this, input, value, -1); 10424 } 10425 10426 function absCeil(number) { 10427 if (number < 0) { 10428 return Math.floor(number); 10429 } else { 10430 return Math.ceil(number); 10431 } 10432 } 10433 10434 function bubble() { 10435 var milliseconds = this._milliseconds, 10436 days = this._days, 10437 months = this._months, 10438 data = this._data, 10439 seconds, 10440 minutes, 10441 hours, 10442 years, 10443 monthsFromDays; 10444 10445 // if we have a mix of positive and negative values, bubble down first 10446 // check: https://github.com/moment/moment/issues/2166 10447 if ( 10448 !( 10449 (milliseconds >= 0 && days >= 0 && months >= 0) || 10450 (milliseconds <= 0 && days <= 0 && months <= 0) 10451 ) 10452 ) { 10453 milliseconds += absCeil(monthsToDays(months) + days) * 864e5; 10454 days = 0; 10455 months = 0; 10456 } 10457 10458 // The following code bubbles up values, see the tests for 10459 // examples of what that means. 10460 data.milliseconds = milliseconds % 1000; 10461 10462 seconds = absFloor(milliseconds / 1000); 10463 data.seconds = seconds % 60; 10464 10465 minutes = absFloor(seconds / 60); 10466 data.minutes = minutes % 60; 10467 10468 hours = absFloor(minutes / 60); 10469 data.hours = hours % 24; 10470 10471 days += absFloor(hours / 24); 10472 10473 // convert days to months 10474 monthsFromDays = absFloor(daysToMonths(days)); 10475 months += monthsFromDays; 10476 days -= absCeil(monthsToDays(monthsFromDays)); 10477 10478 // 12 months -> 1 year 10479 years = absFloor(months / 12); 10480 months %= 12; 10481 10482 data.days = days; 10483 data.months = months; 10484 data.years = years; 10485 10486 return this; 10487 } 10488 10489 function daysToMonths(days) { 10490 // 400 years have 146097 days (taking into account leap year rules) 10491 // 400 years have 12 months === 4800 10492 return (days * 4800) / 146097; 10493 } 10494 10495 function monthsToDays(months) { 10496 // the reverse of daysToMonths 10497 return (months * 146097) / 4800; 10498 } 10499 10500 function as(units) { 10501 if (!this.isValid()) { 10502 return NaN; 10503 } 10504 var days, 10505 months, 10506 milliseconds = this._milliseconds; 10507 10508 units = normalizeUnits(units); 10509 10510 if (units === 'month' || units === 'quarter' || units === 'year') { 10511 days = this._days + milliseconds / 864e5; 10512 months = this._months + daysToMonths(days); 10513 switch (units) { 10514 case 'month': 10515 return months; 10516 case 'quarter': 10517 return months / 3; 10518 case 'year': 10519 return months / 12; 10520 } 10521 } else { 10522 // handle milliseconds separately because of floating point math errors (issue #1867) 10523 days = this._days + Math.round(monthsToDays(this._months)); 10524 switch (units) { 10525 case 'week': 10526 return days / 7 + milliseconds / 6048e5; 10527 case 'day': 10528 return days + milliseconds / 864e5; 10529 case 'hour': 10530 return days * 24 + milliseconds / 36e5; 10531 case 'minute': 10532 return days * 1440 + milliseconds / 6e4; 10533 case 'second': 10534 return days * 86400 + milliseconds / 1000; 10535 // Math.floor prevents floating point math errors here 10536 case 'millisecond': 10537 return Math.floor(days * 864e5) + milliseconds; 10538 default: 10539 throw new Error('Unknown unit ' + units); 10540 } 10541 } 10542 } 10543 10544 // TODO: Use this.as('ms')? 10545 function valueOf$1() { 10546 if (!this.isValid()) { 10547 return NaN; 10548 } 10549 return ( 10550 this._milliseconds + 10551 this._days * 864e5 + 10552 (this._months % 12) * 2592e6 + 10553 toInt(this._months / 12) * 31536e6 10554 ); 10555 } 10556 10557 function makeAs(alias) { 10558 return function () { 10559 return this.as(alias); 10560 }; 10561 } 10562 10563 var asMilliseconds = makeAs('ms'), 10564 asSeconds = makeAs('s'), 10565 asMinutes = makeAs('m'), 10566 asHours = makeAs('h'), 10567 asDays = makeAs('d'), 10568 asWeeks = makeAs('w'), 10569 asMonths = makeAs('M'), 10570 asQuarters = makeAs('Q'), 10571 asYears = makeAs('y'); 10572 10573 function clone$1() { 10574 return createDuration(this); 10575 } 10576 10577 function get$2(units) { 10578 units = normalizeUnits(units); 10579 return this.isValid() ? this[units + 's']() : NaN; 10580 } 10581 10582 function makeGetter(name) { 10583 return function () { 10584 return this.isValid() ? this._data[name] : NaN; 10585 }; 10586 } 10587 10588 var milliseconds = makeGetter('milliseconds'), 10589 seconds = makeGetter('seconds'), 10590 minutes = makeGetter('minutes'), 10591 hours = makeGetter('hours'), 10592 days = makeGetter('days'), 10593 months = makeGetter('months'), 10594 years = makeGetter('years'); 10595 10596 function weeks() { 10597 return absFloor(this.days() / 7); 10598 } 10599 10600 var round = Math.round, 10601 thresholds = { 10602 ss: 44, // a few seconds to seconds 10603 s: 45, // seconds to minute 10604 m: 45, // minutes to hour 10605 h: 22, // hours to day 10606 d: 26, // days to month/week 10607 w: null, // weeks to month 10608 M: 11, // months to year 10609 }; 10610 10611 // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize 10612 function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { 10613 return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); 10614 } 10615 10616 function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) { 10617 var duration = createDuration(posNegDuration).abs(), 10618 seconds = round(duration.as('s')), 10619 minutes = round(duration.as('m')), 10620 hours = round(duration.as('h')), 10621 days = round(duration.as('d')), 10622 months = round(duration.as('M')), 10623 weeks = round(duration.as('w')), 10624 years = round(duration.as('y')), 10625 a = 10626 (seconds <= thresholds.ss && ['s', seconds]) || 10627 (seconds < thresholds.s && ['ss', seconds]) || 10628 (minutes <= 1 && ['m']) || 10629 (minutes < thresholds.m && ['mm', minutes]) || 10630 (hours <= 1 && ['h']) || 10631 (hours < thresholds.h && ['hh', hours]) || 10632 (days <= 1 && ['d']) || 10633 (days < thresholds.d && ['dd', days]); 10634 10635 if (thresholds.w != null) { 10636 a = 10637 a || 10638 (weeks <= 1 && ['w']) || 10639 (weeks < thresholds.w && ['ww', weeks]); 10640 } 10641 a = a || 10642 (months <= 1 && ['M']) || 10643 (months < thresholds.M && ['MM', months]) || 10644 (years <= 1 && ['y']) || ['yy', years]; 10645 10646 a[2] = withoutSuffix; 10647 a[3] = +posNegDuration > 0; 10648 a[4] = locale; 10649 return substituteTimeAgo.apply(null, a); 10650 } 10651 10652 // This function allows you to set the rounding function for relative time strings
vendor: 7,888 bytes, lines 10653-10919
10653 function getSetRelativeTimeRounding(roundingFunction) { 10654 if (roundingFunction === undefined) { 10655 return round; 10656 } 10657 if (typeof roundingFunction === 'function') { 10658 round = roundingFunction; 10659 return true; 10660 } 10661 return false; 10662 } 10663 10664 // This function allows you to set a threshold for relative time strings 10665 function getSetRelativeTimeThreshold(threshold, limit) { 10666 if (thresholds[threshold] === undefined) { 10667 return false; 10668 } 10669 if (limit === undefined) { 10670 return thresholds[threshold]; 10671 } 10672 thresholds[threshold] = limit; 10673 if (threshold === 's') { 10674 thresholds.ss = limit - 1; 10675 } 10676 return true; 10677 } 10678 10679 function humanize(argWithSuffix, argThresholds) { 10680 if (!this.isValid()) { 10681 return this.localeData().invalidDate(); 10682 } 10683 10684 var withSuffix = false, 10685 th = thresholds, 10686 locale, 10687 output; 10688 10689 if (typeof argWithSuffix === 'object') { 10690 argThresholds = argWithSuffix; 10691 argWithSuffix = false; 10692 } 10693 if (typeof argWithSuffix === 'boolean') { 10694 withSuffix = argWithSuffix; 10695 } 10696 if (typeof argThresholds === 'object') { 10697 th = Object.assign({}, thresholds, argThresholds); 10698 if (argThresholds.s != null && argThresholds.ss == null) { 10699 th.ss = argThresholds.s - 1; 10700 } 10701 } 10702 10703 locale = this.localeData(); 10704 output = relativeTime$1(this, !withSuffix, th, locale); 10705 10706 if (withSuffix) { 10707 output = locale.pastFuture(+this, output); 10708 } 10709 10710 return locale.postformat(output); 10711 } 10712 10713 var abs$1 = Math.abs; 10714 10715 function sign(x) { 10716 return (x > 0) - (x < 0) || +x; 10717 } 10718 10719 function toISOString$1() { 10720 // for ISO strings we do not use the normal bubbling rules: 10721 // * milliseconds bubble up until they become hours 10722 // * days do not bubble at all 10723 // * months bubble up until they become years 10724 // This is because there is no context-free conversion between hours and days 10725 // (think of clock changes) 10726 // and also not between days and months (28-31 days per month) 10727 if (!this.isValid()) { 10728 return this.localeData().invalidDate(); 10729 } 10730 10731 var seconds = abs$1(this._milliseconds) / 1000, 10732 days = abs$1(this._days), 10733 months = abs$1(this._months), 10734 minutes, 10735 hours, 10736 years, 10737 s, 10738 total = this.asSeconds(), 10739 totalSign, 10740 ymSign, 10741 daysSign, 10742 hmsSign; 10743 10744 if (!total) { 10745 // this is the same as C#'s (Noda) and python (isodate)... 10746 // but not other JS (goog.date) 10747 return 'P0D'; 10748 } 10749 10750 // 3600 seconds -> 60 minutes -> 1 hour 10751 minutes = absFloor(seconds / 60); 10752 hours = absFloor(minutes / 60); 10753 seconds %= 60; 10754 minutes %= 60; 10755 10756 // 12 months -> 1 year 10757 years = absFloor(months / 12); 10758 months %= 12; 10759 10760 // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js 10761 s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; 10762 10763 totalSign = total < 0 ? '-' : ''; 10764 ymSign = sign(this._months) !== sign(total) ? '-' : ''; 10765 daysSign = sign(this._days) !== sign(total) ? '-' : ''; 10766 hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; 10767 10768 return ( 10769 totalSign + 10770 'P' + 10771 (years ? ymSign + years + 'Y' : '') + 10772 (months ? ymSign + months + 'M' : '') + 10773 (days ? daysSign + days + 'D' : '') + 10774 (hours || minutes || seconds ? 'T' : '') + 10775 (hours ? hmsSign + hours + 'H' : '') + 10776 (minutes ? hmsSign + minutes + 'M' : '') + 10777 (seconds ? hmsSign + s + 'S' : '') 10778 ); 10779 } 10780 10781 var proto$2 = Duration.prototype; 10782 10783 proto$2.isValid = isValid$1; 10784 proto$2.abs = abs; 10785 proto$2.add = add$1; 10786 proto$2.subtract = subtract$1; 10787 proto$2.as = as; 10788 proto$2.asMilliseconds = asMilliseconds; 10789 proto$2.asSeconds = asSeconds; 10790 proto$2.asMinutes = asMinutes; 10791 proto$2.asHours = asHours; 10792 proto$2.asDays = asDays; 10793 proto$2.asWeeks = asWeeks; 10794 proto$2.asMonths = asMonths; 10795 proto$2.asQuarters = asQuarters; 10796 proto$2.asYears = asYears; 10797 proto$2.valueOf = valueOf$1; 10798 proto$2._bubble = bubble; 10799 proto$2.clone = clone$1; 10800 proto$2.get = get$2; 10801 proto$2.milliseconds = milliseconds; 10802 proto$2.seconds = seconds; 10803 proto$2.minutes = minutes; 10804 proto$2.hours = hours; 10805 proto$2.days = days; 10806 proto$2.weeks = weeks; 10807 proto$2.months = months; 10808 proto$2.years = years; 10809 proto$2.humanize = humanize; 10810 proto$2.toISOString = toISOString$1; 10811 proto$2.toString = toISOString$1; 10812 proto$2.toJSON = toISOString$1; 10813 proto$2.locale = locale; 10814 proto$2.localeData = localeData; 10815 10816 proto$2.toIsoString = deprecate( 10817 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', 10818 toISOString$1 10819 ); 10820 proto$2.lang = lang; 10821 10822 // FORMATTING 10823 10824 addFormatToken('X', 0, 0, 'unix'); 10825 addFormatToken('x', 0, 0, 'valueOf'); 10826 10827 // PARSING 10828 10829 addRegexToken('x', matchSigned); 10830 addRegexToken('X', matchTimestamp); 10831 addParseToken('X', function (input, array, config) { 10832 config._d = new Date(parseFloat(input) * 1000); 10833 }); 10834 addParseToken('x', function (input, array, config) { 10835 config._d = new Date(toInt(input)); 10836 }); 10837 10838 //! moment.js 10839 10840 hooks.version = '2.29.4'; 10841 10842 setHookCallback(createLocal); 10843 10844 hooks.fn = proto; 10845 hooks.min = min; 10846 hooks.max = max; 10847 hooks.now = now; 10848 hooks.utc = createUTC; 10849 hooks.unix = createUnix; 10850 hooks.months = listMonths; 10851 hooks.isDate = isDate; 10852 hooks.locale = getSetGlobalLocale; 10853 hooks.invalid = createInvalid; 10854 hooks.duration = createDuration; 10855 hooks.isMoment = isMoment; 10856 hooks.weekdays = listWeekdays; 10857 hooks.parseZone = createInZone; 10858 hooks.localeData = getLocale; 10859 hooks.isDuration = isDuration; 10860 hooks.monthsShort = listMonthsShort; 10861 hooks.weekdaysMin = listWeekdaysMin; 10862 hooks.defineLocale = defineLocale; 10863 hooks.updateLocale = updateLocale; 10864 hooks.locales = listLocales; 10865 hooks.weekdaysShort = listWeekdaysShort; 10866 hooks.normalizeUnits = normalizeUnits; 10867 hooks.relativeTimeRounding = getSetRelativeTimeRounding; 10868 hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; 10869 hooks.calendarFormat = getCalendarFormat; 10870 hooks.prototype = proto; 10871 10872 // currently HTML5 input type only supports 24-hour formats 10873 hooks.HTML5_FMT = { 10874 DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" /> 10875 DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" /> 10876 DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" /> 10877 DATE: 'YYYY-MM-DD', // <input type="date" /> 10878 TIME: 'HH:mm', // <input type="time" /> 10879 TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" /> 10880 TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" /> 10881 WEEK: 'GGGG-[W]WW', // <input type="week" /> 10882 MONTH: 'YYYY-MM', // <input type="month" /> 10883 }; 10884 10885 return hooks; 10886 10887}))); 10888/*! 10889 * jQuery Validation Plugin v1.19.3 10890 * 10891 * https://jqueryvalidation.org/ 10892 * 10893 * Copyright (c) 2021 Jörn Zaefferer 10894 * Released under the MIT license 10895 */ 10896(function( factory ) { 10897 if ( typeof define === "function" && define.amd ) { 10898 define( ["jquery"], factory ); 10899 } else if (typeof module === "object" && module.exports) { 10900 module.exports = factory( require( "jquery" ) ); 10901 } else { 10902 factory( jQuery ); 10903 } 10904}(function( $ ) { 10905 10906$.extend( $.fn, { 10907 10908 // https://jqueryvalidation.org/validate/ 10909 validate: function( options ) { 10910 10911 // If nothing is selected, return nothing; can't chain anyway 10912 if ( !this.length ) { 10913 if ( options && options.debug && window.console ) { 10914 console.warn( "Nothing selected, can't validate, returning nothing." ); 10915 } 10916 return; 10917 } 10918 10919 // Check if a validator for this form was already created
vendor: 26,501 bytes, lines 10920-11806
10920 var validator = $.data( this[ 0 ], "validator" ); 10921 if ( validator ) { 10922 return validator; 10923 } 10924 10925 // Add novalidate tag if HTML5. 10926 this.attr( "novalidate", "novalidate" ); 10927 10928 validator = new $.validator( options, this[ 0 ] ); 10929 $.data( this[ 0 ], "validator", validator ); 10930 10931 if ( validator.settings.onsubmit ) { 10932 10933 this.on( "click.validate", ":submit", function( event ) { 10934 10935 // Track the used submit button to properly handle scripted 10936 // submits later. 10937 validator.submitButton = event.currentTarget; 10938 10939 // Allow suppressing validation by adding a cancel class to the submit button 10940 if ( $( this ).hasClass( "cancel" ) ) { 10941 validator.cancelSubmit = true; 10942 } 10943 10944 // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button 10945 if ( $( this ).attr( "formnovalidate" ) !== undefined ) { 10946 validator.cancelSubmit = true; 10947 } 10948 } ); 10949 10950 // Validate the form on submit 10951 this.on( "submit.validate", function( event ) { 10952 if ( validator.settings.debug ) { 10953 10954 // Prevent form submit to be able to see console output 10955 event.preventDefault(); 10956 } 10957 10958 function handle() { 10959 var hidden, result; 10960 10961 // Insert a hidden input as a replacement for the missing submit button 10962 // The hidden input is inserted in two cases: 10963 // - A user defined a `submitHandler` 10964 // - There was a pending request due to `remote` method and `stopRequest()` 10965 // was called to submit the form in case it's valid 10966 if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) { 10967 hidden = $( "<input type='hidden'/>" ) 10968 .attr( "name", validator.submitButton.name ) 10969 .val( $( validator.submitButton ).val() ) 10970 .appendTo( validator.currentForm ); 10971 } 10972 10973 if ( validator.settings.submitHandler && !validator.settings.debug ) { 10974 result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); 10975 if ( hidden ) { 10976 10977 // And clean up afterwards; thanks to no-block-scope, hidden can be referenced 10978 hidden.remove(); 10979 } 10980 if ( result !== undefined ) { 10981 return result; 10982 } 10983 return false; 10984 } 10985 return true; 10986 } 10987 10988 // Prevent submit for invalid forms or custom submit handlers 10989 if ( validator.cancelSubmit ) { 10990 validator.cancelSubmit = false; 10991 return handle(); 10992 } 10993 if ( validator.form() ) { 10994 if ( validator.pendingRequest ) { 10995 validator.formSubmitted = true; 10996 return false; 10997 } 10998 return handle(); 10999 } else { 11000 validator.focusInvalid(); 11001 return false; 11002 } 11003 } ); 11004 } 11005 11006 return validator; 11007 }, 11008 11009 // https://jqueryvalidation.org/valid/ 11010 valid: function() { 11011 var valid, validator, errorList; 11012 11013 if ( $( this[ 0 ] ).is( "form" ) ) { 11014 valid = this.validate().form(); 11015 } else { 11016 errorList = []; 11017 valid = true; 11018 validator = $( this[ 0 ].form ).validate(); 11019 this.each( function() { 11020 valid = validator.element( this ) && valid; 11021 if ( !valid ) { 11022 errorList = errorList.concat( validator.errorList ); 11023 } 11024 } ); 11025 validator.errorList = errorList; 11026 } 11027 return valid; 11028 }, 11029 11030 // https://jqueryvalidation.org/rules/ 11031 rules: function( command, argument ) { 11032 var element = this[ 0 ], 11033 isContentEditable = typeof this.attr( "contenteditable" ) !== "undefined" && this.attr( "contenteditable" ) !== "false", 11034 settings, staticRules, existingRules, data, param, filtered; 11035 11036 // If nothing is selected, return empty object; can't chain anyway 11037 if ( element == null ) { 11038 return; 11039 } 11040 11041 if ( !element.form && isContentEditable ) { 11042 element.form = this.closest( "form" )[ 0 ]; 11043 element.name = this.attr( "name" ); 11044 } 11045 11046 if ( element.form == null ) { 11047 return; 11048 } 11049 11050 if ( command ) { 11051 settings = $.data( element.form, "validator" ).settings; 11052 staticRules = settings.rules; 11053 existingRules = $.validator.staticRules( element ); 11054 switch ( command ) { 11055 case "add": 11056 $.extend( existingRules, $.validator.normalizeRule( argument ) ); 11057 11058 // Remove messages from rules, but allow them to be set separately 11059 delete existingRules.messages; 11060 staticRules[ element.name ] = existingRules; 11061 if ( argument.messages ) { 11062 settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); 11063 } 11064 break; 11065 case "remove": 11066 if ( !argument ) { 11067 delete staticRules[ element.name ]; 11068 return existingRules; 11069 } 11070 filtered = {}; 11071 $.each( argument.split( /\s/ ), function( index, method ) { 11072 filtered[ method ] = existingRules[ method ]; 11073 delete existingRules[ method ]; 11074 } ); 11075 return filtered; 11076 } 11077 } 11078 11079 data = $.validator.normalizeRules( 11080 $.extend( 11081 {}, 11082 $.validator.classRules( element ), 11083 $.validator.attributeRules( element ), 11084 $.validator.dataRules( element ), 11085 $.validator.staticRules( element ) 11086 ), element ); 11087 11088 // Make sure required is at front 11089 if ( data.required ) { 11090 param = data.required; 11091 delete data.required; 11092 data = $.extend( { required: param }, data ); 11093 } 11094 11095 // Make sure remote is at back 11096 if ( data.remote ) { 11097 param = data.remote; 11098 delete data.remote; 11099 data = $.extend( data, { remote: param } ); 11100 } 11101 11102 return data; 11103 } 11104} ); 11105 11106// JQuery trim is deprecated, provide a trim method based on String.prototype.trim 11107var trim = function( str ) { 11108 11109 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim#Polyfill 11110 return str.replace( /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "" ); 11111}; 11112 11113// Custom selectors 11114$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support 11115 11116 // https://jqueryvalidation.org/blank-selector/ 11117 blank: function( a ) { 11118 return !trim( "" + $( a ).val() ); 11119 }, 11120 11121 // https://jqueryvalidation.org/filled-selector/ 11122 filled: function( a ) { 11123 var val = $( a ).val(); 11124 return val !== null && !!trim( "" + val ); 11125 }, 11126 11127 // https://jqueryvalidation.org/unchecked-selector/ 11128 unchecked: function( a ) { 11129 return !$( a ).prop( "checked" ); 11130 } 11131} ); 11132 11133// Constructor for validator 11134$.validator = function( options, form ) { 11135 this.settings = $.extend( true, {}, $.validator.defaults, options ); 11136 this.currentForm = form; 11137 this.init(); 11138}; 11139 11140// https://jqueryvalidation.org/jQuery.validator.format/ 11141$.validator.format = function( source, params ) { 11142 if ( arguments.length === 1 ) { 11143 return function() { 11144 var args = $.makeArray( arguments ); 11145 args.unshift( source ); 11146 return $.validator.format.apply( this, args ); 11147 }; 11148 } 11149 if ( params === undefined ) { 11150 return source; 11151 } 11152 if ( arguments.length > 2 && params.constructor !== Array ) { 11153 params = $.makeArray( arguments ).slice( 1 ); 11154 } 11155 if ( params.constructor !== Array ) { 11156 params = [ params ]; 11157 } 11158 $.each( params, function( i, n ) { 11159 source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { 11160 return n; 11161 } ); 11162 } ); 11163 return source; 11164}; 11165 11166$.extend( $.validator, { 11167 11168 defaults: { 11169 messages: {}, 11170 groups: {}, 11171 rules: {}, 11172 errorClass: "error", 11173 pendingClass: "pending", 11174 validClass: "valid", 11175 errorElement: "label", 11176 focusCleanup: false, 11177 focusInvalid: true, 11178 errorContainer: $( [] ), 11179 errorLabelContainer: $( [] ), 11180 onsubmit: true, 11181 ignore: ":hidden", 11182 ignoreTitle: false, 11183 onfocusin: function( element ) { 11184 this.lastActive = element; 11185 11186 // Hide error label and remove error class on focus if enabled 11187 if ( this.settings.focusCleanup ) { 11188 if ( this.settings.unhighlight ) { 11189 this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); 11190 } 11191 this.hideThese( this.errorsFor( element ) ); 11192 } 11193 }, 11194 onfocusout: function( element ) { 11195 if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) { 11196 this.element( element ); 11197 } 11198 }, 11199 onkeyup: function( element, event ) { 11200 11201 // Avoid revalidate the field when pressing one of the following keys 11202 // Shift => 16 11203 // Ctrl => 17 11204 // Alt => 18 11205 // Caps lock => 20 11206 // End => 35 11207 // Home => 36 11208 // Left arrow => 37 11209 // Up arrow => 38 11210 // Right arrow => 39 11211 // Down arrow => 40 11212 // Insert => 45 11213 // Num lock => 144 11214 // AltGr key => 225 11215 var excludedKeys = [ 11216 16, 17, 18, 20, 35, 36, 37, 11217 38, 39, 40, 45, 144, 225 11218 ]; 11219 11220 if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { 11221 return; 11222 } else if ( element.name in this.submitted || element.name in this.invalid ) { 11223 this.element( element ); 11224 } 11225 }, 11226 onclick: function( element ) { 11227 11228 // Click on selects, radiobuttons and checkboxes 11229 if ( element.name in this.submitted ) { 11230 this.element( element ); 11231 11232 // Or option elements, check parent select in that case 11233 } else if ( element.parentNode.name in this.submitted ) { 11234 this.element( element.parentNode ); 11235 } 11236 }, 11237 highlight: function( element, errorClass, validClass ) { 11238 if ( element.type === "radio" ) { 11239 this.findByName( element.name ).addClass( errorClass ).removeClass( validClass ); 11240 } else { 11241 $( element ).addClass( errorClass ).removeClass( validClass ); 11242 } 11243 }, 11244 unhighlight: function( element, errorClass, validClass ) { 11245 if ( element.type === "radio" ) { 11246 this.findByName( element.name ).removeClass( errorClass ).addClass( validClass ); 11247 } else { 11248 $( element ).removeClass( errorClass ).addClass( validClass ); 11249 } 11250 } 11251 }, 11252 11253 // https://jqueryvalidation.org/jQuery.validator.setDefaults/ 11254 setDefaults: function( settings ) { 11255 $.extend( $.validator.defaults, settings ); 11256 }, 11257 11258 messages: { 11259 required: "This field is required.", 11260 remote: "Please fix this field.", 11261 email: "Please enter a valid email address.", 11262 url: "Please enter a valid URL.", 11263 date: "Please enter a valid date.", 11264 dateISO: "Please enter a valid date (ISO).", 11265 number: "Please enter a valid number.", 11266 digits: "Please enter only digits.", 11267 equalTo: "Please enter the same value again.", 11268 maxlength: $.validator.format( "Please enter no more than {0} characters." ), 11269 minlength: $.validator.format( "Please enter at least {0} characters." ), 11270 rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ), 11271 range: $.validator.format( "Please enter a value between {0} and {1}." ), 11272 max: $.validator.format( "Please enter a value less than or equal to {0}." ), 11273 min: $.validator.format( "Please enter a value greater than or equal to {0}." ), 11274 step: $.validator.format( "Please enter a multiple of {0}." ) 11275 }, 11276 11277 autoCreateRanges: false, 11278 11279 prototype: { 11280 11281 init: function() { 11282 this.labelContainer = $( this.settings.errorLabelContainer ); 11283 this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm ); 11284 this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer ); 11285 this.submitted = {}; 11286 this.valueCache = {}; 11287 this.pendingRequest = 0; 11288 this.pending = {}; 11289 this.invalid = {}; 11290 this.reset(); 11291 11292 var currentForm = this.currentForm, 11293 groups = ( this.groups = {} ), 11294 rules; 11295 $.each( this.settings.groups, function( key, value ) { 11296 if ( typeof value === "string" ) { 11297 value = value.split( /\s/ ); 11298 } 11299 $.each( value, function( index, name ) { 11300 groups[ name ] = key; 11301 } ); 11302 } ); 11303 rules = this.settings.rules; 11304 $.each( rules, function( key, value ) { 11305 rules[ key ] = $.validator.normalizeRule( value ); 11306 } ); 11307 11308 function delegate( event ) { 11309 var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; 11310 11311 // Set form expando on contenteditable 11312 if ( !this.form && isContentEditable ) { 11313 this.form = $( this ).closest( "form" )[ 0 ]; 11314 this.name = $( this ).attr( "name" ); 11315 } 11316 11317 // Ignore the element if it belongs to another form. This will happen mainly 11318 // when setting the `form` attribute of an input to the id of another form. 11319 if ( currentForm !== this.form ) { 11320 return; 11321 } 11322 11323 var validator = $.data( this.form, "validator" ), 11324 eventType = "on" + event.type.replace( /^validate/, "" ), 11325 settings = validator.settings; 11326 if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) { 11327 settings[ eventType ].call( validator, this, event ); 11328 } 11329 } 11330 11331 $( this.currentForm ) 11332 .on( "focusin.validate focusout.validate keyup.validate", 11333 ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + 11334 "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + 11335 "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + 11336 "[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate ) 11337 11338 // Support: Chrome, oldIE 11339 // "select" is provided as event.target when clicking a option 11340 .on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate ); 11341 11342 if ( this.settings.invalidHandler ) { 11343 $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler ); 11344 } 11345 }, 11346 11347 // https://jqueryvalidation.org/Validator.form/ 11348 form: function() { 11349 this.checkForm(); 11350 $.extend( this.submitted, this.errorMap ); 11351 this.invalid = $.extend( {}, this.errorMap ); 11352 if ( !this.valid() ) { 11353 $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); 11354 } 11355 this.showErrors(); 11356 return this.valid(); 11357 }, 11358 11359 checkForm: function() { 11360 this.prepareForm(); 11361 for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) { 11362 this.check( elements[ i ] ); 11363 } 11364 return this.valid(); 11365 }, 11366 11367 // https://jqueryvalidation.org/Validator.element/ 11368 element: function( element ) { 11369 var cleanElement = this.clean( element ), 11370 checkElement = this.validationTargetFor( cleanElement ), 11371 v = this, 11372 result = true, 11373 rs, group; 11374 11375 if ( checkElement === undefined ) { 11376 delete this.invalid[ cleanElement.name ]; 11377 } else { 11378 this.prepareElement( checkElement ); 11379 this.currentElements = $( checkElement ); 11380 11381 // If this element is grouped, then validate all group elements already 11382 // containing a value 11383 group = this.groups[ checkElement.name ]; 11384 if ( group ) { 11385 $.each( this.groups, function( name, testgroup ) { 11386 if ( testgroup === group && name !== checkElement.name ) { 11387 cleanElement = v.validationTargetFor( v.clean( v.findByName( name ) ) ); 11388 if ( cleanElement && cleanElement.name in v.invalid ) { 11389 v.currentElements.push( cleanElement ); 11390 result = v.check( cleanElement ) && result; 11391 } 11392 } 11393 } ); 11394 } 11395 11396 rs = this.check( checkElement ) !== false; 11397 result = result && rs; 11398 if ( rs ) { 11399 this.invalid[ checkElement.name ] = false; 11400 } else { 11401 this.invalid[ checkElement.name ] = true; 11402 } 11403 11404 if ( !this.numberOfInvalids() ) { 11405 11406 // Hide error containers on last error 11407 this.toHide = this.toHide.add( this.containers ); 11408 } 11409 this.showErrors(); 11410 11411 // Add aria-invalid status for screen readers 11412 $( element ).attr( "aria-invalid", !rs ); 11413 } 11414 11415 return result; 11416 }, 11417 11418 // https://jqueryvalidation.org/Validator.showErrors/ 11419 showErrors: function( errors ) { 11420 if ( errors ) { 11421 var validator = this; 11422 11423 // Add items to error list and map 11424 $.extend( this.errorMap, errors ); 11425 this.errorList = $.map( this.errorMap, function( message, name ) { 11426 return { 11427 message: message, 11428 element: validator.findByName( name )[ 0 ] 11429 }; 11430 } ); 11431 11432 // Remove items from success list 11433 this.successList = $.grep( this.successList, function( element ) { 11434 return !( element.name in errors ); 11435 } ); 11436 } 11437 if ( this.settings.showErrors ) { 11438 this.settings.showErrors.call( this, this.errorMap, this.errorList ); 11439 } else { 11440 this.defaultShowErrors(); 11441 } 11442 }, 11443 11444 // https://jqueryvalidation.org/Validator.resetForm/ 11445 resetForm: function() { 11446 if ( $.fn.resetForm ) { 11447 $( this.currentForm ).resetForm(); 11448 } 11449 this.invalid = {}; 11450 this.submitted = {}; 11451 this.prepareForm(); 11452 this.hideErrors(); 11453 var elements = this.elements() 11454 .removeData( "previousValue" ) 11455 .removeAttr( "aria-invalid" ); 11456 11457 this.resetElements( elements ); 11458 }, 11459 11460 resetElements: function( elements ) { 11461 var i; 11462 11463 if ( this.settings.unhighlight ) { 11464 for ( i = 0; elements[ i ]; i++ ) { 11465 this.settings.unhighlight.call( this, elements[ i ], 11466 this.settings.errorClass, "" ); 11467 this.findByName( elements[ i ].name ).removeClass( this.settings.validClass ); 11468 } 11469 } else { 11470 elements 11471 .removeClass( this.settings.errorClass ) 11472 .removeClass( this.settings.validClass ); 11473 } 11474 }, 11475 11476 numberOfInvalids: function() { 11477 return this.objectLength( this.invalid ); 11478 }, 11479 11480 objectLength: function( obj ) { 11481 /* jshint unused: false */ 11482 var count = 0, 11483 i; 11484 for ( i in obj ) { 11485 11486 // This check allows counting elements with empty error 11487 // message as invalid elements 11488 if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) { 11489 count++; 11490 } 11491 } 11492 return count; 11493 }, 11494 11495 hideErrors: function() { 11496 this.hideThese( this.toHide ); 11497 }, 11498 11499 hideThese: function( errors ) { 11500 errors.not( this.containers ).text( "" ); 11501 this.addWrapper( errors ).hide(); 11502 }, 11503 11504 valid: function() { 11505 return this.size() === 0; 11506 }, 11507 11508 size: function() { 11509 return this.errorList.length; 11510 }, 11511 11512 focusInvalid: function() { 11513 if ( this.settings.focusInvalid ) { 11514 try { 11515 $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] ) 11516 .filter( ":visible" ) 11517 .trigger( "focus" ) 11518 11519 // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find 11520 .trigger( "focusin" ); 11521 } catch ( e ) { 11522 11523 // Ignore IE throwing errors when focusing hidden elements 11524 } 11525 } 11526 }, 11527 11528 findLastActive: function() { 11529 var lastActive = this.lastActive; 11530 return lastActive && $.grep( this.errorList, function( n ) { 11531 return n.element.name === lastActive.name; 11532 } ).length === 1 && lastActive; 11533 }, 11534 11535 elements: function() { 11536 var validator = this, 11537 rulesCache = {}; 11538 11539 // Select all valid inputs inside the form (no submit or reset buttons) 11540 return $( this.currentForm ) 11541 .find( "input, select, textarea, [contenteditable]" ) 11542 .not( ":submit, :reset, :image, :disabled" ) 11543 .not( this.settings.ignore ) 11544 .filter( function() { 11545 var name = this.name || $( this ).attr( "name" ); // For contenteditable 11546 var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; 11547 11548 if ( !name && validator.settings.debug && window.console ) { 11549 console.error( "%o has no name assigned", this ); 11550 } 11551 11552 // Set form expando on contenteditable 11553 if ( isContentEditable ) { 11554 this.form = $( this ).closest( "form" )[ 0 ]; 11555 this.name = name; 11556 } 11557 11558 // Ignore elements that belong to other/nested forms 11559 if ( this.form !== validator.currentForm ) { 11560 return false; 11561 } 11562 11563 // Select only the first element for each name, and only those with rules specified 11564 if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) { 11565 return false; 11566 } 11567 11568 rulesCache[ name ] = true; 11569 return true; 11570 } ); 11571 }, 11572 11573 clean: function( selector ) { 11574 return $( selector )[ 0 ]; 11575 }, 11576 11577 errors: function() { 11578 var errorClass = this.settings.errorClass.split( " " ).join( "." ); 11579 return $( this.settings.errorElement + "." + errorClass, this.errorContext ); 11580 }, 11581 11582 resetInternals: function() { 11583 this.successList = []; 11584 this.errorList = []; 11585 this.errorMap = {}; 11586 this.toShow = $( [] ); 11587 this.toHide = $( [] ); 11588 }, 11589 11590 reset: function() { 11591 this.resetInternals(); 11592 this.currentElements = $( [] ); 11593 }, 11594 11595 prepareForm: function() { 11596 this.reset(); 11597 this.toHide = this.errors().add( this.containers ); 11598 }, 11599 11600 prepareElement: function( element ) { 11601 this.reset(); 11602 this.toHide = this.errorsFor( element ); 11603 }, 11604 11605 elementValue: function( element ) { 11606 var $element = $( element ), 11607 type = element.type, 11608 isContentEditable = typeof $element.attr( "contenteditable" ) !== "undefined" && $element.attr( "contenteditable" ) !== "false", 11609 val, idx; 11610 11611 if ( type === "radio" || type === "checkbox" ) { 11612 return this.findByName( element.name ).filter( ":checked" ).val(); 11613 } else if ( type === "number" && typeof element.validity !== "undefined" ) { 11614 return element.validity.badInput ? "NaN" : $element.val(); 11615 } 11616 11617 if ( isContentEditable ) { 11618 val = $element.text(); 11619 } else { 11620 val = $element.val(); 11621 } 11622 11623 if ( type === "file" ) { 11624 11625 // Modern browser (chrome & safari) 11626 if ( val.substr( 0, 12 ) === "C:\\fakepath\\" ) { 11627 return val.substr( 12 ); 11628 } 11629 11630 // Legacy browsers 11631 // Unix-based path 11632 idx = val.lastIndexOf( "/" ); 11633 if ( idx >= 0 ) { 11634 return val.substr( idx + 1 ); 11635 } 11636 11637 // Windows-based path 11638 idx = val.lastIndexOf( "\\" ); 11639 if ( idx >= 0 ) { 11640 return val.substr( idx + 1 ); 11641 } 11642 11643 // Just the file name 11644 return val; 11645 } 11646 11647 if ( typeof val === "string" ) { 11648 return val.replace( /\r/g, "" ); 11649 } 11650 return val; 11651 }, 11652 11653 check: function( element ) { 11654 element = this.validationTargetFor( this.clean( element ) ); 11655 11656 var rules = $( element ).rules(), 11657 rulesCount = $.map( rules, function( n, i ) { 11658 return i; 11659 } ).length, 11660 dependencyMismatch = false, 11661 val = this.elementValue( element ), 11662 result, method, rule, normalizer; 11663 11664 // Prioritize the local normalizer defined for this element over the global one 11665 // if the former exists, otherwise user the global one in case it exists. 11666 if ( typeof rules.normalizer === "function" ) { 11667 normalizer = rules.normalizer; 11668 } else if ( typeof this.settings.normalizer === "function" ) { 11669 normalizer = this.settings.normalizer; 11670 } 11671 11672 // If normalizer is defined, then call it to retreive the changed value instead 11673 // of using the real one. 11674 // Note that `this` in the normalizer is `element`. 11675 if ( normalizer ) { 11676 val = normalizer.call( element, val ); 11677 11678 // Delete the normalizer from rules to avoid treating it as a pre-defined method. 11679 delete rules.normalizer; 11680 } 11681 11682 for ( method in rules ) { 11683 rule = { method: method, parameters: rules[ method ] }; 11684 try { 11685 result = $.validator.methods[ method ].call( this, val, element, rule.parameters ); 11686 11687 // If a method indicates that the field is optional and therefore valid, 11688 // don't mark it as valid when there are no other rules 11689 if ( result === "dependency-mismatch" && rulesCount === 1 ) { 11690 dependencyMismatch = true; 11691 continue; 11692 } 11693 dependencyMismatch = false; 11694 11695 if ( result === "pending" ) { 11696 this.toHide = this.toHide.not( this.errorsFor( element ) ); 11697 return; 11698 } 11699 11700 if ( !result ) { 11701 this.formatAndAdd( element, rule ); 11702 return false; 11703 } 11704 } catch ( e ) { 11705 if ( this.settings.debug && window.console ) { 11706 console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e ); 11707 } 11708 if ( e instanceof TypeError ) { 11709 e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; 11710 } 11711 11712 throw e; 11713 } 11714 } 11715 if ( dependencyMismatch ) { 11716 return; 11717 } 11718 if ( this.objectLength( rules ) ) { 11719 this.successList.push( element ); 11720 } 11721 return true; 11722 }, 11723 11724 // Return the custom message for the given element and validation method 11725 // specified in the element's HTML5 data attribute 11726 // return the generic message if present and no method specific message is present 11727 customDataMessage: function( element, method ) { 11728 return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() + 11729 method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" ); 11730 }, 11731 11732 // Return the custom message for the given element name and validation method 11733 customMessage: function( name, method ) { 11734 var m = this.settings.messages[ name ]; 11735 return m && ( m.constructor === String ? m : m[ method ] ); 11736 }, 11737 11738 // Return the first defined argument, allowing empty strings 11739 findDefined: function() { 11740 for ( var i = 0; i < arguments.length; i++ ) { 11741 if ( arguments[ i ] !== undefined ) { 11742 return arguments[ i ]; 11743 } 11744 } 11745 return undefined; 11746 }, 11747 11748 // The second parameter 'rule' used to be a string, and extended to an object literal 11749 // of the following form: 11750 // rule = { 11751 // method: "method name", 11752 // parameters: "the given method parameters" 11753 // } 11754 // 11755 // The old behavior still supported, kept to maintain backward compatibility with 11756 // old code, and will be removed in the next major release. 11757 defaultMessage: function( element, rule ) { 11758 if ( typeof rule === "string" ) { 11759 rule = { method: rule }; 11760 } 11761 11762 var message = this.findDefined( 11763 this.customMessage( element.name, rule.method ), 11764 this.customDataMessage( element, rule.method ), 11765 11766 // 'title' is never undefined, so handle empty string as undefined 11767 !this.settings.ignoreTitle && element.title || undefined, 11768 $.validator.messages[ rule.method ], 11769 "<strong>Warning: No message defined for " + element.name + "</strong>" 11770 ), 11771 theregex = /\$?\{(\d+)\}/g; 11772 if ( typeof message === "function" ) { 11773 message = message.call( this, rule.parameters, element ); 11774 } else if ( theregex.test( message ) ) { 11775 message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters ); 11776 } 11777 11778 return message; 11779 }, 11780 11781 formatAndAdd: function( element, rule ) { 11782 var message = this.defaultMessage( element, rule ); 11783 11784 this.errorList.push( { 11785 message: message, 11786 element: element, 11787 method: rule.method 11788 } ); 11789 11790 this.errorMap[ element.name ] = message; 11791 this.submitted[ element.name ] = message; 11792 }, 11793 11794 addWrapper: function( toToggle ) { 11795 if ( this.settings.wrapper ) { 11796 toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); 11797 } 11798 return toToggle; 11799 }, 11800 11801 defaultShowErrors: function() { 11802 var i, elements, error; 11803 for ( i = 0; this.errorList[ i ]; i++ ) { 11804 error = this.errorList[ i ]; 11805 if ( this.settings.highlight ) { 11806 this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.val
11806idClass ); 11807 } 11808 this.showLabel( error.element, error.message ); 11809 } 11810 if ( this.errorList.length ) { 11811 this.toShow = this.toShow.add( this.containers ); 11812 } 11813 if ( this.settings.success ) { 11814 for ( i = 0; this.successList[ i ]; i++ ) { 11815 this.showLabel( this.successList[ i ] ); 11816 } 11817 } 11818 if ( this.settings.unhighlight ) { 11819 for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) { 11820 this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass ); 11821 } 11822 } 11823 this.toHide = this.toHide.not( this.toShow ); 11824 this.hideErrors(); 11825 this.addWrapper( this.toShow ).show(); 11826 }, 11827 11828 validElements: function() { 11829 return this.currentElements.not( this.invalidElements() ); 11830 }, 11831 11832 invalidElements: function() { 11833 return $( this.errorList ).map( function() { 11834 return this.element; 11835 } ); 11836 }, 11837 11838 showLabel: function( element, message ) { 11839 var place, group, errorID, v, 11840 error = this.errorsFor( element ), 11841 elementID = this.idOrName( element ), 11842 describedBy = $( element ).attr( "aria-describedby" ); 11843 11844 if ( error.length ) { 11845 11846 // Refresh error/success class 11847 error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); 11848 11849 // Replace message on existing label 11850 error.html( message ); 11851 } else { 11852 11853 // Create error element 11854 error = $( "<" + this.settings.errorElement + ">" ) 11855 .attr( "id", elementID + "-error" ) 11856 .addClass( this.settings.errorClass ) 11857 .html( message || "" ); 11858 11859 // Maintain reference to the element to be placed into the DOM 11860 place = error; 11861 if ( this.settings.wrapper ) { 11862 11863 // Make sure the element is visible, even in IE 11864 // actually showing the wrapped element is handled elsewhere 11865 place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent(); 11866 } 11867 if ( this.labelContainer.length ) { 11868 this.labelContainer.append( place ); 11869 } else if ( this.settings.errorPlacement ) { 11870 this.settings.errorPlacement.call( this, place, $( element ) ); 11871 } else { 11872 place.insertAfter( element ); 11873 } 11874 11875 // Link error back to the element 11876 if ( error.is( "label" ) ) { 11877 11878 // If the error is a label, then associate using 'for' 11879 error.attr( "for", elementID ); 11880 11881 // If the element is not a child of an associated label, then it's necessary 11882 // to explicitly apply aria-describedby 11883 } else if ( error.parents( "label[for='" + this.escapeCssMeta( elementID ) + "']" ).length === 0 ) { 11884 errorID = error.attr( "id" ); 11885 11886 // Respect existing non-error aria-describedby 11887 if ( !describedBy ) { 11888 describedBy = errorID; 11889 } else if ( !describedBy.match( new RegExp( "\\b" + this.escapeCssMeta( errorID ) + "\\b" ) ) ) { 11890 11891 // Add to end of list if not already present 11892 describedBy += " " + errorID; 11893 } 11894 $( element ).attr( "aria-describedby", describedBy ); 11895 11896 // If this element is grouped, then assign to all elements in the same group 11897 group = this.groups[ element.name ]; 11898 if ( group ) { 11899 v = this; 11900 $.each( v.groups, function( name, testgroup ) { 11901 if ( testgroup === group ) { 11902 $( "[name='" + v.escapeCssMeta( name ) + "']", v.currentForm ) 11903 .attr( "aria-describedby", error.attr( "id" ) ); 11904 } 11905 } ); 11906 } 11907 } 11908 } 11909 if ( !message && this.settings.success ) { 11910 error.text( "" ); 11911 if ( typeof this.settings.success === "string" ) { 11912 error.addClass( this.settings.success ); 11913 } else { 11914 this.settings.success( error, element ); 11915 } 11916 } 11917 this.toShow = this.toShow.add( error ); 11918 }, 11919 11920 errorsFor: function( element ) { 11921 var name = this.escapeCssMeta( this.idOrName( element ) ), 11922 describer = $( element ).attr( "aria-describedby" ), 11923 selector = "label[for='" + name + "'], label[for='" + name + "'] *"; 11924 11925 // 'aria-describedby' should directly reference the error element 11926 if ( describer ) { 11927 selector = selector + ", #" + this.escapeCssMeta( describer ) 11928 .replace( /\s+/g, ", #" ); 11929 } 11930 11931 return this 11932 .errors() 11933 .filter( selector ); 11934 }, 11935 11936 // See https://api.jquery.com/category/selectors/, for CSS 11937 // meta-characters that should be escaped in order to be used with JQuery 11938 // as a literal part of a name/id or any selector. 11939 escapeCssMeta: function( string ) { 11940 return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" ); 11941 }, 11942 11943 idOrName: function( element ) { 11944 return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.i
vendor: 15,418 bytes, lines 11944-12425
11944d || element.name ); 11945 }, 11946 11947 validationTargetFor: function( element ) { 11948 11949 // If radio/checkbox, validate first element in group instead 11950 if ( this.checkable( element ) ) { 11951 element = this.findByName( element.name ); 11952 } 11953 11954 // Always apply ignore filter 11955 return $( element ).not( this.settings.ignore )[ 0 ]; 11956 }, 11957 11958 checkable: function( element ) { 11959 return ( /radio|checkbox/i ).test( element.type ); 11960 }, 11961 11962 findByName: function( name ) { 11963 return $( this.currentForm ).find( "[name='" + this.escapeCssMeta( name ) + "']" ); 11964 }, 11965 11966 getLength: function( value, element ) { 11967 switch ( element.nodeName.toLowerCase() ) { 11968 case "select": 11969 return $( "option:selected", element ).length; 11970 case "input": 11971 if ( this.checkable( element ) ) { 11972 return this.findByName( element.name ).filter( ":checked" ).length; 11973 } 11974 } 11975 return value.length; 11976 }, 11977 11978 depend: function( param, element ) { 11979 return this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ]( param, element ) : true; 11980 }, 11981 11982 dependTypes: { 11983 "boolean": function( param ) { 11984 return param; 11985 }, 11986 "string": function( param, element ) { 11987 return !!$( param, element.form ).length; 11988 }, 11989 "function": function( param, element ) { 11990 return param( element ); 11991 } 11992 }, 11993 11994 optional: function( element ) { 11995 var val = this.elementValue( element ); 11996 return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch"; 11997 }, 11998 11999 startRequest: function( element ) { 12000 if ( !this.pending[ element.name ] ) { 12001 this.pendingRequest++; 12002 $( element ).addClass( this.settings.pendingClass ); 12003 this.pending[ element.name ] = true; 12004 } 12005 }, 12006 12007 stopRequest: function( element, valid ) { 12008 this.pendingRequest--; 12009 12010 // Sometimes synchronization fails, make sure pendingRequest is never < 0 12011 if ( this.pendingRequest < 0 ) { 12012 this.pendingRequest = 0; 12013 } 12014 delete this.pending[ element.name ]; 12015 $( element ).removeClass( this.settings.pendingClass ); 12016 if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) { 12017 $( this.currentForm ).submit(); 12018 12019 // Remove the hidden input that was used as a replacement for the 12020 // missing submit button. The hidden input is added by `handle()` 12021 // to ensure that the value of the used submit button is passed on 12022 // for scripted submits triggered by this method 12023 if ( this.submitButton ) { 12024 $( "input:hidden[name='" + this.submitButton.name + "']", this.currentForm ).remove(); 12025 } 12026 12027 this.formSubmitted = false; 12028 } else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) { 12029 $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); 12030 this.formSubmitted = false; 12031 } 12032 }, 12033 12034 previousValue: function( element, method ) { 12035 method = typeof method === "string" && method || "remote"; 12036 12037 return $.data( element, "previousValue" ) || $.data( element, "previousValue", { 12038 old: null, 12039 valid: true, 12040 message: this.defaultMessage( element, { method: method } ) 12041 } ); 12042 }, 12043 12044 // Cleans up all forms and elements, removes validator-specific events 12045 destroy: function() { 12046 this.resetForm(); 12047 12048 $( this.currentForm ) 12049 .off( ".validate" ) 12050 .removeData( "validator" ) 12051 .find( ".validate-equalTo-blur" ) 12052 .off( ".validate-equalTo" ) 12053 .removeClass( "validate-equalTo-blur" ) 12054 .find( ".validate-lessThan-blur" ) 12055 .off( ".validate-lessThan" ) 12056 .removeClass( "validate-lessThan-blur" ) 12057 .find( ".validate-lessThanEqual-blur" ) 12058 .off( ".validate-lessThanEqual" ) 12059 .removeClass( "validate-lessThanEqual-blur" ) 12060 .find( ".validate-greaterThanEqual-blur" ) 12061 .off( ".validate-greaterThanEqual" ) 12062 .removeClass( "validate-greaterThanEqual-blur" ) 12063 .find( ".validate-greaterThan-blur" ) 12064 .off( ".validate-greaterThan" ) 12065 .removeClass( "validate-greaterThan-blur" ); 12066 } 12067 12068 }, 12069 12070 classRuleSettings: { 12071 required: { required: true }, 12072 email: { email: true }, 12073 url: { url: true }, 12074 date: { date: true }, 12075 dateISO: { dateISO: true }, 12076 number: { number: true }, 12077 digits: { digits: true }, 12078 creditcard: { creditcard: true } 12079 }, 12080 12081 addClassRules: function( className, rules ) { 12082 if ( className.constructor === String ) { 12083 this.classRuleSettings[ className ] = rules; 12084 } else { 12085 $.extend( this.classRuleSettings, className ); 12086 } 12087 }, 12088 12089 classRules: function( element ) { 12090 var rules = {}, 12091 classes = $( element ).attr( "class" ); 12092 12093 if ( classes ) { 12094 $.each( classes.split( " " ), function() { 12095 if ( this in $.validator.classRuleSettings ) { 12096 $.extend( rules, $.validator.classRuleSettings[ this ] ); 12097 } 12098 } ); 12099 } 12100 return rules; 12101 }, 12102 12103 normalizeAttributeRule: function( rules, type, method, value ) { 12104 12105 // Convert the value to a number for number inputs, and for text for backwards compability 12106 // allows type="date" and others to be compared as strings 12107 if ( /min|max|step/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) { 12108 value = Number( value ); 12109 12110 // Support Opera Mini, which returns NaN for undefined minlength 12111 if ( isNaN( value ) ) { 12112 value = undefined; 12113 } 12114 } 12115 12116 if ( value || value === 0 ) { 12117 rules[ method ] = value; 12118 } else if ( type === method && type !== "range" ) { 12119 12120 // Exception: the jquery validate 'range' method 12121 // does not test for the html5 'range' type 12122 rules[ method ] = true; 12123 } 12124 }, 12125 12126 attributeRules: function( element ) { 12127 var rules = {}, 12128 $element = $( element ), 12129 type = element.getAttribute( "type" ), 12130 method, value; 12131 12132 for ( method in $.validator.methods ) { 12133 12134 // Support for <input required> in both html5 and older browsers 12135 if ( method === "required" ) { 12136 value = element.getAttribute( method ); 12137 12138 // Some browsers return an empty string for the required attribute 12139 // and non-HTML5 browsers might have required="" markup 12140 if ( value === "" ) { 12141 value = true; 12142 } 12143 12144 // Force non-HTML5 browsers to return bool 12145 value = !!value; 12146 } else { 12147 value = $element.attr( method ); 12148 } 12149 12150 this.normalizeAttributeRule( rules, type, method, value ); 12151 } 12152 12153 // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs 12154 if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) { 12155 delete rules.maxlength; 12156 } 12157 12158 return rules; 12159 }, 12160 12161 dataRules: function( element ) { 12162 var rules = {}, 12163 $element = $( element ), 12164 type = element.getAttribute( "type" ), 12165 method, value; 12166 12167 for ( method in $.validator.methods ) { 12168 value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ); 12169 12170 // Cast empty attributes like `data-rule-required` to `true` 12171 if ( value === "" ) { 12172 value = true; 12173 } 12174 12175 this.normalizeAttributeRule( rules, type, method, value ); 12176 } 12177 return rules; 12178 }, 12179 12180 staticRules: function( element ) { 12181 var rules = {}, 12182 validator = $.data( element.form, "validator" ); 12183 12184 if ( validator.settings.rules ) { 12185 rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {}; 12186 } 12187 return rules; 12188 }, 12189 12190 normalizeRules: function( rules, element ) { 12191 12192 // Handle dependency check 12193 $.each( rules, function( prop, val ) { 12194 12195 // Ignore rule when param is explicitly false, eg. required:false 12196 if ( val === false ) { 12197 delete rules[ prop ]; 12198 return; 12199 } 12200 if ( val.param || val.depends ) { 12201 var keepRule = true; 12202 switch ( typeof val.depends ) { 12203 case "string": 12204 keepRule = !!$( val.depends, element.form ).length; 12205 break; 12206 case "function": 12207 keepRule = val.depends.call( element, element ); 12208 break; 12209 } 12210 if ( keepRule ) { 12211 rules[ prop ] = val.param !== undefined ? val.param : true; 12212 } else { 12213 $.data( element.form, "validator" ).resetElements( $( element ) ); 12214 delete rules[ prop ]; 12215 } 12216 } 12217 } ); 12218 12219 // Evaluate parameters 12220 $.each( rules, function( rule, parameter ) { 12221 rules[ rule ] = typeof parameter === "function" && rule !== "normalizer" ? parameter( element ) : parameter; 12222 } ); 12223 12224 // Clean number parameters 12225 $.each( [ "minlength", "maxlength" ], function() { 12226 if ( rules[ this ] ) { 12227 rules[ this ] = Number( rules[ this ] ); 12228 } 12229 } ); 12230 $.each( [ "rangelength", "range" ], function() { 12231 var parts; 12232 if ( rules[ this ] ) { 12233 if ( Array.isArray( rules[ this ] ) ) { 12234 rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ]; 12235 } else if ( typeof rules[ this ] === "string" ) { 12236 parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ ); 12237 rules[ this ] = [ Number( parts[ 0 ] ), Number( parts[ 1 ] ) ]; 12238 } 12239 } 12240 } ); 12241 12242 if ( $.validator.autoCreateRanges ) { 12243 12244 // Auto-create ranges 12245 if ( rules.min != null && rules.max != null ) { 12246 rules.range = [ rules.min, rules.max ]; 12247 delete rules.min; 12248 delete rules.max; 12249 } 12250 if ( rules.minlength != null && rules.maxlength != null ) { 12251 rules.rangelength = [ rules.minlength, rules.maxlength ]; 12252 delete rules.minlength; 12253 delete rules.maxlength; 12254 } 12255 } 12256 12257 return rules; 12258 }, 12259 12260 // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} 12261 normalizeRule: function( data ) { 12262 if ( typeof data === "string" ) { 12263 var transformed = {}; 12264 $.each( data.split( /\s/ ), function() { 12265 transformed[ this ] = true; 12266 } ); 12267 data = transformed; 12268 } 12269 return data; 12270 }, 12271 12272 // https://jqueryvalidation.org/jQuery.validator.addMethod/ 12273 addMethod: function( name, method, message ) { 12274 $.validator.methods[ name ] = method; 12275 $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ]; 12276 if ( method.length < 3 ) { 12277 $.validator.addClassRules( name, $.validator.normalizeRule( name ) ); 12278 } 12279 }, 12280 12281 // https://jqueryvalidation.org/jQuery.validator.methods/ 12282 methods: { 12283 12284 // https://jqueryvalidation.org/required-method/ 12285 required: function( value, element, param ) { 12286 12287 // Check if dependency is met 12288 if ( !this.depend( param, element ) ) { 12289 return "dependency-mismatch"; 12290 } 12291 if ( element.nodeName.toLowerCase() === "select" ) { 12292 12293 // Could be an array for select-multiple or a string, both are fine this way 12294 var val = $( element ).val(); 12295 return val && val.length > 0; 12296 } 12297 if ( this.checkable( element ) ) { 12298 return this.getLength( value, element ) > 0; 12299 } 12300 return value !== undefined && value !== null && value.length > 0; 12301 }, 12302 12303 // https://jqueryvalidation.org/email-method/ 12304 email: function( value, element ) { 12305 12306 // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address 12307 // Retrieved 2014-01-14 12308 // If you have a problem with this implementation, report a bug against the above spec 12309 // Or use custom methods to implement your own email validation 12310 return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value ); 12311 }, 12312 12313 // https://jqueryvalidation.org/url-method/ 12314 url: function( value, element ) { 12315 12316 // Copyright (c) 2010-2013 Diego Perini, MIT licensed 12317 // https://gist.github.com/dperini/729294 12318 // see also https://mathiasbynens.be/demo/url-regex 12319 // modified to allow protocol-relative URLs 12320 return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value ); 12321 }, 12322 12323 // https://jqueryvalidation.org/date-method/ 12324 date: ( function() { 12325 var called = false; 12326 12327 return function( value, element ) { 12328 if ( !called ) { 12329 called = true; 12330 if ( this.settings.debug && window.console ) { 12331 console.warn( 12332 "The `date` method is deprecated and will be removed in version '2.0.0'.\n" + 12333 "Please don't use it, since it relies on the Date constructor, which\n" + 12334 "behaves very differently across browsers and locales. Use `dateISO`\n" + 12335 "instead or one of the locale specific methods in `localizations/`\n" + 12336 "and `additional-methods.js`." 12337 ); 12338 } 12339 } 12340 12341 return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); 12342 }; 12343 }() ), 12344 12345 // https://jqueryvalidation.org/dateISO-method/ 12346 dateISO: function( value, element ) { 12347 return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); 12348 }, 12349 12350 // https://jqueryvalidation.org/number-method/ 12351 number: function( value, element ) { 12352 return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value ); 12353 }, 12354 12355 // https://jqueryvalidation.org/digits-method/ 12356 digits: function( value, element ) { 12357 return this.optional( element ) || /^\d+$/.test( value ); 12358 }, 12359 12360 // https://jqueryvalidation.org/minlength-method/ 12361 minlength: function( value, element, param ) { 12362 var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); 12363 return this.optional( element ) || length >= param; 12364 }, 12365 12366 // https://jqueryvalidation.org/maxlength-method/ 12367 maxlength: function( value, element, param ) { 12368 var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); 12369 return this.optional( element ) || length <= param; 12370 }, 12371 12372 // https://jqueryvalidation.org/rangelength-method/ 12373 rangelength: function( value, element, param ) { 12374 var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); 12375 return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); 12376 }, 12377 12378 // https://jqueryvalidation.org/min-method/ 12379 min: function( value, element, param ) { 12380 return this.optional( element ) || value >= param; 12381 }, 12382 12383 // https://jqueryvalidation.org/max-method/ 12384 max: function( value, element, param ) { 12385 return this.optional( element ) || value <= param; 12386 }, 12387 12388 // https://jqueryvalidation.org/range-method/ 12389 range: function( value, element, param ) { 12390 return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); 12391 }, 12392 12393 // https://jqueryvalidation.org/step-method/ 12394 step: function( value, element, param ) { 12395 var type = $( element ).attr( "type" ), 12396 errorMessage = "Step attribute on input type " + type + " is not supported.", 12397 supportedTypes = [ "text", "number", "range" ], 12398 re = new RegExp( "\\b" + type + "\\b" ), 12399 notSupported = type && !re.test( supportedTypes.join() ), 12400 decimalPlaces = function( num ) { 12401 var match = ( "" + num ).match( /(?:\.(\d+))?$/ ); 12402 if ( !match ) { 12403 return 0; 12404 } 12405 12406 // Number of digits right of decimal point. 12407 return match[ 1 ] ? match[ 1 ].length : 0; 12408 }, 12409 toInt = function( num ) { 12410 return Math.round( num * Math.pow( 10, decimals ) ); 12411 }, 12412 valid = true, 12413 decimals; 12414 12415 // Works only for text, number and range input types 12416 // TODO find a way to support input types date, datetime, datetime-local, month, time and week 12417 if ( notSupported ) { 12418 throw new Error( errorMessage ); 12419 } 12420 12421 decimals = decimalPlaces( param ); 12422 12423 // Value can't have too many decimals 12424 if ( decimalPlaces( value ) > decimals || toInt( value ) % toInt( param ) !== 0 ) { 12425 valid = false;
12426 } 12427 12428 return this.optional( element ) || valid; 12429 }, 12430 12431 // https://jqueryvalidation.org/equalTo-method/ 12432 equalTo: function( value, element, param ) { 12433 12434 // Bind to the blur event of the target in order to revalidate whenever the target field is updated 12435 var target = $( param ); 12436 if ( this.settings.onfocusout && target.not( ".validate-equalTo-blur" ).length ) { 12437 target.addClass( "validate-equalTo-blur" ).on( "blur.validate-equalTo", function() { 12438 $( element ).valid(); 12439 } ); 12440 } 12441 return value === target.val(); 12442 }, 12443 12444 // https://jqueryvalidation.org/remote-method/ 12445 remote: function( value, element, param, method ) { 12446 if ( this.optional( element ) ) { 12447 return "dependency-mismatch"; 12448 } 12449 12450 method = typeof method === "string" && method || "remote"; 12451 12452 var previous = this.previousValue( element, method ), 12453 validator, data, optionDataString; 12454 12455 if ( !this.settings.messages[ element.name ] ) { 12456 this.settings.messages[ element.name ] = {}; 12457 } 12458 previous.originalMessage = previous.originalMessage || this.settings.messages[ element.name ][ method ]; 12459 this.settings.messages[ element.name ][ method ] = previous.message; 12460 12461 param = typeof param === "string" && { url: param } || param; 12462 optionDataString = $.param( $.extend( { data: value }, param.data ) ); 12463 if ( previous.old === optionDataString ) { 12464 return previous.valid; 12465 } 12466 12467 previous.old = optionDataString; 12468 validator = this; 12469 this.startRequest( element ); 12470 data = {}; 12471 data[ element.name ] = value; 12472 $.ajax( $.extend( true, { 12473 mode: "abort", 12474 port: "validate" + element.name, 12475 dataType: "json", 12476 data: data, 12477 context: validator.currentForm, 12478 success: function( response ) { 12479 var valid = response === true || response === "true", 12480 errors, message, submitted; 12481 12482 validator.settings.messages[ element.name ][ method ] = previous.originalMessage; 12483 if ( valid ) { 12484 submitted = validator.formSubmitted; 12485 validator.resetInternals(); 12486 validator.toHide = validator.errorsFor( element ); 12487 validator.formSubmitted = submitted; 12488 validator.successList.push( element ); 12489 validator.invalid[ element.name ] = false; 12490 validator.showErrors(); 12491 } else { 12492 errors = {}; 12493 message = response || validator.defaultMessage( element, { method: method, parameters: value } ); 12494 errors[ element.name ] = previous.message = message; 12495 validator.invalid[ element.name ] = true; 12496 validator.showErrors( errors ); 12497 } 12498 previous.valid = valid; 12499 validator.stopRequest( element, valid ); 12500 } 12501 }, param ) ); 12502 return "pending"; 12503 } 12504 } 12505 12506} ); 12507 12508// Ajax mode: abort 12509// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); 12510// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() 12511 12512var pendingRequests = {}, 12513 ajax; 12514 12515// Use a prefilter if available (1.5+) 12516if ( $.ajaxPrefilter ) { 12517 $.ajaxPrefilter( function( settings, _, xhr ) { 12518 var port = settings.port; 12519 if ( settings.mode === "abort" ) { 12520 if ( pendingRequests[ port ] ) { 12521 pendingRequests[ port ].abort(); 12522 } 12523 pendingRequests[ port ] = xhr; 12524 } 12525 } ); 12526} else { 12527 12528 // Proxy ajax 12529 ajax = $.ajax; 12530 $.ajax = function( settings ) { 12531 var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, 12532 port = ( "port" in settings ? settings : $.ajaxSettings ).port; 12533 if ( mode === "abort" ) { 12534 if ( pendingRequests[ port ] ) { 12535 pendingRequests[ port ].abort(); 12536 } 12537 pendingRequests[ port ] = ajax.apply( this, arguments ); 12538 return pendingRequests[ port ]; 12539 } 12540 return ajax.apply( this, arguments ); 12541 }; 12542} 12543return $; 12544})); 12545/*! 12546 * jQuery Validation Plugin v1.19.3 12547 * 12548 * https://jqueryvalidation.org/ 12549 * 12550 * Copyright (c) 2021 Jörn Zaefferer 12551 * Released under the MIT license 12552 */ 12553(function( factory ) { 12554 if ( typeof define === "function" && define.amd ) { 12555 define( ["jquery", "./jquery.validate"], factory ); 12556 } else if (typeof module === "object" && module.exports) { 12557 module.exports = factory( require( "jquery" ) ); 12558 } else { 12559 factory( jQuery ); 12560 } 12561}(function( $ ) { 12562 12563( function() { 12564 12565 function stripHtml( value ) { 12566 12567 // Remove html tags and space chars 12568 return value.replace( /<.[^<>]*?>/g, " " ).replace( / | /gi, " " ) 12569 12570 // Remove punctuation 12571 .replace( /[.(),;:!?%#$'\"_+=\/\-âââ]*/g, "" ); 12572 } 12573 12574 $.validator.addMethod( "maxWords", function( value, element, params ) {
vendor: 4,587 bytes, lines 12575-12707
12575 return this.optional( element ) || stripHtml( value ).match( /\b\w+\b/g ).length <= params; 12576 }, $.validator.format( "Please enter {0} words or less." ) ); 12577 12578 $.validator.addMethod( "minWords", function( value, element, params ) { 12579 return this.optional( element ) || stripHtml( value ).match( /\b\w+\b/g ).length >= params; 12580 }, $.validator.format( "Please enter at least {0} words." ) ); 12581 12582 $.validator.addMethod( "rangeWords", function( value, element, params ) { 12583 var valueStripped = stripHtml( value ), 12584 regex = /\b\w+\b/g; 12585 return this.optional( element ) || valueStripped.match( regex ).length >= params[ 0 ] && valueStripped.match( regex ).length <= params[ 1 ]; 12586 }, $.validator.format( "Please enter between {0} and {1} words." ) ); 12587 12588}() ); 12589 12590/** 12591 * This is used in the United States to process payments, deposits, 12592 * or transfers using the Automated Clearing House (ACH) or Fedwire 12593 * systems. A very common use case would be to validate a form for 12594 * an ACH bill payment. 12595 */ 12596$.validator.addMethod( "abaRoutingNumber", function( value ) { 12597 var checksum = 0; 12598 var tokens = value.split( "" ); 12599 var length = tokens.length; 12600 12601 // Length Check 12602 if ( length !== 9 ) { 12603 return false; 12604 } 12605 12606 // Calc the checksum 12607 // https://en.wikipedia.org/wiki/ABA_routing_transit_number 12608 for ( var i = 0; i < length; i += 3 ) { 12609 checksum += parseInt( tokens[ i ], 10 ) * 3 + 12610 parseInt( tokens[ i + 1 ], 10 ) * 7 + 12611 parseInt( tokens[ i + 2 ], 10 ); 12612 } 12613 12614 // If not zero and divisible by 10 then valid 12615 if ( checksum !== 0 && checksum % 10 === 0 ) { 12616 return true; 12617 } 12618 12619 return false; 12620}, "Please enter a valid routing number." ); 12621 12622// Accept a value from a file input based on a required mimetype 12623$.validator.addMethod( "accept", function( value, element, param ) { 12624 12625 // Split mime on commas in case we have multiple types we can accept 12626 var typeParam = typeof param === "string" ? param.replace( /\s/g, "" ) : "image/*", 12627 optionalValue = this.optional( element ), 12628 i, file, regex; 12629 12630 // Element is optional 12631 if ( optionalValue ) { 12632 return optionalValue; 12633 } 12634 12635 if ( $( element ).attr( "type" ) === "file" ) { 12636 12637 // Escape string to be used in the regex 12638 // see: https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex 12639 // Escape also "/*" as "/.*" as a wildcard 12640 typeParam = typeParam 12641 .replace( /[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g, "\\$&" ) 12642 .replace( /,/g, "|" ) 12643 .replace( /\/\*/g, "/.*" ); 12644 12645 // Check if the element has a FileList before checking each file 12646 if ( element.files && element.files.length ) { 12647 regex = new RegExp( ".?(" + typeParam + ")$", "i" ); 12648 for ( i = 0; i < element.files.length; i++ ) { 12649 file = element.files[ i ]; 12650 12651 // Grab the mimetype from the loaded file, verify it matches 12652 if ( !file.type.match( regex ) ) { 12653 return false; 12654 } 12655 } 12656 } 12657 } 12658 12659 // Either return true because we've validated each file, or because the 12660 // browser does not support element.files and the FileList feature 12661 return true; 12662}, $.validator.format( "Please enter a value with a valid mimetype." ) ); 12663 12664$.validator.addMethod( "alphanumeric", function( value, element ) { 12665 return this.optional( element ) || /^\w+$/i.test( value ); 12666}, "Letters, numbers, and underscores only please" ); 12667 12668/* 12669 * Dutch bank account numbers (not 'giro' numbers) have 9 digits 12670 * and pass the '11 check'. 12671 * We accept the notation with spaces, as that is common. 12672 * acceptable: 123456789 or 12 34 56 789 12673 */ 12674$.validator.addMethod( "bankaccountNL", function( value, element ) { 12675 if ( this.optional( element ) ) { 12676 return true; 12677 } 12678 if ( !( /^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test( value ) ) ) { 12679 return false; 12680 } 12681 12682 // Now '11 check' 12683 var account = value.replace( / /g, "" ), // Remove spaces 12684 sum = 0, 12685 len = account.length, 12686 pos, factor, digit; 12687 for ( pos = 0; pos < len; pos++ ) { 12688 factor = len - pos; 12689 digit = account.substring( pos, pos + 1 ); 12690 sum = sum + factor * digit; 12691 } 12692 return sum % 11 === 0; 12693}, "Please specify a valid bank account number" ); 12694 12695$.validator.addMethod( "bankorgiroaccountNL", function( value, element ) { 12696 return this.optional( element ) || 12697 ( $.validator.methods.bankaccountNL.call( this, value, element ) ) || 12698 ( $.validator.methods.giroaccountNL.call( this, value, element ) ); 12699}, "Please specify a valid bank or giro account number" ); 12700 12701/** 12702 * BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity. 12703 * 12704 * BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional) 12705 * 12706 * Validation is case-insensitive. Please make sure to normalize input yourself. 12707 *
12708 * BIC definition in detail: 12709 * - First 4 characters - bank code (only letters) 12710 * - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters) 12711 * - Next 2 characters - location code (letters and digits) 12712 * a. shall not start with '0' or '1' 12713 * b. second character must be a letter ('O' is not allowed) or digit ('0' for test (therefore not allowed), '1' denoting passive participant, '2' typically reverse-billing) 12714 * - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits) 12715 */ 12716$.validator.addMethod( "bic", function( value, element ) { 12717 return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value.toUpperCase() ); 12718}, "Please specify a valid BIC code" ); 12719 12720/* 12721 * Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities 12722 * Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal 12723 * 12724 * Spanish CIF structure: 12725 * 12726 * [ T ][ P ][ P ][ N ][ N ][ N ][ N ][ N ][ C ] 12727 * 12728 * Where: 12729 * 12730 * T: 1 character. Kind of Organization Letter: [ABCDEFGHJKLMNPQRSUVW] 12731 * P: 2 characters. Province. 12732 * N: 5 characters. Secuencial Number within the province. 12733 * C: 1 character. Control Digit: [0-9A-J]. 12734 * 12735 * [ T ]: Kind of Organizations. Possible values: 12736 * 12737 * A. Corporations 12738 * B. LLCs 12739 * C. General partnerships 12740 * D. Companies limited partnerships 12741 * E. Communities of goods 12742 * F. Cooperative Societies 12743 * G. Associations 12744 * H. Communities of homeowners in horizontal property regime 12745 * J. Civil Societies 12746 * K. Old format 12747 * L. Old format 12748 * M. Old format 12749 * N. Nonresident entities 12750 * P. Local authorities 12751 * Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions 12752 * R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008) 12753 * S. Organs of State Administration and regions 12754 * V. Agrarian Transformation 12755 * W. Permanent establishments of non-resident in Spain 12756 * 12757 * [ C ]: Control Digit. It can be a number or a letter depending on T value: 12758 * [ T ] --> [ C ] 12759 * ------ ---------- 12760 * A Number 12761 * B Number 12762 * E Number 12763 * H Number 12764 * K Letter 12765 * P Letter 12766 * Q Letter 12767 * S Letter 12768 * 12769 */ 12770$.validator.addMethod( "cifES", function( value, element ) { 12771 "use strict"; 12772 12773 if ( this.optional( element ) ) { 12774 return true; 12775 } 12776 12777 var cifRegEx = new RegExp( /^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi ); 12778 var letter = value.substring( 0, 1 ), // [ T ] 12779 number = value.substring( 1, 8 ), // [ P ][ P ][ N ][ N ][ N ][ N ][ N ] 12780 control = value.substring( 8, 9 ), // [ C ] 12781 all_sum = 0, 12782 even_sum = 0, 12783 odd_sum = 0, 12784 i, n, 12785 control_digit, 12786 control_letter; 12787 12788 function isOdd( n ) { 12789 return n % 2 === 0; 12790 } 12791 12792 // Quick format test 12793 if ( value.length !== 9 || !cifRegEx.test( value ) ) { 12794 return false; 12795 } 12796 12797 for ( i = 0; i < number.length; i++ ) { 12798 n = parseInt( number[ i ], 10 ); 12799 12800 // Odd positions 12801 if ( isOdd( i ) ) { 12802 12803 // Odd positions are multiplied first. 12804 n *= 2; 12805 12806 // If the multiplication is bigger than 10 we need to adjust 12807 odd_sum += n < 10 ? n : n - 9; 12808 12809 // Even positions 12810 // Just sum them 12811 } else { 12812 even_sum += n; 12813 } 12814 } 12815 12816 all_sum = even_sum + odd_sum; 12817 control_digit = ( 10 - ( all_sum ).toString().substr( -1 ) ).toString(); 12818 control_digit = parseInt( control_digit, 10 ) > 9 ? "0" : control_digit; 12819 control_letter = "JABCDEFGHI".substr( control_digit, 1 ).toString(); 12820 12821 // Control must be a digit 12822 if ( letter.match( /[ABEH]/ ) ) { 12823 return control === control_digit; 12824 12825 // Control must be a letter 12826 } else if ( letter.match( /[KPQS]/ ) ) { 12827 return control === control_letter; 12828 } 12829 12830 // Can be either 12831 return control === control_digit || control === control_letter; 12832 12833}, "Please specify a valid CIF number." ); 12834 12835/* 12836 * Brazillian CNH number (Carteira Nacional de Habilitacao) is the License Driver number. 12837 * CNH numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. 12838 */ 12839$.validator.addMethod( "cnhBR", function( value ) { 12840 12841 // Removing special characters from value 12842 value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); 12843 12844 // Checking value to have 11 digits only 12845 if ( value.length !== 11 ) { 12846 return false;
vendor: 28,284 bytes, lines 12847-13744
12847 } 12848 12849 var sum = 0, dsc = 0, firstChar, 12850 firstCN, secondCN, i, j, v; 12851 12852 firstChar = value.charAt( 0 ); 12853 12854 if ( new Array( 12 ).join( firstChar ) === value ) { 12855 return false; 12856 } 12857 12858 // Step 1 - using first Check Number: 12859 for ( i = 0, j = 9, v = 0; i < 9; ++i, --j ) { 12860 sum += +( value.charAt( i ) * j ); 12861 } 12862 12863 firstCN = sum % 11; 12864 if ( firstCN >= 10 ) { 12865 firstCN = 0; 12866 dsc = 2; 12867 } 12868 12869 sum = 0; 12870 for ( i = 0, j = 1, v = 0; i < 9; ++i, ++j ) { 12871 sum += +( value.charAt( i ) * j ); 12872 } 12873 12874 secondCN = sum % 11; 12875 if ( secondCN >= 10 ) { 12876 secondCN = 0; 12877 } else { 12878 secondCN = secondCN - dsc; 12879 } 12880 12881 return ( String( firstCN ).concat( secondCN ) === value.substr( -2 ) ); 12882 12883}, "Please specify a valid CNH number" ); 12884 12885/* 12886 * Brazillian value number (Cadastrado de Pessoas Juridica). 12887 * value numbers have 14 digits in total: 12 numbers followed by 2 check numbers that are being used for validation. 12888 */ 12889$.validator.addMethod( "cnpjBR", function( value, element ) { 12890 "use strict"; 12891 12892 if ( this.optional( element ) ) { 12893 return true; 12894 } 12895 12896 // Removing no number 12897 value = value.replace( /[^\d]+/g, "" ); 12898 12899 // Checking value to have 14 digits only 12900 if ( value.length !== 14 ) { 12901 return false; 12902 } 12903 12904 // Elimina values invalidos conhecidos 12905 if ( value === "00000000000000" || 12906 value === "11111111111111" || 12907 value === "22222222222222" || 12908 value === "33333333333333" || 12909 value === "44444444444444" || 12910 value === "55555555555555" || 12911 value === "66666666666666" || 12912 value === "77777777777777" || 12913 value === "88888888888888" || 12914 value === "99999999999999" ) { 12915 return false; 12916 } 12917 12918 // Valida DVs 12919 var tamanho = ( value.length - 2 ); 12920 var numeros = value.substring( 0, tamanho ); 12921 var digitos = value.substring( tamanho ); 12922 var soma = 0; 12923 var pos = tamanho - 7; 12924 12925 for ( var i = tamanho; i >= 1; i-- ) { 12926 soma += numeros.charAt( tamanho - i ) * pos--; 12927 if ( pos < 2 ) { 12928 pos = 9; 12929 } 12930 } 12931 12932 var resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; 12933 12934 if ( resultado !== parseInt( digitos.charAt( 0 ), 10 ) ) { 12935 return false; 12936 } 12937 12938 tamanho = tamanho + 1; 12939 numeros = value.substring( 0, tamanho ); 12940 soma = 0; 12941 pos = tamanho - 7; 12942 12943 for ( var il = tamanho; il >= 1; il-- ) { 12944 soma += numeros.charAt( tamanho - il ) * pos--; 12945 if ( pos < 2 ) { 12946 pos = 9; 12947 } 12948 } 12949 12950 resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; 12951 12952 if ( resultado !== parseInt( digitos.charAt( 1 ), 10 ) ) { 12953 return false; 12954 } 12955 12956 return true; 12957 12958}, "Please specify a CNPJ value number" ); 12959 12960/* 12961 * Brazillian CPF number (Cadastrado de Pessoas FÃsicas) is the equivalent of a Brazilian tax registration number. 12962 * CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. 12963 */ 12964$.validator.addMethod( "cpfBR", function( value, element ) { 12965 "use strict"; 12966 12967 if ( this.optional( element ) ) { 12968 return true; 12969 } 12970 12971 // Removing special characters from value 12972 value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); 12973 12974 // Checking value to have 11 digits only 12975 if ( value.length !== 11 ) { 12976 return false; 12977 } 12978 12979 var sum = 0, 12980 firstCN, secondCN, checkResult, i; 12981 12982 firstCN = parseInt( value.substring( 9, 10 ), 10 ); 12983 secondCN = parseInt( value.substring( 10, 11 ), 10 ); 12984 12985 checkResult = function( sum, cn ) { 12986 var result = ( sum * 10 ) % 11; 12987 if ( ( result === 10 ) || ( result === 11 ) ) { 12988 result = 0; 12989 } 12990 return ( result === cn ); 12991 }; 12992 12993 // Checking for dump data 12994 if ( value === "" || 12995 value === "00000000000" || 12996 value === "11111111111" || 12997 value === "22222222222" || 12998 value === "33333333333" || 12999 value === "44444444444" || 13000 value === "55555555555" || 13001 value === "66666666666" || 13002 value === "77777777777" || 13003 value === "88888888888" || 13004 value === "99999999999" 13005 ) { 13006 return false; 13007 } 13008 13009 // Step 1 - using first Check Number: 13010 for ( i = 1; i <= 9; i++ ) { 13011 sum = sum + parseInt( value.substring( i - 1, i ), 10 ) * ( 11 - i ); 13012 } 13013 13014 // If first Check Number (CN) is valid, move to Step 2 - using second Check Number: 13015 if ( checkResult( sum, firstCN ) ) { 13016 sum = 0; 13017 for ( i = 1; i <= 10; i++ ) { 13018 sum = sum + parseInt( value.substring( i - 1, i ), 10 ) * ( 12 - i ); 13019 } 13020 return checkResult( sum, secondCN ); 13021 } 13022 return false; 13023 13024}, "Please specify a valid CPF number" ); 13025 13026// https://jqueryvalidation.org/creditcard-method/ 13027// based on https://en.wikipedia.org/wiki/Luhn_algorithm 13028$.validator.addMethod( "creditcard", function( value, element ) { 13029 if ( this.optional( element ) ) { 13030 return "dependency-mismatch"; 13031 } 13032 13033 // Accept only spaces, digits and dashes 13034 if ( /[^0-9 \-]+/.test( value ) ) { 13035 return false; 13036 } 13037 13038 var nCheck = 0, 13039 nDigit = 0, 13040 bEven = false, 13041 n, cDigit; 13042 13043 value = value.replace( /\D/g, "" ); 13044 13045 // Basing min and max length on 13046 // https://dev.ean.com/general-info/valid-card-types/ 13047 if ( value.length < 13 || value.length > 19 ) { 13048 return false; 13049 } 13050 13051 for ( n = value.length - 1; n >= 0; n-- ) { 13052 cDigit = value.charAt( n ); 13053 nDigit = parseInt( cDigit, 10 ); 13054 if ( bEven ) { 13055 if ( ( nDigit *= 2 ) > 9 ) { 13056 nDigit -= 9; 13057 } 13058 } 13059 13060 nCheck += nDigit; 13061 bEven = !bEven; 13062 } 13063 13064 return ( nCheck % 10 ) === 0; 13065}, "Please enter a valid credit card number." ); 13066 13067/* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator 13068 * Redistributed under the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 13069 * Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings) 13070 */ 13071$.validator.addMethod( "creditcardtypes", function( value, element, param ) { 13072 if ( /[^0-9\-]+/.test( value ) ) { 13073 return false; 13074 } 13075 13076 value = value.replace( /\D/g, "" ); 13077 13078 var validTypes = 0x0000; 13079 13080 if ( param.mastercard ) { 13081 validTypes |= 0x0001; 13082 } 13083 if ( param.visa ) { 13084 validTypes |= 0x0002; 13085 } 13086 if ( param.amex ) { 13087 validTypes |= 0x0004; 13088 } 13089 if ( param.dinersclub ) { 13090 validTypes |= 0x0008; 13091 } 13092 if ( param.enroute ) { 13093 validTypes |= 0x0010; 13094 } 13095 if ( param.discover ) { 13096 validTypes |= 0x0020; 13097 } 13098 if ( param.jcb ) { 13099 validTypes |= 0x0040; 13100 } 13101 if ( param.unknown ) { 13102 validTypes |= 0x0080; 13103 } 13104 if ( param.all ) { 13105 validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080; 13106 } 13107 if ( validTypes & 0x0001 && ( /^(5[12345])/.test( value ) || /^(2[234567])/.test( value ) ) ) { // Mastercard 13108 return value.length === 16; 13109 } 13110 if ( validTypes & 0x0002 && /^(4)/.test( value ) ) { // Visa 13111 return value.length === 16; 13112 } 13113 if ( validTypes & 0x0004 && /^(3[47])/.test( value ) ) { // Amex 13114 return value.length === 15; 13115 } 13116 if ( validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test( value ) ) { // Dinersclub 13117 return value.length === 14; 13118 } 13119 if ( validTypes & 0x0010 && /^(2(014|149))/.test( value ) ) { // Enroute 13120 return value.length === 15; 13121 } 13122 if ( validTypes & 0x0020 && /^(6011)/.test( value ) ) { // Discover 13123 return value.length === 16; 13124 } 13125 if ( validTypes & 0x0040 && /^(3)/.test( value ) ) { // Jcb 13126 return value.length === 16; 13127 } 13128 if ( validTypes & 0x0040 && /^(2131|1800)/.test( value ) ) { // Jcb 13129 return value.length === 15; 13130 } 13131 if ( validTypes & 0x0080 ) { // Unknown 13132 return true; 13133 } 13134 return false; 13135}, "Please enter a valid credit card number." ); 13136 13137/** 13138 * Validates currencies with any given symbols by @jameslouiz 13139 * Symbols can be optional or required. Symbols required by default 13140 * 13141 * Usage examples: 13142 * currency: ["£", false] - Use false for soft currency validation 13143 * currency: ["$", false] 13144 * currency: ["RM", false] - also works with text based symbols such as "RM" - Malaysia Ringgit etc 13145 * 13146 * <input class="currencyInput" name="currencyInput"> 13147 * 13148 * Soft symbol checking 13149 * currencyInput: { 13150 * currency: ["$", false] 13151 * } 13152 * 13153 * Strict symbol checking (default) 13154 * currencyInput: { 13155 * currency: "$" 13156 * //OR 13157 * currency: ["$", true] 13158 * } 13159 * 13160 * Multiple Symbols 13161 * currencyInput: { 13162 * currency: "$,£,¢" 13163 * } 13164 */ 13165$.validator.addMethod( "currency", function( value, element, param ) { 13166 var isParamString = typeof param === "string", 13167 symbol = isParamString ? param : param[ 0 ], 13168 soft = isParamString ? true : param[ 1 ], 13169 regex; 13170 13171 symbol = symbol.replace( /,/g, "" ); 13172 symbol = soft ? symbol + "]" : symbol + "]?"; 13173 regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$"; 13174 regex = new RegExp( regex ); 13175 return this.optional( element ) || regex.test( value ); 13176 13177}, "Please specify a valid currency" ); 13178 13179$.validator.addMethod( "dateFA", function( value, element ) { 13180 return this.optional( element ) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test( value ); 13181}, $.validator.messages.date ); 13182 13183/** 13184 * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy. 13185 * 13186 * @example $.validator.methods.date("01/01/1900") 13187 * @result true 13188 * 13189 * @example $.validator.methods.date("01/13/1990") 13190 * @result false 13191 * 13192 * @example $.validator.methods.date("01.01.1900") 13193 * @result false 13194 * 13195 * @example <input name="pippo" class="{dateITA:true}" /> 13196 * @desc Declares an optional input element whose value must be a valid date. 13197 * 13198 * @name $.validator.methods.dateITA 13199 * @type Boolean 13200 * @cat Plugins/Validate/Methods 13201 */ 13202$.validator.addMethod( "dateITA", function( value, element ) { 13203 var check = false, 13204 re = /^\d{1,2}\/\d{1,2}\/\d{4}$/, 13205 adata, gg, mm, aaaa, xdata; 13206 if ( re.test( value ) ) { 13207 adata = value.split( "/" ); 13208 gg = parseInt( adata[ 0 ], 10 ); 13209 mm = parseInt( adata[ 1 ], 10 ); 13210 aaaa = parseInt( adata[ 2 ], 10 ); 13211 xdata = new Date( Date.UTC( aaaa, mm - 1, gg, 12, 0, 0, 0 ) ); 13212 if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth() === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) { 13213 check = true; 13214 } else { 13215 check = false; 13216 } 13217 } else { 13218 check = false; 13219 } 13220 return this.optional( element ) || check; 13221}, $.validator.messages.date ); 13222 13223$.validator.addMethod( "dateNL", function( value, element ) { 13224 return this.optional( element ) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test( value ); 13225}, $.validator.messages.date ); 13226 13227// Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept 13228$.validator.addMethod( "extension", function( value, element, param ) { 13229 param = typeof param === "string" ? param.replace( /,/g, "|" ) : "png|jpe?g|gif"; 13230 return this.optional( element ) || value.match( new RegExp( "\\.(" + param + ")$", "i" ) ); 13231}, $.validator.format( "Please enter a value with a valid extension." ) ); 13232 13233/** 13234 * Dutch giro account numbers (not bank numbers) have max 7 digits 13235 */ 13236$.validator.addMethod( "giroaccountNL", function( value, element ) { 13237 return this.optional( element ) || /^[0-9]{1,7}$/.test( value ); 13238}, "Please specify a valid giro account number" ); 13239 13240$.validator.addMethod( "greaterThan", function( value, element, param ) { 13241 var target = $( param ); 13242 13243 if ( this.settings.onfocusout && target.not( ".validate-greaterThan-blur" ).length ) { 13244 target.addClass( "validate-greaterThan-blur" ).on( "blur.validate-greaterThan", function() { 13245 $( element ).valid(); 13246 } ); 13247 } 13248 13249 return value > target.val(); 13250}, "Please enter a greater value." ); 13251 13252$.validator.addMethod( "greaterThanEqual", function( value, element, param ) { 13253 var target = $( param ); 13254 13255 if ( this.settings.onfocusout && target.not( ".validate-greaterThanEqual-blur" ).length ) { 13256 target.addClass( "validate-greaterThanEqual-blur" ).on( "blur.validate-greaterThanEqual", function() { 13257 $( element ).valid(); 13258 } ); 13259 } 13260 13261 return value >= target.val(); 13262}, "Please enter a greater value." ); 13263 13264/** 13265 * IBAN is the international bank account number. 13266 * It has a country - specific format, that is checked here too 13267 * 13268 * Validation is case-insensitive. Please make sure to normalize input yourself. 13269 */ 13270$.validator.addMethod( "iban", function( value, element ) { 13271 13272 // Some quick simple tests to prevent needless work 13273 if ( this.optional( element ) ) { 13274 return true; 13275 } 13276 13277 // Remove spaces and to upper case 13278 var iban = value.replace( / /g, "" ).toUpperCase(), 13279 ibancheckdigits = "", 13280 leadingZeroes = true, 13281 cRest = "", 13282 cOperator = "", 13283 countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p; 13284 13285 // Check for IBAN code length. 13286 // It contains: 13287 // country code ISO 3166-1 - two letters, 13288 // two check digits, 13289 // Basic Bank Account Number (BBAN) - up to 30 chars 13290 var minimalIBANlength = 5; 13291 if ( iban.length < minimalIBANlength ) { 13292 return false; 13293 } 13294 13295 // Check the country code and find the country specific format 13296 countrycode = iban.substring( 0, 2 ); 13297 bbancountrypatterns = { 13298 "AL": "\\d{8}[\\dA-Z]{16}", 13299 "AD": "\\d{8}[\\dA-Z]{12}", 13300 "AT": "\\d{16}", 13301 "AZ": "[\\dA-Z]{4}\\d{20}", 13302 "BE": "\\d{12}", 13303 "BH": "[A-Z]{4}[\\dA-Z]{14}", 13304 "BA": "\\d{16}", 13305 "BR": "\\d{23}[A-Z][\\dA-Z]", 13306 "BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}", 13307 "CR": "\\d{17}", 13308 "HR": "\\d{17}", 13309 "CY": "\\d{8}[\\dA-Z]{16}", 13310 "CZ": "\\d{20}", 13311 "DK": "\\d{14}", 13312 "DO": "[A-Z]{4}\\d{20}", 13313 "EE": "\\d{16}", 13314 "FO": "\\d{14}", 13315 "FI": "\\d{14}", 13316 "FR": "\\d{10}[\\dA-Z]{11}\\d{2}", 13317 "GE": "[\\dA-Z]{2}\\d{16}", 13318 "DE": "\\d{18}", 13319 "GI": "[A-Z]{4}[\\dA-Z]{15}", 13320 "GR": "\\d{7}[\\dA-Z]{16}", 13321 "GL": "\\d{14}", 13322 "GT": "[\\dA-Z]{4}[\\dA-Z]{20}", 13323 "HU": "\\d{24}", 13324 "IS": "\\d{22}", 13325 "IE": "[\\dA-Z]{4}\\d{14}", 13326 "IL": "\\d{19}", 13327 "IT": "[A-Z]\\d{10}[\\dA-Z]{12}", 13328 "KZ": "\\d{3}[\\dA-Z]{13}", 13329 "KW": "[A-Z]{4}[\\dA-Z]{22}", 13330 "LV": "[A-Z]{4}[\\dA-Z]{13}", 13331 "LB": "\\d{4}[\\dA-Z]{20}", 13332 "LI": "\\d{5}[\\dA-Z]{12}", 13333 "LT": "\\d{16}", 13334 "LU": "\\d{3}[\\dA-Z]{13}", 13335 "MK": "\\d{3}[\\dA-Z]{10}\\d{2}", 13336 "MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}", 13337 "MR": "\\d{23}", 13338 "MU": "[A-Z]{4}\\d{19}[A-Z]{3}", 13339 "MC": "\\d{10}[\\dA-Z]{11}\\d{2}", 13340 "MD": "[\\dA-Z]{2}\\d{18}", 13341 "ME": "\\d{18}", 13342 "NL": "[A-Z]{4}\\d{10}", 13343 "NO": "\\d{11}", 13344 "PK": "[\\dA-Z]{4}\\d{16}", 13345 "PS": "[\\dA-Z]{4}\\d{21}", 13346 "PL": "\\d{24}", 13347 "PT": "\\d{21}", 13348 "RO": "[A-Z]{4}[\\dA-Z]{16}", 13349 "SM": "[A-Z]\\d{10}[\\dA-Z]{12}", 13350 "SA": "\\d{2}[\\dA-Z]{18}", 13351 "RS": "\\d{18}", 13352 "SK": "\\d{20}", 13353 "SI": "\\d{15}", 13354 "ES": "\\d{20}", 13355 "SE": "\\d{20}", 13356 "CH": "\\d{5}[\\dA-Z]{12}", 13357 "TN": "\\d{20}", 13358 "TR": "\\d{5}[\\dA-Z]{17}", 13359 "AE": "\\d{3}\\d{16}", 13360 "GB": "[A-Z]{4}\\d{14}", 13361 "VG": "[\\dA-Z]{4}\\d{16}" 13362 }; 13363 13364 bbanpattern = bbancountrypatterns[ countrycode ]; 13365 13366 // As new countries will start using IBAN in the 13367 // future, we only check if the countrycode is known. 13368 // This prevents false negatives, while almost all 13369 // false positives introduced by this, will be caught 13370 // by the checksum validation below anyway. 13371 // Strict checking should return FALSE for unknown 13372 // countries. 13373 if ( typeof bbanpattern !== "undefined" ) { 13374 ibanregexp = new RegExp( "^[A-Z]{2}\\d{2}" + bbanpattern + "$", "" ); 13375 if ( !( ibanregexp.test( iban ) ) ) { 13376 return false; // Invalid country specific format 13377 } 13378 } 13379 13380 // Now check the checksum, first convert to digits 13381 ibancheck = iban.substring( 4, iban.length ) + iban.substring( 0, 4 ); 13382 for ( i = 0; i < ibancheck.length; i++ ) { 13383 charAt = ibancheck.charAt( i ); 13384 if ( charAt !== "0" ) { 13385 leadingZeroes = false; 13386 } 13387 if ( !leadingZeroes ) { 13388 ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf( charAt ); 13389 } 13390 } 13391 13392 // Calculate the result of: ibancheckdigits % 97 13393 for ( p = 0; p < ibancheckdigits.length; p++ ) { 13394 cChar = ibancheckdigits.charAt( p ); 13395 cOperator = "" + cRest + "" + cChar; 13396 cRest = cOperator % 97; 13397 } 13398 return cRest === 1; 13399}, "Please specify a valid IBAN" ); 13400 13401$.validator.addMethod( "integer", function( value, element ) { 13402 return this.optional( element ) || /^-?\d+$/.test( value ); 13403}, "A positive or negative non-decimal number please" ); 13404 13405$.validator.addMethod( "ipv4", function( value, element ) { 13406 return this.optional( element ) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test( value ); 13407}, "Please enter a valid IP v4 address." ); 13408 13409$.validator.addMethod( "ipv6", function( value, element ) { 13410 return this.optional( element ) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test( value ); 13411}, "Please enter a valid IP v6 address." ); 13412 13413$.validator.addMethod( "lessThan", function( value, element, param ) { 13414 var target = $( param ); 13415 13416 if ( this.settings.onfocusout && target.not( ".validate-lessThan-blur" ).length ) { 13417 target.addClass( "validate-lessThan-blur" ).on( "blur.validate-lessThan", function() { 13418 $( element ).valid(); 13419 } ); 13420 } 13421 13422 return value < target.val(); 13423}, "Please enter a lesser value." ); 13424 13425$.validator.addMethod( "lessThanEqual", function( value, element, param ) { 13426 var target = $( param ); 13427 13428 if ( this.settings.onfocusout && target.not( ".validate-lessThanEqual-blur" ).length ) { 13429 target.addClass( "validate-lessThanEqual-blur" ).on( "blur.validate-lessThanEqual", function() { 13430 $( element ).valid(); 13431 } ); 13432 } 13433 13434 return value <= target.val(); 13435}, "Please enter a lesser value." ); 13436 13437$.validator.addMethod( "lettersonly", function( value, element ) { 13438 return this.optional( element ) || /^[a-z]+$/i.test( value ); 13439}, "Letters only please" ); 13440 13441$.validator.addMethod( "letterswithbasicpunc", function( value, element ) { 13442 return this.optional( element ) || /^[a-z\-.,()'"\s]+$/i.test( value ); 13443}, "Letters or punctuation only please" ); 13444 13445// Limit the number of files in a FileList. 13446$.validator.addMethod( "maxfiles", function( value, element, param ) { 13447 if ( this.optional( element ) ) { 13448 return true; 13449 } 13450 13451 if ( $( element ).attr( "type" ) === "file" ) { 13452 if ( element.files && element.files.length > param ) { 13453 return false; 13454 } 13455 } 13456 13457 return true; 13458}, $.validator.format( "Please select no more than {0} files." ) ); 13459 13460// Limit the size of each individual file in a FileList. 13461$.validator.addMethod( "maxsize", function( value, element, param ) { 13462 if ( this.optional( element ) ) { 13463 return true; 13464 } 13465 13466 if ( $( element ).attr( "type" ) === "file" ) { 13467 if ( element.files && element.files.length ) { 13468 for ( var i = 0; i < element.files.length; i++ ) { 13469 if ( element.files[ i ].size > param ) { 13470 return false; 13471 } 13472 } 13473 } 13474 } 13475 13476 return true; 13477}, function( param, element ) { 13478 var mb = ( param / 1048576 ).toFixed( 0 ); 13479 return $.validator.format( $.validator.messages.maxsize || "File size must not exceed {0} MB each.", [ mb ] ); 13480} ); 13481 13482// Limit the size of all files in a FileList. 13483$.validator.addMethod( "maxsizetotal", function( value, element, param ) { 13484 if ( this.optional( element ) ) { 13485 return true; 13486 } 13487 13488 if ( $( element ).attr( "type" ) === "file" ) { 13489 if ( element.files && element.files.length ) { 13490 var totalSize = 0; 13491 13492 for ( var i = 0; i < element.files.length; i++ ) { 13493 totalSize += element.files[ i ].size; 13494 if ( totalSize > param ) { 13495 return false; 13496 } 13497 } 13498 } 13499 } 13500 13501 return true; 13502}, function( param, element ) { 13503 var mb = ( param / 1048576 ).toFixed( 0 ); 13504 return $.validator.format( $.validator.messages.maxsizetotal || "Total size of all files must not exceed {0} MB.", [ mb ] ); 13505} ); 13506 13507 13508$.validator.addMethod( "mobileNL", function( value, element ) { 13509 return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test( value ); 13510}, "Please specify a valid mobile number" ); 13511 13512$.validator.addMethod( "mobileRU", function( phone_number, element ) { 13513 var ruPhone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); 13514 return this.optional( element ) || ruPhone_number.length > 9 && /^((\+7|7|8)+([0-9]){10})$/.test( ruPhone_number ); 13515}, "Please specify a valid mobile number" ); 13516 13517/* For UK phone functions, do the following server side processing: 13518 * Compare original input with this RegEx pattern: 13519 * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ 13520 * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' 13521 * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. 13522 * A number of very detailed GB telephone number RegEx patterns can also be found at: 13523 * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers 13524 */ 13525$.validator.addMethod( "mobileUK", function( phone_number, element ) { 13526 phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); 13527 return this.optional( element ) || phone_number.length > 9 && 13528 phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/ ); 13529}, "Please specify a valid mobile number" ); 13530 13531$.validator.addMethod( "netmask", function( value, element ) { 13532 return this.optional( element ) || /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test( value ); 13533}, "Please enter a valid netmask." ); 13534 13535/* 13536 * The NIE (Número de Identificación de Extranjero) is a Spanish tax identification number assigned by the Spanish 13537 * authorities to any foreigner. 13538 * 13539 * The NIE is the equivalent of a Spaniards Número de Identificación Fiscal (NIF) which serves as a fiscal 13540 * identification number. The CIF number (Certificado de Identificación Fiscal) is equivalent to the NIF, but applies to 13541 * companies rather than individuals. The NIE consists of an 'X' or 'Y' followed by 7 or 8 digits then another letter. 13542 */ 13543$.validator.addMethod( "nieES", function( value, element ) { 13544 "use strict"; 13545 13546 if ( this.optional( element ) ) { 13547 return true; 13548 } 13549 13550 var nieRegEx = new RegExp( /^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi ); 13551 var validChars = "TRWAGMYFPDXBNJZSQVHLCKET", 13552 letter = value.substr( value.length - 1 ).toUpperCase(), 13553 number; 13554 13555 value = value.toString().toUpperCase(); 13556 13557 // Quick format test 13558 if ( value.length > 10 || value.length < 9 || !nieRegEx.test( value ) ) { 13559 return false; 13560 } 13561 13562 // X means same number 13563 // Y means number + 10000000 13564 // Z means number + 20000000 13565 value = value.replace( /^[X]/, "0" ) 13566 .replace( /^[Y]/, "1" ) 13567 .replace( /^[Z]/, "2" ); 13568 13569 number = value.length === 9 ? value.substr( 0, 8 ) : value.substr( 0, 9 ); 13570 13571 return validChars.charAt( parseInt( number, 10 ) % 23 ) === letter; 13572 13573}, "Please specify a valid NIE number." ); 13574 13575/* 13576 * The Número de Identificación Fiscal ( NIF ) is the way tax identification used in Spain for individuals 13577 */ 13578$.validator.addMethod( "nifES", function( value, element ) { 13579 "use strict"; 13580 13581 if ( this.optional( element ) ) { 13582 return true; 13583 } 13584 13585 value = value.toUpperCase(); 13586 13587 // Basic format test 13588 if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { 13589 return false; 13590 } 13591 13592 // Test NIF 13593 if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) { 13594 return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) ); 13595 } 13596 13597 // Test specials NIF (starts with K, L or M) 13598 if ( /^[KLM]{1}/.test( value ) ) { 13599 return ( value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 1 ) % 23 ) ); 13600 } 13601 13602 return false; 13603 13604}, "Please specify a valid NIF number." ); 13605 13606/* 13607 * Numer identyfikacji podatkowej ( NIP ) is the way tax identification used in Poland for companies 13608 */ 13609$.validator.addMethod( "nipPL", function( value ) { 13610 "use strict"; 13611 13612 value = value.replace( /[^0-9]/g, "" ); 13613 13614 if ( value.length !== 10 ) { 13615 return false; 13616 } 13617 13618 var arrSteps = [ 6, 5, 7, 2, 3, 4, 5, 6, 7 ]; 13619 var intSum = 0; 13620 for ( var i = 0; i < 9; i++ ) { 13621 intSum += arrSteps[ i ] * value[ i ]; 13622 } 13623 var int2 = intSum % 11; 13624 var intControlNr = ( int2 === 10 ) ? 0 : int2; 13625 13626 return ( intControlNr === parseInt( value[ 9 ], 10 ) ); 13627}, "Please specify a valid NIP number." ); 13628 13629/** 13630 * Created for project jquery-validation. 13631 * @Description Brazillian PIS or NIS number (Número de Identificação Social Pis ou Pasep) is the equivalent of a 13632 * Brazilian tax registration number NIS of PIS numbers have 11 digits in total: 10 numbers followed by 1 check numbers 13633 * that are being used for validation. 13634 * @copyright (c) 21/08/2018 13:14, Cleiton da Silva Mendonça 13635 * @author Cleiton da Silva Mendonça <[email protected]> 13636 * @link http://gitlab.com/csmendonca Gitlab of Cleiton da Silva Mendonça 13637 * @link http://github.com/csmendonca Github of Cleiton da Silva Mendonça 13638 */ 13639$.validator.addMethod( "nisBR", function( value ) { 13640 var number; 13641 var cn; 13642 var sum = 0; 13643 var dv; 13644 var count; 13645 var multiplier; 13646 13647 // Removing special characters from value 13648 value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); 13649 13650 // Checking value to have 11 digits only 13651 if ( value.length !== 11 ) { 13652 return false; 13653 } 13654 13655 //Get check number of value 13656 cn = parseInt( value.substring( 10, 11 ), 10 ); 13657 13658 //Get number with 10 digits of the value 13659 number = parseInt( value.substring( 0, 10 ), 10 ); 13660 13661 for ( count = 2; count < 12; count++ ) { 13662 multiplier = count; 13663 if ( count === 10 ) { 13664 multiplier = 2; 13665 } 13666 if ( count === 11 ) { 13667 multiplier = 3; 13668 } 13669 sum += ( ( number % 10 ) * multiplier ); 13670 number = parseInt( number / 10, 10 ); 13671 } 13672 dv = ( sum % 11 ); 13673 13674 if ( dv > 1 ) { 13675 dv = ( 11 - dv ); 13676 } else { 13677 dv = 0; 13678 } 13679 13680 if ( cn === dv ) { 13681 return true; 13682 } else { 13683 return false; 13684 } 13685}, "Please specify a valid NIS/PIS number" ); 13686 13687$.validator.addMethod( "notEqualTo", function( value, element, param ) { 13688 return this.optional( element ) || !$.validator.methods.equalTo.call( this, value, element, param ); 13689}, "Please enter a different value, values must not be the same." ); 13690 13691$.validator.addMethod( "nowhitespace", function( value, element ) { 13692 return this.optional( element ) || /^\S+$/i.test( value ); 13693}, "No white space please" ); 13694 13695/** 13696* Return true if the field value matches the given format RegExp 13697* 13698* @example $.validator.methods.pattern("AR1004",element,/^AR\d{4}$/) 13699* @result true 13700* 13701* @example $.validator.methods.pattern("BR1004",element,/^AR\d{4}$/) 13702* @result false 13703* 13704* @name $.validator.methods.pattern 13705* @type Boolean 13706* @cat Plugins/Validate/Methods 13707*/ 13708$.validator.addMethod( "pattern", function( value, element, param ) { 13709 if ( this.optional( element ) ) { 13710 return true; 13711 } 13712 if ( typeof param === "string" ) { 13713 param = new RegExp( "^(?:" + param + ")$" ); 13714 } 13715 return param.test( value ); 13716}, "Invalid format." ); 13717 13718/** 13719 * Dutch phone numbers have 10 digits (or 11 and start with +31). 13720 */ 13721$.validator.addMethod( "phoneNL", function( value, element ) { 13722 return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test( value ); 13723}, "Please specify a valid phone number." ); 13724 13725/** 13726 * Polish telephone numbers have 9 digits. 13727 * 13728 * Mobile phone numbers starts with following digits: 13729 * 45, 50, 51, 53, 57, 60, 66, 69, 72, 73, 78, 79, 88. 13730 * 13731 * Fixed-line numbers starts with area codes: 13732 * 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 29, 32, 33, 13733 * 34, 41, 42, 43, 44, 46, 48, 52, 54, 55, 56, 58, 59, 61, 13734 * 62, 63, 65, 67, 68, 71, 74, 75, 76, 77, 81, 82, 83, 84, 13735 * 85, 86, 87, 89, 91, 94, 95. 13736 * 13737 * Ministry of National Defence numbers and VoIP numbers starts with 26 and 39. 13738 * 13739 * Excludes intelligent networks (premium rate, shared cost, free phone numbers). 13740 * 13741 * Poland National Numbering Plan http://www.itu.int/oth/T02020000A8/en 13742 */ 13743$.validator.addMethod( "phonePL", function( phone_number, element ) { 13744 phone_number = phone_number.replace( /\s+/g, "" );
13745 var regexp = /^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/; 13746 return this.optional( element ) || regexp.test( phone_number ); 13747}, "Please specify a valid phone number" ); 13748 13749/* For UK phone functions, do the following server side processing: 13750 * Compare original input with this RegEx pattern: 13751 * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ 13752 * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' 13753 * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. 13754 * A number of very detailed GB telephone number RegEx patterns can also be found at: 13755 * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers 13756 */ 13757 13758// Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers 13759$.validator.addMethod( "phonesUK", function( phone_number, element ) { 13760 phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); 13761 return this.optional( element ) || phone_number.length > 9 && 13762 phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/ ); 13763}, "Please specify a valid uk phone number" ); 13764 13765/* For UK phone functions, do the following server side processing: 13766 * Compare original input with this RegEx pattern: 13767 * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ 13768 * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' 13769 * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. 13770 * A number of very detailed GB telephone number RegEx patterns can also be found at: 13771 * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers 13772 */ 13773$.validator.addMethod( "phoneUK", function( phone_number, element ) { 13774 phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); 13775 return this.optional( element ) || phone_number.length > 9 && 13776 phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/ ); 13777}, "Please specify a valid phone number" ); 13778 13779/** 13780 * Matches US phone number format 13781 * 13782 * where the area code may not start with 1 and the prefix may not start with 1 13783 * allows '-' or ' ' as a separator and allows parens around area code 13784 * some people may want to put a '1' in front of their number 13785 * 13786 * 1(212)-999-2345 or 13787 * 212 999 2344 or 13788 * 212-999-0983 13789 * 13790 * but not 13791 * 111-123-5434 13792 * and not 13793 * 212 123 4567 13794 */ 13795$.validator.addMethod( "phoneUS", function( phone_number, element ) { 13796 phone_number = phone_number.replace( /\s+/g, "" ); 13797 return this.optional( element ) || phone_number.length > 9 && 13798 phone_number.match( /^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/ ); 13799}, "Please specify a valid phone number" ); 13800 13801/* 13802* Valida CEPs do brasileiros: 13803* 13804* Formatos aceitos: 13805* 99999-999 13806* 99.999-999 13807* 99999999 13808*/ 13809$.validator.addMethod( "postalcodeBR", function( cep_value, element ) { 13810 return this.optional( element ) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value ); 13811}, "Informe um CEP válido." ); 13812 13813/** 13814 * Matches a valid Canadian Postal Code 13815 * 13816 * @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element ) 13817 * @result true 13818 * 13819 * @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element ) 13820 * @result false 13821 * 13822 * @name jQuery.validator.methods.postalCodeCA 13823 * @type Boolean 13824 * @cat Plugins/Validate/Methods 13825 */ 13826$.validator.addMethod( "postalCodeCA", function( value, element ) { 13827 return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test( value ); 13828}, "Please specify a valid postal code" ); 13829 13830/* Matches Italian postcode (CAP) */ 13831$.validator.addMethod( "postalcodeIT", function( value, element ) { 13832 return this.optional( element ) || /^\d{5}$/.test( value ); 13833}, "Please specify a valid postal code" ); 13834 13835$.validator.addMethod( "postalcodeNL", function( value, element ) { 13836 return this.optional( element ) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test( value ); 13837}, "Please specify a valid postal code" ); 13838 13839// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK) 13840$.validator.addMethod( "postcodeUK", function( value, element ) { 13841 return this.optional( element ) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test( value ); 13842}, "Please specify a valid UK postcode" ); 13843 13844/*
13845 * Lets you say "at least X inputs that match selector Y must be filled." 13846 * 13847 * The end result is that neither of these inputs: 13848 * 13849 * <input class="productinfo" name="partnumber"> 13850 * <input class="productinfo" name="description"> 13851 * 13852 * ...will validate unless at least one of them is filled. 13853 * 13854 * partnumber: {require_from_group: [1,".productinfo"]}, 13855 * description: {require_from_group: [1,".productinfo"]} 13856 * 13857 * options[0]: number of fields that must be filled in the group 13858 * options[1]: CSS selector that defines the group of conditionally required fields 13859 */ 13860$.validator.addMethod( "require_from_group", function( value, element, options ) { 13861 var $fields = $( options[ 1 ], element.form ), 13862 $fieldsFirst = $fields.eq( 0 ), 13863 validator = $fieldsFirst.data( "valid_req_grp" ) ? $fieldsFirst.data( "valid_req_grp" ) : $.extend( {}, this ), 13864 isValid = $fields.filter( function() { 13865 return validator.elementValue( this ); 13866 } ).length >= options[ 0 ]; 13867 13868 // Store the cloned validator for future validation 13869 $fieldsFirst.data( "valid_req_grp", validator ); 13870 13871 // If element isn't being validated, run each require_from_group field's validation rules 13872 if ( !$( element ).data( "being_validated" ) ) { 13873 $fields.data( "being_validated", true ); 13874 $fields.each( function() { 13875 validator.element( this ); 13876 } ); 13877 $fields.data( "being_validated", false ); 13878 } 13879 return isValid; 13880}, $.validator.format( "Please fill at least {0} of these fields." ) ); 13881 13882/* 13883 * Lets you say "either at least X inputs that match selector Y must be filled, 13884 * OR they must all be skipped (left blank)." 13885 * 13886 * The end result, is that none of these inputs: 13887 * 13888 * <input class="productinfo" name="partnumber"> 13889 * <input class="productinfo" name="description"> 13890 * <input class="productinfo" name="color"> 13891 * 13892 * ...will validate unless either at least two of them are filled, 13893 * OR none of them are. 13894 * 13895 * partnumber: {skip_or_fill_minimum: [2,".productinfo"]}, 13896 * description: {skip_or_fill_minimum: [2,".productinfo"]}, 13897 * color: {skip_or_fill_minimum: [2,".productinfo"]} 13898 * 13899 * options[0]: number of fields that must be filled in the group 13900 * options[1]: CSS selector that defines the group of conditionally required fields 13901 * 13902 */ 13903$.validator.addMethod( "skip_or_fill_minimum", function( value, element, options ) { 13904 var $fields = $( options[ 1 ], element.form ), 13905 $fieldsFirst = $fields.eq( 0 ), 13906 validator = $fieldsFirst.data( "valid_skip" ) ? $fieldsFirst.data( "valid_skip" ) : $.extend( {}, this ), 13907 numberFilled = $fields.filter( function() { 13908 return validator.elementValue( this ); 13909 } ).length, 13910 isValid = numberFilled === 0 || numberFilled >= options[ 0 ]; 13911 13912 // Store the cloned validator for future validation 13913 $fieldsFirst.data( "valid_skip", validator ); 13914 13915 // If element isn't being validated, run each skip_or_fill_minimum field's validation rules 13916 if ( !$( element ).data( "being_validated" ) ) { 13917 $fields.data( "being_validated", true ); 13918 $fields.each( function() { 13919 validator.element( this ); 13920 } ); 13921 $fields.data( "being_validated", false ); 13922 } 13923 return isValid; 13924}, $.validator.format( "Please either skip these fields or fill at least {0} of them." ) ); 13925 13926/* Validates US States and/or Territories by @jdforsythe 13927 * Can be case insensitive or require capitalization - default is case insensitive 13928 * Can include US Territories or not - default does not 13929 * Can include US Military postal abbreviations (AA, AE, AP) - default does not 13930 * 13931 * Note: "States" always includes DC (District of Colombia) 13932 * 13933 * Usage examples: 13934 * 13935 * This is the default - case insensitive, no territories, no military zones 13936 * stateInput: { 13937 * caseSensitive: false, 13938 * includeTerritories: false, 13939 * includeMilitary: false 13940 * } 13941 * 13942 * Only allow capital letters, no territories, no military zones 13943 * stateInput: { 13944 * caseSensitive: false 13945 * } 13946 * 13947 * Case insensitive, include territories but not military zones 13948 * stateInput: { 13949 * includeTerritories: true 13950 * } 13951 * 13952 * Only allow capital letters, include territories and military zones 13953 * stateInput: { 13954 * caseSensitive: true, 13955 * includeTerritories: true, 13956 * includeMilitary: true 13957 * } 13958 * 13959 */ 13960$.validator.addMethod( "stateUS", function( value, element, options ) { 13961 var isDefault = typeof options === "undefined",
vendor: 4,127 bytes, lines 13962-14020
13962 caseSensitive = ( isDefault || typeof options.caseSensitive === "undefined" ) ? false : options.caseSensitive, 13963 includeTerritories = ( isDefault || typeof options.includeTerritories === "undefined" ) ? false : options.includeTerritories, 13964 includeMilitary = ( isDefault || typeof options.includeMilitary === "undefined" ) ? false : options.includeMilitary, 13965 regex; 13966 13967 if ( !includeTerritories && !includeMilitary ) { 13968 regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; 13969 } else if ( includeTerritories && includeMilitary ) { 13970 regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; 13971 } else if ( includeTerritories ) { 13972 regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; 13973 } else { 13974 regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; 13975 } 13976 13977 regex = caseSensitive ? new RegExp( regex ) : new RegExp( regex, "i" ); 13978 return this.optional( element ) || regex.test( value ); 13979}, "Please specify a valid state" ); 13980 13981// TODO check if value starts with <, otherwise don't try stripping anything 13982$.validator.addMethod( "strippedminlength", function( value, element, param ) { 13983 return $( value ).text().length >= param; 13984}, $.validator.format( "Please enter at least {0} characters" ) ); 13985 13986$.validator.addMethod( "time", function( value, element ) { 13987 return this.optional( element ) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test( value ); 13988}, "Please enter a valid time, between 00:00 and 23:59" ); 13989 13990$.validator.addMethod( "time12h", function( value, element ) { 13991 return this.optional( element ) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test( value ); 13992}, "Please enter a valid time in 12-hour am/pm format" ); 13993 13994// Same as url, but TLD is optional 13995$.validator.addMethod( "url2", function( value, element ) { 13996 return this.optional( element ) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test( value ); 13997}, $.validator.messages.url ); 13998 13999/** 14000 * Return true, if the value is a valid vehicle identification number (VIN). 14001 * 14002 * Works with all kind of text inputs. 14003 * 14004 * @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" /> 14005 * @desc Declares a required input element whose value must be a valid vehicle identification number. 14006 * 14007 * @name $.validator.methods.vinUS 14008 * @type Boolean 14009 * @cat Plugins/Validate/Methods 14010 */ 14011$.validator.addMethod( "vinUS", function( v ) { 14012 if ( v.length !== 17 ) { 14013 return false; 14014 } 14015 14016 var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ], 14017 VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ], 14018 FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ], 14019 rs = 0, 14020 i, n, d, f, cd, cdv;
14021 14022 for ( i = 0; i < 17; i++ ) { 14023 f = FL[ i ]; 14024 d = v.slice( i, i + 1 ); 14025 if ( i === 8 ) { 14026 cdv = d; 14027 } 14028 if ( !isNaN( d ) ) { 14029 d *= f; 14030 } else { 14031 for ( n = 0; n < LL.length; n++ ) { 14032 if ( d.toUpperCase() === LL[ n ] ) { 14033 d = VL[ n ]; 14034 d *= f; 14035 if ( isNaN( cdv ) && n === 8 ) { 14036 cdv = LL[ n ]; 14037 } 14038 break; 14039 } 14040 } 14041 } 14042 rs += d; 14043 } 14044 cd = rs % 11; 14045 if ( cd === 10 ) { 14046 cd = "X"; 14047 } 14048 if ( cd === cdv ) { 14049 return true; 14050 } 14051 return false; 14052}, "The specified vehicle identification number (VIN) is invalid." ); 14053 14054$.validator.addMethod( "zipcodeUS", function( value, element ) { 14055 return this.optional( element ) || /^\d{5}(-\d{4})?$/.test( value ); 14056}, "The specified US ZIP Code is invalid" ); 14057 14058$.validator.addMethod( "ziprange", function( value, element ) { 14059 return this.optional( element ) || /^90[2-5]\d\{2\}-\d{4}$/.test( value ); 14060}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx" ); 14061return $; 14062}));
vendor: 24,103 bytes, lines 14063-14071
14063/*! 14064 * Masonry PACKAGED v4.2.2 14065 * Cascading grid layout library 14066 * https://masonry.desandro.com 14067 * MIT License 14068 * by David DeSandro 14069 */ 14070 14071!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var r=i.toDashed(n),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,n,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=parseFloat(n),s=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=e?a.paddingLeft:a.paddingRight,s-=i?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),o&&!this.isTransitioning)return void this.layoutPosition();var r=t-i,s=e-n,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
vendor: 5,443 bytes, lines 14071-14073
14071 14072/*! medium-zoom 1.0.6 | MIT License | https://github.com/francoischalifour/medium-zoom */ 14073!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).mediumZoom=t()}(this,(function(){"use strict";var e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},t=function(e){return"IMG"===e.tagName},o=function(e){return e&&1===e.nodeType},n=function(e){return".svg"===(e.currentSrc||e.src).substr(-4).toLowerCase()},i=function(e){try{return Array.isArray(e)?e.filter(t):function(e){return NodeList.prototype.isPrototypeOf(e)}(e)?[].slice.call(e).filter(t):o(e)?[e].filter(t):"string"==typeof e?[].slice.call(document.querySelectorAll(e)).filter(t):[]}catch(e){throw new TypeError("The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList or an array.\nSee: https://github.com/francoischalifour/medium-zoom")}},r=function(e){var t=document.createElement("div");return t.classList.add("medium-zoom-overlay"),t.style.background=e,t},d=function(e){var t=e.getBoundingClientRect(),o=t.top,n=t.left,i=t.width,r=t.height,d=e.cloneNode(),m=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,a=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return d.removeAttribute("id"),d.style.position="absolute",d.style.top=o+m+"px",d.style.left=n+a+"px",d.style.width=i+"px",d.style.height=r+"px",d.style.transform="",d},m=function(t,o){var n=e({bubbles:!1,cancelable:!1,detail:void 0},o);if("function"==typeof window.CustomEvent)return new CustomEvent(t,n);var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),i};return function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}"),function t(a){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=window.Promise||function(e){function t(){}e(t,t)},u=function(e){var t=e.target;t!==N?-1!==O.indexOf(t)&&w({target:t}):E()},s=function(){if(!A&&T.original){var e=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(k-e)>S.scrollOffset&&setTimeout(E,150)}},f=function(e){var t=e.key||e.keyCode;"Escape"!==t&&"Esc"!==t&&27!==t||E()},p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t;if(t.background&&(N.style.background=t.background),t.container&&t.container instanceof Object&&(n.container=e({},S.container,t.container)),t.template){var i=o(t.template)?t.template:document.querySelector(t.template);n.template=i}return S=e({},S,n),O.forEach((function(e){e.dispatchEvent(m("medium-zoom:update",{detail:{zoom:j}}))})),j},g=function(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(e({},S,o))},v=function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];var n=t.reduce((function(e,t){return[].concat(e,i(t))}),[]);return n.filter((function(e){return-1===O.indexOf(e)})).forEach((function(e){O.push(e),e.classList.add("medium-zoom-image")})),x.forEach((function(e){var t=e.type,o=e.listener,i=e.options;n.forEach((function(e){e.addEventListener(t,o,i)}))})),j},h=function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];T.zoomed&&E();var n=t.length>0?t.reduce((function(e,t){return[].concat(e,i(t))}),[]):O;return n.forEach((function(e){e.classList.remove("medium-zoom-image"),e.dispatchEvent(m("medium-zoom:detach",{detail:{zoom:j}}))})),O=O.filter((function(e){return-1===n.indexOf(e)})),j},z=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return O.forEach((function(n){n.addEventListener("medium-zoom:"+e,t,o)})),x.push({type:"medium-zoom:"+e,listener:t,options:o}),j},y=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return O.forEach((function(n){n.removeEventListener("medium-zoom:"+e,t,o)})),x=x.filter((function(o){return!(o.type==="medium-zoom:"+e&&o.listener.toString()===t.toString())})),j},b=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.target,r=function(){var t={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},i=void 0,r=void 0;if(S.container)if(S.container instanceof Object)i=(t=e({},t,S.container)).width-t.left-t.right-2*S.margin,r=t.height-t.top-t.bottom-2*S.margin;else{var d=(o(S.container)?S.container:document.querySelector(S.container)).getBoundingClientRect(),m=d.width,a=d.height,l=d.left,c=d.top;t=e({},t,{width:m,height:a,left:l,top:c})}i=i||t.width-2*S.margin,r=r||t.height-2*S.margin;
14073var u=T.zoomedHd||T.original,s=n(u)?i:u.naturalWidth||i,f=n(u)?r:u.naturalHeight||r,p=u.getBoundingClientRect(),g=p.top,v=p.left,h=p.width,z=p.height,y=Math.min(s,i)/h,b=Math.min(f,r)/z,E=Math.min(y,b),w="scale("+E+") translate3d("+((i-h)/2-v+S.margin+t.left)/E+"px, "+((r-z)/2-g+S.margin+t.top)/E+"px, 0)";T.zoomed.style.transform=w,T.zoomedHd&&(T.zoomedHd.style.transform=w)};return new c((function(e){if(i&&-1===O.indexOf(i))e(j);else{if(T.zoomed)e(j);else{if(i)T.original=i;else{if(!(O.length>0))return void e(j);var t=O;T.original=t[0]}if(T.original.dispatchEvent(m("medium-zoom:open",{detail:{zoom:j}})),k=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,A=!0,T.zoomed=d(T.original),document.body.appendChild(N),S.template){var n=o(S.template)?S.template:document.querySelector(S.template);T.template=document.createElement("div"),T.template.appendChild(n.content.cloneNode(!0)),document.body.appendChild(T.template)}if(document.body.appendChild(T.zoomed),window.requestAnimationFrame((function(){document.body.classList.add("medium-zoom--opened")})),T.original.classList.add("medium-zoom-image--hidden"),T.zoomed.classList.add("medium-zoom-image--opened"),T.zoomed.addEventListener("click",E),T.zoomed.addEventListener("transitionend",(function t(){A=!1,T.zoomed.removeEventListener("transitionend",t),T.original.dispatchEvent(m("medium-zoom:opened",{detail:{zoom:j}})),e(j)})),T.original.getAttribute("data-zoom-src")){T.zoomedHd=T.zoomed.cloneNode(),T.zoomedHd.removeAttribute("srcset"),T.zoomedHd.removeAttribute("sizes"),T.zoomedHd.src=T.zoomed.getAttribute("data-zoom-src"),T.zoomedHd.onerror=function(){clearInterval(a),console.warn("Unable to reach the zoom image target "+T.zoomedHd.src),T.zoomedHd=null,r()};var a=setInterval((function(){T.zoomedHd.complete&&(clearInterval(a),T.zoomedHd.classList.add("medium-zoom-image--opened"),T.zoomedHd.addEventListener("click",E),document.body.appendChild(T.zoomedHd),r())}),10)}else if(T.original.hasAttribute("srcset")){T.zoomedHd=T.zoomed.cloneNode(),T.zoomedHd.removeAttribute("sizes"),T.zoomedHd.removeAttribute("loading");var l=T.zoomedHd.addEventListener("load",(function(){T.zoomedHd.removeEventListener("load",l),T.zoomedHd.classList.add("medium-zoom-image--opened"),T.zoomedHd.addEventListener("click",E),document.body.appendChild(T.zoomedHd),r()}))}else r()}}}))},E=function(){return new c((function(e){if(!A&&T.original){A=!0,document.body.classList.remove("medium-zoom--opened"),T.zoomed.style.transform="",T.zoomedHd&&(T.zoomedHd.style.transform=""),T.template&&(T.template.style.transition="opacity 150ms",T.template.style.opacity=0),T.original.dispatchEvent(m("medium-zoom:close",{detail:{zoom:j}})),T.zoomed.addEventListener("transitionend",(function t(){T.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(T.zoomed),T.zoomedHd&&document.body.removeChild(T.zoomedHd),document.body.removeChild(N),T.zoomed.classList.remove("medium-zoom-image--opened"),T.template&&document.body.removeChild(T.template),A=!1,T.zoomed.removeEventListener("transitionend",t),T.original.dispatchEvent(m("medium-zoom:closed",{detail:{zoom:j}})),T.original=null,T.zoomed=null,T.zoomedHd=null,T.template=null,e(j)}))}else e(j)}))},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target;return T.original?E():b({target:t})},L=function(){return S},H=function(){return O},C=function(){return T.original},O=[],x=[],A=!1,k=0,S=l,T={original:null,zoomed:null,zoomedHd:null,template:null};"[object Object]"===Object.prototype.toString.call(a)?S=a:(a||"string"==typeof a)&&v(a),S=e({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},S);var N=r(S.background);document.addEventListener("click",u),document.addEventListener("keyup",f),document.addEventListener("scroll",s),window.addEventListener("resize",E);var j={open:b,close:E,toggle:w,update:p,clone:g,attach:v,detach:h,on:z,off:y,getOptions:L,getImages:H,getZoomedImage:C};return j}})); 14074/** 14075 * Spotlight.js v0.7.8 14076 * Copyright 2019-2021 Nextapps GmbH 14077 * Author: Thomas Wilkerling 14078 * Licence: Apache-2.0 14079 * https://github.com/nextapps-de/spotlight 14080 */ 14081(function(){'use strict';Object.assign||(Object.assign=function(a,b){for(var c=Object.keys(b),e=0,f;e<c.length;e++)f=c[e],a[f]=b[f];return a});Element.prototype.closest||(Element.prototype.closest=function(a){a=a.substring(1);for(var b=this;b&&1===b.nodeType;){if(b.classList.contains(a))return b;b=b.parentElement}return null});function d(a,b,c){a.classList[c?"add":"remove"](b)}function g(a,b,c){c=""+c;a["_s_"+b]!==c&&(a.style.setProperty(b,c),a["_s_"+b]=c)}var aa=0;function ba(a,b){b&&(g(a,"transition","none"),b());aa||(aa=a.clientTop&&0);b&&g(a,"transition","")}function h(a,b,c,e){k(!0,a,b,c,e)}function k(a,b,c,e,f){b[(a?"add":"remove")+"EventListener"](c,e,f||!1===f?f:!0)}function ca(a,b){a.stopPropagation();b&&a.preventDefault()}function l(a,b){g(a,"display",b?"":"none")} 14082function m(a,b){g(a,"visibility",b?"":"hidden")}function n(a,b){g(a,"transition",b?"":"none")};var p="info theme download play page close autofit zoom-in zoom-out prev next fullscreen".split(" "),da={info:1,page:1,close:1,autofit:1,"zoom-in":1,"zoom-out":1,prev:1,next:1,fullscreen:1};var q=document.createElement("div");q.id="spotlight";q.innerHTML="<div class=spl-spinner></div><div class=spl-track><div class=spl-scene><div class=spl-pane></div></div></div><div class=spl-header><div class=spl-page> </div></div><div class=spl-progress></div><div class=spl-footer><div class=spl-title> </div><div class=spl-description> </div><div class=spl-button> </div></div><div class=spl-prev></div><div class=spl-next></div>";var ea={},fa=document.createElement("video");function ha(a,b,c,e){if("node"!==e)for(var f=Object.keys(c),A=0,w;A<f.length;A++)if(w=f[A],3<w.length&&0===w.indexOf("src"))if("video"===e){var F=ea[w];if(F){if(0<F){var Ha=c[w];break}}else if(fa.canPlayType("video/"+w.substring(3).replace("-","").toLowerCase())){ea[w]=1;Ha=c[w];break}else ea[w]=-1}else if(F=parseInt(w.substring(4),10))if(F=Math.abs(b-F),!ib||F<ib){var ib=F;Ha=c[w]}return Ha||c.src||c.href||a.src||a.href};var r={},ia=navigator.connection,ja=window.devicePixelRatio||1,t,u,ka,la,v,ma,na,oa,x,pa,qa,ra,y,z,B,C,D,E,sa,ta,G,ua,va,wa,xa,ya,za,H,Aa,Ba,Ca,Da,I,Ea,Fa,Ga,Ia,J,K,L,Ja,M,Ka=document.createElement("img"),La,Ma,N,Na=0,Oa,Pa,Qa,Ra,Sa,Ta,Ua,Va,O,Wa,P,Q,R,S,Xa,T,Ya;h(document,"click",Za); 14083function $a(){function a(c){return r[c]=(q||document).getElementsByClassName("spl-"+c)[0]}if(!K){K=document.body;La=a("scene");Ma=a("header");N=a("footer");Oa=a("title");Pa=a("description");Qa=a("button");Ra=a("prev");
vendor: 5,158 bytes, lines 14083-14095
14083Sa=a("next");Ua=a("page");O=a("progress");Wa=a("spinner");Ja=[a("pane")];U("close",ab);K[T="requestFullscreen"]||K[T="msRequestFullscreen"]||K[T="webkitRequestFullscreen"]||K[T="mozRequestFullscreen"]||(T="");T?(Ya=T.replace("request","exit").replace("mozRequest","mozCancel").replace("Request", 14084"Exit"),Ta=U("fullscreen",bb)):p.pop();U("info",cb);U("autofit",V);U("zoom-in",db);U("zoom-out",eb);U("theme",fb);Va=U("play",W);U("download",gb);h(Ra,"click",hb);h(Sa,"click",jb);var b=a("track");h(b,"mousedown",kb);h(b,"mousemove",lb);h(b,"mouseleave",mb);h(b,"mouseup",mb);h(b,"touchstart",kb,{passive:!1});h(b,"touchmove",lb,{passive:!0});h(b,"touchend",mb);h(Qa,"click",function(){Da?Da(B,E):Ca&&(location.href=Ca)})}} 14085function U(a,b){var c=document.createElement("div");c.className="spl-"+a;h(c,"click",b);Ma.appendChild(c);return r[a]=c}function Za(a){var b=a.target.closest(".spotlight");if(b){ca(a,!0);a=b.closest(".spotlight-group");D=(a||document).getElementsByClassName("spotlight");for(var c=0;c<D.length;c++)if(D[c]===b){ta=a&&a.dataset;nb(c+1);break}}} 14086function nb(a){if(C=D.length){K||$a();va&&va(a);for(var b=Ja[0],c=b.parentNode,e=Ja.length;e<C;e++){var f=b.cloneNode(!1);g(f,"left",100*e+"%");c.appendChild(f);Ja[e]=f}L||(K.appendChild(q),ob());B=a||1;n(La);pb(!0);T&&l(Ta,0<screen.availHeight-window.innerHeight);history.pushState({spl:1},"");history.pushState({spl:2},"");n(q,!0);d(K,"hide-scrollbars",!0);d(q,"show",!0);qb(!0);ob();X();H&&W(!0,!0)}}function Y(a,b){a=E[a];return"undefined"!==typeof a?(a=""+a,"false"!==a&&(a||b)):b} 14087function rb(a){a?ba(M,rb):(n(La,Ia),g(M,"opacity",Ga?0:1),sb(Fa&&.8),J&&d(M,J,!0))} 14088function tb(a){L=Ja[a-1];M=L.firstChild;B=a;if(M)y&&V(),ya&&d(M,ya,!0),rb(!0),J&&d(M,J),Ga&&g(M,"opacity",1),Fa&&g(M,"transform",""),g(M,"visibility","visible"),Q&&(Ka.src=Q),H&&ub(R);else{var b=P.media,c=Y("spinner",!0);if("video"===b)vb(c,!0),M=document.createElement("video"),M.onloadedmetadata=function(){M===this&&(M.onerror=null,M.width=M.videoWidth,M.height=M.videoHeight,wb(),vb(c),tb(a))},M.poster=E.poster,M.preload=Ba?"auto":"metadata",M.controls=Y("controls",!0),M.autoplay=E.autoplay,M.h= 14089Y("inline"),M.muted=Y("muted"),M.src=P.src,L.appendChild(M);else{if("node"===b){M=P.src;"string"===typeof M&&(M=document.querySelector(M));M&&(M.g||(M.g=M.parentNode),wb(),L.appendChild(M),tb(a));return}vb(c,!0);M=document.createElement("img");M.onload=function(){M===this&&(M.onerror=null,vb(c),tb(a),wb())};M.src=P.src;L.appendChild(M)}M&&(c||g(M,"visibility","visible"),M.onerror=function(){M===this&&(xb(M),d(Wa,"error",!0),vb(c))})}}function vb(a,b){a&&d(Wa,"spin",b)} 14090function yb(){return document.fullscreen||document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement}function zb(){ob();M&&wb();if(T){var a=yb();d(Ta,"on",a);a||l(Ta,0<screen.availHeight-window.innerHeight)}}function ob(){v=q.clientWidth;ma=q.clientHeight}function wb(){na=M.clientWidth;oa=M.clientHeight}function sb(a){g(M,"transform","translate(-50%, -50%) scale("+(a||x)+")")}function Z(a,b){g(L,"transform",a||b?"translate("+a+"px, "+b+"px)":"")} 14091function Ab(a,b,c){b?ba(La,function(){Ab(a,!1,c)}):g(La,"transform","translateX("+(100*-a+(c||0))+"%)")}function qb(a){k(a,window,"keydown",Bb);k(a,window,"wheel",Cb);k(a,window,"resize",zb);k(a,window,"popstate",Db)}function Db(a){L&&a.state.spl&&ab(!0)} 14092function Bb(a){if(L){var b=!1!==E["zoom-in"];switch(a.keyCode){case 8:b&&V();break;case 27:ab();break;case 32:H&&W();break;case 37:hb();break;case 39:jb();break;case 38:case 107:case 187:b&&db();break;case 40:case 109:case 189:b&&eb();break;case 73:cb()}}}function Cb(a){L&&!1!==E["zoom-in"]&&(a=a.deltaY,0>.5*(0>a?1:a?-1:0)?eb():db())}function W(a,b){("boolean"===typeof a?a:!R)===!R&&(R=R?clearTimeout(R):1,d(Va,"on",R),b||ub(R))} 14093function ub(a){ua&&(ba(O,function(){g(O,"transition-duration","");g(O,"transform","")}),a&&(g(O,"transition-duration",Ea+"s"),g(O,"transform","translateX(0)")));a&&(R=setTimeout(jb,1E3*Ea))}function X(){za&&(Xa=Date.now()+2950,S||(d(q,"menu",!0),Eb(3E3)))}function Eb(a){S=setTimeout(function(){var b=Date.now();b>=Xa?(d(q,"menu"),S=0):Eb(Xa-b)},a)}function Fb(a){"boolean"===typeof a&&(S=a?S:0);S?(S=clearTimeout(S),d(q,"menu")):X()} 14094function kb(a){ca(a,!0);pa=!0;qa=!1;var b=a.touches;b&&(b=b[0])&&(a=b);ra=na*x<=v;ka=a.pageX;la=a.pageY;n(L)}function mb(a){ca(a);if(pa){if(qa){if(ra&&qa){var b=(a=t<-(v/7)&&(B<C||G))||t>v/7&&(1<B||G);if(a||b)Ab(B-1,!0,t/v*100),a&&jb()||b&&hb();t=0;Z()}n(L,!0)}else Fb();pa=!1}}function lb(a){ca(a);if(pa){var b=a.touches;b&&(b=b[0])&&(a=b);b=(na*x-v)/2;t-=ka-(ka=a.pageX);ra||(t>b?t=b:t<-b&&(t=-b),oa*x>ma&&(b=(oa*x-ma)/2,u-=la-(la=a.pageY),u>b?u=b:u<-b&&(u=-b)));qa=!0;Z(t,u)}else X()} 14095function bb(a){var b=yb();if("boolean"!==typeof a||a!==!!b)if(b)document[Ya]();else q[T]()}function fb(a){"string"!==typeof a&&(a=z?"":Aa||"white");z!==a&&(z&&d(q,z),a&&d(q,a,!0),z=a)}function V(a){"boolean"===typeof a&&(y=!a);y=1===x&&!y;d(M,"autofit",y);g(M,"transform","");x=1;u=t=0;wb();n(L);Z()}function db(){var a=x/.65;50>=a&&(y&&V(),t/=.65,u/=.65,Z(t,u),Gb(a))}function eb(){var a=.65*x;y&&V();1<=a&&(1===a?t=u=0:(t*=.65,u*=.65),Z(t,u),Gb(a))}
14095function Gb(a){x=a||1;sb()} 14096function cb(){Na=!Na;m(N,Na)}function gb(){var a=K,b=document.createElement("a"),c=M.src;b.href=c;b.download=c.substring(c.lastIndexOf("/")+1);a.appendChild(b);b.click();a.removeChild(b)}function ab(a){setTimeout(function(){K.removeChild(q);L=M=P=E=ta=D=va=wa=xa=Da=null},200);d(K,"hide-scrollbars");d(q,"show");bb(!1);qb();history.go(!0===a?-1:-2);Q&&(Ka.src="");R&&W();M&&xb(M);S&&(S=clearTimeout(S));z&&fb();I&&d(q,I);xa&&xa()} 14097function xb(a){if(a.g)a.g.appendChild(a),a.g=null;else{var b=a.parentNode;b&&b.removeChild(a);a.src=a.onerror=""}}function hb(a){a&&X();if(1<C){if(1<B)return Hb(B-1);if(G)return Ab(C,!0),Hb(C)}}function jb(a){a&&X();if(1<C){if(B<C)return Hb(B+1);if(G)return Ab(-1,!0),Hb(1);R&&W()}}function Hb(a){if(a!==B){R?(clearTimeout(R),ub()):X();var b=a>B;B=a;pb(b);return!0}} 14098function Ib(a){var b=D[B-1],c=b;E={};ta&&Object.assign(E,ta);Object.assign(E,c.dataset||c);sa=E.media;Da=E.onclick;Aa=E.theme;I=E["class"];za=Y("autohide",!0);G=Y("infinite");ua=Y("progress",!0);H=Y("autoslide");Ba=Y("preload",!0);Ca=E.buttonHref;Ea=H&&parseFloat(H)||7;z||Aa&&fb(Aa);I&&d(q,I,!0);I&&ba(q);if(c=E.control){c="string"===typeof c?c.split(","):c;for(var e=0;e<p.length;e++)E[p[e]]=!1;for(e=0;e<c.length;e++){var f=c[e].trim();"zoom"===f?E["zoom-in"]=E["zoom-out"]=!0:E[f]=!0}}c=E.animation; 14099Fa=Ga=Ia=!c;J=!1;if(c)for(c="string"===typeof c?c.split(","):c,e=0;e<c.length;e++)f=c[e].trim(),"scale"===f?Fa=!0:"fade"===f?Ga=!0:"slide"===f?Ia=!0:f&&(J=f);ya=E.fit;void 0==ya&&(ya="contain");e=ia&&ia.downlink;c=Math.max(ma,v)*ja;e&&1200*e<c&&(c=1200*e);var A;P={media:sa,src:ha(b,c,E,sa),title:Y("title",b.alt||b.title||(A=b.firstElementChild)&&(A.alt||A.title))};Q&&(Ka.src=Q="");Ba&&a&&(b=D[B])&&(a=b.dataset||b,(A=a.media)&&"image"!==A||(Q=ha(b,c,a,A)));for(b=0;b<p.length;b++)a=p[b],l(r[a],Y(a, 14100da[a]))} 14101function pb(a){u=t=0;x=1;if(M)if(M.onerror)xb(M);else{var b=M;setTimeout(function(){b&&M!==b&&(xb(b),b=null)},650);rb();Z()}N&&m(N,0);Ib(a);Ab(B-1);d(Wa,"error");tb(B);n(L);Z();a=P.title;var c=Y("description"),e=Y("button"),f=a||c||e;f&&(a&&(Oa.firstChild.nodeValue=a),c&&(Pa.firstChild.nodeValue=c),e&&(Qa.firstChild.nodeValue=e),l(Oa,a),l(Pa,c),l(Qa,e),g(N,"transform","all"===za?"":"none"));za||d(q,"menu",!0);m(N,Na&&f);m(Ra,G||1<B);m(Sa,G||B<C);Ua.firstChild.nodeValue=1<C?B+" / "+C:"";wa&&wa(B,E)} 14102;window.Spotlight={init:$a,theme:fb,fullscreen:bb,download:gb,autofit:V,next:jb,prev:hb,goto:Hb,close:ab,zoom:Gb,menu:Fb,show:function(a,b,c){D=a;b&&(ta=b,va=b.onshow,wa=b.onchange,xa=b.onclose,c=c||b.index);nb(c)},play:W,addControl:U,removeControl:function(a){var b=r[a];b&&(Ma.removeChild(b),r[a]=null)}};}).call(this); 14103 14104!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).checkPasswordStrength={})}(this,(function(e){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n={exports:{}};const i=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(e,t=i,n="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let s=e||"";t[0].minDiversity=0,t[0].minLength=0;const r=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];n&&r.push({regex:`[${n}]`,message:"symbol"});let o={};o.contains=r.filter((e=>new RegExp(`${e.regex}`).test(s))).map((e=>e.message)),o.length=s.length;let a=t.filter((e=>o.contains.length>=e.minDiversity)).filter((e=>o.length>=e.minLength)).sort(((e,t)=>t.id-e.id)).map((e=>({id:e.id,value:e.value})));return Object.assign(o,a[0]),o};n.exports={passwordStrength:s,defaultOptions:i};var r=n.exports.passwordStrength=s,o=n.exports.defaultOptions=i,a=t(n.exports);e.default=a,e.defaultOptions=o,e.passwordStrength=r,Object.defineProperty(e,"__esModule",{value:!0})})); 14105/** 14106* Copyright Marc J. Schmidt. See the LICENSE file at the top-level 14107* directory of this distribution and at 14108* https://github.com/marcj/css-element-queries/blob/master/LICENSE. 14109*/ 14110; 14111(function (root, factory) { 14112 if (typeof define === "function" && define.amd) { 14113 define(factory); 14114 } else if (typeof exports === "object") { 14115 module.exports = factory(); 14116 } else { 14117 root.ResizeSensor = factory(); 14118 } 14119}(typeof window !== 'undefined' ? window : this, function () { 14120 14121 // Make sure it does not throw in a SSR (Server Side Rendering) situation 14122 if (typeof window === "undefined") { 14123 return null; 14124 } 14125 // Only used for the dirty checking, so the event callback count is limited to max 1 call per fps per sensor. 14126 // In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and 14127 // would generate too many unnecessary events. 14128 var requestAnimationFrame = window.requestAnimationFrame || 14129 window.mozRequestAnimationFrame || 14130 window.webkitRequestAnimationFrame || 14131 function (fn) { 14132 return window.setTimeout(fn, 20); 14133 }; 14134 14135 /** 14136 * Iterate over each of the provided element(s). 14137 * 14138 * @param {HTMLElement|HTMLElement[]} elements 14139 * @param {Function} callback 14140 */ 14141 function forEachElement(elements, callback){ 14142 var elementsType = Object.prototype.toString.call(elements); 14143 var isCollectionTyped = ('[object Array]' === elementsType 14144 || ('[object NodeList]' === elementsType) 14145 || ('[object HTMLCollection]' === elementsType) 14146 || ('[object Object]' === elementsType) 14147 || ('undefined' !== typeof jQuery && elements instanceof jQuery) //jquery 14148 || ('undefined' !== typeof Elements && elements instanceof Elements) //mootools 14149 ); 14150 var i = 0, j = elements.length; 14151 if (isCollectionTyped) { 14152 for (; i < j; i++) { 14153 callback(elements[i]); 14154 } 14155 } else { 14156 callback(elements); 14157 } 14158 } 14159 14160 /** 14161 * Class for dimension change detection. 14162 * 14163 * @param {Element|Element[]|Elements|jQuery} element 14164 * @param {Function} callback 14165 * 14166 * @constructor 14167 */ 14168 var ResizeSensor = function(element, callback) { 14169 /** 14170 * 14171 * @constructor 14172 */ 14173 function EventQueue() { 14174 var q = []; 14175 this.add = function(ev) { 14176 q.push(ev); 14177 }; 14178 14179 var i, j; 14180 this.call = function() { 14181 for (i = 0, j = q.length; i < j; i++) { 14182 q[i].call(); 14183 } 14184 }; 14185 14186 this.remove = function(ev) { 14187 var newQueue = []; 14188 for(i = 0, j = q.length; i < j; i++) { 14189 if(q[i] !== ev) newQueue.push(q[i]); 14190 } 14191 q = newQueue; 14192 } 14193 14194 this.length = function() { 14195 return q.length; 14196 } 14197 } 14198 14199 /** 14200 * 14201 * @param {HTMLElement} element 14202 * @param {Function} resized 14203 */ 14204 function attachResizeEvent(element, resized) { 14205 if (!element) return; 14206 if (element.resizedAttached) { 14207 element.resizedAttached.add(resized); 14208 return; 14209 } 14210 14211 element.resizedAttached = new EventQueue(); 14212 element.resizedAttached.add(resized); 14213 14214 element.resizeSensor = document.createElement('div'); 14215 element.resizeSensor.className = 'resize-sensor'; 14216 var style = 'position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;'; 14217 var styleChild = 'position: absolute; left: 0; top: 0; transition: 0s;'; 14218 14219 element.resizeSensor.style.cssText = style; 14220 element.resizeSensor.innerHTML = 14221 '<div class="resize-sensor-expand" style="' + style + '">' + 14222 '<div style="' + styleChild + '"></div>' + 14223 '</div>' + 14224 '<div class="resize-sensor-shrink" style="' + style + '">' + 14225 '<div style="' + styleChild + ' width: 200%; height: 200%"></div>' + 14226 '</div>'; 14227 element.appendChild(element.resizeSensor); 14228 14229 if (element.resizeSensor.offsetParent !== element) { 14230 element.style.position = 'relative'; 14231 } 14232 14233 var expand = element.resizeSensor.childNodes[0]; 14234 var expandChild = expand.childNodes[0]; 14235 var shrink = element.resizeSensor.childNodes[1]; 14236 var dirty, rafId, newWidth, newHeight; 14237 var lastWidth = element.offsetWidth; 14238 var lastHeight = element.offsetHeight; 14239 14240 var reset = function() { 14241 expandChild.style.width = '100000px'; 14242 expandChild.style.height = '100000px'; 14243 14244 expand.scrollLeft = 100000; 14245 expand.scrollTop = 100000; 14246 14247 shrink.scrollLeft = 100000; 14248 shrink.scrollTop = 100000; 14249 }; 14250 14251 reset(); 14252 14253 var onResized = function() { 14254 rafId = 0; 14255 14256 if (!dirty) return; 14257 14258 lastWidth = newWidth; 14259 lastHeight = newHeight; 14260 14261 if (element.resizedAttached) { 14262 element.resizedAttached.call(); 14263 } 14264 }; 14265 14266 var onScroll = function() { 14267 newWidth = element.offsetWidth; 14268 newHeight = element.offsetHeight; 14269 dirty = newWidth != lastWidth || newHeight != lastHeight; 14270
14271 if (dirty && !rafId) { 14272 rafId = requestAnimationFrame(onResized); 14273 } 14274 14275 reset(); 14276 }; 14277 14278 var addEvent = function(el, name, cb) { 14279 if (el.attachEvent) { 14280 el.attachEvent('on' + name, cb); 14281 } else { 14282 el.addEventListener(name, cb); 14283 } 14284 }; 14285 14286 addEvent(expand, 'scroll', onScroll); 14287 addEvent(shrink, 'scroll', onScroll); 14288 } 14289 14290 forEachElement(element, function(elem){ 14291 attachResizeEvent(elem, callback); 14292 }); 14293 14294 this.detach = function(ev) { 14295 ResizeSensor.detach(element, ev); 14296 }; 14297 }; 14298 14299 ResizeSensor.detach = function(element, ev) { 14300 forEachElement(element, function(elem){ 14301 if (!elem) return 14302 if(elem.resizedAttached && typeof ev == "function"){ 14303 elem.resizedAttached.remove(ev); 14304 if(elem.resizedAttached.length()) return; 14305 } 14306 if (elem.resizeSensor) { 14307 if (elem.contains(elem.resizeSensor)) { 14308 elem.removeChild(elem.resizeSensor); 14309 } 14310 delete elem.resizeSensor; 14311 delete elem.resizedAttached; 14312 } 14313 }); 14314 }; 14315 14316 return ResizeSensor; 14317 14318})); 14319(function (global, factory) { 14320 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 14321 typeof define === 'function' && define.amd ? define(['exports'], factory) : 14322 (factory((global.StickySidebar = {}))); 14323}(this, (function (exports) { 'use strict'; 14324 14325var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; 14326 14327 14328 14329function unwrapExports (x) { 14330 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; 14331} 14332 14333function createCommonjsModule(fn, module) { 14334 return module = { exports: {} }, fn(module, module.exports), module.exports; 14335} 14336 14337var stickySidebar = createCommonjsModule(function (module, exports) { 14338(function (global, factory) { 14339 if (typeof undefined === "function" && undefined.amd) { 14340 undefined(['exports'], factory); 14341 } else { 14342 factory(exports); 14343 } 14344})(commonjsGlobal, function (exports) { 14345 Object.defineProperty(exports, "__esModule", { 14346 value: true 14347 }); 14348 14349 function _classCallCheck(instance, Constructor) { 14350 if (!(instance instanceof Constructor)) { 14351 throw new TypeError("Cannot call a class as a function"); 14352 } 14353 } 14354 14355 var _createClass = function () { 14356 function defineProperties(target, props) { 14357 for (var i = 0; i < props.length; i++) { 14358 var descriptor = props[i]; 14359 descriptor.enumerable = descriptor.enumerable || false; 14360 descriptor.configurable = true; 14361 if ("value" in descriptor) descriptor.writable = true; 14362 Object.defineProperty(target, descriptor.key, descriptor); 14363 } 14364 } 14365 14366 return function (Constructor, protoProps, staticProps) { 14367 if (protoProps) defineProperties(Constructor.prototype, protoProps); 14368 if (staticProps) defineProperties(Constructor, staticProps); 14369 return Constructor; 14370 }; 14371 }(); 14372 14373 /** 14374 * Sticky Sidebar JavaScript Plugin. 14375 * @version 3.3.4 14376 * @author Ahmed Bouhuolia <[email protected]> 14377 * @license The MIT License (MIT) 14378 */ 14379 var StickySidebar = function () { 14380 14381 // --------------------------------- 14382 // # Define Constants 14383 // --------------------------------- 14384 // 14385 var EVENT_KEY = '.stickySidebar'; 14386 var DEFAULTS = { 14387 /** 14388 * Additional top spacing of the element when it becomes sticky. 14389 * @type {Numeric|Function} 14390 */ 14391 topSpacing: 0, 14392 14393 /** 14394 * Additional bottom spacing of the element when it becomes sticky. 14395 * @type {Numeric|Function} 14396 */ 14397 bottomSpacing: 0, 14398 14399 /** 14400 * Container sidebar selector to know what the beginning and end of sticky element. 14401 * @type {String|False} 14402 */ 14403 containerSelector: false, 14404 14405 /** 14406 * Inner wrapper selector. 14407 * @type {String} 14408 */ 14409 innerWrapperSelector: '.inner-wrapper-sticky', 14410 14411 /** 14412 * The name of CSS class to apply to elements when they have become stuck. 14413 * @type {String|False} 14414 */ 14415 stickyClass: 'is-affixed', 14416 14417 /** 14418 * Detect when sidebar and its container change height so re-calculate their dimensions. 14419 * @type {Boolean} 14420 */ 14421 resizeSensor: true, 14422 14423 /** 14424 * The sidebar returns to its normal position if its width below this value. 14425 * @type {Numeric} 14426 */ 14427 minWidth: false 14428 }; 14429 14430 // --------------------------------- 14431 // # Class Definition 14432 // --------------------------------- 14433 // 14434 /** 14435 * Sticky Sidebar Class. 14436 * @public 14437 */ 14438 14439 var StickySidebar = function () { 14440 14441 /** 14442 * Sticky Sidebar Constructor. 14443 * @constructor 14444 * @param {HTMLElement|String} sidebar - The sidebar element or sidebar selector. 14445 * @param {Object}
vendor: 1,736 bytes, lines 14445-14501
14445 options - The options of sticky sidebar. 14446 */ 14447 function StickySidebar(sidebar) { 14448 var _this = this; 14449 14450 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 14451 14452 _classCallCheck(this, StickySidebar); 14453 14454 this.options = StickySidebar.extend(DEFAULTS, options); 14455 14456 // Sidebar element query if there's no one, throw error. 14457 this.sidebar = 'string' === typeof sidebar ? document.querySelector(sidebar) : sidebar; 14458 if ('undefined' === typeof this.sidebar) throw new Error("There is no specific sidebar element."); 14459 14460 this.sidebarInner = false; 14461 this.container = this.sidebar.parentElement; 14462 14463 // Current Affix Type of sidebar element. 14464 this.affixedType = 'STATIC'; 14465 this.direction = 'down'; 14466 this.support = { 14467 transform: false, 14468 transform3d: false 14469 }; 14470 14471 this._initialized = false; 14472 this._reStyle = false; 14473 this._breakpoint = false; 14474 14475 // Dimensions of sidebar, container and screen viewport. 14476 this.dimensions = { 14477 translateY: 0, 14478 maxTranslateY: 0, 14479 topSpacing: 0, 14480 lastTopSpacing: 0, 14481 bottomSpacing: 0, 14482 lastBottomSpacing: 0, 14483 sidebarHeight: 0, 14484 sidebarWidth: 0, 14485 containerTop: 0, 14486 containerHeight: 0, 14487 viewportHeight: 0, 14488 viewportTop: 0, 14489 lastViewportTop: 0 14490 }; 14491 14492 // Bind event handlers for referencability. 14493 ['handleEvent'].forEach(function (method) { 14494 _this[method] = _this[method].bind(_this); 14495 }); 14496 14497 // Initialize sticky sidebar for first time. 14498 this.initialize(); 14499 } 14500 14501 /**
14502 * Initializes the sticky sidebar by adding inner wrapper, define its container, 14503 * min-width breakpoint, calculating dimensions, adding helper classes and inline style. 14504 * @private 14505 */ 14506 14507 14508 _createClass(StickySidebar, [{ 14509 key: 'initialize', 14510 value: function initialize() { 14511 var _this2 = this; 14512 14513 this._setSupportFeatures(); 14514 14515 // Get sticky sidebar inner wrapper, if not found, will create one. 14516 if (this.options.innerWrapperSelector) { 14517 this.sidebarInner = this.sidebar.querySelector(this.options.innerWrapperSelector); 14518 14519 if (null === this.sidebarInner) this.sidebarInner = false; 14520 } 14521 14522 if (!this.sidebarInner) { 14523 var wrapper = document.createElement('div'); 14524 wrapper.setAttribute('class', 'inner-wrapper-sticky'); 14525 this.sidebar.appendChild(wrapper); 14526 14527 while (this.sidebar.firstChild != wrapper) { 14528 wrapper.appendChild(this.sidebar.firstChild); 14529 }this.sidebarInner = this.sidebar.querySelector('.inner-wrapper-sticky'); 14530 } 14531 14532 // Container wrapper of the sidebar. 14533 if (this.options.containerSelector) { 14534 var containers = document.querySelectorAll(this.options.containerSelector);
14535 containers = Array.prototype.slice.call(containers); 14536 14537 containers.forEach(function (container, item) { 14538 if (!container.contains(_this2.sidebar)) return; 14539 _this2.container = container; 14540 }); 14541 14542 if (!containers.length) throw new Error("The container does not contains on the sidebar."); 14543 } 14544 14545 // If top/bottom spacing is not function parse value to integer. 14546 if ('function' !== typeof this.options.topSpacing) this.options.topSpacing = parseInt(this.options.topSpacing) || 0; 14547 14548 if ('function' !== typeof this.options.bottomSpacing) this.options.bottomSpacing = parseInt(this.options.bottomSpacing) || 0; 14549 14550 // Breakdown sticky sidebar if screen width below `options.minWidth`. 14551 this._widthBreakpoint(); 14552 14553 // Calculate dimensions of sidebar, container and viewport. 14554 this.calcDimensions(); 14555 14556 // Affix sidebar in proper position. 14557 this.stickyPosition(); 14558 14559 // Bind all events. 14560 this.bindEvents(); 14561
14562 // Inform other properties the sticky sidebar is initialized. 14563 this._initialized = true; 14564 } 14565 }, { 14566 key: 'bindEvents', 14567 value: function bindEvents() { 14568 window.addEventListener('resize', this, { passive: true, capture: false }); 14569 window.addEventListener('scroll', this, { passive: true, capture: false }); 14570 14571 this.sidebar.addEventListener('update' + EVENT_KEY, this); 14572 14573 if (this.options.resizeSensor && 'undefined' !== typeof ResizeSensor) { 14574 new ResizeSensor(this.sidebarInner, this.handleEvent); 14575 new ResizeSensor(this.container, this.handleEvent); 14576 } 14577 } 14578 }, { 14579 key: 'handleEvent', 14580 value: function handleEvent(event) { 14581 this.updateSticky(event); 14582 } 14583 }, { 14584 key: 'calcDimensions', 14585 value: function calcDimensions() { 14586 if (this._breakpoint) return; 14587 var dims = this.dimensions; 14588 14589 // Container of sticky sidebar dimensions. 14590 dims.containerTop = StickySidebar.offsetRelative(this.container).top; 14591 dims.containerHeight = this.container.clientHeight; 14592 dims.containerBottom = dims.containerTop + dims.containerHeight; 14593 14594 // Sidebar dimensions. 14595 // Fix sidebarHeight not consider sidebar padding spacing issue. @CLHOM 14596 // dims.sidebarHeight = this.sidebarInner.offsetHeight; 14597 var paddingSpacing = parseInt(window.getComputedStyle(this.sidebar).paddingTop.replace('px', '')) + parseInt(window.getComputedStyle(this.sidebar).paddingBottom.replace('px', '')); 14598 dims.sidebarHeight = this.sidebarInner.offsetHeight + paddingSpacing; 14599 dims.sidebarWidth = this.sidebarInner.offsetWidth; 14600 14601 // Screen viewport dimensions. 14602 dims.viewportHeight = window.innerHeight; 14603 14604 // Maximum sidebar translate Y. 14605 dims.maxTranslateY = dims.containerHeight - dims.sidebarHeight; 14606 14607 this._calcDimensionsWithScroll(); 14608 } 14609 }, { 14610 key: '_calcDimensionsWithScroll', 14611 value: function _calcDimensionsWithScroll() { 14612 var dims = this.dimensions; 14613 14614 dims.sidebarLeft = StickySidebar.offsetRelative(this.sidebar).left; 14615 14616 dims.viewportTop = document.documentElement.scrollTop || document.body.scrollTop; 14617 dims.viewportBottom = dims.viewportTop + dims.viewportHeight; 14618 dims.viewportLeft = document.documentElement.scrollLeft || document.body.scrollLeft; 14619 14620 dims.topSpacing = this.options.topSpacing; 14621 dims.bottomSpacing = this.options.bottomSpacing; 14622 14623 if ('function' === typeof dims.topSpacing) dims.topSpacing = parseInt(dims.topSpacing(this.sidebar)) || 0; 14624 14625 if ('function' === typeof dims.bottomSpacing) dims.bottomSpacing = parseInt(dims.bottomSpacing(this.sidebar)) || 0; 14626 14627 if ('VIEWPORT-TOP' === this.affixedType) { 14628 // Adjust translate Y in the case decrease top spacing value. 14629 if (dims.topSpacing < dims.lastTopSpacing) { 14630 dims.translateY += dims.lastTopSpacing - dims.topSpacing; 14631 this._reStyle = true; 14632 } 14633 } else if ('VIEWPORT-BOTTOM' === this.affixedType) { 14634 // Adjust translate Y in the case decrease bottom spacing value. 14635 if (dims.bottomSpacing < dims.lastBottomSpacing) { 14636 dims.translateY += dims.lastBottomSpacing - dims.bottomSpacing; 14637 this._reStyle = true; 14638 } 14639 } 14640 14641 dims.lastTopSpacing = dims.topSpacing; 14642 dims.lastBottomSpacing = dims.bottomSpacing; 14643 } 14644 }, { 14645 key: 'isSidebarFitsViewport', 14646 value: function isSidebarFitsViewport() { 14647 var dims = this.dimensions; 14648 var offset = this.scrollDirection === 'down' ? dims.lastBottomSpacing : dims.lastTopSpacing; 14649 return this.dimensions.sidebarHeight + offset < this.dimensions.viewportHeight; 14650 } 14651 }, { 14652 key: 'observeScrollDir', 14653 value: function observeScrollDir() { 14654 var dims = this.dimensions; 14655 if (dims.lastViewportTop === dims.viewportTop) return; 14656 14657 var furthest = 'down' === this.direction ? Math.min : Math.max; 14658 14659 // If the browser is scrolling not in the same direction.
vendor: 4,548 bytes, lines 14660-14761
14660 if (dims.viewportTop === furthest(dims.viewportTop, dims.lastViewportTop)) this.direction = 'down' === this.direction ? 'up' : 'down'; 14661 } 14662 }, { 14663 key: 'getAffixType', 14664 value: function getAffixType() { 14665 this._calcDimensionsWithScroll(); 14666 var dims = this.dimensions; 14667 var colliderTop = dims.viewportTop + dims.topSpacing; 14668 var affixType = this.affixedType; 14669 14670 if (colliderTop <= dims.containerTop || dims.containerHeight <= dims.sidebarHeight) { 14671 dims.translateY = 0; 14672 affixType = 'STATIC'; 14673 } else { 14674 affixType = 'up' === this.direction ? this._getAffixTypeScrollingUp() : this._getAffixTypeScrollingDown(); 14675 } 14676 14677 // Make sure the translate Y is not bigger than container height. 14678 dims.translateY = Math.max(0, dims.translateY); 14679 dims.translateY = Math.min(dims.containerHeight, dims.translateY); 14680 dims.translateY = Math.round(dims.translateY); 14681 14682 dims.lastViewportTop = dims.viewportTop; 14683 return affixType; 14684 } 14685 }, { 14686 key: '_getAffixTypeScrollingDown', 14687 value: function _getAffixTypeScrollingDown() { 14688 var dims = this.dimensions; 14689 var sidebarBottom = dims.sidebarHeight + dims.containerTop; 14690 var colliderTop = dims.viewportTop + dims.topSpacing; 14691 var colliderBottom = dims.viewportBottom - dims.bottomSpacing; 14692 var affixType = this.affixedType; 14693 14694 if (this.isSidebarFitsViewport()) { 14695 if (dims.sidebarHeight + colliderTop >= dims.containerBottom) { 14696 dims.translateY = dims.containerBottom - sidebarBottom; 14697 affixType = 'CONTAINER-BOTTOM'; 14698 } else if (colliderTop >= dims.containerTop) { 14699 dims.translateY = colliderTop - dims.containerTop; 14700 affixType = 'VIEWPORT-TOP'; 14701 } 14702 } else { 14703 if (dims.containerBottom <= colliderBottom) { 14704 dims.translateY = dims.containerBottom - sidebarBottom; 14705 affixType = 'CONTAINER-BOTTOM'; 14706 } else if (sidebarBottom + dims.translateY <= colliderBottom) { 14707 dims.translateY = colliderBottom - sidebarBottom; 14708 affixType = 'VIEWPORT-BOTTOM'; 14709 } else if (dims.containerTop + dims.translateY <= colliderTop && 0 !== dims.translateY && dims.maxTranslateY !== dims.translateY) { 14710 affixType = 'VIEWPORT-UNBOTTOM'; 14711 } 14712 } 14713 14714 return affixType; 14715 } 14716 }, { 14717 key: '_getAffixTypeScrollingUp', 14718 value: function _getAffixTypeScrollingUp() { 14719 var dims = this.dimensions; 14720 var sidebarBottom = dims.sidebarHeight + dims.containerTop; 14721 var colliderTop = dims.viewportTop + dims.topSpacing; 14722 var colliderBottom = dims.viewportBottom - dims.bottomSpacing; 14723 var affixType = this.affixedType; 14724 14725 if (colliderTop <= dims.translateY + dims.containerTop) { 14726 dims.translateY = colliderTop - dims.containerTop; 14727 affixType = 'VIEWPORT-TOP'; 14728 } else if (dims.containerBottom <= colliderBottom) { 14729 dims.translateY = dims.containerBottom - sidebarBottom; 14730 affixType = 'CONTAINER-BOTTOM'; 14731 } else if (!this.isSidebarFitsViewport()) { 14732 14733 if (dims.containerTop <= colliderTop && 0 !== dims.translateY && dims.maxTranslateY !== dims.translateY) { 14734 affixType = 'VIEWPORT-UNBOTTOM'; 14735 } 14736 } 14737 14738 return affixType; 14739 } 14740 }, { 14741 key: '_getStyle', 14742 value: function _getStyle(affixType) { 14743 if ('undefined' === typeof affixType) return; 14744 14745 var style = { inner: {}, outer: {} }; 14746 var dims = this.dimensions; 14747 14748 switch (affixType) { 14749 case 'VIEWPORT-TOP': 14750 style.inner = { position: 'fixed', top: dims.topSpacing, 14751 left: dims.sidebarLeft - dims.viewportLeft, width: dims.sidebarWidth }; 14752 break; 14753 case 'VIEWPORT-BOTTOM': 14754 style.inner = { position: 'fixed', top: 'auto', left: dims.sidebarLeft, 14755 bottom: dims.bottomSpacing, width: dims.sidebarWidth }; 14756 break; 14757 case 'CONTAINER-BOTTOM': 14758 case 'VIEWPORT-UNBOTTOM': 14759 // Fix position fixed doesn't work when using -webkit-transform issue. @CLHOM 14760 // var translate = this._getTranslate(0, dims.translateY + 'px'); 14761 var translate = false;
vendor: 4,484 bytes, lines 14762-14870
14762 14763 if (translate) style.inner = { transform: translate };else style.inner = { position: 'absolute', top: dims.translateY, width: dims.sidebarWidth }; 14764 break; 14765 } 14766 14767 switch (affixType) { 14768 case 'VIEWPORT-TOP': 14769 case 'VIEWPORT-BOTTOM': 14770 case 'VIEWPORT-UNBOTTOM': 14771 case 'CONTAINER-BOTTOM': 14772 // Fix outer element width not set inner element position overflow issue. @CLHOM 14773 // style.outer = { height: dims.sidebarHeight, position: 'relative' }; 14774 style.outer = { width: dims.sidebarWidth, height: dims.sidebarHeight, position: 'relative' }; 14775 break; 14776 } 14777 14778 // Fix outer element width not set inner element position overflow issue. @CLHOM 14779 // style.outer = StickySidebar.extend({ height: '', position: '' }, style.outer); 14780 style.outer = StickySidebar.extend({ width: '', height: '', position: '' }, style.outer); 14781 // Fix left position not cosider left padding spacing issue. @CLHOM 14782 // style.inner = StickySidebar.extend({ position: 'relative', top: '', left: '', 14783 style.inner = StickySidebar.extend({ position: 'relative', top: '', 14784 bottom: '', width: '', transform: '' }, style.inner); 14785 14786 return style; 14787 } 14788 }, { 14789 key: 'stickyPosition', 14790 value: function stickyPosition(force) { 14791 if (this._breakpoint) return; 14792 14793 force = this._reStyle || force || false; 14794 14795 var offsetTop = this.options.topSpacing; 14796 var offsetBottom = this.options.bottomSpacing; 14797 14798 var affixType = this.getAffixType(); 14799 var style = this._getStyle(affixType); 14800 14801 if ((this.affixedType != affixType || force) && affixType) { 14802 var affixEvent = 'affix.' + affixType.toLowerCase().replace('viewport-', '') + EVENT_KEY; 14803 StickySidebar.eventTrigger(this.sidebar, affixEvent); 14804 14805 if ('STATIC' === affixType) StickySidebar.removeClass(this.sidebar, this.options.stickyClass);else StickySidebar.addClass(this.sidebar, this.options.stickyClass); 14806 14807 for (var key in style.outer) { 14808 var unit = 'number' === typeof style.outer[key] ? 'px' : ''; 14809 this.sidebar.style[key] = style.outer[key] + unit; 14810 } 14811 14812 for (var _key in style.inner) { 14813 var _unit = 'number' === typeof style.inner[_key] ? 'px' : ''; 14814 this.sidebarInner.style[_key] = style.inner[_key] + _unit; 14815 } 14816 14817 var affixedEvent = 'affixed.' + affixType.toLowerCase().replace('viewport-', '') + EVENT_KEY; 14818 StickySidebar.eventTrigger(this.sidebar, affixedEvent); 14819 } else { 14820 if (this._initialized) this.sidebarInner.style.left = style.inner.left; 14821 } 14822 14823 this.affixedType = affixType; 14824 } 14825 }, { 14826 key: '_widthBreakpoint', 14827 value: function _widthBreakpoint() { 14828 14829 if (window.innerWidth <= this.options.minWidth) { 14830 this._breakpoint = true; 14831 this.affixedType = 'STATIC'; 14832 14833 this.sidebar.removeAttribute('style'); 14834 StickySidebar.removeClass(this.sidebar, this.options.stickyClass); 14835 this.sidebarInner.removeAttribute('style'); 14836 } else { 14837 this._breakpoint = false; 14838 } 14839 } 14840 }, { 14841 key: 'updateSticky', 14842 value: function updateSticky() { 14843 var _this3 = this; 14844 14845 var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 14846 14847 if (this._running) return; 14848 this._running = true; 14849 14850 (function (eventType) { 14851 requestAnimationFrame(function () { 14852 switch (eventType) { 14853 // When browser is scrolling and re-calculate just dimensions 14854 // within scroll. 14855 case 'scroll': 14856 _this3._calcDimensionsWithScroll(); 14857 _this3.observeScrollDir(); 14858 _this3.stickyPosition(); 14859 break; 14860 14861 // When browser is resizing or there's no event, observe width 14862 // breakpoint and re-calculate dimensions. 14863 case 'resize': 14864 default: 14865 _this3._widthBreakpoint(); 14866 _this3.calcDimensions(); 14867 _this3.stickyPosition(true); 14868 break; 14869 } 14870 _this3._running = false;
vendor: 5,378 bytes, lines 14871-15019
14871 }); 14872 })(event.type); 14873 } 14874 }, { 14875 key: '_setSupportFeatures', 14876 value: function _setSupportFeatures() { 14877 var support = this.support; 14878 14879 support.transform = StickySidebar.supportTransform(); 14880 support.transform3d = StickySidebar.supportTransform(true); 14881 } 14882 }, { 14883 key: '_getTranslate', 14884 value: function _getTranslate() { 14885 var y = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; 14886 var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; 14887 var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; 14888 14889 if (this.support.transform3d) return 'translate3d(' + y + ', ' + x + ', ' + z + ')';else if (this.support.translate) return 'translate(' + y + ', ' + x + ')';else return false; 14890 } 14891 }, { 14892 key: 'destroy', 14893 value: function destroy() { 14894 window.removeEventListener('resize', this, { capture: false }); 14895 window.removeEventListener('scroll', this, { capture: false }); 14896 14897 this.sidebar.classList.remove(this.options.stickyClass); 14898 this.sidebar.style.minHeight = ''; 14899 14900 this.sidebar.removeEventListener('update' + EVENT_KEY, this); 14901 14902 var styleReset = { inner: {}, outer: {} }; 14903 14904 styleReset.inner = { position: '', top: '', left: '', bottom: '', width: '', transform: '' }; 14905 styleReset.outer = { height: '', position: '' }; 14906 14907 for (var key in styleReset.outer) { 14908 this.sidebar.style[key] = styleReset.outer[key]; 14909 }for (var _key2 in styleReset.inner) { 14910 this.sidebarInner.style[_key2] = styleReset.inner[_key2]; 14911 }if (this.options.resizeSensor && 'undefined' !== typeof ResizeSensor) { 14912 ResizeSensor.detach(this.sidebarInner, this.handleEvent); 14913 ResizeSensor.detach(this.container, this.handleEvent); 14914 } 14915 } 14916 }], [{ 14917 key: 'supportTransform', 14918 value: function supportTransform(transform3d) { 14919 var result = false, 14920 property = transform3d ? 'perspective' : 'transform', 14921 upper = property.charAt(0).toUpperCase() + property.slice(1), 14922 prefixes = ['Webkit', 'Moz', 'O', 'ms'], 14923 support = document.createElement('support'), 14924 style = support.style; 14925 14926 (property + ' ' + prefixes.join(upper + ' ') + upper).split(' ').forEach(function (property, i) { 14927 if (style[property] !== undefined) { 14928 result = property; 14929 return false; 14930 } 14931 }); 14932 return result; 14933 } 14934 }, { 14935 key: 'eventTrigger', 14936 value: function eventTrigger(element, eventName, data) { 14937 try { 14938 var event = new CustomEvent(eventName, { detail: data }); 14939 } catch (e) { 14940 var event = document.createEvent('CustomEvent'); 14941 event.initCustomEvent(eventName, true, true, data); 14942 } 14943 element.dispatchEvent(event); 14944 } 14945 }, { 14946 key: 'extend', 14947 value: function extend(defaults, options) { 14948 var results = {}; 14949 for (var key in defaults) { 14950 if ('undefined' !== typeof options[key]) results[key] = options[key];else results[key] = defaults[key]; 14951 } 14952 return results; 14953 } 14954 }, { 14955 key: 'offsetRelative', 14956 value: function offsetRelative(element) { 14957 var result = { left: 0, top: 0 }; 14958 14959 do { 14960 var offsetTop = element.offsetTop; 14961 var offsetLeft = element.offsetLeft; 14962 14963 if (!isNaN(offsetTop)) result.top += offsetTop; 14964 14965 if (!isNaN(offsetLeft)) result.left += offsetLeft; 14966 14967 element = 'BODY' === element.tagName ? element.parentElement : element.offsetParent; 14968 } while (element); 14969 return result; 14970 } 14971 }, { 14972 key: 'addClass', 14973 value: function addClass(element, className) { 14974 if (!StickySidebar.hasClass(element, className)) { 14975 if (element.classList) element.classList.add(className);else element.className += ' ' + className; 14976 } 14977 } 14978 }, { 14979 key: 'removeClass', 14980 value: function removeClass(element, className) { 14981 if (StickySidebar.hasClass(element, className)) { 14982 if (element.classList) element.classList.remove(className);else element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); 14983 } 14984 } 14985 }, { 14986 key: 'hasClass', 14987 value: function hasClass(element, className) { 14988 if (element.classList) return element.classList.contains(className);else return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className); 14989 } 14990 }, { 14991 key: 'defaults', 14992 get: function () { 14993 return DEFAULTS; 14994 } 14995 }]); 14996 14997 return StickySidebar; 14998 }(); 14999 15000 return StickySidebar; 15001 }(); 15002 15003 exports.default = StickySidebar; 15004 15005 15006 // Global 15007 // ------------------------- 15008 window.StickySidebar = StickySidebar; 15009}); 15010}); 15011 15012var stickySidebar$1 = unwrapExports(stickySidebar); 15013 15014exports['default'] = stickySidebar$1; 15015exports.__moduleExports = stickySidebar; 15016 15017Object.defineProperty(exports, '__esModule', { value: true }); 15018 15019})));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.