From 8ed4788d650524bc9354214b56c455bb0ddb22b7 Mon Sep 17 00:00:00 2001 From: REJack Date: Wed, 27 Jan 2021 08:12:15 +0100 Subject: [PATCH] update plugin files --- .../codemirror/addon/edit/closebrackets.js | 2 +- plugins/codemirror/addon/edit/continuelist.js | 2 +- .../codemirror/addon/edit/matchbrackets.js | 12 +- plugins/codemirror/addon/fold/brace-fold.js | 13 +- .../codemirror/addon/hint/javascript-hint.js | 2 +- plugins/codemirror/addon/hint/show-hint.js | 16 +- plugins/codemirror/addon/hint/sql-hint.js | 4 +- .../addon/search/match-highlighter.js | 2 +- plugins/codemirror/codemirror.js | 6 +- plugins/codemirror/keymap/vim.js | 8 +- plugins/codemirror/mode/asn.1/asn.1.js | 2 +- plugins/codemirror/mode/clike/clike.js | 10 +- plugins/codemirror/mode/css/css.js | 8 +- plugins/codemirror/mode/cypher/cypher.js | 4 +- plugins/codemirror/mode/dtd/dtd.js | 4 +- plugins/codemirror/mode/ebnf/ebnf.js | 14 +- plugins/codemirror/mode/factor/factor.js | 2 +- plugins/codemirror/mode/gas/gas.js | 4 +- plugins/codemirror/mode/haml/haml.js | 2 +- plugins/codemirror/mode/idl/idl.js | 2 +- .../codemirror/mode/javascript/javascript.js | 2 +- plugins/codemirror/mode/julia/julia.js | 22 +- plugins/codemirror/mode/markdown/markdown.js | 6 +- plugins/codemirror/mode/meta.js | 2 +- plugins/codemirror/mode/modelica/modelica.js | 6 +- plugins/codemirror/mode/mscgen/mscgen.js | 8 +- plugins/codemirror/mode/mumps/mumps.js | 2 +- plugins/codemirror/mode/oz/oz.js | 4 +- plugins/codemirror/mode/pegjs/pegjs.js | 6 +- plugins/codemirror/mode/perl/perl.js | 4 +- plugins/codemirror/mode/php/php.js | 4 +- plugins/codemirror/mode/pug/pug.js | 2 +- plugins/codemirror/mode/puppet/puppet.js | 2 +- plugins/codemirror/mode/rpm/rpm.js | 8 +- plugins/codemirror/mode/sass/sass.js | 2 +- plugins/codemirror/mode/scheme/scheme.js | 2 +- plugins/codemirror/mode/sieve/sieve.js | 2 +- plugins/codemirror/mode/soy/soy.js | 10 +- plugins/codemirror/mode/sql/sql.js | 10 +- plugins/codemirror/mode/stylus/stylus.js | 2 +- .../codemirror/mode/tiddlywiki/tiddlywiki.js | 2 +- plugins/codemirror/mode/vbscript/vbscript.js | 4 +- plugins/codemirror/mode/velocity/velocity.js | 2 +- plugins/codemirror/mode/verilog/verilog.js | 4 +- .../mode/yaml-frontmatter/yaml-frontmatter.js | 2 +- plugins/codemirror/mode/yaml/yaml.js | 8 +- .../css/searchBuilder.bootstrap4.css | 340 ++ .../css/searchBuilder.bootstrap4.min.css | 1 + .../js/dataTables.searchBuilder.js | 4376 +++++++++++++++++ .../js/dataTables.searchBuilder.min.js | 131 + .../js/searchBuilder.bootstrap4.js | 51 + .../js/searchBuilder.bootstrap4.min.js | 2 + plugins/sweetalert2/sweetalert2.all.js | 6 +- plugins/sweetalert2/sweetalert2.all.min.js | 2 +- plugins/sweetalert2/sweetalert2.js | 6 +- plugins/sweetalert2/sweetalert2.min.js | 2 +- plugins/uplot/uPlot.cjs.js | 150 +- plugins/uplot/uPlot.esm.js | 150 +- plugins/uplot/uPlot.iife.js | 158 +- plugins/uplot/uPlot.iife.min.js | 4 +- 60 files changed, 5228 insertions(+), 398 deletions(-) create mode 100644 plugins/datatables-searchbuilder/css/searchBuilder.bootstrap4.css create mode 100644 plugins/datatables-searchbuilder/css/searchBuilder.bootstrap4.min.css create mode 100644 plugins/datatables-searchbuilder/js/dataTables.searchBuilder.js create mode 100644 plugins/datatables-searchbuilder/js/dataTables.searchBuilder.min.js create mode 100644 plugins/datatables-searchbuilder/js/searchBuilder.bootstrap4.js create mode 100644 plugins/datatables-searchbuilder/js/searchBuilder.bootstrap4.min.js diff --git a/plugins/codemirror/addon/edit/closebrackets.js b/plugins/codemirror/addon/edit/closebrackets.js index 5c1aeab3c..593d4439f 100644 --- a/plugins/codemirror/addon/edit/closebrackets.js +++ b/plugins/codemirror/addon/edit/closebrackets.js @@ -102,7 +102,7 @@ for (var i = 0; i < ranges.length; i++) { var range = ranges[i] if (range.head == cm.getCursor()) primary = i - var pos = {line: range.head.line, ch: range.head.ch + dir} + var pos = range.head.ch || dir > 0 ? {line: range.head.line, ch: range.head.ch + dir} : {line: range.head.line - 1} newRanges.push({anchor: pos, head: pos}) } cm.setSelections(newRanges, primary) diff --git a/plugins/codemirror/addon/edit/continuelist.js b/plugins/codemirror/addon/edit/continuelist.js index 2e5625adc..6ec65010d 100644 --- a/plugins/codemirror/addon/edit/continuelist.js +++ b/plugins/codemirror/addon/edit/continuelist.js @@ -90,7 +90,7 @@ }); } else { if (startIndent.length > nextIndent.length) return; - // This doesn't run if the next line immediatley indents, as it is + // This doesn't run if the next line immediately indents, as it is // not clear of the users intention (new indented item or same level) if ((startIndent.length < nextIndent.length) && (lookAhead === 1)) return; skipCount += 1; diff --git a/plugins/codemirror/addon/edit/matchbrackets.js b/plugins/codemirror/addon/edit/matchbrackets.js index 037740880..43dc8840f 100644 --- a/plugins/codemirror/addon/edit/matchbrackets.js +++ b/plugins/codemirror/addon/edit/matchbrackets.js @@ -38,7 +38,7 @@ if (config && config.strict && (dir > 0) != (pos == where.ch)) return null; var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); - var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config); + var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config); if (found == null) return null; return {from: Pos(where.line, pos), to: found && found.pos, match: found && found.ch == match.charAt(0), forward: dir > 0}; @@ -67,7 +67,8 @@ if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); for (; pos != end; pos += dir) { var ch = line.charAt(pos); - if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) { + if (re.test(ch) && (style === undefined || + (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || "") == (style || ""))) { var match = matching[ch]; if (match && (match.charAt(1) == ">") == (dir > 0)) stack.push(ch); else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch}; @@ -80,11 +81,12 @@ function matchBrackets(cm, autoclear, config) { // Disable brace matching in long lines, since it'll cause hugely slow updates - var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000; + var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000, + highlightNonMatching = config && config.highlightNonMatching; var marks = [], ranges = cm.listSelections(); for (var i = 0; i < ranges.length; i++) { var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config); - if (match && cm.getLine(match.from.line).length <= maxHighlightLen) { + if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) { var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style})); if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) @@ -94,7 +96,7 @@ if (marks.length) { // Kludge to work around the IE bug from issue #1193, where text - // input stops going to the textare whever this fires. + // input stops going to the textarea whenever this fires. if (ie_lt8 && cm.state.focused) cm.focus(); var clear = function() { diff --git a/plugins/codemirror/addon/fold/brace-fold.js b/plugins/codemirror/addon/fold/brace-fold.js index 654d1fb69..79a331cf6 100644 --- a/plugins/codemirror/addon/fold/brace-fold.js +++ b/plugins/codemirror/addon/fold/brace-fold.js @@ -31,13 +31,16 @@ CodeMirror.registerHelper("fold", "brace", function(cm, start) { } } - var startToken = "{", endToken = "}", startCh = findOpening("{"); - if (startCh == null) { - startToken = "[", endToken = "]"; - startCh = findOpening("["); + var startBrace = findOpening("{"), startBracket = findOpening("[") + var startToken, endToken, startCh + if (startBrace != null && (startBracket == null || startBracket > startBrace)) { + startCh = startBrace; startToken = "{"; endToken = "}" + } else if (startBracket != null) { + startCh = startBracket; startToken = "["; endToken = "]" + } else { + return } - if (startCh == null) return; var count = 1, lastLine = cm.lastLine(), end, endCh; outer: for (var i = line; i <= lastLine; ++i) { var text = cm.getLine(i), pos = i == line ? startCh : 0; diff --git a/plugins/codemirror/addon/hint/javascript-hint.js b/plugins/codemirror/addon/hint/javascript-hint.js index 6d09e6b44..9f06b1b54 100644 --- a/plugins/codemirror/addon/hint/javascript-hint.js +++ b/plugins/codemirror/addon/hint/javascript-hint.js @@ -69,7 +69,7 @@ function getCoffeeScriptToken(editor, cur) { // This getToken, it is for coffeescript, imitates the behavior of // getTokenAt method in javascript.js, that is, returning "property" - // type and treat "." as indepenent token. + // type and treat "." as independent token. var token = editor.getTokenAt(cur); if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') { token.end = token.start; diff --git a/plugins/codemirror/addon/hint/show-hint.js b/plugins/codemirror/addon/hint/show-hint.js index 5ef1bba64..a9f2ded18 100644 --- a/plugins/codemirror/addon/hint/show-hint.js +++ b/plugins/codemirror/addon/hint/show-hint.js @@ -61,8 +61,10 @@ this.startPos = this.cm.getCursor("start"); this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length; - var self = this; - cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); }); + if (this.options.updateOnCursorActivity) { + var self = this; + cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); }); + } } var requestAnimationFrame = window.requestAnimationFrame || function(fn) { @@ -75,7 +77,9 @@ if (!this.active()) return; this.cm.state.completionActive = null; this.tick = null; - this.cm.off("cursorActivity", this.activityFunc); + if (this.options.updateOnCursorActivity) { + this.cm.off("cursorActivity", this.activityFunc); + } if (this.widget && this.data) CodeMirror.signal(this.data, "close"); if (this.widget) this.widget.close(); @@ -117,9 +121,7 @@ if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || pos.ch < identStart.ch || this.cm.somethingSelected() || (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) { - if (this.options.closeOnCursorActivity) { - this.close(); - } + this.close(); } else { var self = this; this.debounce = requestAnimationFrame(function() {self.update();}); @@ -492,9 +494,9 @@ completeSingle: true, alignWithWord: true, closeCharacters: /[\s()\[\]{};:>,]/, - closeOnCursorActivity: true, closeOnPick: true, closeOnUnfocus: true, + updateOnCursorActivity: true, completeOnSingleClick: true, container: null, customKeys: null, diff --git a/plugins/codemirror/addon/hint/sql-hint.js b/plugins/codemirror/addon/hint/sql-hint.js index 5b65e2910..efdce813c 100644 --- a/plugins/codemirror/addon/hint/sql-hint.js +++ b/plugins/codemirror/addon/hint/sql-hint.js @@ -97,7 +97,7 @@ if (name.charAt(0) == ".") { name = name.substr(1); } - // replace doublicated identifierQuotes with single identifierQuotes + // replace duplicated identifierQuotes with single identifierQuotes // and remove single identifierQuotes var nameParts = name.split(identifierQuote+identifierQuote); for (var i = 0; i < nameParts.length; i++) @@ -109,7 +109,7 @@ var nameParts = getText(name).split("."); for (var i = 0; i < nameParts.length; i++) nameParts[i] = identifierQuote + - // doublicate identifierQuotes + // duplicate identifierQuotes nameParts[i].replace(new RegExp(identifierQuote,"g"), identifierQuote+identifierQuote) + identifierQuote; var escaped = nameParts.join("."); diff --git a/plugins/codemirror/addon/search/match-highlighter.js b/plugins/codemirror/addon/search/match-highlighter.js index 3a4a7dedc..9b181ebc0 100644 --- a/plugins/codemirror/addon/search/match-highlighter.js +++ b/plugins/codemirror/addon/search/match-highlighter.js @@ -16,7 +16,7 @@ // highlighted only if the selected text is a word. showToken, when enabled, // will cause the current token to be highlighted when nothing is selected. // delay is used to specify how much time to wait, in milliseconds, before -// highlighting the matches. If annotateScrollbar is enabled, the occurences +// highlighting the matches. If annotateScrollbar is enabled, the occurrences // will be highlighted on the scrollbar via the matchesonscrollbar addon. (function(mod) { diff --git a/plugins/codemirror/codemirror.js b/plugins/codemirror/codemirror.js index 149b6fd98..9aa6da5df 100644 --- a/plugins/codemirror/codemirror.js +++ b/plugins/codemirror/codemirror.js @@ -5115,7 +5115,7 @@ (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - if (!(options && options.scroll === false) && doc.cm) + if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor") { ensureCursorVisible(doc.cm); } } @@ -8675,7 +8675,7 @@ function moveOnce(boundToLine) { var next; if (unit == "codepoint") { - var ch = lineObj.text.charCodeAt(pos.ch + (unit > 0 ? 0 : -1)); + var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1)); if (isNaN(ch)) { next = null; } else { @@ -9793,7 +9793,7 @@ addLegacyProps(CodeMirror); - CodeMirror.version = "5.59.1"; + CodeMirror.version = "5.59.2"; return CodeMirror; diff --git a/plugins/codemirror/keymap/vim.js b/plugins/codemirror/keymap/vim.js index 789e1e55b..92715e603 100644 --- a/plugins/codemirror/keymap/vim.js +++ b/plugins/codemirror/keymap/vim.js @@ -737,7 +737,7 @@ // TODO: Convert keymap into dictionary format for fast lookup. }, // Testing hook, though it might be useful to expose the register - // controller anyways. + // controller anyway. getRegisterController: function() { return vimGlobalState.registerController; }, @@ -3483,7 +3483,7 @@ }, isComplete: function(state) { if (state.nextCh === '#') { - var token = state.lineText.match(/#(\w+)/)[1]; + var token = state.lineText.match(/^#(\w+)/)[1]; if (token === 'endif') { if (state.forward && state.depth === 0) { return true; @@ -4322,7 +4322,7 @@ raw += ' ' + desc + ''; return raw; } - var searchPromptDesc = '(Javascript regexp)'; + var searchPromptDesc = '(JavaScript regexp)'; function showPrompt(cm, options) { var shortText = (options.prefix || '') + ' ' + (options.desc || ''); var prompt = makePrompt(options.prefix, options.desc); @@ -5234,7 +5234,7 @@ * @param {Cursor} lineEnd Line to stop replacing at. * @param {RegExp} query Query for performing matches with. * @param {string} replaceWith Text to replace matches with. May contain $1, - * $2, etc for replacing captured groups using Javascript replace. + * $2, etc for replacing captured groups using JavaScript replace. * @param {function()} callback A callback for when the replace is done. */ function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, diff --git a/plugins/codemirror/mode/asn.1/asn.1.js b/plugins/codemirror/mode/asn.1/asn.1.js index d3ecb0878..df1330b68 100644 --- a/plugins/codemirror/mode/asn.1/asn.1.js +++ b/plugins/codemirror/mode/asn.1/asn.1.js @@ -190,7 +190,7 @@ " NetworkAddress BITS BMPString TimeStamp TimeTicks" + " TruthValue RowStatus DisplayString GeneralString" + " GraphicString IA5String NumericString" + - " PrintableString SnmpAdminAtring TeletexString" + + " PrintableString SnmpAdminString TeletexString" + " UTF8String VideotexString VisibleString StringStore" + " ISO646String T61String UniversalString Unsigned32" + " Integer32 Gauge Gauge32 Counter Counter32 Counter64"), diff --git a/plugins/codemirror/mode/clike/clike.js b/plugins/codemirror/mode/clike/clike.js index 2154f1d2d..05b8f77f1 100644 --- a/plugins/codemirror/mode/clike/clike.js +++ b/plugins/codemirror/mode/clike/clike.js @@ -350,8 +350,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { function cpp11StringHook(stream, state) { stream.backUp(1); // Raw strings. - if (stream.match(/(R|u8R|uR|UR|LR)/)) { - var match = stream.match(/"([^\s\\()]{0,16})\(/); + if (stream.match(/^(?:R|u8R|uR|UR|LR)/)) { + var match = stream.match(/^"([^\s\\()]{0,16})\(/); if (!match) { return false; } @@ -360,8 +360,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { return tokenRawString(stream, state); } // Unicode strings/chars. - if (stream.match(/(u8|u|U|L)/)) { - if (stream.match(/["']/, /* eat */ false)) { + if (stream.match(/^(?:u8|u|U|L)/)) { + if (stream.match(/^["']/, /* eat */ false)) { return "string"; } return false; @@ -749,7 +749,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " + "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " + "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " + - "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " + + "gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose " + "gl_ProjectionMatrixInverseTranspose " + "gl_ModelViewProjectionMatrixInverseTranspose " + "gl_TextureMatrixInverseTranspose " + diff --git a/plugins/codemirror/mode/css/css.js b/plugins/codemirror/mode/css/css.js index 240c270a9..88a869bfe 100644 --- a/plugins/codemirror/mode/css/css.js +++ b/plugins/codemirror/mode/css/css.js @@ -78,8 +78,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) { return ret("qualifier", "qualifier"); } else if (/[:;{}\[\]\(\)]/.test(ch)) { return ret(null, ch); - } else if (stream.match(/[\w-.]+(?=\()/)) { - if (/^(url(-prefix)?|domain|regexp)$/.test(stream.current().toLowerCase())) { + } else if (stream.match(/^[\w-.]+(?=\()/)) { + if (/^(url(-prefix)?|domain|regexp)$/i.test(stream.current())) { state.tokenize = tokenParenthesized; } return ret("variable callee", "variable"); @@ -108,7 +108,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { function tokenParenthesized(stream, state) { stream.next(); // Must be '(' - if (!stream.match(/\s*[\"\')]/, false)) + if (!stream.match(/^\s*[\"\')]/, false)) state.tokenize = tokenString(")"); else state.tokenize = null; @@ -781,7 +781,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { } }, ":": function(stream) { - if (stream.match(/\s*\{/, false)) + if (stream.match(/^\s*\{/, false)) return [null, null] return false; }, diff --git a/plugins/codemirror/mode/cypher/cypher.js b/plugins/codemirror/mode/cypher/cypher.js index aa76eb9e3..6d88fa0ed 100644 --- a/plugins/codemirror/mode/cypher/cypher.js +++ b/plugins/codemirror/mode/cypher/cypher.js @@ -21,11 +21,11 @@ var tokenBase = function(stream/*, state*/) { var ch = stream.next(); if (ch ==='"') { - stream.match(/.*?"/); + stream.match(/^[^"]*"/); return "string"; } if (ch === "'") { - stream.match(/.*?'/); + stream.match(/^[^']*'/); return "string"; } if (/[{}\(\),\.;\[\]]/.test(ch)) { diff --git a/plugins/codemirror/mode/dtd/dtd.js b/plugins/codemirror/mode/dtd/dtd.js index 74b8c6bde..1bff91cba 100644 --- a/plugins/codemirror/mode/dtd/dtd.js +++ b/plugins/codemirror/mode/dtd/dtd.js @@ -34,7 +34,7 @@ CodeMirror.defineMode("dtd", function(config) { state.tokenize = inBlock("meta", "?>"); return ret("meta", ch); } else if (ch == "#" && stream.eatWhile(/[\w]/)) return ret("atom", "tag"); - else if (ch == "|") return ret("keyword", "seperator"); + else if (ch == "|") return ret("keyword", "separator"); else if (ch.match(/[\(\)\[\]\-\.,\+\?>]/)) return ret(null, ch);//if(ch === ">") return ret(null, "endtag"); else else if (ch.match(/[\[\]]/)) return ret("rule", ch); else if (ch == "\"" || ch == "'") { @@ -112,7 +112,7 @@ CodeMirror.defineMode("dtd", function(config) { indent: function(state, textAfter) { var n = state.stack.length; - if( textAfter.match(/\]\s+|\]/) )n=n-1; + if( textAfter.charAt(0) === ']' )n--; else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){ if(textAfter.substr(0,1) === "<") {} else if( type == "doindent" && textAfter.length > 1 ) {} diff --git a/plugins/codemirror/mode/ebnf/ebnf.js b/plugins/codemirror/mode/ebnf/ebnf.js index 238bbe23b..d8fb3f3a2 100644 --- a/plugins/codemirror/mode/ebnf/ebnf.js +++ b/plugins/codemirror/mode/ebnf/ebnf.js @@ -41,10 +41,10 @@ state.stringType = stream.peek(); stream.next(); // Skip quote state.stack.unshift(stateType._string); - } else if (stream.match(/^\/\*/)) { //comments starting with /* + } else if (stream.match('/*')) { //comments starting with /* state.stack.unshift(stateType.comment); state.commentType = commentType.slash; - } else if (stream.match(/^\(\*/)) { //comments starting with (* + } else if (stream.match('(*')) { //comments starting with (* state.stack.unshift(stateType.comment); state.commentType = commentType.parenthesis; } @@ -69,10 +69,10 @@ case stateType.comment: while (state.stack[0] === stateType.comment && !stream.eol()) { - if (state.commentType === commentType.slash && stream.match(/\*\//)) { + if (state.commentType === commentType.slash && stream.match('*/')) { state.stack.shift(); // Clear flag state.commentType = null; - } else if (state.commentType === commentType.parenthesis && stream.match(/\*\)/)) { + } else if (state.commentType === commentType.parenthesis && stream.match('*)')) { state.stack.shift(); // Clear flag state.commentType = null; } else { @@ -83,7 +83,7 @@ case stateType.characterClass: while (state.stack[0] === stateType.characterClass && !stream.eol()) { - if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { + if (!(stream.match(/^[^\]\\]+/) || stream.match('.'))) { state.stack.shift(); } } @@ -168,10 +168,10 @@ } } - if (stream.match(/^\/\//)) { + if (stream.match('//')) { stream.skipToEnd(); return "comment"; - } else if (stream.match(/return/)) { + } else if (stream.match('return')) { return "operator"; } else if (stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)) { if (stream.match(/(?=[\(.])/)) { diff --git a/plugins/codemirror/mode/factor/factor.js b/plugins/codemirror/mode/factor/factor.js index 7108278cc..4c876d4d2 100644 --- a/plugins/codemirror/mode/factor/factor.js +++ b/plugins/codemirror/mode/factor/factor.js @@ -16,7 +16,7 @@ "use strict"; CodeMirror.defineSimpleMode("factor", { - // The start state contains the rules that are intially used + // The start state contains the rules that are initially used start: [ // comments {regex: /#?!.*/, token: "comment"}, diff --git a/plugins/codemirror/mode/gas/gas.js b/plugins/codemirror/mode/gas/gas.js index e34d7a7b6..b3515abe7 100644 --- a/plugins/codemirror/mode/gas/gas.js +++ b/plugins/codemirror/mode/gas/gas.js @@ -302,11 +302,11 @@ CodeMirror.defineMode("gas", function(_config, parserConfig) { } if (ch === '{') { - return "braket"; + return "bracket"; } if (ch === '}') { - return "braket"; + return "bracket"; } if (/\d/.test(ch)) { diff --git a/plugins/codemirror/mode/haml/haml.js b/plugins/codemirror/mode/haml/haml.js index 3c8f505eb..d941d9743 100644 --- a/plugins/codemirror/mode/haml/haml.js +++ b/plugins/codemirror/mode/haml/haml.js @@ -72,7 +72,7 @@ } } - // donot handle --> as valid ruby, make it HTML close comment instead + // do not handle --> as valid ruby, make it HTML close comment instead if (state.startOfLine && !stream.match("-->", false) && (ch == "=" || ch == "-" )) { state.tokenize = ruby; return state.tokenize(stream, state); diff --git a/plugins/codemirror/mode/idl/idl.js b/plugins/codemirror/mode/idl/idl.js index 168761cd8..37302bb90 100644 --- a/plugins/codemirror/mode/idl/idl.js +++ b/plugins/codemirror/mode/idl/idl.js @@ -62,7 +62,7 @@ 'empty', 'enable_sysrtn', 'eof', 'eos', 'erase', 'erf', 'erfc', 'erfcx', 'erode', 'errorplot', 'errplot', 'estimator_filter', 'execute', 'exit', 'exp', - 'expand', 'expand_path', 'expint', 'extrac', 'extract_slice', + 'expand', 'expand_path', 'expint', 'extract', 'extract_slice', 'f_cvf', 'f_pdf', 'factorial', 'fft', 'file_basename', 'file_chmod', 'file_copy', 'file_delete', 'file_dirname', 'file_expand_path', 'file_gunzip', 'file_gzip', 'file_info', diff --git a/plugins/codemirror/mode/javascript/javascript.js b/plugins/codemirror/mode/javascript/javascript.js index 966ffef06..047395622 100644 --- a/plugins/codemirror/mode/javascript/javascript.js +++ b/plugins/codemirror/mode/javascript/javascript.js @@ -624,7 +624,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "=>") return cont(typeexpr) } function typeprops(type) { - if (type == "}") return cont() + if (type.match(/[\}\)\]]/)) return cont() if (type == "," || type == ";") return cont(typeprops) return pass(typeprop, typeprops) } diff --git a/plugins/codemirror/mode/julia/julia.js b/plugins/codemirror/mode/julia/julia.js index 394249204..bff5413b8 100644 --- a/plugins/codemirror/mode/julia/julia.js +++ b/plugins/codemirror/mode/julia/julia.js @@ -80,7 +80,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) { // tokenizers function tokenBase(stream, state) { // Handle multiline comments - if (stream.match(/^#=/, false)) { + if (stream.match('#=', false)) { state.tokenize = tokenComment; return state.tokenize(stream, state); } @@ -141,10 +141,10 @@ CodeMirror.defineMode("julia", function(config, parserConf) { } if (inArray(state)) { - if (state.lastToken == "end" && stream.match(/^:/)) { + if (state.lastToken == "end" && stream.match(':')) { return "operator"; } - if (stream.match(/^end/)) { + if (stream.match('end')) { return "number"; } } @@ -201,7 +201,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) { } // Handle Chars - if (stream.match(/^'/)) { + if (stream.match('\'')) { state.tokenize = tokenChar; return state.tokenize(stream, state); } @@ -263,7 +263,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) { state.scopes.push('('); charsAdvanced += match[1].length; } - if (currentScope(state) == '(' && stream.match(/^\)/)) { + if (currentScope(state) == '(' && stream.match(')')) { state.scopes.pop(); charsAdvanced += 1; if (state.scopes.length <= state.firstParenPos) { @@ -295,10 +295,10 @@ CodeMirror.defineMode("julia", function(config, parserConf) { } function tokenAnnotation(stream, state) { - stream.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/); - if (stream.match(/^{/)) { + stream.match(/.*?(?=[,;{}()=\s]|$)/); + if (stream.match('{')) { state.nestedParameters++; - } else if (stream.match(/^}/) && state.nestedParameters > 0) { + } else if (stream.match('}') && state.nestedParameters > 0) { state.nestedParameters--; } if (state.nestedParameters > 0) { @@ -310,13 +310,13 @@ CodeMirror.defineMode("julia", function(config, parserConf) { } function tokenComment(stream, state) { - if (stream.match(/^#=/)) { + if (stream.match('#=')) { state.nestedComments++; } if (!stream.match(/.*?(?=(#=|=#))/)) { stream.skipToEnd(); } - if (stream.match(/^=#/)) { + if (stream.match('=#')) { state.nestedComments--; if (state.nestedComments == 0) state.tokenize = tokenBase; @@ -347,7 +347,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) { return "string"; } if (!stream.match(/^[^']+(?=')/)) { stream.skipToEnd(); } - if (stream.match(/^'/)) { state.tokenize = tokenBase; } + if (stream.match('\'')) { state.tokenize = tokenBase; } return "error"; } diff --git a/plugins/codemirror/mode/markdown/markdown.js b/plugins/codemirror/mode/markdown/markdown.js index 287f39b55..e730fc1ae 100644 --- a/plugins/codemirror/mode/markdown/markdown.js +++ b/plugins/codemirror/mode/markdown/markdown.js @@ -223,7 +223,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { // Add this list item's content's indentation to the stack state.listStack.push(state.indentation); - // Reset inline styles which shouldn't propagate aross list items + // Reset inline styles which shouldn't propagate across list items state.em = false; state.strong = false; state.code = false; @@ -612,7 +612,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return getType(state); } } else if (ch === ' ') { - if (stream.match(/^~~/, true)) { // Probably surrounded by space + if (stream.match('~~', true)) { // Probably surrounded by space if (stream.peek() === ' ') { // Surrounded by spaces, ignore return getType(state); } else { // Not surrounded by spaces, back up pointer @@ -711,7 +711,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } function footnoteLinkInside(stream, state) { - if (stream.match(/^\]:/, true)) { + if (stream.match(']:', true)) { state.f = state.inline = footnoteUrl; if (modeCfg.highlightFormatting) state.formatting = "link"; var returnType = getType(state); diff --git a/plugins/codemirror/mode/meta.js b/plugins/codemirror/mode/meta.js index c7738a514..92b68074c 100644 --- a/plugins/codemirror/mode/meta.js +++ b/plugins/codemirror/mode/meta.js @@ -44,7 +44,7 @@ {name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]}, {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]}, {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]}, - {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, + {name: "Embedded JavaScript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]}, {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]}, {name: "Esper", mime: "text/x-esper", mode: "sql"}, diff --git a/plugins/codemirror/mode/modelica/modelica.js b/plugins/codemirror/mode/modelica/modelica.js index a83a4135d..2e9622f03 100644 --- a/plugins/codemirror/mode/modelica/modelica.js +++ b/plugins/codemirror/mode/modelica/modelica.js @@ -90,7 +90,7 @@ return "error"; } - function tokenUnsignedNuber(stream, state) { + function tokenUnsignedNumber(stream, state) { stream.eatWhile(isDigit); if (stream.eat('.')) { stream.eatWhile(isDigit); @@ -164,9 +164,9 @@ else if(ch == '"') { state.tokenize = tokenString; } - // UNSIGNED_NUBER + // UNSIGNED_NUMBER else if(isDigit.test(ch)) { - state.tokenize = tokenUnsignedNuber; + state.tokenize = tokenUnsignedNumber; } // ERROR else { diff --git a/plugins/codemirror/mode/mscgen/mscgen.js b/plugins/codemirror/mode/mscgen/mscgen.js index 6f4f9cd8f..8d39341cf 100644 --- a/plugins/codemirror/mode/mscgen/mscgen.js +++ b/plugins/codemirror/mode/mscgen/mscgen.js @@ -72,11 +72,11 @@ CodeMirror.defineMIME("text/x-msgenny", {name: "mscgen", language: "msgenny"}); function wordRegexpBoundary(pWords) { - return new RegExp("\\b(" + pWords.join("|") + ")\\b", "i"); + return new RegExp("^\\b(?:" + pWords.join("|") + ")\\b", "i"); } function wordRegexp(pWords) { - return new RegExp("(" + pWords.join("|") + ")", "i"); + return new RegExp("^(?:" + pWords.join("|") + ")", "i"); } function startStateFn() { @@ -153,7 +153,7 @@ return "variable"; /* attribute lists */ - if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match(/\[/, true, true)) { + if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match('[', true, true)) { pConfig.inAttributeList = true; return "bracket"; } @@ -161,7 +161,7 @@ if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) { return "attribute"; } - if (pStream.match(/]/, true, true)) { + if (pStream.match(']', true, true)) { pConfig.inAttributeList = false; return "bracket"; } diff --git a/plugins/codemirror/mode/mumps/mumps.js b/plugins/codemirror/mode/mumps/mumps.js index 3671c9cb3..c53b4bf3a 100644 --- a/plugins/codemirror/mode/mumps/mumps.js +++ b/plugins/codemirror/mode/mumps/mumps.js @@ -26,7 +26,7 @@ var brackets = new RegExp("[()]"); var identifiers = new RegExp("^[%A-Za-z][A-Za-z0-9]*"); var commandKeywords = ["break","close","do","else","for","goto", "halt", "hang", "if", "job","kill","lock","merge","new","open", "quit", "read", "set", "tcommit", "trollback", "tstart", "use", "view", "write", "xecute", "b","c","d","e","f","g", "h", "i", "j","k","l","m","n","o", "q", "r", "s", "tc", "tro", "ts", "u", "v", "w", "x"]; - // The following list includes instrinsic functions _and_ special variables + // The following list includes intrinsic functions _and_ special variables var intrinsicFuncsWords = ["\\$ascii", "\\$char", "\\$data", "\\$ecode", "\\$estack", "\\$etrap", "\\$extract", "\\$find", "\\$fnumber", "\\$get", "\\$horolog", "\\$io", "\\$increment", "\\$job", "\\$justify", "\\$length", "\\$name", "\\$next", "\\$order", "\\$piece", "\\$qlength", "\\$qsubscript", "\\$query", "\\$quit", "\\$random", "\\$reverse", "\\$select", "\\$stack", "\\$test", "\\$text", "\\$translate", "\\$view", "\\$x", "\\$y", "\\$a", "\\$c", "\\$d", "\\$e", "\\$ec", "\\$es", "\\$et", "\\$f", "\\$fn", "\\$g", "\\$h", "\\$i", "\\$j", "\\$l", "\\$n", "\\$na", "\\$o", "\\$p", "\\$q", "\\$ql", "\\$qs", "\\$r", "\\$re", "\\$s", "\\$st", "\\$t", "\\$tr", "\\$v", "\\$z"]; var intrinsicFuncs = wordRegexp(intrinsicFuncsWords); var command = wordRegexp(commandKeywords); diff --git a/plugins/codemirror/mode/oz/oz.js b/plugins/codemirror/mode/oz/oz.js index a9738495b..73857e4c7 100644 --- a/plugins/codemirror/mode/oz/oz.js +++ b/plugins/codemirror/mode/oz/oz.js @@ -45,7 +45,7 @@ CodeMirror.defineMode("oz", function (conf) { } // Special [] keyword - if (stream.match(/(\[])/)) { + if (stream.match('[]')) { return "keyword" } @@ -130,7 +130,7 @@ CodeMirror.defineMode("oz", function (conf) { return "operator"; } - // If nothing match, we skip the entire alphanumerical block + // If nothing match, we skip the entire alphanumeric block stream.eatWhile(/\w/); return "variable"; diff --git a/plugins/codemirror/mode/pegjs/pegjs.js b/plugins/codemirror/mode/pegjs/pegjs.js index 19d5fa4c0..ac011d3c8 100644 --- a/plugins/codemirror/mode/pegjs/pegjs.js +++ b/plugins/codemirror/mode/pegjs/pegjs.js @@ -39,7 +39,7 @@ CodeMirror.defineMode("pegjs", function (config) { stream.next(); // Skip quote state.inString = true; // Update state } - if (!state.inString && !state.inComment && stream.match(/^\/\*/)) { + if (!state.inString && !state.inComment && stream.match('/*')) { state.inComment = true; } @@ -59,7 +59,7 @@ CodeMirror.defineMode("pegjs", function (config) { return state.lhs ? "property string" : "string"; // Token style } else if (state.inComment) { while (state.inComment && !stream.eol()) { - if (stream.match(/\*\//)) { + if (stream.match('*/')) { state.inComment = false; // Clear flag } else { stream.match(/^.[^\*]*/); @@ -76,7 +76,7 @@ CodeMirror.defineMode("pegjs", function (config) { stream.next(); state.inCharacterClass = true; return 'bracket'; - } else if (stream.match(/^\/\//)) { + } else if (stream.match('//')) { stream.skipToEnd(); return "comment"; } else if (state.braced || stream.peek() === '{') { diff --git a/plugins/codemirror/mode/perl/perl.js b/plugins/codemirror/mode/perl/perl.js index 220b0a699..ffe7877af 100644 --- a/plugins/codemirror/mode/perl/perl.js +++ b/plugins/codemirror/mode/perl/perl.js @@ -347,7 +347,7 @@ CodeMirror.defineMode("perl",function(){ lc :1, // - return lower-case version of a string lcfirst :1, // - return a string with just the next letter in lower case length :1, // - return the number of bytes in a string - 'link' :1, // - create a hard link in the filesytem + 'link' :1, // - create a hard link in the filesystem listen :1, // - register your socket as a server local : 2, // - create a temporary value for a global variable (dynamic scoping) localtime :1, // - convert UNIX time into record or string using local time @@ -441,7 +441,7 @@ CodeMirror.defineMode("perl",function(){ state :1, // - declare and assign a state variable (persistent lexical scoping) study :1, // - optimize input data for repeated searches 'sub' :1, // - declare a subroutine, possibly anonymously - 'substr' :1, // - get or alter a portion of a stirng + 'substr' :1, // - get or alter a portion of a string symlink :1, // - create a symbolic link to a file syscall :1, // - execute an arbitrary system call sysopen :1, // - open a file, pipe, or descriptor diff --git a/plugins/codemirror/mode/php/php.js b/plugins/codemirror/mode/php/php.js index 5f3a14399..3202f5072 100644 --- a/plugins/codemirror/mode/php/php.js +++ b/plugins/codemirror/mode/php/php.js @@ -53,7 +53,7 @@ [["]", null]] ], closing, escapes); } - if (stream.match(/\-\>\w/, false)) { + if (stream.match(/^->\w/, false)) { // Match object operator state.tokenize = matchSequence([ [["->", null]], @@ -106,7 +106,7 @@ }, "<": function(stream, state) { var before; - if (before = stream.match(/<<\s*/)) { + if (before = stream.match(/^<<\s*/)) { var quoted = stream.eat(/['"]/); stream.eatWhile(/[\w\.]/); var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1)); diff --git a/plugins/codemirror/mode/pug/pug.js b/plugins/codemirror/mode/pug/pug.js index a4c0e16b8..73e9ae2fc 100644 --- a/plugins/codemirror/mode/pug/pug.js +++ b/plugins/codemirror/mode/pug/pug.js @@ -261,7 +261,7 @@ CodeMirror.defineMode("pug", function (config) { } return 'variable'; } - if (stream.match(/^\+#{/, false)) { + if (stream.match('+#{', false)) { stream.next(); state.mixinCallAfter = true; return interpolation(stream, state); diff --git a/plugins/codemirror/mode/puppet/puppet.js b/plugins/codemirror/mode/puppet/puppet.js index 364934209..a92ca1107 100644 --- a/plugins/codemirror/mode/puppet/puppet.js +++ b/plugins/codemirror/mode/puppet/puppet.js @@ -176,7 +176,7 @@ CodeMirror.defineMode("puppet", function () { // Match characters that we are going to assume // are trying to be regex if (ch == '/') { - stream.match(/.*?\//); + stream.match(/^[^\/]*\//); return 'variable-3'; } // Match all the numbers diff --git a/plugins/codemirror/mode/rpm/rpm.js b/plugins/codemirror/mode/rpm/rpm.js index 2dece2eab..bb9ec9ffa 100644 --- a/plugins/codemirror/mode/rpm/rpm.js +++ b/plugins/codemirror/mode/rpm/rpm.js @@ -12,14 +12,14 @@ "use strict"; CodeMirror.defineMode("rpm-changes", function() { - var headerSeperator = /^-+$/; + var headerSeparator = /^-+$/; var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; var simpleEmail = /^[\w+.-]+@[\w.-]+/; return { token: function(stream) { if (stream.sol()) { - if (stream.match(headerSeperator)) { return 'tag'; } + if (stream.match(headerSeparator)) { return 'tag'; } if (stream.match(headerLine)) { return 'tag'; } } if (stream.match(simpleEmail)) { return 'string'; } @@ -80,12 +80,12 @@ CodeMirror.defineMode("rpm-spec", function() { // Macros like '%make_install' or '%attr(0775,root,root)' if (stream.match(/^%[\w]+/)) { - if (stream.match(/^\(/)) { state.macroParameters = true; } + if (stream.match('(')) { state.macroParameters = true; } return "keyword"; } if (state.macroParameters) { if (stream.match(/^\d+/)) { return "number";} - if (stream.match(/^\)/)) { + if (stream.match(')')) { state.macroParameters = false; return "keyword"; } diff --git a/plugins/codemirror/mode/sass/sass.js b/plugins/codemirror/mode/sass/sass.js index c37ab0b28..1258e142c 100644 --- a/plugins/codemirror/mode/sass/sass.js +++ b/plugins/codemirror/mode/sass/sass.js @@ -231,7 +231,7 @@ CodeMirror.defineMode("sass", function(config) { } if(ch === "@"){ - if(stream.match(/@extend/)){ + if(stream.match('@extend')){ if(!stream.match(/\s*[\w]/)) dedent(state); } diff --git a/plugins/codemirror/mode/scheme/scheme.js b/plugins/codemirror/mode/scheme/scheme.js index efac89078..370250d85 100644 --- a/plugins/codemirror/mode/scheme/scheme.js +++ b/plugins/codemirror/mode/scheme/scheme.js @@ -170,7 +170,7 @@ CodeMirror.defineMode("scheme", function () { } else if (stream.match(/^[-+0-9.]/, false)) { hasRadix = false; numTest = isDecimalNumber; - // re-consume the intial # if all matches failed + // re-consume the initial # if all matches failed } else if (!hasExactness) { stream.eat('#'); } diff --git a/plugins/codemirror/mode/sieve/sieve.js b/plugins/codemirror/mode/sieve/sieve.js index f02a867e7..b7236401a 100644 --- a/plugins/codemirror/mode/sieve/sieve.js +++ b/plugins/codemirror/mode/sieve/sieve.js @@ -43,7 +43,7 @@ CodeMirror.defineMode("sieve", function(config) { if (ch == "(") { state._indent.push("("); // add virtual angel wings so that editor behaves... - // ...more sane incase of broken brackets + // ...more sane in case of broken brackets state._indent.push("{"); return null; } diff --git a/plugins/codemirror/mode/soy/soy.js b/plugins/codemirror/mode/soy/soy.js index e3427ebe3..1f8a13c47 100644 --- a/plugins/codemirror/mode/soy/soy.js +++ b/plugins/codemirror/mode/soy/soy.js @@ -411,7 +411,7 @@ return null; case "list-literal": - if (stream.match(/\]/)) { + if (stream.match(']')) { state.soyState.pop(); state.lookupVariables = true; popcontext(state); @@ -517,14 +517,14 @@ } return expression(stream, state); case "literal": - if (stream.match(/^(?=\{\/literal})/)) { + if (stream.match('{/literal}', false)) { state.soyState.pop(); return this.token(stream, state); } return tokenUntil(stream, state, /\{\/literal}/); } - if (stream.match(/^\{literal}/)) { + if (stream.match('{literal}')) { state.indent += config.indentUnit; state.soyState.push("literal"); state.context = new Context(state.context, "literal", state.variables); @@ -581,12 +581,12 @@ state.soyState.push("import"); state.indent += 2 * config.indentUnit; return "keyword"; - } else if (match = stream.match(/^<\{/)) { + } else if (match = stream.match('<{')) { state.soyState.push("template-call-expression"); state.indent += 2 * config.indentUnit; state.soyState.push("tag"); return "keyword"; - } else if (match = stream.match(/^<\/>/)) { + } else if (match = stream.match('')) { state.indent -= 1 * config.indentUnit; return "keyword"; } diff --git a/plugins/codemirror/mode/sql/sql.js b/plugins/codemirror/mode/sql/sql.js index 4127cd9a0..ead4d6db2 100644 --- a/plugins/codemirror/mode/sql/sql.js +++ b/plugins/codemirror/mode/sql/sql.js @@ -243,9 +243,9 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { // varName can be quoted with ` or ' or " // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html if (stream.eat("@")) { - stream.match(/^session\./); - stream.match(/^local\./); - stream.match(/^global\./); + stream.match('session.'); + stream.match('local.'); + stream.match('global.'); } if (stream.eat("'")) { @@ -370,7 +370,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { "$": hookVar, // The preferred way to escape Identifiers is using double quotes, ref: http://sqlite.org/lang_keywords.html "\"": hookIdentifierDoublequote, - // there is also support for backtics, ref: http://sqlite.org/lang_keywords.html + // there is also support for backticks, ref: http://sqlite.org/lang_keywords.html "`": hookIdentifier } }); @@ -451,7 +451,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { // Spark SQL CodeMirror.defineMIME("text/x-sparksql", { name: "sql", - keywords: set("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"), + keywords: set("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases data dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"), builtin: set("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"), atoms: set("false true null"), operatorChars: /^[*\/+\-%<>!=~&|^]/, diff --git a/plugins/codemirror/mode/stylus/stylus.js b/plugins/codemirror/mode/stylus/stylus.js index eecc554bc..5cddff032 100644 --- a/plugins/codemirror/mode/stylus/stylus.js +++ b/plugins/codemirror/mode/stylus/stylus.js @@ -138,7 +138,7 @@ // Variable if (stream.match(/^(\.|\[)[\w-\'\"\]]+/i, false)) { if (!wordIsTag(stream.current())) { - stream.match(/\./); + stream.match('.'); return ["variable-2", "variable-name"]; } } diff --git a/plugins/codemirror/mode/tiddlywiki/tiddlywiki.js b/plugins/codemirror/mode/tiddlywiki/tiddlywiki.js index a4fb89f65..6a9ce447b 100644 --- a/plugins/codemirror/mode/tiddlywiki/tiddlywiki.js +++ b/plugins/codemirror/mode/tiddlywiki/tiddlywiki.js @@ -114,7 +114,7 @@ CodeMirror.defineMode("tiddlywiki", function () { return 'header'; } - if (ch == '{' && stream.match(/\{\{/)) + if (ch == '{' && stream.match('{{')) return chain(stream, state, twTokenCode); // rudimentary html:// file:// link matching. TW knows much more ... diff --git a/plugins/codemirror/mode/vbscript/vbscript.js b/plugins/codemirror/mode/vbscript/vbscript.js index 0670c0cee..403394813 100644 --- a/plugins/codemirror/mode/vbscript/vbscript.js +++ b/plugins/codemirror/mode/vbscript/vbscript.js @@ -32,7 +32,7 @@ CodeMirror.defineMode("vbscript", function(conf, parserConf) { var singleOperators = new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"); var doubleOperators = new RegExp("^((<>)|(<=)|(>=))"); var singleDelimiters = new RegExp('^[\\.,]'); - var brakets = new RegExp('^[\\(\\)]'); + var brackets = new RegExp('^[\\(\\)]'); var identifiers = new RegExp("^[A-Za-z][_A-Za-z0-9]*"); var openingKeywords = ['class','sub','select','while','if','function', 'property', 'with', 'for']; @@ -183,7 +183,7 @@ CodeMirror.defineMode("vbscript", function(conf, parserConf) { return null; } - if (stream.match(brakets)) { + if (stream.match(brackets)) { return "bracket"; } diff --git a/plugins/codemirror/mode/velocity/velocity.js b/plugins/codemirror/mode/velocity/velocity.js index 56caa671b..1d17c84eb 100644 --- a/plugins/codemirror/mode/velocity/velocity.js +++ b/plugins/codemirror/mode/velocity/velocity.js @@ -48,7 +48,7 @@ CodeMirror.defineMode("velocity", function() { else if (state.inParams) return chain(stream, state, tokenString(ch)); } - // is it one of the special signs []{}().,;? Seperator? + // is it one of the special signs []{}().,;? Separator? else if (/[\[\]{}\(\),;\.]/.test(ch)) { if (ch == "(" && beforeParams) state.inParams = true; diff --git a/plugins/codemirror/mode/verilog/verilog.js b/plugins/codemirror/mode/verilog/verilog.js index 89fe9c1ac..6c799f298 100644 --- a/plugins/codemirror/mode/verilog/verilog.js +++ b/plugins/codemirror/mode/verilog/verilog.js @@ -542,7 +542,7 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { }; var tlvIndentUnit = 3; var tlvTrackStatements = false; - var tlvIdentMatch = /^([~!@#\$%\^&\*-\+=\?\/\\\|'"<>]+)([\d\w_]*)/; // Matches an identifiere. + var tlvIdentMatch = /^([~!@#\$%\^&\*-\+=\?\/\\\|'"<>]+)([\d\w_]*)/; // Matches an identifier. // Note that ':' is excluded, because of it's use in [:]. var tlvFirstLevelIndentMatch = /^[! ] /; var tlvLineIndentationMatch = /^[! ] */; @@ -719,7 +719,7 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { } else { // Just swallow one character and try again. // This enables subsequent identifier match with preceding symbol character, which - // is legal within a statement. (Eg, !$reset). It also enables detection of + // is legal within a statement. (E.g., !$reset). It also enables detection of // comment start with preceding symbols. stream.backUp(stream.current().length - 1); style = "tlv-default"; diff --git a/plugins/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js b/plugins/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js index 87fdf80d0..f9050ad6a 100644 --- a/plugins/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +++ b/plugins/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js @@ -36,7 +36,7 @@ }, token: function (stream, state) { if (state.state == START) { - if (stream.match(/---/, false)) { + if (stream.match('---', false)) { state.state = FRONTMATTER return yamlMode.token(stream, state.inner) } else { diff --git a/plugins/codemirror/mode/yaml/yaml.js b/plugins/codemirror/mode/yaml/yaml.js index a29d7ea4a..d46494102 100644 --- a/plugins/codemirror/mode/yaml/yaml.js +++ b/plugins/codemirror/mode/yaml/yaml.js @@ -38,9 +38,9 @@ CodeMirror.defineMode("yaml", function() { state.pair = false; state.pairStart = false; /* document start */ - if(stream.match(/---/)) { return "def"; } + if(stream.match('---')) { return "def"; } /* document end */ - if (stream.match(/\.\.\./)) { return "def"; } + if (stream.match('...')) { return "def"; } /* array list item */ if (stream.match(/\s*-\s+/)) { return 'meta'; } } @@ -57,12 +57,12 @@ CodeMirror.defineMode("yaml", function() { return 'meta'; } - /* list seperator */ + /* list separator */ if (state.inlineList > 0 && !esc && ch == ',') { stream.next(); return 'meta'; } - /* pairs seperator */ + /* pairs separator */ if (state.inlinePairs > 0 && !esc && ch == ',') { state.keyCol = 0; state.pair = false; diff --git a/plugins/datatables-searchbuilder/css/searchBuilder.bootstrap4.css b/plugins/datatables-searchbuilder/css/searchBuilder.bootstrap4.css new file mode 100644 index 000000000..1d913b0ba --- /dev/null +++ b/plugins/datatables-searchbuilder/css/searchBuilder.bootstrap4.css @@ -0,0 +1,340 @@ +div.dt-datetime { + position: absolute; + background-color: white; + z-index: 2050; + border: 1px solid #ccc; + box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.5); + padding: 0 20px 6px 20px; + width: 275px; +} +div.dt-datetime.inline { + position: relative; + box-shadow: none; +} +div.dt-datetime div.dt-datetime-title { + text-align: center; + padding: 5px 0px 3px; +} +div.dt-datetime table { + border-spacing: 0; + margin: 12px 0; + width: 100%; +} +div.dt-datetime table.dt-datetime-table-nospace { + margin-top: -12px; +} +div.dt-datetime table th { + font-size: 0.8em; + color: #777; + font-weight: normal; + width: 14.285714286%; + padding: 0 0 4px 0; + text-align: center; +} +div.dt-datetime table td { + font-size: 0.9em; + color: #444; + padding: 0; +} +div.dt-datetime table td.selectable { + text-align: center; + background: #f5f5f5; +} +div.dt-datetime table td.selectable.disabled { + color: #aaa; + background: white; +} +div.dt-datetime table td.selectable.disabled button:hover { + color: #aaa; + background: white; +} +div.dt-datetime table td.selectable.now { + background-color: #ddd; +} +div.dt-datetime table td.selectable.now button { + font-weight: bold; +} +div.dt-datetime table td.selectable.selected button { + background: #4E6CA3; + color: white; + border-radius: 2px; +} +div.dt-datetime table td.selectable button:hover { + background: #ff8000; + color: white; + border-radius: 2px; +} +div.dt-datetime table td.dt-datetime-week { + font-size: 0.7em; +} +div.dt-datetime table button { + width: 100%; + box-sizing: border-box; + border: none; + background: transparent; + font-size: inherit; + color: inherit; + text-align: center; + padding: 4px 0; + cursor: pointer; + margin: 0; +} +div.dt-datetime table button span { + display: inline-block; + min-width: 14px; + text-align: right; +} +div.dt-datetime table.weekNumber th { + width: 12.5%; +} +div.dt-datetime div.dt-datetime-calendar table { + margin-top: 0; +} +div.dt-datetime div.dt-datetime-label { + position: relative; + display: inline-block; + height: 30px; + padding: 5px 6px; + border: 1px solid transparent; + box-sizing: border-box; + cursor: pointer; +} +div.dt-datetime div.dt-datetime-label:hover { + border: 1px solid #ddd; + border-radius: 2px; + background-color: #f5f5f5; +} +div.dt-datetime div.dt-datetime-label select { + position: absolute; + top: 6px; + left: 0; + cursor: pointer; + opacity: 0; +} +div.dt-datetime.horizontal { + width: 550px; +} +div.dt-datetime.horizontal div.dt-datetime-date, +div.dt-datetime.horizontal div.dt-datetime-time { + width: 48%; +} +div.dt-datetime.horizontal div.dt-datetime-time { + margin-left: 4%; +} +div.dt-datetime div.dt-datetime-date { + position: relative; + float: left; + width: 100%; +} +div.dt-datetime div.dt-datetime-time { + position: relative; + float: left; + width: 100%; + text-align: center; +} +div.dt-datetime div.dt-datetime-time > span { + vertical-align: middle; +} +div.dt-datetime div.dt-datetime-time th { + text-align: left; +} +div.dt-datetime div.dt-datetime-time div.dt-datetime-timeblock { + display: inline-block; + vertical-align: middle; +} +div.dt-datetime div.dt-datetime-iconLeft, +div.dt-datetime div.dt-datetime-iconRight, +div.dt-datetime div.dt-datetime-iconUp, +div.dt-datetime div.dt-datetime-iconDown { + width: 30px; + height: 30px; + background-position: center; + background-repeat: no-repeat; + opacity: 0.3; + overflow: hidden; + box-sizing: border-box; +} +div.dt-datetime div.dt-datetime-iconLeft:hover, +div.dt-datetime div.dt-datetime-iconRight:hover, +div.dt-datetime div.dt-datetime-iconUp:hover, +div.dt-datetime div.dt-datetime-iconDown:hover { + border: 1px solid #ccc; + border-radius: 2px; + background-color: #f0f0f0; + opacity: 0.6; +} +div.dt-datetime div.dt-datetime-iconLeft button, +div.dt-datetime div.dt-datetime-iconRight button, +div.dt-datetime div.dt-datetime-iconUp button, +div.dt-datetime div.dt-datetime-iconDown button { + border: none; + background: transparent; + text-indent: 30px; + height: 100%; + width: 100%; + cursor: pointer; +} +div.dt-datetime div.dt-datetime-iconLeft { + position: absolute; + top: 5px; + left: 5px; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg=="); +} +div.dt-datetime div.dt-datetime-iconRight { + position: absolute; + top: 5px; + right: 5px; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII="); +} +div.dt-datetime div.dt-datetime-iconUp { + height: 20px; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAALCAMAAABf9c24AAAAFVBMVEX///99fX1+fn57e3t6enoAAAAAAAC73bqPAAAABnRSTlMAYmJkZt92bnysAAAAL0lEQVR4AWOgJmBhxCvLyopHnpmVjY2VCadeoCxIHrcsWJ4RlyxCHlMWCTBRJxwAjrIBDMWSiM0AAAAASUVORK5CYII="); +} +div.dt-datetime div.dt-datetime-iconDown { + height: 20px; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAALCAMAAABf9c24AAAAFVBMVEX///99fX1+fn57e3t6enoAAAAAAAC73bqPAAAABnRSTlMAYmJkZt92bnysAAAAMElEQVR4AWOgDmBiRQIsmPKMrGxQgJDFlEfIYpoPk8Utz8qM232MYFfhkQfKUg8AANefAQxecJ58AAAAAElFTkSuQmCC"); +} + +div.dt-datetime-error { + clear: both; + padding: 0 1em; + max-width: 240px; + font-size: 11px; + line-height: 1.25em; + text-align: center; + color: #b11f1f; +} + +div.dt-button-collection { + overflow: visible !important; +} + +.dtsb-greyscale { + border: 1px solid #cecece !important; +} + +div.dtsb-logicContainer .dtsb-greyscale { + border: none !important; +} + +div.dtsb-searchBuilder { + justify-content: space-evenly; + cursor: default; + margin-bottom: 1em; + text-align: left; +} +div.dtsb-searchBuilder button.dtsb-button, +div.dtsb-searchBuilder select { + font-size: 1em; +} +div.dtsb-searchBuilder div.dtsb-titleRow { + justify-content: space-evenly; + margin-bottom: 0.5em; +} +div.dtsb-searchBuilder div.dtsb-titleRow div.dtsb-title { + display: inline-block; + padding-top: 6px; +} +div.dtsb-searchBuilder div.dtsb-titleRow button.dtsb-clearAll { + float: right; + margin-bottom: 0.333em; +} +div.dtsb-searchBuilder div.dtsb-vertical .dtsb-value, div.dtsb-searchBuilder div.dtsb-vertical .dtsb-data, div.dtsb-searchBuilder div.dtsb-vertical .dtsb-condition { + display: block; +} +div.dtsb-searchBuilder div.dtsb-group { + position: relative; + clear: both; + margin-bottom: 0.8em; +} +div.dtsb-searchBuilder div.dtsb-group button.dtsb-clearGroup { + margin: 2px; + text-align: center; + padding: 0; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -o-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); + position: absolute; + margin-top: 0.8em; + margin-right: 0.8em; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria { + margin-bottom: 0.8em; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-dropDown, +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-input { + padding: 0.4em; + margin-right: 0.8em; + max-width: 20em; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-dropDown option.dtsb-notItalic, +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-input option.dtsb-notItalic { + font-style: normal; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-italic { + font-style: italic; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer { + float: right; + display: inline-block; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-delete, div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-right, div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-left { + margin-right: 0.8em; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-delete:last-child, div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-right:last-child, div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-left:last-child { + margin-right: 0; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria span.dtsp-joiner { + margin-right: 0.8em; +} + +div.dtsb-searchBuilder div.dtsb-titleRow { + height: 40px; +} +div.dtsb-searchBuilder div.dtsb-titleRow div.dtsb-title { + padding-top: 10px; +} +div.dtsb-searchBuilder div.dtsb-group button.dtsb-clearGroup { + margin-right: 8px; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria .form-control { + width: auto; + display: inline-block; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-condition { + border-color: #28a745; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-data { + border-color: #dc3545; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-value, div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-value { + border-color: #007bff; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer { + border-radius: 4px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: flex-start; + align-content: flex-start; + align-items: flex-start; + margin-top: 10px; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer button.dtsb-logic { + border: none; + border-radius: 0px; + flex-grow: 1; + flex-shrink: 0; + flex-basis: 40px; + margin: 0px; +} +div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer button.dtsb-clearGroup { + border: none; + border-radius: 0px; + width: 30px; + margin: 0px; +} diff --git a/plugins/datatables-searchbuilder/css/searchBuilder.bootstrap4.min.css b/plugins/datatables-searchbuilder/css/searchBuilder.bootstrap4.min.css new file mode 100644 index 000000000..aac32aa7a --- /dev/null +++ b/plugins/datatables-searchbuilder/css/searchBuilder.bootstrap4.min.css @@ -0,0 +1 @@ +div.dt-datetime{position:absolute;background-color:white;z-index:2050;border:1px solid #ccc;box-shadow:0 5px 15px -5px rgba(0, 0, 0, 0.5);padding:0 20px 6px 20px;width:275px}div.dt-datetime.inline{position:relative;box-shadow:none}div.dt-datetime div.dt-datetime-title{text-align:center;padding:5px 0px 3px}div.dt-datetime table{border-spacing:0;margin:12px 0;width:100%}div.dt-datetime table.dt-datetime-table-nospace{margin-top:-12px}div.dt-datetime table th{font-size:.8em;color:#777;font-weight:normal;width:14.285714286%;padding:0 0 4px 0;text-align:center}div.dt-datetime table td{font-size:.9em;color:#444;padding:0}div.dt-datetime table td.selectable{text-align:center;background:#f5f5f5}div.dt-datetime table td.selectable.disabled{color:#aaa;background:white}div.dt-datetime table td.selectable.disabled button:hover{color:#aaa;background:white}div.dt-datetime table td.selectable.now{background-color:#ddd}div.dt-datetime table td.selectable.now button{font-weight:bold}div.dt-datetime table td.selectable.selected button{background:#4e6ca3;color:white;border-radius:2px}div.dt-datetime table td.selectable button:hover{background:#ff8000;color:white;border-radius:2px}div.dt-datetime table td.dt-datetime-week{font-size:.7em}div.dt-datetime table button{width:100%;box-sizing:border-box;border:none;background:transparent;font-size:inherit;color:inherit;text-align:center;padding:4px 0;cursor:pointer;margin:0}div.dt-datetime table button span{display:inline-block;min-width:14px;text-align:right}div.dt-datetime table.weekNumber th{width:12.5%}div.dt-datetime div.dt-datetime-calendar table{margin-top:0}div.dt-datetime div.dt-datetime-label{position:relative;display:inline-block;height:30px;padding:5px 6px;border:1px solid transparent;box-sizing:border-box;cursor:pointer}div.dt-datetime div.dt-datetime-label:hover{border:1px solid #ddd;border-radius:2px;background-color:#f5f5f5}div.dt-datetime div.dt-datetime-label select{position:absolute;top:6px;left:0;cursor:pointer;opacity:0}div.dt-datetime.horizontal{width:550px}div.dt-datetime.horizontal div.dt-datetime-date,div.dt-datetime.horizontal div.dt-datetime-time{width:48%}div.dt-datetime.horizontal div.dt-datetime-time{margin-left:4%}div.dt-datetime div.dt-datetime-date{position:relative;float:left;width:100%}div.dt-datetime div.dt-datetime-time{position:relative;float:left;width:100%;text-align:center}div.dt-datetime div.dt-datetime-time>span{vertical-align:middle}div.dt-datetime div.dt-datetime-time th{text-align:left}div.dt-datetime div.dt-datetime-time div.dt-datetime-timeblock{display:inline-block;vertical-align:middle}div.dt-datetime div.dt-datetime-iconLeft,div.dt-datetime div.dt-datetime-iconRight,div.dt-datetime div.dt-datetime-iconUp,div.dt-datetime div.dt-datetime-iconDown{width:30px;height:30px;background-position:center;background-repeat:no-repeat;opacity:.3;overflow:hidden;box-sizing:border-box}div.dt-datetime div.dt-datetime-iconLeft:hover,div.dt-datetime div.dt-datetime-iconRight:hover,div.dt-datetime div.dt-datetime-iconUp:hover,div.dt-datetime div.dt-datetime-iconDown:hover{border:1px solid #ccc;border-radius:2px;background-color:#f0f0f0;opacity:.6}div.dt-datetime div.dt-datetime-iconLeft button,div.dt-datetime div.dt-datetime-iconRight button,div.dt-datetime div.dt-datetime-iconUp button,div.dt-datetime div.dt-datetime-iconDown button{border:none;background:transparent;text-indent:30px;height:100%;width:100%;cursor:pointer}div.dt-datetime div.dt-datetime-iconLeft{position:absolute;top:5px;left:5px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==")}div.dt-datetime div.dt-datetime-iconRight{position:absolute;top:5px;right:5px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=")}div.dt-datetime div.dt-datetime-iconUp{height:20px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAALCAMAAABf9c24AAAAFVBMVEX///99fX1+fn57e3t6enoAAAAAAAC73bqPAAAABnRSTlMAYmJkZt92bnysAAAAL0lEQVR4AWOgJmBhxCvLyopHnpmVjY2VCadeoCxIHrcsWJ4RlyxCHlMWCTBRJxwAjrIBDMWSiM0AAAAASUVORK5CYII=")}div.dt-datetime div.dt-datetime-iconDown{height:20px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAALCAMAAABf9c24AAAAFVBMVEX///99fX1+fn57e3t6enoAAAAAAAC73bqPAAAABnRSTlMAYmJkZt92bnysAAAAMElEQVR4AWOgDmBiRQIsmPKMrGxQgJDFlEfIYpoPk8Utz8qM232MYFfhkQfKUg8AANefAQxecJ58AAAAAElFTkSuQmCC")}div.dt-datetime-error{clear:both;padding:0 1em;max-width:240px;font-size:11px;line-height:1.25em;text-align:center;color:#b11f1f}div.dt-button-collection{overflow:visible !important}.dtsb-greyscale{border:1px solid #cecece !important}div.dtsb-logicContainer .dtsb-greyscale{border:none !important}div.dtsb-searchBuilder{justify-content:space-evenly;cursor:default;margin-bottom:1em;text-align:left}div.dtsb-searchBuilder button.dtsb-button,div.dtsb-searchBuilder select{font-size:1em}div.dtsb-searchBuilder div.dtsb-titleRow{justify-content:space-evenly;margin-bottom:.5em}div.dtsb-searchBuilder div.dtsb-titleRow div.dtsb-title{display:inline-block;padding-top:6px}div.dtsb-searchBuilder div.dtsb-titleRow button.dtsb-clearAll{float:right;margin-bottom:.333em}div.dtsb-searchBuilder div.dtsb-vertical .dtsb-value,div.dtsb-searchBuilder div.dtsb-vertical .dtsb-data,div.dtsb-searchBuilder div.dtsb-vertical .dtsb-condition{display:block}div.dtsb-searchBuilder div.dtsb-group{position:relative;clear:both;margin-bottom:.8em}div.dtsb-searchBuilder div.dtsb-group button.dtsb-clearGroup{margin:2px;text-align:center;padding:0}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);position:absolute;margin-top:.8em;margin-right:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria{margin-bottom:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-dropDown,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-input{padding:.4em;margin-right:.8em;max-width:20em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-dropDown option.dtsb-notItalic,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-input option.dtsb-notItalic{font-style:normal}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-italic{font-style:italic}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer{float:right;display:inline-block}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-delete,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-right,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-left{margin-right:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-delete:last-child,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-right:last-child,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-left:last-child{margin-right:0}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria span.dtsp-joiner{margin-right:.8em}div.dtsb-searchBuilder div.dtsb-titleRow{height:40px}div.dtsb-searchBuilder div.dtsb-titleRow div.dtsb-title{padding-top:10px}div.dtsb-searchBuilder div.dtsb-group button.dtsb-clearGroup{margin-right:8px}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria .form-control{width:auto;display:inline-block}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-condition{border-color:#28a745}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-data{border-color:#dc3545}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-value,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-value{border-color:#007bff}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer{border-radius:4px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-content:flex-start;align-items:flex-start;margin-top:10px}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer button.dtsb-logic{border:none;border-radius:0px;flex-grow:1;flex-shrink:0;flex-basis:40px;margin:0px}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer button.dtsb-clearGroup{border:none;border-radius:0px;width:30px;margin:0px} diff --git a/plugins/datatables-searchbuilder/js/dataTables.searchBuilder.js b/plugins/datatables-searchbuilder/js/dataTables.searchBuilder.js new file mode 100644 index 000000000..4f2eeabee --- /dev/null +++ b/plugins/datatables-searchbuilder/js/dataTables.searchBuilder.js @@ -0,0 +1,4376 @@ +(function () { + 'use strict'; + + /*! DateTime picker for DataTables.net v1.0.1 + * + * ©2020 SpryMedia Ltd, all rights reserved. + * License: MIT datatables.net/license/mit + */ + + /** + * @summary DateTime picker for DataTables.net + * @version 1.0.1 + * @file dataTables.dateTime.js + * @author SpryMedia Ltd + * @contact www.datatables.net/contact + */ + (function( factory ){ + if ( typeof define === 'function' && define.amd ) { + // AMD + define( ['jquery'], function ( $ ) { + return factory( $, window, document ); + } ); + } + else if ( typeof exports === 'object' ) { + // CommonJS + module.exports = function (root, $) { + if ( ! root ) { + root = window; + } + + return factory( $, root, root.document ); + }; + } + else { + // Browser + factory( jQuery, window, document ); + } + }(function( $, window, document, undefined$1 ) { + + // Support libraries which support a Moment like API + var dateLib = window.moment + ? window.moment + : window.dayjs + ? window.dayjs + : null; + + /* + * This file provides a DateTime GUI picker (calendar and time input). Only the + * format YYYY-MM-DD is supported without additional software, but the end user + * experience can be greatly enhanced by including the momentjs or dayjs library + * which provide date / time parsing and formatting options. + * + * This functionality is required because the HTML5 date and datetime input + * types are not widely supported in desktop browsers. + * + * Constructed by using: + * + * new DateTime( input, opts ) + * + * where `input` is the HTML input element to use and `opts` is an object of + * options based on the `DateTime.defaults` object. + */ + var DateTime = function ( input, opts ) { + this.c = $.extend( true, {}, DateTime.defaults, opts ); + var classPrefix = this.c.classPrefix; + var i18n = this.c.i18n; + + // Only IS8601 dates are supported without moment pr dayjs + if ( ! dateLib && this.c.format !== 'YYYY-MM-DD' ) { + throw "DateTime: Without momentjs or dayjs only the format 'YYYY-MM-DD' can be used"; + } + + // Min and max need to be `Date` objects in the config + if (typeof this.c.minDate === 'string') { + this.c.minDate = new Date(this.c.minDate); + } + if (typeof this.c.maxDate === 'string') { + this.c.maxDate = new Date(this.c.maxDate); + } + + // DOM structure + var structure = $( + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'+ + ''+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
' + ); + + this.dom = { + container: structure, + date: structure.find( '.'+classPrefix+'-date' ), + title: structure.find( '.'+classPrefix+'-title' ), + calendar: structure.find( '.'+classPrefix+'-calendar' ), + time: structure.find( '.'+classPrefix+'-time' ), + error: structure.find( '.'+classPrefix+'-error' ), + input: $(input) + }; + + this.s = { + /** @type {Date} Date value that the picker has currently selected */ + d: null, + + /** @type {Date} Date of the calendar - might not match the value */ + display: null, + + /** @type {number} Used to select minutes in a range where the range base is itself unavailable */ + minutesRange: null, + + /** @type {number} Used to select minutes in a range where the range base is itself unavailable */ + secondsRange: null, + + /** @type {String} Unique namespace string for this instance */ + namespace: 'dateime-'+(DateTime._instance++), + + /** @type {Object} Parts of the picker that should be shown */ + parts: { + date: this.c.format.match( /[YMD]|L(?!T)|l/ ) !== null, + time: this.c.format.match( /[Hhm]|LT|LTS/ ) !== null, + seconds: this.c.format.indexOf( 's' ) !== -1, + hours12: this.c.format.match( /[haA]/ ) !== null + } + }; + + this.dom.container + .append( this.dom.date ) + .append( this.dom.time ) + .append( this.dom.error ); + + this.dom.date + .append( this.dom.title ) + .append( this.dom.calendar ); + + this._constructor(); + }; + + $.extend( DateTime.prototype, { + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Public + */ + + /** + * Destroy the control + */ + destroy: function () { + this._hide(true); + this.dom.container.off().empty(); + this.dom.input.off('.datetime'); + }, + + errorMsg: function ( msg ) { + var error = this.dom.error; + + if ( msg ) { + error.html( msg ); + } + else { + error.empty(); + } + + return this; + }, + + hide: function () { + this._hide(); + + return this; + }, + + max: function ( date ) { + this.c.maxDate = typeof date === 'string' + ? new Date(date) + : date; + + this._optionsTitle(); + this._setCalander(); + + return this; + }, + + min: function ( date ) { + this.c.minDate = typeof date === 'string' + ? new Date(date) + : date; + + this._optionsTitle(); + this._setCalander(); + + return this; + }, + + /** + * Check if an element belongs to this control + * + * @param {node} node Element to check + * @return {boolean} true if owned by this control, false otherwise + */ + owns: function ( node ) { + return $(node).parents().filter( this.dom.container ).length > 0; + }, + + /** + * Get / set the value + * + * @param {string|Date} set Value to set + * @param {boolean} [write=true] Flag to indicate if the formatted value + * should be written into the input element + */ + val: function ( set, write ) { + if ( set === undefined$1 ) { + return this.s.d; + } + + if ( set instanceof Date ) { + this.s.d = this._dateToUtc( set ); + } + else if ( set === null || set === '' ) { + this.s.d = null; + } + else if ( set === '--now' ) { + this.s.d = new Date(); + } + else if ( typeof set === 'string' ) { + if ( dateLib ) { + // Use moment or dayjs if possible (even for ISO8601 strings, since it + // will correctly handle 0000-00-00 and the like) + var m = dateLib.utc( set, this.c.format, this.c.locale, this.c.strict ); + this.s.d = m.isValid() ? m.toDate() : null; + } + else { + // Else must be using ISO8601 without a date library (constructor would + // have thrown an error otherwise) + var match = set.match(/(\d{4})\-(\d{2})\-(\d{2})/ ); + this.s.d = match ? + new Date( Date.UTC(match[1], match[2]-1, match[3]) ) : + null; + } + } + + if ( write || write === undefined$1 ) { + if ( this.s.d ) { + this._writeOutput(); + } + else { + // The input value was not valid... + this.dom.input.val( set ); + } + } + + // We need a date to be able to display the calendar at all + if ( ! this.s.d ) { + this.s.d = this._dateToUtc( new Date() ); + } + + this.s.display = new Date( this.s.d.toString() ); + + // Set the day of the month to be 1 so changing between months doesn't + // run into issues when going from day 31 to 28 (for example) + this.s.display.setUTCDate( 1 ); + + // Update the display elements for the new value + this._setTitle(); + this._setCalander(); + this._setTime(); + + return this; + }, + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Constructor + */ + + /** + * Build the control and assign initial event handlers + * + * @private + */ + _constructor: function () { + var that = this; + var classPrefix = this.c.classPrefix; + var onChange = function () { + that.c.onChange.call( that, that.dom.input.val(), that.s.d, that.dom.input ); + }; + + if ( ! this.s.parts.date ) { + this.dom.date.css( 'display', 'none' ); + } + + if ( ! this.s.parts.time ) { + this.dom.time.css( 'display', 'none' ); + } + + if ( ! this.s.parts.seconds ) { + this.dom.time.children('div.'+classPrefix+'-seconds').remove(); + this.dom.time.children('span').eq(1).remove(); + } + + // Render the options + this._optionsTitle(); + + window.allan = this; + + // When attached to a hidden input, we always show the input picker, and + // do so inline + if (this.dom.input.attr('type') === 'hidden') { + this.dom.container.addClass('inline'); + this.c.attachTo = 'input'; + + this.val( this.dom.input.val(), false ); + this._show(); + } + + // Trigger the display of the widget when clicking or focusing on the + // input element + this.dom.input + .attr('autocomplete', 'off') + .on('focus.datetime click.datetime', function () { + // If already visible - don't do anything + if ( that.dom.container.is(':visible') || that.dom.input.is(':disabled') ) { + return; + } + + // In case the value has changed by text + that.val( that.dom.input.val(), false ); + + that._show(); + } ) + .on('keyup.datetime', function () { + // Update the calendar's displayed value as the user types + if ( that.dom.container.is(':visible') ) { + that.val( that.dom.input.val(), false ); + } + } ); + + // Main event handlers for input in the widget + this.dom.container + .on( 'change', 'select', function () { + var select = $(this); + var val = select.val(); + + if ( select.hasClass(classPrefix+'-month') ) { + // Month select + that._correctMonth( that.s.display, val ); + that._setTitle(); + that._setCalander(); + } + else if ( select.hasClass(classPrefix+'-year') ) { + // Year select + that.s.display.setUTCFullYear( val ); + that._setTitle(); + that._setCalander(); + } + else if ( select.hasClass(classPrefix+'-hours') || select.hasClass(classPrefix+'-ampm') ) { + // Hours - need to take account of AM/PM input if present + if ( that.s.parts.hours12 ) { + var hours = $(that.dom.container).find('.'+classPrefix+'-hours').val() * 1; + var pm = $(that.dom.container).find('.'+classPrefix+'-ampm').val() === 'pm'; + + that.s.d.setUTCHours( hours === 12 && !pm ? + 0 : + pm && hours !== 12 ? + hours + 12 : + hours + ); + } + else { + that.s.d.setUTCHours( val ); + } + + that._setTime(); + that._writeOutput( true ); + + onChange(); + } + else if ( select.hasClass(classPrefix+'-minutes') ) { + // Minutes select + that.s.d.setUTCMinutes( val ); + that._setTime(); + that._writeOutput( true ); + + onChange(); + } + else if ( select.hasClass(classPrefix+'-seconds') ) { + // Seconds select + that.s.d.setSeconds( val ); + that._setTime(); + that._writeOutput( true ); + + onChange(); + } + + that.dom.input.focus(); + that._position(); + } ) + .on( 'click', function (e) { + var d = that.s.d; + var nodeName = e.target.nodeName.toLowerCase(); + var target = nodeName === 'span' ? + e.target.parentNode : + e.target; + + nodeName = target.nodeName.toLowerCase(); + + if ( nodeName === 'select' ) { + return; + } + + e.stopPropagation(); + + if ( nodeName === 'button' ) { + var button = $(target); + var parent = button.parent(); + + if ( parent.hasClass('disabled') && ! parent.hasClass('range') ) { + button.blur(); + return; + } + + if ( parent.hasClass(classPrefix+'-iconLeft') ) { + // Previous month + that.s.display.setUTCMonth( that.s.display.getUTCMonth()-1 ); + that._setTitle(); + that._setCalander(); + + that.dom.input.focus(); + } + else if ( parent.hasClass(classPrefix+'-iconRight') ) { + // Next month + that._correctMonth( that.s.display, that.s.display.getUTCMonth()+1 ); + that._setTitle(); + that._setCalander(); + + that.dom.input.focus(); + } + else if ( button.parents('.'+classPrefix+'-time').length ) { + var val = button.data('value'); + var unit = button.data('unit'); + + if ( unit === 'minutes' ) { + if ( parent.hasClass('disabled') && parent.hasClass('range') ) { + that.s.minutesRange = val; + that._setTime(); + return; + } + else { + that.s.minutesRange = null; + } + } + + if ( unit === 'seconds' ) { + if ( parent.hasClass('disabled') && parent.hasClass('range') ) { + that.s.secondsRange = val; + that._setTime(); + return; + } + else { + that.s.secondsRange = null; + } + } + + // Specific to hours for 12h clock + if ( val === 'am' ) { + if ( d.getUTCHours() >= 12 ) { + val = d.getUTCHours() - 12; + } + else { + return; + } + } + else if ( val === 'pm' ) { + if ( d.getUTCHours() < 12 ) { + val = d.getUTCHours() + 12; + } + else { + return; + } + } + + var set = unit === 'hours' ? + 'setUTCHours' : + unit === 'minutes' ? + 'setUTCMinutes' : + 'setSeconds'; + + d[set]( val ); + that._setTime(); + that._writeOutput( true ); + onChange(); + } + else { + // Calendar click + if ( ! d ) { + d = that._dateToUtc( new Date() ); + } + + // Can't be certain that the current day will exist in + // the new month, and likewise don't know that the + // new day will exist in the old month, But 1 always + // does, so we can change the month without worry of a + // recalculation being done automatically by `Date` + d.setUTCDate( 1 ); + d.setUTCFullYear( button.data('year') ); + d.setUTCMonth( button.data('month') ); + d.setUTCDate( button.data('day') ); + + that._writeOutput( true ); + + // Don't hide if there is a time picker, since we want to + // be able to select a time as well. + if ( ! that.s.parts.time ) { + // This is annoying but IE has some kind of async + // behaviour with focus and the focus from the above + // write would occur after this hide - resulting in the + // calendar opening immediately + setTimeout( function () { + that._hide(); + }, 10 ); + } + else { + that._setCalander(); + } + + onChange(); + } + } + else { + // Click anywhere else in the widget - return focus to the + // input element + that.dom.input.focus(); + } + } ); + }, + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Private + */ + + /** + * Compare the date part only of two dates - this is made super easy by the + * toDateString method! + * + * @param {Date} a Date 1 + * @param {Date} b Date 2 + * @private + */ + _compareDates: function( a, b ) { + // Can't use toDateString as that converts to local time + return this._dateToUtcString(a) === this._dateToUtcString(b); + }, + + /** + * When changing month, take account of the fact that some months don't have + * the same number of days. For example going from January to February you + * can have the 31st of Jan selected and just add a month since the date + * would still be 31, and thus drop you into March. + * + * @param {Date} date Date - will be modified + * @param {integer} month Month to set + * @private + */ + _correctMonth: function ( date, month ) { + var days = this._daysInMonth( date.getUTCFullYear(), month ); + var correctDays = date.getUTCDate() > days; + + date.setUTCMonth( month ); + + if ( correctDays ) { + date.setUTCDate( days ); + date.setUTCMonth( month ); + } + }, + + /** + * Get the number of days in a method. Based on + * http://stackoverflow.com/a/4881951 by Matti Virkkunen + * + * @param {integer} year Year + * @param {integer} month Month (starting at 0) + * @private + */ + _daysInMonth: function ( year, month ) { + // + var isLeap = ((year % 4) === 0 && ((year % 100) !== 0 || (year % 400) === 0)); + var months = [31, (isLeap ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + return months[month]; + }, + + /** + * Create a new date object which has the UTC values set to the local time. + * This allows the local time to be used directly for the library which + * always bases its calculations and display on UTC. + * + * @param {Date} s Date to "convert" + * @return {Date} Shifted date + */ + _dateToUtc: function ( s ) { + return new Date( Date.UTC( + s.getFullYear(), s.getMonth(), s.getDate(), + s.getHours(), s.getMinutes(), s.getSeconds() + ) ); + }, + + /** + * Create a UTC ISO8601 date part from a date object + * + * @param {Date} d Date to "convert" + * @return {string} ISO formatted date + */ + _dateToUtcString: function ( d ) { + return d.getUTCFullYear()+'-'+ + this._pad(d.getUTCMonth()+1)+'-'+ + this._pad(d.getUTCDate()); + }, + + /** + * Hide the control and remove events related to its display + * + * @private + */ + _hide: function (destroy) { + if (! destroy && this.dom.input.attr('type') === 'hidden') { + return; + } + + var namespace = this.s.namespace; + + this.dom.container.detach(); + + $(window).off( '.'+namespace ); + $(document).off( 'keydown.'+namespace ); + $('div.dataTables_scrollBody').off( 'scroll.'+namespace ); + $('div.DTE_Body_Content').off( 'scroll.'+namespace ); + $('body').off( 'click.'+namespace ); + }, + + /** + * Convert a 24 hour value to a 12 hour value + * + * @param {integer} val 24 hour value + * @return {integer} 12 hour value + * @private + */ + _hours24To12: function ( val ) { + return val === 0 ? + 12 : + val > 12 ? + val - 12 : + val; + }, + + /** + * Generate the HTML for a single day in the calendar - this is basically + * and HTML cell with a button that has data attributes so we know what was + * clicked on (if it is clicked on) and a bunch of classes for styling. + * + * @param {object} day Day object from the `_htmlMonth` method + * @return {string} HTML cell + */ + _htmlDay: function( day ) + { + if ( day.empty ) { + return ''; + } + + var classes = [ 'selectable' ]; + var classPrefix = this.c.classPrefix; + + if ( day.disabled ) { + classes.push( 'disabled' ); + } + + if ( day.today ) { + classes.push( 'now' ); + } + + if ( day.selected ) { + classes.push( 'selected' ); + } + + return '' + + '' + + ''; + }, + + + /** + * Create the HTML for a month to be displayed in the calendar table. + * + * Based upon the logic used in Pikaday - MIT licensed + * Copyright (c) 2014 David Bushell + * https://github.com/dbushell/Pikaday + * + * @param {integer} year Year + * @param {integer} month Month (starting at 0) + * @return {string} Calendar month HTML + * @private + */ + _htmlMonth: function ( year, month ) { + var now = this._dateToUtc( new Date() ), + days = this._daysInMonth( year, month ), + before = new Date( Date.UTC(year, month, 1) ).getUTCDay(), + data = [], + row = []; + + if ( this.c.firstDay > 0 ) { + before -= this.c.firstDay; + + if (before < 0) { + before += 7; + } + } + + var cells = days + before, + after = cells; + + while ( after > 7 ) { + after -= 7; + } + + cells += 7 - after; + + var minDate = this.c.minDate; + var maxDate = this.c.maxDate; + + if ( minDate ) { + minDate.setUTCHours(0); + minDate.setUTCMinutes(0); + minDate.setSeconds(0); + } + + if ( maxDate ) { + maxDate.setUTCHours(23); + maxDate.setUTCMinutes(59); + maxDate.setSeconds(59); + } + + for ( var i=0, r=0 ; i= (days + before), + disabled = (minDate && day < minDate) || + (maxDate && day > maxDate); + + var disableDays = this.c.disableDays; + if ( Array.isArray( disableDays ) && $.inArray( day.getUTCDay(), disableDays ) !== -1 ) { + disabled = true; + } + else if ( typeof disableDays === 'function' && disableDays( day ) === true ) { + disabled = true; + } + + var dayConfig = { + day: 1 + (i - before), + month: month, + year: year, + selected: selected, + today: today, + disabled: disabled, + empty: empty + }; + + row.push( this._htmlDay(dayConfig) ); + + if ( ++r === 7 ) { + if ( this.c.showWeekNumber ) { + row.unshift( this._htmlWeekOfYear(i - before, month, year) ); + } + + data.push( ''+row.join('')+'' ); + row = []; + r = 0; + } + } + + var classPrefix = this.c.classPrefix; + var className = classPrefix+'-table'; + if ( this.c.showWeekNumber ) { + className += ' weekNumber'; + } + + // Show / hide month icons based on min/max + if ( minDate ) { + var underMin = minDate >= new Date( Date.UTC(year, month, 1, 0, 0, 0 ) ); + + this.dom.title.find('div.'+classPrefix+'-iconLeft') + .css( 'display', underMin ? 'none' : 'block' ); + } + + if ( maxDate ) { + var overMax = maxDate < new Date( Date.UTC(year, month+1, 1, 0, 0, 0 ) ); + + this.dom.title.find('div.'+classPrefix+'-iconRight') + .css( 'display', overMax ? 'none' : 'block' ); + } + + return '' + + ''+ + this._htmlMonthHead() + + ''+ + ''+ + data.join('') + + ''+ + '
'; + }, + + /** + * Create the calendar table's header (week days) + * + * @return {string} HTML cells for the row + * @private + */ + _htmlMonthHead: function () { + var a = []; + var firstDay = this.c.firstDay; + var i18n = this.c.i18n; + + // Take account of the first day shift + var dayName = function ( day ) { + day += firstDay; + + while (day >= 7) { + day -= 7; + } + + return i18n.weekdays[day]; + }; + + // Empty cell in the header + if ( this.c.showWeekNumber ) { + a.push( '' ); + } + + for ( var i=0 ; i<7 ; i++ ) { + a.push( ''+dayName( i )+'' ); + } + + return a.join(''); + }, + + /** + * Create a cell that contains week of the year - ISO8601 + * + * Based on https://stackoverflow.com/questions/6117814/ and + * http://techblog.procurios.nl/k/n618/news/view/33796/14863/ + * + * @param {integer} d Day of month + * @param {integer} m Month of year (zero index) + * @param {integer} y Year + * @return {string} + * @private + */ + _htmlWeekOfYear: function ( d, m, y ) { + var date = new Date( y, m, d, 0, 0, 0, 0 ); + + // First week of the year always has 4th January in it + date.setDate( date.getDate() + 4 - (date.getDay() || 7) ); + + var oneJan = new Date( y, 0, 1 ); + var weekNum = Math.ceil( ( ( (date - oneJan) / 86400000) + 1)/7 ); + + return '' + weekNum + ''; + }, + + /** + * Create option elements from a range in an array + * + * @param {string} selector Class name unique to the select element to use + * @param {array} values Array of values + * @param {array} [labels] Array of labels. If given must be the same + * length as the values parameter. + * @private + */ + _options: function ( selector, values, labels ) { + if ( ! labels ) { + labels = values; + } + + var select = this.dom.container.find('select.'+this.c.classPrefix+'-'+selector); + select.empty(); + + for ( var i=0, ien=values.length ; i'+labels[i]+'' ); + } + }, + + /** + * Set an option and update the option's span pair (since the select element + * has opacity 0 for styling) + * + * @param {string} selector Class name unique to the select element to use + * @param {*} val Value to set + * @private + */ + _optionSet: function ( selector, val ) { + var select = this.dom.container.find('select.'+this.c.classPrefix+'-'+selector); + var span = select.parent().children('span'); + + select.val( val ); + + var selected = select.find('option:selected'); + span.html( selected.length !== 0 ? + selected.text() : + this.c.i18n.unknown + ); + }, + + /** + * Create time options list. + * + * @param {string} unit Time unit - hours, minutes or seconds + * @param {integer} count Count range - 12, 24 or 60 + * @param {integer} val Existing value for this unit + * @param {integer[]} allowed Values allow for selection + * @param {integer} range Override range + * @private + */ + _optionsTime: function ( unit, count, val, allowed, range ) { + var classPrefix = this.c.classPrefix; + var container = this.dom.container.find('div.'+classPrefix+'-'+unit); + var i, j; + var render = count === 12 ? + function (i) { return i; } : + this._pad; + var classPrefix = this.c.classPrefix; + var className = classPrefix+'-table'; + var i18n = this.c.i18n; + + if ( ! container.length ) { + return; + } + + var a = ''; + var span = 10; + var button = function (value, label, className) { + // Shift the value for PM + if ( count === 12 && typeof value === 'number' ) { + if (val >= 12 ) { + value += 12; + } + + if (value == 12) { + value = 0; + } + else if (value == 24) { + value = 12; + } + } + + var selected = val === value || (value === 'am' && val < 12) || (value === 'pm' && val >= 12) ? + 'selected' : + ''; + + if (allowed && $.inArray(value, allowed) === -1) { + selected += ' disabled'; + } + + if ( className ) { + selected += ' '+className; + } + + return '' + + '' + + ''; + }; + + if ( count === 12 ) { + // Hours with AM/PM + a += ''; + + for ( i=1 ; i<=6 ; i++ ) { + a += button(i, render(i)); + } + a += button('am', i18n.amPm[0]); + + a += ''; + a += ''; + + for ( i=7 ; i<=12 ; i++ ) { + a += button(i, render(i)); + } + a += button('pm', i18n.amPm[1]); + a += ''; + + span = 7; + } + else if ( count === 24 ) { + // Hours - 24 + var c = 0; + for (j=0 ; j<4 ; j++ ) { + a += ''; + for ( i=0 ; i<6 ; i++ ) { + a += button(c, render(c)); + c++; + } + a += ''; + } + + span = 6; + } + else { + // Minutes and seconds + a += ''; + for (j=0 ; j<60 ; j+=10 ) { + a += button(j, render(j), 'range'); + } + a += ''; + + // Slight hack to allow for the different number of columns + a += ''; + + var start = range !== null ? + range : + Math.floor( val / 10 )*10; + + a += ''; + for (j=start+1 ; j'+ + ''+ + ''+ + a+ + ''+ + '
'+ + i18n[unit] + + '
' + ); + }, + + /** + * Create the options for the month and year + * + * @param {integer} year Year + * @param {integer} month Month (starting at 0) + * @private + */ + _optionsTitle: function () { + var i18n = this.c.i18n; + var min = this.c.minDate; + var max = this.c.maxDate; + var minYear = min ? min.getFullYear() : null; + var maxYear = max ? max.getFullYear() : null; + + var i = minYear !== null ? minYear : new Date().getFullYear() - this.c.yearRange; + var j = maxYear !== null ? maxYear : new Date().getFullYear() + this.c.yearRange; + + this._options( 'month', this._range( 0, 11 ), i18n.months ); + this._options( 'year', this._range( i, j ) ); + }, + + /** + * Simple two digit pad + * + * @param {integer} i Value that might need padding + * @return {string|integer} Padded value + * @private + */ + _pad: function ( i ) { + return i<10 ? '0'+i : i; + }, + + /** + * Position the calendar to look attached to the input element + * @private + */ + _position: function () { + var offset = this.c.attachTo === 'input' ? this.dom.input.position() : this.dom.input.offset(); + var container = this.dom.container; + var inputHeight = this.dom.input.outerHeight(); + + if (container.hasClass('inline')) { + container.insertAfter( this.dom.input ); + return; + } + + if ( this.s.parts.date && this.s.parts.time && $(window).width() > 550 ) { + container.addClass('horizontal'); + } + else { + container.removeClass('horizontal'); + } + + if(this.c.attachTo === 'input') { + container + .css( { + top: offset.top + inputHeight, + left: offset.left + } ) + .insertAfter( this.dom.input ); + } + else { + container + .css( { + top: offset.top + inputHeight, + left: offset.left + } ) + .appendTo( 'body' ); + } + + var calHeight = container.outerHeight(); + var calWidth = container.outerWidth(); + var scrollTop = $(window).scrollTop(); + + // Correct to the bottom + if ( offset.top + inputHeight + calHeight - scrollTop > $(window).height() ) { + var newTop = offset.top - calHeight; + + container.css( 'top', newTop < 0 ? 0 : newTop ); + } + + // Correct to the right + if ( calWidth + offset.left > $(window).width() ) { + var newLeft = $(window).width() - calWidth; + + // Account for elements which are inside a position absolute element + if (this.c.attachTo === 'input') { + newLeft -= $(container).offsetParent().offset().left; + } + + container.css( 'left', newLeft < 0 ? 0 : newLeft ); + } + }, + + /** + * Create a simple array with a range of values + * + * @param {integer} start Start value (inclusive) + * @param {integer} end End value (inclusive) + * @param {integer} [inc=1] Increment value + * @return {array} Created array + * @private + */ + _range: function ( start, end, inc ) { + var a = []; + + if ( ! inc ) { + inc = 1; + } + + for ( var i=start ; i<=end ; i+=inc ) { + a.push( i ); + } + + return a; + }, + + /** + * Redraw the calendar based on the display date - this is a destructive + * operation + * + * @private + */ + _setCalander: function () { + if ( this.s.display ) { + this.dom.calendar + .empty() + .append( this._htmlMonth( + this.s.display.getUTCFullYear(), + this.s.display.getUTCMonth() + ) ); + } + }, + + /** + * Set the month and year for the calendar based on the current display date + * + * @private + */ + _setTitle: function () { + this._optionSet( 'month', this.s.display.getUTCMonth() ); + this._optionSet( 'year', this.s.display.getUTCFullYear() ); + }, + + /** + * Set the time based on the current value of the widget + * + * @private + */ + _setTime: function () { + var that = this; + var d = this.s.d; + var hours = d ? d.getUTCHours() : 0; + var allowed = function ( prop ) { // Backwards compt with `Increment` option + return that.c[prop+'Available'] ? + that.c[prop+'Available'] : + that._range( 0, 59, that.c[prop+'Increment'] ); + }; + + this._optionsTime( 'hours', this.s.parts.hours12 ? 12 : 24, hours, this.c.hoursAvailable ); + this._optionsTime( 'minutes', 60, d ? d.getUTCMinutes() : 0, allowed('minutes'), this.s.minutesRange ); + this._optionsTime( 'seconds', 60, d ? d.getSeconds() : 0, allowed('seconds'), this.s.secondsRange ); + }, + + /** + * Show the widget and add events to the document required only while it + * is displayed + * + * @private + */ + _show: function () { + var that = this; + var namespace = this.s.namespace; + + this._position(); + + // Need to reposition on scroll + $(window).on( 'scroll.'+namespace+' resize.'+namespace, function () { + that._hide(); + } ); + + $('div.DTE_Body_Content').on( 'scroll.'+namespace, function () { + that._hide(); + } ); + + $('div.dataTables_scrollBody').on( 'scroll.'+namespace, function () { + that._hide(); + } ); + + var offsetParent = this.dom.input[0].offsetParent; + + if ( offsetParent !== document.body ) { + $(offsetParent).on( 'scroll.'+namespace, function () { + that._hide(); + } ); + } + + // On tab focus will move to a different field (no keyboard navigation + // in the date picker - this might need to be changed). + $(document).on( 'keydown.'+namespace, function (e) { + if ( + e.keyCode === 9 || // tab + e.keyCode === 27 || // esc + e.keyCode === 13 // return + ) { + that._hide(); + } + } ); + + // Hide if clicking outside of the widget - but in a different click + // event from the one that was used to trigger the show (bubble and + // inline) + setTimeout( function () { + $('body').on( 'click.'+namespace, function (e) { + var parents = $(e.target).parents(); + + if ( ! parents.filter( that.dom.container ).length && e.target !== that.dom.input[0] ) { + that._hide(); + } + } ); + }, 10 ); + }, + + /** + * Write the formatted string to the input element this control is attached + * to + * + * @private + */ + _writeOutput: function ( focus ) { + var date = this.s.d; + + // Use moment or dayjs if possible - otherwise it must be ISO8601 (or the + // constructor would have thrown an error) + var out = dateLib ? + dateLib.utc( date, undefined$1, this.c.locale, this.c.strict ).format( this.c.format ) : + date.getUTCFullYear() +'-'+ + this._pad(date.getUTCMonth() + 1) +'-'+ + this._pad(date.getUTCDate()); + + this.dom.input + .val( out ) + .trigger('change', {write: date}); + + if ( this.dom.input.attr('type') === 'hidden' ) { + this.val(out, false); + } + + if ( focus ) { + this.dom.input.focus(); + } + } + } ); + + /** + * Use a specificmoment compatible date library + */ + DateTime.use = function (lib) { + dateLib = lib; + }; + + /** + * For generating unique namespaces + * + * @type {Number} + * @private + */ + DateTime._instance = 0; + + /** + * Defaults for the date time picker + * + * @type {Object} + */ + DateTime.defaults = { + attachTo: 'body', + + // Not documented - could be an internal property + classPrefix: 'dt-datetime', + + // function or array of ints + disableDays: null, + + // first day of the week (0: Sunday, 1: Monday, etc) + firstDay: 1, + + format: 'YYYY-MM-DD', + + hoursAvailable: null, + + i18n: { + previous: 'Previous', + next: 'Next', + months: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], + weekdays: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ], + amPm: [ 'am', 'pm' ], + hours: 'Hour', + minutes: 'Minute', + seconds: 'Second', + unknown: '-' + }, + + maxDate: null, + + minDate: null, + + minutesAvailable: null, + + minutesIncrement: 1, // deprecated + + strict: true, + + locale: 'en', + + onChange: function () {}, + + secondsAvailable: null, + + secondsIncrement: 1, // deprecated + + // show the ISO week number at the head of the row + showWeekNumber: false, + + // overruled by max / min date + yearRange: 25 + }; + + DateTime.version = '1.0.1'; + + // Global export - if no conflicts + if (! window.DateTime) { + window.DateTime = DateTime; + } + + // Make available via jQuery + $.fn.dtDateTime = function (options) { + return this.each(function() { + new DateTime(this, options); + }); + }; + + // Attach to DataTables if present + if ($.fn.dataTable) { + $.fn.dataTable.DateTime = DateTime; + $.fn.DataTable.DateTime = DateTime; + } + + return DateTime; + + })); + + var $; + var DataTable; + var moment = window.moment; + /** + * Sets the value of jQuery for use in the file + * @param jq the instance of jQuery to be set + */ + function setJQuery(jq) { + $ = jq; + DataTable = jq.fn.dataTable; + } + /** + * The Criteria class is used within SearchBuilder to represent a search criteria + */ + var Criteria = /** @class */ (function () { + function Criteria(table, opts, topGroup, index, depth) { + var _this = this; + if (index === void 0) { index = 0; } + if (depth === void 0) { depth = 1; } + // Check that the required version of DataTables is included + if (!DataTable || !DataTable.versionCheck || !DataTable.versionCheck('1.10.0')) { + throw new Error('SearchPane requires DataTables 1.10 or newer'); + } + this.classes = $.extend(true, {}, Criteria.classes); + // Get options from user and any extra conditions/column types defined by plug-ins + this.c = $.extend(true, {}, Criteria.defaults, $.fn.dataTable.ext.searchBuilder, opts); + var i18n = this.c.i18n; + this.s = { + condition: undefined, + conditions: {}, + data: undefined, + dataIdx: -1, + dataPoints: [], + depth: depth, + dt: table, + filled: false, + index: index, + momentFormat: false, + topGroup: topGroup, + type: '', + value: [] + }; + this.dom = { + buttons: $('
') + .addClass(this.classes.buttonContainer), + condition: $('') + .addClass(this.classes.data) + .addClass(this.classes.dropDown) + .addClass(this.classes.italic), + dataTitle: $('
\n').replace(/(^|\n)\s*/g,""),kt=function(t){var e,n,o,i,r,a=!!(i=k())&&(i.parentNode.removeChild(i),bt([document.documentElement,document.body],[$["no-backdrop"],$["toast-shown"],$["has-column"]]),!0);pt()?K("SweetAlert2 requires document to initialize"):((r=document.createElement("div")).className=$.container,a&&vt(r,$["no-transition"]),_(r,Ct),(i="string"==typeof(e=t.target)?document.querySelector(e):e).appendChild(r),a=t,(e=x()).setAttribute("role",a.toast?"alert":"dialog"),e.setAttribute("aria-live",a.toast?"polite":"assertive"),a.toast||e.setAttribute("aria-modal","true"),r=i,"rtl"===window.getComputedStyle(r).direction&&vt(k(),$.rtl),t=E(),a=yt(t,$.input),e=yt(t,$.file),n=t.querySelector(".".concat($.range," input")),o=t.querySelector(".".concat($.range," output")),i=yt(t,$.select),r=t.querySelector(".".concat($.checkbox," input")),t=yt(t,$.textarea),a.oninput=ft,e.onchange=ft,i.onchange=ft,r.onchange=ft,t.oninput=ft,n.oninput=function(t){ft(t),o.value=n.value},n.onchange=function(t){ft(t),n.nextSibling.value=n.value})},At=function(t,e){t.jquery?xt(e,t):_(e,t.toString())},xt=function(t,e){if(t.textContent="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},Bt=function(){if(pt())return!1;var t,e=document.createElement("div"),n={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&void 0!==e.style[t])return n[t];return!1}();function Pt(t,e,n){st(t,n["show".concat(m(e),"Button")],"inline-block"),_(t,n["".concat(e,"ButtonText")]),t.setAttribute("aria-label",n["".concat(e,"ButtonAriaLabel")]),t.className=$[e],z(t,n,"".concat(e,"Button")),vt(t,n["".concat(e,"ButtonClass")])}function Et(t,e){var n,o,i=k();i&&(o=i,"string"==typeof(n=e.backdrop)?o.style.background=n:n||vt([document.documentElement,document.body],$["no-backdrop"]),!e.backdrop&&e.allowOutsideClick&&W('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),o=i,(n=e.position)in $?vt(o,$[n]):(W('The "position" parameter is not valid, defaulting to "center"'),vt(o,$.center)),n=i,!(o=e.grow)||"string"!=typeof o||(o="grow-".concat(o))in $&&vt(n,$[o]),z(i,e,"container"),(e=document.body.getAttribute("data-swal2-queue-step"))&&(i.setAttribute("data-queue-step",e),document.body.removeAttribute("data-swal2-queue-step")))}function St(t,e){t.placeholder&&!e.inputPlaceholder||(t.placeholder=e.inputPlaceholder)}function Ot(t,e,n){var o,i;n.inputLabel&&(t.id=$.input,o=document.createElement("label"),i=$["input-label"],o.setAttribute("for",t.id),o.className=i,vt(o,n.customClass.inputLabel),o.innerText=n.inputLabel,e.insertAdjacentElement("beforebegin",o))}var Tt={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},Lt=["input","file","range","select","radio","checkbox","textarea"],qt=function(t){if(!Mt[t.input])return K('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(t.input,'"'));var e=It(t.input),n=Mt[t.input](e,t);rt(n),setTimeout(function(){nt(n)})},Dt=function(t,e){var n=et(E(),t);if(n)for(var o in!function(t){for(var e=0;e=o.progressSteps.length&&W("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.progressSteps.forEach(function(t,e){var n,t=(n=t,t=document.createElement("li"),vt(t,$["progress-step"]),_(t,n),t);i.appendChild(t),e===r&&vt(t,$["active-progress-step"]),e!==o.progressSteps.length-1&&(t=o,e=document.createElement("li"),vt(e,$["progress-step-line"]),t.progressStepsDistance&&(e.style.width=t.progressStepsDistance),e=e,i.appendChild(e))})}function Nt(t,e){var n=M();z(n,e,"header"),Rt(0,e),n=t,t=e,(n=Tt.innerParams.get(n))&&t.icon===n.icon&&B()?zt(B(),t):(Ft(),t.icon&&(-1!==Object.keys(X).indexOf(t.icon)?(n=A(".".concat($.icon,".").concat(X[t.icon])),rt(n),Kt(n,t),zt(n,t),vt(n,t.showClass.icon)):K('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')))),function(t){var e=S();if(!t.imageUrl)return at(e);rt(e,""),e.setAttribute("src",t.imageUrl),e.setAttribute("alt",t.imageAlt),it(e,"width",t.imageWidth),it(e,"height",t.imageHeight),e.className=$.image,z(e,t,"image")}(e),n=e,t=P(),st(t,n.title||n.titleText),n.title&&mt(n.title,t),n.titleText&&(t.innerText=n.titleText),z(t,n,"title"),n=e,e=R(),_(e,n.closeButtonHtml),z(e,n,"closeButton"),st(e,n.showCloseButton),e.setAttribute("aria-label",n.closeButtonAriaLabel)}function Ut(t,e){var n,o;o=e,n=x(),it(n,"width",o.width),it(n,"padding",o.padding),o.background&&(n.style.background=o.background),Jt(n,o),Et(0,e),Nt(t,e),Ht(t,e),ht(0,e),o=e,t=H(),st(t,o.footer),o.footer&&mt(o.footer,t),z(t,o,"footer"),"function"==typeof e.didRender?e.didRender(x()):"function"==typeof e.onRender&&e.onRender(x())}function _t(){return L()&&L().click()}var Ft=function(){for(var t=n(),e=0;e\n \n
\n
\n '):"error"===e.icon?_(t,'\n \n \n \n \n '):_(t,Zt({question:"?",warning:"!",info:"i"}[e.icon]))},Yt=function(t,e){if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(var n=0,o=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];n').concat(t,"")},Qt=[],Jt=function(t,e){t.className="".concat($.popup," ").concat(wt(t)?e.showClass.popup:""),e.toast?(vt([document.documentElement,document.body],$["toast-shown"]),vt(t,$.toast)):vt(t,$.modal),z(t,e,"popup"),"string"==typeof e.customClass&&vt(t,e.customClass),e.icon&&vt(t,$["icon-".concat(e.icon)])};function $t(t){var e=x();e||Mn.fire(),e=x();var n=I(),o=D();!t&&wt(L())&&(t=L()),rt(n),t&&(at(t),o.setAttribute("data-button-to-replace",t.className)),o.parentNode.insertBefore(o,t),vt([e,n],$.loading),rt(o),e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()}function Xt(){return new Promise(function(t){var e=window.scrollX,n=window.scrollY;ee.restoreFocusTimeout=setTimeout(function(){ee.previousActiveElement&&ee.previousActiveElement.focus?(ee.previousActiveElement.focus(),ee.previousActiveElement=null):document.body&&document.body.focus(),t()},100),void 0!==e&&void 0!==n&&window.scrollTo(e,n)})}function Gt(){if(ee.timeout)return function(){var t=V(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";var n=parseInt(window.getComputedStyle(t).width),n=parseInt(e/n*100);t.style.removeProperty("transition"),t.style.width="".concat(n,"%")}(),ee.timeout.stop()}function te(){if(ee.timeout){var t=ee.timeout.start();return dt(t),t}}var ee={},ne=!1,oe={};function ie(t){for(var e=t.target;e&&e!==document;e=e.parentNode)for(var n in oe){var o=e.getAttribute(n);if(o)return void oe[n].fire({template:o})}}function re(t){return Object.prototype.hasOwnProperty.call(se,t)}function ae(t){return le[t]}function ce(t){for(var e in t)re(o=e)||W('Unknown parameter "'.concat(o,'"')),t.toast&&(n=e,-1!==de.indexOf(n)&&W('The parameter "'.concat(n,'" is incompatible with toasts'))),ae(n=e)&&v(n,ae(n));var n,o}var se={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,onBeforeOpen:void 0,onOpen:void 0,willOpen:void 0,didOpen:void 0,onRender:void 0,didRender:void 0,onClose:void 0,onAfterClose:void 0,willClose:void 0,didClose:void 0,onDestroy:void 0,didDestroy:void 0,scrollbarPadding:!0},ue=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","imageAlt","imageHeight","imageUrl","imageWidth","onAfterClose","onClose","onDestroy","progressSteps","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],le={animation:'showClass" and "hideClass',onBeforeOpen:"willOpen",onOpen:"didOpen",onRender:"didRender",onClose:"willClose",onAfterClose:"didClose",onDestroy:"didDestroy"},de=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","heightAuto","keydownListenerCapture"],pe=Object.freeze({isValidParameter:re,isUpdatableParameter:function(t){return-1!==ue.indexOf(t)},isDeprecatedParameter:ae,argsToParams:function(n){var o={};return"object"!==r(n[0])||C(n[0])?["title","html","icon"].forEach(function(t,e){e=n[e];"string"==typeof e||C(e)?o[t]=e:void 0!==e&&K("Unexpected type of ".concat(t,'! Expected "string" or "Element", got ').concat(r(e)))}):s(o,n[0]),o},isVisible:function(){return wt(x())},clickConfirm:_t,clickDeny:function(){return q()&&q().click()},clickCancel:function(){return j()&&j().click()},getContainer:k,getPopup:x,getTitle:P,getContent:E,getHtmlContainer:function(){return t($["html-container"])},getImage:S,getIcon:B,getIcons:n,getInputLabel:function(){return t($["input-label"])},getCloseButton:R,getActions:I,getConfirmButton:L,getDenyButton:q,getCancelButton:j,getLoader:D,getHeader:M,getFooter:H,getTimerProgressBar:V,getFocusableElements:N,getValidationMessage:T,isLoading:function(){return x().hasAttribute("data-loading")},fire:function(){for(var t=arguments.length,e=new Array(t),n=0;nwindow.innerHeight&&(tt.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(tt.previousBodyPadding+function(){var t=document.createElement("div");t.className=$["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px"))}function he(){return!!window.MSInputMethodContext&&!!document.documentMode}function ge(){var t=k(),e=x();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")}var ve=function(){navigator.userAgent.match(/(CriOS|FxiOS|EdgiOS|YaBrowser|UCBrowser)/i)||x().scrollHeight>window.innerHeight-44&&(k().style.paddingBottom="".concat(44,"px"))},be=function(){var e,t=k();t.ontouchstart=function(t){e=ye(t)},t.ontouchmove=function(t){e&&(t.preventDefault(),t.stopPropagation())}},ye=function(t){var e=t.target,n=k();return!we(t)&&!Ce(t)&&(e===n||!(ut(n)||"INPUT"===e.tagName||ut(E())&&E().contains(e)))},we=function(t){return t.touches&&t.touches.length&&"stylus"===t.touches[0].touchType},Ce=function(t){return t.touches&&1")),kt(t)}function Ie(t){var e=k(),n=x();"function"==typeof t.willOpen?t.willOpen(n):"function"==typeof t.onBeforeOpen&&t.onBeforeOpen(n);var o=window.getComputedStyle(document.body).overflowY;$e(e,n,t),setTimeout(function(){Qe(e,n)},10),U()&&(Je(e,t.scrollbarPadding,o),g(document.body.children).forEach(function(t){t===k()||function(t,e){if("function"==typeof t.contains)return t.contains(e)}(t,k())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))})),G()||ee.previousActiveElement||(ee.previousActiveElement=document.activeElement),Ze(n,t),bt(e,$["no-transition"])}function Me(t){var e=x();t.target===e&&(t=k(),e.removeEventListener(Bt,Me),t.style.overflowY="auto")}function He(t,e){t.closePopup({isConfirmed:!0,value:e})}function Ve(t,e,n){var o=N();if(o.length)return(e+=n)===o.length?e=0:-1===e&&(e=o.length-1),o[e].focus();x().focus()}var Re=["swal-title","swal-html","swal-footer"],Ne=function(t){var n={};return g(t.querySelectorAll("swal-param")).forEach(function(t){Ye(t,["name","value"]);var e=t.getAttribute("name"),t=t.getAttribute("value");"boolean"==typeof se[e]&&"false"===t&&(t=!1),"object"===r(se[e])&&(t=JSON.parse(t)),n[e]=t}),n},Ue=function(t){var n={};return g(t.querySelectorAll("swal-button")).forEach(function(t){Ye(t,["type","color","aria-label"]);var e=t.getAttribute("type");n["".concat(e,"ButtonText")]=t.innerHTML,n["show".concat(m(e),"Button")]=!0,t.hasAttribute("color")&&(n["".concat(e,"ButtonColor")]=t.getAttribute("color")),t.hasAttribute("aria-label")&&(n["".concat(e,"ButtonAriaLabel")]=t.getAttribute("aria-label"))}),n},_e=function(t){var e={},t=t.querySelector("swal-image");return t&&(Ye(t,["src","width","height","alt"]),t.hasAttribute("src")&&(e.imageUrl=t.getAttribute("src")),t.hasAttribute("width")&&(e.imageWidth=t.getAttribute("width")),t.hasAttribute("height")&&(e.imageHeight=t.getAttribute("height")),t.hasAttribute("alt")&&(e.imageAlt=t.getAttribute("alt"))),e},Fe=function(t){var e={},t=t.querySelector("swal-icon");return t&&(Ye(t,["type","color"]),t.hasAttribute("type")&&(e.icon=t.getAttribute("type")),t.hasAttribute("color")&&(e.iconColor=t.getAttribute("color")),e.iconHtml=t.innerHTML),e},ze=function(t){var n={},e=t.querySelector("swal-input");e&&(Ye(e,["type","label","placeholder","value"]),n.input=e.getAttribute("type")||"text",e.hasAttribute("label")&&(n.inputLabel=e.getAttribute("label")),e.hasAttribute("placeholder")&&(n.inputPlaceholder=e.getAttribute("placeholder")),e.hasAttribute("value")&&(n.inputValue=e.getAttribute("value")));t=t.querySelectorAll("swal-input-option");return t.length&&(n.inputOptions={},g(t).forEach(function(t){Ye(t,["value"]);var e=t.getAttribute("value"),t=t.innerHTML;n.inputOptions[e]=t})),n},We=function(t,e){var n,o={};for(n in e){var i=e[n],r=t.querySelector(i);r&&(Ye(r,[]),o[i.replace(/^swal-/,"")]=r.innerHTML)}return o},Ke=function(t){var e=Re.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);g(t.children).forEach(function(t){t=t.tagName.toLowerCase();-1===e.indexOf(t)&&W("Unrecognized element <".concat(t,">"))})},Ye=function(e,n){g(e.attributes).forEach(function(t){-1===n.indexOf(t.name)&&W(['Unrecognized attribute "'.concat(t.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(n.length?"Allowed attributes are: ".concat(n.join(", ")):"To set the value, use HTML within the element.")])})},Ze=function(t,e){"function"==typeof e.didOpen?setTimeout(function(){return e.didOpen(t)}):"function"==typeof e.onOpen&&setTimeout(function(){return e.onOpen(t)})},Qe=function(t,e){Bt&<(e)?(t.style.overflowY="hidden",e.addEventListener(Bt,Me)):t.style.overflowY="auto"},Je=function(t,e,n){var o;(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&1 lastNullIdx) { + xi = nullIdx - 1; + while (xi >= 0 && yVals[xi] == null) + yVals[xi--] = null; + + xi = nullIdx + 1; + while (xi < alignedLen && yVals[xi] == null) + yVals[lastNullIdx = xi++] = null; + } + } +} // nullModes is a tables-matched array indicating how to treat nulls in each series function join(tables, nullModes) { - if (tables.length == 1) { - return { - data: tables[0], - isGap: nullModes ? (u, seriesIdx, dataIdx) => nullModes[0][seriesIdx] != NULL_IGNORE : () => true, - }; - } + if (tables.length == 1) + return tables[0]; let xVals = new Set(); - let xNulls = [new Set()]; for (let ti = 0; ti < tables.length; ti++) { let t = tables[ti]; @@ -359,22 +371,6 @@ function join(tables, nullModes) { for (let i = 0; i < len; i++) xVals.add(xs[i]); - - for (let si = 1; si < t.length; si++) { - let nulls = new Set(); - - // cache original nulls for isGap lookup - if (nullModes == null || nullModes[ti][si] == NULL_GAP || nullModes[ti][si] == NULL_EXPAND) { - let ys = t[si]; - - for (let i = 0; i < len; i++) { - if (ys[i] == null) - nulls.add(xs[i]); - } - } - - xNulls.push(nulls); - } } let data = [Array.from(xVals).sort((a, b) => a - b)]; @@ -386,8 +382,6 @@ function join(tables, nullModes) { for (let i = 0; i < alignedLen; i++) xIdxs.set(data[0][i], i); - let gsi = 1; - for (let ti = 0; ti < tables.length; ti++) { let t = tables[ti]; let xs = t[0]; @@ -395,55 +389,35 @@ function join(tables, nullModes) { for (let si = 1; si < t.length; si++) { let ys = t[si]; - let yVals = Array(alignedLen).fill(null); + let yVals = Array(alignedLen).fill(undefined); - for (let i = 0; i < ys.length; i++) - yVals[xIdxs.get(xs[i])] = ys[i]; + let nullMode = nullModes ? nullModes[ti][si] : NULL_GAP; - // mark all filler nulls as explicit when adjacent to existing explicit nulls (minesweeper) - if (nullModes && nullModes[ti][si] == NULL_EXPAND) { - let nulls = xNulls[gsi]; - let size = nulls.size; - let i = 0; - let xi; + let nullIdxs = []; - let lastAddedX = -inf; + for (let i = 0; i < ys.length; i++) { + let yVal = ys[i]; + let alignedIdx = xIdxs.get(xs[i]); - for (let xVal of nulls.values()) { - if (i++ == size) - break; + if (yVal == null) { + if (nullMode != NULL_IGNORE) { + yVals[alignedIdx] = yVal; - if (xVal > lastAddedX) { - let xIdx = xIdxs.get(xVal); - - xi = xIdx - 1; - while (yVals[xi] === null) { - nulls.add(data[0][xi]); - xi--; - } - - xi = xIdx + 1; - while (yVals[xi] === null) { - nulls.add(lastAddedX = data[0][xi]); - xi++; - } + if (nullMode == NULL_EXPAND) + nullIdxs.push(alignedIdx); } } + else + yVals[alignedIdx] = yVal; } - data.push(yVals); + nullExpand(yVals, nullIdxs, alignedLen); - gsi++; + data.push(yVals); } } - return { - data: data, - isGap(u, seriesIdx, dataIdx) { - let xVal = u._data[0][dataIdx]; - return xNulls[seriesIdx].has(xVal); - }, - }; + return data; } const microTask = typeof queueMicrotask == "undefined" ? fn => Promise.resolve().then(fn) : queueMicrotask; @@ -1122,6 +1096,7 @@ const lineMult = 1.5; // font-size multiplier const xAxisOpts = { show: true, scale: "x", + stroke: hexBlack, space: 50, gap: 5, size: 50, @@ -1235,6 +1210,7 @@ function numSeriesVal(self, val) { const yAxisOpts = { show: true, scale: "y", + stroke: hexBlack, space: 30, gap: 5, size: 50, @@ -1269,7 +1245,8 @@ function seriesPoints(self, si) { function seriesFillTo(self, seriesIdx, dataMin, dataMax) { let scale = self.scales[self.series[seriesIdx].scale]; - return scale.distr == 3 ? scale.min : 0; + let isUpperBandEdge = self.bands && self.bands.some(b => b.series[0] == seriesIdx); + return scale.distr == 3 || isUpperBandEdge ? scale.min : 0; } const ySeriesOpts = { @@ -1279,7 +1256,6 @@ const ySeriesOpts = { show: true, band: false, spanGaps: false, - isGap: (self, seriesIdx, dataIdx) => true, alpha: 1, points: { show: seriesPoints, @@ -1515,8 +1491,6 @@ function linear() { drawAcc = drawAccV; } - const isGap = series.isGap; - const dir = scaleX.dir * (scaleX.ori == 0 ? 1 : -1); const _paths = {stroke: new Path2D(), fill: null, clip: null, band: null}; @@ -1553,7 +1527,7 @@ function linear() { minY = min(outY, minY); maxY = max(outY, maxY); } - else if (!accGaps && isGap(u, seriesIdx, i)) + else if (!accGaps && dataY[i] === null) accGaps = true; } else { @@ -1574,14 +1548,14 @@ function linear() { minY = maxY = outY; // prior pixel can have data but still start a gap if ends with null - if (x - accX > 1 && dataY[i - dir] == null && isGap(u, seriesIdx, i - dir)) + if (x - accX > 1 && dataY[i - dir] === null) _addGap = true; } else { minY = inf; maxY = -inf; - if (!accGaps && isGap(u, seriesIdx, i)) + if (!accGaps && dataY[i] === null) accGaps = true; } @@ -1655,7 +1629,7 @@ function spline(opts) { let xPos = valToPosX(xVal, scaleX, xDim, xOff); if (yVal == null) { - if (series.isGap(u, seriesIdx, i)) { + if (yVal === null) { addGap(gaps, prevXPos, xPos); inGap = true; } @@ -1857,7 +1831,7 @@ function stepped(opts) { let x1 = round(valToPosX(dataX[i], scaleX, xDim, xOff)); if (yVal1 == null) { - if (series.isGap(u, seriesIdx, i)) { + if (yVal1 === null) { addGap(gaps, prevXPos, x1); inGap = true; } @@ -2580,7 +2554,7 @@ function uPlot(opts, data, then) { s.paths = s.paths || linearPath || retNull; s.fillTo = fnOrSelf(s.fillTo || seriesFillTo); - s.stroke = fnOrSelf(s.stroke || hexBlack); + s.stroke = fnOrSelf(s.stroke || null); s.fill = fnOrSelf(s.fill || null); s._stroke = s._fill = s._paths = null; @@ -2654,7 +2628,12 @@ function uPlot(opts, data, then) { axis.incrs = fnOrSelf(axis.incrs || ( sc.distr == 2 ? wholeIncrs : (isTime ? (ms == 1 ? timeIncrsMs : timeIncrsS) : numIncrs))); axis.splits = fnOrSelf(axis.splits || (isTime && sc.distr == 1 ? _timeAxisSplits : sc.distr == 3 ? logAxisSplits : numAxisSplits)); + axis.stroke = fnOrSelf(axis.stroke); + axis.grid.stroke = fnOrSelf(axis.grid.stroke); + axis.ticks.stroke = fnOrSelf(axis.ticks.stroke); + let av = axis.values; + axis.values = ( isTime ? ( isArr(av) ? @@ -2716,11 +2695,6 @@ function uPlot(opts, data, then) { let viaAutoScaleX = false; function setData(_data, _resetScales) { - if (!isArr(_data) && isObj(_data)) { - _data.isGap && series.forEach(s => { s.isGap = _data.isGap; }); - _data = _data.data; - } - _data = _data || []; _data[0] = _data[0] || []; @@ -3081,13 +3055,13 @@ function uPlot(opts, data, then) { ctx.rect(lft, top, wid, hgt); ctx.clip(); - if (clip != null) - ctx.clip(clip); + clip && ctx.clip(clip); - if (!fillBands(si, _fill) && _fill != null) - ctx.fill(fill); + let isUpperEdge = fillBands(si, _fill); - width && ctx.stroke(stroke); + !isUpperEdge && _fill && fill && ctx.fill(fill); + + width && _stroke && stroke && ctx.stroke(stroke); ctx.restore(); @@ -3290,7 +3264,7 @@ function uPlot(opts, data, then) { let x = ori == 1 ? finalPos : 0; ctx.font = axis.font[0]; - ctx.fillStyle = axis.stroke || hexBlack; // rgba? + ctx.fillStyle = axis.stroke(self, i); // rgba? ctx.textAlign = axis.align == 1 ? LEFT : axis.align == 2 ? RIGHT : angle > 0 ? LEFT : @@ -3366,7 +3340,7 @@ function uPlot(opts, data, then) { basePos, tickSize, roundDec(ticks.width * pxRatio, 3), - ticks.stroke, + ticks.stroke(self, i), ticks.dash, ticks.cap, ); @@ -3384,7 +3358,7 @@ function uPlot(opts, data, then) { ori == 0 ? plotTop : plotLft, ori == 0 ? plotHgt : plotWid, roundDec(grid.width * pxRatio, 3), - grid.stroke, + grid.stroke(self, i), grid.dash, grid.cap, ); diff --git a/plugins/uplot/uPlot.esm.js b/plugins/uplot/uPlot.esm.js index 9683e1cd4..ebcaeea32 100644 --- a/plugins/uplot/uPlot.esm.js +++ b/plugins/uplot/uPlot.esm.js @@ -4,7 +4,7 @@ * * uPlot.js (μPlot) * A small, fast chart for time series, lines, areas, ohlc & bars -* https://github.com/leeoniya/uPlot (v1.6.1) +* https://github.com/leeoniya/uPlot (v1.6.3) */ const FEAT_TIME = true; @@ -334,21 +334,33 @@ function assign(targ) { } // nullModes -const NULL_IGNORE = 0; // all nulls are ignored by isGap -const NULL_GAP = 1; // alignment nulls are ignored by isGap (default) -const NULL_EXPAND = 2; // nulls are expand to include adjacent alignment nulls +const NULL_IGNORE = 0; // all nulls are ignored, converted to undefined (e.g. spanGaps: true) +const NULL_GAP = 1; // nulls are retained, alignment artifacts = undefined values (default) +const NULL_EXPAND = 2; // nulls are expanded to include adjacent alignment artifacts (undefined values) + +// mark all filler nulls as explicit when adjacent to existing explicit nulls (minesweeper) +function nullExpand(yVals, nullIdxs, alignedLen) { + for (let i = 0, xi, lastNullIdx = -inf; i < nullIdxs.length; i++) { + let nullIdx = nullIdxs[i]; + + if (nullIdx > lastNullIdx) { + xi = nullIdx - 1; + while (xi >= 0 && yVals[xi] == null) + yVals[xi--] = null; + + xi = nullIdx + 1; + while (xi < alignedLen && yVals[xi] == null) + yVals[lastNullIdx = xi++] = null; + } + } +} // nullModes is a tables-matched array indicating how to treat nulls in each series function join(tables, nullModes) { - if (tables.length == 1) { - return { - data: tables[0], - isGap: nullModes ? (u, seriesIdx, dataIdx) => nullModes[0][seriesIdx] != NULL_IGNORE : () => true, - }; - } + if (tables.length == 1) + return tables[0]; let xVals = new Set(); - let xNulls = [new Set()]; for (let ti = 0; ti < tables.length; ti++) { let t = tables[ti]; @@ -357,22 +369,6 @@ function join(tables, nullModes) { for (let i = 0; i < len; i++) xVals.add(xs[i]); - - for (let si = 1; si < t.length; si++) { - let nulls = new Set(); - - // cache original nulls for isGap lookup - if (nullModes == null || nullModes[ti][si] == NULL_GAP || nullModes[ti][si] == NULL_EXPAND) { - let ys = t[si]; - - for (let i = 0; i < len; i++) { - if (ys[i] == null) - nulls.add(xs[i]); - } - } - - xNulls.push(nulls); - } } let data = [Array.from(xVals).sort((a, b) => a - b)]; @@ -384,8 +380,6 @@ function join(tables, nullModes) { for (let i = 0; i < alignedLen; i++) xIdxs.set(data[0][i], i); - let gsi = 1; - for (let ti = 0; ti < tables.length; ti++) { let t = tables[ti]; let xs = t[0]; @@ -393,55 +387,35 @@ function join(tables, nullModes) { for (let si = 1; si < t.length; si++) { let ys = t[si]; - let yVals = Array(alignedLen).fill(null); + let yVals = Array(alignedLen).fill(undefined); - for (let i = 0; i < ys.length; i++) - yVals[xIdxs.get(xs[i])] = ys[i]; + let nullMode = nullModes ? nullModes[ti][si] : NULL_GAP; - // mark all filler nulls as explicit when adjacent to existing explicit nulls (minesweeper) - if (nullModes && nullModes[ti][si] == NULL_EXPAND) { - let nulls = xNulls[gsi]; - let size = nulls.size; - let i = 0; - let xi; + let nullIdxs = []; - let lastAddedX = -inf; + for (let i = 0; i < ys.length; i++) { + let yVal = ys[i]; + let alignedIdx = xIdxs.get(xs[i]); - for (let xVal of nulls.values()) { - if (i++ == size) - break; + if (yVal == null) { + if (nullMode != NULL_IGNORE) { + yVals[alignedIdx] = yVal; - if (xVal > lastAddedX) { - let xIdx = xIdxs.get(xVal); - - xi = xIdx - 1; - while (yVals[xi] === null) { - nulls.add(data[0][xi]); - xi--; - } - - xi = xIdx + 1; - while (yVals[xi] === null) { - nulls.add(lastAddedX = data[0][xi]); - xi++; - } + if (nullMode == NULL_EXPAND) + nullIdxs.push(alignedIdx); } } + else + yVals[alignedIdx] = yVal; } - data.push(yVals); + nullExpand(yVals, nullIdxs, alignedLen); - gsi++; + data.push(yVals); } } - return { - data: data, - isGap(u, seriesIdx, dataIdx) { - let xVal = u._data[0][dataIdx]; - return xNulls[seriesIdx].has(xVal); - }, - }; + return data; } const microTask = typeof queueMicrotask == "undefined" ? fn => Promise.resolve().then(fn) : queueMicrotask; @@ -1120,6 +1094,7 @@ const lineMult = 1.5; // font-size multiplier const xAxisOpts = { show: true, scale: "x", + stroke: hexBlack, space: 50, gap: 5, size: 50, @@ -1233,6 +1208,7 @@ function numSeriesVal(self, val) { const yAxisOpts = { show: true, scale: "y", + stroke: hexBlack, space: 30, gap: 5, size: 50, @@ -1267,7 +1243,8 @@ function seriesPoints(self, si) { function seriesFillTo(self, seriesIdx, dataMin, dataMax) { let scale = self.scales[self.series[seriesIdx].scale]; - return scale.distr == 3 ? scale.min : 0; + let isUpperBandEdge = self.bands && self.bands.some(b => b.series[0] == seriesIdx); + return scale.distr == 3 || isUpperBandEdge ? scale.min : 0; } const ySeriesOpts = { @@ -1277,7 +1254,6 @@ const ySeriesOpts = { show: true, band: false, spanGaps: false, - isGap: (self, seriesIdx, dataIdx) => true, alpha: 1, points: { show: seriesPoints, @@ -1513,8 +1489,6 @@ function linear() { drawAcc = drawAccV; } - const isGap = series.isGap; - const dir = scaleX.dir * (scaleX.ori == 0 ? 1 : -1); const _paths = {stroke: new Path2D(), fill: null, clip: null, band: null}; @@ -1551,7 +1525,7 @@ function linear() { minY = min(outY, minY); maxY = max(outY, maxY); } - else if (!accGaps && isGap(u, seriesIdx, i)) + else if (!accGaps && dataY[i] === null) accGaps = true; } else { @@ -1572,14 +1546,14 @@ function linear() { minY = maxY = outY; // prior pixel can have data but still start a gap if ends with null - if (x - accX > 1 && dataY[i - dir] == null && isGap(u, seriesIdx, i - dir)) + if (x - accX > 1 && dataY[i - dir] === null) _addGap = true; } else { minY = inf; maxY = -inf; - if (!accGaps && isGap(u, seriesIdx, i)) + if (!accGaps && dataY[i] === null) accGaps = true; } @@ -1653,7 +1627,7 @@ function spline(opts) { let xPos = valToPosX(xVal, scaleX, xDim, xOff); if (yVal == null) { - if (series.isGap(u, seriesIdx, i)) { + if (yVal === null) { addGap(gaps, prevXPos, xPos); inGap = true; } @@ -1855,7 +1829,7 @@ function stepped(opts) { let x1 = round(valToPosX(dataX[i], scaleX, xDim, xOff)); if (yVal1 == null) { - if (series.isGap(u, seriesIdx, i)) { + if (yVal1 === null) { addGap(gaps, prevXPos, x1); inGap = true; } @@ -2578,7 +2552,7 @@ function uPlot(opts, data, then) { s.paths = s.paths || linearPath || retNull; s.fillTo = fnOrSelf(s.fillTo || seriesFillTo); - s.stroke = fnOrSelf(s.stroke || hexBlack); + s.stroke = fnOrSelf(s.stroke || null); s.fill = fnOrSelf(s.fill || null); s._stroke = s._fill = s._paths = null; @@ -2652,7 +2626,12 @@ function uPlot(opts, data, then) { axis.incrs = fnOrSelf(axis.incrs || ( sc.distr == 2 ? wholeIncrs : (isTime ? (ms == 1 ? timeIncrsMs : timeIncrsS) : numIncrs))); axis.splits = fnOrSelf(axis.splits || (isTime && sc.distr == 1 ? _timeAxisSplits : sc.distr == 3 ? logAxisSplits : numAxisSplits)); + axis.stroke = fnOrSelf(axis.stroke); + axis.grid.stroke = fnOrSelf(axis.grid.stroke); + axis.ticks.stroke = fnOrSelf(axis.ticks.stroke); + let av = axis.values; + axis.values = ( isTime ? ( isArr(av) ? @@ -2714,11 +2693,6 @@ function uPlot(opts, data, then) { let viaAutoScaleX = false; function setData(_data, _resetScales) { - if (!isArr(_data) && isObj(_data)) { - _data.isGap && series.forEach(s => { s.isGap = _data.isGap; }); - _data = _data.data; - } - _data = _data || []; _data[0] = _data[0] || []; @@ -3079,13 +3053,13 @@ function uPlot(opts, data, then) { ctx.rect(lft, top, wid, hgt); ctx.clip(); - if (clip != null) - ctx.clip(clip); + clip && ctx.clip(clip); - if (!fillBands(si, _fill) && _fill != null) - ctx.fill(fill); + let isUpperEdge = fillBands(si, _fill); - width && ctx.stroke(stroke); + !isUpperEdge && _fill && fill && ctx.fill(fill); + + width && _stroke && stroke && ctx.stroke(stroke); ctx.restore(); @@ -3288,7 +3262,7 @@ function uPlot(opts, data, then) { let x = ori == 1 ? finalPos : 0; ctx.font = axis.font[0]; - ctx.fillStyle = axis.stroke || hexBlack; // rgba? + ctx.fillStyle = axis.stroke(self, i); // rgba? ctx.textAlign = axis.align == 1 ? LEFT : axis.align == 2 ? RIGHT : angle > 0 ? LEFT : @@ -3364,7 +3338,7 @@ function uPlot(opts, data, then) { basePos, tickSize, roundDec(ticks.width * pxRatio, 3), - ticks.stroke, + ticks.stroke(self, i), ticks.dash, ticks.cap, ); @@ -3382,7 +3356,7 @@ function uPlot(opts, data, then) { ori == 0 ? plotTop : plotLft, ori == 0 ? plotHgt : plotWid, roundDec(grid.width * pxRatio, 3), - grid.stroke, + grid.stroke(self, i), grid.dash, grid.cap, ); diff --git a/plugins/uplot/uPlot.iife.js b/plugins/uplot/uPlot.iife.js index b513b3551..f4128fdce 100644 --- a/plugins/uplot/uPlot.iife.js +++ b/plugins/uplot/uPlot.iife.js @@ -4,7 +4,7 @@ * * uPlot.js (μPlot) * A small, fast chart for time series, lines, areas, ohlc & bars -* https://github.com/leeoniya/uPlot (v1.6.1) +* https://github.com/leeoniya/uPlot (v1.6.3) */ var uPlot = (function () { @@ -336,21 +336,33 @@ var uPlot = (function () { } // nullModes - var NULL_IGNORE = 0; // all nulls are ignored by isGap - var NULL_GAP = 1; // alignment nulls are ignored by isGap (default) - var NULL_EXPAND = 2; // nulls are expand to include adjacent alignment nulls + var NULL_IGNORE = 0; // all nulls are ignored, converted to undefined (e.g. spanGaps: true) + var NULL_GAP = 1; // nulls are retained, alignment artifacts = undefined values (default) + var NULL_EXPAND = 2; // nulls are expanded to include adjacent alignment artifacts (undefined values) + + // mark all filler nulls as explicit when adjacent to existing explicit nulls (minesweeper) + function nullExpand(yVals, nullIdxs, alignedLen) { + for (var i = 0, xi = (void 0), lastNullIdx = -inf; i < nullIdxs.length; i++) { + var nullIdx = nullIdxs[i]; + + if (nullIdx > lastNullIdx) { + xi = nullIdx - 1; + while (xi >= 0 && yVals[xi] == null) + { yVals[xi--] = null; } + + xi = nullIdx + 1; + while (xi < alignedLen && yVals[xi] == null) + { yVals[lastNullIdx = xi++] = null; } + } + } + } // nullModes is a tables-matched array indicating how to treat nulls in each series function join(tables, nullModes) { - if (tables.length == 1) { - return { - data: tables[0], - isGap: nullModes ? (u, seriesIdx, dataIdx) => nullModes[0][seriesIdx] != NULL_IGNORE : () => true, - }; - } + if (tables.length == 1) + { return tables[0]; } var xVals = new Set(); - var xNulls = [new Set()]; for (var ti = 0; ti < tables.length; ti++) { var t = tables[ti]; @@ -359,22 +371,6 @@ var uPlot = (function () { for (var i = 0; i < len; i++) { xVals.add(xs[i]); } - - for (var si = 1; si < t.length; si++) { - var nulls = new Set(); - - // cache original nulls for isGap lookup - if (nullModes == null || nullModes[ti][si] == NULL_GAP || nullModes[ti][si] == NULL_EXPAND) { - var ys = t[si]; - - for (var i$1 = 0; i$1 < len; i$1++) { - if (ys[i$1] == null) - { nulls.add(xs[i$1]); } - } - } - - xNulls.push(nulls); - } } var data = [Array.from(xVals).sort((a, b) => a - b)]; @@ -383,67 +379,45 @@ var uPlot = (function () { var xIdxs = new Map(); - for (var i$2 = 0; i$2 < alignedLen; i$2++) - { xIdxs.set(data[0][i$2], i$2); } - - var gsi = 1; + for (var i$1 = 0; i$1 < alignedLen; i$1++) + { xIdxs.set(data[0][i$1], i$1); } for (var ti$1 = 0; ti$1 < tables.length; ti$1++) { var t$1 = tables[ti$1]; var xs$1 = t$1[0]; - for (var si$1 = 1; si$1 < t$1.length; si$1++) { - var ys$1 = t$1[si$1]; + for (var si = 1; si < t$1.length; si++) { + var ys = t$1[si]; - var yVals = Array(alignedLen).fill(null); + var yVals = Array(alignedLen).fill(undefined); - for (var i$3 = 0; i$3 < ys$1.length; i$3++) - { yVals[xIdxs.get(xs$1[i$3])] = ys$1[i$3]; } + var nullMode = nullModes ? nullModes[ti$1][si] : NULL_GAP; - // mark all filler nulls as explicit when adjacent to existing explicit nulls (minesweeper) - if (nullModes && nullModes[ti$1][si$1] == NULL_EXPAND) { - var nulls$1 = xNulls[gsi]; - var size = nulls$1.size; - var i$4 = 0; - var xi = (void 0); + var nullIdxs = []; - var lastAddedX = -inf; + for (var i$2 = 0; i$2 < ys.length; i$2++) { + var yVal = ys[i$2]; + var alignedIdx = xIdxs.get(xs$1[i$2]); - for (var xVal of nulls$1.values()) { - if (i$4++ == size) - { break; } + if (yVal == null) { + if (nullMode != NULL_IGNORE) { + yVals[alignedIdx] = yVal; - if (xVal > lastAddedX) { - var xIdx = xIdxs.get(xVal); - - xi = xIdx - 1; - while (yVals[xi] === null) { - nulls$1.add(data[0][xi]); - xi--; - } - - xi = xIdx + 1; - while (yVals[xi] === null) { - nulls$1.add(lastAddedX = data[0][xi]); - xi++; - } + if (nullMode == NULL_EXPAND) + { nullIdxs.push(alignedIdx); } } } + else + { yVals[alignedIdx] = yVal; } } - data.push(yVals); + nullExpand(yVals, nullIdxs, alignedLen); - gsi++; + data.push(yVals); } } - return { - data: data, - isGap: function isGap(u, seriesIdx, dataIdx) { - var xVal = u._data[0][dataIdx]; - return xNulls[seriesIdx].has(xVal); - }, - }; + return data; } var microTask = typeof queueMicrotask == "undefined" ? fn => Promise.resolve().then(fn) : queueMicrotask; @@ -1123,6 +1097,7 @@ var uPlot = (function () { var xAxisOpts = { show: true, scale: "x", + stroke: hexBlack, space: 50, gap: 5, size: 50, @@ -1236,6 +1211,7 @@ var uPlot = (function () { var yAxisOpts = { show: true, scale: "y", + stroke: hexBlack, space: 30, gap: 5, size: 50, @@ -1270,7 +1246,8 @@ var uPlot = (function () { function seriesFillTo(self, seriesIdx, dataMin, dataMax) { var scale = self.scales[self.series[seriesIdx].scale]; - return scale.distr == 3 ? scale.min : 0; + var isUpperBandEdge = self.bands && self.bands.some(b => b.series[0] == seriesIdx); + return scale.distr == 3 || isUpperBandEdge ? scale.min : 0; } var ySeriesOpts = { @@ -1280,7 +1257,6 @@ var uPlot = (function () { show: true, band: false, spanGaps: false, - isGap: (self, seriesIdx, dataIdx) => true, alpha: 1, points: { show: seriesPoints, @@ -1516,8 +1492,6 @@ var uPlot = (function () { drawAcc = drawAccV; } - var isGap = series.isGap; - var dir = scaleX.dir * (scaleX.ori == 0 ? 1 : -1); var _paths = {stroke: new Path2D(), fill: null, clip: null, band: null}; @@ -1554,7 +1528,7 @@ var uPlot = (function () { minY = min(outY, minY); maxY = max(outY, maxY); } - else if (!accGaps && isGap(u, seriesIdx, i)) + else if (!accGaps && dataY[i] === null) { accGaps = true; } } else { @@ -1575,14 +1549,14 @@ var uPlot = (function () { minY = maxY = outY; // prior pixel can have data but still start a gap if ends with null - if (x - accX > 1 && dataY[i - dir] == null && isGap(u, seriesIdx, i - dir)) + if (x - accX > 1 && dataY[i - dir] === null) { _addGap = true; } } else { minY = inf; maxY = -inf; - if (!accGaps && isGap(u, seriesIdx, i)) + if (!accGaps && dataY[i] === null) { accGaps = true; } } @@ -1656,7 +1630,7 @@ var uPlot = (function () { var xPos = valToPosX(xVal, scaleX, xDim, xOff); if (yVal == null) { - if (series.isGap(u, seriesIdx, i)) { + if (yVal === null) { addGap(gaps, prevXPos, xPos); inGap = true; } @@ -1851,7 +1825,7 @@ var uPlot = (function () { var x1 = round(valToPosX(dataX[i], scaleX, xDim, xOff)); if (yVal1 == null) { - if (series.isGap(u, seriesIdx, i)) { + if (yVal1 === null) { addGap(gaps, prevXPos, x1); inGap = true; } @@ -2578,7 +2552,7 @@ var uPlot = (function () { s.paths = s.paths || linearPath || retNull; s.fillTo = fnOrSelf(s.fillTo || seriesFillTo); - s.stroke = fnOrSelf(s.stroke || hexBlack); + s.stroke = fnOrSelf(s.stroke || null); s.fill = fnOrSelf(s.fill || null); s._stroke = s._fill = s._paths = null; @@ -2652,7 +2626,12 @@ var uPlot = (function () { axis.incrs = fnOrSelf(axis.incrs || ( sc.distr == 2 ? wholeIncrs : (isTime ? (ms == 1 ? timeIncrsMs : timeIncrsS) : numIncrs))); axis.splits = fnOrSelf(axis.splits || (isTime && sc.distr == 1 ? _timeAxisSplits : sc.distr == 3 ? logAxisSplits : numAxisSplits)); + axis.stroke = fnOrSelf(axis.stroke); + axis.grid.stroke = fnOrSelf(axis.grid.stroke); + axis.ticks.stroke = fnOrSelf(axis.ticks.stroke); + var av = axis.values; + axis.values = ( isTime ? ( isArr(av) ? @@ -2717,11 +2696,6 @@ var uPlot = (function () { var viaAutoScaleX = false; function setData(_data, _resetScales) { - if (!isArr(_data) && isObj(_data)) { - _data.isGap && series.forEach(s => { s.isGap = _data.isGap; }); - _data = _data.data; - } - _data = _data || []; _data[0] = _data[0] || []; @@ -3087,13 +3061,13 @@ var uPlot = (function () { ctx.rect(lft, top, wid, hgt); ctx.clip(); - if (clip != null) - { ctx.clip(clip); } + clip && ctx.clip(clip); - if (!fillBands(si, _fill) && _fill != null) - { ctx.fill(fill); } + var isUpperEdge = fillBands(si, _fill); - width && ctx.stroke(stroke); + !isUpperEdge && _fill && fill && ctx.fill(fill); + + width && _stroke && stroke && ctx.stroke(stroke); ctx.restore(); @@ -3301,7 +3275,7 @@ var uPlot = (function () { var x = ori == 1 ? finalPos : 0; ctx.font = axis.font[0]; - ctx.fillStyle = axis.stroke || hexBlack; // rgba? + ctx.fillStyle = axis.stroke(self, i); // rgba? ctx.textAlign = axis.align == 1 ? LEFT : axis.align == 2 ? RIGHT : angle > 0 ? LEFT : @@ -3377,7 +3351,7 @@ var uPlot = (function () { basePos, tickSize, roundDec(ticks.width * pxRatio, 3), - ticks.stroke, + ticks.stroke(self, i), ticks.dash, ticks.cap ); @@ -3395,7 +3369,7 @@ var uPlot = (function () { ori == 0 ? plotTop : plotLft, ori == 0 ? plotHgt : plotWid, roundDec(grid.width * pxRatio, 3), - grid.stroke, + grid.stroke(self, i), grid.dash, grid.cap ); diff --git a/plugins/uplot/uPlot.iife.min.js b/plugins/uplot/uPlot.iife.min.js index ad31b6992..efc318d93 100644 --- a/plugins/uplot/uPlot.iife.min.js +++ b/plugins/uplot/uPlot.iife.min.js @@ -1,2 +1,2 @@ -/*! https://github.com/leeoniya/uPlot (v1.6.1) */ -var uPlot=function(){"use strict";function n(n,e,r,t){var l;r=r||0;for(var a=2147483647>=(t=t||e.length-1);t-r>1;)n>e[l=a?r+t>>1:h((r+t)/2)]?r=l:t=l;return n-e[r]>e[t]-n?t:r}function e(n,e,r,t){for(var l=1==t?e:r;l>=e&&r>=l;l+=t)if(null!=n[l])return l;return-1}var r=[0,0];function t(n,e,t,l){return r[0]=0>t?W(n,-t):n,r[1]=0>l?W(e,-l):e,r}function l(n,e,r,l){var a,i,o,s=10==r?b:_;return n==e&&(n/=r,e*=r),l?(a=h(s(n)),i=m(s(e)),n=(o=t(w(r,a),w(r,i),a,i))[0],e=o[1]):(a=h(s(n)),i=h(s(e)),n=P(n,(o=t(w(r,a),w(r,i),a,i))[0]),e=E(e,o[1])),[n,e]}var a={pad:0,soft:null,mode:0},i={min:a,max:a};function o(n,e,r,t){return N(r)?u(n,e,r):(a.pad=r,a.soft=t?0:null,a.mode=t?3:0,u(n,e,i))}function s(n,e){return null==n?e:n}function u(n,e,r){var t=r.min,l=r.max,a=s(t.pad,0),i=s(l.pad,0),o=s(t.hard,-y),u=s(l.hard,y),f=s(t.soft,y),c=s(l.soft,-y),d=s(t.mode,0),m=s(l.mode,0),x=e-n,_=x||v(e)||1e3,k=b(_),M=w(10,h(k)),S=W(P(n-_*(0==x?0==n?.1:1:a),M/10),6),z=f>n||1!=d&&(3!=d||S>f)&&(2!=d||f>S)?y:f,T=g(o,z>S&&n>=z?z:p(z,S)),D=W(E(e+_*(0==x?0==e?.1:1:i),M/10),6),Y=e>c||1!=m&&(3!=m||c>D)&&(2!=m||D>c)?-y:c,C=p(u,D>Y&&Y>=e?Y:g(Y,D));return T==C&&0==T&&(C=100),[T,C]}var f=new Intl.NumberFormat(navigator.language).format,c=Math,v=c.abs,h=c.floor,d=c.round,m=c.ceil,p=c.min,g=c.max,w=c.pow,x=c.sqrt,b=c.log10,_=c.log2,k=c.PI,y=1/0;function M(n,e){return d(n/e)*e}function S(n,e,r){return p(g(n,e),r)}function z(n){return"function"==typeof n?n:()=>n}var T=(n,e)=>e,D=()=>null;function E(n,e){return m(n/e)*e}function P(n,e){return h(n/e)*e}function W(n,e){return d(n*(e=Math.pow(10,e)))/e}var Y=new Map;function C(n){return((""+n).split(".")[1]||"").length}function A(n,e,r,t){for(var l=[],a=t.map(C),i=e;r>i;i++)for(var o=v(i),s=W(w(n,i),o),u=0;t.length>u;u++){var f=t[u]*s,c=(0>f||0>i?o:0)+(a[u]>i?a[u]:0),h=W(f,c);l.push(h),Y.set(h,c)}return l}var H={},F=Array.isArray;function G(n){return"string"==typeof n}function N(n){var e=!1;if(null!=n){var r=n.constructor;e=null==r||r==Object}return e}function I(n){var e;if(F(n))e=n.map(I);else if(N(n))for(var r in e={},n)e[r]=I(n[r]);else e=n;return e}function L(n){for(var e=arguments,r=1;e.length>r;r++){var t=e[r];for(var l in t)N(n[l])?L(n[l],I(t[l])):n[l]=I(t[l])}return n}var V="undefined"==typeof queueMicrotask?n=>Promise.resolve().then(n):queueMicrotask,O="width",j="height",B="top",R="bottom",U="left",J="right",q="#000",Z="#0000",X="mousemove",K="mousedown",Q="mouseup",$="mouseenter",nn="mouseleave",en="dblclick",rn="resize",tn="scroll",ln="u-off",an="u-label",on=document,sn=window,un=devicePixelRatio;function fn(n,e){null!=e&&n.classList.add(e)}function cn(n,e){n.classList.remove(e)}function vn(n,e,r){n.style[e]=r+"px"}function hn(n,e,r,t){var l=on.createElement(n);return null!=e&&fn(l,e),null!=r&&r.insertBefore(l,t),l}function dn(n,e){return hn("div",n,e)}function mn(n,e,r,t,l){n.style.transform="translate("+e+"px,"+r+"px)",0>e||0>r||e>t||r>l?fn(n,ln):cn(n,ln)}var pn={passive:!0};function gn(n,e,r){e.addEventListener(n,r,pn)}function wn(n,e,r){e.removeEventListener(n,r,pn)}var xn=["January","February","March","April","May","June","July","August","September","October","November","December"],bn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function _n(n){return n.slice(0,3)}var kn=bn.map(_n),yn=xn.map(_n),Mn={MMMM:xn,MMM:yn,WWWW:bn,WWW:kn};function Sn(n){return(10>n?"0":"")+n}var zn={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,e)=>e.MMMM[n.getMonth()],MMM:(n,e)=>e.MMM[n.getMonth()],MM:n=>Sn(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>Sn(n.getDate()),D:n=>n.getDate(),WWWW:(n,e)=>e.WWWW[n.getDay()],WWW:(n,e)=>e.WWW[n.getDay()],HH:n=>Sn(n.getHours()),H:n=>n.getHours(),h:n=>{var e=n.getHours();return 0==e?12:e>12?e-12:e},AA:n=>12>n.getHours()?"AM":"PM",aa:n=>12>n.getHours()?"am":"pm",a:n=>12>n.getHours()?"a":"p",mm:n=>Sn(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>Sn(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>function(n){return(10>n?"00":100>n?"0":"")+n}(n.getMilliseconds())};function Tn(n,e){e=e||Mn;for(var r,t=[],l=/\{([a-z]+)\}|[^{]+/gi;r=l.exec(n);)t.push("{"==r[0][0]?zn[r[1]]:r[0]);return n=>{for(var r="",l=0;t.length>l;l++)r+="string"==typeof t[l]?t[l]:t[l](n,e);return r}}var Dn=(new Intl.DateTimeFormat).resolvedOptions().timeZone,En=n=>n%1==0,Pn=[1,2,2.5,5],Wn=A(10,-16,0,Pn),Yn=A(10,0,16,Pn),Cn=Yn.filter(En),An=Wn.concat(Yn),Hn="{YYYY}",Fn="\n"+Hn,Gn="{M}/{D}",Nn="\n"+Gn,In=Nn+"/{YY}",Ln="{aa}",Vn="{h}:{mm}"+Ln,On="\n"+Vn,jn=":{ss}",Bn=null;function Rn(n){var e=1e3*n,r=60*e,t=60*r,l=24*t,a=30*l,i=365*l;return[(1==n?A(10,0,3,Pn).filter(En):A(10,-3,0,Pn)).concat([e,5*e,10*e,15*e,30*e,r,5*r,10*r,15*r,30*r,t,2*t,3*t,4*t,6*t,8*t,12*t,l,2*l,3*l,4*l,5*l,6*l,7*l,8*l,9*l,10*l,15*l,a,2*a,3*a,4*a,6*a,i,2*i,5*i,10*i,25*i,50*i,100*i]),[[i,Hn,Bn,Bn,Bn,Bn,Bn,Bn,1],[28*l,"{MMM}",Fn,Bn,Bn,Bn,Bn,Bn,1],[l,Gn,Fn,Bn,Bn,Bn,Bn,Bn,1],[t,"{h}"+Ln,In,Bn,Nn,Bn,Bn,Bn,1],[r,Vn,In,Bn,Nn,Bn,Bn,Bn,1],[e,jn,In+" "+Vn,Bn,Nn+" "+Vn,Bn,On,Bn,1],[n,jn+".{fff}",In+" "+Vn,Bn,Nn+" "+Vn,Bn,On,Bn,1]],function(e){return(o,s,u,f,c,v)=>{var d=[],m=c>=i,p=c>=a&&i>c,g=e(u),w=g*n,x=re(g.getFullYear(),m?0:g.getMonth(),p||m?1:g.getDate()),b=x*n;if(p||m)for(var _=p?c/a:0,k=m?c/i:0,y=w==b?w:re(x.getFullYear()+k,x.getMonth()+_,1)*n,M=new Date(y/n),S=M.getFullYear(),z=M.getMonth(),T=0;f>=y;T++){var D=re(S+k*T,z+_*T,1);(y=(+D+(D-e(D*n)))*n)>f||d.push(y)}else{var P=l>c?c:l,Y=b+(h(u)-h(w))+E(w-b,P);d.push(Y);for(var C=e(Y),A=C.getHours()+C.getMinutes()/r+C.getSeconds()/t,H=c/t,F=v/o.axes[s]._space;(Y=W(Y+c,1==n?0:3))<=f;)if(H>1){var G=h(W(A+H,6))%24,N=e(Y).getHours()-G;N>1&&(N=-1),A=(A+H)%24,.7>W(((Y-=N*t)-d[d.length-1])/c,3)*F||d.push(Y)}else d.push(Y)}return d}}]}var Un=Rn(1),Jn=Un[0],qn=Un[1],Zn=Un[2],Xn=Rn(.001),Kn=Xn[0],Qn=Xn[1],$n=Xn[2];function ne(n,e){return n.map((n=>n.map(((r,t)=>0==t||8==t||null==r?r:e(1==t||0==n[8]?r:n[1]+r)))))}function ee(n,e){return(r,t,l,a,i)=>{var o,s,u,f,c,v,h=e.find((n=>i>=n[0]))||e[e.length-1];return t.map((e=>{var r=n(e),t=r.getFullYear(),l=r.getMonth(),a=r.getDate(),i=r.getHours(),d=r.getMinutes(),m=r.getSeconds(),p=t!=o&&h[2]||l!=s&&h[3]||a!=u&&h[4]||i!=f&&h[5]||d!=c&&h[6]||m!=v&&h[7]||h[1];return o=t,s=l,u=a,f=i,c=d,v=m,p(r)}))}}function re(n,e,r){return new Date(n,e,r)}function te(n,e){return e(n)}function le(n,e){return(r,t)=>e(n(t))}function ae(n,e){var r=n.series[e];return r.width?r.stroke(n,e):r.points.width?r.points.stroke(n,e):null}function ie(n,e){return n.series[e].fill(n,e)}A(2,-53,53,[1]);var oe=[0,0];function se(n,e,r){return n=>{0==n.button&&r(n)}}function ue(n,e,r){return r}var fe={show:!0,x:!0,y:!0,lock:!1,move:function(n,e,r){return oe[0]=e,oe[1]=r,oe},points:{show:function(n,e){var r=n.cursor.points,t=dn(),l=r.stroke(n,e),a=r.fill(n,e);t.style.background=a||l;var i=r.size(n,e),o=r.width(n,e,i);o&&(t.style.border=o+"px solid "+l);var s=i/-2;return vn(t,O,i),vn(t,j,i),vn(t,"marginLeft",s),vn(t,"marginTop",s),t},size:function(n,e){return Te(n.series[e].width,1)},width:0,stroke:function(n,e){return n.series[e].stroke(n,e)},fill:function(n,e){return n.series[e].stroke(n,e)}},bind:{mousedown:se,mouseup:se,click:se,dblclick:se,mousemove:ue,mouseleave:ue,mouseenter:ue},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,_x:!1,_y:!1},focus:{prox:-1},left:-10,top:-10,idx:null,dataIdx:function(n,e,r){return r}},ce={show:!0,stroke:"rgba(0,0,0,0.07)",width:2,filter:T},ve=L({},ce,{size:10}),he='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',de="bold "+he,me={show:!0,scale:"x",space:50,gap:5,size:50,labelSize:30,labelFont:de,side:2,grid:ce,ticks:ve,font:he,rotate:0},pe={show:!0,scale:"x",auto:!1,sorted:1,min:y,max:-y,idxs:[]};function ge(n,e){return e.map((n=>null==n?"":f(n)))}function we(n,e,r,t,l,a,i){for(var o=[],s=Y.get(l)||0,u=r=i?r:W(E(r,l),s);t>=u;u=W(u+l,s))o.push(Object.is(u,-0)?0:u);return o}function xe(n,e,r,t,l){var a=[],i=n.scales[n.axes[e].scale].log,o=h((10==i?b:_)(r));l=w(i,o),0>o&&(l=W(l,-o));var s=r;do{a.push(s),l*i>(s=W(s+l,Y.get(l)))||(l=s)}while(t>=s);return a}var be=/./,_e=/[12357]/,ke=/[125]/,ye=/1/;function Me(n,e,r){var t=n.axes[r],l=t.scale;if(2==n.scales[l].log)return e;var a=n.valToPos,i=t._space,o=a(10,l),s=a(9,l)-os.test(n)?n:null))}function Se(n,e){return null==e?"":f(e)}var ze={show:!0,scale:"y",space:30,gap:5,size:50,labelSize:30,labelFont:de,side:3,grid:ce,ticks:ve,font:he,rotate:0};function Te(n,e){return W((3+2*(n||1))*e,3)}function De(n,e){var r=n.scales[n.series[e].scale];return 3==r.distr?r.min:0}var Ee={scale:"y",auto:!0,sorted:0,show:!0,band:!1,spanGaps:!1,isGap:()=>!0,alpha:1,points:{show:function(n,e){var r=n.series[0].idxs;return(0==n.scales[n.series[0].scale].ori?n.bbox.width:n.bbox.height)/(n.series[e].points.space*un)>=r[1]-r[0]}},values:null,min:y,max:-y,idxs:[],path:null,clip:null};function Pe(n,e,r){return r/10}var We={time:!0,auto:!0,distr:1,log:10,min:null,max:null,dir:1,ori:0},Ye=L({},We,{time:!1,ori:1}),Ce={};function Ae(){var n=[];return{sub:function(e){n.push(e)},unsub:function(e){n=n.filter((n=>n!=e))},pub:function(e,r,t,l,a,i,o){n.length>1&&n.forEach((n=>{n!=r&&n.pub(e,r,t,l,a,i,o)}))}}}function He(n,e,r){var t=n.series[e],l=n.scales,a=n.bbox,i=n._data[0],o=n._data[e],s=l[n.series[0].scale],u=l[t.scale],f=a.left,c=a.top,v=a.width,h=a.height,d=n.valToPosH,m=n.valToPosV;return 0==s.ori?r(t,i,o,s,u,d,m,f,c,v,h,Ie,Ve,je,Re,Je):r(t,i,o,s,u,m,d,c,f,h,v,Le,Oe,Be,Ue,qe)}function Fe(n,e,r,t,l){return He(n,e,((n,e,a,i,o,s,u,f,c,v,h)=>{var d,m,p=0==i.ori?Ve:Oe;1==i.dir*(0==i.ori?1:-1)?(d=r,m=t):(d=t,m=r);var g=M(s(e[d],i,v,f),.5),w=M(u(a[d],o,h,c),.5),x=M(s(e[m],i,v,f),.5),b=M(u(o.max,o,h,c),.5),_=new Path2D(l);return p(_,x,b),p(_,g,b),p(_,g,w),_}))}function Ge(n,e,r,t,l,a){var i=null;if(n.length>0){i=new Path2D;for(var o=0==e?je:Be,s=r,u=0;n.length>u;u++){var f=n[u];o(i,s,t,f[0]-s,t+a),s=f[1]}o(i,s,t,r+l-s,t+a)}return i}function Ne(n,e,r){if(r>e){var t=n[n.length-1];t&&t[0]==e?t[1]=r:n.push([e,r])}}function Ie(n,e,r){n.moveTo(e,r)}function Le(n,e,r){n.moveTo(r,e)}function Ve(n,e,r){n.lineTo(e,r)}function Oe(n,e,r){n.lineTo(r,e)}function je(n,e,r,t,l){n.rect(e,r,t,l)}function Be(n,e,r,t,l){n.rect(r,e,l,t)}function Re(n,e,r,t,l,a){n.arc(e,r,t,l,a)}function Ue(n,e,r,t,l,a){n.arc(r,e,t,l,a)}function Je(n,e,r,t,l,a,i){n.bezierCurveTo(e,r,t,l,a,i)}function qe(n,e,r,t,l,a,i){n.bezierCurveTo(r,e,l,t,i,a)}function Ze(n){return(e,r,t,l,a)=>{n(e,r,t),n(e,r,l),n(e,r,a)}}var Xe=Ze(Ve),Ke=Ze(Oe);function Qe(){return(n,r,t,l)=>He(n,r,((a,i,o,s,u,f,c,v,h,m,w)=>{var x,b;0==s.ori?(x=Ve,b=Xe):(x=Oe,b=Ke);var _,k,S,z=a.isGap,T=s.dir*(0==s.ori?1:-1),D={stroke:new Path2D,fill:null,clip:null,band:null},E=D.stroke,P=y,W=-y,Y=[],C=d(f(i[1==T?t:l],s,m,v)),A=!1,H=e(o,t,l,1*T),F=e(o,t,l,-1*T),G=M(f(i[H],s,m,v),.5),N=M(f(i[F],s,m,v),.5);G>v&&Ne(Y,v,G);for(var I=1==T?t:l;I>=t&&l>=I;I+=T){var L=d(f(i[I],s,m,v));if(L==C)null!=o[I]?(_=d(c(o[I],u,w,h)),P==y&&x(E,L,_),P=p(_,P),W=g(_,W)):!A&&z(n,r,I)&&(A=!0);else{var V=!1;P!=y?(b(E,C,P,W,_),k=S=C):A&&(V=!0,A=!1),null!=o[I]?(x(E,L,_=d(c(o[I],u,w,h))),P=W=_,L-C>1&&null==o[I-T]&&z(n,r,I-T)&&(V=!0)):(P=y,W=-y,!A&&z(n,r,I)&&(A=!0)),V&&Ne(Y,k,L),C=L}}if(P!=y&&P!=W&&S!=C&&b(E,C,P,W,_),v+m>N&&Ne(Y,N,v+m),null!=a.fill){var O=D.fill=new Path2D(E),j=d(c(a.fillTo(n,r,a.min,a.max),u,w,h));x(O,N,j),x(O,G,j)}return a.spanGaps||(D.clip=Ge(Y,s.ori,v,h,m,w)),n.bands.length>0&&(D.band=Fe(n,r,t,l,E)),D}))}function $e(n,e,r,t,l){var a,i,o,s,u,f,c,v,h,m,p,g,b,_,k,y,M,S,z,T,D,E,P,W,Y,C=new Path2D,A=n.length;t(C,d(n[0]),d(e[0]));for(var H=0;A-1>H;H++){var F=0==H?0:H-1;i=e[F],s=e[H],u=n[H+1],f=e[H+1],A>H+2?(c=n[H+2],v=e[H+2]):(c=u,v=f),b=x(w((a=n[F])-(o=n[H]),2)+w(i-s,2)),_=x(w(o-u,2)+w(s-f,2)),k=x(w(u-c,2)+w(f-v,2)),T=w(k,r),E=w(k,2*r),D=w(_,r),P=w(_,2*r),(S=3*(Y=w(b,r))*(Y+D))>0&&(S=1/S),(z=3*T*(T+D))>0&&(z=1/z),m=(-P*i+(y=2*(W=w(b,2*r))+3*Y*D+P)*s+W*f)*S,g=(E*s+(M=2*E+3*T*D+P)*f-P*v)*z,0==(h=(-P*a+y*o+W*u)*S)&&0==m&&(h=o,m=s),0==(p=(E*o+M*u-P*c)*z)&&0==g&&(p=u,g=f),l(C,h,m,p,g,u,f)}return C}var nr=Qe();function er(n,e,r,t){return(t?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map(((n,t)=>rr(n,t,e,r)))}function rr(n,e,r,t){return L({},0==e?r:t,n)}var tr=[null,null];function lr(n,e,r){return null==e?tr:[e,r]}var ar=lr;function ir(n,e,r){return null==e?tr:o(e,r,.1,!0)}function or(n,e,r,t){return null==e?tr:l(e,r,n.scales[t].log,!1)}var sr=or;function ur(n){var e;return[n=n.replace(/(\d+)px/,((n,r)=>(e=d(r*un))+"px")),e]}function fr(e,r,t){var a={};function i(n,e){return 3==e.distr?b((n>0?n:e.clamp(a,n,e.min,e.max,e.key))/e.min)/b(e.max/e.min):(n-e.min)/(e.max-e.min)}function u(n,e,r,t){var l=i(n,e);return t+r*(-1==e.dir?1-l:l)}function f(n,e,r,t){var l=i(n,e);return t+r*(-1==e.dir?l:1-l)}function c(n,e,r,t){return 0==e.ori?u(n,e,r,t):f(n,e,r,t)}a.valToPosH=u,a.valToPosV=f;var x=!1;a.status=0;var _=a.root=dn("uplot");null!=e.id&&(_.id=e.id),fn(_,e.class),e.title&&(dn("u-title",_).textContent=e.title);var P=hn("canvas"),C=a.ctx=P.getContext("2d"),A=dn("u-wrap",_),pn=dn("u-under",A);A.appendChild(P);var xn=dn("u-over",A);((e=I(e)).plugins||[]).forEach((n=>{n.opts&&(e=n.opts(a,e)||e)}));var bn=e.ms||.001,_n=a.series=er(e.series||[],pe,Ee,!1),kn=a.axes=er(e.axes||[],me,ze,!0),yn=a.scales={},Mn=a.bands=e.bands||[];Mn.forEach((n=>{n.fill=z(n.fill||null)}));var Sn=_n[0].scale,zn={axes:function(){kn.forEach(((n,e)=>{if(n.show&&n._show){var r=yn[n.scale],t=n.side,l=t%2,i=0==l?je:Be,o=0==l?Ve:Oe,s=d(n.gap*un),u=n.ticks,f=u.show?d(u.size*un):0,v=n._found,h=v[0],m=v[1],p=n._splits,g=2==r.distr?p.map((n=>Mr[n])):p,w=2==r.distr?Mr[p[1]]-Mr[p[0]]:h,x=n._rotate*-k/180,b=d(n._pos*un),_=b+(f+s)*(0==l&&0==t||1==l&&3==t?-1:1),y=0==l?_:0,M=1==l?_:0;C.font=n.font[0],C.fillStyle=n.stroke||q,C.textAlign=1==n.align?U:2==n.align?J:x>0?U:0>x?J:0==l?"center":3==t?J:U,C.textBaseline=x||1==l?"middle":2==t?B:R;var S=1.5*n.font[1],z=p.map((n=>d(c(n,r,i,o))));if(n._values.forEach(((n,e)=>{null!=n&&(0==l?M=z[e]:y=z[e],(""+n).split(/\n/gm).forEach(((n,e)=>{x?(C.save(),C.translate(M,y+e*S),C.rotate(x),C.fillText(n,0,0),C.restore()):C.fillText(n,M,y+e*S)})))})),n.label){C.save();var T=d(n._lpos*un);1==l?(M=y=0,C.translate(T,d(Oe+Be/2)),C.rotate((3==t?-k:k)/2)):(M=d(Ve+je/2),y=T),C.font=n.labelFont[0],C.textAlign="center",C.textBaseline=2==t?B:R,C.fillText(n.label,M,y),C.restore()}u.show&&Er(z,u.filter(a,g,e,m,w),l,t,b,f,W(u.width*un,3),u.stroke,u.dash,u.cap);var D=n.grid;D.show&&Er(z,D.filter(a,g,e,m,w),l,0==l?2:1,0==l?Oe:Ve,0==l?Be:je,W(D.width*un,3),D.stroke,D.dash,D.cap)}})),zt("drawAxes")},series:function(){wr>0&&(_n.forEach(((n,e)=>{if(e>0&&n.show&&null==n._paths){var t=function(n){for(var e=S(_r-1,0,wr-1),r=S(kr+1,0,wr-1);null==n[e]&&e>0;)e--;for(;null==n[r]&&wr-1>r;)r++;return[e,r]}(r[e]);n._paths=n.paths(a,e,t[0],t[1])}})),_n.forEach(((n,e)=>{e>0&&n.show&&(n._paths&&function(n){var e=_n[n],r=e._paths,t=r.stroke,l=r.fill,i=r.clip,o=W(e.width*un,3),s=o%2/2,u=e._stroke=e.stroke(a,n),f=e._fill=e.fill(a,n);Dr(u,o,e.dash,e.cap,f),C.globalAlpha=e.alpha,C.translate(s,s),C.save();var c=Ve,v=Oe,h=je,d=Be,m=o*un/2;0==e.min&&(d+=m),0==e.max&&(v-=m,d+=m),C.beginPath(),C.rect(c,v,h,d),C.clip(),null!=i&&C.clip(i),function(n,e){var r=!1,t=_n[n];return Mn.forEach(((l,i)=>{if(l.series[0]==n){r=!0;var o=_n[l.series[1]],s=(o._paths||H).band;o.show&&s&&(C.save(),Dr(null,null,null,null,l.fill(a,i)||e),C.clip(s),C.fill(t._paths.fill),C.restore())}})),r}(n,f)||null==f||C.fill(l),o&&C.stroke(t),C.restore(),C.translate(-s,-s),C.globalAlpha=1}(e),n.points.show(a,e,_r,kr)&&function(n){var e=_n[n],t=e.points,l=W(t.width*un,3),i=l%2/2,o=t.width>0,s=(t.size-t.width)/2*un,u=W(2*s,3);C.translate(i,i),C.save(),C.beginPath(),C.rect(Ve-u,Oe-u,je+2*u,Be+2*u),C.clip(),C.globalAlpha=e.alpha;var f,c,v,h,m=new Path2D,p=yn[e.scale];0==Gn.ori?(f=je,c=Ve,v=Be,h=Oe):(f=Be,c=Oe,v=je,h=Ve);for(var g=_r;kr>=g;g++)if(null!=r[n][g]){var w=d(Wn(r[0][g],Gn,f,c)),x=d(Yn(r[n][g],p,v,h));Hn(m,w+s,x),Fn(m,w,x,s,0,2*k)}var b=t._stroke=t.stroke(a,n),_=t._fill=t.fill(a,n);Dr(b,l,t.dash,t.cap,_||(o?"#fff":e._stroke)),C.fill(m),o&&C.stroke(m),C.globalAlpha=1,C.restore(),C.translate(-i,-i)}(e),zt("drawSeries",e))})))}},Dn=(e.drawOrder||["axes","series"]).map((n=>zn[n]));function En(n){var r=yn[n];if(null==r){var t=(e.scales||H)[n]||H;if(null!=t.from)En(t.from),yn[n]=L({},yn[t.from],t);else{(r=yn[n]=L({},n==Sn?We:Ye,t)).key=n;var l=r.time,a=3==r.distr,i=r.range;if(n!=Sn&&!F(i)&&N(i)){var s=i;i=(n,e,r)=>null==e?tr:o(e,r,s)}r.range=z(i||(l?ar:n==Sn?a?sr:lr:a?or:ir)),r.auto=z(r.auto),r.clamp=z(r.clamp||Pe)}}}for(var Pn in En("x"),En("y"),_n.forEach((n=>{En(n.scale)})),kn.forEach((n=>{En(n.scale)})),e.scales)En(Pn);var Wn,Yn,Hn,Fn,Gn=yn[Sn],Nn=Gn.distr;0==Gn.ori?(fn(_,"u-hz"),Wn=u,Yn=f,Hn=Ie,Fn=Re):(fn(_,"u-vt"),Wn=f,Yn=u,Hn=Le,Fn=Ue);var In={};for(var Ln in yn){var Vn=yn[Ln];null==Vn.min&&null==Vn.max||(In[Ln]={min:Vn.min,max:Vn.max})}var On,jn=e.tzDate||(n=>new Date(n/bn)),Bn=e.fmtDate||Tn,Rn=1==bn?Zn(jn):$n(jn),Un=ee(jn,ne(1==bn?qn:Qn,Bn)),Xn=le(jn,te("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Bn)),re=L({show:!0,live:!0},e.legend),oe=re.show;re.width=z(s(re.width,2)),re.dash=z(re.dash||"solid"),re.stroke=z(re.stroke||ae),re.fill=z(re.fill||ie);var se,ue=[],ce=!1;if(oe){On=hn("table","u-legend",_);var ve=_n[1]?_n[1].values:null;if(ce=null!=ve){var he=hn("tr","u-thead",On);for(var de in hn("th",null,he),se=ve(a,1,0))hn("th",an,he).textContent=de}else se={_:0},fn(On,"u-inline"),re.live&&fn(On,"u-live")}var be=new Map;function _e(n,e,r){var t=be.get(e)||{},l=fr.bind[n](a,e,r);l&&(gn(n,e,t[n]=l),be.set(e,t))}var ke=0,ye=0,He=0,Fe=0,Ge=0,Ne=0,Ve=0,Oe=0,je=0,Be=0;a.bbox={};var Je=!1,qe=!1,Ze=!1,Xe=!1,Ke=!1;function Qe(n,e){n==a.width&&e==a.height||$e(n,e),Yr(!1),Ze=!0,qe=!0,Xe=!0,Ke=!0,Ur()}function $e(n,e){a.width=ke=He=n,a.height=ye=Fe=e,Ge=Ne=0,function(){var n=!1,e=!1,r=!1,t=!1;kn.forEach((l=>{if(l.show&&l._show){var a=l.side,i=a%2,o=l._size+(l.labelSize=null!=l.label?l.labelSize||30:0);o>0&&(i?(He-=o,3==a?(Ge+=o,t=!0):r=!0):(Fe-=o,0==a?(Ne+=o,n=!0):e=!0))}})),pr[0]=n,pr[1]=r,pr[2]=e,pr[3]=t,He-=br[1]+br[3],Ge+=br[3],Fe-=br[2]+br[0],Ne+=br[0]}(),function(){var n=Ge+He,e=Ne+Fe,r=Ge,t=Ne;function l(l,a){switch(l){case 1:return(n+=a)-a;case 2:return(e+=a)-a;case 3:return(r-=a)+a;case 0:return(t-=a)+a}}kn.forEach((n=>{if(n.show&&n._show){var e=n.side;n._pos=l(e,n._size),null!=n.label&&(n._lpos=l(e,n.labelSize))}}))}();var r=a.bbox;Ve=r.left=M(Ge*un,.5),Oe=r.top=M(Ne*un,.5),je=r.width=M(He*un,.5),Be=r.height=M(Fe*un,.5)}a.setSize=function(n){Qe(n.width,n.height)};var fr=a.cursor=L({},fe,e.cursor);fr._lock=!1;var cr=fr.points;cr.show=z(cr.show),cr.size=z(cr.size),cr.stroke=z(cr.stroke),cr.width=z(cr.width),cr.fill=z(cr.fill);var vr=a.focus=L({},e.focus||{alpha:.3},fr.focus),hr=vr.prox>=0,dr=[null];function mr(n,e){var r=yn[n.scale].time,t=n.value;if(n.value=r?G(t)?le(jn,te(t,Bn)):t||Xn:t||Se,n.label=n.label||(r?"Time":"Value"),e>0){n.width=null==n.width?1:n.width,n.paths=n.paths||nr||D,n.fillTo=z(n.fillTo||De),n.stroke=z(n.stroke||q),n.fill=z(n.fill||null),n._stroke=n._fill=n._paths=null;var l=Te(n.width,1),i=n.points=L({},{size:l,width:g(1,.2*l),stroke:n.stroke,space:2*l,_stroke:null,_fill:null},n.points);i.show=z(i.show),i.fill=z(i.fill),i.stroke=z(i.stroke)}if(oe&&ue.splice(e,0,function(n,e){if(0==e&&(ce||!re.live))return null;var r=[],t=hn("tr","u-series",On,On.childNodes[e]);fn(t,n.class),n.show||fn(t,ln);var l=hn("th",null,t),i=dn("u-marker",l);if(e>0){var o=re.width(a,e);o&&(i.style.border=o+"px "+re.dash(a,e)+" "+re.stroke(a,e)),i.style.background=re.fill(a,e)}var s=dn(an,l);for(var u in s.textContent=n.label,e>0&&(_e("click",l,(()=>{fr._lock||it(_n.indexOf(n),{show:!n.show},Tt.setSeries)})),hr&&_e($,l,(()=>{fr._lock||it(_n.indexOf(n),ot,Tt.setSeries)}))),se){var f=hn("td","u-value",t);f.textContent="--",r.push(f)}return r}(n,e)),fr.show){var o=function(n,e){if(e>0){var r=fr.points.show(a,e);if(r)return fn(r,"u-cursor-pt"),fn(r,n.class),mn(r,-10,-10,He,Fe),xn.insertBefore(r,dr[e]),r}}(n,e);o&&dr.splice(e,0,o)}}a.addSeries=function(n,e){n=rr(n,e=null==e?_n.length:e,pe,Ee),_n.splice(e,0,n),mr(_n[e],e)},a.delSeries=function(n){_n.splice(n,1),oe&&ue.splice(n,1)[0][0].parentNode.remove(),dr.length>1&&dr.splice(n,1)[0].remove()},_n.forEach(mr);var pr=[!1,!1,!1,!1];function gr(n,e,r){var t=r[0],l=r[1],a=r[2],i=r[3],o=e%2,s=0;return 0==o&&(i||l)&&(s=0==e&&!t||2==e&&!a?d(me.size/3):0),1==o&&(t||a)&&(s=1==e&&!l||3==e&&!i?d(ze.size/2):0),s}kn.forEach((function(n,e){if(n._show=n.show,n.show){var r=yn[n.scale];null==r&&(n.scale=n.side%2?_n[1].scale:Sn,r=yn[n.scale]);var t=r.time;n.size=z(n.size),n.space=z(n.space),n.rotate=z(n.rotate),n.incrs=z(n.incrs||(2==r.distr?Cn:t?1==bn?Jn:Kn:An)),n.splits=z(n.splits||(t&&1==r.distr?Rn:3==r.distr?xe:we));var l=n.values;n.values=t?F(l)?ee(jn,ne(l,Bn)):G(l)?function(n,e){var r=Tn(e);return(e,t)=>t.map((e=>r(n(e))))}(jn,l):l||Un:l||ge,n.filter=z(n.filter||(3==r.distr?Me:T)),n.font=ur(n.font),n.labelFont=ur(n.labelFont),n._size=n.size(a,null,e,0),n._space=n._rotate=n._incrs=n._found=n._splits=n._values=null,n._size>0&&(pr[e]=!0)}}));var wr,xr=a.padding=(e.padding||[gr,gr,gr,gr]).map((n=>z(s(n,gr)))),br=a._padding=xr.map(((n,e)=>n(a,e,pr,0))),_r=null,kr=null,yr=_n[0].idxs,Mr=null,Sr=!1;function zr(n,e){if(!F(n)&&N(n)&&(n.isGap&&_n.forEach((e=>{e.isGap=n.isGap})),n=n.data),(n=n||[])[0]=n[0]||[],a.data=n,r=n.slice(),wr=(Mr=r[0]).length,2==Nn&&(r[0]=Mr.map(((n,e)=>e))),a._data=r,Yr(!0),zt("setData"),!1!==e){var t=Gn;t.auto(a,Sr)?Tr():at(Sn,t.min,t.max),Xe=!0,Ke=!0,Ur()}}function Tr(){var n,e,t,a;Sr=!0,wr>0?(_r=yr[0]=0,kr=yr[1]=wr-1,t=r[0][_r],a=r[0][kr],2==Nn?(t=_r,a=kr):1==wr&&(3==Nn?(t=(n=l(t,t,Gn.log,!1))[0],a=n[1]):Gn.time?a=t+86400/bn:(t=(e=o(t,a,.1,!0))[0],a=e[1]))):(_r=yr[0]=t=null,kr=yr[1]=a=null),at(Sn,t,a)}function Dr(n,e,r,t,l){C.strokeStyle=n||Z,C.lineWidth=e,C.lineJoin="round",C.lineCap=t||"butt",C.setLineDash(r||[]),C.fillStyle=l||Z}function Er(n,e,r,t,l,a,i,o,s,u){var f=i%2/2;C.translate(f,f),Dr(o,i,s,u),C.beginPath();var c,v,h,d,m=l+(0==t||3==t?-a:a);0==r?(v=l,d=m):(c=l,h=m),n.forEach(((n,t)=>{null!=e[t]&&(0==r?c=h=n:v=d=n,C.moveTo(c,v),C.lineTo(h,d))})),C.stroke(),C.translate(-f,-f)}function Pr(n){var e=!0;return kn.forEach(((r,t)=>{if(r.show){var l=yn[r.scale];if(null!=l.min){r._show||(e=!1,r._show=!0,Yr(!1));var i=r.side,o=l.min,s=l.max,u=function(n,e,r,t){var l,i=kn[n];if(t>0){var o=i._space=i.space(a,n,e,r,t),s=i._incrs=i.incrs(a,n,e,r,t,o);l=i._found=function(n,e,r,t,l){for(var a=t/(e-n),i=(""+h(n)).length,o=0;r.length>o;o++){var s=r[o]*a,u=10>r[o]?Y.get(r[o]):0;if(s>=l&&17>i+u)return[r[o],s]}return[0,0]}(e,r,s,t,o)}else l=[0,0];return l}(t,o,s,0==i%2?He:Fe),f=u[0],c=u[1];if(0!=c){var v=r._splits=r.splits(a,t,o,s,f,c,2==l.distr),d=2==l.distr?v.map((n=>Mr[n])):v,p=2==l.distr?Mr[v[1]]-Mr[v[0]]:f,g=r._values=r.values(a,r.filter(a,d,t,c,p),t,c,p);r._rotate=2==i?r.rotate(a,g,t,c):0;var w=r._size;r._size=m(r.size(a,g,t,n)),null!=w&&r._size!=w&&(e=!1)}}else r._show&&(e=!1,r._show=!1,Yr(!1))}})),e}function Wr(n){var e=!0;return xr.forEach(((r,t)=>{var l=r(a,t,pr,n);l!=br[t]&&(e=!1),br[t]=l})),e}function Yr(n){_n.forEach(((e,r)=>{r>0&&(e._paths=null,n&&(e.min=null,e.max=null))}))}a.setData=zr;var Cr,Ar,Hr,Fr,Gr,Nr,Ir,Lr,Vr,Or,jr,Br,Rr=!1;function Ur(){Rr||(V(Jr),Rr=!0)}function Jr(){Je&&(function(){var e=I(yn);for(var t in e){var l=e[t],i=In[t];if(null!=i&&null!=i.min)L(l,i),t==Sn&&Yr(!0);else if(t!=Sn)if(0==wr&&null==l.from){var o=l.range(a,null,null,t);l.min=o[0],l.max=o[1]}else l.min=y,l.max=-y}if(wr>0)for(var s in _n.forEach(((t,l)=>{var i=t.scale,o=e[i],s=In[i];if(0==l){var u=o.range(a,o.min,o.max,i);o.min=u[0],o.max=u[1],_r=n(o.min,r[0]),kr=n(o.max,r[0]),o.min>r[0][_r]&&_r++,r[0][kr]>o.max&&kr--,t.min=Mr[_r],t.max=Mr[kr]}else if(t.show&&t.auto&&o.auto(a,Sr)&&(null==s||null==s.min)){var f=null==t.min?3==o.distr?function(n,e,r){for(var t=y,l=-y,a=e;r>=a;a++)n[a]>0&&(t=p(t,n[a]),l=g(l,n[a]));return[t==y?1:t,l==-y?10:l]}(r[l],_r,kr):function(n,e,r,t){var l=y,a=-y;if(1==t)l=n[e],a=n[r];else if(-1==t)l=n[r],a=n[e];else for(var i=e;r>=i;i++)null!=n[i]&&(l=p(l,n[i]),a=g(a,n[i]));return[l,a]}(r[l],_r,kr,t.sorted):[t.min,t.max];o.min=p(o.min,t.min=f[0]),o.max=g(o.max,t.max=f[1])}t.idxs[0]=_r,t.idxs[1]=kr})),e){var u=e[s],f=In[s];if(null==u.from&&(null==f||null==f.min)){var c=u.range(a,u.min==y?null:u.min,u.max==-y?null:u.max,s);u.min=c[0],u.max=c[1]}}for(var v in e){var h=e[v];if(null!=h.from){var d=e[h.from],m=h.range(a,d.min,d.max,v);h.min=m[0],h.max=m[1]}}var w={},x=!1;for(var b in e){var _=e[b],k=yn[b];k.min==_.min&&k.max==_.max||(k.min=_.min,k.max=_.max,w[b]=x=!0)}if(x){for(var M in _n.forEach((n=>{w[n.scale]&&(n._paths=null)})),w)Ze=!0,zt("setScale",M);fr.show&&(Xe=!0)}for(var S in In)In[S]=null}(),Je=!1),Ze&&(function(){for(var n=!1,e=0;!n;){var r=Pr(++e),t=Wr(e);(n=r&&t)||($e(a.width,a.height),qe=!0)}}(),Ze=!1),qe&&(vn(pn,U,Ge),vn(pn,B,Ne),vn(pn,O,He),vn(pn,j,Fe),vn(xn,U,Ge),vn(xn,B,Ne),vn(xn,O,He),vn(xn,j,Fe),vn(A,O,ke),vn(A,j,ye),P.width=d(ke*un),P.height=d(ye*un),pt(),zt("setSize"),qe=!1),fr.show&&Xe&&(dt(),Xe=!1),ke>0&&ye>0&&(C.clearRect(0,0,P.width,P.height),zt("drawClear"),Dn.forEach((n=>n())),zt("draw")),x||(x=!0,a.status=1,zt("ready")),Sr=!1,Rr=!1}function qr(e,t){var l=yn[e];if(null==l.from){if(0==wr){var i=l.range(a,t.min,t.max,e);t.min=i[0],t.max=i[1]}if(t.min>t.max){var o=t.min;t.min=t.max,t.max=o}if(wr>1&&null!=t.min&&null!=t.max&&1e-16>t.max-t.min)return;e==Sn&&2==l.distr&&wr>0&&(t.min=n(t.min,r[0]),t.max=n(t.max,r[0])),In[e]=t,Je=!0,Ur()}}a.redraw=n=>{!1!==n?at(Sn,Gn.min,Gn.max):Ur()},a.setScale=qr;var Zr=!1,Xr=fr.drag,Kr=Xr.x,Qr=Xr.y;fr.show&&(fr.x&&(Cr=dn("u-cursor-x",xn)),fr.y&&(Ar=dn("u-cursor-y",xn)),0==Gn.ori?(Hr=Cr,Fr=Ar):(Hr=Ar,Fr=Cr),jr=fr.left,Br=fr.top);var $r,nt,et,rt=a.select=L({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),tt=rt.show?dn("u-select",rt.over?xn:pn):null;function lt(n,e){if(rt.show){for(var r in n)vn(tt,r,rt[r]=n[r]);!1!==e&&zt("setSelect")}}function at(n,e,r){qr(n,{min:e,max:r})}function it(n,e,r){var t=_n[n];null!=e.focus&&function(n){n!=et&&(_n.forEach(((e,r)=>{!function(n,e){!function(n,e){_n[n].alpha=e,fr.show&&dr[n]&&(dr[n].style.opacity=e),oe&&ue[n]&&(ue[n][0].parentNode.style.opacity=e)}(n,e)}(r,null==n||0==r||r==n?1:vr.alpha)})),et=n,Ur())}(n),null!=e.show&&(t.show=e.show,function(n){var e=oe?ue[n][0].parentNode:null;_n[n].show?e&&cn(e,ln):(e&&fn(e,ln),dr.length>1&&mn(dr[n],-10,-10,He,Fe))}(n),at(t.scale,null,null),Ur()),zt("setSeries",n,e),r&&Et.pub("setSeries",a,n,e)}a.setSelect=lt,a.setSeries=it;var ot={focus:!0},st={focus:!1};function ut(n,e){var r=yn[e],t=He;1==r.ori&&(n=(t=Fe)-n),-1==r.dir&&(n=t-n);var l=r.min,a=r.max,i=n/t;return 3==r.distr?(l=b(l),a=b(a),w(10,l+(a-l)*i)):l+(a-l)*i}function ft(n,e){vn(tt,U,rt.left=n),vn(tt,O,rt.width=e)}function ct(n,e){vn(tt,B,rt.top=n),vn(tt,j,rt.height=e)}oe&&hr&&gn(nn,On,(()=>{fr._lock||(it(null,st,Tt.setSeries),dt())})),a.valToIdx=e=>n(e,r[0]),a.posToIdx=function(e){return n(ut(e,Sn),r[0],_r,kr)},a.posToVal=ut,a.valToPos=(n,e,r)=>0==yn[e].ori?u(n,yn[e],r?je:He,r?Ve:0):f(n,yn[e],r?Be:Fe,r?Oe:0),a.batch=function(n){n(a),Ur()},a.setCursor=n=>{jr=n.left,Br=n.top,dt()};var vt=0==Gn.ori?ft:ct,ht=1==Gn.ori?ft:ct;function dt(e,t){var l,i;Vr=jr,Or=Br,l=fr.move(a,jr,Br),jr=l[0],Br=l[1],fr.show&&(Hr&&mn(Hr,d(jr),0,He,Fe),Fr&&mn(Fr,0,d(Br),He,Fe)),$r=y;var o=0==Gn.ori?He:Fe,s=1==Gn.ori?He:Fe;if(0>jr||0==wr||_r>kr){i=null;for(var u=0;_n.length>u;u++)if(u>0&&dr.length>1&&mn(dr[u],-10,-10,He,Fe),oe&&re.live){if(0==u&&ce)continue;for(var f=0;ue[u].length>f;f++)ue[u][f].firstChild.nodeValue="--"}hr&&it(null,ot,Tt.setSeries)}else{var c=ut(0==Gn.ori?jr:Br,Sn);i=n(c,r[0],_r,kr);for(var h=E(Wn(r[0][i],Gn,o,0),.5),m=0;_n.length>m;m++){var g=_n[m],w=fr.dataIdx(a,m,i,c),b=w==i?h:E(Wn(r[0][w],Gn,o,0),.5);if(m>0&&g.show){var _=r[m][w],k=null==_?-10:E(Yn(_,yn[g.scale],s,0),.5);if(k>0){var M=v(k-Br);M>$r||($r=M,nt=m)}var S=void 0,z=void 0;0==Gn.ori?(S=b,z=k):(S=k,z=b),dr.length>1&&mn(dr[m],S,z,He,Fe)}if(oe&&re.live){if(w==fr.idx&&!Ke||0==m&&ce)continue;var T=0==m&&2==Nn?Mr:r[m],D=ce?g.values(a,m,w):{_:g.value(a,T[w],m,w)},P=0;for(var W in D)ue[m][P++].firstChild.nodeValue=D[W]}}Ke=!1}if(rt.show&&Zr)if(null!=t){var Y=Tt.scales,C=Y[0],A=Y[1],H=t.cursor.drag;Kr=H._x,Qr=H._y;var F,G,N,I,L,V=t.select,O=V.left,j=V.top,B=V.width,R=V.height,U=t.scales[C].ori,J=t.posToVal;C&&(0==U?(F=O,G=B):(F=j,G=R),N=yn[C],I=Wn(J(F,C),N,o,0),L=Wn(J(F+G,C),N,o,0),vt(p(I,L),v(L-I)),A||ht(0,s)),A&&(1==U?(F=O,G=B):(F=j,G=R),N=yn[A],I=Yn(J(F,A),N,s,0),L=Yn(J(F+G,A),N,s,0),ht(p(I,L),v(L-I)),C||vt(0,o))}else{var q=v(Vr-Gr),Z=v(Or-Nr);if(1==Gn.ori){var K=q;q=Z,Z=K}Kr=Xr.x&&q>=Xr.dist,Qr=Xr.y&&Z>=Xr.dist;var Q,$,nn=Xr.uni;null!=nn?Kr&&Qr&&(Qr=Z>=nn,(Kr=q>=nn)||Qr||(Z>q?Qr=!0:Kr=!0)):Xr.x&&Xr.y&&(Kr||Qr)&&(Kr=Qr=!0),Kr&&(0==Gn.ori?(Q=Ir,$=jr):(Q=Lr,$=Br),vt(p(Q,$),v($-Q)),Qr||ht(0,s)),Qr&&(1==Gn.ori?(Q=Ir,$=jr):(Q=Lr,$=Br),ht(p(Q,$),v($-Q)),Kr||vt(0,o)),Kr||Qr||(vt(0,0),ht(0,0))}if(fr.idx=i,fr.left=jr,fr.top=Br,Xr._x=Kr,Xr._y=Qr,null!=e&&(Et.pub(X,a,jr,Br,o,s,i),hr)){var en=Tt.setSeries,rn=vr.prox;null==et?$r>rn||it(nt,ot,en):$r>rn?it(null,ot,en):nt!=et&&it(nt,ot,en)}x&&zt("setCursor")}var mt=null;function pt(){mt=xn.getBoundingClientRect()}function gt(n,e,r,t,l,a){fr._lock||(wt(n,e,r,t,l,a,0,!1,null!=n),null!=n?dt(1):dt(null,e))}function wt(n,e,r,t,l,i,o,s,u){var f;if(null!=n)r=n.clientX-mt.left,t=n.clientY-mt.top;else{if(0>r||0>t)return jr=-10,void(Br=-10);var v=He,h=Fe,d=l,m=i,p=r,g=t;1==Gn.ori&&(v=Fe,h=He);var w=Tt.scales,x=w[0],b=w[1];if(1==e.scales[x].ori&&(d=i,m=l,p=t,g=r),r=null!=x?c(e.posToVal(p,x),yn[x],v,0):v*(p/d),t=null!=b?c(e.posToVal(g,b),yn[b],h,0):h*(g/m),1==Gn.ori){var _=r;r=t,t=_}}u&&(r>1&&He-1>r||(r=M(r,He)),t>1&&Fe-1>t||(t=M(t,Fe))),s?(Gr=r,Nr=t,f=fr.move(a,r,t),Ir=f[0],Lr=f[1]):(jr=r,Br=t)}function xt(){lt({width:0,height:0},!1)}function bt(n,e,r,t,l,i){Zr=!0,Kr=Qr=Xr._x=Xr._y=!1,wt(n,e,r,t,l,i,0,!0,!1),null!=n&&(_e(Q,on,_t),Et.pub(K,a,Ir,Lr,He,Fe,null))}function _t(n,e,r,t,l,i){Zr=Xr._x=Xr._y=!1,wt(n,e,r,t,l,i,0,!1,!0);var o=rt.left,s=rt.top,u=rt.width,f=rt.height,c=u>0||f>0;if(c&<(rt),Xr.setScale&&c){var v=o,h=u,d=s,m=f;if(1==Gn.ori&&(v=s,h=f,d=o,m=u),Kr&&at(Sn,ut(v,Sn),ut(v+h,Sn)),Qr)for(var p in yn){var g=yn[p];p!=Sn&&null==g.from&&g.min!=y&&at(p,ut(d+m,p),ut(d,p))}xt()}else fr.lock&&(fr._lock=!fr._lock,fr._lock||dt());null!=n&&(function(n,e){var r=be.get(e)||{};wn(n,e,r[n]),r[n]=null}(Q,on),Et.pub(Q,a,jr,Br,He,Fe,null))}function kt(n){Tr(),xt(),null!=n&&Et.pub(en,a,jr,Br,He,Fe,null)}var yt,Mt={};Mt.mousedown=bt,Mt.mousemove=gt,Mt.mouseup=_t,Mt.dblclick=kt,Mt.setSeries=(n,e,r,t)=>{it(r,t)},fr.show&&(_e(K,xn,bt),_e(X,xn,gt),_e($,xn,pt),_e(nn,xn,(function(){if(!fr._lock){var n=Zr;if(Zr){var e,r,t=!0,l=!0;0==Gn.ori?(e=Kr,r=Qr):(e=Qr,r=Kr),e&&r&&(t=10>=jr||jr>=He-10,l=10>=Br||Br>=Fe-10),e&&t&&(jr=Ir>jr?0:He),r&&l&&(Br=Lr>Br?0:Fe),dt(1),Zr=!1}jr=-10,Br=-10,dt(1),n&&(Zr=n)}})),_e(en,xn,kt),yt=function(n){var e=null;function r(){e=null,n()}return function(){clearTimeout(e),e=setTimeout(r,100)}}(pt),gn(rn,sn,yt),gn(tn,sn,yt),a.syncRect=pt);var St=a.hooks=e.hooks||{};function zt(n,e,r){n in St&&St[n].forEach((n=>{n.call(null,a,e,r)}))}(e.plugins||[]).forEach((n=>{for(var e in n.hooks)St[e]=(St[e]||[]).concat(n.hooks[e])}));var Tt=L({key:null,setSeries:!1,scales:[Sn,null]},fr.sync),Dt=Tt.key,Et=null!=Dt?Ce[Dt]=Ce[Dt]||Ae():Ae();function Pt(){zt("init",e,r),zr(r||e.data,!1),In[Sn]?qr(Sn,In[Sn]):Tr(),Qe(e.width,e.height),lt(rt,!1)}return Et.sub(a),a.pub=function(n,e,r,t,l,a,i){Mt[n](null,e,r,t,l,a,i)},a.destroy=function(){Et.unsub(a),wn(rn,sn,yt),wn(tn,sn,yt),_.remove(),zt("destroy")},t?t instanceof HTMLElement?(t.appendChild(_),Pt()):t(a,Pt):Pt(),a}fr.assign=L,fr.fmtNum=f,fr.rangeNum=o,fr.rangeLog=l,fr.orient=He,fr.join=function(n,e){if(1==n.length)return{data:n[0],isGap:e?(n,r)=>0!=e[0][r]:()=>!0};for(var r=new Set,t=[new Set],l=0;n.length>l;l++){for(var a=n[l],i=a[0],o=i.length,s=0;o>s;s++)r.add(i[s]);for(var u=1;a.length>u;u++){var f=new Set;if(null==e||1==e[l][u]||2==e[l][u])for(var c=a[u],v=0;o>v;v++)null==c[v]&&f.add(i[v]);t.push(f)}}for(var h=[Array.from(r).sort(((n,e)=>n-e))],d=h[0].length,m=new Map,p=0;d>p;p++)m.set(h[0][p],p);for(var g=1,w=0;n.length>w;w++)for(var x=n[w],b=x[0],_=1;x.length>_;_++){for(var k=x[_],M=Array(d).fill(null),S=0;k.length>S;S++)M[m.get(b[S])]=k[S];if(e&&2==e[w][_]){var z=t[g],T=z.size,D=0,E=void 0,P=-y;for(var W of z.values()){if(D++==T)break;if(W>P){var Y=m.get(W);for(E=Y-1;null===M[E];)z.add(h[0][E]),E--;for(E=Y+1;null===M[E];)z.add(P=h[0][E]),E++}}}h.push(M),g++}return{data:h,isGap:function(n,e,r){return t[e].has(n._data[0][r])}}},fr.fmtDate=Tn,fr.tzDate=function(n,e){var r;return"Etc/UTC"==e?r=new Date(+n+6e4*n.getTimezoneOffset()):e==Dn?r=n:(r=new Date(n.toLocaleString("en-US",{timeZone:e}))).setMilliseconds(n.getMilliseconds()),r},fr.addGap=Ne,fr.clipGaps=Ge;var cr=fr.paths={};return cr.linear=Qe,cr.spline=function(){return(n,r,t,l)=>He(n,r,((a,i,o,s,u,f,c,v,h,m,p)=>{var g,w,x;0==s.ori?(g=Ie,x=Ve,w=Je):(g=Le,x=Oe,w=qe);var b=1*s.dir*(0==s.ori?1:-1);t=e(o,t,l,1),l=e(o,t,l,-1);for(var _=[],k=!1,y=d(f(i[1==b?t:l],s,m,v)),M=y,S=[],z=[],T=1==b?t:l;T>=t&&l>=T;T+=b){var D=o[T],E=f(i[T],s,m,v);null!=D?(k&&(Ne(_,M,E),k=!1),S.push(M=E),z.push(c(o[T],u,p,h))):a.isGap(n,r,T)&&(Ne(_,M,E),k=!0)}var P={stroke:$e(S,z,.5,g,w),fill:null,clip:null,band:null},W=P.stroke;if(null!=a.fill){var Y=P.fill=new Path2D(W),C=a.fillTo(n,r,a.min,a.max),A=d(c(C,u,p,h));x(Y,M,A),x(Y,y,A)}return a.spanGaps||(P.clip=Ge(_,s.ori,v,h,m,p)),n.bands.length>0&&(P.band=Fe(n,r,t,l,W)),P}))},cr.stepped=function(n){var r=s(n.align,1);return(n,t,l,a)=>He(n,t,((i,o,s,u,f,c,v,h,m,p,g)=>{var w=0==u.ori?Ve:Oe,x={stroke:new Path2D,fill:null,clip:null,band:null},b=x.stroke,_=1*u.dir*(0==u.ori?1:-1);l=e(s,l,a,1),a=e(s,l,a,-1);var k=[],y=!1,M=d(v(s[1==_?l:a],f,g,m)),S=d(c(o[1==_?l:a],u,p,h)),z=S;w(b,S,M);for(var T=1==_?l:a;T>=l&&a>=T;T+=_){var D=s[T],E=d(c(o[T],u,p,h));if(null!=D){var P=d(v(D,f,g,m));if(y){if(Ne(k,z,E),M!=P){var W=i.width*un/2,Y=k[k.length-1];Y[0]+=W,Y[1]-=W}y=!1}1==r?w(b,E,M):w(b,z,P),w(b,E,P),M=P,z=E}else i.isGap(n,t,T)&&(Ne(k,z,E),y=!0)}if(null!=i.fill){var C=x.fill=new Path2D(b),A=i.fillTo(n,t,i.min,i.max),H=d(v(A,f,g,m));w(C,z,H),w(C,S,H)}return i.spanGaps||(x.clip=Ge(k,u.ori,h,m,p,g)),n.bands.length>0&&(x.band=Fe(n,t,l,a,b)),x}))},cr.bars=function(n){var r=s((n=n||H).size,[.6,y]),t=n.align||0,l=1-r[0],a=s(r[1],y)*un;return(n,r,i,o)=>He(n,r,((s,u,f,c,v,h,m,w,x,b,_)=>{var k,y=0==c.ori?je:Be,S=h(u[1],c,b,w)-h(u[0],c,b,w),z=S*l,T=m(s.fillTo(n,r,s.min,s.max),v,_,x),D=d(s.width*un),E=d(p(a,S-z)-D),P=1==t?0:-1==t?E:E/2,W={stroke:new Path2D,fill:null,clip:null,band:null},Y=n.bands.length>0;Y&&(W.band=new Path2D,k=M(m(v.max,v,_,x),.5));for(var C=W.stroke,A=W.band,H=c.dir*(0==c.ori?1:-1),F=1==H?i:o;F>=i&&o>=F;F+=H){var G=f[F];if(null==G){if(!Y)continue;var N=e(f,1==H?i:o,F,-H),I=e(f,F,1==H?o:i,H),L=f[N];G=L+(F-N)/(I-N)*(f[I]-L)}var V=h(2==c.distr?F:u[F],c,b,w),O=m(G,v,_,x),j=d(V-P),B=d(g(O,T)),R=d(p(O,T)),U=B-R;null!=f[F]&&y(C,j,R,E,U),Y&&(B=R,y(A,j,R=k,E,U=B-R))}return null!=s.fill&&(W.fill=new Path2D(C)),W}))},fr}(); +/*! https://github.com/leeoniya/uPlot (v1.6.3) */ +var uPlot=function(){"use strict";function n(n,e,r,t){var l;r=r||0;for(var i=2147483647>=(t=t||e.length-1);t-r>1;)n>e[l=i?r+t>>1:h((r+t)/2)]?r=l:t=l;return n-e[r]>e[t]-n?t:r}function e(n,e,r,t){for(var l=1==t?e:r;l>=e&&r>=l;l+=t)if(null!=n[l])return l;return-1}var r=[0,0];function t(n,e,t,l){return r[0]=0>t?W(n,-t):n,r[1]=0>l?W(e,-l):e,r}function l(n,e,r,l){var i,a,o,s=10==r?b:k;return n==e&&(n/=r,e*=r),l?(i=h(s(n)),a=m(s(e)),n=(o=t(w(r,i),w(r,a),i,a))[0],e=o[1]):(i=h(s(n)),a=h(s(e)),n=P(n,(o=t(w(r,i),w(r,a),i,a))[0]),e=E(e,o[1])),[n,e]}var i={pad:0,soft:null,mode:0},a={min:i,max:i};function o(n,e,r,t){return I(r)?u(n,e,r):(i.pad=r,i.soft=t?0:null,i.mode=t?3:0,u(n,e,a))}function s(n,e){return null==n?e:n}function u(n,e,r){var t=r.min,l=r.max,i=s(t.pad,0),a=s(l.pad,0),o=s(t.hard,-y),u=s(l.hard,y),f=s(t.soft,y),c=s(l.soft,-y),d=s(t.mode,0),m=s(l.mode,0),x=e-n,k=x||v(e)||1e3,_=b(k),M=w(10,h(_)),S=W(P(n-k*(0==x?0==n?.1:1:i),M/10),6),z=f>n||1!=d&&(3!=d||S>f)&&(2!=d||f>S)?y:f,T=g(o,z>S&&n>=z?z:p(z,S)),D=W(E(e+k*(0==x?0==e?.1:1:a),M/10),6),Y=e>c||1!=m&&(3!=m||c>D)&&(2!=m||D>c)?-y:c,C=p(u,D>Y&&Y>=e?Y:g(Y,D));return T==C&&0==T&&(C=100),[T,C]}var f=new Intl.NumberFormat(navigator.language).format,c=Math,v=c.abs,h=c.floor,d=c.round,m=c.ceil,p=c.min,g=c.max,w=c.pow,x=c.sqrt,b=c.log10,k=c.log2,_=c.PI,y=1/0;function M(n,e){return d(n/e)*e}function S(n,e,r){return p(g(n,e),r)}function z(n){return"function"==typeof n?n:()=>n}var T=(n,e)=>e,D=()=>null;function E(n,e){return m(n/e)*e}function P(n,e){return h(n/e)*e}function W(n,e){return d(n*(e=Math.pow(10,e)))/e}var Y=new Map;function C(n){return((""+n).split(".")[1]||"").length}function A(n,e,r,t){for(var l=[],i=t.map(C),a=e;r>a;a++)for(var o=v(a),s=W(w(n,a),o),u=0;t.length>u;u++){var f=t[u]*s,c=(0>f||0>a?o:0)+(i[u]>a?i[u]:0),h=W(f,c);l.push(h),Y.set(h,c)}return l}var H={},F=Array.isArray;function N(n){return"string"==typeof n}function I(n){var e=!1;if(null!=n){var r=n.constructor;e=null==r||r==Object}return e}function L(n){var e;if(F(n))e=n.map(L);else if(I(n))for(var r in e={},n)e[r]=L(n[r]);else e=n;return e}function V(n){for(var e=arguments,r=1;e.length>r;r++){var t=e[r];for(var l in t)I(n[l])?V(n[l],L(t[l])):n[l]=L(t[l])}return n}function O(n,e,r){for(var t=0,l=void 0,i=-y;e.length>t;t++){var a=e[t];if(a>i){for(l=a-1;l>=0&&null==n[l];)n[l--]=null;for(l=a+1;r>l&&null==n[l];)n[i=l++]=null}}}var j="undefined"==typeof queueMicrotask?n=>Promise.resolve().then(n):queueMicrotask,G="width",B="height",R="top",U="bottom",J="left",q="right",Z="#000",X="#0000",K="mousemove",Q="mousedown",$="mouseup",nn="mouseenter",en="mouseleave",rn="dblclick",tn="resize",ln="scroll",an="u-off",on="u-label",sn=document,un=window,fn=devicePixelRatio;function cn(n,e){null!=e&&n.classList.add(e)}function vn(n,e){n.classList.remove(e)}function hn(n,e,r){n.style[e]=r+"px"}function dn(n,e,r,t){var l=sn.createElement(n);return null!=e&&cn(l,e),null!=r&&r.insertBefore(l,t),l}function mn(n,e){return dn("div",n,e)}function pn(n,e,r,t,l){n.style.transform="translate("+e+"px,"+r+"px)",0>e||0>r||e>t||r>l?cn(n,an):vn(n,an)}var gn={passive:!0};function wn(n,e,r){e.addEventListener(n,r,gn)}function xn(n,e,r){e.removeEventListener(n,r,gn)}var bn=["January","February","March","April","May","June","July","August","September","October","November","December"],kn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function _n(n){return n.slice(0,3)}var yn=kn.map(_n),Mn=bn.map(_n),Sn={MMMM:bn,MMM:Mn,WWWW:kn,WWW:yn};function zn(n){return(10>n?"0":"")+n}var Tn={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,e)=>e.MMMM[n.getMonth()],MMM:(n,e)=>e.MMM[n.getMonth()],MM:n=>zn(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>zn(n.getDate()),D:n=>n.getDate(),WWWW:(n,e)=>e.WWWW[n.getDay()],WWW:(n,e)=>e.WWW[n.getDay()],HH:n=>zn(n.getHours()),H:n=>n.getHours(),h:n=>{var e=n.getHours();return 0==e?12:e>12?e-12:e},AA:n=>12>n.getHours()?"AM":"PM",aa:n=>12>n.getHours()?"am":"pm",a:n=>12>n.getHours()?"a":"p",mm:n=>zn(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>zn(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>function(n){return(10>n?"00":100>n?"0":"")+n}(n.getMilliseconds())};function Dn(n,e){e=e||Sn;for(var r,t=[],l=/\{([a-z]+)\}|[^{]+/gi;r=l.exec(n);)t.push("{"==r[0][0]?Tn[r[1]]:r[0]);return n=>{for(var r="",l=0;t.length>l;l++)r+="string"==typeof t[l]?t[l]:t[l](n,e);return r}}var En=(new Intl.DateTimeFormat).resolvedOptions().timeZone,Pn=n=>n%1==0,Wn=[1,2,2.5,5],Yn=A(10,-16,0,Wn),Cn=A(10,0,16,Wn),An=Cn.filter(Pn),Hn=Yn.concat(Cn),Fn="{YYYY}",Nn="\n"+Fn,In="{M}/{D}",Ln="\n"+In,Vn=Ln+"/{YY}",On="{aa}",jn="{h}:{mm}"+On,Gn="\n"+jn,Bn=":{ss}",Rn=null;function Un(n){var e=1e3*n,r=60*e,t=60*r,l=24*t,i=30*l,a=365*l;return[(1==n?A(10,0,3,Wn).filter(Pn):A(10,-3,0,Wn)).concat([e,5*e,10*e,15*e,30*e,r,5*r,10*r,15*r,30*r,t,2*t,3*t,4*t,6*t,8*t,12*t,l,2*l,3*l,4*l,5*l,6*l,7*l,8*l,9*l,10*l,15*l,i,2*i,3*i,4*i,6*i,a,2*a,5*a,10*a,25*a,50*a,100*a]),[[a,Fn,Rn,Rn,Rn,Rn,Rn,Rn,1],[28*l,"{MMM}",Nn,Rn,Rn,Rn,Rn,Rn,1],[l,In,Nn,Rn,Rn,Rn,Rn,Rn,1],[t,"{h}"+On,Vn,Rn,Ln,Rn,Rn,Rn,1],[r,jn,Vn,Rn,Ln,Rn,Rn,Rn,1],[e,Bn,Vn+" "+jn,Rn,Ln+" "+jn,Rn,Gn,Rn,1],[n,Bn+".{fff}",Vn+" "+jn,Rn,Ln+" "+jn,Rn,Gn,Rn,1]],function(e){return(o,s,u,f,c,v)=>{var d=[],m=c>=a,p=c>=i&&a>c,g=e(u),w=g*n,x=te(g.getFullYear(),m?0:g.getMonth(),p||m?1:g.getDate()),b=x*n;if(p||m)for(var k=p?c/i:0,_=m?c/a:0,y=w==b?w:te(x.getFullYear()+_,x.getMonth()+k,1)*n,M=new Date(y/n),S=M.getFullYear(),z=M.getMonth(),T=0;f>=y;T++){var D=te(S+_*T,z+k*T,1);(y=(+D+(D-e(D*n)))*n)>f||d.push(y)}else{var P=l>c?c:l,Y=b+(h(u)-h(w))+E(w-b,P);d.push(Y);for(var C=e(Y),A=C.getHours()+C.getMinutes()/r+C.getSeconds()/t,H=c/t,F=v/o.axes[s]._space;(Y=W(Y+c,1==n?0:3))<=f;)if(H>1){var N=h(W(A+H,6))%24,I=e(Y).getHours()-N;I>1&&(I=-1),A=(A+H)%24,.7>W(((Y-=I*t)-d[d.length-1])/c,3)*F||d.push(Y)}else d.push(Y)}return d}}]}var Jn=Un(1),qn=Jn[0],Zn=Jn[1],Xn=Jn[2],Kn=Un(.001),Qn=Kn[0],$n=Kn[1],ne=Kn[2];function ee(n,e){return n.map((n=>n.map(((r,t)=>0==t||8==t||null==r?r:e(1==t||0==n[8]?r:n[1]+r)))))}function re(n,e){return(r,t,l,i,a)=>{var o,s,u,f,c,v,h=e.find((n=>a>=n[0]))||e[e.length-1];return t.map((e=>{var r=n(e),t=r.getFullYear(),l=r.getMonth(),i=r.getDate(),a=r.getHours(),d=r.getMinutes(),m=r.getSeconds(),p=t!=o&&h[2]||l!=s&&h[3]||i!=u&&h[4]||a!=f&&h[5]||d!=c&&h[6]||m!=v&&h[7]||h[1];return o=t,s=l,u=i,f=a,c=d,v=m,p(r)}))}}function te(n,e,r){return new Date(n,e,r)}function le(n,e){return e(n)}function ie(n,e){return(r,t)=>e(n(t))}function ae(n,e){var r=n.series[e];return r.width?r.stroke(n,e):r.points.width?r.points.stroke(n,e):null}function oe(n,e){return n.series[e].fill(n,e)}A(2,-53,53,[1]);var se=[0,0];function ue(n,e,r){return n=>{0==n.button&&r(n)}}function fe(n,e,r){return r}var ce={show:!0,x:!0,y:!0,lock:!1,move:function(n,e,r){return se[0]=e,se[1]=r,se},points:{show:function(n,e){var r=n.cursor.points,t=mn(),l=r.stroke(n,e),i=r.fill(n,e);t.style.background=i||l;var a=r.size(n,e),o=r.width(n,e,a);o&&(t.style.border=o+"px solid "+l);var s=a/-2;return hn(t,G,a),hn(t,B,a),hn(t,"marginLeft",s),hn(t,"marginTop",s),t},size:function(n,e){return De(n.series[e].width,1)},width:0,stroke:function(n,e){return n.series[e].stroke(n,e)},fill:function(n,e){return n.series[e].stroke(n,e)}},bind:{mousedown:ue,mouseup:ue,click:ue,dblclick:ue,mousemove:fe,mouseleave:fe,mouseenter:fe},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,_x:!1,_y:!1},focus:{prox:-1},left:-10,top:-10,idx:null,dataIdx:function(n,e,r){return r}},ve={show:!0,stroke:"rgba(0,0,0,0.07)",width:2,filter:T},he=V({},ve,{size:10}),de='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',me="bold "+de,pe={show:!0,scale:"x",stroke:Z,space:50,gap:5,size:50,labelSize:30,labelFont:me,side:2,grid:ve,ticks:he,font:de,rotate:0},ge={show:!0,scale:"x",auto:!1,sorted:1,min:y,max:-y,idxs:[]};function we(n,e){return e.map((n=>null==n?"":f(n)))}function xe(n,e,r,t,l,i,a){for(var o=[],s=Y.get(l)||0,u=r=a?r:W(E(r,l),s);t>=u;u=W(u+l,s))o.push(Object.is(u,-0)?0:u);return o}function be(n,e,r,t,l){var i=[],a=n.scales[n.axes[e].scale].log,o=h((10==a?b:k)(r));l=w(a,o),0>o&&(l=W(l,-o));var s=r;do{i.push(s),l*a>(s=W(s+l,Y.get(l)))||(l=s)}while(t>=s);return i}var ke=/./,_e=/[12357]/,ye=/[125]/,Me=/1/;function Se(n,e,r){var t=n.axes[r],l=t.scale;if(2==n.scales[l].log)return e;var i=n.valToPos,a=t._space,o=i(10,l),s=i(9,l)-os.test(n)?n:null))}function ze(n,e){return null==e?"":f(e)}var Te={show:!0,scale:"y",stroke:Z,space:30,gap:5,size:50,labelSize:30,labelFont:me,side:3,grid:ve,ticks:he,font:de,rotate:0};function De(n,e){return W((3+2*(n||1))*e,3)}function Ee(n,e){var r=n.scales[n.series[e].scale],t=n.bands&&n.bands.some((n=>n.series[0]==e));return 3==r.distr||t?r.min:0}var Pe={scale:"y",auto:!0,sorted:0,show:!0,band:!1,spanGaps:!1,alpha:1,points:{show:function(n,e){var r=n.series[0].idxs;return(0==n.scales[n.series[0].scale].ori?n.bbox.width:n.bbox.height)/(n.series[e].points.space*fn)>=r[1]-r[0]}},values:null,min:y,max:-y,idxs:[],path:null,clip:null};function We(n,e,r){return r/10}var Ye={time:!0,auto:!0,distr:1,log:10,min:null,max:null,dir:1,ori:0},Ce=V({},Ye,{time:!1,ori:1}),Ae={};function He(){var n=[];return{sub:function(e){n.push(e)},unsub:function(e){n=n.filter((n=>n!=e))},pub:function(e,r,t,l,i,a,o){n.length>1&&n.forEach((n=>{n!=r&&n.pub(e,r,t,l,i,a,o)}))}}}function Fe(n,e,r){var t=n.series[e],l=n.scales,i=n.bbox,a=n._data[0],o=n._data[e],s=l[n.series[0].scale],u=l[t.scale],f=i.left,c=i.top,v=i.width,h=i.height,d=n.valToPosH,m=n.valToPosV;return 0==s.ori?r(t,a,o,s,u,d,m,f,c,v,h,Ve,je,Be,Ue,qe):r(t,a,o,s,u,m,d,c,f,h,v,Oe,Ge,Re,Je,Ze)}function Ne(n,e,r,t,l){return Fe(n,e,((n,e,i,a,o,s,u,f,c,v,h)=>{var d,m,p=0==a.ori?je:Ge;1==a.dir*(0==a.ori?1:-1)?(d=r,m=t):(d=t,m=r);var g=M(s(e[d],a,v,f),.5),w=M(u(i[d],o,h,c),.5),x=M(s(e[m],a,v,f),.5),b=M(u(o.max,o,h,c),.5),k=new Path2D(l);return p(k,x,b),p(k,g,b),p(k,g,w),k}))}function Ie(n,e,r,t,l,i){var a=null;if(n.length>0){a=new Path2D;for(var o=0==e?Be:Re,s=r,u=0;n.length>u;u++){var f=n[u];o(a,s,t,f[0]-s,t+i),s=f[1]}o(a,s,t,r+l-s,t+i)}return a}function Le(n,e,r){if(r>e){var t=n[n.length-1];t&&t[0]==e?t[1]=r:n.push([e,r])}}function Ve(n,e,r){n.moveTo(e,r)}function Oe(n,e,r){n.moveTo(r,e)}function je(n,e,r){n.lineTo(e,r)}function Ge(n,e,r){n.lineTo(r,e)}function Be(n,e,r,t,l){n.rect(e,r,t,l)}function Re(n,e,r,t,l){n.rect(r,e,l,t)}function Ue(n,e,r,t,l,i){n.arc(e,r,t,l,i)}function Je(n,e,r,t,l,i){n.arc(r,e,t,l,i)}function qe(n,e,r,t,l,i,a){n.bezierCurveTo(e,r,t,l,i,a)}function Ze(n,e,r,t,l,i,a){n.bezierCurveTo(r,e,l,t,a,i)}function Xe(n){return(e,r,t,l,i)=>{n(e,r,t),n(e,r,l),n(e,r,i)}}var Ke=Xe(je),Qe=Xe(Ge);function $e(){return(n,r,t,l)=>Fe(n,r,((i,a,o,s,u,f,c,v,h,m,w)=>{var x,b;0==s.ori?(x=je,b=Ke):(x=Ge,b=Qe);var k,_,S,z=s.dir*(0==s.ori?1:-1),T={stroke:new Path2D,fill:null,clip:null,band:null},D=T.stroke,E=y,P=-y,W=[],Y=d(f(a[1==z?t:l],s,m,v)),C=!1,A=e(o,t,l,1*z),H=e(o,t,l,-1*z),F=M(f(a[A],s,m,v),.5),N=M(f(a[H],s,m,v),.5);F>v&&Le(W,v,F);for(var I=1==z?t:l;I>=t&&l>=I;I+=z){var L=d(f(a[I],s,m,v));if(L==Y)null!=o[I]?(k=d(c(o[I],u,w,h)),E==y&&x(D,L,k),E=p(k,E),P=g(k,P)):C||null!==o[I]||(C=!0);else{var V=!1;E!=y?(b(D,Y,E,P,k),_=S=Y):C&&(V=!0,C=!1),null!=o[I]?(x(D,L,k=d(c(o[I],u,w,h))),E=P=k,L-Y>1&&null===o[I-z]&&(V=!0)):(E=y,P=-y,C||null!==o[I]||(C=!0)),V&&Le(W,_,L),Y=L}}if(E!=y&&E!=P&&S!=Y&&b(D,Y,E,P,k),v+m>N&&Le(W,N,v+m),null!=i.fill){var O=T.fill=new Path2D(D),j=d(c(i.fillTo(n,r,i.min,i.max),u,w,h));x(O,N,j),x(O,F,j)}return i.spanGaps||(T.clip=Ie(W,s.ori,v,h,m,w)),n.bands.length>0&&(T.band=Ne(n,r,t,l,D)),T}))}function nr(n,e,r,t,l){var i,a,o,s,u,f,c,v,h,m,p,g,b,k,_,y,M,S,z,T,D,E,P,W,Y,C=new Path2D,A=n.length;t(C,d(n[0]),d(e[0]));for(var H=0;A-1>H;H++){var F=0==H?0:H-1;a=e[F],s=e[H],u=n[H+1],f=e[H+1],A>H+2?(c=n[H+2],v=e[H+2]):(c=u,v=f),b=x(w((i=n[F])-(o=n[H]),2)+w(a-s,2)),k=x(w(o-u,2)+w(s-f,2)),_=x(w(u-c,2)+w(f-v,2)),T=w(_,r),E=w(_,2*r),D=w(k,r),P=w(k,2*r),(S=3*(Y=w(b,r))*(Y+D))>0&&(S=1/S),(z=3*T*(T+D))>0&&(z=1/z),m=(-P*a+(y=2*(W=w(b,2*r))+3*Y*D+P)*s+W*f)*S,g=(E*s+(M=2*E+3*T*D+P)*f-P*v)*z,0==(h=(-P*i+y*o+W*u)*S)&&0==m&&(h=o,m=s),0==(p=(E*o+M*u-P*c)*z)&&0==g&&(p=u,g=f),l(C,h,m,p,g,u,f)}return C}var er=$e();function rr(n,e,r,t){return(t?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map(((n,t)=>tr(n,t,e,r)))}function tr(n,e,r,t){return V({},0==e?r:t,n)}var lr=[null,null];function ir(n,e,r){return null==e?lr:[e,r]}var ar=ir;function or(n,e,r){return null==e?lr:o(e,r,.1,!0)}function sr(n,e,r,t){return null==e?lr:l(e,r,n.scales[t].log,!1)}var ur=sr;function fr(n){var e;return[n=n.replace(/(\d+)px/,((n,r)=>(e=d(r*fn))+"px")),e]}function cr(e,r,t){var i={};function a(n,e){return 3==e.distr?b((n>0?n:e.clamp(i,n,e.min,e.max,e.key))/e.min)/b(e.max/e.min):(n-e.min)/(e.max-e.min)}function u(n,e,r,t){var l=a(n,e);return t+r*(-1==e.dir?1-l:l)}function f(n,e,r,t){var l=a(n,e);return t+r*(-1==e.dir?l:1-l)}function c(n,e,r,t){return 0==e.ori?u(n,e,r,t):f(n,e,r,t)}i.valToPosH=u,i.valToPosV=f;var x=!1;i.status=0;var k=i.root=mn("uplot");null!=e.id&&(k.id=e.id),cn(k,e.class),e.title&&(mn("u-title",k).textContent=e.title);var P=dn("canvas"),C=i.ctx=P.getContext("2d"),A=mn("u-wrap",k),O=mn("u-under",A);A.appendChild(P);var Z=mn("u-over",A);((e=L(e)).plugins||[]).forEach((n=>{n.opts&&(e=n.opts(i,e)||e)}));var gn=e.ms||.001,bn=i.series=rr(e.series||[],ge,Pe,!1),kn=i.axes=rr(e.axes||[],pe,Te,!0),_n=i.scales={},yn=i.bands=e.bands||[];yn.forEach((n=>{n.fill=z(n.fill||null)}));var Mn=bn[0].scale,Sn={axes:function(){kn.forEach(((n,e)=>{if(n.show&&n._show){var r=_n[n.scale],t=n.side,l=t%2,a=0==l?je:Ge,o=0==l?Ie:Le,s=d(n.gap*fn),u=n.ticks,f=u.show?d(u.size*fn):0,v=n._found,h=v[0],m=v[1],p=n._splits,g=2==r.distr?p.map((n=>yr[n])):p,w=2==r.distr?yr[p[1]]-yr[p[0]]:h,x=n._rotate*-_/180,b=d(n._pos*fn),k=b+(f+s)*(0==l&&0==t||1==l&&3==t?-1:1),y=0==l?k:0,M=1==l?k:0;C.font=n.font[0],C.fillStyle=n.stroke(i,e),C.textAlign=1==n.align?J:2==n.align?q:x>0?J:0>x?q:0==l?"center":3==t?q:J,C.textBaseline=x||1==l?"middle":2==t?R:U;var S=1.5*n.font[1],z=p.map((n=>d(c(n,r,a,o))));if(n._values.forEach(((n,e)=>{null!=n&&(0==l?M=z[e]:y=z[e],(""+n).split(/\n/gm).forEach(((n,e)=>{x?(C.save(),C.translate(M,y+e*S),C.rotate(x),C.fillText(n,0,0),C.restore()):C.fillText(n,M,y+e*S)})))})),n.label){C.save();var T=d(n._lpos*fn);1==l?(M=y=0,C.translate(T,d(Le+Ge/2)),C.rotate((3==t?-_:_)/2)):(M=d(Ie+je/2),y=T),C.font=n.labelFont[0],C.textAlign="center",C.textBaseline=2==t?R:U,C.fillText(n.label,M,y),C.restore()}u.show&&Dr(z,u.filter(i,g,e,m,w),l,t,b,f,W(u.width*fn,3),u.stroke(i,e),u.dash,u.cap);var D=n.grid;D.show&&Dr(z,D.filter(i,g,e,m,w),l,0==l?2:1,0==l?Le:Ie,0==l?Ge:je,W(D.width*fn,3),D.stroke(i,e),D.dash,D.cap)}})),St("drawAxes")},series:function(){gr>0&&(bn.forEach(((n,e)=>{if(e>0&&n.show&&null==n._paths){var t=function(n){for(var e=S(br-1,0,gr-1),r=S(kr+1,0,gr-1);null==n[e]&&e>0;)e--;for(;null==n[r]&&gr-1>r;)r++;return[e,r]}(r[e]);n._paths=n.paths(i,e,t[0],t[1])}})),bn.forEach(((n,e)=>{e>0&&n.show&&(n._paths&&function(n){var e=bn[n],r=e._paths,t=r.stroke,l=r.fill,a=r.clip,o=W(e.width*fn,3),s=o%2/2,u=e._stroke=e.stroke(i,n),f=e._fill=e.fill(i,n);Tr(u,o,e.dash,e.cap,f),C.globalAlpha=e.alpha,C.translate(s,s),C.save();var c=Ie,v=Le,h=je,d=Ge,m=o*fn/2;0==e.min&&(d+=m),0==e.max&&(v-=m,d+=m),C.beginPath(),C.rect(c,v,h,d),C.clip(),a&&C.clip(a),!function(n,e){var r=!1,t=bn[n];return yn.forEach(((l,a)=>{if(l.series[0]==n){r=!0;var o=bn[l.series[1]],s=(o._paths||H).band;o.show&&s&&(C.save(),Tr(null,null,null,null,l.fill(i,a)||e),C.clip(s),C.fill(t._paths.fill),C.restore())}})),r}(n,f)&&f&&l&&C.fill(l),o&&u&&t&&C.stroke(t),C.restore(),C.translate(-s,-s),C.globalAlpha=1}(e),n.points.show(i,e,br,kr)&&function(n){var e=bn[n],t=e.points,l=W(t.width*fn,3),a=l%2/2,o=t.width>0,s=(t.size-t.width)/2*fn,u=W(2*s,3);C.translate(a,a),C.save(),C.beginPath(),C.rect(Ie-u,Le-u,je+2*u,Ge+2*u),C.clip(),C.globalAlpha=e.alpha;var f,c,v,h,m=new Path2D,p=_n[e.scale];0==Fn.ori?(f=je,c=Ie,v=Ge,h=Le):(f=Ge,c=Le,v=je,h=Ie);for(var g=br;kr>=g;g++)if(null!=r[n][g]){var w=d(Pn(r[0][g],Fn,f,c)),x=d(Wn(r[n][g],p,v,h));Yn(m,w+s,x),Cn(m,w,x,s,0,2*_)}var b=t._stroke=t.stroke(i,n),k=t._fill=t.fill(i,n);Tr(b,l,t.dash,t.cap,k||(o?"#fff":e._stroke)),C.fill(m),o&&C.stroke(m),C.globalAlpha=1,C.restore(),C.translate(-a,-a)}(e),St("drawSeries",e))})))}},zn=(e.drawOrder||["axes","series"]).map((n=>Sn[n]));function Tn(n){var r=_n[n];if(null==r){var t=(e.scales||H)[n]||H;if(null!=t.from)Tn(t.from),_n[n]=V({},_n[t.from],t);else{(r=_n[n]=V({},n==Mn?Ye:Ce,t)).key=n;var l=r.time,i=3==r.distr,a=r.range;if(n!=Mn&&!F(a)&&I(a)){var s=a;a=(n,e,r)=>null==e?lr:o(e,r,s)}r.range=z(a||(l?ar:n==Mn?i?ur:ir:i?sr:or)),r.auto=z(r.auto),r.clamp=z(r.clamp||We)}}}for(var En in Tn("x"),Tn("y"),bn.forEach((n=>{Tn(n.scale)})),kn.forEach((n=>{Tn(n.scale)})),e.scales)Tn(En);var Pn,Wn,Yn,Cn,Fn=_n[Mn],Nn=Fn.distr;0==Fn.ori?(cn(k,"u-hz"),Pn=u,Wn=f,Yn=Ve,Cn=Ue):(cn(k,"u-vt"),Pn=f,Wn=u,Yn=Oe,Cn=Je);var In={};for(var Ln in _n){var Vn=_n[Ln];null==Vn.min&&null==Vn.max||(In[Ln]={min:Vn.min,max:Vn.max})}var On,jn=e.tzDate||(n=>new Date(n/gn)),Gn=e.fmtDate||Dn,Bn=1==gn?Xn(jn):ne(jn),Rn=re(jn,ee(1==gn?Zn:$n,Gn)),Un=ie(jn,le("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Gn)),Jn=V({show:!0,live:!0},e.legend),Kn=Jn.show;Jn.width=z(s(Jn.width,2)),Jn.dash=z(Jn.dash||"solid"),Jn.stroke=z(Jn.stroke||ae),Jn.fill=z(Jn.fill||oe);var te,se=[],ue=!1;if(Kn){On=dn("table","u-legend",k);var fe=bn[1]?bn[1].values:null;if(ue=null!=fe){var ve=dn("tr","u-thead",On);for(var he in dn("th",null,ve),te=fe(i,1,0))dn("th",on,ve).textContent=he}else te={_:0},cn(On,"u-inline"),Jn.live&&cn(On,"u-live")}var de=new Map;function me(n,e,r){var t=de.get(e)||{},l=$e.bind[n](i,e,r);l&&(wn(n,e,t[n]=l),de.set(e,t))}var ke=0,_e=0,ye=0,Me=0,Fe=0,Ne=0,Ie=0,Le=0,je=0,Ge=0;i.bbox={};var Be=!1,Re=!1,qe=!1,Ze=!1,Xe=!1;function Ke(n,e){n==i.width&&e==i.height||Qe(n,e),Wr(!1),qe=!0,Re=!0,Ze=!0,Xe=!0,Rr()}function Qe(n,e){i.width=ke=ye=n,i.height=_e=Me=e,Fe=Ne=0,function(){var n=!1,e=!1,r=!1,t=!1;kn.forEach((l=>{if(l.show&&l._show){var i=l.side,a=i%2,o=l._size+(l.labelSize=null!=l.label?l.labelSize||30:0);o>0&&(a?(ye-=o,3==i?(Fe+=o,t=!0):r=!0):(Me-=o,0==i?(Ne+=o,n=!0):e=!0))}})),mr[0]=n,mr[1]=r,mr[2]=e,mr[3]=t,ye-=xr[1]+xr[3],Fe+=xr[3],Me-=xr[2]+xr[0],Ne+=xr[0]}(),function(){var n=Fe+ye,e=Ne+Me,r=Fe,t=Ne;function l(l,i){switch(l){case 1:return(n+=i)-i;case 2:return(e+=i)-i;case 3:return(r-=i)+i;case 0:return(t-=i)+i}}kn.forEach((n=>{if(n.show&&n._show){var e=n.side;n._pos=l(e,n._size),null!=n.label&&(n._lpos=l(e,n.labelSize))}}))}();var r=i.bbox;Ie=r.left=M(Fe*fn,.5),Le=r.top=M(Ne*fn,.5),je=r.width=M(ye*fn,.5),Ge=r.height=M(Me*fn,.5)}i.setSize=function(n){Ke(n.width,n.height)};var $e=i.cursor=V({},ce,e.cursor);$e._lock=!1;var nr=$e.points;nr.show=z(nr.show),nr.size=z(nr.size),nr.stroke=z(nr.stroke),nr.width=z(nr.width),nr.fill=z(nr.fill);var cr=i.focus=V({},e.focus||{alpha:.3},$e.focus),vr=cr.prox>=0,hr=[null];function dr(n,e){var r=_n[n.scale].time,t=n.value;if(n.value=r?N(t)?ie(jn,le(t,Gn)):t||Un:t||ze,n.label=n.label||(r?"Time":"Value"),e>0){n.width=null==n.width?1:n.width,n.paths=n.paths||er||D,n.fillTo=z(n.fillTo||Ee),n.stroke=z(n.stroke||null),n.fill=z(n.fill||null),n._stroke=n._fill=n._paths=null;var l=De(n.width,1),a=n.points=V({},{size:l,width:g(1,.2*l),stroke:n.stroke,space:2*l,_stroke:null,_fill:null},n.points);a.show=z(a.show),a.fill=z(a.fill),a.stroke=z(a.stroke)}if(Kn&&se.splice(e,0,function(n,e){if(0==e&&(ue||!Jn.live))return null;var r=[],t=dn("tr","u-series",On,On.childNodes[e]);cn(t,n.class),n.show||cn(t,an);var l=dn("th",null,t),a=mn("u-marker",l);if(e>0){var o=Jn.width(i,e);o&&(a.style.border=o+"px "+Jn.dash(i,e)+" "+Jn.stroke(i,e)),a.style.background=Jn.fill(i,e)}var s=mn(on,l);for(var u in s.textContent=n.label,e>0&&(me("click",l,(()=>{$e._lock||it(bn.indexOf(n),{show:!n.show},zt.setSeries)})),vr&&me(nn,l,(()=>{$e._lock||it(bn.indexOf(n),at,zt.setSeries)}))),te){var f=dn("td","u-value",t);f.textContent="--",r.push(f)}return r}(n,e)),$e.show){var o=function(n,e){if(e>0){var r=$e.points.show(i,e);if(r)return cn(r,"u-cursor-pt"),cn(r,n.class),pn(r,-10,-10,ye,Me),Z.insertBefore(r,hr[e]),r}}(n,e);o&&hr.splice(e,0,o)}}i.addSeries=function(n,e){n=tr(n,e=null==e?bn.length:e,ge,Pe),bn.splice(e,0,n),dr(bn[e],e)},i.delSeries=function(n){bn.splice(n,1),Kn&&se.splice(n,1)[0][0].parentNode.remove(),hr.length>1&&hr.splice(n,1)[0].remove()},bn.forEach(dr);var mr=[!1,!1,!1,!1];function pr(n,e,r){var t=r[0],l=r[1],i=r[2],a=r[3],o=e%2,s=0;return 0==o&&(a||l)&&(s=0==e&&!t||2==e&&!i?d(pe.size/3):0),1==o&&(t||i)&&(s=1==e&&!l||3==e&&!a?d(Te.size/2):0),s}kn.forEach((function(n,e){if(n._show=n.show,n.show){var r=_n[n.scale];null==r&&(n.scale=n.side%2?bn[1].scale:Mn,r=_n[n.scale]);var t=r.time;n.size=z(n.size),n.space=z(n.space),n.rotate=z(n.rotate),n.incrs=z(n.incrs||(2==r.distr?An:t?1==gn?qn:Qn:Hn)),n.splits=z(n.splits||(t&&1==r.distr?Bn:3==r.distr?be:xe)),n.stroke=z(n.stroke),n.grid.stroke=z(n.grid.stroke),n.ticks.stroke=z(n.ticks.stroke);var l=n.values;n.values=t?F(l)?re(jn,ee(l,Gn)):N(l)?function(n,e){var r=Dn(e);return(e,t)=>t.map((e=>r(n(e))))}(jn,l):l||Rn:l||we,n.filter=z(n.filter||(3==r.distr?Se:T)),n.font=fr(n.font),n.labelFont=fr(n.labelFont),n._size=n.size(i,null,e,0),n._space=n._rotate=n._incrs=n._found=n._splits=n._values=null,n._size>0&&(mr[e]=!0)}}));var gr,wr=i.padding=(e.padding||[pr,pr,pr,pr]).map((n=>z(s(n,pr)))),xr=i._padding=wr.map(((n,e)=>n(i,e,mr,0))),br=null,kr=null,_r=bn[0].idxs,yr=null,Mr=!1;function Sr(n,e){if((n=n||[])[0]=n[0]||[],i.data=n,r=n.slice(),gr=(yr=r[0]).length,2==Nn&&(r[0]=yr.map(((n,e)=>e))),i._data=r,Wr(!0),St("setData"),!1!==e){var t=Fn;t.auto(i,Mr)?zr():lt(Mn,t.min,t.max),Ze=!0,Xe=!0,Rr()}}function zr(){var n,e,t,i;Mr=!0,gr>0?(br=_r[0]=0,kr=_r[1]=gr-1,t=r[0][br],i=r[0][kr],2==Nn?(t=br,i=kr):1==gr&&(3==Nn?(t=(n=l(t,t,Fn.log,!1))[0],i=n[1]):Fn.time?i=t+86400/gn:(t=(e=o(t,i,.1,!0))[0],i=e[1]))):(br=_r[0]=t=null,kr=_r[1]=i=null),lt(Mn,t,i)}function Tr(n,e,r,t,l){C.strokeStyle=n||X,C.lineWidth=e,C.lineJoin="round",C.lineCap=t||"butt",C.setLineDash(r||[]),C.fillStyle=l||X}function Dr(n,e,r,t,l,i,a,o,s,u){var f=a%2/2;C.translate(f,f),Tr(o,a,s,u),C.beginPath();var c,v,h,d,m=l+(0==t||3==t?-i:i);0==r?(v=l,d=m):(c=l,h=m),n.forEach(((n,t)=>{null!=e[t]&&(0==r?c=h=n:v=d=n,C.moveTo(c,v),C.lineTo(h,d))})),C.stroke(),C.translate(-f,-f)}function Er(n){var e=!0;return kn.forEach(((r,t)=>{if(r.show){var l=_n[r.scale];if(null!=l.min){r._show||(e=!1,r._show=!0,Wr(!1));var a=r.side,o=l.min,s=l.max,u=function(n,e,r,t){var l,a=kn[n];if(t>0){var o=a._space=a.space(i,n,e,r,t),s=a._incrs=a.incrs(i,n,e,r,t,o);l=a._found=function(n,e,r,t,l){for(var i=t/(e-n),a=(""+h(n)).length,o=0;r.length>o;o++){var s=r[o]*i,u=10>r[o]?Y.get(r[o]):0;if(s>=l&&17>a+u)return[r[o],s]}return[0,0]}(e,r,s,t,o)}else l=[0,0];return l}(t,o,s,0==a%2?ye:Me),f=u[0],c=u[1];if(0!=c){var v=r._splits=r.splits(i,t,o,s,f,c,2==l.distr),d=2==l.distr?v.map((n=>yr[n])):v,p=2==l.distr?yr[v[1]]-yr[v[0]]:f,g=r._values=r.values(i,r.filter(i,d,t,c,p),t,c,p);r._rotate=2==a?r.rotate(i,g,t,c):0;var w=r._size;r._size=m(r.size(i,g,t,n)),null!=w&&r._size!=w&&(e=!1)}}else r._show&&(e=!1,r._show=!1,Wr(!1))}})),e}function Pr(n){var e=!0;return wr.forEach(((r,t)=>{var l=r(i,t,mr,n);l!=xr[t]&&(e=!1),xr[t]=l})),e}function Wr(n){bn.forEach(((e,r)=>{r>0&&(e._paths=null,n&&(e.min=null,e.max=null))}))}i.setData=Sr;var Yr,Cr,Ar,Hr,Fr,Nr,Ir,Lr,Vr,Or,jr,Gr,Br=!1;function Rr(){Br||(j(Ur),Br=!0)}function Ur(){Be&&(function(){var e=L(_n);for(var t in e){var l=e[t],a=In[t];if(null!=a&&null!=a.min)V(l,a),t==Mn&&Wr(!0);else if(t!=Mn)if(0==gr&&null==l.from){var o=l.range(i,null,null,t);l.min=o[0],l.max=o[1]}else l.min=y,l.max=-y}if(gr>0)for(var s in bn.forEach(((t,l)=>{var a=t.scale,o=e[a],s=In[a];if(0==l){var u=o.range(i,o.min,o.max,a);o.min=u[0],o.max=u[1],br=n(o.min,r[0]),kr=n(o.max,r[0]),o.min>r[0][br]&&br++,r[0][kr]>o.max&&kr--,t.min=yr[br],t.max=yr[kr]}else if(t.show&&t.auto&&o.auto(i,Mr)&&(null==s||null==s.min)){var f=null==t.min?3==o.distr?function(n,e,r){for(var t=y,l=-y,i=e;r>=i;i++)n[i]>0&&(t=p(t,n[i]),l=g(l,n[i]));return[t==y?1:t,l==-y?10:l]}(r[l],br,kr):function(n,e,r,t){var l=y,i=-y;if(1==t)l=n[e],i=n[r];else if(-1==t)l=n[r],i=n[e];else for(var a=e;r>=a;a++)null!=n[a]&&(l=p(l,n[a]),i=g(i,n[a]));return[l,i]}(r[l],br,kr,t.sorted):[t.min,t.max];o.min=p(o.min,t.min=f[0]),o.max=g(o.max,t.max=f[1])}t.idxs[0]=br,t.idxs[1]=kr})),e){var u=e[s],f=In[s];if(null==u.from&&(null==f||null==f.min)){var c=u.range(i,u.min==y?null:u.min,u.max==-y?null:u.max,s);u.min=c[0],u.max=c[1]}}for(var v in e){var h=e[v];if(null!=h.from){var d=e[h.from],m=h.range(i,d.min,d.max,v);h.min=m[0],h.max=m[1]}}var w={},x=!1;for(var b in e){var k=e[b],_=_n[b];_.min==k.min&&_.max==k.max||(_.min=k.min,_.max=k.max,w[b]=x=!0)}if(x){for(var M in bn.forEach((n=>{w[n.scale]&&(n._paths=null)})),w)qe=!0,St("setScale",M);$e.show&&(Ze=!0)}for(var S in In)In[S]=null}(),Be=!1),qe&&(function(){for(var n=!1,e=0;!n;){var r=Er(++e),t=Pr(e);(n=r&&t)||(Qe(i.width,i.height),Re=!0)}}(),qe=!1),Re&&(hn(O,J,Fe),hn(O,R,Ne),hn(O,G,ye),hn(O,B,Me),hn(Z,J,Fe),hn(Z,R,Ne),hn(Z,G,ye),hn(Z,B,Me),hn(A,G,ke),hn(A,B,_e),P.width=d(ke*fn),P.height=d(_e*fn),mt(),St("setSize"),Re=!1),$e.show&&Ze&&(ht(),Ze=!1),ke>0&&_e>0&&(C.clearRect(0,0,P.width,P.height),St("drawClear"),zn.forEach((n=>n())),St("draw")),x||(x=!0,i.status=1,St("ready")),Mr=!1,Br=!1}function Jr(e,t){var l=_n[e];if(null==l.from){if(0==gr){var a=l.range(i,t.min,t.max,e);t.min=a[0],t.max=a[1]}if(t.min>t.max){var o=t.min;t.min=t.max,t.max=o}if(gr>1&&null!=t.min&&null!=t.max&&1e-16>t.max-t.min)return;e==Mn&&2==l.distr&&gr>0&&(t.min=n(t.min,r[0]),t.max=n(t.max,r[0])),In[e]=t,Be=!0,Rr()}}i.redraw=n=>{!1!==n?lt(Mn,Fn.min,Fn.max):Rr()},i.setScale=Jr;var qr=!1,Zr=$e.drag,Xr=Zr.x,Kr=Zr.y;$e.show&&($e.x&&(Yr=mn("u-cursor-x",Z)),$e.y&&(Cr=mn("u-cursor-y",Z)),0==Fn.ori?(Ar=Yr,Hr=Cr):(Ar=Cr,Hr=Yr),jr=$e.left,Gr=$e.top);var Qr,$r,nt,et=i.select=V({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),rt=et.show?mn("u-select",et.over?Z:O):null;function tt(n,e){if(et.show){for(var r in n)hn(rt,r,et[r]=n[r]);!1!==e&&St("setSelect")}}function lt(n,e,r){Jr(n,{min:e,max:r})}function it(n,e,r){var t=bn[n];null!=e.focus&&function(n){n!=nt&&(bn.forEach(((e,r)=>{!function(n,e){!function(n,e){bn[n].alpha=e,$e.show&&hr[n]&&(hr[n].style.opacity=e),Kn&&se[n]&&(se[n][0].parentNode.style.opacity=e)}(n,e)}(r,null==n||0==r||r==n?1:cr.alpha)})),nt=n,Rr())}(n),null!=e.show&&(t.show=e.show,function(n){var e=Kn?se[n][0].parentNode:null;bn[n].show?e&&vn(e,an):(e&&cn(e,an),hr.length>1&&pn(hr[n],-10,-10,ye,Me))}(n),lt(t.scale,null,null),Rr()),St("setSeries",n,e),r&&Dt.pub("setSeries",i,n,e)}i.setSelect=tt,i.setSeries=it;var at={focus:!0},ot={focus:!1};function st(n,e){var r=_n[e],t=ye;1==r.ori&&(n=(t=Me)-n),-1==r.dir&&(n=t-n);var l=r.min,i=r.max,a=n/t;return 3==r.distr?(l=b(l),i=b(i),w(10,l+(i-l)*a)):l+(i-l)*a}function ut(n,e){hn(rt,J,et.left=n),hn(rt,G,et.width=e)}function ft(n,e){hn(rt,R,et.top=n),hn(rt,B,et.height=e)}Kn&&vr&&wn(en,On,(()=>{$e._lock||(it(null,ot,zt.setSeries),ht())})),i.valToIdx=e=>n(e,r[0]),i.posToIdx=function(e){return n(st(e,Mn),r[0],br,kr)},i.posToVal=st,i.valToPos=(n,e,r)=>0==_n[e].ori?u(n,_n[e],r?je:ye,r?Ie:0):f(n,_n[e],r?Ge:Me,r?Le:0),i.batch=function(n){n(i),Rr()},i.setCursor=n=>{jr=n.left,Gr=n.top,ht()};var ct=0==Fn.ori?ut:ft,vt=1==Fn.ori?ut:ft;function ht(e,t){var l,a;Vr=jr,Or=Gr,l=$e.move(i,jr,Gr),jr=l[0],Gr=l[1],$e.show&&(Ar&&pn(Ar,d(jr),0,ye,Me),Hr&&pn(Hr,0,d(Gr),ye,Me)),Qr=y;var o=0==Fn.ori?ye:Me,s=1==Fn.ori?ye:Me;if(0>jr||0==gr||br>kr){a=null;for(var u=0;bn.length>u;u++)if(u>0&&hr.length>1&&pn(hr[u],-10,-10,ye,Me),Kn&&Jn.live){if(0==u&&ue)continue;for(var f=0;se[u].length>f;f++)se[u][f].firstChild.nodeValue="--"}vr&&it(null,at,zt.setSeries)}else{var c=st(0==Fn.ori?jr:Gr,Mn);a=n(c,r[0],br,kr);for(var h=E(Pn(r[0][a],Fn,o,0),.5),m=0;bn.length>m;m++){var g=bn[m],w=$e.dataIdx(i,m,a,c),b=w==a?h:E(Pn(r[0][w],Fn,o,0),.5);if(m>0&&g.show){var k=r[m][w],_=null==k?-10:E(Wn(k,_n[g.scale],s,0),.5);if(_>0){var M=v(_-Gr);M>Qr||(Qr=M,$r=m)}var S=void 0,z=void 0;0==Fn.ori?(S=b,z=_):(S=_,z=b),hr.length>1&&pn(hr[m],S,z,ye,Me)}if(Kn&&Jn.live){if(w==$e.idx&&!Xe||0==m&&ue)continue;var T=0==m&&2==Nn?yr:r[m],D=ue?g.values(i,m,w):{_:g.value(i,T[w],m,w)},P=0;for(var W in D)se[m][P++].firstChild.nodeValue=D[W]}}Xe=!1}if(et.show&&qr)if(null!=t){var Y=zt.scales,C=Y[0],A=Y[1],H=t.cursor.drag;Xr=H._x,Kr=H._y;var F,N,I,L,V,O=t.select,j=O.left,G=O.top,B=O.width,R=O.height,U=t.scales[C].ori,J=t.posToVal;C&&(0==U?(F=j,N=B):(F=G,N=R),I=_n[C],L=Pn(J(F,C),I,o,0),V=Pn(J(F+N,C),I,o,0),ct(p(L,V),v(V-L)),A||vt(0,s)),A&&(1==U?(F=j,N=B):(F=G,N=R),I=_n[A],L=Wn(J(F,A),I,s,0),V=Wn(J(F+N,A),I,s,0),vt(p(L,V),v(V-L)),C||ct(0,o))}else{var q=v(Vr-Fr),Z=v(Or-Nr);if(1==Fn.ori){var X=q;q=Z,Z=X}Xr=Zr.x&&q>=Zr.dist,Kr=Zr.y&&Z>=Zr.dist;var Q,$,nn=Zr.uni;null!=nn?Xr&&Kr&&(Kr=Z>=nn,(Xr=q>=nn)||Kr||(Z>q?Kr=!0:Xr=!0)):Zr.x&&Zr.y&&(Xr||Kr)&&(Xr=Kr=!0),Xr&&(0==Fn.ori?(Q=Ir,$=jr):(Q=Lr,$=Gr),ct(p(Q,$),v($-Q)),Kr||vt(0,s)),Kr&&(1==Fn.ori?(Q=Ir,$=jr):(Q=Lr,$=Gr),vt(p(Q,$),v($-Q)),Xr||ct(0,o)),Xr||Kr||(ct(0,0),vt(0,0))}if($e.idx=a,$e.left=jr,$e.top=Gr,Zr._x=Xr,Zr._y=Kr,null!=e&&(Dt.pub(K,i,jr,Gr,o,s,a),vr)){var en=zt.setSeries,rn=cr.prox;null==nt?Qr>rn||it($r,at,en):Qr>rn?it(null,at,en):$r!=nt&&it($r,at,en)}x&&St("setCursor")}var dt=null;function mt(){dt=Z.getBoundingClientRect()}function pt(n,e,r,t,l,i){$e._lock||(gt(n,e,r,t,l,i,0,!1,null!=n),null!=n?ht(1):ht(null,e))}function gt(n,e,r,t,l,a,o,s,u){var f;if(null!=n)r=n.clientX-dt.left,t=n.clientY-dt.top;else{if(0>r||0>t)return jr=-10,void(Gr=-10);var v=ye,h=Me,d=l,m=a,p=r,g=t;1==Fn.ori&&(v=Me,h=ye);var w=zt.scales,x=w[0],b=w[1];if(1==e.scales[x].ori&&(d=a,m=l,p=t,g=r),r=null!=x?c(e.posToVal(p,x),_n[x],v,0):v*(p/d),t=null!=b?c(e.posToVal(g,b),_n[b],h,0):h*(g/m),1==Fn.ori){var k=r;r=t,t=k}}u&&(r>1&&ye-1>r||(r=M(r,ye)),t>1&&Me-1>t||(t=M(t,Me))),s?(Fr=r,Nr=t,f=$e.move(i,r,t),Ir=f[0],Lr=f[1]):(jr=r,Gr=t)}function wt(){tt({width:0,height:0},!1)}function xt(n,e,r,t,l,a){qr=!0,Xr=Kr=Zr._x=Zr._y=!1,gt(n,e,r,t,l,a,0,!0,!1),null!=n&&(me($,sn,bt),Dt.pub(Q,i,Ir,Lr,ye,Me,null))}function bt(n,e,r,t,l,a){qr=Zr._x=Zr._y=!1,gt(n,e,r,t,l,a,0,!1,!0);var o=et.left,s=et.top,u=et.width,f=et.height,c=u>0||f>0;if(c&&tt(et),Zr.setScale&&c){var v=o,h=u,d=s,m=f;if(1==Fn.ori&&(v=s,h=f,d=o,m=u),Xr&<(Mn,st(v,Mn),st(v+h,Mn)),Kr)for(var p in _n){var g=_n[p];p!=Mn&&null==g.from&&g.min!=y&<(p,st(d+m,p),st(d,p))}wt()}else $e.lock&&($e._lock=!$e._lock,$e._lock||ht());null!=n&&(function(n,e){var r=de.get(e)||{};xn(n,e,r[n]),r[n]=null}($,sn),Dt.pub($,i,jr,Gr,ye,Me,null))}function kt(n){zr(),wt(),null!=n&&Dt.pub(rn,i,jr,Gr,ye,Me,null)}var _t,yt={};yt.mousedown=xt,yt.mousemove=pt,yt.mouseup=bt,yt.dblclick=kt,yt.setSeries=(n,e,r,t)=>{it(r,t)},$e.show&&(me(Q,Z,xt),me(K,Z,pt),me(nn,Z,mt),me(en,Z,(function(){if(!$e._lock){var n=qr;if(qr){var e,r,t=!0,l=!0;0==Fn.ori?(e=Xr,r=Kr):(e=Kr,r=Xr),e&&r&&(t=10>=jr||jr>=ye-10,l=10>=Gr||Gr>=Me-10),e&&t&&(jr=Ir>jr?0:ye),r&&l&&(Gr=Lr>Gr?0:Me),ht(1),qr=!1}jr=-10,Gr=-10,ht(1),n&&(qr=n)}})),me(rn,Z,kt),_t=function(n){var e=null;function r(){e=null,n()}return function(){clearTimeout(e),e=setTimeout(r,100)}}(mt),wn(tn,un,_t),wn(ln,un,_t),i.syncRect=mt);var Mt=i.hooks=e.hooks||{};function St(n,e,r){n in Mt&&Mt[n].forEach((n=>{n.call(null,i,e,r)}))}(e.plugins||[]).forEach((n=>{for(var e in n.hooks)Mt[e]=(Mt[e]||[]).concat(n.hooks[e])}));var zt=V({key:null,setSeries:!1,scales:[Mn,null]},$e.sync),Tt=zt.key,Dt=null!=Tt?Ae[Tt]=Ae[Tt]||He():He();function Et(){St("init",e,r),Sr(r||e.data,!1),In[Mn]?Jr(Mn,In[Mn]):zr(),Ke(e.width,e.height),tt(et,!1)}return Dt.sub(i),i.pub=function(n,e,r,t,l,i,a){yt[n](null,e,r,t,l,i,a)},i.destroy=function(){Dt.unsub(i),xn(tn,un,_t),xn(ln,un,_t),k.remove(),St("destroy")},t?t instanceof HTMLElement?(t.appendChild(k),Et()):t(i,Et):Et(),i}cr.assign=V,cr.fmtNum=f,cr.rangeNum=o,cr.rangeLog=l,cr.orient=Fe,cr.join=function(n,e){if(1==n.length)return n[0];for(var r=new Set,t=0;n.length>t;t++)for(var l=n[t][0],i=l.length,a=0;i>a;a++)r.add(l[a]);for(var o=[Array.from(r).sort(((n,e)=>n-e))],s=o[0].length,u=new Map,f=0;s>f;f++)u.set(o[0][f],f);for(var c=0;n.length>c;c++)for(var v=n[c],h=v[0],d=1;v.length>d;d++){for(var m=v[d],p=Array(s).fill(void 0),g=e?e[c][d]:1,w=[],x=0;m.length>x;x++){var b=m[x],k=u.get(h[x]);null==b?0!=g&&(p[k]=b,2==g&&w.push(k)):p[k]=b}O(p,w,s),o.push(p)}return o},cr.fmtDate=Dn,cr.tzDate=function(n,e){var r;return"Etc/UTC"==e?r=new Date(+n+6e4*n.getTimezoneOffset()):e==En?r=n:(r=new Date(n.toLocaleString("en-US",{timeZone:e}))).setMilliseconds(n.getMilliseconds()),r},cr.addGap=Le,cr.clipGaps=Ie;var vr=cr.paths={};return vr.linear=$e,vr.spline=function(){return(n,r,t,l)=>Fe(n,r,((i,a,o,s,u,f,c,v,h,m,p)=>{var g,w,x;0==s.ori?(g=Ve,x=je,w=qe):(g=Oe,x=Ge,w=Ze);var b=1*s.dir*(0==s.ori?1:-1);t=e(o,t,l,1),l=e(o,t,l,-1);for(var k=[],_=!1,y=d(f(a[1==b?t:l],s,m,v)),M=y,S=[],z=[],T=1==b?t:l;T>=t&&l>=T;T+=b){var D=o[T],E=f(a[T],s,m,v);null!=D?(_&&(Le(k,M,E),_=!1),S.push(M=E),z.push(c(o[T],u,p,h))):null===D&&(Le(k,M,E),_=!0)}var P={stroke:nr(S,z,.5,g,w),fill:null,clip:null,band:null},W=P.stroke;if(null!=i.fill){var Y=P.fill=new Path2D(W),C=i.fillTo(n,r,i.min,i.max),A=d(c(C,u,p,h));x(Y,M,A),x(Y,y,A)}return i.spanGaps||(P.clip=Ie(k,s.ori,v,h,m,p)),n.bands.length>0&&(P.band=Ne(n,r,t,l,W)),P}))},vr.stepped=function(n){var r=s(n.align,1);return(n,t,l,i)=>Fe(n,t,((a,o,s,u,f,c,v,h,m,p,g)=>{var w=0==u.ori?je:Ge,x={stroke:new Path2D,fill:null,clip:null,band:null},b=x.stroke,k=1*u.dir*(0==u.ori?1:-1);l=e(s,l,i,1),i=e(s,l,i,-1);var _=[],y=!1,M=d(v(s[1==k?l:i],f,g,m)),S=d(c(o[1==k?l:i],u,p,h)),z=S;w(b,S,M);for(var T=1==k?l:i;T>=l&&i>=T;T+=k){var D=s[T],E=d(c(o[T],u,p,h));if(null!=D){var P=d(v(D,f,g,m));if(y){if(Le(_,z,E),M!=P){var W=a.width*fn/2,Y=_[_.length-1];Y[0]+=W,Y[1]-=W}y=!1}1==r?w(b,E,M):w(b,z,P),w(b,E,P),M=P,z=E}else null===D&&(Le(_,z,E),y=!0)}if(null!=a.fill){var C=x.fill=new Path2D(b),A=a.fillTo(n,t,a.min,a.max),H=d(v(A,f,g,m));w(C,z,H),w(C,S,H)}return a.spanGaps||(x.clip=Ie(_,u.ori,h,m,p,g)),n.bands.length>0&&(x.band=Ne(n,t,l,i,b)),x}))},vr.bars=function(n){var r=s((n=n||H).size,[.6,y]),t=n.align||0,l=1-r[0],i=s(r[1],y)*fn;return(n,r,a,o)=>Fe(n,r,((s,u,f,c,v,h,m,w,x,b,k)=>{var _,y=0==c.ori?Be:Re,S=h(u[1],c,b,w)-h(u[0],c,b,w),z=S*l,T=m(s.fillTo(n,r,s.min,s.max),v,k,x),D=d(s.width*fn),E=d(p(i,S-z)-D),P=1==t?0:-1==t?E:E/2,W={stroke:new Path2D,fill:null,clip:null,band:null},Y=n.bands.length>0;Y&&(W.band=new Path2D,_=M(m(v.max,v,k,x),.5));for(var C=W.stroke,A=W.band,H=c.dir*(0==c.ori?1:-1),F=1==H?a:o;F>=a&&o>=F;F+=H){var N=f[F];if(null==N){if(!Y)continue;var I=e(f,1==H?a:o,F,-H),L=e(f,F,1==H?o:a,H),V=f[I];N=V+(F-I)/(L-I)*(f[L]-V)}var O=h(2==c.distr?F:u[F],c,b,w),j=m(N,v,k,x),G=d(O-P),B=d(g(j,T)),R=d(p(j,T)),U=B-R;null!=f[F]&&y(C,G,R,E,U),Y&&(B=R,y(A,G,R=_,E,U=B-R))}return null!=s.fill&&(W.fill=new Path2D(C)),W}))},cr}();