code
stringlengths 2
1.05M
|
---|
YUI.add('message-scroll',function(Y){
function MessageScroll (cfg){
cfg = cfg || {};
this._src = Y.one(cfg.src || '#messages');
this._cardWidth = cfg.width || 408;
this._src.one('ul.active');
this._ul = this._src.one('ul.active');
this._cards = this._src.one('div.populate');
this.init();
}
MessageScroll.prototype = {
init:function(){
this.bind();
this.position = 0;
this.populate(0);
this._ul.setStyle('transform','translate3d(-' + this._cardWidth + 'px,0,0)');
this._ul.addClass('moving');
this.checkSupport();
},
bind: function(){
this._src.on('webkitTransitionEnd',this._endTransition,this);
this._src.on('transitionend',this._endTransition,this);
this._ul.on("flick", Y.bind(this.flickHandler, this), {
minDistance: 5,
minVelocity: 0.2,
preventDefault: true
});
},
checkSupport: function (){
var notSupported = (Y.UA.opera || Y.UA.ie);
if(notSupported){
var tmpl = '<hgroup>' +
'<h1>Ups!, Browser not supported yet!</h1>' +
'<h2>I\'m working on it... Try with a Webkit browser in the meantime! :)</h2>' +
'</hgroup>';
Y.one('div [data-pos="0"]').setContent(tmpl);
}
},
populate: function(position){
var liPrev = this._ul.one('*'),
liCurrent = liPrev.next(),
liNext = liCurrent.next(),
contentLiPrev = liPrev.one('*'),
contentLiCurrent = liCurrent.one('*'),
contentLiNext = liNext.one('*');
this._cards.append(contentLiPrev);
this._cards.append(contentLiCurrent);
this._cards.append(contentLiNext);
//we check here the cards in case some new load update to the DOM
this._totalCards = this._cards.get('children').size();
positionNode = this._cards.one('div[data-pos="'+ position +'"]'),
prevNode = this._cards.one('div[data-pos="'+ (position-1) +'"]'),
nextNode = this._cards.one('div[data-pos="'+ (position+ 1) +'"]'),
liPrev.append(prevNode);
liCurrent.append(positionNode);
liNext.append(nextNode);
},
_endTransition:function(evt){
this.populate(this.position);
this._ul.setStyle('transform','translate3d(-' + this._cardWidth + 'px,0,0)');
this.moving = false;
},
flickHandler:function(evt){
var cardW = this._cardWidth,
dir = evt.flick.distance > 0 ? 0 : -2,
horizontal = evt.flick.axis == 'x',
move = 'translate3d('+ (dir * cardW) +'px,0,0)',
newPos = this.position + (dir < 0 ? 1 : -1);
if(horizontal && !this.moving && newPos>=0 && newPos<=this._totalCards-1){
this.position = newPos;
this.moving = true;
this._ul.setStyle('transform',move);
}
}
};
Y.MessageScroll = MessageScroll;
},"0.0.1",{
requires:['node','transition','event','event-delegate','event-gestures']
});
|
var gulp = require('gulp'),
name = require('gulp-rename'),
rework = require('gulp-rework'),
reworkNPM = require('rework-npm'),
reworkVars = require('rework-vars'),
includer = require('gulp-htmlincluder'),
classPrefix = require('rework-class-prefix'),
media = require('rework-custom-media'),
size = require('gulp-size'),
md = require('gulp-remarkable');
gulp.task('md', function() {
return gulp.src('modest.md')
.pipe(md({ html: true }))
.pipe(name('-markdown.html'))
.pipe(gulp.dest('example'));
});
gulp.task('html', ['md', 'css'], function() {
return gulp.src('example/*.html')
.pipe(includer())
.pipe(gulp.dest('./'));
});
gulp.task('css', function() {
return gulp.src('index.css')
.pipe(rework(reworkNPM(), classPrefix('modest-'), media(), reworkVars()))
.pipe(size({ gzip: true, showFiles: true }))
.pipe(name('modest.css'))
.pipe(gulp.dest('css'));
});
gulp.task('watch', function() {
gulp.watch(['*.md', '*.css'], function() {
gulp.start('default');
});
});
gulp.task('default', ['md', 'css', 'html', 'watch']);
|
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
/**
* Response for ListLoadBalancingRule API service call.
*/
class LoadBalancerLoadBalancingRuleListResult extends Array {
/**
* Create a LoadBalancerLoadBalancingRuleListResult.
* @member {string} [nextLink] The URL to get the next set of results.
*/
constructor() {
super();
}
/**
* Defines the metadata of LoadBalancerLoadBalancingRuleListResult
*
* @returns {object} metadata of LoadBalancerLoadBalancingRuleListResult
*
*/
mapper() {
return {
required: false,
serializedName: 'LoadBalancerLoadBalancingRuleListResult',
type: {
name: 'Composite',
className: 'LoadBalancerLoadBalancingRuleListResult',
modelProperties: {
value: {
required: false,
serializedName: '',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'LoadBalancingRuleElementType',
type: {
name: 'Composite',
className: 'LoadBalancingRule'
}
}
}
},
nextLink: {
required: false,
readOnly: true,
serializedName: 'nextLink',
type: {
name: 'String'
}
}
}
}
};
}
}
module.exports = LoadBalancerLoadBalancingRuleListResult;
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _ASTWalker = require('typhonjs-ast-walker/dist/ASTWalker');
var _ASTWalker2 = _interopRequireDefault(_ASTWalker);
var _Plugins = require('./Plugins');
var _Plugins2 = _interopRequireDefault(_Plugins);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**
* Provides a runtime to invoke ESComplexModule plugins for processing / metrics calculations of independent modules.
*/
var ESComplexModule = function () {
/**
* Initializes ESComplexModule.
*
* @param {object} options - module options including user plugins to load including:
* ```
* (boolean) loadDefaultPlugins - When false ESComplexModule will not load any default plugins.
* (Array<Object>) plugins - A list of ESComplexModule plugins that have already been instantiated.
* ```
*/
function ESComplexModule() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
_classCallCheck(this, ESComplexModule);
/* istanbul ignore if */
if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) !== 'object') {
throw new TypeError('ctor error: `options` is not an `object`.');
}
/**
* Provides dispatch methods to all module plugins.
* @type {Plugins}
* @private
*/
this._plugins = new _Plugins2.default(options);
}
/**
* Processes the given ast and calculates metrics via plugins.
*
* @param {object|Array} ast - Javascript AST.
* @param {object} options - (Optional) module analyze options.
*
* @returns {ModuleReport} - A single module report.
*/
_createClass(ESComplexModule, [{
key: 'analyze',
value: function analyze(ast) {
var _this = this;
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
if ((typeof ast === 'undefined' ? 'undefined' : _typeof(ast)) !== 'object' || Array.isArray(ast)) {
throw new TypeError('analyze error: `ast` is not an `object` or `array`.');
}
/* istanbul ignore if */
if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) !== 'object') {
throw new TypeError('analyze error: `options` is not an `object`.');
}
var settings = this._plugins.onConfigure(options);
var syntaxes = this._plugins.onLoadSyntax(settings);
var report = this._plugins.onModuleStart(ast, syntaxes, settings);
// Completely traverse the provided AST and defer to plugins to process node traversal.
new _ASTWalker2.default().traverse(ast, {
enterNode: function enterNode(node, parent) {
return _this._plugins.onEnterNode(report, node, parent);
},
exitNode: function exitNode(node, parent) {
return _this._plugins.onExitNode(report, node, parent);
}
});
this._plugins.onModuleEnd(report);
return report.finalize();
}
// Asynchronous Promise based methods ----------------------------------------------------------------------------
/**
* Wraps in a Promise processing the given ast and calculates metrics via plugins.
*
* @param {object|Array} ast - Javascript AST.
* @param {object} options - (Optional) module analyze options.
*
* @returns {Promise<ModuleReport>} - A single module report.
*/
}, {
key: 'analyzeAsync',
value: function analyzeAsync(ast) {
var _this2 = this;
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
return new Promise(function (resolve, reject) {
try {
resolve(_this2.analyze(ast, options));
} catch (err) {
/* istanbul ignore next */reject(err);
}
});
}
}]);
return ESComplexModule;
}();
exports.default = ESComplexModule;
module.exports = exports['default'];
|
/* global app */
app.factory('notifier', ['toastr', function (toastr) {
'use strict';
return {
success: function (msg) {
toastr.success(msg);
},
error: function (msg) {
toastr.error(msg);
}
};
}]);
|
/*
* HTTP GET ์์ฒญ์ ๋ณด๋
๋๋ค.
*/
global.GET = METHOD({
run : (urlOrParams, responseListenerOrListeners) => {
//REQUIRED: urlOrParams
//OPTIONAL: urlOrParams.isSecure HTTPS ํ๋กํ ์ฝ์ธ์ง ์ฌ๋ถ
//OPTIONAL: urlOrParams.host
//OPTIONAL: urlOrParams.port
//OPTIONAL: urlOrParams.uri
//OPTIONAL: urlOrParams.url ์์ฒญ์ ๋ณด๋ผ URL. url์ ์
๋ ฅํ๋ฉด isSecure, host, port, uri๋ฅผ ์
๋ ฅํ ํ์๊ฐ ์์ต๋๋ค.
//OPTIONAL: urlOrParams.paramStr a=1&b=2&c=3๊ณผ ๊ฐ์ ํํ์ ํ๋ผ๋ฏธํฐ ๋ฌธ์์ด
//OPTIONAL: urlOrParams.params ๋ฐ์ดํฐ ํํ({...})๋ก ํํํ ํ๋ผ๋ฏธํฐ ๋ชฉ๋ก
//OPTIONAL: urlOrParams.data UPPERCASE ์น ์๋ฒ๋ก ๋ณด๋ผ ๋ฐ์ดํฐ. ์์ฒญ์ UPPERCASE๊ธฐ๋ฐ ์น ์๋ฒ๋ก ๋ณด๋ด๋ ๊ฒฝ์ฐ ๋ฐ์ดํฐ๋ฅผ ์ง์ ์ ์กํ ์ ์์ต๋๋ค.
//OPTIONAL: urlOrParams.headers ์์ฒญ ํค๋
//OPTIONAL: responseListenerOrListeners
//OPTIONAL: responseListenerOrListeners.error
//OPTIONAL: responseListenerOrListeners.success
if (CHECK_IS_DATA(urlOrParams) !== true) {
urlOrParams = {
url : urlOrParams
};
}
REQUEST(COMBINE([{
method : 'GET'
}, urlOrParams]), responseListenerOrListeners);
}
});
|
'use strict';
/**
* Similar to `LevelUtil` just a concise place to pull all the different formulae
* for stats
*/
const HealthPerStaminaTable = [
0, 14, 14, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19,
19, 20, 20, 20, 20, 22, 22, 22, 22, 24, 24, 24, 24, 25, 25, 26, 26, 26, 26,
28, 28, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 33, 34, 34, 34, 35,
35, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 38, 39,
40, 42, 42, 43, 43, 43, 44, 46, 47, 48, 48, 48, 49, 49, 49, 53, 55, 58, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60
];
exports.healthPerStamina = (level) => {
level = parseInt(level, 10);
return level in HealthPerStaminaTable ? HealthPerStaminaTable[level] : 1;
};
const AttributeTable = {
0: [ 0, 0, 0, 0 ],
1: [ 17, 10, 11, 8 ],
2: [ 19, 12, 12, 9 ],
3: [ 20, 12, 12, 10 ],
4: [ 21, 13, 13, 10 ],
5: [ 21, 13, 13, 10 ],
6: [ 21, 13, 13, 10 ],
7: [ 23, 14, 14, 11 ],
8: [ 24, 15, 15, 12 ],
9: [ 26, 16, 16, 12 ],
10: [ 27, 17, 17, 13 ],
11: [ 30, 18, 18, 14 ],
12: [ 33, 20, 20, 16 ],
13: [ 35, 21, 22, 17 ],
14: [ 38, 24, 24, 18 ],
15: [ 41, 25, 25, 20 ],
16: [ 44, 27, 27, 21 ],
17: [ 47, 28, 29, 23 ],
18: [ 51, 31, 31, 25 ],
19: [ 54, 33, 33, 26 ],
20: [ 56, 35, 35, 27 ],
21: [ 59, 36, 36, 29 ],
22: [ 63, 39, 39, 31 ],
23: [ 66, 40, 41, 32 ],
24: [ 70, 43, 43, 34 ],
25: [ 73, 45, 45, 35 ],
26: [ 76, 46, 47, 37 ],
27: [ 79, 48, 48, 38 ],
28: [ 83, 51, 51, 40 ],
29: [ 86, 53, 53, 42 ],
30: [ 88, 54, 54, 43 ],
31: [ 91, 56, 56, 44 ],
32: [ 94, 57, 58, 46 ],
33: [ 97, 60, 59, 47 ],
34: [ 102, 62, 63, 50 ],
35: [ 105, 64, 64, 51 ],
36: [ 108, 66, 66, 53 ],
37: [ 111, 68, 68, 54 ],
38: [ 114, 69, 70, 55 ],
39: [ 116, 71, 71, 57 ],
40: [ 121, 73, 74, 59 ],
41: [ 123, 75, 76, 60 ],
42: [ 126, 77, 77, 61 ],
43: [ 129, 79, 79, 63 ],
44: [ 132, 80, 81, 64 ],
45: [ 136, 83, 83, 66 ],
46: [ 140, 86, 86, 68 ],
47: [ 143, 87, 88, 70 ],
48: [ 146, 89, 89, 71 ],
49: [ 148, 91, 91, 72 ],
50: [ 151, 93, 93, 74 ],
51: [ 154, 94, 94, 75 ],
52: [ 158, 97, 97, 77 ],
53: [ 161, 98, 99, 78 ],
54: [ 164, 100, 100, 80 ],
55: [ 167, 102, 102, 81 ],
56: [ 171, 105, 105, 83 ],
57: [ 174, 106, 106, 85 ],
58: [ 176, 108, 108, 86 ],
59: [ 179, 109, 110, 87 ],
60: [ 183, 112, 112, 89 ],
61: [ 196, 120, 120, 96 ],
62: [ 208, 127, 128, 102 ],
63: [ 221, 135, 135, 108 ],
64: [ 224, 137, 137, 109 ],
65: [ 228, 139, 140, 111 ],
66: [ 231, 141, 141, 113 ],
67: [ 234, 143, 143, 114 ],
68: [ 236, 145, 145, 115 ],
69: [ 239, 146, 146, 117 ],
70: [ 252, 154, 154, 123 ],
71: [ 259, 158, 158, 126 ],
72: [ 271, 166, 166, 132 ],
73: [ 284, 174, 174, 139 ],
74: [ 287, 175, 175, 140 ],
75: [ 289, 177, 177, 141 ],
76: [ 292, 179, 179, 143 ],
77: [ 296, 181, 181, 145 ],
78: [ 299, 183, 183, 146 ],
79: [ 303, 186, 186, 148 ],
80: [ 309, 189, 189, 151 ],
81: [ 322, 197, 197, 157 ],
82: [ 334, 204, 204, 163 ],
83: [ 341, 208, 209, 167 ],
84: [ 344, 211, 210, 168 ],
85: [ 347, 212, 212, 169 ],
86: [ 359, 220, 220, 175 ],
87: [ 372, 227, 227, 182 ],
88: [ 384, 235, 235, 188 ],
89: [ 397, 242, 243, 194 ],
90: [ 409, 250, 250, 200 ],
91: [ 560, 343, 343, 274 ],
92: [ 662, 405, 405, 324 ],
93: [ 775, 474, 474, 379 ],
94: [ 908, 555, 555, 444 ],
95: [ 1066, 652, 652, 521 ],
96: [ 1254, 767, 767, 613 ],
97: [ 1304, 797, 797, 638 ],
98: [ 1355, 828, 828, 662 ],
99: [ 1405, 859, 859, 687 ],
100: [ 1455, 889, 890, 711 ],
101: [ 3971, 2426, 2429, 1941 ],
102: [ 4547, 2778, 2781, 2222 ],
103: [ 5201, 3178, 3182, 2542 ],
104: [ 5895, 3602, 3606, 2881 ],
105: [ 6478, 3958, 3962, 3165 ],
106: [ 7105, 4341, 4346, 3472 ],
107: [ 7740, 4729, 4734, 3782 ],
108: [ 8491, 5188, 5194, 4149 ],
109: [ 9323, 5697, 5703, 4556 ],
110: [ 10232, 6252, 6259, 5000 ]
};
/**
* Get base stats for a given level
* @param {string} name stat name
* @param {number} level
* @return {number}
*/
exports.baseAttributeByLevel = (name, level) => {
const index = ({
strength: 0,
agility: 1,
stamina: 2,
intellect: 3,
})[name];
if (!(level in AttributeTable)) {
level = 1;
}
return AttributeTable[level][index];
};
const ARReductionTable = [
0, 157, 167, 177, 187, 197, 207, 217, 227, 237, 247, 257, 267, 277, 287, 297, 307, 317,
327, 337, 347, 357, 367, 377, 387, 397, 407, 417, 427, 437, 447, 457, 467, 477, 487,
497, 507, 517, 527, 537, 547, 557, 567, 577, 587, 597, 607, 617, 627, 637, 647, 657,
667, 677, 687, 697, 707, 717, 727, 737, 747, 757, 767, 777, 787, 797, 807, 817, 827,
837, 847, 857, 867, 877, 887, 897, 907, 917, 927, 937, 947, 957, 967, 977, 987, 997,
1007, 1017, 1027, 1037, 1047, 1185, 1342, 1518, 1718, 1945, 2201, 2491, 2819, 3190,
3610, 5435, 5613, 5799, 5994, 6199, 6415, 6642, 6880, 7132, 7390, 7648, 7906, 8164
];
exports.getArmorReductionConstant = (level) => {
return ARReductionTable[level] || 0;
};
|
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _unstyled = require("@material-ui/unstyled");
var _system = require("@material-ui/system");
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
var _styled = _interopRequireDefault(require("../styles/styled"));
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
var _linearProgressClasses = require("./linearProgressClasses");
var _jsxRuntime = require("react/jsx-runtime");
const _excluded = ["className", "color", "value", "valueBuffer", "variant"];
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const TRANSITION_DURATION = 4; // seconds
const indeterminate1Keyframe = (0, _system.keyframes)`
0% {
left: -35%;
right: 100%;
}
60% {
left: 100%;
right: -90%;
}
100% {
left: 100%;
right: -90%;
}
`;
const indeterminate2Keyframe = (0, _system.keyframes)`
0% {
left: -200%;
right: 100%;
}
60% {
left: 107%;
right: -8%;
}
100% {
left: 107%;
right: -8%;
}
`;
const bufferKeyframe = (0, _system.keyframes)`
0% {
opacity: 1;
background-position: 0 -23px;
}
60% {
opacity: 0;
background-position: 0 -23px;
}
100% {
opacity: 1;
background-position: -200px -23px;
}
`;
const useUtilityClasses = styleProps => {
const {
classes,
variant,
color
} = styleProps;
const slots = {
root: ['root', `color${(0, _capitalize.default)(color)}`, variant],
dashed: ['dashed', `dashedColor${(0, _capitalize.default)(color)}`],
bar1: ['bar', `barColor${(0, _capitalize.default)(color)}`, (variant === 'indeterminate' || variant === 'query') && 'bar1Indeterminate', variant === 'determinate' && 'bar1Determinate', variant === 'buffer' && 'bar1Buffer'],
bar2: ['bar', variant !== 'buffer' && `barColor${(0, _capitalize.default)(color)}`, variant === 'buffer' && `color${(0, _capitalize.default)(color)}`, (variant === 'indeterminate' || variant === 'query') && 'bar2Indeterminate', variant === 'buffer' && 'bar2Buffer']
};
return (0, _unstyled.unstable_composeClasses)(slots, _linearProgressClasses.getLinearProgressUtilityClass, classes);
};
const getColorShade = (theme, color) => {
if (color === 'inherit') {
return 'currentColor';
}
return theme.palette.mode === 'light' ? (0, _system.lighten)(theme.palette[color].main, 0.62) : (0, _system.darken)(theme.palette[color].main, 0.5);
};
const LinearProgressRoot = (0, _styled.default)('span', {
name: 'MuiLinearProgress',
slot: 'Root',
overridesResolver: (props, styles) => {
const {
styleProps
} = props;
return [styles.root, styles[`color${(0, _capitalize.default)(styleProps.color)}`], styles[styleProps.variant]];
}
})(({
styleProps,
theme
}) => (0, _extends2.default)({
position: 'relative',
overflow: 'hidden',
display: 'block',
height: 4,
zIndex: 0,
// Fix Safari's bug during composition of different paint.
'@media print': {
colorAdjust: 'exact'
},
backgroundColor: getColorShade(theme, styleProps.color)
}, styleProps.color === 'inherit' && styleProps.variant !== 'buffer' && {
backgroundColor: 'none',
'&::before': {
content: '""',
position: 'absolute',
left: 0,
top: 0,
right: 0,
bottom: 0,
backgroundColor: 'currentColor',
opacity: 0.3
}
}, styleProps.variant === 'buffer' && {
backgroundColor: 'transparent'
}, styleProps.variant === 'query' && {
transform: 'rotate(180deg)'
}));
const LinearProgressDashed = (0, _styled.default)('span', {
name: 'MuiLinearProgress',
slot: 'Dashed',
overridesResolver: (props, styles) => {
const {
styleProps
} = props;
return [styles.dashed, styles[`dashedColor${(0, _capitalize.default)(styleProps.color)}`]];
}
})(({
styleProps,
theme
}) => {
const backgroundColor = getColorShade(theme, styleProps.color);
return (0, _extends2.default)({
position: 'absolute',
marginTop: 0,
height: '100%',
width: '100%'
}, styleProps.color === 'inherit' && {
opacity: 0.3
}, {
backgroundImage: `radial-gradient(${backgroundColor} 0%, ${backgroundColor} 16%, transparent 42%)`,
backgroundSize: '10px 10px',
backgroundPosition: '0 -23px'
});
}, (0, _system.css)`
animation: ${bufferKeyframe} 3s infinite linear;
`);
const LinearProgressBar1 = (0, _styled.default)('span', {
name: 'MuiLinearProgress',
slot: 'Bar1',
overridesResolver: (props, styles) => {
const {
styleProps
} = props;
return [styles.bar, styles[`barColor${(0, _capitalize.default)(styleProps.color)}`], (styleProps.variant === 'indeterminate' || styleProps.variant === 'query') && styles.bar1Indeterminate, styleProps.variant === 'determinate' && styles.bar1Determinate, styleProps.variant === 'buffer' && styles.bar1Buffer];
}
})(({
styleProps,
theme
}) => (0, _extends2.default)({
width: '100%',
position: 'absolute',
left: 0,
bottom: 0,
top: 0,
transition: 'transform 0.2s linear',
transformOrigin: 'left',
backgroundColor: styleProps.color === 'inherit' ? 'currentColor' : theme.palette[styleProps.color].main
}, styleProps.variant === 'determinate' && {
transition: `transform .${TRANSITION_DURATION}s linear`
}, styleProps.variant === 'buffer' && {
zIndex: 1,
transition: `transform .${TRANSITION_DURATION}s linear`
}), ({
styleProps
}) => (styleProps.variant === 'indeterminate' || styleProps.variant === 'query') && (0, _system.css)`
width: auto;
animation: ${indeterminate1Keyframe} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
`);
const LinearProgressBar2 = (0, _styled.default)('span', {
name: 'MuiLinearProgress',
slot: 'Bar2',
overridesResolver: (props, styles) => {
const {
styleProps
} = props;
return [styles.bar, styles[`barColor${(0, _capitalize.default)(styleProps.color)}`], (styleProps.variant === 'indeterminate' || styleProps.variant === 'query') && styles.bar2Indeterminate, styleProps.variant === 'buffer' && styles.bar2Buffer];
}
})(({
styleProps,
theme
}) => (0, _extends2.default)({
width: '100%',
position: 'absolute',
left: 0,
bottom: 0,
top: 0,
transition: 'transform 0.2s linear',
transformOrigin: 'left'
}, styleProps.variant !== 'buffer' && {
backgroundColor: styleProps.color === 'inherit' ? 'currentColor' : theme.palette[styleProps.color].main
}, styleProps.color === 'inherit' && {
opacity: 0.3
}, styleProps.variant === 'buffer' && {
backgroundColor: getColorShade(theme, styleProps.color),
transition: `transform .${TRANSITION_DURATION}s linear`
}), ({
styleProps
}) => (styleProps.variant === 'indeterminate' || styleProps.variant === 'query') && (0, _system.css)`
width: auto;
animation: ${indeterminate2Keyframe} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
`);
/**
* ## ARIA
*
* If the progress bar is describing the loading progress of a particular region of a page,
* you should use `aria-describedby` to point to the progress bar, and set the `aria-busy`
* attribute to `true` on that region until it has finished loading.
*/
const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inProps, ref) {
const props = (0, _useThemeProps.default)({
props: inProps,
name: 'MuiLinearProgress'
});
const {
className,
color = 'primary',
value,
valueBuffer,
variant = 'indeterminate'
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const styleProps = (0, _extends2.default)({}, props, {
color,
variant
});
const classes = useUtilityClasses(styleProps);
const theme = (0, _useTheme.default)();
const rootProps = {};
const inlineStyles = {
bar1: {},
bar2: {}
};
if (variant === 'determinate' || variant === 'buffer') {
if (value !== undefined) {
rootProps['aria-valuenow'] = Math.round(value);
rootProps['aria-valuemin'] = 0;
rootProps['aria-valuemax'] = 100;
let transform = value - 100;
if (theme.direction === 'rtl') {
transform = -transform;
}
inlineStyles.bar1.transform = `translateX(${transform}%)`;
} else if (process.env.NODE_ENV !== 'production') {
console.error('Material-UI: You need to provide a value prop ' + 'when using the determinate or buffer variant of LinearProgress .');
}
}
if (variant === 'buffer') {
if (valueBuffer !== undefined) {
let transform = (valueBuffer || 0) - 100;
if (theme.direction === 'rtl') {
transform = -transform;
}
inlineStyles.bar2.transform = `translateX(${transform}%)`;
} else if (process.env.NODE_ENV !== 'production') {
console.error('Material-UI: You need to provide a valueBuffer prop ' + 'when using the buffer variant of LinearProgress.');
}
}
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(LinearProgressRoot, (0, _extends2.default)({
className: (0, _clsx.default)(classes.root, className),
styleProps: styleProps,
role: "progressbar"
}, rootProps, {
ref: ref
}, other, {
children: [variant === 'buffer' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(LinearProgressDashed, {
className: classes.dashed,
styleProps: styleProps
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(LinearProgressBar1, {
className: classes.bar1,
styleProps: styleProps,
style: inlineStyles.bar1
}), variant === 'determinate' ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(LinearProgressBar2, {
className: classes.bar2,
styleProps: styleProps,
style: inlineStyles.bar2
})]
}));
});
process.env.NODE_ENV !== "production" ? LinearProgress.propTypes
/* remove-proptypes */
= {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* Override or extend the styles applied to the component.
*/
classes: _propTypes.default.object,
/**
* @ignore
*/
className: _propTypes.default.string,
/**
* The color of the component. It supports those theme colors that make sense for this component.
* @default 'primary'
*/
color: _propTypes.default
/* @typescript-to-proptypes-ignore */
.oneOfType([_propTypes.default.oneOf(['inherit', 'primary', 'secondary']), _propTypes.default.string]),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: _propTypes.default.object,
/**
* The value of the progress indicator for the determinate and buffer variants.
* Value between 0 and 100.
*/
value: _propTypes.default.number,
/**
* The value for the buffer variant.
* Value between 0 and 100.
*/
valueBuffer: _propTypes.default.number,
/**
* The variant to use.
* Use indeterminate or query when there is no progress value.
* @default 'indeterminate'
*/
variant: _propTypes.default.oneOf(['buffer', 'determinate', 'indeterminate', 'query'])
} : void 0;
var _default = LinearProgress;
exports.default = _default;
|
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var react = require('react');
var core = require('primereact/core');
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (_typeof(call) === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var StyleClass = /*#__PURE__*/function (_Component) {
_inherits(StyleClass, _Component);
var _super = _createSuper(StyleClass);
function StyleClass() {
_classCallCheck(this, StyleClass);
return _super.apply(this, arguments);
}
_createClass(StyleClass, [{
key: "enter",
value: function enter() {
var _this = this;
if (this.props.enterActiveClassName) {
if (!this.animating) {
this.animating = true;
if (this.props.enterActiveClassName === 'slidedown') {
this.target.style.height = '0px';
core.DomHandler.removeClass(this.target, 'hidden');
this.target.style.maxHeight = this.target.scrollHeight + 'px';
core.DomHandler.addClass(this.target, 'hidden');
this.target.style.height = '';
}
core.DomHandler.addClass(this.target, this.props.enterActiveClassName);
if (this.props.enterClassName) {
core.DomHandler.removeClass(this.target, this.props.enterClassName);
}
this.enterListener = function () {
core.DomHandler.removeClass(_this.target, _this.props.enterActiveClassName);
if (_this.props.enterToClassName) {
core.DomHandler.addClass(_this.target, _this.props.enterToClassName);
}
_this.target.removeEventListener('animationend', _this.enterListener);
if (_this.props.enterActiveClassName === 'slidedown') {
_this.target.style.maxHeight = '';
}
_this.animating = false;
};
this.target.addEventListener('animationend', this.enterListener);
}
} else {
if (this.props.enterClassName) {
core.DomHandler.removeClass(this.target, this.props.enterClassName);
}
if (this.props.enterToClassName) {
core.DomHandler.addClass(this.target, this.props.enterToClassName);
}
}
if (this.props.hideOnOutsideClick) {
this.bindDocumentListener();
}
}
}, {
key: "leave",
value: function leave() {
var _this2 = this;
if (this.props.leaveActiveClassName) {
if (!this.animating) {
this.animating = true;
core.DomHandler.addClass(this.target, this.props.leaveActiveClassName);
if (this.props.leaveClassName) {
core.DomHandler.removeClass(this.target, this.props.leaveClassName);
}
this.leaveListener = function () {
core.DomHandler.removeClass(_this2.target, _this2.props.leaveActiveClassName);
if (_this2.props.leaveToClassName) {
core.DomHandler.addClass(_this2.target, _this2.props.leaveToClassName);
}
_this2.target.removeEventListener('animationend', _this2.leaveListener);
_this2.animating = false;
};
this.target.addEventListener('animationend', this.leaveListener);
}
} else {
if (this.props.leaveClassName) {
core.DomHandler.removeClass(this.target, this.props.leaveClassName);
}
if (this.props.leaveToClassName) {
core.DomHandler.addClass(this.target, this.props.leaveToClassName);
}
}
if (this.props.hideOnOutsideClick) {
this.unbindDocumentListener();
}
}
}, {
key: "resolveTarget",
value: function resolveTarget() {
if (this.target) {
return this.target;
}
switch (this.props.selector) {
case '@next':
return this.el.nextElementSibling;
case '@prev':
return this.el.previousElementSibling;
case '@parent':
return this.el.parentElement;
case '@grandparent':
return this.el.parentElement.parentElement;
default:
return document.querySelector(this.props.selector);
}
}
}, {
key: "bindDocumentListener",
value: function bindDocumentListener() {
var _this3 = this;
if (!this.documentListener) {
this.documentListener = function (event) {
if (getComputedStyle(_this3.target).getPropertyValue('position') === 'static') {
_this3.unbindDocumentListener();
} else if (!_this3.el.isSameNode(event.target) && !_this3.el.contains(event.target) && !_this3.target.contains(event.target)) {
_this3.leave();
}
};
this.el.ownerDocument.addEventListener('click', this.documentListener);
}
}
}, {
key: "unbindDocumentListener",
value: function unbindDocumentListener() {
if (this.documentListener) {
this.el.ownerDocument.removeEventListener('click', this.documentListener);
this.documentListener = null;
}
}
}, {
key: "bindEvents",
value: function bindEvents() {
var _this4 = this;
this.clickListener = function () {
_this4.target = _this4.resolveTarget();
if (_this4.props.toggleClassName) {
if (core.DomHandler.hasClass(_this4.target, _this4.props.toggleClassName)) core.DomHandler.removeClass(_this4.target, _this4.props.toggleClassName);else core.DomHandler.addClass(_this4.target, _this4.props.toggleClassName);
} else {
if (_this4.target.offsetParent === null) _this4.enter();else _this4.leave();
}
};
this.el.addEventListener('click', this.clickListener);
}
}, {
key: "unbindEvents",
value: function unbindEvents() {
if (this.clickListener) {
this.el.removeEventListener('click', this.clickListener);
this.clickListener = null;
}
}
}, {
key: "el",
get: function get() {
var ref = this.props.nodeRef;
if (ref) {
return _typeof(ref) === 'object' && ref.hasOwnProperty('current') ? ref.current : ref;
}
return null;
}
}, {
key: "init",
value: function init() {
if (this.el) {
this.bindEvents();
}
}
}, {
key: "destroy",
value: function destroy() {
this.unbindEvents();
this.unbindDocumentListener();
this.target = null;
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
this.init();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps, prevState) {
if (prevProps.nodeRef !== this.props.nodeRef) {
this.destroy();
this.init();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.destroy();
}
}, {
key: "render",
value: function render() {
return this.props.children;
}
}]);
return StyleClass;
}(react.Component);
_defineProperty(StyleClass, "defaultProps", {
nodeRef: null,
selector: null,
enterClassName: null,
enterActiveClassName: null,
enterToClassName: null,
leaveClassName: null,
leaveActiveClassName: null,
leaveToClassName: null,
hideOnOutsideClick: false,
toggleClassName: null
});
exports.StyleClass = StyleClass;
|
/* *
*
* (c) 2010-2021 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
'use strict';
import A from '../Animation/AnimationUtilities.js';
var animObject = A.animObject;
import AxisDefaults from './AxisDefaults.js';
import Color from '../Color/Color.js';
import D from '../DefaultOptions.js';
var defaultOptions = D.defaultOptions;
import F from '../Foundation.js';
var registerEventOptions = F.registerEventOptions;
import H from '../Globals.js';
var deg2rad = H.deg2rad;
import Tick from './Tick.js';
import U from '../Utilities.js';
var arrayMax = U.arrayMax, arrayMin = U.arrayMin, clamp = U.clamp, correctFloat = U.correctFloat, defined = U.defined, destroyObjectProperties = U.destroyObjectProperties, erase = U.erase, error = U.error, extend = U.extend, fireEvent = U.fireEvent, getMagnitude = U.getMagnitude, isArray = U.isArray, isNumber = U.isNumber, isString = U.isString, merge = U.merge, normalizeTickInterval = U.normalizeTickInterval, objectEach = U.objectEach, pick = U.pick, relativeLength = U.relativeLength, removeEvent = U.removeEvent, splat = U.splat, syncTimeout = U.syncTimeout;
/* *
*
* Class
*
* */
/**
* Create a new axis object. Called internally when instanciating a new chart or
* adding axes by {@link Highcharts.Chart#addAxis}.
*
* A chart can have from 0 axes (pie chart) to multiples. In a normal, single
* series cartesian chart, there is one X axis and one Y axis.
*
* The X axis or axes are referenced by {@link Highcharts.Chart.xAxis}, which is
* an array of Axis objects. If there is only one axis, it can be referenced
* through `chart.xAxis[0]`, and multiple axes have increasing indices. The same
* pattern goes for Y axes.
*
* If you need to get the axes from a series object, use the `series.xAxis` and
* `series.yAxis` properties. These are not arrays, as one series can only be
* associated to one X and one Y axis.
*
* A third way to reference the axis programmatically is by `id`. Add an `id` in
* the axis configuration options, and get the axis by
* {@link Highcharts.Chart#get}.
*
* Configuration options for the axes are given in options.xAxis and
* options.yAxis.
*
* @class
* @name Highcharts.Axis
*
* @param {Highcharts.Chart} chart
* The Chart instance to apply the axis on.
*
* @param {Highcharts.AxisOptions} userOptions
* Axis options.
*/
var Axis = /** @class */ (function () {
/* *
*
* Constructors
*
* */
function Axis(chart, userOptions) {
this.alternateBands = void 0;
this.bottom = void 0;
this.categories = void 0;
this.chart = void 0;
this.closestPointRange = void 0;
this.coll = void 0;
this.eventOptions = void 0;
this.hasNames = void 0;
this.hasVisibleSeries = void 0;
this.height = void 0;
this.isLinked = void 0;
this.labelEdge = void 0; // @todo
this.labelFormatter = void 0;
this.left = void 0;
this.len = void 0;
this.max = void 0;
this.maxLabelLength = void 0;
this.min = void 0;
this.minorTickInterval = void 0;
this.minorTicks = void 0;
this.minPixelPadding = void 0;
this.names = void 0;
this.offset = void 0;
this.options = void 0;
this.overlap = void 0;
this.paddedTicks = void 0;
this.plotLinesAndBands = void 0;
this.plotLinesAndBandsGroups = void 0;
this.pointRange = void 0;
this.pointRangePadding = void 0;
this.pos = void 0;
this.positiveValuesOnly = void 0;
this.right = void 0;
this.series = void 0;
this.side = void 0;
this.tickAmount = void 0;
this.tickInterval = void 0;
this.tickmarkOffset = void 0;
this.tickPositions = void 0;
this.tickRotCorr = void 0;
this.ticks = void 0;
this.top = void 0;
this.transA = void 0;
this.transB = void 0;
this.translationSlope = void 0;
this.userOptions = void 0;
this.visible = void 0;
this.width = void 0;
this.zoomEnabled = void 0;
this.init(chart, userOptions);
}
/* *
*
* Functions
*
* */
/**
* Overrideable function to initialize the axis.
*
* @see {@link Axis}
*
* @function Highcharts.Axis#init
*
* @param {Highcharts.Chart} chart
* The Chart instance to apply the axis on.
*
* @param {AxisOptions} userOptions
* Axis options.
*
* @emits Highcharts.Axis#event:afterInit
* @emits Highcharts.Axis#event:init
*/
Axis.prototype.init = function (chart, userOptions) {
var isXAxis = userOptions.isX, axis = this;
/**
* The Chart that the axis belongs to.
*
* @name Highcharts.Axis#chart
* @type {Highcharts.Chart}
*/
axis.chart = chart;
/**
* Whether the axis is horizontal.
*
* @name Highcharts.Axis#horiz
* @type {boolean|undefined}
*/
axis.horiz = chart.inverted && !axis.isZAxis ? !isXAxis : isXAxis;
/**
* Whether the axis is the x-axis.
*
* @name Highcharts.Axis#isXAxis
* @type {boolean|undefined}
*/
axis.isXAxis = isXAxis;
/**
* The collection where the axis belongs, for example `xAxis`, `yAxis`
* or `colorAxis`. Corresponds to properties on Chart, for example
* {@link Chart.xAxis}.
*
* @name Highcharts.Axis#coll
* @type {string}
*/
axis.coll = axis.coll || (isXAxis ? 'xAxis' : 'yAxis');
fireEvent(this, 'init', { userOptions: userOptions });
// Needed in setOptions
axis.opposite = pick(userOptions.opposite, axis.opposite);
/**
* The side on which the axis is rendered. 0 is top, 1 is right, 2
* is bottom and 3 is left.
*
* @name Highcharts.Axis#side
* @type {number}
*/
axis.side = pick(userOptions.side, axis.side, (axis.horiz ?
(axis.opposite ? 0 : 2) : // top : bottom
(axis.opposite ? 1 : 3)) // right : left
);
/**
* Current options for the axis after merge of defaults and user's
* options.
*
* @name Highcharts.Axis#options
* @type {Highcharts.AxisOptions}
*/
axis.setOptions(userOptions);
var options = this.options, labelsOptions = options.labels, type = options.type;
/**
* User's options for this axis without defaults.
*
* @name Highcharts.Axis#userOptions
* @type {Highcharts.AxisOptions}
*/
axis.userOptions = userOptions;
axis.minPixelPadding = 0;
/**
* Whether the axis is reversed. Based on the `axis.reversed`,
* option, but inverted charts have reversed xAxis by default.
*
* @name Highcharts.Axis#reversed
* @type {boolean}
*/
axis.reversed = pick(options.reversed, axis.reversed);
axis.visible = options.visible;
axis.zoomEnabled = options.zoomEnabled;
// Initial categories
axis.hasNames =
type === 'category' || options.categories === true;
/**
* If categories are present for the axis, names are used instead of
* numbers for that axis.
*
* Since Highcharts 3.0, categories can also be extracted by giving each
* point a name and setting axis type to `category`. However, if you
* have multiple series, best practice remains defining the `categories`
* array.
*
* @see [xAxis.categories](/highcharts/xAxis.categories)
*
* @name Highcharts.Axis#categories
* @type {Array<string>}
* @readonly
*/
axis.categories = options.categories || axis.hasNames;
if (!axis.names) { // Preserve on update (#3830)
axis.names = [];
axis.names.keys = {};
}
// Placeholder for plotlines and plotbands groups
axis.plotLinesAndBandsGroups = {};
// Shorthand types
axis.positiveValuesOnly = !!axis.logarithmic;
// Flag, if axis is linked to another axis
axis.isLinked = defined(options.linkedTo);
/**
* List of major ticks mapped by postition on axis.
*
* @see {@link Highcharts.Tick}
*
* @name Highcharts.Axis#ticks
* @type {Highcharts.Dictionary<Highcharts.Tick>}
*/
axis.ticks = {};
axis.labelEdge = [];
/**
* List of minor ticks mapped by position on the axis.
*
* @see {@link Highcharts.Tick}
*
* @name Highcharts.Axis#minorTicks
* @type {Highcharts.Dictionary<Highcharts.Tick>}
*/
axis.minorTicks = {};
// List of plotLines/Bands
axis.plotLinesAndBands = [];
// Alternate bands
axis.alternateBands = {};
// Axis metrics
axis.len = 0;
axis.minRange = axis.userMinRange = options.minRange || options.maxZoom;
axis.range = options.range;
axis.offset = options.offset || 0;
/**
* The maximum value of the axis. In a logarithmic axis, this is the
* logarithm of the real value, and the real value can be obtained from
* {@link Axis#getExtremes}.
*
* @name Highcharts.Axis#max
* @type {number|null}
*/
axis.max = null;
/**
* The minimum value of the axis. In a logarithmic axis, this is the
* logarithm of the real value, and the real value can be obtained from
* {@link Axis#getExtremes}.
*
* @name Highcharts.Axis#min
* @type {number|null}
*/
axis.min = null;
/**
* The processed crosshair options.
*
* @name Highcharts.Axis#crosshair
* @type {boolean|Highcharts.AxisCrosshairOptions}
*/
var crosshair = pick(options.crosshair, splat(chart.options.tooltip.crosshairs)[isXAxis ? 0 : 1]);
axis.crosshair = crosshair === true ? {} : crosshair;
// Register. Don't add it again on Axis.update().
if (chart.axes.indexOf(axis) === -1) { //
if (isXAxis) { // #2713
chart.axes.splice(chart.xAxis.length, 0, axis);
}
else {
chart.axes.push(axis);
}
chart[axis.coll].push(axis);
}
/**
* All series associated to the axis.
*
* @name Highcharts.Axis#series
* @type {Array<Highcharts.Series>}
*/
axis.series = axis.series || []; // populated by Series
// Reversed axis
if (chart.inverted &&
!axis.isZAxis &&
isXAxis &&
typeof axis.reversed === 'undefined') {
axis.reversed = true;
}
axis.labelRotation = isNumber(labelsOptions.rotation) ?
labelsOptions.rotation :
void 0;
// Register event listeners
registerEventOptions(axis, options);
fireEvent(this, 'afterInit');
};
/**
* Merge and set options.
*
* @private
* @function Highcharts.Axis#setOptions
*
* @param {Highcharts.AxisOptions} userOptions
* Axis options.
*
* @emits Highcharts.Axis#event:afterSetOptions
*/
Axis.prototype.setOptions = function (userOptions) {
this.options = merge(AxisDefaults.defaultXAxisOptions, (this.coll === 'yAxis') && AxisDefaults.defaultYAxisOptions, [
AxisDefaults.defaultTopAxisOptions,
AxisDefaults.defaultRightAxisOptions,
AxisDefaults.defaultBottomAxisOptions,
AxisDefaults.defaultLeftAxisOptions
][this.side], merge(
// if set in setOptions (#1053):
defaultOptions[this.coll], userOptions));
fireEvent(this, 'afterSetOptions', { userOptions: userOptions });
};
/**
* The default label formatter. The context is a special config object for
* the label. In apps, use the
* [labels.formatter](https://api.highcharts.com/highcharts/xAxis.labels.formatter)
* instead, except when a modification is needed.
*
* @function Highcharts.Axis#defaultLabelFormatter
*
* @param {Highcharts.AxisLabelsFormatterContextObject} this
* Formatter context of axis label.
*
* @param {Highcharts.AxisLabelsFormatterContextObject} [ctx]
* Formatter context of axis label.
*
* @return {string}
* The formatted label content.
*/
Axis.prototype.defaultLabelFormatter = function (ctx) {
var axis = this.axis, chart = this.chart, numberFormatter = chart.numberFormatter, value = isNumber(this.value) ? this.value : NaN, time = axis.chart.time, categories = axis.categories, dateTimeLabelFormat = this.dateTimeLabelFormat, lang = defaultOptions.lang, numericSymbols = lang.numericSymbols, numSymMagnitude = lang.numericSymbolMagnitude || 1000,
// make sure the same symbol is added for all labels on a linear
// axis
numericSymbolDetector = axis.logarithmic ?
Math.abs(value) :
axis.tickInterval;
var i = numericSymbols && numericSymbols.length, multi, ret;
if (categories) {
ret = "" + this.value;
}
else if (dateTimeLabelFormat) { // datetime axis
ret = time.dateFormat(dateTimeLabelFormat, value);
}
else if (i && numericSymbolDetector >= 1000) {
// Decide whether we should add a numeric symbol like k (thousands)
// or M (millions). If we are to enable this in tooltip or other
// places as well, we can move this logic to the numberFormatter and
// enable it by a parameter.
while (i-- && typeof ret === 'undefined') {
multi = Math.pow(numSymMagnitude, i + 1);
if (
// Only accept a numeric symbol when the distance is more
// than a full unit. So for example if the symbol is k, we
// don't accept numbers like 0.5k.
numericSymbolDetector >= multi &&
// Accept one decimal before the symbol. Accepts 0.5k but
// not 0.25k. How does this work with the previous?
(value * 10) % multi === 0 &&
numericSymbols[i] !== null &&
value !== 0) { // #5480
ret = numberFormatter(value / multi, -1) + numericSymbols[i];
}
}
}
if (typeof ret === 'undefined') {
if (Math.abs(value) >= 10000) { // add thousands separators
ret = numberFormatter(value, -1);
}
else { // small numbers
ret = numberFormatter(value, -1, void 0, ''); // #2466
}
}
return ret;
};
/**
* Get the minimum and maximum for the series of each axis. The function
* analyzes the axis series and updates `this.dataMin` and `this.dataMax`.
*
* @private
* @function Highcharts.Axis#getSeriesExtremes
*
* @emits Highcharts.Axis#event:afterGetSeriesExtremes
* @emits Highcharts.Axis#event:getSeriesExtremes
*/
Axis.prototype.getSeriesExtremes = function () {
var axis = this, chart = axis.chart;
var xExtremes;
fireEvent(this, 'getSeriesExtremes', null, function () {
axis.hasVisibleSeries = false;
// Reset properties in case we're redrawing (#3353)
axis.dataMin = axis.dataMax = axis.threshold = null;
axis.softThreshold = !axis.isXAxis;
if (axis.stacking) {
axis.stacking.buildStacks();
}
// loop through this axis' series
axis.series.forEach(function (series) {
if (series.visible ||
!chart.options.chart.ignoreHiddenSeries) {
var seriesOptions = series.options;
var xData = void 0, threshold = seriesOptions.threshold, seriesDataMin = void 0, seriesDataMax = void 0;
axis.hasVisibleSeries = true;
// Validate threshold in logarithmic axes
if (axis.positiveValuesOnly && threshold <= 0) {
threshold = null;
}
// Get dataMin and dataMax for X axes
if (axis.isXAxis) {
xData = series.xData;
if (xData.length) {
var isPositive = function (number) { return number > 0; };
xData = axis.logarithmic ?
xData.filter(axis.validatePositiveValue) :
xData;
xExtremes = series.getXExtremes(xData);
// If xData contains values which is not numbers,
// then filter them out. To prevent performance hit,
// we only do this after we have already found
// seriesDataMin because in most cases all data is
// valid. #5234.
seriesDataMin = xExtremes.min;
seriesDataMax = xExtremes.max;
if (!isNumber(seriesDataMin) &&
// #5010:
!(seriesDataMin instanceof Date)) {
xData = xData.filter(isNumber);
xExtremes = series.getXExtremes(xData);
// Do it again with valid data
seriesDataMin = xExtremes.min;
seriesDataMax = xExtremes.max;
}
if (xData.length) {
axis.dataMin = Math.min(pick(axis.dataMin, seriesDataMin), seriesDataMin);
axis.dataMax = Math.max(pick(axis.dataMax, seriesDataMax), seriesDataMax);
}
}
// Get dataMin and dataMax for Y axes, as well as handle
// stacking and processed data
}
else {
// Get this particular series extremes
var dataExtremes = series.applyExtremes();
// Get the dataMin and dataMax so far. If percentage is
// used, the min and max are always 0 and 100. If
// seriesDataMin and seriesDataMax is null, then series
// doesn't have active y data, we continue with nulls
if (isNumber(dataExtremes.dataMin)) {
seriesDataMin = dataExtremes.dataMin;
axis.dataMin = Math.min(pick(axis.dataMin, seriesDataMin), seriesDataMin);
}
if (isNumber(dataExtremes.dataMax)) {
seriesDataMax = dataExtremes.dataMax;
axis.dataMax = Math.max(pick(axis.dataMax, seriesDataMax), seriesDataMax);
}
// Adjust to threshold
if (defined(threshold)) {
axis.threshold = threshold;
}
// If any series has a hard threshold, it takes
// precedence
if (!seriesOptions.softThreshold ||
axis.positiveValuesOnly) {
axis.softThreshold = false;
}
}
}
});
});
fireEvent(this, 'afterGetSeriesExtremes');
};
/**
* Translate from axis value to pixel position on the chart, or back. Use
* the `toPixels` and `toValue` functions in applications.
*
* @private
* @function Highcharts.Axis#translate
*/
Axis.prototype.translate = function (val, backwards, cvsCoord, old, handleLog, pointPlacement) {
var axis = (this.linkedParent || this), // #1417
localMin = old && axis.old ? axis.old.min : axis.min, minPixelPadding = axis.minPixelPadding, doPostTranslate = (axis.isOrdinal ||
axis.brokenAxis && axis.brokenAxis.hasBreaks ||
(axis.logarithmic && handleLog)) && axis.lin2val;
var sign = 1, cvsOffset = 0, localA = old && axis.old ? axis.old.transA : axis.transA, returnValue = 0;
if (!localA) {
localA = axis.transA;
}
// In vertical axes, the canvas coordinates start from 0 at the top like
// in SVG.
if (cvsCoord) {
sign *= -1; // canvas coordinates inverts the value
cvsOffset = axis.len;
}
// Handle reversed axis
if (axis.reversed) {
sign *= -1;
cvsOffset -= sign * (axis.sector || axis.len);
}
// From pixels to value
if (backwards) { // reverse translation
val = val * sign + cvsOffset;
val -= minPixelPadding;
// from chart pixel to value:
returnValue = val / localA + localMin;
if (doPostTranslate) { // log, ordinal and broken axis
returnValue = axis.lin2val(returnValue);
}
// From value to pixels
}
else {
if (doPostTranslate) { // log, ordinal and broken axis
val = axis.val2lin(val);
}
returnValue = isNumber(localMin) ?
(sign * (val - localMin) * localA +
cvsOffset +
(sign * minPixelPadding) +
(isNumber(pointPlacement) ?
localA * pointPlacement :
0)) :
void 0;
}
return returnValue;
};
/**
* Translate a value in terms of axis units into pixels within the chart.
*
* @function Highcharts.Axis#toPixels
*
* @param {number} value
* A value in terms of axis units.
*
* @param {boolean} paneCoordinates
* Whether to return the pixel coordinate relative to the chart or just the
* axis/pane itself.
*
* @return {number}
* Pixel position of the value on the chart or axis.
*/
Axis.prototype.toPixels = function (value, paneCoordinates) {
return this.translate(value, false, !this.horiz, null, true) +
(paneCoordinates ? 0 : this.pos);
};
/**
* Translate a pixel position along the axis to a value in terms of axis
* units.
*
* @function Highcharts.Axis#toValue
*
* @param {number} pixel
* The pixel value coordinate.
*
* @param {boolean} [paneCoordinates=false]
* Whether the input pixel is relative to the chart or just the axis/pane
* itself.
*
* @return {number}
* The axis value.
*/
Axis.prototype.toValue = function (pixel, paneCoordinates) {
return this.translate(pixel - (paneCoordinates ? 0 : this.pos), true, !this.horiz, null, true);
};
/**
* Create the path for a plot line that goes from the given value on
* this axis, across the plot to the opposite side. Also used internally for
* grid lines and crosshairs.
*
* @function Highcharts.Axis#getPlotLinePath
*
* @param {Highcharts.AxisPlotLinePathOptionsObject} options
* Options for the path.
*
* @return {Highcharts.SVGPathArray|null}
* The SVG path definition for the plot line.
*/
Axis.prototype.getPlotLinePath = function (options) {
var axis = this, chart = axis.chart, axisLeft = axis.left, axisTop = axis.top, old = options.old, value = options.value, lineWidth = options.lineWidth, cHeight = (old && chart.oldChartHeight) || chart.chartHeight, cWidth = (old && chart.oldChartWidth) || chart.chartWidth, transB = axis.transB;
var translatedValue = options.translatedValue, force = options.force, x1, y1, x2, y2, skip;
// eslint-disable-next-line valid-jsdoc
/**
* Check if x is between a and b. If not, either move to a/b
* or skip, depending on the force parameter.
* @private
*/
function between(x, a, b) {
if (force !== 'pass' && x < a || x > b) {
if (force) {
x = clamp(x, a, b);
}
else {
skip = true;
}
}
return x;
}
var evt = {
value: value,
lineWidth: lineWidth,
old: old,
force: force,
acrossPanes: options.acrossPanes,
translatedValue: translatedValue
};
fireEvent(this, 'getPlotLinePath', evt, function (e) {
translatedValue = pick(translatedValue, axis.translate(value, null, null, old));
// Keep the translated value within sane bounds, and avoid Infinity
// to fail the isNumber test (#7709).
translatedValue = clamp(translatedValue, -1e5, 1e5);
x1 = x2 = Math.round(translatedValue + transB);
y1 = y2 = Math.round(cHeight - translatedValue - transB);
if (!isNumber(translatedValue)) { // no min or max
skip = true;
force = false; // #7175, don't force it when path is invalid
}
else if (axis.horiz) {
y1 = axisTop;
y2 = cHeight - axis.bottom;
x1 = x2 = between(x1, axisLeft, axisLeft + axis.width);
}
else {
x1 = axisLeft;
x2 = cWidth - axis.right;
y1 = y2 = between(y1, axisTop, axisTop + axis.height);
}
e.path = skip && !force ?
null :
chart.renderer.crispLine([['M', x1, y1], ['L', x2, y2]], lineWidth || 1);
});
return evt.path;
};
/**
* Internal function to get the tick positions of a linear axis to round
* values like whole tens or every five.
*
* @function Highcharts.Axis#getLinearTickPositions
*
* @param {number} tickInterval
* The normalized tick interval.
*
* @param {number} min
* Axis minimum.
*
* @param {number} max
* Axis maximum.
*
* @return {Array<number>}
* An array of axis values where ticks should be placed.
*/
Axis.prototype.getLinearTickPositions = function (tickInterval, min, max) {
var roundedMin = correctFloat(Math.floor(min / tickInterval) * tickInterval), roundedMax = correctFloat(Math.ceil(max / tickInterval) * tickInterval), tickPositions = [];
var pos, lastPos, precision;
// When the precision is higher than what we filter out in
// correctFloat, skip it (#6183).
if (correctFloat(roundedMin + tickInterval) === roundedMin) {
precision = 20;
}
// For single points, add a tick regardless of the relative position
// (#2662, #6274)
if (this.single) {
return [min];
}
// Populate the intermediate values
pos = roundedMin;
while (pos <= roundedMax) {
// Place the tick on the rounded value
tickPositions.push(pos);
// Always add the raw tickInterval, not the corrected one.
pos = correctFloat(pos + tickInterval, precision);
// If the interval is not big enough in the current min - max range
// to actually increase the loop variable, we need to break out to
// prevent endless loop. Issue #619
if (pos === lastPos) {
break;
}
// Record the last value
lastPos = pos;
}
return tickPositions;
};
/**
* Resolve the new minorTicks/minorTickInterval options into the legacy
* loosely typed minorTickInterval option.
*
* @function Highcharts.Axis#getMinorTickInterval
*
* @return {number|"auto"|null}
* Legacy option
*/
Axis.prototype.getMinorTickInterval = function () {
var options = this.options;
if (options.minorTicks === true) {
return pick(options.minorTickInterval, 'auto');
}
if (options.minorTicks === false) {
return null;
}
return options.minorTickInterval;
};
/**
* Internal function to return the minor tick positions. For logarithmic
* axes, the same logic as for major ticks is reused.
*
* @function Highcharts.Axis#getMinorTickPositions
*
* @return {Array<number>}
* An array of axis values where ticks should be placed.
*/
Axis.prototype.getMinorTickPositions = function () {
var axis = this, options = axis.options, tickPositions = axis.tickPositions, minorTickInterval = axis.minorTickInterval, pointRangePadding = axis.pointRangePadding || 0, min = axis.min - pointRangePadding, // #1498
max = axis.max + pointRangePadding, // #1498
range = max - min;
var minorTickPositions = [], pos;
// If minor ticks get too dense, they are hard to read, and may cause
// long running script. So we don't draw them.
if (range && range / minorTickInterval < axis.len / 3) { // #3875
var logarithmic_1 = axis.logarithmic;
if (logarithmic_1) {
// For each interval in the major ticks, compute the minor ticks
// separately.
this.paddedTicks.forEach(function (_pos, i, paddedTicks) {
if (i) {
minorTickPositions.push.apply(minorTickPositions, logarithmic_1.getLogTickPositions(minorTickInterval, paddedTicks[i - 1], paddedTicks[i], true));
}
});
}
else if (axis.dateTime &&
this.getMinorTickInterval() === 'auto') { // #1314
minorTickPositions = minorTickPositions.concat(axis.getTimeTicks(axis.dateTime.normalizeTimeTickInterval(minorTickInterval), min, max, options.startOfWeek));
}
else {
for (pos = min + (tickPositions[0] - min) % minorTickInterval; pos <= max; pos += minorTickInterval) {
// Very, very, tight grid lines (#5771)
if (pos === minorTickPositions[0]) {
break;
}
minorTickPositions.push(pos);
}
}
}
if (minorTickPositions.length !== 0) {
axis.trimTicks(minorTickPositions); // #3652 #3743 #1498 #6330
}
return minorTickPositions;
};
/**
* Adjust the min and max for the minimum range. Keep in mind that the
* series data is not yet processed, so we don't have information on data
* cropping and grouping, or updated `axis.pointRange` or
* `series.pointRange`. The data can't be processed until we have finally
* established min and max.
*
* @private
* @function Highcharts.Axis#adjustForMinRange
*/
Axis.prototype.adjustForMinRange = function () {
var axis = this, options = axis.options, log = axis.logarithmic;
var min = axis.min, max = axis.max, zoomOffset, spaceAvailable, closestDataRange = 0, i, distance, xData, loopLength, minArgs, maxArgs, minRange;
// Set the automatic minimum range based on the closest point distance
if (axis.isXAxis &&
typeof axis.minRange === 'undefined' &&
!log) {
if (defined(options.min) ||
defined(options.max) ||
defined(options.floor) ||
defined(options.ceiling)) {
axis.minRange = null; // don't do this again
}
else {
// Find the closest distance between raw data points, as opposed
// to closestPointRange that applies to processed points
// (cropped and grouped)
axis.series.forEach(function (series) {
xData = series.xData;
loopLength = series.xIncrement ? 1 : xData.length - 1;
if (xData.length > 1) {
for (i = loopLength; i > 0; i--) {
distance = xData[i] - xData[i - 1];
if (!closestDataRange ||
distance < closestDataRange) {
closestDataRange = distance;
}
}
}
});
axis.minRange = Math.min(closestDataRange * 5, axis.dataMax - axis.dataMin);
}
}
// if minRange is exceeded, adjust
if (max - min < axis.minRange) {
spaceAvailable =
axis.dataMax - axis.dataMin >=
axis.minRange;
minRange = axis.minRange;
zoomOffset = (minRange - max + min) / 2;
// if min and max options have been set, don't go beyond it
minArgs = [
min - zoomOffset,
pick(options.min, min - zoomOffset)
];
// If space is available, stay within the data range
if (spaceAvailable) {
minArgs[2] = axis.logarithmic ?
axis.logarithmic.log2lin(axis.dataMin) :
axis.dataMin;
}
min = arrayMax(minArgs);
maxArgs = [
min + minRange,
pick(options.max, min + minRange)
];
// If space is availabe, stay within the data range
if (spaceAvailable) {
maxArgs[2] = log ?
log.log2lin(axis.dataMax) :
axis.dataMax;
}
max = arrayMin(maxArgs);
// now if the max is adjusted, adjust the min back
if (max - min < minRange) {
minArgs[0] = max - minRange;
minArgs[1] = pick(options.min, max - minRange);
min = arrayMax(minArgs);
}
}
// Record modified extremes
axis.min = min;
axis.max = max;
};
/**
* Find the closestPointRange across all series.
*
* @private
* @function Highcharts.Axis#getClosest
*/
Axis.prototype.getClosest = function () {
var ret;
if (this.categories) {
ret = 1;
}
else {
this.series.forEach(function (series) {
var seriesClosest = series.closestPointRange, visible = series.visible ||
!series.chart.options.chart.ignoreHiddenSeries;
if (!series.noSharedTooltip &&
defined(seriesClosest) &&
visible) {
ret = defined(ret) ?
Math.min(ret, seriesClosest) :
seriesClosest;
}
});
}
return ret;
};
/**
* When a point name is given and no x, search for the name in the existing
* categories, or if categories aren't provided, search names or create a
* new category (#2522).
*
* @private
* @function Highcharts.Axis#nameToX
*
* @param {Highcharts.Point} point
* The point to inspect.
*
* @return {number}
* The X value that the point is given.
*/
Axis.prototype.nameToX = function (point) {
var explicitCategories = isArray(this.categories), names = explicitCategories ? this.categories : this.names;
var nameX = point.options.x, x;
point.series.requireSorting = false;
if (!defined(nameX)) {
nameX = this.options.uniqueNames ?
(explicitCategories ?
names.indexOf(point.name) :
pick(names.keys[point.name], -1)) :
point.series.autoIncrement();
}
if (nameX === -1) { // Not found in currenct categories
if (!explicitCategories) {
x = names.length;
}
}
else {
x = nameX;
}
// Write the last point's name to the names array
if (typeof x !== 'undefined') {
this.names[x] = point.name;
// Backwards mapping is much faster than array searching (#7725)
this.names.keys[point.name] = x;
}
return x;
};
/**
* When changes have been done to series data, update the axis.names.
*
* @private
* @function Highcharts.Axis#updateNames
*/
Axis.prototype.updateNames = function () {
var axis = this, names = this.names, i = names.length;
if (i > 0) {
Object.keys(names.keys).forEach(function (key) {
delete (names.keys)[key];
});
names.length = 0;
this.minRange = this.userMinRange; // Reset
(this.series || []).forEach(function (series) {
// Reset incrementer (#5928)
series.xIncrement = null;
// When adding a series, points are not yet generated
if (!series.points || series.isDirtyData) {
// When we're updating the series with data that is longer
// than it was, and cropThreshold is passed, we need to make
// sure that the axis.max is increased _before_ running the
// premature processData. Otherwise this early iteration of
// processData will crop the points to axis.max, and the
// names array will be too short (#5857).
axis.max = Math.max(axis.max, series.xData.length - 1);
series.processData();
series.generatePoints();
}
series.data.forEach(function (point, i) {
var x;
if (point &&
point.options &&
typeof point.name !== 'undefined' // #9562
) {
x = axis.nameToX(point);
if (typeof x !== 'undefined' && x !== point.x) {
point.x = x;
series.xData[i] = x;
}
}
});
});
}
};
/**
* Update translation information.
*
* @private
* @function Highcharts.Axis#setAxisTranslation
*
* @emits Highcharts.Axis#event:afterSetAxisTranslation
*/
Axis.prototype.setAxisTranslation = function () {
var axis = this, range = axis.max - axis.min, linkedParent = axis.linkedParent, hasCategories = !!axis.categories, isXAxis = axis.isXAxis;
var pointRange = axis.axisPointRange || 0, closestPointRange, minPointOffset = 0, pointRangePadding = 0, ordinalCorrection, transA = axis.transA;
// Adjust translation for padding. Y axis with categories need to go
// through the same (#1784).
if (isXAxis || hasCategories || pointRange) {
// Get the closest points
closestPointRange = axis.getClosest();
if (linkedParent) {
minPointOffset = linkedParent.minPointOffset;
pointRangePadding = linkedParent.pointRangePadding;
}
else {
axis.series.forEach(function (series) {
var seriesPointRange = hasCategories ?
1 :
(isXAxis ?
pick(series.options.pointRange, closestPointRange, 0) :
(axis.axisPointRange || 0)), // #2806
pointPlacement = series.options.pointPlacement;
pointRange = Math.max(pointRange, seriesPointRange);
if (!axis.single || hasCategories) {
// TODO: series should internally set x- and y-
// pointPlacement to simplify this logic.
var isPointPlacementAxis = series.is('xrange') ?
!isXAxis :
isXAxis;
// minPointOffset is the value padding to the left of
// the axis in order to make room for points with a
// pointRange, typically columns. When the
// pointPlacement option is 'between' or 'on', this
// padding does not apply.
minPointOffset = Math.max(minPointOffset, isPointPlacementAxis && isString(pointPlacement) ?
0 :
seriesPointRange / 2);
// Determine the total padding needed to the length of
// the axis to make room for the pointRange. If the
// series' pointPlacement is 'on', no padding is added.
pointRangePadding = Math.max(pointRangePadding, isPointPlacementAxis && pointPlacement === 'on' ?
0 :
seriesPointRange);
}
});
}
// Record minPointOffset and pointRangePadding
ordinalCorrection = (axis.ordinal && axis.ordinal.slope && closestPointRange) ?
axis.ordinal.slope / closestPointRange :
1; // #988, #1853
axis.minPointOffset = minPointOffset =
minPointOffset * ordinalCorrection;
axis.pointRangePadding =
pointRangePadding = pointRangePadding * ordinalCorrection;
// pointRange means the width reserved for each point, like in a
// column chart
axis.pointRange = Math.min(pointRange, axis.single && hasCategories ? 1 : range);
// closestPointRange means the closest distance between points. In
// columns it is mostly equal to pointRange, but in lines pointRange
// is 0 while closestPointRange is some other value
if (isXAxis) {
axis.closestPointRange = closestPointRange;
}
}
// Secondary values
axis.translationSlope = axis.transA = transA =
axis.staticScale ||
axis.len / ((range + pointRangePadding) || 1);
// Translation addend
axis.transB = axis.horiz ? axis.left : axis.bottom;
axis.minPixelPadding = transA * minPointOffset;
fireEvent(this, 'afterSetAxisTranslation');
};
/**
* @private
* @function Highcharts.Axis#minFromRange
*/
Axis.prototype.minFromRange = function () {
var axis = this;
return axis.max - axis.range;
};
/**
* Set the tick positions to round values and optionally extend the extremes
* to the nearest tick.
*
* @private
* @function Highcharts.Axis#setTickInterval
*
* @param {boolean} secondPass
* TO-DO: parameter description
*
* @emits Highcharts.Axis#event:foundExtremes
*/
Axis.prototype.setTickInterval = function (secondPass) {
var axis = this, chart = axis.chart, log = axis.logarithmic, options = axis.options, isXAxis = axis.isXAxis, isLinked = axis.isLinked, tickPixelIntervalOption = options.tickPixelInterval, categories = axis.categories, softThreshold = axis.softThreshold;
var maxPadding = options.maxPadding, minPadding = options.minPadding, length, linkedParentExtremes,
// Only non-negative tickInterval is valid, #12961
tickIntervalOption = isNumber(options.tickInterval) && options.tickInterval >= 0 ?
options.tickInterval : void 0, threshold = isNumber(axis.threshold) ? axis.threshold : null, thresholdMin, thresholdMax, hardMin, hardMax;
if (!axis.dateTime && !categories && !isLinked) {
this.getTickAmount();
}
// Min or max set either by zooming/setExtremes or initial options
hardMin = pick(axis.userMin, options.min);
hardMax = pick(axis.userMax, options.max);
// Linked axis gets the extremes from the parent axis
if (isLinked) {
axis.linkedParent = chart[axis.coll][options.linkedTo];
linkedParentExtremes = axis.linkedParent.getExtremes();
axis.min = pick(linkedParentExtremes.min, linkedParentExtremes.dataMin);
axis.max = pick(linkedParentExtremes.max, linkedParentExtremes.dataMax);
if (options.type !== axis.linkedParent.options.type) {
// Can't link axes of different type
error(11, 1, chart);
}
// Initial min and max from the extreme data values
}
else {
// Adjust to hard threshold
if (softThreshold && defined(threshold)) {
if (axis.dataMin >= threshold) {
thresholdMin = threshold;
minPadding = 0;
}
else if (axis.dataMax <= threshold) {
thresholdMax = threshold;
maxPadding = 0;
}
}
axis.min = pick(hardMin, thresholdMin, axis.dataMin);
axis.max = pick(hardMax, thresholdMax, axis.dataMax);
}
if (log) {
if (axis.positiveValuesOnly &&
!secondPass &&
Math.min(axis.min, pick(axis.dataMin, axis.min)) <= 0) { // #978
// Can't plot negative values on log axis
error(10, 1, chart);
}
// The correctFloat cures #934, float errors on full tens. But it
// was too aggressive for #4360 because of conversion back to lin,
// therefore use precision 15.
axis.min = correctFloat(log.log2lin(axis.min), 16);
axis.max = correctFloat(log.log2lin(axis.max), 16);
}
// handle zoomed range
if (axis.range && defined(axis.max)) {
// #618, #6773:
axis.userMin = axis.min = hardMin =
Math.max(axis.dataMin, axis.minFromRange());
axis.userMax = hardMax = axis.max;
axis.range = null; // don't use it when running setExtremes
}
// Hook for Highcharts Stock Scroller.
// Consider combining with beforePadding.
fireEvent(axis, 'foundExtremes');
// Hook for adjusting this.min and this.max. Used by bubble series.
if (axis.beforePadding) {
axis.beforePadding();
}
// adjust min and max for the minimum range
axis.adjustForMinRange();
// Pad the values to get clear of the chart's edges. To avoid
// tickInterval taking the padding into account, we do this after
// computing tick interval (#1337).
if (!categories &&
!axis.axisPointRange &&
!(axis.stacking && axis.stacking.usePercentage) &&
!isLinked &&
defined(axis.min) &&
defined(axis.max)) {
length = axis.max - axis.min;
if (length) {
if (!defined(hardMin) && minPadding) {
axis.min -= length * minPadding;
}
if (!defined(hardMax) && maxPadding) {
axis.max += length * maxPadding;
}
}
}
// Handle options for floor, ceiling, softMin and softMax (#6359)
if (!isNumber(axis.userMin)) {
if (isNumber(options.softMin) && options.softMin < axis.min) {
axis.min = hardMin = options.softMin; // #6894
}
if (isNumber(options.floor)) {
axis.min = Math.max(axis.min, options.floor);
}
}
if (!isNumber(axis.userMax)) {
if (isNumber(options.softMax) && options.softMax > axis.max) {
axis.max = hardMax = options.softMax; // #6894
}
if (isNumber(options.ceiling)) {
axis.max = Math.min(axis.max, options.ceiling);
}
}
// When the threshold is soft, adjust the extreme value only if the data
// extreme and the padded extreme land on either side of the threshold.
// For example, a series of [0, 1, 2, 3] would make the yAxis add a tick
// for -1 because of the default minPadding and startOnTick options.
// This is prevented by the softThreshold option.
if (softThreshold && defined(axis.dataMin)) {
threshold = threshold || 0;
if (!defined(hardMin) &&
axis.min < threshold &&
axis.dataMin >= threshold) {
axis.min = axis.options.minRange ?
Math.min(threshold, axis.max -
axis.minRange) :
threshold;
}
else if (!defined(hardMax) &&
axis.max > threshold &&
axis.dataMax <= threshold) {
axis.max = axis.options.minRange ?
Math.max(threshold, axis.min +
axis.minRange) :
threshold;
}
}
// If min is bigger than highest, or if max less than lowest value, the
// chart should not render points. (#14417)
if (isNumber(axis.min) &&
isNumber(axis.max) &&
!this.chart.polar &&
(axis.min > axis.max)) {
if (defined(axis.options.min)) {
axis.max = axis.min;
}
else if (defined(axis.options.max)) {
axis.min = axis.max;
}
}
// get tickInterval
if (axis.min === axis.max ||
typeof axis.min === 'undefined' ||
typeof axis.max === 'undefined') {
axis.tickInterval = 1;
}
else if (isLinked &&
axis.linkedParent &&
!tickIntervalOption &&
tickPixelIntervalOption ===
axis.linkedParent.options.tickPixelInterval) {
axis.tickInterval = tickIntervalOption =
axis.linkedParent.tickInterval;
}
else {
axis.tickInterval = pick(tickIntervalOption, this.tickAmount ?
((axis.max - axis.min) /
Math.max(this.tickAmount - 1, 1)) :
void 0,
// For categoried axis, 1 is default, for linear axis use
// tickPix
categories ?
1 :
// don't let it be more than the data range
(axis.max - axis.min) *
tickPixelIntervalOption /
Math.max(axis.len, tickPixelIntervalOption));
}
// Now we're finished detecting min and max, crop and group series data.
// This is in turn needed in order to find tick positions in ordinal
// axes.
if (isXAxis && !secondPass) {
var hasExtemesChanged_1 = axis.min !== (axis.old && axis.old.min) ||
axis.max !== (axis.old && axis.old.max);
// First process all series assigned to that axis.
axis.series.forEach(function (series) {
// Allows filtering out points outside the plot area.
series.forceCrop = (series.forceCropping &&
series.forceCropping());
series.processData(hasExtemesChanged_1);
});
// Then apply grouping if needed. The hasExtemesChanged helps to
// decide if the data grouping should be skipped in the further
// calculations #16319.
fireEvent(this, 'postProcessData', { hasExtemesChanged: hasExtemesChanged_1 });
}
// set the translation factor used in translate function
axis.setAxisTranslation();
// hook for ordinal axes and radial axes
fireEvent(this, 'initialAxisTranslation');
// In column-like charts, don't cramp in more ticks than there are
// points (#1943, #4184)
if (axis.pointRange && !tickIntervalOption) {
axis.tickInterval = Math.max(axis.pointRange, axis.tickInterval);
}
// Before normalizing the tick interval, handle minimum tick interval.
// This applies only if tickInterval is not defined.
var minTickInterval = pick(options.minTickInterval,
// In datetime axes, don't go below the data interval, except when
// there are scatter-like series involved (#13369).
axis.dateTime &&
!axis.series.some(function (s) { return s.noSharedTooltip; }) ?
axis.closestPointRange : 0);
if (!tickIntervalOption && axis.tickInterval < minTickInterval) {
axis.tickInterval = minTickInterval;
}
// for linear axes, get magnitude and normalize the interval
if (!axis.dateTime && !axis.logarithmic && !tickIntervalOption) {
axis.tickInterval = normalizeTickInterval(axis.tickInterval, void 0, getMagnitude(axis.tickInterval), pick(options.allowDecimals,
// If the tick interval is greather than 0.5, avoid
// decimals, as linear axes are often used to render
// discrete values. #3363. If a tick amount is set, allow
// decimals by default, as it increases the chances for a
// good fit.
axis.tickInterval < 0.5 || this.tickAmount !== void 0), !!this.tickAmount);
}
// Prevent ticks from getting so close that we can't draw the labels
if (!this.tickAmount) {
axis.tickInterval = axis.unsquish();
}
this.setTickPositions();
};
/**
* Now we have computed the normalized tickInterval, get the tick positions.
*
* @private
* @function Highcharts.Axis#setTickPositions
*
* @emits Highcharts.Axis#event:afterSetTickPositions
*/
Axis.prototype.setTickPositions = function () {
var axis = this, options = this.options, tickPositionsOption = options.tickPositions, minorTickIntervalOption = this.getMinorTickInterval(), hasVerticalPanning = this.hasVerticalPanning(), isColorAxis = this.coll === 'colorAxis', startOnTick = ((isColorAxis || !hasVerticalPanning) && options.startOnTick), endOnTick = ((isColorAxis || !hasVerticalPanning) && options.endOnTick);
var tickPositions, tickPositioner = options.tickPositioner;
// Set the tickmarkOffset
this.tickmarkOffset = (this.categories &&
options.tickmarkPlacement === 'between' &&
this.tickInterval === 1) ? 0.5 : 0; // #3202
// get minorTickInterval
this.minorTickInterval =
minorTickIntervalOption === 'auto' &&
this.tickInterval ?
this.tickInterval / 5 :
minorTickIntervalOption;
// When there is only one point, or all points have the same value on
// this axis, then min and max are equal and tickPositions.length is 0
// or 1. In this case, add some padding in order to center the point,
// but leave it with one tick. #1337.
this.single =
this.min === this.max &&
defined(this.min) &&
!this.tickAmount &&
(
// Data is on integer (#6563)
parseInt(this.min, 10) === this.min ||
// Between integers and decimals are not allowed (#6274)
options.allowDecimals !== false);
/**
* Contains the current positions that are laid out on the axis. The
* positions are numbers in terms of axis values. In a category axis
* they are integers, in a datetime axis they are also integers, but
* designating milliseconds.
*
* This property is read only - for modifying the tick positions, use
* the `tickPositioner` callback or [axis.tickPositions(
* https://api.highcharts.com/highcharts/xAxis.tickPositions) option
* instead.
*
* @name Highcharts.Axis#tickPositions
* @type {Highcharts.AxisTickPositionsArray|undefined}
*/
this.tickPositions =
// Find the tick positions. Work on a copy (#1565)
tickPositions =
(tickPositionsOption && tickPositionsOption.slice());
if (!tickPositions) {
// Too many ticks (#6405). Create a friendly warning and provide two
// ticks so at least we can show the data series.
if ((!axis.ordinal || !axis.ordinal.positions) &&
((this.max - this.min) /
this.tickInterval >
Math.max(2 * this.len, 200))) {
tickPositions = [this.min, this.max];
error(19, false, this.chart);
}
else if (axis.dateTime) {
tickPositions = axis.getTimeTicks(axis.dateTime.normalizeTimeTickInterval(this.tickInterval, options.units), this.min, this.max, options.startOfWeek, axis.ordinal && axis.ordinal.positions, this.closestPointRange, true);
}
else if (axis.logarithmic) {
tickPositions = axis.logarithmic.getLogTickPositions(this.tickInterval, this.min, this.max);
}
else {
tickPositions = this.getLinearTickPositions(this.tickInterval, this.min, this.max);
}
// Too dense ticks, keep only the first and last (#4477)
if (tickPositions.length > this.len) {
tickPositions = [tickPositions[0], tickPositions.pop()];
// Reduce doubled value (#7339)
if (tickPositions[0] === tickPositions[1]) {
tickPositions.length = 1;
}
}
this.tickPositions = tickPositions;
// Run the tick positioner callback, that allows modifying auto tick
// positions.
if (tickPositioner) {
tickPositioner = tickPositioner.apply(axis, [this.min, this.max]);
if (tickPositioner) {
this.tickPositions = tickPositions = tickPositioner;
}
}
}
// Reset min/max or remove extremes based on start/end on tick
this.paddedTicks = tickPositions.slice(0); // Used for logarithmic minor
this.trimTicks(tickPositions, startOnTick, endOnTick);
if (!this.isLinked) {
// Substract half a unit (#2619, #2846, #2515, #3390),
// but not in case of multiple ticks (#6897)
if (this.single &&
tickPositions.length < 2 &&
!this.categories &&
!this.series.some(function (s) {
return (s.is('heatmap') && s.options.pointPlacement === 'between');
})) {
this.min -= 0.5;
this.max += 0.5;
}
if (!tickPositionsOption && !tickPositioner) {
this.adjustTickAmount();
}
}
fireEvent(this, 'afterSetTickPositions');
};
/**
* Handle startOnTick and endOnTick by either adapting to padding min/max or
* rounded min/max. Also handle single data points.
*
* @private
* @function Highcharts.Axis#trimTicks
*
* @param {Array<number>} tickPositions
* TO-DO: parameter description
*
* @param {boolean} [startOnTick]
* TO-DO: parameter description
*
* @param {boolean} [endOnTick]
* TO-DO: parameter description
*/
Axis.prototype.trimTicks = function (tickPositions, startOnTick, endOnTick) {
var roundedMin = tickPositions[0], roundedMax = tickPositions[tickPositions.length - 1], minPointOffset = (!this.isOrdinal && this.minPointOffset) || 0; // (#12716)
fireEvent(this, 'trimTicks');
if (!this.isLinked) {
if (startOnTick && roundedMin !== -Infinity) { // #6502
this.min = roundedMin;
}
else {
while (this.min - minPointOffset > tickPositions[0]) {
tickPositions.shift();
}
}
if (endOnTick) {
this.max = roundedMax;
}
else {
while (this.max + minPointOffset <
tickPositions[tickPositions.length - 1]) {
tickPositions.pop();
}
}
// If no tick are left, set one tick in the middle (#3195)
if (tickPositions.length === 0 &&
defined(roundedMin) &&
!this.options.tickPositions) {
tickPositions.push((roundedMax + roundedMin) / 2);
}
}
};
/**
* Check if there are multiple axes in the same pane.
*
* @private
* @function Highcharts.Axis#alignToOthers
*
* @return {boolean|undefined}
* True if there are other axes.
*/
Axis.prototype.alignToOthers = function () {
var axis = this, others = // Whether there is another axis to pair with this one
{}, options = axis.options;
var hasOther;
if (
// Only if alignTicks is true
this.chart.options.chart.alignTicks !== false &&
options.alignTicks &&
// Disabled when startOnTick or endOnTick are false (#7604)
options.startOnTick !== false &&
options.endOnTick !== false &&
// Don't try to align ticks on a log axis, they are not evenly
// spaced (#6021)
!axis.logarithmic) {
this.chart[this.coll].forEach(function (axis) {
var otherOptions = axis.options, horiz = axis.horiz, key = [
horiz ? otherOptions.left : otherOptions.top,
otherOptions.width,
otherOptions.height,
otherOptions.pane
].join(',');
if (axis.series.length) { // #4442
if (others[key]) {
hasOther = true; // #4201
}
else {
others[key] = 1;
}
}
});
}
return hasOther;
};
/**
* Find the max ticks of either the x and y axis collection, and record it
* in `this.tickAmount`.
*
* @private
* @function Highcharts.Axis#getTickAmount
*/
Axis.prototype.getTickAmount = function () {
var axis = this, options = this.options, tickPixelInterval = options.tickPixelInterval;
var tickAmount = options.tickAmount;
if (!defined(options.tickInterval) &&
!tickAmount &&
this.len < tickPixelInterval &&
!this.isRadial &&
!axis.logarithmic &&
options.startOnTick &&
options.endOnTick) {
tickAmount = 2;
}
if (!tickAmount && this.alignToOthers()) {
// Add 1 because 4 tick intervals require 5 ticks (including first
// and last)
tickAmount = Math.ceil(this.len / tickPixelInterval) + 1;
}
// For tick amounts of 2 and 3, compute five ticks and remove the
// intermediate ones. This prevents the axis from adding ticks that are
// too far away from the data extremes.
if (tickAmount < 4) {
this.finalTickAmt = tickAmount;
tickAmount = 5;
}
this.tickAmount = tickAmount;
};
/**
* When using multiple axes, adjust the number of ticks to match the highest
* number of ticks in that group.
*
* @private
* @function Highcharts.Axis#adjustTickAmount
*/
Axis.prototype.adjustTickAmount = function () {
var axis = this, axisOptions = axis.options, tickInterval = axis.tickInterval, tickPositions = axis.tickPositions, tickAmount = axis.tickAmount, finalTickAmt = axis.finalTickAmt, currentTickAmount = tickPositions && tickPositions.length, threshold = pick(axis.threshold, axis.softThreshold ? 0 : null);
var len, i;
if (axis.hasData() &&
isNumber(axis.min) &&
isNumber(axis.max)) { // #14769
if (currentTickAmount < tickAmount) {
while (tickPositions.length < tickAmount) {
// Extend evenly for both sides unless we're on the
// threshold (#3965)
if (tickPositions.length % 2 ||
axis.min === threshold) {
// to the end
tickPositions.push(correctFloat(tickPositions[tickPositions.length - 1] +
tickInterval));
}
else {
// to the start
tickPositions.unshift(correctFloat(tickPositions[0] - tickInterval));
}
}
axis.transA *= (currentTickAmount - 1) / (tickAmount - 1);
// Do not crop when ticks are not extremes (#9841)
axis.min = axisOptions.startOnTick ?
tickPositions[0] :
Math.min(axis.min, tickPositions[0]);
axis.max = axisOptions.endOnTick ?
tickPositions[tickPositions.length - 1] :
Math.max(axis.max, tickPositions[tickPositions.length - 1]);
// We have too many ticks, run second pass to try to reduce ticks
}
else if (currentTickAmount > tickAmount) {
axis.tickInterval *= 2;
axis.setTickPositions();
}
// The finalTickAmt property is set in getTickAmount
if (defined(finalTickAmt)) {
i = len = tickPositions.length;
while (i--) {
if (
// Remove every other tick
(finalTickAmt === 3 && i % 2 === 1) ||
// Remove all but first and last
(finalTickAmt <= 2 && i > 0 && i < len - 1)) {
tickPositions.splice(i, 1);
}
}
axis.finalTickAmt = void 0;
}
}
};
/**
* Set the scale based on data min and max, user set min and max or options.
*
* @private
* @function Highcharts.Axis#setScale
*
* @emits Highcharts.Axis#event:afterSetScale
*/
Axis.prototype.setScale = function () {
var axis = this;
var isDirtyData = false, isXAxisDirty = false;
axis.series.forEach(function (series) {
isDirtyData = isDirtyData || series.isDirtyData || series.isDirty;
// When x axis is dirty, we need new data extremes for y as
// well:
isXAxisDirty = (isXAxisDirty ||
(series.xAxis && series.xAxis.isDirty) ||
false);
});
// set the new axisLength
axis.setAxisSize();
var isDirtyAxisLength = axis.len !== (axis.old && axis.old.len);
// do we really need to go through all this?
if (isDirtyAxisLength ||
isDirtyData ||
isXAxisDirty ||
axis.isLinked ||
axis.forceRedraw ||
axis.userMin !== (axis.old && axis.old.userMin) ||
axis.userMax !== (axis.old && axis.old.userMax) ||
axis.alignToOthers()) {
if (axis.stacking) {
axis.stacking.resetStacks();
}
axis.forceRedraw = false;
// get data extremes if needed
axis.getSeriesExtremes();
// get fixed positions based on tickInterval
axis.setTickInterval();
// Mark as dirty if it is not already set to dirty and extremes have
// changed. #595.
if (!axis.isDirty) {
axis.isDirty =
isDirtyAxisLength ||
axis.min !== (axis.old && axis.old.min) ||
axis.max !== (axis.old && axis.old.max);
}
}
else if (axis.stacking) {
axis.stacking.cleanStacks();
}
// Recalculate panning state object, when the data
// has changed. It is required when vertical panning is enabled.
if (isDirtyData && axis.panningState) {
axis.panningState.isDirty = true;
}
fireEvent(this, 'afterSetScale');
};
/**
* Set the minimum and maximum of the axes after render time. If the
* `startOnTick` and `endOnTick` options are true, the minimum and maximum
* values are rounded off to the nearest tick. To prevent this, these
* options can be set to false before calling setExtremes. Also, setExtremes
* will not allow a range lower than the `minRange` option, which by default
* is the range of five points.
*
* @sample highcharts/members/axis-setextremes/
* Set extremes from a button
* @sample highcharts/members/axis-setextremes-datetime/
* Set extremes on a datetime axis
* @sample highcharts/members/axis-setextremes-off-ticks/
* Set extremes off ticks
* @sample stock/members/axis-setextremes/
* Set extremes in Highcharts Stock
*
* @function Highcharts.Axis#setExtremes
*
* @param {number} [newMin]
* The new minimum value.
*
* @param {number} [newMax]
* The new maximum value.
*
* @param {boolean} [redraw=true]
* Whether to redraw the chart or wait for an explicit call to
* {@link Highcharts.Chart#redraw}
*
* @param {boolean|Partial<Highcharts.AnimationOptionsObject>} [animation=true]
* Enable or modify animations.
*
* @param {*} [eventArguments]
* Arguments to be accessed in event handler.
*
* @emits Highcharts.Axis#event:setExtremes
*/
Axis.prototype.setExtremes = function (newMin, newMax, redraw, animation, eventArguments) {
var axis = this, chart = axis.chart;
redraw = pick(redraw, true); // defaults to true
axis.series.forEach(function (serie) {
delete serie.kdTree;
});
// Extend the arguments with min and max
eventArguments = extend(eventArguments, {
min: newMin,
max: newMax
});
// Fire the event
fireEvent(axis, 'setExtremes', eventArguments, function () {
axis.userMin = newMin;
axis.userMax = newMax;
axis.eventArgs = eventArguments;
if (redraw) {
chart.redraw(animation);
}
});
};
/**
* Overridable method for zooming chart. Pulled out in a separate method to
* allow overriding in stock charts.
*
* @private
* @function Highcharts.Axis#zoom
*/
Axis.prototype.zoom = function (newMin, newMax) {
var axis = this, dataMin = this.dataMin, dataMax = this.dataMax, options = this.options, min = Math.min(dataMin, pick(options.min, dataMin)), max = Math.max(dataMax, pick(options.max, dataMax)), evt = {
newMin: newMin,
newMax: newMax
};
fireEvent(this, 'zoom', evt, function (e) {
// Use e.newMin and e.newMax - event handlers may have altered them
var newMin = e.newMin, newMax = e.newMax;
if (newMin !== axis.min || newMax !== axis.max) { // #5790
// Prevent pinch zooming out of range. Check for defined is for
// #1946. #1734.
if (!axis.allowZoomOutside) {
// #6014, sometimes newMax will be smaller than min (or
// newMin will be larger than max).
if (defined(dataMin)) {
if (newMin < min) {
newMin = min;
}
if (newMin > max) {
newMin = max;
}
}
if (defined(dataMax)) {
if (newMax < min) {
newMax = min;
}
if (newMax > max) {
newMax = max;
}
}
}
// In full view, displaying the reset zoom button is not
// required
axis.displayBtn = (typeof newMin !== 'undefined' ||
typeof newMax !== 'undefined');
// Do it
axis.setExtremes(newMin, newMax, false, void 0, { trigger: 'zoom' });
}
e.zoomed = true;
});
return evt.zoomed;
};
/**
* Update the axis metrics.
*
* @private
* @function Highcharts.Axis#setAxisSize
*/
Axis.prototype.setAxisSize = function () {
var chart = this.chart, options = this.options,
// [top, right, bottom, left]
offsets = options.offsets || [0, 0, 0, 0], horiz = this.horiz,
// Check for percentage based input values. Rounding fixes problems
// with column overflow and plot line filtering (#4898, #4899)
width = this.width = Math.round(relativeLength(pick(options.width, chart.plotWidth - offsets[3] + offsets[1]), chart.plotWidth)), height = this.height = Math.round(relativeLength(pick(options.height, chart.plotHeight - offsets[0] + offsets[2]), chart.plotHeight)), top = this.top = Math.round(relativeLength(pick(options.top, chart.plotTop + offsets[0]), chart.plotHeight, chart.plotTop)), left = this.left = Math.round(relativeLength(pick(options.left, chart.plotLeft + offsets[3]), chart.plotWidth, chart.plotLeft));
// Expose basic values to use in Series object and navigator
this.bottom = chart.chartHeight - height - top;
this.right = chart.chartWidth - width - left;
// Direction agnostic properties
this.len = Math.max(horiz ? width : height, 0); // Math.max fixes #905
this.pos = horiz ? left : top; // distance from SVG origin
};
/**
* Get the current extremes for the axis.
*
* @sample highcharts/members/axis-getextremes/
* Report extremes by click on a button
*
* @function Highcharts.Axis#getExtremes
*
* @return {Highcharts.ExtremesObject}
* An object containing extremes information.
*/
Axis.prototype.getExtremes = function () {
var axis = this, log = axis.logarithmic;
return {
min: log ?
correctFloat(log.lin2log(axis.min)) :
axis.min,
max: log ?
correctFloat(log.lin2log(axis.max)) :
axis.max,
dataMin: axis.dataMin,
dataMax: axis.dataMax,
userMin: axis.userMin,
userMax: axis.userMax
};
};
/**
* Get the zero plane either based on zero or on the min or max value.
* Used in bar and area plots.
*
* @function Highcharts.Axis#getThreshold
*
* @param {number} threshold
* The threshold in axis values.
*
* @return {number|undefined}
* The translated threshold position in terms of pixels, and corrected to
* stay within the axis bounds.
*/
Axis.prototype.getThreshold = function (threshold) {
var axis = this, log = axis.logarithmic, realMin = log ? log.lin2log(axis.min) : axis.min, realMax = log ? log.lin2log(axis.max) : axis.max;
if (threshold === null || threshold === -Infinity) {
threshold = realMin;
}
else if (threshold === Infinity) {
threshold = realMax;
}
else if (realMin > threshold) {
threshold = realMin;
}
else if (realMax < threshold) {
threshold = realMax;
}
return axis.translate(threshold, 0, 1, 0, 1);
};
/**
* Compute auto alignment for the axis label based on which side the axis is
* on and the given rotation for the label.
*
* @private
* @function Highcharts.Axis#autoLabelAlign
*
* @param {number} rotation
* The rotation in degrees as set by either the `rotation` or `autoRotation`
* options.
*
* @return {Highcharts.AlignValue}
* Can be `"center"`, `"left"` or `"right"`.
*/
Axis.prototype.autoLabelAlign = function (rotation) {
var angle = (pick(rotation, 0) - (this.side * 90) + 720) % 360, evt = { align: 'center' };
fireEvent(this, 'autoLabelAlign', evt, function (e) {
if (angle > 15 && angle < 165) {
e.align = 'right';
}
else if (angle > 195 && angle < 345) {
e.align = 'left';
}
});
return evt.align;
};
/**
* Get the tick length and width for the axis based on axis options.
*
* @private
* @function Highcharts.Axis#tickSize
*
* @param {string} [prefix]
* 'tick' or 'minorTick'
*
* @return {Array<number,number>|undefined}
* An array of tickLength and tickWidth
*/
Axis.prototype.tickSize = function (prefix) {
var options = this.options, tickWidth = pick(options[prefix === 'tick' ? 'tickWidth' : 'minorTickWidth'],
// Default to 1 on linear and datetime X axes
prefix === 'tick' && this.isXAxis && !this.categories ? 1 : 0);
var tickLength = options[prefix === 'tick' ? 'tickLength' : 'minorTickLength'], tickSize;
if (tickWidth && tickLength) {
// Negate the length
if (options[prefix + 'Position'] === 'inside') {
tickLength = -tickLength;
}
tickSize = [tickLength, tickWidth];
}
var e = { tickSize: tickSize };
fireEvent(this, 'afterTickSize', e);
return e.tickSize;
};
/**
* Return the size of the labels.
*
* @private
* @function Highcharts.Axis#labelMetrics
*/
Axis.prototype.labelMetrics = function () {
var index = this.tickPositions && this.tickPositions[0] || 0;
return this.chart.renderer.fontMetrics(this.options.labels.style.fontSize, this.ticks[index] && this.ticks[index].label);
};
/**
* Prevent the ticks from getting so close we can't draw the labels. On a
* horizontal axis, this is handled by rotating the labels, removing ticks
* and adding ellipsis. On a vertical axis remove ticks and add ellipsis.
*
* @private
* @function Highcharts.Axis#unsquish
*/
Axis.prototype.unsquish = function () {
var labelOptions = this.options.labels, horiz = this.horiz, tickInterval = this.tickInterval, slotSize = this.len / (((this.categories ? 1 : 0) +
this.max -
this.min) /
tickInterval), rotationOption = labelOptions.rotation, labelMetrics = this.labelMetrics(), range = Math.max(this.max - this.min, 0),
// Return the multiple of tickInterval that is needed to avoid
// collision
getStep = function (spaceNeeded) {
var step = spaceNeeded / (slotSize || 1);
step = step > 1 ? Math.ceil(step) : 1;
// Guard for very small or negative angles (#9835)
if (step * tickInterval > range &&
spaceNeeded !== Infinity &&
slotSize !== Infinity &&
range) {
step = Math.ceil(range / tickInterval);
}
return correctFloat(step * tickInterval);
};
var newTickInterval = tickInterval, rotation, step, bestScore = Number.MAX_VALUE, autoRotation;
if (horiz) {
if (!labelOptions.staggerLines && !labelOptions.step) {
if (isNumber(rotationOption)) {
autoRotation = [rotationOption];
}
else if (slotSize < labelOptions.autoRotationLimit) {
autoRotation = labelOptions.autoRotation;
}
}
if (autoRotation) {
// Loop over the given autoRotation options, and determine
// which gives the best score. The best score is that with
// the lowest number of steps and a rotation closest
// to horizontal.
autoRotation.forEach(function (rot) {
var score;
if (rot === rotationOption ||
(rot && rot >= -90 && rot <= 90)) { // #3891
step = getStep(Math.abs(labelMetrics.h / Math.sin(deg2rad * rot)));
score = step + Math.abs(rot / 360);
if (score < bestScore) {
bestScore = score;
rotation = rot;
newTickInterval = step;
}
}
});
}
}
else if (!labelOptions.step) { // #4411
newTickInterval = getStep(labelMetrics.h);
}
this.autoRotation = autoRotation;
this.labelRotation = pick(rotation, isNumber(rotationOption) ? rotationOption : 0);
return newTickInterval;
};
/**
* Get the general slot width for labels/categories on this axis. This may
* change between the pre-render (from Axis.getOffset) and the final tick
* rendering and placement.
*
* @private
* @function Highcharts.Axis#getSlotWidth
*
* @param {Highcharts.Tick} [tick] Optionally, calculate the slot width
* basing on tick label. It is used in highcharts-3d module, where the slots
* has different widths depending on perspective angles.
*
* @return {number}
* The pixel width allocated to each axis label.
*/
Axis.prototype.getSlotWidth = function (tick) {
// #5086, #1580, #1931
var chart = this.chart, horiz = this.horiz, labelOptions = this.options.labels, slotCount = Math.max(this.tickPositions.length - (this.categories ? 0 : 1), 1), marginLeft = chart.margin[3];
// Used by grid axis
if (tick && isNumber(tick.slotWidth)) { // #13221, can be 0
return tick.slotWidth;
}
if (horiz && labelOptions.step < 2) {
if (labelOptions.rotation) { // #4415
return 0;
}
return ((this.staggerLines || 1) * this.len) / slotCount;
}
if (!horiz) {
// #7028
var cssWidth = labelOptions.style.width;
if (cssWidth !== void 0) {
return parseInt(String(cssWidth), 10);
}
if (marginLeft) {
return marginLeft - chart.spacing[3];
}
}
// Last resort, a fraction of the available size
return chart.chartWidth * 0.33;
};
/**
* Render the axis labels and determine whether ellipsis or rotation need to
* be applied.
*
* @private
* @function Highcharts.Axis#renderUnsquish
*/
Axis.prototype.renderUnsquish = function () {
var chart = this.chart, renderer = chart.renderer, tickPositions = this.tickPositions, ticks = this.ticks, labelOptions = this.options.labels, labelStyleOptions = labelOptions.style, horiz = this.horiz, slotWidth = this.getSlotWidth(), innerWidth = Math.max(1, Math.round(slotWidth - 2 * labelOptions.padding)), attr = {}, labelMetrics = this.labelMetrics(), textOverflowOption = labelStyleOptions.textOverflow;
var commonWidth, commonTextOverflow, maxLabelLength = 0, label, i, pos;
// Set rotation option unless it is "auto", like in gauges
if (!isString(labelOptions.rotation)) {
// #4443
attr.rotation = labelOptions.rotation || 0;
}
// Get the longest label length
tickPositions.forEach(function (tickPosition) {
var tick = ticks[tickPosition];
// Replace label - sorting animation
if (tick.movedLabel) {
tick.replaceMovedLabel();
}
if (tick &&
tick.label &&
tick.label.textPxLength > maxLabelLength) {
maxLabelLength = tick.label.textPxLength;
}
});
this.maxLabelLength = maxLabelLength;
// Handle auto rotation on horizontal axis
if (this.autoRotation) {
// Apply rotation only if the label is too wide for the slot, and
// the label is wider than its height.
if (maxLabelLength > innerWidth &&
maxLabelLength > labelMetrics.h) {
attr.rotation = this.labelRotation;
}
else {
this.labelRotation = 0;
}
// Handle word-wrap or ellipsis on vertical axis
}
else if (slotWidth) {
// For word-wrap or ellipsis
commonWidth = innerWidth;
if (!textOverflowOption) {
commonTextOverflow = 'clip';
// On vertical axis, only allow word wrap if there is room
// for more lines.
i = tickPositions.length;
while (!horiz && i--) {
pos = tickPositions[i];
label = ticks[pos].label;
if (label) {
// Reset ellipsis in order to get the correct
// bounding box (#4070)
if (label.styles &&
label.styles.textOverflow === 'ellipsis') {
label.css({ textOverflow: 'clip' });
// Set the correct width in order to read
// the bounding box height (#4678, #5034)
}
else if (label.textPxLength > slotWidth) {
label.css({ width: slotWidth + 'px' });
}
if (label.getBBox().height > (this.len / tickPositions.length -
(labelMetrics.h - labelMetrics.f))) {
label.specificTextOverflow = 'ellipsis';
}
}
}
}
}
// Add ellipsis if the label length is significantly longer than ideal
if (attr.rotation) {
commonWidth = (maxLabelLength > chart.chartHeight * 0.5 ?
chart.chartHeight * 0.33 :
maxLabelLength);
if (!textOverflowOption) {
commonTextOverflow = 'ellipsis';
}
}
// Set the explicit or automatic label alignment
this.labelAlign = labelOptions.align ||
this.autoLabelAlign(this.labelRotation);
if (this.labelAlign) {
attr.align = this.labelAlign;
}
// Apply general and specific CSS
tickPositions.forEach(function (pos) {
var tick = ticks[pos], label = tick && tick.label, widthOption = labelStyleOptions.width, css = {};
if (label) {
// This needs to go before the CSS in old IE (#4502)
label.attr(attr);
if (tick.shortenLabel) {
tick.shortenLabel();
}
else if (commonWidth &&
!widthOption &&
// Setting width in this case messes with the bounding box
// (#7975)
labelStyleOptions.whiteSpace !== 'nowrap' &&
(
// Speed optimizing, #7656
commonWidth < label.textPxLength ||
// Resetting CSS, #4928
label.element.tagName === 'SPAN')) {
css.width = commonWidth + 'px';
if (!textOverflowOption) {
css.textOverflow = (label.specificTextOverflow ||
commonTextOverflow);
}
label.css(css);
// Reset previously shortened label (#8210)
}
else if (label.styles &&
label.styles.width &&
!css.width &&
!widthOption) {
label.css({ width: null });
}
delete label.specificTextOverflow;
tick.rotation = attr.rotation;
}
}, this);
// Note: Why is this not part of getLabelPosition?
this.tickRotCorr = renderer.rotCorr(labelMetrics.b, this.labelRotation || 0, this.side !== 0);
};
/**
* Return true if the axis has associated data.
*
* @function Highcharts.Axis#hasData
*
* @return {boolean}
* True if the axis has associated visible series and those series have
* either valid data points or explicit `min` and `max` settings.
*/
Axis.prototype.hasData = function () {
return this.series.some(function (s) {
return s.hasData();
}) ||
(this.options.showEmpty &&
defined(this.min) &&
defined(this.max));
};
/**
* Adds the title defined in axis.options.title.
*
* @function Highcharts.Axis#addTitle
*
* @param {boolean} [display]
* Whether or not to display the title.
*/
Axis.prototype.addTitle = function (display) {
var axis = this, renderer = axis.chart.renderer, horiz = axis.horiz, opposite = axis.opposite, options = axis.options, axisTitleOptions = options.title, styledMode = axis.chart.styledMode;
var textAlign;
if (!axis.axisTitle) {
textAlign = axisTitleOptions.textAlign;
if (!textAlign) {
textAlign = (horiz ? {
low: 'left',
middle: 'center',
high: 'right'
} : {
low: opposite ? 'right' : 'left',
middle: 'center',
high: opposite ? 'left' : 'right'
})[axisTitleOptions.align];
}
axis.axisTitle = renderer
.text(axisTitleOptions.text || '', 0, 0, axisTitleOptions.useHTML)
.attr({
zIndex: 7,
rotation: axisTitleOptions.rotation,
align: textAlign
})
.addClass('highcharts-axis-title');
// #7814, don't mutate style option
if (!styledMode) {
axis.axisTitle.css(merge(axisTitleOptions.style));
}
axis.axisTitle.add(axis.axisGroup);
axis.axisTitle.isNew = true;
}
// Max width defaults to the length of the axis
if (!styledMode &&
!axisTitleOptions.style.width &&
!axis.isRadial) {
axis.axisTitle.css({
width: axis.len + 'px'
});
}
// hide or show the title depending on whether showEmpty is set
axis.axisTitle[display ? 'show' : 'hide'](display);
};
/**
* Generates a tick for initial positioning.
*
* @private
* @function Highcharts.Axis#generateTick
*
* @param {number} pos
* The tick position in axis values.
*
* @param {number} [i]
* The index of the tick in {@link Axis.tickPositions}.
*/
Axis.prototype.generateTick = function (pos) {
var axis = this, ticks = axis.ticks;
if (!ticks[pos]) {
ticks[pos] = new Tick(axis, pos);
}
else {
ticks[pos].addLabel(); // update labels depending on tick interval
}
};
/**
* Render the tick labels to a preliminary position to get their sizes
*
* @private
* @function Highcharts.Axis#getOffset
*
* @emits Highcharts.Axis#event:afterGetOffset
*/
Axis.prototype.getOffset = function () {
var _this = this;
var axis = this, chart = axis.chart, horiz = axis.horiz, options = axis.options, side = axis.side, ticks = axis.ticks, tickPositions = axis.tickPositions, coll = axis.coll, axisParent = axis.axisParent // Used in color axis
, renderer = chart.renderer, invertedSide = (chart.inverted && !axis.isZAxis ?
[1, 0, 3, 2][side] :
side), hasData = axis.hasData(), axisTitleOptions = options.title, labelOptions = options.labels, axisOffset = chart.axisOffset, clipOffset = chart.clipOffset, directionFactor = [-1, 1, 1, -1][side], className = options.className;
var showAxis, titleOffset = 0, titleOffsetOption, titleMargin = 0, labelOffset = 0, // reset
labelOffsetPadded, lineHeightCorrection;
// For reuse in Axis.render
axis.showAxis = showAxis = hasData || options.showEmpty;
// Set/reset staggerLines
axis.staggerLines = (axis.horiz && labelOptions.staggerLines) || void 0;
// Create the axisGroup and gridGroup elements on first iteration
if (!axis.axisGroup) {
var createGroup = function (name, suffix, zIndex) { return renderer.g(name)
.attr({ zIndex: zIndex })
.addClass("highcharts-" + coll.toLowerCase() + suffix + " " +
(_this.isRadial ? "highcharts-radial-axis" + suffix + " " : '') +
(className || ''))
.add(axisParent); };
axis.gridGroup = createGroup('grid', '-grid', options.gridZIndex);
axis.axisGroup = createGroup('axis', '', options.zIndex);
axis.labelGroup = createGroup('axis-labels', '-labels', labelOptions.zIndex);
}
if (hasData || axis.isLinked) {
// Generate ticks
tickPositions.forEach(function (pos) {
// i is not used here, but may be used in overrides
axis.generateTick(pos);
});
axis.renderUnsquish();
// Left side must be align: right and right side must
// have align: left for labels
axis.reserveSpaceDefault = (side === 0 ||
side === 2 ||
{ 1: 'left', 3: 'right' }[side] === axis.labelAlign);
if (pick(labelOptions.reserveSpace, axis.labelAlign === 'center' ? true : null, axis.reserveSpaceDefault)) {
tickPositions.forEach(function (pos) {
// get the highest offset
labelOffset = Math.max(ticks[pos].getLabelSize(), labelOffset);
});
}
if (axis.staggerLines) {
labelOffset *= axis.staggerLines;
}
axis.labelOffset = labelOffset * (axis.opposite ? -1 : 1);
}
else { // doesn't have data
objectEach(ticks, function (tick, n) {
tick.destroy();
delete ticks[n];
});
}
if (axisTitleOptions &&
axisTitleOptions.text &&
axisTitleOptions.enabled !== false) {
axis.addTitle(showAxis);
if (showAxis && axisTitleOptions.reserveSpace !== false) {
axis.titleOffset = titleOffset =
axis.axisTitle.getBBox()[horiz ? 'height' : 'width'];
titleOffsetOption = axisTitleOptions.offset;
titleMargin = defined(titleOffsetOption) ?
0 :
pick(axisTitleOptions.margin, horiz ? 5 : 10);
}
}
// Render the axis line
axis.renderLine();
// handle automatic or user set offset
axis.offset = directionFactor * pick(options.offset, axisOffset[side] ? axisOffset[side] + (options.margin || 0) : 0);
axis.tickRotCorr = axis.tickRotCorr || { x: 0, y: 0 }; // polar
if (side === 0) {
lineHeightCorrection = -axis.labelMetrics().h;
}
else if (side === 2) {
lineHeightCorrection = axis.tickRotCorr.y;
}
else {
lineHeightCorrection = 0;
}
// Find the padded label offset
labelOffsetPadded = Math.abs(labelOffset) + titleMargin;
if (labelOffset) {
labelOffsetPadded -= lineHeightCorrection;
labelOffsetPadded += directionFactor * (horiz ?
pick(labelOptions.y, axis.tickRotCorr.y + directionFactor * 8) :
labelOptions.x);
}
axis.axisTitleMargin = pick(titleOffsetOption, labelOffsetPadded);
if (axis.getMaxLabelDimensions) {
axis.maxLabelDimensions = axis.getMaxLabelDimensions(ticks, tickPositions);
}
// Due to GridAxis.tickSize, tickSize should be calculated after ticks
// has rendered.
if (coll !== 'colorAxis') {
var tickSize = this.tickSize('tick');
axisOffset[side] = Math.max(axisOffset[side], (axis.axisTitleMargin || 0) + titleOffset +
directionFactor * axis.offset, labelOffsetPadded, // #3027
tickPositions && tickPositions.length && tickSize ?
tickSize[0] + directionFactor * axis.offset :
0 // #4866
);
// Decide the clipping needed to keep the graph inside
// the plot area and axis lines
var clip = !axis.axisLine || options.offset ?
0 :
// #4308, #4371:
Math.floor(axis.axisLine.strokeWidth() / 2) * 2;
clipOffset[invertedSide] =
Math.max(clipOffset[invertedSide], clip);
}
fireEvent(this, 'afterGetOffset');
};
/**
* Internal function to get the path for the axis line. Extended for polar
* charts.
*
* @function Highcharts.Axis#getLinePath
*
* @param {number} lineWidth
* The line width in pixels.
*
* @return {Highcharts.SVGPathArray}
* The SVG path definition in array form.
*/
Axis.prototype.getLinePath = function (lineWidth) {
var chart = this.chart, opposite = this.opposite, offset = this.offset, horiz = this.horiz, lineLeft = this.left + (opposite ? this.width : 0) + offset, lineTop = chart.chartHeight - this.bottom -
(opposite ? this.height : 0) + offset;
if (opposite) {
lineWidth *= -1; // crispify the other way - #1480, #1687
}
return chart.renderer
.crispLine([
[
'M',
horiz ?
this.left :
lineLeft,
horiz ?
lineTop :
this.top
],
[
'L',
horiz ?
chart.chartWidth - this.right :
lineLeft,
horiz ?
lineTop :
chart.chartHeight - this.bottom
]
], lineWidth);
};
/**
* Render the axis line. Called internally when rendering and redrawing the
* axis.
*
* @function Highcharts.Axis#renderLine
*/
Axis.prototype.renderLine = function () {
if (!this.axisLine) {
this.axisLine = this.chart.renderer.path()
.addClass('highcharts-axis-line')
.add(this.axisGroup);
if (!this.chart.styledMode) {
this.axisLine.attr({
stroke: this.options.lineColor,
'stroke-width': this.options.lineWidth,
zIndex: 7
});
}
}
};
/**
* Position the axis title.
*
* @private
* @function Highcharts.Axis#getTitlePosition
*
* @return {Highcharts.PositionObject}
* X and Y positions for the title.
*/
Axis.prototype.getTitlePosition = function () {
// compute anchor points for each of the title align options
var horiz = this.horiz, axisLeft = this.left, axisTop = this.top, axisLength = this.len, axisTitleOptions = this.options.title, margin = horiz ? axisLeft : axisTop, opposite = this.opposite, offset = this.offset, xOption = axisTitleOptions.x, yOption = axisTitleOptions.y, axisTitle = this.axisTitle, fontMetrics = this.chart.renderer.fontMetrics(axisTitleOptions.style.fontSize, axisTitle),
// The part of a multiline text that is below the baseline of the
// first line. Subtract 1 to preserve pixel-perfectness from the
// old behaviour (v5.0.12), where only one line was allowed.
textHeightOvershoot = Math.max(axisTitle.getBBox(null, 0).height - fontMetrics.h - 1, 0),
// the position in the length direction of the axis
alongAxis = {
low: margin + (horiz ? 0 : axisLength),
middle: margin + axisLength / 2,
high: margin + (horiz ? axisLength : 0)
}[axisTitleOptions.align],
// the position in the perpendicular direction of the axis
offAxis = (horiz ? axisTop + this.height : axisLeft) +
(horiz ? 1 : -1) * // horizontal axis reverses the margin
(opposite ? -1 : 1) * // so does opposite axes
this.axisTitleMargin +
[
-textHeightOvershoot,
textHeightOvershoot,
fontMetrics.f,
-textHeightOvershoot // left
][this.side], titlePosition = {
x: horiz ?
alongAxis + xOption :
offAxis + (opposite ? this.width : 0) + offset + xOption,
y: horiz ?
offAxis + yOption - (opposite ? this.height : 0) + offset :
alongAxis + yOption
};
fireEvent(this, 'afterGetTitlePosition', { titlePosition: titlePosition });
return titlePosition;
};
/**
* Render a minor tick into the given position. If a minor tick already
* exists in this position, move it.
*
* @function Highcharts.Axis#renderMinorTick
*
* @param {number} pos
* The position in axis values.
*
* @param {boolean} slideIn
* Whether the tick should animate in from last computed position
*/
Axis.prototype.renderMinorTick = function (pos, slideIn) {
var axis = this;
var minorTicks = axis.minorTicks;
if (!minorTicks[pos]) {
minorTicks[pos] = new Tick(axis, pos, 'minor');
}
// Render new ticks in old position
if (slideIn && minorTicks[pos].isNew) {
minorTicks[pos].render(null, true);
}
minorTicks[pos].render(null, false, 1);
};
/**
* Render a major tick into the given position. If a tick already exists
* in this position, move it.
*
* @function Highcharts.Axis#renderTick
*
* @param {number} pos
* The position in axis values.
*
* @param {number} i
* The tick index.
*
* @param {boolean} slideIn
* Whether the tick should animate in from last computed position
*/
Axis.prototype.renderTick = function (pos, i, slideIn) {
var axis = this, isLinked = axis.isLinked, ticks = axis.ticks;
// Linked axes need an extra check to find out if
if (!isLinked ||
(pos >= axis.min && pos <= axis.max) ||
(axis.grid && axis.grid.isColumn)) {
if (!ticks[pos]) {
ticks[pos] = new Tick(axis, pos);
}
// NOTE this seems like overkill. Could be handled in tick.render by
// setting old position in attr, then set new position in animate.
// render new ticks in old position
if (slideIn && ticks[pos].isNew) {
// Start with negative opacity so that it is visible from
// halfway into the animation
ticks[pos].render(i, true, -1);
}
ticks[pos].render(i);
}
};
/**
* Render the axis.
*
* @private
* @function Highcharts.Axis#render
*
* @emits Highcharts.Axis#event:afterRender
*/
Axis.prototype.render = function () {
var axis = this, chart = axis.chart, log = axis.logarithmic, renderer = chart.renderer, options = axis.options, isLinked = axis.isLinked, tickPositions = axis.tickPositions, axisTitle = axis.axisTitle, ticks = axis.ticks, minorTicks = axis.minorTicks, alternateBands = axis.alternateBands, stackLabelOptions = options.stackLabels, alternateGridColor = options.alternateGridColor, tickmarkOffset = axis.tickmarkOffset, axisLine = axis.axisLine, showAxis = axis.showAxis, animation = animObject(renderer.globalAnimation);
var from, to;
// Reset
axis.labelEdge.length = 0;
axis.overlap = false;
// Mark all elements inActive before we go over and mark the active ones
[ticks, minorTicks, alternateBands].forEach(function (coll) {
objectEach(coll, function (tick) {
tick.isActive = false;
});
});
// If the series has data draw the ticks. Else only the line and title
if (axis.hasData() || isLinked) {
var slideInTicks_1 = axis.chart.hasRendered &&
axis.old && isNumber(axis.old.min);
// minor ticks
if (axis.minorTickInterval && !axis.categories) {
axis.getMinorTickPositions().forEach(function (pos) {
axis.renderMinorTick(pos, slideInTicks_1);
});
}
// Major ticks. Pull out the first item and render it last so that
// we can get the position of the neighbour label. #808.
if (tickPositions.length) { // #1300
tickPositions.forEach(function (pos, i) {
axis.renderTick(pos, i, slideInTicks_1);
});
// In a categorized axis, the tick marks are displayed
// between labels. So we need to add a tick mark and
// grid line at the left edge of the X axis.
if (tickmarkOffset && (axis.min === 0 || axis.single)) {
if (!ticks[-1]) {
ticks[-1] = new Tick(axis, -1, null, true);
}
ticks[-1].render(-1);
}
}
// alternate grid color
if (alternateGridColor) {
tickPositions.forEach(function (pos, i) {
to = typeof tickPositions[i + 1] !== 'undefined' ?
tickPositions[i + 1] + tickmarkOffset :
axis.max - tickmarkOffset;
if (i % 2 === 0 &&
pos < axis.max &&
to <= axis.max + (chart.polar ?
-tickmarkOffset :
tickmarkOffset)) { // #2248, #4660
if (!alternateBands[pos]) {
// Should be imported from PlotLineOrBand.js, but
// the dependency cycle with axis is a problem
alternateBands[pos] = new H.PlotLineOrBand(axis);
}
from = pos + tickmarkOffset; // #949
alternateBands[pos].options = {
from: log ? log.lin2log(from) : from,
to: log ? log.lin2log(to) : to,
color: alternateGridColor,
className: 'highcharts-alternate-grid'
};
alternateBands[pos].render();
alternateBands[pos].isActive = true;
}
});
}
// custom plot lines and bands
if (!axis._addedPlotLB) { // only first time
axis._addedPlotLB = true;
(options.plotLines || [])
.concat(options.plotBands || [])
.forEach(function (plotLineOptions) {
axis
.addPlotBandOrLine(plotLineOptions);
});
}
} // end if hasData
// Remove inactive ticks
[ticks, minorTicks, alternateBands].forEach(function (coll) {
var forDestruction = [], delay = animation.duration, destroyInactiveItems = function () {
var i = forDestruction.length;
while (i--) {
// When resizing rapidly, the same items
// may be destroyed in different timeouts,
// or the may be reactivated
if (coll[forDestruction[i]] &&
!coll[forDestruction[i]].isActive) {
coll[forDestruction[i]].destroy();
delete coll[forDestruction[i]];
}
}
};
objectEach(coll, function (tick, pos) {
if (!tick.isActive) {
// Render to zero opacity
tick.render(pos, false, 0);
tick.isActive = false;
forDestruction.push(pos);
}
});
// When the objects are finished fading out, destroy them
syncTimeout(destroyInactiveItems, coll === alternateBands ||
!chart.hasRendered ||
!delay ?
0 :
delay);
});
// Set the axis line path
if (axisLine) {
axisLine[axisLine.isPlaced ? 'animate' : 'attr']({
d: this.getLinePath(axisLine.strokeWidth())
});
axisLine.isPlaced = true;
// Show or hide the line depending on options.showEmpty
axisLine[showAxis ? 'show' : 'hide'](showAxis);
}
if (axisTitle && showAxis) {
var titleXy = axis.getTitlePosition();
if (isNumber(titleXy.y)) {
axisTitle[axisTitle.isNew ? 'attr' : 'animate'](titleXy);
axisTitle.isNew = false;
}
else {
axisTitle.attr('y', -9999);
axisTitle.isNew = true;
}
}
// Stacked totals:
if (stackLabelOptions && stackLabelOptions.enabled && axis.stacking) {
axis.stacking.renderStackTotals();
}
// End stacked totals
// Record old scaling for updating/animation
axis.old = {
len: axis.len,
max: axis.max,
min: axis.min,
transA: axis.transA,
userMax: axis.userMax,
userMin: axis.userMin
};
axis.isDirty = false;
fireEvent(this, 'afterRender');
};
/**
* Redraw the axis to reflect changes in the data or axis extremes. Called
* internally from Highcharts.Chart#redraw.
*
* @private
* @function Highcharts.Axis#redraw
*/
Axis.prototype.redraw = function () {
if (this.visible) {
// render the axis
this.render();
// move plot lines and bands
this.plotLinesAndBands.forEach(function (plotLine) {
plotLine.render();
});
}
// mark associated series as dirty and ready for redraw
this.series.forEach(function (series) {
series.isDirty = true;
});
};
/**
* Returns an array of axis properties, that should be untouched during
* reinitialization.
*
* @private
* @function Highcharts.Axis#getKeepProps
*/
Axis.prototype.getKeepProps = function () {
return (this.keepProps || Axis.keepProps);
};
/**
* Destroys an Axis instance. See {@link Axis#remove} for the API endpoint
* to fully remove the axis.
*
* @private
* @function Highcharts.Axis#destroy
*
* @param {boolean} [keepEvents]
* Whether to preserve events, used internally in Axis.update.
*/
Axis.prototype.destroy = function (keepEvents) {
var axis = this, plotLinesAndBands = axis.plotLinesAndBands, eventOptions = this.eventOptions;
fireEvent(this, 'destroy', { keepEvents: keepEvents });
// Remove the events
if (!keepEvents) {
removeEvent(axis);
}
// Destroy collections
[axis.ticks, axis.minorTicks, axis.alternateBands].forEach(function (coll) {
destroyObjectProperties(coll);
});
if (plotLinesAndBands) {
var i = plotLinesAndBands.length;
while (i--) { // #1975
plotLinesAndBands[i].destroy();
}
}
// Destroy elements
['axisLine', 'axisTitle', 'axisGroup',
'gridGroup', 'labelGroup', 'cross', 'scrollbar'].forEach(function (prop) {
if (axis[prop]) {
axis[prop] = axis[prop].destroy();
}
});
// Destroy each generated group for plotlines and plotbands
for (var plotGroup in axis.plotLinesAndBandsGroups) { // eslint-disable-line guard-for-in
axis.plotLinesAndBandsGroups[plotGroup] =
axis.plotLinesAndBandsGroups[plotGroup].destroy();
}
// Delete all properties and fall back to the prototype.
objectEach(axis, function (val, key) {
if (axis.getKeepProps().indexOf(key) === -1) {
delete axis[key];
}
});
this.eventOptions = eventOptions;
};
/**
* Internal function to draw a crosshair.
*
* @function Highcharts.Axis#drawCrosshair
*
* @param {Highcharts.PointerEventObject} [e]
* The event arguments from the modified pointer event, extended with
* `chartX` and `chartY`
*
* @param {Highcharts.Point} [point]
* The Point object if the crosshair snaps to points.
*
* @emits Highcharts.Axis#event:afterDrawCrosshair
* @emits Highcharts.Axis#event:drawCrosshair
*/
Axis.prototype.drawCrosshair = function (e, point) {
var options = this.crosshair, snap = pick(options && options.snap, true), chart = this.chart;
var path, pos, categorized, graphic = this.cross, crossOptions;
fireEvent(this, 'drawCrosshair', { e: e, point: point });
// Use last available event when updating non-snapped crosshairs without
// mouse interaction (#5287)
if (!e) {
e = this.cross && this.cross.e;
}
if (
// Disabled in options
!options ||
// Snap
((defined(point) || !snap) === false)) {
this.hideCrosshair();
}
else {
// Get the path
if (!snap) {
pos = e &&
(this.horiz ?
e.chartX - this.pos :
this.len - e.chartY + this.pos);
}
else if (defined(point)) {
// #3834
pos = pick(this.coll !== 'colorAxis' ?
point.crosshairPos : // 3D axis extension
null, this.isXAxis ?
point.plotX :
this.len - point.plotY);
}
if (defined(pos)) {
crossOptions = {
// value, only used on radial
value: point && (this.isXAxis ?
point.x :
pick(point.stackY, point.y)),
translatedValue: pos
};
if (chart.polar) {
// Additional information required for crosshairs in
// polar chart
extend(crossOptions, {
isCrosshair: true,
chartX: e && e.chartX,
chartY: e && e.chartY,
point: point
});
}
path = this.getPlotLinePath(crossOptions) ||
null; // #3189
}
if (!defined(path)) {
this.hideCrosshair();
return;
}
categorized = this.categories && !this.isRadial;
// Draw the cross
if (!graphic) {
this.cross = graphic = chart.renderer
.path()
.addClass('highcharts-crosshair highcharts-crosshair-' +
(categorized ? 'category ' : 'thin ') +
(options.className || ''))
.attr({
zIndex: pick(options.zIndex, 2)
})
.add();
// Presentational attributes
if (!chart.styledMode) {
graphic.attr({
stroke: options.color ||
(categorized ?
Color
.parse("#ccd6eb" /* highlightColor20 */)
.setOpacity(0.25)
.get() :
"#cccccc" /* neutralColor20 */),
'stroke-width': pick(options.width, 1)
}).css({
'pointer-events': 'none'
});
if (options.dashStyle) {
graphic.attr({
dashstyle: options.dashStyle
});
}
}
}
graphic.show().attr({
d: path
});
if (categorized && !options.width) {
graphic.attr({
'stroke-width': this.transA
});
}
this.cross.e = e;
}
fireEvent(this, 'afterDrawCrosshair', { e: e, point: point });
};
/**
* Hide the crosshair if visible.
*
* @function Highcharts.Axis#hideCrosshair
*/
Axis.prototype.hideCrosshair = function () {
if (this.cross) {
this.cross.hide();
}
fireEvent(this, 'afterHideCrosshair');
};
/**
* Check whether the chart has vertical panning ('y' or 'xy' type).
*
* @private
* @function Highcharts.Axis#hasVerticalPanning
*/
Axis.prototype.hasVerticalPanning = function () {
var panningOptions = this.chart.options.chart.panning;
return Boolean(panningOptions &&
panningOptions.enabled && // #14624
/y/.test(panningOptions.type));
};
/**
* Check whether the given value is a positive valid axis value.
*
* @private
* @function Highcharts.Axis#validatePositiveValue
*
* @param {unknown} value
* The axis value
*/
Axis.prototype.validatePositiveValue = function (value) {
return isNumber(value) && value > 0;
};
/**
* Update an axis object with a new set of options. The options are merged
* with the existing options, so only new or altered options need to be
* specified.
*
* @sample highcharts/members/axis-update/
* Axis update demo
*
* @function Highcharts.Axis#update
*
* @param {Highcharts.AxisOptions} options
* The new options that will be merged in with existing options on the axis.
*
* @param {boolean} [redraw=true]
* Whether to redraw the chart after the axis is altered. If doing more
* operations on the chart, it is a good idea to set redraw to false and
* call {@link Chart#redraw} after.
*/
Axis.prototype.update = function (options, redraw) {
var chart = this.chart;
options = merge(this.userOptions, options);
this.destroy(true);
this.init(chart, options);
chart.isDirtyBox = true;
if (pick(redraw, true)) {
chart.redraw();
}
};
/**
* Remove the axis from the chart.
*
* @sample highcharts/members/chart-addaxis/
* Add and remove axes
*
* @function Highcharts.Axis#remove
*
* @param {boolean} [redraw=true]
* Whether to redraw the chart following the remove.
*/
Axis.prototype.remove = function (redraw) {
var chart = this.chart, key = this.coll, // xAxis or yAxis
axisSeries = this.series;
var i = axisSeries.length;
// Remove associated series (#2687)
while (i--) {
if (axisSeries[i]) {
axisSeries[i].remove(false);
}
}
// Remove the axis
erase(chart.axes, this);
erase(chart[key], this);
chart[key].forEach(function (axis, i) {
// Re-index, #1706, #8075
axis.options.index = axis.userOptions.index = i;
});
this.destroy();
chart.isDirtyBox = true;
if (pick(redraw, true)) {
chart.redraw();
}
};
/**
* Update the axis title by options after render time.
*
* @sample highcharts/members/axis-settitle/
* Set a new Y axis title
*
* @function Highcharts.Axis#setTitle
*
* @param {Highcharts.AxisTitleOptions} titleOptions
* The additional title options.
*
* @param {boolean} [redraw=true]
* Whether to redraw the chart after setting the title.
*/
Axis.prototype.setTitle = function (titleOptions, redraw) {
this.update({ title: titleOptions }, redraw);
};
/**
* Set new axis categories and optionally redraw.
*
* @sample highcharts/members/axis-setcategories/
* Set categories by click on a button
*
* @function Highcharts.Axis#setCategories
*
* @param {Array<string>} categories
* The new categories.
*
* @param {boolean} [redraw=true]
* Whether to redraw the chart.
*/
Axis.prototype.setCategories = function (categories, redraw) {
this.update({ categories: categories }, redraw);
};
/* *
*
* Static Properties
*
* */
Axis.defaultOptions = AxisDefaults.defaultXAxisOptions;
// Properties to survive after destroy, needed for Axis.update (#4317,
// #5773, #5881).
Axis.keepProps = [
'extKey',
'hcEvents',
'names',
'series',
'userMax',
'userMin'
];
return Axis;
}());
/* *
*
* Default Export
*
* */
export default Axis;
/* *
*
* API Declarations
*
* */
/**
* Options for the path on the Axis to be calculated.
* @interface Highcharts.AxisPlotLinePathOptionsObject
*/ /**
* Axis value.
* @name Highcharts.AxisPlotLinePathOptionsObject#value
* @type {number|undefined}
*/ /**
* Line width used for calculation crisp line coordinates. Defaults to 1.
* @name Highcharts.AxisPlotLinePathOptionsObject#lineWidth
* @type {number|undefined}
*/ /**
* If `false`, the function will return null when it falls outside the axis
* bounds. If `true`, the function will return a path aligned to the plot area
* sides if it falls outside. If `pass`, it will return a path outside.
* @name Highcharts.AxisPlotLinePathOptionsObject#force
* @type {string|boolean|undefined}
*/ /**
* Used in Highcharts Stock. When `true`, plot paths
* (crosshair, plotLines, gridLines)
* will be rendered on all axes when defined on the first axis.
* @name Highcharts.AxisPlotLinePathOptionsObject#acrossPanes
* @type {boolean|undefined}
*/ /**
* Use old coordinates (for resizing and rescaling).
* If not set, defaults to `false`.
* @name Highcharts.AxisPlotLinePathOptionsObject#old
* @type {boolean|undefined}
*/ /**
* If given, return the plot line path of a pixel position on the axis.
* @name Highcharts.AxisPlotLinePathOptionsObject#translatedValue
* @type {number|undefined}
*/ /**
* Used in Polar axes. Reverse the positions for concatenation of polygonal
* plot bands
* @name Highcharts.AxisPlotLinePathOptionsObject#reverse
* @type {boolean|undefined}
*/
/**
* Options for crosshairs on axes.
*
* @product highstock
*
* @typedef {Highcharts.XAxisCrosshairOptions|Highcharts.YAxisCrosshairOptions} Highcharts.AxisCrosshairOptions
*/
/**
* @typedef {"navigator"|"pan"|"rangeSelectorButton"|"rangeSelectorInput"|"scrollbar"|"traverseUpButton"|"zoom"} Highcharts.AxisExtremesTriggerValue
*/
/**
* @callback Highcharts.AxisEventCallbackFunction
*
* @param {Highcharts.Axis} this
*/
/**
* @callback Highcharts.AxisLabelsFormatterCallbackFunction
*
* @param {Highcharts.AxisLabelsFormatterContextObject} this
*
* @param {Highcharts.AxisLabelsFormatterContextObject} ctx
*
* @return {string}
*/
/**
* @interface Highcharts.AxisLabelsFormatterContextObject
*/ /**
* The axis item of the label
* @name Highcharts.AxisLabelsFormatterContextObject#axis
* @type {Highcharts.Axis}
*/ /**
* The chart instance.
* @name Highcharts.AxisLabelsFormatterContextObject#chart
* @type {Highcharts.Chart}
*/ /**
* Whether the label belongs to the first tick on the axis.
* @name Highcharts.AxisLabelsFormatterContextObject#isFirst
* @type {boolean}
*/ /**
* Whether the label belongs to the last tick on the axis.
* @name Highcharts.AxisLabelsFormatterContextObject#isLast
* @type {boolean}
*/ /**
* The position on the axis in terms of axis values. For category axes, a
* zero-based index. For datetime axes, the JavaScript time in milliseconds
* since 1970.
* @name Highcharts.AxisLabelsFormatterContextObject#pos
* @type {number}
*/ /**
* The preformatted text as the result of the default formatting. For example
* dates will be formatted as strings, and numbers with language-specific comma
* separators, thousands separators and numeric symbols like `k` or `M`.
* @name Highcharts.AxisLabelsFormatterContextObject#text
* @type {string}
*/ /**
* The Tick instance.
* @name Highcharts.AxisLabelsFormatterContextObject#tick
* @type {Highcharts.Tick}
*/ /**
* This can be either a numeric value or a category string.
* @name Highcharts.AxisLabelsFormatterContextObject#value
* @type {number|string}
*/
/**
* Options for axes.
*
* @typedef {Highcharts.XAxisOptions|Highcharts.YAxisOptions|Highcharts.ZAxisOptions} Highcharts.AxisOptions
*/
/**
* @callback Highcharts.AxisPointBreakEventCallbackFunction
*
* @param {Highcharts.Axis} this
*
* @param {Highcharts.AxisPointBreakEventObject} evt
*/
/**
* @interface Highcharts.AxisPointBreakEventObject
*/ /**
* @name Highcharts.AxisPointBreakEventObject#brk
* @type {Highcharts.Dictionary<number>}
*/ /**
* @name Highcharts.AxisPointBreakEventObject#point
* @type {Highcharts.Point}
*/ /**
* @name Highcharts.AxisPointBreakEventObject#preventDefault
* @type {Function}
*/ /**
* @name Highcharts.AxisPointBreakEventObject#target
* @type {Highcharts.SVGElement}
*/ /**
* @name Highcharts.AxisPointBreakEventObject#type
* @type {"pointBreak"|"pointInBreak"}
*/
/**
* @callback Highcharts.AxisSetExtremesEventCallbackFunction
*
* @param {Highcharts.Axis} this
*
* @param {Highcharts.AxisSetExtremesEventObject} evt
*/
/**
* @interface Highcharts.AxisSetExtremesEventObject
* @extends Highcharts.ExtremesObject
*/ /**
* @name Highcharts.AxisSetExtremesEventObject#preventDefault
* @type {Function}
*/ /**
* @name Highcharts.AxisSetExtremesEventObject#target
* @type {Highcharts.SVGElement}
*/ /**
* @name Highcharts.AxisSetExtremesEventObject#trigger
* @type {Highcharts.AxisExtremesTriggerValue|string}
*/ /**
* @name Highcharts.AxisSetExtremesEventObject#type
* @type {"setExtremes"}
*/
/**
* @callback Highcharts.AxisTickPositionerCallbackFunction
*
* @param {Highcharts.Axis} this
*
* @return {Highcharts.AxisTickPositionsArray}
*/
/**
* @interface Highcharts.AxisTickPositionsArray
* @augments Array<number>
*/
/**
* @typedef {"high"|"low"|"middle"} Highcharts.AxisTitleAlignValue
*/
/**
* @typedef {Highcharts.XAxisTitleOptions|Highcharts.YAxisTitleOptions|Highcharts.ZAxisTitleOptions} Highcharts.AxisTitleOptions
*/
/**
* @typedef {"linear"|"logarithmic"|"datetime"|"category"|"treegrid"} Highcharts.AxisTypeValue
*/
/**
* The returned object literal from the {@link Highcharts.Axis#getExtremes}
* function.
*
* @interface Highcharts.ExtremesObject
*/ /**
* The maximum value of the axis' associated series.
* @name Highcharts.ExtremesObject#dataMax
* @type {number}
*/ /**
* The minimum value of the axis' associated series.
* @name Highcharts.ExtremesObject#dataMin
* @type {number}
*/ /**
* The maximum axis value, either automatic or set manually. If the `max` option
* is not set, `maxPadding` is 0 and `endOnTick` is false, this value will be
* the same as `dataMax`.
* @name Highcharts.ExtremesObject#max
* @type {number}
*/ /**
* The minimum axis value, either automatic or set manually. If the `min` option
* is not set, `minPadding` is 0 and `startOnTick` is false, this value will be
* the same as `dataMin`.
* @name Highcharts.ExtremesObject#min
* @type {number}
*/ /**
* The user defined maximum, either from the `max` option or from a zoom or
* `setExtremes` action.
* @name Highcharts.ExtremesObject#userMax
* @type {number}
*/ /**
* The user defined minimum, either from the `min` option or from a zoom or
* `setExtremes` action.
* @name Highcharts.ExtremesObject#userMin
* @type {number}
*/
/**
* Formatter function for the text of a crosshair label.
*
* @callback Highcharts.XAxisCrosshairLabelFormatterCallbackFunction
*
* @param {Highcharts.Axis} this
* Axis context
*
* @param {number} value
* Y value of the data point
*
* @return {string}
*/
''; // keeps doclets above in JS file
|
/* eslint-disable @typescript-eslint/naming-convention, consistent-return, jsx-a11y/no-noninteractive-tabindex */
import * as React from 'react';
import PropTypes from 'prop-types';
import { exactProp, elementAcceptingRef } from '@material-ui/utils';
import ownerDocument from '../utils/ownerDocument';
import useForkRef from '../utils/useForkRef';
/**
* Utility component that locks focus inside the component.
*/
function Unstable_TrapFocus(props) {
var children = props.children,
_props$disableAutoFoc = props.disableAutoFocus,
disableAutoFocus = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc,
_props$disableEnforce = props.disableEnforceFocus,
disableEnforceFocus = _props$disableEnforce === void 0 ? false : _props$disableEnforce,
_props$disableRestore = props.disableRestoreFocus,
disableRestoreFocus = _props$disableRestore === void 0 ? false : _props$disableRestore,
getDoc = props.getDoc,
isEnabled = props.isEnabled,
open = props.open;
var ignoreNextEnforceFocus = React.useRef();
var sentinelStart = React.useRef(null);
var sentinelEnd = React.useRef(null);
var nodeToRestore = React.useRef();
var reactFocusEventTarget = React.useRef(null); // This variable is useful when disableAutoFocus is true.
// It waits for the active element to move into the component to activate.
var activated = React.useRef(false);
var rootRef = React.useRef(null);
var handleRef = useForkRef(children.ref, rootRef);
var prevOpenRef = React.useRef();
React.useEffect(function () {
prevOpenRef.current = open;
}, [open]);
if (!prevOpenRef.current && open && typeof window !== 'undefined' && !disableAutoFocus) {
// WARNING: Potentially unsafe in concurrent mode.
// The way the read on `nodeToRestore` is setup could make this actually safe.
// Say we render `open={false}` -> `open={true}` but never commit.
// We have now written a state that wasn't committed. But no committed effect
// will read this wrong value. We only read from `nodeToRestore` in effects
// that were committed on `open={true}`
// WARNING: Prevents the instance from being garbage collected. Should only
// hold a weak ref.
nodeToRestore.current = getDoc().activeElement;
}
React.useEffect(function () {
// We might render an empty child.
if (!open || !rootRef.current) {
return;
}
activated.current = !disableAutoFocus;
}, [disableAutoFocus, open]);
React.useEffect(function () {
// We might render an empty child.
if (!open || !rootRef.current) {
return;
}
var doc = ownerDocument(rootRef.current);
if (!rootRef.current.contains(doc.activeElement)) {
if (!rootRef.current.hasAttribute('tabIndex')) {
if (process.env.NODE_ENV !== 'production') {
console.error(['Material-UI: The modal content node does not accept focus.', 'For the benefit of assistive technologies, ' + 'the tabIndex of the node is being set to "-1".'].join('\n'));
}
rootRef.current.setAttribute('tabIndex', -1);
}
if (activated.current) {
rootRef.current.focus();
}
}
return function () {
// restoreLastFocus()
if (!disableRestoreFocus) {
// In IE 11 it is possible for document.activeElement to be null resulting
// in nodeToRestore.current being null.
// Not all elements in IE 11 have a focus method.
// Once IE 11 support is dropped the focus() call can be unconditional.
if (nodeToRestore.current && nodeToRestore.current.focus) {
ignoreNextEnforceFocus.current = true;
nodeToRestore.current.focus();
}
nodeToRestore.current = null;
}
}; // Missing `disableRestoreFocus` which is fine.
// We don't support changing that prop on an open TrapFocus
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [open]);
React.useEffect(function () {
// We might render an empty child.
if (!open || !rootRef.current) {
return;
}
var doc = ownerDocument(rootRef.current);
var contain = function contain(nativeEvent) {
var rootElement = rootRef.current; // Cleanup functions are executed lazily in React 17.
// Contain can be called between the component being unmounted and its cleanup function being run.
if (rootElement === null) {
return;
}
if (!doc.hasFocus() || disableEnforceFocus || !isEnabled() || ignoreNextEnforceFocus.current) {
ignoreNextEnforceFocus.current = false;
return;
}
if (!rootElement.contains(doc.activeElement)) {
// if the focus event is not coming from inside the children's react tree, reset the refs
if (nativeEvent && reactFocusEventTarget.current !== nativeEvent.target || doc.activeElement !== reactFocusEventTarget.current) {
reactFocusEventTarget.current = null;
} else if (reactFocusEventTarget.current !== null) {
return;
}
if (!activated.current) {
return;
}
rootElement.focus();
} else {
activated.current = true;
}
};
var loopFocus = function loopFocus(nativeEvent) {
if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== 'Tab') {
return;
} // Make sure the next tab starts from the right place.
if (doc.activeElement === rootRef.current) {
// We need to ignore the next contain as
// it will try to move the focus back to the rootRef element.
ignoreNextEnforceFocus.current = true;
if (nativeEvent.shiftKey) {
sentinelEnd.current.focus();
} else {
sentinelStart.current.focus();
}
}
};
doc.addEventListener('focusin', contain);
doc.addEventListener('keydown', loopFocus, true); // With Edge, Safari and Firefox, no focus related events are fired when the focused area stops being a focused area.
// e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=559561.
// Instead, we can look if the active element was restored on the BODY element.
//
// The whatwg spec defines how the browser should behave but does not explicitly mention any events:
// https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule.
var interval = setInterval(function () {
if (doc.activeElement.tagName === 'BODY') {
contain();
}
}, 50);
return function () {
clearInterval(interval);
doc.removeEventListener('focusin', contain);
doc.removeEventListener('keydown', loopFocus, true);
};
}, [disableAutoFocus, disableEnforceFocus, disableRestoreFocus, isEnabled, open]);
var onFocus = function onFocus(event) {
if (!activated.current) {
nodeToRestore.current = event.relatedTarget;
}
activated.current = true;
reactFocusEventTarget.current = event.target;
var childrenPropsHandler = children.props.onFocus;
if (childrenPropsHandler) {
childrenPropsHandler(event);
}
};
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
tabIndex: 0,
ref: sentinelStart,
"data-test": "sentinelStart"
}), /*#__PURE__*/React.cloneElement(children, {
ref: handleRef,
onFocus: onFocus
}), /*#__PURE__*/React.createElement("div", {
tabIndex: 0,
ref: sentinelEnd,
"data-test": "sentinelEnd"
}));
}
process.env.NODE_ENV !== "production" ? Unstable_TrapFocus.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* A single child content element.
*/
children: elementAcceptingRef,
/**
* If `true`, the trap focus will not automatically shift focus to itself when it opens, and
* replace it to the last focused element when it closes.
* This also works correctly with any trap focus children that have the `disableAutoFocus` prop.
*
* Generally this should never be set to `true` as it makes the trap focus less
* accessible to assistive technologies, like screen readers.
* @default false
*/
disableAutoFocus: PropTypes.bool,
/**
* If `true`, the trap focus will not prevent focus from leaving the trap focus while open.
*
* Generally this should never be set to `true` as it makes the trap focus less
* accessible to assistive technologies, like screen readers.
* @default false
*/
disableEnforceFocus: PropTypes.bool,
/**
* If `true`, the trap focus will not restore focus to previously focused element once
* trap focus is hidden.
* @default false
*/
disableRestoreFocus: PropTypes.bool,
/**
* Return the document to consider.
* We use it to implement the restore focus between different browser documents.
*/
getDoc: PropTypes.func.isRequired,
/**
* Do we still want to enforce the focus?
* This prop helps nesting TrapFocus elements.
*/
isEnabled: PropTypes.func.isRequired,
/**
* If `true`, focus will be locked.
*/
open: PropTypes.bool.isRequired
} : void 0;
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line
Unstable_TrapFocus['propTypes' + ''] = exactProp(Unstable_TrapFocus.propTypes);
}
export default Unstable_TrapFocus;
|
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var notifier = require('../../helpers/notifier');
var changed = require('gulp-changed');
var cache = require('gulp-cached');
var tarsConfig = require('../../../tars-config');
var svg2png = require('gulp-svg2png');
/**
* Raster SVG-files (optional task)
* @param {object} buildOptions
*/
module.exports = function(buildOptions) {
return gulp.task('images:raster-svg', function(cb) {
if (tarsConfig.useSVG && gutil.env.ie8) {
return gulp.src('./markup/' + tarsConfig.fs.staticFolderName + '/' + tarsConfig.fs.imagesFolderName + '/svg/*.svg')
.pipe(cache('raster-svg'))
.pipe(
changed(
'dev/' + tarsConfig.fs.staticFolderName + '/' + tarsConfig.fs.imagesFolderName + '/rastered-svg-images',
{
hasChanged: changed.compareLastModifiedTime,
extension: '.png'
}
)
)
.pipe(svg2png())
.on('error', notify.onError(function (error) {
return '\nAn error occurred while rastering svg.\nLook in the console for details.\n' + error;
}))
.pipe(gulp.dest('dev/' + tarsConfig.fs.staticFolderName + '/' + tarsConfig.fs.imagesFolderName + '/rastered-svg-images'))
.pipe(
notifier('SVG\'ve been rastered')
);
} else {
gutil.log('!Rastering SVG is not used!');
cb(null);
}
});
};
|
/*!
* jQuery QueryBuilder 2.5.2
* Locale: Spanish (es)
* Author: "pyarza", "kddlb"
* Licensed under MIT (https://opensource.org/licenses/MIT)
*/
(function(root, factory) {
if (typeof define == 'function' && define.amd) {
define(['jquery', 'query-builder'], factory);
}
else {
factory(root.jQuery);
}
}(this, function($) {
"use strict";
var QueryBuilder = $.fn.queryBuilder;
QueryBuilder.regional['es'] = {
"__locale": "Spanish (es)",
"__author": "\"pyarza\", \"kddlb\"",
"add_rule": "Aรฑadir regla",
"add_group": "Aรฑadir grupo",
"delete_rule": "Borrar",
"delete_group": "Borrar",
"conditions": {
"AND": "Y",
"OR": "O"
},
"operators": {
"equal": "igual",
"not_equal": "distinto",
"in": "en",
"not_in": "no en",
"less": "menor",
"less_or_equal": "menor o igual",
"greater": "mayor",
"greater_or_equal": "mayor o igual",
"between": "entre",
"not_between": "no estรก entre",
"begins_with": "empieza por",
"not_begins_with": "no empieza por",
"contains": "contiene",
"not_contains": "no contiene",
"ends_with": "acaba con",
"not_ends_with": "no acaba con",
"is_empty": "estรก vacรญo",
"is_not_empty": "no estรก vacรญo",
"is_null": "es nulo",
"is_not_null": "no es nulo"
},
"errors": {
"no_filter": "No se ha seleccionado ningรบn filtro",
"empty_group": "El grupo estรก vacรญo",
"radio_empty": "Ningรบn valor seleccionado",
"checkbox_empty": "Ningรบn valor seleccionado",
"select_empty": "Ningรบn valor seleccionado",
"string_empty": "Cadena vacรญa",
"string_exceed_min_length": "Debe contener al menos {0} caracteres",
"string_exceed_max_length": "No debe contener mรกs de {0} caracteres",
"string_invalid_format": "Formato invรกlido ({0})",
"number_nan": "No es un nรบmero",
"number_not_integer": "No es un nรบmero entero",
"number_not_double": "No es un nรบmero real",
"number_exceed_min": "Debe ser mayor que {0}",
"number_exceed_max": "Debe ser menor que {0}",
"number_wrong_step": "Debe ser mรบltiplo de {0}",
"datetime_invalid": "Formato de fecha invรกlido ({0})",
"datetime_exceed_min": "Debe ser posterior a {0}",
"datetime_exceed_max": "Debe ser anterior a {0}",
"number_between_invalid": "Valores Invรกlidos, {0} es mayor que {1}",
"datetime_empty": "Campo vacio",
"datetime_between_invalid": "Valores Invรกlidos, {0} es mayor que {1}",
"boolean_not_valid": "No es booleano",
"operator_not_multiple": "El operador \"{1}\" no puede aceptar valores multiples"
}
};
QueryBuilder.defaults({ lang_code: 'es' });
}));
|
'use strict';
angular.module('copayApp.services').factory('request', function() {
return require('request');
});
|
'use strict';
const {
MathFloor,
NumberIsInteger,
} = primordials;
const { ERR_INVALID_OPT_VALUE } = require('internal/errors').codes;
function highWaterMarkFrom(options, isDuplex, duplexKey) {
return options.highWaterMark != null ? options.highWaterMark :
isDuplex ? options[duplexKey] : null;
}
function getDefaultHighWaterMark(objectMode) {
return objectMode ? 16 : 16 * 1024;
}
function getHighWaterMark(state, options, duplexKey, isDuplex) {
const hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
if (hwm != null) {
if (!NumberIsInteger(hwm) || hwm < 0) {
const name = isDuplex ? duplexKey : 'highWaterMark';
throw new ERR_INVALID_OPT_VALUE(name, hwm);
}
return MathFloor(hwm);
}
// Default value
return getDefaultHighWaterMark(state.objectMode);
}
module.exports = {
getHighWaterMark,
getDefaultHighWaterMark
};
|
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
return _ThemeProvider.default;
}
});
var _ThemeProvider = _interopRequireDefault(require("./ThemeProvider"));
|
import React from 'react'
import * as common from 'test/specs/commonTests'
import TableRow from 'src/collections/Table/TableRow'
describe('TableRow', () => {
common.isConformant(TableRow)
common.rendersChildren(TableRow)
common.implementsCreateMethod(TableRow)
common.implementsTextAlignProp(TableRow, ['left', 'center', 'right'])
common.implementsVerticalAlignProp(TableRow)
common.propKeyOnlyToClassName(TableRow, 'active')
common.propKeyOnlyToClassName(TableRow, 'disabled')
common.propKeyOnlyToClassName(TableRow, 'error')
common.propKeyOnlyToClassName(TableRow, 'negative')
common.propKeyOnlyToClassName(TableRow, 'positive')
common.propKeyOnlyToClassName(TableRow, 'warning')
it('renders as a tr by default', () => {
shallow(<TableRow />)
.should.have.tagName('tr')
})
describe('shorthand', () => {
const cells = ['Name', 'Status', 'Notes']
it('renders empty tr with no shorthand', () => {
const wrapper = mount(<TableRow />)
wrapper.find('td').should.have.lengthOf(0)
})
it('renders the cells', () => {
const wrapper = mount(<TableRow cells={cells} />)
wrapper.find('td').should.have.lengthOf(cells.length)
})
it('renders the cells using cellAs', () => {
const cellAs = 'th'
const wrapper = mount(<TableRow cells={cells} cellAs={cellAs} />)
wrapper.find(cellAs).should.have.lengthOf(cells.length)
})
})
})
|
'use strict';
const _ = require('lodash');
const Utils = require('../../utils');
const debug = Utils.getLogger().debugContext('sql:sqlite');
const Promise = require('../../promise');
const AbstractQuery = require('../abstract/query');
const QueryTypes = require('../../query-types');
const sequelizeErrors = require('../../errors.js');
const parserStore = require('../parserStore')('sqlite');
class Query extends AbstractQuery {
constructor(database, sequelize, options) {
super();
this.database = database;
this.sequelize = sequelize;
this.instance = options.instance;
this.model = options.model;
this.options = _.extend({
logging: console.log,
plain: false,
raw: false
}, options || {});
this.checkLoggingOption();
}
getInsertIdField() {
return 'lastID';
}
/**
* rewrite query with parameters
* @private
*/
static formatBindParameters(sql, values, dialect) {
let bindParam;
if (Array.isArray(values)) {
bindParam = {};
values.forEach((v, i) => {
bindParam['$'+(i+1)] = v;
});
sql = AbstractQuery.formatBindParameters(sql, values, dialect, { skipValueReplace: true })[0];
} else {
bindParam = {};
if (typeof values === 'object') {
for (const k of Object.keys(values)) {
bindParam['$'+k] = values[k];
}
}
sql = AbstractQuery.formatBindParameters(sql, values, dialect, { skipValueReplace: true })[0];
}
return [sql, bindParam];
}
_collectModels(include, prefix) {
const ret = {};
if (include) {
for (const _include of include) {
let key;
if (!prefix) {
key = _include.as;
} else {
key = prefix + '.' + _include.as;
}
ret[key] = _include.model;
if (_include.include) {
_.merge(ret, this._collectModels(_include.include, key));
}
}
}
return ret;
}
run(sql, parameters) {
this.sql = sql;
const method = this.getDatabaseMethod();
if (method === 'exec') {
// exec does not support bind parameter
sql = AbstractQuery.formatBindParameters(sql, this.options.bind, this.options.dialect, { skipUnescape: true })[0];
this.sql = sql;
}
//do we need benchmark for this query execution
const benchmark = this.sequelize.options.benchmark || this.options.benchmark;
let queryBegin;
if (benchmark) {
queryBegin = Date.now();
} else {
this.sequelize.log('Executing (' + (this.database.uuid || 'default') + '): ' + this.sql, this.options);
}
debug(`executing(${this.database.uuid || 'default'}) : ${this.sql}`);
return new Promise(resolve => {
const columnTypes = {};
this.database.serialize(() => {
const executeSql = () => {
if (this.sql.indexOf('-- ') === 0) {
return resolve();
} else {
resolve(new Promise((resolve, reject) => {
const query = this;
// cannot use arrow function here because the function is bound to the statement
function afterExecute(err, results) {
/* jshint validthis:true */
debug(`executed(${query.database.uuid || 'default'}) : ${query.sql}`);
if (benchmark) {
query.sequelize.log('Executed (' + (query.database.uuid || 'default') + '): ' + query.sql, (Date.now() - queryBegin), query.options);
}
if (err) {
err.sql = query.sql;
reject(query.formatError(err));
} else {
const metaData = this;
let result = query.instance;
// add the inserted row id to the instance
if (query.isInsertQuery(results, metaData)) {
query.handleInsertQuery(results, metaData);
if (!query.instance) {
// handle bulkCreate AI primary key
if (
metaData.constructor.name === 'Statement'
&& query.model
&& query.model.autoIncrementField
&& query.model.autoIncrementField === query.model.primaryKeyAttribute
&& query.model.rawAttributes[query.model.primaryKeyAttribute]
) {
const startId = metaData[query.getInsertIdField()] - metaData.changes + 1;
result = [];
for (let i = startId; i < startId + metaData.changes; i++) {
result.push({ [query.model.rawAttributes[query.model.primaryKeyAttribute].field]: i });
}
} else {
result = metaData[query.getInsertIdField()];
}
}
}
if (query.sql.indexOf('sqlite_master') !== -1) {
result = results.map(resultSet => resultSet.name);
} else if (query.isSelectQuery()) {
if (!query.options.raw) {
// This is a map of prefix strings to models, e.g. user.projects -> Project model
const prefixes = query._collectModels(query.options.include);
results = results.map(result => {
return _.mapValues(result, (value, name) => {
let model;
if (name.indexOf('.') !== -1) {
const lastind = name.lastIndexOf('.');
model = prefixes[name.substr(0, lastind)];
name = name.substr(lastind + 1);
} else {
model = query.options.model;
}
const tableName = model.getTableName().toString().replace(/`/g, '');
const tableTypes = columnTypes[tableName] || {};
if (tableTypes && !(name in tableTypes)) {
// The column is aliased
_.forOwn(model.rawAttributes, (attribute, key) => {
if (name === key && attribute.field) {
name = attribute.field;
return false;
}
});
}
return tableTypes[name]
? query.applyParsers(tableTypes[name], value)
: value;
});
});
}
result = query.handleSelectQuery(results);
} else if (query.isShowOrDescribeQuery()) {
result = results;
} else if (query.sql.indexOf('PRAGMA INDEX_LIST') !== -1) {
result = query.handleShowIndexesQuery(results);
} else if (query.sql.indexOf('PRAGMA INDEX_INFO') !== -1) {
result = results;
} else if (query.sql.indexOf('PRAGMA TABLE_INFO') !== -1) {
// this is the sqlite way of getting the metadata of a table
result = {};
let defaultValue;
for (const _result of results) {
if (_result.dflt_value === null) {
// Column schema omits any "DEFAULT ..."
defaultValue = undefined;
} else if (_result.dflt_value === 'NULL') {
// Column schema is a "DEFAULT NULL"
defaultValue = null;
} else {
defaultValue = _result.dflt_value;
}
result[_result.name] = {
type: _result.type,
allowNull: (_result.notnull === 0),
defaultValue,
primaryKey: (_result.pk !== 0)
};
if (result[_result.name].type === 'TINYINT(1)') {
result[_result.name].defaultValue = { '0': false, '1': true }[result[_result.name].defaultValue];
}
if (typeof result[_result.name].defaultValue === 'string') {
result[_result.name].defaultValue = result[_result.name].defaultValue.replace(/'/g, '');
}
}
} else if (query.sql.indexOf('PRAGMA foreign_keys;') !== -1) {
result = results[0];
} else if (query.sql.indexOf('PRAGMA foreign_keys') !== -1) {
result = results;
} else if (query.sql.indexOf('PRAGMA foreign_key_list') !== -1) {
result = results;
} else if ([QueryTypes.BULKUPDATE, QueryTypes.BULKDELETE].indexOf(query.options.type) !== -1) {
result = metaData.changes;
} else if (query.options.type === QueryTypes.UPSERT) {
result = undefined;
} else if (query.options.type === QueryTypes.VERSION) {
result = results[0].version;
} else if (query.options.type === QueryTypes.RAW) {
result = [results, metaData];
} else if (query.isUpdateQuery() || query.isInsertQuery()) {
result = [result, metaData.changes];
}
resolve(result);
}
}
if (method === 'exec') {
// exec does not support bind parameter
this.database[method](this.sql, afterExecute);
} else {
if (!parameters) parameters = [];
this.database[method](this.sql, parameters, afterExecute);
}
}));
return null;
}
};
if ((this.getDatabaseMethod() === 'all')) {
let tableNames = [];
if (this.options && this.options.tableNames) {
tableNames = this.options.tableNames;
} else if (/FROM `(.*?)`/i.exec(this.sql)) {
tableNames.push(/FROM `(.*?)`/i.exec(this.sql)[1]);
}
// If we already have the metadata for the table, there's no need to ask for it again
tableNames = _.filter(tableNames, tableName => !(tableName in columnTypes) && tableName !== 'sqlite_master');
if (!tableNames.length) {
return executeSql();
} else {
return Promise.map(tableNames, tableName =>
new Promise(resolve => {
tableName = tableName.replace(/`/g, '');
columnTypes[tableName] = {};
this.database.all('PRAGMA table_info(`' + tableName + '`)', (err, results) => {
if (!err) {
for (const result of results) {
columnTypes[tableName][result.name] = result.type;
}
}
resolve();
});
})
).then(executeSql);
}
} else {
return executeSql();
}
});
});
}
applyParsers(type, value) {
if (type.indexOf('(') !== -1) {
// Remove the length part
type = type.substr(0, type.indexOf('('));
}
type = type.replace('UNSIGNED', '').replace('ZEROFILL', '');
type = type.trim().toUpperCase();
const parse = parserStore.get(type);
if (value !== null && parse) {
return parse(value, { timezone: this.sequelize.options.timezone });
}
return value;
}
formatError(err) {
switch (err.code) {
case 'SQLITE_CONSTRAINT': {
let match = err.message.match(/FOREIGN KEY constraint failed/);
if (match !== null) {
return new sequelizeErrors.ForeignKeyConstraintError({
parent :err
});
}
let fields = [];
// Sqlite pre 2.2 behavior - Error: SQLITE_CONSTRAINT: columns x, y are not unique
match = err.message.match(/columns (.*?) are/);
if (match !== null && match.length >= 2) {
fields = match[1].split(', ');
} else {
// Sqlite post 2.2 behavior - Error: SQLITE_CONSTRAINT: UNIQUE constraint failed: table.x, table.y
match = err.message.match(/UNIQUE constraint failed: (.*)/);
if (match !== null && match.length >= 2) {
fields = match[1].split(', ').map(columnWithTable => columnWithTable.split('.')[1]);
}
}
const errors = [];
let message = 'Validation error';
for (const field of fields) {
errors.push(new sequelizeErrors.ValidationErrorItem(
this.getUniqueConstraintErrorMessage(field),
'unique violation', field, this.instance && this.instance[field]));
}
if (this.model) {
_.forOwn(this.model.uniqueKeys, constraint => {
if (_.isEqual(constraint.fields, fields) && !!constraint.msg) {
message = constraint.msg;
return false;
}
});
}
return new sequelizeErrors.UniqueConstraintError({message, errors, parent: err, fields});
}
case 'SQLITE_BUSY':
return new sequelizeErrors.TimeoutError(err);
default:
return new sequelizeErrors.DatabaseError(err);
}
}
handleShowIndexesQuery(data) {
// Sqlite returns indexes so the one that was defined last is returned first. Lets reverse that!
return this.sequelize.Promise.map(data.reverse(), item => {
item.fields = [];
item.primary = false;
item.unique = !!item.unique;
return this.run('PRAGMA INDEX_INFO(`' + item.name + '`)').then(columns => {
for (const column of columns) {
item.fields[column.seqno] = {
attribute: column.name,
length: undefined,
order: undefined
};
}
return item;
});
});
}
getDatabaseMethod() {
if (this.isUpsertQuery()) {
return 'exec'; // Needed to run multiple queries in one
} else if (this.isInsertQuery() || this.isUpdateQuery() || this.isBulkUpdateQuery() || (this.sql.toLowerCase().indexOf('CREATE TEMPORARY TABLE'.toLowerCase()) !== -1) || this.options.type === QueryTypes.BULKDELETE) {
return 'run';
} else {
return 'all';
}
}
}
module.exports = Query;
module.exports.Query = Query;
module.exports.default = Query;
|
๏ปฟ/*
* ๆฅๅฟ่ฎฐๅฝ
* @author MingLi (guomilo@gmail.com)
*
* window.debugMode ็จไบ่ฎพ็ฝฎ่ฐ่ฏๆจกๅผ
debugMode=0 ไธ่ฎฐๅฝ้่ฏฏไฟกๆฏใ
debugMode=1 ๆๅบๅผๅธธ๏ผๆๆต่งๅจๅค็ใ
debugMode=2 ๅจๆงๅถๅฐ่พๅบใ
debugMode=3 ๅผนๅบ้่ฏฏไฟกๆฏใ
*
*/
/*ไพ่ต util.js */
var IR = IR || {};
(function (IR) {
var tools = IR.Util;
window.debugMode = 2;
function Log() {
if (typeof Log.instance == "undefined") {
return getInstance.apply(this);
}
else {
return Log.instance;
}
function getInstance() {
Log.instance = this;
this.write = function () {
if (window.debugMode == 0) {
return;
}
else if (window.debugMode == 1) {
for (var k in arguments) {
throw new Error(arguments[k]);
}
}
else if (window.debugMode == 2) {
for (var k in arguments) {
console.log(arguments[k]);
}
console.log("")
}
else {
for (var k in arguments) {
alert(arguments[k]);
}
}
}
return this;
}
}
IR.Log = new Log();
})(IR)
|
"use strict";
/**
* @class
* Defines a http client to request mock data to use the web part with the local workbench
*/
var MockHttpClient = (function () {
function MockHttpClient() {
}
/**
* @function
* Mock get SharePoint list request
*/
MockHttpClient.getLists = function (restUrl, options) {
return new Promise(function (resolve) {
resolve(MockHttpClient._lists);
});
};
/**
* @function
* Mock get SharePoint list items request
*/
MockHttpClient.getListsItems = function (restUrl, options) {
return new Promise(function (resolve) {
resolve(MockHttpClient._items);
});
};
return MockHttpClient;
}());
/**
* @var
* Mock SharePoint list sample
*/
MockHttpClient._lists = [{ Title: 'Mock List', Id: '1', BaseTemplate: '109' }];
/**
* @var
* Mock SharePoint list item sample
*/
MockHttpClient._items = [
{ "ID": "1", "Title": "Pic 1", "Description": "", "File": { "Name": "1.jpg", "ServerRelativeUrl": "/Images/1.jpg" } }
];
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = MockHttpClient;
//# sourceMappingURL=MockHttpClient.js.map
|
/* global chrome*/
/**
* Content script injected into the app page by chrome, works in tandem with the
* background-script to coordinate messaging between EmberDebug, EmberInspector and the
* ClientApp. The content-script serves as a proxy between EmberDebug
* and the background-script.
*
* Content scripts are loaded into every page, and have access to the DOM. This uses that
* to inject the in-page-script to determine the ClientApp version onLoad.
*/
(function() {
"use strict";
/**
* Add an event listener for window.messages.
* The initial message from EmberDebug is used to setup the event listener
* that proxies between the content-script and EmberDebug using a MessagingChannel.
*
* All events from the window are filtered by checking that data and data.type
* properties exist before sending messages on to the background-script.
*
* See:
* https://developer.mozilla.org/en-US/docs/Web/API/Channel_Messaging_API
*/
window.addEventListener('message', function(event) {
// received initial message from EmberDebug
if (event.data === 'debugger-client') {
var emberDebugPort = event.ports[0];
listenToEmberDebugPort(emberDebugPort);
} else if (event.data && event.data.type) {
chrome.extension.sendMessage(event.data);
}
});
/**
* Listen for messages from EmberDebug.
* @param {Object} emberDebugPort
*/
function listenToEmberDebugPort(emberDebugPort) {
// listen for messages from EmberDebug, and pass them on to the background-script
emberDebugPort.addEventListener('message', function(event) {
chrome.extension.sendMessage(event.data);
});
// listen for messages from the EmberInspector, and pass them on to EmberDebug
chrome.extension.onMessage.addListener(function(message) {
if (message.from === 'devtools') {
// forward message to EmberDebug
emberDebugPort.postMessage(message);
}
});
emberDebugPort.start();
}
// document.documentElement.dataset is not present for SVG elements
// this guard prevents that condition from triggering an error
if (document.documentElement && document.documentElement.dataset) {
// let EmberDebug know that content script has executed
document.documentElement.dataset.emberExtension = 1;
}
// Iframes should not reset the icon so we make sure
// it's the top level window before resetting.
if (window.top === window) {
// Clear a possible previous Ember icon
chrome.extension.sendMessage({ type: 'resetEmberIcon' });
}
/**
* Inject JS into the page to check for an app on domready. The in-page-script
* is used by all variants of ember-inspector (Chrome, FF, Bookmarklet) to get
* the libraries running in the ClientApp
*/
var script = document.createElement('script');
script.type = "text/javascript";
script.src = chrome.extension.getURL("scripts/in-page-script.js");
if (document.body && document.contentType !== "application/pdf") {
document.body.appendChild(script);
script.onload = function() {
document.body.removeChild(script);
};
}
/**
* Gather the iframes running in the ClientApp
*/
var iframes = document.getElementsByTagName('iframe');
var urls = [];
for (var i = 0, l = iframes.length; i < l; i ++) {
urls.push(iframes[i].src);
}
/**
* Send the iframes to EmberInspector so that it can run
* EmberDebug in the context of the iframe.
*/
//FIX ME
setTimeout(function() {
chrome.extension.sendMessage({type: 'iframes', urls: urls});
}, 500);
}());
|
var app = require('express')(),
steps = require('./steps');
app.use(require('hmpo-form-wizard')(steps, {}, { templatePath: 'priority-service' }));
module.exports = app;
|
/*
YUI 3.8.0pr2 (build 154)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("event-hover",function(e,t){var n=e.Lang.isFunction,r=function(){},i={processArgs:function(e){var t=n(e[2])?2:3;return n(e[t])?e.splice(t,1)[0]:r},on:function(e,t,n,r){var i=t.args?t.args.slice():[];i.unshift(null),t._detach=e[r?"delegate":"on"]({mouseenter:function(e){e.phase="over",n.fire(e)},mouseleave:function(e){var n=t.context||this;i[0]=e,e.type="hover",e.phase="out",t._extra.apply(n,i)}},r)},detach:function(e,t,n){t._detach.detach()}};i.delegate=i.on,i.detachDelegate=i.detach,e.Event.define("hover",i)},"3.8.0pr2",{requires:["event-mouseenter"]});
|
/*!
* jQuery JavaScript Library v2.0.2 -sizzle,-wrap,-offset
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2013-06-03T15:27Z
*/
(function( window, undefined ) {
// Can't do this because several apps including ASP.NET trace
// the stack via arguments.caller.callee and Firefox dies if
// you try to trace through "use strict" call chains. (#13335)
// Support: Firefox 18+
//"use strict";
var
// A central reference to the root jQuery(document)
rootjQuery,
// The deferred used on DOM ready
readyList,
// Support: IE9
// For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
core_strundefined = typeof undefined,
// Use the correct document accordingly with window argument (sandbox)
location = window.location,
document = window.document,
docElem = document.documentElement,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// [[Class]] -> type pairs
class2type = {},
// List of deleted data cache ids, so we can reuse them
core_deletedIds = [],
core_version = "2.0.2 -sizzle,-wrap,-offset",
// Save a reference to some core methods
core_concat = core_deletedIds.concat,
core_push = core_deletedIds.push,
core_slice = core_deletedIds.slice,
core_indexOf = core_deletedIds.indexOf,
core_toString = class2type.toString,
core_hasOwn = class2type.hasOwnProperty,
core_trim = core_version.trim,
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
// Used for matching numbers
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
// Used for splitting on whitespace
core_rnotwhite = /\S+/g,
// A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Strict HTML recognition (#11290: must start with <)
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
// Matches dashed string for camelizing
rmsPrefix = /^-ms-/,
rdashAlpha = /-([\da-z])/gi,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return letter.toUpperCase();
},
// The ready event handler and self cleanup method
completed = function() {
document.removeEventListener( "DOMContentLoaded", completed, false );
window.removeEventListener( "load", completed, false );
jQuery.ready();
};
jQuery.fn = jQuery.prototype = {
// The current version of jQuery being used
jquery: core_version,
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];
} else {
match = rquickExpr.exec( selector );
}
// Match html or make sure no context is specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
context = context instanceof jQuery ? context[0] : context;
// scripts is true for back-compat
jQuery.merge( this, jQuery.parseHTML(
match[1],
context && context.nodeType ? context.ownerDocument || context : document,
true
) );
// HANDLE: $(html, props)
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
for ( match in context ) {
// Properties of context are called as methods if possible
if ( jQuery.isFunction( this[ match ] ) ) {
this[ match ]( context[ match ] );
// ...and otherwise set as attributes
} else {
this.attr( match, context[ match ] );
}
}
}
return this;
// HANDLE: $(#id)
} else {
elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Inject the element directly into the jQuery object
this.length = 1;
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return ( context || rootjQuery ).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
return this.constructor( context ).find( selector );
}
// HANDLE: $(DOMElement)
} else if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
if ( selector.selector !== undefined ) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The default length of a jQuery object is 0
length: 0,
toArray: function() {
return core_slice.call( this );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num == null ?
// Return a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems ) {
// Build a new jQuery matched element set
var ret = jQuery.merge( this.constructor(), elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context = this.context;
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
return jQuery.each( this, callback, args );
},
ready: function( fn ) {
// Add the callback
jQuery.ready.promise().done( fn );
return this;
},
slice: function() {
return this.pushStack( core_slice.apply( this, arguments ) );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
eq: function( i ) {
var len = this.length,
j = +i + ( i < 0 ? len : 0 );
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || this.constructor(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: core_push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
target = {};
}
// extend jQuery itself if only one argument is passed
if ( length === i ) {
target = this;
--i;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
clone = src && jQuery.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend({
// Unique for each copy of jQuery on the page
expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
} else {
jQuery.ready( true );
}
},
// Handle when the DOM is ready
ready: function( wait ) {
// Abort if there are pending holds or we're already ready
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
return;
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
readyList.resolveWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger("ready").off("ready");
}
},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return jQuery.type(obj) === "function";
},
isArray: Array.isArray,
isWindow: function( obj ) {
return obj != null && obj === obj.window;
},
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
},
type: function( obj ) {
if ( obj == null ) {
return String( obj );
}
// Support: Safari <= 5.1 (functionish RegExp)
return typeof obj === "object" || typeof obj === "function" ?
class2type[ core_toString.call(obj) ] || "object" :
typeof obj;
},
isPlainObject: function( obj ) {
// Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]"
// - DOM nodes
// - window
if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
return false;
}
// Support: Firefox <20
// The try/catch suppresses exceptions thrown when attempting to access
// the "constructor" property of certain host objects, ie. |window.location|
// https://bugzilla.mozilla.org/show_bug.cgi?id=814622
try {
if ( obj.constructor &&
!core_hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
return false;
}
} catch ( e ) {
return false;
}
// If the function hasn't returned already, we're confident that
// |obj| is a plain object, created by {} or constructed with new Object
return true;
},
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw new Error( msg );
},
// data: string of html
// context (optional): If specified, the fragment will be created in this context, defaults to document
// keepScripts (optional): If true, will include scripts passed in the html string
parseHTML: function( data, context, keepScripts ) {
if ( !data || typeof data !== "string" ) {
return null;
}
if ( typeof context === "boolean" ) {
keepScripts = context;
context = false;
}
context = context || document;
var parsed = rsingleTag.exec( data ),
scripts = !keepScripts && [];
// Single tag
if ( parsed ) {
return [ context.createElement( parsed[1] ) ];
}
parsed = jQuery.buildFragment( [ data ], context, scripts );
if ( scripts ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [], parsed.childNodes );
},
parseJSON: JSON.parse,
// Cross-browser xml parsing
parseXML: function( data ) {
var xml, tmp;
if ( !data || typeof data !== "string" ) {
return null;
}
// Support: IE9
try {
tmp = new DOMParser();
xml = tmp.parseFromString( data , "text/xml" );
} catch ( e ) {
xml = undefined;
}
if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
jQuery.error( "Invalid XML: " + data );
}
return xml;
},
noop: function() {},
// Evaluates a script in a global context
globalEval: function( code ) {
var script,
indirect = eval;
code = jQuery.trim( code );
if ( code ) {
// If the code includes a valid, prologue position
// strict mode pragma, execute code by injecting a
// script tag into the document.
if ( code.indexOf("use strict") === 1 ) {
script = document.createElement("script");
script.text = code;
document.head.appendChild( script ).parentNode.removeChild( script );
} else {
// Otherwise, avoid the DOM node creation, insertion
// and removal by using an indirect global eval
indirect( code );
}
}
},
// Convert dashed to camelCase; used by the css and data modules
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},
// args is for internal usage only
each: function( obj, callback, args ) {
var value,
i = 0,
length = obj.length,
isArray = isArraylike( obj );
if ( args ) {
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback.apply( obj[ i ], args );
if ( value === false ) {
break;
}
}
} else {
for ( i in obj ) {
value = callback.apply( obj[ i ], args );
if ( value === false ) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback.call( obj[ i ], i, obj[ i ] );
if ( value === false ) {
break;
}
}
} else {
for ( i in obj ) {
value = callback.call( obj[ i ], i, obj[ i ] );
if ( value === false ) {
break;
}
}
}
}
return obj;
},
trim: function( text ) {
return text == null ? "" : core_trim.call( text );
},
// results is for internal usage only
makeArray: function( arr, results ) {
var ret = results || [];
if ( arr != null ) {
if ( isArraylike( Object(arr) ) ) {
jQuery.merge( ret,
typeof arr === "string" ?
[ arr ] : arr
);
} else {
core_push.call( ret, arr );
}
}
return ret;
},
inArray: function( elem, arr, i ) {
return arr == null ? -1 : core_indexOf.call( arr, elem, i );
},
merge: function( first, second ) {
var l = second.length,
i = first.length,
j = 0;
if ( typeof l === "number" ) {
for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var retVal,
ret = [],
i = 0,
length = elems.length;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var value,
i = 0,
length = elems.length,
isArray = isArraylike( elems ),
ret = [];
// Go through the array, translating each of the items to their
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
// Go through every key on the object,
} else {
for ( i in elems ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
}
// Flatten any nested arrays
return core_concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
var tmp, args, proxy;
if ( typeof context === "string" ) {
tmp = fn[ context ];
context = fn;
fn = tmp;
}
// Quick check to determine if target is callable, in the spec
// this throws a TypeError, but we will just return undefined.
if ( !jQuery.isFunction( fn ) ) {
return undefined;
}
// Simulated bind
args = core_slice.call( arguments, 2 );
proxy = function() {
return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
};
// Set the guid of unique handler to the same of original handler, so it can be removed
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
return proxy;
},
// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
length = elems.length,
bulk = key == null;
// Sets many values
if ( jQuery.type( key ) === "object" ) {
chainable = true;
for ( i in key ) {
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
}
// Sets one value
} else if ( value !== undefined ) {
chainable = true;
if ( !jQuery.isFunction( value ) ) {
raw = true;
}
if ( bulk ) {
// Bulk operations run against the entire set
if ( raw ) {
fn.call( elems, value );
fn = null;
// ...except when executing function values
} else {
bulk = fn;
fn = function( elem, key, value ) {
return bulk.call( jQuery( elem ), value );
};
}
}
if ( fn ) {
for ( ; i < length; i++ ) {
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
}
}
}
return chainable ?
elems :
// Gets
bulk ?
fn.call( elems ) :
length ? fn( elems[0], key ) : emptyGet;
},
now: Date.now,
// A method for quickly swapping in/out CSS properties to get correct calculations.
// Note: this method belongs to the css module but it's needed here for the support module.
// If support gets modularized, this method should be moved back to the css module.
swap: function( elem, options, callback, args ) {
var ret, name,
old = {};
// Remember the old values, and insert the new ones
for ( name in options ) {
old[ name ] = elem.style[ name ];
elem.style[ name ] = options[ name ];
}
ret = callback.apply( elem, args || [] );
// Revert the old values
for ( name in options ) {
elem.style[ name ] = old[ name ];
}
return ret;
}
});
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
// Catch cases where $(document).ready() is called after the browser event has already occurred.
// we once tried to use readyState "interactive" here, but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
setTimeout( jQuery.ready );
} else {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", completed, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", completed, false );
}
}
return readyList.promise( obj );
};
// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
});
function isArraylike( obj ) {
var length = obj.length,
type = jQuery.type( obj );
if ( jQuery.isWindow( obj ) ) {
return false;
}
if ( obj.nodeType === 1 && length ) {
return true;
}
return type === "array" || type !== "function" &&
( length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
/*
* Optional (non-Sizzle) selector module for custom builds.
*
* Note that this DOES NOT SUPPORT many documented jQuery
* features in exchange for its smaller size:
*
* Attribute not equal selector
* Positional selectors (:first; :eq(n); :odd; etc.)
* Type selectors (:input; :checkbox; :button; etc.)
* State-based selectors (:animated; :visible; :hidden; etc.)
* :has(selector)
* :not(complex selector)
* custom selectors via Sizzle extensions
* Leading combinators (e.g., $collection.find("> *"))
* Reliable functionality on XML fragments
* Requiring all parts of a selector to match elements under context
* (e.g., $div.find("div > *") now matches children of $div)
* Matching against non-elements
* Reliable sorting of disconnected nodes
* querySelectorAll bug fixes (e.g., unreliable :focus on WebKit)
*
* If any of these are unacceptable tradeoffs, either use Sizzle or
* customize this stub for the project's specific needs.
*/
var selector_hasDuplicate,
matches = docElem.webkitMatchesSelector ||
docElem.mozMatchesSelector ||
docElem.oMatchesSelector ||
docElem.msMatchesSelector,
selector_sortOrder = function( a, b ) {
// Flag for duplicate removal
if ( a === b ) {
selector_hasDuplicate = true;
return 0;
}
var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
if ( compare ) {
// Disconnected nodes
if ( compare & 1 ) {
// Choose the first element that is related to our document
if ( a === document || jQuery.contains(document, a) ) {
return -1;
}
if ( b === document || jQuery.contains(document, b) ) {
return 1;
}
// Maintain original order
return 0;
}
return compare & 4 ? -1 : 1;
}
// Not directly comparable, sort on existence of method
return a.compareDocumentPosition ? -1 : 1;
};
jQuery.extend({
find: function( selector, context, results, seed ) {
var elem, nodeType,
i = 0;
results = results || [];
context = context || document;
// Same basic safeguard as Sizzle
if ( !selector || typeof selector !== "string" ) {
return results;
}
// Early return if context is not an element or document
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
return [];
}
if ( seed ) {
while ( (elem = seed[i++]) ) {
if ( jQuery.find.matchesSelector(elem, selector) ) {
results.push( elem );
}
}
} else {
jQuery.merge( results, context.querySelectorAll(selector) );
}
return results;
},
unique: function( results ) {
var elem,
duplicates = [],
i = 0,
j = 0;
selector_hasDuplicate = false;
results.sort( selector_sortOrder );
if ( selector_hasDuplicate ) {
while ( (elem = results[i++]) ) {
if ( elem === results[ i ] ) {
j = duplicates.push( i );
}
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
return results;
},
text: function( elem ) {
var node,
ret = "",
i = 0,
nodeType = elem.nodeType;
if ( !nodeType ) {
// If no nodeType, this is expected to be an array
while ( (node = elem[i++]) ) {
// Do not traverse comment nodes
ret += jQuery.text( node );
}
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
// Use textContent for elements
return elem.textContent;
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}
// Do not include comment or processing instruction nodes
return ret;
},
contains: function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && adown.contains(bup) );
},
isXMLDoc: function( elem ) {
return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML";
},
expr: {
attrHandle: {},
match: {
bool: /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,
needsContext: /^[\x20\t\r\n\f]*[>+~]/
}
}
});
jQuery.extend( jQuery.find, {
matches: function( expr, elements ) {
return jQuery.find( expr, null, null, elements );
},
matchesSelector: function( elem, expr ) {
return matches.call( elem, expr );
},
attr: function( elem, name ) {
return elem.getAttribute( name );
}
});
// String to Object options format cache
var optionsCache = {};
// Convert String-formatted options into Object-formatted ones and store in cache
function createOptions( options ) {
var object = optionsCache[ options ] = {};
jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
object[ flag ] = true;
});
return object;
}
/*
* Create a callback list using the following parameters:
*
* options: an optional list of space-separated options that will change how
* the callback list behaves or a more traditional option object
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible options:
*
* once: will ensure the callback list can only be fired once (like a Deferred)
*
* memory: will keep track of previous values and will call any callback added
* after the list has been fired right away with the latest "memorized"
* values (like a Deferred)
*
* unique: will ensure a callback can only be added once (no duplicate in the list)
*
* stopOnFalse: interrupt callings when a callback returns false
*
*/
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
( optionsCache[ options ] || createOptions( options ) ) :
jQuery.extend( {}, options );
var // Last fire value (for non-forgettable lists)
memory,
// Flag to know if list was already fired
fired,
// Flag to know if list is currently firing
firing,
// First callback to fire (used internally by add and fireWith)
firingStart,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// Actual callback list
list = [],
// Stack of fire calls for repeatable lists
stack = !options.once && [],
// Fire callbacks
fire = function( data ) {
memory = options.memory && data;
fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
firing = true;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
memory = false; // To prevent further calls using add
break;
}
}
firing = false;
if ( list ) {
if ( stack ) {
if ( stack.length ) {
fire( stack.shift() );
}
} else if ( memory ) {
list = [];
} else {
self.disable();
}
}
},
// Actual Callbacks object
self = {
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
// First, we save the current length
var start = list.length;
(function add( args ) {
jQuery.each( args, function( _, arg ) {
var type = jQuery.type( arg );
if ( type === "function" ) {
if ( !options.unique || !self.has( arg ) ) {
list.push( arg );
}
} else if ( arg && arg.length && type !== "string" ) {
// Inspect recursively
add( arg );
}
});
})( arguments );
// Do we need to add the callbacks to the
// current firing batch?
if ( firing ) {
firingLength = list.length;
// With memory, if we're not firing then
// we should call right away
} else if ( memory ) {
firingStart = start;
fire( memory );
}
}
return this;
},
// Remove a callback from the list
remove: function() {
if ( list ) {
jQuery.each( arguments, function( _, arg ) {
var index;
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( firing ) {
if ( index <= firingLength ) {
firingLength--;
}
if ( index <= firingIndex ) {
firingIndex--;
}
}
}
});
}
return this;
},
// Check if a given callback is in the list.
// If no argument is given, return whether or not list has callbacks attached.
has: function( fn ) {
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
},
// Remove all callbacks from the list
empty: function() {
list = [];
firingLength = 0;
return this;
},
// Have the list do nothing anymore
disable: function() {
list = stack = memory = undefined;
return this;
},
// Is it disabled?
disabled: function() {
return !list;
},
// Lock the list in its current state
lock: function() {
stack = undefined;
if ( !memory ) {
self.disable();
}
return this;
},
// Is it locked?
locked: function() {
return !stack;
},
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
if ( list && ( !fired || stack ) ) {
if ( firing ) {
stack.push( args );
} else {
fire( args );
}
}
return this;
},
// Call all the callbacks with the given arguments
fire: function() {
self.fireWith( this, arguments );
return this;
},
// To know if the callbacks have already been called at least once
fired: function() {
return !!fired;
}
};
return self;
};
jQuery.extend({
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
[ "notify", "progress", jQuery.Callbacks("memory") ]
],
state = "pending",
promise = {
state: function() {
return state;
},
always: function() {
deferred.done( arguments ).fail( arguments );
return this;
},
then: function( /* fnDone, fnFail, fnProgress */ ) {
var fns = arguments;
return jQuery.Deferred(function( newDefer ) {
jQuery.each( tuples, function( i, tuple ) {
var action = tuple[ 0 ],
fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
// deferred[ done | fail | progress ] for forwarding actions to newDefer
deferred[ tuple[1] ](function() {
var returned = fn && fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise()
.done( newDefer.resolve )
.fail( newDefer.reject )
.progress( newDefer.notify );
} else {
newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
}
});
});
fns = null;
}).promise();
},
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
return obj != null ? jQuery.extend( obj, promise ) : promise;
}
},
deferred = {};
// Keep pipe for back-compat
promise.pipe = promise.then;
// Add list-specific methods
jQuery.each( tuples, function( i, tuple ) {
var list = tuple[ 2 ],
stateString = tuple[ 3 ];
// promise[ done | fail | progress ] = list.add
promise[ tuple[1] ] = list.add;
// Handle state
if ( stateString ) {
list.add(function() {
// state = [ resolved | rejected ]
state = stateString;
// [ reject_list | resolve_list ].disable; progress_list.lock
}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
}
// deferred[ resolve | reject | notify ]
deferred[ tuple[0] ] = function() {
deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
return this;
};
deferred[ tuple[0] + "With" ] = list.fireWith;
});
// Make the deferred a promise
promise.promise( deferred );
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
}
// All done!
return deferred;
},
// Deferred helper
when: function( subordinate /* , ..., subordinateN */ ) {
var i = 0,
resolveValues = core_slice.call( arguments ),
length = resolveValues.length,
// the count of uncompleted subordinates
remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
// Update function for both resolve and progress values
updateFunc = function( i, contexts, values ) {
return function( value ) {
contexts[ i ] = this;
values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
if( values === progressValues ) {
deferred.notifyWith( contexts, values );
} else if ( !( --remaining ) ) {
deferred.resolveWith( contexts, values );
}
};
},
progressValues, progressContexts, resolveContexts;
// add listeners to Deferred subordinates; treat others as resolved
if ( length > 1 ) {
progressValues = new Array( length );
progressContexts = new Array( length );
resolveContexts = new Array( length );
for ( ; i < length; i++ ) {
if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
resolveValues[ i ].promise()
.done( updateFunc( i, resolveContexts, resolveValues ) )
.fail( deferred.reject )
.progress( updateFunc( i, progressContexts, progressValues ) );
} else {
--remaining;
}
}
}
// if we're not waiting on anything, resolve the master
if ( !remaining ) {
deferred.resolveWith( resolveContexts, resolveValues );
}
return deferred.promise();
}
});
jQuery.support = (function( support ) {
var input = document.createElement("input"),
fragment = document.createDocumentFragment(),
div = document.createElement("div"),
select = document.createElement("select"),
opt = select.appendChild( document.createElement("option") );
// Finish early in limited environments
if ( !input.type ) {
return support;
}
input.type = "checkbox";
// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
// Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
support.checkOn = input.value !== "";
// Must access the parent to make an option select properly
// Support: IE9, IE10
support.optSelected = opt.selected;
// Will be defined later
support.reliableMarginRight = true;
support.boxSizingReliable = true;
support.pixelPosition = false;
// Make sure checked status is properly cloned
// Support: IE9, IE10
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as disabled)
select.disabled = true;
support.optDisabled = !opt.disabled;
// Check if an input maintains its value after becoming a radio
// Support: IE9, IE10
input = document.createElement("input");
input.value = "t";
input.type = "radio";
support.radioValue = input.value === "t";
// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "checked", "t" );
input.setAttribute( "name", "t" );
fragment.appendChild( input );
// Support: Safari 5.1, Android 4.x, Android 2.3
// old WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
// Support: Firefox, Chrome, Safari
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
support.focusinBubbles = "onfocusin" in window;
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box";
// Run tests that need a body at doc ready
jQuery(function() {
var container, marginDiv,
// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",
body = document.getElementsByTagName("body")[ 0 ];
if ( !body ) {
// Return for frameset docs that don't have a body
return;
}
container = document.createElement("div");
container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
// Check box-sizing and margin behavior.
body.appendChild( container ).appendChild( div );
div.innerHTML = "";
// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%";
// Workaround failing boxSizing test due to offsetWidth returning wrong value
// with some non-1 values of body zoom, ticket #13543
jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
support.boxSizing = div.offsetWidth === 4;
});
// Use window.getComputedStyle because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
// Support: Android 2.3
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. (#3333)
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
marginDiv = div.appendChild( document.createElement("div") );
marginDiv.style.cssText = div.style.cssText = divReset;
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
support.reliableMarginRight =
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
}
body.removeChild( container );
});
return support;
})( {} );
/*
Implementation Summary
1. Enforce API surface and semantic compatibility with 1.9.x branch
2. Improve the module's maintainability by reducing the storage
paths to a single mechanism.
3. Use the same single mechanism to support "private" and "user" data.
4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
5. Avoid exposing implementation details on user objects (eg. expando properties)
6. Provide a clear path for implementation upgrade to WeakMap in 2014
*/
var data_user, data_priv,
rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
function Data() {
// Support: Android < 4,
// Old WebKit does not have Object.preventExtensions/freeze method,
// return new empty object instead with no [[set]] accessor
Object.defineProperty( this.cache = {}, 0, {
get: function() {
return {};
}
});
this.expando = jQuery.expando + Math.random();
}
Data.uid = 1;
Data.accepts = function( owner ) {
// Accepts only:
// - Node
// - Node.ELEMENT_NODE
// - Node.DOCUMENT_NODE
// - Object
// - Any
return owner.nodeType ?
owner.nodeType === 1 || owner.nodeType === 9 : true;
};
Data.prototype = {
key: function( owner ) {
// We can accept data for non-element nodes in modern browsers,
// but we should not, see #8335.
// Always return the key for a frozen object.
if ( !Data.accepts( owner ) ) {
return 0;
}
var descriptor = {},
// Check if the owner object already has a cache key
unlock = owner[ this.expando ];
// If not, create one
if ( !unlock ) {
unlock = Data.uid++;
// Secure it in a non-enumerable, non-writable property
try {
descriptor[ this.expando ] = { value: unlock };
Object.defineProperties( owner, descriptor );
// Support: Android < 4
// Fallback to a less secure definition
} catch ( e ) {
descriptor[ this.expando ] = unlock;
jQuery.extend( owner, descriptor );
}
}
// Ensure the cache object
if ( !this.cache[ unlock ] ) {
this.cache[ unlock ] = {};
}
return unlock;
},
set: function( owner, data, value ) {
var prop,
// There may be an unlock assigned to this node,
// if there is no entry for this "owner", create one inline
// and set the unlock as though an owner entry had always existed
unlock = this.key( owner ),
cache = this.cache[ unlock ];
// Handle: [ owner, key, value ] args
if ( typeof data === "string" ) {
cache[ data ] = value;
// Handle: [ owner, { properties } ] args
} else {
// Fresh assignments by object are shallow copied
if ( jQuery.isEmptyObject( cache ) ) {
jQuery.extend( this.cache[ unlock ], data );
// Otherwise, copy the properties one-by-one to the cache object
} else {
for ( prop in data ) {
cache[ prop ] = data[ prop ];
}
}
}
return cache;
},
get: function( owner, key ) {
// Either a valid cache is found, or will be created.
// New caches will be created and the unlock returned,
// allowing direct access to the newly created
// empty data object. A valid owner object must be provided.
var cache = this.cache[ this.key( owner ) ];
return key === undefined ?
cache : cache[ key ];
},
access: function( owner, key, value ) {
// In cases where either:
//
// 1. No key was specified
// 2. A string key was specified, but no value provided
//
// Take the "read" path and allow the get method to determine
// which value to return, respectively either:
//
// 1. The entire cache object
// 2. The data stored at the key
//
if ( key === undefined ||
((key && typeof key === "string") && value === undefined) ) {
return this.get( owner, key );
}
// [*]When the key is not a string, or both a key and value
// are specified, set or extend (existing objects) with either:
//
// 1. An object of properties
// 2. A key and value
//
this.set( owner, key, value );
// Since the "set" path can have two possible entry points
// return the expected data based on which path was taken[*]
return value !== undefined ? value : key;
},
remove: function( owner, key ) {
var i, name, camel,
unlock = this.key( owner ),
cache = this.cache[ unlock ];
if ( key === undefined ) {
this.cache[ unlock ] = {};
} else {
// Support array or space separated string of keys
if ( jQuery.isArray( key ) ) {
// If "name" is an array of keys...
// When data is initially created, via ("key", "val") signature,
// keys will be converted to camelCase.
// Since there is no way to tell _how_ a key was added, remove
// both plain key and camelCase key. #12786
// This will only penalize the array argument path.
name = key.concat( key.map( jQuery.camelCase ) );
} else {
camel = jQuery.camelCase( key );
// Try the string as a key before any manipulation
if ( key in cache ) {
name = [ key, camel ];
} else {
// If a key with the spaces exists, use it.
// Otherwise, create an array by matching non-whitespace
name = camel;
name = name in cache ?
[ name ] : ( name.match( core_rnotwhite ) || [] );
}
}
i = name.length;
while ( i-- ) {
delete cache[ name[ i ] ];
}
}
},
hasData: function( owner ) {
return !jQuery.isEmptyObject(
this.cache[ owner[ this.expando ] ] || {}
);
},
discard: function( owner ) {
if ( owner[ this.expando ] ) {
delete this.cache[ owner[ this.expando ] ];
}
}
};
// These may be used throughout the jQuery core codebase
data_user = new Data();
data_priv = new Data();
jQuery.extend({
acceptData: Data.accepts,
hasData: function( elem ) {
return data_user.hasData( elem ) || data_priv.hasData( elem );
},
data: function( elem, name, data ) {
return data_user.access( elem, name, data );
},
removeData: function( elem, name ) {
data_user.remove( elem, name );
},
// TODO: Now that all calls to _data and _removeData have been replaced
// with direct calls to data_priv methods, these can be deprecated.
_data: function( elem, name, data ) {
return data_priv.access( elem, name, data );
},
_removeData: function( elem, name ) {
data_priv.remove( elem, name );
}
});
jQuery.fn.extend({
data: function( key, value ) {
var attrs, name,
elem = this[ 0 ],
i = 0,
data = null;
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
data = data_user.get( elem );
if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
attrs = elem.attributes;
for ( ; i < attrs.length; i++ ) {
name = attrs[ i ].name;
if ( name.indexOf( "data-" ) === 0 ) {
name = jQuery.camelCase( name.slice(5) );
dataAttr( elem, name, data[ name ] );
}
}
data_priv.set( elem, "hasDataAttrs", true );
}
}
return data;
}
// Sets multiple values
if ( typeof key === "object" ) {
return this.each(function() {
data_user.set( this, key );
});
}
return jQuery.access( this, function( value ) {
var data,
camelKey = jQuery.camelCase( key );
// The calling jQuery object (element matches) is not empty
// (and therefore has an element appears at this[ 0 ]) and the
// `value` parameter was not undefined. An empty jQuery object
// will result in `undefined` for elem = this[ 0 ] which will
// throw an exception if an attempt to read a data cache is made.
if ( elem && value === undefined ) {
// Attempt to get data from the cache
// with the key as-is
data = data_user.get( elem, key );
if ( data !== undefined ) {
return data;
}
// Attempt to get data from the cache
// with the key camelized
data = data_user.get( elem, camelKey );
if ( data !== undefined ) {
return data;
}
// Attempt to "discover" the data in
// HTML5 custom data-* attrs
data = dataAttr( elem, camelKey, undefined );
if ( data !== undefined ) {
return data;
}
// We tried really hard, but the data doesn't exist.
return;
}
// Set the data...
this.each(function() {
// First, attempt to store a copy or reference of any
// data that might've been store with a camelCased key.
var data = data_user.get( this, camelKey );
// For HTML5 data-* attribute interop, we have to
// store property names with dashes in a camelCase form.
// This might not apply to all properties...*
data_user.set( this, camelKey, value );
// *... In the case of properties that might _actually_
// have dashes, we need to also store a copy of that
// unchanged property.
if ( key.indexOf("-") !== -1 && data !== undefined ) {
data_user.set( this, key, value );
}
});
}, null, value, arguments.length > 1, null, true );
},
removeData: function( key ) {
return this.each(function() {
data_user.remove( this, key );
});
}
});
function dataAttr( elem, key, data ) {
var name;
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
// Only convert to a number if it doesn't change the string
+data + "" === data ? +data :
rbrace.test( data ) ? JSON.parse( data ) :
data;
} catch( e ) {}
// Make sure we set the data so it isn't changed later
data_user.set( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
jQuery.extend({
queue: function( elem, type, data ) {
var queue;
if ( elem ) {
type = ( type || "fx" ) + "queue";
queue = data_priv.get( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !queue || jQuery.isArray( data ) ) {
queue = data_priv.access( elem, type, jQuery.makeArray(data) );
} else {
queue.push( data );
}
}
return queue || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
startLength = queue.length,
fn = queue.shift(),
hooks = jQuery._queueHooks( elem, type ),
next = function() {
jQuery.dequeue( elem, type );
};
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
startLength--;
}
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift( "inprogress" );
}
// clear up the last queue stop function
delete hooks.stop;
fn.call( elem, next, hooks );
}
if ( !startLength && hooks ) {
hooks.empty.fire();
}
},
// not intended for public consumption - generates a queueHooks object, or returns the current one
_queueHooks: function( elem, type ) {
var key = type + "queueHooks";
return data_priv.get( elem, key ) || data_priv.access( elem, key, {
empty: jQuery.Callbacks("once memory").add(function() {
data_priv.remove( elem, [ type + "queue", key ] );
})
});
}
});
jQuery.fn.extend({
queue: function( type, data ) {
var setter = 2;
if ( typeof type !== "string" ) {
data = type;
type = "fx";
setter--;
}
if ( arguments.length < setter ) {
return jQuery.queue( this[0], type );
}
return data === undefined ?
this :
this.each(function() {
var queue = jQuery.queue( this, type, data );
// ensure a hooks for this queue
jQuery._queueHooks( this, type );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
type = type || "fx";
return this.queue( type, function( next, hooks ) {
var timeout = setTimeout( next, time );
hooks.stop = function() {
clearTimeout( timeout );
};
});
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, obj ) {
var tmp,
count = 1,
defer = jQuery.Deferred(),
elements = this,
i = this.length,
resolve = function() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
};
if ( typeof type !== "string" ) {
obj = type;
type = undefined;
}
type = type || "fx";
while( i-- ) {
tmp = data_priv.get( elements[ i ], type + "queueHooks" );
if ( tmp && tmp.empty ) {
count++;
tmp.empty.add( resolve );
}
}
resolve();
return defer.promise( obj );
}
});
var nodeHook, boolHook,
rclass = /[\t\r\n\f]/g,
rreturn = /\r/g,
rfocusable = /^(?:input|select|textarea|button)$/i;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
},
removeProp: function( name ) {
return this.each(function() {
delete this[ jQuery.propFix[ name ] || name ];
});
},
addClass: function( value ) {
var classes, elem, cur, clazz, j,
i = 0,
len = this.length,
proceed = typeof value === "string" && value;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).addClass( value.call( this, j, this.className ) );
});
}
if ( proceed ) {
// The disjunction here is for better compressibility (see removeClass)
classes = ( value || "" ).match( core_rnotwhite ) || [];
for ( ; i < len; i++ ) {
elem = this[ i ];
cur = elem.nodeType === 1 && ( elem.className ?
( " " + elem.className + " " ).replace( rclass, " " ) :
" "
);
if ( cur ) {
j = 0;
while ( (clazz = classes[j++]) ) {
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
}
elem.className = jQuery.trim( cur );
}
}
}
return this;
},
removeClass: function( value ) {
var classes, elem, cur, clazz, j,
i = 0,
len = this.length,
proceed = arguments.length === 0 || typeof value === "string" && value;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call( this, j, this.className ) );
});
}
if ( proceed ) {
classes = ( value || "" ).match( core_rnotwhite ) || [];
for ( ; i < len; i++ ) {
elem = this[ i ];
// This expression is here for better compressibility (see addClass)
cur = elem.nodeType === 1 && ( elem.className ?
( " " + elem.className + " " ).replace( rclass, " " ) :
""
);
if ( cur ) {
j = 0;
while ( (clazz = classes[j++]) ) {
// Remove *all* instances
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
cur = cur.replace( " " + clazz + " ", " " );
}
}
elem.className = value ? jQuery.trim( cur ) : "";
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function( i ) {
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.match( core_rnotwhite ) || [];
while ( (className = classNames[ i++ ]) ) {
// check each className given, space separated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
// Toggle whole class name
} else if ( type === core_strundefined || type === "boolean" ) {
if ( this.className ) {
// store className if set
data_priv.set( this, "__className__", this.className );
}
// If the element has a class name or if we're passed "false",
// then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored.
this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
var className = " " + selector + " ",
i = 0,
l = this.length;
for ( ; i < l; i++ ) {
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
return true;
}
}
return false;
},
val: function( value ) {
var hooks, ret, isFunction,
elem = this[0];
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
}
ret = elem.value;
return typeof ret === "string" ?
// handle most common string cases
ret.replace(rreturn, "") :
// handle cases where value is null/undef or number
ret == null ? "" : ret;
}
return;
}
isFunction = jQuery.isFunction( value );
return this.each(function( i ) {
var val;
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, jQuery( this ).val() );
} else {
val = value;
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray( val ) ) {
val = jQuery.map(val, function ( value ) {
return value == null ? "" : value + "";
});
}
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
});
}
});
jQuery.extend({
valHooks: {
option: {
get: function( elem ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
select: {
get: function( elem ) {
var value, option,
options = elem.options,
index = elem.selectedIndex,
one = elem.type === "select-one" || index < 0,
values = one ? null : [],
max = one ? index + 1 : options.length,
i = index < 0 ?
max :
one ? index : 0;
// Loop through all the selected options
for ( ; i < max; i++ ) {
option = options[ i ];
// IE6-9 doesn't update selected after form reset (#2551)
if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup
( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
// Get the specific value for the option
value = jQuery( option ).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
return values;
},
set: function( elem, value ) {
var optionSet, option,
options = elem.options,
values = jQuery.makeArray( value ),
i = options.length;
while ( i-- ) {
option = options[ i ];
if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
optionSet = true;
}
}
// force browsers to behave consistently when non-matching value is set
if ( !optionSet ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
attr: function( elem, name, value ) {
var hooks, ret,
nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
// Fallback to prop when attributes are not supported
if ( typeof elem.getAttribute === core_strundefined ) {
return jQuery.prop( elem, name, value );
}
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] ||
( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
} else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, value + "" );
return value;
}
} else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
ret = jQuery.find.attr( elem, name );
// Non-existent attributes return null, we normalize to undefined
return ret == null ?
undefined :
ret;
}
},
removeAttr: function( elem, value ) {
var name, propName,
i = 0,
attrNames = value && value.match( core_rnotwhite );
if ( attrNames && elem.nodeType === 1 ) {
while ( (name = attrNames[i++]) ) {
propName = jQuery.propFix[ name ] || name;
// Boolean attributes get special treatment (#10870)
if ( jQuery.expr.match.bool.test( name ) ) {
// Set corresponding property to false
elem[ propName ] = false;
}
elem.removeAttribute( name );
}
}
},
attrHooks: {
type: {
set: function( elem, value ) {
if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to default in case type is set after value during creation
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
elem.value = val;
}
return value;
}
}
}
},
propFix: {
"for": "htmlFor",
"class": "className"
},
prop: function( elem, name, value ) {
var ret, hooks, notxml,
nType = elem.nodeType;
// don't get/set properties on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
if ( notxml ) {
// Fix name and attach hooks
name = jQuery.propFix[ name ] || name;
hooks = jQuery.propHooks[ name ];
}
if ( value !== undefined ) {
return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
ret :
( elem[ name ] = value );
} else {
return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
ret :
elem[ name ];
}
},
propHooks: {
tabIndex: {
get: function( elem ) {
return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
elem.tabIndex :
-1;
}
}
}
});
// Hooks for boolean attributes
boolHook = {
set: function( elem, value, name ) {
if ( value === false ) {
// Remove boolean attributes when set to false
jQuery.removeAttr( elem, name );
} else {
elem.setAttribute( name, name );
}
return name;
}
};
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
jQuery.expr.attrHandle[ name ] = function( elem, name, isXML ) {
var fn = jQuery.expr.attrHandle[ name ],
ret = isXML ?
undefined :
/* jshint eqeqeq: false */
// Temporarily disable this handler to check existence
(jQuery.expr.attrHandle[ name ] = undefined) !=
getter( elem, name, isXML ) ?
name.toLowerCase() :
null;
// Restore handler
jQuery.expr.attrHandle[ name ] = fn;
return ret;
};
});
// Support: IE9+
// Selectedness for an option in an optgroup can be inaccurate
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = {
get: function( elem ) {
var parent = elem.parentNode;
if ( parent && parent.parentNode ) {
parent.parentNode.selectedIndex;
}
return null;
}
};
}
jQuery.each([
"tabIndex",
"readOnly",
"maxLength",
"cellSpacing",
"cellPadding",
"rowSpan",
"colSpan",
"useMap",
"frameBorder",
"contentEditable"
], function() {
jQuery.propFix[ this.toLowerCase() ] = this;
});
// Radios and checkboxes getter/setter
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
};
if ( !jQuery.support.checkOn ) {
jQuery.valHooks[ this ].get = function( elem ) {
// Support: Webkit
// "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
};
}
});
var rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
function returnTrue() {
return true;
}
function returnFalse() {
return false;
}
function safeActiveElement() {
try {
return document.activeElement;
} catch ( err ) { }
}
/*
* Helper functions for managing events -- not part of the public interface.
* Props to Dean Edwards' addEvent library for many of the ideas.
*/
jQuery.event = {
global: {},
add: function( elem, types, handler, data, selector ) {
var handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
elemData = data_priv.get( elem );
// Don't attach events to noData or text/comment nodes (but allow plain objects)
if ( !elemData ) {
return;
}
// Caller can pass in an object of custom data in lieu of the handler
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
selector = handleObjIn.selector;
}
// Make sure that the handler has a unique ID, used to find/remove it later
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure and main handler, if this is the first
if ( !(events = elemData.events) ) {
events = elemData.events = {};
}
if ( !(eventHandle = elemData.handle) ) {
eventHandle = elemData.handle = function( e ) {
// Discard the second event of a jQuery.event.trigger() and
// when an event is called after a page has unloaded
return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
undefined;
};
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
eventHandle.elem = elem;
}
// Handle multiple events separated by a space
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// There *must* be a type, no attaching namespace-only handlers
if ( !type ) {
continue;
}
// If event changes its type, use the special event handlers for the changed type
special = jQuery.event.special[ type ] || {};
// If selector defined, determine special event api type, otherwise given type
type = ( selector ? special.delegateType : special.bindType ) || type;
// Update special based on newly reset type
special = jQuery.event.special[ type ] || {};
// handleObj is passed to all event handlers
handleObj = jQuery.extend({
type: type,
origType: origType,
data: data,
handler: handler,
guid: handler.guid,
selector: selector,
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join(".")
}, handleObjIn );
// Init the event handler queue if we're the first
if ( !(handlers = events[ type ]) ) {
handlers = events[ type ] = [];
handlers.delegateCount = 0;
// Only use addEventListener if the special events handler returns false
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle, false );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add to the element's handler list, delegates in front
if ( selector ) {
handlers.splice( handlers.delegateCount++, 0, handleObj );
} else {
handlers.push( handleObj );
}
// Keep track of which events have ever been used, for event optimization
jQuery.event.global[ type ] = true;
}
// Nullify elem to prevent memory leaks in IE
elem = null;
},
// Detach an event or set of events from an element
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, origCount, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
elemData = data_priv.hasData( elem ) && data_priv.get( elem );
if ( !elemData || !(events = elemData.events) ) {
return;
}
// Once for each type.namespace in types; type may be omitted
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// Unbind all events (on this namespace, if provided) for the element
if ( !type ) {
for ( type in events ) {
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
}
continue;
}
special = jQuery.event.special[ type ] || {};
type = ( selector ? special.delegateType : special.bindType ) || type;
handlers = events[ type ] || [];
tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
// Remove matching events
origCount = j = handlers.length;
while ( j-- ) {
handleObj = handlers[ j ];
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );
if ( handleObj.selector ) {
handlers.delegateCount--;
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
}
// Remove generic event handler if we removed something and no more handlers exist
// (avoids potential for endless recursion during removal of special event handlers)
if ( origCount && !handlers.length ) {
if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
delete elemData.handle;
data_priv.remove( elem, "events" );
}
},
trigger: function( event, data, elem, onlyHandlers ) {
var i, cur, tmp, bubbleType, ontype, handle, special,
eventPath = [ elem || document ],
type = core_hasOwn.call( event, "type" ) ? event.type : event,
namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
cur = tmp = elem = elem || document;
// Don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// focus/blur morphs to focusin/out; ensure we're not firing them right now
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
return;
}
if ( type.indexOf(".") >= 0 ) {
// Namespaced trigger; create a regexp to match event type in handle()
namespaces = type.split(".");
type = namespaces.shift();
namespaces.sort();
}
ontype = type.indexOf(":") < 0 && "on" + type;
// Caller can pass in a jQuery.Event object, Object, or just an event type string
event = event[ jQuery.expando ] ?
event :
new jQuery.Event( type, typeof event === "object" && event );
// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
event.isTrigger = onlyHandlers ? 2 : 3;
event.namespace = namespaces.join(".");
event.namespace_re = event.namespace ?
new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
null;
// Clean up the event in case it is being reused
event.result = undefined;
if ( !event.target ) {
event.target = elem;
}
// Clone any incoming data and prepend the event, creating the handler arg list
data = data == null ?
[ event ] :
jQuery.makeArray( data, [ event ] );
// Allow special events to draw outside the lines
special = jQuery.event.special[ type ] || {};
if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
return;
}
// Determine event propagation path in advance, per W3C events spec (#9951)
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
bubbleType = special.delegateType || type;
if ( !rfocusMorph.test( bubbleType + type ) ) {
cur = cur.parentNode;
}
for ( ; cur; cur = cur.parentNode ) {
eventPath.push( cur );
tmp = cur;
}
// Only add window if we got to document (e.g., not plain obj or detached DOM)
if ( tmp === (elem.ownerDocument || document) ) {
eventPath.push( tmp.defaultView || tmp.parentWindow || window );
}
}
// Fire handlers on the event path
i = 0;
while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
event.type = i > 1 ?
bubbleType :
special.bindType || type;
// jQuery handler
handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
if ( handle ) {
handle.apply( cur, data );
}
// Native handler
handle = ontype && cur[ ontype ];
if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
event.preventDefault();
}
}
event.type = type;
// If nobody prevented the default action, do it now
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
jQuery.acceptData( elem ) ) {
// Call a native DOM method on the target with the same name name as the event.
// Don't do default actions on window, that's where global variables be (#6170)
if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
tmp = elem[ ontype ];
if ( tmp ) {
elem[ ontype ] = null;
}
// Prevent re-triggering of the same event, since we already bubbled it above
jQuery.event.triggered = type;
elem[ type ]();
jQuery.event.triggered = undefined;
if ( tmp ) {
elem[ ontype ] = tmp;
}
}
}
}
return event.result;
},
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event );
var i, j, ret, matched, handleObj,
handlerQueue = [],
args = core_slice.call( arguments ),
handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
special = jQuery.event.special[ event.type ] || {};
// Use the fix-ed jQuery.Event rather than the (read-only) native event
args[0] = event;
event.delegateTarget = this;
// Call the preDispatch hook for the mapped type, and let it bail if desired
if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
return;
}
// Determine handlers
handlerQueue = jQuery.event.handlers.call( this, event, handlers );
// Run delegates first; they may want to stop propagation beneath us
i = 0;
while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
event.currentTarget = matched.elem;
j = 0;
while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
// Triggered event must either 1) have no namespace, or
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
event.handleObj = handleObj;
event.data = handleObj.data;
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
.apply( matched.elem, args );
if ( ret !== undefined ) {
if ( (event.result = ret) === false ) {
event.preventDefault();
event.stopPropagation();
}
}
}
}
}
// Call the postDispatch hook for the mapped type
if ( special.postDispatch ) {
special.postDispatch.call( this, event );
}
return event.result;
},
handlers: function( event, handlers ) {
var i, matches, sel, handleObj,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
// Find delegate handlers
// Black-hole SVG <use> instance trees (#13180)
// Avoid non-left-click bubbling in Firefox (#3861)
if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
for ( ; cur !== this; cur = cur.parentNode || this ) {
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
if ( cur.disabled !== true || event.type !== "click" ) {
matches = [];
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];
// Don't conflict with Object.prototype properties (#13203)
sel = handleObj.selector + " ";
if ( matches[ sel ] === undefined ) {
matches[ sel ] = handleObj.needsContext ?
jQuery( sel, this ).index( cur ) >= 0 :
jQuery.find( sel, this, null, [ cur ] ).length;
}
if ( matches[ sel ] ) {
matches.push( handleObj );
}
}
if ( matches.length ) {
handlerQueue.push({ elem: cur, handlers: matches });
}
}
}
}
// Add the remaining (directly-bound) handlers
if ( delegateCount < handlers.length ) {
handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
}
return handlerQueue;
},
// Includes some event props shared by KeyEvent and MouseEvent
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "),
filter: function( event, original ) {
// Add which for key events
if ( event.which == null ) {
event.which = original.charCode != null ? original.charCode : original.keyCode;
}
return event;
}
},
mouseHooks: {
props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function( event, original ) {
var eventDoc, doc, body,
button = original.button;
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && button !== undefined ) {
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
}
return event;
}
},
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
// Create a writable copy of the event object and normalize some properties
var i, prop, copy,
type = event.type,
originalEvent = event,
fixHook = this.fixHooks[ type ];
if ( !fixHook ) {
this.fixHooks[ type ] = fixHook =
rmouseEvent.test( type ) ? this.mouseHooks :
rkeyEvent.test( type ) ? this.keyHooks :
{};
}
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
event = new jQuery.Event( originalEvent );
i = copy.length;
while ( i-- ) {
prop = copy[ i ];
event[ prop ] = originalEvent[ prop ];
}
// Support: Cordova 2.5 (WebKit) (#13255)
// All events should have a target; Cordova deviceready doesn't
if ( !event.target ) {
event.target = document;
}
// Support: Safari 6.0+, Chrome < 28
// Target should not be a text node (#504, #13143)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
},
special: {
load: {
// Prevent triggered image.load events from bubbling to window.load
noBubble: true
},
focus: {
// Fire native event if possible so blur/focus sequence is correct
trigger: function() {
if ( this !== safeActiveElement() && this.focus ) {
this.focus();
return false;
}
},
delegateType: "focusin"
},
blur: {
trigger: function() {
if ( this === safeActiveElement() && this.blur ) {
this.blur();
return false;
}
},
delegateType: "focusout"
},
click: {
// For checkbox, fire native event so checked state will be right
trigger: function() {
if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
this.click();
return false;
}
},
// For cross-browser consistency, don't fire native .click() on links
_default: function( event ) {
return jQuery.nodeName( event.target, "a" );
}
},
beforeunload: {
postDispatch: function( event ) {
// Support: Firefox 20+
// Firefox doesn't alert if the returnValue field is not set.
if ( event.result !== undefined ) {
event.originalEvent.returnValue = event.result;
}
}
}
},
simulate: function( type, elem, event, bubble ) {
// Piggyback on a donor event to simulate a different one.
// Fake originalEvent to avoid donor's stopPropagation, but if the
// simulated event prevents default then we do the same on the donor.
var e = jQuery.extend(
new jQuery.Event(),
event,
{
type: type,
isSimulated: true,
originalEvent: {}
}
);
if ( bubble ) {
jQuery.event.trigger( e, null, elem );
} else {
jQuery.event.dispatch.call( elem, e );
}
if ( e.isDefaultPrevented() ) {
event.preventDefault();
}
}
};
jQuery.removeEvent = function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
}
};
jQuery.Event = function( src, props ) {
// Allow instantiation without the 'new' keyword
if ( !(this instanceof jQuery.Event) ) {
return new jQuery.Event( src, props );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this.isDefaultPrevented = ( src.defaultPrevented ||
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
// Event type
} else {
this.type = src;
}
// Put explicitly provided properties onto the event object
if ( props ) {
jQuery.extend( this, props );
}
// Create a timestamp if incoming event doesn't have one
this.timeStamp = src && src.timeStamp || jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
};
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse,
preventDefault: function() {
var e = this.originalEvent;
this.isDefaultPrevented = returnTrue;
if ( e && e.preventDefault ) {
e.preventDefault();
}
},
stopPropagation: function() {
var e = this.originalEvent;
this.isPropagationStopped = returnTrue;
if ( e && e.stopPropagation ) {
e.stopPropagation();
}
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
}
};
// Create mouseenter/leave events using mouseover/out and event-time checks
// Support: Chrome 15+
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
delegateType: fix,
bindType: fix,
handle: function( event ) {
var ret,
target = this,
related = event.relatedTarget,
handleObj = event.handleObj;
// For mousenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
event.type = handleObj.origType;
ret = handleObj.handler.apply( this, arguments );
event.type = fix;
}
return ret;
}
};
});
// Create "bubbling" focus and blur events
// Support: Firefox, Chrome, Safari
if ( !jQuery.support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
var attaches = 0,
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
};
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
});
}
jQuery.fn.extend({
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
var origFn, type;
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
// ( types-Object, selector, data )
if ( typeof selector !== "string" ) {
// ( types-Object, data )
data = data || selector;
selector = undefined;
}
for ( type in types ) {
this.on( type, selector, data, types[ type ], one );
}
return this;
}
if ( data == null && fn == null ) {
// ( types, fn )
fn = selector;
data = selector = undefined;
} else if ( fn == null ) {
if ( typeof selector === "string" ) {
// ( types, selector, fn )
fn = data;
data = undefined;
} else {
// ( types, data, fn )
fn = data;
data = selector;
selector = undefined;
}
}
if ( fn === false ) {
fn = returnFalse;
} else if ( !fn ) {
return this;
}
if ( one === 1 ) {
origFn = fn;
fn = function( event ) {
// Can use an empty set, since event contains the info
jQuery().off( event );
return origFn.apply( this, arguments );
};
// Use same guid so caller can remove using origFn
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
}
return this.each( function() {
jQuery.event.add( this, types, fn, data, selector );
});
},
one: function( types, selector, data, fn ) {
return this.on( types, selector, data, fn, 1 );
},
off: function( types, selector, fn ) {
var handleObj, type;
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
handleObj = types.handleObj;
jQuery( types.delegateTarget ).off(
handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
handleObj.selector,
handleObj.handler
);
return this;
}
if ( typeof types === "object" ) {
// ( types-object [, selector] )
for ( type in types ) {
this.off( type, selector, types[ type ] );
}
return this;
}
if ( selector === false || typeof selector === "function" ) {
// ( types [, fn] )
fn = selector;
selector = undefined;
}
if ( fn === false ) {
fn = returnFalse;
}
return this.each(function() {
jQuery.event.remove( this, types, fn, selector );
});
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
var elem = this[0];
if ( elem ) {
return jQuery.event.trigger( type, data, elem, true );
}
}
});
var isSimple = /^.[^:#\[\.,]*$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var i,
ret = [],
self = this,
len = self.length;
if ( typeof selector !== "string" ) {
return this.pushStack( jQuery( selector ).filter(function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
}) );
}
for ( i = 0; i < len; i++ ) {
jQuery.find( selector, self[ i ], ret );
}
// Needed because $( selector, context ) becomes $( context ).find( selector )
ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
ret.selector = this.selector ? this.selector + " " + selector : selector;
return ret;
},
has: function( target ) {
var targets = jQuery( target, this ),
l = targets.length;
return this.filter(function() {
var i = 0;
for ( ; i < l; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector || [], true) );
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector || [], false) );
},
is: function( selector ) {
return !!winnow(
this,
// If this is a positional/relative selector, check membership in the returned set
// so $("p:first").is("p:last") won't return true for a doc with two "p".
typeof selector === "string" && rneedsContext.test( selector ) ?
jQuery( selector ) :
selector || [],
false
).length;
},
closest: function( selectors, context ) {
var cur,
i = 0,
l = this.length,
matched = [],
pos = ( rneedsContext.test( selectors ) || typeof selectors !== "string" ) ?
jQuery( selectors, context || this.context ) :
0;
for ( ; i < l; i++ ) {
for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
// Always skip document fragments
if ( cur.nodeType < 11 && (pos ?
pos.index(cur) > -1 :
// Don't pass non-elements to Sizzle
cur.nodeType === 1 &&
jQuery.find.matchesSelector(cur, selectors)) ) {
cur = matched.push( cur );
break;
}
}
}
return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
},
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {
// No argument, return index in parent
if ( !elem ) {
return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
}
// index in selector
if ( typeof elem === "string" ) {
return core_indexOf.call( jQuery( elem ), this[ 0 ] );
}
// Locate the position of the desired element
return core_indexOf.call( this,
// If it receives a jQuery object, the first element is used
elem.jquery ? elem[ 0 ] : elem
);
},
add: function( selector, context ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( jQuery.unique(all) );
},
addBack: function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter(selector)
);
}
});
function sibling( cur, dir ) {
while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
return cur;
}
jQuery.each({
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
parents: function( elem ) {
return jQuery.dir( elem, "parentNode" );
},
parentsUntil: function( elem, i, until ) {
return jQuery.dir( elem, "parentNode", until );
},
next: function( elem ) {
return sibling( elem, "nextSibling" );
},
prev: function( elem ) {
return sibling( elem, "previousSibling" );
},
nextAll: function( elem ) {
return jQuery.dir( elem, "nextSibling" );
},
prevAll: function( elem ) {
return jQuery.dir( elem, "previousSibling" );
},
nextUntil: function( elem, i, until ) {
return jQuery.dir( elem, "nextSibling", until );
},
prevUntil: function( elem, i, until ) {
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
},
contents: function( elem ) {
return elem.contentDocument || jQuery.merge( [], elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var matched = jQuery.map( this, fn, until );
if ( name.slice( -5 ) !== "Until" ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
matched = jQuery.filter( selector, matched );
}
if ( this.length > 1 ) {
// Remove duplicates
if ( !guaranteedUnique[ name ] ) {
jQuery.unique( matched );
}
// Reverse order for parents* and prev-derivatives
if ( rparentsprev.test( name ) ) {
matched.reverse();
}
}
return this.pushStack( matched );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
var elem = elems[ 0 ];
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 && elem.nodeType === 1 ?
jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
return elem.nodeType === 1;
}));
},
dir: function( elem, dir, until ) {
var matched = [],
truncate = until !== undefined;
while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
if ( elem.nodeType === 1 ) {
if ( truncate && jQuery( elem ).is( until ) ) {
break;
}
matched.push( elem );
}
}
return matched;
},
sibling: function( n, elem ) {
var matched = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
matched.push( n );
}
}
return matched;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, not ) {
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep( elements, function( elem, i ) {
/* jshint -W018 */
return !!qualifier.call( elem, i, elem ) !== not;
});
}
if ( qualifier.nodeType ) {
return jQuery.grep( elements, function( elem ) {
return ( elem === qualifier ) !== not;
});
}
if ( typeof qualifier === "string" ) {
if ( isSimple.test( qualifier ) ) {
return jQuery.filter( qualifier, elements, not );
}
qualifier = jQuery.filter( qualifier, elements );
}
return jQuery.grep( elements, function( elem ) {
return ( core_indexOf.call( qualifier, elem ) >= 0 ) !== not;
});
}
var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
rtagName = /<([\w:]+)/,
rhtml = /<|&#?\w+;/,
rnoInnerhtml = /<(?:script|style|link)/i,
manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /^$|\/(?:java|ecma)script/i,
rscriptTypeMasked = /^true\/(.*)/,
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
// We have to close these tags to support XHTML (#13200)
wrapMap = {
// Support: IE 9
option: [ 1, "<select multiple='multiple'>", "</select>" ],
thead: [ 1, "<table>", "</table>" ],
col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
_default: [ 0, "", "" ]
};
// Support: IE 9
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
jQuery.fn.extend({
text: function( value ) {
return jQuery.access( this, function( value ) {
return value === undefined ?
jQuery.text( this ) :
this.empty().append( ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) );
}, null, value, arguments.length );
},
append: function() {
return this.domManip( arguments, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
var target = manipulationTarget( this, elem );
target.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip( arguments, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
var target = manipulationTarget( this, elem );
target.insertBefore( elem, target.firstChild );
}
});
},
before: function() {
return this.domManip( arguments, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this );
}
});
},
after: function() {
return this.domManip( arguments, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this.nextSibling );
}
});
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
var elem,
elems = selector ? jQuery.filter( selector, this ) : this,
i = 0;
for ( ; (elem = elems[i]) != null; i++ ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem ) );
}
if ( elem.parentNode ) {
if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
setGlobalEval( getAll( elem, "script" ) );
}
elem.parentNode.removeChild( elem );
}
}
return this;
},
empty: function() {
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
if ( elem.nodeType === 1 ) {
// Prevent memory leaks
jQuery.cleanData( getAll( elem, false ) );
// Remove any remaining nodes
elem.textContent = "";
}
}
return this;
},
clone: function( dataAndEvents, deepDataAndEvents ) {
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
return this.map( function () {
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
});
},
html: function( value ) {
return jQuery.access( this, function( value ) {
var elem = this[ 0 ] || {},
i = 0,
l = this.length;
if ( value === undefined && elem.nodeType === 1 ) {
return elem.innerHTML;
}
// See if we can take a shortcut and just use innerHTML
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
value = value.replace( rxhtmlTag, "<$1></$2>" );
try {
for ( ; i < l; i++ ) {
elem = this[ i ] || {};
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem, false ) );
elem.innerHTML = value;
}
}
elem = 0;
// If using innerHTML throws an exception, use the fallback method
} catch( e ) {}
}
if ( elem ) {
this.empty().append( value );
}
}, null, value, arguments.length );
},
replaceWith: function() {
var
// Snapshot the DOM in case .domManip sweeps something relevant into its fragment
args = jQuery.map( this, function( elem ) {
return [ elem.nextSibling, elem.parentNode ];
}),
i = 0;
// Make the changes, replacing each context element with the new content
this.domManip( arguments, function( elem ) {
var next = args[ i++ ],
parent = args[ i++ ];
if ( parent ) {
// Don't use the snapshot next if it has moved (#13810)
if ( next && next.parentNode !== parent ) {
next = this.nextSibling;
}
jQuery( this ).remove();
parent.insertBefore( elem, next );
}
// Allow new content to include elements from the context set
}, true );
// Force removal if there was no new content (e.g., from empty arguments)
return i ? this : this.remove();
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, callback, allowIntersection ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
var fragment, first, scripts, hasScripts, node, doc,
i = 0,
l = this.length,
set = this,
iNoClone = l - 1,
value = args[ 0 ],
isFunction = jQuery.isFunction( value );
// We can't cloneNode fragments that contain checked, in WebKit
if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
return this.each(function( index ) {
var self = set.eq( index );
if ( isFunction ) {
args[ 0 ] = value.call( this, index, self.html() );
}
self.domManip( args, callback, allowIntersection );
});
}
if ( l ) {
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
fragment = first;
}
if ( first ) {
scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
hasScripts = scripts.length;
// Use the original fragment for the last item instead of the first because it can end up
// being emptied incorrectly in certain situations (#8070).
for ( ; i < l; i++ ) {
node = fragment;
if ( i !== iNoClone ) {
node = jQuery.clone( node, true, true );
// Keep references to cloned scripts for later restoration
if ( hasScripts ) {
// Support: QtWebKit
// jQuery.merge because core_push.apply(_, arraylike) throws
jQuery.merge( scripts, getAll( node, "script" ) );
}
}
callback.call( this[ i ], node, i );
}
if ( hasScripts ) {
doc = scripts[ scripts.length - 1 ].ownerDocument;
// Reenable scripts
jQuery.map( scripts, restoreScript );
// Evaluate executable scripts on first document insertion
for ( i = 0; i < hasScripts; i++ ) {
node = scripts[ i ];
if ( rscriptType.test( node.type || "" ) &&
!data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
if ( node.src ) {
// Hope ajax is available...
jQuery._evalUrl( node.src );
} else {
jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
}
}
}
}
}
}
return this;
}
});
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var elems,
ret = [],
insert = jQuery( selector ),
last = insert.length - 1,
i = 0;
for ( ; i <= last; i++ ) {
elems = i === last ? this : this.clone( true );
jQuery( insert[ i ] )[ original ]( elems );
// Support: QtWebKit
// .get() because core_push.apply(_, arraylike) throws
core_push.apply( ret, elems.get() );
}
return this.pushStack( ret );
};
});
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var i, l, srcElements, destElements,
clone = elem.cloneNode( true ),
inPage = jQuery.contains( elem.ownerDocument, elem );
// Support: IE >= 9
// Fix Cloning issues
if ( !jQuery.support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {
// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
destElements = getAll( clone );
srcElements = getAll( elem );
for ( i = 0, l = srcElements.length; i < l; i++ ) {
fixInput( srcElements[ i ], destElements[ i ] );
}
}
// Copy the events from the original to the clone
if ( dataAndEvents ) {
if ( deepDataAndEvents ) {
srcElements = srcElements || getAll( elem );
destElements = destElements || getAll( clone );
for ( i = 0, l = srcElements.length; i < l; i++ ) {
cloneCopyEvent( srcElements[ i ], destElements[ i ] );
}
} else {
cloneCopyEvent( elem, clone );
}
}
// Preserve script evaluation history
destElements = getAll( clone, "script" );
if ( destElements.length > 0 ) {
setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
}
// Return the cloned set
return clone;
},
buildFragment: function( elems, context, scripts, selection ) {
var elem, tmp, tag, wrap, contains, j,
i = 0,
l = elems.length,
fragment = context.createDocumentFragment(),
nodes = [];
for ( ; i < l; i++ ) {
elem = elems[ i ];
if ( elem || elem === 0 ) {
// Add nodes directly
if ( jQuery.type( elem ) === "object" ) {
// Support: QtWebKit
// jQuery.merge because core_push.apply(_, arraylike) throws
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
// Convert non-html into a text node
} else if ( !rhtml.test( elem ) ) {
nodes.push( context.createTextNode( elem ) );
// Convert html into DOM nodes
} else {
tmp = tmp || fragment.appendChild( context.createElement("div") );
// Deserialize a standard representation
tag = ( rtagName.exec( elem ) || ["", ""] )[ 1 ].toLowerCase();
wrap = wrapMap[ tag ] || wrapMap._default;
tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
// Descend through wrappers to the right content
j = wrap[ 0 ];
while ( j-- ) {
tmp = tmp.firstChild;
}
// Support: QtWebKit
// jQuery.merge because core_push.apply(_, arraylike) throws
jQuery.merge( nodes, tmp.childNodes );
// Remember the top-level container
tmp = fragment.firstChild;
// Fixes #12346
// Support: Webkit, IE
tmp.textContent = "";
}
}
}
// Remove wrapper from fragment
fragment.textContent = "";
i = 0;
while ( (elem = nodes[ i++ ]) ) {
// #4087 - If origin and destination elements are the same, and this is
// that element, do not do anything
if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
continue;
}
contains = jQuery.contains( elem.ownerDocument, elem );
// Append to fragment
tmp = getAll( fragment.appendChild( elem ), "script" );
// Preserve script evaluation history
if ( contains ) {
setGlobalEval( tmp );
}
// Capture executables
if ( scripts ) {
j = 0;
while ( (elem = tmp[ j++ ]) ) {
if ( rscriptType.test( elem.type || "" ) ) {
scripts.push( elem );
}
}
}
}
return fragment;
},
cleanData: function( elems ) {
var data, elem, events, type, key, j,
special = jQuery.event.special,
i = 0;
for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
if ( Data.accepts( elem ) ) {
key = elem[ data_priv.expando ];
if ( key && (data = data_priv.cache[ key ]) ) {
events = Object.keys( data.events || {} );
if ( events.length ) {
for ( j = 0; (type = events[j]) !== undefined; j++ ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
} else {
jQuery.removeEvent( elem, type, data.handle );
}
}
}
if ( data_priv.cache[ key ] ) {
// Discard any remaining `private` data
delete data_priv.cache[ key ];
}
}
}
// Discard any remaining `user` data
delete data_user.cache[ elem[ data_user.expando ] ];
}
},
_evalUrl: function( url ) {
return jQuery.ajax({
url: url,
type: "GET",
dataType: "script",
async: false,
global: false,
"throws": true
});
}
});
// Support: 1.x compatibility
// Manipulating tables requires a tbody
function manipulationTarget( elem, content ) {
return jQuery.nodeName( elem, "table" ) &&
jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ?
elem.getElementsByTagName("tbody")[0] ||
elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
elem;
}
// Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) {
elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
return elem;
}
function restoreScript( elem ) {
var match = rscriptTypeMasked.exec( elem.type );
if ( match ) {
elem.type = match[ 1 ];
} else {
elem.removeAttribute("type");
}
return elem;
}
// Mark scripts as having already been evaluated
function setGlobalEval( elems, refElements ) {
var l = elems.length,
i = 0;
for ( ; i < l; i++ ) {
data_priv.set(
elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
);
}
}
function cloneCopyEvent( src, dest ) {
var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
if ( dest.nodeType !== 1 ) {
return;
}
// 1. Copy private data: events, handlers, etc.
if ( data_priv.hasData( src ) ) {
pdataOld = data_priv.access( src );
pdataCur = data_priv.set( dest, pdataOld );
events = pdataOld.events;
if ( events ) {
delete pdataCur.handle;
pdataCur.events = {};
for ( type in events ) {
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
jQuery.event.add( dest, type, events[ type ][ i ] );
}
}
}
}
// 2. Copy user data
if ( data_user.hasData( src ) ) {
udataOld = data_user.access( src );
udataCur = jQuery.extend( {}, udataOld );
data_user.set( dest, udataCur );
}
}
function getAll( context, tag ) {
var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
[];
return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
jQuery.merge( [ context ], ret ) :
ret;
}
// Support: IE >= 9
function fixInput( src, dest ) {
var nodeName = dest.nodeName.toLowerCase();
// Fails to persist the checked state of a cloned checkbox or radio button.
if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
dest.checked = src.checked;
// Fails to return the selected option to the default selected state when cloning options
} else if ( nodeName === "input" || nodeName === "textarea" ) {
dest.defaultValue = src.defaultValue;
}
}
var curCSS, iframe,
// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
rmargin = /^margin/,
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
elemdisplay = { BODY: "block" },
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
letterSpacing: 0,
fontWeight: 400
},
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
// return a css property mapped to a potentially vendor prefixed property
function vendorPropName( style, name ) {
// shortcut for names that are not vendor prefixed
if ( name in style ) {
return name;
}
// check for vendor prefixed names
var capName = name.charAt(0).toUpperCase() + name.slice(1),
origName = name,
i = cssPrefixes.length;
while ( i-- ) {
name = cssPrefixes[ i ] + capName;
if ( name in style ) {
return name;
}
}
return origName;
}
function isHidden( elem, el ) {
// isHidden might be called from jQuery#filter function;
// in that case, element will be second argument
elem = el || elem;
return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
}
// NOTE: we've included the "window" in window.getComputedStyle
// because jsdom on node.js will break without it.
function getStyles( elem ) {
return window.getComputedStyle( elem, null );
}
function showHide( elements, show ) {
var display, elem, hidden,
values = [],
index = 0,
length = elements.length;
for ( ; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
values[ index ] = data_priv.get( elem, "olddisplay" );
display = elem.style.display;
if ( show ) {
// Reset the inline display of this element to learn if it is
// being hidden by cascaded rules or not
if ( !values[ index ] && display === "none" ) {
elem.style.display = "";
}
// Set elements which have been overridden with display: none
// in a stylesheet to whatever the default browser style is
// for such an element
if ( elem.style.display === "" && isHidden( elem ) ) {
values[ index ] = data_priv.access( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
}
} else {
if ( !values[ index ] ) {
hidden = isHidden( elem );
if ( display && display !== "none" || !hidden ) {
data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css(elem, "display") );
}
}
}
}
// Set the display of most of the elements in a second loop
// to avoid the constant reflow
for ( index = 0; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
elem.style.display = show ? values[ index ] || "" : "none";
}
}
return elements;
}
jQuery.fn.extend({
css: function( name, value ) {
return jQuery.access( this, function( elem, name, value ) {
var styles, len,
map = {},
i = 0;
if ( jQuery.isArray( name ) ) {
styles = getStyles( elem );
len = name.length;
for ( ; i < len; i++ ) {
map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
}
return map;
}
return value !== undefined ?
jQuery.style( elem, name, value ) :
jQuery.css( elem, name );
}, name, value, arguments.length > 1 );
},
show: function() {
return showHide( this, true );
},
hide: function() {
return showHide( this );
},
toggle: function( state ) {
var bool = typeof state === "boolean";
return this.each(function() {
if ( bool ? state : isHidden( this ) ) {
jQuery( this ).show();
} else {
jQuery( this ).hide();
}
});
}
});
jQuery.extend({
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
cssHooks: {
opacity: {
get: function( elem, computed ) {
if ( computed ) {
// We should always get a number back from opacity
var ret = curCSS( elem, "opacity" );
return ret === "" ? "1" : ret;
}
}
}
},
// Don't automatically add "px" to these possibly-unitless properties
cssNumber: {
"columnCount": true,
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": true,
"orphans": true,
"widows": true,
"zIndex": true,
"zoom": true
},
// Add in properties whose names you wish to fix before
// setting or getting the value
cssProps: {
// normalize float css property
"float": "cssFloat"
},
// Get and set the style property on a DOM Node
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
// Make sure that we're working with the right name
var ret, type, hooks,
origName = jQuery.camelCase( name ),
style = elem.style;
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
// gets hook for the prefixed version
// followed by the unprefixed version
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// Check if we're setting a value
if ( value !== undefined ) {
type = typeof value;
// convert relative number strings (+= or -=) to relative numbers. #7345
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
// Fixes bug #9237
type = "number";
}
// Make sure that NaN and null values aren't set. See: #7116
if ( value == null || type === "number" && isNaN( value ) ) {
return;
}
// If a number was passed in, add 'px' to the (except for certain CSS properties)
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
value += "px";
}
// Fixes #8908, it can be done more correctly by specifying setters in cssHooks,
// but it would mean to define eight (for every problematic property) identical functions
if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
style[ name ] = "inherit";
}
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
style[ name ] = value;
}
} else {
// If a hook was provided get the non-computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
return ret;
}
// Otherwise just get the value from the style object
return style[ name ];
}
},
css: function( elem, name, extra, styles ) {
var val, num, hooks,
origName = jQuery.camelCase( name );
// Make sure that we're working with the right name
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
// gets hook for the prefixed version
// followed by the unprefixed version
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// If a hook was provided get the computed value from there
if ( hooks && "get" in hooks ) {
val = hooks.get( elem, true, extra );
}
// Otherwise, if a way to get the computed value exists, use that
if ( val === undefined ) {
val = curCSS( elem, name, styles );
}
//convert "normal" to computed value
if ( val === "normal" && name in cssNormalTransform ) {
val = cssNormalTransform[ name ];
}
// Return, converting to number if forced or a qualifier was provided and val looks numeric
if ( extra === "" || extra ) {
num = parseFloat( val );
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
}
return val;
}
});
curCSS = function( elem, name, _computed ) {
var width, minWidth, maxWidth,
computed = _computed || getStyles( elem ),
// Support: IE9
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
style = elem.style;
if ( computed ) {
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
// Support: Safari 5.1
// A tribute to the "awesome hack by Dean Edwards"
// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
// Remember the original values
width = style.width;
minWidth = style.minWidth;
maxWidth = style.maxWidth;
// Put in the new values to get a computed value out
style.minWidth = style.maxWidth = style.width = ret;
ret = computed.width;
// Revert the changed values
style.width = width;
style.minWidth = minWidth;
style.maxWidth = maxWidth;
}
}
return ret;
};
function setPositiveNumber( elem, value, subtract ) {
var matches = rnumsplit.exec( value );
return matches ?
// Guard against undefined "subtract", e.g., when used as in cssHooks
Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
value;
}
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
var i = extra === ( isBorderBox ? "border" : "content" ) ?
// If we already have the right measurement, avoid augmentation
4 :
// Otherwise initialize for horizontal or vertical properties
name === "width" ? 1 : 0,
val = 0;
for ( ; i < 4; i += 2 ) {
// both box models exclude margin, so add it if we want it
if ( extra === "margin" ) {
val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
}
if ( isBorderBox ) {
// border-box includes padding, so remove it if we want content
if ( extra === "content" ) {
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
}
// at this point, extra isn't border nor margin, so remove border
if ( extra !== "margin" ) {
val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
}
} else {
// at this point, extra isn't content, so add padding
val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
// at this point, extra isn't content nor padding, so add border
if ( extra !== "padding" ) {
val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
}
}
}
return val;
}
function getWidthOrHeight( elem, name, extra ) {
// Start with offset property, which is equivalent to the border-box value
var valueIsBorderBox = true,
val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
styles = getStyles( elem ),
isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
// some non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
if ( val <= 0 || val == null ) {
// Fall back to computed then uncomputed css if necessary
val = curCSS( elem, name, styles );
if ( val < 0 || val == null ) {
val = elem.style[ name ];
}
// Computed unit is not pixels. Stop here and return.
if ( rnumnonpx.test(val) ) {
return val;
}
// we need the check for style in case a browser which returns unreliable values
// for getComputedStyle silently falls back to the reliable elem.style
valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;
}
// use the active box-sizing model to add/subtract irrelevant styles
return ( val +
augmentWidthOrHeight(
elem,
name,
extra || ( isBorderBox ? "border" : "content" ),
valueIsBorderBox,
styles
)
) + "px";
}
// Try to determine the default display value of an element
function css_defaultDisplay( nodeName ) {
var doc = document,
display = elemdisplay[ nodeName ];
if ( !display ) {
display = actualDisplay( nodeName, doc );
// If the simple way fails, read from inside an iframe
if ( display === "none" || !display ) {
// Use the already-created iframe if possible
iframe = ( iframe ||
jQuery("<iframe frameborder='0' width='0' height='0'/>")
.css( "cssText", "display:block !important" )
).appendTo( doc.documentElement );
// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
doc.write("<!doctype html><html><body>");
doc.close();
display = actualDisplay( nodeName, doc );
iframe.detach();
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return display;
}
// Called ONLY from within css_defaultDisplay
function actualDisplay( name, doc ) {
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
display = jQuery.css( elem[0], "display" );
elem.remove();
return display;
}
jQuery.each([ "height", "width" ], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
if ( computed ) {
// certain elements can have dimension info if we invisibly show them
// however, it must have a current display style that would benefit from this
return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
jQuery.swap( elem, cssShow, function() {
return getWidthOrHeight( elem, name, extra );
}) :
getWidthOrHeight( elem, name, extra );
}
},
set: function( elem, value, extra ) {
var styles = extra && getStyles( elem );
return setPositiveNumber( elem, value, extra ?
augmentWidthOrHeight(
elem,
name,
extra,
jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
styles
) : 0
);
}
};
});
// These hooks cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
jQuery(function() {
// Support: Android 2.3
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: function( elem, computed ) {
if ( computed ) {
// Support: Android 2.3
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block
return jQuery.swap( elem, { "display": "inline-block" },
curCSS, [ elem, "marginRight" ] );
}
}
};
}
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// getComputedStyle returns percent when specified for top/left/bottom/right
// rather than make the css module depend on the offset module, we just check for it here
if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery.cssHooks[ prop ] = {
get: function( elem, computed ) {
if ( computed ) {
computed = curCSS( elem, prop );
// if curCSS returns percentage, fallback to offset
return rnumnonpx.test( computed ) ?
jQuery( elem ).position()[ prop ] + "px" :
computed;
}
}
};
});
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
// These hooks are used by animate to expand properties
jQuery.each({
margin: "",
padding: "",
border: "Width"
}, function( prefix, suffix ) {
jQuery.cssHooks[ prefix + suffix ] = {
expand: function( value ) {
var i = 0,
expanded = {},
// assumes a single number if not a string
parts = typeof value === "string" ? value.split(" ") : [ value ];
for ( ; i < 4; i++ ) {
expanded[ prefix + cssExpand[ i ] + suffix ] =
parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
}
return expanded;
}
};
if ( !rmargin.test( prefix ) ) {
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
}
});
var r20 = /%20/g,
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
rsubmittable = /^(?:input|select|textarea|keygen)/i;
jQuery.fn.extend({
serialize: function() {
return jQuery.param( this.serializeArray() );
},
serializeArray: function() {
return this.map(function(){
// Can add propHook for "elements" to filter or add form elements
var elements = jQuery.prop( this, "elements" );
return elements ? jQuery.makeArray( elements ) : this;
})
.filter(function(){
var type = this.type;
// Use .is(":disabled") so that fieldset[disabled] works
return this.name && !jQuery( this ).is( ":disabled" ) &&
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
( this.checked || !manipulation_rcheckableType.test( type ) );
})
.map(function( i, elem ){
var val = jQuery( this ).val();
return val == null ?
null :
jQuery.isArray( val ) ?
jQuery.map( val, function( val ){
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}).get();
}
});
//Serialize an array of form elements or a set of
//key/values into a query string
jQuery.param = function( a, traditional ) {
var prefix,
s = [],
add = function( key, value ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
};
// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
}
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
});
} else {
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
for ( prefix in a ) {
buildParams( prefix, a[ prefix ], traditional, add );
}
}
// Return the resulting serialization
return s.join( "&" ).replace( r20, "+" );
};
function buildParams( prefix, obj, traditional, add ) {
var name;
if ( jQuery.isArray( obj ) ) {
// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional || rbracket.test( prefix ) ) {
// Treat each array item as a scalar.
add( prefix, v );
} else {
// Item is non-scalar (array or object), encode its numeric index.
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
}
});
} else if ( !traditional && jQuery.type( obj ) === "object" ) {
// Serialize object item.
for ( name in obj ) {
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
}
} else {
// Serialize scalar item.
add( prefix, obj );
}
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
return arguments.length > 0 ?
this.on( name, null, data, fn ) :
this.trigger( name );
};
});
jQuery.fn.extend({
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
},
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
}
});
var
// Document location
ajaxLocParts,
ajaxLocation,
ajax_nonce = jQuery.now(),
ajax_rquery = /\?/,
rhash = /#.*$/,
rts = /([?&])_=[^&]*/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
// #7653, #8125, #8152: local protocol detection
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
// Keep a copy of the old load method
_load = jQuery.fn.load,
/* Prefilters
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
* 2) These are called:
* - BEFORE asking for a transport
* - AFTER param serialization (s.data is a string if s.processData is true)
* 3) key is the dataType
* 4) the catchall symbol "*" can be used
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
*/
prefilters = {},
/* Transports bindings
* 1) key is the dataType
* 2) the catchall symbol "*" can be used
* 3) selection will start with transport dataType and THEN go to "*" if needed
*/
transports = {},
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes = "*/".concat("*");
// #8138, IE may throw an exception when accessing
// a field from window.location if document.domain has been set
try {
ajaxLocation = location.href;
} catch( e ) {
// Use the href attribute of an A element
// since IE will modify it given document.location
ajaxLocation = document.createElement( "a" );
ajaxLocation.href = "";
ajaxLocation = ajaxLocation.href;
}
// Segment location into parts
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) {
// dataTypeExpression is optional and defaults to "*"
return function( dataTypeExpression, func ) {
if ( typeof dataTypeExpression !== "string" ) {
func = dataTypeExpression;
dataTypeExpression = "*";
}
var dataType,
i = 0,
dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
if ( jQuery.isFunction( func ) ) {
// For each dataType in the dataTypeExpression
while ( (dataType = dataTypes[i++]) ) {
// Prepend if requested
if ( dataType[0] === "+" ) {
dataType = dataType.slice( 1 ) || "*";
(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
// Otherwise append
} else {
(structure[ dataType ] = structure[ dataType ] || []).push( func );
}
}
}
};
}
// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
var inspected = {},
seekingTransport = ( structure === transports );
function inspect( dataType ) {
var selected;
inspected[ dataType ] = true;
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
options.dataTypes.unshift( dataTypeOrTransport );
inspect( dataTypeOrTransport );
return false;
} else if ( seekingTransport ) {
return !( selected = dataTypeOrTransport );
}
});
return selected;
}
return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
}
// A special extend for ajax options
// that takes "flat" options (not to be deep extended)
// Fixes #9887
function ajaxExtend( target, src ) {
var key, deep,
flatOptions = jQuery.ajaxSettings.flatOptions || {};
for ( key in src ) {
if ( src[ key ] !== undefined ) {
( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
}
}
if ( deep ) {
jQuery.extend( true, target, deep );
}
return target;
}
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
var selector, type, response,
self = this,
off = url.indexOf(" ");
if ( off >= 0 ) {
selector = url.slice( off );
url = url.slice( 0, off );
}
// If it's a function
if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = undefined;
// Otherwise, build a param string
} else if ( params && typeof params === "object" ) {
type = "POST";
}
// If we have elements to modify, make the request
if ( self.length > 0 ) {
jQuery.ajax({
url: url,
// if "type" variable is undefined, then "GET" method will be used
type: type,
dataType: "html",
data: params
}).done(function( responseText ) {
// Save response for use in complete callback
response = arguments;
self.html( selector ?
// If a selector was specified, locate the right elements in a dummy div
// Exclude scripts to avoid IE 'Permission Denied' errors
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
// Otherwise use the full result
responseText );
}).complete( callback && function( jqXHR, status ) {
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
});
}
return this;
};
// Attach a bunch of functions for handling common AJAX events
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
jQuery.fn[ type ] = function( fn ){
return this.on( type, fn );
};
});
jQuery.extend({
// Counter for holding the number of active queries
active: 0,
// Last-Modified header cache for next request
lastModified: {},
etag: {},
ajaxSettings: {
url: ajaxLocation,
type: "GET",
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
global: true,
processData: true,
async: true,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
/*
timeout: 0,
data: null,
dataType: null,
username: null,
password: null,
cache: null,
throws: false,
traditional: false,
headers: {},
*/
accepts: {
"*": allTypes,
text: "text/plain",
html: "text/html",
xml: "application/xml, text/xml",
json: "application/json, text/javascript"
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
},
responseFields: {
xml: "responseXML",
text: "responseText",
json: "responseJSON"
},
// Data converters
// Keys separate source (or catchall "*") and destination types with a single space
converters: {
// Convert anything to text
"* text": String,
// Text to html (true = no transformation)
"text html": true,
// Evaluate text as a json expression
"text json": jQuery.parseJSON,
// Parse text as xml
"text xml": jQuery.parseXML
},
// For options that shouldn't be deep extended:
// you can add your own custom options here if
// and when you create one that shouldn't be
// deep extended (see ajaxExtend)
flatOptions: {
url: true,
context: true
}
},
// Creates a full fledged settings object into target
// with both ajaxSettings and settings fields.
// If target is omitted, writes into ajaxSettings.
ajaxSetup: function( target, settings ) {
return settings ?
// Building a settings object
ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
// Extending ajaxSettings
ajaxExtend( jQuery.ajaxSettings, target );
},
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
ajaxTransport: addToPrefiltersOrTransports( transports ),
// Main method
ajax: function( url, options ) {
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
options = url;
url = undefined;
}
// Force options to be an object
options = options || {};
var transport,
// URL without anti-cache param
cacheURL,
// Response headers
responseHeadersString,
responseHeaders,
// timeout handle
timeoutTimer,
// Cross-domain detection vars
parts,
// To know if global events are to be dispatched
fireGlobals,
// Loop variable
i,
// Create the final options object
s = jQuery.ajaxSetup( {}, options ),
// Callbacks context
callbackContext = s.context || s,
// Context for global events is callbackContext if it is a DOM node or jQuery collection
globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
jQuery( callbackContext ) :
jQuery.event,
// Deferreds
deferred = jQuery.Deferred(),
completeDeferred = jQuery.Callbacks("once memory"),
// Status-dependent callbacks
statusCode = s.statusCode || {},
// Headers (they are sent all at once)
requestHeaders = {},
requestHeadersNames = {},
// The jqXHR state
state = 0,
// Default abort message
strAbort = "canceled",
// Fake xhr
jqXHR = {
readyState: 0,
// Builds headers hashtable if needed
getResponseHeader: function( key ) {
var match;
if ( state === 2 ) {
if ( !responseHeaders ) {
responseHeaders = {};
while ( (match = rheaders.exec( responseHeadersString )) ) {
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
}
}
match = responseHeaders[ key.toLowerCase() ];
}
return match == null ? null : match;
},
// Raw string
getAllResponseHeaders: function() {
return state === 2 ? responseHeadersString : null;
},
// Caches the header
setRequestHeader: function( name, value ) {
var lname = name.toLowerCase();
if ( !state ) {
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
requestHeaders[ name ] = value;
}
return this;
},
// Overrides response content-type header
overrideMimeType: function( type ) {
if ( !state ) {
s.mimeType = type;
}
return this;
},
// Status-dependent callbacks
statusCode: function( map ) {
var code;
if ( map ) {
if ( state < 2 ) {
for ( code in map ) {
// Lazy-add the new callback in a way that preserves old ones
statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
}
} else {
// Execute the appropriate callbacks
jqXHR.always( map[ jqXHR.status ] );
}
}
return this;
},
// Cancel the request
abort: function( statusText ) {
var finalText = statusText || strAbort;
if ( transport ) {
transport.abort( finalText );
}
done( 0, finalText );
return this;
}
};
// Attach deferreds
deferred.promise( jqXHR ).complete = completeDeferred.add;
jqXHR.success = jqXHR.done;
jqXHR.error = jqXHR.fail;
// Remove hash character (#7531: and string promotion)
// Add protocol if not provided (prefilters might expect it)
// Handle falsy url in the settings object (#10093: consistency with old signature)
// We also use the url parameter if available
s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
.replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
// Alias method option to type as per ticket #12004
s.type = options.method || options.type || s.method || s.type;
// Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
// A cross-domain request is in order when we have a protocol:host:port mismatch
if ( s.crossDomain == null ) {
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( parts &&
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
);
}
// Convert data if not already a string
if ( s.data && s.processData && typeof s.data !== "string" ) {
s.data = jQuery.param( s.data, s.traditional );
}
// Apply prefilters
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
// If request was aborted inside a prefilter, stop there
if ( state === 2 ) {
return jqXHR;
}
// We can fire global events as of now if asked to
fireGlobals = s.global;
// Watch for a new set of requests
if ( fireGlobals && jQuery.active++ === 0 ) {
jQuery.event.trigger("ajaxStart");
}
// Uppercase the type
s.type = s.type.toUpperCase();
// Determine if request has content
s.hasContent = !rnoContent.test( s.type );
// Save the URL in case we're toying with the If-Modified-Since
// and/or If-None-Match header later on
cacheURL = s.url;
// More options handling for requests with no content
if ( !s.hasContent ) {
// If data is available, append data to url
if ( s.data ) {
cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
// #9682: remove data so that it's not used in an eventual retry
delete s.data;
}
// Add anti-cache in url if needed
if ( s.cache === false ) {
s.url = rts.test( cacheURL ) ?
// If there is already a '_' parameter, set its value
cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
// Otherwise add one to the end
cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
}
}
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
if ( jQuery.lastModified[ cacheURL ] ) {
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
}
if ( jQuery.etag[ cacheURL ] ) {
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
}
}
// Set the correct header, if data is being sent
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
jqXHR.setRequestHeader( "Content-Type", s.contentType );
}
// Set the Accepts header for the server, depending on the dataType
jqXHR.setRequestHeader(
"Accept",
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
s.accepts[ "*" ]
);
// Check for headers option
for ( i in s.headers ) {
jqXHR.setRequestHeader( i, s.headers[ i ] );
}
// Allow custom headers/mimetypes and early abort
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
// Abort if not done already and return
return jqXHR.abort();
}
// aborting is no longer a cancellation
strAbort = "abort";
// Install callbacks on deferreds
for ( i in { success: 1, error: 1, complete: 1 } ) {
jqXHR[ i ]( s[ i ] );
}
// Get transport
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
// If no transport, we auto-abort
if ( !transport ) {
done( -1, "No Transport" );
} else {
jqXHR.readyState = 1;
// Send global event
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
}
// Timeout
if ( s.async && s.timeout > 0 ) {
timeoutTimer = setTimeout(function() {
jqXHR.abort("timeout");
}, s.timeout );
}
try {
state = 1;
transport.send( requestHeaders, done );
} catch ( e ) {
// Propagate exception as error if not done
if ( state < 2 ) {
done( -1, e );
// Simply rethrow otherwise
} else {
throw e;
}
}
}
// Callback for when everything is done
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
if ( state === 2 ) {
return;
}
// State is "done" now
state = 2;
// Clear timeout if it exists
if ( timeoutTimer ) {
clearTimeout( timeoutTimer );
}
// Dereference transport for early garbage collection
// (no matter how long the jqXHR object will be used)
transport = undefined;
// Cache response headers
responseHeadersString = headers || "";
// Set readyState
jqXHR.readyState = status > 0 ? 4 : 0;
// Determine if successful
isSuccess = status >= 200 && status < 300 || status === 304;
// Get response data
if ( responses ) {
response = ajaxHandleResponses( s, jqXHR, responses );
}
// Convert no matter what (that way responseXXX fields are always set)
response = ajaxConvert( s, response, jqXHR, isSuccess );
// If successful, handle type chaining
if ( isSuccess ) {
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
modified = jqXHR.getResponseHeader("Last-Modified");
if ( modified ) {
jQuery.lastModified[ cacheURL ] = modified;
}
modified = jqXHR.getResponseHeader("etag");
if ( modified ) {
jQuery.etag[ cacheURL ] = modified;
}
}
// if no content
if ( status === 204 || s.type === "HEAD" ) {
statusText = "nocontent";
// if not modified
} else if ( status === 304 ) {
statusText = "notmodified";
// If we have data, let's convert it
} else {
statusText = response.state;
success = response.data;
error = response.error;
isSuccess = !error;
}
} else {
// We extract error from statusText
// then normalize statusText and status for non-aborts
error = statusText;
if ( status || !statusText ) {
statusText = "error";
if ( status < 0 ) {
status = 0;
}
}
}
// Set data for the fake xhr object
jqXHR.status = status;
jqXHR.statusText = ( nativeStatusText || statusText ) + "";
// Success/Error
if ( isSuccess ) {
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
} else {
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
}
// Status-dependent callbacks
jqXHR.statusCode( statusCode );
statusCode = undefined;
if ( fireGlobals ) {
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
[ jqXHR, s, isSuccess ? success : error ] );
}
// Complete
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
// Handle the global AJAX counter
if ( !( --jQuery.active ) ) {
jQuery.event.trigger("ajaxStop");
}
}
}
return jqXHR;
},
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
},
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
}
});
jQuery.each( [ "get", "post" ], function( i, method ) {
jQuery[ method ] = function( url, data, callback, type ) {
// shift arguments if data argument was omitted
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = undefined;
}
return jQuery.ajax({
url: url,
type: method,
dataType: type,
data: data,
success: callback
});
};
});
/* Handles responses to an ajax request:
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
var ct, type, finalDataType, firstDataType,
contents = s.contents,
dataTypes = s.dataTypes;
// Remove auto dataType and get content-type in the process
while( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
}
}
// Check if we're dealing with a known content-type
if ( ct ) {
for ( type in contents ) {
if ( contents[ type ] && contents[ type ].test( ct ) ) {
dataTypes.unshift( type );
break;
}
}
}
// Check to see if we have a response for the expected dataType
if ( dataTypes[ 0 ] in responses ) {
finalDataType = dataTypes[ 0 ];
} else {
// Try convertible dataTypes
for ( type in responses ) {
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
finalDataType = type;
break;
}
if ( !firstDataType ) {
firstDataType = type;
}
}
// Or just use first one
finalDataType = finalDataType || firstDataType;
}
// If we found a dataType
// We add the dataType to the list if needed
// and return the corresponding response
if ( finalDataType ) {
if ( finalDataType !== dataTypes[ 0 ] ) {
dataTypes.unshift( finalDataType );
}
return responses[ finalDataType ];
}
}
/* Chain conversions given the request and the original response
* Also sets the responseXXX fields on the jqXHR instance
*/
function ajaxConvert( s, response, jqXHR, isSuccess ) {
var conv2, current, conv, tmp, prev,
converters = {},
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice();
// Create converters map with lowercased keys
if ( dataTypes[ 1 ] ) {
for ( conv in s.converters ) {
converters[ conv.toLowerCase() ] = s.converters[ conv ];
}
}
current = dataTypes.shift();
// Convert to each sequential dataType
while ( current ) {
if ( s.responseFields[ current ] ) {
jqXHR[ s.responseFields[ current ] ] = response;
}
// Apply the dataFilter if provided
if ( !prev && isSuccess && s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
prev = current;
current = dataTypes.shift();
if ( current ) {
// There's only work to do if current dataType is non-auto
if ( current === "*" ) {
current = prev;
// Convert response if prev dataType is non-auto and differs from current
} else if ( prev !== "*" && prev !== current ) {
// Seek a direct converter
conv = converters[ prev + " " + current ] || converters[ "* " + current ];
// If none found, seek a pair
if ( !conv ) {
for ( conv2 in converters ) {
// If conv2 outputs current
tmp = conv2.split( " " );
if ( tmp[ 1 ] === current ) {
// If prev can be converted to accepted input
conv = converters[ prev + " " + tmp[ 0 ] ] ||
converters[ "* " + tmp[ 0 ] ];
if ( conv ) {
// Condense equivalence converters
if ( conv === true ) {
conv = converters[ conv2 ];
// Otherwise, insert the intermediate dataType
} else if ( converters[ conv2 ] !== true ) {
current = tmp[ 0 ];
dataTypes.unshift( tmp[ 1 ] );
}
break;
}
}
}
}
// Apply converter (if not an equivalence)
if ( conv !== true ) {
// Unless errors are allowed to bubble, catch and return them
if ( conv && s[ "throws" ] ) {
response = conv( response );
} else {
try {
response = conv( response );
} catch ( e ) {
return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
}
}
}
}
}
}
return { state: "success", data: response };
}
// Install script dataType
jQuery.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /(?:java|ecma)script/
},
converters: {
"text script": function( text ) {
jQuery.globalEval( text );
return text;
}
}
});
// Handle cache's special case and crossDomain
jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) {
s.cache = false;
}
if ( s.crossDomain ) {
s.type = "GET";
}
});
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function( s ) {
// This transport only deals with cross domain requests
if ( s.crossDomain ) {
var script, callback;
return {
send: function( _, complete ) {
script = jQuery("<script>").prop({
async: true,
charset: s.scriptCharset,
src: s.url
}).on(
"load error",
callback = function( evt ) {
script.remove();
callback = null;
if ( evt ) {
complete( evt.type === "error" ? 404 : 200, evt.type );
}
}
);
document.head.appendChild( script[ 0 ] );
},
abort: function() {
if ( callback ) {
callback();
}
}
};
}
});
var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/;
// Default jsonp settings
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
this[ callback ] = true;
return callback;
}
});
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
var callbackName, overwritten, responseContainer,
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
"url" :
typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
);
// Handle iff the expected data type is "jsonp" or we have a parameter to set
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
// Get callback name, remembering preexisting value associated with it
callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
s.jsonpCallback() :
s.jsonpCallback;
// Insert callback into url or form data
if ( jsonProp ) {
s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
} else if ( s.jsonp !== false ) {
s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
}
// Use data converter to retrieve json after script execution
s.converters["script json"] = function() {
if ( !responseContainer ) {
jQuery.error( callbackName + " was not called" );
}
return responseContainer[ 0 ];
};
// force json dataType
s.dataTypes[ 0 ] = "json";
// Install callback
overwritten = window[ callbackName ];
window[ callbackName ] = function() {
responseContainer = arguments;
};
// Clean-up function (fires after converters)
jqXHR.always(function() {
// Restore preexisting value
window[ callbackName ] = overwritten;
// Save back as free
if ( s[ callbackName ] ) {
// make sure that re-using the options doesn't screw things around
s.jsonpCallback = originalSettings.jsonpCallback;
// save the callback name for future use
oldCallbacks.push( callbackName );
}
// Call if it was a function and we have a response
if ( responseContainer && jQuery.isFunction( overwritten ) ) {
overwritten( responseContainer[ 0 ] );
}
responseContainer = overwritten = undefined;
});
// Delegate to script
return "script";
}
});
jQuery.ajaxSettings.xhr = function() {
try {
return new XMLHttpRequest();
} catch( e ) {}
};
var xhrSupported = jQuery.ajaxSettings.xhr(),
xhrSuccessStatus = {
// file protocol always yields status code 0, assume 200
0: 200,
// Support: IE9
// #1450: sometimes IE returns 1223 when it should be 204
1223: 204
},
// Support: IE9
// We need to keep track of outbound xhr and abort them manually
// because IE is not smart enough to do it all by itself
xhrId = 0,
xhrCallbacks = {};
if ( window.ActiveXObject ) {
jQuery( window ).on( "unload", function() {
for( var key in xhrCallbacks ) {
xhrCallbacks[ key ]();
}
xhrCallbacks = undefined;
});
}
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
jQuery.support.ajax = xhrSupported = !!xhrSupported;
jQuery.ajaxTransport(function( options ) {
var callback;
// Cross domain only allowed if supported through XMLHttpRequest
if ( jQuery.support.cors || xhrSupported && !options.crossDomain ) {
return {
send: function( headers, complete ) {
var i, id,
xhr = options.xhr();
xhr.open( options.type, options.url, options.async, options.username, options.password );
// Apply custom fields if provided
if ( options.xhrFields ) {
for ( i in options.xhrFields ) {
xhr[ i ] = options.xhrFields[ i ];
}
}
// Override mime type if needed
if ( options.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( options.mimeType );
}
// X-Requested-With header
// For cross-domain requests, seeing as conditions for a preflight are
// akin to a jigsaw puzzle, we simply never set it to be sure.
// (it can always be set on a per-request basis or even using ajaxSetup)
// For same-domain requests, won't change header if already provided.
if ( !options.crossDomain && !headers["X-Requested-With"] ) {
headers["X-Requested-With"] = "XMLHttpRequest";
}
// Set headers
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
// Callback
callback = function( type ) {
return function() {
if ( callback ) {
delete xhrCallbacks[ id ];
callback = xhr.onload = xhr.onerror = null;
if ( type === "abort" ) {
xhr.abort();
} else if ( type === "error" ) {
complete(
// file protocol always yields status 0, assume 404
xhr.status || 404,
xhr.statusText
);
} else {
complete(
xhrSuccessStatus[ xhr.status ] || xhr.status,
xhr.statusText,
// Support: IE9
// #11426: When requesting binary data, IE9 will throw an exception
// on any attempt to access responseText
typeof xhr.responseText === "string" ? {
text: xhr.responseText
} : undefined,
xhr.getAllResponseHeaders()
);
}
}
};
};
// Listen to events
xhr.onload = callback();
xhr.onerror = callback("error");
// Create the abort callback
callback = xhrCallbacks[( id = xhrId++ )] = callback("abort");
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( options.hasContent && options.data || null );
},
abort: function() {
if ( callback ) {
callback();
}
}
};
}
});
var fxNow, timerId,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
rrun = /queueHooks$/,
animationPrefilters = [ defaultPrefilter ],
tweeners = {
"*": [function( prop, value ) {
var tween = this.createTween( prop, value ),
target = tween.cur(),
parts = rfxnum.exec( value ),
unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
// Starting value computation is required for potential unit mismatches
start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
rfxnum.exec( jQuery.css( tween.elem, prop ) ),
scale = 1,
maxIterations = 20;
if ( start && start[ 3 ] !== unit ) {
// Trust units reported by jQuery.css
unit = unit || start[ 3 ];
// Make sure we update the tween properties later on
parts = parts || [];
// Iteratively approximate from a nonzero starting point
start = +target || 1;
do {
// If previous iteration zeroed out, double until we get *something*
// Use a string for doubling factor so we don't accidentally see scale as unchanged below
scale = scale || ".5";
// Adjust and apply
start = start / scale;
jQuery.style( tween.elem, prop, start + unit );
// Update scale, tolerating zero or NaN from tween.cur()
// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
}
// Update tween properties
if ( parts ) {
start = tween.start = +start || +target || 0;
tween.unit = unit;
// If a +=/-= token was provided, we're doing a relative animation
tween.end = parts[ 1 ] ?
start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+parts[ 2 ];
}
return tween;
}]
};
// Animations created synchronously will run synchronously
function createFxNow() {
setTimeout(function() {
fxNow = undefined;
});
return ( fxNow = jQuery.now() );
}
function createTween( value, prop, animation ) {
var tween,
collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
index = 0,
length = collection.length;
for ( ; index < length; index++ ) {
if ( (tween = collection[ index ].call( animation, prop, value )) ) {
// we're done with this property
return tween;
}
}
}
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = animationPrefilters.length,
deferred = jQuery.Deferred().always( function() {
// don't match elem in the :animated selector
delete tick.elem;
}),
tick = function() {
if ( stopped ) {
return false;
}
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
temp = remaining / animation.duration || 0,
percent = 1 - temp,
index = 0,
length = animation.tweens.length;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( percent );
}
deferred.notifyWith( elem, [ animation, percent, remaining ]);
if ( percent < 1 && length ) {
return remaining;
} else {
deferred.resolveWith( elem, [ animation ] );
return false;
}
},
animation = deferred.promise({
elem: elem,
props: jQuery.extend( {}, properties ),
opts: jQuery.extend( true, { specialEasing: {} }, options ),
originalProperties: properties,
originalOptions: options,
startTime: fxNow || createFxNow(),
duration: options.duration,
tweens: [],
createTween: function( prop, end ) {
var tween = jQuery.Tween( elem, animation.opts, prop, end,
animation.opts.specialEasing[ prop ] || animation.opts.easing );
animation.tweens.push( tween );
return tween;
},
stop: function( gotoEnd ) {
var index = 0,
// if we are going to the end, we want to run all the tweens
// otherwise we skip this part
length = gotoEnd ? animation.tweens.length : 0;
if ( stopped ) {
return this;
}
stopped = true;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( 1 );
}
// resolve when we played the last frame
// otherwise, reject
if ( gotoEnd ) {
deferred.resolveWith( elem, [ animation, gotoEnd ] );
} else {
deferred.rejectWith( elem, [ animation, gotoEnd ] );
}
return this;
}
}),
props = animation.props;
propFilter( props, animation.opts.specialEasing );
for ( ; index < length ; index++ ) {
result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
if ( result ) {
return result;
}
}
jQuery.map( props, createTween, animation );
if ( jQuery.isFunction( animation.opts.start ) ) {
animation.opts.start.call( elem, animation );
}
jQuery.fx.timer(
jQuery.extend( tick, {
elem: elem,
anim: animation,
queue: animation.opts.queue
})
);
// attach callbacks from options
return animation.progress( animation.opts.progress )
.done( animation.opts.done, animation.opts.complete )
.fail( animation.opts.fail )
.always( animation.opts.always );
}
function propFilter( props, specialEasing ) {
var index, name, easing, value, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
name = jQuery.camelCase( index );
easing = specialEasing[ name ];
value = props[ index ];
if ( jQuery.isArray( value ) ) {
easing = value[ 1 ];
value = props[ index ] = value[ 0 ];
}
if ( index !== name ) {
props[ name ] = value;
delete props[ index ];
}
hooks = jQuery.cssHooks[ name ];
if ( hooks && "expand" in hooks ) {
value = hooks.expand( value );
delete props[ name ];
// not quite $.extend, this wont overwrite keys already present.
// also - reusing 'index' from above because we have the correct "name"
for ( index in value ) {
if ( !( index in props ) ) {
props[ index ] = value[ index ];
specialEasing[ index ] = easing;
}
}
} else {
specialEasing[ name ] = easing;
}
}
}
jQuery.Animation = jQuery.extend( Animation, {
tweener: function( props, callback ) {
if ( jQuery.isFunction( props ) ) {
callback = props;
props = [ "*" ];
} else {
props = props.split(" ");
}
var prop,
index = 0,
length = props.length;
for ( ; index < length ; index++ ) {
prop = props[ index ];
tweeners[ prop ] = tweeners[ prop ] || [];
tweeners[ prop ].unshift( callback );
}
},
prefilter: function( callback, prepend ) {
if ( prepend ) {
animationPrefilters.unshift( callback );
} else {
animationPrefilters.push( callback );
}
}
});
function defaultPrefilter( elem, props, opts ) {
/* jshint validthis: true */
var prop, value, toggle, tween, hooks, oldfire,
anim = this,
orig = {},
style = elem.style,
hidden = elem.nodeType && isHidden( elem ),
dataShow = data_priv.get( elem, "fxshow" );
// handle queue: false promises
if ( !opts.queue ) {
hooks = jQuery._queueHooks( elem, "fx" );
if ( hooks.unqueued == null ) {
hooks.unqueued = 0;
oldfire = hooks.empty.fire;
hooks.empty.fire = function() {
if ( !hooks.unqueued ) {
oldfire();
}
};
}
hooks.unqueued++;
anim.always(function() {
// doing this makes sure that the complete handler will be called
// before this completes
anim.always(function() {
hooks.unqueued--;
if ( !jQuery.queue( elem, "fx" ).length ) {
hooks.empty.fire();
}
});
});
}
// height/width overflow pass
if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
// Make sure that nothing sneaks out
// Record all 3 overflow attributes because IE9-10 do not
// change the overflow attribute when overflowX and
// overflowY are set to the same value
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
// Set display property to inline-block for height/width
// animations on inline elements that are having width/height animated
if ( jQuery.css( elem, "display" ) === "inline" &&
jQuery.css( elem, "float" ) === "none" ) {
style.display = "inline-block";
}
}
if ( opts.overflow ) {
style.overflow = "hidden";
anim.always(function() {
style.overflow = opts.overflow[ 0 ];
style.overflowX = opts.overflow[ 1 ];
style.overflowY = opts.overflow[ 2 ];
});
}
// show/hide pass
for ( prop in props ) {
value = props[ prop ];
if ( rfxtypes.exec( value ) ) {
delete props[ prop ];
toggle = toggle || value === "toggle";
if ( value === ( hidden ? "hide" : "show" ) ) {
// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
hidden = true;
} else {
continue;
}
}
orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
}
}
if ( !jQuery.isEmptyObject( orig ) ) {
if ( dataShow ) {
if ( "hidden" in dataShow ) {
hidden = dataShow.hidden;
}
} else {
dataShow = data_priv.access( elem, "fxshow", {} );
}
// store state if its toggle - enables .stop().toggle() to "reverse"
if ( toggle ) {
dataShow.hidden = !hidden;
}
if ( hidden ) {
jQuery( elem ).show();
} else {
anim.done(function() {
jQuery( elem ).hide();
});
}
anim.done(function() {
var prop;
data_priv.remove( elem, "fxshow" );
for ( prop in orig ) {
jQuery.style( elem, prop, orig[ prop ] );
}
});
for ( prop in orig ) {
tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
if ( !( prop in dataShow ) ) {
dataShow[ prop ] = tween.start;
if ( hidden ) {
tween.end = tween.start;
tween.start = prop === "width" || prop === "height" ? 1 : 0;
}
}
}
}
}
function Tween( elem, options, prop, end, easing ) {
return new Tween.prototype.init( elem, options, prop, end, easing );
}
jQuery.Tween = Tween;
Tween.prototype = {
constructor: Tween,
init: function( elem, options, prop, end, easing, unit ) {
this.elem = elem;
this.prop = prop;
this.easing = easing || "swing";
this.options = options;
this.start = this.now = this.cur();
this.end = end;
this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
},
cur: function() {
var hooks = Tween.propHooks[ this.prop ];
return hooks && hooks.get ?
hooks.get( this ) :
Tween.propHooks._default.get( this );
},
run: function( percent ) {
var eased,
hooks = Tween.propHooks[ this.prop ];
if ( this.options.duration ) {
this.pos = eased = jQuery.easing[ this.easing ](
percent, this.options.duration * percent, 0, 1, this.options.duration
);
} else {
this.pos = eased = percent;
}
this.now = ( this.end - this.start ) * eased + this.start;
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
}
if ( hooks && hooks.set ) {
hooks.set( this );
} else {
Tween.propHooks._default.set( this );
}
return this;
}
};
Tween.prototype.init.prototype = Tween.prototype;
Tween.propHooks = {
_default: {
get: function( tween ) {
var result;
if ( tween.elem[ tween.prop ] != null &&
(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
return tween.elem[ tween.prop ];
}
// passing an empty string as a 3rd parameter to .css will automatically
// attempt a parseFloat and fallback to a string if the parse fails
// so, simple values such as "10px" are parsed to Float.
// complex values such as "rotate(1rad)" are returned as is.
result = jQuery.css( tween.elem, tween.prop, "" );
// Empty strings, null, undefined and "auto" are converted to 0.
return !result || result === "auto" ? 0 : result;
},
set: function( tween ) {
// use step hook for back compat - use cssHook if its there - use .style if its
// available and use plain properties where available
if ( jQuery.fx.step[ tween.prop ] ) {
jQuery.fx.step[ tween.prop ]( tween );
} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
} else {
tween.elem[ tween.prop ] = tween.now;
}
}
}
};
// Support: IE9
// Panic based approach to setting things on disconnected nodes
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
set: function( tween ) {
if ( tween.elem.nodeType && tween.elem.parentNode ) {
tween.elem[ tween.prop ] = tween.now;
}
}
};
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
var cssFn = jQuery.fn[ name ];
jQuery.fn[ name ] = function( speed, easing, callback ) {
return speed == null || typeof speed === "boolean" ?
cssFn.apply( this, arguments ) :
this.animate( genFx( name, true ), speed, easing, callback );
};
});
jQuery.fn.extend({
fadeTo: function( speed, to, easing, callback ) {
// show any hidden elements after setting opacity to 0
return this.filter( isHidden ).css( "opacity", 0 ).show()
// animate to the value specified
.end().animate({ opacity: to }, speed, easing, callback );
},
animate: function( prop, speed, easing, callback ) {
var empty = jQuery.isEmptyObject( prop ),
optall = jQuery.speed( speed, easing, callback ),
doAnimation = function() {
// Operate on a copy of prop so per-property easing won't be lost
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
// Empty animations, or finishing resolves immediately
if ( empty || data_priv.get( this, "finish" ) ) {
anim.stop( true );
}
};
doAnimation.finish = doAnimation;
return empty || optall.queue === false ?
this.each( doAnimation ) :
this.queue( optall.queue, doAnimation );
},
stop: function( type, clearQueue, gotoEnd ) {
var stopQueue = function( hooks ) {
var stop = hooks.stop;
delete hooks.stop;
stop( gotoEnd );
};
if ( typeof type !== "string" ) {
gotoEnd = clearQueue;
clearQueue = type;
type = undefined;
}
if ( clearQueue && type !== false ) {
this.queue( type || "fx", [] );
}
return this.each(function() {
var dequeue = true,
index = type != null && type + "queueHooks",
timers = jQuery.timers,
data = data_priv.get( this );
if ( index ) {
if ( data[ index ] && data[ index ].stop ) {
stopQueue( data[ index ] );
}
} else {
for ( index in data ) {
if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
stopQueue( data[ index ] );
}
}
}
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
timers[ index ].anim.stop( gotoEnd );
dequeue = false;
timers.splice( index, 1 );
}
}
// start the next in the queue if the last step wasn't forced
// timers currently will call their complete callbacks, which will dequeue
// but only if they were gotoEnd
if ( dequeue || !gotoEnd ) {
jQuery.dequeue( this, type );
}
});
},
finish: function( type ) {
if ( type !== false ) {
type = type || "fx";
}
return this.each(function() {
var index,
data = data_priv.get( this ),
queue = data[ type + "queue" ],
hooks = data[ type + "queueHooks" ],
timers = jQuery.timers,
length = queue ? queue.length : 0;
// enable finishing flag on private data
data.finish = true;
// empty the queue first
jQuery.queue( this, type, [] );
if ( hooks && hooks.stop ) {
hooks.stop.call( this, true );
}
// look for any active animations, and finish them
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
timers[ index ].anim.stop( true );
timers.splice( index, 1 );
}
}
// look for any animations in the old queue and finish them
for ( index = 0; index < length; index++ ) {
if ( queue[ index ] && queue[ index ].finish ) {
queue[ index ].finish.call( this );
}
}
// turn off finishing flag
delete data.finish;
});
}
});
// Generate parameters to create a standard animation
function genFx( type, includeWidth ) {
var which,
attrs = { height: type },
i = 0;
// if we include width, step value is 1 to do all cssExpand values,
// if we don't include width, step value is 2 to skip over Left and Right
includeWidth = includeWidth? 1 : 0;
for( ; i < 4 ; i += 2 - includeWidth ) {
which = cssExpand[ i ];
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
}
if ( includeWidth ) {
attrs.opacity = attrs.width = type;
}
return attrs;
}
// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx("show"),
slideUp: genFx("hide"),
slideToggle: genFx("toggle"),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }
}, function( name, props ) {
jQuery.fn[ name ] = function( speed, easing, callback ) {
return this.animate( props, speed, easing, callback );
};
});
jQuery.speed = function( speed, easing, fn ) {
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
};
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
// normalize opt.queue - true/undefined/null -> "fx"
if ( opt.queue == null || opt.queue === true ) {
opt.queue = "fx";
}
// Queueing
opt.old = opt.complete;
opt.complete = function() {
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
if ( opt.queue ) {
jQuery.dequeue( this, opt.queue );
}
};
return opt;
};
jQuery.easing = {
linear: function( p ) {
return p;
},
swing: function( p ) {
return 0.5 - Math.cos( p*Math.PI ) / 2;
}
};
jQuery.timers = [];
jQuery.fx = Tween.prototype.init;
jQuery.fx.tick = function() {
var timer,
timers = jQuery.timers,
i = 0;
fxNow = jQuery.now();
for ( ; i < timers.length; i++ ) {
timer = timers[ i ];
// Checks the timer has not already been removed
if ( !timer() && timers[ i ] === timer ) {
timers.splice( i--, 1 );
}
}
if ( !timers.length ) {
jQuery.fx.stop();
}
fxNow = undefined;
};
jQuery.fx.timer = function( timer ) {
if ( timer() && jQuery.timers.push( timer ) ) {
jQuery.fx.start();
}
};
jQuery.fx.interval = 13;
jQuery.fx.start = function() {
if ( !timerId ) {
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
}
};
jQuery.fx.stop = function() {
clearInterval( timerId );
timerId = null;
};
jQuery.fx.speeds = {
slow: 600,
fast: 200,
// Default speed
_default: 400
};
// Back Compat <1.8 extension point
jQuery.fx.step = {};
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
// margin is only for outerHeight, outerWidth
jQuery.fn[ funcName ] = function( margin, value ) {
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
return jQuery.access( this, function( elem, type, value ) {
var doc;
if ( jQuery.isWindow( elem ) ) {
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
// isn't a whole lot we can do. See pull request at this URL for discussion:
// https://github.com/jquery/jquery/pull/764
return elem.document.documentElement[ "client" + name ];
}
// Get document width or height
if ( elem.nodeType === 9 ) {
doc = elem.documentElement;
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
// whichever is greatest
return Math.max(
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
elem.body[ "offset" + name ], doc[ "offset" + name ],
doc[ "client" + name ]
);
}
return value === undefined ?
// Get width or height on the element, requesting but not forcing parseFloat
jQuery.css( elem, type, extra ) :
// Set width or height on the element
jQuery.style( elem, type, value, extra );
}, type, chainable ? margin : undefined, chainable, null );
};
});
});
// Limit scope pollution from any deprecated API
// (function() {
// The number of elements contained in the matched element set
jQuery.fn.size = function() {
return this.length;
};
jQuery.fn.andSelf = jQuery.fn.addBack;
// })();
if ( typeof module === "object" && module && typeof module.exports === "object" ) {
// Expose jQuery as module.exports in loaders that implement the Node
// module pattern (including browserify). Do not create the global, since
// the user will be storing it themselves locally, and globals are frowned
// upon in the Node module world.
module.exports = jQuery;
} else {
// Register as a named AMD module, since jQuery can be concatenated with other
// files that may use define, but not via a proper concatenation script that
// understands anonymous AMD modules. A named AMD is safest and most robust
// way to register. Lowercase jquery is used because AMD module names are
// derived from file names, and jQuery is normally delivered in a lowercase
// file name. Do this after creating the global so that if an AMD module wants
// to call noConflict to hide this version of jQuery, it will work.
if ( typeof define === "function" && define.amd ) {
define( "jquery", [], function () { return jQuery; } );
}
}
// If there is a window object, that at least has a document property,
// define jQuery and $ identifiers
if ( typeof window === "object" && typeof window.document === "object" ) {
window.jQuery = window.$ = jQuery;
}
})( window );
|
(function (context) {
"use strict";
var TheGraph = context.TheGraph;
// Initialize configuration for the Port view.
TheGraph.config.port = {
container: {
className: "port arrow"
},
backgroundCircle: {
className: "port-circle-bg"
},
arc: {
className: "port-arc"
},
innerCircle: {
ref: "circleSmall"
},
text: {
ref: "label",
className: "port-label drag"
}
};
TheGraph.factories.port = {
createPortGroup: TheGraph.factories.createGroup,
createPortBackgroundCircle: TheGraph.factories.createCircle,
createPortArc: TheGraph.factories.createPath,
createPortInnerCircle: TheGraph.factories.createCircle,
createPortLabelText: TheGraph.factories.createText
};
// Port view
TheGraph.Port = React.createFactory( React.createClass({
displayName: "TheGraphPort",
mixins: [
TheGraph.mixins.Tooltip
],
componentDidMount: function () {
// Preview edge start
this.getDOMNode().addEventListener("tap", this.edgeStart);
this.getDOMNode().addEventListener("trackstart", this.edgeStart);
// Make edge
this.getDOMNode().addEventListener("trackend", this.triggerDropOnTarget);
this.getDOMNode().addEventListener("the-graph-edge-drop", this.edgeStart);
// Show context menu
if (this.props.showContext) {
this.getDOMNode().addEventListener("contextmenu", this.showContext);
this.getDOMNode().addEventListener("hold", this.showContext);
}
},
getTooltipTrigger: function () {
return this.getDOMNode();
},
shouldShowTooltip: function () {
return (
this.props.app.state.scale < TheGraph.zbpBig ||
this.props.label.length > 8
);
},
showContext: function (event) {
// Don't show port menu on export node port
if (this.props.isExport) {
return;
}
// Click on label, pass context menu to node
if (event && (event.target === this.refs.label.getDOMNode())) {
return;
}
// Don't show native context menu
event.preventDefault();
// Don't tap graph on hold event
event.stopPropagation();
if (event.preventTap) { event.preventTap(); }
// Get mouse position
var x = event.x || event.clientX || 0;
var y = event.y || event.clientY || 0;
// App.showContext
this.props.showContext({
element: this,
type: (this.props.isIn ? "nodeInport" : "nodeOutport"),
x: x,
y: y,
graph: this.props.graph,
itemKey: this.props.label,
item: this.props.port
});
},
getContext: function (menu, options, hide) {
return TheGraph.Menu({
menu: menu,
options: options,
label: this.props.label,
triggerHideContext: hide
});
},
edgeStart: function (event) {
// Don't start edge on export node port
if (this.props.isExport) {
return;
}
// Click on label, pass context menu to node
if (event && (event.target === this.refs.label.getDOMNode())) {
return;
}
// Don't tap graph
event.stopPropagation();
var edgeStartEvent = new CustomEvent('the-graph-edge-start', {
detail: {
isIn: this.props.isIn,
port: this.props.port,
// process: this.props.processKey,
route: this.props.route
},
bubbles: true
});
this.getDOMNode().dispatchEvent(edgeStartEvent);
},
triggerDropOnTarget: function (event) {
// If dropped on a child element will bubble up to port
if (!event.relatedTarget) { return; }
var dropEvent = new CustomEvent('the-graph-edge-drop', {
detail: null,
bubbles: true
});
event.relatedTarget.dispatchEvent(dropEvent);
},
render: function() {
var style;
if (this.props.label.length > 7) {
var fontSize = 6 * (30 / (4 * this.props.label.length));
style = { 'fontSize': fontSize+'px' };
}
var r = 4;
// Highlight matching ports
var highlightPort = this.props.highlightPort;
var inArc = TheGraph.arcs.inport;
var outArc = TheGraph.arcs.outport;
if (highlightPort && highlightPort.isIn === this.props.isIn && (highlightPort.type === this.props.port.type || this.props.port.type === 'any')) {
r = 6;
inArc = TheGraph.arcs.inportBig;
outArc = TheGraph.arcs.outportBig;
}
var backgroundCircleOptions = TheGraph.merge(TheGraph.config.port.backgroundCircle, { r: r + 1 });
var backgroundCircle = TheGraph.factories.port.createPortBackgroundCircle.call(this, backgroundCircleOptions);
var arcOptions = TheGraph.merge(TheGraph.config.port.arc, { d: (this.props.isIn ? inArc : outArc) });
var arc = TheGraph.factories.port.createPortArc.call(this, arcOptions);
var innerCircleOptions = {
className: "port-circle-small fill route"+this.props.route,
r: r - 1.5
};
innerCircleOptions = TheGraph.merge(TheGraph.config.port.innerCircle, innerCircleOptions);
var innerCircle = TheGraph.factories.port.createPortInnerCircle.call(this, innerCircleOptions);
var labelTextOptions = {
x: (this.props.isIn ? 5 : -5),
style: style,
children: this.props.label
};
labelTextOptions = TheGraph.merge(TheGraph.config.port.text, labelTextOptions);
var labelText = TheGraph.factories.port.createPortLabelText.call(this, labelTextOptions);
var portContents = [
backgroundCircle,
arc,
innerCircle,
labelText
];
var containerOptions = TheGraph.merge(TheGraph.config.port.container, { title: this.props.label, transform: "translate("+this.props.x+","+this.props.y+")" });
return TheGraph.factories.port.createPortGroup.call(this, containerOptions, portContents);
}
}));
})(this);
|
// use jasmine to run this file
// https://jasmine.github.io
//
// npm install -g jasmine
// jasmine <this_file>
const fibonacci = require('./mattgd_fibonacci');
describe("Fibonacci by mattgd", () => {
// number1, number2, GDC
fibonacciNumbers = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610];
[1, 2, 5, 8, 14].forEach( n => {
it(`${n} number`, () => {
expect(fibonacci(n)).toEqual(fibonacciNumbers.slice(0, n));
});
});
});
|
"use strict";
exports.intAdd = function (x) {
return function (y) {
/* jshint bitwise: false */
return x + y | 0;
};
};
exports.intMul = function (x) {
return function (y) {
/* jshint bitwise: false */
return x * y | 0;
};
};
exports.numAdd = function (n1) {
return function (n2) {
return n1 + n2;
};
};
exports.numMul = function (n1) {
return function (n2) {
return n1 * n2;
};
};
|
๏ปฟ/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
This software is covered by CKEditor Commercial License. Usage without proper license is prohibited.
*/
CKEDITOR.plugins.setLang("specialchar","el",{euro:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฮฯ
ฯฯ",lsquo:"ฮฯฮนฯฯฮตฯฯฯ ฯฮฑฯฮฑฮบฯฮฎฯฮฑฯ ฮผฮฟฮฝฮฟฯ ฮตฮนฯฮฑฮณฯฮณฮนฮบฮฟฯ",rsquo:"ฮฮตฮพฮนฯฯ ฯฮฑฯฮฑฮบฯฮฎฯฮฑฯ ฮผฮฟฮฝฮฟฯ ฮตฮนฯฮฑฮณฯฮณฮนฮบฮฟฯ",ldquo:"ฮฯฮนฯฯฮตฯฯฯ ฯฮฑฯฮฑฮบฯฮฎฯฮฑฯ ฮตฯ
ฮธฯฮณฯฮฑฮผฮผฯฮฝ ฮตฮนฯฮฑฮณฯฮณฮนฮบฯฮฝ",rdquo:"ฮฮตฮพฮนฯฯ ฯฮฑฯฮฑฮบฯฮฎฯฮฑฯ ฮตฯ
ฮธฯฮณฯฮฑฮผฮผฯฮฝ ฮตฮนฯฮฑฮณฯฮณฮนฮบฯฮฝ",ndash:"ฮ ฮฑฯฮปฮฑ en",mdash:"ฮ ฮฑฯฮปฮฑ em",iexcl:"ฮฮฝฮฌฯฮฟฮดฮฟ ฮธฮฑฯ
ฮผฮฑฯฯฮนฮบฯ",cent:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฯฮตฮฝฯ",pound:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฮปฮฏฯฮฑฯ",curren:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฯฯ
ฮฝฮฑฮปฮปฮฑฮณฮผฮฑฯฮนฮบฮฎฯ ฮผฮฟฮฝฮฌฮดฮฑฯ",yen:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฮฮนฮตฮฝ",brvbar:"ฮฃฯฮฑฯฮผฮญฮฝฮท ฮผฯฮฌฯฮฑ",sect:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฯฮผฮฎฮผฮฑฯฮฟฯ",uml:"ฮฮนฮฑฮฏฯฮตฯฮท",copy:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฯฮฝฮตฯ
ฮผฮฑฯฮนฮบฯฮฝ ฮดฮนฮบฮฑฮนฯฮผฮฌฯฯฮฝ",
ordf:"ฮฮทฮปฯ
ฮบฯฯ ฯฮฑฮบฯฮนฮบฯฯ ฮดฮตฮฏฮบฯฮทฯ",laquo:"ฮฯฮฝฮนฯฮดฮท ฮตฮนฯฮฑฮณฯฮณฮนฮบฮฌ ฮฑฯฮนฯฯฮตฯฮฎฯ ฮบฮฑฯฮฌฮดฮตฮนฮพฮทฯ",not:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฮฌฯฮฝฮทฯฮทฯ",reg:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฯฮทฮผฮฌฯฯฮฝ ฮบฮฑฯฮฑฯฮตฮธฮญฮฝ",macr:"ฮฮฑฮบฯฯฮฝ",deg:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฮฒฮฑฮธฮผฮฟฯ",sup2:"ฮฮบฯฮตฮธฮตฮนฮผฮญฮฝฮฟ ฮดฯฮฟ",sup3:"ฮฮบฯฮตฮธฮตฮนฮผฮญฮฝฮฟ ฯฯฮฏฮฑ",acute:"ฮฮพฮตฮฏฮฑ",micro:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฮผฮนฮบฯฮฟฯ",para:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฯฮฑฯฮฑฮณฯฮฌฯฮฟฯ
",middot:"ฮฮญฯฮท ฯฮตฮปฮตฮฏฮฑ",cedil:"ฮฅฯฮฟฮณฮตฮณฯฮฑฮผฮผฮญฮฝฮท",sup1:"ฮฮบฯฮตฮธฮตฮนฮผฮญฮฝฮฟ ฮญฮฝฮฑ",ordm:"ฮฯฯฮตฮฝฮนฮบฯฯ ฯฮฑฮบฯฮนฮบฯฯ ฮดฮตฮฏฮบฯฮทฯ",raquo:"ฮฯฮฝฮนฯฮดฮท ฮตฮนฯฮฑฮณฯฮณฮนฮบฮฌ ฮดฮตฮพฮนฮฌฯ ฮบฮฑฯฮฌฮดฮตฮนฮพฮทฯ",frac14:"ฮฮฝฮฎฯฮนฮฟ ฮบฮปฮฌฯฮผฮฑ ฮตฮฝฯฯ ฯฮตฯฮฌฯฯฮฟฯ
",frac12:"ฮฮฝฮฎฯฮนฮฟ ฮบฮปฮฌฯฮผฮฑ ฮตฮฝฯฯ ฮดฮตฯฯฮตฯฮฟฯ
",frac34:"ฮฮฝฮฎฯฮนฮฟ ฮบฮปฮฌฯฮผฮฑ ฯฯฮนฯฮฝ ฯฮตฯฮฌฯฯฯฮฝ",
iquest:"ฮฮฝฮฌฯฮฟฮดฮฟ ฮธฮฑฯ
ฮผฮฑฯฯฮนฮบฯ",Agrave:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ A ฮผฮต ฮฒฮฑฯฮตฮฏฮฑ",Aacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ A ฮผฮต ฮฟฮพฮตฮฏฮฑ",Acirc:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ A ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",Atilde:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ A ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",Auml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ A ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ",Aring:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ A ฮผฮต ฮดฮฑฮบฯฯฮปฮนฮฟ ฮตฯฮฌฮฝฯ",AElig:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ ร",Ccedil:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ C ฮผฮต ฯ
ฯฮฟฮณฮตฮณฯฮฑฮผฮผฮญฮฝฮท",Egrave:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ E ฮผฮต ฮฒฮฑฯฮตฮฏฮฑ",Eacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ E ฮผฮต ฮฟฮพฮตฮฏฮฑ",Ecirc:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ ฮ ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท ",
Euml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ ฮ ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ",Igrave:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ I ฮผฮต ฮฒฮฑฯฮตฮฏฮฑ",Iacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ I ฮผฮต ฮฟฮพฮตฮฏฮฑ",Icirc:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ I ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",Iuml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ I ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ ",ETH:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ Eth",Ntilde:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ N ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",Ograve:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ O ฮผฮต ฮฒฮฑฯฮตฮฏฮฑ",Oacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ O ฮผฮต ฮฟฮพฮตฮฏฮฑ",Ocirc:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ O ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท ",Otilde:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ O ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",
Ouml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ O ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ",times:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฯฮฟฮปฮปฮฑฯฮปฮฑฯฮนฮฑฯฮผฮฟฯ",Oslash:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ O ฮผฮต ฮผฮฟฮปฯ
ฮฒฮนฮฌ",Ugrave:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ U ฮผฮต ฮฒฮฑฯฮตฮฏฮฑ",Uacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ U ฮผฮต ฮฟฮพฮตฮฏฮฑ",Ucirc:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ U ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",Uuml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ U ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ",Yacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ Y ฮผฮต ฮฟฮพฮตฮฏฮฑ",THORN:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ Thorn",szlig:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ ฮฑฯฯฯฮฟฮผฮฟ s",agrave:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ a ฮผฮต ฮฒฮฑฯฮตฮฏฮฑ",aacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ a ฮผฮต ฮฟฮพฮตฮฏฮฑ",
acirc:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ a ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",atilde:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ a ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",auml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ a ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ",aring:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ a ฮผฮต ฮดฮฑฮบฯฯฮปฮนฮฟ ฯฮฌฮฝฯ",aelig:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ รฆ",ccedil:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ c ฮผฮต ฯ
ฯฮฟฮณฮตฮณฯฮฑฮผฮผฮญฮฝฮท",egrave:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ ฮต ฮผฮต ฮฒฮฑฯฮตฮฏฮฑ",eacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ e ฮผฮต ฮฟฮพฮตฮฏฮฑ",ecirc:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ e ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",euml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ e ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ",igrave:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ i ฮผฮต ฮฒฮฑฯฮตฮฏฮฑ",iacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ i ฮผฮต ฮฟฮพฮตฮฏฮฑ",
icirc:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ i ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",iuml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ i ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ",eth:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ eth",ntilde:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ n ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",ograve:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ o ฮผฮต ฮฒฮฑฯฮตฮฏฮฑ",oacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ o ฮผฮต ฮฟฮพฮตฮฏฮฑ ",ocirc:"ฮฮฑฯฮนฮฝฮนฮบฯ ฯฮตฮถฯ ฮณฯฮฌฮผฮผฮฑ o ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",otilde:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ o ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท ",ouml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ o ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ",divide:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฮดฮนฮฑฮฏฯฮตฯฮทฯ",oslash:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ o ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",ugrave:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ u ฮผฮต ฮฒฮฑฯฮตฮฏฮฑ",
uacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ u ฮผฮต ฮฟฮพฮตฮฏฮฑ",ucirc:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ u ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",uuml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ u ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ",yacute:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ y ฮผฮต ฮฟฮพฮตฮฏฮฑ",thorn:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ thorn",yuml:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ y ฮผฮต ฮดฮนฮฑฮปฯ
ฯฮนฮบฮฌ",OElig:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฯฯฮผฯฮปฮตฮณฮผฮฑ ฮฮ",oelig:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฯฯฮผฯฮปฮตฮณฮผฮฑ oe",372:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ W ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",374:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮบฮตฯฮฑฮปฮฑฮฏฮฟ ฮณฯฮฌฮผฮผฮฑ Y ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",373:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ w ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",375:"ฮฮฑฯฮนฮฝฮนฮบฯ ฮผฮนฮบฯฯ ฮณฯฮฌฮผฮผฮฑ y ฮผฮต ฯฮตฯฮนฯฯฯฮผฮญฮฝฮท",
sbquo:"ฮฮฝฮนฮฑฮฏฮฟ ฯฮฑฮผฮทฮปฮฟ -9 ฮตฮนฯฮฑฮณฯฮณฮนฮบฯ ",8219:"ฮฮฝฮนฮฑฮฏฮฟ ฯ
ฯฮทฮปฮฟ ฮฑฮฝฮตฯฯฯฮฑฮผฮผฮญฮฝฮฟ-9 ฮตฮนฯฮฑฮณฯฮณฮนฮบฯ ",bdquo:"ฮฮนฯฮปฯ ฯฮฑฮผฮทฮปฯ-9 ฮตฮนฯฮฑฮณฯฮณฮนฮบฯ ",hellip:"ฮฯฮนฮถฯฮฝฯฮนฮฑ ฮฑฯฮฟฯฮนฯฯฮทฯฮนฮบฮฌ",trade:"ฮฃฯฮผฮฒฮฟฮปฮฟ ฮตฮผฯฮฟฯฮนฮบฮฟฯ ฮบฮฑฯฮฑฯฮตฮธฮญฮฝ",9658:"ฮฮฑฯฯฮฟฯ ฮดฮตฮฏฮบฯฮทฯ ฯฮฟฯ
ฮดฮตฮฏฯฮฝฮตฮน ฯฯฮฟฯ ฯฮฑ ฮดฮตฮพฮนฮฌ",bull:"ฮฮฟฯ
ฮบฮบฮฏฮดฮฑ",rarr:"ฮฮตฮพฮฏ ฮฒฮตฮปฮฌฮบฮน",rArr:"ฮฮนฯฮปฯ ฮดฮตฮพฮฏ ฮฒฮตฮปฮฌฮบฮน",hArr:"ฮฮนฯฮปฯ ฮฒฮตฮปฮฌฮบฮน ฮฑฯฮนฯฯฮตฯฮฌ-ฮดฮตฮพฮนฮฌ",diams:"ฮฮฑฯฯฮฟ ฮดฮนฮฑฮผฮฌฮฝฯฮน",asymp:"ฮฃฯฮตฮดฯฮฝ ฮฏฯฮฟ ฮผฮต"});
|
!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):_.dayjs_locale_my=e(_.dayjs)}(this,function(_){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_;var e={name:"my",weekdays:"แแแแบแนแแแฝแฑ_แแแแบแนแแฌ_แกแแบแนแแซ_แแฏแแนแแแฐแธ_แแผแฌแแแแฑแธ_แแฑแฌแแผแฌ_แ
แแฑ".split("_"),months:"แแแบแแแซแแฎ_แแฑแแฑแฌแบแแซแแฎ_แแแบ_แงแแผแฎ_แแฑ_แแฝแแบ_แแฐแแญแฏแแบ_แแผแแฏแแบ_แ
แแบแแแบแแฌ_แกแฑแฌแแบแแญแฏแแฌ_แแญแฏแแแบแแฌ_แแฎแแแบแแฌ".split("_"),weekStart:1,weekdaysShort:"แแฝแฑ_แแฌ_แแซ_แแฐแธ_แแผแฌ_แแฑแฌ_แแฑ".split("_"),monthsShort:"แแแบ_แแฑ_แแแบ_แแผแฎ_แแฑ_แแฝแแบ_แแญแฏแแบ_แแผ_แ
แแบ_แกแฑแฌแแบ_แแญแฏ_แแฎ".split("_"),weekdaysMin:"แแฝแฑ_แแฌ_แแซ_แแฐแธ_แแผแฌ_แแฑแฌ_แแฑ".split("_"),ordinal:function(_){return _}};return _.locale(e,null,!0),e});
|
// We use the same empty object to ref count the styles that don't need a theme object.
const noopTheme = {};
export default noopTheme;
|
/**
* ag-grid-community - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v19.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var context_1 = require("../context/context");
var gridSerializer_1 = require("./gridSerializer");
var downloader_1 = require("../downloader");
var columnController_1 = require("../columnController/columnController");
var valueService_1 = require("../valueService/valueService");
var gridOptionsWrapper_1 = require("../gridOptionsWrapper");
var constants_1 = require("../constants");
var utils_1 = require("../utils");
var LINE_SEPARATOR = '\r\n';
var CsvSerializingSession = /** @class */ (function (_super) {
__extends(CsvSerializingSession, _super);
function CsvSerializingSession(columnController, valueService, gridOptionsWrapper, processCellCallback, processHeaderCallback, suppressQuotes, columnSeparator) {
var _this = _super.call(this, columnController, valueService, gridOptionsWrapper, processCellCallback, processHeaderCallback) || this;
_this.suppressQuotes = suppressQuotes;
_this.columnSeparator = columnSeparator;
_this.result = '';
_this.lineOpened = false;
return _this;
}
CsvSerializingSession.prototype.prepare = function (columnsToExport) {
};
CsvSerializingSession.prototype.addCustomHeader = function (customHeader) {
if (!customHeader)
return;
this.result += customHeader + LINE_SEPARATOR;
};
CsvSerializingSession.prototype.addCustomFooter = function (customFooter) {
if (!customFooter)
return;
this.result += customFooter + LINE_SEPARATOR;
};
CsvSerializingSession.prototype.onNewHeaderGroupingRow = function () {
if (this.lineOpened)
this.result += LINE_SEPARATOR;
return {
onColumn: this.onNewHeaderGroupingRowColumn.bind(this)
};
};
CsvSerializingSession.prototype.onNewHeaderGroupingRowColumn = function (header, index, span) {
if (index != 0) {
this.result += this.columnSeparator;
}
this.result += this.putInQuotes(header, this.suppressQuotes);
for (var i = 1; i <= span; i++) {
this.result += this.columnSeparator + this.putInQuotes("", this.suppressQuotes);
}
this.lineOpened = true;
};
CsvSerializingSession.prototype.onNewHeaderRow = function () {
if (this.lineOpened)
this.result += LINE_SEPARATOR;
return {
onColumn: this.onNewHeaderRowColumn.bind(this)
};
};
CsvSerializingSession.prototype.onNewHeaderRowColumn = function (column, index, node) {
if (index != 0) {
this.result += this.columnSeparator;
}
this.result += this.putInQuotes(this.extractHeaderValue(column), this.suppressQuotes);
this.lineOpened = true;
};
CsvSerializingSession.prototype.onNewBodyRow = function () {
if (this.lineOpened)
this.result += LINE_SEPARATOR;
return {
onColumn: this.onNewBodyRowColumn.bind(this)
};
};
CsvSerializingSession.prototype.onNewBodyRowColumn = function (column, index, node) {
if (index != 0) {
this.result += this.columnSeparator;
}
this.result += this.putInQuotes(this.extractRowCellValue(column, index, constants_1.Constants.EXPORT_TYPE_CSV, node), this.suppressQuotes);
this.lineOpened = true;
};
CsvSerializingSession.prototype.putInQuotes = function (value, suppressQuotes) {
if (suppressQuotes) {
return value;
}
if (value === null || value === undefined) {
return '""';
}
var stringValue;
if (typeof value === 'string') {
stringValue = value;
}
else if (typeof value.toString === 'function') {
stringValue = value.toString();
}
else {
console.warn('unknown value type during csv conversion');
stringValue = '';
}
// replace each " with "" (ie two sets of double quotes is how to do double quotes in csv)
var valueEscaped = stringValue.replace(/"/g, "\"\"");
return '"' + valueEscaped + '"';
};
CsvSerializingSession.prototype.parse = function () {
return this.result;
};
return CsvSerializingSession;
}(gridSerializer_1.BaseGridSerializingSession));
exports.CsvSerializingSession = CsvSerializingSession;
var BaseCreator = /** @class */ (function () {
function BaseCreator() {
}
BaseCreator.prototype.setBeans = function (beans) {
this.beans = beans;
};
BaseCreator.prototype.export = function (userParams) {
if (this.isExportSuppressed()) {
console.warn("ag-grid: Export canceled. Export is not allowed as per your configuration.");
return "";
}
var _a = this.getMergedParamsAndData(userParams), mergedParams = _a.mergedParams, data = _a.data;
var fileNamePresent = mergedParams && mergedParams.fileName && mergedParams.fileName.length !== 0;
var fileName = fileNamePresent ? mergedParams.fileName : this.getDefaultFileName();
if (fileName.indexOf(".") === -1) {
fileName = fileName + "." + this.getDefaultFileExtension();
}
this.beans.downloader.download(fileName, data, this.getMimeType());
return data;
};
BaseCreator.prototype.getData = function (params) {
return this.getMergedParamsAndData(params).data;
};
BaseCreator.prototype.getMergedParamsAndData = function (userParams) {
var mergedParams = this.mergeDefaultParams(userParams);
var data = this.beans.gridSerializer.serialize(this.createSerializingSession(mergedParams), mergedParams);
return { mergedParams: mergedParams, data: data };
};
BaseCreator.prototype.mergeDefaultParams = function (userParams) {
var baseParams = this.beans.gridOptionsWrapper.getDefaultExportParams();
var params = {};
utils_1._.assign(params, baseParams);
utils_1._.assign(params, userParams);
return params;
};
return BaseCreator;
}());
exports.BaseCreator = BaseCreator;
var CsvCreator = /** @class */ (function (_super) {
__extends(CsvCreator, _super);
function CsvCreator() {
return _super !== null && _super.apply(this, arguments) || this;
}
CsvCreator.prototype.postConstruct = function () {
this.setBeans({
downloader: this.downloader,
gridSerializer: this.gridSerializer,
gridOptionsWrapper: this.gridOptionsWrapper
});
};
CsvCreator.prototype.exportDataAsCsv = function (params) {
return this.export(params);
};
CsvCreator.prototype.getDataAsCsv = function (params) {
return this.getData(params);
};
CsvCreator.prototype.getMimeType = function () {
return 'text/csv;charset=utf-8;';
};
CsvCreator.prototype.getDefaultFileName = function () {
return 'export.csv';
};
CsvCreator.prototype.getDefaultFileExtension = function () {
return 'csv';
};
CsvCreator.prototype.createSerializingSession = function (params) {
return new CsvSerializingSession(this.columnController, this.valueService, this.gridOptionsWrapper, params ? params.processCellCallback : null, params ? params.processHeaderCallback : null, params && params.suppressQuotes, (params && params.columnSeparator) || ',');
};
CsvCreator.prototype.isExportSuppressed = function () {
return this.gridOptionsWrapper.isSuppressCsvExport();
};
__decorate([
context_1.Autowired('columnController'),
__metadata("design:type", columnController_1.ColumnController)
], CsvCreator.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('valueService'),
__metadata("design:type", valueService_1.ValueService)
], CsvCreator.prototype, "valueService", void 0);
__decorate([
context_1.Autowired('downloader'),
__metadata("design:type", downloader_1.Downloader)
], CsvCreator.prototype, "downloader", void 0);
__decorate([
context_1.Autowired('gridSerializer'),
__metadata("design:type", gridSerializer_1.GridSerializer)
], CsvCreator.prototype, "gridSerializer", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
], CsvCreator.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.PostConstruct,
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], CsvCreator.prototype, "postConstruct", null);
CsvCreator = __decorate([
context_1.Bean('csvCreator')
], CsvCreator);
return CsvCreator;
}(BaseCreator));
exports.CsvCreator = CsvCreator;
|
/**
* @license Highmaps JS v7.1.3 (2019-08-14)
*
* (c) 2009-2019 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
(function (factory) {
if (typeof module === 'object' && module.exports) {
factory['default'] = factory;
module.exports = factory;
} else if (typeof define === 'function' && define.amd) {
define('highcharts/modules/map-parser', ['highcharts', 'highcharts/modules/data'], function (Highcharts) {
factory(Highcharts);
factory.Highcharts = Highcharts;
return factory;
});
} else {
factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
}
}(function (Highcharts) {
var _modules = Highcharts ? Highcharts._modules : {};
function _registerModule(obj, path, args, fn) {
if (!obj.hasOwnProperty(path)) {
obj[path] = fn.apply(null, args);
}
}
_registerModule(_modules, 'modules/map-parser.src.js', [_modules['parts/Globals.js']], function (H) {
/* *
* (c) 2009-2019 Torstein Honsi
*
* SVG map parser. This file requires data.js.
*
* License: www.highcharts.com/license
*/
/* global document, jQuery, $ */
H.wrap(H.Data.prototype, 'init', function (proceed, options) {
proceed.call(this, options);
if (options.svg) {
this.loadSVG();
}
});
H.extend(H.Data.prototype, {
// Parse an SVG path into a simplified array that Highcharts can read
pathToArray: function (path, matrix) {
var i = 0,
position = 0,
point,
positions,
fixedPoint = [0, 0],
startPoint = [0, 0],
isRelative,
isString,
operator,
matrixTransform = function (p, m) {
return [
m.a * p[0] + m.c * p[1] + m.e,
m.b * p[0] + m.d * p[1] + m.f
];
};
path = path
// Scientific notation
.replace(/[0-9]+e-?[0-9]+/g, function (a) {
return +a; // cast to number
})
// Move letters apart
.replace(/([A-Za-z])/g, ' $1 ')
// Add space before minus
.replace(/-/g, ' -')
// Trim
.replace(/^\s*/, '').replace(/\s*$/, '')
// Remove newlines, tabs etc
.replace(/\s+/g, ' ')
// Split on spaces, minus and commas
.split(/[ ,]+/);
// Blank path
if (path.length === 1) {
return [];
}
// Real path
for (i = 0; i < path.length; i++) {
isString = /[a-zA-Z]/.test(path[i]);
// Handle strings
if (isString) {
operator = path[i];
positions = 2;
// Curves have six positions
if (operator === 'c' || operator === 'C') {
positions = 6;
}
// When moving after a closed subpath, start again from previous
// subpath's starting point
if (operator === 'm') {
startPoint = [
parseFloat(path[i + 1]) + startPoint[0],
parseFloat(path[i + 2]) + startPoint[1]
];
} else if (operator === 'M') {
startPoint = [
parseFloat(path[i + 1]),
parseFloat(path[i + 2])
];
}
// Enter or exit relative mode
if (operator === 'm' || operator === 'l' || operator === 'c') {
path[i] = operator.toUpperCase();
isRelative = true;
} else if (
operator === 'M' ||
operator === 'L' ||
operator === 'C'
) {
isRelative = false;
// Horizontal and vertical line to
} else if (operator === 'h') {
isRelative = true;
path[i] = 'L';
path.splice(i + 2, 0, 0);
} else if (operator === 'v') {
isRelative = true;
path[i] = 'L';
path.splice(i + 1, 0, 0);
} else if (operator === 's') {
isRelative = true;
path[i] = 'L';
path.splice(i + 1, 2);
} else if (operator === 'S') {
isRelative = false;
path[i] = 'L';
path.splice(i + 1, 2);
} else if (operator === 'H' || operator === 'h') {
isRelative = false;
path[i] = 'L';
path.splice(i + 2, 0, fixedPoint[1]);
} else if (operator === 'V' || operator === 'v') {
isRelative = false;
path[i] = 'L';
path.splice(i + 1, 0, fixedPoint[0]);
} else if (operator === 'z' || operator === 'Z') {
fixedPoint = startPoint;
}
// Handle numbers
} else {
path[i] = parseFloat(path[i]);
if (isRelative) {
path[i] += fixedPoint[position % 2];
}
if (position % 2 === 1) { // y
// only translate absolute points or initial moveTo
if (
matrix &&
(!isRelative || (operator === 'm' && i < 3))
) {
point = matrixTransform([path[i - 1], path[i]], matrix);
path[i - 1] = point[0];
path[i] = point[1];
}
}
// Reset to zero position (x/y switching)
if (position === positions - 1) {
// Set the fixed point for the next pair
fixedPoint = [path[i - 1], path[i]];
position = 0;
} else {
position += 1;
}
}
}
// Handle polygon points
if (typeof path[0] === 'number' && path.length >= 4) {
path.unshift('M');
path.splice(3, 0, 'L');
}
return path;
},
// Join the path back to a string for compression
pathToString: function (arr) {
arr.forEach(function (point) {
var path = point.path;
// Join all by commas
path = path.join(',');
// Remove commas next to a letter
path = path.replace(/,?([a-zA-Z]),?/g, '$1');
// Reinsert
point.path = path;
});
return arr;
},
// Scale the path to fit within a given box and round all numbers
roundPaths: function (arr, scale) {
var mapProto = H.seriesTypes.map.prototype,
fakeSeries,
origSize,
transA;
fakeSeries = {
xAxis: {
translate: H.Axis.prototype.translate,
options: {},
minPixelPadding: 0
},
yAxis: {
translate: H.Axis.prototype.translate,
options: {},
minPixelPadding: 0
}
};
// Borrow the map series type's getBox method
mapProto.getBox.call(fakeSeries, arr);
origSize = Math.max(
fakeSeries.maxX - fakeSeries.minX,
fakeSeries.maxY - fakeSeries.minY
);
scale = scale || 1000;
transA = scale / origSize;
fakeSeries.xAxis.transA = fakeSeries.yAxis.transA = transA;
fakeSeries.xAxis.len = fakeSeries.yAxis.len = scale;
fakeSeries.xAxis.min = fakeSeries.minX;
fakeSeries.yAxis.min = (fakeSeries.minY + scale) / transA;
arr.forEach(function (point) {
var i,
path;
point.path = path =
mapProto.translatePath.call(fakeSeries, point.path, true);
i = path.length;
while (i--) {
if (typeof path[i] === 'number') {
path[i] = Math.round(path[i]);
}
}
delete point._foundBox;
});
return arr;
},
// Load an SVG file and extract the paths
loadSVG: function () {
var data = this,
options = this.options;
function getPathLikeChildren(parent) {
return Array.prototype.slice
.call(parent.getElementsByTagName('path'))
.concat(
Array.prototype.slice.call(
parent.getElementsByTagName('polygon')
)
)
.concat(
Array.prototype.slice.call(
parent.getElementsByTagName('rect')
)
);
}
function getPathDefinition(node) {
if (node.nodeName === 'path') {
return node.getAttribute('d');
}
if (node.nodeName === 'polygon') {
return node.getAttribute('points');
}
if (node.nodeName === 'rect') {
var x = +node.getAttribute('x'),
y = +node.getAttribute('y'),
w = +node.getAttribute('width'),
h = +node.getAttribute('height');
// Return polygon definition
return [x, y, x + w, y, x + w, y + h, x, y + h, x, y].join(' ');
}
}
function getTranslate(elem) {
var ctm = elem.getCTM();
if (!isNaN(ctm.f)) {
return ctm;
}
}
function getName(elem) {
var desc = elem.getElementsByTagName('desc'),
nameTag = desc[0] && desc[0].getElementsByTagName('name'),
name = nameTag && nameTag[0] && nameTag[0].innerText;
return (
name ||
elem.getAttribute('inkscape:label') ||
elem.getAttribute('id') ||
elem.getAttribute('class')
);
}
function hasFill(elem) {
return (
!/fill[\s]?\:[\s]?none/.test(elem.getAttribute('style')) &&
elem.getAttribute('fill') !== 'none'
);
}
function handleSVG(xml) {
var arr = [],
currentParent,
allPaths,
commonLineage,
lastCommonAncestor,
handleGroups;
// Make a hidden frame where the SVG is rendered
data.$frame = data.$frame || $('<div>')
.css({
position: 'absolute', // https://bugzilla.mozilla.org/show_bug.cgi?id=756985
top: '-9999em'
})
.appendTo($(document.body));
data.$frame.html(xml);
xml = $('svg', data.$frame)[0];
xml.removeAttribute('viewBox');
allPaths = getPathLikeChildren(xml);
// Skip clip paths
['defs', 'clipPath'].forEach(function (nodeName) {
xml.getElementsByTagName(nodeName).forEach(function (parent) {
parent.getElementsByTagName('path').forEach(
function (path) {
path.skip = true;
}
);
});
});
// If not all paths belong to the same group, handle groups
allPaths.forEach(function (path, i) {
if (!path.skip) {
var itemLineage = [],
parentNode,
j;
if (i > 0 && path.parentNode !== currentParent) {
handleGroups = true;
}
currentParent = path.parentNode;
// Handle common lineage
parentNode = path;
while (parentNode) {
itemLineage.push(parentNode);
parentNode = parentNode.parentNode;
}
itemLineage.reverse();
if (!commonLineage) {
commonLineage = itemLineage; // first iteration
} else {
for (j = 0; j < commonLineage.length; j++) {
if (commonLineage[j] !== itemLineage[j]) {
commonLineage = commonLineage.slice(0, j);
}
}
}
}
});
lastCommonAncestor = commonLineage[commonLineage.length - 1];
// Iterate groups to find sub paths
if (handleGroups) {
lastCommonAncestor.getElementsByTagName('g').forEach(
function (g) {
var groupPath = [],
pathHasFill;
getPathLikeChildren(g).forEach(function (path) {
if (!path.skip) {
groupPath = groupPath.concat(
data.pathToArray(
getPathDefinition(path),
getTranslate(path)
)
);
if (hasFill(path)) {
pathHasFill = true;
}
path.skip = true;
}
});
arr.push({
name: getName(g),
path: groupPath,
hasFill: pathHasFill
});
}
);
}
// Iterate the remaining paths that are not parts of groups
allPaths.forEach(function (path) {
if (!path.skip) {
arr.push({
name: getName(path),
path: data.pathToArray(
getPathDefinition(path),
getTranslate(path)
),
hasFill: hasFill(path)
});
}
});
// Round off to compress
data.roundPaths(arr);
// Do the callback
options.complete({
series: [{
data: arr
}]
});
}
if (options.svg.indexOf('<svg') !== -1) {
handleSVG(options.svg);
} else {
jQuery.ajax({
url: options.svg,
dataType: 'text',
success: handleSVG
});
}
}
});
});
_registerModule(_modules, 'masters/modules/map-parser.src.js', [], function () {
});
}));
|
/*global define*/
define([
'./Cartesian2',
'./defaultValue',
'./defined',
'./defineProperties',
'./DeveloperError',
'./freezeObject'
], function(
Cartesian2,
defaultValue,
defined,
defineProperties,
DeveloperError,
freezeObject) {
'use strict';
/**
* A 2x2 matrix, indexable as a column-major order array.
* Constructor parameters are in row-major order for code readability.
* @alias Matrix2
* @constructor
*
* @param {Number} [column0Row0=0.0] The value for column 0, row 0.
* @param {Number} [column1Row0=0.0] The value for column 1, row 0.
* @param {Number} [column0Row1=0.0] The value for column 0, row 1.
* @param {Number} [column1Row1=0.0] The value for column 1, row 1.
*
* @see Matrix2.fromColumnMajorArray
* @see Matrix2.fromRowMajorArray
* @see Matrix2.fromScale
* @see Matrix2.fromUniformScale
* @see Matrix3
* @see Matrix4
*/
function Matrix2(column0Row0, column1Row0, column0Row1, column1Row1) {
this[0] = defaultValue(column0Row0, 0.0);
this[1] = defaultValue(column0Row1, 0.0);
this[2] = defaultValue(column1Row0, 0.0);
this[3] = defaultValue(column1Row1, 0.0);
}
/**
* The number of elements used to pack the object into an array.
* @type {Number}
*/
Matrix2.packedLength = 4;
/**
* Stores the provided instance into the provided array.
*
* @param {Matrix2} value The value to pack.
* @param {Number[]} array The array to pack into.
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
*
* @returns {Number[]} The array that was packed into
*/
Matrix2.pack = function(value, array, startingIndex) {
//>>includeStart('debug', pragmas.debug);
if (!defined(value)) {
throw new DeveloperError('value is required');
}
if (!defined(array)) {
throw new DeveloperError('array is required');
}
//>>includeEnd('debug');
startingIndex = defaultValue(startingIndex, 0);
array[startingIndex++] = value[0];
array[startingIndex++] = value[1];
array[startingIndex++] = value[2];
array[startingIndex++] = value[3];
return array;
};
/**
* Retrieves an instance from a packed array.
*
* @param {Number[]} array The packed array.
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
* @param {Matrix2} [result] The object into which to store the result.
* @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.
*/
Matrix2.unpack = function(array, startingIndex, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(array)) {
throw new DeveloperError('array is required');
}
//>>includeEnd('debug');
startingIndex = defaultValue(startingIndex, 0);
if (!defined(result)) {
result = new Matrix2();
}
result[0] = array[startingIndex++];
result[1] = array[startingIndex++];
result[2] = array[startingIndex++];
result[3] = array[startingIndex++];
return result;
};
/**
* Duplicates a Matrix2 instance.
*
* @param {Matrix2} matrix The matrix to duplicate.
* @param {Matrix2} [result] The object onto which to store the result.
* @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)
*/
Matrix2.clone = function(values, result) {
if (!defined(values)) {
return undefined;
}
if (!defined(result)) {
return new Matrix2(values[0], values[2],
values[1], values[3]);
}
result[0] = values[0];
result[1] = values[1];
result[2] = values[2];
result[3] = values[3];
return result;
};
/**
* Creates a Matrix2 from 4 consecutive elements in an array.
*
* @param {Number[]} array The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
* @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.
* @param {Matrix2} [result] The object onto which to store the result.
* @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.
*
* @example
* // Create the Matrix2:
* // [1.0, 2.0]
* // [1.0, 2.0]
*
* var v = [1.0, 1.0, 2.0, 2.0];
* var m = Cesium.Matrix2.fromArray(v);
*
* // Create same Matrix2 with using an offset into an array
* var v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];
* var m2 = Cesium.Matrix2.fromArray(v2, 2);
*/
Matrix2.fromArray = function(array, startingIndex, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(array)) {
throw new DeveloperError('array is required');
}
//>>includeEnd('debug');
startingIndex = defaultValue(startingIndex, 0);
if (!defined(result)) {
result = new Matrix2();
}
result[0] = array[startingIndex];
result[1] = array[startingIndex + 1];
result[2] = array[startingIndex + 2];
result[3] = array[startingIndex + 3];
return result;
};
/**
* Creates a Matrix2 instance from a column-major order array.
*
* @param {Number[]} values The column-major order array.
* @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.
* @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.
*/
Matrix2.fromColumnMajorArray = function(values, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(values)) {
throw new DeveloperError('values parameter is required');
}
//>>includeEnd('debug');
return Matrix2.clone(values, result);
};
/**
* Creates a Matrix2 instance from a row-major order array.
* The resulting matrix will be in column-major order.
*
* @param {Number[]} values The row-major order array.
* @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.
* @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.
*/
Matrix2.fromRowMajorArray = function(values, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(values)) {
throw new DeveloperError('values is required.');
}
//>>includeEnd('debug');
if (!defined(result)) {
return new Matrix2(values[0], values[1],
values[2], values[3]);
}
result[0] = values[0];
result[1] = values[2];
result[2] = values[1];
result[3] = values[3];
return result;
};
/**
* Computes a Matrix2 instance representing a non-uniform scale.
*
* @param {Cartesian2} scale The x and y scale factors.
* @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.
* @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.
*
* @example
* // Creates
* // [7.0, 0.0]
* // [0.0, 8.0]
* var m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));
*/
Matrix2.fromScale = function(scale, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(scale)) {
throw new DeveloperError('scale is required.');
}
//>>includeEnd('debug');
if (!defined(result)) {
return new Matrix2(
scale.x, 0.0,
0.0, scale.y);
}
result[0] = scale.x;
result[1] = 0.0;
result[2] = 0.0;
result[3] = scale.y;
return result;
};
/**
* Computes a Matrix2 instance representing a uniform scale.
*
* @param {Number} scale The uniform scale factor.
* @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.
* @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.
*
* @example
* // Creates
* // [2.0, 0.0]
* // [0.0, 2.0]
* var m = Cesium.Matrix2.fromUniformScale(2.0);
*/
Matrix2.fromUniformScale = function(scale, result) {
//>>includeStart('debug', pragmas.debug);
if (typeof scale !== 'number') {
throw new DeveloperError('scale is required.');
}
//>>includeEnd('debug');
if (!defined(result)) {
return new Matrix2(
scale, 0.0,
0.0, scale);
}
result[0] = scale;
result[1] = 0.0;
result[2] = 0.0;
result[3] = scale;
return result;
};
/**
* Creates a rotation matrix.
*
* @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.
* @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.
* @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.
*
* @example
* // Rotate a point 45 degrees counterclockwise.
* var p = new Cesium.Cartesian2(5, 6);
* var m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));
* var rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());
*/
Matrix2.fromRotation = function(angle, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(angle)) {
throw new DeveloperError('angle is required.');
}
//>>includeEnd('debug');
var cosAngle = Math.cos(angle);
var sinAngle = Math.sin(angle);
if (!defined(result)) {
return new Matrix2(
cosAngle, -sinAngle,
sinAngle, cosAngle);
}
result[0] = cosAngle;
result[1] = sinAngle;
result[2] = -sinAngle;
result[3] = cosAngle;
return result;
};
/**
* Creates an Array from the provided Matrix2 instance.
* The array will be in column-major order.
*
* @param {Matrix2} matrix The matrix to use..
* @param {Number[]} [result] The Array onto which to store the result.
* @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided.
*/
Matrix2.toArray = function(matrix, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required');
}
//>>includeEnd('debug');
if (!defined(result)) {
return [matrix[0], matrix[1], matrix[2], matrix[3]];
}
result[0] = matrix[0];
result[1] = matrix[1];
result[2] = matrix[2];
result[3] = matrix[3];
return result;
};
/**
* Computes the array index of the element at the provided row and column.
*
* @param {Number} row The zero-based index of the row.
* @param {Number} column The zero-based index of the column.
* @returns {Number} The index of the element at the provided row and column.
*
* @exception {DeveloperError} row must be 0 or 1.
* @exception {DeveloperError} column must be 0 or 1.
*
* @example
* var myMatrix = new Cesium.Matrix2();
* var column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);
* var column1Row0 = myMatrix[column1Row0Index]
* myMatrix[column1Row0Index] = 10.0;
*/
Matrix2.getElementIndex = function(column, row) {
//>>includeStart('debug', pragmas.debug);
if (typeof row !== 'number' || row < 0 || row > 1) {
throw new DeveloperError('row must be 0 or 1.');
}
if (typeof column !== 'number' || column < 0 || column > 1) {
throw new DeveloperError('column must be 0 or 1.');
}
//>>includeEnd('debug');
return column * 2 + row;
};
/**
* Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.
*
* @param {Matrix2} matrix The matrix to use.
* @param {Number} index The zero-based index of the column to retrieve.
* @param {Cartesian2} result The object onto which to store the result.
* @returns {Cartesian2} The modified result parameter.
*
* @exception {DeveloperError} index must be 0 or 1.
*/
Matrix2.getColumn = function(matrix, index, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required.');
}
if (typeof index !== 'number' || index < 0 || index > 1) {
throw new DeveloperError('index must be 0 or 1.');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
var startIndex = index * 2;
var x = matrix[startIndex];
var y = matrix[startIndex + 1];
result.x = x;
result.y = y;
return result;
};
/**
* Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.
*
* @param {Matrix2} matrix The matrix to use.
* @param {Number} index The zero-based index of the column to set.
* @param {Cartesian2} cartesian The Cartesian whose values will be assigned to the specified column.
* @param {Cartesian2} result The object onto which to store the result.
* @returns {Matrix2} The modified result parameter.
*
* @exception {DeveloperError} index must be 0 or 1.
*/
Matrix2.setColumn = function(matrix, index, cartesian, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required');
}
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
if (typeof index !== 'number' || index < 0 || index > 1) {
throw new DeveloperError('index must be 0 or 1.');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
result = Matrix2.clone(matrix, result);
var startIndex = index * 2;
result[startIndex] = cartesian.x;
result[startIndex + 1] = cartesian.y;
return result;
};
/**
* Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.
*
* @param {Matrix2} matrix The matrix to use.
* @param {Number} index The zero-based index of the row to retrieve.
* @param {Cartesian2} result The object onto which to store the result.
* @returns {Cartesian2} The modified result parameter.
*
* @exception {DeveloperError} index must be 0 or 1.
*/
Matrix2.getRow = function(matrix, index, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required.');
}
if (typeof index !== 'number' || index < 0 || index > 1) {
throw new DeveloperError('index must be 0 or 1.');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
var x = matrix[index];
var y = matrix[index + 2];
result.x = x;
result.y = y;
return result;
};
/**
* Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.
*
* @param {Matrix2} matrix The matrix to use.
* @param {Number} index The zero-based index of the row to set.
* @param {Cartesian2} cartesian The Cartesian whose values will be assigned to the specified row.
* @param {Matrix2} result The object onto which to store the result.
* @returns {Matrix2} The modified result parameter.
*
* @exception {DeveloperError} index must be 0 or 1.
*/
Matrix2.setRow = function(matrix, index, cartesian, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required');
}
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
if (typeof index !== 'number' || index < 0 || index > 1) {
throw new DeveloperError('index must be 0 or 1.');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
result = Matrix2.clone(matrix, result);
result[index] = cartesian.x;
result[index + 2] = cartesian.y;
return result;
};
var scratchColumn = new Cartesian2();
/**
* Extracts the non-uniform scale assuming the matrix is an affine transformation.
*
* @param {Matrix2} matrix The matrix.
* @param {Cartesian2} result The object onto which to store the result.
* @returns {Cartesian2} The modified result parameter.
*/
Matrix2.getScale = function(matrix, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required.');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
result.x = Cartesian2.magnitude(Cartesian2.fromElements(matrix[0], matrix[1], scratchColumn));
result.y = Cartesian2.magnitude(Cartesian2.fromElements(matrix[2], matrix[3], scratchColumn));
return result;
};
var scratchScale = new Cartesian2();
/**
* Computes the maximum scale assuming the matrix is an affine transformation.
* The maximum scale is the maximum length of the column vectors.
*
* @param {Matrix2} matrix The matrix.
* @returns {Number} The maximum scale.
*/
Matrix2.getMaximumScale = function(matrix) {
Matrix2.getScale(matrix, scratchScale);
return Cartesian2.maximumComponent(scratchScale);
};
/**
* Computes the product of two matrices.
*
* @param {Matrix2} left The first matrix.
* @param {Matrix2} right The second matrix.
* @param {Matrix2} result The object onto which to store the result.
* @returns {Matrix2} The modified result parameter.
*/
Matrix2.multiply = function(left, right, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(left)) {
throw new DeveloperError('left is required');
}
if (!defined(right)) {
throw new DeveloperError('right is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
var column0Row0 = left[0] * right[0] + left[2] * right[1];
var column1Row0 = left[0] * right[2] + left[2] * right[3];
var column0Row1 = left[1] * right[0] + left[3] * right[1];
var column1Row1 = left[1] * right[2] + left[3] * right[3];
result[0] = column0Row0;
result[1] = column0Row1;
result[2] = column1Row0;
result[3] = column1Row1;
return result;
};
/**
* Computes the sum of two matrices.
*
* @param {Matrix2} left The first matrix.
* @param {Matrix2} right The second matrix.
* @param {Matrix2} result The object onto which to store the result.
* @returns {Matrix2} The modified result parameter.
*/
Matrix2.add = function(left, right, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(left)) {
throw new DeveloperError('left is required');
}
if (!defined(right)) {
throw new DeveloperError('right is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
result[0] = left[0] + right[0];
result[1] = left[1] + right[1];
result[2] = left[2] + right[2];
result[3] = left[3] + right[3];
return result;
};
/**
* Computes the difference of two matrices.
*
* @param {Matrix2} left The first matrix.
* @param {Matrix2} right The second matrix.
* @param {Matrix2} result The object onto which to store the result.
* @returns {Matrix2} The modified result parameter.
*/
Matrix2.subtract = function(left, right, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(left)) {
throw new DeveloperError('left is required');
}
if (!defined(right)) {
throw new DeveloperError('right is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
result[0] = left[0] - right[0];
result[1] = left[1] - right[1];
result[2] = left[2] - right[2];
result[3] = left[3] - right[3];
return result;
};
/**
* Computes the product of a matrix and a column vector.
*
* @param {Matrix2} matrix The matrix.
* @param {Cartesian2} cartesian The column.
* @param {Cartesian2} result The object onto which to store the result.
* @returns {Cartesian2} The modified result parameter.
*/
Matrix2.multiplyByVector = function(matrix, cartesian, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required');
}
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
var x = matrix[0] * cartesian.x + matrix[2] * cartesian.y;
var y = matrix[1] * cartesian.x + matrix[3] * cartesian.y;
result.x = x;
result.y = y;
return result;
};
/**
* Computes the product of a matrix and a scalar.
*
* @param {Matrix2} matrix The matrix.
* @param {Number} scalar The number to multiply by.
* @param {Matrix2} result The object onto which to store the result.
* @returns {Matrix2} The modified result parameter.
*/
Matrix2.multiplyByScalar = function(matrix, scalar, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required');
}
if (typeof scalar !== 'number') {
throw new DeveloperError('scalar is required and must be a number');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
result[0] = matrix[0] * scalar;
result[1] = matrix[1] * scalar;
result[2] = matrix[2] * scalar;
result[3] = matrix[3] * scalar;
return result;
};
/**
* Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
*
* @param {Matrix2} matrix The matrix on the left-hand side.
* @param {Cartesian2} scale The non-uniform scale on the right-hand side.
* @param {Matrix2} result The object onto which to store the result.
* @returns {Matrix2} The modified result parameter.
*
*
* @example
* // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);
* Cesium.Matrix2.multiplyByScale(m, scale, m);
*
* @see Matrix2.fromScale
* @see Matrix2.multiplyByUniformScale
*/
Matrix2.multiplyByScale = function(matrix, scale, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required');
}
if (!defined(scale)) {
throw new DeveloperError('scale is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
result[0] = matrix[0] * scale.x;
result[1] = matrix[1] * scale.x;
result[2] = matrix[2] * scale.y;
result[3] = matrix[3] * scale.y;
return result;
};
/**
* Creates a negated copy of the provided matrix.
*
* @param {Matrix2} matrix The matrix to negate.
* @param {Matrix2} result The object onto which to store the result.
* @returns {Matrix2} The modified result parameter.
*/
Matrix2.negate = function(matrix, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
result[0] = -matrix[0];
result[1] = -matrix[1];
result[2] = -matrix[2];
result[3] = -matrix[3];
return result;
};
/**
* Computes the transpose of the provided matrix.
*
* @param {Matrix2} matrix The matrix to transpose.
* @param {Matrix2} result The object onto which to store the result.
* @returns {Matrix2} The modified result parameter.
*/
Matrix2.transpose = function(matrix, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
var column0Row0 = matrix[0];
var column0Row1 = matrix[2];
var column1Row0 = matrix[1];
var column1Row1 = matrix[3];
result[0] = column0Row0;
result[1] = column0Row1;
result[2] = column1Row0;
result[3] = column1Row1;
return result;
};
/**
* Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
*
* @param {Matrix2} matrix The matrix with signed elements.
* @param {Matrix2} result The object onto which to store the result.
* @returns {Matrix2} The modified result parameter.
*/
Matrix2.abs = function(matrix, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(matrix)) {
throw new DeveloperError('matrix is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
//>>includeEnd('debug');
result[0] = Math.abs(matrix[0]);
result[1] = Math.abs(matrix[1]);
result[2] = Math.abs(matrix[2]);
result[3] = Math.abs(matrix[3]);
return result;
};
/**
* Compares the provided matrices componentwise and returns
* <code>true</code> if they are equal, <code>false</code> otherwise.
*
* @param {Matrix2} [left] The first matrix.
* @param {Matrix2} [right] The second matrix.
* @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
*/
Matrix2.equals = function(left, right) {
return (left === right) ||
(defined(left) &&
defined(right) &&
left[0] === right[0] &&
left[1] === right[1] &&
left[2] === right[2] &&
left[3] === right[3]);
};
/**
* @private
*/
Matrix2.equalsArray = function(matrix, array, offset) {
return matrix[0] === array[offset] &&
matrix[1] === array[offset + 1] &&
matrix[2] === array[offset + 2] &&
matrix[3] === array[offset + 3];
};
/**
* Compares the provided matrices componentwise and returns
* <code>true</code> if they are within the provided epsilon,
* <code>false</code> otherwise.
*
* @param {Matrix2} [left] The first matrix.
* @param {Matrix2} [right] The second matrix.
* @param {Number} epsilon The epsilon to use for equality testing.
* @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
*/
Matrix2.equalsEpsilon = function(left, right, epsilon) {
//>>includeStart('debug', pragmas.debug);
if (typeof epsilon !== 'number') {
throw new DeveloperError('epsilon must be a number');
}
//>>includeEnd('debug');
return (left === right) ||
(defined(left) &&
defined(right) &&
Math.abs(left[0] - right[0]) <= epsilon &&
Math.abs(left[1] - right[1]) <= epsilon &&
Math.abs(left[2] - right[2]) <= epsilon &&
Math.abs(left[3] - right[3]) <= epsilon);
};
/**
* An immutable Matrix2 instance initialized to the identity matrix.
*
* @type {Matrix2}
* @constant
*/
Matrix2.IDENTITY = freezeObject(new Matrix2(1.0, 0.0,
0.0, 1.0));
/**
* An immutable Matrix2 instance initialized to the zero matrix.
*
* @type {Matrix2}
* @constant
*/
Matrix2.ZERO = freezeObject(new Matrix2(0.0, 0.0,
0.0, 0.0));
/**
* The index into Matrix2 for column 0, row 0.
*
* @type {Number}
* @constant
*
* @example
* var matrix = new Cesium.Matrix2();
* matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0
*/
Matrix2.COLUMN0ROW0 = 0;
/**
* The index into Matrix2 for column 0, row 1.
*
* @type {Number}
* @constant
*
* @example
* var matrix = new Cesium.Matrix2();
* matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0
*/
Matrix2.COLUMN0ROW1 = 1;
/**
* The index into Matrix2 for column 1, row 0.
*
* @type {Number}
* @constant
*
* @example
* var matrix = new Cesium.Matrix2();
* matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0
*/
Matrix2.COLUMN1ROW0 = 2;
/**
* The index into Matrix2 for column 1, row 1.
*
* @type {Number}
* @constant
*
* @example
* var matrix = new Cesium.Matrix2();
* matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0
*/
Matrix2.COLUMN1ROW1 = 3;
defineProperties(Matrix2.prototype, {
/**
* Gets the number of items in the collection.
* @memberof Matrix2.prototype
*
* @type {Number}
*/
length : {
get : function() {
return Matrix2.packedLength;
}
}
});
/**
* Duplicates the provided Matrix2 instance.
*
* @param {Matrix2} [result] The object onto which to store the result.
* @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.
*/
Matrix2.prototype.clone = function(result) {
return Matrix2.clone(this, result);
};
/**
* Compares this matrix to the provided matrix componentwise and returns
* <code>true</code> if they are equal, <code>false</code> otherwise.
*
* @param {Matrix2} [right] The right hand side matrix.
* @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
*/
Matrix2.prototype.equals = function(right) {
return Matrix2.equals(this, right);
};
/**
* Compares this matrix to the provided matrix componentwise and returns
* <code>true</code> if they are within the provided epsilon,
* <code>false</code> otherwise.
*
* @param {Matrix2} [right] The right hand side matrix.
* @param {Number} epsilon The epsilon to use for equality testing.
* @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
*/
Matrix2.prototype.equalsEpsilon = function(right, epsilon) {
return Matrix2.equalsEpsilon(this, right, epsilon);
};
/**
* Creates a string representing this Matrix with each row being
* on a separate line and in the format '(column0, column1)'.
*
* @returns {String} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.
*/
Matrix2.prototype.toString = function() {
return '(' + this[0] + ', ' + this[2] + ')\n' +
'(' + this[1] + ', ' + this[3] + ')';
};
return Matrix2;
});
|
define(
//begin v1.x content
{
"days-standAlone-short": [
"dom",
"seg",
"ter",
"qua",
"qui",
"sex",
"sรกb"
],
"field-weekday": "Dia da semana",
"field-wed-relative+0": "esta quarta-feira",
"field-wed-relative+1": "prรณxima quarta-feira",
"dateFormatItem-GyMMMEd": "E, d 'de' MMM 'de' y G",
"dateFormatItem-MMMEd": "E, d 'de' MMM",
"field-tue-relative+-1": "terรงa-feira passada",
"days-format-short": [
"dom",
"seg",
"ter",
"qua",
"qui",
"sex",
"sรกb"
],
"dateFormat-long": "d 'de' MMMM 'de' y G",
"field-fri-relative+-1": "sexta-feira passada",
"field-wed-relative+-1": "quarta-feira passada",
"dateFormatItem-yyyyQQQ": "QQQQ 'de' y G",
"dateTimeFormat-medium": "{1}, {0}",
"dayPeriods-format-wide-pm": "da tarde",
"dateFormat-full": "EEEE, d 'de' MMMM 'de' y G",
"dateFormatItem-yyyyMEd": "E, dd/MM/y GGGGG",
"field-thu-relative+-1": "quinta-feira passada",
"dateFormatItem-Md": "d/M",
"dayPeriods-format-abbr-am": "a.m.",
"dayPeriods-format-wide-noon": "meio-dia",
"field-era": "Era",
"quarters-format-wide": [
"1.ยบ trimestre",
"2.ยบ trimestre",
"3.ยบ trimestre",
"4.ยบ trimestre"
],
"field-year": "Ano",
"field-hour": "Hora",
"field-sat-relative+0": "este sรกbado",
"field-sat-relative+1": "prรณximo sรกbado",
"field-day-relative+0": "hoje",
"field-thu-relative+0": "esta quinta-feira",
"field-day-relative+1": "amanhรฃ",
"field-thu-relative+1": "prรณxima quinta-feira",
"dateFormatItem-GyMMMd": "d 'de' MMM 'de' y G",
"field-day-relative+2": "depois de amanhรฃ",
"quarters-format-abbr": [
"T1",
"T2",
"T3",
"T4"
],
"quarters-standAlone-wide": [
"1.ยบ trimestre",
"2.ยบ trimestre",
"3.ยบ trimestre",
"4.ยบ trimestre"
],
"dateFormatItem-Gy": "y G",
"dateFormatItem-yyyyMMMEd": "E, d/MM/y G",
"days-standAlone-wide": [
"domingo",
"segunda-feira",
"terรงa-feira",
"quarta-feira",
"quinta-feira",
"sexta-feira",
"sรกbado"
],
"dateFormatItem-yyyyMMM": "MM/y G",
"dateFormatItem-yyyyMMMd": "d/MM/y G",
"field-sun-relative+0": "este domingo",
"field-sun-relative+1": "prรณximo domingo",
"quarters-standAlone-abbr": [
"T1",
"T2",
"T3",
"T4"
],
"field-minute": "Minuto",
"field-dayperiod": "Da manhรฃ/da tarde",
"days-standAlone-abbr": [
"dom",
"seg",
"ter",
"qua",
"qui",
"sex",
"sรกb"
],
"field-day-relative+-1": "ontem",
"dateTimeFormat-long": "{1} 'ร s' {0}",
"dayPeriods-format-narrow-am": "a.m.",
"field-day-relative+-2": "anteontem",
"dateFormatItem-MMMd": "d 'de' MMM",
"dateFormatItem-MEd": "E, dd/MM",
"dateTimeFormat-full": "{1} 'ร s' {0}",
"field-fri-relative+0": "esta sexta-feira",
"field-fri-relative+1": "prรณxima sexta-feira",
"field-day": "Dia",
"days-format-wide": [
"domingo",
"segunda-feira",
"terรงa-feira",
"quarta-feira",
"quinta-feira",
"sexta-feira",
"sรกbado"
],
"field-zone": "Fuso horรกrio",
"dateFormatItem-y": "y G",
"field-year-relative+-1": "ano passado",
"field-month-relative+-1": "mรชs passado",
"dayPeriods-format-abbr-pm": "p.m.",
"days-format-abbr": [
"dom",
"seg",
"ter",
"qua",
"qui",
"sex",
"sรกb"
],
"days-format-narrow": [
"D",
"S",
"T",
"Q",
"Q",
"S",
"S"
],
"dateFormatItem-yyyyMd": "dd/MM/y GGGGG",
"field-month": "Mรชs",
"days-standAlone-narrow": [
"D",
"S",
"T",
"Q",
"Q",
"S",
"S"
],
"field-tue-relative+0": "esta terรงa-feira",
"field-tue-relative+1": "prรณxima terรงa-feira",
"dayPeriods-format-wide-am": "da manhรฃ",
"field-mon-relative+0": "esta segunda-feira",
"field-mon-relative+1": "prรณxima segunda-feira",
"dateFormat-short": "d/M/y G",
"field-second": "Segundo",
"field-sat-relative+-1": "sรกbado passado",
"field-sun-relative+-1": "domingo passado",
"field-month-relative+0": "este mรชs",
"field-month-relative+1": "prรณximo mรชs",
"dateFormatItem-Ed": "E, d",
"field-week": "Semana",
"dateFormat-medium": "d 'de' MMM, y G",
"field-year-relative+0": "este ano",
"field-week-relative+-1": "semana passada",
"dateFormatItem-yyyyM": "MM/y GGGGG",
"field-year-relative+1": "prรณximo ano",
"dayPeriods-format-narrow-pm": "p.m.",
"dateFormatItem-yyyyQQQQ": "QQQQ 'de' y G",
"dateTimeFormat-short": "{1}, {0}",
"dateFormatItem-GyMMM": "MMM 'de' y G",
"field-mon-relative+-1": "segunda-feira passada",
"dateFormatItem-yyyy": "y G",
"field-week-relative+0": "esta semana",
"field-week-relative+1": "prรณxima semana"
}
//end v1.x content
);
|
/**
* TouchableItem renders a touchable that looks native on both iOS and Android.
*
* It provides an abstraction on top of TouchableNativeFeedback and
* TouchableOpacity.
*
* On iOS you can pass the props of TouchableOpacity, on Android pass the props
* of TouchableNativeFeedback.
*/
import React, { Component, Children } from 'react';
import { Platform, TouchableNativeFeedback, TouchableOpacity, View } from 'react-native';
var babelPluginFlowReactPropTypes_proptype_Style = require('../TypeDefinition').babelPluginFlowReactPropTypes_proptype_Style || require('prop-types').any;
const ANDROID_VERSION_LOLLIPOP = 21;
export default class TouchableItem extends Component {
static defaultProps = {
pressColor: 'rgba(0, 0, 0, .32)'
};
render() {
/*
* TouchableNativeFeedback.Ripple causes a crash on old Android versions,
* therefore only enable it on Android Lollipop and above.
*
* All touchables on Android should have the ripple effect according to
* platform design guidelines.
* We need to pass the background prop to specify a borderless ripple effect.
*/
if (Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_LOLLIPOP) {
const { style, ...rest } = this.props; // eslint-disable-line no-unused-vars
return <TouchableNativeFeedback {...rest} style={null} background={TouchableNativeFeedback.Ripple(this.props.pressColor, this.props.borderless)}>
<View style={this.props.style}>
{Children.only(this.props.children)}
</View>
</TouchableNativeFeedback>;
}
return <TouchableOpacity {...this.props}>
{this.props.children}
</TouchableOpacity>;
}
}
TouchableItem.propTypes = {
onPress: require('prop-types').func.isRequired,
delayPressIn: require('prop-types').number,
borderless: require('prop-types').bool,
pressColor: require('prop-types').string,
activeOpacity: require('prop-types').number,
children: require('prop-types').any,
style: babelPluginFlowReactPropTypes_proptype_Style
};
|
'use strict';
var should = require('should'),
request = require('supertest'),
app = require('../../server'),
mongoose = require('mongoose'),
User = mongoose.model('User'),
Invoice = mongoose.model('Invoice'),
agent = request.agent(app);
/**
* Globals
*/
var credentials, user, invoice;
/**
* Invoice routes tests
*/
describe('Invoice CRUD tests', function() {
beforeEach(function(done) {
// Create user credentials
credentials = {
username: 'username',
password: 'password'
};
// Create a new user
user = new User({
firstName: 'Full',
lastName: 'Name',
displayName: 'Full Name',
email: 'test@test.com',
username: credentials.username,
password: credentials.password,
provider: 'local'
});
// Save a user to the test db and create new Invoice
user.save(function() {
invoice = {
name: 'Invoice Name'
};
done();
});
});
it('should be able to save Invoice instance if logged in', function(done) {
agent.post('/auth/signin')
.send(credentials)
.expect(200)
.end(function(signinErr, signinRes) {
// Handle signin error
if (signinErr) done(signinErr);
// Get the userId
var userId = user.id;
// Save a new Invoice
agent.post('/invoices')
.send(invoice)
.expect(200)
.end(function(invoiceSaveErr, invoiceSaveRes) {
// Handle Invoice save error
if (invoiceSaveErr) done(invoiceSaveErr);
// Get a list of Invoices
agent.get('/invoices')
.end(function(invoicesGetErr, invoicesGetRes) {
// Handle Invoice save error
if (invoicesGetErr) done(invoicesGetErr);
// Get Invoices list
var invoices = invoicesGetRes.body;
// Set assertions
(invoices[0].user._id).should.equal(userId);
(invoices[0].name).should.match('Invoice Name');
// Call the assertion callback
done();
});
});
});
});
it('should not be able to save Invoice instance if not logged in', function(done) {
agent.post('/invoices')
.send(invoice)
.expect(401)
.end(function(invoiceSaveErr, invoiceSaveRes) {
// Call the assertion callback
done(invoiceSaveErr);
});
});
it('should not be able to save Invoice instance if no name is provided', function(done) {
// Invalidate name field
invoice.name = '';
agent.post('/auth/signin')
.send(credentials)
.expect(200)
.end(function(signinErr, signinRes) {
// Handle signin error
if (signinErr) done(signinErr);
// Get the userId
var userId = user.id;
// Save a new Invoice
agent.post('/invoices')
.send(invoice)
.expect(400)
.end(function(invoiceSaveErr, invoiceSaveRes) {
// Set message assertion
(invoiceSaveRes.body.message).should.match('Please fill Invoice name');
// Handle Invoice save error
done(invoiceSaveErr);
});
});
});
it('should be able to update Invoice instance if signed in', function(done) {
agent.post('/auth/signin')
.send(credentials)
.expect(200)
.end(function(signinErr, signinRes) {
// Handle signin error
if (signinErr) done(signinErr);
// Get the userId
var userId = user.id;
// Save a new Invoice
agent.post('/invoices')
.send(invoice)
.expect(200)
.end(function(invoiceSaveErr, invoiceSaveRes) {
// Handle Invoice save error
if (invoiceSaveErr) done(invoiceSaveErr);
// Update Invoice name
invoice.name = 'WHY YOU GOTTA BE SO MEAN?';
// Update existing Invoice
agent.put('/invoices/' + invoiceSaveRes.body._id)
.send(invoice)
.expect(200)
.end(function(invoiceUpdateErr, invoiceUpdateRes) {
// Handle Invoice update error
if (invoiceUpdateErr) done(invoiceUpdateErr);
// Set assertions
(invoiceUpdateRes.body._id).should.equal(invoiceSaveRes.body._id);
(invoiceUpdateRes.body.name).should.match('WHY YOU GOTTA BE SO MEAN?');
// Call the assertion callback
done();
});
});
});
});
it('should be able to get a list of Invoices if not signed in', function(done) {
// Create new Invoice model instance
var invoiceObj = new Invoice(invoice);
// Save the Invoice
invoiceObj.save(function() {
// Request Invoices
request(app).get('/invoices')
.end(function(req, res) {
// Set assertion
res.body.should.be.an.Array.with.lengthOf(1);
// Call the assertion callback
done();
});
});
});
it('should be able to get a single Invoice if not signed in', function(done) {
// Create new Invoice model instance
var invoiceObj = new Invoice(invoice);
// Save the Invoice
invoiceObj.save(function() {
request(app).get('/invoices/' + invoiceObj._id)
.end(function(req, res) {
// Set assertion
res.body.should.be.an.Object.with.property('name', invoice.name);
// Call the assertion callback
done();
});
});
});
it('should be able to delete Invoice instance if signed in', function(done) {
agent.post('/auth/signin')
.send(credentials)
.expect(200)
.end(function(signinErr, signinRes) {
// Handle signin error
if (signinErr) done(signinErr);
// Get the userId
var userId = user.id;
// Save a new Invoice
agent.post('/invoices')
.send(invoice)
.expect(200)
.end(function(invoiceSaveErr, invoiceSaveRes) {
// Handle Invoice save error
if (invoiceSaveErr) done(invoiceSaveErr);
// Delete existing Invoice
agent.delete('/invoices/' + invoiceSaveRes.body._id)
.send(invoice)
.expect(200)
.end(function(invoiceDeleteErr, invoiceDeleteRes) {
// Handle Invoice error error
if (invoiceDeleteErr) done(invoiceDeleteErr);
// Set assertions
(invoiceDeleteRes.body._id).should.equal(invoiceSaveRes.body._id);
// Call the assertion callback
done();
});
});
});
});
it('should not be able to delete Invoice instance if not signed in', function(done) {
// Set Invoice user
invoice.user = user;
// Create new Invoice model instance
var invoiceObj = new Invoice(invoice);
// Save the Invoice
invoiceObj.save(function() {
// Try deleting Invoice
request(app).delete('/invoices/' + invoiceObj._id)
.expect(401)
.end(function(invoiceDeleteErr, invoiceDeleteRes) {
// Set message assertion
(invoiceDeleteRes.body.message).should.match('User is not logged in');
// Handle Invoice error error
done(invoiceDeleteErr);
});
});
});
afterEach(function(done) {
User.remove().exec();
Invoice.remove().exec();
done();
});
});
|
// This file has been autogenerated.
exports.setEnvironment = function() {
process.env['AZURE_BATCH_ACCOUNT'] = 'matthchreastus2';
process.env['AZURE_BATCH_ENDPOINT'] = 'https://matthchreastus2.eastus2.batch.azure.com';
process.env['AZURE_SUBSCRIPTION_ID'] = '2915bbd6-1252-405f-8173-6c00428146d9';
};
exports.scopes = [[function (nock) {
var result =
nock('http://matthchreastus2.eastus2.batch.azure.com:443')
.post('/certificates(thumbprintAlgorithm=sha1,thumbprint=cff2ab63c8c955aaf71989efa641b906558d9fb7)/canceldelete?api-version=2016-07-01.3.1')
.reply(409, "{\r\n \"odata.metadata\":\"https://matthchreastus2.eastus2.batch.azure.com/$metadata#Microsoft.Azure.Batch.Protocol.Entities.Container.errors/@Element\",\"code\":\"CertificateBeingDeleted\",\"message\":{\r\n \"lang\":\"en-US\",\"value\":\"The specified certificate has been marked for deletion and is being deleted.\\nRequestId:6c5cedea-a989-4a07-8807-0a721482a264\\nTime:2016-07-29T16:51:58.2373573Z\"\r\n }\r\n}", { 'content-length': '390',
'content-type': 'application/json;odata=minimalmetadata',
server: 'Microsoft-HTTPAPI/2.0',
'request-id': '6c5cedea-a989-4a07-8807-0a721482a264',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
dataserviceversion: '3.0',
date: 'Fri, 29 Jul 2016 16:51:57 GMT',
connection: 'close' });
return result; },
function (nock) {
var result =
nock('https://matthchreastus2.eastus2.batch.azure.com:443')
.post('/certificates(thumbprintAlgorithm=sha1,thumbprint=cff2ab63c8c955aaf71989efa641b906558d9fb7)/canceldelete?api-version=2016-07-01.3.1')
.reply(409, "{\r\n \"odata.metadata\":\"https://matthchreastus2.eastus2.batch.azure.com/$metadata#Microsoft.Azure.Batch.Protocol.Entities.Container.errors/@Element\",\"code\":\"CertificateBeingDeleted\",\"message\":{\r\n \"lang\":\"en-US\",\"value\":\"The specified certificate has been marked for deletion and is being deleted.\\nRequestId:6c5cedea-a989-4a07-8807-0a721482a264\\nTime:2016-07-29T16:51:58.2373573Z\"\r\n }\r\n}", { 'content-length': '390',
'content-type': 'application/json;odata=minimalmetadata',
server: 'Microsoft-HTTPAPI/2.0',
'request-id': '6c5cedea-a989-4a07-8807-0a721482a264',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
dataserviceversion: '3.0',
date: 'Fri, 29 Jul 2016 16:51:57 GMT',
connection: 'close' });
return result; }]];
|
(function () {
'use strict';
var post = document.querySelector('.post-content');
var progressBar = document.querySelector('.progress-bar');
if (post && progressBar) {
var lastScrollTop = 0;
var maxScrollTop = post.scrollHeight;
var completed = progressBar.querySelector('.completed');
var remaining = progressBar.querySelector('.remaining');
var timeCompleted = progressBar.querySelector('.time-completed');
var timeRemaining = progressBar.querySelector('.time-remaining');
document.addEventListener('scroll', function() {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
if (scrollTop > lastScrollTop) {
progressBar.style.bottom = '0%';
} else {
progressBar.style.bottom = '-100%';
}
if (scrollTop <= maxScrollTop) {
var percentage = scrollTop/maxScrollTop;
var completedVal = (percentage * 100).toFixed(2);
var remainingVal = 100 - parseFloat(completedVal);
completed.style.width = completedVal.toString() + '%';
remaining.style.width = remainingVal.toString() + '%';
var totalSeconds = parseInt(progressBar.getAttribute('data-minutes')) * 60;
var completedTime = parseInt(percentage * totalSeconds);
var completedMin = parseInt(completedTime/60);
var completedSec = parseInt((completedTime/60 - completedMin) * 60);
var remainingTime = totalSeconds - completedTime;
var remainingMin = parseInt(remainingTime/60);
var remainingSec = parseInt((remainingTime/60 - remainingMin) * 60);
completedMin = (completedMin < 10) ? '0' + completedMin : completedMin;
completedSec = (completedSec < 10) ? '0' + completedSec : completedSec;
remainingMin = (remainingMin < 10) ? '0' + remainingMin : remainingMin;
remainingSec = (remainingSec < 10) ? '0' + remainingSec : remainingSec;
timeCompleted.innerText = completedMin + ':' + completedSec;
timeRemaining.innerText = remainingMin + ':' + remainingSec;
} else {
completed.style.width = '100%';
remaining.style.width = '0%';
var minutes = parseInt(progressBar.getAttribute('data-minutes'));
minutes = (minutes < 10) ? '0' + minutes : minutes;
timeCompleted.innerText = '00:00';
timeRemaining.innerText = minutes + ':00';
}
lastScrollTop = scrollTop;
});
}
})();
|
/*! jQuery UI - v1.10.4 - 2014-04-13
* http://jqueryui.com
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"hide"),h="show"===l,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),h&&(n.css(d,0),n.css(p,a/2)),f[d]=h?a:0,f[p]=h?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);
|
var mongoose = require('mongoose'),
async = require('async'),
config = require('./config'),
mongoosastic = require('../lib/mongoosastic'),
Schema = mongoose.Schema;
var BookSchema = new Schema({
title: String
});
BookSchema.plugin(mongoosastic);
var Book = mongoose.model('Book', BookSchema);
describe('Synchronize', function() {
var books = null;
before(function(done) {
config.deleteIndexIfExists(['books'], function() {
mongoose.connect(config.mongoUrl, function() {
var client = mongoose.connections[0].db;
client.collection('books', function(err, _books) {
books = _books;
Book.remove(done);
});
});
});
});
after(function(done) {
Book.esClient.close();
mongoose.disconnect();
done();
});
describe('existing collection', function() {
before(function(done) {
async.forEach(config.bookTitlesArray(), function(title, cb) {
books.insert({title: title}, cb);
}, done);
});
it('should index all existing objects', function(done) {
var stream = Book.synchronize(),
count = 0;
stream.on('data', function(err, doc) {
count++;
});
stream.on('close', function() {
count.should.eql(53);
setTimeout(function() {
Book.search({query_string: {query: 'American'}}, function(err, results) {
results.hits.total.should.eql(2);
done();
});
}, config.indexingTimeout);
});
});
});
});
|
// Copyright 2013 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview Closure user agent detection (Browser).
* @see <a href="http://www.useragentstring.com/">User agent strings</a>
* For more information on rendering engine, platform, or device see the other
* sub-namespaces in goog.labs.userAgent, goog.labs.userAgent.platform,
* goog.labs.userAgent.device respectively.)
*
*/
goog.provide('goog.labs.userAgent.browser');
goog.require('goog.asserts');
goog.require('goog.labs.userAgent.util');
goog.require('goog.memoize');
goog.require('goog.string');
/**
* @return {boolean} Whether the user's browser is Opera.
* @private
*/
goog.labs.userAgent.browser.matchOpera_ = goog.memoize(
goog.partial(goog.labs.userAgent.util.matchUserAgent, 'Opera'));
/**
* @return {boolean} Whether the user's browser is IE.
* @private
*/
goog.labs.userAgent.browser.matchIE_ = goog.memoize(function() {
return goog.labs.userAgent.util.matchUserAgent('Trident') ||
goog.labs.userAgent.util.matchUserAgent('MSIE');
});
/**
* @return {boolean} Whether the user's browser is Firefox.
* @private
*/
goog.labs.userAgent.browser.matchFirefox_ = goog.memoize(function() {
return goog.labs.userAgent.util.matchUserAgent('Firefox');
});
/**
* @return {boolean} Whether the user's browser is Safari.
* @private
*/
goog.labs.userAgent.browser.matchSafari_ = goog.memoize(function() {
return goog.labs.userAgent.util.matchUserAgent('Safari') &&
!goog.labs.userAgent.util.matchUserAgent('Chrome') &&
!goog.labs.userAgent.util.matchUserAgent('CriOS') &&
!goog.labs.userAgent.util.matchUserAgent('Android');
});
/**
* @return {boolean} Whether the user's browser is Chrome.
* @private
*/
goog.labs.userAgent.browser.matchChrome_ = goog.memoize(function() {
return goog.labs.userAgent.util.matchUserAgent('Chrome') ||
goog.labs.userAgent.util.matchUserAgent('CriOS');
});
/**
* @return {boolean} Whether the user's browser is the Android browser.
* @private
*/
goog.labs.userAgent.browser.matchAndroidBrowser_ = goog.memoize(function() {
return goog.labs.userAgent.util.matchUserAgent('Android') &&
!goog.labs.userAgent.util.matchUserAgent('Chrome') &&
!goog.labs.userAgent.util.matchUserAgent('CriOS');
});
/**
* @return {boolean} Whether the user's browser is Opera.
*/
goog.labs.userAgent.browser.isOpera =
goog.memoize(goog.labs.userAgent.browser.matchOpera_);
/**
* @return {boolean} Whether the user's browser is IE.
*/
goog.labs.userAgent.browser.isIE =
goog.memoize(goog.labs.userAgent.browser.matchIE_);
/**
* @return {boolean} Whether the user's browser is Firefox.
*/
goog.labs.userAgent.browser.isFirefox =
goog.memoize(goog.labs.userAgent.browser.matchFirefox_);
/**
* @return {boolean} Whether the user's browser is Safari.
*/
goog.labs.userAgent.browser.isSafari =
goog.memoize(goog.labs.userAgent.browser.matchSafari_);
/**
* @return {boolean} Whether the user's browser is Chrome.
*/
goog.labs.userAgent.browser.isChrome =
goog.memoize(goog.labs.userAgent.browser.matchChrome_);
/**
* @return {boolean} Whether the user's browser is the Android browser.
*/
goog.labs.userAgent.browser.isAndroidBrowser =
goog.memoize(goog.labs.userAgent.browser.matchAndroidBrowser_);
/**
* @return {string} The browser version or empty string if version cannot be
* determined.
*/
goog.labs.userAgent.browser.getVersion = goog.memoize(function() {
var userAgentString = goog.labs.userAgent.util.getUserAgentString();
// Special case IE since IE's version is inside the parenthesis and without
// the '/'.
if (goog.labs.userAgent.browser.isIE()) {
return goog.labs.userAgent.browser.getIEVersion_();
}
var versionTuples =
goog.labs.userAgent.util.extractVersionTuples(userAgentString);
// tuples[2] (The first X/Y tuple after the parenthesis) contains the browser
// version number.
// TODO (vbhasin): Make this check more robust.
goog.asserts.assert(versionTuples.length > 2,
'Couldn\'t extract version tuple from user agent string');
return goog.isDef(versionTuples[2][1]) ? versionTuples[2][1] : '';
});
/**
* @param {string|number} version The version to check.
* @return {boolean} Whether the browser version is higher or the same as the
* given version.
*/
goog.labs.userAgent.browser.isVersionOrHigher = function(version) {
return goog.string.compareVersions(goog.labs.userAgent.browser.getVersion(),
version) >= 0;
};
/**
* Determines IE version. More information:
* http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx
*
* @return {string}
* @private
*/
goog.labs.userAgent.browser.getIEVersion_ = goog.memoize(function() {
var gDoc = goog.global['document'];
var version;
var userAgentString = goog.labs.userAgent.util.getUserAgentString();
if (gDoc && gDoc.documentMode) {
version = gDoc.documentMode;
} else if (gDoc && gDoc.compatMode && gDoc.compatMode == 'CSS1Compat') {
version = 7;
} else {
var arr = /\b(?:MSIE|rv)\s+([^\);]+)(?:\)|;)/.exec(userAgentString);
version = arr && arr[1] ? arr[1] : '';
}
return version;
});
|
'use strict';
/**
* Module dependencies.
*/
var InvalidArgumentError = require('../../lib/errors/invalid-argument-error');
var Promise = require('bluebird');
var Request = require('../../lib/request');
var Response = require('../../lib/response');
var Server = require('../../lib/server');
var should = require('should');
/**
* Test `Server` integration.
*/
describe('Server integration', function() {
describe('constructor()', function() {
it('should throw an error if `model` is missing', function() {
try {
new Server({});
should.fail();
} catch (e) {
e.should.be.an.instanceOf(InvalidArgumentError);
e.message.should.equal('Missing parameter: `model`');
}
});
it('should set the `model`', function() {
var model = {};
var server = new Server({ model: model });
server.options.model.should.equal(model);
});
});
describe('authenticate()', function() {
it('should set the default `options`', function() {
var model = {
getAccessToken: function() {
return {
user: {},
accessTokenExpiresAt: new Date(new Date().getTime() + 10000)
};
}
};
var server = new Server({ model: model });
var request = new Request({ body: {}, headers: { 'Authorization': 'Bearer foo' }, method: {}, query: {} });
var response = new Response({ body: {}, headers: {} });
return server.authenticate(request, response)
.then(function() {
this.addAcceptedScopesHeader.should.be.true;
this.addAuthorizedScopesHeader.should.be.true;
this.allowBearerTokensInQueryString.should.be.false;
})
.catch(should.fail);
});
it('should return a promise', function() {
var model = {
getAccessToken: function(token, callback) {
callback(null, {
user: {},
accessTokenExpiresAt: new Date(new Date().getTime() + 10000)
});
}
};
var server = new Server({ model: model });
var request = new Request({ body: {}, headers: { 'Authorization': 'Bearer foo' }, method: {}, query: {} });
var response = new Response({ body: {}, headers: {} });
var handler = server.authenticate(request, response);
handler.should.be.an.instanceOf(Promise);
});
it('should support callbacks', function(next) {
var model = {
getAccessToken: function() {
return {
user: {},
accessTokenExpiresAt: new Date(new Date().getTime() + 10000)
};
}
};
var server = new Server({ model: model });
var request = new Request({ body: {}, headers: { 'Authorization': 'Bearer foo' }, method: {}, query: {} });
var response = new Response({ body: {}, headers: {} });
server.authenticate(request, response, null, next);
});
});
describe('authorize()', function() {
it('should set the default `options`', function() {
var model = {
getAccessToken: function() {
return {
user: {},
accessTokenExpiresAt: new Date(new Date().getTime() + 10000)
};
},
getClient: function() {
return { grants: ['authorization_code'], redirectUris: ['http://example.com/cb'] };
},
saveAuthorizationCode: function() {
return { authorizationCode: 123 };
}
};
var server = new Server({ model: model });
var request = new Request({ body: { client_id: 1234, client_secret: 'secret', response_type: 'code' }, headers: { 'Authorization': 'Bearer foo' }, method: {}, query: { state: 'foobar' } });
var response = new Response({ body: {}, headers: {} });
return server.authorize(request, response)
.then(function() {
this.allowEmptyState.should.be.false;
this.authorizationCodeLifetime.should.equal(300);
})
.catch(should.fail);
});
it('should return a promise', function() {
var model = {
getAccessToken: function() {
return {
user: {},
accessTokenExpiresAt: new Date(new Date().getTime() + 10000)
};
},
getClient: function() {
return { grants: ['authorization_code'], redirectUris: ['http://example.com/cb'] };
},
saveAuthorizationCode: function() {
return { authorizationCode: 123 };
}
};
var server = new Server({ model: model });
var request = new Request({ body: { client_id: 1234, client_secret: 'secret', response_type: 'code' }, headers: { 'Authorization': 'Bearer foo' }, method: {}, query: { state: 'foobar' } });
var response = new Response({ body: {}, headers: {} });
var handler = server.authorize(request, response);
handler.should.be.an.instanceOf(Promise);
});
it('should support callbacks', function(next) {
var model = {
getAccessToken: function() {
return {
user: {},
accessTokenExpiresAt: new Date(new Date().getTime() + 10000)
};
},
getClient: function() {
return { grants: ['authorization_code'], redirectUris: ['http://example.com/cb'] };
},
saveAuthorizationCode: function() {
return { authorizationCode: 123 };
}
};
var server = new Server({ model: model });
var request = new Request({ body: { client_id: 1234, client_secret: 'secret', response_type: 'code' }, headers: { 'Authorization': 'Bearer foo' }, method: {}, query: { state: 'foobar' } });
var response = new Response({ body: {}, headers: {} });
server.authorize(request, response, null, next);
});
});
describe('token()', function() {
it('should set the default `options`', function() {
var model = {
getClient: function() {
return { grants: ['password'] };
},
getUser: function() {
return {};
},
saveToken: function() {
return { accessToken: 1234, client: {}, user: {} };
},
validateScope: function() { return 'foo'; }
};
var server = new Server({ model: model });
var request = new Request({ body: { client_id: 1234, client_secret: 'secret', grant_type: 'password', username: 'foo', password: 'pass', scope: 'foo' }, headers: { 'content-type': 'application/x-www-form-urlencoded', 'transfer-encoding': 'chunked' }, method: 'POST', query: {} });
var response = new Response({ body: {}, headers: {} });
return server.token(request, response)
.then(function() {
this.accessTokenLifetime.should.equal(3600);
this.refreshTokenLifetime.should.equal(1209600);
})
.catch(should.fail);
});
it('should return a promise', function() {
var model = {
getClient: function() {
return { grants: ['password'] };
},
getUser: function() {
return {};
},
saveToken: function() {
return { accessToken: 1234, client: {}, user: {} };
}
};
var server = new Server({ model: model });
var request = new Request({ body: { client_id: 1234, client_secret: 'secret', grant_type: 'password', username: 'foo', password: 'pass' }, headers: { 'content-type': 'application/x-www-form-urlencoded', 'transfer-encoding': 'chunked' }, method: 'POST', query: {} });
var response = new Response({ body: {}, headers: {} });
var handler = server.token(request, response);
handler.should.be.an.instanceOf(Promise);
});
it('should support callbacks', function(next) {
var model = {
getClient: function() {
return { grants: ['password'] };
},
getUser: function() {
return {};
},
saveToken: function() {
return { accessToken: 1234, client: {}, user: {} };
},
validateScope: function() {
return 'foo';
}
};
var server = new Server({ model: model });
var request = new Request({ body: { client_id: 1234, client_secret: 'secret', grant_type: 'password', username: 'foo', password: 'pass', scope: 'foo' }, headers: { 'content-type': 'application/x-www-form-urlencoded', 'transfer-encoding': 'chunked' }, method: 'POST', query: {} });
var response = new Response({ body: {}, headers: {} });
server.token(request, response, null, next);
});
});
});
|
/**
* jQuery EasyUI 1.5.2
*
* Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved.
*
* Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
* To use it on other terms please contact us: info@jeasyui.com
*
*/
(function($){
function _1(_2){
var _3=$.data(_2,"pagination");
var _4=_3.options;
var bb=_3.bb={};
var _5=$(_2).addClass("pagination").html("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr></tr></table>");
var tr=_5.find("tr");
var aa=$.extend([],_4.layout);
if(!_4.showPageList){
_6(aa,"list");
}
if(!_4.showPageInfo){
_6(aa,"info");
}
if(!_4.showRefresh){
_6(aa,"refresh");
}
if(aa[0]=="sep"){
aa.shift();
}
if(aa[aa.length-1]=="sep"){
aa.pop();
}
for(var _7=0;_7<aa.length;_7++){
var _8=aa[_7];
if(_8=="list"){
var ps=$("<select class=\"pagination-page-list\"></select>");
ps.bind("change",function(){
_4.pageSize=parseInt($(this).val());
_4.onChangePageSize.call(_2,_4.pageSize);
_10(_2,_4.pageNumber);
});
for(var i=0;i<_4.pageList.length;i++){
$("<option></option>").text(_4.pageList[i]).appendTo(ps);
}
$("<td></td>").append(ps).appendTo(tr);
}else{
if(_8=="sep"){
$("<td><div class=\"pagination-btn-separator\"></div></td>").appendTo(tr);
}else{
if(_8=="first"){
bb.first=_9("first");
}else{
if(_8=="prev"){
bb.prev=_9("prev");
}else{
if(_8=="next"){
bb.next=_9("next");
}else{
if(_8=="last"){
bb.last=_9("last");
}else{
if(_8=="manual"){
$("<span style=\"padding-left:6px;\"></span>").html(_4.beforePageText).appendTo(tr).wrap("<td></td>");
bb.num=$("<input class=\"pagination-num\" type=\"text\" value=\"1\" size=\"2\">").appendTo(tr).wrap("<td></td>");
bb.num.unbind(".pagination").bind("keydown.pagination",function(e){
if(e.keyCode==13){
var _a=parseInt($(this).val())||1;
_10(_2,_a);
return false;
}
});
bb.after=$("<span style=\"padding-right:6px;\"></span>").appendTo(tr).wrap("<td></td>");
}else{
if(_8=="refresh"){
bb.refresh=_9("refresh");
}else{
if(_8=="links"){
$("<td class=\"pagination-links\"></td>").appendTo(tr);
}else{
if(_8=="info"){
if(_7==aa.length-1){
$("<div class=\"pagination-info\"></div>").appendTo(_5);
$("<div style=\"clear:both;\"></div>").appendTo(_5);
}else{
$("<td><div class=\"pagination-info\"></div></td>").appendTo(tr);
}
}
}
}
}
}
}
}
}
}
}
}
if(_4.buttons){
$("<td><div class=\"pagination-btn-separator\"></div></td>").appendTo(tr);
if($.isArray(_4.buttons)){
for(var i=0;i<_4.buttons.length;i++){
var _b=_4.buttons[i];
if(_b=="-"){
$("<td><div class=\"pagination-btn-separator\"></div></td>").appendTo(tr);
}else{
var td=$("<td></td>").appendTo(tr);
var a=$("<a href=\"javascript:;\"></a>").appendTo(td);
a[0].onclick=eval(_b.handler||function(){
});
a.linkbutton($.extend({},_b,{plain:true}));
}
}
}else{
var td=$("<td></td>").appendTo(tr);
$(_4.buttons).appendTo(td).show();
}
}
function _9(_c){
var _d=_4.nav[_c];
var a=$("<a href=\"javascript:;\"></a>").appendTo(tr);
a.wrap("<td></td>");
a.linkbutton({iconCls:_d.iconCls,plain:true}).unbind(".pagination").bind("click.pagination",function(){
_d.handler.call(_2);
});
return a;
};
function _6(aa,_e){
var _f=$.inArray(_e,aa);
if(_f>=0){
aa.splice(_f,1);
}
return aa;
};
};
function _10(_11,_12){
var _13=$.data(_11,"pagination").options;
_14(_11,{pageNumber:_12});
_13.onSelectPage.call(_11,_13.pageNumber,_13.pageSize);
};
function _14(_15,_16){
var _17=$.data(_15,"pagination");
var _18=_17.options;
var bb=_17.bb;
$.extend(_18,_16||{});
var ps=$(_15).find("select.pagination-page-list");
if(ps.length){
ps.val(_18.pageSize+"");
_18.pageSize=parseInt(ps.val());
}
var _19=Math.ceil(_18.total/_18.pageSize)||1;
if(_18.pageNumber<1){
_18.pageNumber=1;
}
if(_18.pageNumber>_19){
_18.pageNumber=_19;
}
if(_18.total==0){
_18.pageNumber=0;
_19=0;
}
if(bb.num){
bb.num.val(_18.pageNumber);
}
if(bb.after){
bb.after.html(_18.afterPageText.replace(/{pages}/,_19));
}
var td=$(_15).find("td.pagination-links");
if(td.length){
td.empty();
var _1a=_18.pageNumber-Math.floor(_18.links/2);
if(_1a<1){
_1a=1;
}
var _1b=_1a+_18.links-1;
if(_1b>_19){
_1b=_19;
}
_1a=_1b-_18.links+1;
if(_1a<1){
_1a=1;
}
for(var i=_1a;i<=_1b;i++){
var a=$("<a class=\"pagination-link\" href=\"javascript:;\"></a>").appendTo(td);
a.linkbutton({plain:true,text:i});
if(i==_18.pageNumber){
a.linkbutton("select");
}else{
a.unbind(".pagination").bind("click.pagination",{pageNumber:i},function(e){
_10(_15,e.data.pageNumber);
});
}
}
}
var _1c=_18.displayMsg;
_1c=_1c.replace(/{from}/,_18.total==0?0:_18.pageSize*(_18.pageNumber-1)+1);
_1c=_1c.replace(/{to}/,Math.min(_18.pageSize*(_18.pageNumber),_18.total));
_1c=_1c.replace(/{total}/,_18.total);
$(_15).find("div.pagination-info").html(_1c);
if(bb.first){
bb.first.linkbutton({disabled:((!_18.total)||_18.pageNumber==1)});
}
if(bb.prev){
bb.prev.linkbutton({disabled:((!_18.total)||_18.pageNumber==1)});
}
if(bb.next){
bb.next.linkbutton({disabled:(_18.pageNumber==_19)});
}
if(bb.last){
bb.last.linkbutton({disabled:(_18.pageNumber==_19)});
}
_1d(_15,_18.loading);
};
function _1d(_1e,_1f){
var _20=$.data(_1e,"pagination");
var _21=_20.options;
_21.loading=_1f;
if(_21.showRefresh&&_20.bb.refresh){
_20.bb.refresh.linkbutton({iconCls:(_21.loading?"pagination-loading":"pagination-load")});
}
};
$.fn.pagination=function(_22,_23){
if(typeof _22=="string"){
return $.fn.pagination.methods[_22](this,_23);
}
_22=_22||{};
return this.each(function(){
var _24;
var _25=$.data(this,"pagination");
if(_25){
_24=$.extend(_25.options,_22);
}else{
_24=$.extend({},$.fn.pagination.defaults,$.fn.pagination.parseOptions(this),_22);
$.data(this,"pagination",{options:_24});
}
_1(this);
_14(this);
});
};
$.fn.pagination.methods={options:function(jq){
return $.data(jq[0],"pagination").options;
},loading:function(jq){
return jq.each(function(){
_1d(this,true);
});
},loaded:function(jq){
return jq.each(function(){
_1d(this,false);
});
},refresh:function(jq,_26){
return jq.each(function(){
_14(this,_26);
});
},select:function(jq,_27){
return jq.each(function(){
_10(this,_27);
});
}};
$.fn.pagination.parseOptions=function(_28){
var t=$(_28);
return $.extend({},$.parser.parseOptions(_28,[{total:"number",pageSize:"number",pageNumber:"number",links:"number"},{loading:"boolean",showPageList:"boolean",showPageInfo:"boolean",showRefresh:"boolean"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined)});
};
$.fn.pagination.defaults={total:1,pageSize:10,pageNumber:1,pageList:[10,20,30,50],loading:false,buttons:null,showPageList:true,showPageInfo:true,showRefresh:true,links:10,layout:["list","sep","first","prev","sep","manual","sep","next","last","sep","refresh","info"],onSelectPage:function(_29,_2a){
},onBeforeRefresh:function(_2b,_2c){
},onRefresh:function(_2d,_2e){
},onChangePageSize:function(_2f){
},beforePageText:"Page",afterPageText:"of {pages}",displayMsg:"Displaying {from} to {to} of {total} items",nav:{first:{iconCls:"pagination-first",handler:function(){
var _30=$(this).pagination("options");
if(_30.pageNumber>1){
$(this).pagination("select",1);
}
}},prev:{iconCls:"pagination-prev",handler:function(){
var _31=$(this).pagination("options");
if(_31.pageNumber>1){
$(this).pagination("select",_31.pageNumber-1);
}
}},next:{iconCls:"pagination-next",handler:function(){
var _32=$(this).pagination("options");
var _33=Math.ceil(_32.total/_32.pageSize);
if(_32.pageNumber<_33){
$(this).pagination("select",_32.pageNumber+1);
}
}},last:{iconCls:"pagination-last",handler:function(){
var _34=$(this).pagination("options");
var _35=Math.ceil(_34.total/_34.pageSize);
if(_34.pageNumber<_35){
$(this).pagination("select",_35);
}
}},refresh:{iconCls:"pagination-refresh",handler:function(){
var _36=$(this).pagination("options");
if(_36.onBeforeRefresh.call(this,_36.pageNumber,_36.pageSize)!=false){
$(this).pagination("select",_36.pageNumber);
_36.onRefresh.call(this,_36.pageNumber,_36.pageSize);
}
}}}};
})(jQuery);
|
/*global define*/
define([
'Core/defineProperties',
'DataSources/ConstantProperty'
], function(
defineProperties,
ConstantProperty) {
'use strict';
return function(value) {
var property = new ConstantProperty(value);
defineProperties(property, {
isConstant : {
value : false
}
});
return property;
};
});
|
// This file was automatically generated. Do not modify.
'use strict';
goog.provide('Blockly.Msg.hrx');
goog.require('Blockly.Msg');
Blockly.Msg.ADD_COMMENT = "Kommentar hinzufรผche";
Blockly.Msg.CHANGE_VALUE_TITLE = "Neie Variable...";
Blockly.Msg.CLEAN_UP = "Clean up Blocks"; // untranslated
Blockly.Msg.COLLAPSE_ALL = "Blocke zusammerfalte";
Blockly.Msg.COLLAPSE_BLOCK = "Block zusammerfalte";
Blockly.Msg.COLOUR_BLEND_COLOUR1 = "Farreb 1";
Blockly.Msg.COLOUR_BLEND_COLOUR2 = "mit Farreb 2";
Blockly.Msg.COLOUR_BLEND_HELPURL = "http://meyerweb.com/eric/tools/color-blend/"; // untranslated
Blockly.Msg.COLOUR_BLEND_RATIO = "im Verhรคltniss";
Blockly.Msg.COLOUR_BLEND_TITLE = "misch";
Blockly.Msg.COLOUR_BLEND_TOOLTIP = "Vermischt 2 Farwe mit konfigurierbare Farrebverhรคltniss (0.0 - 1.0).";
Blockly.Msg.COLOUR_PICKER_HELPURL = "https://hrx.wikipedia.org/wiki/Farreb";
Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Wรคhl en Farreb von der Palett.";
Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com"; // untranslated
Blockly.Msg.COLOUR_RANDOM_TITLE = "zufรคlliche Farwe";
Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Wรคhl en Farreb noh dem Zufallsprinzip.";
Blockly.Msg.COLOUR_RGB_BLUE = "blau";
Blockly.Msg.COLOUR_RGB_GREEN = "grรผn";
Blockly.Msg.COLOUR_RGB_HELPURL = "http://www.december.com/html/spec/colorper.html"; // untranslated
Blockly.Msg.COLOUR_RGB_RED = "rot";
Blockly.Msg.COLOUR_RGB_TITLE = "Fรคrreb mit";
Blockly.Msg.COLOUR_RGB_TOOLTIP = "Kreiere ene Farreb mit sellrbst definierte rot, grรผn und blau Wearte. All Wearte mรผsse zwischich 0 und 100 liehe.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "ausbreche aus der Schleif";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "mit der nรคchste Iteration fortfoohre aus der Schleifa";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "Die umgebne Schleif beenne.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "Die Oonweisung abbreche und mit der nรคchste Schleifiteration fortfoohre.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Warnung: Die block sollt nuar in en Schleif verwennet sin.";
Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
Blockly.Msg.CONTROLS_FOREACH_TITLE = "Fรผr Weart %1 aus der List %2";
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "Fรผahr en Oonweisung fรผr jede Weart in der List aus und setzt dabei die Variable \"%1\" uff den aktuelle List Weart.";
Blockly.Msg.CONTROLS_FOR_HELPURL = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
Blockly.Msg.CONTROLS_FOR_TITLE = "Zรคhl %1 von %2 bis %3 mit %4";
Blockly.Msg.CONTROLS_FOR_TOOLTIP = "Zรคhl die Variable \"%1\" von enem Startweart bis zu enem Zielweart und fรผahrefรผr jede Weart en Oonweisung aus.";
Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "En weitre Bedingung hinzufรผche.";
Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "En orrer Bedingung hinzufรผche, fรผahrt en Oonweisung aus falls ken Bedingung zutrifft.";
Blockly.Msg.CONTROLS_IF_HELPURL = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
Blockly.Msg.CONTROLS_IF_IF_TOOLTIP = "Hinzufรผche, entferne orrer sortiere von Sektione";
Blockly.Msg.CONTROLS_IF_MSG_ELSE = "orrer";
Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "orrer wenn";
Blockly.Msg.CONTROLS_IF_MSG_IF = "wenn";
Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "Wenn en Bedingung woahr (true) ist, dann fรผahr en Oonweisung aus.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "Wenn en Bedingung woahr (true) ist, dann fรผahr die earscht Oonweisung aus. Ansonscht fรผahr die zwooite Oonweisung aus.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "Wenn der erschte Bedingung woahr (true) ist, dann fรผahr die erschte Oonweisung aus. Orrer wenn die zwooite Bedingung woahr (true) ist, dann fรผahr die zwooite Oonweisung aus.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "Wenn der erscht Bedingung woahr (true) ist, dann fรผahr die erschte Oonweisung aus. Orrer wenn die zwooite Bedingung woahr (true) ist, dann fรผahr die zwooite Oonweisung aus. Falls ken der beide Bedingungen woahr (true) ist, dann fรผahr die dritte Oonweisung aus.";
Blockly.Msg.CONTROLS_REPEAT_HELPURL = "https://hrx.wikipedia.org/wiki/For-Schleif";
Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "mach";
Blockly.Msg.CONTROLS_REPEAT_TITLE = "wiederhol %1 mol";
Blockly.Msg.CONTROLS_REPEAT_TOOLTIP = "En Oonweisung meahrfach ausfรผhre.";
Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "Repetiere bis";
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "Repetier solang";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "Fรผahr die Oonweisung solang aus wie die Bedingung falsch (false) ist.";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "Fรผahr die Oonweisung solang aus wie die Bedingung woahr (true) ist.";
Blockly.Msg.DELETE_ALL_BLOCKS = "All %1 Bausten lรถsche?";
Blockly.Msg.DELETE_BLOCK = "Block lรถsche";
Blockly.Msg.DELETE_VARIABLE = "Delete the '%1' variable"; // untranslated
Blockly.Msg.DELETE_VARIABLE_CONFIRMATION = "Delete %1 uses of the '%2' variable?"; // untranslated
Blockly.Msg.DELETE_X_BLOCKS = "Block %1 lรถsche";
Blockly.Msg.DISABLE_BLOCK = "Block deaktivieren";
Blockly.Msg.DUPLICATE_BLOCK = "Kopieren";
Blockly.Msg.ENABLE_BLOCK = "Block aktivieren";
Blockly.Msg.EXPAND_ALL = "Blocke expandiere";
Blockly.Msg.EXPAND_BLOCK = "Block entfalte";
Blockly.Msg.EXTERNAL_INPUTS = "External Inputsexterne Ingรคnge";
Blockly.Msg.HELP = "Hellef";
Blockly.Msg.INLINE_INPUTS = "interne Ingรคnge";
Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "Generier/erzeich en leear List";
Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "Generier/erzeich en leear List ohne Inhalt.";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "List";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Hinzufรผche, entferne und sortiere von Elemente.";
Blockly.Msg.LISTS_CREATE_WITH_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "Erzeich List mit";
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "En Element zur List hinzufรผche.";
Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "Generier/erzeich en List mit konfigurierte Elemente.";
Blockly.Msg.LISTS_GET_INDEX_FIRST = "earste";
Blockly.Msg.LISTS_GET_INDEX_FROM_END = "#te von hinne";
Blockly.Msg.LISTS_GET_INDEX_FROM_START = "#"; // untranslated
Blockly.Msg.LISTS_GET_INDEX_GET = "Nehm";
Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "Nehm und entfern";
Blockly.Msg.LISTS_GET_INDEX_LAST = "letzte";
Blockly.Msg.LISTS_GET_INDEX_RANDOM = "zufรคlliches";
Blockly.Msg.LISTS_GET_INDEX_REMOVE = "Entfern";
Blockly.Msg.LISTS_GET_INDEX_TAIL = ""; // untranslated
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST = "Extrahiert das earste Element von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM = "Extrahiert das Element zu en definierte Stell von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST = "Extrahiert das letzte Element von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM = "Extrahiert en zufรคlliches Element von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "Extrahiert und entfernt das earste Element von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM = "Extrahiert und entfernt das Element zu en definierte Stell von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "Extrahiert und entfernt das letzte Element von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "Extrahiert und entfernt en zufรคlliches Element von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "Entfernt das earste Element von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM = "Entfernt das Element zu en definierte Stell von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST = "Entfernt das letzte Element von der List.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM = "Entfernt en zufรคlliches Element von der List.";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END = "zu # vom End";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START = "zu #";
Blockly.Msg.LISTS_GET_SUBLIST_END_LAST = "zum Letzte";
Blockly.Msg.LISTS_GET_SUBLIST_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST = "hol Unnerliste vom Earste";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "hol Unnerliste von # vom End";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "hol Unnerlist von #";
Blockly.Msg.LISTS_GET_SUBLIST_TAIL = ""; // untranslated
Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "Generiert en Kopie von en definierte Tel von en List.";
Blockly.Msg.LISTS_INDEX_FROM_END_TOOLTIP = "%1 ist das letzte Element.";
Blockly.Msg.LISTS_INDEX_FROM_START_TOOLTIP = "%1 ist das earschte Element.";
Blockly.Msg.LISTS_INDEX_OF_FIRST = "Such earstes Voarkommniss";
Blockly.Msg.LISTS_INDEX_OF_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
Blockly.Msg.LISTS_INDEX_OF_LAST = "Such letztes Voarkommniss";
Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "Sucht die Position (index) von en Element in der List Gebt %1 zurรผck wenn nixs gefunn woard.";
Blockly.Msg.LISTS_INLIST = "in der List";
Blockly.Msg.LISTS_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
Blockly.Msg.LISTS_ISEMPTY_TITLE = "%1 ist leear?";
Blockly.Msg.LISTS_ISEMPTY_TOOLTIP = "Ist woahr (true), wenn die List leear ist.";
Blockly.Msg.LISTS_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
Blockly.Msg.LISTS_LENGTH_TITLE = "lรคnge %1";
Blockly.Msg.LISTS_LENGTH_TOOLTIP = "Die Oonzoohl von Elemente in der List.";
Blockly.Msg.LISTS_REPEAT_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
Blockly.Msg.LISTS_REPEAT_TITLE = "Erzich List mit Element %1 wiederhol das %2 mol";
Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Erzeicht en List mit en variable Oonzoohl von Elemente";
Blockly.Msg.LISTS_REVERSE_HELPURL = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
Blockly.Msg.LISTS_REVERSE_MESSAGE0 = "reverse %1"; // untranslated
Blockly.Msg.LISTS_REVERSE_TOOLTIP = "Reverse a copy of a list."; // untranslated
Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "uff";
Blockly.Msg.LISTS_SET_INDEX_INSERT = "tue ren setz an";
Blockly.Msg.LISTS_SET_INDEX_SET = "setz";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "Tut das Element an en Oonfang von en List ren setze.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM = "Tut das Element ren setze an en definierte Stell an en List.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "Oonhรคngt das Element zu en List sei End.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "Tut das Element zufรคllich an en List ren setze.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "Sets the first item in a list.Setzt das earschte Element an en list.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM = "Setzt das Element zu en definierte Stell in en List.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Setzt das letzte Element an en List.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Setzt en zufรคlliches Element an en List.";
Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated
Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "ascending"; // untranslated
Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "descending"; // untranslated
Blockly.Msg.LISTS_SORT_TITLE = "sort %1 %2 %3"; // untranslated
Blockly.Msg.LISTS_SORT_TOOLTIP = "Sort a copy of a list."; // untranslated
Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetic, ignore case"; // untranslated
Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numeric"; // untranslated
Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetic"; // untranslated
Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated
Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated
Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN = "Join a list of texts into one text, separated by a delimiter."; // untranslated
Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT = "Split text into a list of texts, breaking at each delimiter."; // untranslated
Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER = "with delimiter"; // untranslated
Blockly.Msg.LOGIC_BOOLEAN_FALSE = "falsch";
Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "Ist entweder woahr (true) orrer falsch (false)";
Blockly.Msg.LOGIC_BOOLEAN_TRUE = "woahr";
Blockly.Msg.LOGIC_COMPARE_HELPURL = "https://hrx.wikipedia.org/wiki/Vergleich_%28Zahlen%29";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ = "Ist woahr (true) wenn beide Wearte identisch sind.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT = "Ist woahr (true) wenn der erschte Weart grรถsser als der zwooite Weart ist.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "Ist woahr (true) wenn der erschte Weart grรถsser als orrer gleich gross wie zwooite Weart ist.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "Ist woahr (true) wenn der earschte Weart klener als der zwooite Weart ist.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "Ist woahr (true) wenn der earscht Weart klener als orrer gleich gross wie zwooite Weart ist.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "Ist woahr (true) wenn beide Wearte unnerschiedlich sind.";
Blockly.Msg.LOGIC_NEGATE_HELPURL = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
Blockly.Msg.LOGIC_NEGATE_TITLE = "net %1";
Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "Ist woahr (true) wenn der Ingรคweweart falsch (false) ist. Ist falsch (false) wenn der Ingรคweweart woahr (true) ist.";
Blockly.Msg.LOGIC_NULL = "null";
Blockly.Msg.LOGIC_NULL_HELPURL = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
Blockly.Msg.LOGIC_NULL_TOOLTIP = "Is NULL.";
Blockly.Msg.LOGIC_OPERATION_AND = "und";
Blockly.Msg.LOGIC_OPERATION_HELPURL = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
Blockly.Msg.LOGIC_OPERATION_OR = "orrer";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = "Ist woahr (true) wenn beide Wearte woahr (true) sind.";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = "Ist woahr (true) wenn en von der beide Wearte woahr (true) ist.";
Blockly.Msg.LOGIC_TERNARY_CONDITION = "test";
Blockly.Msg.LOGIC_TERNARY_HELPURL = "https://en.wikipedia.org/wiki/%3F:"; // untranslated
Blockly.Msg.LOGIC_TERNARY_IF_FALSE = "wenn falsch";
Blockly.Msg.LOGIC_TERNARY_IF_TRUE = "wenn woahr";
Blockly.Msg.LOGIC_TERNARY_TOOLTIP = "รwerprรผft en Bedingung \"test\". Wenn die Bedingung woahr ist weerd der \"wenn woahr\" Weart zurรผckgeb, annerfalls der \"wenn falsch\" Weart";
Blockly.Msg.MATH_ADDITION_SYMBOL = "+"; // untranslated
Blockly.Msg.MATH_ARITHMETIC_HELPURL = "https://hrx.wikipedia.org/wiki/Grundrechenoort";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD = "Ist die Summe zwooier Wearte.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE = "Ist der Quotient zwooier Wearte.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "Ist die Differenz zwooier Wearte.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "Ist das Produkt zwooier Wearte.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "Ist der earschte Weart potenziert mit dem zoiten Weart.";
Blockly.Msg.MATH_CHANGE_HELPURL = "https://hrx.wikipedia.org/wiki/Inkrement_und_Dekrement";
Blockly.Msg.MATH_CHANGE_TITLE = "mach hรถcher / erhรถhe %1 um %2";
Blockly.Msg.MATH_CHANGE_TOOLTIP = "Addiert en Weart zur Variable \"%1\" hinzu.";
Blockly.Msg.MATH_CONSTANT_HELPURL = "https://hrx.wikipedia.org/wiki/Mathematische_Konstante";
Blockly.Msg.MATH_CONSTANT_TOOLTIP = "Mathematische Konstante wie: ฯ (3.141โฆ), e (2.718โฆ), ฯ (1.618โฆ), sqrt(2) (1.414โฆ), sqrt(ยฝ) (0.707โฆ) oder โ (unendlich).";
Blockly.Msg.MATH_CONSTRAIN_HELPURL = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated
Blockly.Msg.MATH_CONSTRAIN_TITLE = "begrenze %1 von %2 bis %3";
Blockly.Msg.MATH_CONSTRAIN_TOOLTIP = "Begrenzt den Weartebereich mittels von / bis Wearte. (inklusiv)";
Blockly.Msg.MATH_DIVISION_SYMBOL = "รท"; // untranslated
Blockly.Msg.MATH_IS_DIVISIBLE_BY = "ist telbar/kann getelt sin doorrich";
Blockly.Msg.MATH_IS_EVEN = "ist grood";
Blockly.Msg.MATH_IS_NEGATIVE = "ist negativ";
Blockly.Msg.MATH_IS_ODD = "ist ungrood";
Blockly.Msg.MATH_IS_POSITIVE = "ist positiv";
Blockly.Msg.MATH_IS_PRIME = "ist en Primenzoohl";
Blockly.Msg.MATH_IS_TOOLTIP = "รwerprรผft ob en Zoohl grood, ungrood, en Primenzoohl, ganzzoohlich, positiv, negativ orrer doorrich en zwooite Zoohl telbar ist. Gebt woahr (true) orrer falsch (false) zurรผck.";
Blockly.Msg.MATH_IS_WHOLE = "ganze Zoohl";
Blockly.Msg.MATH_MODULO_HELPURL = "https://hrx.wikipedia.org/wiki/Modulo";
Blockly.Msg.MATH_MODULO_TITLE = "Rest von %1 รท %2";
Blockly.Msg.MATH_MODULO_TOOLTIP = "Der Rest noh en Division.";
Blockly.Msg.MATH_MULTIPLICATION_SYMBOL = "ร"; // untranslated
Blockly.Msg.MATH_NUMBER_HELPURL = "https://hrx.wikipedia.org/wiki/Zoohl";
Blockly.Msg.MATH_NUMBER_TOOLTIP = "En Zoohl.";
Blockly.Msg.MATH_ONLIST_HELPURL = ""; // untranslated
Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE = "Mittelweart en List";
Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "Maximalweart en List";
Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "Median von en List";
Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "Minimalweart von en List";
Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "Restweart von en List";
Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "Zufallsweart von en List";
Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "Standart/Padrong Abweichung von en List";
Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "Summe von en List";
Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "Ist der Doorrichschnittsweart von aller Wearte in en List.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "Ist der grรถsste Weart in en List.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "Ist der Zentralweart von aller Wearte in en List.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "Ist der klenste Weart in en List.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "Findt den am hรคifichste voarkommend Weart in en List. Falls ken Weart รถftersch voarkomme als all annre, weard die originale List zurรผckgeche";
Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "Geb en Zufallsweart aus der List zurรผck.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "Ist die standartiesierte/padronisierte Standartabweichung/Padrongabweichung von aller Wearte in der List";
Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "Ist die Summ aller Wearte in en List.";
Blockly.Msg.MATH_POWER_SYMBOL = "^"; // untranslated
Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "https://hex.wikipedia.org/wiki/Zufallszoohle";
Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "Zufallszoohl (0.0 -1.0)";
Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "Generier/erzeich en Zufallszoohl zwischich 0.0 (inklusiv) und 1.0 (exklusiv).";
Blockly.Msg.MATH_RANDOM_INT_HELPURL = "https://hrx.wikipedia.org/wiki/Zufallszahlen";
Blockly.Msg.MATH_RANDOM_INT_TITLE = "ganzoohlicher Zufallswearte zwischich %1 bis %2";
Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "Generier/erzeich en ganzรคhliche Zufallsweart zwischich zwooi Wearte (inklusiv).";
Blockly.Msg.MATH_ROUND_HELPURL = "https://hrx.wikipedia.org/wiki/Runden";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "runde";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "ab runde";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP = "uff runde";
Blockly.Msg.MATH_ROUND_TOOLTIP = "En Zoohl uff orrer ab runde.";
Blockly.Msg.MATH_SINGLE_HELPURL = "https://hrx.wikipedia.org/wiki/Quadratwoorzel";
Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE = "Absolutweart";
Blockly.Msg.MATH_SINGLE_OP_ROOT = "Quadratwoorzel";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS = "Ist der Absolutweart von en Weart.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP = "Ist Weart von der Exponentialfunktion von en Weart.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LN = "Ist der natรผarliche Logarithmus von en Weart.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10 = "Ist der dekoodische Logarithmus von en Weart.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG = "Negiert en Weart.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10 = "Rechnet 10 hoch Ingรคbweart.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT = "Ist die Qudratwoorzel von en Weart.";
Blockly.Msg.MATH_SUBTRACTION_SYMBOL = "-"; // untranslated
Blockly.Msg.MATH_TRIG_ACOS = "acos"; // untranslated
Blockly.Msg.MATH_TRIG_ASIN = "asin"; // untranslated
Blockly.Msg.MATH_TRIG_ATAN = "atan"; // untranslated
Blockly.Msg.MATH_TRIG_COS = "cos"; // untranslated
Blockly.Msg.MATH_TRIG_HELPURL = "https://hrx.wikipedia.org/wiki/Trigonometrie";
Blockly.Msg.MATH_TRIG_SIN = "sin"; // untranslated
Blockly.Msg.MATH_TRIG_TAN = "tan"; // untranslated
Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS = "Ist der Arcuscosinus von en Ingabweart.";
Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN = "Ist der Arcussinus von en Ingรคbweart.";
Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Ist der Arcustangens von en Ingรคbweart.";
Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Ist der Cosinus von en Winkel.";
Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Ist der Sinus von en Winkel.";
Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Ist der Tangens von en Winkel.";
Blockly.Msg.NEW_VARIABLE = "Neie Variable...";
Blockly.Msg.NEW_VARIABLE_TITLE = "Die neie Variable sei Noome:";
Blockly.Msg.ORDINAL_NUMBER_SUFFIX = ""; // untranslated
Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS = "allow statements"; // untranslated
Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "mit:";
Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL = "https://hrx.wikipedia.org/wiki/Prozedur_%28Programmierung%29";
Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP = "Ruf en Funktionsblock ohne Rรผckgรคweart uff.";
Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "https://hrx.wikipedia.org/wiki/Prozedur_%28Programmierung%29";
Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Ruf en Funktionsblock mit Rรผckgรคbweart uff.";
Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS = "mit:";
Blockly.Msg.PROCEDURES_CREATE_DO = "Generier/erzeich \"Uffruf %1\"";
Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = "Describe this function..."; // untranslated
Blockly.Msg.PROCEDURES_DEFNORETURN_DO = ""; // untranslated
Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "Funktionsblock";
Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE = "zu";
Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "En Funktionsblock ohne Rรผckgรคbweart.";
Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "geb zurรผck";
Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "En Funktionsblock mit Rรผckgรคbweart.";
Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Warnung: die Funktionsblock hot doppelt Parameter.";
Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Markiear Funktionsblock";
Blockly.Msg.PROCEDURES_IFRETURN_HELPURL = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "Wenn der earste Weart woahr (true) ist, Geb den zwooite Weart zurรผck.";
Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Warnung: Der Block dรคrref nuar innich en Funktionsblock genutzt sin.";
Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "Markiear Funktionsblock";
Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Generier/erzeich \"Uffruf %1\"";
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "Parameter";
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Variable:";
Blockly.Msg.REDO = "Redo"; // untranslated
Blockly.Msg.REMOVE_COMMENT = "Kommentar entferne";
Blockly.Msg.RENAME_VARIABLE = "Die neie Variable sei Noome:";
Blockly.Msg.RENAME_VARIABLE_TITLE = "All \"%1\" Variable umbenenne in:";
Blockly.Msg.TEXT_APPEND_APPENDTEXT = "Text oonhรคnge";
Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
Blockly.Msg.TEXT_APPEND_TO = "An";
Blockly.Msg.TEXT_APPEND_TOOLTIP = "Text an die Variable \"%1\" oonhรคnge.";
Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "umwandle in klenbuchstoobe";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE = "umwandle in Wรถrter";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE = "umwandle in GROSSBUCHSTOOBE";
Blockly.Msg.TEXT_CHANGECASE_TOOLTIP = "Wandelt Schreibweise von Texte um, in Grossbuchstoobe, Klenbuchstoobe orrer den earste Buchstoob von jedes Wort gross und die annre klen.";
Blockly.Msg.TEXT_CHARAT_FIRST = "hol earschte Buchstoob";
Blockly.Msg.TEXT_CHARAT_FROM_END = "hol Buchstoob # von End";
Blockly.Msg.TEXT_CHARAT_FROM_START = "hol Buchstoob #";
Blockly.Msg.TEXT_CHARAT_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT = "in Text";
Blockly.Msg.TEXT_CHARAT_LAST = "hol letztes Wort";
Blockly.Msg.TEXT_CHARAT_RANDOM = "hol zufรคlliches Buchstoob";
Blockly.Msg.TEXT_CHARAT_TAIL = ""; // untranslated
Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Extrahiear en Buchstoob von en spezifizierte Position.";
Blockly.Msg.TEXT_COUNT_HELPURL = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
Blockly.Msg.TEXT_COUNT_MESSAGE0 = "count %1 in %2"; // untranslated
Blockly.Msg.TEXT_COUNT_TOOLTIP = "Count how many times some text occurs within some other text."; // untranslated
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "En Element zum Text hinzufรผche.";
Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "verbinne";
Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "Hinzufรผche, entfernne und sortiere von Elemente.";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "bis #te Buchstoob von hinne";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "bis Buchstoob #te";
Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST = "bis letzte Buchstoob";
Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT = "in Text";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST = "earschte Buchstoob";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END = "hol #te Buchstoob von hinne";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START = "hol substring Buchstoob #te";
Blockly.Msg.TEXT_GET_SUBSTRING_TAIL = ""; // untranslated
Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP = "Schickt en bestimmstes Tel von dem Text retuar.";
Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT = "im Text";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "Such der Begriff sein earstes Voarkommniss";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "Suche der Begriff sein letztes Vorkommniss.";
Blockly.Msg.TEXT_INDEXOF_TAIL = ""; // untranslated
Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Findt das earste / letzte Voarkommniss von en Suchbegriffes in enem Text. Gebt die Position von dem Begriff orrer %1 zurรผck.";
Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 ist leer?";
Blockly.Msg.TEXT_ISEMPTY_TOOLTIP = "Ist woahr (true), wenn der Text leer ist.";
Blockly.Msg.TEXT_JOIN_HELPURL = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "Erstell Text aus";
Blockly.Msg.TEXT_JOIN_TOOLTIP = "Erstellt en Text doorrich das verbinne von mehre Textelemente.";
Blockly.Msg.TEXT_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
Blockly.Msg.TEXT_LENGTH_TITLE = "lรคng %1";
Blockly.Msg.TEXT_LENGTH_TOOLTIP = "Die Oonzoohl von Zeiche in enem Text. (inkl. Leerzeiche)";
Blockly.Msg.TEXT_PRINT_HELPURL = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
Blockly.Msg.TEXT_PRINT_TITLE = "Ausgรคb %1";
Blockly.Msg.TEXT_PRINT_TOOLTIP = "Geb den Inhalt von en Variable aus.";
Blockly.Msg.TEXT_PROMPT_HELPURL = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "Frocht den Benutzer noh en Zoohl.";
Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT = "Frocht den Benutzer noh enem Text.";
Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "Frรคcht noh Zoohl mit Hinweis";
Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "Frocht noh Text mit Hinweis";
Blockly.Msg.TEXT_REPLACE_HELPURL = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
Blockly.Msg.TEXT_REPLACE_MESSAGE0 = "replace %1 with %2 in %3"; // untranslated
Blockly.Msg.TEXT_REPLACE_TOOLTIP = "Replace all occurances of some text within some other text."; // untranslated
Blockly.Msg.TEXT_REVERSE_HELPURL = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
Blockly.Msg.TEXT_REVERSE_MESSAGE0 = "reverse %1"; // untranslated
Blockly.Msg.TEXT_REVERSE_TOOLTIP = "Reverses the order of the characters in the text."; // untranslated
Blockly.Msg.TEXT_TEXT_HELPURL = "https://en.wikipedia.org/wiki/String_(computer_science)https://hrx.wikipedia.org/wiki/Zeichenkette";
Blockly.Msg.TEXT_TEXT_TOOLTIP = "En Buchstoob, Text orrer Satz.";
Blockly.Msg.TEXT_TRIM_HELPURL = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "entfern Leerzeiche von Oonfang und End Seite";
Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "entferne Leerzeiche von Oonfang Seite";
Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "entferne Leerzeiche von End Seite von";
Blockly.Msg.TEXT_TRIM_TOOLTIP = "Entfernt Leerzeiche vom Oonfang und / orrer End von en Text.";
Blockly.Msg.TODAY = "Today"; // untranslated
Blockly.Msg.UNDO = "Undo"; // untranslated
Blockly.Msg.VARIABLES_DEFAULT_NAME = "Element";
Blockly.Msg.VARIABLES_GET_CREATE_SET = "Generier/erzeiche \"Schreibe %1\"";
Blockly.Msg.VARIABLES_GET_HELPURL = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
Blockly.Msg.VARIABLES_GET_TOOLTIP = "Gebt der Variable sein Weart zurรผck.";
Blockly.Msg.VARIABLES_SET = "Schreib %1 zu %2";
Blockly.Msg.VARIABLES_SET_CREATE_GET = "Generier/erzeich \"Lese %1\"";
Blockly.Msg.VARIABLES_SET_HELPURL = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
Blockly.Msg.VARIABLES_SET_TOOLTIP = "Setzt en Variable sei Weart.";
Blockly.Msg.VARIABLE_ALREADY_EXISTS = "A variable named '%1' already exists."; // untranslated
Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE;
Blockly.Msg.CONTROLS_IF_IF_TITLE_IF = Blockly.Msg.CONTROLS_IF_MSG_IF;
Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.CONTROLS_IF_MSG_THEN = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE = Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE;
Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.MATH_CHANGE_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.PROCEDURES_DEFRETURN_DO = Blockly.Msg.PROCEDURES_DEFNORETURN_DO;
Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF = Blockly.Msg.CONTROLS_IF_MSG_ELSEIF;
Blockly.Msg.LISTS_GET_INDEX_HELPURL = Blockly.Msg.LISTS_INDEX_OF_HELPURL;
Blockly.Msg.CONTROLS_FOREACH_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.CONTROLS_FOR_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.TEXT_APPEND_VARIABLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT = Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT;
Blockly.Msg.MATH_HUE = "230";
Blockly.Msg.LOOPS_HUE = "120";
Blockly.Msg.LISTS_HUE = "260";
Blockly.Msg.LOGIC_HUE = "210";
Blockly.Msg.VARIABLES_HUE = "330";
Blockly.Msg.TEXTS_HUE = "160";
Blockly.Msg.PROCEDURES_HUE = "290";
Blockly.Msg.COLOUR_HUE = "20";
|
(function() {
'use strict';
angular.module('app.data')
.factory('postResource', postResource)
.factory('postsUtils', postsUtils);
postResource.$inject = ['$resource'];
function postResource($resource) {
return $resource('/api/posts/:id', {id: '@id'}, {
update: {
method: 'PUT'
}
});
}
postsUtils.$inject = ['postResource'];
function postsUtils(postResource) {
function postsDuringInterval(posts, days) {
var today = new Date();
var interval = 86400000 * days;
var postsDuringInterval = [];
posts.forEach(function(post) {
var postDate = new Date(post.date);
today - postDate < interval && postsDuringInterval.push(post);
});
return postsDuringInterval;
}
function recent(posts, postsNum) {
posts.sort(function(a, b) {
if (a.date < b.date) return 1;
else if (a.date == b.date) return 0;
else return -1;
});
return posts.slice(0, postsNum || 1);
}
function lastEdited(posts) {
var lastEdited = posts[0];
posts.forEach(function(post) {
lastEdited = lastEdited.date < post.date ? lastEdited : post;
});
return lastEdited;
}
return {
postsDuringInterval: postsDuringInterval,
lastEdited: lastEdited,
recent: recent
}
}
})();
|
/**
* @fileoverview Test for no-function-overriding rule
* @author Nicolas Feignon <nfeignon@gmail.com>
*/
"use strict";
let Solium = require("solium");
let userConfig = {
rules: {
"security/no-func-overriding": "error"
}
};
describe("[RULE] no-func-overriding: Acceptances", function() {
it("should accept contracts that don't override their inherited functions", function(done) {
let code = [
`
pragma solidity ^0.4.0;
contract A {
function foo();
function ();
}
contract B is A {
function bar();
function ();
}
`,
`
pragma solidity ^0.4.0;
pragma experimental "ABIEncoderV2";
contract A {
function foo();
}
contract B is A {
function bar();
function();
}
contract C {
function foo();
}
`,
`
library Foo {}
library Bar {}
contract A {
function foo();
}
contract B is A {
function bar();
function foo(uint);
}
`,
`
contract A {
function foo();
}
contract B is A {
function foo(uint, string);
}
contract C is B {
function foo(uint);
}
`,
`
contract A {
function foo() returns (string);
}
contract B is A {
function foo(uint, string) payable public;
}
contract C is B {
function foo(uint);
}
`
];
let errors;
for (let expr of code) {
errors = Solium.lint(expr, userConfig);
errors.length.should.equal(0);
}
Solium.reset();
done();
});
});
describe("[RULE] no-func-overriding: Rejections", function() {
it("should reject contracts that override their inherited functions", function(done) {
let code = [
`
contract A {
function foo();
}
contract B is A {
function foo() { return; }
}
`,
`
contract A {
function foo();
function bar(uint, string);
function();
}
contract B is A {
function bar(uint, string);
}
contract C is B {
function foo(uint);
}
contract D is C {
function foo(uint);
}
`,
`
contract A {
function foo() returns (string);
function();
}
contract B is A {
}
contract C is B {
function foo() returns (string);
}
`,
`
contract A {
function bar(string s, uint u) public;
}
contract B is A {
function bar(string s, uint u) public;
}
`,
`
contract A {
function bar(string s, uint u) public;
}
contract B {
}
contract C is A,B {
function bar(string s, uint u) public;
}
`,
`
pragma solidity ^0.4.0;
contract A {
function bar(string s, uint u) public;
}
contract B {
function bar(string, uint) public;
}
contract C is A,B {
function bar(string s, uint u) public;
}
`
];
let errors;
errors = Solium.lint(code[0], userConfig);
errors.length.should.equal(1);
errors = Solium.lint(code[1], userConfig);
errors.length.should.equal(2);
errors = Solium.lint(code[2], userConfig);
errors.length.should.equal(1);
errors = Solium.lint(code[3], userConfig);
errors.length.should.equal(1);
errors = Solium.lint(code[4], userConfig);
errors.length.should.equal(1);
errors = Solium.lint(code[5], userConfig);
errors.length.should.equal(2);
Solium.reset();
done();
});
});
|
version https://git-lfs.github.com/spec/v1
oid sha256:ae471c42434293ca02685108ce98e3c46c8686b57dd24c26f4d575dc1ddb702d
size 1980
|
import Camera from './Camera';
export default Camera;
|
YUI.add('gallery-beacon-listener', function (Y, NAME) {
"use strict";
/**
* @example
* var picListener = new Y.BeaconListener({
* beacons:'.pic-beacon' //listen for all pic-beacons in the viewport
* });
*
* picListener.on('found', function(e){
* e.beacon.src = e.beacon.getData('img-src');
*
* new Y.Anim({
* node:e.beacon,
* from: {
* opacity: 0
* },
* to: {
* opacity: 1
* }
* }).run();
* });
*
* picListener.start();
*
* @module gallery-beacon-listener
* @class BeaconListener
* @author Kris Kelly
* @description Beacon listeners are simple classes that will periodically check for an element or elements within their defined region
*/
var
MIN_TIMER_VAL = 1,
EVENT_TYPE_FOUND = 'beaconlistener:found',
EVENT_TYPE_LOST = 'beaconlistener:lost',
Lang = Y.Lang,
DOM = Y.DOM,
TOP = 'top',
RIGHT = 'right',
BOTTOM = 'bottom',
LEFT = 'left';
Y.BeaconListener = Y.Base.create('beaconListener', Y.Base, [], {
_isListening: false,
_timerHandle: null,
_pollInterval: 100,
_region: null,//a cache of the region for this listener
_beaconList: null,
_beaconStates: [],
_beaconDOMNodes: [],
_fullyInside: false,
/**
* Constructor for the listener class
* @private
* @param {object} config
* @return null
* @method initializer
*****************/
initializer: function(config){
config = config || {
beacons: '.beacon',
region: null
};
var me = this,
beacons = config.beacons,
region = config.region;
me.publish(EVENT_TYPE_FOUND, {
context: me,
broadcast: true,
emitFacade: true
});
me.publish(EVENT_TYPE_LOST, {
context: me,
broadcast: true,
emitFacade: true
});
//LISTEN TO
me.after('beaconlistener:beaconsChange', me._handleBeaconsChange);
if ( beacons ){
me._handleBeaconsChange();
}
//REGION
me.after('beaconlistener:regionChange', me._handleRegionChange);
if ( region ){
me._handleRegionChange();
}
//poll interval
me.after('beaconlistener:pollIntervalChange', me._handlePollIntervalChange);
Y.on('windowresize', function(){ me._handleRegionChange(); });
me.after('beaconlistener:fullyInsideChange', me._handleFullyInsideChange);
me._handleFullyInsideChange();//force setting of internal property
if (me.get('autoStart')){
me.start();
//fire off a check now
Y.later(
me.get('pollInterval'),
me,
me.check,
null,
false
);
}
},
/**
* Stop listening for beacons
*
* @method stop
*****************/
stop: function(){
var me = this;
if (me._isListening === true && me._timerHandle !== null){
me._timerHandle.cancel();
me._timerHandle = null;
me._isListening = false;
}
},
/**
* Start listening for beacons
*
* @method start
*****************/
start: function(){
var me = this;
if (
Lang.isUndefined( me._timerHandler )
&& !Lang.isUndefined( me._beaconList )
&& me._beaconList !== null
){
me._isListening = true;
me._timerHandle = Y.later(
me.get('pollInterval'),
me,
me.check,
null,
true
);
}
},
/**
* Check for beacons in the region
*
* @method check
*****************/
check: function(){
var me = this,
region = me._region,
testMethod;
if (region === null){
testMethod = DOM.inViewportRegion;
} else {
me._handleRegionChange();//since the scroll pos can change the region
region = me._region;
testMethod = DOM.inRegion;
}
me._beaconList.each(function(node, index){
var testNode = me._beaconDOMNodes[index], inRegion, args;
if (region === null){
args = [testNode, me._fullyInside];
} else {
args = [testNode, region, me._fullyInside];
}
inRegion = testMethod.apply(me, args);
if ( inRegion && !me._beaconStates[index] ){
//if we encounter a beacon and it wasn't previously in the region
me._beaconStates[index] = true;
me.fire( EVENT_TYPE_FOUND, {listener: me, beacon: node} );
} else if ( !inRegion && me._beaconStates[index]){
//if we encounter a beacon and it was in the region
me._beaconStates[index] = false;
me.fire( EVENT_TYPE_LOST, {listener: me, beacon: node} );
}
});
},
/**
* Check if the listener is listening
*
* @method isListening
**********************/
isListening: function(){
return this._isListening;
},
/**
* @private
* @method _handleFullyInsideChange
**********************/
_handleFullyInsideChange: function(){
var me = this;
//store the fullyInside property internally
me._fullyInside = me.get('fullyInside');
},
/**
* @private
* @method _handleRegionChange
*****************/
_handleRegionChange: function(){
var me = this,
region = me.get('region');
me.recalcRegion(region);
},
/**
* Recalculate the region
* The the region is a valid object then the current region will be overwritten
*
* @param region (optional)
* @method recalcRegion
*****************/
recalcRegion: function(region){
var me = this,
newRegion;
if ( Y.Lang.isUndefined( region ) ){
region = me._region;
}
if ( Lang.isObject( region ) ){
if (
Lang.isNumber( region[TOP] )
&& Lang.isNumber( region[RIGHT] )
&& Lang.isNumber( region[BOTTOM] )
&& Lang.isNumber( region[LEFT] )
) {
me._region = region;
return;
} else {
region = Y.one( region );
if ( region ){
if (region.getDOMNode){
newRegion = DOM.region(region.getDOMNode());
} else {
newRegion = DOM.region(region);
}
if (newRegion){
me._region = newRegion;
return;
}
}
}
}
//defult to the viewport
me._region = null;
},
/**
* @private
* @method _handleBeaconsChange
*****************/
_handleBeaconsChange: function(){
var me = this,
beacons = me.get('beacons');
me._beaconStates = [];
me._beaconDOMNodes = [];
me._beaconList = me._getList(beacons);
if ( me._beaconList && me._beaconList.size() > 0 ){
me._beaconList.each(function(node, index){
me._beaconStates[index] = false;
me._beaconDOMNodes[index] = node.getDOMNode();
});
}
},
/**
* @private
* @return NodeList|null
* @method _getList
*****************/
_getList: function(val){
var temp;
if ( Lang.isString( val ) ){ //assume it's a selector
return Y.all(val);
}
if ( Lang.isObject( val ) && val.nodes ) {//if it's a nodelist
return val;
}
temp = Y.one( val );
if (temp){
return new Y.NodeList(temp);
}
return null;
},
/**
* @private
* @method _handlePollIntervalChange
*****************/
_handlePollIntervalChange: function(){
var me = this;
me._pollInterval = me.get('pollInterval');
}
}, {
ATTRS: {
/**
* Number of milliseconds between checks
*
* @attribute pollInterval
* @type Integer
*/
"pollInterval": {
value:100,
validator: function( val ){
return ( Lang.isNumber(val) && val > MIN_TIMER_VAL );
}
},
/**
* Defines the region within which the listener will check for beacons.
*
* @attribute region
* @type Node|Object|null
*/
"region": { //can be a node or region object
value: null, //if region is null then the viewport will be used
validator: function(val){
return ( val === null || Y.one( val ) );
}
},
/**
* A selector, Node or NodeList that will be used to determine the beacons this listener observes
*
* @attribute beacons
* @type String|Node|NodeList
*/
"beacons": {
value: '.beacon',
validator: function(val){
return (!Lang.isUndefined(val) && val !== null);
}
},
/**
* If true, then the beacon must be fully contained within the region
*
* @attribute fullyInside
* @type Boolean
*/
"fullyInside": {
value:false,
validator: function( val ){
return Lang.isBoolean(val);
}
},
/**
* If true, the start method will be called as soon as the class is initialised
*
* @attribute autoStart
* @type Boolean
*/
"autoStart": {
value:false,
validator: function( val ){
return Lang.isBoolean(val);
}
}
}
});
}, 'gallery-2013.06.20-02-07', {"requires": ["node", "event-custom", "event-resize", "base-build", "dom"]});
|
'use strict';
const fs = require('fs');
const path = require('path');
const expect = require('chai').expect;
const assert = require('chai').assert;
const connectors = require('../../src/core/connectors');
const UrlMatch = require('../../src/core/background/util/url-match');
const PROP_TYPES = {
allFrames: 'boolean',
matches: 'array',
label: 'string',
js: 'string',
id: 'string',
};
const REQUIRED_PROPS = ['label', 'js', 'id'];
function testProps(entry) {
for (const prop of REQUIRED_PROPS) {
assert(entry[prop], `Missing property: ${prop}`);
}
for (const prop in entry) {
const type = PROP_TYPES[prop];
assert(type, `Missing property: ${prop}`);
expect(entry[prop]).to.be.a(type);
}
}
function testMatches(entry) {
if (!entry.matches) {
return;
}
assert(entry.matches !== 0, 'Property is empty: matches');
for (const m of entry.matches) {
assert(UrlMatch.createPattern(m), `URL pattern is invalid: ${m}`);
}
}
function testPaths(entry) {
if (!entry.js) {
return;
}
const jsPath = path.join(__dirname, '../../src', entry.js);
try {
fs.statSync(jsPath);
} catch (e) {
throw new Error(`File is missing: ${entry.js}`);
}
}
function testUniqueness(entry) {
for (const connector of connectors) {
if (connector.label === entry.label) {
continue;
}
assert(entry.id !== connector.id, `Id is not unique: ${entry.label}`);
}
}
function runTests() {
for (const entry of connectors) {
describe(entry.label, () => {
it('should have valid prop types', () => {
testProps(entry);
});
it('should have valid URL matches', () => {
testMatches(entry);
});
it('should have js files for', () => {
testPaths(entry);
});
it('should have unique id', () => {
testUniqueness(entry);
});
});
}
}
runTests();
|
exports.Parse = require('./lib/Parse');
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = require("babel-runtime/helpers/defineProperty");
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _extends2 = require("babel-runtime/helpers/extends");
var _extends3 = _interopRequireDefault(_extends2);
var _flowRight2 = require("lodash/flowRight");
var _flowRight3 = _interopRequireDefault(_flowRight2);
var _childContextTypes;
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
var _markerClustererPlus = require("marker-clusterer-plus");
var _markerClustererPlus2 = _interopRequireDefault(_markerClustererPlus);
var _constants = require("../constants");
var _enhanceElement = require("../enhanceElement");
var _enhanceElement2 = _interopRequireDefault(_enhanceElement);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var controlledPropTypes = {
// NOTICE!!!!!!
//
// Only expose those with getters & setters in the table as controlled props.
//
// http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/docs/reference.html
averageCenter: _react.PropTypes.bool,
batchSizeIE: _react.PropTypes.number,
calculator: _react.PropTypes.func,
clusterClass: _react.PropTypes.string,
enableRetinaIcons: _react.PropTypes.bool,
gridSize: _react.PropTypes.number,
ignoreHidden: _react.PropTypes.bool,
imageExtension: _react.PropTypes.string,
imagePath: _react.PropTypes.string,
imageSizes: _react.PropTypes.array,
maxZoom: _react.PropTypes.number,
minimumClusterSize: _react.PropTypes.number,
styles: _react.PropTypes.array,
title: _react.PropTypes.string,
zoomOnClick: _react.PropTypes.bool
};
var defaultUncontrolledPropTypes = (0, _enhanceElement.addDefaultPrefixToPropTypes)(controlledPropTypes);
var eventMap = {
// http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/docs/reference.html
onClick: "click",
onClusteringBegin: "clusteringbegin",
onClusteringEnd: "clusteringend",
onMouseOut: "mouseout",
onMouseOver: "mouseover"
};
var publicMethodMap = {
// Public APIs
//
// http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/docs/reference.html#events
getAverageCenter: function getAverageCenter(markerClusterer) {
return markerClusterer.getAverageCenter();
},
getBatchSizeIE: function getBatchSizeIE(markerClusterer) {
return markerClusterer.getBatchSizeIE();
},
getCalculator: function getCalculator(markerClusterer) {
return markerClusterer.getCalculator();
},
getClusterClass: function getClusterClass(markerClusterer) {
return markerClusterer.getClusterClass();
},
getClusters: function getClusters(markerClusterer) {
return markerClusterer.getClusters();
},
getEnableRetinaIcons: function getEnableRetinaIcons(markerClusterer) {
return markerClusterer.getEnableRetinaIcons();
},
getGridSize: function getGridSize(markerClusterer) {
return markerClusterer.getGridSize();
},
getIgnoreHidden: function getIgnoreHidden(markerClusterer) {
return markerClusterer.getIgnoreHidden();
},
getImageExtension: function getImageExtension(markerClusterer) {
return markerClusterer.getImageExtension();
},
getImagePath: function getImagePath(markerClusterer) {
return markerClusterer.getImagePath();
},
getImageSize: function getImageSize(markerClusterer) {
return markerClusterer.getImageSize();
},
getMarkers: function getMarkers(markerClusterer) {
return markerClusterer.getMarkers();
},
getMaxZoom: function getMaxZoom(markerClusterer) {
return markerClusterer.getMaxZoom();
},
getMinimumClusterSize: function getMinimumClusterSize(markerClusterer) {
return markerClusterer.getMinimumClusterSize();
},
getStyles: function getStyles(markerClusterer) {
return markerClusterer.getStyles();
},
getTitle: function getTitle(markerClusterer) {
return markerClusterer.getTitle();
},
getTotalClusters: function getTotalClusters(markerClusterer) {
return markerClusterer.getTotalClusters();
},
getZoomOnClick: function getZoomOnClick(markerClusterer) {
return markerClusterer.getZoomOnClick();
},
// Public APIs - Use this carefully
addMarker: function addMarker(markerClusterer, marker) {
var nodraw = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
return markerClusterer.addMarker(marker, nodraw);
},
addMarkers: function addMarkers(markerClusterer, markers) {
var nodraw = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
return markerClusterer.addMarkers(markers, nodraw);
},
removeMarker: function removeMarker(markerClusterer, marker) {
var nodraw = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
return markerClusterer.removeMarker(marker, nodraw);
},
removeMarkers: function removeMarkers(markerClusterer, markers) {
var nodraw = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
return markerClusterer.removeMarkers(markers, nodraw);
},
clearMarkers: function clearMarkers(markerClusterer) {
return markerClusterer.clearMarkers();
},
fitMapToMarkers: function fitMapToMarkers(markerClusterer) {
return markerClusterer.fitMapToMarkers();
},
repaint: function repaint(markerClusterer) {
return markerClusterer.repaint();
}
};
var controlledPropUpdaterMap = {
averageCenter: function averageCenter(markerClusterer, _averageCenter) {
markerClusterer.setAverageCenter(_averageCenter);
},
batchSizeIE: function batchSizeIE(markerClusterer, _batchSizeIE) {
markerClusterer.setBatchSizeIE(_batchSizeIE);
},
calculator: function calculator(markerClusterer, _calculator) {
markerClusterer.setCalculator(_calculator);
},
enableRetinaIcons: function enableRetinaIcons(markerClusterer, _enableRetinaIcons) {
markerClusterer.setEnableRetinaIcons(_enableRetinaIcons);
},
gridSize: function gridSize(markerClusterer, _gridSize) {
markerClusterer.setGridSize(_gridSize);
},
ignoreHidden: function ignoreHidden(markerClusterer, _ignoreHidden) {
markerClusterer.setIgnoreHidden(_ignoreHidden);
},
imageExtension: function imageExtension(markerClusterer, _imageExtension) {
markerClusterer.setImageExtension(_imageExtension);
},
imagePath: function imagePath(markerClusterer, _imagePath) {
markerClusterer.setImagePath(_imagePath);
},
imageSizes: function imageSizes(markerClusterer, _imageSizes) {
markerClusterer.setImageSizes(_imageSizes);
},
maxZoom: function maxZoom(markerClusterer, _maxZoom) {
markerClusterer.setMaxZoom(_maxZoom);
},
minimumClusterSize: function minimumClusterSize(markerClusterer, _minimumClusterSize) {
markerClusterer.setMinimumClusterSize(_minimumClusterSize);
},
styles: function styles(markerClusterer, _styles) {
markerClusterer.setStyles(_styles);
},
title: function title(markerClusterer, _title) {
markerClusterer.setTitle(_title);
},
zoomOnClick: function zoomOnClick(markerClusterer, _zoomOnClick) {
markerClusterer.setZoomOnClick(_zoomOnClick);
}
};
function getInstanceFromComponent(component) {
return component.state[_constants.MARKER_CLUSTERER];
}
exports.default = (0, _flowRight3.default)(_react2.default.createClass, (0, _enhanceElement2.default)(getInstanceFromComponent, publicMethodMap, eventMap, controlledPropUpdaterMap))({
displayName: "MarkerClusterer",
propTypes: (0, _extends3.default)({}, controlledPropTypes, defaultUncontrolledPropTypes),
contextTypes: (0, _defineProperty3.default)({}, _constants.MAP, _react.PropTypes.object),
childContextTypes: (_childContextTypes = {}, (0, _defineProperty3.default)(_childContextTypes, _constants.ANCHOR, _react.PropTypes.object), (0, _defineProperty3.default)(_childContextTypes, _constants.MARKER_CLUSTERER, _react.PropTypes.object), _childContextTypes),
getInitialState: function getInitialState() {
// http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/docs/reference.html#events
var markerClusterer = new _markerClustererPlus2.default(this.context[_constants.MAP], [], (0, _enhanceElement.collectUncontrolledAndControlledProps)(defaultUncontrolledPropTypes, controlledPropTypes, this.props));
return (0, _defineProperty3.default)({}, _constants.MARKER_CLUSTERER, markerClusterer);
},
getChildContext: function getChildContext() {
var _ref2;
var markerClusterer = getInstanceFromComponent(this);
return _ref2 = {}, (0, _defineProperty3.default)(_ref2, _constants.ANCHOR, markerClusterer), (0, _defineProperty3.default)(_ref2, _constants.MARKER_CLUSTERER, markerClusterer), _ref2;
},
componentDidUpdate: function componentDidUpdate() {
var markerClusterer = getInstanceFromComponent(this);
markerClusterer.repaint();
},
componentWillUnmount: function componentWillUnmount() {
var markerClusterer = getInstanceFromComponent(this);
if (markerClusterer) {
markerClusterer.setMap(null);
}
},
render: function render() {
var children = this.props.children;
return _react2.default.createElement(
"div",
null,
children
);
}
});
|
describe('my app', function() {
'use strict';
browser.get('index.html');
it('should automatically redirect to /homw when location hash/fragment is empty', function() {
expect(browser.getLocationAbsUrl()).toMatch("/home");
});
});
|
(function () {
var link = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK');
var assumeExternalTargets = function (editorSettings) {
return typeof editorSettings.link_assume_external_targets === 'boolean' ? editorSettings.link_assume_external_targets : false;
};
var hasContextToolbar = function (editorSettings) {
return typeof editorSettings.link_context_toolbar === 'boolean' ? editorSettings.link_context_toolbar : false;
};
var getLinkList = function (editorSettings) {
return editorSettings.link_list;
};
var hasDefaultLinkTarget = function (editorSettings) {
return typeof editorSettings.default_link_target === 'string';
};
var getDefaultLinkTarget = function (editorSettings) {
return editorSettings.default_link_target;
};
var getTargetList = function (editorSettings) {
return editorSettings.target_list;
};
var setTargetList = function (editor, list) {
editor.settings.target_list = list;
};
var shouldShowTargetList = function (editorSettings) {
return getTargetList(editorSettings) !== false;
};
var getRelList = function (editorSettings) {
return editorSettings.rel_list;
};
var hasRelList = function (editorSettings) {
return getRelList(editorSettings) !== undefined;
};
var getLinkClassList = function (editorSettings) {
return editorSettings.link_class_list;
};
var hasLinkClassList = function (editorSettings) {
return getLinkClassList(editorSettings) !== undefined;
};
var shouldShowLinkTitle = function (editorSettings) {
return editorSettings.link_title !== false;
};
var allowUnsafeLinkTarget = function (editorSettings) {
return typeof editorSettings.allow_unsafe_link_target === 'boolean' ? editorSettings.allow_unsafe_link_target : false;
};
var $_bau5ogfvjnlpb21f = {
assumeExternalTargets: assumeExternalTargets,
hasContextToolbar: hasContextToolbar,
getLinkList: getLinkList,
hasDefaultLinkTarget: hasDefaultLinkTarget,
getDefaultLinkTarget: getDefaultLinkTarget,
getTargetList: getTargetList,
setTargetList: setTargetList,
shouldShowTargetList: shouldShowTargetList,
getRelList: getRelList,
hasRelList: hasRelList,
getLinkClassList: getLinkClassList,
hasLinkClassList: hasLinkClassList,
shouldShowLinkTitle: shouldShowLinkTitle,
allowUnsafeLinkTarget: allowUnsafeLinkTarget
};
var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
var appendClickRemove = function (link, evt) {
document.body.appendChild(link);
link.dispatchEvent(evt);
document.body.removeChild(link);
};
var open$$1 = function (url) {
if (!global$3.ie || global$3.ie > 10) {
var link = document.createElement('a');
link.target = '_blank';
link.href = url;
link.rel = 'noreferrer noopener';
var evt = document.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
appendClickRemove(link, evt);
} else {
var win = window.open('', '_blank');
if (win) {
win.opener = null;
var doc = win.document;
doc.open();
doc.write('<meta http-equiv="refresh" content="0; url=' + global$2.DOM.encode(url) + '">');
doc.close();
}
}
};
var $_2sf6akfwjnlpb21g = { open: open$$1 };
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var toggleTargetRules = function (rel, isUnsafe) {
var rules = ['noopener'];
var newRel = rel ? rel.split(/\s+/) : [];
var toString = function (rel) {
return global$4.trim(rel.sort().join(' '));
};
var addTargetRules = function (rel) {
rel = removeTargetRules(rel);
return rel.length ? rel.concat(rules) : rules;
};
var removeTargetRules = function (rel) {
return rel.filter(function (val) {
return global$4.inArray(rules, val) === -1;
});
};
newRel = isUnsafe ? addTargetRules(newRel) : removeTargetRules(newRel);
return newRel.length ? toString(newRel) : null;
};
var trimCaretContainers = function (text) {
return text.replace(/\uFEFF/g, '');
};
var getAnchorElement = function (editor, selectedElm) {
selectedElm = selectedElm || editor.selection.getNode();
if (isImageFigure(selectedElm)) {
return editor.dom.select('a[href]', selectedElm)[0];
} else {
return editor.dom.getParent(selectedElm, 'a[href]');
}
};
var getAnchorText = function (selection, anchorElm) {
var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({ format: 'text' });
return trimCaretContainers(text);
};
var isLink = function (elm) {
return elm && elm.nodeName === 'A' && elm.href;
};
var hasLinks = function (elements) {
return global$4.grep(elements, isLink).length > 0;
};
var isOnlyTextSelected = function (html) {
if (/</.test(html) && (!/^<a [^>]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') === -1)) {
return false;
}
return true;
};
var isImageFigure = function (node) {
return node && node.nodeName === 'FIGURE' && /\bimage\b/i.test(node.className);
};
var link = function (editor, attachState) {
return function (data) {
editor.undoManager.transact(function () {
var selectedElm = editor.selection.getNode();
var anchorElm = getAnchorElement(editor, selectedElm);
var linkAttrs = {
href: data.href,
target: data.target ? data.target : null,
rel: data.rel ? data.rel : null,
class: data.class ? data.class : null,
title: data.title ? data.title : null
};
if (!$_bau5ogfvjnlpb21f.hasRelList(editor.settings) && $_bau5ogfvjnlpb21f.allowUnsafeLinkTarget(editor.settings) === false) {
linkAttrs.rel = toggleTargetRules(linkAttrs.rel, linkAttrs.target === '_blank');
}
if (data.href === attachState.href) {
attachState.attach();
attachState = {};
}
if (anchorElm) {
editor.focus();
if (data.hasOwnProperty('text')) {
if ('innerText' in anchorElm) {
anchorElm.innerText = data.text;
} else {
anchorElm.textContent = data.text;
}
}
editor.dom.setAttribs(anchorElm, linkAttrs);
editor.selection.select(anchorElm);
editor.undoManager.add();
} else {
if (isImageFigure(selectedElm)) {
linkImageFigure(editor, selectedElm, linkAttrs);
} else if (data.hasOwnProperty('text')) {
editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(data.text)));
} else {
editor.execCommand('mceInsertLink', false, linkAttrs);
}
}
});
};
};
var unlink = function (editor) {
return function () {
editor.undoManager.transact(function () {
var node = editor.selection.getNode();
if (isImageFigure(node)) {
unlinkImageFigure(editor, node);
} else {
editor.execCommand('unlink');
}
});
};
};
var unlinkImageFigure = function (editor, fig) {
var a, img;
img = editor.dom.select('img', fig)[0];
if (img) {
a = editor.dom.getParents(img, 'a[href]', fig)[0];
if (a) {
a.parentNode.insertBefore(img, a);
editor.dom.remove(a);
}
}
};
var linkImageFigure = function (editor, fig, attrs) {
var a, img;
img = editor.dom.select('img', fig)[0];
if (img) {
a = editor.dom.create('a', attrs);
img.parentNode.insertBefore(a, img);
a.appendChild(img);
}
};
var $_f77mtqg0jnlpb21y = {
link: link,
unlink: unlink,
isLink: isLink,
hasLinks: hasLinks,
isOnlyTextSelected: isOnlyTextSelected,
getAnchorElement: getAnchorElement,
getAnchorText: getAnchorText,
toggleTargetRules: toggleTargetRules
};
var global$5 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global$6 = tinymce.util.Tools.resolve('tinymce.util.XHR');
var attachState = {};
var createLinkList = function (editor, callback) {
var linkList = $_bau5ogfvjnlpb21f.getLinkList(editor.settings);
if (typeof linkList === 'string') {
global$6.send({
url: linkList,
success: function (text) {
callback(editor, JSON.parse(text));
}
});
} else if (typeof linkList === 'function') {
linkList(function (list) {
callback(editor, list);
});
} else {
callback(editor, linkList);
}
};
var buildListItems = function (inputList, itemCallback, startItems) {
var appendItems = function (values, output) {
output = output || [];
global$4.each(values, function (item) {
var menuItem = { text: item.text || item.title };
if (item.menu) {
menuItem.menu = appendItems(item.menu);
} else {
menuItem.value = item.value;
if (itemCallback) {
itemCallback(menuItem);
}
}
output.push(menuItem);
});
return output;
};
return appendItems(inputList, startItems || []);
};
var delayedConfirm = function (editor, message, callback) {
var rng = editor.selection.getRng();
global$5.setEditorTimeout(editor, function () {
editor.windowManager.confirm(message, function (state) {
editor.selection.setRng(rng);
callback(state);
});
});
};
var showDialog = function (editor, linkList) {
var data = {};
var selection = editor.selection;
var dom = editor.dom;
var anchorElm, initialText;
var win, onlyText, textListCtrl, linkListCtrl, relListCtrl, targetListCtrl, classListCtrl, linkTitleCtrl, value;
var linkListChangeHandler = function (e) {
var textCtrl = win.find('#text');
if (!textCtrl.value() || e.lastControl && textCtrl.value() === e.lastControl.text()) {
textCtrl.value(e.control.text());
}
win.find('#href').value(e.control.value());
};
var buildAnchorListControl = function (url) {
var anchorList = [];
global$4.each(editor.dom.select('a:not([href])'), function (anchor) {
var id = anchor.name || anchor.id;
if (id) {
anchorList.push({
text: id,
value: '#' + id,
selected: url.indexOf('#' + id) !== -1
});
}
});
if (anchorList.length) {
anchorList.unshift({
text: 'None',
value: ''
});
return {
name: 'anchor',
type: 'listbox',
label: 'Anchors',
values: anchorList,
onselect: linkListChangeHandler
};
}
};
var updateText = function () {
if (!initialText && onlyText && !data.text) {
this.parent().parent().find('#text')[0].value(this.value());
}
};
var urlChange = function (e) {
var meta = e.meta || {};
if (linkListCtrl) {
linkListCtrl.value(editor.convertURL(this.value(), 'href'));
}
global$4.each(e.meta, function (value, key) {
var inp = win.find('#' + key);
if (key === 'text') {
if (initialText.length === 0) {
inp.value(value);
data.text = value;
}
} else {
inp.value(value);
}
});
if (meta.attach) {
attachState = {
href: this.value(),
attach: meta.attach
};
}
if (!meta.text) {
updateText.call(this);
}
};
var onBeforeCall = function (e) {
e.meta = win.toJSON();
};
onlyText = $_f77mtqg0jnlpb21y.isOnlyTextSelected(selection.getContent());
anchorElm = $_f77mtqg0jnlpb21y.getAnchorElement(editor);
data.text = initialText = $_f77mtqg0jnlpb21y.getAnchorText(editor.selection, anchorElm);
data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : '';
if (anchorElm) {
data.target = dom.getAttrib(anchorElm, 'target');
} else if ($_bau5ogfvjnlpb21f.hasDefaultLinkTarget(editor.settings)) {
data.target = $_bau5ogfvjnlpb21f.getDefaultLinkTarget(editor.settings);
}
if (value = dom.getAttrib(anchorElm, 'rel')) {
data.rel = value;
}
if (value = dom.getAttrib(anchorElm, 'class')) {
data.class = value;
}
if (value = dom.getAttrib(anchorElm, 'title')) {
data.title = value;
}
if (onlyText) {
textListCtrl = {
name: 'text',
type: 'textbox',
size: 40,
label: 'Text to display',
onchange: function () {
data.text = this.value();
}
};
}
if (linkList) {
linkListCtrl = {
type: 'listbox',
label: 'Link list',
values: buildListItems(linkList, function (item) {
item.value = editor.convertURL(item.value || item.url, 'href');
}, [{
text: 'None',
value: ''
}]),
onselect: linkListChangeHandler,
value: editor.convertURL(data.href, 'href'),
onPostRender: function () {
linkListCtrl = this;
}
};
}
if ($_bau5ogfvjnlpb21f.shouldShowTargetList(editor.settings)) {
if ($_bau5ogfvjnlpb21f.getTargetList(editor.settings) === undefined) {
$_bau5ogfvjnlpb21f.setTargetList(editor, [
{
text: 'None',
value: ''
},
{
text: 'New window',
value: '_blank'
}
]);
}
targetListCtrl = {
name: 'target',
type: 'listbox',
label: 'Target',
values: buildListItems($_bau5ogfvjnlpb21f.getTargetList(editor.settings))
};
}
if ($_bau5ogfvjnlpb21f.hasRelList(editor.settings)) {
relListCtrl = {
name: 'rel',
type: 'listbox',
label: 'Rel',
values: buildListItems($_bau5ogfvjnlpb21f.getRelList(editor.settings), function (item) {
if ($_bau5ogfvjnlpb21f.allowUnsafeLinkTarget(editor.settings) === false) {
item.value = $_f77mtqg0jnlpb21y.toggleTargetRules(item.value, data.target === '_blank');
}
})
};
}
if ($_bau5ogfvjnlpb21f.hasLinkClassList(editor.settings)) {
classListCtrl = {
name: 'class',
type: 'listbox',
label: 'Class',
values: buildListItems($_bau5ogfvjnlpb21f.getLinkClassList(editor.settings), function (item) {
if (item.value) {
item.textStyle = function () {
return editor.formatter.getCssText({
inline: 'a',
classes: [item.value]
});
};
}
})
};
}
if ($_bau5ogfvjnlpb21f.shouldShowLinkTitle(editor.settings)) {
linkTitleCtrl = {
name: 'title',
type: 'textbox',
label: 'Title',
value: data.title
};
}
win = editor.windowManager.open({
title: 'Insert link',
data: data,
body: [
{
name: 'href',
type: 'filepicker',
filetype: 'file',
size: 40,
autofocus: true,
label: 'Url',
onchange: urlChange,
onkeyup: updateText,
onpaste: updateText,
onbeforecall: onBeforeCall
},
textListCtrl,
linkTitleCtrl,
buildAnchorListControl(data.href),
linkListCtrl,
relListCtrl,
targetListCtrl,
classListCtrl
],
onSubmit: function (e) {
var assumeExternalTargets = $_bau5ogfvjnlpb21f.assumeExternalTargets(editor.settings);
var insertLink = $_f77mtqg0jnlpb21y.link(editor, attachState);
var removeLink = $_f77mtqg0jnlpb21y.unlink(editor);
var resultData = global$4.extend({}, data, e.data);
var href = resultData.href;
if (!href) {
removeLink();
return;
}
if (!onlyText || resultData.text === initialText) {
delete resultData.text;
}
if (href.indexOf('@') > 0 && href.indexOf('//') === -1 && href.indexOf('mailto:') === -1) {
delayedConfirm(editor, 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?', function (state) {
if (state) {
resultData.href = 'mailto:' + href;
}
insertLink(resultData);
});
return;
}
if (assumeExternalTargets === true && !/^\w+:/i.test(href) || assumeExternalTargets === false && /^\s*www[\.|\d\.]/i.test(href)) {
delayedConfirm(editor, 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', function (state) {
if (state) {
resultData.href = 'http://' + href;
}
insertLink(resultData);
});
return;
}
insertLink(resultData);
}
});
};
var open$1 = function (editor) {
createLinkList(editor, showDialog);
};
var $_26z4c1g2jnlpb223 = { open: open$1 };
var getLink = function (editor, elm) {
return editor.dom.getParent(elm, 'a[href]');
};
var getSelectedLink = function (editor) {
return getLink(editor, editor.selection.getStart());
};
var getHref = function (elm) {
var href = elm.getAttribute('data-mce-href');
return href ? href : elm.getAttribute('href');
};
var isContextMenuVisible = function (editor) {
var contextmenu = editor.plugins.contextmenu;
return contextmenu ? contextmenu.isContextMenuVisible() : false;
};
var hasOnlyAltModifier = function (e) {
return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;
};
var gotoLink = function (editor, a) {
if (a) {
var href = getHref(a);
if (/^#/.test(href)) {
var targetEl = editor.$(href);
if (targetEl.length) {
editor.selection.scrollIntoView(targetEl[0], true);
}
} else {
$_2sf6akfwjnlpb21g.open(a.href);
}
}
};
var openDialog = function (editor) {
return function () {
$_26z4c1g2jnlpb223.open(editor);
};
};
var gotoSelectedLink = function (editor) {
return function () {
gotoLink(editor, getSelectedLink(editor));
};
};
var leftClickedOnAHref = function (editor) {
return function (elm) {
var sel, rng, node;
if ($_bau5ogfvjnlpb21f.hasContextToolbar(editor.settings) && !isContextMenuVisible(editor) && $_f77mtqg0jnlpb21y.isLink(elm)) {
sel = editor.selection;
rng = sel.getRng();
node = rng.startContainer;
if (node.nodeType === 3 && sel.isCollapsed() && rng.startOffset > 0 && rng.startOffset < node.data.length) {
return true;
}
}
return false;
};
};
var setupGotoLinks = function (editor) {
editor.on('click', function (e) {
var link = getLink(editor, e.target);
if (link && global$1.metaKeyPressed(e)) {
e.preventDefault();
gotoLink(editor, link);
}
});
editor.on('keydown', function (e) {
var link = getSelectedLink(editor);
if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) {
e.preventDefault();
gotoLink(editor, link);
}
});
};
var toggleActiveState = function (editor) {
return function () {
var self = this;
editor.on('nodechange', function (e) {
self.active(!editor.readonly && !!$_f77mtqg0jnlpb21y.getAnchorElement(editor, e.element));
});
};
};
var toggleViewLinkState = function (editor) {
return function () {
var self = this;
var toggleVisibility = function (e) {
if ($_f77mtqg0jnlpb21y.hasLinks(e.parents)) {
self.show();
} else {
self.hide();
}
};
if (!$_f77mtqg0jnlpb21y.hasLinks(editor.dom.getParents(editor.selection.getStart()))) {
self.hide();
}
editor.on('nodechange', toggleVisibility);
self.on('remove', function () {
editor.off('nodechange', toggleVisibility);
});
};
};
var $_gfdrd4ftjnlpb21b = {
openDialog: openDialog,
gotoSelectedLink: gotoSelectedLink,
leftClickedOnAHref: leftClickedOnAHref,
setupGotoLinks: setupGotoLinks,
toggleActiveState: toggleActiveState,
toggleViewLinkState: toggleViewLinkState
};
var register = function (editor) {
editor.addCommand('mceLink', $_gfdrd4ftjnlpb21b.openDialog(editor));
};
var $_arqtiifsjnlpb219 = { register: register };
var setup = function (editor) {
editor.addShortcut('Meta+K', '', $_gfdrd4ftjnlpb21b.openDialog(editor));
};
var $_agry27g5jnlpb22b = { setup: setup };
var setupButtons = function (editor) {
editor.addButton('link', {
active: false,
icon: 'link',
tooltip: 'Insert/edit link',
onclick: $_gfdrd4ftjnlpb21b.openDialog(editor),
onpostrender: $_gfdrd4ftjnlpb21b.toggleActiveState(editor)
});
editor.addButton('unlink', {
active: false,
icon: 'unlink',
tooltip: 'Remove link',
onclick: $_f77mtqg0jnlpb21y.unlink(editor),
onpostrender: $_gfdrd4ftjnlpb21b.toggleActiveState(editor)
});
if (editor.addContextToolbar) {
editor.addButton('openlink', {
icon: 'newtab',
tooltip: 'Open link',
onclick: $_gfdrd4ftjnlpb21b.gotoSelectedLink(editor)
});
}
};
var setupMenuItems = function (editor) {
editor.addMenuItem('openlink', {
text: 'Open link',
icon: 'newtab',
onclick: $_gfdrd4ftjnlpb21b.gotoSelectedLink(editor),
onPostRender: $_gfdrd4ftjnlpb21b.toggleViewLinkState(editor),
prependToContext: true
});
editor.addMenuItem('link', {
icon: 'link',
text: 'Link',
shortcut: 'Meta+K',
onclick: $_gfdrd4ftjnlpb21b.openDialog(editor),
stateSelector: 'a[href]',
context: 'insert',
prependToContext: true
});
editor.addMenuItem('unlink', {
icon: 'unlink',
text: 'Remove link',
onclick: $_f77mtqg0jnlpb21y.unlink(editor),
stateSelector: 'a[href]'
});
};
var setupContextToolbars = function (editor) {
if (editor.addContextToolbar) {
editor.addContextToolbar($_gfdrd4ftjnlpb21b.leftClickedOnAHref(editor), 'openlink | link unlink');
}
};
var $_33507lg6jnlpb22c = {
setupButtons: setupButtons,
setupMenuItems: setupMenuItems,
setupContextToolbars: setupContextToolbars
};
global.add('link', function (editor) {
$_33507lg6jnlpb22c.setupButtons(editor);
$_33507lg6jnlpb22c.setupMenuItems(editor);
$_33507lg6jnlpb22c.setupContextToolbars(editor);
$_gfdrd4ftjnlpb21b.setupGotoLinks(editor);
$_arqtiifsjnlpb219.register(editor);
$_agry27g5jnlpb22b.setup(editor);
});
function Plugin () {
}
return Plugin;
}());
})();
|
SVG.extend(SVG.Element, {
// Initialize local memory object
_memory: {}
// Remember arbitrary data
, remember: function(k, v) {
/* remember every item in an object individually */
if (typeof arguments[0] == 'object')
for (var v in k)
this.remember(v, k[v])
/* retrieve memory */
else if (arguments.length == 1)
return this._memory[k]
/* store memory */
else
this._memory[k] = v
return this
}
// Erase a given memory
, forget: function() {
if (arguments.length == 0)
this._memory = {}
else
for (var i = arguments.length - 1; i >= 0; i--)
delete this._memory[arguments[i]]
return this
}
})
|
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("vue"));
else if(typeof define === 'function' && define.amd)
define(["vue"], factory);
else if(typeof exports === 'object')
exports["Vuetify"] = factory(require("vue"));
else
root["Vuetify"] = factory(root["Vue"]);
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_vue__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/dist/";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./src/components/VAlert/VAlert.ts":
/*!*****************************************!*\
!*** ./src/components/VAlert/VAlert.ts ***!
\*****************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_alerts_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_alerts.styl */ "./src/stylus/components/_alerts.styl");
/* harmony import */ var _stylus_components_alerts_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_alerts_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _mixins_transitionable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/transitionable */ "./src/mixins/transitionable.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
// Styles
// Components
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_transitionable__WEBPACK_IMPORTED_MODULE_4__["default"]).extend({
name: 'v-alert',
props: {
dismissible: Boolean,
icon: String,
outline: Boolean,
type: {
type: String,
validator: function validator(val) {
return ['info', 'error', 'success', 'warning'].includes(val);
}
}
},
data: function data() {
return {
defaultColor: 'error'
};
},
computed: {
classes: function classes() {
var color = this.type && !this.color ? this.type : this.computedColor;
var classes = {
'v-alert--outline': this.outline
};
return this.outline ? this.addTextColorClassChecks(classes, color) : this.addBackgroundColorClassChecks(classes, color);
},
computedIcon: function computedIcon() {
if (this.icon || !this.type) return this.icon;
switch (this.type) {
case 'info':
return '$vuetify.icons.info';
case 'error':
return '$vuetify.icons.error';
case 'success':
return '$vuetify.icons.success';
case 'warning':
return '$vuetify.icons.warning';
}
}
},
render: function render(h) {
var _this = this;
var children = [h('div', this.$slots.default)];
if (this.computedIcon) {
children.unshift(h(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], {
'class': 'v-alert__icon'
}, this.computedIcon));
}
if (this.dismissible) {
var close = h('a', {
'class': 'v-alert__dismissible',
on: { click: function click() {
_this.isActive = false;
} }
}, [h(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], {
props: {
right: true
}
}, '$vuetify.icons.cancel')]);
children.push(close);
}
var alert = h('div', {
staticClass: 'v-alert',
'class': this.classes,
directives: [{
name: 'show',
value: this.isActive
}],
on: this.$listeners
}, children);
if (!this.transition) return alert;
return h('transition', {
props: {
name: this.transition,
origin: this.origin,
mode: this.mode
}
}, [alert]);
}
}));
/***/ }),
/***/ "./src/components/VAlert/index.ts":
/*!****************************************!*\
!*** ./src/components/VAlert/index.ts ***!
\****************************************/
/*! exports provided: VAlert, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VAlert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAlert */ "./src/components/VAlert/VAlert.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAlert", function() { return _VAlert__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VAlert__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VAlert__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VAlert__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VAlert__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VApp/VApp.js":
/*!*************************************!*\
!*** ./src/components/VApp/VApp.js ***!
\*************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_app_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_app.styl */ "./src/stylus/components/_app.styl");
/* harmony import */ var _stylus_components_app_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_app_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_app_theme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mixins/app-theme */ "./src/components/VApp/mixins/app-theme.js");
/* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize.ts");
// Component level mixins
// Directives
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-app',
directives: {
Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_2__["default"]
},
mixins: [_mixins_app_theme__WEBPACK_IMPORTED_MODULE_1__["default"]],
props: {
id: {
type: String,
default: 'app'
},
dark: Boolean
},
computed: {
classes: function classes() {
var _a;
return _a = {}, _a["theme--" + (this.dark ? 'dark' : 'light')] = true, _a['application--is-rtl'] = this.$vuetify.rtl, _a;
}
},
watch: {
dark: function dark() {
this.$vuetify.dark = this.dark;
}
},
mounted: function mounted() {
this.$vuetify.dark = this.dark;
},
render: function render(h) {
var data = {
staticClass: 'application',
'class': this.classes,
attrs: { 'data-app': true },
domProps: { id: this.id }
};
var wrapper = h('div', { staticClass: 'application--wrap' }, this.$slots.default);
return h('div', data, [wrapper]);
}
});
/***/ }),
/***/ "./src/components/VApp/index.js":
/*!**************************************!*\
!*** ./src/components/VApp/index.js ***!
\**************************************/
/*! exports provided: VApp, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VApp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VApp */ "./src/components/VApp/VApp.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VApp", function() { return _VApp__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VApp__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VApp__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VApp__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VApp__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VApp/mixins/app-theme.js":
/*!*************************************************!*\
!*** ./src/components/VApp/mixins/app-theme.js ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_colorUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/colorUtils */ "./src/util/colorUtils.ts");
/* harmony import */ var _util_theme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util/theme */ "./src/util/theme.ts");
/* harmony default export */ __webpack_exports__["default"] = ({
data: function data() {
return {
style: null
};
},
computed: {
parsedTheme: function parsedTheme() {
return _util_theme__WEBPACK_IMPORTED_MODULE_1__["parse"](this.$vuetify.theme);
},
/** @return string */
generatedStyles: function generatedStyles() {
var theme = this.parsedTheme;
var css;
if (this.$vuetify.options.themeCache != null) {
css = this.$vuetify.options.themeCache.get(theme);
if (css != null) return css;
}
var colors = Object.keys(theme);
if (!colors.length) return '';
css = "a { color: " + Object(_util_colorUtils__WEBPACK_IMPORTED_MODULE_0__["intToHex"])(theme.primary) + "; }";
for (var i = 0; i < colors.length; ++i) {
var name = colors[i];
var value = theme[name];
if (this.$vuetify.options.themeVariations.includes(name)) {
css += _util_theme__WEBPACK_IMPORTED_MODULE_1__["genVariations"](name, value).join('');
} else {
css += _util_theme__WEBPACK_IMPORTED_MODULE_1__["genBaseColor"](name, value);
}
}
if (this.$vuetify.options.minifyTheme != null) {
css = this.$vuetify.options.minifyTheme(css);
}
if (this.$vuetify.options.themeCache != null) {
this.$vuetify.options.themeCache.set(theme, css);
}
return css;
},
vueMeta: function vueMeta() {
if (this.$vuetify.theme === false) return {};
var options = {
cssText: this.generatedStyles,
id: 'vuetify-theme-stylesheet',
type: 'text/css'
};
if (this.$vuetify.options.cspNonce) {
options.nonce = this.$vuetify.options.cspNonce;
}
return {
style: [options]
};
}
},
// Regular vue-meta
metaInfo: function metaInfo() {
return this.vueMeta;
},
// Nuxt
head: function head() {
return this.vueMeta;
},
watch: {
generatedStyles: function generatedStyles() {
!this.meta && this.applyTheme();
}
},
created: function created() {
if (this.$vuetify.theme === false) return;
if (this.$meta) {
// Vue-meta
// Handled by metaInfo()/nuxt()
} else if (typeof document === 'undefined' && this.$ssrContext) {
// SSR
var nonce = this.$vuetify.options.cspNonce ? " nonce=\"" + this.$vuetify.options.cspNonce + "\"" : '';
this.$ssrContext.head = this.$ssrContext.head || '';
this.$ssrContext.head += "<style type=\"text/css\" id=\"vuetify-theme-stylesheet\"" + nonce + ">" + this.generatedStyles + "</style>";
} else if (typeof document !== 'undefined') {
// Client-side
this.genStyle();
this.applyTheme();
}
},
methods: {
applyTheme: function applyTheme() {
if (this.style) this.style.innerHTML = this.generatedStyles;
},
genStyle: function genStyle() {
var style = document.getElementById('vuetify-theme-stylesheet');
if (!style) {
style = document.createElement('style');
style.type = 'text/css';
style.id = 'vuetify-theme-stylesheet';
if (this.$vuetify.options.cspNonce) {
style.setAttribute('nonce', this.$vuetify.options.cspNonce);
}
document.head.appendChild(style);
}
this.style = style;
}
}
});
/***/ }),
/***/ "./src/components/VAutocomplete/VAutocomplete.js":
/*!*******************************************************!*\
!*** ./src/components/VAutocomplete/VAutocomplete.js ***!
\*******************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_autocompletes_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_autocompletes.styl */ "./src/stylus/components/_autocompletes.styl");
/* harmony import */ var _stylus_components_autocompletes_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_autocompletes_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSelect/VSelect */ "./src/components/VSelect/VSelect.js");
/* harmony import */ var _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VTextField/VTextField */ "./src/components/VTextField/VTextField.js");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
// Styles
// Extensions
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-autocomplete',
extends: _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"],
props: {
allowOverflow: {
type: Boolean,
default: true
},
browserAutocomplete: {
type: String,
default: 'off'
},
filter: {
type: Function,
default: function _default(item, queryText, itemText) {
var hasValue = function hasValue(val) {
return val != null ? val : '';
};
var text = hasValue(itemText);
var query = hasValue(queryText);
return text.toString().toLowerCase().indexOf(query.toString().toLowerCase()) > -1;
}
},
hideNoData: Boolean,
noFilter: Boolean,
offsetY: {
type: Boolean,
default: true
},
offsetOverflow: {
type: Boolean,
default: true
},
searchInput: {
default: undefined
},
transition: {
type: [Boolean, String],
default: false
}
},
data: function data(vm) {
return {
attrsInput: null,
lazySearch: vm.searchInput
};
},
computed: {
classes: function classes() {
return Object.assign({}, _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].computed.classes.call(this), {
'v-autocomplete': true,
'v-autocomplete--is-selecting-index': this.selectedIndex > -1
});
},
computedItems: function computedItems() {
return this.filteredItems;
},
displayedItemsCount: function displayedItemsCount() {
return this.hideSelected ? this.filteredItems.length - this.selectedItems.length : this.filteredItems.length;
},
/**
* The range of the current input text
*
* @return {Number}
*/
currentRange: function currentRange() {
if (this.selectedItem == null) return 0;
return this.getText(this.selectedItem).toString().length;
},
filteredItems: function filteredItems() {
var _this = this;
if (!this.isSearching || this.noFilter) return this.allItems;
return this.allItems.filter(function (i) {
return _this.filter(i, _this.internalSearch, _this.getText(i));
});
},
internalSearch: {
get: function get() {
return this.lazySearch;
},
set: function set(val) {
this.lazySearch = val;
this.$emit('update:searchInput', val);
}
},
isAnyValueAllowed: function isAnyValueAllowed() {
return false;
},
isDirty: function isDirty() {
return this.searchIsDirty || this.selectedItems.length > 0;
},
isSearching: function isSearching() {
if (this.multiple) return this.searchIsDirty;
return this.searchIsDirty && this.internalSearch !== this.getText(this.selectedItem);
},
menuCanShow: function menuCanShow() {
if (!this.isFocused) return false;
return this.displayedItemsCount > 0 || !this.hideNoData;
},
menuProps: function menuProps() {
return Object.assign(_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].computed.menuProps.call(this), {
contentClass: ("v-autocomplete__content " + (this.contentClass || '')).trim(),
value: this.menuCanShow && this.isMenuActive
});
},
searchIsDirty: function searchIsDirty() {
return this.internalSearch != null && this.internalSearch !== '';
},
selectedItem: function selectedItem() {
var _this = this;
if (this.multiple) return null;
return this.selectedItems.find(function (i) {
return _this.valueComparator(_this.getValue(i), _this.getValue(_this.internalValue));
});
},
listData: function listData() {
var data = _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].computed.listData.call(this);
Object.assign(data.props, {
items: this.virtualizedItems,
noFilter: this.noFilter || !this.isSearching || !this.filteredItems.length,
searchInput: this.internalSearch
});
return data;
}
},
watch: {
filteredItems: function filteredItems(val) {
this.onFilteredItemsChanged(val);
},
internalValue: function internalValue() {
this.setSearch();
},
isFocused: function isFocused(val) {
if (val) {
this.$refs.input && this.$refs.input.select();
} else {
this.updateSelf();
}
},
isMenuActive: function isMenuActive(val) {
if (val || !this.hasSlot) return;
this.lazySearch = null;
},
items: function items(val) {
// If we are focused, the menu
// is not active and items change
// User is probably async loading
// items, try to activate the menu
if (this.isFocused && !this.isMenuActive && val.length) this.activateMenu();
},
searchInput: function searchInput(val) {
this.lazySearch = val;
},
internalSearch: function internalSearch(val) {
this.onInternalSearchChanged(val);
}
},
created: function created() {
this.setSearch();
},
methods: {
onFilteredItemsChanged: function onFilteredItemsChanged(val) {
var _this = this;
this.setMenuIndex(-1);
this.$nextTick(function () {
_this.setMenuIndex(val.length === 1 ? 0 : -1);
});
},
onInternalSearchChanged: function onInternalSearchChanged(val) {
this.updateMenuDimensions();
},
updateMenuDimensions: function updateMenuDimensions() {
if (this.isMenuActive && this.$refs.menu) {
this.$refs.menu.updateDimensions();
}
},
changeSelectedIndex: function changeSelectedIndex(keyCode) {
// Do not allow changing of selectedIndex
// when search is dirty
if (this.searchIsDirty) return;
if (![_util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].backspace, _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].left, _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].right, _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].delete].includes(keyCode)) return;
var indexes = this.selectedItems.length - 1;
if (keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].left) {
this.selectedIndex = this.selectedIndex === -1 ? indexes : this.selectedIndex - 1;
} else if (keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].right) {
this.selectedIndex = this.selectedIndex >= indexes ? -1 : this.selectedIndex + 1;
} else if (this.selectedIndex === -1) {
this.selectedIndex = indexes;
return;
}
var currentItem = this.selectedItems[this.selectedIndex];
if ([_util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].backspace, _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].delete].includes(keyCode) && !this.getDisabled(currentItem)) {
var newIndex = this.selectedIndex === indexes ? this.selectedIndex - 1 : this.selectedItems[this.selectedIndex + 1] ? this.selectedIndex : -1;
if (newIndex === -1) {
this.internalValue = this.multiple ? [] : undefined;
} else {
this.selectItem(currentItem);
}
this.selectedIndex = newIndex;
}
},
clearableCallback: function clearableCallback() {
this.internalSearch = undefined;
_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.clearableCallback.call(this);
},
genInput: function genInput() {
var input = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_2__["default"].methods.genInput.call(this);
input.data.attrs.role = 'combobox';
input.data.domProps.value = this.internalSearch;
return input;
},
genSelections: function genSelections() {
return this.hasSlot || this.multiple ? _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.genSelections.call(this) : [];
},
onClick: function onClick() {
if (this.isDisabled) return;
this.selectedIndex > -1 ? this.selectedIndex = -1 : this.onFocus();
this.activateMenu();
},
onEnterDown: function onEnterDown() {
// Avoid invoking this method
// will cause updateSelf to
// be called emptying search
},
onInput: function onInput(e) {
if (this.selectedIndex > -1) return;
// If typing and menu is not currently active
if (e.target.value) {
this.activateMenu();
if (!this.isAnyValueAllowed) this.setMenuIndex(0);
}
this.mask && this.resetSelections(e.target);
this.internalSearch = e.target.value;
this.badInput = e.target.validity && e.target.validity.badInput;
},
onKeyDown: function onKeyDown(e) {
var keyCode = e.keyCode;
_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.onKeyDown.call(this, e);
// The ordering is important here
// allows new value to be updated
// and then moves the index to the
// proper location
this.changeSelectedIndex(keyCode);
},
onTabDown: function onTabDown(e) {
_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.onTabDown.call(this, e);
this.updateSelf();
},
selectItem: function selectItem(item) {
_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.selectItem.call(this, item);
this.setSearch();
},
setSelectedItems: function setSelectedItems() {
_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.setSelectedItems.call(this);
// #4273 Don't replace if searching
// #4403 Don't replace if focused
if (!this.isFocused) this.setSearch();
},
setSearch: function setSearch() {
var _this = this;
// Wait for nextTick so selectedItem
// has had time to update
this.$nextTick(function () {
_this.internalSearch = !_this.selectedItem || _this.multiple || _this.hasSlot ? null : _this.getText(_this.selectedItem);
});
},
setValue: function setValue() {
this.internalValue = this.internalSearch;
this.$emit('change', this.internalSearch);
},
updateSelf: function updateSelf() {
this.updateAutocomplete();
},
updateAutocomplete: function updateAutocomplete() {
if (!this.searchIsDirty && !this.internalValue) return;
if (!this.valueComparator(this.internalSearch, this.getValue(this.internalValue))) {
this.setSearch();
}
}
}
});
/***/ }),
/***/ "./src/components/VAutocomplete/index.js":
/*!***********************************************!*\
!*** ./src/components/VAutocomplete/index.js ***!
\***********************************************/
/*! exports provided: VAutocomplete, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VAutocomplete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAutocomplete */ "./src/components/VAutocomplete/VAutocomplete.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAutocomplete", function() { return _VAutocomplete__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VAutocomplete__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VAutocomplete__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VAutocomplete__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VAutocomplete__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VAvatar/VAvatar.ts":
/*!*******************************************!*\
!*** ./src/components/VAvatar/VAvatar.ts ***!
\*******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_avatars_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_avatars.styl */ "./src/stylus/components/_avatars.styl");
/* harmony import */ var _stylus_components_avatars_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_avatars_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
name: 'v-avatar',
functional: true,
props: {
// TODO: inherit these
color: String,
size: {
type: [Number, String],
default: 48
},
tile: Boolean
},
render: function render(h, _a) {
var data = _a.data,
props = _a.props,
children = _a.children;
data.staticClass = ("v-avatar " + (data.staticClass || '')).trim();
if (props.tile) data.staticClass += ' v-avatar--tile';
var size = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["convertToUnit"])(props.size);
data.style = __assign({ height: size, width: size }, data.style);
data.class = [data.class, _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.addBackgroundColorClassChecks.call(props, {}, props.color)];
return h('div', data, children);
}
}));
/***/ }),
/***/ "./src/components/VAvatar/index.ts":
/*!*****************************************!*\
!*** ./src/components/VAvatar/index.ts ***!
\*****************************************/
/*! exports provided: VAvatar, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VAvatar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VAvatar */ "./src/components/VAvatar/VAvatar.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAvatar", function() { return _VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VBadge/VBadge.ts":
/*!*****************************************!*\
!*** ./src/components/VBadge/VBadge.ts ***!
\*****************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_badges_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_badges.styl */ "./src/stylus/components/_badges.styl");
/* harmony import */ var _stylus_components_badges_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_badges_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _mixins_positionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/positionable */ "./src/mixins/positionable.ts");
/* harmony import */ var _mixins_transitionable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/transitionable */ "./src/mixins/transitionable.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
// Styles
// Mixins
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_mixins_positionable__WEBPACK_IMPORTED_MODULE_3__["factory"])(['left', 'bottom']), _mixins_transitionable__WEBPACK_IMPORTED_MODULE_4__["default"]
/* @vue/component */
).extend({
name: 'v-badge',
props: {
color: {
type: String,
default: 'primary'
},
overlap: Boolean,
transition: {
type: String,
default: 'fab-transition'
},
value: {
default: true
}
},
computed: {
classes: function classes() {
return {
'v-badge--bottom': this.bottom,
'v-badge--left': this.left,
'v-badge--overlap': this.overlap
};
}
},
render: function render(h) {
var badge = this.$slots.badge ? [h('span', {
staticClass: 'v-badge__badge',
'class': this.addBackgroundColorClassChecks(),
attrs: this.$attrs,
directives: [{
name: 'show',
value: this.isActive
}]
}, this.$slots.badge)] : undefined;
return h('span', {
staticClass: 'v-badge',
'class': this.classes
}, [this.$slots.default, h('transition', {
props: {
name: this.transition,
origin: this.origin,
mode: this.mode
}
}, badge)]);
}
}));
/***/ }),
/***/ "./src/components/VBadge/index.ts":
/*!****************************************!*\
!*** ./src/components/VBadge/index.ts ***!
\****************************************/
/*! exports provided: VBadge, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VBadge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBadge */ "./src/components/VBadge/VBadge.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBadge", function() { return _VBadge__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VBadge__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VBadge__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VBadge__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VBadge__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VBottomNav/VBottomNav.ts":
/*!*************************************************!*\
!*** ./src/components/VBottomNav/VBottomNav.ts ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_bottom_navs_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_bottom-navs.styl */ "./src/stylus/components/_bottom-navs.styl");
/* harmony import */ var _stylus_components_bottom_navs_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_bottom_navs_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/applicationable */ "./src/mixins/applicationable.ts");
/* harmony import */ var _mixins_button_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/button-group */ "./src/mixins/button-group.ts");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
// Styles
// Mixins
// Util
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__["default"])('bottom', ['height', 'value']), _mixins_button_group__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"]
/* @vue/component */
).extend({
name: 'v-bottom-nav',
props: {
active: [Number, String],
height: {
default: 56,
type: [Number, String],
validator: function validator(v) {
return !isNaN(parseInt(v));
}
},
shift: Boolean,
value: null
},
computed: {
classes: function classes() {
return {
'v-bottom-nav--absolute': this.absolute,
'v-bottom-nav--fixed': !this.absolute && (this.app || this.fixed),
'v-bottom-nav--shift': this.shift,
'v-bottom-nav--active': this.value
};
},
computedHeight: function computedHeight() {
return parseInt(this.height);
}
},
watch: {
active: function active() {
this.update();
}
},
methods: {
isSelected: function isSelected(i) {
var item = this.getValue(i);
return this.active === item;
},
updateApplication: function updateApplication() {
return !this.value ? 0 : this.computedHeight;
},
updateValue: function updateValue(i) {
var item = this.getValue(i);
this.$emit('update:active', item);
}
},
render: function render(h) {
return h('div', {
staticClass: 'v-bottom-nav',
class: this.addBackgroundColorClassChecks(this.classes),
style: {
height: parseInt(this.computedHeight) + "px"
},
ref: 'content'
}, this.$slots.default);
}
}));
/***/ }),
/***/ "./src/components/VBottomNav/index.ts":
/*!********************************************!*\
!*** ./src/components/VBottomNav/index.ts ***!
\********************************************/
/*! exports provided: VBottomNav, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VBottomNav__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBottomNav */ "./src/components/VBottomNav/VBottomNav.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBottomNav", function() { return _VBottomNav__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VBottomNav__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VBottomNav__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VBottomNav__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VBottomNav__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VBottomSheet/VBottomSheet.js":
/*!*****************************************************!*\
!*** ./src/components/VBottomSheet/VBottomSheet.js ***!
\*****************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_bottom_sheets_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_bottom-sheets.styl */ "./src/stylus/components/_bottom-sheets.styl");
/* harmony import */ var _stylus_components_bottom_sheets_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_bottom_sheets_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VDialog_VDialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VDialog/VDialog */ "./src/components/VDialog/VDialog.js");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-bottom-sheet',
props: {
disabled: Boolean,
fullWidth: Boolean,
hideOverlay: Boolean,
inset: Boolean,
lazy: Boolean,
maxWidth: {
type: [String, Number],
default: 'auto'
},
persistent: Boolean,
value: null
},
render: function render(h) {
var activator = h('template', {
slot: 'activator'
}, this.$slots.activator);
var contentClass = ['v-bottom-sheet', this.inset ? 'v-bottom-sheet--inset' : ''].join(' ');
return h(_VDialog_VDialog__WEBPACK_IMPORTED_MODULE_1__["default"], {
attrs: __assign({}, this.$props),
on: __assign({}, this.$listeners),
props: {
contentClass: contentClass,
noClickAnimation: true,
transition: 'bottom-sheet-transition',
value: this.value
}
}, [activator, this.$slots.default]);
}
});
/***/ }),
/***/ "./src/components/VBottomSheet/index.js":
/*!**********************************************!*\
!*** ./src/components/VBottomSheet/index.js ***!
\**********************************************/
/*! exports provided: VBottomSheet, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VBottomSheet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBottomSheet */ "./src/components/VBottomSheet/VBottomSheet.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBottomSheet", function() { return _VBottomSheet__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VBottomSheet__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VBottomSheet__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VBottomSheet__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VBottomSheet__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VBreadcrumbs/VBreadcrumbs.js":
/*!*****************************************************!*\
!*** ./src/components/VBreadcrumbs/VBreadcrumbs.js ***!
\*****************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_breadcrumbs_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_breadcrumbs.styl */ "./src/stylus/components/_breadcrumbs.styl");
/* harmony import */ var _stylus_components_breadcrumbs_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_breadcrumbs_styl__WEBPACK_IMPORTED_MODULE_0__);
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-breadcrumbs',
props: {
divider: {
type: String,
default: '/'
},
large: Boolean,
justifyCenter: Boolean,
justifyEnd: Boolean
},
computed: {
classes: function classes() {
return {
'v-breadcrumbs--large': this.large
};
},
computedDivider: function computedDivider() {
return this.$slots.divider ? this.$slots.divider : this.divider;
},
styles: function styles() {
var justify = this.justifyCenter ? 'center' : this.justifyEnd ? 'flex-end' : 'flex-start';
return {
'justify-content': justify
};
}
},
methods: {
/**
* Add dividers between
* v-breadcrumbs-item
*
* @return {array}
*/
genChildren: function genChildren() {
if (!this.$slots.default) return null;
var h = this.$createElement;
var children = [];
var dividerData = { staticClass: 'v-breadcrumbs__divider' };
var createDividers = false;
for (var i = 0; i < this.$slots.default.length; i++) {
var elm = this.$slots.default[i];
if (!elm.componentOptions || elm.componentOptions.Ctor.options.name !== 'v-breadcrumbs-item') {
children.push(elm);
} else {
if (createDividers) {
children.push(h('li', dividerData, this.computedDivider));
}
children.push(elm);
createDividers = true;
}
}
return children;
}
},
render: function render(h) {
return h('ul', {
staticClass: 'v-breadcrumbs',
'class': this.classes,
style: this.styles
}, this.genChildren());
}
});
/***/ }),
/***/ "./src/components/VBreadcrumbs/VBreadcrumbsItem.js":
/*!*********************************************************!*\
!*** ./src/components/VBreadcrumbs/VBreadcrumbsItem.js ***!
\*********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable.ts");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-breadcrumbs-item',
mixins: [_mixins_routable__WEBPACK_IMPORTED_MODULE_0__["default"]],
props: {
// In a breadcrumb, the currently
// active item should be dimmed
activeClass: {
type: String,
default: 'v-breadcrumbs__item--disabled'
}
},
computed: {
classes: function classes() {
var _a;
return _a = {
'v-breadcrumbs__item': true
}, _a[this.activeClass] = this.disabled, _a;
}
},
render: function render(h) {
var _a = this.generateRouteLink(),
tag = _a.tag,
data = _a.data;
return h('li', [h(tag, data, this.$slots.default)]);
}
});
/***/ }),
/***/ "./src/components/VBreadcrumbs/index.js":
/*!**********************************************!*\
!*** ./src/components/VBreadcrumbs/index.js ***!
\**********************************************/
/*! exports provided: VBreadcrumbs, VBreadcrumbsItem, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBreadcrumbs */ "./src/components/VBreadcrumbs/VBreadcrumbs.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBreadcrumbs", function() { return _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _VBreadcrumbsItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VBreadcrumbsItem */ "./src/components/VBreadcrumbs/VBreadcrumbsItem.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBreadcrumbsItem", function() { return _VBreadcrumbsItem__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* istanbul ignore next */
_VBreadcrumbs__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VBreadcrumbs__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_0__["default"]);
Vue.component(_VBreadcrumbsItem__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VBreadcrumbsItem__WEBPACK_IMPORTED_MODULE_1__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VBreadcrumbs__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VBtn/VBtn.ts":
/*!*************************************!*\
!*** ./src/components/VBtn/VBtn.ts ***!
\*************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_buttons_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_buttons.styl */ "./src/stylus/components/_buttons.styl");
/* harmony import */ var _stylus_components_buttons_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_buttons_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
/* harmony import */ var _VProgressCircular__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VProgressCircular */ "./src/components/VProgressCircular/index.ts");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_positionable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/positionable */ "./src/mixins/positionable.ts");
/* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Styles
// Components
// Mixins
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_routable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_positionable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_mixins_toggleable__WEBPACK_IMPORTED_MODULE_7__["factory"])('inputValue'), Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_8__["inject"])('buttonGroup')
/* @vue/component */
).extend({
name: 'v-btn',
props: {
activeClass: {
type: String,
default: 'v-btn--active'
},
block: Boolean,
depressed: Boolean,
fab: Boolean,
flat: Boolean,
icon: Boolean,
large: Boolean,
loading: Boolean,
outline: Boolean,
ripple: {
type: [Boolean, Object],
default: true
},
round: Boolean,
small: Boolean,
tag: {
type: String,
default: 'button'
},
type: {
type: String,
default: 'button'
},
value: null
},
computed: {
classes: function classes() {
var _a;
var classes = __assign((_a = { 'v-btn': true }, _a[this.activeClass] = this.isActive, _a['v-btn--absolute'] = this.absolute, _a['v-btn--block'] = this.block, _a['v-btn--bottom'] = this.bottom, _a['v-btn--disabled'] = this.disabled, _a['v-btn--flat'] = this.flat, _a['v-btn--floating'] = this.fab, _a['v-btn--fixed'] = this.fixed, _a['v-btn--icon'] = this.icon, _a['v-btn--large'] = this.large, _a['v-btn--left'] = this.left, _a['v-btn--loader'] = this.loading, _a['v-btn--outline'] = this.outline, _a['v-btn--depressed'] = this.depressed && !this.flat || this.outline, _a['v-btn--right'] = this.right, _a['v-btn--round'] = this.round, _a['v-btn--router'] = this.to, _a['v-btn--small'] = this.small, _a['v-btn--top'] = this.top, _a), this.themeClasses);
return !this.outline && !this.flat ? this.addBackgroundColorClassChecks(classes) : this.addTextColorClassChecks(classes);
}
},
mounted: function mounted() {
if (this.buttonGroup) {
this.buttonGroup.register(this);
}
},
beforeDestroy: function beforeDestroy() {
if (this.buttonGroup) {
this.buttonGroup.unregister(this);
}
},
methods: {
// Prevent focus to match md spec
click: function click(e) {
!this.fab && e.detail && this.$el.blur();
this.$emit('click', e);
},
genContent: function genContent() {
return this.$createElement('div', { 'class': 'v-btn__content' }, [this.$slots.default]);
},
genLoader: function genLoader() {
var children = [];
if (!this.$slots.loader) {
children.push(this.$createElement(_VProgressCircular__WEBPACK_IMPORTED_MODULE_2__["default"], {
props: {
indeterminate: true,
size: 26,
width: 2
}
}));
} else {
children.push(this.$slots.loader);
}
return this.$createElement('span', { 'class': 'v-btn__loading' }, children);
}
},
render: function render(h) {
var _a = this.generateRouteLink(),
tag = _a.tag,
data = _a.data;
var children = [this.genContent()];
tag === 'button' && (data.attrs.type = this.type);
this.loading && children.push(this.genLoader());
data.attrs.value = ['string', 'number'].includes(_typeof(this.value)) ? this.value : JSON.stringify(this.value);
return h(tag, data, children);
}
}));
/***/ }),
/***/ "./src/components/VBtn/index.ts":
/*!**************************************!*\
!*** ./src/components/VBtn/index.ts ***!
\**************************************/
/*! exports provided: VBtn, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBtn */ "./src/components/VBtn/VBtn.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBtn", function() { return _VBtn__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VBtn__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VBtn__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VBtn__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VBtn__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VBtnToggle/VBtnToggle.ts":
/*!*************************************************!*\
!*** ./src/components/VBtnToggle/VBtnToggle.ts ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_button_toggle_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_button-toggle.styl */ "./src/stylus/components/_button-toggle.styl");
/* harmony import */ var _stylus_components_button_toggle_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_button_toggle_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
/* harmony import */ var _mixins_button_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/button-group */ "./src/mixins/button-group.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
// Mixins
// Util
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(_mixins_button_group__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]).extend({
name: 'v-btn-toggle',
model: {
prop: 'inputValue',
event: 'change'
},
props: {
inputValue: {
required: false
},
mandatory: Boolean,
multiple: Boolean
},
computed: {
classes: function classes() {
return {
'v-btn-toggle': true,
'v-btn-toggle--selected': this.hasValue,
'theme--light': this.light,
'theme--dark': this.dark
};
},
hasValue: function hasValue() {
return this.multiple && this.inputValue.length || !this.multiple && this.inputValue !== null && typeof this.inputValue !== 'undefined';
}
},
watch: {
inputValue: {
handler: function handler() {
this.update();
},
deep: true
}
},
created: function created() {
if (this.multiple && !Array.isArray(this.inputValue)) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_4__["consoleWarn"])('Model must be bound to an array if the multiple property is true.', this);
}
},
methods: {
isSelected: function isSelected(i) {
var item = this.getValue(i);
if (!this.multiple) {
return this.inputValue === item;
}
return this.inputValue.includes(item);
},
updateValue: function updateValue(i) {
var item = this.getValue(i);
if (!this.multiple) {
if (this.mandatory && this.inputValue === item) return;
this.$emit('change', this.inputValue === item ? null : item);
return;
}
var items = this.inputValue.slice();
var index = items.indexOf(item);
if (index > -1) {
if (this.mandatory && items.length === 1) return;
items.length >= 1 && items.splice(index, 1);
} else {
items.push(item);
}
this.$emit('change', items);
},
updateAllValues: function updateAllValues() {
if (!this.multiple) return;
var items = [];
for (var i = 0; i < this.buttons.length; ++i) {
var item = this.getValue(i);
var index = this.inputValue.indexOf(item);
if (index !== -1) {
items.push(item);
}
}
this.$emit('change', items);
}
},
render: function render(h) {
return h('div', { class: this.classes }, this.$slots.default);
}
}));
/***/ }),
/***/ "./src/components/VBtnToggle/index.ts":
/*!********************************************!*\
!*** ./src/components/VBtnToggle/index.ts ***!
\********************************************/
/*! exports provided: VBtnToggle, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VBtnToggle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VBtnToggle */ "./src/components/VBtnToggle/VBtnToggle.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBtnToggle", function() { return _VBtnToggle__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VBtnToggle__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VBtnToggle__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VBtnToggle__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VBtnToggle__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VCard/VCard.ts":
/*!***************************************!*\
!*** ./src/components/VCard/VCard.ts ***!
\***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_cards_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_cards.styl */ "./src/stylus/components/_cards.styl");
/* harmony import */ var _stylus_components_cards_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_cards_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
// Mixins
// Helpers
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_5__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_routable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]).extend({
name: 'v-card',
props: {
flat: Boolean,
height: [Number, String],
hover: Boolean,
img: String,
raised: Boolean,
tag: {
type: String,
default: 'div'
},
tile: Boolean,
width: [String, Number]
},
computed: {
classes: function classes() {
return this.addBackgroundColorClassChecks({
'v-card': true,
'v-card--flat': this.flat,
'v-card--hover': this.hover,
'v-card--raised': this.raised,
'v-card--tile': this.tile,
'theme--light': this.light,
'theme--dark': this.dark
});
},
styles: function styles() {
var style = {
height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.height)
};
if (this.img) {
style.background = "url(\"" + this.img + "\") center center / cover no-repeat";
}
if (this.width) {
style.width = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.width);
}
return style;
}
},
render: function render(h) {
var _a = this.generateRouteLink(),
tag = _a.tag,
data = _a.data;
data.style = this.styles;
return h(tag, data, this.$slots.default);
}
}));
/***/ }),
/***/ "./src/components/VCard/VCardMedia.ts":
/*!********************************************!*\
!*** ./src/components/VCard/VCardMedia.ts ***!
\********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
// Helpers
// Types
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_1___default.a.extend({
name: 'v-card-media',
props: {
contain: Boolean,
height: {
type: [Number, String],
default: 'auto'
},
src: {
type: String
}
},
render: function render(h) {
var data = {
'class': 'v-card__media',
style: {
height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["convertToUnit"])(this.height)
},
on: this.$listeners
};
var children = [];
if (this.src) {
children.push(h('div', {
'class': 'v-card__media__background',
style: {
background: "url(\"" + this.src + "\") center center / " + (this.contain ? 'contain' : 'cover') + " no-repeat"
}
}));
}
children.push(h('div', {
'class': 'v-card__media__content'
}, this.$slots.default));
return h('div', data, children);
}
}));
/***/ }),
/***/ "./src/components/VCard/VCardTitle.ts":
/*!********************************************!*\
!*** ./src/components/VCard/VCardTitle.ts ***!
\********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
// Types
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'v-card-title',
functional: true,
props: {
primaryTitle: Boolean
},
render: function render(h, _a) {
var data = _a.data,
props = _a.props,
children = _a.children;
data.staticClass = ("v-card__title " + (data.staticClass || '')).trim();
if (props.primaryTitle) data.staticClass += ' v-card__title--primary';
return h('div', data, children);
}
}));
/***/ }),
/***/ "./src/components/VCard/index.ts":
/*!***************************************!*\
!*** ./src/components/VCard/index.ts ***!
\***************************************/
/*! exports provided: VCard, VCardMedia, VCardTitle, VCardActions, VCardText, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VCardActions", function() { return VCardActions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VCardText", function() { return VCardText; });
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _VCard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VCard */ "./src/components/VCard/VCard.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCard", function() { return _VCard__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _VCardMedia__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VCardMedia */ "./src/components/VCard/VCardMedia.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCardMedia", function() { return _VCardMedia__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* harmony import */ var _VCardTitle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VCardTitle */ "./src/components/VCard/VCardTitle.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCardTitle", function() { return _VCardTitle__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_4__);
var VCardActions = vue__WEBPACK_IMPORTED_MODULE_4___default.a.extend(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-card__actions'));
var VCardText = vue__WEBPACK_IMPORTED_MODULE_4___default.a.extend(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-card__text'));
/* istanbul ignore next */
_VCard__WEBPACK_IMPORTED_MODULE_1__["default"].install = function install(Vue) {
Vue.component(_VCard__WEBPACK_IMPORTED_MODULE_1__["default"].options.name, _VCard__WEBPACK_IMPORTED_MODULE_1__["default"]);
Vue.component(_VCardMedia__WEBPACK_IMPORTED_MODULE_2__["default"].options.name, _VCardMedia__WEBPACK_IMPORTED_MODULE_2__["default"]);
Vue.component(_VCardTitle__WEBPACK_IMPORTED_MODULE_3__["default"].options.name, _VCardTitle__WEBPACK_IMPORTED_MODULE_3__["default"]);
Vue.component(VCardActions.options.name, VCardActions);
Vue.component(VCardText.options.name, VCardText);
};
/* harmony default export */ __webpack_exports__["default"] = (_VCard__WEBPACK_IMPORTED_MODULE_1__["default"]);
/***/ }),
/***/ "./src/components/VCarousel/VCarousel.js":
/*!***********************************************!*\
!*** ./src/components/VCarousel/VCarousel.js ***!
\***********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_carousel_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_carousel.styl */ "./src/stylus/components/_carousel.styl");
/* harmony import */ var _stylus_components_carousel_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_carousel_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch.ts");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-carousel',
directives: { Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_5__["default"] },
mixins: [_mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_4__["provide"])('carousel')],
props: {
cycle: {
type: Boolean,
default: true
},
delimiterIcon: {
type: String,
default: '$vuetify.icons.delimiter'
},
hideControls: Boolean,
hideDelimiters: Boolean,
interval: {
type: [Number, String],
default: 6000,
validator: function validator(value) {
return value > 0;
}
},
nextIcon: {
type: [Boolean, String],
default: '$vuetify.icons.next'
},
prevIcon: {
type: [Boolean, String],
default: '$vuetify.icons.prev'
},
value: Number
},
data: function data() {
return {
inputValue: null,
items: [],
slideTimeout: null,
reverse: false
};
},
watch: {
items: function items() {
if (this.inputValue >= this.items.length) {
this.inputValue = this.items.length - 1;
}
},
inputValue: function inputValue() {
// Evaluates items when inputValue changes to
// account for dynamic changing of children
var uid = (this.items[this.inputValue] || {}).uid;
for (var index = this.items.length; --index >= 0;) {
this.items[index].open(uid, this.reverse);
}
this.$emit('input', this.inputValue);
this.restartTimeout();
},
value: function value(val) {
this.inputValue = val;
},
interval: function interval() {
this.restartTimeout();
},
cycle: function cycle(val) {
if (val) {
this.restartTimeout();
} else {
clearTimeout(this.slideTimeout);
this.slideTimeout = null;
}
}
},
mounted: function mounted() {
this.init();
},
methods: {
genDelimiters: function genDelimiters() {
return this.$createElement('div', {
staticClass: 'v-carousel__controls'
}, this.genItems());
},
genIcon: function genIcon(direction, icon, fn) {
if (!icon) return null;
return this.$createElement('div', {
staticClass: "v-carousel__" + direction
}, [this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_1__["default"], {
props: {
icon: true,
dark: this.dark || !this.light,
light: this.light
},
on: { click: fn }
}, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], {
props: { 'size': '46px' }
}, icon)])]);
},
genItems: function genItems() {
var _this = this;
return this.items.map(function (item, index) {
return _this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_1__["default"], {
class: {
'v-carousel__controls__item': true,
'v-carousel__controls__item--active': index === _this.inputValue
},
props: {
icon: true,
small: true,
dark: _this.dark || !_this.light,
light: _this.light
},
key: index,
on: { click: _this.select.bind(_this, index) }
}, [_this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], {
props: { size: '18px' }
}, _this.delimiterIcon)]);
});
},
restartTimeout: function restartTimeout() {
this.slideTimeout && clearTimeout(this.slideTimeout);
this.slideTimeout = null;
var raf = requestAnimationFrame || setTimeout;
raf(this.startTimeout);
},
init: function init() {
this.inputValue = this.value || 0;
},
next: function next() {
this.reverse = false;
this.inputValue = (this.inputValue + 1) % this.items.length;
},
prev: function prev() {
this.reverse = true;
this.inputValue = (this.inputValue + this.items.length - 1) % this.items.length;
},
select: function select(index) {
this.reverse = index < this.inputValue;
this.inputValue = index;
},
startTimeout: function startTimeout() {
var _this = this;
if (!this.cycle) return;
this.slideTimeout = setTimeout(function () {
return _this.next();
}, this.interval > 0 ? this.interval : 6000);
},
register: function register(uid, open) {
this.items.push({ uid: uid, open: open });
},
unregister: function unregister(uid) {
this.items = this.items.filter(function (i) {
return i.uid !== uid;
});
}
},
render: function render(h) {
return h('div', {
staticClass: 'v-carousel',
directives: [{
name: 'touch',
value: {
left: this.next,
right: this.prev
}
}]
}, [this.hideControls ? null : this.genIcon('prev', this.$vuetify.rtl ? this.nextIcon : this.prevIcon, this.prev), this.hideControls ? null : this.genIcon('next', this.$vuetify.rtl ? this.prevIcon : this.nextIcon, this.next), this.hideDelimiters ? null : this.genDelimiters(), this.$slots.default]);
}
});
/***/ }),
/***/ "./src/components/VCarousel/VCarouselItem.js":
/*!***************************************************!*\
!*** ./src/components/VCarousel/VCarouselItem.js ***!
\***************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VJumbotron__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VJumbotron */ "./src/components/VJumbotron/index.js");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Components
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-carousel-item',
mixins: [Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_1__["inject"])('carousel', 'v-carousel-item', 'v-carousel')],
inheritAttrs: false,
props: {
transition: {
type: String,
default: 'tab-transition'
},
reverseTransition: {
type: String,
default: 'tab-reverse-transition'
}
},
data: function data() {
return {
active: false,
reverse: false
};
},
computed: {
computedTransition: function computedTransition() {
return this.reverse === !this.$vuetify.rtl ? this.reverseTransition : this.transition;
}
},
mounted: function mounted() {
this.carousel.register(this._uid, this.open);
},
beforeDestroy: function beforeDestroy() {
this.carousel.unregister(this._uid, this.open);
},
methods: {
open: function open(id, reverse) {
this.active = this._uid === id;
this.reverse = reverse;
}
},
render: function render(h) {
var item = h(_VJumbotron__WEBPACK_IMPORTED_MODULE_0__["default"], {
props: __assign({}, this.$attrs, { height: '100%' }),
on: this.$listeners,
directives: [{
name: 'show',
value: this.active
}]
}, this.$slots.default);
return h('transition', { props: { name: this.computedTransition } }, [item]);
}
});
/***/ }),
/***/ "./src/components/VCarousel/index.js":
/*!*******************************************!*\
!*** ./src/components/VCarousel/index.js ***!
\*******************************************/
/*! exports provided: VCarousel, VCarouselItem, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VCarousel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCarousel */ "./src/components/VCarousel/VCarousel.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCarousel", function() { return _VCarousel__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _VCarouselItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VCarouselItem */ "./src/components/VCarousel/VCarouselItem.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCarouselItem", function() { return _VCarouselItem__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* istanbul ignore next */
_VCarousel__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VCarousel__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VCarousel__WEBPACK_IMPORTED_MODULE_0__["default"]);
Vue.component(_VCarouselItem__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VCarouselItem__WEBPACK_IMPORTED_MODULE_1__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VCarousel__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VCheckbox/VCheckbox.js":
/*!***********************************************!*\
!*** ./src/components/VCheckbox/VCheckbox.js ***!
\***********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_selection_controls_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_selection-controls.styl */ "./src/stylus/components/_selection-controls.styl");
/* harmony import */ var _stylus_components_selection_controls_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_selection_controls_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _mixins_selectable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/selectable */ "./src/mixins/selectable.js");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Styles
// Components
// import { VFadeTransition } from '../transitions'
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-checkbox',
mixins: [_mixins_selectable__WEBPACK_IMPORTED_MODULE_2__["default"]],
props: {
indeterminate: Boolean,
indeterminateIcon: {
type: String,
default: '$vuetify.icons.checkboxIndeterminate'
},
onIcon: {
type: String,
default: '$vuetify.icons.checkboxOn'
},
offIcon: {
type: String,
default: '$vuetify.icons.checkboxOff'
}
},
data: function data(vm) {
return {
inputIndeterminate: vm.indeterminate
};
},
computed: {
classes: function classes() {
return {
'v-input--selection-controls': true,
'v-input--checkbox': true
};
},
computedIcon: function computedIcon() {
if (this.inputIndeterminate) {
return this.indeterminateIcon;
} else if (this.isActive) {
return this.onIcon;
} else {
return this.offIcon;
}
}
},
watch: {
indeterminate: function indeterminate(val) {
this.inputIndeterminate = val;
}
},
methods: {
genCheckbox: function genCheckbox() {
return this.$createElement('div', {
staticClass: 'v-input--selection-controls__input'
}, [this.genInput('checkbox', __assign({}, this.$attrs, { 'aria-checked': this.inputIndeterminate ? 'mixed' : this.isActive.toString() })), !this.disabled && this.genRipple({
'class': this.classesSelectable
}), this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], {
'class': this.classesSelectable,
props: {
dark: this.dark,
light: this.light
}
}, this.computedIcon)]);
},
genDefaultSlot: function genDefaultSlot() {
return [this.genCheckbox(), this.genLabel()];
}
}
});
/***/ }),
/***/ "./src/components/VCheckbox/index.js":
/*!*******************************************!*\
!*** ./src/components/VCheckbox/index.js ***!
\*******************************************/
/*! exports provided: VCheckbox, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VCheckbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCheckbox */ "./src/components/VCheckbox/VCheckbox.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCheckbox", function() { return _VCheckbox__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VCheckbox__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VCheckbox__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VCheckbox__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VCheckbox__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VChip/VChip.ts":
/*!***************************************!*\
!*** ./src/components/VChip/VChip.ts ***!
\***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_chips_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_chips.styl */ "./src/stylus/components/_chips.styl");
/* harmony import */ var _stylus_components_chips_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_chips_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
// Components
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_5__["default"]).extend({
name: 'v-chip',
props: {
close: Boolean,
disabled: Boolean,
label: Boolean,
outline: Boolean,
// Used for selects/tagging
selected: Boolean,
small: Boolean,
textColor: String,
value: {
type: Boolean,
default: true
}
},
computed: {
classes: function classes() {
var classes = this.addBackgroundColorClassChecks({
'v-chip--disabled': this.disabled,
'v-chip--selected': this.selected && !this.disabled,
'v-chip--label': this.label,
'v-chip--outline': this.outline,
'v-chip--small': this.small,
'v-chip--removable': this.close,
'theme--light': this.light,
'theme--dark': this.dark
});
return this.textColor || this.outline ? this.addTextColorClassChecks(classes, this.textColor || this.color) : classes;
}
},
methods: {
genClose: function genClose(h) {
var _this = this;
var data = {
staticClass: 'v-chip__close',
on: {
click: function click(e) {
e.stopPropagation();
_this.$emit('input', false);
}
}
};
return h('div', data, [h(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], '$vuetify.icons.delete')]);
},
genContent: function genContent(h) {
var children = [this.$slots.default];
this.close && children.push(this.genClose(h));
return h('span', {
staticClass: 'v-chip__content'
}, children);
}
},
render: function render(h) {
var data = {
staticClass: 'v-chip',
'class': this.classes,
attrs: { tabindex: this.disabled ? -1 : 0 },
directives: [{
name: 'show',
value: this.isActive
}],
on: this.$listeners
};
return h('span', data, [this.genContent(h)]);
}
}));
/***/ }),
/***/ "./src/components/VChip/index.ts":
/*!***************************************!*\
!*** ./src/components/VChip/index.ts ***!
\***************************************/
/*! exports provided: VChip, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VChip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VChip */ "./src/components/VChip/VChip.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VChip", function() { return _VChip__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VChip__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VChip__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VChip__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VChip__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VCombobox/VCombobox.js":
/*!***********************************************!*\
!*** ./src/components/VCombobox/VCombobox.js ***!
\***********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_autocompletes_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_autocompletes.styl */ "./src/stylus/components/_autocompletes.styl");
/* harmony import */ var _stylus_components_autocompletes_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_autocompletes_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSelect/VSelect */ "./src/components/VSelect/VSelect.js");
/* harmony import */ var _VAutocomplete_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VAutocomplete/VAutocomplete */ "./src/components/VAutocomplete/VAutocomplete.js");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
// Styles
// Extensions
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-combobox',
extends: _VAutocomplete_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"],
props: {
delimiters: {
type: Array,
default: function _default() {
return [];
}
},
returnObject: {
type: Boolean,
default: true
}
},
data: function data() {
return {
editingIndex: -1
};
},
computed: {
counterValue: function counterValue() {
return this.multiple ? this.selectedItems.length : (this.internalSearch || '').toString().length;
},
hasSlot: function hasSlot() {
return _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].computed.hasSlot.call(this) || this.multiple;
},
isAnyValueAllowed: function isAnyValueAllowed() {
return true;
},
menuCanShow: function menuCanShow() {
if (!this.isFocused) return false;
return this.displayedItemsCount > 0 || !!this.$slots['no-data'] && !this.hideNoData;
}
},
methods: {
onFilteredItemsChanged: function onFilteredItemsChanged() {
// nop
},
onInternalSearchChanged: function onInternalSearchChanged(val) {
if (val && this.multiple && this.delimiters) {
var delimiter = this.delimiters.find(function (d) {
return val.endsWith(d);
});
if (delimiter == null) return;
this.internalSearch = val.slice(0, val.length - delimiter.length);
this.updateTags();
}
this.updateMenuDimensions();
},
genChipSelection: function genChipSelection(item, index) {
var _this = this;
var chip = _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.genChipSelection.call(this, item, index);
// Allow user to update an existing value
if (this.multiple) {
chip.componentOptions.listeners.dblclick = function () {
_this.editingIndex = index;
_this.internalSearch = _this.getText(item);
_this.selectedIndex = -1;
};
}
return chip;
},
onChipInput: function onChipInput(item) {
_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.onChipInput.call(this, item);
this.editingIndex = -1;
},
// Requires a manual definition
// to overwrite removal in v-autocomplete
onEnterDown: function onEnterDown() {
this.updateSelf();
_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.onEnterDown.call(this);
},
onKeyDown: function onKeyDown(e) {
var keyCode = e.keyCode;
_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.onKeyDown.call(this, e);
// If user is at selection index of 0
// create a new tag
if (this.multiple && keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].left && this.$refs.input.selectionStart === 0) {
this.updateSelf();
}
// The ordering is important here
// allows new value to be updated
// and then moves the index to the
// proper location
this.changeSelectedIndex(keyCode);
},
onTabDown: function onTabDown(e) {
// When adding tags, if searching and
// there is not a filtered options,
// add the value to the tags list
if (this.multiple && this.internalSearch && this.getMenuIndex() === -1) {
e.preventDefault();
e.stopPropagation();
return this.updateTags();
}
_VAutocomplete_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].methods.onTabDown.call(this, e);
},
selectItem: function selectItem(item) {
// Currently only supports items:<string[]>
if (this.editingIndex > -1) {
this.updateEditing();
} else {
_VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.selectItem.call(this, item);
}
this.setSearch();
},
setSelectedItems: function setSelectedItems() {
if (this.internalValue == null || this.internalValue === '') {
this.selectedItems = [];
} else {
this.selectedItems = this.multiple ? this.internalValue : [this.internalValue];
}
},
updateEditing: function updateEditing() {
var value = this.internalValue.slice();
value[this.editingIndex] = this.internalSearch;
this.internalValue = value;
this.editingIndex = -1;
},
updateCombobox: function updateCombobox() {
var isUsingSlot = Boolean(this.$scopedSlots.selection) || this.hasChips;
// If search is not dirty and is
// using slot, do nothing
if (isUsingSlot && !this.searchIsDirty) return;
// The internal search is not matching
// the internal value, update the input
if (this.internalSearch !== this.getText(this.internalValue)) this.setValue();
// Reset search if using slot
// to avoid a double input
if (isUsingSlot) this.internalSearch = undefined;
},
updateSelf: function updateSelf() {
this.multiple ? this.updateTags() : this.updateCombobox();
},
updateTags: function updateTags() {
var menuIndex = this.getMenuIndex();
// If the user is not searching
// and no menu item is selected
// do nothing
if (menuIndex < 0 && !this.searchIsDirty) return;
if (this.editingIndex > -1) {
return this.updateEditing();
}
var index = this.selectedItems.indexOf(this.internalSearch);
// If it already exists, do nothing
// this might need to change to bring
// the duplicated item to the last entered
if (index > -1) {
this.internalValue.splice(index, 1);
}
// If menu index is greater than 1
// the selection is handled elsewhere
// TODO: find out where
if (menuIndex > -1) return this.internalSearch = null;
this.selectItem(this.internalSearch);
this.internalSearch = null;
}
}
});
/***/ }),
/***/ "./src/components/VCombobox/index.js":
/*!*******************************************!*\
!*** ./src/components/VCombobox/index.js ***!
\*******************************************/
/*! exports provided: VCombobox, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VCombobox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCombobox */ "./src/components/VCombobox/VCombobox.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCombobox", function() { return _VCombobox__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VCombobox__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VCombobox__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VCombobox__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VCombobox__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VCounter/VCounter.js":
/*!*********************************************!*\
!*** ./src/components/VCounter/VCounter.js ***!
\*********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_counters_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_counters.styl */ "./src/stylus/components/_counters.styl");
/* harmony import */ var _stylus_components_counters_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_counters_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Styles
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-counter',
functional: true,
mixins: [_mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"]],
props: {
value: {
type: [Number, String],
default: ''
},
max: [Number, String]
},
render: function render(h, _a) {
var props = _a.props;
var max = parseInt(props.max, 10);
var value = parseInt(props.value, 10);
var content = max ? value + " / " + max : props.value;
var isGreater = max && value > max;
return h('div', {
staticClass: 'v-counter',
class: __assign({ 'error--text': isGreater }, _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"].options.computed.themeClasses.call(props))
}, content);
}
});
/***/ }),
/***/ "./src/components/VCounter/index.js":
/*!******************************************!*\
!*** ./src/components/VCounter/index.js ***!
\******************************************/
/*! exports provided: VCounter, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VCounter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VCounter */ "./src/components/VCounter/VCounter.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCounter", function() { return _VCounter__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VCounter__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VCounter__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VCounter__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VCounter__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VDataIterator/VDataIterator.js":
/*!*******************************************************!*\
!*** ./src/components/VDataIterator/VDataIterator.js ***!
\*******************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_data_iterator_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_data-iterator.styl */ "./src/stylus/components/_data-iterator.styl");
/* harmony import */ var _stylus_components_data_iterator_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_data_iterator_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_data_iterable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/data-iterable */ "./src/mixins/data-iterable.js");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-data-iterator',
mixins: [_mixins_data_iterable__WEBPACK_IMPORTED_MODULE_1__["default"]],
inheritAttrs: false,
props: {
contentTag: {
type: String,
default: 'div'
},
contentProps: {
type: Object,
required: false
},
contentClass: {
type: String,
required: false
}
},
computed: {
classes: function classes() {
return {
'v-data-iterator': true,
'v-data-iterator--select-all': this.selectAll !== false,
'theme--dark': this.dark,
'theme--light': this.light
};
}
},
created: function created() {
this.initPagination();
},
methods: {
genContent: function genContent() {
var children = this.genItems();
var data = {
'class': this.contentClass,
attrs: this.$attrs,
on: this.$listeners,
props: this.contentProps
};
return this.$createElement(this.contentTag, data, children);
},
genEmptyItems: function genEmptyItems(content) {
return [this.$createElement('div', {
'class': 'text-xs-center',
style: 'width: 100%'
}, content)];
},
genFilteredItems: function genFilteredItems() {
if (!this.$scopedSlots.item) {
return null;
}
var items = [];
for (var index = 0, len = this.filteredItems.length; index < len; ++index) {
var item = this.filteredItems[index];
var props = this.createProps(item, index);
items.push(this.$scopedSlots.item(props));
}
return items;
},
genFooter: function genFooter() {
var children = [];
if (this.$slots.footer) {
children.push(this.$slots.footer);
}
if (!this.hideActions) {
children.push(this.genActions());
}
if (!children.length) return null;
return this.$createElement('div', children);
},
genHeader: function genHeader() {
var children = [];
if (this.$slots.header) {
children.push(this.$slots.header);
}
if (!children.length) return null;
return this.$createElement('div', children);
}
},
render: function render(h) {
return h('div', {
'class': this.classes
}, [this.genHeader(), this.genContent(), this.genFooter()]);
}
});
/***/ }),
/***/ "./src/components/VDataIterator/index.js":
/*!***********************************************!*\
!*** ./src/components/VDataIterator/index.js ***!
\***********************************************/
/*! exports provided: VDataIterator, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VDataIterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDataIterator */ "./src/components/VDataIterator/VDataIterator.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataIterator", function() { return _VDataIterator__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VDataIterator__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VDataIterator__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VDataIterator__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VDataIterator__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VDataTable/VDataTable.js":
/*!*************************************************!*\
!*** ./src/components/VDataTable/VDataTable.js ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_tables_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_tables.styl */ "./src/stylus/components/_tables.styl");
/* harmony import */ var _stylus_components_tables_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_tables_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _stylus_components_data_table_styl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../stylus/components/_data-table.styl */ "./src/stylus/components/_data-table.styl");
/* harmony import */ var _stylus_components_data_table_styl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_data_table_styl__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _mixins_data_iterable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/data-iterable */ "./src/mixins/data-iterable.js");
/* harmony import */ var _mixins_head__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mixins/head */ "./src/components/VDataTable/mixins/head.js");
/* harmony import */ var _mixins_body__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mixins/body */ "./src/components/VDataTable/mixins/body.js");
/* harmony import */ var _mixins_foot__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mixins/foot */ "./src/components/VDataTable/mixins/foot.js");
/* harmony import */ var _mixins_progress__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mixins/progress */ "./src/components/VDataTable/mixins/progress.js");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
// Importing does not work properly
var VTableOverflow = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["createSimpleFunctional"])('v-table__overflow');
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-data-table',
mixins: [_mixins_data_iterable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_head__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_body__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_foot__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_progress__WEBPACK_IMPORTED_MODULE_6__["default"]],
props: {
headers: {
type: Array,
default: function _default() {
return [];
}
},
headersLength: {
type: Number
},
headerText: {
type: String,
default: 'text'
},
hideHeaders: Boolean,
rowsPerPageText: {
type: String,
default: '$vuetify.dataTable.rowsPerPageText'
},
customFilter: {
type: Function,
default: function _default(items, search, filter, headers) {
search = search.toString().toLowerCase();
if (search.trim() === '') return items;
var props = headers.map(function (h) {
return h.value;
});
return items.filter(function (item) {
return props.some(function (prop) {
return filter(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["getObjectValueByPath"])(item, prop), search);
});
});
}
}
},
data: function data() {
return {
actionsClasses: 'v-datatable__actions',
actionsRangeControlsClasses: 'v-datatable__actions__range-controls',
actionsSelectClasses: 'v-datatable__actions__select',
actionsPaginationClasses: 'v-datatable__actions__pagination'
};
},
computed: {
classes: function classes() {
return {
'v-datatable v-table': true,
'v-datatable--select-all': this.selectAll !== false,
'theme--dark': this.dark,
'theme--light': this.light
};
},
filteredItems: function filteredItems() {
return this.filteredItemsImpl(this.headers);
},
headerColumns: function headerColumns() {
return this.headersLength || this.headers.length + (this.selectAll !== false);
}
},
created: function created() {
var firstSortable = this.headers.find(function (h) {
return !('sortable' in h) || h.sortable;
});
this.defaultPagination.sortBy = !this.disableInitialSort && firstSortable ? firstSortable.value : null;
this.initPagination();
},
methods: {
hasTag: function hasTag(elements, tag) {
return Array.isArray(elements) && elements.find(function (e) {
return e.tag === tag;
});
},
genTR: function genTR(children, data) {
if (data === void 0) {
data = {};
}
return this.$createElement('tr', data, children);
}
},
render: function render(h) {
var tableOverflow = h(VTableOverflow, {}, [h('table', {
'class': this.classes
}, [this.genTHead(), this.genTBody(), this.genTFoot()])]);
return h('div', [tableOverflow, this.genActionsFooter()]);
}
});
/***/ }),
/***/ "./src/components/VDataTable/VEditDialog.js":
/*!**************************************************!*\
!*** ./src/components/VDataTable/VEditDialog.js ***!
\**************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_small_dialog_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_small-dialog.styl */ "./src/stylus/components/_small-dialog.styl");
/* harmony import */ var _stylus_components_small_dialog_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_small_dialog_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_returnable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/returnable */ "./src/mixins/returnable.js");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
/* harmony import */ var _VMenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../VMenu */ "./src/components/VMenu/index.js");
// Mixins
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-edit-dialog',
mixins: [_mixins_returnable__WEBPACK_IMPORTED_MODULE_1__["default"]],
props: {
cancelText: {
default: 'Cancel'
},
large: Boolean,
lazy: Boolean,
persistent: Boolean,
saveText: {
default: 'Save'
},
transition: {
type: String,
default: 'slide-x-reverse-transition'
}
},
data: function data() {
return {
isActive: false
};
},
watch: {
isActive: function isActive(val) {
if (val) {
this.$emit('open');
setTimeout(this.focus, 50); // Give DOM time to paint
} else {
this.$emit('close');
}
}
},
methods: {
cancel: function cancel() {
this.isActive = false;
this.$emit('cancel');
},
focus: function focus() {
var input = this.$refs.content.querySelector('input');
input && input.focus();
},
genButton: function genButton(fn, text) {
return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_3__["default"], {
props: {
flat: true,
color: 'primary',
light: true
},
on: { click: fn }
}, text);
},
genActions: function genActions() {
var _this = this;
return this.$createElement('div', {
'class': 'v-small-dialog__actions'
}, [this.genButton(this.cancel, this.cancelText), this.genButton(function () {
_this.save(_this.returnValue);
_this.$emit('save');
}, this.saveText)]);
},
genContent: function genContent() {
var _this = this;
return this.$createElement('div', {
on: {
keydown: function keydown(e) {
var input = _this.$refs.content.querySelector('input');
e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].esc && _this.cancel();
if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].enter && input) {
_this.save(input.value);
_this.$emit('save');
}
}
},
ref: 'content'
}, [this.$slots.input]);
}
},
render: function render(h) {
var _this = this;
return h(_VMenu__WEBPACK_IMPORTED_MODULE_4__["default"], {
'class': 'v-small-dialog',
props: {
contentClass: 'v-small-dialog__content',
transition: this.transition,
origin: 'top right',
right: true,
value: this.isActive,
closeOnClick: !this.persistent,
closeOnContentClick: false,
lazy: this.lazy
},
on: {
input: function input(val) {
return _this.isActive = val;
}
}
}, [h('a', {
slot: 'activator'
}, this.$slots.default), this.genContent(), this.large ? this.genActions() : null]);
}
});
/***/ }),
/***/ "./src/components/VDataTable/index.js":
/*!********************************************!*\
!*** ./src/components/VDataTable/index.js ***!
\********************************************/
/*! exports provided: VDataTable, VEditDialog, VTableOverflow, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VTableOverflow", function() { return VTableOverflow; });
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _VDataTable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VDataTable */ "./src/components/VDataTable/VDataTable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataTable", function() { return _VDataTable__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _VEditDialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VEditDialog */ "./src/components/VDataTable/VEditDialog.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VEditDialog", function() { return _VEditDialog__WEBPACK_IMPORTED_MODULE_2__["default"]; });
var VTableOverflow = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-table__overflow');
/* istanbul ignore next */
_VDataTable__WEBPACK_IMPORTED_MODULE_1__["default"].install = function install(Vue) {
Vue.component(_VDataTable__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VDataTable__WEBPACK_IMPORTED_MODULE_1__["default"]);
Vue.component(_VEditDialog__WEBPACK_IMPORTED_MODULE_2__["default"].name, _VEditDialog__WEBPACK_IMPORTED_MODULE_2__["default"]);
Vue.component(VTableOverflow.name, VTableOverflow);
};
/* harmony default export */ __webpack_exports__["default"] = (_VDataTable__WEBPACK_IMPORTED_MODULE_1__["default"]);
/***/ }),
/***/ "./src/components/VDataTable/mixins/body.js":
/*!**************************************************!*\
!*** ./src/components/VDataTable/mixins/body.js ***!
\**************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _transitions_expand_transition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../transitions/expand-transition */ "./src/components/transitions/expand-transition.js");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
genTBody: function genTBody() {
var children = this.genItems();
return this.$createElement('tbody', children);
},
genExpandedRow: function genExpandedRow(props) {
var children = [];
if (this.isExpanded(props.item)) {
var expand = this.$createElement('div', {
class: 'v-datatable__expand-content',
key: props.item[this.itemKey]
}, [this.$scopedSlots.expand(props)]);
children.push(expand);
}
var transition = this.$createElement('transition-group', {
class: 'v-datatable__expand-col',
attrs: { colspan: this.headerColumns },
props: {
tag: 'td'
},
on: Object(_transitions_expand_transition__WEBPACK_IMPORTED_MODULE_0__["default"])('v-datatable__expand-col--expanded')
}, children);
return this.genTR([transition], { class: 'v-datatable__expand-row' });
},
genFilteredItems: function genFilteredItems() {
if (!this.$scopedSlots.items) {
return null;
}
var rows = [];
for (var index = 0, len = this.filteredItems.length; index < len; ++index) {
var item = this.filteredItems[index];
var props = this.createProps(item, index);
var row = this.$scopedSlots.items(props);
rows.push(this.hasTag(row, 'td') ? this.genTR(row, {
key: this.itemKey ? props.item[this.itemKey] : index,
attrs: { active: this.isSelected(item) }
}) : row);
if (this.$scopedSlots.expand) {
var expandRow = this.genExpandedRow(props);
rows.push(expandRow);
}
}
return rows;
},
genEmptyItems: function genEmptyItems(content) {
if (this.hasTag(content, 'tr')) {
return content;
} else if (this.hasTag(content, 'td')) {
return this.genTR(content);
} else {
return this.genTR([this.$createElement('td', {
class: {
'text-xs-center': typeof content === 'string'
},
attrs: { colspan: this.headerColumns }
}, content)]);
}
}
}
});
/***/ }),
/***/ "./src/components/VDataTable/mixins/foot.js":
/*!**************************************************!*\
!*** ./src/components/VDataTable/mixins/foot.js ***!
\**************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
genTFoot: function genTFoot() {
if (!this.$slots.footer) {
return null;
}
var footer = this.$slots.footer;
var row = this.hasTag(footer, 'td') ? this.genTR(footer) : footer;
return this.$createElement('tfoot', [row]);
},
genActionsFooter: function genActionsFooter() {
if (this.hideActions) {
return null;
}
return this.$createElement('div', {
'class': this.classes
}, this.genActions());
}
}
});
/***/ }),
/***/ "./src/components/VDataTable/mixins/head.js":
/*!**************************************************!*\
!*** ./src/components/VDataTable/mixins/head.js ***!
\**************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/console */ "./src/util/console.ts");
/* harmony import */ var _VCheckbox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../VCheckbox */ "./src/components/VCheckbox/index.js");
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../VIcon */ "./src/components/VIcon/index.ts");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
var __spread = undefined && undefined.__spread || function () {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}return ar;
};
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
props: {
sortIcon: {
type: String,
default: '$vuetify.icons.sort'
}
},
methods: {
genTHead: function genTHead() {
var _this = this;
if (this.hideHeaders) return; // Exit Early since no headers are needed.
var children = [];
if (this.$scopedSlots.headers) {
var row = this.$scopedSlots.headers({
headers: this.headers,
indeterminate: this.indeterminate,
all: this.everyItem
});
children = [this.hasTag(row, 'th') ? this.genTR(row) : row, this.genTProgress()];
} else {
var row = this.headers.map(function (o) {
return _this.genHeader(o);
});
var checkbox = this.$createElement(_VCheckbox__WEBPACK_IMPORTED_MODULE_1__["default"], {
props: {
dark: this.dark,
light: this.light,
color: this.selectAll === true ? '' : this.selectAll,
hideDetails: true,
inputValue: this.everyItem,
indeterminate: this.indeterminate
},
on: { change: this.toggle }
});
this.hasSelectAll && row.unshift(this.$createElement('th', [checkbox]));
children = [this.genTR(row), this.genTProgress()];
}
return this.$createElement('thead', [children]);
},
genHeader: function genHeader(header) {
var array = [this.$scopedSlots.headerCell ? this.$scopedSlots.headerCell({ header: header }) : header[this.headerText]];
return this.$createElement.apply(this, __spread(['th'], this.genHeaderData(header, array)));
},
genHeaderData: function genHeaderData(header, children) {
var classes = ['column'];
var data = {
key: header[this.headerText],
attrs: {
role: 'columnheader',
scope: 'col',
width: header.width || null,
'aria-label': header[this.headerText] || '',
'aria-sort': 'none'
}
};
if (header.sortable == null || header.sortable) {
this.genHeaderSortingData(header, children, data, classes);
} else {
data.attrs['aria-label'] += ': Not sorted.'; // TODO: Localization
}
classes.push("text-xs-" + (header.align || 'left'));
if (Array.isArray(header.class)) {
classes.push.apply(classes, __spread(header.class));
} else if (header.class) {
classes.push(header.class);
}
data.class = classes;
return [data, children];
},
genHeaderSortingData: function genHeaderSortingData(header, children, data, classes) {
var _this = this;
if (!('value' in header)) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_0__["consoleWarn"])('Headers must have a value property that corresponds to a value in the v-model array', this);
}
data.attrs.tabIndex = 0;
data.on = {
click: function click() {
_this.expanded = {};
_this.sort(header.value);
},
keydown: function keydown(e) {
// check for space
if (e.keyCode === 32) {
e.preventDefault();
_this.sort(header.value);
}
}
};
classes.push('sortable');
var icon = this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], {
props: {
small: true
}
}, this.sortIcon);
if (!header.align || header.align === 'left') {
children.push(icon);
} else {
children.unshift(icon);
}
var pagination = this.computedPagination;
var beingSorted = pagination.sortBy === header.value;
if (beingSorted) {
classes.push('active');
if (pagination.descending) {
classes.push('desc');
data.attrs['aria-sort'] = 'descending';
data.attrs['aria-label'] += ': Sorted descending. Activate to remove sorting.'; // TODO: Localization
} else {
classes.push('asc');
data.attrs['aria-sort'] = 'ascending';
data.attrs['aria-label'] += ': Sorted ascending. Activate to sort descending.'; // TODO: Localization
}
} else {
data.attrs['aria-label'] += ': Not sorted. Activate to sort ascending.'; // TODO: Localization
}
}
}
});
/***/ }),
/***/ "./src/components/VDataTable/mixins/progress.js":
/*!******************************************************!*\
!*** ./src/components/VDataTable/mixins/progress.js ***!
\******************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
genTProgress: function genTProgress() {
var col = this.$createElement('th', {
staticClass: 'column',
attrs: {
colspan: this.headerColumns
}
}, [this.genProgress()]);
return this.genTR([col], {
staticClass: 'v-datatable__progress'
});
}
}
});
/***/ }),
/***/ "./src/components/VDatePicker/VDatePicker.js":
/*!***************************************************!*\
!*** ./src/components/VDatePicker/VDatePicker.js ***!
\***************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VDatePickerTitle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDatePickerTitle */ "./src/components/VDatePicker/VDatePickerTitle.js");
/* harmony import */ var _VDatePickerHeader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VDatePickerHeader */ "./src/components/VDatePicker/VDatePickerHeader.js");
/* harmony import */ var _VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VDatePickerDateTable */ "./src/components/VDatePicker/VDatePickerDateTable.js");
/* harmony import */ var _VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VDatePickerMonthTable */ "./src/components/VDatePicker/VDatePickerMonthTable.js");
/* harmony import */ var _VDatePickerYears__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VDatePickerYears */ "./src/components/VDatePicker/VDatePickerYears.js");
/* harmony import */ var _mixins_picker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/picker */ "./src/mixins/picker.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ "./src/components/VDatePicker/util/index.js");
/* harmony import */ var _util_isDateAllowed__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/isDateAllowed */ "./src/components/VDatePicker/util/isDateAllowed.js");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
// Components
// Mixins
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-date-picker',
mixins: [_mixins_picker__WEBPACK_IMPORTED_MODULE_5__["default"]],
props: {
allowedDates: Function,
// Function formatting the day in date picker table
dayFormat: {
type: Function,
default: null
},
events: {
type: [Array, Object, Function],
default: function _default() {
return null;
}
},
eventColor: {
type: [String, Function, Object],
default: 'warning'
},
firstDayOfWeek: {
type: [String, Number],
default: 0
},
// Function formatting the tableDate in the day/month table header
headerDateFormat: {
type: Function,
default: null
},
locale: {
type: String,
default: 'en-us'
},
max: String,
min: String,
// Function formatting month in the months table
monthFormat: {
type: Function,
default: null
},
nextIcon: {
type: String,
default: '$vuetify.icons.next'
},
pickerDate: String,
prevIcon: {
type: String,
default: '$vuetify.icons.prev'
},
reactive: Boolean,
readonly: Boolean,
scrollable: Boolean,
showCurrent: {
type: [Boolean, String],
default: true
},
// Function formatting currently selected date in the picker title
titleDateFormat: {
type: Function,
default: null
},
type: {
type: String,
default: 'date',
validator: function validator(type) {
return ['date', 'month'].includes(type);
} // TODO: year
},
value: String,
// Function formatting the year in table header and pickup title
yearFormat: {
type: Function,
default: null
},
yearIcon: String
},
data: function data() {
var _this = this;
var now = new Date();
return {
activePicker: this.type.toUpperCase(),
defaultColor: 'accent',
inputDay: null,
inputMonth: null,
inputYear: null,
isReversing: false,
now: now,
// tableDate is a string in 'YYYY' / 'YYYY-M' format (leading zero for month is not required)
tableDate: function () {
if (_this.pickerDate) {
return _this.pickerDate;
}
var date = _this.value || now.getFullYear() + "-" + (now.getMonth() + 1);
var type = _this.type === 'date' ? 'month' : 'year';
return _this.sanitizeDateString(date, type);
}()
};
},
computed: {
current: function current() {
if (this.showCurrent === true) {
return this.sanitizeDateString(this.now.getFullYear() + "-" + (this.now.getMonth() + 1) + "-" + this.now.getDate(), this.type);
}
return this.showCurrent || null;
},
inputDate: function inputDate() {
return this.type === 'date' ? this.inputYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_6__["pad"])(this.inputMonth + 1) + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_6__["pad"])(this.inputDay) : this.inputYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_6__["pad"])(this.inputMonth + 1);
},
tableMonth: function tableMonth() {
return (this.pickerDate || this.tableDate).split('-')[1] - 1;
},
tableYear: function tableYear() {
return (this.pickerDate || this.tableDate).split('-')[0] * 1;
},
minMonth: function minMonth() {
return this.min ? this.sanitizeDateString(this.min, 'month') : null;
},
maxMonth: function maxMonth() {
return this.max ? this.sanitizeDateString(this.max, 'month') : null;
},
minYear: function minYear() {
return this.min ? this.sanitizeDateString(this.min, 'year') : null;
},
maxYear: function maxYear() {
return this.max ? this.sanitizeDateString(this.max, 'year') : null;
},
formatters: function formatters() {
return {
year: this.yearFormat || Object(_util__WEBPACK_IMPORTED_MODULE_6__["createNativeLocaleFormatter"])(this.locale, { year: 'numeric', timeZone: 'UTC' }, { length: 4 }),
titleDate: this.titleDateFormat || this.defaultTitleDateFormatter
};
},
defaultTitleDateFormatter: function defaultTitleDateFormatter() {
var titleFormats = {
year: { year: 'numeric', timeZone: 'UTC' },
month: { month: 'long', timeZone: 'UTC' },
date: { weekday: 'short', month: 'short', day: 'numeric', timeZone: 'UTC' }
};
var titleDateFormatter = Object(_util__WEBPACK_IMPORTED_MODULE_6__["createNativeLocaleFormatter"])(this.locale, titleFormats[this.type], {
start: 0,
length: { date: 10, month: 7, year: 4 }[this.type]
});
var landscapeFormatter = function landscapeFormatter(date) {
return titleDateFormatter(date).replace(/([^\d\s])([\d])/g, function (match, nonDigit, digit) {
return nonDigit + " " + digit;
}).replace(', ', ',<br>');
};
return this.landscape ? landscapeFormatter : titleDateFormatter;
}
},
watch: {
tableDate: function tableDate(val, prev) {
// Make a ISO 8601 strings from val and prev for comparision, otherwise it will incorrectly
// compare for example '2000-9' and '2000-10'
var sanitizeType = this.type === 'month' ? 'year' : 'month';
this.isReversing = this.sanitizeDateString(val, sanitizeType) < this.sanitizeDateString(prev, sanitizeType);
this.$emit('update:pickerDate', val);
},
pickerDate: function pickerDate(val) {
if (val) {
this.tableDate = val;
} else if (this.value && this.type === 'date') {
this.tableDate = this.sanitizeDateString(this.value, 'month');
} else if (this.value && this.type === 'month') {
this.tableDate = this.sanitizeDateString(this.value, 'year');
}
},
value: function value() {
this.setInputDate();
if (this.value && !this.pickerDate) {
this.tableDate = this.sanitizeDateString(this.inputDate, this.type === 'month' ? 'year' : 'month');
}
},
type: function type(_type) {
this.activePicker = _type.toUpperCase();
if (this.value) {
var date = this.sanitizeDateString(this.value, _type);
this.$emit('input', this.isDateAllowed(date) ? date : null);
}
}
},
created: function created() {
if (this.pickerDate !== this.tableDate) {
this.$emit('update:pickerDate', this.tableDate);
}
this.setInputDate();
},
methods: {
isDateAllowed: function isDateAllowed(value) {
return Object(_util_isDateAllowed__WEBPACK_IMPORTED_MODULE_7__["default"])(value, this.min, this.max, this.allowedDates);
},
yearClick: function yearClick(value) {
this.inputYear = value;
if (this.type === 'month') {
this.tableDate = "" + value;
} else {
this.tableDate = value + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_6__["pad"])(this.tableMonth + 1);
}
this.activePicker = 'MONTH';
this.reactive && this.isDateAllowed(this.inputDate) && this.$emit('input', this.inputDate);
},
monthClick: function monthClick(value) {
this.inputYear = parseInt(value.split('-')[0], 10);
this.inputMonth = parseInt(value.split('-')[1], 10) - 1;
if (this.type === 'date') {
this.tableDate = value;
this.activePicker = 'DATE';
this.reactive && this.isDateAllowed(this.inputDate) && this.$emit('input', this.inputDate);
} else {
this.$emit('input', this.inputDate);
this.$emit('change', this.inputDate);
}
},
dateClick: function dateClick(value) {
this.inputYear = parseInt(value.split('-')[0], 10);
this.inputMonth = parseInt(value.split('-')[1], 10) - 1;
this.inputDay = parseInt(value.split('-')[2], 10);
this.$emit('input', this.inputDate);
this.$emit('change', this.inputDate);
},
genPickerTitle: function genPickerTitle() {
var _this = this;
return this.$createElement(_VDatePickerTitle__WEBPACK_IMPORTED_MODULE_0__["default"], {
props: {
date: this.value ? this.formatters.titleDate(this.value) : '',
selectingYear: this.activePicker === 'YEAR',
year: this.formatters.year("" + this.inputYear),
yearIcon: this.yearIcon,
value: this.value
},
slot: 'title',
style: this.readonly ? {
'pointer-events': 'none'
} : undefined,
on: {
'update:selectingYear': function updateSelectingYear(value) {
return _this.activePicker = value ? 'YEAR' : _this.type.toUpperCase();
}
}
});
},
genTableHeader: function genTableHeader() {
var _this = this;
return this.$createElement(_VDatePickerHeader__WEBPACK_IMPORTED_MODULE_1__["default"], {
props: {
nextIcon: this.nextIcon,
color: this.color,
dark: this.dark,
disabled: this.readonly,
format: this.headerDateFormat,
light: this.light,
locale: this.locale,
min: this.activePicker === 'DATE' ? this.minMonth : this.minYear,
max: this.activePicker === 'DATE' ? this.maxMonth : this.maxYear,
prevIcon: this.prevIcon,
value: this.activePicker === 'DATE' ? this.tableYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_6__["pad"])(this.tableMonth + 1) : "" + this.tableYear
},
on: {
toggle: function toggle() {
return _this.activePicker = _this.activePicker === 'DATE' ? 'MONTH' : 'YEAR';
},
input: function input(value) {
return _this.tableDate = value;
}
}
});
},
genDateTable: function genDateTable() {
var _this = this;
return this.$createElement(_VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_2__["default"], {
props: {
allowedDates: this.allowedDates,
color: this.color,
current: this.current,
dark: this.dark,
disabled: this.readonly,
events: this.events,
eventColor: this.eventColor,
firstDayOfWeek: this.firstDayOfWeek,
format: this.dayFormat,
light: this.light,
locale: this.locale,
min: this.min,
max: this.max,
tableDate: this.tableYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_6__["pad"])(this.tableMonth + 1),
scrollable: this.scrollable,
value: this.value
},
ref: 'table',
on: {
input: this.dateClick,
tableDate: function tableDate(value) {
return _this.tableDate = value;
}
}
});
},
genMonthTable: function genMonthTable() {
var _this = this;
return this.$createElement(_VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_3__["default"], {
props: {
allowedDates: this.type === 'month' ? this.allowedDates : null,
color: this.color,
current: this.current ? this.sanitizeDateString(this.current, 'month') : null,
dark: this.dark,
disabled: this.readonly,
format: this.monthFormat,
light: this.light,
locale: this.locale,
min: this.minMonth,
max: this.maxMonth,
scrollable: this.scrollable,
value: !this.value || this.type === 'month' ? this.value : this.value.substr(0, 7),
tableDate: "" + this.tableYear
},
ref: 'table',
on: {
input: this.monthClick,
tableDate: function tableDate(value) {
return _this.tableDate = value;
}
}
});
},
genYears: function genYears() {
return this.$createElement(_VDatePickerYears__WEBPACK_IMPORTED_MODULE_4__["default"], {
props: {
color: this.color,
format: this.yearFormat,
locale: this.locale,
min: this.minYear,
max: this.maxYear,
value: "" + this.tableYear
},
on: {
input: this.yearClick
}
});
},
genPickerBody: function genPickerBody() {
var children = this.activePicker === 'YEAR' ? [this.genYears()] : [this.genTableHeader(), this.activePicker === 'DATE' ? this.genDateTable() : this.genMonthTable()];
return this.$createElement('div', {
key: this.activePicker,
style: this.readonly ? {
'pointer-events': 'none'
} : undefined
}, children);
},
// Adds leading zero to month/day if necessary, returns 'YYYY' if type = 'year',
// 'YYYY-MM' if 'month' and 'YYYY-MM-DD' if 'date'
sanitizeDateString: function sanitizeDateString(dateString, type) {
var _a = __read(dateString.split('-'), 3),
year = _a[0],
_b = _a[1],
month = _b === void 0 ? 1 : _b,
_c = _a[2],
date = _c === void 0 ? 1 : _c;
return (year + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_6__["pad"])(month) + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_6__["pad"])(date)).substr(0, { date: 10, month: 7, year: 4 }[type]);
},
setInputDate: function setInputDate() {
if (this.value) {
var array = this.value.split('-');
this.inputYear = parseInt(array[0], 10);
this.inputMonth = parseInt(array[1], 10) - 1;
if (this.type === 'date') {
this.inputDay = parseInt(array[2], 10);
}
} else {
this.inputYear = this.inputYear || this.now.getFullYear();
this.inputMonth = this.inputMonth == null ? this.inputMonth : this.now.getMonth();
this.inputDay = this.inputDay || this.now.getDate();
}
}
},
render: function render() {
return this.genPicker('v-picker--date');
}
});
/***/ }),
/***/ "./src/components/VDatePicker/VDatePickerDateTable.js":
/*!************************************************************!*\
!*** ./src/components/VDatePicker/VDatePickerDateTable.js ***!
\************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_date_picker_table__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mixins/date-picker-table */ "./src/components/VDatePicker/mixins/date-picker-table.js");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util */ "./src/components/VDatePicker/util/index.js");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
// Mixins
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-date-picker-date-table',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_0__["default"], _mixins_date_picker_table__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]],
props: {
events: {
type: [Array, Object, Function],
default: function _default() {
return null;
}
},
eventColor: {
type: [String, Function, Object],
default: 'warning'
},
firstDayOfWeek: {
type: [String, Number],
default: 0
},
weekdayFormat: {
type: Function,
default: null
}
},
computed: {
formatter: function formatter() {
return this.format || Object(_util__WEBPACK_IMPORTED_MODULE_3__["createNativeLocaleFormatter"])(this.locale, { day: 'numeric', timeZone: 'UTC' }, { start: 8, length: 2 });
},
weekdayFormatter: function weekdayFormatter() {
return this.weekdayFormat || Object(_util__WEBPACK_IMPORTED_MODULE_3__["createNativeLocaleFormatter"])(this.locale, { weekday: 'narrow', timeZone: 'UTC' });
},
weekDays: function weekDays() {
var _this = this;
var first = parseInt(this.firstDayOfWeek, 10);
return this.weekdayFormatter ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["createRange"])(7).map(function (i) {
return _this.weekdayFormatter("2017-01-" + (first + i + 15));
}) // 2017-01-15 is Sunday
: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["createRange"])(7).map(function (i) {
return ['S', 'M', 'T', 'W', 'T', 'F', 'S'][(i + first) % 7];
});
}
},
methods: {
calculateTableDate: function calculateTableDate(delta) {
return Object(_util__WEBPACK_IMPORTED_MODULE_3__["monthChange"])(this.tableDate, Math.sign(delta || 1));
},
genTHead: function genTHead() {
var _this = this;
var days = this.weekDays.map(function (day) {
return _this.$createElement('th', day);
});
return this.$createElement('thead', this.genTR(days));
},
genEvent: function genEvent(date) {
var eventColor;
if (typeof this.eventColor === 'string') {
eventColor = this.eventColor;
} else if (typeof this.eventColor === 'function') {
eventColor = this.eventColor(date);
} else {
eventColor = this.eventColor[date];
}
return this.$createElement('div', {
staticClass: 'v-date-picker-table__event',
class: this.addBackgroundColorClassChecks({}, eventColor || this.color)
});
},
// Returns number of the days from the firstDayOfWeek to the first day of the current month
weekDaysBeforeFirstDayOfTheMonth: function weekDaysBeforeFirstDayOfTheMonth() {
var firstDayOfTheMonth = new Date(this.displayedYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_3__["pad"])(this.displayedMonth + 1) + "-01T00:00:00+00:00");
var weekDay = firstDayOfTheMonth.getUTCDay();
return (weekDay - parseInt(this.firstDayOfWeek) + 7) % 7;
},
isEvent: function isEvent(date) {
if (Array.isArray(this.events)) {
return this.events.indexOf(date) > -1;
} else if (this.events instanceof Function) {
return this.events(date);
} else {
return false;
}
},
genTBody: function genTBody() {
var children = [];
var daysInMonth = new Date(this.displayedYear, this.displayedMonth + 1, 0).getDate();
var rows = [];
var day = this.weekDaysBeforeFirstDayOfTheMonth();
while (day--) {
rows.push(this.$createElement('td'));
}for (day = 1; day <= daysInMonth; day++) {
var date = this.displayedYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_3__["pad"])(this.displayedMonth + 1) + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_3__["pad"])(day);
rows.push(this.$createElement('td', [this.genButton(date, true), this.isEvent(date) ? this.genEvent(date) : null]));
if (rows.length % 7 === 0) {
children.push(this.genTR(rows));
rows = [];
}
}
if (rows.length) {
children.push(this.genTR(rows));
}
return this.$createElement('tbody', children);
},
genTR: function genTR(children) {
return [this.$createElement('tr', children)];
}
},
render: function render() {
return this.genTable('v-date-picker-table v-date-picker-table--date', [this.genTHead(), this.genTBody()]);
}
});
/***/ }),
/***/ "./src/components/VDatePicker/VDatePickerHeader.js":
/*!*********************************************************!*\
!*** ./src/components/VDatePicker/VDatePickerHeader.js ***!
\*********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_date_picker_header_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_date-picker-header.styl */ "./src/stylus/components/_date-picker-header.styl");
/* harmony import */ var _stylus_components_date_picker_header_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_date_picker_header_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util */ "./src/components/VDatePicker/util/index.js");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
// Components
// Mixins
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-date-picker-header',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__["default"]],
props: {
disabled: Boolean,
format: {
type: Function,
default: null
},
locale: {
type: String,
default: 'en-us'
},
min: String,
max: String,
nextIcon: {
type: String,
default: '$vuetify.icons.next'
},
prevIcon: {
type: String,
default: '$vuetify.icons.prev'
},
value: {
type: [Number, String],
required: true
}
},
data: function data() {
return {
isReversing: false,
defaultColor: 'accent'
};
},
computed: {
formatter: function formatter() {
if (this.format) {
return this.format;
} else if (String(this.value).split('-')[1]) {
return Object(_util__WEBPACK_IMPORTED_MODULE_5__["createNativeLocaleFormatter"])(this.locale, { month: 'long', year: 'numeric', timeZone: 'UTC' }, { length: 7 });
} else {
return Object(_util__WEBPACK_IMPORTED_MODULE_5__["createNativeLocaleFormatter"])(this.locale, { year: 'numeric', timeZone: 'UTC' }, { length: 4 });
}
}
},
watch: {
value: function value(newVal, oldVal) {
this.isReversing = newVal < oldVal;
}
},
methods: {
genBtn: function genBtn(change) {
var _this = this;
var disabled = this.disabled || change < 0 && this.min && this.calculateChange(change) < this.min || change > 0 && this.max && this.calculateChange(change) > this.max;
return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_1__["default"], {
props: {
dark: this.dark,
disabled: disabled,
icon: true,
light: this.light
},
nativeOn: {
click: function click(e) {
e.stopPropagation();
_this.$emit('input', _this.calculateChange(change));
}
}
}, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], change < 0 === !this.$vuetify.rtl ? this.prevIcon : this.nextIcon)]);
},
calculateChange: function calculateChange(sign) {
var _a = __read(String(this.value).split('-').map(function (v) {
return 1 * v;
}), 2),
year = _a[0],
month = _a[1];
if (month == null) {
return "" + (year + sign);
} else {
return Object(_util__WEBPACK_IMPORTED_MODULE_5__["monthChange"])(String(this.value), sign);
}
},
genHeader: function genHeader() {
var _this = this;
var header = this.$createElement('strong', {
'class': this.disabled ? undefined : this.addTextColorClassChecks(),
key: String(this.value),
on: {
click: function click() {
return _this.$emit('toggle');
}
}
}, [this.$slots.default || this.formatter(String(this.value))]);
var transition = this.$createElement('transition', {
props: {
name: this.isReversing === !this.$vuetify.rtl ? 'tab-reverse-transition' : 'tab-transition'
}
}, [header]);
return this.$createElement('div', {
staticClass: 'v-date-picker-header__value',
class: {
'v-date-picker-header__value--disabled': this.disabled
}
}, [transition]);
}
},
render: function render() {
return this.$createElement('div', {
staticClass: 'v-date-picker-header',
class: this.themeClasses
}, [this.genBtn(-1), this.genHeader(), this.genBtn(+1)]);
}
});
/***/ }),
/***/ "./src/components/VDatePicker/VDatePickerMonthTable.js":
/*!*************************************************************!*\
!*** ./src/components/VDatePicker/VDatePickerMonthTable.js ***!
\*************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_date_picker_table__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mixins/date-picker-table */ "./src/components/VDatePicker/mixins/date-picker-table.js");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util */ "./src/components/VDatePicker/util/index.js");
// Mixins
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-date-picker-month-table',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_0__["default"], _mixins_date_picker_table__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]],
computed: {
formatter: function formatter() {
return this.format || Object(_util__WEBPACK_IMPORTED_MODULE_3__["createNativeLocaleFormatter"])(this.locale, { month: 'short', timeZone: 'UTC' }, { start: 5, length: 2 });
}
},
methods: {
calculateTableDate: function calculateTableDate(delta) {
return "" + (parseInt(this.tableDate, 10) + Math.sign(delta || 1));
},
genTBody: function genTBody() {
var _this = this;
var children = [];
var cols = Array(3).fill(null);
var rows = 12 / cols.length;
var _loop_1 = function _loop_1(row) {
var tds = cols.map(function (_, col) {
var month = row * cols.length + col;
return _this.$createElement('td', {
key: month
}, [_this.genButton(_this.displayedYear + "-" + Object(_util__WEBPACK_IMPORTED_MODULE_3__["pad"])(month + 1), false)]);
});
children.push(this_1.$createElement('tr', {
key: row
}, tds));
};
var this_1 = this;
for (var row = 0; row < rows; row++) {
_loop_1(row);
}
return this.$createElement('tbody', children);
}
},
render: function render() {
return this.genTable('v-date-picker-table v-date-picker-table--month', [this.genTBody()]);
}
});
/***/ }),
/***/ "./src/components/VDatePicker/VDatePickerTitle.js":
/*!********************************************************!*\
!*** ./src/components/VDatePicker/VDatePickerTitle.js ***!
\********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_date_picker_title_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_date-picker-title.styl */ "./src/stylus/components/_date-picker-title.styl");
/* harmony import */ var _stylus_components_date_picker_title_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_date_picker_title_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _mixins_picker_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/picker-button */ "./src/mixins/picker-button.js");
// Components
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-date-picker-title',
mixins: [_mixins_picker_button__WEBPACK_IMPORTED_MODULE_2__["default"]],
props: {
date: {
type: String,
default: ''
},
selectingYear: Boolean,
year: {
type: [Number, String],
default: ''
},
yearIcon: {
type: String
},
value: {
type: String
}
},
data: function data() {
return {
isReversing: false
};
},
computed: {
computedTransition: function computedTransition() {
return this.isReversing ? 'picker-reverse-transition' : 'picker-transition';
}
},
watch: {
value: function value(val, prev) {
this.isReversing = val < prev;
}
},
methods: {
genYearIcon: function genYearIcon() {
return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], {
props: {
dark: true
}
}, this.yearIcon);
},
getYearBtn: function getYearBtn() {
return this.genPickerButton('selectingYear', true, [this.year, this.yearIcon ? this.genYearIcon() : null], 'v-date-picker-title__year');
},
genTitleText: function genTitleText() {
return this.$createElement('transition', {
props: {
name: this.computedTransition
}
}, [this.$createElement('div', {
domProps: { innerHTML: this.date || ' ' },
key: this.value
})]);
},
genTitleDate: function genTitleDate(title) {
return this.genPickerButton('selectingYear', false, this.genTitleText(title), 'v-date-picker-title__date');
}
},
render: function render(h) {
return h('div', {
staticClass: 'v-date-picker-title'
}, [this.getYearBtn(), this.genTitleDate()]);
}
});
/***/ }),
/***/ "./src/components/VDatePicker/VDatePickerYears.js":
/*!********************************************************!*\
!*** ./src/components/VDatePicker/VDatePickerYears.js ***!
\********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_date_picker_years_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_date-picker-years.styl */ "./src/stylus/components/_date-picker-years.styl");
/* harmony import */ var _stylus_components_date_picker_years_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_date_picker_years_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ "./src/components/VDatePicker/util/index.js");
// Mixins
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-date-picker-years',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"]],
props: {
format: {
type: Function,
default: null
},
locale: {
type: String,
default: 'en-us'
},
min: [Number, String],
max: [Number, String],
value: [Number, String]
},
data: function data() {
return {
defaultColor: 'primary'
};
},
computed: {
formatter: function formatter() {
return this.format || Object(_util__WEBPACK_IMPORTED_MODULE_2__["createNativeLocaleFormatter"])(this.locale, { year: 'numeric', timeZone: 'UTC' }, { length: 4 });
}
},
mounted: function mounted() {
var activeItem = this.$el.getElementsByClassName('active')[0];
if (activeItem) {
this.$el.scrollTop = activeItem.offsetTop - this.$el.offsetHeight / 2 + activeItem.offsetHeight / 2;
} else {
this.$el.scrollTop = this.$el.scrollHeight / 2 - this.$el.offsetHeight / 2;
}
},
methods: {
genYearItem: function genYearItem(year) {
var _this = this;
var formatted = this.formatter("" + year);
return this.$createElement('li', {
key: year,
'class': parseInt(this.value, 10) === year ? this.addTextColorClassChecks({ active: true }) : {},
on: {
click: function click() {
return _this.$emit('input', year);
}
}
}, formatted);
},
genYearItems: function genYearItems() {
var children = [];
var selectedYear = this.value ? parseInt(this.value, 10) : new Date().getFullYear();
var maxYear = this.max ? parseInt(this.max, 10) : selectedYear + 100;
var minYear = Math.min(maxYear, this.min ? parseInt(this.min, 10) : selectedYear - 100);
for (var year = maxYear; year >= minYear; year--) {
children.push(this.genYearItem(year));
}
return children;
}
},
render: function render() {
return this.$createElement('ul', {
staticClass: 'v-date-picker-years',
ref: 'years'
}, this.genYearItems());
}
});
/***/ }),
/***/ "./src/components/VDatePicker/index.js":
/*!*********************************************!*\
!*** ./src/components/VDatePicker/index.js ***!
\*********************************************/
/*! exports provided: VDatePicker, VDatePickerTitle, VDatePickerHeader, VDatePickerDateTable, VDatePickerMonthTable, VDatePickerYears, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VDatePicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDatePicker */ "./src/components/VDatePicker/VDatePicker.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePicker", function() { return _VDatePicker__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _VDatePickerTitle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VDatePickerTitle */ "./src/components/VDatePicker/VDatePickerTitle.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerTitle", function() { return _VDatePickerTitle__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _VDatePickerHeader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VDatePickerHeader */ "./src/components/VDatePicker/VDatePickerHeader.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerHeader", function() { return _VDatePickerHeader__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* harmony import */ var _VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VDatePickerDateTable */ "./src/components/VDatePicker/VDatePickerDateTable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerDateTable", function() { return _VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VDatePickerMonthTable */ "./src/components/VDatePicker/VDatePickerMonthTable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerMonthTable", function() { return _VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/* harmony import */ var _VDatePickerYears__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VDatePickerYears */ "./src/components/VDatePicker/VDatePickerYears.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePickerYears", function() { return _VDatePickerYears__WEBPACK_IMPORTED_MODULE_5__["default"]; });
/* istanbul ignore next */
_VDatePicker__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VDatePicker__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VDatePicker__WEBPACK_IMPORTED_MODULE_0__["default"]);
Vue.component(_VDatePickerTitle__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VDatePickerTitle__WEBPACK_IMPORTED_MODULE_1__["default"]);
Vue.component(_VDatePickerHeader__WEBPACK_IMPORTED_MODULE_2__["default"].name, _VDatePickerHeader__WEBPACK_IMPORTED_MODULE_2__["default"]);
Vue.component(_VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_3__["default"].name, _VDatePickerDateTable__WEBPACK_IMPORTED_MODULE_3__["default"]);
Vue.component(_VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_4__["default"].name, _VDatePickerMonthTable__WEBPACK_IMPORTED_MODULE_4__["default"]);
Vue.component(_VDatePickerYears__WEBPACK_IMPORTED_MODULE_5__["default"].name, _VDatePickerYears__WEBPACK_IMPORTED_MODULE_5__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VDatePicker__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VDatePicker/mixins/date-picker-table.js":
/*!****************************************************************!*\
!*** ./src/components/VDatePicker/mixins/date-picker-table.js ***!
\****************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_date_picker_table_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../stylus/components/_date-picker-table.styl */ "./src/stylus/components/_date-picker-table.styl");
/* harmony import */ var _stylus_components_date_picker_table_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_date_picker_table_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../directives/touch */ "./src/directives/touch.ts");
/* harmony import */ var _util_isDateAllowed__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! .././util/isDateAllowed */ "./src/components/VDatePicker/util/isDateAllowed.js");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Directives
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
directives: { Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_1__["default"] },
props: {
allowedDates: Function,
current: String,
disabled: Boolean,
format: {
type: Function,
default: null
},
locale: {
type: String,
default: 'en-us'
},
min: String,
max: String,
scrollable: Boolean,
tableDate: {
type: String,
required: true
},
value: {
type: String,
required: false
}
},
data: function data() {
return {
defaultColor: 'accent',
isReversing: false
};
},
computed: {
computedTransition: function computedTransition() {
return this.isReversing === !this.$vuetify.rtl ? 'tab-reverse-transition' : 'tab-transition';
},
displayedMonth: function displayedMonth() {
return this.tableDate.split('-')[1] - 1;
},
displayedYear: function displayedYear() {
return this.tableDate.split('-')[0] * 1;
}
},
watch: {
tableDate: function tableDate(newVal, oldVal) {
this.isReversing = newVal < oldVal;
}
},
methods: {
genButtonClasses: function genButtonClasses(value, isAllowed, isFloating) {
var isSelected = value === this.value;
var isCurrent = value === this.current;
var classes = __assign({ 'v-btn--active': isSelected, 'v-btn--flat': !isSelected, 'v-btn--icon': isSelected && isAllowed && isFloating, 'v-btn--floating': isFloating, 'v-btn--depressed': !isFloating && isSelected, 'v-btn--disabled': !isAllowed || this.disabled && isSelected, 'v-btn--outline': isCurrent && !isSelected }, this.themeClasses);
if (isSelected) return this.addBackgroundColorClassChecks(classes);
if (isCurrent) return this.addTextColorClassChecks(classes);
return classes;
},
genButton: function genButton(value, isFloating) {
var _this = this;
var isAllowed = Object(_util_isDateAllowed__WEBPACK_IMPORTED_MODULE_2__["default"])(value, this.min, this.max, this.allowedDates);
return this.$createElement('button', {
staticClass: 'v-btn',
'class': this.genButtonClasses(value, isAllowed, isFloating),
attrs: {
type: 'button'
},
domProps: {
disabled: !isAllowed,
innerHTML: "<div class=\"v-btn__content\">" + this.formatter(value) + "</div>"
},
on: this.disabled || !isAllowed ? {} : {
click: function click() {
return _this.$emit('input', value);
}
}
});
},
wheel: function wheel(e) {
e.preventDefault();
this.$emit('tableDate', this.calculateTableDate(e.deltaY));
},
touch: function touch(value) {
this.$emit('tableDate', this.calculateTableDate(value));
},
genTable: function genTable(staticClass, children) {
var _this = this;
var transition = this.$createElement('transition', {
props: { name: this.computedTransition }
}, [this.$createElement('table', { key: this.tableDate }, children)]);
var touchDirective = {
name: 'touch',
value: {
left: function left(e) {
return e.offsetX < -15 && _this.touch(1);
},
right: function right(e) {
return e.offsetX > 15 && _this.touch(-1);
}
}
};
return this.$createElement('div', {
staticClass: staticClass,
class: this.themeClasses,
on: this.scrollable ? { wheel: this.wheel } : undefined,
directives: [touchDirective]
}, [transition]);
}
}
});
/***/ }),
/***/ "./src/components/VDatePicker/util/createNativeLocaleFormatter.js":
/*!************************************************************************!*\
!*** ./src/components/VDatePicker/util/createNativeLocaleFormatter.js ***!
\************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _pad__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pad */ "./src/components/VDatePicker/util/pad.js");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
/* harmony default export */ __webpack_exports__["default"] = (function (locale, options, _a) {
var _b = _a === void 0 ? { start: 0, length: 0 } : _a,
start = _b.start,
length = _b.length;
var makeIsoString = function makeIsoString(dateString) {
var _a = __read(dateString.trim().split(' ')[0].split('-'), 3),
year = _a[0],
month = _a[1],
date = _a[2];
return [year, Object(_pad__WEBPACK_IMPORTED_MODULE_0__["default"])(month || 1), Object(_pad__WEBPACK_IMPORTED_MODULE_0__["default"])(date || 1)].join('-');
};
try {
var intlFormatter_1 = new Intl.DateTimeFormat(locale || undefined, options);
return function (dateString) {
return intlFormatter_1.format(new Date(makeIsoString(dateString) + "T00:00:00+00:00"));
};
} catch (e) {
return start || length ? function (dateString) {
return makeIsoString(dateString).substr(start, length);
} : null;
}
});
/***/ }),
/***/ "./src/components/VDatePicker/util/index.js":
/*!**************************************************!*\
!*** ./src/components/VDatePicker/util/index.js ***!
\**************************************************/
/*! exports provided: createNativeLocaleFormatter, monthChange, pad */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _createNativeLocaleFormatter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createNativeLocaleFormatter */ "./src/components/VDatePicker/util/createNativeLocaleFormatter.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createNativeLocaleFormatter", function() { return _createNativeLocaleFormatter__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _monthChange__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./monthChange */ "./src/components/VDatePicker/util/monthChange.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "monthChange", function() { return _monthChange__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _pad__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pad */ "./src/components/VDatePicker/util/pad.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return _pad__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/***/ }),
/***/ "./src/components/VDatePicker/util/isDateAllowed.js":
/*!**********************************************************!*\
!*** ./src/components/VDatePicker/util/isDateAllowed.js ***!
\**********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isDateAllowed; });
function isDateAllowed(date, min, max, allowedFn) {
return (!allowedFn || allowedFn(date)) && (!min || date >= min) && (!max || date <= max);
}
/***/ }),
/***/ "./src/components/VDatePicker/util/monthChange.js":
/*!********************************************************!*\
!*** ./src/components/VDatePicker/util/monthChange.js ***!
\********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _pad__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pad */ "./src/components/VDatePicker/util/pad.js");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
/**
* @param {String} value YYYY-MM format
* @param {Number} sign -1 or +1
*/
/* harmony default export */ __webpack_exports__["default"] = (function (value, sign) {
var _a = __read(value.split('-').map(function (v) {
return 1 * v;
}), 2),
year = _a[0],
month = _a[1];
if (month + sign === 0) {
return year - 1 + "-12";
} else if (month + sign === 13) {
return year + 1 + "-01";
} else {
return year + "-" + Object(_pad__WEBPACK_IMPORTED_MODULE_0__["default"])(month + sign);
}
});
/***/ }),
/***/ "./src/components/VDatePicker/util/pad.js":
/*!************************************************!*\
!*** ./src/components/VDatePicker/util/pad.js ***!
\************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
var padStart = function padStart(string, targetLength, padString) {
targetLength = targetLength >> 0;
string = String(string);
padString = String(padString);
if (string.length > targetLength) {
return String(string);
}
targetLength = targetLength - string.length;
if (targetLength > padString.length) {
padString += padString.repeat(targetLength / padString.length);
}
return padString.slice(0, targetLength) + String(string);
};
/* harmony default export */ __webpack_exports__["default"] = (function (n, length) {
if (length === void 0) {
length = 2;
}
return padStart(n, length, '0');
});
/***/ }),
/***/ "./src/components/VDialog/VDialog.js":
/*!*******************************************!*\
!*** ./src/components/VDialog/VDialog.js ***!
\*******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_dialogs_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_dialogs.styl */ "./src/stylus/components/_dialogs.styl");
/* harmony import */ var _stylus_components_dialogs_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_dialogs_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_dependent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/dependent */ "./src/mixins/dependent.js");
/* harmony import */ var _mixins_detachable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/detachable */ "./src/mixins/detachable.js");
/* harmony import */ var _mixins_overlayable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/overlayable */ "./src/mixins/overlayable.js");
/* harmony import */ var _mixins_returnable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/returnable */ "./src/mixins/returnable.js");
/* harmony import */ var _mixins_stackable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/stackable */ "./src/mixins/stackable.js");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Mixins
// Directives
// Helpers
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-dialog',
directives: {
ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_7__["default"]
},
mixins: [_mixins_dependent__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_detachable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_overlayable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_returnable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_stackable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_6__["default"]],
props: {
disabled: Boolean,
persistent: Boolean,
fullscreen: Boolean,
fullWidth: Boolean,
noClickAnimation: Boolean,
maxWidth: {
type: [String, Number],
default: 'none'
},
origin: {
type: String,
default: 'center center'
},
width: {
type: [String, Number],
default: 'auto'
},
scrollable: Boolean,
transition: {
type: [String, Boolean],
default: 'dialog-transition'
}
},
data: function data() {
return {
animate: false,
animateTimeout: null,
stackClass: 'v-dialog__content--active',
stackMinZIndex: 200
};
},
computed: {
classes: function classes() {
var _a;
return _a = {}, _a[("v-dialog " + this.contentClass).trim()] = true, _a['v-dialog--active'] = this.isActive, _a['v-dialog--persistent'] = this.persistent, _a['v-dialog--fullscreen'] = this.fullscreen, _a['v-dialog--scrollable'] = this.scrollable, _a['v-dialog--animated'] = this.animate, _a;
},
contentClasses: function contentClasses() {
return {
'v-dialog__content': true,
'v-dialog__content--active': this.isActive
};
}
},
watch: {
isActive: function isActive(val) {
if (val) {
this.show();
} else {
this.removeOverlay();
this.unbind();
}
}
},
mounted: function mounted() {
this.isBooted = this.isActive;
this.isActive && this.show();
},
beforeDestroy: function beforeDestroy() {
if (typeof window !== 'undefined') this.unbind();
},
methods: {
animateClick: function animateClick() {
var _this = this;
this.animate = false;
// Needed for when clicking very fast
// outside of the dialog
this.$nextTick(function () {
_this.animate = true;
clearTimeout(_this.animateTimeout);
_this.animateTimeout = setTimeout(function () {
return _this.animate = false;
}, 150);
});
},
closeConditional: function closeConditional(e) {
// If the dialog content contains
// the click event, or if the
// dialog is not active
if (this.$refs.content.contains(e.target) || !this.isActive) return false;
// If we made it here, the click is outside
// and is active. If persistent, and the
// click is on the overlay, animate
if (this.persistent) {
if (!this.noClickAnimation && this.overlay === e.target) this.animateClick();
return false;
}
// close dialog if !persistent, clicked outside and we're the topmost dialog.
// Since this should only be called in a capture event (bottom up), we shouldn't need to stop propagation
return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["getZIndex"])(this.$refs.content) >= this.getMaxZIndex();
},
show: function show() {
!this.fullscreen && !this.hideOverlay && this.genOverlay();
this.fullscreen && this.hideScroll();
this.$refs.content.focus();
this.$listeners.keydown && this.bind();
},
bind: function bind() {
window.addEventListener('keydown', this.onKeydown);
},
unbind: function unbind() {
window.removeEventListener('keydown', this.onKeydown);
},
onKeydown: function onKeydown(e) {
this.$emit('keydown', e);
}
},
render: function render(h) {
var _this = this;
var children = [];
var data = {
'class': this.classes,
ref: 'dialog',
directives: [{
name: 'click-outside',
value: function value() {
return _this.isActive = false;
},
args: {
closeConditional: this.closeConditional,
include: this.getOpenDependentElements
}
}, { name: 'show', value: this.isActive }],
on: {
click: function click(e) {
e.stopPropagation();
}
}
};
if (!this.fullscreen) {
data.style = {
maxWidth: this.maxWidth === 'none' ? undefined : Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.maxWidth),
width: this.width === 'auto' ? undefined : Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.width)
};
}
if (this.$slots.activator) {
children.push(h('div', {
staticClass: 'v-dialog__activator',
'class': {
'v-dialog__activator--disabled': this.disabled
},
on: {
click: function click(e) {
e.stopPropagation();
if (!_this.disabled) _this.isActive = !_this.isActive;
}
}
}, [this.$slots.activator]));
}
var dialog = h('div', data, this.showLazyContent(this.$slots.default));
if (this.transition) {
dialog = h('transition', {
props: {
name: this.transition,
origin: this.origin
}
}, [dialog]);
}
children.push(h('div', {
'class': this.contentClasses,
attrs: __assign({ tabIndex: '-1' }, this.getScopeIdAttrs()),
style: { zIndex: this.activeZIndex },
ref: 'content'
}, [dialog]));
return h('div', {
staticClass: 'v-dialog__container',
style: {
display: !this.$slots.activator || this.fullWidth ? 'block' : 'inline-block'
}
}, children);
}
});
/***/ }),
/***/ "./src/components/VDialog/index.js":
/*!*****************************************!*\
!*** ./src/components/VDialog/index.js ***!
\*****************************************/
/*! exports provided: VDialog, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VDialog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDialog */ "./src/components/VDialog/VDialog.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDialog", function() { return _VDialog__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VDialog__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VDialog__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VDialog__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VDialog__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VDivider/VDivider.ts":
/*!*********************************************!*\
!*** ./src/components/VDivider/VDivider.ts ***!
\*********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_dividers_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_dividers.styl */ "./src/stylus/components/_dividers.styl");
/* harmony import */ var _stylus_components_dividers_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_dividers_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Styles
// Types
// Mixins
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_1___default.a.extend({
name: 'v-divider',
functional: true,
props: __assign({}, _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"].options.props, { inset: Boolean, vertical: Boolean }),
render: function render(h, _a) {
var props = _a.props,
data = _a.data;
data.staticClass = ("v-divider " + (data.staticClass || '')).trim();
if (props.inset) data.staticClass += ' v-divider--inset';
if (props.vertical) data.staticClass += ' v-divider--vertical';
if (props.light) data.staticClass += ' theme--light';
if (props.dark) data.staticClass += ' theme--dark';
return h('hr', data);
}
}));
/***/ }),
/***/ "./src/components/VDivider/index.ts":
/*!******************************************!*\
!*** ./src/components/VDivider/index.ts ***!
\******************************************/
/*! exports provided: VDivider, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VDivider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VDivider */ "./src/components/VDivider/VDivider.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDivider", function() { return _VDivider__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VDivider__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VDivider__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VDivider__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VDivider__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VExpansionPanel/VExpansionPanel.ts":
/*!***********************************************************!*\
!*** ./src/components/VExpansionPanel/VExpansionPanel.ts ***!
\***********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_expansion_panel_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_expansion-panel.styl */ "./src/stylus/components/_expansion-panel.styl");
/* harmony import */ var _stylus_components_expansion_panel_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_expansion_panel_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_2__["provide"])('expansionPanel')).extend({
name: 'v-expansion-panel',
provide: function provide() {
return {
expansionPanel: this
};
},
props: {
disabled: Boolean,
readonly: Boolean,
expand: Boolean,
focusable: Boolean,
inset: Boolean,
popout: Boolean,
value: {
type: [Number, Array],
default: function _default() {
return null;
}
}
},
data: function data() {
return {
items: [],
open: []
};
},
computed: {
classes: function classes() {
return __assign({ 'v-expansion-panel--focusable': this.focusable, 'v-expansion-panel--popout': this.popout, 'v-expansion-panel--inset': this.inset }, this.themeClasses);
}
},
watch: {
expand: function expand(v) {
var openIndex = -1;
if (!v) {
// Close all panels unless only one is open
var openCount = this.open.reduce(function (acc, val) {
return val ? acc + 1 : acc;
}, 0);
var open = Array(this.items.length).fill(false);
if (openCount === 1) {
openIndex = this.open.indexOf(true);
}
if (openIndex > -1) {
open[openIndex] = true;
}
this.open = open;
}
this.$emit('input', v ? this.open : openIndex > -1 ? openIndex : null);
},
value: function value(v) {
this.updateFromValue(v);
}
},
mounted: function mounted() {
this.value !== null && this.updateFromValue(this.value);
},
methods: {
updateFromValue: function updateFromValue(v) {
if (Array.isArray(v) && !this.expand) return;
var open = Array(this.items.length).fill(false);
if (typeof v === 'number') {
open[v] = true;
} else if (v !== null) {
open = v;
}
this.updatePanels(open);
},
updatePanels: function updatePanels(open) {
this.open = open;
for (var i = 0; i < this.items.length; i++) {
var active = open && open[i];
this.items[i].toggle(active);
}
},
panelClick: function panelClick(uid) {
var open = this.expand ? this.open.slice() : Array(this.items.length).fill(false);
for (var i = 0; i < this.items.length; i++) {
if (this.items[i]._uid === uid) {
open[i] = !this.open[i];
!this.expand && this.$emit('input', open[i] ? i : null);
}
}
this.updatePanels(open);
if (this.expand) this.$emit('input', open);
},
register: function register(content) {
this.items.push(content);
this.open.push(false);
},
unregister: function unregister(content) {
var index = this.items.findIndex(function (i) {
return i._uid === content._uid;
});
this.items.splice(index, 1);
this.open.splice(index, 1);
}
},
render: function render(h) {
return h('ul', {
staticClass: 'v-expansion-panel',
class: this.classes
}, this.$slots.default);
}
}));
/***/ }),
/***/ "./src/components/VExpansionPanel/VExpansionPanelContent.ts":
/*!******************************************************************!*\
!*** ./src/components/VExpansionPanel/VExpansionPanelContent.ts ***!
\******************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.js");
/* harmony import */ var _mixins_bootable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/bootable */ "./src/mixins/bootable.ts");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _mixins_rippleable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/rippleable */ "./src/mixins/rippleable.ts");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
var __spread = undefined && undefined.__spread || function () {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}return ar;
};
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_6__["default"])(_mixins_bootable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_rippleable__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_4__["inject"])('expansionPanel', 'v-expansion-panel-content', 'v-expansion-panel')
/* @vue/component */
).extend({
name: 'v-expansion-panel-content',
props: {
disabled: Boolean,
readonly: Boolean,
expandIcon: {
type: String,
default: '$vuetify.icons.expand'
},
hideActions: Boolean,
ripple: {
type: [Boolean, Object],
default: false
}
},
data: function data() {
return {
height: 'auto'
};
},
computed: {
containerClasses: function containerClasses() {
return {
'v-expansion-panel__container--active': this.isActive,
'v-expansion-panel__container--disabled': this.isDisabled
};
},
isDisabled: function isDisabled() {
return this.expansionPanel.disabled || this.disabled;
},
isReadonly: function isReadonly() {
return this.expansionPanel.readonly || this.readonly;
}
},
mounted: function mounted() {
this.expansionPanel.register(this);
// Can be removed once fully deprecated
if (typeof this.value !== 'undefined') Object(_util_console__WEBPACK_IMPORTED_MODULE_7__["consoleWarn"])('v-model has been deprecated', this);
},
beforeDestroy: function beforeDestroy() {
this.expansionPanel.unregister(this);
},
methods: {
onKeydown: function onKeydown(e) {
// Ensure element is the activeElement
if (e.keyCode === 13 && this.$el === document.activeElement) this.expansionPanel.panelClick(this._uid);
},
onHeaderClick: function onHeaderClick() {
this.isReadonly || this.expansionPanel.panelClick(this._uid);
},
genBody: function genBody() {
return this.$createElement('div', {
ref: 'body',
class: 'v-expansion-panel__body',
directives: [{
name: 'show',
value: this.isActive
}]
}, this.showLazyContent(this.$slots.default));
},
genHeader: function genHeader() {
var children = __spread(this.$slots.header);
if (!this.hideActions) children.push(this.genIcon());
return this.$createElement('div', {
staticClass: 'v-expansion-panel__header',
directives: [{
name: 'ripple',
value: this.ripple
}],
on: {
click: this.onHeaderClick
}
}, children);
},
genIcon: function genIcon() {
var icon = this.$slots.actions || [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_5__["default"], this.expandIcon)];
return this.$createElement('transition', {
attrs: { name: 'fade-transition' }
}, [this.$createElement('div', {
staticClass: 'v-expansion-panel__header__icon',
directives: [{
name: 'show',
value: !this.isDisabled
}]
}, icon)]);
},
toggle: function toggle(active) {
var _this = this;
if (active) this.isBooted = true;
// We treat bootable differently
// Needs time to calc height
this.$nextTick(function () {
return _this.isActive = active;
});
}
},
render: function render(h) {
var children = [];
this.$slots.header && children.push(this.genHeader());
children.push(h(_transitions__WEBPACK_IMPORTED_MODULE_0__["VExpandTransition"], [this.genBody()]));
return h('li', {
staticClass: 'v-expansion-panel__container',
class: this.containerClasses,
attrs: {
tabindex: this.isReadonly || this.isDisabled ? null : 0
},
on: {
keydown: this.onKeydown
}
}, children);
}
}));
/***/ }),
/***/ "./src/components/VExpansionPanel/index.ts":
/*!*************************************************!*\
!*** ./src/components/VExpansionPanel/index.ts ***!
\*************************************************/
/*! exports provided: VExpansionPanel, VExpansionPanelContent, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VExpansionPanel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VExpansionPanel */ "./src/components/VExpansionPanel/VExpansionPanel.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanel", function() { return _VExpansionPanel__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _VExpansionPanelContent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VExpansionPanelContent */ "./src/components/VExpansionPanel/VExpansionPanelContent.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanelContent", function() { return _VExpansionPanelContent__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* istanbul ignore next */
_VExpansionPanel__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VExpansionPanel__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VExpansionPanel__WEBPACK_IMPORTED_MODULE_0__["default"]);
Vue.component(_VExpansionPanelContent__WEBPACK_IMPORTED_MODULE_1__["default"].options.name, _VExpansionPanelContent__WEBPACK_IMPORTED_MODULE_1__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VExpansionPanel__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VFooter/VFooter.js":
/*!*******************************************!*\
!*** ./src/components/VFooter/VFooter.js ***!
\*******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_footer_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_footer.styl */ "./src/stylus/components/_footer.styl");
/* harmony import */ var _stylus_components_footer_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_footer_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/applicationable */ "./src/mixins/applicationable.ts");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
// Styles
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-footer',
mixins: [Object(_mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__["default"])(null, ['height', 'inset']), _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]],
props: {
height: {
default: 32,
type: [Number, String]
},
inset: Boolean
},
computed: {
applicationProperty: function applicationProperty() {
return this.inset ? 'insetFooter' : 'footer';
},
computedMarginBottom: function computedMarginBottom() {
if (!this.app) return;
return this.$vuetify.application.bottom;
},
computedPaddingLeft: function computedPaddingLeft() {
return !this.app || !this.inset ? 0 : this.$vuetify.application.left;
},
computedPaddingRight: function computedPaddingRight() {
return !this.app ? 0 : this.$vuetify.application.right;
},
styles: function styles() {
var styles = {
height: isNaN(this.height) ? this.height : this.height + "px"
};
if (this.computedPaddingLeft) {
styles.paddingLeft = this.computedPaddingLeft + "px";
}
if (this.computedPaddingRight) {
styles.paddingRight = this.computedPaddingRight + "px";
}
if (this.computedMarginBottom) {
styles.marginBottom = this.computedMarginBottom + "px";
}
return styles;
}
},
methods: {
/**
* Update the application layout
*
* @return {number}
*/
updateApplication: function updateApplication() {
var height = parseInt(this.height);
return isNaN(height) ? this.$el ? this.$el.clientHeight : 0 : height;
}
},
render: function render(h) {
var data = {
staticClass: 'v-footer',
'class': this.addBackgroundColorClassChecks({
'v-footer--absolute': this.absolute,
'v-footer--fixed': !this.absolute && (this.app || this.fixed),
'v-footer--inset': this.inset,
'theme--dark': this.dark,
'theme--light': this.light
}),
style: this.styles,
ref: 'content'
};
return h('footer', data, this.$slots.default);
}
});
/***/ }),
/***/ "./src/components/VFooter/index.js":
/*!*****************************************!*\
!*** ./src/components/VFooter/index.js ***!
\*****************************************/
/*! exports provided: VFooter, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VFooter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VFooter */ "./src/components/VFooter/VFooter.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFooter", function() { return _VFooter__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VFooter__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VFooter__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VFooter__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VFooter__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VForm/VForm.js":
/*!***************************************!*\
!*** ./src/components/VForm/VForm.js ***!
\***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_forms_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_forms.styl */ "./src/stylus/components/_forms.styl");
/* harmony import */ var _stylus_components_forms_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_forms_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
// Styles
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-form',
mixins: [Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_1__["provide"])('form')],
inheritAttrs: false,
props: {
value: Boolean,
lazyValidation: Boolean
},
data: function data() {
return {
inputs: [],
watchers: [],
errorBag: {}
};
},
watch: {
errorBag: {
handler: function handler() {
var errors = Object.values(this.errorBag).includes(true);
this.$emit('input', !errors);
},
deep: true,
immediate: true
}
},
methods: {
watchInput: function watchInput(input) {
var _this = this;
var watcher = function watcher(input) {
return input.$watch('hasError', function (val) {
_this.$set(_this.errorBag, input._uid, val);
}, { immediate: true });
};
var watchers = {
_uid: input._uid,
valid: undefined,
shouldValidate: undefined
};
if (this.lazyValidation) {
// Only start watching inputs if we need to
watchers.shouldValidate = input.$watch('shouldValidate', function (val) {
if (!val) return;
// Only watch if we're not already doing it
if (_this.errorBag.hasOwnProperty(input._uid)) return;
watchers.valid = watcher(input);
});
} else {
watchers.valid = watcher(input);
}
return watchers;
},
validate: function validate() {
var errors = this.inputs.filter(function (input) {
return !input.validate(true);
}).length;
return !errors;
},
reset: function reset() {
var _this = this;
for (var i = this.inputs.length; i--;) {
this.inputs[i].reset();
}
if (this.lazyValidation) {
// Account for timeout in validatable
setTimeout(function () {
_this.errorBag = {};
}, 0);
}
},
register: function register(input) {
var unwatch = this.watchInput(input);
this.inputs.push(input);
this.watchers.push(unwatch);
},
unregister: function unregister(input) {
var found = this.inputs.find(function (i) {
return i._uid === input._uid;
});
if (!found) return;
var unwatch = this.watchers.find(function (i) {
return i._uid === found._uid;
});
unwatch.valid && unwatch.valid();
unwatch.shouldValidate && unwatch.shouldValidate();
this.watchers = this.watchers.filter(function (i) {
return i._uid !== found._uid;
});
this.inputs = this.inputs.filter(function (i) {
return i._uid !== found._uid;
});
this.$delete(this.errorBag, found._uid);
}
},
render: function render(h) {
var _this = this;
return h('form', {
staticClass: 'v-form',
attrs: Object.assign({
novalidate: true
}, this.$attrs),
on: {
submit: function submit(e) {
return _this.$emit('submit', e);
}
}
}, this.$slots.default);
}
});
/***/ }),
/***/ "./src/components/VForm/index.js":
/*!***************************************!*\
!*** ./src/components/VForm/index.js ***!
\***************************************/
/*! exports provided: VForm, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VForm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VForm */ "./src/components/VForm/VForm.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VForm", function() { return _VForm__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VForm__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VForm__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VForm__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VForm__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VGrid/VContainer.js":
/*!********************************************!*\
!*** ./src/components/VGrid/VContainer.js ***!
\********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_grid_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_grid.styl */ "./src/stylus/components/_grid.styl");
/* harmony import */ var _stylus_components_grid_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_grid_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./grid */ "./src/components/VGrid/grid.js");
/* harmony default export */ __webpack_exports__["default"] = (Object(_grid__WEBPACK_IMPORTED_MODULE_1__["default"])('container'));
/***/ }),
/***/ "./src/components/VGrid/VContent.js":
/*!******************************************!*\
!*** ./src/components/VGrid/VContent.js ***!
\******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_content_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_content.styl */ "./src/stylus/components/_content.styl");
/* harmony import */ var _stylus_components_content_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_content_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/ssr-bootable */ "./src/mixins/ssr-bootable.ts");
// Styles
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-content',
mixins: [_mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_1__["default"]],
props: {
tag: {
type: String,
default: 'main'
}
},
computed: {
styles: function styles() {
var _a = this.$vuetify.application,
bar = _a.bar,
top = _a.top,
right = _a.right,
footer = _a.footer,
insetFooter = _a.insetFooter,
bottom = _a.bottom,
left = _a.left;
return {
paddingTop: top + bar + "px",
paddingRight: right + "px",
paddingBottom: footer + insetFooter + bottom + "px",
paddingLeft: left + "px"
};
}
},
render: function render(h) {
var data = {
staticClass: 'v-content',
style: this.styles,
ref: 'content'
};
return h(this.tag, data, [h('div', { staticClass: 'v-content__wrap' }, this.$slots.default)]);
}
});
/***/ }),
/***/ "./src/components/VGrid/VFlex.js":
/*!***************************************!*\
!*** ./src/components/VGrid/VFlex.js ***!
\***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_grid_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_grid.styl */ "./src/stylus/components/_grid.styl");
/* harmony import */ var _stylus_components_grid_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_grid_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./grid */ "./src/components/VGrid/grid.js");
/* harmony default export */ __webpack_exports__["default"] = (Object(_grid__WEBPACK_IMPORTED_MODULE_1__["default"])('flex'));
/***/ }),
/***/ "./src/components/VGrid/VLayout.js":
/*!*****************************************!*\
!*** ./src/components/VGrid/VLayout.js ***!
\*****************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_grid_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_grid.styl */ "./src/stylus/components/_grid.styl");
/* harmony import */ var _stylus_components_grid_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_grid_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./grid */ "./src/components/VGrid/grid.js");
/* harmony default export */ __webpack_exports__["default"] = (Object(_grid__WEBPACK_IMPORTED_MODULE_1__["default"])('layout'));
/***/ }),
/***/ "./src/components/VGrid/grid.js":
/*!**************************************!*\
!*** ./src/components/VGrid/grid.js ***!
\**************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Grid; });
function Grid(name) {
/* @vue/component */
return {
name: "v-" + name,
functional: true,
props: {
id: String,
tag: {
type: String,
default: 'div'
}
},
render: function render(h, _a) {
var props = _a.props,
data = _a.data,
children = _a.children;
data.staticClass = (name + " " + (data.staticClass || '')).trim();
if (data.attrs) {
var classes = Object.keys(data.attrs).filter(function (key) {
// TODO: Remove once resolved
// https://github.com/vuejs/vue/issues/7841
if (key === 'slot') return false;
var value = data.attrs[key];
return value || typeof value === 'string';
});
if (classes.length) data.staticClass += " " + classes.join(' ');
delete data.attrs;
}
if (props.id) {
data.domProps = data.domProps || {};
data.domProps.id = props.id;
}
return h(props.tag, data, children);
}
};
}
/***/ }),
/***/ "./src/components/VGrid/index.js":
/*!***************************************!*\
!*** ./src/components/VGrid/index.js ***!
\***************************************/
/*! exports provided: VContainer, VContent, VFlex, VLayout, VSpacer, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSpacer", function() { return VSpacer; });
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _VContent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VContent */ "./src/components/VGrid/VContent.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VContent", function() { return _VContent__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _VContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VContainer */ "./src/components/VGrid/VContainer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VContainer", function() { return _VContainer__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* harmony import */ var _VFlex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VFlex */ "./src/components/VGrid/VFlex.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFlex", function() { return _VFlex__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _VLayout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VLayout */ "./src/components/VGrid/VLayout.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VLayout", function() { return _VLayout__WEBPACK_IMPORTED_MODULE_4__["default"]; });
var VSpacer = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('spacer', 'div', 'v-spacer');
var VGrid = {};
/* istanbul ignore next */
VGrid.install = function install(Vue) {
Vue.component(_VContent__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VContent__WEBPACK_IMPORTED_MODULE_1__["default"]);
Vue.component(_VContainer__WEBPACK_IMPORTED_MODULE_2__["default"].name, _VContainer__WEBPACK_IMPORTED_MODULE_2__["default"]);
Vue.component(_VFlex__WEBPACK_IMPORTED_MODULE_3__["default"].name, _VFlex__WEBPACK_IMPORTED_MODULE_3__["default"]);
Vue.component(_VLayout__WEBPACK_IMPORTED_MODULE_4__["default"].name, _VLayout__WEBPACK_IMPORTED_MODULE_4__["default"]);
Vue.component(VSpacer.name, VSpacer);
};
/* harmony default export */ __webpack_exports__["default"] = (VGrid);
/***/ }),
/***/ "./src/components/VIcon/VIcon.ts":
/*!***************************************!*\
!*** ./src/components/VIcon/VIcon.ts ***!
\***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_icons_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_icons.styl */ "./src/stylus/components/_icons.styl");
/* harmony import */ var _stylus_components_icons_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_icons_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Mixins
// Util
var SIZE_MAP;
(function (SIZE_MAP) {
SIZE_MAP["small"] = "16px";
SIZE_MAP["default"] = "24px";
SIZE_MAP["medium"] = "28px";
SIZE_MAP["large"] = "36px";
SIZE_MAP["xLarge"] = "40px";
})(SIZE_MAP || (SIZE_MAP = {}));
function isFontAwesome5(iconType) {
return ['fas', 'far', 'fal', 'fab'].some(function (val) {
return iconType.includes(val);
});
}
var ICONS_PREFIX = '$vuetify.icons.';
// This remaps internal names like '$vuetify.icons.cancel' to the current name
// for that icon. Note the parent component is needed for $vuetify because
// VIcon is a functional component. This function only looks at the
// immediate parent, so it won't remap for a nested functional components.
function remapInternalIcon(parent, iconName) {
if (!iconName.startsWith(ICONS_PREFIX)) {
// return original icon name unchanged
return iconName;
}
// Now look up icon indirection name, e.g. '$vuetify.icons.cancel':
return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["getObjectValueByPath"])(parent, iconName) || iconName;
}
var addTextColorClassChecks = _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"].options.methods.addTextColorClassChecks;
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
name: 'v-icon',
functional: true,
props: {
// TODO: inherit these
color: String,
dark: Boolean,
light: Boolean,
disabled: Boolean,
large: Boolean,
left: Boolean,
medium: Boolean,
right: Boolean,
size: {
type: [Number, String]
},
small: Boolean,
xLarge: Boolean
},
render: function render(h, _a) {
var props = _a.props,
data = _a.data,
parent = _a.parent,
_b = _a.listeners,
listeners = _b === void 0 ? {} : _b,
_c = _a.children,
children = _c === void 0 ? [] : _c;
var small = props.small,
medium = props.medium,
large = props.large,
xLarge = props.xLarge;
var sizes = { small: small, medium: medium, large: large, xLarge: xLarge };
var explicitSize = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["keys"])(sizes).find(function (key) {
return sizes[key] && !!key;
});
var fontSize = explicitSize && SIZE_MAP[explicitSize] || Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(props.size);
var newChildren = [];
if (fontSize) data.style = __assign({ fontSize: fontSize }, data.style);
var iconName = '';
if (children.length) iconName = children[0].text;
// Support usage of v-text and v-html
else if (data.domProps) {
iconName = data.domProps.textContent || data.domProps.innerHTML || iconName;
// Remove nodes so it doesn't
// overwrite our changes
delete data.domProps.textContent;
delete data.domProps.innerHTML;
}
// Remap internal names like '$vuetify.icons.cancel' to the current name for that icon
iconName = remapInternalIcon(parent, iconName);
var iconType = 'material-icons';
// Material Icon delimiter is _
// https://material.io/icons/
var delimiterIndex = iconName.indexOf('-');
var isCustomIcon = delimiterIndex > -1;
if (isCustomIcon) {
iconType = iconName.slice(0, delimiterIndex);
if (isFontAwesome5(iconType)) iconType = '';
// Assume if not a custom icon
// is Material Icon font
} else newChildren.push(iconName);
data.attrs = data.attrs || {};
if (!('aria-hidden' in data.attrs)) {
data.attrs['aria-hidden'] = true;
}
var classes = __assign({}, props.color && addTextColorClassChecks.call(props, {}, props.color), { 'v-icon--disabled': props.disabled, 'v-icon--left': props.left, 'v-icon--link': listeners.click || listeners['!click'], 'v-icon--right': props.right, 'theme--dark': props.dark, 'theme--light': props.light });
// Order classes
// * Component class
// * Vuetify classes
// * Icon Classes
data.staticClass = ['v-icon', data.staticClass, Object.keys(classes).filter(function (k) {
return classes[k];
}).join(' '), iconType, isCustomIcon ? iconName : null].filter(function (val) {
return !!val;
}).join(' ').trim();
return h('i', data, newChildren);
}
}));
/***/ }),
/***/ "./src/components/VIcon/index.ts":
/*!***************************************!*\
!*** ./src/components/VIcon/index.ts ***!
\***************************************/
/*! exports provided: VIcon, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VIcon */ "./src/components/VIcon/VIcon.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VIcon", function() { return _VIcon__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VIcon__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VInput/VInput.js":
/*!*****************************************!*\
!*** ./src/components/VInput/VInput.js ***!
\*****************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_inputs_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_inputs.styl */ "./src/stylus/components/_inputs.styl");
/* harmony import */ var _stylus_components_inputs_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_inputs_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _VLabel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VLabel */ "./src/components/VLabel/index.js");
/* harmony import */ var _VMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VMessages */ "./src/components/VMessages/index.js");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_loadable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/loadable */ "./src/mixins/loadable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _mixins_validatable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/validatable */ "./src/mixins/validatable.js");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Styles
// Components
// Mixins
// Utilities
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-input',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_loadable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__["default"], _mixins_validatable__WEBPACK_IMPORTED_MODULE_7__["default"]],
props: {
appendIcon: String,
/** @deprecated */
appendIconCb: Function,
backgroundColor: {
type: String,
default: ''
},
disabled: Boolean,
height: [Number, String],
hideDetails: Boolean,
hint: String,
label: String,
persistentHint: Boolean,
prependIcon: String,
/** @deprecated */
prependIconCb: Function,
readonly: Boolean,
value: { required: false }
},
data: function data(vm) {
return {
lazyValue: vm.value,
isFocused: false
};
},
computed: {
classesInput: function classesInput() {
return __assign({}, this.classes, { 'v-input--has-state': this.hasState, 'v-input--hide-details': this.hideDetails, 'v-input--is-label-active': this.isLabelActive, 'v-input--is-dirty': this.isDirty, 'v-input--is-disabled': this.disabled, 'v-input--is-focused': this.isFocused, 'v-input--is-loading': this.loading !== false, 'v-input--is-readonly': this.readonly }, this.addTextColorClassChecks({}, this.validationState), this.themeClasses);
},
directivesInput: function directivesInput() {
return [];
},
hasHint: function hasHint() {
return !this.hasMessages && this.hint && (this.persistentHint || this.isFocused);
},
hasLabel: function hasLabel() {
return Boolean(this.$slots.label || this.label);
},
// Proxy for `lazyValue`
// This allows an input
// to function without
// a provided model
internalValue: {
get: function get() {
return this.lazyValue;
},
set: function set(val) {
this.lazyValue = val;
this.$emit(this.$_modelEvent, val);
}
},
isDirty: function isDirty() {
return !!this.lazyValue;
},
isDisabled: function isDisabled() {
return Boolean(this.disabled || this.readonly);
},
isLabelActive: function isLabelActive() {
return this.isDirty;
}
},
watch: {
value: function value(val) {
this.lazyValue = val;
}
},
beforeCreate: function beforeCreate() {
// v-radio-group needs to emit a different event
// https://github.com/vuetifyjs/vuetify/issues/4752
this.$_modelEvent = this.$options.model && this.$options.model.event || 'input';
},
methods: {
genContent: function genContent() {
return [this.genPrependSlot(), this.genControl(), this.genAppendSlot()];
},
genControl: function genControl() {
return this.$createElement('div', {
staticClass: 'v-input__control'
}, [this.genInputSlot(), this.genMessages()]);
},
genDefaultSlot: function genDefaultSlot() {
return [this.genLabel(), this.$slots.default];
},
// TODO: remove shouldDeprecate (2.0), used for clearIcon
genIcon: function genIcon(type, cb, shouldDeprecate) {
var _this = this;
if (shouldDeprecate === void 0) {
shouldDeprecate = true;
}
var icon = this[type + "Icon"];
var eventName = "click:" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["kebabCase"])(type);
cb = cb || this[type + "IconCb"];
if (shouldDeprecate && type && cb) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_9__["deprecate"])(":" + type + "-icon-cb", "@" + eventName, this);
}
var data = {
props: {
color: this.validationState,
dark: this.dark,
disabled: this.disabled,
light: this.light
},
on: !(this.$listeners[eventName] || cb) ? null : {
click: function click(e) {
e.preventDefault();
e.stopPropagation();
_this.$emit(eventName, e);
cb && cb(e);
},
// Container has mouseup event that will
// trigger menu open if enclosed
mouseup: function mouseup(e) {
e.preventDefault();
e.stopPropagation();
}
}
};
return this.$createElement('div', {
staticClass: "v-input__icon v-input__icon--" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["kebabCase"])(type),
key: "" + type + icon
}, [this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], data, icon)]);
},
genInputSlot: function genInputSlot() {
return this.$createElement('div', {
staticClass: 'v-input__slot',
class: this.addBackgroundColorClassChecks({}, this.backgroundColor),
style: { height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.height) },
directives: this.directivesInput,
on: {
click: this.onClick,
mousedown: this.onMouseDown,
mouseup: this.onMouseUp
},
ref: 'input-slot'
}, [this.genDefaultSlot(), this.genProgress()]);
},
genLabel: function genLabel() {
if (!this.hasLabel) return null;
return this.$createElement(_VLabel__WEBPACK_IMPORTED_MODULE_2__["default"], {
props: {
color: this.validationState,
dark: this.dark,
focused: this.hasState,
for: this.$attrs.id,
light: this.light
}
}, this.$slots.label || this.label);
},
genMessages: function genMessages() {
if (this.hideDetails) return null;
var messages = this.hasHint ? [this.hint] : this.validations;
return this.$createElement(_VMessages__WEBPACK_IMPORTED_MODULE_3__["default"], {
props: {
color: this.hasHint ? '' : this.validationState,
dark: this.dark,
light: this.light,
value: this.hasMessages || this.hasHint ? messages : []
}
});
},
genSlot: function genSlot(type, location, slot) {
if (!slot.length) return null;
var ref = type + "-" + location;
return this.$createElement('div', {
staticClass: "v-input__" + ref,
ref: ref
}, slot);
},
genPrependSlot: function genPrependSlot() {
var slot = [];
if (this.$slots['prepend']) {
slot.push(this.$slots['prepend']);
} else if (this.prependIcon) {
slot.push(this.genIcon('prepend'));
}
return this.genSlot('prepend', 'outer', slot);
},
genAppendSlot: function genAppendSlot() {
var slot = [];
// Append icon for text field was really
// an appended inner icon, v-text-field
// will overwrite this method in order to obtain
// backwards compat
if (this.$slots['append']) {
slot.push(this.$slots['append']);
} else if (this.appendIcon) {
slot.push(this.genIcon('append'));
}
return this.genSlot('append', 'outer', slot);
},
onClick: function onClick(e) {
this.$emit('click', e);
},
onMouseDown: function onMouseDown(e) {
this.$emit('mousedown', e);
},
onMouseUp: function onMouseUp(e) {
this.$emit('mouseup', e);
}
},
render: function render(h) {
return h('div', {
staticClass: 'v-input',
attrs: this.attrsInput,
'class': this.classesInput
}, this.genContent());
}
});
/***/ }),
/***/ "./src/components/VInput/index.js":
/*!****************************************!*\
!*** ./src/components/VInput/index.js ***!
\****************************************/
/*! exports provided: VInput, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VInput */ "./src/components/VInput/VInput.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VInput", function() { return _VInput__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VInput__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VInput__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VInput__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VInput__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VJumbotron/VJumbotron.js":
/*!*************************************************!*\
!*** ./src/components/VJumbotron/VJumbotron.js ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_jumbotrons_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_jumbotrons.styl */ "./src/stylus/components/_jumbotrons.styl");
/* harmony import */ var _stylus_components_jumbotrons_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_jumbotrons_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-jumbotron',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_routable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]],
props: {
gradient: String,
height: {
type: [Number, String],
default: '400px'
},
src: String,
tag: {
type: String,
default: 'div'
}
},
computed: {
backgroundStyles: function backgroundStyles() {
var styles = {};
if (this.gradient) {
styles.background = "linear-gradient(" + this.gradient + ")";
}
return styles;
},
classes: function classes() {
return {
'theme--dark': this.dark,
'theme--light': this.light
};
},
styles: function styles() {
return {
height: this.height
};
}
},
methods: {
genBackground: function genBackground() {
return this.$createElement('div', {
staticClass: 'v-jumbotron__background',
'class': this.addBackgroundColorClassChecks(),
style: this.backgroundStyles
});
},
genContent: function genContent() {
return this.$createElement('div', {
staticClass: 'v-jumbotron__content'
}, this.$slots.default);
},
genImage: function genImage() {
if (!this.src) return null;
if (this.$slots.img) return this.$slots.img({ src: this.src });
return this.$createElement('img', {
staticClass: 'v-jumbotron__image',
attrs: { src: this.src }
});
},
genWrapper: function genWrapper() {
return this.$createElement('div', {
staticClass: 'v-jumbotron__wrapper'
}, [this.genImage(), this.genBackground(), this.genContent()]);
}
},
render: function render(h) {
var _a = this.generateRouteLink(),
tag = _a.tag,
data = _a.data;
data.staticClass = 'v-jumbotron';
data.style = this.styles;
return h(tag, data, [this.genWrapper()]);
}
});
/***/ }),
/***/ "./src/components/VJumbotron/index.js":
/*!********************************************!*\
!*** ./src/components/VJumbotron/index.js ***!
\********************************************/
/*! exports provided: VJumbotron, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VJumbotron__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VJumbotron */ "./src/components/VJumbotron/VJumbotron.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VJumbotron", function() { return _VJumbotron__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VJumbotron__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VJumbotron__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VJumbotron__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VJumbotron__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VLabel/VLabel.js":
/*!*****************************************!*\
!*** ./src/components/VLabel/VLabel.js ***!
\*****************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_labels_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_labels.styl */ "./src/stylus/components/_labels.styl");
/* harmony import */ var _stylus_components_labels_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_labels_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Styles
// Mixins
// Helpers
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-label',
functional: true,
mixins: [_mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]],
props: {
absolute: Boolean,
color: {
type: [Boolean, String],
default: 'primary'
},
disabled: Boolean,
focused: Boolean,
for: String,
left: {
type: [Number, String],
default: 0
},
right: {
type: [Number, String],
default: 'auto'
},
value: Boolean
},
render: function render(h, _a) {
var children = _a.children,
listeners = _a.listeners,
props = _a.props;
var data = {
staticClass: 'v-label',
'class': __assign({ 'v-label--active': props.value, 'v-label--is-disabled': props.disabled }, _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"].options.computed.themeClasses.call(props)),
attrs: {
for: props.for,
'aria-hidden': !props.for
},
on: listeners,
style: {
left: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(props.left),
right: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["convertToUnit"])(props.right),
position: props.absolute ? 'absolute' : 'relative'
}
};
if (props.focused) {
data.class = _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"].options.methods.addTextColorClassChecks(data.class, props.color);
}
return h('label', data, children);
}
});
/***/ }),
/***/ "./src/components/VLabel/index.js":
/*!****************************************!*\
!*** ./src/components/VLabel/index.js ***!
\****************************************/
/*! exports provided: VLabel, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VLabel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VLabel */ "./src/components/VLabel/VLabel.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VLabel", function() { return _VLabel__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VLabel__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VLabel__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VLabel__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VLabel__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VList/VList.js":
/*!***************************************!*\
!*** ./src/components/VList/VList.js ***!
\***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_lists_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_lists.styl */ "./src/stylus/components/_lists.styl");
/* harmony import */ var _stylus_components_lists_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_lists_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
// Styles
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-list',
mixins: [Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_2__["provide"])('list'), _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"]],
provide: function provide() {
return {
'listClick': this.listClick
};
},
props: {
dense: Boolean,
expand: Boolean,
subheader: Boolean,
threeLine: Boolean,
twoLine: Boolean
},
data: function data() {
return {
groups: []
};
},
computed: {
classes: function classes() {
return {
'v-list--dense': this.dense,
'v-list--subheader': this.subheader,
'v-list--two-line': this.twoLine,
'v-list--three-line': this.threeLine,
'theme--dark': this.dark,
'theme--light': this.light
};
}
},
methods: {
register: function register(uid, cb) {
this.groups.push({ uid: uid, cb: cb });
},
unregister: function unregister(uid) {
var index = this.groups.findIndex(function (g) {
return g.uid === uid;
});
if (index > -1) {
this.groups.splice(index, 1);
}
},
listClick: function listClick(uid) {
if (this.expand) return;
for (var i = this.groups.length; i--;) {
this.groups[i].cb(uid);
}
}
},
render: function render(h) {
var data = {
staticClass: 'v-list',
'class': this.classes
};
return h('div', data, [this.$slots.default]);
}
});
/***/ }),
/***/ "./src/components/VList/VListGroup.js":
/*!********************************************!*\
!*** ./src/components/VList/VListGroup.js ***!
\********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _components_VIcon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../components/VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _mixins_bootable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/bootable */ "./src/mixins/bootable.ts");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.js");
// Components
// Mixins
// Transitions
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-list-group',
mixins: [_mixins_bootable__WEBPACK_IMPORTED_MODULE_1__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_3__["inject"])('list', 'v-list-group', 'v-list'), _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__["default"]],
inject: ['listClick'],
props: {
activeClass: {
type: String,
default: 'primary--text'
},
appendIcon: {
type: String,
default: '$vuetify.icons.expand'
},
disabled: Boolean,
group: String,
noAction: Boolean,
prependIcon: String,
subGroup: Boolean
},
data: function data() {
return {
groups: []
};
},
computed: {
groupClasses: function groupClasses() {
return {
'v-list__group--active': this.isActive,
'v-list__group--disabled': this.disabled
};
},
headerClasses: function headerClasses() {
return {
'v-list__group__header--active': this.isActive,
'v-list__group__header--sub-group': this.subGroup
};
},
itemsClasses: function itemsClasses() {
return {
'v-list__group__items--no-action': this.noAction
};
}
},
watch: {
isActive: function isActive(val) {
if (!this.subGroup && val) {
this.listClick(this._uid);
}
},
$route: function $route(to) {
var isActive = this.matchRoute(to.path);
if (this.group) {
if (isActive && this.isActive !== isActive) {
this.listClick(this._uid);
}
this.isActive = isActive;
}
}
},
mounted: function mounted() {
this.list.register(this._uid, this.toggle);
if (this.group && this.$route && this.value == null) {
this.isActive = this.matchRoute(this.$route.path);
}
},
beforeDestroy: function beforeDestroy() {
this.list.unregister(this._uid);
},
methods: {
click: function click() {
if (this.disabled) return;
this.isActive = !this.isActive;
},
genIcon: function genIcon(icon) {
return this.$createElement(_components_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"], icon);
},
genAppendIcon: function genAppendIcon() {
var icon = !this.subGroup ? this.appendIcon : false;
if (!icon && !this.$slots.appendIcon) return null;
return this.$createElement('div', {
staticClass: 'v-list__group__header__append-icon'
}, [this.$slots.appendIcon || this.genIcon(icon)]);
},
genGroup: function genGroup() {
return this.$createElement('div', {
staticClass: 'v-list__group__header',
'class': this.headerClasses,
on: Object.assign({}, {
click: this.click
}, this.$listeners),
ref: 'item'
}, [this.genPrependIcon(), this.$slots.activator, this.genAppendIcon()]);
},
genItems: function genItems() {
return this.$createElement('div', {
staticClass: 'v-list__group__items',
'class': this.itemsClasses,
directives: [{
name: 'show',
value: this.isActive
}],
ref: 'group'
}, this.showLazyContent(this.$slots.default));
},
genPrependIcon: function genPrependIcon() {
var _a;
var icon = this.prependIcon ? this.prependIcon : this.subGroup ? '$vuetify.icons.subgroup' : false;
if (!icon && !this.$slots.prependIcon) return null;
return this.$createElement('div', {
staticClass: 'v-list__group__header__prepend-icon',
'class': (_a = {}, _a[this.activeClass] = this.isActive, _a)
}, [this.$slots.prependIcon || this.genIcon(icon)]);
},
toggle: function toggle(uid) {
this.isActive = this._uid === uid;
},
matchRoute: function matchRoute(to) {
if (!this.group) return false;
return to.match(this.group) !== null;
}
},
render: function render(h) {
return h('div', {
staticClass: 'v-list__group',
'class': this.groupClasses
}, [this.genGroup(), h(_transitions__WEBPACK_IMPORTED_MODULE_4__["VExpandTransition"], [this.genItems()])]);
}
});
/***/ }),
/***/ "./src/components/VList/VListTile.js":
/*!*******************************************!*\
!*** ./src/components/VList/VListTile.js ***!
\*******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable.ts");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Mixins
// Directives
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-list-tile',
directives: {
Ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_3__["default"]
},
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_0__["default"], _mixins_routable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__["default"]],
inheritAttrs: false,
props: {
activeClass: {
type: String,
default: 'primary--text'
},
avatar: Boolean,
inactive: Boolean,
tag: String
},
data: function data() {
return {
proxyClass: 'v-list__tile--active'
};
},
computed: {
listClasses: function listClasses() {
return this.disabled ? 'v-list--disabled' : this.color ? this.addTextColorClassChecks() : this.defaultColor;
},
classes: function classes() {
var _a;
return _a = {
'v-list__tile': true,
'v-list__tile--link': this.isLink && !this.inactive,
'v-list__tile--avatar': this.avatar,
'v-list__tile--disabled': this.disabled,
'v-list__tile--active': !this.to && this.isActive
}, _a[this.activeClass] = this.isActive, _a;
},
isLink: function isLink() {
return this.href || this.to || this.$listeners && (this.$listeners.click || this.$listeners['!click']);
}
},
render: function render(h) {
var isRouteLink = !this.inactive && this.isLink;
var _a = isRouteLink ? this.generateRouteLink() : {
tag: this.tag || 'div',
data: {
class: this.classes
}
},
tag = _a.tag,
data = _a.data;
data.attrs = Object.assign({}, data.attrs, this.$attrs);
return h('div', {
'class': this.listClasses,
attrs: {
disabled: this.disabled
},
on: __assign({}, this.$listeners)
}, [h(tag, data, this.$slots.default)]);
}
});
/***/ }),
/***/ "./src/components/VList/VListTileAction.js":
/*!*************************************************!*\
!*** ./src/components/VList/VListTileAction.js ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-list-tile-action',
functional: true,
render: function render(h, _a) {
var data = _a.data,
children = _a.children;
data.staticClass = data.staticClass ? "v-list__tile__action " + data.staticClass : 'v-list__tile__action';
if ((children || []).length > 1) data.staticClass += ' v-list__tile__action--stack';
return h('div', data, children);
}
});
/***/ }),
/***/ "./src/components/VList/VListTileAvatar.js":
/*!*************************************************!*\
!*** ./src/components/VList/VListTileAvatar.js ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VAvatar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VAvatar */ "./src/components/VAvatar/index.ts");
// Components
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-list-tile-avatar',
functional: true,
props: {
color: String,
size: {
type: [Number, String],
default: 40
},
tile: Boolean
},
render: function render(h, _a) {
var data = _a.data,
children = _a.children,
props = _a.props;
data.staticClass = ("v-list__tile__avatar " + (data.staticClass || '')).trim();
var avatar = h(_VAvatar__WEBPACK_IMPORTED_MODULE_0__["default"], {
props: {
color: props.color,
size: props.size,
tile: props.tile
}
}, [children]);
return h('div', data, [avatar]);
}
});
/***/ }),
/***/ "./src/components/VList/index.js":
/*!***************************************!*\
!*** ./src/components/VList/index.js ***!
\***************************************/
/*! exports provided: VList, VListGroup, VListTile, VListTileAction, VListTileAvatar, VListTileActionText, VListTileContent, VListTileTitle, VListTileSubTitle, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VListTileActionText", function() { return VListTileActionText; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VListTileContent", function() { return VListTileContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VListTileTitle", function() { return VListTileTitle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VListTileSubTitle", function() { return VListTileSubTitle; });
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _VList__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VList */ "./src/components/VList/VList.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VList", function() { return _VList__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _VListGroup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VListGroup */ "./src/components/VList/VListGroup.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListGroup", function() { return _VListGroup__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* harmony import */ var _VListTile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VListTile */ "./src/components/VList/VListTile.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListTile", function() { return _VListTile__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _VListTileAction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VListTileAction */ "./src/components/VList/VListTileAction.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListTileAction", function() { return _VListTileAction__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/* harmony import */ var _VListTileAvatar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VListTileAvatar */ "./src/components/VList/VListTileAvatar.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VListTileAvatar", function() { return _VListTileAvatar__WEBPACK_IMPORTED_MODULE_5__["default"]; });
var VListTileActionText = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-list__tile__action-text', 'span');
var VListTileContent = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-list__tile__content', 'div');
var VListTileTitle = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-list__tile__title', 'div');
var VListTileSubTitle = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-list__tile__sub-title', 'div');
/* istanbul ignore next */
_VList__WEBPACK_IMPORTED_MODULE_1__["default"].install = function install(Vue) {
Vue.component(_VList__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VList__WEBPACK_IMPORTED_MODULE_1__["default"]);
Vue.component(_VListGroup__WEBPACK_IMPORTED_MODULE_2__["default"].name, _VListGroup__WEBPACK_IMPORTED_MODULE_2__["default"]);
Vue.component(_VListTile__WEBPACK_IMPORTED_MODULE_3__["default"].name, _VListTile__WEBPACK_IMPORTED_MODULE_3__["default"]);
Vue.component(_VListTileAction__WEBPACK_IMPORTED_MODULE_4__["default"].name, _VListTileAction__WEBPACK_IMPORTED_MODULE_4__["default"]);
Vue.component(VListTileActionText.name, VListTileActionText);
Vue.component(_VListTileAvatar__WEBPACK_IMPORTED_MODULE_5__["default"].name, _VListTileAvatar__WEBPACK_IMPORTED_MODULE_5__["default"]);
Vue.component(VListTileContent.name, VListTileContent);
Vue.component(VListTileSubTitle.name, VListTileSubTitle);
Vue.component(VListTileTitle.name, VListTileTitle);
};
/* harmony default export */ __webpack_exports__["default"] = (_VList__WEBPACK_IMPORTED_MODULE_1__["default"]);
/***/ }),
/***/ "./src/components/VMenu/VMenu.js":
/*!***************************************!*\
!*** ./src/components/VMenu/VMenu.js ***!
\***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_menus_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_menus.styl */ "./src/stylus/components/_menus.styl");
/* harmony import */ var _stylus_components_menus_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_menus_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_delayable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/delayable */ "./src/mixins/delayable.ts");
/* harmony import */ var _mixins_dependent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/dependent */ "./src/mixins/dependent.js");
/* harmony import */ var _mixins_detachable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/detachable */ "./src/mixins/detachable.js");
/* harmony import */ var _mixins_menuable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/menuable.js */ "./src/mixins/menuable.js");
/* harmony import */ var _mixins_returnable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/returnable */ "./src/mixins/returnable.js");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _mixins_menu_activator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mixins/menu-activator */ "./src/components/VMenu/mixins/menu-activator.js");
/* harmony import */ var _mixins_menu_generators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./mixins/menu-generators */ "./src/components/VMenu/mixins/menu-generators.js");
/* harmony import */ var _mixins_menu_keyable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./mixins/menu-keyable */ "./src/components/VMenu/mixins/menu-keyable.js");
/* harmony import */ var _mixins_menu_position__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./mixins/menu-position */ "./src/components/VMenu/mixins/menu-position.js");
/* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside.ts");
/* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
// Mixins
// Component level mixins
// Directives
// Helpers
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-menu',
directives: {
ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_11__["default"],
Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_12__["default"]
},
mixins: [_mixins_menu_activator__WEBPACK_IMPORTED_MODULE_7__["default"], _mixins_dependent__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_delayable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_detachable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_menu_generators__WEBPACK_IMPORTED_MODULE_8__["default"], _mixins_menu_keyable__WEBPACK_IMPORTED_MODULE_9__["default"], _mixins_menuable_js__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_menu_position__WEBPACK_IMPORTED_MODULE_10__["default"], _mixins_returnable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_6__["default"]],
props: {
auto: Boolean,
closeOnClick: {
type: Boolean,
default: true
},
closeOnContentClick: {
type: Boolean,
default: true
},
disabled: Boolean,
fullWidth: Boolean,
maxHeight: { default: 'auto' },
offsetX: Boolean,
offsetY: Boolean,
openOnClick: {
type: Boolean,
default: true
},
openOnHover: Boolean,
origin: {
type: String,
default: 'top left'
},
transition: {
type: [Boolean, String],
default: 'v-menu-transition'
}
},
data: function data() {
return {
defaultOffset: 8,
maxHeightAutoDefault: '200px',
startIndex: 3,
stopIndex: 0,
hasJustFocused: false,
resizeTimeout: null
};
},
computed: {
calculatedLeft: function calculatedLeft() {
if (!this.auto) return this.calcLeft();
return this.calcXOverflow(this.calcLeftAuto()) + "px";
},
calculatedMaxHeight: function calculatedMaxHeight() {
return this.auto ? '200px' : Object(_util_helpers__WEBPACK_IMPORTED_MODULE_13__["convertToUnit"])(this.maxHeight);
},
calculatedMaxWidth: function calculatedMaxWidth() {
return isNaN(this.maxWidth) ? this.maxWidth : this.maxWidth + "px";
},
calculatedMinWidth: function calculatedMinWidth() {
if (this.minWidth) {
return isNaN(this.minWidth) ? this.minWidth : this.minWidth + "px";
}
var minWidth = this.dimensions.activator.width + this.nudgeWidth + (this.auto ? 16 : 0);
var calculatedMaxWidth = isNaN(parseInt(this.calculatedMaxWidth)) ? minWidth : parseInt(this.calculatedMaxWidth);
return Math.min(calculatedMaxWidth, minWidth) + "px";
},
calculatedTop: function calculatedTop() {
if (!this.auto || this.isAttached) return this.calcTop();
return this.calcYOverflow(this.calcTopAuto()) + "px";
},
styles: function styles() {
return {
maxHeight: this.calculatedMaxHeight,
minWidth: this.calculatedMinWidth,
maxWidth: this.calculatedMaxWidth,
top: this.calculatedTop,
left: this.calculatedLeft,
transformOrigin: this.origin,
zIndex: this.zIndex || this.activeZIndex
};
},
tileHeight: function tileHeight() {
return this.dense ? 36 : 48;
}
},
watch: {
activator: function activator(newActivator, oldActivator) {
this.removeActivatorEvents(oldActivator);
this.addActivatorEvents(newActivator);
},
isContentActive: function isContentActive(val) {
this.hasJustFocused = val;
}
},
methods: {
activate: function activate() {
// This exists primarily for v-select
// helps determine which tiles to activate
this.getTiles();
// Update coordinates and dimensions of menu
// and its activator
this.updateDimensions();
// Start the transition
requestAnimationFrame(this.startTransition);
// Once transitioning, calculate scroll position
setTimeout(this.calculateScroll, 50);
},
closeConditional: function closeConditional() {
return this.isActive && this.closeOnClick;
},
onResize: function onResize() {
if (!this.isActive) return;
// Account for screen resize
// and orientation change
// eslint-disable-next-line no-unused-expressions
this.$refs.content.offsetWidth;
this.updateDimensions();
// When resizing to a smaller width
// content width is evaluated before
// the new activator width has been
// set, causing it to not size properly
// hacky but will revisit in the future
clearTimeout(this.resizeTimeout);
this.resizeTimeout = setTimeout(this.updateDimensions, 100);
}
},
render: function render(h) {
var data = {
staticClass: 'v-menu',
class: { 'v-menu--inline': !this.fullWidth && this.$slots.activator },
directives: [{
arg: 500,
name: 'resize',
value: this.onResize
}],
on: {
keydown: this.changeListIndex
}
};
return h('div', data, [this.genActivator(), this.genTransition()]);
}
});
/***/ }),
/***/ "./src/components/VMenu/index.js":
/*!***************************************!*\
!*** ./src/components/VMenu/index.js ***!
\***************************************/
/*! exports provided: VMenu, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VMenu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VMenu */ "./src/components/VMenu/VMenu.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VMenu", function() { return _VMenu__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VMenu__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VMenu__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VMenu__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VMenu__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VMenu/mixins/menu-activator.js":
/*!*******************************************************!*\
!*** ./src/components/VMenu/mixins/menu-activator.js ***!
\*******************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Menu activator
*
* @mixin
*
* Handles the click and hover activation
* Supports slotted and detached activators
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
activatorClickHandler: function activatorClickHandler(e) {
if (this.disabled) return;
if (this.openOnClick && !this.isActive) {
this.getActivator().focus();
this.isActive = true;
this.absoluteX = e.clientX;
this.absoluteY = e.clientY;
} else if (this.closeOnClick && this.isActive) {
this.getActivator().blur();
this.isActive = false;
}
},
mouseEnterHandler: function mouseEnterHandler() {
var _this = this;
this.runDelay('open', function () {
if (_this.hasJustFocused) return;
_this.hasJustFocused = true;
_this.isActive = true;
});
},
mouseLeaveHandler: function mouseLeaveHandler(e) {
var _this = this;
// Prevent accidental re-activation
this.runDelay('close', function () {
if (_this.$refs.content.contains(e.relatedTarget)) return;
requestAnimationFrame(function () {
_this.isActive = false;
_this.callDeactivate();
});
});
},
addActivatorEvents: function addActivatorEvents(activator) {
if (activator === void 0) {
activator = null;
}
if (!activator) return;
activator.addEventListener('click', this.activatorClickHandler);
},
removeActivatorEvents: function removeActivatorEvents(activator) {
if (activator === void 0) {
activator = null;
}
if (!activator) return;
activator.removeEventListener('click', this.activatorClickHandler);
}
}
});
/***/ }),
/***/ "./src/components/VMenu/mixins/menu-generators.js":
/*!********************************************************!*\
!*** ./src/components/VMenu/mixins/menu-generators.js ***!
\********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
var __spread = undefined && undefined.__spread || function () {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}return ar;
};
/**
* Menu generators
*
* @mixin
*
* Used for creating the DOM elements for VMenu
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
genActivator: function genActivator() {
if (!this.$slots.activator) return null;
var options = {
staticClass: 'v-menu__activator',
'class': {
'v-menu__activator--active': this.hasJustFocused || this.isActive,
'v-menu__activator--disabled': this.disabled
},
ref: 'activator',
on: {}
};
if (this.openOnHover) {
options.on['mouseenter'] = this.mouseEnterHandler;
options.on['mouseleave'] = this.mouseLeaveHandler;
} else if (this.openOnClick) {
options.on['click'] = this.activatorClickHandler;
}
return this.$createElement('div', options, this.$slots.activator);
},
genTransition: function genTransition() {
if (!this.transition) return this.genContent();
return this.$createElement('transition', {
props: {
name: this.transition
}
}, [this.genContent()]);
},
genDirectives: function genDirectives() {
var _this = this;
// Do not add click outside for hover menu
var directives = !this.openOnHover && this.closeOnClick ? [{
name: 'click-outside',
value: function value() {
return _this.isActive = false;
},
args: {
closeConditional: this.closeConditional,
include: function include() {
return __spread([_this.$el], _this.getOpenDependentElements());
}
}
}] : [];
directives.push({
name: 'show',
value: this.isContentActive
});
return directives;
},
genContent: function genContent() {
var _this = this;
var _a;
var options = {
attrs: this.getScopeIdAttrs(),
staticClass: 'v-menu__content',
'class': (_a = {}, _a[this.contentClass.trim()] = true, _a['v-menu__content--auto'] = this.auto, _a['menuable__content__active'] = this.isActive, _a['theme--dark'] = this.dark, _a['theme--light'] = this.light, _a),
style: this.styles,
directives: this.genDirectives(),
ref: 'content',
on: {
click: function click(e) {
e.stopPropagation();
if (e.target.getAttribute('disabled')) return;
if (_this.closeOnContentClick) _this.isActive = false;
}
}
};
!this.disabled && this.openOnHover && (options.on.mouseenter = this.mouseEnterHandler);
this.openOnHover && (options.on.mouseleave = this.mouseLeaveHandler);
return this.$createElement('div', options, this.showLazyContent(this.$slots.default));
}
}
});
/***/ }),
/***/ "./src/components/VMenu/mixins/menu-keyable.js":
/*!*****************************************************!*\
!*** ./src/components/VMenu/mixins/menu-keyable.js ***!
\*****************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/helpers */ "./src/util/helpers.ts");
/**
* Menu keyable
*
* @mixin
*
* Primarily used to support VSelect
* Handles opening and closing of VMenu from keystrokes
* Will conditionally highlight VListTiles for VSelect
*/
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
data: function data() {
return {
listIndex: -1,
tiles: []
};
},
watch: {
isActive: function isActive(val) {
if (!val) this.listIndex = -1;
},
listIndex: function listIndex(next, prev) {
if (next in this.tiles) {
var tile = this.tiles[next];
tile.classList.add('v-list__tile--highlighted');
this.$refs.content.scrollTop = tile.offsetTop - tile.clientHeight;
}
prev in this.tiles && this.tiles[prev].classList.remove('v-list__tile--highlighted');
}
},
methods: {
changeListIndex: function changeListIndex(e) {
if ([_util_helpers__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].down, _util_helpers__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].up, _util_helpers__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].enter].includes(e.keyCode)) e.preventDefault();
if ([_util_helpers__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].esc, _util_helpers__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].tab].includes(e.keyCode)) {
return this.isActive = false;
}
// For infinite scroll and autocomplete, re-evaluate children
this.getTiles();
if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].down && this.listIndex < this.tiles.length - 1) {
this.listIndex++;
// Allow user to set listIndex to -1 so
// that the list can be un-highlighted
} else if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].up && this.listIndex > -1) {
this.listIndex--;
} else if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].enter && this.listIndex !== -1) {
this.tiles[this.listIndex].click();
}
},
getTiles: function getTiles() {
this.tiles = this.$refs.content.querySelectorAll('.v-list__tile');
}
}
});
/***/ }),
/***/ "./src/components/VMenu/mixins/menu-position.js":
/*!******************************************************!*\
!*** ./src/components/VMenu/mixins/menu-position.js ***!
\******************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Menu position
*
* @mixin
*
* Used for calculating an automatic position (used for VSelect)
* Will position the VMenu content properly over the VSelect
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
// Revisit this
calculateScroll: function calculateScroll() {
if (this.selectedIndex === null) return;
var scrollTop = 0;
if (this.selectedIndex >= this.stopIndex) {
scrollTop = this.$refs.content.scrollHeight;
} else if (this.selectedIndex > this.startIndex) {
scrollTop =
// Top position of selected item
this.selectedIndex * this.tileHeight +
// Remove half of a tile's height
this.tileHeight / 2 +
// Account for padding offset on lists
this.defaultOffset / 2 -
// Half of the auto content's height
100;
}
if (this.$refs.content) {
this.$refs.content.scrollTop = scrollTop;
}
},
calcLeftAuto: function calcLeftAuto() {
if (this.isAttached) return 0;
return parseInt(this.dimensions.activator.left - this.defaultOffset * 2);
},
calcTopAuto: function calcTopAuto() {
var selectedIndex = Array.from(this.tiles).findIndex(function (n) {
return n.classList.contains('v-list__tile--active');
});
if (selectedIndex === -1) {
this.selectedIndex = null;
return this.computedTop;
}
this.selectedIndex = selectedIndex;
this.stopIndex = this.tiles.length > 4 ? this.tiles.length - 4 : this.tiles.length;
var additionalOffset = this.defaultOffset;
var offsetPadding;
// Menu should be centered
if (selectedIndex > this.startIndex && selectedIndex < this.stopIndex) {
offsetPadding = 1.5 * this.tileHeight;
// Menu should be offset top
} else if (selectedIndex >= this.stopIndex) {
// Being offset top means
// we have to account for top
// and bottom list padding
additionalOffset *= 2;
offsetPadding = (selectedIndex - this.stopIndex) * this.tileHeight;
// Menu should be offset bottom
} else {
offsetPadding = selectedIndex * this.tileHeight;
}
return this.computedTop + additionalOffset - offsetPadding - this.tileHeight / 2;
}
}
});
/***/ }),
/***/ "./src/components/VMessages/VMessages.js":
/*!***********************************************!*\
!*** ./src/components/VMessages/VMessages.js ***!
\***********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_messages_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_messages.styl */ "./src/stylus/components/_messages.styl");
/* harmony import */ var _stylus_components_messages_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_messages_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Styles
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-messages',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]],
props: {
value: {
type: Array,
default: function _default() {
return [];
}
}
},
computed: {
classes: function classes() {
return this.addTextColorClassChecks();
}
},
methods: {
genChildren: function genChildren() {
var _this = this;
return this.$createElement('transition-group', {
staticClass: 'v-messages__wrapper',
attrs: {
name: 'message-transition',
tag: 'div'
}
}, this.value.map(function (m) {
return _this.genMessage(m);
}));
},
genMessage: function genMessage(key) {
return this.$createElement('div', {
staticClass: 'v-messages__message',
key: key,
domProps: {
innerHTML: key
}
});
}
},
render: function render(h) {
return h('div', {
staticClass: 'v-messages',
'class': __assign({}, this.classes, this.themeClasses)
}, [this.genChildren()]);
}
});
/***/ }),
/***/ "./src/components/VMessages/index.js":
/*!*******************************************!*\
!*** ./src/components/VMessages/index.js ***!
\*******************************************/
/*! exports provided: VMessages, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VMessages */ "./src/components/VMessages/VMessages.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VMessages", function() { return _VMessages__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VMessages__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VMessages__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VMessages__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VMessages__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VNavigationDrawer/VNavigationDrawer.js":
/*!***************************************************************!*\
!*** ./src/components/VNavigationDrawer/VNavigationDrawer.js ***!
\***************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_navigation_drawer_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_navigation-drawer.styl */ "./src/stylus/components/_navigation-drawer.styl");
/* harmony import */ var _stylus_components_navigation_drawer_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_navigation_drawer_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/applicationable */ "./src/mixins/applicationable.ts");
/* harmony import */ var _mixins_overlayable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/overlayable */ "./src/mixins/overlayable.js");
/* harmony import */ var _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/ssr-bootable */ "./src/mixins/ssr-bootable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside.ts");
/* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize.ts");
/* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
// Mixins
// Directives
// Helpers
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-navigation-drawer',
directives: {
ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_5__["default"],
Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_6__["default"],
Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_7__["default"]
},
mixins: [Object(_mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__["default"])(null, ['miniVariant', 'right', 'width']), _mixins_overlayable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_4__["default"]],
props: {
clipped: Boolean,
disableRouteWatcher: Boolean,
disableResizeWatcher: Boolean,
height: {
type: [Number, String],
default: '100%'
},
floating: Boolean,
miniVariant: Boolean,
miniVariantWidth: {
type: [Number, String],
default: 80
},
mobileBreakPoint: {
type: [Number, String],
default: 1264
},
permanent: Boolean,
right: Boolean,
stateless: Boolean,
temporary: Boolean,
touchless: Boolean,
width: {
type: [Number, String],
default: 300
},
value: { required: false }
},
data: function data() {
return {
isActive: false,
touchArea: {
left: 0,
right: 0
}
};
},
computed: {
/**
* Used for setting an app
* value from a dynamic
* property. Called from
* applicationable.js
*
* @return {string}
*/
applicationProperty: function applicationProperty() {
return this.right ? 'right' : 'left';
},
calculatedTransform: function calculatedTransform() {
if (this.isActive) return 0;
return this.right ? this.calculatedWidth : -this.calculatedWidth;
},
calculatedWidth: function calculatedWidth() {
return this.miniVariant ? this.miniVariantWidth : this.width;
},
classes: function classes() {
return {
'v-navigation-drawer': true,
'v-navigation-drawer--absolute': this.absolute,
'v-navigation-drawer--clipped': this.clipped,
'v-navigation-drawer--close': !this.isActive,
'v-navigation-drawer--fixed': !this.absolute && (this.app || this.fixed),
'v-navigation-drawer--floating': this.floating,
'v-navigation-drawer--is-mobile': this.isMobile,
'v-navigation-drawer--mini-variant': this.miniVariant,
'v-navigation-drawer--open': this.isActive,
'v-navigation-drawer--right': this.right,
'v-navigation-drawer--temporary': this.temporary,
'theme--dark': this.dark,
'theme--light': this.light
};
},
hasApp: function hasApp() {
return this.app && !this.isMobile && !this.temporary;
},
isMobile: function isMobile() {
return !this.stateless && !this.permanent && !this.temporary && this.$vuetify.breakpoint.width < parseInt(this.mobileBreakPoint, 10);
},
marginTop: function marginTop() {
if (!this.hasApp) return 0;
var marginTop = this.$vuetify.application.bar;
marginTop += this.clipped ? this.$vuetify.application.top : 0;
return marginTop;
},
maxHeight: function maxHeight() {
if (!this.hasApp) return null;
var maxHeight = this.$vuetify.application.bottom + this.$vuetify.application.footer + this.$vuetify.application.bar;
if (!this.clipped) return maxHeight;
return maxHeight + this.$vuetify.application.top;
},
reactsToClick: function reactsToClick() {
return !this.stateless && !this.permanent && (this.isMobile || this.temporary);
},
reactsToMobile: function reactsToMobile() {
return !this.disableResizeWatcher && !this.stateless && !this.permanent && !this.temporary;
},
reactsToRoute: function reactsToRoute() {
return !this.disableRouteWatcher && !this.stateless && (this.temporary || this.isMobile);
},
resizeIsDisabled: function resizeIsDisabled() {
return this.disableResizeWatcher || this.stateless;
},
showOverlay: function showOverlay() {
return this.isActive && (this.isMobile || this.temporary);
},
styles: function styles() {
var styles = {
height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_8__["convertToUnit"])(this.height),
marginTop: this.marginTop + "px",
maxHeight: "calc(100% - " + +this.maxHeight + "px)",
transform: "translateX(" + this.calculatedTransform + "px)",
width: this.calculatedWidth + "px"
};
return styles;
}
},
watch: {
$route: function $route() {
if (this.reactsToRoute && this.closeConditional()) {
this.isActive = false;
}
},
isActive: function isActive(val) {
this.$emit('input', val);
this.callUpdate();
},
/**
* When mobile changes, adjust
* the active state only when
* there has been a previous
* value
*/
isMobile: function isMobile(val, prev) {
!val && this.isActive && !this.temporary && this.removeOverlay();
if (prev == null || this.resizeIsDisabled || !this.reactsToMobile) return;
this.isActive = !val;
this.callUpdate();
},
permanent: function permanent(val) {
// If enabling prop
// enable the drawer
if (val) {
this.isActive = true;
}
this.callUpdate();
},
showOverlay: function showOverlay(val) {
if (val) this.genOverlay();else this.removeOverlay();
},
temporary: function temporary() {
this.callUpdate();
},
value: function value(val) {
if (this.permanent) return;
if (val == null) return this.init();
if (val !== this.isActive) this.isActive = val;
}
},
beforeMount: function beforeMount() {
this.init();
},
methods: {
calculateTouchArea: function calculateTouchArea() {
if (!this.$el.parentNode) return;
var parentRect = this.$el.parentNode.getBoundingClientRect();
this.touchArea = {
left: parentRect.left + 50,
right: parentRect.right - 50
};
},
closeConditional: function closeConditional() {
return this.isActive && this.reactsToClick;
},
genDirectives: function genDirectives() {
var _this = this;
var directives = [{
name: 'click-outside',
value: function value() {
return _this.isActive = false;
},
args: {
closeConditional: this.closeConditional
}
}];
!this.touchless && directives.push({
name: 'touch',
value: {
parent: true,
left: this.swipeLeft,
right: this.swipeRight
}
});
return directives;
},
/**
* Sets state before mount to avoid
* entry transitions in SSR
*
* @return {void}
*/
init: function init() {
if (this.permanent) {
this.isActive = true;
} else if (this.stateless || this.value != null) {
this.isActive = this.value;
} else if (!this.temporary) {
this.isActive = !this.isMobile;
}
},
swipeRight: function swipeRight(e) {
if (this.isActive && !this.right) return;
this.calculateTouchArea();
if (Math.abs(e.touchendX - e.touchstartX) < 100) return;
if (!this.right && e.touchstartX <= this.touchArea.left) this.isActive = true;else if (this.right && this.isActive) this.isActive = false;
},
swipeLeft: function swipeLeft(e) {
if (this.isActive && this.right) return;
this.calculateTouchArea();
if (Math.abs(e.touchendX - e.touchstartX) < 100) return;
if (this.right && e.touchstartX >= this.touchArea.right) this.isActive = true;else if (!this.right && this.isActive) this.isActive = false;
},
/**
* Update the application layout
*
* @return {number}
*/
updateApplication: function updateApplication() {
return !this.isActive || this.temporary || this.isMobile ? 0 : this.calculatedWidth;
}
},
render: function render(h) {
var _this = this;
var data = {
'class': this.classes,
style: this.styles,
directives: this.genDirectives(),
on: {
click: function click() {
if (!_this.miniVariant) return;
_this.$emit('update:miniVariant', false);
},
transitionend: function transitionend(e) {
if (e.target !== e.currentTarget) return;
_this.$emit('transitionend', e);
// IE11 does not support new Event('resize')
var resizeEvent = document.createEvent('UIEvents');
resizeEvent.initUIEvent('resize', true, false, window, 0);
window.dispatchEvent(resizeEvent);
}
}
};
return h('aside', data, [this.$slots.default, h('div', { 'class': 'v-navigation-drawer__border' })]);
}
});
/***/ }),
/***/ "./src/components/VNavigationDrawer/index.js":
/*!***************************************************!*\
!*** ./src/components/VNavigationDrawer/index.js ***!
\***************************************************/
/*! exports provided: VNavigationDrawer, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VNavigationDrawer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VNavigationDrawer */ "./src/components/VNavigationDrawer/VNavigationDrawer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VNavigationDrawer", function() { return _VNavigationDrawer__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VNavigationDrawer__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VNavigationDrawer__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VNavigationDrawer__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VNavigationDrawer__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VOverflowBtn/VOverflowBtn.js":
/*!*****************************************************!*\
!*** ./src/components/VOverflowBtn/VOverflowBtn.js ***!
\*****************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_overflow_buttons_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_overflow-buttons.styl */ "./src/stylus/components/_overflow-buttons.styl");
/* harmony import */ var _stylus_components_overflow_buttons_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_overflow_buttons_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSelect/VSelect */ "./src/components/VSelect/VSelect.js");
/* harmony import */ var _VAutocomplete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VAutocomplete */ "./src/components/VAutocomplete/index.js");
/* harmony import */ var _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VTextField/VTextField */ "./src/components/VTextField/VTextField.js");
/* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../VBtn */ "./src/components/VBtn/index.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
// Styles
// Extensions
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-overflow-btn',
extends: _VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"],
props: {
segmented: Boolean,
editable: Boolean,
transition: _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].props.transition
},
computed: {
classes: function classes() {
return Object.assign(_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].computed.classes.call(this), {
'v-overflow-btn': true,
'v-overflow-btn--segmented': this.segmented,
'v-overflow-btn--editable': this.editable
});
},
isAnyValueAllowed: function isAnyValueAllowed() {
return this.editable || _VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].computed.isAnyValueAllowed.call(this);
},
isSingle: function isSingle() {
return true;
},
computedItems: function computedItems() {
return this.segmented ? this.allItems : this.filteredItems;
}
},
methods: {
genSelections: function genSelections() {
return this.editable ? _VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"].methods.genSelections.call(this) : _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.genSelections.call(this); // Override v-autocomplete's override
},
genCommaSelection: function genCommaSelection(item, index, last) {
return this.segmented ? this.genSegmentedBtn(item) : _VSelect_VSelect__WEBPACK_IMPORTED_MODULE_1__["default"].methods.genCommaSelection.call(this, item, index, last);
},
genInput: function genInput() {
var input = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_3__["default"].methods.genInput.call(this);
input.data.domProps.value = this.editable ? this.internalSearch : '';
input.data.attrs.readonly = !this.isAnyValueAllowed;
return input;
},
genLabel: function genLabel() {
if (this.editable && this.isFocused) return null;
var label = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_3__["default"].methods.genLabel.call(this);
if (!label) return label;
// Reset previously set styles from parent
label.data.style = {};
return label;
},
genSegmentedBtn: function genSegmentedBtn(item) {
var _this = this;
var itemValue = this.getValue(item);
var itemObj = this.computedItems.find(function (i) {
return _this.getValue(i) === itemValue;
}) || item;
if (!itemObj.text || !itemObj.callback) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["consoleWarn"])('When using \'segmented\' prop without a selection slot, items must contain both a text and callback property', this);
return null;
}
return this.$createElement(_VBtn__WEBPACK_IMPORTED_MODULE_4__["default"], {
props: { flat: true },
on: {
click: function click(e) {
e.stopPropagation();
itemObj.callback(e);
}
}
}, [itemObj.text]);
},
setSelectedItems: function setSelectedItems() {
if (this.internalValue == null) {
this.selectedItems = [];
} else {
this.selectedItems = [this.internalValue];
}
}
}
});
/***/ }),
/***/ "./src/components/VOverflowBtn/index.js":
/*!**********************************************!*\
!*** ./src/components/VOverflowBtn/index.js ***!
\**********************************************/
/*! exports provided: VOverflowBtn, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VOverflowBtn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VOverflowBtn */ "./src/components/VOverflowBtn/VOverflowBtn.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VOverflowBtn", function() { return _VOverflowBtn__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VOverflowBtn__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VOverflowBtn__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VOverflowBtn__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VOverflowBtn__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VPagination/VPagination.js":
/*!***************************************************!*\
!*** ./src/components/VPagination/VPagination.js ***!
\***************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_pagination_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_pagination.styl */ "./src/stylus/components/_pagination.styl");
/* harmony import */ var _stylus_components_pagination_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_pagination_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize.ts");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
var __spread = undefined && undefined.__spread || function () {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}return ar;
};
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-pagination',
directives: { Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_2__["default"] },
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"]],
props: {
circle: Boolean,
disabled: Boolean,
length: {
type: Number,
default: 0,
validator: function validator(val) {
return val % 1 === 0;
}
},
totalVisible: [Number, String],
nextIcon: {
type: String,
default: '$vuetify.icons.next'
},
prevIcon: {
type: String,
default: '$vuetify.icons.prev'
},
value: {
type: Number,
default: 0
}
},
data: function data() {
return {
maxButtons: 0,
defaultColor: 'primary'
};
},
computed: {
classes: function classes() {
return {
'v-pagination': true,
'v-pagination--circle': this.circle,
'v-pagination--disabled': this.disabled
};
},
items: function items() {
var maxLength = this.totalVisible || this.maxButtons;
if (this.length <= maxLength) {
return this.range(1, this.length);
}
var even = maxLength % 2 === 0 ? 1 : 0;
var left = Math.floor(maxLength / 2);
var right = this.length - left + 1 + even;
if (this.value > left && this.value < right) {
var start = this.value - left + 2;
var end = this.value + left - 2 - even;
return __spread([1, '...'], this.range(start, end), ['...', this.length]);
} else {
return __spread(this.range(1, left), ['...'], this.range(this.length - left + 1 + even, this.length));
}
}
},
watch: {
value: function value() {
this.init();
}
},
mounted: function mounted() {
this.init();
},
methods: {
init: function init() {
var _this = this;
this.selected = null;
this.$nextTick(this.onResize);
// TODO: Change this (f75dee3a, cbdf7caa)
setTimeout(function () {
return _this.selected = _this.value;
}, 100);
},
onResize: function onResize() {
var width = this.$el && this.$el.parentNode ? this.$el.parentNode.clientWidth : window.innerWidth;
this.maxButtons = Math.floor((width - 96) / 42);
},
next: function next(e) {
e.preventDefault();
this.$emit('input', this.value + 1);
this.$emit('next');
},
previous: function previous(e) {
e.preventDefault();
this.$emit('input', this.value - 1);
this.$emit('previous');
},
range: function range(from, to) {
var range = [];
from = from > 0 ? from : 1;
for (var i = from; i <= to; i++) {
range.push(i);
}
return range;
},
genIcon: function genIcon(h, icon, disabled, fn) {
return h('li', [h('button', {
staticClass: 'v-pagination__navigation',
class: {
'v-pagination__navigation--disabled': disabled
},
on: disabled ? {} : { click: fn }
}, [h(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], [icon])])]);
},
genItem: function genItem(h, i) {
var _this = this;
return h('button', {
staticClass: 'v-pagination__item',
class: i === this.value ? this.addBackgroundColorClassChecks({
'v-pagination__item--active': true
}) : {},
on: {
click: function click() {
return _this.$emit('input', i);
}
}
}, [i]);
},
genItems: function genItems(h) {
var _this = this;
return this.items.map(function (i, index) {
return h('li', { key: index }, [isNaN(i) ? h('span', { class: 'v-pagination__more' }, [i]) : _this.genItem(h, i)]);
});
}
},
render: function render(h) {
var children = [this.genIcon(h, this.$vuetify.rtl ? this.nextIcon : this.prevIcon, this.value <= 1, this.previous), this.genItems(h), this.genIcon(h, this.$vuetify.rtl ? this.prevIcon : this.nextIcon, this.value >= this.length, this.next)];
return h('ul', {
directives: [{
modifiers: { quiet: true },
name: 'resize',
value: this.onResize
}],
class: this.classes
}, children);
}
});
/***/ }),
/***/ "./src/components/VPagination/index.js":
/*!*********************************************!*\
!*** ./src/components/VPagination/index.js ***!
\*********************************************/
/*! exports provided: VPagination, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VPagination__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VPagination */ "./src/components/VPagination/VPagination.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VPagination", function() { return _VPagination__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VPagination__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VPagination__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VPagination__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VPagination__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VParallax/VParallax.ts":
/*!***********************************************!*\
!*** ./src/components/VParallax/VParallax.ts ***!
\***********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_parallax_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_parallax.styl */ "./src/stylus/components/_parallax.styl");
/* harmony import */ var _stylus_components_parallax_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_parallax_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_translatable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/translatable */ "./src/mixins/translatable.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
// Style
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_mixins_translatable__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
name: 'v-parallax',
props: {
alt: String,
height: {
type: [String, Number],
default: 500
},
src: String
},
data: function data() {
return {
isBooted: false
};
},
computed: {
styles: function styles() {
return {
display: 'block',
opacity: this.isBooted ? 1 : 0,
transform: "translate(-50%, " + this.parallax + "px)"
};
}
},
watch: {
parallax: function parallax() {
this.isBooted = true;
}
},
mounted: function mounted() {
this.init();
},
methods: {
init: function init() {
var _this = this;
var img = this.$refs.img;
if (!img) return;
if (img.complete) {
this.translate();
this.listeners();
} else {
img.addEventListener('load', function () {
_this.translate();
_this.listeners();
}, false);
}
},
objHeight: function objHeight() {
return this.$refs.img.naturalHeight;
}
},
render: function render(h) {
var imgData = {
staticClass: 'v-parallax__image',
style: this.styles,
attrs: {
src: this.src
},
ref: 'img'
};
if (this.alt) imgData.attrs.alt = this.alt;
var container = h('div', {
staticClass: 'v-parallax__image-container'
}, [h('img', imgData)]);
var content = h('div', {
staticClass: 'v-parallax__content'
}, this.$slots.default);
return h('div', {
staticClass: 'v-parallax',
style: {
height: this.height + "px"
},
on: this.$listeners
}, [container, content]);
}
}));
/***/ }),
/***/ "./src/components/VParallax/index.ts":
/*!*******************************************!*\
!*** ./src/components/VParallax/index.ts ***!
\*******************************************/
/*! exports provided: VParallax, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VParallax__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VParallax */ "./src/components/VParallax/VParallax.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VParallax", function() { return _VParallax__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VParallax__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VParallax__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VParallax__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VParallax__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VPicker/VPicker.js":
/*!*******************************************!*\
!*** ./src/components/VPicker/VPicker.js ***!
\*******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_pickers_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_pickers.styl */ "./src/stylus/components/_pickers.styl");
/* harmony import */ var _stylus_components_pickers_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_pickers_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _stylus_components_cards_styl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../stylus/components/_cards.styl */ "./src/stylus/components/_cards.styl");
/* harmony import */ var _stylus_components_cards_styl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_cards_styl__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-picker',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]],
props: {
fullWidth: Boolean,
landscape: Boolean,
transition: {
type: String,
default: 'fade-transition'
},
width: {
type: [Number, String],
default: 290,
validator: function validator(value) {
return parseInt(value, 10) > 0;
}
}
},
data: function data() {
return {
defaultColor: 'primary'
};
},
computed: {
computedTitleColor: function computedTitleColor() {
var darkTheme = this.dark || !this.light && this.$vuetify.dark;
var defaultTitleColor = darkTheme ? null : this.computedColor;
return this.color || defaultTitleColor;
}
},
methods: {
genTitle: function genTitle() {
return this.$createElement('div', {
staticClass: 'v-picker__title',
'class': this.addBackgroundColorClassChecks({
'v-picker__title--landscape': this.landscape
}, this.computedTitleColor)
}, this.$slots.title);
},
genBodyTransition: function genBodyTransition() {
return this.$createElement('transition', {
props: {
name: this.transition
}
}, this.$slots.default);
},
genBody: function genBody() {
return this.$createElement('div', {
staticClass: 'v-picker__body',
'class': this.themeClasses,
style: this.fullWidth ? undefined : {
width: this.width + 'px'
}
}, [this.genBodyTransition()]);
},
genActions: function genActions() {
return this.$createElement('div', {
staticClass: 'v-picker__actions v-card__actions'
}, this.$slots.actions);
}
},
render: function render(h) {
return h('div', {
staticClass: 'v-picker v-card',
'class': __assign({ 'v-picker--landscape': this.landscape }, this.themeClasses)
}, [this.$slots.title ? this.genTitle() : null, this.genBody(), this.$slots.actions ? this.genActions() : null]);
}
});
/***/ }),
/***/ "./src/components/VPicker/index.js":
/*!*****************************************!*\
!*** ./src/components/VPicker/index.js ***!
\*****************************************/
/*! exports provided: VPicker, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VPicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VPicker */ "./src/components/VPicker/VPicker.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VPicker", function() { return _VPicker__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VPicker__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VPicker__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VPicker__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VPicker__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VProgressCircular/VProgressCircular.ts":
/*!***************************************************************!*\
!*** ./src/components/VProgressCircular/VProgressCircular.ts ***!
\***************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_progress_circular_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_progress-circular.styl */ "./src/stylus/components/_progress-circular.styl");
/* harmony import */ var _stylus_components_progress_circular_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_progress_circular_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_2__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
name: 'v-progress-circular',
props: {
button: Boolean,
indeterminate: Boolean,
rotate: {
type: Number,
default: 0
},
size: {
type: [Number, String],
default: 32
},
width: {
type: Number,
default: 4
},
value: {
type: Number,
default: 0
}
},
computed: {
calculatedSize: function calculatedSize() {
return Number(this.size) + (this.button ? 8 : 0);
},
circumference: function circumference() {
return 2 * Math.PI * this.radius;
},
classes: function classes() {
return this.addTextColorClassChecks({
'v-progress-circular': true,
'v-progress-circular--indeterminate': this.indeterminate,
'v-progress-circular--button': this.button
});
},
normalizedValue: function normalizedValue() {
if (this.value < 0) {
return 0;
}
if (this.value > 100) {
return 100;
}
return this.value;
},
radius: function radius() {
return 20;
},
strokeDashArray: function strokeDashArray() {
return Math.round(this.circumference * 1000) / 1000;
},
strokeDashOffset: function strokeDashOffset() {
return (100 - this.normalizedValue) / 100 * this.circumference + 'px';
},
strokeWidth: function strokeWidth() {
return this.width / +this.size * this.viewBoxSize * 2;
},
styles: function styles() {
return {
height: this.calculatedSize + "px",
width: this.calculatedSize + "px"
};
},
svgStyles: function svgStyles() {
return {
transform: "rotate(" + this.rotate + "deg)"
};
},
viewBoxSize: function viewBoxSize() {
return this.radius / (1 - this.width / +this.size);
}
},
methods: {
genCircle: function genCircle(h, name, offset) {
return h('circle', {
class: "v-progress-circular__" + name,
attrs: {
fill: 'transparent',
cx: 2 * this.viewBoxSize,
cy: 2 * this.viewBoxSize,
r: this.radius,
'stroke-width': this.strokeWidth,
'stroke-dasharray': this.strokeDashArray,
'stroke-dashoffset': offset
}
});
},
genSvg: function genSvg(h) {
var children = [this.indeterminate || this.genCircle(h, 'underlay', 0), this.genCircle(h, 'overlay', this.strokeDashOffset)];
return h('svg', {
style: this.svgStyles,
attrs: {
xmlns: 'http://www.w3.org/2000/svg',
viewBox: this.viewBoxSize + " " + this.viewBoxSize + " " + 2 * this.viewBoxSize + " " + 2 * this.viewBoxSize
}
}, children);
}
},
render: function render(h) {
var info = h('div', { class: 'v-progress-circular__info' }, [this.$slots.default]);
var svg = this.genSvg(h);
return h('div', {
class: this.classes,
style: this.styles,
on: this.$listeners
}, [svg, info]);
}
}));
/***/ }),
/***/ "./src/components/VProgressCircular/index.ts":
/*!***************************************************!*\
!*** ./src/components/VProgressCircular/index.ts ***!
\***************************************************/
/*! exports provided: VProgressCircular, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VProgressCircular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VProgressCircular */ "./src/components/VProgressCircular/VProgressCircular.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VProgressCircular", function() { return _VProgressCircular__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VProgressCircular__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VProgressCircular__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VProgressCircular__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VProgressCircular__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VProgressLinear/VProgressLinear.ts":
/*!***********************************************************!*\
!*** ./src/components/VProgressLinear/VProgressLinear.ts ***!
\***********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_progress_linear_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_progress-linear.styl */ "./src/stylus/components/_progress-linear.styl");
/* harmony import */ var _stylus_components_progress_linear_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_progress_linear_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
/* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.js");
// Mixins
// Helpers
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_3__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"]).extend({
name: 'v-progress-linear',
props: {
active: {
type: Boolean,
default: true
},
backgroundColor: {
type: String,
default: null
},
backgroundOpacity: {
type: [Number, String],
default: null
},
bufferValue: {
type: [Number, String],
default: 100
},
color: {
type: String,
default: 'primary'
},
height: {
type: [Number, String],
default: 7
},
indeterminate: Boolean,
query: Boolean,
value: {
type: [Number, String],
default: 0
}
},
computed: {
styles: function styles() {
var styles = {};
if (!this.active) {
styles.height = 0;
}
if (!this.indeterminate && parseInt(this.bufferValue, 10) !== 100) {
styles.width = this.bufferValue + "%";
}
return styles;
},
effectiveWidth: function effectiveWidth() {
if (!this.bufferValue) {
return 0;
}
return +this.value * 100 / +this.bufferValue;
},
backgroundStyle: function backgroundStyle() {
var backgroundOpacity = this.backgroundOpacity == null ? this.backgroundColor ? 1 : 0.3 : parseFloat(this.backgroundOpacity);
return {
height: this.active ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["convertToUnit"])(this.height) : 0,
opacity: backgroundOpacity,
width: this.bufferValue + "%"
};
}
},
methods: {
genDeterminate: function genDeterminate(h) {
return h('div', {
ref: 'front',
staticClass: "v-progress-linear__bar__determinate",
class: this.addBackgroundColorClassChecks(),
style: {
width: this.effectiveWidth + "%"
}
});
},
genBar: function genBar(h, name) {
var _a;
return h('div', {
staticClass: 'v-progress-linear__bar__indeterminate',
class: this.addBackgroundColorClassChecks((_a = {}, _a[name] = true, _a))
});
},
genIndeterminate: function genIndeterminate(h) {
return h('div', {
ref: 'front',
staticClass: 'v-progress-linear__bar__indeterminate',
class: {
'v-progress-linear__bar__indeterminate--active': this.active
}
}, [this.genBar(h, 'long'), this.genBar(h, 'short')]);
}
},
render: function render(h) {
var fade = h(_transitions__WEBPACK_IMPORTED_MODULE_4__["VFadeTransition"], this.indeterminate ? [this.genIndeterminate(h)] : []);
var slide = h(_transitions__WEBPACK_IMPORTED_MODULE_4__["VSlideXTransition"], this.indeterminate ? [] : [this.genDeterminate(h)]);
var bar = h('div', {
staticClass: 'v-progress-linear__bar',
style: this.styles
}, [fade, slide]);
var background = h('div', {
staticClass: 'v-progress-linear__background',
class: [this.backgroundColor || this.color],
style: this.backgroundStyle
});
return h('div', {
staticClass: 'v-progress-linear',
class: {
'v-progress-linear--query': this.query
},
style: {
height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["convertToUnit"])(this.height)
},
on: this.$listeners
}, [background, bar]);
}
}));
/***/ }),
/***/ "./src/components/VProgressLinear/index.ts":
/*!*************************************************!*\
!*** ./src/components/VProgressLinear/index.ts ***!
\*************************************************/
/*! exports provided: VProgressLinear, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VProgressLinear__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VProgressLinear */ "./src/components/VProgressLinear/VProgressLinear.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VProgressLinear", function() { return _VProgressLinear__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VProgressLinear__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VProgressLinear__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VProgressLinear__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VProgressLinear__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VRadioGroup/VRadio.js":
/*!**********************************************!*\
!*** ./src/components/VRadioGroup/VRadio.js ***!
\**********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_radios_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_radios.styl */ "./src/stylus/components/_radios.styl");
/* harmony import */ var _stylus_components_radios_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_radios_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _VLabel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VLabel */ "./src/components/VLabel/index.js");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_rippleable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/rippleable */ "./src/mixins/rippleable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _mixins_selectable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/selectable */ "./src/mixins/selectable.js");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
var __spread = undefined && undefined.__spread || function () {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}return ar;
};
// Styles
// Components
// Mixins
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-radio',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_rippleable__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_7__["inject"])('radio', 'v-radio', 'v-radio-group'), _mixins_themeable__WEBPACK_IMPORTED_MODULE_5__["default"]],
inheritAttrs: false,
props: {
color: {
type: [Boolean, String],
default: 'accent'
},
disabled: Boolean,
label: String,
onIcon: {
type: String,
default: '$vuetify.icons.radioOn'
},
offIcon: {
type: String,
default: '$vuetify.icons.radioOff'
},
readonly: Boolean,
value: null
},
data: function data() {
return {
isActive: false,
isFocused: false,
parentError: false
};
},
computed: {
classes: function classes() {
var classes = {
'v-radio--is-disabled': this.isDisabled,
'v-radio--is-focused': this.isFocused,
'theme--dark': this.dark,
'theme--light': this.light
};
if (!this.parentError && this.isActive) {
return this.addTextColorClassChecks(classes);
}
return classes;
},
classesSelectable: function classesSelectable() {
return this.addTextColorClassChecks({}, this.isActive ? this.color : this.radio.validationState || false);
},
computedIcon: function computedIcon() {
return this.isActive ? this.onIcon : this.offIcon;
},
hasState: function hasState() {
return this.isActive || !!this.radio.validationState;
},
isDisabled: function isDisabled() {
return this.disabled || !!this.radio.disabled;
},
isReadonly: function isReadonly() {
return this.readonly || !!this.radio.readonly;
}
},
mounted: function mounted() {
this.radio.register(this);
},
beforeDestroy: function beforeDestroy() {
this.radio.unregister(this);
},
methods: {
genInput: function genInput() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _a;
// We can't actually use the mixin directly because
// it's made for standalone components, but its
// genInput method is exactly what we need
return (_a = _mixins_selectable__WEBPACK_IMPORTED_MODULE_6__["default"].methods.genInput).call.apply(_a, __spread([this], args));
},
genLabel: function genLabel() {
return this.$createElement(_VLabel__WEBPACK_IMPORTED_MODULE_2__["default"], {
on: { click: this.onChange },
attrs: {
for: this.id
},
props: {
color: this.radio.validationState || false,
dark: this.dark,
focused: this.hasState,
light: this.light
}
}, this.$slots.label || this.label);
},
genRadio: function genRadio() {
return this.$createElement('div', {
staticClass: 'v-input--selection-controls__input'
}, [this.genInput('radio', __assign({ name: this.radio.name || (this.radio._uid ? 'v-radio-' + this.radio._uid : false), value: this.value }, this.$attrs)), !this.isDisabled && this.genRipple({
'class': this.classesSelectable
}), this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], {
'class': this.classesSelectable,
props: {
dark: this.dark,
light: this.light
}
}, this.computedIcon)]);
},
onFocus: function onFocus() {
this.isFocused = true;
},
onBlur: function onBlur(e) {
this.isFocused = false;
this.$emit('blur', e);
},
onChange: function onChange() {
if (this.isDisabled || this.isReadonly) return;
if (!this.isDisabled && (!this.isActive || !this.radio.mandatory)) {
this.$emit('change', this.value);
}
},
onKeydown: function onKeydown(e) {
if ([_util_helpers__WEBPACK_IMPORTED_MODULE_8__["keyCodes"].enter, _util_helpers__WEBPACK_IMPORTED_MODULE_8__["keyCodes"].space].includes(e.keyCode)) {
e.preventDefault();
this.onChange();
}
}
},
render: function render(h) {
return h('div', {
staticClass: 'v-radio',
class: this.classes
}, [this.genRadio(), this.genLabel()]);
}
});
/***/ }),
/***/ "./src/components/VRadioGroup/VRadioGroup.js":
/*!***************************************************!*\
!*** ./src/components/VRadioGroup/VRadioGroup.js ***!
\***************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_selection_controls_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_selection-controls.styl */ "./src/stylus/components/_selection-controls.styl");
/* harmony import */ var _stylus_components_selection_controls_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_selection_controls_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _stylus_components_radio_group_styl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../stylus/components/_radio-group.styl */ "./src/stylus/components/_radio-group.styl");
/* harmony import */ var _stylus_components_radio_group_styl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_radio_group_styl__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VInput */ "./src/components/VInput/index.js");
/* harmony import */ var _mixins_comparable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/comparable */ "./src/mixins/comparable.ts");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
// Styles
// Components
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-radio-group',
extends: _VInput__WEBPACK_IMPORTED_MODULE_2__["default"],
mixins: [_mixins_comparable__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_4__["provide"])('radio')],
model: {
prop: 'value',
event: 'change'
},
provide: function provide() {
return {
radio: this
};
},
props: {
column: {
type: Boolean,
default: true
},
height: {
type: [Number, String],
default: 'auto'
},
mandatory: {
type: Boolean,
default: true
},
name: String,
row: Boolean,
// If no value set on VRadio
// will match valueComparator
// force default to null
value: {
default: null
}
},
data: function data() {
return {
internalTabIndex: -1,
radios: []
};
},
computed: {
classes: function classes() {
return {
'v-input--selection-controls v-input--radio-group': true,
'v-input--radio-group--column': this.column && !this.row,
'v-input--radio-group--row': this.row
};
}
},
watch: {
hasError: 'setErrorState',
internalValue: 'setActiveRadio'
},
mounted: function mounted() {
this.setErrorState(this.hasError);
this.setActiveRadio();
},
methods: {
genDefaultSlot: function genDefaultSlot() {
return this.$createElement('div', {
staticClass: 'v-input--radio-group__input',
attrs: {
role: 'radiogroup'
}
}, _VInput__WEBPACK_IMPORTED_MODULE_2__["default"].methods.genDefaultSlot.call(this));
},
onRadioChange: function onRadioChange(value) {
if (this.disabled) return;
this.hasInput = true;
this.internalValue = value;
this.setActiveRadio();
this.$nextTick(this.validate);
},
onRadioBlur: function onRadioBlur(e) {
if (!e.relatedTarget || !e.relatedTarget.classList.contains('v-radio')) {
this.hasInput = true;
this.$emit('blur', e);
}
},
register: function register(radio) {
radio.isActive = this.valueComparator(this.internalValue, radio.value);
radio.$on('change', this.onRadioChange);
radio.$on('blur', this.onRadioBlur);
this.radios.push(radio);
},
setErrorState: function setErrorState(val) {
for (var index = this.radios.length; --index >= 0;) {
this.radios[index].parentError = val;
}
},
setActiveRadio: function setActiveRadio() {
for (var index = this.radios.length; --index >= 0;) {
var radio = this.radios[index];
radio.isActive = this.valueComparator(this.internalValue, radio.value);
}
},
unregister: function unregister(radio) {
radio.$off('change', this.onRadioChange);
radio.$off('blur', this.onRadioBlur);
var index = this.radios.findIndex(function (r) {
return r === radio;
});
/* istanbul ignore else */
if (index > -1) this.radios.splice(index, 1);
}
}
});
/***/ }),
/***/ "./src/components/VRadioGroup/index.js":
/*!*********************************************!*\
!*** ./src/components/VRadioGroup/index.js ***!
\*********************************************/
/*! exports provided: VRadioGroup, VRadio, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VRadioGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VRadioGroup */ "./src/components/VRadioGroup/VRadioGroup.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRadioGroup", function() { return _VRadioGroup__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _VRadio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VRadio */ "./src/components/VRadioGroup/VRadio.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRadio", function() { return _VRadio__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* istanbul ignore next */
_VRadioGroup__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VRadioGroup__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VRadioGroup__WEBPACK_IMPORTED_MODULE_0__["default"]);
Vue.component(_VRadio__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VRadio__WEBPACK_IMPORTED_MODULE_1__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VRadioGroup__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VRangeSlider/VRangeSlider.js":
/*!*****************************************************!*\
!*** ./src/components/VRangeSlider/VRangeSlider.js ***!
\*****************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_range_sliders_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_range-sliders.styl */ "./src/stylus/components/_range-sliders.styl");
/* harmony import */ var _stylus_components_range_sliders_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_range_sliders_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VSlider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VSlider */ "./src/components/VSlider/index.js");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
// Styles
// Extensions
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-range-slider',
extends: _VSlider__WEBPACK_IMPORTED_MODULE_1__["default"],
props: {
value: {
type: Array,
default: function _default() {
return [];
}
}
},
data: function data(vm) {
return {
activeThumb: null,
lazyValue: !vm.value.length ? [0, 0] : vm.value
};
},
computed: {
classes: function classes() {
return Object.assign({}, {
'v-input--range-slider': true
}, _VSlider__WEBPACK_IMPORTED_MODULE_1__["default"].computed.classes.call(this));
},
internalValue: {
get: function get() {
return this.lazyValue;
},
set: function set(val) {
var _this = this;
var _a = this,
min = _a.min,
max = _a.max;
// Round value to ensure the
// entire slider range can
// be selected with step
var value = val.map(function (v) {
return _this.roundValue(Math.min(Math.max(v, min), max));
});
// Switch values if range and wrong order
if (value[0] > value[1] || value[1] < value[0]) {
if (this.activeThumb !== null) this.activeThumb = this.activeThumb === 1 ? 0 : 1;
value = [value[1], value[0]];
}
this.lazyValue = value;
if (!Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["deepEqual"])(value, this.value)) this.$emit('input', value);
this.validate();
}
},
inputWidth: function inputWidth() {
var _this = this;
return this.internalValue.map(function (v) {
return (_this.roundValue(v) - _this.min) / (_this.max - _this.min) * 100;
});
},
isDirty: function isDirty() {
var _this = this;
return this.internalValue.some(function (v) {
return v !== _this.min;
}) || this.alwaysDirty;
},
trackFillStyles: function trackFillStyles() {
var styles = _VSlider__WEBPACK_IMPORTED_MODULE_1__["default"].computed.trackFillStyles.call(this);
var fillPercent = Math.abs(this.inputWidth[0] - this.inputWidth[1]);
styles.width = "calc(" + fillPercent + "% - " + this.trackPadding + "px)";
styles[this.$vuetify.rtl ? 'right' : 'left'] = this.inputWidth[0] + "%";
return styles;
},
trackPadding: function trackPadding() {
if (this.isDirty || this.internalValue[0]) return 0;
return _VSlider__WEBPACK_IMPORTED_MODULE_1__["default"].computed.trackPadding.call(this);
}
},
methods: {
getIndexOfClosestValue: function getIndexOfClosestValue(arr, v) {
if (Math.abs(arr[0] - v) < Math.abs(arr[1] - v)) return 0;else return 1;
},
genInput: function genInput() {
var _this = this;
return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["createRange"])(2).map(function (i) {
var input = _VSlider__WEBPACK_IMPORTED_MODULE_1__["default"].methods.genInput.call(_this);
input.data.attrs.value = _this.internalValue[i];
input.data.on.focus = function (e) {
_this.activeThumb = i;
_VSlider__WEBPACK_IMPORTED_MODULE_1__["default"].methods.onFocus.call(_this, e);
};
return input;
});
},
genChildren: function genChildren() {
var _this = this;
return [this.genInput(), this.genTrackContainer(), this.genSteps(), Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["createRange"])(2).map(function (i) {
var value = _this.internalValue[i];
var onDrag = function onDrag(e) {
_this.isActive = true;
_this.activeThumb = i;
_this.onThumbMouseDown(e);
};
var valueWidth = _this.inputWidth[i];
var isActive = (_this.isFocused || _this.isActive) && _this.activeThumb === i;
return _this.genThumbContainer(value, valueWidth, isActive, onDrag);
})];
},
onSliderClick: function onSliderClick(e) {
if (!this.isActive) {
this.isFocused = true;
this.onMouseMove(e, true);
this.$emit('change', this.internalValue);
}
},
onMouseMove: function onMouseMove(e, trackClick) {
if (trackClick === void 0) {
trackClick = false;
}
var _a = this.parseMouseMove(e),
value = _a.value,
isInsideTrack = _a.isInsideTrack;
if (isInsideTrack) {
if (trackClick) this.activeThumb = this.getIndexOfClosestValue(this.internalValue, value);
this.setInternalValue(value);
}
},
onKeyDown: function onKeyDown(e) {
var value = this.parseKeyDown(e, this.internalValue[this.activeThumb]);
if (value == null) return;
this.setInternalValue(value);
},
setInternalValue: function setInternalValue(value) {
var _this = this;
this.internalValue = this.internalValue.map(function (v, i) {
if (i === _this.activeThumb) return value;else return Number(v);
});
}
}
});
/***/ }),
/***/ "./src/components/VRangeSlider/index.js":
/*!**********************************************!*\
!*** ./src/components/VRangeSlider/index.js ***!
\**********************************************/
/*! exports provided: VRangeSlider, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VRangeSlider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VRangeSlider */ "./src/components/VRangeSlider/VRangeSlider.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRangeSlider", function() { return _VRangeSlider__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VRangeSlider__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VRangeSlider__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VRangeSlider__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VRangeSlider__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VSelect/VSelect.js":
/*!*******************************************!*\
!*** ./src/components/VSelect/VSelect.js ***!
\*******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_text_fields_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_text-fields.styl */ "./src/stylus/components/_text-fields.styl");
/* harmony import */ var _stylus_components_text_fields_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_text_fields_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _stylus_components_select_styl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../stylus/components/_select.styl */ "./src/stylus/components/_select.styl");
/* harmony import */ var _stylus_components_select_styl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_select_styl__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _VChip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VChip */ "./src/components/VChip/index.ts");
/* harmony import */ var _VMenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VMenu */ "./src/components/VMenu/index.js");
/* harmony import */ var _VSelectList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VSelectList */ "./src/components/VSelect/VSelectList.js");
/* harmony import */ var _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../VTextField/VTextField */ "./src/components/VTextField/VTextField.js");
/* harmony import */ var _mixins_comparable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/comparable */ "./src/mixins/comparable.ts");
/* harmony import */ var _mixins_filterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/filterable */ "./src/mixins/filterable.js");
/* harmony import */ var _mixins_menuable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../mixins/menuable */ "./src/mixins/menuable.js");
/* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
var __values = undefined && undefined.__values || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator],
i = 0;
if (m) return m.call(o);
return {
next: function next() {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
};
// Styles
// Components
// Extensions
// Mixins
// Directives
// Helpers
// For api-generator
var fakeVMenu = {
name: 'v-menu',
props: _VMenu__WEBPACK_IMPORTED_MODULE_3__["default"].props // TODO: remove some, just for testing
};
var fakeMenuable = {
name: 'menuable',
props: _mixins_menuable__WEBPACK_IMPORTED_MODULE_8__["default"].props
};
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-select',
directives: {
ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_9__["default"]
},
extends: _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_5__["default"],
mixins: [fakeVMenu, fakeMenuable, _mixins_comparable__WEBPACK_IMPORTED_MODULE_6__["default"], _mixins_filterable__WEBPACK_IMPORTED_MODULE_7__["default"]],
props: {
appendIcon: {
type: String,
default: '$vuetify.icons.dropdown'
},
appendIconCb: Function,
attach: {
type: null,
default: false
},
auto: Boolean,
browserAutocomplete: {
type: String,
default: 'on'
},
cacheItems: Boolean,
chips: Boolean,
clearable: Boolean,
contentClass: String,
deletableChips: Boolean,
dense: Boolean,
hideSelected: Boolean,
items: {
type: Array,
default: function _default() {
return [];
}
},
itemAvatar: {
type: [String, Array, Function],
default: 'avatar'
},
itemDisabled: {
type: [String, Array, Function],
default: 'disabled'
},
itemText: {
type: [String, Array, Function],
default: 'text'
},
itemValue: {
type: [String, Array, Function],
default: 'value'
},
maxHeight: {
type: [Number, String],
default: 300
},
minWidth: {
type: [Boolean, Number, String],
default: 0
},
multiple: Boolean,
multiLine: Boolean,
openOnClear: Boolean,
returnObject: Boolean,
searchInput: {
default: null
},
smallChips: Boolean,
singleLine: Boolean
},
data: function data(vm) {
return {
attrsInput: { role: 'combobox' },
cachedItems: vm.cacheItems ? vm.items : [],
content: null,
isBooted: false,
isMenuActive: false,
lastItem: 20,
// As long as a value is defined, show it
// Otherwise, check if multiple
// to determine which default to provide
lazyValue: vm.value !== undefined ? vm.value : vm.multiple ? [] : undefined,
selectedIndex: -1,
selectedItems: []
};
},
computed: {
/* All items that the select has */
allItems: function allItems() {
return this.filterDuplicates(this.cachedItems.concat(this.items));
},
classes: function classes() {
return Object.assign({}, _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_5__["default"].computed.classes.call(this), {
'v-select': true,
'v-select--chips': this.hasChips,
'v-select--chips--small': this.smallChips,
'v-select--is-menu-active': this.isMenuActive
});
},
/* Used by other components to overwrite */
computedItems: function computedItems() {
return this.allItems;
},
counterValue: function counterValue() {
return this.multiple ? this.selectedItems.length : (this.getText(this.selectedItems[0]) || '').toString().length;
},
directives: function directives() {
return this.isFocused ? [{
name: 'click-outside',
value: this.blur,
args: {
closeConditional: this.closeConditional
}
}] : undefined;
},
dynamicHeight: function dynamicHeight() {
return 'auto';
},
hasChips: function hasChips() {
return this.chips || this.smallChips;
},
hasSlot: function hasSlot() {
return Boolean(this.hasChips || this.$scopedSlots.selection);
},
isDirty: function isDirty() {
return this.selectedItems.length > 0;
},
menuProps: function menuProps() {
return {
closeOnClick: false,
closeOnContentClick: false,
openOnClick: false,
value: this.isMenuActive,
offsetY: this.offsetY,
nudgeBottom: this.nudgeBottom ? this.nudgeBottom : this.offsetY ? 1 : 0 // convert to int
};
},
listData: function listData() {
return {
props: {
action: this.multiple && !this.isHidingSelected,
color: this.color,
dark: this.dark,
dense: this.dense,
hideSelected: this.hideSelected,
items: this.virtualizedItems,
light: this.light,
noDataText: this.$vuetify.t(this.noDataText),
selectedItems: this.selectedItems,
itemAvatar: this.itemAvatar,
itemDisabled: this.itemDisabled,
itemValue: this.itemValue,
itemText: this.itemText
},
on: {
select: this.selectItem
},
scopedSlots: {
item: this.$scopedSlots.item
}
};
},
staticList: function staticList() {
if (this.$slots['no-data']) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_11__["consoleError"])('assert: staticList should not be called if slots are used');
}
return this.$createElement(_VSelectList__WEBPACK_IMPORTED_MODULE_4__["default"], this.listData);
},
virtualizedItems: function virtualizedItems() {
return !this.auto ? this.computedItems.slice(0, this.lastItem) : this.computedItems;
}
},
watch: {
internalValue: function internalValue(val) {
this.initialValue = val;
this.$emit('change', this.internalValue);
this.setSelectedItems();
},
isBooted: function isBooted() {
var _this = this;
this.$nextTick(function () {
if (_this.content && _this.content.addEventListener) {
_this.content.addEventListener('scroll', _this.onScroll, false);
}
});
},
isMenuActive: function isMenuActive(val) {
if (!val) return;
this.isBooted = true;
},
items: {
immediate: true,
handler: function handler(val) {
if (this.cacheItems) {
this.cachedItems = this.filterDuplicates(this.cachedItems.concat(val));
}
this.setSelectedItems();
}
}
},
mounted: function mounted() {
this.content = this.$refs.menu && this.$refs.menu.$refs.content;
},
methods: {
/** @public */
blur: function blur() {
this.isMenuActive = false;
this.isFocused = false;
this.$refs.input && this.$refs.input.blur();
this.selectedIndex = -1;
},
/** @public */
activateMenu: function activateMenu() {
this.isMenuActive = true;
},
clearableCallback: function clearableCallback() {
var _this = this;
this.internalValue = this.multiple ? [] : undefined;
this.$nextTick(function () {
return _this.$refs.input.focus();
});
if (this.openOnClear) this.isMenuActive = true;
},
closeConditional: function closeConditional(e) {
return (
// Click originates from outside the menu content
!!this.content && !this.content.contains(e.target) &&
// Click originates from outside the element
!!this.$el && !this.$el.contains(e.target) && e.target !== this.$el
);
},
filterDuplicates: function filterDuplicates(arr) {
var uniqueValues = new Map();
for (var index = 0; index < arr.length; ++index) {
var item = arr[index];
var val = this.getValue(item);
// TODO: comparator
!uniqueValues.has(val) && uniqueValues.set(val, item);
}
return Array.from(uniqueValues.values());
},
findExistingIndex: function findExistingIndex(item) {
var _this = this;
var itemValue = this.getValue(item);
return (this.internalValue || []).findIndex(function (i) {
return _this.valueComparator(_this.getValue(i), itemValue);
});
},
genChipSelection: function genChipSelection(item, index) {
var _this = this;
var isDisabled = this.disabled || this.readonly || this.getDisabled(item);
var focus = function focus(e, cb) {
if (isDisabled) return;
e.stopPropagation();
_this.onFocus();
cb && cb();
};
return this.$createElement(_VChip__WEBPACK_IMPORTED_MODULE_2__["default"], {
staticClass: 'v-chip--select-multi',
props: {
close: this.deletableChips && !isDisabled,
dark: this.dark,
disabled: isDisabled,
selected: index === this.selectedIndex,
small: this.smallChips
},
on: {
click: function click(e) {
focus(e, function () {
_this.selectedIndex = index;
});
},
focus: focus,
input: function input() {
return _this.onChipInput(item);
}
},
key: this.getValue(item)
}, this.getText(item));
},
genCommaSelection: function genCommaSelection(item, index, last) {
// Item may be an object
// TODO: Remove JSON.stringify
var key = JSON.stringify(this.getValue(item));
var isDisabled = this.disabled || this.readonly || this.getDisabled(item);
var classes = index === this.selectedIndex ? this.addTextColorClassChecks() : {};
classes['v-select__selection--disabled'] = isDisabled;
return this.$createElement('div', {
staticClass: 'v-select__selection v-select__selection--comma',
'class': classes,
key: key
}, "" + this.getText(item) + (last ? '' : ', '));
},
genDefaultSlot: function genDefaultSlot() {
var selections = this.genSelections();
var input = this.genInput();
// If the return is an empty array
// push the input
if (Array.isArray(selections)) {
selections.push(input);
// Otherwise push it into children
} else {
selections.children = selections.children || [];
selections.children.push(input);
}
var activator = this.genSelectSlot([this.genLabel(), this.prefix ? this.genAffix('prefix') : null, selections, this.suffix ? this.genAffix('suffix') : null, this.genClearIcon(), this.genIconSlot()]);
return [this.genMenu(activator)];
},
genInput: function genInput() {
var input = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_5__["default"].methods.genInput.call(this);
input.data.domProps.value = null;
input.data.attrs.readonly = true;
input.data.attrs['aria-readonly'] = String(this.readonly);
return input;
},
genList: function genList() {
// If there's no slots, we can use a cached VNode to improve performance
if (this.$slots['no-data']) {
return this.genListWithSlot();
} else {
return this.staticList;
}
},
genListWithSlot: function genListWithSlot() {
// Requires destructuring due to Vue
// modifying the `on` property when passed
// as a referenced object
return this.$createElement(_VSelectList__WEBPACK_IMPORTED_MODULE_4__["default"], __assign({}, this.listData), [this.$createElement('template', {
slot: 'no-data'
}, this.$slots['no-data'])]);
},
genMenu: function genMenu(activator) {
var _this = this;
var e_1, _a;
var props = {
contentClass: this.contentClass
};
var inheritedProps = Object.keys(_VMenu__WEBPACK_IMPORTED_MODULE_3__["default"].props).concat(Object.keys(_mixins_menuable__WEBPACK_IMPORTED_MODULE_8__["default"].props));
try {
// Later this might be filtered
for (var inheritedProps_1 = __values(inheritedProps), inheritedProps_1_1 = inheritedProps_1.next(); !inheritedProps_1_1.done; inheritedProps_1_1 = inheritedProps_1.next()) {
var prop = inheritedProps_1_1.value;
props[prop] = this[prop];
}
} catch (e_1_1) {
e_1 = { error: e_1_1 };
} finally {
try {
if (inheritedProps_1_1 && !inheritedProps_1_1.done && (_a = inheritedProps_1.return)) _a.call(inheritedProps_1);
} finally {
if (e_1) throw e_1.error;
}
}
props.activator = this.$refs['input-slot'];
Object.assign(props, this.menuProps);
// Attach to root el so that
// menu covers prepend/append icons
if (
// TODO: make this a computed property or helper or something
this.attach === '' || // If used as a boolean prop (<v-menu attach>)
this.attach === true || // If bound to a boolean (<v-menu :attach="true">)
this.attach === 'attach' // If bound as boolean prop in pug (v-menu(attach))
) {
props.attach = this.$el;
} else {
props.attach = this.attach;
}
return this.$createElement(_VMenu__WEBPACK_IMPORTED_MODULE_3__["default"], {
props: props,
on: {
input: function input(val) {
_this.isMenuActive = val;
_this.isFocused = val;
}
},
ref: 'menu'
}, [activator, this.genList()]);
},
genSelections: function genSelections() {
var length = this.selectedItems.length;
var children = new Array(length);
var genSelection;
if (this.$scopedSlots.selection) {
genSelection = this.genSlotSelection;
} else if (this.hasChips) {
genSelection = this.genChipSelection;
} else {
genSelection = this.genCommaSelection;
}
while (length--) {
children[length] = genSelection(this.selectedItems[length], length, length === children.length - 1);
}
return this.$createElement('div', {
staticClass: 'v-select__selections'
}, children);
},
genSelectSlot: function genSelectSlot(children) {
return this.$createElement('div', {
staticClass: 'v-select__slot',
directives: this.directives,
slot: 'activator'
}, children);
},
genSlotSelection: function genSlotSelection(item, index) {
return this.$scopedSlots.selection({
parent: this,
item: item,
index: index,
selected: index === this.selectedIndex,
disabled: this.disabled || this.readonly
});
},
getMenuIndex: function getMenuIndex() {
return this.$refs.menu ? this.$refs.menu.listIndex : -1;
},
getDisabled: function getDisabled(item) {
return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_10__["getPropertyFromItem"])(item, this.itemDisabled, false);
},
getText: function getText(item) {
return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_10__["getPropertyFromItem"])(item, this.itemText, item);
},
getValue: function getValue(item) {
return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_10__["getPropertyFromItem"])(item, this.itemValue, this.getText(item));
},
onBlur: function onBlur(e) {
this.$emit('blur', e);
},
onChipInput: function onChipInput(item) {
if (this.multiple) this.selectItem(item);else this.internalValue = null;
// If all items have been deleted,
// open `v-menu`
if (this.selectedItems.length === 0) {
this.isMenuActive = true;
}
this.selectedIndex = -1;
},
onClick: function onClick() {
if (this.isDisabled) return;
this.isMenuActive = true;
if (!this.isFocused) {
this.isFocused = true;
this.$emit('focus');
}
},
onEnterDown: function onEnterDown() {
this.onBlur();
},
onEscDown: function onEscDown(e) {
e.preventDefault();
this.isMenuActive = false;
},
// Detect tab and call original onBlur method
onKeyDown: function onKeyDown(e) {
var keyCode = e.keyCode;
// If enter, space, up, or down is pressed, open menu
if (!this.isMenuActive && [_util_helpers__WEBPACK_IMPORTED_MODULE_10__["keyCodes"].enter, _util_helpers__WEBPACK_IMPORTED_MODULE_10__["keyCodes"].space, _util_helpers__WEBPACK_IMPORTED_MODULE_10__["keyCodes"].up, _util_helpers__WEBPACK_IMPORTED_MODULE_10__["keyCodes"].down].includes(keyCode)) this.activateMenu();
// This should do something different
if (keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_10__["keyCodes"].enter) return this.onEnterDown();
// If escape deactivate the menu
if (keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_10__["keyCodes"].esc) return this.onEscDown(e);
// If tab - select item or close menu
if (keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_10__["keyCodes"].tab) return this.onTabDown(e);
},
onMouseUp: function onMouseUp(e) {
var _this = this;
var appendInner = this.$refs['append-inner'];
// If append inner is present
// and the target is itself
// or inside, toggle menu
if (this.isMenuActive && appendInner && (appendInner === e.target || appendInner.contains(e.target))) {
this.$nextTick(function () {
return _this.isMenuActive = !_this.isMenuActive;
});
// If user is clicking in the container
// and field is enclosed, activate it
} else if (this.isEnclosed && !this.isDisabled) {
this.isMenuActive = true;
}
_VTextField_VTextField__WEBPACK_IMPORTED_MODULE_5__["default"].methods.onMouseUp.call(this, e);
},
onScroll: function onScroll() {
var _this = this;
if (!this.isMenuActive) {
requestAnimationFrame(function () {
return _this.content.scrollTop = 0;
});
} else {
if (this.lastItem >= this.computedItems.length) return;
var showMoreItems = this.content.scrollHeight - (this.content.scrollTop + this.content.clientHeight) < 200;
if (showMoreItems) {
this.lastItem += 20;
}
}
},
onTabDown: function onTabDown(e) {
var menuIndex = this.getMenuIndex();
var listTile = this.$refs.menu.tiles[menuIndex];
// An item that is selected by
// menu-index should toggled
if (listTile && listTile.className.indexOf('v-list__tile--highlighted') > -1 && this.isMenuActive && menuIndex > -1) {
e.preventDefault();
e.stopPropagation();
listTile.click();
} else {
// If we make it here,
// the user has no selected indexes
// and is probably tabbing out
_VTextField_VTextField__WEBPACK_IMPORTED_MODULE_5__["default"].methods.onBlur.call(this, e);
}
},
selectItem: function selectItem(item) {
var _this = this;
if (!this.multiple) {
this.internalValue = this.returnObject ? item : this.getValue(item);
this.isMenuActive = false;
} else {
var internalValue = (this.internalValue || []).slice();
var i = this.findExistingIndex(item);
i !== -1 ? internalValue.splice(i, 1) : internalValue.push(item);
this.internalValue = internalValue.map(function (i) {
return _this.returnObject ? i : _this.getValue(i);
});
// When selecting multiple
// adjust menu after each
// selection
this.$nextTick(function () {
_this.$refs.menu && _this.$refs.menu.updateDimensions();
});
}
},
setMenuIndex: function setMenuIndex(index) {
this.$refs.menu && (this.$refs.menu.listIndex = index);
},
setSelectedItems: function setSelectedItems() {
var _this = this;
var e_2, _a;
var selectedItems = [];
var values = !this.multiple || !Array.isArray(this.internalValue) ? [this.internalValue] : this.internalValue;
var _loop_1 = function _loop_1(value) {
var index = this_1.allItems.findIndex(function (v) {
return _this.valueComparator(_this.getValue(v), _this.getValue(value));
});
if (index > -1) {
selectedItems.push(this_1.allItems[index]);
}
};
var this_1 = this;
try {
for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
var value = values_1_1.value;
_loop_1(value);
}
} catch (e_2_1) {
e_2 = { error: e_2_1 };
} finally {
try {
if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
} finally {
if (e_2) throw e_2.error;
}
}
this.selectedItems = selectedItems;
}
}
});
/***/ }),
/***/ "./src/components/VSelect/VSelectList.js":
/*!***********************************************!*\
!*** ./src/components/VSelect/VSelectList.js ***!
\***********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_cards_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_cards.styl */ "./src/stylus/components/_cards.styl");
/* harmony import */ var _stylus_components_cards_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_cards_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VCheckbox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VCheckbox */ "./src/components/VCheckbox/index.js");
/* harmony import */ var _VDivider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VDivider */ "./src/components/VDivider/index.ts");
/* harmony import */ var _VSubheader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VSubheader */ "./src/components/VSubheader/index.js");
/* harmony import */ var _VList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../VList */ "./src/components/VList/index.js");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
var __values = undefined && undefined.__values || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator],
i = 0;
if (m) return m.call(o);
return {
next: function next() {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
};
// Components
// Mixins
// Helpers
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-select-list',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_6__["default"]],
props: {
action: Boolean,
dense: Boolean,
hideSelected: Boolean,
items: {
type: Array,
default: function _default() {
return [];
}
},
itemAvatar: {
type: [String, Array, Function],
default: 'avatar'
},
itemDisabled: {
type: [String, Array, Function],
default: 'disabled'
},
itemText: {
type: [String, Array, Function],
default: 'text'
},
itemValue: {
type: [String, Array, Function],
default: 'value'
},
noDataText: String,
noFilter: Boolean,
searchInput: {
default: null
},
selectedItems: {
type: Array,
default: function _default() {
return [];
}
}
},
computed: {
parsedItems: function parsedItems() {
var _this = this;
return this.selectedItems.map(function (item) {
return _this.getValue(item);
});
},
tileActiveClass: function tileActiveClass() {
return Object.keys(this.addTextColorClassChecks()).join(' ');
},
staticNoDataTile: function staticNoDataTile() {
var tile = {
on: {
mousedown: function mousedown(e) {
return e.preventDefault();
} // Prevent onBlur from being called
}
};
return this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_4__["VListTile"], tile, [this.genTileContent(this.noDataText)]);
}
},
methods: {
genAction: function genAction(item, inputValue) {
var _this = this;
var data = {
on: {
click: function click(e) {
e.stopPropagation();
_this.$emit('select', item);
}
}
};
return this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_4__["VListTileAction"], data, [this.$createElement(_VCheckbox__WEBPACK_IMPORTED_MODULE_1__["default"], {
props: {
color: this.computedColor,
inputValue: inputValue
}
})]);
},
genDivider: function genDivider(props) {
return this.$createElement(_VDivider__WEBPACK_IMPORTED_MODULE_2__["default"], { props: props });
},
genFilteredText: function genFilteredText(text) {
text = (text || '').toString();
if (!this.searchInput || this.noFilter) return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["escapeHTML"])(text);
var _a = this.getMaskedCharacters(text),
start = _a.start,
middle = _a.middle,
end = _a.end;
return "" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["escapeHTML"])(start) + this.genHighlight(middle) + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["escapeHTML"])(end);
},
genHeader: function genHeader(props) {
return this.$createElement(_VSubheader__WEBPACK_IMPORTED_MODULE_3__["default"], { props: props }, props.header);
},
genHighlight: function genHighlight(text) {
return "<span class=\"v-list__tile__mask\">" + Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["escapeHTML"])(text) + "</span>";
},
getMaskedCharacters: function getMaskedCharacters(text) {
var searchInput = (this.searchInput || '').toString().toLowerCase();
var index = text.toLowerCase().indexOf(searchInput);
if (index < 0) return { start: '', middle: text, end: '' };
var start = text.slice(0, index);
var middle = text.slice(index, index + searchInput.length);
var end = text.slice(index + searchInput.length);
return { start: start, middle: middle, end: end };
},
genTile: function genTile(item, disabled, avatar, value) {
var _this = this;
if (disabled === void 0) {
disabled = null;
}
if (avatar === void 0) {
avatar = false;
}
if (value === void 0) {
value = this.hasItem(item);
}
if (item === Object(item)) {
avatar = this.getAvatar(item);
disabled = disabled !== null ? disabled : this.getDisabled(item);
}
var tile = {
on: {
mousedown: function mousedown(e) {
// Prevent onBlur from being called
e.preventDefault();
},
click: function click() {
return disabled || _this.$emit('select', item);
}
},
props: {
activeClass: this.tileActiveClass,
avatar: avatar,
disabled: disabled,
ripple: true,
value: value
}
};
if (!this.$scopedSlots.item) {
return this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_4__["VListTile"], tile, [this.action && !this.hideSelected && this.items.length > 0 ? this.genAction(item, value) : null, this.genTileContent(item)]);
}
var parent = this;
var scopedSlot = this.$scopedSlots.item({ parent: parent, item: item, tile: tile });
return this.needsTile(scopedSlot) ? this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_4__["VListTile"], tile, [scopedSlot]) : scopedSlot;
},
genTileContent: function genTileContent(item) {
var innerHTML = this.genFilteredText(this.getText(item));
return this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_4__["VListTileContent"], [this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_4__["VListTileTitle"], {
domProps: { innerHTML: innerHTML }
})]);
},
hasItem: function hasItem(item) {
return this.parsedItems.indexOf(this.getValue(item)) > -1;
},
needsTile: function needsTile(tile) {
return tile.componentOptions == null || tile.componentOptions.Ctor.options.name !== 'v-list-tile';
},
getAvatar: function getAvatar(item) {
return Boolean(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["getPropertyFromItem"])(item, this.itemAvatar, false));
},
getDisabled: function getDisabled(item) {
return Boolean(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["getPropertyFromItem"])(item, this.itemDisabled, false));
},
getText: function getText(item) {
return String(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["getPropertyFromItem"])(item, this.itemText, item));
},
getValue: function getValue(item) {
return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["getPropertyFromItem"])(item, this.itemValue, this.getText(item));
}
},
render: function render() {
var e_1, _a;
var children = [];
try {
for (var _b = __values(this.items), _c = _b.next(); !_c.done; _c = _b.next()) {
var item = _c.value;
if (this.hideSelected && this.hasItem(item)) continue;
if (item == null) children.push(this.genTile(item));else if (item.header) children.push(this.genHeader(item));else if (item.divider) children.push(this.genDivider(item));else children.push(this.genTile(item));
}
} catch (e_1_1) {
e_1 = { error: e_1_1 };
} finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
} finally {
if (e_1) throw e_1.error;
}
}
children.length || children.push(this.$slots['no-data'] || this.staticNoDataTile);
return this.$createElement('div', {
staticClass: 'v-select-list v-card',
'class': this.themeClasses
}, [this.$createElement(_VList__WEBPACK_IMPORTED_MODULE_4__["VList"], {
props: {
dense: this.dense
}
}, children)]);
}
});
/***/ }),
/***/ "./src/components/VSelect/index.js":
/*!*****************************************!*\
!*** ./src/components/VSelect/index.js ***!
\*****************************************/
/*! exports provided: VSelect, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSelect", function() { return wrapper; });
/* harmony import */ var _VSelect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSelect */ "./src/components/VSelect/VSelect.js");
/* harmony import */ var _VOverflowBtn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VOverflowBtn */ "./src/components/VOverflowBtn/index.js");
/* harmony import */ var _VAutocomplete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VAutocomplete */ "./src/components/VAutocomplete/index.js");
/* harmony import */ var _VCombobox__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VCombobox */ "./src/components/VCombobox/index.js");
/* harmony import */ var _util_rebuildFunctionalSlots__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/rebuildFunctionalSlots */ "./src/util/rebuildFunctionalSlots.js");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
/* @vue/component */
var wrapper = {
functional: true,
$_wrapperFor: _VSelect__WEBPACK_IMPORTED_MODULE_0__["default"],
props: {
// VAutoComplete
/** @deprecated */
autocomplete: Boolean,
/** @deprecated */
combobox: Boolean,
multiple: Boolean,
/** @deprecated */
tags: Boolean,
// VOverflowBtn
/** @deprecated */
editable: Boolean,
/** @deprecated */
overflow: Boolean,
/** @deprecated */
segmented: Boolean
},
render: function render(h, _a) {
var props = _a.props,
data = _a.data,
slots = _a.slots,
parent = _a.parent;
delete data.model;
var children = Object(_util_rebuildFunctionalSlots__WEBPACK_IMPORTED_MODULE_4__["default"])(slots(), h);
if (props.autocomplete) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["deprecate"])('<v-select autocomplete>', '<v-autocomplete>', wrapper, parent);
}
if (props.combobox) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["deprecate"])('<v-select combobox>', '<v-combobox>', wrapper, parent);
}
if (props.tags) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["deprecate"])('<v-select tags>', '<v-combobox multiple>', wrapper, parent);
}
if (props.overflow) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["deprecate"])('<v-select overflow>', '<v-overflow-btn>', wrapper, parent);
}
if (props.segmented) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["deprecate"])('<v-select segmented>', '<v-overflow-btn segmented>', wrapper, parent);
}
if (props.editable) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["deprecate"])('<v-select editable>', '<v-overflow-btn editable>', wrapper, parent);
}
if (props.combobox || props.tags) {
data.attrs.multiple = props.tags;
return h(_VCombobox__WEBPACK_IMPORTED_MODULE_3__["default"], data, children);
} else if (props.autocomplete) {
data.attrs.multiple = props.multiple;
return h(_VAutocomplete__WEBPACK_IMPORTED_MODULE_2__["default"], data, children);
} else if (props.overflow || props.segmented || props.editable) {
data.attrs.segmented = props.segmented;
data.attrs.editable = props.editable;
return h(_VOverflowBtn__WEBPACK_IMPORTED_MODULE_1__["default"], data, children);
} else {
data.attrs.multiple = props.multiple;
return h(_VSelect__WEBPACK_IMPORTED_MODULE_0__["default"], data, children);
}
}
};
/* istanbul ignore next */
wrapper.install = function install(Vue) {
Vue.component(_VSelect__WEBPACK_IMPORTED_MODULE_0__["default"].name, wrapper);
};
/* harmony default export */ __webpack_exports__["default"] = (wrapper);
/***/ }),
/***/ "./src/components/VSlider/VSlider.js":
/*!*******************************************!*\
!*** ./src/components/VSlider/VSlider.js ***!
\*******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_sliders_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_sliders.styl */ "./src/stylus/components/_sliders.styl");
/* harmony import */ var _stylus_components_sliders_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_sliders_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.js");
/* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VInput */ "./src/components/VInput/index.js");
/* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Styles
// Components
// Extensions
// Directives
// Utilities
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-slider',
directives: { ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_3__["default"] },
extends: _VInput__WEBPACK_IMPORTED_MODULE_2__["default"],
props: {
alwaysDirty: Boolean,
inverseLabel: Boolean,
label: String,
min: {
type: [Number, String],
default: 0
},
max: {
type: [Number, String],
default: 100
},
range: Boolean,
step: {
type: [Number, String],
default: 1
},
ticks: {
type: [Boolean, String],
default: false,
validator: function validator(v) {
return typeof v === 'boolean' || v === 'always';
}
},
tickLabels: {
type: Array,
default: function _default() {
return [];
}
},
tickSize: {
type: [Number, String],
default: 1
},
thumbColor: {
type: String,
default: null
},
thumbLabel: {
type: [Boolean, String],
default: null,
validator: function validator(v) {
return typeof v === 'boolean' || v === 'always';
}
},
thumbSize: {
type: [Number, String],
default: 32
},
trackColor: {
type: String,
default: null
},
value: [Number, String]
},
data: function data(vm) {
return {
app: {},
defaultColor: 'primary',
isActive: false,
keyPressed: 0,
lazyValue: typeof vm.value !== 'undefined' ? vm.value : Number(vm.min),
oldValue: null
};
},
computed: {
classes: function classes() {
return {
'v-input--slider': true,
'v-input--slider--ticks': this.showTicks,
'v-input--slider--inverse-label': this.inverseLabel,
'v-input--slider--ticks-labels': this.tickLabels.length > 0,
'v-input--slider--thumb-label': this.thumbLabel || this.$scopedSlots.thumbLabel
};
},
showTicks: function showTicks() {
return this.tickLabels.length > 0 || !this.disabled && this.stepNumeric && !!this.ticks;
},
showThumbLabel: function showThumbLabel() {
return !this.disabled && (!!this.thumbLabel || this.thumbLabel === '' || this.$scopedSlots['thumb-label']);
},
computedColor: function computedColor() {
if (this.disabled) return null;
return this.validationState || this.color || this.defaultColor;
},
computedTrackColor: function computedTrackColor() {
return this.disabled ? null : this.trackColor || null;
},
computedThumbColor: function computedThumbColor() {
if (this.disabled || !this.isDirty) return null;
return this.validationState || this.thumbColor || this.color || this.defaultColor;
},
internalValue: {
get: function get() {
return this.lazyValue;
},
set: function set(val) {
var _a = this,
min = _a.min,
max = _a.max;
// Round value to ensure the
// entire slider range can
// be selected with step
var value = this.roundValue(Math.min(Math.max(val, min), max));
if (value === this.lazyValue) return;
this.lazyValue = value;
this.$emit('input', value);
this.validate();
}
},
stepNumeric: function stepNumeric() {
return this.step > 0 ? parseFloat(this.step) : 0;
},
trackFillStyles: function trackFillStyles() {
var left = this.$vuetify.rtl ? 'auto' : 0;
var right = this.$vuetify.rtl ? 0 : 'auto';
var width = this.inputWidth + "%";
if (this.disabled) width = "calc(" + this.inputWidth + "% - 8px)";
return {
transition: this.trackTransition,
left: left,
right: right,
width: width
};
},
trackPadding: function trackPadding() {
return this.isActive || this.inputWidth > 0 || this.disabled ? 0 : 7;
},
trackStyles: function trackStyles() {
var trackPadding = this.disabled ? "calc(" + this.inputWidth + "% + 8px)" : this.trackPadding + "px";
var left = this.$vuetify.rtl ? 'auto' : trackPadding;
var right = this.$vuetify.rtl ? trackPadding : 'auto';
var width = this.disabled ? "calc(" + (100 - this.inputWidth) + "% - 8px)" : '100%';
return {
transition: this.trackTransition,
left: left,
right: right,
width: width
};
},
tickStyles: function tickStyles() {
var size = Number(this.tickSize);
return {
'border-width': size + "px",
'border-radius': size > 1 ? '50%' : null,
transform: size > 1 ? "translateX(-" + size + "px) translateY(-" + (size - 1) + "px)" : null
};
},
trackTransition: function trackTransition() {
return this.keyPressed >= 2 ? 'none' : '';
},
numTicks: function numTicks() {
return Math.ceil((this.max - this.min) / this.stepNumeric);
},
inputWidth: function inputWidth() {
return (this.roundValue(this.internalValue) - this.min) / (this.max - this.min) * 100;
},
isDirty: function isDirty() {
return this.internalValue > this.min || this.alwaysDirty;
}
},
watch: {
min: function min(val) {
val > this.internalValue && this.$emit('input', parseFloat(val));
},
max: function max(val) {
val < this.internalValue && this.$emit('input', parseFloat(val));
},
value: function value(val) {
this.internalValue = val;
}
},
mounted: function mounted() {
// Without a v-app, iOS does not work with body selectors
this.app = document.querySelector('[data-app]') || Object(_util_console__WEBPACK_IMPORTED_MODULE_5__["consoleWarn"])('Missing v-app or a non-body wrapping element with the [data-app] attribute', this);
},
methods: {
genDefaultSlot: function genDefaultSlot() {
var children = [this.genLabel()];
var slider = this.genSlider();
this.inverseLabel ? children.unshift(slider) : children.push(slider);
return children;
},
genListeners: function genListeners() {
return {
blur: this.onBlur,
click: this.onSliderClick,
focus: this.onFocus,
keydown: this.onKeyDown,
keyup: this.onKeyUp
};
},
genInput: function genInput() {
return this.$createElement('input', {
attrs: {
'aria-label': this.label,
name: this.name,
role: 'slider',
tabindex: this.disabled ? -1 : this.$attrs.tabindex,
value: this.internalValue,
readonly: true,
'aria-readonly': String(this.readonly)
},
on: this.genListeners(),
ref: 'input'
});
},
genSlider: function genSlider() {
return this.$createElement('div', {
staticClass: 'v-slider',
'class': {
'v-slider--is-active': this.isActive
},
directives: [{
name: 'click-outside',
value: this.onBlur
}]
}, this.genChildren());
},
genChildren: function genChildren() {
return [this.genInput(), this.genTrackContainer(), this.genSteps(), this.genThumbContainer(this.internalValue, this.inputWidth, this.isFocused || this.isActive, this.onThumbMouseDown)];
},
genSteps: function genSteps() {
var _this = this;
if (!this.step || !this.showTicks) return null;
var ticks = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["createRange"])(this.numTicks + 1).map(function (i) {
var children = [];
if (_this.tickLabels[i]) {
children.push(_this.$createElement('span', _this.tickLabels[i]));
}
return _this.$createElement('span', {
key: i,
staticClass: 'v-slider__ticks',
class: {
'v-slider__ticks--always-show': _this.ticks === 'always' || _this.tickLabels.length > 0
},
style: __assign({}, _this.tickStyles, { left: i * (100 / _this.numTicks) + "%" })
}, children);
});
return this.$createElement('div', {
staticClass: 'v-slider__ticks-container'
}, ticks);
},
genThumb: function genThumb() {
return this.$createElement('div', {
staticClass: 'v-slider__thumb',
'class': this.addBackgroundColorClassChecks({}, this.computedThumbColor)
});
},
genThumbContainer: function genThumbContainer(value, valueWidth, isActive, onDrag) {
var children = [this.genThumb()];
var thumbLabelContent = this.getLabel(value);
this.showThumbLabel && children.push(this.genThumbLabel(thumbLabelContent));
return this.$createElement('div', {
staticClass: 'v-slider__thumb-container',
'class': this.addTextColorClassChecks({
'v-slider__thumb-container--is-active': isActive,
'v-slider__thumb-container--show-label': this.showThumbLabel
}, this.computedThumbColor),
style: {
transition: this.trackTransition,
left: (this.$vuetify.rtl ? 100 - valueWidth : valueWidth) + "%"
},
on: {
touchstart: onDrag,
mousedown: onDrag
}
}, children);
},
genThumbLabel: function genThumbLabel(content) {
var size = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["convertToUnit"])(this.thumbSize);
return this.$createElement(_transitions__WEBPACK_IMPORTED_MODULE_1__["VScaleTransition"], {
props: { origin: 'bottom center' }
}, [this.$createElement('div', {
staticClass: 'v-slider__thumb-label__container',
directives: [{
name: 'show',
value: this.isFocused || this.isActive || this.thumbLabel === 'always'
}]
}, [this.$createElement('div', {
staticClass: 'v-slider__thumb-label',
'class': this.addBackgroundColorClassChecks({}, this.computedThumbColor),
style: {
height: size,
width: size
}
}, [content])])]);
},
genTrackContainer: function genTrackContainer() {
var children = [this.$createElement('div', {
staticClass: 'v-slider__track',
'class': this.addBackgroundColorClassChecks({}, this.computedTrackColor),
style: this.trackStyles
}), this.$createElement('div', {
staticClass: 'v-slider__track-fill',
'class': this.addBackgroundColorClassChecks(),
style: this.trackFillStyles
})];
return this.$createElement('div', {
staticClass: 'v-slider__track__container',
ref: 'track'
}, children);
},
getLabel: function getLabel(value) {
return this.$scopedSlots['thumb-label'] ? this.$scopedSlots['thumb-label']({ value: value }) : this.$createElement('span', value);
},
onBlur: function onBlur(e) {
if (this.keyPressed === 2) return;
this.isActive = false;
this.isFocused = false;
this.$emit('blur', e);
},
onFocus: function onFocus(e) {
this.isFocused = true;
this.$emit('focus', e);
},
onThumbMouseDown: function onThumbMouseDown(e) {
this.oldValue = this.internalValue;
this.keyPressed = 2;
var options = { passive: true };
this.isActive = true;
this.isFocused = false;
if ('touches' in e) {
this.app.addEventListener('touchmove', this.onMouseMove, options);
Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["addOnceEventListener"])(this.app, 'touchend', this.onMouseUp);
} else {
this.app.addEventListener('mousemove', this.onMouseMove, options);
Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["addOnceEventListener"])(this.app, 'mouseup', this.onMouseUp);
}
this.$emit('start', this.internalValue);
},
onMouseUp: function onMouseUp() {
this.keyPressed = 0;
var options = { passive: true };
this.isActive = false;
this.isFocused = false;
this.app.removeEventListener('touchmove', this.onMouseMove, options);
this.app.removeEventListener('mousemove', this.onMouseMove, options);
this.$emit('end', this.internalValue);
if (!Object(_util_helpers__WEBPACK_IMPORTED_MODULE_4__["deepEqual"])(this.oldValue, this.internalValue)) {
this.$emit('change', this.internalValue);
}
},
onMouseMove: function onMouseMove(e) {
var _a = this.parseMouseMove(e),
value = _a.value,
isInsideTrack = _a.isInsideTrack;
if (isInsideTrack) {
this.setInternalValue(value);
}
},
onKeyDown: function onKeyDown(e) {
if (this.disabled || this.readonly) return;
var value = this.parseKeyDown(e);
if (value == null) return;
this.setInternalValue(value);
this.$emit('change', value);
},
onKeyUp: function onKeyUp() {
this.keyPressed = 0;
},
onSliderClick: function onSliderClick(e) {
this.isFocused = true;
this.onMouseMove(e);
this.$emit('change', this.internalValue);
},
parseMouseMove: function parseMouseMove(e) {
var _a = this.$refs.track.getBoundingClientRect(),
offsetLeft = _a.left,
trackWidth = _a.width;
var clientX = 'touches' in e ? e.touches[0].clientX : e.clientX;
// It is possible for left to be NaN, force to number
var left = Math.min(Math.max((clientX - offsetLeft) / trackWidth, 0), 1) || 0;
if (this.$vuetify.rtl) left = 1 - left;
var isInsideTrack = clientX >= offsetLeft - 8 && clientX <= offsetLeft + trackWidth + 8;
var value = parseFloat(this.min) + left * (this.max - this.min);
return { value: value, isInsideTrack: isInsideTrack };
},
parseKeyDown: function parseKeyDown(e, value) {
if (value === void 0) {
value = this.internalValue;
}
if (this.disabled) return;
var pageup = _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].pageup,
pagedown = _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].pagedown,
end = _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].end,
home = _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].home,
left = _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].left,
right = _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].right,
down = _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].down,
up = _util_helpers__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].up;
if (![pageup, pagedown, end, home, left, right, down, up].includes(e.keyCode)) return;
e.preventDefault();
var step = this.stepNumeric || 1;
var steps = (this.max - this.min) / step;
if ([left, right, down, up].includes(e.keyCode)) {
this.keyPressed += 1;
var increase = this.$vuetify.rtl ? [left, up] : [right, up];
var direction = increase.includes(e.keyCode) ? 1 : -1;
var multiplier = e.shiftKey ? 3 : e.ctrlKey ? 2 : 1;
value = value + direction * step * multiplier;
} else if (e.keyCode === home) {
value = parseFloat(this.min);
} else if (e.keyCode === end) {
value = parseFloat(this.max);
} else /* if (e.keyCode === keyCodes.pageup || e.keyCode === pagedown) */{
// Page up/down
var direction = e.keyCode === pagedown ? 1 : -1;
value = value - direction * step * (steps > 100 ? steps / 10 : 10);
}
return value;
},
roundValue: function roundValue(value) {
if (!this.stepNumeric) return value;
// Format input value using the same number
// of decimals places as in the step prop
var trimmedStep = this.step.toString().trim();
var decimals = trimmedStep.indexOf('.') > -1 ? trimmedStep.length - trimmedStep.indexOf('.') - 1 : 0;
var offset = this.min % this.stepNumeric;
var newValue = Math.round((value - offset) / this.stepNumeric) * this.stepNumeric + offset;
return parseFloat(Math.min(newValue, this.max).toFixed(decimals));
},
setInternalValue: function setInternalValue(value) {
this.internalValue = value;
}
}
});
/***/ }),
/***/ "./src/components/VSlider/index.js":
/*!*****************************************!*\
!*** ./src/components/VSlider/index.js ***!
\*****************************************/
/*! exports provided: VSlider, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VSlider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSlider */ "./src/components/VSlider/VSlider.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlider", function() { return _VSlider__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VSlider__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VSlider__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VSlider__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VSlider__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VSnackbar/VSnackbar.ts":
/*!***********************************************!*\
!*** ./src/components/VSnackbar/VSnackbar.ts ***!
\***********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_snackbars_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_snackbars.styl */ "./src/stylus/components/_snackbars.styl");
/* harmony import */ var _stylus_components_snackbars_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_snackbars_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _mixins_positionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/positionable */ "./src/mixins/positionable.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/mixins */ "./src/util/mixins.ts");
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__["default"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_mixins_positionable__WEBPACK_IMPORTED_MODULE_3__["factory"])(['absolute', 'top', 'bottom', 'left', 'right'])
/* @vue/component */
).extend({
name: 'v-snackbar',
props: {
autoHeight: Boolean,
multiLine: Boolean,
// TODO: change this to closeDelay to match other API in delayable.js
timeout: {
type: Number,
default: 6000
},
vertical: Boolean
},
data: function data() {
return {
activeTimeout: -1
};
},
computed: {
classes: function classes() {
return {
'v-snack--active': this.isActive,
'v-snack--absolute': this.absolute,
'v-snack--auto-height': this.autoHeight,
'v-snack--bottom': this.bottom || !this.top,
'v-snack--left': this.left,
'v-snack--multi-line': this.multiLine && !this.vertical,
'v-snack--right': this.right,
'v-snack--top': this.top,
'v-snack--vertical': this.vertical
};
}
},
watch: {
isActive: function isActive() {
this.setTimeout();
}
},
mounted: function mounted() {
this.setTimeout();
},
methods: {
setTimeout: function setTimeout() {
var _this = this;
window.clearTimeout(this.activeTimeout);
if (this.isActive && this.timeout) {
this.activeTimeout = window.setTimeout(function () {
_this.isActive = false;
}, this.timeout);
}
}
},
render: function render(h) {
var children = [];
if (this.isActive) {
children.push(h('div', {
staticClass: 'v-snack',
class: this.classes,
on: this.$listeners
}, [h('div', {
staticClass: 'v-snack__wrapper',
class: this.addBackgroundColorClassChecks()
}, [h('div', {
staticClass: 'v-snack__content'
}, this.$slots.default)])]));
}
return h('transition', {
attrs: { name: 'v-snack-transition' }
}, children);
}
}));
/***/ }),
/***/ "./src/components/VSnackbar/index.ts":
/*!*******************************************!*\
!*** ./src/components/VSnackbar/index.ts ***!
\*******************************************/
/*! exports provided: VSnackbar, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VSnackbar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSnackbar */ "./src/components/VSnackbar/VSnackbar.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSnackbar", function() { return _VSnackbar__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VSnackbar__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VSnackbar__WEBPACK_IMPORTED_MODULE_0__["default"].options.name, _VSnackbar__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VSnackbar__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VSpeedDial/VSpeedDial.js":
/*!*************************************************!*\
!*** ./src/components/VSpeedDial/VSpeedDial.js ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_speed_dial_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_speed-dial.styl */ "./src/stylus/components/_speed-dial.styl");
/* harmony import */ var _stylus_components_speed_dial_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_speed_dial_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _mixins_positionable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/positionable */ "./src/mixins/positionable.ts");
/* harmony import */ var _mixins_transitionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/transitionable */ "./src/mixins/transitionable.ts");
/* harmony import */ var _directives_click_outside__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../directives/click-outside */ "./src/directives/click-outside.ts");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-speed-dial',
directives: { ClickOutside: _directives_click_outside__WEBPACK_IMPORTED_MODULE_4__["default"] },
mixins: [_mixins_positionable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_transitionable__WEBPACK_IMPORTED_MODULE_3__["default"]],
props: {
direction: {
type: String,
default: 'top',
validator: function validator(val) {
return ['top', 'right', 'bottom', 'left'].includes(val);
}
},
openOnHover: Boolean,
transition: {
type: String,
default: 'scale-transition'
}
},
computed: {
classes: function classes() {
var _a;
return _a = {
'v-speed-dial': true,
'v-speed-dial--top': this.top,
'v-speed-dial--right': this.right,
'v-speed-dial--bottom': this.bottom,
'v-speed-dial--left': this.left,
'v-speed-dial--absolute': this.absolute,
'v-speed-dial--fixed': this.fixed
}, _a["v-speed-dial--direction-" + this.direction] = true, _a;
}
},
render: function render(h) {
var _this = this;
var children = [];
var data = {
'class': this.classes,
directives: [{
name: 'click-outside',
value: function value() {
return _this.isActive = false;
}
}],
on: {
click: function click() {
return _this.isActive = !_this.isActive;
}
}
};
if (this.openOnHover) {
data.on.mouseenter = function () {
return _this.isActive = true;
};
data.on.mouseleave = function () {
return _this.isActive = false;
};
}
if (this.isActive) {
children = (this.$slots.default || []).map(function (b, i) {
b.key = i;
return b;
});
}
var list = h('transition-group', {
'class': 'v-speed-dial__list',
props: {
name: this.transition,
mode: this.mode,
origin: this.origin,
tag: 'div'
}
}, children);
return h('div', data, [this.$slots.activator, list]);
}
});
/***/ }),
/***/ "./src/components/VSpeedDial/index.js":
/*!********************************************!*\
!*** ./src/components/VSpeedDial/index.js ***!
\********************************************/
/*! exports provided: VSpeedDial, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VSpeedDial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSpeedDial */ "./src/components/VSpeedDial/VSpeedDial.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSpeedDial", function() { return _VSpeedDial__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VSpeedDial__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VSpeedDial__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VSpeedDial__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VSpeedDial__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VStepper/VStepper.js":
/*!*********************************************!*\
!*** ./src/components/VStepper/VStepper.js ***!
\*********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_steppers_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_steppers.styl */ "./src/stylus/components/_steppers.styl");
/* harmony import */ var _stylus_components_steppers_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_steppers_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-stepper',
mixins: [_mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"]],
provide: function provide() {
return {
stepClick: this.stepClick
};
},
props: {
nonLinear: Boolean,
altLabels: Boolean,
vertical: Boolean,
value: [Number, String]
},
data: function data() {
return {
inputValue: null,
isBooted: false,
steps: [],
content: [],
isReverse: false
};
},
computed: {
classes: function classes() {
return {
'v-stepper': true,
'v-stepper--is-booted': this.isBooted,
'v-stepper--vertical': this.vertical,
'v-stepper--alt-labels': this.altLabels,
'v-stepper--non-linear': this.nonLinear,
'theme--dark': this.dark,
'theme--light': this.light
};
}
},
watch: {
inputValue: function inputValue(val, prev) {
this.isReverse = Number(val) < Number(prev);
for (var index = this.steps.length; --index >= 0;) {
this.steps[index].toggle(this.inputValue);
}
for (var index = this.content.length; --index >= 0;) {
this.content[index].toggle(this.inputValue, this.isReverse);
}
this.$emit('input', this.inputValue);
prev && (this.isBooted = true);
},
value: function value() {
var _this = this;
this.getSteps();
this.$nextTick(function () {
return _this.inputValue = _this.value;
});
}
},
mounted: function mounted() {
this.getSteps();
this.inputValue = this.value || this.steps[0].step || 1;
},
methods: {
getSteps: function getSteps() {
this.steps = [];
this.content = [];
for (var index = 0; index < this.$children.length; index++) {
var child = this.$children[index];
if (child.$options.name === 'v-stepper-step') {
this.steps.push(child);
} else if (child.$options.name === 'v-stepper-content') {
child.isVertical = this.vertical;
this.content.push(child);
}
}
},
stepClick: function stepClick(step) {
var _this = this;
this.getSteps();
this.$nextTick(function () {
return _this.inputValue = step;
});
}
},
render: function render(h) {
return h('div', {
'class': this.classes
}, this.$slots.default);
}
});
/***/ }),
/***/ "./src/components/VStepper/VStepperContent.js":
/*!****************************************************!*\
!*** ./src/components/VStepper/VStepperContent.js ***!
\****************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.js");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
// Helpers
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-stepper-content',
props: {
step: {
type: [Number, String],
required: true
}
},
data: function data() {
return {
height: 0,
// Must be null to allow
// previous comparison
isActive: null,
isReverse: false,
isVertical: false
};
},
computed: {
classes: function classes() {
return {
'v-stepper__content': true
};
},
computedTransition: function computedTransition() {
return this.isReverse ? _transitions__WEBPACK_IMPORTED_MODULE_0__["VTabReverseTransition"] : _transitions__WEBPACK_IMPORTED_MODULE_0__["VTabTransition"];
},
styles: function styles() {
if (!this.isVertical) return {};
return {
height: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["convertToUnit"])(this.height)
};
},
wrapperClasses: function wrapperClasses() {
return {
'v-stepper__wrapper': true
};
}
},
watch: {
isActive: function isActive(current, previous) {
// If active and the previous state
// was null, is just booting up
if (current && previous == null) {
return this.height = 'auto';
}
if (!this.isVertical) return;
if (this.isActive) this.enter();else this.leave();
}
},
mounted: function mounted() {
this.$refs.wrapper.addEventListener('transitionend', this.onTransition, false);
},
beforeDestroy: function beforeDestroy() {
this.$refs.wrapper.removeEventListener('transitionend', this.onTransition, false);
},
methods: {
onTransition: function onTransition(e) {
if (!this.isActive || e.propertyName !== 'height') return;
this.height = 'auto';
},
enter: function enter() {
var _this = this;
var scrollHeight = 0;
// Render bug with height
requestAnimationFrame(function () {
scrollHeight = _this.$refs.wrapper.scrollHeight;
});
this.height = 0;
// Give the collapsing element time to collapse
setTimeout(function () {
return _this.isActive && (_this.height = scrollHeight || 'auto');
}, 450);
},
leave: function leave() {
var _this = this;
this.height = this.$refs.wrapper.clientHeight;
setTimeout(function () {
return _this.height = 0;
}, 10);
},
toggle: function toggle(step, reverse) {
this.isActive = step.toString() === this.step.toString();
this.isReverse = reverse;
}
},
render: function render(h) {
var contentData = {
'class': this.classes
};
var wrapperData = {
'class': this.wrapperClasses,
style: this.styles,
ref: 'wrapper'
};
if (!this.isVertical) {
contentData.directives = [{
name: 'show',
value: this.isActive
}];
}
var wrapper = h('div', wrapperData, [this.$slots.default]);
var content = h('div', contentData, [wrapper]);
return h(this.computedTransition, {
on: this.$listeners
}, [content]);
}
});
/***/ }),
/***/ "./src/components/VStepper/VStepperStep.js":
/*!*************************************************!*\
!*** ./src/components/VStepper/VStepperStep.js ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple.ts");
// Components
// Directives
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-stepper-step',
directives: { Ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_1__["default"] },
inject: ['stepClick'],
props: {
color: {
type: String,
default: 'primary'
},
complete: Boolean,
completeIcon: {
type: String,
default: '$vuetify.icons.complete'
},
editIcon: {
type: String,
default: '$vuetify.icons.edit'
},
errorIcon: {
type: String,
default: '$vuetify.icons.error'
},
editable: Boolean,
rules: {
type: Array,
default: function _default() {
return [];
}
},
step: [Number, String]
},
data: function data() {
return {
isActive: false,
isInactive: true
};
},
computed: {
classes: function classes() {
return {
'v-stepper__step': true,
'v-stepper__step--active': this.isActive,
'v-stepper__step--editable': this.editable,
'v-stepper__step--inactive': this.isInactive,
'v-stepper__step--error': this.hasError,
'v-stepper__step--complete': this.complete,
'error--text': this.hasError
};
},
hasError: function hasError() {
return this.rules.some(function (i) {
return i() !== true;
});
}
},
methods: {
click: function click(e) {
e.stopPropagation();
if (this.editable) {
this.stepClick(this.step);
}
},
toggle: function toggle(step) {
this.isActive = step.toString() === this.step.toString();
this.isInactive = Number(step) < Number(this.step);
}
},
render: function render(h) {
var _a;
var data = {
'class': this.classes,
directives: [{
name: 'ripple',
value: this.editable
}],
on: { click: this.click }
};
var stepContent;
if (this.hasError) {
stepContent = [h(_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"], {}, this.errorIcon)];
} else if (this.complete) {
if (this.editable) {
stepContent = [h(_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"], {}, this.editIcon)];
} else {
stepContent = [h(_VIcon__WEBPACK_IMPORTED_MODULE_0__["default"], {}, this.completeIcon)];
}
} else {
stepContent = this.step;
}
var step = h('span', {
staticClass: 'v-stepper__step__step',
'class': (_a = {}, _a[this.color] = !this.hasError && (this.complete || this.isActive), _a)
}, stepContent);
var label = h('div', {
staticClass: 'v-stepper__label'
}, this.$slots.default);
return h('div', data, [step, label]);
}
});
/***/ }),
/***/ "./src/components/VStepper/index.js":
/*!******************************************!*\
!*** ./src/components/VStepper/index.js ***!
\******************************************/
/*! exports provided: VStepper, VStepperContent, VStepperStep, VStepperHeader, VStepperItems, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VStepperHeader", function() { return VStepperHeader; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VStepperItems", function() { return VStepperItems; });
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _VStepper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VStepper */ "./src/components/VStepper/VStepper.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepper", function() { return _VStepper__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _VStepperStep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VStepperStep */ "./src/components/VStepper/VStepperStep.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepperStep", function() { return _VStepperStep__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* harmony import */ var _VStepperContent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VStepperContent */ "./src/components/VStepper/VStepperContent.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepperContent", function() { return _VStepperContent__WEBPACK_IMPORTED_MODULE_3__["default"]; });
var VStepperHeader = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-stepper__header');
var VStepperItems = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-stepper__items');
/* istanbul ignore next */
_VStepper__WEBPACK_IMPORTED_MODULE_1__["default"].install = function install(Vue) {
Vue.component(_VStepper__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VStepper__WEBPACK_IMPORTED_MODULE_1__["default"]);
Vue.component(_VStepperContent__WEBPACK_IMPORTED_MODULE_3__["default"].name, _VStepperContent__WEBPACK_IMPORTED_MODULE_3__["default"]);
Vue.component(_VStepperStep__WEBPACK_IMPORTED_MODULE_2__["default"].name, _VStepperStep__WEBPACK_IMPORTED_MODULE_2__["default"]);
Vue.component(VStepperHeader.name, VStepperHeader);
Vue.component(VStepperItems.name, VStepperItems);
};
/* harmony default export */ __webpack_exports__["default"] = (_VStepper__WEBPACK_IMPORTED_MODULE_1__["default"]);
/***/ }),
/***/ "./src/components/VSubheader/VSubheader.js":
/*!*************************************************!*\
!*** ./src/components/VSubheader/VSubheader.js ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_subheaders_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_subheaders.styl */ "./src/stylus/components/_subheaders.styl");
/* harmony import */ var _stylus_components_subheaders_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_subheaders_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-subheader',
functional: true,
mixins: [_mixins_themeable__WEBPACK_IMPORTED_MODULE_1__["default"]],
props: {
inset: Boolean
},
render: function render(h, _a) {
var data = _a.data,
children = _a.children,
props = _a.props;
data.staticClass = ("v-subheader " + (data.staticClass || '')).trim();
if (props.inset) data.staticClass += ' v-subheader--inset';
if (props.light) data.staticClass += ' theme--light';
if (props.dark) data.staticClass += ' theme--dark';
return h('div', data, children);
}
});
/***/ }),
/***/ "./src/components/VSubheader/index.js":
/*!********************************************!*\
!*** ./src/components/VSubheader/index.js ***!
\********************************************/
/*! exports provided: VSubheader, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VSubheader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSubheader */ "./src/components/VSubheader/VSubheader.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSubheader", function() { return _VSubheader__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VSubheader__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VSubheader__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VSubheader__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VSubheader__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VSwitch/VSwitch.js":
/*!*******************************************!*\
!*** ./src/components/VSwitch/VSwitch.js ***!
\*******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_selection_controls_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_selection-controls.styl */ "./src/stylus/components/_selection-controls.styl");
/* harmony import */ var _stylus_components_selection_controls_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_selection_controls_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _stylus_components_switch_styl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../stylus/components/_switch.styl */ "./src/stylus/components/_switch.styl");
/* harmony import */ var _stylus_components_switch_styl__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_switch_styl__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _mixins_selectable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/selectable */ "./src/mixins/selectable.js");
/* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Mixins
// Directives
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-switch',
directives: { Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_3__["default"] },
mixins: [_mixins_selectable__WEBPACK_IMPORTED_MODULE_2__["default"]],
computed: {
classes: function classes() {
return {
'v-input--selection-controls v-input--switch': true
};
}
},
methods: {
genDefaultSlot: function genDefaultSlot() {
return [this.genSwitch(), this.genLabel()];
},
genSwitch: function genSwitch() {
return this.$createElement('div', {
staticClass: 'v-input--selection-controls__input'
}, [this.genInput('checkbox', this.$attrs), !this.disabled && this.genRipple({
'class': this.classesSelectable,
directives: [{
name: 'touch',
value: {
left: this.onSwipeLeft,
right: this.onSwipeRight
}
}]
}), this.genSwitchPart('track'), this.genSwitchPart('thumb')]);
},
// Switches have default colors for thumb/track
// that do not tie into theme colors
// this avoids a visual issue where
// the color takes too long to transition
genSwitchPart: function genSwitchPart(target) {
return this.$createElement('div', {
staticClass: "v-input--switch__" + target,
'class': __assign({}, this.classesSelectable, this.themeClasses),
// Avoid cache collision
key: target
});
},
onSwipeLeft: function onSwipeLeft() {
if (this.isActive) this.onChange();
},
onSwipeRight: function onSwipeRight() {
if (!this.isActive) this.onChange();
}
}
});
/***/ }),
/***/ "./src/components/VSwitch/index.js":
/*!*****************************************!*\
!*** ./src/components/VSwitch/index.js ***!
\*****************************************/
/*! exports provided: VSwitch, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VSwitch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSwitch */ "./src/components/VSwitch/VSwitch.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSwitch", function() { return _VSwitch__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VSwitch__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VSwitch__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VSwitch__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VSwitch__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VSystemBar/VSystemBar.js":
/*!*************************************************!*\
!*** ./src/components/VSystemBar/VSystemBar.js ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_system_bars_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_system-bars.styl */ "./src/stylus/components/_system-bars.styl");
/* harmony import */ var _stylus_components_system_bars_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_system_bars_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/applicationable */ "./src/mixins/applicationable.ts");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-system-bar',
mixins: [Object(_mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__["default"])('bar', ['height', 'window']), _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]],
props: {
height: {
type: [Number, String],
validator: function validator(v) {
return !isNaN(parseInt(v));
}
},
lightsOut: Boolean,
status: Boolean,
window: Boolean
},
computed: {
classes: function classes() {
return this.addBackgroundColorClassChecks(Object.assign({
'v-system-bar--lights-out': this.lightsOut,
'v-system-bar--absolute': this.absolute,
'v-system-bar--fixed': !this.absolute && (this.app || this.fixed),
'v-system-bar--status': this.status,
'v-system-bar--window': this.window
}, this.themeClasses));
},
computedHeight: function computedHeight() {
if (this.height) return parseInt(this.height);
return this.window ? 32 : 24;
}
},
methods: {
/**
* Update the application layout
*
* @return {number}
*/
updateApplication: function updateApplication() {
return this.computedHeight;
}
},
render: function render(h) {
var data = {
staticClass: 'v-system-bar',
'class': this.classes,
style: {
height: this.computedHeight + "px"
}
};
return h('div', data, this.$slots.default);
}
});
/***/ }),
/***/ "./src/components/VSystemBar/index.js":
/*!********************************************!*\
!*** ./src/components/VSystemBar/index.js ***!
\********************************************/
/*! exports provided: VSystemBar, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VSystemBar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VSystemBar */ "./src/components/VSystemBar/VSystemBar.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSystemBar", function() { return _VSystemBar__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VSystemBar__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VSystemBar__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VSystemBar__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VSystemBar__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VTabs/VTab.js":
/*!**************************************!*\
!*** ./src/components/VTabs/VTab.js ***!
\**************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _mixins_routable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/routable */ "./src/mixins/routable.ts");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
// Mixins
// Utilities
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-tab',
mixins: [Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_1__["inject"])('tabs', 'v-tab', 'v-tabs'), _mixins_routable__WEBPACK_IMPORTED_MODULE_0__["default"]],
inject: ['tabClick'],
props: {
activeClass: {
type: String,
default: 'v-tabs__item--active'
},
ripple: {
type: [Boolean, Object],
default: true
}
},
data: function data() {
return {
isActive: false
};
},
computed: {
classes: function classes() {
var _a;
return _a = {
'v-tabs__item': true,
'v-tabs__item--disabled': this.disabled
}, _a[this.activeClass] = !this.to && this.isActive, _a;
},
action: function action() {
var to = this.to || this.href;
if (this.$router && this.to === Object(this.to)) {
var resolve = this.$router.resolve(this.to, this.$route, this.append);
to = resolve.href;
}
return typeof to === 'string' ? to.replace('#', '') : this;
}
},
watch: {
$route: 'onRouteChange'
},
mounted: function mounted() {
this.tabs.register(this);
this.onRouteChange();
},
beforeDestroy: function beforeDestroy() {
this.tabs.unregister(this);
},
methods: {
click: function click(e) {
// If user provides an
// actual link, do not
// prevent default
if (this.href && this.href.indexOf('#') > -1) e.preventDefault();
this.$emit('click', e);
this.to || this.tabClick(this);
},
onRouteChange: function onRouteChange() {
var _this = this;
if (!this.to || !this.$refs.link) return;
var path = "_vnode.data.class." + this.activeClass;
this.$nextTick(function () {
if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_2__["getObjectValueByPath"])(_this.$refs.link, path)) {
_this.tabClick(_this);
}
});
},
toggle: function toggle(action) {
this.isActive = action === this || action === this.action;
}
},
render: function render(h) {
var link = this.generateRouteLink();
var data = link.data;
// If disabled, use div as anchor tags do not support
// being disabled
var tag = this.disabled ? 'div' : link.tag;
data.ref = 'link';
return h('div', {
staticClass: 'v-tabs__div'
}, [h(tag, data, this.$slots.default)]);
}
});
/***/ }),
/***/ "./src/components/VTabs/VTabItem.js":
/*!******************************************!*\
!*** ./src/components/VTabs/VTabItem.js ***!
\******************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _mixins_bootable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/bootable */ "./src/mixins/bootable.ts");
/* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transitions */ "./src/components/transitions/index.js");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch.ts");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-tab-item',
components: {
VTabTransition: _transitions__WEBPACK_IMPORTED_MODULE_1__["VTabTransition"],
VTabReverseTransition: _transitions__WEBPACK_IMPORTED_MODULE_1__["VTabReverseTransition"]
},
directives: {
Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_3__["default"]
},
mixins: [_mixins_bootable__WEBPACK_IMPORTED_MODULE_0__["default"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_2__["inject"])('tabs', 'v-tab-item', 'v-tabs-items')],
props: {
id: String,
transition: {
type: [Boolean, String],
default: 'tab-transition'
},
reverseTransition: {
type: [Boolean, String],
default: 'tab-reverse-transition'
}
},
data: function data() {
return {
isActive: false,
reverse: false
};
},
computed: {
computedTransition: function computedTransition() {
return this.reverse ? this.reverseTransition : this.transition;
}
},
mounted: function mounted() {
this.tabs.register(this);
},
beforeDestroy: function beforeDestroy() {
this.tabs.unregister(this);
},
methods: {
toggle: function toggle(isActive, reverse, showTransition) {
this.$el.style.transition = !showTransition ? 'none' : null;
this.reverse = reverse;
this.isActive = isActive;
}
},
render: function render(h) {
var data = {
staticClass: 'v-tabs__content',
directives: [{
name: 'show',
value: this.isActive
}],
domProps: { id: this.id },
on: this.$listeners
};
var div = h('div', data, this.showLazyContent(this.$slots.default));
if (!this.computedTransition) return div;
return h('transition', {
props: { name: this.computedTransition }
}, [div]);
}
});
/***/ }),
/***/ "./src/components/VTabs/VTabs.js":
/*!***************************************!*\
!*** ./src/components/VTabs/VTabs.js ***!
\***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_tabs_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_tabs.styl */ "./src/stylus/components/_tabs.styl");
/* harmony import */ var _stylus_components_tabs_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_tabs_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_tabs_computed__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mixins/tabs-computed */ "./src/components/VTabs/mixins/tabs-computed.js");
/* harmony import */ var _mixins_tabs_generators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mixins/tabs-generators */ "./src/components/VTabs/mixins/tabs-generators.js");
/* harmony import */ var _mixins_tabs_props__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mixins/tabs-props */ "./src/components/VTabs/mixins/tabs-props.js");
/* harmony import */ var _mixins_tabs_touch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mixins/tabs-touch */ "./src/components/VTabs/mixins/tabs-touch.js");
/* harmony import */ var _mixins_tabs_watchers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mixins/tabs-watchers */ "./src/components/VTabs/mixins/tabs-watchers.js");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../mixins/ssr-bootable */ "./src/mixins/ssr-bootable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _directives_resize__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../directives/resize */ "./src/directives/resize.ts");
/* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch.ts");
// Styles
// Component level mixins
// Mixins
// Directives
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-tabs',
directives: {
Resize: _directives_resize__WEBPACK_IMPORTED_MODULE_10__["default"],
Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_11__["default"]
},
mixins: [Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_9__["provide"])('tabs'), _mixins_colorable__WEBPACK_IMPORTED_MODULE_6__["default"], _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_7__["default"], _mixins_tabs_computed__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_tabs_props__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_tabs_generators__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_tabs_touch__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_tabs_watchers__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_8__["default"]],
provide: function provide() {
return {
tabClick: this.tabClick,
tabProxy: this.tabProxy,
registerItems: this.registerItems,
unregisterItems: this.unregisterItems
};
},
data: function data() {
return {
bar: [],
content: [],
isBooted: false,
isOverflowing: false,
lazyValue: this.value,
nextIconVisible: false,
prevIconVisible: false,
resizeTimeout: null,
reverse: false,
scrollOffset: 0,
sliderWidth: null,
sliderLeft: null,
startX: 0,
tabsContainer: null,
tabs: [],
tabItems: null,
transitionTime: 300,
widths: {
bar: 0,
container: 0,
wrapper: 0
}
};
},
watch: {
tabs: 'onResize'
},
mounted: function mounted() {
this.checkIcons();
},
methods: {
checkIcons: function checkIcons() {
this.prevIconVisible = this.checkPrevIcon();
this.nextIconVisible = this.checkNextIcon();
},
checkPrevIcon: function checkPrevIcon() {
return this.scrollOffset > 0;
},
checkNextIcon: function checkNextIcon() {
// Check one scroll ahead to know the width of right-most item
return this.widths.container > this.scrollOffset + this.widths.wrapper;
},
callSlider: function callSlider() {
var _this = this;
if (this.hideSlider || !this.activeTab) return false;
// Give screen time to paint
var action = (this.activeTab || {}).action;
var activeTab = action === this.activeTab ? this.activeTab : this.tabs.find(function (tab) {
return tab.action === action;
});
this.$nextTick(function () {
if (!activeTab || !activeTab.$el) return;
_this.sliderWidth = activeTab.$el.scrollWidth;
_this.sliderLeft = activeTab.$el.offsetLeft;
});
},
/**
* When v-navigation-drawer changes the
* width of the container, call resize
* after the transition is complete
*/
onResize: function onResize() {
var _this = this;
if (this._isDestroyed) return;
this.setWidths();
clearTimeout(this.resizeTimeout);
this.resizeTimeout = setTimeout(function () {
_this.callSlider();
_this.scrollIntoView();
_this.checkIcons();
}, this.transitionTime);
},
overflowCheck: function overflowCheck(e, fn) {
this.isOverflowing && fn(e);
},
scrollTo: function scrollTo(direction) {
this.scrollOffset = this.newOffset(direction);
},
setOverflow: function setOverflow() {
this.isOverflowing = this.widths.bar < this.widths.container;
},
setWidths: function setWidths() {
var bar = this.$refs.bar ? this.$refs.bar.clientWidth : 0;
var container = this.$refs.container ? this.$refs.container.clientWidth : 0;
var wrapper = this.$refs.wrapper ? this.$refs.wrapper.clientWidth : 0;
this.widths = { bar: bar, container: container, wrapper: wrapper };
this.setOverflow();
},
findActiveLink: function findActiveLink() {
var _this = this;
if (!this.tabs.length) return;
var activeIndex = this.tabs.findIndex(function (tabItem, index) {
var id = tabItem.action === tabItem ? index : tabItem.action;
return id === _this.lazyValue || tabItem.$el.firstChild.className.indexOf(_this.activeClass) > -1;
});
var index = activeIndex > -1 ? activeIndex : 0;
var tab = this.tabs[index];
/* istanbul ignore next */
// There is not a reliable way to test
this.inputValue = tab.action === tab ? index : tab.action;
},
parseNodes: function parseNodes() {
var item = [];
var items = [];
var slider = [];
var tab = [];
var length = (this.$slots.default || []).length;
for (var i = 0; i < length; i++) {
var vnode = this.$slots.default[i];
if (vnode.componentOptions) {
switch (vnode.componentOptions.Ctor.options.name) {
case 'v-tabs-slider':
slider.push(vnode);
break;
case 'v-tabs-items':
items.push(vnode);
break;
case 'v-tab-item':
item.push(vnode);
break;
// case 'v-tab' - intentionally omitted
default:
tab.push(vnode);
}
} else {
tab.push(vnode);
}
}
return { tab: tab, slider: slider, items: items, item: item };
},
register: function register(options) {
this.tabs.push(options);
},
scrollIntoView: function scrollIntoView() {
if (!this.activeTab) return;
if (!this.isOverflowing) return this.scrollOffset = 0;
var totalWidth = this.widths.wrapper + this.scrollOffset;
var _a = this.activeTab.$el,
clientWidth = _a.clientWidth,
offsetLeft = _a.offsetLeft;
var itemOffset = clientWidth + offsetLeft;
var additionalOffset = clientWidth * 0.3;
if (this.activeIndex === this.tabs.length - 1) {
additionalOffset = 0; // don't add an offset if selecting the last tab
}
/* istanbul ignore else */
if (offsetLeft < this.scrollOffset) {
this.scrollOffset = Math.max(offsetLeft - additionalOffset, 0);
} else if (totalWidth < itemOffset) {
this.scrollOffset -= totalWidth - itemOffset - additionalOffset;
}
},
tabClick: function tabClick(tab) {
this.inputValue = tab.action === tab ? this.tabs.indexOf(tab) : tab.action;
this.scrollIntoView();
},
tabProxy: function tabProxy(val) {
this.inputValue = val;
},
registerItems: function registerItems(fn) {
this.tabItems = fn;
},
unregisterItems: function unregisterItems() {
this.tabItems = null;
},
unregister: function unregister(tab) {
this.tabs = this.tabs.filter(function (o) {
return o !== tab;
});
},
updateTabs: function updateTabs() {
for (var index = this.tabs.length; --index >= 0;) {
this.tabs[index].toggle(this.target);
}
this.setOverflow();
}
},
render: function render(h) {
var _a = this.parseNodes(),
tab = _a.tab,
slider = _a.slider,
items = _a.items,
item = _a.item;
return h('div', {
staticClass: 'v-tabs',
directives: [{
name: 'resize',
arg: 400,
modifiers: { quiet: true },
value: this.onResize
}]
}, [this.genBar([this.hideSlider ? null : this.genSlider(slider), tab]), this.genItems(items, item)]);
}
});
/***/ }),
/***/ "./src/components/VTabs/VTabsItems.js":
/*!********************************************!*\
!*** ./src/components/VTabs/VTabsItems.js ***!
\********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _directives_touch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../directives/touch */ "./src/directives/touch.ts");
// Mixins
// Directives
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-tabs-items',
directives: { Touch: _directives_touch__WEBPACK_IMPORTED_MODULE_1__["default"] },
mixins: [Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_0__["provide"])('tabs')],
inject: {
registerItems: {
default: null
},
tabProxy: {
default: null
},
unregisterItems: {
default: null
}
},
props: {
cycle: Boolean,
touchless: Boolean,
value: [Number, String]
},
data: function data() {
return {
items: [],
lazyValue: this.value,
reverse: false
};
},
computed: {
activeIndex: function activeIndex() {
var _this = this;
return this.items.findIndex(function (item, index) {
return item.id === _this.lazyValue || index === _this.lazyValue;
});
},
activeItem: function activeItem() {
if (!this.items.length) return undefined;
return this.items[this.activeIndex];
},
inputValue: {
get: function get() {
return this.lazyValue;
},
set: function set(val) {
this.lazyValue = val;
if (this.tabProxy) this.tabProxy(val);else this.$emit('input', val);
}
}
},
watch: {
activeIndex: function activeIndex(current, previous) {
this.reverse = current < previous;
this.updateItems();
},
value: function value(val) {
this.lazyValue = val;
}
},
mounted: function mounted() {
this.registerItems && this.registerItems(this.changeModel);
},
beforeDestroy: function beforeDestroy() {
this.unregisterItems && this.unregisterItems();
},
methods: {
changeModel: function changeModel(val) {
this.inputValue = val;
},
next: function next(cycle) {
var nextIndex = this.activeIndex + 1;
if (!this.items[nextIndex]) {
if (!cycle) return;
nextIndex = 0;
}
this.inputValue = this.items[nextIndex].id || nextIndex;
},
prev: function prev(cycle) {
var prevIndex = this.activeIndex - 1;
if (!this.items[prevIndex]) {
if (!cycle) return;
prevIndex = this.items.length - 1;
}
this.inputValue = this.items[prevIndex].id || prevIndex;
},
onSwipe: function onSwipe(action) {
this[action](this.cycle);
},
register: function register(item) {
this.items.push(item);
},
unregister: function unregister(item) {
this.items = this.items.filter(function (i) {
return i !== item;
});
},
updateItems: function updateItems() {
for (var index = this.items.length; --index >= 0;) {
this.items[index].toggle(this.activeIndex === index, this.reverse, this.isBooted);
}
this.isBooted = true;
}
},
render: function render(h) {
var _this = this;
var data = {
staticClass: 'v-tabs__items',
directives: []
};
!this.touchless && data.directives.push({
name: 'touch',
value: {
left: function left() {
return _this.onSwipe('next');
},
right: function right() {
return _this.onSwipe('prev');
}
}
});
return h('div', data, this.$slots.default);
}
});
/***/ }),
/***/ "./src/components/VTabs/VTabsSlider.js":
/*!*********************************************!*\
!*** ./src/components/VTabs/VTabsSlider.js ***!
\*********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-tabs-slider',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_0__["default"]],
data: function data() {
return {
defaultColor: 'accent'
};
},
render: function render(h) {
return h('div', {
staticClass: 'v-tabs__slider',
class: this.addBackgroundColorClassChecks()
});
}
});
/***/ }),
/***/ "./src/components/VTabs/index.js":
/*!***************************************!*\
!*** ./src/components/VTabs/index.js ***!
\***************************************/
/*! exports provided: VTabs, VTabItem, VTab, VTabsItems, VTabsSlider, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VTabs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTabs */ "./src/components/VTabs/VTabs.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabs", function() { return _VTabs__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _VTab__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VTab */ "./src/components/VTabs/VTab.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTab", function() { return _VTab__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _VTabsItems__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VTabsItems */ "./src/components/VTabs/VTabsItems.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabsItems", function() { return _VTabsItems__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* harmony import */ var _VTabItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VTabItem */ "./src/components/VTabs/VTabItem.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabItem", function() { return _VTabItem__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _VTabsSlider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VTabsSlider */ "./src/components/VTabs/VTabsSlider.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabsSlider", function() { return _VTabsSlider__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/* istanbul ignore next */
_VTabs__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VTabs__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VTabs__WEBPACK_IMPORTED_MODULE_0__["default"]);
Vue.component(_VTab__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VTab__WEBPACK_IMPORTED_MODULE_1__["default"]);
Vue.component(_VTabsItems__WEBPACK_IMPORTED_MODULE_2__["default"].name, _VTabsItems__WEBPACK_IMPORTED_MODULE_2__["default"]);
Vue.component(_VTabItem__WEBPACK_IMPORTED_MODULE_3__["default"].name, _VTabItem__WEBPACK_IMPORTED_MODULE_3__["default"]);
Vue.component(_VTabsSlider__WEBPACK_IMPORTED_MODULE_4__["default"].name, _VTabsSlider__WEBPACK_IMPORTED_MODULE_4__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VTabs__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VTabs/mixins/tabs-computed.js":
/*!******************************************************!*\
!*** ./src/components/VTabs/mixins/tabs-computed.js ***!
\******************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Tabs computed
*
* @mixin
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
computed: {
activeIndex: function activeIndex() {
var _this = this;
return this.tabs.findIndex(function (tab, index) {
var id = tab.action === tab ? index : tab.action;
return id === _this.lazyValue;
});
},
activeTab: function activeTab() {
if (!this.tabs.length) return undefined;
return this.tabs[this.activeIndex];
},
containerStyles: function containerStyles() {
return this.height ? {
height: parseInt(this.height, 10) + "px"
} : null;
},
hasArrows: function hasArrows() {
return (this.showArrows || !this.isMobile) && this.isOverflowing;
},
inputValue: {
get: function get() {
return this.lazyValue;
},
set: function set(val) {
if (this.inputValue === val) return;
this.lazyValue = val;
this.$emit('input', val);
}
},
isMobile: function isMobile() {
return this.$vuetify.breakpoint.width < this.mobileBreakPoint;
},
sliderStyles: function sliderStyles() {
return {
left: this.sliderLeft + "px",
transition: this.sliderLeft != null ? null : 'none',
width: this.sliderWidth + "px"
};
},
target: function target() {
return this.activeTab ? this.activeTab.action : null;
}
}
});
/***/ }),
/***/ "./src/components/VTabs/mixins/tabs-generators.js":
/*!********************************************************!*\
!*** ./src/components/VTabs/mixins/tabs-generators.js ***!
\********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VTabsItems__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VTabsItems */ "./src/components/VTabs/VTabsItems.js");
/* harmony import */ var _VTabsSlider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VTabsSlider */ "./src/components/VTabs/VTabsSlider.js");
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../VIcon */ "./src/components/VIcon/index.ts");
/**
* Tabs generators
*
* @mixin
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
genBar: function genBar(items) {
return this.$createElement('div', {
staticClass: 'v-tabs__bar',
'class': this.addBackgroundColorClassChecks({
'theme--dark': this.dark,
'theme--light': this.light
}),
ref: 'bar'
}, [this.genTransition('prev'), this.genWrapper(this.genContainer(items)), this.genTransition('next')]);
},
genContainer: function genContainer(items) {
return this.$createElement('div', {
staticClass: 'v-tabs__container',
class: {
'v-tabs__container--align-with-title': this.alignWithTitle,
'v-tabs__container--centered': this.centered,
'v-tabs__container--fixed-tabs': this.fixedTabs,
'v-tabs__container--grow': this.grow,
'v-tabs__container--icons-and-text': this.iconsAndText,
'v-tabs__container--overflow': this.isOverflowing,
'v-tabs__container--right': this.right
},
style: this.containerStyles,
ref: 'container'
}, items);
},
genIcon: function genIcon(direction) {
var _this = this;
if (!this.hasArrows || !this[direction + "IconVisible"]) return null;
return this.$createElement(_VIcon__WEBPACK_IMPORTED_MODULE_2__["default"], {
staticClass: "v-tabs__icon v-tabs__icon--" + direction,
props: {
disabled: !this[direction + "IconVisible"]
},
on: {
click: function click() {
return _this.scrollTo(direction);
}
}
}, this[direction + "Icon"]);
},
genItems: function genItems(items, item) {
if (items.length > 0) return items;
if (!item.length) return null;
return this.$createElement(_VTabsItems__WEBPACK_IMPORTED_MODULE_0__["default"], item);
},
genTransition: function genTransition(direction) {
return this.$createElement('transition', {
props: { name: 'fade-transition' }
}, [this.genIcon(direction)]);
},
genWrapper: function genWrapper(items) {
var _this = this;
return this.$createElement('div', {
staticClass: 'v-tabs__wrapper',
class: {
'v-tabs__wrapper--show-arrows': this.hasArrows
},
ref: 'wrapper',
directives: [{
name: 'touch',
value: {
start: function start(e) {
return _this.overflowCheck(e, _this.onTouchStart);
},
move: function move(e) {
return _this.overflowCheck(e, _this.onTouchMove);
},
end: function end(e) {
return _this.overflowCheck(e, _this.onTouchEnd);
}
}
}]
}, [items]);
},
genSlider: function genSlider(items) {
if (!items.length) {
items = [this.$createElement(_VTabsSlider__WEBPACK_IMPORTED_MODULE_1__["default"], {
props: { color: this.sliderColor }
})];
}
return this.$createElement('div', {
staticClass: 'v-tabs__slider-wrapper',
style: this.sliderStyles
}, items);
}
}
});
/***/ }),
/***/ "./src/components/VTabs/mixins/tabs-props.js":
/*!***************************************************!*\
!*** ./src/components/VTabs/mixins/tabs-props.js ***!
\***************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Tabs props
*
* @mixin
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
props: {
alignWithTitle: Boolean,
centered: Boolean,
fixedTabs: Boolean,
grow: Boolean,
height: {
type: [Number, String],
default: undefined,
validator: function validator(v) {
return !isNaN(parseInt(v));
}
},
hideSlider: Boolean,
iconsAndText: Boolean,
mobileBreakPoint: {
type: [Number, String],
default: 1264,
validator: function validator(v) {
return !isNaN(parseInt(v));
}
},
nextIcon: {
type: String,
default: '$vuetify.icons.next'
},
prevIcon: {
type: String,
default: '$vuetify.icons.prev'
},
right: Boolean,
showArrows: Boolean,
sliderColor: {
type: String,
default: 'accent'
},
value: [Number, String]
}
});
/***/ }),
/***/ "./src/components/VTabs/mixins/tabs-touch.js":
/*!***************************************************!*\
!*** ./src/components/VTabs/mixins/tabs-touch.js ***!
\***************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Tabs touch
*
* @mixin
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
newOffset: function newOffset(direction) {
var clientWidth = this.$refs.wrapper.clientWidth;
if (direction === 'prev') {
return Math.max(this.scrollOffset - clientWidth, 0);
} else {
return Math.min(this.scrollOffset + clientWidth, this.$refs.container.clientWidth - clientWidth);
}
},
onTouchStart: function onTouchStart(e) {
this.startX = this.scrollOffset + e.touchstartX;
this.$refs.container.style.transition = 'none';
this.$refs.container.style.willChange = 'transform';
},
onTouchMove: function onTouchMove(e) {
this.scrollOffset = this.startX - e.touchmoveX;
},
onTouchEnd: function onTouchEnd() {
var container = this.$refs.container;
var wrapper = this.$refs.wrapper;
var maxScrollOffset = container.clientWidth - wrapper.clientWidth;
container.style.transition = null;
container.style.willChange = null;
/* istanbul ignore else */
if (this.scrollOffset < 0 || !this.isOverflowing) {
this.scrollOffset = 0;
} else if (this.scrollOffset >= maxScrollOffset) {
this.scrollOffset = maxScrollOffset;
}
}
}
});
/***/ }),
/***/ "./src/components/VTabs/mixins/tabs-watchers.js":
/*!******************************************************!*\
!*** ./src/components/VTabs/mixins/tabs-watchers.js ***!
\******************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/**
* Tabs watchers
*
* @mixin
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
watch: {
activeTab: function activeTab(tab, prev) {
!prev && tab && this.updateTabs();
setTimeout(this.callSlider, 0);
if (!tab) return;
var action = tab.action;
this.tabItems && this.tabItems(action === tab ? this.tabs.indexOf(tab) : action);
},
alignWithTitle: 'callSlider',
centered: 'callSlider',
fixedTabs: 'callSlider',
hasArrows: function hasArrows(val) {
if (!val) this.scrollOffset = 0;
},
isBooted: 'findActiveLink',
lazyValue: 'updateTabs',
right: 'callSlider',
value: function value(val) {
this.lazyValue = val;
},
'$vuetify.application.left': 'onResize',
'$vuetify.application.right': 'onResize',
scrollOffset: function scrollOffset(val) {
this.$refs.container.style.transform = "translateX(" + -val + "px)";
if (this.hasArrows) {
this.prevIconVisible = this.checkPrevIcon();
this.nextIconVisible = this.checkNextIcon();
}
}
}
});
/***/ }),
/***/ "./src/components/VTextField/VTextField.js":
/*!*************************************************!*\
!*** ./src/components/VTextField/VTextField.js ***!
\*************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_text_fields_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_text-fields.styl */ "./src/stylus/components/_text-fields.styl");
/* harmony import */ var _stylus_components_text_fields_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_text_fields_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VInput */ "./src/components/VInput/index.js");
/* harmony import */ var _VCounter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VCounter */ "./src/components/VCounter/index.js");
/* harmony import */ var _VLabel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VLabel */ "./src/components/VLabel/index.js");
/* harmony import */ var _mixins_maskable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/maskable */ "./src/mixins/maskable.js");
/* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../directives/ripple */ "./src/directives/ripple.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Styles
// Extensions
// Components
// Mixins
// Directives
// Utilities
var dirtyTypes = ['color', 'file', 'time', 'date', 'datetime-local', 'week', 'month'];
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-text-field',
directives: { Ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_5__["default"] },
extends: _VInput__WEBPACK_IMPORTED_MODULE_1__["default"],
mixins: [_mixins_maskable__WEBPACK_IMPORTED_MODULE_4__["default"]],
inheritAttrs: false,
props: {
appendOuterIcon: String,
/** @deprecated */
appendOuterIconCb: Function,
autofocus: Boolean,
box: Boolean,
browserAutocomplete: String,
clearable: Boolean,
clearIcon: {
type: String,
default: '$vuetify.icons.clear'
},
clearIconCb: Function,
color: {
type: String,
default: 'primary'
},
counter: [Boolean, Number, String],
flat: Boolean,
fullWidth: Boolean,
label: String,
outline: Boolean,
placeholder: String,
prefix: String,
prependInnerIcon: String,
/** @deprecated */
prependInnerIconCb: Function,
reverse: Boolean,
singleLine: Boolean,
solo: Boolean,
soloInverted: Boolean,
suffix: String,
textarea: Boolean,
type: {
type: String,
default: 'text'
}
},
data: function data() {
return {
badInput: false,
initialValue: null,
internalChange: false,
isClearing: false
};
},
computed: {
classes: function classes() {
return {
'v-text-field': true,
'v-text-field--full-width': this.fullWidth,
'v-text-field--prefix': this.prefix,
'v-text-field--single-line': this.isSingle,
'v-text-field--solo': this.isSolo,
'v-text-field--solo-inverted': this.soloInverted,
'v-text-field--solo-flat': this.flat,
'v-text-field--box': this.box,
'v-text-field--enclosed': this.isEnclosed,
'v-text-field--reverse': this.reverse,
'v-text-field--outline': this.hasOutline
};
},
counterValue: function counterValue() {
return (this.internalValue || '').toString().length;
},
directivesInput: function directivesInput() {
return [];
},
// TODO: Deprecate
hasOutline: function hasOutline() {
return this.outline || this.textarea;
},
internalValue: {
get: function get() {
return this.lazyValue;
},
set: function set(val) {
if (this.mask) {
this.lazyValue = this.unmaskText(this.maskText(this.unmaskText(val)));
this.setSelectionRange();
} else {
this.lazyValue = val;
this.$emit('input', this.lazyValue);
}
}
},
isDirty: function isDirty() {
return this.lazyValue != null && this.lazyValue.toString().length > 0 || this.badInput;
},
isEnclosed: function isEnclosed() {
return this.box || this.isSolo || this.hasOutline || this.fullWidth;
},
isLabelActive: function isLabelActive() {
return this.isDirty || dirtyTypes.includes(this.type);
},
isSingle: function isSingle() {
return this.isSolo || this.singleLine;
},
isSolo: function isSolo() {
return this.solo || this.soloInverted;
},
labelPosition: function labelPosition() {
var offset = this.prefix && !this.labelValue ? 16 : 0;
return !this.$vuetify.rtl !== !this.reverse ? {
left: 'auto',
right: offset
} : {
left: offset,
right: 'auto'
};
},
showLabel: function showLabel() {
return this.hasLabel && (!this.isSingle || !this.isLabelActive && !this.placeholder);
},
labelValue: function labelValue() {
return !this.isSingle && Boolean(this.isFocused || this.isLabelActive || this.placeholder);
}
},
watch: {
isFocused: function isFocused(val) {
// Sets validationState from validatable
this.hasColor = val;
if (val) {
this.initialValue = this.lazyValue;
} else if (this.initialValue !== this.lazyValue) {
this.$emit('change', this.lazyValue);
}
},
value: function value(val) {
var _this = this;
if (this.mask && !this.internalChange) {
var masked_1 = this.maskText(this.unmaskText(val));
this.lazyValue = this.unmaskText(masked_1);
// Emit when the externally set value was modified internally
String(val) !== this.lazyValue && this.$nextTick(function () {
_this.$refs.input.value = masked_1;
_this.$emit('input', _this.lazyValue);
});
} else this.lazyValue = val;
}
},
mounted: function mounted() {
this.autofocus && this.onFocus();
},
methods: {
/** @public */
focus: function focus() {
this.onFocus();
},
/** @public */
blur: function blur() {
this.$refs.input ? this.$refs.input.blur() : this.onBlur();
},
clearableCallback: function clearableCallback() {
var _this = this;
this.internalValue = null;
this.$nextTick(function () {
return _this.$refs.input.focus();
});
},
genAppendSlot: function genAppendSlot() {
var slot = [];
if (this.$slots['append-outer']) {
slot.push(this.$slots['append-outer']);
} else if (this.appendOuterIcon) {
slot.push(this.genIcon('appendOuter'));
}
return this.genSlot('append', 'outer', slot);
},
genPrependInnerSlot: function genPrependInnerSlot() {
var slot = [];
if (this.$slots['prepend-inner']) {
slot.push(this.$slots['prepend-inner']);
} else if (this.prependInnerIcon) {
slot.push(this.genIcon('prependInner'));
}
return this.genSlot('prepend', 'inner', slot);
},
genIconSlot: function genIconSlot() {
var slot = [];
if (this.$slots['append']) {
slot.push(this.$slots['append']);
} else if (this.appendIcon) {
slot.push(this.genIcon('append'));
}
return this.genSlot('append', 'inner', slot);
},
genInputSlot: function genInputSlot() {
var input = _VInput__WEBPACK_IMPORTED_MODULE_1__["default"].methods.genInputSlot.call(this);
var prepend = this.genPrependInnerSlot();
prepend && input.children.unshift(prepend);
return input;
},
genClearIcon: function genClearIcon() {
if (!this.clearable) return null;
var icon = !this.isDirty ? false : 'clear';
if (this.clearIconCb) Object(_util_console__WEBPACK_IMPORTED_MODULE_7__["deprecate"])(':clear-icon-cb', '@click:clear', this);
return this.genSlot('append', 'inner', [this.genIcon(icon, !this.$listeners['click:clear'] && this.clearIconCb || this.clearableCallback, false)]);
},
genCounter: function genCounter() {
if (this.counter === false || this.counter == null) return null;
var max = this.counter === true ? this.$attrs.maxlength : this.counter;
return this.$createElement(_VCounter__WEBPACK_IMPORTED_MODULE_2__["default"], {
props: {
dark: this.dark,
light: this.light,
max: max,
value: this.counterValue
}
});
},
genDefaultSlot: function genDefaultSlot() {
return [this.genTextFieldSlot(), this.genClearIcon(), this.genIconSlot()];
},
genLabel: function genLabel() {
if (!this.showLabel) return null;
var data = {
props: {
absolute: true,
color: this.validationState,
dark: this.dark,
disabled: this.disabled,
focused: !this.isSingle && (this.isFocused || !!this.validationState),
left: this.labelPosition.left,
light: this.light,
right: this.labelPosition.right,
value: this.labelValue
}
};
if (this.$attrs.id) data.props.for = this.$attrs.id;
return this.$createElement(_VLabel__WEBPACK_IMPORTED_MODULE_3__["default"], data, this.$slots.label || this.label);
},
genInput: function genInput() {
var listeners = Object.assign({}, this.$listeners);
delete listeners['change']; // Change should not be bound externally
var data = {
style: {},
domProps: {
value: this.maskText(this.lazyValue)
},
attrs: __assign({ 'aria-label': (!this.$attrs || !this.$attrs.id) && this.label }, this.$attrs, { autofocus: this.autofocus, disabled: this.disabled, readonly: this.readonly, type: this.type }),
on: Object.assign(listeners, {
blur: this.onBlur,
input: this.onInput,
focus: this.onFocus,
keydown: this.onKeyDown
}),
ref: 'input'
};
if (this.placeholder) data.attrs.placeholder = this.placeholder;
if (this.mask) data.attrs.maxlength = this.masked.length;
if (this.browserAutocomplete) data.attrs.autocomplete = this.browserAutocomplete;
return this.$createElement('input', data);
},
genMessages: function genMessages() {
if (this.hideDetails) return null;
return this.$createElement('div', {
staticClass: 'v-text-field__details'
}, [_VInput__WEBPACK_IMPORTED_MODULE_1__["default"].methods.genMessages.call(this), this.genCounter()]);
},
genTextFieldSlot: function genTextFieldSlot() {
return this.$createElement('div', {
staticClass: 'v-text-field__slot'
}, [this.genLabel(), this.prefix ? this.genAffix('prefix') : null, this.genInput(), this.suffix ? this.genAffix('suffix') : null]);
},
genAffix: function genAffix(type) {
return this.$createElement('div', {
'class': "v-text-field__" + type,
ref: type
}, this[type]);
},
onBlur: function onBlur(e) {
this.isFocused = false;
// Reset internalChange state
// to allow external change
// to persist
this.internalChange = false;
this.$emit('blur', e);
},
onClick: function onClick() {
if (this.isFocused || this.disabled) return;
this.$refs.input.focus();
},
onFocus: function onFocus(e) {
if (!this.$refs.input) return;
if (document.activeElement !== this.$refs.input) {
return this.$refs.input.focus();
}
if (!this.isFocused) {
this.isFocused = true;
this.$emit('focus', e);
}
},
onInput: function onInput(e) {
this.internalChange = true;
this.mask && this.resetSelections(e.target);
this.internalValue = e.target.value;
this.badInput = e.target.validity && e.target.validity.badInput;
},
onKeyDown: function onKeyDown(e) {
this.internalChange = true;
if (e.keyCode === _util_helpers__WEBPACK_IMPORTED_MODULE_6__["keyCodes"].enter) this.$emit('change', this.internalValue);
this.$emit('keydown', e);
},
onMouseDown: function onMouseDown(e) {
// Prevent input from being blurred
if (e.target !== this.$refs.input) {
e.preventDefault();
e.stopPropagation();
}
_VInput__WEBPACK_IMPORTED_MODULE_1__["default"].methods.onMouseDown.call(this, e);
},
onMouseUp: function onMouseUp(e) {
this.focus();
_VInput__WEBPACK_IMPORTED_MODULE_1__["default"].methods.onMouseUp.call(this, e);
}
}
});
/***/ }),
/***/ "./src/components/VTextField/index.js":
/*!********************************************!*\
!*** ./src/components/VTextField/index.js ***!
\********************************************/
/*! exports provided: VTextField, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VTextField", function() { return wrapper; });
/* harmony import */ var _VTextField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTextField */ "./src/components/VTextField/VTextField.js");
/* harmony import */ var _VTextarea_VTextarea__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VTextarea/VTextarea */ "./src/components/VTextarea/VTextarea.js");
/* harmony import */ var _util_rebuildFunctionalSlots__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/rebuildFunctionalSlots */ "./src/util/rebuildFunctionalSlots.js");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
// TODO: remove this in v2.0
/* @vue/component */
var wrapper = {
functional: true,
$_wrapperFor: _VTextField__WEBPACK_IMPORTED_MODULE_0__["default"],
props: {
textarea: Boolean,
multiLine: Boolean
},
render: function render(h, _a) {
var props = _a.props,
data = _a.data,
slots = _a.slots,
parent = _a.parent;
delete data.model;
var children = Object(_util_rebuildFunctionalSlots__WEBPACK_IMPORTED_MODULE_2__["default"])(slots(), h);
if (props.textarea) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_3__["deprecate"])('<v-text-field textarea>', '<v-textarea outline>', wrapper, parent);
}
if (props.multiLine) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_3__["deprecate"])('<v-text-field multi-line>', '<v-textarea>', wrapper, parent);
}
if (props.textarea || props.multiLine) {
data.attrs.outline = props.textarea;
return h(_VTextarea_VTextarea__WEBPACK_IMPORTED_MODULE_1__["default"], data, children);
} else {
return h(_VTextField__WEBPACK_IMPORTED_MODULE_0__["default"], data, children);
}
}
};
/* istanbul ignore next */
wrapper.install = function install(Vue) {
Vue.component(_VTextField__WEBPACK_IMPORTED_MODULE_0__["default"].name, wrapper);
};
/* harmony default export */ __webpack_exports__["default"] = (wrapper);
/***/ }),
/***/ "./src/components/VTextarea/VTextarea.js":
/*!***********************************************!*\
!*** ./src/components/VTextarea/VTextarea.js ***!
\***********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_textarea_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_textarea.styl */ "./src/stylus/components/_textarea.styl");
/* harmony import */ var _stylus_components_textarea_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_textarea_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VTextField/VTextField */ "./src/components/VTextField/VTextField.js");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Styles
// Extensions
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-textarea',
extends: _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__["default"],
props: {
autoGrow: Boolean,
noResize: Boolean,
outline: Boolean,
rowHeight: {
type: [Number, String],
default: 24,
validator: function validator(v) {
return !isNaN(parseFloat(v));
}
},
rows: {
type: [Number, String],
default: 5,
validator: function validator(v) {
return !isNaN(parseInt(v, 10));
}
}
},
computed: {
classes: function classes() {
return __assign({ 'v-textarea': true, 'v-textarea--auto-grow': this.autoGrow, 'v-textarea--no-resize': this.noResizeHandle }, _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].computed.classes.call(this, null));
},
dynamicHeight: function dynamicHeight() {
return this.autoGrow ? this.inputHeight : 'auto';
},
isEnclosed: function isEnclosed() {
return this.textarea || _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].computed.isEnclosed.call(this);
},
noResizeHandle: function noResizeHandle() {
return this.noResize || this.autoGrow;
}
},
watch: {
lazyValue: function lazyValue() {
!this.internalChange && this.autoGrow && this.$nextTick(this.calculateInputHeight);
}
},
mounted: function mounted() {
var _this = this;
setTimeout(function () {
_this.autoGrow && _this.calculateInputHeight();
}, 0);
// TODO: remove (2.0)
if (this.autoGrow && this.noResize) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["consoleInfo"])('"no-resize" is now implied when using "auto-grow", and can be removed', this);
}
},
methods: {
calculateInputHeight: function calculateInputHeight() {
var input = this.$refs.input;
if (input) {
input.style.height = 0;
var height = input.scrollHeight;
var minHeight = parseInt(this.rows, 10) * parseFloat(this.rowHeight);
// This has to be done ASAP, waiting for Vue
// to update the DOM causes ugly layout jumping
input.style.height = Math.max(minHeight, height) + 'px';
}
},
genInput: function genInput() {
var input = _VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].methods.genInput.call(this);
input.tag = 'textarea';
delete input.data.attrs.type;
input.data.attrs.rows = this.rows;
return input;
},
onInput: function onInput(e) {
_VTextField_VTextField__WEBPACK_IMPORTED_MODULE_1__["default"].methods.onInput.call(this, e);
this.autoGrow && this.calculateInputHeight();
},
onKeyDown: function onKeyDown(e) {
// Prevents closing of a
// dialog when pressing
// enter
if (this.isFocused && e.keyCode === 13) {
e.stopPropagation();
}
this.internalChange = true;
this.$emit('keydown', e);
}
}
});
/***/ }),
/***/ "./src/components/VTextarea/index.js":
/*!*******************************************!*\
!*** ./src/components/VTextarea/index.js ***!
\*******************************************/
/*! exports provided: VTextarea, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VTextarea__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTextarea */ "./src/components/VTextarea/VTextarea.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTextarea", function() { return _VTextarea__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VTextarea__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VTextarea__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VTextarea__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VTextarea__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VTimePicker/VTimePicker.js":
/*!***************************************************!*\
!*** ./src/components/VTimePicker/VTimePicker.js ***!
\***************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VTimePickerTitle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTimePickerTitle */ "./src/components/VTimePicker/VTimePickerTitle.js");
/* harmony import */ var _VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VTimePickerClock */ "./src/components/VTimePicker/VTimePickerClock.js");
/* harmony import */ var _mixins_picker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/picker */ "./src/mixins/picker.js");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _VDatePicker_util_pad__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../VDatePicker/util/pad */ "./src/components/VDatePicker/util/pad.js");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
// Components
// Mixins
// Utils
var rangeHours24 = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["createRange"])(24);
var rangeHours12am = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["createRange"])(12);
var rangeHours12pm = rangeHours12am.map(function (v) {
return v + 12;
});
var rangeMinutes = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_3__["createRange"])(60);
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-time-picker',
mixins: [_mixins_picker__WEBPACK_IMPORTED_MODULE_2__["default"]],
props: {
allowedHours: Function,
allowedMinutes: Function,
format: {
type: String,
default: 'ampm',
validator: function validator(val) {
return ['ampm', '24hr'].includes(val);
}
},
min: String,
max: String,
scrollable: Boolean,
value: null
},
data: function data() {
return {
inputHour: null,
inputMinute: null,
period: 'am',
selectingHour: true
};
},
computed: {
isAllowedHourCb: function isAllowedHourCb() {
var _this = this;
if (!this.min && !this.max) return this.allowedHours;
var minHour = this.min ? this.min.split(':')[0] : 0;
var maxHour = this.max ? this.max.split(':')[0] : 23;
return function (val) {
return val >= minHour * 1 && val <= maxHour * 1 && (!_this.allowedHours || _this.allowedHours(val));
};
},
isAllowedMinuteCb: function isAllowedMinuteCb() {
var _this = this;
var isHourAllowed = !this.allowedHours || this.allowedHours(this.inputHour);
if (!this.min && !this.max) {
return isHourAllowed ? this.allowedMinutes : function () {
return false;
};
}
var _a = __read(this.min ? this.min.split(':') : [0, 0], 2),
minHour = _a[0],
minMinute = _a[1];
var _b = __read(this.max ? this.max.split(':') : [23, 59], 2),
maxHour = _b[0],
maxMinute = _b[1];
var minTime = minHour * 60 + minMinute * 1;
var maxTime = maxHour * 60 + maxMinute * 1;
return function (val) {
var time = 60 * _this.inputHour + val;
return time >= minTime && time <= maxTime && isHourAllowed && (!_this.allowedMinutes || _this.allowedMinutes(val));
};
},
isAmPm: function isAmPm() {
return this.format === 'ampm';
}
},
watch: {
value: 'setInputData'
},
mounted: function mounted() {
this.setInputData(this.value);
},
methods: {
emitValue: function emitValue() {
if (this.inputHour != null && this.inputMinute != null) {
this.$emit('input', Object(_VDatePicker_util_pad__WEBPACK_IMPORTED_MODULE_4__["default"])(this.inputHour) + ":" + Object(_VDatePicker_util_pad__WEBPACK_IMPORTED_MODULE_4__["default"])(this.inputMinute));
}
},
setPeriod: function setPeriod(period) {
this.period = period;
if (this.inputHour != null) {
var newHour = this.inputHour + (period === 'am' ? -12 : 12);
this.inputHour = this.firstAllowed('hour', newHour);
this.emitValue();
}
},
setInputData: function setInputData(value) {
if (value == null) {
this.inputHour = null;
this.inputMinute = null;
return;
}
if (value instanceof Date) {
this.inputHour = value.getHours();
this.inputMinute = value.getMinutes();
} else {
var _a = __read(value.trim().toLowerCase().match(/^(\d+):(\d+)(:\d+)?([ap]m)?$/, '') || [], 5),
hour = _a[1],
minute = _a[2],
period = _a[4];
this.inputHour = period ? this.convert12to24(parseInt(hour, 10), period) : parseInt(hour, 10);
this.inputMinute = parseInt(minute, 10);
}
this.period = this.inputHour < 12 ? 'am' : 'pm';
},
convert24to12: function convert24to12(hour) {
return hour ? (hour - 1) % 12 + 1 : 12;
},
convert12to24: function convert12to24(hour, period) {
return hour % 12 + (period === 'pm' ? 12 : 0);
},
onInput: function onInput(value) {
if (this.selectingHour) {
this.inputHour = this.isAmPm ? this.convert12to24(value, this.period) : value;
} else {
this.inputMinute = value;
}
this.emitValue();
},
onChange: function onChange() {
if (!this.selectingHour) {
this.$emit('change', this.value);
} else {
this.selectingHour = false;
}
},
firstAllowed: function firstAllowed(type, value) {
var allowedFn = type === 'hour' ? this.isAllowedHourCb : this.isAllowedMinuteCb;
if (!allowedFn) return value;
// TODO: clean up
var range = type === 'minute' ? rangeMinutes : this.isAmPm ? value < 12 ? rangeHours12am : rangeHours12pm : rangeHours24;
var first = range.find(function (v) {
return allowedFn((v + value) % range.length + range[0]);
});
return ((first || 0) + value) % range.length + range[0];
},
genClock: function genClock() {
return this.$createElement(_VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__["default"], {
props: {
allowedValues: this.selectingHour ? this.isAllowedHourCb : this.isAllowedMinuteCb,
color: this.color,
dark: this.dark,
double: this.selectingHour && !this.isAmPm,
format: this.selectingHour ? this.isAmPm ? this.convert24to12 : function (val) {
return val;
} : function (val) {
return Object(_VDatePicker_util_pad__WEBPACK_IMPORTED_MODULE_4__["default"])(val, 2);
},
light: this.light,
max: this.selectingHour ? this.isAmPm && this.period === 'am' ? 11 : 23 : 59,
min: this.selectingHour && this.isAmPm && this.period === 'pm' ? 12 : 0,
scrollable: this.scrollable,
size: this.width - (!this.fullWidth && this.landscape ? 80 : 20),
step: this.selectingHour ? 1 : 5,
value: this.selectingHour ? this.inputHour : this.inputMinute
},
on: {
input: this.onInput,
change: this.onChange
},
ref: 'clock'
});
},
genPickerBody: function genPickerBody() {
return this.$createElement('div', {
staticClass: 'v-time-picker-clock__container',
style: {
width: this.width + "px",
height: this.width - (!this.fullWidth && this.landscape ? 60 : 0) + "px"
},
key: this.selectingHour
}, [this.genClock()]);
},
genPickerTitle: function genPickerTitle() {
var _this = this;
return this.$createElement(_VTimePickerTitle__WEBPACK_IMPORTED_MODULE_0__["default"], {
props: {
ampm: this.isAmPm,
hour: this.inputHour,
minute: this.inputMinute,
period: this.period,
selectingHour: this.selectingHour
},
on: {
'update:selectingHour': function updateSelectingHour(value) {
return _this.selectingHour = value;
},
'update:period': this.setPeriod
},
ref: 'title',
slot: 'title'
});
}
},
render: function render() {
return this.genPicker('v-picker--time');
}
});
/***/ }),
/***/ "./src/components/VTimePicker/VTimePickerClock.js":
/*!********************************************************!*\
!*** ./src/components/VTimePicker/VTimePickerClock.js ***!
\********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_time_picker_clock_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_time-picker-clock.styl */ "./src/stylus/components/_time-picker-clock.styl");
/* harmony import */ var _stylus_components_time_picker_clock_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_time_picker_clock_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-time-picker-clock',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__["default"]],
props: {
allowedValues: Function,
double: Boolean,
format: {
type: Function,
default: function _default(val) {
return val;
}
},
max: {
type: Number,
required: true
},
min: {
type: Number,
required: true
},
scrollable: Boolean,
rotate: {
type: Number,
default: 0
},
size: {
type: [Number, String],
default: 270
},
step: {
type: Number,
default: 1
},
value: Number
},
data: function data() {
return {
defaultColor: 'accent',
inputValue: this.value,
isDragging: false,
valueOnMouseDown: null,
valueOnMouseUp: null
};
},
computed: {
count: function count() {
return this.max - this.min + 1;
},
innerRadius: function innerRadius() {
return this.radius - Math.max(this.radius * 0.4, 48);
},
outerRadius: function outerRadius() {
return this.radius - 4;
},
roundCount: function roundCount() {
return this.double ? this.count / 2 : this.count;
},
degreesPerUnit: function degreesPerUnit() {
return 360 / this.roundCount;
},
degrees: function degrees() {
return this.degreesPerUnit * Math.PI / 180;
},
radius: function radius() {
return this.size / 2;
},
displayedValue: function displayedValue() {
return this.value == null ? this.min : this.value;
}
},
watch: {
value: function value(_value) {
this.inputValue = _value;
}
},
methods: {
wheel: function wheel(e) {
e.preventDefault();
var delta = Math.sign(e.wheelDelta || 1);
var value = this.displayedValue;
do {
value = value + delta;
value = (value - this.min + this.count) % this.count + this.min;
} while (!this.isAllowed(value) && value !== this.displayedValue);
if (value !== this.displayedValue) {
this.update(value);
}
},
handScale: function handScale(value) {
return this.double && value - this.min >= this.roundCount ? this.innerRadius / this.radius : this.outerRadius / this.radius;
},
isAllowed: function isAllowed(value) {
return !this.allowedValues || this.allowedValues(value);
},
genValues: function genValues() {
var children = [];
for (var value = this.min; value <= this.max; value = value + this.step) {
var classes = {
active: value === this.displayedValue,
disabled: !this.isAllowed(value)
};
children.push(this.$createElement('span', {
'class': this.addBackgroundColorClassChecks(classes, value === this.value ? this.computedColor : null),
style: this.getTransform(value),
domProps: { innerHTML: "<span>" + this.format(value) + "</span>" }
}));
}
return children;
},
genHand: function genHand() {
var scale = "scaleY(" + this.handScale(this.displayedValue) + ")";
var angle = this.rotate + this.degreesPerUnit * (this.displayedValue - this.min);
return this.$createElement('div', {
staticClass: 'v-time-picker-clock__hand',
'class': this.value == null ? {} : this.addBackgroundColorClassChecks(),
style: {
transform: "rotate(" + angle + "deg) " + scale
}
});
},
getTransform: function getTransform(i) {
var _a = this.getPosition(i),
x = _a.x,
y = _a.y;
return { transform: "translate(" + x + "px, " + y + "px)" };
},
getPosition: function getPosition(value) {
var radius = (this.radius - 24) * this.handScale(value);
var rotateRadians = this.rotate * Math.PI / 180;
return {
x: Math.round(Math.sin((value - this.min) * this.degrees + rotateRadians) * radius),
y: Math.round(-Math.cos((value - this.min) * this.degrees + rotateRadians) * radius)
};
},
onMouseDown: function onMouseDown(e) {
e.preventDefault();
this.valueOnMouseDown = null;
this.valueOnMouseUp = null;
this.isDragging = true;
this.onDragMove(e);
},
onMouseUp: function onMouseUp() {
this.isDragging = false;
if (this.valueOnMouseUp !== null && this.isAllowed(this.valueOnMouseUp)) {
this.$emit('change', this.valueOnMouseUp);
}
},
onDragMove: function onDragMove(e) {
e.preventDefault();
if (!this.isDragging && e.type !== 'click') return;
var _a = this.$refs.clock.getBoundingClientRect(),
width = _a.width,
top = _a.top,
left = _a.left;
var _b = 'touches' in e ? e.touches[0] : e,
clientX = _b.clientX,
clientY = _b.clientY;
var center = { x: width / 2, y: -width / 2 };
var coords = { x: clientX - left, y: top - clientY };
var handAngle = Math.round(this.angle(center, coords) - this.rotate + 360) % 360;
var insideClick = this.double && this.euclidean(center, coords) < (this.outerRadius + this.innerRadius) / 2 - 16;
var value = Math.round(handAngle / this.degreesPerUnit) + this.min + (insideClick ? this.roundCount : 0);
// Necessary to fix edge case when selecting left part of max value
var newValue;
if (handAngle >= 360 - this.degreesPerUnit / 2) {
newValue = insideClick ? this.max : this.min;
} else {
newValue = value;
}
if (this.isAllowed(value)) {
if (this.valueOnMouseDown === null) {
this.valueOnMouseDown = newValue;
}
this.valueOnMouseUp = newValue;
this.update(newValue);
}
},
update: function update(value) {
if (this.inputValue !== value) {
this.inputValue = value;
this.$emit('input', value);
}
},
euclidean: function euclidean(p0, p1) {
var dx = p1.x - p0.x;
var dy = p1.y - p0.y;
return Math.sqrt(dx * dx + dy * dy);
},
angle: function angle(center, p1) {
var value = 2 * Math.atan2(p1.y - center.y - this.euclidean(center, p1), p1.x - center.x);
return Math.abs(value * 180 / Math.PI);
}
},
render: function render() {
var _this = this;
var data = {
staticClass: 'v-time-picker-clock',
class: __assign({ 'v-time-picker-clock--indeterminate': this.value == null }, this.themeClasses),
on: {
mousedown: this.onMouseDown,
mouseup: this.onMouseUp,
mouseleave: function mouseleave() {
return _this.isDragging && _this.onMouseUp();
},
touchstart: this.onMouseDown,
touchend: this.onMouseUp,
mousemove: this.onDragMove,
touchmove: this.onDragMove
},
style: {
height: this.size + "px",
width: this.size + "px"
},
ref: 'clock'
};
this.scrollable && (data.on.wheel = this.wheel);
return this.$createElement('div', data, [this.genHand(), this.genValues()]);
}
});
/***/ }),
/***/ "./src/components/VTimePicker/VTimePickerTitle.js":
/*!********************************************************!*\
!*** ./src/components/VTimePicker/VTimePickerTitle.js ***!
\********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_time_picker_title_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_time-picker-title.styl */ "./src/stylus/components/_time-picker-title.styl");
/* harmony import */ var _stylus_components_time_picker_title_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_time_picker_title_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_picker_button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/picker-button */ "./src/mixins/picker-button.js");
/* harmony import */ var _VDatePicker_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../VDatePicker/util */ "./src/components/VDatePicker/util/index.js");
// Mixins
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-time-picker-title',
mixins: [_mixins_picker_button__WEBPACK_IMPORTED_MODULE_1__["default"]],
props: {
ampm: Boolean,
hour: Number,
minute: Number,
period: {
type: String,
validator: function validator(period) {
return period === 'am' || period === 'pm';
}
},
selectingHour: Boolean
},
methods: {
genTime: function genTime() {
var hour = this.hour;
if (this.ampm) {
hour = hour ? (hour - 1) % 12 + 1 : 12;
}
var displayedHour = this.hour == null ? '--' : this.ampm ? hour : Object(_VDatePicker_util__WEBPACK_IMPORTED_MODULE_2__["pad"])(hour);
var displayedMinute = this.minute == null ? '--' : Object(_VDatePicker_util__WEBPACK_IMPORTED_MODULE_2__["pad"])(this.minute);
return this.$createElement('div', {
'class': 'v-time-picker-title__time'
}, [this.genPickerButton('selectingHour', true, displayedHour), this.$createElement('span', ':'), this.genPickerButton('selectingHour', false, displayedMinute)]);
},
genAmPm: function genAmPm() {
return this.$createElement('div', {
staticClass: 'v-time-picker-title__ampm'
}, [this.genPickerButton('period', 'am', 'am'), this.genPickerButton('period', 'pm', 'pm')]);
}
},
render: function render(h) {
return h('div', {
staticClass: 'v-time-picker-title'
}, [this.genTime(), this.ampm ? this.genAmPm() : null]);
}
});
/***/ }),
/***/ "./src/components/VTimePicker/index.js":
/*!*********************************************!*\
!*** ./src/components/VTimePicker/index.js ***!
\*********************************************/
/*! exports provided: VTimePicker, VTimePickerClock, VTimePickerTitle, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VTimePicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTimePicker */ "./src/components/VTimePicker/VTimePicker.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimePicker", function() { return _VTimePicker__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VTimePickerClock */ "./src/components/VTimePicker/VTimePickerClock.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimePickerClock", function() { return _VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _VTimePickerTitle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VTimePickerTitle */ "./src/components/VTimePicker/VTimePickerTitle.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimePickerTitle", function() { return _VTimePickerTitle__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* istanbul ignore next */
_VTimePicker__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VTimePicker__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VTimePicker__WEBPACK_IMPORTED_MODULE_0__["default"]);
Vue.component(_VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VTimePickerClock__WEBPACK_IMPORTED_MODULE_1__["default"]);
Vue.component(_VTimePickerTitle__WEBPACK_IMPORTED_MODULE_2__["default"].name, _VTimePickerTitle__WEBPACK_IMPORTED_MODULE_2__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VTimePicker__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/VToolbar/VToolbar.js":
/*!*********************************************!*\
!*** ./src/components/VToolbar/VToolbar.js ***!
\*********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_toolbar_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_toolbar.styl */ "./src/stylus/components/_toolbar.styl");
/* harmony import */ var _stylus_components_toolbar_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_toolbar_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/applicationable */ "./src/mixins/applicationable.ts");
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/ssr-bootable */ "./src/mixins/ssr-bootable.ts");
/* harmony import */ var _directives_scroll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../directives/scroll */ "./src/directives/scroll.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
// Styles
// Mixins
// Directives
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-toolbar',
directives: { Scroll: _directives_scroll__WEBPACK_IMPORTED_MODULE_5__["default"] },
mixins: [Object(_mixins_applicationable__WEBPACK_IMPORTED_MODULE_1__["default"])('top', ['clippedLeft', 'clippedRight', 'computedHeight', 'invertedScroll', 'manualScroll']), _mixins_colorable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_ssr_bootable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_3__["default"]],
props: {
card: Boolean,
clippedLeft: Boolean,
clippedRight: Boolean,
dense: Boolean,
extended: Boolean,
extensionHeight: {
type: [Number, String],
validator: function validator(v) {
return !isNaN(parseInt(v));
}
},
flat: Boolean,
floating: Boolean,
height: {
type: [Number, String],
validator: function validator(v) {
return !isNaN(parseInt(v));
}
},
invertedScroll: Boolean,
manualScroll: Boolean,
prominent: Boolean,
scrollOffScreen: Boolean,
/* @deprecated */
scrollToolbarOffScreen: Boolean,
scrollTarget: String,
scrollThreshold: {
type: Number,
default: 300
},
tabs: Boolean
},
data: function data() {
return {
activeTimeout: null,
currentScroll: 0,
heights: {
mobileLandscape: 48,
mobile: 56,
desktop: 64,
dense: 48
},
isActive: true,
isExtended: false,
isScrollingUp: false,
previousScroll: null,
previousScrollDirection: null,
savedScroll: 0,
target: null
};
},
computed: {
canScroll: function canScroll() {
// TODO: remove
if (this.scrollToolbarOffScreen) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_6__["deprecate"])('scrollToolbarOffScreen', 'scrollOffScreen', this);
return true;
}
return this.scrollOffScreen || this.invertedScroll;
},
computedContentHeight: function computedContentHeight() {
if (this.height) return parseInt(this.height);
if (this.dense) return this.heights.dense;
if (this.prominent || this.$vuetify.breakpoint.mdAndUp) return this.heights.desktop;
if (this.$vuetify.breakpoint.smAndDown && this.$vuetify.breakpoint.width > this.$vuetify.breakpoint.height) return this.heights.mobileLandscape;
return this.heights.mobile;
},
computedExtensionHeight: function computedExtensionHeight() {
if (this.tabs) return 48;
if (this.extensionHeight) return parseInt(this.extensionHeight);
return this.computedContentHeight;
},
computedHeight: function computedHeight() {
if (!this.isExtended) return this.computedContentHeight;
return this.computedContentHeight + this.computedExtensionHeight;
},
computedMarginTop: function computedMarginTop() {
if (!this.app) return 0;
return this.$vuetify.application.bar;
},
classes: function classes() {
return this.addBackgroundColorClassChecks({
'v-toolbar': true,
'elevation-0': this.flat || !this.isActive && !this.tabs && this.canScroll,
'v-toolbar--absolute': this.absolute,
'v-toolbar--card': this.card,
'v-toolbar--clipped': this.clippedLeft || this.clippedRight,
'v-toolbar--dense': this.dense,
'v-toolbar--extended': this.isExtended,
'v-toolbar--fixed': !this.absolute && (this.app || this.fixed),
'v-toolbar--floating': this.floating,
'v-toolbar--prominent': this.prominent,
'theme--dark': this.dark,
'theme--light': this.light
});
},
computedPaddingLeft: function computedPaddingLeft() {
if (!this.app || this.clippedLeft) return 0;
return this.$vuetify.application.left;
},
computedPaddingRight: function computedPaddingRight() {
if (!this.app || this.clippedRight) return 0;
return this.$vuetify.application.right;
},
computedTransform: function computedTransform() {
return !this.isActive ? this.canScroll ? -this.computedContentHeight : -this.computedHeight : 0;
},
currentThreshold: function currentThreshold() {
return Math.abs(this.currentScroll - this.savedScroll);
},
styles: function styles() {
return {
marginTop: this.computedMarginTop + "px",
paddingRight: this.computedPaddingRight + "px",
paddingLeft: this.computedPaddingLeft + "px",
transform: "translateY(" + this.computedTransform + "px)"
};
}
},
watch: {
currentThreshold: function currentThreshold(val) {
if (this.invertedScroll) {
return this.isActive = this.currentScroll > this.scrollThreshold;
}
if (val < this.scrollThreshold || !this.isBooted) return;
this.isActive = this.isScrollingUp;
this.savedScroll = this.currentScroll;
},
isActive: function isActive() {
this.savedScroll = 0;
},
invertedScroll: function invertedScroll(val) {
this.isActive = !val;
},
manualScroll: function manualScroll(val) {
this.isActive = !val;
},
isScrollingUp: function isScrollingUp() {
this.savedScroll = this.savedScroll || this.currentScroll;
}
},
created: function created() {
if (this.invertedScroll || this.manualScroll) this.isActive = false;
},
mounted: function mounted() {
if (this.scrollTarget) {
this.target = document.querySelector(this.scrollTarget);
}
},
methods: {
onScroll: function onScroll() {
if (!this.canScroll || this.manualScroll || typeof window === 'undefined') return;
var target = this.target || window;
this.currentScroll = this.scrollTarget ? target.scrollTop : target.pageYOffset || document.documentElement.scrollTop;
this.isScrollingUp = this.currentScroll < this.previousScroll;
this.previousScroll = this.currentScroll;
},
/**
* Update the application layout
*
* @return {number}
*/
updateApplication: function updateApplication() {
return this.invertedScroll || this.manualScroll ? 0 : this.computedHeight;
}
},
render: function render(h) {
this.isExtended = this.extended || !!this.$slots.extension;
var children = [];
var data = {
'class': this.classes,
style: this.styles,
on: this.$listeners
};
data.directives = [{
arg: this.scrollTarget,
name: 'scroll',
value: this.onScroll
}];
children.push(h('div', {
staticClass: 'v-toolbar__content',
style: { height: this.computedContentHeight + "px" },
ref: 'content'
}, this.$slots.default));
if (this.isExtended) {
children.push(h('div', {
staticClass: 'v-toolbar__extension',
style: { height: this.computedExtensionHeight + "px" }
}, this.$slots.extension));
}
return h('nav', data, children);
}
});
/***/ }),
/***/ "./src/components/VToolbar/VToolbarSideIcon.js":
/*!*****************************************************!*\
!*** ./src/components/VToolbar/VToolbarSideIcon.js ***!
\*****************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _components_VBtn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../components/VBtn */ "./src/components/VBtn/index.ts");
/* harmony import */ var _components_VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../components/VIcon */ "./src/components/VIcon/index.ts");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-toolbar-side-icon',
functional: true,
render: function render(h, _a) {
var slots = _a.slots,
listeners = _a.listeners,
props = _a.props,
data = _a.data;
var classes = data.staticClass ? data.staticClass + " v-toolbar__side-icon" : 'v-toolbar__side-icon';
var d = Object.assign(data, {
staticClass: classes,
props: Object.assign(props, {
icon: true
}),
on: listeners
});
var defaultSlot = slots().default;
return h(_components_VBtn__WEBPACK_IMPORTED_MODULE_0__["default"], d, defaultSlot || [h(_components_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], '$vuetify.icons.menu')]);
}
});
/***/ }),
/***/ "./src/components/VToolbar/index.js":
/*!******************************************!*\
!*** ./src/components/VToolbar/index.js ***!
\******************************************/
/*! exports provided: VToolbar, VToolbarSideIcon, VToolbarTitle, VToolbarItems, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VToolbarTitle", function() { return VToolbarTitle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VToolbarItems", function() { return VToolbarItems; });
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _VToolbar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VToolbar */ "./src/components/VToolbar/VToolbar.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VToolbar", function() { return _VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _VToolbarSideIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VToolbarSideIcon */ "./src/components/VToolbar/VToolbarSideIcon.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VToolbarSideIcon", function() { return _VToolbarSideIcon__WEBPACK_IMPORTED_MODULE_2__["default"]; });
var VToolbarTitle = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-toolbar__title');
var VToolbarItems = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleFunctional"])('v-toolbar__items');
/* istanbul ignore next */
_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"].install = function install(Vue) {
Vue.component(_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"].name, _VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"]);
Vue.component(VToolbarItems.name, VToolbarItems);
Vue.component(VToolbarTitle.name, VToolbarTitle);
Vue.component(_VToolbarSideIcon__WEBPACK_IMPORTED_MODULE_2__["default"].name, _VToolbarSideIcon__WEBPACK_IMPORTED_MODULE_2__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VToolbar__WEBPACK_IMPORTED_MODULE_1__["default"]);
/***/ }),
/***/ "./src/components/VTooltip/VTooltip.js":
/*!*********************************************!*\
!*** ./src/components/VTooltip/VTooltip.js ***!
\*********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_tooltips_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stylus/components/_tooltips.styl */ "./src/stylus/components/_tooltips.styl");
/* harmony import */ var _stylus_components_tooltips_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_tooltips_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _mixins_delayable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/delayable */ "./src/mixins/delayable.ts");
/* harmony import */ var _mixins_dependent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mixins/dependent */ "./src/mixins/dependent.js");
/* harmony import */ var _mixins_detachable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mixins/detachable */ "./src/mixins/detachable.js");
/* harmony import */ var _mixins_menuable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mixins/menuable */ "./src/mixins/menuable.js");
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../mixins/toggleable */ "./src/mixins/toggleable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
// Mixins
// Helpers
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'v-tooltip',
mixins: [_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _mixins_delayable__WEBPACK_IMPORTED_MODULE_2__["default"], _mixins_dependent__WEBPACK_IMPORTED_MODULE_3__["default"], _mixins_detachable__WEBPACK_IMPORTED_MODULE_4__["default"], _mixins_menuable__WEBPACK_IMPORTED_MODULE_5__["default"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_6__["default"]],
props: {
debounce: {
type: [Number, String],
default: 0
},
disabled: Boolean,
fixed: {
type: Boolean,
default: true
},
openDelay: {
type: [Number, String],
default: 200
},
tag: {
type: String,
default: 'span'
},
transition: String,
zIndex: {
default: null
}
},
data: function data() {
return {
calculatedMinWidth: 0,
closeDependents: false
};
},
computed: {
calculatedLeft: function calculatedLeft() {
var _a = this.dimensions,
activator = _a.activator,
content = _a.content;
var unknown = !this.bottom && !this.left && !this.top && !this.right;
var left = 0;
if (this.top || this.bottom || unknown) {
left = activator.left + activator.width / 2 - content.width / 2;
} else if (this.left || this.right) {
left = activator.left + (this.right ? activator.width : -content.width) + (this.right ? 10 : -10);
}
return this.calcXOverflow(left) + "px";
},
calculatedTop: function calculatedTop() {
var _a = this.dimensions,
activator = _a.activator,
content = _a.content;
var top = 0;
if (this.top || this.bottom) {
top = activator.top + (this.bottom ? activator.height : -content.height) + (this.bottom ? 10 : -10);
} else if (this.left || this.right) {
top = activator.top + activator.height / 2 - content.height / 2;
}
return this.calcYOverflow(top + this.pageYOffset) + "px";
},
classes: function classes() {
return {
'v-tooltip--top': this.top,
'v-tooltip--right': this.right,
'v-tooltip--bottom': this.bottom,
'v-tooltip--left': this.left
};
},
computedTransition: function computedTransition() {
if (this.transition) return this.transition;
if (this.top) return 'slide-y-reverse-transition';
if (this.right) return 'slide-x-transition';
if (this.bottom) return 'slide-y-transition';
if (this.left) return 'slide-x-reverse-transition';
},
offsetY: function offsetY() {
return this.top || this.bottom;
},
offsetX: function offsetX() {
return this.left || this.right;
},
styles: function styles() {
return {
left: this.calculatedLeft,
maxWidth: Object(_util_helpers__WEBPACK_IMPORTED_MODULE_7__["convertToUnit"])(this.maxWidth),
opacity: this.isActive ? 0.9 : 0,
top: this.calculatedTop,
zIndex: this.zIndex || this.activeZIndex
};
}
},
mounted: function mounted() {
this.value && this.callActivate();
},
methods: {
activate: function activate() {
// Update coordinates and dimensions of menu
// and its activator
this.updateDimensions();
// Start the transition
requestAnimationFrame(this.startTransition);
}
},
render: function render(h) {
var _this = this;
var _a;
var tooltip = h('div', {
staticClass: 'v-tooltip__content',
'class': this.addBackgroundColorClassChecks((_a = {}, _a[this.contentClass] = true, _a['menuable__content__active'] = this.isActive, _a)),
style: this.styles,
attrs: this.getScopeIdAttrs(),
directives: [{
name: 'show',
value: this.isContentActive
}],
ref: 'content'
}, this.showLazyContent(this.$slots.default));
return h(this.tag, {
staticClass: 'v-tooltip',
'class': this.classes
}, [h('transition', {
props: {
name: this.computedTransition
}
}, [tooltip]), h('span', {
on: this.disabled ? {} : {
mouseenter: function mouseenter() {
_this.runDelay('open', function () {
return _this.isActive = true;
});
},
mouseleave: function mouseleave() {
_this.runDelay('close', function () {
return _this.isActive = false;
});
}
},
ref: 'activator'
}, this.$slots.activator)]);
}
});
/***/ }),
/***/ "./src/components/VTooltip/index.js":
/*!******************************************!*\
!*** ./src/components/VTooltip/index.js ***!
\******************************************/
/*! exports provided: VTooltip, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _VTooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VTooltip */ "./src/components/VTooltip/VTooltip.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTooltip", function() { return _VTooltip__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* istanbul ignore next */
_VTooltip__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) {
Vue.component(_VTooltip__WEBPACK_IMPORTED_MODULE_0__["default"].name, _VTooltip__WEBPACK_IMPORTED_MODULE_0__["default"]);
};
/* harmony default export */ __webpack_exports__["default"] = (_VTooltip__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./src/components/Vuetify/index.ts":
/*!*****************************************!*\
!*** ./src/components/Vuetify/index.ts ***!
\*****************************************/
/*! exports provided: checkVueVersion, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkVueVersion", function() { return checkVueVersion; });
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_application__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mixins/application */ "./src/components/Vuetify/mixins/application.ts");
/* harmony import */ var _mixins_breakpoint__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mixins/breakpoint */ "./src/components/Vuetify/mixins/breakpoint.ts");
/* harmony import */ var _mixins_theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mixins/theme */ "./src/components/Vuetify/mixins/theme.ts");
/* harmony import */ var _mixins_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mixins/icons */ "./src/components/Vuetify/mixins/icons.js");
/* harmony import */ var _mixins_options__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mixins/options */ "./src/components/Vuetify/mixins/options.js");
/* harmony import */ var _mixins_lang__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mixins/lang */ "./src/components/Vuetify/mixins/lang.ts");
/* harmony import */ var _util_goTo__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/goTo */ "./src/components/Vuetify/util/goTo.js");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util/console */ "./src/util/console.ts");
// Utils
var Vuetify = {
install: function install(Vue, opts) {
if (opts === void 0) {
opts = {};
}
if (this.installed) return;
this.installed = true;
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a !== Vue) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_8__["consoleError"])('Multiple instances of Vue detected\nSee https://github.com/vuetifyjs/vuetify/issues/4068\n\nIf you\'re seeing "$attrs is readonly", it\'s caused by this');
}
checkVueVersion(Vue);
var lang = Object(_mixins_lang__WEBPACK_IMPORTED_MODULE_6__["default"])(opts.lang);
Vue.prototype.$vuetify = new Vue({
mixins: [_mixins_breakpoint__WEBPACK_IMPORTED_MODULE_2__["default"]],
data: {
application: _mixins_application__WEBPACK_IMPORTED_MODULE_1__["default"],
dark: false,
icons: Object(_mixins_icons__WEBPACK_IMPORTED_MODULE_4__["default"])(opts.iconfont, opts.icons),
lang: lang,
options: Object(_mixins_options__WEBPACK_IMPORTED_MODULE_5__["default"])(opts.options),
rtl: opts.rtl,
theme: Object(_mixins_theme__WEBPACK_IMPORTED_MODULE_3__["default"])(opts.theme)
},
methods: {
goTo: _util_goTo__WEBPACK_IMPORTED_MODULE_7__["default"],
t: lang.t.bind(lang)
}
});
if (opts.transitions) {
Object.values(opts.transitions).forEach(function (transition) {
if (transition.name !== undefined && transition.name.startsWith('v-')) {
Vue.component(transition.name, transition);
}
});
}
if (opts.directives) {
Object.values(opts.directives).forEach(function (directive) {
Vue.directive(directive.name, directive);
});
}
if (opts.components) {
Object.values(opts.components).forEach(function (component) {
Vue.use(component);
});
}
},
version: '1.1.16'
};
function checkVueVersion(Vue, requiredVue) {
var vueDep = requiredVue || '^2.5.10';
var required = vueDep.split('.', 3).map(function (v) {
return v.replace(/\D/g, '');
}).map(Number);
var actual = Vue.version.split('.', 3).map(function (n) {
return parseInt(n, 10);
});
// Simple semver caret range comparison
var passes = actual[0] === required[0] && ( // major matches
actual[1] > required[1] || // minor is greater
actual[1] === required[1] && actual[2] >= required[2] // or minor is eq and patch is >=
);
if (!passes) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_8__["consoleWarn"])("Vuetify requires Vue version " + vueDep);
}
}
/* harmony default export */ __webpack_exports__["default"] = (Vuetify);
/***/ }),
/***/ "./src/components/Vuetify/mixins/application.ts":
/*!******************************************************!*\
!*** ./src/components/Vuetify/mixins/application.ts ***!
\******************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ({
bar: 0,
bottom: 0,
footer: 0,
insetFooter: 0,
left: 0,
right: 0,
top: 0,
components: {
bar: {},
bottom: {},
footer: {},
insetFooter: {},
left: {},
right: {},
top: {}
},
bind: function bind(uid, target, value) {
var _a;
if (!this.components[target]) return;
this.components[target] = (_a = {}, _a[uid] = value, _a);
this.update(target);
},
unbind: function unbind(uid, target) {
if (this.components[target][uid] == null) return;
delete this.components[target][uid];
this.update(target);
},
update: function update(target) {
this[target] = Object.values(this.components[target]).reduce(function (acc, cur) {
return acc + cur;
}, 0);
}
});
/***/ }),
/***/ "./src/components/Vuetify/mixins/breakpoint.ts":
/*!*****************************************************!*\
!*** ./src/components/Vuetify/mixins/breakpoint.ts ***!
\*****************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/**
* A modified version of https://gist.github.com/cb109/b074a65f7595cffc21cea59ce8d15f9b
*/
/**
* A Vue mixin to get the current width/height and the associated breakpoint.
*
* <div v-if="$breakpoint.smAndDown">...</div>
*
*/
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
data: function data() {
return {
clientHeight: getClientHeight(),
clientWidth: getClientWidth(),
resizeTimeout: undefined
};
},
computed: {
breakpoint: function breakpoint() {
var xs = this.clientWidth < 600;
var sm = this.clientWidth < 960 && !xs;
var md = this.clientWidth < 1280 - 16 && !(sm || xs);
var lg = this.clientWidth < 1920 - 16 && !(md || sm || xs);
var xl = this.clientWidth >= 1920 - 16;
var xsOnly = xs;
var smOnly = sm;
var smAndDown = (xs || sm) && !(md || lg || xl);
var smAndUp = !xs && (sm || md || lg || xl);
var mdOnly = md;
var mdAndDown = (xs || sm || md) && !(lg || xl);
var mdAndUp = !(xs || sm) && (md || lg || xl);
var lgOnly = lg;
var lgAndDown = (xs || sm || md || lg) && !xl;
var lgAndUp = !(xs || sm || md) && (lg || xl);
var xlOnly = xl;
var name;
switch (true) {
case xs:
name = 'xs';
break;
case sm:
name = 'sm';
break;
case md:
name = 'md';
break;
case lg:
name = 'lg';
break;
default:
name = 'xl';
break;
}
return {
// Definite breakpoint.
xs: xs,
sm: sm,
md: md,
lg: lg,
xl: xl,
// Useful e.g. to construct CSS class names dynamically.
name: name,
// Breakpoint ranges.
xsOnly: xsOnly,
smOnly: smOnly,
smAndDown: smAndDown,
smAndUp: smAndUp,
mdOnly: mdOnly,
mdAndDown: mdAndDown,
mdAndUp: mdAndUp,
lgOnly: lgOnly,
lgAndDown: lgAndDown,
lgAndUp: lgAndUp,
xlOnly: xlOnly,
// For custom breakpoint logic.
width: this.clientWidth,
height: this.clientHeight
};
}
},
created: function created() {
if (typeof window === 'undefined') return;
window.addEventListener('resize', this.onResize, { passive: true });
},
beforeDestroy: function beforeDestroy() {
if (typeof window === 'undefined') return;
window.removeEventListener('resize', this.onResize);
},
methods: {
onResize: function onResize() {
clearTimeout(this.resizeTimeout);
// Added debounce to match what
// v-resize used to do but was
// removed due to a memory leak
// https://github.com/vuetifyjs/vuetify/pull/2997
this.resizeTimeout = window.setTimeout(this.setDimensions, 200);
},
setDimensions: function setDimensions() {
this.clientHeight = getClientHeight();
this.clientWidth = getClientWidth();
}
}
}));
// Cross-browser support as described in:
// https://stackoverflow.com/questions/1248081
function getClientWidth() {
if (typeof document === 'undefined') return 0; // SSR
return Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
}
function getClientHeight() {
if (typeof document === 'undefined') return 0; // SSR
return Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
}
/***/ }),
/***/ "./src/components/Vuetify/mixins/icons.js":
/*!************************************************!*\
!*** ./src/components/Vuetify/mixins/icons.js ***!
\************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return icons; });
// Maps internal Vuetify icon names to actual Material Design icon names.
var ICONS_MATERIAL = {
'complete': 'check',
'cancel': 'cancel',
'close': 'close',
'delete': 'cancel',
'clear': 'clear',
'success': 'check_circle',
'info': 'info',
'warning': 'priority_high',
'error': 'warning',
'prev': 'chevron_left',
'next': 'chevron_right',
'checkboxOn': 'check_box',
'checkboxOff': 'check_box_outline_blank',
'checkboxIndeterminate': 'indeterminate_check_box',
'delimiter': 'fiber_manual_record',
'sort': 'arrow_upward',
'expand': 'keyboard_arrow_down',
'menu': 'menu',
'subgroup': 'arrow_drop_down',
'dropdown': 'arrow_drop_down',
'radioOn': 'radio_button_checked',
'radioOff': 'radio_button_unchecked',
'edit': 'edit'
};
// Maps internal Vuetify icon names to actual icons from materialdesignicons.com
var ICONS_MDI = {
'complete': 'mdi-check',
'cancel': 'mdi-close-circle',
'close': 'mdi-close',
'delete': 'mdi-close-circle',
'clear': 'mdi-close',
'success': 'mdi-check-circle',
'info': 'mdi-information',
'warning': 'mdi-exclamation',
'error': 'mdi-alert',
'prev': 'mdi-chevron-left',
'next': 'mdi-chevron-right',
'checkboxOn': 'mdi-checkbox-marked',
'checkboxOff': 'mdi-checkbox-blank-outline',
'checkboxIndeterminate': 'mdi-minus-box',
'delimiter': 'mdi-circle',
'sort': 'mdi-arrow-up',
'expand': 'mdi-chevron-down',
'menu': 'mdi-menu',
'subgroup': 'mdi-menu-down',
'dropdown': 'mdi-menu-down',
'radioOn': 'mdi-radiobox-marked',
'radioOff': 'mdi-radiobox-blank',
'edit': 'mdi-pencil'
};
// Maps internal Vuetify icon names to actual Font-Awesome 4 icon names.
var ICONS_FONTAWESOME4 = {
'complete': 'fa fa-check',
'cancel': 'fa fa-times-circle',
'close': 'fa fa-times',
'delete': 'fa fa-times-circle',
'clear': 'fa fa-times-circle',
'success': 'fa fa-check-circle',
'info': 'fa fa-info-circle',
'warning': 'fa fa-exclamation',
'error': 'fa fa-exclamation-triangle',
'prev': 'fa fa-chevron-left',
'next': 'fa fa-chevron-right',
'checkboxOn': 'fa fa-check-square',
'checkboxOff': 'fa fa-square-o',
'checkboxIndeterminate': 'fa fa-minus-square',
'delimiter': 'fa fa-circle',
'sort': 'fa fa-sort-up',
'expand': 'fa fa-chevron-down',
'menu': 'fa fa-bars',
'subgroup': 'fa fa-caret-down',
'dropdown': 'fa fa-caret-down',
'radioOn': 'fa fa-dot-circle',
'radioOff': 'fa fa-circle-o',
'edit': 'fa fa-pencil'
};
// Maps internal Vuetify icon names to actual Font-Awesome 5+ icon names.
var ICONS_FONTAWESOME = {
'complete': 'fas fa-check',
'cancel': 'fas fa-times-circle',
'close': 'fas fa-times',
'delete': 'fas fa-times-circle',
'clear': 'fas fa-times-circle',
'success': 'fas fa-check-circle',
'info': 'fas fa-info-circle',
'warning': 'fas fa-exclamation',
'error': 'fas fa-exclamation-triangle',
'prev': 'fas fa-chevron-left',
'next': 'fas fa-chevron-right',
'checkboxOn': 'fas fa-check-square',
'checkboxOff': 'far fa-square',
'checkboxIndeterminate': 'fas fa-minus-square',
'delimiter': 'fas fa-circle',
'sort': 'fas fa-sort-up',
'expand': 'fas fa-chevron-down',
'menu': 'fas fa-bars',
'subgroup': 'fas fa-caret-down',
'dropdown': 'fas fa-caret-down',
'radioOn': 'far fa-dot-circle',
'radioOff': 'far fa-circle',
'edit': 'fas fa-edit'
};
var iconSets = {
md: ICONS_MATERIAL,
mdi: ICONS_MDI,
fa: ICONS_FONTAWESOME,
fa4: ICONS_FONTAWESOME4
};
function icons(iconfont, icons) {
if (iconfont === void 0) {
iconfont = 'md';
}
if (icons === void 0) {
icons = {};
}
return Object.assign({}, iconSets[iconfont] || iconSets.md, icons);
}
/***/ }),
/***/ "./src/components/Vuetify/mixins/lang.ts":
/*!***********************************************!*\
!*** ./src/components/Vuetify/mixins/lang.ts ***!
\***********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lang; });
/* harmony import */ var _locale_en__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../locale/en */ "./src/locale/en.js");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../util/console */ "./src/util/console.ts");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
var __spread = undefined && undefined.__spread || function () {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}return ar;
};
var LANG_PREFIX = '$vuetify.';
var fallback = Symbol('Lang fallback');
function getTranslation(locale, key, usingFallback) {
if (usingFallback === void 0) {
usingFallback = false;
}
var shortKey = key.replace(LANG_PREFIX, '');
var translation = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["getObjectValueByPath"])(locale, shortKey, fallback);
if (translation === fallback) {
if (usingFallback) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["consoleError"])("Translation key \"" + shortKey + "\" not found in fallback");
translation = key;
} else {
Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["consoleWarn"])("Translation key \"" + shortKey + "\" not found, falling back to default");
translation = getTranslation(_locale_en__WEBPACK_IMPORTED_MODULE_0__["default"], key, true);
}
}
return translation;
}
function lang(config) {
if (config === void 0) {
config = {};
}
return {
locales: Object.assign({ en: _locale_en__WEBPACK_IMPORTED_MODULE_0__["default"] }, config.locales),
current: config.current || 'en',
t: function t(key) {
var params = [];
for (var _i = 1; _i < arguments.length; _i++) {
params[_i - 1] = arguments[_i];
}
if (!key.startsWith(LANG_PREFIX)) return key;
if (config.t) return config.t.apply(config, __spread([key], params));
var translation = getTranslation(this.locales[this.current], key);
return translation.replace(/\{(\d+)\}/g, function (match, index) {
return String(params[+index]);
});
}
};
}
/***/ }),
/***/ "./src/components/Vuetify/mixins/options.js":
/*!**************************************************!*\
!*** ./src/components/Vuetify/mixins/options.js ***!
\**************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return options; });
var OPTIONS_DEFAULTS = {
themeVariations: ['primary', 'secondary', 'accent'],
minifyTheme: null,
themeCache: null,
cspNonce: null
};
function options(options) {
if (options === void 0) {
options = {};
}
return Object.assign({}, OPTIONS_DEFAULTS, options);
}
/***/ }),
/***/ "./src/components/Vuetify/mixins/theme.ts":
/*!************************************************!*\
!*** ./src/components/Vuetify/mixins/theme.ts ***!
\************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return theme; });
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
/* eslint-disable no-multi-spaces */
var THEME_DEFAULTS = {
primary: '#1976D2',
secondary: '#424242',
accent: '#82B1FF',
error: '#FF5252',
info: '#2196F3',
success: '#4CAF50',
warning: '#FFC107' // amber.base
};
function theme(theme) {
if (theme === void 0) {
theme = {};
}
if (theme === false) return false;
return __assign({}, THEME_DEFAULTS, theme);
}
/***/ }),
/***/ "./src/components/Vuetify/util/goTo.js":
/*!*********************************************!*\
!*** ./src/components/Vuetify/util/goTo.js ***!
\*********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return goTo; });
/* harmony import */ var _util_easing_patterns__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/easing-patterns */ "./src/util/easing-patterns.js");
var defaults = {
duration: 500,
offset: 0,
easing: 'easeInOutCubic'
};
function getDocumentHeight() {
return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight);
}
function getWindowHeight() {
return window.innerHeight || (document.documentElement || document.body).clientHeight;
}
function isVueComponent(obj) {
return obj != null && obj._isVue;
}
function getTargetLocation(target, settings) {
var location;
if (isVueComponent(target)) {
target = target.$el;
}
if (target instanceof Element) {
location = target.getBoundingClientRect().top + window.pageYOffset;
} else if (typeof target === 'string') {
var targetEl = document.querySelector(target);
if (!targetEl) throw new TypeError("Target element \"" + target + "\" not found.");
location = targetEl.getBoundingClientRect().top + window.pageYOffset;
} else if (typeof target === 'number') {
location = target;
} else {
var type = target == null ? target : target.constructor.name;
throw new TypeError("Target must be a Selector/Number/DOMElement/VueComponent, received " + type + " instead.");
}
return Math.round(Math.min(Math.max(location + settings.offset, 0), getDocumentHeight() - getWindowHeight()));
}
function goTo(target, options) {
return new Promise(function (resolve, reject) {
if (typeof window === 'undefined') return reject('Window is undefined');
var settings = Object.assign({}, defaults, options);
var startTime = performance.now();
var startLocation = window.pageYOffset;
var targetLocation = getTargetLocation(target, settings);
var distanceToScroll = targetLocation - startLocation;
var easingFunction = typeof settings.easing === 'function' ? settings.easing : _util_easing_patterns__WEBPACK_IMPORTED_MODULE_0__[settings.easing];
if (!easingFunction) throw new TypeError("Easing function '" + settings.easing + "' not found.");
function step(currentTime) {
var progressPercentage = Math.min(1, (currentTime - startTime) / settings.duration);
var targetPosition = Math.floor(startLocation + distanceToScroll * easingFunction(progressPercentage));
window.scrollTo(0, targetPosition);
if (Math.round(window.pageYOffset) === targetLocation || progressPercentage === 1) {
return resolve(target);
}
window.requestAnimationFrame(step);
}
window.requestAnimationFrame(step);
});
}
/***/ }),
/***/ "./src/components/index.js":
/*!*********************************!*\
!*** ./src/components/index.js ***!
\*********************************/
/*! exports provided: Vuetify, VApp, VAlert, VAutocomplete, VAvatar, VBadge, VBottomNav, VBottomSheet, VBreadcrumbs, VBtn, VBtnToggle, VCard, VCarousel, VCheckbox, VChip, VCombobox, VCounter, VDataIterator, VDataTable, VDatePicker, VDialog, VDivider, VExpansionPanel, VFooter, VForm, VGrid, VIcon, VInput, VJumbotron, VLabel, VList, VMenu, VMessages, VNavigationDrawer, VOverflowBtn, VPagination, VParallax, VPicker, VProgressCircular, VProgressLinear, VRadioGroup, VRangeSlider, VSelect, VSlider, VSnackbar, VSpeedDial, VStepper, VSubheader, VSwitch, VSystemBar, VTabs, VTextarea, VTextField, VTimePicker, VToolbar, VTooltip, Transitions */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Vuetify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Vuetify */ "./src/components/Vuetify/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Vuetify", function() { return _Vuetify__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _VApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VApp */ "./src/components/VApp/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VApp", function() { return _VApp__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _VAlert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VAlert */ "./src/components/VAlert/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAlert", function() { return _VAlert__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* harmony import */ var _VAutocomplete__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VAutocomplete */ "./src/components/VAutocomplete/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAutocomplete", function() { return _VAutocomplete__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _VAvatar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VAvatar */ "./src/components/VAvatar/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VAvatar", function() { return _VAvatar__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/* harmony import */ var _VBadge__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VBadge */ "./src/components/VBadge/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBadge", function() { return _VBadge__WEBPACK_IMPORTED_MODULE_5__["default"]; });
/* harmony import */ var _VBottomNav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./VBottomNav */ "./src/components/VBottomNav/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBottomNav", function() { return _VBottomNav__WEBPACK_IMPORTED_MODULE_6__["default"]; });
/* harmony import */ var _VBottomSheet__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./VBottomSheet */ "./src/components/VBottomSheet/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBottomSheet", function() { return _VBottomSheet__WEBPACK_IMPORTED_MODULE_7__["default"]; });
/* harmony import */ var _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./VBreadcrumbs */ "./src/components/VBreadcrumbs/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBreadcrumbs", function() { return _VBreadcrumbs__WEBPACK_IMPORTED_MODULE_8__["default"]; });
/* harmony import */ var _VBtn__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./VBtn */ "./src/components/VBtn/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBtn", function() { return _VBtn__WEBPACK_IMPORTED_MODULE_9__["default"]; });
/* harmony import */ var _VBtnToggle__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./VBtnToggle */ "./src/components/VBtnToggle/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VBtnToggle", function() { return _VBtnToggle__WEBPACK_IMPORTED_MODULE_10__["default"]; });
/* harmony import */ var _VCard__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./VCard */ "./src/components/VCard/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCard", function() { return _VCard__WEBPACK_IMPORTED_MODULE_11__["default"]; });
/* harmony import */ var _VCarousel__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./VCarousel */ "./src/components/VCarousel/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCarousel", function() { return _VCarousel__WEBPACK_IMPORTED_MODULE_12__["default"]; });
/* harmony import */ var _VCheckbox__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./VCheckbox */ "./src/components/VCheckbox/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCheckbox", function() { return _VCheckbox__WEBPACK_IMPORTED_MODULE_13__["default"]; });
/* harmony import */ var _VChip__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./VChip */ "./src/components/VChip/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VChip", function() { return _VChip__WEBPACK_IMPORTED_MODULE_14__["default"]; });
/* harmony import */ var _VCombobox__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./VCombobox */ "./src/components/VCombobox/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCombobox", function() { return _VCombobox__WEBPACK_IMPORTED_MODULE_15__["default"]; });
/* harmony import */ var _VCounter__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./VCounter */ "./src/components/VCounter/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VCounter", function() { return _VCounter__WEBPACK_IMPORTED_MODULE_16__["default"]; });
/* harmony import */ var _VDataIterator__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./VDataIterator */ "./src/components/VDataIterator/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataIterator", function() { return _VDataIterator__WEBPACK_IMPORTED_MODULE_17__["default"]; });
/* harmony import */ var _VDataTable__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./VDataTable */ "./src/components/VDataTable/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDataTable", function() { return _VDataTable__WEBPACK_IMPORTED_MODULE_18__["default"]; });
/* harmony import */ var _VDatePicker__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./VDatePicker */ "./src/components/VDatePicker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDatePicker", function() { return _VDatePicker__WEBPACK_IMPORTED_MODULE_19__["default"]; });
/* harmony import */ var _VDialog__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./VDialog */ "./src/components/VDialog/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDialog", function() { return _VDialog__WEBPACK_IMPORTED_MODULE_20__["default"]; });
/* harmony import */ var _VDivider__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./VDivider */ "./src/components/VDivider/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VDivider", function() { return _VDivider__WEBPACK_IMPORTED_MODULE_21__["default"]; });
/* harmony import */ var _VExpansionPanel__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./VExpansionPanel */ "./src/components/VExpansionPanel/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VExpansionPanel", function() { return _VExpansionPanel__WEBPACK_IMPORTED_MODULE_22__["default"]; });
/* harmony import */ var _VFooter__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./VFooter */ "./src/components/VFooter/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VFooter", function() { return _VFooter__WEBPACK_IMPORTED_MODULE_23__["default"]; });
/* harmony import */ var _VForm__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./VForm */ "./src/components/VForm/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VForm", function() { return _VForm__WEBPACK_IMPORTED_MODULE_24__["default"]; });
/* harmony import */ var _VGrid__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./VGrid */ "./src/components/VGrid/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VGrid", function() { return _VGrid__WEBPACK_IMPORTED_MODULE_25__["default"]; });
/* harmony import */ var _VIcon__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./VIcon */ "./src/components/VIcon/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VIcon", function() { return _VIcon__WEBPACK_IMPORTED_MODULE_26__["default"]; });
/* harmony import */ var _VInput__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./VInput */ "./src/components/VInput/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VInput", function() { return _VInput__WEBPACK_IMPORTED_MODULE_27__["default"]; });
/* harmony import */ var _VJumbotron__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./VJumbotron */ "./src/components/VJumbotron/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VJumbotron", function() { return _VJumbotron__WEBPACK_IMPORTED_MODULE_28__["default"]; });
/* harmony import */ var _VLabel__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./VLabel */ "./src/components/VLabel/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VLabel", function() { return _VLabel__WEBPACK_IMPORTED_MODULE_29__["default"]; });
/* harmony import */ var _VList__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./VList */ "./src/components/VList/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VList", function() { return _VList__WEBPACK_IMPORTED_MODULE_30__["default"]; });
/* harmony import */ var _VMenu__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./VMenu */ "./src/components/VMenu/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VMenu", function() { return _VMenu__WEBPACK_IMPORTED_MODULE_31__["default"]; });
/* harmony import */ var _VMessages__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./VMessages */ "./src/components/VMessages/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VMessages", function() { return _VMessages__WEBPACK_IMPORTED_MODULE_32__["default"]; });
/* harmony import */ var _VNavigationDrawer__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./VNavigationDrawer */ "./src/components/VNavigationDrawer/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VNavigationDrawer", function() { return _VNavigationDrawer__WEBPACK_IMPORTED_MODULE_33__["default"]; });
/* harmony import */ var _VOverflowBtn__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./VOverflowBtn */ "./src/components/VOverflowBtn/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VOverflowBtn", function() { return _VOverflowBtn__WEBPACK_IMPORTED_MODULE_34__["default"]; });
/* harmony import */ var _VPagination__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./VPagination */ "./src/components/VPagination/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VPagination", function() { return _VPagination__WEBPACK_IMPORTED_MODULE_35__["default"]; });
/* harmony import */ var _VParallax__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./VParallax */ "./src/components/VParallax/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VParallax", function() { return _VParallax__WEBPACK_IMPORTED_MODULE_36__["default"]; });
/* harmony import */ var _VPicker__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./VPicker */ "./src/components/VPicker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VPicker", function() { return _VPicker__WEBPACK_IMPORTED_MODULE_37__["default"]; });
/* harmony import */ var _VProgressCircular__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./VProgressCircular */ "./src/components/VProgressCircular/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VProgressCircular", function() { return _VProgressCircular__WEBPACK_IMPORTED_MODULE_38__["default"]; });
/* harmony import */ var _VProgressLinear__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./VProgressLinear */ "./src/components/VProgressLinear/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VProgressLinear", function() { return _VProgressLinear__WEBPACK_IMPORTED_MODULE_39__["default"]; });
/* harmony import */ var _VRadioGroup__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./VRadioGroup */ "./src/components/VRadioGroup/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRadioGroup", function() { return _VRadioGroup__WEBPACK_IMPORTED_MODULE_40__["default"]; });
/* harmony import */ var _VRangeSlider__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./VRangeSlider */ "./src/components/VRangeSlider/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VRangeSlider", function() { return _VRangeSlider__WEBPACK_IMPORTED_MODULE_41__["default"]; });
/* harmony import */ var _VSelect__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./VSelect */ "./src/components/VSelect/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSelect", function() { return _VSelect__WEBPACK_IMPORTED_MODULE_42__["default"]; });
/* harmony import */ var _VSlider__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./VSlider */ "./src/components/VSlider/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSlider", function() { return _VSlider__WEBPACK_IMPORTED_MODULE_43__["default"]; });
/* harmony import */ var _VSnackbar__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./VSnackbar */ "./src/components/VSnackbar/index.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSnackbar", function() { return _VSnackbar__WEBPACK_IMPORTED_MODULE_44__["default"]; });
/* harmony import */ var _VSpeedDial__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./VSpeedDial */ "./src/components/VSpeedDial/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSpeedDial", function() { return _VSpeedDial__WEBPACK_IMPORTED_MODULE_45__["default"]; });
/* harmony import */ var _VStepper__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./VStepper */ "./src/components/VStepper/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VStepper", function() { return _VStepper__WEBPACK_IMPORTED_MODULE_46__["default"]; });
/* harmony import */ var _VSubheader__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./VSubheader */ "./src/components/VSubheader/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSubheader", function() { return _VSubheader__WEBPACK_IMPORTED_MODULE_47__["default"]; });
/* harmony import */ var _VSwitch__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./VSwitch */ "./src/components/VSwitch/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSwitch", function() { return _VSwitch__WEBPACK_IMPORTED_MODULE_48__["default"]; });
/* harmony import */ var _VSystemBar__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./VSystemBar */ "./src/components/VSystemBar/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VSystemBar", function() { return _VSystemBar__WEBPACK_IMPORTED_MODULE_49__["default"]; });
/* harmony import */ var _VTabs__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./VTabs */ "./src/components/VTabs/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTabs", function() { return _VTabs__WEBPACK_IMPORTED_MODULE_50__["default"]; });
/* harmony import */ var _VTextarea__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./VTextarea */ "./src/components/VTextarea/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTextarea", function() { return _VTextarea__WEBPACK_IMPORTED_MODULE_51__["default"]; });
/* harmony import */ var _VTextField__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./VTextField */ "./src/components/VTextField/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTextField", function() { return _VTextField__WEBPACK_IMPORTED_MODULE_52__["default"]; });
/* harmony import */ var _VTimePicker__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./VTimePicker */ "./src/components/VTimePicker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTimePicker", function() { return _VTimePicker__WEBPACK_IMPORTED_MODULE_53__["default"]; });
/* harmony import */ var _VToolbar__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./VToolbar */ "./src/components/VToolbar/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VToolbar", function() { return _VToolbar__WEBPACK_IMPORTED_MODULE_54__["default"]; });
/* harmony import */ var _VTooltip__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./VTooltip */ "./src/components/VTooltip/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VTooltip", function() { return _VTooltip__WEBPACK_IMPORTED_MODULE_55__["default"]; });
/* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./transitions */ "./src/components/transitions/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Transitions", function() { return _transitions__WEBPACK_IMPORTED_MODULE_56__["default"]; });
/***/ }),
/***/ "./src/components/transitions/expand-transition.js":
/*!*********************************************************!*\
!*** ./src/components/transitions/expand-transition.js ***!
\*********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony default export */ __webpack_exports__["default"] = (function (expandedParentClass) {
if (expandedParentClass === void 0) {
expandedParentClass = '';
}
return {
enter: function enter(el, done) {
el._parent = el.parentNode;
Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["addOnceEventListener"])(el, 'transitionend', done);
// Get height that is to be scrolled
el.style.overflow = 'hidden';
el.style.height = 0;
el.style.display = 'block';
expandedParentClass && el._parent.classList.add(expandedParentClass);
setTimeout(function () {
el.style.height = !el.scrollHeight ? 'auto' : el.scrollHeight + "px";
}, 100);
},
afterEnter: function afterEnter(el) {
el.style.overflow = null;
el.style.height = null;
},
leave: function leave(el, done) {
// Remove initial transition
Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["addOnceEventListener"])(el, 'transitionend', done);
// Set height before we transition to 0
el.style.overflow = 'hidden';
el.style.height = el.scrollHeight + "px";
setTimeout(function () {
return el.style.height = 0;
}, 100);
},
afterLeave: function afterLeave(el) {
expandedParentClass && el._parent && el._parent.classList.remove(expandedParentClass);
}
};
});
/***/ }),
/***/ "./src/components/transitions/index.js":
/*!*********************************************!*\
!*** ./src/components/transitions/index.js ***!
\*********************************************/
/*! exports provided: VBottomSheetTransition, VCarouselTransition, VCarouselReverseTransition, VTabTransition, VTabReverseTransition, VMenuTransition, VFabTransition, VDialogTransition, VDialogBottomTransition, VFadeTransition, VScaleTransition, VSlideXTransition, VSlideXReverseTransition, VSlideYTransition, VSlideYReverseTransition, VExpandTransition, VRowExpandTransition, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VBottomSheetTransition", function() { return VBottomSheetTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VCarouselTransition", function() { return VCarouselTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VCarouselReverseTransition", function() { return VCarouselReverseTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VTabTransition", function() { return VTabTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VTabReverseTransition", function() { return VTabReverseTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VMenuTransition", function() { return VMenuTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VFabTransition", function() { return VFabTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VDialogTransition", function() { return VDialogTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VDialogBottomTransition", function() { return VDialogBottomTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VFadeTransition", function() { return VFadeTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VScaleTransition", function() { return VScaleTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSlideXTransition", function() { return VSlideXTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSlideXReverseTransition", function() { return VSlideXReverseTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSlideYTransition", function() { return VSlideYTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSlideYReverseTransition", function() { return VSlideYReverseTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VExpandTransition", function() { return VExpandTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VRowExpandTransition", function() { return VRowExpandTransition; });
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _expand_transition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./expand-transition */ "./src/components/transitions/expand-transition.js");
// Component specific transitions
var VBottomSheetTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('bottom-sheet-transition');
var VCarouselTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('carousel-transition');
var VCarouselReverseTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('carousel-reverse-transition');
var VTabTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('tab-transition');
var VTabReverseTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('tab-reverse-transition');
var VMenuTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('menu-transition');
var VFabTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('fab-transition', 'center center', 'out-in');
// Generic transitions
var VDialogTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('dialog-transition');
var VDialogBottomTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('dialog-bottom-transition');
var VFadeTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('fade-transition');
var VScaleTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('scale-transition');
var VSlideXTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('slide-x-transition');
var VSlideXReverseTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('slide-x-reverse-transition');
var VSlideYTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('slide-y-transition');
var VSlideYReverseTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createSimpleTransition"])('slide-y-reverse-transition');
// JavaScript transitions
var VExpandTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createJavaScriptTransition"])('expand-transition', Object(_expand_transition__WEBPACK_IMPORTED_MODULE_1__["default"])());
var VRowExpandTransition = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["createJavaScriptTransition"])('row-expand-transition', Object(_expand_transition__WEBPACK_IMPORTED_MODULE_1__["default"])('datatable__expand-col--expanded'));
/* harmony default export */ __webpack_exports__["default"] = (install);
/* istanbul ignore next */
function install(Vue) {
Vue.component('v-bottom-sheet-transition', VBottomSheetTransition);
Vue.component('v-carousel-transition', VCarouselTransition);
Vue.component('v-carousel-reverse-transition', VCarouselReverseTransition);
Vue.component('v-dialog-transition', VDialogTransition);
Vue.component('v-dialog-bottom-transition', VDialogBottomTransition);
Vue.component('v-fab-transition', VFabTransition);
Vue.component('v-fade-transition', VFadeTransition);
Vue.component('v-menu-transition', VMenuTransition);
Vue.component('v-scale-transition', VScaleTransition);
Vue.component('v-slide-x-transition', VSlideXTransition);
Vue.component('v-slide-x-reverse-transition', VSlideXReverseTransition);
Vue.component('v-slide-y-transition', VSlideYTransition);
Vue.component('v-slide-y-reverse-transition', VSlideYReverseTransition);
Vue.component('v-tab-reverse-transition', VTabReverseTransition);
Vue.component('v-tab-transition', VTabTransition);
Vue.component('v-expand-transition', VExpandTransition);
Vue.component('v-row-expand-transition', VRowExpandTransition);
}
/***/ }),
/***/ "./src/directives/click-outside.ts":
/*!*****************************************!*\
!*** ./src/directives/click-outside.ts ***!
\*****************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
var __values = undefined && undefined.__values || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator],
i = 0;
if (m) return m.call(o);
return {
next: function next() {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
};
function closeConditional() {
return false;
}
function directive(e, el, binding) {
// Args may not always be supplied
binding.args = binding.args || {};
// If no closeConditional was supplied assign a default
var isActive = binding.args.closeConditional || closeConditional;
// The include element callbacks below can be expensive
// so we should avoid calling them when we're not active.
// Explicitly check for false to allow fallback compatibility
// with non-toggleable components
if (!e || isActive(e) === false) return;
// If click was triggered programmaticaly (domEl.click()) then
// it shouldn't be treated as click-outside
// Chrome/Firefox support isTrusted property
// IE/Edge support pointerType property (empty if not triggered
// by pointing device)
if ('isTrusted' in e && !e.isTrusted || 'pointerType' in e && !e.pointerType) return;
// Check if additional elements were passed to be included in check
// (click must be outside all included elements, if any)
var elements = (binding.args.include || function () {
return [];
})();
// Add the root element for the component this directive was defined on
elements.push(el);
// Check if it's a click outside our elements, and then if our callback returns true.
// Non-toggleable components should take action in their callback and return falsy.
// Toggleable can return true if it wants to deactivate.
// Note that, because we're in the capture phase, this callback will occure before
// the bubbling click event on any outside elements.
!clickedInEls(e, elements) && setTimeout(function () {
isActive(e) && binding.value(e);
}, 0);
}
function clickedInEls(e, elements) {
var e_1, _a;
// Get position of click
var x = e.clientX,
y = e.clientY;
try {
// Loop over all included elements to see if click was in any of them
for (var elements_1 = __values(elements), elements_1_1 = elements_1.next(); !elements_1_1.done; elements_1_1 = elements_1.next()) {
var el = elements_1_1.value;
if (clickedInEl(el, x, y)) return true;
}
} catch (e_1_1) {
e_1 = { error: e_1_1 };
} finally {
try {
if (elements_1_1 && !elements_1_1.done && (_a = elements_1.return)) _a.call(elements_1);
} finally {
if (e_1) throw e_1.error;
}
}
return false;
}
function clickedInEl(el, x, y) {
// Get bounding rect for element
// (we're in capturing event and we want to check for multiple elements,
// so can't use target.)
var b = el.getBoundingClientRect();
// Check if the click was in the element's bounding rect
return x >= b.left && x <= b.right && y >= b.top && y <= b.bottom;
}
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'click-outside',
// [data-app] may not be found
// if using bind, inserted makes
// sure that the root element is
// available, iOS does not support
// clicks on body
inserted: function inserted(el, binding) {
var onClick = function onClick(e) {
return directive(e, el, binding);
};
// iOS does not recognize click events on document
// or body, this is the entire purpose of the v-app
// component and [data-app], stop removing this
var app = document.querySelector('[data-app]') || document.body; // This is only for unit tests
app.addEventListener('click', onClick, true);
el._clickOutside = onClick;
},
unbind: function unbind(el) {
var app = document.querySelector('[data-app]') || document.body; // This is only for unit tests
app && app.removeEventListener('click', el._clickOutside, true);
delete el._clickOutside;
}
});
/***/ }),
/***/ "./src/directives/index.js":
/*!*********************************!*\
!*** ./src/directives/index.js ***!
\*********************************/
/*! exports provided: ClickOutside, Ripple, Resize, Scroll, Touch, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return install; });
/* harmony import */ var _click_outside__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./click-outside */ "./src/directives/click-outside.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClickOutside", function() { return _click_outside__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony import */ var _resize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resize */ "./src/directives/resize.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Resize", function() { return _resize__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _ripple__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ripple */ "./src/directives/ripple.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Ripple", function() { return _ripple__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* harmony import */ var _scroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scroll */ "./src/directives/scroll.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scroll", function() { return _scroll__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _touch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./touch */ "./src/directives/touch.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return _touch__WEBPACK_IMPORTED_MODULE_4__["default"]; });
function install(Vue) {
Vue.directive('click-outside', _click_outside__WEBPACK_IMPORTED_MODULE_0__["default"]);
Vue.directive('ripple', _ripple__WEBPACK_IMPORTED_MODULE_2__["default"]);
Vue.directive('resize', _resize__WEBPACK_IMPORTED_MODULE_1__["default"]);
Vue.directive('scroll', _scroll__WEBPACK_IMPORTED_MODULE_3__["default"]);
Vue.directive('touch', _touch__WEBPACK_IMPORTED_MODULE_4__["default"]);
}
/***/ }),
/***/ "./src/directives/resize.ts":
/*!**********************************!*\
!*** ./src/directives/resize.ts ***!
\**********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
function inserted(el, binding) {
var callback = binding.value;
var options = binding.options || { passive: true };
window.addEventListener('resize', callback, options);
el._onResize = {
callback: callback,
options: options
};
if (!binding.modifiers || !binding.modifiers.quiet) {
callback();
}
}
function unbind(el) {
var _a = el._onResize,
callback = _a.callback,
options = _a.options;
window.removeEventListener('resize', callback, options);
delete el._onResize;
}
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'resize',
inserted: inserted,
unbind: unbind
});
/***/ }),
/***/ "./src/directives/ripple.ts":
/*!**********************************!*\
!*** ./src/directives/ripple.ts ***!
\**********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
function style(el, value) {
el.style['transform'] = value;
el.style['webkitTransform'] = value;
}
var ripple = {
show: function show(e, el, value) {
if (value === void 0) {
value = {};
}
if (!el._ripple || !el._ripple.enabled) {
return;
}
var container = document.createElement('span');
var animation = document.createElement('span');
container.appendChild(animation);
container.className = 'v-ripple__container';
if (value.class) {
container.className += " " + value.class;
}
var size = Math.max(el.clientWidth, el.clientHeight) * (value.center ? 1 : 2);
var halfSize = size / 2;
animation.className = 'v-ripple__animation';
animation.style.width = size + "px";
animation.style.height = size + "px";
el.appendChild(container);
var computed = window.getComputedStyle(el);
if (computed.position !== 'absolute' && computed.position !== 'fixed') el.style.position = 'relative';
var offset = el.getBoundingClientRect();
var x = value.center ? 0 : e.clientX - offset.left - halfSize;
var y = value.center ? 0 : e.clientY - offset.top - halfSize;
animation.classList.add('v-ripple__animation--enter');
animation.classList.add('v-ripple__animation--visible');
style(animation, "translate(" + x + "px, " + y + "px) scale3d(0, 0, 0)");
animation.dataset.activated = String(performance.now());
setTimeout(function () {
animation.classList.remove('v-ripple__animation--enter');
style(animation, "translate(" + x + "px, " + y + "px) scale3d(1, 1, 1)");
}, 0);
},
hide: function hide(el) {
if (!el || !el._ripple || !el._ripple.enabled) return;
var ripples = el.getElementsByClassName('v-ripple__animation');
if (ripples.length === 0) return;
var animation = ripples[ripples.length - 1];
if (animation.dataset.isHiding) return;else animation.dataset.isHiding = 'true';
var diff = performance.now() - Number(animation.dataset.activated);
var delay = Math.max(300 - diff, 0);
setTimeout(function () {
animation.classList.remove('v-ripple__animation--visible');
setTimeout(function () {
var ripples = el.getElementsByClassName('v-ripple__animation');
if (ripples.length === 0) el.style.position = null;
animation.parentNode && el.removeChild(animation.parentNode);
}, 300);
}, delay);
}
};
function isRippleEnabled(value) {
return typeof value === 'undefined' || !!value;
}
function rippleShow(e) {
var value = {};
var element = e.currentTarget;
if (!element) return;
value.center = element._ripple.centered;
if (element._ripple.class) {
value.class = element._ripple.class;
}
ripple.show(e, element, value);
}
function rippleHide(e) {
ripple.hide(e.currentTarget);
}
function updateRipple(el, binding, wasEnabled) {
var enabled = isRippleEnabled(binding.value);
if (!enabled) {
ripple.hide(el);
}
el._ripple = el._ripple || {};
el._ripple.enabled = enabled;
var value = binding.value || {};
if (value.center) {
el._ripple.centered = true;
}
if (value.class) {
el._ripple.class = binding.value.class;
}
if (enabled && !wasEnabled) {
if ('ontouchstart' in window) {
el.addEventListener('touchend', rippleHide, false);
el.addEventListener('touchcancel', rippleHide, false);
}
el.addEventListener('mousedown', rippleShow, false);
el.addEventListener('mouseup', rippleHide, false);
el.addEventListener('mouseleave', rippleHide, false);
// Anchor tags can be dragged, causes other hides to fail - #1537
el.addEventListener('dragstart', rippleHide, false);
} else if (!enabled && wasEnabled) {
removeListeners(el);
}
}
function removeListeners(el) {
el.removeEventListener('mousedown', rippleShow, false);
el.removeEventListener('touchend', rippleHide, false);
el.removeEventListener('touchcancel', rippleHide, false);
el.removeEventListener('mouseup', rippleHide, false);
el.removeEventListener('mouseleave', rippleHide, false);
el.removeEventListener('dragstart', rippleHide, false);
}
function directive(el, binding) {
updateRipple(el, binding, false);
}
function unbind(el) {
delete el._ripple;
removeListeners(el);
}
function update(el, binding) {
if (binding.value === binding.oldValue) {
return;
}
var wasEnabled = isRippleEnabled(binding.oldValue);
updateRipple(el, binding, wasEnabled);
}
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'ripple',
bind: directive,
unbind: unbind,
update: update
});
/***/ }),
/***/ "./src/directives/scroll.ts":
/*!**********************************!*\
!*** ./src/directives/scroll.ts ***!
\**********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
function inserted(el, binding) {
var callback = binding.value;
var options = binding.options || { passive: true };
var target = binding.arg ? document.querySelector(binding.arg) : window;
if (!target) return;
target.addEventListener('scroll', callback, options);
el._onScroll = {
callback: callback,
options: options,
target: target
};
}
function unbind(el) {
if (!el._onScroll) return;
var _a = el._onScroll,
callback = _a.callback,
options = _a.options,
target = _a.target;
target.removeEventListener('scroll', callback, options);
delete el._onScroll;
}
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'scroll',
inserted: inserted,
unbind: unbind
});
/***/ }),
/***/ "./src/directives/touch.ts":
/*!*********************************!*\
!*** ./src/directives/touch.ts ***!
\*********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/helpers */ "./src/util/helpers.ts");
var handleGesture = function handleGesture(wrapper) {
var touchstartX = wrapper.touchstartX,
touchendX = wrapper.touchendX,
touchstartY = wrapper.touchstartY,
touchendY = wrapper.touchendY;
var dirRatio = 0.5;
var minDistance = 16;
wrapper.offsetX = touchendX - touchstartX;
wrapper.offsetY = touchendY - touchstartY;
if (Math.abs(wrapper.offsetY) < dirRatio * Math.abs(wrapper.offsetX)) {
wrapper.left && touchendX < touchstartX - minDistance && wrapper.left(wrapper);
wrapper.right && touchendX > touchstartX + minDistance && wrapper.right(wrapper);
}
if (Math.abs(wrapper.offsetX) < dirRatio * Math.abs(wrapper.offsetY)) {
wrapper.up && touchendY < touchstartY - minDistance && wrapper.up(wrapper);
wrapper.down && touchendY > touchstartY + minDistance && wrapper.down(wrapper);
}
};
function _touchstart(event, wrapper) {
var touch = event.changedTouches[0];
wrapper.touchstartX = touch.clientX;
wrapper.touchstartY = touch.clientY;
wrapper.start && wrapper.start(Object.assign(event, wrapper));
}
function _touchend(event, wrapper) {
var touch = event.changedTouches[0];
wrapper.touchendX = touch.clientX;
wrapper.touchendY = touch.clientY;
wrapper.end && wrapper.end(Object.assign(event, wrapper));
handleGesture(wrapper);
}
function _touchmove(event, wrapper) {
var touch = event.changedTouches[0];
wrapper.touchmoveX = touch.clientX;
wrapper.touchmoveY = touch.clientY;
wrapper.move && wrapper.move(Object.assign(event, wrapper));
}
function createHandlers(value) {
var wrapper = {
touchstartX: 0,
touchstartY: 0,
touchendX: 0,
touchendY: 0,
touchmoveX: 0,
touchmoveY: 0,
offsetX: 0,
offsetY: 0,
left: value.left,
right: value.right,
up: value.up,
down: value.down,
start: value.start,
move: value.move,
end: value.end
};
return {
touchstart: function touchstart(e) {
return _touchstart(e, wrapper);
},
touchend: function touchend(e) {
return _touchend(e, wrapper);
},
touchmove: function touchmove(e) {
return _touchmove(e, wrapper);
}
};
}
function inserted(el, binding, vnode) {
var value = binding.value;
var target = value.parent ? el.parentNode : el;
var options = value.options || { passive: true };
// Needed to pass unit tests
if (!target) return;
var handlers = createHandlers(binding.value);
target._touchHandlers = Object(target._touchHandlers);
target._touchHandlers[vnode.context._uid] = handlers;
Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["keys"])(handlers).forEach(function (eventName) {
target.addEventListener(eventName, handlers[eventName], options);
});
}
function unbind(el, binding, vnode) {
var target = binding.value.parent ? el.parentNode : el;
if (!target) return;
var handlers = target._touchHandlers[vnode.context._uid];
Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["keys"])(handlers).forEach(function (eventName) {
target.removeEventListener(eventName, handlers[eventName]);
});
delete target._touchHandlers[vnode.context._uid];
}
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'touch',
inserted: inserted,
unbind: unbind
});
/***/ }),
/***/ "./src/index.ts":
/*!**********************!*\
!*** ./src/index.ts ***!
\**********************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_app_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./stylus/app.styl */ "./src/stylus/app.styl");
/* harmony import */ var _stylus_app_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_app_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components */ "./src/components/index.js");
/* harmony import */ var _directives__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./directives */ "./src/directives/index.js");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
var Vuetify = {
install: function install(Vue, args) {
var VuetifyComponent = _components__WEBPACK_IMPORTED_MODULE_1__["Vuetify"];
Vue.use(VuetifyComponent, __assign({ components: _components__WEBPACK_IMPORTED_MODULE_1__,
directives: _directives__WEBPACK_IMPORTED_MODULE_2__ }, args));
},
version: '1.1.16'
};
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(Vuetify);
}
/* harmony default export */ __webpack_exports__["default"] = (Vuetify);
/***/ }),
/***/ "./src/locale/en.js":
/*!**************************!*\
!*** ./src/locale/en.js ***!
\**************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ({
dataIterator: {
rowsPerPageText: 'Items per page:',
rowsPerPageAll: 'All',
pageText: '{0}-{1} of {2}',
noResultsText: 'No matching records found',
nextPage: 'Next page',
prevPage: 'Previous page'
},
dataTable: {
rowsPerPageText: 'Rows per page:'
},
noDataText: 'No data available'
});
/***/ }),
/***/ "./src/mixins/applicationable.ts":
/*!***************************************!*\
!*** ./src/mixins/applicationable.ts ***!
\***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return applicationable; });
/* harmony import */ var _positionable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./positionable */ "./src/mixins/positionable.ts");
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/mixins */ "./src/util/mixins.ts");
// Util
function applicationable(value, events) {
if (events === void 0) {
events = [];
}
/* @vue/component */
return Object(_util_mixins__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_positionable__WEBPACK_IMPORTED_MODULE_0__["factory"])(['absolute', 'fixed'])).extend({
name: 'applicationable',
props: {
app: Boolean
},
computed: {
applicationProperty: function applicationProperty() {
return value;
}
},
watch: {
// If previous value was app
// reset the provided prop
app: function app(x, prev) {
prev ? this.removeApplication(true) : this.callUpdate();
},
applicationProperty: function applicationProperty(newVal, oldVal) {
this.$vuetify.application.unbind(this._uid, oldVal);
}
},
activated: function activated() {
this.callUpdate();
},
created: function created() {
for (var i = 0, length = events.length; i < length; i++) {
this.$watch(events[i], this.callUpdate);
}
this.callUpdate();
},
mounted: function mounted() {
this.callUpdate();
},
deactivated: function deactivated() {
this.removeApplication();
},
destroyed: function destroyed() {
this.removeApplication();
},
methods: {
callUpdate: function callUpdate() {
if (!this.app) return;
this.$vuetify.application.bind(this._uid, this.applicationProperty, this.updateApplication());
},
removeApplication: function removeApplication(force) {
if (force === void 0) {
force = false;
}
if (!force && !this.app) return;
this.$vuetify.application.unbind(this._uid, this.applicationProperty);
},
updateApplication: function updateApplication() {
return 0;
}
}
});
}
/***/ }),
/***/ "./src/mixins/bootable.ts":
/*!********************************!*\
!*** ./src/mixins/bootable.ts ***!
\********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/**
* Bootable
* @mixin
*
* Used to add lazy content functionality to components
* Looks for change in "isActive" to automatically boot
* Otherwise can be set manually
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend().extend({
name: 'bootable',
props: {
lazy: Boolean
},
data: function data() {
return {
isBooted: false
};
},
computed: {
hasContent: function hasContent() {
return this.isBooted || !this.lazy || this.isActive;
}
},
watch: {
isActive: function isActive() {
this.isBooted = true;
}
},
methods: {
showLazyContent: function showLazyContent(content) {
return this.hasContent ? content : undefined;
}
}
}));
/***/ }),
/***/ "./src/mixins/button-group.ts":
/*!************************************!*\
!*** ./src/mixins/button-group.ts ***!
\************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/mixins */ "./src/util/mixins.ts");
/* harmony import */ var _registrable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/console */ "./src/util/console.ts");
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_registrable__WEBPACK_IMPORTED_MODULE_1__["provide"])('buttonGroup')).extend({
name: 'button-group',
props: {
mandatory: Boolean
},
data: function data() {
return {
buttons: [],
listeners: [],
isDestroying: false
};
},
watch: {
buttons: 'update'
},
mounted: function mounted() {
this.update();
},
beforeDestroy: function beforeDestroy() {
this.isDestroying = true;
},
methods: {
/** @abstract */
isSelected: function isSelected(i) {
throw new Error('Not implemented !');
},
/** @abstract */
updateValue: function updateValue(i) {
throw new Error('Not implemented !');
},
/** @abstract */
updateAllValues: function updateAllValues() {
throw new Error('Not implemented !');
},
getValue: function getValue(i) {
if (this.buttons[i].value != null) {
return this.buttons[i].value;
}
return i;
},
update: function update() {
var selected = [];
for (var i = 0; i < this.buttons.length; i++) {
var elm = this.buttons[i].$el;
var button = this.buttons[i];
elm.removeAttribute('data-only-child');
if (this.isSelected(i)) {
!button.to && (button.isActive = true);
selected.push(i);
} else {
!button.to && (button.isActive = false);
}
}
if (selected.length === 1) {
this.buttons[selected[0]].$el.setAttribute('data-only-child', 'true');
}
this.ensureMandatoryInvariant(selected.length > 0);
},
register: function register(button) {
var index = this.buttons.length;
this.buttons.push(button);
this.listeners.push(this.updateValue.bind(this, index));
button.$on('click', this.listeners[index]);
},
unregister: function unregister(buttonToUnregister) {
// Basic cleanup if we're destroying
if (this.isDestroying) {
var index = this.buttons.indexOf(buttonToUnregister);
if (index !== -1) {
buttonToUnregister.$off('click', this.listeners[index]);
}
return;
}
this.redoRegistrations(buttonToUnregister);
},
redoRegistrations: function redoRegistrations(buttonToUnregister) {
var selectedCount = 0;
var buttons = [];
for (var index = 0; index < this.buttons.length; ++index) {
var button = this.buttons[index];
if (button !== buttonToUnregister) {
buttons.push(button);
selectedCount += Number(this.isSelected(index));
}
button.$off('click', this.listeners[index]);
}
this.buttons = [];
this.listeners = [];
for (var index = 0; index < buttons.length; ++index) {
this.register(buttons[index]);
}
this.ensureMandatoryInvariant(selectedCount > 0);
this.updateAllValues && this.updateAllValues();
},
ensureMandatoryInvariant: function ensureMandatoryInvariant(hasSelectedAlready) {
// Preserve the mandatory invariant by selecting the first tracked button, if needed
if (!this.mandatory || hasSelectedAlready) return;
if (!this.listeners.length) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["consoleWarn"])('There must be at least one v-btn child if the mandatory property is true.', this);
return;
}
this.listeners[0]();
}
}
}));
/***/ }),
/***/ "./src/mixins/colorable.ts":
/*!*********************************!*\
!*** ./src/mixins/colorable.ts ***!
\*********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'colorable',
props: {
color: String
},
data: function data() {
return {
defaultColor: undefined
};
},
computed: {
computedColor: function computedColor() {
return this.color || this.defaultColor;
}
},
methods: {
addBackgroundColorClassChecks: function addBackgroundColorClassChecks(obj, color) {
var classes = Object.assign({}, obj);
var selectedColor = color === undefined ? this.computedColor : color;
if (selectedColor) {
classes[selectedColor] = true;
}
return classes;
},
addTextColorClassChecks: function addTextColorClassChecks(obj, color) {
var classes = Object.assign({}, obj);
if (color === undefined) color = this.computedColor;
if (color) {
var _a = __read(color.toString().trim().split(' '), 2),
colorName = _a[0],
colorModifier = _a[1];
classes[colorName + '--text'] = true;
colorModifier && (classes['text--' + colorModifier] = true);
}
return classes;
}
}
}));
/***/ }),
/***/ "./src/mixins/comparable.ts":
/*!**********************************!*\
!*** ./src/mixins/comparable.ts ***!
\**********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/helpers */ "./src/util/helpers.ts");
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'comparable',
props: {
valueComparator: {
type: Function,
default: _util_helpers__WEBPACK_IMPORTED_MODULE_1__["deepEqual"]
}
}
}));
/***/ }),
/***/ "./src/mixins/data-iterable.js":
/*!*************************************!*\
!*** ./src/mixins/data-iterable.js ***!
\*************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _components_VBtn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/VBtn */ "./src/components/VBtn/index.ts");
/* harmony import */ var _components_VIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/VIcon */ "./src/components/VIcon/index.ts");
/* harmony import */ var _components_VSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/VSelect */ "./src/components/VSelect/index.js");
/* harmony import */ var _filterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filterable */ "./src/mixins/filterable.js");
/* harmony import */ var _themeable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./themeable */ "./src/mixins/themeable.ts");
/* harmony import */ var _loadable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./loadable */ "./src/mixins/loadable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/console */ "./src/util/console.ts");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
var __spread = undefined && undefined.__spread || function () {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}return ar;
};
/**
* DataIterable
*
* @mixin
*
* Base behavior for data table and data iterator
* providing selection, pagination, sorting and filtering.
*
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'data-iterable',
mixins: [_filterable__WEBPACK_IMPORTED_MODULE_3__["default"], _loadable__WEBPACK_IMPORTED_MODULE_5__["default"], _themeable__WEBPACK_IMPORTED_MODULE_4__["default"]],
props: {
expand: Boolean,
hideActions: Boolean,
disableInitialSort: Boolean,
mustSort: Boolean,
noResultsText: {
type: String,
default: '$vuetify.dataIterator.noResultsText'
},
nextIcon: {
type: String,
default: '$vuetify.icons.next'
},
prevIcon: {
type: String,
default: '$vuetify.icons.prev'
},
rowsPerPageItems: {
type: Array,
default: function _default() {
return [5, 10, 25, {
text: '$vuetify.dataIterator.rowsPerPageAll',
value: -1
}];
}
},
rowsPerPageText: {
type: String,
default: '$vuetify.dataIterator.rowsPerPageText'
},
selectAll: [Boolean, String],
search: {
required: false
},
filter: {
type: Function,
default: function _default(val, search) {
return val != null && typeof val !== 'boolean' && val.toString().toLowerCase().indexOf(search) !== -1;
}
},
customFilter: {
type: Function,
default: function _default(items, search, filter) {
search = search.toString().toLowerCase();
if (search.trim() === '') return items;
return items.filter(function (i) {
return Object.keys(i).some(function (j) {
return filter(i[j], search);
});
});
}
},
customSort: {
type: Function,
default: function _default(items, index, isDescending) {
if (index === null) return items;
return items.sort(function (a, b) {
var _a, _b;
var sortA = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getObjectValueByPath"])(a, index);
var sortB = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getObjectValueByPath"])(b, index);
if (isDescending) {
_a = __read([sortB, sortA], 2), sortA = _a[0], sortB = _a[1];
}
// Check if both are numbers
if (!isNaN(sortA) && !isNaN(sortB)) {
return sortA - sortB;
}
// Check if both cannot be evaluated
if (sortA === null && sortB === null) {
return 0;
}
_b = __read([sortA, sortB].map(function (s) {
return (s || '').toString().toLocaleLowerCase();
}), 2), sortA = _b[0], sortB = _b[1];
if (sortA > sortB) return 1;
if (sortA < sortB) return -1;
return 0;
});
}
},
value: {
type: Array,
default: function _default() {
return [];
}
},
items: {
type: Array,
required: true,
default: function _default() {
return [];
}
},
totalItems: {
type: Number,
default: null
},
itemKey: {
type: String,
default: 'id'
},
pagination: {
type: Object,
default: function _default() {}
}
},
data: function data() {
return {
searchLength: 0,
defaultPagination: {
descending: false,
page: 1,
rowsPerPage: 5,
sortBy: null,
totalItems: 0
},
expanded: {},
actionsClasses: 'v-data-iterator__actions',
actionsRangeControlsClasses: 'v-data-iterator__actions__range-controls',
actionsSelectClasses: 'v-data-iterator__actions__select',
actionsPaginationClasses: 'v-data-iterator__actions__pagination'
};
},
computed: {
computedPagination: function computedPagination() {
return this.hasPagination ? this.pagination : this.defaultPagination;
},
computedRowsPerPageItems: function computedRowsPerPageItems() {
var _this = this;
return this.rowsPerPageItems.map(function (item) {
return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["isObject"])(item) ? Object.assign({}, item, {
text: _this.$vuetify.t(item.text)
}) : item;
});
},
hasPagination: function hasPagination() {
var pagination = this.pagination || {};
return Object.keys(pagination).length > 0;
},
hasSelectAll: function hasSelectAll() {
return this.selectAll !== undefined && this.selectAll !== false;
},
itemsLength: function itemsLength() {
if (this.hasSearch) return this.searchLength;
return this.totalItems || this.items.length;
},
indeterminate: function indeterminate() {
return this.hasSelectAll && this.someItems && !this.everyItem;
},
everyItem: function everyItem() {
var _this = this;
return this.filteredItems.length && this.filteredItems.every(function (i) {
return _this.isSelected(i);
});
},
someItems: function someItems() {
var _this = this;
return this.filteredItems.some(function (i) {
return _this.isSelected(i);
});
},
getPage: function getPage() {
var rowsPerPage = this.computedPagination.rowsPerPage;
return rowsPerPage === Object(rowsPerPage) ? rowsPerPage.value : rowsPerPage;
},
pageStart: function pageStart() {
return this.getPage === -1 ? 0 : (this.computedPagination.page - 1) * this.getPage;
},
pageStop: function pageStop() {
return this.getPage === -1 ? this.itemsLength : this.computedPagination.page * this.getPage;
},
filteredItems: function filteredItems() {
return this.filteredItemsImpl();
},
selected: function selected() {
var selected = {};
for (var index = 0; index < this.value.length; index++) {
var key = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getObjectValueByPath"])(this.value[index], this.itemKey);
selected[key] = true;
}
return selected;
},
hasSearch: function hasSearch() {
return this.search != null;
}
},
watch: {
search: function search() {
var _this = this;
this.$nextTick(function () {
_this.updatePagination({ page: 1, totalItems: _this.itemsLength });
});
},
'computedPagination.sortBy': 'resetPagination',
'computedPagination.descending': 'resetPagination'
},
methods: {
initPagination: function initPagination() {
if (!this.rowsPerPageItems.length) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_7__["consoleWarn"])("The prop 'rows-per-page-items' can not be empty", this);
} else {
this.defaultPagination.rowsPerPage = this.rowsPerPageItems[0];
}
this.defaultPagination.totalItems = this.items.length;
this.updatePagination(Object.assign({}, this.defaultPagination, this.pagination));
},
updatePagination: function updatePagination(val) {
var pagination = this.hasPagination ? this.pagination : this.defaultPagination;
var updatedPagination = Object.assign({}, pagination, val);
this.$emit('update:pagination', updatedPagination);
if (!this.hasPagination) {
this.defaultPagination = updatedPagination;
}
},
isSelected: function isSelected(item) {
return this.selected[Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getObjectValueByPath"])(item, this.itemKey)];
},
isExpanded: function isExpanded(item) {
return this.expanded[Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getObjectValueByPath"])(item, this.itemKey)];
},
filteredItemsImpl: function filteredItemsImpl() {
var additionalFilterArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
additionalFilterArgs[_i] = arguments[_i];
}
if (this.totalItems) return this.items;
var items = this.items.slice();
if (this.hasSearch) {
items = this.customFilter.apply(this, __spread([items, this.search, this.filter], additionalFilterArgs));
this.searchLength = items.length;
}
items = this.customSort(items, this.computedPagination.sortBy, this.computedPagination.descending);
return this.hideActions && !this.hasPagination ? items : items.slice(this.pageStart, this.pageStop);
},
resetPagination: function resetPagination() {
this.computedPagination.page !== 1 && this.updatePagination({ page: 1 });
},
sort: function sort(index) {
var _a = this.computedPagination,
sortBy = _a.sortBy,
descending = _a.descending;
if (sortBy === null) {
this.updatePagination({ sortBy: index, descending: false });
} else if (sortBy === index && !descending) {
this.updatePagination({ descending: true });
} else if (sortBy !== index) {
this.updatePagination({ sortBy: index, descending: false });
} else if (!this.mustSort) {
this.updatePagination({ sortBy: null, descending: null });
} else {
this.updatePagination({ sortBy: index, descending: false });
}
},
toggle: function toggle(value) {
var _this = this;
var selected = Object.assign({}, this.selected);
for (var index = 0; index < this.filteredItems.length; index++) {
var key = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getObjectValueByPath"])(this.filteredItems[index], this.itemKey);
selected[key] = value;
}
this.$emit('input', this.items.filter(function (i) {
var key = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getObjectValueByPath"])(i, _this.itemKey);
return selected[key];
}));
},
createProps: function createProps(item, index) {
var _this = this;
var props = { item: item, index: index };
var keyProp = this.itemKey;
var itemKey = Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getObjectValueByPath"])(item, keyProp);
Object.defineProperty(props, 'selected', {
get: function get() {
return _this.selected[itemKey];
},
set: function set(value) {
if (itemKey == null) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_7__["consoleWarn"])("\"" + keyProp + "\" attribute must be defined for item", _this);
}
var selected = _this.value.slice();
if (value) selected.push(item);else selected = selected.filter(function (i) {
return Object(_util_helpers__WEBPACK_IMPORTED_MODULE_6__["getObjectValueByPath"])(i, keyProp) !== itemKey;
});
_this.$emit('input', selected);
}
});
Object.defineProperty(props, 'expanded', {
get: function get() {
return _this.expanded[itemKey];
},
set: function set(value) {
if (itemKey == null) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_7__["consoleWarn"])("\"" + keyProp + "\" attribute must be defined for item", _this);
}
if (!_this.expand) {
for (var key in _this.expanded) {
_this.expanded.hasOwnProperty(key) && _this.$set(_this.expanded, key, false);
}
}
_this.$set(_this.expanded, itemKey, value);
}
});
return props;
},
genItems: function genItems() {
if (!this.itemsLength && !this.items.length) {
var noData = this.$slots['no-data'] || this.$vuetify.t(this.noDataText);
return [this.genEmptyItems(noData)];
}
if (!this.filteredItems.length) {
var noResults = this.$slots['no-results'] || this.$vuetify.t(this.noResultsText);
return [this.genEmptyItems(noResults)];
}
return this.genFilteredItems();
},
genPrevIcon: function genPrevIcon() {
var _this = this;
return this.$createElement(_components_VBtn__WEBPACK_IMPORTED_MODULE_0__["default"], {
props: {
disabled: this.computedPagination.page === 1,
icon: true,
flat: true,
dark: this.dark,
light: this.light
},
on: {
click: function click() {
var page = _this.computedPagination.page;
_this.updatePagination({ page: page - 1 });
}
},
attrs: {
'aria-label': this.$vuetify.t('$vuetify.dataIterator.prevPage')
}
}, [this.$createElement(_components_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], this.$vuetify.rtl ? this.nextIcon : this.prevIcon)]);
},
genNextIcon: function genNextIcon() {
var _this = this;
var pagination = this.computedPagination;
var disabled = pagination.rowsPerPage < 0 || pagination.page * pagination.rowsPerPage >= this.itemsLength || this.pageStop < 0;
return this.$createElement(_components_VBtn__WEBPACK_IMPORTED_MODULE_0__["default"], {
props: {
disabled: disabled,
icon: true,
flat: true,
dark: this.dark,
light: this.light
},
on: {
click: function click() {
var page = _this.computedPagination.page;
_this.updatePagination({ page: page + 1 });
}
},
attrs: {
'aria-label': this.$vuetify.t('$vuetify.dataIterator.nextPage')
}
}, [this.$createElement(_components_VIcon__WEBPACK_IMPORTED_MODULE_1__["default"], this.$vuetify.rtl ? this.prevIcon : this.nextIcon)]);
},
genSelect: function genSelect() {
var _this = this;
return this.$createElement('div', {
'class': this.actionsSelectClasses
}, [this.$vuetify.t(this.rowsPerPageText), this.$createElement(_components_VSelect__WEBPACK_IMPORTED_MODULE_2__["default"], {
attrs: {
'aria-label': this.$vuetify.t(this.rowsPerPageText)
},
props: {
items: this.computedRowsPerPageItems,
value: this.computedPagination.rowsPerPage,
hideDetails: true,
auto: true,
minWidth: '75px'
},
on: {
input: function input(val) {
_this.updatePagination({
page: 1,
rowsPerPage: val
});
}
}
})]);
},
genPagination: function genPagination() {
var pagination = 'โ';
if (this.itemsLength) {
var stop = this.itemsLength < this.pageStop || this.pageStop < 0 ? this.itemsLength : this.pageStop;
pagination = this.$scopedSlots.pageText ? this.$scopedSlots.pageText({
pageStart: this.pageStart + 1,
pageStop: stop,
itemsLength: this.itemsLength
}) : this.$vuetify.t('$vuetify.dataIterator.pageText', this.pageStart + 1, stop, this.itemsLength);
}
return this.$createElement('div', {
'class': this.actionsPaginationClasses
}, [pagination]);
},
genActions: function genActions() {
var rangeControls = this.$createElement('div', {
'class': this.actionsRangeControlsClasses
}, [this.genPagination(), this.genPrevIcon(), this.genNextIcon()]);
return [this.$createElement('div', {
'class': this.actionsClasses
}, [this.rowsPerPageItems.length > 1 ? this.genSelect() : null, rangeControls])];
}
}
});
/***/ }),
/***/ "./src/mixins/delayable.ts":
/*!*********************************!*\
!*** ./src/mixins/delayable.ts ***!
\*********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/**
* Delayable
*
* @mixin
*
* Changes the open or close delay time for elements
*/
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'delayable',
props: {
openDelay: {
type: [Number, String],
default: 0
},
closeDelay: {
type: [Number, String],
default: 200
}
},
data: function data() {
return {
openTimeout: undefined,
closeTimeout: undefined
};
},
methods: {
/**
* Clear any pending delay timers from executing
*/
clearDelay: function clearDelay() {
clearTimeout(this.openTimeout);
clearTimeout(this.closeTimeout);
},
/**
* Runs callback after a specified delay
*/
runDelay: function runDelay(type, cb) {
this.clearDelay();
var delay = parseInt(this[type + "Delay"], 10);
this[type + "Timeout"] = setTimeout(cb, delay);
}
}
}));
/***/ }),
/***/ "./src/mixins/dependent.js":
/*!*********************************!*\
!*** ./src/mixins/dependent.js ***!
\*********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
var __spread = undefined && undefined.__spread || function () {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}return ar;
};
function searchChildren(children) {
var results = [];
for (var index = 0; index < children.length; index++) {
var child = children[index];
if (child.isActive && child.isDependent) {
results.push(child);
} else {
results.push.apply(results, __spread(searchChildren(child.$children)));
}
}
return results;
}
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'dependent',
data: function data() {
return {
closeDependents: true,
isDependent: true
};
},
watch: {
isActive: function isActive(val) {
if (val) return;
var openDependents = this.getOpenDependents();
for (var index = 0; index < openDependents.length; index++) {
openDependents[index].isActive = false;
}
}
},
methods: {
getOpenDependents: function getOpenDependents() {
if (this.closeDependents) return searchChildren(this.$children);
return [];
},
getOpenDependentElements: function getOpenDependentElements() {
var result = [];
var openDependents = this.getOpenDependents();
for (var index = 0; index < openDependents.length; index++) {
result.push.apply(result, __spread(openDependents[index].getClickableDependentElements()));
}
return result;
},
getClickableDependentElements: function getClickableDependentElements() {
var result = [this.$el];
if (this.$refs.content) result.push(this.$refs.content);
result.push.apply(result, __spread(this.getOpenDependentElements()));
return result;
}
}
});
/***/ }),
/***/ "./src/mixins/detachable.js":
/*!**********************************!*\
!*** ./src/mixins/detachable.js ***!
\**********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _bootable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bootable */ "./src/mixins/bootable.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/console */ "./src/util/console.ts");
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
function validateAttachTarget(val) {
var type = typeof val === 'undefined' ? 'undefined' : _typeof(val);
if (type === 'boolean' || type === 'string') return true;
return val.nodeType === Node.ELEMENT_NODE;
}
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'detachable',
mixins: [_bootable__WEBPACK_IMPORTED_MODULE_0__["default"]],
props: {
attach: {
type: null,
default: false,
validator: validateAttachTarget
},
contentClass: {
default: ''
}
},
data: function data() {
return {
hasDetached: false
};
},
watch: {
attach: function attach() {
this.hasDetached = false;
this.initDetach();
},
hasContent: 'initDetach'
},
mounted: function mounted() {
!this.lazy && this.initDetach();
},
deactivated: function deactivated() {
this.isActive = false;
},
beforeDestroy: function beforeDestroy() {
if (!this.$refs.content) return;
// IE11 Fix
try {
this.$refs.content.parentNode.removeChild(this.$refs.content);
} catch (e) {
console.log(e);
}
},
methods: {
getScopeIdAttrs: function getScopeIdAttrs() {
var _a;
var scopeId = this.$vnode && this.$vnode.context.$options._scopeId;
return scopeId && (_a = {}, _a[scopeId] = '', _a);
},
initDetach: function initDetach() {
if (this._isDestroyed || !this.$refs.content || this.hasDetached ||
// Leave menu in place if attached
// and dev has not changed target
this.attach === '' || // If used as a boolean prop (<v-menu attach>)
this.attach === true || // If bound to a boolean (<v-menu :attach="true">)
this.attach === 'attach' // If bound as boolean prop in pug (v-menu(attach))
) return;
var target;
if (this.attach === false) {
// Default, detach to app
target = document.querySelector('[data-app]');
} else if (typeof this.attach === 'string') {
// CSS selector
target = document.querySelector(this.attach);
} else {
// DOM Element
target = this.attach;
}
if (!target) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleWarn"])("Unable to locate target " + (this.attach || '[data-app]'), this);
return;
}
target.insertBefore(this.$refs.content, target.firstChild);
this.hasDetached = true;
}
}
});
/***/ }),
/***/ "./src/mixins/filterable.js":
/*!**********************************!*\
!*** ./src/mixins/filterable.js ***!
\**********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'filterable',
props: {
noDataText: {
type: String,
default: '$vuetify.noDataText'
}
}
});
/***/ }),
/***/ "./src/mixins/loadable.ts":
/*!********************************!*\
!*** ./src/mixins/loadable.ts ***!
\********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_VProgressLinear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/VProgressLinear */ "./src/components/VProgressLinear/index.ts");
/**
* Loadable
*
* @mixin
*
* Used to add linear progress bar to components
* Can use a default bar with a specific color
* or designate a custom progress linear bar
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend().extend({
name: 'loadable',
props: {
loading: {
type: [Boolean, String],
default: false
}
},
methods: {
genProgress: function genProgress() {
if (this.loading === false) return null;
return this.$slots.progress || this.$createElement(_components_VProgressLinear__WEBPACK_IMPORTED_MODULE_1__["default"], {
props: {
color: this.loading === true || this.loading === '' ? this.color || 'primary' : this.loading,
height: 2,
indeterminate: true
}
});
}
}
}));
/***/ }),
/***/ "./src/mixins/maskable.js":
/*!********************************!*\
!*** ./src/mixins/maskable.js ***!
\********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_mask__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/mask */ "./src/util/mask.js");
/**
* Maskable
*
* @mixin
*
* Creates an input mask that is
* generated from a masked str
*
* Example: mask="#### #### #### ####"
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'maskable',
props: {
dontFillMaskBlanks: Boolean,
mask: {
type: [Object, String],
default: null
},
returnMaskedValue: Boolean
},
data: function data() {
return {
selection: 0,
lazySelection: 0,
preDefined: {
'credit-card': '#### - #### - #### - ####',
'date': '##/##/####',
'date-with-time': '##/##/#### ##:##',
'phone': '(###) ### - ####',
'social': '###-##-####',
'time': '##:##',
'time-with-seconds': '##:##:##'
}
};
},
computed: {
masked: function masked() {
var preDefined = this.preDefined[this.mask];
var mask = preDefined || this.mask || '';
return mask.split('');
}
},
watch: {
/**
* Make sure the cursor is in the correct
* location when the mask changes
*/
mask: function mask() {
var _this = this;
if (!this.$refs.input) return;
var oldValue = this.$refs.input.value;
var newValue = this.maskText(Object(_util_mask__WEBPACK_IMPORTED_MODULE_0__["unmaskText"])(this.lazyValue));
var position = 0;
var selection = this.selection;
for (var index = 0; index < selection; index++) {
Object(_util_mask__WEBPACK_IMPORTED_MODULE_0__["isMaskDelimiter"])(oldValue[index]) || position++;
}
selection = 0;
if (newValue) {
for (var index = 0; index < newValue.length; index++) {
Object(_util_mask__WEBPACK_IMPORTED_MODULE_0__["isMaskDelimiter"])(newValue[index]) || position--;
selection++;
if (position <= 0) break;
}
}
this.$nextTick(function () {
_this.$refs.input.value = newValue;
_this.setCaretPosition(selection);
});
}
},
beforeMount: function beforeMount() {
if (!this.mask || this.value == null || !this.returnMaskedValue) return;
var value = this.maskText(this.value);
// See if masked value does not
// match the user given value
if (value === this.value) return;
this.$emit('input', value);
},
methods: {
setCaretPosition: function setCaretPosition(selection) {
var _this = this;
this.selection = selection;
window.setTimeout(function () {
_this.$refs.input && _this.$refs.input.setSelectionRange(_this.selection, _this.selection);
}, 0);
},
updateRange: function updateRange() {
if (!this.$refs.input) return;
var newValue = this.maskText(this.lazyValue);
var selection = 0;
this.$refs.input.value = newValue;
if (newValue) {
for (var index = 0; index < newValue.length; index++) {
if (this.lazySelection <= 0) break;
Object(_util_mask__WEBPACK_IMPORTED_MODULE_0__["isMaskDelimiter"])(newValue[index]) || this.lazySelection--;
selection++;
}
}
this.setCaretPosition(selection);
// this.$emit() must occur only when all internal values are correct
this.$emit('input', this.returnMaskedValue ? this.$refs.input.value : this.lazyValue);
},
maskText: function maskText(text) {
return this.mask ? Object(_util_mask__WEBPACK_IMPORTED_MODULE_0__["maskText"])(text, this.masked, this.dontFillMaskBlanks) : text;
},
unmaskText: function unmaskText(text) {
return this.mask && !this.returnMaskedValue ? Object(_util_mask__WEBPACK_IMPORTED_MODULE_0__["unmaskText"])(text) : text;
},
// When the input changes and is
// re-created, ensure that the
// caret location is correct
setSelectionRange: function setSelectionRange() {
this.$nextTick(this.updateRange);
},
resetSelections: function resetSelections(input) {
if (!input.selectionEnd) return;
this.selection = input.selectionEnd;
this.lazySelection = 0;
for (var index = 0; index < this.selection; index++) {
Object(_util_mask__WEBPACK_IMPORTED_MODULE_0__["isMaskDelimiter"])(input.value[index]) || this.lazySelection++;
}
}
}
});
/***/ }),
/***/ "./src/mixins/menuable.js":
/*!********************************!*\
!*** ./src/mixins/menuable.js ***!
\********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _positionable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./positionable */ "./src/mixins/positionable.ts");
/* harmony import */ var _stackable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stackable */ "./src/mixins/stackable.js");
/* harmony import */ var _themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./themeable */ "./src/mixins/themeable.ts");
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* eslint-disable object-property-newline */
var dimensions = {
activator: {
top: 0, left: 0,
bottom: 0, right: 0,
width: 0, height: 0,
offsetTop: 0, scrollHeight: 0
},
content: {
top: 0, left: 0,
bottom: 0, right: 0,
width: 0, height: 0,
offsetTop: 0, scrollHeight: 0
},
hasWindow: false
};
/* eslint-enable object-property-newline */
/**
* Menuable
*
* @mixin
*
* Used for fixed or absolutely positioning
* elements within the DOM
* Can calculate X and Y axis overflows
* As well as be manually positioned
*/
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'menuable',
mixins: [_positionable__WEBPACK_IMPORTED_MODULE_0__["default"], _stackable__WEBPACK_IMPORTED_MODULE_1__["default"], _themeable__WEBPACK_IMPORTED_MODULE_2__["default"]],
props: {
activator: {
default: null,
validator: function validator(val) {
return ['string', 'object'].includes(typeof val === 'undefined' ? 'undefined' : _typeof(val));
}
},
allowOverflow: Boolean,
inputActivator: Boolean,
maxWidth: {
type: [Number, String],
default: 'auto'
},
minWidth: [Number, String],
nudgeBottom: {
type: [Number, String],
default: 0
},
nudgeLeft: {
type: [Number, String],
default: 0
},
nudgeRight: {
type: [Number, String],
default: 0
},
nudgeTop: {
type: [Number, String],
default: 0
},
nudgeWidth: {
type: [Number, String],
default: 0
},
offsetOverflow: Boolean,
positionX: {
type: Number,
default: null
},
positionY: {
type: Number,
default: null
},
zIndex: {
type: [Number, String],
default: null
}
},
data: function data() {
return {
absoluteX: 0,
absoluteY: 0,
dimensions: Object.assign({}, dimensions),
isContentActive: false,
pageYOffset: 0,
stackClass: 'v-menu__content--active',
stackMinZIndex: 6
};
},
computed: {
computedLeft: function computedLeft() {
var a = this.dimensions.activator;
var c = this.dimensions.content;
var minWidth = a.width < c.width ? c.width : a.width;
var left = 0;
left += this.left ? a.left - (minWidth - a.width) : a.left;
if (this.offsetX) left += this.left ? -a.width : a.width;
if (this.nudgeLeft) left -= parseInt(this.nudgeLeft);
if (this.nudgeRight) left += parseInt(this.nudgeRight);
return left;
},
computedTop: function computedTop() {
var a = this.dimensions.activator;
var c = this.dimensions.content;
var top = this.top ? a.bottom - c.height : a.top;
if (!this.isAttached) top += this.pageYOffset;
if (this.offsetY) top += this.top ? -a.height : a.height;
if (this.nudgeTop) top -= parseInt(this.nudgeTop);
if (this.nudgeBottom) top += parseInt(this.nudgeBottom);
return top;
},
hasActivator: function hasActivator() {
return !!this.$slots.activator || this.activator || this.inputActivator;
},
isAttached: function isAttached() {
return this.attach !== false;
}
},
watch: {
disabled: function disabled(val) {
val && this.callDeactivate();
},
isActive: function isActive(val) {
if (this.disabled) return;
val ? this.callActivate() : this.callDeactivate();
}
},
beforeMount: function beforeMount() {
this.checkForWindow();
},
methods: {
absolutePosition: function absolutePosition() {
return {
offsetTop: 0,
scrollHeight: 0,
top: this.positionY || this.absoluteY,
bottom: this.positionY || this.absoluteY,
left: this.positionX || this.absoluteX,
right: this.positionX || this.absoluteX,
height: 0,
width: 0
};
},
activate: function activate() {},
calcLeft: function calcLeft() {
return (this.isAttached ? this.computedLeft : this.calcXOverflow(this.computedLeft)) + "px";
},
calcTop: function calcTop() {
return (this.isAttached ? this.computedTop : this.calcYOverflow(this.computedTop)) + "px";
},
calcXOverflow: function calcXOverflow(left) {
var parsedMaxWidth = isNaN(parseInt(this.maxWidth)) ? 0 : parseInt(this.maxWidth);
var innerWidth = this.getInnerWidth();
var maxWidth = Math.max(this.dimensions.content.width, parsedMaxWidth);
var totalWidth = left + maxWidth;
var availableWidth = totalWidth - innerWidth;
if ((!this.left || this.right) && availableWidth > 0) {
left = innerWidth - maxWidth - (innerWidth > 600 ? 30 : 12) // Account for scrollbar
;
}
if (left < 0) left = 12;
return left;
},
calcYOverflow: function calcYOverflow(top) {
var documentHeight = this.getInnerHeight();
var toTop = this.pageYOffset + documentHeight;
var activator = this.dimensions.activator;
var contentHeight = this.dimensions.content.height;
var totalHeight = top + contentHeight;
var isOverflowing = toTop < totalHeight;
// If overflowing bottom and offset
// TODO: set 'bottom' position instead of 'top'
if (isOverflowing && this.offsetOverflow &&
// If we don't have enough room to offset
// the overflow, don't offset
activator.top > contentHeight) {
top = this.pageYOffset + (activator.top - contentHeight);
// If overflowing bottom
} else if (isOverflowing && !this.allowOverflow) {
top = toTop - contentHeight - 12;
// If overflowing top
} else if (top < this.pageYOffset && !this.allowOverflow) {
top = this.pageYOffset + 12;
}
return top < 12 ? 12 : top;
},
callActivate: function callActivate() {
if (!this.hasWindow) return;
this.activate();
},
callDeactivate: function callDeactivate() {
this.isContentActive = false;
this.deactivate();
},
checkForWindow: function checkForWindow() {
if (!this.hasWindow) {
this.hasWindow = typeof window !== 'undefined';
}
},
checkForPageYOffset: function checkForPageYOffset() {
if (this.hasWindow) {
this.pageYOffset = this.getOffsetTop();
}
},
deactivate: function deactivate() {},
getActivator: function getActivator() {
if (this.inputActivator) {
return this.$el.querySelector('.v-input__slot');
}
if (this.activator) {
return typeof this.activator === 'string' ? document.querySelector(this.activator) : this.activator;
}
return this.$refs.activator.children.length > 0 ? this.$refs.activator.children[0] : this.$refs.activator;
},
getInnerHeight: function getInnerHeight() {
if (!this.hasWindow) return 0;
return window.innerHeight || document.documentElement.clientHeight;
},
getInnerWidth: function getInnerWidth() {
if (!this.hasWindow) return 0;
return window.innerWidth;
},
getOffsetTop: function getOffsetTop() {
if (!this.hasWindow) return 0;
return window.pageYOffset || document.documentElement.scrollTop;
},
getRoundedBoundedClientRect: function getRoundedBoundedClientRect(el) {
var rect = el.getBoundingClientRect();
return {
top: Math.round(rect.top),
left: Math.round(rect.left),
bottom: Math.round(rect.bottom),
right: Math.round(rect.right),
width: Math.round(rect.width),
height: Math.round(rect.height)
};
},
measure: function measure(el, selector) {
el = selector ? el.querySelector(selector) : el;
if (!el || !this.hasWindow) return null;
var rect = this.getRoundedBoundedClientRect(el);
// Account for activator margin
if (this.isAttached) {
var style = window.getComputedStyle(el);
rect.left = parseInt(style.marginLeft);
rect.top = parseInt(style.marginTop);
}
return rect;
},
sneakPeek: function sneakPeek(cb) {
var _this = this;
requestAnimationFrame(function () {
var el = _this.$refs.content;
if (!el || _this.isShown(el)) return cb();
el.style.display = 'inline-block';
cb();
el.style.display = 'none';
});
},
startTransition: function startTransition() {
var _this = this;
requestAnimationFrame(function () {
return _this.isContentActive = true;
});
},
isShown: function isShown(el) {
return el.style.display !== 'none';
},
updateDimensions: function updateDimensions() {
var _this = this;
this.checkForWindow();
this.checkForPageYOffset();
var dimensions = {};
// Activator should already be shown
dimensions.activator = !this.hasActivator || this.absolute ? this.absolutePosition() : this.measure(this.getActivator());
// Display and hide to get dimensions
this.sneakPeek(function () {
dimensions.content = _this.measure(_this.$refs.content);
_this.dimensions = dimensions;
});
}
}
});
/***/ }),
/***/ "./src/mixins/overlayable.js":
/*!***********************************!*\
!*** ./src/mixins/overlayable.js ***!
\***********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _stylus_components_overlay_styl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../stylus/components/_overlay.styl */ "./src/stylus/components/_overlay.styl");
/* harmony import */ var _stylus_components_overlay_styl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_stylus_components_overlay_styl__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/helpers */ "./src/util/helpers.ts");
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'overlayable',
props: {
hideOverlay: Boolean
},
data: function data() {
return {
overlay: null,
overlayOffset: 0,
overlayTimeout: null,
overlayTransitionDuration: 500 + 150 // transition + delay
};
},
beforeDestroy: function beforeDestroy() {
this.removeOverlay();
},
methods: {
genOverlay: function genOverlay() {
var _this = this;
// If fn is called and timeout is active
// or overlay already exists
// cancel removal of overlay and re-add active
if (!this.isActive || this.hideOverlay || this.isActive && this.overlayTimeout || this.overlay) {
clearTimeout(this.overlayTimeout);
return this.overlay && this.overlay.classList.add('v-overlay--active');
}
this.overlay = document.createElement('div');
this.overlay.className = 'v-overlay';
if (this.absolute) this.overlay.className += ' v-overlay--absolute';
this.hideScroll();
var parent = this.absolute ? this.$el.parentNode : document.querySelector('[data-app]');
parent && parent.insertBefore(this.overlay, parent.firstChild);
// eslint-disable-next-line no-unused-expressions
this.overlay.clientHeight; // Force repaint
requestAnimationFrame(function () {
// https://github.com/vuetifyjs/vuetify/issues/4678
if (!_this.overlay) return;
_this.overlay.className += ' v-overlay--active';
if (_this.activeZIndex !== undefined) {
_this.overlay.style.zIndex = _this.activeZIndex - 1;
}
});
return true;
},
removeOverlay: function removeOverlay() {
var _this = this;
if (!this.overlay) {
return this.showScroll();
}
this.overlay.classList.remove('v-overlay--active');
this.overlayTimeout = setTimeout(function () {
// IE11 Fix
try {
if (_this.overlay && _this.overlay.parentNode) {
_this.overlay.parentNode.removeChild(_this.overlay);
}
_this.overlay = null;
_this.showScroll();
} catch (e) {
console.log(e);
}
clearTimeout(_this.overlayTimeout);
_this.overlayTimeout = null;
}, this.overlayTransitionDuration);
},
/**
* @param {Event} e
* @returns void
*/
scrollListener: function scrollListener(e) {
if (e.type === 'keydown') {
if (['INPUT', 'TEXTAREA', 'SELECT'].includes(e.target.tagName) ||
// https://github.com/vuetifyjs/vuetify/issues/4715
e.target.isContentEditable) return;
var up = [_util_helpers__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].up, _util_helpers__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].pageup];
var down = [_util_helpers__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].down, _util_helpers__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].pagedown];
if (up.includes(e.keyCode)) {
e.deltaY = -1;
} else if (down.includes(e.keyCode)) {
e.deltaY = 1;
} else {
return;
}
}
if (e.target === this.overlay || e.type !== 'keydown' && e.target === document.body || this.checkPath(e)) e.preventDefault();
},
hasScrollbar: function hasScrollbar(el) {
if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;
var style = window.getComputedStyle(el);
return ['auto', 'scroll'].includes(style['overflow-y']) && el.scrollHeight > el.clientHeight;
},
shouldScroll: function shouldScroll(el, delta) {
if (el.scrollTop === 0 && delta < 0) return true;
return el.scrollTop + el.clientHeight === el.scrollHeight && delta > 0;
},
isInside: function isInside(el, parent) {
if (el === parent) {
return true;
} else if (el === null || el === document.body) {
return false;
} else {
return this.isInside(el.parentNode, parent);
}
},
/**
* @param {Event} e
* @returns boolean
*/
checkPath: function checkPath(e) {
var path = e.path || this.composedPath(e);
var delta = e.deltaY || -e.wheelDelta;
if (e.type === 'keydown' && path[0] === document.body) {
var dialog = this.$refs.dialog;
var selected = window.getSelection().anchorNode;
if (this.hasScrollbar(dialog) && this.isInside(selected, dialog)) {
return this.shouldScroll(dialog, delta);
}
return true;
}
for (var index = 0; index < path.length; index++) {
var el = path[index];
if (el === document) return true;
if (el === document.documentElement) return true;
if (el === this.$refs.content) return true;
if (this.hasScrollbar(el)) return this.shouldScroll(el, delta);
}
return true;
},
/**
* Polyfill for Event.prototype.composedPath
* @param {Event} e
* @returns Element[]
*/
composedPath: function composedPath(e) {
if (e.composedPath) return e.composedPath();
var path = [];
var el = e.target;
while (el) {
path.push(el);
if (el.tagName === 'HTML') {
path.push(document);
path.push(window);
return path;
}
el = el.parentElement;
}
},
hideScroll: function hideScroll() {
if (this.$vuetify.breakpoint.smAndDown) {
document.documentElement.classList.add('overflow-y-hidden');
} else {
window.addEventListener('wheel', this.scrollListener);
window.addEventListener('keydown', this.scrollListener);
}
},
showScroll: function showScroll() {
document.documentElement.classList.remove('overflow-y-hidden');
window.removeEventListener('wheel', this.scrollListener);
window.removeEventListener('keydown', this.scrollListener);
}
}
});
/***/ }),
/***/ "./src/mixins/picker-button.js":
/*!*************************************!*\
!*** ./src/mixins/picker-button.js ***!
\*************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
methods: {
genPickerButton: function genPickerButton(prop, value, content, staticClass) {
var _this = this;
if (staticClass === void 0) {
staticClass = '';
}
var active = this[prop] === value;
var click = function click(event) {
event.stopPropagation();
_this.$emit("update:" + prop, value);
};
return this.$createElement('div', {
staticClass: ("v-picker__title__btn " + staticClass).trim(),
'class': { active: active },
on: active ? undefined : { click: click }
}, Array.isArray(content) ? content : [content]);
}
}
});
/***/ }),
/***/ "./src/mixins/picker.js":
/*!******************************!*\
!*** ./src/mixins/picker.js ***!
\******************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _components_VPicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/VPicker */ "./src/components/VPicker/index.js");
/* harmony import */ var _colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colorable */ "./src/mixins/colorable.ts");
/* harmony import */ var _themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./themeable */ "./src/mixins/themeable.ts");
// Components
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'picker',
mixins: [_colorable__WEBPACK_IMPORTED_MODULE_1__["default"], _themeable__WEBPACK_IMPORTED_MODULE_2__["default"]],
props: {
fullWidth: Boolean,
headerColor: String,
landscape: Boolean,
noTitle: Boolean,
width: {
type: [Number, String],
default: 290,
validator: function validator(value) {
return parseInt(value, 10) > 0;
}
}
},
methods: {
genPickerTitle: function genPickerTitle() {},
genPickerBody: function genPickerBody() {},
genPickerActionsSlot: function genPickerActionsSlot() {
return this.$scopedSlots.default ? this.$scopedSlots.default({
save: this.save,
cancel: this.cancel
}) : this.$slots.default;
},
genPicker: function genPicker(staticClass) {
return this.$createElement(_components_VPicker__WEBPACK_IMPORTED_MODULE_0__["default"], {
staticClass: staticClass,
class: this.fullWidth ? ['v-picker--full-width'] : [],
props: {
color: this.headerColor || this.color,
dark: this.dark,
fullWidth: this.fullWidth,
landscape: this.landscape,
light: this.light,
width: this.width
}
}, [this.noTitle ? null : this.genPickerTitle(), this.genPickerBody(), this.$createElement('template', { slot: 'actions' }, [this.genPickerActionsSlot()])]);
}
}
});
/***/ }),
/***/ "./src/mixins/positionable.ts":
/*!************************************!*\
!*** ./src/mixins/positionable.ts ***!
\************************************/
/*! exports provided: factory, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "factory", function() { return factory; });
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/helpers */ "./src/util/helpers.ts");
var availableProps = {
absolute: Boolean,
bottom: Boolean,
fixed: Boolean,
left: Boolean,
right: Boolean,
top: Boolean
};
function factory(selected) {
if (selected === void 0) {
selected = [];
}
return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'positionable',
props: selected.length ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_1__["filterObjectOnKeys"])(availableProps, selected) : availableProps
});
}
/* harmony default export */ __webpack_exports__["default"] = (factory());
// Add a `*` before the second `/`
/* Tests /
let single = factory(['top']).extend({
created () {
this.top
this.bottom
this.absolute
}
})
let some = factory(['top', 'bottom']).extend({
created () {
this.top
this.bottom
this.absolute
}
})
let all = factory().extend({
created () {
this.top
this.bottom
this.absolute
this.foobar
}
})
/**/
/***/ }),
/***/ "./src/mixins/registrable.ts":
/*!***********************************!*\
!*** ./src/mixins/registrable.ts ***!
\***********************************/
/*! exports provided: inject, provide */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return inject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "provide", function() { return provide; });
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/console */ "./src/util/console.ts");
function generateWarning(child, parent) {
return function () {
return Object(_util_console__WEBPACK_IMPORTED_MODULE_1__["consoleWarn"])("The " + child + " component must be used inside a " + parent);
};
}
function inject(namespace, child, parent) {
var _a;
var defaultImpl = child && parent ? {
register: generateWarning(child, parent),
unregister: generateWarning(child, parent)
} : null;
return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'registrable-inject',
inject: (_a = {}, _a[namespace] = {
default: defaultImpl
}, _a)
});
}
function provide(namespace) {
return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'registrable-provide',
methods: {
register: null,
unregister: null
},
provide: function provide() {
var _a;
return _a = {}, _a[namespace] = {
register: this.register,
unregister: this.unregister
}, _a;
}
});
}
/***/ }),
/***/ "./src/mixins/returnable.js":
/*!**********************************!*\
!*** ./src/mixins/returnable.js ***!
\**********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'returnable',
props: {
returnValue: null
},
data: function data() {
return {
originalValue: null
};
},
watch: {
isActive: function isActive(val) {
if (val) {
this.originalValue = this.returnValue;
} else {
this.$emit('update:returnValue', this.originalValue);
}
}
},
methods: {
save: function save(value) {
this.originalValue = value;
this.isActive = false;
}
}
});
/***/ }),
/***/ "./src/mixins/rippleable.ts":
/*!**********************************!*\
!*** ./src/mixins/rippleable.ts ***!
\**********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../directives/ripple */ "./src/directives/ripple.ts");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
// Types
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_1___default.a.extend({
name: 'rippleable',
directives: { Ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_0__["default"] },
props: {
ripple: {
type: [Boolean, Object],
default: true
}
},
methods: {
genRipple: function genRipple(data) {
if (data === void 0) {
data = {};
}
if (!this.ripple) return null;
data.staticClass = 'v-input--selection-controls__ripple';
data.directives = data.directives || [];
data.directives.push({
name: 'ripple',
value: { center: true }
});
data.on = Object.assign({
click: this.onChange
}, this.$listeners);
return this.$createElement('div', data);
},
onChange: function onChange() {}
}
}));
/***/ }),
/***/ "./src/mixins/routable.ts":
/*!********************************!*\
!*** ./src/mixins/routable.ts ***!
\********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _directives_ripple__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../directives/ripple */ "./src/directives/ripple.ts");
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'routable',
directives: {
Ripple: _directives_ripple__WEBPACK_IMPORTED_MODULE_1__["default"]
},
props: {
activeClass: String,
append: Boolean,
disabled: Boolean,
exact: {
type: Boolean,
default: undefined
},
exactActiveClass: String,
href: [String, Object],
to: [String, Object],
nuxt: Boolean,
replace: Boolean,
ripple: [Boolean, Object],
tag: String,
target: String
},
methods: {
/* eslint-disable-next-line no-unused-vars */
click: function click(e) {},
generateRouteLink: function generateRouteLink() {
var _a;
var exact = this.exact;
var tag;
var data = (_a = {
attrs: { disabled: this.disabled },
class: this.classes,
props: {},
directives: [{
name: 'ripple',
value: this.ripple && !this.disabled ? this.ripple : false
}]
}, _a[this.to ? 'nativeOn' : 'on'] = __assign({}, this.$listeners, { click: this.click }), _a);
if (typeof this.exact === 'undefined') {
exact = this.to === '/' || this.to === Object(this.to) && this.to.path === '/';
}
if (this.to) {
// Add a special activeClass hook
// for component level styles
var activeClass = this.activeClass;
var exactActiveClass = this.exactActiveClass || activeClass;
// TODO: apply only in VListTile
if (this.proxyClass) {
activeClass += ' ' + this.proxyClass;
exactActiveClass += ' ' + this.proxyClass;
}
tag = this.nuxt ? 'nuxt-link' : 'router-link';
Object.assign(data.props, {
to: this.to,
exact: exact,
activeClass: activeClass,
exactActiveClass: exactActiveClass,
append: this.append,
replace: this.replace
});
} else {
tag = this.href && 'a' || this.tag || 'a';
if (tag === 'a' && this.href) data.attrs.href = this.href;
}
if (this.target) data.attrs.target = this.target;
return { tag: tag, data: data };
}
}
}));
/***/ }),
/***/ "./src/mixins/selectable.js":
/*!**********************************!*\
!*** ./src/mixins/selectable.js ***!
\**********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _components_VInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/VInput */ "./src/components/VInput/index.js");
/* harmony import */ var _rippleable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rippleable */ "./src/mixins/rippleable.ts");
/* harmony import */ var _comparable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./comparable */ "./src/mixins/comparable.ts");
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/helpers */ "./src/util/helpers.ts");
// Components
// Mixins
// Utils
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'selectable',
extends: _components_VInput__WEBPACK_IMPORTED_MODULE_0__["default"],
mixins: [_rippleable__WEBPACK_IMPORTED_MODULE_1__["default"], _comparable__WEBPACK_IMPORTED_MODULE_2__["default"]],
model: {
prop: 'inputValue',
event: 'change'
},
props: {
color: {
type: String,
default: 'accent'
},
id: String,
inputValue: null,
falseValue: null,
trueValue: null,
multiple: {
type: Boolean,
default: null
},
label: String,
toggleKeys: {
type: Array,
default: function _default() {
return [_util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].enter, _util_helpers__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].space];
}
}
},
data: function data(vm) {
return {
lazyValue: vm.inputValue
};
},
computed: {
classesSelectable: function classesSelectable() {
return this.addTextColorClassChecks({}, this.isDirty ? this.color : this.validationState);
},
isMultiple: function isMultiple() {
return this.multiple === true || this.multiple === null && Array.isArray(this.internalValue);
},
isActive: function isActive() {
var _this = this;
var value = this.value;
var input = this.internalValue;
if (this.isMultiple) {
if (!Array.isArray(input)) return false;
return input.some(function (item) {
return _this.valueComparator(item, value);
});
}
if (this.trueValue === undefined || this.falseValue === undefined) {
return value ? this.valueComparator(value, input) : Boolean(input);
}
return this.valueComparator(input, this.trueValue);
},
isDirty: function isDirty() {
return this.isActive;
}
},
watch: {
inputValue: function inputValue(val) {
this.lazyValue = val;
}
},
methods: {
genLabel: function genLabel() {
if (!this.hasLabel) return null;
var label = _components_VInput__WEBPACK_IMPORTED_MODULE_0__["default"].methods.genLabel.call(this);
label.data.on = { click: this.onChange };
return label;
},
genInput: function genInput(type, attrs) {
return this.$createElement('input', {
attrs: Object.assign({
'aria-label': this.label,
'aria-checked': this.isActive.toString(),
disabled: this.isDisabled,
id: this.id,
role: type,
type: type,
value: this.inputValue
}, attrs),
domProps: {
checked: this.isActive
},
on: {
blur: this.onBlur,
change: this.onChange,
focus: this.onFocus,
keydown: this.onKeydown
},
ref: 'input'
});
},
onBlur: function onBlur() {
this.isFocused = false;
},
onChange: function onChange() {
var _this = this;
if (this.isDisabled) return;
var value = this.value;
var input = this.internalValue;
if (this.isMultiple) {
if (!Array.isArray(input)) {
input = [];
}
var length = input.length;
input = input.filter(function (item) {
return !_this.valueComparator(item, value);
});
if (input.length === length) {
input.push(value);
}
} else if (this.trueValue !== undefined && this.falseValue !== undefined) {
input = this.valueComparator(input, this.trueValue) ? this.falseValue : this.trueValue;
} else if (value) {
input = this.valueComparator(input, value) ? null : value;
} else {
input = !input;
}
this.validate(true, input);
this.internalValue = input;
},
onFocus: function onFocus() {
this.isFocused = true;
},
onKeydown: function onKeydown(e) {
// Overwrite default behavior to only allow
// the specified keyCodes
if (this.toggleKeys.indexOf(e.keyCode) > -1) {
e.preventDefault();
this.onChange();
}
}
}
});
/***/ }),
/***/ "./src/mixins/ssr-bootable.ts":
/*!************************************!*\
!*** ./src/mixins/ssr-bootable.ts ***!
\************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/**
* SSRBootable
*
* @mixin
*
* Used in layout components (drawer, toolbar, content)
* to avoid an entry animation when using SSR
*/
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'ssr-bootable',
data: function data() {
return {
isBooted: false
};
},
mounted: function mounted() {
var _this = this;
// Use setAttribute instead of dataset
// because dataset does not work well
// with unit tests
window.requestAnimationFrame(function () {
_this.$el.setAttribute('data-booted', 'true');
_this.isBooted = true;
});
}
}));
/***/ }),
/***/ "./src/mixins/stackable.js":
/*!*********************************!*\
!*** ./src/mixins/stackable.js ***!
\*********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/helpers */ "./src/util/helpers.ts");
var __read = undefined && undefined.__read || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o),
r,
ar = [],
e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = { error: error };
} finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
} finally {
if (e) throw e.error;
}
}
return ar;
};
var __spread = undefined && undefined.__spread || function () {
for (var ar = [], i = 0; i < arguments.length; i++) {
ar = ar.concat(__read(arguments[i]));
}return ar;
};
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'stackable',
data: function data() {
return {
stackBase: null,
stackClass: 'unpecified',
stackElement: null,
stackExclude: null,
stackMinZIndex: 0
};
},
computed: {
/**
* Currently active z-index
*
* @return {number}
*/
activeZIndex: function activeZIndex() {
if (typeof window === 'undefined') return 0;
var content = this.stackElement || this.$refs.content;
// Return current zindex if not active
var index = !this.isActive ? Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["getZIndex"])(content) : this.getMaxZIndex(this.stackExclude || [content]) + 2;
if (index == null) return index;
// Return max current z-index (excluding self) + 2
// (2 to leave room for an overlay below, if needed)
return parseInt(index);
}
},
methods: {
getMaxZIndex: function getMaxZIndex(exclude) {
if (exclude === void 0) {
exclude = [];
}
var base = this.stackBase || this.$el;
// Start with lowest allowed z-index or z-index of
// base component's element, whichever is greater
var zis = [this.stackMinZIndex, Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["getZIndex"])(base)];
// Convert the NodeList to an array to
// prevent an Edge bug with Symbol.iterator
// https://github.com/vuetifyjs/vuetify/issues/2146
var activeElements = __spread(document.getElementsByClassName(this.stackClass));
// Get z-index for all active dialogs
for (var index = 0; index < activeElements.length; index++) {
if (!exclude.includes(activeElements[index])) {
zis.push(Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["getZIndex"])(activeElements[index]));
}
}
return Math.max.apply(Math, __spread(zis));
}
}
});
/***/ }),
/***/ "./src/mixins/themeable.ts":
/*!*********************************!*\
!*** ./src/mixins/themeable.ts ***!
\*********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'themeable',
props: {
dark: Boolean,
light: Boolean
},
computed: {
themeClasses: function themeClasses() {
return {
'theme--light': this.light,
'theme--dark': this.dark
};
}
}
}));
/***/ }),
/***/ "./src/mixins/toggleable.ts":
/*!**********************************!*\
!*** ./src/mixins/toggleable.ts ***!
\**********************************/
/*! exports provided: factory, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "factory", function() { return factory; });
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
function factory(prop, event) {
if (prop === void 0) {
prop = 'value';
}
if (event === void 0) {
event = 'input';
}
var _a, _b;
return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'toggleable',
model: { prop: prop, event: event },
props: (_a = {}, _a[prop] = { required: false }, _a),
data: function data() {
return {
isActive: !!this[prop]
};
},
watch: (_b = {}, _b[prop] = function (val) {
this.isActive = !!val;
}, _b.isActive = function (val) {
!!val !== this[prop] && this.$emit(event, val);
}, _b)
});
}
/* eslint-disable-next-line no-redeclare */
var Toggleable = factory();
/* harmony default export */ __webpack_exports__["default"] = (Toggleable);
/***/ }),
/***/ "./src/mixins/transitionable.ts":
/*!**************************************!*\
!*** ./src/mixins/transitionable.ts ***!
\**************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'transitionable',
props: {
mode: String,
origin: String,
transition: String
}
}));
/***/ }),
/***/ "./src/mixins/translatable.ts":
/*!************************************!*\
!*** ./src/mixins/translatable.ts ***!
\************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* harmony default export */ __webpack_exports__["default"] = (vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
name: 'translatable',
props: {
height: Number
},
data: function data() {
return {
parallax: 0,
parallaxDist: 0,
percentScrolled: 0,
windowHeight: 0,
windowBottom: 0
};
},
computed: {
imgHeight: function imgHeight() {
return this.objHeight();
}
},
beforeDestroy: function beforeDestroy() {
window.removeEventListener('scroll', this.translate, false);
window.removeEventListener('resize', this.translate, false);
},
methods: {
calcDimensions: function calcDimensions() {
this.parallaxDist = this.imgHeight - this.height;
this.windowHeight = window.innerHeight;
this.windowBottom = window.pageYOffset + this.windowHeight;
},
listeners: function listeners() {
window.addEventListener('scroll', this.translate, false);
window.addEventListener('resize', this.translate, false);
},
/** @abstract **/
objHeight: function objHeight() {
throw new Error('Not implemented !');
},
translate: function translate() {
this.calcDimensions();
this.percentScrolled = (this.windowBottom - this.$el.offsetTop) / (parseInt(this.height) + this.windowHeight);
this.parallax = Math.round(this.parallaxDist * this.percentScrolled);
}
}
}));
/***/ }),
/***/ "./src/mixins/validatable.js":
/*!***********************************!*\
!*** ./src/mixins/validatable.js ***!
\***********************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/helpers */ "./src/util/helpers.ts");
/* harmony import */ var _registrable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./registrable */ "./src/mixins/registrable.ts");
/* harmony import */ var _util_console__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/console */ "./src/util/console.ts");
/* harmony import */ var _colorable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./colorable */ "./src/mixins/colorable.ts");
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
// Mixins
/* @vue/component */
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'validatable',
mixins: [_colorable__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_registrable__WEBPACK_IMPORTED_MODULE_1__["inject"])('form')],
props: {
error: Boolean,
errorCount: {
type: [Number, String],
default: 1
},
errorMessages: {
type: [String, Array],
default: function _default() {
return [];
}
},
messages: {
type: [String, Array],
default: function _default() {
return [];
}
},
rules: {
type: Array,
default: function _default() {
return [];
}
},
success: Boolean,
successMessages: {
type: [String, Array],
default: function _default() {
return [];
}
},
validateOnBlur: Boolean
},
data: function data() {
return {
errorBucket: [],
hasColor: false,
hasFocused: false,
hasInput: false,
isResetting: false,
valid: false
};
},
computed: {
hasError: function hasError() {
return this.internalErrorMessages.length > 0 || this.errorBucket.length > 0 || this.error;
},
externalError: function externalError() {
return this.internalErrorMessages.length > 0 || this.error;
},
// TODO: Add logic that allows the user to enable based
// upon a good validation
hasSuccess: function hasSuccess() {
return this.successMessages.length > 0 || this.success;
},
hasMessages: function hasMessages() {
return this.validations.length > 0;
},
hasState: function hasState() {
return this.hasSuccess || this.shouldValidate && this.hasError;
},
internalErrorMessages: function internalErrorMessages() {
return this.errorMessages || '';
},
shouldValidate: function shouldValidate() {
return this.externalError || !this.isResetting && (this.validateOnBlur ? this.hasFocused && !this.isFocused : this.hasInput || this.hasFocused);
},
validations: function validations() {
return this.validationTarget.slice(0, this.errorCount);
},
validationState: function validationState() {
if (this.hasError && this.shouldValidate) return 'error';
if (this.hasSuccess) return 'success';
if (this.hasColor) return this.color;
return null;
},
validationTarget: function validationTarget() {
var target = this.internalErrorMessages.length > 0 ? this.errorMessages : this.successMessages.length > 0 ? this.successMessages : this.messages;
// String
if (!Array.isArray(target)) {
return [target];
// Array with items
} else if (target.length > 0) {
return target;
// Currently has validation
} else if (this.shouldValidate) {
return this.errorBucket;
} else {
return [];
}
}
},
watch: {
rules: {
handler: function handler(newVal, oldVal) {
if (Object(_util_helpers__WEBPACK_IMPORTED_MODULE_0__["deepEqual"])(newVal, oldVal)) return;
this.validate();
},
deep: true
},
internalValue: function internalValue() {
// If it's the first time we're setting input,
// mark it with hasInput
this.hasInput = true;
this.validateOnBlur || this.$nextTick(this.validate);
},
isFocused: function isFocused(val) {
if (!val) {
this.hasFocused = true;
this.validateOnBlur && this.validate();
}
},
isResetting: function isResetting() {
var _this = this;
setTimeout(function () {
_this.hasInput = false;
_this.hasFocused = false;
_this.isResetting = false;
}, 0);
},
hasError: function hasError(val) {
if (this.shouldValidate) {
this.$emit('update:error', val);
}
}
},
beforeMount: function beforeMount() {
this.validate();
},
created: function created() {
this.form && this.form.register(this);
},
beforeDestroy: function beforeDestroy() {
this.form && this.form.unregister(this);
},
methods: {
reset: function reset() {
this.isResetting = true;
this.internalValue = Array.isArray(this.internalValue) ? [] : undefined;
},
validate: function validate(force, value) {
if (force === void 0) {
force = false;
}
if (value === void 0) {
value = this.internalValue;
}
var errorBucket = [];
if (force) this.hasInput = this.hasFocused = true;
for (var index = 0; index < this.rules.length; index++) {
var rule = this.rules[index];
var valid = typeof rule === 'function' ? rule(value) : rule;
if (valid === false || typeof valid === 'string') {
errorBucket.push(valid);
} else if (valid !== true) {
Object(_util_console__WEBPACK_IMPORTED_MODULE_2__["consoleError"])("Rules should return a string or boolean, received '" + (typeof valid === 'undefined' ? 'undefined' : _typeof(valid)) + "' instead", this);
}
}
this.errorBucket = errorBucket;
this.valid = errorBucket.length === 0;
return this.valid;
}
}
});
/***/ }),
/***/ "./src/stylus/app.styl":
/*!*****************************!*\
!*** ./src/stylus/app.styl ***!
\*****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_alerts.styl":
/*!********************************************!*\
!*** ./src/stylus/components/_alerts.styl ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_app.styl":
/*!*****************************************!*\
!*** ./src/stylus/components/_app.styl ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_autocompletes.styl":
/*!***************************************************!*\
!*** ./src/stylus/components/_autocompletes.styl ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_avatars.styl":
/*!*********************************************!*\
!*** ./src/stylus/components/_avatars.styl ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_badges.styl":
/*!********************************************!*\
!*** ./src/stylus/components/_badges.styl ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_bottom-navs.styl":
/*!*************************************************!*\
!*** ./src/stylus/components/_bottom-navs.styl ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_bottom-sheets.styl":
/*!***************************************************!*\
!*** ./src/stylus/components/_bottom-sheets.styl ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_breadcrumbs.styl":
/*!*************************************************!*\
!*** ./src/stylus/components/_breadcrumbs.styl ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_button-toggle.styl":
/*!***************************************************!*\
!*** ./src/stylus/components/_button-toggle.styl ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_buttons.styl":
/*!*********************************************!*\
!*** ./src/stylus/components/_buttons.styl ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_cards.styl":
/*!*******************************************!*\
!*** ./src/stylus/components/_cards.styl ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_carousel.styl":
/*!**********************************************!*\
!*** ./src/stylus/components/_carousel.styl ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_chips.styl":
/*!*******************************************!*\
!*** ./src/stylus/components/_chips.styl ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_content.styl":
/*!*********************************************!*\
!*** ./src/stylus/components/_content.styl ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_counters.styl":
/*!**********************************************!*\
!*** ./src/stylus/components/_counters.styl ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_data-iterator.styl":
/*!***************************************************!*\
!*** ./src/stylus/components/_data-iterator.styl ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_data-table.styl":
/*!************************************************!*\
!*** ./src/stylus/components/_data-table.styl ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_date-picker-header.styl":
/*!********************************************************!*\
!*** ./src/stylus/components/_date-picker-header.styl ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_date-picker-table.styl":
/*!*******************************************************!*\
!*** ./src/stylus/components/_date-picker-table.styl ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_date-picker-title.styl":
/*!*******************************************************!*\
!*** ./src/stylus/components/_date-picker-title.styl ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_date-picker-years.styl":
/*!*******************************************************!*\
!*** ./src/stylus/components/_date-picker-years.styl ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_dialogs.styl":
/*!*********************************************!*\
!*** ./src/stylus/components/_dialogs.styl ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_dividers.styl":
/*!**********************************************!*\
!*** ./src/stylus/components/_dividers.styl ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_expansion-panel.styl":
/*!*****************************************************!*\
!*** ./src/stylus/components/_expansion-panel.styl ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_footer.styl":
/*!********************************************!*\
!*** ./src/stylus/components/_footer.styl ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_forms.styl":
/*!*******************************************!*\
!*** ./src/stylus/components/_forms.styl ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_grid.styl":
/*!******************************************!*\
!*** ./src/stylus/components/_grid.styl ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_icons.styl":
/*!*******************************************!*\
!*** ./src/stylus/components/_icons.styl ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_inputs.styl":
/*!********************************************!*\
!*** ./src/stylus/components/_inputs.styl ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_jumbotrons.styl":
/*!************************************************!*\
!*** ./src/stylus/components/_jumbotrons.styl ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_labels.styl":
/*!********************************************!*\
!*** ./src/stylus/components/_labels.styl ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_lists.styl":
/*!*******************************************!*\
!*** ./src/stylus/components/_lists.styl ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_menus.styl":
/*!*******************************************!*\
!*** ./src/stylus/components/_menus.styl ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_messages.styl":
/*!**********************************************!*\
!*** ./src/stylus/components/_messages.styl ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_navigation-drawer.styl":
/*!*******************************************************!*\
!*** ./src/stylus/components/_navigation-drawer.styl ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_overflow-buttons.styl":
/*!******************************************************!*\
!*** ./src/stylus/components/_overflow-buttons.styl ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_overlay.styl":
/*!*********************************************!*\
!*** ./src/stylus/components/_overlay.styl ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_pagination.styl":
/*!************************************************!*\
!*** ./src/stylus/components/_pagination.styl ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_parallax.styl":
/*!**********************************************!*\
!*** ./src/stylus/components/_parallax.styl ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_pickers.styl":
/*!*********************************************!*\
!*** ./src/stylus/components/_pickers.styl ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_progress-circular.styl":
/*!*******************************************************!*\
!*** ./src/stylus/components/_progress-circular.styl ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_progress-linear.styl":
/*!*****************************************************!*\
!*** ./src/stylus/components/_progress-linear.styl ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_radio-group.styl":
/*!*************************************************!*\
!*** ./src/stylus/components/_radio-group.styl ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_radios.styl":
/*!********************************************!*\
!*** ./src/stylus/components/_radios.styl ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_range-sliders.styl":
/*!***************************************************!*\
!*** ./src/stylus/components/_range-sliders.styl ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_select.styl":
/*!********************************************!*\
!*** ./src/stylus/components/_select.styl ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_selection-controls.styl":
/*!********************************************************!*\
!*** ./src/stylus/components/_selection-controls.styl ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_sliders.styl":
/*!*********************************************!*\
!*** ./src/stylus/components/_sliders.styl ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_small-dialog.styl":
/*!**************************************************!*\
!*** ./src/stylus/components/_small-dialog.styl ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_snackbars.styl":
/*!***********************************************!*\
!*** ./src/stylus/components/_snackbars.styl ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_speed-dial.styl":
/*!************************************************!*\
!*** ./src/stylus/components/_speed-dial.styl ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_steppers.styl":
/*!**********************************************!*\
!*** ./src/stylus/components/_steppers.styl ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_subheaders.styl":
/*!************************************************!*\
!*** ./src/stylus/components/_subheaders.styl ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_switch.styl":
/*!********************************************!*\
!*** ./src/stylus/components/_switch.styl ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_system-bars.styl":
/*!*************************************************!*\
!*** ./src/stylus/components/_system-bars.styl ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_tables.styl":
/*!********************************************!*\
!*** ./src/stylus/components/_tables.styl ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_tabs.styl":
/*!******************************************!*\
!*** ./src/stylus/components/_tabs.styl ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_text-fields.styl":
/*!*************************************************!*\
!*** ./src/stylus/components/_text-fields.styl ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_textarea.styl":
/*!**********************************************!*\
!*** ./src/stylus/components/_textarea.styl ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_time-picker-clock.styl":
/*!*******************************************************!*\
!*** ./src/stylus/components/_time-picker-clock.styl ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_time-picker-title.styl":
/*!*******************************************************!*\
!*** ./src/stylus/components/_time-picker-title.styl ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_toolbar.styl":
/*!*********************************************!*\
!*** ./src/stylus/components/_toolbar.styl ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/stylus/components/_tooltips.styl":
/*!**********************************************!*\
!*** ./src/stylus/components/_tooltips.styl ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/util/color/transformCIELAB.ts":
/*!*******************************************!*\
!*** ./src/util/color/transformCIELAB.ts ***!
\*******************************************/
/*! exports provided: fromXYZ, toXYZ */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromXYZ", function() { return fromXYZ; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toXYZ", function() { return toXYZ; });
var delta = 0.20689655172413793; // 6รท29
var cielabForwardTransform = function cielabForwardTransform(t) {
return t > Math.pow(delta, 3) ? Math.cbrt(t) : t / (3 * Math.pow(delta, 2)) + 4 / 29;
};
var cielabReverseTransform = function cielabReverseTransform(t) {
return t > delta ? Math.pow(t, 3) : 3 * Math.pow(delta, 2) * (t - 4 / 29);
};
function fromXYZ(xyz) {
var transform = cielabForwardTransform;
var transformedY = transform(xyz[1]);
return [116 * transformedY - 16, 500 * (transform(xyz[0] / 0.95047) - transformedY), 200 * (transformedY - transform(xyz[2] / 1.08883))];
}
function toXYZ(lab) {
var transform = cielabReverseTransform;
var Ln = (lab[0] + 16) / 116;
return [transform(Ln + lab[1] / 500) * 0.95047, transform(Ln), transform(Ln - lab[2] / 200) * 1.08883];
}
/***/ }),
/***/ "./src/util/color/transformSRGB.ts":
/*!*****************************************!*\
!*** ./src/util/color/transformSRGB.ts ***!
\*****************************************/
/*! exports provided: fromXYZ, toXYZ */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromXYZ", function() { return fromXYZ; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toXYZ", function() { return toXYZ; });
// For converting XYZ to sRGB
var srgbForwardMatrix = [[3.2406, -1.5372, -0.4986], [-0.9689, 1.8758, 0.0415], [0.0557, -0.2040, 1.0570]];
// Forward gamma adjust
var srgbForwardTransform = function srgbForwardTransform(C) {
return C <= 0.0031308 ? C * 12.92 : 1.055 * Math.pow(C, 1 / 2.4) - 0.055;
};
// For converting sRGB to XYZ
var srgbReverseMatrix = [[0.4124, 0.3576, 0.1805], [0.2126, 0.7152, 0.0722], [0.0193, 0.1192, 0.9505]];
// Reverse gamma adjust
var srgbReverseTransform = function srgbReverseTransform(C) {
return C <= 0.04045 ? C / 12.92 : Math.pow((C + 0.055) / 1.055, 2.4);
};
function clamp(value) {
return Math.max(0, Math.min(1, value));
}
function fromXYZ(xyz) {
var rgb = Array(3);
var transform = srgbForwardTransform;
var matrix = srgbForwardMatrix;
// Matrix transform, then gamma adjustment
for (var i = 0; i < 3; ++i) {
rgb[i] = Math.round(clamp(transform(matrix[i][0] * xyz[0] + matrix[i][1] * xyz[1] + matrix[i][2] * xyz[2])) * 255);
}
// Rescale back to [0, 255]
return (rgb[0] << 16) + (rgb[1] << 8) + (rgb[2] << 0);
}
function toXYZ(rgb) {
var xyz = [0, 0, 0];
var transform = srgbReverseTransform;
var matrix = srgbReverseMatrix;
// Rescale from [0, 255] to [0, 1] then adjust sRGB gamma to linear RGB
var r = transform((rgb >> 16 & 0xff) / 255);
var g = transform((rgb >> 8 & 0xff) / 255);
var b = transform((rgb >> 0 & 0xff) / 255);
// Matrix color space transform
for (var i = 0; i < 3; ++i) {
xyz[i] = matrix[i][0] * r + matrix[i][1] * g + matrix[i][2] * b;
}
return xyz;
}
/***/ }),
/***/ "./src/util/colorUtils.ts":
/*!********************************!*\
!*** ./src/util/colorUtils.ts ***!
\********************************/
/*! exports provided: colorToInt, intToHex */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorToInt", function() { return colorToInt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "intToHex", function() { return intToHex; });
/* harmony import */ var _console__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./console */ "./src/util/console.ts");
function colorToInt(color) {
var rgb;
if (typeof color === 'number') {
rgb = color;
} else if (typeof color === 'string') {
var c = color[0] === '#' ? color.substring(1) : color;
if (c.length === 3) {
c = c.split('').map(function (char) {
return char + char;
}).join('');
}
if (c.length !== 6) {
Object(_console__WEBPACK_IMPORTED_MODULE_0__["consoleWarn"])("'" + color + "' is not a valid rgb color");
}
rgb = parseInt(c, 16);
} else {
throw new TypeError("Colors can only be numbers or strings, recieved " + (color == null ? color : color.constructor.name) + " instead");
}
if (rgb < 0) {
Object(_console__WEBPACK_IMPORTED_MODULE_0__["consoleWarn"])("Colors cannot be negative: '" + color + "'");
rgb = 0;
} else if (rgb > 0xffffff || isNaN(rgb)) {
Object(_console__WEBPACK_IMPORTED_MODULE_0__["consoleWarn"])("'" + color + "' is not a valid rgb color");
rgb = 0xffffff;
}
return rgb;
}
function intToHex(color) {
var hexColor = color.toString(16);
if (hexColor.length < 6) hexColor = '0'.repeat(6 - hexColor.length) + hexColor;
return '#' + hexColor;
}
/***/ }),
/***/ "./src/util/console.ts":
/*!*****************************!*\
!*** ./src/util/console.ts ***!
\*****************************/
/*! exports provided: consoleInfo, consoleWarn, consoleError, deprecate */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consoleInfo", function() { return consoleInfo; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consoleWarn", function() { return consoleWarn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consoleError", function() { return consoleError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deprecate", function() { return deprecate; });
function createMessage(message, vm, parent) {
if (parent) {
vm = {
_isVue: true,
$parent: parent,
$options: vm
};
}
if (vm) {
// Only show each message once per instance
vm.$_alreadyWarned = vm.$_alreadyWarned || [];
if (vm.$_alreadyWarned.includes(message)) return;
vm.$_alreadyWarned.push(message);
}
return "[Vuetify] " + message + (vm ? generateComponentTrace(vm) : '');
}
function consoleInfo(message, vm, parent) {
var newMessage = createMessage(message, vm, parent);
newMessage != null && console.info(newMessage);
}
function consoleWarn(message, vm, parent) {
var newMessage = createMessage(message, vm, parent);
newMessage != null && console.warn(newMessage);
}
function consoleError(message, vm, parent) {
var newMessage = createMessage(message, vm, parent);
newMessage != null && console.error(newMessage);
}
function deprecate(original, replacement, vm, parent) {
consoleWarn("'" + original + "' is deprecated, use '" + replacement + "' instead", vm, parent);
}
/**
* Shamelessly stolen from vuejs/vue/blob/dev/src/core/util/debug.js
*/
var classifyRE = /(?:^|[-_])(\w)/g;
var classify = function classify(str) {
return str.replace(classifyRE, function (c) {
return c.toUpperCase();
}).replace(/[-_]/g, '');
};
function formatComponentName(vm, includeFile) {
if (vm.$root === vm) {
return '<Root>';
}
var options = typeof vm === 'function' && vm.cid != null ? vm.options : vm._isVue ? vm.$options || vm.constructor.options : vm || {};
var name = options.name || options._componentTag;
var file = options.__file;
if (!name && file) {
var match = file.match(/([^/\\]+)\.vue$/);
name = match && match[1];
}
return (name ? "<" + classify(name) + ">" : "<Anonymous>") + (file && includeFile !== false ? " at " + file : '');
}
function generateComponentTrace(vm) {
if (vm._isVue && vm.$parent) {
var tree = [];
var currentRecursiveSequence = 0;
while (vm) {
if (tree.length > 0) {
var last = tree[tree.length - 1];
if (last.constructor === vm.constructor) {
currentRecursiveSequence++;
vm = vm.$parent;
continue;
} else if (currentRecursiveSequence > 0) {
tree[tree.length - 1] = [last, currentRecursiveSequence];
currentRecursiveSequence = 0;
}
}
tree.push(vm);
vm = vm.$parent;
}
return '\n\nfound in\n\n' + tree.map(function (vm, i) {
return "" + (i === 0 ? '---> ' : ' '.repeat(5 + i * 2)) + (Array.isArray(vm) ? formatComponentName(vm[0]) + "... (" + vm[1] + " recursive calls)" : formatComponentName(vm));
}).join('\n');
} else {
return "\n\n(found in " + formatComponentName(vm) + ")";
}
}
/***/ }),
/***/ "./src/util/easing-patterns.js":
/*!*************************************!*\
!*** ./src/util/easing-patterns.js ***!
\*************************************/
/*! exports provided: linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linear", function() { return linear; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInQuad", function() { return easeInQuad; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeOutQuad", function() { return easeOutQuad; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInOutQuad", function() { return easeInOutQuad; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInCubic", function() { return easeInCubic; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeOutCubic", function() { return easeOutCubic; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInOutCubic", function() { return easeInOutCubic; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInQuart", function() { return easeInQuart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeOutQuart", function() { return easeOutQuart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInOutQuart", function() { return easeInOutQuart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInQuint", function() { return easeInQuint; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeOutQuint", function() { return easeOutQuint; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "easeInOutQuint", function() { return easeInOutQuint; });
// linear
var linear = function linear(t) {
return t;
};
// accelerating from zero velocity
var easeInQuad = function easeInQuad(t) {
return t * t;
};
// decelerating to zero velocity
var easeOutQuad = function easeOutQuad(t) {
return t * (2 - t);
};
// acceleration until halfway, then deceleration
var easeInOutQuad = function easeInOutQuad(t) {
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
};
// accelerating from zero velocity
var easeInCubic = function easeInCubic(t) {
return t * t * t;
};
// decelerating to zero velocity
var easeOutCubic = function easeOutCubic(t) {
return --t * t * t + 1;
};
// acceleration until halfway, then deceleration
var easeInOutCubic = function easeInOutCubic(t) {
return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
};
// accelerating from zero velocity
var easeInQuart = function easeInQuart(t) {
return t * t * t * t;
};
// decelerating to zero velocity
var easeOutQuart = function easeOutQuart(t) {
return 1 - --t * t * t * t;
};
// acceleration until halfway, then deceleration
var easeInOutQuart = function easeInOutQuart(t) {
return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
};
// accelerating from zero velocity
var easeInQuint = function easeInQuint(t) {
return t * t * t * t * t;
};
// decelerating to zero velocity
var easeOutQuint = function easeOutQuint(t) {
return 1 + --t * t * t * t * t;
};
// acceleration until halfway, then deceleration
var easeInOutQuint = function easeInOutQuint(t) {
return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
};
/***/ }),
/***/ "./src/util/helpers.ts":
/*!*****************************!*\
!*** ./src/util/helpers.ts ***!
\*****************************/
/*! exports provided: createSimpleFunctional, createSimpleTransition, createJavaScriptTransition, directiveConfig, addOnceEventListener, getNestedValue, deepEqual, getObjectValueByPath, getPropertyFromItem, createRange, getZIndex, escapeHTML, filterObjectOnKeys, filterChildren, convertToUnit, kebabCase, isObject, keyCodes, keys */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleFunctional", function() { return createSimpleFunctional; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleTransition", function() { return createSimpleTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createJavaScriptTransition", function() { return createJavaScriptTransition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "directiveConfig", function() { return directiveConfig; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addOnceEventListener", function() { return addOnceEventListener; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNestedValue", function() { return getNestedValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepEqual", function() { return deepEqual; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getObjectValueByPath", function() { return getObjectValueByPath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPropertyFromItem", function() { return getPropertyFromItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRange", function() { return createRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getZIndex", function() { return getZIndex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeHTML", function() { return escapeHTML; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterObjectOnKeys", function() { return filterObjectOnKeys; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterChildren", function() { return filterChildren; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToUnit", function() { return convertToUnit; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "kebabCase", function() { return kebabCase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return keyCodes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return keys; });
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
function createSimpleFunctional(c, el, name) {
if (el === void 0) {
el = 'div';
}
return {
name: name || c.replace(/__/g, '-'),
functional: true,
render: function render(h, _a) {
var data = _a.data,
children = _a.children;
data.staticClass = (c + " " + (data.staticClass || '')).trim();
return h(el, data, children);
}
};
}
function createSimpleTransition(name, origin, mode) {
if (origin === void 0) {
origin = 'top center 0';
}
return {
name: name,
functional: true,
props: {
origin: {
type: String,
default: origin
}
},
render: function render(h, context) {
context.data = context.data || {};
context.data.props = { name: name };
context.data.on = context.data.on || {};
if (!Object.isExtensible(context.data.on)) {
context.data.on = __assign({}, context.data.on);
}
if (mode) context.data.props.mode = mode;
context.data.on.beforeEnter = function (el) {
el.style.transformOrigin = context.props.origin;
el.style.webkitTransformOrigin = context.props.origin;
};
return h('transition', context.data, context.children);
}
};
}
function createJavaScriptTransition(name, functions, css, mode) {
if (css === void 0) {
css = false;
}
if (mode === void 0) {
mode = 'in-out';
}
return {
name: name,
functional: true,
props: {
css: {
type: Boolean,
default: css
},
mode: {
type: String,
default: mode
}
},
render: function render(h, context) {
var data = {
props: __assign({}, context.props, { name: name }),
on: functions
};
return h('transition', data, context.children);
}
};
}
function directiveConfig(binding, defaults) {
if (defaults === void 0) {
defaults = {};
}
return __assign({}, defaults, binding.modifiers, { value: binding.arg }, binding.value || {});
}
function addOnceEventListener(el, event, cb) {
var once = function once() {
cb();
el.removeEventListener(event, once, false);
};
el.addEventListener(event, once, false);
}
function getNestedValue(obj, path, fallback) {
var last = path.length - 1;
if (last < 0) return obj === undefined ? fallback : obj;
for (var i = 0; i < last; i++) {
if (obj == null) {
return fallback;
}
obj = obj[path[i]];
}
if (obj == null) return fallback;
return obj[path[last]] === undefined ? fallback : obj[path[last]];
}
function deepEqual(a, b) {
if (a === b) return true;
if (a instanceof Date && b instanceof Date) {
// If the values are Date, they were convert to timestamp with getTime and compare it
if (a.getTime() !== b.getTime()) return false;
}
if (a !== Object(a) || b !== Object(b)) {
// If the values aren't objects, they were already checked for equality
return false;
}
var props = Object.keys(a);
if (props.length !== Object.keys(b).length) {
// Different number of props, don't bother to check
return false;
}
return props.every(function (p) {
return deepEqual(a[p], b[p]);
});
}
function getObjectValueByPath(obj, path, fallback) {
// credit: http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key#comment55278413_6491621
if (!path || path.constructor !== String) return fallback;
path = path.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties
path = path.replace(/^\./, ''); // strip a leading dot
return getNestedValue(obj, path.split('.'), fallback);
}
function getPropertyFromItem(item, property, fallback) {
if (property == null) return item === undefined ? fallback : item;
if (item !== Object(item)) return fallback === undefined ? item : fallback;
if (typeof property === 'string') return getObjectValueByPath(item, property, fallback);
if (Array.isArray(property)) return getNestedValue(item, property, fallback);
if (typeof property !== 'function') return fallback;
var value = property(item, fallback);
return typeof value === 'undefined' ? fallback : value;
}
function createRange(length) {
return Array.from({ length: length }, function (v, k) {
return k;
});
}
function getZIndex(el) {
if (!el || el.nodeType !== Node.ELEMENT_NODE) return 0;
var index = +window.getComputedStyle(el).getPropertyValue('z-index');
if (isNaN(index)) return getZIndex(el.parentNode);
return index;
}
var tagsToReplace = {
'&': '&',
'<': '<',
'>': '>'
};
function escapeHTML(str) {
return str.replace(/[&<>]/g, function (tag) {
return tagsToReplace[tag] || tag;
});
}
function filterObjectOnKeys(obj, keys) {
var filtered = {};
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (typeof obj[key] !== 'undefined') {
filtered[key] = obj[key];
}
}
return filtered;
}
function filterChildren(array, tag) {
if (array === void 0) {
array = [];
}
return array.filter(function (child) {
return child.componentOptions && child.componentOptions.Ctor.options.name === tag;
});
}
function convertToUnit(str, unit) {
if (unit === void 0) {
unit = 'px';
}
if (str == null || str === '') {
return undefined;
} else if (isNaN(+str)) {
return String(str);
} else {
return "" + Number(str) + unit;
}
}
function kebabCase(str) {
return (str || '').replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
}
function isObject(obj) {
return obj !== null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object';
}
// KeyboardEvent.keyCode aliases
var keyCodes = Object.freeze({
enter: 13,
tab: 9,
delete: 46,
esc: 27,
space: 32,
up: 38,
down: 40,
left: 37,
right: 39,
end: 35,
home: 36,
del: 46,
backspace: 8,
insert: 45,
pageup: 33,
pagedown: 34
});
function keys(o) {
return Object.keys(o);
}
/***/ }),
/***/ "./src/util/mask.js":
/*!**************************!*\
!*** ./src/util/mask.js ***!
\**************************/
/*! exports provided: defaultDelimiters, isMaskDelimiter, maskText, unmaskText */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultDelimiters", function() { return defaultDelimiters; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMaskDelimiter", function() { return isMaskDelimiter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maskText", function() { return maskText; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unmaskText", function() { return unmaskText; });
/**
* Default delimiter RegExp
*
* @type {RegExp}
*/
var defaultDelimiters = /[-!$%^&*()_+|~=`{}[\]:";'<>?,./\\ ]/;
/**
*
* @param {String} char
*
* @return {Boolean}
*/
var isMaskDelimiter = function isMaskDelimiter(char) {
return char && defaultDelimiters.test(char);
};
/**
* Mask keys
*
* @type {Object}
*/
var allowedMasks = {
'#': {
test: function test(char) {
return char.match(/[0-9]/);
}
},
'A': {
test: function test(char) {
return char.match(/[A-Z]/i);
},
convert: function convert(char) {
return char.toUpperCase();
}
},
'a': {
test: function test(char) {
return char.match(/[a-z]/i);
},
convert: function convert(char) {
return char.toLowerCase();
}
},
'N': {
test: function test(char) {
return char.match(/[0-9A-Z]/i);
},
convert: function convert(char) {
return char.toUpperCase();
}
},
'n': {
test: function test(char) {
return char.match(/[0-9a-z]/i);
},
convert: function convert(char) {
return char.toLowerCase();
}
},
'X': {
test: isMaskDelimiter
}
};
/**
* Is Character mask
*
* @param {String} char
*
* @return {Boolean}
*/
var isMask = function isMask(char) {
return allowedMasks.hasOwnProperty(char);
};
/**
* Automatically convert char case
*
* @param {String} mask
* @param {String} char
*
* @return {String}
*/
var convert = function convert(mask, char) {
return allowedMasks[mask].convert ? allowedMasks[mask].convert(char) : char;
};
/**
* Mask Validation
*
* @param {String} mask
* @param {String} char
*
* @return {Boolean}
*/
var maskValidates = function maskValidates(mask, char) {
if (char == null || !isMask(mask)) return false;
return allowedMasks[mask].test(char);
};
/**
* Mask Text
*
* Takes a string or an array of characters
* and returns a masked string
*
* @param {*} text
* @param {Array|String} masked
* @param {Boolean} [dontFillMaskBlanks]
*
* @return {String}
*/
var maskText = function maskText(text, masked, dontFillMaskBlanks) {
if (text == null) return '';
text = String(text);
if (!masked.length || !text.length) return text;
if (!Array.isArray(masked)) masked = masked.split('');
var textIndex = 0;
var maskIndex = 0;
var newText = '';
while (maskIndex < masked.length) {
var mask = masked[maskIndex];
// Assign the next character
var char = text[textIndex];
// Check if mask is delimiter
// and current char matches
if (!isMask(mask) && char === mask) {
newText += mask;
textIndex++;
// Check if not mask
} else if (!isMask(mask) && !dontFillMaskBlanks) {
newText += mask;
// Check if is mask and validates
} else if (maskValidates(mask, char)) {
newText += convert(mask, char);
textIndex++;
} else {
return newText;
}
maskIndex++;
}
return newText;
};
/**
* Unmask Text
*
* @param {String} text
*
* @return {String}
*/
var unmaskText = function unmaskText(text) {
return text ? String(text).replace(new RegExp(defaultDelimiters, 'g'), '') : text;
};
/***/ }),
/***/ "./src/util/mixins.ts":
/*!****************************!*\
!*** ./src/util/mixins.ts ***!
\****************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mixins; });
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
/* eslint-disable max-len, import/export, no-use-before-define */
function mixins() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return vue__WEBPACK_IMPORTED_MODULE_0___default.a.extend({ mixins: args });
}
/***/ }),
/***/ "./src/util/rebuildFunctionalSlots.js":
/*!********************************************!*\
!*** ./src/util/rebuildFunctionalSlots.js ***!
\********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return rebuildFunctionalSlots; });
/**
*
* @param {object} slots
* @param {function} h
* @returns {array}
*/
function rebuildFunctionalSlots(slots, h) {
var children = [];
for (var slot in slots) {
if (slots.hasOwnProperty(slot)) {
children.push(h('template', { slot: slot }, slots[slot]));
}
}
return children;
}
/***/ }),
/***/ "./src/util/theme.ts":
/*!***************************!*\
!*** ./src/util/theme.ts ***!
\***************************/
/*! exports provided: parse, genBaseColor, genVariantColor, genVariations */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genBaseColor", function() { return genBaseColor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genVariantColor", function() { return genVariantColor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genVariations", function() { return genVariations; });
/* harmony import */ var _colorUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colorUtils */ "./src/util/colorUtils.ts");
/* harmony import */ var _color_transformSRGB__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color/transformSRGB */ "./src/util/color/transformSRGB.ts");
/* harmony import */ var _color_transformCIELAB__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./color/transformCIELAB */ "./src/util/color/transformCIELAB.ts");
function parse(theme) {
var colors = Object.keys(theme);
var parsedTheme = {};
for (var i = 0; i < colors.length; ++i) {
var name = colors[i];
var value = theme[name];
parsedTheme[name] = Object(_colorUtils__WEBPACK_IMPORTED_MODULE_0__["colorToInt"])(value);
}
return parsedTheme;
}
/**
* Generate the CSS for a base color (.primary)
*/
var genBaseColor = function genBaseColor(name, value) {
var rgb = Object(_colorUtils__WEBPACK_IMPORTED_MODULE_0__["intToHex"])(value);
return "\n." + name + " {\n background-color: " + rgb + " !important;\n border-color: " + rgb + " !important;\n}\n." + name + "--text {\n color: " + rgb + " !important;\n}\n." + name + "--text input,\n." + name + "--text textarea {\n caret-color: " + rgb + " !important;\n}";
};
/**
* Generate the CSS for a variant color (.primary.darken-2)
*/
var genVariantColor = function genVariantColor(name, value, type, n) {
var rgb = Object(_colorUtils__WEBPACK_IMPORTED_MODULE_0__["intToHex"])(value);
return "\n." + name + "." + type + "-" + n + " {\n background-color: " + rgb + " !important;\n border-color: " + rgb + " !important;\n}\n." + name + "--text.text--" + type + "-" + n + " {\n color: " + rgb + " !important;\n}\n." + name + "--text.text--" + type + "-" + n + " input,\n." + name + "--text.text--" + type + "-" + n + " textarea {\n caret-color: " + rgb + " !important;\n}";
};
function genVariations(name, value) {
var values = Array(10);
values[0] = genBaseColor(name, value);
for (var i = 1, n = 5; i <= 5; ++i, --n) {
values[i] = genVariantColor(name, lighten(value, n), 'lighten', n);
}
for (var i = 1; i <= 4; ++i) {
values[i + 5] = genVariantColor(name, darken(value, i), 'darken', i);
}
return values;
}
function lighten(value, amount) {
var lab = _color_transformCIELAB__WEBPACK_IMPORTED_MODULE_2__["fromXYZ"](_color_transformSRGB__WEBPACK_IMPORTED_MODULE_1__["toXYZ"](value));
lab[0] = lab[0] + amount * 10;
return _color_transformSRGB__WEBPACK_IMPORTED_MODULE_1__["fromXYZ"](_color_transformCIELAB__WEBPACK_IMPORTED_MODULE_2__["toXYZ"](lab));
}
function darken(value, amount) {
var lab = _color_transformCIELAB__WEBPACK_IMPORTED_MODULE_2__["fromXYZ"](_color_transformSRGB__WEBPACK_IMPORTED_MODULE_1__["toXYZ"](value));
lab[0] = lab[0] - amount * 10;
return _color_transformSRGB__WEBPACK_IMPORTED_MODULE_1__["fromXYZ"](_color_transformCIELAB__WEBPACK_IMPORTED_MODULE_2__["toXYZ"](lab));
}
/***/ }),
/***/ "vue":
/*!******************************************************************************!*\
!*** external {"commonjs":"vue","commonjs2":"vue","amd":"vue","root":"Vue"} ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_vue__;
/***/ })
/******/ })["default"];
});
//# sourceMappingURL=vuetify.js.map
|
import { get } from 'ember-metal/property_get';
import { set } from 'ember-metal/property_set';
import { addObserver } from 'ember-metal/observer';
import { observer as emberObserver } from 'ember-metal/mixin';
import { computed } from 'ember-metal/computed';
import { testBoth } from 'ember-metal/tests/props_helper';
import { ArrayTests } from 'ember-runtime/tests/suites/array';
import EmberObject from 'ember-runtime/system/object';
import EmberArray, {
addArrayObserver,
removeArrayObserver,
arrayContentDidChange,
arrayContentWillChange,
objectAt
} from 'ember-runtime/mixins/array';
import { A as emberA } from 'ember-runtime/system/native_array';
/*
Implement a basic fake mutable array. This validates that any non-native
enumerable can impl this API.
*/
const TestArray = EmberObject.extend(EmberArray, {
_content: null,
init(ary = []) {
this._content = ary;
},
// some methods to modify the array so we can test changes. Note that
// arrays can be modified even if they don't implement MutableArray. The
// MutableArray is just a standard API for mutation but not required.
addObject(obj) {
let idx = this._content.length;
arrayContentWillChange(this, idx, 0, 1);
this._content.push(obj);
arrayContentDidChange(this, idx, 0, 1);
},
removeFirst(idx) {
arrayContentWillChange(this, 0, 1, 0);
this._content.shift();
arrayContentDidChange(this, 0, 1, 0);
},
objectAt(idx) {
return this._content[idx];
},
length: computed(function() {
return this._content.length;
})
});
ArrayTests.extend({
name: 'Basic Mutable Array',
newObject(ary) {
ary = ary ? ary.slice() : this.newFixture(3);
return new TestArray(ary);
},
// allows for testing of the basic enumerable after an internal mutation
mutate(obj) {
obj.addObject(this.getFixture(1)[0]);
},
toArray(obj) {
return obj.slice();
}
}).run();
QUnit.test('the return value of slice has Ember.Array applied', function() {
let x = EmberObject.extend(EmberArray).create({
length: 0
});
let y = x.slice(1);
equal(EmberArray.detect(y), true, 'mixin should be applied');
});
QUnit.test('slice supports negative index arguments', function() {
let testArray = new TestArray([1, 2, 3, 4]);
deepEqual(testArray.slice(-2), [3, 4], 'slice(-2)');
deepEqual(testArray.slice(-2, -1), [3], 'slice(-2, -1');
deepEqual(testArray.slice(-2, -2), [], 'slice(-2, -2)');
deepEqual(testArray.slice(-1, -2), [], 'slice(-1, -2)');
deepEqual(testArray.slice(-4, 1), [1], 'slice(-4, 1)');
deepEqual(testArray.slice(-4, 5), [1, 2, 3, 4], 'slice(-4, 5)');
deepEqual(testArray.slice(-4), [1, 2, 3, 4], 'slice(-4)');
deepEqual(testArray.slice(0, -1), [1, 2, 3], 'slice(0, -1)');
deepEqual(testArray.slice(0, -4), [], 'slice(0, -4)');
deepEqual(testArray.slice(0, -3), [1], 'slice(0, -3)');
});
// ..........................................................
// CONTENT DID CHANGE
//
const DummyArray = EmberObject.extend(EmberArray, {
nextObject() {},
length: 0,
objectAt(idx) { return 'ITEM-' + idx; }
});
let obj, observer;
// ..........................................................
// NOTIFY ARRAY OBSERVERS
//
QUnit.module('mixins/array/arrayContent[Will|Did]Change');
QUnit.test('should notify observers of []', function() {
obj = DummyArray.extend({
enumerablePropertyDidChange: emberObserver('[]', function() {
this._count++;
})
}).create({
_count: 0
});
equal(obj._count, 0, 'should not have invoked yet');
arrayContentWillChange(obj, 0, 1, 1);
arrayContentDidChange(obj, 0, 1, 1);
equal(obj._count, 1, 'should have invoked');
});
// ..........................................................
// NOTIFY CHANGES TO LENGTH
//
QUnit.module('notify observers of length', {
setup() {
obj = DummyArray.extend({
lengthDidChange: emberObserver('length', function() {
this._after++;
})
}).create({
_after: 0
});
equal(obj._after, 0, 'should not have fired yet');
},
teardown() {
obj = null;
}
});
QUnit.test('should notify observers when call with no params', function() {
arrayContentWillChange(obj);
equal(obj._after, 0);
arrayContentDidChange(obj);
equal(obj._after, 1);
});
// API variation that included items only
QUnit.test('should not notify when passed lengths are same', function() {
arrayContentWillChange(obj, 0, 1, 1);
equal(obj._after, 0);
arrayContentDidChange(obj, 0, 1, 1);
equal(obj._after, 0);
});
QUnit.test('should notify when passed lengths are different', function() {
arrayContentWillChange(obj, 0, 1, 2);
equal(obj._after, 0);
arrayContentDidChange(obj, 0, 1, 2);
equal(obj._after, 1);
});
// ..........................................................
// NOTIFY ARRAY OBSERVER
//
QUnit.module('notify array observers', {
setup() {
obj = DummyArray.create();
observer = EmberObject.extend({
arrayWillChange() {
equal(this._before, null); // should only call once
this._before = Array.prototype.slice.call(arguments);
},
arrayDidChange() {
equal(this._after, null); // should only call once
this._after = Array.prototype.slice.call(arguments);
}
}).create({
_before: null,
_after: null
});
addArrayObserver(obj, observer);
},
teardown() {
obj = observer = null;
}
});
QUnit.test('should notify enumerable observers when called with no params', function() {
arrayContentWillChange(obj);
deepEqual(observer._before, [obj, 0, -1, -1]);
arrayContentDidChange(obj);
deepEqual(observer._after, [obj, 0, -1, -1]);
});
// API variation that included items only
QUnit.test('should notify when called with same length items', function() {
arrayContentWillChange(obj, 0, 1, 1);
deepEqual(observer._before, [obj, 0, 1, 1]);
arrayContentDidChange(obj, 0, 1, 1);
deepEqual(observer._after, [obj, 0, 1, 1]);
});
QUnit.test('should notify when called with diff length items', function() {
arrayContentWillChange(obj, 0, 2, 1);
deepEqual(observer._before, [obj, 0, 2, 1]);
arrayContentDidChange(obj, 0, 2, 1);
deepEqual(observer._after, [obj, 0, 2, 1]);
});
QUnit.test('removing enumerable observer should disable', function() {
removeArrayObserver(obj, observer);
arrayContentWillChange(obj);
deepEqual(observer._before, null);
arrayContentDidChange(obj);
deepEqual(observer._after, null);
});
// ..........................................................
// NOTIFY ENUMERABLE OBSERVER
//
QUnit.module('notify enumerable observers as well', {
setup() {
obj = DummyArray.create();
observer = EmberObject.extend({
enumerableWillChange() {
equal(this._before, null); // should only call once
this._before = Array.prototype.slice.call(arguments);
},
enumerableDidChange() {
equal(this._after, null); // should only call once
this._after = Array.prototype.slice.call(arguments);
}
}).create({
_before: null,
_after: null
});
obj.addEnumerableObserver(observer);
},
teardown() {
obj = observer = null;
}
});
QUnit.test('should notify enumerable observers when called with no params', function() {
arrayContentWillChange(obj);
deepEqual(observer._before, [obj, null, null], 'before');
arrayContentDidChange(obj);
deepEqual(observer._after, [obj, null, null], 'after');
});
// API variation that included items only
QUnit.test('should notify when called with same length items', function() {
arrayContentWillChange(obj, 0, 1, 1);
deepEqual(observer._before, [obj, ['ITEM-0'], 1], 'before');
arrayContentDidChange(obj, 0, 1, 1);
deepEqual(observer._after, [obj, 1, ['ITEM-0']], 'after');
});
QUnit.test('should notify when called with diff length items', function() {
arrayContentWillChange(obj, 0, 2, 1);
deepEqual(observer._before, [obj, ['ITEM-0', 'ITEM-1'], 1], 'before');
arrayContentDidChange(obj, 0, 2, 1);
deepEqual(observer._after, [obj, 2, ['ITEM-0']], 'after');
});
QUnit.test('removing enumerable observer should disable', function() {
obj.removeEnumerableObserver(observer);
arrayContentWillChange(obj);
deepEqual(observer._before, null, 'before');
arrayContentDidChange(obj);
deepEqual(observer._after, null, 'after');
});
// ..........................................................
// @each
//
let ary;
QUnit.module('EmberArray.@each support', {
setup() {
ary = new TestArray([
{ isDone: true, desc: 'Todo 1' },
{ isDone: false, desc: 'Todo 2' },
{ isDone: true, desc: 'Todo 3' },
{ isDone: false, desc: 'Todo 4' }
]);
},
teardown() {
ary = null;
}
});
QUnit.test('adding an object should notify (@each.isDone)', function() {
let called = 0;
let observerObject = EmberObject.create({
wasCalled() {
called++;
}
});
addObserver(ary, '@each.isDone', observerObject, 'wasCalled');
ary.addObject(EmberObject.create({
desc: 'foo',
isDone: false
}));
equal(called, 1, 'calls observer when object is pushed');
});
QUnit.test('using @each to observe arrays that does not return objects raise error', function() {
let called = 0;
let observerObject = EmberObject.create({
wasCalled() {
called++;
}
});
ary = TestArray.create({
objectAt(idx) {
return get(this._content[idx], 'desc');
}
});
addObserver(ary, '@each.isDone', observerObject, 'wasCalled');
expectAssertion(() => {
ary.addObject(EmberObject.create({
desc: 'foo',
isDone: false
}));
}, /When using @each to observe the array/);
equal(called, 0, 'not calls observer when object is pushed');
});
QUnit.test('modifying the array should also indicate the isDone prop itself has changed', function() {
// NOTE: we never actually get the '@each.isDone' property here. This is
// important because it tests the case where we don't have an isDone
// EachArray materialized but just want to know when the property has
// changed.
let each = get(ary, '@each');
let count = 0;
addObserver(each, 'isDone', () => count++);
count = 0;
let item = objectAt(ary, 2);
set(item, 'isDone', !get(item, 'isDone'));
equal(count, 1, '@each.isDone should have notified');
});
QUnit.test('`objectAt` returns correct object', function() {
let arr = ['first', 'second', 'third', 'fourth'];
equal(objectAt(arr, 2), 'third');
equal(objectAt(arr, 4), undefined);
});
testBoth('should be clear caches for computed properties that have dependent keys on arrays that are changed after object initialization', function(get, set) {
let obj = EmberObject.extend({
init() {
this._super(...arguments);
set(this, 'resources', emberA());
},
common: computed('resources.@each.common', function() {
return get(objectAt(get(this, 'resources'), 0), 'common');
})
}).create();
get(obj, 'resources').pushObject(EmberObject.create({ common: 'HI!' }));
equal('HI!', get(obj, 'common'));
set(objectAt(get(obj, 'resources'), 0), 'common', 'BYE!');
equal('BYE!', get(obj, 'common'));
});
testBoth('observers that contain @each in the path should fire only once the first time they are accessed', function(get, set) {
let count = 0;
let obj = EmberObject.extend({
init() {
this._super(...arguments);
// Observer does not fire on init
set(this, 'resources', emberA());
},
commonDidChange: emberObserver('resources.@each.common', () => count++)
}).create();
// Observer fires second time when new object is added
get(obj, 'resources').pushObject(EmberObject.create({ common: 'HI!' }));
// Observer fires third time when property on an object is changed
set(objectAt(get(obj, 'resources'), 0), 'common', 'BYE!');
equal(count, 2, 'observers should only be called once');
});
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _extends from "@babel/runtime/helpers/esm/extends";
const _excluded = ["children", "className", "max", "spacing", "variant"];
import * as React from 'react';
import PropTypes from 'prop-types';
import { isFragment } from 'react-is';
import clsx from 'clsx';
import { chainPropTypes } from '@material-ui/utils';
import { unstable_composeClasses as composeClasses } from '@material-ui/unstyled';
import styled from '../styles/styled';
import useThemeProps from '../styles/useThemeProps';
import Avatar from '../Avatar';
import avatarGroupClasses, { getAvatarGroupUtilityClass } from './avatarGroupClasses';
import { jsxs as _jsxs } from "react/jsx-runtime";
const SPACINGS = {
small: -16,
medium: null
};
const useUtilityClasses = styleProps => {
const {
classes
} = styleProps;
const slots = {
root: ['root'],
avatar: ['avatar']
};
return composeClasses(slots, getAvatarGroupUtilityClass, classes);
};
const AvatarGroupRoot = styled('div', {
name: 'MuiAvatarGroup',
slot: 'Root',
overridesResolver: (props, styles) => _extends({
[`& .${avatarGroupClasses.avatar}`]: styles.avatar
}, styles.root)
})(({
theme
}) => ({
[`& .MuiAvatar-root`]: {
border: `2px solid ${theme.palette.background.default}`,
boxSizing: 'content-box',
marginLeft: -8,
'&:last-child': {
marginLeft: 0
}
},
display: 'flex',
flexDirection: 'row-reverse'
}));
const AvatarGroupAvatar = styled(Avatar, {
name: 'MuiAvatarGroup',
slot: 'Avatar',
overridesResolver: (props, styles) => styles.avatar
})(({
theme
}) => ({
border: `2px solid ${theme.palette.background.default}`,
boxSizing: 'content-box',
marginLeft: -8,
'&:last-child': {
marginLeft: 0
}
}));
const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
const props = useThemeProps({
props: inProps,
name: 'MuiAvatarGroup'
});
const {
children: childrenProp,
className,
max = 5,
spacing = 'medium',
variant = 'circular'
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const clampedMax = max < 2 ? 2 : max;
const styleProps = _extends({}, props, {
max,
spacing,
variant
});
const classes = useUtilityClasses(styleProps);
const children = React.Children.toArray(childrenProp).filter(child => {
if (process.env.NODE_ENV !== 'production') {
if (isFragment(child)) {
console.error(["Material-UI: The AvatarGroup component doesn't accept a Fragment as a child.", 'Consider providing an array instead.'].join('\n'));
}
}
return /*#__PURE__*/React.isValidElement(child);
});
const extraAvatars = children.length > clampedMax ? children.length - clampedMax + 1 : 0;
const marginLeft = spacing && SPACINGS[spacing] !== undefined ? SPACINGS[spacing] : -spacing;
return /*#__PURE__*/_jsxs(AvatarGroupRoot, _extends({
styleProps: styleProps,
className: clsx(classes.root, className),
ref: ref
}, other, {
children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, {
styleProps: styleProps,
className: classes.avatar,
style: {
marginLeft
},
variant: variant,
children: ["+", extraAvatars]
}) : null, children.slice(0, children.length - extraAvatars).reverse().map(child => {
return /*#__PURE__*/React.cloneElement(child, {
className: clsx(child.props.className, classes.avatar),
style: _extends({
marginLeft
}, child.props.style),
variant: child.props.variant || variant
});
})]
}));
});
process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
/* remove-proptypes */
= {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* The avatars to stack.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
/**
* @ignore
*/
className: PropTypes.string,
/**
* Max avatars to show before +x.
* @default 5
*/
max: chainPropTypes(PropTypes.number, props => {
if (props.max < 2) {
return new Error(['Material-UI: The prop `max` should be equal to 2 or above.', 'A value below is clamped to 2.'].join('\n'));
}
return null;
}),
/**
* Spacing between avatars.
* @default 'medium'
*/
spacing: PropTypes.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.number]),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.object,
/**
* The variant to use.
* @default 'circular'
*/
variant: PropTypes
/* @typescript-to-proptypes-ignore */
.oneOfType([PropTypes.oneOf(['circular', 'rounded', 'square']), PropTypes.string])
} : void 0;
export default AvatarGroup;
|
module.exports={title:"Bamboo",slug:"bamboo",svg:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Bamboo icon</title><path d="M21.7142 13.6433h-4.9888a.651.651 0 00-.655.555 4.1139 4.1139 0 01-4.0619 3.5299l1.35 6.1728a10.3737 10.3737 0 009.0077-9.5447.651.651 0 00-.652-.713zm-8.6327-.158l7.1998-6.1718a.645.645 0 000-.984L13.0815.1597a.648.648 0 00-1.074.483v12.3426a.651.651 0 001.073.5zm-11.3547 1.505A10.3847 10.3847 0 0012.0115 24v-6.2698a4.0929 4.0929 0 01-4.0999-4.0869zm-.096-1.447v.1h6.2798a4.0929 4.0929 0 014.098-4.0879l-1.348-6.1698a10.3697 10.3697 0 00-9.0298 10.1577"/></svg>',get path(){return this.svg.match(/<path\s+d="([^"]*)/)[1]},source:"https://www.atlassian.design/guidelines/marketing/resources/logo-files",hex:"0052CC",license:void 0};
|
var Checker = require('../../../lib/checker');
var assert = require('assert');
describe('rules/disallow-left-sticked-operators', function() {
var checker;
beforeEach(function() {
checker = new Checker();
checker.registerDefaultRules();
checker.configure({ disallowLeftStickedOperators: ['+'] });
});
it('should output correct deprecation notice', function() {
var errors = checker.checkString('var a = b+ c; var a = b+ c;').getErrorList();
assert(errors.length === 1);
var error = errors[0];
assert(error.line === 1 && error.column === 0);
assert(error.message === 'The disallowLeftStickedOperators rule is no longer supported.' +
'\nPlease use the following rules instead:' +
'\n' +
'\nrequireSpaceBeforeBinaryOperators' +
'\nrequireSpaceBeforePostfixUnaryOperators' +
'\nrequireSpacesInConditionalExpression');
});
});
|
/**
* @author mrdoob / http://mrdoob.com/
*/
var Editor = function () {
var SIGNALS = signals;
this.signals = {
// player
startPlayer: new SIGNALS.Signal(),
stopPlayer: new SIGNALS.Signal(),
// actions
playAnimation: new SIGNALS.Signal(),
stopAnimation: new SIGNALS.Signal(),
showDialog: new SIGNALS.Signal(),
// notifications
savingStarted: new SIGNALS.Signal(),
savingFinished: new SIGNALS.Signal(),
themeChanged: new SIGNALS.Signal(),
transformModeChanged: new SIGNALS.Signal(),
snapChanged: new SIGNALS.Signal(),
spaceChanged: new SIGNALS.Signal(),
rendererChanged: new SIGNALS.Signal(),
sceneGraphChanged: new SIGNALS.Signal(),
cameraChanged: new SIGNALS.Signal(),
geometryChanged: new SIGNALS.Signal(),
objectSelected: new SIGNALS.Signal(),
objectFocused: new SIGNALS.Signal(),
objectAdded: new SIGNALS.Signal(),
objectChanged: new SIGNALS.Signal(),
objectRemoved: new SIGNALS.Signal(),
helperAdded: new SIGNALS.Signal(),
helperRemoved: new SIGNALS.Signal(),
materialChanged: new SIGNALS.Signal(),
fogTypeChanged: new SIGNALS.Signal(),
fogColorChanged: new SIGNALS.Signal(),
fogParametersChanged: new SIGNALS.Signal(),
windowResize: new SIGNALS.Signal(),
showGridChanged: new SIGNALS.Signal()
};
this.config = new Config();
this.storage = new Storage();
this.loader = new Loader( this );
this.camera = new THREE.PerspectiveCamera( 50, 1, 0.1, 100000 );
this.scene = new THREE.Scene();
this.scene.name = 'Scene';
this.sceneHelpers = new THREE.Scene();
this.object = {};
this.geometries = {};
this.materials = {};
this.textures = {};
// this.scripts = {};
this.selected = null;
this.helpers = {};
};
Editor.prototype = {
setTheme: function ( value ) {
document.getElementById( 'theme' ).href = value;
this.signals.themeChanged.dispatch( value );
},
showDialog: function ( value ) {
this.signals.showDialog.dispatch( value );
},
//
setScene: function ( scene ) {
this.scene.name = scene.name;
this.scene.userData = JSON.parse( JSON.stringify( scene.userData ) );
// avoid render per object
this.signals.sceneGraphChanged.active = false;
while ( scene.children.length > 0 ) {
this.addObject( scene.children[ 0 ] );
}
this.signals.sceneGraphChanged.active = true;
this.signals.sceneGraphChanged.dispatch();
},
//
addObject: function ( object ) {
var scope = this;
object.traverse( function ( child ) {
if ( child.geometry !== undefined ) scope.addGeometry( child.geometry );
if ( child.material !== undefined ) scope.addMaterial( child.material );
scope.addHelper( child );
} );
this.scene.add( object );
this.signals.objectAdded.dispatch( object );
this.signals.sceneGraphChanged.dispatch();
},
setObjectName: function ( object, name ) {
object.name = name;
this.signals.sceneGraphChanged.dispatch();
},
removeObject: function ( object ) {
if ( object.parent === undefined ) return; // avoid deleting the camera or scene
if ( confirm( 'Delete ' + object.name + '?' ) === false ) return;
var scope = this;
object.traverse( function ( child ) {
scope.removeHelper( child );
} );
object.parent.remove( object );
this.signals.objectRemoved.dispatch( object );
this.signals.sceneGraphChanged.dispatch();
},
addGeometry: function ( geometry ) {
this.geometries[ geometry.uuid ] = geometry;
},
setGeometryName: function ( geometry, name ) {
geometry.name = name;
this.signals.sceneGraphChanged.dispatch();
},
addMaterial: function ( material ) {
this.materials[ material.uuid ] = material;
},
setMaterialName: function ( material, name ) {
material.name = name;
this.signals.sceneGraphChanged.dispatch();
},
addTexture: function ( texture ) {
this.textures[ texture.uuid ] = texture;
},
//
addHelper: function () {
var geometry = new THREE.SphereGeometry( 20, 4, 2 );
var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
return function ( object ) {
var helper;
if ( object instanceof THREE.Camera ) {
helper = new THREE.CameraHelper( object, 10 );
} else if ( object instanceof THREE.PointLight ) {
helper = new THREE.PointLightHelper( object, 10 );
} else if ( object instanceof THREE.DirectionalLight ) {
helper = new THREE.DirectionalLightHelper( object, 20 );
} else if ( object instanceof THREE.SpotLight ) {
helper = new THREE.SpotLightHelper( object, 10 );
} else if ( object instanceof THREE.HemisphereLight ) {
helper = new THREE.HemisphereLightHelper( object, 10 );
} else if ( object instanceof THREE.SkinnedMesh ) {
helper = new THREE.SkeletonHelper( object );
} else {
// no helper for this object type
return;
}
var picker = new THREE.Mesh( geometry, material );
picker.name = 'picker';
picker.userData.object = object;
picker.visible = false;
helper.add( picker );
this.sceneHelpers.add( helper );
this.helpers[ object.id ] = helper;
this.signals.helperAdded.dispatch( helper );
};
}(),
removeHelper: function ( object ) {
if ( this.helpers[ object.id ] !== undefined ) {
var helper = this.helpers[ object.id ];
helper.parent.remove( helper );
delete this.helpers[ object.id ];
this.signals.helperRemoved.dispatch( helper );
}
},
//
parent: function ( object, parent ) {
if ( parent === undefined ) {
parent = this.scene;
}
parent.add( object );
this.signals.sceneGraphChanged.dispatch();
},
//
select: function ( object ) {
if ( this.selected === object ) return;
var uuid = null;
if ( object !== null ) {
uuid = object.uuid;
}
this.selected = object;
this.config.setKey( 'selected', uuid );
this.signals.objectSelected.dispatch( object );
},
selectById: function ( id ) {
this.select( this.scene.getObjectById( id, true ) );
},
selectByUuid: function ( uuid ) {
var scope = this;
this.scene.traverse( function ( child ) {
if ( child.uuid === uuid ) {
scope.select( child );
}
} );
},
deselect: function () {
this.select( null );
},
focus: function ( object ) {
this.signals.objectFocused.dispatch( object );
},
focusById: function ( id ) {
this.focus( this.scene.getObjectById( id, true ) );
}
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Operator uses GetValue
es5id: 11.13.2_A2.1_T1.8
description: >
Either Type is not Reference or GetBase is not null, check
opeartor is "x >>>= y"
---*/
//CHECK#1
var x = 4;
var z = (x >>>= 1);
if (z !== 2) {
$ERROR('#1: var x = 4; var z = (x >>>= 1); z === 2. Actual: ' + (z));
}
//CHECK#2
var x = 4;
var y = 1;
var z = (x >>>= y);
if (z !== 2) {
$ERROR('#2: var x = 4; var y = 1; var z = (x >>>= y); z === 2. Actual: ' + (z));
}
|
var db = require('level')('.cache')
var readdirp = require('readdirp')
var s3sync = require('./')
// To be updated with your own configuration
var syncer = s3sync(db, {
key: process.env.AWS_ACCESS_KEY
, secret: process.env.AWS_SECRET_KEY
, bucket: process.env.AWS_BUCKET
})
console.error('cache downloading...')
syncer.getCache(function(err) {
if (err) throw err
// It's important that this stream
// gets created in the same tick you
// pipe it to syncer.
var files = readdirp({
root: __dirname + '/node_modules'
})
console.error('cache downloaded!')
files.pipe(syncer)
.on('data', function(d) {
console.log(d.fullPath + ' -> ' + d.url)
})
.once('end', function() {
console.error('uploading new cache')
syncer.putCache(function(err) {
if (err) throw err
console.error('done!')
db.close()
})
})
})
|
/*
LumX v1.7.31
(c) 2014-2018 LumApps http://ui.lumapps.com
License: MIT
*/
(function()
{
'use strict';
angular.module('lumx.utils.depth', []);
angular.module('lumx.utils.event-scheduler', []);
angular.module('lumx.utils.transclude-replace', []);
angular.module('lumx.utils.utils', []);
angular.module('lumx.utils.directives', []);
angular.module('lumx.utils.filters', []);
angular.module('lumx.utils', [
'lumx.utils.depth',
'lumx.utils.event-scheduler',
'lumx.utils.transclude-replace',
'lumx.utils.utils',
'lumx.utils.directives',
'lumx.utils.filters',
]);
angular.module('lumx.button', []);
angular.module('lumx.checkbox', []);
angular.module('lumx.data-table', []);
angular.module('lumx.date-picker', []);
angular.module('lumx.dialog', ['lumx.utils.event-scheduler']);
angular.module('lumx.dropdown', ['lumx.utils.event-scheduler']);
angular.module('lumx.fab', []);
angular.module('lumx.file-input', []);
angular.module('lumx.icon', []);
angular.module('lumx.notification', ['lumx.utils.event-scheduler']);
angular.module('lumx.progress', []);
angular.module('lumx.radio-button', []);
angular.module('lumx.ripple', []);
angular.module('lumx.search-filter', []);
angular.module('lumx.select', []);
angular.module('lumx.stepper', []);
angular.module('lumx.switch', []);
angular.module('lumx.tabs', []);
angular.module('lumx.text-field', []);
angular.module('lumx.tooltip', []);
angular.module('lumx', [
'lumx.button',
'lumx.checkbox',
'lumx.data-table',
'lumx.date-picker',
'lumx.dialog',
'lumx.dropdown',
'lumx.fab',
'lumx.file-input',
'lumx.icon',
'lumx.notification',
'lumx.progress',
'lumx.radio-button',
'lumx.ripple',
'lumx.search-filter',
'lumx.select',
'lumx.stepper',
'lumx.switch',
'lumx.tabs',
'lumx.text-field',
'lumx.tooltip',
'lumx.utils'
]);
})();
(function()
{
'use strict';
angular
.module('lumx.utils.depth')
.service('LxDepthService', LxDepthService);
function LxDepthService()
{
var service = this;
var depth = 1000;
service.getDepth = getDepth;
service.register = register;
////////////
function getDepth()
{
return depth;
}
function register()
{
depth++;
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.utils.event-scheduler')
.service('LxEventSchedulerService', LxEventSchedulerService);
LxEventSchedulerService.$inject = ['$document', 'LxUtils'];
function LxEventSchedulerService($document, LxUtils)
{
var service = this;
var handlers = {};
var schedule = {};
service.register = register;
service.unregister = unregister;
////////////
function handle(event)
{
var scheduler = schedule[event.type];
if (angular.isDefined(scheduler))
{
for (var i = 0, length = scheduler.length; i < length; i++)
{
var handler = scheduler[i];
if (angular.isDefined(handler) && angular.isDefined(handler.callback) && angular.isFunction(handler.callback))
{
handler.callback(event);
if (event.isPropagationStopped())
{
break;
}
}
}
}
}
function register(eventName, callback)
{
var handler = {
eventName: eventName,
callback: callback
};
var id = LxUtils.generateUUID();
handlers[id] = handler;
if (angular.isUndefined(schedule[eventName]))
{
schedule[eventName] = [];
$document.on(eventName, handle);
}
schedule[eventName].unshift(handlers[id]);
return id;
}
function unregister(id)
{
var found = false;
var handler = handlers[id];
if (angular.isDefined(handler) && angular.isDefined(schedule[handler.eventName]))
{
var index = schedule[handler.eventName].indexOf(handler);
if (angular.isDefined(index) && index > -1)
{
schedule[handler.eventName].splice(index, 1);
delete handlers[id];
found = true;
}
if (schedule[handler.eventName].length === 0)
{
delete schedule[handler.eventName];
$document.off(handler.eventName, handle);
}
}
return found;
}
}
})();
/* eslint-disable angular/component-limit */
(function IIFE() {
'use strict';
/////////////////////////////
/**
* Highlights text in a string that matches another string.
*
* Taken from AngularUI Bootstrap Typeahead
* See https://github.com/angular-ui/bootstrap/blob/0.10.0/src/typeahead/typeahead.js#L340
*/
HighlightFilter.$inject = ['LxUtils'];
function HighlightFilter(LxUtils) {
return function highlightCode(matchItem, query, html) {
if (!html) {
return (query && matchItem) ?
matchItem.replace(
new RegExp(LxUtils.escapeRegexp(query), 'gi'),
'<span class="lx-select-choices__pane-choice--highlight">$&</span>'
) : matchItem;
}
var el = angular.element('<div>' + matchItem + '</div>');
if (el.children().length) {
angular.forEach(el.children(), function forEachNodes(node) {
if (node.nodeName !== 'SPAN') {
return;
}
var nodeEl = angular.element(node);
nodeEl.html(highlightCode(nodeEl.text(), query, false));
});
} else {
el.html(highlightCode(el.text(), query, false));
}
return el.html();
};
}
/////////////////////////////
/**
* Blocks the propagation of an event in the DOM.
*
* @param {string} stopPropagation The name of the event (or events) to be stopped.
* @return {Directive} The stop propagation directive.
*/
function StopPropagationDirective() {
return function stopPropagationCode(scope, el, attrs) {
el.on(attrs.lxStopPropagation, function stopPropagation(evt) {
evt.stopPropagation();
});
};
}
/////////////////////////////
/**
* Place here only small, highly re-usable directives.
* For a big complex directive, use a separate own file.
* For a directive specific to your application, place it in your application.
*/
angular.module('lumx.utils.directives')
.directive('lxStopPropagation', StopPropagationDirective);
angular.module('lumx.utils.filters')
.filter('lxHighlight', HighlightFilter);
})();
(function()
{
'use strict';
angular
.module('lumx.utils.transclude-replace')
.directive('ngTranscludeReplace', ngTranscludeReplace);
ngTranscludeReplace.$inject = ['$log'];
function ngTranscludeReplace($log)
{
return {
terminal: true,
restrict: 'EA',
link: link
};
function link(scope, element, attrs, ctrl, transclude)
{
if (!transclude)
{
$log.error('orphan',
'Illegal use of ngTranscludeReplace directive in the template! ' +
'No parent directive that requires a transclusion found. ');
return;
}
transclude(function(clone)
{
if (clone.length)
{
element.replaceWith(clone);
}
else
{
element.remove();
}
});
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.utils.utils')
.service('LxUtils', LxUtils);
function LxUtils()
{
var service = this;
var alreadyDisabledScroll = false;
service.debounce = debounce;
service.disableBodyScroll = disableBodyScroll;
service.escapeRegexp = escapeRegexp;
service.generateUUID = generateUUID;
////////////
// http://underscorejs.org/#debounce (1.8.3)
function debounce(func, wait, immediate)
{
var timeout, args, context, timestamp, result;
wait = wait || 500;
var later = function()
{
var last = Date.now() - timestamp;
if (last < wait && last >= 0)
{
timeout = setTimeout(later, wait - last);
}
else
{
timeout = null;
if (!immediate)
{
result = func.apply(context, args);
if (!timeout)
{
context = args = null;
}
}
}
};
var debounced = function()
{
context = this;
args = arguments;
timestamp = Date.now();
var callNow = immediate && !timeout;
if (!timeout)
{
timeout = setTimeout(later, wait);
}
if (callNow)
{
result = func.apply(context, args);
context = args = null;
}
return result;
};
debounced.clear = function()
{
clearTimeout(timeout);
timeout = context = args = null;
};
return debounced;
}
function disableBodyScroll()
{
var body = document.body;
var documentElement = document.documentElement;
if (!alreadyDisabledScroll) {
var prevDocumentStyle = documentElement.style.cssText || '';
var prevBodyStyle = body.style.cssText || '';
var viewportTop = (document.scrollingElement) ?
document.scrollingElement.scrollTop : window.scrollY || window.pageYOffset || body.scrollTop;
viewportTop = viewportTop || 0;
}
var clientWidth = body.clientWidth;
var hasVerticalScrollbar = body.scrollHeight > window.innerHeight + 1;
if (hasVerticalScrollbar)
{
angular.element('body').css({
overflow: 'hidden',
});
}
if (body.clientWidth < clientWidth)
{
body.style.overflow = 'hidden';
}
// This should be applied after the manipulation to the body, because
// adding a scrollbar can potentially resize it, causing the measurement
// to change.
if (hasVerticalScrollbar)
{
documentElement.style.overflowY = 'scroll';
}
// This attribution prevents this function to consider the css it sets
// to body and documents to be the 'previous' css attributes to recover.
alreadyDisabledScroll = true;
return function restoreScroll()
{
if (!alreadyDisabledScroll) {
return;
}
// Reset the inline style CSS to the previous.
body.style.cssText = prevBodyStyle;
documentElement.style.cssText = prevDocumentStyle;
// The body loses its scroll position while being fixed.
if (document.scrollingElement) {
document.scrollingElement.scrollTop = viewportTop;
} else {
body.scrollTop = viewportTop;
}
alreadyDisabledScroll = false;
};
}
/**
* Escape all RegExp special characters in a string.
*
* @param {string} strToEscape The string to escape RegExp special char in.
* @return {string} The escapes string.
*/
function escapeRegexp(strToEscape) {
return strToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
}
function generateUUID()
{
var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c)
{
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == 'x' ? r : (r & 0x3 | 0x8))
.toString(16);
});
return uuid.toUpperCase();
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.button')
.directive('lxButton', lxButton);
function lxButton()
{
var buttonClass;
return {
restrict: 'E',
templateUrl: getTemplateUrl,
compile: compile,
replace: true,
transclude: true
};
function compile(element, attrs)
{
setButtonStyle(element, attrs.lxSize, attrs.lxColor, attrs.lxType);
return function(scope, element, attrs)
{
attrs.$observe('lxSize', function(lxSize)
{
setButtonStyle(element, lxSize, attrs.lxColor, attrs.lxType);
});
attrs.$observe('lxColor', function(lxColor)
{
setButtonStyle(element, attrs.lxSize, lxColor, attrs.lxType);
});
attrs.$observe('lxType', function(lxType)
{
setButtonStyle(element, attrs.lxSize, attrs.lxColor, lxType);
});
element.on('click', function(event)
{
if (attrs.disabled === true)
{
event.preventDefault();
event.stopImmediatePropagation();
}
});
};
}
function getTemplateUrl(element, attrs)
{
return isAnchor(attrs) ? 'link.html' : 'button.html';
}
function isAnchor(attrs)
{
return angular.isDefined(attrs.href) || angular.isDefined(attrs.ngHref) || angular.isDefined(attrs.ngLink) || angular.isDefined(attrs.uiSref);
}
function setButtonStyle(element, size, color, type)
{
var buttonBase = 'btn';
var buttonSize = angular.isDefined(size) ? size : 'm';
var buttonColor = angular.isDefined(color) ? color : 'primary';
var buttonType = angular.isDefined(type) ? type : 'raised';
element.removeClass(buttonClass);
buttonClass = buttonBase + ' btn--' + buttonSize + ' btn--' + buttonColor + ' btn--' + buttonType;
element.addClass(buttonClass);
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.checkbox')
.directive('lxCheckbox', lxCheckbox)
.directive('lxCheckboxLabel', lxCheckboxLabel)
.directive('lxCheckboxHelp', lxCheckboxHelp);
function lxCheckbox()
{
return {
restrict: 'E',
templateUrl: 'checkbox.html',
scope:
{
lxColor: '@?',
name: '@?',
ngChange: '&?',
ngDisabled: '=?',
ngFalseValue: '@?',
ngModel: '=',
ngTrueValue: '@?',
lxTheme: '@?'
},
controller: LxCheckboxController,
controllerAs: 'lxCheckbox',
bindToController: true,
transclude: true,
replace: true
};
}
LxCheckboxController.$inject = ['$scope', '$timeout', 'LxUtils'];
function LxCheckboxController($scope, $timeout, LxUtils)
{
var lxCheckbox = this;
var checkboxId;
var checkboxHasChildren;
var timer;
lxCheckbox.getCheckboxId = getCheckboxId;
lxCheckbox.getCheckboxHasChildren = getCheckboxHasChildren;
lxCheckbox.setCheckboxId = setCheckboxId;
lxCheckbox.setCheckboxHasChildren = setCheckboxHasChildren;
lxCheckbox.triggerNgChange = triggerNgChange;
$scope.$on('$destroy', function()
{
$timeout.cancel(timer);
});
init();
////////////
function getCheckboxId()
{
return checkboxId;
}
function getCheckboxHasChildren()
{
return checkboxHasChildren;
}
function init()
{
setCheckboxId(LxUtils.generateUUID());
setCheckboxHasChildren(false);
lxCheckbox.ngTrueValue = angular.isUndefined(lxCheckbox.ngTrueValue) ? true : lxCheckbox.ngTrueValue;
lxCheckbox.ngFalseValue = angular.isUndefined(lxCheckbox.ngFalseValue) ? false : lxCheckbox.ngFalseValue;
lxCheckbox.lxColor = angular.isUndefined(lxCheckbox.lxColor) ? 'accent' : lxCheckbox.lxColor;
}
function setCheckboxId(_checkboxId)
{
checkboxId = _checkboxId;
}
function setCheckboxHasChildren(_checkboxHasChildren)
{
checkboxHasChildren = _checkboxHasChildren;
}
function triggerNgChange()
{
timer = $timeout(lxCheckbox.ngChange);
}
}
function lxCheckboxLabel()
{
return {
restrict: 'AE',
require: ['^lxCheckbox', '^lxCheckboxLabel'],
templateUrl: 'checkbox-label.html',
link: link,
controller: LxCheckboxLabelController,
controllerAs: 'lxCheckboxLabel',
bindToController: true,
transclude: true,
replace: true
};
function link(scope, element, attrs, ctrls)
{
ctrls[0].setCheckboxHasChildren(true);
ctrls[1].setCheckboxId(ctrls[0].getCheckboxId());
}
}
function LxCheckboxLabelController()
{
var lxCheckboxLabel = this;
var checkboxId;
lxCheckboxLabel.getCheckboxId = getCheckboxId;
lxCheckboxLabel.setCheckboxId = setCheckboxId;
////////////
function getCheckboxId()
{
return checkboxId;
}
function setCheckboxId(_checkboxId)
{
checkboxId = _checkboxId;
}
}
function lxCheckboxHelp()
{
return {
restrict: 'AE',
require: '^lxCheckbox',
templateUrl: 'checkbox-help.html',
transclude: true,
replace: true
};
}
})();
(function()
{
'use strict';
angular
.module('lumx.data-table')
.directive('lxDataTable', lxDataTable);
function lxDataTable()
{
return {
restrict: 'E',
templateUrl: 'data-table.html',
scope:
{
border: '=?lxBorder',
selectable: '=?lxSelectable',
thumbnail: '=?lxThumbnail',
tbody: '=lxTbody',
thead: '=lxThead'
},
link: link,
controller: LxDataTableController,
controllerAs: 'lxDataTable',
bindToController: true,
transclude: true,
replace: true
};
function link(scope, element, attrs, ctrl)
{
attrs.$observe('id', function(_newId)
{
ctrl.id = _newId;
});
}
}
LxDataTableController.$inject = ['$rootScope', '$sce', '$scope'];
function LxDataTableController($rootScope, $sce, $scope)
{
var lxDataTable = this;
lxDataTable.areAllRowsSelected = areAllRowsSelected;
lxDataTable.border = angular.isUndefined(lxDataTable.border) ? true : lxDataTable.border;
lxDataTable.sort = sort;
lxDataTable.toggle = toggle;
lxDataTable.toggleAllSelected = toggleAllSelected;
lxDataTable.$sce = $sce;
lxDataTable.allRowsSelected = false;
lxDataTable.selectedRows = [];
$scope.$on('lx-data-table__select', function(event, id, row)
{
if (id === lxDataTable.id && angular.isDefined(row))
{
if (angular.isArray(row) && row.length > 0)
{
row = row[0];
}
_select(row);
}
});
$scope.$on('lx-data-table__select-all', function(event, id)
{
if (id === lxDataTable.id)
{
_selectAll();
}
});
$scope.$on('lx-data-table__unselect', function(event, id, row)
{
if (id === lxDataTable.id && angular.isDefined(row))
{
if (angular.isArray(row) && row.length > 0)
{
row = row[0];
}
_unselect(row);
}
});
$scope.$on('lx-data-table__unselect-all', function(event, id)
{
if (id === lxDataTable.id)
{
_unselectAll();
}
});
////////////
function _selectAll()
{
lxDataTable.selectedRows.length = 0;
for (var i = 0, len = lxDataTable.tbody.length; i < len; i++)
{
if (!lxDataTable.tbody[i].lxDataTableDisabled)
{
lxDataTable.tbody[i].lxDataTableSelected = true;
lxDataTable.selectedRows.push(lxDataTable.tbody[i]);
}
}
lxDataTable.allRowsSelected = true;
$rootScope.$broadcast('lx-data-table__unselected', lxDataTable.id, lxDataTable.selectedRows);
}
function _select(row)
{
toggle(row, true);
}
function _unselectAll()
{
for (var i = 0, len = lxDataTable.tbody.length; i < len; i++)
{
if (!lxDataTable.tbody[i].lxDataTableDisabled)
{
lxDataTable.tbody[i].lxDataTableSelected = false;
}
}
lxDataTable.allRowsSelected = false;
lxDataTable.selectedRows.length = 0;
$rootScope.$broadcast('lx-data-table__selected', lxDataTable.id, lxDataTable.selectedRows);
}
function _unselect(row)
{
toggle(row, false);
}
////////////
function areAllRowsSelected()
{
var displayedRows = 0;
for (var i = 0, len = lxDataTable.tbody.length; i < len; i++)
{
if (!lxDataTable.tbody[i].lxDataTableDisabled)
{
displayedRows++;
}
}
if (displayedRows === lxDataTable.selectedRows.length)
{
lxDataTable.allRowsSelected = true;
}
else
{
lxDataTable.allRowsSelected = false;
}
}
function sort(_column)
{
if (!_column.sortable)
{
return;
}
for (var i = 0, len = lxDataTable.thead.length; i < len; i++)
{
if (lxDataTable.thead[i].sortable && lxDataTable.thead[i].name !== _column.name)
{
lxDataTable.thead[i].sort = undefined;
}
}
if (!_column.sort || _column.sort === 'desc')
{
_column.sort = 'asc';
}
else
{
_column.sort = 'desc';
}
$rootScope.$broadcast('lx-data-table__sorted', lxDataTable.id, _column);
}
function toggle(_row, _newSelectedStatus)
{
if (_row.lxDataTableDisabled || !lxDataTable.selectable)
{
return;
}
_row.lxDataTableSelected = angular.isDefined(_newSelectedStatus) ? _newSelectedStatus : !_row.lxDataTableSelected;
if (_row.lxDataTableSelected)
{
// Make sure it's not already in.
if (lxDataTable.selectedRows.length === 0 || (lxDataTable.selectedRows.length && lxDataTable.selectedRows.indexOf(_row) === -1))
{
lxDataTable.selectedRows.push(_row);
lxDataTable.areAllRowsSelected();
$rootScope.$broadcast('lx-data-table__selected', lxDataTable.id, lxDataTable.selectedRows, _row);
}
}
else
{
if (lxDataTable.selectedRows.length && lxDataTable.selectedRows.indexOf(_row) > -1)
{
lxDataTable.selectedRows.splice(lxDataTable.selectedRows.indexOf(_row), 1);
lxDataTable.allRowsSelected = false;
$rootScope.$broadcast('lx-data-table__unselected', lxDataTable.id, lxDataTable.selectedRows, _row);
}
}
}
function toggleAllSelected()
{
if (lxDataTable.allRowsSelected)
{
_unselectAll();
}
else
{
_selectAll();
}
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.data-table')
.service('LxDataTableService', LxDataTableService);
LxDataTableService.$inject = ['$rootScope'];
function LxDataTableService($rootScope)
{
var service = this;
service.select = select;
service.selectAll = selectAll;
service.unselect = unselect;
service.unselectAll = unselectAll;
////////////
function select(_dataTableId, row)
{
$rootScope.$broadcast('lx-data-table__select', _dataTableId, row);
}
function selectAll(_dataTableId)
{
$rootScope.$broadcast('lx-data-table__select-all', _dataTableId);
}
function unselect(_dataTableId, row)
{
$rootScope.$broadcast('lx-data-table__unselect', _dataTableId, row);
}
function unselectAll(_dataTableId)
{
$rootScope.$broadcast('lx-data-table__unselect-all', _dataTableId);
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.date-picker')
.directive('lxDatePicker', lxDatePicker);
lxDatePicker.$inject = ['LxDatePickerService', 'LxUtils'];
function lxDatePicker(LxDatePickerService, LxUtils)
{
return {
restrict: 'AE',
templateUrl: 'date-picker.html',
scope:
{
autoClose: '=?lxAutoClose',
callback: '&?lxCallback',
color: '@?lxColor',
escapeClose: '=?lxEscapeClose',
inputFormat: '@?lxInputFormat',
maxDate: '=?lxMaxDate',
ngModel: '=',
minDate: '=?lxMinDate',
locale: '@lxLocale'
},
link: link,
controller: LxDatePickerController,
controllerAs: 'lxDatePicker',
bindToController: true,
replace: true,
transclude: true
};
function link(scope, element, attrs)
{
if (angular.isDefined(attrs.id))
{
attrs.$observe('id', function(_newId)
{
scope.lxDatePicker.pickerId = _newId;
LxDatePickerService.registerScope(scope.lxDatePicker.pickerId, scope);
});
}
else
{
scope.lxDatePicker.pickerId = LxUtils.generateUUID();
LxDatePickerService.registerScope(scope.lxDatePicker.pickerId, scope);
}
}
}
LxDatePickerController.$inject = ['$element', '$scope', '$timeout', '$transclude', 'LxDatePickerService', 'LxUtils'];
function LxDatePickerController($element, $scope, $timeout, $transclude, LxDatePickerService, LxUtils)
{
var lxDatePicker = this;
var input;
var modelController;
var timer1;
var timer2;
var watcher1;
var watcher2;
lxDatePicker.closeDatePicker = closeDatePicker;
lxDatePicker.displayYearSelection = displayYearSelection;
lxDatePicker.hideYearSelection = hideYearSelection;
lxDatePicker.getDateFormatted = getDateFormatted;
lxDatePicker.nextMonth = nextMonth;
lxDatePicker.openDatePicker = openDatePicker;
lxDatePicker.previousMonth = previousMonth;
lxDatePicker.select = select;
lxDatePicker.selectYear = selectYear;
lxDatePicker.autoClose = angular.isDefined(lxDatePicker.autoClose) ? lxDatePicker.autoClose : true;
lxDatePicker.color = angular.isDefined(lxDatePicker.color) ? lxDatePicker.color : 'primary';
lxDatePicker.element = $element.find('.lx-date-picker');
lxDatePicker.escapeClose = angular.isDefined(lxDatePicker.escapeClose) ? lxDatePicker.escapeClose : true;
lxDatePicker.isOpen = false;
lxDatePicker.moment = moment;
lxDatePicker.yearSelection = false;
lxDatePicker.uuid = LxUtils.generateUUID();
$transclude(function(clone)
{
if (clone.length)
{
lxDatePicker.hasInput = true;
timer1 = $timeout(function()
{
input = $element.find('.lx-date-input input');
modelController = input.data('$ngModelController');
watcher2 = $scope.$watch(function()
{
return modelController.$viewValue;
}, function(newValue, oldValue)
{
if (angular.isUndefined(newValue))
{
lxDatePicker.ngModel = undefined;
}
});
});
}
});
watcher1 = $scope.$watch(function()
{
return lxDatePicker.ngModel;
}, init);
$scope.$on('$destroy', function()
{
$timeout.cancel(timer1);
$timeout.cancel(timer2);
if (angular.isFunction(watcher1))
{
watcher1();
}
if (angular.isFunction(watcher2))
{
watcher2();
}
});
////////////
function closeDatePicker()
{
LxDatePickerService.close(lxDatePicker.pickerId);
}
function displayYearSelection()
{
lxDatePicker.yearSelection = true;
timer2 = $timeout(function()
{
var yearSelector = angular.element('.lx-date-picker__year-selector');
var activeYear = yearSelector.find('.lx-date-picker__year--is-active');
yearSelector.scrollTop(yearSelector.scrollTop() + activeYear.position().top - yearSelector.height() / 2 + activeYear.height() / 2);
});
}
function hideYearSelection()
{
lxDatePicker.yearSelection = false;
}
function generateCalendar()
{
lxDatePicker.days = [];
var previousDay = angular.copy(lxDatePicker.ngModelMoment).date(0);
var firstDayOfMonth = angular.copy(lxDatePicker.ngModelMoment).date(1);
var lastDayOfMonth = firstDayOfMonth.clone().endOf('month');
var maxDays = lastDayOfMonth.date();
lxDatePicker.emptyFirstDays = [];
for (var i = firstDayOfMonth.day() === 0 ? 6 : firstDayOfMonth.day() - 1; i > 0; i--)
{
lxDatePicker.emptyFirstDays.push(
{});
}
for (var j = 0; j < maxDays; j++)
{
var date = angular.copy(previousDay.add(1, 'days'));
date.selected = angular.isDefined(lxDatePicker.ngModel) && date.isSame(lxDatePicker.ngModel, 'day');
date.today = date.isSame(moment(), 'day');
if (angular.isDefined(lxDatePicker.minDate))
{
var minDate = (angular.isString(lxDatePicker.minDate)) ? new Date(lxDatePicker.minDate) : lxDatePicker.minDate;
if (date.toDate() < minDate)
{
date.disabled = true;
}
}
if (angular.isDefined(lxDatePicker.maxDate))
{
var maxDate = (angular.isString(lxDatePicker.maxDate)) ? new Date(lxDatePicker.maxDate) : lxDatePicker.maxDate;
if (date.toDate() > maxDate)
{
date.disabled = true;
}
}
lxDatePicker.days.push(date);
}
lxDatePicker.emptyLastDays = [];
for (var k = 7 - (lastDayOfMonth.day() === 0 ? 7 : lastDayOfMonth.day()); k > 0; k--)
{
lxDatePicker.emptyLastDays.push(
{});
}
}
function getDateFormatted()
{
var dateFormatted = lxDatePicker.ngModelMoment.format('llll').replace(lxDatePicker.ngModelMoment.format('LT'), '').trim().replace(lxDatePicker.ngModelMoment.format('YYYY'), '').trim();
var dateFormattedLastChar = dateFormatted.slice(-1);
if (dateFormattedLastChar === ',')
{
dateFormatted = dateFormatted.slice(0, -1);
}
return dateFormatted;
}
function init()
{
moment.locale(lxDatePicker.locale);
lxDatePicker.ngModelMoment = angular.isDefined(lxDatePicker.ngModel) ? moment(angular.copy(lxDatePicker.ngModel)) : moment();
lxDatePicker.days = [];
lxDatePicker.daysOfWeek = [moment.weekdaysMin(1), moment.weekdaysMin(2), moment.weekdaysMin(3), moment.weekdaysMin(4), moment.weekdaysMin(5), moment.weekdaysMin(6), moment.weekdaysMin(0)];
lxDatePicker.years = [];
for (var y = moment().year() - 100; y <= moment().year() + 100; y++)
{
lxDatePicker.years.push(y);
}
generateCalendar();
}
function nextMonth()
{
lxDatePicker.ngModelMoment = lxDatePicker.ngModelMoment.add(1, 'month');
generateCalendar();
}
function openDatePicker()
{
LxDatePickerService.open(lxDatePicker.pickerId);
generateCalendar();
}
function previousMonth()
{
lxDatePicker.ngModelMoment = lxDatePicker.ngModelMoment.subtract(1, 'month');
generateCalendar();
}
function select(_day)
{
if (!_day.disabled)
{
lxDatePicker.ngModel = _day.toDate();
lxDatePicker.ngModelMoment = angular.copy(_day);
if (angular.isDefined(lxDatePicker.callback))
{
lxDatePicker.callback(
{
newDate: lxDatePicker.ngModel
});
}
if (angular.isDefined(modelController) && lxDatePicker.inputFormat)
{
modelController.$setViewValue(angular.copy(_day).format(lxDatePicker.inputFormat));
modelController.$render();
}
generateCalendar();
}
}
function selectYear(_year)
{
lxDatePicker.yearSelection = false;
lxDatePicker.ngModelMoment = lxDatePicker.ngModelMoment.year(_year);
generateCalendar();
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.date-picker')
.service('LxDatePickerService', LxDatePickerService);
LxDatePickerService.$inject = ['$rootScope', '$timeout', 'LxDepthService', 'LxEventSchedulerService'];
function LxDatePickerService($rootScope, $timeout, LxDepthService, LxEventSchedulerService)
{
var service = this;
var activeDatePickerId;
var datePickerFilter;
var idEventScheduler;
var scopeMap = {};
service.close = closeDatePicker;
service.open = openDatePicker;
service.registerScope = registerScope;
////////////
function closeDatePicker(_datePickerId)
{
if (angular.isDefined(idEventScheduler))
{
LxEventSchedulerService.unregister(idEventScheduler);
idEventScheduler = undefined;
}
activeDatePickerId = undefined;
$rootScope.$broadcast('lx-date-picker__close-start', _datePickerId);
datePickerFilter.removeClass('lx-date-picker-filter--is-shown');
scopeMap[_datePickerId].element.removeClass('lx-date-picker--is-shown');
$timeout(function()
{
angular.element('body').removeClass('no-scroll-date-picker-' + scopeMap[_datePickerId].uuid);
datePickerFilter.remove();
scopeMap[_datePickerId].element
.hide()
.appendTo(scopeMap[_datePickerId].elementParent);
scopeMap[_datePickerId].isOpen = false;
$rootScope.$broadcast('lx-date-picker__close-end', _datePickerId);
}, 600);
}
function onKeyUp(_event)
{
if (_event.keyCode == 27 && angular.isDefined(activeDatePickerId))
{
closeDatePicker(activeDatePickerId);
}
_event.stopPropagation();
}
function openDatePicker(_datePickerId)
{
LxDepthService.register();
activeDatePickerId = _datePickerId;
angular.element('body').addClass('no-scroll-date-picker-' + scopeMap[_datePickerId].uuid);
datePickerFilter = angular.element('<div/>',
{
class: 'lx-date-picker-filter'
});
datePickerFilter
.css('z-index', LxDepthService.getDepth())
.appendTo('body');
if (scopeMap[activeDatePickerId].autoClose)
{
datePickerFilter.on('click', function()
{
closeDatePicker(activeDatePickerId);
});
}
if (scopeMap[activeDatePickerId].escapeClose)
{
idEventScheduler = LxEventSchedulerService.register('keyup', onKeyUp);
}
scopeMap[activeDatePickerId].element
.css('z-index', LxDepthService.getDepth() + 1)
.appendTo('body')
.show();
$timeout(function()
{
$rootScope.$broadcast('lx-date-picker__open-start', activeDatePickerId);
scopeMap[activeDatePickerId].isOpen = true;
datePickerFilter.addClass('lx-date-picker-filter--is-shown');
scopeMap[activeDatePickerId].element.addClass('lx-date-picker--is-shown');
}, 100);
$timeout(function()
{
$rootScope.$broadcast('lx-date-picker__open-end', activeDatePickerId);
}, 700);
}
function registerScope(_datePickerId, _datePickerScope)
{
scopeMap[_datePickerId] = _datePickerScope.lxDatePicker;
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.dialog')
.directive('lxDialog', lxDialog)
.directive('lxDialogHeader', lxDialogHeader)
.directive('lxDialogContent', lxDialogContent)
.directive('lxDialogFooter', lxDialogFooter)
.directive('lxDialogClose', lxDialogClose);
function lxDialog()
{
return {
restrict: 'E',
template: '<div class="dialog" ng-class="{ \'dialog--l\': !lxDialog.size || lxDialog.size === \'l\', \'dialog--s\': lxDialog.size === \'s\', \'dialog--m\': lxDialog.size === \'m\' }"><div ng-if="lxDialog.isOpen" ng-transclude></div></div>',
scope:
{
autoClose: '=?lxAutoClose',
escapeClose: '=?lxEscapeClose',
size: '@?lxSize'
},
link: link,
controller: LxDialogController,
controllerAs: 'lxDialog',
bindToController: true,
replace: true,
transclude: true
};
function link(scope, element, attrs, ctrl)
{
attrs.$observe('id', function(_newId)
{
ctrl.id = _newId;
});
}
}
LxDialogController.$inject = ['$element', '$interval', '$rootScope', '$scope', '$timeout', '$window', 'LxDepthService', 'LxEventSchedulerService', 'LxUtils'];
function LxDialogController($element, $interval, $rootScope, $scope, $timeout, $window, LxDepthService, LxEventSchedulerService, LxUtils)
{
var lxDialog = this;
var dialogFilter = angular.element('<div/>',
{
class: 'dialog-filter'
});
var dialogHeight;
var dialogInterval;
var dialogScrollable;
var elementParent = $element.parent();
var idEventScheduler;
var resizeDebounce;
var windowHeight;
lxDialog.autoClose = angular.isDefined(lxDialog.autoClose) ? lxDialog.autoClose : true;
lxDialog.escapeClose = angular.isDefined(lxDialog.escapeClose) ? lxDialog.escapeClose : true;
lxDialog.isOpen = false;
lxDialog.uuid = LxUtils.generateUUID();
$scope.$on('lx-dialog__open', function(event, id, params)
{
if (id === lxDialog.id)
{
open(params);
}
});
$scope.$on('lx-dialog__close', function(event, id, canceled, params)
{
if (id === lxDialog.id || id === undefined)
{
close(canceled, params);
}
});
$scope.$on('$destroy', function()
{
close(true);
});
////////////
function checkDialogHeight()
{
var dialog = $element;
var dialogHeader = dialog.find('.dialog__header');
var dialogContent = dialog.find('.dialog__content');
var dialogFooter = dialog.find('.dialog__footer');
if (!dialogFooter.length)
{
dialogFooter = dialog.find('.dialog__actions');
}
if (angular.isUndefined(dialogHeader))
{
return;
}
var heightToCheck = 60 + dialogHeader.outerHeight() + dialogContent.outerHeight() + dialogFooter.outerHeight();
if (dialogHeight === heightToCheck && windowHeight === $window.innerHeight)
{
return;
}
dialogHeight = heightToCheck;
windowHeight = $window.innerHeight;
if (heightToCheck >= $window.innerHeight)
{
dialog.addClass('dialog--is-fixed');
dialogScrollable
.css(
{
top: dialogHeader.outerHeight(),
bottom: dialogFooter.outerHeight()
})
.off('scroll', checkScrollEnd)
.on('scroll', checkScrollEnd);
}
else
{
dialog.removeClass('dialog--is-fixed');
dialogScrollable
.removeAttr('style')
.off('scroll', checkScrollEnd);
}
}
function checkDialogHeightOnResize()
{
if (resizeDebounce)
{
$timeout.cancel(resizeDebounce);
}
resizeDebounce = $timeout(function()
{
checkDialogHeight();
}, 200);
}
function checkScrollEnd()
{
if (dialogScrollable.scrollTop() + dialogScrollable.innerHeight() >= dialogScrollable[0].scrollHeight)
{
$rootScope.$broadcast('lx-dialog__scroll-end', lxDialog.id);
dialogScrollable.off('scroll', checkScrollEnd);
$timeout(function()
{
dialogScrollable.on('scroll', checkScrollEnd);
}, 500);
}
}
function onKeyUp(_event)
{
if (_event.keyCode == 27)
{
close(true);
}
_event.stopPropagation();
}
function open(_params)
{
if (lxDialog.isOpen)
{
return;
}
LxDepthService.register();
angular.element('body').addClass('no-scroll-dialog-' + lxDialog.uuid);
dialogFilter
.css('z-index', LxDepthService.getDepth())
.appendTo('body');
if (lxDialog.autoClose)
{
dialogFilter.on('click', function()
{
close(true);
});
}
if (lxDialog.escapeClose)
{
idEventScheduler = LxEventSchedulerService.register('keyup', onKeyUp);
}
$element
.css('z-index', LxDepthService.getDepth() + 1)
.appendTo('body')
.show();
$timeout(function()
{
$rootScope.$broadcast('lx-dialog__open-start', lxDialog.id, _params);
lxDialog.isOpen = true;
dialogFilter.addClass('dialog-filter--is-shown');
$element.addClass('dialog--is-shown');
}, 100);
$timeout(function()
{
if ($element.find('.dialog__scrollable').length === 0)
{
$element.find('.dialog__content').wrap(angular.element('<div/>',
{
class: 'dialog__scrollable'
}));
}
dialogScrollable = $element.find('.dialog__scrollable');
}, 200);
$timeout(function()
{
$rootScope.$broadcast('lx-dialog__open-end', lxDialog.id, _params);
}, 700);
dialogInterval = $interval(function()
{
checkDialogHeight();
}, 500);
angular.element($window).on('resize', checkDialogHeightOnResize);
}
function close(_canceled, _params)
{
if (!lxDialog.isOpen)
{
return;
}
_params = _params || {};
if (angular.isDefined(idEventScheduler))
{
LxEventSchedulerService.unregister(idEventScheduler);
idEventScheduler = undefined;
}
angular.element($window).off('resize', checkDialogHeightOnResize);
$element.find('.dialog__scrollable').off('scroll', checkScrollEnd);
$rootScope.$broadcast('lx-dialog__close-start', lxDialog.id, _canceled, _params);
if (resizeDebounce)
{
$timeout.cancel(resizeDebounce);
}
$interval.cancel(dialogInterval);
dialogFilter.removeClass('dialog-filter--is-shown');
$element.removeClass('dialog--is-shown');
$timeout(function()
{
angular.element('body').removeClass('no-scroll-dialog-' + lxDialog.uuid);
dialogFilter.remove();
$element
.hide()
.removeClass('dialog--is-fixed')
.appendTo(elementParent);
lxDialog.isOpen = false;
dialogHeight = undefined;
$rootScope.$broadcast('lx-dialog__close-end', lxDialog.id, _canceled, _params);
}, 600);
}
}
function lxDialogHeader()
{
return {
restrict: 'E',
template: '<div class="dialog__header" ng-transclude></div>',
replace: true,
transclude: true
};
}
function lxDialogContent()
{
return {
restrict: 'E',
template: '<div class="dialog__scrollable"><div class="dialog__content" ng-transclude></div></div>',
replace: true,
transclude: true
};
}
function lxDialogFooter()
{
return {
restrict: 'E',
template: '<div class="dialog__footer" ng-transclude></div>',
replace: true,
transclude: true
};
}
lxDialogClose.$inject = ['LxDialogService'];
function lxDialogClose(LxDialogService)
{
return {
restrict: 'A',
link: function(scope, element)
{
element.on('click', function()
{
LxDialogService.close(element.parents('.dialog').attr('id'), true);
});
scope.$on('$destroy', function()
{
element.off();
});
}
};
}
})();
(function()
{
'use strict';
angular
.module('lumx.dialog')
.service('LxDialogService', LxDialogService);
LxDialogService.$inject = ['$rootScope'];
function LxDialogService($rootScope)
{
var service = this;
service.open = open;
service.close = close;
////////////
function open(_dialogId, _params)
{
$rootScope.$broadcast('lx-dialog__open', _dialogId, _params);
}
function close(_dialogId, _canceled, _params)
{
$rootScope.$broadcast('lx-dialog__close', _dialogId, _canceled, _params);
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.dropdown')
.directive('lxDropdown', lxDropdown)
.directive('lxDropdownToggle', lxDropdownToggle)
.directive('lxDropdownMenu', lxDropdownMenu)
.directive('lxDropdownFilter', lxDropdownFilter);
function lxDropdown()
{
return {
restrict: 'E',
templateUrl: 'dropdown.html',
scope:
{
closeOnClick: '=?lxCloseOnClick',
effect: '@?lxEffect',
escapeClose: '=?lxEscapeClose',
hover: '=?lxHover',
hoverDelay: '=?lxHoverDelay',
minOffset: '=?lxMinOffset',
offset: '@?lxOffset',
overToggle: '=?lxOverToggle',
position: '@?lxPosition',
width: '@?lxWidth'
},
link: link,
controller: LxDropdownController,
controllerAs: 'lxDropdown',
bindToController: true,
transclude: true
};
function link(scope, element, attrs, ctrl)
{
var backwardOneWay = ['position', 'width'];
var backwardTwoWay = ['escapeClose', 'overToggle'];
angular.forEach(backwardOneWay, function(attribute)
{
if (angular.isDefined(attrs[attribute]))
{
attrs.$observe(attribute, function(newValue)
{
scope.lxDropdown[attribute] = newValue;
});
}
});
angular.forEach(backwardTwoWay, function(attribute)
{
if (angular.isDefined(attrs[attribute]))
{
scope.$watch(function()
{
return scope.$parent.$eval(attrs[attribute]);
}, function(newValue)
{
scope.lxDropdown[attribute] = newValue;
});
}
});
attrs.$observe('id', function(_newId)
{
ctrl.uuid = _newId;
});
scope.$on('$destroy', function()
{
if (ctrl.isOpen)
{
ctrl.closeDropdownMenu();
}
});
}
}
LxDropdownController.$inject = ['$document', '$element', '$interval', '$rootScope', '$scope', '$timeout', '$window',
'LxDepthService', 'LxDropdownService', 'LxEventSchedulerService', 'LxUtils'
];
function LxDropdownController($document, $element, $interval, $rootScope, $scope, $timeout, $window, LxDepthService,
LxDropdownService, LxEventSchedulerService, LxUtils)
{
var lxDropdown = this;
var dropdownContentWatcher;
var dropdownMenu;
var dropdownToggle;
var idEventScheduler;
var openTimeout;
var positionTarget;
var scrollMask = angular.element('<div/>',
{
class: 'scroll-mask'
});
var enableBodyScroll;
lxDropdown.closeDropdownMenu = closeDropdownMenu;
lxDropdown.openDropdownMenu = openDropdownMenu;
lxDropdown.registerDropdownMenu = registerDropdownMenu;
lxDropdown.registerDropdownToggle = registerDropdownToggle;
lxDropdown.toggle = toggle;
lxDropdown.uuid = LxUtils.generateUUID();
lxDropdown.closeOnClick = angular.isDefined(lxDropdown.closeOnClick) ? lxDropdown.closeOnClick : true;
lxDropdown.effect = angular.isDefined(lxDropdown.effect) ? lxDropdown.effect : 'expand';
lxDropdown.escapeClose = angular.isDefined(lxDropdown.escapeClose) ? lxDropdown.escapeClose : true;
lxDropdown.hasToggle = false;
lxDropdown.isOpen = false;
lxDropdown.overToggle = angular.isDefined(lxDropdown.overToggle) ? lxDropdown.overToggle : false;
lxDropdown.position = angular.isDefined(lxDropdown.position) ? lxDropdown.position : 'left';
lxDropdown.minOffset = (angular.isUndefined(lxDropdown.minOffset) || lxDropdown.minOffset < 0) ? 8 : lxDropdown.minOffset;
$scope.$on('lx-dropdown__open', function(_event, _params)
{
if (_params.uuid === lxDropdown.uuid && !lxDropdown.isOpen)
{
LxDropdownService.closeActiveDropdown();
LxDropdownService.registerActiveDropdownUuid(lxDropdown.uuid);
positionTarget = _params.target;
registerDropdownToggle(positionTarget);
openDropdownMenu();
}
});
$scope.$on('lx-dropdown__close', function(_event, _params)
{
if (_params.uuid === lxDropdown.uuid && lxDropdown.isOpen && (!_params.documentClick || (_params.documentClick && lxDropdown.closeOnClick)))
{
closeDropdownMenu();
}
});
$scope.$on('$destroy', function()
{
$timeout.cancel(openTimeout);
});
////////////
function closeDropdownMenu()
{
$document.off('click touchend', onDocumentClick);
$rootScope.$broadcast('lx-dropdown__close-start', $element.attr('id'));
angular.element(window).off('resize', initDropdownPosition);
if (angular.isFunction(dropdownContentWatcher)) {
dropdownContentWatcher();
dropdownContentWatcher = undefined;
}
LxDropdownService.resetActiveDropdownUuid();
var velocityProperties;
var velocityEasing;
if (scrollMask) {
scrollMask.remove();
}
if (angular.isFunction(enableBodyScroll)) {
enableBodyScroll();
}
enableBodyScroll = undefined;
var dropdownToggleElement;
if (lxDropdown.hasToggle)
{
dropdownToggleElement = (angular.isString(dropdownToggle)) ? angular.element(dropdownToggle) : dropdownToggle;
dropdownToggleElement
.off('wheel')
.css('z-index', '');
}
dropdownMenu
.css(
{
overflow: 'hidden'
});
if (lxDropdown.effect === 'expand')
{
velocityProperties = {
width: 0,
height: 0
};
velocityEasing = 'easeOutQuint';
}
else if (lxDropdown.effect === 'fade')
{
velocityProperties = {
opacity: 0
};
velocityEasing = 'linear';
}
if (lxDropdown.effect === 'expand' || lxDropdown.effect === 'fade')
{
dropdownMenu.velocity(velocityProperties,
{
duration: 200,
easing: velocityEasing,
complete: function()
{
dropdownMenu
.removeAttr('style')
.removeClass('dropdown-menu--is-open')
.appendTo($element.find('.dropdown'));
$scope.$apply(function()
{
lxDropdown.isOpen = false;
if (lxDropdown.escapeClose)
{
LxEventSchedulerService.unregister(idEventScheduler);
idEventScheduler = undefined;
}
});
}
});
}
else if (lxDropdown.effect === 'none')
{
dropdownMenu
.removeAttr('style')
.removeClass('dropdown-menu--is-open')
.appendTo($element.find('.dropdown'));
lxDropdown.isOpen = false;
if (lxDropdown.escapeClose)
{
LxEventSchedulerService.unregister(idEventScheduler);
idEventScheduler = undefined;
}
}
$rootScope.$broadcast('lx-dropdown__close-end', $element.attr('id'));
}
function getAvailableHeight()
{
var availableHeightOnTop;
var availableHeightOnBottom;
var direction;
var dropdownToggleElement = (angular.isString(dropdownToggle)) ? angular.element(dropdownToggle) : dropdownToggle;
var dropdownToggleHeight = dropdownToggleElement.outerHeight();
var dropdownToggleTop = dropdownToggleElement.offset().top - angular.element($window).scrollTop();
var windowHeight = $window.innerHeight;
if (lxDropdown.overToggle)
{
availableHeightOnTop = dropdownToggleTop + dropdownToggleHeight;
availableHeightOnBottom = windowHeight - dropdownToggleTop;
}
else
{
availableHeightOnTop = dropdownToggleTop;
availableHeightOnBottom = windowHeight - (dropdownToggleTop + dropdownToggleHeight);
}
if (availableHeightOnTop > availableHeightOnBottom)
{
direction = 'top';
}
else
{
direction = 'bottom';
}
return {
top: availableHeightOnTop,
bottom: availableHeightOnBottom,
direction: direction
};
}
function initDropdownPosition()
{
var availableHeight = getAvailableHeight();
var dropdownMenuWidth;
var dropdownMenuLeft;
var dropdownMenuRight;
var dropdownToggleElement = (angular.isString(dropdownToggle)) ? angular.element(dropdownToggle) : dropdownToggle;
var dropdownToggleWidth = dropdownToggleElement.outerWidth();
var dropdownToggleHeight = dropdownToggleElement.outerHeight();
var dropdownToggleTop = dropdownToggleElement.offset().top - angular.element($window).scrollTop();
var windowWidth = $window.innerWidth;
var windowHeight = $window.innerHeight;
var cssProperties = {};
if (angular.isDefined(lxDropdown.width))
{
if (lxDropdown.width.indexOf('%') > -1)
{
dropdownMenuWidth = dropdownToggleWidth * (lxDropdown.width.slice(0, -1) / 100);
angular.extend(cssProperties,
{
minWidth: dropdownMenuWidth,
});
}
else
{
dropdownMenuWidth = lxDropdown.width;
angular.extend(cssProperties,
{
width: dropdownMenuWidth,
});
}
}
else
{
dropdownMenuWidth = 'auto';
angular.extend(cssProperties,
{
width: dropdownMenuWidth,
});
}
if (lxDropdown.position === 'left')
{
dropdownMenuLeft = dropdownToggleElement.offset().left;
dropdownMenuLeft = (dropdownMenuLeft <= lxDropdown.minOffset) ? lxDropdown.minOffset : dropdownMenuLeft;
dropdownMenuRight = 'auto';
}
else if (lxDropdown.position === 'right')
{
dropdownMenuLeft = 'auto';
dropdownMenuRight = windowWidth - dropdownToggleElement.offset().left - dropdownToggleWidth;
dropdownMenuRight = (dropdownMenuRight > (windowWidth - lxDropdown.minOffset)) ? (windowWidth - lxDropdown.minOffset) : dropdownMenuRight;
}
else if (lxDropdown.position === 'center')
{
dropdownMenuLeft = (dropdownToggleElement.offset().left + (dropdownToggleWidth / 2)) - (dropdownMenuWidth / 2);
dropdownMenuLeft = (dropdownMenuLeft <= lxDropdown.minOffset) ? lxDropdown.minOffset : dropdownMenuLeft;
dropdownMenuRight = 'auto';
}
angular.extend(cssProperties,
{
left: dropdownMenuLeft,
right: dropdownMenuRight,
});
dropdownMenu.css(cssProperties);
if (availableHeight.direction === 'top')
{
dropdownMenu.css(
{
bottom: lxDropdown.overToggle ? (windowHeight - dropdownToggleTop - dropdownToggleHeight) : (windowHeight - dropdownToggleTop + ~~lxDropdown.offset)
});
return availableHeight.top;
}
else if (availableHeight.direction === 'bottom')
{
dropdownMenu.css(
{
top: lxDropdown.overToggle ? dropdownToggleTop : (dropdownToggleTop + dropdownToggleHeight + ~~lxDropdown.offset)
});
return availableHeight.bottom;
}
}
function onDocumentClick() {
$timeout(function nextDigest() {
LxDropdownService.close(lxDropdown.uuid, true);
})
}
function openDropdownMenu()
{
$document.on('click touchend', onDocumentClick);
$document.on('touchmove', function onTouchMove(evt) {
$document.off('touchend', onDocumentClick);
});
$rootScope.$broadcast('lx-dropdown__open-start', $element.attr('id'));
lxDropdown.isOpen = true;
LxDepthService.register();
scrollMask.css('z-index', LxDepthService.getDepth()).appendTo('body');
// An action outside the dropdown triggers the close function.
scrollMask.on('click wheel touchmove ontouchstart', closeDropdownMenu);
angular.element(window).on('resize', initDropdownPosition);
enableBodyScroll = LxUtils.disableBodyScroll();
var dropdownToggleElement;
if (lxDropdown.hasToggle)
{
dropdownToggleElement = (angular.isString(dropdownToggle)) ? angular.element(dropdownToggle) : dropdownToggle;
dropdownToggleElement
.css('z-index', LxDepthService.getDepth() + 1)
.on('wheel', function preventDefault(e) {
e.preventDefault();
});
}
dropdownMenu
.addClass('dropdown-menu--is-open')
.css('z-index', LxDepthService.getDepth() + 1)
.appendTo('body');
if (lxDropdown.escapeClose)
{
idEventScheduler = LxEventSchedulerService.register('keyup', onKeyUp);
}
openTimeout = $timeout(function()
{
var availableHeight = initDropdownPosition() - ~~lxDropdown.offset;
var dropdownMenuHeight = dropdownMenu.outerHeight();
var dropdownMenuWidth = dropdownMenu.outerWidth();
var enoughHeight = true;
if (availableHeight < dropdownMenuHeight)
{
enoughHeight = false;
dropdownMenuHeight = availableHeight;
}
/*
* Watch for any changes in the dropdown content.
* Each time the content of the dropdown changes, recompute its height to be sure to stay inside of the
* viewport (and make it scrollable when it overflows).
*/
dropdownContentWatcher = $scope.$watch(function watcherDropdownContent() {
return dropdownMenu.find('.dropdown-menu__content').html();
}, function watchDropdownContent(newValue, oldValue) {
if (newValue === oldValue) {
return;
}
updateDropdownMenuHeight();
});
if (lxDropdown.effect === 'expand')
{
dropdownMenu.css(
{
width: 0,
height: 0,
opacity: 1,
overflow: 'hidden'
});
dropdownMenu.find('.dropdown-menu__content').css(
{
width: dropdownMenuWidth,
height: dropdownMenuHeight
});
dropdownMenu.velocity(
{
width: dropdownMenuWidth
},
{
duration: 200,
easing: 'easeOutQuint',
queue: false
});
dropdownMenu.velocity(
{
height: dropdownMenuHeight
},
{
duration: 500,
easing: 'easeOutQuint',
queue: false,
complete: function()
{
dropdownMenu.css(
{
overflow: 'auto'
});
if (angular.isUndefined(lxDropdown.width))
{
dropdownMenu.css(
{
width: 'auto'
});
}
$timeout(updateDropdownMenuHeight);
dropdownMenu.find('.dropdown-menu__content').removeAttr('style');
}
});
}
else if (lxDropdown.effect === 'fade')
{
dropdownMenu.css(
{
height: dropdownMenuHeight
});
dropdownMenu.velocity(
{
opacity: 1,
},
{
duration: 200,
easing: 'linear',
queue: false,
complete: function()
{
$timeout(updateDropdownMenuHeight);
}
});
}
else if (lxDropdown.effect === 'none')
{
dropdownMenu.css(
{
opacity: 1
});
$timeout(updateDropdownMenuHeight);
}
$rootScope.$broadcast('lx-dropdown__open-end', $element.attr('id'));
});
}
function onKeyUp(_event)
{
if (_event.keyCode == 27)
{
closeDropdownMenu();
}
_event.stopPropagation();
}
function registerDropdownMenu(_dropdownMenu)
{
dropdownMenu = _dropdownMenu;
}
function registerDropdownToggle(_dropdownToggle)
{
if (!positionTarget)
{
lxDropdown.hasToggle = true;
}
dropdownToggle = _dropdownToggle;
}
function toggle()
{
if (!lxDropdown.isOpen)
{
openDropdownMenu();
}
else
{
closeDropdownMenu();
}
}
/**
* Update the height of the dropdown.
* If the content is too large to fit in the remaining size of the screen (to the top or the bottom), then make
* it scrollable.
* This function is called everytime the content inside of the dropdown changes.
*/
function updateDropdownMenuHeight() {
if (positionTarget) {
registerDropdownToggle(angular.element(positionTarget));
}
if (!angular.element(dropdownToggle).is(':visible')) {
return;
}
var availableHeight = getAvailableHeight();
var scrollPosition = dropdownMenu.scrollTop();
dropdownMenu.css({
height: 'auto',
});
dropdownMenu.css(availableHeight.direction, 'auto');
var dropdownMenuHeight = dropdownMenu.find('.dropdown-menu__content').outerHeight();
if ((availableHeight[availableHeight.direction] - ~~lxDropdown.offset) <= dropdownMenuHeight) {
if (availableHeight.direction === 'top') {
dropdownMenu.css({
top: 0,
});
} else if (availableHeight.direction === 'bottom') {
dropdownMenu.css({
bottom: 0,
});
}
} else {
if (availableHeight.direction === 'top') {
dropdownMenu.css({
top: 'auto',
});
} else if (availableHeight.direction === 'bottom') {
dropdownMenu.css({
bottom: 'auto',
});
}
}
dropdownMenu.scrollTop(scrollPosition);
}
}
lxDropdownToggle.$inject = ['$timeout', '$window', 'LxDropdownService'];
function lxDropdownToggle($timeout, $window, LxDropdownService)
{
return {
restrict: 'AE',
templateUrl: 'dropdown-toggle.html',
require: '^lxDropdown',
scope: true,
link: link,
replace: true,
transclude: true
};
function link(scope, element, attrs, ctrl)
{
var hoverTimeout = [];
var mouseEvent = ctrl.hover ? 'mouseenter' : 'click';
ctrl.registerDropdownToggle(element);
element.on(mouseEvent, function(_event)
{
// If we are in mobile, ignore the mouseenter event for hovering detection
if (mouseEvent === 'mouseenter' && ('ontouchstart' in window && angular.element($window).outerWidth() <= 480)) {
return;
}
if (!ctrl.hover)
{
_event.stopPropagation();
}
LxDropdownService.closeActiveDropdown();
LxDropdownService.registerActiveDropdownUuid(ctrl.uuid);
if (ctrl.hover)
{
ctrl.mouseOnToggle = true;
if (!ctrl.isOpen)
{
hoverTimeout[0] = $timeout(function()
{
scope.$apply(function()
{
ctrl.openDropdownMenu();
});
}, ctrl.hoverDelay);
}
}
else
{
scope.$apply(function()
{
ctrl.toggle();
});
}
});
if (ctrl.hover)
{
element.on('mouseleave', function()
{
ctrl.mouseOnToggle = false;
$timeout.cancel(hoverTimeout[0]);
hoverTimeout[1] = $timeout(function()
{
if (!ctrl.mouseOnMenu)
{
scope.$apply(function()
{
ctrl.closeDropdownMenu();
});
}
}, ctrl.hoverDelay);
});
}
scope.$on('$destroy', function()
{
element.off();
if (ctrl.hover)
{
$timeout.cancel(hoverTimeout[0]);
$timeout.cancel(hoverTimeout[1]);
}
});
}
}
lxDropdownMenu.$inject = ['$timeout'];
function lxDropdownMenu($timeout)
{
return {
restrict: 'E',
templateUrl: 'dropdown-menu.html',
require: ['lxDropdownMenu', '^lxDropdown'],
scope: true,
link: link,
controller: LxDropdownMenuController,
controllerAs: 'lxDropdownMenu',
bindToController: true,
replace: true,
transclude: true
};
function link(scope, element, attrs, ctrls)
{
var hoverTimeout;
ctrls[1].registerDropdownMenu(element);
ctrls[0].setParentController(ctrls[1]);
if (ctrls[1].hover)
{
element.on('mouseenter', function()
{
ctrls[1].mouseOnMenu = true;
});
element.on('mouseleave', function()
{
ctrls[1].mouseOnMenu = false;
hoverTimeout = $timeout(function()
{
if (!ctrls[1].mouseOnToggle)
{
scope.$apply(function()
{
ctrls[1].closeDropdownMenu();
});
}
}, ctrls[1].hoverDelay);
});
}
scope.$on('$destroy', function()
{
if (ctrls[1].hover)
{
element.off();
$timeout.cancel(hoverTimeout);
}
});
}
}
LxDropdownMenuController.$inject = ['$element'];
function LxDropdownMenuController($element)
{
var lxDropdownMenu = this;
lxDropdownMenu.setParentController = setParentController;
////////////
function setParentController(_parentCtrl)
{
lxDropdownMenu.parentCtrl = _parentCtrl;
}
}
lxDropdownFilter.$inject = ['$timeout'];
function lxDropdownFilter($timeout)
{
return {
restrict: 'A',
link: link
};
function link(scope, element)
{
var focusTimeout;
element.on('click', function(_event)
{
_event.stopPropagation();
});
focusTimeout = $timeout(function()
{
element.find('input').focus();
}, 200);
scope.$on('$destroy', function()
{
$timeout.cancel(focusTimeout);
element.off();
});
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.dropdown')
.service('LxDropdownService', LxDropdownService);
LxDropdownService.$inject = ['$document', '$rootScope'];
function LxDropdownService($document, $rootScope)
{
var service = this;
var activeDropdownUuid;
service.close = close;
service.closeActiveDropdown = closeActiveDropdown;
service.open = open;
service.isOpen = isOpen;
service.registerActiveDropdownUuid = registerActiveDropdownUuid;
service.resetActiveDropdownUuid = resetActiveDropdownUuid;
////////////
function close(_uuid, isDocumentClick)
{
isDocumentClick = isDocumentClick || false;
$rootScope.$broadcast('lx-dropdown__close',
{
documentClick: isDocumentClick,
uuid: _uuid
});
}
function closeActiveDropdown()
{
if (angular.isDefined(activeDropdownUuid) && activeDropdownUuid.length > 0) {
$rootScope.$broadcast('lx-dropdown__close',
{
documentClick: true,
uuid: activeDropdownUuid
});
}
}
function open(_uuid, _target)
{
$rootScope.$broadcast('lx-dropdown__open',
{
uuid: _uuid,
target: _target
});
}
function isOpen(_uuid)
{
return activeDropdownUuid === _uuid;
}
function registerActiveDropdownUuid(_uuid)
{
activeDropdownUuid = _uuid;
}
function resetActiveDropdownUuid()
{
activeDropdownUuid = undefined;
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.fab')
.directive('lxFab', lxFab)
.directive('lxFabTrigger', lxFabTrigger)
.directive('lxFabActions', lxFabActions);
function lxFab()
{
return {
restrict: 'E',
templateUrl: 'fab.html',
scope: true,
link: link,
controller: LxFabController,
controllerAs: 'lxFab',
bindToController: true,
transclude: true,
replace: true
};
function link(scope, element, attrs, ctrl)
{
attrs.$observe('lxDirection', function(newDirection)
{
ctrl.setFabDirection(newDirection);
});
attrs.$observe('lxTriggerOnClick', function(isTriggeredOnClick)
{
ctrl.setFabTriggerMethod(scope.$eval(isTriggeredOnClick));
});
}
}
function LxFabController()
{
var lxFab = this;
lxFab.setFabDirection = setFabDirection;
lxFab.setFabTriggerMethod = setFabTriggerMethod;
lxFab.toggleState = toggleState;
lxFab.isOpen = false;
////////////
function setFabDirection(_direction)
{
lxFab.lxDirection = _direction;
}
function setFabTriggerMethod(_isTriggeredOnClick)
{
lxFab.lxTriggerOnClick = _isTriggeredOnClick;
}
function toggleState()
{
if (lxFab.lxTriggerOnClick)
{
lxFab.isOpen = !lxFab.isOpen;
}
}
}
function lxFabTrigger()
{
return {
restrict: 'E',
require: '^lxFab',
templateUrl: 'fab-trigger.html',
transclude: true,
replace: true
};
}
function lxFabActions()
{
return {
restrict: 'E',
require: '^lxFab',
templateUrl: 'fab-actions.html',
link: link,
transclude: true,
replace: true
};
function link(scope, element, attrs, ctrl)
{
scope.parentCtrl = ctrl;
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.file-input')
.directive('lxFileInput', lxFileInput);
function lxFileInput()
{
return {
restrict: 'E',
templateUrl: 'file-input.html',
scope:
{
label: '@lxLabel',
accept: '@lxAccept',
callback: '&?lxCallback'
},
link: link,
controller: LxFileInputController,
controllerAs: 'lxFileInput',
bindToController: true,
replace: true
};
function link(scope, element, attrs, ctrl)
{
var input = element.find('input');
input
.on('change', ctrl.updateModel)
.on('blur', function()
{
element.removeClass('input-file--is-focus');
});
scope.$on('$destroy', function()
{
input.off();
});
}
}
LxFileInputController.$inject = ['$element', '$scope', '$timeout'];
function LxFileInputController($element, $scope, $timeout)
{
var lxFileInput = this;
var input = $element.find('input');
var timer;
lxFileInput.updateModel = updateModel;
$scope.$on('$destroy', function()
{
$timeout.cancel(timer);
});
////////////
function setFileName()
{
if (input.val())
{
lxFileInput.fileName = input.val().replace(/C:\\fakepath\\/i, '');
$element.addClass('input-file--is-focus');
$element.addClass('input-file--is-active');
}
else
{
lxFileInput.fileName = undefined;
$element.removeClass('input-file--is-active');
}
input.val(undefined);
}
function updateModel()
{
if (angular.isDefined(lxFileInput.callback))
{
lxFileInput.callback(
{
newFile: input[0].files[0]
});
}
timer = $timeout(setFileName);
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.icon')
.directive('lxIcon', lxIcon);
function lxIcon()
{
return {
restrict: 'E',
templateUrl: 'icon.html',
scope:
{
color: '@?lxColor',
id: '@lxId',
size: '@?lxSize',
type: '@?lxType'
},
controller: LxIconController,
controllerAs: 'lxIcon',
bindToController: true,
replace: true
};
}
function LxIconController()
{
var lxIcon = this;
lxIcon.getClass = getClass;
////////////
function getClass()
{
var iconClass = [];
iconClass.push('mdi-' + lxIcon.id);
if (angular.isDefined(lxIcon.size))
{
iconClass.push('icon--' + lxIcon.size);
}
if (angular.isDefined(lxIcon.color))
{
iconClass.push('icon--' + lxIcon.color);
}
if (angular.isDefined(lxIcon.type))
{
iconClass.push('icon--' + lxIcon.type);
}
return iconClass;
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.notification')
.service('LxNotificationService', LxNotificationService);
LxNotificationService.$inject = ['$injector', '$rootScope', '$timeout', 'LxDepthService', 'LxEventSchedulerService'];
function LxNotificationService($injector, $rootScope, $timeout, LxDepthService, LxEventSchedulerService)
{
var service = this;
var dialogFilter;
var dialog;
var idEventScheduler;
var notificationList = [];
var actionClicked = false;
service.alert = showAlertDialog;
service.confirm = showConfirmDialog;
service.error = notifyError;
service.info = notifyInfo;
service.notify = notify;
service.success = notifySuccess;
service.warning = notifyWarning;
service.getNotificationList = getNotificationList;
service.reComputeElementsPosition = reComputeElementsPosition;
service.deleteNotification = deleteNotification;
service.buildNotification = buildNotification;
////////////
//
// NOTIFICATION
//
function getElementHeight(_elem)
{
return parseFloat(window.getComputedStyle(_elem, null).height);
}
function moveNotificationUp()
{
var newNotifIndex = notificationList.length - 1;
notificationList[newNotifIndex].height = getElementHeight(notificationList[newNotifIndex].elem[0]);
var upOffset = 0;
for (var idx = newNotifIndex; idx >= 0; idx--)
{
if (notificationList.length > 1 && idx !== newNotifIndex)
{
upOffset = 24 + notificationList[newNotifIndex].height;
notificationList[idx].margin += upOffset;
notificationList[idx].elem.css('marginBottom', notificationList[idx].margin + 'px');
}
}
}
function deleteNotification(_notification, _callback)
{
_callback = (!angular.isFunction(_callback)) ? angular.noop : _callback;
var notifIndex = notificationList.indexOf(_notification);
var dnOffset = angular.isDefined(notificationList[notifIndex]) ? 24 + notificationList[notifIndex].height : 24;
for (var idx = 0; idx < notifIndex; idx++)
{
if (notificationList.length > 1)
{
notificationList[idx].margin -= dnOffset;
notificationList[idx].elem.css('marginBottom', notificationList[idx].margin + 'px');
}
}
_notification.elem.removeClass('notification--is-shown');
$timeout(function()
{
_notification.elem.remove();
// Find index again because notificationList may have changed
notifIndex = notificationList.indexOf(_notification);
if (notifIndex != -1)
{
notificationList.splice(notifIndex, 1);
}
_callback(actionClicked);
actionClicked = false;
}, 400);
}
/**
* Compute the notification list element new position.
* Usefull when the height change programmatically and you need other notifications to fit.
*/
function reComputeElementsPosition()
{
var baseOffset = 0;
for (var idx = notificationList.length -1; idx >= 0; idx--)
{
notificationList[idx].height = getElementHeight(notificationList[idx].elem[0]);
notificationList[idx].margin = baseOffset;
notificationList[idx].elem.css('marginBottom', notificationList[idx].margin + 'px');
baseOffset += notificationList[idx].height + 24;
}
}
function buildNotification(_text, _icon, _color, _action)
{
var notification = angular.element('<div/>',
{
class: 'notification'
});
var notificationText = angular.element('<span/>',
{
class: 'notification__content',
html: _text
});
if (angular.isDefined(_icon))
{
var notificationIcon = angular.element('<i/>',
{
class: 'notification__icon mdi mdi-' + _icon
});
notification
.addClass('notification--has-icon')
.append(notificationIcon);
}
if (angular.isDefined(_color))
{
notification.addClass('notification--' + _color);
}
notification.append(notificationText);
if (angular.isDefined(_action))
{
var $compile = $injector.get('$compile');
var notificationAction = angular.element('<button/>',
{
class: 'notification__action btn btn--m btn--flat',
html: _action
});
if (angular.isDefined(_color))
{
notificationAction.addClass('btn--' + _color);
}
else
{
notificationAction.addClass('btn--white');
}
notificationAction.attr('lx-ripple', '');
$compile(notificationAction)($rootScope);
notificationAction.bind('click', function()
{
actionClicked = true;
});
notification
.addClass('notification--has-action')
.append(notificationAction);
}
return notification;
}
function notify(_text, _icon, _sticky, _color, _action, _callback, _delay)
{
/*jshint ignore:start*/
// Use of `this` for override purpose.
var notification = this.buildNotification(_text, _icon, _color, _action);
/*jshint ignore:end*/
var notificationTimeout;
var notificationDelay = _delay || 6000;
LxDepthService.register();
notification
.css('z-index', LxDepthService.getDepth())
.appendTo('body');
$timeout(function()
{
notification.addClass('notification--is-shown');
}, 100);
var data = {
elem: notification,
margin: 0
};
notificationList.push(data);
moveNotificationUp();
notification.bind('click', function()
{
actionClicked = true;
deleteNotification(data, _callback);
if (angular.isDefined(notificationTimeout))
{
$timeout.cancel(notificationTimeout);
}
});
if (angular.isUndefined(_sticky) || !_sticky)
{
notificationTimeout = $timeout(function()
{
deleteNotification(data, _callback);
}, notificationDelay);
}
}
function notifyError(_text, _sticky)
{
service.notify(_text, 'alert-circle', _sticky, 'red');
}
function notifyInfo(_text, _sticky)
{
service.notify(_text, 'information-outline', _sticky, 'blue');
}
function notifySuccess(_text, _sticky)
{
service.notify(_text, 'check', _sticky, 'green');
}
function notifyWarning(_text, _sticky)
{
service.notify(_text, 'alert', _sticky, 'orange');
}
//
// ALERT & CONFIRM
//
function buildDialogActions(_buttons, _callback, _unbind)
{
var $compile = $injector.get('$compile');
var dialogActions = angular.element('<div/>',
{
class: 'dialog__footer'
});
var dialogLastBtn = angular.element('<button/>',
{
class: 'btn btn--m btn--blue btn--flat',
text: _buttons.ok
});
if (angular.isDefined(_buttons.cancel))
{
var dialogFirstBtn = angular.element('<button/>',
{
class: 'btn btn--m btn--red btn--flat',
text: _buttons.cancel
});
dialogFirstBtn.attr('lx-ripple', '');
$compile(dialogFirstBtn)($rootScope);
dialogActions.append(dialogFirstBtn);
dialogFirstBtn.bind('click', function()
{
_callback(false);
closeDialog();
});
}
dialogLastBtn.attr('lx-ripple', '');
$compile(dialogLastBtn)($rootScope);
dialogActions.append(dialogLastBtn);
dialogLastBtn.bind('click', function()
{
_callback(true);
closeDialog();
});
if (!_unbind)
{
idEventScheduler = LxEventSchedulerService.register('keyup', function(event)
{
if (event.keyCode == 13)
{
_callback(true);
closeDialog();
}
else if (event.keyCode == 27)
{
_callback(angular.isUndefined(_buttons.cancel));
closeDialog();
}
event.stopPropagation();
});
}
return dialogActions;
}
function buildDialogContent(_text)
{
var dialogContent = angular.element('<div/>',
{
class: 'dialog__content p++ pt0 tc-black-2',
text: _text
});
return dialogContent;
}
function buildDialogHeader(_title)
{
var dialogHeader = angular.element('<div/>',
{
class: 'dialog__header p++ fs-title',
text: _title
});
return dialogHeader;
}
function closeDialog()
{
if (angular.isDefined(idEventScheduler))
{
$timeout(function()
{
LxEventSchedulerService.unregister(idEventScheduler);
idEventScheduler = undefined;
}, 1);
}
dialogFilter.removeClass('dialog-filter--is-shown');
dialog.removeClass('dialog--is-shown');
$timeout(function()
{
dialogFilter.remove();
dialog.remove();
}, 600);
}
function showAlertDialog(_title, _text, _button, _callback, _unbind)
{
LxDepthService.register();
dialogFilter = angular.element('<div/>',
{
class: 'dialog-filter'
});
dialog = angular.element('<div/>',
{
class: 'dialog dialog--alert'
});
var dialogHeader = buildDialogHeader(_title);
var dialogContent = buildDialogContent(_text);
var dialogActions = buildDialogActions(
{
ok: _button
}, _callback, _unbind);
dialogFilter
.css('z-index', LxDepthService.getDepth())
.appendTo('body');
dialog
.append(dialogHeader)
.append(dialogContent)
.append(dialogActions)
.css('z-index', LxDepthService.getDepth() + 1)
.appendTo('body')
.show()
.focus();
$timeout(function()
{
angular.element(document.activeElement).blur();
dialogFilter.addClass('dialog-filter--is-shown');
dialog.addClass('dialog--is-shown');
}, 100);
}
function showConfirmDialog(_title, _text, _buttons, _callback, _unbind)
{
LxDepthService.register();
dialogFilter = angular.element('<div/>',
{
class: 'dialog-filter'
});
dialog = angular.element('<div/>',
{
class: 'dialog dialog--alert'
});
var dialogHeader = buildDialogHeader(_title);
var dialogContent = buildDialogContent(_text);
var dialogActions = buildDialogActions(_buttons, _callback, _unbind);
dialogFilter
.css('z-index', LxDepthService.getDepth())
.appendTo('body');
dialog
.append(dialogHeader)
.append(dialogContent)
.append(dialogActions)
.css('z-index', LxDepthService.getDepth() + 1)
.appendTo('body')
.show()
.focus();
$timeout(function()
{
angular.element(document.activeElement).blur();
dialogFilter.addClass('dialog-filter--is-shown');
dialog.addClass('dialog--is-shown');
}, 100);
}
function getNotificationList()
{
// Return a copy of the notification list.
return notificationList.slice();
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.progress')
.directive('lxProgress', lxProgress);
function lxProgress()
{
return {
restrict: 'E',
templateUrl: 'progress.html',
scope:
{
lxColor: '@?',
lxDiameter: '@?',
lxType: '@',
lxValue: '@'
},
controller: LxProgressController,
controllerAs: 'lxProgress',
bindToController: true,
replace: true
};
}
function LxProgressController()
{
var lxProgress = this;
lxProgress.getCircularProgressValue = getCircularProgressValue;
lxProgress.getLinearProgressValue = getLinearProgressValue;
lxProgress.getProgressDiameter = getProgressDiameter;
////////////
function getCircularProgressValue()
{
if (angular.isDefined(lxProgress.lxValue))
{
return {
'stroke-dasharray': lxProgress.lxValue * 1.26 + ',200'
};
}
}
function getLinearProgressValue()
{
if (angular.isDefined(lxProgress.lxValue))
{
return {
'transform': 'scale(' + lxProgress.lxValue / 100 + ', 1)'
};
}
}
function getProgressDiameter()
{
if (lxProgress.lxType === 'circular')
{
return {
'transform': 'scale(' + parseInt(lxProgress.lxDiameter) / 100 + ')'
};
}
return;
}
function init()
{
lxProgress.lxDiameter = angular.isDefined(lxProgress.lxDiameter) ? lxProgress.lxDiameter : 100;
lxProgress.lxColor = angular.isDefined(lxProgress.lxColor) ? lxProgress.lxColor : 'primary';
lxProgress.lxClass = angular.isDefined(lxProgress.lxValue) ? 'progress-container--determinate' : 'progress-container--indeterminate';
}
this.$onInit = init;
}
})();
(function()
{
'use strict';
angular
.module('lumx.radio-button')
.directive('lxRadioGroup', lxRadioGroup)
.directive('lxRadioButton', lxRadioButton)
.directive('lxRadioButtonLabel', lxRadioButtonLabel)
.directive('lxRadioButtonHelp', lxRadioButtonHelp);
function lxRadioGroup()
{
return {
restrict: 'E',
templateUrl: 'radio-group.html',
transclude: true,
replace: true
};
}
function lxRadioButton()
{
return {
restrict: 'E',
templateUrl: 'radio-button.html',
scope:
{
lxColor: '@?',
name: '@',
ngChange: '&?',
ngDisabled: '=?',
ngModel: '=',
ngValue: '=?',
value: '@?',
lxTheme: '@?'
},
controller: LxRadioButtonController,
controllerAs: 'lxRadioButton',
bindToController: true,
transclude: true,
link: function (scope, el, attrs, ctrl) {
ctrl.init();
},
replace: true
};
}
LxRadioButtonController.$inject = ['$scope', '$timeout', 'LxUtils'];
function LxRadioButtonController($scope, $timeout, LxUtils)
{
var lxRadioButton = this;
var radioButtonId;
var radioButtonHasChildren;
var timer;
lxRadioButton.getRadioButtonId = getRadioButtonId;
lxRadioButton.getRadioButtonHasChildren = getRadioButtonHasChildren;
lxRadioButton.setRadioButtonId = setRadioButtonId;
lxRadioButton.setRadioButtonHasChildren = setRadioButtonHasChildren;
lxRadioButton.triggerNgChange = triggerNgChange;
lxRadioButton.init = init;
$scope.$on('$destroy', function()
{
$timeout.cancel(timer);
});
////////////
function getRadioButtonId()
{
return radioButtonId;
}
function getRadioButtonHasChildren()
{
return radioButtonHasChildren;
}
function init()
{
setRadioButtonId(LxUtils.generateUUID());
setRadioButtonHasChildren(false);
if (angular.isDefined(lxRadioButton.value) && angular.isUndefined(lxRadioButton.ngValue))
{
lxRadioButton.ngValue = lxRadioButton.value;
}
lxRadioButton.lxColor = angular.isUndefined(lxRadioButton.lxColor) ? 'accent' : lxRadioButton.lxColor;
}
function setRadioButtonId(_radioButtonId)
{
radioButtonId = _radioButtonId;
}
function setRadioButtonHasChildren(_radioButtonHasChildren)
{
radioButtonHasChildren = _radioButtonHasChildren;
}
function triggerNgChange()
{
timer = $timeout(lxRadioButton.ngChange);
}
}
function lxRadioButtonLabel()
{
return {
restrict: 'AE',
require: ['^lxRadioButton', '^lxRadioButtonLabel'],
templateUrl: 'radio-button-label.html',
link: link,
controller: LxRadioButtonLabelController,
controllerAs: 'lxRadioButtonLabel',
bindToController: true,
transclude: true,
replace: true
};
function link(scope, element, attrs, ctrls)
{
ctrls[0].setRadioButtonHasChildren(true);
ctrls[1].setRadioButtonId(ctrls[0].getRadioButtonId());
}
}
function LxRadioButtonLabelController()
{
var lxRadioButtonLabel = this;
var radioButtonId;
lxRadioButtonLabel.getRadioButtonId = getRadioButtonId;
lxRadioButtonLabel.setRadioButtonId = setRadioButtonId;
////////////
function getRadioButtonId()
{
return radioButtonId;
}
function setRadioButtonId(_radioButtonId)
{
radioButtonId = _radioButtonId;
}
}
function lxRadioButtonHelp()
{
return {
restrict: 'AE',
require: '^lxRadioButton',
templateUrl: 'radio-button-help.html',
transclude: true,
replace: true
};
}
})();
(function()
{
'use strict';
angular
.module('lumx.ripple')
.directive('lxRipple', lxRipple);
lxRipple.$inject = ['$timeout'];
function lxRipple($timeout)
{
return {
restrict: 'A',
link: link,
};
function link(scope, element, attrs)
{
var timer;
element
.css(
{
position: 'relative',
overflow: 'hidden'
})
.on('mousedown', function(e)
{
var ripple;
if (element.find('.ripple').length === 0)
{
ripple = angular.element('<span/>',
{
class: 'ripple'
});
if (attrs.lxRipple)
{
ripple.addClass('bgc-' + attrs.lxRipple);
}
element.prepend(ripple);
}
else
{
ripple = element.find('.ripple');
}
ripple.removeClass('ripple--is-animated');
if (!ripple.height() && !ripple.width())
{
var diameter = Math.max(element.outerWidth(), element.outerHeight());
ripple.css(
{
height: diameter,
width: diameter
});
}
var x = e.pageX - element.offset().left - ripple.width() / 2;
var y = e.pageY - element.offset().top - ripple.height() / 2;
ripple.css(
{
top: y + 'px',
left: x + 'px'
}).addClass('ripple--is-animated');
timer = $timeout(function()
{
ripple.removeClass('ripple--is-animated');
}, 651);
});
scope.$on('$destroy', function()
{
$timeout.cancel(timer);
element.off();
});
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.search-filter')
.filter('lxSearchHighlight', lxSearchHighlight)
.directive('lxSearchFilter', lxSearchFilter);
lxSearchHighlight.$inject = ['$sce'];
function lxSearchHighlight($sce)
{
function escapeRegexp(queryToEscape)
{
return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
}
return function (matchItem, query, icon)
{
var string = '';
if (icon)
{
string += '<i class="mdi mdi-' + icon + '"></i>';
}
string += query && matchItem ? matchItem.replace(new RegExp(escapeRegexp(query), 'gi'), '<strong>$&</strong>') : matchItem;
return $sce.trustAsHtml(string);
};
}
function lxSearchFilter()
{
return {
restrict: 'E',
templateUrl: 'search-filter.html',
scope:
{
autocomplete: '&?lxAutocomplete',
closed: '=?lxClosed',
color: '@?lxColor',
icon: '@?lxIcon',
onInit: '&?lxOnInit',
onSelect: '=?lxOnSelect',
searchOnFocus: '=?lxSearchOnFocus',
theme: '@?lxTheme',
width: '@?lxWidth'
},
link: link,
controller: LxSearchFilterController,
controllerAs: 'lxSearchFilter',
bindToController: true,
replace: true,
transclude: true
};
function link(scope, element, attrs, ctrl, transclude)
{
var input;
attrs.$observe('lxWidth', function(newWidth)
{
if (angular.isDefined(scope.lxSearchFilter.closed) && scope.lxSearchFilter.closed)
{
element.find('.search-filter__container').css('width', newWidth);
}
});
transclude(function()
{
input = element.find('input');
ctrl.setInput(input);
ctrl.setModel(input.data('$ngModelController'));
input.on('focus', ctrl.focusInput);
input.on('blur', ctrl.blurInput);
input.on('keydown', ctrl.keyEvent);
});
scope.$on('$destroy', function()
{
input.off();
});
if (angular.isDefined(scope.lxSearchFilter.onInit)) {
scope.lxSearchFilter.onInit()(scope.lxSearchFilter.dropdownId);
}
}
}
LxSearchFilterController.$inject = ['$element', '$scope', '$timeout', 'LxDropdownService', 'LxNotificationService', 'LxUtils'];
function LxSearchFilterController($element, $scope, $timeout, LxDropdownService, LxNotificationService, LxUtils)
{
var lxSearchFilter = this;
var debouncedAutocomplete;
var input;
var itemSelected = false;
lxSearchFilter.blurInput = blurInput;
lxSearchFilter.clearInput = clearInput;
lxSearchFilter.focusInput = focusInput;
lxSearchFilter.getClass = getClass;
lxSearchFilter.keyEvent = keyEvent;
lxSearchFilter.openInput = openInput;
lxSearchFilter.selectItem = selectItem;
lxSearchFilter.setInput = setInput;
lxSearchFilter.setModel = setModel;
lxSearchFilter.activeChoiceIndex = -1;
lxSearchFilter.color = angular.isDefined(lxSearchFilter.color) ? lxSearchFilter.color : 'black';
lxSearchFilter.dropdownId = LxUtils.generateUUID();
lxSearchFilter.theme = angular.isDefined(lxSearchFilter.theme) ? lxSearchFilter.theme : 'light';
////////////
function blurInput()
{
if (angular.isDefined(lxSearchFilter.closed) && lxSearchFilter.closed && !input.val())
{
$element.velocity(
{
width: 40
},
{
duration: 400,
easing: 'easeOutQuint',
queue: false
});
}
if (!input.val())
{
$timeout(function() {
lxSearchFilter.modelController.$setViewValue(undefined);
}, 500);
}
}
function clearInput()
{
lxSearchFilter.modelController.$setViewValue(undefined);
lxSearchFilter.modelController.$render();
// Temporarily disabling search on focus since we never want to trigger it when clearing the input.
var searchOnFocus = lxSearchFilter.searchOnFocus;
lxSearchFilter.searchOnFocus = false;
input.focus();
lxSearchFilter.searchOnFocus = searchOnFocus;
}
function focusInput()
{
if (!lxSearchFilter.searchOnFocus)
{
return;
}
updateAutocomplete(lxSearchFilter.modelController.$viewValue, true);
}
function getClass()
{
var searchFilterClass = [];
if (angular.isUndefined(lxSearchFilter.closed) || !lxSearchFilter.closed)
{
searchFilterClass.push('search-filter--opened-mode');
}
if (angular.isDefined(lxSearchFilter.closed) && lxSearchFilter.closed)
{
searchFilterClass.push('search-filter--closed-mode');
}
if (input.val())
{
searchFilterClass.push('search-filter--has-clear-button');
}
if (angular.isDefined(lxSearchFilter.color))
{
searchFilterClass.push('search-filter--' + lxSearchFilter.color);
}
if (angular.isDefined(lxSearchFilter.theme))
{
searchFilterClass.push('search-filter--theme-' + lxSearchFilter.theme);
}
if (angular.isFunction(lxSearchFilter.autocomplete))
{
searchFilterClass.push('search-filter--autocomplete');
}
if (LxDropdownService.isOpen(lxSearchFilter.dropdownId))
{
searchFilterClass.push('search-filter--is-open');
}
return searchFilterClass;
}
function keyEvent(_event)
{
if (!angular.isFunction(lxSearchFilter.autocomplete))
{
return;
}
if (!LxDropdownService.isOpen(lxSearchFilter.dropdownId))
{
lxSearchFilter.activeChoiceIndex = -1;
}
switch (_event.keyCode) {
case 13:
keySelect();
if (lxSearchFilter.activeChoiceIndex > -1)
{
_event.preventDefault();
}
break;
case 38:
keyUp();
_event.preventDefault();
break;
case 40:
keyDown();
_event.preventDefault();
break;
}
$scope.$apply();
}
function keyDown()
{
if (lxSearchFilter.autocompleteList.length)
{
lxSearchFilter.activeChoiceIndex += 1;
if (lxSearchFilter.activeChoiceIndex >= lxSearchFilter.autocompleteList.length)
{
lxSearchFilter.activeChoiceIndex = 0;
}
}
}
function keySelect()
{
if (!lxSearchFilter.autocompleteList || lxSearchFilter.activeChoiceIndex === -1)
{
return;
}
selectItem(lxSearchFilter.autocompleteList[lxSearchFilter.activeChoiceIndex]);
}
function keyUp()
{
if (lxSearchFilter.autocompleteList.length)
{
lxSearchFilter.activeChoiceIndex -= 1;
if (lxSearchFilter.activeChoiceIndex < 0)
{
lxSearchFilter.activeChoiceIndex = lxSearchFilter.autocompleteList.length - 1;
}
}
}
function openDropdown()
{
LxDropdownService.open(lxSearchFilter.dropdownId, $element);
}
function closeDropdown()
{
LxDropdownService.close(lxSearchFilter.dropdownId);
}
function onAutocompleteSuccess(autocompleteList)
{
lxSearchFilter.autocompleteList = autocompleteList;
(lxSearchFilter.autocompleteList.length) ? openDropdown() : closeDropdown();
lxSearchFilter.isLoading = false;
}
function onAutocompleteError(error)
{
LxNotificationService.error(error);
lxSearchFilter.isLoading = false;
}
function openInput()
{
if (angular.isDefined(lxSearchFilter.closed) && lxSearchFilter.closed)
{
$element.velocity(
{
width: angular.isDefined(lxSearchFilter.width) ? parseInt(lxSearchFilter.width) : 240
},
{
duration: 400,
easing: 'easeOutQuint',
queue: false,
complete: function()
{
input.focus();
}
});
}
else
{
input.focus();
}
}
function selectItem(_item)
{
itemSelected = true;
closeDropdown();
lxSearchFilter.modelController.$setViewValue(_item);
lxSearchFilter.modelController.$render();
if (angular.isFunction(lxSearchFilter.onSelect))
{
lxSearchFilter.onSelect(_item);
}
}
function setInput(_input)
{
input = _input;
}
function setModel(_modelController)
{
lxSearchFilter.modelController = _modelController;
if (angular.isFunction(lxSearchFilter.autocomplete) && angular.isFunction(lxSearchFilter.autocomplete()))
{
debouncedAutocomplete = LxUtils.debounce(function()
{
lxSearchFilter.isLoading = true;
(lxSearchFilter.autocomplete()).apply(this, arguments);
}, 500);
lxSearchFilter.modelController.$parsers.push(updateAutocomplete);
}
}
function updateAutocomplete(_newValue, _immediate)
{
if ((_newValue || (angular.isUndefined(_newValue) && lxSearchFilter.searchOnFocus)) && !itemSelected)
{
if (_immediate)
{
lxSearchFilter.isLoading = true;
(lxSearchFilter.autocomplete())(_newValue, onAutocompleteSuccess, onAutocompleteError);
}
else
{
debouncedAutocomplete(_newValue, onAutocompleteSuccess, onAutocompleteError);
}
}
else
{
debouncedAutocomplete.clear();
closeDropdown();
}
itemSelected = false;
return _newValue;
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.select')
.filter('filterChoices', filterChoices)
.directive('lxSelect', lxSelect)
.directive('lxSelectSelected', lxSelectSelected)
.directive('lxSelectChoices', lxSelectChoices);
filterChoices.$inject = ['$filter'];
function filterChoices($filter)
{
return function(choices, externalFilter, textFilter)
{
if (externalFilter)
{
return choices;
}
var toFilter = [];
if (!angular.isArray(choices))
{
if (angular.isObject(choices))
{
for (var idx in choices)
{
if (angular.isArray(choices[idx]))
{
toFilter = toFilter.concat(choices[idx]);
}
}
}
}
else
{
toFilter = choices;
}
return $filter('filter')(toFilter, textFilter);
};
}
function lxSelect()
{
return {
restrict: 'E',
templateUrl: 'select.html',
scope:
{
allowClear: '=?lxAllowClear',
allowNewValue: '=?lxAllowNewValue',
autocomplete: '=?lxAutocomplete',
newValueTransform: '=?lxNewValueTransform',
choices: '=?lxChoices',
choicesCustomStyle: '=?lxChoicesCustomStyle',
choicesViewMode: '@?lxChoicesViewMode',
customStyle: '=?lxCustomStyle',
displayFilter: '=?lxDisplayFilter',
error: '=?lxError',
filter: '&?lxFilter',
filterFields: '=?lxFilterFields',
fixedLabel: '=?lxFixedLabel',
helper: '=?lxHelper',
helperMessage: '@?lxHelperMessage',
label: '@?lxLabel',
loading: '=?lxLoading',
modelToSelection: '&?lxModelToSelection',
multiple: '=?lxMultiple',
ngChange: '&?',
ngDisabled: '=?',
ngModel: '=',
selectionToModel: '&?lxSelectionToModel',
theme: '@?lxTheme',
valid: '=?lxValid',
viewMode: '@?lxViewMode'
},
link: link,
controller: LxSelectController,
controllerAs: 'lxSelect',
bindToController: true,
replace: true,
transclude: true
};
function link(scope, element, attrs)
{
var backwardOneWay = ['customStyle'];
var backwardTwoWay = ['allowClear', 'choices', 'error', 'loading', 'multiple', 'valid'];
angular.forEach(backwardOneWay, function(attribute)
{
if (angular.isDefined(attrs[attribute]))
{
attrs.$observe(attribute, function(newValue)
{
scope.lxSelect[attribute] = newValue;
});
}
});
angular.forEach(backwardTwoWay, function(attribute)
{
if (angular.isDefined(attrs[attribute]))
{
scope.$watch(function()
{
return scope.$parent.$eval(attrs[attribute]);
}, function(newValue)
{
if (attribute === 'multiple' && angular.isUndefined(newValue))
{
scope.lxSelect[attribute] = true;
}
else
{
scope.lxSelect[attribute] = newValue;
}
});
}
});
attrs.$observe('placeholder', function(newValue)
{
scope.lxSelect.label = newValue;
});
attrs.$observe('change', function(newValue)
{
scope.lxSelect.ngChange = function(data)
{
return scope.$parent.$eval(newValue, data);
};
});
attrs.$observe('filter', function(newValue)
{
scope.lxSelect.filter = function(data)
{
return scope.$parent.$eval(newValue, data);
};
scope.lxSelect.displayFilter = true;
});
attrs.$observe('modelToSelection', function(newValue)
{
scope.lxSelect.modelToSelection = function(data)
{
return scope.$parent.$eval(newValue, data);
};
});
attrs.$observe('selectionToModel', function(newValue)
{
scope.lxSelect.selectionToModel = function(data)
{
return scope.$parent.$eval(newValue, data);
};
});
}
}
LxSelectController.$inject = ['$interpolate', '$element', '$filter', '$sce', '$scope', '$timeout', 'LxDepthService', 'LxDropdownService', 'LxUtils'];
function LxSelectController($interpolate, $element, $filter, $sce, $scope, $timeout, LxDepthService, LxDropdownService, LxUtils)
{
/////////////////////////////
// //
// Private attributes //
// //
/////////////////////////////
var lxSelect = this;
var choiceTemplate;
var selectedTemplate;
var toggledPanes = {};
/////////////////////////////
// //
// Public attributes //
// //
/////////////////////////////
lxSelect.activeChoiceIndex = -1;
lxSelect.activeSelectedIndex = -1;
lxSelect.uuid = LxUtils.generateUUID();
lxSelect.filterModel = undefined;
lxSelect.ngModel = angular.isUndefined(lxSelect.ngModel) && lxSelect.multiple ? [] : lxSelect.ngModel;
lxSelect.unconvertedModel = lxSelect.multiple ? [] : undefined;
lxSelect.viewMode = angular.isUndefined(lxSelect.viewMode) ? 'field' : lxSelect.viewMode;
lxSelect.choicesViewMode = angular.isUndefined(lxSelect.choicesViewMode) ? 'list' : lxSelect.choicesViewMode;
lxSelect.panes = [];
lxSelect.matchingPaths = undefined;
/////////////////////////////
// //
// Private functions //
// //
/////////////////////////////
/**
* Close the given panes (and all of its children panes).
*
* @param {number} index The index of the pane to close.
*/
function _closePane(index) {
if (index === 0) {
_closePanes();
return;
}
if (angular.isUndefined(toggledPanes[index])) {
return;
}
_closePane(index + 1);
if (lxSelect.choicesViewSize === 'large') {
lxSelect.panes.splice(toggledPanes[index].position, 1);
} else {
lxSelect.openedPanes.splice(toggledPanes[index].position, 1);
}
delete toggledPanes[index];
}
/**
* Close all panes.
*/
function _closePanes() {
toggledPanes = {};
if (lxSelect.choicesViewSize === 'large') {
if (angular.isDefined(lxSelect.choices) && lxSelect.choices !== null) {
lxSelect.panes = [lxSelect.choices];
} else {
lxSelect.panes = [];
}
} else {
if (angular.isDefined(lxSelect.choices) && lxSelect.choices !== null) {
lxSelect.openedPanes = [lxSelect.choices];
} else {
lxSelect.openedPanes = [];
}
}
}
/**
* Find the index of an element in an array.
*
* @param {Array} haystack The array in which to search for the value.
* @param {*} needle The value to search in the array.
* @return {number} The index of the value of the array, or -1 if not found.
*/
function _findIndex(haystack, needle) {
if (angular.isUndefined(haystack) || haystack.length === 0) {
return -1;
}
for (var i = 0, len = haystack.length; i < len; i++) {
if (haystack[i] === needle) {
return i;
}
}
return -1;
}
/**
* Get the longest matching path containing the given string.
*
* @param {string} [containing] The string we want the matching path to contain.
* If none given, just take the longest matching path of the first matching path.
*/
function _getLongestMatchingPath(containing) {
if (angular.isUndefined(lxSelect.matchingPaths) || lxSelect.matchingPaths.length === 0) {
return undefined;
}
containing = containing || lxSelect.matchingPaths[0];
var longest = lxSelect.matchingPaths[0];
var longestSize = longest.split('.').length;
for (var i = 1, len = lxSelect.matchingPaths.length; i < len; i++) {
var matchingPath = lxSelect.matchingPaths[i];
if (!matchingPath) {
continue;
}
if (matchingPath.indexOf(containing) === -1) {
break;
}
var size = matchingPath.split('.').length;
if (size > longestSize) {
longest = matchingPath;
longestSize = size;
}
}
return longest;
}
/**
* When the down key is pressed, select the next item of the most right opened pane (the first one if we are at
* the bottom).
*/
function _keyDown()
{
var filteredChoices;
if (lxSelect.choicesViewMode === 'panes') {
filteredChoices = Object.keys(lxSelect.panes[(lxSelect.panes.length - 1)]);
} else {
filteredChoices = $filter('filterChoices')(lxSelect.choices, lxSelect.filter, lxSelect.filterModel);
}
if (filteredChoices.length)
{
lxSelect.activeChoiceIndex += 1;
if (lxSelect.activeChoiceIndex >= filteredChoices.length)
{
lxSelect.activeChoiceIndex = 0;
}
}
if (lxSelect.autocomplete)
{
LxDropdownService.open('dropdown-' + lxSelect.uuid, '#lx-select-selected-wrapper-' + lxSelect.uuid);
}
}
/**
* When the left key is pressed and we are displaying the choices in pane mode, close the most right opened
* pane.
*/
function _keyLeft() {
if (lxSelect.choicesViewMode !== 'panes' || lxSelect.panes.length < 2) {
return;
}
var previousPaneIndex = lxSelect.panes.length - 2;
lxSelect.activeChoiceIndex = (
Object.keys(lxSelect.panes[previousPaneIndex]) || []
).indexOf(
(toggledPanes[previousPaneIndex] || {}).key
);
_closePane(previousPaneIndex);
}
function _keyRemove()
{
if (lxSelect.filterModel || angular.isUndefined(lxSelect.getSelectedModel()) || !lxSelect.getSelectedModel().length)
{
return;
}
if (lxSelect.activeSelectedIndex === -1)
{
lxSelect.activeSelectedIndex = lxSelect.getSelectedModel().length - 1;
}
else
{
unselect(lxSelect.getSelectedModel()[lxSelect.activeSelectedIndex]);
}
}
/**
* When the right key is pressed and we are displaying the choices in pane mode, open the currently selected
* pane.
*/
function _keyRight() {
if (lxSelect.choicesViewMode !== 'panes' || lxSelect.activeChoiceIndex === -1) {
return;
}
var paneOpened = _openPane((lxSelect.panes.length - 1), lxSelect.activeChoiceIndex, true);
if (paneOpened) {
lxSelect.activeChoiceIndex = 0;
} else {
_keySelect();
}
}
/**
* When the enter key is pressed, select the currently active choice.
*/
function _keySelect() {
var filteredChoices;
if (lxSelect.choicesViewMode === 'panes') {
filteredChoices = lxSelect.panes[(lxSelect.panes.length - 1)];
if (!lxSelect.isLeaf(filteredChoices[lxSelect.activeChoiceIndex])) {
return;
}
} else {
filteredChoices = $filter('filterChoices')(lxSelect.choices, lxSelect.filter, lxSelect.filterModel);
}
if (filteredChoices.length && filteredChoices[lxSelect.activeChoiceIndex]) {
lxSelect.toggleChoice(filteredChoices[lxSelect.activeChoiceIndex]);
} else if (lxSelect.filterModel && lxSelect.allowNewValue) {
if (angular.isArray(getSelectedModel())) {
var value = angular.isFunction(lxSelect.newValueTransform) ? lxSelect.newValueTransform(lxSelect.filterModel) : lxSelect.filterModel;
var identical = getSelectedModel().some(function (item) {
return angular.equals(item, value);
});
if (!identical) {
lxSelect.getSelectedModel().push(value);
}
}
lxSelect.filterModel = undefined;
LxDropdownService.close('dropdown-' + lxSelect.uuid);
}
}
/**
* When the up key is pressed, select the previous item of the most right opened pane (the last one if we are at
* the top).
*/
function _keyUp() {
var filteredChoices;
if (lxSelect.choicesViewMode === 'panes') {
filteredChoices = Object.keys(lxSelect.panes[(lxSelect.panes.length - 1)]);
} else {
filteredChoices = $filter('filterChoices')(lxSelect.choices, lxSelect.filter, lxSelect.filterModel);
}
if (filteredChoices.length) {
lxSelect.activeChoiceIndex -= 1;
if (lxSelect.activeChoiceIndex < 0) {
lxSelect.activeChoiceIndex = filteredChoices.length - 1;
}
}
if (lxSelect.autocomplete) {
LxDropdownService.open('dropdown-' + lxSelect.uuid, '#lx-select-selected-wrapper-' + lxSelect.uuid);
}
}
/**
* When a key is pressed, call the event handler in the angular context.
*
* @param {Event} evt The keydown event.
*/
function _onKeyDown(evt) {
$scope.$apply(function applyKeyEvent() {
lxSelect.keyEvent(evt);
});
}
/**
* Open a pane.
* If the pane is already opened, don't do anything.
*
* @param {number} parentIndex The index of the parent of the pane to open.
* @param {number|string} indexOrKey The index or the name of the pane to open.
* @param {boolean} [checkIsLeaf=false] Check if the pane we want to open is in fact a leaf.
* In the case of a leaf, don't open it.
* @return {boolean} Indicates if the panel has been opened or not.
*/
function _openPane(parentIndex, indexOrKey, checkIsLeaf) {
if (angular.isDefined(toggledPanes[parentIndex])) {
return false;
}
var pane = pane || lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex];
if (angular.isUndefined(pane)) {
return false;
}
var key = indexOrKey;
if (angular.isObject(pane) && angular.isNumber(key)) {
key = (Object.keys(pane) || [])[key];
}
if (checkIsLeaf && lxSelect.isLeaf(pane[key])) {
return false;
}
if (lxSelect.choicesViewSize === 'large') {
lxSelect.panes.push(pane[key]);
} else {
lxSelect.openedPanes.push(pane[key]);
}
toggledPanes[parentIndex] = {
key: key,
position: lxSelect.choicesViewSize === 'large' ? lxSelect.panes.length - 1 : lxSelect.openedPanes.length - 1,
path: (parentIndex === 0) ? key : toggledPanes[parentIndex - 1].path + '.' + key,
};
return true;
}
/**
* Search for any path in an object containing the given regexp as a key or as a value.
*
* @param {*} container The container in which to search for the regexp.
* @param {RegExp} regexp The regular expression to search in keys or values of the object (nested)
* @param {string} previousKey The path to the current object.
* @param {Array} [limitToFields=Array()] The fields in which we want to look for the filter.
* If none give, then use all the fields of the object.
* @return {Array} The list of paths that have matching key or value.
*/
function _searchPath(container, regexp, previousKey, limitToFields) {
limitToFields = limitToFields || [];
limitToFields = (angular.isArray(limitToFields)) ? limitToFields : [limitToFields];
var results = [];
angular.forEach(container, function forEachItemsInContainer(items, key) {
if (limitToFields.length > 0 && limitToFields.indexOf(key) === -1) {
return;
}
var pathToMatching = (previousKey) ? previousKey + '.' + key : key;
var previousKeyAdded = false;
var isLeaf = lxSelect.isLeaf(items);
if ((!isLeaf && angular.isString(key) && regexp.test(key)) || (angular.isString(items) && regexp.test(items))) {
if (!previousKeyAdded && previousKey) {
results.push(previousKey);
}
if (!isLeaf) {
results.push(pathToMatching);
}
}
if (angular.isArray(items) || angular.isObject(items)) {
var newPaths = _searchPath(items, regexp, pathToMatching, (isLeaf) ? lxSelect.filterFields : []);
if (angular.isDefined(newPaths) && newPaths.length > 0) {
if (previousKey) {
results.push(previousKey);
previousKeyAdded = true;
}
results = results.concat(newPaths);
}
}
});
return results;
}
/////////////////////////////
// //
// Public functions //
// //
/////////////////////////////
function arrayObjectIndexOf(arr, obj)
{
for (var i = 0; i < arr.length; i++)
{
if (angular.equals(arr[i], obj))
{
return i;
}
}
return -1;
}
/**
* Check if the choices dropdown is opened.
*
* @return {boolean} If the choices dropdown is opened or not.
*/
function areChoicesOpened() {
return LxDropdownService.isOpen('dropdown-' + lxSelect.uuid);
}
function displayChoice(_choice)
{
var choiceScope = {
$choice: _choice
};
var interpolatedChoice = $interpolate(choiceTemplate)(choiceScope);
interpolatedChoice = '<span>' + interpolatedChoice + '</span>';
return $sce.trustAsHtml((lxSelect.matchingPaths) ?
$filter('lxHighlight')(interpolatedChoice, lxSelect.filterModel, true) : interpolatedChoice
);
}
function displaySelected(_selected)
{
var selectedScope = {};
if (!angular.isArray(lxSelect.choices))
{
var found = false;
for (var header in lxSelect.choices)
{
if (found)
{
break;
}
if (lxSelect.choices.hasOwnProperty(header))
{
for (var idx = 0, len = lxSelect.choices[header].length; idx < len; idx++)
{
if (angular.equals(_selected, lxSelect.choices[header][idx]))
{
selectedScope.$selectedSubheader = header;
found = true;
break;
}
}
}
}
}
if (angular.isDefined(_selected))
{
selectedScope.$selected = _selected;
}
else
{
selectedScope.$selected = getSelectedModel();
}
return $sce.trustAsHtml($interpolate(selectedTemplate)(selectedScope));
}
function displaySubheader(_subheader)
{
return $sce.trustAsHtml((lxSelect.matchingPaths) ?
$filter('lxHighlight')(_subheader, lxSelect.filterModel, true) : _subheader
);
}
function getFilteredChoices()
{
return $filter('filterChoices')(lxSelect.choices, lxSelect.filter, lxSelect.filterModel);
}
function getSelectedModel()
{
if (angular.isDefined(lxSelect.modelToSelection) || angular.isDefined(lxSelect.selectionToModel))
{
return lxSelect.unconvertedModel;
}
else
{
return lxSelect.ngModel;
}
}
/**
* Check if an object is a leaf object.
* A leaf object is an object that contains the `isLeaf` property or that has property that are anything else
* than object or arrays.
*
* @param {*} obj The object to check if it's a leaf
* @return {boolean} If the object is a leaf object.
*/
function isLeaf(obj) {
if (angular.isUndefined(obj)) {
return false;
}
if (angular.isArray(obj)) {
return false;
}
if (!angular.isObject(obj)) {
return true;
}
if (obj.isLeaf) {
return true;
}
var isLeaf = false;
var keys = Object.keys(obj);
for (var i = 0, len = keys.length; i < len; i++) {
var property = keys[i];
if (property.charAt(0) === '$') {
continue;
}
if (!angular.isArray(obj[property]) && !angular.isObject(obj[property])) {
isLeaf = true;
break;
}
}
return isLeaf;
}
/**
* Check if a pane is toggled.
*
* @param {number} parentIndex The parent index of the pane in which to check.
* @param {number|string} indexOrKey The index or the name of the pane to check.
* @return {boolean} If the pane is toggled or not.
*/
function isPaneToggled(parentIndex, indexOrKey) {
var pane = lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex];
if (angular.isUndefined(pane)) {
return false;
}
var key = indexOrKey;
if (angular.isObject(pane) && angular.isNumber(indexOrKey)) {
key = (Object.keys(pane) || [])[indexOrKey];
}
return angular.isDefined(toggledPanes[parentIndex]) && toggledPanes[parentIndex].key === key;
}
/**
* Check if a path of a pane is matching the filter.
*
* @param {number} parentIndex The index of the pane.
* @param {number|string} indexOrKey The index or the name of the item to check.
*/
function isMatchingPath(parentIndex, indexOrKey) {
var pane = lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex];
if (angular.isUndefined(pane)) {
return;
}
var key = indexOrKey;
if (angular.isObject(pane) && angular.isNumber(indexOrKey)) {
key = (Object.keys(pane) || [])[indexOrKey];
}
if (parentIndex === 0) {
return _findIndex(lxSelect.matchingPaths, key) !== -1;
}
var previous = toggledPanes[parentIndex - 1];
if (angular.isUndefined(previous)) {
return false;
}
return _findIndex(lxSelect.matchingPaths, previous.path + '.' + key) !== -1;
}
function isSelected(_choice)
{
if (lxSelect.multiple && angular.isDefined(getSelectedModel()))
{
return arrayObjectIndexOf(getSelectedModel(), _choice) !== -1;
}
else if (angular.isDefined(getSelectedModel()))
{
return angular.equals(getSelectedModel(), _choice);
}
}
/**
* Handle a key press event
*
* @param {Event} evt The key press event.
*/
function keyEvent(evt) {
if (evt.keyCode !== 8) {
lxSelect.activeSelectedIndex = -1;
}
if (!LxDropdownService.isOpen('dropdown-' + lxSelect.uuid)) {
lxSelect.activeChoiceIndex = -1;
}
switch (evt.keyCode) {
case 8:
_keyRemove();
break;
case 13:
_keySelect();
evt.preventDefault();
break;
case 37:
if (lxSelect.activeChoiceIndex > -1) {
_keyLeft();
evt.preventDefault();
}
break;
case 38:
_keyUp();
evt.preventDefault();
break;
case 39:
if (lxSelect.activeChoiceIndex > -1) {
_keyRight();
evt.preventDefault();
}
break;
case 40:
_keyDown();
evt.preventDefault();
break;
default:
break;
}
}
function registerChoiceTemplate(_choiceTemplate)
{
choiceTemplate = _choiceTemplate;
}
function registerSelectedTemplate(_selectedTemplate)
{
selectedTemplate = _selectedTemplate;
}
function select(_choice, cb)
{
cb = cb || angular.noop;
if (lxSelect.multiple && angular.isUndefined(lxSelect.ngModel))
{
lxSelect.ngModel = [];
}
if (angular.isDefined(lxSelect.selectionToModel))
{
lxSelect.selectionToModel(
{
data: _choice,
callback: function(resp)
{
if (lxSelect.multiple)
{
lxSelect.ngModel.push(resp);
}
else
{
lxSelect.ngModel = resp;
}
if (lxSelect.autocomplete)
{
$element.find('.lx-select-selected__filter').focus();
}
if (lxSelect.choicesViewMode === 'panes' && lxSelect.displayFilter && lxSelect.multiple) {
$element.find('.lx-select-selected__filter input').focus();
}
if (angular.isFunction(cb)) {
$timeout(cb);
}
}
});
}
else
{
if (lxSelect.multiple)
{
lxSelect.ngModel.push(_choice);
}
else
{
lxSelect.ngModel = _choice;
}
if (lxSelect.autocomplete)
{
$element.find('.lx-select-selected__filter').focus();
}
if (lxSelect.choicesViewMode === 'panes' && lxSelect.displayFilter && lxSelect.multiple) {
$element.find('.lx-select-selected__filter input').focus();
}
if (angular.isFunction(cb)) {
$timeout(cb);
}
}
}
/**
* Toggle the given choice. If it was selected, unselect it. If it wasn't selected, select it.
*
* @param {Object} choice The choice to toggle.
* @param {Event} [evt] The event that triggered the function.
*/
function toggleChoice(choice, evt) {
if (lxSelect.multiple && !lxSelect.autocomplete && angular.isDefined(evt)) {
evt.stopPropagation();
}
if (lxSelect.areChoicesOpened() && lxSelect.multiple) {
var dropdownElement = angular.element(angular.element(evt.target).closest('.dropdown-menu--is-open')[0]);
// If the dropdown element is scrollable, fix the content div height to keep the current scroll state.
if (dropdownElement.scrollTop() > 0) {
var dropdownContentElement = angular.element(dropdownElement.find('.dropdown-menu__content')[0]);
var dropdownFilterElement = angular.element(dropdownContentElement.find('.lx-select-choices__filter')[0]);
var newHeight = dropdownContentElement.height();
newHeight -= (dropdownFilterElement.length) ? dropdownFilterElement.outerHeight() : 0;
var dropdownListElement = angular.element(dropdownContentElement.find('ul > div')[0]);
dropdownListElement.css('height', newHeight + 'px');
// This function is called when the ng-change attached to the filter input is called.
lxSelect.resetDropdownSize = function() {
dropdownListElement.css('height', 'auto');
lxSelect.resetDropdownSize = undefined;
}
}
}
if (lxSelect.multiple && isSelected(choice)) {
lxSelect.unselect(choice);
} else {
lxSelect.select(choice);
}
if (lxSelect.autocomplete) {
lxSelect.activeChoiceIndex = -1;
lxSelect.filterModel = undefined;
}
if (lxSelect.autocomplete || (lxSelect.choicesViewMode === 'panes' && !lxSelect.multiple)) {
LxDropdownService.close('dropdown-' + lxSelect.uuid);
}
}
/**
* Toggle a pane.
*
* @param {Event} evt The click event that led to toggle the pane.
* @param {number} parentIndex The index of the containing pane.
* @param {number|string} indexOrKey The index or the name of the pane to toggle.
* @param {boolean} [selectLeaf=true] Indicates if we want to select the choice if the pane to toggle is
* in fact a leaf.
*/
function togglePane(evt, parentIndex, indexOrKey, selectLeaf) {
selectLeaf = (angular.isUndefined(selectLeaf)) ? true : selectLeaf;
var pane = lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex];
if (angular.isUndefined(pane)) {
return;
}
var key = indexOrKey;
if (angular.isObject(pane) && angular.isNumber(indexOrKey)) {
key = (Object.keys(pane) || [])[indexOrKey];
}
if (angular.isDefined(toggledPanes[parentIndex])) {
var previousKey = toggledPanes[parentIndex].key;
_closePane(parentIndex);
if (previousKey === key) {
return;
}
}
var isLeaf = lxSelect.isLeaf(pane[key]);
if (isLeaf) {
if (selectLeaf) {
lxSelect.toggleChoice(pane[key], evt);
}
return;
}
_openPane(parentIndex, key, false);
}
function unselect(_choice, cb)
{
cb = cb || angular.noop;
if (angular.isDefined(lxSelect.selectionToModel))
{
lxSelect.selectionToModel(
{
data: _choice,
callback: function(resp)
{
removeElement(lxSelect.ngModel, resp);
if (lxSelect.autocomplete)
{
$element.find('.lx-select-selected__filter').focus();
lxSelect.activeSelectedIndex = -1;
}
if (lxSelect.choicesViewMode === 'panes' && lxSelect.displayFilter &&
(lxSelect.ngModel.length === 0 || lxSelect.multiple)) {
$element.find('.lx-select-selected__filter input').focus();
}
if (angular.isFunction(cb)) {
$timeout(cb);
}
}
});
removeElement(lxSelect.unconvertedModel, _choice);
}
else
{
removeElement(lxSelect.ngModel, _choice);
if (lxSelect.autocomplete)
{
$element.find('.lx-select-selected__filter').focus();
lxSelect.activeSelectedIndex = -1;
}
if (lxSelect.choicesViewMode === 'panes' && lxSelect.displayFilter &&
(lxSelect.ngModel.length === 0 || lxSelect.multiple)) {
$element.find('.lx-select-selected__filter input').focus();
}
if (angular.isFunction(cb)) {
$timeout(cb);
}
}
}
/**
* Update the filter.
* Either filter the choices available or highlight the path to the matching elements.
*/
function updateFilter() {
if (angular.isFunction(lxSelect.resetDropdownSize)) {
lxSelect.resetDropdownSize();
}
if (angular.isDefined(lxSelect.filter)) {
lxSelect.matchingPaths = lxSelect.filter({
newValue: lxSelect.filterModel
});
} else if (lxSelect.choicesViewMode === 'panes') {
lxSelect.matchingPaths = lxSelect.searchPath(lxSelect.filterModel);
_closePanes();
}
if (lxSelect.autocomplete) {
lxSelect.activeChoiceIndex = -1;
if (lxSelect.filterModel) {
LxDropdownService.open('dropdown-' + lxSelect.uuid, '#lx-select-selected-wrapper-' + lxSelect.uuid);
} else {
LxDropdownService.close('dropdown-' + lxSelect.uuid);
}
}
if (lxSelect.choicesViewMode === 'panes' && angular.isDefined(lxSelect.matchingPaths) && lxSelect.matchingPaths.length > 0) {
var longest = _getLongestMatchingPath();
if (!longest) {
return;
}
var longestPath = longest.split('.');
if (longestPath.length === 0) {
return;
}
angular.forEach(longestPath, function forEachPartOfTheLongestPath(part, index) {
_openPane(index, part, index === (longestPath.length - 1));
});
}
}
function helperDisplayable() {
// If helper message is not defined, message is not displayed...
if (angular.isUndefined(lxSelect.helperMessage))
{
return false;
}
// If helper is defined return it's state.
if (angular.isDefined(lxSelect.helper))
{
return lxSelect.helper;
}
// Else check if there's choices.
var choices = lxSelect.getFilteredChoices();
if (angular.isArray(choices))
{
return !choices.length;
}
else if (angular.isObject(choices))
{
return !(Object.keys(choices) || []).length;
}
return true;
}
function removeElement(model, element)
{
var index = -1;
for (var i = 0, len = model.length; i < len; i++)
{
if (angular.equals(element, model[i]))
{
index = i;
break;
}
}
if (index > -1)
{
model.splice(index, 1);
}
}
/**
* Search in the multipane select for the paths matching the search.
*
* @param {string} newValue The filter string.
*/
function searchPath(newValue) {
if (!newValue || newValue.length < 2) {
return undefined;
}
var regexp = new RegExp(LxUtils.escapeRegexp(newValue), 'ig');
return _searchPath(lxSelect.choices, regexp);
}
/////////////////////////////
lxSelect.areChoicesOpened = areChoicesOpened;
lxSelect.displayChoice = displayChoice;
lxSelect.displaySelected = displaySelected;
lxSelect.displaySubheader = displaySubheader;
lxSelect.getFilteredChoices = getFilteredChoices;
lxSelect.getSelectedModel = getSelectedModel;
lxSelect.helperDisplayable = helperDisplayable;
lxSelect.isLeaf = isLeaf;
lxSelect.isMatchingPath = isMatchingPath;
lxSelect.isPaneToggled = isPaneToggled;
lxSelect.isSelected = isSelected;
lxSelect.keyEvent = keyEvent;
lxSelect.registerChoiceTemplate = registerChoiceTemplate;
lxSelect.registerSelectedTemplate = registerSelectedTemplate;
lxSelect.searchPath = searchPath;
lxSelect.select = select;
lxSelect.toggleChoice = toggleChoice;
lxSelect.togglePane = togglePane;
lxSelect.unselect = unselect;
lxSelect.updateFilter = updateFilter;
/////////////////////////////
// //
// Watchers //
// //
/////////////////////////////
$scope.$watch(function watcherChoices() {
return lxSelect.choices;
}, function watchChoices(newChoices, oldChoices) {
if (angular.isUndefined(lxSelect.choices) || lxSelect.choices === null) {
lxSelect.panes = [];
return;
}
lxSelect.panes = [lxSelect.choices];
lxSelect.openedPanes = [lxSelect.choices];
}, true);
/////////////////////////////
// //
// Events //
// //
/////////////////////////////
/**
* When the choices dropdown closes, reset the toggled panels and the filter.
*
* @param {Event} evt The dropdown close event.
* @param {string} dropdownId The id of the dropdown that ends to close.
*/
$scope.$on('lx-dropdown__close-end', function onDropdownClose(evt, dropdownId) {
if (lxSelect.choicesViewMode !== 'panes' || dropdownId !== 'dropdown-' + lxSelect.uuid) {
return;
}
angular.element(document).off('keydown', _onKeyDown);
lxSelect.filterModel = undefined;
lxSelect.matchingPaths = undefined;
lxSelect.activeChoiceIndex = -1;
_closePanes();
});
/**
* When the choices dropdown opens, focus the search filter.
*
* @param {Event} evt The dropdown open event.
* @param {string} dropdownId The id of the dropdown that ends to close.
*/
$scope.$on('lx-dropdown__open-start', function onDropdownOpen(evt, dropdownId) {
if (lxSelect.choicesViewMode !== 'panes' || dropdownId !== 'dropdown-' + lxSelect.uuid) {
return;
}
angular.element(document).on('keydown', _onKeyDown);
$timeout(function delayFocusSearchFilter() {
$element.find('.lx-select-selected__filter input').focus();
});
});
}
function lxSelectSelected()
{
return {
restrict: 'E',
require: ['lxSelectSelected', '^lxSelect'],
templateUrl: 'select-selected.html',
link: link,
controller: LxSelectSelectedController,
controllerAs: 'lxSelectSelected',
bindToController: true,
transclude: true
};
function link(scope, element, attrs, ctrls, transclude)
{
ctrls[0].setParentController(ctrls[1]);
transclude(scope, function(clone)
{
var template = '';
for (var i = 0; i < clone.length; i++)
{
template += clone[i].data || clone[i].outerHTML || '';
}
ctrls[1].registerSelectedTemplate(template);
});
}
}
function LxSelectSelectedController()
{
var lxSelectSelected = this;
lxSelectSelected.clearModel = clearModel;
lxSelectSelected.setParentController = setParentController;
lxSelectSelected.removeSelected = removeSelected;
////////////
function clearModel(_event)
{
_event.stopPropagation();
lxSelectSelected.parentCtrl.ngModel = undefined;
lxSelectSelected.parentCtrl.unconvertedModel = undefined;
}
function setParentController(_parentCtrl)
{
lxSelectSelected.parentCtrl = _parentCtrl;
}
function removeSelected(_selected, _event)
{
_event.stopPropagation();
lxSelectSelected.parentCtrl.unselect(_selected);
}
}
function lxSelectChoices()
{
return {
restrict: 'E',
require: ['lxSelectChoices', '^lxSelect'],
templateUrl: 'select-choices.html',
link: link,
controller: LxSelectChoicesController,
controllerAs: 'lxSelectChoices',
bindToController: true,
transclude: true
};
function link(scope, element, attrs, ctrls, transclude)
{
ctrls[0].setParentController(ctrls[1]);
transclude(scope, function(clone)
{
var template = '';
for (var i = 0; i < clone.length; i++)
{
template += clone[i].data || clone[i].outerHTML || '';
}
ctrls[1].registerChoiceTemplate(template);
});
}
}
LxSelectChoicesController.$inject = ['$scope', '$timeout', '$window'];
function LxSelectChoicesController($scope, $timeout, $window)
{
var lxSelectChoices = this;
var timer;
lxSelectChoices.isArray = isArray;
lxSelectChoices.setParentController = setParentController;
$scope.$on('$destroy', function()
{
$timeout.cancel(timer);
});
////////////
function isArray(choices)
{
choices = (angular.isUndefined(choices)) ? lxSelectChoices.parentCtrl.choices : choices;
return angular.isArray(choices);
}
function setParentController(_parentCtrl)
{
lxSelectChoices.parentCtrl = _parentCtrl;
$scope.$watch(function()
{
return lxSelectChoices.parentCtrl.ngModel;
}, function(newModel, oldModel)
{
timer = $timeout(function()
{
if (newModel !== oldModel && angular.isDefined(lxSelectChoices.parentCtrl.ngChange))
{
lxSelectChoices.parentCtrl.ngChange(
{
newValue: newModel,
oldValue: oldModel
});
}
if (angular.isDefined(lxSelectChoices.parentCtrl.modelToSelection) || angular.isDefined(lxSelectChoices.parentCtrl.selectionToModel))
{
toSelection();
}
});
}, true);
lxSelectChoices.parentCtrl.choicesViewSize = $window.innerWidth < 980 ? 'small' : 'large';
angular.element($window).on('resize', function onResize(evt) {
if (evt.target.innerWidth < 980) {
lxSelectChoices.parentCtrl.choicesViewSize = 'small';
} else {
lxSelectChoices.parentCtrl.choicesViewSize = 'large';
}
});
}
function toSelection()
{
if (lxSelectChoices.parentCtrl.multiple)
{
lxSelectChoices.parentCtrl.unconvertedModel = [];
angular.forEach(lxSelectChoices.parentCtrl.ngModel, function(item)
{
lxSelectChoices.parentCtrl.modelToSelection(
{
data: item,
callback: function(resp)
{
lxSelectChoices.parentCtrl.unconvertedModel.push(resp);
}
});
});
}
else
{
lxSelectChoices.parentCtrl.modelToSelection(
{
data: lxSelectChoices.parentCtrl.ngModel,
callback: function(resp)
{
lxSelectChoices.parentCtrl.unconvertedModel = resp;
}
});
}
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.stepper')
.directive('lxStepper', lxStepper)
.directive('lxStep', lxStep)
.directive('lxStepNav', lxStepNav);
/* Stepper */
function lxStepper()
{
return {
restrict: 'E',
templateUrl: 'stepper.html',
scope: {
cancel: '&?lxCancel',
complete: '&lxComplete',
controls: '=?lxShowControls',
id: '@?lxId',
isLinear: '=?lxIsLinear',
labels: '=?lxLabels',
layout: '@?lxLayout'
},
controller: LxStepperController,
controllerAs: 'lxStepper',
bindToController: true,
transclude: true
};
}
LxStepperController.$inject = ['$scope'];
function LxStepperController($scope)
{
var lxStepper = this;
var _classes = [];
var _defaultValues = {
isLinear: true,
labels: {
'back': 'Back',
'cancel': 'Cancel',
'continue': 'Continue',
'optional': 'Optional'
},
layout: 'horizontal'
};
lxStepper.addStep = addStep;
lxStepper.getClasses = getClasses;
lxStepper.goToStep = goToStep;
lxStepper.isComplete = isComplete;
lxStepper.updateStep = updateStep;
lxStepper.controls = angular.isDefined(lxStepper.controls) ? lxStepper.controls : true;
lxStepper.activeIndex = 0;
lxStepper.isLinear = angular.isDefined(lxStepper.isLinear) ? lxStepper.isLinear : _defaultValues.isLinear;
lxStepper.labels = angular.isDefined(lxStepper.labels) ? lxStepper.labels : _defaultValues.labels;
lxStepper.layout = angular.isDefined(lxStepper.layout) ? lxStepper.layout : _defaultValues.layout;
lxStepper.steps = [];
////////////
function addStep(step)
{
lxStepper.steps.push(step);
}
function getClasses()
{
_classes.length = 0;
_classes.push('lx-stepper--layout-' + lxStepper.layout);
if (lxStepper.isLinear)
{
_classes.push('lx-stepper--is-linear');
}
var step = lxStepper.steps[lxStepper.activeIndex];
if (angular.isDefined(step))
{
if (step.feedback)
{
_classes.push('lx-stepper--step-has-feedback');
}
if (step.isLoading)
{
_classes.push('lx-stepper--step-is-loading');
}
}
return _classes;
}
function goToStep(index, bypass)
{
// Check if the wanted step previous steps are optionals.
// If so, check if the step before the last optional step is valid to allow going to the wanted step from the nav (only if linear stepper).
var stepBeforeLastOptionalStep;
if (!bypass && lxStepper.isLinear)
{
for (var i = index - 1; i >= 0; i--)
{
if (angular.isDefined(lxStepper.steps[i]) && !lxStepper.steps[i].isOptional)
{
stepBeforeLastOptionalStep = lxStepper.steps[i];
break;
}
}
if(angular.isDefined(stepBeforeLastOptionalStep))
{
// Check validity only if step is dirty and editable.
if (!stepBeforeLastOptionalStep.pristine && angular.isFunction(stepBeforeLastOptionalStep.validator) && stepBeforeLastOptionalStep.isEditable)
{
var validity = stepBeforeLastOptionalStep.validator();
if (validity === true)
{
stepBeforeLastOptionalStep.isValid = true;
}
else
{
stepBeforeLastOptionalStep.isValid = false;
stepBeforeLastOptionalStep.errorMessage = validity;
}
}
if (stepBeforeLastOptionalStep.isValid === true)
{
bypass = true;
}
}
}
// Check if the wanted step previous step is not valid to disallow going to the wanted step from the nav (only if linear stepper).
if (!bypass && lxStepper.isLinear && angular.isDefined(lxStepper.steps[index - 1]) && (angular.isUndefined(lxStepper.steps[index - 1].isValid) || lxStepper.steps[index - 1].isValid === false))
{
return;
}
if (index < lxStepper.steps.length)
{
lxStepper.activeIndex = parseInt(index);
lxStepper.steps[lxStepper.activeIndex].pristine = false;
$scope.$emit('lx-stepper__step', lxStepper.id, index, index === 0, index === (lxStepper.steps.length - 1));
}
}
function isComplete()
{
var countMandatory = 0;
var countValid = 0;
for (var i = 0, len = lxStepper.steps.length; i < len; i++)
{
if (!lxStepper.steps[i].isOptional)
{
countMandatory++;
if (lxStepper.steps[i].isValid === true) {
countValid++;
}
}
}
if (countValid === countMandatory)
{
lxStepper.complete();
return true;
}
}
function updateStep(step)
{
for (var i = 0, len = lxStepper.steps.length; i < len; i++)
{
if (lxStepper.steps[i].uuid === step.uuid)
{
lxStepper.steps[i].index = step.index;
lxStepper.steps[i].label = step.label;
return;
}
}
}
$scope.$on('lx-stepper__go-to-step', function(event, id, stepIndex, bypass)
{
if (angular.isDefined(id) && id !== lxStepper.id)
{
return;
}
goToStep(stepIndex, bypass);
});
$scope.$on('lx-stepper__cancel', function(event, id)
{
if ((angular.isDefined(id) && id !== lxStepper.id) || !angular.isFunction(lxStepper.cancel))
{
return;
}
lxStepper.cancel();
});
}
/* Step */
function lxStep()
{
return {
restrict: 'E',
require: ['lxStep', '^lxStepper'],
templateUrl: 'step.html',
scope: {
feedback: '@?lxFeedback',
isEditable: '=?lxIsEditable',
isOptional: '=?lxIsOptional',
isValid: '=?lxIsValid',
label: '@lxLabel',
submit: '&?lxSubmit',
validate: '&?lxValidate'
},
link: link,
controller: LxStepController,
controllerAs: 'lxStep',
bindToController: true,
replace: true,
transclude: true
};
function link(scope, element, attrs, ctrls)
{
ctrls[0].init(ctrls[1], element.index());
attrs.$observe('lxFeedback', function(feedback)
{
ctrls[0].setFeedback(feedback);
});
attrs.$observe('lxLabel', function(label)
{
ctrls[0].setLabel(label);
});
attrs.$observe('lxIsEditable', function(isEditable)
{
ctrls[0].setIsEditable(isEditable);
});
attrs.$observe('lxIsOptional', function(isOptional)
{
ctrls[0].setIsOptional(isOptional);
});
}
}
LxStepController.$inject = ['$q', '$scope', 'LxNotificationService', 'LxUtils'];
function LxStepController($q, $scope, LxNotificationService, LxUtils)
{
var lxStep = this;
var _classes = [];
var _nextStepIndex;
lxStep.getClasses = getClasses;
lxStep.init = init;
lxStep.previousStep = previousStep;
lxStep.setFeedback = setFeedback;
lxStep.setLabel = setLabel;
lxStep.setIsEditable = setIsEditable;
lxStep.setIsOptional = setIsOptional;
lxStep.submitStep = submitStep;
lxStep.step = {
errorMessage: undefined,
feedback: undefined,
index: undefined,
isEditable: false,
isLoading: false,
isOptional: false,
isValid: lxStep.isValid,
label: undefined,
pristine: true,
uuid: LxUtils.generateUUID(),
validator: undefined
};
////////////
function getClasses()
{
_classes.length = 0;
if (lxStep.step.index === lxStep.parent.activeIndex)
{
_classes.push('lx-step--is-active');
}
return _classes;
}
function init(parent, index)
{
lxStep.parent = parent;
lxStep.step.index = index;
lxStep.step.validator = lxStep.validate;
lxStep.parent.addStep(lxStep.step);
}
function previousStep()
{
if (lxStep.step.index > 0)
{
lxStep.parent.goToStep(lxStep.step.index - 1);
}
}
function setFeedback(feedback)
{
lxStep.step.feedback = feedback;
updateParentStep();
}
function setLabel(label)
{
lxStep.step.label = label;
updateParentStep();
}
function setIsEditable(isEditable)
{
lxStep.step.isEditable = isEditable;
updateParentStep();
}
function setIsOptional(isOptional)
{
lxStep.step.isOptional = isOptional;
updateParentStep();
}
function submitStep()
{
if (lxStep.step.isValid === true && !lxStep.step.isEditable)
{
lxStep.parent.goToStep(_nextStepIndex, true);
return;
}
var validateFunction = lxStep.validate;
var validity = true;
if (angular.isFunction(validateFunction))
{
validity = validateFunction();
}
if (validity === true)
{
$scope.$emit('lx-stepper__step-loading', lxStep.parent.id, lxStep.step.index);
lxStep.step.isLoading = true;
updateParentStep();
var submitFunction = lxStep.submit;
if (!angular.isFunction(submitFunction))
{
submitFunction = function()
{
return $q(function(resolve)
{
resolve();
});
};
}
var promise = submitFunction();
promise.then(function(nextStepIndex)
{
lxStep.step.isValid = true;
updateParentStep();
var isComplete = lxStep.parent.isComplete();
if (!isComplete)
{
_nextStepIndex = angular.isDefined(nextStepIndex) && nextStepIndex > lxStep.parent.activeIndex && (!lxStep.parent.isLinear || (lxStep.parent.isLinear && lxStep.parent.steps[nextStepIndex - 1].isOptional)) ? nextStepIndex : lxStep.step.index + 1;
lxStep.parent.goToStep(_nextStepIndex, true);
}
else
{
$scope.$emit('lx-stepper__completed', lxStepper.id);
}
}).catch(function(error)
{
LxNotificationService.error(error);
}).finally(function()
{
$scope.$emit('lx-stepper__step-loaded', lxStep.parent.id, lxStep.step.index);
lxStep.step.isLoading = false;
updateParentStep();
});
}
else
{
lxStep.step.isValid = false;
lxStep.step.errorMessage = validity;
updateParentStep();
}
}
function updateParentStep()
{
lxStep.parent.updateStep(lxStep.step);
}
$scope.$on('lx-stepper__submit-step', function(event, id, index)
{
if ((angular.isDefined(id) && id !== lxStep.parent.id) || index !== lxStep.step.index)
{
return;
}
submitStep();
});
$scope.$on('lx-stepper__previous-step', function(event, id, index)
{
if ((angular.isDefined(id) && id !== lxStep.parent.id) || index !== lxStep.step.index)
{
return;
}
previousStep();
});
}
/* Step nav */
function lxStepNav()
{
return {
restrict: 'E',
require: ['lxStepNav', '^lxStepper'],
templateUrl: 'step-nav.html',
scope: {
activeIndex: '@lxActiveIndex',
step: '=lxStep'
},
link: link,
controller: LxStepNavController,
controllerAs: 'lxStepNav',
bindToController: true,
replace: true,
transclude: false
};
function link(scope, element, attrs, ctrls)
{
ctrls[0].init(ctrls[1]);
}
}
function LxStepNavController()
{
var lxStepNav = this;
var _classes = [];
lxStepNav.getClasses = getClasses;
lxStepNav.init = init;
////////////
function getClasses()
{
_classes.length = 0;
if (parseInt(lxStepNav.step.index) === parseInt(lxStepNav.activeIndex))
{
_classes.push('lx-step-nav--is-active');
}
if (lxStepNav.step.isValid === true)
{
_classes.push('lx-step-nav--is-valid');
}
else if (lxStepNav.step.isValid === false)
{
_classes.push('lx-step-nav--has-error');
}
if (lxStepNav.step.isEditable)
{
_classes.push('lx-step-nav--is-editable');
}
if (lxStepNav.step.isOptional)
{
_classes.push('lx-step-nav--is-optional');
}
return _classes;
}
function init(parent, index)
{
lxStepNav.parent = parent;
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.switch')
.directive('lxSwitch', lxSwitch)
.directive('lxSwitchLabel', lxSwitchLabel)
.directive('lxSwitchHelp', lxSwitchHelp);
function lxSwitch()
{
return {
restrict: 'E',
templateUrl: 'switch.html',
scope:
{
ngModel: '=',
name: '@?',
ngTrueValue: '@?',
ngFalseValue: '@?',
ngChange: '&?',
ngDisabled: '=?',
lxColor: '@?',
lxPosition: '@?',
lxTheme: '@?'
},
controller: LxSwitchController,
controllerAs: 'lxSwitch',
bindToController: true,
transclude: true,
replace: true
};
}
LxSwitchController.$inject = ['$scope', '$timeout', 'LxUtils'];
function LxSwitchController($scope, $timeout, LxUtils)
{
var lxSwitch = this;
var switchId;
var switchHasChildren;
var timer;
lxSwitch.getSwitchId = getSwitchId;
lxSwitch.getSwitchHasChildren = getSwitchHasChildren;
lxSwitch.setSwitchId = setSwitchId;
lxSwitch.setSwitchHasChildren = setSwitchHasChildren;
lxSwitch.triggerNgChange = triggerNgChange;
$scope.$on('$destroy', function()
{
$timeout.cancel(timer);
});
init();
////////////
function getSwitchId()
{
return switchId;
}
function getSwitchHasChildren()
{
return switchHasChildren;
}
function init()
{
setSwitchId(LxUtils.generateUUID());
setSwitchHasChildren(false);
lxSwitch.ngTrueValue = angular.isUndefined(lxSwitch.ngTrueValue) ? true : lxSwitch.ngTrueValue;
lxSwitch.ngFalseValue = angular.isUndefined(lxSwitch.ngFalseValue) ? false : lxSwitch.ngFalseValue;
lxSwitch.lxColor = angular.isUndefined(lxSwitch.lxColor) ? 'accent' : lxSwitch.lxColor;
lxSwitch.lxPosition = angular.isUndefined(lxSwitch.lxPosition) ? 'left' : lxSwitch.lxPosition;
}
function setSwitchId(_switchId)
{
switchId = _switchId;
}
function setSwitchHasChildren(_switchHasChildren)
{
switchHasChildren = _switchHasChildren;
}
function triggerNgChange()
{
timer = $timeout(lxSwitch.ngChange);
}
}
function lxSwitchLabel()
{
return {
restrict: 'AE',
require: ['^lxSwitch', '^lxSwitchLabel'],
templateUrl: 'switch-label.html',
link: link,
controller: LxSwitchLabelController,
controllerAs: 'lxSwitchLabel',
bindToController: true,
transclude: true,
replace: true
};
function link(scope, element, attrs, ctrls)
{
ctrls[0].setSwitchHasChildren(true);
ctrls[1].setSwitchId(ctrls[0].getSwitchId());
}
}
function LxSwitchLabelController()
{
var lxSwitchLabel = this;
var switchId;
lxSwitchLabel.getSwitchId = getSwitchId;
lxSwitchLabel.setSwitchId = setSwitchId;
////////////
function getSwitchId()
{
return switchId;
}
function setSwitchId(_switchId)
{
switchId = _switchId;
}
}
function lxSwitchHelp()
{
return {
restrict: 'AE',
require: '^lxSwitch',
templateUrl: 'switch-help.html',
transclude: true,
replace: true
};
}
})();
(function()
{
'use strict';
angular
.module('lumx.tabs')
.directive('lxTabs', lxTabs)
.directive('lxTab', lxTab)
.directive('lxTabsPanes', lxTabsPanes)
.directive('lxTabPane', lxTabPane);
function lxTabs()
{
return {
restrict: 'E',
templateUrl: 'tabs.html',
scope:
{
layout: '@?lxLayout',
theme: '@?lxTheme',
color: '@?lxColor',
indicator: '@?lxIndicator',
activeTab: '=?lxActiveTab',
panesId: '@?lxPanesId',
links: '=?lxLinks',
position: '@?lxPosition'
},
controller: LxTabsController,
controllerAs: 'lxTabs',
bindToController: true,
replace: true,
transclude: true
};
}
LxTabsController.$inject = ['LxUtils', '$element', '$scope', '$timeout'];
function LxTabsController(LxUtils, $element, $scope, $timeout)
{
var lxTabs = this;
var tabsLength;
var timer1;
var timer2;
var timer3;
var timer4;
lxTabs.removeTab = removeTab;
lxTabs.setActiveTab = setActiveTab;
lxTabs.setViewMode = setViewMode;
lxTabs.tabIsActive = tabIsActive;
lxTabs.updateTabs = updateTabs;
lxTabs.activeTab = angular.isDefined(lxTabs.activeTab) ? lxTabs.activeTab : 0;
lxTabs.color = angular.isDefined(lxTabs.color) ? lxTabs.color : 'primary';
lxTabs.indicator = angular.isDefined(lxTabs.indicator) ? lxTabs.indicator : 'accent';
lxTabs.layout = angular.isDefined(lxTabs.layout) ? lxTabs.layout : 'full';
lxTabs.tabs = [];
lxTabs.theme = angular.isDefined(lxTabs.theme) ? lxTabs.theme : 'light';
lxTabs.viewMode = angular.isDefined(lxTabs.links) ? 'separate' : 'gather';
$scope.$watch(function()
{
return lxTabs.activeTab;
}, function(_newActiveTab, _oldActiveTab)
{
timer1 = $timeout(function()
{
setIndicatorPosition(_oldActiveTab);
if (lxTabs.viewMode === 'separate')
{
angular.element('#' + lxTabs.panesId).find('.tabs__pane').hide();
angular.element('#' + lxTabs.panesId).find('.tabs__pane').eq(lxTabs.activeTab).show();
}
});
});
$scope.$watch(function()
{
return lxTabs.position;
}, function(_newPosition) {
lxTabs.bottomPosition = angular.isDefined(_newPosition) && (_newPosition === 'bottom');
});
$scope.$watch(function()
{
return lxTabs.links;
}, function(_newLinks)
{
lxTabs.viewMode = angular.isDefined(_newLinks) ? 'separate' : 'gather';
angular.forEach(_newLinks, function(link, index)
{
var tab = {
uuid: (angular.isUndefined(link.uuid) || link.uuid.length === 0) ? LxUtils.generateUUID() : link.uuid,
index: index,
label: link.label,
icon: link.icon,
disabled: link.disabled
};
updateTabs(tab);
});
});
timer2 = $timeout(function()
{
tabsLength = lxTabs.tabs.length;
});
$scope.$on('$destroy', function()
{
$timeout.cancel(timer1);
$timeout.cancel(timer2);
$timeout.cancel(timer3);
$timeout.cancel(timer4);
});
////////////
function removeTab(_tab)
{
lxTabs.tabs.splice(_tab.index, 1);
angular.forEach(lxTabs.tabs, function(tab, index)
{
tab.index = index;
});
if (lxTabs.activeTab === 0)
{
timer3 = $timeout(function()
{
setIndicatorPosition();
});
}
else
{
setActiveTab(lxTabs.tabs[0]);
}
}
function setActiveTab(_tab)
{
if (!_tab.disabled)
{
lxTabs.activeTab = _tab.index;
}
}
function setIndicatorPosition(_previousActiveTab)
{
var direction = lxTabs.activeTab > _previousActiveTab ? 'right' : 'left';
var indicator = $element.find('.tabs__indicator');
var activeTab = $element.find('.tabs__link').eq(lxTabs.activeTab);
var indicatorLeft = activeTab.position().left;
var indicatorRight = $element.outerWidth() - (indicatorLeft + activeTab.outerWidth());
if (angular.isUndefined(_previousActiveTab))
{
indicator.css(
{
left: indicatorLeft,
right: indicatorRight
});
}
else
{
var animationProperties = {
duration: 200,
easing: 'easeOutQuint'
};
if (direction === 'left')
{
indicator.velocity(
{
left: indicatorLeft
}, animationProperties);
indicator.velocity(
{
right: indicatorRight
}, animationProperties);
}
else
{
indicator.velocity(
{
right: indicatorRight
}, animationProperties);
indicator.velocity(
{
left: indicatorLeft
}, animationProperties);
}
}
}
function setViewMode(_viewMode)
{
lxTabs.viewMode = _viewMode;
}
function tabIsActive(_index)
{
return lxTabs.activeTab === _index;
}
function updateTabs(_tab)
{
var newTab = true;
angular.forEach(lxTabs.tabs, function(tab)
{
if (tab.index === _tab.index)
{
newTab = false;
tab.uuid = _tab.uuid;
tab.icon = _tab.icon;
tab.label = _tab.label;
}
});
if (newTab)
{
lxTabs.tabs.push(_tab);
if (angular.isDefined(tabsLength))
{
timer4 = $timeout(function()
{
setIndicatorPosition();
});
}
}
}
}
function lxTab()
{
return {
restrict: 'E',
require: ['lxTab', '^lxTabs'],
templateUrl: 'tab.html',
scope:
{
ngDisabled: '=?'
},
link: link,
controller: LxTabController,
controllerAs: 'lxTab',
bindToController: true,
replace: true,
transclude: true
};
function link(scope, element, attrs, ctrls)
{
ctrls[0].init(ctrls[1], element.index());
attrs.$observe('lxLabel', function(_newLabel)
{
ctrls[0].setLabel(_newLabel);
});
attrs.$observe('lxIcon', function(_newIcon)
{
ctrls[0].setIcon(_newIcon);
});
}
}
LxTabController.$inject = ['$scope', 'LxUtils'];
function LxTabController($scope, LxUtils)
{
var lxTab = this;
var parentCtrl;
var tab = {
uuid: LxUtils.generateUUID(),
index: undefined,
label: undefined,
icon: undefined,
disabled: false
};
lxTab.init = init;
lxTab.setIcon = setIcon;
lxTab.setLabel = setLabel;
lxTab.tabIsActive = tabIsActive;
$scope.$watch(function()
{
return lxTab.ngDisabled;
}, function(_isDisabled)
{
if (_isDisabled)
{
tab.disabled = true;
}
else
{
tab.disabled = false;
}
parentCtrl.updateTabs(tab);
});
$scope.$on('$destroy', function()
{
parentCtrl.removeTab(tab);
});
////////////
function init(_parentCtrl, _index)
{
parentCtrl = _parentCtrl;
tab.index = _index;
parentCtrl.updateTabs(tab);
}
function setIcon(_icon)
{
tab.icon = _icon;
parentCtrl.updateTabs(tab);
}
function setLabel(_label)
{
tab.label = _label;
parentCtrl.updateTabs(tab);
}
function tabIsActive()
{
return parentCtrl.tabIsActive(tab.index);
}
}
function lxTabsPanes()
{
return {
restrict: 'E',
templateUrl: 'tabs-panes.html',
scope: true,
replace: true,
transclude: true
};
}
function lxTabPane()
{
return {
restrict: 'E',
templateUrl: 'tab-pane.html',
scope: true,
replace: true,
transclude: true
};
}
})();
(function()
{
'use strict';
angular
.module('lumx.text-field')
.directive('lxTextField', lxTextField);
lxTextField.$inject = ['$timeout'];
function lxTextField($timeout)
{
return {
restrict: 'E',
templateUrl: 'text-field.html',
scope:
{
allowClear: '=?lxAllowClear',
error: '=?lxError',
fixedLabel: '=?lxFixedLabel',
focus: '<?lxFocus',
icon: '@?lxIcon',
label: '@lxLabel',
ngDisabled: '=?',
theme: '@?lxTheme',
valid: '=?lxValid'
},
link: link,
controller: LxTextFieldController,
controllerAs: 'lxTextField',
bindToController: true,
replace: true,
transclude: true
};
function link(scope, element, attrs, ctrl, transclude)
{
var backwardOneWay = ['icon', 'label', 'theme'];
var backwardTwoWay = ['error', 'fixedLabel', 'valid'];
var input;
var timer;
angular.forEach(backwardOneWay, function(attribute)
{
if (angular.isDefined(attrs[attribute]))
{
attrs.$observe(attribute, function(newValue)
{
scope.lxTextField[attribute] = newValue;
});
}
});
angular.forEach(backwardTwoWay, function(attribute)
{
if (angular.isDefined(attrs[attribute]))
{
scope.$watch(function()
{
return scope.$parent.$eval(attrs[attribute]);
}, function(newValue)
{
scope.lxTextField[attribute] = newValue;
});
}
});
transclude(function()
{
input = element.find('textarea');
if (input[0])
{
input.on('cut paste drop keydown', function()
{
timer = $timeout(ctrl.updateTextareaHeight);
});
}
else
{
input = element.find('input');
}
input.addClass('text-field__input');
ctrl.setInput(input);
ctrl.setModel(input.data('$ngModelController'));
input.on('focus', function()
{
var phase = scope.$root.$$phase;
if (phase === '$apply' || phase === '$digest')
{
ctrl.focusInput();
}
else
{
scope.$apply(ctrl.focusInput);
}
});
input.on('blur', ctrl.blurInput);
});
scope.$on('$destroy', function()
{
$timeout.cancel(timer);
input.off();
});
}
}
LxTextFieldController.$inject = ['$scope', '$timeout'];
function LxTextFieldController($scope, $timeout)
{
var lxTextField = this;
var input;
var modelController;
var timer;
lxTextField.blurInput = blurInput;
lxTextField.clearInput = clearInput;
lxTextField.focusInput = focusInput;
lxTextField.hasValue = hasValue;
lxTextField.setInput = setInput;
lxTextField.setModel = setModel;
lxTextField.updateTextareaHeight = updateTextareaHeight;
$scope.$watch(function()
{
return modelController.$viewValue;
}, function(newValue, oldValue)
{
if (angular.isDefined(newValue) && newValue)
{
lxTextField.isActive = true;
}
else
{
lxTextField.isActive = false;
}
if (newValue !== oldValue && newValue)
{
updateTextareaHeight();
}
});
$scope.$watch(function()
{
return lxTextField.focus;
}, function(newValue, oldValue)
{
if (angular.isDefined(newValue) && newValue)
{
$timeout(function()
{
input.focus();
// Reset the value so we can re-focus the field later on if we want to.
lxTextField.focus = false;
});
}
});
$scope.$on('$destroy', function()
{
$timeout.cancel(timer);
});
////////////
function blurInput()
{
if (!hasValue())
{
$scope.$apply(function()
{
lxTextField.isActive = false;
});
}
$scope.$apply(function()
{
lxTextField.isFocus = false;
});
}
function clearInput(_event)
{
_event.stopPropagation();
modelController.$setViewValue(undefined);
modelController.$render();
}
function focusInput()
{
lxTextField.isActive = true;
lxTextField.isFocus = true;
}
function hasValue()
{
return angular.isDefined(input.val()) && input.val().length > 0;
}
function init()
{
lxTextField.isActive = hasValue();
lxTextField.focus = angular.isDefined(lxTextField.focus) ? lxTextField.focus : false;
lxTextField.isFocus = lxTextField.focus;
}
function setInput(_input)
{
input = _input;
timer = $timeout(init);
}
function setModel(_modelControler)
{
modelController = _modelControler;
}
function updateTextareaHeight()
{
if (!input.is('textarea'))
{
return;
}
var tmpTextArea = angular.element('<textarea class="text-field__input" style="width: ' + input.width() + 'px;">' + input.val() + '</textarea>');
tmpTextArea.appendTo('body');
input.css(
{
height: tmpTextArea[0].scrollHeight + 'px'
});
tmpTextArea.remove();
}
}
})();
(function()
{
'use strict';
angular
.module('lumx.tooltip')
.directive('lxTooltip', lxTooltip);
function lxTooltip()
{
return {
restrict: 'A',
scope:
{
tooltip: '@lxTooltip',
position: '@?lxTooltipPosition'
},
link: link,
controller: LxTooltipController,
controllerAs: 'lxTooltip',
bindToController: true
};
function link(scope, element, attrs, ctrl)
{
if (angular.isDefined(attrs.lxTooltip))
{
attrs.$observe('lxTooltip', function(newValue)
{
ctrl.updateTooltipText(newValue);
});
}
if (angular.isDefined(attrs.lxTooltipPosition))
{
attrs.$observe('lxTooltipPosition', function(newValue)
{
scope.lxTooltip.position = newValue;
});
}
if (angular.element(window).outerWidth() > 768) {
element.on('mouseenter', ctrl.showTooltip);
element.on('mouseleave', ctrl.hideTooltip);
}
scope.$on('$destroy', function()
{
element.off();
});
}
}
LxTooltipController.$inject = ['$element', '$scope', '$timeout', 'LxDepthService', 'LxUtils'];
function LxTooltipController($element, $scope, $timeout, LxDepthService, LxUtils)
{
var lxTooltip = this;
var timer1;
var timer2;
var tooltip;
var tooltipBackground;
var tooltipLabel;
lxTooltip.hideTooltip = hideTooltip;
lxTooltip.showTooltip = showTooltip;
lxTooltip.updateTooltipText = updateTooltipText;
lxTooltip.position = angular.isDefined(lxTooltip.position) ? lxTooltip.position : 'top';
$scope.$on('$destroy', function()
{
if (angular.isDefined(tooltip))
{
tooltip.remove();
tooltip = undefined;
}
$timeout.cancel(timer1);
$timeout.cancel(timer2);
});
////////////
function hideTooltip()
{
if (angular.isDefined(tooltip))
{
tooltip.removeClass('tooltip--is-active');
timer1 = $timeout(function()
{
if (angular.isDefined(tooltip))
{
angular.element(document).off('scroll', _debouncedSetPosition);
tooltip.remove();
tooltip = undefined;
}
}, 200);
}
}
function setTooltipPosition()
{
var topOffset = ($('.scroll-mask')) ? $('body').css('top') : 0;
topOffset = (topOffset) ? parseInt(topOffset, 10) : 0;
topOffset = (isNaN(topOffset)) ? 0 : topOffset;
var width = $element.outerWidth(),
height = $element.outerHeight(),
top = $element.offset().top - topOffset,
left = $element.offset().left;
tooltip
.append(tooltipBackground)
.append(tooltipLabel)
.appendTo('body');
if (lxTooltip.position === 'top')
{
tooltip.css(
{
left: left - (tooltip.outerWidth() / 2) + (width / 2),
top: top - tooltip.outerHeight()
});
}
else if (lxTooltip.position === 'bottom')
{
tooltip.css(
{
left: left - (tooltip.outerWidth() / 2) + (width / 2),
top: top + height
});
}
else if (lxTooltip.position === 'left')
{
tooltip.css(
{
left: left - tooltip.outerWidth(),
top: top + (height / 2) - (tooltip.outerHeight() / 2)
});
}
else if (lxTooltip.position === 'right')
{
tooltip.css(
{
left: left + width,
top: top + (height / 2) - (tooltip.outerHeight() / 2)
});
}
}
var _debouncedSetPosition = LxUtils.debounce(setTooltipPosition, 250);
function showTooltip()
{
if (angular.isUndefined(tooltip))
{
LxDepthService.register();
tooltip = angular.element('<div/>',
{
class: 'tooltip tooltip--' + lxTooltip.position
});
tooltipBackground = angular.element('<div/>',
{
class: 'tooltip__background'
});
tooltipLabel = angular.element('<span/>',
{
class: 'tooltip__label',
text: lxTooltip.tooltip
});
setTooltipPosition();
angular.element(document).on('scroll', _debouncedSetPosition);
tooltip
.append(tooltipBackground)
.append(tooltipLabel)
.css('z-index', LxDepthService.getDepth())
.appendTo('body');
timer2 = $timeout(function()
{
tooltip.addClass('tooltip--is-active');
});
}
}
function updateTooltipText(_newValue)
{
if (angular.isDefined(tooltipLabel))
{
tooltipLabel.text(_newValue);
}
}
}
})();
angular.module("lumx.dropdown").run(['$templateCache', function(a) { a.put('dropdown.html', '<div class="dropdown"\n' +
' ng-class="{ \'dropdown--has-toggle\': lxDropdown.hasToggle,\n' +
' \'dropdown--is-open\': lxDropdown.isOpen }"\n' +
' ng-transclude></div>\n' +
'');
a.put('dropdown-toggle.html', '<div class="dropdown-toggle" ng-transclude></div>\n' +
'');
a.put('dropdown-menu.html', '<div class="dropdown-menu">\n' +
' <div class="dropdown-menu__content" ng-transclude ng-if="lxDropdownMenu.parentCtrl.isOpen"></div>\n' +
'</div>\n' +
'');
}]);
angular.module("lumx.file-input").run(['$templateCache', function(a) { a.put('file-input.html', '<div class="input-file">\n' +
' <span class="input-file__label">{{ lxFileInput.label }}</span>\n' +
' <span class="input-file__filename">{{ lxFileInput.fileName }}</span>\n' +
' <input type="file" class="input-file__input" accept="{{ lxFileInput.accept }}">\n' +
'</div>\n' +
'');
}]);
angular.module("lumx.text-field").run(['$templateCache', function(a) { a.put('text-field.html', '<div class="text-field"\n' +
' ng-class="{ \'text-field--error\': lxTextField.error,\n' +
' \'text-field--fixed-label\': lxTextField.fixedLabel,\n' +
' \'text-field--has-icon\': lxTextField.icon,\n' +
' \'text-field--has-value\': lxTextField.hasValue(),\n' +
' \'text-field--is-active\': lxTextField.isActive,\n' +
' \'text-field--is-disabled\': lxTextField.ngDisabled,\n' +
' \'text-field--is-focus\': lxTextField.isFocus,\n' +
' \'text-field--theme-light\': !lxTextField.theme || lxTextField.theme === \'light\',\n' +
' \'text-field--theme-dark\': lxTextField.theme === \'dark\',\n' +
' \'text-field--valid\': lxTextField.valid }">\n' +
' <div class="text-field__icon" ng-if="lxTextField.icon">\n' +
' <i class="mdi mdi-{{ lxTextField.icon }}"></i>\n' +
' </div>\n' +
'\n' +
' <label class="text-field__label">\n' +
' {{ lxTextField.label }}\n' +
' </label>\n' +
'\n' +
' <div ng-transclude></div>\n' +
'\n' +
' <span class="text-field__clear" ng-click="lxTextField.clearInput($event)" ng-if="lxTextField.allowClear">\n' +
' <i class="mdi mdi-close-circle"></i>\n' +
' </span>\n' +
'</div>\n' +
'');
}]);
angular.module("lumx.search-filter").run(['$templateCache', function(a) { a.put('search-filter.html', '<div class="search-filter" ng-class="lxSearchFilter.getClass()">\n' +
' <div class="search-filter__container">\n' +
' <div class="search-filter__button">\n' +
' <lx-button type="submit" lx-size="l" lx-color="{{ lxSearchFilter.color }}" lx-type="icon" ng-click="lxSearchFilter.openInput()">\n' +
' <i class="mdi mdi-magnify"></i>\n' +
' </lx-button>\n' +
' </div>\n' +
'\n' +
' <div class="search-filter__input" ng-transclude></div>\n' +
'\n' +
' <div class="search-filter__clear">\n' +
' <lx-button type="button" lx-size="l" lx-color="{{ lxSearchFilter.color }}" lx-type="icon" ng-click="lxSearchFilter.clearInput()">\n' +
' <i class="mdi mdi-close"></i>\n' +
' </lx-button>\n' +
' </div>\n' +
' </div>\n' +
'\n' +
' <div class="search-filter__loader" ng-if="lxSearchFilter.isLoading">\n' +
' <lx-progress lx-type="linear"></lx-progress>\n' +
' </div>\n' +
'\n' +
' <lx-dropdown id="{{ lxSearchFilter.dropdownId }}" lx-effect="none" lx-width="100%" ng-if="lxSearchFilter.autocomplete">\n' +
' <lx-dropdown-menu class="search-filter__autocomplete-list">\n' +
' <ul>\n' +
' <li ng-repeat="item in lxSearchFilter.autocompleteList track by $index">\n' +
' <a class="search-filter__autocomplete-item"\n' +
' ng-class="{ \'search-filter__autocomplete-item--is-active\': lxSearchFilter.activeChoiceIndex === $index }"\n' +
' ng-click="lxSearchFilter.selectItem(item)"\n' +
' ng-bind-html="item | lxSearchHighlight:lxSearchFilter.modelController.$viewValue:lxSearchFilter.icon"></a>\n' +
' </li>\n' +
' </ul>\n' +
' </lx-dropdown-menu>\n' +
' </lx-dropdown>\n' +
'</div>');
}]);
angular.module("lumx.select").run(['$templateCache', function(a) { a.put('select.html', '<div class="lx-select"\n' +
' ng-class="{ \'lx-select--error\': lxSelect.error,\n' +
' \'lx-select--fixed-label\': lxSelect.fixedLabel && lxSelect.viewMode === \'field\',\n' +
' \'lx-select--is-active\': (!lxSelect.multiple && lxSelect.getSelectedModel()) || (lxSelect.multiple && lxSelect.getSelectedModel().length) || (lxSelect.choicesViewMode === \'panes\' && lxSelect.areChoicesOpened()),\n' +
' \'lx-select--is-disabled\': lxSelect.ngDisabled,\n' +
' \'lx-select--is-multiple\': lxSelect.multiple,\n' +
' \'lx-select--is-unique\': !lxSelect.multiple,\n' +
' \'lx-select--theme-light\': !lxSelect.theme || lxSelect.theme === \'light\',\n' +
' \'lx-select--theme-dark\': lxSelect.theme === \'dark\',\n' +
' \'lx-select--valid\': lxSelect.valid,\n' +
' \'lx-select--custom-style\': lxSelect.customStyle,\n' +
' \'lx-select--default-style\': !lxSelect.customStyle,\n' +
' \'lx-select--view-mode-field\': !lxSelect.multiple || (lxSelect.multiple && lxSelect.viewMode === \'field\'),\n' +
' \'lx-select--view-mode-chips\': lxSelect.multiple && lxSelect.viewMode === \'chips\',\n' +
' \'lx-select--panes\': lxSelect.choicesViewMode === \'panes\',\n' +
' \'lx-select--with-filter\': lxSelect.displayFilter,\n' +
' \'lx-select--autocomplete\': lxSelect.autocomplete }">\n' +
' <span class="lx-select-label" ng-if="!lxSelect.autocomplete">\n' +
' {{ lxSelect.label }}\n' +
' </span>\n' +
'\n' +
' <lx-dropdown id="dropdown-{{ lxSelect.uuid }}" lx-width="{{ (lxSelect.choicesViewMode === \'panes\') ? \'\' : \'100%\' }}"\n' +
' lx-effect="{{ lxSelect.autocomplete ? \'none\' : \'expand\' }}">\n' +
' <ng-transclude></ng-transclude>\n' +
' </lx-dropdown>\n' +
'</div>\n' +
'');
a.put('select-selected.html', '<div>\n' +
' <lx-dropdown-toggle ng-if="::!lxSelectSelected.parentCtrl.autocomplete">\n' +
' <ng-include src="\'select-selected-content.html\'"></ng-include>\n' +
' </lx-dropdown-toggle>\n' +
'\n' +
' <ng-include src="\'select-selected-content.html\'" ng-if="::lxSelectSelected.parentCtrl.autocomplete"></ng-include>\n' +
'</div>\n' +
'');
a.put('select-selected-content.html', '<div class="lx-select-selected-wrapper"\n' +
' ng-class="{ \'lx-select-selected-wrapper--with-filter\': !lxSelectSelected.parentCtrl.ngDisabled && lxSelectSelected.parentCtrl.areChoicesOpened() && (lxSelectSelected.parentCtrl.multiple || !lxSelectSelected.parentCtrl.getSelectedModel()) }"\n' +
' id="lx-select-selected-wrapper-{{ lxSelectSelected.parentCtrl.uuid }}">\n' +
' <div class="lx-select-selected"\n' +
' ng-if="!lxSelectSelected.parentCtrl.multiple">\n' +
' <span class="lx-select-selected__value"\n' +
' ng-bind-html="lxSelectSelected.parentCtrl.displaySelected()"\n' +
' ng-if="lxSelectSelected.parentCtrl.getSelectedModel()"></span>\n' +
'\n' +
' <a class="lx-select-selected__clear"\n' +
' ng-click="lxSelectSelected.clearModel($event)"\n' +
' ng-if="lxSelectSelected.parentCtrl.allowClear && lxSelectSelected.parentCtrl.getSelectedModel()">\n' +
' <i class="mdi mdi-close-circle"></i>\n' +
' </a>\n' +
' </div>\n' +
'\n' +
' <div class="lx-select-selected" ng-if="lxSelectSelected.parentCtrl.multiple">\n' +
' <span class="lx-select-selected__tag"\n' +
' ng-class="{ \'lx-select-selected__tag--is-active\': lxSelectSelected.parentCtrl.activeSelectedIndex === $index }"\n' +
' ng-click="lxSelectSelected.removeSelected(selected, $event)"\n' +
' ng-repeat="selected in lxSelectSelected.parentCtrl.getSelectedModel()"\n' +
' ng-bind-html="lxSelectSelected.parentCtrl.displaySelected(selected)"></span>\n' +
'\n' +
' <input type="text"\n' +
' placeholder="{{ ::lxSelectSelected.parentCtrl.label }}"\n' +
' class="lx-select-selected__filter"\n' +
' ng-model="lxSelectSelected.parentCtrl.filterModel"\n' +
' ng-change="lxSelectSelected.parentCtrl.updateFilter()"\n' +
' ng-keydown="lxSelectSelected.parentCtrl.keyEvent($event)"\n' +
' ng-if="lxSelectSelected.parentCtrl.autocomplete && !lxSelectSelected.parentCtrl.ngDisabled">\n' +
' </div>\n' +
'\n' +
' <lx-search-filter lx-dropdown-filter class="lx-select-selected__filter" ng-if="lxSelectSelected.parentCtrl.choicesViewMode === \'panes\' && !lxSelectSelected.parentCtrl.ngDisabled && lxSelectSelected.parentCtrl.areChoicesOpened() && (lxSelectSelected.parentCtrl.multiple || !lxSelectSelected.parentCtrl.getSelectedModel())">\n' +
' <input type="text"\n' +
' ng-model="lxSelectSelected.parentCtrl.filterModel"\n' +
' ng-change="lxSelectSelected.parentCtrl.updateFilter()"\n' +
' lx-stop-propagation="click">\n' +
' </lx-search-filter>\n' +
'</div>\n' +
'');
a.put('select-choices.html', '<lx-dropdown-menu class="lx-select-choices"\n' +
' ng-class="{ \'lx-select-choices--custom-style\': lxSelectChoices.parentCtrl.choicesCustomStyle,\n' +
' \'lx-select-choices--default-style\': !lxSelectChoices.parentCtrl.choicesCustomStyle,\n' +
' \'lx-select-choices--is-multiple\': lxSelectChoices.parentCtrl.multiple,\n' +
' \'lx-select-choices--is-unique\': !lxSelectChoices.parentCtrl.multiple,\n' +
' \'lx-select-choices--list\': lxSelectChoices.parentCtrl.choicesViewMode === \'list\',\n' +
' \'lx-select-choices--multi-panes\': lxSelectChoices.parentCtrl.choicesViewMode === \'panes\' }">\n' +
' <ul ng-if="::lxSelectChoices.parentCtrl.choicesViewMode === \'list\'">\n' +
' <li class="lx-select-choices__filter" ng-if="::lxSelectChoices.parentCtrl.displayFilter && !lxSelectChoices.parentCtrl.autocomplete">\n' +
' <lx-search-filter lx-dropdown-filter>\n' +
' <input type="text" ng-model="lxSelectChoices.parentCtrl.filterModel" ng-change="lxSelectChoices.parentCtrl.updateFilter()">\n' +
' </lx-search-filter>\n' +
' </li>\n' +
'\n' +
' <div ng-if="::lxSelectChoices.isArray()">\n' +
' <li class="lx-select-choices__choice"\n' +
' ng-class="{ \'lx-select-choices__choice--is-selected\': lxSelectChoices.parentCtrl.isSelected(choice),\n' +
' \'lx-select-choices__choice--is-focus\': lxSelectChoices.parentCtrl.activeChoiceIndex === $index }"\n' +
' ng-repeat="choice in lxSelectChoices.parentCtrl.choices | filterChoices:lxSelectChoices.parentCtrl.filter:lxSelectChoices.parentCtrl.filterModel"\n' +
' ng-bind-html="::lxSelectChoices.parentCtrl.displayChoice(choice)"\n' +
' ng-click="lxSelectChoices.parentCtrl.toggleChoice(choice, $event)"></li>\n' +
' </div>\n' +
'\n' +
' <div ng-if="::!lxSelectChoices.isArray()">\n' +
' <li class="lx-select-choices__subheader"\n' +
' ng-repeat-start="(subheader, children) in lxSelectChoices.parentCtrl.choices"\n' +
' ng-bind-html="::lxSelectChoices.parentCtrl.displaySubheader(subheader)"></li>\n' +
'\n' +
' <li class="lx-select-choices__choice"\n' +
' ng-class="{ \'lx-select-choices__choice--is-selected\': lxSelectChoices.parentCtrl.isSelected(choice),\n' +
' \'lx-select-choices__choice--is-focus\': lxSelectChoices.parentCtrl.activeChoiceIndex === $index }"\n' +
' ng-repeat-end\n' +
' ng-repeat="choice in children | filterChoices:lxSelectChoices.parentCtrl.filter:lxSelectChoices.parentCtrl.filterModel"\n' +
' ng-bind-html="::lxSelectChoices.parentCtrl.displayChoice(choice)"\n' +
' ng-click="lxSelectChoices.parentCtrl.toggleChoice(choice, $event)"></li>\n' +
' </div>\n' +
'\n' +
' <li class="lx-select-choices__subheader" ng-if="lxSelectChoices.parentCtrl.helperDisplayable()">\n' +
' {{ lxSelectChoices.parentCtrl.helperMessage }}\n' +
' </li>\n' +
'\n' +
' <li class="lx-select-choices__loader" ng-if="lxSelectChoices.parentCtrl.loading">\n' +
' <lx-progress lx-type="circular" lx-color="primary" lx-diameter="20"></lx-progress>\n' +
' </li>\n' +
' </ul>\n' +
'\n' +
' <div class="lx-select-choices__panes-wrapper" ng-if="lxSelectChoices.parentCtrl.choicesViewMode === \'panes\' && lxSelectChoices.parentCtrl.choicesViewSize === \'large\'" lx-stop-propagation="click">\n' +
' <div class="lx-select-choices__loader" ng-if="lxSelectChoices.parentCtrl.loading">\n' +
' <lx-progress lx-type="circular" lx-color="white" lx-diameter="60"></lx-progress>\n' +
' </div>\n' +
'\n' +
' <div class="lx-select-choices__panes-container" ng-if="!lxSelectChoices.parentCtrl.loading">\n' +
' <div class="lx-select-choices__pane lx-select-choices__pane-{{ $index }}"\n' +
' ng-class="{ \'lx-select-choices__pane--is-filtering\': lxSelectChoices.parentCtrl.matchingPaths !== undefined,\n' +
' \'lx-select-choices__pane--first\': $first,\n' +
' \'lx-select-choices__pane--last\': $last }"\n' +
' ng-repeat="pane in lxSelectChoices.parentCtrl.panes">\n' +
' <div ng-repeat="(label, items) in pane"\n' +
' class="lx-select-choices__pane-choice"\n' +
' ng-class="{ \'lx-select-choices__pane-choice--is-selected\': lxSelectChoices.parentCtrl.isPaneToggled($parent.$index, label) || lxSelectChoices.parentCtrl.isSelected(items) || ($parent.$last && lxSelectChoices.parentCtrl.activeChoiceIndex === $index),\n' +
' \'lx-select-choices__pane-choice--is-matching\': lxSelectChoices.parentCtrl.isMatchingPath($parent.$index, label),\n' +
' \'lx-select-choices__pane-choice--is-leaf\': lxSelectChoices.isArray(pane) }"\n' +
' ng-bind-html="(lxSelectChoices.isArray(pane)) ? lxSelectChoices.parentCtrl.displayChoice(items) : lxSelectChoices.parentCtrl.displaySubheader(label)"\n' +
' ng-click="lxSelectChoices.parentCtrl.togglePane($event, $parent.$index, label, true)">\n' +
' </div>\n' +
' </div>\n' +
' </div>\n' +
' </div>\n' +
'\n' +
' <div class="lx-select-choices__panes-wrapper" ng-if="lxSelectChoices.parentCtrl.choicesViewMode === \'panes\' && lxSelectChoices.parentCtrl.choicesViewSize === \'small\'" lx-stop-propagation="click">\n' +
' <div class="lx-select-choices__loader" ng-if="lxSelectChoices.parentCtrl.loading">\n' +
' <lx-progress lx-type="circular" lx-color="white" lx-diameter="60"></lx-progress>\n' +
' </div>\n' +
' <div class="lx-select-choices__panes-container" ng-if="!lxSelectChoices.parentCtrl.loading">\n' +
' <div class="lx-select-choices__pane lx-select-choices__pane"\n' +
' ng-class="{ \'lx-select-choices__pane--is-filtering\': lxSelectChoices.parentCtrl.matchingPaths !== undefined,\n' +
' \'lx-select-choices__pane--first\': $first,\n' +
' \'lx-select-choices__pane--last\': $last }"\n' +
' ng-repeat="pane in lxSelectChoices.parentCtrl.panes">\n' +
' <div ng-include="\'select-choices-accordion.html\'" ng-init="level = 0"></div>\n' +
' </div>\n' +
' </div>\n' +
' </div>\n' +
'\n' +
'</lx-dropdown-menu>\n' +
'');
a.put('select-choices-accordion.html', '<div ng-repeat="(label, items) in pane">\n' +
' <div class="lx-select-choices__pane-choice lx-select-choices__pane-{{ level }}"\n' +
' ng-class="{ \'lx-select-choices__pane-choice--is-selected\': lxSelectChoices.parentCtrl.isPaneToggled(level, label) || lxSelectChoices.parentCtrl.isSelected(items),\n' +
' \'lx-select-choices__pane-choice--is-matching\': lxSelectChoices.parentCtrl.isMatchingPath(level, label),\n' +
' \'lx-select-choices__pane-choice--is-leaf\': lxSelectChoices.isArray(pane) }"\n' +
' ng-bind-html="(lxSelectChoices.isArray(pane)) ? lxSelectChoices.parentCtrl.displayChoice(items) : lxSelectChoices.parentCtrl.displaySubheader(label)"\n' +
' ng-click="lxSelectChoices.parentCtrl.togglePane($event, level, label, true)"></div>\n' +
'\n' +
' <div ng-include="\'select-choices-accordion.html\'"\n' +
' ng-if="!lxSelectChoices.isArray(pane) && lxSelectChoices.parentCtrl.isPaneToggled(level,label)"\n' +
' ng-init="pane = items; level = level + 1"></div>\n' +
'</div>\n' +
'');
}]);
angular.module("lumx.tabs").run(['$templateCache', function(a) { a.put('tabs.html', '<div class="tabs tabs--layout-{{ lxTabs.layout }} tabs--theme-{{ lxTabs.theme }} tabs--color-{{ lxTabs.color }} tabs--indicator-{{ lxTabs.indicator }}">\n' +
' <div class="tabs__panes" ng-if="lxTabs.viewMode === \'gather\' && lxTabs.bottomPosition" ng-transclude></div>\n' +
' <div class="tabs__links">\n' +
' <a class="tabs__link"\n' +
' ng-class="{ \'tabs__link--is-active\': lxTabs.tabIsActive(tab.index),\n' +
' \'tabs__link--is-disabled\': tab.disabled }"\n' +
' ng-repeat="tab in lxTabs.tabs"\n' +
' ng-click="lxTabs.setActiveTab(tab)"\n' +
' lx-ripple>\n' +
' <i class="mdi mdi-{{ tab.icon }}" ng-if="tab.icon"></i>\n' +
' <span ng-if="tab.label">{{ tab.label }}</span>\n' +
' </a>\n' +
' </div>\n' +
' \n' +
' <div class="tabs__panes" ng-if="lxTabs.viewMode === \'gather\' && !lxTabs.bottomPosition" ng-transclude></div>\n' +
' <div class="tabs__indicator" ng-class="{\'tabs__indicator--top\': !lxTabs.bottomPosition, \'tabs__indicator--bottom\': lxTabs.bottomPosition}"></div>\n' +
'</div>\n' +
'');
a.put('tabs-panes.html', '<div class="tabs tabs--separate">\n' +
' <div class="tabs__panes" ng-transclude></div>\n' +
'</div>');
a.put('tab.html', '<div class="tabs__pane" ng-class="{ \'tabs__pane--is-disabled\': lxTab.ngDisabled }">\n' +
' <div ng-if="lxTab.tabIsActive()" ng-transclude></div>\n' +
'</div>\n' +
'');
a.put('tab-pane.html', '<div class="tabs__pane" ng-transclude></div>\n' +
'');
}]);
angular.module("lumx.date-picker").run(['$templateCache', function(a) { a.put('date-picker.html', '<div class="lx-date">\n' +
' <!-- Date picker input -->\n' +
' <div class="lx-date-input" ng-click="lxDatePicker.openDatePicker()" ng-if="lxDatePicker.hasInput">\n' +
' <ng-transclude></ng-transclude>\n' +
' </div>\n' +
' \n' +
' <!-- Date picker -->\n' +
' <div class="lx-date-picker lx-date-picker--{{ lxDatePicker.color }}">\n' +
' <div ng-if="lxDatePicker.isOpen">\n' +
' <!-- Date picker: header -->\n' +
' <div class="lx-date-picker__header">\n' +
' <a class="lx-date-picker__current-year"\n' +
' ng-class="{ \'lx-date-picker__current-year--is-active\': lxDatePicker.yearSelection }"\n' +
' ng-click="lxDatePicker.displayYearSelection()">\n' +
' {{ lxDatePicker.moment(lxDatePicker.ngModel).format(\'YYYY\') }}\n' +
' </a>\n' +
'\n' +
' <a class="lx-date-picker__current-date"\n' +
' ng-class="{ \'lx-date-picker__current-date--is-active\': !lxDatePicker.yearSelection }"\n' +
' ng-click="lxDatePicker.hideYearSelection()">\n' +
' {{ lxDatePicker.getDateFormatted() }}\n' +
' </a>\n' +
' </div>\n' +
' \n' +
' <!-- Date picker: content -->\n' +
' <div class="lx-date-picker__content">\n' +
' <!-- Calendar -->\n' +
' <div class="lx-date-picker__calendar" ng-if="!lxDatePicker.yearSelection">\n' +
' <div class="lx-date-picker__nav">\n' +
' <lx-button lx-size="l" lx-color="black" lx-type="icon" ng-click="lxDatePicker.previousMonth()">\n' +
' <i class="mdi mdi-chevron-left"></i>\n' +
' </lx-button>\n' +
'\n' +
' <span>{{ lxDatePicker.ngModelMoment.format(\'MMMM YYYY\') }}</span>\n' +
' \n' +
' <lx-button lx-size="l" lx-color="black" lx-type="icon" ng-click="lxDatePicker.nextMonth()">\n' +
' <i class="mdi mdi-chevron-right"></i>\n' +
' </lx-button>\n' +
' </div>\n' +
'\n' +
' <div class="lx-date-picker__days-of-week">\n' +
' <span ng-repeat="day in lxDatePicker.daysOfWeek">{{ day }}</span>\n' +
' </div>\n' +
'\n' +
' <div class="lx-date-picker__days">\n' +
' <span class="lx-date-picker__day lx-date-picker__day--is-empty"\n' +
' ng-repeat="x in lxDatePicker.emptyFirstDays"> </span>\n' +
'\n' +
' <div class="lx-date-picker__day"\n' +
' ng-class="{ \'lx-date-picker__day--is-selected\': day.selected,\n' +
' \'lx-date-picker__day--is-today\': day.today && !day.selected,\n' +
' \'lx-date-picker__day--is-disabled\': day.disabled }"\n' +
' ng-repeat="day in lxDatePicker.days">\n' +
' <a ng-click="lxDatePicker.select(day)">{{ day ? day.format(\'D\') : \'\' }}</a>\n' +
' </div>\n' +
'\n' +
' <span class="lx-date-picker__day lx-date-picker__day--is-empty"\n' +
' ng-repeat="x in lxDatePicker.emptyLastDays"> </span>\n' +
' </div>\n' +
' </div>\n' +
'\n' +
' <!-- Year selection -->\n' +
' <div class="lx-date-picker__year-selector" ng-if="lxDatePicker.yearSelection">\n' +
' <a class="lx-date-picker__year"\n' +
' ng-class="{ \'lx-date-picker__year--is-active\': year == lxDatePicker.moment(lxDatePicker.ngModel).format(\'YYYY\') }"\n' +
' ng-repeat="year in lxDatePicker.years"\n' +
' ng-click="lxDatePicker.selectYear(year)"\n' +
' ng-if="lxDatePicker.yearSelection">\n' +
' {{ year }}\n' +
' </a>\n' +
' </div>\n' +
' </div>\n' +
'\n' +
' <!-- Actions -->\n' +
' <div class="lx-date-picker__actions">\n' +
' <lx-button lx-color="{{ lxDatePicker.color }}" lx-type="flat" ng-click="lxDatePicker.closeDatePicker()">\n' +
' Ok\n' +
' </lx-button>\n' +
' </div>\n' +
' </div>\n' +
' </div>\n' +
'</div>');
}]);
angular.module("lumx.progress").run(['$templateCache', function(a) { a.put('progress.html', '<div class="progress-container progress-container--{{ lxProgress.lxType }} progress-container--{{ lxProgress.lxColor }} {{ lxProgress.lxClass }}">\n' +
' <div class="progress-circular"\n' +
' ng-if="lxProgress.lxType === \'circular\'"\n' +
' ng-style="lxProgress.getProgressDiameter()">\n' +
' <svg class="progress-circular__svg">\n' +
' <g transform="translate(50 50)">\n' +
' <g class="progress-circular__g">\n' +
' <circle class="progress-circular__path" cx="0" cy="0" r="20" fill="none" stroke-width="4" stroke-miterlimit="10" ng-style="lxProgress.getCircularProgressValue()"></circle>\n' +
' </g>\n' +
' </g>\n' +
' </svg>\n' +
' </div>\n' +
'\n' +
' <div class="progress-linear" ng-if="lxProgress.lxType === \'linear\'">\n' +
' <div class="progress-linear__background"></div>\n' +
' <div class="progress-linear__bar progress-linear__bar--first" ng-style="lxProgress.getLinearProgressValue()"></div>\n' +
' <div class="progress-linear__bar progress-linear__bar--second"></div>\n' +
' </div>\n' +
'</div>\n' +
'');
}]);
angular.module("lumx.button").run(['$templateCache', function(a) { a.put('link.html', '<a ng-transclude lx-ripple></a>\n' +
'');
a.put('button.html', '<button ng-transclude lx-ripple></button>\n' +
'');
}]);
angular.module("lumx.checkbox").run(['$templateCache', function(a) { a.put('checkbox.html', '<div class="checkbox checkbox--{{ lxCheckbox.lxColor }}"\n' +
' ng-class="{ \'checkbox--theme-light\': !lxCheckbox.lxTheme || lxCheckbox.lxTheme === \'light\',\n' +
' \'checkbox--theme-dark\': lxCheckbox.lxTheme === \'dark\' }">\n' +
' <input id="{{ lxCheckbox.getCheckboxId() }}"\n' +
' type="checkbox"\n' +
' class="checkbox__input"\n' +
' name="{{ lxCheckbox.name }}"\n' +
' ng-model="lxCheckbox.ngModel"\n' +
' ng-true-value="{{ lxCheckbox.ngTrueValue }}"\n' +
' ng-false-value="{{ lxCheckbox.ngFalseValue }}"\n' +
' ng-change="lxCheckbox.triggerNgChange()"\n' +
' ng-disabled="lxCheckbox.ngDisabled">\n' +
' <label for="{{ lxCheckbox.getCheckboxId() }}" class="checkbox__label" ng-transclude ng-if="!lxCheckbox.getCheckboxHasChildren()"></label>\n' +
' <ng-transclude-replace ng-if="lxCheckbox.getCheckboxHasChildren()"></ng-transclude-replace>\n' +
'</div>\n' +
'');
a.put('checkbox-label.html', '<label for="{{ lxCheckboxLabel.getCheckboxId() }}" class="checkbox__label" ng-transclude></label>\n' +
'');
a.put('checkbox-help.html', '<span class="checkbox__help" ng-transclude></span>\n' +
'');
}]);
angular.module("lumx.radio-button").run(['$templateCache', function(a) { a.put('radio-group.html', '<div class="radio-group" ng-transclude></div>\n' +
'');
a.put('radio-button.html', '<div class="radio-button radio-button--{{ lxRadioButton.lxColor }}"\n' +
' ng-class="{ \'radio-button--theme-light\': !lxRadioButton.lxTheme || lxRadioButton.lxTheme === \'light\',\n' +
' \'radio-button--theme-dark\': lxRadioButton.lxTheme === \'dark\' }">\n' +
' <input id="{{ lxRadioButton.getRadioButtonId() }}"\n' +
' type="radio"\n' +
' class="radio-button__input"\n' +
' name="{{ lxRadioButton.name }}"\n' +
' ng-model="lxRadioButton.ngModel"\n' +
' ng-value="lxRadioButton.ngValue"\n' +
' ng-change="lxRadioButton.triggerNgChange()"\n' +
' ng-disabled="lxRadioButton.ngDisabled">\n' +
' <label for="{{ lxRadioButton.getRadioButtonId() }}" class="radio-button__label" ng-transclude ng-if="!lxRadioButton.getRadioButtonHasChildren()"></label>\n' +
' <ng-transclude-replace ng-if="lxRadioButton.getRadioButtonHasChildren()"></ng-transclude-replace>\n' +
'</div>\n' +
'');
a.put('radio-button-label.html', '<label for="{{ lxRadioButtonLabel.getRadioButtonId() }}" class="radio-button__label" ng-transclude></label>\n' +
'');
a.put('radio-button-help.html', '<span class="radio-button__help" ng-transclude></span>\n' +
'');
}]);
angular.module("lumx.stepper").run(['$templateCache', function(a) { a.put('stepper.html', '<div class="lx-stepper" ng-class="lxStepper.getClasses()">\n' +
' <div class="lx-stepper__header" ng-if="lxStepper.layout === \'horizontal\'">\n' +
' <div class="lx-stepper__nav">\n' +
' <lx-step-nav lx-active-index="{{ lxStepper.activeIndex }}" lx-step="step" ng-repeat="step in lxStepper.steps"></lx-step-nav>\n' +
' </div>\n' +
'\n' +
' <div class="lx-stepper__feedback" ng-if="lxStepper.steps[lxStepper.activeIndex].feedback">\n' +
' <span>{{ lxStepper.steps[lxStepper.activeIndex].feedback }}</span>\n' +
' </div>\n' +
' </div>\n' +
'\n' +
' <div class="lx-stepper__steps" ng-transclude></div>\n' +
'</div>');
a.put('step.html', '<div class="lx-step" ng-class="lxStep.getClasses()">\n' +
' <div class="lx-step__nav" ng-if="lxStep.parent.layout === \'vertical\'">\n' +
' <lx-step-nav lx-active-index="{{ lxStep.parent.activeIndex }}" lx-step="lxStep.step"></lx-step-nav>\n' +
' </div>\n' +
'\n' +
' <div class="lx-step__wrapper" ng-if="lxStep.parent.activeIndex === lxStep.step.index">\n' +
' <div class="lx-step__content">\n' +
' <ng-transclude></ng-transclude>\n' +
'\n' +
' <div class="lx-step__progress" ng-if="lxStep.step.isLoading">\n' +
' <lx-progress lx-type="circular"></lx-progress>\n' +
' </div>\n' +
' </div>\n' +
'\n' +
' <div class="lx-step__actions" ng-if="lxStep.parent.activeIndex === lxStep.step.index && lxStep.parent.controls">\n' +
' <div class="lx-step__action lx-step__action--continue">\n' +
' <lx-button ng-click="lxStep.submitStep()" ng-disabled="lxStep.isLoading">{{ lxStep.parent.labels.continue }}</lx-button>\n' +
' </div>\n' +
'\n' +
' <div class="lx-step__action lx-step__action--cancel" ng-if="lxStep.parent.cancel">\n' +
' <lx-button lx-color="black" lx-type="flat" ng-click="lxStep.parent.cancel()" ng-disabled="lxStep.isLoading">{{ lxStep.parent.labels.cancel }}</lx-button>\n' +
' </div>\n' +
'\n' +
' <div class="lx-step__action lx-step__action--back" ng-if="lxStep.parent.isLinear">\n' +
' <lx-button lx-color="black" lx-type="flat" ng-click="lxStep.previousStep()" ng-disabled="lxStep.isLoading || lxStep.step.index === 0">{{ lxStep.parent.labels.back }}</lx-button>\n' +
' </div>\n' +
' </div>\n' +
' </div>\n' +
'</div>\n' +
'');
a.put('step-nav.html', '<div class="lx-step-nav" ng-click="lxStepNav.parent.goToStep(lxStepNav.step.index)" ng-class="lxStepNav.getClasses()" lx-ripple>\n' +
' <div class="lx-step-nav__indicator lx-step-nav__indicator--index" ng-if="lxStepNav.step.isValid === undefined">\n' +
' <span>{{ lxStepNav.step.index + 1 }}</span>\n' +
' </div>\n' +
'\n' +
' <div class="lx-step-nav__indicator lx-step-nav__indicator--icon" ng-if="lxStepNav.step.isValid === true">\n' +
' <lx-icon lx-id="check" ng-if="!lxStepNav.step.isEditable"></lx-icon>\n' +
' <lx-icon lx-id="pencil" ng-if="lxStepNav.step.isEditable"></lx-icon>\n' +
' </div>\n' +
'\n' +
' <div class="lx-step-nav__indicator lx-step-nav__indicator--error" ng-if="lxStepNav.step.isValid === false">\n' +
' <lx-icon lx-id="alert"></lx-icon>\n' +
' </div>\n' +
'\n' +
' <div class="lx-step-nav__wrapper">\n' +
' <div class="lx-step-nav__label">\n' +
' <span>{{ lxStepNav.step.label }}</span>\n' +
' </div>\n' +
'\n' +
' <div class="lx-step-nav__state">\n' +
' <span ng-if="(lxStepNav.step.isValid === undefined || lxStepNav.step.isValid === true) && lxStepNav.step.isOptional">{{ lxStepNav.parent.labels.optional }}</span>\n' +
' <span ng-if="lxStepNav.step.isValid === false">{{ lxStepNav.step.errorMessage }}</span>\n' +
' </div>\n' +
' </div>\n' +
'</div>');
}]);
angular.module("lumx.switch").run(['$templateCache', function(a) { a.put('switch.html', '<div class="switch switch--{{ lxSwitch.lxColor }} switch--{{ lxSwitch.lxPosition }}"\n' +
' ng-class="{ \'switch--theme-light\': !lxSwitch.lxTheme || lxSwitch.lxTheme === \'light\',\n' +
' \'switch--theme-dark\': lxSwitch.lxTheme === \'dark\' }">\n' +
' <input id="{{ lxSwitch.getSwitchId() }}"\n' +
' type="checkbox"\n' +
' class="switch__input"\n' +
' name="{{ lxSwitch.name }}"\n' +
' ng-model="lxSwitch.ngModel"\n' +
' ng-true-value="{{ lxSwitch.ngTrueValue }}"\n' +
' ng-false-value="{{ lxSwitch.ngFalseValue }}"\n' +
' ng-change="lxSwitch.triggerNgChange()"\n' +
' ng-disabled="lxSwitch.ngDisabled">\n' +
'\n' +
' <label for="{{ lxSwitch.getSwitchId() }}" class="switch__label" ng-transclude ng-if="!lxSwitch.getSwitchHasChildren()"></label>\n' +
' <ng-transclude-replace ng-if="lxSwitch.getSwitchHasChildren()"></ng-transclude-replace>\n' +
'</div>\n' +
'');
a.put('switch-label.html', '<label for="{{ lxSwitchLabel.getSwitchId() }}" class="switch__label" ng-transclude></label>\n' +
'');
a.put('switch-help.html', '<span class="switch__help" ng-transclude></span>\n' +
'');
}]);
angular.module("lumx.fab").run(['$templateCache', function(a) { a.put('fab.html', '<div class="fab"\n' +
' ng-class="{ \'lx-fab--trigger-on-hover\': !lxFab.lxTriggerOnClick,\n' +
' \'lx-fab--trigger-on-click\': lxFab.lxTriggerOnClick,\n' +
' \'lx-fab--is-open\': lxFab.lxTriggerOnClick && lxFab.isOpen,\n' +
' \'lx-fab--is-close\': lxFab.lxTriggerOnClick && !lxFab.isOpen }"\n' +
' ng-click="lxFab.toggleState()">\n' +
' <ng-transclude-replace></ng-transclude-replace>\n' +
'</div>\n' +
'');
a.put('fab-trigger.html', '<div class="fab__primary" ng-transclude></div>\n' +
'');
a.put('fab-actions.html', '<div class="fab__actions fab__actions--{{ parentCtrl.lxDirection }}" ng-transclude></div>\n' +
'');
}]);
angular.module("lumx.icon").run(['$templateCache', function(a) { a.put('icon.html', '<i class="icon mdi" ng-class="lxIcon.getClass()"></i>');
}]);
angular.module("lumx.data-table").run(['$templateCache', function(a) { a.put('data-table.html', '<div class="data-table-container">\n' +
' <table class="data-table"\n' +
' ng-class="{ \'data-table--no-border\': !lxDataTable.border,\n' +
' \'data-table--thumbnail\': lxDataTable.thumbnail }">\n' +
' <thead>\n' +
' <tr ng-class="{ \'data-table__selectable-row\': lxDataTable.selectable,\n' +
' \'data-table__selectable-row--is-selected\': lxDataTable.selectable && lxDataTable.allRowsSelected }">\n' +
' <th ng-if="lxDataTable.thumbnail"></th>\n' +
' <th ng-click="lxDataTable.toggleAllSelected()"\n' +
' ng-if="lxDataTable.selectable"></th>\n' +
' <th ng-class=" { \'data-table__sortable-cell\': th.sortable,\n' +
' \'data-table__sortable-cell--asc\': th.sortable && th.sort === \'asc\',\n' +
' \'data-table__sortable-cell--desc\': th.sortable && th.sort === \'desc\' }"\n' +
' ng-click="lxDataTable.sort(th)"\n' +
' ng-repeat="th in lxDataTable.thead track by $index"\n' +
' ng-if="!lxDataTable.thumbnail || (lxDataTable.thumbnail && $index != 0)">\n' +
' <lx-icon lx-id="{{ th.icon }}" ng-if="th.icon"></lx-icon>\n' +
' <span>{{ th.label }}</span>\n' +
' </th>\n' +
' </tr>\n' +
' </thead>\n' +
'\n' +
' <tbody>\n' +
' <tr ng-class="{ \'data-table__selectable-row\': lxDataTable.selectable,\n' +
' \'data-table__selectable-row--is-disabled\': lxDataTable.selectable && tr.lxDataTableDisabled,\n' +
' \'data-table__selectable-row--is-selected\': lxDataTable.selectable && tr.lxDataTableSelected }"\n' +
' ng-repeat="tr in lxDataTable.tbody"\n' +
' ng-click="lxDataTable.toggle(tr)">\n' +
' <td ng-if="lxDataTable.thumbnail">\n' +
' <div ng-if="lxDataTable.thead[0].format" ng-bind-html="lxDataTable.$sce.trustAsHtml(lxDataTable.thead[0].format(tr))"></div>\n' +
' </td>\n' +
' <td ng-if="lxDataTable.selectable"></td>\n' +
' <td ng-repeat="th in lxDataTable.thead track by $index"\n' +
' ng-if="!lxDataTable.thumbnail || (lxDataTable.thumbnail && $index != 0)">\n' +
' <span ng-if="!th.format">{{ tr[th.name] }}</span>\n' +
' <div ng-if="th.format" ng-bind-html="lxDataTable.$sce.trustAsHtml(th.format(tr))"></div>\n' +
' </td>\n' +
' </tr>\n' +
' </tbody>\n' +
' </table>\n' +
'</div>');
}]);
|
var supportsIteratorDestructuring = require("../../../helpers/supportsIteratorDestructuring");
var supportsObjectDestructuring = require("../../../helpers/supportsObjectDestructuring");
module.exports = function(config) {
return !config.minimize && supportsIteratorDestructuring() && supportsObjectDestructuring();
};
|
/*!
* ui-grid - v4.6.1 - 2018-07-04
* Copyright (c) 2018 ; License: MIT
*/
(function () {
angular.module('ui.grid').config(['$provide', function($provide) {
$provide.decorator('i18nService', ['$delegate', function($delegate) {
$delegate.add('no', {
headerCell: {
aria: {
defaultFilterLabel: 'Filter for kolonne',
removeFilter: 'Fjern filter',
columnMenuButtonLabel: 'Kolonnemeny'
},
priority: 'Prioritet:',
filterLabel: "Filter for kolonne: "
},
aggregate: {
label: 'elementer'
},
groupPanel: {
description: 'Trekk en kolonneoverskrift hit og slipp den for รฅ gruppere etter den kolonnen.'
},
search: {
placeholder: 'Sรธk...',
showingItems: 'Viste elementer:',
selectedItems: 'Valgte elementer:',
totalItems: 'Antall elementer:',
size: 'Sidestรธrrelse:',
first: 'Fรธrste side',
next: 'Neste side',
previous: 'Forrige side',
last: 'Siste side'
},
menu: {
text: 'Velg kolonner:'
},
sort: {
ascending: 'Sortere stigende',
descending: 'Sortere fallende',
none: 'Ingen sortering',
remove: 'Fjern sortering'
},
column: {
hide: 'Skjul kolonne'
},
aggregation: {
count: 'antall rader: ',
sum: 'total: ',
avg: 'gjennomsnitt: ',
min: 'minimum: ',
max: 'maksimum: '
},
pinning: {
pinLeft: 'Fest til venstre',
pinRight: 'Fest til hรธyre',
unpin: 'Lรธsne'
},
columnMenu: {
close: 'Lukk'
},
gridMenu: {
aria: {
buttonLabel: 'Grid Menu'
},
columns: 'Kolonner:',
importerTitle: 'Importer fil',
exporterAllAsCsv: 'Eksporter alle data som csv',
exporterVisibleAsCsv: 'Eksporter synlige data som csv',
exporterSelectedAsCsv: 'Eksporter utvalgte data som csv',
exporterAllAsPdf: 'Eksporter alle data som pdf',
exporterVisibleAsPdf: 'Eksporter synlige data som pdf',
exporterSelectedAsPdf: 'Eksporter utvalgte data som pdf',
exporterAllAsExcel: 'Eksporter alle data som excel',
exporterVisibleAsExcel: 'Eksporter synlige data som excel',
exporterSelectedAsExcel: 'Eksporter utvalgte data som excel',
clearAllFilters: 'Clear all filters'
},
importer: {
noHeaders: 'Kolonnenavn kunne ikke avledes. Har filen en overskrift?',
noObjects: 'Objekter kunne ikke avledes. Er der andre data i filen enn overskriften?',
invalidCsv: 'Filen kunne ikke behandles. Er den gyldig CSV?',
invalidJson: 'Filen kunne ikke behandles. Er den gyldig JSON?',
jsonNotArray: 'Importert JSON-fil mรฅ inneholde en liste. Avbryter.'
},
pagination: {
aria: {
pageToFirst: 'Gรฅ til fรธrste side',
pageBack: 'Gรฅ til forrige side',
pageSelected: 'Valgte side',
pageForward: 'Gรฅ til neste side',
pageToLast: 'Gรฅ til siste side'
},
sizes: 'elementer per side',
totalItems: 'elementer',
through: 'til',
of: 'av'
},
grouping: {
group: 'Gruppere',
ungroup: 'Fjerne gruppering',
aggregate_count: 'Agr: Antall',
aggregate_sum: 'Agr: Sum',
aggregate_max: 'Agr: Maksimum',
aggregate_min: 'Agr: Minimum',
aggregate_avg: 'Agr: Gjennomsnitt',
aggregate_remove: 'Agr: Fjern'
}
});
return $delegate;
}]);
}]);
})();
|
/**
* This is a tweet list item used in the TweetList view. It has several components:
*
* - {@link #userName}: used to display the username of the tweet.
* - {@link #text}: used to display the text of the tweet
* - {@link #avatar}: used to displat the public avatarof the person who tweeted
* - {@link #retweets}: used to display the number of retweets, if specified
*/
Ext.define('Twitter.view.TweetListItem', {
extend: 'Ext.dataview.component.ListItem',
xtype : 'tweetlistitem',
requires: [
'Twitter.view.TweetListItemText',
'Ext.Img'
],
config: {
// @inherit
ui: 'tweet',
/**
* @inherit
* The dataMap allows you to map {@link #record} fields to specific configurations in this component.
*
* For example, lets say you have a {@link #text} configuration which, when applied, gets turned into an instance of an Ext.Component.
* We want to update the {@link #html} of this component when the 'text' field of the record gets changed.
* As you can see below, it is simply a matter of setting the key of the object to be the getter of the config (getText), and then give that
* property a value of an object, which then has 'setHtml' (the html setter) as the key, and 'text' (the field name) as the value.
*/
dataMap: {
// When the record is updated, get the {@link #text} configuration, and call {@link #setHtml} with the 'text' field of the record.
getText: {
setHtml: 'text'
},
// When the record is updated, get the {@link #userName} configuration, and call {@link #setHtml} with the 'from_user' field of the record.
getUserName: {
setHtml: 'from_user'
},
// When the record is updated, get the {@link #avatar} configuration, and call {@link #setSrc} with the 'profile_image_url' field of the record.
getAvatar: {
setSrc: 'profile_image_url'
}
},
/**
* @cfg {Object/Instance} userName
* The component which displays the tweet posters username.
*/
userName: {
cls: 'username'
},
/**
* @cfg {Object/Instance} text
* The component which displays the tweets text.
*/
text: {
cls: 'text'
},
/**
* @cfg {Object/Instance} retweets
* The component which displays the number of retweets the tweet has, if the tweet is popular.
* This is hidden by default, as not all tweets are popular.
*/
retweets: {
cls : 'retweets',
hidden: true
},
/**
* @cfg {Object/Instance} avatar
* The component which displays the avatar of the person who tweeted.
* This uses the {@link Ext.Img} component to show the image.
* It is docked to the left.
*/
avatar: {
docked: 'left',
xtype : 'image',
cls : 'avatar',
width: '48px',
height: '48px'
},
/**
* @inherit
* The layout of this component is vbox, so we can show the username, tweet text, and retweets (if nessecarry) all vertically, which
* still showing the avatar docked to the left.
*/
layout: {
type: 'vbox'
}
},
/**
* Applies the {@link #userName} configuration which will return an instance of Ext.Component
*/
applyUserName: function(config) {
return Ext.factory(config, Ext.Component, this.getUserName());
},
/**
* Called when the {@link #userName} configuration has been updated. Inserts the component as the first child (so it is always at the top)
*/
updateUserName: function(newUserName) {
if (newUserName) {
this.insert(0, newUserName);
}
},
/**
* Applies the {@link #text} configuration which will return an instance of Twitter.view.TweetListItemText. This is not a component because we
* need to override setHtml to linkify URLs and wrap usernames + hashtags.
*/
applyText: function(config) {
return Ext.factory(config, Twitter.view.TweetListItemText, this.getText());
},
/**
* Called when the {@link #text} configuration has been updated. Add the component into this item.
*/
updateText: function(newText) {
if (newText) {
this.add(newText);
}
},
/**
* Applies the {@link #avatar} configuration. Returns an instance of Ext.Img
*/
applyAvatar: function(config) {
return Ext.factory(config, Ext.Img, this.getAvatar());
},
/**
* Called when the {@link #avatar} confguration has been updated. Inserts the component into this item.
*/
updateAvatar: function(newAvatar) {
if (newAvatar) {
this.add(newAvatar);
}
},
/**
* Applies the {@link #retweets} configuration. Returns an instance of Ext.Component
*/
applyRetweets: function(config) {
return Ext.factory(config, Ext.Component, this.getRetweets());
},
/**
* Called when the {@link #retweets} confguration has been updated. Inserts the component into this item.
*/
updateRetweets: function(newRetweets) {
if (newRetweets) {
this.add(newRetweets);
}
},
updateTpl: Ext.emptyFn,
/**
* We must override the {@link #updateRecord} method in dataitem. This is so we can look at the records metadata field and check
* if the tweet is popuplar, and if the tweet has retweets. If it is popular, it adds a custom className. If it has retweets, we
* show the {@link #retweets} component, and update it's HTML.
*/
updateRecord: function(newRecord) {
this.callParent(arguments);
if (!newRecord) {
return;
}
var metadata = newRecord.get('metadata'),
retweets = this.getRetweets();
// ensure that the record has metadata + is a popular tweet
if (metadata && metadata.result_type && metadata.result_type == "popular") {
this.element.addCls('popular');
//if there are retweets
if (metadata.recent_retweets) {
retweets.show();
retweets.setHtml(metadata.recent_retweets + '+ recent retweets');
}
} else {
//it isn't popular, so it can't have retweets. Remove the className + hide the retweets component
this.element.removeCls('popular');
retweets.hide();
}
}
});
|
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"fullDate": "EEEE, MMMM d, y",
"longDate": "MMMM d, y",
"medium": "MMM d, y h:mm:ss a",
"mediumDate": "MMM d, y",
"mediumTime": "h:mm:ss a",
"short": "M/d/yy h:mm a",
"shortDate": "M/d/yy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "en-pr",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
๏ปฟ/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'newpage', 'sl', {
toolbar: 'Nova stran'
});
|
import React from 'react'
import * as common from 'test/specs/commonTests'
import TableFooter from 'src/collections/Table/TableFooter'
describe('TableFooter', () => {
common.isConformant(TableFooter)
it('renders as a tfoot by default', () => {
shallow(<TableFooter />)
.should.have.tagName('tfoot')
})
})
|
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var React;
var ReactNoop;
describe('ReactExpiration', () => {
beforeEach(() => {
jest.resetModules();
React = require('react');
ReactNoop = require('react-noop-renderer');
});
function span(prop) {
return {type: 'span', children: [], prop};
}
it('increases priority of updates as time progresses', () => {
ReactNoop.render(<span prop="done" />);
expect(ReactNoop.getChildren()).toEqual([]);
// Nothing has expired yet because time hasn't advanced.
ReactNoop.flushExpired();
expect(ReactNoop.getChildren()).toEqual([]);
// Advance by 300ms, not enough to expire the low pri update.
ReactNoop.expire(300);
ReactNoop.flushExpired();
expect(ReactNoop.getChildren()).toEqual([]);
// Advance by another second. Now the update should expire and flush.
ReactNoop.expire(1000);
ReactNoop.flushExpired();
expect(ReactNoop.getChildren()).toEqual([span('done')]);
});
});
|
/*!
* Annotations Support for Patterns - v0.3
*
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
*
*/
var annotationsPattern = {
commentsOverlayActive: false,
commentsOverlay: false,
commentsOverlayElement: "",
commentsEmbeddedActive: false,
commentsEmbedded: false,
/**
* add an onclick handler to each element in the pattern that has an annotation
*/
showComments: function() {
// make sure this only added when we're on a pattern specific view
var body = document.getElementsByTagName("body");
if (!body[0].classList.contains("sg-pattern-list")) {
for (comment in comments.comments) {
var item = comments.comments[comment];
var els = document.querySelectorAll(item.el);
for (var i = 0; i < els.length; ++i) {
els[i].onclick = (function(item) {
return function(e) {
e.preventDefault();
e.stopPropagation();
var obj = {};
if (annotationsPattern.commentsOverlayActive && !annotationsPattern.commentsOverlay) {
// if this is for an overlay and comments overlay is false set the payload to turn the overlay on
annotationsPattern.commentsOverlay = true;
obj = { "commentOverlay": "on", "swapOverlay": false, "el": item.el, "title": item.title, "comment": item.comment };
} else if (annotationsPattern.commentsOverlayActive && annotationsPattern.commentsOverlay) {
if (item.el == annotationsPattern.commentsOverlayElement) {
// if the last element was clicked again turn off the overlay
annotationsPattern.commentsOverlay = false;
obj = { "commentOverlay": "off" };
} else {
// if an element was clicked on while the overlay was already on swap it
obj = { "commentOverlay": "on", "swapOverlay": true, "el": item.el, "title": item.title, "comment": item.comment };
}
}
annotationsPattern.commentsOverlayElement = item.el;
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
parent.postMessage(obj,targetOrigin);
}
})(item);
}
}
}
},
/**
* embed a comment by building the sg-annotations div (if necessary) and building an sg-annotation div
* @param {Object} element to check the parent node of
* @param {String} the title of the comment
* @param {String} the comment HTML
*/
embedComments: function (el,title,comment) {
// build the annotation div and add the content to it
var annotationDiv = document.createElement("div");
annotationDiv.classList.add("sg-annotation");
var h3 = document.createElement("h3");
var p = document.createElement("p");
h3.innerHTML = title;
p.innerHTML = comment;
annotationDiv.appendChild(h3);
annotationDiv.appendChild(p);
// find the parent element to attach things to
var parentEl = annotationsPattern.findParent(el);
// see if a child with the class annotations exists
var els = parentEl.getElementsByClassName("sg-annotations");
if (els.length > 0) {
els[0].appendChild(annotationDiv);
} else {
var annotationsDiv = document.createElement("div");
annotationsDiv.classList.add("sg-annotations");
annotationsDiv.appendChild(annotationDiv);
parentEl.appendChild(annotationsDiv);
}
},
/**
* recursively find the parent of an element to see if it contains the sg-pattern class
* @param {Object} element to check the parent node of
*/
findParent: function(el) {
if (el.parentNode.classList.contains("sg-pattern")) {
return el.parentNode;
} else {
var parentEl = annotationsPattern.findParent(el.parentNode);
}
return parentEl;
},
/**
* toggle the annotation feature on/off
* based on the great MDN docs at https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage
* @param {Object} event info
*/
receiveIframeMessage: function(event) {
// does the origin sending the message match the current host? if not dev/null the request
if ((window.location.protocol != "file:") && (event.origin !== window.location.protocol+"//"+window.location.host)) {
return;
}
if (event.data.commentToggle != undefined) {
// if this is an overlay make sure it's active for the onclick event
annotationsPattern.commentsOverlayActive = false;
annotationsPattern.commentsEmbeddedActive = false;
// see which flag to toggle based on if this is a styleguide or view-all page
var body = document.getElementsByTagName("body");
if ((event.data.commentToggle == "on") && (body[0].classList.contains("sg-pattern-list"))) {
annotationsPattern.commentsEmbeddedActive = true;
} else if (event.data.commentToggle == "on") {
annotationsPattern.commentsOverlayActive = true;
}
// if comments overlay is turned off make sure to remove the has-comment class and pointer
if (!annotationsPattern.commentsOverlayActive) {
var els = document.querySelectorAll(".has-comment");
for (var i = 0; i < els.length; i++) {
els[i].classList.remove("has-comment");
}
}
// if comments embedding is turned off make sure to hide the annotations div
if (!annotationsPattern.commentsEmbeddedActive) {
var els = document.getElementsByClassName("sg-annotations");
for (var i = 0; i < els.length; i++) {
els[i].style.display = "none";
}
}
// if comments overlay is turned on add the has-comment class and pointer
if (annotationsPattern.commentsOverlayActive) {
for (comment in comments.comments) {
var item = comments.comments[comment];
var els = document.querySelectorAll(item.el);
for (var i = 0; i < els.length; i++) {
els[i].classList.add("has-comment");
}
}
} else if (annotationsPattern.commentsEmbeddedActive && !annotationsPattern.commentsEmbedded) {
// if comment embedding is turned on and comments haven't been embedded yet do it
for (comment in comments.comments) {
var item = comments.comments[comment];
var els = document.querySelectorAll(item.el);
if (els.length > 0) {
annotationsPattern.embedComments(els[0],item.title,item.comment);
}
annotationsPattern.commentsEmbedded = true;
}
} else if (annotationsPattern.commentsEmbeddedActive && annotationsPattern.commentsEmbedded) {
// if comment embedding is turned on and comments have been embedded simply display them
var els = document.getElementsByClassName("sg-annotations");
for (var i = 0; i < els.length; ++i) {
els[i].style.display = "block";
}
}
}
}
};
// add the onclick handlers to the elements that have an annotations
annotationsPattern.showComments();
window.addEventListener("message", annotationsPattern.receiveIframeMessage, false);
// before unloading the iframe make sure any active overlay is turned off/closed
window.onbeforeunload = function() {
var obj = { "commentOverlay": "off" };
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
parent.postMessage(obj,targetOrigin);
};
|
(function (factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
var v = factory(require, exports); if (v !== undefined) module.exports = v;
}
else if (typeof define === 'function' && define.amd) {
define(["require", "exports", '@angular/core', '../../platform/key'], factory);
}
})(function (require, exports) {
"use strict";
var core_1 = require('@angular/core');
var key_1 = require('../../platform/key');
/**
* @private
*/
var RangeKnob = (function () {
function RangeKnob() {
this.ionIncrease = new core_1.EventEmitter();
this.ionDecrease = new core_1.EventEmitter();
}
Object.defineProperty(RangeKnob.prototype, "ratio", {
set: function (r) {
this._x = r * 100 + "%";
},
enumerable: true,
configurable: true
});
RangeKnob.prototype._keyup = function (ev) {
var keyCode = ev.keyCode;
if (keyCode === key_1.Key.LEFT || keyCode === key_1.Key.DOWN) {
(void 0) /* console.debug */;
this.ionDecrease.emit();
ev.preventDefault();
ev.stopPropagation();
}
else if (keyCode === key_1.Key.RIGHT || keyCode === key_1.Key.UP) {
(void 0) /* console.debug */;
this.ionIncrease.emit();
ev.preventDefault();
ev.stopPropagation();
}
};
RangeKnob.decorators = [
{ type: core_1.Component, args: [{
selector: '.range-knob-handle',
template: '<div class="range-pin" *ngIf="pin" role="presentation">{{val}}</div>' +
'<div class="range-knob" role="presentation"></div>',
host: {
'[class.range-knob-pressed]': 'pressed',
'[class.range-knob-min]': 'val===min||val===undefined',
'[class.range-knob-max]': 'val===max',
'[style.left]': '_x',
'[attr.aria-valuenow]': 'val',
'[attr.aria-valuemin]': 'min',
'[attr.aria-valuemax]': 'max',
'[attr.aria-disabled]': 'disabled',
'[attr.aria-labelledby]': 'labelId',
'[tabindex]': 'disabled?-1:0',
'role': 'slider'
}
},] },
];
/** @nocollapse */
RangeKnob.ctorParameters = [];
RangeKnob.propDecorators = {
'ratio': [{ type: core_1.Input },],
'pressed': [{ type: core_1.Input },],
'pin': [{ type: core_1.Input },],
'min': [{ type: core_1.Input },],
'max': [{ type: core_1.Input },],
'val': [{ type: core_1.Input },],
'disabled': [{ type: core_1.Input },],
'labelId': [{ type: core_1.Input },],
'ionIncrease': [{ type: core_1.Output },],
'ionDecrease': [{ type: core_1.Output },],
'_keyup': [{ type: core_1.HostListener, args: ['keydown', ['$event'],] },],
};
return RangeKnob;
}());
exports.RangeKnob = RangeKnob;
});
//# sourceMappingURL=range-knob.js.map
|
L.Toolbar = L.Class.extend({
includes: [L.Mixin.Events],
initialize: function (options) {
L.setOptions(this, options);
this._modes = {};
this._actionButtons = [];
this._activeMode = null;
},
enabled: function () {
return this._activeMode !== null;
},
disable: function () {
if (!this.enabled()) { return; }
this._activeMode.handler.disable();
},
removeToolbar: function () {
// Dispose each handler
for (var handlerId in this._modes) {
if (this._modes.hasOwnProperty(handlerId)) {
// Unbind handler button
this._disposeButton(this._modes[handlerId].button, this._modes[handlerId].handler.enable);
// Make sure is disabled
this._modes[handlerId].handler.disable();
// Unbind handler
this._modes[handlerId].handler
.off('enabled', this._handlerActivated, this)
.off('disabled', this._handlerDeactivated, this);
}
}
this._modes = {};
// Dispose the actions toolbar
for (var i = 0, l = this._actionButtons.length; i < l; i++) {
this._disposeButton(this._actionButtons[i].button, this._actionButtons[i].callback);
}
this._actionButtons = [];
this._actionsContainer = null;
},
_initModeHandler: function (handler, container, buttonIndex, classNamePredix, buttonTitle) {
var type = handler.type;
this._modes[type] = {};
this._modes[type].handler = handler;
this._modes[type].button = this._createButton({
title: buttonTitle,
className: classNamePredix + '-' + type,
container: container,
callback: this._modes[type].handler.enable,
context: this._modes[type].handler
});
this._modes[type].buttonIndex = buttonIndex;
this._modes[type].handler
.on('enabled', this._handlerActivated, this)
.on('disabled', this._handlerDeactivated, this);
},
_createButton: function (options) {
var link = L.DomUtil.create('a', options.className || '', options.container);
link.href = '#';
if (options.text) {
link.innerHTML = options.text;
}
if (options.title) {
link.title = options.title;
}
L.DomEvent
.on(link, 'click', L.DomEvent.stopPropagation)
.on(link, 'mousedown', L.DomEvent.stopPropagation)
.on(link, 'dblclick', L.DomEvent.stopPropagation)
.on(link, 'click', L.DomEvent.preventDefault)
.on(link, 'click', options.callback, options.context);
return link;
},
_disposeButton: function (button, callback) {
L.DomEvent
.off(button, 'click', L.DomEvent.stopPropagation)
.off(button, 'mousedown', L.DomEvent.stopPropagation)
.off(button, 'dblclick', L.DomEvent.stopPropagation)
.off(button, 'click', L.DomEvent.preventDefault)
.off(button, 'click', callback);
},
_handlerActivated: function (e) {
// Disable active mode (if present)
if (this._activeMode && this._activeMode.handler.enabled()) {
this._activeMode.handler.disable();
}
// Cache new active feature
this._activeMode = this._modes[e.handler];
L.DomUtil.addClass(this._activeMode.button, 'leaflet-draw-toolbar-button-enabled');
this._showActionsToolbar();
this.fire('enable');
},
_handlerDeactivated: function () {
this._hideActionsToolbar();
L.DomUtil.removeClass(this._activeMode.button, 'leaflet-draw-toolbar-button-enabled');
this._activeMode = null;
this.fire('disable');
},
_createActions: function (buttons) {
var container = L.DomUtil.create('ul', 'leaflet-draw-actions'),
l = buttons.length,
li, button;
for (var i = 0; i < l; i++) {
li = L.DomUtil.create('li', '', container);
button = this._createButton({
title: buttons[i].title,
text: buttons[i].text,
container: li,
callback: buttons[i].callback,
context: buttons[i].context
});
this._actionButtons.push({
button: button,
callback: buttons[i].callback
});
}
return container;
},
_showActionsToolbar: function () {
var buttonIndex = this._activeMode.buttonIndex,
lastButtonIndex = this._lastButtonIndex,
buttonHeight = 26, // TODO: this should be calculated
borderHeight = 1, // TODO: this should also be calculated
toolbarPosition = (buttonIndex * buttonHeight) + (buttonIndex * borderHeight) - 1;
// Correctly position the cancel button
this._actionsContainer.style.top = toolbarPosition + 'px';
if (buttonIndex === 0) {
L.DomUtil.addClass(this._toolbarContainer, 'leaflet-draw-toolbar-notop');
L.DomUtil.addClass(this._actionsContainer, 'leaflet-draw-actions-top');
}
if (buttonIndex === lastButtonIndex) {
L.DomUtil.addClass(this._toolbarContainer, 'leaflet-draw-toolbar-nobottom');
L.DomUtil.addClass(this._actionsContainer, 'leaflet-draw-actions-bottom');
}
this._actionsContainer.style.display = 'block';
},
_hideActionsToolbar: function () {
this._actionsContainer.style.display = 'none';
L.DomUtil.removeClass(this._toolbarContainer, 'leaflet-draw-toolbar-notop');
L.DomUtil.removeClass(this._toolbarContainer, 'leaflet-draw-toolbar-nobottom');
L.DomUtil.removeClass(this._actionsContainer, 'leaflet-draw-actions-top');
L.DomUtil.removeClass(this._actionsContainer, 'leaflet-draw-actions-bottom');
}
});
|
define({scientificFormat:"#E0",infinity:"โ",superscriptingExponent:"ร",list:"ุ",percentSign:"โ%โ",minusSign:"โ-","decimalFormat-short":"000ย ุชุฑูููู",nan:"ููุณย ุฑูู
ูุง",plusSign:"โ+",currencyFormat:"ยค#,##0.00;(ยค#,##0.00)",perMille:"โฐ",group:",",percentFormat:"#,##0%","decimalFormat-long":"000 ุชุฑูููู",decimalFormat:"#,##0.###","currencyFormat-short":"000ย ุชุฑููููย ยค",timeSeparator:":",decimal:".",exponential:"E"});
|
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'scayt', 'zh', {
btn_about: '้ๆผๅณๆๆผๅฏซๆชขๆฅ',
btn_dictionaries: 'ๅญๅ
ธ',
btn_disable: '้้ๅณๆๆผๅฏซๆชขๆฅ',
btn_enable: 'ๅ็จๅณๆๆผๅฏซๆชขๆฅ',
btn_langs: '่ช่จ',
btn_options: '้ธ้
',
text_title: 'ๅณๆๆผๅฏซๆชขๆฅ'
});
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = gatherSequenceExpressions;
var _getBindingIdentifiers = _interopRequireDefault(require("../retrievers/getBindingIdentifiers"));
var _generated = require("../validators/generated");
var _generated2 = require("../builders/generated");
var _cloneNode = _interopRequireDefault(require("../clone/cloneNode"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function gatherSequenceExpressions(nodes, scope, declars) {
const exprs = [];
let ensureLastUndefined = true;
for (const node of nodes) {
if (!(0, _generated.isEmptyStatement)(node)) {
ensureLastUndefined = false;
}
if ((0, _generated.isExpression)(node)) {
exprs.push(node);
} else if ((0, _generated.isExpressionStatement)(node)) {
exprs.push(node.expression);
} else if ((0, _generated.isVariableDeclaration)(node)) {
if (node.kind !== "var") return;
for (const declar of node.declarations) {
const bindings = (0, _getBindingIdentifiers.default)(declar);
for (const key of Object.keys(bindings)) {
declars.push({
kind: node.kind,
id: (0, _cloneNode.default)(bindings[key])
});
}
if (declar.init) {
exprs.push((0, _generated2.assignmentExpression)("=", declar.id, declar.init));
}
}
ensureLastUndefined = true;
} else if ((0, _generated.isIfStatement)(node)) {
const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();
const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();
if (!consequent || !alternate) return;
exprs.push((0, _generated2.conditionalExpression)(node.test, consequent, alternate));
} else if ((0, _generated.isBlockStatement)(node)) {
const body = gatherSequenceExpressions(node.body, scope, declars);
if (!body) return;
exprs.push(body);
} else if ((0, _generated.isEmptyStatement)(node)) {
if (nodes.indexOf(node) === 0) {
ensureLastUndefined = true;
}
} else {
return;
}
}
if (ensureLastUndefined) {
exprs.push(scope.buildUndefinedNode());
}
if (exprs.length === 1) {
return exprs[0];
} else {
return (0, _generated2.sequenceExpression)(exprs);
}
}
|
version https://git-lfs.github.com/spec/v1
oid sha256:4a7d2b366baef54c731ed4ff3182a68eac3f16f4cf48d3d797ae7520ef9ffc4a
size 6037
|
jQuery(function($){$.ui.dialog.wiquery.regional['fr']={okButton:'Ok',cancelButton:'Annuler',questionTitle:'Question',waitTitle:'Veuillez patienter',errorTitle:'Erreur',warningTitle:'Avertissement'};});
|
import React from 'react'
import Content from './Content'
import Types from './Types'
import Variations from './Variations'
const FeedExamples = () => (
<div>
<Types />
<Content />
<Variations />
</div>
)
export default FeedExamples
|
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglifyjs');
var header = require('gulp-header');
var jshint = require('gulp-jshint');
var todo = require('gulp-todo');
var gulputil = require('gulp-util');
var moment = require('moment');
var pkg = require('./package.json');
var banner =
'/*!\n\n' +
'<%= pkg.name %> - <%= pkg.summary %>\nVersion <%= pkg.version %>+<%= build %>\n' +
'\u00A9 <%= year %> <%= pkg.author.name %> - <%= pkg.author.url %>\n\n' +
'Site: <%= pkg.homepage %>\n'+
'Issues: <%= pkg.bugs.url %>\n' +
'License: <%= pkg.license.url %>\n\n' +
'*/\n';
function generateBuild(){
var date = new Date;
return Math.floor((date - (new Date(date.getFullYear(),0,0)))/1000).toString(36)
}
var build = generateBuild();
var paths = {
scripts: ["src/ondomready.js", "src/polyfills.js", "src/augment.js", "src/holder.js"]
}
gulp.task('jshint', function () {
return gulp.src(paths.scripts[paths.scripts.length - 1])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('todo', function(){
return gulp.src(paths.scripts)
.pipe(todo())
.pipe(gulp.dest('./'));
});
gulp.task('scripts', ['jshint'], function () {
return gulp.src(paths.scripts)
.pipe(concat("holder.js"))
.pipe(gulp.dest("./"));
});
gulp.task('minify', ['scripts'], function () {
return gulp.src("holder.js")
.pipe(uglify("holder.min.js"))
.pipe(gulp.dest("./"));
});
gulp.task('banner', ['minify'], function () {
return gulp.src(["holder*.js"])
.pipe(header(banner, {
pkg: pkg,
year: moment().format("YYYY"),
build: build
}))
.pipe(gulp.dest("./"));
});
gulp.task('watch', function(){
gulp.watch(paths.scripts, ['default']);
});
gulp.task('default', ['todo', 'jshint', 'scripts', 'minify', 'banner'], function(){
gulputil.log("Finished build "+build);
build = generateBuild();
});
|
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define('Plyr', factory) :
(global.Plyr = factory());
}(this, (function () { 'use strict';
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var _global = createCommonjsModule(function (module) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
});
var _core = createCommonjsModule(function (module) {
var core = module.exports = { version: '2.5.3' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
});
var _isObject = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
var _anObject = function (it) {
if (!_isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
var _fails = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
// Thank's IE8 for his funny defineProperty
var _descriptors = !_fails(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
var document$1 = _global.document;
// typeof document.createElement is 'object' in old IE
var is = _isObject(document$1) && _isObject(document$1.createElement);
var _domCreate = function (it) {
return is ? document$1.createElement(it) : {};
};
var _ie8DomDefine = !_descriptors && !_fails(function () {
return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
});
// 7.1.1 ToPrimitive(input [, PreferredType])
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
var _toPrimitive = function (it, S) {
if (!_isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
var dP = Object.defineProperty;
var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
_anObject(O);
P = _toPrimitive(P, true);
_anObject(Attributes);
if (_ie8DomDefine) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
var _objectDp = {
f: f
};
var _propertyDesc = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
var _hide = _descriptors ? function (object, key, value) {
return _objectDp.f(object, key, _propertyDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
var hasOwnProperty = {}.hasOwnProperty;
var _has = function (it, key) {
return hasOwnProperty.call(it, key);
};
var id = 0;
var px = Math.random();
var _uid = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
var _redefine = createCommonjsModule(function (module) {
var SRC = _uid('src');
var TO_STRING = 'toString';
var $toString = Function[TO_STRING];
var TPL = ('' + $toString).split(TO_STRING);
_core.inspectSource = function (it) {
return $toString.call(it);
};
(module.exports = function (O, key, val, safe) {
var isFunction = typeof val == 'function';
if (isFunction) _has(val, 'name') || _hide(val, 'name', key);
if (O[key] === val) return;
if (isFunction) _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
if (O === _global) {
O[key] = val;
} else if (!safe) {
delete O[key];
_hide(O, key, val);
} else if (O[key]) {
O[key] = val;
} else {
_hide(O, key, val);
}
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, TO_STRING, function toString() {
return typeof this == 'function' && this[SRC] || $toString.call(this);
});
});
var _aFunction = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
// optional / simple context binding
var _ctx = function (fn, that, length) {
_aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE];
var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
var key, own, out, exp;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
// export native or passed
out = (own ? target : source)[key];
// bind timers to global for call from export context
exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
// extend global
if (target) _redefine(target, key, out, type & $export.U);
// export
if (exports[key] != out) _hide(exports, key, exp);
if (IS_PROTO && expProto[key] != out) expProto[key] = out;
}
};
_global.core = _core;
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
var _export = $export;
var TYPED = _uid('typed_array');
var VIEW$1 = _uid('view');
var ABV = !!(_global.ArrayBuffer && _global.DataView);
var CONSTR = ABV;
var i = 0;
var l = 9;
var Typed;
var TypedArrayConstructors = (
'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
).split(',');
while (i < l) {
if (Typed = _global[TypedArrayConstructors[i++]]) {
_hide(Typed.prototype, TYPED, true);
_hide(Typed.prototype, VIEW$1, true);
} else CONSTR = false;
}
var _typed = {
ABV: ABV,
CONSTR: CONSTR,
TYPED: TYPED,
VIEW: VIEW$1
};
var _library = false;
var _redefineAll = function (target, src, safe) {
for (var key in src) _redefine(target, key, src[key], safe);
return target;
};
var _anInstance = function (it, Constructor, name, forbiddenField) {
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
throw TypeError(name + ': incorrect invocation!');
} return it;
};
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
var _toInteger = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
// 7.1.15 ToLength
var min = Math.min;
var _toLength = function (it) {
return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
// https://tc39.github.io/ecma262/#sec-toindex
var _toIndex = function (it) {
if (it === undefined) return 0;
var number = _toInteger(it);
var length = _toLength(number);
if (number !== length) throw RangeError('Wrong length!');
return length;
};
var toString = {}.toString;
var _cof = function (it) {
return toString.call(it).slice(8, -1);
};
// fallback for non-array-like ES3 and non-enumerable old V8 strings
// eslint-disable-next-line no-prototype-builtins
var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return _cof(it) == 'String' ? it.split('') : Object(it);
};
// 7.2.1 RequireObjectCoercible(argument)
var _defined = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
// to indexed object, toObject with fallback for non-array-like ES3 strings
var _toIobject = function (it) {
return _iobject(_defined(it));
};
var max = Math.max;
var min$1 = Math.min;
var _toAbsoluteIndex = function (index, length) {
index = _toInteger(index);
return index < 0 ? max(index + length, 0) : min$1(index, length);
};
// false -> Array#indexOf
// true -> Array#includes
var _arrayIncludes = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = _toIobject($this);
var length = _toLength(O.length);
var index = _toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
var SHARED = '__core-js_shared__';
var store = _global[SHARED] || (_global[SHARED] = {});
var _shared = function (key) {
return store[key] || (store[key] = {});
};
var shared = _shared('keys');
var _sharedKey = function (key) {
return shared[key] || (shared[key] = _uid(key));
};
var arrayIndexOf = _arrayIncludes(false);
var IE_PROTO = _sharedKey('IE_PROTO');
var _objectKeysInternal = function (object, names) {
var O = _toIobject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (_has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
// IE 8- don't enum bug keys
var _enumBugKeys = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return _objectKeysInternal(O, hiddenKeys);
};
var _objectGopn = {
f: f$1
};
// 7.1.13 ToObject(argument)
var _toObject = function (it) {
return Object(_defined(it));
};
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
'use strict';
var _arrayFill = function fill(value /* , start = 0, end = @length */) {
var O = _toObject(this);
var length = _toLength(O.length);
var aLen = arguments.length;
var index = _toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
var end = aLen > 2 ? arguments[2] : undefined;
var endPos = end === undefined ? length : _toAbsoluteIndex(end, length);
while (endPos > index) O[index++] = value;
return O;
};
var _wks = createCommonjsModule(function (module) {
var store = _shared('wks');
var Symbol = _global.Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name));
};
$exports.store = store;
});
var def = _objectDp.f;
var TAG = _wks('toStringTag');
var _setToStringTag = function (it, tag, stat) {
if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};
var _typedBuffer = createCommonjsModule(function (module, exports) {
'use strict';
var gOPN = _objectGopn.f;
var dP = _objectDp.f;
var ARRAY_BUFFER = 'ArrayBuffer';
var DATA_VIEW = 'DataView';
var PROTOTYPE = 'prototype';
var WRONG_LENGTH = 'Wrong length!';
var WRONG_INDEX = 'Wrong index!';
var $ArrayBuffer = _global[ARRAY_BUFFER];
var $DataView = _global[DATA_VIEW];
var Math = _global.Math;
var RangeError = _global.RangeError;
// eslint-disable-next-line no-shadow-restricted-names
var Infinity = _global.Infinity;
var BaseBuffer = $ArrayBuffer;
var abs = Math.abs;
var pow = Math.pow;
var floor = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var BUFFER = 'buffer';
var BYTE_LENGTH = 'byteLength';
var BYTE_OFFSET = 'byteOffset';
var $BUFFER = _descriptors ? '_b' : BUFFER;
var $LENGTH = _descriptors ? '_l' : BYTE_LENGTH;
var $OFFSET = _descriptors ? '_o' : BYTE_OFFSET;
// IEEE754 conversions based on https://github.com/feross/ieee754
function packIEEE754(value, mLen, nBytes) {
var buffer = new Array(nBytes);
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
var i = 0;
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
var e, m, c;
value = abs(value);
// eslint-disable-next-line no-self-compare
if (value != value || value === Infinity) {
// eslint-disable-next-line no-self-compare
m = value != value ? 1 : 0;
e = eMax;
} else {
e = floor(log(value) / LN2);
if (value * (c = pow(2, -e)) < 1) {
e--;
c *= 2;
}
if (e + eBias >= 1) {
value += rt / c;
} else {
value += rt * pow(2, 1 - eBias);
}
if (value * c >= 2) {
e++;
c /= 2;
}
if (e + eBias >= eMax) {
m = 0;
e = eMax;
} else if (e + eBias >= 1) {
m = (value * c - 1) * pow(2, mLen);
e = e + eBias;
} else {
m = value * pow(2, eBias - 1) * pow(2, mLen);
e = 0;
}
}
for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
e = e << mLen | m;
eLen += mLen;
for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
buffer[--i] |= s * 128;
return buffer;
}
function unpackIEEE754(buffer, mLen, nBytes) {
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var nBits = eLen - 7;
var i = nBytes - 1;
var s = buffer[i--];
var e = s & 127;
var m;
s >>= 7;
for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
m = e & (1 << -nBits) - 1;
e >>= -nBits;
nBits += mLen;
for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
if (e === 0) {
e = 1 - eBias;
} else if (e === eMax) {
return m ? NaN : s ? -Infinity : Infinity;
} else {
m = m + pow(2, mLen);
e = e - eBias;
} return (s ? -1 : 1) * m * pow(2, e - mLen);
}
function unpackI32(bytes) {
return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
}
function packI8(it) {
return [it & 0xff];
}
function packI16(it) {
return [it & 0xff, it >> 8 & 0xff];
}
function packI32(it) {
return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
}
function packF64(it) {
return packIEEE754(it, 52, 8);
}
function packF32(it) {
return packIEEE754(it, 23, 4);
}
function addGetter(C, key, internal) {
dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
}
function get(view, bytes, index, isLittleEndian) {
var numIndex = +index;
var intIndex = _toIndex(numIndex);
if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
var store = view[$BUFFER]._b;
var start = intIndex + view[$OFFSET];
var pack = store.slice(start, start + bytes);
return isLittleEndian ? pack : pack.reverse();
}
function set(view, bytes, index, conversion, value, isLittleEndian) {
var numIndex = +index;
var intIndex = _toIndex(numIndex);
if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
var store = view[$BUFFER]._b;
var start = intIndex + view[$OFFSET];
var pack = conversion(+value);
for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
}
if (!_typed.ABV) {
$ArrayBuffer = function ArrayBuffer(length) {
_anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
var byteLength = _toIndex(length);
this._b = _arrayFill.call(new Array(byteLength), 0);
this[$LENGTH] = byteLength;
};
$DataView = function DataView(buffer, byteOffset, byteLength) {
_anInstance(this, $DataView, DATA_VIEW);
_anInstance(buffer, $ArrayBuffer, DATA_VIEW);
var bufferLength = buffer[$LENGTH];
var offset = _toInteger(byteOffset);
if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
byteLength = byteLength === undefined ? bufferLength - offset : _toLength(byteLength);
if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
this[$BUFFER] = buffer;
this[$OFFSET] = offset;
this[$LENGTH] = byteLength;
};
if (_descriptors) {
addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
addGetter($DataView, BUFFER, '_b');
addGetter($DataView, BYTE_LENGTH, '_l');
addGetter($DataView, BYTE_OFFSET, '_o');
}
_redefineAll($DataView[PROTOTYPE], {
getInt8: function getInt8(byteOffset) {
return get(this, 1, byteOffset)[0] << 24 >> 24;
},
getUint8: function getUint8(byteOffset) {
return get(this, 1, byteOffset)[0];
},
getInt16: function getInt16(byteOffset /* , littleEndian */) {
var bytes = get(this, 2, byteOffset, arguments[1]);
return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
},
getUint16: function getUint16(byteOffset /* , littleEndian */) {
var bytes = get(this, 2, byteOffset, arguments[1]);
return bytes[1] << 8 | bytes[0];
},
getInt32: function getInt32(byteOffset /* , littleEndian */) {
return unpackI32(get(this, 4, byteOffset, arguments[1]));
},
getUint32: function getUint32(byteOffset /* , littleEndian */) {
return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
},
getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
},
getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
},
setInt8: function setInt8(byteOffset, value) {
set(this, 1, byteOffset, packI8, value);
},
setUint8: function setUint8(byteOffset, value) {
set(this, 1, byteOffset, packI8, value);
},
setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
set(this, 2, byteOffset, packI16, value, arguments[2]);
},
setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
set(this, 2, byteOffset, packI16, value, arguments[2]);
},
setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packI32, value, arguments[2]);
},
setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packI32, value, arguments[2]);
},
setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packF32, value, arguments[2]);
},
setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
set(this, 8, byteOffset, packF64, value, arguments[2]);
}
});
} else {
if (!_fails(function () {
$ArrayBuffer(1);
}) || !_fails(function () {
new $ArrayBuffer(-1); // eslint-disable-line no-new
}) || _fails(function () {
new $ArrayBuffer(); // eslint-disable-line no-new
new $ArrayBuffer(1.5); // eslint-disable-line no-new
new $ArrayBuffer(NaN); // eslint-disable-line no-new
return $ArrayBuffer.name != ARRAY_BUFFER;
})) {
$ArrayBuffer = function ArrayBuffer(length) {
_anInstance(this, $ArrayBuffer);
return new BaseBuffer(_toIndex(length));
};
var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
if (!((key = keys[j++]) in $ArrayBuffer)) _hide($ArrayBuffer, key, BaseBuffer[key]);
}
if (!_library) ArrayBufferProto.constructor = $ArrayBuffer;
}
// iOS Safari 7.x bug
var view = new $DataView(new $ArrayBuffer(2));
var $setInt8 = $DataView[PROTOTYPE].setInt8;
view.setInt8(0, 2147483648);
view.setInt8(1, 2147483649);
if (view.getInt8(0) || !view.getInt8(1)) _redefineAll($DataView[PROTOTYPE], {
setInt8: function setInt8(byteOffset, value) {
$setInt8.call(this, byteOffset, value << 24 >> 24);
},
setUint8: function setUint8(byteOffset, value) {
$setInt8.call(this, byteOffset, value << 24 >> 24);
}
}, true);
}
_setToStringTag($ArrayBuffer, ARRAY_BUFFER);
_setToStringTag($DataView, DATA_VIEW);
_hide($DataView[PROTOTYPE], _typed.VIEW, true);
exports[ARRAY_BUFFER] = $ArrayBuffer;
exports[DATA_VIEW] = $DataView;
});
// 7.3.20 SpeciesConstructor(O, defaultConstructor)
var SPECIES = _wks('species');
var _speciesConstructor = function (O, D) {
var C = _anObject(O).constructor;
var S;
return C === undefined || (S = _anObject(C)[SPECIES]) == undefined ? D : _aFunction(S);
};
'use strict';
var SPECIES$1 = _wks('species');
var _setSpecies = function (KEY) {
var C = _global[KEY];
if (_descriptors && C && !C[SPECIES$1]) _objectDp.f(C, SPECIES$1, {
configurable: true,
get: function () { return this; }
});
};
'use strict';
var ArrayBuffer = _global.ArrayBuffer;
var $ArrayBuffer = _typedBuffer.ArrayBuffer;
var $DataView = _typedBuffer.DataView;
var $isView = _typed.ABV && ArrayBuffer.isView;
var $slice = $ArrayBuffer.prototype.slice;
var VIEW = _typed.VIEW;
var ARRAY_BUFFER = 'ArrayBuffer';
_export(_export.G + _export.W + _export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });
_export(_export.S + _export.F * !_typed.CONSTR, ARRAY_BUFFER, {
// 24.1.3.1 ArrayBuffer.isView(arg)
isView: function isView(it) {
return $isView && $isView(it) || _isObject(it) && VIEW in it;
}
});
_export(_export.P + _export.U + _export.F * _fails(function () {
return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
}), ARRAY_BUFFER, {
// 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
slice: function slice(start, end) {
if ($slice !== undefined && end === undefined) return $slice.call(_anObject(this), start); // FF fix
var len = _anObject(this).byteLength;
var first = _toAbsoluteIndex(start, len);
var final = _toAbsoluteIndex(end === undefined ? len : end, len);
var result = new (_speciesConstructor(this, $ArrayBuffer))(_toLength(final - first));
var viewS = new $DataView(this);
var viewT = new $DataView(result);
var index = 0;
while (first < final) {
viewT.setUint8(index++, viewS.getUint8(first++));
} return result;
}
});
_setSpecies(ARRAY_BUFFER);
// getting tag from 19.1.3.6 Object.prototype.toString()
var TAG$1 = _wks('toStringTag');
// ES3 wrong here
var ARG = _cof(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (e) { /* empty */ }
};
var _classof = function (it) {
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T
// builtinTag case
: ARG ? _cof(O)
// ES3 arguments fallback
: (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
var _iterators = {};
// check on default Array iterator
var ITERATOR = _wks('iterator');
var ArrayProto = Array.prototype;
var _isArrayIter = function (it) {
return it !== undefined && (_iterators.Array === it || ArrayProto[ITERATOR] === it);
};
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var _objectKeys = Object.keys || function keys(O) {
return _objectKeysInternal(O, _enumBugKeys);
};
var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
_anObject(O);
var keys = _objectKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]);
return O;
};
var document$2 = _global.document;
var _html = document$2 && document$2.documentElement;
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var IE_PROTO$1 = _sharedKey('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE$1 = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = _domCreate('iframe');
var i = _enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
_html.appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]];
return createDict();
};
var _objectCreate = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE$1] = _anObject(O);
result = new Empty();
Empty[PROTOTYPE$1] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO$1] = O;
} else result = createDict();
return Properties === undefined ? result : _objectDps(result, Properties);
};
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var IE_PROTO$2 = _sharedKey('IE_PROTO');
var ObjectProto = Object.prototype;
var _objectGpo = Object.getPrototypeOf || function (O) {
O = _toObject(O);
if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
var ITERATOR$1 = _wks('iterator');
var core_getIteratorMethod = _core.getIteratorMethod = function (it) {
if (it != undefined) return it[ITERATOR$1]
|| it['@@iterator']
|| _iterators[_classof(it)];
};
// 7.2.2 IsArray(argument)
var _isArray = Array.isArray || function isArray(arg) {
return _cof(arg) == 'Array';
};
var SPECIES$2 = _wks('species');
var _arraySpeciesConstructor = function (original) {
var C;
if (_isArray(original)) {
C = original.constructor;
// cross-realm fallback
if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined;
if (_isObject(C)) {
C = C[SPECIES$2];
if (C === null) C = undefined;
}
} return C === undefined ? Array : C;
};
// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
var _arraySpeciesCreate = function (original, length) {
return new (_arraySpeciesConstructor(original))(length);
};
// 0 -> Array#forEach
// 1 -> Array#map
// 2 -> Array#filter
// 3 -> Array#some
// 4 -> Array#every
// 5 -> Array#find
// 6 -> Array#findIndex
var _arrayMethods = function (TYPE, $create) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
var create = $create || _arraySpeciesCreate;
return function ($this, callbackfn, that) {
var O = _toObject($this);
var self = _iobject(O);
var f = _ctx(callbackfn, that, 3);
var length = _toLength(self.length);
var index = 0;
var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
var val, res;
for (;length > index; index++) if (NO_HOLES || index in self) {
val = self[index];
res = f(val, index, O);
if (TYPE) {
if (IS_MAP) result[index] = res; // map
else if (res) switch (TYPE) {
case 3: return true; // some
case 5: return val; // find
case 6: return index; // findIndex
case 2: result.push(val); // filter
} else if (IS_EVERY) return false; // every
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
};
};
// 22.1.3.31 Array.prototype[@@unscopables]
var UNSCOPABLES = _wks('unscopables');
var ArrayProto$1 = Array.prototype;
if (ArrayProto$1[UNSCOPABLES] == undefined) _hide(ArrayProto$1, UNSCOPABLES, {});
var _addToUnscopables = function (key) {
ArrayProto$1[UNSCOPABLES][key] = true;
};
var _iterStep = function (done, value) {
return { value: value, done: !!done };
};
'use strict';
var IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
_hide(IteratorPrototype, _wks('iterator'), function () { return this; });
var _iterCreate = function (Constructor, NAME, next) {
Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) });
_setToStringTag(Constructor, NAME + ' Iterator');
};
'use strict';
var ITERATOR$2 = _wks('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
_iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR$2] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = (!BUGGY && $native) || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = _objectGpo($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
_setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!_library && !_has(IteratorPrototype, ITERATOR$2)) _hide(IteratorPrototype, ITERATOR$2, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR$2])) {
_hide(proto, ITERATOR$2, $default);
}
// Plug for library
_iterators[NAME] = $default;
_iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) _redefine(proto, key, methods[key]);
} else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
'use strict';
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) {
this._t = _toIobject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
var O = this._t;
var kind = this._k;
var index = this._i++;
if (!O || index >= O.length) {
this._t = undefined;
return _iterStep(1);
}
if (kind == 'keys') return _iterStep(0, index);
if (kind == 'values') return _iterStep(0, O[index]);
return _iterStep(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
_iterators.Arguments = _iterators.Array;
_addToUnscopables('keys');
_addToUnscopables('values');
_addToUnscopables('entries');
var ITERATOR$3 = _wks('iterator');
var SAFE_CLOSING = false;
try {
var riter = [7][ITERATOR$3]();
riter['return'] = function () { SAFE_CLOSING = true; };
// eslint-disable-next-line no-throw-literal
} catch (e) { /* empty */ }
var _iterDetect = function (exec, skipClosing) {
if (!skipClosing && !SAFE_CLOSING) return false;
var safe = false;
try {
var arr = [7];
var iter = arr[ITERATOR$3]();
iter.next = function () { return { done: safe = true }; };
arr[ITERATOR$3] = function () { return iter; };
exec(arr);
} catch (e) { /* empty */ }
return safe;
};
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
'use strict';
var _arrayCopyWithin = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
var O = _toObject(this);
var len = _toLength(O.length);
var to = _toAbsoluteIndex(target, len);
var from = _toAbsoluteIndex(start, len);
var end = arguments.length > 2 ? arguments[2] : undefined;
var count = Math.min((end === undefined ? len : _toAbsoluteIndex(end, len)) - from, len - to);
var inc = 1;
if (from < to && to < from + count) {
inc = -1;
from += count - 1;
to += count - 1;
}
while (count-- > 0) {
if (from in O) O[to] = O[from];
else delete O[to];
to += inc;
from += inc;
} return O;
};
var f$3 = {}.propertyIsEnumerable;
var _objectPie = {
f: f$3
};
var gOPD = Object.getOwnPropertyDescriptor;
var f$2 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) {
O = _toIobject(O);
P = _toPrimitive(P, true);
if (_ie8DomDefine) try {
return gOPD(O, P);
} catch (e) { /* empty */ }
if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]);
};
var _objectGopd = {
f: f$2
};
var _typedArray = createCommonjsModule(function (module) {
'use strict';
if (_descriptors) {
var LIBRARY = _library;
var global = _global;
var fails = _fails;
var $export = _export;
var $typed = _typed;
var $buffer = _typedBuffer;
var ctx = _ctx;
var anInstance = _anInstance;
var propertyDesc = _propertyDesc;
var hide = _hide;
var redefineAll = _redefineAll;
var toInteger = _toInteger;
var toLength = _toLength;
var toIndex = _toIndex;
var toAbsoluteIndex = _toAbsoluteIndex;
var toPrimitive = _toPrimitive;
var has = _has;
var classof$$1 = _classof;
var isObject = _isObject;
var toObject = _toObject;
var isArrayIter$$1 = _isArrayIter;
var create = _objectCreate;
var getPrototypeOf = _objectGpo;
var gOPN = _objectGopn.f;
var getIterFn$$1 = core_getIteratorMethod;
var uid = _uid;
var wks = _wks;
var createArrayMethod = _arrayMethods;
var createArrayIncludes = _arrayIncludes;
var speciesConstructor = _speciesConstructor;
var ArrayIterators = es6_array_iterator;
var Iterators$$1 = _iterators;
var $iterDetect = _iterDetect;
var setSpecies = _setSpecies;
var arrayFill = _arrayFill;
var arrayCopyWithin = _arrayCopyWithin;
var $DP = _objectDp;
var $GOPD = _objectGopd;
var dP = $DP.f;
var gOPD = $GOPD.f;
var RangeError = global.RangeError;
var TypeError = global.TypeError;
var Uint8Array = global.Uint8Array;
var ARRAY_BUFFER = 'ArrayBuffer';
var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
var PROTOTYPE = 'prototype';
var ArrayProto = Array[PROTOTYPE];
var $ArrayBuffer = $buffer.ArrayBuffer;
var $DataView = $buffer.DataView;
var arrayForEach = createArrayMethod(0);
var arrayFilter = createArrayMethod(2);
var arraySome = createArrayMethod(3);
var arrayEvery = createArrayMethod(4);
var arrayFind = createArrayMethod(5);
var arrayFindIndex = createArrayMethod(6);
var arrayIncludes = createArrayIncludes(true);
var arrayIndexOf = createArrayIncludes(false);
var arrayValues = ArrayIterators.values;
var arrayKeys = ArrayIterators.keys;
var arrayEntries = ArrayIterators.entries;
var arrayLastIndexOf = ArrayProto.lastIndexOf;
var arrayReduce = ArrayProto.reduce;
var arrayReduceRight = ArrayProto.reduceRight;
var arrayJoin = ArrayProto.join;
var arraySort = ArrayProto.sort;
var arraySlice = ArrayProto.slice;
var arrayToString = ArrayProto.toString;
var arrayToLocaleString = ArrayProto.toLocaleString;
var ITERATOR = wks('iterator');
var TAG = wks('toStringTag');
var TYPED_CONSTRUCTOR = uid('typed_constructor');
var DEF_CONSTRUCTOR = uid('def_constructor');
var ALL_CONSTRUCTORS = $typed.CONSTR;
var TYPED_ARRAY = $typed.TYPED;
var VIEW = $typed.VIEW;
var WRONG_LENGTH = 'Wrong length!';
var $map = createArrayMethod(1, function (O, length) {
return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
});
var LITTLE_ENDIAN = fails(function () {
// eslint-disable-next-line no-undef
return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
});
var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
new Uint8Array(1).set({});
});
var toOffset = function (it, BYTES) {
var offset = toInteger(it);
if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
return offset;
};
var validate = function (it) {
if (isObject(it) && TYPED_ARRAY in it) return it;
throw TypeError(it + ' is not a typed array!');
};
var allocate = function (C, length) {
if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
throw TypeError('It is not a typed array constructor!');
} return new C(length);
};
var speciesFromList = function (O, list) {
return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
};
var fromList = function (C, list) {
var index = 0;
var length = list.length;
var result = allocate(C, length);
while (length > index) result[index] = list[index++];
return result;
};
var addGetter = function (it, key, internal) {
dP(it, key, { get: function () { return this._d[internal]; } });
};
var $from = function from(source /* , mapfn, thisArg */) {
var O = toObject(source);
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var iterFn = getIterFn$$1(O);
var i, length, values, result, step, iterator;
if (iterFn != undefined && !isArrayIter$$1(iterFn)) {
for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
values.push(step.value);
} O = values;
}
if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
result[i] = mapping ? mapfn(O[i], i) : O[i];
}
return result;
};
var $of = function of(/* ...items */) {
var index = 0;
var length = arguments.length;
var result = allocate(this, length);
while (length > index) result[index] = arguments[index++];
return result;
};
// iOS Safari 6.x fails here
var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
var $toLocaleString = function toLocaleString() {
return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
};
var proto = {
copyWithin: function copyWithin(target, start /* , end */) {
return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
},
every: function every(callbackfn /* , thisArg */) {
return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
return arrayFill.apply(validate(this), arguments);
},
filter: function filter(callbackfn /* , thisArg */) {
return speciesFromList(this, arrayFilter(validate(this), callbackfn,
arguments.length > 1 ? arguments[1] : undefined));
},
find: function find(predicate /* , thisArg */) {
return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
findIndex: function findIndex(predicate /* , thisArg */) {
return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
forEach: function forEach(callbackfn /* , thisArg */) {
arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
indexOf: function indexOf(searchElement /* , fromIndex */) {
return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
includes: function includes(searchElement /* , fromIndex */) {
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
join: function join(separator) { // eslint-disable-line no-unused-vars
return arrayJoin.apply(validate(this), arguments);
},
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
return arrayLastIndexOf.apply(validate(this), arguments);
},
map: function map(mapfn /* , thisArg */) {
return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
},
reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
return arrayReduce.apply(validate(this), arguments);
},
reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
return arrayReduceRight.apply(validate(this), arguments);
},
reverse: function reverse() {
var that = this;
var length = validate(that).length;
var middle = Math.floor(length / 2);
var index = 0;
var value;
while (index < middle) {
value = that[index];
that[index++] = that[--length];
that[length] = value;
} return that;
},
some: function some(callbackfn /* , thisArg */) {
return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
sort: function sort(comparefn) {
return arraySort.call(validate(this), comparefn);
},
subarray: function subarray(begin, end) {
var O = validate(this);
var length = O.length;
var $begin = toAbsoluteIndex(begin, length);
return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
O.buffer,
O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
);
}
};
var $slice = function slice(start, end) {
return speciesFromList(this, arraySlice.call(validate(this), start, end));
};
var $set = function set(arrayLike /* , offset */) {
validate(this);
var offset = toOffset(arguments[1], 1);
var length = this.length;
var src = toObject(arrayLike);
var len = toLength(src.length);
var index = 0;
if (len + offset > length) throw RangeError(WRONG_LENGTH);
while (index < len) this[offset + index] = src[index++];
};
var $iterators$$1 = {
entries: function entries() {
return arrayEntries.call(validate(this));
},
keys: function keys() {
return arrayKeys.call(validate(this));
},
values: function values() {
return arrayValues.call(validate(this));
}
};
var isTAIndex = function (target, key) {
return isObject(target)
&& target[TYPED_ARRAY]
&& typeof key != 'symbol'
&& key in target
&& String(+key) == String(key);
};
var $getDesc = function getOwnPropertyDescriptor(target, key) {
return isTAIndex(target, key = toPrimitive(key, true))
? propertyDesc(2, target[key])
: gOPD(target, key);
};
var $setDesc = function defineProperty(target, key, desc) {
if (isTAIndex(target, key = toPrimitive(key, true))
&& isObject(desc)
&& has(desc, 'value')
&& !has(desc, 'get')
&& !has(desc, 'set')
// TODO: add validation descriptor w/o calling accessors
&& !desc.configurable
&& (!has(desc, 'writable') || desc.writable)
&& (!has(desc, 'enumerable') || desc.enumerable)
) {
target[key] = desc.value;
return target;
} return dP(target, key, desc);
};
if (!ALL_CONSTRUCTORS) {
$GOPD.f = $getDesc;
$DP.f = $setDesc;
}
$export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
getOwnPropertyDescriptor: $getDesc,
defineProperty: $setDesc
});
if (fails(function () { arrayToString.call({}); })) {
arrayToString = arrayToLocaleString = function toString() {
return arrayJoin.call(this);
};
}
var $TypedArrayPrototype$ = redefineAll({}, proto);
redefineAll($TypedArrayPrototype$, $iterators$$1);
hide($TypedArrayPrototype$, ITERATOR, $iterators$$1.values);
redefineAll($TypedArrayPrototype$, {
slice: $slice,
set: $set,
constructor: function () { /* noop */ },
toString: arrayToString,
toLocaleString: $toLocaleString
});
addGetter($TypedArrayPrototype$, 'buffer', 'b');
addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
addGetter($TypedArrayPrototype$, 'byteLength', 'l');
addGetter($TypedArrayPrototype$, 'length', 'e');
dP($TypedArrayPrototype$, TAG, {
get: function () { return this[TYPED_ARRAY]; }
});
// eslint-disable-next-line max-statements
module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
CLAMPED = !!CLAMPED;
var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
var GETTER = 'get' + KEY;
var SETTER = 'set' + KEY;
var TypedArray = global[NAME];
var Base = TypedArray || {};
var TAC = TypedArray && getPrototypeOf(TypedArray);
var FORCED = !TypedArray || !$typed.ABV;
var O = {};
var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
var getter = function (that, index) {
var data = that._d;
return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
};
var setter = function (that, index, value) {
var data = that._d;
if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
};
var addElement = function (that, index) {
dP(that, index, {
get: function () {
return getter(this, index);
},
set: function (value) {
return setter(this, index, value);
},
enumerable: true
});
};
if (FORCED) {
TypedArray = wrapper(function (that, data, $offset, $length) {
anInstance(that, TypedArray, NAME, '_d');
var index = 0;
var offset = 0;
var buffer, byteLength, length, klass;
if (!isObject(data)) {
length = toIndex(data);
byteLength = length * BYTES;
buffer = new $ArrayBuffer(byteLength);
} else if (data instanceof $ArrayBuffer || (klass = classof$$1(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
buffer = data;
offset = toOffset($offset, BYTES);
var $len = data.byteLength;
if ($length === undefined) {
if ($len % BYTES) throw RangeError(WRONG_LENGTH);
byteLength = $len - offset;
if (byteLength < 0) throw RangeError(WRONG_LENGTH);
} else {
byteLength = toLength($length) * BYTES;
if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
}
length = byteLength / BYTES;
} else if (TYPED_ARRAY in data) {
return fromList(TypedArray, data);
} else {
return $from.call(TypedArray, data);
}
hide(that, '_d', {
b: buffer,
o: offset,
l: byteLength,
e: length,
v: new $DataView(buffer)
});
while (index < length) addElement(that, index++);
});
TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
hide(TypedArrayPrototype, 'constructor', TypedArray);
} else if (!fails(function () {
TypedArray(1);
}) || !fails(function () {
new TypedArray(-1); // eslint-disable-line no-new
}) || !$iterDetect(function (iter) {
new TypedArray(); // eslint-disable-line no-new
new TypedArray(null); // eslint-disable-line no-new
new TypedArray(1.5); // eslint-disable-line no-new
new TypedArray(iter); // eslint-disable-line no-new
}, true)) {
TypedArray = wrapper(function (that, data, $offset, $length) {
anInstance(that, TypedArray, NAME);
var klass;
// `ws` module bug, temporarily remove validation length for Uint8Array
// https://github.com/websockets/ws/pull/645
if (!isObject(data)) return new Base(toIndex(data));
if (data instanceof $ArrayBuffer || (klass = classof$$1(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
return $length !== undefined
? new Base(data, toOffset($offset, BYTES), $length)
: $offset !== undefined
? new Base(data, toOffset($offset, BYTES))
: new Base(data);
}
if (TYPED_ARRAY in data) return fromList(TypedArray, data);
return $from.call(TypedArray, data);
});
arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
});
TypedArray[PROTOTYPE] = TypedArrayPrototype;
if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
}
var $nativeIterator = TypedArrayPrototype[ITERATOR];
var CORRECT_ITER_NAME = !!$nativeIterator
&& ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
var $iterator = $iterators$$1.values;
hide(TypedArray, TYPED_CONSTRUCTOR, true);
hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
hide(TypedArrayPrototype, VIEW, true);
hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
dP(TypedArrayPrototype, TAG, {
get: function () { return NAME; }
});
}
O[NAME] = TypedArray;
$export($export.G + $export.W + $export.F * (TypedArray != Base), O);
$export($export.S, NAME, {
BYTES_PER_ELEMENT: BYTES
});
$export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
from: $from,
of: $of
});
if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
$export($export.P, NAME, proto);
setSpecies(NAME);
$export($export.P + $export.F * FORCED_SET, NAME, { set: $set });
$export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators$$1);
if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;
$export($export.P + $export.F * fails(function () {
new TypedArray(1).slice();
}), NAME, { slice: $slice });
$export($export.P + $export.F * (fails(function () {
return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
}) || !fails(function () {
TypedArrayPrototype.toLocaleString.call([1, 2]);
})), NAME, { toLocaleString: $toLocaleString });
Iterators$$1[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
};
} else module.exports = function () { /* empty */ };
});
_typedArray('Int8', 1, function (init) {
return function Int8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
_typedArray('Uint8', 1, function (init) {
return function Uint8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
_typedArray('Uint8', 1, function (init) {
return function Uint8ClampedArray(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
}, true);
_typedArray('Int16', 2, function (init) {
return function Int16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
_typedArray('Uint16', 2, function (init) {
return function Uint16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
_typedArray('Int32', 4, function (init) {
return function Int32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
_typedArray('Uint32', 4, function (init) {
return function Uint32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
_typedArray('Float32', 4, function (init) {
return function Float32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
_typedArray('Float64', 8, function (init) {
return function Float64Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
// call something on iterator step with safe closing on error
var _iterCall = function (iterator, fn, value, entries) {
try {
return entries ? fn(_anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch (e) {
var ret = iterator['return'];
if (ret !== undefined) _anObject(ret.call(iterator));
throw e;
}
};
var _forOf = createCommonjsModule(function (module) {
var BREAK = {};
var RETURN = {};
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(iterable);
var f = _ctx(fn, that, entries ? 2 : 1);
var index = 0;
var length, step, iterator, result;
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
// fast case for arrays with default iterator
if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) {
result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
if (result === BREAK || result === RETURN) return result;
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
result = _iterCall(iterator, f, step.value, entries);
if (result === BREAK || result === RETURN) return result;
}
};
exports.BREAK = BREAK;
exports.RETURN = RETURN;
});
var _meta = createCommonjsModule(function (module) {
var META = _uid('meta');
var setDesc = _objectDp.f;
var id = 0;
var isExtensible = Object.isExtensible || function () {
return true;
};
var FREEZE = !_fails(function () {
return isExtensible(Object.preventExtensions({}));
});
var setMeta = function (it) {
setDesc(it, META, { value: {
i: 'O' + ++id, // object ID
w: {} // weak collections IDs
} });
};
var fastKey = function (it, create) {
// return primitive with prefix
if (!_isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if (!_has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return 'F';
// not necessary to add metadata
if (!create) return 'E';
// add missing metadata
setMeta(it);
// return object ID
} return it[META].i;
};
var getWeak = function (it, create) {
if (!_has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return true;
// not necessary to add metadata
if (!create) return false;
// add missing metadata
setMeta(it);
// return hash weak collections IDs
} return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it);
return it;
};
var meta = module.exports = {
KEY: META,
NEED: false,
fastKey: fastKey,
getWeak: getWeak,
onFreeze: onFreeze
};
});
var _validateCollection = function (it, TYPE) {
if (!_isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
return it;
};
'use strict';
var dP$1 = _objectDp.f;
var fastKey = _meta.fastKey;
var SIZE = _descriptors ? '_s' : 'size';
var getEntry = function (that, key) {
// fast case
var index = fastKey(key);
var entry;
if (index !== 'F') return that._i[index];
// frozen object case
for (entry = that._f; entry; entry = entry.n) {
if (entry.k == key) return entry;
}
};
var _collectionStrong = {
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
var C = wrapper(function (that, iterable) {
_anInstance(that, C, NAME, '_i');
that._t = NAME; // collection type
that._i = _objectCreate(null); // index
that._f = undefined; // first entry
that._l = undefined; // last entry
that[SIZE] = 0; // size
if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that);
});
_redefineAll(C.prototype, {
// 23.1.3.1 Map.prototype.clear()
// 23.2.3.2 Set.prototype.clear()
clear: function clear() {
for (var that = _validateCollection(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
entry.r = true;
if (entry.p) entry.p = entry.p.n = undefined;
delete data[entry.i];
}
that._f = that._l = undefined;
that[SIZE] = 0;
},
// 23.1.3.3 Map.prototype.delete(key)
// 23.2.3.4 Set.prototype.delete(value)
'delete': function (key) {
var that = _validateCollection(this, NAME);
var entry = getEntry(that, key);
if (entry) {
var next = entry.n;
var prev = entry.p;
delete that._i[entry.i];
entry.r = true;
if (prev) prev.n = next;
if (next) next.p = prev;
if (that._f == entry) that._f = next;
if (that._l == entry) that._l = prev;
that[SIZE]--;
} return !!entry;
},
// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
forEach: function forEach(callbackfn /* , that = undefined */) {
_validateCollection(this, NAME);
var f = _ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
var entry;
while (entry = entry ? entry.n : this._f) {
f(entry.v, entry.k, this);
// revert to the last existing entry
while (entry && entry.r) entry = entry.p;
}
},
// 23.1.3.7 Map.prototype.has(key)
// 23.2.3.7 Set.prototype.has(value)
has: function has(key) {
return !!getEntry(_validateCollection(this, NAME), key);
}
});
if (_descriptors) dP$1(C.prototype, 'size', {
get: function () {
return _validateCollection(this, NAME)[SIZE];
}
});
return C;
},
def: function (that, key, value) {
var entry = getEntry(that, key);
var prev, index;
// change existing entry
if (entry) {
entry.v = value;
// create new entry
} else {
that._l = entry = {
i: index = fastKey(key, true), // <- index
k: key, // <- key
v: value, // <- value
p: prev = that._l, // <- previous entry
n: undefined, // <- next entry
r: false // <- removed
};
if (!that._f) that._f = entry;
if (prev) prev.n = entry;
that[SIZE]++;
// add to index
if (index !== 'F') that._i[index] = entry;
} return that;
},
getEntry: getEntry,
setStrong: function (C, NAME, IS_MAP) {
// add .keys, .values, .entries, [@@iterator]
// 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
_iterDefine(C, NAME, function (iterated, kind) {
this._t = _validateCollection(iterated, NAME); // target
this._k = kind; // kind
this._l = undefined; // previous
}, function () {
var that = this;
var kind = that._k;
var entry = that._l;
// revert to the last existing entry
while (entry && entry.r) entry = entry.p;
// get next entry
if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
// or finish the iteration
that._t = undefined;
return _iterStep(1);
}
// return step by kind
if (kind == 'keys') return _iterStep(0, entry.k);
if (kind == 'values') return _iterStep(0, entry.v);
return _iterStep(0, [entry.k, entry.v]);
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
// add [@@species], 23.1.2.2, 23.2.2.2
_setSpecies(NAME);
}
};
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var check = function (O, proto) {
_anObject(O);
if (!_isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
};
var _setProto = {
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
function (test, buggy, set) {
try {
set = _ctx(Function.call, _objectGopd.f(Object.prototype, '__proto__').set, 2);
set(test, []);
buggy = !(test instanceof Array);
} catch (e) { buggy = true; }
return function setPrototypeOf(O, proto) {
check(O, proto);
if (buggy) O.__proto__ = proto;
else set(O, proto);
return O;
};
}({}, false) : undefined),
check: check
};
var setPrototypeOf = _setProto.set;
var _inheritIfRequired = function (that, target, C) {
var S = target.constructor;
var P;
if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && _isObject(P) && setPrototypeOf) {
setPrototypeOf(that, P);
} return that;
};
'use strict';
var _collection = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
var Base = _global[NAME];
var C = Base;
var ADDER = IS_MAP ? 'set' : 'add';
var proto = C && C.prototype;
var O = {};
var fixMethod = function (KEY) {
var fn = proto[KEY];
_redefine(proto, KEY,
KEY == 'delete' ? function (a) {
return IS_WEAK && !_isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'has' ? function has(a) {
return IS_WEAK && !_isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'get' ? function get(a) {
return IS_WEAK && !_isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
: function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
);
};
if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !_fails(function () {
new C().entries().next();
}))) {
// create collection constructor
C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
_redefineAll(C.prototype, methods);
_meta.NEED = true;
} else {
var instance = new C();
// early implementations not supports chaining
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
var THROWS_ON_PRIMITIVES = _fails(function () { instance.has(1); });
// most early implementations doesn't supports iterables, most modern - not close it correctly
var ACCEPT_ITERABLES = _iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
// for early implementations -0 and +0 not the same
var BUGGY_ZERO = !IS_WEAK && _fails(function () {
// V8 ~ Chromium 42- fails only with 5+ elements
var $instance = new C();
var index = 5;
while (index--) $instance[ADDER](index, index);
return !$instance.has(-0);
});
if (!ACCEPT_ITERABLES) {
C = wrapper(function (target, iterable) {
_anInstance(target, C, NAME);
var that = _inheritIfRequired(new Base(), target, C);
if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that);
return that;
});
C.prototype = proto;
proto.constructor = C;
}
if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
fixMethod('delete');
fixMethod('has');
IS_MAP && fixMethod('get');
}
if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
// weak collections should not contains .clear method
if (IS_WEAK && proto.clear) delete proto.clear;
}
_setToStringTag(C, NAME);
O[NAME] = C;
_export(_export.G + _export.W + _export.F * (C != Base), O);
if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
return C;
};
'use strict';
var MAP = 'Map';
// 23.1 Map Objects
var es6_map = _collection(MAP, function (get) {
return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.1.3.6 Map.prototype.get(key)
get: function get(key) {
var entry = _collectionStrong.getEntry(_validateCollection(this, MAP), key);
return entry && entry.v;
},
// 23.1.3.9 Map.prototype.set(key, value)
set: function set(key, value) {
return _collectionStrong.def(_validateCollection(this, MAP), key === 0 ? 0 : key, value);
}
}, _collectionStrong, true);
'use strict';
var SET = 'Set';
// 23.2 Set Objects
var es6_set = _collection(SET, function (get) {
return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.2.3.1 Set.prototype.add(value)
add: function add(value) {
return _collectionStrong.def(_validateCollection(this, SET), value = value === 0 ? 0 : value, value);
}
}, _collectionStrong);
var f$4 = Object.getOwnPropertySymbols;
var _objectGops = {
f: f$4
};
'use strict';
// 19.1.2.1 Object.assign(target, source, ...)
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
var _objectAssign = !$assign || _fails(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = _toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = _objectGops.f;
var isEnum = _objectPie.f;
while (aLen > index) {
var S = _iobject(arguments[index++]);
var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
} return T;
} : $assign;
'use strict';
var getWeak = _meta.getWeak;
var arrayFind = _arrayMethods(5);
var arrayFindIndex = _arrayMethods(6);
var id$1 = 0;
// fallback for uncaught frozen keys
var uncaughtFrozenStore = function (that) {
return that._l || (that._l = new UncaughtFrozenStore());
};
var UncaughtFrozenStore = function () {
this.a = [];
};
var findUncaughtFrozen = function (store, key) {
return arrayFind(store.a, function (it) {
return it[0] === key;
});
};
UncaughtFrozenStore.prototype = {
get: function (key) {
var entry = findUncaughtFrozen(this, key);
if (entry) return entry[1];
},
has: function (key) {
return !!findUncaughtFrozen(this, key);
},
set: function (key, value) {
var entry = findUncaughtFrozen(this, key);
if (entry) entry[1] = value;
else this.a.push([key, value]);
},
'delete': function (key) {
var index = arrayFindIndex(this.a, function (it) {
return it[0] === key;
});
if (~index) this.a.splice(index, 1);
return !!~index;
}
};
var _collectionWeak = {
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
var C = wrapper(function (that, iterable) {
_anInstance(that, C, NAME, '_i');
that._t = NAME; // collection type
that._i = id$1++; // collection id
that._l = undefined; // leak store for uncaught frozen objects
if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that);
});
_redefineAll(C.prototype, {
// 23.3.3.2 WeakMap.prototype.delete(key)
// 23.4.3.3 WeakSet.prototype.delete(value)
'delete': function (key) {
if (!_isObject(key)) return false;
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME))['delete'](key);
return data && _has(data, this._i) && delete data[this._i];
},
// 23.3.3.4 WeakMap.prototype.has(key)
// 23.4.3.4 WeakSet.prototype.has(value)
has: function has(key) {
if (!_isObject(key)) return false;
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME)).has(key);
return data && _has(data, this._i);
}
});
return C;
},
def: function (that, key, value) {
var data = getWeak(_anObject(key), true);
if (data === true) uncaughtFrozenStore(that).set(key, value);
else data[that._i] = value;
return that;
},
ufstore: uncaughtFrozenStore
};
var es6_weakMap = createCommonjsModule(function (module) {
'use strict';
var each = _arrayMethods(0);
var WEAK_MAP = 'WeakMap';
var getWeak = _meta.getWeak;
var isExtensible = Object.isExtensible;
var uncaughtFrozenStore = _collectionWeak.ufstore;
var tmp = {};
var InternalMap;
var wrapper = function (get) {
return function WeakMap() {
return get(this, arguments.length > 0 ? arguments[0] : undefined);
};
};
var methods = {
// 23.3.3.3 WeakMap.prototype.get(key)
get: function get(key) {
if (_isObject(key)) {
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(_validateCollection(this, WEAK_MAP)).get(key);
return data ? data[this._i] : undefined;
}
},
// 23.3.3.5 WeakMap.prototype.set(key, value)
set: function set(key, value) {
return _collectionWeak.def(_validateCollection(this, WEAK_MAP), key, value);
}
};
// 23.3 WeakMap Objects
var $WeakMap = module.exports = _collection(WEAK_MAP, wrapper, methods, _collectionWeak, true, true);
// IE11 WeakMap frozen keys fix
if (_fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {
InternalMap = _collectionWeak.getConstructor(wrapper, WEAK_MAP);
_objectAssign(InternalMap.prototype, methods);
_meta.NEED = true;
each(['delete', 'has', 'get', 'set'], function (key) {
var proto = $WeakMap.prototype;
var method = proto[key];
_redefine(proto, key, function (a, b) {
// store frozen objects on internal weakmap shim
if (_isObject(a) && !isExtensible(a)) {
if (!this._f) this._f = new InternalMap();
var result = this._f[key](a, b);
return key == 'set' ? this : result;
// store all the rest on native weakmap
} return method.call(this, a, b);
});
});
}
});
'use strict';
var WEAK_SET = 'WeakSet';
// 23.4 WeakSet Objects
_collection(WEAK_SET, function (get) {
return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.4.3.1 WeakSet.prototype.add(value)
add: function add(value) {
return _collectionWeak.def(_validateCollection(this, WEAK_SET), value, true);
}
}, _collectionWeak, false, true);
// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
var rApply = (_global.Reflect || {}).apply;
var fApply = Function.apply;
// MS Edge argumentsList argument is optional
_export(_export.S + _export.F * !_fails(function () {
rApply(function () { /* empty */ });
}), 'Reflect', {
apply: function apply(target, thisArgument, argumentsList) {
var T = _aFunction(target);
var L = _anObject(argumentsList);
return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
}
});
// fast apply, http://jsperf.lnkit.com/fast-apply/5
var _invoke = function (fn, args, that) {
var un = that === undefined;
switch (args.length) {
case 0: return un ? fn()
: fn.call(that);
case 1: return un ? fn(args[0])
: fn.call(that, args[0]);
case 2: return un ? fn(args[0], args[1])
: fn.call(that, args[0], args[1]);
case 3: return un ? fn(args[0], args[1], args[2])
: fn.call(that, args[0], args[1], args[2]);
case 4: return un ? fn(args[0], args[1], args[2], args[3])
: fn.call(that, args[0], args[1], args[2], args[3]);
} return fn.apply(that, args);
};
'use strict';
var arraySlice = [].slice;
var factories = {};
var construct = function (F, len, args) {
if (!(len in factories)) {
for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
// eslint-disable-next-line no-new-func
factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
} return factories[len](F, args);
};
var _bind = Function.bind || function bind(that /* , ...args */) {
var fn = _aFunction(this);
var partArgs = arraySlice.call(arguments, 1);
var bound = function (/* args... */) {
var args = partArgs.concat(arraySlice.call(arguments));
return this instanceof bound ? construct(fn, args.length, args) : _invoke(fn, args, that);
};
if (_isObject(fn.prototype)) bound.prototype = fn.prototype;
return bound;
};
// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
var rConstruct = (_global.Reflect || {}).construct;
// MS Edge supports only 2 arguments and argumentsList argument is optional
// FF Nightly sets third argument as `new.target`, but does not create `this` from it
var NEW_TARGET_BUG = _fails(function () {
function F() { /* empty */ }
return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
});
var ARGS_BUG = !_fails(function () {
rConstruct(function () { /* empty */ });
});
_export(_export.S + _export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
construct: function construct(Target, args /* , newTarget */) {
_aFunction(Target);
_anObject(args);
var newTarget = arguments.length < 3 ? Target : _aFunction(arguments[2]);
if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
if (Target == newTarget) {
// w/o altered newTarget, optimization for 0-4 arguments
switch (args.length) {
case 0: return new Target();
case 1: return new Target(args[0]);
case 2: return new Target(args[0], args[1]);
case 3: return new Target(args[0], args[1], args[2]);
case 4: return new Target(args[0], args[1], args[2], args[3]);
}
// w/o altered newTarget, lot of arguments case
var $args = [null];
$args.push.apply($args, args);
return new (_bind.apply(Target, $args))();
}
// with altered newTarget, not support built-in constructors
var proto = newTarget.prototype;
var instance = _objectCreate(_isObject(proto) ? proto : Object.prototype);
var result = Function.apply.call(Target, instance, args);
return _isObject(result) ? result : instance;
}
});
// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
// MS Edge has broken Reflect.defineProperty - throwing instead of returning false
_export(_export.S + _export.F * _fails(function () {
// eslint-disable-next-line no-undef
Reflect.defineProperty(_objectDp.f({}, 1, { value: 1 }), 1, { value: 2 });
}), 'Reflect', {
defineProperty: function defineProperty(target, propertyKey, attributes) {
_anObject(target);
propertyKey = _toPrimitive(propertyKey, true);
_anObject(attributes);
try {
_objectDp.f(target, propertyKey, attributes);
return true;
} catch (e) {
return false;
}
}
});
// 26.1.4 Reflect.deleteProperty(target, propertyKey)
var gOPD$2 = _objectGopd.f;
_export(_export.S, 'Reflect', {
deleteProperty: function deleteProperty(target, propertyKey) {
var desc = gOPD$2(_anObject(target), propertyKey);
return desc && !desc.configurable ? false : delete target[propertyKey];
}
});
// 26.1.6 Reflect.get(target, propertyKey [, receiver])
function get(target, propertyKey /* , receiver */) {
var receiver = arguments.length < 3 ? target : arguments[2];
var desc, proto;
if (_anObject(target) === receiver) return target[propertyKey];
if (desc = _objectGopd.f(target, propertyKey)) return _has(desc, 'value')
? desc.value
: desc.get !== undefined
? desc.get.call(receiver)
: undefined;
if (_isObject(proto = _objectGpo(target))) return get(proto, propertyKey, receiver);
}
_export(_export.S, 'Reflect', { get: get });
// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
_export(_export.S, 'Reflect', {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
return _objectGopd.f(_anObject(target), propertyKey);
}
});
// 26.1.8 Reflect.getPrototypeOf(target)
_export(_export.S, 'Reflect', {
getPrototypeOf: function getPrototypeOf(target) {
return _objectGpo(_anObject(target));
}
});
// 26.1.9 Reflect.has(target, propertyKey)
_export(_export.S, 'Reflect', {
has: function has(target, propertyKey) {
return propertyKey in target;
}
});
// 26.1.10 Reflect.isExtensible(target)
var $isExtensible = Object.isExtensible;
_export(_export.S, 'Reflect', {
isExtensible: function isExtensible(target) {
_anObject(target);
return $isExtensible ? $isExtensible(target) : true;
}
});
// all object keys, includes non-enumerable and symbols
var Reflect$1 = _global.Reflect;
var _ownKeys = Reflect$1 && Reflect$1.ownKeys || function ownKeys(it) {
var keys = _objectGopn.f(_anObject(it));
var getSymbols = _objectGops.f;
return getSymbols ? keys.concat(getSymbols(it)) : keys;
};
// 26.1.11 Reflect.ownKeys(target)
_export(_export.S, 'Reflect', { ownKeys: _ownKeys });
// 26.1.12 Reflect.preventExtensions(target)
var $preventExtensions = Object.preventExtensions;
_export(_export.S, 'Reflect', {
preventExtensions: function preventExtensions(target) {
_anObject(target);
try {
if ($preventExtensions) $preventExtensions(target);
return true;
} catch (e) {
return false;
}
}
});
// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
function set(target, propertyKey, V /* , receiver */) {
var receiver = arguments.length < 4 ? target : arguments[3];
var ownDesc = _objectGopd.f(_anObject(target), propertyKey);
var existingDescriptor, proto;
if (!ownDesc) {
if (_isObject(proto = _objectGpo(target))) {
return set(proto, propertyKey, V, receiver);
}
ownDesc = _propertyDesc(0);
}
if (_has(ownDesc, 'value')) {
if (ownDesc.writable === false || !_isObject(receiver)) return false;
existingDescriptor = _objectGopd.f(receiver, propertyKey) || _propertyDesc(0);
existingDescriptor.value = V;
_objectDp.f(receiver, propertyKey, existingDescriptor);
return true;
}
return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
}
_export(_export.S, 'Reflect', { set: set });
// 26.1.14 Reflect.setPrototypeOf(target, proto)
if (_setProto) _export(_export.S, 'Reflect', {
setPrototypeOf: function setPrototypeOf(target, proto) {
_setProto.check(target, proto);
try {
_setProto.set(target, proto);
return true;
} catch (e) {
return false;
}
}
});
var process$1 = _global.process;
var setTask = _global.setImmediate;
var clearTask = _global.clearImmediate;
var MessageChannel = _global.MessageChannel;
var Dispatch = _global.Dispatch;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = 'onreadystatechange';
var defer;
var channel;
var port;
var run = function () {
var id = +this;
// eslint-disable-next-line no-prototype-builtins
if (queue.hasOwnProperty(id)) {
var fn = queue[id];
delete queue[id];
fn();
}
};
var listener = function (event) {
run.call(event.data);
};
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if (!setTask || !clearTask) {
setTask = function setImmediate(fn) {
var args = [];
var i = 1;
while (arguments.length > i) args.push(arguments[i++]);
queue[++counter] = function () {
// eslint-disable-next-line no-new-func
_invoke(typeof fn == 'function' ? fn : Function(fn), args);
};
defer(counter);
return counter;
};
clearTask = function clearImmediate(id) {
delete queue[id];
};
// Node.js 0.8-
if (_cof(process$1) == 'process') {
defer = function (id) {
process$1.nextTick(_ctx(run, id, 1));
};
// Sphere (JS game engine) Dispatch API
} else if (Dispatch && Dispatch.now) {
defer = function (id) {
Dispatch.now(_ctx(run, id, 1));
};
// Browsers with MessageChannel, includes WebWorkers
} else if (MessageChannel) {
channel = new MessageChannel();
port = channel.port2;
channel.port1.onmessage = listener;
defer = _ctx(port.postMessage, port, 1);
// Browsers with postMessage, skip WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
} else if (_global.addEventListener && typeof postMessage == 'function' && !_global.importScripts) {
defer = function (id) {
_global.postMessage(id + '', '*');
};
_global.addEventListener('message', listener, false);
// IE8-
} else if (ONREADYSTATECHANGE in _domCreate('script')) {
defer = function (id) {
_html.appendChild(_domCreate('script'))[ONREADYSTATECHANGE] = function () {
_html.removeChild(this);
run.call(id);
};
};
// Rest old browsers
} else {
defer = function (id) {
setTimeout(_ctx(run, id, 1), 0);
};
}
}
var _task = {
set: setTask,
clear: clearTask
};
var macrotask = _task.set;
var Observer = _global.MutationObserver || _global.WebKitMutationObserver;
var process$2 = _global.process;
var Promise$1 = _global.Promise;
var isNode$1 = _cof(process$2) == 'process';
var _microtask = function () {
var head, last, notify;
var flush = function () {
var parent, fn;
if (isNode$1 && (parent = process$2.domain)) parent.exit();
while (head) {
fn = head.fn;
head = head.next;
try {
fn();
} catch (e) {
if (head) notify();
else last = undefined;
throw e;
}
} last = undefined;
if (parent) parent.enter();
};
// Node.js
if (isNode$1) {
notify = function () {
process$2.nextTick(flush);
};
// browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
} else if (Observer && !(_global.navigator && _global.navigator.standalone)) {
var toggle = true;
var node = document.createTextNode('');
new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
notify = function () {
node.data = toggle = !toggle;
};
// environments with maybe non-completely correct, but existent Promise
} else if (Promise$1 && Promise$1.resolve) {
var promise = Promise$1.resolve();
notify = function () {
promise.then(flush);
};
// for other environments - macrotask based on:
// - setImmediate
// - MessageChannel
// - window.postMessag
// - onreadystatechange
// - setTimeout
} else {
notify = function () {
// strange IE + webpack dev server bug - use .call(global)
macrotask.call(_global, flush);
};
}
return function (fn) {
var task = { fn: fn, next: undefined };
if (last) last.next = task;
if (!head) {
head = task;
notify();
} last = task;
};
};
'use strict';
// 25.4.1.5 NewPromiseCapability(C)
function PromiseCapability(C) {
var resolve, reject;
this.promise = new C(function ($$resolve, $$reject) {
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
resolve = $$resolve;
reject = $$reject;
});
this.resolve = _aFunction(resolve);
this.reject = _aFunction(reject);
}
var f$5 = function (C) {
return new PromiseCapability(C);
};
var _newPromiseCapability = {
f: f$5
};
var _perform = function (exec) {
try {
return { e: false, v: exec() };
} catch (e) {
return { e: true, v: e };
}
};
var _promiseResolve = function (C, x) {
_anObject(C);
if (_isObject(x) && x.constructor === C) return x;
var promiseCapability = _newPromiseCapability.f(C);
var resolve = promiseCapability.resolve;
resolve(x);
return promiseCapability.promise;
};
'use strict';
var task = _task.set;
var microtask = _microtask();
var PROMISE = 'Promise';
var TypeError$1 = _global.TypeError;
var process = _global.process;
var $Promise = _global[PROMISE];
var isNode = _classof(process) == 'process';
var empty = function () { /* empty */ };
var Internal;
var newGenericPromiseCapability;
var OwnPromiseCapability;
var Wrapper;
var newPromiseCapability = newGenericPromiseCapability = _newPromiseCapability.f;
var USE_NATIVE = !!function () {
try {
// correct subclassing with @@species support
var promise = $Promise.resolve(1);
var FakePromise = (promise.constructor = {})[_wks('species')] = function (exec) {
exec(empty, empty);
};
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test
return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
} catch (e) { /* empty */ }
}();
// helpers
var isThenable = function (it) {
var then;
return _isObject(it) && typeof (then = it.then) == 'function' ? then : false;
};
var notify = function (promise, isReject) {
if (promise._n) return;
promise._n = true;
var chain = promise._c;
microtask(function () {
var value = promise._v;
var ok = promise._s == 1;
var i = 0;
var run = function (reaction) {
var handler = ok ? reaction.ok : reaction.fail;
var resolve = reaction.resolve;
var reject = reaction.reject;
var domain = reaction.domain;
var result, then;
try {
if (handler) {
if (!ok) {
if (promise._h == 2) onHandleUnhandled(promise);
promise._h = 1;
}
if (handler === true) result = value;
else {
if (domain) domain.enter();
result = handler(value);
if (domain) domain.exit();
}
if (result === reaction.promise) {
reject(TypeError$1('Promise-chain cycle'));
} else if (then = isThenable(result)) {
then.call(result, resolve, reject);
} else resolve(result);
} else reject(value);
} catch (e) {
reject(e);
}
};
while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
promise._c = [];
promise._n = false;
if (isReject && !promise._h) onUnhandled(promise);
});
};
var onUnhandled = function (promise) {
task.call(_global, function () {
var value = promise._v;
var unhandled = isUnhandled(promise);
var result, handler, console;
if (unhandled) {
result = _perform(function () {
if (isNode) {
process.emit('unhandledRejection', value, promise);
} else if (handler = _global.onunhandledrejection) {
handler({ promise: promise, reason: value });
} else if ((console = _global.console) && console.error) {
console.error('Unhandled promise rejection', value);
}
});
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
promise._h = isNode || isUnhandled(promise) ? 2 : 1;
} promise._a = undefined;
if (unhandled && result.e) throw result.v;
});
};
var isUnhandled = function (promise) {
return promise._h !== 1 && (promise._a || promise._c).length === 0;
};
var onHandleUnhandled = function (promise) {
task.call(_global, function () {
var handler;
if (isNode) {
process.emit('rejectionHandled', promise);
} else if (handler = _global.onrejectionhandled) {
handler({ promise: promise, reason: promise._v });
}
});
};
var $reject = function (value) {
var promise = this;
if (promise._d) return;
promise._d = true;
promise = promise._w || promise; // unwrap
promise._v = value;
promise._s = 2;
if (!promise._a) promise._a = promise._c.slice();
notify(promise, true);
};
var $resolve = function (value) {
var promise = this;
var then;
if (promise._d) return;
promise._d = true;
promise = promise._w || promise; // unwrap
try {
if (promise === value) throw TypeError$1("Promise can't be resolved itself");
if (then = isThenable(value)) {
microtask(function () {
var wrapper = { _w: promise, _d: false }; // wrap
try {
then.call(value, _ctx($resolve, wrapper, 1), _ctx($reject, wrapper, 1));
} catch (e) {
$reject.call(wrapper, e);
}
});
} else {
promise._v = value;
promise._s = 1;
notify(promise, false);
}
} catch (e) {
$reject.call({ _w: promise, _d: false }, e); // wrap
}
};
// constructor polyfill
if (!USE_NATIVE) {
// 25.4.3.1 Promise(executor)
$Promise = function Promise(executor) {
_anInstance(this, $Promise, PROMISE, '_h');
_aFunction(executor);
Internal.call(this);
try {
executor(_ctx($resolve, this, 1), _ctx($reject, this, 1));
} catch (err) {
$reject.call(this, err);
}
};
// eslint-disable-next-line no-unused-vars
Internal = function Promise(executor) {
this._c = []; // <- awaiting reactions
this._a = undefined; // <- checked in isUnhandled reactions
this._s = 0; // <- state
this._d = false; // <- done
this._v = undefined; // <- value
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
this._n = false; // <- notify
};
Internal.prototype = _redefineAll($Promise.prototype, {
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
then: function then(onFulfilled, onRejected) {
var reaction = newPromiseCapability(_speciesConstructor(this, $Promise));
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
reaction.fail = typeof onRejected == 'function' && onRejected;
reaction.domain = isNode ? process.domain : undefined;
this._c.push(reaction);
if (this._a) this._a.push(reaction);
if (this._s) notify(this, false);
return reaction.promise;
},
// 25.4.5.1 Promise.prototype.catch(onRejected)
'catch': function (onRejected) {
return this.then(undefined, onRejected);
}
});
OwnPromiseCapability = function () {
var promise = new Internal();
this.promise = promise;
this.resolve = _ctx($resolve, promise, 1);
this.reject = _ctx($reject, promise, 1);
};
_newPromiseCapability.f = newPromiseCapability = function (C) {
return C === $Promise || C === Wrapper
? new OwnPromiseCapability(C)
: newGenericPromiseCapability(C);
};
}
_export(_export.G + _export.W + _export.F * !USE_NATIVE, { Promise: $Promise });
_setToStringTag($Promise, PROMISE);
_setSpecies(PROMISE);
Wrapper = _core[PROMISE];
// statics
_export(_export.S + _export.F * !USE_NATIVE, PROMISE, {
// 25.4.4.5 Promise.reject(r)
reject: function reject(r) {
var capability = newPromiseCapability(this);
var $$reject = capability.reject;
$$reject(r);
return capability.promise;
}
});
_export(_export.S + _export.F * (_library || !USE_NATIVE), PROMISE, {
// 25.4.4.6 Promise.resolve(x)
resolve: function resolve(x) {
return _promiseResolve(_library && this === Wrapper ? $Promise : this, x);
}
});
_export(_export.S + _export.F * !(USE_NATIVE && _iterDetect(function (iter) {
$Promise.all(iter)['catch'](empty);
})), PROMISE, {
// 25.4.4.1 Promise.all(iterable)
all: function all(iterable) {
var C = this;
var capability = newPromiseCapability(C);
var resolve = capability.resolve;
var reject = capability.reject;
var result = _perform(function () {
var values = [];
var index = 0;
var remaining = 1;
_forOf(iterable, false, function (promise) {
var $index = index++;
var alreadyCalled = false;
values.push(undefined);
remaining++;
C.resolve(promise).then(function (value) {
if (alreadyCalled) return;
alreadyCalled = true;
values[$index] = value;
--remaining || resolve(values);
}, reject);
});
--remaining || resolve(values);
});
if (result.e) reject(result.v);
return capability.promise;
},
// 25.4.4.4 Promise.race(iterable)
race: function race(iterable) {
var C = this;
var capability = newPromiseCapability(C);
var reject = capability.reject;
var result = _perform(function () {
_forOf(iterable, false, function (promise) {
C.resolve(promise).then(capability.resolve, reject);
});
});
if (result.e) reject(result.v);
return capability.promise;
}
});
var f$6 = _wks;
var _wksExt = {
f: f$6
};
var defineProperty = _objectDp.f;
var _wksDefine = function (name) {
var $Symbol = _core.Symbol || (_core.Symbol = _library ? {} : _global.Symbol || {});
if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: _wksExt.f(name) });
};
// all enumerable object keys, includes symbols
var _enumKeys = function (it) {
var result = _objectKeys(it);
var getSymbols = _objectGops.f;
if (getSymbols) {
var symbols = getSymbols(it);
var isEnum = _objectPie.f;
var i = 0;
var key;
while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
} return result;
};
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var gOPN$1 = _objectGopn.f;
var toString$1 = {}.toString;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function (it) {
try {
return gOPN$1(it);
} catch (e) {
return windowNames.slice();
}
};
var f$7 = function getOwnPropertyNames(it) {
return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN$1(_toIobject(it));
};
var _objectGopnExt = {
f: f$7
};
'use strict';
// ECMAScript 6 symbols shim
var META = _meta.KEY;
var gOPD$3 = _objectGopd.f;
var dP$2 = _objectDp.f;
var gOPN = _objectGopnExt.f;
var $Symbol = _global.Symbol;
var $JSON = _global.JSON;
var _stringify = $JSON && $JSON.stringify;
var PROTOTYPE$2 = 'prototype';
var HIDDEN = _wks('_hidden');
var TO_PRIMITIVE = _wks('toPrimitive');
var isEnum = {}.propertyIsEnumerable;
var SymbolRegistry = _shared('symbol-registry');
var AllSymbols = _shared('symbols');
var OPSymbols = _shared('op-symbols');
var ObjectProto$1 = Object[PROTOTYPE$2];
var USE_NATIVE$1 = typeof $Symbol == 'function';
var QObject = _global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild;
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = _descriptors && _fails(function () {
return _objectCreate(dP$2({}, 'a', {
get: function () { return dP$2(this, 'a', { value: 7 }).a; }
})).a != 7;
}) ? function (it, key, D) {
var protoDesc = gOPD$3(ObjectProto$1, key);
if (protoDesc) delete ObjectProto$1[key];
dP$2(it, key, D);
if (protoDesc && it !== ObjectProto$1) dP$2(ObjectProto$1, key, protoDesc);
} : dP$2;
var wrap = function (tag) {
var sym = AllSymbols[tag] = _objectCreate($Symbol[PROTOTYPE$2]);
sym._k = tag;
return sym;
};
var isSymbol = USE_NATIVE$1 && typeof $Symbol.iterator == 'symbol' ? function (it) {
return typeof it == 'symbol';
} : function (it) {
return it instanceof $Symbol;
};
var $defineProperty$1 = function defineProperty(it, key, D) {
if (it === ObjectProto$1) $defineProperty$1(OPSymbols, key, D);
_anObject(it);
key = _toPrimitive(key, true);
_anObject(D);
if (_has(AllSymbols, key)) {
if (!D.enumerable) {
if (!_has(it, HIDDEN)) dP$2(it, HIDDEN, _propertyDesc(1, {}));
it[HIDDEN][key] = true;
} else {
if (_has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
D = _objectCreate(D, { enumerable: _propertyDesc(0, false) });
} return setSymbolDesc(it, key, D);
} return dP$2(it, key, D);
};
var $defineProperties = function defineProperties(it, P) {
_anObject(it);
var keys = _enumKeys(P = _toIobject(P));
var i = 0;
var l = keys.length;
var key;
while (l > i) $defineProperty$1(it, key = keys[i++], P[key]);
return it;
};
var $create = function create(it, P) {
return P === undefined ? _objectCreate(it) : $defineProperties(_objectCreate(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key) {
var E = isEnum.call(this, key = _toPrimitive(key, true));
if (this === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return false;
return E || !_has(this, key) || !_has(AllSymbols, key) || _has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
it = _toIobject(it);
key = _toPrimitive(key, true);
if (it === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return;
var D = gOPD$3(it, key);
if (D && _has(AllSymbols, key) && !(_has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it) {
var names = gOPN(_toIobject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (!_has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
} return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
var IS_OP = it === ObjectProto$1;
var names = gOPN(IS_OP ? OPSymbols : _toIobject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (_has(AllSymbols, key = names[i++]) && (IS_OP ? _has(ObjectProto$1, key) : true)) result.push(AllSymbols[key]);
} return result;
};
// 19.4.1.1 Symbol([description])
if (!USE_NATIVE$1) {
$Symbol = function Symbol() {
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
var tag = _uid(arguments.length > 0 ? arguments[0] : undefined);
var $set = function (value) {
if (this === ObjectProto$1) $set.call(OPSymbols, value);
if (_has(this, HIDDEN) && _has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
setSymbolDesc(this, tag, _propertyDesc(1, value));
};
if (_descriptors && setter) setSymbolDesc(ObjectProto$1, tag, { configurable: true, set: $set });
return wrap(tag);
};
_redefine($Symbol[PROTOTYPE$2], 'toString', function toString() {
return this._k;
});
_objectGopd.f = $getOwnPropertyDescriptor;
_objectDp.f = $defineProperty$1;
_objectGopn.f = _objectGopnExt.f = $getOwnPropertyNames;
_objectPie.f = $propertyIsEnumerable;
_objectGops.f = $getOwnPropertySymbols;
if (_descriptors && !_library) {
_redefine(ObjectProto$1, 'propertyIsEnumerable', $propertyIsEnumerable, true);
}
_wksExt.f = function (name) {
return wrap(_wks(name));
};
}
_export(_export.G + _export.W + _export.F * !USE_NATIVE$1, { Symbol: $Symbol });
for (var es6Symbols = (
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), j = 0; es6Symbols.length > j;)_wks(es6Symbols[j++]);
for (var wellKnownSymbols = _objectKeys(_wks.store), k = 0; wellKnownSymbols.length > k;) _wksDefine(wellKnownSymbols[k++]);
_export(_export.S + _export.F * !USE_NATIVE$1, 'Symbol', {
// 19.4.2.1 Symbol.for(key)
'for': function (key) {
return _has(SymbolRegistry, key += '')
? SymbolRegistry[key]
: SymbolRegistry[key] = $Symbol(key);
},
// 19.4.2.5 Symbol.keyFor(sym)
keyFor: function keyFor(sym) {
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
},
useSetter: function () { setter = true; },
useSimple: function () { setter = false; }
});
_export(_export.S + _export.F * !USE_NATIVE$1, 'Object', {
// 19.1.2.2 Object.create(O [, Properties])
create: $create,
// 19.1.2.4 Object.defineProperty(O, P, Attributes)
defineProperty: $defineProperty$1,
// 19.1.2.3 Object.defineProperties(O, Properties)
defineProperties: $defineProperties,
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
// 19.1.2.7 Object.getOwnPropertyNames(O)
getOwnPropertyNames: $getOwnPropertyNames,
// 19.1.2.8 Object.getOwnPropertySymbols(O)
getOwnPropertySymbols: $getOwnPropertySymbols
});
// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && _export(_export.S + _export.F * (!USE_NATIVE$1 || _fails(function () {
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it) {
var args = [it];
var i = 1;
var replacer, $replacer;
while (arguments.length > i) args.push(arguments[i++]);
$replacer = replacer = args[1];
if (!_isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
if (!_isArray(replacer)) replacer = function (key, value) {
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
if (!isSymbol(value)) return value;
};
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE$2][TO_PRIMITIVE] || _hide($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
_setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
_setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
_setToStringTag(_global.JSON, 'JSON', true);
// most Object methods by ES6 should accept primitives
var _objectSap = function (KEY, exec) {
var fn = (_core.Object || {})[KEY] || Object[KEY];
var exp = {};
exp[KEY] = exec(fn);
_export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
};
// 19.1.2.5 Object.freeze(O)
var meta = _meta.onFreeze;
_objectSap('freeze', function ($freeze) {
return function freeze(it) {
return $freeze && _isObject(it) ? $freeze(meta(it)) : it;
};
});
// 19.1.2.17 Object.seal(O)
var meta$1 = _meta.onFreeze;
_objectSap('seal', function ($seal) {
return function seal(it) {
return $seal && _isObject(it) ? $seal(meta$1(it)) : it;
};
});
// 19.1.2.15 Object.preventExtensions(O)
var meta$2 = _meta.onFreeze;
_objectSap('preventExtensions', function ($preventExtensions) {
return function preventExtensions(it) {
return $preventExtensions && _isObject(it) ? $preventExtensions(meta$2(it)) : it;
};
});
// 19.1.2.12 Object.isFrozen(O)
_objectSap('isFrozen', function ($isFrozen) {
return function isFrozen(it) {
return _isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
};
});
// 19.1.2.13 Object.isSealed(O)
_objectSap('isSealed', function ($isSealed) {
return function isSealed(it) {
return _isObject(it) ? $isSealed ? $isSealed(it) : false : true;
};
});
// 19.1.2.11 Object.isExtensible(O)
_objectSap('isExtensible', function ($isExtensible) {
return function isExtensible(it) {
return _isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
};
});
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
var $getOwnPropertyDescriptor$1 = _objectGopd.f;
_objectSap('getOwnPropertyDescriptor', function () {
return function getOwnPropertyDescriptor(it, key) {
return $getOwnPropertyDescriptor$1(_toIobject(it), key);
};
});
// 19.1.2.9 Object.getPrototypeOf(O)
_objectSap('getPrototypeOf', function () {
return function getPrototypeOf(it) {
return _objectGpo(_toObject(it));
};
});
// 19.1.2.14 Object.keys(O)
_objectSap('keys', function () {
return function keys(it) {
return _objectKeys(_toObject(it));
};
});
// 19.1.2.7 Object.getOwnPropertyNames(O)
_objectSap('getOwnPropertyNames', function () {
return _objectGopnExt.f;
});
// 19.1.3.1 Object.assign(target, source)
_export(_export.S + _export.F, 'Object', { assign: _objectAssign });
// 7.2.9 SameValue(x, y)
var _sameValue = Object.is || function is(x, y) {
// eslint-disable-next-line no-self-compare
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
};
// 19.1.3.10 Object.is(value1, value2)
_export(_export.S, 'Object', { is: _sameValue });
var dP$3 = _objectDp.f;
var FProto = Function.prototype;
var nameRE = /^\s*function ([^ (]*)/;
var NAME = 'name';
// 19.2.4.2 name
NAME in FProto || _descriptors && dP$3(FProto, NAME, {
configurable: true,
get: function () {
try {
return ('' + this).match(nameRE)[1];
} catch (e) {
return '';
}
}
});
_export(_export.S, 'String', {
// 21.1.2.4 String.raw(callSite, ...substitutions)
raw: function raw(callSite) {
var tpl = _toIobject(callSite.raw);
var len = _toLength(tpl.length);
var aLen = arguments.length;
var res = [];
var i = 0;
while (len > i) {
res.push(String(tpl[i++]));
if (i < aLen) res.push(String(arguments[i]));
} return res.join('');
}
});
var fromCharCode = String.fromCharCode;
var $fromCodePoint = String.fromCodePoint;
// length should be 1, old FF problem
_export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
// 21.1.2.2 String.fromCodePoint(...codePoints)
fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
var res = [];
var aLen = arguments.length;
var i = 0;
var code;
while (aLen > i) {
code = +arguments[i++];
if (_toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
res.push(code < 0x10000
? fromCharCode(code)
: fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
);
} return res.join('');
}
});
// true -> String#at
// false -> String#codePointAt
var _stringAt = function (TO_STRING) {
return function (that, pos) {
var s = String(_defined(that));
var i = _toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
'use strict';
var $at = _stringAt(false);
_export(_export.P, 'String', {
// 21.1.3.3 String.prototype.codePointAt(pos)
codePointAt: function codePointAt(pos) {
return $at(this, pos);
}
});
'use strict';
var _stringRepeat = function repeat(count) {
var str = String(_defined(this));
var res = '';
var n = _toInteger(count);
if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
return res;
};
_export(_export.P, 'String', {
// 21.1.3.13 String.prototype.repeat(count)
repeat: _stringRepeat
});
// 7.2.8 IsRegExp(argument)
var MATCH = _wks('match');
var _isRegexp = function (it) {
var isRegExp;
return _isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : _cof(it) == 'RegExp');
};
// helper for String#{startsWith, endsWith, includes}
var _stringContext = function (that, searchString, NAME) {
if (_isRegexp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
return String(_defined(that));
};
var MATCH$1 = _wks('match');
var _failsIsRegexp = function (KEY) {
var re = /./;
try {
'/./'[KEY](re);
} catch (e) {
try {
re[MATCH$1] = false;
return !'/./'[KEY](re);
} catch (f) { /* empty */ }
} return true;
};
// 21.1.3.18 String.prototype.startsWith(searchString [, position ])
'use strict';
var STARTS_WITH = 'startsWith';
var $startsWith = ''[STARTS_WITH];
_export(_export.P + _export.F * _failsIsRegexp(STARTS_WITH), 'String', {
startsWith: function startsWith(searchString /* , position = 0 */) {
var that = _stringContext(this, searchString, STARTS_WITH);
var index = _toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
var search = String(searchString);
return $startsWith
? $startsWith.call(that, search, index)
: that.slice(index, index + search.length) === search;
}
});
// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
'use strict';
var ENDS_WITH = 'endsWith';
var $endsWith = ''[ENDS_WITH];
_export(_export.P + _export.F * _failsIsRegexp(ENDS_WITH), 'String', {
endsWith: function endsWith(searchString /* , endPosition = @length */) {
var that = _stringContext(this, searchString, ENDS_WITH);
var endPosition = arguments.length > 1 ? arguments[1] : undefined;
var len = _toLength(that.length);
var end = endPosition === undefined ? len : Math.min(_toLength(endPosition), len);
var search = String(searchString);
return $endsWith
? $endsWith.call(that, search, end)
: that.slice(end - search.length, end) === search;
}
});
// 21.1.3.7 String.prototype.includes(searchString, position = 0)
'use strict';
var INCLUDES = 'includes';
_export(_export.P + _export.F * _failsIsRegexp(INCLUDES), 'String', {
includes: function includes(searchString /* , position = 0 */) {
return !!~_stringContext(this, searchString, INCLUDES)
.indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
}
});
'use strict';
// 21.2.5.3 get RegExp.prototype.flags
var _flags = function () {
var that = _anObject(this);
var result = '';
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
if (that.unicode) result += 'u';
if (that.sticky) result += 'y';
return result;
};
// 21.2.5.3 get RegExp.prototype.flags()
if (_descriptors && /./g.flags != 'g') _objectDp.f(RegExp.prototype, 'flags', {
configurable: true,
get: _flags
});
'use strict';
var _fixReWks = function (KEY, length, exec) {
var SYMBOL = _wks(KEY);
var fns = exec(_defined, SYMBOL, ''[KEY]);
var strfn = fns[0];
var rxfn = fns[1];
if (_fails(function () {
var O = {};
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) != 7;
})) {
_redefine(String.prototype, KEY, strfn);
_hide(RegExp.prototype, SYMBOL, length == 2
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
? function (string, arg) { return rxfn.call(string, this, arg); }
// 21.2.5.6 RegExp.prototype[@@match](string)
// 21.2.5.9 RegExp.prototype[@@search](string)
: function (string) { return rxfn.call(string, this); }
);
}
};
// @@match logic
_fixReWks('match', 1, function (defined, MATCH, $match) {
// 21.1.3.11 String.prototype.match(regexp)
return [function match(regexp) {
'use strict';
var O = defined(this);
var fn = regexp == undefined ? undefined : regexp[MATCH];
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
}, $match];
});
// @@replace logic
_fixReWks('replace', 2, function (defined, REPLACE, $replace) {
// 21.1.3.14 String.prototype.replace(searchValue, replaceValue)
return [function replace(searchValue, replaceValue) {
'use strict';
var O = defined(this);
var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
return fn !== undefined
? fn.call(searchValue, O, replaceValue)
: $replace.call(String(O), searchValue, replaceValue);
}, $replace];
});
// @@split logic
_fixReWks('split', 2, function (defined, SPLIT, $split) {
'use strict';
var isRegExp = _isRegexp;
var _split = $split;
var $push = [].push;
var $SPLIT = 'split';
var LENGTH = 'length';
var LAST_INDEX = 'lastIndex';
if (
'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
'.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
'.'[$SPLIT](/()()/)[LENGTH] > 1 ||
''[$SPLIT](/.?/)[LENGTH]
) {
var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group
// based on es5-shim implementation, need to rework it
$split = function (separator, limit) {
var string = String(this);
if (separator === undefined && limit === 0) return [];
// If `separator` is not a regex, use native split
if (!isRegExp(separator)) return _split.call(string, separator, limit);
var output = [];
var flags = (separator.ignoreCase ? 'i' : '') +
(separator.multiline ? 'm' : '') +
(separator.unicode ? 'u' : '') +
(separator.sticky ? 'y' : '');
var lastLastIndex = 0;
var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
// Make `global` and avoid `lastIndex` issues by working with a copy
var separatorCopy = new RegExp(separator.source, flags + 'g');
var separator2, match, lastIndex, lastLength, i;
// Doesn't need flags gy, but they don't hurt
if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
while (match = separatorCopy.exec(string)) {
// `separatorCopy.lastIndex` is not reliable cross-browser
lastIndex = match.index + match[0][LENGTH];
if (lastIndex > lastLastIndex) {
output.push(string.slice(lastLastIndex, match.index));
// Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG
// eslint-disable-next-line no-loop-func
if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {
for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;
});
if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
lastLength = match[0][LENGTH];
lastLastIndex = lastIndex;
if (output[LENGTH] >= splitLimit) break;
}
if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
}
if (lastLastIndex === string[LENGTH]) {
if (lastLength || !separatorCopy.test('')) output.push('');
} else output.push(string.slice(lastLastIndex));
return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
};
// Chakra, V8
} else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
$split = function (separator, limit) {
return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);
};
}
// 21.1.3.17 String.prototype.split(separator, limit)
return [function split(separator, limit) {
var O = defined(this);
var fn = separator == undefined ? undefined : separator[SPLIT];
return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);
}, $split];
});
// @@search logic
_fixReWks('search', 1, function (defined, SEARCH, $search) {
// 21.1.3.15 String.prototype.search(regexp)
return [function search(regexp) {
'use strict';
var O = defined(this);
var fn = regexp == undefined ? undefined : regexp[SEARCH];
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
}, $search];
});
'use strict';
var _createProperty = function (object, index, value) {
if (index in object) _objectDp.f(object, index, _propertyDesc(0, value));
else object[index] = value;
};
'use strict';
_export(_export.S + _export.F * !_iterDetect(function (iter) { }), 'Array', {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = _toObject(arrayLike);
var C = typeof this == 'function' ? this : Array;
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var index = 0;
var iterFn = core_getIteratorMethod(O);
var length, result, step, iterator;
if (mapping) mapfn = _ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
// if object isn't iterable or it's array with default iterator - use simple case
if (iterFn != undefined && !(C == Array && _isArrayIter(iterFn))) {
for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
_createProperty(result, index, mapping ? _iterCall(iterator, mapfn, [step.value, index], true) : step.value);
}
} else {
length = _toLength(O.length);
for (result = new C(length); length > index; index++) {
_createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
}
}
result.length = index;
return result;
}
});
'use strict';
// WebKit Array.of isn't generic
_export(_export.S + _export.F * _fails(function () {
function F() { /* empty */ }
return !(Array.of.call(F) instanceof F);
}), 'Array', {
// 22.1.2.3 Array.of( ...items)
of: function of(/* ...args */) {
var index = 0;
var aLen = arguments.length;
var result = new (typeof this == 'function' ? this : Array)(aLen);
while (aLen > index) _createProperty(result, index, arguments[index++]);
result.length = aLen;
return result;
}
});
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
_export(_export.P, 'Array', { copyWithin: _arrayCopyWithin });
_addToUnscopables('copyWithin');
'use strict';
// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
var $find = _arrayMethods(5);
var KEY = 'find';
var forced = true;
// Shouldn't skip holes
if (KEY in []) Array(1)[KEY](function () { forced = false; });
_export(_export.P + _export.F * forced, 'Array', {
find: function find(callbackfn /* , that = undefined */) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
_addToUnscopables(KEY);
'use strict';
// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
var $find$1 = _arrayMethods(6);
var KEY$1 = 'findIndex';
var forced$1 = true;
// Shouldn't skip holes
if (KEY$1 in []) Array(1)[KEY$1](function () { forced$1 = false; });
_export(_export.P + _export.F * forced$1, 'Array', {
findIndex: function findIndex(callbackfn /* , that = undefined */) {
return $find$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
_addToUnscopables(KEY$1);
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
_export(_export.P, 'Array', { fill: _arrayFill });
_addToUnscopables('fill');
// 20.1.2.2 Number.isFinite(number)
var _isFinite = _global.isFinite;
_export(_export.S, 'Number', {
isFinite: function isFinite(it) {
return typeof it == 'number' && _isFinite(it);
}
});
// 20.1.2.3 Number.isInteger(number)
var floor$1 = Math.floor;
var _isInteger = function isInteger(it) {
return !_isObject(it) && isFinite(it) && floor$1(it) === it;
};
// 20.1.2.3 Number.isInteger(number)
_export(_export.S, 'Number', { isInteger: _isInteger });
// 20.1.2.5 Number.isSafeInteger(number)
var abs = Math.abs;
_export(_export.S, 'Number', {
isSafeInteger: function isSafeInteger(number) {
return _isInteger(number) && abs(number) <= 0x1fffffffffffff;
}
});
// 20.1.2.4 Number.isNaN(number)
_export(_export.S, 'Number', {
isNaN: function isNaN(number) {
// eslint-disable-next-line no-self-compare
return number != number;
}
});
// 20.1.2.1 Number.EPSILON
_export(_export.S, 'Number', { EPSILON: Math.pow(2, -52) });
// 20.1.2.10 Number.MIN_SAFE_INTEGER
_export(_export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
// 20.1.2.6 Number.MAX_SAFE_INTEGER
_export(_export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
// 20.2.2.20 Math.log1p(x)
var _mathLog1p = Math.log1p || function log1p(x) {
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
};
// 20.2.2.3 Math.acosh(x)
var sqrt = Math.sqrt;
var $acosh = Math.acosh;
_export(_export.S + _export.F * !($acosh
// V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
&& Math.floor($acosh(Number.MAX_VALUE)) == 710
// Tor Browser bug: Math.acosh(Infinity) -> NaN
&& $acosh(Infinity) == Infinity
), 'Math', {
acosh: function acosh(x) {
return (x = +x) < 1 ? NaN : x > 94906265.62425156
? Math.log(x) + Math.LN2
: _mathLog1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
}
});
// 20.2.2.5 Math.asinh(x)
var $asinh = Math.asinh;
function asinh(x) {
return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
}
// Tor Browser bug: Math.asinh(0) -> -0
_export(_export.S + _export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });
// 20.2.2.7 Math.atanh(x)
var $atanh = Math.atanh;
// Tor Browser bug: Math.atanh(-0) -> 0
_export(_export.S + _export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
atanh: function atanh(x) {
return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
}
});
// 20.2.2.28 Math.sign(x)
var _mathSign = Math.sign || function sign(x) {
// eslint-disable-next-line no-self-compare
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
};
// 20.2.2.9 Math.cbrt(x)
_export(_export.S, 'Math', {
cbrt: function cbrt(x) {
return _mathSign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
}
});
// 20.2.2.11 Math.clz32(x)
_export(_export.S, 'Math', {
clz32: function clz32(x) {
return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
}
});
// 20.2.2.12 Math.cosh(x)
var exp = Math.exp;
_export(_export.S, 'Math', {
cosh: function cosh(x) {
return (exp(x = +x) + exp(-x)) / 2;
}
});
// 20.2.2.14 Math.expm1(x)
var $expm1 = Math.expm1;
var _mathExpm1 = (!$expm1
// Old FF bug
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
// Tor Browser bug
|| $expm1(-2e-17) != -2e-17
) ? function expm1(x) {
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
} : $expm1;
// 20.2.2.14 Math.expm1(x)
_export(_export.S + _export.F * (_mathExpm1 != Math.expm1), 'Math', { expm1: _mathExpm1 });
// 20.2.2.16 Math.fround(x)
var pow = Math.pow;
var EPSILON = pow(2, -52);
var EPSILON32 = pow(2, -23);
var MAX32 = pow(2, 127) * (2 - EPSILON32);
var MIN32 = pow(2, -126);
var roundTiesToEven = function (n) {
return n + 1 / EPSILON - 1 / EPSILON;
};
var _mathFround = Math.fround || function fround(x) {
var $abs = Math.abs(x);
var $sign = _mathSign(x);
var a, result;
if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
a = (1 + EPSILON32 / EPSILON) * $abs;
result = a - (a - $abs);
// eslint-disable-next-line no-self-compare
if (result > MAX32 || result != result) return $sign * Infinity;
return $sign * result;
};
// 20.2.2.16 Math.fround(x)
_export(_export.S, 'Math', { fround: _mathFround });
// 20.2.2.17 Math.hypot([value1[, value2[, โฆ ]]])
var abs$1 = Math.abs;
_export(_export.S, 'Math', {
hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
var sum = 0;
var i = 0;
var aLen = arguments.length;
var larg = 0;
var arg, div;
while (i < aLen) {
arg = abs$1(arguments[i++]);
if (larg < arg) {
div = larg / arg;
sum = sum * div * div + 1;
larg = arg;
} else if (arg > 0) {
div = arg / larg;
sum += div * div;
} else sum += arg;
}
return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
}
});
// 20.2.2.18 Math.imul(x, y)
var $imul = Math.imul;
// some WebKit versions fails with big numbers, some has wrong arity
_export(_export.S + _export.F * _fails(function () {
return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
}), 'Math', {
imul: function imul(x, y) {
var UINT16 = 0xffff;
var xn = +x;
var yn = +y;
var xl = UINT16 & xn;
var yl = UINT16 & yn;
return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
}
});
// 20.2.2.20 Math.log1p(x)
_export(_export.S, 'Math', { log1p: _mathLog1p });
// 20.2.2.21 Math.log10(x)
_export(_export.S, 'Math', {
log10: function log10(x) {
return Math.log(x) * Math.LOG10E;
}
});
// 20.2.2.22 Math.log2(x)
_export(_export.S, 'Math', {
log2: function log2(x) {
return Math.log(x) / Math.LN2;
}
});
// 20.2.2.28 Math.sign(x)
_export(_export.S, 'Math', { sign: _mathSign });
// 20.2.2.30 Math.sinh(x)
var exp$1 = Math.exp;
// V8 near Chromium 38 has a problem with very small numbers
_export(_export.S + _export.F * _fails(function () {
return !Math.sinh(-2e-17) != -2e-17;
}), 'Math', {
sinh: function sinh(x) {
return Math.abs(x = +x) < 1
? (_mathExpm1(x) - _mathExpm1(-x)) / 2
: (exp$1(x - 1) - exp$1(-x - 1)) * (Math.E / 2);
}
});
// 20.2.2.33 Math.tanh(x)
var exp$2 = Math.exp;
_export(_export.S, 'Math', {
tanh: function tanh(x) {
var a = _mathExpm1(x = +x);
var b = _mathExpm1(-x);
return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp$2(x) + exp$2(-x));
}
});
// 20.2.2.34 Math.trunc(x)
_export(_export.S, 'Math', {
trunc: function trunc(it) {
return (it > 0 ? Math.floor : Math.ceil)(it);
}
});
'use strict';
// https://github.com/tc39/Array.prototype.includes
var $includes = _arrayIncludes(true);
_export(_export.P, 'Array', {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
_addToUnscopables('includes');
var isEnum$1 = _objectPie.f;
var _objectToArray = function (isEntries) {
return function (it) {
var O = _toIobject(it);
var keys = _objectKeys(O);
var length = keys.length;
var i = 0;
var result = [];
var key;
while (length > i) if (isEnum$1.call(O, key = keys[i++])) {
result.push(isEntries ? [key, O[key]] : O[key]);
} return result;
};
};
// https://github.com/tc39/proposal-object-values-entries
var $values = _objectToArray(false);
_export(_export.S, 'Object', {
values: function values(it) {
return $values(it);
}
});
// https://github.com/tc39/proposal-object-values-entries
var $entries = _objectToArray(true);
_export(_export.S, 'Object', {
entries: function entries(it) {
return $entries(it);
}
});
// https://github.com/tc39/proposal-object-getownpropertydescriptors
_export(_export.S, 'Object', {
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
var O = _toIobject(object);
var getDesc = _objectGopd.f;
var keys = _ownKeys(O);
var result = {};
var i = 0;
var key, desc;
while (keys.length > i) {
desc = getDesc(O, key = keys[i++]);
if (desc !== undefined) _createProperty(result, key, desc);
}
return result;
}
});
// https://github.com/tc39/proposal-string-pad-start-end
var _stringPad = function (that, maxLength, fillString, left) {
var S = String(_defined(that));
var stringLength = S.length;
var fillStr = fillString === undefined ? ' ' : String(fillString);
var intMaxLength = _toLength(maxLength);
if (intMaxLength <= stringLength || fillStr == '') return S;
var fillLen = intMaxLength - stringLength;
var stringFiller = _stringRepeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
return left ? stringFiller + S : S + stringFiller;
};
var navigator$1 = _global.navigator;
var _userAgent = navigator$1 && navigator$1.userAgent || '';
'use strict';
// https://github.com/tc39/proposal-string-pad-start-end
// https://github.com/zloirock/core-js/issues/280
_export(_export.P + _export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(_userAgent), 'String', {
padStart: function padStart(maxLength /* , fillString = ' ' */) {
return _stringPad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
}
});
'use strict';
// https://github.com/tc39/proposal-string-pad-start-end
// https://github.com/zloirock/core-js/issues/280
_export(_export.P + _export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(_userAgent), 'String', {
padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
return _stringPad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
}
});
// ie9- setTimeout & setInterval additional parameters fix
var slice = [].slice;
var MSIE = /MSIE .\./.test(_userAgent); // <- dirty ie9- check
var wrap$1 = function (set) {
return function (fn, time /* , ...args */) {
var boundArgs = arguments.length > 2;
var args = boundArgs ? slice.call(arguments, 2) : false;
return set(boundArgs ? function () {
// eslint-disable-next-line no-new-func
(typeof fn == 'function' ? fn : Function(fn)).apply(this, args);
} : fn, time);
};
};
_export(_export.G + _export.B + _export.F * MSIE, {
setTimeout: wrap$1(_global.setTimeout),
setInterval: wrap$1(_global.setInterval)
});
_export(_export.G + _export.B, {
setImmediate: _task.set,
clearImmediate: _task.clear
});
var ITERATOR$4 = _wks('iterator');
var TO_STRING_TAG = _wks('toStringTag');
var ArrayValues = _iterators.Array;
var DOMIterables = {
CSSRuleList: true, // TODO: Not spec compliant, should be false.
CSSStyleDeclaration: false,
CSSValueList: false,
ClientRectList: false,
DOMRectList: false,
DOMStringList: false,
DOMTokenList: true,
DataTransferItemList: false,
FileList: false,
HTMLAllCollection: false,
HTMLCollection: false,
HTMLFormElement: false,
HTMLSelectElement: false,
MediaList: true, // TODO: Not spec compliant, should be false.
MimeTypeArray: false,
NamedNodeMap: false,
NodeList: true,
PaintRequestList: false,
Plugin: false,
PluginArray: false,
SVGLengthList: false,
SVGNumberList: false,
SVGPathSegList: false,
SVGPointList: false,
SVGStringList: false,
SVGTransformList: false,
SourceBufferList: false,
StyleSheetList: true, // TODO: Not spec compliant, should be false.
TextTrackCueList: false,
TextTrackList: false,
TouchList: false
};
for (var collections = _objectKeys(DOMIterables), i$1 = 0; i$1 < collections.length; i$1++) {
var NAME$1 = collections[i$1];
var explicit = DOMIterables[NAME$1];
var Collection = _global[NAME$1];
var proto = Collection && Collection.prototype;
var key;
if (proto) {
if (!proto[ITERATOR$4]) _hide(proto, ITERATOR$4, ArrayValues);
if (!proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME$1);
_iterators[NAME$1] = ArrayValues;
if (explicit) for (key in es6_array_iterator) if (!proto[key]) _redefine(proto, key, es6_array_iterator[key], true);
}
}
var runtime = createCommonjsModule(function (module) {
/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* https://raw.github.com/facebook/regenerator/master/LICENSE file. An
* additional grant of patent rights can be found in the PATENTS file in
* the same directory.
*/
!(function(global) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
var inModule = 'object' === "object";
var runtime = global.regeneratorRuntime;
if (runtime) {
if (inModule) {
// If regeneratorRuntime is defined globally and we're in a module,
// make the exports object identical to regeneratorRuntime.
module.exports = runtime;
}
// Don't bother evaluating the rest of this file if the runtime was
// already defined globally.
return;
}
// Define the runtime globally (as expected by generated code) as either
// module.exports (if we're in a module) or a new, empty object.
runtime = global.regeneratorRuntime = inModule ? module.exports : {};
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
runtime.wrap = wrap;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return { type: "normal", arg: fn.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype &&
NativeIteratorPrototype !== Op &&
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype =
Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] =
GeneratorFunction.displayName = "GeneratorFunction";
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
prototype[method] = function(arg) {
return this._invoke(method, arg);
};
});
}
runtime.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction"
: false;
};
runtime.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}
genFun.prototype = Object.create(Gp);
return genFun;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
runtime.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return Promise.resolve(value.__await).then(function(value) {
invoke("next", value, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return Promise.resolve(value).then(function(unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration. If the Promise is rejected, however, the
// result for this iteration will be rejected with the same
// reason. Note that rejections of yielded Promises are not
// thrown back into the generator function, as is the case
// when an awaited Promise is rejected. This difference in
// behavior between yield and await is important, because it
// allows the consumer to decide what to do with the yielded
// rejection (swallow it and continue, manually .throw it back
// into the generator, abandon iteration, whatever). With
// await, by contrast, there is no opportunity to examine the
// rejection reason outside the generator function, so the
// only option is to throw it from the await expression, and
// let the generator function handle the exception.
result.value = unwrapped;
resolve(result);
}, reject);
}
}
if (typeof global.process === "object" && global.process.domain) {
invoke = global.process.domain.bind(invoke);
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new Promise(function(resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise =
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
runtime.AsyncIterator = AsyncIterator;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
runtime.async = function(innerFn, outerFn, self, tryLocsList) {
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList)
);
return runtime.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done
? GenStateCompleted
: GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
// Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
}
// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
if (delegate.iterator.return) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (! info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value;
// Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc;
// If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
}
// The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator";
// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function() {
return this;
};
Gp.toString = function() {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
runtime.keys = function(object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1, next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return next.next = next;
}
}
// Return an iterator with no values.
return { next: doneResult };
}
runtime.values = values;
function doneResult() {
return { value: undefined, done: true };
}
Context.prototype = {
constructor: Context,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" &&
hasOwn.call(this, name) &&
!isNaN(+name.slice(1))) {
this[name] = undefined;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined;
}
return !! caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev &&
hasOwn.call(entry, "finallyLoc") &&
this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry &&
(type === "break" ||
type === "continue") &&
finallyEntry.tryLoc <= arg &&
arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" ||
record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined;
}
return ContinueSentinel;
}
};
})(
// Among the various tricks for obtaining a reference to the global
// object, this seems to be the most reliable technique that does not
// use indirect eval (which violates Content Security Policy).
typeof commonjsGlobal === "object" ? commonjsGlobal :
typeof window === "object" ? window :
typeof self === "object" ? self : commonjsGlobal
);
});
// Polyfill for creating CustomEvents on IE9/10/11
// code pulled from:
// https://github.com/d4tocchini/customevent-polyfill
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill
try {
var ce = new window.CustomEvent('test');
ce.preventDefault();
if (ce.defaultPrevented !== true) {
// IE has problems with .preventDefault() on custom events
// http://stackoverflow.com/questions/23349191
throw new Error('Could not prevent default');
}
} catch(e) {
var CustomEvent$1 = function(event, params) {
var evt, origPrevent;
params = params || {
bubbles: false,
cancelable: false,
detail: undefined
};
evt = document.createEvent("CustomEvent");
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
origPrevent = evt.preventDefault;
evt.preventDefault = function () {
origPrevent.call(this);
try {
Object.defineProperty(this, 'defaultPrevented', {
get: function () {
return true;
}
});
} catch(e) {
this.defaultPrevented = true;
}
};
return evt;
};
CustomEvent$1.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent$1; // expose definition to window
}
// ==========================================================================
// Plyr supported types and providers
// ==========================================================================
var providers = {
html5: 'html5',
youtube: 'youtube',
vimeo: 'vimeo'
};
var types = {
audio: 'audio',
video: 'video'
};
// ==========================================================================
// Plyr default config
// ==========================================================================
var defaults = {
// Disable
enabled: true,
// Custom media title
title: '',
// Logging to console
debug: false,
// Auto play (if supported)
autoplay: false,
// Only allow one media playing at once (vimeo only)
autopause: true,
// Default time to skip when rewind/fast forward
seekTime: 10,
// Default volume
volume: 1,
muted: false,
// Pass a custom duration
duration: null,
// Display the media duration on load in the current time position
// If you have opted to display both duration and currentTime, this is ignored
displayDuration: true,
// Invert the current time to be a countdown
invertTime: true,
// Clicking the currentTime inverts it's value to show time left rather than elapsed
toggleInvert: true,
// Aspect ratio (for embeds)
ratio: '16:9',
// Click video container to play/pause
clickToPlay: true,
// Auto hide the controls
hideControls: true,
// Revert to poster on finish (HTML5 - will cause reload)
showPosterOnEnd: false,
// Disable the standard context menu
disableContextMenu: true,
// Sprite (for icons)
loadSprite: true,
iconPrefix: 'plyr',
iconUrl: 'https://cdn.plyr.io/3.0.0-beta.17/plyr.svg',
// Blank video (used to prevent errors on source change)
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
// Quality default
quality: {
default: 'default',
options: ['hd2160', 'hd1440', 'hd1080', 'hd720', 'large', 'medium', 'small', 'tiny', 'default']
},
// Set loops
loop: {
active: false
// start: null,
// end: null,
},
// Speed default and options to display
speed: {
selected: 1,
options: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]
},
// Keyboard shortcut settings
keyboard: {
focused: true,
global: false
},
// Display tooltips
tooltips: {
controls: false,
seek: true
},
// Captions settings
captions: {
active: false,
language: window.navigator.language.split('-')[0]
},
// Fullscreen settings
fullscreen: {
enabled: true, // Allow fullscreen?
fallback: true, // Fallback for vintage browsers
iosNative: false // Use the native fullscreen in iOS (disables custom controls)
},
// Local storage
storage: {
enabled: true,
key: 'plyr'
},
// Default controls
controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'settings', 'pip', 'airplay', 'fullscreen'],
settings: ['captions', 'quality', 'speed'],
// Localisation
i18n: {
restart: 'Restart',
rewind: 'Rewind {seektime} secs',
play: 'Play',
pause: 'Pause',
forward: 'Forward {seektime} secs',
seek: 'Seek',
played: 'Played',
buffered: 'Buffered',
currentTime: 'Current time',
duration: 'Duration',
volume: 'Volume',
mute: 'Mute',
unmute: 'Unmute',
enableCaptions: 'Enable captions',
disableCaptions: 'Disable captions',
enterFullscreen: 'Enter fullscreen',
exitFullscreen: 'Exit fullscreen',
frameTitle: 'Player for {title}',
captions: 'Captions',
settings: 'Settings',
speed: 'Speed',
quality: 'Quality',
loop: 'Loop',
start: 'Start',
end: 'End',
all: 'All',
reset: 'Reset',
none: 'None',
disabled: 'Disabled',
advertisement: 'Ad'
},
// URLs
urls: {
vimeo: {
api: 'https://player.vimeo.com/api/player.js'
},
youtube: {
api: 'https://www.youtube.com/iframe_api'
},
googleIMA: {
api: 'https://imasdk.googleapis.com/js/sdkloader/ima3.js'
}
},
// Custom control listeners
listeners: {
seek: null,
play: null,
pause: null,
restart: null,
rewind: null,
forward: null,
mute: null,
volume: null,
captions: null,
fullscreen: null,
pip: null,
airplay: null,
speed: null,
quality: null,
loop: null,
language: null
},
// Events to watch and bubble
events: [
// Events to watch on HTML5 media elements and bubble
// https://developer.mozilla.org/en/docs/Web/Guide/Events/Media_events
'ended', 'progress', 'stalled', 'playing', 'waiting', 'canplay', 'canplaythrough', 'loadstart', 'loadeddata', 'loadedmetadata', 'timeupdate', 'volumechange', 'play', 'pause', 'error', 'seeking', 'seeked', 'emptied', 'ratechange', 'cuechange',
// Custom events
'enterfullscreen', 'exitfullscreen', 'captionsenabled', 'captionsdisabled', 'languagechange', 'controlshidden', 'controlsshown', 'ready',
// YouTube
'statechange', 'qualitychange', 'qualityrequested',
// Ads
'adsloaded', 'adscontentpause', 'adsconentresume', 'adstarted', 'adsmidpoint', 'adscomplete', 'adsallcomplete', 'adsimpression', 'adsclick'],
// Selectors
// Change these to match your template if using custom HTML
selectors: {
editable: 'input, textarea, select, [contenteditable]',
container: '.plyr',
controls: {
container: null,
wrapper: '.plyr__controls'
},
labels: '[data-plyr]',
buttons: {
play: '[data-plyr="play"]',
pause: '[data-plyr="pause"]',
restart: '[data-plyr="restart"]',
rewind: '[data-plyr="rewind"]',
forward: '[data-plyr="fast-forward"]',
mute: '[data-plyr="mute"]',
captions: '[data-plyr="captions"]',
fullscreen: '[data-plyr="fullscreen"]',
pip: '[data-plyr="pip"]',
airplay: '[data-plyr="airplay"]',
settings: '[data-plyr="settings"]',
loop: '[data-plyr="loop"]'
},
inputs: {
seek: '[data-plyr="seek"]',
volume: '[data-plyr="volume"]',
speed: '[data-plyr="speed"]',
language: '[data-plyr="language"]',
quality: '[data-plyr="quality"]'
},
display: {
currentTime: '.plyr__time--current',
duration: '.plyr__time--duration',
buffer: '.plyr__progress--buffer',
played: '.plyr__progress--played',
loop: '.plyr__progress--loop',
volume: '.plyr__volume--display'
},
progress: '.plyr__progress',
captions: '.plyr__captions',
menu: {
quality: '.js-plyr__menu__list--quality'
}
},
// Class hooks added to the player in different states
classNames: {
video: 'plyr__video-wrapper',
embed: 'plyr__video-embed',
ads: 'plyr__ads',
control: 'plyr__control',
type: 'plyr--{0}',
provider: 'plyr--{0}',
stopped: 'plyr--stopped',
playing: 'plyr--playing',
loading: 'plyr--loading',
error: 'plyr--has-error',
hover: 'plyr--hover',
tooltip: 'plyr__tooltip',
cues: 'plyr__cues',
hidden: 'plyr__sr-only',
hideControls: 'plyr--hide-controls',
isIos: 'plyr--is-ios',
isTouch: 'plyr--is-touch',
uiSupported: 'plyr--full-ui',
noTransition: 'plyr--no-transition',
menu: {
value: 'plyr__menu__value',
badge: 'plyr__badge',
open: 'plyr--menu-open'
},
captions: {
enabled: 'plyr--captions-enabled',
active: 'plyr--captions-active'
},
fullscreen: {
enabled: 'plyr--fullscreen-enabled',
fallback: 'plyr--fullscreen-fallback'
},
pip: {
supported: 'plyr--pip-supported',
active: 'plyr--pip-active'
},
airplay: {
supported: 'plyr--airplay-supported',
active: 'plyr--airplay-active'
},
tabFocus: 'plyr__tab-focus'
},
// Embed attributes
attributes: {
embed: {
provider: 'data-plyr-provider',
id: 'data-plyr-embed-id'
}
},
// API keys
keys: {
google: null
},
// Advertisements plugin
// Tag is not required as publisher is determined by vi.ai using the domain
ads: {
enabled: false
}
};
var asyncGenerator = function () {
function AwaitValue(value) {
this.value = value;
}
function AsyncGenerator(gen) {
var front, back;
function send(key, arg) {
return new Promise(function (resolve, reject) {
var request = {
key: key,
arg: arg,
resolve: resolve,
reject: reject,
next: null
};
if (back) {
back = back.next = request;
} else {
front = back = request;
resume(key, arg);
}
});
}
function resume(key, arg) {
try {
var result = gen[key](arg);
var value = result.value;
if (value instanceof AwaitValue) {
Promise.resolve(value.value).then(function (arg) {
resume("next", arg);
}, function (arg) {
resume("throw", arg);
});
} else {
settle(result.done ? "return" : "normal", result.value);
}
} catch (err) {
settle("throw", err);
}
}
function settle(type, value) {
switch (type) {
case "return":
front.resolve({
value: value,
done: true
});
break;
case "throw":
front.reject(value);
break;
default:
front.resolve({
value: value,
done: false
});
break;
}
front = front.next;
if (front) {
resume(front.key, front.arg);
} else {
back = null;
}
}
this._invoke = send;
if (typeof gen.return !== "function") {
this.return = undefined;
}
}
if (typeof Symbol === "function" && Symbol.asyncIterator) {
AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
return this;
};
}
AsyncGenerator.prototype.next = function (arg) {
return this._invoke("next", arg);
};
AsyncGenerator.prototype.throw = function (arg) {
return this._invoke("throw", arg);
};
AsyncGenerator.prototype.return = function (arg) {
return this._invoke("return", arg);
};
return {
wrap: function (fn) {
return function () {
return new AsyncGenerator(fn.apply(this, arguments));
};
},
await: function (value) {
return new AwaitValue(value);
}
};
}();
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
var createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var defineProperty$1 = function (obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
};
var slicedToArray = function () {
function sliceIterator(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"]) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function (arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if (Symbol.iterator in Object(arr)) {
return sliceIterator(arr, i);
} else {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
};
}();
var toConsumableArray = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
} else {
return Array.from(arr);
}
};
// ==========================================================================
// Plyr utils
// ==========================================================================
var utils = {
// Check variable types
is: {
plyr: function plyr(input) {
return this.instanceof(input, window.Plyr);
},
object: function object(input) {
return this.getConstructor(input) === Object;
},
number: function number(input) {
return this.getConstructor(input) === Number && !Number.isNaN(input);
},
string: function string(input) {
return this.getConstructor(input) === String;
},
boolean: function boolean(input) {
return this.getConstructor(input) === Boolean;
},
function: function _function(input) {
return this.getConstructor(input) === Function;
},
array: function array(input) {
return !this.nullOrUndefined(input) && Array.isArray(input);
},
weakMap: function weakMap(input) {
return this.instanceof(input, window.WeakMap);
},
nodeList: function nodeList(input) {
return this.instanceof(input, window.NodeList);
},
element: function element(input) {
return this.instanceof(input, window.Element);
},
textNode: function textNode(input) {
return this.getConstructor(input) === Text;
},
event: function event(input) {
return this.instanceof(input, window.Event);
},
cue: function cue(input) {
return this.instanceof(input, window.TextTrackCue) || this.instanceof(input, window.VTTCue);
},
track: function track(input) {
return this.instanceof(input, TextTrack) || !this.nullOrUndefined(input) && this.string(input.kind);
},
url: function url(input) {
return !this.nullOrUndefined(input) && /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-/]))?/.test(input);
},
nullOrUndefined: function nullOrUndefined(input) {
return input === null || typeof input === 'undefined';
},
empty: function empty(input) {
return this.nullOrUndefined(input) || (this.string(input) || this.array(input) || this.nodeList(input)) && !input.length || this.object(input) && !Object.keys(input).length;
},
instanceof: function _instanceof$$1(input, constructor) {
return Boolean(input && constructor && input instanceof constructor);
},
getConstructor: function getConstructor(input) {
return !this.nullOrUndefined(input) ? input.constructor : null;
}
},
// Unfortunately, due to mixed support, UA sniffing is required
getBrowser: function getBrowser() {
return {
isIE: /* @cc_on!@ */false || !!document.documentMode,
isWebkit: 'WebkitAppearance' in document.documentElement.style && !/Edge/.test(navigator.userAgent),
isIPhone: /(iPhone|iPod)/gi.test(navigator.platform),
isIos: /(iPad|iPhone|iPod)/gi.test(navigator.platform)
};
},
// Fetch wrapper
// Using XHR to avoid issues with older browsers
fetch: function fetch(url) {
var responseType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text';
return new Promise(function (resolve, reject) {
try {
var request = new XMLHttpRequest();
// Check for CORS support
if (!('withCredentials' in request)) {
return;
}
request.addEventListener('load', function () {
if (responseType === 'text') {
try {
resolve(JSON.parse(request.responseText));
} catch (e) {
resolve(request.responseText);
}
} else {
resolve(request.response);
}
});
request.addEventListener('error', function () {
throw new Error(request.statusText);
});
request.open('GET', url, true);
// Set the required response type
request.responseType = responseType;
request.send();
} catch (e) {
reject(e);
}
});
},
// Load an external script
loadScript: function loadScript(url, callback, error) {
var current = document.querySelector('script[src="' + url + '"]');
// Check script is not already referenced, if so wait for load
if (current !== null) {
current.callbacks = current.callbacks || [];
current.callbacks.push(callback);
return;
}
// Build the element
var element = document.createElement('script');
// Callback queue
element.callbacks = element.callbacks || [];
element.callbacks.push(callback);
// Error queue
element.errors = element.errors || [];
element.errors.push(error);
// Bind callback
if (utils.is.function(callback)) {
element.addEventListener('load', function (event) {
element.callbacks.forEach(function (cb) {
return cb.call(null, event);
});
element.callbacks = null;
}, false);
}
// Bind error handling
element.addEventListener('error', function (event) {
element.errors.forEach(function (err) {
return err.call(null, event);
});
element.errors = null;
}, false);
// Set the URL after binding callback
element.src = url;
// Inject
var first = document.getElementsByTagName('script')[0];
first.parentNode.insertBefore(element, first);
},
// Load an external SVG sprite
loadSprite: function loadSprite(url, id) {
if (!utils.is.string(url)) {
return;
}
var prefix = 'cache-';
var hasId = utils.is.string(id);
var isCached = false;
function updateSprite(data) {
// Inject content
this.innerHTML = data;
// Inject the SVG to the body
document.body.insertBefore(this, document.body.childNodes[0]);
}
// Only load once
if (!hasId || !document.querySelectorAll('#' + id).length) {
// Create container
var container = document.createElement('div');
utils.toggleHidden(container, true);
if (hasId) {
container.setAttribute('id', id);
}
// Check in cache
if (support.storage) {
var cached = window.localStorage.getItem(prefix + id);
isCached = cached !== null;
if (isCached) {
var data = JSON.parse(cached);
updateSprite.call(container, data.content);
return;
}
}
// Get the sprite
utils.fetch(url).then(function (result) {
if (utils.is.empty(result)) {
return;
}
if (support.storage) {
window.localStorage.setItem(prefix + id, JSON.stringify({
content: result
}));
}
updateSprite.call(container, result);
}).catch(function () {});
}
},
// Generate a random ID
generateId: function generateId(prefix) {
return prefix + '-' + Math.floor(Math.random() * 10000);
},
// Determine if we're in an iframe
inFrame: function inFrame() {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
},
// Wrap an element
wrap: function wrap(elements, wrapper) {
// Convert `elements` to an array, if necessary.
var targets = elements.length ? elements : [elements];
// Loops backwards to prevent having to clone the wrapper on the
// first element (see `child` below).
Array.from(targets).reverse().forEach(function (element, index) {
var child = index > 0 ? wrapper.cloneNode(true) : wrapper;
// Cache the current parent and sibling.
var parent = element.parentNode;
var sibling = element.nextSibling;
// Wrap the element (is automatically removed from its current
// parent).
child.appendChild(element);
// If the element had a sibling, insert the wrapper before
// the sibling to maintain the HTML structure; otherwise, just
// append it to the parent.
if (sibling) {
parent.insertBefore(child, sibling);
} else {
parent.appendChild(child);
}
});
},
// Create a DocumentFragment
createElement: function createElement(type, attributes, text) {
// Create a new <element>
var element = document.createElement(type);
// Set all passed attributes
if (utils.is.object(attributes)) {
utils.setAttributes(element, attributes);
}
// Add text node
if (utils.is.string(text)) {
element.textContent = text;
}
// Return built element
return element;
},
// Inaert an element after another
insertAfter: function insertAfter(element, target) {
target.parentNode.insertBefore(element, target.nextSibling);
},
// Insert a DocumentFragment
insertElement: function insertElement(type, parent, attributes, text) {
// Inject the new <element>
parent.appendChild(utils.createElement(type, attributes, text));
},
// Remove an element
removeElement: function removeElement(element) {
if (!utils.is.element(element) || !utils.is.element(element.parentNode)) {
return;
}
if (utils.is.nodeList(element) || utils.is.array(element)) {
Array.from(element).forEach(utils.removeElement);
return;
}
element.parentNode.removeChild(element);
},
// Remove all child elements
emptyElement: function emptyElement(element) {
var length = element.childNodes.length;
while (length > 0) {
element.removeChild(element.lastChild);
length -= 1;
}
},
// Replace element
replaceElement: function replaceElement(newChild, oldChild) {
if (!utils.is.element(oldChild) || !utils.is.element(oldChild.parentNode) || !utils.is.element(newChild)) {
return null;
}
oldChild.parentNode.replaceChild(newChild, oldChild);
return newChild;
},
// Set attributes
setAttributes: function setAttributes(element, attributes) {
if (!utils.is.element(element) || utils.is.empty(attributes)) {
return;
}
Object.keys(attributes).forEach(function (key) {
element.setAttribute(key, attributes[key]);
});
},
// Get an attribute object from a string selector
getAttributesFromSelector: function getAttributesFromSelector(sel, existingAttributes) {
// For example:
// '.test' to { class: 'test' }
// '#test' to { id: 'test' }
// '[data-test="test"]' to { 'data-test': 'test' }
if (!utils.is.string(sel) || utils.is.empty(sel)) {
return {};
}
var attributes = {};
var existing = existingAttributes;
sel.split(',').forEach(function (s) {
// Remove whitespace
var selector = s.trim();
var className = selector.replace('.', '');
var stripped = selector.replace(/[[\]]/g, '');
// Get the parts and value
var parts = stripped.split('=');
var key = parts[0];
var value = parts.length > 1 ? parts[1].replace(/["']/g, '') : '';
// Get the first character
var start = selector.charAt(0);
switch (start) {
case '.':
// Add to existing classname
if (utils.is.object(existing) && utils.is.string(existing.class)) {
existing.class += ' ' + className;
}
attributes.class = className;
break;
case '#':
// ID selector
attributes.id = selector.replace('#', '');
break;
case '[':
// Attribute selector
attributes[key] = value;
break;
default:
break;
}
});
return attributes;
},
// Toggle class on an element
toggleClass: function toggleClass(element, className, toggle) {
if (utils.is.element(element)) {
var contains = element.classList.contains(className);
element.classList[toggle ? 'add' : 'remove'](className);
return toggle && !contains || !toggle && contains;
}
return null;
},
// Has class name
hasClass: function hasClass(element, className) {
return utils.is.element(element) && element.classList.contains(className);
},
// Toggle hidden attribute on an element
toggleHidden: function toggleHidden(element, toggle) {
if (!utils.is.element(element)) {
return;
}
if (toggle) {
element.setAttribute('hidden', '');
} else {
element.removeAttribute('hidden');
}
},
// Element matches selector
matches: function matches(element, selector) {
var prototype = { Element: Element };
function match() {
return Array.from(document.querySelectorAll(selector)).includes(this);
}
var matches = prototype.matches || prototype.webkitMatchesSelector || prototype.mozMatchesSelector || prototype.msMatchesSelector || match;
return matches.call(element, selector);
},
// Find all elements
getElements: function getElements(selector) {
return this.elements.container.querySelectorAll(selector);
},
// Find a single element
getElement: function getElement(selector) {
return this.elements.container.querySelector(selector);
},
// Find the UI controls and store references in custom controls
// TODO: Allow settings menus with custom controls
findElements: function findElements() {
try {
this.elements.controls = utils.getElement.call(this, this.config.selectors.controls.wrapper);
// Buttons
this.elements.buttons = {
play: utils.getElements.call(this, this.config.selectors.buttons.play),
pause: utils.getElement.call(this, this.config.selectors.buttons.pause),
restart: utils.getElement.call(this, this.config.selectors.buttons.restart),
rewind: utils.getElement.call(this, this.config.selectors.buttons.rewind),
forward: utils.getElement.call(this, this.config.selectors.buttons.forward),
mute: utils.getElement.call(this, this.config.selectors.buttons.mute),
pip: utils.getElement.call(this, this.config.selectors.buttons.pip),
airplay: utils.getElement.call(this, this.config.selectors.buttons.airplay),
settings: utils.getElement.call(this, this.config.selectors.buttons.settings),
captions: utils.getElement.call(this, this.config.selectors.buttons.captions),
fullscreen: utils.getElement.call(this, this.config.selectors.buttons.fullscreen)
};
// Progress
this.elements.progress = utils.getElement.call(this, this.config.selectors.progress);
// Inputs
this.elements.inputs = {
seek: utils.getElement.call(this, this.config.selectors.inputs.seek),
volume: utils.getElement.call(this, this.config.selectors.inputs.volume)
};
// Display
this.elements.display = {
buffer: utils.getElement.call(this, this.config.selectors.display.buffer),
duration: utils.getElement.call(this, this.config.selectors.display.duration),
currentTime: utils.getElement.call(this, this.config.selectors.display.currentTime)
};
// Seek tooltip
if (utils.is.element(this.elements.progress)) {
this.elements.display.seekTooltip = this.elements.progress.querySelector('.' + this.config.classNames.tooltip);
}
return true;
} catch (error) {
// Log it
this.debug.warn('It looks like there is a problem with your custom controls HTML', error);
// Restore native video controls
this.toggleNativeControls(true);
return false;
}
},
// Get the focused element
getFocusElement: function getFocusElement() {
var focused = document.activeElement;
if (!focused || focused === document.body) {
focused = null;
} else {
focused = document.querySelector(':focus');
}
return focused;
},
// Trap focus inside container
trapFocus: function trapFocus() {
var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var toggle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (!utils.is.element(element)) {
return;
}
var focusable = utils.getElements.call(this, 'button:not(:disabled), input:not(:disabled), [tabindex]');
var first = focusable[0];
var last = focusable[focusable.length - 1];
var trap = function trap(event) {
// Bail if not tab key or not fullscreen
if (event.key !== 'Tab' || event.keyCode !== 9) {
return;
}
// Get the current focused element
var focused = utils.getFocusElement();
if (focused === last && !event.shiftKey) {
// Move focus to first element that can be tabbed if Shift isn't used
first.focus();
event.preventDefault();
} else if (focused === first && event.shiftKey) {
// Move focus to last element that can be tabbed if Shift is used
last.focus();
event.preventDefault();
}
};
if (toggle) {
utils.on(this.elements.container, 'keydown', trap, false);
} else {
utils.off(this.elements.container, 'keydown', trap, false);
}
},
// Toggle event listener
toggleListener: function toggleListener(elements, event, callback, toggle, passive, capture) {
// Bail if no elemetns, event, or callback
if (utils.is.empty(elements) || utils.is.empty(event) || !utils.is.function(callback)) {
return;
}
// If a nodelist is passed, call itself on each node
if (utils.is.nodeList(elements) || utils.is.array(elements)) {
// Create listener for each node
Array.from(elements).forEach(function (element) {
if (element instanceof Node) {
utils.toggleListener.call(null, element, event, callback, toggle, passive, capture);
}
});
return;
}
// Allow multiple events
var events = event.split(' ');
// Build options
// Default to just capture boolean
var options = utils.is.boolean(capture) ? capture : false;
// If passive events listeners are supported
if (support.passiveListeners) {
options = {
// Whether the listener can be passive (i.e. default never prevented)
passive: utils.is.boolean(passive) ? passive : true,
// Whether the listener is a capturing listener or not
capture: utils.is.boolean(capture) ? capture : false
};
}
// If a single node is passed, bind the event listener
events.forEach(function (type) {
elements[toggle ? 'addEventListener' : 'removeEventListener'](type, callback, options);
});
},
// Bind event handler
on: function on(element, events, callback, passive, capture) {
utils.toggleListener(element, events, callback, true, passive, capture);
},
// Unbind event handler
off: function off(element, events, callback, passive, capture) {
utils.toggleListener(element, events, callback, false, passive, capture);
},
// Trigger event
dispatchEvent: function dispatchEvent(element, type, bubbles, detail) {
// Bail if no element
if (!utils.is.element(element) || !utils.is.string(type)) {
return;
}
// Create and dispatch the event
var event = new CustomEvent(type, {
bubbles: utils.is.boolean(bubbles) ? bubbles : false,
detail: Object.assign({}, detail, {
plyr: utils.is.plyr(this) ? this : null
})
});
// Dispatch the event
element.dispatchEvent(event);
},
// Toggle aria-pressed state on a toggle button
// http://www.ssbbartgroup.com/blog/how-not-to-misuse-aria-states-properties-and-roles
toggleState: function toggleState(element, input) {
// If multiple elements passed
if (utils.is.array(element) || utils.is.nodeList(element)) {
Array.from(element).forEach(function (target) {
return utils.toggleState(target, input);
});
return;
}
// Bail if no target
if (!utils.is.element(element)) {
return;
}
// Get state
var pressed = element.getAttribute('aria-pressed') === 'true';
var state = utils.is.boolean(input) ? input : !pressed;
// Set the attribute on target
element.setAttribute('aria-pressed', state);
},
// Get percentage
getPercentage: function getPercentage(current, max) {
if (current === 0 || max === 0 || Number.isNaN(current) || Number.isNaN(max)) {
return 0;
}
return (current / max * 100).toFixed(2);
},
// Time helpers
getHours: function getHours(value) {
return parseInt(value / 60 / 60 % 60, 10);
},
getMinutes: function getMinutes(value) {
return parseInt(value / 60 % 60, 10);
},
getSeconds: function getSeconds(value) {
return parseInt(value % 60, 10);
},
// Format time to UI friendly string
formatTime: function formatTime() {
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var displayHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var inverted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
// Bail if the value isn't a number
if (!utils.is.number(time)) {
return this.formatTime(null, displayHours, inverted);
}
// Format time component to add leading zero
var format = function format(value) {
return ('0' + value).slice(-2);
};
// Breakdown to hours, mins, secs
var hours = this.getHours(time);
var mins = this.getMinutes(time);
var secs = this.getSeconds(time);
// Do we need to display hours?
if (displayHours || hours > 0) {
hours = hours + ':';
} else {
hours = '';
}
// Render
return '' + (inverted ? '-' : '') + hours + format(mins) + ':' + format(secs);
},
// Deep extend destination object with N more objects
extend: function extend() {
var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
sources[_key - 1] = arguments[_key];
}
if (!sources.length) {
return target;
}
var source = sources.shift();
if (!utils.is.object(source)) {
return target;
}
Object.keys(source).forEach(function (key) {
if (utils.is.object(source[key])) {
if (!Object.keys(target).includes(key)) {
Object.assign(target, defineProperty$1({}, key, {}));
}
utils.extend(target[key], source[key]);
} else {
Object.assign(target, defineProperty$1({}, key, source[key]));
}
});
return utils.extend.apply(utils, [target].concat(toConsumableArray(sources)));
},
// Get the provider for a given URL
getProviderByUrl: function getProviderByUrl(url) {
// YouTube
if (/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$/.test(url)) {
return providers.youtube;
}
// Vimeo
if (/^https?:\/\/player.vimeo.com\/video\/\d{8,}(?=\b|\/)/.test(url)) {
return providers.vimeo;
}
return null;
},
// Parse YouTube ID from URL
parseYouTubeId: function parseYouTubeId(url) {
if (utils.is.empty(url)) {
return null;
}
var regex = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
return url.match(regex) ? RegExp.$2 : url;
},
// Parse Vimeo ID from URL
parseVimeoId: function parseVimeoId(url) {
if (utils.is.empty(url)) {
return null;
}
if (utils.is.number(Number(url))) {
return url;
}
var regex = /^.*(vimeo.com\/|video\/)(\d+).*/;
return url.match(regex) ? RegExp.$2 : url;
},
// Convert a URL to a location object
parseUrl: function parseUrl(url) {
var parser = document.createElement('a');
parser.href = url;
return parser;
},
// Get URL query parameters
getUrlParams: function getUrlParams(input) {
var search = input;
// Parse URL if needed
if (input.startsWith('http://') || input.startsWith('https://')) {
var _parseUrl = this.parseUrl(input);
search = _parseUrl.search;
}
if (this.is.empty(search)) {
return null;
}
var hashes = search.slice(search.indexOf('?') + 1).split('&');
return hashes.reduce(function (params, hash) {
var _hash$split = hash.split('='),
_hash$split2 = slicedToArray(_hash$split, 2),
key = _hash$split2[0],
val = _hash$split2[1];
return Object.assign(params, defineProperty$1({}, key, decodeURIComponent(val)));
}, {});
},
// Convert object to URL parameters
buildUrlParams: function buildUrlParams(input) {
if (!utils.is.object(input)) {
return '';
}
return Object.keys(input).map(function (key) {
return encodeURIComponent(key) + '=' + encodeURIComponent(input[key]);
}).join('&');
},
// Remove HTML from a string
stripHTML: function stripHTML(source) {
var fragment = document.createDocumentFragment();
var element = document.createElement('div');
fragment.appendChild(element);
element.innerHTML = source;
return fragment.firstChild.innerText;
},
// Get aspect ratio for dimensions
getAspectRatio: function getAspectRatio(width, height) {
var getRatio = function getRatio(w, h) {
return h === 0 ? w : getRatio(h, w % h);
};
var ratio = getRatio(width, height);
return width / ratio + ':' + height / ratio;
},
// Get the transition end event
get transitionEndEvent() {
var element = document.createElement('span');
var events = {
WebkitTransition: 'webkitTransitionEnd',
MozTransition: 'transitionend',
OTransition: 'oTransitionEnd otransitionend',
transition: 'transitionend'
};
var type = Object.keys(events).find(function (event) {
return element.style[event] !== undefined;
});
return utils.is.string(type) ? events[type] : false;
},
// Force repaint of element
repaint: function repaint(element) {
setTimeout(function () {
utils.toggleHidden(element, true);
element.offsetHeight; // eslint-disable-line
utils.toggleHidden(element, false);
}, 0);
}
};
// ==========================================================================
// Plyr support checks
// ==========================================================================
// Check for feature support
var support = {
// Basic support
audio: 'canPlayType' in document.createElement('audio'),
video: 'canPlayType' in document.createElement('video'),
// Check for support
// Basic functionality vs full UI
check: function check(type, provider, inline) {
var api = false;
var ui = false;
var browser = utils.getBrowser();
var playsInline = browser.isIPhone && inline && support.inline;
switch (provider + ':' + type) {
case 'html5:video':
api = support.video;
ui = api && support.rangeInput && (!browser.isIPhone || playsInline);
break;
case 'html5:audio':
api = support.audio;
ui = api && support.rangeInput;
break;
case 'youtube:video':
api = true;
ui = support.rangeInput && (!browser.isIPhone || playsInline);
break;
case 'vimeo:video':
api = true;
ui = support.rangeInput && !browser.isIPhone;
break;
default:
api = support.audio && support.video;
ui = api && support.rangeInput;
}
return {
api: api,
ui: ui
};
},
// Picture-in-picture support
// Safari only currently
pip: function () {
var browser = utils.getBrowser();
return !browser.isIPhone && utils.is.function(utils.createElement('video').webkitSetPresentationMode);
}(),
// Airplay support
// Safari only currently
airplay: utils.is.function(window.WebKitPlaybackTargetAvailabilityEvent),
// Inline playback support
// https://webkit.org/blog/6784/new-video-policies-for-ios/
inline: 'playsInline' in document.createElement('video'),
// Check for mime type support against a player instance
// Credits: http://diveintohtml5.info/everything.html
// Related: http://www.leanbackplayer.com/test/h5mt.html
mime: function mime(type) {
var media = this.media;
try {
// Bail if no checking function
if (!this.isHTML5 || !utils.is.function(media.canPlayType)) {
return false;
}
// Type specific checks
if (this.isVideo) {
switch (type) {
case 'video/webm':
return media.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/, '');
case 'video/mp4':
return media.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/, '');
case 'video/ogg':
return media.canPlayType('video/ogg; codecs="theora"').replace(/no/, '');
default:
return false;
}
} else if (this.isAudio) {
switch (type) {
case 'audio/mpeg':
return media.canPlayType('audio/mpeg;').replace(/no/, '');
case 'audio/ogg':
return media.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, '');
case 'audio/wav':
return media.canPlayType('audio/wav; codecs="1"').replace(/no/, '');
default:
return false;
}
}
} catch (e) {
return false;
}
// If we got this far, we're stuffed
return false;
},
// Check for textTracks support
textTracks: 'textTracks' in document.createElement('video'),
// Check for passive event listener support
// https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
// https://www.youtube.com/watch?v=NPM6172J22g
passiveListeners: function () {
// Test via a getter in the options object to see if the passive property is accessed
var supported = false;
try {
var options = Object.defineProperty({}, 'passive', {
get: function get() {
supported = true;
return null;
}
});
window.addEventListener('test', null, options);
} catch (e) {
// Do nothing
}
return supported;
}(),
// <input type="range"> Sliders
rangeInput: function () {
var range = document.createElement('input');
range.type = 'range';
return range.type === 'range';
}(),
// Touch
// Remember a device can be moust + touch enabled
touch: 'ontouchstart' in document.documentElement,
// Detect transitions support
transitions: utils.transitionEndEvent !== false,
// Reduced motion iOS & MacOS setting
// https://webkit.org/blog/7551/responsive-design-for-motion/
reducedMotion: 'matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches
};
// ==========================================================================
// Console wrapper
// ==========================================================================
var noop = function noop() {};
var Console = function () {
function Console() {
var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
classCallCheck(this, Console);
this.enabled = window.console && enabled;
if (this.enabled) {
this.log('Debugging enabled');
}
}
createClass(Console, [{
key: 'log',
get: function get() {
// eslint-disable-next-line no-console
return this.enabled ? Function.prototype.bind.call(console.log, console) : noop;
}
}, {
key: 'warn',
get: function get() {
// eslint-disable-next-line no-console
return this.enabled ? Function.prototype.bind.call(console.warn, console) : noop;
}
}, {
key: 'error',
get: function get() {
// eslint-disable-next-line no-console
return this.enabled ? Function.prototype.bind.call(console.error, console) : noop;
}
}]);
return Console;
}();
// ==========================================================================
// Fullscreen wrapper
// ==========================================================================
var browser = utils.getBrowser();
function onChange() {
if (!this.enabled) {
return;
}
// Update toggle button
var button = this.player.elements.buttons.fullscreen;
if (utils.is.element(button)) {
utils.toggleState(button, this.active);
}
// Trigger an event
utils.dispatchEvent(this.target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
// Trap focus in container
if (!browser.isIos) {
utils.trapFocus.call(this.player, this.target, this.active);
}
}
function toggleFallback() {
var toggle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
// Store or restore scroll position
if (toggle) {
this.scrollPosition = {
x: window.scrollX || 0,
y: window.scrollY || 0
};
} else {
window.scrollTo(this.scrollPosition.x, this.scrollPosition.y);
}
// Toggle scroll
document.body.style.overflow = toggle ? 'hidden' : '';
// Toggle class hook
utils.toggleClass(this.target, this.player.config.classNames.fullscreen.fallback, toggle);
// Toggle button and fire events
onChange.call(this);
}
var Fullscreen = function () {
function Fullscreen(player) {
var _this = this;
classCallCheck(this, Fullscreen);
// Keep reference to parent
this.player = player;
// Get prefix
this.prefix = Fullscreen.prefix;
// Scroll position
this.scrollPosition = { x: 0, y: 0 };
// Register event listeners
// Handle event (incase user presses escape etc)
utils.on(document, this.prefix === 'ms' ? 'MSFullscreenChange' : this.prefix + 'fullscreenchange', function () {
// TODO: Filter for target??
onChange.call(_this);
});
// Fullscreen toggle on double click
utils.on(this.player.elements.container, 'dblclick', function () {
_this.toggle();
});
// Prevent double click on controls bubbling up
utils.on(this.player.elements.controls, 'dblclick', function (event) {
return event.stopPropagation();
});
// Update the UI
this.update();
}
// Determine if native supported
createClass(Fullscreen, [{
key: 'update',
// Update UI
value: function update() {
if (this.enabled) {
this.player.debug.log((Fullscreen.native ? 'Native' : 'Fallback') + ' fullscreen enabled');
} else {
this.player.debug.log('Fullscreen not supported and fallback disabled');
}
// Add styling hook to show button
utils.toggleClass(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.enabled);
}
// Make an element fullscreen
}, {
key: 'enter',
value: function enter() {
if (!this.enabled) {
return;
}
// iOS native fullscreen doesn't need the request step
if (browser.isIos && this.player.config.fullscreen.iosNative) {
if (this.player.playing) {
this.target.webkitEnterFullscreen();
}
} else if (!Fullscreen.native) {
toggleFallback.call(this, true);
} else if (!this.prefix) {
this.target.requestFullScreen();
} else if (!utils.is.empty(this.prefix)) {
this.target['' + this.prefix + (this.prefix === 'ms' ? 'RequestFullscreen' : 'RequestFullScreen')]();
}
}
// Bail from fullscreen
}, {
key: 'exit',
value: function exit() {
if (!this.enabled) {
return;
}
// iOS native fullscreen
if (browser.isIos && this.player.config.fullscreen.iosNative) {
this.target.webkitExitFullscreen();
this.player.play();
} else if (!Fullscreen.native) {
toggleFallback.call(this, false);
} else if (!this.prefix) {
document.cancelFullScreen();
} else if (!utils.is.empty(this.prefix)) {
document['' + this.prefix + (this.prefix === 'ms' ? 'ExitFullscreen' : 'CancelFullScreen')]();
}
}
// Toggle state
}, {
key: 'toggle',
value: function toggle() {
if (!this.active) {
this.enter();
} else {
this.exit();
}
}
}, {
key: 'enabled',
// Determine if fullscreen is enabled
get: function get() {
var fallback = this.player.config.fullscreen.fallback && !utils.inFrame();
return (Fullscreen.native || fallback) && this.player.config.fullscreen.enabled && this.player.supported.ui && this.player.isVideo;
}
// Get active state
}, {
key: 'active',
get: function get() {
if (!this.enabled) {
return false;
}
// Fallback using classname
if (!Fullscreen.native) {
return utils.hasClass(this.target, this.player.config.classNames.fullscreen.fallback);
}
var element = !this.prefix ? document.fullscreenElement : document[this.prefix + 'FullscreenElement'];
return element === this.target;
}
// Get target element
}, {
key: 'target',
get: function get() {
return browser.isIos && this.player.config.fullscreen.iosNative ? this.player.media : this.player.elements.container;
}
}], [{
key: 'native',
get: function get() {
return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);
}
// Get the prefix for handlers
}, {
key: 'prefix',
get: function get() {
// No prefix
if (utils.is.function(document.cancelFullScreen)) {
return false;
}
// Check for fullscreen support by vendor prefix
var value = '';
var prefixes = ['webkit', 'moz', 'ms'];
prefixes.some(function (pre) {
if (utils.is.function(document[pre + 'CancelFullScreen'])) {
value = pre;
return true;
} else if (utils.is.function(document.msExitFullscreen)) {
value = 'ms';
return true;
}
return false;
});
return value;
}
}]);
return Fullscreen;
}();
// ==========================================================================
// Plyr storage
// ==========================================================================
var Storage = function () {
function Storage(player) {
classCallCheck(this, Storage);
this.enabled = player.config.storage.enabled;
this.key = player.config.storage.key;
}
// Check for actual support (see if we can use it)
createClass(Storage, [{
key: 'get',
value: function get(key) {
var store = window.localStorage.getItem(this.key);
if (!Storage.supported || utils.is.empty(store)) {
return null;
}
var json = JSON.parse(store);
return utils.is.string(key) && key.length ? json[key] : json;
}
}, {
key: 'set',
value: function set(object) {
// Bail if we don't have localStorage support or it's disabled
if (!Storage.supported || !this.enabled) {
return;
}
// Can only store objectst
if (!utils.is.object(object)) {
return;
}
// Get current storage
var storage = this.get();
// Default to empty object
if (utils.is.empty(storage)) {
storage = {};
}
// Update the working copy of the values
utils.extend(storage, object);
// Update storage
window.localStorage.setItem(this.key, JSON.stringify(storage));
}
}], [{
key: 'supported',
get: function get() {
if (!('localStorage' in window)) {
return false;
}
var test = '___test';
// Try to use it (it might be disabled, e.g. user is in private mode)
// see: https://github.com/sampotts/plyr/issues/131
try {
window.localStorage.setItem(test, test);
window.localStorage.removeItem(test);
return true;
} catch (e) {
return false;
}
}
}]);
return Storage;
}();
// ==========================================================================
// Advertisement plugin using Google IMA HTML5 SDK
// Create an account with our ad partner, vi here:
// https://www.vi.ai/publisher-video-monetization/
// ==========================================================================
/* global google */
// Build the default tag URL
var getTagUrl = function getTagUrl() {
var params = {
AV_PUBLISHERID: '58c25bb0073ef448b1087ad6',
AV_CHANNELID: '5a0458dc28a06145e4519d21',
AV_URL: '127.0.0.1:3000',
cb: 1,
AV_WIDTH: 640,
AV_HEIGHT: 480
};
var base = 'https://go.aniview.com/api/adserver6/vast/';
return base + '?' + utils.buildUrlParams(params);
};
var Ads = function () {
/**
* Ads constructor.
* @param {object} player
* @return {Ads}
*/
function Ads(player) {
var _this = this;
classCallCheck(this, Ads);
this.player = player;
this.enabled = player.config.ads.enabled;
this.playing = false;
this.initialized = false;
this.blocked = false;
this.enabled = utils.is.url(player.config.ads.tag);
// Check if a tag URL is provided.
if (!this.enabled) {
return;
}
// Check if the Google IMA3 SDK is loaded or load it ourselves
if (!utils.is.object(window.google)) {
utils.loadScript(player.config.urls.googleIMA.api, function () {
_this.ready();
}, function () {
// Script failed to load or is blocked
_this.blocked = true;
_this.player.debug.log('Ads error: Google IMA SDK failed to load');
});
} else {
this.ready();
}
}
/**
* Get the ads instance ready.
*/
createClass(Ads, [{
key: 'ready',
value: function ready() {
var _this2 = this;
this.elements = {
container: null,
displayContainer: null
};
this.manager = null;
this.loader = null;
this.cuePoints = null;
this.events = {};
this.safetyTimer = null;
this.countdownTimer = null;
// Set listeners on the Plyr instance
this.listeners();
// Start ticking our safety timer. If the whole advertisement
// thing doesn't resolve within our set time; we bail
this.startSafetyTimer(12000, 'ready()');
// Setup a simple promise to resolve if the IMA loader is ready
this.loaderPromise = new Promise(function (resolve) {
_this2.on('ADS_LOADER_LOADED', function () {
return resolve();
});
});
// Setup a promise to resolve if the IMA manager is ready
this.managerPromise = new Promise(function (resolve) {
_this2.on('ADS_MANAGER_LOADED', function () {
return resolve();
});
});
// Clear the safety timer
this.managerPromise.then(function () {
_this2.clearSafetyTimer('onAdsManagerLoaded()');
});
// Setup the IMA SDK
this.setupIMA();
}
/**
* In order for the SDK to display ads for our video, we need to tell it where to put them,
* so here we define our ad container. This div is set up to render on top of the video player.
* Using the code below, we tell the SDK to render ads within that div. We also provide a
* handle to the content video player - the SDK will poll the current time of our player to
* properly place mid-rolls. After we create the ad display container, we initialize it. On
* mobile devices, this initialization is done as the result of a user action.
*/
}, {
key: 'setupIMA',
value: function setupIMA() {
// Create the container for our advertisements
this.elements.container = utils.createElement('div', {
class: this.player.config.classNames.ads,
hidden: ''
});
this.player.elements.container.appendChild(this.elements.container);
// So we can run VPAID2
google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED);
// Set language
google.ima.settings.setLocale(this.player.config.ads.language);
// We assume the adContainer is the video container of the plyr element
// that will house the ads
this.elements.displayContainer = new google.ima.AdDisplayContainer(this.elements.container);
// Request video ads to be pre-loaded
this.requestAds();
}
/**
* Request advertisements
*/
}, {
key: 'requestAds',
value: function requestAds() {
var _this3 = this;
var container = this.player.elements.container;
try {
// Create ads loader
this.loader = new google.ima.AdsLoader(this.elements.displayContainer);
// Listen and respond to ads loaded and error events
this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, function (event) {
return _this3.onAdsManagerLoaded(event);
}, false);
this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, function (error) {
return _this3.onAdError(error);
}, false);
// Request video ads
var request = new google.ima.AdsRequest();
request.adTagUrl = getTagUrl();
// Specify the linear and nonlinear slot sizes. This helps the SDK
// to select the correct creative if multiple are returned
request.linearAdSlotWidth = container.offsetWidth;
request.linearAdSlotHeight = container.offsetHeight;
request.nonLinearAdSlotWidth = container.offsetWidth;
request.nonLinearAdSlotHeight = container.offsetHeight;
// We only overlay ads as we only support video.
request.forceNonLinearFullSlot = false;
this.loader.requestAds(request);
this.handleEventListeners('ADS_LOADER_LOADED');
} catch (e) {
this.onAdError(e);
}
}
/**
* Update the ad countdown
* @param {boolean} start
*/
}, {
key: 'pollCountdown',
value: function pollCountdown() {
var _this4 = this;
var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
if (!start) {
window.clearInterval(this.countdownTimer);
this.elements.container.removeAttribute('data-badge-text');
return;
}
var update = function update() {
var time = utils.formatTime(_this4.manager.getRemainingTime());
var label = _this4.player.config.i18n.advertisement + ' - ' + time;
_this4.elements.container.setAttribute('data-badge-text', label);
};
this.countdownTimer = window.setInterval(update, 100);
}
/**
* This method is called whenever the ads are ready inside the AdDisplayContainer
* @param {Event} adsManagerLoadedEvent
*/
}, {
key: 'onAdsManagerLoaded',
value: function onAdsManagerLoaded(adsManagerLoadedEvent) {
var _this5 = this;
// Get the ads manager
var settings = new google.ima.AdsRenderingSettings();
// Tell the SDK to save and restore content video state on our behalf
settings.restoreCustomPlaybackStateOnAdBreakComplete = true;
settings.enablePreloading = true;
// The SDK is polling currentTime on the contentPlayback. And needs a duration
// so it can determine when to start the mid- and post-roll
this.manager = adsManagerLoadedEvent.getAdsManager(this.player, settings);
// Get the cue points for any mid-rolls by filtering out the pre- and post-roll
this.cuePoints = this.manager.getCuePoints();
// Add advertisement cue's within the time line if available
this.cuePoints.forEach(function (cuePoint) {
if (cuePoint !== 0 && cuePoint !== -1) {
var seekElement = _this5.player.elements.progress;
if (seekElement) {
var cuePercentage = 100 / _this5.player.duration * cuePoint;
var cue = utils.createElement('span', {
class: _this5.player.config.classNames.cues
});
cue.style.left = cuePercentage.toString() + '%';
seekElement.appendChild(cue);
}
}
});
// Get skippable state
// TODO: Skip button
// this.manager.getAdSkippableState();
// Set volume to match player
this.manager.setVolume(this.player.volume);
// Add listeners to the required events
// Advertisement error events
this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, function (error) {
return _this5.onAdError(error);
});
// Advertisement regular events
Object.keys(google.ima.AdEvent.Type).forEach(function (type) {
_this5.manager.addEventListener(google.ima.AdEvent.Type[type], function (event) {
return _this5.onAdEvent(event);
});
});
// Resolve our adsManager
this.handleEventListeners('ADS_MANAGER_LOADED');
}
/**
* This is where all the event handling takes place. Retrieve the ad from the event. Some
* events (e.g. ALL_ADS_COMPLETED) don't have the ad object associated
* https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdEvent.Type
* @param {Event} event
*/
}, {
key: 'onAdEvent',
value: function onAdEvent(event) {
var _this6 = this;
var container = this.player.elements.container;
// Retrieve the ad from the event. Some events (e.g. ALL_ADS_COMPLETED)
// don't have ad object associated
var ad = event.getAd();
// Proxy event
var dispatchEvent = function dispatchEvent(type) {
utils.dispatchEvent.call(_this6.player, _this6.player.media, 'ads' + type);
};
switch (event.type) {
case google.ima.AdEvent.Type.LOADED:
// This is the first event sent for an ad - it is possible to determine whether the
// ad is a video ad or an overlay
this.handleEventListeners('LOADED');
// Bubble event
dispatchEvent('loaded');
// Start countdown
this.pollCountdown(true);
if (!ad.isLinear()) {
// Position AdDisplayContainer correctly for overlay
ad.width = container.offsetWidth;
ad.height = container.offsetHeight;
}
// console.info('Ad type: ' + event.getAd().getAdPodInfo().getPodIndex());
// console.info('Ad time: ' + event.getAd().getAdPodInfo().getTimeOffset());
break;
case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:
// All ads for the current videos are done. We can now request new advertisements
// in case the video is re-played
this.handleEventListeners('ALL_ADS_COMPLETED');
// Fire event
dispatchEvent('allcomplete');
// TODO: Example for what happens when a next video in a playlist would be loaded.
// So here we load a new video when all ads are done.
// Then we load new ads within a new adsManager. When the video
// Is started - after - the ads are loaded, then we get ads.
// You can also easily test cancelling and reloading by running
// player.ads.cancel() and player.ads.play from the console I guess.
// this.player.source = {
// type: 'video',
// title: 'View From A Blue Moon',
// sources: [{
// src:
// 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4', type:
// 'video/mp4', }], poster:
// 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg', tracks:
// [ { kind: 'captions', label: 'English', srclang: 'en', src:
// 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt',
// default: true, }, { kind: 'captions', label: 'French', srclang: 'fr', src:
// 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.fr.vtt', }, ],
// };
// TODO: So there is still this thing where a video should only be allowed to start
// playing when the IMA SDK is ready or has failed
this.loadAds();
break;
case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:
// This event indicates the ad has started - the video player can adjust the UI,
// for example display a pause button and remaining time. Fired when content should
// be paused. This usually happens right before an ad is about to cover the content
this.handleEventListeners('CONTENT_PAUSE_REQUESTED');
dispatchEvent('contentpause');
this.pauseContent();
break;
case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:
// This event indicates the ad has finished - the video player can perform
// appropriate UI actions, such as removing the timer for remaining time detection.
// Fired when content should be resumed. This usually happens when an ad finishes
// or collapses
this.handleEventListeners('CONTENT_RESUME_REQUESTED');
dispatchEvent('contentresume');
this.pollCountdown();
this.resumeContent();
break;
case google.ima.AdEvent.Type.STARTED:
dispatchEvent('started');
break;
case google.ima.AdEvent.Type.MIDPOINT:
dispatchEvent('midpoint');
break;
case google.ima.AdEvent.Type.COMPLETE:
dispatchEvent('complete');
break;
case google.ima.AdEvent.Type.IMPRESSION:
dispatchEvent('impression');
break;
case google.ima.AdEvent.Type.CLICK:
dispatchEvent('click');
break;
default:
break;
}
}
/**
* Any ad error handling comes through here
* @param {Event} event
*/
}, {
key: 'onAdError',
value: function onAdError(event) {
this.cancel();
this.player.debug.log('Ads error', event);
}
/**
* Setup hooks for Plyr and window events. This ensures
* the mid- and post-roll launch at the correct time. And
* resize the advertisement when the player resizes
*/
}, {
key: 'listeners',
value: function listeners() {
var _this7 = this;
var container = this.player.elements.container;
var time = void 0;
// Add listeners to the required events
this.player.on('ended', function () {
_this7.loader.contentComplete();
});
this.player.on('seeking', function () {
time = _this7.player.currentTime;
return time;
});
this.player.on('seeked', function () {
var seekedTime = _this7.player.currentTime;
_this7.cuePoints.forEach(function (cuePoint, index) {
if (time < cuePoint && cuePoint < seekedTime) {
_this7.manager.discardAdBreak();
_this7.cuePoints.splice(index, 1);
}
});
});
// Listen to the resizing of the window. And resize ad accordingly
// TODO: eventually implement ResizeObserver
window.addEventListener('resize', function () {
_this7.manager.resize(container.offsetWidth, container.offsetHeight, google.ima.ViewMode.NORMAL);
});
}
/**
* Initialize the adsManager and start playing advertisements
*/
}, {
key: 'play',
value: function play() {
var _this8 = this;
var container = this.player.elements.container;
if (!this.managerPromise) {
return;
}
// Play the requested advertisement whenever the adsManager is ready
this.managerPromise.then(function () {
// Initialize the container. Must be done via a user action on mobile devices
_this8.elements.displayContainer.initialize();
try {
if (!_this8.initialized) {
// Initialize the ads manager. Ad rules playlist will start at this time
_this8.manager.init(container.offsetWidth, container.offsetHeight, google.ima.ViewMode.NORMAL);
// Call play to start showing the ad. Single video and overlay ads will
// start at this time; the call will be ignored for ad rules
_this8.manager.start();
}
_this8.initialized = true;
} catch (adError) {
// An error may be thrown if there was a problem with the
// VAST response
_this8.onAdError(adError);
}
});
}
/**
* Resume our video.
*/
}, {
key: 'resumeContent',
value: function resumeContent() {
// Hide our ad container
utils.toggleHidden(this.elements.container, true);
// Ad is stopped
this.playing = false;
// Play our video
if (this.player.currentTime < this.player.duration) {
this.player.play();
}
}
/**
* Pause our video
*/
}, {
key: 'pauseContent',
value: function pauseContent() {
// Show our ad container.
utils.toggleHidden(this.elements.container, false);
// Ad is playing.
this.playing = true;
// Pause our video.
this.player.pause();
}
/**
* Destroy the adsManager so we can grab new ads after this. If we don't then we're not
* allowed to call new ads based on google policies, as they interpret this as an accidental
* video requests. https://developers.google.com/interactive-
* media-ads/docs/sdks/android/faq#8
*/
}, {
key: 'cancel',
value: function cancel() {
// Pause our video
if (this.initialized) {
this.resumeContent();
}
// Tell our instance that we're done for now
this.handleEventListeners('ERROR');
// Re-create our adsManager
this.loadAds();
}
/**
* Re-create our adsManager
*/
}, {
key: 'loadAds',
value: function loadAds() {
var _this9 = this;
// Tell our adsManager to go bye bye
this.managerPromise.then(function () {
// Destroy our adsManager
if (_this9.manager) {
_this9.manager.destroy();
}
// Re-set our adsManager promises
_this9.managerPromise = new Promise(function (resolve) {
_this9.on('ADS_MANAGER_LOADED', function () {
return resolve();
});
_this9.player.debug.log(_this9.manager);
});
// Now request some new advertisements
_this9.requestAds();
});
}
/**
* Handles callbacks after an ad event was invoked
* @param {string} event - Event type
*/
}, {
key: 'handleEventListeners',
value: function handleEventListeners(event) {
if (utils.is.function(this.events[event])) {
this.events[event].call(this);
}
}
/**
* Add event listeners
* @param {string} event - Event type
* @param {function} callback - Callback for when event occurs
* @return {Ads}
*/
}, {
key: 'on',
value: function on(event, callback) {
this.events[event] = callback;
return this;
}
/**
* Setup a safety timer for when the ad network doesn't respond for whatever reason.
* The advertisement has 12 seconds to get its things together. We stop this timer when the
* advertisement is playing, or when a user action is required to start, then we clear the
* timer on ad ready
* @param {number} time
* @param {string} from
*/
}, {
key: 'startSafetyTimer',
value: function startSafetyTimer(time, from) {
var _this10 = this;
this.player.debug.log('Safety timer invoked from: ' + from);
this.safetyTimer = setTimeout(function () {
_this10.cancel();
_this10.clearSafetyTimer('startSafetyTimer()');
}, time);
}
/**
* Clear our safety timer(s)
* @param {string} from
*/
}, {
key: 'clearSafetyTimer',
value: function clearSafetyTimer(from) {
if (!utils.is.nullOrUndefined(this.safetyTimer)) {
this.player.debug.log('Safety timer cleared from: ' + from);
clearTimeout(this.safetyTimer);
this.safetyTimer = null;
}
}
}]);
return Ads;
}();
// ==========================================================================
// Plyr Event Listeners
// ==========================================================================
// Sniff out the browser
var browser$2 = utils.getBrowser();
var listeners = {
// Global listeners
global: function global() {
var _this = this;
var last = null;
// Get the key code for an event
var getKeyCode = function getKeyCode(event) {
return event.keyCode ? event.keyCode : event.which;
};
// Handle key press
var handleKey = function handleKey(event) {
var code = getKeyCode(event);
var pressed = event.type === 'keydown';
var repeat = pressed && code === last;
// Bail if a modifier key is set
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
return;
}
// If the event is bubbled from the media element
// Firefox doesn't get the keycode for whatever reason
if (!utils.is.number(code)) {
return;
}
// Seek by the number keys
var seekByKey = function seekByKey() {
// Divide the max duration into 10th's and times by the number value
_this.currentTime = _this.duration / 10 * (code - 48);
};
// Handle the key on keydown
// Reset on keyup
if (pressed) {
// Which keycodes should we prevent default
var preventDefault = [48, 49, 50, 51, 52, 53, 54, 56, 57, 32, 75, 38, 40, 77, 39, 37, 70, 67, 73, 76, 79];
// Check focused element
// and if the focused element is not editable (e.g. text input)
// and any that accept key input http://webaim.org/techniques/keyboard/
var focused = utils.getFocusElement();
if (utils.is.element(focused) && utils.matches(focused, _this.config.selectors.editable)) {
return;
}
// If the code is found prevent default (e.g. prevent scrolling for arrows)
if (preventDefault.includes(code)) {
event.preventDefault();
event.stopPropagation();
}
switch (code) {
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
// 0-9
if (!repeat) {
seekByKey();
}
break;
case 32:
case 75:
// Space and K key
if (!repeat) {
_this.togglePlay();
}
break;
case 38:
// Arrow up
_this.increaseVolume(0.1);
break;
case 40:
// Arrow down
_this.decreaseVolume(0.1);
break;
case 77:
// M key
if (!repeat) {
_this.muted = !_this.muted;
}
break;
case 39:
// Arrow forward
_this.forward();
break;
case 37:
// Arrow back
_this.rewind();
break;
case 70:
// F key
_this.fullscreen.toggle();
break;
case 67:
// C key
if (!repeat) {
_this.toggleCaptions();
}
break;
case 76:
// L key
_this.loop = !_this.loop;
break;
/* case 73:
this.setLoop('start');
break;
case 76:
this.setLoop();
break;
case 79:
this.setLoop('end');
break; */
default:
break;
}
// Escape is handle natively when in full screen
// So we only need to worry about non native
if (!_this.fullscreen.enabled && _this.fullscreen.active && code === 27) {
_this.fullscreen.toggle();
}
// Store last code for next cycle
last = code;
} else {
last = null;
}
};
// Keyboard shortcuts
if (this.config.keyboard.global) {
utils.on(window, 'keydown keyup', handleKey, false);
} else if (this.config.keyboard.focused) {
utils.on(this.elements.container, 'keydown keyup', handleKey, false);
}
// Detect tab focus
// Remove class on blur/focusout
utils.on(this.elements.container, 'focusout', function (event) {
utils.toggleClass(event.target, _this.config.classNames.tabFocus, false);
});
// Add classname to tabbed elements
utils.on(this.elements.container, 'keydown', function (event) {
if (event.keyCode !== 9) {
return;
}
// Delay the adding of classname until the focus has changed
// This event fires before the focusin event
setTimeout(function () {
utils.toggleClass(utils.getFocusElement(), _this.config.classNames.tabFocus, true);
}, 0);
});
// Toggle controls visibility based on mouse movement
if (this.config.hideControls) {
// Toggle controls on mouse events and entering fullscreen
utils.on(this.elements.container, 'mouseenter mouseleave mousemove touchstart touchend touchmove enterfullscreen exitfullscreen', function (event) {
_this.toggleControls(event);
});
}
},
// Listen for media events
media: function media() {
var _this2 = this;
// Time change on media
utils.on(this.media, 'timeupdate seeking', function (event) {
return ui.timeUpdate.call(_this2, event);
});
// Display duration
utils.on(this.media, 'durationchange loadedmetadata', function (event) {
return ui.durationUpdate.call(_this2, event);
});
// Check for audio tracks on load
// We can't use `loadedmetadata` as it doesn't seem to have audio tracks at that point
utils.on(this.media, 'loadeddata', function () {
utils.toggleHidden(_this2.elements.volume, !_this2.hasAudio);
utils.toggleHidden(_this2.elements.buttons.mute, !_this2.hasAudio);
});
// Handle the media finishing
utils.on(this.media, 'ended', function () {
// Show poster on end
if (_this2.isHTML5 && _this2.isVideo && _this2.config.showPosterOnEnd) {
// Restart
_this2.restart();
// Re-load media
_this2.media.load();
}
});
// Check for buffer progress
utils.on(this.media, 'progress playing', function (event) {
return ui.updateProgress.call(_this2, event);
});
// Handle native mute
utils.on(this.media, 'volumechange', function (event) {
return ui.updateVolume.call(_this2, event);
});
// Handle native play/pause
utils.on(this.media, 'playing play pause ended', function (event) {
return ui.checkPlaying.call(_this2, event);
});
// Loading
utils.on(this.media, 'waiting canplay seeked playing', function (event) {
return ui.checkLoading.call(_this2, event);
});
// Check if media failed to load
// utils.on(this.media, 'play', event => ui.checkFailed.call(this, event));
// Click video
if (this.supported.ui && this.config.clickToPlay && !this.isAudio) {
// Re-fetch the wrapper
var wrapper = utils.getElement.call(this, '.' + this.config.classNames.video);
// Bail if there's no wrapper (this should never happen)
if (!utils.is.element(wrapper)) {
return;
}
// On click play, pause ore restart
utils.on(wrapper, 'click', function () {
// Touch devices will just show controls (if we're hiding controls)
if (_this2.config.hideControls && support.touch && !_this2.paused) {
return;
}
if (_this2.paused) {
_this2.play();
} else if (_this2.ended) {
_this2.restart();
_this2.play();
} else {
_this2.pause();
}
});
}
// Disable right click
if (this.supported.ui && this.config.disableContextMenu) {
utils.on(this.media, 'contextmenu', function (event) {
event.preventDefault();
}, false);
}
// Volume change
utils.on(this.media, 'volumechange', function () {
// Save to storage
_this2.storage.set({ volume: _this2.volume, muted: _this2.muted });
});
// Speed change
utils.on(this.media, 'ratechange', function () {
// Update UI
controls.updateSetting.call(_this2, 'speed');
// Save to storage
_this2.storage.set({ speed: _this2.speed });
});
// Quality change
utils.on(this.media, 'qualitychange', function () {
// Update UI
controls.updateSetting.call(_this2, 'quality');
// Save to storage
_this2.storage.set({ quality: _this2.quality });
});
// Caption language change
utils.on(this.media, 'languagechange', function () {
// Update UI
controls.updateSetting.call(_this2, 'captions');
// Save to storage
_this2.storage.set({ language: _this2.language });
});
// Captions toggle
utils.on(this.media, 'captionsenabled captionsdisabled', function () {
// Update UI
controls.updateSetting.call(_this2, 'captions');
// Save to storage
_this2.storage.set({ captions: _this2.captions.active });
});
// Proxy events to container
// Bubble up key events for Edge
utils.on(this.media, this.config.events.concat(['keyup', 'keydown']).join(' '), function (event) {
var detail = {};
// Get error details from media
if (event.type === 'error') {
detail = _this2.media.error;
}
utils.dispatchEvent.call(_this2, _this2.elements.container, event.type, true, detail);
});
},
// Listen for control events
controls: function controls$$1() {
var _this3 = this;
// IE doesn't support input event, so we fallback to change
var inputEvent = browser$2.isIE ? 'change' : 'input';
// Trigger custom and default handlers
var proxy = function proxy(event, handlerKey, defaultHandler) {
var customHandler = _this3.config.listeners[handlerKey];
// Execute custom handler
if (utils.is.function(customHandler)) {
customHandler.call(_this3, event);
}
// Only call default handler if not prevented in custom handler
if (!event.defaultPrevented && utils.is.function(defaultHandler)) {
defaultHandler.call(_this3, event);
}
};
// Play/pause toggle
utils.on(this.elements.buttons.play, 'click', function (event) {
return proxy(event, 'play', function () {
_this3.togglePlay();
});
});
// Pause
utils.on(this.elements.buttons.restart, 'click', function (event) {
return proxy(event, 'restart', function () {
_this3.restart();
});
});
// Rewind
utils.on(this.elements.buttons.rewind, 'click', function (event) {
return proxy(event, 'rewind', function () {
_this3.rewind();
});
});
// Rewind
utils.on(this.elements.buttons.forward, 'click', function (event) {
return proxy(event, 'forward', function () {
_this3.forward();
});
});
// Mute toggle
utils.on(this.elements.buttons.mute, 'click', function (event) {
return proxy(event, 'mute', function () {
_this3.muted = !_this3.muted;
});
});
// Captions toggle
utils.on(this.elements.buttons.captions, 'click', function (event) {
return proxy(event, 'captions', function () {
_this3.toggleCaptions();
});
});
// Fullscreen toggle
utils.on(this.elements.buttons.fullscreen, 'click', function (event) {
return proxy(event, 'fullscreen', function () {
_this3.fullscreen.toggle();
});
});
// Picture-in-Picture
utils.on(this.elements.buttons.pip, 'click', function (event) {
return proxy(event, 'pip', function () {
_this3.pip = 'toggle';
});
});
// Airplay
utils.on(this.elements.buttons.airplay, 'click', function (event) {
return proxy(event, 'airplay', function () {
_this3.airplay();
});
});
// Settings menu
utils.on(this.elements.buttons.settings, 'click', function (event) {
controls.toggleMenu.call(_this3, event);
});
// Click anywhere closes menu
utils.on(document.documentElement, 'click', function (event) {
controls.toggleMenu.call(_this3, event);
});
// Settings menu
utils.on(this.elements.settings.form, 'click', function (event) {
event.stopPropagation();
// Settings menu items - use event delegation as items are added/removed
if (utils.matches(event.target, _this3.config.selectors.inputs.language)) {
proxy(event, 'language', function () {
_this3.language = event.target.value;
});
} else if (utils.matches(event.target, _this3.config.selectors.inputs.quality)) {
proxy(event, 'quality', function () {
_this3.quality = event.target.value;
});
} else if (utils.matches(event.target, _this3.config.selectors.inputs.speed)) {
proxy(event, 'speed', function () {
_this3.speed = parseFloat(event.target.value);
});
} else {
controls.showTab.call(_this3, event);
}
});
// Seek
utils.on(this.elements.inputs.seek, inputEvent, function (event) {
return proxy(event, 'seek', function () {
_this3.currentTime = event.target.value / event.target.max * _this3.duration;
});
});
// Current time invert
// Only if one time element is used for both currentTime and duration
if (this.config.toggleInvert && !utils.is.element(this.elements.display.duration)) {
utils.on(this.elements.display.currentTime, 'click', function () {
// Do nothing if we're at the start
if (_this3.currentTime === 0) {
return;
}
_this3.config.invertTime = !_this3.config.invertTime;
ui.timeUpdate.call(_this3);
});
}
// Volume
utils.on(this.elements.inputs.volume, inputEvent, function (event) {
return proxy(event, 'volume', function () {
_this3.volume = event.target.value;
});
});
// Polyfill for lower fill in <input type="range"> for webkit
if (browser$2.isWebkit) {
utils.on(utils.getElements.call(this, 'input[type="range"]'), 'input', function (event) {
controls.updateRangeFill.call(_this3, event.target);
});
}
// Seek tooltip
utils.on(this.elements.progress, 'mouseenter mouseleave mousemove', function (event) {
return controls.updateSeekTooltip.call(_this3, event);
});
// Toggle controls visibility based on mouse movement
if (this.config.hideControls) {
// Watch for cursor over controls so they don't hide when trying to interact
utils.on(this.elements.controls, 'mouseenter mouseleave', function (event) {
_this3.elements.controls.hover = event.type === 'mouseenter';
});
// Watch for cursor over controls so they don't hide when trying to interact
utils.on(this.elements.controls, 'mousedown mouseup touchstart touchend touchcancel', function (event) {
_this3.elements.controls.pressed = ['mousedown', 'touchstart'].includes(event.type);
});
// Focus in/out on controls
utils.on(this.elements.controls, 'focusin focusout', function (event) {
_this3.toggleControls(event);
});
}
// Mouse wheel for volume
utils.on(this.elements.inputs.volume, 'wheel', function (event) {
return proxy(event, 'volume', function () {
// Detect "natural" scroll - suppored on OS X Safari only
// Other browsers on OS X will be inverted until support improves
var inverted = event.webkitDirectionInvertedFromDevice;
var step = 1 / 50;
var direction = 0;
// Scroll down (or up on natural) to decrease
if (event.deltaY < 0 || event.deltaX > 0) {
if (inverted) {
_this3.decreaseVolume(step);
direction = -1;
} else {
_this3.increaseVolume(step);
direction = 1;
}
}
// Scroll up (or down on natural) to increase
if (event.deltaY > 0 || event.deltaX < 0) {
if (inverted) {
_this3.increaseVolume(step);
direction = 1;
} else {
_this3.decreaseVolume(step);
direction = -1;
}
}
// Don't break page scrolling at max and min
if (direction === 1 && _this3.media.volume < 1 || direction === -1 && _this3.media.volume > 0) {
event.preventDefault();
}
});
}, false);
}
};
// ==========================================================================
// Plyr UI
// ==========================================================================
var ui = {
addStyleHook: function addStyleHook() {
utils.toggleClass(this.elements.container, this.config.selectors.container.replace('.', ''), true);
utils.toggleClass(this.elements.container, this.config.classNames.uiSupported, this.supported.ui);
},
// Toggle native HTML5 media controls
toggleNativeControls: function toggleNativeControls() {
var toggle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
if (toggle && this.isHTML5) {
this.media.setAttribute('controls', '');
} else {
this.media.removeAttribute('controls');
}
},
// Setup the UI
build: function build() {
var _this = this;
// Re-attach media element listeners
// TODO: Use event bubbling
listeners.media.call(this);
// Don't setup interface if no support
if (!this.supported.ui) {
this.debug.warn('Basic support only for ' + this.provider + ' ' + this.type);
// Restore native controls
ui.toggleNativeControls.call(this, true);
// Bail
return;
}
// Inject custom controls if not present
if (!utils.is.element(this.elements.controls)) {
// Inject custom controls
controls.inject.call(this);
// Re-attach control listeners
listeners.controls.call(this);
}
// If there's no controls, bail
if (!utils.is.element(this.elements.controls)) {
return;
}
// Remove native controls
ui.toggleNativeControls.call(this);
// Captions
captions.setup.call(this);
// Reset volume
this.volume = null;
// Reset mute state
this.muted = null;
// Reset speed
this.speed = null;
// Reset loop state
this.loop = null;
// Reset quality options
this.options.quality = [];
// Reset time display
ui.timeUpdate.call(this);
// Update the UI
ui.checkPlaying.call(this);
// Ready for API calls
this.ready = true;
// Ready event at end of execution stack
setTimeout(function () {
utils.dispatchEvent.call(_this, _this.media, 'ready');
}, 0);
// Set the title
ui.setTitle.call(this);
},
// Setup aria attribute for play and iframe title
setTitle: function setTitle() {
// Find the current text
var label = this.config.i18n.play;
// If there's a media title set, use that for the label
if (utils.is.string(this.config.title) && !utils.is.empty(this.config.title)) {
label += ', ' + this.config.title;
// Set container label
this.elements.container.setAttribute('aria-label', this.config.title);
}
// If there's a play button, set label
if (utils.is.nodeList(this.elements.buttons.play)) {
Array.from(this.elements.buttons.play).forEach(function (button) {
button.setAttribute('aria-label', label);
});
}
// Set iframe title
// https://github.com/sampotts/plyr/issues/124
if (this.isEmbed) {
var iframe = utils.getElement.call(this, 'iframe');
if (!utils.is.element(iframe)) {
return;
}
// Default to media type
var title = !utils.is.empty(this.config.title) ? this.config.title : 'video';
iframe.setAttribute('title', this.config.i18n.frameTitle.replace('{title}', title));
}
},
// Check playing state
checkPlaying: function checkPlaying() {
// Class hooks
utils.toggleClass(this.elements.container, this.config.classNames.playing, this.playing);
utils.toggleClass(this.elements.container, this.config.classNames.stopped, this.paused);
// Set ARIA state
utils.toggleState(this.elements.buttons.play, this.playing);
// Toggle controls
this.toggleControls(!this.playing);
},
// Check if media is loading
checkLoading: function checkLoading(event) {
var _this2 = this;
this.loading = ['stalled', 'waiting'].includes(event.type);
// Clear timer
clearTimeout(this.timers.loading);
// Timer to prevent flicker when seeking
this.timers.loading = setTimeout(function () {
// Toggle container class hook
utils.toggleClass(_this2.elements.container, _this2.config.classNames.loading, _this2.loading);
// Show controls if loading, hide if done
_this2.toggleControls(_this2.loading);
}, this.loading ? 250 : 0);
},
// Check if media failed to load
checkFailed: function checkFailed() {
var _this3 = this;
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/networkState
this.failed = this.media.networkState === 3;
if (this.failed) {
utils.toggleClass(this.elements.container, this.config.classNames.loading, false);
utils.toggleClass(this.elements.container, this.config.classNames.error, true);
}
// Clear timer
clearTimeout(this.timers.failed);
// Timer to prevent flicker when seeking
this.timers.loading = setTimeout(function () {
// Toggle container class hook
utils.toggleClass(_this3.elements.container, _this3.config.classNames.loading, _this3.loading);
// Show controls if loading, hide if done
_this3.toggleControls(_this3.loading);
}, this.loading ? 250 : 0);
},
// Update volume UI and storage
updateVolume: function updateVolume() {
if (!this.supported.ui) {
return;
}
// Update range
if (utils.is.element(this.elements.inputs.volume)) {
ui.setRange.call(this, this.elements.inputs.volume, this.muted ? 0 : this.volume);
}
// Update mute state
if (utils.is.element(this.elements.buttons.mute)) {
utils.toggleState(this.elements.buttons.mute, this.muted || this.volume === 0);
}
},
// Update seek value and lower fill
setRange: function setRange(target) {
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
if (!utils.is.element(target)) {
return;
}
// eslint-disable-next-line
target.value = value;
// Webkit range fill
controls.updateRangeFill.call(this, target);
},
// Set <progress> value
setProgress: function setProgress(target, input) {
var value = utils.is.number(input) ? input : 0;
var progress = utils.is.element(target) ? target : this.elements.display.buffer;
// Update value and label
if (utils.is.element(progress)) {
progress.value = value;
// Update text label inside
var label = progress.getElementsByTagName('span')[0];
if (utils.is.element(label)) {
label.childNodes[0].nodeValue = value;
}
}
},
// Update <progress> elements
updateProgress: function updateProgress(event) {
var _this4 = this;
if (!this.supported.ui || !utils.is.event(event)) {
return;
}
var value = 0;
if (event) {
switch (event.type) {
// Video playing
case 'timeupdate':
case 'seeking':
value = utils.getPercentage(this.currentTime, this.duration);
// Set seek range value only if it's a 'natural' time event
if (event.type === 'timeupdate') {
ui.setRange.call(this, this.elements.inputs.seek, value);
}
break;
// Check buffer status
case 'playing':
case 'progress':
value = function () {
var buffered = _this4.media.buffered;
if (buffered && buffered.length) {
// HTML5
return utils.getPercentage(buffered.end(0), _this4.duration);
} else if (utils.is.number(buffered)) {
// YouTube returns between 0 and 1
return buffered * 100;
}
return 0;
}();
ui.setProgress.call(this, this.elements.display.buffer, value);
break;
default:
break;
}
}
},
// Update the displayed time
updateTimeDisplay: function updateTimeDisplay() {
var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var inverted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
// Bail if there's no element to display or the value isn't a number
if (!utils.is.element(target) || !utils.is.number(time)) {
return;
}
// Always display hours if duration is over an hour
var displayHours = utils.getHours(this.duration) > 0;
// eslint-disable-next-line no-param-reassign
target.textContent = utils.formatTime(time, displayHours, inverted);
},
// Handle time change event
timeUpdate: function timeUpdate(event) {
// Only invert if only one time element is displayed and used for both duration and currentTime
var invert = !utils.is.element(this.elements.display.duration) && this.config.invertTime;
// Duration
ui.updateTimeDisplay.call(this, this.elements.display.currentTime, invert ? this.duration - this.currentTime : this.currentTime, invert);
// Ignore updates while seeking
if (event && event.type === 'timeupdate' && this.media.seeking) {
return;
}
// Playing progress
ui.updateProgress.call(this, event);
},
// Show the duration on metadataloaded
durationUpdate: function durationUpdate() {
if (!this.supported.ui) {
return;
}
// If there's a spot to display duration
var hasDuration = utils.is.element(this.elements.display.duration);
// If there's only one time display, display duration there
if (!hasDuration && this.config.displayDuration && this.paused) {
ui.updateTimeDisplay.call(this, this.elements.display.currentTime, this.duration);
}
// If there's a duration element, update content
if (hasDuration) {
ui.updateTimeDisplay.call(this, this.elements.display.duration, this.duration);
}
// Update the tooltip (if visible)
controls.updateSeekTooltip.call(this);
}
};
// ==========================================================================
// Plyr controls
// ==========================================================================
// Sniff out the browser
var browser$1 = utils.getBrowser();
var controls = {
// Webkit polyfill for lower fill range
updateRangeFill: function updateRangeFill(target) {
// WebKit only
if (!browser$1.isWebkit) {
return;
}
// Get range from event if event passed
var range = utils.is.event(target) ? target.target : target;
// Needs to be a valid <input type='range'>
if (!utils.is.element(range) || range.getAttribute('type') !== 'range') {
return;
}
// Set CSS custom property
range.style.setProperty('--value', range.value / range.max * 100 + '%');
},
// Get icon URL
getIconUrl: function getIconUrl() {
return {
url: this.config.iconUrl,
absolute: this.config.iconUrl.indexOf('http') === 0 || browser$1.isIE && !window.svg4everybody
};
},
// Create <svg> icon
createIcon: function createIcon(type, attributes) {
var namespace = 'http://www.w3.org/2000/svg';
var iconUrl = controls.getIconUrl.call(this);
var iconPath = (!iconUrl.absolute ? iconUrl.url : '') + '#' + this.config.iconPrefix;
// Create <svg>
var icon = document.createElementNS(namespace, 'svg');
utils.setAttributes(icon, utils.extend(attributes, {
role: 'presentation'
}));
// Create the <use> to reference sprite
var use = document.createElementNS(namespace, 'use');
var path = iconPath + '-' + type;
// Set `href` attributes
// https://github.com/sampotts/plyr/issues/460
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href
if ('href' in use) {
use.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
} else {
use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
}
// Add <use> to <svg>
icon.appendChild(use);
return icon;
},
// Create hidden text label
createLabel: function createLabel(type, attr) {
var text = this.config.i18n[type];
var attributes = Object.assign({}, attr);
switch (type) {
case 'pip':
text = 'PIP';
break;
case 'airplay':
text = 'AirPlay';
break;
default:
break;
}
if ('class' in attributes) {
attributes.class += ' ' + this.config.classNames.hidden;
} else {
attributes.class = this.config.classNames.hidden;
}
return utils.createElement('span', attributes, text);
},
// Create a badge
createBadge: function createBadge(text) {
if (utils.is.empty(text)) {
return null;
}
var badge = utils.createElement('span', {
class: this.config.classNames.menu.value
});
badge.appendChild(utils.createElement('span', {
class: this.config.classNames.menu.badge
}, text));
return badge;
},
// Create a <button>
createButton: function createButton(buttonType, attr) {
var button = utils.createElement('button');
var attributes = Object.assign({}, attr);
var type = buttonType;
var toggle = false;
var label = void 0;
var icon = void 0;
var labelPressed = void 0;
var iconPressed = void 0;
if (!('type' in attributes)) {
attributes.type = 'button';
}
if ('class' in attributes) {
if (attributes.class.includes(this.config.classNames.control)) {
attributes.class += ' ' + this.config.classNames.control;
}
} else {
attributes.class = this.config.classNames.control;
}
// Large play button
switch (type) {
case 'play':
toggle = true;
label = 'play';
labelPressed = 'pause';
icon = 'play';
iconPressed = 'pause';
break;
case 'mute':
toggle = true;
label = 'mute';
labelPressed = 'unmute';
icon = 'volume';
iconPressed = 'muted';
break;
case 'captions':
toggle = true;
label = 'enableCaptions';
labelPressed = 'disableCaptions';
icon = 'captions-off';
iconPressed = 'captions-on';
break;
case 'fullscreen':
toggle = true;
label = 'enterFullscreen';
labelPressed = 'exitFullscreen';
icon = 'enter-fullscreen';
iconPressed = 'exit-fullscreen';
break;
case 'play-large':
attributes.class += ' ' + this.config.classNames.control + '--overlaid';
type = 'play';
label = 'play';
icon = 'play';
break;
default:
label = type;
icon = type;
}
// Setup toggle icon and labels
if (toggle) {
// Icon
button.appendChild(controls.createIcon.call(this, iconPressed, { class: 'icon--pressed' }));
button.appendChild(controls.createIcon.call(this, icon, { class: 'icon--not-pressed' }));
// Label/Tooltip
button.appendChild(controls.createLabel.call(this, labelPressed, { class: 'label--pressed' }));
button.appendChild(controls.createLabel.call(this, label, { class: 'label--not-pressed' }));
// Add aria attributes
attributes['aria-pressed'] = false;
attributes['aria-label'] = this.config.i18n[label];
} else {
button.appendChild(controls.createIcon.call(this, icon));
button.appendChild(controls.createLabel.call(this, label));
}
// Merge attributes
utils.extend(attributes, utils.getAttributesFromSelector(this.config.selectors.buttons[type], attributes));
utils.setAttributes(button, attributes);
// We have multiple play buttons
if (type === 'play') {
if (!utils.is.array(this.elements.buttons[type])) {
this.elements.buttons[type] = [];
}
this.elements.buttons[type].push(button);
} else {
this.elements.buttons[type] = button;
}
return button;
},
// Create an <input type='range'>
createRange: function createRange(type, attributes) {
// Seek label
var label = utils.createElement('label', {
for: attributes.id,
class: this.config.classNames.hidden
}, this.config.i18n[type]);
// Seek input
var input = utils.createElement('input', utils.extend(utils.getAttributesFromSelector(this.config.selectors.inputs[type]), {
type: 'range',
min: 0,
max: 100,
step: 0.01,
value: 0,
autocomplete: 'off'
}, attributes));
this.elements.inputs[type] = input;
// Set the fill for webkit now
controls.updateRangeFill.call(this, input);
return {
label: label,
input: input
};
},
// Create a <progress>
createProgress: function createProgress(type, attributes) {
var progress = utils.createElement('progress', utils.extend(utils.getAttributesFromSelector(this.config.selectors.display[type]), {
min: 0,
max: 100,
value: 0
}, attributes));
// Create the label inside
if (type !== 'volume') {
progress.appendChild(utils.createElement('span', null, '0'));
var suffix = '';
switch (type) {
case 'played':
suffix = this.config.i18n.played;
break;
case 'buffer':
suffix = this.config.i18n.buffered;
break;
default:
break;
}
progress.textContent = '% ' + suffix.toLowerCase();
}
this.elements.display[type] = progress;
return progress;
},
// Create time display
createTime: function createTime(type) {
var container = utils.createElement('div', {
class: 'plyr__time'
});
container.appendChild(utils.createElement('span', {
class: this.config.classNames.hidden
}, this.config.i18n[type]));
container.appendChild(utils.createElement('span', utils.getAttributesFromSelector(this.config.selectors.display[type]), '00:00'));
this.elements.display[type] = container;
return container;
},
// Create a settings menu item
createMenuItem: function createMenuItem(value, list, type, title) {
var badge = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
var checked = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
var item = utils.createElement('li');
var label = utils.createElement('label', {
class: this.config.classNames.control
});
var radio = utils.createElement('input', utils.extend(utils.getAttributesFromSelector(this.config.selectors.inputs[type]), {
type: 'radio',
name: 'plyr-' + type,
value: value,
checked: checked,
class: 'plyr__sr-only'
}));
var faux = utils.createElement('span', { 'aria-hidden': true });
label.appendChild(radio);
label.appendChild(faux);
label.insertAdjacentHTML('beforeend', title);
if (utils.is.element(badge)) {
label.appendChild(badge);
}
item.appendChild(label);
list.appendChild(item);
},
// Update hover tooltip for seeking
updateSeekTooltip: function updateSeekTooltip(event) {
// Bail if setting not true
if (!this.config.tooltips.seek || !utils.is.element(this.elements.inputs.seek) || !utils.is.element(this.elements.display.seekTooltip) || this.duration === 0) {
return;
}
// Calculate percentage
var percent = 0;
var clientRect = this.elements.inputs.seek.getBoundingClientRect();
var visible = this.config.classNames.tooltip + '--visible';
// Determine percentage, if already visible
if (utils.is.event(event)) {
percent = 100 / clientRect.width * (event.pageX - clientRect.left);
} else if (utils.hasClass(this.elements.display.seekTooltip, visible)) {
percent = parseFloat(this.elements.display.seekTooltip.style.left, 10);
} else {
return;
}
// Set bounds
if (percent < 0) {
percent = 0;
} else if (percent > 100) {
percent = 100;
}
// Display the time a click would seek to
ui.updateTimeDisplay.call(this, this.elements.display.seekTooltip, this.duration / 100 * percent);
// Set position
this.elements.display.seekTooltip.style.left = percent + '%';
// Show/hide the tooltip
// If the event is a moues in/out and percentage is inside bounds
if (utils.is.event(event) && ['mouseenter', 'mouseleave'].includes(event.type)) {
utils.toggleClass(this.elements.display.seekTooltip, visible, event.type === 'mouseenter');
}
},
// Hide/show a tab
toggleTab: function toggleTab(setting, toggle) {
var tab = this.elements.settings.tabs[setting];
var pane = this.elements.settings.panes[setting];
utils.toggleHidden(tab, !toggle);
utils.toggleHidden(pane, !toggle);
},
// Set the YouTube quality menu
// TODO: Support for HTML5
setQualityMenu: function setQualityMenu(options) {
var _this = this;
var type = 'quality';
var list = this.elements.settings.panes.quality.querySelector('ul');
// Set options if passed and filter based on config
if (utils.is.array(options)) {
this.options.quality = options.filter(function (quality) {
return _this.config.quality.options.includes(quality);
});
} else {
this.options.quality = this.config.quality.options;
}
// Toggle the pane and tab
var toggle = !utils.is.empty(this.options.quality) && this.isYouTube;
controls.toggleTab.call(this, type, toggle);
// If we're hiding, nothing more to do
if (!toggle) {
return;
}
// Empty the menu
utils.emptyElement(list);
// Get the badge HTML for HD, 4K etc
var getBadge = function getBadge(quality) {
var label = '';
switch (quality) {
case 'hd2160':
label = '4K';
break;
case 'hd1440':
label = 'WQHD';
break;
case 'hd1080':
label = 'HD';
break;
case 'hd720':
label = 'HD';
break;
default:
break;
}
if (!label.length) {
return null;
}
return controls.createBadge.call(_this, label);
};
this.options.quality.forEach(function (quality) {
return controls.createMenuItem.call(_this, quality, list, type, controls.getLabel.call(_this, 'quality', quality), getBadge(quality));
});
controls.updateSetting.call(this, type, list);
},
// Translate a value into a nice label
// TODO: Localisation
getLabel: function getLabel(setting, value) {
switch (setting) {
case 'speed':
return value === 1 ? 'Normal' : value + '×';
case 'quality':
switch (value) {
case 'hd2160':
return '2160P';
case 'hd1440':
return '1440P';
case 'hd1080':
return '1080P';
case 'hd720':
return '720P';
case 'large':
return '480P';
case 'medium':
return '360P';
case 'small':
return '240P';
case 'tiny':
return 'Tiny';
case 'default':
return 'Auto';
default:
return value;
}
case 'captions':
return controls.getLanguage.call(this);
default:
return null;
}
},
// Update the selected setting
updateSetting: function updateSetting(setting, container) {
var pane = this.elements.settings.panes[setting];
var value = null;
var list = container;
switch (setting) {
case 'captions':
value = this.captions.active ? this.captions.language : '';
break;
default:
value = this[setting];
// Get default
if (utils.is.empty(value)) {
value = this.config[setting].default;
}
// Unsupported value
if (!this.options[setting].includes(value)) {
this.debug.warn('Unsupported value of \'' + value + '\' for ' + setting);
return;
}
// Disabled value
if (!this.config[setting].options.includes(value)) {
this.debug.warn('Disabled value of \'' + value + '\' for ' + setting);
return;
}
break;
}
// Get the list if we need to
if (!utils.is.element(list)) {
list = pane && pane.querySelector('ul');
}
// Update the label
if (!utils.is.empty(value)) {
var label = this.elements.settings.tabs[setting].querySelector('.' + this.config.classNames.menu.value);
label.innerHTML = controls.getLabel.call(this, setting, value);
}
// Find the radio option
var target = list && list.querySelector('input[value="' + value + '"]');
if (utils.is.element(target)) {
// Check it
target.checked = true;
}
},
// Set the looping options
/* setLoopMenu() {
const options = ['start', 'end', 'all', 'reset'];
const list = this.elements.settings.panes.loop.querySelector('ul');
// Show the pane and tab
utils.toggleHidden(this.elements.settings.tabs.loop, false);
utils.toggleHidden(this.elements.settings.panes.loop, false);
// Toggle the pane and tab
const toggle = !utils.is.empty(this.loop.options);
controls.toggleTab.call(this, 'loop', toggle);
// Empty the menu
utils.emptyElement(list);
options.forEach(option => {
const item = utils.createElement('li');
const button = utils.createElement(
'button',
utils.extend(utils.getAttributesFromSelector(this.config.selectors.buttons.loop), {
type: 'button',
class: this.config.classNames.control,
'data-plyr-loop-action': option,
}),
this.config.i18n[option]
);
if (['start', 'end'].includes(option)) {
const badge = controls.createBadge.call(this, '00:00');
button.appendChild(badge);
}
item.appendChild(button);
list.appendChild(item);
});
}, */
// Get current selected caption language
// TODO: rework this to user the getter in the API?
getLanguage: function getLanguage() {
if (!this.supported.ui) {
return null;
}
if (!support.textTracks || !captions.getTracks.call(this).length) {
return this.config.i18n.none;
}
if (this.captions.active) {
var currentTrack = captions.getCurrentTrack.call(this);
if (utils.is.track(currentTrack)) {
return currentTrack.label;
}
}
return this.config.i18n.disabled;
},
// Set a list of available captions languages
setCaptionsMenu: function setCaptionsMenu() {
var _this2 = this;
// TODO: Captions or language? Currently it's mixed
var type = 'captions';
var list = this.elements.settings.panes.captions.querySelector('ul');
// Toggle the pane and tab
var hasTracks = captions.getTracks.call(this).length;
controls.toggleTab.call(this, type, hasTracks);
// Empty the menu
utils.emptyElement(list);
// If there's no captions, bail
if (!hasTracks) {
return;
}
// Re-map the tracks into just the data we need
var tracks = captions.getTracks.call(this).map(function (track) {
return {
language: track.language,
label: !utils.is.empty(track.label) ? track.label : track.language.toUpperCase()
};
});
// Add the "None" option to turn off captions
tracks.unshift({
language: '',
label: this.config.i18n.none
});
// Generate options
tracks.forEach(function (track) {
controls.createMenuItem.call(_this2, track.language, list, 'language', track.label || track.language, controls.createBadge.call(_this2, track.language.toUpperCase()), track.language.toLowerCase() === _this2.captions.language.toLowerCase());
});
controls.updateSetting.call(this, type, list);
},
// Set a list of available captions languages
setSpeedMenu: function setSpeedMenu() {
var _this3 = this;
var type = 'speed';
// Set the default speeds
if (!utils.is.object(this.options.speed) || !Object.keys(this.options.speed).length) {
this.options.speed = [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
}
// Set options if passed and filter based on config
this.options.speed = this.options.speed.filter(function (speed) {
return _this3.config.speed.options.includes(speed);
});
// Toggle the pane and tab
var toggle = !utils.is.empty(this.options.speed);
controls.toggleTab.call(this, type, toggle);
// If we're hiding, nothing more to do
if (!toggle) {
return;
}
// Get the list to populate
var list = this.elements.settings.panes.speed.querySelector('ul');
// Show the pane and tab
utils.toggleHidden(this.elements.settings.tabs.speed, false);
utils.toggleHidden(this.elements.settings.panes.speed, false);
// Empty the menu
utils.emptyElement(list);
// Create items
this.options.speed.forEach(function (speed) {
return controls.createMenuItem.call(_this3, speed, list, type, controls.getLabel.call(_this3, 'speed', speed));
});
controls.updateSetting.call(this, type, list);
},
// Show/hide menu
toggleMenu: function toggleMenu(event) {
var form = this.elements.settings.form;
var button = this.elements.buttons.settings;
var show = utils.is.boolean(event) ? event : utils.is.element(form) && form.getAttribute('aria-hidden') === 'true';
if (utils.is.event(event)) {
var isMenuItem = utils.is.element(form) && form.contains(event.target);
var isButton = event.target === this.elements.buttons.settings;
// If the click was inside the form or if the click
// wasn't the button or menu item and we're trying to
// show the menu (a doc click shouldn't show the menu)
if (isMenuItem || !isMenuItem && !isButton && show) {
return;
}
// Prevent the toggle being caught by the doc listener
if (isButton) {
event.stopPropagation();
}
}
// Set form and button attributes
if (utils.is.element(button)) {
button.setAttribute('aria-expanded', show);
}
if (utils.is.element(form)) {
form.setAttribute('aria-hidden', !show);
utils.toggleClass(this.elements.container, this.config.classNames.menu.open, show);
if (show) {
form.removeAttribute('tabindex');
} else {
form.setAttribute('tabindex', -1);
}
}
},
// Get the natural size of a tab
getTabSize: function getTabSize(tab) {
var clone = tab.cloneNode(true);
clone.style.position = 'absolute';
clone.style.opacity = 0;
clone.setAttribute('aria-hidden', false);
// Prevent input's being unchecked due to the name being identical
Array.from(clone.querySelectorAll('input[name]')).forEach(function (input) {
var name = input.getAttribute('name');
input.setAttribute('name', name + '-clone');
});
// Append to parent so we get the "real" size
tab.parentNode.appendChild(clone);
// Get the sizes before we remove
var width = clone.scrollWidth;
var height = clone.scrollHeight;
// Remove from the DOM
utils.removeElement(clone);
return {
width: width,
height: height
};
},
// Toggle Menu
showTab: function showTab(event) {
var menu = this.elements.settings.menu;
var tab = event.target;
var show = tab.getAttribute('aria-expanded') === 'false';
var pane = document.getElementById(tab.getAttribute('aria-controls'));
// Nothing to show, bail
if (!utils.is.element(pane)) {
return;
}
// Are we targetting a tab? If not, bail
var isTab = pane.getAttribute('role') === 'tabpanel';
if (!isTab) {
return;
}
// Hide all other tabs
// Get other tabs
var current = menu.querySelector('[role="tabpanel"][aria-hidden="false"]');
var container = current.parentNode;
// Set other toggles to be expanded false
Array.from(menu.querySelectorAll('[aria-controls="' + current.getAttribute('id') + '"]')).forEach(function (toggle) {
toggle.setAttribute('aria-expanded', false);
});
// If we can do fancy animations, we'll animate the height/width
if (support.transitions && !support.reducedMotion) {
// Set the current width as a base
container.style.width = current.scrollWidth + 'px';
container.style.height = current.scrollHeight + 'px';
// Get potential sizes
var size = controls.getTabSize.call(this, pane);
// Restore auto height/width
var restore = function restore(e) {
// We're only bothered about height and width on the container
if (e.target !== container || !['width', 'height'].includes(e.propertyName)) {
return;
}
// Revert back to auto
container.style.width = '';
container.style.height = '';
// Only listen once
utils.off(container, utils.transitionEndEvent, restore);
};
// Listen for the transition finishing and restore auto height/width
utils.on(container, utils.transitionEndEvent, restore);
// Set dimensions to target
container.style.width = size.width + 'px';
container.style.height = size.height + 'px';
}
// Set attributes on current tab
current.setAttribute('aria-hidden', true);
current.setAttribute('tabindex', -1);
// Set attributes on target
pane.setAttribute('aria-hidden', !show);
tab.setAttribute('aria-expanded', show);
pane.removeAttribute('tabindex');
// Focus the first item
pane.querySelectorAll('button:not(:disabled), input:not(:disabled), [tabindex]')[0].focus();
},
// Build the default HTML
// TODO: Set order based on order in the config.controls array?
create: function create(data) {
var _this4 = this;
// Do nothing if we want no controls
if (utils.is.empty(this.config.controls)) {
return null;
}
// Create the container
var container = utils.createElement('div', utils.getAttributesFromSelector(this.config.selectors.controls.wrapper));
// Restart button
if (this.config.controls.includes('restart')) {
container.appendChild(controls.createButton.call(this, 'restart'));
}
// Rewind button
if (this.config.controls.includes('rewind')) {
container.appendChild(controls.createButton.call(this, 'rewind'));
}
// Play/Pause button
if (this.config.controls.includes('play')) {
container.appendChild(controls.createButton.call(this, 'play'));
}
// Fast forward button
if (this.config.controls.includes('fast-forward')) {
container.appendChild(controls.createButton.call(this, 'fast-forward'));
}
// Progress
if (this.config.controls.includes('progress')) {
var progress = utils.createElement('div', utils.getAttributesFromSelector(this.config.selectors.progress));
// Seek range slider
var seek = controls.createRange.call(this, 'seek', {
id: 'plyr-seek-' + data.id
});
progress.appendChild(seek.label);
progress.appendChild(seek.input);
// Buffer progress
progress.appendChild(controls.createProgress.call(this, 'buffer'));
// TODO: Add loop display indicator
// Seek tooltip
if (this.config.tooltips.seek) {
var tooltip = utils.createElement('span', {
role: 'tooltip',
class: this.config.classNames.tooltip
}, '00:00');
progress.appendChild(tooltip);
this.elements.display.seekTooltip = tooltip;
}
this.elements.progress = progress;
container.appendChild(this.elements.progress);
}
// Media current time display
if (this.config.controls.includes('current-time')) {
container.appendChild(controls.createTime.call(this, 'currentTime'));
}
// Media duration display
if (this.config.controls.includes('duration')) {
container.appendChild(controls.createTime.call(this, 'duration'));
}
// Toggle mute button
if (this.config.controls.includes('mute')) {
container.appendChild(controls.createButton.call(this, 'mute'));
}
// Volume range control
if (this.config.controls.includes('volume')) {
var volume = utils.createElement('div', {
class: 'plyr__volume'
});
// Set the attributes
var attributes = {
max: 1,
step: 0.05,
value: this.config.volume
};
// Create the volume range slider
var range = controls.createRange.call(this, 'volume', utils.extend(attributes, {
id: 'plyr-volume-' + data.id
}));
volume.appendChild(range.label);
volume.appendChild(range.input);
this.elements.volume = volume;
container.appendChild(volume);
}
// Toggle captions button
if (this.config.controls.includes('captions')) {
container.appendChild(controls.createButton.call(this, 'captions'));
}
// Settings button / menu
if (this.config.controls.includes('settings') && !utils.is.empty(this.config.settings)) {
var menu = utils.createElement('div', {
class: 'plyr__menu'
});
menu.appendChild(controls.createButton.call(this, 'settings', {
id: 'plyr-settings-toggle-' + data.id,
'aria-haspopup': true,
'aria-controls': 'plyr-settings-' + data.id,
'aria-expanded': false
}));
var form = utils.createElement('form', {
class: 'plyr__menu__container',
id: 'plyr-settings-' + data.id,
'aria-hidden': true,
'aria-labelled-by': 'plyr-settings-toggle-' + data.id,
role: 'tablist',
tabindex: -1
});
var inner = utils.createElement('div');
var home = utils.createElement('div', {
id: 'plyr-settings-' + data.id + '-home',
'aria-hidden': false,
'aria-labelled-by': 'plyr-settings-toggle-' + data.id,
role: 'tabpanel'
});
// Create the tab list
var tabs = utils.createElement('ul', {
role: 'tablist'
});
// Build the tabs
this.config.settings.forEach(function (type) {
var tab = utils.createElement('li', {
role: 'tab',
hidden: ''
});
var button = utils.createElement('button', utils.extend(utils.getAttributesFromSelector(_this4.config.selectors.buttons.settings), {
type: 'button',
class: _this4.config.classNames.control + ' ' + _this4.config.classNames.control + '--forward',
id: 'plyr-settings-' + data.id + '-' + type + '-tab',
'aria-haspopup': true,
'aria-controls': 'plyr-settings-' + data.id + '-' + type,
'aria-expanded': false
}), _this4.config.i18n[type]);
var value = utils.createElement('span', {
class: _this4.config.classNames.menu.value
});
// Speed contains HTML entities
value.innerHTML = data[type];
button.appendChild(value);
tab.appendChild(button);
tabs.appendChild(tab);
_this4.elements.settings.tabs[type] = tab;
});
home.appendChild(tabs);
inner.appendChild(home);
// Build the panes
this.config.settings.forEach(function (type) {
var pane = utils.createElement('div', {
id: 'plyr-settings-' + data.id + '-' + type,
'aria-hidden': true,
'aria-labelled-by': 'plyr-settings-' + data.id + '-' + type + '-tab',
role: 'tabpanel',
tabindex: -1,
hidden: ''
});
var back = utils.createElement('button', {
type: 'button',
class: _this4.config.classNames.control + ' ' + _this4.config.classNames.control + '--back',
'aria-haspopup': true,
'aria-controls': 'plyr-settings-' + data.id + '-home',
'aria-expanded': false
}, _this4.config.i18n[type]);
pane.appendChild(back);
var options = utils.createElement('ul');
pane.appendChild(options);
inner.appendChild(pane);
_this4.elements.settings.panes[type] = pane;
});
form.appendChild(inner);
menu.appendChild(form);
container.appendChild(menu);
this.elements.settings.form = form;
this.elements.settings.menu = menu;
}
// Picture in picture button
if (this.config.controls.includes('pip') && support.pip) {
container.appendChild(controls.createButton.call(this, 'pip'));
}
// Airplay button
if (this.config.controls.includes('airplay') && support.airplay) {
container.appendChild(controls.createButton.call(this, 'airplay'));
}
// Toggle fullscreen button
if (this.config.controls.includes('fullscreen')) {
container.appendChild(controls.createButton.call(this, 'fullscreen'));
}
// Larger overlaid play button
if (this.config.controls.includes('play-large')) {
this.elements.container.appendChild(controls.createButton.call(this, 'play-large'));
}
this.elements.controls = container;
if (this.config.controls.includes('settings') && this.config.settings.includes('speed')) {
controls.setSpeedMenu.call(this);
}
return container;
},
// Insert controls
inject: function inject() {
var _this5 = this;
// Sprite
if (this.config.loadSprite) {
var icon = controls.getIconUrl.call(this);
// Only load external sprite using AJAX
if (icon.absolute) {
utils.loadSprite(icon.url, 'sprite-plyr');
}
}
// Create a unique ID
this.id = Math.floor(Math.random() * 10000);
// Null by default
var container = null;
this.elements.controls = null;
// HTML or Element passed as the option
if (utils.is.string(this.config.controls) || utils.is.element(this.config.controls)) {
container = this.config.controls;
} else if (utils.is.function(this.config.controls)) {
// A custom function to build controls
// The function can return a HTMLElement or String
container = this.config.controls({
id: this.id,
seektime: this.config.seekTime,
title: this.config.title
});
} else {
// Create controls
container = controls.create.call(this, {
id: this.id,
seektime: this.config.seekTime,
speed: this.speed,
quality: this.quality,
captions: controls.getLanguage.call(this)
// TODO: Looping
// loop: 'None',
});
}
// Controls container
var target = void 0;
// Inject to custom location
if (utils.is.string(this.config.selectors.controls.container)) {
target = document.querySelector(this.config.selectors.controls.container);
}
// Inject into the container by default
if (!utils.is.element(target)) {
target = this.elements.container;
}
// Inject controls HTML
if (utils.is.element(container)) {
target.appendChild(container);
} else {
target.insertAdjacentHTML('beforeend', container);
}
// Find the elements if need be
if (!utils.is.element(this.elements.controls)) {
utils.findElements.call(this);
}
// Edge sometimes doesn't finish the paint so force a redraw
if (window.navigator.userAgent.includes('Edge')) {
utils.repaint(target);
}
// Setup tooltips
if (this.config.tooltips.controls) {
var labels = utils.getElements.call(this, [this.config.selectors.controls.wrapper, ' ', this.config.selectors.labels, ' .', this.config.classNames.hidden].join(''));
Array.from(labels).forEach(function (label) {
utils.toggleClass(label, _this5.config.classNames.hidden, false);
utils.toggleClass(label, _this5.config.classNames.tooltip, true);
label.setAttribute('role', 'tooltip');
});
}
}
};
// ==========================================================================
// Plyr Captions
// TODO: Create as class
// ==========================================================================
var captions = {
// Setup captions
setup: function setup() {
// Requires UI support
if (!this.supported.ui) {
return;
}
// Set default language if not set
var stored = this.storage.get('language');
if (!utils.is.empty(stored)) {
this.captions.language = stored;
}
if (utils.is.empty(this.captions.language)) {
this.captions.language = this.config.captions.language.toLowerCase();
}
// Set captions enabled state if not set
if (!utils.is.boolean(this.captions.active)) {
var active = this.storage.get('captions');
if (utils.is.boolean(active)) {
this.captions.active = active;
} else {
this.captions.active = this.config.captions.active;
}
}
// Only Vimeo and HTML5 video supported at this point
if (!this.isVideo || this.isYouTube || this.isHTML5 && !support.textTracks) {
// Clear menu and hide
if (utils.is.array(this.config.controls) && this.config.controls.includes('settings') && this.config.settings.includes('captions')) {
controls.setCaptionsMenu.call(this);
}
return;
}
// Inject the container
if (!utils.is.element(this.elements.captions)) {
this.elements.captions = utils.createElement('div', utils.getAttributesFromSelector(this.config.selectors.captions));
utils.insertAfter(this.elements.captions, this.elements.wrapper);
}
// Set the class hook
utils.toggleClass(this.elements.container, this.config.classNames.captions.enabled, !utils.is.empty(captions.getTracks.call(this)));
// Get tracks
var tracks = captions.getTracks.call(this);
// If no caption file exists, hide container for caption text
if (utils.is.empty(tracks)) {
return;
}
// Get browser info
var browser = utils.getBrowser();
// Fix IE captions if CORS is used
// Fetch captions and inject as blobs instead (data URIs not supported!)
if (browser.isIE && window.URL) {
var elements = this.media.querySelectorAll('track');
Array.from(elements).forEach(function (track) {
var src = track.getAttribute('src');
var href = utils.parseUrl(src);
if (href.hostname !== window.location.href.hostname && ['http:', 'https:'].includes(href.protocol)) {
utils.fetch(src, 'blob').then(function (blob) {
track.setAttribute('src', window.URL.createObjectURL(blob));
}).catch(function () {
utils.removeElement(track);
});
}
});
}
// Set language
captions.setLanguage.call(this);
// Enable UI
captions.show.call(this);
// Set available languages in list
if (utils.is.array(this.config.controls) && this.config.controls.includes('settings') && this.config.settings.includes('captions')) {
controls.setCaptionsMenu.call(this);
}
},
// Set the captions language
setLanguage: function setLanguage() {
var _this = this;
// Setup HTML5 track rendering
if (this.isHTML5 && this.isVideo) {
captions.getTracks.call(this).forEach(function (track) {
// Show track
utils.on(track, 'cuechange', function (event) {
return captions.setCue.call(_this, event);
});
// Turn off native caption rendering to avoid double captions
// eslint-disable-next-line
track.mode = 'hidden';
});
// Get current track
var currentTrack = captions.getCurrentTrack.call(this);
// Check if suported kind
if (utils.is.track(currentTrack)) {
// If we change the active track while a cue is already displayed we need to update it
if (Array.from(currentTrack.activeCues || []).length) {
captions.setCue.call(this, currentTrack);
}
}
} else if (this.isVimeo && this.captions.active) {
this.embed.enableTextTrack(this.language);
}
},
// Get the tracks
getTracks: function getTracks() {
// Return empty array at least
if (utils.is.nullOrUndefined(this.media)) {
return [];
}
// Only get accepted kinds
return Array.from(this.media.textTracks || []).filter(function (track) {
return ['captions', 'subtitles'].includes(track.kind);
});
},
// Get the current track for the current language
getCurrentTrack: function getCurrentTrack() {
var _this2 = this;
return captions.getTracks.call(this).find(function (track) {
return track.language.toLowerCase() === _this2.language;
});
},
// Display active caption if it contains text
setCue: function setCue(input) {
// Get the track from the event if needed
var track = utils.is.event(input) ? input.target : input;
var activeCues = track.activeCues;
var active = activeCues.length && activeCues[0];
var currentTrack = captions.getCurrentTrack.call(this);
// Only display current track
if (track !== currentTrack) {
return;
}
// Display a cue, if there is one
if (utils.is.cue(active)) {
captions.setText.call(this, active.getCueAsHTML());
} else {
captions.setText.call(this, null);
}
utils.dispatchEvent.call(this, this.media, 'cuechange');
},
// Set the current caption
setText: function setText(input) {
// Requires UI
if (!this.supported.ui) {
return;
}
if (utils.is.element(this.elements.captions)) {
var content = utils.createElement('span');
// Empty the container
utils.emptyElement(this.elements.captions);
// Default to empty
var caption = !utils.is.nullOrUndefined(input) ? input : '';
// Set the span content
if (utils.is.string(caption)) {
content.textContent = caption.trim();
} else {
content.appendChild(caption);
}
// Set new caption text
this.elements.captions.appendChild(content);
} else {
this.debug.warn('No captions element to render to');
}
},
// Display captions container and button (for initialization)
show: function show() {
// If there's no caption toggle, bail
if (!utils.is.element(this.elements.buttons.captions)) {
return;
}
// Try to load the value from storage
var active = this.storage.get('captions');
// Otherwise fall back to the default config
if (!utils.is.boolean(active)) {
active = this.config.captions.active;
} else {
this.captions.active = active;
}
if (active) {
utils.toggleClass(this.elements.container, this.config.classNames.captions.active, true);
utils.toggleState(this.elements.buttons.captions, true);
}
}
};
// ==========================================================================
// YouTube plugin
// ==========================================================================
var youtube = {
setup: function setup() {
var _this = this;
// Add embed class for responsive
utils.toggleClass(this.elements.wrapper, this.config.classNames.embed, true);
// Set aspect ratio
youtube.setAspectRatio.call(this);
// Setup API
if (utils.is.object(window.YT) && utils.is.function(window.YT.Player)) {
youtube.ready.call(this);
} else {
// Load the API
utils.loadScript(this.config.urls.youtube.api);
// Setup callback for the API
// YouTube has it's own system of course...
window.onYouTubeReadyCallbacks = window.onYouTubeReadyCallbacks || [];
// Add to queue
window.onYouTubeReadyCallbacks.push(function () {
youtube.ready.call(_this);
});
// Set callback to process queue
window.onYouTubeIframeAPIReady = function () {
window.onYouTubeReadyCallbacks.forEach(function (callback) {
callback();
});
};
}
},
// Get the media title
getTitle: function getTitle(videoId) {
var _this2 = this;
// Try via undocumented API method first
// This method disappears now and then though...
// https://github.com/sampotts/plyr/issues/709
if (utils.is.function(this.embed.getVideoData)) {
var _embed$getVideoData = this.embed.getVideoData(),
title = _embed$getVideoData.title;
if (utils.is.empty(title)) {
this.config.title = title;
ui.setTitle.call(this);
return;
}
}
// Or via Google API
var key = this.config.keys.google;
if (utils.is.string(key) && !utils.is.empty(key)) {
var url = 'https://www.googleapis.com/youtube/v3/videos?id=' + videoId + '&key=' + key + '&fields=items(snippet(title))&part=snippet';
utils.fetch(url).then(function (result) {
if (utils.is.object(result)) {
_this2.config.title = result.items[0].snippet.title;
ui.setTitle.call(_this2);
}
}).catch(function () {});
}
},
// Set aspect ratio
setAspectRatio: function setAspectRatio() {
var ratio = this.config.ratio.split(':');
this.elements.wrapper.style.paddingBottom = 100 / ratio[0] * ratio[1] + '%';
},
// API ready
ready: function ready() {
var player = this;
// Ignore already setup (race condition)
var currentId = player.media.getAttribute('id');
if (!utils.is.empty(currentId) && currentId.startsWith('youtube-')) {
return;
}
// Get the source URL or ID
var source = player.media.getAttribute('src');
// Get from <div> if needed
if (utils.is.empty(source)) {
source = player.media.getAttribute(this.config.attributes.embed.id);
}
// Replace the <iframe> with a <div> due to YouTube API issues
var videoId = utils.parseYouTubeId(source);
var id = utils.generateId(player.provider);
var container = utils.createElement('div', { id: id });
player.media = utils.replaceElement(container, player.media);
// Setup instance
// https://developers.google.com/youtube/iframe_api_reference
player.embed = new window.YT.Player(id, {
videoId: videoId,
playerVars: {
autoplay: player.config.autoplay ? 1 : 0, // Autoplay
controls: player.supported.ui ? 0 : 1, // Only show controls if not fully supported
rel: 0, // No related vids
showinfo: 0, // Hide info
iv_load_policy: 3, // Hide annotations
modestbranding: 1, // Hide logos as much as possible (they still show one in the corner when paused)
disablekb: 1, // Disable keyboard as we handle it
playsinline: 1, // Allow iOS inline playback
// Tracking for stats
// origin: window ? `${window.location.protocol}//${window.location.host}` : null,
widget_referrer: window ? window.location.href : null,
// Captions are flaky on YouTube
cc_load_policy: player.captions.active ? 1 : 0,
cc_lang_pref: player.config.captions.language
},
events: {
onError: function onError(event) {
// If we've already fired an error, don't do it again
// YouTube fires onError twice
if (utils.is.object(player.media.error)) {
return;
}
var detail = {
code: event.data
};
// Messages copied from https://developers.google.com/youtube/iframe_api_reference#onError
switch (event.data) {
case 2:
detail.message = 'The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.';
break;
case 5:
detail.message = 'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.';
break;
case 100:
detail.message = 'The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.';
break;
case 101:
case 150:
detail.message = 'The owner of the requested video does not allow it to be played in embedded players.';
break;
default:
detail.message = 'An unknown error occured';
break;
}
player.media.error = detail;
utils.dispatchEvent.call(player, player.media, 'error');
},
onPlaybackQualityChange: function onPlaybackQualityChange(event) {
// Get the instance
var instance = event.target;
// Get current quality
player.media.quality = instance.getPlaybackQuality();
utils.dispatchEvent.call(player, player.media, 'qualitychange');
},
onPlaybackRateChange: function onPlaybackRateChange(event) {
// Get the instance
var instance = event.target;
// Get current speed
player.media.playbackRate = instance.getPlaybackRate();
utils.dispatchEvent.call(player, player.media, 'ratechange');
},
onReady: function onReady(event) {
// Get the instance
var instance = event.target;
// Get the title
youtube.getTitle.call(player, videoId);
// Create a faux HTML5 API using the YouTube API
player.media.play = function () {
instance.playVideo();
};
player.media.pause = function () {
instance.pauseVideo();
};
player.media.stop = function () {
instance.stopVideo();
};
player.media.duration = instance.getDuration();
player.media.paused = true;
// Seeking
player.media.currentTime = 0;
Object.defineProperty(player.media, 'currentTime', {
get: function get() {
return Number(instance.getCurrentTime());
},
set: function set(time) {
// Set seeking flag
player.media.seeking = true;
// Trigger seeking
utils.dispatchEvent.call(player, player.media, 'seeking');
// Seek after events sent
instance.seekTo(time);
}
});
// Playback speed
Object.defineProperty(player.media, 'playbackRate', {
get: function get() {
return instance.getPlaybackRate();
},
set: function set(input) {
instance.setPlaybackRate(input);
}
});
// Quality
Object.defineProperty(player.media, 'quality', {
get: function get() {
return instance.getPlaybackQuality();
},
set: function set(input) {
// Trigger request event
utils.dispatchEvent.call(player, player.media, 'qualityrequested', false, {
quality: input
});
instance.setPlaybackQuality(input);
}
});
// Volume
var volume = player.config.volume;
Object.defineProperty(player.media, 'volume', {
get: function get() {
return volume;
},
set: function set(input) {
volume = input;
instance.setVolume(volume * 100);
utils.dispatchEvent.call(player, player.media, 'volumechange');
}
});
// Muted
var muted = player.config.muted;
Object.defineProperty(player.media, 'muted', {
get: function get() {
return muted;
},
set: function set(input) {
var toggle = utils.is.boolean(input) ? input : muted;
muted = toggle;
instance[toggle ? 'mute' : 'unMute']();
utils.dispatchEvent.call(player, player.media, 'volumechange');
}
});
// Source
Object.defineProperty(player.media, 'currentSrc', {
get: function get() {
return instance.getVideoUrl();
}
});
// Ended
Object.defineProperty(player.media, 'ended', {
get: function get() {
return player.currentTime === player.duration;
}
});
// Get available speeds
player.options.speed = instance.getAvailablePlaybackRates();
// Set the tabindex to avoid focus entering iframe
if (player.supported.ui) {
player.media.setAttribute('tabindex', -1);
}
utils.dispatchEvent.call(player, player.media, 'timeupdate');
utils.dispatchEvent.call(player, player.media, 'durationchange');
// Reset timer
window.clearInterval(player.timers.buffering);
// Setup buffering
player.timers.buffering = window.setInterval(function () {
// Get loaded % from YouTube
player.media.buffered = instance.getVideoLoadedFraction();
// Trigger progress only when we actually buffer something
if (player.media.lastBuffered === null || player.media.lastBuffered < player.media.buffered) {
utils.dispatchEvent.call(player, player.media, 'progress');
}
// Set last buffer point
player.media.lastBuffered = player.media.buffered;
// Bail if we're at 100%
if (player.media.buffered === 1) {
window.clearInterval(player.timers.buffering);
// Trigger event
utils.dispatchEvent.call(player, player.media, 'canplaythrough');
}
}, 200);
// Rebuild UI
setTimeout(function () {
return ui.build.call(player);
}, 50);
},
onStateChange: function onStateChange(event) {
// Get the instance
var instance = event.target;
// Reset timer
window.clearInterval(player.timers.playing);
// Handle events
// -1 Unstarted
// 0 Ended
// 1 Playing
// 2 Paused
// 3 Buffering
// 5 Video cued
switch (event.data) {
case 0:
player.media.paused = true;
// YouTube doesn't support loop for a single video, so mimick it.
if (player.media.loop) {
// YouTube needs a call to `stopVideo` before playing again
instance.stopVideo();
instance.playVideo();
} else {
utils.dispatchEvent.call(player, player.media, 'ended');
}
break;
case 1:
// If we were seeking, fire seeked event
if (player.media.seeking) {
utils.dispatchEvent.call(player, player.media, 'seeked');
}
player.media.seeking = false;
// Only fire play if paused before
if (player.media.paused) {
utils.dispatchEvent.call(player, player.media, 'play');
}
player.media.paused = false;
utils.dispatchEvent.call(player, player.media, 'playing');
// Poll to get playback progress
player.timers.playing = window.setInterval(function () {
utils.dispatchEvent.call(player, player.media, 'timeupdate');
}, 50);
// Check duration again due to YouTube bug
// https://github.com/sampotts/plyr/issues/374
// https://code.google.com/p/gdata-issues/issues/detail?id=8690
if (player.media.duration !== instance.getDuration()) {
player.media.duration = instance.getDuration();
utils.dispatchEvent.call(player, player.media, 'durationchange');
}
// Get quality
controls.setQualityMenu.call(player, instance.getAvailableQualityLevels());
break;
case 2:
player.media.paused = true;
utils.dispatchEvent.call(player, player.media, 'pause');
break;
default:
break;
}
utils.dispatchEvent.call(player, player.elements.container, 'statechange', false, {
code: event.data
});
}
}
});
}
};
// ==========================================================================
// Vimeo plugin
// ==========================================================================
var vimeo = {
setup: function setup() {
var _this = this;
// Add embed class for responsive
utils.toggleClass(this.elements.wrapper, this.config.classNames.embed, true);
// Set intial ratio
vimeo.setAspectRatio.call(this);
// Load the API if not already
if (!utils.is.object(window.Vimeo)) {
utils.loadScript(this.config.urls.vimeo.api, function () {
vimeo.ready.call(_this);
});
} else {
vimeo.ready.call(this);
}
},
// Set aspect ratio
// For Vimeo we have an extra 300% height <div> to hide the standard controls and UI
setAspectRatio: function setAspectRatio(input) {
var ratio = utils.is.string(input) ? input.split(':') : this.config.ratio.split(':');
var padding = 100 / ratio[0] * ratio[1];
var height = 200;
var offset = (height - padding) / (height / 50);
this.elements.wrapper.style.paddingBottom = padding + '%';
this.media.style.transform = 'translateY(-' + offset + '%)';
},
// API Ready
ready: function ready() {
var _this2 = this;
var player = this;
// Get Vimeo params for the iframe
var options = {
loop: player.config.loop.active,
autoplay: player.autoplay,
byline: false,
portrait: false,
title: false,
speed: true,
transparent: 0,
gesture: 'media'
};
var params = utils.buildUrlParams(options);
// Get the source URL or ID
var source = player.media.getAttribute('src');
// Get from <div> if needed
if (utils.is.empty(source)) {
source = player.media.getAttribute(this.config.attributes.embed.id);
}
var id = utils.parseVimeoId(source);
// Build an iframe
var iframe = utils.createElement('iframe');
var src = 'https://player.vimeo.com/video/' + id + '?' + params;
iframe.setAttribute('src', src);
iframe.setAttribute('allowfullscreen', '');
iframe.setAttribute('allowtransparency', '');
iframe.setAttribute('allow', 'autoplay');
// Inject the package
var wrapper = utils.createElement('div');
wrapper.appendChild(iframe);
player.media = utils.replaceElement(wrapper, player.media);
// Setup instance
// https://github.com/vimeo/player.js
player.embed = new window.Vimeo.Player(iframe);
player.media.paused = true;
player.media.currentTime = 0;
// Create a faux HTML5 API using the Vimeo API
player.media.play = function () {
player.embed.play().then(function () {
player.media.paused = false;
});
};
player.media.pause = function () {
player.embed.pause().then(function () {
player.media.paused = true;
});
};
player.media.stop = function () {
player.embed.stop().then(function () {
player.media.paused = true;
player.currentTime = 0;
});
};
// Seeking
var currentTime = player.media.currentTime;
Object.defineProperty(player.media, 'currentTime', {
get: function get() {
return currentTime;
},
set: function set(time) {
// Get current paused state
// Vimeo will automatically play on seek
var paused = player.media.paused;
// Set seeking flag
player.media.seeking = true;
// Trigger seeking
utils.dispatchEvent.call(player, player.media, 'seeking');
// Seek after events
player.embed.setCurrentTime(time);
// Restore pause state
if (paused) {
player.pause();
}
}
});
// Playback speed
var speed = player.config.speed.selected;
Object.defineProperty(player.media, 'playbackRate', {
get: function get() {
return speed;
},
set: function set(input) {
player.embed.setPlaybackRate(input).then(function () {
speed = input;
utils.dispatchEvent.call(player, player.media, 'ratechange');
});
}
});
// Volume
var volume = player.config.volume;
Object.defineProperty(player.media, 'volume', {
get: function get() {
return volume;
},
set: function set(input) {
player.embed.setVolume(input).then(function () {
volume = input;
utils.dispatchEvent.call(player, player.media, 'volumechange');
});
}
});
// Muted
var muted = player.config.muted;
Object.defineProperty(player.media, 'muted', {
get: function get() {
return muted;
},
set: function set(input) {
var toggle = utils.is.boolean(input) ? input : false;
player.embed.setVolume(toggle ? 0 : player.config.volume).then(function () {
muted = toggle;
utils.dispatchEvent.call(player, player.media, 'volumechange');
});
}
});
// Loop
var loop = player.config.loop;
Object.defineProperty(player.media, 'loop', {
get: function get() {
return loop;
},
set: function set(input) {
var toggle = utils.is.boolean(input) ? input : player.config.loop.active;
player.embed.setLoop(toggle).then(function () {
loop = toggle;
});
}
});
// Source
var currentSrc = void 0;
player.embed.getVideoUrl().then(function (value) {
currentSrc = value;
});
Object.defineProperty(player.media, 'currentSrc', {
get: function get() {
return currentSrc;
}
});
// Ended
Object.defineProperty(player.media, 'ended', {
get: function get() {
return player.currentTime === player.duration;
}
});
// Set aspect ratio based on video size
Promise.all([player.embed.getVideoWidth(), player.embed.getVideoHeight()]).then(function (dimensions) {
var ratio = utils.getAspectRatio(dimensions[0], dimensions[1]);
vimeo.setAspectRatio.call(_this2, ratio);
});
// Set autopause
player.embed.setAutopause(player.config.autopause).then(function (state) {
player.config.autopause = state;
});
// Get title
player.embed.getVideoTitle().then(function (title) {
player.config.title = title;
ui.setTitle.call(_this2);
});
// Get current time
player.embed.getCurrentTime().then(function (value) {
currentTime = value;
utils.dispatchEvent.call(player, player.media, 'timeupdate');
});
// Get duration
player.embed.getDuration().then(function (value) {
player.media.duration = value;
utils.dispatchEvent.call(player, player.media, 'durationchange');
});
// Get captions
player.embed.getTextTracks().then(function (tracks) {
player.media.textTracks = tracks;
captions.setup.call(player);
});
player.embed.on('cuechange', function (data) {
var cue = null;
if (data.cues.length) {
cue = utils.stripHTML(data.cues[0].text);
}
captions.setText.call(player, cue);
});
player.embed.on('loaded', function () {
if (utils.is.element(player.embed.element) && player.supported.ui) {
var frame = player.embed.element;
// Fix keyboard focus issues
// https://github.com/sampotts/plyr/issues/317
frame.setAttribute('tabindex', -1);
}
});
player.embed.on('play', function () {
// Only fire play if paused before
if (player.media.paused) {
utils.dispatchEvent.call(player, player.media, 'play');
}
player.media.paused = false;
utils.dispatchEvent.call(player, player.media, 'playing');
});
player.embed.on('pause', function () {
player.media.paused = true;
utils.dispatchEvent.call(player, player.media, 'pause');
});
player.embed.on('timeupdate', function (data) {
player.media.seeking = false;
currentTime = data.seconds;
utils.dispatchEvent.call(player, player.media, 'timeupdate');
});
player.embed.on('progress', function (data) {
player.media.buffered = data.percent;
utils.dispatchEvent.call(player, player.media, 'progress');
// Check all loaded
if (parseInt(data.percent, 10) === 1) {
utils.dispatchEvent.call(player, player.media, 'canplaythrough');
}
});
player.embed.on('seeked', function () {
player.media.seeking = false;
utils.dispatchEvent.call(player, player.media, 'seeked');
utils.dispatchEvent.call(player, player.media, 'play');
});
player.embed.on('ended', function () {
player.media.paused = true;
utils.dispatchEvent.call(player, player.media, 'ended');
});
player.embed.on('error', function (detail) {
player.media.error = detail;
utils.dispatchEvent.call(player, player.media, 'error');
});
// Rebuild UI
setTimeout(function () {
return ui.build.call(player);
}, 0);
}
};
// ==========================================================================
// Plyr Media
// ==========================================================================
// Sniff out the browser
var browser$3 = utils.getBrowser();
var media = {
// Setup media
setup: function setup() {
// If there's no media, bail
if (!this.media) {
this.debug.warn('No media element found!');
return;
}
// Add type class
utils.toggleClass(this.elements.container, this.config.classNames.type.replace('{0}', this.type), true);
// Add provider class
utils.toggleClass(this.elements.container, this.config.classNames.provider.replace('{0}', this.provider), true);
// Add video class for embeds
// This will require changes if audio embeds are added
if (this.isEmbed) {
utils.toggleClass(this.elements.container, this.config.classNames.type.replace('{0}', 'video'), true);
}
if (this.supported.ui) {
// Check for picture-in-picture support
utils.toggleClass(this.elements.container, this.config.classNames.pip.supported, support.pip && this.isHTML5 && this.isVideo);
// Check for airplay support
utils.toggleClass(this.elements.container, this.config.classNames.airplay.supported, support.airplay && this.isHTML5);
// If there's no autoplay attribute, assume the video is stopped and add state class
utils.toggleClass(this.elements.container, this.config.classNames.stopped, this.config.autoplay);
// Add iOS class
utils.toggleClass(this.elements.container, this.config.classNames.isIos, browser$3.isIos);
// Add touch class
utils.toggleClass(this.elements.container, this.config.classNames.isTouch, support.touch);
}
// Inject the player wrapper
if (this.isVideo) {
// Create the wrapper div
this.elements.wrapper = utils.createElement('div', {
class: this.config.classNames.video
});
// Wrap the video in a container
utils.wrap(this.media, this.elements.wrapper);
}
if (this.isEmbed) {
switch (this.provider) {
case 'youtube':
youtube.setup.call(this);
break;
case 'vimeo':
vimeo.setup.call(this);
break;
default:
break;
}
} else if (this.isHTML5) {
ui.setTitle.call(this);
}
},
// Cancel current network requests
// See https://github.com/sampotts/plyr/issues/174
cancelRequests: function cancelRequests() {
if (!this.isHTML5) {
return;
}
// Remove child sources
utils.removeElement(this.media.querySelectorAll('source'));
// Set blank video src attribute
// This is to prevent a MEDIA_ERR_SRC_NOT_SUPPORTED error
// Info: http://stackoverflow.com/questions/32231579/how-to-properly-dispose-of-an-html5-video-and-close-socket-or-connection
this.media.setAttribute('src', this.config.blankVideo);
// Load the new empty source
// This will cancel existing requests
// See https://github.com/sampotts/plyr/issues/174
this.media.load();
// Debugging
this.debug.log('Cancelled network requests');
}
};
// ==========================================================================
// Plyr source update
// ==========================================================================
var source = {
// Add elements to HTML5 media (source, tracks, etc)
insertElements: function insertElements(type, attributes) {
var _this = this;
if (utils.is.string(attributes)) {
utils.insertElement(type, this.media, {
src: attributes
});
} else if (utils.is.array(attributes)) {
attributes.forEach(function (attribute) {
utils.insertElement(type, _this.media, attribute);
});
}
},
// Update source
// Sources are not checked for support so be careful
change: function change(input) {
var _this2 = this;
if (!utils.is.object(input) || !('sources' in input) || !input.sources.length) {
this.debug.warn('Invalid source format');
return;
}
// Cancel current network requests
media.cancelRequests.call(this);
// Destroy instance and re-setup
this.destroy.call(this, function () {
// TODO: Reset menus here
// Remove elements
utils.removeElement(_this2.media);
_this2.media = null;
// Reset class name
if (utils.is.element(_this2.elements.container)) {
_this2.elements.container.removeAttribute('class');
}
// Set the type and provider
_this2.type = input.type;
_this2.provider = !utils.is.empty(input.sources[0].provider) ? input.sources[0].provider : providers.html5;
// Check for support
_this2.supported = support.check(_this2.type, _this2.provider, _this2.config.inline);
// Create new markup
switch (_this2.provider + ':' + _this2.type) {
case 'html5:video':
_this2.media = utils.createElement('video');
break;
case 'html5:audio':
_this2.media = utils.createElement('audio');
break;
case 'youtube:video':
case 'vimeo:video':
_this2.media = utils.createElement('div', {
src: input.sources[0].src
});
break;
default:
break;
}
// Inject the new element
_this2.elements.container.appendChild(_this2.media);
// Autoplay the new source?
if (utils.is.boolean(input.autoplay)) {
_this2.config.autoplay = input.autoplay;
}
// Set attributes for audio and video
if (_this2.isHTML5) {
if (_this2.config.crossorigin) {
_this2.media.setAttribute('crossorigin', '');
}
if (_this2.config.autoplay) {
_this2.media.setAttribute('autoplay', '');
}
if ('poster' in input) {
_this2.media.setAttribute('poster', input.poster);
}
if (_this2.config.loop.active) {
_this2.media.setAttribute('loop', '');
}
if (_this2.config.muted) {
_this2.media.setAttribute('muted', '');
}
if (_this2.config.inline) {
_this2.media.setAttribute('playsinline', '');
}
}
// Restore class hook
ui.addStyleHook.call(_this2);
// Set new sources for html5
if (_this2.isHTML5) {
source.insertElements.call(_this2, 'source', input.sources);
}
// Set video title
_this2.config.title = input.title;
// Set up from scratch
media.setup.call(_this2);
// HTML5 stuff
if (_this2.isHTML5) {
// Setup captions
if ('tracks' in input) {
source.insertElements.call(_this2, 'track', input.tracks);
}
// Load HTML5 sources
_this2.media.load();
}
// If HTML5 or embed but not fully supported, setupInterface and call ready now
if (_this2.isHTML5 || _this2.isEmbed && !_this2.supported.ui) {
// Setup interface
ui.build.call(_this2);
}
// Update the fullscreen support
_this2.fullscreen.update();
}, true);
}
};
// ==========================================================================
// Plyr
// plyr.js v3.0.0-beta.17
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================
// Private properties
// TODO: Use a WeakMap for private globals
// const globals = new WeakMap();
// Plyr instance
var Plyr$1 = function () {
function Plyr(target, options) {
var _this = this;
classCallCheck(this, Plyr);
this.timers = {};
// State
this.ready = false;
this.loading = false;
this.failed = false;
// Set the media element
this.media = target;
// String selector passed
if (utils.is.string(this.media)) {
this.media = document.querySelectorAll(this.media);
}
// jQuery, NodeList or Array passed, use first element
if (window.jQuery && this.media instanceof jQuery || utils.is.nodeList(this.media) || utils.is.array(this.media)) {
// eslint-disable-next-line
this.media = this.media[0];
}
// Set config
this.config = utils.extend({}, defaults, options, function () {
try {
return JSON.parse(_this.media.getAttribute('data-plyr-config'));
} catch (e) {
return {};
}
}());
// Elements cache
this.elements = {
container: null,
buttons: {},
display: {},
progress: {},
inputs: {},
settings: {
menu: null,
panes: {},
tabs: {}
},
captions: null
};
// Captions
this.captions = {
active: null,
currentTrack: null
};
// Fullscreen
this.fullscreen = {
active: false
};
// Options
this.options = {
speed: [],
quality: []
};
// Debugging
// TODO: move to globals
this.debug = new Console(this.config.debug);
// Log config options and support
this.debug.log('Config', this.config);
this.debug.log('Support', support);
// We need an element to setup
if (utils.is.nullOrUndefined(this.media) || !utils.is.element(this.media)) {
this.debug.error('Setup failed: no suitable element passed');
return;
}
// Bail if the element is initialized
if (this.media.plyr) {
this.debug.warn('Target already setup');
return;
}
// Bail if not enabled
if (!this.config.enabled) {
this.debug.error('Setup failed: disabled by config');
return;
}
// Bail if disabled or no basic support
// You may want to disable certain UAs etc
if (!support.check().api) {
this.debug.error('Setup failed: no support');
return;
}
// Cache original element state for .destroy()
this.elements.original = this.media.cloneNode(true);
// Set media type based on tag or data attribute
// Supported: video, audio, vimeo, youtube
var type = this.media.tagName.toLowerCase();
// Embed properties
var iframe = null;
var url = null;
var params = null;
// Different setup based on type
switch (type) {
case 'div':
// Find the frame
iframe = this.media.querySelector('iframe');
// <iframe> type
if (utils.is.element(iframe)) {
// Detect provider
url = iframe.getAttribute('src');
this.provider = utils.getProviderByUrl(url);
// Rework elements
this.elements.container = this.media;
this.media = iframe;
// Reset classname
this.elements.container.className = '';
// Get attributes from URL and set config
params = utils.getUrlParams(url);
if (!utils.is.empty(params)) {
var truthy = ['1', 'true'];
if (truthy.includes(params.autoplay)) {
this.config.autoplay = true;
}
if (truthy.includes(params.playsinline)) {
this.config.inline = true;
}
if (truthy.includes(params.loop)) {
this.config.loop.active = true;
}
}
} else {
// <div> with attributes
this.provider = this.media.getAttribute(this.config.attributes.embed.provider);
// Remove attribute
this.media.removeAttribute(this.config.attributes.embed.provider);
}
// Unsupported or missing provider
if (utils.is.empty(this.provider) || !Object.keys(providers).includes(this.provider)) {
this.debug.error('Setup failed: Invalid provider');
return;
}
// Audio will come later for external providers
this.type = types.video;
break;
case 'video':
case 'audio':
this.type = type;
this.provider = providers.html5;
// Get config from attributes
if (this.media.hasAttribute('crossorigin')) {
this.config.crossorigin = true;
}
if (this.media.hasAttribute('autoplay')) {
this.config.autoplay = true;
}
if (this.media.hasAttribute('playsinline')) {
this.config.inline = true;
}
if (this.media.hasAttribute('muted')) {
this.config.muted = true;
}
if (this.media.hasAttribute('loop')) {
this.config.loop.active = true;
}
break;
default:
this.debug.error('Setup failed: unsupported type');
return;
}
// Check for support again but with type
this.supported = support.check(this.type, this.provider, this.config.inline);
// If no support for even API, bail
if (!this.supported.api) {
this.debug.error('Setup failed: no support');
return;
}
// Setup local storage for user settings
this.storage = new Storage(this);
// Store reference
this.media.plyr = this;
// Wrap media
if (!utils.is.element(this.elements.container)) {
this.elements.container = utils.createElement('div');
utils.wrap(this.media, this.elements.container);
}
// Allow focus to be captured
this.elements.container.setAttribute('tabindex', 0);
// Global listeners
listeners.global.call(this);
// Add style hook
ui.addStyleHook.call(this);
// Setup media
media.setup.call(this);
// Listen for events if debugging
if (this.config.debug) {
utils.on(this.elements.container, this.config.events.join(' '), function (event) {
_this.debug.log('event: ' + event.type);
});
}
// Setup interface
// If embed but not fully supported, build interface now to avoid flash of controls
if (this.isHTML5 || this.isEmbed && !this.supported.ui) {
ui.build.call(this);
}
// Setup fullscreen
this.fullscreen = new Fullscreen(this);
// Setup ads if provided
this.ads = new Ads(this);
}
// ---------------------------------------
// API
// ---------------------------------------
/**
* Types and provider helpers
*/
createClass(Plyr, [{
key: 'play',
/**
* Play the media, or play the advertisement (if they are not blocked)
*/
value: function play() {
// TODO: Always return a promise?
if (this.ads.enabled && !this.ads.initialized && !this.ads.blocked) {
this.ads.play();
return null;
}
// Return the promise (for HTML5)
return this.media.play();
}
/**
* Pause the media
*/
}, {
key: 'pause',
value: function pause() {
if (!this.playing) {
return;
}
this.media.pause();
}
/**
* Get paused state
*/
}, {
key: 'togglePlay',
/**
* Toggle playback based on current status
* @param {boolean} input
*/
value: function togglePlay(input) {
// Toggle based on current state if nothing passed
var toggle = utils.is.boolean(input) ? input : !this.playing;
if (toggle) {
this.play();
} else {
this.pause();
}
}
/**
* Stop playback
*/
}, {
key: 'stop',
value: function stop() {
this.restart();
this.pause();
}
/**
* Restart playback
*/
}, {
key: 'restart',
value: function restart() {
this.currentTime = 0;
}
/**
* Rewind
* @param {number} seekTime - how far to rewind in seconds. Defaults to the config.seekTime
*/
}, {
key: 'rewind',
value: function rewind(seekTime) {
this.currentTime = this.currentTime - (utils.is.number(seekTime) ? seekTime : this.config.seekTime);
}
/**
* Fast forward
* @param {number} seekTime - how far to fast forward in seconds. Defaults to the config.seekTime
*/
}, {
key: 'forward',
value: function forward(seekTime) {
this.currentTime = this.currentTime + (utils.is.number(seekTime) ? seekTime : this.config.seekTime);
}
/**
* Seek to a time
* @param {number} input - where to seek to in seconds. Defaults to 0 (the start)
*/
}, {
key: 'increaseVolume',
/**
* Increase volume
* @param {boolean} step - How much to decrease by (between 0 and 1)
*/
value: function increaseVolume(step) {
var volume = this.media.muted ? 0 : this.volume;
this.volume = volume + (utils.is.number(step) ? step : 1);
}
/**
* Decrease volume
* @param {boolean} step - How much to decrease by (between 0 and 1)
*/
}, {
key: 'decreaseVolume',
value: function decreaseVolume(step) {
var volume = this.media.muted ? 0 : this.volume;
this.volume = volume - (utils.is.number(step) ? step : 1);
}
/**
* Set muted state
* @param {boolean} mute
*/
}, {
key: 'toggleCaptions',
/**
* Toggle captions
* @param {boolean} input - Whether to enable captions
*/
value: function toggleCaptions(input) {
// If there's no full support, or there's no caption toggle
if (!this.supported.ui || !utils.is.element(this.elements.buttons.captions)) {
return;
}
// If the method is called without parameter, toggle based on current value
var show = utils.is.boolean(input) ? input : this.elements.container.className.indexOf(this.config.classNames.captions.active) === -1;
// Nothing to change...
if (this.captions.active === show) {
return;
}
// Set global
this.captions.active = show;
// Toggle state
utils.toggleState(this.elements.buttons.captions, this.captions.active);
// Add class hook
utils.toggleClass(this.elements.container, this.config.classNames.captions.active, this.captions.active);
// Trigger an event
utils.dispatchEvent.call(this, this.media, this.captions.active ? 'captionsenabled' : 'captionsdisabled');
}
/**
* Set the captions language
* @param {string} - Two character ISO language code (e.g. EN, FR, PT, etc)
*/
}, {
key: 'airplay',
/**
* Trigger the airplay dialog
* TODO: update player with state, support, enabled
*/
value: function airplay() {
// Show dialog if supported
if (support.airplay) {
this.media.webkitShowPlaybackTargetPicker();
}
}
/**
* Toggle the player controls
* @param {boolean} toggle - Whether to show the controls
*/
}, {
key: 'toggleControls',
value: function toggleControls(toggle) {
var _this2 = this;
// We need controls of course...
if (!utils.is.element(this.elements.controls)) {
return;
}
// Don't hide if no UI support or it's audio
if (!this.supported.ui || this.isAudio) {
return;
}
var delay = 0;
var show = toggle;
var isEnterFullscreen = false;
// Get toggle state if not set
if (!utils.is.boolean(toggle)) {
if (utils.is.event(toggle)) {
// Is the enter fullscreen event
isEnterFullscreen = toggle.type === 'enterfullscreen';
// Whether to show controls
show = ['mouseenter', 'mousemove', 'touchstart', 'touchmove', 'focusin'].includes(toggle.type);
// Delay hiding on move events
if (['mousemove', 'touchmove', 'touchend'].includes(toggle.type)) {
delay = 2000;
}
// Delay a little more for keyboard users
if (toggle.type === 'focusin') {
delay = 3000;
utils.toggleClass(this.elements.controls, this.config.classNames.noTransition, true);
}
} else {
show = utils.hasClass(this.elements.container, this.config.classNames.hideControls);
}
}
// Clear timer on every call
window.clearTimeout(this.timers.controls);
// If the mouse is not over the controls, set a timeout to hide them
if (show || this.paused || this.loading) {
// Check if controls toggled
var toggled = utils.toggleClass(this.elements.container, this.config.classNames.hideControls, false);
// Trigger event
if (toggled) {
utils.dispatchEvent.call(this, this.media, 'controlsshown');
}
// Always show controls when paused or if touch
if (this.paused || this.loading) {
return;
}
// Delay for hiding on touch
if (support.touch) {
delay = 3000;
}
}
// If toggle is false or if we're playing (regardless of toggle),
// then set the timer to hide the controls
if (!show || this.playing) {
this.timers.controls = setTimeout(function () {
// If the mouse is over the controls (and not entering fullscreen), bail
if ((_this2.elements.controls.pressed || _this2.elements.controls.hover) && !isEnterFullscreen) {
return;
}
// Restore transition behaviour
if (!utils.hasClass(_this2.elements.container, _this2.config.classNames.hideControls)) {
utils.toggleClass(_this2.elements.controls, _this2.config.classNames.noTransition, false);
}
// Check if controls toggled
var toggled = utils.toggleClass(_this2.elements.container, _this2.config.classNames.hideControls, true);
// Trigger event and close menu
if (toggled) {
utils.dispatchEvent.call(_this2, _this2.media, 'controlshidden');
if (_this2.config.controls.includes('settings') && !utils.is.empty(_this2.config.settings)) {
controls.toggleMenu.call(_this2, false);
}
}
}, delay);
}
}
/**
* Add event listeners
* @param {string} event - Event type
* @param {function} callback - Callback for when event occurs
*/
}, {
key: 'on',
value: function on(event, callback) {
utils.on(this.elements.container, event, callback);
}
/**
* Remove event listeners
* @param {string} event - Event type
* @param {function} callback - Callback for when event occurs
*/
}, {
key: 'off',
value: function off(event, callback) {
utils.off(this.elements.container, event, callback);
}
/**
* Destroy an instance
* Event listeners are removed when elements are removed
* http://stackoverflow.com/questions/12528049/if-a-dom-element-is-removed-are-its-listeners-also-removed-from-memory
* @param {function} callback - Callback for when destroy is complete
* @param {boolean} soft - Whether it's a soft destroy (for source changes etc)
*/
}, {
key: 'destroy',
value: function destroy(callback) {
var _this3 = this;
var soft = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var done = function done() {
// Reset overflow (incase destroyed while in fullscreen)
document.body.style.overflow = '';
// GC for embed
_this3.embed = null;
// If it's a soft destroy, make minimal changes
if (soft) {
if (Object.keys(_this3.elements).length) {
// Remove elements
utils.removeElement(_this3.elements.buttons.play);
utils.removeElement(_this3.elements.captions);
utils.removeElement(_this3.elements.controls);
utils.removeElement(_this3.elements.wrapper);
// Clear for GC
_this3.elements.buttons.play = null;
_this3.elements.captions = null;
_this3.elements.controls = null;
_this3.elements.wrapper = null;
}
// Callback
if (utils.is.function(callback)) {
callback();
}
} else {
// Replace the container with the original element provided
utils.replaceElement(_this3.elements.original, _this3.elements.container);
// Event
utils.dispatchEvent.call(_this3, _this3.elements.original, 'destroyed', true);
// Callback
if (utils.is.function(callback)) {
callback.call(_this3.elements.original);
}
// Clear for GC
_this3.elements = null;
}
};
// Type specific stuff
switch (this.provider + ':' + this.type) {
case 'html5:video':
case 'html5:audio':
// Restore native video controls
ui.toggleNativeControls.call(this, true);
// Clean up
done();
break;
case 'youtube:video':
// Clear timers
window.clearInterval(this.timers.buffering);
window.clearInterval(this.timers.playing);
// Destroy YouTube API
if (this.embed !== null) {
this.embed.destroy();
}
// Clean up
done();
break;
case 'vimeo:video':
// Destroy Vimeo API
// then clean up (wait, to prevent postmessage errors)
if (this.embed !== null) {
this.embed.unload().then(done);
}
// Vimeo does not always return
setTimeout(done, 200);
break;
default:
break;
}
}
/**
* Check for support for a mime type (HTML5 only)
* @param {string} type - Mime type
*/
}, {
key: 'supports',
value: function supports(type) {
return support.mime.call(this, type);
}
/**
* Check for support
* @param {string} type - Player type (audio/video)
* @param {string} provider - Provider (html5/youtube/vimeo)
* @param {bool} inline - Where player has `playsinline` sttribute
*/
}, {
key: 'isHTML5',
get: function get() {
return this.provider === providers.html5;
}
}, {
key: 'isEmbed',
get: function get() {
return this.isYouTube || this.isVimeo;
}
}, {
key: 'isYouTube',
get: function get() {
return this.provider === providers.youtube;
}
}, {
key: 'isVimeo',
get: function get() {
return this.provider === providers.vimeo;
}
}, {
key: 'isVideo',
get: function get() {
return this.type === types.video;
}
}, {
key: 'isAudio',
get: function get() {
return this.type === types.audio;
}
}, {
key: 'paused',
get: function get() {
return this.media.paused;
}
/**
* Get playing state
*/
}, {
key: 'playing',
get: function get() {
return !this.paused && !this.ended && (this.isHTML5 ? this.media.readyState > 2 : true);
}
/**
* Get ended state
*/
}, {
key: 'ended',
get: function get() {
return this.media.ended;
}
}, {
key: 'currentTime',
set: function set(input) {
var targetTime = 0;
if (utils.is.number(input)) {
targetTime = input;
}
// Normalise targetTime
if (targetTime < 0) {
targetTime = 0;
} else if (targetTime > this.duration) {
targetTime = this.duration;
}
// Set
this.media.currentTime = targetTime.toFixed(4);
// Logging
this.debug.log('Seeking to ' + this.currentTime + ' seconds');
}
/**
* Get current time
*/
,
get: function get() {
return Number(this.media.currentTime);
}
/**
* Get seeking status
*/
}, {
key: 'seeking',
get: function get() {
return this.media.seeking;
}
/**
* Get the duration of the current media
*/
}, {
key: 'duration',
get: function get() {
// Faux duration set via config
var fauxDuration = parseInt(this.config.duration, 10);
// True duration
var realDuration = Number(this.media.duration);
// If custom duration is funky, use regular duration
return !Number.isNaN(fauxDuration) ? fauxDuration : realDuration;
}
/**
* Set the player volume
* @param {number} value - must be between 0 and 1. Defaults to the value from local storage and config.volume if not set in storage
*/
}, {
key: 'volume',
set: function set(value) {
var volume = value;
var max = 1;
var min = 0;
if (utils.is.string(volume)) {
volume = Number(volume);
}
// Load volume from storage if no value specified
if (!utils.is.number(volume)) {
volume = this.storage.get('volume');
}
// Use config if all else fails
if (!utils.is.number(volume)) {
volume = this.config.volume;
}
// Maximum is volumeMax
if (volume > max) {
volume = max;
}
// Minimum is volumeMin
if (volume < min) {
volume = min;
}
// Update config
this.config.volume = volume;
// Set the player volume
this.media.volume = volume;
// If muted, and we're increasing volume, reset muted state
if (this.muted && volume > 0) {
this.muted = false;
}
}
/**
* Get the current player volume
*/
,
get: function get() {
return this.media.volume;
}
}, {
key: 'muted',
set: function set(mute) {
var toggle = mute;
// Load muted state from storage
if (!utils.is.boolean(toggle)) {
toggle = this.storage.get('muted');
}
// Use config if all else fails
if (!utils.is.boolean(toggle)) {
toggle = this.config.muted;
}
// Update config
this.config.muted = toggle;
// Set mute on the player
this.media.muted = toggle;
}
/**
* Get current muted state
*/
,
get: function get() {
return this.media.muted;
}
/**
* Check if the media has audio
*/
}, {
key: 'hasAudio',
get: function get() {
// Assume yes for all non HTML5 (as we can't tell...)
if (!this.isHTML5) {
return true;
}
if (this.isAudio) {
return true;
}
// Get audio tracks
return this.media.mozHasAudio || Boolean(this.media.webkitAudioDecodedByteCount) || Boolean(this.media.audioTracks && this.media.audioTracks.length);
}
/**
* Set playback speed
* @param {decimal} speed - the speed of playback (0.5-2.0)
*/
}, {
key: 'speed',
set: function set(input) {
var speed = null;
if (utils.is.number(input)) {
speed = input;
}
if (!utils.is.number(speed)) {
speed = this.storage.get('speed');
}
if (!utils.is.number(speed)) {
speed = this.config.speed.selected;
}
// Set min/max
if (speed < 0.1) {
speed = 0.1;
}
if (speed > 2.0) {
speed = 2.0;
}
if (!this.config.speed.options.includes(speed)) {
this.debug.warn('Unsupported speed (' + speed + ')');
return;
}
// Update config
this.config.speed.selected = speed;
// Set media speed
this.media.playbackRate = speed;
}
/**
* Get current playback speed
*/
,
get: function get() {
return this.media.playbackRate;
}
/**
* Set playback quality
* Currently YouTube only
* @param {string} input - Quality level
*/
}, {
key: 'quality',
set: function set(input) {
var quality = null;
if (utils.is.string(input)) {
quality = input;
}
if (!utils.is.string(quality)) {
quality = this.storage.get('quality');
}
if (!utils.is.string(quality)) {
quality = this.config.quality.selected;
}
if (!this.options.quality.includes(quality)) {
this.debug.warn('Unsupported quality option (' + quality + ')');
return;
}
// Update config
this.config.quality.selected = quality;
// Set quality
this.media.quality = quality;
}
/**
* Get current quality level
*/
,
get: function get() {
return this.media.quality;
}
/**
* Toggle loop
* TODO: Finish fancy new logic. Set the indicator on load as user may pass loop as config
* @param {boolean} input - Whether to loop or not
*/
}, {
key: 'loop',
set: function set(input) {
var toggle = utils.is.boolean(input) ? input : this.config.loop.active;
this.config.loop.active = toggle;
this.media.loop = toggle;
// Set default to be a true toggle
/* const type = ['start', 'end', 'all', 'none', 'toggle'].includes(input) ? input : 'toggle';
switch (type) {
case 'start':
if (this.config.loop.end && this.config.loop.end <= this.currentTime) {
this.config.loop.end = null;
}
this.config.loop.start = this.currentTime;
// this.config.loop.indicator.start = this.elements.display.played.value;
break;
case 'end':
if (this.config.loop.start >= this.currentTime) {
return this;
}
this.config.loop.end = this.currentTime;
// this.config.loop.indicator.end = this.elements.display.played.value;
break;
case 'all':
this.config.loop.start = 0;
this.config.loop.end = this.duration - 2;
this.config.loop.indicator.start = 0;
this.config.loop.indicator.end = 100;
break;
case 'toggle':
if (this.config.loop.active) {
this.config.loop.start = 0;
this.config.loop.end = null;
} else {
this.config.loop.start = 0;
this.config.loop.end = this.duration - 2;
}
break;
default:
this.config.loop.start = 0;
this.config.loop.end = null;
break;
} */
}
/**
* Get current loop state
*/
,
get: function get() {
return this.media.loop;
}
/**
* Set new media source
* @param {object} input - The new source object (see docs)
*/
}, {
key: 'source',
set: function set(input) {
source.change.call(this, input);
}
/**
* Get current source
*/
,
get: function get() {
return this.media.currentSrc;
}
/**
* Set the poster image for a HTML5 video
* @param {input} - the URL for the new poster image
*/
}, {
key: 'poster',
set: function set(input) {
if (!this.isHTML5 || !this.isVideo) {
this.debug.warn('Poster can only be set on HTML5 video');
return;
}
if (utils.is.string(input)) {
this.media.setAttribute('poster', input);
}
}
/**
* Get the current poster image
*/
,
get: function get() {
if (!this.isHTML5 || !this.isVideo) {
return null;
}
return this.media.getAttribute('poster');
}
/**
* Set the autoplay state
* @param {boolean} input - Whether to autoplay or not
*/
}, {
key: 'autoplay',
set: function set(input) {
var toggle = utils.is.boolean(input) ? input : this.config.autoplay;
this.config.autoplay = toggle;
}
/**
* Get the current autoplay state
*/
,
get: function get() {
return this.config.autoplay;
}
}, {
key: 'language',
set: function set(input) {
// Nothing specified
if (!utils.is.string(input)) {
return;
}
// Toggle captions based on input
this.toggleCaptions(!utils.is.empty(input));
// If empty string is passed, assume disable captions
if (utils.is.empty(input)) {
return;
}
// Normalize
var language = input.toLowerCase();
// If nothing to change, bail
if (this.language === language) {
return;
}
// Update config
this.captions.language = language;
// Clear caption
captions.setText.call(this, null);
// Update captions
captions.setLanguage.call(this);
// Trigger an event
utils.dispatchEvent.call(this, this.media, 'languagechange');
}
/**
* Get the current captions language
*/
,
get: function get() {
return this.captions.language;
}
/**
* Toggle picture-in-picture playback on WebKit/MacOS
* TODO: update player with state, support, enabled
* TODO: detect outside changes
*/
}, {
key: 'pip',
set: function set(input) {
var states = {
pip: 'picture-in-picture',
inline: 'inline'
};
// Bail if no support
if (!support.pip) {
return;
}
// Toggle based on current state if not passed
var toggle = utils.is.boolean(input) ? input : this.pip === states.inline;
// Toggle based on current state
this.media.webkitSetPresentationMode(toggle ? states.pip : states.inline);
}
/**
* Get the current picture-in-picture state
*/
,
get: function get() {
if (!support.pip) {
return null;
}
return this.media.webkitPresentationMode;
}
}], [{
key: 'supported',
value: function supported(type, provider, inline) {
return support.check(type, provider, inline);
}
/**
* Load an SVG sprite into the page
* @param {string} url - URL for the SVG sprite
* @param {string} [id] - Unique ID
*/
}, {
key: 'loadSprite',
value: function loadSprite(url, id) {
return utils.loadSprite(url, id);
}
}]);
return Plyr;
}();
// ==========================================================================
// Plyr Polyfilled Build
// plyr.js v3.0.0-beta.16
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================
return Plyr$1;
})));
//# sourceMappingURL=plyr.polyfilled.js.map
|
/**
* @author Lee Stemkoski
*
* Note: Only works with recent Chrome build.
*
* Usage:
* (1) create a global variable:
* var gamepad = new GamepadState();
* (2) during main loop:
* gamepad.update();
* (3a) check state of buttons:
* gamepad.down("A") -- true for one update cycle after button is pressed
* gamepad.pressed("A") -- true as long as button is being pressed
* gamepad.up("A") -- true for one update cycle after button is released
* (3b) check state of axes:
* gamepad.value("leftStickX") -- returns a value between -1.0 and 1.0
*
* See _buttonNames and _axisNames object data below for valid name strings.
* Note: can get values for of leftTrigger and rightTrigger also.
*/
////////////////////
// gamepad object //
////////////////////
GamepadState = function()
{
//////////////////
// gamepad data //
//////////////////
this.status = {};
////////////////////////////
// gamepad initialization //
////////////////////////////
for (var i = 0; i < GamepadState._buttonNames.length; i++)
{
var name = GamepadState._buttonNames[i];
this.status[name] = {down: false, pressed: false, up:false, active:false};
}
for (var i = 0; i < GamepadState._axisNames.length; i++)
{
var name = GamepadState._axisNames[i];
this.status[name] = {value: 0};
}
////////////////////
// gamepad events //
////////////////////
// not yet available in Chrome? :(
addEventListener("gamepadconnected", function() { console.log("Gamepad connected.") });
addEventListener("gamepaddisconnected", function() { console.log("Gamepad disconnected.") });
///////////////////////
// gamepad functions //
///////////////////////
this.isAvailable = function isAvailable()
{
var g = (navigator.getGamepads && navigator.getGamepads()) ||
(navigator.webkitGetGamepads && navigator.webkitGetGamepads());
var anything = g[0] || g[1] || g[2] || g[3];
if (anything) return true; else return false;
}
this.update = function update()
{
var g = (navigator.getGamepads && navigator.getGamepads()) ||
(navigator.webkitGetGamepads && navigator.webkitGetGamepads());
var gamepad = g[0] || g[1] || g[2] || g[3];
if (!gamepad) return; // exit if no gamepad available
// update buttons
for (var i = 0; i < 16; i++)
{
var name = GamepadState._buttonNames[i];
var button = this.status[name];
button.pressed = gamepad.buttons[i];
// ensure button is flagged as down for only one update.
if (button.down)
button.down = false;
// ensure button is flagged as up for only one update.
// when "up" becomes false, button is no longer active.
if (button.up)
{
button.up = false;
button.active = false;
}
// is this the first update where this button was pressed?
if (button.pressed && !button.active)
button.down = true;
// is this the first update where this button was released?
if (!button.pressed && button.active)
button.up = true;
// if _anything_ is flagged, button is "active"
button.active = (button.down || button.pressed || button.up);
}
// update axes
for (var i = 0; i < 4; i++)
{
var name = GamepadState._axisNames[i];
this.status[name].value = gamepad.axes[i];
}
}
this.down = function down(buttonName)
{
if ( this.status.hasOwnProperty(buttonName) )
return this.status[buttonName].down;
else console.warn("Gamepad: no button mapped to", buttonName);
}
this.pressed = function pressed(buttonName)
{
if (this.status.hasOwnProperty(buttonName))
return this.status[buttonName].pressed;
else console.warn("Gamepad: no button mapped to", buttonName);
}
this.up = function up(buttonName)
{
if (this.status.hasOwnProperty(buttonName))
return this.status[buttonName].up;
else console.warn("Gamepad: no button mapped to", buttonName);
}
this.value = function value(axisName)
{
if (axisName == "leftTrigger" || axisName == "rightTrigger")
return this.status[axisName].pressed;
else if (this.status.hasOwnProperty(axisName))
return this.status[axisName].value;
else
console.warn("Gamepad: no axis mapped to", axisName);
}
this.report = function report()
{
console.log("-------- Report Data ---------");
for (var i = 0; i < GamepadState._buttonNames.length; i++)
{
var name = GamepadState._buttonNames[i];
var button = this.status[name];
if (button.down) console.log(name, ": is down");
if (button.pressed) console.log(name, ": is pressed");
if (button.up) console.log(name, ": is up");
}
for (var i = 0; i < GamepadState._axisNames.length; i++)
{
var deadZone = 0.10;
var name = GamepadState._axisNames[i];
var axis = this.status[name];
if (Math.abs(axis.value) > deadZone) console.log(name, ": has value ", axis.value);
}
}
} // end of constructor
GamepadState._buttonNames = ["A", "B", "X", "Y", "leftShoulder", "rightShoulder", "leftTrigger", "rightTrigger",
"back", "start", "leftStick", "rightStick", "dpadUp", "dpadDown", "dpadLeft", "dpadRight"];
GamepadState._axisNames = ["leftStickX", "leftStickY", "rightStickX", "rightStickY"];
|
/**
* @author WestLangley / http://github.com/WestLangley
*
*/
THREE.Line2 = function ( geometry, material ) {
THREE.LineSegments2.call( this );
this.type = 'Line2';
this.geometry = geometry !== undefined ? geometry : new THREE.LineGeometry();
this.material = material !== undefined ? material : new THREE.LineMaterial( { color: Math.random() * 0xffffff } );
};
THREE.Line2.prototype = Object.assign( Object.create( THREE.LineSegments2.prototype ), {
constructor: THREE.Line2,
isLine2: true,
copy: function ( /* source */ ) {
// todo
return this;
}
} );
|
๏ปฟ
/*
* GET home page.
*/
exports.index = function(req, res){
res.render('index', { title: 'Express' });
};
|
var testCase = require('nodeunit').testCase,
cron = require('../lib/cron');
module.exports = testCase({
'test second (* * * * * *)': function(assert) {
assert.expect(1);
var c = new cron.CronJob('* * * * * *', function() {
assert.ok(true);
}, null, true);
setTimeout(function() {
c.stop();
assert.done();
}, 1250);
},
'test second with oncomplete (* * * * * *)': function(assert) {
assert.expect(2);
var c = new cron.CronJob('* * * * * *', function(done) {
assert.ok(true);
}, function () {
assert.ok(true);
assert.done();
}, true);
setTimeout(function() {
c.stop();
}, 1250);
},
'test every second for 5 seconds (* * * * * *)': function(assert) {
assert.expect(5);
var c = new cron.CronJob('* * * * * *', function() {
assert.ok(true);
}, null, true);
setTimeout(function() {
c.stop();
assert.done();
}, 5250);
},
'test standard cron no-seconds syntax doesnt send on seconds (* * * * *)': function(assert) {
assert.expect(0);
// Delay test from running at minute boundary
var prepDate = new Date();
if (prepDate.getSeconds() >= 55) {
setTimeout(testRun, 5000);
} else {
testRun();
}
function testRun() {
var c = new cron.CronJob('* * * * *', function() {
assert.ok(true);
}, null, true);
setTimeout(function() {
c.stop();
assert.done();
}, 5250);
}
},
'test every second for 5 seconds with oncomplete (* * * * * *)': function(assert) {
assert.expect(6);
var c = new cron.CronJob('* * * * * *', function(done) {
assert.ok(true);
}, function() {
assert.ok(true);
assert.done();
}, true);
setTimeout(function() {
c.stop();
}, 5250);
},
'test every 1 second for 5 seconds (*/1 * * * * *)': function(assert) {
assert.expect(5);
var c = new cron.CronJob('*/1 * * * * *', function() {
assert.ok(true);
}, null, true);
setTimeout(function() {
assert.done();
c.stop();
}, 5250);
},
'test every 1 second for 5 seconds with oncomplete (*/1 * * * * *)': function(assert) {
assert.expect(6);
var c = new cron.CronJob('*/1 * * * * *', function(done) {
assert.ok(true);
}, function() {
assert.ok(true);
assert.done();
}, true);
setTimeout(function() {
c.stop();
}, 5250);
},
'test every second for a range ([start]-[end] * * * * *)': function(assert) {
assert.expect(5);
var prepDate = new Date();
if ((54 - prepDate.getSeconds()) <= 0) {
setTimeout(testRun, (60000 - (prepDate.getSeconds()*1000)) + 1000);
} else {
testRun();
}
function testRun() {
var d = new Date();
var s = d.getSeconds()+2;
var e = s + 6; //end value is inclusive
var c = new cron.CronJob(s + '-' + e +' * * * * *', function() {
assert.ok(true);
}, null, true);
setTimeout(function() {
c.stop();
assert.done();
}, 6250);
}
},
'test every second for a range with oncomplete ([start]-[end] * * * * *)': function(assert) {
assert.expect(6);
var prepDate = new Date();
if ((54 - prepDate.getSeconds()) <= 0) {
setTimeout(testRun, (60000 - (prepDate.getSeconds()*1000)) + 1000);
} else {
testRun();
}
function testRun() {
var d = new Date();
var s = d.getSeconds()+2;
var e = s + 6; //end value is inclusive
var c = new cron.CronJob(s + '-' + e +' * * * * *', function() {
assert.ok(true);
}, function() {
assert.ok(true);
assert.done();
}, true);
setTimeout(function() {
c.stop();
}, 6250);
}
},
'test second (* * * * * *) object constructor': function(assert) {
assert.expect(1);
var c = new cron.CronJob({
cronTime: '* * * * * *',
onTick: function() {
assert.ok(true);
},
start: true
});
setTimeout(function() {
c.stop();
assert.done();
}, 1250);
},
'test second with oncomplete (* * * * * *) object constructor': function(assert) {
assert.expect(2);
var c = new cron.CronJob({
cronTime: '* * * * * *',
onTick: function(done) {
assert.ok(true);
},
onComplete: function () {
assert.ok(true);
assert.done();
},
start: true
});
setTimeout(function() {
c.stop();
}, 1250);
},
'test start/stop': function(assert) {
assert.expect(1);
var c = new cron.CronJob('* * * * * *', function() {
assert.ok(true);
this.stop();
});
c.start();
setTimeout(function() {
assert.done();
}, 3250);
},
'test specifying a specific date': function(assert) {
assert.expect(2);
var prepDate = new Date();
if ((58 - prepDate.getSeconds()) <= 0) {
setTimeout(testRun, (60000 - (prepDate.getSeconds()*1000)) + 1000);
} else {
testRun();
}
function testRun() {
var d = new Date();
var s = d.getSeconds()+1;
d.setSeconds(s);
var c = new cron.CronJob(d, function() {
var t = new Date();
assert.equal(t.getSeconds(), d.getSeconds());
assert.ok(true);
}, null, true);
setTimeout(function() {
c.stop();
assert.done();
}, 2250);
}
},
'test specifying a specific date with oncomplete': function(assert) {
assert.expect(3);
var prepDate = new Date();
if ((58 - prepDate.getSeconds()) <= 0) {
setTimeout(testRun, (60000 - (prepDate.getSeconds()*1000)) + 1000);
} else {
testRun();
}
function testRun() {
var d = new Date();
var s = d.getSeconds()+1;
d.setSeconds(s);
var c = new cron.CronJob(d, function() {
var t = new Date();
assert.equal(t.getSeconds(), d.getSeconds());
assert.ok(true);
}, function() {
assert.ok(true);
assert.done();
}, true);
setTimeout(function() {
c.stop();
}, 2250);
}
},
'test a job with a string and a given time zone': function (assert) {
assert.expect(3);
var time = require("time");
var zone = "America/Chicago";
// New Orleans time
var t = new time.Date();
t.setTimezone(zone);
// Current time
d = new Date();
// If current time is New Orleans time, switch to Los Angeles..
if (t.getHours() === d.getHours()) {
zone = "America/Los_Angeles";
t.setTimezone(zone);
}
assert.notEqual(d.getHours(), t.getHours());
assert.ok(!(Date instanceof time.Date));
// If t = 59s12m then t.setSeconds(60)
// becones 00s13m so we're fine just doing
// this and no testRun callback.
t.setSeconds(t.getSeconds()+1);
// Run a job designed to be executed at a given
// time in `zone`, making sure that it is a different
// hour than local time.
var c = new cron.CronJob(t.getSeconds() + ' ' + t.getMinutes() + ' ' + t.getHours() + ' * * *', function(){
assert.ok(true);
}, undefined, true, zone);
setTimeout(function() {
c.stop();
assert.done();
}, 1250);
},
'test a job with a date and a given time zone': function (assert) {
assert.expect(3);
var time = require("time");
var zone = "America/Chicago";
// New Orleans time
var t = new time.Date();
t.setTimezone(zone);
// Current time
d = new Date();
// If current time is New Orleans time, switch to Los Angeles..
if (t.getHours() === d.getHours()) {
zone = "America/Los_Angeles";
t.setTimezone(zone);
}
assert.notEqual(d.getHours(), t.getHours());
assert.ok(!(Date instanceof time.Date));
if ((58 - t.getSeconds()) <= 0) {
setTimeout(testRun, (60000 - (t.getSeconds()*1000)) + 1000);
} else {
testRun();
}
function testRun() {
var s = d.getSeconds()+1;
d.setSeconds(s);
var c = new cron.CronJob(d, function() {
assert.ok(true);
}, null, true, zone);
setTimeout(function() {
c.stop();
assert.done();
}, 2250);
}
},
'test dates fire only once': function(assert) {
assert.expect(1);
var count = 0;
var d = new Date().getTime() + 1000;
var job = cron.job(new Date(d), function() {
count++;
});
job.start();
setTimeout(function() {
job.stop();
assert.equal(count, 1);
assert.done();
}, 5250);
},
'test long wait should not fire immediately': function(assert) {
assert.expect(1);
var count = 0;
var d = new Date().getTime() + 31 * 86400 * 1000;
var job = cron.job(new Date(d), function() {
assert.ok(false);
});
job.start();
setTimeout(function() {
job.stop();
assert.ok(true);
assert.done();
}, 250);
},
'test start, change time, start again': function(assert) {
assert.expect(3);
var c = new cron.CronJob('* * * * * *', function() {
assert.ok(true);
});
var time = cron.time('*/2 * * * * *');
c.start();
setTimeout(function() {
c.stop();
c.setTime(time);
c.start();
setTimeout(function() {
c.stop();
assert.done();
}, 4250);
}, 1250);
},
'test start, change time, excpetion': function(assert) {
assert.expect(2);
var c = new cron.CronJob('* * * * * *', function() {
assert.ok(true);
});
var time = new Date();
c.start();
setTimeout(function() {
c.stop();
assert.throws(function() {
c.setTime(time);
});
assert.done();
}, 1250);
},
'test cronjob scoping': function(assert) {
assert.expect(2);
var c = new cron.CronJob('* * * * * *', function() {
assert.ok(true);
assert.ok(c instanceof cron.CronJob);
}, null, true);
setTimeout(function() {
c.stop();
assert.done();
}, 1250);
},
'test non-cronjob scoping': function(assert) {
assert.expect(2);
var c = new cron.CronJob('* * * * * *', function() {
assert.ok(true);
assert.equal(this.hello, 'world');
}, null, true, null, {'hello':'world'});
setTimeout(function() {
c.stop();
assert.done();
}, 1250);
},
'test non-cronjob scoping inside object': function(assert) {
assert.expect(2);
var c = new cron.CronJob({
cronTime: '* * * * * *',
onTick: function() {
assert.ok(true);
assert.equal(this.hello, 'world');
},
start: true,
context: {hello: 'world'}
});
setTimeout(function() {
c.stop();
assert.done();
}, 1250);
}
});
|
import React from 'react';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import List from 'src/List/List';
import ListItem from 'src/List/ListItem';
import makeSelectable from 'src/List/makeSelectable';
import injectTheme from '../fixtures/inject-theme';
import getMuiTheme from 'src/styles/getMuiTheme';
import TestUtils from 'react-addons-test-utils';
describe('makeSelectable', () => {
const muiTheme = getMuiTheme();
const shallowWithContext = (node) => shallow(node, {context: {muiTheme}});
const testChildren = [
<ListItem
key={1}
value={1}
primaryText="Brendan Lim"
nestedItems={[
<ListItem
value={2}
primaryText="Grace Ng"
/>,
]}
/>,
<ListItem
key={3}
value={3}
primaryText="Kerem Suer"
/>,
];
it('should display the children', () => {
const SelectableList = makeSelectable(List);
const wrapper = shallowWithContext(
<SelectableList>
{testChildren}
</SelectableList>
);
const brendan = wrapper.childAt(0);
const kerem = wrapper.childAt(1);
assert.ok(brendan.length);
assert.ok(kerem.length);
});
it('should select the right item', () => {
const SelectableList = injectTheme(makeSelectable(List));
const render = TestUtils.renderIntoDocument(
<SelectableList value={2}>
{testChildren}
</SelectableList>
);
const nodeTree = TestUtils.scryRenderedDOMComponentsWithTag(render, 'div');
assert.equal(
nodeTree[0].firstChild.lastChild.querySelector('span').style.backgroundColor,
'rgba(0, 0, 0, 0.2)',
'Change the backgroundColor of the selected item'
);
});
});
|
'use strict';
var grunt = require('grunt');
/*
======== A Handy Little Nodeunit Reference ========
https://github.com/caolan/nodeunit
Test methods:
test.expect(numAssertions)
test.done()
Test assertions:
test.ok(value, [message])
test.equal(actual, expected, [message])
test.notEqual(actual, expected, [message])
test.deepEqual(actual, expected, [message])
test.notDeepEqual(actual, expected, [message])
test.strictEqual(actual, expected, [message])
test.notStrictEqual(actual, expected, [message])
test.throws(block, [error], [message])
test.doesNotThrow(block, [error], [message])
test.ifError(value)
*/
exports.bbb_server = {
setUp: function(done) {
// setup here if necessary
done();
},
default_options: function(test) {
test.expect(1);
var actual = grunt.file.read('tmp/default_options');
var expected = grunt.file.read('test/expected/default_options');
test.equal(actual, expected, 'should describe what the default behavior is.');
test.done();
},
custom_options: function(test) {
test.expect(1);
var actual = grunt.file.read('tmp/custom_options');
var expected = grunt.file.read('test/expected/custom_options');
test.equal(actual, expected, 'should describe what the custom option(s) behavior is.');
test.done();
},
};
|
/* Make sure that console is defined */
if(typeof console === "undefined") {
this.console = {
log: function() {},
warn: function() {},
info: function() {},
debug: function() {},
error: function() {}
};
}
|
/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("lang/datatype-date-format_ms",function(e){e.Intl.add("datatype-date-format","ms",{a:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],A:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],b:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogos","Sep","Okt","Nov","Dis"],B:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],c:"%a, %Y %b %d %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%Y-%m-%d",X:"%H:%M:%S"})},"3.17.2");
|
// require json files
var area = require('../../config/data/area');
var character = require('../../config/data/character');
var equipment = require('../../config/data/equipment');
var experience = require('../../config/data/experience');
var npc = require('../../config/data/npc');
var role = require('../../config/data/role');
var talk = require('../../config/data/talk');
var item = require('../../config/data/item');
var fightskill = require('../../config/data/fightskill');
var task = require('../../config/data/task');
var team = require('../../config/data/team');
/**
* Data model `new Data()`
*
* @param {Array}
*
*/
var Data = function(data) {
var fields = {};
data[1].forEach(function(i, k) {
fields[i] = k;
});
data.splice(0, 2);
var result = {}, item;
data.forEach(function(k) {
item = mapData(fields, k);
result[item.id] = item;
});
this.data = result;
};
/**
* map the array data to object
*
* @param {Object}
* @param {Array}
* @return {Object} result
* @api private
*/
var mapData = function(fields, item) {
var obj = {};
for (var k in fields) {
obj[k] = item[fields[k]];
}
return obj;
};
/**
* find items by attribute
*
* @param {String} attribute name
* @param {String|Number} the value of the attribute
* @return {Array} result
* @api public
*/
Data.prototype.findBy = function(attr, value) {
var result = [];
var i, item;
for (i in this.data) {
item = this.data[i];
if (item[attr] == value) {
result.push(item);
}
}
return result;
};
Data.prototype.findBigger = function(attr, value) {
var result = [];
value = Number(value);
var i, item;
for (i in this.data) {
item = this.data[i];
if (Number(item[attr]) >= value) {
result.push(item);
}
}
return result;
};
Data.prototype.findSmaller = function(attr, value) {
var result = [];
value = Number(value);
var i, item;
for (i in this.data) {
item = this.data[i];
if (Number(item[attr]) <= value) {
result.push(item);
}
}
return result;
};
/**
* find item by id
*
* @param id
* @return {Obj}
* @api public
*/
Data.prototype.findById = function(id) {
return this.data[id];
};
/**
* find all item
*
* @return {array}
* @api public
*/
Data.prototype.all = function() {
return this.data;
};
module.exports = {
area: new Data(area),
character: new Data(character),
equipment: new Data(equipment),
experience: new Data(experience),
npc: new Data(npc),
role: new Data(role),
talk: new Data(talk),
item: new Data(item),
fightskill: new Data(fightskill),
task: new Data(task),
team: new Data(team)
};
|
/*!
* @atlassian/aui - Atlassian User Interface Framework
* @version v7.4.0
* @link https://docs.atlassian.com/aui/latest/
* @license SEE LICENSE IN LICENSE.md
* @author Atlassian Pty Ltd.
*/
// src/js/aui/jquery.js
(typeof window === 'undefined' ? global : window).__fa4bdecddc16a5afcc6c3490bffabe5c = (function () {
var module = {
exports: {}
};
var exports = module.exports;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = window.jQuery || window.Zepto;
module.exports = exports["default"];
return module.exports;
}).call(this);
// src/js/aui/create-element.js
(typeof window === 'undefined' ? global : window).__27efba7665da1bee18d02fa5f22f3be5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function createElement() {
var res = null;
if (arguments.length && typeof arguments[0] === 'string') {
res = (0, _jquery2.default)(document.createElement(arguments[0]));
if (arguments.length === 2) {
res.html(arguments[1]);
}
}
//We can't use the deprecate module or we will introduce a circular dependency
if (typeof console !== 'undefined' && console.warn) {
console.warn('AJS\'s create element functionality has been deprecated since 5.9.0.\nNo alternative will be provided.\nUse document.createElement() or jQuery.parseHTML(), or preferably use a templating library.');
}
return res;
}
exports.default = createElement;
module.exports = exports['default'];
return module.exports;
}).call(this);
// node_modules/object-assign/index.js
(typeof window === 'undefined' ? global : window).__c3f74fd1aead90e93f8bb66a6df98e40 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
/* eslint-disable no-unused-vars */
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
module.exports = Object.assign || function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (Object.getOwnPropertySymbols) {
symbols = Object.getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
return module.exports;
}).call(this);
// src/js/aui/internal/globalize.js
(typeof window === 'undefined' ? global : window).__202c95dc6d314ca2ed9178d1b384f912 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = globalize;
var _createElement = __27efba7665da1bee18d02fa5f22f3be5;
var _createElement2 = _interopRequireDefault(_createElement);
var _objectAssign = __c3f74fd1aead90e93f8bb66a6df98e40;
var _objectAssign2 = _interopRequireDefault(_objectAssign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function auiNamespace() {
return _createElement2.default.apply(undefined, arguments);
};
var NAMESPACE = 'AJS';
function globalize(name, value) {
if (window[NAMESPACE] !== auiNamespace) {
window[NAMESPACE] = (0, _objectAssign2.default)(auiNamespace, window[NAMESPACE]);
}
return window[NAMESPACE][name] = value;
}
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/deprecation.js
(typeof window === 'undefined' ? global : window).__ebcf2ab00bc38af4e85edb3431c4154b = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getMessageLogger = exports.propertyDeprecationSupported = exports.obj = exports.prop = exports.css = exports.construct = exports.fn = undefined;
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var has = Object.prototype.hasOwnProperty;
var deprecationCalls = [];
var deprecatedSelectorMap = [];
function toSentenceCase(str) {
str += '';
if (!str) {
return '';
}
return str.charAt(0).toUpperCase() + str.substring(1);
}
function getDeprecatedLocation(printFrameOffset) {
var err = new Error();
var stack = err.stack || err.stacktrace;
var stackMessage = stack && stack.replace(/^Error\n/, '') || '';
if (stackMessage) {
stackMessage = stackMessage.split('\n');
return stackMessage[printFrameOffset + 2];
}
return stackMessage;
}
function logger() {
if (typeof console !== 'undefined' && console.warn) {
Function.prototype.apply.call(console.warn, console, arguments);
}
}
/**
* Return a function that logs a deprecation warning to the console the first time it is called from a certain location.
* It will also print the stack frame of the calling function.
*
* @param {string} displayName the name of the thing being deprecated
* @param {object} options
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
* @param {string} options.extraObject an extra object that will be printed at the end
* @param {string} options.deprecationType type of the deprecation to append to the start of the deprecation message. e.g. JS or CSS
* @return {Function} that logs the warning and stack frame of the calling function. Takes in an optional parameter for the offset of
* the stack frame to print, the default is 0. For example, 0 will log it for the line of the calling function,
* -1 will print the location the logger was called from
*/
function getShowDeprecationMessage(displayName, options) {
// This can be used internally to pas in a showmessage fn
if (typeof displayName === 'function') {
return displayName;
}
var called = false;
options = options || {};
return function (printFrameOffset) {
var deprecatedLocation = getDeprecatedLocation(printFrameOffset ? printFrameOffset : 1) || '';
// Only log once if the stack frame doesn't exist to avoid spamming the console/test output
if (!called || deprecationCalls.indexOf(deprecatedLocation) === -1) {
deprecationCalls.push(deprecatedLocation);
called = true;
var deprecationType = options.deprecationType + ' ' || '';
var message = 'DEPRECATED ' + deprecationType + '- ' + toSentenceCase(displayName) + ' has been deprecated' + (options.sinceVersion ? ' since ' + options.sinceVersion : '') + ' and will be removed in ' + (options.removeInVersion || 'a future release') + '.';
if (options.alternativeName) {
message += ' Use ' + options.alternativeName + ' instead. ';
}
if (options.extraInfo) {
message += ' ' + options.extraInfo;
}
if (deprecatedLocation === '') {
deprecatedLocation = ' \n ' + 'No stack trace of the deprecated usage is available in your current browser.';
} else {
deprecatedLocation = ' \n ' + deprecatedLocation;
}
if (options.extraObject) {
message += '\n';
logger(message, options.extraObject, deprecatedLocation);
} else {
logger(message, deprecatedLocation);
}
}
};
}
function logCssDeprecation(selectorMap, newNode) {
var displayName = selectorMap.options.displayName;
displayName = displayName ? ' (' + displayName + ')' : '';
var options = _jquery2.default.extend({
deprecationType: 'CSS',
extraObject: newNode
}, selectorMap.options);
getShowDeprecationMessage('\'' + selectorMap.selector + '\' pattern' + displayName, options)();
}
/**
* Returns a wrapped version of the function that logs a deprecation warning when the function is used.
* @param {Function} fn the fn to wrap
* @param {string} displayName the name of the fn to be displayed in the message
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
* @return {Function} wrapping the original function
*/
function deprecateFunctionExpression(fn, displayName, options) {
options = options || {};
options.deprecationType = options.deprecationType || 'JS';
var showDeprecationMessage = getShowDeprecationMessage(displayName || fn.name || 'this function', options);
return function () {
showDeprecationMessage();
return fn.apply(this, arguments);
};
}
/**
* Returns a wrapped version of the constructor that logs a deprecation warning when the constructor is instantiated.
* @param {Function} constructorFn the constructor function to wrap
* @param {string} displayName the name of the fn to be displayed in the message
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
* @return {Function} wrapping the original function
*/
function deprecateConstructor(constructorFn, displayName, options) {
options = options || {};
options.deprecationType = options.deprecationType || 'JS';
var deprecatedConstructor = deprecateFunctionExpression(constructorFn, displayName, options);
deprecatedConstructor.prototype = constructorFn.prototype;
_jquery2.default.extend(deprecatedConstructor, constructorFn); //copy static methods across;
return deprecatedConstructor;
}
var supportsProperties = false;
try {
if (Object.defineProperty) {
Object.defineProperty({}, 'blam', { get: function get() {}, set: function set() {} });
exports.propertyDeprecationSupported = supportsProperties = true;
}
} catch (e) {}
/* IE8 doesn't support on non-DOM elements */
/**
* Wraps a "value" object property in a deprecation warning in browsers supporting Object.defineProperty
* @param {Object} obj the object containing the property
* @param {string} prop the name of the property to deprecate
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.displayName the display name of the property to deprecate (optional, will fall back to the property name)
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
*/
function deprecateValueProperty(obj, prop, options) {
if (supportsProperties) {
var oldVal = obj[prop];
options = options || {};
options.deprecationType = options.deprecationType || 'JS';
var displayNameOrShowMessageFn = options.displayName || prop;
var showDeprecationMessage = getShowDeprecationMessage(displayNameOrShowMessageFn, options);
Object.defineProperty(obj, prop, {
get: function get() {
showDeprecationMessage();
return oldVal;
},
set: function set(val) {
oldVal = val;
showDeprecationMessage();
return val;
}
});
}
}
/**
* Wraps an object property in a deprecation warning, if possible. functions will always log warnings, but other
* types of properties will only log in browsers supporting Object.defineProperty
* @param {Object} obj the object containing the property
* @param {string} prop the name of the property to deprecate
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.displayName the display name of the property to deprecate (optional, will fall back to the property name)
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
*/
function deprecateObjectProperty(obj, prop, options) {
if (typeof obj[prop] === 'function') {
options = options || {};
options.deprecationType = options.deprecationType || 'JS';
var displayNameOrShowMessageFn = options.displayName || prop;
obj[prop] = deprecateFunctionExpression(obj[prop], displayNameOrShowMessageFn, options);
} else {
deprecateValueProperty(obj, prop, options);
}
}
/**
* Wraps all an objects properties in a deprecation warning, if possible. functions will always log warnings, but other
* types of properties will only log in browsers supporting Object.defineProperty
* @param {Object} obj the object to be wrapped
* @param {string} objDisplayPrefix the object's prefix to be used in logs
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.alternativeNamePrefix the name of another object to prefix the deprecated objects properties with
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
*/
function deprecateAllProperties(obj, objDisplayPrefix, options) {
options = options || {};
for (var attr in obj) {
if (has.call(obj, attr)) {
options.deprecationType = options.deprecationType || 'JS';
options.displayName = objDisplayPrefix + attr;
options.alternativeName = options.alternativeNamePrefix && options.alternativeNamePrefix + attr;
deprecateObjectProperty(obj, attr, _jquery2.default.extend({}, options));
}
}
}
function matchesSelector(el, selector) {
return (el.matches || el.msMatchesSelector || el.webkitMatchesSelector || el.mozMatchesSelector || el.oMatchesSelector).call(el, selector);
}
function handleAddingSelector(options) {
return function (selector) {
var selectorMap = {
selector: selector,
options: options || {}
};
deprecatedSelectorMap.push(selectorMap);
// Search if matches have already been added
var matches = document.querySelectorAll(selector);
for (var i = 0; i < matches.length; i++) {
logCssDeprecation(selectorMap, matches[i]);
}
};
}
/**
* Return a function that logs a deprecation warning to the console the first time it is called from a certain location.
* It will also print the stack frame of the calling function.
*
* @param {string|Array} selectors a selector or list of selectors that match deprecated markup
* @param {object} options
* @param {string} options.displayName a name describing these selectors
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.removeInVersion the version these will be removed in
* @param {string} options.sinceVersion the version these have been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
*/
function deprecateCSS(selectors, options) {
if (!window.MutationObserver) {
logger('CSS could not be deprecated as Mutation Observer was not found.');
return;
}
if (typeof selectors === 'string') {
selectors = [selectors];
}
selectors.forEach(handleAddingSelector(options));
}
function testAndHandleDeprecation(newNode) {
return function (selectorMap) {
if (matchesSelector(newNode, selectorMap.selector)) {
logCssDeprecation(selectorMap, newNode);
}
};
}
if (window.MutationObserver) {
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
// TODO - should this also look at class changes, if possible?
var addedNodes = mutation.addedNodes;
for (var i = 0; i < addedNodes.length; i++) {
var newNode = addedNodes[i];
if (newNode.nodeType === 1) {
deprecatedSelectorMap.forEach(testAndHandleDeprecation(newNode));
}
}
});
});
var config = {
childList: true,
subtree: true
};
observer.observe(document, config);
}
var deprecate = {
fn: deprecateFunctionExpression,
construct: deprecateConstructor,
css: deprecateCSS,
prop: deprecateObjectProperty,
obj: deprecateAllProperties,
propertyDeprecationSupported: supportsProperties,
getMessageLogger: getShowDeprecationMessage
};
(0, _globalize2.default)('deprecate', deprecate);
exports.fn = deprecateFunctionExpression;
exports.construct = deprecateConstructor;
exports.css = deprecateCSS;
exports.prop = deprecateObjectProperty;
exports.obj = deprecateAllProperties;
exports.propertyDeprecationSupported = supportsProperties;
exports.getMessageLogger = getShowDeprecationMessage;
return module.exports;
}).call(this);
// src/js/aui/internal/amdify.js
(typeof window === 'undefined' ? global : window).__ef2fd31e6f10ced6cb535a906a7926aa = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (name, fn) {
if (window.define) {
var alias = window.define;
alias(name, [], function () {
return fn;
});
}
return fn;
};
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/log.js
(typeof window === 'undefined' ? global : window).__084be15bc3dec09fe27a76bc41cb3906 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.error = exports.warn = exports.log = undefined;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function polyfillConsole(prop) {
return function () {
if (typeof console !== 'undefined' && console[prop]) {
Function.prototype.apply.call(console[prop], console, arguments);
}
};
}
var log = polyfillConsole('log');
var warn = polyfillConsole('warn');
var error = polyfillConsole('error');
(0, _globalize2.default)('error', error);
(0, _globalize2.default)('log', log);
(0, _globalize2.default)('warn', warn);
exports.log = log;
exports.warn = warn;
exports.error = error;
return module.exports;
}).call(this);
// src/js/aui/internal/browser.js
(typeof window === 'undefined' ? global : window).__06d3cef33ca9f6a1f5da6f0cc5a2aa58 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.needsLayeringShim = needsLayeringShim;
exports.supportsCalc = supportsCalc;
exports.supportsRequestAnimationFrame = supportsRequestAnimationFrame;
exports.supportsVoiceOver = supportsVoiceOver;
exports.supportsDateField = supportsDateField;
exports.supportsNewMouseEvent = supportsNewMouseEvent;
var ua = navigator.userAgent.toLowerCase();
var isIE = /msie/.test(ua);
var isWinXP = /windows nt 5.1/.test(ua);
var isWinVista = /windows nt 6.0/.test(ua);
var isWin7 = /windows nt 6.1/.test(ua);
var isMacOSX = /mac os x/.test(ua);
var doesSupportCalc;
var doesSupportHtml5DateInput;
/**
* Layered elements can get obscured by <object>, <embed>, <select> or sometimes even <iframe>
* on older versions of Windows + Internet Explorer.
* From manual testing, all IE versions on Windows 7 appear to have the bug,
* but no IE versions on Windows 8 have it.
*/
function needsLayeringShim() {
return isIE && (isWinXP || isWinVista || isWin7);
}
function supportsCalc() {
if (typeof doesSupportCalc === 'undefined') {
var d = document.createElement('div');
d.style.cssText = 'height: -webkit-calc(20px + 0); height: calc(20px);';
// browsers will cull the rules they don't understand, so we can check whether
// any were added at all to confirm presence of the calc() behaviour.
doesSupportCalc = d.style.cssText.length > 0;
}
return doesSupportCalc;
}
function supportsRequestAnimationFrame() {
return !!window.requestAnimationFrame;
}
function supportsVoiceOver() {
return isMacOSX;
}
function supportsDateField() {
if (typeof doesSupportHtml5DateInput === 'undefined') {
var el = document.createElement('input');
el.setAttribute('type', 'date');
doesSupportHtml5DateInput = el.type === 'date';
}
return doesSupportHtml5DateInput;
}
// This is supported everywhere except Chrome 22, but we needed to support this use case due to
// https://bitbucket.org/atlassian/aui/pull-requests/1920/aui-4380-fix-shortcut-not-work-in-old/diff .
function supportsNewMouseEvent() {
try {
new MouseEvent('click');
} catch (e) {
return false;
}
return true;
}
return module.exports;
}).call(this);
// src/js/aui/key-code.js
(typeof window === 'undefined' ? global : window).__d9798488305326dc80a738b4a3341d65 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var keyCode = {
ALT: 18,
BACKSPACE: 8,
CAPS_LOCK: 20,
COMMA: 188,
COMMAND: 91,
// cmd
COMMAND_LEFT: 91,
COMMAND_RIGHT: 93,
LEFT_SQUARE_BRACKET: 91, //This is 91 for keypress and 219 for keydown/keyup
CONTROL: 17,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
INSERT: 45,
LEFT: 37,
// right cmd
MENU: 93,
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
NUMPAD_ENTER: 108,
NUMPAD_MULTIPLY: 106,
NUMPAD_SUBTRACT: 109,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SHIFT: 16,
SPACE: 32,
TAB: 9,
UP: 38,
// cmd
WINDOWS: 91
};
(0, _globalize2.default)('keyCode', keyCode);
exports.default = keyCode;
module.exports = exports['default'];
return module.exports;
}).call(this);
// node_modules/css.escape/css.escape.js
(typeof window === 'undefined' ? global : window).__8068ad10ad677e290eeeebcb4033d71d = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__8068ad10ad677e290eeeebcb4033d71d");
define.amd = true;
/*! https://mths.be/cssescape v1.5.0 by @mathias | MIT license */
;(function(root, factory) {
// https://github.com/umdjs/umd/blob/master/returnExports.js
if (typeof exports == 'object') {
// For Node.js.
module.exports = factory(root);
} else if (typeof define == 'function' && define.amd) {
// For AMD. Register as an anonymous module.
define([], factory.bind(root, root));
} else {
// For browser globals (not exposing the function separately).
factory(root);
}
}(typeof global != 'undefined' ? global : this, function(root) {
if (root.CSS && root.CSS.escape) {
return root.CSS.escape;
}
// https://drafts.csswg.org/cssom/#serialize-an-identifier
var cssEscape = function(value) {
var string = String(value);
var length = string.length;
var index = -1;
var codeUnit;
var result = '';
var firstCodeUnit = string.charCodeAt(0);
while (++index < length) {
codeUnit = string.charCodeAt(index);
// Note: thereโs no need to special-case astral symbols, surrogate
// pairs, or lone surrogates.
// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
// (U+FFFD).
if (codeUnit == 0x0000) {
result += '\uFFFD';
continue;
}
if (
// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
// U+007F, [โฆ]
(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||
// If the character is the first character and is in the range [0-9]
// (U+0030 to U+0039), [โฆ]
(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
// If the character is the second character and is in the range [0-9]
// (U+0030 to U+0039) and the first character is a `-` (U+002D), [โฆ]
(
index == 1 &&
codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
firstCodeUnit == 0x002D
)
) {
// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
result += '\\' + codeUnit.toString(16) + ' ';
continue;
}
if (
// If the character is the first character and is a `-` (U+002D), and
// there is no second character, [โฆ]
index == 0 &&
length == 1 &&
codeUnit == 0x002D
) {
result += '\\' + string.charAt(index);
continue;
}
// If the character is not handled by one of the above rules and is
// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
// U+005A), or [a-z] (U+0061 to U+007A), [โฆ]
if (
codeUnit >= 0x0080 ||
codeUnit == 0x002D ||
codeUnit == 0x005F ||
codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
codeUnit >= 0x0041 && codeUnit <= 0x005A ||
codeUnit >= 0x0061 && codeUnit <= 0x007A
) {
// the character itself
result += string.charAt(index);
continue;
}
// Otherwise, the escaped character.
// https://drafts.csswg.org/cssom/#escape-a-character
result += '\\' + string.charAt(index);
}
return result;
};
if (!root.CSS) {
root.CSS = {};
}
root.CSS.escape = cssEscape;
return cssEscape;
}));
return module.exports;
}).call(this);
// src/js/aui/inline-dialog.js
(typeof window === 'undefined' ? global : window).__2850afcf6a043ee52a959949f0cf40de = (function () {
var module = {
exports: {}
};
var exports = module.exports;
/* eslint quotmark:off, eqeqeq:off, strict:off, complexity:off */
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _browser = __06d3cef33ca9f6a1f5da6f0cc5a2aa58;
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var deprecate = _interopRequireWildcard(_deprecation);
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _keyCode = __d9798488305326dc80a738b4a3341d65;
var _keyCode2 = _interopRequireDefault(_keyCode);
var _css = __8068ad10ad677e290eeeebcb4033d71d;
var _css2 = _interopRequireDefault(_css);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates a new inline dialog.
*
* @param items jQuery object - the items that trigger the display of this popup when the user mouses over.
* @param identifier A unique identifier for this popup. This should be unique across all popups on the page and a valid CSS class.
* @param url The URL to retrieve popup contents.
* @param options Custom options to change default behaviour. See InlineDialog.opts for default values and valid options.
*/
function InlineDialog(items, identifier, url, options) {
options = options || [];
if (options.hasOwnProperty('onTop')) {
onTopDeprecationLogger();
if (options.onTop && options.gravity === undefined) {
options.gravity = 's';
}
}
// attempt to generate a random identifier if it doesn't exist
if (typeof identifier === 'undefined') {
identifier = String(Math.random()).replace('.', '');
// if the generated supplied identifier already exists when combined with the prefixes we'll be using, then bail
if ((0, _jquery2.default)('#inline-dialog-' + identifier + ', #arrow-' + identifier + ', #inline-dialog-shim-' + identifier).length) {
throw 'GENERATED_IDENTIFIER_NOT_UNIQUE';
}
}
var escapedIdentifier = (0, _css2.default)(identifier);
var opts = _jquery2.default.extend(false, InlineDialog.opts, options);
if (opts.gravity === 'w') {
// TODO Once support for gravity: 'e' is added, it should also
// transpose the defaults for offsetX and offsetY.
opts.offsetX = options.offsetX === undefined ? 10 : options.offsetX;
opts.offsetY = options.offsetY === undefined ? 0 : options.offsetY;
}
var hash;
var hideDelayTimer;
var showTimer;
var beingShown = false;
var shouldShow = false;
var contentLoaded = false;
var mousePosition;
var targetPosition;
var popup = (0, _jquery2.default)('<div id="inline-dialog-' + identifier + '" class="aui-inline-dialog"><div class="aui-inline-dialog-contents contents"></div><div id="arrow-' + identifier + '" class="aui-inline-dialog-arrow arrow aui-css-arrow"></div></div>');
var arrow = (0, _jquery2.default)('#arrow-' + escapedIdentifier, popup);
var contents = popup.find('.contents');
if (!opts.displayShadow) {
contents.addClass('aui-inline-dialog-no-shadow');
}
if (opts.autoWidth) {
contents.addClass('aui-inline-dialog-auto-width');
} else {
contents.width(opts.width);
}
contents.on({
mouseenter: function mouseenter() {
clearTimeout(hideDelayTimer);
popup.unbind('mouseenter');
},
mouseleave: function mouseleave() {
hidePopup();
}
});
var getHash = function getHash() {
if (!hash) {
hash = {
popup: popup,
hide: function hide() {
hidePopup(0);
},
id: identifier,
show: function show() {
showPopup();
},
persistent: opts.persistent ? true : false,
reset: function reset() {
function drawPopup(popup, positions) {
//Position the popup using the left and right parameters
popup.css(positions.popupCss);
arrow.removeClass('aui-bottom-arrow aui-left-arrow aui-right-arrow');
if (positions.gravity === 's' && !arrow.hasClass('aui-bottom-arrow')) {
arrow.addClass('aui-bottom-arrow');
} else if (positions.gravity === 'w') {
arrow.addClass('aui-left-arrow');
} else if (positions.gravity === 'e') {
arrow.addClass('aui-right-arrow');
}
// Default styles are for 'n' gravity.
arrow.css(positions.arrowCss);
}
//DRAW POPUP
var viewportHeight = (0, _jquery2.default)(window).height();
var popupMaxHeight = Math.round(viewportHeight * 0.75);
popup.children('.aui-inline-dialog-contents').css('max-height', popupMaxHeight);
var positions = opts.calculatePositions(popup, targetPosition, mousePosition, opts);
if (positions.hasOwnProperty('displayAbove')) {
displayAboveDeprecationLogger();
positions.gravity = positions.displayAbove ? 's' : 'n';
}
drawPopup(popup, positions);
// reset position of popup box
popup.fadeIn(opts.fadeTime, function () {
// once the animation is complete, set the tracker variables
// beingShown = false; // is this necessary? Maybe only the shouldShow will have to be reset?
});
if ((0, _browser.needsLayeringShim)()) {
// iframeShim, prepend if it doesnt exist
var jQueryCache = (0, _jquery2.default)('#inline-dialog-shim-' + escapedIdentifier);
if (!jQueryCache.length) {
(0, _jquery2.default)(popup).prepend((0, _jquery2.default)('<iframe class = "inline-dialog-shim" id="inline-dialog-shim-' + identifier + '" frameBorder="0" src="javascript:false;"></iframe>'));
}
// adjust height and width of shim according to the popup
jQueryCache.css({
width: contents.outerWidth(),
height: contents.outerHeight()
});
}
}
};
}
return hash;
};
var showPopup = function showPopup() {
if (popup.is(':visible')) {
return;
}
showTimer = setTimeout(function () {
if (!contentLoaded || !shouldShow) {
return;
}
opts.addActiveClass && (0, _jquery2.default)(items).addClass('active');
beingShown = true;
if (!opts.persistent) {
bindHideEvents();
}
InlineDialog.current = getHash();
(0, _jquery2.default)(document).trigger('showLayer', ['inlineDialog', getHash()]);
// retrieve the position of the click target. The offsets might be different for different types of targets and therefore
// either have to be customisable or we will have to be smarter about calculating the padding and elements around it
getHash().reset();
}, opts.showDelay);
};
var hidePopup = function hidePopup(delay) {
// do not auto hide the popup if persistent is set as true
if (typeof delay === 'undefined' && opts.persistent) {
return;
}
if (typeof popup.get(0)._datePickerPopup !== 'undefined') {
// AUI-2696 - This inline dialog is host to a date picker... so we shouldn't close it.
return;
}
shouldShow = false;
// only exectute the below if the popup is currently being shown
// and the arbitrator callback gives us the green light
if (beingShown && opts.preHideCallback.call(popup[0].popup)) {
delay = delay == null ? opts.hideDelay : delay;
clearTimeout(hideDelayTimer);
clearTimeout(showTimer);
// store the timer so that it can be cleared in the mouseenter if required
//disable auto-hide if user passes null for hideDelay
if (delay != null) {
hideDelayTimer = setTimeout(function () {
unbindHideEvents();
opts.addActiveClass && (0, _jquery2.default)(items).removeClass('active');
popup.fadeOut(opts.fadeTime, function () {
opts.hideCallback.call(popup[0].popup);
});
beingShown = false;
shouldShow = false;
(0, _jquery2.default)(document).trigger('hideLayer', ['inlineDialog', getHash()]);
InlineDialog.current = null;
if (!opts.cacheContent) {
//if not caching the content, then reset the
//flags to false so as to reload the content
//on next mouse hover.
contentLoaded = false;
contentLoading = false;
}
}, delay);
}
}
};
// the trigger is the jquery element that is triggering the popup (i.e., the element that the mousemove event is bound to)
var initPopup = function initPopup(e, trigger) {
var $trigger = (0, _jquery2.default)(trigger);
opts.upfrontCallback.call({
popup: popup,
hide: function hide() {
hidePopup(0);
},
id: identifier,
show: function show() {
showPopup();
}
});
popup.each(function () {
if (typeof this.popup !== 'undefined') {
this.popup.hide();
}
});
//Close all other popups if neccessary
if (opts.closeOthers) {
(0, _jquery2.default)('.aui-inline-dialog').each(function () {
!this.popup.persistent && this.popup.hide();
});
}
//handle programmatic showing where there is no event
targetPosition = { target: $trigger };
if (!e) {
mousePosition = { x: $trigger.offset().left, y: $trigger.offset().top };
} else {
mousePosition = { x: e.pageX, y: e.pageY };
}
if (!beingShown) {
clearTimeout(showTimer);
}
shouldShow = true;
var doShowPopup = function doShowPopup() {
contentLoading = false;
contentLoaded = true;
opts.initCallback.call({
popup: popup,
hide: function hide() {
hidePopup(0);
},
id: identifier,
show: function show() {
showPopup();
}
});
showPopup();
};
// lazy load popup contents
if (!contentLoading) {
contentLoading = true;
if (_jquery2.default.isFunction(url)) {
// If the passed in URL is a function, execute it. Otherwise simply load the content.
url(contents, trigger, doShowPopup);
} else {
//Retrive response from server
_jquery2.default.get(url, function (data, status, xhr) {
//Load HTML contents into the popup
contents.html(opts.responseHandler(data, status, xhr));
//Show the popup
contentLoaded = true;
opts.initCallback.call({
popup: popup,
hide: function hide() {
hidePopup(0);
},
id: identifier,
show: function show() {
showPopup();
}
});
showPopup();
});
}
}
// stops the hide event if we move from the trigger to the popup element
clearTimeout(hideDelayTimer);
// don't trigger the animation again if we're being shown
if (!beingShown) {
showPopup();
}
return false;
};
popup[0].popup = getHash();
var contentLoading = false;
var added = false;
var appendPopup = function appendPopup() {
if (!added) {
(0, _jquery2.default)(opts.container).append(popup);
added = true;
}
};
var $items = (0, _jquery2.default)(items);
if (opts.onHover) {
if (opts.useLiveEvents) {
// We're using .on() to emulate the behaviour of .live() here. on() requires the jQuery object to have
// a selector - this is actually how .live() is implemented in jQuery 1.7+.
// Note that .selector is deleted in jQuery 1.9+.
// This means that jQuery objects created by selection eg $(".my-class-selector") will work, but
// object created by DOM parsing eg $("<div class='.my-class'></div>") will not work.
// Ideally we should throw an error if the $items has no selector but that is backwards incompatible,
// so we warn and do a no-op - this emulates the behaviour of live() but has the added warning.
if ($items.selector) {
(0, _jquery2.default)(document).on('mouseenter', $items.selector, function (e) {
appendPopup();
initPopup(e, this);
}).on('mouseleave', $items.selector, function () {
hidePopup();
});
} else {
logger.log('Warning: inline dialog trigger elements must have a jQuery selector when the useLiveEvents option is enabled.');
}
} else {
$items.on({
mouseenter: function mouseenter(e) {
appendPopup();
initPopup(e, this);
},
mouseleave: function mouseleave() {
hidePopup();
}
});
}
} else {
if (!opts.noBind) {
//Check if the noBind option is turned on
if (opts.useLiveEvents) {
// See above for why we filter by .selector
if ($items.selector) {
(0, _jquery2.default)(document).on('click', $items.selector, function (e) {
appendPopup();
if (shouldCloseOnTriggerClick()) {
popup.hide();
} else {
initPopup(e, this);
}
return false;
}).on('mouseleave', $items.selector, function () {
hidePopup();
});
} else {
logger.log('Warning: inline dialog trigger elements must have a jQuery selector when the useLiveEvents option is enabled.');
}
} else {
$items.on('click', function (e) {
appendPopup();
if (shouldCloseOnTriggerClick()) {
popup.hide();
} else {
initPopup(e, this);
}
return false;
}).on('mouseleave', function () {
hidePopup();
});
}
}
}
var shouldCloseOnTriggerClick = function shouldCloseOnTriggerClick() {
return beingShown && opts.closeOnTriggerClick;
};
var bindHideEvents = function bindHideEvents() {
bindHideOnExternalClick();
bindHideOnEscPressed();
};
var unbindHideEvents = function unbindHideEvents() {
unbindHideOnExternalClick();
unbindHideOnEscPressed();
};
// Be defensive and make sure that we haven't already bound the event
var hasBoundOnExternalClick = false;
var externalClickNamespace = identifier + '.inline-dialog-check';
/**
* Catch click events on the body to see if the click target occurs outside of this popup
* If it does, the popup will be hidden
*/
var bindHideOnExternalClick = function bindHideOnExternalClick() {
if (!hasBoundOnExternalClick) {
(0, _jquery2.default)('body').bind('click.' + externalClickNamespace, function (e) {
var $target = (0, _jquery2.default)(e.target);
// hide the popup if the target of the event is not in the dialog
if ($target.closest('#inline-dialog-' + escapedIdentifier + ' .contents').length === 0) {
hidePopup(0);
}
});
hasBoundOnExternalClick = true;
}
};
var unbindHideOnExternalClick = function unbindHideOnExternalClick() {
if (hasBoundOnExternalClick) {
(0, _jquery2.default)('body').unbind('click.' + externalClickNamespace);
}
hasBoundOnExternalClick = false;
};
var onKeydown = function onKeydown(e) {
if (e.keyCode === _keyCode2.default.ESCAPE) {
hidePopup(0);
}
};
var bindHideOnEscPressed = function bindHideOnEscPressed() {
(0, _jquery2.default)(document).on('keydown', onKeydown);
};
var unbindHideOnEscPressed = function unbindHideOnEscPressed() {
(0, _jquery2.default)(document).off('keydown', onKeydown);
};
/**
* Show the inline dialog.
* @method show
*/
popup.show = function (e, trigger) {
if (e) {
e.stopPropagation();
}
appendPopup();
if (opts.noBind && !(items && items.length)) {
initPopup(e, trigger === undefined ? e.target : trigger);
} else {
initPopup(e, items);
}
};
/**
* Hide the inline dialog.
* @method hide
*/
popup.hide = function () {
hidePopup(0);
};
/**
* Repositions the inline dialog if being shown.
* @method refresh
*/
popup.refresh = function () {
if (beingShown) {
getHash().reset();
}
};
popup.getOptions = function () {
return opts;
};
return popup;
}
function dimensionsOf(el) {
var $el = (0, _jquery2.default)(el);
var offset = _jquery2.default.extend({ left: 0, top: 0 }, $el.offset());
return {
left: offset.left,
top: offset.top,
width: $el.outerWidth(),
height: $el.outerHeight()
};
}
function getDimensions(popup, targetPosition, mousePosition, opts) {
var offsetX = _jquery2.default.isFunction(opts.offsetX) ? opts.offsetX(popup, targetPosition, mousePosition, opts) : opts.offsetX;
var offsetY = _jquery2.default.isFunction(opts.offsetY) ? opts.offsetY(popup, targetPosition, mousePosition, opts) : opts.offsetY;
var arrowOffsetX = _jquery2.default.isFunction(opts.arrowOffsetX) ? opts.arrowOffsetX(popup, targetPosition, mousePosition, opts) : opts.arrowOffsetX;
var arrowOffsetY = _jquery2.default.isFunction(opts.arrowOffsetY) ? opts.arrowOffsetY(popup, targetPosition, mousePosition, opts) : opts.arrowOffsetY;
// Support positioning inside a scroll container other than <body>
var isConstrainedScroll = opts.container.toLowerCase() !== 'body';
var $scrollContainer = (0, _jquery2.default)(opts.container);
var $scrollWindow = isConstrainedScroll ? (0, _jquery2.default)(opts.container).parent() : (0, _jquery2.default)(window);
var scrollContainerOffset = isConstrainedScroll ? $scrollContainer.offset() : { left: 0, top: 0 };
var scrollWindowOffset = isConstrainedScroll ? $scrollWindow.offset() : { left: 0, top: 0 };
var trigger = targetPosition.target;
var triggerOffset = trigger.offset();
// Support SVG elements as triggers
// TODO Should calculateNorthSouthPositions also try getBBox()?
var triggerBBox = trigger[0].getBBox && trigger[0].getBBox();
return {
// determines how close to the edge the dialog needs to be before it is considered offscreen
screenPadding: 10,
// Min distance arrow needs to be from the edge of the dialog
arrowMargin: 5,
window: {
top: scrollWindowOffset.top,
left: scrollWindowOffset.left,
scrollTop: $scrollWindow.scrollTop(),
scrollLeft: $scrollWindow.scrollLeft(),
width: $scrollWindow.width(),
height: $scrollWindow.height()
},
scrollContainer: {
width: $scrollContainer.width(),
height: $scrollContainer.height()
},
// Position of the trigger is relative to the scroll container
trigger: {
top: triggerOffset.top - scrollContainerOffset.top,
left: triggerOffset.left - scrollContainerOffset.left,
width: triggerBBox ? triggerBBox.width : trigger.outerWidth(),
height: triggerBBox ? triggerBBox.height : trigger.outerHeight()
},
dialog: {
width: popup.width(),
height: popup.height(),
offset: {
top: offsetY,
left: offsetX
}
},
arrow: {
height: popup.find('.arrow').outerHeight(),
offset: {
top: arrowOffsetY,
left: arrowOffsetX
}
}
};
}
function calculateWestPositions(popup, targetPosition, mousePosition, opts) {
var dimensions = getDimensions(popup, targetPosition, mousePosition, opts);
var screenPadding = dimensions.screenPadding;
var win = dimensions.window;
var trigger = dimensions.trigger;
var dialog = dimensions.dialog;
var arrow = dimensions.arrow;
var scrollContainer = dimensions.scrollContainer;
var triggerScrollOffset = {
top: trigger.top - win.scrollTop,
left: trigger.left - win.scrollLeft
};
// Halves - because the browser doesn't do sub-pixel positioning, we need to consistently floor
// all decimal values or you can get 1px jumps in arrow positioning when the dialog's height changes.
var halfTriggerHeight = Math.floor(trigger.height / 2);
var halfPopupHeight = Math.floor(dialog.height / 2);
var halfArrowHeight = Math.floor(arrow.height / 2);
// Figure out where to position the dialog, preferring the right (gravity: 'w').
var spaceOnLeft = triggerScrollOffset.left - dialog.offset.left - screenPadding;
// This implementation may not be suitable for horizontally scrolling containers
var spaceOnRight = scrollContainer.width - triggerScrollOffset.left - trigger.width - dialog.offset.left - screenPadding;
var enoughSpaceOnLeft = spaceOnLeft >= dialog.width;
var enoughSpaceOnRight = spaceOnRight >= dialog.width;
var gravity = !enoughSpaceOnRight && enoughSpaceOnLeft ? 'e' : 'w';
// Screen padding needs to be adjusted if the arrow would extend into it
var arrowScreenTop = triggerScrollOffset.top + halfTriggerHeight - halfArrowHeight;
var arrowScreenBottom = win.height - arrowScreenTop - arrow.height;
screenPadding = Math.min(screenPadding, arrowScreenTop - dimensions.arrowMargin);
screenPadding = Math.min(screenPadding, arrowScreenBottom - dimensions.arrowMargin);
// Figure out if the dialog needs to be adjusted up or down to fit on the screen
var middleOfTrigger = triggerScrollOffset.top + halfTriggerHeight;
var spaceAboveMiddleOfTrigger = Math.max(middleOfTrigger - screenPadding, 0);
var spaceBelowMiddleOfTrigger = Math.max(win.height - middleOfTrigger - screenPadding, 0);
var isOverflowingAbove = halfPopupHeight - dialog.offset.top > spaceAboveMiddleOfTrigger;
var isOverflowingBelow = halfPopupHeight + dialog.offset.top > spaceBelowMiddleOfTrigger;
var popupCss;
var arrowCss;
if (isOverflowingAbove) {
popupCss = {
top: win.scrollTop + screenPadding,
left: gravity === 'w' ? trigger.left + trigger.width + dialog.offset.left : trigger.left - dialog.width - dialog.offset.left
};
arrowCss = {
top: trigger.top + halfTriggerHeight - (popupCss.top + halfArrowHeight)
};
} else if (isOverflowingBelow) {
popupCss = {
top: win.scrollTop + win.height - dialog.height - screenPadding,
left: gravity === 'w' ? trigger.left + trigger.width + dialog.offset.left : trigger.left - dialog.width - dialog.offset.left
};
arrowCss = {
top: trigger.top + halfTriggerHeight - (popupCss.top + halfArrowHeight)
};
} else {
popupCss = {
top: trigger.top + halfTriggerHeight - halfPopupHeight + dialog.offset.top,
left: gravity === 'w' ? trigger.left + trigger.width + dialog.offset.left : trigger.left - dialog.width - dialog.offset.left
};
arrowCss = {
top: halfPopupHeight - halfArrowHeight + arrow.offset.top
};
}
return {
gravity: gravity,
popupCss: popupCss,
arrowCss: arrowCss
};
}
function calculateNorthSouthPositions(popup, targetPosition, mousePosition, opts) {
var offsetX = _jquery2.default.isFunction(opts.offsetX) ? opts.offsetX(popup, targetPosition, mousePosition, opts) : opts.offsetX;
var offsetY = _jquery2.default.isFunction(opts.offsetY) ? opts.offsetY(popup, targetPosition, mousePosition, opts) : opts.offsetY;
var arrowOffsetX = _jquery2.default.isFunction(opts.arrowOffsetX) ? opts.arrowOffsetX(popup, targetPosition, mousePosition, opts) : opts.arrowOffsetX;
var viewportDimensions = dimensionsOf(window);
var targetDimensions = dimensionsOf(targetPosition.target);
var popupDimensions = dimensionsOf(popup);
var arrowDimensions = dimensionsOf(popup.find('.aui-inline-dialog-arrow'));
var middleOfTrigger = targetDimensions.left + targetDimensions.width / 2; //The absolute x position of the middle of the Trigger
var bottomOfViewablePage = (window.pageYOffset || document.documentElement.scrollTop) + viewportDimensions.height;
var SCREEN_PADDING = 10; //determines how close to the edge the dialog needs to be before it is considered offscreen
// Set popup's position (within the viewport)
popupDimensions.top = targetDimensions.top + targetDimensions.height + ~~offsetY;
popupDimensions.left = targetDimensions.left + ~~offsetX;
// Calculate if the popup would render off the side of the viewport
var diff = viewportDimensions.width - (popupDimensions.left + popupDimensions.width + SCREEN_PADDING);
// Set arrow's position (within the popup)
arrowDimensions.left = middleOfTrigger - popupDimensions.left + ~~arrowOffsetX;
// TODO arrowDimensions.top should also use arrowOffsetY.
arrowDimensions.top = -(arrowDimensions.height / 2);
// Check whether the popup should display above or below the trigger
var enoughRoomAbove = targetDimensions.top > popupDimensions.height;
var enoughRoomBelow = popupDimensions.top + popupDimensions.height < bottomOfViewablePage;
var displayAbove = !enoughRoomBelow && enoughRoomAbove || enoughRoomAbove && opts.gravity === 's';
if (displayAbove) {
popupDimensions.top = targetDimensions.top - popupDimensions.height - arrowDimensions.height / 2;
arrowDimensions.top = popupDimensions.height;
}
// Check if the popup should show up relative to the mouse
if (opts.isRelativeToMouse) {
if (diff < 0) {
popupDimensions.right = SCREEN_PADDING;
popupDimensions.left = 'auto';
// TODO Why doesn't arrowDimentions.left here use arrowOffsetX?
arrowDimensions.left = mousePosition.x - (viewportDimensions.width - popupDimensions.width);
} else {
popupDimensions.left = mousePosition.x - 20;
// TODO Why doesn't arrowDimentions.left here use arrowOffsetX?
arrowDimensions.left = mousePosition.x - popupDimensions.left;
}
} else {
if (diff < 0) {
popupDimensions.right = SCREEN_PADDING;
popupDimensions.left = 'auto';
var popupRightEdge = viewportDimensions.width - popupDimensions.right;
var popupLeftEdge = popupRightEdge - popupDimensions.width;
//arrow's position must be relative to the popup's position and not of the screen.
arrowDimensions.right = 'auto';
// TODO Why doesn't arrowDimentions.left here use arrowOffsetX?
arrowDimensions.left = middleOfTrigger - popupLeftEdge - arrowDimensions.width / 2;
} else if (popupDimensions.width <= targetDimensions.width / 2) {
// TODO Why doesn't arrowDimentions.left here use arrowOffsetX?
arrowDimensions.left = popupDimensions.width / 2;
popupDimensions.left = middleOfTrigger - popupDimensions.width / 2;
}
}
return {
gravity: displayAbove ? 's' : 'n',
displayAbove: displayAbove, // Replaced with gravity but remains for backward compatibility.
popupCss: {
left: popupDimensions.left,
top: popupDimensions.top,
right: popupDimensions.right
},
arrowCss: {
left: arrowDimensions.left,
top: arrowDimensions.top,
right: arrowDimensions.right
}
};
}
InlineDialog.opts = {
onTop: false,
responseHandler: function responseHandler(data) {
//assume data is html
return data;
},
closeOthers: true,
isRelativeToMouse: false,
addActiveClass: true, // if false, signifies that the triggers should not have the "active" class applied
onHover: false,
useLiveEvents: false,
noBind: false,
fadeTime: 100,
persistent: false,
hideDelay: 10000,
showDelay: 0,
width: 300,
offsetX: 0,
offsetY: 10,
arrowOffsetX: 0,
arrowOffsetY: 0,
container: 'body',
cacheContent: true,
displayShadow: true,
autoWidth: false,
gravity: 'n',
closeOnTriggerClick: false,
preHideCallback: function preHideCallback() {
return true;
},
hideCallback: function hideCallback() {}, // if defined, this method will be exected after the popup has been faded out.
initCallback: function initCallback() {}, // A function called after the popup contents are loaded. `this` will be the popup jQuery object, and the first argument is the popup identifier.
upfrontCallback: function upfrontCallback() {}, // A function called before the popup contents are loaded. `this` will be the popup jQuery object, and the first argument is the popup identifier.
/**
* Returns an object with the following attributes:
* popupCss css attributes to apply on the popup element
* arrowCss css attributes to apply on the arrow element
*
* @param popup
* @param targetPosition position of the target element
* @param mousePosition current mouse position
* @param opts options
*/
calculatePositions: function calculatePositions(popup, targetPosition, mousePosition, opts) {
opts = opts || {};
var algorithm = opts.gravity === 'w' ? calculateWestPositions : calculateNorthSouthPositions;
return algorithm(popup, targetPosition, mousePosition, opts);
}
};
// Deprecations
// ------------
InlineDialog = deprecate.construct(InlineDialog, 'Inline dialog constructor', {
alternativeName: 'inline dialog 2'
});
var displayAboveDeprecationLogger = deprecate.getMessageLogger('displayAbove', '[remove version]', {
alternativeName: 'gravity',
extraInfo: 'See https://ecosystem.atlassian.net/browse/AUI-2197.'
});
var onTopDeprecationLogger = deprecate.getMessageLogger('onTop', '[remove version]', {
alternativeName: 'gravity',
extraInfo: 'See https://ecosystem.atlassian.net/browse/AUI-2197.'
});
// Exporting
// ---------
(0, _globalize2.default)('InlineDialog', InlineDialog);
exports.default = InlineDialog;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/format.js
(typeof window === 'undefined' ? global : window).__fc46eb408dec032237a215988716adad = (function () {
var module = {
exports: {}
};
var exports = module.exports;
/* eslint no-cond-assign: off */
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Replaces tokens in a string with arguments, similar to Java's MessageFormat.
* Tokens are in the form {0}, {1}, {2}, etc.
*
* This version also provides support for simple choice formats (excluding floating point numbers) of the form
* {0,choice,0#0 issues|1#1 issue|1<{0,number} issues}
*
* Number format is currently not implemented, tokens of the form {0,number} will simply be printed as {0}
*
* @method format
* @param message the message to replace tokens in
* @param arg (optional) replacement value for token {0}, with subsequent arguments being {1}, etc.
* @return {String} the message with the tokens replaced
* @usage formatString("This is a {0} test", "simple");
*/
function formatString(message) {
var apos = /'(?!')/g; // founds "'", but not "''" // TODO: does not work for floating point numbers!
var simpleFormat = /^\d+$/;
var numberFormat = /^(\d+),number$/; // TODO: incomplete, as doesn't support floating point numbers
var choiceFormat = /^(\d+)\,choice\,(.+)/;
var choicePart = /^(\d+)([#<])(.+)/;
// we are caching RegExps, so will not spend time on recreating them on each call
// formats a value, currently choice and simple replacement are implemented, proper
var getParamValue = function getParamValue(format, args) {
// simple substitute
var res = '';
var match;
if (match = format.match(simpleFormat)) {
// TODO: heavy guns for checking whether format is a simple number...
res = args.length > ++format ? args[format] : ''; // use the argument as is, or use '' if not found
}
// number format
else if (match = format.match(numberFormat)) {
// TODO: doesn't actually format the number...
res = args.length > ++match[1] ? args[match[1]] : '';
}
// choice format
else if (match = format.match(choiceFormat)) {
// format: "0,choice,0#0 issues|1#1 issue|1<{0,number} issues"
// match[0]: "0,choice,0#0 issues|1#1 issue|1<{0,number} issues"
// match[1]: "0"
// match[2]: "0#0 issues|1#1 issue|1<{0,number} issues"
// get the argument value we base the choice on
var value = args.length > ++match[1] ? args[match[1]] : null;
if (value !== null) {
// go through all options, checking against the number, according to following formula,
// if X < the first entry then the first entry is returned, if X > last entry, the last entry is returned
//
// X matches j if and only if limit[j] <= X < limit[j+1]
//
var options = match[2].split('|');
var prevOptionValue = null; // holds last passed option
for (var i = 0; i < options.length; i++) {
// option: "0#0 issues"
// part[0]: "0#0 issues"
// part[1]: "0"
// part[2]: "#"
// part[3]" "0 issues";
var parts = options[i].match(choicePart);
// if value is smaller, we take the previous value, or the current if no previous exists
var argValue = parseInt(parts[1], 10);
if (value < argValue) {
if (prevOptionValue) {
res = prevOptionValue;
break;
} else {
res = parts[3];
break;
}
}
// if value is equal the condition, and the match is equality match we accept it
if (value == argValue && parts[2] == '#') {
res = parts[3];
break;
} else {}
// value is greater the condition, fall through to next iteration
// check whether we are the last option, in which case accept it even if the option does not match
if (i == options.length - 1) {
res = parts[3];
}
// retain current option
prevOptionValue = parts[3];
}
// run result through format, as the parts might contain substitutes themselves
var formatArgs = [res].concat(Array.prototype.slice.call(args, 1));
res = formatString.apply(null, formatArgs);
}
}
return res;
};
// drop in replacement for the token regex
// splits the message to return the next accurance of a i18n placeholder.
// Does not use regexps as we need to support nested placeholders
// text between single ticks ' are ignored
var _performTokenRegex = function _performTokenRegex(message) {
var tick = false;
var openIndex = -1;
var openCount = 0;
for (var i = 0; i < message.length; i++) {
// handle ticks
var c = message.charAt(i);
if (c == "'") {
// toggle
tick = !tick;
}
// skip if we are between ticks
if (tick) {
continue;
}
// check open brackets
if (c === '{') {
if (openCount === 0) {
openIndex = i;
}
openCount++;
} else if (c === '}') {
if (openCount > 0) {
openCount--;
if (openCount === 0) {
// we found a bracket match - generate the result array (
var match = [];
match.push(message.substring(0, i + 1)); // from begin to match
match.push(message.substring(0, openIndex)); // everything until match start
match.push(message.substring(openIndex + 1, i)); // matched content
return match;
}
}
}
}
return null;
};
var _formatString = function _formatString(message) {
var args = arguments;
var res = '';
if (!message) {
return res;
}
var match = _performTokenRegex(message);
while (match) {
// reduce message to string after match
message = message.substring(match[0].length);
// add value before match to result
res += match[1].replace(apos, '');
// add formatted parameter
res += getParamValue(match[2], args);
// check for next match
match = _performTokenRegex(message); //message.match(token);
}
// add remaining message to result
res += message.replace(apos, '');
return res;
};
return _formatString.apply(null, arguments);
}
(0, _globalize2.default)('format', formatString);
exports.default = formatString;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/i18n/aui.js
(typeof window === 'undefined' ? global : window).__73761d26d9c581620754acbd99deb9a2 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
'aui.dropdown.async.error': 'Error loading dropdown',
'aui.dropdown.async.loading': 'Loading dropdown',
'aui.words.add': 'Add',
'aui.words.update': 'Update',
'aui.words.delete': 'Delete',
'aui.words.remove': 'Remove',
'aui.words.cancel': 'Cancel',
'aui.words.loading': 'Loading',
'aui.words.close': 'Close',
'aui.enter.value': 'Enter value',
'aui.words.more': 'More',
'aui.words.moreitem': 'Moreโฆ',
'aui.keyboard.shortcut.type.x': "Type ''{0}''",
'aui.keyboard.shortcut.then.x': "then ''{0}''",
'aui.keyboard.shortcut.or.x': "OR ''{0}''",
'aui.sidebar.expand.tooltip': 'Expand sidebar ( [ )',
'aui.sidebar.collapse.tooltip': 'Collapse sidebar ( [ )',
'aui.validation.message.maxlength': 'Must be fewer than or equal to {0} characters',
'aui.validation.message.minlength': 'Must be greater than or equal to {0} characters',
'aui.validation.message.exactlength': 'Must be exactly {0} characters',
'aui.validation.message.matchingfield': '{0} and {1} do not match.',
'aui.validation.message.matchingfield-novalue': 'These fields do not match.',
'aui.validation.message.doesnotcontain': 'Do not include the phrase {0} in this field',
'aui.validation.message.pattern': 'This field does not match the required format',
'aui.validation.message.required': 'This is a required field',
'aui.validation.message.validnumber': 'Please enter a valid number',
'aui.validation.message.min': 'Enter a value greater than {0}',
'aui.validation.message.max': 'Enter a value less than {0}',
'aui.validation.message.dateformat': 'Enter a valid date',
'aui.validation.message.minchecked': 'Tick at least {0,choice,0#0 checkboxes|1#1 checkbox|1<{0,number} checkboxes}.',
'aui.validation.message.maxchecked': 'Tick at most {0,choice,0#0 checkboxes|1#1 checkbox|1<{0,number} checkboxes}.',
'aui.checkboxmultiselect.clear.selected': 'Clear selected items',
'aui.select.no.suggestions': 'No suggestions',
'aui.select.new.suggestions': 'New suggestions added. Please use the up and down arrows to select.',
'aui.select.new.value': 'new value',
'aui.toggle.on': 'On',
'aui.toggle.off': 'Off',
'ajs.datepicker.localisations.day-names.sunday': 'Sunday',
'ajs.datepicker.localisations.day-names.monday': 'Monday',
'ajs.datepicker.localisations.day-names.tuesday': 'Tuesday',
'ajs.datepicker.localisations.day-names.wednesday': 'Wednesday',
'ajs.datepicker.localisations.day-names.thursday': 'Thursday',
'ajs.datepicker.localisations.day-names.friday': 'Friday',
'ajs.datepicker.localisations.day-names.saturday': 'Saturday',
'ajs.datepicker.localisations.day-names-min.sunday': 'Sun',
'ajs.datepicker.localisations.day-names-min.monday': 'Mon',
'ajs.datepicker.localisations.day-names-min.tuesday': 'Tue',
'ajs.datepicker.localisations.day-names-min.wednesday': 'Wed',
'ajs.datepicker.localisations.day-names-min.thursday': 'Thu',
'ajs.datepicker.localisations.day-names-min.friday': 'Fri',
'ajs.datepicker.localisations.day-names-min.saturday': 'Sat',
'ajs.datepicker.localisations.first-day': 0,
'ajs.datepicker.localisations.is-RTL': false,
'ajs.datepicker.localisations.month-names.january': 'January',
'ajs.datepicker.localisations.month-names.february': 'February',
'ajs.datepicker.localisations.month-names.march': 'March',
'ajs.datepicker.localisations.month-names.april': 'April',
'ajs.datepicker.localisations.month-names.may': 'May',
'ajs.datepicker.localisations.month-names.june': 'June',
'ajs.datepicker.localisations.month-names.july': 'July',
'ajs.datepicker.localisations.month-names.august': 'August',
'ajs.datepicker.localisations.month-names.september': 'September',
'ajs.datepicker.localisations.month-names.october': 'October',
'ajs.datepicker.localisations.month-names.november': 'November',
'ajs.datepicker.localisations.month-names.december': 'December',
'ajs.datepicker.localisations.show-month-after-year': false,
'ajs.datepicker.localisations.year-suffix': null
};
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/i18n.js
(typeof window === 'undefined' ? global : window).__ed74109c4e727b6405515053222f381b = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _format = __fc46eb408dec032237a215988716adad;
var _format2 = _interopRequireDefault(_format);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _aui = __73761d26d9c581620754acbd99deb9a2;
var _aui2 = _interopRequireDefault(_aui);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Returns the value defined in AJS.I18n.keys for the given key. If AJS.I18n.keys does not exist, or if the given key does not exist,
* the key is returned - this could occur in plugin mode if the I18n transform is not performed;
* or in flatpack mode if the i18n JS file is not loaded.
*/
var i18n = {
keys: _aui2.default,
getText: function getText(key) {
var params = Array.prototype.slice.call(arguments, 1);
if (Object.prototype.hasOwnProperty.call(this.keys, key)) {
return _format2.default.apply(null, [this.keys[key]].concat(params));
}
return key;
}
};
(0, _globalize2.default)('I18n', i18n);
exports.default = i18n;
module.exports = exports['default'];
return module.exports;
}).call(this);
// node_modules/skatejs/lib/constants.js
(typeof window === 'undefined' ? global : window).__d1943092751b2a1c4820e92eb7e9de1d = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__d1943092751b2a1c4820e92eb7e9de1d");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
}
})(function (exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var ATTR_IGNORE = "data-skate-ignore";
exports.ATTR_IGNORE = ATTR_IGNORE;
var TYPE_ATTRIBUTE = "a";
exports.TYPE_ATTRIBUTE = TYPE_ATTRIBUTE;
var TYPE_CLASSNAME = "c";
exports.TYPE_CLASSNAME = TYPE_CLASSNAME;
var TYPE_ELEMENT = "t";
exports.TYPE_ELEMENT = TYPE_ELEMENT;
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/version.js
(typeof window === 'undefined' ? global : window).__965e6d3da9aea63630affcf0bd4c477d = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__965e6d3da9aea63630affcf0bd4c477d");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module);
}
})(function (exports, module) {
module.exports = "0.13.17";
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/globals.js
(typeof window === 'undefined' ? global : window).__06e3f58f6e0f578762178198b8f2bc48 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./version": __965e6d3da9aea63630affcf0bd4c477d,
"./version": __965e6d3da9aea63630affcf0bd4c477d
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__06e3f58f6e0f578762178198b8f2bc48");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module", "./version"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module, __965e6d3da9aea63630affcf0bd4c477d);
}
})(function (exports, module, _version) {
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
var version = _interopRequire(_version);
var VERSION = "__skate_" + version.replace(/[^\w]/g, "_");
if (!window[VERSION]) {
window[VERSION] = {
observer: undefined,
registry: {}
};
}
module.exports = window[VERSION];
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/data.js
(typeof window === 'undefined' ? global : window).__95ce7c75b8462be8e6cc451ff350ed01 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__95ce7c75b8462be8e6cc451ff350ed01");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module);
}
})(function (exports, module) {
module.exports = function (element) {
var namespace = arguments[1] === undefined ? "" : arguments[1];
var data = element.__SKATE_DATA || (element.__SKATE_DATA = {});
return namespace && (data[namespace] || (data[namespace] = {})) || data;
};
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/mutation-observer.js
(typeof window === 'undefined' ? global : window).__03ca3eddefb96bc06be807c495751c7f = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__03ca3eddefb96bc06be807c495751c7f");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
}
})(function (exports) {
(function (self) {
// Atlassian: added IIFE
/**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
// @version 0.7.15
if (typeof WeakMap === "undefined") {
(function () {
var defineProperty = Object.defineProperty;
var counter = Date.now() % 1000000000;
var WeakMap = function WeakMap() {
this.name = "__st" + (Math.random() * 1000000000 >>> 0) + (counter++ + "__");
};
WeakMap.prototype = {
set: function set(key, value) {
var entry = key[this.name];
if (entry && entry[0] === key) entry[1] = value;else defineProperty(key, this.name, {
value: [key, value],
writable: true
});
return this;
},
get: function get(key) {
var entry;
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
},
"delete": function _delete(key) {
var entry = key[this.name];
if (!entry || entry[0] !== key) {
return false;
}entry[0] = entry[1] = undefined;
return true;
},
has: function has(key) {
var entry = key[this.name];
if (!entry) {
return false;
}return entry[0] === key;
}
};
window.WeakMap = WeakMap;
})();
}
(function (global) {
if (global.JsMutationObserver) {
return;
}
var registrationsTable = new WeakMap();
var setImmediate;
if (/Trident|Edge/.test(navigator.userAgent)) {
setImmediate = setTimeout;
} else if (window.setImmediate) {
setImmediate = window.setImmediate;
} else {
var setImmediateQueue = [];
var sentinel = String(Math.random());
window.addEventListener("message", function (e) {
if (e.data === sentinel) {
var queue = setImmediateQueue;
setImmediateQueue = [];
queue.forEach(function (func) {
func();
});
}
});
setImmediate = function (func) {
setImmediateQueue.push(func);
window.postMessage(sentinel, "*");
};
}
var isScheduled = false;
var scheduledObservers = [];
function scheduleCallback(observer) {
scheduledObservers.push(observer);
if (!isScheduled) {
isScheduled = true;
setImmediate(dispatchCallbacks);
}
}
function wrapIfNeeded(node) {
return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
}
function dispatchCallbacks() {
isScheduled = false;
var observers = scheduledObservers;
scheduledObservers = [];
observers.sort(function (o1, o2) {
return o1.uid_ - o2.uid_;
});
var anyNonEmpty = false;
observers.forEach(function (observer) {
var queue = observer.takeRecords();
removeTransientObserversFor(observer);
if (queue.length) {
observer.callback_(queue, observer);
anyNonEmpty = true;
}
});
if (anyNonEmpty) dispatchCallbacks();
}
function removeTransientObserversFor(observer) {
observer.nodes_.forEach(function (node) {
var registrations = registrationsTable.get(node);
if (!registrations) return;
registrations.forEach(function (registration) {
if (registration.observer === observer) registration.removeTransientObservers();
});
});
}
function forEachAncestorAndObserverEnqueueRecord(target, callback) {
for (var node = target; node; node = node.parentNode) {
var registrations = registrationsTable.get(node);
if (registrations) {
for (var j = 0; j < registrations.length; j++) {
var registration = registrations[j];
var options = registration.options;
if (node !== target && !options.subtree) continue;
var record = callback(options);
if (record) registration.enqueue(record);
}
}
}
}
var uidCounter = 0;
function JsMutationObserver(callback) {
this.callback_ = callback;
this.nodes_ = [];
this.records_ = [];
this.uid_ = ++uidCounter;
}
JsMutationObserver.prototype = {
observe: function observe(target, options) {
target = wrapIfNeeded(target);
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
throw new SyntaxError();
}
var registrations = registrationsTable.get(target);
if (!registrations) registrationsTable.set(target, registrations = []);
var registration;
for (var i = 0; i < registrations.length; i++) {
if (registrations[i].observer === this) {
registration = registrations[i];
registration.removeListeners();
registration.options = options;
break;
}
}
if (!registration) {
registration = new Registration(this, target, options);
registrations.push(registration);
this.nodes_.push(target);
}
registration.addListeners();
},
disconnect: function disconnect() {
this.nodes_.forEach(function (node) {
var registrations = registrationsTable.get(node);
for (var i = 0; i < registrations.length; i++) {
var registration = registrations[i];
if (registration.observer === this) {
registration.removeListeners();
registrations.splice(i, 1);
break;
}
}
}, this);
this.records_ = [];
},
takeRecords: function takeRecords() {
var copyOfRecords = this.records_;
this.records_ = [];
return copyOfRecords;
}
};
function MutationRecord(type, target) {
this.type = type;
this.target = target;
this.addedNodes = [];
this.removedNodes = [];
this.previousSibling = null;
this.nextSibling = null;
this.attributeName = null;
this.attributeNamespace = null;
this.oldValue = null;
}
function copyMutationRecord(original) {
var record = new MutationRecord(original.type, original.target);
record.addedNodes = original.addedNodes.slice();
record.removedNodes = original.removedNodes.slice();
record.previousSibling = original.previousSibling;
record.nextSibling = original.nextSibling;
record.attributeName = original.attributeName;
record.attributeNamespace = original.attributeNamespace;
record.oldValue = original.oldValue;
return record;
}
var currentRecord, recordWithOldValue;
function getRecord(type, target) {
return currentRecord = new MutationRecord(type, target);
}
function getRecordWithOldValue(oldValue) {
if (recordWithOldValue) {
return recordWithOldValue;
}recordWithOldValue = copyMutationRecord(currentRecord);
recordWithOldValue.oldValue = oldValue;
return recordWithOldValue;
}
function clearRecords() {
currentRecord = recordWithOldValue = undefined;
}
function recordRepresentsCurrentMutation(record) {
return record === recordWithOldValue || record === currentRecord;
}
function selectRecord(lastRecord, newRecord) {
if (lastRecord === newRecord) {
return lastRecord;
}if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) {
return recordWithOldValue;
}return null;
}
function Registration(observer, target, options) {
this.observer = observer;
this.target = target;
this.options = options;
this.transientObservedNodes = [];
}
Registration.prototype = {
enqueue: function enqueue(record) {
var records = this.observer.records_;
var length = records.length;
if (records.length > 0) {
var lastRecord = records[length - 1];
var recordToReplaceLast = selectRecord(lastRecord, record);
if (recordToReplaceLast) {
records[length - 1] = recordToReplaceLast;
return;
}
} else {
scheduleCallback(this.observer);
}
records[length] = record;
},
addListeners: function addListeners() {
this.addListeners_(this.target);
},
addListeners_: function addListeners_(node) {
var options = this.options;
if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
},
removeListeners: function removeListeners() {
this.removeListeners_(this.target);
},
removeListeners_: function removeListeners_(node) {
var options = this.options;
if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
},
addTransientObserver: function addTransientObserver(node) {
if (node === this.target) {
return;
}this.addListeners_(node);
this.transientObservedNodes.push(node);
var registrations = registrationsTable.get(node);
if (!registrations) registrationsTable.set(node, registrations = []);
registrations.push(this);
},
removeTransientObservers: function removeTransientObservers() {
var transientObservedNodes = this.transientObservedNodes;
this.transientObservedNodes = [];
transientObservedNodes.forEach(function (node) {
this.removeListeners_(node);
var registrations = registrationsTable.get(node);
for (var i = 0; i < registrations.length; i++) {
if (registrations[i] === this) {
registrations.splice(i, 1);
break;
}
}
}, this);
},
handleEvent: function handleEvent(e) {
e.stopImmediatePropagation();
switch (e.type) {
case "DOMAttrModified":
var name = e.attrName;
var namespace = e.relatedNode.namespaceURI;
var target = e.target;
var record = new getRecord("attributes", target);
record.attributeName = name;
record.attributeNamespace = namespace;
var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
forEachAncestorAndObserverEnqueueRecord(target, function (options) {
if (!options.attributes) return;
if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
return;
}
if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
return record;
});
break;
case "DOMCharacterDataModified":
var target = e.target;
var record = getRecord("characterData", target);
var oldValue = e.prevValue;
forEachAncestorAndObserverEnqueueRecord(target, function (options) {
if (!options.characterData) return;
if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
return record;
});
break;
case "DOMNodeRemoved":
this.addTransientObserver(e.target);
case "DOMNodeInserted":
var changedNode = e.target;
var addedNodes, removedNodes;
if (e.type === "DOMNodeInserted") {
addedNodes = [changedNode];
removedNodes = [];
} else {
addedNodes = [];
removedNodes = [changedNode];
}
var previousSibling = changedNode.previousSibling;
var nextSibling = changedNode.nextSibling;
var record = getRecord("childList", e.target.parentNode);
record.addedNodes = addedNodes;
record.removedNodes = removedNodes;
record.previousSibling = previousSibling;
record.nextSibling = nextSibling;
forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function (options) {
if (!options.childList) return;
return record;
});
}
clearRecords();
}
};
global.JsMutationObserver = JsMutationObserver;
if (!global.MutationObserver) {
global.MutationObserver = JsMutationObserver;
JsMutationObserver._isPolyfilled = true;
}
})(self);
})(window); // Atlassian: added IIFE
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/utils.js
(typeof window === 'undefined' ? global : window).__fbddd2b55da17b618c8ec248b1d28b31 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./constants": __d1943092751b2a1c4820e92eb7e9de1d,
"./constants": __d1943092751b2a1c4820e92eb7e9de1d
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__fbddd2b55da17b618c8ec248b1d28b31");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "./constants"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, __d1943092751b2a1c4820e92eb7e9de1d);
}
})(function (exports, _constants) {
/**
* Checks {}.hasOwnProperty in a safe way.
*
* @param {Object} obj The object the property is on.
* @param {String} key The object key to check.
*
* @returns {Boolean}
*/
exports.hasOwn = hasOwn;
/**
* Camel-cases the specified string.
*
* @param {String} str The string to camel-case.
*
* @returns {String}
*/
exports.camelCase = camelCase;
/**
* Returns whether or not the source element contains the target element.
* This is for browsers that don't support Element.prototype.contains on an
* HTMLUnknownElement.
*
* @param {HTMLElement} source The source element.
* @param {HTMLElement} target The target element.
*
* @returns {Boolean}
*/
exports.elementContains = elementContains;
/**
* Returns a function that will prevent more than one call in a single clock
* tick.
*
* @param {Function} fn The function to call.
*
* @returns {Function}
*/
exports.debounce = debounce;
/**
* Returns whether or not the specified element has been selectively ignored.
*
* @param {Element} element The element to check and traverse up from.
*
* @returns {Boolean}
*/
exports.getClosestIgnoredElement = getClosestIgnoredElement;
/**
* Merges the second argument into the first.
*
* @param {Object} child The object to merge into.
* @param {Object} parent The object to merge from.
* @param {Boolean} overwrite Whether or not to overwrite properties on the child.
*
* @returns {Object} Returns the child object.
*/
exports.inherit = inherit;
/**
* Traverses an object checking hasOwnProperty.
*
* @param {Object} obj The object to traverse.
* @param {Function} fn The function to call for each item in the object.
*
* @returns {undefined}
*/
exports.objEach = objEach;
exports.supportsNativeCustomElements = supportsNativeCustomElements;
exports.isValidNativeCustomElementName = isValidNativeCustomElementName;
Object.defineProperty(exports, "__esModule", {
value: true
});
var ATTR_IGNORE = _constants.ATTR_IGNORE;
var elementPrototype = window.HTMLElement.prototype;
exports.elementPrototype = elementPrototype;
var elementPrototypeContains = elementPrototype.contains;
function hasOwn(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
function camelCase(str) {
return str.split(/-/g).map(function (str, index) {
return index === 0 ? str : str[0].toUpperCase() + str.substring(1);
}).join("");
}
function elementContains(source, target) {
// The document element does not have the contains method in IE.
if (source === document && !source.contains) {
return document.head.contains(target) || document.body.contains(target);
}
return source.contains ? source.contains(target) : elementPrototypeContains.call(source, target);
}
function debounce(fn) {
var called = false;
return function () {
if (!called) {
called = true;
setTimeout(function () {
called = false;
fn();
}, 1);
}
};
}
function getClosestIgnoredElement(element) {
var parent = element;
// e.g. document doesn't have a function hasAttribute; no need to go further up
while (parent instanceof Element) {
if (parent.hasAttribute(ATTR_IGNORE)) {
return parent;
}
parent = parent.parentNode;
}
}
function inherit(child, parent, overwrite) {
var names = Object.getOwnPropertyNames(parent);
var namesLen = names.length;
for (var a = 0; a < namesLen; a++) {
var name = names[a];
if (overwrite || child[name] === undefined) {
var desc = Object.getOwnPropertyDescriptor(parent, name);
var shouldDefineProps = desc.get || desc.set || !desc.writable || !desc.enumerable || !desc.configurable;
if (shouldDefineProps) {
Object.defineProperty(child, name, desc);
} else {
child[name] = parent[name];
}
}
}
return child;
}
function objEach(obj, fn) {
for (var a in obj) {
if (hasOwn(obj, a)) {
fn(obj[a], a);
}
}
}
function supportsNativeCustomElements() {
return typeof document.registerElement === "function";
}
function isValidNativeCustomElementName(name) {
return name.indexOf("-") > 0;
}
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/registry.js
(typeof window === 'undefined' ? global : window).__c6a2470f69b4b0cecfde78396d749fdd = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./constants": __d1943092751b2a1c4820e92eb7e9de1d,
"./globals": __06e3f58f6e0f578762178198b8f2bc48,
"./utils": __fbddd2b55da17b618c8ec248b1d28b31,
"./constants": __d1943092751b2a1c4820e92eb7e9de1d,
"./globals": __06e3f58f6e0f578762178198b8f2bc48,
"./utils": __fbddd2b55da17b618c8ec248b1d28b31
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__c6a2470f69b4b0cecfde78396d749fdd");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module", "./constants", "./globals", "./utils"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module, __d1943092751b2a1c4820e92eb7e9de1d, __06e3f58f6e0f578762178198b8f2bc48, __fbddd2b55da17b618c8ec248b1d28b31);
}
})(function (exports, module, _constants, _globals, _utils) {
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
var TYPE_ATTRIBUTE = _constants.TYPE_ATTRIBUTE;
var TYPE_CLASSNAME = _constants.TYPE_CLASSNAME;
var TYPE_ELEMENT = _constants.TYPE_ELEMENT;
var globals = _interopRequire(_globals);
var hasOwn = _utils.hasOwn;
var isValidNativeCustomElementName = _utils.isValidNativeCustomElementName;
var supportsNativeCustomElements = _utils.supportsNativeCustomElements;
/**
* Returns the class list for the specified element.
*
* @param {Element} element The element to get the class list for.
*
* @returns {ClassList | Array}
*/
function getClassList(element) {
var classList = element.classList;
if (classList) {
return classList;
}
var attrs = element.attributes;
return attrs["class"] && attrs["class"].nodeValue.split(/\s+/) || [];
}
module.exports = {
clear: function clear() {
globals.registry = {};
return this;
},
get: function get(id) {
return hasOwn(globals.registry, id) && globals.registry[id];
},
getForElement: function getForElement(element) {
var attrs = element.attributes;
var attrsLen = attrs.length;
var definitions = [];
var isAttr = attrs.is;
var isAttrValue = isAttr && (isAttr.value || isAttr.nodeValue);
// Using localName as fallback for edge cases when processing <object> tag that is used
// as inteface to NPAPI plugin.
var tag = (element.tagName || element.localName).toLowerCase();
var isAttrOrTag = isAttrValue || tag;
var definition;
var tagToExtend;
if (this.isType(isAttrOrTag, TYPE_ELEMENT)) {
definition = globals.registry[isAttrOrTag];
tagToExtend = definition["extends"];
if (isAttrValue) {
if (tag === tagToExtend) {
definitions.push(definition);
}
} else if (!tagToExtend) {
definitions.push(definition);
}
}
for (var a = 0; a < attrsLen; a++) {
var attr = attrs[a].nodeName;
if (this.isType(attr, TYPE_ATTRIBUTE)) {
definition = globals.registry[attr];
tagToExtend = definition["extends"];
if (!tagToExtend || tag === tagToExtend) {
definitions.push(definition);
}
}
}
var classList = getClassList(element);
var classListLen = classList.length;
for (var b = 0; b < classListLen; b++) {
var className = classList[b];
if (this.isType(className, TYPE_CLASSNAME)) {
definition = globals.registry[className];
tagToExtend = definition["extends"];
if (!tagToExtend || tag === tagToExtend) {
definitions.push(definition);
}
}
}
return definitions;
},
isType: function isType(id, type) {
var def = this.get(id);
return def && def.type === type;
},
isNativeCustomElement: function isNativeCustomElement(id) {
return supportsNativeCustomElements() && this.isType(id, TYPE_ELEMENT) && isValidNativeCustomElementName(id);
},
set: function set(id, definition) {
if (hasOwn(globals.registry, id)) {
throw new Error("A component definition of type \"" + definition.type + "\" with the ID of \"" + id + "\" already exists.");
}
globals.registry[id] = definition;
return this;
}
};
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/lifecycle.js
(typeof window === 'undefined' ? global : window).__3968c781f57c50c16e1f01ed9198b141 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./constants": __d1943092751b2a1c4820e92eb7e9de1d,
"./data": __95ce7c75b8462be8e6cc451ff350ed01,
"./mutation-observer": __03ca3eddefb96bc06be807c495751c7f,
"./registry": __c6a2470f69b4b0cecfde78396d749fdd,
"./utils": __fbddd2b55da17b618c8ec248b1d28b31,
"./constants": __d1943092751b2a1c4820e92eb7e9de1d,
"./data": __95ce7c75b8462be8e6cc451ff350ed01,
"./mutation-observer": __03ca3eddefb96bc06be807c495751c7f,
"./registry": __c6a2470f69b4b0cecfde78396d749fdd,
"./utils": __fbddd2b55da17b618c8ec248b1d28b31
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__3968c781f57c50c16e1f01ed9198b141");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "./constants", "./data", "./mutation-observer", "./registry", "./utils"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, __d1943092751b2a1c4820e92eb7e9de1d, __95ce7c75b8462be8e6cc451ff350ed01, __03ca3eddefb96bc06be807c495751c7f, __c6a2470f69b4b0cecfde78396d749fdd, __fbddd2b55da17b618c8ec248b1d28b31);
}
})(function (exports, _constants, _data, _mutationObserver, _registry, _utils) {
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
Object.defineProperty(exports, "__esModule", {
value: true
});
var ATTR_IGNORE = _constants.ATTR_IGNORE;
var data = _interopRequire(_data);
var registry = _interopRequire(_registry);
var camelCase = _utils.camelCase;
var elementContains = _utils.elementContains;
var hasOwn = _utils.hasOwn;
var inherit = _utils.inherit;
var objEach = _utils.objEach;
var Node = window.Node;
//jshint ignore:line
var elProto = window.HTMLElement.prototype;
var nativeMatchesSelector = elProto.matches || elProto.msMatchesSelector || elProto.webkitMatchesSelector || elProto.mozMatchesSelector || elProto.oMatchesSelector;
// Only IE9 has this msMatchesSelector bug, but best to detect it.
var hasNativeMatchesSelectorDetattachedBug = !nativeMatchesSelector.call(document.createElement("div"), "div");
var matchesSelector = function matchesSelector(element, selector) {
if (hasNativeMatchesSelectorDetattachedBug) {
var clone = element.cloneNode();
document.createElement("div").appendChild(clone);
return nativeMatchesSelector.call(clone, selector);
}
return nativeMatchesSelector.call(element, selector);
};
// Edge has a bug where oldValue is sent as null instead of the true oldValue
// when an element attribute is removed. Bug raised at
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7711883/
var needsAttributeOldValueCaching = /Edge/.test(navigator.userAgent);
/**
* Parses an event definition and returns information about it.
*
* @param {String} e The event to parse.
*
* @returns {Object]}
*/
function parseEvent(e) {
var parts = e.split(" ");
return {
name: parts.shift(),
delegate: parts.join(" ")
};
}
/**
* Sets the defined attributes to their default values, if specified.
*
* @param {Element} target The web component element.
* @param {Object} component The web component definition.
*
* @returns {undefined}
*/
function initAttributes(target, component) {
var componentAttributes = component.attributes;
if (typeof componentAttributes !== "object") {
return;
}
for (var attribute in componentAttributes) {
if (hasOwn(componentAttributes, attribute) && hasOwn(componentAttributes[attribute], "value") && !target.hasAttribute(attribute)) {
var value = componentAttributes[attribute].value;
value = typeof value === "function" ? value(target) : value;
target.setAttribute(attribute, value);
}
}
}
/**
* Defines a property that proxies the specified attribute.
*
* @param {Element} target The web component element.
* @param {String} attribute The attribute name to proxy.
*
* @returns {undefined}
*/
function defineAttributeProperty(target, attribute, property) {
Object.defineProperty(target, property, {
get: function get() {
return this.getAttribute(attribute);
},
set: function set(value) {
if (value === undefined) {
this.removeAttribute(attribute);
} else {
this.setAttribute(attribute, value);
}
}
});
}
/**
* Adds links from attributes to properties.
*
* @param {Element} target The web component element.
* @param {Object} component The web component definition.
*
* @returns {undefined}
*/
function addAttributeToPropertyLinks(target, component) {
var componentAttributes = component.attributes;
if (typeof componentAttributes !== "object") {
return;
}
for (var attribute in componentAttributes) {
var property = camelCase(attribute);
if (hasOwn(componentAttributes, attribute) && !hasOwn(target, property)) {
defineAttributeProperty(target, attribute, property);
}
}
}
function triggerAttributeChanged(target, component, mutationData) {
var callback;
var type;
var name = mutationData.name;
var newValue = mutationData.newValue;
var cachedAttributeOldValues;
if (needsAttributeOldValueCaching) {
cachedAttributeOldValues = data(target, "cachedAttributeOldValues");
}
// Read the old attribute value from cache if needed, otherwise use native oldValue
var oldValue = needsAttributeOldValueCaching && hasOwn(cachedAttributeOldValues, name) ? cachedAttributeOldValues[name] : mutationData.oldValue;
var newValueIsString = typeof newValue === "string";
var oldValueIsString = typeof oldValue === "string";
var attrs = component.attributes;
var specific = attrs && attrs[name];
if (!oldValueIsString && newValueIsString) {
type = "created";
} else if (oldValueIsString && newValueIsString) {
type = "updated";
} else if (oldValueIsString && !newValueIsString) {
type = "removed";
}
if (needsAttributeOldValueCaching) {
if (type === "removed") {
delete cachedAttributeOldValues[name];
} else {
cachedAttributeOldValues[name] = newValue;
}
}
if (specific && typeof specific[type] === "function") {
callback = specific[type];
} else if (specific && typeof specific.fallback === "function") {
callback = specific.fallback;
} else if (typeof specific === "function") {
callback = specific;
} else if (typeof attrs === "function") {
callback = attrs;
}
// Ensure values are null if undefined.
newValue = newValue === undefined ? null : newValue;
oldValue = oldValue === undefined ? null : oldValue;
// There may still not be a callback.
if (callback) {
callback(target, {
type: type,
name: name,
newValue: newValue,
oldValue: oldValue
});
}
}
function triggerAttributesCreated(target, component) {
var a;
var attrs = target.attributes;
var attrsCopy = [];
var attrsLen = attrs.length;
for (a = 0; a < attrsLen; a++) {
attrsCopy.push(attrs[a]);
}
// In default web components, attribute changes aren't triggered for
// attributes that already exist on an element when it is bound. This sucks
// when you want to reuse and separate code for attributes away from your
// lifecycle callbacks. Skate will initialise each attribute by calling the
// created callback for the attributes that already exist on the element.
for (a = 0; a < attrsLen; a++) {
var attr = attrsCopy[a];
triggerAttributeChanged(target, component, {
name: attr.nodeName,
newValue: attr.value || attr.nodeValue
});
}
}
function addAttributeListeners(target, component) {
var attrs = target.attributes;
if (!component.attributes || registry.isNativeCustomElement(component.id)) {
return;
}
var observer = new window.MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
var name = mutation.attributeName;
var attr = attrs[name];
triggerAttributeChanged(target, component, {
name: name,
newValue: attr && (attr.value || attr.nodeValue),
oldValue: mutation.oldValue
});
});
});
observer.observe(target, {
attributes: true,
attributeOldValue: true
});
}
/**
* Binds event listeners for the specified event handlers.
*
* @param {Element} target The component element.
* @param {Object} component The component data.
*
* @returns {undefined}
*/
function addEventListeners(target, component) {
if (typeof component.events !== "object") {
return;
}
function makeHandler(handler, delegate) {
return function (e) {
// If we're not delegating, trigger directly on the component element.
if (!delegate) {
return handler(target, e, target);
}
// If we're delegating, but the target doesn't match, then we've have
// to go up the tree until we find a matching ancestor or stop at the
// component element, or document. If a matching ancestor is found, the
// handler is triggered on it.
var current = e.target;
while (current && current !== document && current !== target.parentNode) {
if (matchesSelector(current, delegate)) {
return handler(target, e, current);
}
current = current.parentNode;
}
};
}
objEach(component.events, function (handler, name) {
var evt = parseEvent(name);
var useCapture = !!evt.delegate && (evt.name === "blur" || evt.name === "focus");
target.addEventListener(evt.name, makeHandler(handler, evt.delegate), useCapture);
});
}
/**
* Triggers the created lifecycle callback.
*
* @param {Element} target The component element.
* @param {Object} component The component data.
*
* @returns {undefined}
*/
function triggerCreated(target, component) {
var targetData = data(target, component.id);
if (targetData.created) {
return;
}
targetData.created = true;
// TODO: This doesn't need to happen if using native.
inherit(target, component.prototype, true);
// We use the unresolved / resolved attributes to flag whether or not the
// element has been templated or not.
if (component.template && !target.hasAttribute(component.resolvedAttribute)) {
component.template(target);
}
target.removeAttribute(component.unresolvedAttribute);
target.setAttribute(component.resolvedAttribute, "");
addEventListeners(target, component);
addAttributeListeners(target, component);
addAttributeToPropertyLinks(target, component);
initAttributes(target, component);
triggerAttributesCreated(target, component);
if (component.created) {
component.created(target);
}
}
/**
* Triggers the attached lifecycle callback.
*
* @param {Element} target The component element.
* @param {Object} component The component data.
*
* @returns {undefined}
*/
function triggerAttached(target, component) {
var targetData = data(target, component.id);
if (targetData.attached) {
return;
}
if (!elementContains(document, target)) {
return;
}
targetData.attached = true;
if (component.attached) {
component.attached(target);
}
targetData.detached = false;
}
/**
* Triggers the detached lifecycle callback.
*
* @param {Element} target The component element.
* @param {Object} component The component data.
*
* @returns {undefined}
*/
function triggerDetached(target, component) {
var targetData = data(target, component.id);
if (targetData.detached) {
return;
}
targetData.detached = true;
if (component.detached) {
component.detached(target);
}
targetData.attached = false;
}
/**
* Triggers the entire element lifecycle if it's not being ignored.
*
* @param {Element} target The component element.
* @param {Object} component The component data.
*
* @returns {undefined}
*/
function triggerLifecycle(target, component) {
triggerCreated(target, component);
triggerAttached(target, component);
}
/**
* Initialises a set of elements.
*
* @param {DOMNodeList | Array} elements A traversable set of elements.
*
* @returns {undefined}
*/
function initElements(elements) {
// [CATION] Don't cache elements length! Components initialization could append nodes
// as siblings (see label's element behaviour for example) and this could lead to problems with
// components placed at the end of processing childNodes because they will change they index
// position and get out of cached value range.
for (var a = 0; a < elements.length; a++) {
var element = elements[a];
if (element.nodeType !== Node.ELEMENT_NODE || element.attributes[ATTR_IGNORE]) {
continue;
}
var currentNodeDefinitions = registry.getForElement(element);
var currentNodeDefinitionsLength = currentNodeDefinitions.length;
for (var b = 0; b < currentNodeDefinitionsLength; b++) {
triggerLifecycle(element, currentNodeDefinitions[b]);
}
// When <object> tag is used to expose NPAPI api to js may have different behaviour then other
// tags. One of those differences is that it's childNodes can be undefined.
var elementChildNodes = element.childNodes || [];
var elementChildNodesLen = elementChildNodes.length;
if (elementChildNodesLen) {
initElements(elementChildNodes);
}
}
}
/**
* Triggers the remove lifecycle callback on all of the elements.
*
* @param {DOMNodeList} elements The elements to trigger the remove lifecycle
* callback on.
*
* @returns {undefined}
*/
function removeElements(elements) {
// Don't cache `childNodes` length. For more info see description in `initElements` function.
for (var a = 0; a < elements.length; a++) {
var element = elements[a];
if (element.nodeType !== Node.ELEMENT_NODE) {
continue;
}
removeElements(element.childNodes);
var definitions = registry.getForElement(element);
var definitionsLen = definitions.length;
for (var b = 0; b < definitionsLen; b++) {
triggerDetached(element, definitions[b]);
}
}
}
exports.initElements = initElements;
exports.removeElements = removeElements;
exports.triggerAttached = triggerAttached;
exports.triggerAttributeChanged = triggerAttributeChanged;
exports.triggerCreated = triggerCreated;
exports.triggerDetached = triggerDetached;
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/fix-ie-innerhtml.js
(typeof window === 'undefined' ? global : window).__ca1173e367174fe9d7870e3ef51f5c97 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__ca1173e367174fe9d7870e3ef51f5c97");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
}
})(function (exports) {
var isIeUntil10 = /MSIE/.test(navigator.userAgent);
var isIe11 = /Trident/.test(navigator.userAgent);
var isIe = isIeUntil10 || isIe11;
var elementPrototype = window.HTMLElement.prototype;
// ! This walkTree method differs from the implementation in ../../utils/walk-tree
// It invokes the callback only for the children, not the passed node and the second parameter to the callback is the parent node
function walkTree(node, cb) {
var childNodes = node.childNodes;
if (!childNodes) {
return;
}
var childNodesLen = childNodes.length;
for (var a = 0; a < childNodesLen; a++) {
var childNode = childNodes[a];
cb(childNode, node);
walkTree(childNode, cb);
}
}
function fixInnerHTML() {
var originalInnerHTML = Object.getOwnPropertyDescriptor(elementPrototype, "innerHTML");
var get = function get() {
return originalInnerHTML.get.call(this);
};
get._hasBeenEnhanced = true;
// This redefines the innerHTML property so that we can ensure that events
// are properly triggered.
Object.defineProperty(elementPrototype, "innerHTML", {
get: get,
set: function set(html) {
walkTree(this, function (node, parentNode) {
var mutationEvent = document.createEvent("MutationEvent");
mutationEvent.initMutationEvent("DOMNodeRemoved", true, false, parentNode, null, null, null, null);
node.dispatchEvent(mutationEvent);
});
originalInnerHTML.set.call(this, html);
}
});
}
if (isIe) {
// IE 9-11
var propertyDescriptor = Object.getOwnPropertyDescriptor(elementPrototype, "innerHTML");
var hasBeenEnhanced = !!propertyDescriptor && propertyDescriptor.get._hasBeenEnhanced;
if (!hasBeenEnhanced) {
if (isIe11) {
// IE11's native MutationObserver needs some help as well :()
window.MutationObserver = window.JsMutationObserver || window.MutationObserver;
}
fixInnerHTML();
}
}
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/document-observer.js
(typeof window === 'undefined' ? global : window).__4d0d8ecd848029e14d80a6188a9c33f0 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./globals": __06e3f58f6e0f578762178198b8f2bc48,
"./lifecycle": __3968c781f57c50c16e1f01ed9198b141,
"./mutation-observer": __03ca3eddefb96bc06be807c495751c7f,
"./fix-ie-innerhtml": __ca1173e367174fe9d7870e3ef51f5c97,
"./utils": __fbddd2b55da17b618c8ec248b1d28b31,
"./globals": __06e3f58f6e0f578762178198b8f2bc48,
"./lifecycle": __3968c781f57c50c16e1f01ed9198b141,
"./mutation-observer": __03ca3eddefb96bc06be807c495751c7f,
"./fix-ie-innerhtml": __ca1173e367174fe9d7870e3ef51f5c97,
"./utils": __fbddd2b55da17b618c8ec248b1d28b31
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__4d0d8ecd848029e14d80a6188a9c33f0");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module", "./globals", "./lifecycle", "./mutation-observer", "./fix-ie-innerhtml", "./utils"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module, __06e3f58f6e0f578762178198b8f2bc48, __3968c781f57c50c16e1f01ed9198b141, __03ca3eddefb96bc06be807c495751c7f, __ca1173e367174fe9d7870e3ef51f5c97, __fbddd2b55da17b618c8ec248b1d28b31);
}
})(function (exports, module, _globals, _lifecycle, _mutationObserver, _fixIeInnerhtml, _utils) {
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
var globals = _interopRequire(_globals);
var initElements = _lifecycle.initElements;
var removeElements = _lifecycle.removeElements;
var getClosestIgnoredElement = _utils.getClosestIgnoredElement;
/**
* The document observer handler.
*
* @param {Array} mutations The mutations to handle.
*
* @returns {undefined}
*/
function documentObserverHandler(mutations) {
var mutationsLen = mutations.length;
for (var a = 0; a < mutationsLen; a++) {
var mutation = mutations[a];
var addedNodes = mutation.addedNodes;
var removedNodes = mutation.removedNodes;
// Since siblings are batched together, we check the first node's parent
// node to see if it is ignored. If it is then we don't process any added
// nodes. This prevents having to check every node.
if (addedNodes && addedNodes.length && !getClosestIgnoredElement(addedNodes[0].parentNode)) {
initElements(addedNodes);
}
// We can't check batched nodes here because they won't have a parent node.
if (removedNodes && removedNodes.length) {
removeElements(removedNodes);
}
}
}
/**
* Creates a new mutation observer for listening to Skate definitions for the
* document.
*
* @param {Element} root The element to observe.
*
* @returns {MutationObserver}
*/
function createDocumentObserver() {
var observer = new window.MutationObserver(documentObserverHandler);
// Observe after the DOM content has loaded.
observer.observe(document, {
childList: true,
subtree: true
});
return observer;
}
module.exports = {
register: function register(fixIe) {
// IE has issues with reporting removedNodes correctly. See the polyfill for
// details. If we fix IE, we must also re-define the document observer.
if (fixIe) {
this.unregister();
}
if (!globals.observer) {
globals.observer = createDocumentObserver();
}
return this;
},
unregister: function unregister() {
if (globals.observer) {
globals.observer.disconnect();
globals.observer = undefined;
}
return this;
}
};
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/skate.js
(typeof window === 'undefined' ? global : window).__dd34432b636f7160e4c8267d9b4587c0 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./constants": __d1943092751b2a1c4820e92eb7e9de1d,
"./document-observer": __4d0d8ecd848029e14d80a6188a9c33f0,
"./lifecycle": __3968c781f57c50c16e1f01ed9198b141,
"./registry": __c6a2470f69b4b0cecfde78396d749fdd,
"./utils": __fbddd2b55da17b618c8ec248b1d28b31,
"./version": __965e6d3da9aea63630affcf0bd4c477d,
"./constants": __d1943092751b2a1c4820e92eb7e9de1d,
"./document-observer": __4d0d8ecd848029e14d80a6188a9c33f0,
"./lifecycle": __3968c781f57c50c16e1f01ed9198b141,
"./registry": __c6a2470f69b4b0cecfde78396d749fdd,
"./utils": __fbddd2b55da17b618c8ec248b1d28b31,
"./version": __965e6d3da9aea63630affcf0bd4c477d
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__dd34432b636f7160e4c8267d9b4587c0");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module", "./constants", "./document-observer", "./lifecycle", "./registry", "./utils", "./version"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module, __d1943092751b2a1c4820e92eb7e9de1d, __4d0d8ecd848029e14d80a6188a9c33f0, __3968c781f57c50c16e1f01ed9198b141, __c6a2470f69b4b0cecfde78396d749fdd, __fbddd2b55da17b618c8ec248b1d28b31, __965e6d3da9aea63630affcf0bd4c477d);
}
})(function (exports, module, _constants, _documentObserver, _lifecycle, _registry, _utils, _version) {
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
var TYPE_ATTRIBUTE = _constants.TYPE_ATTRIBUTE;
var TYPE_CLASSNAME = _constants.TYPE_CLASSNAME;
var TYPE_ELEMENT = _constants.TYPE_ELEMENT;
var documentObserver = _interopRequire(_documentObserver);
var triggerCreated = _lifecycle.triggerCreated;
var triggerAttached = _lifecycle.triggerAttached;
var triggerDetached = _lifecycle.triggerDetached;
var triggerAttributeChanged = _lifecycle.triggerAttributeChanged;
var initElements = _lifecycle.initElements;
var registry = _interopRequire(_registry);
var debounce = _utils.debounce;
var inherit = _utils.inherit;
var version = _interopRequire(_version);
var HTMLElement = window.HTMLElement; //jshint ignore:line
// IE <= 10 can fire "interactive" too early (#243).
var isOldIE = !!document.attachEvent; // attachEvent was removed in IE11.
function isReady() {
if (isOldIE) {
return document.readyState === "complete";
} else {
return document.readyState === "interactive" || document.readyState === "complete";
}
}
/**
* Initialises all valid elements in the document. Ensures that it does not
* happen more than once in the same execution, and that it happens after the DOM is ready.
*
* @returns {undefined}
*/
var initDocument = debounce(function () {
var initialiseSkateElementsOnDomLoad = function initialiseSkateElementsOnDomLoad() {
initElements(document.documentElement.childNodes);
};
if (isReady()) {
initialiseSkateElementsOnDomLoad();
} else {
if (isOldIE) {
window.addEventListener("load", initialiseSkateElementsOnDomLoad);
} else {
document.addEventListener("DOMContentLoaded", initialiseSkateElementsOnDomLoad);
}
}
});
/**
* Creates a constructor for the specified definition.
*
* @param {Object} definition The definition information to use for generating the constructor.
*
* @returns {Function} The element constructor.
*/
function makeElementConstructor(definition) {
function CustomElement() {
var element;
var tagToExtend = definition["extends"];
var definitionId = definition.id;
if (tagToExtend) {
element = document.createElement(tagToExtend);
element.setAttribute("is", definitionId);
} else {
element = document.createElement(definitionId);
}
// Ensure the definition prototype is up to date with the element's
// prototype. This ensures that overwriting the element prototype still
// works.
definition.prototype = CustomElement.prototype;
// If they use the constructor we don't have to wait until it's attached.
triggerCreated(element, definition);
return element;
}
// This allows modifications to the element prototype propagate to the
// definition prototype.
CustomElement.prototype = definition.prototype;
return CustomElement;
}
// Public API
// ----------
/**
* Creates a listener for the specified definition.
*
* @param {String} id The ID of the definition.
* @param {Object | Function} definition The definition definition.
*
* @returns {Function} Constructor that returns a custom element.
*/
function skate(id, definition) {
// Just in case the definition is shared, we duplicate it so that internal
// modifications to the original aren't shared.
definition = inherit({}, definition);
definition = inherit(definition, skate.defaults);
definition.id = id;
registry.set(id, definition);
if (registry.isNativeCustomElement(id)) {
var elementPrototype = definition["extends"] ? document.createElement(definition["extends"]).constructor.prototype : HTMLElement.prototype;
if (!elementPrototype.isPrototypeOf(definition.prototype)) {
definition.prototype = inherit(Object.create(elementPrototype), definition.prototype, true);
}
var options = {
prototype: inherit(definition.prototype, {
createdCallback: function createdCallback() {
triggerCreated(this, definition);
},
attachedCallback: function attachedCallback() {
triggerAttached(this, definition);
},
detachedCallback: function detachedCallback() {
triggerDetached(this, definition);
},
attributeChangedCallback: function attributeChangedCallback(name, oldValue, newValue) {
triggerAttributeChanged(this, definition, {
name: name,
oldValue: oldValue,
newValue: newValue
});
}
})
};
if (definition["extends"]) {
options["extends"] = definition["extends"];
}
return document.registerElement(id, options);
}
initDocument();
documentObserver.register(!!definition.detached);
if (registry.isType(id, TYPE_ELEMENT)) {
return makeElementConstructor(definition);
}
}
/**
* Synchronously initialises the specified element or elements and descendants.
*
* @param {Mixed} nodes The node, or nodes to initialise. Can be anything:
* jQuery, DOMNodeList, DOMNode, selector etc.
*
* @returns {skate}
*/
skate.init = function (nodes) {
var nodesToUse = nodes;
if (!nodes) {
return nodes;
}
if (typeof nodes === "string") {
nodesToUse = nodes = document.querySelectorAll(nodes);
} else if (nodes instanceof HTMLElement) {
nodesToUse = [nodes];
}
initElements(nodesToUse);
return nodes;
};
// Restriction type constants.
skate.type = {
ATTRIBUTE: TYPE_ATTRIBUTE,
CLASSNAME: TYPE_CLASSNAME,
ELEMENT: TYPE_ELEMENT
};
// Makes checking the version easy when debugging.
skate.version = version;
/**
* The default options for a definition.
*
* @var {Object}
*/
skate.defaults = {
// Attribute lifecycle callback or callbacks.
attributes: undefined,
// The events to manage the binding and unbinding of during the definition's
// lifecycle.
events: undefined,
// Restricts a particular definition to binding explicitly to an element with
// a tag name that matches the specified value.
"extends": undefined,
// The ID of the definition. This is automatically set in the `skate()`
// function.
id: "",
// Properties and methods to add to each element.
prototype: {},
// The attribute name to add after calling the created() callback.
resolvedAttribute: "resolved",
// The template to replace the content of the element with.
template: undefined,
// The type of bindings to allow.
type: TYPE_ELEMENT,
// The attribute name to remove after calling the created() callback.
unresolvedAttribute: "unresolved"
};
// Exporting
// ---------
var previousSkate = window.skate;
skate.noConflict = function () {
window.skate = previousSkate;
return skate;
};
// Global
window.skate = skate;
// ES6
module.exports = skate;
});
return module.exports;
}).call(this);
// src/js/aui/internal/skate.js
(typeof window === 'undefined' ? global : window).__f3781475eb0bf3a02085f171842f7c4c = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _skatejs = __dd34432b636f7160e4c8267d9b4587c0;
var _skatejs2 = _interopRequireDefault(_skatejs);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var auiSkate = _skatejs2.default.noConflict();
exports.default = auiSkate;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/animation.js
(typeof window === 'undefined' ? global : window).__0c2efa86d943ccf7adf9319649824b2a = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
/**
* Force a re-compute of the style of an element.
*
* This is useful for CSS transitions and animations that need computed style changes to occur.
* CSS transitions will fire when the computed value of the property they are transitioning changes.
* This may not occur if the style changes get batched into one style change event by the browser.
* We can force the browser to recognise the two different computed values by calling this function when we want it
* to recompute the styles.
*
* For example, consider a transition on the opacity property.
*
* With recomputeStyle:
* $parent.append($el); //opacity=0
* recomputeStyle($el);
* $el.addClass('visible'); //opacity=1
* //Browser calculates value of opacity=0, and then transitions it to opacity=1
*
* Without recomputeStyle:
* $parent.append($el); //opacity=0
* $el.addClass('visible'); //opacity=1
* //Browser calculates value of opacity=1 but no transition
*
* @param el The DOM or jQuery element for which style should be recomputed
*/
Object.defineProperty(exports, "__esModule", {
value: true
});
function recomputeStyle(el) {
el = el.length ? el[0] : el;
window.getComputedStyle(el, null).getPropertyValue('left');
}
exports.recomputeStyle = recomputeStyle;
return module.exports;
}).call(this);
// src/js/aui/escape-html.js
(typeof window === 'undefined' ? global : window).__91ab8247841516252393b05d610ab13e = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function escapeHtml(str) {
return str.replace(/[&"'<>`]/g, function (str) {
var special = {
'<': '<',
'>': '>',
'&': '&',
'\'': ''',
'`': '`'
};
if (typeof special[str] === 'string') {
return special[str];
}
return '"';
});
}
(0, _globalize2.default)('escapeHtml', escapeHtml);
exports.default = escapeHtml;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/template.js
(typeof window === 'undefined' ? global : window).__92cb1756a37ec7526fc57dd472bfea6f = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _escapeHtml = __91ab8247841516252393b05d610ab13e;
var _escapeHtml2 = _interopRequireDefault(_escapeHtml);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates an object with methods for template support.
*
* See <a href="http://confluence.atlassian.com/display/AUI/AJS.template">CAC Documentation</a>.
*
* @constructor
* @class template
* @namespace AJS
*/
var template = function ($) {
var tokenRegex = /\{([^\}]+)\}/g; // matches "{xxxxx}"
var objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g; // matches ".xxxxx" or "["xxxxx"]" to run over object properties
// internal function
// parses "{xxxxx}" and returns actual value from the given object that matches the expression
var replacer = function replacer(all, key, obj, isHTML) {
var res = obj;
key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {
name = name || quotedName;
if (res) {
if (name + ':html' in res) {
res = res[name + ':html'];
isHTML = true;
} else if (name in res) {
res = res[name];
}
if (isFunc && typeof res === 'function') {
res = res();
}
}
});
// if not found restore original value
if (res == null || res === obj) {
res = all;
}
res = String(res);
if (!isHTML) {
res = T.escape(res);
}
return res;
};
/**
* Replaces tokens in the template with corresponding values without HTML escaping
* @method fillHtml
* @param obj {Object} to populate the template with
* @return {Object} the template object
*/
var fillHtml = function fillHtml(obj) {
this.template = this.template.replace(tokenRegex, function (all, key) {
return replacer(all, key, obj, true);
});
return this;
};
/**
* Replaces tokens in the template with corresponding values with HTML escaping
* @method fill
* @param obj {Object} to populate the template with
* @return {Object} the template object
*/
var fill = function fill(obj) {
this.template = this.template.replace(tokenRegex, function (all, key) {
return replacer(all, key, obj);
});
return this;
};
/**
* Returns the current templated string.
* @method toString
* @return {String} the current template
*/
var toString = function toString() {
return this.template;
};
// internal function
var T = function T(s) {
function res() {
return res.template;
}
/**
* The current templated string
* @property template
*/
res.template = String(s);
res.toString = res.valueOf = toString;
res.fill = fill;
res.fillHtml = fillHtml;
return res;
};
var cache = {};
var count = [];
var findScripts = function findScripts(title) {
return $('script').filter(function () {
return this.getAttribute('title') === title;
});
};
// returns template taken form the script tag with given title. Type agnostic, but better put type="text/x-template"
T.load = function (title) {
title = String(title);
if (!cache.hasOwnProperty(title)) {
if (count.length >= 1e3) {
delete cache[count.shift()]; // enforce maximum cache size
}
count.push(title);
cache[title] = findScripts(title)[0].text;
}
return this(cache[title]);
};
// escape HTML dangerous characters
T.escape = _escapeHtml2.default;
return T;
}(_jquery2.default);
(0, _globalize2.default)('template', template);
exports.default = template;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js-vendor/spin/spin.js
(typeof window === 'undefined' ? global : window).__5eeecf289c922237d018a0ef26a8a643 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__5eeecf289c922237d018a0ef26a8a643");
define.amd = true;
//fgnass.github.com/spin.js#v1.3.3
/*
Modified by Atlassian
*/
/**
* Copyright (c) 2011-2013 Felix Gnass
* Licensed under the MIT license
*/
(function(root, factory) {
/* CommonJS */
if (typeof exports == 'object') module.exports = factory()
/* AMD module */
// ATLASSIAN - don't check define.amd for products who deleted it.
else if (typeof define == 'function') define('aui/internal/spin', factory)
/* Browser global */
// ATLASSIAN - always expose Spinner globally
root.Spinner = factory()
}
(window, function() {
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
, animations = {} /* Animation rules keyed by their name */
, useCssAnimations /* Whether to use CSS animations or setTimeout */
/**
* Utility function to create elements. If no tag name is given,
* a DIV is created. Optionally properties can be passed.
*/
function createEl(tag, prop) {
var el = document.createElement(tag || 'div')
, n
for(n in prop) el[n] = prop[n]
return el
}
/**
* Appends children and returns the parent.
*/
function ins(parent /* child1, child2, ...*/) {
for (var i=1, n=arguments.length; i<n; i++)
parent.appendChild(arguments[i])
return parent
}
/**
* Insert a new stylesheet to hold the @keyframe or VML rules.
*/
var sheet = (function() {
var el = createEl('style', {type : 'text/css'})
ins(document.getElementsByTagName('head')[0], el)
return el.sheet || el.styleSheet
}())
/**
* Creates an opacity keyframe animation rule and returns its name.
* Since most mobile Webkits have timing issues with animation-delay,
* we create separate rules for each line/segment.
*/
function addAnimation(alpha, trail, i, lines) {
var name = ['opacity', trail, ~~(alpha*100), i, lines].join('-')
, start = 0.01 + i/lines * 100
, z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
, prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
, pre = prefix && '-' + prefix + '-' || ''
if (!animations[name]) {
sheet.insertRule(
'@' + pre + 'keyframes ' + name + '{' +
'0%{opacity:' + z + '}' +
start + '%{opacity:' + alpha + '}' +
(start+0.01) + '%{opacity:1}' +
(start+trail) % 100 + '%{opacity:' + alpha + '}' +
'100%{opacity:' + z + '}' +
'}', sheet.cssRules.length)
animations[name] = 1
}
return name
}
/**
* Tries various vendor prefixes and returns the first supported property.
*/
function vendor(el, prop) {
var s = el.style
, pp
, i
prop = prop.charAt(0).toUpperCase() + prop.slice(1)
for(i=0; i<prefixes.length; i++) {
pp = prefixes[i]+prop
if(s[pp] !== undefined) return pp
}
if(s[prop] !== undefined) return prop
}
/**
* Sets multiple style properties at once.
*/
function css(el, prop) {
for (var n in prop)
el.style[vendor(el, n)||n] = prop[n]
return el
}
/**
* Fills in default values.
*/
function merge(obj) {
for (var i=1; i < arguments.length; i++) {
var def = arguments[i]
for (var n in def)
if (obj[n] === undefined) obj[n] = def[n]
}
return obj
}
/**
* Returns the absolute page-offset of the given element.
*/
function pos(el) {
var o = { x:el.offsetLeft, y:el.offsetTop }
while((el = el.offsetParent))
// ATLASSIAN - AUI-3542 - add border width to the calculation of o.x and o.y
o.x+=el.offsetLeft+el.clientLeft, o.y+=el.offsetTop+el.clientTop
return o
}
/**
* Returns the line color from the given string or array.
*/
function getColor(color, idx) {
return typeof color == 'string' ? color : color[idx % color.length]
}
// Built-in defaults
var defaults = {
lines: 12, // The number of lines to draw
length: 7, // The length of each line
width: 5, // The line thickness
radius: 10, // The radius of the inner circle
rotate: 0, // Rotation offset
corners: 1, // Roundness (0..1)
color: '#000', // #rgb or #rrggbb
direction: 1, // 1: clockwise, -1: counterclockwise
speed: 1, // Rounds per second
trail: 100, // Afterglow percentage
opacity: 1/4, // Opacity of the lines
fps: 20, // Frames per second when using setTimeout()
zIndex: 2e9, // Use a high z-index by default
className: 'spinner', // CSS class to assign to the element
top: 'auto', // center vertically
left: 'auto', // center horizontally
position: 'relative' // element position
}
/** The constructor */
function Spinner(o) {
if (typeof this == 'undefined') return new Spinner(o)
this.opts = merge(o || {}, Spinner.defaults, defaults)
}
// Global defaults that override the built-ins:
Spinner.defaults = {}
merge(Spinner.prototype, {
/**
* Adds the spinner to the given target element. If this instance is already
* spinning, it is automatically removed from its previous target b calling
* stop() internally.
*/
spin: function(target) {
this.stop()
var self = this
, o = self.opts
, el = self.el = css(createEl(0, {className: o.className}), {position: o.position, width: 0, zIndex: o.zIndex})
, mid = o.radius+o.length+o.width
, ep // element position
, tp // target position
if (target) {
target.insertBefore(el, target.firstChild||null)
tp = pos(target)
ep = pos(el)
css(el, {
left: (o.left == 'auto' ? tp.x-ep.x + (target.offsetWidth >> 1) : parseInt(o.left, 10) + mid) + 'px',
top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : parseInt(o.top, 10) + mid) + 'px'
})
}
el.setAttribute('role', 'progressbar')
self.lines(el, self.opts)
if (!useCssAnimations) {
// No CSS animation support, use setTimeout() instead
var i = 0
, start = (o.lines - 1) * (1 - o.direction) / 2
, alpha
, fps = o.fps
, f = fps/o.speed
, ostep = (1-o.opacity) / (f*o.trail / 100)
, astep = f/o.lines
;(function anim() {
i++;
for (var j = 0; j < o.lines; j++) {
alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity)
self.opacity(el, j * o.direction + start, alpha, o)
}
self.timeout = self.el && setTimeout(anim, ~~(1000/fps))
})()
}
return self
},
/**
* Stops and removes the Spinner.
*/
stop: function() {
var el = this.el
if (el) {
clearTimeout(this.timeout)
if (el.parentNode) el.parentNode.removeChild(el)
this.el = undefined
}
return this
},
/**
* Internal method that draws the individual lines. Will be overwritten
* in VML fallback mode below.
*/
lines: function(el, o) {
var i = 0
, start = (o.lines - 1) * (1 - o.direction) / 2
, seg
function fill(color, shadow) {
return css(createEl(), {
position: 'absolute',
width: (o.length+o.width) + 'px',
height: o.width + 'px',
background: color,
boxShadow: shadow,
transformOrigin: 'left',
transform: 'rotate(' + ~~(360/o.lines*i+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)',
borderRadius: (o.corners * o.width>>1) + 'px'
})
}
for (; i < o.lines; i++) {
seg = css(createEl(), {
position: 'absolute',
top: 1+~(o.width/2) + 'px',
transform: o.hwaccel ? 'translate3d(0,0,0)' : '',
opacity: o.opacity,
animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1/o.speed + 's linear infinite'
})
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'}))
ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')))
}
return el
},
/**
* Internal method that adjusts the opacity of a single line.
* Will be overwritten in VML fallback mode below.
*/
opacity: function(el, i, val) {
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val
}
})
function initVML() {
/* Utility function to create a VML tag */
function vml(tag, attr) {
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
}
// No CSS transforms but VML support, add a CSS rule for VML elements:
sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')
Spinner.prototype.lines = function(el, o) {
var r = o.length+o.width
, s = 2*r
function grp() {
return css(
vml('group', {
coordsize: s + ' ' + s,
coordorigin: -r + ' ' + -r
}),
{ width: s, height: s }
)
}
var margin = -(o.width+o.length)*2 + 'px'
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
, i
function seg(i, dx, filter) {
ins(g,
ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}),
ins(css(vml('roundrect', {arcsize: o.corners}), {
width: r,
height: o.width,
left: o.radius,
top: -o.width>>1,
filter: filter
}),
vml('fill', {color: getColor(o.color, i), opacity: o.opacity}),
vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
)
)
)
}
if (o.shadow)
for (i = 1; i <= o.lines; i++)
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
for (i = 1; i <= o.lines; i++) seg(i)
return ins(el, g)
}
Spinner.prototype.opacity = function(el, i, val, o) {
var c = el.firstChild
o = o.shadow && o.lines || 0
if (c && i+o < c.childNodes.length) {
c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild
if (c) c.opacity = val
}
}
}
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'})
if (!vendor(probe, 'transform') && probe.adj) initVML()
else useCssAnimations = vendor(probe, 'animation')
return Spinner
}));
return module.exports;
}).call(this);
// src/js-vendor/jquery/jquery.spin.js
(typeof window === 'undefined' ? global : window).__9c6dc60c31790b5589ff0b5c7a5a2253 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
/*
* Ideas from https://gist.github.com/its-florida/1290439 are acknowledged and used here.
* Resulting file is heavily modified from that gist so is licensed under AUI's license.
*
* You can now create a spinner using any of the variants below:
*
* $("#el").spin(); // Produces default Spinner using the text color of #el.
* $("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
* $("#el").spin("large", { ... }); // Produces a 'large' Spinner with your custom settings.
* $("#el").spin({ ... }); // Produces a Spinner using your custom settings.
*
* $("#el").spin(false); // Kills the spinner.
* $("#el").spinStop(); // Also kills the spinner.
*
*/
(function($) {
$.fn.spin = function(optsOrPreset, opts) {
var preset, options;
if (typeof optsOrPreset === 'string') {
if (! optsOrPreset in $.fn.spin.presets) {
throw new Error("Preset '" + optsOrPreset + "' isn't defined");
}
preset = $.fn.spin.presets[optsOrPreset];
options = opts || {};
} else {
if (opts) {
throw new Error('Invalid arguments. Accepted arguments:\n' +
'$.spin([String preset[, Object options]]),\n' +
'$.spin(Object options),\n' +
'$.spin(Boolean shouldSpin)');
}
preset = $.fn.spin.presets.small;
options = $.isPlainObject(optsOrPreset) ? optsOrPreset : {};
}
if (window.Spinner) {
return this.each(function() {
var $this = $(this),
data = $this.data();
if (data.spinner) {
data.spinner.stop();
delete data.spinner;
}
if (optsOrPreset === false) { // just stop it spinning.
return;
}
options = $.extend({ color: $this.css('color') }, preset, options);
data.spinner = new Spinner(options).spin(this);
});
} else {
throw "Spinner class not available.";
}
};
$.fn.spin.presets = {
"small": { lines: 12, length: 3, width: 2, radius: 3, trail: 60, speed: 1.5 },
"medium": { lines: 12, length: 5, width: 3, radius: 8, trail: 60, speed: 1.5 },
"large": { lines: 12, length: 8, width: 4, radius: 10, trail: 60, speed: 1.5 }
};
$.fn.spinStop = function() {
if (window.Spinner) {
return this.each(function() {
var $this = $(this),
data = $this.data();
if (data.spinner) {
data.spinner.stop();
delete data.spinner;
}
});
} else {
throw "Spinner class not available.";
}
};
})(jQuery);
return module.exports;
}).call(this);
// src/js/aui/spin.js
(typeof window === 'undefined' ? global : window).__98b7c9cf3949a197ac63f13f8686abea = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
__5eeecf289c922237d018a0ef26a8a643;
__9c6dc60c31790b5589ff0b5c7a5a2253;
return module.exports;
}).call(this);
// node_modules/skatejs-template-html/dist/template-html.js
(typeof window === 'undefined' ? global : window).__23921246870221a1cfaf9dc62cd3cb19 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__23921246870221a1cfaf9dc62cd3cb19");
define.amd = true;
(function () {
var DocumentFragment = window.DocumentFragment;
var elProto = window.HTMLElement.prototype;
var matchesSelector = (
elProto.matches ||
elProto.msMatchesSelector ||
elProto.webkitMatchesSelector ||
elProto.mozMatchesSelector ||
elProto.oMatchesSelector
);
function getData (element, name) {
if (element.__SKATE_TEMPLATE_HTML_DATA) {
return element.__SKATE_TEMPLATE_HTML_DATA[name];
}
}
function setData (element, name, value) {
if (!element.__SKATE_TEMPLATE_HTML_DATA) {
element.__SKATE_TEMPLATE_HTML_DATA = {};
}
element.__SKATE_TEMPLATE_HTML_DATA[name] = value;
return element;
}
function createFragmentFromString (domString) {
var specialMap = {
caption: 'table',
dd: 'dl',
dt: 'dl',
li: 'ul',
tbody: 'table',
td: 'tr',
thead: 'table',
tr: 'tbody'
};
var tag = domString.match(/\s*<([^\s>]+)/);
var div = document.createElement(tag && specialMap[tag[1]] || 'div');
div.innerHTML = domString;
return createFragmentFromNodeList(div.childNodes);
}
function createFragmentFromNodeList (nodeList) {
var frag = document.createDocumentFragment();
while (nodeList && nodeList.length) {
frag.appendChild(nodeList[0]);
}
return frag;
}
function getNodesBetween (startNode, endNode) {
var nodes = [];
var nextNode = startNode.nextSibling;
while (nextNode !== endNode) {
nodes.push(nextNode);
nextNode = nextNode.nextSibling;
}
return nodes;
}
function findChildrenMatchingSelector (sourceNode, selector) {
if (selector) {
var found = sourceNode.querySelectorAll(selector);
var foundLength = found.length;
var filtered = [];
for (var a = 0; a < foundLength; a++) {
var node = found[a];
if (node.parentNode === sourceNode) {
filtered.push(node);
}
}
return filtered;
}
return [].slice.call(sourceNode.childNodes) || [];
}
function htmlTemplateParentWrapper (element) {
var contentNodes = getData(element, 'content');
var contentNodesLen = contentNodes.length;
return {
childNodes: {
get: function () {
var nodes = [];
for (var a = 0; a < contentNodesLen; a++) {
var contentNode = contentNodes[a];
if (contentNode.isDefault) {
continue;
}
nodes = nodes.concat(getNodesBetween(contentNode.startNode, contentNode.endNode));
}
return nodes;
}
},
firstChild: {
get: function () {
var childNodes = this.childNodes;
return childNodes.length && childNodes[0] || null;
}
},
innerHTML: {
get: function () {
var html = '';
var childNodes = this.childNodes;
var childNodesLen = childNodes.length;
for (var a = 0; a < childNodesLen; a++) {
var childNode = childNodes[a];
html += childNode.outerHTML || childNode.textContent;
}
return html;
},
set: function (html) {
var targetFragment = createFragmentFromString(html);
for (var a = 0; a < contentNodesLen; a++) {
var contentNode = contentNodes[a];
var childNodes = getNodesBetween(contentNode.startNode, contentNode.endNode);
// Remove all nodes (including default content).
for (var b = 0; b < childNodes.length; b++) {
var childNode = childNodes[b];
childNode.parentNode.removeChild(childNode);
}
var foundNodes = findChildrenMatchingSelector(targetFragment, contentNode.selector);
// Add any matched nodes from the given HTML.
for (var c = 0; c < foundNodes.length; c++) {
contentNode.container.insertBefore(foundNodes[c], contentNode.endNode);
}
// If no nodes were found, set the default content.
if (foundNodes.length) {
removeDefaultContent(contentNode);
} else {
addDefaultContent(contentNode);
}
}
}
},
lastChild: {
get: function () {
for (var a = contentNodesLen - 1; a > -1; a--) {
var contentNode = contentNodes[a];
if (contentNode.isDefault) {
continue;
}
var childNodes = this.childNodes;
var childNodesLen = childNodes.length;
return childNodes[childNodesLen - 1];
}
return null;
}
},
outerHTML: {
get: function () {
var name = this.tagName.toLowerCase();
var html = '<' + name;
var attrs = this.attributes;
if (attrs) {
var attrsLength = attrs.length;
for (var a = 0; a < attrsLength; a++) {
var attr = attrs[a];
html += ' ' + attr.nodeName + '="' + attr.nodeValue + '"';
}
}
html += '>';
html += this.innerHTML;
html += '</' + name + '>';
return html;
}
},
textContent: {
get: function () {
var textContent = '';
var childNodes = this.childNodes;
var childNodesLength = this.childNodes.length;
for (var a = 0; a < childNodesLength; a++) {
textContent += childNodes[a].textContent;
}
return textContent;
},
set: function (textContent) {
var acceptsTextContent;
// Removes all nodes (including default content).
this.innerHTML = '';
// Find the first content node without a selector.
for (var a = 0; a < contentNodesLen; a++) {
var contentNode = contentNodes[a];
if (!contentNode.selector) {
acceptsTextContent = contentNode;
break;
}
}
// There may be no content nodes that accept text content.
if (acceptsTextContent) {
if (textContent) {
removeDefaultContent(acceptsTextContent);
acceptsTextContent.container.insertBefore(document.createTextNode(textContent), acceptsTextContent.endNode);
} else {
addDefaultContent(acceptsTextContent);
}
}
}
},
appendChild: {
value: function (node) {
if (node instanceof DocumentFragment) {
var fragChildNodes = node.childNodes;
[].slice.call(fragChildNodes).forEach(function (node) {
this.appendChild(node);
}.bind(this));
return this;
}
for (var b = 0; b < contentNodesLen; b++) {
var contentNode = contentNodes[b];
var contentSelector = contentNode.selector;
if (!contentSelector || node instanceof window.HTMLElement && matchesSelector.call(node, contentSelector)) {
removeDefaultContent(contentNode);
contentNode.endNode.parentNode.insertBefore(node, contentNode.endNode);
break;
}
}
return this;
}
},
insertAdjacentHTML: {
value: function (where, html) {
if (where === 'afterbegin') {
this.insertBefore(createFragmentFromString(html), this.childNodes[0]);
} else if (where === 'beforeend') {
this.appendChild(createFragmentFromString(html));
} else {
element.insertAdjacentHTML(where, html);
}
return this;
}
},
insertBefore: {
value: function (node, referenceNode) {
// If no reference node is supplied, we append. This also means that we
// don't need to add / remove any default content because either there
// aren't any nodes or appendChild will handle it.
if (!referenceNode) {
return this.appendChild(node);
}
// Handle document fragments.
if (node instanceof DocumentFragment) {
var fragChildNodes = node.childNodes;
if (fragChildNodes) {
var fragChildNodesLength = fragChildNodes.length;
for (var a = 0; a < fragChildNodesLength; a++) {
this.insertBefore(fragChildNodes[a], referenceNode);
}
}
return this;
}
var hasFoundReferenceNode = false;
// There's no reason to handle default content add / remove because:
// 1. If no reference node is supplied, appendChild handles it.
// 2. If a reference node is supplied, there already is content.
// 3. If a reference node is invalid, an exception is thrown, but also
// it's state would not change even if it wasn't.
mainLoop:
for (var b = 0; b < contentNodesLen; b++) {
var contentNode = contentNodes[b];
var betweenNodes = getNodesBetween(contentNode.startNode, contentNode.endNode);
var betweenNodesLen = betweenNodes.length;
for (var c = 0; c < betweenNodesLen; c++) {
var betweenNode = betweenNodes[c];
if (betweenNode === referenceNode) {
hasFoundReferenceNode = true;
}
if (hasFoundReferenceNode) {
var selector = contentNode.selector;
if (!selector || matchesSelector.call(node, selector)) {
betweenNode.parentNode.insertBefore(node, betweenNode);
break mainLoop;
}
}
}
}
// If no reference node was found as a child node of the element we must
// throw an error. This works for both no child nodes, or if the
// reference wasn't found to be a child node.
if (!hasFoundReferenceNode) {
throw new Error('DOMException 8: The node before which the new node is to be inserted is not a child of this node.');
}
return node;
}
},
removeChild: {
value: function (childNode) {
var removed = false;
for (var a = 0; a < contentNodesLen; a++) {
var contentNode = contentNodes[a];
if (contentNode.container === childNode.parentNode) {
contentNode.container.removeChild(childNode);
removed = true;
break;
}
if (contentNode.startNode.nextSibling === contentNode.endNode) {
addDefaultContent(contentNode);
}
}
if (!removed) {
throw new Error('DOMException 8: The node in which you are trying to remove is not a child of this node.');
}
return childNode;
}
},
replaceChild: {
value: function (newChild, oldChild) {
for (var a = 0; a < contentNodesLen; a++) {
var contentNode = contentNodes[a];
if (contentNode.container === oldChild.parentNode) {
contentNode.container.replaceChild(newChild, oldChild);
break;
}
}
return this;
}
}
};
}
function addDefaultContent (content) {
var nodes = content.defaultNodes;
var nodesLen = nodes.length;
for (var a = 0; a < nodesLen; a++) {
content.container.insertBefore(nodes[a], content.endNode);
}
content.isDefault = true;
}
function removeDefaultContent (content) {
var nodes = content.defaultNodes;
var nodesLen = nodes.length;
for (var a = 0; a < nodesLen; a++) {
var node = nodes[a];
node.parentNode.removeChild(node);
}
content.isDefault = false;
}
function createProxyProperty (node, name) {
return {
get: function () {
var value = node[name];
if (typeof value === 'function') {
return value.bind(node);
}
return value;
},
set: function (value) {
node[name] = value;
}
};
}
function wrapNodeWith (node, wrapper) {
var wrapped = {};
for (var name in node) {
var inWrapper = name in wrapper;
if (inWrapper) {
Object.defineProperty(wrapped, name, wrapper[name]);
} else {
Object.defineProperty(wrapped, name, createProxyProperty(node, name));
}
}
return wrapped;
}
function cacheContentData (node) {
var contentNodes = node.getElementsByTagName('content');
var contentNodesLen = contentNodes && contentNodes.length;
if (contentNodesLen) {
var contentData = [];
while (contentNodes.length) {
var contentNode = contentNodes[0];
var parentNode = contentNode.parentNode;
var selector = contentNode.getAttribute('select');
var startNode = document.createComment(' content ');
var endNode = document.createComment(' /content ');
contentData.push({
container: parentNode,
contentNode: contentNode,
defaultNodes: [].slice.call(contentNode.childNodes),
endNode: endNode,
isDefault: true,
selector: selector,
startNode: startNode
});
parentNode.replaceChild(endNode, contentNode);
parentNode.insertBefore(startNode, endNode);
// Cache data in the comment that can be read if no content information
// is cached. This allows seamless server-side rendering.
startNode.textContent += JSON.stringify({
defaultContent: contentNode.innerHTML,
selector: selector
}) + ' ';
}
setData(node, 'content', contentData);
}
}
// Content Parser
// --------------
function parseCommentNode (node) {
var data;
var matches = node.textContent.match(/^ (\/?)content (.*)/i);
if (matches) {
if (matches[2]) {
try {
data = JSON.parse(matches[2]);
} catch (e) {
throw new Error('Unable to parse content comment data: "' + e + '" in "<!--' + node.textContent + '-->".');
}
}
return {
data: data || {
defaultContent: undefined,
isDefault: undefined,
selector: undefined
},
type: matches[1] ? 'close' : 'open'
};
}
}
function parseNodeForContent (node) {
var a;
var childNodes = node.childNodes;
var childNodesLen = childNodes.length;
var contentDatas = [];
var lastContentNode;
for (a = 0; a < childNodesLen; a++) {
var childNode = childNodes[a];
if (childNode.nodeType === 8) {
var contentInfo = parseCommentNode(childNode);
if (contentInfo) {
if (contentInfo.type === 'open') {
if (lastContentNode) {
throw new Error('Cannot have an opening content placeholder after another content placeholder at the same level in the DOM tree: "' + childNode.textContent + '" in "' + childNode.parentNode.innerHTML + '".');
}
lastContentNode = {
container: childNode.parentNode,
contentNode: childNode,
defaultNodes: contentInfo.data.defaultContent && createFragmentFromString(contentInfo.data.defaultContent).childNodes || [],
isDefault: contentInfo.data.isDefault,
selector: contentInfo.data.selector,
startNode: childNode
};
} else if (contentInfo.type === 'close') {
if (!lastContentNode) {
throw new Error('Unmatched closing content placeholder: "' + childNode.textContent + '" in "' + childNode.parentNode.innerHTML + '".');
}
lastContentNode.endNode = childNode;
contentDatas.push(lastContentNode);
lastContentNode = undefined;
}
}
} else {
contentDatas = contentDatas.concat(parseNodeForContent(childNode));
}
}
return contentDatas;
}
// Public API
// ----------
function skateTemplateHtml () {
var template = [].slice.call(arguments).join('');
return function (target) {
var frag = createFragmentFromNodeList(target.childNodes);
target.innerHTML = template;
cacheContentData(target);
if (frag.childNodes.length) {
skateTemplateHtml.wrap(target).appendChild(frag);
}
};
}
skateTemplateHtml.wrap = function (node) {
if (!getData(node, 'content')) {
setData(node, 'content', parseNodeForContent(node));
}
return wrapNodeWith(node, htmlTemplateParentWrapper(node));
};
// Exporting
// ---------
// Global.
window.skateTemplateHtml = skateTemplateHtml;
// AMD.
if (typeof define === 'function') {
define(function () {
return skateTemplateHtml;
});
}
// CommonJS.
if (typeof module === 'object') {
module.exports = skateTemplateHtml;
}
})();
return module.exports;
}).call(this);
// src/js/aui/debounce.js
(typeof window === 'undefined' ? global : window).__8cd9ff0a19109fb463ce91f349330abb = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = debounce;
exports.debounceImmediate = debounceImmediate;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function debounce(func, wait) {
var timeout;
var result;
return function () {
var args = arguments;
var context = this;
var later = function later() {
result = func.apply(context, args);
context = args = null;
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
return result;
};
}
(0, _globalize2.default)('debounce', debounce);
function debounceImmediate(func, wait) {
var timeout = null;
var result;
return function () {
var context = this;
var args = arguments;
var later = function later() {
timeout = context = args = null;
};
if (timeout === null) {
result = func.apply(context, args);
}
clearTimeout(timeout);
timeout = setTimeout(later, wait);
return result;
};
}
(0, _globalize2.default)('debounceImmediate', debounceImmediate);
return module.exports;
}).call(this);
// node_modules/tether/tether.js
(typeof window === 'undefined' ? global : window).__c4eb27dbd464e57ba19d70c0f1bcae57 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__c4eb27dbd464e57ba19d70c0f1bcae57");
define.amd = true;
/*! tether 0.6.5 */
(function(root) {
(function() {
var Evented, addClass, defer, deferred, extend, flush, getBounds, getOffsetParent, getOrigin, getScrollBarSize, getScrollParent, hasClass, node, removeClass, uniqueId, updateClasses, zeroPosCache,
__hasProp = {}.hasOwnProperty,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
__slice = [].slice;
if (this.Tether == null) {
this.Tether = {
modules: []
};
}
getScrollParent = function(el) {
var parent, position, scrollParent, style, _ref;
position = getComputedStyle(el).position;
if (position === 'fixed') {
return el;
}
scrollParent = void 0;
parent = el;
while (parent = parent.parentNode) {
try {
style = getComputedStyle(parent);
} catch (_error) {}
if (style == null) {
return parent;
}
if (/(auto|scroll)/.test(style['overflow'] + style['overflow-y'] + style['overflow-x'])) {
if (position !== 'absolute' || ((_ref = style['position']) === 'relative' || _ref === 'absolute' || _ref === 'fixed')) {
return parent;
}
}
}
return document.body;
};
uniqueId = (function() {
var id;
id = 0;
return function() {
return id++;
};
})();
zeroPosCache = {};
getOrigin = function(doc) {
var id, k, node, v, _ref;
node = doc._tetherZeroElement;
if (node == null) {
node = doc.createElement('div');
node.setAttribute('data-tether-id', uniqueId());
extend(node.style, {
top: 0,
left: 0,
position: 'absolute'
});
doc.body.appendChild(node);
doc._tetherZeroElement = node;
}
id = node.getAttribute('data-tether-id');
if (zeroPosCache[id] == null) {
zeroPosCache[id] = {};
_ref = node.getBoundingClientRect();
for (k in _ref) {
v = _ref[k];
zeroPosCache[id][k] = v;
}
defer(function() {
return zeroPosCache[id] = void 0;
});
}
return zeroPosCache[id];
};
node = null;
getBounds = function(el) {
var box, doc, docEl, k, origin, v, _ref;
if (el === document) {
doc = document;
el = document.documentElement;
} else {
doc = el.ownerDocument;
}
docEl = doc.documentElement;
box = {};
_ref = el.getBoundingClientRect();
for (k in _ref) {
v = _ref[k];
box[k] = v;
}
origin = getOrigin(doc);
box.top -= origin.top;
box.left -= origin.left;
if (box.width == null) {
box.width = document.body.scrollWidth - box.left - box.right;
}
if (box.height == null) {
box.height = document.body.scrollHeight - box.top - box.bottom;
}
box.top = box.top - docEl.clientTop;
box.left = box.left - docEl.clientLeft;
box.right = doc.body.clientWidth - box.width - box.left;
box.bottom = doc.body.clientHeight - box.height - box.top;
return box;
};
getOffsetParent = function(el) {
return el.offsetParent || document.documentElement;
};
getScrollBarSize = function() {
var inner, outer, width, widthContained, widthScroll;
inner = document.createElement('div');
inner.style.width = '100%';
inner.style.height = '200px';
outer = document.createElement('div');
extend(outer.style, {
position: 'absolute',
top: 0,
left: 0,
pointerEvents: 'none',
visibility: 'hidden',
width: '200px',
height: '150px',
overflow: 'hidden'
});
outer.appendChild(inner);
document.body.appendChild(outer);
widthContained = inner.offsetWidth;
outer.style.overflow = 'scroll';
widthScroll = inner.offsetWidth;
if (widthContained === widthScroll) {
widthScroll = outer.clientWidth;
}
document.body.removeChild(outer);
width = widthContained - widthScroll;
return {
width: width,
height: width
};
};
extend = function(out) {
var args, key, obj, val, _i, _len, _ref;
if (out == null) {
out = {};
}
args = [];
Array.prototype.push.apply(args, arguments);
_ref = args.slice(1);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
obj = _ref[_i];
if (obj) {
for (key in obj) {
if (!__hasProp.call(obj, key)) continue;
val = obj[key];
out[key] = val;
}
}
}
return out;
};
removeClass = function(el, name) {
var cls, _i, _len, _ref, _results;
if (el.classList != null) {
_ref = name.split(' ');
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
cls = _ref[_i];
if (cls.trim()) {
_results.push(el.classList.remove(cls));
}
}
return _results;
} else {
return el.className = el.className.replace(new RegExp("(^| )" + (name.split(' ').join('|')) + "( |$)", 'gi'), ' ');
}
};
addClass = function(el, name) {
var cls, _i, _len, _ref, _results;
if (el.classList != null) {
_ref = name.split(' ');
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
cls = _ref[_i];
if (cls.trim()) {
_results.push(el.classList.add(cls));
}
}
return _results;
} else {
removeClass(el, name);
return el.className += " " + name;
}
};
hasClass = function(el, name) {
if (el.classList != null) {
return el.classList.contains(name);
} else {
return new RegExp("(^| )" + name + "( |$)", 'gi').test(el.className);
}
};
updateClasses = function(el, add, all) {
var cls, _i, _j, _len, _len1, _results;
for (_i = 0, _len = all.length; _i < _len; _i++) {
cls = all[_i];
if (__indexOf.call(add, cls) < 0) {
if (hasClass(el, cls)) {
removeClass(el, cls);
}
}
}
_results = [];
for (_j = 0, _len1 = add.length; _j < _len1; _j++) {
cls = add[_j];
if (!hasClass(el, cls)) {
_results.push(addClass(el, cls));
} else {
_results.push(void 0);
}
}
return _results;
};
deferred = [];
defer = function(fn) {
return deferred.push(fn);
};
flush = function() {
var fn, _results;
_results = [];
while (fn = deferred.pop()) {
_results.push(fn());
}
return _results;
};
Evented = (function() {
function Evented() {}
Evented.prototype.on = function(event, handler, ctx, once) {
var _base;
if (once == null) {
once = false;
}
if (this.bindings == null) {
this.bindings = {};
}
if ((_base = this.bindings)[event] == null) {
_base[event] = [];
}
return this.bindings[event].push({
handler: handler,
ctx: ctx,
once: once
});
};
Evented.prototype.once = function(event, handler, ctx) {
return this.on(event, handler, ctx, true);
};
Evented.prototype.off = function(event, handler) {
var i, _ref, _results;
if (((_ref = this.bindings) != null ? _ref[event] : void 0) == null) {
return;
}
if (handler == null) {
return delete this.bindings[event];
} else {
i = 0;
_results = [];
while (i < this.bindings[event].length) {
if (this.bindings[event][i].handler === handler) {
_results.push(this.bindings[event].splice(i, 1));
} else {
_results.push(i++);
}
}
return _results;
}
};
Evented.prototype.trigger = function() {
var args, ctx, event, handler, i, once, _ref, _ref1, _results;
event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if ((_ref = this.bindings) != null ? _ref[event] : void 0) {
i = 0;
_results = [];
while (i < this.bindings[event].length) {
_ref1 = this.bindings[event][i], handler = _ref1.handler, ctx = _ref1.ctx, once = _ref1.once;
handler.apply(ctx != null ? ctx : this, args);
if (once) {
_results.push(this.bindings[event].splice(i, 1));
} else {
_results.push(i++);
}
}
return _results;
}
};
return Evented;
})();
this.Tether.Utils = {
getScrollParent: getScrollParent,
getBounds: getBounds,
getOffsetParent: getOffsetParent,
extend: extend,
addClass: addClass,
removeClass: removeClass,
hasClass: hasClass,
updateClasses: updateClasses,
defer: defer,
flush: flush,
uniqueId: uniqueId,
Evented: Evented,
getScrollBarSize: getScrollBarSize
};
}).call(this);
(function() {
var MIRROR_LR, MIRROR_TB, OFFSET_MAP, Tether, addClass, addOffset, attachmentToOffset, autoToFixedAttachment, defer, extend, flush, getBounds, getOffsetParent, getOuterSize, getScrollBarSize, getScrollParent, getSize, now, offsetToPx, parseAttachment, parseOffset, position, removeClass, tethers, transformKey, updateClasses, within, _Tether, _ref,
__slice = [].slice,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
if (this.Tether == null) {
throw new Error("You must include the utils.js file before tether.js");
}
Tether = this.Tether;
_ref = Tether.Utils, getScrollParent = _ref.getScrollParent, getSize = _ref.getSize, getOuterSize = _ref.getOuterSize, getBounds = _ref.getBounds, getOffsetParent = _ref.getOffsetParent, extend = _ref.extend, addClass = _ref.addClass, removeClass = _ref.removeClass, updateClasses = _ref.updateClasses, defer = _ref.defer, flush = _ref.flush, getScrollBarSize = _ref.getScrollBarSize;
within = function(a, b, diff) {
if (diff == null) {
diff = 1;
}
return (a + diff >= b && b >= a - diff);
};
transformKey = (function() {
var el, key, _i, _len, _ref1;
el = document.createElement('div');
_ref1 = ['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform'];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
key = _ref1[_i];
if (el.style[key] !== void 0) {
return key;
}
}
})();
tethers = [];
position = function() {
var tether, _i, _len;
for (_i = 0, _len = tethers.length; _i < _len; _i++) {
tether = tethers[_i];
tether.position(false);
}
return flush();
};
now = function() {
var _ref1;
return (_ref1 = typeof performance !== "undefined" && performance !== null ? typeof performance.now === "function" ? performance.now() : void 0 : void 0) != null ? _ref1 : +(new Date);
};
(function() {
var event, lastCall, lastDuration, pendingTimeout, tick, _i, _len, _ref1, _results;
lastCall = null;
lastDuration = null;
pendingTimeout = null;
tick = function() {
if ((lastDuration != null) && lastDuration > 16) {
lastDuration = Math.min(lastDuration - 16, 250);
pendingTimeout = setTimeout(tick, 250);
return;
}
if ((lastCall != null) && (now() - lastCall) < 10) {
return;
}
if (pendingTimeout != null) {
clearTimeout(pendingTimeout);
pendingTimeout = null;
}
lastCall = now();
position();
return lastDuration = now() - lastCall;
};
_ref1 = ['resize', 'scroll', 'touchmove'];
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
event = _ref1[_i];
_results.push(window.addEventListener(event, tick));
}
return _results;
})();
MIRROR_LR = {
center: 'center',
left: 'right',
right: 'left'
};
MIRROR_TB = {
middle: 'middle',
top: 'bottom',
bottom: 'top'
};
OFFSET_MAP = {
top: 0,
left: 0,
middle: '50%',
center: '50%',
bottom: '100%',
right: '100%'
};
autoToFixedAttachment = function(attachment, relativeToAttachment) {
var left, top;
left = attachment.left, top = attachment.top;
if (left === 'auto') {
left = MIRROR_LR[relativeToAttachment.left];
}
if (top === 'auto') {
top = MIRROR_TB[relativeToAttachment.top];
}
return {
left: left,
top: top
};
};
attachmentToOffset = function(attachment) {
var _ref1, _ref2;
return {
left: (_ref1 = OFFSET_MAP[attachment.left]) != null ? _ref1 : attachment.left,
top: (_ref2 = OFFSET_MAP[attachment.top]) != null ? _ref2 : attachment.top
};
};
addOffset = function() {
var left, offsets, out, top, _i, _len, _ref1;
offsets = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
out = {
top: 0,
left: 0
};
for (_i = 0, _len = offsets.length; _i < _len; _i++) {
_ref1 = offsets[_i], top = _ref1.top, left = _ref1.left;
if (typeof top === 'string') {
top = parseFloat(top, 10);
}
if (typeof left === 'string') {
left = parseFloat(left, 10);
}
out.top += top;
out.left += left;
}
return out;
};
offsetToPx = function(offset, size) {
if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) {
offset.left = parseFloat(offset.left, 10) / 100 * size.width;
}
if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) {
offset.top = parseFloat(offset.top, 10) / 100 * size.height;
}
return offset;
};
parseAttachment = parseOffset = function(value) {
var left, top, _ref1;
_ref1 = value.split(' '), top = _ref1[0], left = _ref1[1];
return {
top: top,
left: left
};
};
_Tether = (function() {
_Tether.modules = [];
function _Tether(options) {
this.position = __bind(this.position, this);
var module, _i, _len, _ref1, _ref2;
tethers.push(this);
this.history = [];
this.setOptions(options, false);
_ref1 = Tether.modules;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
module = _ref1[_i];
if ((_ref2 = module.initialize) != null) {
_ref2.call(this);
}
}
this.position();
}
_Tether.prototype.getClass = function(key) {
var _ref1, _ref2;
if ((_ref1 = this.options.classes) != null ? _ref1[key] : void 0) {
return this.options.classes[key];
} else if (((_ref2 = this.options.classes) != null ? _ref2[key] : void 0) !== false) {
if (this.options.classPrefix) {
return "" + this.options.classPrefix + "-" + key;
} else {
return key;
}
} else {
return '';
}
};
_Tether.prototype.setOptions = function(options, position) {
var defaults, key, _i, _len, _ref1, _ref2;
this.options = options;
if (position == null) {
position = true;
}
defaults = {
offset: '0 0',
targetOffset: '0 0',
targetAttachment: 'auto auto',
classPrefix: 'tether'
};
this.options = extend(defaults, this.options);
_ref1 = this.options, this.element = _ref1.element, this.target = _ref1.target, this.targetModifier = _ref1.targetModifier;
if (this.target === 'viewport') {
this.target = document.body;
this.targetModifier = 'visible';
} else if (this.target === 'scroll-handle') {
this.target = document.body;
this.targetModifier = 'scroll-handle';
}
_ref2 = ['element', 'target'];
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
key = _ref2[_i];
if (this[key] == null) {
throw new Error("Tether Error: Both element and target must be defined");
}
if (this[key].jquery != null) {
this[key] = this[key][0];
} else if (typeof this[key] === 'string') {
this[key] = document.querySelector(this[key]);
}
}
addClass(this.element, this.getClass('element'));
addClass(this.target, this.getClass('target'));
if (!this.options.attachment) {
throw new Error("Tether Error: You must provide an attachment");
}
this.targetAttachment = parseAttachment(this.options.targetAttachment);
this.attachment = parseAttachment(this.options.attachment);
this.offset = parseOffset(this.options.offset);
this.targetOffset = parseOffset(this.options.targetOffset);
if (this.scrollParent != null) {
this.disable();
}
if (this.targetModifier === 'scroll-handle') {
this.scrollParent = this.target;
} else {
this.scrollParent = getScrollParent(this.target);
}
if (this.options.enabled !== false) {
return this.enable(position);
}
};
_Tether.prototype.getTargetBounds = function() {
var bounds, fitAdj, hasBottomScroll, height, out, scrollBottom, scrollPercentage, style, target;
if (this.targetModifier != null) {
switch (this.targetModifier) {
case 'visible':
if (this.target === document.body) {
return {
top: pageYOffset,
left: pageXOffset,
height: innerHeight,
width: innerWidth
};
} else {
bounds = getBounds(this.target);
out = {
height: bounds.height,
width: bounds.width,
top: bounds.top,
left: bounds.left
};
out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top));
out.height = Math.min(out.height, bounds.height - ((bounds.top + bounds.height) - (pageYOffset + innerHeight)));
out.height = Math.min(innerHeight, out.height);
out.height -= 2;
out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left));
out.width = Math.min(out.width, bounds.width - ((bounds.left + bounds.width) - (pageXOffset + innerWidth)));
out.width = Math.min(innerWidth, out.width);
out.width -= 2;
if (out.top < pageYOffset) {
out.top = pageYOffset;
}
if (out.left < pageXOffset) {
out.left = pageXOffset;
}
return out;
}
break;
case 'scroll-handle':
target = this.target;
if (target === document.body) {
target = document.documentElement;
bounds = {
left: pageXOffset,
top: pageYOffset,
height: innerHeight,
width: innerWidth
};
} else {
bounds = getBounds(target);
}
style = getComputedStyle(target);
hasBottomScroll = target.scrollWidth > target.clientWidth || 'scroll' === [style.overflow, style.overflowX] || this.target !== document.body;
scrollBottom = 0;
if (hasBottomScroll) {
scrollBottom = 15;
}
height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom;
out = {
width: 15,
height: height * 0.975 * (height / target.scrollHeight),
left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15
};
fitAdj = 0;
if (height < 408 && this.target === document.body) {
fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58;
}
if (this.target !== document.body) {
out.height = Math.max(out.height, 24);
}
scrollPercentage = this.target.scrollTop / (target.scrollHeight - height);
out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth);
if (this.target === document.body) {
out.height = Math.max(out.height, 24);
}
return out;
}
} else {
return getBounds(this.target);
}
};
_Tether.prototype.clearCache = function() {
return this._cache = {};
};
_Tether.prototype.cache = function(k, getter) {
if (this._cache == null) {
this._cache = {};
}
if (this._cache[k] == null) {
this._cache[k] = getter.call(this);
}
return this._cache[k];
};
_Tether.prototype.enable = function(position) {
if (position == null) {
position = true;
}
addClass(this.target, this.getClass('enabled'));
addClass(this.element, this.getClass('enabled'));
this.enabled = true;
if (this.scrollParent !== document) {
this.scrollParent.addEventListener('scroll', this.position);
}
if (position) {
return this.position();
}
};
_Tether.prototype.disable = function() {
removeClass(this.target, this.getClass('enabled'));
removeClass(this.element, this.getClass('enabled'));
this.enabled = false;
if (this.scrollParent != null) {
return this.scrollParent.removeEventListener('scroll', this.position);
}
};
_Tether.prototype.destroy = function() {
var i, tether, _i, _len, _results;
this.disable();
_results = [];
for (i = _i = 0, _len = tethers.length; _i < _len; i = ++_i) {
tether = tethers[i];
if (tether === this) {
tethers.splice(i, 1);
break;
} else {
_results.push(void 0);
}
}
return _results;
};
_Tether.prototype.updateAttachClasses = function(elementAttach, targetAttach) {
var add, all, side, sides, _i, _j, _len, _len1, _ref1,
_this = this;
if (elementAttach == null) {
elementAttach = this.attachment;
}
if (targetAttach == null) {
targetAttach = this.targetAttachment;
}
sides = ['left', 'top', 'bottom', 'right', 'middle', 'center'];
if ((_ref1 = this._addAttachClasses) != null ? _ref1.length : void 0) {
this._addAttachClasses.splice(0, this._addAttachClasses.length);
}
add = this._addAttachClasses != null ? this._addAttachClasses : this._addAttachClasses = [];
if (elementAttach.top) {
add.push("" + (this.getClass('element-attached')) + "-" + elementAttach.top);
}
if (elementAttach.left) {
add.push("" + (this.getClass('element-attached')) + "-" + elementAttach.left);
}
if (targetAttach.top) {
add.push("" + (this.getClass('target-attached')) + "-" + targetAttach.top);
}
if (targetAttach.left) {
add.push("" + (this.getClass('target-attached')) + "-" + targetAttach.left);
}
all = [];
for (_i = 0, _len = sides.length; _i < _len; _i++) {
side = sides[_i];
all.push("" + (this.getClass('element-attached')) + "-" + side);
}
for (_j = 0, _len1 = sides.length; _j < _len1; _j++) {
side = sides[_j];
all.push("" + (this.getClass('target-attached')) + "-" + side);
}
return defer(function() {
if (_this._addAttachClasses == null) {
return;
}
updateClasses(_this.element, _this._addAttachClasses, all);
updateClasses(_this.target, _this._addAttachClasses, all);
return _this._addAttachClasses = void 0;
});
};
_Tether.prototype.position = function(flushChanges) {
var elementPos, elementStyle, height, left, manualOffset, manualTargetOffset, module, next, offset, offsetBorder, offsetParent, offsetParentSize, offsetParentStyle, offsetPosition, ret, scrollLeft, scrollTop, scrollbarSize, side, targetAttachment, targetOffset, targetPos, targetSize, top, width, _i, _j, _len, _len1, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6,
_this = this;
if (flushChanges == null) {
flushChanges = true;
}
if (!this.enabled) {
return;
}
this.clearCache();
targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment);
this.updateAttachClasses(this.attachment, targetAttachment);
elementPos = this.cache('element-bounds', function() {
return getBounds(_this.element);
});
width = elementPos.width, height = elementPos.height;
if (width === 0 && height === 0 && (this.lastSize != null)) {
_ref1 = this.lastSize, width = _ref1.width, height = _ref1.height;
} else {
this.lastSize = {
width: width,
height: height
};
}
targetSize = targetPos = this.cache('target-bounds', function() {
return _this.getTargetBounds();
});
offset = offsetToPx(attachmentToOffset(this.attachment), {
width: width,
height: height
});
targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize);
manualOffset = offsetToPx(this.offset, {
width: width,
height: height
});
manualTargetOffset = offsetToPx(this.targetOffset, targetSize);
offset = addOffset(offset, manualOffset);
targetOffset = addOffset(targetOffset, manualTargetOffset);
left = targetPos.left + targetOffset.left - offset.left;
top = targetPos.top + targetOffset.top - offset.top;
_ref2 = Tether.modules;
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
module = _ref2[_i];
ret = module.position.call(this, {
left: left,
top: top,
targetAttachment: targetAttachment,
targetPos: targetPos,
attachment: this.attachment,
elementPos: elementPos,
offset: offset,
targetOffset: targetOffset,
manualOffset: manualOffset,
manualTargetOffset: manualTargetOffset,
scrollbarSize: scrollbarSize
});
if ((ret == null) || typeof ret !== 'object') {
continue;
} else if (ret === false) {
return false;
} else {
top = ret.top, left = ret.left;
}
}
next = {
page: {
top: top,
left: left
},
viewport: {
top: top - pageYOffset,
bottom: pageYOffset - top - height + innerHeight,
left: left - pageXOffset,
right: pageXOffset - left - width + innerWidth
}
};
if (document.body.scrollWidth > window.innerWidth) {
scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
next.viewport.bottom -= scrollbarSize.height;
}
if (document.body.scrollHeight > window.innerHeight) {
scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
next.viewport.right -= scrollbarSize.width;
}
if (((_ref3 = document.body.style.position) !== '' && _ref3 !== 'static') || ((_ref4 = document.body.parentElement.style.position) !== '' && _ref4 !== 'static')) {
next.page.bottom = document.body.scrollHeight - top - height;
next.page.right = document.body.scrollWidth - left - width;
}
if (((_ref5 = this.options.optimizations) != null ? _ref5.moveElement : void 0) !== false && (this.targetModifier == null)) {
offsetParent = this.cache('target-offsetparent', function() {
return getOffsetParent(_this.target);
});
offsetPosition = this.cache('target-offsetparent-bounds', function() {
return getBounds(offsetParent);
});
offsetParentStyle = getComputedStyle(offsetParent);
elementStyle = getComputedStyle(this.element);
offsetParentSize = offsetPosition;
offsetBorder = {};
_ref6 = ['Top', 'Left', 'Bottom', 'Right'];
for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
side = _ref6[_j];
offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle["border" + side + "Width"]);
}
offsetPosition.right = document.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right;
offsetPosition.bottom = document.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom;
if (next.page.top >= (offsetPosition.top + offsetBorder.top) && next.page.bottom >= offsetPosition.bottom) {
if (next.page.left >= (offsetPosition.left + offsetBorder.left) && next.page.right >= offsetPosition.right) {
scrollTop = offsetParent.scrollTop;
scrollLeft = offsetParent.scrollLeft;
next.offset = {
top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top,
left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left
};
}
}
}
this.move(next);
this.history.unshift(next);
if (this.history.length > 3) {
this.history.pop();
}
if (flushChanges) {
flush();
}
return true;
};
_Tether.prototype.move = function(position) {
var css, elVal, found, key, moved, offsetParent, point, same, transcribe, type, val, write, writeCSS, _i, _len, _ref1, _ref2,
_this = this;
if (this.element.parentNode == null) {
return;
}
same = {};
for (type in position) {
same[type] = {};
for (key in position[type]) {
found = false;
_ref1 = this.history;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
point = _ref1[_i];
if (!within((_ref2 = point[type]) != null ? _ref2[key] : void 0, position[type][key])) {
found = true;
break;
}
}
if (!found) {
same[type][key] = true;
}
}
}
css = {
top: '',
left: '',
right: '',
bottom: ''
};
transcribe = function(same, pos) {
var xPos, yPos, _ref3;
if (((_ref3 = _this.options.optimizations) != null ? _ref3.gpu : void 0) !== false) {
if (same.top) {
css.top = 0;
yPos = pos.top;
} else {
css.bottom = 0;
yPos = -pos.bottom;
}
if (same.left) {
css.left = 0;
xPos = pos.left;
} else {
css.right = 0;
xPos = -pos.right;
}
css[transformKey] = "translateX(" + (Math.round(xPos)) + "px) translateY(" + (Math.round(yPos)) + "px)";
if (transformKey !== 'msTransform') {
return css[transformKey] += " translateZ(0)";
}
} else {
if (same.top) {
css.top = "" + pos.top + "px";
} else {
css.bottom = "" + pos.bottom + "px";
}
if (same.left) {
return css.left = "" + pos.left + "px";
} else {
return css.right = "" + pos.right + "px";
}
}
};
moved = false;
if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) {
css.position = 'absolute';
transcribe(same.page, position.page);
} else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) {
css.position = 'fixed';
transcribe(same.viewport, position.viewport);
} else if ((same.offset != null) && same.offset.top && same.offset.left) {
css.position = 'absolute';
offsetParent = this.cache('target-offsetparent', function() {
return getOffsetParent(_this.target);
});
if (getOffsetParent(this.element) !== offsetParent) {
defer(function() {
_this.element.parentNode.removeChild(_this.element);
return offsetParent.appendChild(_this.element);
});
}
transcribe(same.offset, position.offset);
moved = true;
} else {
css.position = 'absolute';
transcribe({
top: true,
left: true
}, position.page);
}
if (!moved && this.element.parentNode.tagName !== 'BODY') {
this.element.parentNode.removeChild(this.element);
document.body.appendChild(this.element);
}
writeCSS = {};
write = false;
for (key in css) {
val = css[key];
elVal = this.element.style[key];
if (elVal !== '' && val !== '' && (key === 'top' || key === 'left' || key === 'bottom' || key === 'right')) {
elVal = parseFloat(elVal);
val = parseFloat(val);
}
if (elVal !== val) {
write = true;
writeCSS[key] = css[key];
}
}
if (write) {
return defer(function() {
return extend(_this.element.style, writeCSS);
});
}
};
return _Tether;
})();
Tether.position = position;
this.Tether = extend(_Tether, Tether);
}).call(this);
(function() {
var BOUNDS_FORMAT, MIRROR_ATTACH, defer, extend, getBoundingRect, getBounds, getOuterSize, getSize, updateClasses, _ref,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
_ref = this.Tether.Utils, getOuterSize = _ref.getOuterSize, getBounds = _ref.getBounds, getSize = _ref.getSize, extend = _ref.extend, updateClasses = _ref.updateClasses, defer = _ref.defer;
MIRROR_ATTACH = {
left: 'right',
right: 'left',
top: 'bottom',
bottom: 'top',
middle: 'middle'
};
BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom'];
getBoundingRect = function(tether, to) {
var i, pos, side, size, style, _i, _len;
if (to === 'scrollParent') {
to = tether.scrollParent;
} else if (to === 'window') {
to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset];
}
if (to === document) {
to = to.documentElement;
}
if (to.nodeType != null) {
pos = size = getBounds(to);
style = getComputedStyle(to);
to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top];
for (i = _i = 0, _len = BOUNDS_FORMAT.length; _i < _len; i = ++_i) {
side = BOUNDS_FORMAT[i];
side = side[0].toUpperCase() + side.substr(1);
if (side === 'Top' || side === 'Left') {
to[i] += parseFloat(style["border" + side + "Width"]);
} else {
to[i] -= parseFloat(style["border" + side + "Width"]);
}
}
}
return to;
};
this.Tether.modules.push({
position: function(_arg) {
var addClasses, allClasses, attachment, bounds, changeAttachX, changeAttachY, cls, constraint, eAttachment, height, left, oob, oobClass, p, pin, pinned, pinnedClass, removeClass, side, tAttachment, targetAttachment, targetHeight, targetSize, targetWidth, to, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8,
_this = this;
top = _arg.top, left = _arg.left, targetAttachment = _arg.targetAttachment;
if (!this.options.constraints) {
return true;
}
removeClass = function(prefix) {
var side, _i, _len, _results;
_this.removeClass(prefix);
_results = [];
for (_i = 0, _len = BOUNDS_FORMAT.length; _i < _len; _i++) {
side = BOUNDS_FORMAT[_i];
_results.push(_this.removeClass("" + prefix + "-" + side));
}
return _results;
};
_ref1 = this.cache('element-bounds', function() {
return getBounds(_this.element);
}), height = _ref1.height, width = _ref1.width;
if (width === 0 && height === 0 && (this.lastSize != null)) {
_ref2 = this.lastSize, width = _ref2.width, height = _ref2.height;
}
targetSize = this.cache('target-bounds', function() {
return _this.getTargetBounds();
});
targetHeight = targetSize.height;
targetWidth = targetSize.width;
tAttachment = {};
eAttachment = {};
allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')];
_ref3 = this.options.constraints;
for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
constraint = _ref3[_i];
if (constraint.outOfBoundsClass) {
allClasses.push(constraint.outOfBoundsClass);
}
if (constraint.pinnedClass) {
allClasses.push(constraint.pinnedClass);
}
}
for (_j = 0, _len1 = allClasses.length; _j < _len1; _j++) {
cls = allClasses[_j];
_ref4 = ['left', 'top', 'right', 'bottom'];
for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
side = _ref4[_k];
allClasses.push("" + cls + "-" + side);
}
}
addClasses = [];
tAttachment = extend({}, targetAttachment);
eAttachment = extend({}, this.attachment);
_ref5 = this.options.constraints;
for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
constraint = _ref5[_l];
to = constraint.to, attachment = constraint.attachment, pin = constraint.pin;
if (attachment == null) {
attachment = '';
}
if (__indexOf.call(attachment, ' ') >= 0) {
_ref6 = attachment.split(' '), changeAttachY = _ref6[0], changeAttachX = _ref6[1];
} else {
changeAttachX = changeAttachY = attachment;
}
bounds = getBoundingRect(this, to);
if (changeAttachY === 'target' || changeAttachY === 'both') {
if (top < bounds[1] && tAttachment.top === 'top') {
top += targetHeight;
tAttachment.top = 'bottom';
}
if (top + height > bounds[3] && tAttachment.top === 'bottom') {
top -= targetHeight;
tAttachment.top = 'top';
}
}
if (changeAttachY === 'together') {
if (top < bounds[1] && tAttachment.top === 'top') {
if (eAttachment.top === 'bottom') {
top += targetHeight;
tAttachment.top = 'bottom';
top += height;
eAttachment.top = 'top';
} else if (eAttachment.top === 'top') {
top += targetHeight;
tAttachment.top = 'bottom';
top -= height;
eAttachment.top = 'bottom';
}
}
if (top + height > bounds[3] && tAttachment.top === 'bottom') {
if (eAttachment.top === 'top') {
top -= targetHeight;
tAttachment.top = 'top';
top -= height;
eAttachment.top = 'bottom';
} else if (eAttachment.top === 'bottom') {
top -= targetHeight;
tAttachment.top = 'top';
top += height;
eAttachment.top = 'top';
}
}
if (tAttachment.top === 'middle') {
if (top + height > bounds[3] && eAttachment.top === 'top') {
top -= height;
eAttachment.top = 'bottom';
} else if (top < bounds[1] && eAttachment.top === 'bottom') {
top += height;
eAttachment.top = 'top';
}
}
}
if (changeAttachX === 'target' || changeAttachX === 'both') {
if (left < bounds[0] && tAttachment.left === 'left') {
left += targetWidth;
tAttachment.left = 'right';
}
if (left + width > bounds[2] && tAttachment.left === 'right') {
left -= targetWidth;
tAttachment.left = 'left';
}
}
if (changeAttachX === 'together') {
if (left < bounds[0] && tAttachment.left === 'left') {
if (eAttachment.left === 'right') {
left += targetWidth;
tAttachment.left = 'right';
left += width;
eAttachment.left = 'left';
} else if (eAttachment.left === 'left') {
left += targetWidth;
tAttachment.left = 'right';
left -= width;
eAttachment.left = 'right';
}
} else if (left + width > bounds[2] && tAttachment.left === 'right') {
if (eAttachment.left === 'left') {
left -= targetWidth;
tAttachment.left = 'left';
left -= width;
eAttachment.left = 'right';
} else if (eAttachment.left === 'right') {
left -= targetWidth;
tAttachment.left = 'left';
left += width;
eAttachment.left = 'left';
}
} else if (tAttachment.left === 'center') {
if (left + width > bounds[2] && eAttachment.left === 'left') {
left -= width;
eAttachment.left = 'right';
} else if (left < bounds[0] && eAttachment.left === 'right') {
left += width;
eAttachment.left = 'left';
}
}
}
if (changeAttachY === 'element' || changeAttachY === 'both') {
if (top < bounds[1] && eAttachment.top === 'bottom') {
top += height;
eAttachment.top = 'top';
}
if (top + height > bounds[3] && eAttachment.top === 'top') {
top -= height;
eAttachment.top = 'bottom';
}
}
if (changeAttachX === 'element' || changeAttachX === 'both') {
if (left < bounds[0] && eAttachment.left === 'right') {
left += width;
eAttachment.left = 'left';
}
if (left + width > bounds[2] && eAttachment.left === 'left') {
left -= width;
eAttachment.left = 'right';
}
}
if (typeof pin === 'string') {
pin = (function() {
var _len4, _m, _ref7, _results;
_ref7 = pin.split(',');
_results = [];
for (_m = 0, _len4 = _ref7.length; _m < _len4; _m++) {
p = _ref7[_m];
_results.push(p.trim());
}
return _results;
})();
} else if (pin === true) {
pin = ['top', 'left', 'right', 'bottom'];
}
pin || (pin = []);
pinned = [];
oob = [];
if (top < bounds[1]) {
if (__indexOf.call(pin, 'top') >= 0) {
top = bounds[1];
pinned.push('top');
} else {
oob.push('top');
}
}
if (top + height > bounds[3]) {
if (__indexOf.call(pin, 'bottom') >= 0) {
top = bounds[3] - height;
pinned.push('bottom');
} else {
oob.push('bottom');
}
}
if (left < bounds[0]) {
if (__indexOf.call(pin, 'left') >= 0) {
left = bounds[0];
pinned.push('left');
} else {
oob.push('left');
}
}
if (left + width > bounds[2]) {
if (__indexOf.call(pin, 'right') >= 0) {
left = bounds[2] - width;
pinned.push('right');
} else {
oob.push('right');
}
}
if (pinned.length) {
pinnedClass = (_ref7 = this.options.pinnedClass) != null ? _ref7 : this.getClass('pinned');
addClasses.push(pinnedClass);
for (_m = 0, _len4 = pinned.length; _m < _len4; _m++) {
side = pinned[_m];
addClasses.push("" + pinnedClass + "-" + side);
}
}
if (oob.length) {
oobClass = (_ref8 = this.options.outOfBoundsClass) != null ? _ref8 : this.getClass('out-of-bounds');
addClasses.push(oobClass);
for (_n = 0, _len5 = oob.length; _n < _len5; _n++) {
side = oob[_n];
addClasses.push("" + oobClass + "-" + side);
}
}
if (__indexOf.call(pinned, 'left') >= 0 || __indexOf.call(pinned, 'right') >= 0) {
eAttachment.left = tAttachment.left = false;
}
if (__indexOf.call(pinned, 'top') >= 0 || __indexOf.call(pinned, 'bottom') >= 0) {
eAttachment.top = tAttachment.top = false;
}
if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== this.attachment.top || eAttachment.left !== this.attachment.left) {
this.updateAttachClasses(eAttachment, tAttachment);
}
}
defer(function() {
updateClasses(_this.target, addClasses, allClasses);
return updateClasses(_this.element, addClasses, allClasses);
});
return {
top: top,
left: left
};
}
});
}).call(this);
(function() {
var defer, getBounds, updateClasses, _ref;
_ref = this.Tether.Utils, getBounds = _ref.getBounds, updateClasses = _ref.updateClasses, defer = _ref.defer;
this.Tether.modules.push({
position: function(_arg) {
var abutted, addClasses, allClasses, bottom, height, left, right, side, sides, targetPos, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref1, _ref2, _ref3, _ref4, _ref5,
_this = this;
top = _arg.top, left = _arg.left;
_ref1 = this.cache('element-bounds', function() {
return getBounds(_this.element);
}), height = _ref1.height, width = _ref1.width;
targetPos = this.getTargetBounds();
bottom = top + height;
right = left + width;
abutted = [];
if (top <= targetPos.bottom && bottom >= targetPos.top) {
_ref2 = ['left', 'right'];
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
side = _ref2[_i];
if ((_ref3 = targetPos[side]) === left || _ref3 === right) {
abutted.push(side);
}
}
}
if (left <= targetPos.right && right >= targetPos.left) {
_ref4 = ['top', 'bottom'];
for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
side = _ref4[_j];
if ((_ref5 = targetPos[side]) === top || _ref5 === bottom) {
abutted.push(side);
}
}
}
allClasses = [];
addClasses = [];
sides = ['left', 'top', 'right', 'bottom'];
allClasses.push(this.getClass('abutted'));
for (_k = 0, _len2 = sides.length; _k < _len2; _k++) {
side = sides[_k];
allClasses.push("" + (this.getClass('abutted')) + "-" + side);
}
if (abutted.length) {
addClasses.push(this.getClass('abutted'));
}
for (_l = 0, _len3 = abutted.length; _l < _len3; _l++) {
side = abutted[_l];
addClasses.push("" + (this.getClass('abutted')) + "-" + side);
}
defer(function() {
updateClasses(_this.target, addClasses, allClasses);
return updateClasses(_this.element, addClasses, allClasses);
});
return true;
}
});
}).call(this);
(function() {
this.Tether.modules.push({
position: function(_arg) {
var left, result, shift, shiftLeft, shiftTop, top, _ref;
top = _arg.top, left = _arg.left;
if (!this.options.shift) {
return;
}
result = function(val) {
if (typeof val === 'function') {
return val.call(this, {
top: top,
left: left
});
} else {
return val;
}
};
shift = result(this.options.shift);
if (typeof shift === 'string') {
shift = shift.split(' ');
shift[1] || (shift[1] = shift[0]);
shiftTop = shift[0], shiftLeft = shift[1];
shiftTop = parseFloat(shiftTop, 10);
shiftLeft = parseFloat(shiftLeft, 10);
} else {
_ref = [shift.top, shift.left], shiftTop = _ref[0], shiftLeft = _ref[1];
}
top += shiftTop;
left += shiftLeft;
return {
top: top,
left: left
};
}
});
}).call(this);
root.Tether = this.Tether;
if (typeof define === 'function') {
define([],function() {
return root.Tether;
});
} else if (typeof exports === 'object') {
module.exports = root.Tether;
}
}(this));
return module.exports;
}).call(this);
// src/js/aui/internal/alignment.js
(typeof window === 'undefined' ? global : window).__8285f4e2b63df95621f0c3551adf7a51 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var _tether = __c4eb27dbd464e57ba19d70c0f1bcae57;
var _tether2 = _interopRequireDefault(_tether);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ATTR_ALIGNMENT = 'alignment';
var ATTR_ALIGNMENT_STATIC = 'alignment-static';
var ATTR_CONTAINER = 'alignment-container';
var CLASS_PREFIX_ALIGNMENT = 'aui-alignment';
var CLASS_PREFIX_SIDE = 'aui-alignment-side-';
var CLASS_PREFIX_SNAP = 'aui-alignment-snap-';
var DEFAULT_ATTACHMENT = 'right middle';
var attachmentMap = {
'top left': { el: 'bottom left', target: 'top left' },
'top center': { el: 'bottom center', target: 'top center' },
'top right': { el: 'bottom right', target: 'top right' },
'right top': { el: 'top left', target: 'top right' },
'right middle': { el: 'middle left', target: 'middle right' },
'right bottom': { el: 'bottom left', target: 'bottom right' },
'bottom left': { el: 'top left', target: 'bottom left' },
'bottom center': { el: 'top center', target: 'bottom center' },
'bottom right': { el: 'top right', target: 'bottom right' },
'left top': { el: 'top right', target: 'top left' },
'left middle': { el: 'middle right', target: 'middle left' },
'left bottom': { el: 'bottom right', target: 'bottom left' },
'submenu left': { el: 'top left', target: 'top right' },
'submenu right': { el: 'top right', target: 'top left' }
};
function hasClass(element, className) {
return (' ' + element.className + ' ').indexOf(' ' + className + ' ') !== -1;
}
function addAlignmentClasses(element, side, snap) {
var sideClass = CLASS_PREFIX_SIDE + side;
var snapClass = CLASS_PREFIX_SNAP + snap;
if (!hasClass(element, sideClass)) {
element.className += ' ' + sideClass;
}
if (!hasClass(element, snapClass)) {
element.className += ' ' + snapClass;
}
}
function getAttribute(element, name) {
return element.getAttribute(name) || element.getAttribute('data-aui-' + name);
}
function hasAttribute(element, name) {
return element.hasAttribute(name) || element.hasAttribute('data-aui-' + name);
}
function getAlignment(element) {
var _split = (getAttribute(element, ATTR_ALIGNMENT) || DEFAULT_ATTACHMENT).split(' '),
_split2 = _slicedToArray(_split, 2),
side = _split2[0],
snap = _split2[1];
return {
side: side,
snap: snap
};
}
function getContainer(element) {
var container = getAttribute(element, ATTR_CONTAINER) || window;
if (typeof container === 'string') {
container = document.querySelector(container);
}
return container;
}
function calculateBestAlignmentSnap(target, container) {
var snap = 'left';
if (!container || container === window || container === document) {
container = document.documentElement;
}
if (container && container.nodeType && container.nodeType === Node.ELEMENT_NODE) {
var containerBounds = container.getBoundingClientRect();
var targetBounds = target.getBoundingClientRect();
if (targetBounds.left > containerBounds.right / 2) {
snap = 'right';
}
}
return snap;
}
function getAttachment(side, snap) {
return attachmentMap[side + ' ' + snap] || attachmentMap[DEFAULT_ATTACHMENT];
}
function Alignment(element, target) {
var container = getContainer(element);
var alignment = getAlignment(element);
if (!alignment.snap || alignment.snap === 'auto') {
alignment.snap = calculateBestAlignmentSnap(target, container);
}
var attachment = getAttachment(alignment.side, alignment.snap);
var isStaticallyAligned = hasAttribute(element, ATTR_ALIGNMENT_STATIC);
var tether = new _tether2.default({
enabled: false,
element: element,
target: target,
attachment: attachment.el,
targetAttachment: attachment.target,
classPrefix: CLASS_PREFIX_ALIGNMENT,
constraints: [{
// Try and keep the element on page
to: container === window ? 'window' : container,
attachment: isStaticallyAligned === true ? 'none' : 'together'
}]
});
addAlignmentClasses(element, alignment.side, alignment.snap);
this._auiTether = tether;
}
Alignment.prototype = {
/**
* Stops aligning and cleans up.
*
* @returns {Alignment}
*/
destroy: function destroy() {
this._auiTether.destroy();
return this;
},
/**
* Disables alignment.
*
* @returns {Alignment}
*/
disable: function disable() {
this._auiTether.disable();
return this;
},
/**
* Enables alignment.
*
* @returns {Alignment}
*/
enable: function enable() {
this._auiTether.enable();
return this;
}
};
exports.default = Alignment;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/polyfills/custom-event.js
(typeof window === 'undefined' ? global : window).__a61ca8be187b18bfa5c93cf8ff929ee5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var CustomEvent = void 0;
(function () {
if (window.CustomEvent) {
// Some browsers don't support constructable custom events yet.
try {
var ce = new window.CustomEvent('name', {
bubbles: false,
cancelable: true,
detail: {
x: 'y'
}
});
ce.preventDefault();
if (ce.defaultPrevented !== true) {
throw new Error('Could not prevent default');
}
if (ce.type !== 'name') {
throw new Error('Could not set custom name');
}
if (ce.detail.x !== 'y') {
throw new Error('Could not set detail');
}
CustomEvent = window.CustomEvent;
return;
} catch (e) {
// polyfill it
}
}
/**
* @type CustomEvent
* @param {String} event - the name of the event.
* @param {Object} [params] - optional configuration of the custom event.
* @param {Boolean} [params.cancelable=false] - A boolean indicating whether the event is cancelable (i.e., can call preventDefault and set the defaultPrevented property).
* @param {Boolean} [params.bubbles=false] - A boolean indicating whether the event bubbles up through the DOM or not.
* @param {Boolean} [params.detail] - The data passed when initializing the event.
* @extends Event
* @returns {Event}
* @constructor
*/
CustomEvent = function CustomEvent(event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, !!params.bubbles, !!params.cancelable, params.detail);
var origPrevent = evt.preventDefault;
evt.preventDefault = function () {
origPrevent.call(this);
try {
Object.defineProperty(this, 'defaultPrevented', {
get: function get() {
return true;
}
});
} catch (e) {
this.defaultPrevented = true;
}
};
return evt;
};
CustomEvent.prototype = window.Event.prototype;
})();
exports.default = CustomEvent;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/blanket.js
(typeof window === 'undefined' ? global : window).__7ad39690422479cb34f1bf6ebb46656d = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.undim = exports.dim = undefined;
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var _animation = __0c2efa86d943ccf7adf9319649824b2a;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var overflowEl;
var _hiddenByAui = [];
/**
* Dims the screen using a blanket div
* @param useShim deprecated, it is calculated by dim() now
*/
function dim(useShim, zIndex) {
//if we're blanketing the page it means we want to hide the whatever is under the blanket from the screen readers as well
function hasAriaHidden(element) {
return element.getAttribute('aria-hidden') ? true : false;
}
function isAuiLayer(element) {
return element.className.match(/\baui-layer\b/) ? true : false;
}
Array.prototype.forEach.call(document.body.children, function (element) {
if (!hasAriaHidden(element) && !isAuiLayer(element)) {
element.setAttribute('aria-hidden', 'true');
_hiddenByAui.push(element);
}
});
if (!overflowEl) {
overflowEl = document.body;
}
if (useShim === true) {
useShimDeprecationLogger();
}
var isBlanketShowing = !!dim.$dim && dim.$dim.attr('aria-hidden') === 'false';
if (!!dim.$dim) {
dim.$dim.remove();
dim.$dim = null;
}
dim.$dim = (0, _jquery2.default)('<div></div>').addClass('aui-blanket');
dim.$dim.attr('tabindex', '0'); //required, or the last element's focusout event will go to the browser
dim.$dim.appendTo(document.body);
if (!isBlanketShowing) {
//recompute after insertion and before setting aria-hidden=false to ensure we calculate a difference in
//computed styles
(0, _animation.recomputeStyle)(dim.$dim);
dim.cachedOverflow = {
overflow: overflowEl.style.overflow,
overflowX: overflowEl.style.overflowX,
overflowY: overflowEl.style.overflowY
};
overflowEl.style.overflowX = 'hidden';
overflowEl.style.overflowY = 'hidden';
overflowEl.style.overflow = 'hidden';
}
dim.$dim.attr('aria-hidden', 'false');
if (zIndex) {
dim.$dim.css({ zIndex: zIndex });
}
return dim.$dim;
}
/**
* Removes semitransparent DIV
* @see dim
*/
function undim() {
_hiddenByAui.forEach(function (element) {
element.removeAttribute('aria-hidden');
});
_hiddenByAui = [];
if (dim.$dim) {
dim.$dim.attr('aria-hidden', 'true');
if (overflowEl) {
overflowEl.style.overflow = dim.cachedOverflow.overflow;
overflowEl.style.overflowX = dim.cachedOverflow.overflowX;
overflowEl.style.overflowY = dim.cachedOverflow.overflowY;
}
}
}
var useShimDeprecationLogger = (0, _deprecation.getMessageLogger)('useShim', {
extraInfo: 'useShim has no alternative as it is now calculated by dim().'
});
(0, _globalize2.default)('dim', dim);
(0, _globalize2.default)('undim', undim);
exports.dim = dim;
exports.undim = undim;
return module.exports;
}).call(this);
// src/js/aui/focus-manager.js
(typeof window === 'undefined' ? global : window).__f820769cec2d5b3d6663c4b8c0b065dc = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
(function initSelectors() {
/*
:tabbable and :focusable functions from jQuery UI v 1.10.4
renamed to :aui-tabbable and :aui-focusable to not clash with jquery-ui if it's included.
Code modified slightly to be compatible with jQuery < 1.8
.addBack() replaced with .andSelf()
$.curCSS() replaced with $.css()
*/
function visible(element) {
return _jquery2.default.css(element, 'visibility') === 'visible';
}
function focusable(element, isTabIndexNotNaN) {
var nodeName = element.nodeName.toLowerCase();
if (nodeName === 'aui-select') {
return true;
}
if (nodeName === 'area') {
var map = element.parentNode;
var mapName = map.name;
var imageMap = (0, _jquery2.default)('img[usemap=#' + mapName + ']').get();
if (!element.href || !mapName || map.nodeName.toLowerCase() !== 'map') {
return false;
}
return imageMap && visible(imageMap);
}
var isFormElement = /input|select|textarea|button|object/.test(nodeName);
var isAnchor = nodeName === 'a';
var isAnchorTabbable = element.href || isTabIndexNotNaN;
return (isFormElement ? !element.disabled : isAnchor ? isAnchorTabbable : isTabIndexNotNaN) && visible(element);
}
function tabbable(element) {
var tabIndex = _jquery2.default.attr(element, 'tabindex');
var isTabIndexNaN = isNaN(tabIndex);
var hasTabIndex = isTabIndexNaN || tabIndex >= 0;
return hasTabIndex && focusable(element, !isTabIndexNaN);
}
_jquery2.default.extend(_jquery2.default.expr[':'], {
'aui-focusable': function auiFocusable(element) {
return focusable(element, !isNaN(_jquery2.default.attr(element, 'tabindex')));
},
'aui-tabbable': tabbable
});
})();
var RESTORE_FOCUS_DATA_KEY = '_aui-focus-restore';
function FocusManager() {
this._focusTrapStack = [];
(0, _jquery2.default)(document).on('focusout', { focusTrapStack: this._focusTrapStack }, focusTrapHandler);
}
FocusManager.defaultFocusSelector = ':aui-tabbable';
FocusManager.prototype.enter = function ($el) {
// remember focus on old element
$el.data(RESTORE_FOCUS_DATA_KEY, (0, _jquery2.default)(document.activeElement));
// focus on new selector
if ($el.attr('data-aui-focus') !== 'false') {
var focusSelector = $el.attr('data-aui-focus-selector') || FocusManager.defaultFocusSelector;
var $focusEl = $el.is(focusSelector) ? $el : $el.find(focusSelector);
$focusEl.first().focus();
}
if (elementTrapsFocus($el)) {
trapFocus($el, this._focusTrapStack);
}
};
function trapFocus($el, focusTrapStack) {
focusTrapStack.push($el);
}
function untrapFocus(focusTrapStack) {
focusTrapStack.pop();
}
function elementTrapsFocus($el) {
return $el.is('.aui-dialog2');
}
FocusManager.prototype.exit = function ($el) {
if (elementTrapsFocus($el)) {
untrapFocus(this._focusTrapStack);
}
// AUI-1059: remove focus from the active element when dialog is hidden
var activeElement = document.activeElement;
if ($el[0] === activeElement || $el.has(activeElement).length) {
(0, _jquery2.default)(activeElement).blur();
}
var $restoreFocus = $el.data(RESTORE_FOCUS_DATA_KEY);
if ($restoreFocus && $restoreFocus.length) {
$el.removeData(RESTORE_FOCUS_DATA_KEY);
$restoreFocus.focus();
}
};
function focusTrapHandler(event) {
var focusTrapStack = event.data.focusTrapStack;
if (!event.relatedTarget) {
//Does not work in firefox, see https://bugzilla.mozilla.org/show_bug.cgi?id=687787
return;
}
if (focusTrapStack.length === 0) {
return;
}
var $focusTrapElement = focusTrapStack[focusTrapStack.length - 1];
var focusOrigin = event.target;
var focusTo = event.relatedTarget;
var $tabbableElements = $focusTrapElement.find(':aui-tabbable');
var $firstTabbableElement = (0, _jquery2.default)($tabbableElements.first());
var $lastTabbableElement = (0, _jquery2.default)($tabbableElements.last());
var elementContainsOrigin = $focusTrapElement.has(focusTo).length === 0;
var focusLeavingElement = elementContainsOrigin && focusTo;
if (focusLeavingElement) {
if ($firstTabbableElement.is(focusOrigin)) {
$lastTabbableElement.focus();
} else if ($lastTabbableElement.is(focusOrigin)) {
$firstTabbableElement.focus();
}
}
}
FocusManager.global = new FocusManager();
(0, _globalize2.default)('FocusManager', FocusManager);
exports.default = FocusManager;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/widget.js
(typeof window === 'undefined' ? global : window).__36c93ee282e03af34282ae4d42cc61f2 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (name, Ctor) {
var dataAttr = '_aui-widget-' + name;
return function (selectorOrOptions, maybeOptions) {
var selector;
var options;
if (_jquery2.default.isPlainObject(selectorOrOptions)) {
options = selectorOrOptions;
} else {
selector = selectorOrOptions;
options = maybeOptions;
}
var $el = selector && (0, _jquery2.default)(selector);
var widget;
if (!$el || !$el.data(dataAttr)) {
widget = new Ctor($el, options || {});
$el = widget.$el;
$el.data(dataAttr, widget);
} else {
widget = $el.data(dataAttr);
// options are discarded if $el has already been constructed
}
return widget;
};
};
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = exports['default'];
/**
* @param {string} name The name of the widget to use in any messaging.
* @param {function(new:{ $el: jQuery }, ?jQuery, ?Object)} Ctor
* A constructor which will only ever be called with "new". It must take a JQuery object as the first
* parameter, or generate one if not provided. The second parameter will be a configuration object.
* The returned object must have an $el property and a setOptions function.
* @constructor
*/
return module.exports;
}).call(this);
// src/js/aui/layer.js
(typeof window === 'undefined' ? global : window).__20d9b9968ab547182d27cd4991c9c125 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _blanket = __7ad39690422479cb34f1bf6ebb46656d;
var _focusManager = __f820769cec2d5b3d6663c4b8c0b065dc;
var _focusManager2 = _interopRequireDefault(_focusManager);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _keyCode = __d9798488305326dc80a738b4a3341d65;
var _keyCode2 = _interopRequireDefault(_keyCode);
var _widget = __36c93ee282e03af34282ae4d42cc61f2;
var _widget2 = _interopRequireDefault(_widget);
var _customEvent = __a61ca8be187b18bfa5c93cf8ff929ee5;
var _customEvent2 = _interopRequireDefault(_customEvent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var EVENT_PREFIX = '_aui-internal-layer-';
var GLOBAL_EVENT_PREFIX = '_aui-internal-layer-global-';
var LAYER_EVENT_PREFIX = 'aui-layer-';
var AUI_EVENT_PREFIX = 'aui-';
var $doc = (0, _jquery2.default)(document);
// AUI-3708 - Abstracted to reflect code implemented upstream.
function isTransitioning(el, prop) {
var transition = window.getComputedStyle(el).transitionProperty;
return transition ? transition.indexOf(prop) > -1 : false;
}
function onTransitionEnd(el, prop, func, once) {
function handler(e) {
if (prop !== e.propertyName) {
return;
}
func.call(el);
if (once) {
el.removeEventListener('transitionend', handler);
}
}
if (isTransitioning(el, prop)) {
el.addEventListener('transitionend', handler);
} else {
func.call(el);
}
}
function oneTransitionEnd(el, prop, func) {
onTransitionEnd(el, prop, func, true);
}
// end AUI-3708
function ariaHide($el) {
$el.attr('aria-hidden', 'true');
}
function ariaShow($el) {
$el.attr('aria-hidden', 'false');
}
/**
* @return {bool} Returns false if at least one of the event handlers called .preventDefault(). Returns true otherwise.
*/
function triggerEvent($el, deprecatedName, newNativeName) {
var e1 = _jquery2.default.Event(EVENT_PREFIX + deprecatedName);
var e2 = _jquery2.default.Event(GLOBAL_EVENT_PREFIX + deprecatedName);
// TODO: Remove this 'aui-layer-' prefixed event once it is no longer used by inline dialog and dialog2.
var nativeEvent = new _customEvent2.default(LAYER_EVENT_PREFIX + newNativeName, {
bubbles: true,
cancelable: true
});
var nativeEvent2 = new _customEvent2.default(AUI_EVENT_PREFIX + newNativeName, {
bubbles: true,
cancelable: true
});
$el.trigger(e1);
$el.trigger(e2, [$el]);
$el[0].dispatchEvent(nativeEvent);
$el[0].dispatchEvent(nativeEvent2);
return !e1.isDefaultPrevented() && !e2.isDefaultPrevented() && !nativeEvent.defaultPrevented && !nativeEvent2.defaultPrevented;
}
function Layer(selector) {
this.$el = (0, _jquery2.default)(selector || '<div class="aui-layer" aria-hidden="true"></div>');
this.$el.addClass('aui-layer');
}
Layer.prototype = {
/**
* Returns the layer below the current layer if it exists.
*
* @returns {jQuery | undefined}
*/
below: function below() {
return LayerManager.global.item(LayerManager.global.indexOf(this.$el) - 1);
},
/**
* Returns the layer above the current layer if it exists.
*
* @returns {jQuery | undefined}
*/
above: function above() {
return LayerManager.global.item(LayerManager.global.indexOf(this.$el) + 1);
},
/**
* Sets the width and height of the layer.
*
* @param {Integer} width The width to set.
* @param {Integer} height The height to set.
*
* @returns {Layer}
*/
changeSize: function changeSize(width, height) {
this.$el.css('width', width);
this.$el.css('height', height === 'content' ? '' : height);
return this;
},
/**
* Binds a layer event.
*
* @param {String} event The event name to listen to.
* @param {Function} fn The event handler.
*
* @returns {Layer}
*/
on: function on(event, fn) {
this.$el.on(EVENT_PREFIX + event, fn);
return this;
},
/**
* Unbinds a layer event.
*
* @param {String} event The event name to unbind=.
* @param {Function} fn Optional. The event handler.
*
* @returns {Layer}
*/
off: function off(event, fn) {
this.$el.off(EVENT_PREFIX + event, fn);
return this;
},
/**
* Shows the layer.
*
* @returns {Layer}
*/
show: function show() {
if (this.isVisible()) {
ariaShow(this.$el);
return this;
}
if (!triggerEvent(this.$el, 'beforeShow', 'show')) {
return this;
}
// AUI-3708
// Ensures that the display property is removed if it's been added
// during hiding.
if (this.$el.css('display') === 'none') {
this.$el.css('display', '');
}
LayerManager.global.push(this.$el);
return this;
},
/**
* Hides the layer.
*
* @returns {Layer}
*/
hide: function hide() {
if (!this.isVisible()) {
ariaHide(this.$el);
return this;
}
if (!triggerEvent(this.$el, 'beforeHide', 'hide')) {
return this;
}
// AUI-3708
var thisLayer = this;
oneTransitionEnd(this.$el.get(0), 'opacity', function () {
if (!thisLayer.isVisible()) {
this.style.display = 'none';
}
});
LayerManager.global.popUntil(this.$el);
return this;
},
/**
* Checks to see if the layer is visible.
*
* @returns {Boolean}
*/
isVisible: function isVisible() {
return this.$el.attr('aria-hidden') === 'false';
},
/**
* Removes the layer and cleans up internal state.
*
* @returns {undefined}
*/
remove: function remove() {
this.hide();
this.$el.remove();
this.$el = null;
},
/**
* Returns whether or not the layer is blanketed.
*
* @returns {Boolean}
*/
isBlanketed: function isBlanketed() {
return this.$el.attr('data-aui-blanketed') === 'true';
},
/**
* Returns whether or not the layer is persistent.
*
* @returns {Boolean}
*/
isPersistent: function isPersistent() {
var modal = this.$el.attr('modal') || this.$el.attr('data-aui-modal');
var isPersistent = this.$el[0].hasAttribute('persistent');
return modal === 'true' || isPersistent;
},
_hideLayer: function _hideLayer(triggerBeforeEvents) {
if (this.isPersistent() || this.isBlanketed()) {
_focusManager2.default.global.exit(this.$el);
}
if (triggerBeforeEvents) {
triggerEvent(this.$el, 'beforeHide', 'hide');
}
this.$el.attr('aria-hidden', 'true');
this.$el.css('z-index', this.$el.data('_aui-layer-cached-z-index') || '');
this.$el.data('_aui-layer-cached-z-index', '');
this.$el.trigger(EVENT_PREFIX + 'hide');
this.$el.trigger(GLOBAL_EVENT_PREFIX + 'hide', [this.$el]);
},
_showLayer: function _showLayer(zIndex) {
if (!this.$el.parent().is('body')) {
this.$el.appendTo(document.body);
}
this.$el.data('_aui-layer-cached-z-index', this.$el.css('z-index'));
this.$el.css('z-index', zIndex);
this.$el.attr('aria-hidden', 'false');
if (this.isPersistent() || this.isBlanketed()) {
_focusManager2.default.global.enter(this.$el);
}
this.$el.trigger(EVENT_PREFIX + 'show');
this.$el.trigger(GLOBAL_EVENT_PREFIX + 'show', [this.$el]);
}
};
var createLayer = (0, _widget2.default)('layer', Layer);
createLayer.on = function (eventName, selector, fn) {
$doc.on(GLOBAL_EVENT_PREFIX + eventName, selector, fn);
return this;
};
createLayer.off = function (eventName, selector, fn) {
$doc.off(GLOBAL_EVENT_PREFIX + eventName, selector, fn);
return this;
};
// Layer Manager
// -------------
/**
* Manages layers.
*
* There is a single global layer manager.
* Additional instances can be created however this should generally only be used in tests.
*
* Layers are added by the push($el) method. Layers are removed by the
* popUntil($el) method.
*
* popUntil's contract is that it pops all layers above & including the given
* layer. This is used to support popping multiple layers.
* Say we were showing a dropdown inside an inline dialog inside a dialog - we
* have a stack of dialog layer, inline dialog layer, then dropdown layer. Calling
* popUntil(dialog.$el) would hide all layers above & including the dialog.
*/
function getTrigger($layer) {
return (0, _jquery2.default)('[aria-controls="' + $layer.attr('id') + '"]');
}
function hasTrigger($layer) {
return getTrigger($layer).length > 0;
}
function topIndexWhere(layerArr, fn) {
var i = layerArr.length;
while (i--) {
if (fn(layerArr[i])) {
return i;
}
}
return -1;
}
function layerIndex(layerArr, $el) {
return topIndexWhere(layerArr, function ($layer) {
return $layer[0] === $el[0];
});
}
function topBlanketedIndex(layerArr) {
return topIndexWhere(layerArr, function ($layer) {
return createLayer($layer).isBlanketed();
});
}
function nextZIndex(layerArr) {
var _nextZIndex;
if (layerArr.length) {
var $topEl = layerArr[layerArr.length - 1];
var zIndex = parseInt($topEl.css('z-index'), 10);
_nextZIndex = (isNaN(zIndex) ? 0 : zIndex) + 100;
} else {
_nextZIndex = 0;
}
return Math.max(3000, _nextZIndex);
}
function updateBlanket(stack, oldBlanketIndex) {
var newTopBlanketedIndex = topBlanketedIndex(stack);
if (oldBlanketIndex !== newTopBlanketedIndex) {
if (newTopBlanketedIndex > -1) {
(0, _blanket.dim)(false, stack[newTopBlanketedIndex].css('z-index') - 20);
} else {
(0, _blanket.undim)();
}
}
}
function popLayers(stack, stopIndex, forceClosePersistent) {
if (stopIndex < 0) {
return;
}
for (var a = stack.length - 1; a >= stopIndex; a--) {
var $layer = stack[a];
var layer = createLayer($layer);
if (forceClosePersistent || !layer.isPersistent()) {
layer._hideLayer(true);
stack.splice(a, 1);
}
}
}
function getParentLayer($childLayer) {
var $layerTrigger = getTrigger($childLayer);
if ($layerTrigger.length > 0) {
return $layerTrigger.closest('.aui-layer');
}
}
function LayerManager() {
this._stack = [];
}
LayerManager.prototype = {
/**
* Pushes a layer onto the stack. The same element cannot be opened as a layer multiple times - if the given
* element is already an open layer, this method throws an exception.
*
* @param {HTMLElement | String | jQuery} element The element to push onto the stack.
*
* @returns {LayerManager}
*/
push: function push(element) {
var $el = element instanceof _jquery2.default ? element : (0, _jquery2.default)(element);
if (layerIndex(this._stack, $el) >= 0) {
throw new Error('The given element is already an active layer.');
}
this.popLayersBeside($el);
var layer = createLayer($el);
var zIndex = nextZIndex(this._stack);
layer._showLayer(zIndex);
if (layer.isBlanketed()) {
(0, _blanket.dim)(false, zIndex - 20);
}
this._stack.push($el);
return this;
},
popLayersBeside: function popLayersBeside(element) {
var $layer = element instanceof _jquery2.default ? element : (0, _jquery2.default)(element);
if (!hasTrigger($layer)) {
// We can't find this layer's trigger, we will pop all non-persistent until a blanket or the document
var blanketedIndex = topBlanketedIndex(this._stack);
popLayers(this._stack, ++blanketedIndex, false);
return;
}
var $parentLayer = getParentLayer($layer);
if ($parentLayer) {
var parentIndex = this.indexOf($parentLayer);
popLayers(this._stack, ++parentIndex, false);
} else {
popLayers(this._stack, 0, false);
}
},
/**
* Returns the index of the specified layer in the layer stack.
*
* @param {HTMLElement | String | jQuery} element The element to find in the stack.
*
* @returns {Number} the (zero-based) index of the element, or -1 if not in the stack.
*/
indexOf: function indexOf(element) {
return layerIndex(this._stack, (0, _jquery2.default)(element));
},
/**
* Returns the item at the particular index or false.
*
* @param {Number} index The index of the element to get.
*
* @returns {jQuery | Boolean}
*/
item: function item(index) {
return this._stack[index];
},
/**
* Hides all layers in the stack.
*
* @returns {LayerManager}
*/
hideAll: function hideAll() {
this._stack.reverse().forEach(function (element) {
var layer = createLayer(element);
if (layer.isBlanketed() || layer.isPersistent()) {
return;
}
layer.hide();
});
return this;
},
/**
* Gets the previous layer below the given layer, which is non modal and non persistent. If it finds a blanketed layer on the way
* it returns it regardless if it is modal or not
*
* @param {HTMLElement | String | jQuery} element layer to start the search from.
*
* @returns {jQuery | null} the next matching layer or null if none found.
*/
getNextLowerNonPersistentOrBlanketedLayer: function getNextLowerNonPersistentOrBlanketedLayer(element) {
var $el = element instanceof _jquery2.default ? element : (0, _jquery2.default)(element);
var index = layerIndex(this._stack, $el);
if (index < 0) {
return null;
}
var $nextEl;
index--;
while (index >= 0) {
$nextEl = this._stack[index];
var layer = createLayer($nextEl);
if (!layer.isPersistent() || layer.isBlanketed()) {
return $nextEl;
}
index--;
}
return null;
},
/**
* Gets the next layer which is neither modal or blanketed, from the given layer.
*
* @param {HTMLElement | String | jQuery} element layer to start the search from.
*
* @returns {jQuery | null} the next non modal non blanketed layer or null if none found.
*/
getNextHigherNonPeristentAndNonBlanketedLayer: function getNextHigherNonPeristentAndNonBlanketedLayer(element) {
var $el = element instanceof _jquery2.default ? element : (0, _jquery2.default)(element);
var index = layerIndex(this._stack, $el);
if (index < 0) {
return null;
}
var $nextEl;
index++;
while (index < this._stack.length) {
$nextEl = this._stack[index];
var layer = createLayer($nextEl);
if (!(layer.isPersistent() || layer.isBlanketed())) {
return $nextEl;
}
index++;
}
return null;
},
/**
* Removes all non-modal layers above & including the given element. If the given element is not an active layer, this method
* is a no-op. The given element will be removed regardless of whether or not it is modal.
*
* @param {HTMLElement | String | jQuery} element layer to pop.
*
* @returns {jQuery} The last layer that was popped, or null if no layer matching the given $el was found.
*/
popUntil: function popUntil(element) {
var $el = element instanceof _jquery2.default ? element : (0, _jquery2.default)(element);
var index = layerIndex(this._stack, $el);
if (index === -1) {
return null;
}
var oldTopBlanketedIndex = topBlanketedIndex(this._stack);
// Removes all layers above the current one.
popLayers(this._stack, index + 1, createLayer($el).isBlanketed());
// Removes the current layer.
createLayer($el)._hideLayer();
this._stack.splice(index, 1);
updateBlanket(this._stack, oldTopBlanketedIndex);
return $el;
},
/**
* Gets the top layer, if it exists.
*
* @returns The layer on top of the stack, if it exists, otherwise null.
*/
getTopLayer: function getTopLayer() {
if (!this._stack.length) {
return null;
}
var $topLayer = this._stack[this._stack.length - 1];
return $topLayer;
},
/**
* Pops the top layer, if it exists and it is non modal and non persistent.
*
* @returns The layer that was popped, if it was popped.
*/
popTopIfNonPersistent: function popTopIfNonPersistent() {
var $topLayer = this.getTopLayer();
var layer = createLayer($topLayer);
if (!$topLayer || layer.isPersistent()) {
return null;
}
return this.popUntil($topLayer);
},
/**
* Pops all layers above and including the top blanketed layer. If layers exist but none are blanketed, this method
* does nothing.
*
* @returns The blanketed layer that was popped, if it exists, otherwise null.
*/
popUntilTopBlanketed: function popUntilTopBlanketed() {
var i = topBlanketedIndex(this._stack);
if (i < 0) {
return null;
}
var $topBlanketedLayer = this._stack[i];
var layer = createLayer($topBlanketedLayer);
if (layer.isPersistent()) {
// We can't pop the blanketed layer, only the things ontop
var $next = this.getNextHigherNonPeristentAndNonBlanketedLayer($topBlanketedLayer);
if ($next) {
var stopIndex = layerIndex(this._stack, $next);
popLayers(this._stack, stopIndex, true);
return $next;
}
return null;
}
popLayers(this._stack, i, true);
updateBlanket(this._stack, i);
return $topBlanketedLayer;
},
/**
* Pops all layers above and including the top persistent layer. If layers exist but none are persistent, this method
* does nothing.
*/
popUntilTopPersistent: function popUntilTopPersistent() {
var $toPop = LayerManager.global.getTopLayer();
if (!$toPop) {
return;
}
var stopIndex;
var oldTopBlanketedIndex = topBlanketedIndex(this._stack);
var toPop = createLayer($toPop);
if (toPop.isPersistent()) {
if (toPop.isBlanketed()) {
return;
} else {
// Get the closest non modal layer below, stop at the first blanketed layer though, we don't want to pop below that
$toPop = LayerManager.global.getNextLowerNonPersistentOrBlanketedLayer($toPop);
toPop = createLayer($toPop);
if ($toPop && !toPop.isPersistent()) {
stopIndex = layerIndex(this._stack, $toPop);
popLayers(this._stack, stopIndex, true);
updateBlanket(this._stack, oldTopBlanketedIndex);
} else {
// Here we have a blanketed persistent layer
return;
}
}
} else {
stopIndex = layerIndex(this._stack, $toPop);
popLayers(this._stack, stopIndex, true);
updateBlanket(this._stack, oldTopBlanketedIndex);
}
}
};
// LayerManager.global
// -------------------
function initCloseLayerOnEscPress() {
$doc.on('keydown', function (e) {
if (e.keyCode === _keyCode2.default.ESCAPE) {
LayerManager.global.popUntilTopPersistent();
e.preventDefault();
}
});
}
function initCloseLayerOnBlanketClick() {
$doc.on('click', '.aui-blanket', function (e) {
if (LayerManager.global.popUntilTopBlanketed()) {
e.preventDefault();
}
});
}
function hasLayer($trigger) {
if (!$trigger.length) {
return false;
}
var layer = document.getElementById($trigger.attr('aria-controls'));
return LayerManager.global.indexOf(layer) > -1;
}
// If it's a click on a trigger, do nothing.
// If it's a click on a layer, close all layers above.
// Otherwise, close all layers.
function initCloseLayerOnOuterClick() {
$doc.on('click', function (e) {
var $target = (0, _jquery2.default)(e.target);
if ($target.closest('.aui-blanket').length) {
return;
}
var $trigger = $target.closest('[aria-controls]');
var $layer = $target.closest('.aui-layer');
if (!$layer.length && !hasLayer($trigger)) {
LayerManager.global.hideAll();
return;
}
// Triggers take precedence over layers
if (hasLayer($trigger)) {
return;
}
if ($layer.length) {
// We dont want to explicitly call close on a modal dialog if it happens to be next.
// All blanketed layers should be below us, as otherwise the blanket should have caught the click.
// We make sure we dont close a blanketed one explicitly as a hack, this is to fix the problem arising
// from dialog2 triggers inside dialog2's having no aria controls, where the dialog2 that was just
// opened would be closed instantly
var $next = LayerManager.global.getNextHigherNonPeristentAndNonBlanketedLayer($layer);
if ($next) {
createLayer($next).hide();
}
}
});
}
initCloseLayerOnEscPress();
initCloseLayerOnBlanketClick();
initCloseLayerOnOuterClick();
LayerManager.global = new LayerManager();
createLayer.Manager = LayerManager;
(0, _globalize2.default)('layer', createLayer);
exports.default = createLayer;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/state.js
(typeof window === 'undefined' ? global : window).__ac20873dc2158ed13da59491630092c2 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
function state(element) {
return {
/**
* sets an internal state on a component element
* @param element the element to which the state will be added
* @param stateName the name of the state
* @param stateValue the value that the state will be changed to
*/
set: function set(stateName, stateValue) {
if (element._state === undefined) {
element._state = {};
}
element._state[stateName] = stateValue;
},
/**
* gets an internal state on a component element
* @param element the element to which the state will be added
* @param stateName the name of the state
*/
get: function get(stateName) {
if (element._state) {
return element._state[stateName];
}
}
};
}
exports.default = state;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/dropdown2.js
(typeof window === 'undefined' ? global : window).__3937b556d81f7c0f6d92a2176855406e = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
__ed74109c4e727b6405515053222f381b;
__98b7c9cf3949a197ac63f13f8686abea;
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _skatejsTemplateHtml = __23921246870221a1cfaf9dc62cd3cb19;
var _skatejsTemplateHtml2 = _interopRequireDefault(_skatejsTemplateHtml);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var deprecate = _interopRequireWildcard(_deprecation);
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
var _debounce = __8cd9ff0a19109fb463ce91f349330abb;
var _browser = __06d3cef33ca9f6a1f5da6f0cc5a2aa58;
var _alignment = __8285f4e2b63df95621f0c3551adf7a51;
var _alignment2 = _interopRequireDefault(_alignment);
var _customEvent = __a61ca8be187b18bfa5c93cf8ff929ee5;
var _customEvent2 = _interopRequireDefault(_customEvent);
var _keyCode = __d9798488305326dc80a738b4a3341d65;
var _keyCode2 = _interopRequireDefault(_keyCode);
var _layer = __20d9b9968ab547182d27cd4991c9c125;
var _layer2 = _interopRequireDefault(_layer);
var _state = __ac20873dc2158ed13da59491630092c2;
var _state2 = _interopRequireDefault(_state);
var _skate = __f3781475eb0bf3a02085f171842f7c4c;
var _skate2 = _interopRequireDefault(_skate);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function isChecked(el) {
return (0, _jquery2.default)(el).is('.checked, .aui-dropdown2-checked, [aria-checked="true"]');
}
function getTrigger(control) {
return control._triggeringElement || document.querySelector('[aria-controls="' + control.id + '"]');
}
function doIfTrigger(triggerable, callback) {
var trigger = getTrigger(triggerable);
if (trigger) {
callback(trigger);
}
}
function setDropdownTriggerActiveState(trigger, isActive) {
var $trigger = (0, _jquery2.default)(trigger);
if (isActive) {
$trigger.attr('aria-expanded', 'true');
$trigger.addClass('active aui-dropdown2-active');
} else {
$trigger.attr('aria-expanded', 'false');
$trigger.removeClass('active aui-dropdown2-active');
}
}
// LOADING STATES
var UNLOADED = 'unloaded';
var LOADING = 'loading';
var ERROR = 'error';
var SUCCESS = 'success';
// ASYNC DROPDOWN FUNCTIONS
function makeAsyncDropdownContents(json) {
var dropdownContents = json.map(function makeSection(sectionData) {
var sectionItemsHtml = sectionData.items.map(function makeSectionItem(itemData) {
function makeBooleanAttribute(attr) {
return itemData[attr] ? attr + ' ="true"' : '';
}
function makeAttribute(attr) {
return itemData[attr] ? attr + '="' + itemData[attr] + '"' : '';
}
var tagName = 'aui-item-' + itemData.type;
var itemHtml = '\n <' + tagName + ' ' + makeAttribute('for') + ' ' + makeAttribute('href') + ' ' + makeBooleanAttribute('interactive') + '\n ' + makeBooleanAttribute('checked') + ' ' + makeBooleanAttribute('disabled') + ' ' + makeBooleanAttribute('hidden') + '>\n ' + itemData.content + '\n </' + tagName + '>';
return itemHtml;
}).join('');
var sectionAttributes = sectionData.label ? 'label="' + sectionData.label + '"' : '';
var sectionHtml = '\n <aui-section ' + sectionAttributes + '>\n ' + sectionItemsHtml + '\n </aui-section>';
return sectionHtml;
}).join('\n');
return dropdownContents;
}
function setDropdownContents(dropdown, json) {
(0, _state2.default)(dropdown).set('loading-state', SUCCESS);
_skatejsTemplateHtml2.default.wrap(dropdown).innerHTML = makeAsyncDropdownContents(json);
_skate2.default.init(dropdown);
}
function setDropdownErrorState(dropdown) {
(0, _state2.default)(dropdown).set('loading-state', ERROR);
(0, _state2.default)(dropdown).set('hasErrorBeenShown', dropdown.isVisible());
_skatejsTemplateHtml2.default.wrap(dropdown).innerHTML = '\n <div class="aui-message aui-message-error aui-dropdown-error">\n <p>' + AJS.I18n.getText('aui.dropdown.async.error') + '</p>\n </div>\n ';
}
function setDropdownLoadingState(dropdown) {
(0, _state2.default)(dropdown).set('loading-state', LOADING);
(0, _state2.default)(dropdown).set('hasErrorBeenShown', false);
doIfTrigger(dropdown, function (trigger) {
trigger.setAttribute('aria-busy', 'true');
});
_skatejsTemplateHtml2.default.wrap(dropdown).innerHTML = '\n <div class="aui-dropdown-loading">\n <span class="spinner"></span> ' + AJS.I18n.getText('aui.dropdown.async.loading') + '\n </div>\n ';
(0, _jquery2.default)(dropdown).find('.spinner').spin();
}
function setDropdownLoaded(dropdown) {
doIfTrigger(dropdown, function (trigger) {
trigger.setAttribute('aria-busy', 'false');
});
}
function loadContentsIfAsync(dropdown) {
if (!dropdown.src || (0, _state2.default)(dropdown).get('loading-state') === LOADING) {
return;
}
setDropdownLoadingState(dropdown);
_jquery2.default.ajax(dropdown.src).done(function (json, status, xhr) {
var isValidStatus = xhr.status === 200;
if (isValidStatus) {
setDropdownContents(dropdown, json);
} else {
setDropdownErrorState(dropdown);
}
}).fail(function () {
setDropdownErrorState(dropdown);
}).always(function () {
setDropdownLoaded(dropdown);
});
}
function loadContentWhenMouseEnterTrigger(dropdown) {
var isDropdownUnloaded = (0, _state2.default)(dropdown).get('loading-state') === UNLOADED;
var hasCurrentErrorBeenShown = (0, _state2.default)(dropdown).get('hasErrorBeenShown');
if (isDropdownUnloaded || hasCurrentErrorBeenShown && !dropdown.isVisible()) {
loadContentsIfAsync(dropdown);
}
}
function loadContentWhenMenuShown(dropdown) {
var isDropdownUnloaded = (0, _state2.default)(dropdown).get('loading-state') === UNLOADED;
var hasCurrentErrorBeenShown = (0, _state2.default)(dropdown).get('hasErrorBeenShown');
if (isDropdownUnloaded || hasCurrentErrorBeenShown) {
loadContentsIfAsync(dropdown);
}
if ((0, _state2.default)(dropdown).get('loading-state') === ERROR) {
(0, _state2.default)(dropdown).set('hasErrorBeenShown', true);
}
}
// The dropdown's trigger
// ----------------------
function triggerCreated(trigger) {
var dropdownID = trigger.getAttribute('aria-controls');
if (!dropdownID) {
dropdownID = trigger.getAttribute('aria-owns');
if (!dropdownID) {
logger.error('Dropdown triggers need either a "aria-owns" or "aria-controls" attribute');
} else {
trigger.removeAttribute('aria-owns');
trigger.setAttribute('aria-controls', dropdownID);
}
}
trigger.setAttribute('aria-haspopup', true);
trigger.setAttribute('aria-expanded', false);
var shouldSetHref = trigger.nodeName === 'A' && !trigger.href;
if (shouldSetHref) {
trigger.setAttribute('href', '#' + dropdownID);
}
function handleIt(e) {
e.preventDefault();
if (!trigger.isEnabled()) {
return;
}
var dropdown = document.getElementById(dropdownID);
// AUI-4271 - Maintains legacy integration with parent elements.
var $trigger = (0, _jquery2.default)(trigger);
if ($trigger.parent().hasClass('aui-buttons')) {
dropdown.classList.add('aui-dropdown2-in-buttons');
}
if ($trigger.parents().hasClass('aui-header')) {
dropdown.classList.add('aui-dropdown2-in-header');
}
dropdown.toggle(e);
dropdown.isSubmenu = trigger.hasSubmenu();
return dropdown;
}
function handleMouseEnter(e) {
e.preventDefault();
if (!trigger.isEnabled()) {
return;
}
var dropdown = document.getElementById(dropdownID);
loadContentWhenMouseEnterTrigger(dropdown);
if (trigger.hasSubmenu()) {
dropdown.show(e);
dropdown.isSubmenu = trigger.hasSubmenu();
}
return dropdown;
}
function handleKeydown(e) {
var normalInvoke = e.keyCode === _keyCode2.default.ENTER || e.keyCode === _keyCode2.default.SPACE;
var submenuInvoke = e.keyCode === _keyCode2.default.RIGHT && trigger.hasSubmenu();
var rootMenuInvoke = (e.keyCode === _keyCode2.default.UP || e.keyCode === _keyCode2.default.DOWN) && !trigger.hasSubmenu();
if (normalInvoke || submenuInvoke || rootMenuInvoke) {
var dropdown = handleIt(e);
if (dropdown) {
dropdown.focusItem(0);
}
}
}
(0, _jquery2.default)(trigger).on('aui-button-invoke', handleIt).on('click', handleIt).on('keydown', handleKeydown).on('mouseenter', handleMouseEnter);
}
var triggerPrototype = {
disable: function disable() {
this.setAttribute('aria-disabled', 'true');
},
enable: function enable() {
this.setAttribute('aria-disabled', 'false');
},
isEnabled: function isEnabled() {
return this.getAttribute('aria-disabled') !== 'true';
},
hasSubmenu: function hasSubmenu() {
var triggerClasses = (this.className || '').split(/\s+/);
return triggerClasses.indexOf('aui-dropdown2-sub-trigger') !== -1;
}
};
(0, _skate2.default)('aui-dropdown2-trigger', {
type: _skate2.default.type.CLASSNAME,
created: triggerCreated,
prototype: triggerPrototype
});
//To remove at a later date. Some dropdown triggers initialise lazily, so we need to listen for mousedown
//and synchronously init before the click event is fired.
//TODO: delete in AUI 8.0.0, see AUI-2868
function bindLazyTriggerInitialisation() {
(0, _jquery2.default)(document).on('mousedown', '.aui-dropdown2-trigger', function () {
var isElementSkated = this.hasAttribute('resolved');
if (!isElementSkated) {
_skate2.default.init(this);
var lazyDeprecate = deprecate.getMessageLogger('Dropdown2 lazy initialisation', {
removeInVersion: '8.0.0',
alternativeName: 'initialisation on DOM insertion',
sinceVersion: '5.8.0',
extraInfo: 'Dropdown2 triggers should have all necessary attributes on DOM insertion',
deprecationType: 'JS'
});
lazyDeprecate();
}
});
}
bindLazyTriggerInitialisation();
(0, _skate2.default)('aui-dropdown2-sub-trigger', {
type: _skate2.default.type.CLASSNAME,
created: function created(trigger) {
trigger.className += ' aui-dropdown2-trigger';
_skate2.default.init(trigger);
}
});
// Dropdown trigger groups
// -----------------------
(0, _jquery2.default)(document).on('mouseenter', '.aui-dropdown2-trigger-group a, .aui-dropdown2-trigger-group button', function (e) {
var $item = (0, _jquery2.default)(e.currentTarget);
if ($item.is('.aui-dropdown2-active')) {
return; // No point doing anything if we're hovering over the already-active item trigger.
}
if ($item.closest('.aui-dropdown2').length) {
return; // We don't want to deal with dropdown items, just the potential triggers in the group.
}
var $triggerGroup = $item.closest('.aui-dropdown2-trigger-group');
var $groupActiveTrigger = $triggerGroup.find('.aui-dropdown2-active');
if ($groupActiveTrigger.length && $item.is('.aui-dropdown2-trigger')) {
$groupActiveTrigger.blur(); // Remove focus from the previously opened menu.
$item.trigger('aui-button-invoke'); // Open this trigger's menu.
e.preventDefault();
}
var $groupFocusedTrigger = $triggerGroup.find(':focus');
if ($groupFocusedTrigger.length && $item.is('.aui-dropdown2-trigger')) {
$groupFocusedTrigger.blur();
}
});
// Dropdown items
// --------------
function getDropdownItems(dropdown, filter) {
return (0, _jquery2.default)(dropdown).find([
// Legacy markup.
'> ul > li', '> .aui-dropdown2-section > ul > li',
// Accessible markup.
'> div[role] > .aui-dropdown2-section > div[role="group"] > ul[role] > li[role]',
// Web component.
'aui-item-link', 'aui-item-checkbox', 'aui-item-radio'].join(', ')).filter(filter).children('a, button, [role="checkbox"], [role="menuitemcheckbox"], [role="radio"], [role="menuitemradio"]');
}
function getAllDropdownItems(dropdown) {
return getDropdownItems(dropdown, function () {
return true;
});
}
function getVisibleDropdownItems(dropdown) {
return getDropdownItems(dropdown, function () {
return this.className.indexOf('hidden') === -1 && !this.hasAttribute('hidden');
});
}
function amendDropdownItem(item) {
var $item = (0, _jquery2.default)(item);
$item.attr('tabindex', '-1');
/**
* Honouring the documentation.
* @link https://docs.atlassian.com/aui/latest/docs/dropdown2.html
*/
if ($item.hasClass('aui-dropdown2-disabled') || $item.parent().hasClass('aui-dropdown2-hidden')) {
$item.attr('aria-disabled', true);
}
}
function amendDropdownContent(dropdown) {
// Add assistive semantics to each dropdown item
getAllDropdownItems(dropdown).each(function () {
amendDropdownItem(this);
});
}
/**
* Honours behaviour for code written using only the legacy class names.
* To maintain old behaviour (i.e., remove the 'hidden' class and the item will become un-hidden)
* whilst allowing our code to only depend on the new classes, we need to
* keep the state of the DOM in sync with legacy classes.
*
* Calling this function will add the new namespaced classes to elements with legacy names.
* @returns {Function} a function to remove the new namespaced classes, only from the elements they were added to.
*/
function migrateAndSyncLegacyClassNames(dropdown) {
var $dropdown = (0, _jquery2.default)(dropdown);
// Migrate away from legacy class names
var $hiddens = $dropdown.find('.hidden').addClass('aui-dropdown2-hidden');
var $disableds = $dropdown.find('.disabled').addClass('aui-dropdown2-disabled');
var $interactives = $dropdown.find('.interactive').addClass('aui-dropdown2-interactive');
return function revertToOriginalMarkup() {
$hiddens.removeClass('aui-dropdown2-hidden');
$disableds.removeClass('aui-dropdown2-disabled');
$interactives.removeClass('aui-dropdown2-interactive');
};
}
// The Dropdown itself
// -------------------
function setLayerAlignment(dropdown, trigger) {
var hasSubmenu = trigger && trigger.hasSubmenu && trigger.hasSubmenu();
var hasSubmenuAlignment = dropdown.getAttribute('data-aui-alignment') === 'submenu auto';
if (!hasSubmenu && hasSubmenuAlignment) {
restorePreviousAlignment(dropdown);
}
var hasAnyAlignment = dropdown.hasAttribute('data-aui-alignment');
if (hasSubmenu && !hasSubmenuAlignment) {
saveCurrentAlignment(dropdown);
dropdown.setAttribute('data-aui-alignment', 'submenu auto');
dropdown.setAttribute('data-aui-alignment-static', true);
} else if (!hasAnyAlignment) {
dropdown.setAttribute('data-aui-alignment', 'bottom auto');
dropdown.setAttribute('data-aui-alignment-static', true);
}
if (dropdown._auiAlignment) {
dropdown._auiAlignment.destroy();
}
dropdown._auiAlignment = new _alignment2.default(dropdown, trigger);
dropdown._auiAlignment.enable();
}
function saveCurrentAlignment(dropdown) {
var $dropdown = (0, _jquery2.default)(dropdown);
if (dropdown.hasAttribute('data-aui-alignment')) {
$dropdown.data('previous-data-aui-alignment', dropdown.getAttribute('data-aui-alignment'));
}
$dropdown.data('had-data-aui-alignment-static', dropdown.hasAttribute('data-aui-alignment-static'));
}
function restorePreviousAlignment(dropdown) {
var $dropdown = (0, _jquery2.default)(dropdown);
var previousAlignment = $dropdown.data('previous-data-aui-alignment');
if (previousAlignment) {
dropdown.setAttribute('data-aui-alignment', previousAlignment);
} else {
dropdown.removeAttribute('data-aui-alignment');
}
$dropdown.removeData('previous-data-aui-alignment');
if (!$dropdown.data('had-data-aui-alignment-static')) {
dropdown.removeAttribute('data-aui-alignment-static');
}
$dropdown.removeData('had-data-aui-alignment-static');
}
function getDropdownHideLocation(dropdown, trigger) {
var possibleHome = trigger.getAttribute('data-dropdown2-hide-location');
return document.getElementById(possibleHome) || dropdown.parentNode;
}
var keyboardClose = false;
function keyboardCloseDetected() {
keyboardClose = true;
}
function wasProbablyClosedViaKeyboard() {
var result = keyboardClose === true;
keyboardClose = false;
return result;
}
function bindDropdownBehaviourToLayer(dropdown) {
(0, _layer2.default)(dropdown);
dropdown.addEventListener('aui-layer-show', function () {
(0, _jquery2.default)(dropdown).trigger('aui-dropdown2-show');
dropdown._syncClasses = migrateAndSyncLegacyClassNames(dropdown);
amendDropdownContent(this);
doIfTrigger(dropdown, function (trigger) {
setDropdownTriggerActiveState(trigger, true);
dropdown._returnTo = getDropdownHideLocation(dropdown, trigger);
});
});
dropdown.addEventListener('aui-layer-hide', function () {
(0, _jquery2.default)(dropdown).trigger('aui-dropdown2-hide');
if (dropdown._syncClasses) {
dropdown._syncClasses();
delete dropdown._syncClasses;
}
if (dropdown._auiAlignment) {
dropdown._auiAlignment.disable();
dropdown._auiAlignment.destroy();
}
if (dropdown._returnTo) {
if (dropdown.parentNode && dropdown.parentNode !== dropdown._returnTo) {
dropdown._returnTo.appendChild(dropdown);
}
}
(0, _jquery2.default)(dropdown).removeClass('aui-dropdown2-in-buttons');
getVisibleDropdownItems(dropdown).removeClass('active aui-dropdown2-active');
doIfTrigger(dropdown, function (trigger) {
if (wasProbablyClosedViaKeyboard()) {
trigger.focus();
setDropdownTriggerActiveState(trigger, trigger.hasSubmenu && trigger.hasSubmenu());
} else {
setDropdownTriggerActiveState(trigger, false);
}
});
// Gets set by submenu trigger invocation. Bad coupling point?
delete dropdown.isSubmenu;
dropdown._triggeringElement = null;
});
}
function bindItemInteractionBehaviourToDropdown(dropdown) {
var $dropdown = (0, _jquery2.default)(dropdown);
$dropdown.on('keydown', function (e) {
if (e.keyCode === _keyCode2.default.DOWN) {
dropdown.focusNext();
e.preventDefault();
} else if (e.keyCode === _keyCode2.default.UP) {
dropdown.focusPrevious();
e.preventDefault();
} else if (e.keyCode === _keyCode2.default.LEFT) {
if (dropdown.isSubmenu) {
keyboardCloseDetected();
dropdown.hide(e);
e.preventDefault();
}
} else if (e.keyCode === _keyCode2.default.ESCAPE) {
// The closing will be handled by the LayerManager!
keyboardCloseDetected();
} else if (e.keyCode === _keyCode2.default.TAB) {
keyboardCloseDetected();
dropdown.hide(e);
}
});
var hideIfNotSubmenuAndNotInteractive = function hideIfNotSubmenuAndNotInteractive(e) {
var $item = (0, _jquery2.default)(e.currentTarget);
if ($item.attr('aria-disabled') === 'true') {
e.preventDefault();
return;
}
var isSubmenuTrigger = e.currentTarget.hasSubmenu && e.currentTarget.hasSubmenu();
if (!isSubmenuTrigger && !$item.is('.aui-dropdown2-interactive')) {
var theMenu = dropdown;
do {
var dd = (0, _layer2.default)(theMenu);
theMenu = (0, _layer2.default)(theMenu).below();
if (dd.$el.is('.aui-dropdown2')) {
dd.hide(e);
}
} while (theMenu);
}
};
$dropdown.on('click keydown', 'a, button, [role="menuitem"], [role="menuitemcheckbox"], [role="checkbox"], [role="menuitemradio"], [role="radio"]', function (e) {
var item = e.currentTarget;
var $item = (0, _jquery2.default)(item);
var eventKeyCode = e.keyCode;
var isEnter = eventKeyCode === _keyCode2.default.ENTER;
var isSpace = eventKeyCode === _keyCode2.default.SPACE;
// AUI-4283: Accessibility - need to ignore enter on links/buttons so
// that the dropdown remains visible to allow the click event to eventually fire.
var itemIgnoresEnter = isEnter && $item.is('a[href], button');
if (!itemIgnoresEnter && (e.type === 'click' || isEnter || isSpace)) {
hideIfNotSubmenuAndNotInteractive(e);
}
});
// close a submenus when the mouse moves over items other than its trigger
$dropdown.on('mouseenter', 'a, button, [role="menuitem"], [role="menuitemcheckbox"], [role="checkbox"], [role="menuitemradio"], [role="radio"]', function (e) {
var item = e.currentTarget;
var hasSubmenu = item.hasSubmenu && item.hasSubmenu();
if (!e.isDefaultPrevented() && !hasSubmenu) {
var maybeALayer = (0, _layer2.default)(dropdown).above();
if (maybeALayer) {
(0, _layer2.default)(maybeALayer).hide();
}
}
});
}
(0, _jquery2.default)(window).on('resize', (0, _debounce.debounceImmediate)(function () {
(0, _jquery2.default)('.aui-dropdown2').each(function (index, dropdown) {
_skate2.default.init(dropdown);
if (dropdown.isVisible()) {
dropdown.hide();
}
});
}, 1000));
// Dropdowns
// ---------
function dropdownCreated(dropdown) {
var $dropdown = (0, _jquery2.default)(dropdown);
$dropdown.addClass('aui-dropdown2');
// swap the inner div to presentation as application is only needed for Windows
if ((0, _browser.supportsVoiceOver)()) {
$dropdown.find('> div[role="application"]').attr('role', 'presentation');
}
if (dropdown.hasAttribute('data-container')) {
$dropdown.attr('data-aui-alignment-container', $dropdown.attr('data-container'));
$dropdown.removeAttr('data-container');
}
bindDropdownBehaviourToLayer(dropdown);
bindItemInteractionBehaviourToDropdown(dropdown);
dropdown.hide();
(0, _jquery2.default)(dropdown).delegate('.aui-dropdown2-checkbox:not(.disabled):not(.aui-dropdown2-disabled)', 'click keydown', function (e) {
if (e.type === 'click' || e.keyCode === _keyCode2.default.ENTER || e.keyCode === _keyCode2.default.SPACE) {
var checkbox = this;
if (e.isDefaultPrevented()) {
return;
}
if (checkbox.isInteractive()) {
e.preventDefault();
}
if (checkbox.isEnabled()) {
// toggle the checked state
if (checkbox.isChecked()) {
checkbox.uncheck();
} else {
checkbox.check();
}
}
}
});
(0, _jquery2.default)(dropdown).delegate('.aui-dropdown2-radio:not(.checked):not(.aui-dropdown2-checked):not(.disabled):not(.aui-dropdown2-disabled)', 'click keydown', function (e) {
if (e.type === 'click' || e.keyCode === _keyCode2.default.ENTER || e.keyCode === _keyCode2.default.SPACE) {
var radio = this;
if (e.isDefaultPrevented()) {
return;
}
if (radio.isInteractive()) {
e.preventDefault();
}
var $radio = (0, _jquery2.default)(this);
if (this.isEnabled() && this.isChecked() === false) {
// toggle the checked state
$radio.closest('ul,[role=group]').find('.aui-dropdown2-checked').not(this).each(function () {
this.uncheck();
});
radio.check();
}
}
});
}
var dropdownPrototype = {
/**
* Toggles the visibility of the dropdown menu
*/
toggle: function toggle(e) {
if (this.isVisible()) {
this.hide(e);
} else {
this.show(e);
}
},
/**
* Explicitly shows the menu
*
* @returns {HTMLElement}
*/
show: function show(e) {
if (e && e.currentTarget && e.currentTarget.classList.contains('aui-dropdown2-trigger')) {
this._triggeringElement = e.currentTarget;
}
(0, _layer2.default)(this).show();
var dropdown = this;
doIfTrigger(dropdown, function (trigger) {
setLayerAlignment(dropdown, trigger);
});
return this;
},
/**
* Explicitly hides the menu
*
* @returns {HTMLElement}
*/
hide: function hide() {
(0, _layer2.default)(this).hide();
return this;
},
/**
* Shifts explicit focus to the next available item in the menu
*
* @returns {undefined}
*/
focusNext: function focusNext() {
var $items = getVisibleDropdownItems(this);
var selected = document.activeElement;
var idx;
if ($items.last()[0] !== selected) {
idx = $items.toArray().indexOf(selected);
this.focusItem($items.get(idx + 1));
}
},
/**
* Shifts explicit focus to the previous available item in the menu
*
* @returns {undefined}
*/
focusPrevious: function focusPrevious() {
var $items = getVisibleDropdownItems(this);
var selected = document.activeElement;
var idx;
if ($items.first()[0] !== selected) {
idx = $items.toArray().indexOf(selected);
this.focusItem($items.get(idx - 1));
}
},
/**
* Shifts explicit focus to the menu item matching the index param
*/
focusItem: function focusItem(item) {
var $items = getVisibleDropdownItems(this);
var $item;
if (typeof item === 'number') {
item = $items.get(item);
}
$item = (0, _jquery2.default)(item);
$item.focus();
$items.removeClass('active aui-dropdown2-active');
$item.addClass('active aui-dropdown2-active');
},
/**
* Checks whether or not the menu is currently displayed
*
* @returns {Boolean}
*/
isVisible: function isVisible() {
return (0, _layer2.default)(this).isVisible();
}
};
// Web component API for dropdowns
// -------------------------------
var disabledAttributeHandler = {
created: function created(element) {
var a = element.children[0];
a.setAttribute('aria-disabled', 'true');
a.className += ' aui-dropdown2-disabled';
},
removed: function removed(element) {
var a = element.children[0];
a.setAttribute('aria-disabled', 'false');
(0, _jquery2.default)(a).removeClass('aui-dropdown2-disabled');
}
};
var interactiveAttributeHandler = {
created: function created(element) {
var a = element.children[0];
a.className += ' aui-dropdown2-interactive';
},
removed: function removed(element) {
var a = element.children[0];
(0, _jquery2.default)(a).removeClass('aui-dropdown2-interactive');
}
};
var checkedAttributeHandler = {
created: function created(element) {
var a = element.children[0];
(0, _jquery2.default)(a).addClass('checked aui-dropdown2-checked');
a.setAttribute('aria-checked', true);
element.dispatchEvent(new _customEvent2.default('change', { bubbles: true }));
},
removed: function removed(element) {
var a = element.children[0];
(0, _jquery2.default)(a).removeClass('checked aui-dropdown2-checked');
a.setAttribute('aria-checked', false);
element.dispatchEvent(new _customEvent2.default('change', { bubbles: true }));
}
};
var hiddenAttributeHandler = {
created: function created(element) {
disabledAttributeHandler.created(element);
},
removed: function removed(element) {
disabledAttributeHandler.removed(element);
}
};
(0, _skate2.default)('aui-item-link', {
template: (0, _skatejsTemplateHtml2.default)('<a role="menuitem" tabindex="-1"><content></content></a>'),
attributes: {
disabled: disabledAttributeHandler,
interactive: interactiveAttributeHandler,
hidden: hiddenAttributeHandler,
href: {
created: function created(element, change) {
var a = element.children[0];
a.setAttribute('href', change.newValue);
},
updated: function updated(element, change) {
var a = element.children[0];
a.setAttribute('href', change.newValue);
},
removed: function removed(element) {
var a = element.children[0];
a.removeAttribute('href');
}
},
for: {
created: function created(element) {
var anchor = element.children[0];
anchor.setAttribute('aria-controls', element.getAttribute('for'));
(0, _jquery2.default)(anchor).addClass('aui-dropdown2-sub-trigger');
},
updated: function updated(element) {
var anchor = element.children[0];
anchor.setAttribute('aria-controls', element.getAttribute('for'));
},
removed: function removed(element) {
var anchor = element.children[0];
anchor.removeAttribute('aria-controls');
(0, _jquery2.default)(anchor).removeClass('aui-dropdown2-sub-trigger');
}
}
}
});
(0, _skate2.default)('aui-item-checkbox', {
template: (0, _skatejsTemplateHtml2.default)('<span role="checkbox" class="aui-dropdown2-checkbox" tabindex="-1"><content></content></span>'),
attributes: {
disabled: disabledAttributeHandler,
interactive: interactiveAttributeHandler,
checked: checkedAttributeHandler,
hidden: hiddenAttributeHandler
}
});
(0, _skate2.default)('aui-item-radio', {
template: (0, _skatejsTemplateHtml2.default)('<span role="radio" class="aui-dropdown2-radio" tabindex="-1"><content></content></span>'),
attributes: {
disabled: disabledAttributeHandler,
interactive: interactiveAttributeHandler,
checked: checkedAttributeHandler,
hidden: hiddenAttributeHandler
}
});
(0, _skate2.default)('aui-section', {
template: (0, _skatejsTemplateHtml2.default)('\n <strong aria-role="presentation" class="aui-dropdown2-heading"></strong>\n <div role="group">\n <content></content>\n </div>\n '),
attributes: {
label: function label(element, data) {
var headingElement = element.children[0];
var groupElement = element.children[1];
headingElement.textContent = data.newValue;
groupElement.setAttribute('aria-label', data.newValue);
}
},
created: function created(element) {
element.className += ' aui-dropdown2-section';
element.setAttribute('role', 'presentation');
}
});
(0, _skate2.default)('aui-dropdown-menu', {
template: (0, _skatejsTemplateHtml2.default)('\n <div role="application">\n <content></content>\n </div>\n '),
created: function created(dropdown) {
dropdown.setAttribute('role', 'menu');
dropdown.className = 'aui-dropdown2 aui-style-default aui-layer';
(0, _state2.default)(dropdown).set('loading-state', UNLOADED);
// Now skate the .aui-dropdown2 behaviour.
_skate2.default.init(dropdown);
},
attributes: {
src: {}
},
prototype: dropdownPrototype,
events: {
'aui-layer-show': loadContentWhenMenuShown
}
});
// Legacy dropdown inits
// ---------------------
(0, _skate2.default)('aui-dropdown2', {
type: _skate2.default.type.CLASSNAME,
created: dropdownCreated,
prototype: dropdownPrototype
});
(0, _skate2.default)('data-aui-dropdown2', {
type: _skate2.default.type.ATTRIBUTE,
created: dropdownCreated,
prototype: dropdownPrototype
});
// Checkboxes and radios
// ---------------------
(0, _skate2.default)('aui-dropdown2-checkbox', {
type: _skate2.default.type.CLASSNAME,
created: function created(checkbox) {
var checked = isChecked(checkbox);
if (checked) {
(0, _jquery2.default)(checkbox).addClass('checked aui-dropdown2-checked');
}
checkbox.setAttribute('aria-checked', checked);
checkbox.setAttribute('tabindex', '0');
// swap from menuitemcheckbox to just plain checkbox for VoiceOver
if ((0, _browser.supportsVoiceOver)()) {
checkbox.setAttribute('role', 'checkbox');
}
},
prototype: {
isEnabled: function isEnabled() {
return !(this.getAttribute('aria-disabled') !== null && this.getAttribute('aria-disabled') === 'true');
},
isChecked: function isChecked() {
return this.getAttribute('aria-checked') !== null && this.getAttribute('aria-checked') === 'true';
},
isInteractive: function isInteractive() {
return (0, _jquery2.default)(this).hasClass('aui-dropdown2-interactive');
},
uncheck: function uncheck() {
if (this.parentNode.tagName.toLowerCase() === 'aui-item-checkbox') {
this.parentNode.removeAttribute('checked');
}
this.setAttribute('aria-checked', 'false');
(0, _jquery2.default)(this).removeClass('checked aui-dropdown2-checked');
(0, _jquery2.default)(this).trigger('aui-dropdown2-item-uncheck');
},
check: function check() {
if (this.parentNode.tagName.toLowerCase() === 'aui-item-checkbox') {
this.parentNode.setAttribute('checked', '');
}
this.setAttribute('aria-checked', 'true');
(0, _jquery2.default)(this).addClass('checked aui-dropdown2-checked');
(0, _jquery2.default)(this).trigger('aui-dropdown2-item-check');
}
}
});
(0, _skate2.default)('aui-dropdown2-radio', {
type: _skate2.default.type.CLASSNAME,
created: function created(radio) {
// add a dash of ARIA
var checked = isChecked(radio);
if (checked) {
(0, _jquery2.default)(radio).addClass('checked aui-dropdown2-checked');
}
radio.setAttribute('aria-checked', checked);
radio.setAttribute('tabindex', '0');
// swap from menuitemradio to just plain radio for VoiceOver
if ((0, _browser.supportsVoiceOver)()) {
radio.setAttribute('role', 'radio');
}
},
prototype: {
isEnabled: function isEnabled() {
return !(this.getAttribute('aria-disabled') !== null && this.getAttribute('aria-disabled') === 'true');
},
isChecked: function isChecked() {
return this.getAttribute('aria-checked') !== null && this.getAttribute('aria-checked') === 'true';
},
isInteractive: function isInteractive() {
return (0, _jquery2.default)(this).hasClass('aui-dropdown2-interactive');
},
uncheck: function uncheck() {
if (this.parentNode.tagName.toLowerCase() === 'aui-item-radio') {
this.parentNode.removeAttribute('checked');
}
this.setAttribute('aria-checked', 'false');
(0, _jquery2.default)(this).removeClass('checked aui-dropdown2-checked');
(0, _jquery2.default)(this).trigger('aui-dropdown2-item-uncheck');
},
check: function check() {
if (this.parentNode.tagName.toLowerCase() === 'aui-item-radio') {
this.parentNode.setAttribute('checked', '');
}
this.setAttribute('aria-checked', 'true');
(0, _jquery2.default)(this).addClass('checked aui-dropdown2-checked');
(0, _jquery2.default)(this).trigger('aui-dropdown2-item-check');
}
}
});
return module.exports;
}).call(this);
// src/js/aui/unique-id.js
(typeof window === 'undefined' ? global : window).__388ef4e8d369be2e25e22add284c2c1e = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var uniqueID;
var uniqueIDstring;
var uniqueIDcounter = 0;
/**
* Generate a unique ID string, checking the ID is not present in the DOM before
* returning. Note uniqueID, uniqueIDstring, uniqueIDcounter = 0; set at top of
* file.
*
* @param {String} prefix String to prepend to ID instead of default AUI prefix.
*
* @returns {String}
*/
function generateUniqueId(prefix) {
uniqueID = uniqueIDcounter++ + '';
uniqueIDstring = prefix ? prefix + uniqueID : 'aui-uid-' + uniqueID;
if (!document.getElementById(uniqueIDstring)) {
return uniqueIDstring;
} else {
uniqueIDstring = uniqueIDstring + '-' + new Date().getTime();
if (!document.getElementById(uniqueIDstring)) {
return uniqueIDstring;
} else {
throw new Error('Timestamped fallback ID "' + uniqueIDstring + '" exists.');
}
}
}
(0, _globalize2.default)('id', generateUniqueId);
exports.default = generateUniqueId;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/enforcer.js
(typeof window === 'undefined' ? global : window).__d7df4172d37613f70c7c4e4b335a76d0 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function enforcer(element) {
function attributeExists(attributeName) {
var errorMessage = attributeName + ' wasn\'t defined';
return satisfiesRules(function () {
return element.hasAttribute(attributeName);
}, errorMessage);
}
function refersTo(attributeName) {
if (!attributeExists(attributeName, element)) {
return false;
}
var desiredId = element.getAttribute(attributeName);
var errorMessage = 'an element with id set to "' + desiredId + '" was not found';
return satisfiesRules(function () {
return document.getElementById(desiredId);
}, errorMessage);
}
function ariaControls() {
return refersTo('aria-controls');
}
function ariaOwns() {
return refersTo('aria-owns');
}
function satisfiesRules(predicate, message) {
if (!predicate()) {
if (element) {
logger.error(message, element);
} else {
logger.error(message);
}
return false;
}
return true;
}
return {
attributeExists: attributeExists,
refersTo: refersTo,
satisfiesRules: satisfiesRules,
ariaControls: ariaControls,
ariaOwns: ariaOwns
};
}
exports.default = enforcer;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js-vendor/underscorejs/underscore.js
(typeof window === 'undefined' ? global : window).__ed831912f30b9092f0c528b076acf41d = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__ed831912f30b9092f0c528b076acf41d");
define.amd = true;
// Underscore.js 1.5.2
// http://underscorejs.org
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
(function() {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `exports` on the server.
var root = this;
// Save the previous value of the `_` variable.
var previousUnderscore = root._;
// Establish the object that gets returned to break out of a loop iteration.
var breaker = {};
// Save bytes in the minified (but not gzipped) version:
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
// Create quick reference variables for speed access to core prototypes.
var
push = ArrayProto.push,
slice = ArrayProto.slice,
concat = ArrayProto.concat,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;
// All **ECMAScript 5** native function implementations that we hope to use
// are declared here.
var
nativeForEach = ArrayProto.forEach,
nativeMap = ArrayProto.map,
nativeReduce = ArrayProto.reduce,
nativeReduceRight = ArrayProto.reduceRight,
nativeFilter = ArrayProto.filter,
nativeEvery = ArrayProto.every,
nativeSome = ArrayProto.some,
nativeIndexOf = ArrayProto.indexOf,
nativeLastIndexOf = ArrayProto.lastIndexOf,
nativeIsArray = Array.isArray,
nativeKeys = Object.keys,
nativeBind = FuncProto.bind;
// Create a safe reference to the Underscore object for use below.
var _ = function(obj) {
if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj;
};
// Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're in
// the browser, add `_` as a global object via a string identifier,
// for Closure Compiler "advanced" mode.
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _;
}
exports._ = _;
} else {
root._ = _;
}
// Current version.
_.VERSION = '1.5.2';
// Collection Functions
// --------------------
// The cornerstone, an `each` implementation, aka `forEach`.
// Handles objects with the built-in `forEach`, arrays, and raw objects.
// Delegates to **ECMAScript 5**'s native `forEach` if available.
var each = _.each = _.forEach = function(obj, iterator, context) {
if (obj == null) return;
if (nativeForEach && obj.forEach === nativeForEach) {
obj.forEach(iterator, context);
} else if (obj.length === +obj.length) {
for (var i = 0, length = obj.length; i < length; i++) {
if (iterator.call(context, obj[i], i, obj) === breaker) return;
}
} else {
var keys = _.keys(obj);
for (var i = 0, length = keys.length; i < length; i++) {
if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return;
}
}
};
// Return the results of applying the iterator to each element.
// Delegates to **ECMAScript 5**'s native `map` if available.
_.map = _.collect = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
each(obj, function(value, index, list) {
results.push(iterator.call(context, value, index, list));
});
return results;
};
var reduceError = 'Reduce of empty array with no initial value';
// **Reduce** builds up a single result from a list of values, aka `inject`,
// or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
_.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
var initial = arguments.length > 2;
if (obj == null) obj = [];
if (nativeReduce && obj.reduce === nativeReduce) {
if (context) iterator = _.bind(iterator, context);
return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
}
each(obj, function(value, index, list) {
if (!initial) {
memo = value;
initial = true;
} else {
memo = iterator.call(context, memo, value, index, list);
}
});
if (!initial) throw new TypeError(reduceError);
return memo;
};
// The right-associative version of reduce, also known as `foldr`.
// Delegates to **ECMAScript 5**'s native `reduceRight` if available.
_.reduceRight = _.foldr = function(obj, iterator, memo, context) {
var initial = arguments.length > 2;
if (obj == null) obj = [];
if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
if (context) iterator = _.bind(iterator, context);
return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
}
var length = obj.length;
if (length !== +length) {
var keys = _.keys(obj);
length = keys.length;
}
each(obj, function(value, index, list) {
index = keys ? keys[--length] : --length;
if (!initial) {
memo = obj[index];
initial = true;
} else {
memo = iterator.call(context, memo, obj[index], index, list);
}
});
if (!initial) throw new TypeError(reduceError);
return memo;
};
// Return the first value which passes a truth test. Aliased as `detect`.
_.find = _.detect = function(obj, iterator, context) {
var result;
any(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) {
result = value;
return true;
}
});
return result;
};
// Return all the elements that pass a truth test.
// Delegates to **ECMAScript 5**'s native `filter` if available.
// Aliased as `select`.
_.filter = _.select = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
each(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) results.push(value);
});
return results;
};
// Return all the elements for which a truth test fails.
_.reject = function(obj, iterator, context) {
return _.filter(obj, function(value, index, list) {
return !iterator.call(context, value, index, list);
}, context);
};
// Determine whether all of the elements match a truth test.
// Delegates to **ECMAScript 5**'s native `every` if available.
// Aliased as `all`.
_.every = _.all = function(obj, iterator, context) {
iterator || (iterator = _.identity);
var result = true;
if (obj == null) return result;
if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
each(obj, function(value, index, list) {
if (!(result = result && iterator.call(context, value, index, list))) return breaker;
});
return !!result;
};
// Determine if at least one element in the object matches a truth test.
// Delegates to **ECMAScript 5**'s native `some` if available.
// Aliased as `any`.
var any = _.some = _.any = function(obj, iterator, context) {
iterator || (iterator = _.identity);
var result = false;
if (obj == null) return result;
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
each(obj, function(value, index, list) {
if (result || (result = iterator.call(context, value, index, list))) return breaker;
});
return !!result;
};
// Determine if the array or object contains a given value (using `===`).
// Aliased as `include`.
_.contains = _.include = function(obj, target) {
if (obj == null) return false;
if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
return any(obj, function(value) {
return value === target;
});
};
// Invoke a method (with arguments) on every item in a collection.
_.invoke = function(obj, method) {
var args = slice.call(arguments, 2);
var isFunc = _.isFunction(method);
return _.map(obj, function(value) {
return (isFunc ? method : value[method]).apply(value, args);
});
};
// Convenience version of a common use case of `map`: fetching a property.
_.pluck = function(obj, key) {
return _.map(obj, function(value){ return value[key]; });
};
// Convenience version of a common use case of `filter`: selecting only objects
// containing specific `key:value` pairs.
_.where = function(obj, attrs, first) {
if (_.isEmpty(attrs)) return first ? void 0 : [];
return _[first ? 'find' : 'filter'](obj, function(value) {
for (var key in attrs) {
if (attrs[key] !== value[key]) return false;
}
return true;
});
};
// Convenience version of a common use case of `find`: getting the first object
// containing specific `key:value` pairs.
_.findWhere = function(obj, attrs) {
return _.where(obj, attrs, true);
};
// Return the maximum element or (element-based computation).
// Can't optimize arrays of integers longer than 65,535 elements.
// See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797)
_.max = function(obj, iterator, context) {
if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
return Math.max.apply(Math, obj);
}
if (!iterator && _.isEmpty(obj)) return -Infinity;
var result = {computed : -Infinity, value: -Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed > result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
// Return the minimum element (or element-based computation).
_.min = function(obj, iterator, context) {
if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
return Math.min.apply(Math, obj);
}
if (!iterator && _.isEmpty(obj)) return Infinity;
var result = {computed : Infinity, value: Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed < result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
// Shuffle an array, using the modern version of the
// [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/FisherรขโฌโYates_shuffle).
_.shuffle = function(obj) {
var rand;
var index = 0;
var shuffled = [];
each(obj, function(value) {
rand = _.random(index++);
shuffled[index - 1] = shuffled[rand];
shuffled[rand] = value;
});
return shuffled;
};
// Sample **n** random values from an array.
// If **n** is not specified, returns a single random element from the array.
// The internal `guard` argument allows it to work with `map`.
_.sample = function(obj, n, guard) {
if (arguments.length < 2 || guard) {
return obj[_.random(obj.length - 1)];
}
return _.shuffle(obj).slice(0, Math.max(0, n));
};
// An internal function to generate lookup iterators.
var lookupIterator = function(value) {
return _.isFunction(value) ? value : function(obj){ return obj[value]; };
};
// Sort the object's values by a criterion produced by an iterator.
_.sortBy = function(obj, value, context) {
var iterator = lookupIterator(value);
return _.pluck(_.map(obj, function(value, index, list) {
return {
value: value,
index: index,
criteria: iterator.call(context, value, index, list)
};
}).sort(function(left, right) {
var a = left.criteria;
var b = right.criteria;
if (a !== b) {
if (a > b || a === void 0) return 1;
if (a < b || b === void 0) return -1;
}
return left.index - right.index;
}), 'value');
};
// An internal function used for aggregate "group by" operations.
var group = function(behavior) {
return function(obj, value, context) {
var result = {};
var iterator = value == null ? _.identity : lookupIterator(value);
each(obj, function(value, index) {
var key = iterator.call(context, value, index, obj);
behavior(result, key, value);
});
return result;
};
};
// Groups the object's values by a criterion. Pass either a string attribute
// to group by, or a function that returns the criterion.
_.groupBy = group(function(result, key, value) {
(_.has(result, key) ? result[key] : (result[key] = [])).push(value);
});
// Indexes the object's values by a criterion, similar to `groupBy`, but for
// when you know that your index values will be unique.
_.indexBy = group(function(result, key, value) {
result[key] = value;
});
// Counts instances of an object that group by a certain criterion. Pass
// either a string attribute to count by, or a function that returns the
// criterion.
_.countBy = group(function(result, key) {
_.has(result, key) ? result[key]++ : result[key] = 1;
});
// Use a comparator function to figure out the smallest index at which
// an object should be inserted so as to maintain order. Uses binary search.
_.sortedIndex = function(array, obj, iterator, context) {
iterator = iterator == null ? _.identity : lookupIterator(iterator);
var value = iterator.call(context, obj);
var low = 0, high = array.length;
while (low < high) {
var mid = (low + high) >>> 1;
iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
}
return low;
};
// Safely create a real, live array from anything iterable.
_.toArray = function(obj) {
if (!obj) return [];
if (_.isArray(obj)) return slice.call(obj);
if (obj.length === +obj.length) return _.map(obj, _.identity);
return _.values(obj);
};
// Return the number of elements in an object.
_.size = function(obj) {
if (obj == null) return 0;
return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
};
// Array Functions
// ---------------
// Get the first element of an array. Passing **n** will return the first N
// values in the array. Aliased as `head` and `take`. The **guard** check
// allows it to work with `_.map`.
_.first = _.head = _.take = function(array, n, guard) {
if (array == null) return void 0;
return (n == null) || guard ? array[0] : slice.call(array, 0, n);
};
// Returns everything but the last entry of the array. Especially useful on
// the arguments object. Passing **n** will return all the values in
// the array, excluding the last N. The **guard** check allows it to work with
// `_.map`.
_.initial = function(array, n, guard) {
return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
};
// Get the last element of an array. Passing **n** will return the last N
// values in the array. The **guard** check allows it to work with `_.map`.
_.last = function(array, n, guard) {
if (array == null) return void 0;
if ((n == null) || guard) {
return array[array.length - 1];
} else {
return slice.call(array, Math.max(array.length - n, 0));
}
};
// Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
// Especially useful on the arguments object. Passing an **n** will return
// the rest N values in the array. The **guard**
// check allows it to work with `_.map`.
_.rest = _.tail = _.drop = function(array, n, guard) {
return slice.call(array, (n == null) || guard ? 1 : n);
};
// Trim out all falsy values from an array.
_.compact = function(array) {
return _.filter(array, _.identity);
};
// Internal implementation of a recursive `flatten` function.
var flatten = function(input, shallow, output) {
if (shallow && _.every(input, _.isArray)) {
return concat.apply(output, input);
}
each(input, function(value) {
if (_.isArray(value) || _.isArguments(value)) {
shallow ? push.apply(output, value) : flatten(value, shallow, output);
} else {
output.push(value);
}
});
return output;
};
// Flatten out an array, either recursively (by default), or just one level.
_.flatten = function(array, shallow) {
return flatten(array, shallow, []);
};
// Return a version of the array that does not contain the specified value(s).
_.without = function(array) {
return _.difference(array, slice.call(arguments, 1));
};
// Produce a duplicate-free version of the array. If the array has already
// been sorted, you have the option of using a faster algorithm.
// Aliased as `unique`.
_.uniq = _.unique = function(array, isSorted, iterator, context) {
if (_.isFunction(isSorted)) {
context = iterator;
iterator = isSorted;
isSorted = false;
}
var initial = iterator ? _.map(array, iterator, context) : array;
var results = [];
var seen = [];
each(initial, function(value, index) {
if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
seen.push(value);
results.push(array[index]);
}
});
return results;
};
// Produce an array that contains the union: each distinct element from all of
// the passed-in arrays.
_.union = function() {
return _.uniq(_.flatten(arguments, true));
};
// Produce an array that contains every item shared between all the
// passed-in arrays.
_.intersection = function(array) {
var rest = slice.call(arguments, 1);
return _.filter(_.uniq(array), function(item) {
return _.every(rest, function(other) {
return _.indexOf(other, item) >= 0;
});
});
};
// Take the difference between one array and a number of other arrays.
// Only the elements present in just the first array will remain.
_.difference = function(array) {
var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
return _.filter(array, function(value){ return !_.contains(rest, value); });
};
// Zip together multiple lists into a single array -- elements that share
// an index go together.
_.zip = function() {
var length = _.max(_.pluck(arguments, "length").concat(0));
var results = new Array(length);
for (var i = 0; i < length; i++) {
results[i] = _.pluck(arguments, '' + i);
}
return results;
};
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
_.object = function(list, values) {
if (list == null) return {};
var result = {};
for (var i = 0, length = list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
};
// If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
// we need this function. Return the position of the first occurrence of an
// item in an array, or -1 if the item is not included in the array.
// Delegates to **ECMAScript 5**'s native `indexOf` if available.
// If the array is large and already in sort order, pass `true`
// for **isSorted** to use binary search.
_.indexOf = function(array, item, isSorted) {
if (array == null) return -1;
var i = 0, length = array.length;
if (isSorted) {
if (typeof isSorted == 'number') {
i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted);
} else {
i = _.sortedIndex(array, item);
return array[i] === item ? i : -1;
}
}
if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
for (; i < length; i++) if (array[i] === item) return i;
return -1;
};
// Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
_.lastIndexOf = function(array, item, from) {
if (array == null) return -1;
var hasIndex = from != null;
if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
}
var i = (hasIndex ? from : array.length);
while (i--) if (array[i] === item) return i;
return -1;
};
// Generate an integer Array containing an arithmetic progression. A port of
// the native Python `range()` function. See
// [the Python documentation](http://docs.python.org/library/functions.html#range).
_.range = function(start, stop, step) {
if (arguments.length <= 1) {
stop = start || 0;
start = 0;
}
step = arguments[2] || 1;
var length = Math.max(Math.ceil((stop - start) / step), 0);
var idx = 0;
var range = new Array(length);
while(idx < length) {
range[idx++] = start;
start += step;
}
return range;
};
// Function (ahem) Functions
// ------------------
// Reusable constructor function for prototype setting.
var ctor = function(){};
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
// available.
_.bind = function(func, context) {
var args, bound;
if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
if (!_.isFunction(func)) throw new TypeError;
args = slice.call(arguments, 2);
return bound = function() {
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
ctor.prototype = func.prototype;
var self = new ctor;
ctor.prototype = null;
var result = func.apply(self, args.concat(slice.call(arguments)));
if (Object(result) === result) return result;
return self;
};
};
// Partially apply a function by creating a version that has had some of its
// arguments pre-filled, without changing its dynamic `this` context.
_.partial = function(func) {
var args = slice.call(arguments, 1);
return function() {
return func.apply(this, args.concat(slice.call(arguments)));
};
};
// Bind all of an object's methods to that object. Useful for ensuring that
// all callbacks defined on an object belong to it.
_.bindAll = function(obj) {
var funcs = slice.call(arguments, 1);
if (funcs.length === 0) throw new Error("bindAll must be passed function names");
each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
return obj;
};
// Memoize an expensive function by storing its results.
_.memoize = function(func, hasher) {
var memo = {};
hasher || (hasher = _.identity);
return function() {
var key = hasher.apply(this, arguments);
return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
};
};
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
_.delay = function(func, wait) {
var args = slice.call(arguments, 2);
return setTimeout(function(){ return func.apply(null, args); }, wait);
};
// Defers a function, scheduling it to run after the current call stack has
// cleared.
_.defer = function(func) {
return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
};
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time. Normally, the throttled function will run
// as much as it can, without ever going more than once per `wait` duration;
// but if you'd like to disable the execution on the leading edge, pass
// `{leading: false}`. To disable execution on the trailing edge, ditto.
_.throttle = function(func, wait, options) {
var context, args, result;
var timeout = null;
var previous = 0;
options || (options = {});
var later = function() {
previous = options.leading === false ? 0 : new Date;
timeout = null;
result = func.apply(context, args);
};
return function() {
var now = new Date;
if (!previous && options.leading === false) previous = now;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0) {
clearTimeout(timeout);
timeout = null;
previous = now;
result = func.apply(context, args);
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
}
return result;
};
};
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
_.debounce = function(func, wait, immediate) {
var timeout, args, context, timestamp, result;
return function() {
context = this;
args = arguments;
timestamp = new Date();
var later = function() {
var last = (new Date()) - timestamp;
if (last < wait) {
timeout = setTimeout(later, wait - last);
} else {
timeout = null;
if (!immediate) result = func.apply(context, args);
}
};
var callNow = immediate && !timeout;
if (!timeout) {
timeout = setTimeout(later, wait);
}
if (callNow) result = func.apply(context, args);
return result;
};
};
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
_.once = function(func) {
var ran = false, memo;
return function() {
if (ran) return memo;
ran = true;
memo = func.apply(this, arguments);
func = null;
return memo;
};
};
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
_.wrap = function(func, wrapper) {
return function() {
var args = [func];
push.apply(args, arguments);
return wrapper.apply(this, args);
};
};
// Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
_.compose = function() {
var funcs = arguments;
return function() {
var args = arguments;
for (var i = funcs.length - 1; i >= 0; i--) {
args = [funcs[i].apply(this, args)];
}
return args[0];
};
};
// Returns a function that will only be executed after being called N times.
_.after = function(times, func) {
return function() {
if (--times < 1) {
return func.apply(this, arguments);
}
};
};
// Object Functions
// ----------------
// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
_.keys = nativeKeys || function(obj) {
if (obj !== Object(obj)) throw new TypeError('Invalid object');
var keys = [];
for (var key in obj) if (_.has(obj, key)) keys.push(key);
return keys;
};
// Retrieve the values of an object's properties.
_.values = function(obj) {
var keys = _.keys(obj);
var length = keys.length;
var values = new Array(length);
for (var i = 0; i < length; i++) {
values[i] = obj[keys[i]];
}
return values;
};
// Convert an object into a list of `[key, value]` pairs.
_.pairs = function(obj) {
var keys = _.keys(obj);
var length = keys.length;
var pairs = new Array(length);
for (var i = 0; i < length; i++) {
pairs[i] = [keys[i], obj[keys[i]]];
}
return pairs;
};
// Invert the keys and values of an object. The values must be serializable.
_.invert = function(obj) {
var result = {};
var keys = _.keys(obj);
for (var i = 0, length = keys.length; i < length; i++) {
result[obj[keys[i]]] = keys[i];
}
return result;
};
// Return a sorted list of the function names available on the object.
// Aliased as `methods`
_.functions = _.methods = function(obj) {
var names = [];
for (var key in obj) {
if (_.isFunction(obj[key])) names.push(key);
}
return names.sort();
};
// Extend a given object with all the properties in passed-in object(s).
_.extend = function(obj) {
each(slice.call(arguments, 1), function(source) {
if (source) {
for (var prop in source) {
obj[prop] = source[prop];
}
}
});
return obj;
};
// Return a copy of the object only containing the whitelisted properties.
_.pick = function(obj) {
var copy = {};
var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
each(keys, function(key) {
if (key in obj) copy[key] = obj[key];
});
return copy;
};
// Return a copy of the object without the blacklisted properties.
_.omit = function(obj) {
var copy = {};
var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
for (var key in obj) {
if (!_.contains(keys, key)) copy[key] = obj[key];
}
return copy;
};
// Fill in a given object with default properties.
_.defaults = function(obj) {
each(slice.call(arguments, 1), function(source) {
if (source) {
for (var prop in source) {
if (obj[prop] === void 0) obj[prop] = source[prop];
}
}
});
return obj;
};
// Create a (shallow-cloned) duplicate of an object.
_.clone = function(obj) {
if (!_.isObject(obj)) return obj;
return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
};
// Invokes interceptor with the obj, and then returns obj.
// The primary purpose of this method is to "tap into" a method chain, in
// order to perform operations on intermediate results within the chain.
_.tap = function(obj, interceptor) {
interceptor(obj);
return obj;
};
// Internal recursive comparison function for `isEqual`.
var eq = function(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
if (a === b) return a !== 0 || 1 / a == 1 / b;
// A strict comparison is necessary because `null == undefined`.
if (a == null || b == null) return a === b;
// Unwrap any wrapped objects.
if (a instanceof _) a = a._wrapped;
if (b instanceof _) b = b._wrapped;
// Compare `[[Class]]` names.
var className = toString.call(a);
if (className != toString.call(b)) return false;
switch (className) {
// Strings, numbers, dates, and booleans are compared by value.
case '[object String]':
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
// equivalent to `new String("5")`.
return a == String(b);
case '[object Number]':
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
// other numeric values.
return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
case '[object Date]':
case '[object Boolean]':
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return +a == +b;
// RegExps are compared by their source patterns and flags.
case '[object RegExp]':
return a.source == b.source &&
a.global == b.global &&
a.multiline == b.multiline &&
a.ignoreCase == b.ignoreCase;
}
if (typeof a != 'object' || typeof b != 'object') return false;
// Assume equality for cyclic structures. The algorithm for detecting cyclic
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
var length = aStack.length;
while (length--) {
// Linear search. Performance is inversely proportional to the number of
// unique nested structures.
if (aStack[length] == a) return bStack[length] == b;
}
// Objects with different constructors are not equivalent, but `Object`s
// from different frames are.
var aCtor = a.constructor, bCtor = b.constructor;
if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
_.isFunction(bCtor) && (bCtor instanceof bCtor))) {
return false;
}
// Add the first object to the stack of traversed objects.
aStack.push(a);
bStack.push(b);
var size = 0, result = true;
// Recursively compare objects and arrays.
if (className == '[object Array]') {
// Compare array lengths to determine if a deep comparison is necessary.
size = a.length;
result = size == b.length;
if (result) {
// Deep compare the contents, ignoring non-numeric properties.
while (size--) {
if (!(result = eq(a[size], b[size], aStack, bStack))) break;
}
}
} else {
// Deep compare objects.
for (var key in a) {
if (_.has(a, key)) {
// Count the expected number of properties.
size++;
// Deep compare each member.
if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
}
}
// Ensure that both objects contain the same number of properties.
if (result) {
for (key in b) {
if (_.has(b, key) && !(size--)) break;
}
result = !size;
}
}
// Remove the first object from the stack of traversed objects.
aStack.pop();
bStack.pop();
return result;
};
// Perform a deep comparison to check if two objects are equal.
_.isEqual = function(a, b) {
return eq(a, b, [], []);
};
// Is a given array, string, or object empty?
// An "empty" object has no enumerable own-properties.
_.isEmpty = function(obj) {
if (obj == null) return true;
if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
for (var key in obj) if (_.has(obj, key)) return false;
return true;
};
// Is a given value a DOM element?
_.isElement = function(obj) {
return !!(obj && obj.nodeType === 1);
};
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
_.isArray = nativeIsArray || function(obj) {
return toString.call(obj) == '[object Array]';
};
// Is a given variable an object?
_.isObject = function(obj) {
return obj === Object(obj);
};
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
_['is' + name] = function(obj) {
return toString.call(obj) == '[object ' + name + ']';
};
});
// Define a fallback version of the method in browsers (ahem, IE), where
// there isn't any inspectable "Arguments" type.
if (!_.isArguments(arguments)) {
_.isArguments = function(obj) {
return !!(obj && _.has(obj, 'callee'));
};
}
// Optimize `isFunction` if appropriate.
if (typeof (/./) !== 'function') {
_.isFunction = function(obj) {
return typeof obj === 'function';
};
}
// Is a given object a finite number?
_.isFinite = function(obj) {
return isFinite(obj) && !isNaN(parseFloat(obj));
};
// Is the given value `NaN`? (NaN is the only number which does not equal itself).
_.isNaN = function(obj) {
return _.isNumber(obj) && obj != +obj;
};
// Is a given value a boolean?
_.isBoolean = function(obj) {
return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
};
// Is a given value equal to null?
_.isNull = function(obj) {
return obj === null;
};
// Is a given variable undefined?
_.isUndefined = function(obj) {
return obj === void 0;
};
// Shortcut function for checking if an object has a given property directly
// on itself (in other words, not on a prototype).
_.has = function(obj, key) {
return hasOwnProperty.call(obj, key);
};
// Utility Functions
// -----------------
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
// previous owner. Returns a reference to the Underscore object.
_.noConflict = function() {
root._ = previousUnderscore;
return this;
};
// Keep the identity function around for default iterators.
_.identity = function(value) {
return value;
};
// Run a function **n** times.
_.times = function(n, iterator, context) {
var accum = Array(Math.max(0, n));
for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
return accum;
};
// Return a random integer between min and max (inclusive).
_.random = function(min, max) {
if (max == null) {
max = min;
min = 0;
}
return min + Math.floor(Math.random() * (max - min + 1));
};
// List of HTML entities for escaping.
var entityMap = {
escape: {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
}
};
entityMap.unescape = _.invert(entityMap.escape);
// Regexes containing the keys and values listed immediately above.
var entityRegexes = {
escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
};
// Functions for escaping and unescaping strings to/from HTML interpolation.
_.each(['escape', 'unescape'], function(method) {
_[method] = function(string) {
if (string == null) return '';
return ('' + string).replace(entityRegexes[method], function(match) {
return entityMap[method][match];
});
};
});
// If the value of the named `property` is a function then invoke it with the
// `object` as context; otherwise, return it.
_.result = function(object, property) {
if (object == null) return void 0;
var value = object[property];
return _.isFunction(value) ? value.call(object) : value;
};
// Add your own custom functions to the Underscore object.
_.mixin = function(obj) {
each(_.functions(obj), function(name) {
var func = _[name] = obj[name];
_.prototype[name] = function() {
var args = [this._wrapped];
push.apply(args, arguments);
return result.call(this, func.apply(_, args));
};
});
};
// Generate a unique integer id (unique within the entire client session).
// Useful for temporary DOM ids.
var idCounter = 0;
_.uniqueId = function(prefix) {
var id = ++idCounter + '';
return prefix ? prefix + id : id;
};
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_.templateSettings = {
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g,
escape : /<%-([\s\S]+?)%>/g
};
// When customizing `templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var noMatch = /(.)^/;
// Certain characters need to be escaped so that they can be put into a
// string literal.
var escapes = {
"'": "'",
'\\': '\\',
'\r': 'r',
'\n': 'n',
'\t': 't',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
_.template = function(text, data, settings) {
var render;
settings = _.defaults({}, settings, _.templateSettings);
// Combine delimiters into one regular expression via alternation.
var matcher = new RegExp([
(settings.escape || noMatch).source,
(settings.interpolate || noMatch).source,
(settings.evaluate || noMatch).source
].join('|') + '|$', 'g');
// Compile the template source, escaping string literals appropriately.
var index = 0;
var source = "__p+='";
text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
source += text.slice(index, offset)
.replace(escaper, function(match) { return '\\' + escapes[match]; });
if (escape) {
source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
}
if (interpolate) {
source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
}
if (evaluate) {
source += "';\n" + evaluate + "\n__p+='";
}
index = offset + match.length;
return match;
});
source += "';\n";
// If a variable is not specified, place data values in local scope.
if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
source = "var __t,__p='',__j=Array.prototype.join," +
"print=function(){__p+=__j.call(arguments,'');};\n" +
source + "return __p;\n";
try {
render = new Function(settings.variable || 'obj', '_', source);
} catch (e) {
e.source = source;
throw e;
}
if (data) return render(data, _);
var template = function(data) {
return render.call(this, data, _);
};
// Provide the compiled function source as a convenience for precompilation.
template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
return template;
};
// Add a "chain" function, which will delegate to the wrapper.
_.chain = function(obj) {
return _(obj).chain();
};
// OOP
// ---------------
// If Underscore is called as a function, it returns a wrapped object that
// can be used OO-style. This wrapper holds altered versions of all the
// underscore functions. Wrapped objects may be chained.
// Helper function to continue chaining intermediate results.
var result = function(obj) {
return this._chain ? _(obj).chain() : obj;
};
// Add all of the Underscore functions to the wrapper object.
_.mixin(_);
// Add all mutator Array functions to the wrapper.
each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
var method = ArrayProto[name];
_.prototype[name] = function() {
var obj = this._wrapped;
method.apply(obj, arguments);
if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
return result.call(this, obj);
};
});
// Add all accessor Array functions to the wrapper.
each(['concat', 'join', 'slice'], function(name) {
var method = ArrayProto[name];
_.prototype[name] = function() {
return result.call(this, method.apply(this._wrapped, arguments));
};
});
_.extend(_.prototype, {
// Start chaining a wrapped Underscore object.
chain: function() {
this._chain = true;
return this;
},
// Extracts the result from a wrapped and chained object.
value: function() {
return this._wrapped;
}
});
}).call(this);
/**
* FOLLOWING LINES MODIFIED BY ATLASSIAN
* @see https://ecosystem.atlassian.net/browse/AUI-2989
*/
if (typeof window.define === 'function') {
define('underscore', [], function(){
return window._;
})
}
/** END ATLASSIAN */
return module.exports;
}).call(this);
// src/js/aui/underscore.js
(typeof window === 'undefined' ? global : window).__003f5da3b6466136f51b7b21bc9be073 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _underscore = __ed831912f30b9092f0c528b076acf41d;
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
if (!window._) {
window._ = _underscore2.default;
}
exports.default = window._;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/events.js
(typeof window === 'undefined' ? global : window).__106f30b5b9d4eb6d2e7eefe5947f43d5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.triggerEvtForInst = exports.triggerEvt = exports.bindEvt = undefined;
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var deprecate = _interopRequireWildcard(_deprecation);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var eventRoot = document || {};
var $eventTarget = (0, _jquery2.default)(eventRoot);
/**
* Triggers a custom event on the AJS object
*
* @param {String} name - name of event
* @param {Array} args - args for event handler
*/
function triggerEvt(name, args) {
$eventTarget.trigger(name, args);
}
/**
* Binds handler to the AJS object
*
* @param {String} name
* @param {Function} func
*/
function bindEvt(name, func) {
$eventTarget.bind(name, func);
}
/**
* Some generic error handling that fires event in multiple contexts
* - on AJS object
* - on Instance
* - on AJS object with prefixed id.
*
* @param evt
* @param inst
* @param args
*/
function triggerEvtForInst(evt, inst, args) {
(0, _jquery2.default)(inst).trigger(evt, args);
triggerEvt(evt, args);
if (inst.id) {
triggerEvt(inst.id + '-' + evt, args);
}
}
exports.bindEvt = bindEvt = deprecate.fn(bindEvt, 'bindEvt', {
sinceVersion: '5.8.0'
});
exports.triggerEvt = triggerEvt = deprecate.fn(triggerEvt, 'triggerEvt', {
sinceVersion: '5.8.0'
});
exports.triggerEvtForInst = triggerEvtForInst = deprecate.fn(triggerEvtForInst, 'triggerEvtForInst', {
sinceVersion: '5.8.0'
});
(0, _globalize2.default)('bindEvt', bindEvt);
(0, _globalize2.default)('triggerEvt', triggerEvt);
(0, _globalize2.default)('triggerEvtForInst', triggerEvtForInst);
exports.bindEvt = bindEvt;
exports.triggerEvt = triggerEvt;
exports.triggerEvtForInst = triggerEvtForInst;
return module.exports;
}).call(this);
// src/js/aui/event.js
(typeof window === 'undefined' ? global : window).__e477ed6f9808ba53a5c3a76317d073a2 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.trigger = exports.unbind = exports.bind = undefined;
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Binds events to the window object. See jQuery bind documentation for more
* details. Exceptions are caught and logged.
*/
function bind(eventType, eventData, handler) {
try {
if (typeof handler === 'function') {
return (0, _jquery2.default)(window).bind(eventType, eventData, handler);
} else {
return (0, _jquery2.default)(window).bind(eventType, eventData);
}
} catch (e) {
logger.log('error while binding: ' + e.message);
}
}
/**
* Unbinds event handlers from the window object. See jQuery unbind
* documentation for more details. Exceptions are caught and logged.
*/
function unbind(eventType, handler) {
try {
return (0, _jquery2.default)(window).unbind(eventType, handler);
} catch (e) {
logger.log('error while unbinding: ' + e.message);
}
}
/**
* Triggers events on the window object. See jQuery trigger documentation for
* more details. Exceptions are caught and logged.
*/
function trigger(eventType, extraParameters) {
try {
return (0, _jquery2.default)(window).trigger(eventType, extraParameters);
} catch (e) {
logger.log('error while triggering: ' + e.message);
}
}
(0, _globalize2.default)('bind', bind);
(0, _globalize2.default)('trigger', trigger);
(0, _globalize2.default)('unbind', unbind);
exports.bind = bind;
exports.unbind = unbind;
exports.trigger = trigger;
return module.exports;
}).call(this);
// src/js/aui/forms.js
(typeof window === 'undefined' ? global : window).__9719c7394480fce893225cd8d6abde49 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.inlineHelp = exports.enable = undefined;
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Enables the specified form element.
*
* @param {Element} el The element to enable.
* @param {Boolean} b The flag setting enabled / disabled.
*
* @returns {jQuery}
*/
function enable(el, b) {
var $el = (0, _jquery2.default)(el);
if (typeof b === 'undefined') {
b = true;
}
return $el.each(function () {
this.disabled = !b;
});
}
/**
* Forms: Inline Help - toggles visibility of inline help content.
*
* @method inlineHelp
* @namespace AJS
* @for AJS
*/
function inlineHelp() {
(0, _jquery2.default)('.icon-inline-help').click(function () {
var $t = (0, _jquery2.default)(this).siblings('.field-help');
if ($t.hasClass('hidden')) {
$t.removeClass('hidden');
} else {
$t.addClass('hidden');
}
});
}
(0, _globalize2.default)('enable', enable);
(0, _globalize2.default)('inlineHelp', inlineHelp);
exports.enable = enable;
exports.inlineHelp = inlineHelp;
return module.exports;
}).call(this);
// src/js/aui/dialog.js
(typeof window === 'undefined' ? global : window).__14e770c8f3e2710e2bffe202dce2344b = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.popup = exports.Dialog = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; // can't "use strict"
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _keyCode = __d9798488305326dc80a738b4a3341d65;
var _keyCode2 = _interopRequireDefault(_keyCode);
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var deprecate = _interopRequireWildcard(_deprecation);
var _event = __e477ed6f9808ba53a5c3a76317d073a2;
var _blanket = __7ad39690422479cb34f1bf6ebb46656d;
var _forms = __9719c7394480fce893225cd8d6abde49;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates a generic popup that will be displayed in the center of the screen with a
* grey blanket in the background.
* Usage:
* <pre>
* createPopup({
* width: 800,
* height: 400,
* id: "my-dialog"
* });
* </pre>
* @param options {object} [optional] Permitted options and defaults are as follows:
* width (800), height (600), keypressListener (closes dialog on ESC).
*/
function createPopup(options) {
var defaults = {
width: 800,
height: 600,
closeOnOutsideClick: false,
keypressListener: function keypressListener(e) {
if (e.keyCode === _keyCode2.default.ESCAPE && popup.is(':visible')) {
res.hide();
}
}
};
// for backwards-compatibility
if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) !== 'object') {
options = {
width: arguments[0],
height: arguments[1],
id: arguments[2]
};
options = _jquery2.default.extend({}, options, arguments[3]);
}
options = _jquery2.default.extend({}, defaults, options);
var popup = (0, _jquery2.default)('<div></div>').addClass('aui-popup');
if (options.id) {
popup.attr('id', options.id);
}
//find the highest z-index on the page to ensure any new popup that is shown is shown on top
var highestZIndex = 3000;
(0, _jquery2.default)('.aui-dialog').each(function () {
var currentPopup = (0, _jquery2.default)(this);
highestZIndex = currentPopup.css('z-index') > highestZIndex ? currentPopup.css('z-index') : highestZIndex;
});
var applySize = function _applySize(width, height) {
options.width = width = width || options.width;
options.height = height = height || options.height;
popup.css({
marginTop: -Math.round(height / 2) + 'px',
marginLeft: -Math.round(width / 2) + 'px',
width: width,
height: height,
'z-index': parseInt(highestZIndex, 10) + 2 //+ 2 so that the shadow can be shown on +1 (underneath the popup but above everything else)
});
return _applySize;
}(options.width, options.height);
(0, _jquery2.default)('body').append(popup);
popup.hide();
(0, _forms.enable)(popup);
/**
* Popup object
* @class Popup
* @static
*/
//blanket for reference further down
var blanket = (0, _jquery2.default)('.aui-blanket');
var focusItem = function focusItem(selector, element) {
var item = (0, _jquery2.default)(selector, element);
if (item.length) {
item.focus();
return true;
}
return false;
};
// we try and place focus, in the configured element or by looking for the first input
// in page body, then button panel and finally page menu.
var focusDialog = function focusDialog(element) {
if ((0, _jquery2.default)('.dialog-page-body', element).find(':focus').length !== 0) {
return;
}
if (options.focusSelector) {
return focusItem(options.focusSelector, element);
}
var defaultFocusSelector = ':input:visible:enabled:first';
if (focusItem(defaultFocusSelector, (0, _jquery2.default)('.dialog-page-body', element))) {
return;
}
if (focusItem(defaultFocusSelector, (0, _jquery2.default)('.dialog-button-panel', element))) {
return;
}
focusItem(defaultFocusSelector, (0, _jquery2.default)('.dialog-page-menu', element));
};
var res = {
changeSize: function changeSize(w, h) {
if (w && w != options.width || h && h != options.height) {
applySize(w, h);
}
this.show();
},
/**
* Shows the popup
* @method show
*/
show: function show() {
var show = function show() {
(0, _jquery2.default)(document).off('keydown', options.keypressListener).on('keydown', options.keypressListener);
(0, _blanket.dim)();
blanket = (0, _jquery2.default)('.aui-blanket');
if (blanket.length !== 0 && options.closeOnOutsideClick) {
blanket.click(function () {
if (popup.is(':visible')) {
res.hide();
}
});
}
popup.show();
createPopup.current = this;
focusDialog(popup);
(0, _jquery2.default)(document).trigger('showLayer', ['popup', this]);
};
show.call(this);
this.show = show;
},
/**
* Hides the popup.
* @method hide
*/
hide: function hide() {
(0, _jquery2.default)(document).unbind('keydown', options.keypressListener);
blanket.unbind();
this.element.hide();
//only undim if no other dialogs are visible
if ((0, _jquery2.default)('.aui-dialog:visible').length === 0) {
(0, _blanket.undim)();
}
// AUI-1059: remove focus from the active element when dialog is hidden
var activeElement = document.activeElement;
if (this.element.has(activeElement).length) {
activeElement.blur();
}
(0, _jquery2.default)(document).trigger('hideLayer', ['popup', this]);
createPopup.current = null;
this.enable();
},
/**
* jQuery object, representing popup DOM element
* @property element
*/
element: popup,
/**
* Removes popup elements from the DOM
* @method remove
*/
remove: function remove() {
popup.remove();
this.element = null;
},
/**
* disables the popup
* @method disable
*/
disable: function disable() {
if (!this.disabled) {
this.popupBlanket = (0, _jquery2.default)("<div class='dialog-blanket'> </div>").css({
height: popup.height(),
width: popup.width()
});
popup.append(this.popupBlanket);
this.disabled = true;
}
},
/**
* enables the popup if it is disabled
* @method enable
*/
enable: function enable() {
if (this.disabled) {
this.disabled = false;
this.popupBlanket.remove();
this.popupBlanket = null;
}
}
};
return res;
}
// Scoping function
var Dialog = function () {
/**
* @class Button
* @constructor Button
* @param page {number} page id
* @param label {string} button label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @private
*/
function Button(page, label, onclick, className) {
if (!page.buttonpanel) {
page.addButtonPanel();
}
this.page = page;
this.onclick = onclick;
this._onclick = function (e) {
return onclick.call(this, page.dialog, page, e) === true;
};
this.item = (0, _jquery2.default)('<button></button>').html(label).addClass('button-panel-button');
if (className) {
this.item.addClass(className);
}
if (typeof onclick === 'function') {
this.item.click(this._onclick);
}
page.buttonpanel.append(this.item);
this.id = page.button.length;
page.button[this.id] = this;
}
/**
* @class Link
* @constructor Link
* @param page {number} page id
* @param label {string} button label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @private
*/
function Link(page, label, onclick, className, url) {
if (!page.buttonpanel) {
page.addButtonPanel();
}
//if no url is given use # as default
if (!url) {
url = '#';
}
this.page = page;
this.onclick = onclick;
this._onclick = function (e) {
return onclick.call(this, page.dialog, page, e) === true;
};
this.item = (0, _jquery2.default)('<a></a>').html(label).attr('href', url).addClass('button-panel-link');
if (className) {
this.item.addClass(className);
}
if (typeof onclick === 'function') {
this.item.click(this._onclick);
}
page.buttonpanel.append(this.item);
this.id = page.button.length;
page.button[this.id] = this;
}
function itemMove(leftOrRight, target) {
var dir = leftOrRight == 'left' ? -1 : 1;
return function (step) {
var dtarget = this.page[target];
if (this.id != (dir == 1 ? dtarget.length - 1 : 0)) {
dir *= step || 1;
dtarget[this.id + dir].item[dir < 0 ? 'before' : 'after'](this.item);
dtarget.splice(this.id, 1);
dtarget.splice(this.id + dir, 0, this);
for (var i = 0, ii = dtarget.length; i < ii; i++) {
if (target == 'panel' && this.page.curtab == dtarget[i].id) {
this.page.curtab = i;
}
dtarget[i].id = i;
}
}
return this;
};
}
function itemRemove(target) {
return function () {
this.page[target].splice(this.id, 1);
for (var i = 0, ii = this.page[target].length; i < ii; i++) {
this.page[target][i].id = i;
}
this.item.remove();
};
}
/**
* Moves item left in the hierarchy
* @method moveUp
* @method moveLeft
* @param step {number} how many items to move, default is 1
* @return {object} button
*/
Button.prototype.moveUp = Button.prototype.moveLeft = itemMove('left', 'button');
/**
* Moves item right in the hierarchy
* @method moveDown
* @method moveRight
* @param step {number} how many items to move, default is 1
* @return {object} button
*/
Button.prototype.moveDown = Button.prototype.moveRight = itemMove('right', 'button');
/**
* Removes item
* @method remove
*/
Button.prototype.remove = itemRemove('button');
/**
* Getter and setter for label
* @method label
* @param label {string} [optional] label of the button
* @return {string} label, if nothing is passed in
* @return {object} jQuery button object, if label is passed in
*/
Button.prototype.html = function (label) {
return this.item.html(label);
};
/**
* Getter and setter of onclick event handler
* @method onclick
* @param onclick {function} [optional] new event handler, that is going to replace the old one
* @return {function} existing event handler if new one is undefined
*/
Button.prototype.onclick = function (onclick) {
var self = this;
if (typeof onclick === 'undefined') {
return this.onclick;
} else {
this.item.unbind('click', this._onclick);
this._onclick = function (e) {
return onclick.call(this, self.page.dialog, self.page, e) === true;
};
if (typeof onclick === 'function') {
this.item.click(this._onclick);
}
}
};
var DEFAULT_PADDING = 20;
/**
* Class for panels
* @class Panel
* @constructor
* @param page {number} page id
* @param title {string} panel title
* @param reference {string} or {object} jQuery object or selector for the contents of the Panel
* @param className {string} [optional] HTML class name
* @param panelButtonId {string} the unique id that will be put on the button element for this panel.
* @private
*/
var Panel = function Panel(page, title, reference, className, panelButtonId) {
if (!(reference instanceof _jquery2.default)) {
reference = (0, _jquery2.default)(reference);
}
this.dialog = page.dialog;
this.page = page;
this.id = page.panel.length;
this.button = (0, _jquery2.default)('<button></button>').html(title).addClass('item-button');
if (panelButtonId) {
this.button[0].id = panelButtonId;
}
this.item = (0, _jquery2.default)('<li></li>').append(this.button).addClass('page-menu-item');
this.body = (0, _jquery2.default)('<div></div>').append(reference).addClass('dialog-panel-body').css('height', page.dialog.height + 'px');
this.padding = DEFAULT_PADDING;
if (className) {
this.body.addClass(className);
}
var i = page.panel.length;
var tab = this;
page.menu.append(this.item);
page.body.append(this.body);
page.panel[i] = this;
var onclick = function onclick() {
var cur;
if (page.curtab + 1) {
cur = page.panel[page.curtab];
cur.body.hide();
cur.item.removeClass('selected');
typeof cur.onblur === 'function' && cur.onblur();
}
page.curtab = tab.id;
tab.body.show();
tab.item.addClass('selected');
typeof tab.onselect === 'function' && tab.onselect();
typeof page.ontabchange === 'function' && page.ontabchange(tab, cur);
};
if (!this.button.click) {
logger.log('atlassian-dialog:Panel:constructor - this.button.click false');
this.button.onclick = onclick;
} else {
this.button.click(onclick);
}
onclick();
if (i == 0) {
page.menu.css('display', 'none'); // don't use jQuery hide()
} else {
page.menu.show();
}
};
/**
* Selects current panel
* @method select
*/
Panel.prototype.select = function () {
this.button.click();
};
/**
* Moves item left in the hierarchy
* @method moveUp
* @method moveLeft
* @param step {number} how many items to move, default is 1
* @return {object} panel
*/
Panel.prototype.moveUp = Panel.prototype.moveLeft = itemMove('left', 'panel');
/**
* Moves item right in the hierarchy
* @method moveDown
* @method moveRight
* @param step {number} how many items to move, default is 1
* @return {object} panel
*/
Panel.prototype.moveDown = Panel.prototype.moveRight = itemMove('right', 'panel');
/**
* Removes item
* @method remove
*/
Panel.prototype.remove = itemRemove('panel');
/**
* Getter and setter of inner HTML of the panel
* @method html
* @param html {string} HTML source to set up
* @return {object} panel
* @return {string} current HTML source
*/
Panel.prototype.html = function (html) {
if (html) {
this.body.html(html);
return this;
} else {
return this.body.html();
}
};
/**
* This method gives you ability to overwrite default padding value. Use it with caution.
* @method setPadding
* @param padding {number} padding in pixels
* @return {object} panel
* @see DEFAULT_PADDING
*/
Panel.prototype.setPadding = function (padding) {
if (!isNaN(+padding)) {
this.body.css('padding', +padding);
this.padding = +padding;
this.page.recalcSize();
}
return this;
};
var HEADER_HEIGHT = 62;
var BUTTONS_HEIGHT = 52;
var MIN_DIALOG_VERTICAL_BUFFER = 50;
/**
* Class for pages
* @class Page
* @constructor
* @param dialog {object} dialog object
* @param className {string} [optional] HTML class name
* @private
*/
var Page = function Page(dialog, className) {
this.dialog = dialog;
this.id = dialog.page.length;
this.element = (0, _jquery2.default)('<div></div>').addClass('dialog-components');
this.body = (0, _jquery2.default)('<div></div>').addClass('dialog-page-body');
this.menu = (0, _jquery2.default)('<ul></ul>').addClass('dialog-page-menu').css('height', dialog.height + 'px');
this.body.append(this.menu);
this.curtab;
this.panel = [];
this.button = [];
if (className) {
this.body.addClass(className);
}
dialog.popup.element.append(this.element.append(this.menu).append(this.body));
dialog.page[dialog.page.length] = this;
};
/**
* Size updater for contents of the page. For internal use
* @method recalcSize
*/
Page.prototype.recalcSize = function () {
var headerHeight = this.header ? HEADER_HEIGHT : 0;
var buttonHeight = this.buttonpanel ? BUTTONS_HEIGHT : 0;
for (var i = this.panel.length; i--;) {
var dialogComponentsHeight = this.dialog.height - headerHeight - buttonHeight;
this.panel[i].body.css('height', dialogComponentsHeight);
this.menu.css('height', dialogComponentsHeight);
}
};
/**
* Adds a button panel to the bottom of dialog
* @method addButtonPanel
*/
Page.prototype.addButtonPanel = function () {
this.buttonpanel = (0, _jquery2.default)('<div></div>').addClass('dialog-button-panel');
this.element.append(this.buttonpanel);
};
/**
* Method for adding new panel to the page
* @method addPanel
* @param title {string} panel title
* @param reference {string} or {object} jQuery object or selector for the contents of the Panel
* @param className {string} [optional] HTML class name
* @param panelButtonId {string} [optional] The unique id for the panel's button.
* @return {object} the page
*/
Page.prototype.addPanel = function (title, reference, className, panelButtonId) {
new Panel(this, title, reference, className, panelButtonId);
this.recalcSize();
return this;
};
/**
* Method for adding header to the page
* @method addHeader
* @param title {string} panel title
* @param className {string} [optional] CSS class name
* @return {object} the page
*/
Page.prototype.addHeader = function (title, className) {
if (this.header) {
this.header.remove();
}
this.header = (0, _jquery2.default)('<h2></h2>').text(title || '').addClass('dialog-title');
className && this.header.addClass(className);
this.element.prepend(this.header);
this.recalcSize();
return this;
};
/**
* Method for adding new button to the page
* @method addButton
* @param label {string} button label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @return {object} the page
*/
Page.prototype.addButton = function (label, onclick, className) {
new Button(this, label, onclick, className);
this.recalcSize();
return this;
};
/**
* Method for adding new link to the page
* @method addLink
* @param label {string} button label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @return {object} the page
*/
Page.prototype.addLink = function (label, onclick, className, url) {
new Link(this, label, onclick, className, url);
this.recalcSize();
return this;
};
/**
* Selects corresponding panel
* @method gotoPanel
* @param panel {object} panel object
* @param panel {number} id of the panel
*/
Page.prototype.gotoPanel = function (panel) {
this.panel[panel.id || panel].select();
};
/**
* Returns current panel on the page
* @method getCurrentPanel
* @return panel {object} the panel
*/
Page.prototype.getCurrentPanel = function () {
return this.panel[this.curtab];
};
/**
* Hides the page
* @method hide
*/
Page.prototype.hide = function () {
this.element.hide();
};
/**
* Shows the page, if it was hidden
* @method show
*/
Page.prototype.show = function () {
this.element.show();
};
/**
* Removes the page
* @method remove
*/
Page.prototype.remove = function () {
this.element.remove();
};
/**
* Constructor for a Dialog. A Dialog is a popup which consists of Pages, where each Page can consist of Panels,
* Buttons and a Header. The dialog must be constructed in page order as it has a current page state. For example,
* calling addButton() will add a button to the 'current' page.
* <p>
* By default, a new Dialog will have one page. If there are multiple Panels on a Page, a
* menu is displayed on the left side of the dialog.
* </p>
* Usage:
* <pre>
* var dialog = new Dialog(860, 530);
* dialog.addHeader("Insert Macro")
* .addPanel("All", "<p></p>")
* .addPanel("Some", "<p></p>")
* .addButton("Next", function (dialog) {dialog.nextPage();})
* .addButton("Cancel", function (dialog) {dialog.hide();});
*
* dialog.addPage()
* .addButton("Cancel", function (dialog) {dialog.hide();});
*
* somebutton.click(function () {dialog.show();});
* </pre>
* @class Dialog
* @constructor
* @param width {number} dialog width in pixels, or an object containing the Dialog parameters
* @param height {number} dialog height in pixels
* @param id {number} [optional] dialog id
*/
function Dialog(width, height, id) {
var options = {};
if (!+width) {
options = Object(width);
width = options.width;
height = options.height;
id = options.id;
}
this.height = height || 480;
this.width = width || 640;
this.id = id;
options = _jquery2.default.extend({}, options, {
width: this.width,
height: this.height,
id: this.id
});
this.popup = createPopup(options);
this.popup.element.addClass('aui-dialog');
this.page = [];
this.curpage = 0;
new Page(this);
};
/**
* Method for adding header to the current page
* @method addHeader
* @param title {string} panel title
* @param className {string} [optional] HTML class name
* @return {object} the dialog
*/
Dialog.prototype.addHeader = function (title, className) {
this.page[this.curpage].addHeader(title, className);
return this;
};
/**
* Method for adding new button to the current page
* @method addButton
* @param label {string} button label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @return {object} the dialog
*/
Dialog.prototype.addButton = function (label, onclick, className) {
this.page[this.curpage].addButton(label, onclick, className);
return this;
};
/**
* Method for adding new link to the current page
* @method addButton
* @param label {string} link label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @return {object} the dialog
*/
Dialog.prototype.addLink = function (label, onclick, className, url) {
this.page[this.curpage].addLink(label, onclick, className, url);
return this;
};
/**
* Method for adding a submit button to the current page
* @method addSubmit
* @param label {string} link label
* @param onclick {function} [optional] click event handler
* @return {object} the dialog
*/
Dialog.prototype.addSubmit = function (label, onclick) {
this.page[this.curpage].addButton(label, onclick, 'button-panel-submit-button');
return this;
};
/**
* Method for adding a cancel link to the current page
* @method addCancel
* @param label {string} link label
* @param onclick {function} [optional] click event handler
* @return {object} the dialog
*/
Dialog.prototype.addCancel = function (label, onclick) {
this.page[this.curpage].addLink(label, onclick, 'button-panel-cancel-link');
return this;
};
/**
* Method for adding new button panel to the current page
* @return {object} the dialog
*/
Dialog.prototype.addButtonPanel = function () {
this.page[this.curpage].addButtonPanel();
return this;
};
/**
* Method for adding new panel to the current page.
* @method addPanel
* @param title {string} panel title
* @param reference {string} or {object} jQuery object or selector for the contents of the Panel
* @param className {string} [optional] HTML class name
* @param panelButtonId {String} [optional] The unique id for the panel's button.
* @return {object} the dialog
*/
Dialog.prototype.addPanel = function (title, reference, className, panelButtonId) {
this.page[this.curpage].addPanel(title, reference, className, panelButtonId);
return this;
};
/**
* Adds a new page to the dialog and sets the new page as the current page
* @method addPage
* @param className {string} [optional] HTML class name
* @return {object} the dialog
*/
Dialog.prototype.addPage = function (className) {
new Page(this, className);
this.page[this.curpage].hide();
this.curpage = this.page.length - 1;
return this;
};
/**
* Making next page in hierarchy visible and active
* @method nextPage
* @return {object} the dialog
*/
Dialog.prototype.nextPage = function () {
this.page[this.curpage++].hide();
if (this.curpage >= this.page.length) {
this.curpage = 0;
}
this.page[this.curpage].show();
return this;
};
/**
* Making previous page in hierarchy visible and active
* @method prevPage
* @return {object} the dialog
*/
Dialog.prototype.prevPage = function () {
this.page[this.curpage--].hide();
if (this.curpage < 0) {
this.curpage = this.page.length - 1;
}
this.page[this.curpage].show();
return this;
};
/**
* Making specified page visible and active
* @method gotoPage
* @param num {number} page id
* @return {object} the dialog
*/
Dialog.prototype.gotoPage = function (num) {
this.page[this.curpage].hide();
this.curpage = num;
if (this.curpage < 0) {
this.curpage = this.page.length - 1;
} else if (this.curpage >= this.page.length) {
this.curpage = 0;
}
this.page[this.curpage].show();
return this;
};
/**
* Returns specified panel at the current page
* @method getPanel
* @param pageorpanelId {number} page id or panel id
* @param panelId {number} panel id
* @return {object} the internal Panel object
*/
Dialog.prototype.getPanel = function (pageorpanelId, panelId) {
var pageid = panelId == null ? this.curpage : pageorpanelId;
if (panelId == null) {
panelId = pageorpanelId;
}
return this.page[pageid].panel[panelId];
};
/**
* Returns specified page
* @method getPage
* @param pageid {number} page id
* @return {object} the internal Page Object
*/
Dialog.prototype.getPage = function (pageid) {
return this.page[pageid];
};
/**
* Returns current panel at the current page
* @method getCurrentPanel
* @return {object} the internal Panel object
*/
Dialog.prototype.getCurrentPanel = function () {
return this.page[this.curpage].getCurrentPanel();
};
/**
* Selects corresponding panel
* @method gotoPanel
* @param pageorpanel {object} panel object or page object
* @param panel {object} panel object
* @param panel {number} id of the panel
*/
Dialog.prototype.gotoPanel = function (pageorpanel, panel) {
if (panel != null) {
var pageid = pageorpanel.id || pageorpanel;
this.gotoPage(pageid);
}
this.page[this.curpage].gotoPanel(typeof panel === 'undefined' ? pageorpanel : panel);
};
/**
* Shows the dialog, if it is not visible
* @method show
* @return {object} the dialog
*/
Dialog.prototype.show = function () {
this.popup.show();
(0, _event.trigger)('show.dialog', { dialog: this });
return this;
};
/**
* Hides the dialog, if it was visible
* @method hide
* @return {object} the dialog
*/
Dialog.prototype.hide = function () {
this.popup.hide();
(0, _event.trigger)('hide.dialog', { dialog: this });
return this;
};
/**
* Removes the dialog elements from the DOM
* @method remove
*/
Dialog.prototype.remove = function () {
this.popup.hide();
this.popup.remove();
(0, _event.trigger)('remove.dialog', { dialog: this });
};
/**
* Disables the dialog if enabled
* @method disable
*/
Dialog.prototype.disable = function () {
this.popup.disable();
return this;
};
/**
* Enables the dialog if disabled
* @method disable
*/
Dialog.prototype.enable = function () {
this.popup.enable();
return this;
};
/**
* Gets set of items depending on query
* @method get
* @param query {string} query to search for panels, pages, headers or buttons
* e.g.
* '#Name' will find all dialog components with the given name such as panels and buttons, etc
* 'panel#Name' will find only panels with the given name
* 'panel#"Foo bar"' will find only panels with given name
* 'panel:3' will find the third panel
*/
Dialog.prototype.get = function (query) {
var coll = [];
var dialog = this;
var nameExp = '#([^"][^ ]*|"[^"]*")'; // a name is a hash followed by either a bare word or quoted string
var indexExp = ':(\\d+)'; // an index is a colon followed by some digits
var typeExp = 'page|panel|button|header'; // one of the allowed types
var selectorExp = '(?:' + // a selector is either ...
'(' + typeExp + ')(?:' + nameExp + '|' + indexExp + ')?' + // a type optionally followed by either #name or :index
'|' + nameExp + // or just a #name
')';
var queryRE = new RegExp('(?:^|,)' + // a comma or at the start of the line
'\\s*' + selectorExp + // optional space and a selector
'(?:\\s+' + selectorExp + ')?' + // optionally, followed by some space and a second selector
'\\s*(?=,|$)', 'ig'); // followed by, but not including, a comma or the end of the string
(query + '').replace(queryRE, function (all, name, title, id, justtitle, name2, title2, id2, justtitle2) {
name = name && name.toLowerCase();
var pages = [];
if (name == 'page' && dialog.page[id]) {
pages.push(dialog.page[id]);
name = name2;
name = name && name.toLowerCase();
title = title2;
id = id2;
justtitle = justtitle2;
} else {
pages = dialog.page;
}
title = title && (title + '').replace(/"/g, '');
title2 = title2 && (title2 + '').replace(/"/g, '');
justtitle = justtitle && (justtitle + '').replace(/"/g, '');
justtitle2 = justtitle2 && (justtitle2 + '').replace(/"/g, '');
if (name || justtitle) {
for (var i = pages.length; i--;) {
if (justtitle || name == 'panel' && (title || !title && id == null)) {
for (var j = pages[i].panel.length; j--;) {
if (pages[i].panel[j].button.html() == justtitle || pages[i].panel[j].button.html() == title || name == 'panel' && !title && id == null) {
coll.push(pages[i].panel[j]);
}
}
}
if (justtitle || name == 'button' && (title || !title && id == null)) {
for (var j = pages[i].button.length; j--;) {
if (pages[i].button[j].item.html() == justtitle || pages[i].button[j].item.html() == title || name == 'button' && !title && id == null) {
coll.push(pages[i].button[j]);
}
}
}
if (pages[i][name] && pages[i][name][id]) {
coll.push(pages[i][name][id]);
}
if (name == 'header' && pages[i].header) {
coll.push(pages[i].header);
}
}
} else {
coll = coll.concat(pages);
}
});
var res = {
length: coll.length
};
for (var i = coll.length; i--;) {
res[i] = coll[i];
for (var method in coll[i]) {
if (!(method in res)) {
(function (m) {
res[m] = function () {
for (var j = this.length; j--;) {
if (typeof this[j][m] === 'function') {
this[j][m].apply(this[j], arguments);
}
}
};
})(method);
}
}
}
return res;
};
/**
* Updates height of panels, to contain content without the need for scroll bars.
*
* @method updateHeight
*/
Dialog.prototype.updateHeight = function () {
var height = 0;
var maxDialogHeight = (0, _jquery2.default)(window).height() - HEADER_HEIGHT - BUTTONS_HEIGHT - MIN_DIALOG_VERTICAL_BUFFER * 2;
for (var i = 0; this.getPanel(i); i++) {
if (this.getPanel(i).body.css({ height: 'auto', display: 'block' }).outerHeight() > height) {
height = Math.min(maxDialogHeight, this.getPanel(i).body.outerHeight());
}
if (i !== this.page[this.curpage].curtab) {
this.getPanel(i).body.css({ display: 'none' });
}
}
for (i = 0; this.getPanel(i); i++) {
this.getPanel(i).body.css({ height: height || this.height });
}
this.page[0].menu.height(height);
this.height = height + HEADER_HEIGHT + BUTTONS_HEIGHT + 1;
this.popup.changeSize(undefined, this.height);
};
/**
* Returns whether the dialog has been resized to it's maximum height (has been capped by the viewport height and vertical buffer).
*
* @method isMaximised
*/
Dialog.prototype.isMaximised = function () {
return this.popup.element.outerHeight() >= (0, _jquery2.default)(window).height() - MIN_DIALOG_VERTICAL_BUFFER * 2;
};
/**
* Returns the current panel.
* @deprecated Since 3.0.1 Use getCurrentPanel() instead.
*/
Dialog.prototype.getCurPanel = function () {
return this.getPanel(this.page[this.curpage].curtab);
};
/**
* Returns the current button panel.
* @deprecated Since 3.0.1 Use get() instead.
*/
Dialog.prototype.getCurPanelButton = function () {
return this.getCurPanel().button;
};
return Dialog;
}();
exports.Dialog = Dialog = deprecate.construct(Dialog, 'Dialog constructor', {
alternativeName: 'Dialog2'
});
exports.popup = createPopup = deprecate.construct(createPopup, 'Dialog popup constructor', {
alternatveName: 'Dialog2'
});
(0, _globalize2.default)('Dialog', Dialog);
(0, _globalize2.default)('popup', createPopup);
exports.Dialog = Dialog;
exports.popup = createPopup;
return module.exports;
}).call(this);
// src/js/aui/clone.js
(typeof window === 'undefined' ? global : window).__b8528e770b80bbc69c4f6b442e55b068 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Clones the element specified by the selector and removes the id attribute.
*
* @param {String} selector A jQuery selector
*/
function clone(selector) {
return (0, _jquery2.default)(selector).clone().removeAttr('id');
}
(0, _globalize2.default)('clone', clone);
exports.default = clone;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/attributes.js
(typeof window === 'undefined' ? global : window).__12a1bdd49804fd32f5af784a6748a2cb = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.computeBooleanValue = computeBooleanValue;
exports.setBooleanAttribute = setBooleanAttribute;
exports.computeEnumValue = computeEnumValue;
exports.setEnumAttribute = setEnumAttribute;
/**
* Like el.hasAttribute(attr) but designed for use within a skate attribute
* change handler where you only have access to change.oldValue.
*/
function computeBooleanValue(attrValue) {
return attrValue !== null;
}
function setBooleanAttribute(el, attr, newValue) {
if (newValue) {
el.setAttribute(attr, '');
} else {
el.removeAttribute(attr);
}
}
function computeEnumValue(enumOptions, value) {
var matchesEnumValue = function matchesEnumValue(enumValue) {
return enumValue.toLowerCase() === value.toLowerCase();
};
var isMissing = value === null;
var isInvalid = !isMissing && !enumOptions.values.filter(matchesEnumValue).length;
if (isMissing) {
if (enumOptions.hasOwnProperty('missingDefault')) {
return enumOptions.missingDefault;
}
return null;
}
if (isInvalid) {
if (enumOptions.hasOwnProperty('invalidDefault')) {
return enumOptions.invalidDefault;
} else if (enumOptions.hasOwnProperty('missingDefault')) {
return enumOptions.missingDefault;
}
return null;
}
return enumOptions.values.length ? enumOptions.values.filter(matchesEnumValue)[0] : null;
}
function setEnumAttribute(el, enumOptions, newValue) {
el.setAttribute(enumOptions.attribute, newValue);
}
/**
* Helper functions useful for implementing reflected boolean and enumerated
* attributes and properties.
*
* @see https://html.spec.whatwg.org/multipage/infrastructure.html#reflecting-content-attributes-in-idl-attributes
* @see https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attribute
* @see https://html.spec.whatwg.org/multipage/infrastructure.html#enumerated-attribute
*/
exports.default = {
computeBooleanValue: computeBooleanValue,
setBooleanAttribute: setBooleanAttribute,
computeEnumValue: computeEnumValue,
setEnumAttribute: setEnumAttribute
};
return module.exports;
}).call(this);
// src/js/aui/internal/header/create-header.js
(typeof window === 'undefined' ? global : window).__393229f5a07222d0bb991a5cfe1a0a41 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _customEvent = __a61ca8be187b18bfa5c93cf8ff929ee5;
var _customEvent2 = _interopRequireDefault(_customEvent);
var _debounce = __8cd9ff0a19109fb463ce91f349330abb;
var _debounce2 = _interopRequireDefault(_debounce);
var _i18n = __ed74109c4e727b6405515053222f381b;
var _i18n2 = _interopRequireDefault(_i18n);
var _skate = __f3781475eb0bf3a02085f171842f7c4c;
var _skate2 = _interopRequireDefault(_skate);
var _skatejsTemplateHtml = __23921246870221a1cfaf9dc62cd3cb19;
var _skatejsTemplateHtml2 = _interopRequireDefault(_skatejsTemplateHtml);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var $window = (0, _jquery2.default)(window);
function Header(element) {
var that = this;
this.element = element;
this.$element = (0, _jquery2.default)(element);
this.index = (0, _jquery2.default)('aui-header, .aui-header').index(element);
this.$secondaryNav = this.$element.find('.aui-header-secondary .aui-nav').first();
this.menuItems = [];
this.totalWidth = 0;
this.$moreMenu = undefined;
this.rightMostNavItemIndex = undefined;
this.$applicationLogo = this.$element.find('#logo');
this.moreMenuWidth = 0;
this.primaryButtonsWidth = 0;
// to cache the selector and give .find convenience
this.$headerFind = function () {
var $header = (0, _jquery2.default)(that.$element[0].querySelector('.aui-header-primary'));
return function (selector) {
return $header.find(selector);
};
}();
}
Header.prototype = {
init: function init() {
var that = this;
this.element.setAttribute('data-aui-responsive', 'true');
this.$headerFind('.aui-button').parent().each(function () {
that.primaryButtonsWidth += (0, _jquery2.default)(this).outerWidth(true);
});
// remember the widths of all the menu items
this.$headerFind('.aui-nav > li > a:not(.aui-button)').each(function () {
var $this = (0, _jquery2.default)(this).parent();
var outerWidth = $this.outerWidth(true);
that.totalWidth += outerWidth;
that.menuItems.push({
$element: $this,
outerWidth: outerWidth
});
});
/** The zero based index of the right-most visible nav menu item. */
this.rightMostNavItemIndex = this.menuItems.length - 1;
$window.on('resize', this._resizeHandler = (0, _debounce2.default)(function () {
that.constructResponsiveDropdown();
}, 100));
// So that the header logo doesn't mess things up. (size is unknown before the image loads)
var $logoImg = this.$applicationLogo.find('img');
if ($logoImg.length !== 0) {
$logoImg.attr('data-aui-responsive-header-index', this.index);
$logoImg.on('load', function () {
that.constructResponsiveDropdown();
});
}
this.constructResponsiveDropdown();
// show the aui nav (hidden via css on load)
this.$headerFind('.aui-nav').css('width', 'auto');
},
destroy: function destroy() {
$window.off('resize', this._resizeHandler);
},
// calculate widths based on the current state of the page
calculateAvailableWidth: function calculateAvailableWidth() {
// if there is no secondary nav, use the right of the screen as the boundary instead
var rightMostBoundary = this.$secondaryNav.is(':visible') ? this.$secondaryNav.offset().left : this.$element.outerWidth();
// the right most side of the primary nav, this is assumed to exists if this code is running
var primaryNavRight = this.$applicationLogo.offset().left + this.$applicationLogo.outerWidth(true) + this.primaryButtonsWidth;
return rightMostBoundary - primaryNavRight;
},
showResponsiveDropdown: function showResponsiveDropdown() {
if (this.$moreMenu === undefined) {
this.$moreMenu = this.createResponsiveDropdownTrigger();
}
this.$moreMenu.css('display', '');
},
hideResponsiveDropdown: function hideResponsiveDropdown() {
if (this.$moreMenu !== undefined) {
this.$moreMenu.css('display', 'none');
}
},
constructResponsiveDropdown: function constructResponsiveDropdown() {
if (!this.menuItems.length) {
return;
}
var remainingWidth;
var availableWidth = this.calculateAvailableWidth(this.$element, this.primaryButtonsWidth);
if (availableWidth > this.totalWidth) {
this.showAll();
} else {
this.showResponsiveDropdown();
remainingWidth = availableWidth - this.moreMenuWidth;
// Figure out how many nav menu items fit into the available space.
var newRightMostNavItemIndex = -1;
while (remainingWidth - this.menuItems[newRightMostNavItemIndex + 1].outerWidth >= 0) {
remainingWidth -= this.menuItems[newRightMostNavItemIndex + 1].outerWidth;
newRightMostNavItemIndex++;
}
if (newRightMostNavItemIndex < this.rightMostNavItemIndex) {
this.moveToResponsiveDropdown(this.rightMostNavItemIndex - newRightMostNavItemIndex);
} else if (this.rightMostNavItemIndex < newRightMostNavItemIndex) {
this.moveOutOfResponsiveDropdown(newRightMostNavItemIndex - this.rightMostNavItemIndex);
}
}
},
// creates the trigger and content elements for the show more dropdown
createResponsiveDropdownTrigger: function createResponsiveDropdownTrigger() {
var moreNavItemEl = document.createElement('li');
var dropdownEl = document.createElement('aui-dropdown-menu');
dropdownEl.id = 'aui-responsive-header-dropdown-' + this.index;
_skate2.default.init(dropdownEl);
var dropdownSectionEl = document.createElement('aui-section');
dropdownSectionEl.id = 'aui-responsive-header-dropdown-list-' + this.index;
_skate2.default.init(dropdownSectionEl);
_skatejsTemplateHtml2.default.wrap(dropdownEl).appendChild(dropdownSectionEl);
var triggerEl = createTriggerAndAssociate(dropdownEl);
moreNavItemEl.appendChild(triggerEl);
moreNavItemEl.appendChild(dropdownEl);
// Append the More menu before any primary buttons.
if (this.primaryButtonsWidth === 0) {
this.$headerFind('.aui-nav').append(moreNavItemEl);
} else {
this.$headerFind('.aui-nav > li > .aui-button:first').parent().before(moreNavItemEl);
}
this.moreMenuWidth = (0, _jquery2.default)(moreNavItemEl).outerWidth(true);
return (0, _jquery2.default)(moreNavItemEl);
},
// function that handles moving items out of the show more menu into the app header
moveOutOfResponsiveDropdown: function moveOutOfResponsiveDropdown(numItems) {
if (numItems <= 0) {
return;
}
var $moreDropdown = (0, _jquery2.default)('#aui-responsive-header-dropdown-' + this.index);
// Move items (working top-to-bottom) from the more menu into the nav bar.
var leftMostIndexToMove = this.rightMostNavItemIndex + 1;
var rightMostIndexToMove = this.rightMostNavItemIndex + numItems;
for (var i = leftMostIndexToMove; i <= rightMostIndexToMove; i++) {
var $navItem = this.menuItems[i].$element;
var $navItemTrigger = $navItem.children('a');
if ($navItemTrigger.attr('aria-controls')) {
var $navItemDropdown = (0, _jquery2.default)(document.getElementById($navItemTrigger.attr('aria-controls')));
$navItemDropdown.removeClass('aui-dropdown2-sub-menu');
$navItem.append($navItemDropdown);
}
$moreDropdown.find('aui-item-link:first').remove();
$navItem.insertBefore(this.$moreMenu);
}
this.rightMostNavItemIndex += numItems;
},
// function that handles moving items into the show more menu
moveToResponsiveDropdown: function moveToResponsiveDropdown(numItems) {
if (numItems <= 0) {
return;
}
var moreDropdownSectionEl = _skatejsTemplateHtml2.default.wrap(this.$moreMenu[0].querySelector('aui-section'));
// Move items (working right-to-left) from the nav bar to the more menu.
var rightMostIndexToMove = this.rightMostNavItemIndex;
var leftMostIndexToMove = this.rightMostNavItemIndex - numItems + 1;
for (var i = rightMostIndexToMove; i >= leftMostIndexToMove; i--) {
var $navItem = this.menuItems[i].$element;
var $navItemTrigger = $navItem.children('a');
_skate2.default.init($navItemTrigger); // ensure all triggers have gone through their lifecycle before we check for submenus
var moreDropdownItemEl = document.createElement('aui-item-link');
moreDropdownItemEl.setAttribute('href', $navItemTrigger.attr('href'));
if ($navItemTrigger.attr('aria-controls')) {
var $navItemDropdown = (0, _jquery2.default)(document.getElementById($navItemTrigger.attr('aria-controls')));
moreDropdownItemEl.setAttribute('for', $navItemTrigger.attr('aria-controls'));
$navItemDropdown.addClass('aui-dropdown2-sub-menu');
$navItemDropdown.appendTo('body');
}
_skate2.default.init(moreDropdownItemEl);
_skatejsTemplateHtml2.default.wrap(moreDropdownItemEl).textContent = $navItemTrigger.text();
$navItem.detach();
moreDropdownSectionEl.insertBefore(moreDropdownItemEl, moreDropdownSectionEl.firstChild);
this.element.dispatchEvent(new _customEvent2.default('aui-responsive-menu-item-created', {
bubbles: true,
detail: {
originalItem: $navItem[0],
newItem: moreDropdownItemEl
}
}));
}
this.rightMostNavItemIndex -= numItems;
},
// function that handles show everything
showAll: function showAll() {
this.moveOutOfResponsiveDropdown(this.menuItems.length - 1 - this.rightMostNavItemIndex);
this.hideResponsiveDropdown();
}
};
function createTriggerAndAssociate(dropdown) {
var trigger = document.createElement('a');
trigger.setAttribute('class', 'aui-dropdown2-trigger');
trigger.setAttribute('href', '#');
trigger.id = dropdown.id + '-trigger';
trigger.setAttribute('aria-controls', dropdown.id);
trigger.innerHTML = _i18n2.default.getText('aui.words.more');
return trigger;
}
/**
* Initialise a Header, or return an existing Header for an element.
*/
function createHeader(element) {
var header = element._header;
if (!(header instanceof Header)) {
header = new Header(element);
header.init();
element._header = header;
}
return header;
}
exports.default = createHeader;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/polyfills/console.js
(typeof window === 'undefined' ? global : window).__53c6c96a5afecd28dfe14aa069c01614 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
/**
* AUI-2773
*
* The following shim for console is deprecated and to be removed in AUI 6.
* We shouldn't be creating console.log if it doesn't exist; instead, we should avoid using it directly.
* @start deprecated
*/
if (typeof window.console === 'undefined') {
window.console = {
messages: [],
log: function log(text) {
this.messages.push(text);
},
show: function show() {
alert(this.messages.join('\n'));
this.messages = [];
}
};
} else {
// Firebug console - show not required to do anything.
window.console.show = function () {};
}
return module.exports;
}).call(this);
// src/js/aui/binder.js
(typeof window === 'undefined' ? global : window).__d25d10be2eae686af96552a0229cd9b0 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var deprecate = _interopRequireWildcard(_deprecation);
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Support for markup based binder components. Binder components must be objects with the following "interface":
*
* <pre>
* {
* selector: "input.foo",
* run: function(element) {
* //do stuff on given element
* }
* }
* </pre>
*/
var Binder = function () {
var binders = {};
return {
/**
* Runs all the binder components for the given scope, or the document body if none specified.
*
* @method runBinders
* @param scope {Element} element scope to run the binders in
*/
runBinders: function runBinders(scope) {
if (_jquery2.default.isEmptyObject(binders)) {
logger.log('No binders to run');
return;
}
scope = scope || document.body;
(0, _jquery2.default)('*:not(link, script)', scope).each(function (i, element) {
var $element = (0, _jquery2.default)(element);
_jquery2.default.each(binders, function (id, binder) {
if (!$element.data(id) && $element.is(binder.selector)) {
logger.log('Running binder component: ' + id + ' on element ' + element);
$element.data(id, true); // so we don't bind to the same element again later
binder.run(element);
}
});
});
},
/**
* Register a binder component with the given id.
* @method register
*/
register: function register(id, binder) {
binders[id] = binder;
},
/**
* Unregister a binder component for the given id.
* @method unregister
*/
unregister: function unregister(id) {
binders[id] = null;
}
};
}();
Binder = deprecate.construct(Binder, 'Binder', {
sinceVersion: '5.8.0'
});
(0, _globalize2.default)('Binder', Binder);
exports.default = Binder;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/binders/placeholder.js
(typeof window === 'undefined' ? global : window).__dc6375b3ff483224e2622da6d1d221ab = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _binder = __d25d10be2eae686af96552a0229cd9b0;
var _binder2 = _interopRequireDefault(_binder);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
(function () {
// browser supports placeholder, no need to do anything
var temp = document.createElement('input');
if ('placeholder' in temp) {
return;
}
/**
* Displays default text in the input field when its value is empty.
* If the browser supports placeholder input attributes (HTML5), then
* we skip this component.
*
* Usage:
* <pre>
* <input placeholder='Some default text'>
* </pre>
*
* Events thrown: reset.placeholder
*/
_binder2.default.register('placeholder', {
selector: 'input[placeholder]',
run: function run(element) {
var $this = (0, _jquery2.default)(element);
var applyDefaultText = function applyDefaultText() {
if (!_jquery2.default.trim($this.val()).length) {
$this.val($this.attr('placeholder')).addClass('placeholder-shown').trigger('reset.placeholder');
}
};
applyDefaultText();
$this.blur(applyDefaultText).focus(function () {
if ($this.hasClass('placeholder-shown')) {
$this.val('').removeClass('placeholder-shown');
}
});
}
});
})();
return module.exports;
}).call(this);
// src/js/jquery/jquery.os.js
(typeof window === 'undefined' ? global : window).__9220dc8b32b65dc265679e74ba01c583 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
jQuery.os = {};
(function () {
var platform = navigator.platform.toLowerCase();
jQuery.os.windows = platform.indexOf('win') != -1;
jQuery.os.mac = platform.indexOf('mac') != -1;
jQuery.os.linux = platform.indexOf('linux') != -1;
})();
return module.exports;
}).call(this);
// src/js/jquery/jquery.moveto.js
(typeof window === 'undefined' ? global : window).__69d030f47706d4a278feaf7f00d142f5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
/**
*
* @module Controls
* @requires AJS, jQuery
*/
/**
* If not visible, moves the scroll position of the screen to the element
*
* <pre>
* <strong>Usage:</strong>
* jQuery("li.item").moveTo();
* </pre>
*
* This plugin also supports options as an argument. The options
* that can be defined are:
* <ul>
* <li>transition - if set to true will cause a smooth scrolling transition (false by default)</li>
* <li>scrollOffset - defines an offset to scroll past the element to view in pixels such that
* all of it can be viewed (35 pixels by default)</li>
* </ul>
*
* @class moveTo
* @constuctor moveTo
* @namespace jQuery.fn
* @param {Object} options
*/
jQuery.fn.moveTo = function (options) {
var defaults = {
transition: false,
scrollOffset: 35
};
var opts = jQuery.extend(defaults, options);
var instance = this;
var topOffset = instance.offset().top;
var scrollTarget;
if ((jQuery(window).scrollTop() + jQuery(window).height() - this.outerHeight() < topOffset || jQuery(window).scrollTop() + opts.scrollOffset > topOffset) && jQuery(window).height() > opts.scrollOffset) {
if (jQuery(window).scrollTop() + opts.scrollOffset > topOffset) {
//move up
scrollTarget = topOffset - (jQuery(window).height() - this.outerHeight()) + opts.scrollOffset;
} else {
//move down
scrollTarget = topOffset - opts.scrollOffset;
}
if (!jQuery.fn.moveTo.animating && opts.transition) {
jQuery(document).trigger('moveToStarted', this);
jQuery.fn.moveTo.animating = true;
jQuery('html,body').animate({
scrollTop: scrollTarget
}, 1000, function () {
jQuery(document).trigger('moveToFinished', instance);
delete jQuery.fn.moveTo.animating;
});
return this;
} else {
var jQueryCache = jQuery('html, body');
if (jQueryCache.is(':animated')) {
jQueryCache.stop();
delete jQuery.fn.moveTo.animating;
}
jQuery(document).trigger('moveToStarted');
jQuery(window).scrollTop(scrollTarget);
//need to put a slight timeout for the moveToFinished event such that recipients of this event
//have time to act on it.
setTimeout(function () {
jQuery(document).trigger('moveToFinished', instance);
}, 100);
return this;
}
}
jQuery(document).trigger('moveToFinished', this);
return this;
};
return module.exports;
}).call(this);
// src/js/aui/cookie.js
(typeof window === 'undefined' ? global : window).__13bd581224edb4c91ecf99398f71c33b = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.save = exports.read = exports.erase = undefined;
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var deprecate = _interopRequireWildcard(_deprecation);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var COOKIE_NAME = 'AJS.conglomerate.cookie';
var UNESCAPE_COOKIE_REGEX = /(\\|^"|"$)/g;
var CONSECUTIVE_PIPE_CHARS_REGEX = /\|\|+/g;
var ANY_QUOTE_REGEX = /"/g;
var REGEX_SPECIAL_CHARS = /[.*+?|^$()[\]{\\]/g;
function regexEscape(str) {
return str.replace(REGEX_SPECIAL_CHARS, '\\$&');
}
function getValueFromConglomerate(name, cookieValue) {
// A null cookieValue is just the first time through so create it.
cookieValue = cookieValue || '';
var reg = new RegExp(regexEscape(name) + '=([^|]+)');
var res = cookieValue.match(reg);
return res && res[1];
}
// Either append or replace the value in the cookie string/
function addOrAppendToValue(name, value, cookieValue) {
// A cookie name follows after any amount of white space mixed with any amount of '|' characters.
// A cookie value is preceded by '=', then anything except for '|'.
var reg = new RegExp('(\\s|\\|)*\\b' + regexEscape(name) + '=[^|]*[|]*');
cookieValue = cookieValue || '';
cookieValue = cookieValue.replace(reg, '|');
if (value !== '') {
var pair = name + '=' + value;
if (cookieValue.length + pair.length < 4020) {
cookieValue += '|' + pair;
}
}
return cookieValue.replace(CONSECUTIVE_PIPE_CHARS_REGEX, '|');
}
function unescapeCookieValue(name) {
return name.replace(UNESCAPE_COOKIE_REGEX, '');
}
function getCookieValue(name) {
var reg = new RegExp('\\b' + regexEscape(name) + '=((?:[^\\\\;]+|\\\\.)*)(?:;|$)');
var res = document.cookie.match(reg);
return res && unescapeCookieValue(res[1]);
}
function saveCookie(name, value, days) {
var ex = '';
var d;
var quotedValue = '"' + value.replace(ANY_QUOTE_REGEX, '\\"') + '"';
if (days) {
d = new Date();
d.setTime(+d + days * 24 * 60 * 60 * 1000);
ex = '; expires=' + d.toGMTString();
}
document.cookie = name + '=' + quotedValue + ex + ';path=/';
}
/**
* Save a cookie.
* @param name {String} name of cookie
* @param value {String} value of cookie
* @param expires {Number} number of days before cookie expires
*/
function save(name, value, expires) {
var cookieValue = getCookieValue(COOKIE_NAME);
cookieValue = addOrAppendToValue(name, value, cookieValue);
saveCookie(COOKIE_NAME, cookieValue, expires || 365);
}
/**
* Get the value of a cookie.
* @param name {String} name of cookie to read
* @param defaultValue {String} the default value of the cookie to return if not found
*/
function read(name, defaultValue) {
var cookieValue = getCookieValue(COOKIE_NAME);
var value = getValueFromConglomerate(name, cookieValue);
if (value != null) {
return value;
}
return defaultValue;
}
/**
* Remove the given cookie.
* @param name {String} the name of the cookie to remove
*/
function erase(name) {
save(name, '');
}
var cookie = {
erase: erase,
read: read,
save: save
};
(0, _globalize2.default)('cookie', cookie);
(0, _globalize2.default)('Cookie', cookie);
deprecate.prop(AJS, 'Cookie', {
alternativeName: 'cookie',
sinceVersion: '5.8.0'
});
exports.erase = erase;
exports.read = read;
exports.save = save;
return module.exports;
}).call(this);
// src/js/aui/firebug.js
(typeof window === 'undefined' ? global : window).__1aae3d001693253893e1c2909cefa0d0 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.warnAboutFirebug = exports.firebug = undefined;
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var deprecate = _interopRequireWildcard(_deprecation);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Does nothing because legacy code.
*
* @returns {undefined}
*/
function warnAboutFirebug() {}
/**
* Includes firebug lite for debugging in IE. Especially in IE.
*
* @returns {undefined}
*/
function firebug() {
var script = (0, _jquery2.default)(document.createElement('script'));
script.attr('src', 'https://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js');
(0, _jquery2.default)('head').append(script);
(function () {
if (window.firebug) {
firebug.init();
} else {
setTimeout(firebug, 0);
}
})();
}
exports.firebug = firebug = deprecate.fn(firebug, 'firebug', {
sinceVersion: '5.1.0'
});
exports.warnAboutFirebug = warnAboutFirebug = deprecate.fn(warnAboutFirebug, 'warnAboutFirebug', {
sinceVersion: '5.8.0'
});
(0, _globalize2.default)('firebug', firebug);
(0, _globalize2.default)('warnAboutFirebug', warnAboutFirebug);
exports.firebug = firebug;
exports.warnAboutFirebug = warnAboutFirebug;
return module.exports;
}).call(this);
// src/js/aui/internal/add-id.js
(typeof window === 'undefined' ? global : window).__cc55a09ead414d69cc4de7048121d904 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _uniqueId = __388ef4e8d369be2e25e22add284c2c1e;
var _uniqueId2 = _interopRequireDefault(_uniqueId);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Apply a unique ID to the element. Preserves ID if the element already has one.
*
* @param {Element} el Selector to find target element.
* @param {string} prefix Optional. String to prepend to ID instead of default AUI prefix.
*
* @returns {undefined}
*/
function addId(el, prefix) {
var element = (0, _jquery2.default)(el);
var addprefix = prefix || false;
element.each(function () {
var $el = (0, _jquery2.default)(this);
if (!$el.attr('id')) {
$el.attr('id', (0, _uniqueId2.default)(addprefix));
}
});
}
(0, _globalize2.default)('_addID', addId);
exports.default = addId;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/alphanum.js
(typeof window === 'undefined' ? global : window).__951d278fb9777c400323ceb589a0fdc2 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Compare two strings in alphanumeric way
* @method alphanum
* @param {String} a first string to compare
* @param {String} b second string to compare
* @return {Number(-1|0|1)} -1 if a < b, 0 if a = b, 1 if a > b
*/
function alphanum(a, b) {
a = (a + '').toLowerCase();
b = (b + '').toLowerCase();
var chunks = /(\d+|\D+)/g;
var am = a.match(chunks);
var bm = b.match(chunks);
var len = Math.max(am.length, bm.length);
for (var i = 0; i < len; i++) {
if (i === am.length) {
return -1;
}
if (i === bm.length) {
return 1;
}
var ad = parseInt(am[i], 10) + '';
var bd = parseInt(bm[i], 10) + '';
if (ad === am[i] && bd === bm[i] && ad !== bd) {
return (ad - bd) / Math.abs(ad - bd);
}
if ((ad !== am[i] || bd !== bm[i]) && am[i] !== bm[i]) {
return am[i] < bm[i] ? -1 : 1;
}
}
return 0;
}
(0, _globalize2.default)('alphanum', alphanum);
exports.default = alphanum;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/contain-dropdown.js
(typeof window === 'undefined' ? global : window).__bd0f84740d2e1d3ddd1bfd9558bcf0f0 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function containDropdown(dropdown, containerSelector, dynamic) {
function getDropdownOffset() {
return dropdown.$.offset().top - (0, _jquery2.default)(containerSelector).offset().top;
}
var container;
var ddOffset;
var availableArea;
var shadowOffset = 25;
if (dropdown.$.parents(containerSelector).length !== -1) {
container = (0, _jquery2.default)(containerSelector);
ddOffset = getDropdownOffset();
shadowOffset = 30;
availableArea = container.outerHeight() - ddOffset - shadowOffset;
if (availableArea <= parseInt(dropdown.$.attr('scrollHeight'), 10)) {
containDropdown.containHeight(dropdown, availableArea);
} else if (dynamic) {
containDropdown.releaseContainment(dropdown);
}
dropdown.reset();
}
};
containDropdown.containHeight = function (dropdown, availableArea) {
dropdown.$.css({
height: availableArea
});
if (dropdown.$.css('overflowY') !== 'scroll') {
dropdown.$.css({
width: 15 + dropdown.$.attr('scrollWidth'),
overflowY: 'scroll',
overflowX: 'hidden'
});
}
};
containDropdown.releaseContainment = function (dropdown) {
dropdown.$.css({
height: '',
width: '',
overflowY: '',
overflowX: ''
});
};
(0, _globalize2.default)('containDropdown', containDropdown);
exports.default = containDropdown;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/index-of.js
(typeof window === 'undefined' ? global : window).__227451369d229dd189d5e7c308c513fb = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Finds the index of an element in the array.
*
* @param {Array} The array being searched.
* @param {Mixed} item Element which will be searched for.
* @param {Integer} fromIndex The index from which the item will be searched. Negative values will search from the end of the array.
*
* @returns {Integer}
*/
function indexOf(array, item, fromIndex) {
var length = array.length;
if (!fromIndex) {
fromIndex = 0;
} else if (fromIndex < 0) {
fromIndex = Math.max(0, length + fromIndex);
}
for (var i = fromIndex; i < length; i++) {
if (array[i] === item) {
return i;
}
}
return -1;
}
(0, _globalize2.default)('indexOf', indexOf);
exports.default = indexOf;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/contains.js
(typeof window === 'undefined' ? global : window).__b8543bc1d5ba586690c801531e166d4a = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _indexOf = __227451369d229dd189d5e7c308c513fb;
var _indexOf2 = _interopRequireDefault(_indexOf);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Looks for an element inside the array.
*
* @param {Array} array The array being searched.
* @param {Array} item The current item.
*
* @return {Boolean}
*/
function contains(array, item) {
return (0, _indexOf2.default)(array, item) > -1;
}
(0, _globalize2.default)('contains', contains);
exports.default = contains;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js-vendor/jquery/plugins/jquery.aop.js
(typeof window === 'undefined' ? global : window).__6e61b10da092c0fe3784a94c20bb6253 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
/**
* jQuery AOP - jQuery plugin to add features of aspect-oriented programming (AOP) to jQuery.
* http://jquery-aop.googlecode.com/
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Version: 1.3
*
* Cross-frame type detection based on Daniel Steigerwald's code (http://daniel.steigerwald.cz)
* http://gist.github.com/204554
*
* Modified by Atlassian (workaround for IE6/7 removed)
*/
(function() {
var _after = 1;
var _afterThrow = 2;
var _afterFinally = 3;
var _before = 4;
var _around = 5;
var _intro = 6;
var _regexEnabled = true;
var _arguments = 'arguments';
var _undef = 'undefined';
var getType = (function() {
var toString = Object.prototype.toString,
toStrings = {},
nodeTypes = { 1: 'element', 3: 'textnode', 9: 'document', 11: 'fragment' },
types = 'Arguments Array Boolean Date Document Element Error Fragment Function NodeList Null Number Object RegExp String TextNode Undefined Window'.split(' ');
for (var i = types.length; i--; ) {
var type = types[i], constructor = window[type];
if (constructor) {
try { toStrings[toString.call(new constructor)] = type.toLowerCase(); }
catch (e) { }
}
}
return function(item) {
return item == null && (item === undefined ? _undef : 'null') ||
item.nodeType && nodeTypes[item.nodeType] ||
typeof item.length == 'number' && (
item.callee && _arguments ||
item.alert && 'window' ||
item.item && 'nodelist') ||
toStrings[toString.call(item)];
};
})();
var isFunc = function(obj) { return getType(obj) == 'function'; };
/**
* Private weaving function.
*/
var weaveOne = function(source, method, advice) {
var old = source[method];
// IE6/7 behavior on some native method return object instances instead of functions
// and may cause the issue https://github.com/gonzalocasas/jquery-aop/issues/7.
// Workaround was removed as it uses eval. See: http://ecosystem.atlassian.net/browse/AUI-4391
var aspect;
if (advice.type == _after || advice.type == _afterThrow || advice.type == _afterFinally)
aspect = function() {
var returnValue, exceptionThrown = null;
try {
returnValue = old.apply(this, arguments);
} catch (e) {
exceptionThrown = e;
}
if (advice.type == _after)
if (exceptionThrown == null)
returnValue = advice.value.apply(this, [returnValue, method]);
else
throw exceptionThrown;
else if (advice.type == _afterThrow && exceptionThrown != null)
returnValue = advice.value.apply(this, [exceptionThrown, method]);
else if (advice.type == _afterFinally)
returnValue = advice.value.apply(this, [returnValue, exceptionThrown, method]);
return returnValue;
};
else if (advice.type == _before)
aspect = function() {
advice.value.apply(this, [arguments, method]);
return old.apply(this, arguments);
};
else if (advice.type == _intro)
aspect = function() {
return advice.value.apply(this, arguments);
};
else if (advice.type == _around) {
aspect = function() {
var invocation = { object: this, args: Array.prototype.slice.call(arguments) };
return advice.value.apply(invocation.object, [{ arguments: invocation.args, method: method, proceed :
function() {
return old.apply(invocation.object, invocation.args);
}
}] );
};
}
aspect.unweave = function() {
source[method] = old;
pointcut = source = aspect = old = null;
};
source[method] = aspect;
return aspect;
};
/**
* Private method search
*/
var search = function(source, pointcut, advice) {
var methods = [];
for (var method in source) {
var item = null;
// Ignore exceptions during method retrival
try {
item = source[method];
}
catch (e) { }
if (item != null && method.match(pointcut.method) && isFunc(item))
methods[methods.length] = { source: source, method: method, advice: advice };
}
return methods;
};
/**
* Private weaver and pointcut parser.
*/
var weave = function(pointcut, advice) {
var source = typeof(pointcut.target.prototype) != _undef ? pointcut.target.prototype : pointcut.target;
var advices = [];
// If it's not an introduction and no method was found, try with regex...
if (advice.type != _intro && typeof(source[pointcut.method]) == _undef) {
// First try directly on target
var methods = search(pointcut.target, pointcut, advice);
// No method found, re-try directly on prototype
if (methods.length == 0)
methods = search(source, pointcut, advice);
for (var i in methods)
advices[advices.length] = weaveOne(methods[i].source, methods[i].method, methods[i].advice);
}
else
{
// Return as an array of one element
advices[0] = weaveOne(source, pointcut.method, advice);
}
return _regexEnabled ? advices : advices[0];
};
jQuery.aop =
{
/**
* Creates an advice after the defined point-cut. The advice will be executed after the point-cut method
* has completed execution successfully, and will receive one parameter with the result of the execution.
* This function returns an array of weaved aspects (Function).
*
* @example jQuery.aop.after( {target: window, method: 'MyGlobalMethod'}, function(result) {
* alert('Returned: ' + result);
* return result;
* } );
* @result Array<Function>
*
* @example jQuery.aop.after( {target: String, method: 'indexOf'}, function(index) {
* alert('Result found at: ' + index + ' on:' + this);
* return index;
* } );
* @result Array<Function>
*
* @name after
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
* @param Function advice Function containing the code that will get called after the execution of the point-cut. It receives one parameter
* with the result of the point-cut's execution. The function can choose to return this same value or a different one.
*
* @type Array<Function>
* @cat Plugins/General
*/
after : function(pointcut, advice)
{
return weave( pointcut, { type: _after, value: advice } );
},
/**
* Creates an advice after the defined point-cut only for unhandled exceptions. The advice will be executed
* after the point-cut method only if the execution failed and an exception has been thrown. It will receive one
* parameter with the exception thrown by the point-cut method.
* This function returns an array of weaved aspects (Function).
*
* @example jQuery.aop.afterThrow( {target: String, method: 'indexOf'}, function(exception) {
* alert('Unhandled exception: ' + exception);
* return -1;
* } );
* @result Array<Function>
*
* @example jQuery.aop.afterThrow( {target: calculator, method: 'Calculate'}, function(exception) {
* console.log('Unhandled exception: ' + exception);
* throw exception;
* } );
* @result Array<Function>
*
* @name afterThrow
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
* @param Function advice Function containing the code that will get called after the execution of the point-cut. It receives one parameter
* with the exception thrown by the point-cut method.
*
* @type Array<Function>
* @cat Plugins/General
*/
afterThrow : function(pointcut, advice)
{
return weave( pointcut, { type: _afterThrow, value: advice } );
},
/**
* Creates an advice after the defined point-cut. The advice will be executed after the point-cut method
* regardless of its success or failure, and it will receive two parameters: one with the
* result of a successful execution or null, and another one with the exception thrown or null.
* This function returns an array of weaved aspects (Function).
*
* @example jQuery.aop.afterFinally( {target: window, method: 'MyGlobalMethod'}, function(result, exception) {
* if (exception == null)
* return 'Returned: ' + result;
* else
* return 'Unhandled exception: ' + exception;
* } );
* @result Array<Function>
*
* @name afterFinally
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
* @param Function advice Function containing the code that will get called after the execution of the point-cut regardless of its success or failure.
* It receives two parameters, the first one with the result of a successful execution or null, and the second one with the
* exception or null.
*
* @type Array<Function>
* @cat Plugins/General
*/
afterFinally : function(pointcut, advice)
{
return weave( pointcut, { type: _afterFinally, value: advice } );
},
/**
* Creates an advice before the defined point-cut. The advice will be executed before the point-cut method
* but cannot modify the behavior of the method, or prevent its execution.
* This function returns an array of weaved aspects (Function).
*
* @example jQuery.aop.before( {target: window, method: 'MyGlobalMethod'}, function() {
* alert('About to execute MyGlobalMethod');
* } );
* @result Array<Function>
*
* @example jQuery.aop.before( {target: String, method: 'indexOf'}, function(index) {
* alert('About to execute String.indexOf on: ' + this);
* } );
* @result Array<Function>
*
* @name before
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
* @param Function advice Function containing the code that will get called before the execution of the point-cut.
*
* @type Array<Function>
* @cat Plugins/General
*/
before : function(pointcut, advice)
{
return weave( pointcut, { type: _before, value: advice } );
},
/**
* Creates an advice 'around' the defined point-cut. This type of advice can control the point-cut method execution by calling
* the functions '.proceed()' on the 'invocation' object, and also, can modify the arguments collection before sending them to the function call.
* This function returns an array of weaved aspects (Function).
*
* @example jQuery.aop.around( {target: window, method: 'MyGlobalMethod'}, function(invocation) {
* alert('# of Arguments: ' + invocation.arguments.length);
* return invocation.proceed();
* } );
* @result Array<Function>
*
* @example jQuery.aop.around( {target: String, method: 'indexOf'}, function(invocation) {
* alert('Searching: ' + invocation.arguments[0] + ' on: ' + this);
* return invocation.proceed();
* } );
* @result Array<Function>
*
* @example jQuery.aop.around( {target: window, method: /Get(\d+)/}, function(invocation) {
* alert('Executing ' + invocation.method);
* return invocation.proceed();
* } );
* @desc Matches all global methods starting with 'Get' and followed by a number.
* @result Array<Function>
*
*
* @name around
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
* @param Function advice Function containing the code that will get called around the execution of the point-cut. This advice will be called with one
* argument containing one function '.proceed()', the collection of arguments '.arguments', and the matched method name '.method'.
*
* @type Array<Function>
* @cat Plugins/General
*/
around : function(pointcut, advice)
{
return weave( pointcut, { type: _around, value: advice } );
},
/**
* Creates an introduction on the defined point-cut. This type of advice replaces any existing methods with the same
* name. To restore them, just unweave it.
* This function returns an array with only one weaved aspect (Function).
*
* @example jQuery.aop.introduction( {target: window, method: 'MyGlobalMethod'}, function(result) {
* alert('Returned: ' + result);
* } );
* @result Array<Function>
*
* @example jQuery.aop.introduction( {target: String, method: 'log'}, function() {
* alert('Console: ' + this);
* } );
* @result Array<Function>
*
* @name introduction
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved.
* @param Function advice Function containing the code that will be executed on the point-cut.
*
* @type Array<Function>
* @cat Plugins/General
*/
introduction : function(pointcut, advice)
{
return weave( pointcut, { type: _intro, value: advice } );
},
/**
* Configures global options.
*
* @name setup
* @param Map settings Configuration options.
* @option Boolean regexMatch Enables/disables regex matching of method names.
*
* @example jQuery.aop.setup( { regexMatch: false } );
* @desc Disable regex matching.
*
* @type Void
* @cat Plugins/General
*/
setup: function(settings)
{
_regexEnabled = settings.regexMatch;
}
};
})();
return module.exports;
}).call(this);
// src/js/aui/drop-down.js
(typeof window === 'undefined' ? global : window).__6fd23dc578f5f4af127e42f8b87e4c55 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
__6e61b10da092c0fe3784a94c20bb6253;
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var deprecate = _interopRequireWildcard(_deprecation);
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Displays a drop down, typically used for menus.
*
* @param obj {jQuery Object|String|Array} object to populate the drop down from.
* @param usroptions optional dropdown configuration. Supported properties are:
* <li>alignment - "left" or "right" alignment of the drop down</li>
* <li>escapeHandler - function to handle on escape key presses</li>
* <li>activeClass - class name to be added to drop down items when 'active' ie. hover over</li>
* <li>selectionHandler - function to handle when drop down items are selected on</li>
* <li>hideHandler - function to handle when the drop down is hidden</li>
* When an object of type Array is passed in, you can also configure:
* <li>isHiddenByDefault - set to true if you would like to hide the drop down on initialisation</li>
* <li>displayHandler - function to display text in the drop down</li>
* <li>useDisabled - If set to true, the dropdown will not appear if a class of disabled is added to aui-dd-parent</li>
*
* @returns {Array} an array of jQuery objects, referring to the drop down container elements
*/
function dropDown(obj, usroptions) {
var dd = null;
var result = [];
var moving = false;
var $doc = (0, _jquery2.default)(document);
var options = {
item: 'li:has(a)',
activeClass: 'active',
alignment: 'right',
displayHandler: function displayHandler(obj) {
return obj.name;
},
escapeHandler: function escapeHandler() {
this.hide('escape');
return false;
},
hideHandler: function hideHandler() {},
moveHandler: function moveHandler() {},
useDisabled: false
};
_jquery2.default.extend(options, usroptions);
options.alignment = { left: 'left', right: 'right' }[options.alignment.toLowerCase()] || 'left';
if (obj && obj.jquery) {
// if $
dd = obj;
} else if (typeof obj === 'string') {
// if $ selector
dd = (0, _jquery2.default)(obj);
} else if (obj && obj.constructor === Array) {
// if JSON
dd = (0, _jquery2.default)('<div></div>').addClass('aui-dropdown').toggleClass('hidden', !!options.isHiddenByDefault);
for (var i = 0, ii = obj.length; i < ii; i++) {
var ol = (0, _jquery2.default)('<ol></ol>');
for (var j = 0, jj = obj[i].length; j < jj; j++) {
var li = (0, _jquery2.default)('<li></li>');
var properties = obj[i][j];
if (properties.href) {
li.append((0, _jquery2.default)('<a></a>').html('<span>' + options.displayHandler(properties) + '</span>').attr({ href: properties.href }).addClass(properties.className));
// deprecated - use the properties on the li, not the span
_jquery2.default.data((0, _jquery2.default)('a > span', li)[0], 'properties', properties);
} else {
li.html(properties.html).addClass(properties.className);
}
if (properties.icon) {
li.prepend((0, _jquery2.default)('<img />').attr('src', properties.icon));
}
if (properties.insideSpanIcon) {
li.children('a').prepend((0, _jquery2.default)('<span></span>').attr('class', 'icon'));
}
if (properties.iconFontClass) {
li.children('a').prepend((0, _jquery2.default)('<span></span>').addClass('aui-icon aui-icon-small aui-iconfont-' + properties.iconFontClass));
}
_jquery2.default.data(li[0], 'properties', properties);
ol.append(li);
}
if (i === ii - 1) {
ol.addClass('last');
}
dd.append(ol);
}
(0, _jquery2.default)('body').append(dd);
} else {
throw new Error('dropDown function was called with illegal parameter. Should be $ object, $ selector or array.');
}
var moveDown = function moveDown() {
move(+1);
};
var moveUp = function moveUp() {
move(-1);
};
var move = function move(dir) {
var trigger = !moving;
var cdd = dropDown.current.$[0];
var links = dropDown.current.links;
var oldFocus = cdd.focused;
moving = true;
if (links.length === 0) {
// Nothing to move focus to. Abort.
return;
}
cdd.focused = typeof oldFocus === 'number' ? oldFocus : -1;
if (!dropDown.current) {
logger.log('move - not current, aborting');
return true;
}
cdd.focused += dir;
// Resolve out of bounds values:
if (cdd.focused < 0) {
cdd.focused = links.length - 1;
} else if (cdd.focused >= links.length) {
cdd.focused = 0;
}
options.moveHandler((0, _jquery2.default)(links[cdd.focused]), dir < 0 ? 'up' : 'down');
if (trigger && links.length) {
(0, _jquery2.default)(links[cdd.focused]).addClass(options.activeClass);
moving = false;
} else if (!links.length) {
moving = false;
}
};
var moveFocus = function moveFocus(e) {
if (!dropDown.current) {
return true;
}
var c = e.which;
var cdd = dropDown.current.$[0];
var links = dropDown.current.links;
dropDown.current.cleanActive();
switch (c) {
case 40:
{
moveDown();
break;
}
case 38:
{
moveUp();
break;
}
case 27:
{
return options.escapeHandler.call(dropDown.current, e);
}
case 13:
{
if (cdd.focused >= 0) {
if (!options.selectionHandler) {
if ((0, _jquery2.default)(links[cdd.focused]).attr('nodeName') != 'a') {
return (0, _jquery2.default)('a', links[cdd.focused]).trigger('focus'); //focus on the "a" within the parent item elements
} else {
return (0, _jquery2.default)(links[cdd.focused]).trigger('focus'); //focus on the "a"
}
} else {
return options.selectionHandler.call(dropDown.current, e, (0, _jquery2.default)(links[cdd.focused])); //call the selection handler
}
}
return true;
}
default:
{
if (links.length) {
(0, _jquery2.default)(links[cdd.focused]).addClass(options.activeClass);
}
return true;
}
}
e.stopPropagation();
e.preventDefault();
return false;
};
var hider = function hider(e) {
if (!(e && e.which && e.which == 3 || e && e.button && e.button == 2 || false)) {
// right click check
if (dropDown.current) {
dropDown.current.hide('click');
}
}
};
var active = function active(i) {
return function () {
if (!dropDown.current) {
return;
}
dropDown.current.cleanFocus();
this.originalClass = this.className;
(0, _jquery2.default)(this).addClass(options.activeClass);
dropDown.current.$[0].focused = i;
};
};
var handleClickSelection = function handleClickSelection(e) {
if (e.button || e.metaKey || e.ctrlKey || e.shiftKey) {
return true;
}
if (dropDown.current && options.selectionHandler) {
options.selectionHandler.call(dropDown.current, e, (0, _jquery2.default)(this));
}
};
var isEventsBound = function isEventsBound(el) {
var bound = false;
if (el.data('events')) {
_jquery2.default.each(el.data('events'), function (i, handler) {
_jquery2.default.each(handler, function (type, handler) {
if (handleClickSelection === handler) {
bound = true;
return false;
}
});
});
}
return bound;
};
dd.each(function () {
var cdd = this;
var $cdd = (0, _jquery2.default)(this);
var res = {};
var methods = {
reset: function reset() {
res = _jquery2.default.extend(res, {
$: $cdd,
links: (0, _jquery2.default)(options.item || 'li:has(a)', cdd),
cleanActive: function cleanActive() {
if (cdd.focused + 1 && res.links.length) {
(0, _jquery2.default)(res.links[cdd.focused]).removeClass(options.activeClass);
}
},
cleanFocus: function cleanFocus() {
res.cleanActive();
cdd.focused = -1;
},
moveDown: moveDown,
moveUp: moveUp,
moveFocus: moveFocus,
getFocusIndex: function getFocusIndex() {
return typeof cdd.focused === 'number' ? cdd.focused : -1;
}
});
res.links.each(function (i) {
var $this = (0, _jquery2.default)(this);
if (!isEventsBound($this)) {
$this.hover(active(i), res.cleanFocus);
$this.click(handleClickSelection);
}
});
},
appear: function appear(dir) {
if (dir) {
$cdd.removeClass('hidden');
//handle left or right alignment
$cdd.addClass('aui-dropdown-' + options.alignment);
} else {
$cdd.addClass('hidden');
}
},
fade: function fade(dir) {
if (dir) {
$cdd.fadeIn('fast');
} else {
$cdd.fadeOut('fast');
}
},
scroll: function scroll(dir) {
if (dir) {
$cdd.slideDown('fast');
} else {
$cdd.slideUp('fast');
}
}
};
res.reset = methods.reset;
res.reset();
/**
* Uses Aspect Oriented Programming (AOP) to wrap a method around another method
* Allows control of the execution of the wrapped method.
* specified method has returned @see $.aop
* @method addControlProcess
* @param {String} methodName - Name of a public method
* @param {Function} callback - Function to be executed
* @return {Array} weaved aspect
*/
res.addControlProcess = function (method, process) {
_jquery2.default.aop.around({ target: this, method: method }, process);
};
/**
* Uses Aspect Oriented Programming (AOP) to insert callback <em>after</em> the
* specified method has returned @see $.aop
* @method addCallback
* @param {String} methodName - Name of a public method
* @param {Function} callback - Function to be executed
* @return {Array} weaved aspect
*/
res.addCallback = function (method, callback) {
return _jquery2.default.aop.after({ target: this, method: method }, callback);
};
res.show = function (method) {
if (options.useDisabled && this.$.closest('.aui-dd-parent').hasClass('disabled')) {
return;
}
this.alignment = options.alignment;
hider();
dropDown.current = this;
this.method = method || this.method || 'appear';
this.timer = setTimeout(function () {
$doc.click(hider);
}, 0);
$doc.keydown(moveFocus);
if (options.firstSelected && this.links[0]) {
active(0).call(this.links[0]);
}
(0, _jquery2.default)(cdd.offsetParent).css({ zIndex: 2000 });
methods[this.method](true);
(0, _jquery2.default)(document).trigger('showLayer', ['dropdown', dropDown.current]);
};
res.hide = function (causer) {
this.method = this.method || 'appear';
(0, _jquery2.default)($cdd.get(0).offsetParent).css({ zIndex: '' });
this.cleanFocus();
methods[this.method](false);
$doc.unbind('click', hider).unbind('keydown', moveFocus);
(0, _jquery2.default)(document).trigger('hideLayer', ['dropdown', dropDown.current]);
dropDown.current = null;
return causer;
};
res.addCallback('reset', function () {
if (options.firstSelected && this.links[0]) {
active(0).call(this.links[0]);
}
});
if (!dropDown.iframes) {
dropDown.iframes = [];
}
dropDown.createShims = function createShims() {
(0, _jquery2.default)('iframe').each(function (idx) {
var iframe = this;
if (!iframe.shim) {
iframe.shim = (0, _jquery2.default)('<div />').addClass('shim hidden').appendTo('body');
dropDown.iframes.push(iframe);
}
});
return createShims;
}();
res.addCallback('show', function () {
(0, _jquery2.default)(dropDown.iframes).each(function () {
var $this = (0, _jquery2.default)(this);
if ($this.is(':visible')) {
var offset = $this.offset();
offset.height = $this.height();
offset.width = $this.width();
this.shim.css({
left: offset.left + 'px',
top: offset.top + 'px',
height: offset.height + 'px',
width: offset.width + 'px'
}).removeClass('hidden');
}
});
});
res.addCallback('hide', function () {
(0, _jquery2.default)(dropDown.iframes).each(function () {
this.shim.addClass('hidden');
});
options.hideHandler();
});
result.push(res);
});
return result;
};
/**
* For the given item in the drop down get the value of the named additional property. If there is no
* property with the specified name then null will be returned.
*
* @method getAdditionalPropertyValue
* @namespace dropDown
* @param item {Object} jQuery Object of the drop down item. An LI element is expected.
* @param name {String} name of the property to retrieve
*/
dropDown.getAdditionalPropertyValue = function (item, name) {
var el = item[0];
if (!el || typeof el.tagName !== 'string' || el.tagName.toLowerCase() !== 'li') {
// we are moving the location of the properties and want to deprecate the attachment to the span
// but are unsure where and how its being called so for now we just log
logger.log('dropDown.getAdditionalPropertyValue : item passed in should be an LI element wrapped by jQuery');
}
var properties = _jquery2.default.data(el, 'properties');
return properties ? properties[name] : null;
};
/**
* Only here for backwards compatibility
* @method removeAllAdditionalProperties
* @namespace dropDown
* @deprecated Since 3.0
*/
dropDown.removeAllAdditionalProperties = function (item) {};
/**
* Base dropdown control. Enables you to identify triggers that when clicked, display dropdown.
*
* @class Standard
* @constructor
* @namespace dropDown
* @param {Object} usroptions
* @return {Object
*/
dropDown.Standard = function (usroptions) {
var res = [];
var options = {
selector: '.aui-dd-parent',
dropDown: '.aui-dropdown',
trigger: '.aui-dd-trigger'
};
var dropdownParents;
// extend defaults with user options
_jquery2.default.extend(options, usroptions);
var hookUpDropDown = function hookUpDropDown($trigger, $parent, $dropdown, ddcontrol) {
// extend to control to have any additional properties/methods
_jquery2.default.extend(ddcontrol, { trigger: $trigger });
// flag it to prevent additional dd controls being applied
$parent.addClass('dd-allocated');
//hide dropdown if not already hidden
$dropdown.addClass('hidden');
//show the dropdown if isHiddenByDefault is set to false
if (options.isHiddenByDefault == false) {
ddcontrol.show();
}
ddcontrol.addCallback('show', function () {
$parent.addClass('active');
});
ddcontrol.addCallback('hide', function () {
$parent.removeClass('active');
});
};
var handleEvent = function handleEvent(event, $trigger, $dropdown, ddcontrol) {
if (ddcontrol != dropDown.current) {
$dropdown.css({ top: $trigger.outerHeight() });
ddcontrol.show();
event.stopImmediatePropagation();
}
event.preventDefault();
};
if (options.useLiveEvents) {
// cache arrays so that we don't have to recalculate the dropdowns. Since we can't store objects as keys in a map,
// we have two arrays: keysCache stores keys of dropdown triggers; valuesCache stores a map of internally used objects
var keysCache = [];
var valuesCache = [];
(0, _jquery2.default)(options.trigger).live('click', function (event) {
var $trigger = (0, _jquery2.default)(this);
var $parent;
var $dropdown;
var ddcontrol;
// if we're cached, don't recalculate the dropdown and do all that funny shite.
var index;
if ((index = _jquery2.default.inArray(this, keysCache)) >= 0) {
var val = valuesCache[index];
$parent = val.parent;
$dropdown = val.dropdown;
ddcontrol = val.ddcontrol;
} else {
$parent = $trigger.closest(options.selector);
$dropdown = $parent.find(options.dropDown);
// Sanity checking
if ($dropdown.length === 0) {
return;
}
ddcontrol = dropDown($dropdown, options)[0];
// Sanity checking
if (!ddcontrol) {
return;
}
// cache
keysCache.push(this);
val = {
parent: $parent,
dropdown: $dropdown,
ddcontrol: ddcontrol
};
hookUpDropDown($trigger, $parent, $dropdown, ddcontrol);
valuesCache.push(val);
}
handleEvent(event, $trigger, $dropdown, ddcontrol);
});
} else {
// handling for jQuery collections
if (this instanceof _jquery2.default) {
dropdownParents = this;
// handling for selectors
} else {
dropdownParents = (0, _jquery2.default)(options.selector);
}
// a series of checks to ensure we are dealing with valid dropdowns
dropdownParents = dropdownParents.not('.dd-allocated').filter(':has(' + options.dropDown + ')').filter(':has(' + options.trigger + ')');
dropdownParents.each(function () {
var $parent = (0, _jquery2.default)(this);
var $dropdown = (0, _jquery2.default)(options.dropDown, this);
var $trigger = (0, _jquery2.default)(options.trigger, this);
var ddcontrol = dropDown($dropdown, options)[0];
// extend to control to have any additional properties/methods
_jquery2.default.extend(ddcontrol, { trigger: $trigger });
hookUpDropDown($trigger, $parent, $dropdown, ddcontrol);
$trigger.click(function (e) {
handleEvent(e, $trigger, $dropdown, ddcontrol);
});
// add control to the response
res.push(ddcontrol);
});
}
return res;
};
/**
* A NewStandard dropdown, however, with the ability to populate its content's via ajax.
*
* @class Ajax
* @constructor
* @namespace dropDown
* @param {Object} options
* @return {Object} dropDown instance
*/
dropDown.Ajax = function (usroptions) {
var dropdowns;
var options = { cache: true };
// extend defaults with user options
_jquery2.default.extend(options, usroptions || {});
// we call with "this" in case we are called in the context of a jQuery collection
dropdowns = dropDown.Standard.call(this, options);
(0, _jquery2.default)(dropdowns).each(function () {
var ddcontrol = this;
_jquery2.default.extend(ddcontrol, {
getAjaxOptions: function getAjaxOptions(opts) {
var success = function success(response) {
if (options.formatResults) {
response = options.formatResults(response);
}
if (options.cache) {
ddcontrol.cache.set(ddcontrol.getAjaxOptions(), response);
}
ddcontrol.refreshSuccess(response);
};
if (options.ajaxOptions) {
if (_jquery2.default.isFunction(options.ajaxOptions)) {
return _jquery2.default.extend(options.ajaxOptions.call(ddcontrol), { success: success });
} else {
return _jquery2.default.extend(options.ajaxOptions, { success: success });
}
}
return _jquery2.default.extend(opts, { success: success });
},
refreshSuccess: function refreshSuccess(response) {
this.$.html(response);
},
cache: function () {
var c = {};
return {
get: function get(ajaxOptions) {
var data = ajaxOptions.data || '';
return c[(ajaxOptions.url + data).replace(/[\?\&]/gi, '')];
},
set: function set(ajaxOptions, responseData) {
var data = ajaxOptions.data || '';
c[(ajaxOptions.url + data).replace(/[\?\&]/gi, '')] = responseData;
},
reset: function reset() {
c = {};
}
};
}(),
show: function (superMethod) {
return function () {
if (options.cache && !!ddcontrol.cache.get(ddcontrol.getAjaxOptions())) {
ddcontrol.refreshSuccess(ddcontrol.cache.get(ddcontrol.getAjaxOptions()));
superMethod.call(ddcontrol);
} else {
(0, _jquery2.default)(_jquery2.default.ajax(ddcontrol.getAjaxOptions())).throbber({ target: ddcontrol.$,
end: function end() {
ddcontrol.reset();
}
});
superMethod.call(ddcontrol);
if (ddcontrol.iframeShim) {
ddcontrol.iframeShim.hide();
}
}
};
}(ddcontrol.show),
resetCache: function resetCache() {
ddcontrol.cache.reset();
}
});
ddcontrol.addCallback('refreshSuccess', function () {
ddcontrol.reset();
});
});
return dropdowns;
};
// OMG. No. Just no.
_jquery2.default.fn.dropDown = function (type, options) {
type = (type || 'Standard').replace(/^([a-z])/, function (match) {
return match.toUpperCase();
});
return dropDown[type].call(this, options);
};
_jquery2.default.fn.dropDown = deprecate.construct(_jquery2.default.fn.dropDown, 'Dropdown constructor', {
alternativeName: 'Dropdown2'
});
(0, _globalize2.default)('dropDown', dropDown);
exports.default = dropDown;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/escape.js
(typeof window === 'undefined' ? global : window).__a8e9bc97883bfa5f425e57f01ee312e7 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Similar to Javascript's in-built escape() function, but where the built-in escape()
* might encode unicode charaters as %uHHHH, this function will leave them as-is.
*
* NOTE: this function does not do html-escaping, see escapeHtml().
*/
var jsEscape = window.escape;
function escape(string) {
return jsEscape(string).replace(/%u\w{4}/gi, function (w) {
return unescape(w);
});
}
(0, _globalize2.default)('escape', escape);
exports.default = escape;
module.exports = exports['default'];
return module.exports;
}).call(this);
// node_modules/fancy-file-input/dist/fancy-file-input.js
(typeof window === 'undefined' ? global : window).__ec79a87e329f3cd93c511477e9ec744f = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"jquery": __fa4bdecddc16a5afcc6c3490bffabe5c,
"jquery": __fa4bdecddc16a5afcc6c3490bffabe5c
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__ec79a87e329f3cd93c511477e9ec744f");
define.amd = true;
/*! jQuery Fancy File Input plugin - v2.0.3 - 2017-10-25
* Copyright (c) 2017 Atlassian Pty Ltd; Licensed Apache-2.0 */
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define(["jquery"], function (a0) {
return (root['FancyFileInput'] = factory(a0));
});
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(__fa4bdecddc16a5afcc6c3490bffabe5c);
} else {
root['FancyFileInput'] = factory(root["jQuery"]);
}
}(this, function ($) {
/**
* --------------------------------------------------------------------
* jQuery Fancy File Input plugin
* Author: Atlassian Pty Ltd
* Copyright ยฉ 2012 - 2016 Atlassian Pty Ltd. Licensed under the
* Apache License, Version 2.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
* --------------------------------------------------------------------
*/
/* jshint -W097 */
var fakePathRegex = /^.*[\\\/]/;
var multipleFileTextRegex = /\{0\}/gi;
var ie = (function() {
var v = 3;
var div = document.createElement( 'div' );
var all = div.getElementsByTagName( 'i' );
do {
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->';
} while (all[0]);
return v > 4 ? v : document.documentMode;
}());
function FancyFileInput(el, options) {
var instance = $(el).data('FancyFileInput');
if (instance) {
return instance;
}
options = $.extend({}, FancyFileInput.defaults, options);
this.el = el;
this.$el = $(el);
this.$label = this.createLabel(options.buttonText);
this._addLabelText();
this.$clearButton = $('<button>', {
text: (this.$label.attr('data-ffi-clearButtonText') || options.clearButtonText),
'class': 'ffi-clear',
type: 'button',
'tabindex': '-1'
});
this.multipleFileTextPattern = this.$label.attr('data-ffi-multipleFileTextPattern') || options.multipleFileTextPattern;
this._eventNamespace = '.ffi';
this.CLASSES = {
disabled: 'is-disabled',
focused: 'is-focused',
active: 'is-active',
valid: 'is-valid',
invalid: 'is-invalid'
};
this[this.isDisabled() ? 'disable' : 'enable']();
this.isFocused = false;
}
FancyFileInput.defaults = {
buttonText: 'Browse\u2026',
clearButtonText: 'Clear',
multipleFileTextPattern: '{0} files'
};
FancyFileInput.prototype._addLabelText = function attLabelText() {
var $associatedLabel = $('label[for="' + this.el.id + '"]');
if ($associatedLabel.length) {
this.$el.attr('aria-label', $associatedLabel.text());
}
};
FancyFileInput.prototype.createLabel = function (buttonText) {
var $label = this.$el.parent('.ffi[data-ffi-button-text]');
if (!$label.length) {
$label = this.$el.wrap($('<label>', { 'class': 'ffi', 'data-ffi-button-text': buttonText })).parent();
}
return $label;
};
FancyFileInput.prototype.isDisabled = function () {
return this.$el.is(':disabled');
};
FancyFileInput.prototype.formatMultipleFileText = function (numFiles) {
return this.multipleFileTextPattern.replace(multipleFileTextRegex, numFiles);
};
FancyFileInput.prototype.bindEvents = function () {
this.$el
.on('invalid' + this._eventNamespace, $.proxy(this.checkValidity, this))
.on('change' + this._eventNamespace, $.proxy(this.change, this))
.on('keydown' + this._eventNamespace, $.proxy(this.keydown, this))
.on('mousedown' + this._eventNamespace, $.proxy(this.mousedown, this))
.on('mouseup' + this._eventNamespace, $.proxy(this.mouseup, this))
.on('focus' + this._eventNamespace, $.proxy(this.focus, this))
.on('blur' + this._eventNamespace, $.proxy(this.blur, this));
this.$clearButton.on('click' + this._eventNamespace, $.proxy(this.clear, this));
};
FancyFileInput.prototype.unbindEvents = function () {
this.$el.off(this._eventNamespace);
this.$clearButton.off(this._eventNamespace);
};
FancyFileInput.prototype.fireEvent = function (event) {
this.$el.trigger(event + this._eventNamespace);
};
FancyFileInput.prototype.enable = function () {
this.bindEvents();
this.$el.prop('disabled', false);
this.$label.removeClass(this.CLASSES.disabled);
};
FancyFileInput.prototype.disable = function () {
this.unbindEvents();
this.$el.prop('disabled', true);
this.$label.addClass(this.CLASSES.disabled);
};
FancyFileInput.prototype.clear = function () {
this.$el.wrap('<form>').closest('form').get(0).reset();
this.$el.unwrap();
this.el.value = '';
this.change();
return false;
};
FancyFileInput.prototype.focus = function () {
var instance = this;
this.$label.addClass(this.CLASSES.focused);
// toggle focus so that the cursor appears back in the field instead of on the button
if (ie && !this.isFocused) {
this.isFocused = true;
setTimeout(function() {
instance.$el.blur();
instance.$el.focus();
}, 0);
}
};
FancyFileInput.prototype.blur = function () {
if (!ie || !this.isFocused) {
this.$label.removeClass(this.CLASSES.focused);
this.isFocused = false;
}
};
FancyFileInput.prototype.mousedown = function () {
this.$label.addClass(this.CLASSES.active);
};
FancyFileInput.prototype.mouseup = function () {
this.$label.removeClass(this.CLASSES.active);
};
FancyFileInput.prototype.keydown = function (e) {
var keyCode = e.which;
var BACKSPACE = 8;
var TAB = 9;
var DELETE = 46;
// Add clear behaviour for all browsers
if (keyCode === BACKSPACE || keyCode === DELETE) {
this.clear();
e.preventDefault();
}
// This works around the IE double tab-stop - no events or blur/change occur when moving between
// the field part of the input and the button part. This is dirty, but it works.
if (ie && keyCode === TAB) {
var instance = this;
this.isFocused = false;
this.$el.prop('disabled',true);
setTimeout(function(){
instance.$el.prop('disabled', false).blur();
}, 0);
}
};
FancyFileInput.prototype.checkValidity = function () {
if (!this.el.required) {
return;
}
var isInvalid = this.$el.is(':invalid');
this.$label.toggleClass(this.CLASSES.invalid, isInvalid).toggleClass(this.CLASSES.valid, !isInvalid);
};
FancyFileInput.prototype.change = function () {
var files;
var val = '';
this.checkValidity();
// multiple file selection
if (this.el.multiple && this.el.files.length > 1) {
files = this.formatMultipleFileText(this.el.files.length); // '5 files'
} else {
files = this.el.value; // 'README.txt'
}
if (files.length) {
val = files.replace(fakePathRegex, ''); // Strips off the C:\fakepath nonsense
this.$clearButton.appendTo(this.$label);
} else {
this.$clearButton.detach();
}
this.$el.focus();
this.setFieldText(val);
this.fireEvent('value-changed');
};
FancyFileInput.prototype.setFieldText = function (text) {
var dataAttribute = 'data-ffi-value';
if (text.length) {
this.$label.attr(dataAttribute, text);
this.fireEvent('value-added');
} else {
this.$label.removeAttr(dataAttribute);
this.fireEvent('value-cleared');
}
};
$.fn.fancyFileInput = function (options) {
return this.each(function () {
var ffi = new FancyFileInput(this, options);
$(this).data('FancyFileInput', ffi);
});
};
return FancyFileInput;
}));
return module.exports;
}).call(this);
// src/js/aui/fancy-file-input.js
(typeof window === 'undefined' ? global : window).__8ba01637e04f593af329577b99d7def3 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
/* AUI-4199: This puts the FFI object on the jQuery global for backwards compatibility. */
Object.defineProperty(exports, "__esModule", {
value: true
});
var _fancyFileInput = __ec79a87e329f3cd93c511477e9ec744f;
var _fancyFileInput2 = _interopRequireDefault(_fancyFileInput);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _fancyFileInput2.default;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/filter-by-search.js
(typeof window === 'undefined' ? global : window).__d119b6562e5820a628e0a35ffc8bfbb9 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Filters a list of entries by a passed search term.
*
* Options:
* - `keywordsField` name of entry field containing keywords, default "keywords".
* - `ignoreForCamelCase` ignore search case for camel case, e.g. CB matches Code Block *and* Code block.
* - `matchBoundary` match words only at boundary, e.g. link matches "linking" but not "hyperlinks".
* - `splitRegex` regex to split search words, instead of on whitespace.
*
* @param {Array} entries An array of objects with a "keywords" property.
* @param {String} search One or more words to search on, which may include camel-casing.
* @param {Object} options Specifiy to override default behaviour.
*
* @returns {Array}
*/
function filterBySearch(entries, search, options) {
// search for nothing, get nothing - up to calling code to handle.
if (!search) {
return [];
}
var keywordsField = options && options.keywordsField || 'keywords';
var camelCaseFlags = options && options.ignoreForCamelCase ? 'i' : '';
var boundaryFlag = options && options.matchBoundary ? '\\b' : '';
var splitRegex = options && options.splitRegex || /\s+/;
// each word in the input is considered a distinct filter that has to match a keyword in the record
var filterWords = search.split(splitRegex);
var filters = [];
filterWords.forEach(function (word) {
// anchor on word boundaries
var subfilters = [new RegExp(boundaryFlag + word, 'i')];
// split camel-case into separate words
if (/^([A-Z][a-z]*) {2,}$/.test(this)) {
var camelRegexStr = this.replace(/([A-Z][a-z]*)/g, '\\b$1[^,]*');
subfilters.push(new RegExp(camelRegexStr, camelCaseFlags));
}
filters.push(subfilters);
});
var result = [];
entries.forEach(function (entry) {
for (var i = 0; i < filters.length; i++) {
var somethingMatches = false;
for (var j = 0; j < filters[i].length; j++) {
if (filters[i][j].test(entry[keywordsField])) {
somethingMatches = true;
break;
}
}
if (!somethingMatches) {
return;
}
}
result.push(entry);
});
return result;
}
var filterBySearch = (0, _deprecation.fn)(filterBySearch, 'filterBySearch', {
sinceVersion: '5.9.0',
extraInfo: 'No alternative will be provided. If products require this function, this should be copied.'
});
(0, _globalize2.default)('filterBySearch', filterBySearch);
exports.default = filterBySearch;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/include.js
(typeof window === 'undefined' ? global : window).__ea436c86b1b85ed7eb1a765f42e63225 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var _contains = __b8543bc1d5ba586690c801531e166d4a;
var _contains2 = _interopRequireDefault(_contains);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var included = [];
function include(url) {
if (!(0, _contains2.default)(included, url)) {
included.push(url);
var s = document.createElement('script');
s.src = url;
(0, _jquery2.default)('body').append(s);
}
}
var include = (0, _deprecation.fn)(include, 'include', {
sinceVersion: '5.9.0',
extraInfo: 'No alternative will be provided. Use a proper module loader instead.'
});
(0, _globalize2.default)('include', include);
exports.default = include;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/inline-dialog2.js
(typeof window === 'undefined' ? global : window).__8c1eca7492da6c44c911da75dc007ff3 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _alignment = __8285f4e2b63df95621f0c3551adf7a51;
var _alignment2 = _interopRequireDefault(_alignment);
var _amdify = __ef2fd31e6f10ced6cb535a906a7926aa;
var _amdify2 = _interopRequireDefault(_amdify);
var _attributes = __12a1bdd49804fd32f5af784a6748a2cb;
var _attributes2 = _interopRequireDefault(_attributes);
var _enforcer = __d7df4172d37613f70c7c4e4b335a76d0;
var _enforcer2 = _interopRequireDefault(_enforcer);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _layer = __20d9b9968ab547182d27cd4991c9c125;
var _layer2 = _interopRequireDefault(_layer);
var _skate = __f3781475eb0bf3a02085f171842f7c4c;
var _skate2 = _interopRequireDefault(_skate);
var _state = __ac20873dc2158ed13da59491630092c2;
var _state2 = _interopRequireDefault(_state);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var DEFAULT_HOVEROUT_DELAY = 1000;
function getTrigger(element) {
return document.querySelector('[aria-controls="' + element.id + '"]');
}
function doIfTrigger(element, callback) {
var trigger = getTrigger(element);
if (trigger) {
callback(trigger);
}
}
function initAlignment(element, trigger) {
if (!element._auiAlignment) {
element._auiAlignment = new _alignment2.default(element, trigger);
}
}
function enableAlignment(element, trigger) {
initAlignment(element, trigger);
element._auiAlignment.enable();
}
function disableAlignment(element, trigger) {
initAlignment(element, trigger);
element._auiAlignment.disable();
}
function handleMessage(element, message) {
var messageTypeMap = {
toggle: ['click'],
hover: ['mouseenter', 'mouseleave', 'focus', 'blur']
};
var messageList = messageTypeMap[element.respondsTo];
if (messageList && messageList.indexOf(message.type) > -1) {
messageHandler[message.type](element, message);
}
}
var messageHandler = {
click: function click(element) {
if (element.open) {
if (!(0, _layer2.default)(element).isPersistent()) {
element.open = false;
}
} else {
element.open = true;
}
},
mouseenter: function mouseenter(element) {
if (!element.open) {
element.open = true;
}
if (element._clearMouseleaveTimeout) {
element._clearMouseleaveTimeout();
}
},
mouseleave: function mouseleave(element) {
if ((0, _layer2.default)(element).isPersistent() || !element.open) {
return;
}
if (element._clearMouseleaveTimeout) {
element._clearMouseleaveTimeout();
}
var timeout = setTimeout(function () {
if (!(0, _state2.default)(element).get('mouse-inside')) {
element.open = false;
}
}, DEFAULT_HOVEROUT_DELAY);
element._clearMouseleaveTimeout = function () {
clearTimeout(timeout);
element._clearMouseleaveTimeout = null;
};
},
focus: function focus(element) {
if (!element.open) {
element.open = true;
}
},
blur: function blur(element) {
if (!(0, _layer2.default)(element).isPersistent() && element.open) {
element.open = false;
}
}
};
function onMouseEnter(e) {
var element = e.target;
(0, _state2.default)(element).set('mouse-inside', true);
element.message({
type: 'mouseenter'
});
}
function onMouseLeave(e) {
var element = e.target;
(0, _state2.default)(element).set('mouse-inside', false);
element.message({
type: 'mouseleave'
});
}
function rebindMouseEvents(el) {
(0, _state2.default)(el).set('mouse-inside', undefined);
el.removeEventListener('mouseenter', onMouseEnter);
el.removeEventListener('mouseleave', onMouseLeave);
if (el.respondsTo === 'hover') {
(0, _state2.default)(el).set('mouse-inside', false);
el.addEventListener('mouseenter', onMouseEnter);
el.addEventListener('mouseleave', onMouseLeave);
}
}
function showInlineDialog(el) {
(0, _layer2.default)(el).show();
if ((0, _layer2.default)(el).isVisible()) {
doIfTrigger(el, function (trigger) {
enableAlignment(el, trigger);
trigger.setAttribute('aria-expanded', 'true');
});
} else {
el.open = false;
}
}
function hideInlineDialog(el) {
(0, _layer2.default)(el).hide();
if (!(0, _layer2.default)(el).isVisible()) {
doIfTrigger(el, function (trigger) {
disableAlignment(el, trigger);
trigger.setAttribute('aria-expanded', 'false');
});
} else {
el.open = true;
}
}
function reflectOpenness(el) {
var isInitalizing = !el.hasAttribute('aria-hidden');
var shouldBeOpen = el.hasAttribute('open');
if (isInitalizing || el.open !== shouldBeOpen) {
if (shouldBeOpen) {
(0, _state2.default)(el).set('is-processing-show', true);
showInlineDialog(el);
(0, _state2.default)(el).set('is-processing-show', false);
} else {
hideInlineDialog(el);
}
}
}
var RESPONDS_TO_ATTRIBUTE_ENUM = {
attribute: 'responds-to',
values: ['toggle', 'hover'],
missingDefault: 'toggle',
invalidDefault: 'toggle'
};
var inlineDialog = (0, _skate2.default)('aui-inline-dialog', {
prototype: {
/**
* Returns whether the inline dialog is open.
*/
get open() {
return (0, _layer2.default)(this).isVisible();
},
/**
* Opens or closes the inline dialog, returning whether the dialog is
* open or closed as a result (since event handlers can prevent either
* action).
*
* You should check the value of open after setting this
* value since the before show/hide events may have prevented it.
*/
set open(value) {
// TODO AUI-3726 Revisit double calls to canceled event handlers.
// Explicitly calling reflectOpenness(โฆ) in this setter means
// that in native we'll get two sync calls to reflectOpenness(โฆ)
// and in polyfill one sync (here) and one async (attr change
// handler). The latter of the two calls, for both cases, will
// usually be a noop (except when show/hide events are cancelled).
_attributes2.default.setBooleanAttribute(this, 'open', value);
reflectOpenness(this);
},
get persistent() {
return this.hasAttribute('persistent');
},
set persistent(value) {
_attributes2.default.setBooleanAttribute(this, 'persistent', value);
},
get respondsTo() {
var attr = RESPONDS_TO_ATTRIBUTE_ENUM.attribute;
return _attributes2.default.computeEnumValue(RESPONDS_TO_ATTRIBUTE_ENUM, this.getAttribute(attr));
},
set respondsTo(value) {
var oldComputedValue = this.respondsTo;
_attributes2.default.setEnumAttribute(this, RESPONDS_TO_ATTRIBUTE_ENUM, value);
if (oldComputedValue !== this.respondsTo) {
rebindMouseEvents(this);
}
},
/**
* Handles the receiving of a message from another component.
*
* @param {Object} msg The message to act on.
*
* @returns {HTMLElement}
*/
message: function message(msg) {
handleMessage(this, msg);
return this;
}
},
created: function created(element) {
(0, _state2.default)(element).set('is-processing-show', false);
doIfTrigger(element, function (trigger) {
trigger.setAttribute('aria-expanded', element.open);
trigger.setAttribute('aria-haspopup', 'true');
});
},
attributes: {
'aria-hidden': function ariaHidden(element, change) {
if (change.newValue === 'true') {
var trigger = getTrigger(element);
if (trigger) {
trigger.setAttribute('aria-expanded', 'false');
}
}
// Whenever layer manager hides us, we need to sync the open attribute.
_attributes2.default.setBooleanAttribute(element, 'open', change.newValue === 'false');
},
open: function open(element) {
// skate runs the created callback for attributes before the
// element is attached to the DOM, so guard against that.
if (document.body.contains(element)) {
reflectOpenness(element);
}
},
'responds-to': function respondsTo(element, change) {
var oldComputedValue = _attributes2.default.computeEnumValue(RESPONDS_TO_ATTRIBUTE_ENUM, change.oldValue);
var newComputedValue = _attributes2.default.computeEnumValue(RESPONDS_TO_ATTRIBUTE_ENUM, change.newValue);
if (oldComputedValue !== newComputedValue) {
rebindMouseEvents(element);
}
}
},
attached: function attached(element) {
(0, _enforcer2.default)(element).attributeExists('id');
if (element.hasAttribute('open')) {
// show() can cause the element to be reattached (to the <body>),
// so guard against a nested show() call that blows up the layer
// manager (since it sees us pushing the same element twice).
if (!(0, _state2.default)(element).get('is-processing-show')) {
reflectOpenness(element);
}
} else {
reflectOpenness(element);
}
rebindMouseEvents(element);
},
detached: function detached(element) {
if (element._auiAlignment) {
element._auiAlignment.destroy();
}
},
template: function template(element) {
var elem = (0, _jquery2.default)('<div class="aui-inline-dialog-contents"></div>').append(element.childNodes);
(0, _jquery2.default)(element).addClass('aui-layer').html(elem);
}
});
(0, _amdify2.default)('aui/inline-dialog2', inlineDialog);
(0, _globalize2.default)('InlineDialog2', inlineDialog);
exports.default = inlineDialog;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/is-clipped.js
(typeof window === 'undefined' ? global : window).__281e698ee59309c72a2df7fa62f96f58 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Shortcut function to see if passed element is truncated/clipped, eg. with
* text-overflow: ellipsis.
*
* @param {String | Element | jQuery} element The element to check.
*
* @returns {Boolean}
*/
function isClipped(el) {
el = (0, _jquery2.default)(el);
return el.prop('scrollWidth') > el.prop('clientWidth');
}
(0, _globalize2.default)('isClipped', isClipped);
exports.default = isClipped;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/is-visible.js
(typeof window === 'undefined' ? global : window).__55f2b7c50110d7f6a92fa56cdb2c1f13 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Shortcut function to see if passed element is currently visible on screen.
*
* @param {String | Element} element The HTMLElement or an jQuery selector to check.
*
* @returns {Boolean}
*/
function isVisible(element) {
return !(0, _jquery2.default)(element).hasClass('hidden');
}
var isVisible = (0, _deprecation.fn)(isVisible, 'isVisible', {
sinceVersion: '5.9.0',
extraInfo: 'No alternative will be provided. Use jQuery.hasClass() instead.'
});
(0, _globalize2.default)('isVisible', isVisible);
exports.default = isVisible;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/layer-manager.js
(typeof window === 'undefined' ? global : window).__d6523560b14b2c09c47caffab4018681 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _layer = __20d9b9968ab547182d27cd4991c9c125;
var _layer2 = _interopRequireDefault(_layer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
(0, _globalize2.default)('LayerManager', _layer2.default.Manager);
exports.default = _layer2.default.Manager;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/messages.js
(typeof window === 'undefined' ? global : window).__f2d1e0a4015e938a0d79db4189cbf8ad = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var deprecate = _interopRequireWildcard(_deprecation);
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _keyCode = __d9798488305326dc80a738b4a3341d65;
var _keyCode2 = _interopRequireDefault(_keyCode);
var _skate = __f3781475eb0bf3a02085f171842f7c4c;
var _skate2 = _interopRequireDefault(_skate);
var _template = __92cb1756a37ec7526fc57dd472bfea6f;
var _template2 = _interopRequireDefault(_template);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var DEFAULT_FADEOUT_DURATION = 500;
var DEFAULT_FADEOUT_DELAY = 5000;
var FADEOUT_RESTORE_DURATION = 100;
var MESSAGE_TEMPLATE = '<div class="aui-message aui-message-{type} {closeable} {shadowed} {fadeout}">' + '<p class="title">' + '<strong>{title}</strong>' + '</p>' + '{body}<!-- .aui-message -->' + '</div>';
var MESSAGE_WITHOUT_TITLE_TEMPLATE = '<div class="aui-message aui-message-{type} {closeable} {shadowed} {fadeout}">' + '{body}<!-- .aui-message -->' + '</div>';
function createMessageConstructor(type) {
/**
*
* @param context
* @param {Object} obj - message configuration
* @param {String} [obj.id] - ID to add to the message.
* @param {String} [obj.title] - Plain-text title of the message. If provided, will appear above the message body.
* @param {String} obj.body - Content of the message. Can be HTML content.
* @param {boolean} [obj.closeable] - If true, the message can be manually closed by the end-user via the UI.
* @param {boolean} [obj.shadowed]
* @param {boolean} [obj.fadeout]
* @param {boolean} [obj.duration]
* @param {boolean} [obj.delay]
* @returns {*|HTMLElement}
*/
messages[type] = function (context, obj) {
if (!obj) {
obj = context;
context = '#aui-message-bar';
}
// Set up our template options
obj.closeable = obj.closeable !== null && obj.closeable !== false;
// shadowed no longer does anything but left in so it doesn't break
obj.shadowed = obj.shadowed !== null && obj.shadowed !== false;
var title = (obj.title || '').toString().trim();
var $message = renderMessageElement(title ? this.template : this.templateAlt, obj, type);
insertMessageIntoContext($message, obj.insert, context);
// Attach the optional extra behaviours
if (obj.closeable) {
makeCloseable($message);
}
if (obj.fadeout) {
makeFadeout($message, obj.delay, obj.duration);
}
return $message;
};
}
function makeCloseable(message) {
(0, _jquery2.default)(message || 'div.aui-message.closeable').each(function () {
var $this = (0, _jquery2.default)(this);
var $closeIcons = $this.find('.aui-icon.icon-close');
var $icon = $closeIcons.length > 0 ? $closeIcons.first() : (0, _jquery2.default)('<span class="aui-icon icon-close" role="button" tabindex="0"></span>');
$this.addClass('closeable');
$this.append($icon);
initCloseMessageBoxOnClickAndKeypress($this);
});
}
function makeFadeout(message, delay, duration) {
delay = typeof delay !== 'undefined' ? delay : DEFAULT_FADEOUT_DELAY;
duration = typeof duration !== 'undefined' ? duration : DEFAULT_FADEOUT_DURATION;
(0, _jquery2.default)(message || 'div.aui-message.fadeout').each(function () {
var $this = (0, _jquery2.default)(this);
//Store the component state to avoid collisions between animations
var hasFocus = false;
var isHover = false;
//Small functions to keep the code easier to read and avoid code duplication
function fadeOut() {
//Algorithm:
//1. Stop all running animations (first arg), including any fade animation and delay
// Do not jump to the end of the animation (second arg). This prevents the message to abruptly
// jump to opacity:0 or opacity:1
//2. Wait <delay> ms before starting the fadeout
//3. Start the fadeout with a duration of <duration> ms
//4. Close the message at the end of the animation
$this.stop(true, false).delay(delay).fadeOut(duration, function () {
$this.closeMessage();
});
}
function resetFadeOut() {
//Algorithm:
//1. Stop all running animations (first arg), including any fade animation and delay
// Do not jump to the end of the animation (second arg). This prevents the message to abruptly
// jump to opacity:0 or opacity:1
//2. Fast animation to opacity:1
$this.stop(true, false).fadeTo(FADEOUT_RESTORE_DURATION, 1);
}
function shouldStartFadeOut() {
return !hasFocus && !isHover;
}
//Attach handlers for user interactions (focus and hover)
$this.focusin(function () {
hasFocus = true;
resetFadeOut();
}).focusout(function () {
hasFocus = false;
if (shouldStartFadeOut()) {
fadeOut();
}
}).hover(function () {
//should be called .hoverin(), but jQuery does not implement that method
isHover = true;
resetFadeOut();
}, function () {
//should be called .hoverout(), but jQuery does not implement that method
isHover = false;
if (shouldStartFadeOut()) {
fadeOut();
}
});
//Initial animation
fadeOut();
});
}
/**
* Utility methods to display different message types to the user.
* Usage:
* <pre>
* messages.info("#container", {
* title: "Info",
* body: "You can choose to have messages without Close functionality.",
* closeable: false,
* shadowed: false
* });
* </pre>
*/
var messages = {
setup: function setup() {
makeCloseable();
makeFadeout();
},
makeCloseable: makeCloseable,
makeFadeout: makeFadeout,
template: MESSAGE_TEMPLATE,
templateAlt: MESSAGE_WITHOUT_TITLE_TEMPLATE,
createMessage: createMessageConstructor
};
function initCloseMessageBoxOnClickAndKeypress($message) {
$message.on('click', '.aui-icon.icon-close', function (e) {
(0, _jquery2.default)(e.target).closest('.aui-message').closeMessage();
}).on('keydown', '.aui-icon.icon-close', function (e) {
if (e.which === _keyCode2.default.ENTER || e.which === _keyCode2.default.SPACE) {
(0, _jquery2.default)(e.target).closest('.aui-message').closeMessage();
e.preventDefault(); // this is especially important when handling the space bar, as we don't want to page down
}
});
}
function insertMessageIntoContext($message, insertWhere, context) {
if (insertWhere === 'prepend') {
$message.prependTo(context);
} else {
$message.appendTo(context);
}
}
function renderMessageElement(templateString, options, type) {
// Append the message using template
var $message = (0, _jquery2.default)((0, _template2.default)(templateString).fill({
type: type,
closeable: options.closeable ? 'closeable' : '',
shadowed: options.shadowed ? 'shadowed' : '',
fadeout: options.fadeout ? 'fadeout' : '',
title: options.title || '',
'body:html': options.body || ''
}).toString());
// Add ID if supplied
if (options.id) {
if (/[#\'\"\.\s]/g.test(options.id)) {
// reject IDs that don't comply with style guide (ie. they'll break stuff)
logger.warn('Messages error: ID rejected, must not include spaces, hashes, dots or quotes.');
} else {
$message.attr('id', options.id);
}
}
return $message;
}
_jquery2.default.fn.closeMessage = function () {
var $message = (0, _jquery2.default)(this);
if ($message.hasClass('aui-message') && $message.hasClass('closeable')) {
$message.stop(true); //Stop any running animation
$message.trigger('messageClose', [this]).remove(); //messageClose event Deprecated as of 5.3
(0, _jquery2.default)(document).trigger('aui-message-close', [this]); //must trigger on document since the element has been removed
}
};
createMessageConstructor('generic'); //Deprecated Oct 2017
createMessageConstructor('error');
createMessageConstructor('warning');
createMessageConstructor('info');
createMessageConstructor('success');
createMessageConstructor('hint'); //Deprecated Oct 2017
(0, _skate2.default)('aui-message', {
created: function created(element) {
var body = element.innerHTML;
var type = element.getAttribute('type') || 'info';
element.innerHTML = '';
messages[type](element, {
body: body,
closeable: element.getAttribute('closeable'),
delay: element.getAttribute('delay'),
duration: element.getAttribute('duration'),
fadeout: element.getAttribute('fadeout'),
title: element.getAttribute('title')
});
}
});
(0, _jquery2.default)(function () {
messages.setup();
});
deprecate.prop(messages, 'makeCloseable', {
extraInfo: 'Use the "closeable" option in the constructor instead. Docs: https://docs.atlassian.com/aui/latest/docs/messages.html'
});
deprecate.prop(messages, 'createMessage', {
extraInfo: 'Use the provided convenience methods instead e.g. messages.info(). Docs: https://docs.atlassian.com/aui/latest/docs/messages.html'
});
deprecate.prop(messages, 'makeFadeout', {
extraInfo: 'Use the "fadeout" option in the constructor instead. Docs: https://docs.atlassian.com/aui/latest/docs/messages.html'
});
deprecate.prop(messages, 'generic', {
extraInfo: 'use the messages.info() method instead. Docs: https://docs.atlassian.com/aui/latest/docs/messages.html'
});
deprecate.prop(messages, 'hint', {
extraInfo: 'use the messages.info() method instead. Docs: https://docs.atlassian.com/aui/latest/docs/messages.html'
});
// Exporting
// ---------
(0, _globalize2.default)('messages', messages);
exports.default = messages;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/navigation.js
(typeof window === 'undefined' ? global : window).__8f601c4ff6fac74179b45292888dae40 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
__ed74109c4e727b6405515053222f381b;
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _skate = __f3781475eb0bf3a02085f171842f7c4c;
var _skate2 = _interopRequireDefault(_skate);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _widget = __36c93ee282e03af34282ae4d42cc61f2;
var _widget2 = _interopRequireDefault(_widget);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Navigation (".aui-nav" elements).
*
* @param {(string|HtmlElement|jQuery)} selector - An expression
* representing a single .aui-nav element; you may also pass an expression
* for a descendent element, in which case the closest containing
* .aui-nav element is used.
* @constructor
*/
function Navigation(selector) {
this.$el = (0, _jquery2.default)(selector).closest('.aui-nav');
// If there are multiple objects, initialise them separately
if (this.$el.length > 1) {
return this.$el.map(function (idx, elm) {
return new Navigation(elm);
})[0];
}
// If already initialised, return existing object
if (this.$el.data('aui-navigation')) {
return this.$el.data('aui-navigation');
}
this.$el.data('aui-navigation', this);
this.$treeParent = this.$el.parent('li[aria-expanded]');
this.$subtreeToggleIcon = this.$treeParent.children('.aui-nav-subtree-toggle').children('span.aui-icon');
// Hide extra items under a 'More...' link
this.hideMoreItems();
// Add child-selected class to relevant attributes
this.$el.children('li:has(.aui-nav-selected)').addClass('aui-nav-child-selected');
// Auto-expand if child is selected
var $selected = this.$el.children('.aui-nav-selected');
$selected.parents('.aui-nav > [aria-expanded=false]').add($selected.filter('[aria-expanded=false]')).each(function () {
var nav = navigationWidget((0, _jquery2.default)(this).children('.aui-nav'));
nav.expand();
});
// Toggle expand on click
this.$el.find('> li[aria-expanded] > .aui-nav-subtree-toggle').on('click', function () {
var nav = navigationWidget((0, _jquery2.default)(this).siblings('.aui-nav'));
nav.toggle();
});
return this;
}
Navigation.prototype.isNested = function () {
return this.$treeParent.length === 1;
};
Navigation.prototype.isCollapsed = function () {
return this.$treeParent.attr('aria-expanded') === 'false';
};
Navigation.prototype.expand = function () {
this.$treeParent.attr('aria-expanded', 'true');
this.$subtreeToggleIcon.removeClass('aui-iconfont-collapsed').addClass('aui-iconfont-expanded');
this.hideMoreItems();
return this;
};
Navigation.prototype.collapse = function () {
this.$treeParent.attr('aria-expanded', 'false');
this.$subtreeToggleIcon.removeClass('aui-iconfont-expanded').addClass('aui-iconfont-collapsed');
return this;
};
Navigation.prototype.toggle = function () {
if (this.isCollapsed()) {
this.expand();
} else {
this.collapse();
}
return this;
};
Navigation.prototype.hideMoreItems = function () {
if (this.$el.is('.aui-nav:not([aria-expanded=false]) [data-more]')) {
var moreText = this.$el.attr('data-more') || AJS.I18n.getText('aui.words.moreitem');
var limit = Math.abs(parseInt(this.$el.attr('data-more-limit'))) || 5;
var $listElements = this.$el.children('li');
// Only add 'More...' if there is more than one element to hide and there are no selected elements
var lessThanTwoToHide = $listElements.length <= limit + 1;
var selectedElementPresent = $listElements.filter('.aui-nav-selected').length;
var alreadyInitialised = $listElements.filter('.aui-nav-more').length;
if (lessThanTwoToHide || selectedElementPresent || alreadyInitialised) {
return this;
}
(0, _jquery2.default)('<li>', {
'class': 'aui-nav-more',
'aria-hidden': 'true'
}).append((0, _jquery2.default)('<a>', {
'href': '#',
'class': 'aui-nav-item',
'text': moreText,
'click': function click(e) {
e.preventDefault();
(0, _jquery2.default)(this).parent().remove();
}
})).insertAfter($listElements.eq(limit - 1));
}
return this;
};
var navigationWidget = (0, _widget2.default)('navigation', Navigation);
// Initialise nav elements
(0, _skate2.default)('aui-nav', {
type: _skate2.default.type.CLASSNAME,
attached: function attached(element) {
new Navigation(element);
},
detached: function detached(element) {
(0, _jquery2.default)(element).removeData();
}
});
(0, _globalize2.default)('navigation', navigationWidget);
exports.default = navigationWidget;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/on-text-resize.js
(typeof window === 'undefined' ? global : window).__b8da0169fd9b532b08d16c532ca32dd9 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function onTextResize(f) {
if (typeof f === 'function') {
if (onTextResize['on-text-resize']) {
onTextResize['on-text-resize'].push(function (emsize) {
f(emsize);
});
} else {
var em = (0, _jquery2.default)('<div></div>');
em.css({
width: '1em',
height: '1em',
position: 'absolute',
top: '-9999em',
left: '-9999em'
});
(0, _jquery2.default)('body').append(em);
em.size = em.width();
setInterval(function () {
if (em.size !== em.width()) {
em.size = em.width();
for (var i = 0, ii = onTextResize['on-text-resize'].length; i < ii; i++) {
onTextResize['on-text-resize'][i](em.size);
}
}
}, 0);
onTextResize.em = em;
onTextResize['on-text-resize'] = [function (emsize) {
f(emsize);
}];
}
}
}
(0, _globalize2.default)('onTextResize', onTextResize);
exports.default = onTextResize;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/params.js
(typeof window === 'undefined' ? global : window).__e7410f2f791a1b727ea3d22067f86069 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (0, _globalize2.default)('params', {});
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/populate-parameters.js
(typeof window === 'undefined' ? global : window).__29a2c48daf9f50c1eb0df5b68fde4c60 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _params = __e7410f2f791a1b727ea3d22067f86069;
var _params2 = _interopRequireDefault(_params);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function populateParameters(parameters) {
if (!parameters) {
parameters = _params2.default;
}
(0, _jquery2.default)('.parameters input').each(function () {
var value = this.value;
var id = this.title || this.id;
if ((0, _jquery2.default)(this).hasClass('list')) {
if (parameters[id]) {
parameters[id].push(value);
} else {
parameters[id] = [value];
}
} else {
parameters[id] = value.match(/^(tru|fals)e$/i) ? value.toLowerCase() === 'true' : value;
}
});
}
(0, _globalize2.default)('populateParameters', populateParameters);
exports.default = populateParameters;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/prevent-default.js
(typeof window === 'undefined' ? global : window).__556ca2046b1b12509a10dc250112eb99 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Calls e.preventDefault. This is designed for event handlers that only need to prevent the default browser
* action, eg:
*
* $(".my-class").click(AJS.preventDefault)
*
* @param {jQuery.Event} e jQuery event.
*
* @returns {undefined}
*/
function preventDefault(e) {
e.preventDefault();
}
(0, _globalize2.default)('preventDefault', preventDefault);
exports.default = preventDefault;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/header.js
(typeof window === 'undefined' ? global : window).__1623800661d086053debdc74f9c4e5e4 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _createHeader = __393229f5a07222d0bb991a5cfe1a0a41;
var _createHeader2 = _interopRequireDefault(_createHeader);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var deprecate = _interopRequireWildcard(_deprecation);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function findAndCreateHeaders() {
(0, _jquery2.default)('.aui-header').each(function () {
(0, _createHeader2.default)(this);
});
}
(0, _jquery2.default)(findAndCreateHeaders);
var responsiveheader = {};
responsiveheader.setup = deprecate.fn(findAndCreateHeaders, 'responsiveheader.setup', {
removeInVersion: '8.0.0',
sinceVersion: '5.8.0',
extraInfo: 'No need to manually initialise anymore as this is now a web component.'
});
(0, _globalize2.default)('responsiveheader', responsiveheader);
exports.default = responsiveheader;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/set-current.js
(typeof window === 'undefined' ? global : window).__dc464087aa944e84225691bf45d0e718 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Shortcut function adds or removes 'current' classname to an element based on a passed boolean.
*
* @param {String | Element} element The element or an ID to show or hide.
* @param {boolean} show True to add 'current' class, false to remove.
*
* @returns {undefined}
*/
function setCurrent(element, current) {
if (!(element = (0, _jquery2.default)(element))) {
return;
}
if (current) {
element.addClass('current');
} else {
element.removeClass('current');
}
}
var setCurrent = (0, _deprecation.fn)(setCurrent, 'setCurrent', {
sinceVersion: '5.9.0',
extraInfo: 'No alternative will be provided. Use jQuery.addClass() / removeClass() instead.'
});
(0, _globalize2.default)('setCurrent', setCurrent);
exports.default = setCurrent;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/set-visible.js
(typeof window === 'undefined' ? global : window).__078a23c3cf569347d04df3c33eedcaad = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Shortcut function adds or removes 'hidden' classname to an element based on a passed boolean.
*
* @param {String | Element} element The element or an ID to show or hide.
* @param {boolean} show true to show, false to hide.
*
* @returns {undefined}
*/
function setVisible(element, show) {
if (!(element = (0, _jquery2.default)(element))) {
return;
}
(0, _jquery2.default)(element).each(function () {
var isHidden = (0, _jquery2.default)(this).hasClass('hidden');
if (isHidden && show) {
(0, _jquery2.default)(this).removeClass('hidden');
} else if (!isHidden && !show) {
(0, _jquery2.default)(this).addClass('hidden');
}
});
}
var setVisible = (0, _deprecation.fn)(setVisible, 'setVisible', {
sinceVersion: '5.9.0',
extraInfo: 'No alternative will be provided. Use jQuery.addClass() / removeClass() instead.'
});
(0, _globalize2.default)('setVisible', setVisible);
exports.default = setVisible;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/stop-event.js
(typeof window === 'undefined' ? global : window).__3269810477afaf28d741e0fc9faece67 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Prevent further handling of an event. Returns false, which you should use as the return value of your event handler:
* return stopEvent(e);
*
* @param {jQuery.Event} e jQuery event
*
* @returns {Boolean}
*/
function stopEvent(e) {
e.stopPropagation();
return false; // required for JWebUnit pop-up links to work properly
}
var stopEvent = (0, _deprecation.fn)(stopEvent, 'stopEvent', {
alternativeName: 'preventDefault()',
sinceVersion: '5.8.0'
});
(0, _globalize2.default)('stopEvent', stopEvent);
exports.default = stopEvent;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/tabs.js
(typeof window === 'undefined' ? global : window).__0dc9e764c1007120960f5be604c6d69f = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
__23921246870221a1cfaf9dc62cd3cb19;
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
var _debounce = __8cd9ff0a19109fb463ce91f349330abb;
var _debounce2 = _interopRequireDefault(_debounce);
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _addId = __cc55a09ead414d69cc4de7048121d904;
var _addId2 = _interopRequireDefault(_addId);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _isClipped = __281e698ee59309c72a2df7fa62f96f58;
var _isClipped2 = _interopRequireDefault(_isClipped);
var _skate = __f3781475eb0bf3a02085f171842f7c4c;
var _skate2 = _interopRequireDefault(_skate);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var template = window.skateTemplateHtml;
var REGEX = /#.*/;
var STORAGE_PREFIX = '_internal-aui-tabs-';
var RESPONSIVE_OPT_IN_SELECTOR = '.aui-tabs.horizontal-tabs[data-aui-responsive]:not([data-aui-responsive="false"]), aui-tabs[responsive]:not([responsive="false"])';
function enhanceTabLink(link) {
var $thisLink = (0, _jquery2.default)(link);
var targetPane = $thisLink.attr('href');
(0, _addId2.default)($thisLink);
$thisLink.attr('role', 'tab');
(0, _jquery2.default)(targetPane).attr('aria-labelledby', $thisLink.attr('id'));
if ($thisLink.parent().hasClass('active-tab')) {
$thisLink.attr('aria-selected', 'true');
} else {
$thisLink.attr('aria-selected', 'false');
}
}
var ResponsiveAdapter = {
totalTabsWidth: function totalTabsWidth($visibleTabs, $dropdown) {
var totalVisibleTabsWidth = this.totalVisibleTabWidth($visibleTabs);
var totalDropdownTabsWidth = 0;
$dropdown.find('li').each(function (index, tab) {
totalDropdownTabsWidth += parseInt(tab.getAttribute('data-aui-tab-width'));
});
return totalVisibleTabsWidth + totalDropdownTabsWidth;
},
totalVisibleTabWidth: function totalVisibleTabWidth($tabs) {
var totalWidth = 0;
$tabs.each(function (index, tab) {
totalWidth += (0, _jquery2.default)(tab).outerWidth();
});
return totalWidth;
},
removeResponsiveDropdown: function removeResponsiveDropdown($dropdown, $dropdownTriggerTab) {
$dropdown.remove();
$dropdownTriggerTab.remove();
},
createResponsiveDropdownTrigger: function createResponsiveDropdownTrigger($tabsMenu, id) {
var triggerMarkup = '<li class="menu-item aui-tabs-responsive-trigger-item">' + '<a class="aui-dropdown2-trigger aui-tabs-responsive-trigger aui-dropdown2-trigger-arrowless" id="aui-tabs-responsive-trigger-' + id + '" aria-haspopup="true" aria-controls="aui-tabs-responsive-dropdown-' + id + '" href="aui-tabs-responsive-dropdown-' + id + '">...</a>' + '</li>';
$tabsMenu.append(triggerMarkup);
var $trigger = $tabsMenu.find('.aui-tabs-responsive-trigger-item');
return $trigger;
},
createResponsiveDropdown: function createResponsiveDropdown($tabsContainer, id) {
var dropdownMarkup = '<div class="aui-dropdown2 aui-style-default aui-tabs-responsive-dropdown" id="aui-tabs-responsive-dropdown-' + id + '">' + '<ul>' + '</ul>' + '</div>';
$tabsContainer.append(dropdownMarkup);
var $dropdown = $tabsContainer.find('#aui-tabs-responsive-dropdown-' + id);
return $dropdown;
},
findNewVisibleTabs: function findNewVisibleTabs(tabs, parentWidth, dropdownTriggerTabWidth) {
function hasMoreSpace(currentTotalTabWidth, dropdownTriggerTabWidth, parentWidth) {
return currentTotalTabWidth + dropdownTriggerTabWidth <= parentWidth;
}
var currentTotalTabWidth = 0;
for (var i = 0; hasMoreSpace(currentTotalTabWidth, dropdownTriggerTabWidth, parentWidth) && i < tabs.length; i++) {
var $tab = (0, _jquery2.default)(tabs[i]);
var tabWidth = $tab.outerWidth(true);
currentTotalTabWidth += tabWidth;
}
// i should now be at the tab index after the last visible tab because of the loop so we minus 1 to get the new visible tabs
return tabs.slice(0, i - 1);
},
moveVisibleTabs: function moveVisibleTabs(oldVisibleTabs, $tabsParent, $dropdownTriggerTab) {
var dropdownId = $dropdownTriggerTab.find('a').attr('aria-controls');
var $dropdown = (0, _jquery2.default)('#' + dropdownId);
var newVisibleTabs = this.findNewVisibleTabs(oldVisibleTabs, $tabsParent.outerWidth(), $dropdownTriggerTab.parent().outerWidth(true));
var lastTabIndex = newVisibleTabs.length - 1;
for (var j = oldVisibleTabs.length - 1; j >= lastTabIndex; j--) {
var $tab = (0, _jquery2.default)(oldVisibleTabs[j]);
this.moveTabToResponsiveDropdown($tab, $dropdown, $dropdownTriggerTab);
}
return (0, _jquery2.default)(newVisibleTabs);
},
moveTabToResponsiveDropdown: function moveTabToResponsiveDropdown($tab, $dropdown, $dropdownTriggerTab) {
var $tabLink = $tab.find('a');
$tab.attr('data-aui-tab-width', $tab.outerWidth(true));
$tabLink.addClass('aui-dropdown2-radio aui-tabs-responsive-item');
if ($tab.hasClass('active-tab')) {
$tabLink.addClass('aui-dropdown2-checked');
$dropdownTriggerTab.addClass('active-tab');
}
$dropdown.find('ul').prepend($tab);
},
moveInvisibleTabs: function moveInvisibleTabs(tabsInDropdown, remainingSpace, $dropdownTriggerTab) {
function hasMoreSpace(remainingSpace) {
return remainingSpace > 0;
}
for (var i = 0; hasMoreSpace(remainingSpace) && i < tabsInDropdown.length; i++) {
var $tab = (0, _jquery2.default)(tabsInDropdown[i]);
var tabInDropdownWidth = parseInt($tab.attr('data-aui-tab-width'), 10);
var shouldMoveTabOut = tabInDropdownWidth < remainingSpace;
if (shouldMoveTabOut) {
this.moveTabOutOfDropdown($tab, $dropdownTriggerTab);
}
remainingSpace -= tabInDropdownWidth;
}
},
moveTabOutOfDropdown: function moveTabOutOfDropdown($tab, $dropdownTriggerTab) {
var isTabInDropdownActive = $tab.find('a').hasClass('aui-dropdown2-checked');
if (isTabInDropdownActive) {
$tab.addClass('active-tab');
$dropdownTriggerTab.removeClass('active-tab');
}
$tab.children('a').removeClass('aui-dropdown2-radio aui-tabs-responsive-item aui-dropdown2-checked');
$dropdownTriggerTab.before($tab);
}
};
// this function is run by jquery .each() where 'this' is the current tabs container
function calculateResponsiveTabs(tabsContainer, index) {
var $tabsContainer = (0, _jquery2.default)(tabsContainer);
var $tabsMenu = $tabsContainer.find('.tabs-menu').first();
var $visibleTabs = $tabsMenu.find('li:not(.aui-tabs-responsive-trigger-item)');
var $dropdownTriggerTab = $tabsMenu.find('.aui-tabs-responsive-trigger').parent();
var $dropdownTrigger = $dropdownTriggerTab.find('a');
var dropdownId = $dropdownTrigger.attr('aria-controls');
var $dropdown = (0, _jquery2.default)(document).find('#' + dropdownId).attr('aria-checked', false);
var isResponsive = $dropdown.length > 0;
var totalTabsWidth = ResponsiveAdapter.totalTabsWidth($visibleTabs, $dropdown);
var needsResponsive = totalTabsWidth > $tabsContainer.outerWidth();
if (!isResponsive && needsResponsive) {
$dropdownTriggerTab = ResponsiveAdapter.createResponsiveDropdownTrigger($tabsMenu, index);
$dropdown = ResponsiveAdapter.createResponsiveDropdown($tabsContainer, index);
}
// reset id's in case tabs have changed DOM order
$dropdownTrigger.attr('aria-controls', 'aui-tabs-responsive-dropdown-' + index);
$dropdownTrigger.attr('id', 'aui-tabs-responsive-trigger-' + index);
$dropdownTrigger.attr('href', 'aui-tabs-responsive-trigger-' + index);
$dropdown.attr('id', 'aui-tabs-responsive-dropdown-' + index);
if (needsResponsive) {
var $newVisibleTabs = ResponsiveAdapter.moveVisibleTabs($visibleTabs.toArray(), $tabsContainer, $dropdownTriggerTab);
var visibleTabWidth = ResponsiveAdapter.totalVisibleTabWidth($newVisibleTabs);
var remainingSpace = $tabsContainer.outerWidth() - visibleTabWidth - $dropdownTriggerTab.outerWidth(true);
var hasSpace = remainingSpace > 0;
if (hasSpace) {
var $tabsInDropdown = $dropdown.find('li');
ResponsiveAdapter.moveInvisibleTabs($tabsInDropdown.toArray(), remainingSpace, $dropdownTriggerTab);
}
$dropdown.on('click', 'a', handleTabClick);
/* Workaround for bug in Edge where the dom is just not being re-rendered properly
It is only triggered for certain widths. Simply taking the element out of the DOM
and placing it back in causes the browser to re-render, hiding the issue.
added from AUI-4098 and to be revisited in AUI-4117*/
if ($tabsMenu.is(':visible')) {
$tabsMenu.hide().show();
}
}
if (isResponsive && !needsResponsive) {
$dropdown.find('li').each(function () {
ResponsiveAdapter.moveTabOutOfDropdown((0, _jquery2.default)(this), $dropdownTriggerTab);
});
ResponsiveAdapter.removeResponsiveDropdown($dropdown, $dropdownTriggerTab);
}
}
function switchToTab(tab) {
var $tab = (0, _jquery2.default)(tab);
// This probably isn't needed anymore. Remove once confirmed.
if ($tab.hasClass('aui-tabs-responsive-trigger')) {
return;
}
var $pane = (0, _jquery2.default)($tab.attr('href').match(REGEX)[0]);
$pane.addClass('active-pane').attr('aria-hidden', 'false').siblings('.tabs-pane').removeClass('active-pane').attr('aria-hidden', 'true');
var $dropdownTriggerTab = $tab.parents('.aui-tabs').find('.aui-tabs-responsive-trigger-item a');
var dropdownId = $dropdownTriggerTab.attr('aria-controls');
var $dropdown = (0, _jquery2.default)(document).find('#' + dropdownId);
$dropdown.find('li a').attr('aria-checked', false).removeClass('checked aui-dropdown2-checked');
$dropdown.find('li').removeClass('active-tab');
$tab.parent('li.menu-item').addClass('active-tab').siblings('.menu-item').removeClass('active-tab');
if ($tab.hasClass('aui-tabs-responsive-item')) {
var $visibleTabs = $pane.parent('.aui-tabs').find('li.menu-item:not(.aui-tabs-responsive-trigger-item)');
$visibleTabs.removeClass('active-tab');
$visibleTabs.find('a').removeClass('checked').removeAttr('aria-checked');
}
if ($tab.hasClass('aui-tabs-responsive-item')) {
$pane.parent('.aui-tabs').find('li.menu-item.aui-tabs-responsive-trigger-item').addClass('active-tab');
}
$tab.closest('.tabs-menu').find('a').attr('aria-selected', 'false');
$tab.attr('aria-selected', 'true');
$tab.trigger('tabSelect', {
tab: $tab,
pane: $pane
});
}
function isPersistentTabGroup($tabGroup) {
// Tab group persistent attribute exists and is not false
return $tabGroup.attr('data-aui-persist') !== undefined && $tabGroup.attr('data-aui-persist') !== 'false';
}
function createPersistentKey($tabGroup) {
var tabGroupId = $tabGroup.attr('id');
var value = $tabGroup.attr('data-aui-persist');
return STORAGE_PREFIX + (tabGroupId ? tabGroupId : '') + (value && value !== 'true' ? '-' + value : '');
}
/* eslint max-depth: 1 */
function updateTabsFromLocalStorage($tabGroups) {
for (var i = 0, ii = $tabGroups.length; i < ii; i++) {
var $tabGroup = $tabGroups.eq(i);
var tabs = $tabGroups.get(i);
if (isPersistentTabGroup($tabGroup) && window.localStorage) {
var tabGroupId = $tabGroup.attr('id');
if (tabGroupId) {
var persistentTabId = window.localStorage.getItem(createPersistentKey($tabGroup));
if (persistentTabId) {
var anchor = tabs.querySelector('a[href$="' + persistentTabId + '"]');
if (anchor) {
switchToTab(anchor);
}
}
} else {
logger.warn('A tab group must specify an id attribute if it specifies data-aui-persist.');
}
}
}
}
function updateLocalStorageEntry($tab) {
var $tabGroup = $tab.closest('.aui-tabs');
var tabGroupId = $tabGroup.attr('id');
if (tabGroupId) {
var tabId = $tab.attr('href');
if (tabId) {
window.localStorage.setItem(createPersistentKey($tabGroup), tabId);
}
} else {
logger.warn('A tab group must specify an id attribute if it specifies data-aui-persist.');
}
}
function handleTabClick(e) {
tabs.change((0, _jquery2.default)(e.target).closest('a'));
if (e) {
e.preventDefault();
}
}
function responsiveResizeHandler(tabs) {
tabs.forEach(function (tab, index) {
calculateResponsiveTabs(tab, index);
});
}
// Initialisation
// --------------
function getTabs() {
return (0, _jquery2.default)('.aui-tabs:not(.aui-tabs-disabled)');
}
function getResponsiveTabs() {
return (0, _jquery2.default)(RESPONSIVE_OPT_IN_SELECTOR).toArray();
}
function initWindow() {
var debounced = (0, _debounce2.default)(responsiveResizeHandler, 200);
var responsive = getResponsiveTabs();
responsiveResizeHandler(responsive);
(0, _jquery2.default)(window).resize(function () {
debounced(responsive);
});
}
function initTab(tab) {
var $tab = (0, _jquery2.default)(tab);
tab.setAttribute('role', 'application');
if (!$tab.data('aui-tab-events-bound')) {
var $tabMenu = $tab.children('ul.tabs-menu');
// ARIA setup
$tabMenu.attr('role', 'tablist');
// ignore the LIs so tab count is announced correctly
$tabMenu.children('li').attr('role', 'presentation');
$tabMenu.find('> .menu-item a').each(function () {
enhanceTabLink(this);
});
// Set up click event for tabs
$tabMenu.on('click', 'a', handleTabClick);
$tab.data('aui-tab-events-bound', true);
initPanes(tab);
}
}
function initTabs() {
var tabs = getTabs();
tabs.each(function () {
initTab(this);
});
updateTabsFromLocalStorage(tabs);
}
function initPane(pane) {
pane.setAttribute('role', 'tabpanel');
pane.setAttribute('aria-hidden', (0, _jquery2.default)(pane).hasClass('active-pane') ? 'false' : 'true');
}
function initPanes(tab) {
[].slice.call(tab.querySelectorAll('.tabs-pane')).forEach(initPane);
}
function initVerticalTabs() {
// Vertical tab truncation setup (adds title if clipped)
(0, _jquery2.default)('.aui-tabs.vertical-tabs').find('a').each(function () {
var thisTab = (0, _jquery2.default)(this);
// don't override existing titles
if (!thisTab.attr('title')) {
// if text has been truncated, add title
if ((0, _isClipped2.default)(thisTab)) {
thisTab.attr('title', thisTab.text());
}
}
});
}
var tabs = {
setup: function setup() {
initWindow();
initTabs();
initVerticalTabs();
},
change: function change(a) {
var $a = (0, _jquery2.default)(a);
var $tabGroup = $a.closest('.aui-tabs');
switchToTab($a);
if (isPersistentTabGroup($tabGroup) && window.localStorage) {
updateLocalStorageEntry($a);
}
}
};
(0, _jquery2.default)(tabs.setup);
// Web Components
// --------------
function findComponent(element) {
return (0, _jquery2.default)(element).closest('aui-tabs').get(0);
}
function findPanes(tabs) {
return tabs.querySelectorAll('aui-tabs-pane');
}
function findTabs(tabs) {
return tabs.querySelectorAll('li[is=aui-tabs-tab]');
}
(0, _skate2.default)('aui-tabs', {
created: function created(element) {
(0, _jquery2.default)(element).addClass('aui-tabs horizontal-tabs');
// We must initialise here so that the old code still works since
// the lifecycle of the sub-components setup the markup so that it
// can be processed by the old logic.
_skate2.default.init(element);
// Use the old logic to initialise the tabs.
initTab(element);
},
template: template('<ul class="tabs-menu">', '<content select="li[is=aui-tabs-tab]"></content>', '</ul>', '<content select="aui-tabs-pane"></content>'),
prototype: {
select: function select(element) {
var index = (0, _jquery2.default)(findPanes(this)).index(element);
if (index > -1) {
tabs.change(findTabs(this)[index].children[0]);
}
return this;
}
}
});
var Tab = (0, _skate2.default)('aui-tabs-tab', {
extends: 'li',
created: function created(element) {
(0, _jquery2.default)(element).addClass('menu-item');
},
template: template('<a href="#">', '<strong>', '<content></content>', '</strong>', '</a>')
});
(0, _skate2.default)('aui-tabs-pane', {
attached: function attached(element) {
var $component = (0, _jquery2.default)(findComponent(element));
var $element = (0, _jquery2.default)(element);
var index = $component.find('aui-tabs-pane').index($element);
var tab = new Tab();
var $tab = (0, _jquery2.default)(tab);
$element.addClass('tabs-pane');
tab.firstChild.setAttribute('href', '#' + element.id);
template.wrap(tab).textContent = $element.attr('title');
if (index === 0) {
$element.addClass('active-pane');
}
if ($element.hasClass('active-pane')) {
$tab.addClass('active-tab');
}
$element.siblings('ul').append(tab);
},
template: template('<content></content>')
});
(0, _globalize2.default)('tabs', tabs);
exports.default = tabs;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/toggle-class-name.js
(typeof window === 'undefined' ? global : window).__8f711196509b934483aad497f958c8e5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __ebcf2ab00bc38af4e85edb3431c4154b;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Shortcut function to toggle class name of an element.
*
* @param {String | Element} element The element or an ID to toggle class name on.
* @param {String} className The class name to remove or add.
*
* @returns {undefined}
*/
function toggleClassName(element, className) {
if (!(element = (0, _jquery2.default)(element))) {
return;
}
element.toggleClass(className);
}
var toggleClassName = (0, _deprecation.fn)(toggleClassName, 'toggleClassName', {
sinceVersion: '5.8.0'
});
(0, _globalize2.default)('toggleClassName', toggleClassName);
exports.default = toggleClassName;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/to-init.js
(typeof window === 'undefined' ? global : window).__575ad550ff0b67b6c9be0e2eb09ae170 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Adds functions to the list of methods to be run on initialisation. Wraps
* error handling around the provided function so its failure won't prevent
* other init functions running.
*
* @param {Function} func Function to be call on initialisation.
*
* @return {Object}
*/
function toInit(func) {
(0, _jquery2.default)(function () {
try {
func.apply(this, arguments);
} catch (ex) {
logger.log('Failed to run init function: ' + ex + '\n' + func.toString());
}
});
return this;
}
(0, _globalize2.default)('toInit', toInit);
exports.default = toInit;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/unbind-text-resize.js
(typeof window === 'undefined' ? global : window).__889198c193cab5a50f1ee37a48a1a55e = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _onTextResize = __b8da0169fd9b532b08d16c532ca32dd9;
var _onTextResize2 = _interopRequireDefault(_onTextResize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function unbindTextResize(f) {
for (var i = 0, ii = _onTextResize2.default['on-text-resize'].length; i < ii; i++) {
if (_onTextResize2.default['on-text-resize'][i] === f) {
return _onTextResize2.default['on-text-resize'].splice(i, 1);
}
}
}
(0, _globalize2.default)('unbindTextResize', unbindTextResize);
exports.default = unbindTextResize;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/jquery/jquery.hotkeys.js
(typeof window === 'undefined' ? global : window).__20963cd9b25fa0115f73b6a54381a09c = (function () {
var module = {
exports: {}
};
var exports = module.exports;
"use strict";
/*
* Modified by Atlassian to allow chaining of keys
*
* jQuery Hotkeys Plugin
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Based upon the plugin by Tzury Bar Yochay:
* http://github.com/tzuryby/hotkeys
*
* Original idea by:
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
*/
(function (jQuery) {
jQuery.hotkeys = {
version: "0.8",
specialKeys: {
8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
91: "meta",
96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111: "/",
112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll",
188: ",", 190: ".", 191: "/", 224: "meta", 219: '[', 221: ']'
},
// These only work under Mac Gecko when using keypress (see http://unixpapa.com/js/key.html).
keypressKeys: ["<", ">", "?"],
shiftNums: {
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ":", "'": "\"", ",": "<",
".": ">", "/": "?", "\\": "|"
}
};
jQuery.each(jQuery.hotkeys.keypressKeys, function (_, key) {
jQuery.hotkeys.shiftNums[key] = key;
});
function TimedNumber(timer) {
this.num = 0;
this.timer = timer > 0 ? timer : false;
}
TimedNumber.prototype.val = function () {
return this.num;
};
TimedNumber.prototype.inc = function () {
if (this.timer) {
clearTimeout(this.timeout);
this.timeout = setTimeout(jQuery.proxy(TimedNumber.prototype.reset, this), this.timer);
}
this.num++;
};
TimedNumber.prototype.reset = function () {
if (this.timer) {
clearTimeout(this.timeout);
}
this.num = 0;
};
function keyHandler(handleObj) {
// Only care when a possible input has been specified
if (!(jQuery.isPlainObject(handleObj.data) || jQuery.isArray(handleObj.data) || typeof handleObj.data === "string")) {
return;
}
var origHandler = handleObj.handler,
options = {
timer: 700,
combo: []
};
(function (data) {
if (typeof data === 'string') {
options.combo = [data];
} else if (jQuery.isArray(data)) {
options.combo = data;
} else {
jQuery.extend(options, data);
}
options.combo = jQuery.map(options.combo, function (key) {
return key.toLowerCase();
});
})(handleObj.data);
handleObj.index = new TimedNumber(options.timer);
handleObj.handler = function (event) {
// Don't fire in text-accepting inputs that we didn't directly bind to
// important to note that jQuery.fn.prop is only available on jquery 1.6+
if (this !== event.target && (/textarea|select|input/i.test(event.target.nodeName) || jQuery(event.target).prop('contenteditable') === 'true')) {
return;
}
// Keypress represents characters, not special keys
var special = event.type !== 'keypress' ? jQuery.hotkeys.specialKeys[event.which] : null,
character = String.fromCharCode(event.which).toLowerCase(),
key,
modif = "",
possible = {};
// check combinations (alt|ctrl|shift+anything)
if (event.altKey && special !== "alt") {
modif += "alt+";
}
if (event.ctrlKey && special !== "ctrl") {
modif += "ctrl+";
}
// TODO: Need to make sure this works consistently across platforms
if (event.metaKey && !event.ctrlKey && special !== "meta") {
modif += "meta+";
}
if (event.shiftKey && special !== "shift") {
modif += "shift+";
}
// Under Chrome and Safari, meta's keycode == '['s charcode
// Even if they did type this key combo we could not use it because it is browser back in Chrome/Safari on OS X
if (event.metaKey && character === '[') {
character = null;
}
if (special) {
possible[modif + special] = true;
}
if (character) {
possible[modif + character] = true;
}
// "$" can be specified as "shift+4" or "$"
if (/shift+/.test(modif)) {
possible[modif.replace('shift+', '') + jQuery.hotkeys.shiftNums[special || character]] = true;
}
var index = handleObj.index,
combo = options.combo;
if (pressed(combo[index.val()], possible)) {
if (index.val() === combo.length - 1) {
index.reset();
return origHandler.apply(this, arguments);
} else {
index.inc();
}
} else {
index.reset();
// For mutli-key combinations, we might have restarted the key sequence.
if (pressed(combo[0], possible)) {
index.inc();
}
}
};
}
function pressed(key, possible) {
var keys = key.split(' ');
for (var i = 0, len = keys.length; i < len; i++) {
if (possible[keys[i]]) {
return true;
}
}
return false;
}
jQuery.each(["keydown", "keyup", "keypress"], function () {
jQuery.event.special[this] = { add: keyHandler };
});
})(jQuery);
return module.exports;
}).call(this);
// src/js/aui/when-i-type.js
(typeof window === 'undefined' ? global : window).__1810a286c1d0228394d031cf381635b6 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
__20963cd9b25fa0115f73b6a54381a09c;
__69d030f47706d4a278feaf7f00d142f5;
var _log = __084be15bc3dec09fe27a76bc41cb3906;
var logger = _interopRequireWildcard(_log);
var _dialog = __14e770c8f3e2710e2bffe202dce2344b;
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _browser = __06d3cef33ca9f6a1f5da6f0cc5a2aa58;
var _keyCode = __d9798488305326dc80a738b4a3341d65;
var _keyCode2 = _interopRequireDefault(_keyCode);
var _underscore = __003f5da3b6466136f51b7b21bc9be073;
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var isMac = navigator.platform.indexOf('Mac') !== -1;
var isSafari = navigator.userAgent.indexOf('Safari') !== -1;
var multiCharRegex = /^(backspace|tab|r(ight|eturn)|s(hift|pace|croll)|c(trl|apslock)|alt|pa(use|ge(up|down))|e(sc|nd)|home|left|up|d(el|own)|insert|f\d\d?|numlock|meta)/i;
/**
* Trigger native click event.
* @param $el
*/
var triggerClickEvent = function triggerClickEvent($el) {
var element = $el[0];
// if we find the element and Native MouseEvents are available, change it!
if (element && 'MouseEvent' in window) {
// Native event bubbles are compatible with Synthetic Event from React
var event = void 0;
var bubbles = true;
var cancelable = true;
if ((0, _browser.supportsNewMouseEvent)()) {
event = new MouseEvent('click', { bubbles: bubbles, cancelable: cancelable });
} else {
// `document.createEvent` is deprecated and may be removed by some browsers in future
// (https://developer.mozilla.org/en-US/docs/Web/API/Document/createEvent).
// As of 2016-12-28, all browsers still support `document.createEvent`
event = document.createEvent('MouseEvent');
event.initEvent('click', bubbles, cancelable);
}
element.dispatchEvent(event);
} else {
// otherwise just use the original jquery code.
$el.trigger('click');
}
};
/**
* Keyboard commands with syntactic sugar.
*
* <strong>Usage:</strong>
* <pre>
* whenIType("gh").or("gd").goTo("/secure/Dashboard.jspa");
* whenIType("c").click("#create_link");
* </pre>
*
* @param keys - Key combinations, modifier keys are "+" deliminated. e.g "ctrl+b"
*/
function whenIType(keys) {
var boundKeyCombos = [];
var executor = _jquery2.default.Callbacks();
function keypressHandler(e) {
if (!_dialog.popup.current && executor) {
executor.fire(e);
}
}
function defaultPreventionHandler(e) {
e.preventDefault();
}
// Bind an arbitrary set of keys by calling bindKeyCombo on each triggering key combo.
// A string like "abc 123" means (a then b then c) OR (1 then 2 then 3). abc is one key combo, 123 is another.
function bindKeys(keys) {
var keyCombos = keys && keys.split ? _jquery2.default.trim(keys).split(' ') : [keys];
keyCombos.forEach(function (keyCombo) {
bindKeyCombo(keyCombo);
});
}
function hasUnprintables(keysArr) {
// a bit of a heuristic, but works for everything we have. Only the unprintable characters are represented with > 1-character names.
var i = keysArr.length;
while (i--) {
if (keysArr[i].length > 1 && keysArr[i] !== 'space') {
return true;
}
}
return false;
}
// bind a single key combo to this handler
// A string like "abc 123" means (a then b then c) OR (1 then 2 then 3). abc is one key combo, 123 is another.
function bindKeyCombo(keyCombo) {
var keysArr = keyCombo instanceof Array ? keyCombo : keyComboArrayFromString(keyCombo.toString());
var eventType = hasUnprintables(keysArr) ? 'keydown' : 'keypress';
boundKeyCombos.push(keysArr);
(0, _jquery2.default)(document).bind(eventType, keysArr, keypressHandler);
// Override browser/plugins
(0, _jquery2.default)(document).bind(eventType + ' keyup', keysArr, defaultPreventionHandler);
}
// parse out an array of (modifier+key) presses from a single string
// e.g. "12ctrl+3" becomes [ "1", "2", "ctrl+3" ]
function keyComboArrayFromString(keyString) {
var keysArr = [];
var currModifiers = '';
while (keyString.length) {
var modifierMatch = keyString.match(/^(ctrl|meta|shift|alt)\+/i);
var multiCharMatch = keyString.match(multiCharRegex);
if (modifierMatch) {
currModifiers += modifierMatch[0];
keyString = keyString.substring(modifierMatch[0].length);
} else if (multiCharMatch) {
keysArr.push(currModifiers + multiCharMatch[0]);
keyString = keyString.substring(multiCharMatch[0].length);
currModifiers = '';
} else {
keysArr.push(currModifiers + keyString[0]);
keyString = keyString.substring(1);
currModifiers = '';
}
}
return keysArr;
}
function addShortcutsToTitle(selector) {
var elem = (0, _jquery2.default)(selector);
var title = elem.attr('title') || '';
var keyCombos = boundKeyCombos.slice();
var existingCombos = elem.data('boundKeyCombos') || [];
var shortcutInstructions = elem.data('kbShortcutAppended') || '';
var isFirst = !shortcutInstructions;
var originalTitle = isFirst ? title : title.substring(0, title.length - shortcutInstructions.length);
while (keyCombos.length) {
var keyCombo = keyCombos.shift();
var comboAlreadyExists = existingCombos.some(function (existingCombo) {
return _underscore2.default.isEqual(keyCombo, existingCombo);
});
if (!comboAlreadyExists) {
shortcutInstructions = appendKeyComboInstructions(keyCombo.slice(), shortcutInstructions, isFirst);
isFirst = false;
}
}
if (isMac) {
shortcutInstructions = shortcutInstructions.replace(/Meta/ig, '\u2318') //Apple cmd key
.replace(/Shift/ig, '\u21E7'); //Apple Shift symbol
}
elem.attr('title', originalTitle + shortcutInstructions);
elem.data('kbShortcutAppended', shortcutInstructions);
elem.data('boundKeyCombos', existingCombos.concat(boundKeyCombos));
}
function removeShortcutsFromTitle(selector) {
var elem = (0, _jquery2.default)(selector);
var shortcuts = elem.data('kbShortcutAppended');
if (!shortcuts) {
return;
}
var title = elem.attr('title');
elem.attr('title', title.replace(shortcuts, ''));
elem.removeData('kbShortcutAppended');
elem.removeData('boundKeyCombos');
}
//
function appendKeyComboInstructions(keyCombo, title, isFirst) {
if (isFirst) {
title += ' (' + AJS.I18n.getText('aui.keyboard.shortcut.type.x', keyCombo.shift());
} else {
title = title.replace(/\)$/, '');
title += AJS.I18n.getText('aui.keyboard.shortcut.or.x', keyCombo.shift());
}
keyCombo.forEach(function (key) {
title += ' ' + AJS.I18n.getText('aui.keyboard.shortcut.then.x', key);
});
title += ')';
return title;
}
bindKeys(keys);
return whenIType.makeShortcut({
executor: executor,
bindKeys: bindKeys,
addShortcutsToTitle: addShortcutsToTitle,
removeShortcutsFromTitle: removeShortcutsFromTitle,
keypressHandler: keypressHandler,
defaultPreventionHandler: defaultPreventionHandler
});
}
whenIType.makeShortcut = function (options) {
var executor = options.executor;
var bindKeys = options.bindKeys;
var addShortcutsToTitle = options.addShortcutsToTitle;
var removeShortcutsFromTitle = options.removeShortcutsFromTitle;
var keypressHandler = options.keypressHandler;
var defaultPreventionHandler = options.defaultPreventionHandler;
var selectorsWithTitlesModified = [];
function makeMoveToFunction(getNewFocus) {
return function (selector, options) {
options = options || {};
var focusedClass = options.focusedClass || 'focused';
var wrapAround = options.hasOwnProperty('wrapAround') ? options.wrapAround : true;
var escToCancel = options.hasOwnProperty('escToCancel') ? options.escToCancel : true;
executor.add(function () {
var $items = (0, _jquery2.default)(selector);
var $focusedElem = $items.filter('.' + focusedClass);
var moveToOptions = $focusedElem.length === 0 ? undefined : { transition: true };
if (escToCancel) {
(0, _jquery2.default)(document).one('keydown', function (e) {
if (e.keyCode === _keyCode2.default.ESCAPE && $focusedElem) {
$focusedElem.removeClass(focusedClass);
}
});
}
if ($focusedElem.length) {
$focusedElem.removeClass(focusedClass);
}
$focusedElem = getNewFocus($focusedElem, $items, wrapAround);
if ($focusedElem && $focusedElem.length > 0) {
$focusedElem.addClass(focusedClass);
$focusedElem.moveTo(moveToOptions);
if ($focusedElem.is('a')) {
$focusedElem.focus();
} else {
$focusedElem.find('a:first').focus();
}
}
});
return this;
};
}
return {
/**
* Scrolls to and adds <em>focused</em> class to the next item in the jQuery collection
*
* @method moveToNextItem
* @param selector
* @param options
* @return {Object}
*/
moveToNextItem: makeMoveToFunction(function ($focusedElem, $items, wrapAround) {
var index;
if (wrapAround && $focusedElem.length === 0) {
return $items.eq(0);
} else {
index = _jquery2.default.inArray($focusedElem.get(0), $items);
if (index < $items.length - 1) {
index = index + 1;
return $items.eq(index);
} else if (wrapAround) {
return $items.eq(0);
}
}
return $focusedElem;
}),
/**
* Scrolls to and adds <em>focused</em> class to the previous item in the jQuery collection
*
* @method moveToPrevItem
* @param selector
* @param focusedClass
* @return {Object}
*/
moveToPrevItem: makeMoveToFunction(function ($focusedElem, $items, wrapAround) {
var index;
if (wrapAround && $focusedElem.length === 0) {
return $items.filter(':last');
} else {
index = _jquery2.default.inArray($focusedElem.get(0), $items);
if (index > 0) {
index = index - 1;
return $items.eq(index);
} else if (wrapAround) {
return $items.filter(':last');
}
}
return $focusedElem;
}),
/**
* Clicks the element specified by the <em>selector</em> argument.
*
* @method click
* @param selector - jQuery selector for element
* @return {Object}
*/
click: function click(selector) {
selectorsWithTitlesModified.push(selector);
addShortcutsToTitle(selector);
executor.add(function () {
var $el = (0, _jquery2.default)(selector);
triggerClickEvent($el);
});
return this;
},
/**
* Navigates to specified <em>location</em>
*
* @method goTo
* @param {String} location - http location
* @return {Object}
*/
goTo: function goTo(location) {
executor.add(function () {
window.location.href = location;
});
return this;
},
/**
* navigates browser window to link href
*
* @method followLink
* @param selector - jQuery selector for element
* @return {Object}
*/
followLink: function followLink(selector) {
selectorsWithTitlesModified.push(selector);
addShortcutsToTitle(selector);
executor.add(function () {
var elem = (0, _jquery2.default)(selector)[0];
if (elem && { 'a': true, 'link': true }[elem.nodeName.toLowerCase()]) {
window.location.href = elem.href;
}
});
return this;
},
/**
* Executes function
*
* @method execute
* @param {function} func
* @return {Object}
*/
execute: function execute(func) {
var self = this;
executor.add(function () {
func.apply(self, arguments);
});
return this;
},
/**
* @deprecated This implementation is uncool. Kept around to satisfy Confluence plugin devs in the short term.
*
* Executes the javascript provided by the shortcut plugin point _immediately_.
*
* @method evaluate
* @param {Function} command - the function provided by the shortcut key plugin point
*/
evaluate: function evaluate(command) {
command.call(this);
},
/**
* Scrolls to element if out of view, then clicks it.
*
* @method moveToAndClick
* @param selector - jQuery selector for element
* @return {Object}
*/
moveToAndClick: function moveToAndClick(selector) {
selectorsWithTitlesModified.push(selector);
addShortcutsToTitle(selector);
executor.add(function () {
var $el = (0, _jquery2.default)(selector);
if ($el.length > 0) {
triggerClickEvent($el);
$el.moveTo();
}
});
return this;
},
/**
* Scrolls to element if out of view, then focuses it
*
* @method moveToAndFocus
* @param selector - jQuery selector for element
* @return {Object}
*/
moveToAndFocus: function moveToAndFocus(selector) {
selectorsWithTitlesModified.push(selector);
addShortcutsToTitle(selector);
executor.add(function (e) {
var $elem = (0, _jquery2.default)(selector);
if ($elem.length > 0) {
$elem.focus();
if ($elem.moveTo) {
$elem.moveTo();
}
if ($elem.is(':input')) {
e.preventDefault();
}
}
});
return this;
},
/**
* Binds additional keyboard controls
*
* @method or
* @param {String} keys - keys to bind
* @return {Object}
*/
or: function or(keys) {
bindKeys(keys);
return this;
},
/**
* Unbinds shortcut keys
*
* @method unbind
*/
unbind: function unbind() {
(0, _jquery2.default)(document).unbind('keydown keypress', keypressHandler).unbind('keydown keypress keyup', defaultPreventionHandler);
for (var i = 0, len = selectorsWithTitlesModified.length; i < len; i++) {
removeShortcutsFromTitle(selectorsWithTitlesModified[i]);
}
selectorsWithTitlesModified = [];
}
};
};
/**
* Creates keyboard commands and their actions from json data. Format looks like:
*
* <pre>
* [
* {
* "keys":[["g", "d"]],
* "context":"global",
* "op":"followLink",
* "param":"#home_link"
* },
* {
* "keys":[["g", "i"]],
* "context":"global",
* "op":"followLink",
* "param":"#find_link"
* },
* {
* "keys":[["/"]],
* "context":"global",
* "op":"moveToAndFocus",
* "param":"#quickSearchInput"
* },
* {
* "keys":[["c"]],
* "context":"global",
* "op":"moveToAndClick",
* "param":"#create_link"
* }
* ]
* </pre>
*
* @method fromJSON
* @static
* @param json
*/
whenIType.fromJSON = function (json, switchCtrlToMetaOnMac) {
var shortcuts = [];
if (json) {
_jquery2.default.each(json, function (i, item) {
var operation = item.op;
var param = item.param;
var params = void 0;
if (operation === 'execute' || operation === 'evaluate') {
// need to turn function string into function object
params = [new Function(param)];
} else if (/^\[[^\]\[]*,[^\]\[]*\]$/.test(param)) {
// pass in an array to send multiple params
try {
params = JSON.parse(param);
} catch (e) {
logger.error('When using a parameter array, array must be in strict JSON format: ' + param);
}
if (!_jquery2.default.isArray(params)) {
logger.error('Badly formatted shortcut parameter. String or JSON Array of parameters required: ' + param);
}
} else {
params = [param];
}
_jquery2.default.each(item.keys, function () {
var shortcutList = this;
if (switchCtrlToMetaOnMac && isMac) {
shortcutList = _jquery2.default.map(shortcutList, function (shortcutString) {
return shortcutString.replace(/ctrl/i, 'meta');
});
}
var newShortcut = whenIType(shortcutList);
newShortcut[operation].apply(newShortcut, params);
shortcuts.push(newShortcut);
});
});
}
return shortcuts;
};
// Trigger this event on an iframe if you want its keypress events to be propagated (Events to work in iframes).
(0, _jquery2.default)(document).bind('iframeAppended', function (e, iframe) {
(0, _jquery2.default)(iframe).load(function () {
var target = (0, _jquery2.default)(iframe).contents();
target.bind('keyup keydown keypress', function (e) {
// safari propagates keypress events from iframes
if (isSafari && e.type === 'keypress') {
return;
}
if (!(0, _jquery2.default)(e.target).is(':input')) {
_jquery2.default.event.trigger(e, arguments, // Preserve original event data.
document, // Bubble this event from the iframe's document to its parent document.
true // Use the capturing phase to preserve original event.target.
);
}
});
});
});
(0, _globalize2.default)('whenIType', whenIType);
exports.default = whenIType;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/version.js
(typeof window === 'undefined' ? global : window).__7852dccee9c727cad1fac3e9561ba4ee = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var version = '7.4.0';
(0, _globalize2.default)('version', version);
exports.default = version;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/setup.js
(typeof window === 'undefined' ? global : window).__084c84671f4982c2e2f3847750812c19 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
var _jquery = __fa4bdecddc16a5afcc6c3490bffabe5c;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __202c95dc6d314ca2ed9178d1b384f912;
var _globalize2 = _interopRequireDefault(_globalize);
var _populateParameters = __29a2c48daf9f50c1eb0df5b68fde4c60;
var _populateParameters2 = _interopRequireDefault(_populateParameters);
var _version = __7852dccee9c727cad1fac3e9561ba4ee;
var _version2 = _interopRequireDefault(_version);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Set the version.
// Global setup that used to be in the main AJS namespace file.
(0, _jquery2.default)(function () {
var $body = (0, _jquery2.default)('body');
if (!$body.data('auiVersion')) {
$body.attr('data-aui-version', _version2.default);
}
(0, _populateParameters2.default)();
});
// Setting Traditional to handle our default param serialisation.
// See http://api.jquery.com/jQuery.param/ for more information.
_jquery2.default.ajaxSettings.traditional = true;
(0, _globalize2.default)('$', _jquery2.default);
return module.exports;
}).call(this);
// src/js/aui.js
(typeof window === 'undefined' ? global : window).__7b55f7ca5c4e12bb0702e79d09050e51 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
__53c6c96a5afecd28dfe14aa069c01614;
__dc6375b3ff483224e2622da6d1d221ab;
__9220dc8b32b65dc265679e74ba01c583;
__69d030f47706d4a278feaf7f00d142f5;
__13bd581224edb4c91ecf99398f71c33b;
__14e770c8f3e2710e2bffe202dce2344b;
__e477ed6f9808ba53a5c3a76317d073a2;
__106f30b5b9d4eb6d2e7eefe5947f43d5;
__9719c7394480fce893225cd8d6abde49;
__084be15bc3dec09fe27a76bc41cb3906;
__7ad39690422479cb34f1bf6ebb46656d;
__1aae3d001693253893e1c2909cefa0d0;
__cc55a09ead414d69cc4de7048121d904;
__951d278fb9777c400323ceb589a0fdc2;
__d25d10be2eae686af96552a0229cd9b0;
__b8528e770b80bbc69c4f6b442e55b068;
__bd0f84740d2e1d3ddd1bfd9558bcf0f0;
__b8543bc1d5ba586690c801531e166d4a;
__6fd23dc578f5f4af127e42f8b87e4c55;
__3937b556d81f7c0f6d92a2176855406e;
__a8e9bc97883bfa5f425e57f01ee312e7;
__91ab8247841516252393b05d610ab13e;
__8ba01637e04f593af329577b99d7def3;
__d119b6562e5820a628e0a35ffc8bfbb9;
__f820769cec2d5b3d6663c4b8c0b065dc;
__fc46eb408dec032237a215988716adad;
__ed74109c4e727b6405515053222f381b;
__388ef4e8d369be2e25e22add284c2c1e;
__ea436c86b1b85ed7eb1a765f42e63225;
__227451369d229dd189d5e7c308c513fb;
__2850afcf6a043ee52a959949f0cf40de;
__8c1eca7492da6c44c911da75dc007ff3;
__281e698ee59309c72a2df7fa62f96f58;
__55f2b7c50110d7f6a92fa56cdb2c1f13;
__d9798488305326dc80a738b4a3341d65;
__20d9b9968ab547182d27cd4991c9c125;
__d6523560b14b2c09c47caffab4018681;
__f2d1e0a4015e938a0d79db4189cbf8ad;
__8f601c4ff6fac74179b45292888dae40;
__b8da0169fd9b532b08d16c532ca32dd9;
__29a2c48daf9f50c1eb0df5b68fde4c60;
__556ca2046b1b12509a10dc250112eb99;
__1623800661d086053debdc74f9c4e5e4;
__dc464087aa944e84225691bf45d0e718;
__078a23c3cf569347d04df3c33eedcaad;
__3269810477afaf28d741e0fc9faece67;
__0dc9e764c1007120960f5be604c6d69f;
__92cb1756a37ec7526fc57dd472bfea6f;
__8f711196509b934483aad497f958c8e5;
__575ad550ff0b67b6c9be0e2eb09ae170;
__889198c193cab5a50f1ee37a48a1a55e;
__1810a286c1d0228394d031cf381635b6;
__084c84671f4982c2e2f3847750812c19;
exports.default = window.AJS;
// Fancy File Input is required by the refapp and assumed to be bundled in AUI.
// It's exposed as a web resource in the plugin.
// We might want to consider not bundling it.
module.exports = exports['default'];
return module.exports;
}).call(this);
|
import React, { PropTypes } from 'react';
import { css } from 'glamor';
import classes from './styles';
function FormNote ({
className,
children,
component: Component,
html,
...props
}) {
props.className = css(classes.note, className);
// Property Violation
if (children && html) {
console.error('Warning: FormNote cannot render `children` and `html`. You must provide one or the other.');
}
return html ? (
<Component {...props} dangerouslySetInnerHTML={{ __html: html }} />
) : (
<Component {...props}>{children}</Component>
);
};
FormNote.propTypes = {
component: PropTypes.oneOfType([
PropTypes.func,
PropTypes.string,
]),
html: PropTypes.string,
};
FormNote.defaultProps = {
component: 'div',
};
module.exports = FormNote;
|
var MediaQuery = require('./MediaQuery');
var Util = require('./Util');
var each = Util.each;
var isFunction = Util.isFunction;
var isArray = Util.isArray;
/**
* Allows for registration of query handlers.
* Manages the query handler's state and is responsible for wiring up browser events
*
* @constructor
*/
function MediaQueryDispatch () {
if(!window.matchMedia) {
throw new Error('matchMedia not present, legacy browsers require a polyfill');
}
this.queries = {};
this.browserIsIncapable = !window.matchMedia('only all').matches;
}
MediaQueryDispatch.prototype = {
constructor : MediaQueryDispatch,
/**
* Registers a handler for the given media query
*
* @param {string} q the media query
* @param {object || Array || Function} options either a single query handler object, a function, or an array of query handlers
* @param {function} options.match fired when query matched
* @param {function} [options.unmatch] fired when a query is no longer matched
* @param {function} [options.setup] fired when handler first triggered
* @param {boolean} [options.deferSetup=false] whether setup should be run immediately or deferred until query is first matched
* @param {boolean} [shouldDegrade=false] whether this particular media query should always run on incapable browsers
*/
register : function(q, options, shouldDegrade) {
var queries = this.queries,
isUnconditional = shouldDegrade && this.browserIsIncapable;
if(!queries[q]) {
queries[q] = new MediaQuery(q, isUnconditional);
}
//normalise to object in an array
if(isFunction(options)) {
options = { match : options };
}
if(!isArray(options)) {
options = [options];
}
each(options, function(handler) {
if (isFunction(handler)) {
handler = { match : handler };
}
queries[q].addHandler(handler);
});
return this;
},
/**
* unregisters a query and all it's handlers, or a specific handler for a query
*
* @param {string} q the media query to target
* @param {object || function} [handler] specific handler to unregister
*/
unregister : function(q, handler) {
var query = this.queries[q];
if(query) {
if(handler) {
query.removeHandler(handler);
}
else {
query.clear();
delete this.queries[q];
}
}
return this;
}
};
module.exports = MediaQueryDispatch;
|
var should = require('should'),
testUtils = require('../../utils'),
// Stuff we are testing
AppSettingModel = require('../../../server/models/app-setting').AppSetting,
context = testUtils.context.admin;
describe('App Setting Model', function () {
// Keep the DB clean
before(testUtils.teardown);
afterEach(testUtils.teardown);
beforeEach(testUtils.setup('app_setting'));
before(function () {
should.exist(AppSettingModel);
});
it('can findAll', function (done) {
AppSettingModel.findAll().then(function (results) {
should.exist(results);
results.length.should.be.above(0);
done();
}).catch(done);
});
it('can findOne', function (done) {
AppSettingModel.findOne({id: testUtils.DataGenerator.Content.app_settings[0].id}).then(function (foundAppSetting) {
should.exist(foundAppSetting);
foundAppSetting.get('created_at').should.be.an.instanceof(Date);
done();
}).catch(done);
});
it('can edit', function (done) {
AppSettingModel.findOne({id: testUtils.DataGenerator.Content.app_settings[0].id}).then(function (foundAppSetting) {
should.exist(foundAppSetting);
return foundAppSetting.set({value: '350'}).save(null, context);
}).then(function () {
return AppSettingModel.findOne({id: testUtils.DataGenerator.Content.app_settings[0].id});
}).then(function (updatedAppSetting) {
should.exist(updatedAppSetting);
updatedAppSetting.get('value').should.equal('350');
done();
}).catch(done);
});
});
|
"use strict";
/* eslint-disable no-new-func */
const acorn = require("acorn");
const findGlobals = require("acorn-globals");
const escodegen = require("escodegen");
// We can't use the default browserify vm shim because it doesn't work in a web worker.
// From ES spec table of contents. Also, don't forget the Annex B additions.
// If someone feels ambitious maybe make this into an npm package.
const builtInConsts = ["Infinity", "NaN", "undefined"];
const otherBuiltIns = ["isFinite", "isNaN", "parseFloat", "parseInt", "decodeURI", "decodeURIComponent",
"encodeURI", "encodeURIComponent", "Array", "ArrayBuffer", "Boolean", "DataView", "Date", "Error", "EvalError",
"Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Number", "Object",
"Proxy", "Promise", "RangeError", "ReferenceError", "RegExp", "Set", "String", "Symbol", "SyntaxError", "TypeError",
"Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "URIError", "WeakMap", "WeakSet", "JSON", "Math",
"Reflect", "escape", "unescape"];
exports.createContext = function (sandbox) {
Object.defineProperty(sandbox, "__isVMShimContext", {
value: true,
writable: true,
configurable: true,
enumerable: false
});
for (const builtIn of builtInConsts) {
Object.defineProperty(sandbox, builtIn, {
value: global[builtIn],
writable: false,
configurable: false,
enumerable: false
});
}
for (const builtIn of otherBuiltIns) {
Object.defineProperty(sandbox, builtIn, {
value: global[builtIn],
writable: true,
configurable: true,
enumerable: false
});
}
Object.defineProperty(sandbox, "eval", {
value(code) {
return exports.runInContext(code, sandbox);
},
writable: true,
configurable: true,
enumerable: false
});
};
exports.isContext = function (sandbox) {
return sandbox.__isVMShimContext;
};
exports.runInContext = function (code, contextifiedSandbox, options) {
if (code === "this") {
// Special case for during window creation.
return contextifiedSandbox;
}
if (options === undefined) {
options = {};
}
const comments = [];
const tokens = [];
const ast = acorn.parse(code, {
allowReturnOutsideFunction: true,
ranges: true,
// collect comments in Esprima's format
onComment: comments,
// collect token ranges
onToken: tokens
});
// make sure we keep comments
escodegen.attachComments(ast, comments, tokens);
const globals = findGlobals(ast);
for (let i = 0; i < globals.length; ++i) {
if (globals[i].name === "window" || globals[i].name === "this") {
continue;
}
const nodes = globals[i].nodes;
for (let j = 0; j < nodes.length; ++j) {
const type = nodes[j].type;
const name = nodes[j].name;
nodes[j].type = "MemberExpression";
nodes[j].property = { name, type };
nodes[j].computed = false;
nodes[j].object = {
name: "window",
type: "Identifier"
};
}
}
const lastNode = ast.body[ast.body.length - 1];
if (lastNode.type === "ExpressionStatement") {
lastNode.type = "ReturnStatement";
lastNode.argument = lastNode.expression;
delete lastNode.expression;
}
const rewrittenCode = escodegen.generate(ast, { comment: true });
const suffix = options.filename !== undefined ? "\n//# sourceURL=" + options.filename : "";
return Function("window", rewrittenCode + suffix).bind(contextifiedSandbox)(contextifiedSandbox);
};
exports.Script = class VMShimScript {
constructor(code, options) {
this._code = code;
this._options = options;
}
runInContext(sandbox, options) {
return exports.runInContext(this._code, sandbox, Object.assign({}, this._options, options));
}
};
|
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class ChunkRenderError extends Error {
constructor(chunk, file, error) {
super();
this.name = "ChunkRenderError";
this.error = error;
this.message = error.message;
this.details = error.stack;
this.file = file;
this.chunk = chunk;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = ChunkRenderError;
|
/*!
* Note: While Microsoft is not the author of this file, Microsoft is
* offering you a license subject to the terms of the Microsoft Software
* License Terms for Microsoft ASP.NET Model View Controller 3.
* Microsoft reserves all other rights. The notices below are provided
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery UI 1.8.6
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
*
* http://docs.jquery.com/UI
*/
(function(b,c){function f(g){return!b(g).parents().andSelf().filter(function(){return b.curCSS(this,"visibility")==="hidden"||b.expr.filters.hidden(this)}).length}b.ui=b.ui||{};if(!b.ui.version){b.extend(b.ui,{version:"1.8.6",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});b.fn.extend({_focus:b.fn.focus,focus:function(g,e){return typeof g==="number"?this.each(function(){var a=this;setTimeout(function(){b(a).focus();e&&e.call(a)},g)}):this._focus.apply(this,arguments)},scrollParent:function(){var g;g=b.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(b.curCSS(this,
"position",1))&&/(auto|scroll)/.test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!g.length?b(document):g},zIndex:function(g){if(g!==c)return this.css("zIndex",g);if(this.length){g=b(this[0]);for(var e;g.length&&g[0]!==document;){e=g.css("position");
if(e==="absolute"||e==="relative"||e==="fixed"){e=parseInt(g.css("zIndex"),10);if(!isNaN(e)&&e!==0)return e}g=g.parent()}}return 0},disableSelection:function(){return this.bind((b.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(g){g.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});b.each(["Width","Height"],function(g,e){function a(j,n,q,l){b.each(d,function(){n-=parseFloat(b.curCSS(j,"padding"+this,true))||0;if(q)n-=parseFloat(b.curCSS(j,
"border"+this+"Width",true))||0;if(l)n-=parseFloat(b.curCSS(j,"margin"+this,true))||0});return n}var d=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),i={innerWidth:b.fn.innerWidth,innerHeight:b.fn.innerHeight,outerWidth:b.fn.outerWidth,outerHeight:b.fn.outerHeight};b.fn["inner"+e]=function(j){if(j===c)return i["inner"+e].call(this);return this.each(function(){b(this).css(h,a(this,j)+"px")})};b.fn["outer"+e]=function(j,n){if(typeof j!=="number")return i["outer"+e].call(this,j);return this.each(function(){b(this).css(h,
a(this,j,true,n)+"px")})}});b.extend(b.expr[":"],{data:function(g,e,a){return!!b.data(g,a[3])},focusable:function(g){var e=g.nodeName.toLowerCase(),a=b.attr(g,"tabindex");if("area"===e){e=g.parentNode;a=e.name;if(!g.href||!a||e.nodeName.toLowerCase()!=="map")return false;g=b("img[usemap=#"+a+"]")[0];return!!g&&f(g)}return(/input|select|textarea|button|object/.test(e)?!g.disabled:"a"==e?g.href||!isNaN(a):!isNaN(a))&&f(g)},tabbable:function(g){var e=b.attr(g,"tabindex");return(isNaN(e)||e>=0)&&b(g).is(":focusable")}});
b(function(){var g=document.body,e=g.appendChild(e=document.createElement("div"));b.extend(e.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});b.support.minHeight=e.offsetHeight===100;b.support.selectstart="onselectstart"in e;g.removeChild(e).style.display="none"});b.extend(b.ui,{plugin:{add:function(g,e,a){g=b.ui[g].prototype;for(var d in a){g.plugins[d]=g.plugins[d]||[];g.plugins[d].push([e,a[d]])}},call:function(g,e,a){if((e=g.plugins[e])&&g.element[0].parentNode)for(var d=0;d<e.length;d++)g.options[e[d][0]]&&
e[d][1].apply(g.element,a)}},contains:function(g,e){return document.compareDocumentPosition?g.compareDocumentPosition(e)&16:g!==e&&g.contains(e)},hasScroll:function(g,e){if(b(g).css("overflow")==="hidden")return false;e=e&&e==="left"?"scrollLeft":"scrollTop";var a=false;if(g[e]>0)return true;g[e]=1;a=g[e]>0;g[e]=0;return a},isOverAxis:function(g,e,a){return g>e&&g<e+a},isOver:function(g,e,a,d,h,i){return b.ui.isOverAxis(g,a,h)&&b.ui.isOverAxis(e,d,i)}})}})(jQuery);
(function(b,c){if(b.cleanData){var f=b.cleanData;b.cleanData=function(e){for(var a=0,d;(d=e[a])!=null;a++)b(d).triggerHandler("remove");f(e)}}else{var g=b.fn.remove;b.fn.remove=function(e,a){return this.each(function(){if(!a)if(!e||b.filter(e,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return g.call(b(this),e,a)})}}b.widget=function(e,a,d){var h=e.split(".")[0],i;e=e.split(".")[1];i=h+"-"+e;if(!d){d=a;a=b.Widget}b.expr[":"][i]=function(j){return!!b.data(j,
e)};b[h]=b[h]||{};b[h][e]=function(j,n){arguments.length&&this._createWidget(j,n)};a=new a;a.options=b.extend(true,{},a.options);b[h][e].prototype=b.extend(true,a,{namespace:h,widgetName:e,widgetEventPrefix:b[h][e].prototype.widgetEventPrefix||e,widgetBaseClass:i},d);b.widget.bridge(e,b[h][e])};b.widget.bridge=function(e,a){b.fn[e]=function(d){var h=typeof d==="string",i=Array.prototype.slice.call(arguments,1),j=this;d=!h&&i.length?b.extend.apply(null,[true,d].concat(i)):d;if(h&&d.charAt(0)==="_")return j;
h?this.each(function(){var n=b.data(this,e),q=n&&b.isFunction(n[d])?n[d].apply(n,i):n;if(q!==n&&q!==c){j=q;return false}}):this.each(function(){var n=b.data(this,e);n?n.option(d||{})._init():b.data(this,e,new a(d,this))});return j}};b.Widget=function(e,a){arguments.length&&this._createWidget(e,a)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(e,a){b.data(a,this.widgetName,this);this.element=b(a);this.options=b.extend(true,{},this.options,
this._getCreateOptions(),e);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
widget:function(){return this.element},option:function(e,a){var d=e;if(arguments.length===0)return b.extend({},this.options);if(typeof e==="string"){if(a===c)return this.options[e];d={};d[e]=a}this._setOptions(d);return this},_setOptions:function(e){var a=this;b.each(e,function(d,h){a._setOption(d,h)});return this},_setOption:function(e,a){this.options[e]=a;if(e==="disabled")this.widget()[a?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",a);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,a,d){var h=this.options[e];a=b.Event(a);a.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();d=d||{};if(a.originalEvent){e=b.event.props.length;for(var i;e;){i=b.event.props[--e];a[i]=a.originalEvent[i]}}this.element.trigger(a,d);return!(b.isFunction(h)&&h.call(this.element[0],a,d)===false||a.isDefaultPrevented())}}})(jQuery);
(function(b){b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(f){return c._mouseDown(f)}).bind("click."+this.widgetName,function(f){if(c._preventClickEvent){c._preventClickEvent=false;f.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(c){c.originalEvent=c.originalEvent||{};if(!c.originalEvent.mouseHandled){this._mouseStarted&&
this._mouseUp(c);this._mouseDownEvent=c;var f=this,g=c.which==1,e=typeof this.options.cancel=="string"?b(c.target).parents().add(c.target).filter(this.options.cancel).length:false;if(!g||e||!this._mouseCapture(c))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){f.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=this._mouseStart(c)!==false;if(!this._mouseStarted){c.preventDefault();
return true}}this._mouseMoveDelegate=function(a){return f._mouseMove(a)};this._mouseUpDelegate=function(a){return f._mouseUp(a)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.preventDefault();return c.originalEvent.mouseHandled=true}},_mouseMove:function(c){if(b.browser.msie&&!(document.documentMode>=9)&&!c.button)return this._mouseUp(c);if(this._mouseStarted){this._mouseDrag(c);return c.preventDefault()}if(this._mouseDistanceMet(c)&&
this._mouseDelayMet(c))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==false)?this._mouseDrag(c):this._mouseUp(c);return!this._mouseStarted},_mouseUp:function(c){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=c.target==this._mouseDownEvent.target;this._mouseStop(c)}return false},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX-
c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
(function(b){b.widget("ui.draggable",b.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(c){var f=
this.options;if(this.helper||f.disabled||b(c.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(c);if(!this.handle)return false;return true},_mouseStart:function(c){var f=this.options;this.helper=this._createHelper(c);this._cacheHelperProportions();if(b.ui.ddmanager)b.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
this.margins.top,left:this.offset.left-this.margins.left};b.extend(this.offset,{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(c);this.originalPageX=c.pageX;this.originalPageY=c.pageY;f.cursorAt&&this._adjustOffsetFromHelper(f.cursorAt);f.containment&&this._setContainment();if(this._trigger("start",c)===false){this._clear();return false}this._cacheHelperProportions();
b.ui.ddmanager&&!f.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,c);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(c,true);return true},_mouseDrag:function(c,f){this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");if(!f){f=this._uiHash();if(this._trigger("drag",c,f)===false){this._mouseUp({});return false}this.position=f.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";b.ui.ddmanager&&b.ui.ddmanager.drag(this,c);return false},_mouseStop:function(c){var f=false;if(b.ui.ddmanager&&!this.options.dropBehaviour)f=b.ui.ddmanager.drop(this,c);if(this.dropped){f=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!f||this.options.revert=="valid"&&f||this.options.revert===true||b.isFunction(this.options.revert)&&this.options.revert.call(this.element,
f)){var g=this;b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){g._trigger("stop",c)!==false&&g._clear()})}else this._trigger("stop",c)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(c){var f=!this.options.handle||!b(this.options.handle,this.element).length?true:false;b(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
c.target)f=true});return f},_createHelper:function(c){var f=this.options;c=b.isFunction(f.helper)?b(f.helper.apply(this.element[0],[c])):f.helper=="clone"?this.element.clone():this.element;c.parents("body").length||c.appendTo(f.appendTo=="parent"?this.element[0].parentNode:f.appendTo);c[0]!=this.element[0]&&!/(fixed|absolute)/.test(c.css("position"))&&c.css("position","absolute");return c},_adjustOffsetFromHelper:function(c){if(typeof c=="string")c=c.split(" ");if(b.isArray(c))c={left:+c[0],top:+c[1]||
0};if("left"in c)this.offset.click.left=c.left+this.margins.left;if("right"in c)this.offset.click.left=this.helperProportions.width-c.right+this.margins.left;if("top"in c)this.offset.click.top=c.top+this.margins.top;if("bottom"in c)this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],
this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)c={top:0,left:0};return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var c=this.element.position();return{top:c.top-
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var c=this.options;if(c.containment==
"parent")c.containment=this.helper[0].parentNode;if(c.containment=="document"||c.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(c.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b(c.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(c.containment)&&
c.containment.constructor!=Array){var f=b(c.containment)[0];if(f){c=b(c.containment).offset();var g=b(f).css("overflow")!="hidden";this.containment=[c.left+(parseInt(b(f).css("borderLeftWidth"),10)||0)+(parseInt(b(f).css("paddingLeft"),10)||0)-this.margins.left,c.top+(parseInt(b(f).css("borderTopWidth"),10)||0)+(parseInt(b(f).css("paddingTop"),10)||0)-this.margins.top,c.left+(g?Math.max(f.scrollWidth,f.offsetWidth):f.offsetWidth)-(parseInt(b(f).css("borderLeftWidth"),10)||0)-(parseInt(b(f).css("paddingRight"),
10)||0)-this.helperProportions.width-this.margins.left,c.top+(g?Math.max(f.scrollHeight,f.offsetHeight):f.offsetHeight)-(parseInt(b(f).css("borderTopWidth"),10)||0)-(parseInt(b(f).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(c.containment.constructor==Array)this.containment=c.containment},_convertPositionTo:function(c,f){if(!f)f=this.position;c=c=="absolute"?1:-1;var g=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],
this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(g[0].tagName);return{top:f.top+this.offset.relative.top*c+this.offset.parent.top*c-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:g.scrollTop())*c),left:f.left+this.offset.relative.left*c+this.offset.parent.left*c-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
e?0:g.scrollLeft())*c)}},_generatePosition:function(c){var f=this.options,g=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(g[0].tagName),a=c.pageX,d=c.pageY;if(this.originalPosition){if(this.containment){if(c.pageX-this.offset.click.left<this.containment[0])a=this.containment[0]+this.offset.click.left;if(c.pageY-this.offset.click.top<this.containment[1])d=this.containment[1]+
this.offset.click.top;if(c.pageX-this.offset.click.left>this.containment[2])a=this.containment[2]+this.offset.click.left;if(c.pageY-this.offset.click.top>this.containment[3])d=this.containment[3]+this.offset.click.top}if(f.grid){d=this.originalPageY+Math.round((d-this.originalPageY)/f.grid[1])*f.grid[1];d=this.containment?!(d-this.offset.click.top<this.containment[1]||d-this.offset.click.top>this.containment[3])?d:!(d-this.offset.click.top<this.containment[1])?d-f.grid[1]:d+f.grid[1]:d;a=this.originalPageX+
Math.round((a-this.originalPageX)/f.grid[0])*f.grid[0];a=this.containment?!(a-this.offset.click.left<this.containment[0]||a-this.offset.click.left>this.containment[2])?a:!(a-this.offset.click.left<this.containment[0])?a-f.grid[0]:a+f.grid[0]:a}}return{top:d-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:g.scrollTop()),left:a-this.offset.click.left-
this.offset.relative.left-this.offset.parent.left+(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:g.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(c,f,g){g=g||this._uiHash();b.ui.plugin.call(this,c,[f,g]);if(c=="drag")this.positionAbs=
this._convertPositionTo("absolute");return b.Widget.prototype._trigger.call(this,c,f,g)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});b.extend(b.ui.draggable,{version:"1.8.6"});b.ui.plugin.add("draggable","connectToSortable",{start:function(c,f){var g=b(this).data("draggable"),e=g.options,a=b.extend({},f,{item:g.element});g.sortables=[];b(e.connectToSortable).each(function(){var d=b.data(this,"sortable");
if(d&&!d.options.disabled){g.sortables.push({instance:d,shouldRevert:d.options.revert});d._refreshItems();d._trigger("activate",c,a)}})},stop:function(c,f){var g=b(this).data("draggable"),e=b.extend({},f,{item:g.element});b.each(g.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;g.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;
g.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,e)}})},drag:function(c,f){var g=b(this).data("draggable"),e=this;b.each(g.sortables,function(){this.instance.positionAbs=g.positionAbs;this.instance.helperProportions=g.helperProportions;this.instance.offset.click=g.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=
1;this.instance.currentItem=b(e).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=g.offset.click.top;this.instance.offset.click.left=g.offset.click.left;this.instance.offset.parent.left-=g.offset.parent.left-this.instance.offset.parent.left;
this.instance.offset.parent.top-=g.offset.parent.top-this.instance.offset.parent.top;g._trigger("toSortable",c);g.dropped=this.instance.element;g.currentItem=g.element;this.instance.fromOutside=g}this.instance.currentItem&&this.instance._mouseDrag(c)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=
this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();g._trigger("fromSortable",c);g.dropped=false}})}});b.ui.plugin.add("draggable","cursor",{start:function(){var c=b("body"),f=b(this).data("draggable").options;if(c.css("cursor"))f._cursor=c.css("cursor");c.css("cursor",f.cursor)},stop:function(){var c=b(this).data("draggable").options;c._cursor&&b("body").css("cursor",c._cursor)}});b.ui.plugin.add("draggable","iframeFix",{start:function(){var c=
b(this).data("draggable").options;b(c.iframeFix===true?"iframe":c.iframeFix).each(function(){b('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(b(this).offset()).appendTo("body")})},stop:function(){b("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});b.ui.plugin.add("draggable","opacity",{start:function(c,f){c=b(f.helper);f=b(this).data("draggable").options;
if(c.css("opacity"))f._opacity=c.css("opacity");c.css("opacity",f.opacity)},stop:function(c,f){c=b(this).data("draggable").options;c._opacity&&b(f.helper).css("opacity",c._opacity)}});b.ui.plugin.add("draggable","scroll",{start:function(){var c=b(this).data("draggable");if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML")c.overflowOffset=c.scrollParent.offset()},drag:function(c){var f=b(this).data("draggable"),g=f.options,e=false;if(f.scrollParent[0]!=document&&f.scrollParent[0].tagName!=
"HTML"){if(!g.axis||g.axis!="x")if(f.overflowOffset.top+f.scrollParent[0].offsetHeight-c.pageY<g.scrollSensitivity)f.scrollParent[0].scrollTop=e=f.scrollParent[0].scrollTop+g.scrollSpeed;else if(c.pageY-f.overflowOffset.top<g.scrollSensitivity)f.scrollParent[0].scrollTop=e=f.scrollParent[0].scrollTop-g.scrollSpeed;if(!g.axis||g.axis!="y")if(f.overflowOffset.left+f.scrollParent[0].offsetWidth-c.pageX<g.scrollSensitivity)f.scrollParent[0].scrollLeft=e=f.scrollParent[0].scrollLeft+g.scrollSpeed;else if(c.pageX-
f.overflowOffset.left<g.scrollSensitivity)f.scrollParent[0].scrollLeft=e=f.scrollParent[0].scrollLeft-g.scrollSpeed}else{if(!g.axis||g.axis!="x")if(c.pageY-b(document).scrollTop()<g.scrollSensitivity)e=b(document).scrollTop(b(document).scrollTop()-g.scrollSpeed);else if(b(window).height()-(c.pageY-b(document).scrollTop())<g.scrollSensitivity)e=b(document).scrollTop(b(document).scrollTop()+g.scrollSpeed);if(!g.axis||g.axis!="y")if(c.pageX-b(document).scrollLeft()<g.scrollSensitivity)e=b(document).scrollLeft(b(document).scrollLeft()-
g.scrollSpeed);else if(b(window).width()-(c.pageX-b(document).scrollLeft())<g.scrollSensitivity)e=b(document).scrollLeft(b(document).scrollLeft()+g.scrollSpeed)}e!==false&&b.ui.ddmanager&&!g.dropBehaviour&&b.ui.ddmanager.prepareOffsets(f,c)}});b.ui.plugin.add("draggable","snap",{start:function(){var c=b(this).data("draggable"),f=c.options;c.snapElements=[];b(f.snap.constructor!=String?f.snap.items||":data(draggable)":f.snap).each(function(){var g=b(this),e=g.offset();this!=c.element[0]&&c.snapElements.push({item:this,
width:g.outerWidth(),height:g.outerHeight(),top:e.top,left:e.left})})},drag:function(c,f){for(var g=b(this).data("draggable"),e=g.options,a=e.snapTolerance,d=f.offset.left,h=d+g.helperProportions.width,i=f.offset.top,j=i+g.helperProportions.height,n=g.snapElements.length-1;n>=0;n--){var q=g.snapElements[n].left,l=q+g.snapElements[n].width,k=g.snapElements[n].top,m=k+g.snapElements[n].height;if(q-a<d&&d<l+a&&k-a<i&&i<m+a||q-a<d&&d<l+a&&k-a<j&&j<m+a||q-a<h&&h<l+a&&k-a<i&&i<m+a||q-a<h&&h<l+a&&k-a<j&&
j<m+a){if(e.snapMode!="inner"){var o=Math.abs(k-j)<=a,p=Math.abs(m-i)<=a,s=Math.abs(q-h)<=a,r=Math.abs(l-d)<=a;if(o)f.position.top=g._convertPositionTo("relative",{top:k-g.helperProportions.height,left:0}).top-g.margins.top;if(p)f.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top;if(s)f.position.left=g._convertPositionTo("relative",{top:0,left:q-g.helperProportions.width}).left-g.margins.left;if(r)f.position.left=g._convertPositionTo("relative",{top:0,left:l}).left-g.margins.left}var u=
o||p||s||r;if(e.snapMode!="outer"){o=Math.abs(k-i)<=a;p=Math.abs(m-j)<=a;s=Math.abs(q-d)<=a;r=Math.abs(l-h)<=a;if(o)f.position.top=g._convertPositionTo("relative",{top:k,left:0}).top-g.margins.top;if(p)f.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top;if(s)f.position.left=g._convertPositionTo("relative",{top:0,left:q}).left-g.margins.left;if(r)f.position.left=g._convertPositionTo("relative",{top:0,left:l-g.helperProportions.width}).left-g.margins.left}if(!g.snapElements[n].snapping&&
(o||p||s||r||u))g.options.snap.snap&&g.options.snap.snap.call(g.element,c,b.extend(g._uiHash(),{snapItem:g.snapElements[n].item}));g.snapElements[n].snapping=o||p||s||r||u}else{g.snapElements[n].snapping&&g.options.snap.release&&g.options.snap.release.call(g.element,c,b.extend(g._uiHash(),{snapItem:g.snapElements[n].item}));g.snapElements[n].snapping=false}}}});b.ui.plugin.add("draggable","stack",{start:function(){var c=b(this).data("draggable").options;c=b.makeArray(b(c.stack)).sort(function(g,e){return(parseInt(b(g).css("zIndex"),
10)||0)-(parseInt(b(e).css("zIndex"),10)||0)});if(c.length){var f=parseInt(c[0].style.zIndex)||0;b(c).each(function(g){this.style.zIndex=f+g});this[0].style.zIndex=f+c.length}}});b.ui.plugin.add("draggable","zIndex",{start:function(c,f){c=b(f.helper);f=b(this).data("draggable").options;if(c.css("zIndex"))f._zIndex=c.css("zIndex");c.css("zIndex",f.zIndex)},stop:function(c,f){c=b(this).data("draggable").options;c._zIndex&&b(f.helper).css("zIndex",c._zIndex)}})})(jQuery);
(function(b){b.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var c=this.options,f=c.accept;this.isover=0;this.isout=1;this.accept=b.isFunction(f)?f:function(g){return g.is(f)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};b.ui.ddmanager.droppables[c.scope]=b.ui.ddmanager.droppables[c.scope]||[];b.ui.ddmanager.droppables[c.scope].push(this);
c.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var c=b.ui.ddmanager.droppables[this.options.scope],f=0;f<c.length;f++)c[f]==this&&c.splice(f,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(c,f){if(c=="accept")this.accept=b.isFunction(f)?f:function(g){return g.is(f)};b.Widget.prototype._setOption.apply(this,arguments)},_activate:function(c){var f=b.ui.ddmanager.current;this.options.activeClass&&
this.element.addClass(this.options.activeClass);f&&this._trigger("activate",c,this.ui(f))},_deactivate:function(c){var f=b.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);f&&this._trigger("deactivate",c,this.ui(f))},_over:function(c){var f=b.ui.ddmanager.current;if(!(!f||(f.currentItem||f.element)[0]==this.element[0]))if(this.accept.call(this.element[0],f.currentItem||f.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
this._trigger("over",c,this.ui(f))}},_out:function(c){var f=b.ui.ddmanager.current;if(!(!f||(f.currentItem||f.element)[0]==this.element[0]))if(this.accept.call(this.element[0],f.currentItem||f.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",c,this.ui(f))}},_drop:function(c,f){var g=f||b.ui.ddmanager.current;if(!g||(g.currentItem||g.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var a=
b.data(this,"droppable");if(a.options.greedy&&!a.options.disabled&&a.options.scope==g.options.scope&&a.accept.call(a.element[0],g.currentItem||g.element)&&b.ui.intersect(g,b.extend(a,{offset:a.element.offset()}),a.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],g.currentItem||g.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
c,this.ui(g));return this.element}return false},ui:function(c){return{draggable:c.currentItem||c.element,helper:c.helper,position:c.position,offset:c.positionAbs}}});b.extend(b.ui.droppable,{version:"1.8.6"});b.ui.intersect=function(c,f,g){if(!f.offset)return false;var e=(c.positionAbs||c.position.absolute).left,a=e+c.helperProportions.width,d=(c.positionAbs||c.position.absolute).top,h=d+c.helperProportions.height,i=f.offset.left,j=i+f.proportions.width,n=f.offset.top,q=n+f.proportions.height;
switch(g){case "fit":return i<=e&&a<=j&&n<=d&&h<=q;case "intersect":return i<e+c.helperProportions.width/2&&a-c.helperProportions.width/2<j&&n<d+c.helperProportions.height/2&&h-c.helperProportions.height/2<q;case "pointer":return b.ui.isOver((c.positionAbs||c.position.absolute).top+(c.clickOffset||c.offset.click).top,(c.positionAbs||c.position.absolute).left+(c.clickOffset||c.offset.click).left,n,i,f.proportions.height,f.proportions.width);case "touch":return(d>=n&&d<=q||h>=n&&h<=q||d<n&&h>q)&&(e>=
i&&e<=j||a>=i&&a<=j||e<i&&a>j);default:return false}};b.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(c,f){var g=b.ui.ddmanager.droppables[c.options.scope]||[],e=f?f.type:null,a=(c.currentItem||c.element).find(":data(droppable)").andSelf(),d=0;a:for(;d<g.length;d++)if(!(g[d].options.disabled||c&&!g[d].accept.call(g[d].element[0],c.currentItem||c.element))){for(var h=0;h<a.length;h++)if(a[h]==g[d].element[0]){g[d].proportions.height=0;continue a}g[d].visible=g[d].element.css("display")!=
"none";if(g[d].visible){g[d].offset=g[d].element.offset();g[d].proportions={width:g[d].element[0].offsetWidth,height:g[d].element[0].offsetHeight};e=="mousedown"&&g[d]._activate.call(g[d],f)}}},drop:function(c,f){var g=false;b.each(b.ui.ddmanager.droppables[c.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&b.ui.intersect(c,this,this.options.tolerance))g=g||this._drop.call(this,f);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],c.currentItem||
c.element)){this.isout=1;this.isover=0;this._deactivate.call(this,f)}}});return g},drag:function(c,f){c.options.refreshPositions&&b.ui.ddmanager.prepareOffsets(c,f);b.each(b.ui.ddmanager.droppables[c.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var g=b.ui.intersect(c,this,this.options.tolerance);if(g=!g&&this.isover==1?"isout":g&&this.isover==0?"isover":null){var e;if(this.options.greedy){var a=this.element.parents(":data(droppable):eq(0)");if(a.length){e=
b.data(a[0],"droppable");e.greedyChild=g=="isover"?1:0}}if(e&&g=="isover"){e.isover=0;e.isout=1;e._out.call(e,f)}this[g]=1;this[g=="isout"?"isover":"isout"]=0;this[g=="isover"?"_over":"_out"].call(this,f);if(e&&g=="isout"){e.isout=0;e.isover=1;e._over.call(e,f)}}}})}}})(jQuery);
(function(b){b.widget("ui.resizable",b.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var g=this,e=this.options;this.element.addClass("ui-resizable");b.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,
_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&b.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(b('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=e.handles||(!b(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var a=this.handles.split(",");this.handles={};for(var d=0;d<a.length;d++){var h=b.trim(a[d]),i=b('<div class="ui-resizable-handle '+("ui-resizable-"+h)+'"></div>');/sw|se|ne|nw/.test(h)&&i.css({zIndex:++e.zIndex});"se"==h&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[h]=".ui-resizable-"+h;this.element.append(i)}}this._renderAxis=function(j){j=j||this.element;for(var n in this.handles){if(this.handles[n].constructor==
String)this.handles[n]=b(this.handles[n],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var q=b(this.handles[n],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(n)?q.outerHeight():q.outerWidth();q=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");j.css(q,l);this._proportionallyResize()}b(this.handles[n])}};this._renderAxis(this.element);this._handles=b(".ui-resizable-handle",this.element).disableSelection();
this._handles.mouseover(function(){if(!g.resizing){if(this.className)var j=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);g.axis=j&&j[1]?j[1]:"se"}});if(e.autoHide){this._handles.hide();b(this.element).addClass("ui-resizable-autohide").hover(function(){b(this).removeClass("ui-resizable-autohide");g._handles.show()},function(){if(!g.resizing){b(this).addClass("ui-resizable-autohide");g._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var g=function(a){b(a).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
if(this.elementIsWrapper){g(this.element);var e=this.element;e.after(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);g(this.originalElement);return this},_mouseCapture:function(g){var e=false;for(var a in this.handles)if(b(this.handles[a])[0]==g.target)e=true;return!this.options.disabled&&e},_mouseStart:function(g){var e=this.options,a=this.element.position(),
d=this.element;this.resizing=true;this.documentScroll={top:b(document).scrollTop(),left:b(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:a.top,left:a.left});b.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();a=c(this.helper.css("left"));var h=c(this.helper.css("top"));if(e.containment){a+=b(e.containment).scrollLeft()||0;h+=b(e.containment).scrollTop()||0}this.offset=
this.helper.offset();this.position={left:a,top:h};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:a,top:h};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=typeof e.aspectRatio=="number"?e.aspectRatio:
this.originalSize.width/this.originalSize.height||1;e=b(".ui-resizable-"+this.axis).css("cursor");b("body").css("cursor",e=="auto"?this.axis+"-resize":e);d.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(g){var e=this.helper,a=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;a=d.apply(this,[g,g.pageX-a.left||0,g.pageY-a.top||0]);if(this._aspectRatio||g.shiftKey)a=this._updateRatio(a,g);a=this._respectSize(a,g);this._propagate("resize",
g);e.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(a);this._trigger("resize",g,this.ui());return false},_mouseStop:function(g){this.resizing=false;var e=this.options,a=this;if(this._helper){var d=this._proportionallyResizeElements,h=d.length&&/textarea/i.test(d[0].nodeName);d=h&&b.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;
h={width:a.size.width-(h?0:a.sizeDiff.width),height:a.size.height-d};d=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var i=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;e.animate||this.element.css(b.extend(h,{top:i,left:d}));a.helper.height(a.size.height);a.helper.width(a.size.width);this._helper&&!e.animate&&this._proportionallyResize()}b("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",
g);this._helper&&this.helper.remove();return false},_updateCache:function(g){this.offset=this.helper.offset();if(f(g.left))this.position.left=g.left;if(f(g.top))this.position.top=g.top;if(f(g.height))this.size.height=g.height;if(f(g.width))this.size.width=g.width},_updateRatio:function(g){var e=this.position,a=this.size,d=this.axis;if(g.height)g.width=a.height*this.aspectRatio;else if(g.width)g.height=a.width/this.aspectRatio;if(d=="sw"){g.left=e.left+(a.width-g.width);g.top=null}if(d=="nw"){g.top=
e.top+(a.height-g.height);g.left=e.left+(a.width-g.width)}return g},_respectSize:function(g){var e=this.options,a=this.axis,d=f(g.width)&&e.maxWidth&&e.maxWidth<g.width,h=f(g.height)&&e.maxHeight&&e.maxHeight<g.height,i=f(g.width)&&e.minWidth&&e.minWidth>g.width,j=f(g.height)&&e.minHeight&&e.minHeight>g.height;if(i)g.width=e.minWidth;if(j)g.height=e.minHeight;if(d)g.width=e.maxWidth;if(h)g.height=e.maxHeight;var n=this.originalPosition.left+this.originalSize.width,q=this.position.top+this.size.height,
l=/sw|nw|w/.test(a);a=/nw|ne|n/.test(a);if(i&&l)g.left=n-e.minWidth;if(d&&l)g.left=n-e.maxWidth;if(j&&a)g.top=q-e.minHeight;if(h&&a)g.top=q-e.maxHeight;if((e=!g.width&&!g.height)&&!g.left&&g.top)g.top=null;else if(e&&!g.top&&g.left)g.left=null;return g},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var g=this.helper||this.element,e=0;e<this._proportionallyResizeElements.length;e++){var a=this._proportionallyResizeElements[e];if(!this.borderDif){var d=[a.css("borderTopWidth"),
a.css("borderRightWidth"),a.css("borderBottomWidth"),a.css("borderLeftWidth")],h=[a.css("paddingTop"),a.css("paddingRight"),a.css("paddingBottom"),a.css("paddingLeft")];this.borderDif=b.map(d,function(i,j){i=parseInt(i,10)||0;j=parseInt(h[j],10)||0;return i+j})}b.browser.msie&&(b(g).is(":hidden")||b(g).parents(":hidden").length)||a.css({height:g.height()-this.borderDif[0]-this.borderDif[2]||0,width:g.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var g=this.options;this.elementOffset=
this.element.offset();if(this._helper){this.helper=this.helper||b('<div style="overflow:hidden;"></div>');var e=b.browser.msie&&b.browser.version<7,a=e?1:0;e=e?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+e,height:this.element.outerHeight()+e,position:"absolute",left:this.elementOffset.left-a+"px",top:this.elementOffset.top-a+"px",zIndex:++g.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(g,e){return{width:this.originalSize.width+
e}},w:function(g,e){return{left:this.originalPosition.left+e,width:this.originalSize.width-e}},n:function(g,e,a){return{top:this.originalPosition.top+a,height:this.originalSize.height-a}},s:function(g,e,a){return{height:this.originalSize.height+a}},se:function(g,e,a){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,e,a]))},sw:function(g,e,a){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,e,a]))},ne:function(g,e,a){return b.extend(this._change.n.apply(this,
arguments),this._change.e.apply(this,[g,e,a]))},nw:function(g,e,a){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,e,a]))}},_propagate:function(g,e){b.ui.plugin.call(this,g,[e,this.ui()]);g!="resize"&&this._trigger(g,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});b.extend(b.ui.resizable,
{version:"1.8.6"});b.ui.plugin.add("resizable","alsoResize",{start:function(){var g=b(this).data("resizable").options,e=function(a){b(a).each(function(){var d=b(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof g.alsoResize=="object"&&!g.alsoResize.parentNode)if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];e(g.alsoResize)}else b.each(g.alsoResize,
function(a){e(a)});else e(g.alsoResize)},resize:function(g,e){var a=b(this).data("resizable");g=a.options;var d=a.originalSize,h=a.originalPosition,i={height:a.size.height-d.height||0,width:a.size.width-d.width||0,top:a.position.top-h.top||0,left:a.position.left-h.left||0},j=function(n,q){b(n).each(function(){var l=b(this),k=b(this).data("resizable-alsoresize"),m={},o=q&&q.length?q:l.parents(e.originalElement[0]).length?["width","height"]:["width","height","top","left"];b.each(o,function(p,s){if((p=
(k[s]||0)+(i[s]||0))&&p>=0)m[s]=p||null});if(b.browser.opera&&/relative/.test(l.css("position"))){a._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(m)})};typeof g.alsoResize=="object"&&!g.alsoResize.nodeType?b.each(g.alsoResize,function(n,q){j(n,q)}):j(g.alsoResize)},stop:function(){var g=b(this).data("resizable"),e=g.options,a=function(d){b(d).each(function(){var h=b(this);h.css({position:h.data("resizable-alsoresize").position})})};if(g._revertToRelativePosition){g._revertToRelativePosition=
false;typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?b.each(e.alsoResize,function(d){a(d)}):a(e.alsoResize)}b(this).removeData("resizable-alsoresize")}});b.ui.plugin.add("resizable","animate",{stop:function(g){var e=b(this).data("resizable"),a=e.options,d=e._proportionallyResizeElements,h=d.length&&/textarea/i.test(d[0].nodeName),i=h&&b.ui.hasScroll(d[0],"left")?0:e.sizeDiff.height;h={width:e.size.width-(h?0:e.sizeDiff.width),height:e.size.height-i};i=parseInt(e.element.css("left"),10)+(e.position.left-
e.originalPosition.left)||null;var j=parseInt(e.element.css("top"),10)+(e.position.top-e.originalPosition.top)||null;e.element.animate(b.extend(h,j&&i?{top:j,left:i}:{}),{duration:a.animateDuration,easing:a.animateEasing,step:function(){var n={width:parseInt(e.element.css("width"),10),height:parseInt(e.element.css("height"),10),top:parseInt(e.element.css("top"),10),left:parseInt(e.element.css("left"),10)};d&&d.length&&b(d[0]).css({width:n.width,height:n.height});e._updateCache(n);e._propagate("resize",
g)}})}});b.ui.plugin.add("resizable","containment",{start:function(){var g=b(this).data("resizable"),e=g.element,a=g.options.containment;if(e=a instanceof b?a.get(0):/parent/.test(a)?e.parent().get(0):a){g.containerElement=b(e);if(/document/.test(a)||a==document){g.containerOffset={left:0,top:0};g.containerPosition={left:0,top:0};g.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}}else{var d=b(e),h=[];b(["Top",
"Right","Left","Bottom"]).each(function(n,q){h[n]=c(d.css("padding"+q))});g.containerOffset=d.offset();g.containerPosition=d.position();g.containerSize={height:d.innerHeight()-h[3],width:d.innerWidth()-h[1]};a=g.containerOffset;var i=g.containerSize.height,j=g.containerSize.width;j=b.ui.hasScroll(e,"left")?e.scrollWidth:j;i=b.ui.hasScroll(e)?e.scrollHeight:i;g.parentData={element:e,left:a.left,top:a.top,width:j,height:i}}}},resize:function(g){var e=b(this).data("resizable"),a=e.options,d=e.containerOffset,
h=e.position;g=e._aspectRatio||g.shiftKey;var i={top:0,left:0},j=e.containerElement;if(j[0]!=document&&/static/.test(j.css("position")))i=d;if(h.left<(e._helper?d.left:0)){e.size.width+=e._helper?e.position.left-d.left:e.position.left-i.left;if(g)e.size.height=e.size.width/a.aspectRatio;e.position.left=a.helper?d.left:0}if(h.top<(e._helper?d.top:0)){e.size.height+=e._helper?e.position.top-d.top:e.position.top;if(g)e.size.width=e.size.height*a.aspectRatio;e.position.top=e._helper?d.top:0}e.offset.left=
e.parentData.left+e.position.left;e.offset.top=e.parentData.top+e.position.top;a=Math.abs((e._helper?e.offset.left-i.left:e.offset.left-i.left)+e.sizeDiff.width);d=Math.abs((e._helper?e.offset.top-i.top:e.offset.top-d.top)+e.sizeDiff.height);h=e.containerElement.get(0)==e.element.parent().get(0);i=/relative|absolute/.test(e.containerElement.css("position"));if(h&&i)a-=e.parentData.left;if(a+e.size.width>=e.parentData.width){e.size.width=e.parentData.width-a;if(g)e.size.height=e.size.width/e.aspectRatio}if(d+
e.size.height>=e.parentData.height){e.size.height=e.parentData.height-d;if(g)e.size.width=e.size.height*e.aspectRatio}},stop:function(){var g=b(this).data("resizable"),e=g.options,a=g.containerOffset,d=g.containerPosition,h=g.containerElement,i=b(g.helper),j=i.offset(),n=i.outerWidth()-g.sizeDiff.width;i=i.outerHeight()-g.sizeDiff.height;g._helper&&!e.animate&&/relative/.test(h.css("position"))&&b(this).css({left:j.left-d.left-a.left,width:n,height:i});g._helper&&!e.animate&&/static/.test(h.css("position"))&&
b(this).css({left:j.left-d.left-a.left,width:n,height:i})}});b.ui.plugin.add("resizable","ghost",{start:function(){var g=b(this).data("resizable"),e=g.options,a=g.size;g.ghost=g.originalElement.clone();g.ghost.css({opacity:0.25,display:"block",position:"relative",height:a.height,width:a.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:"");g.ghost.appendTo(g.helper)},resize:function(){var g=b(this).data("resizable");g.ghost&&g.ghost.css({position:"relative",
height:g.size.height,width:g.size.width})},stop:function(){var g=b(this).data("resizable");g.ghost&&g.helper&&g.helper.get(0).removeChild(g.ghost.get(0))}});b.ui.plugin.add("resizable","grid",{resize:function(){var g=b(this).data("resizable"),e=g.options,a=g.size,d=g.originalSize,h=g.originalPosition,i=g.axis;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var j=Math.round((a.width-d.width)/(e.grid[0]||1))*(e.grid[0]||1);e=Math.round((a.height-d.height)/(e.grid[1]||1))*(e.grid[1]||1);if(/^(se|s|e)$/.test(i)){g.size.width=
d.width+j;g.size.height=d.height+e}else if(/^(ne)$/.test(i)){g.size.width=d.width+j;g.size.height=d.height+e;g.position.top=h.top-e}else{if(/^(sw)$/.test(i)){g.size.width=d.width+j;g.size.height=d.height+e}else{g.size.width=d.width+j;g.size.height=d.height+e;g.position.top=h.top-e}g.position.left=h.left-j}}});var c=function(g){return parseInt(g,10)||0},f=function(g){return!isNaN(parseInt(g,10))}})(jQuery);
(function(b){b.widget("ui.selectable",b.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=b(c.options.filter,c.element[0]);f.each(function(){var g=b(this),e=g.offset();b.data(this,"selectable-item",{element:this,$element:g,left:e.left,top:e.top,right:e.left+g.outerWidth(),bottom:e.top+g.outerHeight(),startselected:false,selected:g.hasClass("ui-selected"),
selecting:g.hasClass("ui-selecting"),unselecting:g.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=b("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
c.pageY];if(!this.options.disabled){var g=this.options;this.selectees=b(g.filter,this.element[0]);this._trigger("start",c);b(g.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});g.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var e=b.data(this,"selectable-item");e.startselected=true;if(!c.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;f._trigger("unselecting",
c,{unselecting:e.element})}});b(c.target).parents().andSelf().each(function(){var e=b.data(this,"selectable-item");if(e){var a=!c.metaKey||!e.$element.hasClass("ui-selected");e.$element.removeClass(a?"ui-unselecting":"ui-selected").addClass(a?"ui-selecting":"ui-unselecting");e.unselecting=!a;e.selecting=a;(e.selected=a)?f._trigger("selecting",c,{selecting:e.element}):f._trigger("unselecting",c,{unselecting:e.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var g=
this.options,e=this.opos[0],a=this.opos[1],d=c.pageX,h=c.pageY;if(e>d){var i=d;d=e;e=i}if(a>h){i=h;h=a;a=i}this.helper.css({left:e,top:a,width:d-e,height:h-a});this.selectees.each(function(){var j=b.data(this,"selectable-item");if(!(!j||j.element==f.element[0])){var n=false;if(g.tolerance=="touch")n=!(j.left>d||j.right<e||j.top>h||j.bottom<a);else if(g.tolerance=="fit")n=j.left>e&&j.right<d&&j.top>a&&j.bottom<h;if(n){if(j.selected){j.$element.removeClass("ui-selected");j.selected=false}if(j.unselecting){j.$element.removeClass("ui-unselecting");
j.unselecting=false}if(!j.selecting){j.$element.addClass("ui-selecting");j.selecting=true;f._trigger("selecting",c,{selecting:j.element})}}else{if(j.selecting)if(c.metaKey&&j.startselected){j.$element.removeClass("ui-selecting");j.selecting=false;j.$element.addClass("ui-selected");j.selected=true}else{j.$element.removeClass("ui-selecting");j.selecting=false;if(j.startselected){j.$element.addClass("ui-unselecting");j.unselecting=true}f._trigger("unselecting",c,{unselecting:j.element})}if(j.selected)if(!c.metaKey&&
!j.startselected){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;f._trigger("unselecting",c,{unselecting:j.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;b(".ui-unselecting",this.element[0]).each(function(){var g=b.data(this,"selectable-item");g.$element.removeClass("ui-unselecting");g.unselecting=false;g.startselected=false;f._trigger("unselected",c,{unselected:g.element})});b(".ui-selecting",this.element[0]).each(function(){var g=
b.data(this,"selectable-item");g.$element.removeClass("ui-selecting").addClass("ui-selected");g.selecting=false;g.selected=true;g.startselected=true;f._trigger("selected",c,{selected:g.element})});this._trigger("stop",c);this.helper.remove();return false}});b.extend(b.ui.selectable,{version:"1.8.6"})})(jQuery);
(function(b){b.widget("ui.sortable",b.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");
this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var c=this.items.length-1;c>=0;c--)this.items[c].item.removeData("sortable-item");return this},_setOption:function(c,f){if(c==="disabled"){this.options[c]=f;this.widget()[f?"addClass":"removeClass"]("ui-sortable-disabled")}else b.Widget.prototype._setOption.apply(this,
arguments)},_mouseCapture:function(c,f){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(c);var g=null,e=this;b(c.target).parents().each(function(){if(b.data(this,"sortable-item")==e){g=b(this);return false}});if(b.data(c.target,"sortable-item")==e)g=b(c.target);if(!g)return false;if(this.options.handle&&!f){var a=false;b(this.options.handle,g).find("*").andSelf().each(function(){if(this==c.target)a=true});if(!a)return false}this.currentItem=
g;this._removeCurrentsFromItems();return true},_mouseStart:function(c,f,g){f=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(c);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");b.extend(this.offset,
{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(c);this.originalPageX=c.pageX;this.originalPageY=c.pageY;f.cursorAt&&this._adjustOffsetFromHelper(f.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();f.containment&&this._setContainment();
if(f.cursor){if(b("body").css("cursor"))this._storedCursor=b("body").css("cursor");b("body").css("cursor",f.cursor)}if(f.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",f.opacity)}if(f.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",f.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",
c,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!g)for(g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",c,e._uiHash(this));if(b.ui.ddmanager)b.ui.ddmanager.current=this;b.ui.ddmanager&&!f.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,c);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(c);return true},_mouseDrag:function(c){this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");
if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var f=this.options,g=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-c.pageY<f.scrollSensitivity)this.scrollParent[0].scrollTop=g=this.scrollParent[0].scrollTop+f.scrollSpeed;else if(c.pageY-this.overflowOffset.top<f.scrollSensitivity)this.scrollParent[0].scrollTop=g=this.scrollParent[0].scrollTop-f.scrollSpeed;if(this.overflowOffset.left+
this.scrollParent[0].offsetWidth-c.pageX<f.scrollSensitivity)this.scrollParent[0].scrollLeft=g=this.scrollParent[0].scrollLeft+f.scrollSpeed;else if(c.pageX-this.overflowOffset.left<f.scrollSensitivity)this.scrollParent[0].scrollLeft=g=this.scrollParent[0].scrollLeft-f.scrollSpeed}else{if(c.pageY-b(document).scrollTop()<f.scrollSensitivity)g=b(document).scrollTop(b(document).scrollTop()-f.scrollSpeed);else if(b(window).height()-(c.pageY-b(document).scrollTop())<f.scrollSensitivity)g=b(document).scrollTop(b(document).scrollTop()+
f.scrollSpeed);if(c.pageX-b(document).scrollLeft()<f.scrollSensitivity)g=b(document).scrollLeft(b(document).scrollLeft()-f.scrollSpeed);else if(b(window).width()-(c.pageX-b(document).scrollLeft())<f.scrollSensitivity)g=b(document).scrollLeft(b(document).scrollLeft()+f.scrollSpeed)}g!==false&&b.ui.ddmanager&&!f.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,c)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+
"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(f=this.items.length-1;f>=0;f--){g=this.items[f];var e=g.item[0],a=this._intersectsWithPointer(g);if(a)if(e!=this.currentItem[0]&&this.placeholder[a==1?"next":"prev"]()[0]!=e&&!b.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!b.ui.contains(this.element[0],e):true)){this.direction=a==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(g))this._rearrange(c,
g);else break;this._trigger("change",c,this._uiHash());break}}this._contactContainers(c);b.ui.ddmanager&&b.ui.ddmanager.drag(this,c);this._trigger("sort",c,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,f){if(c){b.ui.ddmanager&&!this.options.dropBehaviour&&b.ui.ddmanager.drop(this,c);if(this.options.revert){var g=this;f=g.placeholder.offset();g.reverting=true;b(this.helper).animate({left:f.left-this.offset.parent.left-g.margins.left+(this.offsetParent[0]==
document.body?0:this.offsetParent[0].scrollLeft),top:f.top-this.offset.parent.top-g.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){g._clear(c)})}else this._clear(c,f);return false}},cancel:function(){var c=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var f=this.containers.length-1;f>=0;f--){this.containers[f]._trigger("deactivate",
null,c._uiHash(this));if(this.containers[f].containerCache.over){this.containers[f]._trigger("out",null,c._uiHash(this));this.containers[f].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();b.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?b(this.domPosition.prev).after(this.currentItem):
b(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(c){var f=this._getItemsAsjQuery(c&&c.connected),g=[];c=c||{};b(f).each(function(){var e=(b(c.item||this).attr(c.attribute||"id")||"").match(c.expression||/(.+)[-=_](.+)/);if(e)g.push((c.key||e[1]+"[]")+"="+(c.key&&c.expression?e[1]:e[2]))});!g.length&&c.key&&g.push(c.key+"=");return g.join("&")},toArray:function(c){var f=this._getItemsAsjQuery(c&&c.connected),g=[];c=c||{};f.each(function(){g.push(b(c.item||this).attr(c.attribute||
"id")||"")});return g},_intersectsWith:function(c){var f=this.positionAbs.left,g=f+this.helperProportions.width,e=this.positionAbs.top,a=e+this.helperProportions.height,d=c.left,h=d+c.width,i=c.top,j=i+c.height,n=this.offset.click.top,q=this.offset.click.left;n=e+n>i&&e+n<j&&f+q>d&&f+q<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>c[this.floating?"width":"height"]?n:d<f+
this.helperProportions.width/2&&g-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&a-this.helperProportions.height/2<j},_intersectsWithPointer:function(c){var f=b.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,c.top,c.height);c=b.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,c.left,c.width);f=f&&c;c=this._getDragVerticalDirection();var g=this._getDragHorizontalDirection();if(!f)return false;return this.floating?g&&g=="right"||c=="down"?2:1:c&&(c=="down"?
2:1)},_intersectsWithSides:function(c){var f=b.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,c.top+c.height/2,c.height);c=b.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,c.left+c.width/2,c.width);var g=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&c||e=="left"&&!c:g&&(g=="down"&&f||g=="up"&&!f)},_getDragVerticalDirection:function(){var c=this.positionAbs.top-this.lastPositionAbs.top;return c!=0&&(c>0?"down":"up")},
_getDragHorizontalDirection:function(){var c=this.positionAbs.left-this.lastPositionAbs.left;return c!=0&&(c>0?"right":"left")},refresh:function(c){this._refreshItems(c);this.refreshPositions();return this},_connectWith:function(){var c=this.options;return c.connectWith.constructor==String?[c.connectWith]:c.connectWith},_getItemsAsjQuery:function(c){var f=[],g=[],e=this._connectWith();if(e&&c)for(c=e.length-1;c>=0;c--)for(var a=b(e[c]),d=a.length-1;d>=0;d--){var h=b.data(a[d],"sortable");if(h&&h!=
this&&!h.options.disabled)g.push([b.isFunction(h.options.items)?h.options.items.call(h.element):b(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}g.push([b.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):b(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(c=g.length-1;c>=0;c--)g[c][0].each(function(){f.push(this)});return b(f)},_removeCurrentsFromItems:function(){for(var c=
this.currentItem.find(":data(sortable-item)"),f=0;f<this.items.length;f++)for(var g=0;g<c.length;g++)c[g]==this.items[f].item[0]&&this.items.splice(f,1)},_refreshItems:function(c){this.items=[];this.containers=[this];var f=this.items,g=[[b.isFunction(this.options.items)?this.options.items.call(this.element[0],c,{item:this.currentItem}):b(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var a=e.length-1;a>=0;a--)for(var d=b(e[a]),h=d.length-1;h>=0;h--){var i=b.data(d[h],"sortable");
if(i&&i!=this&&!i.options.disabled){g.push([b.isFunction(i.options.items)?i.options.items.call(i.element[0],c,{item:this.currentItem}):b(i.options.items,i.element),i]);this.containers.push(i)}}for(a=g.length-1;a>=0;a--){c=g[a][1];e=g[a][0];h=0;for(d=e.length;h<d;h++){i=b(e[h]);i.data("sortable-item",c);f.push({item:i,instance:c,width:0,height:0,left:0,top:0})}}},refreshPositions:function(c){if(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();for(var f=this.items.length-1;f>=
0;f--){var g=this.items[f],e=this.options.toleranceElement?b(this.options.toleranceElement,g.item):g.item;if(!c){g.width=e.outerWidth();g.height=e.outerHeight()}e=e.offset();g.left=e.left;g.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(f=this.containers.length-1;f>=0;f--){e=this.containers[f].element.offset();this.containers[f].containerCache.left=e.left;this.containers[f].containerCache.top=e.top;this.containers[f].containerCache.width=
this.containers[f].element.outerWidth();this.containers[f].containerCache.height=this.containers[f].element.outerHeight()}return this},_createPlaceholder:function(c){var f=c||this,g=f.options;if(!g.placeholder||g.placeholder.constructor==String){var e=g.placeholder;g.placeholder={element:function(){var a=b(document.createElement(f.currentItem[0].nodeName)).addClass(e||f.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)a.style.visibility="hidden";return a},
update:function(a,d){if(!(e&&!g.forcePlaceholderSize)){d.height()||d.height(f.currentItem.innerHeight()-parseInt(f.currentItem.css("paddingTop")||0,10)-parseInt(f.currentItem.css("paddingBottom")||0,10));d.width()||d.width(f.currentItem.innerWidth()-parseInt(f.currentItem.css("paddingLeft")||0,10)-parseInt(f.currentItem.css("paddingRight")||0,10))}}}}f.placeholder=b(g.placeholder.element.call(f.element,f.currentItem));f.currentItem.after(f.placeholder);g.placeholder.update(f,f.placeholder)},_contactContainers:function(c){for(var f=
null,g=null,e=this.containers.length-1;e>=0;e--)if(!b.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(f&&b.ui.contains(this.containers[e].element[0],f.element[0]))){f=this.containers[e];g=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",c,this._uiHash(this));this.containers[e].containerCache.over=0}if(f)if(this.containers.length===1){this.containers[g]._trigger("over",c,this._uiHash(this));
this.containers[g].containerCache.over=1}else if(this.currentContainer!=this.containers[g]){f=1E4;e=null;for(var a=this.positionAbs[this.containers[g].floating?"left":"top"],d=this.items.length-1;d>=0;d--)if(b.ui.contains(this.containers[g].element[0],this.items[d].item[0])){var h=this.items[d][this.containers[g].floating?"left":"top"];if(Math.abs(h-a)<f){f=Math.abs(h-a);e=this.items[d]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[g];e?this._rearrange(c,e,null,true):this._rearrange(c,
null,this.containers[g].element,true);this._trigger("change",c,this._uiHash());this.containers[g]._trigger("change",c,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[g]._trigger("over",c,this._uiHash(this));this.containers[g].containerCache.over=1}}},_createHelper:function(c){var f=this.options;c=b.isFunction(f.helper)?b(f.helper.apply(this.element[0],[c,this.currentItem])):f.helper=="clone"?this.currentItem.clone():this.currentItem;c.parents("body").length||
b(f.appendTo!="parent"?f.appendTo:this.currentItem[0].parentNode)[0].appendChild(c[0]);if(c[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(c[0].style.width==""||f.forceHelperSize)c.width(this.currentItem.width());if(c[0].style.height==""||f.forceHelperSize)c.height(this.currentItem.height());return c},_adjustOffsetFromHelper:function(c){if(typeof c==
"string")c=c.split(" ");if(b.isArray(c))c={left:+c[0],top:+c[1]||0};if("left"in c)this.offset.click.left=c.left+this.margins.left;if("right"in c)this.offset.click.left=this.helperProportions.width-c.right+this.margins.left;if("top"in c)this.offset.click.top=c.top+this.margins.top;if("bottom"in c)this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition==
"absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)c={top:0,left:0};return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==
"relative"){var c=this.currentItem.position();return{top:c.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},
_setContainment:function(){var c=this.options;if(c.containment=="parent")c.containment=this.helper[0].parentNode;if(c.containment=="document"||c.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(c.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b(c.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-
this.margins.top];if(!/^(document|window|parent)$/.test(c.containment)){var f=b(c.containment)[0];c=b(c.containment).offset();var g=b(f).css("overflow")!="hidden";this.containment=[c.left+(parseInt(b(f).css("borderLeftWidth"),10)||0)+(parseInt(b(f).css("paddingLeft"),10)||0)-this.margins.left,c.top+(parseInt(b(f).css("borderTopWidth"),10)||0)+(parseInt(b(f).css("paddingTop"),10)||0)-this.margins.top,c.left+(g?Math.max(f.scrollWidth,f.offsetWidth):f.offsetWidth)-(parseInt(b(f).css("borderLeftWidth"),
10)||0)-(parseInt(b(f).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,c.top+(g?Math.max(f.scrollHeight,f.offsetHeight):f.offsetHeight)-(parseInt(b(f).css("borderTopWidth"),10)||0)-(parseInt(b(f).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(c,f){if(!f)f=this.position;c=c=="absolute"?1:-1;var g=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?
this.offsetParent:this.scrollParent,e=/(html|body)/i.test(g[0].tagName);return{top:f.top+this.offset.relative.top*c+this.offset.parent.top*c-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:g.scrollTop())*c),left:f.left+this.offset.relative.left*c+this.offset.parent.left*c-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:g.scrollLeft())*c)}},_generatePosition:function(c){var f=
this.options,g=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(g[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var a=c.pageX,d=c.pageY;if(this.originalPosition){if(this.containment){if(c.pageX-this.offset.click.left<this.containment[0])a=this.containment[0]+
this.offset.click.left;if(c.pageY-this.offset.click.top<this.containment[1])d=this.containment[1]+this.offset.click.top;if(c.pageX-this.offset.click.left>this.containment[2])a=this.containment[2]+this.offset.click.left;if(c.pageY-this.offset.click.top>this.containment[3])d=this.containment[3]+this.offset.click.top}if(f.grid){d=this.originalPageY+Math.round((d-this.originalPageY)/f.grid[1])*f.grid[1];d=this.containment?!(d-this.offset.click.top<this.containment[1]||d-this.offset.click.top>this.containment[3])?
d:!(d-this.offset.click.top<this.containment[1])?d-f.grid[1]:d+f.grid[1]:d;a=this.originalPageX+Math.round((a-this.originalPageX)/f.grid[0])*f.grid[0];a=this.containment?!(a-this.offset.click.left<this.containment[0]||a-this.offset.click.left>this.containment[2])?a:!(a-this.offset.click.left<this.containment[0])?a-f.grid[0]:a+f.grid[0]:a}}return{top:d-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(b.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():
e?0:g.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(b.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:g.scrollLeft())}},_rearrange:function(c,f,g,e){g?g[0].appendChild(this.placeholder[0]):f.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?f.item[0]:f.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var a=this,d=this.counter;window.setTimeout(function(){d==
a.counter&&a.refreshPositions(!e)},0)},_clear:function(c,f){this.reverting=false;var g=[];!this._noFinalSort&&this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!f&&g.push(function(a){this._trigger("receive",
a,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!f)g.push(function(a){this._trigger("update",a,this._uiHash())});if(!b.ui.contains(this.element[0],this.currentItem[0])){f||g.push(function(a){this._trigger("remove",a,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(b.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!f){g.push(function(a){return function(d){a._trigger("receive",
d,this._uiHash(this))}}.call(this,this.containers[e]));g.push(function(a){return function(d){a._trigger("update",d,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){f||g.push(function(a){return function(d){a._trigger("deactivate",d,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){g.push(function(a){return function(d){a._trigger("out",d,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=
0}}this._storedCursor&&b("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!f){this._trigger("beforeStop",c,this._uiHash());for(e=0;e<g.length;e++)g[e].call(this,c);this._trigger("stop",c,this._uiHash())}return false}f||this._trigger("beforeStop",c,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!f){for(e=0;e<g.length;e++)g[e].call(this,c);this._trigger("stop",c,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){b.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(c){var f=c||this;return{helper:f.helper,placeholder:f.placeholder||b([]),position:f.position,originalPosition:f.originalPosition,offset:f.positionAbs,item:f.currentItem,sender:c?c.element:null}}});
b.extend(b.ui.sortable,{version:"1.8.6"})})(jQuery);
jQuery.effects||function(b,c){function f(l){var k;if(l&&l.constructor==Array&&l.length==3)return l;if(k=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(l))return[parseInt(k[1],10),parseInt(k[2],10),parseInt(k[3],10)];if(k=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(l))return[parseFloat(k[1])*2.55,parseFloat(k[2])*2.55,parseFloat(k[3])*2.55];if(k=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(l))return[parseInt(k[1],16),
parseInt(k[2],16),parseInt(k[3],16)];if(k=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(l))return[parseInt(k[1]+k[1],16),parseInt(k[2]+k[2],16),parseInt(k[3]+k[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(l))return j.transparent;return j[b.trim(l).toLowerCase()]}function g(l,k){var m;do{m=b.curCSS(l,k);if(m!=""&&m!="transparent"||b.nodeName(l,"body"))break;k="backgroundColor"}while(l=l.parentNode);return f(m)}function e(){var l=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
k={},m,o;if(l&&l.length&&l[0]&&l[l[0]])for(var p=l.length;p--;){m=l[p];if(typeof l[m]=="string"){o=m.replace(/\-(\w)/g,function(s,r){return r.toUpperCase()});k[o]=l[m]}}else for(m in l)if(typeof l[m]==="string")k[m]=l[m];return k}function a(l){var k,m;for(k in l){m=l[k];if(m==null||b.isFunction(m)||k in q||/scrollbar/.test(k)||!/color/i.test(k)&&isNaN(parseFloat(m)))delete l[k]}return l}function d(l,k){var m={_:0},o;for(o in k)if(l[o]!=k[o])m[o]=k[o];return m}function h(l,k,m,o){if(typeof l=="object"){o=
k;m=null;k=l;l=k.effect}if(b.isFunction(k)){o=k;m=null;k={}}if(typeof k=="number"||b.fx.speeds[k]){o=m;m=k;k={}}if(b.isFunction(m)){o=m;m=null}k=k||{};m=m||k.duration;m=b.fx.off?0:typeof m=="number"?m:b.fx.speeds[m]||b.fx.speeds._default;o=o||k.complete;return[l,k,m,o]}function i(l){if(!l||typeof l==="number"||b.fx.speeds[l])return true;if(typeof l==="string"&&!b.effects[l])return true;return false}b.effects={};b.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor",
"borderColor","color","outlineColor"],function(l,k){b.fx.step[k]=function(m){if(!m.colorInit){m.start=g(m.elem,k);m.end=f(m.end);m.colorInit=true}m.elem.style[k]="rgb("+Math.max(Math.min(parseInt(m.pos*(m.end[0]-m.start[0])+m.start[0],10),255),0)+","+Math.max(Math.min(parseInt(m.pos*(m.end[1]-m.start[1])+m.start[1],10),255),0)+","+Math.max(Math.min(parseInt(m.pos*(m.end[2]-m.start[2])+m.start[2],10),255),0)+")"}});var j={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,
0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],
lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},n=["add","remove","toggle"],q={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};b.effects.animateClass=function(l,k,m,o){if(b.isFunction(m)){o=
m;m=null}return this.each(function(){var p=b(this),s=p.attr("style")||" ",r=a(e.call(this)),u,v=p.attr("className");b.each(n,function(w,y){l[y]&&p[y+"Class"](l[y])});u=a(e.call(this));p.attr("className",v);p.animate(d(r,u),k,m,function(){b.each(n,function(w,y){l[y]&&p[y+"Class"](l[y])});if(typeof p.attr("style")=="object"){p.attr("style").cssText="";p.attr("style").cssText=s}else p.attr("style",s);o&&o.apply(this,arguments)})})};b.fn.extend({_addClass:b.fn.addClass,addClass:function(l,k,m,o){return k?
b.effects.animateClass.apply(this,[{add:l},k,m,o]):this._addClass(l)},_removeClass:b.fn.removeClass,removeClass:function(l,k,m,o){return k?b.effects.animateClass.apply(this,[{remove:l},k,m,o]):this._removeClass(l)},_toggleClass:b.fn.toggleClass,toggleClass:function(l,k,m,o,p){return typeof k=="boolean"||k===c?m?b.effects.animateClass.apply(this,[k?{add:l}:{remove:l},m,o,p]):this._toggleClass(l,k):b.effects.animateClass.apply(this,[{toggle:l},k,m,o])},switchClass:function(l,k,m,o,p){return b.effects.animateClass.apply(this,
[{add:k,remove:l},m,o,p])}});b.extend(b.effects,{version:"1.8.6",save:function(l,k){for(var m=0;m<k.length;m++)k[m]!==null&&l.data("ec.storage."+k[m],l[0].style[k[m]])},restore:function(l,k){for(var m=0;m<k.length;m++)k[m]!==null&&l.css(k[m],l.data("ec.storage."+k[m]))},setMode:function(l,k){if(k=="toggle")k=l.is(":hidden")?"show":"hide";return k},getBaseline:function(l,k){var m;switch(l[0]){case "top":m=0;break;case "middle":m=0.5;break;case "bottom":m=1;break;default:m=l[0]/k.height}switch(l[1]){case "left":l=
0;break;case "center":l=0.5;break;case "right":l=1;break;default:l=l[1]/k.width}return{x:l,y:m}},createWrapper:function(l){if(l.parent().is(".ui-effects-wrapper"))return l.parent();var k={width:l.outerWidth(true),height:l.outerHeight(true),"float":l.css("float")},m=b("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});l.wrap(m);m=l.parent();if(l.css("position")=="static"){m.css({position:"relative"});l.css({position:"relative"})}else{b.extend(k,
{position:l.css("position"),zIndex:l.css("z-index")});b.each(["top","left","bottom","right"],function(o,p){k[p]=l.css(p);if(isNaN(parseInt(k[p],10)))k[p]="auto"});l.css({position:"relative",top:0,left:0})}return m.css(k).show()},removeWrapper:function(l){if(l.parent().is(".ui-effects-wrapper"))return l.parent().replaceWith(l);return l},setTransition:function(l,k,m,o){o=o||{};b.each(k,function(p,s){unit=l.cssUnit(s);if(unit[0]>0)o[s]=unit[0]*m+unit[1]});return o}});b.fn.extend({effect:function(l){var k=
h.apply(this,arguments),m={options:k[1],duration:k[2],callback:k[3]};k=m.options.mode;var o=b.effects[l];if(b.fx.off||!o)return k?this[k](m.duration,m.callback):this.each(function(){m.callback&&m.callback.call(this)});return o.call(this,m)},_show:b.fn.show,show:function(l){if(i(l))return this._show.apply(this,arguments);else{var k=h.apply(this,arguments);k[1].mode="show";return this.effect.apply(this,k)}},_hide:b.fn.hide,hide:function(l){if(i(l))return this._hide.apply(this,arguments);else{var k=
h.apply(this,arguments);k[1].mode="hide";return this.effect.apply(this,k)}},__toggle:b.fn.toggle,toggle:function(l){if(i(l)||typeof l==="boolean"||b.isFunction(l))return this.__toggle.apply(this,arguments);else{var k=h.apply(this,arguments);k[1].mode="toggle";return this.effect.apply(this,k)}},cssUnit:function(l){var k=this.css(l),m=[];b.each(["em","px","%","pt"],function(o,p){if(k.indexOf(p)>0)m=[parseFloat(k),p]});return m}});b.easing.jswing=b.easing.swing;b.extend(b.easing,{def:"easeOutQuad",swing:function(l,
k,m,o,p){return b.easing[b.easing.def](l,k,m,o,p)},easeInQuad:function(l,k,m,o,p){return o*(k/=p)*k+m},easeOutQuad:function(l,k,m,o,p){return-o*(k/=p)*(k-2)+m},easeInOutQuad:function(l,k,m,o,p){if((k/=p/2)<1)return o/2*k*k+m;return-o/2*(--k*(k-2)-1)+m},easeInCubic:function(l,k,m,o,p){return o*(k/=p)*k*k+m},easeOutCubic:function(l,k,m,o,p){return o*((k=k/p-1)*k*k+1)+m},easeInOutCubic:function(l,k,m,o,p){if((k/=p/2)<1)return o/2*k*k*k+m;return o/2*((k-=2)*k*k+2)+m},easeInQuart:function(l,k,m,o,p){return o*
(k/=p)*k*k*k+m},easeOutQuart:function(l,k,m,o,p){return-o*((k=k/p-1)*k*k*k-1)+m},easeInOutQuart:function(l,k,m,o,p){if((k/=p/2)<1)return o/2*k*k*k*k+m;return-o/2*((k-=2)*k*k*k-2)+m},easeInQuint:function(l,k,m,o,p){return o*(k/=p)*k*k*k*k+m},easeOutQuint:function(l,k,m,o,p){return o*((k=k/p-1)*k*k*k*k+1)+m},easeInOutQuint:function(l,k,m,o,p){if((k/=p/2)<1)return o/2*k*k*k*k*k+m;return o/2*((k-=2)*k*k*k*k+2)+m},easeInSine:function(l,k,m,o,p){return-o*Math.cos(k/p*(Math.PI/2))+o+m},easeOutSine:function(l,
k,m,o,p){return o*Math.sin(k/p*(Math.PI/2))+m},easeInOutSine:function(l,k,m,o,p){return-o/2*(Math.cos(Math.PI*k/p)-1)+m},easeInExpo:function(l,k,m,o,p){return k==0?m:o*Math.pow(2,10*(k/p-1))+m},easeOutExpo:function(l,k,m,o,p){return k==p?m+o:o*(-Math.pow(2,-10*k/p)+1)+m},easeInOutExpo:function(l,k,m,o,p){if(k==0)return m;if(k==p)return m+o;if((k/=p/2)<1)return o/2*Math.pow(2,10*(k-1))+m;return o/2*(-Math.pow(2,-10*--k)+2)+m},easeInCirc:function(l,k,m,o,p){return-o*(Math.sqrt(1-(k/=p)*k)-1)+m},easeOutCirc:function(l,
k,m,o,p){return o*Math.sqrt(1-(k=k/p-1)*k)+m},easeInOutCirc:function(l,k,m,o,p){if((k/=p/2)<1)return-o/2*(Math.sqrt(1-k*k)-1)+m;return o/2*(Math.sqrt(1-(k-=2)*k)+1)+m},easeInElastic:function(l,k,m,o,p){l=1.70158;var s=0,r=o;if(k==0)return m;if((k/=p)==1)return m+o;s||(s=p*0.3);if(r<Math.abs(o)){r=o;l=s/4}else l=s/(2*Math.PI)*Math.asin(o/r);return-(r*Math.pow(2,10*(k-=1))*Math.sin((k*p-l)*2*Math.PI/s))+m},easeOutElastic:function(l,k,m,o,p){l=1.70158;var s=0,r=o;if(k==0)return m;if((k/=p)==1)return m+
o;s||(s=p*0.3);if(r<Math.abs(o)){r=o;l=s/4}else l=s/(2*Math.PI)*Math.asin(o/r);return r*Math.pow(2,-10*k)*Math.sin((k*p-l)*2*Math.PI/s)+o+m},easeInOutElastic:function(l,k,m,o,p){l=1.70158;var s=0,r=o;if(k==0)return m;if((k/=p/2)==2)return m+o;s||(s=p*0.3*1.5);if(r<Math.abs(o)){r=o;l=s/4}else l=s/(2*Math.PI)*Math.asin(o/r);if(k<1)return-0.5*r*Math.pow(2,10*(k-=1))*Math.sin((k*p-l)*2*Math.PI/s)+m;return r*Math.pow(2,-10*(k-=1))*Math.sin((k*p-l)*2*Math.PI/s)*0.5+o+m},easeInBack:function(l,k,m,o,p,s){if(s==
c)s=1.70158;return o*(k/=p)*k*((s+1)*k-s)+m},easeOutBack:function(l,k,m,o,p,s){if(s==c)s=1.70158;return o*((k=k/p-1)*k*((s+1)*k+s)+1)+m},easeInOutBack:function(l,k,m,o,p,s){if(s==c)s=1.70158;if((k/=p/2)<1)return o/2*k*k*(((s*=1.525)+1)*k-s)+m;return o/2*((k-=2)*k*(((s*=1.525)+1)*k+s)+2)+m},easeInBounce:function(l,k,m,o,p){return o-b.easing.easeOutBounce(l,p-k,0,o,p)+m},easeOutBounce:function(l,k,m,o,p){return(k/=p)<1/2.75?o*7.5625*k*k+m:k<2/2.75?o*(7.5625*(k-=1.5/2.75)*k+0.75)+m:k<2.5/2.75?o*(7.5625*
(k-=2.25/2.75)*k+0.9375)+m:o*(7.5625*(k-=2.625/2.75)*k+0.984375)+m},easeInOutBounce:function(l,k,m,o,p){if(k<p/2)return b.easing.easeInBounce(l,k*2,0,o,p)*0.5+m;return b.easing.easeOutBounce(l,k*2-p,0,o,p)*0.5+o*0.5+m}})}(jQuery);
(function(b){b.effects.blind=function(c){return this.queue(function(){var f=b(this),g=["position","top","left"],e=b.effects.setMode(f,c.options.mode||"hide"),a=c.options.direction||"vertical";b.effects.save(f,g);f.show();var d=b.effects.createWrapper(f).css({overflow:"hidden"}),h=a=="vertical"?"height":"width";a=a=="vertical"?d.height():d.width();e=="show"&&d.css(h,0);var i={};i[h]=e=="show"?a:0;d.animate(i,c.duration,c.options.easing,function(){e=="hide"&&f.hide();b.effects.restore(f,g);b.effects.removeWrapper(f);
c.callback&&c.callback.apply(f[0],arguments);f.dequeue()})})}})(jQuery);
(function(b){b.effects.bounce=function(c){return this.queue(function(){var f=b(this),g=["position","top","left"],e=b.effects.setMode(f,c.options.mode||"effect"),a=c.options.direction||"up",d=c.options.distance||20,h=c.options.times||5,i=c.duration||250;/show|hide/.test(e)&&g.push("opacity");b.effects.save(f,g);f.show();b.effects.createWrapper(f);var j=a=="up"||a=="down"?"top":"left";a=a=="up"||a=="left"?"pos":"neg";d=c.options.distance||(j=="top"?f.outerHeight({margin:true})/3:f.outerWidth({margin:true})/
3);if(e=="show")f.css("opacity",0).css(j,a=="pos"?-d:d);if(e=="hide")d/=h*2;e!="hide"&&h--;if(e=="show"){var n={opacity:1};n[j]=(a=="pos"?"+=":"-=")+d;f.animate(n,i/2,c.options.easing);d/=2;h--}for(n=0;n<h;n++){var q={},l={};q[j]=(a=="pos"?"-=":"+=")+d;l[j]=(a=="pos"?"+=":"-=")+d;f.animate(q,i/2,c.options.easing).animate(l,i/2,c.options.easing);d=e=="hide"?d*2:d/2}if(e=="hide"){n={opacity:0};n[j]=(a=="pos"?"-=":"+=")+d;f.animate(n,i/2,c.options.easing,function(){f.hide();b.effects.restore(f,g);b.effects.removeWrapper(f);
c.callback&&c.callback.apply(this,arguments)})}else{q={};l={};q[j]=(a=="pos"?"-=":"+=")+d;l[j]=(a=="pos"?"+=":"-=")+d;f.animate(q,i/2,c.options.easing).animate(l,i/2,c.options.easing,function(){b.effects.restore(f,g);b.effects.removeWrapper(f);c.callback&&c.callback.apply(this,arguments)})}f.queue("fx",function(){f.dequeue()});f.dequeue()})}})(jQuery);
(function(b){b.effects.clip=function(c){return this.queue(function(){var f=b(this),g=["position","top","left","height","width"],e=b.effects.setMode(f,c.options.mode||"hide"),a=c.options.direction||"vertical";b.effects.save(f,g);f.show();var d=b.effects.createWrapper(f).css({overflow:"hidden"});d=f[0].tagName=="IMG"?d:f;var h={size:a=="vertical"?"height":"width",position:a=="vertical"?"top":"left"};a=a=="vertical"?d.height():d.width();if(e=="show"){d.css(h.size,0);d.css(h.position,a/2)}var i={};i[h.size]=
e=="show"?a:0;i[h.position]=e=="show"?0:a/2;d.animate(i,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){e=="hide"&&f.hide();b.effects.restore(f,g);b.effects.removeWrapper(f);c.callback&&c.callback.apply(f[0],arguments);f.dequeue()}})})}})(jQuery);
(function(b){b.effects.drop=function(c){return this.queue(function(){var f=b(this),g=["position","top","left","opacity"],e=b.effects.setMode(f,c.options.mode||"hide"),a=c.options.direction||"left";b.effects.save(f,g);f.show();b.effects.createWrapper(f);var d=a=="up"||a=="down"?"top":"left";a=a=="up"||a=="left"?"pos":"neg";var h=c.options.distance||(d=="top"?f.outerHeight({margin:true})/2:f.outerWidth({margin:true})/2);if(e=="show")f.css("opacity",0).css(d,a=="pos"?-h:h);var i={opacity:e=="show"?1:
0};i[d]=(e=="show"?a=="pos"?"+=":"-=":a=="pos"?"-=":"+=")+h;f.animate(i,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){e=="hide"&&f.hide();b.effects.restore(f,g);b.effects.removeWrapper(f);c.callback&&c.callback.apply(this,arguments);f.dequeue()}})})}})(jQuery);
(function(b){b.effects.explode=function(c){return this.queue(function(){var f=c.options.pieces?Math.round(Math.sqrt(c.options.pieces)):3,g=c.options.pieces?Math.round(Math.sqrt(c.options.pieces)):3;c.options.mode=c.options.mode=="toggle"?b(this).is(":visible")?"hide":"show":c.options.mode;var e=b(this).show().css("visibility","hidden"),a=e.offset();a.top-=parseInt(e.css("marginTop"),10)||0;a.left-=parseInt(e.css("marginLeft"),10)||0;for(var d=e.outerWidth(true),h=e.outerHeight(true),i=0;i<f;i++)for(var j=
0;j<g;j++)e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(d/g),top:-i*(h/f)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:d/g,height:h/f,left:a.left+j*(d/g)+(c.options.mode=="show"?(j-Math.floor(g/2))*(d/g):0),top:a.top+i*(h/f)+(c.options.mode=="show"?(i-Math.floor(f/2))*(h/f):0),opacity:c.options.mode=="show"?0:1}).animate({left:a.left+j*(d/g)+(c.options.mode=="show"?0:(j-Math.floor(g/2))*(d/g)),top:a.top+
i*(h/f)+(c.options.mode=="show"?0:(i-Math.floor(f/2))*(h/f)),opacity:c.options.mode=="show"?1:0},c.duration||500);setTimeout(function(){c.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide();c.callback&&c.callback.apply(e[0]);e.dequeue();b("div.ui-effects-explode").remove()},c.duration||500)})}})(jQuery);
(function(b){b.effects.fade=function(c){return this.queue(function(){var f=b(this),g=b.effects.setMode(f,c.options.mode||"hide");f.animate({opacity:g},{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){c.callback&&c.callback.apply(this,arguments);f.dequeue()}})})}})(jQuery);
(function(b){b.effects.fold=function(c){return this.queue(function(){var f=b(this),g=["position","top","left"],e=b.effects.setMode(f,c.options.mode||"hide"),a=c.options.size||15,d=!!c.options.horizFirst,h=c.duration?c.duration/2:b.fx.speeds._default/2;b.effects.save(f,g);f.show();var i=b.effects.createWrapper(f).css({overflow:"hidden"}),j=e=="show"!=d,n=j?["width","height"]:["height","width"];j=j?[i.width(),i.height()]:[i.height(),i.width()];var q=/([0-9]+)%/.exec(a);if(q)a=parseInt(q[1],10)/100*
j[e=="hide"?0:1];if(e=="show")i.css(d?{height:0,width:a}:{height:a,width:0});d={};q={};d[n[0]]=e=="show"?j[0]:a;q[n[1]]=e=="show"?j[1]:0;i.animate(d,h,c.options.easing).animate(q,h,c.options.easing,function(){e=="hide"&&f.hide();b.effects.restore(f,g);b.effects.removeWrapper(f);c.callback&&c.callback.apply(f[0],arguments);f.dequeue()})})}})(jQuery);
(function(b){b.effects.highlight=function(c){return this.queue(function(){var f=b(this),g=["backgroundImage","backgroundColor","opacity"],e=b.effects.setMode(f,c.options.mode||"show"),a={backgroundColor:f.css("backgroundColor")};if(e=="hide")a.opacity=0;b.effects.save(f,g);f.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(a,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){e=="hide"&&f.hide();b.effects.restore(f,g);e=="show"&&!b.support.opacity&&
this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);f.dequeue()}})})}})(jQuery);
(function(b){b.effects.pulsate=function(c){return this.queue(function(){var f=b(this),g=b.effects.setMode(f,c.options.mode||"show");times=(c.options.times||5)*2-1;duration=c.duration?c.duration/2:b.fx.speeds._default/2;isVisible=f.is(":visible");animateTo=0;if(!isVisible){f.css("opacity",0).show();animateTo=1}if(g=="hide"&&isVisible||g=="show"&&!isVisible)times--;for(g=0;g<times;g++){f.animate({opacity:animateTo},duration,c.options.easing);animateTo=(animateTo+1)%2}f.animate({opacity:animateTo},duration,
c.options.easing,function(){animateTo==0&&f.hide();c.callback&&c.callback.apply(this,arguments)});f.queue("fx",function(){f.dequeue()}).dequeue()})}})(jQuery);
(function(b){b.effects.puff=function(c){return this.queue(function(){var f=b(this),g=b.effects.setMode(f,c.options.mode||"hide"),e=parseInt(c.options.percent,10)||150,a=e/100,d={height:f.height(),width:f.width()};b.extend(c.options,{fade:true,mode:g,percent:g=="hide"?e:100,from:g=="hide"?d:{height:d.height*a,width:d.width*a}});f.effect("scale",c.options,c.duration,c.callback);f.dequeue()})};b.effects.scale=function(c){return this.queue(function(){var f=b(this),g=b.extend(true,{},c.options),e=b.effects.setMode(f,
c.options.mode||"effect"),a=parseInt(c.options.percent,10)||(parseInt(c.options.percent,10)==0?0:e=="hide"?0:100),d=c.options.direction||"both",h=c.options.origin;if(e!="effect"){g.origin=h||["middle","center"];g.restore=true}h={height:f.height(),width:f.width()};f.from=c.options.from||(e=="show"?{height:0,width:0}:h);a={y:d!="horizontal"?a/100:1,x:d!="vertical"?a/100:1};f.to={height:h.height*a.y,width:h.width*a.x};if(c.options.fade){if(e=="show"){f.from.opacity=0;f.to.opacity=1}if(e=="hide"){f.from.opacity=
1;f.to.opacity=0}}g.from=f.from;g.to=f.to;g.mode=e;f.effect("size",g,c.duration,c.callback);f.dequeue()})};b.effects.size=function(c){return this.queue(function(){var f=b(this),g=["position","top","left","width","height","overflow","opacity"],e=["position","top","left","overflow","opacity"],a=["width","height","overflow"],d=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=b.effects.setMode(f,
c.options.mode||"effect"),n=c.options.restore||false,q=c.options.scale||"both",l=c.options.origin,k={height:f.height(),width:f.width()};f.from=c.options.from||k;f.to=c.options.to||k;if(l){l=b.effects.getBaseline(l,k);f.from.top=(k.height-f.from.height)*l.y;f.from.left=(k.width-f.from.width)*l.x;f.to.top=(k.height-f.to.height)*l.y;f.to.left=(k.width-f.to.width)*l.x}var m={from:{y:f.from.height/k.height,x:f.from.width/k.width},to:{y:f.to.height/k.height,x:f.to.width/k.width}};if(q=="box"||q=="both"){if(m.from.y!=
m.to.y){g=g.concat(h);f.from=b.effects.setTransition(f,h,m.from.y,f.from);f.to=b.effects.setTransition(f,h,m.to.y,f.to)}if(m.from.x!=m.to.x){g=g.concat(i);f.from=b.effects.setTransition(f,i,m.from.x,f.from);f.to=b.effects.setTransition(f,i,m.to.x,f.to)}}if(q=="content"||q=="both")if(m.from.y!=m.to.y){g=g.concat(d);f.from=b.effects.setTransition(f,d,m.from.y,f.from);f.to=b.effects.setTransition(f,d,m.to.y,f.to)}b.effects.save(f,n?g:e);f.show();b.effects.createWrapper(f);f.css("overflow","hidden").css(f.from);
if(q=="content"||q=="both"){h=h.concat(["marginTop","marginBottom"]).concat(d);i=i.concat(["marginLeft","marginRight"]);a=g.concat(h).concat(i);f.find("*[width]").each(function(){child=b(this);n&&b.effects.save(child,a);var o={height:child.height(),width:child.width()};child.from={height:o.height*m.from.y,width:o.width*m.from.x};child.to={height:o.height*m.to.y,width:o.width*m.to.x};if(m.from.y!=m.to.y){child.from=b.effects.setTransition(child,h,m.from.y,child.from);child.to=b.effects.setTransition(child,
h,m.to.y,child.to)}if(m.from.x!=m.to.x){child.from=b.effects.setTransition(child,i,m.from.x,child.from);child.to=b.effects.setTransition(child,i,m.to.x,child.to)}child.css(child.from);child.animate(child.to,c.duration,c.options.easing,function(){n&&b.effects.restore(child,a)})})}f.animate(f.to,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){f.to.opacity===0&&f.css("opacity",f.from.opacity);j=="hide"&&f.hide();b.effects.restore(f,n?g:e);b.effects.removeWrapper(f);c.callback&&
c.callback.apply(this,arguments);f.dequeue()}})})}})(jQuery);
(function(b){b.effects.shake=function(c){return this.queue(function(){var f=b(this),g=["position","top","left"];b.effects.setMode(f,c.options.mode||"effect");var e=c.options.direction||"left",a=c.options.distance||20,d=c.options.times||3,h=c.duration||c.options.duration||140;b.effects.save(f,g);f.show();b.effects.createWrapper(f);var i=e=="up"||e=="down"?"top":"left",j=e=="up"||e=="left"?"pos":"neg";e={};var n={},q={};e[i]=(j=="pos"?"-=":"+=")+a;n[i]=(j=="pos"?"+=":"-=")+a*2;q[i]=(j=="pos"?"-=":"+=")+
a*2;f.animate(e,h,c.options.easing);for(a=1;a<d;a++)f.animate(n,h,c.options.easing).animate(q,h,c.options.easing);f.animate(n,h,c.options.easing).animate(e,h/2,c.options.easing,function(){b.effects.restore(f,g);b.effects.removeWrapper(f);c.callback&&c.callback.apply(this,arguments)});f.queue("fx",function(){f.dequeue()});f.dequeue()})}})(jQuery);
(function(b){b.effects.slide=function(c){return this.queue(function(){var f=b(this),g=["position","top","left"],e=b.effects.setMode(f,c.options.mode||"show"),a=c.options.direction||"left";b.effects.save(f,g);f.show();b.effects.createWrapper(f).css({overflow:"hidden"});var d=a=="up"||a=="down"?"top":"left";a=a=="up"||a=="left"?"pos":"neg";var h=c.options.distance||(d=="top"?f.outerHeight({margin:true}):f.outerWidth({margin:true}));if(e=="show")f.css(d,a=="pos"?-h:h);var i={};i[d]=(e=="show"?a=="pos"?
"+=":"-=":a=="pos"?"-=":"+=")+h;f.animate(i,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){e=="hide"&&f.hide();b.effects.restore(f,g);b.effects.removeWrapper(f);c.callback&&c.callback.apply(this,arguments);f.dequeue()}})})}})(jQuery);
(function(b){b.effects.transfer=function(c){return this.queue(function(){var f=b(this),g=b(c.options.to),e=g.offset();g={top:e.top,left:e.left,height:g.innerHeight(),width:g.innerWidth()};e=f.offset();var a=b('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(c.options.className).css({top:e.top,left:e.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,c.duration,c.options.easing,function(){a.remove();c.callback&&c.callback.apply(f[0],arguments);
f.dequeue()})})}})(jQuery);
(function(b){b.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var c=this,f=c.options;c.running=0;c.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");c.headers=
c.element.find(f.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){f.disabled||b(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){f.disabled||b(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){f.disabled||b(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){f.disabled||b(this).removeClass("ui-state-focus")});c.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
if(f.navigation){var g=c.element.find("a").filter(f.navigationFilter).eq(0);if(g.length){var e=g.closest(".ui-accordion-header");c.active=e.length?e:g.closest(".ui-accordion-content").prev()}}c.active=c._findActive(c.active||f.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");c.active.next().addClass("ui-accordion-content-active");c._createIcons();c.resize();c.element.attr("role","tablist");c.headers.attr("role","tab").bind("keydown.accordion",
function(a){return c._keydown(a)}).next().attr("role","tabpanel");c.headers.not(c.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();c.active.length?c.active.attr({"aria-expanded":"true",tabIndex:0}):c.headers.eq(0).attr("tabIndex",0);b.browser.safari||c.headers.find("a").attr("tabIndex",-1);f.event&&c.headers.bind(f.event.split(" ").join(".accordion ")+".accordion",function(a){c._clickHandler.call(c,a,this);a.preventDefault()})},_createIcons:function(){var c=this.options;if(c.icons){b("<span></span>").addClass("ui-icon "+
c.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(c.icons.header).toggleClass(c.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");
this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var f=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(c.autoHeight||c.fillHeight)f.css("height","");return b.Widget.prototype.destroy.call(this)},_setOption:function(c,f){b.Widget.prototype._setOption.apply(this,arguments);c=="active"&&this.activate(f);if(c=="icons"){this._destroyIcons();
f&&this._createIcons()}if(c=="disabled")this.headers.add(this.headers.next())[f?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(c){if(!(this.options.disabled||c.altKey||c.ctrlKey)){var f=b.ui.keyCode,g=this.headers.length,e=this.headers.index(c.target),a=false;switch(c.keyCode){case f.RIGHT:case f.DOWN:a=this.headers[(e+1)%g];break;case f.LEFT:case f.UP:a=this.headers[(e-1+g)%g];break;case f.SPACE:case f.ENTER:this._clickHandler({target:c.target},c.target);
c.preventDefault()}if(a){b(c.target).attr("tabIndex",-1);b(a).attr("tabIndex",0);a.focus();return false}return true}},resize:function(){var c=this.options,f;if(c.fillSpace){if(b.browser.msie){var g=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}f=this.element.parent().height();b.browser.msie&&this.element.parent().css("overflow",g);this.headers.each(function(){f-=b(this).outerHeight(true)});this.headers.next().each(function(){b(this).height(Math.max(0,f-b(this).innerHeight()+
b(this).height()))}).css("overflow","auto")}else if(c.autoHeight){f=0;this.headers.next().each(function(){f=Math.max(f,b(this).height("").height())}).height(f)}return this},activate:function(c){this.options.active=c;c=this._findActive(c)[0];this._clickHandler({target:c},c);return this},_findActive:function(c){return c?typeof c==="number"?this.headers.filter(":eq("+c+")"):this.headers.not(this.headers.not(c)):c===false?b([]):this.headers.filter(":eq(0)")},_clickHandler:function(c,f){var g=this.options;
if(!g.disabled)if(c.target){c=b(c.currentTarget||f);f=c[0]===this.active[0];g.active=g.collapsible&&f?false:this.headers.index(c);if(!(this.running||!g.collapsible&&f)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(g.icons.headerSelected).addClass(g.icons.header);if(!f){c.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(g.icons.header).addClass(g.icons.headerSelected);
c.next().addClass("ui-accordion-content-active")}d=c.next();e=this.active.next();a={options:g,newHeader:f&&g.collapsible?b([]):c,oldHeader:this.active,newContent:f&&g.collapsible?b([]):d,oldContent:e};g=this.headers.index(this.active[0])>this.headers.index(c[0]);this.active=f?b([]):c;this._toggle(d,e,a,f,g)}}else if(g.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(g.icons.headerSelected).addClass(g.icons.header);
this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),a={options:g,newHeader:b([]),oldHeader:g.active,newContent:b([]),oldContent:e},d=this.active=b([]);this._toggle(d,e,a)}},_toggle:function(c,f,g,e,a){var d=this,h=d.options;d.toShow=c;d.toHide=f;d.data=g;var i=function(){if(d)return d._completed.apply(d,arguments)};d._trigger("changestart",null,d.data);d.running=f.size()===0?c.size():f.size();if(h.animated){g={};g=h.collapsible&&e?{toShow:b([]),toHide:f,complete:i,
down:a,autoHeight:h.autoHeight||h.fillSpace}:{toShow:c,toHide:f,complete:i,down:a,autoHeight:h.autoHeight||h.fillSpace};if(!h.proxied)h.proxied=h.animated;if(!h.proxiedDuration)h.proxiedDuration=h.duration;h.animated=b.isFunction(h.proxied)?h.proxied(g):h.proxied;h.duration=b.isFunction(h.proxiedDuration)?h.proxiedDuration(g):h.proxiedDuration;e=b.ui.accordion.animations;var j=h.duration,n=h.animated;if(n&&!e[n]&&!b.easing[n])n="slide";e[n]||(e[n]=function(q){this.slide(q,{easing:n,duration:j||700})});
e[n](g)}else{if(h.collapsible&&e)c.toggle();else{f.hide();c.show()}i(true)}f.prev().attr({"aria-expanded":"false",tabIndex:-1}).blur();c.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(c){this.running=c?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});b.extend(b.ui.accordion,{version:"1.8.6",animations:{slide:function(c,
f){c=b.extend({easing:"swing",duration:300},c,f);if(c.toHide.size())if(c.toShow.size()){var g=c.toShow.css("overflow"),e=0,a={},d={},h;f=c.toShow;h=f[0].style.width;f.width(parseInt(f.parent().width(),10)-parseInt(f.css("paddingLeft"),10)-parseInt(f.css("paddingRight"),10)-(parseInt(f.css("borderLeftWidth"),10)||0)-(parseInt(f.css("borderRightWidth"),10)||0));b.each(["height","paddingTop","paddingBottom"],function(i,j){d[j]="hide";i=(""+b.css(c.toShow[0],j)).match(/^([\d+-.]+)(.*)$/);a[j]={value:i[1],
unit:i[2]||"px"}});c.toShow.css({height:0,overflow:"hidden"}).show();c.toHide.filter(":hidden").each(c.complete).end().filter(":visible").animate(d,{step:function(i,j){if(j.prop=="height")e=j.end-j.start===0?0:(j.now-j.start)/(j.end-j.start);c.toShow[0].style[j.prop]=e*a[j.prop].value+a[j.prop].unit},duration:c.duration,easing:c.easing,complete:function(){c.autoHeight||c.toShow.css("height","");c.toShow.css({width:h,overflow:g});c.complete()}})}else c.toHide.animate({height:"hide",paddingTop:"hide",
paddingBottom:"hide"},c);else c.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},c)},bounceslide:function(c){this.slide(c,{easing:c.down?"easeOutBounce":"swing",duration:c.down?1E3:200})}}})})(jQuery);
(function(b){b.widget("ui.autocomplete",{options:{appendTo:"body",delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},_create:function(){var c=this,f=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(e){if(!(c.options.disabled||c.element.attr("readonly"))){g=false;var a=b.ui.keyCode;switch(e.keyCode){case a.PAGE_UP:c._move("previousPage",
e);break;case a.PAGE_DOWN:c._move("nextPage",e);break;case a.UP:c._move("previous",e);e.preventDefault();break;case a.DOWN:c._move("next",e);e.preventDefault();break;case a.ENTER:case a.NUMPAD_ENTER:if(c.menu.active){g=true;e.preventDefault()}case a.TAB:if(!c.menu.active)return;c.menu.select(e);break;case a.ESCAPE:c.element.val(c.term);c.close(e);break;default:clearTimeout(c.searching);c.searching=setTimeout(function(){if(c.term!=c.element.val()){c.selectedItem=null;c.search(null,e)}},c.options.delay);
break}}}).bind("keypress.autocomplete",function(e){if(g){g=false;e.preventDefault()}}).bind("focus.autocomplete",function(){if(!c.options.disabled){c.selectedItem=null;c.previous=c.element.val()}}).bind("blur.autocomplete",function(e){if(!c.options.disabled){clearTimeout(c.searching);c.closing=setTimeout(function(){c.close(e);c._change(e)},150)}});this._initSource();this.response=function(){return c._response.apply(c,arguments)};this.menu=b("<ul></ul>").addClass("ui-autocomplete").appendTo(b(this.options.appendTo||
"body",f)[0]).mousedown(function(e){var a=c.menu.element[0];b(e.target).closest(".ui-menu-item").length||setTimeout(function(){b(document).one("mousedown",function(d){d.target!==c.element[0]&&d.target!==a&&!b.ui.contains(a,d.target)&&c.close()})},1);setTimeout(function(){clearTimeout(c.closing)},13)}).menu({focus:function(e,a){a=a.item.data("item.autocomplete");false!==c._trigger("focus",e,{item:a})&&/^key/.test(e.originalEvent.type)&&c.element.val(a.value)},selected:function(e,a){a=a.item.data("item.autocomplete");
var d=c.previous;if(c.element[0]!==f.activeElement){c.element.focus();c.previous=d;setTimeout(function(){c.previous=d},1)}false!==c._trigger("select",e,{item:a})&&c.element.val(a.value);c.term=c.element.val();c.close(e);c.selectedItem=a},blur:function(){c.menu.element.is(":visible")&&c.element.val()!==c.term&&c.element.val(c.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");b.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");
this.menu.element.remove();b.Widget.prototype.destroy.call(this)},_setOption:function(c,f){b.Widget.prototype._setOption.apply(this,arguments);c==="source"&&this._initSource();if(c==="appendTo")this.menu.element.appendTo(b(f||"body",this.element[0].ownerDocument)[0])},_initSource:function(){var c=this,f,g;if(b.isArray(this.options.source)){f=this.options.source;this.source=function(e,a){a(b.ui.autocomplete.filter(f,e.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=
function(e,a){c.xhr&&c.xhr.abort();c.xhr=b.getJSON(g,e,function(d,h,i){i===c.xhr&&a(d);c.xhr=null})}}else this.source=this.options.source},search:function(c,f){c=c!=null?c:this.element.val();this.term=this.element.val();if(c.length<this.options.minLength)return this.close(f);clearTimeout(this.closing);if(this._trigger("search",f)!==false)return this._search(c)},_search:function(c){this.element.addClass("ui-autocomplete-loading");this.source({term:c},this.response)},_response:function(c){if(c&&c.length){c=
this._normalize(c);this._suggest(c);this._trigger("open")}else this.close();this.element.removeClass("ui-autocomplete-loading")},close:function(c){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this._trigger("close",c);this.menu.element.hide();this.menu.deactivate()}},_change:function(c){this.previous!==this.element.val()&&this._trigger("change",c,{item:this.selectedItem})},_normalize:function(c){if(c.length&&c[0].label&&c[0].value)return c;return b.map(c,function(f){if(typeof f===
"string")return{label:f,value:f};return b.extend({label:f.label||f.value,value:f.value||f.label},f)})},_suggest:function(c){this._renderMenu(this.menu.element.empty().zIndex(this.element.zIndex()+1),c);this.menu.deactivate();this.menu.refresh();this.menu.element.show().position(b.extend({of:this.element},this.options.position));this._resizeMenu()},_resizeMenu:function(){var c=this.menu.element;c.outerWidth(Math.max(c.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(c,f){var g=
this;b.each(f,function(e,a){g._renderItem(c,a)})},_renderItem:function(c,f){return b("<li></li>").data("item.autocomplete",f).append(b("<a></a>").text(f.label)).appendTo(c)},_move:function(c,f){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(c)||this.menu.last()&&/^next/.test(c)){this.element.val(this.term);this.menu.deactivate()}else this.menu[c](f);else this.search(null,f)},widget:function(){return this.menu.element}});b.extend(b.ui.autocomplete,{escapeRegex:function(c){return c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
"\\$&")},filter:function(c,f){var g=new RegExp(b.ui.autocomplete.escapeRegex(f),"i");return b.grep(c,function(e){return g.test(e.label||e.value||e)})}})})(jQuery);
(function(b){b.widget("ui.menu",{_create:function(){var c=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(f){if(b(f.target).closest(".ui-menu-item a").length){f.preventDefault();c.select(f)}});this.refresh()},refresh:function(){var c=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
-1).mouseenter(function(f){c.activate(f,b(this).parent())}).mouseleave(function(){c.deactivate()})},activate:function(c,f){this.deactivate();if(this.hasScroll()){var g=f.offset().top-this.element.offset().top,e=this.element.attr("scrollTop"),a=this.element.height();if(g<0)this.element.attr("scrollTop",e+g);else g>=a&&this.element.attr("scrollTop",e+g-a+f.height())}this.active=f.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",c,{item:f})},
deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(c){this.move("next",".ui-menu-item:first",c)},previous:function(c){this.move("prev",".ui-menu-item:last",c)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(c,f,g){if(this.active){c=this.active[c+"All"](".ui-menu-item").eq(0);
c.length?this.activate(g,c):this.activate(g,this.element.children(f))}else this.activate(g,this.element.children(f))},nextPage:function(c){if(this.hasScroll())if(!this.active||this.last())this.activate(c,this.element.children(".ui-menu-item:first"));else{var f=this.active.offset().top,g=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var a=b(this).offset().top-f-g+b(this).height();return a<10&&a>-10});e.length||(e=this.element.children(".ui-menu-item:last"));this.activate(c,
e)}else this.activate(c,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(c){if(this.hasScroll())if(!this.active||this.first())this.activate(c,this.element.children(".ui-menu-item:last"));else{var f=this.active.offset().top,g=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var e=b(this).offset().top-f+g-b(this).height();return e<10&&e>-10});result.length||(result=this.element.children(".ui-menu-item:first"));
this.activate(c,result)}else this.activate(c,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element.attr("scrollHeight")},select:function(c){this._trigger("selected",c,{item:this.active})}})})(jQuery);
(function(b){var c,f=function(e){b(":ui-button",e.target.form).each(function(){var a=b(this).data("button");setTimeout(function(){a.refresh()},1)})},g=function(e){var a=e.name,d=e.form,h=b([]);if(a)h=d?b(d).find("[name='"+a+"']"):b("[name='"+a+"']",e.ownerDocument).filter(function(){return!this.form});return h};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",
f);if(typeof this.options.disabled!=="boolean")this.options.disabled=this.element.attr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var e=this,a=this.options,d=this.type==="checkbox"||this.type==="radio",h="ui-state-hover"+(!d?" ui-state-active":"");if(a.label===null)a.label=this.buttonElement.html();if(this.element.is(":disabled"))a.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",
function(){if(!a.disabled){b(this).addClass("ui-state-hover");this===c&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){a.disabled||b(this).removeClass(h)}).bind("focus.button",function(){b(this).addClass("ui-state-focus")}).bind("blur.button",function(){b(this).removeClass("ui-state-focus")});d&&this.element.bind("change.button",function(){e.refresh()});if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(a.disabled)return false;b(this).toggleClass("ui-state-active");
e.buttonElement.attr("aria-pressed",e.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(a.disabled)return false;b(this).addClass("ui-state-active");e.buttonElement.attr("aria-pressed",true);var i=e.element[0];g(i).not(i).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)});else{this.buttonElement.bind("mousedown.button",function(){if(a.disabled)return false;b(this).addClass("ui-state-active");
c=this;b(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(a.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(i){if(a.disabled)return false;if(i.keyCode==b.ui.keyCode.SPACE||i.keyCode==b.ui.keyCode.ENTER)b(this).addClass("ui-state-active")}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(i){i.keyCode===b.ui.keyCode.SPACE&&b(this).click()})}this._setOption("disabled",
a.disabled)},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type==="radio"){this.buttonElement=this.element.parents().last().find("label[for="+this.element.attr("id")+"]");this.element.addClass("ui-helper-hidden-accessible");var e=this.element.is(":checked");e&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",e)}else this.buttonElement=
this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||
this.buttonElement.removeAttr("title");b.Widget.prototype.destroy.call(this)},_setOption:function(e,a){b.Widget.prototype._setOption.apply(this,arguments);if(e==="disabled")a?this.element.attr("disabled",true):this.element.removeAttr("disabled");this._resetButton()},refresh:function(){var e=this.element.is(":disabled");e!==this.options.disabled&&this._setOption("disabled",e);if(this.type==="radio")g(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
true):b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var e=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
a=b("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),d=this.options.icons,h=d.primary&&d.secondary;if(d.primary||d.secondary){e.addClass("ui-button-text-icon"+(h?"s":d.primary?"-primary":"-secondary"));d.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>");d.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>");if(!this.options.text){e.addClass(h?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary");
this.hasTitle||e.attr("title",a)}}else e.addClass("ui-button-text-only")}}});b.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,a){e==="disabled"&&this.buttons.button("option",e,a);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":visible").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end().end()},
destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");b.Widget.prototype.destroy.call(this)}})})(jQuery);
(function(b,c){function f(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};b.extend(this._defaults,this.regional[""]);this.dpDiv=b('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}function g(a,d){b.extend(a,
d);for(var h in d)if(d[h]==null||d[h]==c)a[h]=d[h];return a}b.extend(b.ui,{datepicker:{version:"1.8.6"}});var e=(new Date).getTime();b.extend(f.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){g(this._defaults,a||{});return this},_attachDatepicker:function(a,d){var h=null;for(var i in this._defaults){var j=a.getAttribute("date:"+i);if(j){h=h||{};try{h[i]=eval(j)}catch(n){h[i]=
j}}}i=a.nodeName.toLowerCase();j=i=="div"||i=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var q=this._newInst(b(a),j);q.settings=b.extend({},d||{},h||{});if(i=="input")this._connectDatepicker(a,q);else j&&this._inlineDatepicker(a,q)},_newInst:function(a,d){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:d,dpDiv:!d?this.dpDiv:b('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},
_connectDatepicker:function(a,d){var h=b(a);d.append=b([]);d.trigger=b([]);if(!h.hasClass(this.markerClassName)){this._attachments(h,d);h.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(i,j,n){d.settings[j]=n}).bind("getData.datepicker",function(i,j){return this._get(d,j)});this._autoSize(d);b.data(a,"datepicker",d)}},_attachments:function(a,d){var h=this._get(d,"appendText"),i=this._get(d,"isRTL");d.append&&
d.append.remove();if(h){d.append=b('<span class="'+this._appendClass+'">'+h+"</span>");a[i?"before":"after"](d.append)}a.unbind("focus",this._showDatepicker);d.trigger&&d.trigger.remove();h=this._get(d,"showOn");if(h=="focus"||h=="both")a.focus(this._showDatepicker);if(h=="button"||h=="both"){h=this._get(d,"buttonText");var j=this._get(d,"buttonImage");d.trigger=b(this._get(d,"buttonImageOnly")?b("<img/>").addClass(this._triggerClass).attr({src:j,alt:h,title:h}):b('<button type="button"></button>').addClass(this._triggerClass).html(j==
""?h:b("<img/>").attr({src:j,alt:h,title:h})));a[i?"before":"after"](d.trigger);d.trigger.click(function(){b.datepicker._datepickerShowing&&b.datepicker._lastInput==a[0]?b.datepicker._hideDatepicker():b.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var d=new Date(2009,11,20),h=this._get(a,"dateFormat");if(h.match(/[DM]/)){var i=function(j){for(var n=0,q=0,l=0;l<j.length;l++)if(j[l].length>n){n=j[l].length;q=l}return q};d.setMonth(i(this._get(a,
h.match(/MM/)?"monthNames":"monthNamesShort")));d.setDate(i(this._get(a,h.match(/DD/)?"dayNames":"dayNamesShort"))+20-d.getDay())}a.input.attr("size",this._formatDate(a,d).length)}},_inlineDatepicker:function(a,d){var h=b(a);if(!h.hasClass(this.markerClassName)){h.addClass(this.markerClassName).append(d.dpDiv).bind("setData.datepicker",function(i,j,n){d.settings[j]=n}).bind("getData.datepicker",function(i,j){return this._get(d,j)});b.data(a,"datepicker",d);this._setDate(d,this._getDefaultDate(d),
true);this._updateDatepicker(d);this._updateAlternate(d)}},_dialogDatepicker:function(a,d,h,i,j){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=b('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);b("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};b.data(this._dialogInput[0],"datepicker",a)}g(a.settings,i||{});d=d&&d.constructor==
Date?this._formatDate(a,d):d;this._dialogInput.val(d);this._pos=j?j.length?j:[j.pageX,j.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=h;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);
b.blockUI&&b.blockUI(this.dpDiv);b.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var d=b(a),h=b.data(a,"datepicker");if(d.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();b.removeData(a,"datepicker");if(i=="input"){h.append.remove();h.trigger.remove();d.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(i=="div"||i=="span")d.removeClass(this.markerClassName).empty()}},
_enableDatepicker:function(a){var d=b(a),h=b.data(a,"datepicker");if(d.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();if(i=="input"){a.disabled=false;h.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(i=="div"||i=="span")d.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=b.map(this._disabledInputs,function(j){return j==a?null:j})}},_disableDatepicker:function(a){var d=
b(a),h=b.data(a,"datepicker");if(d.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();if(i=="input"){a.disabled=true;h.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(i=="div"||i=="span")d.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=b.map(this._disabledInputs,function(j){return j==a?null:j});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;
for(var d=0;d<this._disabledInputs.length;d++)if(this._disabledInputs[d]==a)return true;return false},_getInst:function(a){try{return b.data(a,"datepicker")}catch(d){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,d,h){var i=this._getInst(a);if(arguments.length==2&&typeof d=="string")return d=="defaults"?b.extend({},b.datepicker._defaults):i?d=="all"?b.extend({},i.settings):this._get(i,d):null;var j=d||{};if(typeof d=="string"){j={};j[d]=h}if(i){this._curInst==i&&
this._hideDatepicker();var n=this._getDateDatepicker(a,true);g(i.settings,j);this._attachments(b(a),i);this._autoSize(i);this._setDateDatepicker(a,n);this._updateDatepicker(i)}},_changeDatepicker:function(a,d,h){this._optionDatepicker(a,d,h)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,d){if(a=this._getInst(a)){this._setDate(a,d);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,d){(a=this._getInst(a))&&
!a.inline&&this._setDateFromField(a,d);return a?this._getDate(a):null},_doKeyDown:function(a){var d=b.datepicker._getInst(a.target),h=true,i=d.dpDiv.is(".ui-datepicker-rtl");d._keyEvent=true;if(b.datepicker._datepickerShowing)switch(a.keyCode){case 9:b.datepicker._hideDatepicker();h=false;break;case 13:h=b("td."+b.datepicker._dayOverClass,d.dpDiv).add(b("td."+b.datepicker._currentClass,d.dpDiv));h[0]?b.datepicker._selectDay(a.target,d.selectedMonth,d.selectedYear,h[0]):b.datepicker._hideDatepicker();
return false;case 27:b.datepicker._hideDatepicker();break;case 33:b.datepicker._adjustDate(a.target,a.ctrlKey?-b.datepicker._get(d,"stepBigMonths"):-b.datepicker._get(d,"stepMonths"),"M");break;case 34:b.datepicker._adjustDate(a.target,a.ctrlKey?+b.datepicker._get(d,"stepBigMonths"):+b.datepicker._get(d,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)b.datepicker._clearDate(a.target);h=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)b.datepicker._gotoToday(a.target);h=a.ctrlKey||
a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)b.datepicker._adjustDate(a.target,i?+1:-1,"D");h=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)b.datepicker._adjustDate(a.target,a.ctrlKey?-b.datepicker._get(d,"stepBigMonths"):-b.datepicker._get(d,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)b.datepicker._adjustDate(a.target,-7,"D");h=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)b.datepicker._adjustDate(a.target,i?-1:+1,"D");h=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)b.datepicker._adjustDate(a.target,
a.ctrlKey?+b.datepicker._get(d,"stepBigMonths"):+b.datepicker._get(d,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)b.datepicker._adjustDate(a.target,+7,"D");h=a.ctrlKey||a.metaKey;break;default:h=false}else if(a.keyCode==36&&a.ctrlKey)b.datepicker._showDatepicker(this);else h=false;if(h){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var d=b.datepicker._getInst(a.target);if(b.datepicker._get(d,"constrainInput")){d=b.datepicker._possibleChars(b.datepicker._get(d,"dateFormat"));
var h=String.fromCharCode(a.charCode==c?a.keyCode:a.charCode);return a.ctrlKey||h<" "||!d||d.indexOf(h)>-1}},_doKeyUp:function(a){a=b.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(b.datepicker.parseDate(b.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,b.datepicker._getFormatConfig(a))){b.datepicker._setDateFromField(a);b.datepicker._updateAlternate(a);b.datepicker._updateDatepicker(a)}}catch(d){b.datepicker.log(d)}return true},_showDatepicker:function(a){a=a.target||
a;if(a.nodeName.toLowerCase()!="input")a=b("input",a.parentNode)[0];if(!(b.datepicker._isDisabledDatepicker(a)||b.datepicker._lastInput==a)){var d=b.datepicker._getInst(a);b.datepicker._curInst&&b.datepicker._curInst!=d&&b.datepicker._curInst.dpDiv.stop(true,true);var h=b.datepicker._get(d,"beforeShow");g(d.settings,h?h.apply(a,[a,d]):{});d.lastVal=null;b.datepicker._lastInput=a;b.datepicker._setDateFromField(d);if(b.datepicker._inDialog)a.value="";if(!b.datepicker._pos){b.datepicker._pos=b.datepicker._findPos(a);
b.datepicker._pos[1]+=a.offsetHeight}var i=false;b(a).parents().each(function(){i|=b(this).css("position")=="fixed";return!i});if(i&&b.browser.opera){b.datepicker._pos[0]-=document.documentElement.scrollLeft;b.datepicker._pos[1]-=document.documentElement.scrollTop}h={left:b.datepicker._pos[0],top:b.datepicker._pos[1]};b.datepicker._pos=null;d.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});b.datepicker._updateDatepicker(d);h=b.datepicker._checkOffset(d,h,i);d.dpDiv.css({position:b.datepicker._inDialog&&
b.blockUI?"static":i?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"});if(!d.inline){h=b.datepicker._get(d,"showAnim");var j=b.datepicker._get(d,"duration"),n=function(){b.datepicker._datepickerShowing=true;var q=b.datepicker._getBorders(d.dpDiv);d.dpDiv.find("iframe.ui-datepicker-cover").css({left:-q[0],top:-q[1],width:d.dpDiv.outerWidth(),height:d.dpDiv.outerHeight()})};d.dpDiv.zIndex(b(a).zIndex()+1);b.effects&&b.effects[h]?d.dpDiv.show(h,b.datepicker._get(d,"showOptions"),j,
n):d.dpDiv[h||"show"](h?j:null,n);if(!h||!j)n();d.input.is(":visible")&&!d.input.is(":disabled")&&d.input.focus();b.datepicker._curInst=d}}},_updateDatepicker:function(a){var d=this,h=b.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-h[0],top:-h[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){b(this).removeClass("ui-state-hover");
this.className.indexOf("ui-datepicker-prev")!=-1&&b(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&b(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!d._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){b(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&b(this).addClass("ui-datepicker-prev-hover");
this.className.indexOf("ui-datepicker-next")!=-1&&b(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();h=this._getNumberOfMonths(a);var i=h[1];i>1?a.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",17*i+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(h[0]!=1||h[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");
a==b.datepicker._curInst&&b.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var d=function(h){return{thin:1,medium:2,thick:3}[h]||h};return[parseFloat(d(a.css("border-left-width"))),parseFloat(d(a.css("border-top-width")))]},_checkOffset:function(a,d,h){var i=a.dpDiv.outerWidth(),j=a.dpDiv.outerHeight(),n=a.input?a.input.outerWidth():0,q=a.input?a.input.outerHeight():0,l=document.documentElement.clientWidth+b(document).scrollLeft(),
k=document.documentElement.clientHeight+b(document).scrollTop();d.left-=this._get(a,"isRTL")?i-n:0;d.left-=h&&d.left==a.input.offset().left?b(document).scrollLeft():0;d.top-=h&&d.top==a.input.offset().top+q?b(document).scrollTop():0;d.left-=Math.min(d.left,d.left+i>l&&l>i?Math.abs(d.left+i-l):0);d.top-=Math.min(d.top,d.top+j>k&&k>j?Math.abs(j+q):0);return d},_findPos:function(a){for(var d=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[d?"previousSibling":"nextSibling"];
a=b(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var d=this._curInst;if(!(!d||a&&d!=b.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(d,"showAnim");var h=this._get(d,"duration"),i=function(){b.datepicker._tidyDialog(d);this._curInst=null};b.effects&&b.effects[a]?d.dpDiv.hide(a,b.datepicker._get(d,"showOptions"),h,i):d.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?h:null,i);a||i();if(a=this._get(d,"onClose"))a.apply(d.input?d.input[0]:null,[d.input?d.input.val():
"",d]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(b.blockUI){b.unblockUI();b("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(b.datepicker._curInst){a=b(a.target);a[0].id!=b.datepicker._mainDivId&&a.parents("#"+b.datepicker._mainDivId).length==0&&!a.hasClass(b.datepicker.markerClassName)&&
!a.hasClass(b.datepicker._triggerClass)&&b.datepicker._datepickerShowing&&!(b.datepicker._inDialog&&b.blockUI)&&b.datepicker._hideDatepicker()}},_adjustDate:function(a,d,h){a=b(a);var i=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(i,d+(h=="M"?this._get(i,"showCurrentAtPos"):0),h);this._updateDatepicker(i)}},_gotoToday:function(a){a=b(a);var d=this._getInst(a[0]);if(this._get(d,"gotoCurrent")&&d.currentDay){d.selectedDay=d.currentDay;d.drawMonth=d.selectedMonth=d.currentMonth;
d.drawYear=d.selectedYear=d.currentYear}else{var h=new Date;d.selectedDay=h.getDate();d.drawMonth=d.selectedMonth=h.getMonth();d.drawYear=d.selectedYear=h.getFullYear()}this._notifyChange(d);this._adjustDate(a)},_selectMonthYear:function(a,d,h){a=b(a);var i=this._getInst(a[0]);i._selectingMonthYear=false;i["selected"+(h=="M"?"Month":"Year")]=i["draw"+(h=="M"?"Month":"Year")]=parseInt(d.options[d.selectedIndex].value,10);this._notifyChange(i);this._adjustDate(a)},_clickMonthYear:function(a){var d=
this._getInst(b(a)[0]);d.input&&d._selectingMonthYear&&setTimeout(function(){d.input.focus()},0);d._selectingMonthYear=!d._selectingMonthYear},_selectDay:function(a,d,h,i){var j=b(a);if(!(b(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(j[0]))){j=this._getInst(j[0]);j.selectedDay=j.currentDay=b("a",i).html();j.selectedMonth=j.currentMonth=d;j.selectedYear=j.currentYear=h;this._selectDate(a,this._formatDate(j,j.currentDay,j.currentMonth,j.currentYear))}},_clearDate:function(a){a=
b(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,d){a=this._getInst(b(a)[0]);d=d!=null?d:this._formatDate(a);a.input&&a.input.val(d);this._updateAlternate(a);var h=this._get(a,"onSelect");if(h)h.apply(a.input?a.input[0]:null,[d,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var d=this._get(a,
"altField");if(d){var h=this._get(a,"altFormat")||this._get(a,"dateFormat"),i=this._getDate(a),j=this.formatDate(h,i,this._getFormatConfig(a));b(d).each(function(){b(this).val(j)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var d=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((d-a)/864E5)/7)+1},parseDate:function(a,d,h){if(a==null||d==null)throw"Invalid arguments";d=typeof d==
"object"?d.toString():d+"";if(d=="")return null;for(var i=(h?h.shortYearCutoff:null)||this._defaults.shortYearCutoff,j=(h?h.dayNamesShort:null)||this._defaults.dayNamesShort,n=(h?h.dayNames:null)||this._defaults.dayNames,q=(h?h.monthNamesShort:null)||this._defaults.monthNamesShort,l=(h?h.monthNames:null)||this._defaults.monthNames,k=h=-1,m=-1,o=-1,p=false,s=function(x){(x=y+1<a.length&&a.charAt(y+1)==x)&&y++;return x},r=function(x){s(x);x=new RegExp("^\\d{1,"+(x=="@"?14:x=="!"?20:x=="y"?4:x=="o"?
3:2)+"}");x=d.substring(w).match(x);if(!x)throw"Missing number at position "+w;w+=x[0].length;return parseInt(x[0],10)},u=function(x,C,J){x=s(x)?J:C;for(C=0;C<x.length;C++)if(d.substr(w,x[C].length).toLowerCase()==x[C].toLowerCase()){w+=x[C].length;return C+1}throw"Unknown name at position "+w;},v=function(){if(d.charAt(w)!=a.charAt(y))throw"Unexpected literal at position "+w;w++},w=0,y=0;y<a.length;y++)if(p)if(a.charAt(y)=="'"&&!s("'"))p=false;else v();else switch(a.charAt(y)){case "d":m=r("d");
break;case "D":u("D",j,n);break;case "o":o=r("o");break;case "m":k=r("m");break;case "M":k=u("M",q,l);break;case "y":h=r("y");break;case "@":var B=new Date(r("@"));h=B.getFullYear();k=B.getMonth()+1;m=B.getDate();break;case "!":B=new Date((r("!")-this._ticksTo1970)/1E4);h=B.getFullYear();k=B.getMonth()+1;m=B.getDate();break;case "'":if(s("'"))v();else p=true;break;default:v()}if(h==-1)h=(new Date).getFullYear();else if(h<100)h+=(new Date).getFullYear()-(new Date).getFullYear()%100+(h<=i?0:-100);if(o>
-1){k=1;m=o;do{i=this._getDaysInMonth(h,k-1);if(m<=i)break;k++;m-=i}while(1)}B=this._daylightSavingAdjust(new Date(h,k-1,m));if(B.getFullYear()!=h||B.getMonth()+1!=k||B.getDate()!=m)throw"Invalid date";return B},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*
60*60*1E7,formatDate:function(a,d,h){if(!d)return"";var i=(h?h.dayNamesShort:null)||this._defaults.dayNamesShort,j=(h?h.dayNames:null)||this._defaults.dayNames,n=(h?h.monthNamesShort:null)||this._defaults.monthNamesShort;h=(h?h.monthNames:null)||this._defaults.monthNames;var q=function(s){(s=p+1<a.length&&a.charAt(p+1)==s)&&p++;return s},l=function(s,r,u){r=""+r;if(q(s))for(;r.length<u;)r="0"+r;return r},k=function(s,r,u,v){return q(s)?v[r]:u[r]},m="",o=false;if(d)for(var p=0;p<a.length;p++)if(o)if(a.charAt(p)==
"'"&&!q("'"))o=false;else m+=a.charAt(p);else switch(a.charAt(p)){case "d":m+=l("d",d.getDate(),2);break;case "D":m+=k("D",d.getDay(),i,j);break;case "o":m+=l("o",(d.getTime()-(new Date(d.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":m+=l("m",d.getMonth()+1,2);break;case "M":m+=k("M",d.getMonth(),n,h);break;case "y":m+=q("y")?d.getFullYear():(d.getYear()%100<10?"0":"")+d.getYear()%100;break;case "@":m+=d.getTime();break;case "!":m+=d.getTime()*1E4+this._ticksTo1970;break;case "'":if(q("'"))m+=
"'";else o=true;break;default:m+=a.charAt(p)}return m},_possibleChars:function(a){for(var d="",h=false,i=function(n){(n=j+1<a.length&&a.charAt(j+1)==n)&&j++;return n},j=0;j<a.length;j++)if(h)if(a.charAt(j)=="'"&&!i("'"))h=false;else d+=a.charAt(j);else switch(a.charAt(j)){case "d":case "m":case "y":case "@":d+="0123456789";break;case "D":case "M":return null;case "'":if(i("'"))d+="'";else h=true;break;default:d+=a.charAt(j)}return d},_get:function(a,d){return a.settings[d]!==c?a.settings[d]:this._defaults[d]},
_setDateFromField:function(a,d){if(a.input.val()!=a.lastVal){var h=this._get(a,"dateFormat"),i=a.lastVal=a.input?a.input.val():null,j,n;j=n=this._getDefaultDate(a);var q=this._getFormatConfig(a);try{j=this.parseDate(h,i,q)||n}catch(l){this.log(l);i=d?"":i}a.selectedDay=j.getDate();a.drawMonth=a.selectedMonth=j.getMonth();a.drawYear=a.selectedYear=j.getFullYear();a.currentDay=i?j.getDate():0;a.currentMonth=i?j.getMonth():0;a.currentYear=i?j.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,
this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,d,h){var i=function(n){var q=new Date;q.setDate(q.getDate()+n);return q},j=function(n){try{return b.datepicker.parseDate(b.datepicker._get(a,"dateFormat"),n,b.datepicker._getFormatConfig(a))}catch(q){}var l=(n.toLowerCase().match(/^c/)?b.datepicker._getDate(a):null)||new Date,k=l.getFullYear(),m=l.getMonth();l=l.getDate();for(var o=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,p=o.exec(n);p;){switch(p[2]||"d"){case "d":case "D":l+=
parseInt(p[1],10);break;case "w":case "W":l+=parseInt(p[1],10)*7;break;case "m":case "M":m+=parseInt(p[1],10);l=Math.min(l,b.datepicker._getDaysInMonth(k,m));break;case "y":case "Y":k+=parseInt(p[1],10);l=Math.min(l,b.datepicker._getDaysInMonth(k,m));break}p=o.exec(n)}return new Date(k,m,l)};if(d=(d=d==null?h:typeof d=="string"?j(d):typeof d=="number"?isNaN(d)?h:i(d):d)&&d.toString()=="Invalid Date"?h:d){d.setHours(0);d.setMinutes(0);d.setSeconds(0);d.setMilliseconds(0)}return this._daylightSavingAdjust(d)},
_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,d,h){var i=!d,j=a.selectedMonth,n=a.selectedYear;d=this._restrictMinMax(a,this._determineDate(a,d,new Date));a.selectedDay=a.currentDay=d.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=d.getMonth();a.drawYear=a.selectedYear=a.currentYear=d.getFullYear();if((j!=a.selectedMonth||n!=a.selectedYear)&&!h)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(i?
"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var d=new Date;d=this._daylightSavingAdjust(new Date(d.getFullYear(),d.getMonth(),d.getDate()));var h=this._get(a,"isRTL"),i=this._get(a,"showButtonPanel"),j=this._get(a,"hideIfNoPrevNext"),n=this._get(a,"navigationAsDateFormat"),q=this._getNumberOfMonths(a),l=this._get(a,"showCurrentAtPos"),k=
this._get(a,"stepMonths"),m=q[0]!=1||q[1]!=1,o=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),p=this._getMinMaxDate(a,"min"),s=this._getMinMaxDate(a,"max");l=a.drawMonth-l;var r=a.drawYear;if(l<0){l+=12;r--}if(s){var u=this._daylightSavingAdjust(new Date(s.getFullYear(),s.getMonth()-q[0]*q[1]+1,s.getDate()));for(u=p&&u<p?p:u;this._daylightSavingAdjust(new Date(r,l,1))>u;){l--;if(l<0){l=11;r--}}}a.drawMonth=l;a.drawYear=r;u=this._get(a,
"prevText");u=!n?u:this.formatDate(u,this._daylightSavingAdjust(new Date(r,l-k,1)),this._getFormatConfig(a));u=this._canAdjustMonth(a,-1,r,l)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._adjustDate('#"+a.id+"', -"+k+", 'M');\" title=\""+u+'"><span class="ui-icon ui-icon-circle-triangle-'+(h?"e":"w")+'">'+u+"</span></a>":j?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+u+'"><span class="ui-icon ui-icon-circle-triangle-'+(h?"e":"w")+'">'+
u+"</span></a>";var v=this._get(a,"nextText");v=!n?v:this.formatDate(v,this._daylightSavingAdjust(new Date(r,l+k,1)),this._getFormatConfig(a));j=this._canAdjustMonth(a,+1,r,l)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._adjustDate('#"+a.id+"', +"+k+", 'M');\" title=\""+v+'"><span class="ui-icon ui-icon-circle-triangle-'+(h?"w":"e")+'">'+v+"</span></a>":j?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+v+'"><span class="ui-icon ui-icon-circle-triangle-'+
(h?"w":"e")+'">'+v+"</span></a>";k=this._get(a,"currentText");v=this._get(a,"gotoCurrent")&&a.currentDay?o:d;k=!n?k:this.formatDate(k,v,this._getFormatConfig(a));n=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+e+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";i=i?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(h?n:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
e+".datepicker._gotoToday('#"+a.id+"');\">"+k+"</button>":"")+(h?"":n)+"</div>":"";n=parseInt(this._get(a,"firstDay"),10);n=isNaN(n)?0:n;k=this._get(a,"showWeek");v=this._get(a,"dayNames");this._get(a,"dayNamesShort");var w=this._get(a,"dayNamesMin"),y=this._get(a,"monthNames"),B=this._get(a,"monthNamesShort"),x=this._get(a,"beforeShowDay"),C=this._get(a,"showOtherMonths"),J=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var M=this._getDefaultDate(a),K="",G=0;G<q[0];G++){for(var N=
"",H=0;H<q[1];H++){var O=this._daylightSavingAdjust(new Date(r,l,a.selectedDay)),A=" ui-corner-all",D="";if(m){D+='<div class="ui-datepicker-group';if(q[1]>1)switch(H){case 0:D+=" ui-datepicker-group-first";A=" ui-corner-"+(h?"right":"left");break;case q[1]-1:D+=" ui-datepicker-group-last";A=" ui-corner-"+(h?"left":"right");break;default:D+=" ui-datepicker-group-middle";A="";break}D+='">'}D+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+A+'">'+(/all|left/.test(A)&&G==0?h?
j:u:"")+(/all|right/.test(A)&&G==0?h?u:j:"")+this._generateMonthYearHeader(a,l,r,p,s,G>0||H>0,y,B)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var E=k?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(A=0;A<7;A++){var z=(A+n)%7;E+="<th"+((A+n+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+v[z]+'">'+w[z]+"</span></th>"}D+=E+"</tr></thead><tbody>";E=this._getDaysInMonth(r,l);if(r==a.selectedYear&&l==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,
E);A=(this._getFirstDayOfMonth(r,l)-n+7)%7;E=m?6:Math.ceil((A+E)/7);z=this._daylightSavingAdjust(new Date(r,l,1-A));for(var P=0;P<E;P++){D+="<tr>";var Q=!k?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(z)+"</td>";for(A=0;A<7;A++){var I=x?x.apply(a.input?a.input[0]:null,[z]):[true,""],F=z.getMonth()!=l,L=F&&!J||!I[0]||p&&z<p||s&&z>s;Q+='<td class="'+((A+n+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(z.getTime()==O.getTime()&&l==a.selectedMonth&&
a._keyEvent||M.getTime()==z.getTime()&&M.getTime()==O.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!C?"":" "+I[1]+(z.getTime()==o.getTime()?" "+this._currentClass:"")+(z.getTime()==d.getTime()?" ui-datepicker-today":""))+'"'+((!F||C)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+e+".datepicker._selectDay('#"+a.id+"',"+z.getMonth()+","+z.getFullYear()+', this);return false;"')+">"+(F&&!C?" ":L?'<span class="ui-state-default">'+z.getDate()+
"</span>":'<a class="ui-state-default'+(z.getTime()==d.getTime()?" ui-state-highlight":"")+(z.getTime()==o.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+z.getDate()+"</a>")+"</td>";z.setDate(z.getDate()+1);z=this._daylightSavingAdjust(z)}D+=Q+"</tr>"}l++;if(l>11){l=0;r++}D+="</tbody></table>"+(m?"</div>"+(q[0]>0&&H==q[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");N+=D}K+=N}K+=i+(b.browser.msie&&parseInt(b.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
"");a._keyEvent=false;return K},_generateMonthYearHeader:function(a,d,h,i,j,n,q,l){var k=this._get(a,"changeMonth"),m=this._get(a,"changeYear"),o=this._get(a,"showMonthAfterYear"),p='<div class="ui-datepicker-title">',s="";if(n||!k)s+='<span class="ui-datepicker-month">'+q[d]+"</span>";else{q=i&&i.getFullYear()==h;var r=j&&j.getFullYear()==h;s+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+e+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+e+".datepicker._clickMonthYear('#"+
a.id+"');\">";for(var u=0;u<12;u++)if((!q||u>=i.getMonth())&&(!r||u<=j.getMonth()))s+='<option value="'+u+'"'+(u==d?' selected="selected"':"")+">"+l[u]+"</option>";s+="</select>"}o||(p+=s+(n||!(k&&m)?" ":""));if(n||!m)p+='<span class="ui-datepicker-year">'+h+"</span>";else{l=this._get(a,"yearRange").split(":");var v=(new Date).getFullYear();q=function(w){w=w.match(/c[+-].*/)?h+parseInt(w.substring(1),10):w.match(/[+-].*/)?v+parseInt(w,10):parseInt(w,10);return isNaN(w)?v:w};d=q(l[0]);l=Math.max(d,
q(l[1]||""));d=i?Math.max(d,i.getFullYear()):d;l=j?Math.min(l,j.getFullYear()):l;for(p+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+e+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+e+".datepicker._clickMonthYear('#"+a.id+"');\">";d<=l;d++)p+='<option value="'+d+'"'+(d==h?' selected="selected"':"")+">"+d+"</option>";p+="</select>"}p+=this._get(a,"yearSuffix");if(o)p+=(n||!(k&&m)?" ":"")+s;p+="</div>";return p},_adjustInstDate:function(a,d,h){var i=
a.drawYear+(h=="Y"?d:0),j=a.drawMonth+(h=="M"?d:0);d=Math.min(a.selectedDay,this._getDaysInMonth(i,j))+(h=="D"?d:0);i=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(i,j,d)));a.selectedDay=i.getDate();a.drawMonth=a.selectedMonth=i.getMonth();a.drawYear=a.selectedYear=i.getFullYear();if(h=="M"||h=="Y")this._notifyChange(a)},_restrictMinMax:function(a,d){var h=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");d=h&&d<h?h:d;return d=a&&d>a?a:d},_notifyChange:function(a){var d=this._get(a,
"onChangeMonthYear");if(d)d.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,d){return this._determineDate(a,this._get(a,d+"Date"),null)},_getDaysInMonth:function(a,d){return 32-(new Date(a,d,32)).getDate()},_getFirstDayOfMonth:function(a,d){return(new Date(a,d,1)).getDay()},_canAdjustMonth:function(a,d,h,i){var j=this._getNumberOfMonths(a);
h=this._daylightSavingAdjust(new Date(h,i+(d<0?d:j[0]*j[1]),1));d<0&&h.setDate(this._getDaysInMonth(h.getFullYear(),h.getMonth()));return this._isInRange(a,h)},_isInRange:function(a,d){var h=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!h||d.getTime()>=h.getTime())&&(!a||d.getTime()<=a.getTime())},_getFormatConfig:function(a){var d=this._get(a,"shortYearCutoff");d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);return{shortYearCutoff:d,dayNamesShort:this._get(a,
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,d,h,i){if(!d){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}d=d?typeof d=="object"?d:this._daylightSavingAdjust(new Date(i,h,d)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),d,this._getFormatConfig(a))}});b.fn.datepicker=
function(a){if(!b.datepicker.initialized){b(document).mousedown(b.datepicker._checkExternalClick).find("body").append(b.datepicker.dpDiv);b.datepicker.initialized=true}var d=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this[0]].concat(d));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this[0]].concat(d));
return this.each(function(){typeof a=="string"?b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this].concat(d)):b.datepicker._attachDatepicker(this,a)})};b.datepicker=new f;b.datepicker.initialized=false;b.datepicker.uuid=(new Date).getTime();b.datepicker.version="1.8.6";window["DP_jQuery_"+e]=b})(jQuery);
(function(b,c){var f={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},g={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};b.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var a=b(this).css(e).offset().top;
a<0&&b(this).css("top",e.top-a)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var e=this,a=e.options,d=a.title||" ",h=b.ui.dialog.getTitleId(e.element),i=(e.uiDialog=b("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+a.dialogClass).css({zIndex:a.zIndex}).attr("tabIndex",
-1).css("outline",0).keydown(function(q){if(a.closeOnEscape&&q.keyCode&&q.keyCode===b.ui.keyCode.ESCAPE){e.close(q);q.preventDefault()}}).attr({role:"dialog","aria-labelledby":h}).mousedown(function(q){e.moveToTop(false,q)});e.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(i);var j=(e.uiDialogTitlebar=b("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(i),n=b('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role",
"button").hover(function(){n.addClass("ui-state-hover")},function(){n.removeClass("ui-state-hover")}).focus(function(){n.addClass("ui-state-focus")}).blur(function(){n.removeClass("ui-state-focus")}).click(function(q){e.close(q);return false}).appendTo(j);(e.uiDialogTitlebarCloseText=b("<span></span>")).addClass("ui-icon ui-icon-closethick").text(a.closeText).appendTo(n);b("<span></span>").addClass("ui-dialog-title").attr("id",h).html(d).prependTo(j);if(b.isFunction(a.beforeclose)&&!b.isFunction(a.beforeClose))a.beforeClose=
a.beforeclose;j.find("*").add(j).disableSelection();a.draggable&&b.fn.draggable&&e._makeDraggable();a.resizable&&b.fn.resizable&&e._makeResizable();e._createButtons(a.buttons);e._isOpen=false;b.fn.bgiframe&&i.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var e=this;e.overlay&&e.overlay.destroy();e.uiDialog.hide();e.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");e.uiDialog.remove();e.originalTitle&&
e.element.attr("title",e.originalTitle);return e},widget:function(){return this.uiDialog},close:function(e){var a=this,d;if(false!==a._trigger("beforeClose",e)){a.overlay&&a.overlay.destroy();a.uiDialog.unbind("keypress.ui-dialog");a._isOpen=false;if(a.options.hide)a.uiDialog.hide(a.options.hide,function(){a._trigger("close",e)});else{a.uiDialog.hide();a._trigger("close",e)}b.ui.dialog.overlay.resize();if(a.options.modal){d=0;b(".ui-dialog").each(function(){if(this!==a.uiDialog[0])d=Math.max(d,b(this).css("z-index"))});
b.ui.dialog.maxZ=d}return a}},isOpen:function(){return this._isOpen},moveToTop:function(e,a){var d=this,h=d.options;if(h.modal&&!e||!h.stack&&!h.modal)return d._trigger("focus",a);if(h.zIndex>b.ui.dialog.maxZ)b.ui.dialog.maxZ=h.zIndex;if(d.overlay){b.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",b.ui.dialog.overlay.maxZ=b.ui.dialog.maxZ)}e={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};b.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",b.ui.dialog.maxZ);d.element.attr(e);
d._trigger("focus",a);return d},open:function(){if(!this._isOpen){var e=this,a=e.options,d=e.uiDialog;e.overlay=a.modal?new b.ui.dialog.overlay(e):null;e._size();e._position(a.position);d.show(a.show);e.moveToTop(true);a.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode===b.ui.keyCode.TAB){var i=b(":tabbable",this),j=i.filter(":first");i=i.filter(":last");if(h.target===i[0]&&!h.shiftKey){j.focus(1);return false}else if(h.target===j[0]&&h.shiftKey){i.focus(1);return false}}});b(e.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();
e._isOpen=true;e._trigger("open");return e}},_createButtons:function(e){var a=this,d=false,h=b("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),i=b("<div></div>").addClass("ui-dialog-buttonset").appendTo(h);a.uiDialog.find(".ui-dialog-buttonpane").remove();typeof e==="object"&&e!==null&&b.each(e,function(){return!(d=true)});if(d){b.each(e,function(j,n){n=b.isFunction(n)?{click:n,text:j}:n;j=b('<button type="button"></button>').attr(n,true).unbind("click").click(function(){n.click.apply(a.element[0],
arguments)}).appendTo(i);b.fn.button&&j.button()});h.appendTo(a.uiDialog)}},_makeDraggable:function(){function e(j){return{position:j.position,offset:j.offset}}var a=this,d=a.options,h=b(document),i;a.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(j,n){i=d.height==="auto"?"auto":b(this).height();b(this).height(b(this).height()).addClass("ui-dialog-dragging");a._trigger("dragStart",j,e(n))},drag:function(j,
n){a._trigger("drag",j,e(n))},stop:function(j,n){d.position=[n.position.left-h.scrollLeft(),n.position.top-h.scrollTop()];b(this).removeClass("ui-dialog-dragging").height(i);a._trigger("dragStop",j,e(n));b.ui.dialog.overlay.resize()}})},_makeResizable:function(e){function a(j){return{originalPosition:j.originalPosition,originalSize:j.originalSize,position:j.position,size:j.size}}e=e===c?this.options.resizable:e;var d=this,h=d.options,i=d.uiDialog.css("position");e=typeof e==="string"?e:"n,e,s,w,se,sw,ne,nw";
d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:h.maxWidth,maxHeight:h.maxHeight,minWidth:h.minWidth,minHeight:d._minHeight(),handles:e,start:function(j,n){b(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",j,a(n))},resize:function(j,n){d._trigger("resize",j,a(n))},stop:function(j,n){b(this).removeClass("ui-dialog-resizing");h.height=b(this).height();h.width=b(this).width();d._trigger("resizeStop",j,a(n));b.ui.dialog.overlay.resize()}}).css("position",
i).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(e){var a=[],d=[0,0],h;if(e){if(typeof e==="string"||typeof e==="object"&&"0"in e){a=e.split?e.split(" "):[e[0],e[1]];if(a.length===1)a[1]=a[0];b.each(["left","top"],function(i,j){if(+a[i]===a[i]){d[i]=a[i];a[i]=j}});e={my:a.join(" "),at:a.join(" "),offset:d.join(" ")}}e=b.extend({},b.ui.dialog.prototype.options.position,
e)}else e=b.ui.dialog.prototype.options.position;(h=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(e);h||this.uiDialog.hide()},_setOptions:function(e){var a=this,d={},h=false;b.each(e,function(i,j){a._setOption(i,j);if(i in f)h=true;if(i in g)d[i]=j});h&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(e,a){var d=this,h=d.uiDialog;switch(e){case "beforeclose":e="beforeClose";break;case "buttons":d._createButtons(a);
break;case "closeText":d.uiDialogTitlebarCloseText.text(""+a);break;case "dialogClass":h.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+a);break;case "disabled":a?h.addClass("ui-dialog-disabled"):h.removeClass("ui-dialog-disabled");break;case "draggable":var i=h.is(":data(draggable)");i&&!a&&h.draggable("destroy");!i&&a&&d._makeDraggable();break;case "position":d._position(a);break;case "resizable":(i=h.is(":data(resizable)"))&&!a&&h.resizable("destroy");
i&&typeof a==="string"&&h.resizable("option","handles",a);!i&&a!==false&&d._makeResizable(a);break;case "title":b(".ui-dialog-title",d.uiDialogTitlebar).html(""+(a||" "));break}b.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var e=this.options,a,d;this.element.show().css({width:"auto",minHeight:0,height:0});if(e.minWidth>e.width)e.width=e.minWidth;a=this.uiDialog.css({height:"auto",width:e.width}).height();d=Math.max(0,e.minHeight-a);if(e.height==="auto")if(b.support.minHeight)this.element.css({minHeight:d,
height:"auto"});else{this.uiDialog.show();e=this.element.css("height","auto").height();this.uiDialog.hide();this.element.height(Math.max(e,d))}else this.element.height(Math.max(e.height-a,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});b.extend(b.ui.dialog,{version:"1.8.6",uuid:0,maxZ:0,getTitleId:function(e){e=e.attr("id");if(!e){this.uuid+=1;e=this.uuid}return"ui-dialog-title-"+e},overlay:function(e){this.$el=b.ui.dialog.overlay.create(e)}});
b.extend(b.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){b.ui.dialog.overlay.instances.length&&b(document).bind(b.ui.dialog.overlay.events,function(d){if(b(d.target).zIndex()<b.ui.dialog.overlay.maxZ)return false})},1);b(document).bind("keydown.dialog-overlay",function(d){if(e.options.closeOnEscape&&
d.keyCode&&d.keyCode===b.ui.keyCode.ESCAPE){e.close(d);d.preventDefault()}});b(window).bind("resize.dialog-overlay",b.ui.dialog.overlay.resize)}var a=(this.oldInstances.pop()||b("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});b.fn.bgiframe&&a.bgiframe();this.instances.push(a);return a},destroy:function(e){this.oldInstances.push(this.instances.splice(b.inArray(e,this.instances),1)[0]);this.instances.length===0&&b([document,window]).unbind(".dialog-overlay");
e.remove();var a=0;b.each(this.instances,function(){a=Math.max(a,this.css("z-index"))});this.maxZ=a},height:function(){var e,a;if(b.browser.msie&&b.browser.version<7){e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);a=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return e<a?b(window).height()+"px":e+"px"}else return b(document).height()+"px"},width:function(){var e,a;if(b.browser.msie&&b.browser.version<7){e=Math.max(document.documentElement.scrollWidth,
document.body.scrollWidth);a=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return e<a?b(window).width()+"px":e+"px"}else return b(document).width()+"px"},resize:function(){var e=b([]);b.each(b.ui.dialog.overlay.instances,function(){e=e.add(this)});e.css({width:0,height:0}).css({width:b.ui.dialog.overlay.width(),height:b.ui.dialog.overlay.height()})}});b.extend(b.ui.dialog.overlay.prototype,{destroy:function(){b.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
(function(b){b.ui=b.ui||{};var c=/left|center|right/,f=/top|center|bottom/,g=b.fn.position,e=b.fn.offset;b.fn.position=function(a){if(!a||!a.of)return g.apply(this,arguments);a=b.extend({},a);var d=b(a.of),h=d[0],i=(a.collision||"flip").split(" "),j=a.offset?a.offset.split(" "):[0,0],n,q,l;if(h.nodeType===9){n=d.width();q=d.height();l={top:0,left:0}}else if(h.setTimeout){n=d.width();q=d.height();l={top:d.scrollTop(),left:d.scrollLeft()}}else if(h.preventDefault){a.at="left top";n=q=0;l={top:a.of.pageY,
left:a.of.pageX}}else{n=d.outerWidth();q=d.outerHeight();l=d.offset()}b.each(["my","at"],function(){var k=(a[this]||"").split(" ");if(k.length===1)k=c.test(k[0])?k.concat(["center"]):f.test(k[0])?["center"].concat(k):["center","center"];k[0]=c.test(k[0])?k[0]:"center";k[1]=f.test(k[1])?k[1]:"center";a[this]=k});if(i.length===1)i[1]=i[0];j[0]=parseInt(j[0],10)||0;if(j.length===1)j[1]=j[0];j[1]=parseInt(j[1],10)||0;if(a.at[0]==="right")l.left+=n;else if(a.at[0]==="center")l.left+=n/2;if(a.at[1]==="bottom")l.top+=
q;else if(a.at[1]==="center")l.top+=q/2;l.left+=j[0];l.top+=j[1];return this.each(function(){var k=b(this),m=k.outerWidth(),o=k.outerHeight(),p=parseInt(b.curCSS(this,"marginLeft",true))||0,s=parseInt(b.curCSS(this,"marginTop",true))||0,r=m+p+parseInt(b.curCSS(this,"marginRight",true))||0,u=o+s+parseInt(b.curCSS(this,"marginBottom",true))||0,v=b.extend({},l),w;if(a.my[0]==="right")v.left-=m;else if(a.my[0]==="center")v.left-=m/2;if(a.my[1]==="bottom")v.top-=o;else if(a.my[1]==="center")v.top-=o/2;
v.left=parseInt(v.left);v.top=parseInt(v.top);w={left:v.left-p,top:v.top-s};b.each(["left","top"],function(y,B){b.ui.position[i[y]]&&b.ui.position[i[y]][B](v,{targetWidth:n,targetHeight:q,elemWidth:m,elemHeight:o,collisionPosition:w,collisionWidth:r,collisionHeight:u,offset:j,my:a.my,at:a.at})});b.fn.bgiframe&&k.bgiframe();k.offset(b.extend(v,{using:a.using}))})};b.ui.position={fit:{left:function(a,d){var h=b(window);h=d.collisionPosition.left+d.collisionWidth-h.width()-h.scrollLeft();a.left=h>0?
a.left-h:Math.max(a.left-d.collisionPosition.left,a.left)},top:function(a,d){var h=b(window);h=d.collisionPosition.top+d.collisionHeight-h.height()-h.scrollTop();a.top=h>0?a.top-h:Math.max(a.top-d.collisionPosition.top,a.top)}},flip:{left:function(a,d){if(d.at[0]!=="center"){var h=b(window);h=d.collisionPosition.left+d.collisionWidth-h.width()-h.scrollLeft();var i=d.my[0]==="left"?-d.elemWidth:d.my[0]==="right"?d.elemWidth:0,j=d.at[0]==="left"?d.targetWidth:-d.targetWidth,n=-2*d.offset[0];a.left+=
d.collisionPosition.left<0?i+j+n:h>0?i+j+n:0}},top:function(a,d){if(d.at[1]!=="center"){var h=b(window);h=d.collisionPosition.top+d.collisionHeight-h.height()-h.scrollTop();var i=d.my[1]==="top"?-d.elemHeight:d.my[1]==="bottom"?d.elemHeight:0,j=d.at[1]==="top"?d.targetHeight:-d.targetHeight,n=-2*d.offset[1];a.top+=d.collisionPosition.top<0?i+j+n:h>0?i+j+n:0}}}};if(!b.offset.setOffset){b.offset.setOffset=function(a,d){if(/static/.test(b.curCSS(a,"position")))a.style.position="relative";var h=b(a),
i=h.offset(),j=parseInt(b.curCSS(a,"top",true),10)||0,n=parseInt(b.curCSS(a,"left",true),10)||0;i={top:d.top-i.top+j,left:d.left-i.left+n};"using"in d?d.using.call(a,i):h.css(i)};b.fn.offset=function(a){var d=this[0];if(!d||!d.ownerDocument)return null;if(a)return this.each(function(){b.offset.setOffset(this,a)});return e.call(this)}}})(jQuery);
(function(b,c){b.widget("ui.progressbar",{options:{value:0},min:0,max:100,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(f){if(f===c)return this._value();this._setOption("value",f);return this},_setOption:function(f,g){if(f==="value"){this.options.value=g;this._refreshValue();this._trigger("change");this._value()===this.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var f=this.options.value;if(typeof f!=="number")f=0;return Math.min(this.max,Math.max(this.min,f))},_refreshValue:function(){var f=
this.value();this.valueDiv.toggleClass("ui-corner-right",f===this.max).width(f+"%");this.element.attr("aria-valuenow",f)}});b.extend(b.ui.progressbar,{version:"1.8.6"})})(jQuery);
(function(b){b.widget("ui.slider",b.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var c=this,f=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");f.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");
this.range=b([]);if(f.range){if(f.range===true){this.range=b("<div></div>");if(!f.values)f.values=[this._valueMin(),this._valueMin()];if(f.values.length&&f.values.length!==2)f.values=[f.values[0],f.values[0]]}else this.range=b("<div></div>");this.range.appendTo(this.element).addClass("ui-slider-range");if(f.range==="min"||f.range==="max")this.range.addClass("ui-slider-range-"+f.range);this.range.addClass("ui-widget-header")}b(".ui-slider-handle",this.element).length===0&&b("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
if(f.values&&f.values.length)for(;b(".ui-slider-handle",this.element).length<f.values.length;)b("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){f.disabled||b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(f.disabled)b(this).blur();
else{b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(g){b(this).data("index.ui-slider-handle",g)});this.handles.keydown(function(g){var e=true,a=b(this).data("index.ui-slider-handle"),d,h,i;if(!c.options.disabled){switch(g.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:e=
false;if(!c._keySliding){c._keySliding=true;b(this).addClass("ui-state-active");d=c._start(g,a);if(d===false)return}break}i=c.options.step;d=c.options.values&&c.options.values.length?(h=c.values(a)):(h=c.value());switch(g.keyCode){case b.ui.keyCode.HOME:h=c._valueMin();break;case b.ui.keyCode.END:h=c._valueMax();break;case b.ui.keyCode.PAGE_UP:h=c._trimAlignValue(d+(c._valueMax()-c._valueMin())/5);break;case b.ui.keyCode.PAGE_DOWN:h=c._trimAlignValue(d-(c._valueMax()-c._valueMin())/5);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(d===
c._valueMax())return;h=c._trimAlignValue(d+i);break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(d===c._valueMin())return;h=c._trimAlignValue(d-i);break}c._slide(g,a,h);return e}}).keyup(function(g){var e=b(this).data("index.ui-slider-handle");if(c._keySliding){c._keySliding=false;c._stop(g,e);c._change(g,e);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");
this._mouseDestroy();return this},_mouseCapture:function(c){var f=this.options,g,e,a,d,h;if(f.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();g=this._normValueFromMouse({x:c.pageX,y:c.pageY});e=this._valueMax()-this._valueMin()+1;d=this;this.handles.each(function(i){var j=Math.abs(g-d.values(i));if(e>j){e=j;a=b(this);h=i}});if(f.range===true&&this.values(1)===f.min){h+=1;a=b(this.handles[h])}if(this._start(c,
h)===false)return false;this._mouseSliding=true;d._handleIndex=h;a.addClass("ui-state-active").focus();f=a.offset();this._clickOffset=!b(c.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:c.pageX-f.left-a.width()/2,top:c.pageY-f.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)};this._slide(c,h,g);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(c){var f=
this._normValueFromMouse({x:c.pageX,y:c.pageY});this._slide(c,this._handleIndex,f);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(c){var f;if(this.orientation==="horizontal"){f=
this.elementSize.width;c=c.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{f=this.elementSize.height;c=c.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}f=c/f;if(f>1)f=1;if(f<0)f=0;if(this.orientation==="vertical")f=1-f;c=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+f*c)},_start:function(c,f){var g={handle:this.handles[f],value:this.value()};if(this.options.values&&this.options.values.length){g.value=this.values(f);
g.values=this.values()}return this._trigger("start",c,g)},_slide:function(c,f,g){var e;if(this.options.values&&this.options.values.length){e=this.values(f?0:1);if(this.options.values.length===2&&this.options.range===true&&(f===0&&g>e||f===1&&g<e))g=e;if(g!==this.values(f)){e=this.values();e[f]=g;c=this._trigger("slide",c,{handle:this.handles[f],value:g,values:e});this.values(f?0:1);c!==false&&this.values(f,g,true)}}else if(g!==this.value()){c=this._trigger("slide",c,{handle:this.handles[f],value:g});
c!==false&&this.value(g)}},_stop:function(c,f){var g={handle:this.handles[f],value:this.value()};if(this.options.values&&this.options.values.length){g.value=this.values(f);g.values=this.values()}this._trigger("stop",c,g)},_change:function(c,f){if(!this._keySliding&&!this._mouseSliding){var g={handle:this.handles[f],value:this.value()};if(this.options.values&&this.options.values.length){g.value=this.values(f);g.values=this.values()}this._trigger("change",c,g)}},value:function(c){if(arguments.length){this.options.value=
this._trimAlignValue(c);this._refreshValue();this._change(null,0)}return this._value()},values:function(c,f){var g,e,a;if(arguments.length>1){this.options.values[c]=this._trimAlignValue(f);this._refreshValue();this._change(null,c)}if(arguments.length)if(b.isArray(arguments[0])){g=this.options.values;e=arguments[0];for(a=0;a<g.length;a+=1){g[a]=this._trimAlignValue(e[a]);this._change(null,a)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(c):this.value();
else return this._values()},_setOption:function(c,f){var g,e=0;if(b.isArray(this.options.values))e=this.options.values.length;b.Widget.prototype._setOption.apply(this,arguments);switch(c){case "disabled":if(f){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(g=0;g<e;g+=1)this._change(null,g);this._animateOff=false;break}},_value:function(){var c=this.options.value;return c=this._trimAlignValue(c)},_values:function(c){var f,g;if(arguments.length){f=this.options.values[c];
return f=this._trimAlignValue(f)}else{f=this.options.values.slice();for(g=0;g<f.length;g+=1)f[g]=this._trimAlignValue(f[g]);return f}},_trimAlignValue:function(c){if(c<this._valueMin())return this._valueMin();if(c>this._valueMax())return this._valueMax();var f=this.options.step>0?this.options.step:1,g=c%f;c=c-g;if(Math.abs(g)*2>=f)c+=g>0?f:-f;return parseFloat(c.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var c=
this.options.range,f=this.options,g=this,e=!this._animateOff?f.animate:false,a,d={},h,i,j,n;if(this.options.values&&this.options.values.length)this.handles.each(function(q){a=(g.values(q)-g._valueMin())/(g._valueMax()-g._valueMin())*100;d[g.orientation==="horizontal"?"left":"bottom"]=a+"%";b(this).stop(1,1)[e?"animate":"css"](d,f.animate);if(g.options.range===true)if(g.orientation==="horizontal"){if(q===0)g.range.stop(1,1)[e?"animate":"css"]({left:a+"%"},f.animate);if(q===1)g.range[e?"animate":"css"]({width:a-
h+"%"},{queue:false,duration:f.animate})}else{if(q===0)g.range.stop(1,1)[e?"animate":"css"]({bottom:a+"%"},f.animate);if(q===1)g.range[e?"animate":"css"]({height:a-h+"%"},{queue:false,duration:f.animate})}h=a});else{i=this.value();j=this._valueMin();n=this._valueMax();a=n!==j?(i-j)/(n-j)*100:0;d[g.orientation==="horizontal"?"left":"bottom"]=a+"%";this.handle.stop(1,1)[e?"animate":"css"](d,f.animate);if(c==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:a+"%"},
f.animate);if(c==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-a+"%"},{queue:false,duration:f.animate});if(c==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:a+"%"},f.animate);if(c==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-a+"%"},{queue:false,duration:f.animate})}}});b.extend(b.ui.slider,{version:"1.8.6"})})(jQuery);
(function(b,c){function f(){return++e}function g(){return++a}var e=0,a=0;b.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(d,h){if(d=="selected")this.options.collapsible&&
h==this.options.selected||this.select(h);else{this.options[d]=h;this._tabify()}},_tabId:function(d){return d.title&&d.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+f()},_sanitizeSelector:function(d){return d.replace(/:/g,"\\:")},_cookie:function(){var d=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+g());return b.cookie.apply(null,[d].concat(b.makeArray(arguments)))},_ui:function(d,h){return{tab:d,panel:h,index:this.anchors.index(d)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var d=
b(this);d.html(d.data("label.tabs")).removeData("label.tabs")})},_tabify:function(d){function h(r,u){r.css("display","");!b.support.opacity&&u.opacity&&r[0].style.removeAttribute("filter")}var i=this,j=this.options,n=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=b(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return b("a",this)[0]});this.panels=b([]);this.anchors.each(function(r,u){var v=b(u).attr("href"),w=v.split("#")[0],y;if(w&&(w===location.toString().split("#")[0]||
(y=b("base")[0])&&w===y.href)){v=u.hash;u.href=v}if(n.test(v))i.panels=i.panels.add(i._sanitizeSelector(v));else if(v&&v!=="#"){b.data(u,"href.tabs",v);b.data(u,"load.tabs",v.replace(/#.*$/,""));v=i._tabId(u);u.href="#"+v;u=b("#"+v);if(!u.length){u=b(j.panelTemplate).attr("id",v).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(i.panels[r-1]||i.list);u.data("destroy.tabs",true)}i.panels=i.panels.add(u)}else j.disabled.push(r)});if(d){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(j.selected===c){location.hash&&this.anchors.each(function(r,u){if(u.hash==location.hash){j.selected=r;return false}});if(typeof j.selected!=="number"&&j.cookie)j.selected=parseInt(i._cookie(),10);if(typeof j.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)j.selected=
this.lis.index(this.lis.filter(".ui-tabs-selected"));j.selected=j.selected||(this.lis.length?0:-1)}else if(j.selected===null)j.selected=-1;j.selected=j.selected>=0&&this.anchors[j.selected]||j.selected<0?j.selected:0;j.disabled=b.unique(j.disabled.concat(b.map(this.lis.filter(".ui-state-disabled"),function(r){return i.lis.index(r)}))).sort();b.inArray(j.selected,j.disabled)!=-1&&j.disabled.splice(b.inArray(j.selected,j.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
if(j.selected>=0&&this.anchors.length){b(i._sanitizeSelector(i.anchors[j.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active");i.element.queue("tabs",function(){i._trigger("show",null,i._ui(i.anchors[j.selected],b(i._sanitizeSelector(i.anchors[j.selected].hash))))});this.load(j.selected)}b(window).bind("unload",function(){i.lis.add(i.anchors).unbind(".tabs");i.lis=i.anchors=i.panels=null})}else j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
this.element[j.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");j.cookie&&this._cookie(j.selected,j.cookie);d=0;for(var q;q=this.lis[d];d++)b(q)[b.inArray(d,j.disabled)!=-1&&!b(q).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");j.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(j.event!=="mouseover"){var l=function(r,u){u.is(":not(.ui-state-disabled)")&&u.addClass("ui-state-"+r)},k=function(r,u){u.removeClass("ui-state-"+
r)};this.lis.bind("mouseover.tabs",function(){l("hover",b(this))});this.lis.bind("mouseout.tabs",function(){k("hover",b(this))});this.anchors.bind("focus.tabs",function(){l("focus",b(this).closest("li"))});this.anchors.bind("blur.tabs",function(){k("focus",b(this).closest("li"))})}var m,o;if(j.fx)if(b.isArray(j.fx)){m=j.fx[0];o=j.fx[1]}else m=o=j.fx;var p=o?function(r,u){b(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
function(){h(u,o);i._trigger("show",null,i._ui(r,u[0]))})}:function(r,u){b(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.removeClass("ui-tabs-hide");i._trigger("show",null,i._ui(r,u[0]))},s=m?function(r,u){u.animate(m,m.duration||"normal",function(){i.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");h(u,m);i.element.dequeue("tabs")})}:function(r,u){i.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");i.element.dequeue("tabs")};
this.anchors.bind(j.event+".tabs",function(){var r=this,u=b(r).closest("li"),v=i.panels.filter(":not(.ui-tabs-hide)"),w=b(i._sanitizeSelector(r.hash));if(u.hasClass("ui-tabs-selected")&&!j.collapsible||u.hasClass("ui-state-disabled")||u.hasClass("ui-state-processing")||i.panels.filter(":animated").length||i._trigger("select",null,i._ui(this,w[0]))===false){this.blur();return false}j.selected=i.anchors.index(this);i.abort();if(j.collapsible)if(u.hasClass("ui-tabs-selected")){j.selected=-1;j.cookie&&
i._cookie(j.selected,j.cookie);i.element.queue("tabs",function(){s(r,v)}).dequeue("tabs");this.blur();return false}else if(!v.length){j.cookie&&i._cookie(j.selected,j.cookie);i.element.queue("tabs",function(){p(r,w)});i.load(i.anchors.index(this));this.blur();return false}j.cookie&&i._cookie(j.selected,j.cookie);if(w.length){v.length&&i.element.queue("tabs",function(){s(r,v)});i.element.queue("tabs",function(){p(r,w)});i.load(i.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
b.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(d){if(typeof d=="string")d=this.anchors.index(this.anchors.filter("[href$="+d+"]"));return d},destroy:function(){var d=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var h=
b.data(this,"href.tabs");if(h)this.href=h;var i=b(this).unbind(".tabs");b.each(["href","load","cache"],function(j,n){i.removeData(n+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){b.data(this,"destroy.tabs")?b(this).remove():b(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});d.cookie&&this._cookie(null,d.cookie);return this},add:function(d,
h,i){if(i===c)i=this.anchors.length;var j=this,n=this.options;h=b(n.tabTemplate.replace(/#\{href\}/g,d).replace(/#\{label\}/g,h));d=!d.indexOf("#")?d.replace("#",""):this._tabId(b("a",h)[0]);h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var q=b("#"+d);q.length||(q=b(n.panelTemplate).attr("id",d).data("destroy.tabs",true));q.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(i>=this.lis.length){h.appendTo(this.list);q.appendTo(this.list[0].parentNode)}else{h.insertBefore(this.lis[i]);
q.insertBefore(this.panels[i])}n.disabled=b.map(n.disabled,function(l){return l>=i?++l:l});this._tabify();if(this.anchors.length==1){n.selected=0;h.addClass("ui-tabs-selected ui-state-active");q.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){j._trigger("show",null,j._ui(j.anchors[0],j.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[i],this.panels[i]));return this},remove:function(d){d=this._getIndex(d);var h=this.options,i=this.lis.eq(d).remove(),j=this.panels.eq(d).remove();
if(i.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(d+(d+1<this.anchors.length?1:-1));h.disabled=b.map(b.grep(h.disabled,function(n){return n!=d}),function(n){return n>=d?--n:n});this._tabify();this._trigger("remove",null,this._ui(i.find("a")[0],j[0]));return this},enable:function(d){d=this._getIndex(d);var h=this.options;if(b.inArray(d,h.disabled)!=-1){this.lis.eq(d).removeClass("ui-state-disabled");h.disabled=b.grep(h.disabled,function(i){return i!=d});this._trigger("enable",null,
this._ui(this.anchors[d],this.panels[d]));return this}},disable:function(d){d=this._getIndex(d);var h=this.options;if(d!=h.selected){this.lis.eq(d).addClass("ui-state-disabled");h.disabled.push(d);h.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[d],this.panels[d]))}return this},select:function(d){d=this._getIndex(d);if(d==-1)if(this.options.collapsible&&this.options.selected!=-1)d=this.options.selected;else return this;this.anchors.eq(d).trigger(this.options.event+".tabs");return this},
load:function(d){d=this._getIndex(d);var h=this,i=this.options,j=this.anchors.eq(d)[0],n=b.data(j,"load.tabs");this.abort();if(!n||this.element.queue("tabs").length!==0&&b.data(j,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(d).addClass("ui-state-processing");if(i.spinner){var q=b("span",j);q.data("label.tabs",q.html()).html(i.spinner)}this.xhr=b.ajax(b.extend({},i.ajaxOptions,{url:n,success:function(l,k){b(h._sanitizeSelector(j.hash)).html(l);h._cleanup();i.cache&&b.data(j,"cache.tabs",
true);h._trigger("load",null,h._ui(h.anchors[d],h.panels[d]));try{i.ajaxOptions.success(l,k)}catch(m){}},error:function(l,k){h._cleanup();h._trigger("load",null,h._ui(h.anchors[d],h.panels[d]));try{i.ajaxOptions.error(l,k,d,j)}catch(m){}}}));h.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(d,
h){this.anchors.eq(d).removeData("cache.tabs").data("load.tabs",h);return this},length:function(){return this.anchors.length}});b.extend(b.ui.tabs,{version:"1.8.6"});b.extend(b.ui.tabs.prototype,{rotation:null,rotate:function(d,h){var i=this,j=this.options,n=i._rotate||(i._rotate=function(q){clearTimeout(i.rotation);i.rotation=setTimeout(function(){var l=j.selected;i.select(++l<i.anchors.length?l:0)},d);q&&q.stopPropagation()});h=i._unrotate||(i._unrotate=!h?function(q){q.clientX&&i.rotate(null)}:
function(){t=j.selected;n()});if(d){this.element.bind("tabsshow",n);this.anchors.bind(j.event+".tabs",h);n()}else{clearTimeout(i.rotation);this.element.unbind("tabsshow",n);this.anchors.unbind(j.event+".tabs",h);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
|
function settype(vr, type) {
// discuss at: http://phpjs.org/functions/settype/
// original by: Waldo Malqui Silva (http://waldo.malqui.info)
// improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// revised by: Brett Zamir (http://brett-zamir.me)
// note: Credits to Crockford also
// note: only works on global variables, and "vr" must be passed in as a string
// example 1: foo = '5bar';
// example 1: settype('foo', 'integer');
// example 1: $result = foo
// returns 1: 5
// example 2: foo = true;
// example 2: settype('foo', 'string');
// example 2: $result = foo
// returns 2: '1'
var is_array = function(arr) {
return typeof arr === 'object' && typeof arr.length === 'number' && !(arr.propertyIsEnumerable('length')) &&
typeof arr.splice === 'function';
};
var v, mtch, i, obj;
v = this[vr] ? this[vr] : vr;
try {
switch (type) {
case 'boolean':
if (is_array(v) && v.length === 0) {
this[vr] = false;
} else if (v === '0') {
this[vr] = false;
} else if (typeof v === 'object' && !is_array(v)) {
var lgth = false;
for (i in v) {
lgth = true;
}
this[vr] = lgth;
} else {
this[vr] = !!v;
}
break;
case 'integer':
if (typeof v === 'number') {
this[vr] = parseInt(v, 10);
} else if (typeof v === 'string') {
mtch = v.match(/^([+\-]?)(\d+)/);
if (!mtch) {
this[vr] = 0;
} else {
this[vr] = parseInt(v, 10);
}
} else if (v === true) {
this[vr] = 1;
} else if (v === false || v === null) {
this[vr] = 0;
} else if (is_array(v) && v.length === 0) {
this[vr] = 0;
} else if (typeof v === 'object') {
this[vr] = 1;
}
break;
case 'float':
if (typeof v === 'string') {
mtch = v.match(/^([+\-]?)(\d+(\.\d+)?|\.\d+)([eE][+\-]?\d+)?/);
if (!mtch) {
this[vr] = 0;
} else {
this[vr] = parseFloat(v, 10);
}
} else if (v === true) {
this[vr] = 1;
} else if (v === false || v === null) {
this[vr] = 0;
} else if (is_array(v) && v.length === 0) {
this[vr] = 0;
} else if (typeof v === 'object') {
this[vr] = 1;
}
break;
case 'string':
if (v === null || v === false) {
this[vr] = '';
} else if (is_array(v)) {
this[vr] = 'Array';
} else if (typeof v === 'object') {
this[vr] = 'Object';
} else if (v === true) {
this[vr] = '1';
} else {
this[vr] += '';
} // numbers (and functions?)
break;
case 'array':
if (v === null) {
this[vr] = [];
} else if (typeof v !== 'object') {
this[vr] = [v];
}
break;
case 'object':
if (v === null) {
this[vr] = {};
} else if (is_array(v)) {
for (i = 0, obj = {}; i < v.length; i++) {
obj[i] = v;
}
this[vr] = obj;
} else if (typeof v !== 'object') {
this[vr] = {
scalar : v
};
}
break;
case 'null':
delete this[vr];
break;
}
return true;
} catch (e) {
return false;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.