From 7fa912663b5eb8c43b94146fe3c696810e454fd0 Mon Sep 17 00:00:00 2001 From: Djebali Sofiene Date: Thu, 28 Apr 2016 08:00:39 +0200 Subject: [PATCH 01/53] NodeJS plugin --- Plugins/Vorlon/plugins/nodejs/README.md | 33 +++++ Plugins/Vorlon/plugins/nodejs/control.html | 37 +++++ .../plugins/nodejs/vorlon.nodejs.client.ts | 46 ++++++ .../plugins/nodejs/vorlon.nodejs.dashboard.ts | 66 +++++++++ .../typings/Vorlon/vorlon.basePlugin.d.ts | 18 +++ .../Vorlon/vorlon.clientMessenger.d.ts | 39 +++++ .../typings/Vorlon/vorlon.clientPlugin.d.ts | 12 ++ .../Scripts/typings/Vorlon/vorlon.core.d.ts | 37 +++++ .../Vorlon/vorlon.dashboardPlugin.d.ts | 17 +++ .../Scripts/typings/Vorlon/vorlon.enums.d.ts | 12 ++ .../Scripts/typings/Vorlon/vorlon.tools.d.ts | 45 ++++++ Server/config.json | 140 +++++++++++++++--- 12 files changed, 482 insertions(+), 20 deletions(-) create mode 100644 Plugins/Vorlon/plugins/nodejs/README.md create mode 100644 Plugins/Vorlon/plugins/nodejs/control.html create mode 100644 Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.client.ts create mode 100644 Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.dashboard.ts create mode 100644 Server/Scripts/typings/Vorlon/vorlon.basePlugin.d.ts create mode 100644 Server/Scripts/typings/Vorlon/vorlon.clientMessenger.d.ts create mode 100644 Server/Scripts/typings/Vorlon/vorlon.clientPlugin.d.ts create mode 100644 Server/Scripts/typings/Vorlon/vorlon.core.d.ts create mode 100644 Server/Scripts/typings/Vorlon/vorlon.dashboardPlugin.d.ts create mode 100644 Server/Scripts/typings/Vorlon/vorlon.enums.d.ts create mode 100644 Server/Scripts/typings/Vorlon/vorlon.tools.d.ts diff --git a/Plugins/Vorlon/plugins/nodejs/README.md b/Plugins/Vorlon/plugins/nodejs/README.md new file mode 100644 index 00000000..db39b395 --- /dev/null +++ b/Plugins/Vorlon/plugins/nodejs/README.md @@ -0,0 +1,33 @@ +# Sample plugin + +This is an example additional plugin for vorlon. It renders an input field into the Vorlon dashboard. If you type a message, it sends it to your client, which reverses it, and sends it back to be rendered into the dashboard. + +You can use this as a starting point for your own plugins. + +## Enabling the sample plugin + +To enable the sample plugin: + +1. Clone this github repo if you haven't already (`git clone git@github.com/MicrosoftDX/Vorlonjs`) +2. Modify `Server/config.json` to add the plugin, so it looks like this: + +```json +{ + "includeSocketIO": true, + "plugins": [ + { "id": "CONSOLE", "name": "Interactive Console", "panel": "bottom", "foldername" : "interactiveConsole", "enabled": true}, + { "id": "DOM", "name": "Dom Explorer", "panel": "top", "foldername" : "domExplorer", "enabled": true }, + { "id": "MODERNIZR", "name": "Modernizr","panel": "bottom", "foldername" : "modernizrReport", "enabled": true }, + { "id": "OBJEXPLORER", "name" : "Obj. Explorer","panel": "top", "foldername" : "objectExplorer", "enabled": true }, + { "id": "SAMPLE", "name" : "Sample","panel": "top", "foldername" : "sample", "enabled": true } + ] +} +``` + +3. From the root directory of the repository, install dependencies with `npm install`, build vorlon with `npm run build` and start the server with `npm start` (make sure you kill any existing vorlon servers running on your machine. You can now navigate to the vorlon dashboard as normal, and you'll see an additional tab in the list. + +## Modifying the plugin + +The plugin is based on two files (one for the client and one for the dashboard) who respectively extend from VORLON.ClientPlugin and VORLON.DashboardPlugin, as defined in `Plugins/Vorlon/vorlon.clientPlugin.ts` and `Plugins/Vorlon/vorlon.dashboardPlugin.ts` so you can see what methods are available for your plugin from there. You may also wish to look at the other existing plugins in `Plugins/Vorlon/plugins` for ideas. + +`control.html` will be inserted into the dashboard, as will `dashboard.css`. diff --git a/Plugins/Vorlon/plugins/nodejs/control.html b/Plugins/Vorlon/plugins/nodejs/control.html new file mode 100644 index 00000000..8fc561fa --- /dev/null +++ b/Plugins/Vorlon/plugins/nodejs/control.html @@ -0,0 +1,37 @@ + + + + + + + + +
+
+
+
+
    + +
+
+ + +
+
+
+
+

Modules

+

Memory

+

EXPRESS - Routes

+
+
+
+ + + diff --git a/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.client.ts b/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.client.ts new file mode 100644 index 00000000..d4374007 --- /dev/null +++ b/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.client.ts @@ -0,0 +1,46 @@ +module VORLON { + export class NodejsClient extends ClientPlugin { + + constructor() { + super("nodejs"); // Name + this._ready = true; // No need to wait + console.log('Started'); + } + + //Return unique id for your plugin + public getID(): string { + return "NODEJS"; + } + + public refresh(): void { + //override this method with cleanup work that needs to happen + //as the user switches between clients on the dashboard + + //we don't really need to do anything in this sample + } + + // This code will run on the client ////////////////////// + + // Start the clientside code + public startClientSide(): void { + + } + + // Handle messages from the dashboard, on the client + public onRealtimeMessageReceivedFromDashboardSide(receivedObject: any): void { + if (receivedObject == 'modules') { + this.sendToDashboard({ type: 'modules', data: Object.keys(require('module')._cache)}); + } else if (receivedObject == 'routes') { + console.log('test'); + console.log('test2'); + var routes = []; + this.sendToDashboard({ type: 'modules', data: routes}); + } else if (receivedObject == 'memory') { + this.sendToDashboard({ type: 'memory', data: process.memoryUsage()}); + } + } + } + + //Register the plugin with vorlon core + Core.RegisterClientPlugin(new NodejsClient()); +} diff --git a/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.dashboard.ts b/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.dashboard.ts new file mode 100644 index 00000000..9e067bec --- /dev/null +++ b/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.dashboard.ts @@ -0,0 +1,66 @@ +module VORLON { + + declare var $: any; + + export class NodejsDashboard extends DashboardPlugin { + + //Do any setup you need, call super to configure + //the plugin with html and css for the dashboard + constructor() { + // name , html for dash css for dash + super("nodejs", "control.html", "control.css"); + this._ready = true; + console.log('Started'); + } + + //Return unique id for your plugin + public getID(): string { + return "NODEJS"; + } + + // This code will run on the dashboard ////////////////////// + + // Start dashboard code + // uses _insertHtmlContentAsync to insert the control.html content + // into the dashboard + private _inputField: HTMLInputElement + private _outputDiv: HTMLElement + + public startDashboardSide(div: HTMLDivElement = null): void { + this._insertHtmlContentAsync(div, (filledDiv) => { + this.toogleMenu(); + this.sendToClient('modules'); + this.sendToClient('routes'); + this.sendToClient('memory'); + }) + } + + public toogleMenu(): void { + $('.open-menu').click(function() { + $('.open-menu').removeClass('active-menu'); + $('#searchlist').val(''); + $('.explorer-menu').hide(); + $('#' + $(this).data('menu')).show(); + $('.new-entry').fadeOut(); + $(this).addClass('active-menu'); + }); + } + public onRealtimeMessageReceivedFromClientSide(receivedObject: any): void { + if (receivedObject.type == 'modules') { + for (var i = 0, len = receivedObject.data.length; i < len; i++) { + $('#modules ul').append('
  • '+ receivedObject.data[i] +'
  • '); + } + } + if (receivedObject.type == 'routes') { + for (var i = 0, len = receivedObject.data.length; i < len; i++) { + $('#routes ul').append('
  • '+ JSON.stringify(receivedObject.data[i]) +'
  • '); + } + } + if (receivedObject.type == 'memory') { + $('#memory').append(JSON.stringify(receivedObject.data)); + } + } + } + + Core.RegisterDashboardPlugin(new NodejsDashboard()); +} diff --git a/Server/Scripts/typings/Vorlon/vorlon.basePlugin.d.ts b/Server/Scripts/typings/Vorlon/vorlon.basePlugin.d.ts new file mode 100644 index 00000000..4f49c028 --- /dev/null +++ b/Server/Scripts/typings/Vorlon/vorlon.basePlugin.d.ts @@ -0,0 +1,18 @@ +declare module VORLON { + class BasePlugin { + name: string; + _ready: boolean; + protected _id: string; + protected _debug: boolean; + _type: PluginType; + trace: (msg) => void; + protected traceLog: (msg: any) => void; + protected traceNoop: (msg: any) => void; + loadingDirectory: string; + constructor(name: string); + Type: PluginType; + debug: boolean; + getID(): string; + isReady(): boolean; + } +} diff --git a/Server/Scripts/typings/Vorlon/vorlon.clientMessenger.d.ts b/Server/Scripts/typings/Vorlon/vorlon.clientMessenger.d.ts new file mode 100644 index 00000000..90241fc0 --- /dev/null +++ b/Server/Scripts/typings/Vorlon/vorlon.clientMessenger.d.ts @@ -0,0 +1,39 @@ +declare module VORLON { + interface VorlonMessageMetadata { + pluginID: string; + side: RuntimeSide; + sessionId: string; + clientId: string; + listenClientId: string; + } + interface VorlonMessage { + metadata: VorlonMessageMetadata; + command?: string; + data?: any; + } + class ClientMessenger { + private _socket; + private _isConnected; + private _sessionId; + private _clientId; + private _listenClientId; + private _serverUrl; + onRealtimeMessageReceived: (message: VorlonMessage) => void; + onHeloReceived: (id: string) => void; + onIdentifyReceived: (id: string) => void; + onRemoveClient: (id: any) => void; + onAddClient: (id: any) => void; + onStopListenReceived: () => void; + onRefreshClients: () => void; + onReload: (id: string) => void; + onError: (err: Error) => void; + isConnected: boolean; + clientId: string; + socketId: string; + constructor(side: RuntimeSide, serverUrl: string, sessionId: string, clientId: string, listenClientId: string); + stopListening(): void; + sendRealtimeMessage(pluginID: string, objectToSend: any, side: RuntimeSide, messageType?: string, command?: string): void; + sendMonitoringMessage(pluginID: string, message: string): void; + getMonitoringMessage(pluginID: string, onMonitoringMessage: (messages: string[]) => any, from?: string, to?: string): any; + } +} diff --git a/Server/Scripts/typings/Vorlon/vorlon.clientPlugin.d.ts b/Server/Scripts/typings/Vorlon/vorlon.clientPlugin.d.ts new file mode 100644 index 00000000..40280ebd --- /dev/null +++ b/Server/Scripts/typings/Vorlon/vorlon.clientPlugin.d.ts @@ -0,0 +1,12 @@ +declare module VORLON { + class ClientPlugin extends BasePlugin { + ClientCommands: any; + constructor(name: string); + startClientSide(): void; + onRealtimeMessageReceivedFromDashboardSide(receivedObject: any): void; + sendToDashboard(data: any): void; + sendCommandToDashboard(command: string, data?: any): void; + refresh(): void; + _loadNewScriptAsync(scriptName: string, callback: () => void, waitForDOMContentLoaded?: boolean): void; + } +} diff --git a/Server/Scripts/typings/Vorlon/vorlon.core.d.ts b/Server/Scripts/typings/Vorlon/vorlon.core.d.ts new file mode 100644 index 00000000..73a2f31a --- /dev/null +++ b/Server/Scripts/typings/Vorlon/vorlon.core.d.ts @@ -0,0 +1,37 @@ +declare module VORLON { + class _Core { + _clientPlugins: ClientPlugin[]; + _dashboardPlugins: DashboardPlugin[]; + _messenger: ClientMessenger; + _sessionID: string; + _listenClientId: string; + _side: RuntimeSide; + _errorNotifier: any; + _messageNotifier: any; + _socketIOWaitCount: number; + debug: boolean; + _RetryTimeout: number; + Messenger: ClientMessenger; + ClientPlugins: Array; + DashboardPlugins: Array; + RegisterClientPlugin(plugin: ClientPlugin): void; + RegisterDashboardPlugin(plugin: DashboardPlugin): void; + StopListening(): void; + StartClientSide(serverUrl?: string, sessionId?: string, listenClientId?: string): void; + sendHelo(): void; + startClientDirtyCheck(): void; + StartDashboardSide(serverUrl?: string, sessionId?: string, listenClientId?: string, divMapper?: (string) => HTMLDivElement): void; + private _OnStopListenReceived(); + private _OnIdentifyReceived(message); + private ShowError(message, timeout?); + private _OnError(err); + private _OnIdentificationReceived(id); + private _OnReloadClient(id); + private _RetrySendingRealtimeMessage(plugin, message); + private _Dispatch(message); + private _DispatchPluginMessage(plugin, message); + private _DispatchFromClientPluginMessage(plugin, message); + private _DispatchFromDashboardPluginMessage(plugin, message); + } + var Core: _Core; +} diff --git a/Server/Scripts/typings/Vorlon/vorlon.dashboardPlugin.d.ts b/Server/Scripts/typings/Vorlon/vorlon.dashboardPlugin.d.ts new file mode 100644 index 00000000..d1e7385e --- /dev/null +++ b/Server/Scripts/typings/Vorlon/vorlon.dashboardPlugin.d.ts @@ -0,0 +1,17 @@ +declare module VORLON { + class DashboardPlugin extends BasePlugin { + htmlFragmentUrl: any; + cssStyleSheetUrl: any; + JavascriptSheetUrl: any; + DashboardCommands: any; + constructor(name: string, htmlFragmentUrl: string, cssStyleSheetUrl?: (string | string[]), JavascriptSheetUrl?: (string | string[])); + startDashboardSide(div: HTMLDivElement): void; + onRealtimeMessageReceivedFromClientSide(receivedObject: any): void; + sendToClient(data: any): void; + sendCommandToClient(command: string, data?: any): void; + sendCommandToPluginClient(pluginId: string, command: string, data?: any): void; + sendCommandToPluginDashboard(pluginId: string, command: string, data?: any): void; + _insertHtmlContentAsync(divContainer: HTMLDivElement, callback: (filledDiv: HTMLDivElement) => void): void; + private _stripContent(content); + } +} diff --git a/Server/Scripts/typings/Vorlon/vorlon.enums.d.ts b/Server/Scripts/typings/Vorlon/vorlon.enums.d.ts new file mode 100644 index 00000000..96b062b9 --- /dev/null +++ b/Server/Scripts/typings/Vorlon/vorlon.enums.d.ts @@ -0,0 +1,12 @@ +declare module VORLON { + enum RuntimeSide { + Client = 0, + Dashboard = 1, + Both = 2, + } + enum PluginType { + OneOne = 0, + MulticastReceiveOnly = 1, + Multicast = 2, + } +} diff --git a/Server/Scripts/typings/Vorlon/vorlon.tools.d.ts b/Server/Scripts/typings/Vorlon/vorlon.tools.d.ts new file mode 100644 index 00000000..41908260 --- /dev/null +++ b/Server/Scripts/typings/Vorlon/vorlon.tools.d.ts @@ -0,0 +1,45 @@ +declare module VORLON { + class Tools { + static IsWindowAvailable: boolean; + static QuerySelectorById(root: HTMLElement, id: string): HTMLElement; + static SetImmediate(func: () => void): void; + static setLocalStorageValue(key: string, data: string): void; + static getLocalStorageValue(key: string): any; + static Hook(rootObject: any, functionToHook: string, hookingFunction: (...optionalParams: any[]) => void): void; + static HookProperty(rootObjectName: string, propertyToHook: string, callback: any): void; + static getCallStack(skipped: any): any; + static CreateCookie(name: string, value: string, days: number): void; + static ReadCookie(name: string): string; + static CreateGUID(): string; + static RemoveEmpties(arr: string[]): number; + static AddClass(e: HTMLElement, name: string): HTMLElement; + static RemoveClass(e: HTMLElement, name: string): HTMLElement; + static ToggleClass(e: HTMLElement, name: string, callback?: (hasClass: boolean) => void): void; + static htmlToString(text: any): any; + } + class FluentDOM { + element: HTMLElement; + childs: Array; + parent: FluentDOM; + constructor(nodeType: string, className?: string, parentElt?: Element, parent?: FluentDOM); + static forElement(element: HTMLElement): FluentDOM; + addClass(classname: string): FluentDOM; + toggleClass(classname: string): FluentDOM; + className(classname: string): FluentDOM; + opacity(opacity: string): FluentDOM; + display(display: string): FluentDOM; + hide(): FluentDOM; + visibility(visibility: string): FluentDOM; + text(text: string): FluentDOM; + html(text: string): FluentDOM; + attr(name: string, val: string): FluentDOM; + editable(editable: boolean): FluentDOM; + style(name: string, val: string): FluentDOM; + appendTo(elt: Element): FluentDOM; + append(nodeType: string, className?: string, callback?: (fdom: FluentDOM) => void): FluentDOM; + createChild(nodeType: string, className?: string): FluentDOM; + click(callback: (EventTarget) => void): FluentDOM; + blur(callback: (EventTarget) => void): FluentDOM; + keydown(callback: (EventTarget) => void): FluentDOM; + } +} diff --git a/Server/config.json b/Server/config.json index 038053dc..dbe61615 100644 --- a/Server/config.json +++ b/Server/config.json @@ -1,6 +1,6 @@ { "baseURL": "", - "useSSLAzure":false, + "useSSLAzure": false, "useSSL": false, "SSLkey": "cert/server.key", "SSLcert": "cert/server.crt", @@ -8,28 +8,128 @@ "username": "", "password": "", "port": 1337, - "enableWebproxy" : true, + "enableWebproxy": true, "baseProxyURL": "", - "proxyPort" : 5050, + "proxyPort": 5050, "proxyEnvPort": false, "vorlonServerURL": "", "vorlonProxyURL": "", - "plugins": [ - { "id": "CONSOLE", "name": "Interactive Console", "panel": "bottom", "foldername": "interactiveConsole", "enabled": true, "nodeCompliant": true }, - { "id": "DOM", "name": "Dom Explorer", "panel": "top", "foldername": "domExplorer", "enabled": true }, - { "id": "MODERNIZR", "name": "Modernizr", "panel": "bottom", "foldername": "modernizrReport", "enabled": true }, - { "id": "OBJEXPLORER", "name": "Obj. Explorer", "panel": "top", "foldername": "objectExplorer", "enabled": true, "nodeCompliant": true }, - { "id": "WEBSTANDARDS", "name": "Best practices", "panel": "top", "foldername": "webstandards", "enabled": true }, - { "id": "XHRPANEL", "name": "XHR", "panel": "top", "foldername": "xhrPanel", "enabled": true, "nodeCompliant": true }, - { "id": "NGINSPECTOR", "name": "Ng. Inspector", "panel": "top", "foldername": "ngInspector", "enabled": false }, - { "id": "NETWORK", "name": "Network Monitor", "panel": "top", "foldername": "networkMonitor", "enabled": true }, - { "id": "RESOURCES", "name": "Resources Explorer", "panel": "top", "foldername": "resourcesExplorer", "enabled": true }, - { "id": "DEVICE", "name": "My Device", "panel": "top", "foldername": "device", "enabled": true }, - { "id": "UNITTEST", "name": "Unit Test", "panel": "top", "foldername": "unitTestRunner", "enabled": true }, - { "id": "BABYLONINSPECTOR", "name": "Babylon Inspector", "panel": "top", "foldername": "babylonInspector", "enabled": false }, - { "id": "OFFICE", "name": "Office Addin", "panel": "top", "foldername": "office", "enabled": false }, - { "id": "UWP", "name": "UWP apps", "panel": "top", "foldername": "uwp", "enabled": true }, - { "id": "SCREEN", "name": "Screenshot", "panel": "top", "foldername": "screenshot", "enabled": false } + { + "id": "NODEJS", + "name": "NodeJS", + "panel": "top", + "foldername": "nodejs", + "enabled": true, + "nodeCompliant": true + }, + { + "id": "CONSOLE", + "name": "Interactive Console", + "panel": "top", + "foldername": "interactiveConsole", + "enabled": true, + "nodeCompliant": true + }, + { + "id": "DOM", + "name": "Dom Explorer", + "panel": "top", + "foldername": "domExplorer", + "enabled": true + }, + { + "id": "MODERNIZR", + "name": "Modernizr", + "panel": "bottom", + "foldername": "modernizrReport", + "enabled": true + }, + { + "id": "OBJEXPLORER", + "name": "Obj. Explorer", + "panel": "top", + "foldername": "objectExplorer", + "enabled": true, + "nodeCompliant": true + }, + { + "id": "WEBSTANDARDS", + "name": "Best practices", + "panel": "top", + "foldername": "webstandards", + "enabled": true + }, + { + "id": "XHRPANEL", + "name": "XHR", + "panel": "top", + "foldername": "xhrPanel", + "enabled": true, + "nodeCompliant": true + }, + { + "id": "NGINSPECTOR", + "name": "Ng. Inspector", + "panel": "top", + "foldername": "ngInspector", + "enabled": false + }, + { + "id": "NETWORK", + "name": "Network Monitor", + "panel": "top", + "foldername": "networkMonitor", + "enabled": true + }, + { + "id": "RESOURCES", + "name": "Resources Explorer", + "panel": "top", + "foldername": "resourcesExplorer", + "enabled": true + }, + { + "id": "DEVICE", + "name": "My Device", + "panel": "top", + "foldername": "device", + "enabled": true + }, + { + "id": "UNITTEST", + "name": "Unit Test", + "panel": "top", + "foldername": "unitTestRunner", + "enabled": true + }, + { + "id": "BABYLONINSPECTOR", + "name": "Babylon Inspector", + "panel": "top", + "foldername": "babylonInspector", + "enabled": false + }, + { + "id": "OFFICE", + "name": "Office Addin", + "panel": "top", + "foldername": "office", + "enabled": false + }, + { + "id": "UWP", + "name": "UWP apps", + "panel": "top", + "foldername": "uwp", + "enabled": true + }, + { + "id": "SCREEN", + "name": "Screenshot", + "panel": "top", + "foldername": "screenshot", + "enabled": false + } ] -} +} \ No newline at end of file From fa488da9d23e19c135021da3d4ae60d258ec73d1 Mon Sep 17 00:00:00 2001 From: Sofiene Djebali Date: Mon, 2 May 2016 09:59:36 +0200 Subject: [PATCH 02/53] Version on sideBar --- Server/Scripts/vorlon.dashboard.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Server/Scripts/vorlon.dashboard.ts b/Server/Scripts/vorlon.dashboard.ts index 42f5dc07..a74c4c50 100644 --- a/Server/Scripts/vorlon.dashboard.ts +++ b/Server/Scripts/vorlon.dashboard.ts @@ -71,13 +71,13 @@ export module VORLON { private dashboardWithClient() { return (req: express.Request, res: express.Response) => { - res.render('dashboard', { baseURL: this.baseURLConfig.baseURL, title: 'Dashboard', sessionid: req.params.sessionid, clientid: req.params.clientid }); + res.render('dashboard', { baseURL: this.baseURLConfig.baseURL, title: 'Dashboard', sessionid: req.params.sessionid, clientid: req.params.clientid, version: packageJson.version }); } } private dashboardConfig() { return (req: express.Request, res: express.Response) => { - res.render('config', { baseURL: this.baseURLConfig.baseURL, title: 'Configuration', sessionid: "default", clientid: "" }); + res.render('config', { baseURL: this.baseURLConfig.baseURL, title: 'Configuration', sessionid: "default", clientid: "", version: packageJson.version }); }; } From c51b46063e5a4eddbc711ed6246a29458988a630 Mon Sep 17 00:00:00 2001 From: Sofiene Djebali Date: Mon, 2 May 2016 11:37:06 +0200 Subject: [PATCH 03/53] NodeOnly plugins --- Server/public/vorlon.dashboardManager.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Server/public/vorlon.dashboardManager.ts b/Server/public/vorlon.dashboardManager.ts index bbd026f7..2d25979f 100644 --- a/Server/public/vorlon.dashboardManager.ts +++ b/Server/public/vorlon.dashboardManager.ts @@ -246,6 +246,13 @@ module VORLON { continue; } } + + if (!DashboardManager.NoWindowMode) { + if (plugin.nodeOnly) { + continue; + } + } + pluginstoload ++; } } @@ -270,6 +277,12 @@ module VORLON { } } + if (!DashboardManager.NoWindowMode) { + if (plugin.nodeOnly) { + continue; + } + } + var existingLocation = document.querySelector('[data-plugin=' + plugin.id + ']'); if (!existingLocation) { From 42db711cd2646ae438f80fd62e92881000daab5c Mon Sep 17 00:00:00 2001 From: Sofiene Djebali Date: Mon, 2 May 2016 11:37:56 +0200 Subject: [PATCH 04/53] Scripts and sheets before html --- Plugins/Vorlon/vorlon.dashboardPlugin.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Plugins/Vorlon/vorlon.dashboardPlugin.ts b/Plugins/Vorlon/vorlon.dashboardPlugin.ts index b56774c5..7f1b293c 100644 --- a/Plugins/Vorlon/vorlon.dashboardPlugin.ts +++ b/Plugins/Vorlon/vorlon.dashboardPlugin.ts @@ -62,14 +62,6 @@ request.onreadystatechange = (ev: Event) => { if (request.readyState === 4) { if (request.status === 200) { - divContainer.innerHTML = this._stripContent(request.responseText); - if($(divContainer).find('.split').length && $(divContainer).find('.split').is(":visible") && !$(divContainer).find('.vsplitter').length) { - $(divContainer).find('.split').split({ - orientation: $(divContainer).find('.split').data('orientation'), - limit: $(divContainer).find('.split').data('limit'), - position: $(divContainer).find('.split').data('position'), - }); - } var headID = document.getElementsByTagName("head")[0]; for (var i = 0; i < this.cssStyleSheetUrl.length; i++) { var cssNode = document.createElement('link'); @@ -86,6 +78,15 @@ jsNode.src = basedUrl + this.JavascriptSheetUrl[i]; headID.appendChild(jsNode); } + + divContainer.innerHTML = this._stripContent(request.responseText); + if($(divContainer).find('.split').length && $(divContainer).find('.split').is(":visible") && !$(divContainer).find('.vsplitter').length) { + $(divContainer).find('.split').split({ + orientation: $(divContainer).find('.split').data('orientation'), + limit: $(divContainer).find('.split').data('limit'), + position: $(divContainer).find('.split').data('position'), + }); + } var firstDivChild = (divContainer.children[0]); From 5856c38bcaa6a23be44fe97b2ca80742715a4752 Mon Sep 17 00:00:00 2001 From: Sofiene Djebali Date: Mon, 2 May 2016 11:39:49 +0200 Subject: [PATCH 05/53] NodeJS Plugin v0.1 --- Plugins/Vorlon/plugins/nodejs/chart.js | 7 + Plugins/Vorlon/plugins/nodejs/control.html | 87 ++++++-- Plugins/Vorlon/plugins/nodejs/tree.css | 57 +++++ .../plugins/nodejs/vorlon.nodejs.client.ts | 55 ++++- .../plugins/nodejs/vorlon.nodejs.dashboard.ts | 199 +++++++++++++++++- Server/config.json | 67 +++--- 6 files changed, 407 insertions(+), 65 deletions(-) create mode 100644 Plugins/Vorlon/plugins/nodejs/chart.js create mode 100644 Plugins/Vorlon/plugins/nodejs/tree.css diff --git a/Plugins/Vorlon/plugins/nodejs/chart.js b/Plugins/Vorlon/plugins/nodejs/chart.js new file mode 100644 index 00000000..c05fc0aa --- /dev/null +++ b/Plugins/Vorlon/plugins/nodejs/chart.js @@ -0,0 +1,7 @@ +!function t(e,i,s){function a(n,r){if(!i[n]){if(!e[n]){var h="function"==typeof require&&require;if(!r&&h)return h(n,!0);if(o)return o(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[n]={exports:{}};e[n][0].call(c.exports,function(t){var i=e[n][1][t];return a(i?i:t)},c,c.exports,t,e,i,s)}return i[n].exports}for(var o="function"==typeof require&&require,n=0;n=s?s/12.92:Math.pow((s+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(e+.05)/(i+.05):(i+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(299*t[0]+587*t[1]+114*t[2])/1e3;return 128>e},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;3>e;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){return this.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},darken:function(t){return this.values.hsl[2]-=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},saturate:function(t){return this.values.hsl[1]+=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},desaturate:function(t){return this.values.hsl[1]-=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},whiten:function(t){return this.values.hwb[1]+=this.values.hwb[1]*t,this.setValues("hwb",this.values.hwb),this},blacken:function(t){return this.values.hwb[2]+=this.values.hwb[2]*t,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){return this.setValues("alpha",this.values.alpha-this.values.alpha*t),this},opaquer:function(t){return this.setValues("alpha",this.values.alpha+this.values.alpha*t),this},rotate:function(t){var e=this.values.hsl[0];return e=(e+t)%360,e=0>e?360+e:e,this.values.hsl[0]=e,this.setValues("hsl",this.values.hsl),this},mix:function(t,e){e=1-(null==e?.5:e);for(var i=2*e-1,s=this.alpha()-t.alpha(),a=((i*s==-1?i:(i+s)/(1+i*s))+1)/2,o=1-a,n=this.rgbArray(),r=t.rgbArray(),h=0;he&&(e+=360),s=(r+h)/2,i=h==r?0:.5>=s?l/(h+r):l/(2-h-r),[e,100*i,100*s]}function a(t){var e,i,s,a=t[0],o=t[1],n=t[2],r=Math.min(a,o,n),h=Math.max(a,o,n),l=h-r;return i=0==h?0:l/h*1e3/10,h==r?e=0:a==h?e=(o-n)/l:o==h?e=2+(n-a)/l:n==h&&(e=4+(a-o)/l),e=Math.min(60*e,360),0>e&&(e+=360),s=h/255*1e3/10,[e,i,s]}function o(t){var e=t[0],i=t[1],a=t[2],o=s(t)[0],n=1/255*Math.min(e,Math.min(i,a)),a=1-1/255*Math.max(e,Math.max(i,a));return[o,100*n,100*a]}function n(t){var e,i,s,a,o=t[0]/255,n=t[1]/255,r=t[2]/255;return a=Math.min(1-o,1-n,1-r),e=(1-o-a)/(1-a)||0,i=(1-n-a)/(1-a)||0,s=(1-r-a)/(1-a)||0,[100*e,100*i,100*s,100*a]}function h(t){return X[JSON.stringify(t)]}function l(t){var e=t[0]/255,i=t[1]/255,s=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var a=.4124*e+.3576*i+.1805*s,o=.2126*e+.7152*i+.0722*s,n=.0193*e+.1192*i+.9505*s;return[100*a,100*o,100*n]}function c(t){var e,i,s,a=l(t),o=a[0],n=a[1],r=a[2];return o/=95.047,n/=100,r/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,e=116*n-16,i=500*(o-n),s=200*(n-r),[e,i,s]}function u(t){return z(c(t))}function d(t){var e,i,s,a,o,n=t[0]/360,r=t[1]/100,h=t[2]/100;if(0==r)return o=255*h,[o,o,o];i=.5>h?h*(1+r):h+r-h*r,e=2*h-i,a=[0,0,0];for(var l=0;3>l;l++)s=n+1/3*-(l-1),0>s&&s++,s>1&&s--,o=1>6*s?e+6*(i-e)*s:1>2*s?i:2>3*s?e+(i-e)*(2/3-s)*6:e,a[l]=255*o;return a}function f(t){var e,i,s=t[0],a=t[1]/100,o=t[2]/100;return 0===o?[0,0,0]:(o*=2,a*=1>=o?o:2-o,i=(o+a)/2,e=2*a/(o+a),[s,100*e,100*i])}function m(t){return o(d(t))}function p(t){return n(d(t))}function v(t){return h(d(t))}function x(t){var e=t[0]/60,i=t[1]/100,s=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),n=255*s*(1-i),r=255*s*(1-i*o),h=255*s*(1-i*(1-o)),s=255*s;switch(a){case 0:return[s,h,n];case 1:return[r,s,n];case 2:return[n,s,h];case 3:return[n,r,s];case 4:return[h,n,s];case 5:return[s,n,r]}}function y(t){var e,i,s=t[0],a=t[1]/100,o=t[2]/100;return i=(2-a)*o,e=a*o,e/=1>=i?i:2-i,e=e||0,i/=2,[s,100*e,100*i]}function k(t){return o(x(t))}function _(t){return n(x(t))}function D(t){return h(x(t))}function S(t){var e,i,s,a,o=t[0]/360,n=t[1]/100,h=t[2]/100,l=n+h;switch(l>1&&(n/=l,h/=l),e=Math.floor(6*o),i=1-h,s=6*o-e,0!=(1&e)&&(s=1-s),a=n+s*(i-n),e){default:case 6:case 0:r=i,g=a,b=n;break;case 1:r=a,g=i,b=n;break;case 2:r=n,g=i,b=a;break;case 3:r=n,g=a,b=i;break;case 4:r=a,g=n,b=i;break;case 5:r=i,g=n,b=a}return[255*r,255*g,255*b]}function w(t){return s(S(t))}function C(t){return a(S(t))}function M(t){return n(S(t))}function A(t){return h(S(t))}function I(t){var e,i,s,a=t[0]/100,o=t[1]/100,n=t[2]/100,r=t[3]/100;return e=1-Math.min(1,a*(1-r)+r),i=1-Math.min(1,o*(1-r)+r),s=1-Math.min(1,n*(1-r)+r),[255*e,255*i,255*s]}function T(t){return s(I(t))}function F(t){return a(I(t))}function P(t){return o(I(t))}function O(t){return h(I(t))}function V(t){var e,i,s,a=t[0]/100,o=t[1]/100,n=t[2]/100;return e=3.2406*a+-1.5372*o+n*-.4986,i=a*-.9689+1.8758*o+.0415*n,s=.0557*a+o*-.204+1.057*n,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e=12.92*e,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i=12.92*i,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s=12.92*s,e=Math.min(Math.max(0,e),1),i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),[255*e,255*i,255*s]}function W(t){var e,i,s,a=t[0],o=t[1],n=t[2];return a/=95.047,o/=100,n/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,e=116*o-16,i=500*(a-o),s=200*(o-n),[e,i,s]}function R(t){return z(W(t))}function L(t){var e,i,s,a,o=t[0],n=t[1],r=t[2];return 8>=o?(i=100*o/903.3,a=7.787*(i/100)+16/116):(i=100*Math.pow((o+16)/116,3),a=Math.pow(i/100,1/3)),e=.008856>=e/95.047?e=95.047*(n/500+a-16/116)/7.787:95.047*Math.pow(n/500+a,3),s=.008859>=s/108.883?s=108.883*(a-r/200-16/116)/7.787:108.883*Math.pow(a-r/200,3),[e,i,s]}function z(t){var e,i,s,a=t[0],o=t[1],n=t[2];return e=Math.atan2(n,o),i=360*e/2/Math.PI,0>i&&(i+=360),s=Math.sqrt(o*o+n*n),[a,s,i]}function B(t){return V(L(t))}function Y(t){var e,i,s,a=t[0],o=t[1],n=t[2];return s=n/360*2*Math.PI,e=o*Math.cos(s),i=o*Math.sin(s),[a,e,i]}function H(t){return L(Y(t))}function N(t){return B(Y(t))}function E(t){return J[t]}function U(t){return s(E(t))}function j(t){return a(E(t))}function G(t){return o(E(t))}function q(t){return n(E(t))}function Z(t){return c(E(t))}function Q(t){return l(E(t))}e.exports={rgb2hsl:s,rgb2hsv:a,rgb2hwb:o,rgb2cmyk:n,rgb2keyword:h,rgb2xyz:l,rgb2lab:c,rgb2lch:u,hsl2rgb:d,hsl2hsv:f,hsl2hwb:m,hsl2cmyk:p,hsl2keyword:v,hsv2rgb:x,hsv2hsl:y,hsv2hwb:k,hsv2cmyk:_,hsv2keyword:D,hwb2rgb:S,hwb2hsl:w,hwb2hsv:C,hwb2cmyk:M,hwb2keyword:A,cmyk2rgb:I,cmyk2hsl:T,cmyk2hsv:F,cmyk2hwb:P,cmyk2keyword:O,keyword2rgb:E,keyword2hsl:U,keyword2hsv:j,keyword2hwb:G,keyword2cmyk:q,keyword2lab:Z,keyword2xyz:Q,xyz2rgb:V,xyz2lab:W,xyz2lch:R,lab2xyz:L,lab2rgb:B,lab2lch:z,lch2lab:Y,lch2xyz:H,lch2rgb:N};var J={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],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],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},X={};for(var $ in J)X[JSON.stringify(J[$])]=$},{}],3:[function(t,e,i){var s=t("./conversions"),a=function(){return new l};for(var o in s){a[o+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),s[t](e)}}(o);var n=/(\w+)2(\w+)/.exec(o),r=n[1],h=n[2];a[r]=a[r]||{},a[r][h]=a[o]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var i=s[t](e);if("string"==typeof i||void 0===i)return i;for(var a=0;ae||t[3]&&t[3]<1?u(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function u(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function d(t,e){if(1>e||t[3]&&t[3]<1)return f(t,e);var i=Math.round(t[0]/255*100),s=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+i+"%, "+s+"%, "+a+"%)"}function f(t,e){var i=Math.round(t[0]/255*100),s=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgba("+i+"%, "+s+"%, "+a+"%, "+(e||t[3]||1)+")"}function m(t,e){return 1>e||t[3]&&t[3]<1?g(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function g(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function p(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"}function b(t){return k[t.slice(0,3)]}function v(t,e,i){return Math.min(Math.max(e,t),i)}function x(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var y=t("color-name");e.exports={getRgba:s,getHsla:a,getRgb:n,getHsl:r,getHwb:o,getAlpha:h,hexString:l,rgbString:c,rgbaString:u,percentString:d,percentaString:f,hslString:m,hslaString:g,hwbString:p,keyword:b};var k={};for(var _ in y)k[y[_]]=_},{"color-name":4}],6:[function(t,e,i){!function(t,s){"object"==typeof i&&"undefined"!=typeof e?e.exports=s():"function"==typeof define&&define.amd?define(s):t.moment=s()}(this,function(){"use strict";function i(){return Zi.apply(null,arguments)}function s(t){Zi=t}function a(t){return"[object Array]"===Object.prototype.toString.call(t)}function o(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function n(t,e){var i,s=[];for(i=0;i0)for(i in Ji)s=Ji[i],a=e[s],m(a)||(t[s]=a);return t}function p(t){g(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),Xi===!1&&(Xi=!0,i.updateOffset(this),Xi=!1)}function b(t){return t instanceof p||null!=t&&null!=t._isAMomentObject}function v(t){return 0>t?Math.ceil(t):Math.floor(t)}function x(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=v(e)),i}function y(t,e,i){var s,a=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),n=0;for(s=0;a>s;s++)(i&&t[s]!==e[s]||!i&&x(t[s])!==x(e[s]))&&n++;return n+o}function k(){}function _(t){return t?t.toLowerCase().replace("_","-"):t}function D(t){for(var e,i,s,a,o=0;o0;){if(s=S(a.slice(0,e).join("-")))return s;if(i&&i.length>=e&&y(a,i,!0)>=e-1)break;e--}o++}return null}function S(i){var s=null;if(!$i[i]&&"undefined"!=typeof e&&e&&e.exports)try{s=Qi._abbr,t("./locale/"+i),w(s)}catch(a){}return $i[i]}function w(t,e){var i;return t&&(i=m(e)?M(t):C(t,e),i&&(Qi=i)),Qi._abbr}function C(t,e){return null!==e?(e.abbr=t,$i[t]=$i[t]||new k,$i[t].set(e),w(t),$i[t]):(delete $i[t],null)}function M(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Qi;if(!a(t)){if(e=S(t))return e;t=[t]}return D(t)}function A(t,e){var i=t.toLowerCase();Ki[i]=Ki[i+"s"]=Ki[e]=t}function I(t){return"string"==typeof t?Ki[t]||Ki[t.toLowerCase()]:void 0}function T(t){var e,i,s={};for(i in t)r(t,i)&&(e=I(i),e&&(s[e]=t[i]));return s}function F(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function P(t,e){return function(s){return null!=s?(V(this,t,s),i.updateOffset(this,e),this):O(this,t)}}function O(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function V(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function W(t,e){var i;if("object"==typeof t)for(i in t)this.set(i,t[i]);else if(t=I(t),F(this[t]))return this[t](e);return this}function R(t,e,i){var s=""+Math.abs(t),a=e-s.length,o=t>=0;return(o?i?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+s}function L(t,e,i,s){var a=s;"string"==typeof s&&(a=function(){return this[s]()}),t&&(ss[t]=a),e&&(ss[e[0]]=function(){return R(a.apply(this,arguments),e[1],e[2])}),i&&(ss[i]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function z(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function B(t){var e,i,s=t.match(ts);for(e=0,i=s.length;i>e;e++)ss[s[e]]?s[e]=ss[s[e]]:s[e]=z(s[e]);return function(a){var o="";for(e=0;i>e;e++)o+=s[e]instanceof Function?s[e].call(a,t):s[e];return o}}function Y(t,e){return t.isValid()?(e=H(e,t.localeData()),is[e]=is[e]||B(e),is[e](t)):t.localeData().invalidDate()}function H(t,e){function i(t){return e.longDateFormat(t)||t}var s=5;for(es.lastIndex=0;s>=0&&es.test(t);)t=t.replace(es,i),es.lastIndex=0,s-=1;return t}function N(t,e,i){ks[t]=F(e)?e:function(t,s){return t&&i?i:e}}function E(t,e){return r(ks,t)?ks[t](e._strict,e._locale):new RegExp(U(t))}function U(t){return j(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,s,a){return e||i||s||a}))}function j(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function G(t,e){var i,s=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(s=function(t,i){i[e]=x(t)}),i=0;is;s++){if(a=l([2e3,s]),i&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),i||this._monthsParse[s]||(o="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[s]=new RegExp(o.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[s].test(t))return s;if(i&&"MMM"===e&&this._shortMonthsParse[s].test(t))return s;if(!i&&this._monthsParse[s].test(t))return s}}function K(t,e){var i;return t.isValid()?"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(i=Math.min(t.date(),Q(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t):t}function tt(t){return null!=t?(K(this,t),i.updateOffset(this,!0),this):O(this,"Month")}function et(){return Q(this.year(),this.month())}function it(t){return this._monthsParseExact?(r(this,"_monthsRegex")||at.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function st(t){return this._monthsParseExact?(r(this,"_monthsRegex")||at.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function at(){function t(t,e){return e.length-t.length}var e,i,s=[],a=[],o=[];for(e=0;12>e;e++)i=l([2e3,e]),s.push(this.monthsShort(i,"")),a.push(this.months(i,"")),o.push(this.months(i,"")),o.push(this.monthsShort(i,""));for(s.sort(t),a.sort(t),o.sort(t),e=0;12>e;e++)s[e]=j(s[e]),a[e]=j(a[e]),o[e]=j(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")$","i")}function ot(t){var e,i=t._a;return i&&-2===u(t).overflow&&(e=i[Ss]<0||i[Ss]>11?Ss:i[ws]<1||i[ws]>Q(i[Ds],i[Ss])?ws:i[Cs]<0||i[Cs]>24||24===i[Cs]&&(0!==i[Ms]||0!==i[As]||0!==i[Is])?Cs:i[Ms]<0||i[Ms]>59?Ms:i[As]<0||i[As]>59?As:i[Is]<0||i[Is]>999?Is:-1,u(t)._overflowDayOfYear&&(Ds>e||e>ws)&&(e=ws),u(t)._overflowWeeks&&-1===e&&(e=Ts),u(t)._overflowWeekday&&-1===e&&(e=Fs),u(t).overflow=e),t}function nt(t){i.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function rt(t,e){var i=!0;return h(function(){return i&&(nt(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),i=!1),e.apply(this,arguments)},e)}function ht(t,e){Ls[t]||(nt(e),Ls[t]=!0)}function lt(t){var e,i,s,a,o,n,r=t._i,h=zs.exec(r)||Bs.exec(r);if(h){for(u(t).iso=!0,e=0,i=Hs.length;i>e;e++)if(Hs[e][1].exec(h[1])){a=Hs[e][0],s=Hs[e][2]!==!1;break}if(null==a)return void(t._isValid=!1);if(h[3]){for(e=0,i=Ns.length;i>e;e++)if(Ns[e][1].exec(h[3])){o=(h[2]||" ")+Ns[e][0];break}if(null==o)return void(t._isValid=!1)}if(!s&&null!=o)return void(t._isValid=!1);if(h[4]){if(!Ys.exec(h[4]))return void(t._isValid=!1);n="Z"}t._f=a+(o||"")+(n||""),St(t)}else t._isValid=!1}function ct(t){ +var e=Es.exec(t._i);return null!==e?void(t._d=new Date(+e[1])):(lt(t),void(t._isValid===!1&&(delete t._isValid,i.createFromInputFallback(t))))}function ut(t,e,i,s,a,o,n){var r=new Date(t,e,i,s,a,o,n);return 100>t&&t>=0&&isFinite(r.getFullYear())&&r.setFullYear(t),r}function dt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function ft(t){return mt(t)?366:365}function mt(t){return t%4===0&&t%100!==0||t%400===0}function gt(){return mt(this.year())}function pt(t,e,i){var s=7+e-i,a=(7+dt(t,0,s).getUTCDay()-e)%7;return-a+s-1}function bt(t,e,i,s,a){var o,n,r=(7+i-s)%7,h=pt(t,s,a),l=1+7*(e-1)+r+h;return 0>=l?(o=t-1,n=ft(o)+l):l>ft(t)?(o=t+1,n=l-ft(t)):(o=t,n=l),{year:o,dayOfYear:n}}function vt(t,e,i){var s,a,o=pt(t.year(),e,i),n=Math.floor((t.dayOfYear()-o-1)/7)+1;return 1>n?(a=t.year()-1,s=n+xt(a,e,i)):n>xt(t.year(),e,i)?(s=n-xt(t.year(),e,i),a=t.year()+1):(a=t.year(),s=n),{week:s,year:a}}function xt(t,e,i){var s=pt(t,e,i),a=pt(t+1,e,i);return(ft(t)-s+a)/7}function yt(t,e,i){return null!=t?t:null!=e?e:i}function kt(t){var e=new Date(i.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function _t(t){var e,i,s,a,o=[];if(!t._d){for(s=kt(t),t._w&&null==t._a[ws]&&null==t._a[Ss]&&Dt(t),t._dayOfYear&&(a=yt(t._a[Ds],s[Ds]),t._dayOfYear>ft(a)&&(u(t)._overflowDayOfYear=!0),i=dt(a,0,t._dayOfYear),t._a[Ss]=i.getUTCMonth(),t._a[ws]=i.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=s[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Cs]&&0===t._a[Ms]&&0===t._a[As]&&0===t._a[Is]&&(t._nextDay=!0,t._a[Cs]=0),t._d=(t._useUTC?dt:ut).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Cs]=24)}}function Dt(t){var e,i,s,a,o,n,r,h;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,n=4,i=yt(e.GG,t._a[Ds],vt(Pt(),1,4).year),s=yt(e.W,1),a=yt(e.E,1),(1>a||a>7)&&(h=!0)):(o=t._locale._week.dow,n=t._locale._week.doy,i=yt(e.gg,t._a[Ds],vt(Pt(),o,n).year),s=yt(e.w,1),null!=e.d?(a=e.d,(0>a||a>6)&&(h=!0)):null!=e.e?(a=e.e+o,(e.e<0||e.e>6)&&(h=!0)):a=o),1>s||s>xt(i,o,n)?u(t)._overflowWeeks=!0:null!=h?u(t)._overflowWeekday=!0:(r=bt(i,s,a,o,n),t._a[Ds]=r.year,t._dayOfYear=r.dayOfYear)}function St(t){if(t._f===i.ISO_8601)return void lt(t);t._a=[],u(t).empty=!0;var e,s,a,o,n,r=""+t._i,h=r.length,l=0;for(a=H(t._f,t._locale).match(ts)||[],e=0;e0&&u(t).unusedInput.push(n),r=r.slice(r.indexOf(s)+s.length),l+=s.length),ss[o]?(s?u(t).empty=!1:u(t).unusedTokens.push(o),Z(o,s,t)):t._strict&&!s&&u(t).unusedTokens.push(o);u(t).charsLeftOver=h-l,r.length>0&&u(t).unusedInput.push(r),u(t).bigHour===!0&&t._a[Cs]<=12&&t._a[Cs]>0&&(u(t).bigHour=void 0),t._a[Cs]=wt(t._locale,t._a[Cs],t._meridiem),_t(t),ot(t)}function wt(t,e,i){var s;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(s=t.isPM(i),s&&12>e&&(e+=12),s||12!==e||(e=0),e):e}function Ct(t){var e,i,s,a,o;if(0===t._f.length)return u(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;ao)&&(s=o,i=e));h(t,i||e)}function Mt(t){if(!t._d){var e=T(t._i);t._a=n([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),_t(t)}}function At(t){var e=new p(ot(It(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function It(t){var e=t._i,i=t._f;return t._locale=t._locale||M(t._l),null===e||void 0===i&&""===e?f({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),b(e)?new p(ot(e)):(a(i)?Ct(t):i?St(t):o(e)?t._d=e:Tt(t),d(t)||(t._d=null),t))}function Tt(t){var e=t._i;void 0===e?t._d=new Date(i.now()):o(e)?t._d=new Date(+e):"string"==typeof e?ct(t):a(e)?(t._a=n(e.slice(0),function(t){return parseInt(t,10)}),_t(t)):"object"==typeof e?Mt(t):"number"==typeof e?t._d=new Date(e):i.createFromInputFallback(t)}function Ft(t,e,i,s,a){var o={};return"boolean"==typeof i&&(s=i,i=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=a,o._l=i,o._i=t,o._f=e,o._strict=s,At(o)}function Pt(t,e,i,s){return Ft(t,e,i,s,!1)}function Ot(t,e){var i,s;if(1===e.length&&a(e[0])&&(e=e[0]),!e.length)return Pt();for(i=e[0],s=1;st&&(t=-t,i="-"),i+R(~~(t/60),2)+e+R(~~t%60,2)})}function Bt(t,e){var i=(e||"").match(t)||[],s=i[i.length-1]||[],a=(s+"").match(Zs)||["-",0,0],o=+(60*a[1])+x(a[2]);return"+"===a[0]?o:-o}function Yt(t,e){var s,a;return e._isUTC?(s=e.clone(),a=(b(t)||o(t)?+t:+Pt(t))-+s,s._d.setTime(+s._d+a),i.updateOffset(s,!1),s):Pt(t).local()}function Ht(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Nt(t,e){var s,a=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Bt(vs,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(s=Ht(this)),this._offset=t,this._isUTC=!0,null!=s&&this.add(s,"m"),a!==t&&(!e||this._changeInProgress?ae(this,Kt(t-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?a:Ht(this):null!=t?this:NaN}function Et(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Ut(t){return this.utcOffset(0,t)}function jt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ht(this),"m")),this}function Gt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Bt(bs,this._i)),this}function qt(t){return this.isValid()?(t=t?Pt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Zt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Qt(){if(!m(this._isDSTShifted))return this._isDSTShifted;var t={};if(g(t,this),t=It(t),t._a){var e=t._isUTC?l(t._a):Pt(t._a);this._isDSTShifted=this.isValid()&&y(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Jt(){return this.isValid()?!this._isUTC:!1}function Xt(){return this.isValid()?this._isUTC:!1}function $t(){return this.isValid()?this._isUTC&&0===this._offset:!1}function Kt(t,e){var i,s,a,o=t,n=null;return Lt(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(o={},e?o[e]=t:o.milliseconds=t):(n=Qs.exec(t))?(i="-"===n[1]?-1:1,o={y:0,d:x(n[ws])*i,h:x(n[Cs])*i,m:x(n[Ms])*i,s:x(n[As])*i,ms:x(n[Is])*i}):(n=Js.exec(t))?(i="-"===n[1]?-1:1,o={y:te(n[2],i),M:te(n[3],i),d:te(n[4],i),h:te(n[5],i),m:te(n[6],i),s:te(n[7],i),w:te(n[8],i)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(a=ie(Pt(o.from),Pt(o.to)),o={},o.ms=a.milliseconds,o.M=a.months),s=new Rt(o),Lt(t)&&r(t,"_locale")&&(s._locale=t._locale),s}function te(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function ee(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function ie(t,e){var i;return t.isValid()&&e.isValid()?(e=Yt(e,t),t.isBefore(e)?i=ee(t,e):(i=ee(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function se(t,e){return function(i,s){var a,o;return null===s||isNaN(+s)||(ht(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),o=i,i=s,s=o),i="string"==typeof i?+i:i,a=Kt(i,s),ae(this,a,t),this}}function ae(t,e,s,a){var o=e._milliseconds,n=e._days,r=e._months;t.isValid()&&(a=null==a?!0:a,o&&t._d.setTime(+t._d+o*s),n&&V(t,"Date",O(t,"Date")+n*s),r&&K(t,O(t,"Month")+r*s),a&&i.updateOffset(t,n||r))}function oe(t,e){var i=t||Pt(),s=Yt(i,this).startOf("day"),a=this.diff(s,"days",!0),o=-6>a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse",n=e&&(F(e[o])?e[o]():e[o]);return this.format(n||this.localeData().calendar(o,this,Pt(i)))}function ne(){return new p(this)}function re(t,e){var i=b(t)?t:Pt(t);return this.isValid()&&i.isValid()?(e=I(m(e)?"millisecond":e),"millisecond"===e?+this>+i:+i<+this.clone().startOf(e)):!1}function he(t,e){var i=b(t)?t:Pt(t);return this.isValid()&&i.isValid()?(e=I(m(e)?"millisecond":e),"millisecond"===e?+i>+this:+this.clone().endOf(e)<+i):!1}function le(t,e,i){return this.isAfter(t,i)&&this.isBefore(e,i)}function ce(t,e){var i,s=b(t)?t:Pt(t);return this.isValid()&&s.isValid()?(e=I(e||"millisecond"),"millisecond"===e?+this===+s:(i=+s,+this.clone().startOf(e)<=i&&i<=+this.clone().endOf(e))):!1}function ue(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function de(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function fe(t,e,i){var s,a,o,n;return this.isValid()?(s=Yt(t,this),s.isValid()?(a=6e4*(s.utcOffset()-this.utcOffset()),e=I(e),"year"===e||"month"===e||"quarter"===e?(n=me(this,s),"quarter"===e?n/=3:"year"===e&&(n/=12)):(o=this-s,n="second"===e?o/1e3:"minute"===e?o/6e4:"hour"===e?o/36e5:"day"===e?(o-a)/864e5:"week"===e?(o-a)/6048e5:o),i?n:v(n)):NaN):NaN}function me(t,e){var i,s,a=12*(e.year()-t.year())+(e.month()-t.month()),o=t.clone().add(a,"months");return 0>e-o?(i=t.clone().add(a-1,"months"),s=(e-o)/(o-i)):(i=t.clone().add(a+1,"months"),s=(e-o)/(i-o)),-(a+s)}function ge(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function pe(){var t=this.clone().utc();return 0o&&(e=o),Ne.call(this,t,e,i,s,a))}function Ne(t,e,i,s,a){var o=bt(t,e,i,s,a),n=dt(o.year,0,o.dayOfYear);return this.year(n.getUTCFullYear()),this.month(n.getUTCMonth()),this.date(n.getUTCDate()),this}function Ee(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ue(t){return vt(t,this._week.dow,this._week.doy).week}function je(){return this._week.dow}function Ge(){return this._week.doy}function qe(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Ze(t){var e=vt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Qe(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Je(t,e){return a(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function Xe(t){return this._weekdaysShort[t.day()]}function $e(t){return this._weekdaysMin[t.day()]}function Ke(t,e,i){var s,a,o;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;7>s;s++){if(a=Pt([2e3,1]).day(s),i&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[s]||(o="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[s]=new RegExp(o.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[s].test(t))return s;if(i&&"ddd"===e&&this._shortWeekdaysParse[s].test(t))return s;if(i&&"dd"===e&&this._minWeekdaysParse[s].test(t))return s;if(!i&&this._weekdaysParse[s].test(t))return s}}function ti(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Qe(t,this.localeData()),this.add(t-e,"d")):e}function ei(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function ii(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function si(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function ai(){return this.hours()%12||12}function oi(t,e){L(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function ni(t,e){return e._meridiemParse}function ri(t){return"p"===(t+"").toLowerCase().charAt(0)}function hi(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function li(t,e){e[Is]=x(1e3*("0."+t))}function ci(){return this._isUTC?"UTC":""}function ui(){return this._isUTC?"Coordinated Universal Time":""}function di(t){return Pt(1e3*t)}function fi(){return Pt.apply(null,arguments).parseZone()}function mi(t,e,i){var s=this._calendar[t];return F(s)?s.call(e,i):s}function gi(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function pi(){return this._invalidDate}function bi(t){return this._ordinal.replace("%d",t)}function vi(t){return t}function xi(t,e,i,s){var a=this._relativeTime[i];return F(a)?a(t,e,i,s):a.replace(/%d/i,t)}function yi(t,e){var i=this._relativeTime[t>0?"future":"past"];return F(i)?i(e):i.replace(/%s/i,e)}function ki(t){var e,i;for(i in t)e=t[i],F(e)?this[i]=e:this["_"+i]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function _i(t,e,i,s){var a=M(),o=l().set(s,e);return a[i](o,t)}function Di(t,e,i,s,a){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return _i(t,e,i,a);var o,n=[];for(o=0;s>o;o++)n[o]=_i(t,o,i,a);return n}function Si(t,e){return Di(t,e,"months",12,"month")}function wi(t,e){return Di(t,e,"monthsShort",12,"month")}function Ci(t,e){return Di(t,e,"weekdays",7,"day")}function Mi(t,e){return Di(t,e,"weekdaysShort",7,"day")}function Ai(t,e){return Di(t,e,"weekdaysMin",7,"day")}function Ii(){var t=this._data;return this._milliseconds=ya(this._milliseconds),this._days=ya(this._days),this._months=ya(this._months),t.milliseconds=ya(t.milliseconds),t.seconds=ya(t.seconds),t.minutes=ya(t.minutes),t.hours=ya(t.hours),t.months=ya(t.months),t.years=ya(t.years),this}function Ti(t,e,i,s){var a=Kt(e,i);return t._milliseconds+=s*a._milliseconds,t._days+=s*a._days,t._months+=s*a._months,t._bubble()}function Fi(t,e){return Ti(this,t,e,1)}function Pi(t,e){return Ti(this,t,e,-1)}function Oi(t){return 0>t?Math.floor(t):Math.ceil(t)}function Vi(){var t,e,i,s,a,o=this._milliseconds,n=this._days,r=this._months,h=this._data;return o>=0&&n>=0&&r>=0||0>=o&&0>=n&&0>=r||(o+=864e5*Oi(Ri(r)+n),n=0,r=0),h.milliseconds=o%1e3,t=v(o/1e3),h.seconds=t%60,e=v(t/60),h.minutes=e%60,i=v(e/60),h.hours=i%24,n+=v(i/24),a=v(Wi(n)),r+=a,n-=Oi(Ri(a)),s=v(r/12),r%=12,h.days=n,h.months=r,h.years=s,this}function Wi(t){return 4800*t/146097}function Ri(t){return 146097*t/4800}function Li(t){var e,i,s=this._milliseconds;if(t=I(t),"month"===t||"year"===t)return e=this._days+s/864e5,i=this._months+Wi(e),"month"===t?i:i/12;switch(e=this._days+Math.round(Ri(this._months)),t){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return 24*e+s/36e5;case"minute":return 1440*e+s/6e4;case"second":return 86400*e+s/1e3;case"millisecond":return Math.floor(864e5*e)+s;default:throw new Error("Unknown unit "+t)}}function zi(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*x(this._months/12)}function Bi(t){return function(){return this.as(t)}}function Yi(t){return t=I(t),this[t+"s"]()}function Hi(t){return function(){return this._data[t]}}function Ni(){return v(this.days()/7)}function Ei(t,e,i,s,a){return a.relativeTime(e||1,!!i,t,s)}function Ui(t,e,i){var s=Kt(t).abs(),a=Ra(s.as("s")),o=Ra(s.as("m")),n=Ra(s.as("h")),r=Ra(s.as("d")),h=Ra(s.as("M")),l=Ra(s.as("y")),c=a=o&&["m"]||o=n&&["h"]||n=r&&["d"]||r=h&&["M"]||h=l&&["y"]||["yy",l];return c[2]=e,c[3]=+t>0,c[4]=i,Ei.apply(null,c)}function ji(t,e){return void 0===La[t]?!1:void 0===e?La[t]:(La[t]=e,!0)}function Gi(t){var e=this.localeData(),i=Ui(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function qi(){var t,e,i,s=za(this._milliseconds)/1e3,a=za(this._days),o=za(this._months);t=v(s/60),e=v(t/60),s%=60,t%=60,i=v(o/12),o%=12;var n=i,r=o,h=a,l=e,c=t,u=s,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(n?n+"Y":"")+(r?r+"M":"")+(h?h+"D":"")+(l||c||u?"T":"")+(l?l+"H":"")+(c?c+"M":"")+(u?u+"S":""):"P0D"}var Zi,Qi,Ji=i.momentProperties=[],Xi=!1,$i={},Ki={},ts=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,es=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,is={},ss={},as=/\d/,os=/\d\d/,ns=/\d{3}/,rs=/\d{4}/,hs=/[+-]?\d{6}/,ls=/\d\d?/,cs=/\d\d\d\d?/,us=/\d\d\d\d\d\d?/,ds=/\d{1,3}/,fs=/\d{1,4}/,ms=/[+-]?\d{1,6}/,gs=/\d+/,ps=/[+-]?\d+/,bs=/Z|[+-]\d\d:?\d\d/gi,vs=/Z|[+-]\d\d(?::?\d\d)?/gi,xs=/[+-]?\d+(\.\d{1,3})?/,ys=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ks={},_s={},Ds=0,Ss=1,ws=2,Cs=3,Ms=4,As=5,Is=6,Ts=7,Fs=8;L("M",["MM",2],"Mo",function(){return this.month()+1}),L("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),L("MMMM",0,0,function(t){return this.localeData().months(this,t)}),A("month","M"),N("M",ls),N("MM",ls,os),N("MMM",function(t,e){return e.monthsShortRegex(t)}),N("MMMM",function(t,e){return e.monthsRegex(t)}),G(["M","MM"],function(t,e){e[Ss]=x(t)-1}),G(["MMM","MMMM"],function(t,e,i,s){var a=i._locale.monthsParse(t,s,i._strict);null!=a?e[Ss]=a:u(i).invalidMonth=t});var Ps=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Os="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Vs="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ws=ys,Rs=ys,Ls={};i.suppressDeprecationWarnings=!1;var zs=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Bs=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Ys=/Z|[+-]\d\d(?::?\d\d)?/,Hs=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Ns=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Es=/^\/?Date\((\-?\d+)/i;i.createFromInputFallback=rt("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),L("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),L(0,["YY",2],0,function(){return this.year()%100}),L(0,["YYYY",4],0,"year"),L(0,["YYYYY",5],0,"year"),L(0,["YYYYYY",6,!0],0,"year"),A("year","y"),N("Y",ps),N("YY",ls,os),N("YYYY",fs,rs),N("YYYYY",ms,hs),N("YYYYYY",ms,hs),G(["YYYYY","YYYYYY"],Ds),G("YYYY",function(t,e){e[Ds]=2===t.length?i.parseTwoDigitYear(t):x(t)}),G("YY",function(t,e){e[Ds]=i.parseTwoDigitYear(t)}),G("Y",function(t,e){e[Ds]=parseInt(t,10)}),i.parseTwoDigitYear=function(t){return x(t)+(x(t)>68?1900:2e3)};var Us=P("FullYear",!1);i.ISO_8601=function(){};var js=rt("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Pt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:f()}),Gs=rt("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Pt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:f()}),qs=function(){return Date.now?Date.now():+new Date};zt("Z",":"),zt("ZZ",""),N("Z",vs),N("ZZ",vs),G(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Bt(vs,t)});var Zs=/([\+\-]|\d\d)/gi;i.updateOffset=function(){};var Qs=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,Js=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Kt.fn=Rt.prototype;var Xs=se(1,"add"),$s=se(-1,"subtract");i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Ks=rt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});L(0,["gg",2],0,function(){return this.weekYear()%100}),L(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Re("gggg","weekYear"),Re("ggggg","weekYear"),Re("GGGG","isoWeekYear"),Re("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),N("G",ps),N("g",ps),N("GG",ls,os),N("gg",ls,os),N("GGGG",fs,rs),N("gggg",fs,rs),N("GGGGG",ms,hs),N("ggggg",ms,hs),q(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,s){e[s.substr(0,2)]=x(t)}),q(["gg","GG"],function(t,e,s,a){e[a]=i.parseTwoDigitYear(t)}),L("Q",0,"Qo","quarter"),A("quarter","Q"),N("Q",as),G("Q",function(t,e){e[Ss]=3*(x(t)-1)}),L("w",["ww",2],"wo","week"),L("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),N("w",ls),N("ww",ls,os),N("W",ls),N("WW",ls,os),q(["w","ww","W","WW"],function(t,e,i,s){e[s.substr(0,1)]=x(t)});var ta={dow:0,doy:6};L("D",["DD",2],"Do","date"),A("date","D"),N("D",ls),N("DD",ls,os),N("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),G(["D","DD"],ws),G("Do",function(t,e){e[ws]=x(t.match(ls)[0],10)});var ea=P("Date",!0);L("d",0,"do","day"),L("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),L("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),L("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),L("e",0,0,"weekday"),L("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),N("d",ls),N("e",ls),N("E",ls),N("dd",ys),N("ddd",ys),N("dddd",ys),q(["dd","ddd","dddd"],function(t,e,i,s){var a=i._locale.weekdaysParse(t,s,i._strict);null!=a?e.d=a:u(i).invalidWeekday=t}),q(["d","e","E"],function(t,e,i,s){e[s]=x(t)});var ia="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),sa="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),aa="Su_Mo_Tu_We_Th_Fr_Sa".split("_");L("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),N("DDD",ds),N("DDDD",ns),G(["DDD","DDDD"],function(t,e,i){i._dayOfYear=x(t)}),L("H",["HH",2],0,"hour"),L("h",["hh",2],0,ai),L("hmm",0,0,function(){return""+ai.apply(this)+R(this.minutes(),2)}),L("hmmss",0,0,function(){return""+ai.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)}),L("Hmm",0,0,function(){return""+this.hours()+R(this.minutes(),2)}),L("Hmmss",0,0,function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)}),oi("a",!0),oi("A",!1),A("hour","h"),N("a",ni),N("A",ni),N("H",ls),N("h",ls),N("HH",ls,os),N("hh",ls,os),N("hmm",cs),N("hmmss",us),N("Hmm",cs),N("Hmmss",us),G(["H","HH"],Cs),G(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),G(["h","hh"],function(t,e,i){e[Cs]=x(t),u(i).bigHour=!0}),G("hmm",function(t,e,i){var s=t.length-2;e[Cs]=x(t.substr(0,s)),e[Ms]=x(t.substr(s)),u(i).bigHour=!0}),G("hmmss",function(t,e,i){var s=t.length-4,a=t.length-2;e[Cs]=x(t.substr(0,s)),e[Ms]=x(t.substr(s,2)),e[As]=x(t.substr(a)),u(i).bigHour=!0}),G("Hmm",function(t,e,i){var s=t.length-2;e[Cs]=x(t.substr(0,s)),e[Ms]=x(t.substr(s))}),G("Hmmss",function(t,e,i){var s=t.length-4,a=t.length-2;e[Cs]=x(t.substr(0,s)),e[Ms]=x(t.substr(s,2)),e[As]=x(t.substr(a))});var oa=/[ap]\.?m?\.?/i,na=P("Hours",!0);L("m",["mm",2],0,"minute"),A("minute","m"),N("m",ls),N("mm",ls,os),G(["m","mm"],Ms);var ra=P("Minutes",!1);L("s",["ss",2],0,"second"),A("second","s"),N("s",ls),N("ss",ls,os),G(["s","ss"],As);var ha=P("Seconds",!1);L("S",0,0,function(){return~~(this.millisecond()/100)}),L(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),L(0,["SSS",3],0,"millisecond"),L(0,["SSSS",4],0,function(){return 10*this.millisecond()}),L(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),L(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),L(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),L(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),L(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),N("S",ds,as),N("SS",ds,os),N("SSS",ds,ns);var la;for(la="SSSS";la.length<=9;la+="S")N(la,gs);for(la="S";la.length<=9;la+="S")G(la,li);var ca=P("Milliseconds",!1);L("z",0,0,"zoneAbbr"),L("zz",0,0,"zoneName");var ua=p.prototype;ua.add=Xs,ua.calendar=oe,ua.clone=ne,ua.diff=fe,ua.endOf=we,ua.format=be,ua.from=ve,ua.fromNow=xe,ua.to=ye,ua.toNow=ke,ua.get=W,ua.invalidAt=Ve,ua.isAfter=re,ua.isBefore=he,ua.isBetween=le,ua.isSame=ce,ua.isSameOrAfter=ue,ua.isSameOrBefore=de,ua.isValid=Pe,ua.lang=Ks,ua.locale=_e,ua.localeData=De,ua.max=Gs,ua.min=js,ua.parsingFlags=Oe,ua.set=W,ua.startOf=Se,ua.subtract=$s,ua.toArray=Ie,ua.toObject=Te,ua.toDate=Ae,ua.toISOString=pe,ua.toJSON=Fe,ua.toString=ge,ua.unix=Me,ua.valueOf=Ce,ua.creationData=We,ua.year=Us,ua.isLeapYear=gt,ua.weekYear=Le,ua.isoWeekYear=ze,ua.quarter=ua.quarters=Ee,ua.month=tt,ua.daysInMonth=et,ua.week=ua.weeks=qe,ua.isoWeek=ua.isoWeeks=Ze,ua.weeksInYear=Ye,ua.isoWeeksInYear=Be,ua.date=ea,ua.day=ua.days=ti,ua.weekday=ei,ua.isoWeekday=ii,ua.dayOfYear=si,ua.hour=ua.hours=na,ua.minute=ua.minutes=ra,ua.second=ua.seconds=ha,ua.millisecond=ua.milliseconds=ca,ua.utcOffset=Nt,ua.utc=Ut,ua.local=jt,ua.parseZone=Gt,ua.hasAlignedHourOffset=qt,ua.isDST=Zt,ua.isDSTShifted=Qt,ua.isLocal=Jt,ua.isUtcOffset=Xt,ua.isUtc=$t,ua.isUTC=$t,ua.zoneAbbr=ci,ua.zoneName=ui,ua.dates=rt("dates accessor is deprecated. Use date instead.",ea),ua.months=rt("months accessor is deprecated. Use month instead",tt),ua.years=rt("years accessor is deprecated. Use year instead",Us),ua.zone=rt("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Et);var da=ua,fa={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},ma={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},ga="Invalid date",pa="%d",ba=/\d{1,2}/,va={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},xa=k.prototype;xa._calendar=fa,xa.calendar=mi,xa._longDateFormat=ma,xa.longDateFormat=gi,xa._invalidDate=ga,xa.invalidDate=pi,xa._ordinal=pa,xa.ordinal=bi,xa._ordinalParse=ba,xa.preparse=vi,xa.postformat=vi,xa._relativeTime=va,xa.relativeTime=xi,xa.pastFuture=yi,xa.set=ki,xa.months=J,xa._months=Os,xa.monthsShort=X,xa._monthsShort=Vs,xa.monthsParse=$,xa._monthsRegex=Rs,xa.monthsRegex=st,xa._monthsShortRegex=Ws,xa.monthsShortRegex=it,xa.week=Ue,xa._week=ta,xa.firstDayOfYear=Ge,xa.firstDayOfWeek=je,xa.weekdays=Je,xa._weekdays=ia,xa.weekdaysMin=$e,xa._weekdaysMin=aa,xa.weekdaysShort=Xe,xa._weekdaysShort=sa,xa.weekdaysParse=Ke,xa.isPM=ri,xa._meridiemParse=oa,xa.meridiem=hi,w("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===x(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),i.lang=rt("moment.lang is deprecated. Use moment.locale instead.",w),i.langData=rt("moment.langData is deprecated. Use moment.localeData instead.",M);var ya=Math.abs,ka=Bi("ms"),_a=Bi("s"),Da=Bi("m"),Sa=Bi("h"),wa=Bi("d"),Ca=Bi("w"),Ma=Bi("M"),Aa=Bi("y"),Ia=Hi("milliseconds"),Ta=Hi("seconds"),Fa=Hi("minutes"),Pa=Hi("hours"),Oa=Hi("days"),Va=Hi("months"),Wa=Hi("years"),Ra=Math.round,La={s:45,m:45,h:22,d:26,M:11},za=Math.abs,Ba=Rt.prototype;Ba.abs=Ii,Ba.add=Fi,Ba.subtract=Pi,Ba.as=Li,Ba.asMilliseconds=ka,Ba.asSeconds=_a,Ba.asMinutes=Da,Ba.asHours=Sa,Ba.asDays=wa,Ba.asWeeks=Ca,Ba.asMonths=Ma,Ba.asYears=Aa,Ba.valueOf=zi,Ba._bubble=Vi,Ba.get=Yi,Ba.milliseconds=Ia,Ba.seconds=Ta,Ba.minutes=Fa,Ba.hours=Pa,Ba.days=Oa,Ba.weeks=Ni,Ba.months=Va,Ba.years=Wa,Ba.humanize=Gi,Ba.toISOString=qi,Ba.toString=qi,Ba.toJSON=qi,Ba.locale=_e,Ba.localeData=De,Ba.toIsoString=rt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",qi),Ba.lang=Ks,L("X",0,0,"unix"),L("x",0,0,"valueOf"),N("x",ps),N("X",xs),G("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),G("x",function(t,e,i){i._d=new Date(x(t))}),i.version="2.11.2",s(Pt),i.fn=da,i.min=Vt,i.max=Wt,i.now=qs,i.utc=l,i.unix=di,i.months=Si,i.isDate=o,i.locale=w,i.invalid=f,i.duration=Kt,i.isMoment=b,i.weekdays=Ci,i.parseZone=fi,i.localeData=M,i.isDuration=Lt,i.monthsShort=wi,i.weekdaysMin=Ai,i.defineLocale=C,i.weekdaysShort=Mi,i.normalizeUnits=I,i.relativeTimeThreshold=ji,i.prototype=da;var Ya=i;return Ya})},{}],7:[function(t,e,i){var s=t("./core/core.js")();t("./core/core.helpers")(s),t("./core/core.element")(s),t("./core/core.animation")(s), +t("./core/core.controller")(s),t("./core/core.datasetController")(s),t("./core/core.layoutService")(s),t("./core/core.legend")(s),t("./core/core.plugin.js")(s),t("./core/core.scale")(s),t("./core/core.scaleService")(s),t("./core/core.title")(s),t("./core/core.tooltip")(s),t("./controllers/controller.bar")(s),t("./controllers/controller.bubble")(s),t("./controllers/controller.doughnut")(s),t("./controllers/controller.line")(s),t("./controllers/controller.polarArea")(s),t("./controllers/controller.radar")(s),t("./scales/scale.category")(s),t("./scales/scale.linear")(s),t("./scales/scale.logarithmic")(s),t("./scales/scale.radialLinear")(s),t("./scales/scale.time")(s),t("./elements/element.arc")(s),t("./elements/element.line")(s),t("./elements/element.point")(s),t("./elements/element.rectangle")(s),t("./charts/Chart.Bar")(s),t("./charts/Chart.Bubble")(s),t("./charts/Chart.Doughnut")(s),t("./charts/Chart.Line")(s),t("./charts/Chart.PolarArea")(s),t("./charts/Chart.Radar")(s),t("./charts/Chart.Scatter")(s),window.Chart=e.exports=s},{"./charts/Chart.Bar":8,"./charts/Chart.Bubble":9,"./charts/Chart.Doughnut":10,"./charts/Chart.Line":11,"./charts/Chart.PolarArea":12,"./charts/Chart.Radar":13,"./charts/Chart.Scatter":14,"./controllers/controller.bar":15,"./controllers/controller.bubble":16,"./controllers/controller.doughnut":17,"./controllers/controller.line":18,"./controllers/controller.polarArea":19,"./controllers/controller.radar":20,"./core/core.animation":21,"./core/core.controller":22,"./core/core.datasetController":23,"./core/core.element":24,"./core/core.helpers":25,"./core/core.js":26,"./core/core.layoutService":27,"./core/core.legend":28,"./core/core.plugin.js":29,"./core/core.scale":30,"./core/core.scaleService":31,"./core/core.title":32,"./core/core.tooltip":33,"./elements/element.arc":34,"./elements/element.line":35,"./elements/element.point":36,"./elements/element.rectangle":37,"./scales/scale.category":38,"./scales/scale.linear":39,"./scales/scale.logarithmic":40,"./scales/scale.radialLinear":41,"./scales/scale.time":42}],8:[function(t,e,i){"use strict";e.exports=function(t){t.Bar=function(e,i){return i.type="bar",new t(e,i)}}},{}],9:[function(t,e,i){"use strict";e.exports=function(t){t.Bubble=function(e,i){return i.type="bubble",new t(e,i)}}},{}],10:[function(t,e,i){"use strict";e.exports=function(t){t.Doughnut=function(e,i){return i.type="doughnut",new t(e,i)}}},{}],11:[function(t,e,i){"use strict";e.exports=function(t){t.Line=function(e,i){return i.type="line",new t(e,i)}}},{}],12:[function(t,e,i){"use strict";e.exports=function(t){t.PolarArea=function(e,i){return i.type="polarArea",new t(e,i)}}},{}],13:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i={aspectRatio:1};t.Radar=function(s,a){return a.options=e.configMerge(i,a.options),a.type="radar",new t(s,a)}}},{}],14:[function(t,e,i){"use strict";e.exports=function(t){var e={hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-1"}],yAxes:[{type:"linear",position:"left",id:"y-axis-1"}]},tooltips:{callbacks:{title:function(t,e){return""},label:function(t,e){return"("+t.xLabel+", "+t.yLabel+")"}}}};t.defaults.scatter=e,t.controllers.scatter=t.controllers.line,t.Scatter=function(e,i){return i.type="scatter",new t(e,i)}}},{}],15:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.bar={hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}},t.controllers.bar=t.DatasetController.extend({initialize:function(e,i){t.DatasetController.prototype.initialize.call(this,e,i),this.getDataset().bar=!0},getBarCount:function(){var t=0;return e.each(this.chart.data.datasets,function(i){e.isDatasetVisible(i)&&i.bar&&++t}),t},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],e.each(this.getDataset().data,function(e,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new t.elements.Rectangle({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(e){this.getDataset().metaData=this.getDataset().metaData||[];var i=new t.elements.Rectangle({_chart:this.chart.chart,_datasetIndex:this.index,_index:e}),s=this.getBarCount();this.updateElement(i,e,!0,s),this.getDataset().metaData.splice(e,0,i)},update:function(t){var i=this.getBarCount();e.each(this.getDataset().metaData,function(e,s){this.updateElement(e,s,t,i)},this)},updateElement:function(t,i,s,a){var o,n=this.getScaleForId(this.getDataset().xAxisID),r=this.getScaleForId(this.getDataset().yAxisID);o=r.min<0&&r.max<0?r.getPixelForValue(r.max):r.min>0&&r.max>0?r.getPixelForValue(r.min):r.getPixelForValue(0),e.extend(t,{_chart:this.chart.chart,_xScale:n,_yScale:r,_datasetIndex:this.index,_index:i,_model:{x:this.calculateBarX(i,this.index),y:s?o:this.calculateBarY(i,this.index),label:this.chart.data.labels[i],datasetLabel:this.getDataset().label,base:s?o:this.calculateBarBase(this.index,i),width:this.calculateBarWidth(a),backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().backgroundColor,i,this.chart.options.elements.rectangle.backgroundColor),borderSkipped:t.custom&&t.custom.borderSkipped?t.custom.borderSkipped:this.chart.options.elements.rectangle.borderSkipped,borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().borderColor,i,this.chart.options.elements.rectangle.borderColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().borderWidth,i,this.chart.options.elements.rectangle.borderWidth)}}),t.pivot()},calculateBarBase:function(t,i){var s=(this.getScaleForId(this.getDataset().xAxisID),this.getScaleForId(this.getDataset().yAxisID)),a=0;if(s.options.stacked){var o=this.chart.data.datasets[t].data[i];if(0>o)for(var n=0;t>n;n++){var r=this.chart.data.datasets[n];e.isDatasetVisible(r)&&r.yAxisID===s.id&&r.bar&&(a+=r.data[i]<0?r.data[i]:0)}else for(var h=0;t>h;h++){var l=this.chart.data.datasets[h];e.isDatasetVisible(l)&&l.yAxisID===s.id&&l.bar&&(a+=l.data[i]>0?l.data[i]:0)}return s.getPixelForValue(a)}return a=s.getPixelForValue(s.min),s.beginAtZero||s.min<=0&&s.max>=0||s.min>=0&&s.max<=0?a=s.getPixelForValue(0,0):s.min<0&&s.max<0&&(a=s.getPixelForValue(s.max)),a},getRuler:function(){var t=this.getScaleForId(this.getDataset().xAxisID),e=(this.getScaleForId(this.getDataset().yAxisID),this.getBarCount()),i=function(){for(var e=t.getPixelForTick(1)-t.getPixelForTick(0),i=2;is;++s)e.isDatasetVisible(this.chart.data.datasets[s])&&this.chart.data.datasets[s].bar&&++i;return i},calculateBarX:function(t,e){var i=(this.getScaleForId(this.getDataset().yAxisID),this.getScaleForId(this.getDataset().xAxisID)),s=this.getBarIndex(e),a=this.getRuler(),o=i.getPixelForValue(null,t,e,this.chart.isCombo);return o-=this.chart.isCombo?a.tickWidth/2:0,i.options.stacked?o+a.categoryWidth/2+a.categorySpacing:o+a.barWidth/2+a.categorySpacing+a.barWidth*s+a.barSpacing/2+a.barSpacing*s},calculateBarY:function(t,i){var s=(this.getScaleForId(this.getDataset().xAxisID),this.getScaleForId(this.getDataset().yAxisID)),a=this.getDataset().data[t];if(s.options.stacked){for(var o=0,n=0,r=0;i>r;r++){var h=this.chart.data.datasets[r];e.isDatasetVisible(h)&&h.bar&&h.yAxisID===s.id&&(h.data[t]<0?n+=h.data[t]||0:o+=h.data[t]||0)}return 0>a?s.getPixelForValue(n+a):s.getPixelForValue(o+a)}return s.getPixelForValue(a)},draw:function(t){var i=t||1;e.each(this.getDataset().metaData,function(t,e){var s=this.getDataset().data[e];null===s||void 0===s||isNaN(s)||t.transition(i).draw()},this)},setHoverStyle:function(t){var i=this.chart.data.datasets[t._datasetIndex],s=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:e.getValueAtIndexOrDefault(i.hoverBackgroundColor,s,e.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:e.getValueAtIndexOrDefault(i.hoverBorderColor,s,e.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:e.getValueAtIndexOrDefault(i.hoverBorderWidth,s,t._model.borderWidth)},removeHoverStyle:function(t){var i=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().backgroundColor,i,this.chart.options.elements.rectangle.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().borderColor,i,this.chart.options.elements.rectangle.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().borderWidth,i,this.chart.options.elements.rectangle.borderWidth)}})}},{}],16:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.bubble={hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(t,e){return""},label:function(t,e){var i=e.datasets[t.datasetIndex].label||"",s=e.datasets[t.datasetIndex].data[t.index];return i+": ("+s.x+", "+s.y+", "+s.r+")"}}}},t.controllers.bubble=t.DatasetController.extend({addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],e.each(this.getDataset().data,function(e,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new t.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(e){this.getDataset().metaData=this.getDataset().metaData||[];var i=new t.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:e});this.updateElement(i,e,!0),this.getDataset().metaData.splice(e,0,i)},update:function(t){var i,s=this.getDataset().metaData,a=this.getScaleForId(this.getDataset().yAxisID);this.getScaleForId(this.getDataset().xAxisID);i=a.min<0&&a.max<0?a.getPixelForValue(a.max):a.min>0&&a.max>0?a.getPixelForValue(a.min):a.getPixelForValue(0),e.each(s,function(e,i){this.updateElement(e,i,t)},this)},updateElement:function(t,i,s){var a,o=this.getScaleForId(this.getDataset().yAxisID),n=this.getScaleForId(this.getDataset().xAxisID);a=o.min<0&&o.max<0?o.getPixelForValue(o.max):o.min>0&&o.max>0?o.getPixelForValue(o.min):o.getPixelForValue(0),e.extend(t,{_chart:this.chart.chart,_xScale:n,_yScale:o,_datasetIndex:this.index,_index:i,_model:{x:s?n.getPixelForDecimal(.5):n.getPixelForValue(this.getDataset().data[i],i,this.index,this.chart.isCombo),y:s?a:o.getPixelForValue(this.getDataset().data[i],i,this.index),radius:s?0:t.custom&&t.custom.radius?t.custom.radius:this.getRadius(this.getDataset().data[i]),backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().backgroundColor,i,this.chart.options.elements.point.backgroundColor),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().borderColor,i,this.chart.options.elements.point.borderColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().borderWidth,i,this.chart.options.elements.point.borderWidth),hitRadius:t.custom&&t.custom.hitRadius?t.custom.hitRadius:e.getValueAtIndexOrDefault(this.getDataset().hitRadius,i,this.chart.options.elements.point.hitRadius)}}),t._model.skip=t.custom&&t.custom.skip?t.custom.skip:isNaN(t._model.x)||isNaN(t._model.y),t.pivot()},getRadius:function(t){return t.r||this.chart.options.elements.point.radius},draw:function(t){var i=t||1;e.each(this.getDataset().metaData,function(t,e){t.transition(i),t.draw()})},setHoverStyle:function(t){var i=this.chart.data.datasets[t._datasetIndex],s=t._index;t._model.radius=t.custom&&t.custom.hoverRadius?t.custom.hoverRadius:e.getValueAtIndexOrDefault(i.hoverRadius,s,this.chart.options.elements.point.hoverRadius)+this.getRadius(this.getDataset().data[t._index]),t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:e.getValueAtIndexOrDefault(i.hoverBackgroundColor,s,e.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:e.getValueAtIndexOrDefault(i.hoverBorderColor,s,e.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:e.getValueAtIndexOrDefault(i.hoverBorderWidth,s,t._model.borderWidth)},removeHoverStyle:function(t){var i=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.radius=t.custom&&t.custom.radius?t.custom.radius:this.getRadius(this.getDataset().data[t._index]),t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().backgroundColor,i,this.chart.options.elements.point.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().borderColor,i,this.chart.options.elements.point.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().borderWidth,i,this.chart.options.elements.point.borderWidth)}})}},{}],17:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.doughnut={animation:{animateRotate:!0,animateScale:!1},aspectRatio:1,hover:{mode:"single"},legendCallback:function(t){var e=[];if(e.push('
      '),t.data.datasets.length)for(var i=0;i'),t.data.labels[i]&&e.push(t.data.labels[i]),e.push("");return e.push("
    "),e.join("")},legend:{labels:{generateLabels:function(t){return t.labels.length&&t.datasets.length?t.labels.map(function(i,s){var a=t.datasets[0],o=a.metaData[s],n=o.custom&&o.custom.backgroundColor?o.custom.backgroundColor:e.getValueAtIndexOrDefault(a.backgroundColor,s,this.chart.options.elements.arc.backgroundColor),r=o.custom&&o.custom.borderColor?o.custom.borderColor:e.getValueAtIndexOrDefault(a.borderColor,s,this.chart.options.elements.arc.borderColor),h=o.custom&&o.custom.borderWidth?o.custom.borderWidth:e.getValueAtIndexOrDefault(a.borderWidth,s,this.chart.options.elements.arc.borderWidth);return{text:i,fillStyle:n,strokeStyle:r,lineWidth:h,hidden:isNaN(t.datasets[0].data[s]),index:s}},this):[]}},onClick:function(t,i){e.each(this.chart.data.datasets,function(t){t.metaHiddenData=t.metaHiddenData||[];var e=i.index;isNaN(t.data[e])?isNaN(t.metaHiddenData[e])||(t.data[e]=t.metaHiddenData[e]):(t.metaHiddenData[e]=t.data[e],t.data[e]=NaN)}),this.chart.update()}},cutoutPercentage:50,rotation:Math.PI*-.5,circumference:2*Math.PI,tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+e.datasets[t.datasetIndex].data[t.index]}}}},t.defaults.pie=e.clone(t.defaults.doughnut),e.extend(t.defaults.pie,{cutoutPercentage:0}),t.controllers.doughnut=t.controllers.pie=t.DatasetController.extend({linkScales:function(){},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],e.each(this.getDataset().data,function(e,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new t.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(i,s){this.getDataset().metaData=this.getDataset().metaData||[];var a=new t.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:i});s&&e.isArray(this.getDataset().backgroundColor)&&this.getDataset().backgroundColor.splice(i,0,s),this.updateElement(a,i,!0),this.getDataset().metaData.splice(i,0,a)},getVisibleDatasetCount:function(){return e.where(this.chart.data.datasets,function(t){return e.isDatasetVisible(t)}).length},getRingIndex:function(t){for(var i=0,s=0;t>s;++s)e.isDatasetVisible(this.chart.data.datasets[s])&&++i;return i},update:function(t){var i=this.chart.chartArea.right-this.chart.chartArea.left-this.chart.options.elements.arc.borderWidth,s=this.chart.chartArea.bottom-this.chart.chartArea.top-this.chart.options.elements.arc.borderWidth,a=Math.min(i,s),o={x:0,y:0};if(this.chart.options.circumference<2*Math.PI){var n=this.chart.options.rotation%(2*Math.PI);n+=2*Math.PI*(n>=Math.PI?-1:n<-Math.PI?1:0);var r=n+this.chart.options.circumference,h={x:Math.cos(n),y:Math.sin(n)},l={x:Math.cos(r),y:Math.sin(r)},c=0>=n&&r>=0||n<=2*Math.PI&&2*Math.PI<=r,u=n<=.5*Math.PI&&.5*Math.PI<=r||n<=2.5*Math.PI&&2.5*Math.PI<=r,d=n<=-Math.PI&&-Math.PI<=r||n<=Math.PI&&Math.PI<=r,f=n<=.5*-Math.PI&&.5*-Math.PI<=r||n<=1.5*Math.PI&&1.5*Math.PI<=r,m=this.chart.options.cutoutPercentage/100,g={x:d?-1:Math.min(h.x*(h.x<0?1:m),l.x*(l.x<0?1:m)),y:f?-1:Math.min(h.y*(h.y<0?1:m),l.y*(l.y<0?1:m))},p={x:c?1:Math.max(h.x*(h.x>0?1:m),l.x*(l.x>0?1:m)),y:u?1:Math.max(h.y*(h.y>0?1:m),l.y*(l.y>0?1:m))},b={width:.5*(p.x-g.x),height:.5*(p.y-g.y)};a=Math.min(i/b.width,s/b.height),o={x:(p.x+g.x)*-.5,y:(p.y+g.y)*-.5}}this.chart.outerRadius=Math.max(a/2,0),this.chart.innerRadius=Math.max(this.chart.options.cutoutPercentage?this.chart.outerRadius/100*this.chart.options.cutoutPercentage:1,0),this.chart.radiusLength=(this.chart.outerRadius-this.chart.innerRadius)/this.getVisibleDatasetCount(),this.chart.offsetX=o.x*this.chart.outerRadius,this.chart.offsetY=o.y*this.chart.outerRadius,this.getDataset().total=0,e.each(this.getDataset().data,function(t){isNaN(t)||(this.getDataset().total+=Math.abs(t))},this),this.outerRadius=this.chart.outerRadius-this.chart.radiusLength*this.getRingIndex(this.index),this.innerRadius=this.outerRadius-this.chart.radiusLength,e.each(this.getDataset().metaData,function(e,i){this.updateElement(e,i,t)},this)},updateElement:function(t,i,s){var a=(this.chart.chartArea.left+this.chart.chartArea.right)/2,o=(this.chart.chartArea.top+this.chart.chartArea.bottom)/2,n=this.chart.options.rotation,r=this.chart.options.rotation,h=s&&this.chart.options.animation.animateRotate?0:this.calculateCircumference(this.getDataset().data[i])*(this.chart.options.circumference/(2*Math.PI)),l=s&&this.chart.options.animation.animateScale?0:this.innerRadius,c=s&&this.chart.options.animation.animateScale?0:this.outerRadius;e.extend(t,{_chart:this.chart.chart,_datasetIndex:this.index,_index:i,_model:{x:a+this.chart.offsetX,y:o+this.chart.offsetY,startAngle:n,endAngle:r,circumference:h,outerRadius:c,innerRadius:l,backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().backgroundColor,i,this.chart.options.elements.arc.backgroundColor),hoverBackgroundColor:t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:e.getValueAtIndexOrDefault(this.getDataset().hoverBackgroundColor,i,this.chart.options.elements.arc.hoverBackgroundColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().borderWidth,i,this.chart.options.elements.arc.borderWidth),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().borderColor,i,this.chart.options.elements.arc.borderColor),label:e.getValueAtIndexOrDefault(this.getDataset().label,i,this.chart.data.labels[i])}}),s||(0===i?t._model.startAngle=this.chart.options.rotation:t._model.startAngle=this.getDataset().metaData[i-1]._model.endAngle,t._model.endAngle=t._model.startAngle+t._model.circumference),t.pivot()},draw:function(t){var i=t||1;e.each(this.getDataset().metaData,function(t,e){t.transition(i).draw()})},setHoverStyle:function(t){var i=this.chart.data.datasets[t._datasetIndex],s=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:e.getValueAtIndexOrDefault(i.hoverBackgroundColor,s,e.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:e.getValueAtIndexOrDefault(i.hoverBorderColor,s,e.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:e.getValueAtIndexOrDefault(i.hoverBorderWidth,s,t._model.borderWidth)},removeHoverStyle:function(t){var i=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().backgroundColor,i,this.chart.options.elements.arc.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().borderColor,i,this.chart.options.elements.arc.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().borderWidth,i,this.chart.options.elements.arc.borderWidth)},calculateCircumference:function(t){return this.getDataset().total>0&&!isNaN(t)?2*Math.PI*(t/this.getDataset().total):0}})}},{}],18:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.line={showLines:!0,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}},t.controllers.line=t.DatasetController.extend({addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],this.getDataset().metaDataset=this.getDataset().metaDataset||new t.elements.Line({_chart:this.chart.chart,_datasetIndex:this.index,_points:this.getDataset().metaData}),e.each(this.getDataset().data,function(e,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new t.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(e){this.getDataset().metaData=this.getDataset().metaData||[];var i=new t.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:e});this.updateElement(i,e,!0),this.getDataset().metaData.splice(e,0,i),this.chart.options.showLines&&0!==this.chart.options.elements.line.tension&&this.updateBezierControlPoints()},update:function(t){var i,s=this.getDataset().metaDataset,a=this.getDataset().metaData,o=this.getScaleForId(this.getDataset().yAxisID);this.getScaleForId(this.getDataset().xAxisID);i=o.min<0&&o.max<0?o.getPixelForValue(o.max):o.min>0&&o.max>0?o.getPixelForValue(o.min):o.getPixelForValue(0),this.chart.options.showLines&&(s._scale=o,s._datasetIndex=this.index,s._children=a,void 0!==this.getDataset().tension&&void 0===this.getDataset().lineTension&&(this.getDataset().lineTension=this.getDataset().tension),s._model={tension:s.custom&&s.custom.tension?s.custom.tension:e.getValueOrDefault(this.getDataset().lineTension,this.chart.options.elements.line.tension),backgroundColor:s.custom&&s.custom.backgroundColor?s.custom.backgroundColor:this.getDataset().backgroundColor||this.chart.options.elements.line.backgroundColor,borderWidth:s.custom&&s.custom.borderWidth?s.custom.borderWidth:this.getDataset().borderWidth||this.chart.options.elements.line.borderWidth,borderColor:s.custom&&s.custom.borderColor?s.custom.borderColor:this.getDataset().borderColor||this.chart.options.elements.line.borderColor,borderCapStyle:s.custom&&s.custom.borderCapStyle?s.custom.borderCapStyle:this.getDataset().borderCapStyle||this.chart.options.elements.line.borderCapStyle,borderDash:s.custom&&s.custom.borderDash?s.custom.borderDash:this.getDataset().borderDash||this.chart.options.elements.line.borderDash,borderDashOffset:s.custom&&s.custom.borderDashOffset?s.custom.borderDashOffset:this.getDataset().borderDashOffset||this.chart.options.elements.line.borderDashOffset,borderJoinStyle:s.custom&&s.custom.borderJoinStyle?s.custom.borderJoinStyle:this.getDataset().borderJoinStyle||this.chart.options.elements.line.borderJoinStyle,fill:s.custom&&s.custom.fill?s.custom.fill:void 0!==this.getDataset().fill?this.getDataset().fill:this.chart.options.elements.line.fill,scaleTop:o.top,scaleBottom:o.bottom,scaleZero:i},s.pivot()),e.each(a,function(e,i){this.updateElement(e,i,t)},this),this.chart.options.showLines&&0!==this.chart.options.elements.line.tension&&this.updateBezierControlPoints()},getPointBackgroundColor:function(t,i){var s=this.chart.options.elements.point.backgroundColor,a=this.getDataset();return t.custom&&t.custom.backgroundColor?s=t.custom.backgroundColor:a.pointBackgroundColor?s=e.getValueAtIndexOrDefault(a.pointBackgroundColor,i,s):a.backgroundColor&&(s=a.backgroundColor),s},getPointBorderColor:function(t,i){var s=this.chart.options.elements.point.borderColor,a=this.getDataset();return t.custom&&t.custom.borderColor?s=t.custom.borderColor:a.pointBorderColor?s=e.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,i,s):a.borderColor&&(s=a.borderColor),s},getPointBorderWidth:function(t,i){var s=this.chart.options.elements.point.borderWidth,a=this.getDataset();return t.custom&&void 0!==t.custom.borderWidth?s=t.custom.borderWidth:void 0!==a.pointBorderWidth?s=e.getValueAtIndexOrDefault(a.pointBorderWidth,i,s):void 0!==a.borderWidth&&(s=a.borderWidth),s},updateElement:function(t,i,s){var a,o=this.getScaleForId(this.getDataset().yAxisID),n=this.getScaleForId(this.getDataset().xAxisID);a=o.min<0&&o.max<0?o.getPixelForValue(o.max):o.min>0&&o.max>0?o.getPixelForValue(o.min):o.getPixelForValue(0),t._chart=this.chart.chart,t._xScale=n,t._yScale=o,t._datasetIndex=this.index,t._index=i,void 0!==this.getDataset().radius&&void 0===this.getDataset().pointRadius&&(this.getDataset().pointRadius=this.getDataset().radius),void 0!==this.getDataset().hitRadius&&void 0===this.getDataset().pointHitRadius&&(this.getDataset().pointHitRadius=this.getDataset().hitRadius),t._model={x:n.getPixelForValue(this.getDataset().data[i],i,this.index,this.chart.isCombo),y:s?a:this.calculatePointY(this.getDataset().data[i],i,this.index,this.chart.isCombo),radius:t.custom&&t.custom.radius?t.custom.radius:e.getValueAtIndexOrDefault(this.getDataset().pointRadius,i,this.chart.options.elements.point.radius),pointStyle:t.custom&&t.custom.pointStyle?t.custom.pointStyle:e.getValueAtIndexOrDefault(this.getDataset().pointStyle,i,this.chart.options.elements.point.pointStyle),backgroundColor:this.getPointBackgroundColor(t,i),borderColor:this.getPointBorderColor(t,i),borderWidth:this.getPointBorderWidth(t,i),hitRadius:t.custom&&t.custom.hitRadius?t.custom.hitRadius:e.getValueAtIndexOrDefault(this.getDataset().pointHitRadius,i,this.chart.options.elements.point.hitRadius)},t._model.skip=t.custom&&t.custom.skip?t.custom.skip:isNaN(t._model.x)||isNaN(t._model.y)},calculatePointY:function(t,i,s,a){var o=(this.getScaleForId(this.getDataset().xAxisID),this.getScaleForId(this.getDataset().yAxisID));if(o.options.stacked){for(var n=0,r=0,h=0;s>h;h++){var l=this.chart.data.datasets[h];"line"===l.type&&e.isDatasetVisible(l)&&(l.data[i]<0?r+=l.data[i]||0:n+=l.data[i]||0)}return 0>t?o.getPixelForValue(r+t):o.getPixelForValue(n+t)}return o.getPixelForValue(t)},updateBezierControlPoints:function(){e.each(this.getDataset().metaData,function(t,i){var s=e.splineCurve(e.previousItem(this.getDataset().metaData,i)._model,t._model,e.nextItem(this.getDataset().metaData,i)._model,this.getDataset().metaDataset._model.tension);t._model.controlPointPreviousX=Math.max(Math.min(s.previous.x,this.chart.chartArea.right),this.chart.chartArea.left),t._model.controlPointPreviousY=Math.max(Math.min(s.previous.y,this.chart.chartArea.bottom),this.chart.chartArea.top),t._model.controlPointNextX=Math.max(Math.min(s.next.x,this.chart.chartArea.right),this.chart.chartArea.left),t._model.controlPointNextY=Math.max(Math.min(s.next.y,this.chart.chartArea.bottom),this.chart.chartArea.top),t.pivot()},this)},draw:function(t){var i=t||1;e.each(this.getDataset().metaData,function(t){t.transition(i)}),this.chart.options.showLines&&this.getDataset().metaDataset.transition(i).draw(),e.each(this.getDataset().metaData,function(t){t.draw()})},setHoverStyle:function(t){var i=this.chart.data.datasets[t._datasetIndex],s=t._index;t._model.radius=t.custom&&t.custom.hoverRadius?t.custom.hoverRadius:e.getValueAtIndexOrDefault(i.pointHoverRadius,s,this.chart.options.elements.point.hoverRadius),t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:e.getValueAtIndexOrDefault(i.pointHoverBackgroundColor,s,e.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:e.getValueAtIndexOrDefault(i.pointHoverBorderColor,s,e.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:e.getValueAtIndexOrDefault(i.pointHoverBorderWidth,s,t._model.borderWidth)},removeHoverStyle:function(t){var i=(this.chart.data.datasets[t._datasetIndex],t._index);void 0!==this.getDataset().radius&&void 0===this.getDataset().pointRadius&&(this.getDataset().pointRadius=this.getDataset().radius),t._model.radius=t.custom&&t.custom.radius?t.custom.radius:e.getValueAtIndexOrDefault(this.getDataset().pointRadius,i,this.chart.options.elements.point.radius),t._model.backgroundColor=this.getPointBackgroundColor(t,i),t._model.borderColor=this.getPointBorderColor(t,i),t._model.borderWidth=this.getPointBorderWidth(t,i)}})}},{}],19:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.polarArea={scale:{type:"radialLinear",lineArc:!0},animateRotate:!0,animateScale:!0,aspectRatio:1,legendCallback:function(t){var e=[];if(e.push('
      '),t.data.datasets.length)for(var i=0;i'),t.data.labels[i]&&e.push(t.data.labels[i]),e.push("");return e.push("
    "),e.join("")},legend:{labels:{generateLabels:function(t){return t.labels.length&&t.datasets.length?t.labels.map(function(i,s){var a=t.datasets[0],o=a.metaData[s],n=o.custom&&o.custom.backgroundColor?o.custom.backgroundColor:e.getValueAtIndexOrDefault(a.backgroundColor,s,this.chart.options.elements.arc.backgroundColor),r=o.custom&&o.custom.borderColor?o.custom.borderColor:e.getValueAtIndexOrDefault(a.borderColor,s,this.chart.options.elements.arc.borderColor),h=o.custom&&o.custom.borderWidth?o.custom.borderWidth:e.getValueAtIndexOrDefault(a.borderWidth,s,this.chart.options.elements.arc.borderWidth);return{text:i,fillStyle:n,strokeStyle:r,lineWidth:h,hidden:isNaN(t.datasets[0].data[s]),index:s}},this):[]}},onClick:function(t,i){e.each(this.chart.data.datasets,function(t){t.metaHiddenData=t.metaHiddenData||[];var e=i.index;isNaN(t.data[e])?isNaN(t.metaHiddenData[e])||(t.data[e]=t.metaHiddenData[e]):(t.metaHiddenData[e]=t.data[e],t.data[e]=NaN)}),this.chart.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}},t.controllers.polarArea=t.DatasetController.extend({linkScales:function(){},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],e.each(this.getDataset().data,function(e,i){ +this.getDataset().metaData[i]=this.getDataset().metaData[i]||new t.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(e){this.getDataset().metaData=this.getDataset().metaData||[];var i=new t.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:e});this.updateElement(i,e,!0),this.getDataset().metaData.splice(e,0,i)},getVisibleDatasetCount:function(){return e.where(this.chart.data.datasets,function(t){return e.isDatasetVisible(t)}).length},update:function(t){var i=Math.min(this.chart.chartArea.right-this.chart.chartArea.left,this.chart.chartArea.bottom-this.chart.chartArea.top);this.chart.outerRadius=Math.max((i-this.chart.options.elements.arc.borderWidth/2)/2,0),this.chart.innerRadius=Math.max(this.chart.options.cutoutPercentage?this.chart.outerRadius/100*this.chart.options.cutoutPercentage:1,0),this.chart.radiusLength=(this.chart.outerRadius-this.chart.innerRadius)/this.getVisibleDatasetCount(),this.getDataset().total=0,e.each(this.getDataset().data,function(t){this.getDataset().total+=Math.abs(t)},this),this.outerRadius=this.chart.outerRadius-this.chart.radiusLength*this.index,this.innerRadius=this.outerRadius-this.chart.radiusLength,e.each(this.getDataset().metaData,function(e,i){this.updateElement(e,i,t)},this)},updateElement:function(t,i,s){for(var a=this.calculateCircumference(this.getDataset().data[i]),o=(this.chart.chartArea.left+this.chart.chartArea.right)/2,n=(this.chart.chartArea.top+this.chart.chartArea.bottom)/2,r=0,h=0;i>h;++h)isNaN(this.getDataset().data[h])||++r;var l=-.5*Math.PI+a*r,c=l+a,u={x:o,y:n,innerRadius:0,outerRadius:this.chart.options.animateScale?0:this.chart.scale.getDistanceFromCenterForValue(this.getDataset().data[i]),startAngle:this.chart.options.animateRotate?Math.PI*-.5:l,endAngle:this.chart.options.animateRotate?Math.PI*-.5:c,backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().backgroundColor,i,this.chart.options.elements.arc.backgroundColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().borderWidth,i,this.chart.options.elements.arc.borderWidth),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().borderColor,i,this.chart.options.elements.arc.borderColor),label:e.getValueAtIndexOrDefault(this.chart.data.labels,i,this.chart.data.labels[i])};e.extend(t,{_chart:this.chart.chart,_datasetIndex:this.index,_index:i,_scale:this.chart.scale,_model:s?u:{x:o,y:n,innerRadius:0,outerRadius:this.chart.scale.getDistanceFromCenterForValue(this.getDataset().data[i]),startAngle:l,endAngle:c,backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().backgroundColor,i,this.chart.options.elements.arc.backgroundColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().borderWidth,i,this.chart.options.elements.arc.borderWidth),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().borderColor,i,this.chart.options.elements.arc.borderColor),label:e.getValueAtIndexOrDefault(this.chart.data.labels,i,this.chart.data.labels[i])}}),t.pivot()},draw:function(t){var i=t||1;e.each(this.getDataset().metaData,function(t,e){t.transition(i).draw()})},setHoverStyle:function(t){var i=this.chart.data.datasets[t._datasetIndex],s=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:e.getValueAtIndexOrDefault(i.hoverBackgroundColor,s,e.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:e.getValueAtIndexOrDefault(i.hoverBorderColor,s,e.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:e.getValueAtIndexOrDefault(i.hoverBorderWidth,s,t._model.borderWidth)},removeHoverStyle:function(t){var i=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().backgroundColor,i,this.chart.options.elements.arc.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().borderColor,i,this.chart.options.elements.arc.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().borderWidth,i,this.chart.options.elements.arc.borderWidth)},calculateCircumference:function(t){if(isNaN(t))return 0;var i=e.where(this.getDataset().data,function(t){return isNaN(t)}).length;return 2*Math.PI/(this.getDataset().data.length-i)}})}},{}],20:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.radar={scale:{type:"radialLinear"},elements:{line:{tension:0}}},t.controllers.radar=t.DatasetController.extend({linkScales:function(){},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],this.getDataset().metaDataset=this.getDataset().metaDataset||new t.elements.Line({_chart:this.chart.chart,_datasetIndex:this.index,_points:this.getDataset().metaData,_loop:!0}),e.each(this.getDataset().data,function(e,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new t.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:i,_model:{x:0,y:0}})},this)},addElementAndReset:function(e){this.getDataset().metaData=this.getDataset().metaData||[];var i=new t.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:e});this.updateElement(i,e,!0),this.getDataset().metaData.splice(e,0,i),this.updateBezierControlPoints()},update:function(t){var i,s=this.getDataset().metaDataset,a=this.getDataset().metaData,o=this.chart.scale;i=o.min<0&&o.max<0?o.getPointPositionForValue(0,o.max):o.min>0&&o.max>0?o.getPointPositionForValue(0,o.min):o.getPointPositionForValue(0,0),e.extend(this.getDataset().metaDataset,{_datasetIndex:this.index,_children:this.getDataset().metaData,_model:{tension:s.custom&&s.custom.tension?s.custom.tension:e.getValueOrDefault(this.getDataset().tension,this.chart.options.elements.line.tension),backgroundColor:s.custom&&s.custom.backgroundColor?s.custom.backgroundColor:this.getDataset().backgroundColor||this.chart.options.elements.line.backgroundColor,borderWidth:s.custom&&s.custom.borderWidth?s.custom.borderWidth:this.getDataset().borderWidth||this.chart.options.elements.line.borderWidth,borderColor:s.custom&&s.custom.borderColor?s.custom.borderColor:this.getDataset().borderColor||this.chart.options.elements.line.borderColor,fill:s.custom&&s.custom.fill?s.custom.fill:void 0!==this.getDataset().fill?this.getDataset().fill:this.chart.options.elements.line.fill,borderCapStyle:s.custom&&s.custom.borderCapStyle?s.custom.borderCapStyle:this.getDataset().borderCapStyle||this.chart.options.elements.line.borderCapStyle,borderDash:s.custom&&s.custom.borderDash?s.custom.borderDash:this.getDataset().borderDash||this.chart.options.elements.line.borderDash,borderDashOffset:s.custom&&s.custom.borderDashOffset?s.custom.borderDashOffset:this.getDataset().borderDashOffset||this.chart.options.elements.line.borderDashOffset,borderJoinStyle:s.custom&&s.custom.borderJoinStyle?s.custom.borderJoinStyle:this.getDataset().borderJoinStyle||this.chart.options.elements.line.borderJoinStyle,scaleTop:o.top,scaleBottom:o.bottom,scaleZero:i}}),this.getDataset().metaDataset.pivot(),e.each(a,function(e,i){this.updateElement(e,i,t)},this),this.updateBezierControlPoints()},updateElement:function(t,i,s){var a=this.chart.scale.getPointPositionForValue(i,this.getDataset().data[i]);e.extend(t,{_datasetIndex:this.index,_index:i,_scale:this.chart.scale,_model:{x:s?this.chart.scale.xCenter:a.x,y:s?this.chart.scale.yCenter:a.y,tension:t.custom&&t.custom.tension?t.custom.tension:e.getValueOrDefault(this.getDataset().tension,this.chart.options.elements.line.tension),radius:t.custom&&t.custom.radius?t.custom.radius:e.getValueAtIndexOrDefault(this.getDataset().pointRadius,i,this.chart.options.elements.point.radius),backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().pointBackgroundColor,i,this.chart.options.elements.point.backgroundColor),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,i,this.chart.options.elements.point.borderColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().pointBorderWidth,i,this.chart.options.elements.point.borderWidth),pointStyle:t.custom&&t.custom.pointStyle?t.custom.pointStyle:e.getValueAtIndexOrDefault(this.getDataset().pointStyle,i,this.chart.options.elements.point.pointStyle),hitRadius:t.custom&&t.custom.hitRadius?t.custom.hitRadius:e.getValueAtIndexOrDefault(this.getDataset().hitRadius,i,this.chart.options.elements.point.hitRadius)}}),t._model.skip=t.custom&&t.custom.skip?t.custom.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){e.each(this.getDataset().metaData,function(t,i){var s=e.splineCurve(e.previousItem(this.getDataset().metaData,i,!0)._model,t._model,e.nextItem(this.getDataset().metaData,i,!0)._model,t._model.tension);t._model.controlPointPreviousX=Math.max(Math.min(s.previous.x,this.chart.chartArea.right),this.chart.chartArea.left),t._model.controlPointPreviousY=Math.max(Math.min(s.previous.y,this.chart.chartArea.bottom),this.chart.chartArea.top),t._model.controlPointNextX=Math.max(Math.min(s.next.x,this.chart.chartArea.right),this.chart.chartArea.left),t._model.controlPointNextY=Math.max(Math.min(s.next.y,this.chart.chartArea.bottom),this.chart.chartArea.top),t.pivot()},this)},draw:function(t){var i=t||1;e.each(this.getDataset().metaData,function(t,e){t.transition(i)}),this.getDataset().metaDataset.transition(i).draw(),e.each(this.getDataset().metaData,function(t){t.draw()})},setHoverStyle:function(t){var i=this.chart.data.datasets[t._datasetIndex],s=t._index;t._model.radius=t.custom&&t.custom.hoverRadius?t.custom.hoverRadius:e.getValueAtIndexOrDefault(i.pointHoverRadius,s,this.chart.options.elements.point.hoverRadius),t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:e.getValueAtIndexOrDefault(i.pointHoverBackgroundColor,s,e.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:e.getValueAtIndexOrDefault(i.pointHoverBorderColor,s,e.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:e.getValueAtIndexOrDefault(i.pointHoverBorderWidth,s,t._model.borderWidth)},removeHoverStyle:function(t){var i=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.radius=t.custom&&t.custom.radius?t.custom.radius:e.getValueAtIndexOrDefault(this.getDataset().radius,i,this.chart.options.elements.point.radius),t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:e.getValueAtIndexOrDefault(this.getDataset().pointBackgroundColor,i,this.chart.options.elements.point.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:e.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,i,this.chart.options.elements.point.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:e.getValueAtIndexOrDefault(this.getDataset().pointBorderWidth,i,this.chart.options.elements.point.borderWidth)}})}},{}],21:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.global.animation={duration:1e3,easing:"easeOutQuart",onProgress:e.noop,onComplete:e.noop},t.Animation=t.Element.extend({currentStep:null,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,i,s){s||(t.animating=!0);for(var a=0;a1&&(e=Math.floor(this.dropFrames),this.dropFrames=this.dropFrames%1);for(var i=0;ithis.animations[i].animationObject.numSteps&&(this.animations[i].animationObject.currentStep=this.animations[i].animationObject.numSteps),this.animations[i].animationObject.render(this.animations[i].chartInstance,this.animations[i].animationObject),this.animations[i].animationObject.onAnimationProgress&&this.animations[i].animationObject.onAnimationProgress.call&&this.animations[i].animationObject.onAnimationProgress.call(this.animations[i].chartInstance,this.animations[i]),this.animations[i].animationObject.currentStep===this.animations[i].animationObject.numSteps?(this.animations[i].animationObject.onAnimationComplete&&this.animations[i].animationObject.onAnimationComplete.call&&this.animations[i].animationObject.onAnimationComplete.call(this.animations[i].chartInstance,this.animations[i]),this.animations[i].chartInstance.animating=!1,this.animations.splice(i,1)):++i;var s=Date.now(),a=(s-t)/this.frameDuration;this.dropFrames+=a,this.animations.length>0&&this.requestAnimationFrame()}}}},{}],22:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.types={},t.instances={},t.controllers={},t.Controller=function(i){return this.chart=i,this.config=i.config,this.options=this.config.options=e.configMerge(t.defaults.global,t.defaults[this.config.type],this.config.options||{}),this.id=e.uid(),Object.defineProperty(this,"data",{get:function(){return this.config.data}}),t.instances[this.id]=this,this.options.responsive&&this.resize(!0),this.initialize(),this},e.extend(t.Controller.prototype,{initialize:function(){return t.pluginService.notifyPlugins("beforeInit",[this]),this.bindEvents(),this.ensureScalesHaveIDs(),this.buildOrUpdateControllers(),this.buildScales(),this.buildSurroundingItems(),this.updateLayout(),this.resetElements(),this.initToolTip(),this.update(),t.pluginService.notifyPlugins("afterInit",[this]),this},clear:function(){return e.clear(this.chart),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var i=this.chart.canvas,s=e.getMaximumWidth(this.chart.canvas),a=this.options.maintainAspectRatio&&isNaN(this.chart.aspectRatio)===!1&&isFinite(this.chart.aspectRatio)&&0!==this.chart.aspectRatio?s/this.chart.aspectRatio:e.getMaximumHeight(this.chart.canvas),o=this.chart.width!==s||this.chart.height!==a;return o?(i.width=this.chart.width=s,i.height=this.chart.height=a,e.retinaScale(this.chart),t||(this.stop(),this.update(this.options.responsiveAnimationDuration)),this):this},ensureScalesHaveIDs:function(){var t="x-axis-",i="y-axis-";this.options.scales&&(this.options.scales.xAxes&&this.options.scales.xAxes.length&&e.each(this.options.scales.xAxes,function(e,i){e.id=e.id||t+i}),this.options.scales.yAxes&&this.options.scales.yAxes.length&&e.each(this.options.scales.yAxes,function(t,e){t.id=t.id||i+e}))},buildScales:function(){if(this.scales={},this.options.scales&&(this.options.scales.xAxes&&this.options.scales.xAxes.length&&e.each(this.options.scales.xAxes,function(i,s){var a=e.getValueOrDefault(i.type,"category"),o=t.scaleService.getScaleConstructor(a);if(o){var n=new o({ctx:this.chart.ctx,options:i,chart:this,id:i.id});this.scales[n.id]=n}},this),this.options.scales.yAxes&&this.options.scales.yAxes.length&&e.each(this.options.scales.yAxes,function(i,s){var a=e.getValueOrDefault(i.type,"linear"),o=t.scaleService.getScaleConstructor(a);if(o){var n=new o({ctx:this.chart.ctx,options:i,chart:this,id:i.id});this.scales[n.id]=n}},this)),this.options.scale){var i=t.scaleService.getScaleConstructor(this.options.scale.type);if(i){var s=new i({ctx:this.chart.ctx,options:this.options.scale,chart:this});this.scale=s,this.scales.radialScale=s}}t.scaleService.addScalesToLayout(this)},buildSurroundingItems:function(){this.options.title&&(this.titleBlock=new t.Title({ctx:this.chart.ctx,options:this.options.title,chart:this}),t.layoutService.addBox(this,this.titleBlock)),this.options.legend&&(this.legend=new t.Legend({ctx:this.chart.ctx,options:this.options.legend,chart:this}),t.layoutService.addBox(this,this.legend))},updateLayout:function(){t.layoutService.update(this,this.chart.width,this.chart.height)},buildOrUpdateControllers:function(){var i=[],s=[];if(e.each(this.data.datasets,function(e,a){e.type||(e.type=this.config.type);var o=e.type;i.push(o),e.controller?e.controller.updateIndex(a):(e.controller=new t.controllers[o](this,a),s.push(e.controller))},this),i.length>1)for(var a=1;a0&&(e=this.data.datasets[e[0]._datasetIndex].metaData),e},generateLegend:function(){return this.options.legendCallback(this)},destroy:function(){this.clear(),e.unbindEvents(this,this.events),e.removeResizeListener(this.chart.canvas.parentNode);var i=this.chart.canvas;i.width=this.chart.width,i.height=this.chart.height,void 0!==this.chart.originalDevicePixelRatio&&this.chart.ctx.scale(1/this.chart.originalDevicePixelRatio,1/this.chart.originalDevicePixelRatio),i.style.width=this.chart.originalCanvasStyleWidth,i.style.height=this.chart.originalCanvasStyleHeight,t.pluginService.notifyPlugins("destroy",[this]),delete t.instances[this.id]},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)},initToolTip:function(){this.tooltip=new t.Tooltip({_chart:this.chart,_chartInstance:this,_data:this.data,_options:this.options},this)},bindEvents:function(){e.bindEvents(this,this.options.events,function(t){this.eventHandler(t)})},eventHandler:function(t){if(this.lastActive=this.lastActive||[],this.lastTooltipActive=this.lastTooltipActive||[],"mouseout"===t.type)this.active=[],this.tooltipActive=[];else{var i=this,s=function(e){switch(e){case"single":return i.getElementAtEvent(t);case"label":return i.getElementsAtEvent(t);case"dataset":return i.getDatasetAtEvent(t);default:return t}};this.active=s(this.options.hover.mode),this.tooltipActive=s(this.options.tooltips.mode)}this.options.hover.onHover&&this.options.hover.onHover.call(this,this.active),("mouseup"===t.type||"click"===t.type)&&(this.options.onClick&&this.options.onClick.call(this,t,this.active),this.legend&&this.legend.handleEvent&&this.legend.handleEvent(t));if(this.lastActive.length)switch(this.options.hover.mode){case"single":this.data.datasets[this.lastActive[0]._datasetIndex].controller.removeHoverStyle(this.lastActive[0],this.lastActive[0]._datasetIndex,this.lastActive[0]._index);break;case"label":case"dataset":for(var a=0;at)this.getDataset().metaData.splice(t,e-t);else if(t>e)for(var i=e;t>i;++i)this.addElementAndReset(i)},addElements:e.noop,addElementAndReset:e.noop,draw:e.noop,removeHoverStyle:e.noop,setHoverStyle:e.noop,update:e.noop}),t.DatasetController.extend=e.inherits}},{}],24:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.elements={},t.Element=function(t){e.extend(this,t),this.initialize.apply(this,arguments)},e.extend(t.Element.prototype,{initialize:function(){},pivot:function(){return this._view||(this._view=e.clone(this._model)),this._start=e.clone(this._view),this},transition:function(t){return this._view||(this._view=e.clone(this._model)),1===t?(this._view=this._model,this._start=null,this):(this._start||this.pivot(),e.each(this._model,function(i,s){if("_"!==s[0]&&this._model.hasOwnProperty(s))if(this._view.hasOwnProperty(s))if(i===this._view[s]);else if("string"==typeof i)try{var a=e.color(this._start[s]).mix(e.color(this._model[s]),t);this._view[s]=a.rgbString()}catch(o){this._view[s]=i}else if("number"==typeof i){var n=void 0!==this._start[s]&&isNaN(this._start[s])===!1?this._start[s]:0;this._view[s]=(this._model[s]-n)*t+n}else this._view[s]=i;else"number"!=typeof i||isNaN(this._view[s])?this._view[s]=i:this._view[s]=i*t;else;},this),this)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return e.isNumber(this._model.x)&&e.isNumber(this._model.y)}}),t.Element.extend=e.inherits}},{}],25:[function(t,e,i){"use strict";var s=t("chartjs-color");e.exports=function(t){function e(t,e,i){var s;return"string"==typeof t?(s=parseInt(t,10),-1!=t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}function i(t,i,s){var a,o=document.defaultView.getComputedStyle(t)[i],n=document.defaultView.getComputedStyle(t.parentNode)[i],r=null!==o&&"none"!==o,h=null!==n&&"none"!==n;return(r||h)&&(a=Math.min(r?e(o,t,s):Number.POSITIVE_INFINITY,h?e(n,t.parentNode,s):Number.POSITIVE_INFINITY)),a}var a=t.helpers={};a.each=function(t,e,i,s){var o,n;if(a.isArray(t))if(n=t.length,s)for(o=n-1;o>=0;o--)e.call(i,t[o],o);else for(o=0;n>o;o++)e.call(i,t[o],o);else if("object"==typeof t){var r=Object.keys(t);for(n=r.length,o=0;n>o;o++)e.call(i,t[r[o]],r[o])}},a.clone=function(t){var e={};return a.each(t,function(i,s){t.hasOwnProperty(s)&&(a.isArray(i)?e[s]=i.slice(0):"object"==typeof i&&null!==i?e[s]=a.clone(i):e[s]=i)}),e},a.extend=function(t){for(var e=arguments.length,i=[],s=1;e>s;s++)i.push(arguments[s]);return a.each(i,function(e){a.each(e,function(i,s){e.hasOwnProperty(s)&&(t[s]=i)})}),t},a.configMerge=function(e){var i=a.clone(e);return a.each(Array.prototype.slice.call(arguments,1),function(e){a.each(e,function(s,o){if(e.hasOwnProperty(o))if("scales"===o)i[o]=a.scaleMerge(i.hasOwnProperty(o)?i[o]:{},s);else if("scale"===o)i[o]=a.configMerge(i.hasOwnProperty(o)?i[o]:{},t.scaleService.getScaleDefaults(s.type),s);else if(i.hasOwnProperty(o)&&a.isArray(i[o])&&a.isArray(s)){var n=i[o];a.each(s,function(t,e){e=s[o].length||!s[o][i].type?s[o].push(a.configMerge(r,e)):e.type&&e.type!==s[o][i].type?s[o][i]=a.configMerge(s[o][i],r,e):s[o][i]=a.configMerge(s[o][i],e)}):(s[o]=[],a.each(e,function(e){var i=a.getValueOrDefault(e.type,"xAxes"===o?"category":"linear");s[o].push(a.configMerge(t.scaleService.getScaleDefaults(i),e))})):s.hasOwnProperty(o)&&"object"==typeof s[o]&&null!==s[o]&&"object"==typeof e?s[o]=a.configMerge(s[o],e):s[o]=e)}),s},a.getValueAtIndexOrDefault=function(t,e,i){return void 0===t||null===t?i:a.isArray(t)?e=0;s--){var a=t[s];if(e(a))return a}},a.inherits=function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},s=function(){this.constructor=i};return s.prototype=e.prototype,i.prototype=new s,i.extend=a.inherits,t&&a.extend(i.prototype,t),i.__super__=e.prototype,i},a.noop=function(){},a.uid=function(){var t=0;return function(){return"chart-"+t++}}(),a.warn=function(t){console&&"function"==typeof console.warn&&console.warn(t)},a.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},a.almostEquals=function(t,e,i){return Math.abs(t-e)0?1:-1)},a.log10=function(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10},a.toRadians=function(t){return t*(Math.PI/180)},a.toDegrees=function(t){return t*(180/Math.PI)},a.getAngleFromPoint=function(t,e){var i=e.x-t.x,s=e.y-t.y,a=Math.sqrt(i*i+s*s),o=Math.atan2(s,i);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:a}},a.aliasPixel=function(t){return t%2===0?0:.5},a.splineCurve=function(t,e,i,s){var a=t.skip?e:t,o=e,n=i.skip?e:i,r=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),h=Math.sqrt(Math.pow(n.x-o.x,2)+Math.pow(n.y-o.y,2)),l=r/(r+h),c=h/(r+h);l=isNaN(l)?0:l,c=isNaN(c)?0:c;var u=s*l,d=s*c;return{previous:{x:o.x-u*(n.x-a.x),y:o.y-u*(n.y-a.y)},next:{x:o.x+d*(n.x-a.x),y:o.y+d*(n.y-a.y)}}},a.nextItem=function(t,e,i){return i?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},a.previousItem=function(t,e,i){return i?0>=e?t[t.length-1]:t[e-1]:0>=e?t[0]:t[e-1]},a.niceNum=function(t,e){var i,s=Math.floor(a.log10(t)),o=t/Math.pow(10,s);return i=e?1.5>o?1:3>o?2:7>o?5:10:1>=o?1:2>=o?2:5>=o?5:10,i*Math.pow(10,s)};var o=a.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2)); +},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,i=0,s=1;return 0===t?0:1===(t/=1)?1:(i||(i=.3),st?-.5*(s*Math.pow(2,10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/i)):s*Math.pow(2,-10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/i)*.5+1)},easeInBack:function(t){var e=1.70158;return 1*(t/=1)*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return 1*((t=t/1-1)*t*((e+1)*t+e)+1)},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:function(t){return 1-o.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?1*(7.5625*t*t):2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*o.easeInBounce(2*t):.5*o.easeOutBounce(2*t-1)+.5}};a.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),a.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),a.getRelativePosition=function(t,e){var i,s,o=t.originalEvent||t,n=t.currentTarget||t.srcElement,r=n.getBoundingClientRect();o.touches&&o.touches.length>0?(i=o.touches[0].clientX,s=o.touches[0].clientY):(i=o.clientX,s=o.clientY);var h=parseFloat(a.getStyle(n,"padding-left")),l=parseFloat(a.getStyle(n,"padding-top")),c=parseFloat(a.getStyle(n,"padding-right")),u=parseFloat(a.getStyle(n,"padding-bottom")),d=r.right-r.left-h-c,f=r.bottom-r.top-l-u;return i=Math.round((i-r.left-h)/d*n.width/e.currentDevicePixelRatio),s=Math.round((s-r.top-l)/f*n.height/e.currentDevicePixelRatio),{x:i,y:s}},a.addEvent=function(t,e,i){t.addEventListener?t.addEventListener(e,i):t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i},a.removeEvent=function(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=a.noop},a.bindEvents=function(t,e,i){t.events||(t.events={}),a.each(e,function(e){t.events[e]=function(){i.apply(t,arguments)},a.addEvent(t.chart.canvas,e,t.events[e])})},a.unbindEvents=function(t,e){a.each(e,function(e,i){a.removeEvent(t.chart.canvas,i,e)})},a.getConstraintWidth=function(t){return i(t,"max-width","clientWidth")},a.getConstraintHeight=function(t){return i(t,"max-height","clientHeight")},a.getMaximumWidth=function(t){var e=t.parentNode,i=parseInt(a.getStyle(e,"padding-left"))+parseInt(a.getStyle(e,"padding-right")),s=e.clientWidth-i,o=a.getConstraintWidth(t);return void 0!==o&&(s=Math.min(s,o)),s},a.getMaximumHeight=function(t){var e=t.parentNode,i=parseInt(a.getStyle(e,"padding-top"))+parseInt(a.getStyle(e,"padding-bottom")),s=e.clientHeight-i,o=a.getConstraintHeight(t);return void 0!==o&&(s=Math.min(s,o)),s},a.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},a.retinaScale=function(t){var e=t.ctx,i=t.canvas.width,s=t.canvas.height,a=t.currentDevicePixelRatio=window.devicePixelRatio||1;1!==a&&(e.canvas.height=s*a,e.canvas.width=i*a,e.scale(a,a),t.originalDevicePixelRatio=t.originalDevicePixelRatio||a),e.canvas.style.width=i+"px",e.canvas.style.height=s+"px"},a.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},a.fontString=function(t,e,i){return e+" "+t+"px "+i},a.longestText=function(t,e,i,s){s=s||{},s.data=s.data||{},s.garbageCollect=s.garbageCollect||[],s.font!==e&&(s.data={},s.garbageCollect=[],s.font=e),t.font=e;var o=0;a.each(i,function(e){if(void 0!==e&&null!==e){var i=s.data[e];i||(i=s.data[e]=t.measureText(e).width,s.garbageCollect.push(e)),i>o&&(o=i)}});var n=s.garbageCollect.length/2;if(n>i.length){for(var r=0;n>r;r++)delete s.data[s.garbageCollect[r]];s.garbageCollect.splice(0,n)}return o},a.drawRoundedRectangle=function(t,e,i,s,a,o){t.beginPath(),t.moveTo(e+o,i),t.lineTo(e+s-o,i),t.quadraticCurveTo(e+s,i,e+s,i+o),t.lineTo(e+s,i+a-o),t.quadraticCurveTo(e+s,i+a,e+s-o,i+a),t.lineTo(e+o,i+a),t.quadraticCurveTo(e,i+a,e,i+a-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath()},a.color=function(e){return s?s(e instanceof CanvasGradient?t.defaults.global.defaultColor:e):(console.log("Color.js not found!"),e)},a.addResizeListener=function(t,e){var i=document.createElement("iframe"),s="chartjs-hidden-iframe";i.classlist?i.classlist.add(s):i.setAttribute("class",s),i.style.width="100%",i.style.display="block",i.style.border=0,i.style.height=0,i.style.margin=0,i.style.position="absolute",i.style.left=0,i.style.right=0,i.style.top=0,i.style.bottom=0,t.insertBefore(i,t.firstChild),(i.contentWindow||i).onresize=function(){e&&e()}},a.removeResizeListener=function(t){var e=t.querySelector(".chartjs-hidden-iframe");e&&e.parentNode.removeChild(e)},a.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},a.pushAllIfDefined=function(t,e){"undefined"!=typeof t&&(a.isArray(t)?e.push.apply(e,t):e.push(t))},a.isDatasetVisible=function(t){return!t.hidden},a.callCallback=function(t,e,i){t&&"function"==typeof t.call&&t.apply(i,e)}}},{"chartjs-color":1}],26:[function(t,e,i){"use strict";e.exports=function(){var t=function(e,i){this.config=i,e.length&&e[0].getContext&&(e=e[0]),e.getContext&&(e=e.getContext("2d")),this.ctx=e,this.canvas=e.canvas,this.width=e.canvas.width||parseInt(t.helpers.getStyle(e.canvas,"width"))||t.helpers.getMaximumWidth(e.canvas),this.height=e.canvas.height||parseInt(t.helpers.getStyle(e.canvas,"height"))||t.helpers.getMaximumHeight(e.canvas),this.aspectRatio=this.width/this.height,(isNaN(this.aspectRatio)||isFinite(this.aspectRatio)===!1)&&(this.aspectRatio=void 0!==i.aspectRatio?i.aspectRatio:2),this.originalCanvasStyleWidth=e.canvas.style.width,this.originalCanvasStyleHeight=e.canvas.style.height,t.helpers.retinaScale(this),i&&(this.controller=new t.Controller(this));var s=this;return t.helpers.addResizeListener(e.canvas.parentNode,function(){s.controller&&s.controller.config.options.responsive&&s.controller.resize()}),this.controller?this.controller:this};return t.defaults={global:{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"single",animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},legendCallback:function(t){var e=[];e.push('
      ');for(var i=0;i'),t.data.datasets[i].label&&e.push(t.data.datasets[i].label),e.push("");return e.push("
    "),e.join("")}}},t}},{}],27:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.layoutService={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),t.boxes.push(e)},removeBox:function(t,e){t.boxes&&t.boxes.splice(t.boxes.indexOf(e),1)},update:function(t,i,s){function a(t){var e,i=t.isHorizontal();i?(e=t.update(t.options.fullWidth?g:k,y),_-=e.height):(e=t.update(x,v),k-=e.width),D.push({horizontal:i,minSize:e,box:t})}function o(t){var i=e.findNextWhere(D,function(e){return e.box===t});if(i)if(t.isHorizontal()){var s={left:S,right:w,top:0,bottom:0};t.update(t.options.fullWidth?g:k,p/2,s)}else t.update(i.minSize.width,_)}function n(t){var i=e.findNextWhere(D,function(e){return e.box===t}),s={left:0,right:0,top:C,bottom:M};i&&t.update(i.minSize.width,_,s)}function r(t){t.isHorizontal()?(t.left=t.options.fullWidth?h:S,t.right=t.options.fullWidth?i-h:S+k,t.top=F,t.bottom=F+t.height,F=t.bottom):(t.left=T,t.right=T+t.width,t.top=C,t.bottom=C+_,T=t.right)}if(t){var h=0,l=0,c=e.where(t.boxes,function(t){return"left"===t.options.position}),u=e.where(t.boxes,function(t){return"right"===t.options.position}),d=e.where(t.boxes,function(t){return"top"===t.options.position}),f=e.where(t.boxes,function(t){return"bottom"===t.options.position}),m=e.where(t.boxes,function(t){return"chartArea"===t.options.position});d.sort(function(t,e){return(e.options.fullWidth?1:0)-(t.options.fullWidth?1:0)}),f.sort(function(t,e){return(t.options.fullWidth?1:0)-(e.options.fullWidth?1:0)});var g=i-2*h,p=s-2*l,b=g/2,v=p/2,x=(i-b)/(c.length+u.length),y=(s-v)/(d.length+f.length),k=g,_=p,D=[];e.each(c.concat(u,d,f),a);var S=h,w=h,C=l,M=l;e.each(c.concat(u),o),e.each(c,function(t){S+=t.width}),e.each(u,function(t){w+=t.width}),e.each(d.concat(f),o),e.each(d,function(t){C+=t.height}),e.each(f,function(t){M+=t.height}),e.each(c.concat(u),n),S=h,w=h,C=l,M=l,e.each(c,function(t){S+=t.width}),e.each(u,function(t){w+=t.width}),e.each(d,function(t){C+=t.height}),e.each(f,function(t){M+=t.height});var A=s-C-M,I=i-S-w;(I!==k||A!==_)&&(e.each(c,function(t){t.height=A}),e.each(u,function(t){t.height=A}),e.each(d,function(t){t.options.fullWidth||(t.width=I)}),e.each(f,function(t){t.options.fullWidth||(t.width=I)}),_=A,k=I);var T=h,F=l;e.each(c.concat(d),r),T+=k,F+=_,e.each(u,r),e.each(f,r),t.chartArea={left:S,top:C,right:S+k,bottom:C+_},e.each(m,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(k,_)})}}}}},{}],28:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.global.legend={display:!0,position:"top",fullWidth:!0,reverse:!1,onClick:function(t,e){var i=this.chart.data.datasets[e.datasetIndex];i.hidden=!i.hidden,this.chart.update()},labels:{boxWidth:40,padding:10,generateLabels:function(t){return e.isArray(t.datasets)?t.datasets.map(function(t,e){return{text:t.label,fillStyle:t.backgroundColor,hidden:t.hidden,lineCap:t.borderCapStyle,lineDash:t.borderDash,lineDashOffset:t.borderDashOffset,lineJoin:t.borderJoinStyle,lineWidth:t.borderWidth,strokeStyle:t.borderColor,datasetIndex:e}},this):[]}}},t.Legend=t.Element.extend({initialize:function(t){e.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:e.noop,update:function(t,e,i){return this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this.margins=i,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this.beforeBuildLabels(),this.buildLabels(),this.afterBuildLabels(),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate(),this.minSize},afterUpdate:e.noop,beforeSetDimensions:e.noop,setDimensions:function(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0,this.minSize={width:0,height:0}},afterSetDimensions:e.noop,beforeBuildLabels:e.noop,buildLabels:function(){this.legendItems=this.options.labels.generateLabels.call(this,this.chart.data),this.options.reverse&&this.legendItems.reverse()},afterBuildLabels:e.noop,beforeFit:e.noop,fit:function(){var i=this.ctx,s=e.getValueOrDefault(this.options.labels.fontSize,t.defaults.global.defaultFontSize),a=e.getValueOrDefault(this.options.labels.fontStyle,t.defaults.global.defaultFontStyle),o=e.getValueOrDefault(this.options.labels.fontFamily,t.defaults.global.defaultFontFamily),n=e.fontString(s,a,o);if(this.legendHitBoxes=[],this.isHorizontal()?this.minSize.width=this.maxWidth:this.minSize.width=this.options.display?10:0,this.isHorizontal()?this.minSize.height=this.options.display?10:0:this.minSize.height=this.maxHeight,this.options.display&&this.isHorizontal()){this.lineWidths=[0];var r=this.legendItems.length?s+this.options.labels.padding:0;i.textAlign="left",i.textBaseline="top",i.font=n,e.each(this.legendItems,function(t,e){var a=this.options.labels.boxWidth+s/2+i.measureText(t.text).width;this.lineWidths[this.lineWidths.length-1]+a+this.options.labels.padding>=this.width&&(r+=s+this.options.labels.padding,this.lineWidths[this.lineWidths.length]=this.left),this.legendHitBoxes[e]={left:0,top:0,width:a,height:s},this.lineWidths[this.lineWidths.length-1]+=a+this.options.labels.padding},this),this.minSize.height+=r}this.width=this.minSize.width,this.height=this.minSize.height},afterFit:e.noop,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){if(this.options.display){var i=this.ctx,s={x:this.left+(this.width-this.lineWidths[0])/2,y:this.top+this.options.labels.padding,line:0},a=e.getValueOrDefault(this.options.labels.fontColor,t.defaults.global.defaultFontColor),o=e.getValueOrDefault(this.options.labels.fontSize,t.defaults.global.defaultFontSize),n=e.getValueOrDefault(this.options.labels.fontStyle,t.defaults.global.defaultFontStyle),r=e.getValueOrDefault(this.options.labels.fontFamily,t.defaults.global.defaultFontFamily),h=e.fontString(o,n,r);this.isHorizontal()&&(i.textAlign="left",i.textBaseline="top",i.lineWidth=.5,i.strokeStyle=a,i.fillStyle=a,i.font=h,e.each(this.legendItems,function(e,a){var n=i.measureText(e.text).width,r=this.options.labels.boxWidth+o/2+n;s.x+r>=this.width&&(s.y+=o+this.options.labels.padding,s.line++,s.x=this.left+(this.width-this.lineWidths[s.line])/2),i.save();var h=function(t,e){return void 0!==t?t:e};i.fillStyle=h(e.fillStyle,t.defaults.global.defaultColor),i.lineCap=h(e.lineCap,t.defaults.global.elements.line.borderCapStyle),i.lineDashOffset=h(e.lineDashOffset,t.defaults.global.elements.line.borderDashOffset),i.lineJoin=h(e.lineJoin,t.defaults.global.elements.line.borderJoinStyle),i.lineWidth=h(e.lineWidth,t.defaults.global.elements.line.borderWidth),i.strokeStyle=h(e.strokeStyle,t.defaults.global.defaultColor),i.setLineDash&&i.setLineDash(h(e.lineDash,t.defaults.global.elements.line.borderDash)),i.strokeRect(s.x,s.y,this.options.labels.boxWidth,o),i.fillRect(s.x,s.y,this.options.labels.boxWidth,o),i.restore(),this.legendHitBoxes[a].left=s.x,this.legendHitBoxes[a].top=s.y,i.fillText(e.text,this.options.labels.boxWidth+o/2+s.x,s.y),e.hidden&&(i.beginPath(),i.lineWidth=2,i.moveTo(this.options.labels.boxWidth+o/2+s.x,s.y+o/2),i.lineTo(this.options.labels.boxWidth+o/2+s.x+n,s.y+o/2),i.stroke()),s.x+=r+this.options.labels.padding},this))}},handleEvent:function(t){var i=e.getRelativePosition(t,this.chart.chart);if(i.x>=this.left&&i.x<=this.right&&i.y>=this.top&&i.y<=this.bottom)for(var s=0;s=a.left&&i.x<=a.left+a.width&&i.y>=a.top&&i.y<=a.top+a.height){this.options.onClick&&this.options.onClick.call(this,t,this.legendItems[s]);break}}}})}},{}],29:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.plugins=[],t.pluginService={register:function(e){-1===t.plugins.indexOf(e)&&t.plugins.push(e)},remove:function(e){var i=t.plugins.indexOf(e);-1!==i&&t.plugins.splice(i,1)},notifyPlugins:function(i,s,a){e.each(t.plugins,function(t){t[i]&&"function"==typeof t[i]&&t[i].apply(a,s)},a)}},t.PluginBase=t.Element.extend({beforeInit:e.noop,afterInit:e.noop,beforeUpdate:e.noop,afterUpdate:e.noop,beforeDraw:e.noop,afterDraw:e.noop,destroy:e.noop})}},{}],30:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.scale={display:!0,gridLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",offsetGridLines:!1},scaleLabel:{labelString:"",display:!1},ticks:{beginAtZero:!1,maxRotation:50,mirror:!1,padding:10,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,callback:function(t){return""+t}}},t.Scale=t.Element.extend({beforeUpdate:function(){e.callCallback(this.options.beforeUpdate,[this])},update:function(t,i,s){return this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,this.margins=e.extend({left:0,right:0,top:0,bottom:0},s),this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this.beforeBuildTicks(),this.buildTicks(),this.afterBuildTicks(),this.beforeTickToLabelConversion(),this.convertTicksToLabels(),this.afterTickToLabelConversion(),this.beforeCalculateTickRotation(),this.calculateTickRotation(),this.afterCalculateTickRotation(),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate(),this.minSize},afterUpdate:function(){e.callCallback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){e.callCallback(this.options.beforeSetDimensions,[this])},setDimensions:function(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0},afterSetDimensions:function(){e.callCallback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){e.callCallback(this.options.beforeDataLimits,[this])},determineDataLimits:e.noop,afterDataLimits:function(){e.callCallback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){e.callCallback(this.options.beforeBuildTicks,[this])},buildTicks:e.noop,afterBuildTicks:function(){e.callCallback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){e.callCallback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){this.ticks=this.ticks.map(function(t,e,i){return this.options.ticks.userCallback?this.options.ticks.userCallback(t,e,i):this.options.ticks.callback(t,e,i)},this)},afterTickToLabelConversion:function(){e.callCallback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){e.callCallback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var i=e.getValueOrDefault(this.options.ticks.fontSize,t.defaults.global.defaultFontSize),s=e.getValueOrDefault(this.options.ticks.fontStyle,t.defaults.global.defaultFontStyle),a=e.getValueOrDefault(this.options.ticks.fontFamily,t.defaults.global.defaultFontFamily),o=e.fontString(i,s,a);this.ctx.font=o;var n,r=this.ctx.measureText(this.ticks[0]).width,h=this.ctx.measureText(this.ticks[this.ticks.length-1]).width;if(this.labelRotation=0,this.paddingRight=0,this.paddingLeft=0,this.options.display&&this.isHorizontal()){this.paddingRight=h/2+3,this.paddingLeft=r/2+3,this.longestTextCache||(this.longestTextCache={});for(var l,c,u=e.longestText(this.ctx,o,this.ticks,this.longestTextCache),d=u,f=this.getPixelForTick(1)-this.getPixelForTick(0)-6;d>f&&this.labelRotationthis.yLabelWidth&&(this.paddingLeft=n+i/2),this.paddingRight=i/2,c*u>this.maxHeight){this.labelRotation--;break}this.labelRotation++,d=l*u}}this.margins&&(this.paddingLeft=Math.max(this.paddingLeft-this.margins.left,0),this.paddingRight=Math.max(this.paddingRight-this.margins.right,0))},afterCalculateTickRotation:function(){e.callCallback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){e.callCallback(this.options.beforeFit,[this])},fit:function(){this.minSize={width:0,height:0};var i=e.getValueOrDefault(this.options.ticks.fontSize,t.defaults.global.defaultFontSize),s=e.getValueOrDefault(this.options.ticks.fontStyle,t.defaults.global.defaultFontStyle),a=e.getValueOrDefault(this.options.ticks.fontFamily,t.defaults.global.defaultFontFamily),o=e.fontString(i,s,a),n=e.getValueOrDefault(this.options.scaleLabel.fontSize,t.defaults.global.defaultFontSize),r=e.getValueOrDefault(this.options.scaleLabel.fontStyle,t.defaults.global.defaultFontStyle),h=e.getValueOrDefault(this.options.scaleLabel.fontFamily,t.defaults.global.defaultFontFamily);e.fontString(n,r,h);if(this.isHorizontal()?this.minSize.width=this.isFullWidth()?this.maxWidth-this.margins.left-this.margins.right:this.maxWidth:this.minSize.width=this.options.gridLines.tickMarkLength,this.isHorizontal()?this.minSize.height=this.options.gridLines.tickMarkLength:this.minSize.height=this.maxHeight,this.options.scaleLabel.display&&(this.isHorizontal()?this.minSize.height+=1.5*n:this.minSize.width+=1.5*n),this.options.ticks.display&&this.options.display){this.longestTextCache||(this.longestTextCache={});var l=e.longestText(this.ctx,o,this.ticks,this.longestTextCache);if(this.isHorizontal()){this.longestLabelWidth=l;var c=Math.sin(e.toRadians(this.labelRotation))*this.longestLabelWidth+1.5*i;this.minSize.height=Math.min(this.maxHeight,this.minSize.height+c),this.ctx.font=o;var u=this.ctx.measureText(this.ticks[0]).width,d=this.ctx.measureText(this.ticks[this.ticks.length-1]).width,f=Math.cos(e.toRadians(this.labelRotation)),m=Math.sin(e.toRadians(this.labelRotation));this.paddingLeft=0!==this.labelRotation?f*u+3:u/2+3,this.paddingRight=0!==this.labelRotation?m*(i/2)+3:d/2+3}else{var g=this.maxWidth-this.minSize.width;this.options.ticks.mirror||(l+=this.options.ticks.padding),g>l?this.minSize.width+=l:this.minSize.width=this.maxWidth,this.paddingTop=i/2,this.paddingBottom=i/2}}this.margins&&(this.paddingLeft=Math.max(this.paddingLeft-this.margins.left,0),this.paddingTop=Math.max(this.paddingTop-this.margins.top,0),this.paddingRight=Math.max(this.paddingRight-this.margins.right,0),this.paddingBottom=Math.max(this.paddingBottom-this.margins.bottom,0)),this.width=this.minSize.width,this.height=this.minSize.height},afterFit:function(){e.callCallback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function i(t){return null===t||"undefined"==typeof t?NaN:"number"==typeof t&&isNaN(t)?NaN:"object"==typeof t?t instanceof Date?t:i(this.isHorizontal()?t.x:t.y):t},getLabelForIndex:e.noop,getPixelForValue:e.noop,getPixelForTick:function(t,e){if(this.isHorizontal()){var i=this.width-(this.paddingLeft+this.paddingRight),s=i/Math.max(this.ticks.length-(this.options.gridLines.offsetGridLines?0:1),1),a=s*t+this.paddingLeft;e&&(a+=s/2);var o=this.left+Math.round(a);return o+=this.isFullWidth()?this.margins.left:0}var n=this.height-(this.paddingTop+this.paddingBottom);return this.top+t*(n/(this.ticks.length-1))},getPixelForDecimal:function(t){if(this.isHorizontal()){var e=this.width-(this.paddingLeft+this.paddingRight),i=e*t+this.paddingLeft,s=this.left+Math.round(i);return s+=this.isFullWidth()?this.margins.left:0}return this.top+t*this.height},draw:function(i){if(this.options.display){var s,a,o,n,r,h=0!==this.labelRotation,l=this.options.ticks.autoSkip;this.options.ticks.maxTicksLimit&&(r=this.options.ticks.maxTicksLimit);var c=e.getValueOrDefault(this.options.ticks.fontColor,t.defaults.global.defaultFontColor),u=e.getValueOrDefault(this.options.ticks.fontSize,t.defaults.global.defaultFontSize),d=e.getValueOrDefault(this.options.ticks.fontStyle,t.defaults.global.defaultFontStyle),f=e.getValueOrDefault(this.options.ticks.fontFamily,t.defaults.global.defaultFontFamily),m=e.fontString(u,d,f),g=this.options.gridLines.tickMarkLength,p=e.getValueOrDefault(this.options.scaleLabel.fontColor,t.defaults.global.defaultFontColor),b=e.getValueOrDefault(this.options.scaleLabel.fontSize,t.defaults.global.defaultFontSize),v=e.getValueOrDefault(this.options.scaleLabel.fontStyle,t.defaults.global.defaultFontStyle),x=e.getValueOrDefault(this.options.scaleLabel.fontFamily,t.defaults.global.defaultFontFamily),y=e.fontString(b,v,x),k=Math.cos(e.toRadians(this.labelRotation)),_=(Math.sin(e.toRadians(this.labelRotation)),this.longestLabelWidth*k);if(this.ctx.fillStyle=c,this.isHorizontal()){s=!0;var D="bottom"===this.options.position?this.top:this.bottom-g,S="bottom"===this.options.position?this.top+g:this.bottom;if(a=!1,(_/2+this.options.ticks.autoSkipPadding)*this.ticks.length>this.width-(this.paddingLeft+this.paddingRight)&&(a=1+Math.floor((_/2+this.options.ticks.autoSkipPadding)*this.ticks.length/(this.width-(this.paddingLeft+this.paddingRight)))),r&&this.ticks.length>r)for(;!a||this.ticks.length/(a||1)>r;)a||(a=1),a+=1;l||(a=!1),e.each(this.ticks,function(t,o){var n=this.ticks.length===o+1,r=a>1&&o%a>0||o%a===0&&o+a>this.ticks.length;if((!r||n)&&void 0!==t&&null!==t){var l=this.getPixelForTick(o),c=this.getPixelForTick(o,this.options.gridLines.offsetGridLines);this.options.gridLines.display&&(o===("undefined"!=typeof this.zeroLineIndex?this.zeroLineIndex:0)?(this.ctx.lineWidth=this.options.gridLines.zeroLineWidth,this.ctx.strokeStyle=this.options.gridLines.zeroLineColor,s=!0):s&&(this.ctx.lineWidth=this.options.gridLines.lineWidth,this.ctx.strokeStyle=this.options.gridLines.color,s=!1),l+=e.aliasPixel(this.ctx.lineWidth),this.ctx.beginPath(),this.options.gridLines.drawTicks&&(this.ctx.moveTo(l,D),this.ctx.lineTo(l,S)),this.options.gridLines.drawOnChartArea&&(this.ctx.moveTo(l,i.top),this.ctx.lineTo(l,i.bottom)),this.ctx.stroke()),this.options.ticks.display&&(this.ctx.save(),this.ctx.translate(c,h?this.top+12:"top"===this.options.position?this.bottom-g:this.top+g),this.ctx.rotate(-1*e.toRadians(this.labelRotation)),this.ctx.font=m,this.ctx.textAlign=h?"right":"center",this.ctx.textBaseline=h?"middle":"top"===this.options.position?"bottom":"top",this.ctx.fillText(t,0,0),this.ctx.restore())}},this),this.options.scaleLabel.display&&(this.ctx.textAlign="center",this.ctx.textBaseline="middle",this.ctx.fillStyle=p,this.ctx.font=y,o=this.left+(this.right-this.left)/2,n="bottom"===this.options.position?this.bottom-b/2:this.top+b/2,this.ctx.fillText(this.options.scaleLabel.labelString,o,n))}else{s=!0;var w="right"===this.options.position?this.left:this.right-5,C="right"===this.options.position?this.left+5:this.right;if(e.each(this.ticks,function(t,a){if(void 0!==t&&null!==t){var o=this.getPixelForTick(a);if(this.options.gridLines.display&&(a===("undefined"!=typeof this.zeroLineIndex?this.zeroLineIndex:0)?(this.ctx.lineWidth=this.options.gridLines.zeroLineWidth,this.ctx.strokeStyle=this.options.gridLines.zeroLineColor,s=!0):s&&(this.ctx.lineWidth=this.options.gridLines.lineWidth,this.ctx.strokeStyle=this.options.gridLines.color,s=!1),o+=e.aliasPixel(this.ctx.lineWidth),this.ctx.beginPath(),this.options.gridLines.drawTicks&&(this.ctx.moveTo(w,o),this.ctx.lineTo(C,o)),this.options.gridLines.drawOnChartArea&&(this.ctx.moveTo(i.left,o),this.ctx.lineTo(i.right,o)),this.ctx.stroke()),this.options.ticks.display){var n,r=this.getPixelForTick(a,this.options.gridLines.offsetGridLines);this.ctx.save(),"left"===this.options.position?this.options.ticks.mirror?(n=this.right+this.options.ticks.padding,this.ctx.textAlign="left"):(n=this.right-this.options.ticks.padding,this.ctx.textAlign="right"):this.options.ticks.mirror?(n=this.left-this.options.ticks.padding,this.ctx.textAlign="right"):(n=this.left+this.options.ticks.padding,this.ctx.textAlign="left"),this.ctx.translate(n,r),this.ctx.rotate(-1*e.toRadians(this.labelRotation)),this.ctx.font=m,this.ctx.textBaseline="middle",this.ctx.fillText(t,0,0),this.ctx.restore()}}},this),this.options.scaleLabel.display){o="left"===this.options.position?this.left+b/2:this.right-b/2,n=this.top+(this.bottom-this.top)/2;var M="left"===this.options.position?-.5*Math.PI:.5*Math.PI;this.ctx.save(),this.ctx.translate(o,n),this.ctx.rotate(M),this.ctx.textAlign="center",this.ctx.fillStyle=p,this.ctx.font=y,this.ctx.textBaseline="middle",this.ctx.fillText(this.options.scaleLabel.labelString,0,0),this.ctx.restore()}}this.ctx.lineWidth=this.options.gridLines.lineWidth,this.ctx.strokeStyle=this.options.gridLines.color;var A=this.left,I=this.right,T=this.top,F=this.bottom;this.isHorizontal()?(T=F="top"===this.options.position?this.bottom:this.top,T+=e.aliasPixel(this.ctx.lineWidth),F+=e.aliasPixel(this.ctx.lineWidth)):(A=I="left"===this.options.position?this.right:this.left,A+=e.aliasPixel(this.ctx.lineWidth),I+=e.aliasPixel(this.ctx.lineWidth)),this.ctx.beginPath(),this.ctx.moveTo(A,T),this.ctx.lineTo(I,F),this.ctx.stroke()}}})}},{}],31:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.scaleService={constructors:{},defaults:{},registerScaleType:function(t,i,s){this.constructors[t]=i,this.defaults[t]=e.clone(s)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(i){return this.defaults.hasOwnProperty(i)?e.scaleMerge(t.defaults.scale,this.defaults[i]):{}},addScalesToLayout:function(i){e.each(i.scales,function(e){t.layoutService.addBox(i,e)})}}}},{}],32:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.global.title={display:!1,position:"top",fullWidth:!0,fontStyle:"bold",padding:10,text:""},t.Title=t.Element.extend({initialize:function(i){e.extend(this,i),this.options=e.configMerge(t.defaults.global.title,i.options),this.legendHitBoxes=[]},beforeUpdate:e.noop,update:function(t,e,i){return this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this.margins=i,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this.beforeBuildLabels(),this.buildLabels(),this.afterBuildLabels(),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate(),this.minSize},afterUpdate:e.noop,beforeSetDimensions:e.noop,setDimensions:function(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0,this.minSize={width:0,height:0}},afterSetDimensions:e.noop,beforeBuildLabels:e.noop,buildLabels:e.noop,afterBuildLabels:e.noop,beforeFit:e.noop,fit:function(){var i=(this.ctx,e.getValueOrDefault(this.options.fontSize,t.defaults.global.defaultFontSize)),s=e.getValueOrDefault(this.options.fontStyle,t.defaults.global.defaultFontStyle),a=e.getValueOrDefault(this.options.fontFamily,t.defaults.global.defaultFontFamily);e.fontString(i,s,a);this.isHorizontal()?this.minSize.width=this.maxWidth:this.minSize.width=0,this.isHorizontal()?this.minSize.height=0:this.minSize.height=this.maxHeight,this.isHorizontal()?this.options.display&&(this.minSize.height+=i+2*this.options.padding):this.options.display&&(this.minSize.width+=i+2*this.options.padding),this.width=this.minSize.width,this.height=this.minSize.height},afterFit:e.noop,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){if(this.options.display){var i,s,a=this.ctx,o=e.getValueOrDefault(this.options.fontColor,t.defaults.global.defaultFontColor),n=e.getValueOrDefault(this.options.fontSize,t.defaults.global.defaultFontSize),r=e.getValueOrDefault(this.options.fontStyle,t.defaults.global.defaultFontStyle),h=e.getValueOrDefault(this.options.fontFamily,t.defaults.global.defaultFontFamily),l=e.fontString(n,r,h);if(a.fillStyle=o,a.font=l,this.isHorizontal())a.textAlign="center",a.textBaseline="middle",i=this.left+(this.right-this.left)/2,s=this.top+(this.bottom-this.top)/2,a.fillText(this.options.text,i,s);else{ +i="left"===this.options.position?this.left+n/2:this.right-n/2,s=this.top+(this.bottom-this.top)/2;var c="left"===this.options.position?-.5*Math.PI:.5*Math.PI;a.save(),a.translate(i,s),a.rotate(c),a.textAlign="center",a.textBaseline="middle",a.fillText(this.options.text,0,0),a.restore()}}}})}},{}],33:[function(t,e,i){"use strict";e.exports=function(t){function e(t,e){return e&&(i.isArray(e)?t=t.concat(e):t.push(e)),t}var i=t.helpers;t.defaults.global.tooltips={enabled:!0,custom:null,mode:"single",backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleColor:"#fff",titleAlign:"left",bodySpacing:2,bodyColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,yAlign:"center",xAlign:"center",caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",callbacks:{beforeTitle:i.noop,title:function(t,e){var i="";return t.length>0&&(t[0].xLabel?i=t[0].xLabel:e.labels.length>0&&t[0].indexthis._chart.height-t.height&&(this._model.yAlign="bottom");var e,i,s,a,o,n=this,r=(this._chartInstance.chartArea.left+this._chartInstance.chartArea.right)/2,h=(this._chartInstance.chartArea.top+this._chartInstance.chartArea.bottom)/2;"center"===this._model.yAlign?(e=function(t){return r>=t},i=function(t){return t>r}):(e=function(e){return e<=t.width/2},i=function(e){return e>=n._chart.width-t.width/2}),s=function(e){return e+t.width>n._chart.width},a=function(e){return e-t.width<0},o=function(t){return h>=t?"top":"bottom"},e(this._model.x)?(this._model.xAlign="left",s(this._model.x)&&(this._model.xAlign="center",this._model.yAlign=o(this._model.y))):i(this._model.x)&&(this._model.xAlign="right",a(this._model.x)&&(this._model.xAlign="center",this._model.yAlign=o(this._model.y)))},getBackgroundPoint:function(t,e){var i={x:t.x,y:t.y};return"right"===t.xAlign?i.x-=e.width:"center"===t.xAlign&&(i.x-=e.width/2),"top"===t.yAlign?i.y+=t.caretPadding+t.caretSize:"bottom"===t.yAlign?i.y-=e.height+t.caretPadding+t.caretSize:i.y-=e.height/2,"center"===t.yAlign?"left"===t.xAlign?i.x+=t.caretPadding+t.caretSize:"right"===t.xAlign&&(i.x-=t.caretPadding+t.caretSize):"left"===t.xAlign?i.x-=t.cornerRadius+t.caretPadding:"right"===t.xAlign&&(i.x+=t.cornerRadius+t.caretPadding),i},drawCaret:function(t,e,s,a){var o,n,r,h,l,c,u=this._view,d=this._chart.ctx;"center"===u.yAlign?("left"===u.xAlign?(o=t.x,n=o-u.caretSize,r=o):(o=t.x+e.width,n=o+u.caretSize,r=o),l=t.y+e.height/2,h=l-u.caretSize,c=l+u.caretSize):("left"===u.xAlign?(o=t.x+u.cornerRadius,n=o+u.caretSize,r=n+u.caretSize):"right"===u.xAlign?(o=t.x+e.width-u.cornerRadius,n=o-u.caretSize,r=n-u.caretSize):(n=t.x+e.width/2,o=n-u.caretSize,r=n+u.caretSize),"top"===u.yAlign?(h=t.y,l=h-u.caretSize,c=h):(h=t.y+e.height,l=h+u.caretSize,c=h));var f=i.color(u.backgroundColor);d.fillStyle=f.alpha(s*f.alpha()).rgbString(),d.beginPath(),d.moveTo(o,h),d.lineTo(n,l),d.lineTo(r,c),d.closePath(),d.fill()},drawTitle:function(t,e,s,a){if(e.title.length){s.textAlign=e._titleAlign,s.textBaseline="top";var o=i.color(e.titleColor);s.fillStyle=o.alpha(a*o.alpha()).rgbString(),s.font=i.fontString(e.titleFontSize,e._titleFontStyle,e._titleFontFamily),i.each(e.title,function(i,a){s.fillText(i,t.x,t.y),t.y+=e.titleFontSize+e.titleSpacing,a+1===e.title.length&&(t.y+=e.titleMarginBottom-e.titleSpacing)})}},drawBody:function(t,e,s,a){s.textAlign=e._bodyAlign,s.textBaseline="top";var o=i.color(e.bodyColor);s.fillStyle=o.alpha(a*o.alpha()).rgbString(),s.font=i.fontString(e.bodyFontSize,e._bodyFontStyle,e._bodyFontFamily),i.each(e.beforeBody,function(i){s.fillText(i,t.x,t.y),t.y+=e.bodyFontSize+e.bodySpacing}),i.each(e.body,function(o,n){"single"!==this._options.tooltips.mode&&(s.fillStyle=i.color(e.legendColorBackground).alpha(a).rgbaString(),s.fillRect(t.x,t.y,e.bodyFontSize,e.bodyFontSize),s.strokeStyle=i.color(e.labelColors[n].borderColor).alpha(a).rgbaString(),s.strokeRect(t.x,t.y,e.bodyFontSize,e.bodyFontSize),s.fillStyle=i.color(e.labelColors[n].backgroundColor).alpha(a).rgbaString(),s.fillRect(t.x+1,t.y+1,e.bodyFontSize-2,e.bodyFontSize-2),s.fillStyle=i.color(e.bodyColor).alpha(a).rgbaString()),s.fillText(o,t.x+("single"!==this._options.tooltips.mode?e.bodyFontSize+2:0),t.y),t.y+=e.bodyFontSize+e.bodySpacing},this),i.each(e.afterBody,function(i){s.fillText(i,t.x,t.y),t.y+=e.bodyFontSize}),t.y-=e.bodySpacing},drawFooter:function(t,e,s,a){if(e.footer.length){t.y+=e.footerMarginTop,s.textAlign=e._footerAlign,s.textBaseline="top";var o=i.color(e.footerColor);s.fillStyle=o.alpha(a*o.alpha()).rgbString(),s.font=i.fontString(e.footerFontSize,e._footerFontStyle,e._footerFontFamily),i.each(e.footer,function(i){s.fillText(i,t.x,t.y),t.y+=e.footerFontSize+e.footerSpacing})}},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var s=e.caretPadding,a=this.getTooltipSize(e),o={x:e.x,y:e.y},n=Math.abs(e.opacity<.001)?0:e.opacity;if(this._options.tooltips.enabled){var r=i.color(e.backgroundColor);t.fillStyle=r.alpha(n*r.alpha()).rgbString(),i.drawRoundedRectangle(t,o.x,o.y,a.width,a.height,e.cornerRadius),t.fill(),this.drawCaret(o,a,n,s),o.x+=e.xPadding,o.y+=e.yPadding,this.drawTitle(o,e,t,n),this.drawBody(o,e,t,n),this.drawFooter(o,e,t,n)}}}})}},{}],34:[function(t,e,i){"use strict";e.exports=function(t,e){var i=t.helpers;t.defaults.global.elements.arc={backgroundColor:t.defaults.global.defaultColor,borderColor:"#fff",borderWidth:2},t.elements.Arc=t.Element.extend({inLabelRange:function(t){var e=this._view;return e?Math.pow(t-e.x,2)n;)n+=2*Math.PI;for(;a.angle>n;)a.angle-=2*Math.PI;for(;a.angle=o&&a.angle<=n,h=a.distance>=s.innerRadius&&a.distance<=s.outerRadius;return r&&h}return!1},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t=this._chart.ctx,e=this._view;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,e.startAngle,e.endAngle),t.arc(e.x,e.y,e.innerRadius,e.endAngle,e.startAngle,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})}},{}],35:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.global.elements.line={tension:.4,backgroundColor:t.defaults.global.defaultColor,borderWidth:3,borderColor:t.defaults.global.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",fill:!0},t.elements.Line=t.Element.extend({lineToNextPoint:function(t,e,i,s,a){var o=this._chart.ctx;e._view.skip?s.call(this,t,e,i):t._view.skip?a.call(this,t,e,i):0===e._view.tension?o.lineTo(e._view.x,e._view.y):o.bezierCurveTo(t._view.controlPointNextX,t._view.controlPointNextY,e._view.controlPointPreviousX,e._view.controlPointPreviousY,e._view.x,e._view.y)},draw:function(){function i(t){n._view.skip||r._view.skip?t&&o.lineTo(s._view.scaleZero.x,s._view.scaleZero.y):o.bezierCurveTo(r._view.controlPointNextX,r._view.controlPointNextY,n._view.controlPointPreviousX,n._view.controlPointPreviousY,n._view.x,n._view.y)}var s=this,a=this._view,o=this._chart.ctx,n=this._children[0],r=this._children[this._children.length-1];o.save(),this._children.length>0&&a.fill&&(o.beginPath(),e.each(this._children,function(t,i){var s=e.previousItem(this._children,i),n=e.nextItem(this._children,i);0===i?(this._loop?o.moveTo(a.scaleZero.x,a.scaleZero.y):o.moveTo(t._view.x,a.scaleZero),t._view.skip?this._loop||o.moveTo(n._view.x,this._view.scaleZero):o.lineTo(t._view.x,t._view.y)):this.lineToNextPoint(s,t,n,function(t,e,i){this._loop?o.lineTo(this._view.scaleZero.x,this._view.scaleZero.y):(o.lineTo(t._view.x,this._view.scaleZero),o.moveTo(i._view.x,this._view.scaleZero))},function(t,e){o.lineTo(e._view.x,e._view.y)})},this),this._loop?i(!0):(o.lineTo(this._children[this._children.length-1]._view.x,a.scaleZero),o.lineTo(this._children[0]._view.x,a.scaleZero)),o.fillStyle=a.backgroundColor||t.defaults.global.defaultColor,o.closePath(),o.fill()),o.lineCap=a.borderCapStyle||t.defaults.global.elements.line.borderCapStyle,o.setLineDash&&o.setLineDash(a.borderDash||t.defaults.global.elements.line.borderDash),o.lineDashOffset=a.borderDashOffset||t.defaults.global.elements.line.borderDashOffset,o.lineJoin=a.borderJoinStyle||t.defaults.global.elements.line.borderJoinStyle,o.lineWidth=a.borderWidth||t.defaults.global.elements.line.borderWidth,o.strokeStyle=a.borderColor||t.defaults.global.defaultColor,o.beginPath(),e.each(this._children,function(t,i){var s=e.previousItem(this._children,i),a=e.nextItem(this._children,i);0===i?o.moveTo(t._view.x,t._view.y):this.lineToNextPoint(s,t,a,function(t,e,i){o.moveTo(i._view.x,i._view.y)},function(t,e){o.moveTo(e._view.x,e._view.y)})},this),this._loop&&this._children.length>0&&i(),o.stroke(),o.restore()}})}},{}],36:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.global.elements.point={radius:3,pointStyle:"circle",backgroundColor:t.defaults.global.defaultColor,borderWidth:1,borderColor:t.defaults.global.defaultColor,hitRadius:1,hoverRadius:4,hoverBorderWidth:1},t.elements.Point=t.Element.extend({inRange:function(t,e){var i=this._view;if(i){var s=i.hitRadius+i.radius;return Math.pow(t-i.x,2)+Math.pow(e-i.y,2)0){s.strokeStyle=i.borderColor||t.defaults.global.defaultColor,s.lineWidth=e.getValueOrDefault(i.borderWidth,t.defaults.global.elements.point.borderWidth),s.fillStyle=i.backgroundColor||t.defaults.global.defaultColor;var a,o,n=i.radius;switch(i.pointStyle){default:s.beginPath(),s.arc(i.x,i.y,n,0,2*Math.PI),s.closePath(),s.fill();break;case"triangle":s.beginPath();var r=3*n/Math.sqrt(3),h=r*Math.sqrt(3)/2;s.moveTo(i.x-r/2,i.y+h/3),s.lineTo(i.x+r/2,i.y+h/3),s.lineTo(i.x,i.y-2*h/3),s.closePath(),s.fill();break;case"rect":s.fillRect(i.x-1/Math.SQRT2*n,i.y-1/Math.SQRT2*n,2/Math.SQRT2*n,2/Math.SQRT2*n),s.strokeRect(i.x-1/Math.SQRT2*n,i.y-1/Math.SQRT2*n,2/Math.SQRT2*n,2/Math.SQRT2*n);break;case"rectRot":s.translate(i.x,i.y),s.rotate(Math.PI/4),s.fillRect(-1/Math.SQRT2*n,-1/Math.SQRT2*n,2/Math.SQRT2*n,2/Math.SQRT2*n),s.strokeRect(-1/Math.SQRT2*n,-1/Math.SQRT2*n,2/Math.SQRT2*n,2/Math.SQRT2*n),s.setTransform(1,0,0,1,0,0);break;case"cross":s.beginPath(),s.moveTo(i.x,i.y+n),s.lineTo(i.x,i.y-n),s.moveTo(i.x-n,i.y),s.lineTo(i.x+n,i.y),s.closePath();break;case"crossRot":s.beginPath(),a=Math.cos(Math.PI/4)*n,o=Math.sin(Math.PI/4)*n,s.moveTo(i.x-a,i.y-o),s.lineTo(i.x+a,i.y+o),s.moveTo(i.x-a,i.y+o),s.lineTo(i.x+a,i.y-o),s.closePath();break;case"star":s.beginPath(),s.moveTo(i.x,i.y+n),s.lineTo(i.x,i.y-n),s.moveTo(i.x-n,i.y),s.lineTo(i.x+n,i.y),a=Math.cos(Math.PI/4)*n,o=Math.sin(Math.PI/4)*n,s.moveTo(i.x-a,i.y-o),s.lineTo(i.x+a,i.y+o),s.moveTo(i.x-a,i.y+o),s.lineTo(i.x+a,i.y-o),s.closePath();break;case"line":s.beginPath(),s.moveTo(i.x-n,i.y),s.lineTo(i.x+n,i.y),s.closePath();break;case"dash":s.beginPath(),s.moveTo(i.x,i.y),s.lineTo(i.x+n,i.y),s.closePath()}s.stroke()}}}})}},{}],37:[function(t,e,i){"use strict";e.exports=function(t){t.helpers;t.defaults.global.elements.rectangle={backgroundColor:t.defaults.global.defaultColor,borderWidth:0,borderColor:t.defaults.global.defaultColor,borderSkipped:"bottom"},t.elements.Rectangle=t.Element.extend({draw:function(){function t(t){return h[(c+t)%4]}var e=this._chart.ctx,i=this._view,s=i.width/2,a=i.x-s,o=i.x+s,n=i.base-(i.base-i.y),r=i.borderWidth/2;i.borderWidth&&(a+=r,o-=r,n+=r),e.beginPath(),e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth;var h=[[a,i.base],[a,n],[o,n],[o,i.base]],l=["bottom","left","top","right"],c=l.indexOf(i.borderSkipped,0);-1===c&&(c=0),e.moveTo.apply(e,t(0));for(var u=1;4>u;u++)e.lineTo.apply(e,t(u));e.fill(),i.borderWidth&&e.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var i=this._view,s=!1;return i&&(s=i.y=i.x-i.width/2&&t<=i.x+i.width/2&&e>=i.y&&e<=i.base:t>=i.x-i.width/2&&t<=i.x+i.width/2&&e>=i.base&&e<=i.y),s},inLabelRange:function(t){var e=this._view;return e?t>=e.x-e.width/2&&t<=e.x+e.width/2:!1},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})}},{}],38:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i={position:"bottom"},s=t.Scale.extend({determineDataLimits:function(){this.minIndex=0,this.maxIndex=this.chart.data.labels.length;var t;void 0!==this.options.ticks.min&&(t=e.indexOf(this.chart.data.labels,this.options.ticks.min),this.minIndex=-1!==t?t:this.minIndex),void 0!==this.options.ticks.max&&(t=e.indexOf(this.chart.data.labels,this.options.ticks.max),this.maxIndex=-1!==t?t:this.maxIndex),this.min=this.chart.data.labels[this.minIndex],this.max=this.chart.data.labels[this.maxIndex]},buildTicks:function(t){this.ticks=0===this.minIndex&&this.maxIndex===this.chart.data.labels.length?this.chart.data.labels:this.chart.data.labels.slice(this.minIndex,this.maxIndex+1)},getLabelForIndex:function(t,e){return this.ticks[t]},getPixelForValue:function(t,e,i,s){var a=Math.max(this.ticks.length-(this.options.gridLines.offsetGridLines?0:1),1);if(this.isHorizontal()){var o=this.width-(this.paddingLeft+this.paddingRight),n=o/a,r=n*(e-this.minIndex)+this.paddingLeft;return this.options.gridLines.offsetGridLines&&s&&(r+=n/2),this.left+Math.round(r)}var h=this.height-(this.paddingTop+this.paddingBottom),l=h/a,c=l*(e-this.minIndex)+this.paddingTop;return this.options.gridLines.offsetGridLines&&s&&(c+=l/2),this.top+Math.round(c)},getPixelForTick:function(t,e){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null,e)}});t.scaleService.registerScaleType("category",s,i)}},{}],39:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i={position:"left",ticks:{callback:function(t,i,s){var a=s.length>3?s[2]-s[1]:s[1]-s[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var o=e.log10(Math.abs(a)),n="";if(0!==t){var r=-1*Math.floor(o);r=Math.max(Math.min(r,20),0),n=t.toFixed(r)}else n="0";return n}}},s=t.Scale.extend({determineDataLimits:function(){if(this.min=null,this.max=null,this.options.stacked){var t={},i=!1,s=!1;e.each(this.chart.data.datasets,function(a){void 0===t[a.type]&&(t[a.type]={positiveValues:[],negativeValues:[]});var o=t[a.type].positiveValues,n=t[a.type].negativeValues;e.isDatasetVisible(a)&&(this.isHorizontal()?a.xAxisID===this.id:a.yAxisID===this.id)&&e.each(a.data,function(t,e){var a=+this.getRightValue(t);isNaN(a)||(o[e]=o[e]||0,n[e]=n[e]||0,this.options.relativePoints?o[e]=100:0>a?(s=!0,n[e]+=a):(i=!0,o[e]+=a))},this)},this),e.each(t,function(t){var i=t.positiveValues.concat(t.negativeValues),s=e.min(i),a=e.max(i);this.min=null===this.min?s:Math.min(this.min,s),this.max=null===this.max?a:Math.max(this.max,a)},this)}else e.each(this.chart.data.datasets,function(t){e.isDatasetVisible(t)&&(this.isHorizontal()?t.xAxisID===this.id:t.yAxisID===this.id)&&e.each(t.data,function(t,e){var i=+this.getRightValue(t);isNaN(i)||(null===this.min?this.min=i:ithis.max&&(this.max=i))},this)},this);if(this.options.ticks.beginAtZero){var a=e.sign(this.min),o=e.sign(this.max);0>a&&0>o?this.max=0:a>0&&o>0&&(this.min=0)}void 0!==this.options.ticks.min?this.min=this.options.ticks.min:void 0!==this.options.ticks.suggestedMin&&(this.min=Math.min(this.min,this.options.ticks.suggestedMin)),void 0!==this.options.ticks.max?this.max=this.options.ticks.max:void 0!==this.options.ticks.suggestedMax&&(this.max=Math.max(this.max,this.options.ticks.suggestedMax)),this.min===this.max&&(this.min--,this.max++)},buildTicks:function(){this.ticks=[];var i;if(this.isHorizontal())i=Math.min(this.options.ticks.maxTicksLimit?this.options.ticks.maxTicksLimit:11,Math.ceil(this.width/50));else{var s=e.getValueOrDefault(this.options.ticks.fontSize,t.defaults.global.defaultFontSize);i=Math.min(this.options.ticks.maxTicksLimit?this.options.ticks.maxTicksLimit:11,Math.ceil(this.height/(2*s)))}i=Math.max(2,i);var a,o=this.options.ticks.fixedStepSize&&this.options.ticks.fixedStepSize>0||this.options.ticks.stepSize&&this.options.ticks.stepSize>0;if(o)a=e.getValueOrDefault(this.options.ticks.fixedStepSize,this.options.ticks.stepSize);else{var n=e.niceNum(this.max-this.min,!1);a=e.niceNum(n/(i-1),!0)}var r=Math.floor(this.min/a)*a,h=Math.ceil(this.max/a)*a,l=(h-r)/a;l=e.almostEquals(l,Math.round(l),a/1e3)?Math.round(l):Math.ceil(l),this.ticks.push(void 0!==this.options.ticks.min?this.options.ticks.min:r);for(var c=1;l>c;++c)this.ticks.push(r+c*a);this.ticks.push(void 0!==this.options.ticks.max?this.options.ticks.max:h),("left"===this.options.position||"right"===this.options.position)&&this.ticks.reverse(),this.max=e.max(this.ticks),this.min=e.min(this.ticks),this.options.ticks.reverse?(this.ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},convertTicksToLabels:function(){this.ticksAsNumbers=this.ticks.slice(),this.zeroLineIndex=this.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(this)},getPixelForValue:function(t,e,i,s){var a,o=+this.getRightValue(t),n=this.end-this.start;if(this.isHorizontal()){var r=this.width-(this.paddingLeft+this.paddingRight);return a=this.left+r/n*(o-this.start),Math.round(a+this.paddingLeft)}var h=this.height-(this.paddingTop+this.paddingBottom);return a=this.bottom-this.paddingBottom-h/n*(o-this.start),Math.round(a)},getPixelForTick:function(t,e){return this.getPixelForValue(this.ticksAsNumbers[t],null,null,e)}});t.scaleService.registerScaleType("linear",s,i)}},{}],40:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i={position:"left",ticks:{callback:function(e,i,s){var a=e/Math.pow(10,Math.floor(t.helpers.log10(e)));return 1===a||2===a||5===a||0===i||i===s.length-1?e.toExponential():""}}},s=t.Scale.extend({determineDataLimits:function(){if(this.min=null,this.max=null,this.options.stacked){var t={};e.each(this.chart.data.datasets,function(i){e.isDatasetVisible(i)&&(this.isHorizontal()?i.xAxisID===this.id:i.yAxisID===this.id)&&(void 0===t[i.type]&&(t[i.type]=[]),e.each(i.data,function(e,s){var a=t[i.type],o=+this.getRightValue(e);isNaN(o)||(a[s]=a[s]||0,this.options.relativePoints?a[s]=100:a[s]+=o)},this))},this),e.each(t,function(t){var i=e.min(t),s=e.max(t);this.min=null===this.min?i:Math.min(this.min,i),this.max=null===this.max?s:Math.max(this.max,s)},this)}else e.each(this.chart.data.datasets,function(t){e.isDatasetVisible(t)&&(this.isHorizontal()?t.xAxisID===this.id:t.yAxisID===this.id)&&e.each(t.data,function(t,e){var i=+this.getRightValue(t);isNaN(i)||(null===this.min?this.min=i:ithis.max&&(this.max=i))},this)},this);this.min=void 0!==this.options.ticks.min?this.options.ticks.min:this.min,this.max=void 0!==this.options.ticks.max?this.options.ticks.max:this.max,this.min===this.max&&(0!==this.min&&null!==this.min?(this.min=Math.pow(10,Math.floor(e.log10(this.min))-1),this.max=Math.pow(10,Math.floor(e.log10(this.max))+1)):(this.min=1,this.max=10))},buildTicks:function(){this.ticks=[];for(var t=void 0!==this.options.ticks.min?this.options.ticks.min:Math.pow(10,Math.floor(e.log10(this.min)));tthis.max&&(this.max=i))},this)},this),this.options.ticks.beginAtZero){var t=e.sign(this.min),i=e.sign(this.max);0>t&&0>i?this.max=0:t>0&&i>0&&(this.min=0)}void 0!==this.options.ticks.min?this.min=this.options.ticks.min:void 0!==this.options.ticks.suggestedMin&&(this.min=Math.min(this.min,this.options.ticks.suggestedMin)),void 0!==this.options.ticks.max?this.max=this.options.ticks.max:void 0!==this.options.ticks.suggestedMax&&(this.max=Math.max(this.max,this.options.ticks.suggestedMax)),this.min===this.max&&(this.min--,this.max++)},buildTicks:function(){this.ticks=[];var i=e.getValueOrDefault(this.options.ticks.fontSize,t.defaults.global.defaultFontSize),s=Math.min(this.options.ticks.maxTicksLimit?this.options.ticks.maxTicksLimit:11,Math.ceil(this.drawingArea/(1.5*i)));s=Math.max(2,s);var a=e.niceNum(this.max-this.min,!1),o=e.niceNum(a/(s-1),!0),n=Math.floor(this.min/o)*o,r=Math.ceil(this.max/o)*o,h=Math.ceil((r-n)/o);this.ticks.push(void 0!==this.options.ticks.min?this.options.ticks.min:n);for(var l=1;h>l;++l)this.ticks.push(n+l*o);this.ticks.push(void 0!==this.options.ticks.max?this.options.ticks.max:r),this.max=e.max(this.ticks),this.min=e.min(this.ticks),this.options.ticks.reverse?(this.ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),this.zeroLineIndex=this.ticks.indexOf(0)},convertTicksToLabels:function(){t.Scale.prototype.convertTicksToLabels.call(this),this.pointLabels=this.chart.data.labels.map(this.options.pointLabels.callback,this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var i,s,a,o,n,r,h,l,c,u,d,f,m=e.getValueOrDefault(this.options.pointLabels.fontSize,t.defaults.global.defaultFontSize),g=e.getValueOrDefault(this.options.pointLabels.fontStyle,t.defaults.global.defaultFontStyle),p=e.getValueOrDefault(this.options.pointLabels.fontFamily,t.defaults.global.defaultFontFamily),b=e.fontString(m,g,p),v=e.min([this.height/2-m-5,this.width/2]),x=this.width,y=0;for(this.ctx.font=b,s=0;sx&&(x=i.x+o,n=s),i.x-ox&&(x=i.x+a,n=s):s>this.getValueCount()/2&&i.x-a0||this.options.reverse){var o=this.getDistanceFromCenterForValue(this.ticks[a]),n=this.yCenter-o;if(this.options.gridLines.display)if(i.strokeStyle=this.options.gridLines.color,i.lineWidth=this.options.gridLines.lineWidth,this.options.lineArc)i.beginPath(), +i.arc(this.xCenter,this.yCenter,o,0,2*Math.PI),i.closePath(),i.stroke();else{i.beginPath();for(var r=0;r=0;s--){if(this.options.angleLines.display){var a=this.getPointPosition(s,this.getDistanceFromCenterForValue(this.options.reverse?this.min:this.max));i.beginPath(),i.moveTo(this.xCenter,this.yCenter),i.lineTo(a.x,a.y),i.stroke(),i.closePath()}var o=this.getPointPosition(s,this.getDistanceFromCenterForValue(this.options.reverse?this.min:this.max)+5),n=e.getValueOrDefault(this.options.pointLabels.fontColor,t.defaults.global.defaultFontColor),r=e.getValueOrDefault(this.options.pointLabels.fontSize,t.defaults.global.defaultFontSize),h=e.getValueOrDefault(this.options.pointLabels.fontStyle,t.defaults.global.defaultFontStyle),l=e.getValueOrDefault(this.options.pointLabels.fontFamily,t.defaults.global.defaultFontFamily),c=e.fontString(r,h,l);i.font=c,i.fillStyle=n;var u=this.pointLabels.length,d=this.pointLabels.length/2,f=d/2,m=f>s||s>u-f,g=s===f||s===u-f;0===s?i.textAlign="center":s===d?i.textAlign="center":d>s?i.textAlign="left":i.textAlign="right",g?i.textBaseline="middle":m?i.textBaseline="bottom":i.textBaseline="top",i.fillText(this.pointLabels[s]?this.pointLabels[s]:"",o.x,o.y)}}}}});t.scaleService.registerScaleType("radialLinear",s,i)}},{}],42:[function(t,e,i){"use strict";var s=t("moment");s="function"==typeof s?s:window.moment,e.exports=function(t){var e=t.helpers,i={units:[{name:"millisecond",steps:[1,2,5,10,20,50,100,250,500]},{name:"second",steps:[1,2,5,10,30]},{name:"minute",steps:[1,2,5,10,30]},{name:"hour",steps:[1,2,3,6,12]},{name:"day",steps:[1,2,5]},{name:"week",maxStep:4},{name:"month",maxStep:3},{name:"quarter",maxStep:4},{name:"year",maxStep:!1}]},a={position:"bottom",time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,displayFormats:{millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm:ss a",hour:"MMM D, hA",day:"ll",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"}},ticks:{autoSkip:!1}},o=t.Scale.extend({initialize:function(){if(!s)throw new Error("Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com");t.Scale.prototype.initialize.call(this)},getLabelMoment:function(t,e){return this.labelMoments[t][e]},determineDataLimits:function(){this.labelMoments=[];var t=[];this.chart.data.labels&&this.chart.data.labels.length>0?(e.each(this.chart.data.labels,function(e,i){var s=this.parseTime(e);s.isValid()&&(this.options.time.round&&s.startOf(this.options.time.round),t.push(s))},this),this.firstTick=s.min.call(this,t),this.lastTick=s.max.call(this,t)):(this.firstTick=null,this.lastTick=null),e.each(this.chart.data.datasets,function(i,a){var o=[];"object"==typeof i.data[0]?e.each(i.data,function(t,e){var i=this.parseTime(this.getRightValue(t));i.isValid()&&(this.options.time.round&&i.startOf(this.options.time.round),o.push(i),this.firstTick=null!==this.firstTick?s.min(this.firstTick,i):i,this.lastTick=null!==this.lastTick?s.max(this.lastTick,i):i)},this):o=t,this.labelMoments.push(o)},this),this.options.time.min&&(this.firstTick=this.parseTime(this.options.time.min)),this.options.time.max&&(this.lastTick=this.parseTime(this.options.time.max)),this.firstTick=(this.firstTick||s()).clone(),this.lastTick=(this.lastTick||s()).clone()},buildTicks:function(s){this.ctx.save();var a=e.getValueOrDefault(this.options.ticks.fontSize,t.defaults.global.defaultFontSize),o=e.getValueOrDefault(this.options.ticks.fontStyle,t.defaults.global.defaultFontStyle),n=e.getValueOrDefault(this.options.ticks.fontFamily,t.defaults.global.defaultFontFamily),r=e.fontString(a,o,n);if(this.ctx.font=r,this.ticks=[],this.unitScale=1,this.scaleSizeInUnits=0,this.options.time.unit)this.tickUnit=this.options.time.unit||"day",this.displayFormat=this.options.time.displayFormats[this.tickUnit],this.scaleSizeInUnits=this.lastTick.diff(this.firstTick,this.tickUnit,!0),this.unitScale=e.getValueOrDefault(this.options.time.unitStepSize,1);else{var h=this.isHorizontal()?this.width-(this.paddingLeft+this.paddingRight):this.height-(this.paddingTop+this.paddingBottom),l=this.tickFormatFunction(this.firstTick,0,[]),c=this.ctx.measureText(l).width,u=Math.cos(e.toRadians(this.options.ticks.maxRotation)),d=Math.sin(e.toRadians(this.options.ticks.maxRotation));c=c*u+a*d;var f=h/c;this.tickUnit="millisecond",this.scaleSizeInUnits=this.lastTick.diff(this.firstTick,this.tickUnit,!0),this.displayFormat=this.options.time.displayFormats[this.tickUnit];for(var m=0,g=i.units[m];m=Math.ceil(this.scaleSizeInUnits/f)){this.unitScale=e.getValueOrDefault(this.options.time.unitStepSize,g.steps[p]);break}break}if(g.maxStep===!1||Math.ceil(this.scaleSizeInUnits/f)=0)break;v%this.unitScale===0&&this.ticks.push(x)}(0!==this.ticks[this.ticks.length-1].diff(this.lastTick,this.tickUnit)||0===this.scaleSizeInUnits)&&(this.options.time.max?(this.ticks.push(this.lastTick.clone()),this.scaleSizeInUnits=this.lastTick.diff(this.ticks[0],this.tickUnit,!0)):(this.scaleSizeInUnits=Math.ceil(this.scaleSizeInUnits/this.unitScale)*this.unitScale,this.ticks.push(this.firstTick.clone().add(this.scaleSizeInUnits,this.tickUnit)),this.lastTick=this.ticks[this.ticks.length-1].clone())),this.ctx.restore()},getLabelForIndex:function(t,e){var i=this.chart.data.labels&&t
    -
      - -
    -
    - + +
    -

    Modules

    -

    Memory

    -

    EXPRESS - Routes

    +

    Modules required

    +

    Memory usage

    +

    Process Informations

    diff --git a/Plugins/Vorlon/plugins/nodejs/tree.css b/Plugins/Vorlon/plugins/nodejs/tree.css new file mode 100644 index 00000000..e88d91c4 --- /dev/null +++ b/Plugins/Vorlon/plugins/nodejs/tree.css @@ -0,0 +1,57 @@ +.tree a { + cursor: pointer; +} + +.tree { + padding: 15px; +} + +.tree ul { + list-style: none outside none; +} +.tree li a { + line-height: 25px; +} +.tree > ul > li > a { + color: #3B4C56; + display: block; + font-weight: normal; + position: relative; + text-decoration: none; +} +.tree li.parent > a { + padding: 0 0 0 28px; +} +.tree li.parent > a:before { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAZCAYAAABzVH1EAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRY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WhGQ7W2PLtx8/JSpXLDscOHiOMYEdPcXGj/7W3211BPpaeX9Rse58mnn+HypV8Ocs+ivGotKEPyvXb4h9OnHSxp7T9pOHubEaX1PRvI9J+/Xjj0xGOPPpx/dvLCHwzdduuCMeR6+b/WfwMAT4wE7x++y1wAAAAASUVORK5CYII="); + background-position: 25px center; + content: ""; + display: block; + height: 21px; + left: 0; + position: absolute; + top: 2px; + vertical-align: middle; + width: 23px; +} +.tree ul li.active > a:before { + background-position: 0 center; +} +.tree ul li ul { + border-left: 1px solid #D9DADB; + display: none; + margin: 0 0 0 12px; + overflow: hidden; + padding: 0 0 0 25px; +} +.tree ul li ul li { + position: relative; +} +.tree ul li ul li:before { + border-bottom: 1px dashed #E2E2E3; + content: ""; + left: -20px; + position: absolute; + top: 12px; + width: 15px; +} \ No newline at end of file diff --git a/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.client.ts b/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.client.ts index d4374007..4612d5b5 100644 --- a/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.client.ts +++ b/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.client.ts @@ -23,21 +23,54 @@ module VORLON { // Start the clientside code public startClientSide(): void { - + console.log('client'); } + + public simpleStringify (object :any): void { + var simpleObject = {}; + for (var prop in object ){ + if (!object.hasOwnProperty(prop)){ + continue; + } + if (typeof(object[prop]) == 'object'){ + continue; + } + if (typeof(object[prop]) == 'function'){ + continue; + } + simpleObject[prop] = object[prop]; + } + return JSON.stringify(simpleObject); // returns cleaned up JSON + }; // Handle messages from the dashboard, on the client public onRealtimeMessageReceivedFromDashboardSide(receivedObject: any): void { - if (receivedObject == 'modules') { - this.sendToDashboard({ type: 'modules', data: Object.keys(require('module')._cache)}); - } else if (receivedObject == 'routes') { - console.log('test'); - console.log('test2'); - var routes = []; - this.sendToDashboard({ type: 'modules', data: routes}); - } else if (receivedObject == 'memory') { - this.sendToDashboard({ type: 'memory', data: process.memoryUsage()}); - } + if (!Tools.IsWindowAvailable) { + if (receivedObject == 'modules') { + this.sendToDashboard({ type: 'modules', data: Object.keys(require('module')._cache)}); + } else if (receivedObject == 'infos') { + this.sendToDashboard({ type: 'infos', data: { + title: process.title, + version: process.version, + platform: process.platform, + arch: process.arch, + debugPort: process.debugPort, + pid: process.pid, + USERNAME: process.env.USERNAME, + USERDOMAIN_ROAMINGPROFILE: process.env.USERDOMAIN_ROAMINGPROFILE, + USERPROFILE: process.env.USERPROFILE, + WINDIR: process.env.WINDIR, + UATDATA: process.env.UATDATA, + USERDOMAIN: process.env.USERDOMAIN, + }}); + } else if (receivedObject == 'memory') { + var _that = this; + _that.sendToDashboard({ type: 'memory', data: process.memoryUsage()}); + setInterval(function() { + _that.sendToDashboard({ type: 'memory', data: process.memoryUsage()}); + }, 5000); + } + } } } diff --git a/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.dashboard.ts b/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.dashboard.ts index 9e067bec..e95ecd89 100644 --- a/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.dashboard.ts +++ b/Plugins/Vorlon/plugins/nodejs/vorlon.nodejs.dashboard.ts @@ -8,7 +8,7 @@ module VORLON { //the plugin with html and css for the dashboard constructor() { // name , html for dash css for dash - super("nodejs", "control.html", "control.css"); + super("nodejs", "control.html", ["control.css", "tree.css"], "chart.js"); this._ready = true; console.log('Started'); } @@ -25,16 +25,120 @@ module VORLON { // into the dashboard private _inputField: HTMLInputElement private _outputDiv: HTMLElement + private _time: Number + private _chart: any + private __html: any + private _ctx: HTMLCanvasElement + private _chart_data: Object public startDashboardSide(div: HTMLDivElement = null): void { this._insertHtmlContentAsync(div, (filledDiv) => { this.toogleMenu(); - this.sendToClient('modules'); - this.sendToClient('routes'); + + this._time = 0; + + this._ctx = document.getElementById("memory-chart").getContext("2d"); + this._chart_data = { + labels: [], + datasets: [ + { + label: "Heap Used (MB)", + fill: false, + lineTension: 0.1, + backgroundColor: "rgba(75,192,192,0.4)", + borderColor: "rgba(75,192,192,1)", + borderCapStyle: 'butt', + borderDash: [], + borderDashOffset: 0.0, + borderJoinStyle: 'miter', + pointBorderColor: "rgba(75,192,192,1)", + pointBackgroundColor: "#fff", + pointBorderWidth: 1, + pointHoverRadius: 5, + pointHoverBackgroundColor: "rgba(75,192,192,1)", + pointHoverBorderColor: "rgba(220,220,220,1)", + pointHoverBorderWidth: 2, + pointRadius: 1, + pointHitRadius: 10, + data: [], + }, + { + label: "Heap Total (MB)", + fill: false, + lineTension: 0.1, + backgroundColor: "rgba(142, 68, 173,0.4)", + borderColor: "rgba(142, 68, 173,1.0)", + borderCapStyle: 'butt', + borderDash: [], + borderDashOffset: 0.0, + borderJoinStyle: 'miter', + pointBorderColor: "rgba(142, 68, 173,1.0)", + pointBackgroundColor: "#fff", + pointBorderWidth: 1, + pointHoverRadius: 5, + pointHoverBackgroundColor: "rgba(142, 68, 173,1.0)", + pointHoverBorderColor: "rgba(155, 89, 182,1.0)", + pointHoverBorderWidth: 2, + pointRadius: 1, + pointHitRadius: 10, + data: [], + }, + { + label: "RSS (MB)", + fill: false, + lineTension: 0.1, + backgroundColor: "rgba(192, 57, 43,0.4)", + borderColor: "rgba(192, 57, 43,1.0)", + borderCapStyle: 'butt', + borderDash: [], + borderDashOffset: 0.0, + borderJoinStyle: 'miter', + pointBorderColor: "rgba(192, 57, 43,1.0)", + pointBackgroundColor: "#fff", + pointBorderWidth: 1, + pointHoverRadius: 5, + pointHoverBackgroundColor: "rgba(192, 57, 43,1.0)", + pointHoverBorderColor: "rgba(231, 76, 60,1.0)", + pointHoverBorderWidth: 2, + pointRadius: 1, + pointHitRadius: 10, + data: [], + } + ] + }; + + this._chart = false; + this.__html = []; + + this.sendToClient('infos'); this.sendToClient('memory'); + this.sendToClient('modules'); }) } + public chart(): void { + Chart.defaults.global.responsive = true; + Chart.defaults.global.maintainAspectRatio = false; + Chart.defaults.global.animation.easing = 'linear'; + + this._chart = new Chart.Line(this._ctx, { + data: this._chart_data, + }); + } + + public jstree(): void { + $( '.tree li' ).each( function() { + if( $( this ).find('ul').children( 'li' ).length > 0 ) { + $( this ).addClass( 'parent' ); + } + }); + + $( '.tree li.parent > a' ).click( function( ) { + $( this ).parent().toggleClass( 'active' ); + $( this ).parent().children( 'ul' ).slideToggle( 'fast' ); + }); + } + public toogleMenu(): void { $('.open-menu').click(function() { $('.open-menu').removeClass('active-menu'); @@ -45,19 +149,96 @@ module VORLON { $(this).addClass('active-menu'); }); } + + public renderTree(arr: any): void { + var __that = this; + __that.__html.push('
      '); + $.each(arr, function(i, val) { + __that.__html.push('
    • ' + val.text +''); + if (val.children) { + __that.renderTree(val.children) + } + __that.__html.push('
    • '); + }); + __that.__html.push('
    '); + } + + public buildTree(parts: any,treeNode: any): void { + if(parts.length === 0) + { + return; + } + + for(var i = 0 ; i < treeNode.length; i++) + { + if(parts[0] == treeNode[i].text) + { + this.buildTree(parts.splice(1,parts.length),treeNode[i].children); + return; + } + } + + var newNode = {'text': parts[0] ,'children':[]}; + treeNode.push(newNode); + this.buildTree(parts.splice(1,parts.length),newNode.children); + } + public onRealtimeMessageReceivedFromClientSide(receivedObject: any): void { if (receivedObject.type == 'modules') { - for (var i = 0, len = receivedObject.data.length; i < len; i++) { - $('#modules ul').append('
  • '+ receivedObject.data[i] +'
  • '); + var list = receivedObject.data; + var data = []; + + for(var i = 0; i < list.length; i++) { + list[i] = list[i].split("\\"); + list[i].splice(0, 6); + this.buildTree(list[i], data); } + + this.renderTree(data); + $('#jstree').append(this.__html.join('')); + this.jstree(); } - if (receivedObject.type == 'routes') { - for (var i = 0, len = receivedObject.data.length; i < len; i++) { - $('#routes ul').append('
  • '+ JSON.stringify(receivedObject.data[i]) +'
  • '); + if (receivedObject.type == 'infos') { + for (var k in receivedObject.data) { + $('.infos-' + k).append(receivedObject.data[k]); + } + var icon = ''; + switch (receivedObject.data['platform']) { + case 'linux': + icon = 'linux.png'; + break; + case 'win32': + icon = 'windows.png'; + break; + case 'win64': + icon = 'windows.png'; + break; + case 'darwin': + icon = 'apple.png'; + break; } + + $('.infos-platform img').attr('src', '/images/systems/' + icon); } if (receivedObject.type == 'memory') { - $('#memory').append(JSON.stringify(receivedObject.data)); + if(!this._chart) { + this.chart(); + } + if (this._time >= 70) { + this._chart.data.datasets[0].data.splice(0, 1); + this._chart.data.datasets[1].data.splice(0, 1); + this._chart.data.datasets[2].data.splice(0, 1); + this._chart.data.labels.splice(0, 1); + } + + this._chart.data.labels.push(this._time); + + this._chart.data.datasets[0].data.push(receivedObject.data['heapUsed']); + this._chart.data.datasets[1].data.push(receivedObject.data['heapTotal']); + this._chart.data.datasets[2].data.push(receivedObject.data['rss']); + + this._chart.update(); + this._time += 5; } } } diff --git a/Server/config.json b/Server/config.json index dbe61615..f2575c6a 100644 --- a/Server/config.json +++ b/Server/config.json @@ -21,15 +21,8 @@ "panel": "top", "foldername": "nodejs", "enabled": true, - "nodeCompliant": true - }, - { - "id": "CONSOLE", - "name": "Interactive Console", - "panel": "top", - "foldername": "interactiveConsole", - "enabled": true, - "nodeCompliant": true + "nodeCompliant": true, + "nodeOnly": true }, { "id": "DOM", @@ -39,10 +32,10 @@ "enabled": true }, { - "id": "MODERNIZR", - "name": "Modernizr", - "panel": "bottom", - "foldername": "modernizrReport", + "id": "DEVICE", + "name": "My Device", + "panel": "top", + "foldername": "device", "enabled": true }, { @@ -68,13 +61,6 @@ "enabled": true, "nodeCompliant": true }, - { - "id": "NGINSPECTOR", - "name": "Ng. Inspector", - "panel": "top", - "foldername": "ngInspector", - "enabled": false - }, { "id": "NETWORK", "name": "Network Monitor", @@ -90,19 +76,41 @@ "enabled": true }, { - "id": "DEVICE", - "name": "My Device", + "id": "UNITTEST", + "name": "Unit Test", "panel": "top", - "foldername": "device", + "foldername": "unitTestRunner", "enabled": true }, { - "id": "UNITTEST", - "name": "Unit Test", + "id": "UWP", + "name": "UWP apps", "panel": "top", - "foldername": "unitTestRunner", + "foldername": "uwp", + "enabled": true + }, + { + "id": "CONSOLE", + "name": "Interactive Console", + "panel": "bottom", + "foldername": "interactiveConsole", + "enabled": true, + "nodeCompliant": true + }, + { + "id": "MODERNIZR", + "name": "Modernizr", + "panel": "bottom", + "foldername": "modernizrReport", "enabled": true }, + { + "id": "NGINSPECTOR", + "name": "Ng. Inspector", + "panel": "top", + "foldername": "ngInspector", + "enabled": false + }, { "id": "BABYLONINSPECTOR", "name": "Babylon Inspector", @@ -117,13 +125,6 @@ "foldername": "office", "enabled": false }, - { - "id": "UWP", - "name": "UWP apps", - "panel": "top", - "foldername": "uwp", - "enabled": true - }, { "id": "SCREEN", "name": "Screenshot", From 5576700e72cacde0f41ca6a37014789c7d2f8127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20REMY?= Date: Wed, 4 May 2016 15:31:45 -0700 Subject: [PATCH 06/53] Added: primitive data pipeline --- Plugins/Vorlon/plugins/domtimeline/README.md | 33 +++ .../domtimeline/api/vorlon.basePlugin.d.ts | 18 ++ .../api/vorlon.clientMessenger.d.ts | 39 +++ .../domtimeline/api/vorlon.clientPlugin.d.ts | 12 + .../plugins/domtimeline/api/vorlon.core.d.ts | 37 +++ .../api/vorlon.dashboardPlugin.d.ts | 16 ++ .../plugins/domtimeline/api/vorlon.enums.d.ts | 12 + .../plugins/domtimeline/api/vorlon.tools.d.ts | 45 ++++ .../Vorlon/plugins/domtimeline/control.html | 16 ++ .../domtimeline/vorlon.domtimeline.client.ts | 224 ++++++++++++++++++ .../vorlon.domtimeline.dashboard.ts | 93 ++++++++ Server/config.json | 3 +- gulpfile.js | 14 ++ 13 files changed, 561 insertions(+), 1 deletion(-) create mode 100644 Plugins/Vorlon/plugins/domtimeline/README.md create mode 100644 Plugins/Vorlon/plugins/domtimeline/api/vorlon.basePlugin.d.ts create mode 100644 Plugins/Vorlon/plugins/domtimeline/api/vorlon.clientMessenger.d.ts create mode 100644 Plugins/Vorlon/plugins/domtimeline/api/vorlon.clientPlugin.d.ts create mode 100644 Plugins/Vorlon/plugins/domtimeline/api/vorlon.core.d.ts create mode 100644 Plugins/Vorlon/plugins/domtimeline/api/vorlon.dashboardPlugin.d.ts create mode 100644 Plugins/Vorlon/plugins/domtimeline/api/vorlon.enums.d.ts create mode 100644 Plugins/Vorlon/plugins/domtimeline/api/vorlon.tools.d.ts create mode 100644 Plugins/Vorlon/plugins/domtimeline/control.html create mode 100644 Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.client.ts create mode 100644 Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts diff --git a/Plugins/Vorlon/plugins/domtimeline/README.md b/Plugins/Vorlon/plugins/domtimeline/README.md new file mode 100644 index 00000000..7f0846da --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/README.md @@ -0,0 +1,33 @@ +# DOMTimeline plugin + +This is an example additional plugin for vorlon. It renders an input field into the Vorlon dashboard. If you type a message, it sends it to your client, which reverses it, and sends it back to be rendered into the dashboard. + +You can use this as a starting point for your own plugins. + +## Enabling the sample plugin + +To enable the sample plugin: + +1. Clone this github repo if you haven't already (`git clone git@github.com/MicrosoftDX/Vorlonjs`) +2. Modify `Server/config.json` to add the plugin, so it looks like this: + +```json +{ + "includeSocketIO": true, + "plugins": [ + { "id": "CONSOLE", "name": "Interactive Console", "panel": "bottom", "foldername" : "interactiveConsole", "enabled": true}, + { "id": "DOM", "name": "Dom Explorer", "panel": "top", "foldername" : "domExplorer", "enabled": true }, + { "id": "MODERNIZR", "name": "Modernizr","panel": "bottom", "foldername" : "modernizrReport", "enabled": true }, + { "id": "OBJEXPLORER", "name" : "Obj. Explorer","panel": "top", "foldername" : "objectExplorer", "enabled": true }, + { "id": "SAMPLE", "name" : "Sample","panel": "top", "foldername" : "sample", "enabled": true } + ] +} +``` + +3. From the root directory of the repository, install dependencies with `npm install`, build vorlon with `npm run build` and start the server with `npm start` (make sure you kill any existing vorlon servers running on your machine. You can now navigate to the vorlon dashboard as normal, and you'll see an additional tab in the list. + +## Modifying the plugin + +The plugin is based on two files (one for the client and one for the dashboard) who respectively extend from VORLON.ClientPlugin and VORLON.DashboardPlugin, as defined in `Plugins/Vorlon/vorlon.clientPlugin.ts` and `Plugins/Vorlon/vorlon.dashboardPlugin.ts` so you can see what methods are available for your plugin from there. You may also wish to look at the other existing plugins in `Plugins/Vorlon/plugins` for ideas. + +`control.html` will be inserted into the dashboard, as will `dashboard.css`. diff --git a/Plugins/Vorlon/plugins/domtimeline/api/vorlon.basePlugin.d.ts b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.basePlugin.d.ts new file mode 100644 index 00000000..4f49c028 --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.basePlugin.d.ts @@ -0,0 +1,18 @@ +declare module VORLON { + class BasePlugin { + name: string; + _ready: boolean; + protected _id: string; + protected _debug: boolean; + _type: PluginType; + trace: (msg) => void; + protected traceLog: (msg: any) => void; + protected traceNoop: (msg: any) => void; + loadingDirectory: string; + constructor(name: string); + Type: PluginType; + debug: boolean; + getID(): string; + isReady(): boolean; + } +} diff --git a/Plugins/Vorlon/plugins/domtimeline/api/vorlon.clientMessenger.d.ts b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.clientMessenger.d.ts new file mode 100644 index 00000000..90241fc0 --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.clientMessenger.d.ts @@ -0,0 +1,39 @@ +declare module VORLON { + interface VorlonMessageMetadata { + pluginID: string; + side: RuntimeSide; + sessionId: string; + clientId: string; + listenClientId: string; + } + interface VorlonMessage { + metadata: VorlonMessageMetadata; + command?: string; + data?: any; + } + class ClientMessenger { + private _socket; + private _isConnected; + private _sessionId; + private _clientId; + private _listenClientId; + private _serverUrl; + onRealtimeMessageReceived: (message: VorlonMessage) => void; + onHeloReceived: (id: string) => void; + onIdentifyReceived: (id: string) => void; + onRemoveClient: (id: any) => void; + onAddClient: (id: any) => void; + onStopListenReceived: () => void; + onRefreshClients: () => void; + onReload: (id: string) => void; + onError: (err: Error) => void; + isConnected: boolean; + clientId: string; + socketId: string; + constructor(side: RuntimeSide, serverUrl: string, sessionId: string, clientId: string, listenClientId: string); + stopListening(): void; + sendRealtimeMessage(pluginID: string, objectToSend: any, side: RuntimeSide, messageType?: string, command?: string): void; + sendMonitoringMessage(pluginID: string, message: string): void; + getMonitoringMessage(pluginID: string, onMonitoringMessage: (messages: string[]) => any, from?: string, to?: string): any; + } +} diff --git a/Plugins/Vorlon/plugins/domtimeline/api/vorlon.clientPlugin.d.ts b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.clientPlugin.d.ts new file mode 100644 index 00000000..40280ebd --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.clientPlugin.d.ts @@ -0,0 +1,12 @@ +declare module VORLON { + class ClientPlugin extends BasePlugin { + ClientCommands: any; + constructor(name: string); + startClientSide(): void; + onRealtimeMessageReceivedFromDashboardSide(receivedObject: any): void; + sendToDashboard(data: any): void; + sendCommandToDashboard(command: string, data?: any): void; + refresh(): void; + _loadNewScriptAsync(scriptName: string, callback: () => void, waitForDOMContentLoaded?: boolean): void; + } +} diff --git a/Plugins/Vorlon/plugins/domtimeline/api/vorlon.core.d.ts b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.core.d.ts new file mode 100644 index 00000000..73a2f31a --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.core.d.ts @@ -0,0 +1,37 @@ +declare module VORLON { + class _Core { + _clientPlugins: ClientPlugin[]; + _dashboardPlugins: DashboardPlugin[]; + _messenger: ClientMessenger; + _sessionID: string; + _listenClientId: string; + _side: RuntimeSide; + _errorNotifier: any; + _messageNotifier: any; + _socketIOWaitCount: number; + debug: boolean; + _RetryTimeout: number; + Messenger: ClientMessenger; + ClientPlugins: Array; + DashboardPlugins: Array; + RegisterClientPlugin(plugin: ClientPlugin): void; + RegisterDashboardPlugin(plugin: DashboardPlugin): void; + StopListening(): void; + StartClientSide(serverUrl?: string, sessionId?: string, listenClientId?: string): void; + sendHelo(): void; + startClientDirtyCheck(): void; + StartDashboardSide(serverUrl?: string, sessionId?: string, listenClientId?: string, divMapper?: (string) => HTMLDivElement): void; + private _OnStopListenReceived(); + private _OnIdentifyReceived(message); + private ShowError(message, timeout?); + private _OnError(err); + private _OnIdentificationReceived(id); + private _OnReloadClient(id); + private _RetrySendingRealtimeMessage(plugin, message); + private _Dispatch(message); + private _DispatchPluginMessage(plugin, message); + private _DispatchFromClientPluginMessage(plugin, message); + private _DispatchFromDashboardPluginMessage(plugin, message); + } + var Core: _Core; +} diff --git a/Plugins/Vorlon/plugins/domtimeline/api/vorlon.dashboardPlugin.d.ts b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.dashboardPlugin.d.ts new file mode 100644 index 00000000..78ef7930 --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.dashboardPlugin.d.ts @@ -0,0 +1,16 @@ +declare module VORLON { + class DashboardPlugin extends BasePlugin { + htmlFragmentUrl: any; + cssStyleSheetUrl: any; + DashboardCommands: any; + constructor(name: string, htmlFragmentUrl: string, cssStyleSheetUrl: string); + startDashboardSide(div: HTMLDivElement): void; + onRealtimeMessageReceivedFromClientSide(receivedObject: any): void; + sendToClient(data: any): void; + sendCommandToClient(command: string, data?: any): void; + sendCommandToPluginClient(pluginId: string, command: string, data?: any): void; + sendCommandToPluginDashboard(pluginId: string, command: string, data?: any): void; + _insertHtmlContentAsync(divContainer: HTMLDivElement, callback: (filledDiv: HTMLDivElement) => void): void; + private _stripContent(content); + } +} diff --git a/Plugins/Vorlon/plugins/domtimeline/api/vorlon.enums.d.ts b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.enums.d.ts new file mode 100644 index 00000000..96b062b9 --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.enums.d.ts @@ -0,0 +1,12 @@ +declare module VORLON { + enum RuntimeSide { + Client = 0, + Dashboard = 1, + Both = 2, + } + enum PluginType { + OneOne = 0, + MulticastReceiveOnly = 1, + Multicast = 2, + } +} diff --git a/Plugins/Vorlon/plugins/domtimeline/api/vorlon.tools.d.ts b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.tools.d.ts new file mode 100644 index 00000000..a13f7a26 --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/api/vorlon.tools.d.ts @@ -0,0 +1,45 @@ +declare module VORLON { + class Tools { + static IsWindowAvailable: boolean; + static QuerySelectorById(root: HTMLElement, id: string): HTMLElement; + static SetImmediate(func: () => void): void; + static setLocalStorageValue(key: string, data: string): void; + static getLocalStorageValue(key: string): any; + static Hook(rootObject: any, functionToHook: string, hookingFunction: (...optionalParams: any[]) => void): void; + static HookProperty(rootObject: any, propertyToHook: string, callback: any): void; + static getCallStack(skipped: any): any; + static CreateCookie(name: string, value: string, days: number): void; + static ReadCookie(name: string): string; + static CreateGUID(): string; + static RemoveEmpties(arr: string[]): number; + static AddClass(e: HTMLElement, name: string): HTMLElement; + static RemoveClass(e: HTMLElement, name: string): HTMLElement; + static ToggleClass(e: HTMLElement, name: string, callback?: (hasClass: boolean) => void): void; + static htmlToString(text: any): any; + } + class FluentDOM { + element: HTMLElement; + childs: Array; + parent: FluentDOM; + constructor(nodeType: string, className?: string, parentElt?: Element, parent?: FluentDOM); + static forElement(element: HTMLElement): FluentDOM; + addClass(classname: string): FluentDOM; + toggleClass(classname: string): FluentDOM; + className(classname: string): FluentDOM; + opacity(opacity: string): FluentDOM; + display(display: string): FluentDOM; + hide(): FluentDOM; + visibility(visibility: string): FluentDOM; + text(text: string): FluentDOM; + html(text: string): FluentDOM; + attr(name: string, val: string): FluentDOM; + editable(editable: boolean): FluentDOM; + style(name: string, val: string): FluentDOM; + appendTo(elt: Element): FluentDOM; + append(nodeType: string, className?: string, callback?: (fdom: FluentDOM) => void): FluentDOM; + createChild(nodeType: string, className?: string): FluentDOM; + click(callback: (EventTarget) => void): FluentDOM; + blur(callback: (EventTarget) => void): FluentDOM; + keydown(callback: (EventTarget) => void): FluentDOM; + } +} diff --git a/Plugins/Vorlon/plugins/domtimeline/control.html b/Plugins/Vorlon/plugins/domtimeline/control.html new file mode 100644 index 00000000..35c810ac --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/control.html @@ -0,0 +1,16 @@ +
    + +
    + + + + + + + +
    + +
    
    +	

    Ready for instructions

    + +
    diff --git a/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.client.ts b/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.client.ts new file mode 100644 index 00000000..32cbfd06 --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.client.ts @@ -0,0 +1,224 @@ +/// +/// +var domTimelineOptions: any; +interface ExtentedMutationRecord extends MutationRecord { + stack: string + timestamp: number + newValue: string +} +var domHistory: { + + past: Array + future: Array + lostFuture: Array + + undo:()=>boolean + redo:()=>boolean + + startRecording:()=>boolean + stopRecording:()=>boolean + + isRecording:boolean + isRecordingStopped:boolean + + generateDashboardData:()=>any + +}; +interface Window { + eval: (string) => (any) +} +interface DataForEntry { + type:string, + description: string, + isCancelled: boolean, + timestamp: number, + details: any +} +module VORLON { + export class DOMTimelineClient extends ClientPlugin { + + constructor() { + super("domtimeline"); // Name + (this)._ready = true; // No need to wait + console.log('Started'); + } + + //Return unique id for your plugin + public getID(): string { + return "DOMTIMELINE"; + } + + public refresh(): void { + //override this method with cleanup work that needs to happen + //as the user switches between clients on the dashboard + + //we don't really need to do anything in this sample + } + + // This code will run on the client ////////////////////// + + // Start the clientside code + public startClientSide(): void { + domHistory.generateDashboardData = function() { + var data:any = {}; + data.isRecordingNow = domHistory.isRecording; + data.isRecordingEnded = domHistory.isRecordingStopped; + data.isPageFrozen = domHistory.future.length>0; + data.history = ( + [] + .concat(domHistory.past.map(generateDashboardDataForPastEntry)) + .concat(domHistory.future.map(generateDashboardDataForFutureEntry)) + ); + data.lostFuture = ( + domHistory.lostFuture.map(generateDashboardDataForFutureEntry) + ); + return data; + } + function generateDashboardDataForEntry(e:ExtentedMutationRecord, isCancelled:boolean):DataForEntry { + var targetDescription = descriptionOf(e.target); + if(e.addedNodes.length > 0) { + var nodeDescription = ( + (e.addedNodes.length == 1) + ? (descriptionOf(e.addedNodes[0])) + : e.addedNodes.length + " nodes" + ); + return { + type:"added", + description: "Inserted " + nodeDescription + " into " + targetDescription, + isCancelled: isCancelled, + timestamp: e.timestamp, + details: { + "Added nodes": descriptionOfNodeList(e.addedNodes), + "Target": targetDescription, + "Timestamp": e.timestamp/1000+"s", + "Stack": "`"+e.stack+"`" + } + } + } else if(e.removedNodes.length > 0) { + var nodeDescription = ( + (e.removedNodes.length == 1) + ? (descriptionOf(e.removedNodes[0])) + : e.removedNodes.length + " nodes" + ); + return { + type:"removed", + description: "Removed " + nodeDescription + " from " + targetDescription, + isCancelled: isCancelled, + timestamp: e.timestamp, + details: { + "Removed nodes": descriptionOfNodeList(e.addedNodes), + "Target": targetDescription, + "Timestamp": e.timestamp/1000+"s", + "Stack": "`"+e.stack+"`" + } + } + } else if(e.attributeName) { + if(e.newValue === null || e.newValue === undefined) { + return { + type:"updated", + description: "Removed attribute `"+e.attributeName+"` from " + targetDescription, + isCancelled: isCancelled, + timestamp: e.timestamp, + details: { + "Attribute name": e.attributeName, + "Old value": e.oldValue, + "New value": e.newValue, + "Target": targetDescription, + "Timestamp": e.timestamp/1000+"s", + "Stack": "`"+e.stack+"`" + } + } + } else if(e.oldValue === null || e.oldValue === undefined) { + return { + type:"updated", + description: "Added attribute `"+e.attributeName+"` to " + targetDescription, + isCancelled: isCancelled, + timestamp: e.timestamp, + details: { + "Attribute name": e.attributeName, + "Old value": e.oldValue, + "New value": e.newValue, + "Target": targetDescription, + "Timestamp": e.timestamp/1000+"s", + "Stack": "`"+e.stack+"`" + } + } + } else { + return { + type:"updated", + description: "Updated attribute `"+e.attributeName+"` of " + targetDescription, + isCancelled: isCancelled, + timestamp: e.timestamp, + details: { + "Attribute name": e.attributeName, + "Old value": e.oldValue, + "New value": e.newValue, + "Target": targetDescription, + "Timestamp": e.timestamp/1000+"s", + "Stack": "`"+e.stack+"`" + } + } + } + } else { + var nodeDescription = descriptionOf(e.target.parentNode) + return { + type:"updated", + description: "Updated text content of " + nodeDescription, + isCancelled: isCancelled, + timestamp: e.timestamp, + details: { + "Old value": e.oldValue, + "New value": e.newValue, + "Timestamp": e.timestamp/1000+"s", + "Stack": "`"+e.stack+"`" + } + } + } + } + function generateDashboardDataForPastEntry(e:ExtentedMutationRecord) { + return generateDashboardDataForEntry(e,false); + } + function generateDashboardDataForFutureEntry(e:ExtentedMutationRecord) { + return generateDashboardDataForEntry(e,true); + } + function descriptionOf(e:Node) { + if(e instanceof HTMLElement) { + if(e.firstChild) { + e = e.cloneNode(false); + e.appendChild(document.createTextNode("…")); + return "`"+e.outerHTML+"`" + } else { + return "`"+e.outerHTML+"`" + } + } + if(e instanceof SVGElement) { return "`<"+e.tagName+"…>`" } + if(e.nodeName[0] != "#") { return "`attribute "+e.nodeName+"`" } + if(e.nodeValue.length < 15) { return "`"+e.nodeValue+"`" } + return "`"+e.nodeValue.substr(0,15)+"…`" + } + function descriptionOfNodeList(elements:NodeList) { + if(elements.length == 1) { return "`empty node list`" } + if(elements.length == 1) { return "`1 node: "+descriptionOf(elements[0]).replace(/^`|`$/g,'')+"`"} + var desc = "`"+elements.length + " nodes:"; + for(var i = 0; i < elements.length; i++) { + desc += '\n'+descriptionOf(elements[i]).replace(/^`|`$/g,''); + } + return desc+"`"; + } + } + + // Handle messages from the dashboard, on the client + public onRealtimeMessageReceivedFromDashboardSide(receivedObject: any): void { + var result; try { + result = window.eval(receivedObject.message); + } catch (ex) { + result = ex.stack; + } + this.sendToDashboard({ message: result, messageId: receivedObject.messageId }); + } + + } + + //Register the plugin with vorlon core + Core.RegisterClientPlugin(new DOMTimelineClient()); +} diff --git a/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts b/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts new file mode 100644 index 00000000..bce5640c --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts @@ -0,0 +1,93 @@ +/// +/// +module VORLON { + + export class DOMTimelineDashboard extends DashboardPlugin { + + //Do any setup you need, call super to configure + //the plugin with html and css for the dashboard + constructor() { + // name , html for dash css for dash + super("domtimeline", "control.html", "control.css"); + (this)._ready = true; + this._messageHandlers = {}; + this._messageId = 0; + console.log('Started'); + } + + //Return unique id for your plugin + public getID(): string { + return "DOMTIMELINE"; + } + + // This code will run on the dashboard ////////////////////// + + // Start dashboard code + // uses _insertHtmlContentAsync to insert the control.html content + // into the dashboard + private _inputField: HTMLInputElement + private _outputDiv: HTMLElement + private _toastDiv: HTMLElement + private _messageId: number; + private _messageHandlers: {[s:string]:(receivedObject:any)=>void}; + + public startDashboardSide(div: HTMLDivElement = null): void { + this._insertHtmlContentAsync(div, (filledDiv) => { + this._inputField = filledDiv.querySelector('#echoInput'); + this._outputDiv = filledDiv.querySelector('#output'); + this._toastDiv = filledDiv.querySelector('#toast'); + + // Handle toolbar buttons + var me = this; + var clientCommands = filledDiv.querySelectorAll("[data-client-command]"); + for(var i = clientCommands.length; i--;) { var clientCommand = clientCommands[i]; + clientCommand.onclick = function(event) { + me.sendMessageToClient(this.getAttribute("data-client-command"), (e)=>me.logMessage(e)); + }; + } + + // Send message to client when user types and hits return + this._inputField.addEventListener("keydown", (evt) => { + if (evt.keyCode === 13) { + this.sendMessageToClient(this._inputField.value, (e)=>me.logMessage(e)); + this._inputField.value = ""; + } + }); + + // Refresh the output from time to time + setInterval(function() { + me.sendMessageToClient( + "domHistory.generateDashboardData()", + (e)=>(me._outputDiv.textContent=JSON.stringify(e.message,null," ")) + ); + }, 333); + }) + } + + // When we get a message from the client, just show it + public logMessage(receivedObject: any) { + var message = document.createElement('p'); + message.textContent = receivedObject.message; + this._toastDiv.appendChild(message); + } + + // sends a message to the client, and enables you to provide a callback for the reply + public sendMessageToClient(message: string, callback:(receivedObject:any)=>void = undefined) { + var messageId = this._messageId++; + if(callback) this._messageHandlers[messageId] = callback; + this.sendToClient({message,messageId}); + } + + // execute the planned callback when we receive a message from the client + public onRealtimeMessageReceivedFromClientSide(receivedObject: any): void { + var callback = this._messageHandlers[receivedObject.messageId]; + if(callback) { + this._messageHandlers[receivedObject.messageId] = undefined; + callback(receivedObject); + } + } + } + + //Register the plugin with vorlon core + Core.RegisterDashboardPlugin(new DOMTimelineDashboard()); +} diff --git a/Server/config.json b/Server/config.json index 8d1b2bd0..ea560c24 100644 --- a/Server/config.json +++ b/Server/config.json @@ -28,6 +28,7 @@ { "id": "RESOURCES", "name": "Resources Explorer", "panel": "top", "foldername": "resourcesExplorer", "enabled": true }, { "id": "DEVICE", "name": "My Device", "panel": "top", "foldername": "device", "enabled": true }, { "id": "UNITTEST", "name": "Unit Test", "panel": "top", "foldername": "unitTestRunner", "enabled": true }, - { "id": "BABYLONINSPECTOR", "name": "Babylon Inspector", "panel": "top", "foldername": "babylonInspector", "enabled": false } + { "id": "BABYLONINSPECTOR", "name": "Babylon Inspector", "panel": "top", "foldername": "babylonInspector", "enabled": false }, + { "id": "DOMTIMELINE", "name": "DOM Timeline", "panel": "bottom", "foldername": "domtimeline", "enabled": true } ] } diff --git a/gulpfile.js b/gulpfile.js index 8cc26e2f..6f70ca78 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -93,6 +93,20 @@ gulp.task('concat-webstandards-rules-plugins', ['typescript-to-js-plugins'], fun * Do not hesitate to update it if you need to add your own files */ gulp.task('scripts-specific-plugins-plugins', ['scripts-plugins'], function() { + // DOMTimeline + gulp.src([ + 'Plugins/release/plugins/domtimeline/vorlon.domtimeline.dashboard.js', + ]) + .pipe(concat('vorlon.domtimeline.dashboard.min.js')) + .pipe(gulp.dest('Plugins/release/plugins/domtimeline/')); + gulp.src([ + 'Plugins/Vorlon/plugins/domtimeline/dom-timeline.js', + 'Plugins/release/plugins/domtimeline/vorlon.domtimeline.client.js', + ]) + .pipe(concat('vorlon.domtimeline.client.js')) + .pipe(gulp.dest('Plugins/release/plugins/domtimeline/')); + + // Babylon Inspector gulp.src([ 'Plugins/release/plugins/babylonInspector/vorlon.babylonInspector.interfaces.js', From defc1c8b2579ee3f8db305cf75093c4ad85eaf10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20REMY?= Date: Mon, 9 May 2016 00:09:00 -0700 Subject: [PATCH 07/53] Added: missing files due to gitignore... --- .gitignore | 6 +- Plugins/Vorlon/.gitignore | 6 +- .../Vorlon/plugins/domtimeline/control.css | 37 + .../plugins/domtimeline/dom-timeline.js | 751 ++++++++++++++++++ 4 files changed, 798 insertions(+), 2 deletions(-) create mode 100644 Plugins/Vorlon/plugins/domtimeline/control.css create mode 100644 Plugins/Vorlon/plugins/domtimeline/dom-timeline.js diff --git a/.gitignore b/.gitignore index 9dca76e1..26bfe683 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,8 @@ sync.bat Server/public/stylesheets/style.css /Server/public/stylesheets/style.css /DeploymentTools/deployment-package.zip -DeploymentTools/deployment-package.zip \ No newline at end of file +DeploymentTools/deployment-package.zip +!/Plugins/Vorlon/plugins/domtimeline/** +!/Plugins/Vorlon/plugins/domtimeline/**/*.css +!/Plugins/Vorlon/plugins/domtimeline/**/*.js +!/Plugins/Vorlon/plugins/domtimeline/dom-timeline.js \ No newline at end of file diff --git a/Plugins/Vorlon/.gitignore b/Plugins/Vorlon/.gitignore index 6f34efdb..a4f9ee38 100644 --- a/Plugins/Vorlon/.gitignore +++ b/Plugins/Vorlon/.gitignore @@ -2,4 +2,8 @@ *.js.map *.min.js !verge.min.js -!res.min.js \ No newline at end of file +!res.min.js +!plugins/domtimeline/** +!plugins/domtimeline/**/*.css +!plugins/domtimeline/**/*.js +!plugins/domtimeline/dom-timeline.js \ No newline at end of file diff --git a/Plugins/Vorlon/plugins/domtimeline/control.css b/Plugins/Vorlon/plugins/domtimeline/control.css new file mode 100644 index 00000000..98d2227b --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/control.css @@ -0,0 +1,37 @@ +.toolbar > * { + vertical-align: middle; +} + +#echoInput { + width: 25%; + padding: 5px; + margin: 20px; + margin-bottom: 10px; +} + +#output > p { + padding-bottom: 2px; + margin: 0; +} + +#toast { + position: absolute; + border: 1px solid gray; + border-radius: 5px; + background: #eee; + color: #555; + left: 50%; + bottom: 10px; + transform: translateX(-50%); + padding: 3px; + pointer-events: none; + opacity: 0.75; +} + +#toast > p:not(:last-child) { + display: none; +} + +#toast > p:last-child { + display: inline; margin: 0; padding: 0; +} \ No newline at end of file diff --git a/Plugins/Vorlon/plugins/domtimeline/dom-timeline.js b/Plugins/Vorlon/plugins/domtimeline/dom-timeline.js new file mode 100644 index 00000000..acd228c5 --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/dom-timeline.js @@ -0,0 +1,751 @@ +// ================================================== +// DOM Timeline core (MIT Licensed) +// https://github.com/FremyCompany/dom-timeline-core +// ================================================== + +// +// if you didn't specify domTimelineOptions before this line, +// those options will be use as the default options +// +var domTimelineOptions = domTimelineOptions || { + + // ------------------------------------------------------------------------------------------------------------------ + // if true, the script will try to attribute changes to javascript stack traces + // ------------------------------------------------------------------------------------------------------------------ + // note: this incurs an important dom performance impact on the page + // ------------------------------------------------------------------------------------------------------------------ + // note: when this script is not run first on the page, this feature may not work completely + // to make sure it is run first, put a breakpoint before the first script of the page, + // and execute it in the console before continuing the page execution + // ------------------------------------------------------------------------------------------------------------------ + enableCallstackTracking: true, + + // ------------------------------------------------------------------------------------------------------------------ + // when false, the script won't start recording changes until you press F9 or call domHistory.startRecording() + // ------------------------------------------------------------------------------------------------------------------ + startRecordingImmediately: false, + + // ------------------------------------------------------------------------------------------------------------------ + // this function is called whenever (claimed or unclaimed) change records are being added to the dom history + // its primary purpose is to allow you to log these events (in whole or after applying some filter) + // ------------------------------------------------------------------------------------------------------------------ + considerLoggingRecords(claim,records,stack) { + //console.groupCollapsed(claim+" ["+records.length+"]");{ + // for(let record of records) { console.log(record); } + // console.log(stack||"(no known stack)"); + // console.groupEnd(); + //}; + }, + + // ------------------------------------------------------------------------------------------------------------------ + // this function is being called inline when a change record is being discovered + // its primary usage is to allow you to break into the debugger in the context of the change + // ------------------------------------------------------------------------------------------------------------------ + // note: this feature requires 'enableCallstackTracking' being on and working (otherwise some changes will be unclaimed) + // ------------------------------------------------------------------------------------------------------------------ + considerDomBreakpoint(m) { + //if(m.attributeName=='style' && m.target.id=='configStackPage_1' && m.newValue && m.newValue.indexOf('block')>=0) { + // debugger; + //} + }, + + // ------------------------------------------------------------------------------------------------------------------ + // this function is being called inline when a change record is being discovered (before it is added to history) + // its primary usage is to allow you to return "false" and avoid the change to clutter the history + // ------------------------------------------------------------------------------------------------------------------ + // note: not including a change in the history means it cannot be undone/redone! + // note: this feature may be easier to use if 'enableCallstackTracking' is on and working + // ------------------------------------------------------------------------------------------------------------------ + considerIgnoringRecord(m) { + + var e = m.target; + var shouldIgnore = false; + + // ignore vorlon overlays + shouldIgnore = shouldIgnore || !!(e.id && e.id.indexOf("vorlon") == 0); + shouldIgnore = shouldIgnore || !!(closest(e,"[id^='vorlon']")); + shouldIgnore = shouldIgnore || !!(m.addedNodes[0] && m.addedNodes[0].id && m.addedNodes[0].id.indexOf("vorlon") == 0); + shouldIgnore = shouldIgnore || !!(m.addedNodes[1] && m.addedNodes[1].id && m.addedNodes[1].id.indexOf("vorlon") == 0); + shouldIgnore = shouldIgnore || !!(m.removedNodes[0] && m.removedNodes[0].id && m.removedNodes[0].id.indexOf("vorlon") == 0); + shouldIgnore = shouldIgnore || !!(m.removedNodes[1] && m.removedNodes[1].id && m.removedNodes[1].id.indexOf("vorlon") == 0); + + // ignore vorlon modernizer + shouldIgnore = shouldIgnore || !!(m.stack && m.stack.indexOf("vorlon/plugins/modernizrReport/modernizr.js") >= 0); + + // ignore vorlon's inspect overlays + shouldIgnore = shouldIgnore || !!(m.stack && m.stack.indexOf("vorlon.max.js") >= 0 && m.stack.indexOf("DOMExplorerClient.inspect") >= 0); + + // ignore vorlon scripts and styles + shouldIgnore = shouldIgnore || !!(e.tagName == "LINK" && e.href.indexOf("vorlon") >= 0); + shouldIgnore = shouldIgnore || !!(e.tagName == "STYLE" && e.src.indexOf("vorlon") >= 0); + shouldIgnore = shouldIgnore || !!(e.tagName == "SCRIPT" && e.src.indexOf("vorlon") >= 0); + shouldIgnore = shouldIgnore || !!(m.addedNodes[0] && m.addedNodes[0].href && m.addedNodes[0].href.indexOf("vorlon") >= 0); + shouldIgnore = shouldIgnore || !!(m.addedNodes[1] && m.addedNodes[1].href && m.addedNodes[1].href.indexOf("vorlon") >= 0); + shouldIgnore = shouldIgnore || !!(m.removedNodes[0] && m.removedNodes[0].href && m.removedNodes[0].href.indexOf("vorlon") >= 0); + shouldIgnore = shouldIgnore || !!(m.removedNodes[1] && m.removedNodes[1].href && m.removedNodes[1].href.indexOf("vorlon") >= 0); + shouldIgnore = shouldIgnore || !!(m.addedNodes[0] && m.addedNodes[0].src && m.addedNodes[0].src.indexOf("vorlon") >= 0); + shouldIgnore = shouldIgnore || !!(m.addedNodes[1] && m.addedNodes[1].src && m.addedNodes[1].src.indexOf("vorlon") >= 0); + shouldIgnore = shouldIgnore || !!(m.removedNodes[0] && m.removedNodes[0].src && m.removedNodes[0].src.indexOf("vorlon") >= 0); + shouldIgnore = shouldIgnore || !!(m.removedNodes[1] && m.removedNodes[1].src && m.removedNodes[1].src.indexOf("vorlon") >= 0); + return shouldIgnore; + + function closest(e,s) { + if(e.closest) { + return e.closest(s); + } else { + while((e = e.parentNode) && (!matches(e,s))) {} + return e; + } + function matches(e,s) { + return ( + e.matches ? e.matches(s) : + e.matchesSelector ? e.matchesSelector(s) : + e.webkitMatchesSelector ? e.webkitMatchesSelector(s) : + e.mozMatchesSelector ? e.mozMatchesSelector(s) : + e.msMatchesSelector ? e.msMatchesSelector(s) : + false + ); + } + } + } + +}; + +// +// from there, you can find the actual dom-timeline-core code +// +void function() { + "use strict"; + + // prepare to store the mutations + let recordingStartDate = (window.performance ? window.performance.now() : Date.now()); + var domHistoryPast = []; + var domHistoryFuture = []; + var domHistory = window.domHistory = { + + // ------------------------------------------------------------------------------------------------------------------ + // this MutationRecord array contains past dom changes of the page, ready to undo + // ------------------------------------------------------------------------------------------------------------------ + past: domHistoryPast, + + // ------------------------------------------------------------------------------------------------------------------ + // this MutationRecord array contains undoed dom changes of the page, ready to redo + // ------------------------------------------------------------------------------------------------------------------ + // note: if this array is not empty, the page will be frozen to avoid rewriting the history + // ------------------------------------------------------------------------------------------------------------------ + future: domHistoryFuture, + + // ------------------------------------------------------------------------------------------------------------------ + // this MutationRecord array contains dom changes that were canceled just after execution, due to a future already existing + // ------------------------------------------------------------------------------------------------------------------ + lostFuture: [], + + // ------------------------------------------------------------------------------------------------------------------ + // takes the last dom change added to the past history, undoes it, and add it to the future history + // ------------------------------------------------------------------------------------------------------------------ + // note: this will lock the page in past history, potentially breaking page scripts + // ------------------------------------------------------------------------------------------------------------------ + undo() { + + // clean records + logUnclaimedMutations(o.takeRecords()); + + // get mutation to undo + var mutation = domHistoryPast.pop(); + if(!mutation) return false; + + // undo it + try { + isDoingOffRecordsMutations++; + domHistoryFuture.push(mutation); + undoMutationRecord(mutation); + } finally { + isDoingOffRecordsMutations--; + o.takeRecords(); + } + + return true; + + }, + + // ------------------------------------------------------------------------------------------------------------------ + // takes the last dom change added to the future history, redoes it, and add it to the past history + // ------------------------------------------------------------------------------------------------------------------ + // note: this could unlock the page future history, if this was the last future change to apply + // ------------------------------------------------------------------------------------------------------------------ + redo() { + + // clean records + logUnclaimedMutations(o.takeRecords()); + + // get mutation to undo + var mutation = domHistoryFuture.pop(); + if(!mutation) return false; + + // undo it + try { + isDoingOffRecordsMutations++; + domHistoryPast.push(mutation); + redoMutationRecord(mutation); + } finally { + isDoingOffRecordsMutations--; + o.takeRecords(); + } + + return true; + + }, + + startRecording() { + if(isRecordingStopped) { + isRecordingStopped = false; + return true; + } + if(isDoingOffRecordsMutations >= 1e9) { + isDoingOffRecordsMutations -= 1e9; + recordingStartDate = (window.performance ? window.performance.now() : Date.now()); + return true; + } + return false; + }, + + stopRecording() { + if(isDoingOffRecordsMutations >= 1e9) { + return false; + } + if(!isRecordingStopped) { + isRecordingStopped = true; + return false; + } + return true; + }, + + get isRecording() { + return !(isRecordingStopped || isDoingOffRecordsMutations >= 1e9); + }, + + get isRecordingStopped() { + return isRecordingStopped; + } + + }; + + // create an observer + let o = new MutationObserver(logUnclaimedMutations); + + // allow things to be off-records + let isRecordingStopped = false; + let isDoingOffRecordsMutations = +false; + function getAttribute(target, attributeName) { + try { + isDoingOffRecordsMutations++; + return target.getAttribute(attributeName); + } finally { + isDoingOffRecordsMutations--; + } + } + + // hook the observer + o.observe( + document.documentElement, + { + childList: true, + attributes: true, + characterData: true, + subtree: true, + attributeOldValue: true, + characterDataOldValue: true + } + ); + + // disable recording if asked to do some + if(!domTimelineOptions.startRecordingImmediately) { + isDoingOffRecordsMutations += 1e9; + window.addEventListener('keydown', e=>{ if(e.keyCode==120) domHistory.startRecording(); }, true); + } + + // enable callstack tracking + if(domTimelineOptions.enableCallstackTracking) { + console.groupCollapsed("domTimelineOptions.enableCallstackTracking==true"); + try { + enableCallstackTracking(); + } finally { + console.groupEnd(); + } + } + + // notify everything went fine + console.log("setup completed without error"); return; + //----------------------------------------------------------------------------------------------------- + + // + // save the newValue attribute on records to enable redo, and add them to history + // + function postProcessRecords(records,stack,claim) { + + // we cancel immediately any mutation which would be added to the past history when there is already a future + if(domHistoryFuture.length > 0 || isRecordingStopped) { + + if(domHistory.lostFuture.length == 0) { + console.warn("DOM Mutations were canceled because we are reviewing the past and there is already a future (see domHistory.lostFuture)"); + domHistory.lostFuture.push.apply(domHistory.lostFuture, records); + } else { + domHistory.lostFuture.push.apply(domHistory.lostFuture, records); + } + + try { + isDoingOffRecordsMutations++; + for(var i = records.length; i--;) { + undoMutationRecord(records[i]) + } + } finally { + isDoingOffRecordsMutations--; + records.length = 0; + o.takeRecords(); + } + return; + + } + + // otherwise, we post process the records + if(records.length == 1) { + + var record = records[0]; + if(record.type == 'attributes') { + + var target = record.target; + var attrName = record.attributeName; + record.newValue = getAttribute(target,attrName); + + } else if(record.type == 'characterData') { + + var target = record.target; + record.newValue = target.nodeValue; + + } + + record.claim = claim; + record.stack = stack; + record.timestamp = (window.performance ? window.performance.now() : Date.now())-recordingStartDate; + + // give the owner an opportunity to hide the record + if(domTimelineOptions.considerIgnoringRecord(record)) { + records.length = 0; + } else { + domHistoryPast.push(record); + } + + // give the owner an opportunity to break into javascript + domTimelineOptions.considerDomBreakpoint(record); + + } else { + + var containsAnyNull = false; + var latestAttributeValues = new Map(); + var latestCharacterDataValues = new Map(); + for(var i = records.length; i--;) { + + var record = records[i]; + if(record.type == 'attributes') { + + var target = record.target; + var attrName = record.attributeName; + var attrValues = latestAttributeValues.get(target); + if(!attrValues) latestAttributeValues.set(target, attrValues={}); + record.newValue = attrValues[attrName] || getAttribute(target,attrName); + attrValues[attrName] = record.oldValue; + + } else if(record.type == 'characterData') { + + var target = record.target; + var newValue = latestCharacterDataValues.get(target); + record.newValue = (newValue != undefined) ? (newValue) : (target.nodeValue); + latestCharacterDataValues.set(target, record.oldValue); + + } + + record.stack = stack; + + // give the owner an opportunity to hide the record + if(domTimelineOptions.considerIgnoringRecord(record)) { + records[i] = null; containsAnyNull = true; + } + + // give the owner an opportunity to break into javascript + domTimelineOptions.considerDomBreakpoint(record); + + } + + // remove from the records anything that has been ignored + if(containsAnyNull) { + for(var i=0, j=0; i--;) { + if(records[i] !== null) { + records[j++] = newRecords[i]; + } + } + records.length = j; + } + + domHistoryPast.push.apply(domHistoryPast, records); + } + } + + // + // log mutations which are not claimed by a monitored function call + // + function logUnclaimedMutations(inputRecords) { + var stack = undefined, claim = "unclaimed"; + var records = inputRecords || o.takeRecords(); + if(records && records.length && isDoingOffRecordsMutations<1e9) { + + postProcessRecords(records,stack,claim); + if(records.length) { + domTimelineOptions.considerLoggingRecords(claim,records,stack); + } + + } + } + + // + // log mutations which are claimed by a monitored function call + // + function logClaimedMutations(claim, stack) { + var records = o.takeRecords(); + if(records && records.length) { + + postProcessRecords(records,stack,claim); + if(records.length) { + domTimelineOptions.considerLoggingRecords(claim,records,stack); + } + + } + } + + // + // enable callstack support + // + function enableCallstackTracking() { + + // before hooking anything, get an instance of important classes + var classListInstance = document.documentElement.classList; + var styleInstance = document.documentElement.style; + + // the style object is special in some browsers, we need special attention to it + if("style" in window.Element.prototype) wrapStyleInProxy(window.Element); + if("style" in window.SVGElement.prototype) wrapStyleInProxy(window.SVGElement); + if("style" in window.HTMLElement.prototype) wrapStyleInProxy(window.HTMLElement); + + // otherwhise, we can hook most properties and functions from those classes + for(let protoName of ['SVGElement','HTMLElement','Element','Node','Range','Selection',classListInstance,styleInstance]) { + try{ + let proto = (typeof(protoName) == 'string') ? (window[protoName].prototype) : Object.getPrototypeOf(protoName); + protoName = (typeof(protoName) == 'string') ? protoName : Object.prototype.toString.call(protoName).replace(/\[object (.*)\]/,'$1'); + + // for each property, we might want to setup a hook + for(let propName of Object.getOwnPropertyNames(proto)) { + if(/^on/.test(propName)) { continue/* and don't mess with events */; } + + let prop = Object.getOwnPropertyDescriptor(proto, propName); + if("value" in prop) { + if(typeof(prop.value) == 'function' && propName != "constructor") { + + console.log(`patching ${protoName}.prototype.${propName} as a function`); + try { + + proto[propName] = function() { + isDoingOffRecordsMutations || logUnclaimedMutations(); + let result = prop.value.apply(this, arguments); + isDoingOffRecordsMutations || logClaimedMutations("call "+propName, new Error().stack.replace(/^Error *\r?\n/i,'')); + return result; + }; + + } catch (ex) { + console.log(ex); + } + + } else { + console.log(`skipping ${protoName}..${propName} as a constant`); + } + } else { + + console.log(`patching ${protoName}..${propName} as a property`); + try { + + if(!prop.get || !/native code/.test(prop.get)) { continue; } + Object.defineProperty(proto, propName, { + get() { + try { + let result = prop.get.apply(this,arguments); + return result; + } catch (ex) { + if(ex.stack.indexOf("Illegal invocation")==-1) { + throw ex; + } else { + console.log(ex); + } + } + }, + set() { + //if(propName=="transitionDelay") { console.warn("Blocked transitionDelay"); return; } + isDoingOffRecordsMutations || logUnclaimedMutations(); + let result = prop.set ? prop.set.apply(this,arguments) : undefined; + isDoingOffRecordsMutations || logClaimedMutations("set "+propName, new Error().stack.replace(/^Error *\r?\n/i,'')); + return result; + } + }); + + } catch (ex) { + console.log(ex); + } + + } + } + } catch (ex) { + console.error("Gave up hooking into ", ""+protoName, ex.message); + } + } + + function wrapStyleInProxy(HTMLElement) { + var propName = 'style'; + var prop = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'style'); + Object.defineProperty(HTMLElement.prototype, 'style', { + get() { + try { + let result = prop.get.apply(this,arguments); + return wrapInProxy( + result, + propName, + (claim)=>(isDoingOffRecordsMutations || logUnclaimedMutations()), + (claim)=>(isDoingOffRecordsMutations || logClaimedMutations(claim, new Error().stack.replace(/^Error *\r?\n/i,''))) + ); + } catch (ex) { + if(ex.stack.indexOf("Illegal invocation")==-1) { + throw ex; + } else { + console.log(ex); + } + } + }, + set() { + isDoingOffRecordsMutations || logUnclaimedMutations(); + let result = prop.set.apply(this,arguments); + isDoingOffRecordsMutations || logClaimedMutations("set "+propName, new Error().stack.replace(/^Error *\r?\n/i,'')); + return result; + } + }); + } + + // some objects need special wrapping, which we try to get using a proxy + function wrapInProxy(obj,objName,onbeforechange,onafterchange) { + + if(window.Proxy) { + + // wrap using proxy + return new Proxy(obj, { + "get": function (oTarget, sKey) { + return oTarget[sKey]; + }, + "set": function (oTarget, sKey, vValue) { + //if(sKey=="transitionDelay") { console.warn("Blocked transitionDelay"); return; } + onbeforechange("set " + objName + "." + sKey); + var result = oTarget[sKey] = vValue; + onafterchange("set " + objName + "." + sKey); + return true; + } + }); + + } else { + + // wrap using exhaustive property forwarding + var shapeSource = getComputedStyle(document.documentElement); + var o = {__proto__:document.documentElement.style.__proto__}; + Object.keys(shapeSource).forEach(function(key) { + var lowerKey = key.replace(/./,c=>c.toLowerCase()); + var upperKey = key.replace(/./,c=>c.toUpperCase()); + var cssKey = key.replace(/[A-Z]/g,c=>'-'+c.toLowerCase()); + var cssPrefixKey = '-'+cssKey; + // create a getter for that key + if(lowerKey in obj) { + Object.defineProperty(o, lowerKey, { + get: function() { + return obj[lowerKey]; + }, + set: function(value) { + onbeforechange("set " + objName + "." + key); + var result = obj[lowerKey]=value; + onafterchange("set " + objName + "." + key); + return result; + } + }); + } + // create a getter for a possible hidden key + if(upperKey in obj) { + Object.defineProperty(o, upperKey, { + get: function() { + return obj[upperKey]; + }, + set: function(value) { + onbeforechange("set " + objName + "." + key); + var result = obj[upperKey]=value; + onafterchange("set " + objName + "." + key); + return result; + } + }); + } + // create a getter for a possible hidden css key + if(cssKey in obj) { + Object.defineProperty(o, cssKey, { + get: function() { + return obj[cssKey]; + }, + set: function(value) { + onbeforechange("set " + objName + "." + key); + var result = obj[cssKey]=value; + onafterchange("set " + objName + "." + key); + return result; + } + }); + } + // create a getter for a possible hidden prefixed css key + if(cssPrefixKey in obj) { + Object.defineProperty(o, cssPrefixKey, { + get: function() { + return obj[cssPrefixKey]; + }, + set: function(value) { + onbeforechange("set " + objName + "." + key); + var result = obj[cssPrefixKey]=value; + onafterchange("set " + objName + "." + key); + return result; + } + }); + } + }); + + } + + } + + } + + // + // execute the action which cancels a mutation record + // + function undoMutationRecord(change) { + switch(change.type) { + + // + case "attributes": + change.target.setAttribute(change.attributeName, change.oldValue); + return; + + // + case "characterData": + change.target.nodeValue = change.oldValue; + return; + + // + case "childList": + if(change.addedNodes) { + for(var i = change.addedNodes.length; i--;) { + change.addedNodes[i].remove(); + } + } + if(change.removedNodes) { + var lastNode = change.nextSibling; + for(var i = change.removedNodes.length; i--;) { + change.target.insertBefore(change.removedNodes[i], lastNode); + lastNode = change.removedNodes[i]; + } + } + return; + + } + } + + // + // execute the action which replicates a mutation record + // + function redoMutationRecord(change) { + switch(change.type) { + + // + case "attributes": + change.target.setAttribute(change.attributeName, change.newValue); + return; + + // + case "characterData": + change.target.nodeValue = change.newValue; + return; + + // + case "childList": + if(change.addedNodes) { + var lastNode = change.nextSibling; + for(var i = change.addedNodes.length; i--;) { + change.target.insertBefore(change.addedNodes[i], lastNode); + lastNode = change.addedNodes[i]; + } + } + if(change.removedNodes) { + for(var i = change.removedNodes.length; i--;) { + change.removedNodes[i].remove(); + } + } + return; + + } + } + +}(); + +// +// this is where we enable to "dom timeline animation" demo on pressing down F10 +// +void function() { + + // enable shortcut for animation + window.addEventListener('keydown', e=>{ if(e.keyCode==121) animateDOMHistory(); }, true); + + function animateDOMHistory() { + + if(animateDOMHistory.timer) { + console.log("stopping animation (we may be locked in the past)"); + window.clearInterval(animateDOMHistory.timer); + animateDOMHistory.timer = 0; + return; + } + + var historyLength = (domHistory.past.length + domHistory.future.length); + + var wait = 0; + var wait3s = 3000/(10000/historyLength); + + console.log("starting animation"); + while(domHistory.past.length > 0) { + domHistory.undo(); + } + + animateDOMHistory.timer = window.setInterval(function() { + if(domHistory.future.length == 0) { + if(wait == 0) console.log('start waiting'); + if(wait++ >= wait3s) { + console.log('rewinding all events'); + while(domHistory.past.length > 0) { + domHistory.undo(); + } + wait = 0; + } + } else { + domHistory.redo(); + } + },10000/historyLength); + + } +}(); + +// +// we are done :-) +// +"setup completed without error"; \ No newline at end of file From 697e3ddccaf87d7b2b5995bc7b82ceee75917b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20REMY?= Date: Mon, 9 May 2016 00:09:35 -0700 Subject: [PATCH 08/53] Updated: reduced dom-timeline data transfers & computation --- .../domtimeline/vorlon.domtimeline.client.ts | 50 +++++++++++-------- .../vorlon.domtimeline.dashboard.ts | 11 +++- 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.client.ts b/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.client.ts index 32cbfd06..f43d2013 100644 --- a/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.client.ts +++ b/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.client.ts @@ -2,6 +2,7 @@ /// var domTimelineOptions: any; interface ExtentedMutationRecord extends MutationRecord { + claim: string stack: string timestamp: number newValue: string @@ -21,7 +22,7 @@ var domHistory: { isRecording:boolean isRecordingStopped:boolean - generateDashboardData:()=>any + generateDashboardData:(knownEvents:number)=>any }; interface Window { @@ -30,9 +31,8 @@ interface Window { interface DataForEntry { type:string, description: string, - isCancelled: boolean, timestamp: number, - details: any + details: any, } module VORLON { export class DOMTimelineClient extends ClientPlugin { @@ -59,22 +59,34 @@ module VORLON { // Start the clientside code public startClientSide(): void { - domHistory.generateDashboardData = function() { + domTimelineOptions.considerLoggingRecords = function(c,entries,s) { + for(var i = entries.length; i--;) { + var e = entries[i]; + e.__dashboardData = generateDashboardDataForEntry(e); + } + } + domHistory.generateDashboardData = function(knownEvents) { var data:any = {}; data.isRecordingNow = domHistory.isRecording; data.isRecordingEnded = domHistory.isRecordingStopped; data.isPageFrozen = domHistory.future.length>0; + data.pastEventsCount = domHistory.past.length; + data.futureEventsCounts = domHistory.future.length; data.history = ( [] - .concat(domHistory.past.map(generateDashboardDataForPastEntry)) - .concat(domHistory.future.map(generateDashboardDataForFutureEntry)) + .concat(domHistory.past.map(getDashboardDataForEntry)) + .concat(domHistory.future.map(getDashboardDataForEntry)) ); + data.history.splice(0,knownEvents); data.lostFuture = ( - domHistory.lostFuture.map(generateDashboardDataForFutureEntry) + domHistory.lostFuture.map(getDashboardDataForEntry) ); return data; } - function generateDashboardDataForEntry(e:ExtentedMutationRecord, isCancelled:boolean):DataForEntry { + function getDashboardDataForEntry(e) { + return (e).__dashboardData; + } + function generateDashboardDataForEntry(e:ExtentedMutationRecord):DataForEntry { var targetDescription = descriptionOf(e.target); if(e.addedNodes.length > 0) { var nodeDescription = ( @@ -85,12 +97,12 @@ module VORLON { return { type:"added", description: "Inserted " + nodeDescription + " into " + targetDescription, - isCancelled: isCancelled, timestamp: e.timestamp, details: { "Added nodes": descriptionOfNodeList(e.addedNodes), "Target": targetDescription, "Timestamp": e.timestamp/1000+"s", + "Claim": e.claim, "Stack": "`"+e.stack+"`" } } @@ -103,12 +115,12 @@ module VORLON { return { type:"removed", description: "Removed " + nodeDescription + " from " + targetDescription, - isCancelled: isCancelled, timestamp: e.timestamp, details: { "Removed nodes": descriptionOfNodeList(e.addedNodes), "Target": targetDescription, "Timestamp": e.timestamp/1000+"s", + "Claim": e.claim, "Stack": "`"+e.stack+"`" } } @@ -117,7 +129,6 @@ module VORLON { return { type:"updated", description: "Removed attribute `"+e.attributeName+"` from " + targetDescription, - isCancelled: isCancelled, timestamp: e.timestamp, details: { "Attribute name": e.attributeName, @@ -125,6 +136,7 @@ module VORLON { "New value": e.newValue, "Target": targetDescription, "Timestamp": e.timestamp/1000+"s", + "Claim": e.claim, "Stack": "`"+e.stack+"`" } } @@ -132,7 +144,6 @@ module VORLON { return { type:"updated", description: "Added attribute `"+e.attributeName+"` to " + targetDescription, - isCancelled: isCancelled, timestamp: e.timestamp, details: { "Attribute name": e.attributeName, @@ -140,6 +151,7 @@ module VORLON { "New value": e.newValue, "Target": targetDescription, "Timestamp": e.timestamp/1000+"s", + "Claim": e.claim, "Stack": "`"+e.stack+"`" } } @@ -147,7 +159,6 @@ module VORLON { return { type:"updated", description: "Updated attribute `"+e.attributeName+"` of " + targetDescription, - isCancelled: isCancelled, timestamp: e.timestamp, details: { "Attribute name": e.attributeName, @@ -155,6 +166,7 @@ module VORLON { "New value": e.newValue, "Target": targetDescription, "Timestamp": e.timestamp/1000+"s", + "Claim": e.claim, "Stack": "`"+e.stack+"`" } } @@ -164,31 +176,25 @@ module VORLON { return { type:"updated", description: "Updated text content of " + nodeDescription, - isCancelled: isCancelled, timestamp: e.timestamp, details: { "Old value": e.oldValue, "New value": e.newValue, "Timestamp": e.timestamp/1000+"s", + "Claim": e.claim, "Stack": "`"+e.stack+"`" } } } } - function generateDashboardDataForPastEntry(e:ExtentedMutationRecord) { - return generateDashboardDataForEntry(e,false); - } - function generateDashboardDataForFutureEntry(e:ExtentedMutationRecord) { - return generateDashboardDataForEntry(e,true); - } function descriptionOf(e:Node) { if(e instanceof HTMLElement) { if(e.firstChild) { e = e.cloneNode(false); e.appendChild(document.createTextNode("…")); - return "`"+e.outerHTML+"`" + return "`"+(e).outerHTML+"`" } else { - return "`"+e.outerHTML+"`" + return "`"+(e).outerHTML+"`" } } if(e instanceof SVGElement) { return "`<"+e.tagName+"…>`" } diff --git a/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts b/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts index bce5640c..3457082a 100644 --- a/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts +++ b/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts @@ -55,10 +55,17 @@ module VORLON { }); // Refresh the output from time to time + var alreadyKnownEvents = []; setInterval(function() { me.sendMessageToClient( - "domHistory.generateDashboardData()", - (e)=>(me._outputDiv.textContent=JSON.stringify(e.message,null," ")) + "domHistory.generateDashboardData("+alreadyKnownEvents.length+")", + (e)=>{ + alreadyKnownEvents = e.message.history = alreadyKnownEvents.concat(e.message.history); + for(var i = alreadyKnownEvents.length; i--;) { + alreadyKnownEvents[i].isCancelled = i >= e.message.pastEventsCount; + } + me._outputDiv.textContent=JSON.stringify(e.message,null," "); + } ); }, 333); }) From 0a91d26c6877767a42e4f9f9a8aa749ce2a48aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20REMY?= Date: Mon, 9 May 2016 00:40:05 -0700 Subject: [PATCH 09/53] Updated: refresh more often now that refresh cost is almost zero --- .../Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts b/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts index 3457082a..a39140d8 100644 --- a/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts +++ b/Plugins/Vorlon/plugins/domtimeline/vorlon.domtimeline.dashboard.ts @@ -67,7 +67,7 @@ module VORLON { me._outputDiv.textContent=JSON.stringify(e.message,null," "); } ); - }, 333); + }, 100); }) } From 33882166a6dcb223d0f6b07708bce773871d129d Mon Sep 17 00:00:00 2001 From: Sofiene Djebali Date: Mon, 9 May 2016 12:19:20 +0200 Subject: [PATCH 10/53] Express base --- Plugins/Vorlon/plugins/express/README.md | 33 +++++++++ Plugins/Vorlon/plugins/express/control.html | 37 ++++++++++ Plugins/Vorlon/plugins/express/icon.png | Bin 0 -> 8668 bytes .../plugins/express/vorlon.express.client.ts | 67 ++++++++++++++++++ .../express/vorlon.express.dashboard.ts | 52 ++++++++++++++ Plugins/Vorlon/plugins/nodejs/icon.png | Bin 0 -> 27386 bytes 6 files changed, 189 insertions(+) create mode 100644 Plugins/Vorlon/plugins/express/README.md create mode 100644 Plugins/Vorlon/plugins/express/control.html create mode 100644 Plugins/Vorlon/plugins/express/icon.png create mode 100644 Plugins/Vorlon/plugins/express/vorlon.express.client.ts create mode 100644 Plugins/Vorlon/plugins/express/vorlon.express.dashboard.ts create mode 100644 Plugins/Vorlon/plugins/nodejs/icon.png diff --git a/Plugins/Vorlon/plugins/express/README.md b/Plugins/Vorlon/plugins/express/README.md new file mode 100644 index 00000000..db39b395 --- /dev/null +++ b/Plugins/Vorlon/plugins/express/README.md @@ -0,0 +1,33 @@ +# Sample plugin + +This is an example additional plugin for vorlon. It renders an input field into the Vorlon dashboard. If you type a message, it sends it to your client, which reverses it, and sends it back to be rendered into the dashboard. + +You can use this as a starting point for your own plugins. + +## Enabling the sample plugin + +To enable the sample plugin: + +1. Clone this github repo if you haven't already (`git clone git@github.com/MicrosoftDX/Vorlonjs`) +2. Modify `Server/config.json` to add the plugin, so it looks like this: + +```json +{ + "includeSocketIO": true, + "plugins": [ + { "id": "CONSOLE", "name": "Interactive Console", "panel": "bottom", "foldername" : "interactiveConsole", "enabled": true}, + { "id": "DOM", "name": "Dom Explorer", "panel": "top", "foldername" : "domExplorer", "enabled": true }, + { "id": "MODERNIZR", "name": "Modernizr","panel": "bottom", "foldername" : "modernizrReport", "enabled": true }, + { "id": "OBJEXPLORER", "name" : "Obj. Explorer","panel": "top", "foldername" : "objectExplorer", "enabled": true }, + { "id": "SAMPLE", "name" : "Sample","panel": "top", "foldername" : "sample", "enabled": true } + ] +} +``` + +3. From the root directory of the repository, install dependencies with `npm install`, build vorlon with `npm run build` and start the server with `npm start` (make sure you kill any existing vorlon servers running on your machine. You can now navigate to the vorlon dashboard as normal, and you'll see an additional tab in the list. + +## Modifying the plugin + +The plugin is based on two files (one for the client and one for the dashboard) who respectively extend from VORLON.ClientPlugin and VORLON.DashboardPlugin, as defined in `Plugins/Vorlon/vorlon.clientPlugin.ts` and `Plugins/Vorlon/vorlon.dashboardPlugin.ts` so you can see what methods are available for your plugin from there. You may also wish to look at the other existing plugins in `Plugins/Vorlon/plugins` for ideas. + +`control.html` will be inserted into the dashboard, as will `dashboard.css`. diff --git a/Plugins/Vorlon/plugins/express/control.html b/Plugins/Vorlon/plugins/express/control.html new file mode 100644 index 00000000..54eb96ef --- /dev/null +++ b/Plugins/Vorlon/plugins/express/control.html @@ -0,0 +1,37 @@ + + + + + + + + +
    +
    +
    +
    + +
    + + + +
    +
    +
    +
    +

    Routes

    +

    Requests

    +

    Sessions

    +

    Locals

    +
    +
    +
    + + + diff --git a/Plugins/Vorlon/plugins/express/icon.png b/Plugins/Vorlon/plugins/express/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b77fa8a4cf22862e6fc445009d30d8cc9fbb6f3d GIT binary patch literal 8668 zcmV<2AtT<2P)X+uL$Nkc;* zP;zf(X>4Tx07wm;mUmQB*%pV-y*Itk5+Wca^cs2zAksTX6$DXM^`x7XQc?|s+0 z08spb1j2M!0f022SQPH-!CVp(%f$Br7!UytSOLJ{W@ZFO_(THK{JlMynW#v{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(): void { + $('.open-menu').click(function() { + $('.open-menu').removeClass('active-menu'); + $('#searchlist').val(''); + $('.explorer-menu').hide(); + $('#' + $(this).data('menu')).show(); + $('.new-entry').fadeOut(); + $(this).addClass('active-menu'); + }); + } + + public onRealtimeMessageReceivedFromClientSide(receivedObject: any): void { + + } + } + + Core.RegisterDashboardPlugin(new ExpressDashboard()); +} diff --git a/Plugins/Vorlon/plugins/nodejs/icon.png b/Plugins/Vorlon/plugins/nodejs/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..564ba3746d130dbccea942c05d3545cf6e7ffa8c GIT binary patch literal 27386 zcmZ_0cRbba|399D?CfNfEi056l9es%87C>Gk>Eet&c;x}MkbdOn`l^%(d2{qYP@SCuEkyMcG<(j`KLM=~0hE?tJ8|6Iie zzp1zQFbV#`aM6%|c&QLYy9j=`VkxB}b?MTlxA?~tp#NaBIb@rG zU*3SpLSUK>7BF`cXY)(yCeQ3)JgTx;Fo-{fI* zZHYXN+|$nRlI{LZJ=B`V0g9I9CW|I%4EKOeDf2|J9Nb)~n7fmyQxV>J)lWp8FZvRX z^G#=z$b3S}**BjV=SPL$M1&ly+Mg^aQv!uiBJso3cD2^?=Ndx(u+P^h1g?tRB_WCAZGGK* zR z>WqI_ESS*QP*?G((D%1K+w+A=@+oX(p}gwO?l{8yLCT$e(C7zUV7HgbwjG1!CO zS^w9sy>5j5ExycaYqpHQ9tOZ3hp+32hC&i@s}7!-BEc{DAx~|yA_hVe%Bv9dtJOQv zXKhef8JStK!z+>wba6F{-(4;3SW36RUE6I#KItX=Y)V#H|FINa9Hw^Lmrf4683|Id z9u|-LQ`>G(v!?<`fAr9|u-hzjR~baUxlH7%L~}dfpbeOyx_a&KH!)L|kA2_db_k{_ zsiKUG88IDR>odC4(nZ+O54rmC(!P-3VD|k4>dVjX*_a9?1|*smfEiaZiAxtnn2-DgK&JekMQ z*C%pHNM)V|(b2R}px;Tn>I_t+{b?n*KDGO)?D@YkZ*d|`i?0_3Tb2FPOp2P(DM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R=hgGBE?-i0 znHwY-49cN($Noe@hB)Th{VKJ4!w&gAYTT}gYNnH<@ Jt7dce{{Vq6`#k^v literal 0 HcmV?d00001 From 4c2e8720794fdf41751086a04d8384d72d1b52f8 Mon Sep 17 00:00:00 2001 From: Sofiene Djebali Date: Mon, 9 May 2016 13:41:12 +0200 Subject: [PATCH 11/53] Config.json --- Server/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/config.json b/Server/config.json index 47a2c426..bbf04153 100644 --- a/Server/config.json +++ b/Server/config.json @@ -86,7 +86,7 @@ "id": "UWP", "name": "UWP apps", "panel": "top", - "foldername": "uwp", + "foldername": "uwp" }, { "id": "CONSOLE", From b5b103a2134f9a5252a1dd053a5017a6d31a7e75 Mon Sep 17 00:00:00 2001 From: Sofiene Djebali Date: Mon, 9 May 2016 13:43:39 +0200 Subject: [PATCH 12/53] icon domtimeline --- Plugins/Vorlon/plugins/domtimeline/icon.png | Bin 0 -> 2860 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Plugins/Vorlon/plugins/domtimeline/icon.png diff --git a/Plugins/Vorlon/plugins/domtimeline/icon.png b/Plugins/Vorlon/plugins/domtimeline/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..6c08f27e1f9aaf0577e2cca9ffb49313e801d53a GIT binary patch literal 2860 zcmZvec{r2{8^+(+7$(_9!;qcEma!9&WhSI^ghIl|dP)b0v6XkomR)0Chr%b>l3m^q zN<~+PY>jcOC0m3t_?+*$zW>g1UH9|5p6mJV{^!0EtbaSt!;R+#0D#BB+|1^P;6Flh z9PJ)Mx4|PI15GUK&_@%2_J}{ax%|x?0|5Xd_>W*fUV$(GaKE=OGqwvUSSbvzv%f6V zZv>&D?gI!Rn^kjuwQ>UYeUzKc!!e#gm#jZ*^S=0GZ096&mw%yM^hoAE^KRGtBHi-R zH&3%%ORQIvi6b2yla_HU7NEICMy!oYPjOOf1Gf#mizW6ndURQ#)zjnCf!oZRwVfwq z1rp4p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is)v*gUBl+qX6#X*azX@ok@N3*oGr zhLw|Eoh5AP+4Vpo5`m7zu2I6G5{&{nydk2Ncih}GEt7&=`of!qQ|=Cg1-QOHCLtaF zd}G-$mAsF0SAw?|`tFHOdW+O3H#4CM9i>!s)$s0*sbm48NL=&$w_5jnmnMyqJG*ZX zbY);bKB`LVo_;%6Te=^jbo}-dUX%Q$yPv1OM%J{A&3E9Nh_0I0{oxB3#@n!hj!jj= zicdMM6bsgQ3Uw*d(8&dTj%~Z}q z8LbzX?CUq#LUZPioIR>1k@N$t4`)x6tZO7T*T;xyJ-m(%wu(3QksSBc_106YDaWX%0eN=N{x96whs|hK|ykVfXbn1AIol@(TKa1?qmHByq(e%2)SPfJ1q|dJc zXPIIkG(XDQKxJxZSnDj{r>E1E>O6U=(xYn7%OeXF21IU)ZyaRVOX7A_JY2=vIGo;7 zyswKPTD0$-7dH(Ef70PZPnO?$eW3YMJNPtNZa#`HANY-|6gS#e>#Y|ydocG(TK{5Y zNRL>O-d-C^92=Ph9q*gM6-F1Z^^ZA2^A@qa(qCu?pErn&wpKxEiSp6X#A|Q zPaYVK?%?6|yfhgizB1<=+g%=ryH?|lyqXxv>92UO&B3(VwpJHZ;|3blgHPV3{_@b7 z(0j&>x>;lTQ88O(1VM98C!UfXn$sQH9{%xrJ|o-- z_nYkcVLH+h>vrK@Vdj;_%37ziiS|Ie2MyU)@KdR2GO5#HLp5%P5rBs!C-kQzws}R{vh>7yZYu!cubS7IlcAMKlHo2XlAo*3 zk8OJ(SU;k^l;AzQbw}>%ef7sai8M0q-1$7vUWU3VOpkEGe&6OXU1c5&7=4F-=Qd0& vFP Date: Mon, 9 May 2016 14:08:42 +0200 Subject: [PATCH 13/53] Fix position problem --- .../Scripts/typings/Vorlon/vorlon.tools.d.ts | 4 +- Server/config.json | 43 +++++++++++-------- Server/public/vorlon.dashboardManager.ts | 14 +----- 3 files changed, 27 insertions(+), 34 deletions(-) diff --git a/Server/Scripts/typings/Vorlon/vorlon.tools.d.ts b/Server/Scripts/typings/Vorlon/vorlon.tools.d.ts index 41908260..3752ab91 100644 --- a/Server/Scripts/typings/Vorlon/vorlon.tools.d.ts +++ b/Server/Scripts/typings/Vorlon/vorlon.tools.d.ts @@ -22,7 +22,7 @@ declare module VORLON { childs: Array; parent: FluentDOM; constructor(nodeType: string, className?: string, parentElt?: Element, parent?: FluentDOM); - static forElement(element: HTMLElement): FluentDOM; + static forElement(element: HTMLElement): VORLON.FluentDOM; addClass(classname: string): FluentDOM; toggleClass(classname: string): FluentDOM; className(classname: string): FluentDOM; @@ -37,7 +37,7 @@ declare module VORLON { style(name: string, val: string): FluentDOM; appendTo(elt: Element): FluentDOM; append(nodeType: string, className?: string, callback?: (fdom: FluentDOM) => void): FluentDOM; - createChild(nodeType: string, className?: string): FluentDOM; + createChild(nodeType: string, className?: string): VORLON.FluentDOM; click(callback: (EventTarget) => void): FluentDOM; blur(callback: (EventTarget) => void): FluentDOM; keydown(callback: (EventTarget) => void): FluentDOM; diff --git a/Server/config.json b/Server/config.json index 073994ba..417c031c 100644 --- a/Server/config.json +++ b/Server/config.json @@ -15,7 +15,14 @@ "vorlonServerURL": "", "vorlonProxyURL": "", "plugins": [ -<<<<<<< HEAD + { + "id": "OBJEXPLORER", + "name": "Obj. Explorer", + "panel": "top", + "foldername": "objectExplorer", + "enabled": true, + "nodeCompliant": true + }, { "id": "NODEJS", "name": "NodeJS", @@ -26,11 +33,12 @@ "nodeOnly": true }, { - "id": "DOM", - "name": "Dom Explorer", + "id": "XHRPANEL", + "name": "XHR", "panel": "top", - "foldername": "domExplorer", - "enabled": true + "foldername": "xhrPanel", + "enabled": true, + "nodeCompliant": true }, { "id": "DEVICE", @@ -40,12 +48,11 @@ "enabled": true }, { - "id": "OBJEXPLORER", - "name": "Obj. Explorer", + "id": "DOM", + "name": "Dom Explorer", "panel": "top", - "foldername": "objectExplorer", - "enabled": true, - "nodeCompliant": true + "foldername": "domExplorer", + "enabled": true }, { "id": "WEBSTANDARDS", @@ -54,14 +61,6 @@ "foldername": "webstandards", "enabled": true }, - { - "id": "XHRPANEL", - "name": "XHR", - "panel": "top", - "foldername": "xhrPanel", - "enabled": true, - "nodeCompliant": true - }, { "id": "NETWORK", "name": "Network Monitor", @@ -89,6 +88,13 @@ "panel": "top", "foldername": "uwp" }, + { + "id": "DOMTIMELINE", + "name": "DOM Timeline", + "panel": "bottom", + "foldername": "domtimeline", + "enabled": true + }, { "id": "CONSOLE", "name": "Interactive Console", @@ -132,7 +138,6 @@ "foldername": "screenshot", "enabled": false }, - { "id": "DOMTIMELINE", "name": "DOM Timeline", "panel": "bottom", "foldername": "domtimeline", "enabled": true }, { "id": "EXPRESS", "name": "Express", diff --git a/Server/public/vorlon.dashboardManager.ts b/Server/public/vorlon.dashboardManager.ts index 0b53ab2a..6d076c23 100644 --- a/Server/public/vorlon.dashboardManager.ts +++ b/Server/public/vorlon.dashboardManager.ts @@ -265,24 +265,12 @@ module VORLON { plugintab.textContent = plugin.name; plugintab.setAttribute('data-plugin-target', plugin.id); - if (!plugin.enabled){ + if (!plugin.enabled || (DashboardManager.NoWindowMode && !plugin.nodeCompliant) || (!DashboardManager.NoWindowMode && plugin.nodeOnly)){ plugintab.style.display = 'none'; divPluginBottomTabs.appendChild(plugintab); continue; } - if (DashboardManager.NoWindowMode) { - if (!plugin.nodeCompliant) { - continue; - } - } - - if (!DashboardManager.NoWindowMode) { - if (plugin.nodeOnly) { - continue; - } - } - var existingLocation = document.querySelector('[data-plugin=' + plugin.id + ']'); if (!existingLocation) { From 13009946623546434ab8991a6bb50998ee393490 Mon Sep 17 00:00:00 2001 From: Sofiene Djebali Date: Mon, 9 May 2016 17:14:43 +0200 Subject: [PATCH 14/53] Domtimeline --- Plugins/Vorlon/.gitignore | 10 +- .../Vorlon/plugins/domtimeline/control.css | 433 +- .../Vorlon/plugins/domtimeline/control.html | 68 +- Plugins/Vorlon/plugins/domtimeline/control.js | 326 + .../domtimeline/images/arrow-blue-b.PNG | Bin 0 -> 198 bytes .../plugins/domtimeline/images/arrow-blue.PNG | Bin 0 -> 180 bytes .../domtimeline/images/arrow-green-b.PNG | Bin 0 -> 180 bytes .../domtimeline/images/arrow-green.PNG | Bin 0 -> 183 bytes .../domtimeline/images/arrow-red-b.PNG | Bin 0 -> 206 bytes .../plugins/domtimeline/images/arrow-red.PNG | Bin 0 -> 180 bytes .../plugins/domtimeline/images/blind.png | Bin 0 -> 130 bytes .../Vorlon/plugins/domtimeline/images/lev.PNG | Bin 0 -> 349 bytes .../plugins/domtimeline/images/rule.PNG | Bin 0 -> 249 bytes .../Vorlon/plugins/domtimeline/jquery-ui.js | 16608 ++++++++++++++++ .../vorlon.domtimeline.dashboard.ts | 3 +- Plugins/Vorlon/plugins/express/control.css | 600 + Plugins/Vorlon/plugins/express/control.html | 2 +- Plugins/Vorlon/plugins/nodejs/control.css | 600 + Plugins/Vorlon/plugins/nodejs/control.html | 2 +- Server/config.json | 16 +- gulpfile.js | 1 + 21 files changed, 18614 insertions(+), 55 deletions(-) create mode 100644 Plugins/Vorlon/plugins/domtimeline/control.js create mode 100644 Plugins/Vorlon/plugins/domtimeline/images/arrow-blue-b.PNG create mode 100644 Plugins/Vorlon/plugins/domtimeline/images/arrow-blue.PNG create mode 100644 Plugins/Vorlon/plugins/domtimeline/images/arrow-green-b.PNG create mode 100644 Plugins/Vorlon/plugins/domtimeline/images/arrow-green.PNG create mode 100644 Plugins/Vorlon/plugins/domtimeline/images/arrow-red-b.PNG create mode 100644 Plugins/Vorlon/plugins/domtimeline/images/arrow-red.PNG create mode 100644 Plugins/Vorlon/plugins/domtimeline/images/blind.png create mode 100644 Plugins/Vorlon/plugins/domtimeline/images/lev.PNG create mode 100644 Plugins/Vorlon/plugins/domtimeline/images/rule.PNG create mode 100644 Plugins/Vorlon/plugins/domtimeline/jquery-ui.js create mode 100644 Plugins/Vorlon/plugins/express/control.css create mode 100644 Plugins/Vorlon/plugins/nodejs/control.css diff --git a/Plugins/Vorlon/.gitignore b/Plugins/Vorlon/.gitignore index a2ea6b47..7c6c6151 100644 --- a/Plugins/Vorlon/.gitignore +++ b/Plugins/Vorlon/.gitignore @@ -5,4 +5,12 @@ !plugins/domtimeline/** !plugins/domtimeline/**/*.css !plugins/domtimeline/**/*.js -!plugins/domtimeline/dom-timeline.js \ No newline at end of file +!plugins/domtimeline/dom-timeline.js +!plugins/express/** +!plugins/express/**/*.css +!plugins/express/**/*.js +!plugins/express/dom-timeline.js +!plugins/nodejs/** +!plugins/nodejs/**/*.css +!plugins/nodejs/**/*.js +!plugins/nodejs/dom-timeline.js \ No newline at end of file diff --git a/Plugins/Vorlon/plugins/domtimeline/control.css b/Plugins/Vorlon/plugins/domtimeline/control.css index 98d2227b..ebb52c1a 100644 --- a/Plugins/Vorlon/plugins/domtimeline/control.css +++ b/Plugins/Vorlon/plugins/domtimeline/control.css @@ -1,37 +1,416 @@ -.toolbar > * { - vertical-align: middle; +.plugin-domtimeline * { + font-family: 'Roboto'; + box-sizing: border-box; } -#echoInput { - width: 25%; - padding: 5px; - margin: 20px; - margin-bottom: 10px; +.plugin-domtimeline #dom-recorder { + width: 90%; + margin: auto; + padding-top: 20px; } -#output > p { - padding-bottom: 2px; - margin: 0; +.plugin-domtimeline #options { + margin-bottom: 20px; } -#toast { - position: absolute; - border: 1px solid gray; - border-radius: 5px; - background: #eee; - color: #555; - left: 50%; - bottom: 10px; - transform: translateX(-50%); - padding: 3px; - pointer-events: none; - opacity: 0.75; +.plugin-domtimeline #option-autorecord, #option-colorblind { + display: inline; } -#toast > p:not(:last-child) { - display: none; +.plugin-domtimeline #option-autorecord { + float:left; } -#toast > p:last-child { - display: inline; margin: 0; padding: 0; -} \ No newline at end of file +.plugin-domtimeline #option-colorblind { + float:right; +} + +.plugin-domtimeline #wrapper-timeline { + overflow-x: auto; + overflow-y: hidden; + width: 100%; + position: relative; + padding-bottom: 10px; + margin-bottom: 20px; +} + +.plugin-domtimeline #timeline { + cursor: crosshair; + height: 100px; + background-color: #FBFAF7; + background-image: url('images/rule.png'); + background-repeat-y: no-repeat; + position: relative; +} + +.plugin-domtimeline .clear { + clear: both; + color: #75655E; +} + +.plugin-domtimeline #node-changes { + position: relative; +} + +.plugin-domtimeline #node-changes input { + position: absolute; + right: 0px; + top: 25px; + padding: 5px 8px; + border-radius: 5px; + border: 1px solid #EEE9E0; + outline: none; +} + +.plugin-domtimeline #node-changes h1 { + font-family: 'Oswald'; + text-transform: uppercase; + font-size: 22px; + font-weight: 500; + margin-top: 0px; + margin-bottom: 5px; + color: #000000; +} + +.plugin-domtimeline ul.inline-changes { + padding: 0; + margin: 0; + list-style-type: none; + margin-bottom: 20px; +} + +.plugin-domtimeline ul.inline-changes li { + display: inline; + margin-right: 5px; +} + +.plugin-domtimeline ul.inline-changes li:before { + content: ''; + width: 10px; + height: 10px; + position:relative; + margin-right: 5px; + display: inline-block; +} + +.plugin-domtimeline .colorblind-off ul.inline-changes li.inline-changes-added:before { + background-color: #007C29; +} + +.plugin-domtimeline .colorblind-off ul.inline-changes li.inline-changes-removed:before { + background-color: #F2002D; +} + +.plugin-domtimeline .colorblind-off ul.inline-changes li.inline-changes-modified:before { + background-color: #223879; +} + +.plugin-domtimeline .colorblind-on ul.inline-changes li.inline-changes-added:before { + background-color: #555555; +} + +.plugin-domtimeline .colorblind-on ul.inline-changes li.inline-changes-removed:before { + background-color: none; + border: 1px solid #555555; +} + +.plugin-domtimeline .colorblind-on ul.inline-changes li.inline-changes-modified:before { + background-color: none; + border: 1px solid #555555; + background-image: url('images/blind.png'); +} + +.plugin-domtimeline +ul.accordion-changes { + height: 260px; + padding: 0; + margin: 0; + border: 1px solid #E0E0E0; + list-style-type: none; + overflow-y: scroll; +} + +.plugin-domtimeline ul.accordion-changes li { + cursor: pointer; + padding: 12px 20px; + border-bottom: 1px solid #E0E0E0; +} + +.plugin-domtimeline ul.accordion-changes li.hide-change { + background: rgba(107, 45, 129, 0.58); + opacity: 0.7; +} + +.plugin-domtimeline ul.accordion-changes li.hide-change:before { + display:none; +} + +.plugin-domtimeline ul.accordion-changes li .fa-undo { + display: none; + cursor: pointer; + margin-right: 10px; + float:right; +} + +.plugin-domtimeline ul.accordion-changes li:hover .fa-undo{ + display: inline; +} + +.plugin-domtimeline ul.accordion-changes li:before { + display: inline-block; + content: ""; + width: 8px; + height: 15px; + margin-right: 13px; + transition: all linear 0.2s; +} + +.plugin-domtimeline ul.accordion-changes li.rotate:before { + -ms-transform: rotate(90deg); /* IE 9 */ + -webkit-transform: rotate(90deg); /* Chrome, Safari, Opera */ + transform: rotate(90deg); +} + +.plugin-domtimeline .colorblind-off ul.accordion-changes li.accordion-changes-added:before { + background-image: url('images/arrow-green.png'); +} + +.plugin-domtimeline .colorblind-off ul.accordion-changes li.accordion-changes-removed:before { + background-image: url('images/arrow-red.png'); +} + +.plugin-domtimeline .colorblind-off ul.accordion-changes li.accordion-changes-modified:before { + background-image: url('images/arrow-blue.png'); +} + +.plugin-domtimeline .colorblind-on ul.accordion-changes li.accordion-changes-added:before { + background-image: url('images/arrow-green-b.png'); +} + +.plugin-domtimeline .colorblind-on ul.accordion-changes li.accordion-changes-removed:before { + background-image: url('images/arrow-red-b.png'); +} + +.plugin-domtimeline .colorblind-on ul.accordion-changes li.accordion-changes-modified:before { + background-image: url('images/arrow-blue-b.png'); +} + +.plugin-domtimeline +ul.accordion-changes li span { + float:right; +} + +.plugin-domtimeline .seconds-list { + position: relative; + height: 22px; + cursor: -moz-grab; + cursor: -webkit-grab; + cursor: grab; +} + +.plugin-domtimeline .seconds-list span { + position: absolute; + display: inline-block; + width: 61px; +} + +.plugin-domtimeline #timeline div { + position: absolute; + bottom: 0px; + width: 10px; + display: inline-block; +} + +.plugin-domtimeline #timeline div span { + cursor: pointer; + float: left; + width: 100%; + display: inline-block; +} + +.plugin-domtimeline .colorblind-off #timeline div span.added_h { + background-color: #007C29; +} + +.plugin-domtimeline .colorblind-off #timeline div span.removed_h { + background-color: #F2002D; +} + +.plugin-domtimeline .colorblind-off #timeline div span.modified_h { + background-color: #223879; +} + +.plugin-domtimeline .colorblind-on #timeline div span.added_h { + background-color: #555555; +} + +.plugin-domtimeline .colorblind-on #timeline div span.removed_h { + background-color: none; + border: 1px solid #555555; +} + +.plugin-domtimeline .colorblind-on #timeline div span.modified_h { + background-color: none; + border: 1px solid #555555; + background-image: url('images/blind.png'); +} + +.plugin-domtimeline .acc { + display: none; + padding: 0px !important; + display: block; + overflow: hidden; + transition: all linear 0.3s; + border-bottom: none !important; +} + +.plugin-domtimeline .acc table { + padding: 0px 50px; + display: block; +} + +.plugin-domtimeline .acc table .td-name { + font-weight: bold; + font-size: 17px; + margin-right: 15px; + padding-right: 20px; +} + +.plugin-domtimeline .lev { + background: transparent; + height: 100%; + position: relative; + left: 61px; + display: inline-block; + cursor: -moz-grab; + cursor: -webkit-grab; + cursor: grab; + border: 1px solid #6B2D81; + z-index: 10; +} + +.plugin-domtimeline .lev .drag-lev { + display: block; + width: 100%; + height: 100%; +} + +.plugin-domtimeline .lev .handle { + position: absolute; + top: 50%; + transform: translateY(-50%); + cursor: col-resize; + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Chrome/Safari/Opera */ + -khtml-user-select: none; /* Konqueror */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* Non-prefixed version, currently + not supported by any browser */ + display: inline-block; + background: url('images/lev.png'); + width: 14px; + height: 19px; +} + +.plugin-domtimeline .lev .lev1 { + left: -8px; +} + +.plugin-domtimeline .lev .lev2 { + right: -8px; +} + +.plugin-domtimeline #history-control { + margin-top: 20px; +} + +.plugin-domtimeline button { + background: #D7CDBF; + padding: 5px 15px; + border-radius: 5px; + border: 1px solid #D7CDBF; + cursor: pointer; +} + +.plugin-domtimeline .ui-selectable-helper { + background: #482045; + opacity: 0.5; +} + +.plugin-domtimeline #offsetW { + width: 100% !important; + height: 100% !important; + position: absolute !important; + top: 0px !important; + left: 0px !important; + z-index: 555; + display: none; +} + +.plugin-domtimeline #filter-changes { + margin-bottom: 20px; + display:none; +} + +.plugin-domtimeline #filter-changes input { + width: 40px; + margin-right: 3px; +} + +.plugin-domtimeline #filter-changes a { + text-decoration: none; + margin-left: 10px; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/*! Hint.css - v2.2.1 - 2016-03-26 +* http://kushagragour.in/lab/hint/ +* Copyright (c) 2016 Kushagra Gour; Licensed */ + +[data-hint]{position:relative;display:inline-block}[data-hint]:after,[data-hint]:before{position:absolute;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:1000000;pointer-events:none;-webkit-transition:.3s ease;-moz-transition:.3s ease;transition:.3s ease;-webkit-transition-delay:0ms;-moz-transition-delay:0ms;transition-delay:0ms}[data-hint]:hover:after,[data-hint]:hover:before{visibility:visible;opacity:1;-webkit-transition-delay:100ms;-moz-transition-delay:100ms;transition-delay:100ms}[data-hint]:before{content:'';position:absolute;background:0 0;border:6px solid transparent;z-index:1000001}[data-hint]:after{content:attr(data-hint);background:#383838;color:#fff;padding:8px 10px;font-size:12px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:12px;white-space:nowrap;text-shadow:0 -1px 0 #000;box-shadow:4px 4px 8px rgba(0,0,0,.3)}[data-hint='']:after,[data-hint='']:before{display:none!important}.hint--top-left:before,.hint--top-right:before,.hint--top:before{border-top-color:#383838}.hint--bottom-left:before,.hint--bottom-right:before,.hint--bottom:before{border-bottom-color:#383838}.hint--top:after,.hint--top:before{bottom:100%;left:50%}.hint--top:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top:after{-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);transform:translateX(-50%)}.hint--top:focus:before,.hint--top:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--top:focus:after,.hint--top:hover:after{-webkit-transform:translateX(-50%) translateY(-8px);-moz-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--bottom:after,.hint--bottom:before{top:100%;left:50%}.hint--bottom:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom:after{-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);transform:translateX(-50%)}.hint--bottom:focus:before,.hint--bottom:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--bottom:focus:after,.hint--bottom:hover:after{-webkit-transform:translateX(-50%) translateY(8px);-moz-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--right:before{border-right-color:#383838;margin-left:-11px;margin-bottom:-6px}.hint--right:after{margin-bottom:-14px}.hint--right:after,.hint--right:before{left:100%;bottom:50%}.hint--right:focus:after,.hint--right:focus:before,.hint--right:hover:after,.hint--right:hover:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--left:before{border-left-color:#383838;margin-right:-11px;margin-bottom:-6px}.hint--left:after{margin-bottom:-14px}.hint--left:after,.hint--left:before{right:100%;bottom:50%}.hint--left:focus:after,.hint--left:focus:before,.hint--left:hover:after,.hint--left:hover:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--top-left:after,.hint--top-left:before{bottom:100%;left:50%}.hint--top-left:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-left:after{-webkit-transform:translateX(-100%);-moz-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--top-left:focus:before,.hint--top-left:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--top-left:focus:after,.hint--top-left:hover:after{-webkit-transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--top-right:after,.hint--top-right:before{bottom:100%;left:50%}.hint--top-right:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-right:after{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--top-right:focus:after,.hint--top-right:focus:before,.hint--top-right:hover:after,.hint--top-right:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--bottom-left:after,.hint--bottom-left:before{top:100%;left:50%}.hint--bottom-left:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-left:after{-webkit-transform:translateX(-100%);-moz-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--bottom-left:focus:before,.hint--bottom-left:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--bottom-left:focus:after,.hint--bottom-left:hover:after{-webkit-transform:translateX(-100%) translateY(8px);-moz-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--bottom-right:after,.hint--bottom-right:before{top:100%;left:50%}.hint--bottom-right:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-right:after{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--bottom-right:focus:after,.hint--bottom-right:focus:before,.hint--bottom-right:hover:after,.hint--bottom-right:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--large:after,.hint--medium:after,.hint--small:after{white-space:normal;line-height:1.4em}.hint--small:after{width:80px}.hint--medium:after{width:150px}.hint--large:after{width:300px}.hint--error:after{background-color:#b34e4d;text-shadow:0 -1px 0 #592726}.hint--error.hint--top-left:before,.hint--error.hint--top-right:before,.hint--error.hint--top:before{border-top-color:#b34e4d}.hint--error.hint--bottom-left:before,.hint--error.hint--bottom-right:before,.hint--error.hint--bottom:before{border-bottom-color:#b34e4d}.hint--error.hint--left:before{border-left-color:#b34e4d}.hint--error.hint--right:before{border-right-color:#b34e4d}.hint--warning:after{background-color:#c09854;text-shadow:0 -1px 0 #6c5328}.hint--warning.hint--top-left:before,.hint--warning.hint--top-right:before,.hint--warning.hint--top:before{border-top-color:#c09854}.hint--warning.hint--bottom-left:before,.hint--warning.hint--bottom-right:before,.hint--warning.hint--bottom:before{border-bottom-color:#c09854}.hint--warning.hint--left:before{border-left-color:#c09854}.hint--warning.hint--right:before{border-right-color:#c09854}.hint--info:after{background-color:#3986ac;text-shadow:0 -1px 0 #1a3c4d}.hint--info.hint--top-left:before,.hint--info.hint--top-right:before,.hint--info.hint--top:before{border-top-color:#3986ac}.hint--info.hint--bottom-left:before,.hint--info.hint--bottom-right:before,.hint--info.hint--bottom:before{border-bottom-color:#3986ac}.hint--info.hint--left:before{border-left-color:#3986ac}.hint--info.hint--right:before{border-right-color:#3986ac}.hint--success:after{background-color:#458746;text-shadow:0 -1px 0 #1a321a}.hint--success.hint--top-left:before,.hint--success.hint--top-right:before,.hint--success.hint--top:before{border-top-color:#458746}.hint--success.hint--bottom-left:before,.hint--success.hint--bottom-right:before,.hint--success.hint--bottom:before{border-bottom-color:#458746}.hint--success.hint--left:before{border-left-color:#458746}.hint--success.hint--right:before{border-right-color:#458746}.hint--always:after,.hint--always:before{opacity:1;visibility:visible}.hint--always.hint--top:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top:after{-webkit-transform:translateX(-50%) translateY(-8px);-moz-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--always.hint--top-left:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top-left:after{-webkit-transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--always.hint--top-right:after,.hint--always.hint--top-right:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--bottom:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom:after{-webkit-transform:translateX(-50%) translateY(8px);-moz-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--always.hint--bottom-left:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom-left:after{-webkit-transform:translateX(-100%) translateY(8px);-moz-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--always.hint--bottom-right:after,.hint--always.hint--bottom-right:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--left:after,.hint--always.hint--left:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--always.hint--right:after,.hint--always.hint--right:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--rounded:after{border-radius:4px}.hint--no-animate:after,.hint--no-animate:before{-webkit-transition-duration:0ms;-moz-transition-duration:0ms;transition-duration:0ms}.hint--bounce:after,.hint--bounce:before{-webkit-transition:opacity .3s ease,visibility .3s ease,-webkit-transform .3s cubic-bezier(.71,1.7,.77,1.24);-moz-transition:opacity .3s ease,visibility .3s ease,-moz-transform .3s cubic-bezier(.71,1.7,.77,1.24);transition:opacity .3s ease,visibility .3s ease,transform .3s cubic-bezier(.71,1.7,.77,1.24)} \ No newline at end of file diff --git a/Plugins/Vorlon/plugins/domtimeline/control.html b/Plugins/Vorlon/plugins/domtimeline/control.html index 35c810ac..1705ca0c 100644 --- a/Plugins/Vorlon/plugins/domtimeline/control.html +++ b/Plugins/Vorlon/plugins/domtimeline/control.html @@ -1,16 +1,52 @@ -
    - -
    - - - - - - - -
    - -
    
    -	

    Ready for instructions

    - -
    + + + + Dom Timeline + + + + + + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + + + + +
    +
    +
    + Filter time range: s to s Reset range +
    +
    + +

    Node changes

    +
      +
    • added,
    • +
    • modified,
    • +
    • removed
    • +
    +
      +
      +
      + + + +
      +
      + + \ No newline at end of file diff --git a/Plugins/Vorlon/plugins/domtimeline/control.js b/Plugins/Vorlon/plugins/domtimeline/control.js new file mode 100644 index 00000000..0c7ab5c2 --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/control.js @@ -0,0 +1,326 @@ +var START_TIME = 0; +var FRAMES_PER_SECOND = 5; +var TIMELINE_SECONDS = 20; + +var setNumberChanges = function (timeline) { + document.querySelectorAll('.inline-changes-added span')[0].innerHTML = countStatus('added' ,timeline); + document.querySelectorAll('.inline-changes-removed span')[0].innerHTML = countStatus('removed' ,timeline); + document.querySelectorAll('.inline-changes-modified span')[0].innerHTML = countStatus('modified' ,timeline); +} + +var setChanges = function (changes) { + + changes.sort(function(a, b) { + return a.time - b.time; + }); + + var times = {}; + var max = {time: 0, count: 0}; + for (var i = 0, len = changes.length; i < len; i++) { + details_table = ''; + for (var t = 0, lenT = changes[i].details.length; t < lenT; t++) { + details_table += '' + changes[i].details[t].name + ':' + changes[i].details[t].value + ''; + } + var details = ''; + document.querySelectorAll('.accordion-changes')[0].innerHTML += '
    • ' + escapeHtml(changes[i].element) + ' ' + changes[i].status + ' ' + changes[i].time + 's
    • ' + details; + if (typeof times[changes[i].time] === 'undefined') { + times[changes[i].time] = {added: 0, removed: 0, modified: 0}; + } + times[changes[i].time][changes[i].status]++; + if (max.count < (times[changes[i].time].added + times[changes[i].time].removed + times[changes[i].time].modified)) { + max.count = (times[changes[i].time].added + times[changes[i].time].removed + times[changes[i].time].modified); + max.time = changes[i].time; + } + } + + + for (var i = 0; i < document.getElementsByClassName('acc-tr').length; i++) { + document.getElementsByClassName('acc-tr')[i].addEventListener('click', function(e) { + if ($(this).hasClass('hide-change')) { + e.preventDefault(); + return; + } + + if ($(this.nextElementSibling).css('display') == 'none') { + $(this.nextElementSibling).show(); + } else { + $(this.nextElementSibling).hide(); + } + + var className = 'rotate'; + + if ($(this.nextElementSibling).css('display') == 'block') { + if (this.classList) + this.classList.add(className); + else + this.className += ' ' + className; + } else { + if (this.classList) + this.classList.remove(className); + else + this.className = this.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); + } + }, false); + } + + for (var time in times) { + var times_h = ''; + times_h += ''; + times_h += ''; + document.getElementById('timeline').innerHTML += '
      ' + times_h + '
      '; + } + +} + +var setTimelineSeconds = function (s) { + var v = START_TIME; + for (var i = 0; i <= s; i++) { + var left = (i) ? ((i * 61) - (4 * i.toString().length)) : i; + document.querySelectorAll('.seconds-list')[0].innerHTML += '' + v + 's'; + v++; + } + document.getElementById('timeline').style.width = (s + 1) * 61 + 'px'; +} + +var setTimeline = function(timeline) { + setNumberChanges(timeline); + setChanges(timeline); + setTimelineSeconds(TIMELINE_SECONDS); +} + +var filterChanges = function(timeline, type) { + setNumberChanges(timeline); + $('.acc-tr').each(function(i) { + var time = parseFloat($(this).data('time')); + if($('#filter-changes').css('display') == 'none' || (time >= $('#filter-changes').find('.from').val() && time <= $('#filter-changes').find('.to').val())) { + $(this).removeClass('hide-change').addClass('show-change'); + } else { + $(this).removeClass('show-change').addClass('hide-change'); + } + }); + $(".accordion-changes").animate({ scrollTop: $('.show-change').first().data('id') * 44}, ((type == 'resize' || type == 'draggable') ? 0 : 500)); +} + +var levChanged = function(type) { + if (parseInt(document.getElementById('lev').style.width) > 0) { + $('#lev').css('border-width', '2px'); + $('#filter-changes').show(); + $('#filter-changes').find('.from').val(($('.lev').position().left / 61).toFixed(2)); + $('#filter-changes').find('.to').val((($('.lev').position().left + parseInt(document.getElementById('lev').style.width)) / 61).toFixed(2)); + } else { + $('#lev').css('border-width', '1px'); + $('#filter-changes').hide(); + } + filterChanges(timeline, type); +} + +var escapeHtml = function (str) { + return String(str) + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'") + .replace(/\//g, "/"); +} + +var validate = function (evt) { + var theEvent = evt || window.event; + var key = theEvent.keyCode || theEvent.which; + key = String.fromCharCode( key ); + var regex = /[0-9]|\./; + if( !regex.test(key) ) { + theEvent.returnValue = false; + if(theEvent.preventDefault) theEvent.preventDefault(); + } +} + +var countStatus = function (status, timeline) { + var count = 0; + for (var i = 0, len = timeline.length; i < len; i++) { + if (timeline[i].status == status) { + if($('#filter-changes').css('display') == 'none' || (timeline[i].time >= $('#filter-changes').find('.from').val() && timeline[i].time <= $('#filter-changes').find('.to').val())) { + count++; + } + } + } + return count; +} + +var timeline = [ + {element: '
      ', time: 0.2, status: 'added', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
      ', time: 0.2, status: 'added', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
      ', time: 0.2, status: 'added', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
      ', time: 0.2, status: 'added', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
      ', time: 0.2, status: 'added', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
      ', time: 1.5, status: 'added', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '', time: 1.5, status: 'added', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
      ', time: 3.5, status: 'added', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
      ', time: 3.5, status: 'added', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
      ', time: 5, status: 'added', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '', time: 1.5, status: 'removed', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
        ', time: 7, status: 'removed', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '', time: 1.5, status: 'removed', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 3.5, status: 'removed', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 3, status: 'removed', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 3, status: 'removed', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 1.5, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
        ', time: 3, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '', time: 7, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 5, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 6, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 6.5, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 1.5, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '
        ', time: 3, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '', time: 5, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 5, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 6, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]}, + {element: '

        ', time: 6.5, status: 'modified', details: [{name: 'prop1', value: 'value for prop1'}, {name: 'prop2', value: 'value for prop2'}]} +]; + +setTimeline(timeline); + +var selectable = function() { + $('#timeline').selectable({ + stop: function(e) { + if (e.toElement.id == 'offsetW') { + var selectXW = (e.offsetX < 0) ? 0 : e.offsetX; + $('.lev').css({ + width: (selectXW > selectX) ? selectXW - selectX : selectX - selectXW, + left: (selectXW > selectX) ? selectX : selectXW, + }); + levChanged('selectable'); + } + $('#offsetW').hide(); + }, + start: function(e, ui) { + $('#offsetW').show(); + selectX = e.offsetX; + }, + filter: '.noselectee', + }); +} + +var selectX; + +selectable(); + +$('#filter-changes input').bind('keypress', function(e) { + var toVal = $('#filter-changes .to').val(); + var fromVal = $('#filter-changes .from').val(); + if(e.keyCode==13 && !(toVal < 0 || fromVal < 0 || toVal > TIMELINE_SECONDS || fromVal > TIMELINE_SECONDS)){ + $('#lev').css({left: ($('#filter-changes .from').val() * 61), width: ($('#filter-changes .to').val() * 61) - ($('#filter-changes .from').val() * 61)}); + levChanged(); + } +}); + +$('#node-changes input').on('keyup', function () { + var value = this.value; + $('.accordion-changes .acc-tr').hide().each(function () { + if ($(this).text().search(value) > -1) { + $(this).show(); + } + }); +}); + +$( ".lev" ).draggable({ + axis: 'x', + containment: 'parent', + handle: '.drag-lev', + drag: function(e) { + levChanged('draggable'); + } +}); + +var x,y,top,left,down; + +$(".seconds-list").mousedown(function(e){ + e.preventDefault(); + down=true; + x=e.pageX; + y=e.pageY; + top=$("#wrapper-timeline").scrollTop(); + left=$("#wrapper-timeline").scrollLeft(); +}); + +$("body").mousemove(function(e){ + if(down){ + var newX=e.pageX; + var newY=e.pageY; + + $("#wrapper-timeline").scrollTop(top-newY+y); + $("#wrapper-timeline").scrollLeft(left-newX+x); + } +}); + +$("body").mouseup(function(e){down=false;}); + +$("#colorblind").change(function() { + if(!this.checked) { + $('#dom-recorder').removeClass('colorblind-on').addClass('colorblind-off'); + } else { + $('#dom-recorder').removeClass('colorblind-off').addClass('colorblind-on'); + } +}); + +$('#filter-changes').find('a').click(function(e) { + e.preventDefault(); + $('#lev').css('width', '0px'); + levChanged('reset'); +}); + +var element = document.getElementById('lev'); + +var resizerE = document.getElementsByClassName('lev2')[0]; +resizerE.addEventListener('mousedown', initResizeE, false); + +function initResizeE(e) { + $( "#timeline" ).selectable('destroy'); + window.addEventListener('mousemove', ResizeE, false); + window.addEventListener('mouseup', stopResizeE, false); +} + +function ResizeE(e) { + levChanged('resize'); + element.style.width = ((e.clientX - $('#timeline').offset().left) - $('.lev').position().left) + 'px'; +} + +function stopResizeE(e) { + selectable(); + window.removeEventListener('mousemove', ResizeE, false); + window.removeEventListener('mouseup', stopResizeE, false); +} + +var baseX; +var baseW; +var resizerW = document.getElementsByClassName('lev1')[0]; +resizerW.addEventListener('mousedown', initResizeW, false); + +function initResizeW(e) { + $( "#timeline" ).selectable('destroy'); + baseX = e.clientX - $('#timeline').offset().left; + baseW = parseInt(element.style.width); + window.addEventListener('mousemove', ResizeW, false); + window.addEventListener('mouseup', stopResizeW, false); +} + +function ResizeW(e) { + levChanged('resize'); + if (baseX < (e.clientX - $('#timeline').offset().left)) { + element.style.width = (baseW - ((e.clientX - $('#timeline').offset().left - baseX))) + 'px'; + } else { + element.style.width = (baseW + (baseX - (e.clientX - $('#timeline').offset().left))) + 'px'; + } + + if(e.clientX - $('#timeline').offset().left < 0) { + element.style.left = '0px'; + } else { + element.style.left = ((e.clientX - $('#timeline').offset().left)) + 'px'; + } +} + +function stopResizeW(e) { + selectable(); + window.removeEventListener('mousemove', ResizeW, false); + window.removeEventListener('mouseup', stopResizeW, false); +} \ No newline at end of file diff --git a/Plugins/Vorlon/plugins/domtimeline/images/arrow-blue-b.PNG b/Plugins/Vorlon/plugins/domtimeline/images/arrow-blue-b.PNG new file mode 100644 index 0000000000000000000000000000000000000000..872e0b68248b8f2cbd9688387a53afa8ea8b1570 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^96-#^!3HF6a`hPlDb50q$YKTtzQZ8Qcszea3Q(}Z z)5S5Q;#Td%gS-ubJZ`*6>dW6HFou77!Rju(BjTXf-^C~O1=lv$Jglx1Adn3(O`x-BtR<%PkY0FK7ubCuFrYv))#za8Lpv+}N^ s*7k#z>eJd2&xXYZX-mG?YhVAFxh7RA(ZK1JI?xRap00i_>zopr0GPZ+cK`qY literal 0 HcmV?d00001 diff --git a/Plugins/Vorlon/plugins/domtimeline/images/arrow-blue.PNG b/Plugins/Vorlon/plugins/domtimeline/images/arrow-blue.PNG new file mode 100644 index 0000000000000000000000000000000000000000..25fb5a7849acd300853115ef367846443542e72d GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^96-#^!3HF6a`hPlDb50q$YKTtzQZ8Qcszea3Q#c3 z)5S5Q;#TsHZ-1}$|}2LaiokhKIAx)k<^)h$I+u zIy3H4TEjI#^kE3Yp-|cCkJ>Nhm&$Bsn($vE8i8_pS$MBZH@_pUXO@geCw;nLRE5 literal 0 HcmV?d00001 diff --git a/Plugins/Vorlon/plugins/domtimeline/images/arrow-green.PNG b/Plugins/Vorlon/plugins/domtimeline/images/arrow-green.PNG new file mode 100644 index 0000000000000000000000000000000000000000..79a816919219db628b2389a467df6b97003e917a GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^96-#^!3HF6a`hPlDb50q$YKTtzQZ8Qcszea3Q#c9 z)5S5Q;#TQ7Tdo5NJZ*{j&sO!xt#gj8Qrp|KWr6p?yTKw_|DJHCRLMKJ)ET#G3rGpR z_c$imp*3N4%L>L8wtz5e+Xbv=rbk?eZ(6X%R);Ms{E7ehX8TR{UkVwEWf;Vz9X2+7 cQIR-Zqp-dFRC4|+d!VHZp00i_>zopr0R0U;1poj5 literal 0 HcmV?d00001 diff --git a/Plugins/Vorlon/plugins/domtimeline/images/arrow-red-b.PNG b/Plugins/Vorlon/plugins/domtimeline/images/arrow-red-b.PNG new file mode 100644 index 0000000000000000000000000000000000000000..354a815fe20cd1d9bcac43486b81d24f52975b6b GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^96-#^!3HF6a`hPlDb50q$YKTtzQZ8Qcszea3Q(}Y z)5S5Q;#Td&jl2$m0&EYuSDaBWoMfuAAeEojOFCms!qRHX)+a|lns@!@p3bbPTEn{K znnZF9GsBKWtaFN2OgSXL#2=MyaV+5?n+V@uhIT%OkM|Y}Fg>56zGCa5DMH2Pp7So9 z5_+lf%z>%W5!pA3n58=IrI}~;?3~8^<=*`LKN&yPm$S&7=Jf`;g~8L+&t;ucLK6Tp C?MW&C literal 0 HcmV?d00001 diff --git a/Plugins/Vorlon/plugins/domtimeline/images/arrow-red.PNG b/Plugins/Vorlon/plugins/domtimeline/images/arrow-red.PNG new file mode 100644 index 0000000000000000000000000000000000000000..e5443cda903660e6a3841b663a78a60cc95dca70 GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^96-#^!3HF6a`hPlDb50q$YKTtzQZ8Qcszea3Q#c3 z)5S5Q;#TsHZJEF8YZ@N8=!P`lsMeV^97VRIEpLp)w bU}5;bqkG4e6| literal 0 HcmV?d00001 diff --git a/Plugins/Vorlon/plugins/domtimeline/images/blind.png b/Plugins/Vorlon/plugins/domtimeline/images/blind.png new file mode 100644 index 0000000000000000000000000000000000000000..420c93b82275d393d74fd3c6a78f6d5e2baf6538 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V6Od#IhpG4@pEpRCwBB`1R`-0|-C7_VoYBEf@cv*nHvt_SpyjXX`eC@%sK< zV6l^1F8sfH@!@}%dN6T%`=$T622F6q`0#-hC&8K-e*E~!kZ;^VlqMMd@a7`}!^gLu z7)a3s!cT5L|4%)QZNW4CZ|L8Rf_q}-64p39d)fcnryro;g;ncm=v1;b&MH{>|IxK) zD0pf8Cc+w<{ipt4(XtfBt( znN1f8E--1Oq8~qh{6ezEXZK$I2j|Du;ORtbs&VcA|LyB{NJf79;ypu8?A-rF=I#Fr vP1{iX1j?%*u|l)9|LvhO{=aze3Y?Jv2QG$@h)`*n00000NkvXXu0mjfEWxQO literal 0 HcmV?d00001 diff --git a/Plugins/Vorlon/plugins/domtimeline/images/rule.PNG b/Plugins/Vorlon/plugins/domtimeline/images/rule.PNG new file mode 100644 index 0000000000000000000000000000000000000000..fa6cbcf7214092c8b7e77fb9a7b5a61369dd2970 GIT binary patch literal 249 zcmeAS@N?(olHy`uVBq!ia0vp^wjeeK8<3QeNOJ*FoCO|{#S9F5he4R}c>anMpx|mx z7srr_TW>EepZ)%NCkscUFxO1#(3 tz2E=UU(AmHDXELx62$e`qE71?VXXMO+x literal 0 HcmV?d00001 diff --git a/Plugins/Vorlon/plugins/domtimeline/jquery-ui.js b/Plugins/Vorlon/plugins/domtimeline/jquery-ui.js new file mode 100644 index 00000000..8f0e8025 --- /dev/null +++ b/Plugins/Vorlon/plugins/domtimeline/jquery-ui.js @@ -0,0 +1,16608 @@ +/*! jQuery UI - v1.11.3 - 2015-02-12 +* http://jqueryui.com +* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js +* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ + +(function( factory ) { + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define([ "jquery" ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { +/*! + * jQuery UI Core 1.11.3 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/category/ui-core/ + */ + + +// $.ui might exist from components with no dependencies, e.g., $.ui.position +$.ui = $.ui || {}; + +$.extend( $.ui, { + version: "1.11.3", + + keyCode: { + BACKSPACE: 8, + COMMA: 188, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + LEFT: 37, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SPACE: 32, + TAB: 9, + UP: 38 + } +}); + +// plugins +$.fn.extend({ + scrollParent: function( includeHidden ) { + var position = this.css( "position" ), + excludeStaticParent = position === "absolute", + overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, + scrollParent = this.parents().filter( function() { + var parent = $( this ); + if ( excludeStaticParent && parent.css( "position" ) === "static" ) { + return false; + } + return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) ); + }).eq( 0 ); + + return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent; + }, + + uniqueId: (function() { + var uuid = 0; + + return function() { + return this.each(function() { + if ( !this.id ) { + this.id = "ui-id-" + ( ++uuid ); + } + }); + }; + })(), + + removeUniqueId: function() { + return this.each(function() { + if ( /^ui-id-\d+$/.test( this.id ) ) { + $( this ).removeAttr( "id" ); + } + }); + } +}); + +// selectors +function focusable( element, isTabIndexNotNaN ) { + var map, mapName, img, + nodeName = element.nodeName.toLowerCase(); + if ( "area" === nodeName ) { + map = element.parentNode; + mapName = map.name; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap='#" + mapName + "']" )[ 0 ]; + return !!img && visible( img ); + } + return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ? + !element.disabled : + "a" === nodeName ? + element.href || isTabIndexNotNaN : + isTabIndexNotNaN) && + // the element and all of its ancestors must be visible + visible( element ); +} + +function visible( element ) { + return $.expr.filters.visible( element ) && + !$( element ).parents().addBack().filter(function() { + return $.css( this, "visibility" ) === "hidden"; + }).length; +} + +$.extend( $.expr[ ":" ], { + data: $.expr.createPseudo ? + $.expr.createPseudo(function( dataName ) { + return function( elem ) { + return !!$.data( elem, dataName ); + }; + }) : + // support: jQuery <1.8 + function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ), + isTabIndexNaN = isNaN( tabIndex ); + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); + } +}); + +// support: jQuery <1.8 +if ( !$( "" ).outerWidth( 1 ).jquery ) { + $.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; + if ( border ) { + size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; + }); +} + +// support: jQuery <1.8 +if ( !$.fn.addBack ) { + $.fn.addBack = function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + }; +} + +// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) +if ( $( "" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { + $.fn.removeData = (function( removeData ) { + return function( key ) { + if ( arguments.length ) { + return removeData.call( this, $.camelCase( key ) ); + } else { + return removeData.call( this ); + } + }; + })( $.fn.removeData ); +} + +// deprecated +$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); + +$.fn.extend({ + focus: (function( orig ) { + return function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + orig.apply( this, arguments ); + }; + })( $.fn.focus ), + + disableSelection: (function() { + var eventType = "onselectstart" in document.createElement( "div" ) ? + "selectstart" : + "mousedown"; + + return function() { + return this.bind( eventType + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }; + })(), + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + //

        + value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + } +}); + +// $.ui.plugin is deprecated. Use $.widget() extensions instead. +$.ui.plugin = { + add: function( module, option, set ) { + var i, + proto = $.ui[ module ].prototype; + for ( i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args, allowDisconnected ) { + var i, + set = instance.plugins[ name ]; + + if ( !set ) { + return; + } + + if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) { + return; + } + + for ( i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } +}; + + +/*! + * jQuery UI Widget 1.11.3 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/jQuery.widget/ + */ + + +var widget_uuid = 0, + widget_slice = Array.prototype.slice; + +$.cleanData = (function( orig ) { + return function( elems ) { + var events, elem, i; + for ( i = 0; (elem = elems[i]) != null; i++ ) { + try { + + // Only trigger remove when necessary to save time + events = $._data( elem, "events" ); + if ( events && events.remove ) { + $( elem ).triggerHandler( "remove" ); + } + + // http://bugs.jquery.com/ticket/8235 + } catch ( e ) {} + } + orig( elems ); + }; +})( $.cleanData ); + +$.widget = function( name, base, prototype ) { + var fullName, existingConstructor, constructor, basePrototype, + // proxiedPrototype allows the provided prototype to remain unmodified + // so that it can be used as a mixin for multiple widgets (#8876) + proxiedPrototype = {}, + namespace = name.split( "." )[ 0 ]; + + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { + return !!$.data( elem, fullName ); + }; + + $[ namespace ] = $[ namespace ] || {}; + existingConstructor = $[ namespace ][ name ]; + constructor = $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without "new" keyword + if ( !this._createWidget ) { + return new constructor( options, element ); + } + + // allow instantiation without initializing for simple inheritance + // must use "new" keyword (the code above always passes args) + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + // extend with the existing constructor to carry over any static properties + $.extend( constructor, existingConstructor, { + version: prototype.version, + // copy the object used to create the prototype in case we need to + // redefine the widget later + _proto: $.extend( {}, prototype ), + // track widgets that inherit from this widget in case this widget is + // redefined after a widget inherits from it + _childConstructors: [] + }); + + basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from + basePrototype.options = $.widget.extend( {}, basePrototype.options ); + $.each( prototype, function( prop, value ) { + if ( !$.isFunction( value ) ) { + proxiedPrototype[ prop ] = value; + return; + } + proxiedPrototype[ prop ] = (function() { + var _super = function() { + return base.prototype[ prop ].apply( this, arguments ); + }, + _superApply = function( args ) { + return base.prototype[ prop ].apply( this, args ); + }; + return function() { + var __super = this._super, + __superApply = this._superApply, + returnValue; + + this._super = _super; + this._superApply = _superApply; + + returnValue = value.apply( this, arguments ); + + this._super = __super; + this._superApply = __superApply; + + return returnValue; + }; + })(); + }); + constructor.prototype = $.widget.extend( basePrototype, { + // TODO: remove support for widgetEventPrefix + // always use the name + a colon as the prefix, e.g., draggable:start + // don't prefix for widgets that aren't DOM-based + widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name + }, proxiedPrototype, { + constructor: constructor, + namespace: namespace, + widgetName: name, + widgetFullName: fullName + }); + + // If this widget is being redefined then we need to find all widgets that + // are inheriting from it and redefine all of them so that they inherit from + // the new version of this widget. We're essentially trying to replace one + // level in the prototype chain. + if ( existingConstructor ) { + $.each( existingConstructor._childConstructors, function( i, child ) { + var childPrototype = child.prototype; + + // redefine the child widget using the same prototype that was + // originally used, but inherit from the new version of the base + $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); + }); + // remove the list of existing child constructors from the old constructor + // so the old child constructors can be garbage collected + delete existingConstructor._childConstructors; + } else { + base._childConstructors.push( constructor ); + } + + $.widget.bridge( name, constructor ); + + return constructor; +}; + +$.widget.extend = function( target ) { + var input = widget_slice.call( arguments, 1 ), + inputIndex = 0, + inputLength = input.length, + key, + value; + for ( ; inputIndex < inputLength; inputIndex++ ) { + for ( key in input[ inputIndex ] ) { + value = input[ inputIndex ][ key ]; + if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { + // Clone objects + if ( $.isPlainObject( value ) ) { + target[ key ] = $.isPlainObject( target[ key ] ) ? + $.widget.extend( {}, target[ key ], value ) : + // Don't extend strings, arrays, etc. with objects + $.widget.extend( {}, value ); + // Copy everything else by reference + } else { + target[ key ] = value; + } + } + } + } + return target; +}; + +$.widget.bridge = function( name, object ) { + var fullName = object.prototype.widgetFullName || name; + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = widget_slice.call( arguments, 1 ), + returnValue = this; + + if ( isMethodCall ) { + this.each(function() { + var methodValue, + instance = $.data( this, fullName ); + if ( options === "instance" ) { + returnValue = instance; + return false; + } + if ( !instance ) { + return $.error( "cannot call methods on " + name + " prior to initialization; " + + "attempted to call method '" + options + "'" ); + } + if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { + return $.error( "no such method '" + options + "' for " + name + " widget instance" ); + } + methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue && methodValue.jquery ? + returnValue.pushStack( methodValue.get() ) : + methodValue; + return false; + } + }); + } else { + + // Allow multiple hashes to be passed on init + if ( args.length ) { + options = $.widget.extend.apply( null, [ options ].concat(args) ); + } + + this.each(function() { + var instance = $.data( this, fullName ); + if ( instance ) { + instance.option( options || {} ); + if ( instance._init ) { + instance._init(); + } + } else { + $.data( this, fullName, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( /* options, element */ ) {}; +$.Widget._childConstructors = []; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + defaultElement: "
        ", + options: { + disabled: false, + + // callbacks + create: null + }, + _createWidget: function( options, element ) { + element = $( element || this.defaultElement || this )[ 0 ]; + this.element = $( element ); + this.uuid = widget_uuid++; + this.eventNamespace = "." + this.widgetName + this.uuid; + + this.bindings = $(); + this.hoverable = $(); + this.focusable = $(); + + if ( element !== this ) { + $.data( element, this.widgetFullName, this ); + this._on( true, this.element, { + remove: function( event ) { + if ( event.target === element ) { + this.destroy(); + } + } + }); + this.document = $( element.style ? + // element within the document + element.ownerDocument : + // element is window or document + element.document || element ); + this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); + } + + this.options = $.widget.extend( {}, + this.options, + this._getCreateOptions(), + options ); + + this._create(); + this._trigger( "create", null, this._getCreateEventData() ); + this._init(); + }, + _getCreateOptions: $.noop, + _getCreateEventData: $.noop, + _create: $.noop, + _init: $.noop, + + destroy: function() { + this._destroy(); + // we can probably remove the unbind calls in 2.0 + // all event bindings should go through this._on() + this.element + .unbind( this.eventNamespace ) + .removeData( this.widgetFullName ) + // support: jquery <1.6.3 + // http://bugs.jquery.com/ticket/9413 + .removeData( $.camelCase( this.widgetFullName ) ); + this.widget() + .unbind( this.eventNamespace ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetFullName + "-disabled " + + "ui-state-disabled" ); + + // clean up events and states + this.bindings.unbind( this.eventNamespace ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + }, + _destroy: $.noop, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key, + parts, + curOption, + i; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.widget.extend( {}, this.options ); + } + + if ( typeof key === "string" ) { + // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } + options = {}; + parts = key.split( "." ); + key = parts.shift(); + if ( parts.length ) { + curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); + for ( i = 0; i < parts.length - 1; i++ ) { + curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; + curOption = curOption[ parts[ i ] ]; + } + key = parts.pop(); + if ( arguments.length === 1 ) { + return curOption[ key ] === undefined ? null : curOption[ key ]; + } + curOption[ key ] = value; + } else { + if ( arguments.length === 1 ) { + return this.options[ key ] === undefined ? null : this.options[ key ]; + } + options[ key ] = value; + } + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var key; + + for ( key in options ) { + this._setOption( key, options[ key ] ); + } + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + .toggleClass( this.widgetFullName + "-disabled", !!value ); + + // If the widget is becoming disabled, then nothing is interactive + if ( value ) { + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + } + } + + return this; + }, + + enable: function() { + return this._setOptions({ disabled: false }); + }, + disable: function() { + return this._setOptions({ disabled: true }); + }, + + _on: function( suppressDisabledCheck, element, handlers ) { + var delegateElement, + instance = this; + + // no suppressDisabledCheck flag, shuffle arguments + if ( typeof suppressDisabledCheck !== "boolean" ) { + handlers = element; + element = suppressDisabledCheck; + suppressDisabledCheck = false; + } + + // no element argument, shuffle and use this.element + if ( !handlers ) { + handlers = element; + element = this.element; + delegateElement = this.widget(); + } else { + element = delegateElement = $( element ); + this.bindings = this.bindings.add( element ); + } + + $.each( handlers, function( event, handler ) { + function handlerProxy() { + // allow widgets to customize the disabled handling + // - disabled as an array instead of boolean + // - disabled class as method for disabling individual parts + if ( !suppressDisabledCheck && + ( instance.options.disabled === true || + $( this ).hasClass( "ui-state-disabled" ) ) ) { + return; + } + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + + // copy the guid so direct unbinding works + if ( typeof handler !== "string" ) { + handlerProxy.guid = handler.guid = + handler.guid || handlerProxy.guid || $.guid++; + } + + var match = event.match( /^([\w:-]*)\s*(.*)$/ ), + eventName = match[1] + instance.eventNamespace, + selector = match[2]; + if ( selector ) { + delegateElement.delegate( selector, eventName, handlerProxy ); + } else { + element.bind( eventName, handlerProxy ); + } + }); + }, + + _off: function( element, eventName ) { + eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + + this.eventNamespace; + element.unbind( eventName ).undelegate( eventName ); + + // Clear the stack to avoid memory leaks (#10056) + this.bindings = $( this.bindings.not( element ).get() ); + this.focusable = $( this.focusable.not( element ).get() ); + this.hoverable = $( this.hoverable.not( element ).get() ); + }, + + _delay: function( handler, delay ) { + function handlerProxy() { + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + var instance = this; + return setTimeout( handlerProxy, delay || 0 ); + }, + + _hoverable: function( element ) { + this.hoverable = this.hoverable.add( element ); + this._on( element, { + mouseenter: function( event ) { + $( event.currentTarget ).addClass( "ui-state-hover" ); + }, + mouseleave: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-hover" ); + } + }); + }, + + _focusable: function( element ) { + this.focusable = this.focusable.add( element ); + this._on( element, { + focusin: function( event ) { + $( event.currentTarget ).addClass( "ui-state-focus" ); + }, + focusout: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-focus" ); + } + }); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + return !( $.isFunction( callback ) && + callback.apply( this.element[0], [ event ].concat( data ) ) === false || + event.isDefaultPrevented() ); + } +}; + +$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { + $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { + if ( typeof options === "string" ) { + options = { effect: options }; + } + var hasOptions, + effectName = !options ? + method : + options === true || typeof options === "number" ? + defaultEffect : + options.effect || defaultEffect; + options = options || {}; + if ( typeof options === "number" ) { + options = { duration: options }; + } + hasOptions = !$.isEmptyObject( options ); + options.complete = callback; + if ( options.delay ) { + element.delay( options.delay ); + } + if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { + element[ method ]( options ); + } else if ( effectName !== method && element[ effectName ] ) { + element[ effectName ]( options.duration, options.easing, callback ); + } else { + element.queue(function( next ) { + $( this )[ method ](); + if ( callback ) { + callback.call( element[ 0 ] ); + } + next(); + }); + } + }; +}); + +var widget = $.widget; + + +/*! + * jQuery UI Mouse 1.11.3 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/mouse/ + */ + + +var mouseHandled = false; +$( document ).mouseup( function() { + mouseHandled = false; +}); + +var mouse = $.widget("ui.mouse", { + version: "1.11.3", + options: { + cancel: "input,textarea,button,select,option", + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var that = this; + + this.element + .bind("mousedown." + this.widgetName, function(event) { + return that._mouseDown(event); + }) + .bind("click." + this.widgetName, function(event) { + if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) { + $.removeData(event.target, that.widgetName + ".preventClickEvent"); + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind("." + this.widgetName); + if ( this._mouseMoveDelegate ) { + this.document + .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate) + .unbind("mouseup." + this.widgetName, this._mouseUpDelegate); + } + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + if ( mouseHandled ) { + return; + } + + this._mouseMoved = false; + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var that = this, + btnIsLeft = (event.which === 1), + // event.target.nodeName works around a bug in IE 8 with + // disabled inputs (#7620) + elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + that.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // Click event may never have fired (Gecko & Opera) + if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) { + $.removeData(event.target, this.widgetName + ".preventClickEvent"); + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return that._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return that._mouseUp(event); + }; + + this.document + .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) + .bind( "mouseup." + this.widgetName, this._mouseUpDelegate ); + + event.preventDefault(); + + mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // Only check for mouseups outside the document if you've moved inside the document + // at least once. This prevents the firing of mouseup in the case of IE<9, which will + // fire a mousemove event if content is placed under the cursor. See #7778 + // Support: IE <9 + if ( this._mouseMoved ) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) { + return this._mouseUp(event); + + // Iframe mouseup check - mouseup occurred in another document + } else if ( !event.which ) { + return this._mouseUp( event ); + } + } + + if ( event.which || event.button ) { + this._mouseMoved = true; + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + this.document + .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) + .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate ); + + if (this._mouseStarted) { + this._mouseStarted = false; + + if (event.target === this._mouseDownEvent.target) { + $.data(event.target, this.widgetName + ".preventClickEvent", true); + } + + this._mouseStop(event); + } + + mouseHandled = false; + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(/* event */) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(/* event */) {}, + _mouseDrag: function(/* event */) {}, + _mouseStop: function(/* event */) {}, + _mouseCapture: function(/* event */) { return true; } +}); + + +/*! + * jQuery UI Position 1.11.3 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/position/ + */ + +(function() { + +$.ui = $.ui || {}; + +var cachedScrollbarWidth, supportsOffsetFractions, + max = Math.max, + abs = Math.abs, + round = Math.round, + rhorizontal = /left|center|right/, + rvertical = /top|center|bottom/, + roffset = /[\+\-]\d+(\.[\d]+)?%?/, + rposition = /^\w+/, + rpercent = /%$/, + _position = $.fn.position; + +function getOffsets( offsets, width, height ) { + return [ + parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), + parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) + ]; +} + +function parseCss( element, property ) { + return parseInt( $.css( element, property ), 10 ) || 0; +} + +function getDimensions( elem ) { + var raw = elem[0]; + if ( raw.nodeType === 9 ) { + return { + width: elem.width(), + height: elem.height(), + offset: { top: 0, left: 0 } + }; + } + if ( $.isWindow( raw ) ) { + return { + width: elem.width(), + height: elem.height(), + offset: { top: elem.scrollTop(), left: elem.scrollLeft() } + }; + } + if ( raw.preventDefault ) { + return { + width: 0, + height: 0, + offset: { top: raw.pageY, left: raw.pageX } + }; + } + return { + width: elem.outerWidth(), + height: elem.outerHeight(), + offset: elem.offset() + }; +} + +$.position = { + scrollbarWidth: function() { + if ( cachedScrollbarWidth !== undefined ) { + return cachedScrollbarWidth; + } + var w1, w2, + div = $( "
        " ), + innerDiv = div.children()[0]; + + $( "body" ).append( div ); + w1 = innerDiv.offsetWidth; + div.css( "overflow", "scroll" ); + + w2 = innerDiv.offsetWidth; + + if ( w1 === w2 ) { + w2 = div[0].clientWidth; + } + + div.remove(); + + return (cachedScrollbarWidth = w1 - w2); + }, + getScrollInfo: function( within ) { + var overflowX = within.isWindow || within.isDocument ? "" : + within.element.css( "overflow-x" ), + overflowY = within.isWindow || within.isDocument ? "" : + within.element.css( "overflow-y" ), + hasOverflowX = overflowX === "scroll" || + ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), + hasOverflowY = overflowY === "scroll" || + ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); + return { + width: hasOverflowY ? $.position.scrollbarWidth() : 0, + height: hasOverflowX ? $.position.scrollbarWidth() : 0 + }; + }, + getWithinInfo: function( element ) { + var withinElement = $( element || window ), + isWindow = $.isWindow( withinElement[0] ), + isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9; + return { + element: withinElement, + isWindow: isWindow, + isDocument: isDocument, + offset: withinElement.offset() || { left: 0, top: 0 }, + scrollLeft: withinElement.scrollLeft(), + scrollTop: withinElement.scrollTop(), + + // support: jQuery 1.6.x + // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows + width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(), + height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight() + }; + } +}; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, + target = $( options.of ), + within = $.position.getWithinInfo( options.within ), + scrollInfo = $.position.getScrollInfo( within ), + collision = ( options.collision || "flip" ).split( " " ), + offsets = {}; + + dimensions = getDimensions( target ); + if ( target[0].preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + } + targetWidth = dimensions.width; + targetHeight = dimensions.height; + targetOffset = dimensions.offset; + // clone to reuse original targetOffset later + basePosition = $.extend( {}, targetOffset ); + + // force my and at to have valid horizontal and vertical positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[ this ] || "" ).split( " " ), + horizontalOffset, + verticalOffset; + + if ( pos.length === 1) { + pos = rhorizontal.test( pos[ 0 ] ) ? + pos.concat( [ "center" ] ) : + rvertical.test( pos[ 0 ] ) ? + [ "center" ].concat( pos ) : + [ "center", "center" ]; + } + pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; + pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; + + // calculate offsets + horizontalOffset = roffset.exec( pos[ 0 ] ); + verticalOffset = roffset.exec( pos[ 1 ] ); + offsets[ this ] = [ + horizontalOffset ? horizontalOffset[ 0 ] : 0, + verticalOffset ? verticalOffset[ 0 ] : 0 + ]; + + // reduce to just the positions without the offsets + options[ this ] = [ + rposition.exec( pos[ 0 ] )[ 0 ], + rposition.exec( pos[ 1 ] )[ 0 ] + ]; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + if ( options.at[ 0 ] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[ 0 ] === "center" ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[ 1 ] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[ 1 ] === "center" ) { + basePosition.top += targetHeight / 2; + } + + atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); + basePosition.left += atOffset[ 0 ]; + basePosition.top += atOffset[ 1 ]; + + return this.each(function() { + var collisionPosition, using, + elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseCss( this, "marginLeft" ), + marginTop = parseCss( this, "marginTop" ), + collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, + collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, + position = $.extend( {}, basePosition ), + myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); + + if ( options.my[ 0 ] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[ 0 ] === "center" ) { + position.left -= elemWidth / 2; + } + + if ( options.my[ 1 ] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[ 1 ] === "center" ) { + position.top -= elemHeight / 2; + } + + position.left += myOffset[ 0 ]; + position.top += myOffset[ 1 ]; + + // if the browser doesn't support fractions, then round for consistent results + if ( !supportsOffsetFractions ) { + position.left = round( position.left ); + position.top = round( position.top ); + } + + collisionPosition = { + marginLeft: marginLeft, + marginTop: marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[ i ] ] ) { + $.ui.position[ collision[ i ] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], + my: options.my, + at: options.at, + within: within, + elem: elem + }); + } + }); + + if ( options.using ) { + // adds feedback as second argument to using callback, if present + using = function( props ) { + var left = targetOffset.left - position.left, + right = left + targetWidth - elemWidth, + top = targetOffset.top - position.top, + bottom = top + targetHeight - elemHeight, + feedback = { + target: { + element: target, + left: targetOffset.left, + top: targetOffset.top, + width: targetWidth, + height: targetHeight + }, + element: { + element: elem, + left: position.left, + top: position.top, + width: elemWidth, + height: elemHeight + }, + horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", + vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" + }; + if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { + feedback.horizontal = "center"; + } + if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { + feedback.vertical = "middle"; + } + if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { + feedback.important = "horizontal"; + } else { + feedback.important = "vertical"; + } + options.using.call( this, props, feedback ); + }; + } + + elem.offset( $.extend( position, { using: using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, + outerWidth = within.width, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = withinOffset - collisionPosLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, + newOverRight; + + // element is wider than within + if ( data.collisionWidth > outerWidth ) { + // element is initially over the left side of within + if ( overLeft > 0 && overRight <= 0 ) { + newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; + position.left += overLeft - newOverRight; + // element is initially over right side of within + } else if ( overRight > 0 && overLeft <= 0 ) { + position.left = withinOffset; + // element is initially over both left and right sides of within + } else { + if ( overLeft > overRight ) { + position.left = withinOffset + outerWidth - data.collisionWidth; + } else { + position.left = withinOffset; + } + } + // too far left -> align with left edge + } else if ( overLeft > 0 ) { + position.left += overLeft; + // too far right -> align with right edge + } else if ( overRight > 0 ) { + position.left -= overRight; + // adjust based on position and margin + } else { + position.left = max( position.left - collisionPosLeft, position.left ); + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollTop : within.offset.top, + outerHeight = data.within.height, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = withinOffset - collisionPosTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, + newOverBottom; + + // element is taller than within + if ( data.collisionHeight > outerHeight ) { + // element is initially over the top of within + if ( overTop > 0 && overBottom <= 0 ) { + newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; + position.top += overTop - newOverBottom; + // element is initially over bottom of within + } else if ( overBottom > 0 && overTop <= 0 ) { + position.top = withinOffset; + // element is initially over both top and bottom of within + } else { + if ( overTop > overBottom ) { + position.top = withinOffset + outerHeight - data.collisionHeight; + } else { + position.top = withinOffset; + } + } + // too far up -> align with top + } else if ( overTop > 0 ) { + position.top += overTop; + // too far down -> align with bottom edge + } else if ( overBottom > 0 ) { + position.top -= overBottom; + // adjust based on position and margin + } else { + position.top = max( position.top - collisionPosTop, position.top ); + } + } + }, + flip: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.offset.left + within.scrollLeft, + outerWidth = within.width, + offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = collisionPosLeft - offsetLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + data.at[ 0 ] === "right" ? + -data.targetWidth : + 0, + offset = -2 * data.offset[ 0 ], + newOverRight, + newOverLeft; + + if ( overLeft < 0 ) { + newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; + if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { + position.left += myOffset + atOffset + offset; + } + } else if ( overRight > 0 ) { + newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; + if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { + position.left += myOffset + atOffset + offset; + } + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.offset.top + within.scrollTop, + outerHeight = within.height, + offsetTop = within.isWindow ? within.scrollTop : within.offset.top, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = collisionPosTop - offsetTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, + top = data.my[ 1 ] === "top", + myOffset = top ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + data.at[ 1 ] === "bottom" ? + -data.targetHeight : + 0, + offset = -2 * data.offset[ 1 ], + newOverTop, + newOverBottom; + if ( overTop < 0 ) { + newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; + if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { + position.top += myOffset + atOffset + offset; + } + } else if ( overBottom > 0 ) { + newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; + if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { + position.top += myOffset + atOffset + offset; + } + } + } + }, + flipfit: { + left: function() { + $.ui.position.flip.left.apply( this, arguments ); + $.ui.position.fit.left.apply( this, arguments ); + }, + top: function() { + $.ui.position.flip.top.apply( this, arguments ); + $.ui.position.fit.top.apply( this, arguments ); + } + } +}; + +// fraction support test +(function() { + var testElement, testElementParent, testElementStyle, offsetLeft, i, + body = document.getElementsByTagName( "body" )[ 0 ], + div = document.createElement( "div" ); + + //Create a "fake body" for testing based on method used in jQuery.support + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + $.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || document.documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + div.style.cssText = "position: absolute; left: 10.7432222px;"; + + offsetLeft = $( div ).offset().left; + supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11; + + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); +})(); + +})(); + +var position = $.ui.position; + + +/*! + * jQuery UI Accordion 1.11.3 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/accordion/ + */ + + +var accordion = $.widget( "ui.accordion", { + version: "1.11.3", + options: { + active: 0, + animate: {}, + collapsible: false, + event: "click", + header: "> li > :first-child,> :not(li):even", + heightStyle: "auto", + icons: { + activeHeader: "ui-icon-triangle-1-s", + header: "ui-icon-triangle-1-e" + }, + + // callbacks + activate: null, + beforeActivate: null + }, + + hideProps: { + borderTopWidth: "hide", + borderBottomWidth: "hide", + paddingTop: "hide", + paddingBottom: "hide", + height: "hide" + }, + + showProps: { + borderTopWidth: "show", + borderBottomWidth: "show", + paddingTop: "show", + paddingBottom: "show", + height: "show" + }, + + _create: function() { + var options = this.options; + this.prevShow = this.prevHide = $(); + this.element.addClass( "ui-accordion ui-widget ui-helper-reset" ) + // ARIA + .attr( "role", "tablist" ); + + // don't allow collapsible: false and active: false / null + if ( !options.collapsible && (options.active === false || options.active == null) ) { + options.active = 0; + } + + this._processPanels(); + // handle negative values + if ( options.active < 0 ) { + options.active += this.headers.length; + } + this._refresh(); + }, + + _getCreateEventData: function() { + return { + header: this.active, + panel: !this.active.length ? $() : this.active.next() + }; + }, + + _createIcons: function() { + var icons = this.options.icons; + if ( icons ) { + $( "" ) + .addClass( "ui-accordion-header-icon ui-icon " + icons.header ) + .prependTo( this.headers ); + this.active.children( ".ui-accordion-header-icon" ) + .removeClass( icons.header ) + .addClass( icons.activeHeader ); + this.headers.addClass( "ui-accordion-icons" ); + } + }, + + _destroyIcons: function() { + this.headers + .removeClass( "ui-accordion-icons" ) + .children( ".ui-accordion-header-icon" ) + .remove(); + }, + + _destroy: function() { + var contents; + + // clean up main element + this.element + .removeClass( "ui-accordion ui-widget ui-helper-reset" ) + .removeAttr( "role" ); + + // clean up headers + this.headers + .removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " + + "ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) + .removeAttr( "role" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-selected" ) + .removeAttr( "aria-controls" ) + .removeAttr( "tabIndex" ) + .removeUniqueId(); + + this._destroyIcons(); + + // clean up content panels + contents = this.headers.next() + .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " + + "ui-accordion-content ui-accordion-content-active ui-state-disabled" ) + .css( "display", "" ) + .removeAttr( "role" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-labelledby" ) + .removeUniqueId(); + + if ( this.options.heightStyle !== "content" ) { + contents.css( "height", "" ); + } + }, + + _setOption: function( key, value ) { + if ( key === "active" ) { + // _activate() will handle invalid values and update this.options + this._activate( value ); + return; + } + + if ( key === "event" ) { + if ( this.options.event ) { + this._off( this.headers, this.options.event ); + } + this._setupEvents( value ); + } + + this._super( key, value ); + + // setting collapsible: false while collapsed; open first panel + if ( key === "collapsible" && !value && this.options.active === false ) { + this._activate( 0 ); + } + + if ( key === "icons" ) { + this._destroyIcons(); + if ( value ) { + this._createIcons(); + } + } + + // #5332 - opacity doesn't cascade to positioned elements in IE + // so we need to add the disabled class to the headers and panels + if ( key === "disabled" ) { + this.element + .toggleClass( "ui-state-disabled", !!value ) + .attr( "aria-disabled", value ); + this.headers.add( this.headers.next() ) + .toggleClass( "ui-state-disabled", !!value ); + } + }, + + _keydown: function( event ) { + if ( event.altKey || event.ctrlKey ) { + return; + } + + var keyCode = $.ui.keyCode, + length = this.headers.length, + currentIndex = this.headers.index( event.target ), + toFocus = false; + + switch ( event.keyCode ) { + case keyCode.RIGHT: + case keyCode.DOWN: + toFocus = this.headers[ ( currentIndex + 1 ) % length ]; + break; + case keyCode.LEFT: + case keyCode.UP: + toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; + break; + case keyCode.SPACE: + case keyCode.ENTER: + this._eventHandler( event ); + break; + case keyCode.HOME: + toFocus = this.headers[ 0 ]; + break; + case keyCode.END: + toFocus = this.headers[ length - 1 ]; + break; + } + + if ( toFocus ) { + $( event.target ).attr( "tabIndex", -1 ); + $( toFocus ).attr( "tabIndex", 0 ); + toFocus.focus(); + event.preventDefault(); + } + }, + + _panelKeyDown: function( event ) { + if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { + $( event.currentTarget ).prev().focus(); + } + }, + + refresh: function() { + var options = this.options; + this._processPanels(); + + // was collapsed or no panel + if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) { + options.active = false; + this.active = $(); + // active false only when collapsible is true + } else if ( options.active === false ) { + this._activate( 0 ); + // was active, but active panel is gone + } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { + // all remaining panel are disabled + if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) { + options.active = false; + this.active = $(); + // activate previous panel + } else { + this._activate( Math.max( 0, options.active - 1 ) ); + } + // was active, active panel still exists + } else { + // make sure active index is correct + options.active = this.headers.index( this.active ); + } + + this._destroyIcons(); + + this._refresh(); + }, + + _processPanels: function() { + var prevHeaders = this.headers, + prevPanels = this.panels; + + this.headers = this.element.find( this.options.header ) + .addClass( "ui-accordion-header ui-state-default ui-corner-all" ); + + this.panels = this.headers.next() + .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ) + .filter( ":not(.ui-accordion-content-active)" ) + .hide(); + + // Avoid memory leaks (#10056) + if ( prevPanels ) { + this._off( prevHeaders.not( this.headers ) ); + this._off( prevPanels.not( this.panels ) ); + } + }, + + _refresh: function() { + var maxHeight, + options = this.options, + heightStyle = options.heightStyle, + parent = this.element.parent(); + + this.active = this._findActive( options.active ) + .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ) + .removeClass( "ui-corner-all" ); + this.active.next() + .addClass( "ui-accordion-content-active" ) + .show(); + + this.headers + .attr( "role", "tab" ) + .each(function() { + var header = $( this ), + headerId = header.uniqueId().attr( "id" ), + panel = header.next(), + panelId = panel.uniqueId().attr( "id" ); + header.attr( "aria-controls", panelId ); + panel.attr( "aria-labelledby", headerId ); + }) + .next() + .attr( "role", "tabpanel" ); + + this.headers + .not( this.active ) + .attr({ + "aria-selected": "false", + "aria-expanded": "false", + tabIndex: -1 + }) + .next() + .attr({ + "aria-hidden": "true" + }) + .hide(); + + // make sure at least one header is in the tab order + if ( !this.active.length ) { + this.headers.eq( 0 ).attr( "tabIndex", 0 ); + } else { + this.active.attr({ + "aria-selected": "true", + "aria-expanded": "true", + tabIndex: 0 + }) + .next() + .attr({ + "aria-hidden": "false" + }); + } + + this._createIcons(); + + this._setupEvents( options.event ); + + if ( heightStyle === "fill" ) { + maxHeight = parent.height(); + this.element.siblings( ":visible" ).each(function() { + var elem = $( this ), + position = elem.css( "position" ); + + if ( position === "absolute" || position === "fixed" ) { + return; + } + maxHeight -= elem.outerHeight( true ); + }); + + this.headers.each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.headers.next() + .each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( heightStyle === "auto" ) { + maxHeight = 0; + this.headers.next() + .each(function() { + maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); + }) + .height( maxHeight ); + } + }, + + _activate: function( index ) { + var active = this._findActive( index )[ 0 ]; + + // trying to activate the already active panel + if ( active === this.active[ 0 ] ) { + return; + } + + // trying to collapse, simulate a click on the currently active header + active = active || this.active[ 0 ]; + + this._eventHandler({ + target: active, + currentTarget: active, + preventDefault: $.noop + }); + }, + + _findActive: function( selector ) { + return typeof selector === "number" ? this.headers.eq( selector ) : $(); + }, + + _setupEvents: function( event ) { + var events = { + keydown: "_keydown" + }; + if ( event ) { + $.each( event.split( " " ), function( index, eventName ) { + events[ eventName ] = "_eventHandler"; + }); + } + + this._off( this.headers.add( this.headers.next() ) ); + this._on( this.headers, events ); + this._on( this.headers.next(), { keydown: "_panelKeyDown" }); + this._hoverable( this.headers ); + this._focusable( this.headers ); + }, + + _eventHandler: function( event ) { + var options = this.options, + active = this.active, + clicked = $( event.currentTarget ), + clickedIsActive = clicked[ 0 ] === active[ 0 ], + collapsing = clickedIsActive && options.collapsible, + toShow = collapsing ? $() : clicked.next(), + toHide = active.next(), + eventData = { + oldHeader: active, + oldPanel: toHide, + newHeader: collapsing ? $() : clicked, + newPanel: toShow + }; + + event.preventDefault(); + + if ( + // click on active header, but not collapsible + ( clickedIsActive && !options.collapsible ) || + // allow canceling activation + ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { + return; + } + + options.active = collapsing ? false : this.headers.index( clicked ); + + // when the call to ._toggle() comes after the class changes + // it causes a very odd bug in IE 8 (see #6720) + this.active = clickedIsActive ? $() : clicked; + this._toggle( eventData ); + + // switch classes + // corner classes on the previously active header stay after the animation + active.removeClass( "ui-accordion-header-active ui-state-active" ); + if ( options.icons ) { + active.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.activeHeader ) + .addClass( options.icons.header ); + } + + if ( !clickedIsActive ) { + clicked + .removeClass( "ui-corner-all" ) + .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ); + if ( options.icons ) { + clicked.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.header ) + .addClass( options.icons.activeHeader ); + } + + clicked + .next() + .addClass( "ui-accordion-content-active" ); + } + }, + + _toggle: function( data ) { + var toShow = data.newPanel, + toHide = this.prevShow.length ? this.prevShow : data.oldPanel; + + // handle activating a panel during the animation for another activation + this.prevShow.add( this.prevHide ).stop( true, true ); + this.prevShow = toShow; + this.prevHide = toHide; + + if ( this.options.animate ) { + this._animate( toShow, toHide, data ); + } else { + toHide.hide(); + toShow.show(); + this._toggleComplete( data ); + } + + toHide.attr({ + "aria-hidden": "true" + }); + toHide.prev().attr({ + "aria-selected": "false", + "aria-expanded": "false" + }); + // if we're switching panels, remove the old header from the tab order + // if we're opening from collapsed state, remove the previous header from the tab order + // if we're collapsing, then keep the collapsing header in the tab order + if ( toShow.length && toHide.length ) { + toHide.prev().attr({ + "tabIndex": -1, + "aria-expanded": "false" + }); + } else if ( toShow.length ) { + this.headers.filter(function() { + return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0; + }) + .attr( "tabIndex", -1 ); + } + + toShow + .attr( "aria-hidden", "false" ) + .prev() + .attr({ + "aria-selected": "true", + "aria-expanded": "true", + tabIndex: 0 + }); + }, + + _animate: function( toShow, toHide, data ) { + var total, easing, duration, + that = this, + adjust = 0, + down = toShow.length && + ( !toHide.length || ( toShow.index() < toHide.index() ) ), + animate = this.options.animate || {}, + options = down && animate.down || animate, + complete = function() { + that._toggleComplete( data ); + }; + + if ( typeof options === "number" ) { + duration = options; + } + if ( typeof options === "string" ) { + easing = options; + } + // fall back from options to animation in case of partial down settings + easing = easing || options.easing || animate.easing; + duration = duration || options.duration || animate.duration; + + if ( !toHide.length ) { + return toShow.animate( this.showProps, duration, easing, complete ); + } + if ( !toShow.length ) { + return toHide.animate( this.hideProps, duration, easing, complete ); + } + + total = toShow.show().outerHeight(); + toHide.animate( this.hideProps, { + duration: duration, + easing: easing, + step: function( now, fx ) { + fx.now = Math.round( now ); + } + }); + toShow + .hide() + .animate( this.showProps, { + duration: duration, + easing: easing, + complete: complete, + step: function( now, fx ) { + fx.now = Math.round( now ); + if ( fx.prop !== "height" ) { + adjust += fx.now; + } else if ( that.options.heightStyle !== "content" ) { + fx.now = Math.round( total - toHide.outerHeight() - adjust ); + adjust = 0; + } + } + }); + }, + + _toggleComplete: function( data ) { + var toHide = data.oldPanel; + + toHide + .removeClass( "ui-accordion-content-active" ) + .prev() + .removeClass( "ui-corner-top" ) + .addClass( "ui-corner-all" ); + + // Work around for rendering bug in IE (#5421) + if ( toHide.length ) { + toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className; + } + this._trigger( "activate", null, data ); + } +}); + + +/*! + * jQuery UI Menu 1.11.3 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/menu/ + */ + + +var menu = $.widget( "ui.menu", { + version: "1.11.3", + defaultElement: "
          ", + delay: 300, + options: { + icons: { + submenu: "ui-icon-carat-1-e" + }, + items: "> *", + menus: "ul", + position: { + my: "left-1 top", + at: "right top" + }, + role: "menu", + + // callbacks + blur: null, + focus: null, + select: null + }, + + _create: function() { + this.activeMenu = this.element; + + // Flag used to prevent firing of the click handler + // as the event bubbles up through nested menus + this.mouseHandled = false; + this.element + .uniqueId() + .addClass( "ui-menu ui-widget ui-widget-content" ) + .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length ) + .attr({ + role: this.options.role, + tabIndex: 0 + }); + + if ( this.options.disabled ) { + this.element + .addClass( "ui-state-disabled" ) + .attr( "aria-disabled", "true" ); + } + + this._on({ + // Prevent focus from sticking to links inside menu after clicking + // them (focus should always stay on UL during navigation). + "mousedown .ui-menu-item": function( event ) { + event.preventDefault(); + }, + "click .ui-menu-item": function( event ) { + var target = $( event.target ); + if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) { + this.select( event ); + + // Only set the mouseHandled flag if the event will bubble, see #9469. + if ( !event.isPropagationStopped() ) { + this.mouseHandled = true; + } + + // Open submenu on click + if ( target.has( ".ui-menu" ).length ) { + this.expand( event ); + } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) { + + // Redirect focus to the menu + this.element.trigger( "focus", [ true ] ); + + // If the active item is on the top level, let it stay active. + // Otherwise, blur the active item since it is no longer visible. + if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { + clearTimeout( this.timer ); + } + } + } + }, + "mouseenter .ui-menu-item": function( event ) { + // Ignore mouse events while typeahead is active, see #10458. + // Prevents focusing the wrong item when typeahead causes a scroll while the mouse + // is over an item in the menu + if ( this.previousFilter ) { + return; + } + var target = $( event.currentTarget ); + // Remove ui-state-active class from siblings of the newly focused menu item + // to avoid a jump caused by adjacent elements both having a class with a border + target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" ); + this.focus( event, target ); + }, + mouseleave: "collapseAll", + "mouseleave .ui-menu": "collapseAll", + focus: function( event, keepActiveItem ) { + // If there's already an active item, keep it active + // If not, activate the first item + var item = this.active || this.element.find( this.options.items ).eq( 0 ); + + if ( !keepActiveItem ) { + this.focus( event, item ); + } + }, + blur: function( event ) { + this._delay(function() { + if ( !$.contains( this.element[0], this.document[0].activeElement ) ) { + this.collapseAll( event ); + } + }); + }, + keydown: "_keydown" + }); + + this.refresh(); + + // Clicks outside of a menu collapse any open menus + this._on( this.document, { + click: function( event ) { + if ( this._closeOnDocumentClick( event ) ) { + this.collapseAll( event ); + } + + // Reset the mouseHandled flag + this.mouseHandled = false; + } + }); + }, + + _destroy: function() { + // Destroy (sub)menus + this.element + .removeAttr( "aria-activedescendant" ) + .find( ".ui-menu" ).addBack() + .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" ) + .removeAttr( "role" ) + .removeAttr( "tabIndex" ) + .removeAttr( "aria-labelledby" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-disabled" ) + .removeUniqueId() + .show(); + + // Destroy menu items + this.element.find( ".ui-menu-item" ) + .removeClass( "ui-menu-item" ) + .removeAttr( "role" ) + .removeAttr( "aria-disabled" ) + .removeUniqueId() + .removeClass( "ui-state-hover" ) + .removeAttr( "tabIndex" ) + .removeAttr( "role" ) + .removeAttr( "aria-haspopup" ) + .children().each( function() { + var elem = $( this ); + if ( elem.data( "ui-menu-submenu-carat" ) ) { + elem.remove(); + } + }); + + // Destroy menu dividers + this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" ); + }, + + _keydown: function( event ) { + var match, prev, character, skip, + preventDefault = true; + + switch ( event.keyCode ) { + case $.ui.keyCode.PAGE_UP: + this.previousPage( event ); + break; + case $.ui.keyCode.PAGE_DOWN: + this.nextPage( event ); + break; + case $.ui.keyCode.HOME: + this._move( "first", "first", event ); + break; + case $.ui.keyCode.END: + this._move( "last", "last", event ); + break; + case $.ui.keyCode.UP: + this.previous( event ); + break; + case $.ui.keyCode.DOWN: + this.next( event ); + break; + case $.ui.keyCode.LEFT: + this.collapse( event ); + break; + case $.ui.keyCode.RIGHT: + if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { + this.expand( event ); + } + break; + case $.ui.keyCode.ENTER: + case $.ui.keyCode.SPACE: + this._activate( event ); + break; + case $.ui.keyCode.ESCAPE: + this.collapse( event ); + break; + default: + preventDefault = false; + prev = this.previousFilter || ""; + character = String.fromCharCode( event.keyCode ); + skip = false; + + clearTimeout( this.filterTimer ); + + if ( character === prev ) { + skip = true; + } else { + character = prev + character; + } + + match = this._filterMenuItems( character ); + match = skip && match.index( this.active.next() ) !== -1 ? + this.active.nextAll( ".ui-menu-item" ) : + match; + + // If no matches on the current filter, reset to the last character pressed + // to move down the menu to the first item that starts with that character + if ( !match.length ) { + character = String.fromCharCode( event.keyCode ); + match = this._filterMenuItems( character ); + } + + if ( match.length ) { + this.focus( event, match ); + this.previousFilter = character; + this.filterTimer = this._delay(function() { + delete this.previousFilter; + }, 1000 ); + } else { + delete this.previousFilter; + } + } + + if ( preventDefault ) { + event.preventDefault(); + } + }, + + _activate: function( event ) { + if ( !this.active.is( ".ui-state-disabled" ) ) { + if ( this.active.is( "[aria-haspopup='true']" ) ) { + this.expand( event ); + } else { + this.select( event ); + } + } + }, + + refresh: function() { + var menus, items, + that = this, + icon = this.options.icons.submenu, + submenus = this.element.find( this.options.menus ); + + this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length ); + + // Initialize nested menus + submenus.filter( ":not(.ui-menu)" ) + .addClass( "ui-menu ui-widget ui-widget-content ui-front" ) + .hide() + .attr({ + role: this.options.role, + "aria-hidden": "true", + "aria-expanded": "false" + }) + .each(function() { + var menu = $( this ), + item = menu.parent(), + submenuCarat = $( "" ) + .addClass( "ui-menu-icon ui-icon " + icon ) + .data( "ui-menu-submenu-carat", true ); + + item + .attr( "aria-haspopup", "true" ) + .prepend( submenuCarat ); + menu.attr( "aria-labelledby", item.attr( "id" ) ); + }); + + menus = submenus.add( this.element ); + items = menus.find( this.options.items ); + + // Initialize menu-items containing spaces and/or dashes only as dividers + items.not( ".ui-menu-item" ).each(function() { + var item = $( this ); + if ( that._isDivider( item ) ) { + item.addClass( "ui-widget-content ui-menu-divider" ); + } + }); + + // Don't refresh list items that are already adapted + items.not( ".ui-menu-item, .ui-menu-divider" ) + .addClass( "ui-menu-item" ) + .uniqueId() + .attr({ + tabIndex: -1, + role: this._itemRole() + }); + + // Add aria-disabled attribute to any disabled menu item + items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); + + // If the active item has been removed, blur the menu + if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { + this.blur(); + } + }, + + _itemRole: function() { + return { + menu: "menuitem", + listbox: "option" + }[ this.options.role ]; + }, + + _setOption: function( key, value ) { + if ( key === "icons" ) { + this.element.find( ".ui-menu-icon" ) + .removeClass( this.options.icons.submenu ) + .addClass( value.submenu ); + } + if ( key === "disabled" ) { + this.element + .toggleClass( "ui-state-disabled", !!value ) + .attr( "aria-disabled", value ); + } + this._super( key, value ); + }, + + focus: function( event, item ) { + var nested, focused; + this.blur( event, event && event.type === "focus" ); + + this._scrollIntoView( item ); + + this.active = item.first(); + focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" ); + // Only update aria-activedescendant if there's a role + // otherwise we assume focus is managed elsewhere + if ( this.options.role ) { + this.element.attr( "aria-activedescendant", focused.attr( "id" ) ); + } + + // Highlight active parent menu item, if any + this.active + .parent() + .closest( ".ui-menu-item" ) + .addClass( "ui-state-active" ); + + if ( event && event.type === "keydown" ) { + this._close(); + } else { + this.timer = this._delay(function() { + this._close(); + }, this.delay ); + } + + nested = item.children( ".ui-menu" ); + if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) { + this._startOpening(nested); + } + this.activeMenu = item.parent(); + + this._trigger( "focus", event, { item: item } ); + }, + + _scrollIntoView: function( item ) { + var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; + if ( this._hasScroll() ) { + borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0; + paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0; + offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; + scroll = this.activeMenu.scrollTop(); + elementHeight = this.activeMenu.height(); + itemHeight = item.outerHeight(); + + if ( offset < 0 ) { + this.activeMenu.scrollTop( scroll + offset ); + } else if ( offset + itemHeight > elementHeight ) { + this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight ); + } + } + }, + + blur: function( event, fromFocus ) { + if ( !fromFocus ) { + clearTimeout( this.timer ); + } + + if ( !this.active ) { + return; + } + + this.active.removeClass( "ui-state-focus" ); + this.active = null; + + this._trigger( "blur", event, { item: this.active } ); + }, + + _startOpening: function( submenu ) { + clearTimeout( this.timer ); + + // Don't open if already open fixes a Firefox bug that caused a .5 pixel + // shift in the submenu position when mousing over the carat icon + if ( submenu.attr( "aria-hidden" ) !== "true" ) { + return; + } + + this.timer = this._delay(function() { + this._close(); + this._open( submenu ); + }, this.delay ); + }, + + _open: function( submenu ) { + var position = $.extend({ + of: this.active + }, this.options.position ); + + clearTimeout( this.timer ); + this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) ) + .hide() + .attr( "aria-hidden", "true" ); + + submenu + .show() + .removeAttr( "aria-hidden" ) + .attr( "aria-expanded", "true" ) + .position( position ); + }, + + collapseAll: function( event, all ) { + clearTimeout( this.timer ); + this.timer = this._delay(function() { + // If we were passed an event, look for the submenu that contains the event + var currentMenu = all ? this.element : + $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); + + // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway + if ( !currentMenu.length ) { + currentMenu = this.element; + } + + this._close( currentMenu ); + + this.blur( event ); + this.activeMenu = currentMenu; + }, this.delay ); + }, + + // With no arguments, closes the currently active menu - if nothing is active + // it closes all menus. If passed an argument, it will search for menus BELOW + _close: function( startMenu ) { + if ( !startMenu ) { + startMenu = this.active ? this.active.parent() : this.element; + } + + startMenu + .find( ".ui-menu" ) + .hide() + .attr( "aria-hidden", "true" ) + .attr( "aria-expanded", "false" ) + .end() + .find( ".ui-state-active" ).not( ".ui-state-focus" ) + .removeClass( "ui-state-active" ); + }, + + _closeOnDocumentClick: function( event ) { + return !$( event.target ).closest( ".ui-menu" ).length; + }, + + _isDivider: function( item ) { + + // Match hyphen, em dash, en dash + return !/[^\-\u2014\u2013\s]/.test( item.text() ); + }, + + collapse: function( event ) { + var newItem = this.active && + this.active.parent().closest( ".ui-menu-item", this.element ); + if ( newItem && newItem.length ) { + this._close(); + this.focus( event, newItem ); + } + }, + + expand: function( event ) { + var newItem = this.active && + this.active + .children( ".ui-menu " ) + .find( this.options.items ) + .first(); + + if ( newItem && newItem.length ) { + this._open( newItem.parent() ); + + // Delay so Firefox will not hide activedescendant change in expanding submenu from AT + this._delay(function() { + this.focus( event, newItem ); + }); + } + }, + + next: function( event ) { + this._move( "next", "first", event ); + }, + + previous: function( event ) { + this._move( "prev", "last", event ); + }, + + isFirstItem: function() { + return this.active && !this.active.prevAll( ".ui-menu-item" ).length; + }, + + isLastItem: function() { + return this.active && !this.active.nextAll( ".ui-menu-item" ).length; + }, + + _move: function( direction, filter, event ) { + var next; + if ( this.active ) { + if ( direction === "first" || direction === "last" ) { + next = this.active + [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ) + .eq( -1 ); + } else { + next = this.active + [ direction + "All" ]( ".ui-menu-item" ) + .eq( 0 ); + } + } + if ( !next || !next.length || !this.active ) { + next = this.activeMenu.find( this.options.items )[ filter ](); + } + + this.focus( event, next ); + }, + + nextPage: function( event ) { + var item, base, height; + + if ( !this.active ) { + this.next( event ); + return; + } + if ( this.isLastItem() ) { + return; + } + if ( this._hasScroll() ) { + base = this.active.offset().top; + height = this.element.height(); + this.active.nextAll( ".ui-menu-item" ).each(function() { + item = $( this ); + return item.offset().top - base - height < 0; + }); + + this.focus( event, item ); + } else { + this.focus( event, this.activeMenu.find( this.options.items ) + [ !this.active ? "first" : "last" ]() ); + } + }, + + previousPage: function( event ) { + var item, base, height; + if ( !this.active ) { + this.next( event ); + return; + } + if ( this.isFirstItem() ) { + return; + } + if ( this._hasScroll() ) { + base = this.active.offset().top; + height = this.element.height(); + this.active.prevAll( ".ui-menu-item" ).each(function() { + item = $( this ); + return item.offset().top - base + height > 0; + }); + + this.focus( event, item ); + } else { + this.focus( event, this.activeMenu.find( this.options.items ).first() ); + } + }, + + _hasScroll: function() { + return this.element.outerHeight() < this.element.prop( "scrollHeight" ); + }, + + select: function( event ) { + // TODO: It should never be possible to not have an active item at this + // point, but the tests don't trigger mouseenter before click. + this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); + var ui = { item: this.active }; + if ( !this.active.has( ".ui-menu" ).length ) { + this.collapseAll( event, true ); + } + this._trigger( "select", event, ui ); + }, + + _filterMenuItems: function(character) { + var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ), + regex = new RegExp( "^" + escapedCharacter, "i" ); + + return this.activeMenu + .find( this.options.items ) + + // Only match on items, not dividers or other content (#10571) + .filter( ".ui-menu-item" ) + .filter(function() { + return regex.test( $.trim( $( this ).text() ) ); + }); + } +}); + + +/*! + * jQuery UI Autocomplete 1.11.3 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/autocomplete/ + */ + + +$.widget( "ui.autocomplete", { + version: "1.11.3", + defaultElement: "", + options: { + appendTo: null, + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null, + + // callbacks + change: null, + close: null, + focus: null, + open: null, + response: null, + search: null, + select: null + }, + + requestIndex: 0, + pending: 0, + + _create: function() { + // Some browsers only repeat keydown events, not keypress events, + // so we use the suppressKeyPress flag to determine if we've already + // handled the keydown event. #7269 + // Unfortunately the code for & in keypress is the same as the up arrow, + // so we use the suppressKeyPressRepeat flag to avoid handling keypress + // events when we know the keydown event was used to modify the + // search term. #7799 + var suppressKeyPress, suppressKeyPressRepeat, suppressInput, + nodeName = this.element[ 0 ].nodeName.toLowerCase(), + isTextarea = nodeName === "textarea", + isInput = nodeName === "input"; + + this.isMultiLine = + // Textareas are always multi-line + isTextarea ? true : + // Inputs are always single-line, even if inside a contentEditable element + // IE also treats inputs as contentEditable + isInput ? false : + // All other element types are determined by whether or not they're contentEditable + this.element.prop( "isContentEditable" ); + + this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ]; + this.isNewMenu = true; + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ); + + this._on( this.element, { + keydown: function( event ) { + if ( this.element.prop( "readOnly" ) ) { + suppressKeyPress = true; + suppressInput = true; + suppressKeyPressRepeat = true; + return; + } + + suppressKeyPress = false; + suppressInput = false; + suppressKeyPressRepeat = false; + var keyCode = $.ui.keyCode; + switch ( event.keyCode ) { + case keyCode.PAGE_UP: + suppressKeyPress = true; + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + suppressKeyPress = true; + this._move( "nextPage", event ); + break; + case keyCode.UP: + suppressKeyPress = true; + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + suppressKeyPress = true; + this._keyEvent( "next", event ); + break; + case keyCode.ENTER: + // when menu is open and has focus + if ( this.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + this.menu.select( event ); + } + break; + case keyCode.TAB: + if ( this.menu.active ) { + this.menu.select( event ); + } + break; + case keyCode.ESCAPE: + if ( this.menu.element.is( ":visible" ) ) { + if ( !this.isMultiLine ) { + this._value( this.term ); + } + this.close( event ); + // Different browsers have different default behavior for escape + // Single press can mean undo or clear + // Double press in IE means clear the whole form + event.preventDefault(); + } + break; + default: + suppressKeyPressRepeat = true; + // search timeout should be triggered before the input value is changed + this._searchTimeout( event ); + break; + } + }, + keypress: function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + event.preventDefault(); + } + return; + } + if ( suppressKeyPressRepeat ) { + return; + } + + // replicate some key handlers to allow them to repeat in Firefox and Opera + var keyCode = $.ui.keyCode; + switch ( event.keyCode ) { + case keyCode.PAGE_UP: + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + this._move( "nextPage", event ); + break; + case keyCode.UP: + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + this._keyEvent( "next", event ); + break; + } + }, + input: function( event ) { + if ( suppressInput ) { + suppressInput = false; + event.preventDefault(); + return; + } + this._searchTimeout( event ); + }, + focus: function() { + this.selectedItem = null; + this.previous = this._value(); + }, + blur: function( event ) { + if ( this.cancelBlur ) { + delete this.cancelBlur; + return; + } + + clearTimeout( this.searching ); + this.close( event ); + this._change( event ); + } + }); + + this._initSource(); + this.menu = $( "
            " ) + .addClass( "ui-autocomplete ui-front" ) + .appendTo( this._appendTo() ) + .menu({ + // disable ARIA support, the live region takes care of that + role: null + }) + .hide() + .menu( "instance" ); + + this._on( this.menu.element, { + mousedown: function( event ) { + // prevent moving focus out of the text field + event.preventDefault(); + + // IE doesn't prevent moving focus even with event.preventDefault() + // so we set a flag to know when we should ignore the blur event + this.cancelBlur = true; + this._delay(function() { + delete this.cancelBlur; + }); + + // clicking on the scrollbar causes focus to shift to the body + // but we can't detect a mouseup or a click immediately afterward + // so we have to track the next mousedown and close the menu if + // the user clicks somewhere outside of the autocomplete + var menuElement = this.menu.element[ 0 ]; + if ( !$( event.target ).closest( ".ui-menu-item" ).length ) { + this._delay(function() { + var that = this; + this.document.one( "mousedown", function( event ) { + if ( event.target !== that.element[ 0 ] && + event.target !== menuElement && + !$.contains( menuElement, event.target ) ) { + that.close(); + } + }); + }); + } + }, + menufocus: function( event, ui ) { + var label, item; + // support: Firefox + // Prevent accidental activation of menu items in Firefox (#7024 #9118) + if ( this.isNewMenu ) { + this.isNewMenu = false; + if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) { + this.menu.blur(); + + this.document.one( "mousemove", function() { + $( event.target ).trigger( event.originalEvent ); + }); + + return; + } + } + + item = ui.item.data( "ui-autocomplete-item" ); + if ( false !== this._trigger( "focus", event, { item: item } ) ) { + // use value to match what will end up in the input, if it was a key event + if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) { + this._value( item.value ); + } + } + + // Announce the value in the liveRegion + label = ui.item.attr( "aria-label" ) || item.value; + if ( label && $.trim( label ).length ) { + this.liveRegion.children().hide(); + $( "
            " ).text( label ).appendTo( this.liveRegion ); + } + }, + menuselect: function( event, ui ) { + var item = ui.item.data( "ui-autocomplete-item" ), + previous = this.previous; + + // only trigger when focus was lost (click on menu) + if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) { + this.element.focus(); + this.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + this._delay(function() { + this.previous = previous; + this.selectedItem = item; + }); + } + + if ( false !== this._trigger( "select", event, { item: item } ) ) { + this._value( item.value ); + } + // reset the term after the select event + // this allows custom select handling to work properly + this.term = this._value(); + + this.close( event ); + this.selectedItem = item; + } + }); + + this.liveRegion = $( "", { + role: "status", + "aria-live": "assertive", + "aria-relevant": "additions" + }) + .addClass( "ui-helper-hidden-accessible" ) + .appendTo( this.document[ 0 ].body ); + + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + this._on( this.window, { + beforeunload: function() { + this.element.removeAttr( "autocomplete" ); + } + }); + }, + + _destroy: function() { + clearTimeout( this.searching ); + this.element + .removeClass( "ui-autocomplete-input" ) + .removeAttr( "autocomplete" ); + this.menu.element.remove(); + this.liveRegion.remove(); + }, + + _setOption: function( key, value ) { + this._super( key, value ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( this._appendTo() ); + } + if ( key === "disabled" && value && this.xhr ) { + this.xhr.abort(); + } + }, + + _appendTo: function() { + var element = this.options.appendTo; + + if ( element ) { + element = element.jquery || element.nodeType ? + $( element ) : + this.document.find( element ).eq( 0 ); + } + + if ( !element || !element[ 0 ] ) { + element = this.element.closest( ".ui-front" ); + } + + if ( !element.length ) { + element = this.document[ 0 ].body; + } + + return element; + }, + + _initSource: function() { + var array, url, + that = this; + if ( $.isArray( this.options.source ) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter( array, request.term ) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if ( that.xhr ) { + that.xhr.abort(); + } + that.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data ) { + response( data ); + }, + error: function() { + response([]); + } + }); + }; + } else { + this.source = this.options.source; + } + }, + + _searchTimeout: function( event ) { + clearTimeout( this.searching ); + this.searching = this._delay(function() { + + // Search if the value has changed, or if the user retypes the same value (see #7434) + var equalValues = this.term === this._value(), + menuVisible = this.menu.element.is( ":visible" ), + modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey; + + if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) { + this.selectedItem = null; + this.search( null, event ); + } + }, this.options.delay ); + }, + + search: function( value, event ) { + value = value != null ? value : this._value(); + + // always save the actual value, not the one passed as an argument + this.term = this._value(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.pending++; + this.element.addClass( "ui-autocomplete-loading" ); + this.cancelSearch = false; + + this.source( { term: value }, this._response() ); + }, + + _response: function() { + var index = ++this.requestIndex; + + return $.proxy(function( content ) { + if ( index === this.requestIndex ) { + this.__response( content ); + } + + this.pending--; + if ( !this.pending ) { + this.element.removeClass( "ui-autocomplete-loading" ); + } + }, this ); + }, + + __response: function( content ) { + if ( content ) { + content = this._normalize( content ); + } + this._trigger( "response", null, { content: content } ); + if ( !this.options.disabled && content && content.length && !this.cancelSearch ) { + this._suggest( content ); + this._trigger( "open" ); + } else { + // use ._close() instead of .close() so we don't cancel future searches + this._close(); + } + }, + + close: function( event ) { + this.cancelSearch = true; + this._close( event ); + }, + + _close: function( event ) { + if ( this.menu.element.is( ":visible" ) ) { + this.menu.element.hide(); + this.menu.blur(); + this.isNewMenu = true; + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this._value() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + // assume all items have the right format when the first item is complete + if ( items.length && items[ 0 ].label && items[ 0 ].value ) { + return items; + } + return $.map( items, function( item ) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend( {}, item, { + label: item.label || item.value, + value: item.value || item.label + }); + }); + }, + + _suggest: function( items ) { + var ul = this.menu.element.empty(); + this._renderMenu( ul, items ); + this.isNewMenu = true; + this.menu.refresh(); + + // size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend({ + of: this.element + }, this.options.position ) ); + + if ( this.options.autoFocus ) { + this.menu.next(); + } + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + // Firefox wraps long text (possibly a rounding bug) + // so we add 1px to avoid the wrapping (#7513) + ul.width( "" ).outerWidth() + 1, + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var that = this; + $.each( items, function( index, item ) { + that._renderItemData( ul, item ); + }); + }, + + _renderItemData: function( ul, item ) { + return this._renderItem( ul, item ).data( "ui-autocomplete-item", item ); + }, + + _renderItem: function( ul, item ) { + return $( "
          • " ).text( item.label ).appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is( ":visible" ) ) { + this.search( null, event ); + return; + } + if ( this.menu.isFirstItem() && /^previous/.test( direction ) || + this.menu.isLastItem() && /^next/.test( direction ) ) { + + if ( !this.isMultiLine ) { + this._value( this.term ); + } + + this.menu.blur(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + }, + + _value: function() { + return this.valueMethod.apply( this.element, arguments ); + }, + + _keyEvent: function( keyEvent, event ) { + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + this._move( keyEvent, event ); + + // prevents moving cursor to beginning/end of the text field in some browsers + event.preventDefault(); + } + } +}); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); + }, + filter: function( array, term ) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" ); + return $.grep( array, function( value ) { + return matcher.test( value.label || value.value || value ); + }); + } +}); + +// live region extension, adding a `messages` option +// NOTE: This is an experimental API. We are still investigating +// a full solution for string manipulation and internationalization. +$.widget( "ui.autocomplete", $.ui.autocomplete, { + options: { + messages: { + noResults: "No search results.", + results: function( amount ) { + return amount + ( amount > 1 ? " results are" : " result is" ) + + " available, use up and down arrow keys to navigate."; + } + } + }, + + __response: function( content ) { + var message; + this._superApply( arguments ); + if ( this.options.disabled || this.cancelSearch ) { + return; + } + if ( content && content.length ) { + message = this.options.messages.results( content.length ); + } else { + message = this.options.messages.noResults; + } + this.liveRegion.children().hide(); + $( "
            " ).text( message ).appendTo( this.liveRegion ); + } +}); + +var autocomplete = $.ui.autocomplete; + + +/*! + * jQuery UI Button 1.11.3 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/button/ + */ + + +var lastActive, + baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", + typeClasses = "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", + formResetHandler = function() { + var form = $( this ); + setTimeout(function() { + form.find( ":ui-button" ).button( "refresh" ); + }, 1 ); + }, + radioGroup = function( radio ) { + var name = radio.name, + form = radio.form, + radios = $( [] ); + if ( name ) { + name = name.replace( /'/g, "\\'" ); + if ( form ) { + radios = $( form ).find( "[name='" + name + "'][type=radio]" ); + } else { + radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument ) + .filter(function() { + return !this.form; + }); + } + } + return radios; + }; + +$.widget( "ui.button", { + version: "1.11.3", + defaultElement: "").addClass(this._triggerClass). + html(!buttonImage ? buttonText : $("").attr( + { src:buttonImage, alt:buttonText, title:buttonText }))); + input[isRTL ? "before" : "after"](inst.trigger); + inst.trigger.click(function() { + if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) { + $.datepicker._hideDatepicker(); + } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) { + $.datepicker._hideDatepicker(); + $.datepicker._showDatepicker(input[0]); + } else { + $.datepicker._showDatepicker(input[0]); + } + return false; + }); + } + }, + + /* Apply the maximum length for the date format. */ + _autoSize: function(inst) { + if (this._get(inst, "autoSize") && !inst.inline) { + var findMax, max, maxI, i, + date = new Date(2009, 12 - 1, 20), // Ensure double digits + dateFormat = this._get(inst, "dateFormat"); + + if (dateFormat.match(/[DM]/)) { + findMax = function(names) { + max = 0; + maxI = 0; + for (i = 0; i < names.length; i++) { + if (names[i].length > max) { + max = names[i].length; + maxI = i; + } + } + return maxI; + }; + date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? + "monthNames" : "monthNamesShort")))); + date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? + "dayNames" : "dayNamesShort"))) + 20 - date.getDay()); + } + inst.input.attr("size", this._formatDate(inst, date).length); + } + }, + + /* Attach an inline date picker to a div. */ + _inlineDatepicker: function(target, inst) { + var divSpan = $(target); + if (divSpan.hasClass(this.markerClassName)) { + return; + } + divSpan.addClass(this.markerClassName).append(inst.dpDiv); + $.data(target, "datepicker", inst); + this._setDate(inst, this._getDefaultDate(inst), true); + this._updateDatepicker(inst); + this._updateAlternate(inst); + //If disabled option is true, disable the datepicker before showing it (see ticket #5665) + if( inst.settings.disabled ) { + this._disableDatepicker( target ); + } + // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements + // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height + inst.dpDiv.css( "display", "block" ); + }, + + /* Pop-up the date picker in a "dialog" box. + * @param input element - ignored + * @param date string or Date - the initial date to display + * @param onSelect function - the function to call when a date is selected + * @param settings object - update the dialog date picker instance's settings (anonymous object) + * @param pos int[2] - coordinates for the dialog's position within the screen or + * event - with x/y coordinates or + * leave empty for default (screen centre) + * @return the manager object + */ + _dialogDatepicker: function(input, date, onSelect, settings, pos) { + var id, browserWidth, browserHeight, scrollX, scrollY, + inst = this._dialogInst; // internal instance + + if (!inst) { + this.uuid += 1; + id = "dp" + this.uuid; + this._dialogInput = $(""); + this._dialogInput.keydown(this._doKeyDown); + $("body").append(this._dialogInput); + inst = this._dialogInst = this._newInst(this._dialogInput, false); + inst.settings = {}; + $.data(this._dialogInput[0], "datepicker", inst); + } + datepicker_extendRemove(inst.settings, settings || {}); + date = (date && date.constructor === Date ? this._formatDate(inst, date) : date); + this._dialogInput.val(date); + + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); + if (!this._pos) { + browserWidth = document.documentElement.clientWidth; + browserHeight = document.documentElement.clientHeight; + scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; + scrollY = document.documentElement.scrollTop || document.body.scrollTop; + this._pos = // should use actual width/height below + [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; + } + + // move input on screen for focus, but hidden behind dialog + this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px"); + inst.settings.onSelect = onSelect; + this._inDialog = true; + this.dpDiv.addClass(this._dialogClass); + this._showDatepicker(this._dialogInput[0]); + if ($.blockUI) { + $.blockUI(this.dpDiv); + } + $.data(this._dialogInput[0], "datepicker", inst); + return this; + }, + + /* Detach a datepicker from its control. + * @param target element - the target input field or division or span + */ + _destroyDatepicker: function(target) { + var nodeName, + $target = $(target), + inst = $.data(target, "datepicker"); + + if (!$target.hasClass(this.markerClassName)) { + return; + } + + nodeName = target.nodeName.toLowerCase(); + $.removeData(target, "datepicker"); + if (nodeName === "input") { + inst.append.remove(); + inst.trigger.remove(); + $target.removeClass(this.markerClassName). + unbind("focus", this._showDatepicker). + unbind("keydown", this._doKeyDown). + unbind("keypress", this._doKeyPress). + unbind("keyup", this._doKeyUp); + } else if (nodeName === "div" || nodeName === "span") { + $target.removeClass(this.markerClassName).empty(); + } + + if ( datepicker_instActive === inst ) { + datepicker_instActive = null; + } + }, + + /* Enable the date picker to a jQuery selection. + * @param target element - the target input field or division or span + */ + _enableDatepicker: function(target) { + var nodeName, inline, + $target = $(target), + inst = $.data(target, "datepicker"); + + if (!$target.hasClass(this.markerClassName)) { + return; + } + + nodeName = target.nodeName.toLowerCase(); + if (nodeName === "input") { + target.disabled = false; + inst.trigger.filter("button"). + each(function() { this.disabled = false; }).end(). + filter("img").css({opacity: "1.0", cursor: ""}); + } else if (nodeName === "div" || nodeName === "span") { + inline = $target.children("." + this._inlineClass); + inline.children().removeClass("ui-state-disabled"); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + prop("disabled", false); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value === target ? null : value); }); // delete entry + }, + + /* Disable the date picker to a jQuery selection. + * @param target element - the target input field or division or span + */ + _disableDatepicker: function(target) { + var nodeName, inline, + $target = $(target), + inst = $.data(target, "datepicker"); + + if (!$target.hasClass(this.markerClassName)) { + return; + } + + nodeName = target.nodeName.toLowerCase(); + if (nodeName === "input") { + target.disabled = true; + inst.trigger.filter("button"). + each(function() { this.disabled = true; }).end(). + filter("img").css({opacity: "0.5", cursor: "default"}); + } else if (nodeName === "div" || nodeName === "span") { + inline = $target.children("." + this._inlineClass); + inline.children().addClass("ui-state-disabled"); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + prop("disabled", true); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value === target ? null : value); }); // delete entry + this._disabledInputs[this._disabledInputs.length] = target; + }, + + /* Is the first field in a jQuery collection disabled as a datepicker? + * @param target element - the target input field or division or span + * @return boolean - true if disabled, false if enabled + */ + _isDisabledDatepicker: function(target) { + if (!target) { + return false; + } + for (var i = 0; i < this._disabledInputs.length; i++) { + if (this._disabledInputs[i] === target) { + return true; + } + } + return false; + }, + + /* Retrieve the instance data for the target control. + * @param target element - the target input field or division or span + * @return object - the associated instance data + * @throws error if a jQuery problem getting data + */ + _getInst: function(target) { + try { + return $.data(target, "datepicker"); + } + catch (err) { + throw "Missing instance data for this datepicker"; + } + }, + + /* Update or retrieve the settings for a date picker attached to an input field or division. + * @param target element - the target input field or division or span + * @param name object - the new settings to update or + * string - the name of the setting to change or retrieve, + * when retrieving also "all" for all instance settings or + * "defaults" for all global defaults + * @param value any - the new value for the setting + * (omit if above is an object or to retrieve a value) + */ + _optionDatepicker: function(target, name, value) { + var settings, date, minDate, maxDate, + inst = this._getInst(target); + + if (arguments.length === 2 && typeof name === "string") { + return (name === "defaults" ? $.extend({}, $.datepicker._defaults) : + (inst ? (name === "all" ? $.extend({}, inst.settings) : + this._get(inst, name)) : null)); + } + + settings = name || {}; + if (typeof name === "string") { + settings = {}; + settings[name] = value; + } + + if (inst) { + if (this._curInst === inst) { + this._hideDatepicker(); + } + + date = this._getDateDatepicker(target, true); + minDate = this._getMinMaxDate(inst, "min"); + maxDate = this._getMinMaxDate(inst, "max"); + datepicker_extendRemove(inst.settings, settings); + // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided + if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) { + inst.settings.minDate = this._formatDate(inst, minDate); + } + if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) { + inst.settings.maxDate = this._formatDate(inst, maxDate); + } + if ( "disabled" in settings ) { + if ( settings.disabled ) { + this._disableDatepicker(target); + } else { + this._enableDatepicker(target); + } + } + this._attachments($(target), inst); + this._autoSize(inst); + this._setDate(inst, date); + this._updateAlternate(inst); + this._updateDatepicker(inst); + } + }, + + // change method deprecated + _changeDatepicker: function(target, name, value) { + this._optionDatepicker(target, name, value); + }, + + /* Redraw the date picker attached to an input field or division. + * @param target element - the target input field or division or span + */ + _refreshDatepicker: function(target) { + var inst = this._getInst(target); + if (inst) { + this._updateDatepicker(inst); + } + }, + + /* Set the dates for a jQuery selection. + * @param target element - the target input field or division or span + * @param date Date - the new date + */ + _setDateDatepicker: function(target, date) { + var inst = this._getInst(target); + if (inst) { + this._setDate(inst, date); + this._updateDatepicker(inst); + this._updateAlternate(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. + * @param target element - the target input field or division or span + * @param noDefault boolean - true if no default date is to be used + * @return Date - the current date + */ + _getDateDatepicker: function(target, noDefault) { + var inst = this._getInst(target); + if (inst && !inst.inline) { + this._setDateFromField(inst, noDefault); + } + return (inst ? this._getDate(inst) : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(event) { + var onSelect, dateStr, sel, + inst = $.datepicker._getInst(event.target), + handled = true, + isRTL = inst.dpDiv.is(".ui-datepicker-rtl"); + + inst._keyEvent = true; + if ($.datepicker._datepickerShowing) { + switch (event.keyCode) { + case 9: $.datepicker._hideDatepicker(); + handled = false; + break; // hide on tab out + case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." + + $.datepicker._currentClass + ")", inst.dpDiv); + if (sel[0]) { + $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); + } + + onSelect = $.datepicker._get(inst, "onSelect"); + if (onSelect) { + dateStr = $.datepicker._formatDate(inst); + + // trigger custom callback + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); + } else { + $.datepicker._hideDatepicker(); + } + + return false; // don't submit the form + case 27: $.datepicker._hideDatepicker(); + break; // hide on escape + case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, "stepBigMonths") : + -$.datepicker._get(inst, "stepMonths")), "M"); + break; // previous month/year on page up/+ ctrl + case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, "stepBigMonths") : + +$.datepicker._get(inst, "stepMonths")), "M"); + break; // next month/year on page down/+ ctrl + case 35: if (event.ctrlKey || event.metaKey) { + $.datepicker._clearDate(event.target); + } + handled = event.ctrlKey || event.metaKey; + break; // clear on ctrl or command +end + case 36: if (event.ctrlKey || event.metaKey) { + $.datepicker._gotoToday(event.target); + } + handled = event.ctrlKey || event.metaKey; + break; // current on ctrl or command +home + case 37: if (event.ctrlKey || event.metaKey) { + $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D"); + } + handled = event.ctrlKey || event.metaKey; + // -1 day on ctrl or command +left + if (event.originalEvent.altKey) { + $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, "stepBigMonths") : + -$.datepicker._get(inst, "stepMonths")), "M"); + } + // next month/year on alt +left on Mac + break; + case 38: if (event.ctrlKey || event.metaKey) { + $.datepicker._adjustDate(event.target, -7, "D"); + } + handled = event.ctrlKey || event.metaKey; + break; // -1 week on ctrl or command +up + case 39: if (event.ctrlKey || event.metaKey) { + $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D"); + } + handled = event.ctrlKey || event.metaKey; + // +1 day on ctrl or command +right + if (event.originalEvent.altKey) { + $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, "stepBigMonths") : + +$.datepicker._get(inst, "stepMonths")), "M"); + } + // next month/year on alt +right + break; + case 40: if (event.ctrlKey || event.metaKey) { + $.datepicker._adjustDate(event.target, +7, "D"); + } + handled = event.ctrlKey || event.metaKey; + break; // +1 week on ctrl or command +down + default: handled = false; + } + } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + } else { + handled = false; + } + + if (handled) { + event.preventDefault(); + event.stopPropagation(); + } + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(event) { + var chars, chr, + inst = $.datepicker._getInst(event.target); + + if ($.datepicker._get(inst, "constrainInput")) { + chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat")); + chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode); + return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1); + } + }, + + /* Synchronise manual entry and field/alternate field. */ + _doKeyUp: function(event) { + var date, + inst = $.datepicker._getInst(event.target); + + if (inst.input.val() !== inst.lastVal) { + try { + date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), + (inst.input ? inst.input.val() : null), + $.datepicker._getFormatConfig(inst)); + + if (date) { // only if valid + $.datepicker._setDateFromField(inst); + $.datepicker._updateAlternate(inst); + $.datepicker._updateDatepicker(inst); + } + } + catch (err) { + } + } + return true; + }, + + /* Pop-up the date picker for a given input field. + * If false returned from beforeShow event handler do not show. + * @param input element - the input field attached to the date picker or + * event - if triggered by focus + */ + _showDatepicker: function(input) { + input = input.target || input; + if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger + input = $("input", input.parentNode)[0]; + } + + if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here + return; + } + + var inst, beforeShow, beforeShowSettings, isFixed, + offset, showAnim, duration; + + inst = $.datepicker._getInst(input); + if ($.datepicker._curInst && $.datepicker._curInst !== inst) { + $.datepicker._curInst.dpDiv.stop(true, true); + if ( inst && $.datepicker._datepickerShowing ) { + $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] ); + } + } + + beforeShow = $.datepicker._get(inst, "beforeShow"); + beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; + if(beforeShowSettings === false){ + return; + } + datepicker_extendRemove(inst.settings, beforeShowSettings); + + inst.lastVal = null; + $.datepicker._lastInput = input; + $.datepicker._setDateFromField(inst); + + if ($.datepicker._inDialog) { // hide cursor + input.value = ""; + } + if (!$.datepicker._pos) { // position below input + $.datepicker._pos = $.datepicker._findPos(input); + $.datepicker._pos[1] += input.offsetHeight; // add the height + } + + isFixed = false; + $(input).parents().each(function() { + isFixed |= $(this).css("position") === "fixed"; + return !isFixed; + }); + + offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; + $.datepicker._pos = null; + //to avoid flashes on Firefox + inst.dpDiv.empty(); + // determine sizing offscreen + inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"}); + $.datepicker._updateDatepicker(inst); + // fix width for dynamic number of date pickers + // and adjust position before showing + offset = $.datepicker._checkOffset(inst, offset, isFixed); + inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? + "static" : (isFixed ? "fixed" : "absolute")), display: "none", + left: offset.left + "px", top: offset.top + "px"}); + + if (!inst.inline) { + showAnim = $.datepicker._get(inst, "showAnim"); + duration = $.datepicker._get(inst, "duration"); + inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 ); + $.datepicker._datepickerShowing = true; + + if ( $.effects && $.effects.effect[ showAnim ] ) { + inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration); + } else { + inst.dpDiv[showAnim || "show"](showAnim ? duration : null); + } + + if ( $.datepicker._shouldFocusInput( inst ) ) { + inst.input.focus(); + } + + $.datepicker._curInst = inst; + } + }, + + /* Generate the date picker content. */ + _updateDatepicker: function(inst) { + this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) + datepicker_instActive = inst; // for delegate hover events + inst.dpDiv.empty().append(this._generateHTML(inst)); + this._attachHandlers(inst); + + var origyearshtml, + numMonths = this._getNumberOfMonths(inst), + cols = numMonths[1], + width = 17, + activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ); + + if ( activeCell.length > 0 ) { + datepicker_handleMouseover.apply( activeCell.get( 0 ) ); + } + + inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""); + if (cols > 1) { + inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em"); + } + inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") + + "Class"]("ui-datepicker-multi"); + inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + + "Class"]("ui-datepicker-rtl"); + + if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) { + inst.input.focus(); + } + + // deffered render of the years select (to avoid flashes on Firefox) + if( inst.yearshtml ){ + origyearshtml = inst.yearshtml; + setTimeout(function(){ + //assure that inst.yearshtml didn't change. + if( origyearshtml === inst.yearshtml && inst.yearshtml ){ + inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml); + } + origyearshtml = inst.yearshtml = null; + }, 0); + } + }, + + // #6694 - don't focus the input if it's already focused + // this breaks the change event in IE + // Support: IE and jQuery <1.9 + _shouldFocusInput: function( inst ) { + return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" ); + }, + + /* Check positioning to remain on screen. */ + _checkOffset: function(inst, offset, isFixed) { + var dpWidth = inst.dpDiv.outerWidth(), + dpHeight = inst.dpDiv.outerHeight(), + inputWidth = inst.input ? inst.input.outerWidth() : 0, + inputHeight = inst.input ? inst.input.outerHeight() : 0, + viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()), + viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop()); + + offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0); + offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0; + offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; + + // now check if datepicker is showing outside window viewport - move to a better place if so. + offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight) : 0); + + return offset; + }, + + /* Find an object's position on the screen. */ + _findPos: function(obj) { + var position, + inst = this._getInst(obj), + isRTL = this._get(inst, "isRTL"); + + while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) { + obj = obj[isRTL ? "previousSibling" : "nextSibling"]; + } + + position = $(obj).offset(); + return [position.left, position.top]; + }, + + /* Hide the date picker from view. + * @param input element - the input field attached to the date picker + */ + _hideDatepicker: function(input) { + var showAnim, duration, postProcess, onClose, + inst = this._curInst; + + if (!inst || (input && inst !== $.data(input, "datepicker"))) { + return; + } + + if (this._datepickerShowing) { + showAnim = this._get(inst, "showAnim"); + duration = this._get(inst, "duration"); + postProcess = function() { + $.datepicker._tidyDialog(inst); + }; + + // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed + if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) { + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess); + } else { + inst.dpDiv[(showAnim === "slideDown" ? "slideUp" : + (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess); + } + + if (!showAnim) { + postProcess(); + } + this._datepickerShowing = false; + + onClose = this._get(inst, "onClose"); + if (onClose) { + onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]); + } + + this._lastInput = null; + if (this._inDialog) { + this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }); + if ($.blockUI) { + $.unblockUI(); + $("body").append(this.dpDiv); + } + } + this._inDialog = false; + } + }, + + /* Tidy up after a dialog display. */ + _tidyDialog: function(inst) { + inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar"); + }, + + /* Close date picker if clicked elsewhere. */ + _checkExternalClick: function(event) { + if (!$.datepicker._curInst) { + return; + } + + var $target = $(event.target), + inst = $.datepicker._getInst($target[0]); + + if ( ( ( $target[0].id !== $.datepicker._mainDivId && + $target.parents("#" + $.datepicker._mainDivId).length === 0 && + !$target.hasClass($.datepicker.markerClassName) && + !$target.closest("." + $.datepicker._triggerClass).length && + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) || + ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) { + $.datepicker._hideDatepicker(); + } + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(id, offset, period) { + var target = $(id), + inst = this._getInst(target[0]); + + if (this._isDisabledDatepicker(target[0])) { + return; + } + this._adjustInstDate(inst, offset + + (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning + period); + this._updateDatepicker(inst); + }, + + /* Action for current link. */ + _gotoToday: function(id) { + var date, + target = $(id), + inst = this._getInst(target[0]); + + if (this._get(inst, "gotoCurrent") && inst.currentDay) { + inst.selectedDay = inst.currentDay; + inst.drawMonth = inst.selectedMonth = inst.currentMonth; + inst.drawYear = inst.selectedYear = inst.currentYear; + } else { + date = new Date(); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + } + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a new month/year. */ + _selectMonthYear: function(id, select, period) { + var target = $(id), + inst = this._getInst(target[0]); + + inst["selected" + (period === "M" ? "Month" : "Year")] = + inst["draw" + (period === "M" ? "Month" : "Year")] = + parseInt(select.options[select.selectedIndex].value,10); + + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a day. */ + _selectDay: function(id, month, year, td) { + var inst, + target = $(id); + + if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { + return; + } + + inst = this._getInst(target[0]); + inst.selectedDay = inst.currentDay = $("a", td).html(); + inst.selectedMonth = inst.currentMonth = month; + inst.selectedYear = inst.currentYear = year; + this._selectDate(id, this._formatDate(inst, + inst.currentDay, inst.currentMonth, inst.currentYear)); + }, + + /* Erase the input field and hide the date picker. */ + _clearDate: function(id) { + var target = $(id); + this._selectDate(target, ""); + }, + + /* Update the input field with the selected date. */ + _selectDate: function(id, dateStr) { + var onSelect, + target = $(id), + inst = this._getInst(target[0]); + + dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); + if (inst.input) { + inst.input.val(dateStr); + } + this._updateAlternate(inst); + + onSelect = this._get(inst, "onSelect"); + if (onSelect) { + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback + } else if (inst.input) { + inst.input.trigger("change"); // fire the change event + } + + if (inst.inline){ + this._updateDatepicker(inst); + } else { + this._hideDatepicker(); + this._lastInput = inst.input[0]; + if (typeof(inst.input[0]) !== "object") { + inst.input.focus(); // restore focus + } + this._lastInput = null; + } + }, + + /* Update any alternate field to synchronise with the main field. */ + _updateAlternate: function(inst) { + var altFormat, date, dateStr, + altField = this._get(inst, "altField"); + + if (altField) { // update alternate field too + altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat"); + date = this._getDate(inst); + dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); + $(altField).each(function() { $(this).val(dateStr); }); + } + }, + + /* Set as beforeShowDay function to prevent selection of weekends. + * @param date Date - the date to customise + * @return [boolean, string] - is this date selectable?, what is its CSS class? + */ + noWeekends: function(date) { + var day = date.getDay(); + return [(day > 0 && day < 6), ""]; + }, + + /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. + * @param date Date - the date to get the week for + * @return number - the number of the week within the year that contains this date + */ + iso8601Week: function(date) { + var time, + checkDate = new Date(date.getTime()); + + // Find Thursday of this week starting on Monday + checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); + + time = checkDate.getTime(); + checkDate.setMonth(0); // Compare with Jan 1 + checkDate.setDate(1); + return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; + }, + + /* Parse a string value into a date object. + * See formatDate below for the possible formats. + * + * @param format string - the expected format of the date + * @param value string - the date in the above format + * @param settings Object - attributes include: + * shortYearCutoff number - the cutoff year for determining the century (optional) + * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + * dayNames string[7] - names of the days from Sunday (optional) + * monthNamesShort string[12] - abbreviated names of the months (optional) + * monthNames string[12] - names of the months (optional) + * @return Date - the extracted date value or null if value is blank + */ + parseDate: function (format, value, settings) { + if (format == null || value == null) { + throw "Invalid arguments"; + } + + value = (typeof value === "object" ? value.toString() : value + ""); + if (value === "") { + return null; + } + + var iFormat, dim, extra, + iValue = 0, + shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff, + shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp : + new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)), + dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort, + dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames, + monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort, + monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames, + year = -1, + month = -1, + day = -1, + doy = -1, + literal = false, + date, + // Check whether a format character is doubled + lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); + if (matches) { + iFormat++; + } + return matches; + }, + // Extract a number from the string value + getNumber = function(match) { + var isDoubled = lookAhead(match), + size = (match === "@" ? 14 : (match === "!" ? 20 : + (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))), + minSize = (match === "y" ? size : 1), + digits = new RegExp("^\\d{" + minSize + "," + size + "}"), + num = value.substring(iValue).match(digits); + if (!num) { + throw "Missing number at position " + iValue; + } + iValue += num[0].length; + return parseInt(num[0], 10); + }, + // Extract a name from the string value and convert to an index + getName = function(match, shortNames, longNames) { + var index = -1, + names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { + return [ [k, v] ]; + }).sort(function (a, b) { + return -(a[1].length - b[1].length); + }); + + $.each(names, function (i, pair) { + var name = pair[1]; + if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) { + index = pair[0]; + iValue += name.length; + return false; + } + }); + if (index !== -1) { + return index + 1; + } else { + throw "Unknown name at position " + iValue; + } + }, + // Confirm that a literal character matches the string value + checkLiteral = function() { + if (value.charAt(iValue) !== format.charAt(iFormat)) { + throw "Unexpected literal at position " + iValue; + } + iValue++; + }; + + for (iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) { + if (format.charAt(iFormat) === "'" && !lookAhead("'")) { + literal = false; + } else { + checkLiteral(); + } + } else { + switch (format.charAt(iFormat)) { + case "d": + day = getNumber("d"); + break; + case "D": + getName("D", dayNamesShort, dayNames); + break; + case "o": + doy = getNumber("o"); + break; + case "m": + month = getNumber("m"); + break; + case "M": + month = getName("M", monthNamesShort, monthNames); + break; + case "y": + year = getNumber("y"); + break; + case "@": + date = new Date(getNumber("@")); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "!": + date = new Date((getNumber("!") - this._ticksTo1970) / 10000); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "'": + if (lookAhead("'")){ + checkLiteral(); + } else { + literal = true; + } + break; + default: + checkLiteral(); + } + } + } + + if (iValue < value.length){ + extra = value.substr(iValue); + if (!/^\s+/.test(extra)) { + throw "Extra/unparsed characters found in date: " + extra; + } + } + + if (year === -1) { + year = new Date().getFullYear(); + } else if (year < 100) { + year += new Date().getFullYear() - new Date().getFullYear() % 100 + + (year <= shortYearCutoff ? 0 : -100); + } + + if (doy > -1) { + month = 1; + day = doy; + do { + dim = this._getDaysInMonth(year, month - 1); + if (day <= dim) { + break; + } + month++; + day -= dim; + } while (true); + } + + date = this._daylightSavingAdjust(new Date(year, month - 1, day)); + if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) { + throw "Invalid date"; // E.g. 31/02/00 + } + return date; + }, + + /* Standard date formats. */ + ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601) + 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", // RFC 822 + TICKS: "!", + TIMESTAMP: "@", + W3C: "yy-mm-dd", // ISO 8601 + + _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), + + /* Format a date object into a string value. + * The format can be combinations of the following: + * d - day of month (no leading zero) + * dd - day of month (two digit) + * o - day of year (no leading zeros) + * oo - day of year (three digit) + * D - day name short + * DD - day name long + * m - month of year (no leading zero) + * mm - month of year (two digit) + * M - month name short + * MM - month name long + * y - year (two digit) + * yy - year (four digit) + * @ - Unix timestamp (ms since 01/01/1970) + * ! - Windows ticks (100ns since 01/01/0001) + * "..." - literal text + * '' - single quote + * + * @param format string - the desired format of the date + * @param date Date - the date value to format + * @param settings Object - attributes include: + * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + * dayNames string[7] - names of the days from Sunday (optional) + * monthNamesShort string[12] - abbreviated names of the months (optional) + * monthNames string[12] - names of the months (optional) + * @return string - the date in the above format + */ + formatDate: function (format, date, settings) { + if (!date) { + return ""; + } + + var iFormat, + dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort, + dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames, + monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort, + monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames, + // Check whether a format character is doubled + lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); + if (matches) { + iFormat++; + } + return matches; + }, + // Format a number, with leading zero if necessary + formatNumber = function(match, value, len) { + var num = "" + value; + if (lookAhead(match)) { + while (num.length < len) { + num = "0" + num; + } + } + return num; + }, + // Format a name, short or long as requested + formatName = function(match, value, shortNames, longNames) { + return (lookAhead(match) ? longNames[value] : shortNames[value]); + }, + output = "", + literal = false; + + if (date) { + for (iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) { + if (format.charAt(iFormat) === "'" && !lookAhead("'")) { + literal = false; + } else { + output += format.charAt(iFormat); + } + } else { + switch (format.charAt(iFormat)) { + case "d": + output += formatNumber("d", date.getDate(), 2); + break; + case "D": + output += formatName("D", date.getDay(), dayNamesShort, dayNames); + break; + case "o": + output += formatNumber("o", + Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); + break; + case "m": + output += formatNumber("m", date.getMonth() + 1, 2); + break; + case "M": + output += formatName("M", date.getMonth(), monthNamesShort, monthNames); + break; + case "y": + output += (lookAhead("y") ? date.getFullYear() : + (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100); + break; + case "@": + output += date.getTime(); + break; + case "!": + output += date.getTime() * 10000 + this._ticksTo1970; + break; + case "'": + if (lookAhead("'")) { + output += "'"; + } else { + literal = true; + } + break; + default: + output += format.charAt(iFormat); + } + } + } + } + return output; + }, + + /* Extract all possible characters from the date format. */ + _possibleChars: function (format) { + var iFormat, + chars = "", + literal = false, + // Check whether a format character is doubled + lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); + if (matches) { + iFormat++; + } + return matches; + }; + + for (iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) { + if (format.charAt(iFormat) === "'" && !lookAhead("'")) { + literal = false; + } else { + chars += format.charAt(iFormat); + } + } else { + switch (format.charAt(iFormat)) { + case "d": case "m": case "y": case "@": + chars += "0123456789"; + break; + case "D": case "M": + return null; // Accept anything + case "'": + if (lookAhead("'")) { + chars += "'"; + } else { + literal = true; + } + break; + default: + chars += format.charAt(iFormat); + } + } + } + return chars; + }, + + /* Get a setting value, defaulting if necessary. */ + _get: function(inst, name) { + return inst.settings[name] !== undefined ? + inst.settings[name] : this._defaults[name]; + }, + + /* Parse existing date and initialise date picker. */ + _setDateFromField: function(inst, noDefault) { + if (inst.input.val() === inst.lastVal) { + return; + } + + var dateFormat = this._get(inst, "dateFormat"), + dates = inst.lastVal = inst.input ? inst.input.val() : null, + defaultDate = this._getDefaultDate(inst), + date = defaultDate, + settings = this._getFormatConfig(inst); + + try { + date = this.parseDate(dateFormat, dates, settings) || defaultDate; + } catch (event) { + dates = (noDefault ? "" : dates); + } + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + inst.currentDay = (dates ? date.getDate() : 0); + inst.currentMonth = (dates ? date.getMonth() : 0); + inst.currentYear = (dates ? date.getFullYear() : 0); + this._adjustInstDate(inst); + }, + + /* Retrieve the default date shown on opening. */ + _getDefaultDate: function(inst) { + return this._restrictMinMax(inst, + this._determineDate(inst, this._get(inst, "defaultDate"), new Date())); + }, + + /* A date may be specified as an exact value or a relative one. */ + _determineDate: function(inst, date, defaultDate) { + var offsetNumeric = function(offset) { + var date = new Date(); + date.setDate(date.getDate() + offset); + return date; + }, + offsetString = function(offset) { + try { + return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), + offset, $.datepicker._getFormatConfig(inst)); + } + catch (e) { + // Ignore + } + + var date = (offset.toLowerCase().match(/^c/) ? + $.datepicker._getDate(inst) : null) || new Date(), + year = date.getFullYear(), + month = date.getMonth(), + day = date.getDate(), + pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, + matches = pattern.exec(offset); + + while (matches) { + switch (matches[2] || "d") { + case "d" : case "D" : + day += parseInt(matches[1],10); break; + case "w" : case "W" : + day += parseInt(matches[1],10) * 7; break; + case "m" : case "M" : + month += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + case "y": case "Y" : + year += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + } + matches = pattern.exec(offset); + } + return new Date(year, month, day); + }, + newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) : + (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); + + newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate); + if (newDate) { + newDate.setHours(0); + newDate.setMinutes(0); + newDate.setSeconds(0); + newDate.setMilliseconds(0); + } + return this._daylightSavingAdjust(newDate); + }, + + /* Handle switch to/from daylight saving. + * Hours may be non-zero on daylight saving cut-over: + * > 12 when midnight changeover, but then cannot generate + * midnight datetime, so jump to 1AM, otherwise reset. + * @param date (Date) the date to check + * @return (Date) the corrected date + */ + _daylightSavingAdjust: function(date) { + if (!date) { + return null; + } + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); + return date; + }, + + /* Set the date(s) directly. */ + _setDate: function(inst, date, noChange) { + var clear = !date, + origMonth = inst.selectedMonth, + origYear = inst.selectedYear, + newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); + + inst.selectedDay = inst.currentDay = newDate.getDate(); + inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); + inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); + if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) { + this._notifyChange(inst); + } + this._adjustInstDate(inst); + if (inst.input) { + inst.input.val(clear ? "" : this._formatDate(inst)); + } + }, + + /* Retrieve the date(s) directly. */ + _getDate: function(inst) { + var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null : + this._daylightSavingAdjust(new Date( + inst.currentYear, inst.currentMonth, inst.currentDay))); + return startDate; + }, + + /* Attach the onxxx handlers. These are declared statically so + * they work with static code transformers like Caja. + */ + _attachHandlers: function(inst) { + var stepMonths = this._get(inst, "stepMonths"), + id = "#" + inst.id.replace( /\\\\/g, "\\" ); + inst.dpDiv.find("[data-handler]").map(function () { + var handler = { + prev: function () { + $.datepicker._adjustDate(id, -stepMonths, "M"); + }, + next: function () { + $.datepicker._adjustDate(id, +stepMonths, "M"); + }, + hide: function () { + $.datepicker._hideDatepicker(); + }, + today: function () { + $.datepicker._gotoToday(id); + }, + selectDay: function () { + $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this); + return false; + }, + selectMonth: function () { + $.datepicker._selectMonthYear(id, this, "M"); + return false; + }, + selectYear: function () { + $.datepicker._selectMonthYear(id, this, "Y"); + return false; + } + }; + $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]); + }); + }, + + /* Generate the HTML for the current state of the date picker. */ + _generateHTML: function(inst) { + var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, + controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, + monthNames, monthNamesShort, beforeShowDay, showOtherMonths, + selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, + cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, + printDate, dRow, tbody, daySettings, otherMonth, unselectable, + tempDate = new Date(), + today = this._daylightSavingAdjust( + new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time + isRTL = this._get(inst, "isRTL"), + showButtonPanel = this._get(inst, "showButtonPanel"), + hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"), + navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"), + numMonths = this._getNumberOfMonths(inst), + showCurrentAtPos = this._get(inst, "showCurrentAtPos"), + stepMonths = this._get(inst, "stepMonths"), + isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1), + currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : + new Date(inst.currentYear, inst.currentMonth, inst.currentDay))), + minDate = this._getMinMaxDate(inst, "min"), + maxDate = this._getMinMaxDate(inst, "max"), + drawMonth = inst.drawMonth - showCurrentAtPos, + drawYear = inst.drawYear; + + if (drawMonth < 0) { + drawMonth += 12; + drawYear--; + } + if (maxDate) { + maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), + maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); + while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { + drawMonth--; + if (drawMonth < 0) { + drawMonth = 11; + drawYear--; + } + } + } + inst.drawMonth = drawMonth; + inst.drawYear = drawYear; + + prevText = this._get(inst, "prevText"); + prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), + this._getFormatConfig(inst))); + + prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? + "" + prevText + "" : + (hideIfNoPrevNext ? "" : "" + prevText + "")); + + nextText = this._get(inst, "nextText"); + nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), + this._getFormatConfig(inst))); + + next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? + "" + nextText + "" : + (hideIfNoPrevNext ? "" : "" + nextText + "")); + + currentText = this._get(inst, "currentText"); + gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today); + currentText = (!navigationAsDateFormat ? currentText : + this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); + + controls = (!inst.inline ? "" : ""); + + buttonPanel = (showButtonPanel) ? "
            " + (isRTL ? controls : "") + + (this._isInRange(inst, gotoDate) ? "" : "") + (isRTL ? "" : controls) + "
            " : ""; + + firstDay = parseInt(this._get(inst, "firstDay"),10); + firstDay = (isNaN(firstDay) ? 0 : firstDay); + + showWeek = this._get(inst, "showWeek"); + dayNames = this._get(inst, "dayNames"); + dayNamesMin = this._get(inst, "dayNamesMin"); + monthNames = this._get(inst, "monthNames"); + monthNamesShort = this._get(inst, "monthNamesShort"); + beforeShowDay = this._get(inst, "beforeShowDay"); + showOtherMonths = this._get(inst, "showOtherMonths"); + selectOtherMonths = this._get(inst, "selectOtherMonths"); + defaultDate = this._getDefaultDate(inst); + html = ""; + dow; + for (row = 0; row < numMonths[0]; row++) { + group = ""; + this.maxRows = 4; + for (col = 0; col < numMonths[1]; col++) { + selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); + cornerClass = " ui-corner-all"; + calender = ""; + if (isMultiMonth) { + calender += "
            "; + } + calender += "
            " + + (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") + + (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") + + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, + row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers + "
            " + + ""; + thead = (showWeek ? "" : ""); + for (dow = 0; dow < 7; dow++) { // days of the week + day = (dow + firstDay) % 7; + thead += ""; + } + calender += thead + ""; + daysInMonth = this._getDaysInMonth(drawYear, drawMonth); + if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) { + inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); + } + leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; + curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate + numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) + this.maxRows = numRows; + printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); + for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows + calender += ""; + tbody = (!showWeek ? "" : ""); + for (dow = 0; dow < 7; dow++) { // create date picker days + daySettings = (beforeShowDay ? + beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]); + otherMonth = (printDate.getMonth() !== drawMonth); + unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); + tbody += ""; // display selectable date + printDate.setDate(printDate.getDate() + 1); + printDate = this._daylightSavingAdjust(printDate); + } + calender += tbody + ""; + } + drawMonth++; + if (drawMonth > 11) { + drawMonth = 0; + drawYear++; + } + calender += "
            " + this._get(inst, "weekHeader") + "= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + + "" + dayNamesMin[day] + "
            " + + this._get(inst, "calculateWeek")(printDate) + "" + // actions + (otherMonth && !showOtherMonths ? " " : // display for other months + (unselectable ? "" + printDate.getDate() + "" : "" + printDate.getDate() + "")) + "
            " + (isMultiMonth ? "
            " + + ((numMonths[0] > 0 && col === numMonths[1]-1) ? "
            " : "") : ""); + group += calender; + } + html += group; + } + html += buttonPanel; + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + + var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, + changeMonth = this._get(inst, "changeMonth"), + changeYear = this._get(inst, "changeYear"), + showMonthAfterYear = this._get(inst, "showMonthAfterYear"), + html = "
            ", + monthHtml = ""; + + // month selection + if (secondary || !changeMonth) { + monthHtml += "" + monthNames[drawMonth] + ""; + } else { + inMinYear = (minDate && minDate.getFullYear() === drawYear); + inMaxYear = (maxDate && maxDate.getFullYear() === drawYear); + monthHtml += ""; + } + + if (!showMonthAfterYear) { + html += monthHtml + (secondary || !(changeMonth && changeYear) ? " " : ""); + } + + // year selection + if ( !inst.yearshtml ) { + inst.yearshtml = ""; + if (secondary || !changeYear) { + html += "" + drawYear + ""; + } else { + // determine range of years to display + years = this._get(inst, "yearRange").split(":"); + thisYear = new Date().getFullYear(); + determineYear = function(value) { + var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + year = determineYear(years[0]); + endYear = Math.max(year, determineYear(years[1] || "")); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + inst.yearshtml += ""; + + html += inst.yearshtml; + inst.yearshtml = null; + } + } + + html += this._get(inst, "yearSuffix"); + if (showMonthAfterYear) { + html += (secondary || !(changeMonth && changeYear) ? " " : "") + monthHtml; + } + html += "
            "; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period === "Y" ? offset : 0), + month = inst.drawMonth + (period === "M" ? offset : 0), + day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0), + date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day))); + + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period === "M" || period === "Y") { + this._notifyChange(inst); + } + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, "min"), + maxDate = this._getMinMaxDate(inst, "max"), + newDate = (minDate && date < minDate ? minDate : date); + return (maxDate && newDate > maxDate ? maxDate : newDate); + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, "onChangeMonthYear"); + if (onChange) { + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + } + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, "numberOfMonths"); + return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + "Date"), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst), + date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + + if (offset < 0) { + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + } + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var yearSplit, currentYear, + minDate = this._getMinMaxDate(inst, "min"), + maxDate = this._getMinMaxDate(inst, "max"), + minYear = null, + maxYear = null, + years = this._get(inst, "yearRange"); + if (years){ + yearSplit = years.split(":"); + currentYear = new Date().getFullYear(); + minYear = parseInt(yearSplit[0], 10); + maxYear = parseInt(yearSplit[1], 10); + if ( yearSplit[0].match(/[+\-].*/) ) { + minYear += currentYear; + } + if ( yearSplit[1].match(/[+\-].*/) ) { + maxYear += currentYear; + } + } + + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime()) && + (!minYear || date.getFullYear() >= minYear) && + (!maxYear || date.getFullYear() <= maxYear)); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, "shortYearCutoff"); + shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"), + monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")}; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day === "object" ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst)); + } +}); + +/* + * Bind hover events for datepicker elements. + * Done via delegate so the binding only occurs once in the lifetime of the parent div. + * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. + */ +function datepicker_bindHover(dpDiv) { + var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; + return dpDiv.delegate(selector, "mouseout", function() { + $(this).removeClass("ui-state-hover"); + if (this.className.indexOf("ui-datepicker-prev") !== -1) { + $(this).removeClass("ui-datepicker-prev-hover"); + } + if (this.className.indexOf("ui-datepicker-next") !== -1) { + $(this).removeClass("ui-datepicker-next-hover"); + } + }) + .delegate( selector, "mouseover", datepicker_handleMouseover ); +} + +function datepicker_handleMouseover() { + if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) { + $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); + $(this).addClass("ui-state-hover"); + if (this.className.indexOf("ui-datepicker-prev") !== -1) { + $(this).addClass("ui-datepicker-prev-hover"); + } + if (this.className.indexOf("ui-datepicker-next") !== -1) { + $(this).addClass("ui-datepicker-next-hover"); + } + } +} + +/* jQuery extend now ignores nulls! */ +function datepicker_extendRemove(target, props) { + $.extend(target, props); + for (var name in props) { + if (props[name] == null) { + target[name] = props[name]; + } + } + return target; +} + +/* Invoke the datepicker functionality. + @param options string - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function(options){ + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick); + $.datepicker.initialized = true; + } + + /* Append datepicker main container to body if not exist. */ + if ($("#"+$.datepicker._mainDivId).length === 0) { + $("body").append($.datepicker.dpDiv); + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) { + return $.datepicker["_" + options + "Datepicker"]. + apply($.datepicker, [this[0]].concat(otherArgs)); + } + if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") { + return $.datepicker["_" + options + "Datepicker"]. + apply($.datepicker, [this[0]].concat(otherArgs)); + } + return this.each(function() { + typeof options === "string" ? + $.datepicker["_" + options + "Datepicker"]. + apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); +}; + +$.datepicker = new Datepicker(); // singleton instance +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.11.3"; + +var datepicker = $.datepicker; + + +/*! + * jQuery UI Draggable 1.11.3 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/draggable/ + */ + + +$.widget("ui.draggable", $.ui.mouse, { + version: "1.11.3", + 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, + + // callbacks + drag: null, + start: null, + stop: null + }, + _create: function() { + + if ( this.options.helper === "original" ) { + this._setPositionRelative(); + } + if (this.options.addClasses){ + this.element.addClass("ui-draggable"); + } + if (this.options.disabled){ + this.element.addClass("ui-draggable-disabled"); + } + this._setHandleClassName(); + + this._mouseInit(); + }, + + _setOption: function( key, value ) { + this._super( key, value ); + if ( key === "handle" ) { + this._removeHandleClassName(); + this._setHandleClassName(); + } + }, + + _destroy: function() { + if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) { + this.destroyOnClear = true; + return; + } + this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); + this._removeHandleClassName(); + this._mouseDestroy(); + }, + + _mouseCapture: function(event) { + var o = this.options; + + this._blurActiveElement( event ); + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) { + return false; + } + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) { + return false; + } + + this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix ); + + return true; + + }, + + _blockFrames: function( selector ) { + this.iframeBlocks = this.document.find( selector ).map(function() { + var iframe = $( this ); + + return $( "
            " ) + .css( "position", "absolute" ) + .appendTo( iframe.parent() ) + .outerWidth( iframe.outerWidth() ) + .outerHeight( iframe.outerHeight() ) + .offset( iframe.offset() )[ 0 ]; + }); + }, + + _unblockFrames: function() { + if ( this.iframeBlocks ) { + this.iframeBlocks.remove(); + delete this.iframeBlocks; + } + }, + + _blurActiveElement: function( event ) { + var document = this.document[ 0 ]; + + // Only need to blur if the event occurred on the draggable itself, see #10527 + if ( !this.handleElement.is( event.target ) ) { + return; + } + + // support: IE9 + // IE9 throws an "Unspecified error" accessing document.activeElement from an