From 7b9987202fa818c16dd8cf45a9589209dd9ed1e7 Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Jun 13 2017 10:54:46 +0000 Subject: cleanup: move static js/css to vendor dir Signed-off-by: Shengjing Zhu --- diff --git a/pagure/static/atwho/jquery.atwho-1.5.1.css b/pagure/static/atwho/jquery.atwho-1.5.1.css deleted file mode 100644 index dad94ed..0000000 --- a/pagure/static/atwho/jquery.atwho-1.5.1.css +++ /dev/null @@ -1,72 +0,0 @@ -.atwho-view { - position:absolute; - top: 0; - left: 0; - display: none; - margin-top: 18px; - background: white; - color: black; - border: 1px solid #DDD; - border-radius: 3px; - box-shadow: 0 0 5px rgba(0,0,0,0.1); - min-width: 120px; - z-index: 11110 !important; -} - -.atwho-view .atwho-header { - padding: 5px; - margin: 5px; - cursor: pointer; - border-bottom: solid 1px #eaeff1; - color: #6f8092; - font-size: 11px; - font-weight: bold; -} - -.atwho-view .atwho-header .small { - color: #6f8092; - float: right; - padding-top: 2px; - margin-right: -5px; - font-size: 12px; - font-weight: normal; -} - -.atwho-view .atwho-header:hover { - cursor: default; -} - -.atwho-view .cur { - background: #3366FF; - color: white; -} -.atwho-view .cur small { - color: white; -} -.atwho-view strong { - color: #3366FF; -} -.atwho-view .cur strong { - color: white; - font:bold; -} -.atwho-view ul { - /* width: 100px; */ - list-style:none; - padding:0; - margin:auto; - max-height: 200px; - overflow-y: auto; -} -.atwho-view ul li { - display: block; - padding: 5px 10px; - border-bottom: 1px solid #DDD; - cursor: pointer; - /* border-top: 1px solid #C8C8C8; */ -} -.atwho-view small { - font-size: smaller; - color: #777; - font-weight: normal; -} diff --git a/pagure/static/atwho/jquery.atwho-1.5.1.js b/pagure/static/atwho/jquery.atwho-1.5.1.js deleted file mode 100644 index 0d295eb..0000000 --- a/pagure/static/atwho/jquery.atwho-1.5.1.js +++ /dev/null @@ -1,1202 +0,0 @@ -/** - * at.js - 1.5.1 - * Copyright (c) 2016 chord.luo ; - * Homepage: http://ichord.github.com/At.js - * License: MIT - */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(jQuery); - } -}(this, function ($) { -var DEFAULT_CALLBACKS, KEY_CODE; - -KEY_CODE = { - DOWN: 40, - UP: 38, - ESC: 27, - TAB: 9, - ENTER: 13, - CTRL: 17, - A: 65, - P: 80, - N: 78, - LEFT: 37, - UP: 38, - RIGHT: 39, - DOWN: 40, - BACKSPACE: 8, - SPACE: 32 -}; - -DEFAULT_CALLBACKS = { - beforeSave: function(data) { - return Controller.arrayToDefaultHash(data); - }, - matcher: function(flag, subtext, should_startWithSpace, acceptSpaceBar) { - var _a, _y, match, regexp, space; - flag = flag.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - if (should_startWithSpace) { - flag = '(?:^|\\s)' + flag; - } - _a = decodeURI("%C3%80"); - _y = decodeURI("%C3%BF"); - space = acceptSpaceBar ? "\ " : ""; - regexp = new RegExp(flag + "([A-Za-z" + _a + "-" + _y + "0-9_" + space + "\'\.\+\-]*)$|" + flag + "([^\\x00-\\xff]*)$", 'gi'); - match = regexp.exec(subtext); - if (match) { - return match[2] || match[1]; - } else { - return null; - } - }, - filter: function(query, data, searchKey) { - var _results, i, item, len; - _results = []; - for (i = 0, len = data.length; i < len; i++) { - item = data[i]; - if (~new String(item[searchKey]).toLowerCase().indexOf(query.toLowerCase())) { - _results.push(item); - } - } - return _results; - }, - remoteFilter: null, - sorter: function(query, items, searchKey) { - var _results, i, item, len; - if (!query) { - return items; - } - _results = []; - for (i = 0, len = items.length; i < len; i++) { - item = items[i]; - item.atwho_order = new String(item[searchKey]).toLowerCase().indexOf(query.toLowerCase()); - if (item.atwho_order > -1) { - _results.push(item); - } - } - return _results.sort(function(a, b) { - return a.atwho_order - b.atwho_order; - }); - }, - tplEval: function(tpl, map) { - var error, error1, template; - template = tpl; - try { - if (typeof tpl !== 'string') { - template = tpl(map); - } - return template.replace(/\$\{([^\}]*)\}/g, function(tag, key, pos) { - return map[key]; - }); - } catch (error1) { - error = error1; - return ""; - } - }, - highlighter: function(li, query) { - var regexp; - if (!query) { - return li; - } - regexp = new RegExp(">\\s*(\\w*?)(" + query.replace("+", "\\+") + ")(\\w*)\\s*<", 'ig'); - return li.replace(regexp, function(str, $1, $2, $3) { - return '> ' + $1 + '' + $2 + '' + $3 + ' <'; - }); - }, - beforeInsert: function(value, $li, e) { - return value; - }, - beforeReposition: function(offset) { - return offset; - }, - afterMatchFailed: function(at, el) {} -}; - -var App; - -App = (function() { - function App(inputor) { - this.currentFlag = null; - this.controllers = {}; - this.aliasMaps = {}; - this.$inputor = $(inputor); - this.setupRootElement(); - this.listen(); - } - - App.prototype.createContainer = function(doc) { - var ref; - if ((ref = this.$el) != null) { - ref.remove(); - } - return $(doc.body).append(this.$el = $("
")); - }; - - App.prototype.setupRootElement = function(iframe, asRoot) { - var error, error1; - if (asRoot == null) { - asRoot = false; - } - if (iframe) { - this.window = iframe.contentWindow; - this.document = iframe.contentDocument || this.window.document; - this.iframe = iframe; - } else { - this.document = this.$inputor[0].ownerDocument; - this.window = this.document.defaultView || this.document.parentWindow; - try { - this.iframe = this.window.frameElement; - } catch (error1) { - error = error1; - this.iframe = null; - if ($.fn.atwho.debug) { - throw new Error("iframe auto-discovery is failed.\nPlease use `setIframe` to set the target iframe manually.\n" + error); - } - } - } - return this.createContainer((this.iframeAsRoot = asRoot) ? this.document : document); - }; - - App.prototype.controller = function(at) { - var c, current, currentFlag, ref; - if (this.aliasMaps[at]) { - current = this.controllers[this.aliasMaps[at]]; - } else { - ref = this.controllers; - for (currentFlag in ref) { - c = ref[currentFlag]; - if (currentFlag === at) { - current = c; - break; - } - } - } - if (current) { - return current; - } else { - return this.controllers[this.currentFlag]; - } - }; - - App.prototype.setContextFor = function(at) { - this.currentFlag = at; - return this; - }; - - App.prototype.reg = function(flag, setting) { - var base, controller; - controller = (base = this.controllers)[flag] || (base[flag] = this.$inputor.is('[contentEditable]') ? new EditableController(this, flag) : new TextareaController(this, flag)); - if (setting.alias) { - this.aliasMaps[setting.alias] = flag; - } - controller.init(setting); - return this; - }; - - App.prototype.listen = function() { - return this.$inputor.on('compositionstart', (function(_this) { - return function(e) { - var ref; - if ((ref = _this.controller()) != null) { - ref.view.hide(); - } - _this.isComposing = true; - return null; - }; - })(this)).on('compositionend', (function(_this) { - return function(e) { - _this.isComposing = false; - setTimeout(function(e) { - return _this.dispatch(e); - }); - return null; - }; - })(this)).on('keyup.atwhoInner', (function(_this) { - return function(e) { - return _this.onKeyup(e); - }; - })(this)).on('keydown.atwhoInner', (function(_this) { - return function(e) { - return _this.onKeydown(e); - }; - })(this)).on('blur.atwhoInner', (function(_this) { - return function(e) { - var c; - if (c = _this.controller()) { - c.expectedQueryCBId = null; - return c.view.hide(e, c.getOpt("displayTimeout")); - } - }; - })(this)).on('click.atwhoInner', (function(_this) { - return function(e) { - return _this.dispatch(e); - }; - })(this)).on('scroll.atwhoInner', (function(_this) { - return function() { - var lastScrollTop; - lastScrollTop = _this.$inputor.scrollTop(); - return function(e) { - var currentScrollTop, ref; - currentScrollTop = e.target.scrollTop; - if (lastScrollTop !== currentScrollTop) { - if ((ref = _this.controller()) != null) { - ref.view.hide(e); - } - } - lastScrollTop = currentScrollTop; - return true; - }; - }; - })(this)()); - }; - - App.prototype.shutdown = function() { - var _, c, ref; - ref = this.controllers; - for (_ in ref) { - c = ref[_]; - c.destroy(); - delete this.controllers[_]; - } - this.$inputor.off('.atwhoInner'); - return this.$el.remove(); - }; - - App.prototype.dispatch = function(e) { - var _, c, ref, results; - ref = this.controllers; - results = []; - for (_ in ref) { - c = ref[_]; - results.push(c.lookUp(e)); - } - return results; - }; - - App.prototype.onKeyup = function(e) { - var ref; - switch (e.keyCode) { - case KEY_CODE.ESC: - e.preventDefault(); - if ((ref = this.controller()) != null) { - ref.view.hide(); - } - break; - case KEY_CODE.DOWN: - case KEY_CODE.UP: - case KEY_CODE.CTRL: - case KEY_CODE.ENTER: - $.noop(); - break; - case KEY_CODE.P: - case KEY_CODE.N: - if (!e.ctrlKey) { - this.dispatch(e); - } - break; - default: - this.dispatch(e); - } - }; - - App.prototype.onKeydown = function(e) { - var ref, view; - view = (ref = this.controller()) != null ? ref.view : void 0; - if (!(view && view.visible())) { - return; - } - switch (e.keyCode) { - case KEY_CODE.ESC: - e.preventDefault(); - view.hide(e); - break; - case KEY_CODE.UP: - e.preventDefault(); - view.prev(); - break; - case KEY_CODE.DOWN: - e.preventDefault(); - view.next(); - break; - case KEY_CODE.P: - if (!e.ctrlKey) { - return; - } - e.preventDefault(); - view.prev(); - break; - case KEY_CODE.N: - if (!e.ctrlKey) { - return; - } - e.preventDefault(); - view.next(); - break; - case KEY_CODE.TAB: - case KEY_CODE.ENTER: - case KEY_CODE.SPACE: - if (!view.visible()) { - return; - } - if (!this.controller().getOpt('spaceSelectsMatch') && e.keyCode === KEY_CODE.SPACE) { - return; - } - if (!this.controller().getOpt('tabSelectsMatch') && e.keyCode === KEY_CODE.TAB) { - return; - } - if (view.highlighted()) { - e.preventDefault(); - view.choose(e); - } else { - view.hide(e); - } - break; - default: - $.noop(); - } - }; - - return App; - -})(); - -var Controller, - slice = [].slice; - -Controller = (function() { - Controller.prototype.uid = function() { - return (Math.random().toString(16) + "000000000").substr(2, 8) + (new Date().getTime()); - }; - - function Controller(app, at1) { - this.app = app; - this.at = at1; - this.$inputor = this.app.$inputor; - this.id = this.$inputor[0].id || this.uid(); - this.expectedQueryCBId = null; - this.setting = null; - this.query = null; - this.pos = 0; - this.range = null; - if ((this.$el = $("#atwho-ground-" + this.id, this.app.$el)).length === 0) { - this.app.$el.append(this.$el = $("
")); - } - this.model = new Model(this); - this.view = new View(this); - } - - Controller.prototype.init = function(setting) { - this.setting = $.extend({}, this.setting || $.fn.atwho["default"], setting); - this.view.init(); - return this.model.reload(this.setting.data); - }; - - Controller.prototype.destroy = function() { - this.trigger('beforeDestroy'); - this.model.destroy(); - this.view.destroy(); - return this.$el.remove(); - }; - - Controller.prototype.callDefault = function() { - var args, error, error1, funcName; - funcName = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; - try { - return DEFAULT_CALLBACKS[funcName].apply(this, args); - } catch (error1) { - error = error1; - return $.error(error + " Or maybe At.js doesn't have function " + funcName); - } - }; - - Controller.prototype.trigger = function(name, data) { - var alias, eventName; - if (data == null) { - data = []; - } - data.push(this); - alias = this.getOpt('alias'); - eventName = alias ? name + "-" + alias + ".atwho" : name + ".atwho"; - return this.$inputor.trigger(eventName, data); - }; - - Controller.prototype.callbacks = function(funcName) { - return this.getOpt("callbacks")[funcName] || DEFAULT_CALLBACKS[funcName]; - }; - - Controller.prototype.getOpt = function(at, default_value) { - var e, error1; - try { - return this.setting[at]; - } catch (error1) { - e = error1; - return null; - } - }; - - Controller.prototype.insertContentFor = function($li) { - var data, tpl; - tpl = this.getOpt('insertTpl'); - data = $.extend({}, $li.data('item-data'), { - 'atwho-at': this.at - }); - return this.callbacks("tplEval").call(this, tpl, data, "onInsert"); - }; - - Controller.prototype.renderView = function(data) { - var searchKey; - searchKey = this.getOpt("searchKey"); - data = this.callbacks("sorter").call(this, this.query.text, data.slice(0, 1001), searchKey); - return this.view.render(data.slice(0, this.getOpt('limit'))); - }; - - Controller.arrayToDefaultHash = function(data) { - var i, item, len, results; - if (!$.isArray(data)) { - return data; - } - results = []; - for (i = 0, len = data.length; i < len; i++) { - item = data[i]; - if ($.isPlainObject(item)) { - results.push(item); - } else { - results.push({ - name: item - }); - } - } - return results; - }; - - Controller.prototype.lookUp = function(e) { - var query, wait; - if (e && e.type === 'click' && !this.getOpt('lookUpOnClick')) { - return; - } - if (this.getOpt('suspendOnComposing') && this.app.isComposing) { - return; - } - query = this.catchQuery(e); - if (!query) { - this.expectedQueryCBId = null; - return query; - } - this.app.setContextFor(this.at); - if (wait = this.getOpt('delay')) { - this._delayLookUp(query, wait); - } else { - this._lookUp(query); - } - return query; - }; - - Controller.prototype._delayLookUp = function(query, wait) { - var now, remaining; - now = Date.now ? Date.now() : new Date().getTime(); - this.previousCallTime || (this.previousCallTime = now); - remaining = wait - (now - this.previousCallTime); - if ((0 < remaining && remaining < wait)) { - this.previousCallTime = now; - this._stopDelayedCall(); - return this.delayedCallTimeout = setTimeout((function(_this) { - return function() { - _this.previousCallTime = 0; - _this.delayedCallTimeout = null; - return _this._lookUp(query); - }; - })(this), wait); - } else { - this._stopDelayedCall(); - if (this.previousCallTime !== now) { - this.previousCallTime = 0; - } - return this._lookUp(query); - } - }; - - Controller.prototype._stopDelayedCall = function() { - if (this.delayedCallTimeout) { - clearTimeout(this.delayedCallTimeout); - return this.delayedCallTimeout = null; - } - }; - - Controller.prototype._generateQueryCBId = function() { - return {}; - }; - - Controller.prototype._lookUp = function(query) { - var _callback; - _callback = function(queryCBId, data) { - if (queryCBId !== this.expectedQueryCBId) { - return; - } - if (data && data.length > 0) { - return this.renderView(this.constructor.arrayToDefaultHash(data)); - } else { - return this.view.hide(); - } - }; - this.expectedQueryCBId = this._generateQueryCBId(); - return this.model.query(query.text, $.proxy(_callback, this, this.expectedQueryCBId)); - }; - - return Controller; - -})(); - -var TextareaController, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -TextareaController = (function(superClass) { - extend(TextareaController, superClass); - - function TextareaController() { - return TextareaController.__super__.constructor.apply(this, arguments); - } - - TextareaController.prototype.catchQuery = function() { - var caretPos, content, end, isString, query, start, subtext; - content = this.$inputor.val(); - caretPos = this.$inputor.caret('pos', { - iframe: this.app.iframe - }); - subtext = content.slice(0, caretPos); - query = this.callbacks("matcher").call(this, this.at, subtext, this.getOpt('startWithSpace'), this.getOpt("acceptSpaceBar")); - isString = typeof query === 'string'; - if (isString && query.length < this.getOpt('minLen', 0)) { - return; - } - if (isString && query.length <= this.getOpt('maxLen', 20)) { - start = caretPos - query.length; - end = start + query.length; - this.pos = start; - query = { - 'text': query, - 'headPos': start, - 'endPos': end - }; - this.trigger("matched", [this.at, query.text]); - } else { - query = null; - this.view.hide(); - } - return this.query = query; - }; - - TextareaController.prototype.rect = function() { - var c, iframeOffset, scaleBottom; - if (!(c = this.$inputor.caret('offset', this.pos - 1, { - iframe: this.app.iframe - }))) { - return; - } - if (this.app.iframe && !this.app.iframeAsRoot) { - iframeOffset = $(this.app.iframe).offset(); - c.left += iframeOffset.left; - c.top += iframeOffset.top; - } - scaleBottom = this.app.document.selection ? 0 : 2; - return { - left: c.left, - top: c.top, - bottom: c.top + c.height + scaleBottom - }; - }; - - TextareaController.prototype.insert = function(content, $li) { - var $inputor, source, startStr, suffix, text; - $inputor = this.$inputor; - source = $inputor.val(); - startStr = source.slice(0, Math.max(this.query.headPos - this.at.length, 0)); - suffix = (suffix = this.getOpt('suffix')) === "" ? suffix : suffix || " "; - content += suffix; - text = "" + startStr + content + (source.slice(this.query['endPos'] || 0)); - $inputor.val(text); - $inputor.caret('pos', startStr.length + content.length, { - iframe: this.app.iframe - }); - if (!$inputor.is(':focus')) { - $inputor.focus(); - } - return $inputor.change(); - }; - - return TextareaController; - -})(Controller); - -var EditableController, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -EditableController = (function(superClass) { - extend(EditableController, superClass); - - function EditableController() { - return EditableController.__super__.constructor.apply(this, arguments); - } - - EditableController.prototype._getRange = function() { - var sel; - sel = this.app.window.getSelection(); - if (sel.rangeCount > 0) { - return sel.getRangeAt(0); - } - }; - - EditableController.prototype._setRange = function(position, node, range) { - if (range == null) { - range = this._getRange(); - } - if (!range) { - return; - } - node = $(node)[0]; - if (position === 'after') { - range.setEndAfter(node); - range.setStartAfter(node); - } else { - range.setEndBefore(node); - range.setStartBefore(node); - } - range.collapse(false); - return this._clearRange(range); - }; - - EditableController.prototype._clearRange = function(range) { - var sel; - if (range == null) { - range = this._getRange(); - } - sel = this.app.window.getSelection(); - if (this.ctrl_a_pressed == null) { - sel.removeAllRanges(); - return sel.addRange(range); - } - }; - - EditableController.prototype._movingEvent = function(e) { - var ref; - return e.type === 'click' || ((ref = e.which) === KEY_CODE.RIGHT || ref === KEY_CODE.LEFT || ref === KEY_CODE.UP || ref === KEY_CODE.DOWN); - }; - - EditableController.prototype._unwrap = function(node) { - var next; - node = $(node).unwrap().get(0); - if ((next = node.nextSibling) && next.nodeValue) { - node.nodeValue += next.nodeValue; - $(next).remove(); - } - return node; - }; - - EditableController.prototype.catchQuery = function(e) { - var $inserted, $query, _range, index, inserted, isString, lastNode, matched, offset, query, query_content, range; - if (!(range = this._getRange())) { - return; - } - if (!range.collapsed) { - return; - } - if (e.which === KEY_CODE.ENTER) { - ($query = $(range.startContainer).closest('.atwho-query')).contents().unwrap(); - if ($query.is(':empty')) { - $query.remove(); - } - ($query = $(".atwho-query", this.app.document)).text($query.text()).contents().last().unwrap(); - this._clearRange(); - return; - } - if (/firefox/i.test(navigator.userAgent)) { - if ($(range.startContainer).is(this.$inputor)) { - this._clearRange(); - return; - } - if (e.which === KEY_CODE.BACKSPACE && range.startContainer.nodeType === document.ELEMENT_NODE && (offset = range.startOffset - 1) >= 0) { - _range = range.cloneRange(); - _range.setStart(range.startContainer, offset); - if ($(_range.cloneContents()).contents().last().is('.atwho-inserted')) { - inserted = $(range.startContainer).contents().get(offset); - this._setRange('after', $(inserted).contents().last()); - } - } else if (e.which === KEY_CODE.LEFT && range.startContainer.nodeType === document.TEXT_NODE) { - $inserted = $(range.startContainer.previousSibling); - if ($inserted.is('.atwho-inserted') && range.startOffset === 0) { - this._setRange('after', $inserted.contents().last()); - } - } - } - $(range.startContainer).closest('.atwho-inserted').addClass('atwho-query').siblings().removeClass('atwho-query'); - if (($query = $(".atwho-query", this.app.document)).length > 0 && $query.is(':empty') && $query.text().length === 0) { - $query.remove(); - } - if (!this._movingEvent(e)) { - $query.removeClass('atwho-inserted'); - } - if ($query.length > 0) { - switch (e.which) { - case KEY_CODE.LEFT: - this._setRange('before', $query.get(0), range); - $query.removeClass('atwho-query'); - return; - case KEY_CODE.RIGHT: - this._setRange('after', $query.get(0).nextSibling, range); - $query.removeClass('atwho-query'); - return; - } - } - if ($query.length > 0 && (query_content = $query.attr('data-atwho-at-query'))) { - $query.empty().html(query_content).attr('data-atwho-at-query', null); - this._setRange('after', $query.get(0), range); - } - _range = range.cloneRange(); - _range.setStart(range.startContainer, 0); - matched = this.callbacks("matcher").call(this, this.at, _range.toString(), this.getOpt('startWithSpace'), this.getOpt("acceptSpaceBar")); - isString = typeof matched === 'string'; - if ($query.length === 0 && isString && (index = range.startOffset - this.at.length - matched.length) >= 0) { - range.setStart(range.startContainer, index); - $query = $('', this.app.document).attr(this.getOpt("editableAtwhoQueryAttrs")).addClass('atwho-query'); - range.surroundContents($query.get(0)); - lastNode = $query.contents().last().get(0); - if (/firefox/i.test(navigator.userAgent)) { - range.setStart(lastNode, lastNode.length); - range.setEnd(lastNode, lastNode.length); - this._clearRange(range); - } else { - this._setRange('after', lastNode, range); - } - } - if (isString && matched.length < this.getOpt('minLen', 0)) { - return; - } - if (isString && matched.length <= this.getOpt('maxLen', 20)) { - query = { - text: matched, - el: $query - }; - this.trigger("matched", [this.at, query.text]); - return this.query = query; - } else { - this.view.hide(); - this.query = { - el: $query - }; - if ($query.text().indexOf(this.at) >= 0) { - if (this._movingEvent(e) && $query.hasClass('atwho-inserted')) { - $query.removeClass('atwho-query'); - } else if (false !== this.callbacks('afterMatchFailed').call(this, this.at, $query)) { - this._setRange("after", this._unwrap($query.text($query.text()).contents().first())); - } - } - return null; - } - }; - - EditableController.prototype.rect = function() { - var $iframe, iframeOffset, rect; - rect = this.query.el.offset(); - if (this.app.iframe && !this.app.iframeAsRoot) { - iframeOffset = ($iframe = $(this.app.iframe)).offset(); - rect.left += iframeOffset.left - this.$inputor.scrollLeft(); - rect.top += iframeOffset.top - this.$inputor.scrollTop(); - } - rect.bottom = rect.top + this.query.el.height(); - return rect; - }; - - EditableController.prototype.insert = function(content, $li) { - var data, range, suffix, suffixNode; - if (!this.$inputor.is(':focus')) { - this.$inputor.focus(); - } - suffix = (suffix = this.getOpt('suffix')) === "" ? suffix : suffix || "\u00A0"; - data = $li.data('item-data'); - this.query.el.removeClass('atwho-query').addClass('atwho-inserted').html(content).attr('data-atwho-at-query', "" + data['atwho-at'] + this.query.text); - if (range = this._getRange()) { - range.setEndAfter(this.query.el[0]); - range.collapse(false); - range.insertNode(suffixNode = this.app.document.createTextNode("\u200D" + suffix)); - this._setRange('after', suffixNode, range); - } - if (!this.$inputor.is(':focus')) { - this.$inputor.focus(); - } - return this.$inputor.change(); - }; - - return EditableController; - -})(Controller); - -var Model; - -Model = (function() { - function Model(context) { - this.context = context; - this.at = this.context.at; - this.storage = this.context.$inputor; - } - - Model.prototype.destroy = function() { - return this.storage.data(this.at, null); - }; - - Model.prototype.saved = function() { - return this.fetch() > 0; - }; - - Model.prototype.query = function(query, callback) { - var _remoteFilter, data, searchKey; - data = this.fetch(); - searchKey = this.context.getOpt("searchKey"); - data = this.context.callbacks('filter').call(this.context, query, data, searchKey) || []; - _remoteFilter = this.context.callbacks('remoteFilter'); - if (data.length > 0 || (!_remoteFilter && data.length === 0)) { - return callback(data); - } else { - return _remoteFilter.call(this.context, query, callback); - } - }; - - Model.prototype.fetch = function() { - return this.storage.data(this.at) || []; - }; - - Model.prototype.save = function(data) { - return this.storage.data(this.at, this.context.callbacks("beforeSave").call(this.context, data || [])); - }; - - Model.prototype.load = function(data) { - if (!(this.saved() || !data)) { - return this._load(data); - } - }; - - Model.prototype.reload = function(data) { - return this._load(data); - }; - - Model.prototype._load = function(data) { - if (typeof data === "string") { - return $.ajax(data, { - dataType: "json" - }).done((function(_this) { - return function(data) { - return _this.save(data); - }; - })(this)); - } else { - return this.save(data); - } - }; - - return Model; - -})(); - -var View; - -View = (function() { - function View(context) { - this.context = context; - this.$el = $("
    "); - this.$elUl = this.$el.children(); - this.timeoutID = null; - this.context.$el.append(this.$el); - this.bindEvent(); - } - - View.prototype.init = function() { - var header_tpl, id; - id = this.context.getOpt("alias") || this.context.at.charCodeAt(0); - header_tpl = this.context.getOpt("headerTpl"); - if (header_tpl && this.$el.children().length === 1) { - this.$el.prepend(header_tpl); - } - return this.$el.attr({ - 'id': "at-view-" + id - }); - }; - - View.prototype.destroy = function() { - return this.$el.remove(); - }; - - View.prototype.bindEvent = function() { - var $menu, lastCoordX, lastCoordY; - $menu = this.$el.find('ul'); - lastCoordX = 0; - lastCoordY = 0; - return $menu.on('mousemove.atwho-view', 'li', (function(_this) { - return function(e) { - var $cur; - if (lastCoordX === e.clientX && lastCoordY === e.clientY) { - return; - } - lastCoordX = e.clientX; - lastCoordY = e.clientY; - $cur = $(e.currentTarget); - if ($cur.hasClass('cur')) { - return; - } - $menu.find('.cur').removeClass('cur'); - return $cur.addClass('cur'); - }; - })(this)).on('click.atwho-view', 'li', (function(_this) { - return function(e) { - $menu.find('.cur').removeClass('cur'); - $(e.currentTarget).addClass('cur'); - _this.choose(e); - return e.preventDefault(); - }; - })(this)); - }; - - View.prototype.visible = function() { - return this.$el.is(":visible"); - }; - - View.prototype.highlighted = function() { - return this.$el.find(".cur").length > 0; - }; - - View.prototype.choose = function(e) { - var $li, content; - if (($li = this.$el.find(".cur")).length) { - content = this.context.insertContentFor($li); - this.context._stopDelayedCall(); - this.context.insert(this.context.callbacks("beforeInsert").call(this.context, content, $li, e), $li); - this.context.trigger("inserted", [$li, e]); - this.hide(e); - } - if (this.context.getOpt("hideWithoutSuffix")) { - return this.stopShowing = true; - } - }; - - View.prototype.reposition = function(rect) { - var _window, offset, overflowOffset, ref; - _window = this.context.app.iframeAsRoot ? this.context.app.window : window; - if (rect.bottom + this.$el.height() - $(_window).scrollTop() > $(_window).height()) { - rect.bottom = rect.top - this.$el.height(); - } - if (rect.left > (overflowOffset = $(_window).width() - this.$el.width() - 5)) { - rect.left = overflowOffset; - } - offset = { - left: rect.left, - top: rect.bottom - }; - if ((ref = this.context.callbacks("beforeReposition")) != null) { - ref.call(this.context, offset); - } - this.$el.offset(offset); - return this.context.trigger("reposition", [offset]); - }; - - View.prototype.next = function() { - var cur, next, nextEl, offset; - cur = this.$el.find('.cur').removeClass('cur'); - next = cur.next(); - if (!next.length) { - next = this.$el.find('li:first'); - } - next.addClass('cur'); - nextEl = next[0]; - offset = nextEl.offsetTop + nextEl.offsetHeight + (nextEl.nextSibling ? nextEl.nextSibling.offsetHeight : 0); - return this.scrollTop(Math.max(0, offset - this.$el.height())); - }; - - View.prototype.prev = function() { - var cur, offset, prev, prevEl; - cur = this.$el.find('.cur').removeClass('cur'); - prev = cur.prev(); - if (!prev.length) { - prev = this.$el.find('li:last'); - } - prev.addClass('cur'); - prevEl = prev[0]; - offset = prevEl.offsetTop + prevEl.offsetHeight + (prevEl.nextSibling ? prevEl.nextSibling.offsetHeight : 0); - return this.scrollTop(Math.max(0, offset - this.$el.height())); - }; - - View.prototype.scrollTop = function(scrollTop) { - var scrollDuration; - scrollDuration = this.context.getOpt('scrollDuration'); - if (scrollDuration) { - return this.$elUl.animate({ - scrollTop: scrollTop - }, scrollDuration); - } else { - return this.$elUl.scrollTop(scrollTop); - } - }; - - View.prototype.show = function() { - var rect; - if (this.stopShowing) { - this.stopShowing = false; - return; - } - if (!this.visible()) { - this.$el.show(); - this.$el.scrollTop(0); - this.context.trigger('shown'); - } - if (rect = this.context.rect()) { - return this.reposition(rect); - } - }; - - View.prototype.hide = function(e, time) { - var callback; - if (!this.visible()) { - return; - } - if (isNaN(time)) { - this.$el.hide(); - return this.context.trigger('hidden', [e]); - } else { - callback = (function(_this) { - return function() { - return _this.hide(); - }; - })(this); - clearTimeout(this.timeoutID); - return this.timeoutID = setTimeout(callback, time); - } - }; - - View.prototype.render = function(list) { - var $li, $ul, i, item, len, li, tpl; - if (!($.isArray(list) && list.length > 0)) { - this.hide(); - return; - } - this.$el.find('ul').empty(); - $ul = this.$el.find('ul'); - tpl = this.context.getOpt('displayTpl'); - for (i = 0, len = list.length; i < len; i++) { - item = list[i]; - item = $.extend({}, item, { - 'atwho-at': this.context.at - }); - li = this.context.callbacks("tplEval").call(this.context, tpl, item, "onDisplay"); - $li = $(this.context.callbacks("highlighter").call(this.context, li, this.context.query.text)); - $li.data("item-data", item); - $ul.append($li); - } - this.show(); - if (this.context.getOpt('highlightFirst')) { - return $ul.find("li:first").addClass("cur"); - } - }; - - return View; - -})(); - -var Api; - -Api = { - load: function(at, data) { - var c; - if (c = this.controller(at)) { - return c.model.load(data); - } - }, - isSelecting: function() { - var ref; - return !!((ref = this.controller()) != null ? ref.view.visible() : void 0); - }, - hide: function() { - var ref; - return (ref = this.controller()) != null ? ref.view.hide() : void 0; - }, - reposition: function() { - var c; - if (c = this.controller()) { - return c.view.reposition(c.rect()); - } - }, - setIframe: function(iframe, asRoot) { - this.setupRootElement(iframe, asRoot); - return null; - }, - run: function() { - return this.dispatch(); - }, - destroy: function() { - this.shutdown(); - return this.$inputor.data('atwho', null); - } -}; - -$.fn.atwho = function(method) { - var _args, result; - _args = arguments; - result = null; - this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function() { - var $this, app; - if (!(app = ($this = $(this)).data("atwho"))) { - $this.data('atwho', (app = new App(this))); - } - if (typeof method === 'object' || !method) { - return app.reg(method.at, method); - } else if (Api[method] && app) { - return result = Api[method].apply(app, Array.prototype.slice.call(_args, 1)); - } else { - return $.error("Method " + method + " does not exist on jQuery.atwho"); - } - }); - if (result != null) { - return result; - } else { - return this; - } -}; - -$.fn.atwho["default"] = { - at: void 0, - alias: void 0, - data: null, - displayTpl: "
  • ${name}
  • ", - insertTpl: "${atwho-at}${name}", - headerTpl: null, - callbacks: DEFAULT_CALLBACKS, - searchKey: "name", - suffix: void 0, - hideWithoutSuffix: false, - startWithSpace: true, - acceptSpaceBar: false, - highlightFirst: true, - limit: 5, - maxLen: 20, - minLen: 0, - displayTimeout: 300, - delay: null, - spaceSelectsMatch: false, - tabSelectsMatch: true, - editableAtwhoQueryAttrs: {}, - scrollDuration: 150, - suspendOnComposing: true, - lookUpOnClick: true -}; - -$.fn.atwho.debug = false; - -})); diff --git a/pagure/static/atwho/jquery.atwho-1.5.1.min.css b/pagure/static/atwho/jquery.atwho-1.5.1.min.css deleted file mode 100644 index f770dc7..0000000 --- a/pagure/static/atwho/jquery.atwho-1.5.1.min.css +++ /dev/null @@ -1 +0,0 @@ -.atwho-view{position:absolute;top:0;left:0;display:none;margin-top:18px;background:#fff;color:#000;border:1px solid #DDD;border-radius:3px;box-shadow:0 0 5px rgba(0,0,0,.1);min-width:120px;z-index:11110!important}.atwho-view .atwho-header{padding:5px;margin:5px;cursor:pointer;border-bottom:solid 1px #eaeff1;color:#6f8092;font-size:11px;font-weight:700}.atwho-view .atwho-header .small{color:#6f8092;float:right;padding-top:2px;margin-right:-5px;font-size:12px;font-weight:400}.atwho-view .atwho-header:hover{cursor:default}.atwho-view .cur{background:#36F;color:#fff}.atwho-view .cur small{color:#fff}.atwho-view strong{color:#36F}.atwho-view .cur strong{color:#fff;font:700}.atwho-view ul{list-style:none;padding:0;margin:auto;max-height:200px;overflow-y:auto}.atwho-view ul li{display:block;padding:5px 10px;border-bottom:1px solid #DDD;cursor:pointer}.atwho-view small{font-size:smaller;color:#777;font-weight:400} \ No newline at end of file diff --git a/pagure/static/atwho/jquery.atwho-1.5.1.min.js b/pagure/static/atwho/jquery.atwho-1.5.1.min.js deleted file mode 100644 index 71e9a10..0000000 --- a/pagure/static/atwho/jquery.atwho-1.5.1.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(this,function(t){var e,i;i={DOWN:40,UP:38,ESC:27,TAB:9,ENTER:13,CTRL:17,A:65,P:80,N:78,LEFT:37,UP:38,RIGHT:39,DOWN:40,BACKSPACE:8,SPACE:32},e={beforeSave:function(t){return r.arrayToDefaultHash(t)},matcher:function(t,e,i,n){var r,o,s,a,h;return t=t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),i&&(t="(?:^|\\s)"+t),r=decodeURI("%C3%80"),o=decodeURI("%C3%BF"),h=n?" ":"",a=new RegExp(t+"([A-Za-z"+r+"-"+o+"0-9_"+h+"'.+-]*)$|"+t+"([^\\x00-\\xff]*)$","gi"),s=a.exec(e),s?s[2]||s[1]:null},filter:function(t,e,i){var n,r,o,s;for(n=[],r=0,s=e.length;s>r;r++)o=e[r],~new String(o[i]).toLowerCase().indexOf(t.toLowerCase())&&n.push(o);return n},remoteFilter:null,sorter:function(t,e,i){var n,r,o,s;if(!t)return e;for(n=[],r=0,s=e.length;s>r;r++)o=e[r],o.atwho_order=new String(o[i]).toLowerCase().indexOf(t.toLowerCase()),o.atwho_order>-1&&n.push(o);return n.sort(function(t,e){return t.atwho_order-e.atwho_order})},tplEval:function(t,e){var i,n,r;r=t;try{return"string"!=typeof t&&(r=t(e)),r.replace(/\$\{([^\}]*)\}/g,function(t,i,n){return e[i]})}catch(n){return i=n,""}},highlighter:function(t,e){var i;return e?(i=new RegExp(">\\s*(\\w*?)("+e.replace("+","\\+")+")(\\w*)\\s*<","ig"),t.replace(i,function(t,e,i,n){return"> "+e+""+i+""+n+" <"})):t},beforeInsert:function(t,e,i){return t},beforeReposition:function(t){return t},afterMatchFailed:function(t,e){}};var n;n=function(){function e(e){this.currentFlag=null,this.controllers={},this.aliasMaps={},this.$inputor=t(e),this.setupRootElement(),this.listen()}return e.prototype.createContainer=function(e){var i;return null!=(i=this.$el)&&i.remove(),t(e.body).append(this.$el=t("
    "))},e.prototype.setupRootElement=function(e,i){var n,r;if(null==i&&(i=!1),e)this.window=e.contentWindow,this.document=e.contentDocument||this.window.document,this.iframe=e;else{this.document=this.$inputor[0].ownerDocument,this.window=this.document.defaultView||this.document.parentWindow;try{this.iframe=this.window.frameElement}catch(r){if(n=r,this.iframe=null,t.fn.atwho.debug)throw new Error("iframe auto-discovery is failed.\nPlease use `setIframe` to set the target iframe manually.\n"+n)}}return this.createContainer((this.iframeAsRoot=i)?this.document:document)},e.prototype.controller=function(t){var e,i,n,r;if(this.aliasMaps[t])i=this.controllers[this.aliasMaps[t]];else{r=this.controllers;for(n in r)if(e=r[n],n===t){i=e;break}}return i?i:this.controllers[this.currentFlag]},e.prototype.setContextFor=function(t){return this.currentFlag=t,this},e.prototype.reg=function(t,e){var i,n;return n=(i=this.controllers)[t]||(i[t]=this.$inputor.is("[contentEditable]")?new l(this,t):new s(this,t)),e.alias&&(this.aliasMaps[e.alias]=t),n.init(e),this},e.prototype.listen=function(){return this.$inputor.on("compositionstart",function(t){return function(e){var i;return null!=(i=t.controller())&&i.view.hide(),t.isComposing=!0,null}}(this)).on("compositionend",function(t){return function(e){return t.isComposing=!1,setTimeout(function(e){return t.dispatch(e)}),null}}(this)).on("keyup.atwhoInner",function(t){return function(e){return t.onKeyup(e)}}(this)).on("keydown.atwhoInner",function(t){return function(e){return t.onKeydown(e)}}(this)).on("blur.atwhoInner",function(t){return function(e){var i;return(i=t.controller())?(i.expectedQueryCBId=null,i.view.hide(e,i.getOpt("displayTimeout"))):void 0}}(this)).on("click.atwhoInner",function(t){return function(e){return t.dispatch(e)}}(this)).on("scroll.atwhoInner",function(t){return function(){var e;return e=t.$inputor.scrollTop(),function(i){var n,r;return n=i.target.scrollTop,e!==n&&null!=(r=t.controller())&&r.view.hide(i),e=n,!0}}}(this)())},e.prototype.shutdown=function(){var t,e,i;i=this.controllers;for(t in i)e=i[t],e.destroy(),delete this.controllers[t];return this.$inputor.off(".atwhoInner"),this.$el.remove()},e.prototype.dispatch=function(t){var e,i,n,r;n=this.controllers,r=[];for(e in n)i=n[e],r.push(i.lookUp(t));return r},e.prototype.onKeyup=function(e){var n;switch(e.keyCode){case i.ESC:e.preventDefault(),null!=(n=this.controller())&&n.view.hide();break;case i.DOWN:case i.UP:case i.CTRL:case i.ENTER:t.noop();break;case i.P:case i.N:e.ctrlKey||this.dispatch(e);break;default:this.dispatch(e)}},e.prototype.onKeydown=function(e){var n,r;if(r=null!=(n=this.controller())?n.view:void 0,r&&r.visible())switch(e.keyCode){case i.ESC:e.preventDefault(),r.hide(e);break;case i.UP:e.preventDefault(),r.prev();break;case i.DOWN:e.preventDefault(),r.next();break;case i.P:if(!e.ctrlKey)return;e.preventDefault(),r.prev();break;case i.N:if(!e.ctrlKey)return;e.preventDefault(),r.next();break;case i.TAB:case i.ENTER:case i.SPACE:if(!r.visible())return;if(!this.controller().getOpt("spaceSelectsMatch")&&e.keyCode===i.SPACE)return;if(!this.controller().getOpt("tabSelectsMatch")&&e.keyCode===i.TAB)return;r.highlighted()?(e.preventDefault(),r.choose(e)):r.hide(e);break;default:t.noop()}},e}();var r,o=[].slice;r=function(){function i(e,i){this.app=e,this.at=i,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.expectedQueryCBId=null,this.setting=null,this.query=null,this.pos=0,this.range=null,0===(this.$el=t("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=t("
    ")),this.model=new u(this),this.view=new c(this)}return i.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},i.prototype.init=function(e){return this.setting=t.extend({},this.setting||t.fn.atwho["default"],e),this.view.init(),this.model.reload(this.setting.data)},i.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},i.prototype.callDefault=function(){var i,n,r,s;s=arguments[0],i=2<=arguments.length?o.call(arguments,1):[];try{return e[s].apply(this,i)}catch(r){return n=r,t.error(n+" Or maybe At.js doesn't have function "+s)}},i.prototype.trigger=function(t,e){var i,n;return null==e&&(e=[]),e.push(this),i=this.getOpt("alias"),n=i?t+"-"+i+".atwho":t+".atwho",this.$inputor.trigger(n,e)},i.prototype.callbacks=function(t){return this.getOpt("callbacks")[t]||e[t]},i.prototype.getOpt=function(t,e){var i,n;try{return this.setting[t]}catch(n){return i=n,null}},i.prototype.insertContentFor=function(e){var i,n;return n=this.getOpt("insertTpl"),i=t.extend({},e.data("item-data"),{"atwho-at":this.at}),this.callbacks("tplEval").call(this,n,i,"onInsert")},i.prototype.renderView=function(t){var e;return e=this.getOpt("searchKey"),t=this.callbacks("sorter").call(this,this.query.text,t.slice(0,1001),e),this.view.render(t.slice(0,this.getOpt("limit")))},i.arrayToDefaultHash=function(e){var i,n,r,o;if(!t.isArray(e))return e;for(o=[],i=0,r=e.length;r>i;i++)n=e[i],t.isPlainObject(n)?o.push(n):o.push({name:n});return o},i.prototype.lookUp=function(t){var e,i;if((!t||"click"!==t.type||this.getOpt("lookUpOnClick"))&&(!this.getOpt("suspendOnComposing")||!this.app.isComposing))return(e=this.catchQuery(t))?(this.app.setContextFor(this.at),(i=this.getOpt("delay"))?this._delayLookUp(e,i):this._lookUp(e),e):(this.expectedQueryCBId=null,e)},i.prototype._delayLookUp=function(t,e){var i,n;return i=Date.now?Date.now():(new Date).getTime(),this.previousCallTime||(this.previousCallTime=i),n=e-(i-this.previousCallTime),n>0&&e>n?(this.previousCallTime=i,this._stopDelayedCall(),this.delayedCallTimeout=setTimeout(function(e){return function(){return e.previousCallTime=0,e.delayedCallTimeout=null,e._lookUp(t)}}(this),e)):(this._stopDelayedCall(),this.previousCallTime!==i&&(this.previousCallTime=0),this._lookUp(t))},i.prototype._stopDelayedCall=function(){return this.delayedCallTimeout?(clearTimeout(this.delayedCallTimeout),this.delayedCallTimeout=null):void 0},i.prototype._generateQueryCBId=function(){return{}},i.prototype._lookUp=function(e){var i;return i=function(t,e){return t===this.expectedQueryCBId?e&&e.length>0?this.renderView(this.constructor.arrayToDefaultHash(e)):this.view.hide():void 0},this.expectedQueryCBId=this._generateQueryCBId(),this.model.query(e.text,t.proxy(i,this,this.expectedQueryCBId))},i}();var s,a=function(t,e){function i(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},h={}.hasOwnProperty;s=function(e){function i(){return i.__super__.constructor.apply(this,arguments)}return a(i,e),i.prototype.catchQuery=function(){var t,e,i,n,r,o,s;return e=this.$inputor.val(),t=this.$inputor.caret("pos",{iframe:this.app.iframe}),s=e.slice(0,t),r=this.callbacks("matcher").call(this,this.at,s,this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),n="string"==typeof r,n&&r.length0?t.getRangeAt(0):void 0},n.prototype._setRange=function(e,i,n){return null==n&&(n=this._getRange()),n?(i=t(i)[0],"after"===e?(n.setEndAfter(i),n.setStartAfter(i)):(n.setEndBefore(i),n.setStartBefore(i)),n.collapse(!1),this._clearRange(n)):void 0},n.prototype._clearRange=function(t){var e;return null==t&&(t=this._getRange()),e=this.app.window.getSelection(),null==this.ctrl_a_pressed?(e.removeAllRanges(),e.addRange(t)):void 0},n.prototype._movingEvent=function(t){var e;return"click"===t.type||(e=t.which)===i.RIGHT||e===i.LEFT||e===i.UP||e===i.DOWN},n.prototype._unwrap=function(e){var i;return e=t(e).unwrap().get(0),(i=e.nextSibling)&&i.nodeValue&&(e.nodeValue+=i.nodeValue,t(i).remove()),e},n.prototype.catchQuery=function(e){var n,r,o,s,a,h,l,u,c,p,f,d;if((d=this._getRange())&&d.collapsed){if(e.which===i.ENTER)return(r=t(d.startContainer).closest(".atwho-query")).contents().unwrap(),r.is(":empty")&&r.remove(),(r=t(".atwho-query",this.app.document)).text(r.text()).contents().last().unwrap(),void this._clearRange();if(/firefox/i.test(navigator.userAgent)){if(t(d.startContainer).is(this.$inputor))return void this._clearRange();e.which===i.BACKSPACE&&d.startContainer.nodeType===document.ELEMENT_NODE&&(c=d.startOffset-1)>=0?(o=d.cloneRange(),o.setStart(d.startContainer,c),t(o.cloneContents()).contents().last().is(".atwho-inserted")&&(a=t(d.startContainer).contents().get(c),this._setRange("after",t(a).contents().last()))):e.which===i.LEFT&&d.startContainer.nodeType===document.TEXT_NODE&&(n=t(d.startContainer.previousSibling),n.is(".atwho-inserted")&&0===d.startOffset&&this._setRange("after",n.contents().last()))}if(t(d.startContainer).closest(".atwho-inserted").addClass("atwho-query").siblings().removeClass("atwho-query"),(r=t(".atwho-query",this.app.document)).length>0&&r.is(":empty")&&0===r.text().length&&r.remove(),this._movingEvent(e)||r.removeClass("atwho-inserted"),r.length>0)switch(e.which){case i.LEFT:return this._setRange("before",r.get(0),d),void r.removeClass("atwho-query");case i.RIGHT:return this._setRange("after",r.get(0).nextSibling,d),void r.removeClass("atwho-query")}if(r.length>0&&(f=r.attr("data-atwho-at-query"))&&(r.empty().html(f).attr("data-atwho-at-query",null),this._setRange("after",r.get(0),d)),o=d.cloneRange(),o.setStart(d.startContainer,0),u=this.callbacks("matcher").call(this,this.at,o.toString(),this.getOpt("startWithSpace"),this.getOpt("acceptSpaceBar")),h="string"==typeof u,0===r.length&&h&&(s=d.startOffset-this.at.length-u.length)>=0&&(d.setStart(d.startContainer,s),r=t("",this.app.document).attr(this.getOpt("editableAtwhoQueryAttrs")).addClass("atwho-query"),d.surroundContents(r.get(0)),l=r.contents().last().get(0),/firefox/i.test(navigator.userAgent)?(d.setStart(l,l.length),d.setEnd(l,l.length),this._clearRange(d)):this._setRange("after",l,d)),!(h&&u.length=0&&(this._movingEvent(e)&&r.hasClass("atwho-inserted")?r.removeClass("atwho-query"):!1!==this.callbacks("afterMatchFailed").call(this,this.at,r)&&this._setRange("after",this._unwrap(r.text(r.text()).contents().first()))),null)}},n.prototype.rect=function(){var e,i,n;return n=this.query.el.offset(),this.app.iframe&&!this.app.iframeAsRoot&&(i=(e=t(this.app.iframe)).offset(),n.left+=i.left-this.$inputor.scrollLeft(),n.top+=i.top-this.$inputor.scrollTop()),n.bottom=n.top+this.query.el.height(),n},n.prototype.insert=function(t,e){var i,n,r,o;return this.$inputor.is(":focus")||this.$inputor.focus(),r=""===(r=this.getOpt("suffix"))?r:r||" ",i=e.data("item-data"),this.query.el.removeClass("atwho-query").addClass("atwho-inserted").html(t).attr("data-atwho-at-query",""+i["atwho-at"]+this.query.text),(n=this._getRange())&&(n.setEndAfter(this.query.el[0]),n.collapse(!1),n.insertNode(o=this.app.document.createTextNode("‍"+r)),this._setRange("after",o,n)),this.$inputor.is(":focus")||this.$inputor.focus(),this.$inputor.change()},n}(r);var u;u=function(){function e(t){this.context=t,this.at=this.context.at,this.storage=this.context.$inputor}return e.prototype.destroy=function(){return this.storage.data(this.at,null)},e.prototype.saved=function(){return this.fetch()>0},e.prototype.query=function(t,e){var i,n,r;return n=this.fetch(),r=this.context.getOpt("searchKey"),n=this.context.callbacks("filter").call(this.context,t,n,r)||[],i=this.context.callbacks("remoteFilter"),n.length>0||!i&&0===n.length?e(n):i.call(this.context,t,e)},e.prototype.fetch=function(){return this.storage.data(this.at)||[]},e.prototype.save=function(t){return this.storage.data(this.at,this.context.callbacks("beforeSave").call(this.context,t||[]))},e.prototype.load=function(t){return!this.saved()&&t?this._load(t):void 0},e.prototype.reload=function(t){return this._load(t)},e.prototype._load=function(e){return"string"==typeof e?t.ajax(e,{dataType:"json"}).done(function(t){return function(e){return t.save(e)}}(this)):this.save(e)},e}();var c;c=function(){function e(e){this.context=e,this.$el=t("
      "),this.$elUl=this.$el.children(),this.timeoutID=null,this.context.$el.append(this.$el),this.bindEvent()}return e.prototype.init=function(){var t,e;return e=this.context.getOpt("alias")||this.context.at.charCodeAt(0),t=this.context.getOpt("headerTpl"),t&&1===this.$el.children().length&&this.$el.prepend(t),this.$el.attr({id:"at-view-"+e})},e.prototype.destroy=function(){return this.$el.remove()},e.prototype.bindEvent=function(){var e,i,n;return e=this.$el.find("ul"),i=0,n=0,e.on("mousemove.atwho-view","li",function(r){return function(r){var o;if((i!==r.clientX||n!==r.clientY)&&(i=r.clientX,n=r.clientY,o=t(r.currentTarget),!o.hasClass("cur")))return e.find(".cur").removeClass("cur"),o.addClass("cur")}}(this)).on("click.atwho-view","li",function(i){return function(n){return e.find(".cur").removeClass("cur"),t(n.currentTarget).addClass("cur"),i.choose(n),n.preventDefault()}}(this))},e.prototype.visible=function(){return this.$el.is(":visible")},e.prototype.highlighted=function(){return this.$el.find(".cur").length>0},e.prototype.choose=function(t){var e,i;return(e=this.$el.find(".cur")).length&&(i=this.context.insertContentFor(e),this.context._stopDelayedCall(),this.context.insert(this.context.callbacks("beforeInsert").call(this.context,i,e,t),e),this.context.trigger("inserted",[e,t]),this.hide(t)),this.context.getOpt("hideWithoutSuffix")?this.stopShowing=!0:void 0},e.prototype.reposition=function(e){var i,n,r,o;return i=this.context.app.iframeAsRoot?this.context.app.window:window,e.bottom+this.$el.height()-t(i).scrollTop()>t(i).height()&&(e.bottom=e.top-this.$el.height()),e.left>(r=t(i).width()-this.$el.width()-5)&&(e.left=r),n={left:e.left,top:e.bottom},null!=(o=this.context.callbacks("beforeReposition"))&&o.call(this.context,n),this.$el.offset(n),this.context.trigger("reposition",[n])},e.prototype.next=function(){var t,e,i,n;return t=this.$el.find(".cur").removeClass("cur"),e=t.next(),e.length||(e=this.$el.find("li:first")),e.addClass("cur"),i=e[0],n=i.offsetTop+i.offsetHeight+(i.nextSibling?i.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,n-this.$el.height()))},e.prototype.prev=function(){var t,e,i,n;return t=this.$el.find(".cur").removeClass("cur"),i=t.prev(),i.length||(i=this.$el.find("li:last")),i.addClass("cur"),n=i[0],e=n.offsetTop+n.offsetHeight+(n.nextSibling?n.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,e-this.$el.height()))},e.prototype.scrollTop=function(t){var e;return e=this.context.getOpt("scrollDuration"),e?this.$elUl.animate({scrollTop:t},e):this.$elUl.scrollTop(t)},e.prototype.show=function(){var t;return this.stopShowing?void(this.stopShowing=!1):(this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(t=this.context.rect())?this.reposition(t):void 0)},e.prototype.hide=function(t,e){var i;if(this.visible())return isNaN(e)?(this.$el.hide(),this.context.trigger("hidden",[t])):(i=function(t){return function(){return t.hide()}}(this),clearTimeout(this.timeoutID),this.timeoutID=setTimeout(i,e))},e.prototype.render=function(e){var i,n,r,o,s,a,h;if(!(t.isArray(e)&&e.length>0))return void this.hide();for(this.$el.find("ul").empty(),n=this.$el.find("ul"),h=this.context.getOpt("displayTpl"),r=0,s=e.length;s>r;r++)o=e[r],o=t.extend({},o,{"atwho-at":this.context.at}),a=this.context.callbacks("tplEval").call(this.context,h,o,"onDisplay"),i=t(this.context.callbacks("highlighter").call(this.context,a,this.context.query.text)),i.data("item-data",o),n.append(i);return this.show(),this.context.getOpt("highlightFirst")?n.find("li:first").addClass("cur"):void 0},e}();var p;p={load:function(t,e){var i;return(i=this.controller(t))?i.model.load(e):void 0},isSelecting:function(){var t;return!!(null!=(t=this.controller())?t.view.visible():void 0)},hide:function(){var t;return null!=(t=this.controller())?t.view.hide():void 0},reposition:function(){var t;return(t=this.controller())?t.view.reposition(t.rect()):void 0},setIframe:function(t,e){return this.setupRootElement(t,e),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},t.fn.atwho=function(e){var i,r;return i=arguments,r=null,this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var o,s;return(s=(o=t(this)).data("atwho"))||o.data("atwho",s=new n(this)),"object"!=typeof e&&e?p[e]&&s?r=p[e].apply(s,Array.prototype.slice.call(i,1)):t.error("Method "+e+" does not exist on jQuery.atwho"):s.reg(e.at,e)}),null!=r?r:this},t.fn.atwho["default"]={at:void 0,alias:void 0,data:null,displayTpl:"
    • ${name}
    • ",insertTpl:"${atwho-at}${name}",headerTpl:null,callbacks:e,searchKey:"name",suffix:void 0,hideWithoutSuffix:!1,startWithSpace:!0,acceptSpaceBar:!1,highlightFirst:!0,limit:5,maxLen:20,minLen:0,displayTimeout:300,delay:null,spaceSelectsMatch:!1,tabSelectsMatch:!0,editableAtwhoQueryAttrs:{},scrollDuration:150,suspendOnComposing:!0,lookUpOnClick:!0},t.fn.atwho.debug=!1}); \ No newline at end of file diff --git a/pagure/static/atwho/jquery.atwho.css b/pagure/static/atwho/jquery.atwho.css deleted file mode 120000 index 7cdb23b..0000000 --- a/pagure/static/atwho/jquery.atwho.css +++ /dev/null @@ -1 +0,0 @@ -jquery.atwho-1.5.1.css \ No newline at end of file diff --git a/pagure/static/atwho/jquery.atwho.js b/pagure/static/atwho/jquery.atwho.js deleted file mode 120000 index 71094fd..0000000 --- a/pagure/static/atwho/jquery.atwho.js +++ /dev/null @@ -1 +0,0 @@ -jquery.atwho-1.5.1.js \ No newline at end of file diff --git a/pagure/static/atwho/jquery.atwho.min.css b/pagure/static/atwho/jquery.atwho.min.css deleted file mode 120000 index 9f0145a..0000000 --- a/pagure/static/atwho/jquery.atwho.min.css +++ /dev/null @@ -1 +0,0 @@ -jquery.atwho-1.5.1.min.css \ No newline at end of file diff --git a/pagure/static/atwho/jquery.atwho.min.js b/pagure/static/atwho/jquery.atwho.min.js deleted file mode 120000 index e1879fd..0000000 --- a/pagure/static/atwho/jquery.atwho.min.js +++ /dev/null @@ -1 +0,0 @@ -jquery.atwho-1.5.1.min.js \ No newline at end of file diff --git a/pagure/static/atwho/jquery.caret-0.3.1.js b/pagure/static/atwho/jquery.caret-0.3.1.js deleted file mode 100644 index 811ec63..0000000 --- a/pagure/static/atwho/jquery.caret-0.3.1.js +++ /dev/null @@ -1,436 +0,0 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(["jquery"], function ($) { - return (root.returnExportsGlobal = factory($)); - }); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like enviroments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(jQuery); - } -}(this, function ($) { - -/* - Implement Github like autocomplete mentions - http://ichord.github.com/At.js - - Copyright (c) 2013 chord.luo@gmail.com - Licensed under the MIT license. -*/ - -/* -本插件操作 textarea 或者 input 内的插入符 -只实现了获得插入符在文本框中的位置,我设置 -插入符的位置. -*/ - -"use strict"; -var EditableCaret, InputCaret, Mirror, Utils, discoveryIframeOf, methods, oDocument, oFrame, oWindow, pluginName, setContextBy; - -pluginName = 'caret'; - -EditableCaret = (function() { - function EditableCaret($inputor) { - this.$inputor = $inputor; - this.domInputor = this.$inputor[0]; - } - - EditableCaret.prototype.setPos = function(pos) { - var fn, found, offset, sel; - if (sel = oWindow.getSelection()) { - offset = 0; - found = false; - (fn = function(pos, parent) { - var node, range, _i, _len, _ref, _results; - _ref = parent.childNodes; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - if (found) { - break; - } - if (node.nodeType === 3) { - if (offset + node.length >= pos) { - found = true; - range = oDocument.createRange(); - range.setStart(node, pos - offset); - sel.removeAllRanges(); - sel.addRange(range); - break; - } else { - _results.push(offset += node.length); - } - } else { - _results.push(fn(pos, node)); - } - } - return _results; - })(pos, this.domInputor); - } - return this.domInputor; - }; - - EditableCaret.prototype.getIEPosition = function() { - return this.getPosition(); - }; - - EditableCaret.prototype.getPosition = function() { - var inputor_offset, offset; - offset = this.getOffset(); - inputor_offset = this.$inputor.offset(); - offset.left -= inputor_offset.left; - offset.top -= inputor_offset.top; - return offset; - }; - - EditableCaret.prototype.getOldIEPos = function() { - var preCaretTextRange, textRange; - textRange = oDocument.selection.createRange(); - preCaretTextRange = oDocument.body.createTextRange(); - preCaretTextRange.moveToElementText(this.domInputor); - preCaretTextRange.setEndPoint("EndToEnd", textRange); - return preCaretTextRange.text.length; - }; - - EditableCaret.prototype.getPos = function() { - var clonedRange, pos, range; - if (range = this.range()) { - clonedRange = range.cloneRange(); - clonedRange.selectNodeContents(this.domInputor); - clonedRange.setEnd(range.endContainer, range.endOffset); - pos = clonedRange.toString().length; - clonedRange.detach(); - return pos; - } else if (oDocument.selection) { - return this.getOldIEPos(); - } - }; - - EditableCaret.prototype.getOldIEOffset = function() { - var range, rect; - range = oDocument.selection.createRange().duplicate(); - range.moveStart("character", -1); - rect = range.getBoundingClientRect(); - return { - height: rect.bottom - rect.top, - left: rect.left, - top: rect.top - }; - }; - - EditableCaret.prototype.getOffset = function(pos) { - var clonedRange, offset, range, rect, shadowCaret; - if (oWindow.getSelection && (range = this.range())) { - if (range.endOffset - 1 > 0 && range.endContainer !== this.domInputor) { - clonedRange = range.cloneRange(); - clonedRange.setStart(range.endContainer, range.endOffset - 1); - clonedRange.setEnd(range.endContainer, range.endOffset); - rect = clonedRange.getBoundingClientRect(); - offset = { - height: rect.height, - left: rect.left + rect.width, - top: rect.top - }; - clonedRange.detach(); - } - if (!offset || (offset != null ? offset.height : void 0) === 0) { - clonedRange = range.cloneRange(); - shadowCaret = $(oDocument.createTextNode("|")); - clonedRange.insertNode(shadowCaret[0]); - clonedRange.selectNode(shadowCaret[0]); - rect = clonedRange.getBoundingClientRect(); - offset = { - height: rect.height, - left: rect.left, - top: rect.top - }; - shadowCaret.remove(); - clonedRange.detach(); - } - } else if (oDocument.selection) { - offset = this.getOldIEOffset(); - } - if (offset) { - offset.top += $(oWindow).scrollTop(); - offset.left += $(oWindow).scrollLeft(); - } - return offset; - }; - - EditableCaret.prototype.range = function() { - var sel; - if (!oWindow.getSelection) { - return; - } - sel = oWindow.getSelection(); - if (sel.rangeCount > 0) { - return sel.getRangeAt(0); - } else { - return null; - } - }; - - return EditableCaret; - -})(); - -InputCaret = (function() { - function InputCaret($inputor) { - this.$inputor = $inputor; - this.domInputor = this.$inputor[0]; - } - - InputCaret.prototype.getIEPos = function() { - var endRange, inputor, len, normalizedValue, pos, range, textInputRange; - inputor = this.domInputor; - range = oDocument.selection.createRange(); - pos = 0; - if (range && range.parentElement() === inputor) { - normalizedValue = inputor.value.replace(/\r\n/g, "\n"); - len = normalizedValue.length; - textInputRange = inputor.createTextRange(); - textInputRange.moveToBookmark(range.getBookmark()); - endRange = inputor.createTextRange(); - endRange.collapse(false); - if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) { - pos = len; - } else { - pos = -textInputRange.moveStart("character", -len); - } - } - return pos; - }; - - InputCaret.prototype.getPos = function() { - if (oDocument.selection) { - return this.getIEPos(); - } else { - return this.domInputor.selectionStart; - } - }; - - InputCaret.prototype.setPos = function(pos) { - var inputor, range; - inputor = this.domInputor; - if (oDocument.selection) { - range = inputor.createTextRange(); - range.move("character", pos); - range.select(); - } else if (inputor.setSelectionRange) { - inputor.setSelectionRange(pos, pos); - } - return inputor; - }; - - InputCaret.prototype.getIEOffset = function(pos) { - var h, textRange, x, y; - textRange = this.domInputor.createTextRange(); - pos || (pos = this.getPos()); - textRange.move('character', pos); - x = textRange.boundingLeft; - y = textRange.boundingTop; - h = textRange.boundingHeight; - return { - left: x, - top: y, - height: h - }; - }; - - InputCaret.prototype.getOffset = function(pos) { - var $inputor, offset, position; - $inputor = this.$inputor; - if (oDocument.selection) { - offset = this.getIEOffset(pos); - offset.top += $(oWindow).scrollTop() + $inputor.scrollTop(); - offset.left += $(oWindow).scrollLeft() + $inputor.scrollLeft(); - return offset; - } else { - offset = $inputor.offset(); - position = this.getPosition(pos); - return offset = { - left: offset.left + position.left - $inputor.scrollLeft(), - top: offset.top + position.top - $inputor.scrollTop(), - height: position.height - }; - } - }; - - InputCaret.prototype.getPosition = function(pos) { - var $inputor, at_rect, end_range, format, html, mirror, start_range; - $inputor = this.$inputor; - format = function(value) { - value = value.replace(/<|>|`|"|&/g, '?').replace(/\r\n|\r|\n/g, "
      "); - if (/firefox/i.test(navigator.userAgent)) { - value = value.replace(/\s/g, ' '); - } - return value; - }; - if (pos === void 0) { - pos = this.getPos(); - } - start_range = $inputor.val().slice(0, pos); - end_range = $inputor.val().slice(pos); - html = "" + format(start_range) + ""; - html += "|"; - html += "" + format(end_range) + ""; - mirror = new Mirror($inputor); - return at_rect = mirror.create(html).rect(); - }; - - InputCaret.prototype.getIEPosition = function(pos) { - var h, inputorOffset, offset, x, y; - offset = this.getIEOffset(pos); - inputorOffset = this.$inputor.offset(); - x = offset.left - inputorOffset.left; - y = offset.top - inputorOffset.top; - h = offset.height; - return { - left: x, - top: y, - height: h - }; - }; - - return InputCaret; - -})(); - -Mirror = (function() { - Mirror.prototype.css_attr = ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle", "borderTopWidth", "boxSizing", "fontFamily", "fontSize", "fontWeight", "height", "letterSpacing", "lineHeight", "marginBottom", "marginLeft", "marginRight", "marginTop", "outlineWidth", "overflow", "overflowX", "overflowY", "paddingBottom", "paddingLeft", "paddingRight", "paddingTop", "textAlign", "textOverflow", "textTransform", "whiteSpace", "wordBreak", "wordWrap"]; - - function Mirror($inputor) { - this.$inputor = $inputor; - } - - Mirror.prototype.mirrorCss = function() { - var css, - _this = this; - css = { - position: 'absolute', - left: -9999, - top: 0, - zIndex: -20000 - }; - if (this.$inputor.prop('tagName') === 'TEXTAREA') { - this.css_attr.push('width'); - } - $.each(this.css_attr, function(i, p) { - return css[p] = _this.$inputor.css(p); - }); - return css; - }; - - Mirror.prototype.create = function(html) { - this.$mirror = $('
      '); - this.$mirror.css(this.mirrorCss()); - this.$mirror.html(html); - this.$inputor.after(this.$mirror); - return this; - }; - - Mirror.prototype.rect = function() { - var $flag, pos, rect; - $flag = this.$mirror.find("#caret"); - pos = $flag.position(); - rect = { - left: pos.left, - top: pos.top, - height: $flag.height() - }; - this.$mirror.remove(); - return rect; - }; - - return Mirror; - -})(); - -Utils = { - contentEditable: function($inputor) { - return !!($inputor[0].contentEditable && $inputor[0].contentEditable === 'true'); - } -}; - -methods = { - pos: function(pos) { - if (pos || pos === 0) { - return this.setPos(pos); - } else { - return this.getPos(); - } - }, - position: function(pos) { - if (oDocument.selection) { - return this.getIEPosition(pos); - } else { - return this.getPosition(pos); - } - }, - offset: function(pos) { - var offset; - offset = this.getOffset(pos); - return offset; - } -}; - -oDocument = null; - -oWindow = null; - -oFrame = null; - -setContextBy = function(settings) { - var iframe; - if (iframe = settings != null ? settings.iframe : void 0) { - oFrame = iframe; - oWindow = iframe.contentWindow; - return oDocument = iframe.contentDocument || oWindow.document; - } else { - oFrame = void 0; - oWindow = window; - return oDocument = document; - } -}; - -discoveryIframeOf = function($dom) { - var error; - oDocument = $dom[0].ownerDocument; - oWindow = oDocument.defaultView || oDocument.parentWindow; - try { - return oFrame = oWindow.frameElement; - } catch (_error) { - error = _error; - } -}; - -$.fn.caret = function(method, value, settings) { - var caret; - if (methods[method]) { - if ($.isPlainObject(value)) { - setContextBy(value); - value = void 0; - } else { - setContextBy(settings); - } - caret = Utils.contentEditable(this) ? new EditableCaret(this) : new InputCaret(this); - return methods[method].apply(caret, [value]); - } else { - return $.error("Method " + method + " does not exist on jQuery.caret"); - } -}; - -$.fn.caret.EditableCaret = EditableCaret; - -$.fn.caret.InputCaret = InputCaret; - -$.fn.caret.Utils = Utils; - -$.fn.caret.apis = methods; - - -})); diff --git a/pagure/static/atwho/jquery.caret-0.3.1.min.js b/pagure/static/atwho/jquery.caret-0.3.1.min.js deleted file mode 100644 index a25584e..0000000 --- a/pagure/static/atwho/jquery.caret-0.3.1.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jquery.caret 2016-02-27 */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return a.returnExportsGlobal=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){"use strict";var b,c,d,e,f,g,h,i,j,k,l;k="caret",b=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.setPos=function(a){var b,c,d,e;return(e=j.getSelection())&&(d=0,c=!1,(b=function(a,f){var g,i,j,k,l,m;for(l=f.childNodes,m=[],j=0,k=l.length;k>j&&(g=l[j],!c);j++)if(3===g.nodeType){if(d+g.length>=a){c=!0,i=h.createRange(),i.setStart(g,a-d),e.removeAllRanges(),e.addRange(i);break}m.push(d+=g.length)}else m.push(b(a,g));return m})(a,this.domInputor)),this.domInputor},b.prototype.getIEPosition=function(){return this.getPosition()},b.prototype.getPosition=function(){var a,b;return b=this.getOffset(),a=this.$inputor.offset(),b.left-=a.left,b.top-=a.top,b},b.prototype.getOldIEPos=function(){var a,b;return b=h.selection.createRange(),a=h.body.createTextRange(),a.moveToElementText(this.domInputor),a.setEndPoint("EndToEnd",b),a.text.length},b.prototype.getPos=function(){var a,b,c;return(c=this.range())?(a=c.cloneRange(),a.selectNodeContents(this.domInputor),a.setEnd(c.endContainer,c.endOffset),b=a.toString().length,a.detach(),b):h.selection?this.getOldIEPos():void 0},b.prototype.getOldIEOffset=function(){var a,b;return a=h.selection.createRange().duplicate(),a.moveStart("character",-1),b=a.getBoundingClientRect(),{height:b.bottom-b.top,left:b.left,top:b.top}},b.prototype.getOffset=function(){var b,c,d,e,f;return j.getSelection&&(d=this.range())?(d.endOffset-1>0&&d.endContainer!==this.domInputor&&(b=d.cloneRange(),b.setStart(d.endContainer,d.endOffset-1),b.setEnd(d.endContainer,d.endOffset),e=b.getBoundingClientRect(),c={height:e.height,left:e.left+e.width,top:e.top},b.detach()),c&&0!==(null!=c?c.height:void 0)||(b=d.cloneRange(),f=a(h.createTextNode("|")),b.insertNode(f[0]),b.selectNode(f[0]),e=b.getBoundingClientRect(),c={height:e.height,left:e.left,top:e.top},f.remove(),b.detach())):h.selection&&(c=this.getOldIEOffset()),c&&(c.top+=a(j).scrollTop(),c.left+=a(j).scrollLeft()),c},b.prototype.range=function(){var a;if(j.getSelection)return a=j.getSelection(),a.rangeCount>0?a.getRangeAt(0):null},b}(),c=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.getIEPos=function(){var a,b,c,d,e,f,g;return b=this.domInputor,f=h.selection.createRange(),e=0,f&&f.parentElement()===b&&(d=b.value.replace(/\r\n/g,"\n"),c=d.length,g=b.createTextRange(),g.moveToBookmark(f.getBookmark()),a=b.createTextRange(),a.collapse(!1),e=g.compareEndPoints("StartToEnd",a)>-1?c:-g.moveStart("character",-c)),e},b.prototype.getPos=function(){return h.selection?this.getIEPos():this.domInputor.selectionStart},b.prototype.setPos=function(a){var b,c;return b=this.domInputor,h.selection?(c=b.createTextRange(),c.move("character",a),c.select()):b.setSelectionRange&&b.setSelectionRange(a,a),b},b.prototype.getIEOffset=function(a){var b,c,d,e;return c=this.domInputor.createTextRange(),a||(a=this.getPos()),c.move("character",a),d=c.boundingLeft,e=c.boundingTop,b=c.boundingHeight,{left:d,top:e,height:b}},b.prototype.getOffset=function(b){var c,d,e;return c=this.$inputor,h.selection?(d=this.getIEOffset(b),d.top+=a(j).scrollTop()+c.scrollTop(),d.left+=a(j).scrollLeft()+c.scrollLeft(),d):(d=c.offset(),e=this.getPosition(b),d={left:d.left+e.left-c.scrollLeft(),top:d.top+e.top-c.scrollTop(),height:e.height})},b.prototype.getPosition=function(a){var b,c,e,f,g,h,i;return b=this.$inputor,f=function(a){return a=a.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"
      "),/firefox/i.test(navigator.userAgent)&&(a=a.replace(/\s/g," ")),a},void 0===a&&(a=this.getPos()),i=b.val().slice(0,a),e=b.val().slice(a),g=""+f(i)+"",g+="|",g+=""+f(e)+"",h=new d(b),c=h.create(g).rect()},b.prototype.getIEPosition=function(a){var b,c,d,e,f;return d=this.getIEOffset(a),c=this.$inputor.offset(),e=d.left-c.left,f=d.top-c.top,b=d.height,{left:e,top:f,height:b}},b}(),d=function(){function b(a){this.$inputor=a}return b.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],b.prototype.mirrorCss=function(){var b,c=this;return b={position:"absolute",left:-9999,top:0,zIndex:-2e4},"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),a.each(this.css_attr,function(a,d){return b[d]=c.$inputor.css(d)}),b},b.prototype.create=function(b){return this.$mirror=a("
      "),this.$mirror.css(this.mirrorCss()),this.$mirror.html(b),this.$inputor.after(this.$mirror),this},b.prototype.rect=function(){var a,b,c;return a=this.$mirror.find("#caret"),b=a.position(),c={left:b.left,top:b.top,height:a.height()},this.$mirror.remove(),c},b}(),e={contentEditable:function(a){return!(!a[0].contentEditable||"true"!==a[0].contentEditable)}},g={pos:function(a){return a||0===a?this.setPos(a):this.getPos()},position:function(a){return h.selection?this.getIEPosition(a):this.getPosition(a)},offset:function(a){var b;return b=this.getOffset(a)}},h=null,j=null,i=null,l=function(a){var b;return(b=null!=a?a.iframe:void 0)?(i=b,j=b.contentWindow,h=b.contentDocument||j.document):(i=void 0,j=window,h=document)},f=function(a){var b;h=a[0].ownerDocument,j=h.defaultView||h.parentWindow;try{return i=j.frameElement}catch(c){b=c}},a.fn.caret=function(d,f,h){var i;return g[d]?(a.isPlainObject(f)?(l(f),f=void 0):l(h),i=e.contentEditable(this)?new b(this):new c(this),g[d].apply(i,[f])):a.error("Method "+d+" does not exist on jQuery.caret")},a.fn.caret.EditableCaret=b,a.fn.caret.InputCaret=c,a.fn.caret.Utils=e,a.fn.caret.apis=g}); \ No newline at end of file diff --git a/pagure/static/atwho/jquery.caret.js b/pagure/static/atwho/jquery.caret.js deleted file mode 120000 index e0b716b..0000000 --- a/pagure/static/atwho/jquery.caret.js +++ /dev/null @@ -1 +0,0 @@ -jquery.caret-0.3.1.js \ No newline at end of file diff --git a/pagure/static/atwho/jquery.caret.min.js b/pagure/static/atwho/jquery.caret.min.js deleted file mode 120000 index 0cfd9eb..0000000 --- a/pagure/static/atwho/jquery.caret.min.js +++ /dev/null @@ -1 +0,0 @@ -jquery.caret-0.3.1.min.js \ No newline at end of file diff --git a/pagure/static/cal-heatmap/cal-heatmap.3.3.10.css b/pagure/static/cal-heatmap/cal-heatmap.3.3.10.css deleted file mode 100644 index 83e43fb..0000000 --- a/pagure/static/cal-heatmap/cal-heatmap.3.3.10.css +++ /dev/null @@ -1,145 +0,0 @@ -/* Cal-HeatMap CSS */ - -.cal-heatmap-container { - display: block; -} - -.graph -{ - font-family: "Lucida Grande", Lucida, Verdana, sans-serif; -} - -.graph-label -{ - fill: #999; - font-size: 10px -} - -.graph, .graph-legend rect { - shape-rendering: crispedges -} - -.graph-rect -{ - fill: #ededed -} - -.graph-subdomain-group rect:hover -{ - stroke: #000; - stroke-width: 1px -} - -.subdomain-text { - font-size: 8px; - fill: #999; - pointer-events: none -} - -.hover_cursor:hover { - cursor: pointer -} - -.qi { - background-color: #999; - fill: #999 -} - -/* -Remove comment to apply this style to date with value equal to 0 -.q0 -{ - background-color: #fff; - fill: #fff; - stroke: #ededed -} -*/ - -.q1 -{ - background-color: #dae289; - fill: #dae289 -} - -.q2 -{ - background-color: #cedb9c; - fill: #9cc069 -} - -.q3 -{ - background-color: #b5cf6b; - fill: #669d45 -} - -.q4 -{ - background-color: #637939; - fill: #637939 -} - -.q5 -{ - background-color: #3b6427; - fill: #3b6427 -} - -rect.highlight -{ - stroke:#444; - stroke-width:1 -} - -text.highlight -{ - fill: #444 -} - -rect.now -{ - stroke: red -} - -text.now -{ - fill: red; - font-weight: 800 -} - -.domain-background { - fill: none; - shape-rendering: crispedges -} - -.ch-tooltip { - padding: 10px; - background: #222; - color: #bbb; - font-size: 12px; - line-height: 1.4; - width: 140px; - position: absolute; - z-index: 99999; - text-align: center; - border-radius: 2px; - box-shadow: 2px 2px 2px rgba(0,0,0,0.2); - display: none; - box-sizing: border-box; -} - -.ch-tooltip::after{ - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - content: ""; - padding: 0; - display: "block"; - bottom: -6px; - left: 50%; - margin-left: -6px; - border-width: 6px 6px 0; - border-top-color: #222; -} diff --git a/pagure/static/cal-heatmap/cal-heatmap.3.3.10.js b/pagure/static/cal-heatmap/cal-heatmap.3.3.10.js deleted file mode 100644 index 9cd7626..0000000 --- a/pagure/static/cal-heatmap/cal-heatmap.3.3.10.js +++ /dev/null @@ -1,3348 +0,0 @@ -/*! cal-heatmap v3.3.10 (Tue Dec 03 2013 19:30:01) - * --------------------------------------------- - * Cal-Heatmap is a javascript module to create calendar heatmap to visualize time series data - * https://github.com/kamisama/cal-heatmap - * Licensed under the MIT license - * Copyright 2013 Wan Qi Chen - */ - -var CalHeatMap = function() { - "use strict"; - - var self = this; - - this.allowedDataType = ["json", "csv", "tsv", "txt"]; - - // Default settings - this.options = { - // selector string of the container to append the graph to - // Accept any string value accepted by document.querySelector or CSS3 - // or an Element object - itemSelector: "#cal-heatmap", - - // Whether to paint the calendar on init() - // Used by testsuite to reduce testing time - paintOnLoad: true, - - // ================================================ - // DOMAIN - // ================================================ - - // Number of domain to display on the graph - range: 12, - - // Size of each cell, in pixel - cellSize: 10, - - // Padding between each cell, in pixel - cellPadding: 2, - - // For rounded subdomain rectangles, in pixels - cellRadius: 0, - - domainGutter: 2, - - domainMargin: [0, 0, 0, 0], - - domain: "hour", - - subDomain: "min", - - // Number of columns to split the subDomains to - // If not null, will takes precedence over rowLimit - colLimit: null, - - // Number of rows to split the subDomains to - // Will be ignored if colLimit is not null - rowLimit: null, - - // First day of the week is Monday - // 0 to start the week on Sunday - weekStartOnMonday: true, - - // Start date of the graph - // @default now - start: new Date(), - - minDate: null, - - maxDate: null, - - // URL, where to fetch the original datas - data: "", - - dataType: this.allowedDataType[0], - - // Whether to consider missing date:value from the datasource - // as equal to 0, or just leave them as missing - considerMissingDataAsZero: false, - - // Load remote data on calendar creation - // When false, the calendar will be left empty - loadOnInit: true, - - // Calendar orientation - // false: display domains side by side - // true : display domains one under the other - verticalOrientation: false, - - // Domain dynamic width/height - // The width on a domain depends on the number of - domainDynamicDimension: true, - - // Domain Label properties - label: { - // valid: top, right, bottom, left - position: "bottom", - - // Valid: left, center, right - // Also valid are the direct svg values: start, middle, end - align: "center", - - // By default, there is no margin/padding around the label - offset: { - x: 0, - y: 0 - }, - - rotate: null, - - // Used only on vertical orientation - width: 100, - - // Used only on horizontal orientation - height: null - }, - - // ================================================ - // LEGEND - // ================================================ - - // Threshold for the legend - legend: [10, 20, 30, 40], - - // Whether to display the legend - displayLegend: true, - - legendCellSize: 10, - - legendCellPadding: 2, - - legendMargin: [0, 0, 0, 0], - - // Legend vertical position - // top: place legend above calendar - // bottom: place legend below the calendar - legendVerticalPosition: "bottom", - - // Legend horizontal position - // accepted values: left, center, right - legendHorizontalPosition: "left", - - // Legend rotation - // accepted values: horizontal, vertical - legendOrientation: "horizontal", - - // Objects holding all the heatmap different colors - // null to disable, and use the default css styles - // - // Examples: - // legendColors: { - // min: "green", - // max: "red", - // empty: "#ffffff", - // base: "grey", - // overflow: "red" - // } - legendColors: null, - - // ================================================ - // HIGHLIGHT - // ================================================ - - // List of dates to highlight - // Valid values: - // - []: don't highlight anything - // - "now": highlight the current date - // - an array of Date objects: highlight the specified dates - highlight: [], - - // ================================================ - // TEXT FORMATTING / i18n - // ================================================ - - // Name of the items to represent in the calendar - itemName: ["item", "items"], - - // Formatting of the domain label - // @default: null, will use the formatting according to domain type - // Accept a string used as specifier by d3.time.format() - // or a function - // - // Refer to https://github.com/mbostock/d3/wiki/Time-Formatting - // for accepted date formatting used by d3.time.format() - domainLabelFormat: null, - - // Formatting of the title displayed when hovering a subDomain cell - subDomainTitleFormat: { - empty: "{date}", - filled: "{count} {name} {connector} {date}" - }, - - // Formatting of the {date} used in subDomainTitleFormat - // @default: null, will use the formatting according to subDomain type - // Accept a string used as specifier by d3.time.format() - // or a function - // - // Refer to https://github.com/mbostock/d3/wiki/Time-Formatting - // for accepted date formatting used by d3.time.format() - subDomainDateFormat: null, - - // Formatting of the text inside each subDomain cell - // @default: null, no text - // Accept a string used as specifier by d3.time.format() - // or a function - // - // Refer to https://github.com/mbostock/d3/wiki/Time-Formatting - // for accepted date formatting used by d3.time.format() - subDomainTextFormat: null, - - // Formatting of the title displayed when hovering a legend cell - legendTitleFormat: { - lower: "less than {min} {name}", - inner: "between {down} and {up} {name}", - upper: "more than {max} {name}" - }, - - // Animation duration, in ms - animationDuration: 500, - - nextSelector: false, - - previousSelector: false, - - itemNamespace: "cal-heatmap", - - tooltip: false, - - // ================================================ - // EVENTS CALLBACK - // ================================================ - - // Callback when clicking on a time block - onClick: null, - - // Callback after painting the empty calendar - // Can be used to trigger an API call, once the calendar is ready to be filled - afterLoad: null, - - // Callback after loading the next domain in the calendar - afterLoadNextDomain: null, - - // Callback after loading the previous domain in the calendar - afterLoadPreviousDomain: null, - - // Callback after finishing all actions on the calendar - onComplete: null, - - // Callback after fetching the datas, but before applying them to the calendar - // Used mainly to convert the datas if they're not formatted like expected - // Takes the fetched "data" object as argument, must return a json object - // formatted like {timestamp:count, timestamp2:count2}, - afterLoadData: function(data) { return data; }, - - // Callback triggered after calling next(). - // The `status` argument is equal to true if there is no - // more next domain to load - // - // This callback is also executed once, after calling previous(), - // only when the max domain is reached - onMaxDomainReached: null, - - // Callback triggered after calling previous(). - // The `status` argument is equal to true if there is no - // more previous domain to load - // - // This callback is also executed once, after calling next(), - // only when the min domain is reached - onMinDomainReached: null - }; - - this._domainType = { - "min": { - name: "minute", - level: 10, - maxItemNumber: 60, - defaultRowNumber: 10, - defaultColumnNumber: 6, - row: function(d) { return self.getSubDomainRowNumber(d); }, - column: function(d) { return self.getSubDomainColumnNumber(d); }, - position: { - x: function(d) { return Math.floor(d.getMinutes() / self._domainType.min.row(d)); }, - y: function(d) { return d.getMinutes() % self._domainType.min.row(d); } - }, - format: { - date: "%H:%M, %A %B %-e, %Y", - legend: "", - connector: "at" - }, - extractUnit: function(d) { - return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes()).getTime(); - } - }, - "hour": { - name: "hour", - level: 20, - maxItemNumber: function(d) { - switch(self.options.domain) { - case "day": - return 24; - case "week": - return 24 * 7; - case "month": - return 24 * (self.options.domainDynamicDimension ? self.getDayCountInMonth(d): 31); - } - }, - defaultRowNumber: 6, - defaultColumnNumber: function(d) { - switch(self.options.domain) { - case "day": - return 4; - case "week": - return 28; - case "month": - return self.options.domainDynamicDimension ? self.getDayCountInMonth(d): 31; - } - }, - row: function(d) { return self.getSubDomainRowNumber(d); }, - column: function(d) { return self.getSubDomainColumnNumber(d); }, - position: { - x: function(d) { - if (self.options.domain === "month") { - if (self.options.colLimit > 0 || self.options.rowLimit > 0) { - return Math.floor((d.getHours() + (d.getDate()-1)*24) / self._domainType.hour.row(d)); - } - return Math.floor(d.getHours() / self._domainType.hour.row(d)) + (d.getDate()-1)*4; - } else if (self.options.domain === "week") { - if (self.options.colLimit > 0 || self.options.rowLimit > 0) { - return Math.floor((d.getHours() + self.getWeekDay(d)*24) / self._domainType.hour.row(d)); - } - return Math.floor(d.getHours() / self._domainType.hour.row(d)) + self.getWeekDay(d)*4; - } - return Math.floor(d.getHours() / self._domainType.hour.row(d)); - }, - y: function(d) { - var p = d.getHours(); - if (self.options.colLimit > 0 || self.options.rowLimit > 0) { - switch(self.options.domain) { - case "month": - p += (d.getDate()-1) * 24; - break; - case "week": - p += self.getWeekDay(d) * 24; - break; - } - } - return Math.floor(p % self._domainType.hour.row(d)); - } - }, - format: { - date: "%Hh, %A %B %-e, %Y", - legend: "%H:00", - connector: "at" - }, - extractUnit: function(d) { - return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours()).getTime(); - } - }, - "day": { - name: "day", - level: 30, - maxItemNumber: function(d) { - switch(self.options.domain) { - case "week": - return 7; - case "month": - return self.options.domainDynamicDimension ? self.getDayCountInMonth(d) : 31; - case "year": - return self.options.domainDynamicDimension ? self.getDayCountInYear(d) : 366; - } - }, - defaultColumnNumber: function(d) { - d = new Date(d); - switch(self.options.domain) { - case "week": - return 1; - case "month": - return (self.options.domainDynamicDimension && !self.options.verticalOrientation) ? (self.getWeekNumber(new Date(d.getFullYear(), d.getMonth()+1, 0)) - self.getWeekNumber(d) + 1): 6; - case "year": - return (self.options.domainDynamicDimension ? (self.getWeekNumber(new Date(d.getFullYear(), 11, 31)) - self.getWeekNumber(new Date(d.getFullYear(), 0)) + 1): 54); - } - }, - defaultRowNumber: 7, - row: function(d) { return self.getSubDomainRowNumber(d); }, - column: function(d) { return self.getSubDomainColumnNumber(d); }, - position: { - x: function(d) { - switch(self.options.domain) { - case "week": - return Math.floor(self.getWeekDay(d) / self._domainType.day.row(d)); - case "month": - if (self.options.colLimit > 0 || self.options.rowLimit > 0) { - return Math.floor((d.getDate() - 1)/ self._domainType.day.row(d)); - } - return self.getWeekNumber(d) - self.getWeekNumber(new Date(d.getFullYear(), d.getMonth())); - case "year": - if (self.options.colLimit > 0 || self.options.rowLimit > 0) { - return Math.floor((self.getDayOfYear(d) - 1) / self._domainType.day.row(d)); - } - return self.getWeekNumber(d); - } - }, - y: function(d) { - var p = self.getWeekDay(d); - if (self.options.colLimit > 0 || self.options.rowLimit > 0) { - switch(self.options.domain) { - case "year": - p = self.getDayOfYear(d) - 1; - break; - case "week": - p = self.getWeekDay(d); - break; - case "month": - p = d.getDate() - 1; - break; - } - } - return Math.floor(p % self._domainType.day.row(d)); - } - }, - format: { - date: "%A %B %-e, %Y", - legend: "%e %b", - connector: "on" - }, - extractUnit: function(d) { - return new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime(); - } - }, - "week": { - name: "week", - level: 40, - maxItemNumber: 54, - defaultColumnNumber: function(d) { - d = new Date(d); - switch(self.options.domain) { - case "year": - return self._domainType.week.maxItemNumber; - case "month": - return self.getWeekNumber(new Date(d.getFullYear(), d.getMonth()+1, 0)) - self.getWeekNumber(d); - } - }, - defaultRowNumber: 1, - row: function(d) { return self.getSubDomainRowNumber(d); }, - column: function(d) { return self.getSubDomainColumnNumber(d); }, - position: { - x: function(d) { - switch(self.options.domain) { - case "year": - return Math.floor(self.getWeekNumber(d) / self._domainType.week.row(d)); - case "month": - return Math.floor(self.getMonthWeekNumber(d) / self._domainType.week.row(d)); - } - }, - y: function(d) { - return self.getWeekNumber(d) % self._domainType.week.row(d); - } - }, - format: { - date: "%B Week #%W", - legend: "%B Week #%W", - connector: "on" - }, - extractUnit: function(d) { - var dt = new Date(d.getFullYear(), d.getMonth(), d.getDate()); - // According to ISO-8601, week number computation are based on week starting on Monday - var weekDay = dt.getDay()-1; - if (weekDay < 0) { - weekDay = 6; - } - dt.setDate(dt.getDate() - weekDay); - return dt.getTime(); - } - }, - "month": { - name: "month", - level: 50, - maxItemNumber: 12, - defaultColumnNumber: 12, - defaultRowNumber: 1, - row: function() { return self.getSubDomainRowNumber(); }, - column: function() { return self.getSubDomainColumnNumber(); }, - position: { - x: function(d) { return Math.floor(d.getMonth() / self._domainType.month.row(d)); }, - y: function(d) { return d.getMonth() % self._domainType.month.row(d); } - }, - format: { - date: "%B %Y", - legend: "%B", - connector: "on" - }, - extractUnit: function(d) { - return new Date(d.getFullYear(), d.getMonth()).getTime(); - } - }, - "year": { - name: "year", - level: 60, - row: function() { return self.options.rowLimit || 1; }, - column: function() { return self.options.colLimit || 1; }, - position: { - x: function() { return 1; }, - y: function() { return 1; } - }, - format: { - date: "%Y", - legend: "%Y", - connector: "on" - }, - extractUnit: function(d) { - return new Date(d.getFullYear()).getTime(); - } - } - }; - - for (var type in this._domainType) { - if (this._domainType.hasOwnProperty(type)) { - var d = this._domainType[type]; - this._domainType["x_" + type] = { - name: "x_" + type, - level: d.type, - maxItemNumber: d.maxItemNumber, - defaultRowNumber: d.defaultRowNumber, - defaultColumnNumber: d.defaultColumnNumber, - row: d.column, - column: d.row, - position: { - x: d.position.y, - y: d.position.x, - }, - format: d.format, - extractUnit: d.extractUnit - }; - } - } - - // Record the address of the last inserted domain when browsing - this.lastInsertedSvg = null; - - this._completed = false; - - // Record all the valid domains - // Each domain value is a timestamp in milliseconds - this._domains = d3.map(); - - this.graphDim = { - width: 0, - height: 0 - }; - - this.legendDim = { - width: 0, - height: 0 - }; - - this.NAVIGATE_LEFT = 1; - this.NAVIGATE_RIGHT = 2; - - // Various update mode when using the update() API - this.RESET_ALL_ON_UPDATE = 0; - this.RESET_SINGLE_ON_UPDATE = 1; - this.APPEND_ON_UPDATE = 2; - - this.DEFAULT_LEGEND_MARGIN = 10; - - this.root = null; - this.tooltip = null; - - this._maxDomainReached = false; - this._minDomainReached = false; - - this.domainPosition = new DomainPosition(); - this.Legend = null; - this.legendScale = null; - - // List of domains that are skipped because of DST - // All times belonging to these domains should be re-assigned to the previous domain - this.DSTDomain = []; - - /** - * Display the graph for the first time - * @return bool True if the calendar is created - */ - this._init = function() { - - self.getDomain(self.options.start).map(function(d) { return d.getTime(); }).map(function(d) { - self._domains.set(d, self.getSubDomain(d).map(function(d) { return {t: self._domainType[self.options.subDomain].extractUnit(d), v: null}; })); - }); - - self.root = d3.select(self.options.itemSelector).append("svg").attr("class", "cal-heatmap-container"); - - self.tooltip = d3.select(self.options.itemSelector) - .attr("style", function() { - var current = d3.select(self.options.itemSelector).attr("style"); - return (current !== null ? current : "") + "position:relative;"; - }) - .append("div") - .attr("class", "ch-tooltip") - ; - - self.root.attr("x", 0).attr("y", 0).append("svg").attr("class", "graph"); - - self.Legend = new Legend(self); - - if (self.options.paintOnLoad) { - _initCalendar(); - } - - return true; - }; - - function _initCalendar() { - self.verticalDomainLabel = (self.options.label.position === "top" || self.options.label.position === "bottom"); - - self.domainVerticalLabelHeight = self.options.label.height === null ? Math.max(25, self.options.cellSize*2): self.options.label.height; - self.domainHorizontalLabelWidth = 0; - - if (self.options.domainLabelFormat === "" && self.options.label.height === null) { - self.domainVerticalLabelHeight = 0; - } - - if (!self.verticalDomainLabel) { - self.domainVerticalLabelHeight = 0; - self.domainHorizontalLabelWidth = self.options.label.width; - } - - self.paint(); - - // =========================================================================// - // ATTACHING DOMAIN NAVIGATION EVENT // - // =========================================================================// - if (self.options.nextSelector !== false) { - d3.select(self.options.nextSelector).on("click." + self.options.itemNamespace, function() { - d3.event.preventDefault(); - return self.loadNextDomain(1); - }); - } - - if (self.options.previousSelector !== false) { - d3.select(self.options.previousSelector).on("click." + self.options.itemNamespace, function() { - d3.event.preventDefault(); - return self.loadPreviousDomain(1); - }); - } - - self.Legend.redraw(self.graphDim.width - self.options.domainGutter - self.options.cellPadding); - self.afterLoad(); - - var domains = self.getDomainKeys(); - - // Fill the graph with some datas - if (self.options.loadOnInit) { - self.getDatas( - self.options.data, - new Date(domains[0]), - self.getSubDomain(domains[domains.length-1]).pop(), - function() { - self.fill(); - self.onComplete(); - } - ); - } else { - self.onComplete(); - } - - self.checkIfMinDomainIsReached(domains[0]); - self.checkIfMaxDomainIsReached(self.getNextDomain().getTime()); - } - - // Return the width of the domain block, without the domain gutter - // @param int d Domain start timestamp - function w(d, outer) { - var width = self.options.cellSize*self._domainType[self.options.subDomain].column(d) + self.options.cellPadding*self._domainType[self.options.subDomain].column(d); - if (arguments.length === 2 && outer === true) { - return width += self.domainHorizontalLabelWidth + self.options.domainGutter + self.options.domainMargin[1] + self.options.domainMargin[3]; - } - return width; - } - - // Return the height of the domain block, without the domain gutter - function h(d, outer) { - var height = self.options.cellSize*self._domainType[self.options.subDomain].row(d) + self.options.cellPadding*self._domainType[self.options.subDomain].row(d); - if (arguments.length === 2 && outer === true) { - height += self.options.domainGutter + self.domainVerticalLabelHeight + self.options.domainMargin[0] + self.options.domainMargin[2]; - } - return height; - } - - /** - * - * - * @param int navigationDir - */ - this.paint = function(navigationDir) { - - var options = self.options; - - if (arguments.length === 0) { - navigationDir = false; - } - - // Painting all the domains - var domainSvg = self.root.select(".graph") - .selectAll(".graph-domain") - .data( - function() { - var data = self.getDomainKeys(); - return navigationDir === self.NAVIGATE_LEFT ? data.reverse(): data; - }, - function(d) { return d; } - ) - ; - - var enteringDomainDim = 0; - var exitingDomainDim = 0; - - // =========================================================================// - // PAINTING DOMAIN // - // =========================================================================// - - var svg = domainSvg - .enter() - .append("svg") - .attr("width", function(d) { - return w(d, true); - }) - .attr("height", function(d) { - return h(d, true); - }) - .attr("x", function(d) { - if (options.verticalOrientation) { - self.graphDim.width = Math.max(self.graphDim.width, w(d, true)); - return 0; - } else { - return getDomainPosition(d, self.graphDim, "width", w(d, true)); - } - }) - .attr("y", function(d) { - if (options.verticalOrientation) { - return getDomainPosition(d, self.graphDim, "height", h(d, true)); - } else { - self.graphDim.height = Math.max(self.graphDim.height, h(d, true)); - return 0; - } - }) - .attr("class", function(d) { - var classname = "graph-domain"; - var date = new Date(d); - switch(options.domain) { - case "hour": - classname += " h_" + date.getHours(); - /* falls through */ - case "day": - classname += " d_" + date.getDate() + " dy_" + date.getDay(); - /* falls through */ - case "week": - classname += " w_" + self.getWeekNumber(date); - /* falls through */ - case "month": - classname += " m_" + (date.getMonth() + 1); - /* falls through */ - case "year": - classname += " y_" + date.getFullYear(); - } - return classname; - }) - ; - - self.lastInsertedSvg = svg; - - function getDomainPosition(domainIndex, graphDim, axis, domainDim) { - var tmp = 0; - switch(navigationDir) { - case false: - tmp = graphDim[axis]; - - graphDim[axis] += domainDim; - self.domainPosition.setPosition(domainIndex, tmp); - return tmp; - - case self.NAVIGATE_RIGHT: - self.domainPosition.setPosition(domainIndex, graphDim[axis]); - - enteringDomainDim = domainDim; - exitingDomainDim = self.domainPosition.getPositionFromIndex(1); - - self.domainPosition.shiftRightBy(exitingDomainDim); - return graphDim[axis]; - - case self.NAVIGATE_LEFT: - tmp = -domainDim; - - enteringDomainDim = -tmp; - exitingDomainDim = graphDim[axis] - self.domainPosition.getLast(); - - self.domainPosition.setPosition(domainIndex, tmp); - self.domainPosition.shiftLeftBy(enteringDomainDim); - return tmp; - } - } - - svg.append("rect") - .attr("width", function(d) { return w(d, true) - options.domainGutter - options.cellPadding; }) - .attr("height", function(d) { return h(d, true) - options.domainGutter - options.cellPadding; }) - .attr("class", "domain-background") - ; - - // =========================================================================// - // PAINTING SUBDOMAINS // - // =========================================================================// - var subDomainSvgGroup = svg.append("svg") - .attr("x", function() { - if (options.label.position === "left") { - return self.domainHorizontalLabelWidth + options.domainMargin[3]; - } else { - return options.domainMargin[3]; - } - }) - .attr("y", function() { - if (options.label.position === "top") { - return self.domainVerticalLabelHeight + options.domainMargin[0]; - } else { - return options.domainMargin[0]; - } - }) - .attr("class", "graph-subdomain-group") - ; - - var rect = subDomainSvgGroup - .selectAll("g") - .data(function(d) { return self._domains.get(d); }) - .enter() - .append("g") - ; - - rect - .append("rect") - .attr("class", function(d) { - return "graph-rect" + self.getHighlightClassName(d.t) + (options.onClick !== null ? " hover_cursor": ""); - }) - .attr("width", options.cellSize) - .attr("height", options.cellSize) - .attr("x", function(d) { return self.positionSubDomainX(d.t); }) - .attr("y", function(d) { return self.positionSubDomainY(d.t); }) - .on("click", function(d) { - if (options.onClick !== null) { - return self.onClick(new Date(d.t), d.v); - } - }) - .call(function(selection) { - if (options.cellRadius > 0) { - selection - .attr("rx", options.cellRadius) - .attr("ry", options.cellRadius) - ; - } - - if (self.legendScale !== null && options.legendColors !== null && options.legendColors.hasOwnProperty("base")) { - selection.attr("fill", options.legendColors.base); - } - - if (options.tooltip) { - selection.on("mouseover", function(d) { - var domainNode = this.parentNode.parentNode.parentNode; - - self.tooltip - .html(self.getSubDomainTitle(d)) - .attr("style", "display: block;") - ; - - self.tooltip.attr("style", - "display: block; " + - "left: " + (self.positionSubDomainX(d.t) - self.tooltip[0][0].offsetWidth/2 + options.cellSize/2 + parseInt(domainNode.getAttribute("x"), 10)) + "px; " + - "top: " + (self.positionSubDomainY(d.t) - self.tooltip[0][0].offsetHeight - options.cellSize/2 + parseInt(domainNode.getAttribute("y"), 10)) + "px;") - ; - }); - - selection.on("mouseout", function() { - self.tooltip - .attr("style", "display:none") - .html(""); - }); - } - }) - ; - - // Appending a title to each subdomain - if (!options.tooltip) { - rect.append("title").text(function(d){ return self.formatDate(new Date(d.t), options.subDomainDateFormat); }); - } - - // =========================================================================// - // PAINTING LABEL // - // =========================================================================// - if (options.domainLabelFormat !== "") { - svg.append("text") - .attr("class", "graph-label") - .attr("y", function(d) { - var y = options.domainMargin[0]; - switch(options.label.position) { - case "top": - y += self.domainVerticalLabelHeight/2; - break; - case "bottom": - y += h(d) + self.domainVerticalLabelHeight/2; - } - - return y + options.label.offset.y * - ( - ((options.label.rotate === "right" && options.label.position === "right") || - (options.label.rotate === "left" && options.label.position === "left")) ? - -1: 1 - ); - }) - .attr("x", function(d){ - var x = options.domainMargin[3]; - switch(options.label.position) { - case "right": - x += w(d); - break; - case "bottom": - case "top": - x += w(d)/2; - } - - if (options.label.align === "right") { - return x + self.domainHorizontalLabelWidth - options.label.offset.x * - (options.label.rotate === "right" ? -1: 1); - } - return x + options.label.offset.x; - - }) - .attr("text-anchor", function() { - switch(options.label.align) { - case "start": - case "left": - return "start"; - case "end": - case "right": - return "end"; - default: - return "middle"; - } - }) - .attr("dominant-baseline", function() { return self.verticalDomainLabel ? "middle": "top"; }) - .text(function(d) { return self.formatDate(new Date(d), options.domainLabelFormat); }) - .call(domainRotate) - ; - } - - function domainRotate(selection) { - switch (options.label.rotate) { - case "right": - selection - .attr("transform", function(d) { - var s = "rotate(90), "; - switch(options.label.position) { - case "right": - s += "translate(-" + w(d) + " , -" + w(d) + ")"; - break; - case "left": - s += "translate(0, -" + self.domainHorizontalLabelWidth + ")"; - break; - } - - return s; - }); - break; - case "left": - selection - .attr("transform", function(d) { - var s = "rotate(270), "; - switch(options.label.position) { - case "right": - s += "translate(-" + (w(d) + self.domainHorizontalLabelWidth) + " , " + w(d) + ")"; - break; - case "left": - s += "translate(-" + (self.domainHorizontalLabelWidth) + " , " + self.domainHorizontalLabelWidth + ")"; - break; - } - - return s; - }); - break; - } - } - - // =========================================================================// - // PAINTING DOMAIN SUBDOMAIN CONTENT // - // =========================================================================// - if (options.subDomainTextFormat !== null) { - rect - .append("text") - .attr("class", function(d) { return "subdomain-text" + self.getHighlightClassName(d.t); }) - .attr("x", function(d) { return self.positionSubDomainX(d.t) + options.cellSize/2; }) - .attr("y", function(d) { return self.positionSubDomainY(d.t) + options.cellSize/2; }) - .attr("text-anchor", "middle") - .attr("dominant-baseline", "central") - .text(function(d){ return self.formatDate(new Date(d.t), options.subDomainTextFormat); }) - ; - } - - // =========================================================================// - // ANIMATION // - // =========================================================================// - - if (navigationDir !== false) { - domainSvg.transition().duration(options.animationDuration) - .attr("x", function(d){ - return options.verticalOrientation ? 0: self.domainPosition.getPosition(d); - }) - .attr("y", function(d){ - return options.verticalOrientation? self.domainPosition.getPosition(d): 0; - }) - ; - } - - var tempWidth = self.graphDim.width; - var tempHeight = self.graphDim.height; - - if (options.verticalOrientation) { - self.graphDim.height += enteringDomainDim - exitingDomainDim; - } else { - self.graphDim.width += enteringDomainDim - exitingDomainDim; - } - - // At the time of exit, domainsWidth and domainsHeight already automatically shifted - domainSvg.exit().transition().duration(options.animationDuration) - .attr("x", function(d){ - if (options.verticalOrientation) { - return 0; - } else { - switch(navigationDir) { - case self.NAVIGATE_LEFT: - return Math.min(self.graphDim.width, tempWidth); - case self.NAVIGATE_RIGHT: - return -w(d, true); - } - } - }) - .attr("y", function(d){ - if (options.verticalOrientation) { - switch(navigationDir) { - case self.NAVIGATE_LEFT: - return Math.min(self.graphDim.height, tempHeight); - case self.NAVIGATE_RIGHT: - return -h(d, true); - } - } else { - return 0; - } - }) - .remove() - ; - - // Resize the root container - self.resize(); - }; -}; - -CalHeatMap.prototype = { - - /** - * Validate and merge user settings with default settings - * - * @param {object} settings User settings - * @return {bool} False if settings contains error - */ - /* jshint maxstatements:false */ - init: function(settings) { - "use strict"; - - var parent = this; - - var options = parent.options = mergeRecursive(parent.options, settings); - - // Fatal errors - // Stop script execution on error - validateDomainType(); - validateSelector(options.itemSelector, false, "itemSelector"); - - if (parent.allowedDataType.indexOf(options.dataType) === -1) { - throw new Error("The data type '" + options.dataType + "' is not valid data type"); - } - - if (d3.select(options.itemSelector)[0][0] === null) { - throw new Error("The node '" + options.itemSelector + "' specified in itemSelector does not exists"); - } - - try { - validateSelector(options.nextSelector, true, "nextSelector"); - validateSelector(options.previousSelector, true, "previousSelector"); - } catch(error) { - console.log(error.message); - return false; - } - - // If other settings contains error, will fallback to default - - if (!settings.hasOwnProperty("subDomain")) { - this.options.subDomain = getOptimalSubDomain(settings.domain); - } - - if (typeof options.itemNamespace !== "string" || options.itemNamespace === "") { - console.log("itemNamespace can not be empty, falling back to cal-heatmap"); - options.itemNamespace = "cal-heatmap"; - } - - // Don't touch these settings - var s = ["data", "onComplete", "onClick", "afterLoad", "afterLoadData", "afterLoadPreviousDomain", "afterLoadNextDomain"]; - - for (var k in s) { - if (settings.hasOwnProperty(s[k])) { - options[s[k]] = settings[s[k]]; - } - } - - options.subDomainDateFormat = (typeof options.subDomainDateFormat === "string" || typeof options.subDomainDateFormat === "function" ? options.subDomainDateFormat : this._domainType[options.subDomain].format.date); - options.domainLabelFormat = (typeof options.domainLabelFormat === "string" || typeof options.domainLabelFormat === "function" ? options.domainLabelFormat : this._domainType[options.domain].format.legend); - options.subDomainTextFormat = ((typeof options.subDomainTextFormat === "string" && options.subDomainTextFormat !== "") || typeof options.subDomainTextFormat === "function" ? options.subDomainTextFormat : null); - options.domainMargin = expandMarginSetting(options.domainMargin); - options.legendMargin = expandMarginSetting(options.legendMargin); - options.highlight = parent.expandDateSetting(options.highlight); - options.itemName = expandItemName(options.itemName); - options.colLimit = parseColLimit(options.colLimit); - options.rowLimit = parseRowLimit(options.rowLimit); - if (!settings.hasOwnProperty("legendMargin")) { - autoAddLegendMargin(); - } - autoAlignLabel(); - - /** - * Validate that a queryString is valid - * - * @param {Element|string|bool} selector The queryString to test - * @param {bool} canBeFalse Whether false is an accepted and valid value - * @param {string} name Name of the tested selector - * @throws {Error} If the selector is not valid - * @return {bool} True if the selector is a valid queryString - */ - function validateSelector(selector, canBeFalse, name) { - if (((canBeFalse && selector === false) || selector instanceof Element || typeof selector === "string") && selector !== "") { - return true; - } - throw new Error("The " + name + " is not valid"); - } - - /** - * Return the optimal subDomain for the specified domain - * - * @param {string} domain a domain name - * @return {string} the subDomain name - */ - function getOptimalSubDomain(domain) { - switch(domain) { - case "year": - return "month"; - case "month": - return "day"; - case "week": - return "day"; - case "day": - return "hour"; - default: - return "min"; - } - } - - /** - * Ensure that the domain and subdomain are valid - * - * @throw {Error} when domain or subdomain are not valid - * @return {bool} True if domain and subdomain are valid and compatible - */ - function validateDomainType() { - if (!parent._domainType.hasOwnProperty(options.domain) || options.domain === "min" || options.domain.substring(0, 2) === "x_") { - throw new Error("The domain '" + options.domain + "' is not valid"); - } - - if (!parent._domainType.hasOwnProperty(options.subDomain) || options.subDomain === "year") { - throw new Error("The subDomain '" + options.subDomain + "' is not valid"); - } - - if (parent._domainType[options.domain].level <= parent._domainType[options.subDomain].level) { - throw new Error("'" + options.subDomain + "' is not a valid subDomain to '" + options.domain + "'"); - } - - return true; - } - - /** - * Fine-tune the label alignement depending on its position - * - * @return void - */ - function autoAlignLabel() { - // Auto-align label, depending on it's position - if (!settings.hasOwnProperty("label") || (settings.hasOwnProperty("label") && !settings.label.hasOwnProperty("align"))) { - switch(options.label.position) { - case "left": - options.label.align = "right"; - break; - case "right": - options.label.align = "left"; - break; - default: - options.label.align = "center"; - } - - if (options.label.rotate === "left") { - options.label.align = "right"; - } else if (options.label.rotate === "right") { - options.label.align = "left"; - } - } - - if (!settings.hasOwnProperty("label") || (settings.hasOwnProperty("label") && !settings.label.hasOwnProperty("offset"))) { - if (options.label.position === "left" || options.label.position === "right") { - options.label.offset = { - x: 10, - y: 15 - }; - } - } - } - - /** - * If not specified, add some margin around the legend depending on its position - * - * @return void - */ - function autoAddLegendMargin() { - switch(options.legendVerticalPosition) { - case "top": - options.legendMargin[2] = parent.DEFAULT_LEGEND_MARGIN; - break; - case "bottom": - options.legendMargin[0] = parent.DEFAULT_LEGEND_MARGIN; - break; - case "middle": - case "center": - options.legendMargin[options.legendHorizontalPosition === "right" ? 3 : 1] = parent.DEFAULT_LEGEND_MARGIN; - } - } - - /** - * Expand a number of an array of numbers to an usable 4 values array - * - * @param {integer|array} value - * @return {array} array - */ - function expandMarginSetting(value) { - if (typeof value === "number") { - value = [value]; - } - - if (!Array.isArray(value)) { - console.log("Margin only takes an integer or an array of integers"); - value = [0]; - } - - switch(value.length) { - case 1: - return [value[0], value[0], value[0], value[0]]; - case 2: - return [value[0], value[1], value[0], value[1]]; - case 3: - return [value[0], value[1], value[2], value[1]]; - case 4: - return value; - default: - return value.slice(0, 4); - } - } - - /** - * Convert a string to an array like [singular-form, plural-form] - * - * @param {string|array} value Date to convert - * @return {array} An array like [singular-form, plural-form] - */ - function expandItemName(value) { - if (typeof value === "string") { - return [value, value + (value !== "" ? "s" : "")]; - } - - if (Array.isArray(value)) { - if (value.length === 1) { - return [value[0], value[0] + "s"]; - } else if (value.length > 2) { - return value.slice(0, 2); - } - - return value; - } - - return ["item", "items"]; - } - - function parseColLimit(value) { - return value > 0 ? value : null; - } - - function parseRowLimit(value) { - if (value > 0 && options.colLimit > 0) { - console.log("colLimit and rowLimit are mutually exclusive, rowLimit will be ignored"); - return null; - } - return value > 0 ? value : null; - } - - return this._init(); - - }, - - /** - * Convert a keyword or an array of keyword/date to an array of date objects - * - * @param {string|array|Date} value Data to convert - * @return {array} An array of Dates - */ - expandDateSetting: function(value) { - "use strict"; - - if (!Array.isArray(value)) { - value = [value]; - } - - return value.map(function(data) { - if (data === "now") { - return new Date(); - } - if (data instanceof Date) { - return data; - } - return false; - }).filter(function(d) { return d !== false; }); - }, - - /** - * Fill the calendar by coloring the cells - * - * @param array svg An array of html node to apply the transformation to (optional) - * It's used to limit the painting to only a subset of the calendar - * @return void - */ - fill: function(svg) { - "use strict"; - - var parent = this; - var options = parent.options; - - if (arguments.length === 0) { - svg = parent.root.selectAll(".graph-domain"); - } - - var rect = svg - .selectAll("svg").selectAll("g") - .data(function(d) { return parent._domains.get(d); }) - ; - - /** - * Colorize the cell via a style attribute if enabled - */ - function addStyle(element) { - if (parent.legendScale === null) { - return false; - } - - element.attr("fill", function(d) { - if (d.v === 0 && options.legendColors !== null && options.legendColors.hasOwnProperty("empty")) { - return options.legendColors.empty; - } - - if (d.v < 0 && options.legend[0] > 0 && options.legendColors !== null && options.legendColors.hasOwnProperty("overflow")) { - return options.legendColors.overflow; - } - - return parent.legendScale(Math.min(d.v, options.legend[options.legend.length-1])); - }); - } - - rect.transition().duration(options.animationDuration).select("rect") - .attr("class", function(d) { - - var htmlClass = parent.getHighlightClassName(d.t); - - if (parent.legendScale === null) { - htmlClass += " graph-rect"; - } - - if (d.v !== null) { - htmlClass += " " + parent.Legend.getClass(d.v, (parent.legendScale === null)); - } else if (options.considerMissingDataAsZero) { - htmlClass += " " + parent.Legend.getClass(0, (parent.legendScale === null)); - } - - if (options.onClick !== null) { - htmlClass += " hover_cursor"; - } - - return htmlClass; - }) - .call(addStyle) - ; - - rect.transition().duration(options.animationDuration).select("title") - .text(function(d) { return parent.getSubDomainTitle(d); }) - ; - }, - - // =========================================================================// - // EVENTS CALLBACK // - // =========================================================================// - - /** - * Helper method for triggering event callback - * - * @param string eventName Name of the event to trigger - * @param array successArgs List of argument to pass to the callback - * @param boolean skip Whether to skip the event triggering - * @return mixed True when the triggering was skipped, false on error, else the callback function - */ - triggerEvent: function(eventName, successArgs, skip) { - "use strict"; - - if ((arguments.length === 3 && skip) || this.options[eventName] === null) { - return true; - } - - if (typeof this.options[eventName] === "function") { - if (typeof successArgs === "function") { - successArgs = successArgs(); - } - return this.options[eventName].apply(this, successArgs); - } else { - console.log("Provided callback for " + eventName + " is not a function."); - return false; - } - }, - - /** - * Event triggered on a mouse click on a subDomain cell - * - * @param Date d Date of the subdomain block - * @param int itemNb Number of items in that date - */ - onClick: function(d, itemNb) { - "use strict"; - - return this.triggerEvent("onClick", [d, itemNb]); - }, - - /** - * Event triggered after drawing the calendar, byt before filling it with data - */ - afterLoad: function() { - "use strict"; - - return this.triggerEvent("afterLoad"); - }, - - /** - * Event triggered after completing drawing and filling the calendar - */ - onComplete: function() { - "use strict"; - - var response = this.triggerEvent("onComplete", [], this._completed); - this._completed = true; - return response; - }, - - /** - * Event triggered after shifting the calendar one domain back - * - * @param Date start Domain start date - * @param Date end Domain end date - */ - afterLoadPreviousDomain: function(start) { - "use strict"; - - var parent = this; - return this.triggerEvent("afterLoadPreviousDomain", function() { - var subDomain = parent.getSubDomain(start); - return [subDomain.shift(), subDomain.pop()]; - }); - }, - - /** - * Event triggered after shifting the calendar one domain above - * - * @param Date start Domain start date - * @param Date end Domain end date - */ - afterLoadNextDomain: function(start) { - "use strict"; - - var parent = this; - return this.triggerEvent("afterLoadNextDomain", function() { - var subDomain = parent.getSubDomain(start); - return [subDomain.shift(), subDomain.pop()]; - }); - }, - - /** - * Event triggered after loading the leftmost domain allowed by minDate - * - * @param boolean reached True if the leftmost domain was reached - */ - onMinDomainReached: function(reached) { - "use strict"; - - this._minDomainReached = reached; - return this.triggerEvent("onMinDomainReached", [reached]); - }, - - /** - * Event triggered after loading the rightmost domain allowed by maxDate - * - * @param boolean reached True if the rightmost domain was reached - */ - onMaxDomainReached: function(reached) { - "use strict"; - - this._maxDomainReached = reached; - return this.triggerEvent("onMaxDomainReached", [reached]); - }, - - checkIfMinDomainIsReached: function(date, upperBound) { - "use strict"; - - if (this.minDomainIsReached(date)) { - this.onMinDomainReached(true); - } - - if (arguments.length === 2) { - if (this._maxDomainReached && !this.maxDomainIsReached(upperBound)) { - this.onMaxDomainReached(false); - } - } - }, - - checkIfMaxDomainIsReached: function(date, lowerBound) { - "use strict"; - - if (this.maxDomainIsReached(date)) { - this.onMaxDomainReached(true); - } - - if (arguments.length === 2) { - if (this._minDomainReached && !this.minDomainIsReached(lowerBound)) { - this.onMinDomainReached(false); - } - } - }, - - // =========================================================================// - // FORMATTER // - // =========================================================================// - - formatNumber: d3.format(",g"), - - formatDate: function(d, format) { - "use strict"; - - if (arguments.length < 2) { - format = "title"; - } - - if (typeof format === "function") { - return format(d); - } else { - var f = d3.time.format(format); - return f(d); - } - }, - - getSubDomainTitle: function(d) { - "use strict"; - - if (d.v === null && !this.options.considerMissingDataAsZero) { - return (this.options.subDomainTitleFormat.empty).format({ - date: this.formatDate(new Date(d.t), this.options.subDomainDateFormat) - }); - } else { - var value = d.v; - // Consider null as 0 - if (value === null && this.options.considerMissingDataAsZero) { - value = 0; - } - - return (this.options.subDomainTitleFormat.filled).format({ - count: this.formatNumber(value), - name: this.options.itemName[(value !== 1 ? 1: 0)], - connector: this._domainType[this.options.subDomain].format.connector, - date: this.formatDate(new Date(d.t), this.options.subDomainDateFormat) - }); - } - }, - - // =========================================================================// - // DOMAIN NAVIGATION // - // =========================================================================// - - /** - * Shift the calendar one domain forward - * - * The new domain is loaded only if it's not beyond maxDate - * - * @param int n Number of domains to load - * @return bool True if the next domain was loaded, else false - */ - loadNextDomain: function(n) { - "use strict"; - - if (this._maxDomainReached || n === 0) { - return false; - } - - var bound = this.loadNewDomains(this.NAVIGATE_RIGHT, this.getDomain(this.getNextDomain(), n)); - - this.afterLoadNextDomain(bound.end); - this.checkIfMaxDomainIsReached(this.getNextDomain().getTime(), bound.start); - - return true; - }, - - /** - * Shift the calendar one domain backward - * - * The previous domain is loaded only if it's not beyond the minDate - * - * @param int n Number of domains to load - * @return bool True if the previous domain was loaded, else false - */ - loadPreviousDomain: function(n) { - "use strict"; - - if (this._minDomainReached || n === 0) { - return false; - } - - var bound = this.loadNewDomains(this.NAVIGATE_LEFT, this.getDomain(this.getDomainKeys()[0], -n).reverse()); - - this.afterLoadPreviousDomain(bound.start); - this.checkIfMinDomainIsReached(bound.start, bound.end); - - return true; - }, - - loadNewDomains: function(direction, newDomains) { - "use strict"; - - var parent = this; - var backward = direction === this.NAVIGATE_LEFT; - var i = -1; - var total = newDomains.length; - var domains = this.getDomainKeys(); - - function buildSubDomain(d) { - return {t: parent._domainType[parent.options.subDomain].extractUnit(d), v: null}; - } - - // Remove out of bound domains from list of new domains to prepend - while (++i < total) { - if (backward && this.minDomainIsReached(newDomains[i])) { - newDomains = newDomains.slice(0, i+1); - break; - } - if (!backward && this.maxDomainIsReached(newDomains[i])) { - newDomains = newDomains.slice(0, i); - break; - } - } - - newDomains = newDomains.slice(-this.options.range); - - for (i = 0, total = newDomains.length; i < total; i++) { - this._domains.set( - newDomains[i].getTime(), - this.getSubDomain(newDomains[i]).map(buildSubDomain) - ); - - this._domains.remove(backward ? domains.pop() : domains.shift()); - } - - domains = this.getDomainKeys(); - - if (backward) { - newDomains = newDomains.reverse(); - } - - this.paint(direction); - - this.getDatas( - this.options.data, - newDomains[0], - this.getSubDomain(newDomains[newDomains.length-1]).pop(), - function() { - parent.fill(parent.lastInsertedSvg); - } - ); - - return { - start: newDomains[backward ? 0 : 1], - end: domains[domains.length-1] - }; - }, - - /** - * Return whether a date is inside the scope determined by maxDate - * - * @param int datetimestamp The timestamp in ms to test - * @return bool True if the specified date correspond to the calendar upper bound - */ - maxDomainIsReached: function(datetimestamp) { - "use strict"; - - return (this.options.maxDate !== null && (this.options.maxDate.getTime() < datetimestamp)); - }, - - /** - * Return whether a date is inside the scope determined by minDate - * - * @param int datetimestamp The timestamp in ms to test - * @return bool True if the specified date correspond to the calendar lower bound - */ - minDomainIsReached: function (datetimestamp) { - "use strict"; - - return (this.options.minDate !== null && (this.options.minDate.getTime() >= datetimestamp)); - }, - - /** - * Return the list of the calendar's domain timestamp - * - * @return Array a sorted array of timestamp - */ - getDomainKeys: function() { - "use strict"; - - return this._domains.keys() - .map(function(d) { return parseInt(d, 10); }) - .sort(function(a,b) { return a-b; }); - }, - - // =========================================================================// - // POSITIONNING // - // =========================================================================// - - positionSubDomainX: function(d) { - "use strict"; - - var index = this._domainType[this.options.subDomain].position.x(new Date(d)); - return index * this.options.cellSize + index * this.options.cellPadding; - }, - - positionSubDomainY: function(d) { - "use strict"; - - var index = this._domainType[this.options.subDomain].position.y(new Date(d)); - return index * this.options.cellSize + index * this.options.cellPadding; - }, - - getSubDomainColumnNumber: function(d) { - "use strict"; - - if (this.options.rowLimit > 0) { - var i = this._domainType[this.options.subDomain].maxItemNumber; - if (typeof i === "function") { - i = i(d); - } - return Math.ceil(i / this.options.rowLimit); - } - - var j = this._domainType[this.options.subDomain].defaultColumnNumber; - if (typeof j === "function") { - j = j(d); - - } - return this.options.colLimit || j; - }, - - getSubDomainRowNumber: function(d) { - "use strict"; - - if (this.options.colLimit > 0) { - var i = this._domainType[this.options.subDomain].maxItemNumber; - if (typeof i === "function") { - i = i(d); - } - return Math.ceil(i / this.options.colLimit); - } - - var j = this._domainType[this.options.subDomain].defaultRowNumber; - if (typeof j === "function") { - j = j(d); - - } - return this.options.rowLimit || j; - }, - - /** - * Return a classname if the specified date should be highlighted - * - * @param timestamp date Date of the current subDomain - * @return String the highlight class - */ - getHighlightClassName: function(d) { - "use strict"; - - d = new Date(d); - - if (this.options.highlight.length > 0) { - for (var i in this.options.highlight) { - if (this.options.highlight[i] instanceof Date && this.dateIsEqual(this.options.highlight[i], d)) { - return " highlight" + (this.isNow(this.options.highlight[i]) ? " now": ""); - } - } - } - return ""; - }, - - /** - * Return whether the specified date is now, - * according to the type of subdomain - * - * @param Date d The date to compare - * @return bool True if the date correspond to a subdomain cell - */ - isNow: function(d) { - "use strict"; - - return this.dateIsEqual(d, new Date()); - }, - - /** - * Return whether 2 dates are equals - * This function is subdomain-aware, - * and dates comparison are dependent of the subdomain - * - * @param Date dateA First date to compare - * @param Date dateB Secon date to compare - * @return bool true if the 2 dates are equals - */ - /* jshint maxcomplexity: false */ - dateIsEqual: function(dateA, dateB) { - "use strict"; - - switch(this.options.subDomain) { - case "x_min": - case "min": - return dateA.getFullYear() === dateB.getFullYear() && - dateA.getMonth() === dateB.getMonth() && - dateA.getDate() === dateB.getDate() && - dateA.getHours() === dateB.getHours() && - dateA.getMinutes() === dateB.getMinutes(); - case "x_hour": - case "hour": - return dateA.getFullYear() === dateB.getFullYear() && - dateA.getMonth() === dateB.getMonth() && - dateA.getDate() === dateB.getDate() && - dateA.getHours() === dateB.getHours(); - case "x_day": - case "day": - return dateA.getFullYear() === dateB.getFullYear() && - dateA.getMonth() === dateB.getMonth() && - dateA.getDate() === dateB.getDate(); - case "x_week": - case "week": - case "x_month": - case "month": - return dateA.getFullYear() === dateB.getFullYear() && - dateA.getMonth() === dateB.getMonth(); - default: - return false; - } - }, - - // =========================================================================// - // DATE COMPUTATION // - // =========================================================================// - - /** - * Return the day of the year for the date - * @param Date - * @return int Day of the year [1,366] - */ - getDayOfYear: d3.time.format("%j"), - - /** - * Return the week number of the year - * Monday as the first day of the week - * @return int Week number [0-53] - */ - getWeekNumber: function(d) { - "use strict"; - - var f = this.options.weekStartOnMonday === true ? d3.time.format("%W"): d3.time.format("%U"); - return f(d); - }, - - /** - * Return the week number, relative to its month - * - * @param int|Date d Date or timestamp in milliseconds - * @return int Week number, relative to the month [0-5] - */ - getMonthWeekNumber: function (d) { - "use strict"; - - if (typeof d === "number") { - d = new Date(d); - } - - var monthFirstWeekNumber = this.getWeekNumber(new Date(d.getFullYear(), d.getMonth())); - return this.getWeekNumber(d) - monthFirstWeekNumber - 1; - }, - - /** - * Return the number of weeks in the dates' year - * - * @param int|Date d Date or timestamp in milliseconds - * @return int Number of weeks in the date's year - */ - getWeekNumberInYear: function(d) { - "use strict"; - - if (typeof d === "number") { - d = new Date(d); - } - }, - - /** - * Return the number of days in the date's month - * - * @param int|Date d Date or timestamp in milliseconds - * @return int Number of days in the date's month - */ - getDayCountInMonth: function(d) { - "use strict"; - - return this.getEndOfMonth(d).getDate(); - }, - - /** - * Return the number of days in the date's year - * - * @param int|Date d Date or timestamp in milliseconds - * @return int Number of days in the date's year - */ - getDayCountInYear: function(d) { - "use strict"; - - if (typeof d === "number") { - d = new Date(d); - } - return (new Date(d.getFullYear(), 1, 29).getMonth() === 1) ? 366 : 365; - }, - - /** - * Get the weekday from a date - * - * Return the week day number (0-6) of a date, - * depending on whether the week start on monday or sunday - * - * @param Date d - * @return int The week day number (0-6) - */ - getWeekDay: function(d) { - "use strict"; - - if (this.options.weekStartOnMonday === false) { - return d.getDay(); - } - return d.getDay() === 0 ? 6 : (d.getDay()-1); - }, - - /** - * Get the last day of the month - * @param Date|int d Date or timestamp in milliseconds - * @return Date Last day of the month - */ - getEndOfMonth: function(d) { - "use strict"; - - if (typeof d === "number") { - d = new Date(d); - } - return new Date(d.getFullYear(), d.getMonth()+1, 0); - }, - - /** - * - * @param Date date - * @param int count - * @param string step - * @return Date - */ - jumpDate: function(date, count, step) { - "use strict"; - - var d = new Date(date); - switch(step) { - case "hour": - d.setHours(d.getHours() + count); - break; - case "day": - d.setHours(d.getHours() + count * 24); - break; - case "week": - d.setHours(d.getHours() + count * 24 * 7); - break; - case "month": - d.setMonth(d.getMonth() + count); - break; - case "year": - d.setFullYear(d.getFullYear() + count); - } - - return new Date(d); - }, - - // =========================================================================// - // DOMAIN COMPUTATION // - // =========================================================================// - - /** - * Return all the minutes between 2 dates - * - * @param Date d date A date - * @param int|date range Number of minutes in the range, or a stop date - * @return array An array of minutes - */ - getMinuteDomain: function (d, range) { - "use strict"; - - var start = new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours()); - var stop = null; - if (range instanceof Date) { - stop = new Date(range.getFullYear(), range.getMonth(), range.getDate(), range.getHours()); - } else { - stop = new Date(+start + range * 1000 * 60); - } - return d3.time.minutes(Math.min(start, stop), Math.max(start, stop)); - }, - - /** - * Return all the hours between 2 dates - * - * @param Date d A date - * @param int|date range Number of hours in the range, or a stop date - * @return array An array of hours - */ - getHourDomain: function (d, range) { - "use strict"; - - var start = new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours()); - var stop = null; - if (range instanceof Date) { - stop = new Date(range.getFullYear(), range.getMonth(), range.getDate(), range.getHours()); - } else { - stop = new Date(start); - stop.setHours(stop.getHours() + range); - } - - var domains = d3.time.hours(Math.min(start, stop), Math.max(start, stop)); - - // Passing from DST to standard time - // If there are 25 hours, let's compress the duplicate hours - var i = 0; - var total = domains.length; - for(i = 0; i < total; i++) { - if (i > 0 && (domains[i].getHours() === domains[i-1].getHours())) { - this.DSTDomain.push(domains[i].getTime()); - domains.splice(i, 1); - break; - } - } - - // d3.time.hours is returning more hours than needed when changing - // from DST to standard time, because there is really 2 hours between - // 1am and 2am! - if (typeof range === "number" && domains.length > Math.abs(range)) { - domains.splice(domains.length-1, 1); - } - - return domains; - }, - - /** - * Return all the days between 2 dates - * - * @param Date d A date - * @param int|date range Number of days in the range, or a stop date - * @return array An array of weeks - */ - getDayDomain: function (d, range) { - "use strict"; - - var start = new Date(d.getFullYear(), d.getMonth(), d.getDate()); - var stop = null; - if (range instanceof Date) { - stop = new Date(range.getFullYear(), range.getMonth(), range.getDate()); - } else { - stop = new Date(start); - stop = new Date(stop.setDate(stop.getDate() + parseInt(range, 10))); - } - - return d3.time.days(Math.min(start, stop), Math.max(start, stop)); - }, - - /** - * Return all the weeks between 2 dates - * - * @param Date d A date - * @param int|date range Number of minutes in the range, or a stop date - * @return array An array of weeks - */ - getWeekDomain: function (d, range) { - "use strict"; - - var weekStart; - - if (this.options.weekStartOnMonday === false) { - weekStart = new Date(d.getFullYear(), d.getMonth(), d.getDate() - d.getDay()); - } else { - if (d.getDay() === 1) { - weekStart = new Date(d.getFullYear(), d.getMonth(), d.getDate()); - } else if (d.getDay() === 0) { - weekStart = new Date(d.getFullYear(), d.getMonth(), d.getDate()); - weekStart.setDate(weekStart.getDate() - 6); - } else { - weekStart = new Date(d.getFullYear(), d.getMonth(), d.getDate()-d.getDay()+1); - } - } - - var endDate = new Date(weekStart); - - var stop = range; - if (typeof range !== "object") { - stop = new Date(endDate.setDate(endDate.getDate() + range * 7)); - } - - return (this.options.weekStartOnMonday === true) ? - d3.time.mondays(Math.min(weekStart, stop), Math.max(weekStart, stop)): - d3.time.sundays(Math.min(weekStart, stop), Math.max(weekStart, stop)) - ; - }, - - /** - * Return all the months between 2 dates - * - * @param Date d A date - * @param int|date range Number of months in the range, or a stop date - * @return array An array of months - */ - getMonthDomain: function (d, range) { - "use strict"; - - var start = new Date(d.getFullYear(), d.getMonth()); - var stop = null; - if (range instanceof Date) { - stop = new Date(range.getFullYear(), range.getMonth()); - } else { - stop = new Date(start); - stop = stop.setMonth(stop.getMonth()+range); - } - - return d3.time.months(Math.min(start, stop), Math.max(start, stop)); - }, - - /** - * Return all the years between 2 dates - * - * @param Date d date A date - * @param int|date range Number of minutes in the range, or a stop date - * @return array An array of hours - */ - getYearDomain: function(d, range){ - "use strict"; - - var start = new Date(d.getFullYear(), 0); - var stop = null; - if (range instanceof Date) { - stop = new Date(range.getFullYear(), 0); - } else { - stop = new Date(d.getFullYear()+range, 0); - } - - return d3.time.years(Math.min(start, stop), Math.max(start, stop)); - }, - - /** - * Get an array of domain start dates - * - * @param int|Date date A random date included in the wanted domain - * @param int|Date range Number of dates to get, or a stop date - * @return Array of dates - */ - getDomain: function(date, range) { - "use strict"; - - if (typeof date === "number") { - date = new Date(date); - } - - if (arguments.length < 2) { - range = this.options.range; - } - - switch(this.options.domain) { - case "hour" : - var domains = this.getHourDomain(date, range); - - // Case where an hour is missing, when passing from standard time to DST - // Missing hour is perfectly acceptabl in subDomain, but not in domains - if (typeof range === "number" && domains.length < range) { - if (range > 0) { - domains.push(this.getHourDomain(domains[domains.length-1], 2)[1]); - } else { - domains.shift(this.getHourDomain(domains[0], -2)[0]); - } - } - return domains; - case "day" : - return this.getDayDomain(date, range); - case "week" : - return this.getWeekDomain(date, range); - case "month": - return this.getMonthDomain(date, range); - case "year" : - return this.getYearDomain(date, range); - } - }, - - /* jshint maxcomplexity: false */ - getSubDomain: function(date) { - "use strict"; - - if (typeof date === "number") { - date = new Date(date); - } - - var parent = this; - - /** - * @return int - */ - var computeDaySubDomainSize = function(date, domain) { - switch(domain) { - case "year": - return parent.getDayCountInYear(date); - case "month": - return parent.getDayCountInMonth(date); - case "week": - return 7; - } - }; - - /** - * @return int - */ - var computeMinSubDomainSize = function(date, domain) { - switch (domain) { - case "hour": - return 60; - case "day": - return 60 * 24; - case "week": - return 60 * 24 * 7; - } - }; - - /** - * @return int - */ - var computeHourSubDomainSize = function(date, domain) { - switch(domain) { - case "day": - return 24; - case "week": - return 168; - case "month": - return parent.getDayCountInMonth(date) * 24; - } - }; - - /** - * @return int - */ - var computeWeekSubDomainSize = function(date, domain) { - if (domain === "month") { - var endOfMonth = new Date(date.getFullYear(), date.getMonth()+1, 0); - var endWeekNb = parent.getWeekNumber(endOfMonth); - var startWeekNb = parent.getWeekNumber(new Date(date.getFullYear(), date.getMonth())); - - if (startWeekNb > endWeekNb) { - startWeekNb = 0; - endWeekNb++; - } - - return endWeekNb - startWeekNb + 1; - } else if (domain === "year") { - return parent.getWeekNumber(new Date(date.getFullYear(), 11, 31)); - } - }; - - switch(this.options.subDomain) { - case "x_min": - case "min" : - return this.getMinuteDomain(date, computeMinSubDomainSize(date, this.options.domain)); - case "x_hour": - case "hour" : - return this.getHourDomain(date, computeHourSubDomainSize(date, this.options.domain)); - case "x_day": - case "day" : - return this.getDayDomain(date, computeDaySubDomainSize(date, this.options.domain)); - case "x_week": - case "week" : - return this.getWeekDomain(date, computeWeekSubDomainSize(date, this.options.domain)); - case "x_month": - case "month": - return this.getMonthDomain(date, 12); - } - }, - - /** - * Get the n-th next domain after the calendar newest (rightmost) domain - * @param int n - * @return Date The start date of the wanted domain - */ - getNextDomain: function(n) { - "use strict"; - - if (arguments.length === 0) { - n = 1; - } - return this.getDomain(this.jumpDate(this.getDomainKeys().pop(), n, this.options.domain), 1)[0]; - }, - - /** - * Get the n-th domain before the calendar oldest (leftmost) domain - * @param int n - * @return Date The start date of the wanted domain - */ - getPreviousDomain: function(n) { - "use strict"; - - if (arguments.length === 0) { - n = 1; - } - return this.getDomain(this.jumpDate(this.getDomainKeys().shift(), -n, this.options.domain), 1)[0]; - }, - - - // =========================================================================// - // DATAS // - // =========================================================================// - - /** - * Fetch and interpret data from the datasource - * - * @param string|object source - * @param Date startDate - * @param Date endDate - * @param function callback - * @param function|boolean afterLoad function used to convert the data into a json object. Use true to use the afterLoad callback - * @param updateMode - * - * @return mixed - * - True if there are no data to load - * - False if data are loaded asynchronously - */ - getDatas: function(source, startDate, endDate, callback, afterLoad, updateMode) { - "use strict"; - - var self = this; - if (arguments.length < 5) { - afterLoad = true; - } - if (arguments.length < 6) { - updateMode = this.APPEND_ON_UPDATE; - } - var _callback = function(data) { - if (afterLoad !== false) { - if (typeof afterLoad === "function") { - data = afterLoad(data); - } else if (typeof (self.options.afterLoadData) === "function") { - data = self.options.afterLoadData(data); - } else { - console.log("Provided callback for afterLoadData is not a function."); - } - } else if (self.options.dataType === "csv" || self.options.dataType === "tsv") { - data = this.interpretCSV(data); - } - self.parseDatas(data, updateMode, startDate, endDate); - if (typeof callback === "function") { - callback(); - } - }; - - switch(typeof source) { - case "string": - if (source === "") { - _callback({}); - return true; - } else { - switch(this.options.dataType) { - case "json": - d3.json(this.parseURI(source, startDate, endDate), _callback); - break; - case "csv": - d3.csv(this.parseURI(source, startDate, endDate), _callback); - break; - case "tsv": - d3.tsv(this.parseURI(source, startDate, endDate), _callback); - break; - case "txt": - d3.text(this.parseURI(source, startDate, endDate), "text/plain", _callback); - break; - } - } - return false; - case "object": - if (source === Object(source)) { - _callback(source); - return false; - } - /* falls through */ - default: - _callback({}); - return true; - } - }, - - /** - * Populate the calendar internal data - * - * @param object data - * @param constant updateMode - * @param Date startDate - * @param Date endDate - * - * @return void - */ - parseDatas: function(data, updateMode, startDate, endDate) { - "use strict"; - - if (updateMode === this.RESET_ALL_ON_UPDATE) { - this._domains.forEach(function(key, value) { - value.forEach(function(element, index, array) { - array[index].v = null; - }); - }); - } - - var temp = {}; - - var extractTime = function(d) { return d.t; }; - - /*jshint forin:false */ - for (var d in data) { - var date = new Date(d*1000); - var domainUnit = this.getDomain(date)[0].getTime(); - - // The current data belongs to a domain that was compressed - // Compress the data for the two duplicate hours into the same hour - if (this.DSTDomain.indexOf(domainUnit) >= 0) { - - // Re-assign all data to the first or the second duplicate hours - // depending on which is visible - if (this._domains.has(domainUnit - 3600 * 1000)) { - domainUnit -= 3600 * 1000; - } - } - - // Skip if data is not relevant to current domain - if (isNaN(d) || !data.hasOwnProperty(d) || !this._domains.has(domainUnit) || !(domainUnit >= +startDate && domainUnit < +endDate)) { - continue; - } - - var subDomainsData = this._domains.get(domainUnit); - - if (!temp.hasOwnProperty(domainUnit)) { - temp[domainUnit] = subDomainsData.map(extractTime); - } - - var index = temp[domainUnit].indexOf(this._domainType[this.options.subDomain].extractUnit(date)); - - if (updateMode === this.RESET_SINGLE_ON_UPDATE) { - subDomainsData[index].v = data[d]; - } else { - if (!isNaN(subDomainsData[index].v)) { - subDomainsData[index].v += data[d]; - } else { - subDomainsData[index].v = data[d]; - } - } - } - }, - - parseURI: function(str, startDate, endDate) { - "use strict"; - - // Use a timestamp in seconds - str = str.replace(/\{\{t:start\}\}/g, startDate.getTime()/1000); - str = str.replace(/\{\{t:end\}\}/g, endDate.getTime()/1000); - - // Use a string date, following the ISO-8601 - str = str.replace(/\{\{d:start\}\}/g, startDate.toISOString()); - str = str.replace(/\{\{d:end\}\}/g, endDate.toISOString()); - - return str; - }, - - interpretCSV: function(data) { - "use strict"; - - var d = {}; - var keys = Object.keys(data[0]); - var i, total; - for (i = 0, total = data.length; i < total; i++) { - d[data[i][keys[0]]] = +data[i][keys[1]]; - } - return d; - }, - - /** - * Handle the calendar layout and dimension - * - * Expand and shrink the container depending on its children dimension - * Also rearrange the children position depending on their dimension, - * and the legend position - * - * @return void - */ - resize: function() { - "use strict"; - - var parent = this; - var options = parent.options; - var legendWidth = options.displayLegend ? (parent.Legend.getDim("width") + options.legendMargin[1] + options.legendMargin[3]) : 0; - var legendHeight = options.displayLegend ? (parent.Legend.getDim("height") + options.legendMargin[0] + options.legendMargin[2]) : 0; - - var graphWidth = parent.graphDim.width - options.domainGutter - options.cellPadding; - var graphHeight = parent.graphDim.height - options.domainGutter - options.cellPadding; - - this.root.transition().duration(options.animationDuration) - .attr("width", function() { - if (options.legendVerticalPosition === "middle" || options.legendVerticalPosition === "center") { - return graphWidth + legendWidth; - } - return Math.max(graphWidth, legendWidth); - }) - .attr("height", function() { - if (options.legendVerticalPosition === "middle" || options.legendVerticalPosition === "center") { - return Math.max(graphHeight, legendHeight); - } - return graphHeight + legendHeight; - }) - ; - - this.root.select(".graph").transition().duration(options.animationDuration) - .attr("y", function() { - if (options.legendVerticalPosition === "top") { - return legendHeight; - } - return 0; - }) - .attr("x", function() { - if ( - (options.legendVerticalPosition === "middle" || options.legendVerticalPosition === "center") && - options.legendHorizontalPosition === "left") { - return legendWidth; - } - return 0; - - }) - ; - }, - - // =========================================================================// - // PUBLIC API // - // =========================================================================// - - /** - * Shift the calendar forward - */ - next: function(n) { - "use strict"; - - if (arguments.length === 0) { - n = 1; - } - return this.loadNextDomain(n); - }, - - /** - * Shift the calendar backward - */ - previous: function(n) { - "use strict"; - - if (arguments.length === 0) { - n = 1; - } - return this.loadPreviousDomain(n); - }, - - /** - * Jump directly to a specific date - * - * JumpTo will scroll the calendar until the wanted domain with the specified - * date is visible. Unless you set reset to true, the wanted domain - * will not necessarily be the first (leftmost) domain of the calendar. - * - * @param Date date Jump to the domain containing that date - * @param bool reset Whether the wanted domain should be the first domain of the calendar - * @param bool True of the calendar was scrolled - */ - jumpTo: function(date, reset) { - "use strict"; - - if (arguments.length < 2) { - reset = false; - } - var domains = this.getDomainKeys(); - var firstDomain = domains[0]; - var lastDomain = domains[domains.length-1]; - - if (date < firstDomain) { - return this.loadPreviousDomain(this.getDomain(firstDomain, date).length); - } else { - if (reset) { - return this.loadNextDomain(this.getDomain(firstDomain, date).length); - } - - if (date > lastDomain) { - return this.loadNextDomain(this.getDomain(lastDomain, date).length); - } - } - - return false; - }, - - /** - * Navigate back to the start date - * - * @since 3.3.8 - * @return void - */ - rewind: function() { - "use strict"; - - this.jumpTo(this.options.start, true); - }, - - /** - * Update the calendar with new data - * - * @param object|string dataSource The calendar's datasource, same type as this.options.data - * @param boolean|function afterLoad Whether to execute afterLoad() on the data. Pass directly a function - * if you don't want to use the afterLoad() callback - */ - update: function(dataSource, afterLoad, updateMode) { - "use strict"; - - if (arguments.length < 2) { - afterLoad = true; - } - if (arguments.length < 3) { - updateMode = this.RESET_ALL_ON_UPDATE; - } - - var domains = this.getDomainKeys(); - var self = this; - this.getDatas( - dataSource, - new Date(domains[0]), - this.getSubDomain(domains[domains.length-1]).pop(), - function() { - self.fill(); - }, - afterLoad, - updateMode - ); - }, - - /** - * Set the legend - * - * @param array legend an array of integer, representing the different threshold value - * @param array colorRange an array of 2 hex colors, for the minimum and maximum colors - */ - setLegend: function() { - "use strict"; - - var oldLegend = this.options.legend.slice(0); - if (arguments.length >= 1 && Array.isArray(arguments[0])) { - this.options.legend = arguments[0]; - } - if (arguments.length >= 2) { - if (Array.isArray(arguments[1]) && arguments[1].length >= 2) { - this.options.legendColors = [arguments[1][0], arguments[1][1]]; - } else { - this.options.legendColors = arguments[1]; - } - } - - if ((arguments.length > 0 && !arrayEquals(oldLegend, this.options.legend)) || arguments.length >= 2) { - this.Legend.buildColors(); - this.fill(); - } - - this.Legend.redraw(this.graphDim.width - this.options.domainGutter - this.options.cellPadding); - }, - - /** - * Remove the legend - * - * @return bool False if there is no legend to remove - */ - removeLegend: function() { - "use strict"; - - if (!this.options.displayLegend) { - return false; - } - this.options.displayLegend = false; - this.Legend.remove(); - return true; - }, - - /** - * Display the legend - * - * @return bool False if the legend was already displayed - */ - showLegend: function() { - "use strict"; - - if (this.options.displayLegend) { - return false; - } - this.options.displayLegend = true; - this.Legend.redraw(this.graphDim.width - this.options.domainGutter - this.options.cellPadding); - return true; - }, - - /** - * Highlight dates - * - * Add a highlight class to a set of dates - * - * @since 3.3.5 - * @param array Array of dates to highlight - * @return bool True if dates were highlighted - */ - highlight: function(args) { - "use strict"; - - if ((this.options.highlight = this.expandDateSetting(args)).length > 0) { - this.fill(); - return true; - } - return false; - }, - - /** - * Destroy the calendar - * - * Usage: cal = cal.destroy(); - * - * @since 3.3.6 - * @param function A callback function to trigger after destroying the calendar - * @return null - */ - destroy: function(callback) { - "use strict"; - - this.root.transition().duration(this.options.animationDuration) - .attr("width", 0) - .attr("height", 0) - .remove() - .each("end", function() { - if (typeof callback === "function") { - callback(); - } else if (arguments.length > 0) { - console.log("Provided callback for destroy() is not a function."); - } - }) - ; - - return null; - }, - - getSVG: function() { - "use strict"; - - var styles = { - ".cal-heatmap-container": {}, - ".graph": {}, - ".graph-rect": {}, - "rect.highlight": {}, - "rect.now": {}, - "text.highlight": {}, - "text.now": {}, - ".domain-background": {}, - ".graph-label": {}, - ".subdomain-text": {}, - ".q0": {}, - ".qi": {} - }; - - for (var j = 1, total = this.options.legend.length+1; j <= total; j++) { - styles[".q" + j] = {}; - } - - var root = this.root; - - var whitelistStyles = [ - // SVG specific properties - "stroke", "stroke-width", "stroke-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-miterlimit", - "fill", "fill-opacity", "fill-rule", - "marker", "marker-start", "marker-mid", "marker-end", - "alignement-baseline", "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", "glyph-orientation-vertical", "kerning", "text-anchor", - "shape-rendering", - - // Text Specific properties - "text-transform", "font-family", "font", "font-size", "font-weight" - ]; - - var filterStyles = function(attribute, property, value) { - if (whitelistStyles.indexOf(property) !== -1) { - styles[attribute][property] = value; - } - }; - - var getElement = function(e) { - return root.select(e)[0][0]; - }; - - /* jshint forin:false */ - for (var element in styles) { - if (!styles.hasOwnProperty(element)) { - continue; - } - - var dom = getElement(element); - - if (dom === null) { - continue; - } - - // The DOM Level 2 CSS way - /* jshint maxdepth: false */ - if ("getComputedStyle" in window) { - var cs = getComputedStyle(dom, null); - if (cs.length !== 0) { - for (var i = 0; i < cs.length; i++) { - filterStyles(element, cs.item(i), cs.getPropertyValue(cs.item(i))); - } - - // Opera workaround. Opera doesn"t support `item`/`length` - // on CSSStyleDeclaration. - } else { - for (var k in cs) { - if (cs.hasOwnProperty(k)) { - filterStyles(element, k, cs[k]); - } - } - } - - // The IE way - } else if ("currentStyle" in dom) { - var css = dom.currentStyle; - for (var p in css) { - filterStyles(element, p, css[p]); - } - } - } - - var string = ""; - string += new XMLSerializer().serializeToString(this.root[0][0]); - string += ""; - - return string; - } -}; - -// =========================================================================// -// DOMAIN POSITION COMPUTATION // -// =========================================================================// - -/** - * Compute the position of a domain, relative to the calendar - */ -var DomainPosition = function() { - "use strict"; - - this.positions = d3.map(); -}; - -DomainPosition.prototype.getPosition = function(d) { - "use strict"; - - return this.positions.get(d); -}; - -DomainPosition.prototype.getPositionFromIndex = function(i) { - "use strict"; - - var domains = this.getKeys(); - return this.positions.get(domains[i]); -}; - -DomainPosition.prototype.getLast = function() { - "use strict"; - - var domains = this.getKeys(); - return this.positions.get(domains[domains.length-1]); -}; - -DomainPosition.prototype.setPosition = function(d, dim) { - "use strict"; - - this.positions.set(d, dim); -}; - -DomainPosition.prototype.shiftRightBy = function(exitingDomainDim) { - "use strict"; - - this.positions.forEach(function(key, value) { - this.set(key, value - exitingDomainDim); - }); - - var domains = this.getKeys(); - this.positions.remove(domains[0]); -}; - -DomainPosition.prototype.shiftLeftBy = function(enteringDomainDim) { - "use strict"; - - this.positions.forEach(function(key, value) { - this.set(key, value + enteringDomainDim); - }); - - var domains = this.getKeys(); - this.positions.remove(domains[domains.length-1]); -}; - -DomainPosition.prototype.getKeys = function() { - "use strict"; - - return this.positions.keys().sort(function(a, b) { - return parseInt(a, 10) - parseInt(b, 10); - }); -}; - -// =========================================================================// -// LEGEND // -// =========================================================================// - -var Legend = function(calendar) { - "use strict"; - - this.calendar = calendar; - this.computeDim(); - - if (calendar.options.legendColors !== null) { - this.buildColors(); - } -}; - -Legend.prototype.computeDim = function() { - "use strict"; - - var options = this.calendar.options; // Shorter accessor for variable name mangling when minifying - this.dim = { - width: - options.legendCellSize * (options.legend.length+1) + - options.legendCellPadding * (options.legend.length), - height: - options.legendCellSize - }; -}; - -Legend.prototype.remove = function() { - "use strict"; - - this.calendar.root.select(".graph-legend").remove(); - this.calendar.resize(); -}; - -Legend.prototype.redraw = function(width) { - "use strict"; - - if (!this.calendar.options.displayLegend) { - return false; - } - - var parent = this; - var calendar = this.calendar; - var legend = calendar.root; - var legendItem; - var options = calendar.options; // Shorter accessor for variable name mangling when minifying - - this.computeDim(); - - var _legend = options.legend.slice(0); - _legend.push(_legend[_legend.length-1]+1); - - var legendElement = calendar.root.select(".graph-legend"); - if (legendElement[0][0] !== null) { - legend = legendElement; - legendItem = legend - .select("g") - .selectAll("rect").data(_legend) - ; - } else { - // Creating the new legend DOM if it doesn't already exist - legend = options.legendVerticalPosition === "top" ? legend.insert("svg", ".graph") : legend.append("svg"); - - legend - .attr("x", getLegendXPosition()) - .attr("y", getLegendYPosition()) - ; - - legendItem = legend - .attr("class", "graph-legend") - .attr("height", parent.getDim("height")) - .attr("width", parent.getDim("width")) - .append("g") - .selectAll().data(_legend) - ; - } - - legendItem - .enter() - .append("rect") - .call(legendCellLayout) - .attr("class", function(d){ return calendar.Legend.getClass(d, (calendar.legendScale === null)); }) - .attr("fill-opacity", 0) - .call(function(selection) { - if (calendar.legendScale !== null && options.legendColors !== null && options.legendColors.hasOwnProperty("base")) { - selection.attr("fill", options.legendColors.base); - } - }) - .append("title") - ; - - legendItem.exit().transition().duration(options.animationDuration) - .attr("fill-opacity", 0) - .remove(); - - legendItem.transition().delay(function(d, i) { return options.animationDuration * i/10; }) - .call(legendCellLayout) - .attr("fill-opacity", 1) - .call(function(element) { - element.attr("fill", function(d, i) { - if (calendar.legendScale === null) { - return ""; - } - - if (i === 0) { - return calendar.legendScale(d - 1); - } - return calendar.legendScale(options.legend[i-1]); - }); - - element.attr("class", function(d) { return calendar.Legend.getClass(d, (calendar.legendScale === null)); }); - }) - ; - - function legendCellLayout(selection) { - selection - .attr("width", options.legendCellSize) - .attr("height", options.legendCellSize) - .attr("x", function(d, i) { - return i * (options.legendCellSize + options.legendCellPadding); - }) - ; - } - - legendItem.select("title").text(function(d, i) { - if (i === 0) { - return (options.legendTitleFormat.lower).format({ - min: options.legend[i], - name: options.itemName[1] - }); - } else if (i === _legend.length-1) { - return (options.legendTitleFormat.upper).format({ - max: options.legend[i-1], - name: options.itemName[1] - }); - } else { - return (options.legendTitleFormat.inner).format({ - down: options.legend[i-1], - up: options.legend[i], - name: options.itemName[1] - }); - } - }) - ; - - legend.transition().duration(options.animationDuration) - .attr("x", getLegendXPosition()) - .attr("y", getLegendYPosition()) - .attr("width", parent.getDim("width")) - .attr("height", parent.getDim("height")) - ; - - legend.select("g").transition().duration(options.animationDuration) - .attr("transform", function() { - if (options.legendOrientation === "vertical") { - return "rotate(90 " + options.legendCellSize/2 + " " + options.legendCellSize/2 + ")"; - } - return ""; - }) - ; - - function getLegendXPosition() { - switch(options.legendHorizontalPosition) { - case "right": - if (options.legendVerticalPosition === "center" || options.legendVerticalPosition === "middle") { - return width + options.legendMargin[3]; - } - return width - parent.getDim("width") - options.legendMargin[1]; - case "middle": - case "center": - return Math.round(width/2 - parent.getDim("width")/2); - default: - return options.legendMargin[3]; - } - } - - function getLegendYPosition() { - if (options.legendVerticalPosition === "bottom") { - return calendar.graphDim.height + options.legendMargin[0] - options.domainGutter - options.cellPadding; - } - return options.legendMargin[0]; - } - - calendar.resize(); -}; - -/** - * Return the dimension of the legend - * - * Takes into account rotation - * - * @param string axis Width or height - * @return int height or width in pixels - */ -Legend.prototype.getDim = function(axis) { - "use strict"; - - var isHorizontal = (this.calendar.options.legendOrientation === "horizontal"); - - switch(axis) { - case "width": - return this.dim[isHorizontal ? "width": "height"]; - case "height": - return this.dim[isHorizontal ? "height": "width"]; - } -}; - -Legend.prototype.buildColors = function() { - "use strict"; - - var options = this.calendar.options; // Shorter accessor for variable name mangling when minifying - - if (options.legendColors === null) { - this.calendar.legendScale = null; - return false; - } - - var _colorRange = []; - - if (Array.isArray(options.legendColors)) { - _colorRange = options.legendColors; - } else if (options.legendColors.hasOwnProperty("min") && options.legendColors.hasOwnProperty("max")) { - _colorRange = [options.legendColors.min, options.legendColors.max]; - } else { - options.legendColors = null; - return false; - } - - var _legend = options.legend.slice(0); - - if (_legend[0] > 0) { - _legend.unshift(0); - } else if (_legend[0] < 0) { - // Let's guess the leftmost value, it we have to add one - _legend.unshift(_legend[0] - (_legend[_legend.length-1] - _legend[0])/_legend.length); - } - - var colorScale = d3.scale.linear() - .range(_colorRange) - .interpolate(d3.interpolateHcl) - .domain([d3.min(_legend), d3.max(_legend)]) - ; - - var legendColors = _legend.map(function(element) { return colorScale(element); }); - this.calendar.legendScale = d3.scale.threshold().domain(options.legend).range(legendColors); - - return true; -}; - -/** - * Return the classname on the legend for the specified value - * - * @param integer n Value associated to a date - * @param bool withCssClass Whether to display the css class used to style the cell. - * Disabling will allow styling directly via html fill attribute - * - * @return string Classname according to the legend - */ -Legend.prototype.getClass = function(n, withCssClass) { - "use strict"; - - if (n === null || isNaN(n)) { - return ""; - } - - var index = [this.calendar.options.legend.length + 1]; - - for (var i = 0, total = this.calendar.options.legend.length-1; i <= total; i++) { - - if (this.calendar.options.legend[0] > 0 && n < 0) { - index = ["1", "i"]; - break; - } - - if (n <= this.calendar.options.legend[i]) { - index = [i+1]; - break; - } - } - - if (n === 0) { - index.push(0); - } - - index.unshift(""); - return (index.join(" r") + (withCssClass ? index.join(" q"): "")).trim(); -}; - -/** - * Sprintf like function - * @source http://stackoverflow.com/a/4795914/805649 - * @return String - */ -String.prototype.format = function () { - "use strict"; - - var formatted = this; - for (var prop in arguments[0]) { - if (arguments[0].hasOwnProperty(prop)) { - var regexp = new RegExp("\\{" + prop + "\\}", "gi"); - formatted = formatted.replace(regexp, arguments[0][prop]); - } - } - return formatted; -}; - -/** - * #source http://stackoverflow.com/a/383245/805649 - */ -function mergeRecursive(obj1, obj2) { - "use strict"; - - /*jshint forin:false */ - for (var p in obj2) { - try { - // Property in destination object set; update its value. - if (obj2[p].constructor === Object) { - obj1[p] = mergeRecursive(obj1[p], obj2[p]); - } else { - obj1[p] = obj2[p]; - } - } catch(e) { - // Property in destination object not set; create it and set its value. - obj1[p] = obj2[p]; - } - } - - return obj1; -} - -/** - * Check if 2 arrays are equals - * - * @link http://stackoverflow.com/a/14853974/805649 - * @param array array the array to compare to - * @return bool true of the 2 arrays are equals - */ -function arrayEquals(arrayA, arrayB) { - "use strict"; - - // if the other array is a falsy value, return - if (!arrayB || !arrayA) { - return false; - } - - // compare lengths - can save a lot of time - if (arrayA.length !== arrayB.length) { - return false; - } - - for (var i = 0; i < arrayA.length; i++) { - // Check if we have nested arrays - if (arrayA[i] instanceof Array && arrayB[i] instanceof Array) { - // recurse into the nested arrays - if (!arrayEquals(arrayA[i], arrayB[i])) { - return false; - } - } - else if (arrayA[i] !== arrayB[i]) { - // Warning - two different object instances will never be equal: {x:20} != {x:20} - return false; - } - } - return true; -} - -/** - * AMD Loader - */ -if (typeof define === "function" && define.amd) { - define(["d3"], function() { - "use strict"; - - return CalHeatMap; - }); -} diff --git a/pagure/static/cal-heatmap/cal-heatmap.3.3.10.min.js b/pagure/static/cal-heatmap/cal-heatmap.3.3.10.min.js deleted file mode 100644 index 1828163..0000000 --- a/pagure/static/cal-heatmap/cal-heatmap.3.3.10.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! cal-heatmap v3.3.10 (Tue Dec 03 2013 19:30:23) - * --------------------------------------------- - * Cal-Heatmap is a javascript module to create calendar heatmap to visualize time series data - * https://github.com/kamisama/cal-heatmap - * Licensed under the MIT license - * Copyright 2013 Wan Qi Chen - */ -function mergeRecursive(t,e){"use strict";for(var n in e)try{t[n]=e[n].constructor===Object?mergeRecursive(t[n],e[n]):e[n]}catch(i){t[n]=e[n]}return t}function arrayEquals(t,e){"use strict";if(!e||!t)return!1;if(t.length!==e.length)return!1;for(var n=0;t.length>n;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!arrayEquals(t[n],e[n]))return!1}else if(t[n]!==e[n])return!1;return!0}var CalHeatMap=function(){"use strict";function t(){i.verticalDomainLabel="top"===i.options.label.position||"bottom"===i.options.label.position,i.domainVerticalLabelHeight=null===i.options.label.height?Math.max(25,2*i.options.cellSize):i.options.label.height,i.domainHorizontalLabelWidth=0,""===i.options.domainLabelFormat&&null===i.options.label.height&&(i.domainVerticalLabelHeight=0),i.verticalDomainLabel||(i.domainVerticalLabelHeight=0,i.domainHorizontalLabelWidth=i.options.label.width),i.paint(),i.options.nextSelector!==!1&&d3.select(i.options.nextSelector).on("click."+i.options.itemNamespace,function(){return d3.event.preventDefault(),i.loadNextDomain(1)}),i.options.previousSelector!==!1&&d3.select(i.options.previousSelector).on("click."+i.options.itemNamespace,function(){return d3.event.preventDefault(),i.loadPreviousDomain(1)}),i.Legend.redraw(i.graphDim.width-i.options.domainGutter-i.options.cellPadding),i.afterLoad();var t=i.getDomainKeys();i.options.loadOnInit?i.getDatas(i.options.data,new Date(t[0]),i.getSubDomain(t[t.length-1]).pop(),function(){i.fill(),i.onComplete()}):i.onComplete(),i.checkIfMinDomainIsReached(t[0]),i.checkIfMaxDomainIsReached(i.getNextDomain().getTime())}function e(t,e){var n=i.options.cellSize*i._domainType[i.options.subDomain].column(t)+i.options.cellPadding*i._domainType[i.options.subDomain].column(t);return 2===arguments.length&&e===!0?n+=i.domainHorizontalLabelWidth+i.options.domainGutter+i.options.domainMargin[1]+i.options.domainMargin[3]:n}function n(t,e){var n=i.options.cellSize*i._domainType[i.options.subDomain].row(t)+i.options.cellPadding*i._domainType[i.options.subDomain].row(t);return 2===arguments.length&&e===!0&&(n+=i.options.domainGutter+i.domainVerticalLabelHeight+i.options.domainMargin[0]+i.options.domainMargin[2]),n}var i=this;this.allowedDataType=["json","csv","tsv","txt"],this.options={itemSelector:"#cal-heatmap",paintOnLoad:!0,range:12,cellSize:10,cellPadding:2,cellRadius:0,domainGutter:2,domainMargin:[0,0,0,0],domain:"hour",subDomain:"min",colLimit:null,rowLimit:null,weekStartOnMonday:!0,start:new Date,minDate:null,maxDate:null,data:"",dataType:this.allowedDataType[0],considerMissingDataAsZero:!1,loadOnInit:!0,verticalOrientation:!1,domainDynamicDimension:!0,label:{position:"bottom",align:"center",offset:{x:0,y:0},rotate:null,width:100,height:null},legend:[10,20,30,40],displayLegend:!0,legendCellSize:10,legendCellPadding:2,legendMargin:[0,0,0,0],legendVerticalPosition:"bottom",legendHorizontalPosition:"left",legendOrientation:"horizontal",legendColors:null,highlight:[],itemName:["item","items"],domainLabelFormat:null,subDomainTitleFormat:{empty:"{date}",filled:"{count} {name} {connector} {date}"},subDomainDateFormat:null,subDomainTextFormat:null,legendTitleFormat:{lower:"less than {min} {name}",inner:"between {down} and {up} {name}",upper:"more than {max} {name}"},animationDuration:500,nextSelector:!1,previousSelector:!1,itemNamespace:"cal-heatmap",tooltip:!1,onClick:null,afterLoad:null,afterLoadNextDomain:null,afterLoadPreviousDomain:null,onComplete:null,afterLoadData:function(t){return t},onMaxDomainReached:null,onMinDomainReached:null},this._domainType={min:{name:"minute",level:10,maxItemNumber:60,defaultRowNumber:10,defaultColumnNumber:6,row:function(t){return i.getSubDomainRowNumber(t)},column:function(t){return i.getSubDomainColumnNumber(t)},position:{x:function(t){return Math.floor(t.getMinutes()/i._domainType.min.row(t))},y:function(t){return t.getMinutes()%i._domainType.min.row(t)}},format:{date:"%H:%M, %A %B %-e, %Y",legend:"",connector:"at"},extractUnit:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes()).getTime()}},hour:{name:"hour",level:20,maxItemNumber:function(t){switch(i.options.domain){case"day":return 24;case"week":return 168;case"month":return 24*(i.options.domainDynamicDimension?i.getDayCountInMonth(t):31)}},defaultRowNumber:6,defaultColumnNumber:function(t){switch(i.options.domain){case"day":return 4;case"week":return 28;case"month":return i.options.domainDynamicDimension?i.getDayCountInMonth(t):31}},row:function(t){return i.getSubDomainRowNumber(t)},column:function(t){return i.getSubDomainColumnNumber(t)},position:{x:function(t){return"month"===i.options.domain?i.options.colLimit>0||i.options.rowLimit>0?Math.floor((t.getHours()+24*(t.getDate()-1))/i._domainType.hour.row(t)):Math.floor(t.getHours()/i._domainType.hour.row(t))+4*(t.getDate()-1):"week"===i.options.domain?i.options.colLimit>0||i.options.rowLimit>0?Math.floor((t.getHours()+24*i.getWeekDay(t))/i._domainType.hour.row(t)):Math.floor(t.getHours()/i._domainType.hour.row(t))+4*i.getWeekDay(t):Math.floor(t.getHours()/i._domainType.hour.row(t))},y:function(t){var e=t.getHours();if(i.options.colLimit>0||i.options.rowLimit>0)switch(i.options.domain){case"month":e+=24*(t.getDate()-1);break;case"week":e+=24*i.getWeekDay(t)}return Math.floor(e%i._domainType.hour.row(t))}},format:{date:"%Hh, %A %B %-e, %Y",legend:"%H:00",connector:"at"},extractUnit:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours()).getTime()}},day:{name:"day",level:30,maxItemNumber:function(t){switch(i.options.domain){case"week":return 7;case"month":return i.options.domainDynamicDimension?i.getDayCountInMonth(t):31;case"year":return i.options.domainDynamicDimension?i.getDayCountInYear(t):366}},defaultColumnNumber:function(t){switch(t=new Date(t),i.options.domain){case"week":return 1;case"month":return i.options.domainDynamicDimension&&!i.options.verticalOrientation?i.getWeekNumber(new Date(t.getFullYear(),t.getMonth()+1,0))-i.getWeekNumber(t)+1:6;case"year":return i.options.domainDynamicDimension?i.getWeekNumber(new Date(t.getFullYear(),11,31))-i.getWeekNumber(new Date(t.getFullYear(),0))+1:54}},defaultRowNumber:7,row:function(t){return i.getSubDomainRowNumber(t)},column:function(t){return i.getSubDomainColumnNumber(t)},position:{x:function(t){switch(i.options.domain){case"week":return Math.floor(i.getWeekDay(t)/i._domainType.day.row(t));case"month":return i.options.colLimit>0||i.options.rowLimit>0?Math.floor((t.getDate()-1)/i._domainType.day.row(t)):i.getWeekNumber(t)-i.getWeekNumber(new Date(t.getFullYear(),t.getMonth()));case"year":return i.options.colLimit>0||i.options.rowLimit>0?Math.floor((i.getDayOfYear(t)-1)/i._domainType.day.row(t)):i.getWeekNumber(t)}},y:function(t){var e=i.getWeekDay(t);if(i.options.colLimit>0||i.options.rowLimit>0)switch(i.options.domain){case"year":e=i.getDayOfYear(t)-1;break;case"week":e=i.getWeekDay(t);break;case"month":e=t.getDate()-1}return Math.floor(e%i._domainType.day.row(t))}},format:{date:"%A %B %-e, %Y",legend:"%e %b",connector:"on"},extractUnit:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}},week:{name:"week",level:40,maxItemNumber:54,defaultColumnNumber:function(t){switch(t=new Date(t),i.options.domain){case"year":return i._domainType.week.maxItemNumber;case"month":return i.getWeekNumber(new Date(t.getFullYear(),t.getMonth()+1,0))-i.getWeekNumber(t)}},defaultRowNumber:1,row:function(t){return i.getSubDomainRowNumber(t)},column:function(t){return i.getSubDomainColumnNumber(t)},position:{x:function(t){switch(i.options.domain){case"year":return Math.floor(i.getWeekNumber(t)/i._domainType.week.row(t));case"month":return Math.floor(i.getMonthWeekNumber(t)/i._domainType.week.row(t))}},y:function(t){return i.getWeekNumber(t)%i._domainType.week.row(t)}},format:{date:"%B Week #%W",legend:"%B Week #%W",connector:"on"},extractUnit:function(t){var e=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=e.getDay()-1;return 0>n&&(n=6),e.setDate(e.getDate()-n),e.getTime()}},month:{name:"month",level:50,maxItemNumber:12,defaultColumnNumber:12,defaultRowNumber:1,row:function(){return i.getSubDomainRowNumber()},column:function(){return i.getSubDomainColumnNumber()},position:{x:function(t){return Math.floor(t.getMonth()/i._domainType.month.row(t))},y:function(t){return t.getMonth()%i._domainType.month.row(t)}},format:{date:"%B %Y",legend:"%B",connector:"on"},extractUnit:function(t){return new Date(t.getFullYear(),t.getMonth()).getTime()}},year:{name:"year",level:60,row:function(){return i.options.rowLimit||1},column:function(){return i.options.colLimit||1},position:{x:function(){return 1},y:function(){return 1}},format:{date:"%Y",legend:"%Y",connector:"on"},extractUnit:function(t){return new Date(t.getFullYear()).getTime()}}};for(var o in this._domainType)if(this._domainType.hasOwnProperty(o)){var a=this._domainType[o];this._domainType["x_"+o]={name:"x_"+o,level:a.type,maxItemNumber:a.maxItemNumber,defaultRowNumber:a.defaultRowNumber,defaultColumnNumber:a.defaultColumnNumber,row:a.column,column:a.row,position:{x:a.position.y,y:a.position.x},format:a.format,extractUnit:a.extractUnit}}this.lastInsertedSvg=null,this._completed=!1,this._domains=d3.map(),this.graphDim={width:0,height:0},this.legendDim={width:0,height:0},this.NAVIGATE_LEFT=1,this.NAVIGATE_RIGHT=2,this.RESET_ALL_ON_UPDATE=0,this.RESET_SINGLE_ON_UPDATE=1,this.APPEND_ON_UPDATE=2,this.DEFAULT_LEGEND_MARGIN=10,this.root=null,this.tooltip=null,this._maxDomainReached=!1,this._minDomainReached=!1,this.domainPosition=new DomainPosition,this.Legend=null,this.legendScale=null,this.DSTDomain=[],this._init=function(){return i.getDomain(i.options.start).map(function(t){return t.getTime()}).map(function(t){i._domains.set(t,i.getSubDomain(t).map(function(t){return{t:i._domainType[i.options.subDomain].extractUnit(t),v:null}}))}),i.root=d3.select(i.options.itemSelector).append("svg").attr("class","cal-heatmap-container"),i.tooltip=d3.select(i.options.itemSelector).attr("style",function(){var t=d3.select(i.options.itemSelector).attr("style");return(null!==t?t:"")+"position:relative;"}).append("div").attr("class","ch-tooltip"),i.root.attr("x",0).attr("y",0).append("svg").attr("class","graph"),i.Legend=new Legend(i),i.options.paintOnLoad&&t(),!0},this.paint=function(t){function o(e,n,o,a){var r=0;switch(t){case!1:return r=n[o],n[o]+=a,i.domainPosition.setPosition(e,r),r;case i.NAVIGATE_RIGHT:return i.domainPosition.setPosition(e,n[o]),l=a,u=i.domainPosition.getPositionFromIndex(1),i.domainPosition.shiftRightBy(u),n[o];case i.NAVIGATE_LEFT:return r=-a,l=-r,u=n[o]-i.domainPosition.getLast(),i.domainPosition.setPosition(e,r),i.domainPosition.shiftLeftBy(l),r}}function a(t){switch(r.label.rotate){case"right":t.attr("transform",function(t){var n="rotate(90), ";switch(r.label.position){case"right":n+="translate(-"+e(t)+" , -"+e(t)+")";break;case"left":n+="translate(0, -"+i.domainHorizontalLabelWidth+")"}return n});break;case"left":t.attr("transform",function(t){var n="rotate(270), ";switch(r.label.position){case"right":n+="translate(-"+(e(t)+i.domainHorizontalLabelWidth)+" , "+e(t)+")";break;case"left":n+="translate(-"+i.domainHorizontalLabelWidth+" , "+i.domainHorizontalLabelWidth+")"}return n})}}var r=i.options;0===arguments.length&&(t=!1);var s=i.root.select(".graph").selectAll(".graph-domain").data(function(){var e=i.getDomainKeys();return t===i.NAVIGATE_LEFT?e.reverse():e},function(t){return t}),l=0,u=0,m=s.enter().append("svg").attr("width",function(t){return e(t,!0)}).attr("height",function(t){return n(t,!0)}).attr("x",function(t){return r.verticalOrientation?(i.graphDim.width=Math.max(i.graphDim.width,e(t,!0)),0):o(t,i.graphDim,"width",e(t,!0))}).attr("y",function(t){return r.verticalOrientation?o(t,i.graphDim,"height",n(t,!0)):(i.graphDim.height=Math.max(i.graphDim.height,n(t,!0)),0)}).attr("class",function(t){var e="graph-domain",n=new Date(t);switch(r.domain){case"hour":e+=" h_"+n.getHours();case"day":e+=" d_"+n.getDate()+" dy_"+n.getDay();case"week":e+=" w_"+i.getWeekNumber(n);case"month":e+=" m_"+(n.getMonth()+1);case"year":e+=" y_"+n.getFullYear()}return e});i.lastInsertedSvg=m,m.append("rect").attr("width",function(t){return e(t,!0)-r.domainGutter-r.cellPadding}).attr("height",function(t){return n(t,!0)-r.domainGutter-r.cellPadding}).attr("class","domain-background");var c=m.append("svg").attr("x",function(){return"left"===r.label.position?i.domainHorizontalLabelWidth+r.domainMargin[3]:r.domainMargin[3]}).attr("y",function(){return"top"===r.label.position?i.domainVerticalLabelHeight+r.domainMargin[0]:r.domainMargin[0]}).attr("class","graph-subdomain-group"),h=c.selectAll("g").data(function(t){return i._domains.get(t)}).enter().append("g");h.append("rect").attr("class",function(t){return"graph-rect"+i.getHighlightClassName(t.t)+(null!==r.onClick?" hover_cursor":"")}).attr("width",r.cellSize).attr("height",r.cellSize).attr("x",function(t){return i.positionSubDomainX(t.t)}).attr("y",function(t){return i.positionSubDomainY(t.t)}).on("click",function(t){return null!==r.onClick?i.onClick(new Date(t.t),t.v):void 0}).call(function(t){r.cellRadius>0&&t.attr("rx",r.cellRadius).attr("ry",r.cellRadius),null!==i.legendScale&&null!==r.legendColors&&r.legendColors.hasOwnProperty("base")&&t.attr("fill",r.legendColors.base),r.tooltip&&(t.on("mouseover",function(t){var e=this.parentNode.parentNode.parentNode;i.tooltip.html(i.getSubDomainTitle(t)).attr("style","display: block;"),i.tooltip.attr("style","display: block; left: "+(i.positionSubDomainX(t.t)-i.tooltip[0][0].offsetWidth/2+r.cellSize/2+parseInt(e.getAttribute("x"),10))+"px; "+"top: "+(i.positionSubDomainY(t.t)-i.tooltip[0][0].offsetHeight-r.cellSize/2+parseInt(e.getAttribute("y"),10))+"px;")}),t.on("mouseout",function(){i.tooltip.attr("style","display:none").html("")}))}),r.tooltip||h.append("title").text(function(t){return i.formatDate(new Date(t.t),r.subDomainDateFormat)}),""!==r.domainLabelFormat&&m.append("text").attr("class","graph-label").attr("y",function(t){var e=r.domainMargin[0];switch(r.label.position){case"top":e+=i.domainVerticalLabelHeight/2;break;case"bottom":e+=n(t)+i.domainVerticalLabelHeight/2}return e+r.label.offset.y*("right"===r.label.rotate&&"right"===r.label.position||"left"===r.label.rotate&&"left"===r.label.position?-1:1)}).attr("x",function(t){var n=r.domainMargin[3];switch(r.label.position){case"right":n+=e(t);break;case"bottom":case"top":n+=e(t)/2}return"right"===r.label.align?n+i.domainHorizontalLabelWidth-r.label.offset.x*("right"===r.label.rotate?-1:1):n+r.label.offset.x}).attr("text-anchor",function(){switch(r.label.align){case"start":case"left":return"start";case"end":case"right":return"end";default:return"middle"}}).attr("dominant-baseline",function(){return i.verticalDomainLabel?"middle":"top"}).text(function(t){return i.formatDate(new Date(t),r.domainLabelFormat)}).call(a),null!==r.subDomainTextFormat&&h.append("text").attr("class",function(t){return"subdomain-text"+i.getHighlightClassName(t.t)}).attr("x",function(t){return i.positionSubDomainX(t.t)+r.cellSize/2}).attr("y",function(t){return i.positionSubDomainY(t.t)+r.cellSize/2}).attr("text-anchor","middle").attr("dominant-baseline","central").text(function(t){return i.formatDate(new Date(t.t),r.subDomainTextFormat)}),t!==!1&&s.transition().duration(r.animationDuration).attr("x",function(t){return r.verticalOrientation?0:i.domainPosition.getPosition(t)}).attr("y",function(t){return r.verticalOrientation?i.domainPosition.getPosition(t):0});var g=i.graphDim.width,d=i.graphDim.height;r.verticalOrientation?i.graphDim.height+=l-u:i.graphDim.width+=l-u,s.exit().transition().duration(r.animationDuration).attr("x",function(n){if(r.verticalOrientation)return 0;switch(t){case i.NAVIGATE_LEFT:return Math.min(i.graphDim.width,g);case i.NAVIGATE_RIGHT:return-e(n,!0)}}).attr("y",function(e){if(!r.verticalOrientation)return 0;switch(t){case i.NAVIGATE_LEFT:return Math.min(i.graphDim.height,d);case i.NAVIGATE_RIGHT:return-n(e,!0)}}).remove(),i.resize()}};CalHeatMap.prototype={init:function(t){"use strict";function e(t,e,n){if((e&&t===!1||t instanceof Element||"string"==typeof t)&&""!==t)return!0;throw Error("The "+n+" is not valid")}function n(t){switch(t){case"year":return"month";case"month":return"day";case"week":return"day";case"day":return"hour";default:return"min"}}function i(){if(!m._domainType.hasOwnProperty(c.domain)||"min"===c.domain||"x_"===c.domain.substring(0,2))throw Error("The domain '"+c.domain+"' is not valid");if(!m._domainType.hasOwnProperty(c.subDomain)||"year"===c.subDomain)throw Error("The subDomain '"+c.subDomain+"' is not valid");if(m._domainType[c.domain].level<=m._domainType[c.subDomain].level)throw Error("'"+c.subDomain+"' is not a valid subDomain to '"+c.domain+"'");return!0}function o(){if(!t.hasOwnProperty("label")||t.hasOwnProperty("label")&&!t.label.hasOwnProperty("align")){switch(c.label.position){case"left":c.label.align="right";break;case"right":c.label.align="left";break;default:c.label.align="center"}"left"===c.label.rotate?c.label.align="right":"right"===c.label.rotate&&(c.label.align="left")}(!t.hasOwnProperty("label")||t.hasOwnProperty("label")&&!t.label.hasOwnProperty("offset"))&&("left"===c.label.position||"right"===c.label.position)&&(c.label.offset={x:10,y:15})}function a(){switch(c.legendVerticalPosition){case"top":c.legendMargin[2]=m.DEFAULT_LEGEND_MARGIN;break;case"bottom":c.legendMargin[0]=m.DEFAULT_LEGEND_MARGIN;break;case"middle":case"center":c.legendMargin["right"===c.legendHorizontalPosition?3:1]=m.DEFAULT_LEGEND_MARGIN}}function r(t){switch("number"==typeof t&&(t=[t]),Array.isArray(t)||(console.log("Margin only takes an integer or an array of integers"),t=[0]),t.length){case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];case 4:return t;default:return t.slice(0,4)}}function s(t){return"string"==typeof t?[t,t+(""!==t?"s":"")]:Array.isArray(t)?1===t.length?[t[0],t[0]+"s"]:t.length>2?t.slice(0,2):t:["item","items"]}function l(t){return t>0?t:null}function u(t){return t>0&&c.colLimit>0?(console.log("colLimit and rowLimit are mutually exclusive, rowLimit will be ignored"),null):t>0?t:null}var m=this,c=m.options=mergeRecursive(m.options,t);if(i(),e(c.itemSelector,!1,"itemSelector"),-1===m.allowedDataType.indexOf(c.dataType))throw Error("The data type '"+c.dataType+"' is not valid data type");if(null===d3.select(c.itemSelector)[0][0])throw Error("The node '"+c.itemSelector+"' specified in itemSelector does not exists");try{e(c.nextSelector,!0,"nextSelector"),e(c.previousSelector,!0,"previousSelector")}catch(h){return console.log(h.message),!1}t.hasOwnProperty("subDomain")||(this.options.subDomain=n(t.domain)),("string"!=typeof c.itemNamespace||""===c.itemNamespace)&&(console.log("itemNamespace can not be empty, falling back to cal-heatmap"),c.itemNamespace="cal-heatmap");var g=["data","onComplete","onClick","afterLoad","afterLoadData","afterLoadPreviousDomain","afterLoadNextDomain"];for(var d in g)t.hasOwnProperty(g[d])&&(c[g[d]]=t[g[d]]);return c.subDomainDateFormat="string"==typeof c.subDomainDateFormat||"function"==typeof c.subDomainDateFormat?c.subDomainDateFormat:this._domainType[c.subDomain].format.date,c.domainLabelFormat="string"==typeof c.domainLabelFormat||"function"==typeof c.domainLabelFormat?c.domainLabelFormat:this._domainType[c.domain].format.legend,c.subDomainTextFormat="string"==typeof c.subDomainTextFormat&&""!==c.subDomainTextFormat||"function"==typeof c.subDomainTextFormat?c.subDomainTextFormat:null,c.domainMargin=r(c.domainMargin),c.legendMargin=r(c.legendMargin),c.highlight=m.expandDateSetting(c.highlight),c.itemName=s(c.itemName),c.colLimit=l(c.colLimit),c.rowLimit=u(c.rowLimit),t.hasOwnProperty("legendMargin")||a(),o(),this._init()},expandDateSetting:function(t){"use strict";return Array.isArray(t)||(t=[t]),t.map(function(t){return"now"===t?new Date:t instanceof Date?t:!1}).filter(function(t){return t!==!1})},fill:function(t){"use strict";function e(t){return null===n.legendScale?!1:(t.attr("fill",function(t){return 0===t.v&&null!==i.legendColors&&i.legendColors.hasOwnProperty("empty")?i.legendColors.empty:0>t.v&&i.legend[0]>0&&null!==i.legendColors&&i.legendColors.hasOwnProperty("overflow")?i.legendColors.overflow:n.legendScale(Math.min(t.v,i.legend[i.legend.length-1]))}),void 0)}var n=this,i=n.options;0===arguments.length&&(t=n.root.selectAll(".graph-domain"));var o=t.selectAll("svg").selectAll("g").data(function(t){return n._domains.get(t)});o.transition().duration(i.animationDuration).select("rect").attr("class",function(t){var e=n.getHighlightClassName(t.t);return null===n.legendScale&&(e+=" graph-rect"),null!==t.v?e+=" "+n.Legend.getClass(t.v,null===n.legendScale):i.considerMissingDataAsZero&&(e+=" "+n.Legend.getClass(0,null===n.legendScale)),null!==i.onClick&&(e+=" hover_cursor"),e}).call(e),o.transition().duration(i.animationDuration).select("title").text(function(t){return n.getSubDomainTitle(t)})},triggerEvent:function(t,e,n){"use strict";return 3===arguments.length&&n||null===this.options[t]?!0:"function"==typeof this.options[t]?("function"==typeof e&&(e=e()),this.options[t].apply(this,e)):(console.log("Provided callback for "+t+" is not a function."),!1)},onClick:function(t,e){"use strict";return this.triggerEvent("onClick",[t,e])},afterLoad:function(){"use strict";return this.triggerEvent("afterLoad")},onComplete:function(){"use strict";var t=this.triggerEvent("onComplete",[],this._completed);return this._completed=!0,t},afterLoadPreviousDomain:function(t){"use strict";var e=this;return this.triggerEvent("afterLoadPreviousDomain",function(){var n=e.getSubDomain(t);return[n.shift(),n.pop()]})},afterLoadNextDomain:function(t){"use strict";var e=this;return this.triggerEvent("afterLoadNextDomain",function(){var n=e.getSubDomain(t);return[n.shift(),n.pop()]})},onMinDomainReached:function(t){"use strict";return this._minDomainReached=t,this.triggerEvent("onMinDomainReached",[t])},onMaxDomainReached:function(t){"use strict";return this._maxDomainReached=t,this.triggerEvent("onMaxDomainReached",[t])},checkIfMinDomainIsReached:function(t,e){"use strict";this.minDomainIsReached(t)&&this.onMinDomainReached(!0),2===arguments.length&&this._maxDomainReached&&!this.maxDomainIsReached(e)&&this.onMaxDomainReached(!1)},checkIfMaxDomainIsReached:function(t,e){"use strict";this.maxDomainIsReached(t)&&this.onMaxDomainReached(!0),2===arguments.length&&this._minDomainReached&&!this.minDomainIsReached(e)&&this.onMinDomainReached(!1)},formatNumber:d3.format(",g"),formatDate:function(t,e){"use strict";if(2>arguments.length&&(e="title"),"function"==typeof e)return e(t);var n=d3.time.format(e);return n(t)},getSubDomainTitle:function(t){"use strict";if(null!==t.v||this.options.considerMissingDataAsZero){var e=t.v;return null===e&&this.options.considerMissingDataAsZero&&(e=0),this.options.subDomainTitleFormat.filled.format({count:this.formatNumber(e),name:this.options.itemName[1!==e?1:0],connector:this._domainType[this.options.subDomain].format.connector,date:this.formatDate(new Date(t.t),this.options.subDomainDateFormat)})}return this.options.subDomainTitleFormat.empty.format({date:this.formatDate(new Date(t.t),this.options.subDomainDateFormat)})},loadNextDomain:function(t){"use strict";if(this._maxDomainReached||0===t)return!1;var e=this.loadNewDomains(this.NAVIGATE_RIGHT,this.getDomain(this.getNextDomain(),t));return this.afterLoadNextDomain(e.end),this.checkIfMaxDomainIsReached(this.getNextDomain().getTime(),e.start),!0},loadPreviousDomain:function(t){"use strict";if(this._minDomainReached||0===t)return!1;var e=this.loadNewDomains(this.NAVIGATE_LEFT,this.getDomain(this.getDomainKeys()[0],-t).reverse());return this.afterLoadPreviousDomain(e.start),this.checkIfMinDomainIsReached(e.start,e.end),!0},loadNewDomains:function(t,e){"use strict";function n(t){return{t:i._domainType[i.options.subDomain].extractUnit(t),v:null}}for(var i=this,o=t===this.NAVIGATE_LEFT,a=-1,r=e.length,s=this.getDomainKeys();r>++a;){if(o&&this.minDomainIsReached(e[a])){e=e.slice(0,a+1);break}if(!o&&this.maxDomainIsReached(e[a])){e=e.slice(0,a);break}}for(e=e.slice(-this.options.range),a=0,r=e.length;r>a;a++)this._domains.set(e[a].getTime(),this.getSubDomain(e[a]).map(n)),this._domains.remove(o?s.pop():s.shift());return s=this.getDomainKeys(),o&&(e=e.reverse()),this.paint(t),this.getDatas(this.options.data,e[0],this.getSubDomain(e[e.length-1]).pop(),function(){i.fill(i.lastInsertedSvg)}),{start:e[o?0:1],end:s[s.length-1]}},maxDomainIsReached:function(t){"use strict";return null!==this.options.maxDate&&t>this.options.maxDate.getTime()},minDomainIsReached:function(t){"use strict";return null!==this.options.minDate&&this.options.minDate.getTime()>=t},getDomainKeys:function(){"use strict";return this._domains.keys().map(function(t){return parseInt(t,10)}).sort(function(t,e){return t-e})},positionSubDomainX:function(t){"use strict";var e=this._domainType[this.options.subDomain].position.x(new Date(t));return e*this.options.cellSize+e*this.options.cellPadding},positionSubDomainY:function(t){"use strict";var e=this._domainType[this.options.subDomain].position.y(new Date(t));return e*this.options.cellSize+e*this.options.cellPadding},getSubDomainColumnNumber:function(t){"use strict";if(this.options.rowLimit>0){var e=this._domainType[this.options.subDomain].maxItemNumber;return"function"==typeof e&&(e=e(t)),Math.ceil(e/this.options.rowLimit)}var n=this._domainType[this.options.subDomain].defaultColumnNumber;return"function"==typeof n&&(n=n(t)),this.options.colLimit||n},getSubDomainRowNumber:function(t){"use strict";if(this.options.colLimit>0){var e=this._domainType[this.options.subDomain].maxItemNumber;return"function"==typeof e&&(e=e(t)),Math.ceil(e/this.options.colLimit)}var n=this._domainType[this.options.subDomain].defaultRowNumber;return"function"==typeof n&&(n=n(t)),this.options.rowLimit||n},getHighlightClassName:function(t){"use strict";if(t=new Date(t),this.options.highlight.length>0)for(var e in this.options.highlight)if(this.options.highlight[e]instanceof Date&&this.dateIsEqual(this.options.highlight[e],t))return" highlight"+(this.isNow(this.options.highlight[e])?" now":"");return""},isNow:function(t){"use strict";return this.dateIsEqual(t,new Date)},dateIsEqual:function(t,e){"use strict";switch(this.options.subDomain){case"x_min":case"min":return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()&&t.getHours()===e.getHours()&&t.getMinutes()===e.getMinutes();case"x_hour":case"hour":return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()&&t.getHours()===e.getHours();case"x_day":case"day":return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate();case"x_week":case"week":case"x_month":case"month":return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth();default:return!1}},getDayOfYear:d3.time.format("%j"),getWeekNumber:function(t){"use strict";var e=this.options.weekStartOnMonday===!0?d3.time.format("%W"):d3.time.format("%U");return e(t)},getMonthWeekNumber:function(t){"use strict";"number"==typeof t&&(t=new Date(t));var e=this.getWeekNumber(new Date(t.getFullYear(),t.getMonth()));return this.getWeekNumber(t)-e-1},getWeekNumberInYear:function(t){"use strict";"number"==typeof t&&(t=new Date(t))},getDayCountInMonth:function(t){"use strict";return this.getEndOfMonth(t).getDate()},getDayCountInYear:function(t){"use strict";return"number"==typeof t&&(t=new Date(t)),1===new Date(t.getFullYear(),1,29).getMonth()?366:365},getWeekDay:function(t){"use strict";return this.options.weekStartOnMonday===!1?t.getDay():0===t.getDay()?6:t.getDay()-1},getEndOfMonth:function(t){"use strict";return"number"==typeof t&&(t=new Date(t)),new Date(t.getFullYear(),t.getMonth()+1,0)},jumpDate:function(t,e,n){"use strict";var i=new Date(t);switch(n){case"hour":i.setHours(i.getHours()+e);break;case"day":i.setHours(i.getHours()+24*e);break;case"week":i.setHours(i.getHours()+7*24*e);break;case"month":i.setMonth(i.getMonth()+e);break;case"year":i.setFullYear(i.getFullYear()+e)}return new Date(i)},getMinuteDomain:function(t,e){"use strict";var n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours()),i=null;return i=e instanceof Date?new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours()):new Date(+n+60*1e3*e),d3.time.minutes(Math.min(n,i),Math.max(n,i))},getHourDomain:function(t,e){"use strict";var n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours()),i=null;e instanceof Date?i=new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours()):(i=new Date(n),i.setHours(i.getHours()+e));var o=d3.time.hours(Math.min(n,i),Math.max(n,i)),a=0,r=o.length;for(a=0;r>a;a++)if(a>0&&o[a].getHours()===o[a-1].getHours()){this.DSTDomain.push(o[a].getTime()),o.splice(a,1);break}return"number"==typeof e&&o.length>Math.abs(e)&&o.splice(o.length-1,1),o},getDayDomain:function(t,e){"use strict";var n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),i=null;return e instanceof Date?i=new Date(e.getFullYear(),e.getMonth(),e.getDate()):(i=new Date(n),i=new Date(i.setDate(i.getDate()+parseInt(e,10)))),d3.time.days(Math.min(n,i),Math.max(n,i))},getWeekDomain:function(t,e){"use strict";var n;this.options.weekStartOnMonday===!1?n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-t.getDay()):1===t.getDay()?n=new Date(t.getFullYear(),t.getMonth(),t.getDate()):0===t.getDay()?(n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n.setDate(n.getDate()-6)):n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-t.getDay()+1);var i=new Date(n),o=e;return"object"!=typeof e&&(o=new Date(i.setDate(i.getDate()+7*e))),this.options.weekStartOnMonday===!0?d3.time.mondays(Math.min(n,o),Math.max(n,o)):d3.time.sundays(Math.min(n,o),Math.max(n,o))},getMonthDomain:function(t,e){"use strict";var n=new Date(t.getFullYear(),t.getMonth()),i=null;return e instanceof Date?i=new Date(e.getFullYear(),e.getMonth()):(i=new Date(n),i=i.setMonth(i.getMonth()+e)),d3.time.months(Math.min(n,i),Math.max(n,i))},getYearDomain:function(t,e){"use strict";var n=new Date(t.getFullYear(),0),i=null;return i=e instanceof Date?new Date(e.getFullYear(),0):new Date(t.getFullYear()+e,0),d3.time.years(Math.min(n,i),Math.max(n,i))},getDomain:function(t,e){"use strict";switch("number"==typeof t&&(t=new Date(t)),2>arguments.length&&(e=this.options.range),this.options.domain){case"hour":var n=this.getHourDomain(t,e);return"number"==typeof e&&e>n.length&&(e>0?n.push(this.getHourDomain(n[n.length-1],2)[1]):n.shift(this.getHourDomain(n[0],-2)[0])),n;case"day":return this.getDayDomain(t,e);case"week":return this.getWeekDomain(t,e);case"month":return this.getMonthDomain(t,e);case"year":return this.getYearDomain(t,e)}},getSubDomain:function(t){"use strict";"number"==typeof t&&(t=new Date(t));var e=this,n=function(t,n){switch(n){case"year":return e.getDayCountInYear(t);case"month":return e.getDayCountInMonth(t);case"week":return 7}},i=function(t,e){switch(e){case"hour":return 60;case"day":return 1440;case"week":return 10080}},o=function(t,n){switch(n){case"day":return 24;case"week":return 168;case"month":return 24*e.getDayCountInMonth(t)}},a=function(t,n){if("month"===n){var i=new Date(t.getFullYear(),t.getMonth()+1,0),o=e.getWeekNumber(i),a=e.getWeekNumber(new Date(t.getFullYear(),t.getMonth()));return a>o&&(a=0,o++),o-a+1}return"year"===n?e.getWeekNumber(new Date(t.getFullYear(),11,31)):void 0};switch(this.options.subDomain){case"x_min":case"min":return this.getMinuteDomain(t,i(t,this.options.domain));case"x_hour":case"hour":return this.getHourDomain(t,o(t,this.options.domain));case"x_day":case"day":return this.getDayDomain(t,n(t,this.options.domain));case"x_week":case"week":return this.getWeekDomain(t,a(t,this.options.domain));case"x_month":case"month":return this.getMonthDomain(t,12)}},getNextDomain:function(t){"use strict";return 0===arguments.length&&(t=1),this.getDomain(this.jumpDate(this.getDomainKeys().pop(),t,this.options.domain),1)[0] -},getPreviousDomain:function(t){"use strict";return 0===arguments.length&&(t=1),this.getDomain(this.jumpDate(this.getDomainKeys().shift(),-t,this.options.domain),1)[0]},getDatas:function(t,e,n,i,o,a){"use strict";var r=this;5>arguments.length&&(o=!0),6>arguments.length&&(a=this.APPEND_ON_UPDATE);var s=function(t){o!==!1?"function"==typeof o?t=o(t):"function"==typeof r.options.afterLoadData?t=r.options.afterLoadData(t):console.log("Provided callback for afterLoadData is not a function."):("csv"===r.options.dataType||"tsv"===r.options.dataType)&&(t=this.interpretCSV(t)),r.parseDatas(t,a,e,n),"function"==typeof i&&i()};switch(typeof t){case"string":if(""===t)return s({}),!0;switch(this.options.dataType){case"json":d3.json(this.parseURI(t,e,n),s);break;case"csv":d3.csv(this.parseURI(t,e,n),s);break;case"tsv":d3.tsv(this.parseURI(t,e,n),s);break;case"txt":d3.text(this.parseURI(t,e,n),"text/plain",s)}return!1;case"object":if(t===Object(t))return s(t),!1;default:return s({}),!0}},parseDatas:function(t,e,n,i){"use strict";e===this.RESET_ALL_ON_UPDATE&&this._domains.forEach(function(t,e){e.forEach(function(t,e,n){n[e].v=null})});var o={},a=function(t){return t.t};for(var r in t){var s=new Date(1e3*r),l=this.getDomain(s)[0].getTime();if(this.DSTDomain.indexOf(l)>=0&&this._domains.has(l-36e5)&&(l-=36e5),!isNaN(r)&&t.hasOwnProperty(r)&&this._domains.has(l)&&l>=+n&&+i>l){var u=this._domains.get(l);o.hasOwnProperty(l)||(o[l]=u.map(a));var m=o[l].indexOf(this._domainType[this.options.subDomain].extractUnit(s));e===this.RESET_SINGLE_ON_UPDATE?u[m].v=t[r]:isNaN(u[m].v)?u[m].v=t[r]:u[m].v+=t[r]}}},parseURI:function(t,e,n){"use strict";return t=t.replace(/\{\{t:start\}\}/g,e.getTime()/1e3),t=t.replace(/\{\{t:end\}\}/g,n.getTime()/1e3),t=t.replace(/\{\{d:start\}\}/g,e.toISOString()),t=t.replace(/\{\{d:end\}\}/g,n.toISOString())},interpretCSV:function(t){"use strict";var e,n,i={},o=Object.keys(t[0]);for(e=0,n=t.length;n>e;e++)i[t[e][o[0]]]=+t[e][o[1]];return i},resize:function(){"use strict";var t=this,e=t.options,n=e.displayLegend?t.Legend.getDim("width")+e.legendMargin[1]+e.legendMargin[3]:0,i=e.displayLegend?t.Legend.getDim("height")+e.legendMargin[0]+e.legendMargin[2]:0,o=t.graphDim.width-e.domainGutter-e.cellPadding,a=t.graphDim.height-e.domainGutter-e.cellPadding;this.root.transition().duration(e.animationDuration).attr("width",function(){return"middle"===e.legendVerticalPosition||"center"===e.legendVerticalPosition?o+n:Math.max(o,n)}).attr("height",function(){return"middle"===e.legendVerticalPosition||"center"===e.legendVerticalPosition?Math.max(a,i):a+i}),this.root.select(".graph").transition().duration(e.animationDuration).attr("y",function(){return"top"===e.legendVerticalPosition?i:0}).attr("x",function(){return"middle"!==e.legendVerticalPosition&&"center"!==e.legendVerticalPosition||"left"!==e.legendHorizontalPosition?0:n})},next:function(t){"use strict";return 0===arguments.length&&(t=1),this.loadNextDomain(t)},previous:function(t){"use strict";return 0===arguments.length&&(t=1),this.loadPreviousDomain(t)},jumpTo:function(t,e){"use strict";2>arguments.length&&(e=!1);var n=this.getDomainKeys(),i=n[0],o=n[n.length-1];return i>t?this.loadPreviousDomain(this.getDomain(i,t).length):e?this.loadNextDomain(this.getDomain(i,t).length):t>o?this.loadNextDomain(this.getDomain(o,t).length):!1},rewind:function(){"use strict";this.jumpTo(this.options.start,!0)},update:function(t,e,n){"use strict";2>arguments.length&&(e=!0),3>arguments.length&&(n=this.RESET_ALL_ON_UPDATE);var i=this.getDomainKeys(),o=this;this.getDatas(t,new Date(i[0]),this.getSubDomain(i[i.length-1]).pop(),function(){o.fill()},e,n)},setLegend:function(){"use strict";var t=this.options.legend.slice(0);arguments.length>=1&&Array.isArray(arguments[0])&&(this.options.legend=arguments[0]),arguments.length>=2&&(this.options.legendColors=Array.isArray(arguments[1])&&arguments[1].length>=2?[arguments[1][0],arguments[1][1]]:arguments[1]),(arguments.length>0&&!arrayEquals(t,this.options.legend)||arguments.length>=2)&&(this.Legend.buildColors(),this.fill()),this.Legend.redraw(this.graphDim.width-this.options.domainGutter-this.options.cellPadding)},removeLegend:function(){"use strict";return this.options.displayLegend?(this.options.displayLegend=!1,this.Legend.remove(),!0):!1},showLegend:function(){"use strict";return this.options.displayLegend?!1:(this.options.displayLegend=!0,this.Legend.redraw(this.graphDim.width-this.options.domainGutter-this.options.cellPadding),!0)},highlight:function(t){"use strict";return(this.options.highlight=this.expandDateSetting(t)).length>0?(this.fill(),!0):!1},destroy:function(t){"use strict";return this.root.transition().duration(this.options.animationDuration).attr("width",0).attr("height",0).remove().each("end",function(){"function"==typeof t?t():arguments.length>0&&console.log("Provided callback for destroy() is not a function.")}),null},getSVG:function(){"use strict";for(var t={".cal-heatmap-container":{},".graph":{},".graph-rect":{},"rect.highlight":{},"rect.now":{},"text.highlight":{},"text.now":{},".domain-background":{},".graph-label":{},".subdomain-text":{},".q0":{},".qi":{}},e=1,n=this.options.legend.length+1;n>=e;e++)t[".q"+e]={};var i=this.root,o=["stroke","stroke-width","stroke-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-miterlimit","fill","fill-opacity","fill-rule","marker","marker-start","marker-mid","marker-end","alignement-baseline","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","kerning","text-anchor","shape-rendering","text-transform","font-family","font","font-size","font-weight"],a=function(e,n,i){-1!==o.indexOf(n)&&(t[e][n]=i)},r=function(t){return i.select(t)[0][0]};for(var s in t)if(t.hasOwnProperty(s)){var l=r(s);if(null!==l)if("getComputedStyle"in window){var u=getComputedStyle(l,null);if(0!==u.length)for(var m=0;u.length>m;m++)a(s,u.item(m),u.getPropertyValue(u.item(m)));else for(var c in u)u.hasOwnProperty(c)&&a(s,c,u[c])}else if("currentStyle"in l){var h=l.currentStyle;for(var g in h)a(s,g,h[g])}}var d='",d+=(new XMLSerializer).serializeToString(this.root[0][0]),d+=""}};var DomainPosition=function(){"use strict";this.positions=d3.map()};DomainPosition.prototype.getPosition=function(t){"use strict";return this.positions.get(t)},DomainPosition.prototype.getPositionFromIndex=function(t){"use strict";var e=this.getKeys();return this.positions.get(e[t])},DomainPosition.prototype.getLast=function(){"use strict";var t=this.getKeys();return this.positions.get(t[t.length-1])},DomainPosition.prototype.setPosition=function(t,e){"use strict";this.positions.set(t,e)},DomainPosition.prototype.shiftRightBy=function(t){"use strict";this.positions.forEach(function(e,n){this.set(e,n-t)});var e=this.getKeys();this.positions.remove(e[0])},DomainPosition.prototype.shiftLeftBy=function(t){"use strict";this.positions.forEach(function(e,n){this.set(e,n+t)});var e=this.getKeys();this.positions.remove(e[e.length-1])},DomainPosition.prototype.getKeys=function(){"use strict";return this.positions.keys().sort(function(t,e){return parseInt(t,10)-parseInt(e,10)})};var Legend=function(t){"use strict";this.calendar=t,this.computeDim(),null!==t.options.legendColors&&this.buildColors()};Legend.prototype.computeDim=function(){"use strict";var t=this.calendar.options;this.dim={width:t.legendCellSize*(t.legend.length+1)+t.legendCellPadding*t.legend.length,height:t.legendCellSize}},Legend.prototype.remove=function(){"use strict";this.calendar.root.select(".graph-legend").remove(),this.calendar.resize()},Legend.prototype.redraw=function(t){"use strict";function e(t){t.attr("width",l.legendCellSize).attr("height",l.legendCellSize).attr("x",function(t,e){return e*(l.legendCellSize+l.legendCellPadding)})}function n(){switch(l.legendHorizontalPosition){case"right":return"center"===l.legendVerticalPosition||"middle"===l.legendVerticalPosition?t+l.legendMargin[3]:t-a.getDim("width")-l.legendMargin[1];case"middle":case"center":return Math.round(t/2-a.getDim("width")/2);default:return l.legendMargin[3]}}function i(){return"bottom"===l.legendVerticalPosition?r.graphDim.height+l.legendMargin[0]-l.domainGutter-l.cellPadding:l.legendMargin[0]}if(!this.calendar.options.displayLegend)return!1;var o,a=this,r=this.calendar,s=r.root,l=r.options;this.computeDim();var u=l.legend.slice(0);u.push(u[u.length-1]+1);var m=r.root.select(".graph-legend");null!==m[0][0]?(s=m,o=s.select("g").selectAll("rect").data(u)):(s="top"===l.legendVerticalPosition?s.insert("svg",".graph"):s.append("svg"),s.attr("x",n()).attr("y",i()),o=s.attr("class","graph-legend").attr("height",a.getDim("height")).attr("width",a.getDim("width")).append("g").selectAll().data(u)),o.enter().append("rect").call(e).attr("class",function(t){return r.Legend.getClass(t,null===r.legendScale)}).attr("fill-opacity",0).call(function(t){null!==r.legendScale&&null!==l.legendColors&&l.legendColors.hasOwnProperty("base")&&t.attr("fill",l.legendColors.base)}).append("title"),o.exit().transition().duration(l.animationDuration).attr("fill-opacity",0).remove(),o.transition().delay(function(t,e){return l.animationDuration*e/10}).call(e).attr("fill-opacity",1).call(function(t){t.attr("fill",function(t,e){return null===r.legendScale?"":0===e?r.legendScale(t-1):r.legendScale(l.legend[e-1])}),t.attr("class",function(t){return r.Legend.getClass(t,null===r.legendScale)})}),o.select("title").text(function(t,e){return 0===e?l.legendTitleFormat.lower.format({min:l.legend[e],name:l.itemName[1]}):e===u.length-1?l.legendTitleFormat.upper.format({max:l.legend[e-1],name:l.itemName[1]}):l.legendTitleFormat.inner.format({down:l.legend[e-1],up:l.legend[e],name:l.itemName[1]})}),s.transition().duration(l.animationDuration).attr("x",n()).attr("y",i()).attr("width",a.getDim("width")).attr("height",a.getDim("height")),s.select("g").transition().duration(l.animationDuration).attr("transform",function(){return"vertical"===l.legendOrientation?"rotate(90 "+l.legendCellSize/2+" "+l.legendCellSize/2+")":""}),r.resize()},Legend.prototype.getDim=function(t){"use strict";var e="horizontal"===this.calendar.options.legendOrientation;switch(t){case"width":return this.dim[e?"width":"height"];case"height":return this.dim[e?"height":"width"]}},Legend.prototype.buildColors=function(){"use strict";var t=this.calendar.options;if(null===t.legendColors)return this.calendar.legendScale=null,!1;var e=[];if(Array.isArray(t.legendColors))e=t.legendColors;else{if(!t.legendColors.hasOwnProperty("min")||!t.legendColors.hasOwnProperty("max"))return t.legendColors=null,!1;e=[t.legendColors.min,t.legendColors.max]}var n=t.legend.slice(0);n[0]>0?n.unshift(0):0>n[0]&&n.unshift(n[0]-(n[n.length-1]-n[0])/n.length);var i=d3.scale.linear().range(e).interpolate(d3.interpolateHcl).domain([d3.min(n),d3.max(n)]),o=n.map(function(t){return i(t)});return this.calendar.legendScale=d3.scale.threshold().domain(t.legend).range(o),!0},Legend.prototype.getClass=function(t,e){"use strict";if(null===t||isNaN(t))return"";for(var n=[this.calendar.options.legend.length+1],i=0,o=this.calendar.options.legend.length-1;o>=i;i++){if(this.calendar.options.legend[0]>0&&0>t){n=["1","i"];break}if(this.calendar.options.legend[i]>=t){n=[i+1];break}}return 0===t&&n.push(0),n.unshift(""),(n.join(" r")+(e?n.join(" q"):"")).trim()},String.prototype.format=function(){"use strict";var t=this;for(var e in arguments[0])if(arguments[0].hasOwnProperty(e)){var n=RegExp("\\{"+e+"\\}","gi");t=t.replace(n,arguments[0][e])}return t},"function"==typeof define&&define.amd&&define(["d3"],function(){"use strict";return CalHeatMap}); -//@ sourceMappingURL=cal-heatmap.source-map.js \ No newline at end of file diff --git a/pagure/static/codemirror/codemirror-5.18.2.css b/pagure/static/codemirror/codemirror-5.18.2.css deleted file mode 100644 index 18b0bf7..0000000 --- a/pagure/static/codemirror/codemirror-5.18.2.css +++ /dev/null @@ -1,347 +0,0 @@ -/* BASICS */ - -.CodeMirror { - /* Set height, width, borders, and global font properties here */ - font-family: monospace; - height: 300px; - color: black; -} - -/* PADDING */ - -.CodeMirror-lines { - padding: 4px 0; /* Vertical padding around content */ -} -.CodeMirror pre { - padding: 0 4px; /* Horizontal padding of content */ -} - -.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - background-color: white; /* The little square between H and V scrollbars */ -} - -/* GUTTER */ - -.CodeMirror-gutters { - border-right: 1px solid #ddd; - background-color: #f7f7f7; - white-space: nowrap; -} -.CodeMirror-linenumbers {} -.CodeMirror-linenumber { - padding: 0 3px 0 5px; - min-width: 20px; - text-align: right; - color: #999; - white-space: nowrap; -} - -.CodeMirror-guttermarker { color: black; } -.CodeMirror-guttermarker-subtle { color: #999; } - -/* CURSOR */ - -.CodeMirror-cursor { - border-left: 1px solid black; - border-right: none; - width: 0; -} -/* Shown when moving in bi-directional text */ -.CodeMirror div.CodeMirror-secondarycursor { - border-left: 1px solid silver; -} -.cm-fat-cursor .CodeMirror-cursor { - width: auto; - border: 0 !important; - background: #7e7; -} -.cm-fat-cursor div.CodeMirror-cursors { - z-index: 1; -} - -.cm-animate-fat-cursor { - width: auto; - border: 0; - -webkit-animation: blink 1.06s steps(1) infinite; - -moz-animation: blink 1.06s steps(1) infinite; - animation: blink 1.06s steps(1) infinite; - background-color: #7e7; -} -@-moz-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} -@-webkit-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} -@keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} - -/* Can style cursor different in overwrite (non-insert) mode */ -.CodeMirror-overwrite .CodeMirror-cursor {} - -.cm-tab { display: inline-block; text-decoration: inherit; } - -.CodeMirror-rulers { - position: absolute; - left: 0; right: 0; top: -50px; bottom: -20px; - overflow: hidden; -} -.CodeMirror-ruler { - border-left: 1px solid #ccc; - top: 0; bottom: 0; - position: absolute; -} - -/* DEFAULT THEME */ - -.cm-s-default .cm-header {color: blue;} -.cm-s-default .cm-quote {color: #090;} -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-header, .cm-strong {font-weight: bold;} -.cm-em {font-style: italic;} -.cm-link {text-decoration: underline;} -.cm-strikethrough {text-decoration: line-through;} - -.cm-s-default .cm-keyword {color: #708;} -.cm-s-default .cm-atom {color: #219;} -.cm-s-default .cm-number {color: #164;} -.cm-s-default .cm-def {color: #00f;} -.cm-s-default .cm-variable, -.cm-s-default .cm-punctuation, -.cm-s-default .cm-property, -.cm-s-default .cm-operator {} -.cm-s-default .cm-variable-2 {color: #05a;} -.cm-s-default .cm-variable-3 {color: #085;} -.cm-s-default .cm-comment {color: #a50;} -.cm-s-default .cm-string {color: #a11;} -.cm-s-default .cm-string-2 {color: #f50;} -.cm-s-default .cm-meta {color: #555;} -.cm-s-default .cm-qualifier {color: #555;} -.cm-s-default .cm-builtin {color: #30a;} -.cm-s-default .cm-bracket {color: #997;} -.cm-s-default .cm-tag {color: #170;} -.cm-s-default .cm-attribute {color: #00c;} -.cm-s-default .cm-hr {color: #999;} -.cm-s-default .cm-link {color: #00c;} - -.cm-s-default .cm-error {color: #f00;} -.cm-invalidchar {color: #f00;} - -.CodeMirror-composing { border-bottom: 2px solid; } - -/* Default styles for common addons */ - -div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} -.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } -.CodeMirror-activeline-background {background: #e8f2ff;} - -/* STOP */ - -/* The rest of this file contains styles related to the mechanics of - the editor. You probably shouldn't touch them. */ - -.CodeMirror { - position: relative; - overflow: hidden; - background: white; -} - -.CodeMirror-scroll { - overflow: scroll !important; /* Things will break if this is overridden */ - /* 30px is the magic margin used to hide the element's real scrollbars */ - /* See overflow: hidden in .CodeMirror */ - margin-bottom: -30px; margin-right: -30px; - padding-bottom: 30px; - height: 100%; - outline: none; /* Prevent dragging from highlighting the element */ - position: relative; -} -.CodeMirror-sizer { - position: relative; - border-right: 30px solid transparent; -} - -/* The fake, visible scrollbars. Used to force redraw during scrolling - before actual scrolling happens, thus preventing shaking and - flickering artifacts. */ -.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - position: absolute; - z-index: 6; - display: none; -} -.CodeMirror-vscrollbar { - right: 0; top: 0; - overflow-x: hidden; - overflow-y: scroll; -} -.CodeMirror-hscrollbar { - bottom: 0; left: 0; - overflow-y: hidden; - overflow-x: scroll; -} -.CodeMirror-scrollbar-filler { - right: 0; bottom: 0; -} -.CodeMirror-gutter-filler { - left: 0; bottom: 0; -} - -.CodeMirror-gutters { - position: absolute; left: 0; top: 0; - min-height: 100%; - z-index: 3; -} -.CodeMirror-gutter { - white-space: normal; - height: 100%; - display: inline-block; - vertical-align: top; - margin-bottom: -30px; - /* Hack to make IE7 behave */ - *zoom:1; - *display:inline; -} -.CodeMirror-gutter-wrapper { - position: absolute; - z-index: 4; - background: none !important; - border: none !important; -} -.CodeMirror-gutter-background { - position: absolute; - top: 0; bottom: 0; - z-index: 4; -} -.CodeMirror-gutter-elt { - position: absolute; - cursor: default; - z-index: 4; -} -.CodeMirror-gutter-wrapper { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; -} - -.CodeMirror-lines { - cursor: text; - min-height: 1px; /* prevents collapsing before first draw */ -} -.CodeMirror pre { - /* Reset some styles that the rest of the page might have set */ - -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; - border-width: 0; - background: transparent; - font-family: inherit; - font-size: inherit; - margin: 0; - white-space: pre; - word-wrap: normal; - line-height: inherit; - color: inherit; - z-index: 2; - position: relative; - overflow: visible; - -webkit-tap-highlight-color: transparent; - -webkit-font-variant-ligatures: none; - font-variant-ligatures: none; -} -.CodeMirror-wrap pre { - word-wrap: break-word; - white-space: pre-wrap; - word-break: normal; -} - -.CodeMirror-linebackground { - position: absolute; - left: 0; right: 0; top: 0; bottom: 0; - z-index: 0; -} - -.CodeMirror-linewidget { - position: relative; - z-index: 2; - overflow: auto; -} - -.CodeMirror-widget {} - -.CodeMirror-code { - outline: none; -} - -/* Force content-box sizing for the elements where we expect it */ -.CodeMirror-scroll, -.CodeMirror-sizer, -.CodeMirror-gutter, -.CodeMirror-gutters, -.CodeMirror-linenumber { - -moz-box-sizing: content-box; - box-sizing: content-box; -} - -.CodeMirror-measure { - position: absolute; - width: 100%; - height: 0; - overflow: hidden; - visibility: hidden; -} - -.CodeMirror-cursor { - position: absolute; - pointer-events: none; -} -.CodeMirror-measure pre { position: static; } - -div.CodeMirror-cursors { - visibility: hidden; - position: relative; - z-index: 3; -} -div.CodeMirror-dragcursors { - visibility: visible; -} - -.CodeMirror-focused div.CodeMirror-cursors { - visibility: visible; -} - -.CodeMirror-selected { background: #d9d9d9; } -.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } -.CodeMirror-crosshair { cursor: crosshair; } -.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } -.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } - -.cm-searching { - background: #ffa; - background: rgba(255, 255, 0, .4); -} - -/* IE7 hack to prevent it from returning funny offsetTops on the spans */ -.CodeMirror span { *vertical-align: text-bottom; } - -/* Used to force a border model for a node */ -.cm-force-border { padding-right: .1px; } - -@media print { - /* Hide the cursor when printing */ - .CodeMirror div.CodeMirror-cursors { - visibility: hidden; - } -} - -/* See issue #2901 */ -.cm-tab-wrap-hack:after { content: ''; } - -/* Help users use markselection to safely style text background */ -span.CodeMirror-selectedtext { background: none; } diff --git a/pagure/static/codemirror/codemirror-5.18.2.js b/pagure/static/codemirror/codemirror-5.18.2.js deleted file mode 100644 index 1071bb9..0000000 --- a/pagure/static/codemirror/codemirror-5.18.2.js +++ /dev/null @@ -1,8961 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// This is CodeMirror (http://codemirror.net), a code editor -// implemented in JavaScript on top of the browser's DOM. -// -// You can find some technical background for some of the code below -// at http://marijnhaverbeke.nl/blog/#cm-internals . - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - module.exports = mod(); - else if (typeof define == "function" && define.amd) // AMD - return define([], mod); - else // Plain browser env - (this || window).CodeMirror = mod(); -})(function() { - "use strict"; - - // BROWSER SNIFFING - - // Kludges for bugs and behavior differences that can't be feature - // detected are enabled based on userAgent etc sniffing. - var userAgent = navigator.userAgent; - var platform = navigator.platform; - - var gecko = /gecko\/\d/i.test(userAgent); - var ie_upto10 = /MSIE \d/.test(userAgent); - var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); - var ie = ie_upto10 || ie_11up; - var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]); - var webkit = /WebKit\//.test(userAgent); - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); - var chrome = /Chrome\//.test(userAgent); - var presto = /Opera\//.test(userAgent); - var safari = /Apple Computer/.test(navigator.vendor); - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); - var phantom = /PhantomJS/.test(userAgent); - - var ios = /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent); - // This is woefully incomplete. Suggestions for alternative methods welcome. - var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); - var mac = ios || /Mac/.test(platform); - var chromeOS = /\bCrOS\b/.test(userAgent); - var windows = /win/i.test(platform); - - var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); - if (presto_version) presto_version = Number(presto_version[1]); - if (presto_version && presto_version >= 15) { presto = false; webkit = true; } - // Some browsers use the wrong event properties to signal cmd/ctrl on OS X - var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); - var captureRightClick = gecko || (ie && ie_version >= 9); - - // Optimize some code when these features are not used. - var sawReadOnlySpans = false, sawCollapsedSpans = false; - - // EDITOR CONSTRUCTOR - - // A CodeMirror instance represents an editor. This is the object - // that user code is usually dealing with. - - function CodeMirror(place, options) { - if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); - - this.options = options = options ? copyObj(options) : {}; - // Determine effective options based on given values and defaults. - copyObj(defaults, options, false); - setGuttersForLineNumbers(options); - - var doc = options.value; - if (typeof doc == "string") doc = new Doc(doc, options.mode, null, options.lineSeparator); - this.doc = doc; - - var input = new CodeMirror.inputStyles[options.inputStyle](this); - var display = this.display = new Display(place, doc, input); - display.wrapper.CodeMirror = this; - updateGutters(this); - themeChanged(this); - if (options.lineWrapping) - this.display.wrapper.className += " CodeMirror-wrap"; - if (options.autofocus && !mobile) display.input.focus(); - initScrollbars(this); - - this.state = { - keyMaps: [], // stores maps added by addKeyMap - overlays: [], // highlighting overlays, as added by addOverlay - modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info - overwrite: false, - delayingBlurEvent: false, - focused: false, - suppressEdits: false, // used to disable editing during key handlers when in readOnly mode - pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll - selectingText: false, - draggingText: false, - highlight: new Delayed(), // stores highlight worker timeout - keySeq: null, // Unfinished key sequence - specialChars: null - }; - - var cm = this; - - // Override magic textarea content restore that IE sometimes does - // on our hidden textarea on reload - if (ie && ie_version < 11) setTimeout(function() { cm.display.input.reset(true); }, 20); - - registerEventHandlers(this); - ensureGlobalHandlers(); - - startOperation(this); - this.curOp.forceUpdate = true; - attachDoc(this, doc); - - if ((options.autofocus && !mobile) || cm.hasFocus()) - setTimeout(bind(onFocus, this), 20); - else - onBlur(this); - - for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) - optionHandlers[opt](this, options[opt], Init); - maybeUpdateLineNumberWidth(this); - if (options.finishInit) options.finishInit(this); - for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); - endOperation(this); - // Suppress optimizelegibility in Webkit, since it breaks text - // measuring on line wrapping boundaries. - if (webkit && options.lineWrapping && - getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") - display.lineDiv.style.textRendering = "auto"; - } - - // DISPLAY CONSTRUCTOR - - // The display handles the DOM integration, both for input reading - // and content drawing. It holds references to DOM nodes and - // display-related state. - - function Display(place, doc, input) { - var d = this; - this.input = input; - - // Covers bottom-right square when both scrollbars are present. - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); - d.scrollbarFiller.setAttribute("cm-not-content", "true"); - // Covers bottom of gutter when coverGutterNextToScrollbar is on - // and h scrollbar is present. - d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); - d.gutterFiller.setAttribute("cm-not-content", "true"); - // Will contain the actual code, positioned to cover the viewport. - d.lineDiv = elt("div", null, "CodeMirror-code"); - // Elements are added to these to represent selection and cursors. - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); - d.cursorDiv = elt("div", null, "CodeMirror-cursors"); - // A visibility: hidden element used to find the size of things. - d.measure = elt("div", null, "CodeMirror-measure"); - // When lines outside of the viewport are measured, they are drawn in this. - d.lineMeasure = elt("div", null, "CodeMirror-measure"); - // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], - null, "position: relative; outline: none"); - // Moved around its parent to cover visible view. - d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); - // Set to the height of the document, allowing scrolling. - d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); - d.sizerWidth = null; - // Behavior of elts with overflow: auto and padding is - // inconsistent across browsers. This is used to ensure the - // scrollable area is big enough. - d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); - // Will contain the gutters, if any. - d.gutters = elt("div", null, "CodeMirror-gutters"); - d.lineGutter = null; - // Actual scrollable element. - d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); - d.scroller.setAttribute("tabIndex", "-1"); - // The element in which the editor lives. - d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); - - // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) - if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } - if (!webkit && !(gecko && mobile)) d.scroller.draggable = true; - - if (place) { - if (place.appendChild) place.appendChild(d.wrapper); - else place(d.wrapper); - } - - // Current rendered range (may be bigger than the view window). - d.viewFrom = d.viewTo = doc.first; - d.reportedViewFrom = d.reportedViewTo = doc.first; - // Information about the rendered lines. - d.view = []; - d.renderedView = null; - // Holds info about a single rendered line when it was rendered - // for measurement, while not in view. - d.externalMeasured = null; - // Empty space (in pixels) above the view - d.viewOffset = 0; - d.lastWrapHeight = d.lastWrapWidth = 0; - d.updateLineNumbers = null; - - d.nativeBarWidth = d.barHeight = d.barWidth = 0; - d.scrollbarsClipped = false; - - // Used to only resize the line number gutter when necessary (when - // the amount of lines crosses a boundary that makes its width change) - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; - // Set to true when a non-horizontal-scrolling line widget is - // added. As an optimization, line widget aligning is skipped when - // this is false. - d.alignWidgets = false; - - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - - // Tracks the maximum line length so that the horizontal scrollbar - // can be kept static when scrolling. - d.maxLine = null; - d.maxLineLength = 0; - d.maxLineChanged = false; - - // Used for measuring wheel scrolling granularity - d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; - - // True when shift is held down. - d.shift = false; - - // Used to track whether anything happened since the context menu - // was opened. - d.selForContextMenu = null; - - d.activeTouch = null; - - input.init(d); - } - - // STATE UPDATES - - // Used to get the editor into a consistent state again when options change. - - function loadMode(cm) { - cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption); - resetModeState(cm); - } - - function resetModeState(cm) { - cm.doc.iter(function(line) { - if (line.stateAfter) line.stateAfter = null; - if (line.styles) line.styles = null; - }); - cm.doc.frontier = cm.doc.first; - startWorker(cm, 100); - cm.state.modeGen++; - if (cm.curOp) regChange(cm); - } - - function wrappingChanged(cm) { - if (cm.options.lineWrapping) { - addClass(cm.display.wrapper, "CodeMirror-wrap"); - cm.display.sizer.style.minWidth = ""; - cm.display.sizerWidth = null; - } else { - rmClass(cm.display.wrapper, "CodeMirror-wrap"); - findMaxLine(cm); - } - estimateLineHeights(cm); - regChange(cm); - clearCaches(cm); - setTimeout(function(){updateScrollbars(cm);}, 100); - } - - // Returns a function that estimates the height of a line, to use as - // first approximation until the line becomes visible (and is thus - // properly measurable). - function estimateHeight(cm) { - var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; - var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); - return function(line) { - if (lineIsHidden(cm.doc, line)) return 0; - - var widgetsHeight = 0; - if (line.widgets) for (var i = 0; i < line.widgets.length; i++) { - if (line.widgets[i].height) widgetsHeight += line.widgets[i].height; - } - - if (wrapping) - return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; - else - return widgetsHeight + th; - }; - } - - function estimateLineHeights(cm) { - var doc = cm.doc, est = estimateHeight(cm); - doc.iter(function(line) { - var estHeight = est(line); - if (estHeight != line.height) updateLineHeight(line, estHeight); - }); - } - - function themeChanged(cm) { - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + - cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); - clearCaches(cm); - } - - function guttersChanged(cm) { - updateGutters(cm); - regChange(cm); - setTimeout(function(){alignHorizontally(cm);}, 20); - } - - // Rebuild the gutter elements, ensure the margin to the left of the - // code matches their width. - function updateGutters(cm) { - var gutters = cm.display.gutters, specs = cm.options.gutters; - removeChildren(gutters); - for (var i = 0; i < specs.length; ++i) { - var gutterClass = specs[i]; - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); - if (gutterClass == "CodeMirror-linenumbers") { - cm.display.lineGutter = gElt; - gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; - } - } - gutters.style.display = i ? "" : "none"; - updateGutterSpace(cm); - } - - function updateGutterSpace(cm) { - var width = cm.display.gutters.offsetWidth; - cm.display.sizer.style.marginLeft = width + "px"; - } - - // Compute the character length of a line, taking into account - // collapsed ranges (see markText) that might hide parts, and join - // other lines onto it. - function lineLength(line) { - if (line.height == 0) return 0; - var len = line.text.length, merged, cur = line; - while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(0, true); - cur = found.from.line; - len += found.from.ch - found.to.ch; - } - cur = line; - while (merged = collapsedSpanAtEnd(cur)) { - var found = merged.find(0, true); - len -= cur.text.length - found.from.ch; - cur = found.to.line; - len += cur.text.length - found.to.ch; - } - return len; - } - - // Find the longest line in the document. - function findMaxLine(cm) { - var d = cm.display, doc = cm.doc; - d.maxLine = getLine(doc, doc.first); - d.maxLineLength = lineLength(d.maxLine); - d.maxLineChanged = true; - doc.iter(function(line) { - var len = lineLength(line); - if (len > d.maxLineLength) { - d.maxLineLength = len; - d.maxLine = line; - } - }); - } - - // Make sure the gutters options contains the element - // "CodeMirror-linenumbers" when the lineNumbers option is true. - function setGuttersForLineNumbers(options) { - var found = indexOf(options.gutters, "CodeMirror-linenumbers"); - if (found == -1 && options.lineNumbers) { - options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); - } else if (found > -1 && !options.lineNumbers) { - options.gutters = options.gutters.slice(0); - options.gutters.splice(found, 1); - } - } - - // SCROLLBARS - - // Prepare DOM reads needed to update the scrollbars. Done in one - // shot to minimize update/measure roundtrips. - function measureForScrollbars(cm) { - var d = cm.display, gutterW = d.gutters.offsetWidth; - var docH = Math.round(cm.doc.height + paddingVert(cm.display)); - return { - clientHeight: d.scroller.clientHeight, - viewHeight: d.wrapper.clientHeight, - scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, - viewWidth: d.wrapper.clientWidth, - barLeft: cm.options.fixedGutter ? gutterW : 0, - docHeight: docH, - scrollHeight: docH + scrollGap(cm) + d.barHeight, - nativeBarWidth: d.nativeBarWidth, - gutterWidth: gutterW - }; - } - - function NativeScrollbars(place, scroll, cm) { - this.cm = cm; - var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); - var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); - place(vert); place(horiz); - - on(vert, "scroll", function() { - if (vert.clientHeight) scroll(vert.scrollTop, "vertical"); - }); - on(horiz, "scroll", function() { - if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal"); - }); - - this.checkedZeroWidth = false; - // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; - } - - NativeScrollbars.prototype = copyObj({ - update: function(measure) { - var needsH = measure.scrollWidth > measure.clientWidth + 1; - var needsV = measure.scrollHeight > measure.clientHeight + 1; - var sWidth = measure.nativeBarWidth; - - if (needsV) { - this.vert.style.display = "block"; - this.vert.style.bottom = needsH ? sWidth + "px" : "0"; - var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); - // A bug in IE8 can cause this value to be negative, so guard it. - this.vert.firstChild.style.height = - Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; - } else { - this.vert.style.display = ""; - this.vert.firstChild.style.height = "0"; - } - - if (needsH) { - this.horiz.style.display = "block"; - this.horiz.style.right = needsV ? sWidth + "px" : "0"; - this.horiz.style.left = measure.barLeft + "px"; - var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); - this.horiz.firstChild.style.width = - (measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; - } else { - this.horiz.style.display = ""; - this.horiz.firstChild.style.width = "0"; - } - - if (!this.checkedZeroWidth && measure.clientHeight > 0) { - if (sWidth == 0) this.zeroWidthHack(); - this.checkedZeroWidth = true; - } - - return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}; - }, - setScrollLeft: function(pos) { - if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos; - if (this.disableHoriz) this.enableZeroWidthBar(this.horiz, this.disableHoriz); - }, - setScrollTop: function(pos) { - if (this.vert.scrollTop != pos) this.vert.scrollTop = pos; - if (this.disableVert) this.enableZeroWidthBar(this.vert, this.disableVert); - }, - zeroWidthHack: function() { - var w = mac && !mac_geMountainLion ? "12px" : "18px"; - this.horiz.style.height = this.vert.style.width = w; - this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; - this.disableHoriz = new Delayed; - this.disableVert = new Delayed; - }, - enableZeroWidthBar: function(bar, delay) { - bar.style.pointerEvents = "auto"; - function maybeDisable() { - // To find out whether the scrollbar is still visible, we - // check whether the element under the pixel in the bottom - // left corner of the scrollbar box is the scrollbar box - // itself (when the bar is still visible) or its filler child - // (when the bar is hidden). If it is still visible, we keep - // it enabled, if it's hidden, we disable pointer events. - var box = bar.getBoundingClientRect(); - var elt = document.elementFromPoint(box.left + 1, box.bottom - 1); - if (elt != bar) bar.style.pointerEvents = "none"; - else delay.set(1000, maybeDisable); - } - delay.set(1000, maybeDisable); - }, - clear: function() { - var parent = this.horiz.parentNode; - parent.removeChild(this.horiz); - parent.removeChild(this.vert); - } - }, NativeScrollbars.prototype); - - function NullScrollbars() {} - - NullScrollbars.prototype = copyObj({ - update: function() { return {bottom: 0, right: 0}; }, - setScrollLeft: function() {}, - setScrollTop: function() {}, - clear: function() {} - }, NullScrollbars.prototype); - - CodeMirror.scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; - - function initScrollbars(cm) { - if (cm.display.scrollbars) { - cm.display.scrollbars.clear(); - if (cm.display.scrollbars.addClass) - rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); - } - - cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) { - cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); - // Prevent clicks in the scrollbars from killing focus - on(node, "mousedown", function() { - if (cm.state.focused) setTimeout(function() { cm.display.input.focus(); }, 0); - }); - node.setAttribute("cm-not-content", "true"); - }, function(pos, axis) { - if (axis == "horizontal") setScrollLeft(cm, pos); - else setScrollTop(cm, pos); - }, cm); - if (cm.display.scrollbars.addClass) - addClass(cm.display.wrapper, cm.display.scrollbars.addClass); - } - - function updateScrollbars(cm, measure) { - if (!measure) measure = measureForScrollbars(cm); - var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; - updateScrollbarsInner(cm, measure); - for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { - if (startWidth != cm.display.barWidth && cm.options.lineWrapping) - updateHeightsInViewport(cm); - updateScrollbarsInner(cm, measureForScrollbars(cm)); - startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; - } - } - - // Re-synchronize the fake scrollbars with the actual size of the - // content. - function updateScrollbarsInner(cm, measure) { - var d = cm.display; - var sizes = d.scrollbars.update(measure); - - d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; - d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; - d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent" - - if (sizes.right && sizes.bottom) { - d.scrollbarFiller.style.display = "block"; - d.scrollbarFiller.style.height = sizes.bottom + "px"; - d.scrollbarFiller.style.width = sizes.right + "px"; - } else d.scrollbarFiller.style.display = ""; - if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { - d.gutterFiller.style.display = "block"; - d.gutterFiller.style.height = sizes.bottom + "px"; - d.gutterFiller.style.width = measure.gutterWidth + "px"; - } else d.gutterFiller.style.display = ""; - } - - // Compute the lines that are visible in a given viewport (defaults - // the the current scroll position). viewport may contain top, - // height, and ensure (see op.scrollToPos) properties. - function visibleLines(display, doc, viewport) { - var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; - top = Math.floor(top - paddingTop(display)); - var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; - - var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); - // Ensure is a {from: {line, ch}, to: {line, ch}} object, and - // forces those lines into the viewport (if possible). - if (viewport && viewport.ensure) { - var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; - if (ensureFrom < from) { - from = ensureFrom; - to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); - } else if (Math.min(ensureTo, doc.lastLine()) >= to) { - from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); - to = ensureTo; - } - } - return {from: from, to: Math.max(to, from + 1)}; - } - - // LINE NUMBERS - - // Re-align line numbers and gutter marks to compensate for - // horizontal scrolling. - function alignHorizontally(cm) { - var display = cm.display, view = display.view; - if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; - var gutterW = display.gutters.offsetWidth, left = comp + "px"; - for (var i = 0; i < view.length; i++) if (!view[i].hidden) { - if (cm.options.fixedGutter) { - if (view[i].gutter) - view[i].gutter.style.left = left; - if (view[i].gutterBackground) - view[i].gutterBackground.style.left = left; - } - var align = view[i].alignable; - if (align) for (var j = 0; j < align.length; j++) - align[j].style.left = left; - } - if (cm.options.fixedGutter) - display.gutters.style.left = (comp + gutterW) + "px"; - } - - // Used to ensure that the line number gutter is still the right - // size for the current document size. Returns true when an update - // is needed. - function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) return false; - var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], - "CodeMirror-linenumber CodeMirror-gutter-elt")); - var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; - display.lineGutter.style.width = ""; - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; - display.lineNumWidth = display.lineNumInnerWidth + padding; - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; - display.lineGutter.style.width = display.lineNumWidth + "px"; - updateGutterSpace(cm); - return true; - } - return false; - } - - function lineNumberFor(options, i) { - return String(options.lineNumberFormatter(i + options.firstLineNumber)); - } - - // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, - // but using getBoundingClientRect to get a sub-pixel-accurate - // result. - function compensateForHScroll(display) { - return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; - } - - // DISPLAY DRAWING - - function DisplayUpdate(cm, viewport, force) { - var display = cm.display; - - this.viewport = viewport; - // Store some values that we'll need later (but don't want to force a relayout for) - this.visible = visibleLines(display, cm.doc, viewport); - this.editorIsHidden = !display.wrapper.offsetWidth; - this.wrapperHeight = display.wrapper.clientHeight; - this.wrapperWidth = display.wrapper.clientWidth; - this.oldDisplayWidth = displayWidth(cm); - this.force = force; - this.dims = getDimensions(cm); - this.events = []; - } - - DisplayUpdate.prototype.signal = function(emitter, type) { - if (hasHandler(emitter, type)) - this.events.push(arguments); - }; - DisplayUpdate.prototype.finish = function() { - for (var i = 0; i < this.events.length; i++) - signal.apply(null, this.events[i]); - }; - - function maybeClipScrollbars(cm) { - var display = cm.display; - if (!display.scrollbarsClipped && display.scroller.offsetWidth) { - display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; - display.heightForcer.style.height = scrollGap(cm) + "px"; - display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; - display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; - display.scrollbarsClipped = true; - } - } - - // Does the actual updating of the line display. Bails out - // (returning false) when there is nothing to be done and forced is - // false. - function updateDisplayIfNeeded(cm, update) { - var display = cm.display, doc = cm.doc; - - if (update.editorIsHidden) { - resetView(cm); - return false; - } - - // Bail out if the visible area is already rendered and nothing changed. - if (!update.force && - update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && - display.renderedView == display.view && countDirtyView(cm) == 0) - return false; - - if (maybeUpdateLineNumberWidth(cm)) { - resetView(cm); - update.dims = getDimensions(cm); - } - - // Compute a suitable new viewport (from & to) - var end = doc.first + doc.size; - var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); - var to = Math.min(end, update.visible.to + cm.options.viewportMargin); - if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom); - if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo); - if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from); - to = visualLineEndNo(cm.doc, to); - } - - var different = from != display.viewFrom || to != display.viewTo || - display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; - adjustView(cm, from, to); - - display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); - // Position the mover div to align with the current scroll position - cm.display.mover.style.top = display.viewOffset + "px"; - - var toUpdate = countDirtyView(cm); - if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) - return false; - - // For big changes, we hide the enclosing element during the - // update, since that speeds up the operations on most browsers. - var focused = activeElt(); - if (toUpdate > 4) display.lineDiv.style.display = "none"; - patchDisplay(cm, display.updateLineNumbers, update.dims); - if (toUpdate > 4) display.lineDiv.style.display = ""; - display.renderedView = display.view; - // There might have been a widget with a focused element that got - // hidden or updated, if so re-focus it. - if (focused && activeElt() != focused && focused.offsetHeight) focused.focus(); - - // Prevent selection and cursors from interfering with the scroll - // width and height. - removeChildren(display.cursorDiv); - removeChildren(display.selectionDiv); - display.gutters.style.height = display.sizer.style.minHeight = 0; - - if (different) { - display.lastWrapHeight = update.wrapperHeight; - display.lastWrapWidth = update.wrapperWidth; - startWorker(cm, 400); - } - - display.updateLineNumbers = null; - - return true; - } - - function postUpdateDisplay(cm, update) { - var viewport = update.viewport; - - for (var first = true;; first = false) { - if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { - // Clip forced viewport to actual scrollable area. - if (viewport && viewport.top != null) - viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; - // Updated line heights might result in the drawn area not - // actually covering the viewport. Keep looping until it does. - update.visible = visibleLines(cm.display, cm.doc, viewport); - if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) - break; - } - if (!updateDisplayIfNeeded(cm, update)) break; - updateHeightsInViewport(cm); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - updateScrollbars(cm, barMeasure); - setDocumentHeight(cm, barMeasure); - } - - update.signal(cm, "update", cm); - if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { - update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); - cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; - } - } - - function updateDisplaySimple(cm, viewport) { - var update = new DisplayUpdate(cm, viewport); - if (updateDisplayIfNeeded(cm, update)) { - updateHeightsInViewport(cm); - postUpdateDisplay(cm, update); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - updateScrollbars(cm, barMeasure); - setDocumentHeight(cm, barMeasure); - update.finish(); - } - } - - function setDocumentHeight(cm, measure) { - cm.display.sizer.style.minHeight = measure.docHeight + "px"; - cm.display.heightForcer.style.top = measure.docHeight + "px"; - cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"; - } - - // Read the actual heights of the rendered lines, and update their - // stored heights to match. - function updateHeightsInViewport(cm) { - var display = cm.display; - var prevBottom = display.lineDiv.offsetTop; - for (var i = 0; i < display.view.length; i++) { - var cur = display.view[i], height; - if (cur.hidden) continue; - if (ie && ie_version < 8) { - var bot = cur.node.offsetTop + cur.node.offsetHeight; - height = bot - prevBottom; - prevBottom = bot; - } else { - var box = cur.node.getBoundingClientRect(); - height = box.bottom - box.top; - } - var diff = cur.line.height - height; - if (height < 2) height = textHeight(display); - if (diff > .001 || diff < -.001) { - updateLineHeight(cur.line, height); - updateWidgetHeight(cur.line); - if (cur.rest) for (var j = 0; j < cur.rest.length; j++) - updateWidgetHeight(cur.rest[j]); - } - } - } - - // Read and store the height of line widgets associated with the - // given line. - function updateWidgetHeight(line) { - if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) - line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; - } - - // Do a bulk-read of the DOM positions and sizes needed to draw the - // view, so that we don't interleave reading and writing to the DOM. - function getDimensions(cm) { - var d = cm.display, left = {}, width = {}; - var gutterLeft = d.gutters.clientLeft; - for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { - left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; - width[cm.options.gutters[i]] = n.clientWidth; - } - return {fixedPos: compensateForHScroll(d), - gutterTotalWidth: d.gutters.offsetWidth, - gutterLeft: left, - gutterWidth: width, - wrapperWidth: d.wrapper.clientWidth}; - } - - // Sync the actual display DOM structure with display.view, removing - // nodes for lines that are no longer in view, and creating the ones - // that are not there yet, and updating the ones that are out of - // date. - function patchDisplay(cm, updateNumbersFrom, dims) { - var display = cm.display, lineNumbers = cm.options.lineNumbers; - var container = display.lineDiv, cur = container.firstChild; - - function rm(node) { - var next = node.nextSibling; - // Works around a throw-scroll bug in OS X Webkit - if (webkit && mac && cm.display.currentWheelTarget == node) - node.style.display = "none"; - else - node.parentNode.removeChild(node); - return next; - } - - var view = display.view, lineN = display.viewFrom; - // Loop over the elements in the view, syncing cur (the DOM nodes - // in display.lineDiv) with the view as we go. - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (lineView.hidden) { - } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet - var node = buildLineElement(cm, lineView, lineN, dims); - container.insertBefore(node, cur); - } else { // Already drawn - while (cur != lineView.node) cur = rm(cur); - var updateNumber = lineNumbers && updateNumbersFrom != null && - updateNumbersFrom <= lineN && lineView.lineNumber; - if (lineView.changes) { - if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false; - updateLineForChanges(cm, lineView, lineN, dims); - } - if (updateNumber) { - removeChildren(lineView.lineNumber); - lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); - } - cur = lineView.node.nextSibling; - } - lineN += lineView.size; - } - while (cur) cur = rm(cur); - } - - // When an aspect of a line changes, a string is added to - // lineView.changes. This updates the relevant part of the line's - // DOM structure. - function updateLineForChanges(cm, lineView, lineN, dims) { - for (var j = 0; j < lineView.changes.length; j++) { - var type = lineView.changes[j]; - if (type == "text") updateLineText(cm, lineView); - else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims); - else if (type == "class") updateLineClasses(lineView); - else if (type == "widget") updateLineWidgets(cm, lineView, dims); - } - lineView.changes = null; - } - - // Lines with gutter elements, widgets or a background class need to - // be wrapped, and have the extra elements added to the wrapper div - function ensureLineWrapped(lineView) { - if (lineView.node == lineView.text) { - lineView.node = elt("div", null, null, "position: relative"); - if (lineView.text.parentNode) - lineView.text.parentNode.replaceChild(lineView.node, lineView.text); - lineView.node.appendChild(lineView.text); - if (ie && ie_version < 8) lineView.node.style.zIndex = 2; - } - return lineView.node; - } - - function updateLineBackground(lineView) { - var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; - if (cls) cls += " CodeMirror-linebackground"; - if (lineView.background) { - if (cls) lineView.background.className = cls; - else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } - } else if (cls) { - var wrap = ensureLineWrapped(lineView); - lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); - } - } - - // Wrapper around buildLineContent which will reuse the structure - // in display.externalMeasured when possible. - function getLineContent(cm, lineView) { - var ext = cm.display.externalMeasured; - if (ext && ext.line == lineView.line) { - cm.display.externalMeasured = null; - lineView.measure = ext.measure; - return ext.built; - } - return buildLineContent(cm, lineView); - } - - // Redraw the line's text. Interacts with the background and text - // classes because the mode may output tokens that influence these - // classes. - function updateLineText(cm, lineView) { - var cls = lineView.text.className; - var built = getLineContent(cm, lineView); - if (lineView.text == lineView.node) lineView.node = built.pre; - lineView.text.parentNode.replaceChild(built.pre, lineView.text); - lineView.text = built.pre; - if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { - lineView.bgClass = built.bgClass; - lineView.textClass = built.textClass; - updateLineClasses(lineView); - } else if (cls) { - lineView.text.className = cls; - } - } - - function updateLineClasses(lineView) { - updateLineBackground(lineView); - if (lineView.line.wrapClass) - ensureLineWrapped(lineView).className = lineView.line.wrapClass; - else if (lineView.node != lineView.text) - lineView.node.className = ""; - var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; - lineView.text.className = textClass || ""; - } - - function updateLineGutter(cm, lineView, lineN, dims) { - if (lineView.gutter) { - lineView.node.removeChild(lineView.gutter); - lineView.gutter = null; - } - if (lineView.gutterBackground) { - lineView.node.removeChild(lineView.gutterBackground); - lineView.gutterBackground = null; - } - if (lineView.line.gutterClass) { - var wrap = ensureLineWrapped(lineView); - lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, - "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + - "px; width: " + dims.gutterTotalWidth + "px"); - wrap.insertBefore(lineView.gutterBackground, lineView.text); - } - var markers = lineView.line.gutterMarkers; - if (cm.options.lineNumbers || markers) { - var wrap = ensureLineWrapped(lineView); - var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + - (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"); - cm.display.input.setUneditable(gutterWrap); - wrap.insertBefore(gutterWrap, lineView.text); - if (lineView.line.gutterClass) - gutterWrap.className += " " + lineView.line.gutterClass; - if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) - lineView.lineNumber = gutterWrap.appendChild( - elt("div", lineNumberFor(cm.options, lineN), - "CodeMirror-linenumber CodeMirror-gutter-elt", - "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " - + cm.display.lineNumInnerWidth + "px")); - if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) { - var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; - if (found) - gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + - dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); - } - } - } - - function updateLineWidgets(cm, lineView, dims) { - if (lineView.alignable) lineView.alignable = null; - for (var node = lineView.node.firstChild, next; node; node = next) { - var next = node.nextSibling; - if (node.className == "CodeMirror-linewidget") - lineView.node.removeChild(node); - } - insertLineWidgets(cm, lineView, dims); - } - - // Build a line's DOM representation from scratch - function buildLineElement(cm, lineView, lineN, dims) { - var built = getLineContent(cm, lineView); - lineView.text = lineView.node = built.pre; - if (built.bgClass) lineView.bgClass = built.bgClass; - if (built.textClass) lineView.textClass = built.textClass; - - updateLineClasses(lineView); - updateLineGutter(cm, lineView, lineN, dims); - insertLineWidgets(cm, lineView, dims); - return lineView.node; - } - - // A lineView may contain multiple logical lines (when merged by - // collapsed spans). The widgets for all of them need to be drawn. - function insertLineWidgets(cm, lineView, dims) { - insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); - if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) - insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); - } - - function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { - if (!line.widgets) return; - var wrap = ensureLineWrapped(lineView); - for (var i = 0, ws = line.widgets; i < ws.length; ++i) { - var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); - if (!widget.handleMouseEvents) node.setAttribute("cm-ignore-events", "true"); - positionLineWidget(widget, node, lineView, dims); - cm.display.input.setUneditable(node); - if (allowAbove && widget.above) - wrap.insertBefore(node, lineView.gutter || lineView.text); - else - wrap.appendChild(node); - signalLater(widget, "redraw"); - } - } - - function positionLineWidget(widget, node, lineView, dims) { - if (widget.noHScroll) { - (lineView.alignable || (lineView.alignable = [])).push(node); - var width = dims.wrapperWidth; - node.style.left = dims.fixedPos + "px"; - if (!widget.coverGutter) { - width -= dims.gutterTotalWidth; - node.style.paddingLeft = dims.gutterTotalWidth + "px"; - } - node.style.width = width + "px"; - } - if (widget.coverGutter) { - node.style.zIndex = 5; - node.style.position = "relative"; - if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px"; - } - } - - // POSITION OBJECT - - // A Pos instance represents a position within the text. - var Pos = CodeMirror.Pos = function(line, ch) { - if (!(this instanceof Pos)) return new Pos(line, ch); - this.line = line; this.ch = ch; - }; - - // Compare two positions, return 0 if they are the same, a negative - // number when a is less, and a positive number otherwise. - var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; }; - - function copyPos(x) {return Pos(x.line, x.ch);} - function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; } - function minPos(a, b) { return cmp(a, b) < 0 ? a : b; } - - // INPUT HANDLING - - function ensureFocus(cm) { - if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); } - } - - // This will be set to a {lineWise: bool, text: [string]} object, so - // that, when pasting, we know what kind of selections the copied - // text was made out of. - var lastCopied = null; - - function applyTextInput(cm, inserted, deleted, sel, origin) { - var doc = cm.doc; - cm.display.shift = false; - if (!sel) sel = doc.sel; - - var paste = cm.state.pasteIncoming || origin == "paste"; - var textLines = doc.splitLines(inserted), multiPaste = null - // When pasing N lines into N selections, insert one line per selection - if (paste && sel.ranges.length > 1) { - if (lastCopied && lastCopied.text.join("\n") == inserted) { - if (sel.ranges.length % lastCopied.text.length == 0) { - multiPaste = []; - for (var i = 0; i < lastCopied.text.length; i++) - multiPaste.push(doc.splitLines(lastCopied.text[i])); - } - } else if (textLines.length == sel.ranges.length) { - multiPaste = map(textLines, function(l) { return [l]; }); - } - } - - // Normal behavior is to insert the new text into every selection - for (var i = sel.ranges.length - 1; i >= 0; i--) { - var range = sel.ranges[i]; - var from = range.from(), to = range.to(); - if (range.empty()) { - if (deleted && deleted > 0) // Handle deletion - from = Pos(from.line, from.ch - deleted); - else if (cm.state.overwrite && !paste) // Handle overwrite - to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); - else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) - from = to = Pos(from.line, 0) - } - var updateInput = cm.curOp.updateInput; - var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, - origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}; - makeChange(cm.doc, changeEvent); - signalLater(cm, "inputRead", cm, changeEvent); - } - if (inserted && !paste) - triggerElectric(cm, inserted); - - ensureCursorVisible(cm); - cm.curOp.updateInput = updateInput; - cm.curOp.typing = true; - cm.state.pasteIncoming = cm.state.cutIncoming = false; - } - - function handlePaste(e, cm) { - var pasted = e.clipboardData && e.clipboardData.getData("Text"); - if (pasted) { - e.preventDefault(); - if (!cm.isReadOnly() && !cm.options.disableInput) - runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); }); - return true; - } - } - - function triggerElectric(cm, inserted) { - // When an 'electric' character is inserted, immediately trigger a reindent - if (!cm.options.electricChars || !cm.options.smartIndent) return; - var sel = cm.doc.sel; - - for (var i = sel.ranges.length - 1; i >= 0; i--) { - var range = sel.ranges[i]; - if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue; - var mode = cm.getModeAt(range.head); - var indented = false; - if (mode.electricChars) { - for (var j = 0; j < mode.electricChars.length; j++) - if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indented = indentLine(cm, range.head.line, "smart"); - break; - } - } else if (mode.electricInput) { - if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) - indented = indentLine(cm, range.head.line, "smart"); - } - if (indented) signalLater(cm, "electricInput", cm, range.head.line); - } - } - - function copyableRanges(cm) { - var text = [], ranges = []; - for (var i = 0; i < cm.doc.sel.ranges.length; i++) { - var line = cm.doc.sel.ranges[i].head.line; - var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; - ranges.push(lineRange); - text.push(cm.getRange(lineRange.anchor, lineRange.head)); - } - return {text: text, ranges: ranges}; - } - - function disableBrowserMagic(field, spellcheck) { - field.setAttribute("autocorrect", "off"); - field.setAttribute("autocapitalize", "off"); - field.setAttribute("spellcheck", !!spellcheck); - } - - // TEXTAREA INPUT STYLE - - function TextareaInput(cm) { - this.cm = cm; - // See input.poll and input.reset - this.prevInput = ""; - - // Flag that indicates whether we expect input to appear real soon - // now (after some event like 'keypress' or 'input') and are - // polling intensively. - this.pollingFast = false; - // Self-resetting timeout for the poller - this.polling = new Delayed(); - // Tracks when input.reset has punted to just putting a short - // string into the textarea instead of the full selection. - this.inaccurateSelection = false; - // Used to work around IE issue with selection being forgotten when focus moves away from textarea - this.hasSelection = false; - this.composing = null; - }; - - function hiddenTextarea() { - var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"); - var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); - // The textarea is kept positioned near the cursor to prevent the - // fact that it'll be scrolled into view on input from scrolling - // our fake cursor out of view. On webkit, when wrap=off, paste is - // very slow. So make the area wide instead. - if (webkit) te.style.width = "1000px"; - else te.setAttribute("wrap", "off"); - // If border: 0; -- iOS fails to open keyboard (issue #1287) - if (ios) te.style.border = "1px solid black"; - disableBrowserMagic(te); - return div; - } - - TextareaInput.prototype = copyObj({ - init: function(display) { - var input = this, cm = this.cm; - - // Wraps and hides input textarea - var div = this.wrapper = hiddenTextarea(); - // The semihidden textarea that is focused when the editor is - // focused, and receives input. - var te = this.textarea = div.firstChild; - display.wrapper.insertBefore(div, display.wrapper.firstChild); - - // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) - if (ios) te.style.width = "0px"; - - on(te, "input", function() { - if (ie && ie_version >= 9 && input.hasSelection) input.hasSelection = null; - input.poll(); - }); - - on(te, "paste", function(e) { - if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return - - cm.state.pasteIncoming = true; - input.fastPoll(); - }); - - function prepareCopyCut(e) { - if (signalDOMEvent(cm, e)) return - if (cm.somethingSelected()) { - lastCopied = {lineWise: false, text: cm.getSelections()}; - if (input.inaccurateSelection) { - input.prevInput = ""; - input.inaccurateSelection = false; - te.value = lastCopied.text.join("\n"); - selectInput(te); - } - } else if (!cm.options.lineWiseCopyCut) { - return; - } else { - var ranges = copyableRanges(cm); - lastCopied = {lineWise: true, text: ranges.text}; - if (e.type == "cut") { - cm.setSelections(ranges.ranges, null, sel_dontScroll); - } else { - input.prevInput = ""; - te.value = ranges.text.join("\n"); - selectInput(te); - } - } - if (e.type == "cut") cm.state.cutIncoming = true; - } - on(te, "cut", prepareCopyCut); - on(te, "copy", prepareCopyCut); - - on(display.scroller, "paste", function(e) { - if (eventInWidget(display, e) || signalDOMEvent(cm, e)) return; - cm.state.pasteIncoming = true; - input.focus(); - }); - - // Prevent normal selection in the editor (we handle our own) - on(display.lineSpace, "selectstart", function(e) { - if (!eventInWidget(display, e)) e_preventDefault(e); - }); - - on(te, "compositionstart", function() { - var start = cm.getCursor("from"); - if (input.composing) input.composing.range.clear() - input.composing = { - start: start, - range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) - }; - }); - on(te, "compositionend", function() { - if (input.composing) { - input.poll(); - input.composing.range.clear(); - input.composing = null; - } - }); - }, - - prepareSelection: function() { - // Redraw the selection and/or cursor - var cm = this.cm, display = cm.display, doc = cm.doc; - var result = prepareSelection(cm); - - // Move the hidden textarea near the cursor to prevent scrolling artifacts - if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); - var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); - result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)); - result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)); - } - - return result; - }, - - showSelection: function(drawn) { - var cm = this.cm, display = cm.display; - removeChildrenAndAdd(display.cursorDiv, drawn.cursors); - removeChildrenAndAdd(display.selectionDiv, drawn.selection); - if (drawn.teTop != null) { - this.wrapper.style.top = drawn.teTop + "px"; - this.wrapper.style.left = drawn.teLeft + "px"; - } - }, - - // Reset the input to correspond to the selection (or to be empty, - // when not typing and nothing is selected) - reset: function(typing) { - if (this.contextMenuPending) return; - var minimal, selected, cm = this.cm, doc = cm.doc; - if (cm.somethingSelected()) { - this.prevInput = ""; - var range = doc.sel.primary(); - minimal = hasCopyEvent && - (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000); - var content = minimal ? "-" : selected || cm.getSelection(); - this.textarea.value = content; - if (cm.state.focused) selectInput(this.textarea); - if (ie && ie_version >= 9) this.hasSelection = content; - } else if (!typing) { - this.prevInput = this.textarea.value = ""; - if (ie && ie_version >= 9) this.hasSelection = null; - } - this.inaccurateSelection = minimal; - }, - - getField: function() { return this.textarea; }, - - supportsTouch: function() { return false; }, - - focus: function() { - if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { - try { this.textarea.focus(); } - catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM - } - }, - - blur: function() { this.textarea.blur(); }, - - resetPosition: function() { - this.wrapper.style.top = this.wrapper.style.left = 0; - }, - - receivedFocus: function() { this.slowPoll(); }, - - // Poll for input changes, using the normal rate of polling. This - // runs as long as the editor is focused. - slowPoll: function() { - var input = this; - if (input.pollingFast) return; - input.polling.set(this.cm.options.pollInterval, function() { - input.poll(); - if (input.cm.state.focused) input.slowPoll(); - }); - }, - - // When an event has just come in that is likely to add or change - // something in the input textarea, we poll faster, to ensure that - // the change appears on the screen quickly. - fastPoll: function() { - var missed = false, input = this; - input.pollingFast = true; - function p() { - var changed = input.poll(); - if (!changed && !missed) {missed = true; input.polling.set(60, p);} - else {input.pollingFast = false; input.slowPoll();} - } - input.polling.set(20, p); - }, - - // Read input from the textarea, and update the document to match. - // When something is selected, it is present in the textarea, and - // selected (unless it is huge, in which case a placeholder is - // used). When nothing is selected, the cursor sits after previously - // seen text (can be empty), which is stored in prevInput (we must - // not reset the textarea when typing, because that breaks IME). - poll: function() { - var cm = this.cm, input = this.textarea, prevInput = this.prevInput; - // Since this is called a *lot*, try to bail out as cheaply as - // possible when it is clear that nothing happened. hasSelection - // will be the case when there is a lot of text in the textarea, - // in which case reading its value would be expensive. - if (this.contextMenuPending || !cm.state.focused || - (hasSelection(input) && !prevInput && !this.composing) || - cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) - return false; - - var text = input.value; - // If nothing changed, bail. - if (text == prevInput && !cm.somethingSelected()) return false; - // Work around nonsensical selection resetting in IE9/10, and - // inexplicable appearance of private area unicode characters on - // some key combos in Mac (#2689). - if (ie && ie_version >= 9 && this.hasSelection === text || - mac && /[\uf700-\uf7ff]/.test(text)) { - cm.display.input.reset(); - return false; - } - - if (cm.doc.sel == cm.display.selForContextMenu) { - var first = text.charCodeAt(0); - if (first == 0x200b && !prevInput) prevInput = "\u200b"; - if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo"); } - } - // Find the part of the input that is actually new - var same = 0, l = Math.min(prevInput.length, text.length); - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; - - var self = this; - runInOp(cm, function() { - applyTextInput(cm, text.slice(same), prevInput.length - same, - null, self.composing ? "*compose" : null); - - // Don't leave long text in the textarea, since it makes further polling slow - if (text.length > 1000 || text.indexOf("\n") > -1) input.value = self.prevInput = ""; - else self.prevInput = text; - - if (self.composing) { - self.composing.range.clear(); - self.composing.range = cm.markText(self.composing.start, cm.getCursor("to"), - {className: "CodeMirror-composing"}); - } - }); - return true; - }, - - ensurePolled: function() { - if (this.pollingFast && this.poll()) this.pollingFast = false; - }, - - onKeyPress: function() { - if (ie && ie_version >= 9) this.hasSelection = null; - this.fastPoll(); - }, - - onContextMenu: function(e) { - var input = this, cm = input.cm, display = cm.display, te = input.textarea; - var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; - if (!pos || presto) return; // Opera is difficult. - - // Reset the current text selection only if the click is done outside of the selection - // and 'resetSelectionOnContextMenu' option is true. - var reset = cm.options.resetSelectionOnContextMenu; - if (reset && cm.doc.sel.contains(pos) == -1) - operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); - - var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText; - input.wrapper.style.cssText = "position: absolute" - var wrapperBox = input.wrapper.getBoundingClientRect() - te.style.cssText = "position: absolute; width: 30px; height: 30px; top: " + (e.clientY - wrapperBox.top - 5) + - "px; left: " + (e.clientX - wrapperBox.left - 5) + "px; z-index: 1000; background: " + - (ie ? "rgba(255, 255, 255, .05)" : "transparent") + - "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) - display.input.focus(); - if (webkit) window.scrollTo(null, oldScrollY); - display.input.reset(); - // Adds "Select all" to context menu in FF - if (!cm.somethingSelected()) te.value = input.prevInput = " "; - input.contextMenuPending = true; - display.selForContextMenu = cm.doc.sel; - clearTimeout(display.detectingSelectAll); - - // Select-all will be greyed out if there's nothing to select, so - // this adds a zero-width space so that we can later check whether - // it got selected. - function prepareSelectAllHack() { - if (te.selectionStart != null) { - var selected = cm.somethingSelected(); - var extval = "\u200b" + (selected ? te.value : ""); - te.value = "\u21da"; // Used to catch context-menu undo - te.value = extval; - input.prevInput = selected ? "" : "\u200b"; - te.selectionStart = 1; te.selectionEnd = extval.length; - // Re-set this, in case some other handler touched the - // selection in the meantime. - display.selForContextMenu = cm.doc.sel; - } - } - function rehide() { - input.contextMenuPending = false; - input.wrapper.style.cssText = oldWrapperCSS - te.style.cssText = oldCSS; - if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); - - // Try to detect the user choosing select-all - if (te.selectionStart != null) { - if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); - var i = 0, poll = function() { - if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && - te.selectionEnd > 0 && input.prevInput == "\u200b") - operation(cm, commands.selectAll)(cm); - else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); - else display.input.reset(); - }; - display.detectingSelectAll = setTimeout(poll, 200); - } - } - - if (ie && ie_version >= 9) prepareSelectAllHack(); - if (captureRightClick) { - e_stop(e); - var mouseup = function() { - off(window, "mouseup", mouseup); - setTimeout(rehide, 20); - }; - on(window, "mouseup", mouseup); - } else { - setTimeout(rehide, 50); - } - }, - - readOnlyChanged: function(val) { - if (!val) this.reset(); - }, - - setUneditable: nothing, - - needsContentAttribute: false - }, TextareaInput.prototype); - - // CONTENTEDITABLE INPUT STYLE - - function ContentEditableInput(cm) { - this.cm = cm; - this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; - this.polling = new Delayed(); - this.gracePeriod = false; - } - - ContentEditableInput.prototype = copyObj({ - init: function(display) { - var input = this, cm = input.cm; - var div = input.div = display.lineDiv; - disableBrowserMagic(div, cm.options.spellcheck); - - on(div, "paste", function(e) { - if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return - // IE doesn't fire input events, so we schedule a read for the pasted content in this way - if (ie_version <= 11) setTimeout(operation(cm, function() { - if (!input.pollContent()) regChange(cm); - }), 20) - }) - - on(div, "compositionstart", function(e) { - var data = e.data; - input.composing = {sel: cm.doc.sel, data: data, startData: data}; - if (!data) return; - var prim = cm.doc.sel.primary(); - var line = cm.getLine(prim.head.line); - var found = line.indexOf(data, Math.max(0, prim.head.ch - data.length)); - if (found > -1 && found <= prim.head.ch) - input.composing.sel = simpleSelection(Pos(prim.head.line, found), - Pos(prim.head.line, found + data.length)); - }); - on(div, "compositionupdate", function(e) { - input.composing.data = e.data; - }); - on(div, "compositionend", function(e) { - var ours = input.composing; - if (!ours) return; - if (e.data != ours.startData && !/\u200b/.test(e.data)) - ours.data = e.data; - // Need a small delay to prevent other code (input event, - // selection polling) from doing damage when fired right after - // compositionend. - setTimeout(function() { - if (!ours.handled) - input.applyComposition(ours); - if (input.composing == ours) - input.composing = null; - }, 50); - }); - - on(div, "touchstart", function() { - input.forceCompositionEnd(); - }); - - on(div, "input", function() { - if (input.composing) return; - if (cm.isReadOnly() || !input.pollContent()) - runInOp(input.cm, function() {regChange(cm);}); - }); - - function onCopyCut(e) { - if (signalDOMEvent(cm, e)) return - if (cm.somethingSelected()) { - lastCopied = {lineWise: false, text: cm.getSelections()}; - if (e.type == "cut") cm.replaceSelection("", null, "cut"); - } else if (!cm.options.lineWiseCopyCut) { - return; - } else { - var ranges = copyableRanges(cm); - lastCopied = {lineWise: true, text: ranges.text}; - if (e.type == "cut") { - cm.operation(function() { - cm.setSelections(ranges.ranges, 0, sel_dontScroll); - cm.replaceSelection("", null, "cut"); - }); - } - } - if (e.clipboardData) { - e.clipboardData.clearData(); - var content = lastCopied.text.join("\n") - // iOS exposes the clipboard API, but seems to discard content inserted into it - e.clipboardData.setData("Text", content); - if (e.clipboardData.getData("Text") == content) { - e.preventDefault(); - return - } - } - // Old-fashioned briefly-focus-a-textarea hack - var kludge = hiddenTextarea(), te = kludge.firstChild; - cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); - te.value = lastCopied.text.join("\n"); - var hadFocus = document.activeElement; - selectInput(te); - setTimeout(function() { - cm.display.lineSpace.removeChild(kludge); - hadFocus.focus(); - if (hadFocus == div) input.showPrimarySelection() - }, 50); - } - on(div, "copy", onCopyCut); - on(div, "cut", onCopyCut); - }, - - prepareSelection: function() { - var result = prepareSelection(this.cm, false); - result.focus = this.cm.state.focused; - return result; - }, - - showSelection: function(info, takeFocus) { - if (!info || !this.cm.display.view.length) return; - if (info.focus || takeFocus) this.showPrimarySelection(); - this.showMultipleSelections(info); - }, - - showPrimarySelection: function() { - var sel = window.getSelection(), prim = this.cm.doc.sel.primary(); - var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset); - var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset); - if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && - cmp(minPos(curAnchor, curFocus), prim.from()) == 0 && - cmp(maxPos(curAnchor, curFocus), prim.to()) == 0) - return; - - var start = posToDOM(this.cm, prim.from()); - var end = posToDOM(this.cm, prim.to()); - if (!start && !end) return; - - var view = this.cm.display.view; - var old = sel.rangeCount && sel.getRangeAt(0); - if (!start) { - start = {node: view[0].measure.map[2], offset: 0}; - } else if (!end) { // FIXME dangerously hacky - var measure = view[view.length - 1].measure; - var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; - end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}; - } - - try { var rng = range(start.node, start.offset, end.offset, end.node); } - catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible - if (rng) { - if (!gecko && this.cm.state.focused) { - sel.collapse(start.node, start.offset); - if (!rng.collapsed) sel.addRange(rng); - } else { - sel.removeAllRanges(); - sel.addRange(rng); - } - if (old && sel.anchorNode == null) sel.addRange(old); - else if (gecko) this.startGracePeriod(); - } - this.rememberSelection(); - }, - - startGracePeriod: function() { - var input = this; - clearTimeout(this.gracePeriod); - this.gracePeriod = setTimeout(function() { - input.gracePeriod = false; - if (input.selectionChanged()) - input.cm.operation(function() { input.cm.curOp.selectionChanged = true; }); - }, 20); - }, - - showMultipleSelections: function(info) { - removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); - removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); - }, - - rememberSelection: function() { - var sel = window.getSelection(); - this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; - this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; - }, - - selectionInEditor: function() { - var sel = window.getSelection(); - if (!sel.rangeCount) return false; - var node = sel.getRangeAt(0).commonAncestorContainer; - return contains(this.div, node); - }, - - focus: function() { - if (this.cm.options.readOnly != "nocursor") this.div.focus(); - }, - blur: function() { this.div.blur(); }, - getField: function() { return this.div; }, - - supportsTouch: function() { return true; }, - - receivedFocus: function() { - var input = this; - if (this.selectionInEditor()) - this.pollSelection(); - else - runInOp(this.cm, function() { input.cm.curOp.selectionChanged = true; }); - - function poll() { - if (input.cm.state.focused) { - input.pollSelection(); - input.polling.set(input.cm.options.pollInterval, poll); - } - } - this.polling.set(this.cm.options.pollInterval, poll); - }, - - selectionChanged: function() { - var sel = window.getSelection(); - return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || - sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; - }, - - pollSelection: function() { - if (!this.composing && !this.gracePeriod && this.selectionChanged()) { - var sel = window.getSelection(), cm = this.cm; - this.rememberSelection(); - var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var head = domToPos(cm, sel.focusNode, sel.focusOffset); - if (anchor && head) runInOp(cm, function() { - setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); - if (anchor.bad || head.bad) cm.curOp.selectionChanged = true; - }); - } - }, - - pollContent: function() { - var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); - var from = sel.from(), to = sel.to(); - if (from.line < display.viewFrom || to.line > display.viewTo - 1) return false; - - var fromIndex; - if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { - var fromLine = lineNo(display.view[0].line); - var fromNode = display.view[0].node; - } else { - var fromLine = lineNo(display.view[fromIndex].line); - var fromNode = display.view[fromIndex - 1].node.nextSibling; - } - var toIndex = findViewIndex(cm, to.line); - if (toIndex == display.view.length - 1) { - var toLine = display.viewTo - 1; - var toNode = display.lineDiv.lastChild; - } else { - var toLine = lineNo(display.view[toIndex + 1].line) - 1; - var toNode = display.view[toIndex + 1].node.previousSibling; - } - - var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); - var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); - while (newText.length > 1 && oldText.length > 1) { - if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } - else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } - else break; - } - - var cutFront = 0, cutEnd = 0; - var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); - while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) - ++cutFront; - var newBot = lst(newText), oldBot = lst(oldText); - var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), - oldBot.length - (oldText.length == 1 ? cutFront : 0)); - while (cutEnd < maxCutEnd && - newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) - ++cutEnd; - - newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd); - newText[0] = newText[0].slice(cutFront); - - var chFrom = Pos(fromLine, cutFront); - var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); - if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { - replaceRange(cm.doc, newText, chFrom, chTo, "+input"); - return true; - } - }, - - ensurePolled: function() { - this.forceCompositionEnd(); - }, - reset: function() { - this.forceCompositionEnd(); - }, - forceCompositionEnd: function() { - if (!this.composing || this.composing.handled) return; - this.applyComposition(this.composing); - this.composing.handled = true; - this.div.blur(); - this.div.focus(); - }, - applyComposition: function(composing) { - if (this.cm.isReadOnly()) - operation(this.cm, regChange)(this.cm) - else if (composing.data && composing.data != composing.startData) - operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel); - }, - - setUneditable: function(node) { - node.contentEditable = "false" - }, - - onKeyPress: function(e) { - e.preventDefault(); - if (!this.cm.isReadOnly()) - operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); - }, - - readOnlyChanged: function(val) { - this.div.contentEditable = String(val != "nocursor") - }, - - onContextMenu: nothing, - resetPosition: nothing, - - needsContentAttribute: true - }, ContentEditableInput.prototype); - - function posToDOM(cm, pos) { - var view = findViewForLine(cm, pos.line); - if (!view || view.hidden) return null; - var line = getLine(cm.doc, pos.line); - var info = mapFromLineView(view, line, pos.line); - - var order = getOrder(line), side = "left"; - if (order) { - var partPos = getBidiPartAt(order, pos.ch); - side = partPos % 2 ? "right" : "left"; - } - var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); - result.offset = result.collapse == "right" ? result.end : result.start; - return result; - } - - function badPos(pos, bad) { if (bad) pos.bad = true; return pos; } - - function domToPos(cm, node, offset) { - var lineNode; - if (node == cm.display.lineDiv) { - lineNode = cm.display.lineDiv.childNodes[offset]; - if (!lineNode) return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true); - node = null; offset = 0; - } else { - for (lineNode = node;; lineNode = lineNode.parentNode) { - if (!lineNode || lineNode == cm.display.lineDiv) return null; - if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) break; - } - } - for (var i = 0; i < cm.display.view.length; i++) { - var lineView = cm.display.view[i]; - if (lineView.node == lineNode) - return locateNodeInLineView(lineView, node, offset); - } - } - - function locateNodeInLineView(lineView, node, offset) { - var wrapper = lineView.text.firstChild, bad = false; - if (!node || !contains(wrapper, node)) return badPos(Pos(lineNo(lineView.line), 0), true); - if (node == wrapper) { - bad = true; - node = wrapper.childNodes[offset]; - offset = 0; - if (!node) { - var line = lineView.rest ? lst(lineView.rest) : lineView.line; - return badPos(Pos(lineNo(line), line.text.length), bad); - } - } - - var textNode = node.nodeType == 3 ? node : null, topNode = node; - if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { - textNode = node.firstChild; - if (offset) offset = textNode.nodeValue.length; - } - while (topNode.parentNode != wrapper) topNode = topNode.parentNode; - var measure = lineView.measure, maps = measure.maps; - - function find(textNode, topNode, offset) { - for (var i = -1; i < (maps ? maps.length : 0); i++) { - var map = i < 0 ? measure.map : maps[i]; - for (var j = 0; j < map.length; j += 3) { - var curNode = map[j + 2]; - if (curNode == textNode || curNode == topNode) { - var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); - var ch = map[j] + offset; - if (offset < 0 || curNode != textNode) ch = map[j + (offset ? 1 : 0)]; - return Pos(line, ch); - } - } - } - } - var found = find(textNode, topNode, offset); - if (found) return badPos(found, bad); - - // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems - for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { - found = find(after, after.firstChild, 0); - if (found) - return badPos(Pos(found.line, found.ch - dist), bad); - else - dist += after.textContent.length; - } - for (var before = topNode.previousSibling, dist = offset; before; before = before.previousSibling) { - found = find(before, before.firstChild, -1); - if (found) - return badPos(Pos(found.line, found.ch + dist), bad); - else - dist += before.textContent.length; - } - } - - function domTextBetween(cm, from, to, fromLine, toLine) { - var text = "", closing = false, lineSep = cm.doc.lineSeparator(); - function recognizeMarker(id) { return function(marker) { return marker.id == id; }; } - function walk(node) { - if (node.nodeType == 1) { - var cmText = node.getAttribute("cm-text"); - if (cmText != null) { - if (cmText == "") cmText = node.textContent.replace(/\u200b/g, ""); - text += cmText; - return; - } - var markerID = node.getAttribute("cm-marker"), range; - if (markerID) { - var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); - if (found.length && (range = found[0].find())) - text += getBetween(cm.doc, range.from, range.to).join(lineSep); - return; - } - if (node.getAttribute("contenteditable") == "false") return; - for (var i = 0; i < node.childNodes.length; i++) - walk(node.childNodes[i]); - if (/^(pre|div|p)$/i.test(node.nodeName)) - closing = true; - } else if (node.nodeType == 3) { - var val = node.nodeValue; - if (!val) return; - if (closing) { - text += lineSep; - closing = false; - } - text += val; - } - } - for (;;) { - walk(from); - if (from == to) break; - from = from.nextSibling; - } - return text; - } - - CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; - - // SELECTION / CURSOR - - // Selection objects are immutable. A new one is created every time - // the selection changes. A selection is one or more non-overlapping - // (and non-touching) ranges, sorted, and an integer that indicates - // which one is the primary selection (the one that's scrolled into - // view, that getCursor returns, etc). - function Selection(ranges, primIndex) { - this.ranges = ranges; - this.primIndex = primIndex; - } - - Selection.prototype = { - primary: function() { return this.ranges[this.primIndex]; }, - equals: function(other) { - if (other == this) return true; - if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false; - for (var i = 0; i < this.ranges.length; i++) { - var here = this.ranges[i], there = other.ranges[i]; - if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false; - } - return true; - }, - deepCopy: function() { - for (var out = [], i = 0; i < this.ranges.length; i++) - out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); - return new Selection(out, this.primIndex); - }, - somethingSelected: function() { - for (var i = 0; i < this.ranges.length; i++) - if (!this.ranges[i].empty()) return true; - return false; - }, - contains: function(pos, end) { - if (!end) end = pos; - for (var i = 0; i < this.ranges.length; i++) { - var range = this.ranges[i]; - if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) - return i; - } - return -1; - } - }; - - function Range(anchor, head) { - this.anchor = anchor; this.head = head; - } - - Range.prototype = { - from: function() { return minPos(this.anchor, this.head); }, - to: function() { return maxPos(this.anchor, this.head); }, - empty: function() { - return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; - } - }; - - // Take an unsorted, potentially overlapping set of ranges, and - // build a selection out of it. 'Consumes' ranges array (modifying - // it). - function normalizeSelection(ranges, primIndex) { - var prim = ranges[primIndex]; - ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); - primIndex = indexOf(ranges, prim); - for (var i = 1; i < ranges.length; i++) { - var cur = ranges[i], prev = ranges[i - 1]; - if (cmp(prev.to(), cur.from()) >= 0) { - var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); - var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; - if (i <= primIndex) --primIndex; - ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); - } - } - return new Selection(ranges, primIndex); - } - - function simpleSelection(anchor, head) { - return new Selection([new Range(anchor, head || anchor)], 0); - } - - // Most of the external API clips given positions to make sure they - // actually exist within the document. - function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} - function clipPos(doc, pos) { - if (pos.line < doc.first) return Pos(doc.first, 0); - var last = doc.first + doc.size - 1; - if (pos.line > last) return Pos(last, getLine(doc, last).text.length); - return clipToLen(pos, getLine(doc, pos.line).text.length); - } - function clipToLen(pos, linelen) { - var ch = pos.ch; - if (ch == null || ch > linelen) return Pos(pos.line, linelen); - else if (ch < 0) return Pos(pos.line, 0); - else return pos; - } - function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} - function clipPosArray(doc, array) { - for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); - return out; - } - - // SELECTION UPDATES - - // The 'scroll' parameter given to many of these indicated whether - // the new cursor position should be scrolled into view after - // modifying the selection. - - // If shift is held or the extend flag is set, extends a range to - // include a given position (and optionally a second position). - // Otherwise, simply returns the range between the given positions. - // Used for cursor motion and such. - function extendRange(doc, range, head, other) { - if (doc.cm && doc.cm.display.shift || doc.extend) { - var anchor = range.anchor; - if (other) { - var posBefore = cmp(head, anchor) < 0; - if (posBefore != (cmp(other, anchor) < 0)) { - anchor = head; - head = other; - } else if (posBefore != (cmp(head, other) < 0)) { - head = other; - } - } - return new Range(anchor, head); - } else { - return new Range(other || head, head); - } - } - - // Extend the primary selection range, discard the rest. - function extendSelection(doc, head, other, options) { - setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); - } - - // Extend all selections (pos is an array of selections with length - // equal the number of selections) - function extendSelections(doc, heads, options) { - for (var out = [], i = 0; i < doc.sel.ranges.length; i++) - out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); - var newSel = normalizeSelection(out, doc.sel.primIndex); - setSelection(doc, newSel, options); - } - - // Updates a single range in the selection. - function replaceOneSelection(doc, i, range, options) { - var ranges = doc.sel.ranges.slice(0); - ranges[i] = range; - setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); - } - - // Reset the selection to a single range. - function setSimpleSelection(doc, anchor, head, options) { - setSelection(doc, simpleSelection(anchor, head), options); - } - - // Give beforeSelectionChange handlers a change to influence a - // selection update. - function filterSelectionChange(doc, sel, options) { - var obj = { - ranges: sel.ranges, - update: function(ranges) { - this.ranges = []; - for (var i = 0; i < ranges.length; i++) - this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), - clipPos(doc, ranges[i].head)); - }, - origin: options && options.origin - }; - signal(doc, "beforeSelectionChange", doc, obj); - if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); - if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); - else return sel; - } - - function setSelectionReplaceHistory(doc, sel, options) { - var done = doc.history.done, last = lst(done); - if (last && last.ranges) { - done[done.length - 1] = sel; - setSelectionNoUndo(doc, sel, options); - } else { - setSelection(doc, sel, options); - } - } - - // Set a new selection. - function setSelection(doc, sel, options) { - setSelectionNoUndo(doc, sel, options); - addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); - } - - function setSelectionNoUndo(doc, sel, options) { - if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) - sel = filterSelectionChange(doc, sel, options); - - var bias = options && options.bias || - (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) - ensureCursorVisible(doc.cm); - } - - function setSelectionInner(doc, sel) { - if (sel.equals(doc.sel)) return; - - doc.sel = sel; - - if (doc.cm) { - doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; - signalCursorActivity(doc.cm); - } - signalLater(doc, "cursorActivity", doc); - } - - // Verify that the selection does not partially select any atomic - // marked ranges. - function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll); - } - - // Return a selection that does not partially select any atomic - // ranges. - function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; - var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); - var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear); - if (out || newAnchor != range.anchor || newHead != range.head) { - if (!out) out = sel.ranges.slice(0, i); - out[i] = new Range(newAnchor, newHead); - } - } - return out ? normalizeSelection(out, sel.primIndex) : sel; - } - - function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { - var line = getLine(doc, pos.line); - if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker; - if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && - (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter"); - if (m.explicitlyCleared) { - if (!line.markedSpans) break; - else {--i; continue;} - } - } - if (!m.atomic) continue; - - if (oldPos) { - var near = m.find(dir < 0 ? 1 : -1), diff; - if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) - near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); - if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) - return skipAtomicInner(doc, near, pos, dir, mayClear); - } - - var far = m.find(dir < 0 ? -1 : 1); - if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) - far = movePos(doc, far, dir, far.line == pos.line ? line : null); - return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null; - } - } - return pos; - } - - // Ensure a given position is not inside an atomic range. - function skipAtomic(doc, pos, oldPos, bias, mayClear) { - var dir = bias || 1; - var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || - (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || - skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || - (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)); - if (!found) { - doc.cantEdit = true; - return Pos(doc.first, 0); - } - return found; - } - - function movePos(doc, pos, dir, line) { - if (dir < 0 && pos.ch == 0) { - if (pos.line > doc.first) return clipPos(doc, Pos(pos.line - 1)); - else return null; - } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { - if (pos.line < doc.first + doc.size - 1) return Pos(pos.line + 1, 0); - else return null; - } else { - return new Pos(pos.line, pos.ch + dir); - } - } - - // SELECTION DRAWING - - function updateSelection(cm) { - cm.display.input.showSelection(cm.display.input.prepareSelection()); - } - - function prepareSelection(cm, primary) { - var doc = cm.doc, result = {}; - var curFragment = result.cursors = document.createDocumentFragment(); - var selFragment = result.selection = document.createDocumentFragment(); - - for (var i = 0; i < doc.sel.ranges.length; i++) { - if (primary === false && i == doc.sel.primIndex) continue; - var range = doc.sel.ranges[i]; - if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) continue; - var collapsed = range.empty(); - if (collapsed || cm.options.showCursorWhenSelecting) - drawSelectionCursor(cm, range.head, curFragment); - if (!collapsed) - drawSelectionRange(cm, range, selFragment); - } - return result; - } - - // Draws a cursor for the given range - function drawSelectionCursor(cm, head, output) { - var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); - - var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); - cursor.style.left = pos.left + "px"; - cursor.style.top = pos.top + "px"; - cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - - if (pos.other) { - // Secondary cursor, shown when on a 'jump' in bi-directional text - var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); - otherCursor.style.display = ""; - otherCursor.style.left = pos.other.left + "px"; - otherCursor.style.top = pos.other.top + "px"; - otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; - } - } - - // Draws the given range as a highlighted selection - function drawSelectionRange(cm, range, output) { - var display = cm.display, doc = cm.doc; - var fragment = document.createDocumentFragment(); - var padding = paddingH(cm.display), leftSide = padding.left; - var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; - - function add(left, top, width, bottom) { - if (top < 0) top = 0; - top = Math.round(top); - bottom = Math.round(bottom); - fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + - "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) + - "px; height: " + (bottom - top) + "px")); - } - - function drawForLine(line, fromArg, toArg) { - var lineObj = getLine(doc, line); - var lineLen = lineObj.text.length; - var start, end; - function coords(ch, bias) { - return charCoords(cm, Pos(line, ch), "div", lineObj, bias); - } - - iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { - var leftPos = coords(from, "left"), rightPos, left, right; - if (from == to) { - rightPos = leftPos; - left = right = leftPos.left; - } else { - rightPos = coords(to - 1, "right"); - if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; } - left = leftPos.left; - right = rightPos.right; - } - if (fromArg == null && from == 0) left = leftSide; - if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part - add(left, leftPos.top, null, leftPos.bottom); - left = leftSide; - if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); - } - if (toArg == null && to == lineLen) right = rightSide; - if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) - start = leftPos; - if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) - end = rightPos; - if (left < leftSide + 1) left = leftSide; - add(left, rightPos.top, right - left, rightPos.bottom); - }); - return {start: start, end: end}; - } - - var sFrom = range.from(), sTo = range.to(); - if (sFrom.line == sTo.line) { - drawForLine(sFrom.line, sFrom.ch, sTo.ch); - } else { - var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); - var singleVLine = visualLine(fromLine) == visualLine(toLine); - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; - var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; - if (singleVLine) { - if (leftEnd.top < rightStart.top - 2) { - add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); - add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); - } else { - add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); - } - } - if (leftEnd.bottom < rightStart.top) - add(leftSide, leftEnd.bottom, null, rightStart.top); - } - - output.appendChild(fragment); - } - - // Cursor-blinking - function restartBlink(cm) { - if (!cm.state.focused) return; - var display = cm.display; - clearInterval(display.blinker); - var on = true; - display.cursorDiv.style.visibility = ""; - if (cm.options.cursorBlinkRate > 0) - display.blinker = setInterval(function() { - display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; - }, cm.options.cursorBlinkRate); - else if (cm.options.cursorBlinkRate < 0) - display.cursorDiv.style.visibility = "hidden"; - } - - // HIGHLIGHT WORKER - - function startWorker(cm, time) { - if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo) - cm.state.highlight.set(time, bind(highlightWorker, cm)); - } - - function highlightWorker(cm) { - var doc = cm.doc; - if (doc.frontier < doc.first) doc.frontier = doc.first; - if (doc.frontier >= cm.display.viewTo) return; - var end = +new Date + cm.options.workTime; - var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); - var changedLines = []; - - doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { - if (doc.frontier >= cm.display.viewFrom) { // Visible - var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength; - var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true); - line.styles = highlighted.styles; - var oldCls = line.styleClasses, newCls = highlighted.classes; - if (newCls) line.styleClasses = newCls; - else if (oldCls) line.styleClasses = null; - var ischange = !oldStyles || oldStyles.length != line.styles.length || - oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); - for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; - if (ischange) changedLines.push(doc.frontier); - line.stateAfter = tooLong ? state : copyState(doc.mode, state); - } else { - if (line.text.length <= cm.options.maxHighlightLength) - processLine(cm, line.text, state); - line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null; - } - ++doc.frontier; - if (+new Date > end) { - startWorker(cm, cm.options.workDelay); - return true; - } - }); - if (changedLines.length) runInOp(cm, function() { - for (var i = 0; i < changedLines.length; i++) - regLineChange(cm, changedLines[i], "text"); - }); - } - - // Finds the line to start with when starting a parse. Tries to - // find a line with a stateAfter, so that it can start with a - // valid state. If that fails, it returns the line with the - // smallest indentation, which tends to need the least context to - // parse correctly. - function findStartLine(cm, n, precise) { - var minindent, minline, doc = cm.doc; - var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); - for (var search = n; search > lim; --search) { - if (search <= doc.first) return doc.first; - var line = getLine(doc, search - 1); - if (line.stateAfter && (!precise || search <= doc.frontier)) return search; - var indented = countColumn(line.text, null, cm.options.tabSize); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline; - } - - function getStateBefore(cm, n, precise) { - var doc = cm.doc, display = cm.display; - if (!doc.mode.startState) return true; - var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; - if (!state) state = startState(doc.mode); - else state = copyState(doc.mode, state); - doc.iter(pos, n, function(line) { - processLine(cm, line.text, state); - var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; - line.stateAfter = save ? copyState(doc.mode, state) : null; - ++pos; - }); - if (precise) doc.frontier = pos; - return state; - } - - // POSITION MEASUREMENT - - function paddingTop(display) {return display.lineSpace.offsetTop;} - function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;} - function paddingH(display) { - if (display.cachedPaddingH) return display.cachedPaddingH; - var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); - var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; - var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; - if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data; - return data; - } - - function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth; } - function displayWidth(cm) { - return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; - } - function displayHeight(cm) { - return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; - } - - // Ensure the lineView.wrapping.heights array is populated. This is - // an array of bottom offsets for the lines that make up a drawn - // line. When lineWrapping is on, there might be more than one - // height. - function ensureLineHeights(cm, lineView, rect) { - var wrapping = cm.options.lineWrapping; - var curWidth = wrapping && displayWidth(cm); - if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { - var heights = lineView.measure.heights = []; - if (wrapping) { - lineView.measure.width = curWidth; - var rects = lineView.text.firstChild.getClientRects(); - for (var i = 0; i < rects.length - 1; i++) { - var cur = rects[i], next = rects[i + 1]; - if (Math.abs(cur.bottom - next.bottom) > 2) - heights.push((cur.bottom + next.top) / 2 - rect.top); - } - } - heights.push(rect.bottom - rect.top); - } - } - - // Find a line map (mapping character offsets to text nodes) and a - // measurement cache for the given line number. (A line view might - // contain multiple lines when collapsed ranges are present.) - function mapFromLineView(lineView, line, lineN) { - if (lineView.line == line) - return {map: lineView.measure.map, cache: lineView.measure.cache}; - for (var i = 0; i < lineView.rest.length; i++) - if (lineView.rest[i] == line) - return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}; - for (var i = 0; i < lineView.rest.length; i++) - if (lineNo(lineView.rest[i]) > lineN) - return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}; - } - - // Render a line into the hidden node display.externalMeasured. Used - // when measurement is needed for a line that's not in the viewport. - function updateExternalMeasurement(cm, line) { - line = visualLine(line); - var lineN = lineNo(line); - var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); - view.lineN = lineN; - var built = view.built = buildLineContent(cm, view); - view.text = built.pre; - removeChildrenAndAdd(cm.display.lineMeasure, built.pre); - return view; - } - - // Get a {top, bottom, left, right} box (in line-local coordinates) - // for a given character. - function measureChar(cm, line, ch, bias) { - return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); - } - - // Find a line view that corresponds to the given line number. - function findViewForLine(cm, lineN) { - if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) - return cm.display.view[findViewIndex(cm, lineN)]; - var ext = cm.display.externalMeasured; - if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) - return ext; - } - - // Measurement can be split in two steps, the set-up work that - // applies to the whole line, and the measurement of the actual - // character. Functions like coordsChar, that need to do a lot of - // measurements in a row, can thus ensure that the set-up work is - // only done once. - function prepareMeasureForLine(cm, line) { - var lineN = lineNo(line); - var view = findViewForLine(cm, lineN); - if (view && !view.text) { - view = null; - } else if (view && view.changes) { - updateLineForChanges(cm, view, lineN, getDimensions(cm)); - cm.curOp.forceUpdate = true; - } - if (!view) - view = updateExternalMeasurement(cm, line); - - var info = mapFromLineView(view, line, lineN); - return { - line: line, view: view, rect: null, - map: info.map, cache: info.cache, before: info.before, - hasHeights: false - }; - } - - // Given a prepared measurement object, measures the position of an - // actual character (or fetches it from the cache). - function measureCharPrepared(cm, prepared, ch, bias, varHeight) { - if (prepared.before) ch = -1; - var key = ch + (bias || ""), found; - if (prepared.cache.hasOwnProperty(key)) { - found = prepared.cache[key]; - } else { - if (!prepared.rect) - prepared.rect = prepared.view.text.getBoundingClientRect(); - if (!prepared.hasHeights) { - ensureLineHeights(cm, prepared.view, prepared.rect); - prepared.hasHeights = true; - } - found = measureCharInner(cm, prepared, ch, bias); - if (!found.bogus) prepared.cache[key] = found; - } - return {left: found.left, right: found.right, - top: varHeight ? found.rtop : found.top, - bottom: varHeight ? found.rbottom : found.bottom}; - } - - var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; - - function nodeAndOffsetInLineMap(map, ch, bias) { - var node, start, end, collapse; - // First, search the line map for the text node corresponding to, - // or closest to, the target character. - for (var i = 0; i < map.length; i += 3) { - var mStart = map[i], mEnd = map[i + 1]; - if (ch < mStart) { - start = 0; end = 1; - collapse = "left"; - } else if (ch < mEnd) { - start = ch - mStart; - end = start + 1; - } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { - end = mEnd - mStart; - start = end - 1; - if (ch >= mEnd) collapse = "right"; - } - if (start != null) { - node = map[i + 2]; - if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) - collapse = bias; - if (bias == "left" && start == 0) - while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { - node = map[(i -= 3) + 2]; - collapse = "left"; - } - if (bias == "right" && start == mEnd - mStart) - while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { - node = map[(i += 3) + 2]; - collapse = "right"; - } - break; - } - } - return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}; - } - - function getUsefulRect(rects, bias) { - var rect = nullRect - if (bias == "left") for (var i = 0; i < rects.length; i++) { - if ((rect = rects[i]).left != rect.right) break - } else for (var i = rects.length - 1; i >= 0; i--) { - if ((rect = rects[i]).left != rect.right) break - } - return rect - } - - function measureCharInner(cm, prepared, ch, bias) { - var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); - var node = place.node, start = place.start, end = place.end, collapse = place.collapse; - - var rect; - if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. - for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned - while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) --start; - while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) ++end; - if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) - rect = node.parentNode.getBoundingClientRect(); - else - rect = getUsefulRect(range(node, start, end).getClientRects(), bias) - if (rect.left || rect.right || start == 0) break; - end = start; - start = start - 1; - collapse = "right"; - } - if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect); - } else { // If it is a widget, simply get the box for the whole widget. - if (start > 0) collapse = bias = "right"; - var rects; - if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) - rect = rects[bias == "right" ? rects.length - 1 : 0]; - else - rect = node.getBoundingClientRect(); - } - if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { - var rSpan = node.parentNode.getClientRects()[0]; - if (rSpan) - rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; - else - rect = nullRect; - } - - var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; - var mid = (rtop + rbot) / 2; - var heights = prepared.view.measure.heights; - for (var i = 0; i < heights.length - 1; i++) - if (mid < heights[i]) break; - var top = i ? heights[i - 1] : 0, bot = heights[i]; - var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, - right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, - top: top, bottom: bot}; - if (!rect.left && !rect.right) result.bogus = true; - if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } - - return result; - } - - // Work around problem with bounding client rects on ranges being - // returned incorrectly when zoomed on IE10 and below. - function maybeUpdateRectForZooming(measure, rect) { - if (!window.screen || screen.logicalXDPI == null || - screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) - return rect; - var scaleX = screen.logicalXDPI / screen.deviceXDPI; - var scaleY = screen.logicalYDPI / screen.deviceYDPI; - return {left: rect.left * scaleX, right: rect.right * scaleX, - top: rect.top * scaleY, bottom: rect.bottom * scaleY}; - } - - function clearLineMeasurementCacheFor(lineView) { - if (lineView.measure) { - lineView.measure.cache = {}; - lineView.measure.heights = null; - if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) - lineView.measure.caches[i] = {}; - } - } - - function clearLineMeasurementCache(cm) { - cm.display.externalMeasure = null; - removeChildren(cm.display.lineMeasure); - for (var i = 0; i < cm.display.view.length; i++) - clearLineMeasurementCacheFor(cm.display.view[i]); - } - - function clearCaches(cm) { - clearLineMeasurementCache(cm); - cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; - if (!cm.options.lineWrapping) cm.display.maxLineChanged = true; - cm.display.lineNumChars = null; - } - - function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; } - function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; } - - // Converts a {top, bottom, left, right} box from line-local - // coordinates into another coordinate system. Context may be one of - // "line", "div" (display.lineDiv), "local"/null (editor), "window", - // or "page". - function intoCoordSystem(cm, lineObj, rect, context) { - if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { - var size = widgetHeight(lineObj.widgets[i]); - rect.top += size; rect.bottom += size; - } - if (context == "line") return rect; - if (!context) context = "local"; - var yOff = heightAtLine(lineObj); - if (context == "local") yOff += paddingTop(cm.display); - else yOff -= cm.display.viewOffset; - if (context == "page" || context == "window") { - var lOff = cm.display.lineSpace.getBoundingClientRect(); - yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); - var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); - rect.left += xOff; rect.right += xOff; - } - rect.top += yOff; rect.bottom += yOff; - return rect; - } - - // Coverts a box from "div" coords to another coordinate system. - // Context may be "window", "page", "div", or "local"/null. - function fromCoordSystem(cm, coords, context) { - if (context == "div") return coords; - var left = coords.left, top = coords.top; - // First move into "page" coordinate system - if (context == "page") { - left -= pageScrollX(); - top -= pageScrollY(); - } else if (context == "local" || !context) { - var localBox = cm.display.sizer.getBoundingClientRect(); - left += localBox.left; - top += localBox.top; - } - - var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); - return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}; - } - - function charCoords(cm, pos, context, lineObj, bias) { - if (!lineObj) lineObj = getLine(cm.doc, pos.line); - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); - } - - // Returns a box for a given cursor position, which may have an - // 'other' property containing the position of the secondary cursor - // on a bidi boundary. - function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { - lineObj = lineObj || getLine(cm.doc, pos.line); - if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); - function get(ch, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); - if (right) m.left = m.right; else m.right = m.left; - return intoCoordSystem(cm, lineObj, m, context); - } - function getBidi(ch, partPos) { - var part = order[partPos], right = part.level % 2; - if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) { - part = order[--partPos]; - ch = bidiRight(part) - (part.level % 2 ? 0 : 1); - right = true; - } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) { - part = order[++partPos]; - ch = bidiLeft(part) - part.level % 2; - right = false; - } - if (right && ch == part.to && ch > part.from) return get(ch - 1); - return get(ch, right); - } - var order = getOrder(lineObj), ch = pos.ch; - if (!order) return get(ch); - var partPos = getBidiPartAt(order, ch); - var val = getBidi(ch, partPos); - if (bidiOther != null) val.other = getBidi(ch, bidiOther); - return val; - } - - // Used to cheaply estimate the coordinates for a position. Used for - // intermediate scroll updates. - function estimateCoords(cm, pos) { - var left = 0, pos = clipPos(cm.doc, pos); - if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; - var lineObj = getLine(cm.doc, pos.line); - var top = heightAtLine(lineObj) + paddingTop(cm.display); - return {left: left, right: left, top: top, bottom: top + lineObj.height}; - } - - // Positions returned by coordsChar contain some extra information. - // xRel is the relative x position of the input coordinates compared - // to the found position (so xRel > 0 means the coordinates are to - // the right of the character position, for example). When outside - // is true, that means the coordinates lie outside the line's - // vertical range. - function PosWithInfo(line, ch, outside, xRel) { - var pos = Pos(line, ch); - pos.xRel = xRel; - if (outside) pos.outside = true; - return pos; - } - - // Compute the character position closest to the given coordinates. - // Input must be lineSpace-local ("div" coordinate system). - function coordsChar(cm, x, y) { - var doc = cm.doc; - y += cm.display.viewOffset; - if (y < 0) return PosWithInfo(doc.first, 0, true, -1); - var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; - if (lineN > last) - return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1); - if (x < 0) x = 0; - - var lineObj = getLine(doc, lineN); - for (;;) { - var found = coordsCharInner(cm, lineObj, lineN, x, y); - var merged = collapsedSpanAtEnd(lineObj); - var mergedPos = merged && merged.find(0, true); - if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) - lineN = lineNo(lineObj = mergedPos.to.line); - else - return found; - } - } - - function coordsCharInner(cm, lineObj, lineNo, x, y) { - var innerOff = y - heightAtLine(lineObj); - var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth; - var preparedMeasure = prepareMeasureForLine(cm, lineObj); - - function getX(ch) { - var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure); - wrongLine = true; - if (innerOff > sp.bottom) return sp.left - adjust; - else if (innerOff < sp.top) return sp.left + adjust; - else wrongLine = false; - return sp.left; - } - - var bidi = getOrder(lineObj), dist = lineObj.text.length; - var from = lineLeft(lineObj), to = lineRight(lineObj); - var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine; - - if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1); - // Do a binary search between these bounds. - for (;;) { - if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { - var ch = x < fromX || x - fromX <= toX - x ? from : to; - var outside = ch == from ? fromOutside : toOutside - var xDiff = x - (ch == from ? fromX : toX); - // This is a kludge to handle the case where the coordinates - // are after a line-wrapped line. We should replace it with a - // more general handling of cursor positions around line - // breaks. (Issue #4078) - if (toOutside && !bidi && !/\s/.test(lineObj.text.charAt(ch)) && xDiff > 0 && - ch < lineObj.text.length && preparedMeasure.view.measure.heights.length > 1) { - var charSize = measureCharPrepared(cm, preparedMeasure, ch, "right"); - if (innerOff <= charSize.bottom && innerOff >= charSize.top && Math.abs(x - charSize.right) < xDiff) { - outside = false - ch++ - xDiff = x - charSize.right - } - } - while (isExtendingChar(lineObj.text.charAt(ch))) ++ch; - var pos = PosWithInfo(lineNo, ch, outside, xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); - return pos; - } - var step = Math.ceil(dist / 2), middle = from + step; - if (bidi) { - middle = from; - for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); - } - var middleX = getX(middle); - if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;} - else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;} - } - } - - var measureText; - // Compute the default text height. - function textHeight(display) { - if (display.cachedTextHeight != null) return display.cachedTextHeight; - if (measureText == null) { - measureText = elt("pre"); - // Measure a bunch of lines, for browsers that compute - // fractional heights. - for (var i = 0; i < 49; ++i) { - measureText.appendChild(document.createTextNode("x")); - measureText.appendChild(elt("br")); - } - measureText.appendChild(document.createTextNode("x")); - } - removeChildrenAndAdd(display.measure, measureText); - var height = measureText.offsetHeight / 50; - if (height > 3) display.cachedTextHeight = height; - removeChildren(display.measure); - return height || 1; - } - - // Compute the default character width. - function charWidth(display) { - if (display.cachedCharWidth != null) return display.cachedCharWidth; - var anchor = elt("span", "xxxxxxxxxx"); - var pre = elt("pre", [anchor]); - removeChildrenAndAdd(display.measure, pre); - var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; - if (width > 2) display.cachedCharWidth = width; - return width || 10; - } - - // OPERATIONS - - // Operations are used to wrap a series of changes to the editor - // state in such a way that each change won't have to update the - // cursor and display (which would be awkward, slow, and - // error-prone). Instead, display updates are batched and then all - // combined and executed at once. - - var operationGroup = null; - - var nextOpId = 0; - // Start a new operation. - function startOperation(cm) { - cm.curOp = { - cm: cm, - viewChanged: false, // Flag that indicates that lines might need to be redrawn - startHeight: cm.doc.height, // Used to detect need to update scrollbar - forceUpdate: false, // Used to force a redraw - updateInput: null, // Whether to reset the input textarea - typing: false, // Whether this reset should be careful to leave existing text (for compositing) - changeObjs: null, // Accumulated changes, for firing change events - cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on - cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already - selectionChanged: false, // Whether the selection needs to be redrawn - updateMaxLine: false, // Set when the widest line needs to be determined anew - scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet - scrollToPos: null, // Used to scroll to a specific position - focus: false, - id: ++nextOpId // Unique ID - }; - if (operationGroup) { - operationGroup.ops.push(cm.curOp); - } else { - cm.curOp.ownsGroup = operationGroup = { - ops: [cm.curOp], - delayedCallbacks: [] - }; - } - } - - function fireCallbacksForOps(group) { - // Calls delayed callbacks and cursorActivity handlers until no - // new ones appear - var callbacks = group.delayedCallbacks, i = 0; - do { - for (; i < callbacks.length; i++) - callbacks[i].call(null); - for (var j = 0; j < group.ops.length; j++) { - var op = group.ops[j]; - if (op.cursorActivityHandlers) - while (op.cursorActivityCalled < op.cursorActivityHandlers.length) - op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); - } - } while (i < callbacks.length); - } - - // Finish an operation, updating the display and signalling delayed events - function endOperation(cm) { - var op = cm.curOp, group = op.ownsGroup; - if (!group) return; - - try { fireCallbacksForOps(group); } - finally { - operationGroup = null; - for (var i = 0; i < group.ops.length; i++) - group.ops[i].cm.curOp = null; - endOperations(group); - } - } - - // The DOM updates done when an operation finishes are batched so - // that the minimum number of relayouts are required. - function endOperations(group) { - var ops = group.ops; - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_R1(ops[i]); - for (var i = 0; i < ops.length; i++) // Write DOM (maybe) - endOperation_W1(ops[i]); - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_R2(ops[i]); - for (var i = 0; i < ops.length; i++) // Write DOM (maybe) - endOperation_W2(ops[i]); - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_finish(ops[i]); - } - - function endOperation_R1(op) { - var cm = op.cm, display = cm.display; - maybeClipScrollbars(cm); - if (op.updateMaxLine) findMaxLine(cm); - - op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || - op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || - op.scrollToPos.to.line >= display.viewTo) || - display.maxLineChanged && cm.options.lineWrapping; - op.update = op.mustUpdate && - new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); - } - - function endOperation_W1(op) { - op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); - } - - function endOperation_R2(op) { - var cm = op.cm, display = cm.display; - if (op.updatedDisplay) updateHeightsInViewport(cm); - - op.barMeasure = measureForScrollbars(cm); - - // If the max line changed since it was last measured, measure it, - // and ensure the document's width matches it. - // updateDisplay_W2 will use these properties to do the actual resizing - if (display.maxLineChanged && !cm.options.lineWrapping) { - op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; - cm.display.sizerWidth = op.adjustWidthTo; - op.barMeasure.scrollWidth = - Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); - op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); - } - - if (op.updatedDisplay || op.selectionChanged) - op.preparedSelection = display.input.prepareSelection(op.focus); - } - - function endOperation_W2(op) { - var cm = op.cm; - - if (op.adjustWidthTo != null) { - cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; - if (op.maxScrollLeft < cm.doc.scrollLeft) - setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); - cm.display.maxLineChanged = false; - } - - var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus()) - if (op.preparedSelection) - cm.display.input.showSelection(op.preparedSelection, takeFocus); - if (op.updatedDisplay || op.startHeight != cm.doc.height) - updateScrollbars(cm, op.barMeasure); - if (op.updatedDisplay) - setDocumentHeight(cm, op.barMeasure); - - if (op.selectionChanged) restartBlink(cm); - - if (cm.state.focused && op.updateInput) - cm.display.input.reset(op.typing); - if (takeFocus) ensureFocus(op.cm); - } - - function endOperation_finish(op) { - var cm = op.cm, display = cm.display, doc = cm.doc; - - if (op.updatedDisplay) postUpdateDisplay(cm, op.update); - - // Abort mouse wheel delta measurement, when scrolling explicitly - if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) - display.wheelStartX = display.wheelStartY = null; - - // Propagate the scroll position to the actual DOM scroller - if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) { - doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); - display.scrollbars.setScrollTop(doc.scrollTop); - display.scroller.scrollTop = doc.scrollTop; - } - if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { - doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft)); - display.scrollbars.setScrollLeft(doc.scrollLeft); - display.scroller.scrollLeft = doc.scrollLeft; - alignHorizontally(cm); - } - // If we need to scroll a specific position into view, do so. - if (op.scrollToPos) { - var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), - clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); - if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords); - } - - // Fire events for markers that are hidden/unidden by editing or - // undoing - var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; - if (hidden) for (var i = 0; i < hidden.length; ++i) - if (!hidden[i].lines.length) signal(hidden[i], "hide"); - if (unhidden) for (var i = 0; i < unhidden.length; ++i) - if (unhidden[i].lines.length) signal(unhidden[i], "unhide"); - - if (display.wrapper.offsetHeight) - doc.scrollTop = cm.display.scroller.scrollTop; - - // Fire change events, and delayed event handlers - if (op.changeObjs) - signal(cm, "changes", cm, op.changeObjs); - if (op.update) - op.update.finish(); - } - - // Run the given function in an operation - function runInOp(cm, f) { - if (cm.curOp) return f(); - startOperation(cm); - try { return f(); } - finally { endOperation(cm); } - } - // Wraps a function in an operation. Returns the wrapped function. - function operation(cm, f) { - return function() { - if (cm.curOp) return f.apply(cm, arguments); - startOperation(cm); - try { return f.apply(cm, arguments); } - finally { endOperation(cm); } - }; - } - // Used to add methods to editor and doc instances, wrapping them in - // operations. - function methodOp(f) { - return function() { - if (this.curOp) return f.apply(this, arguments); - startOperation(this); - try { return f.apply(this, arguments); } - finally { endOperation(this); } - }; - } - function docMethodOp(f) { - return function() { - var cm = this.cm; - if (!cm || cm.curOp) return f.apply(this, arguments); - startOperation(cm); - try { return f.apply(this, arguments); } - finally { endOperation(cm); } - }; - } - - // VIEW TRACKING - - // These objects are used to represent the visible (currently drawn) - // part of the document. A LineView may correspond to multiple - // logical lines, if those are connected by collapsed ranges. - function LineView(doc, line, lineN) { - // The starting line - this.line = line; - // Continuing lines, if any - this.rest = visualLineContinued(line); - // Number of logical lines in this visual line - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; - this.node = this.text = null; - this.hidden = lineIsHidden(doc, line); - } - - // Create a range of LineView objects for the given lines. - function buildViewArray(cm, from, to) { - var array = [], nextPos; - for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); - nextPos = pos + view.size; - array.push(view); - } - return array; - } - - // Updates the display.view data structure for a given change to the - // document. From and to are in pre-change coordinates. Lendiff is - // the amount of lines added or subtracted by the change. This is - // used for changes that span multiple lines, or change the way - // lines are divided into visual lines. regLineChange (below) - // registers single-line changes. - function regChange(cm, from, to, lendiff) { - if (from == null) from = cm.doc.first; - if (to == null) to = cm.doc.first + cm.doc.size; - if (!lendiff) lendiff = 0; - - var display = cm.display; - if (lendiff && to < display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers > from)) - display.updateLineNumbers = from; - - cm.curOp.viewChanged = true; - - if (from >= display.viewTo) { // Change after - if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) - resetView(cm); - } else if (to <= display.viewFrom) { // Change before - if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { - resetView(cm); - } else { - display.viewFrom += lendiff; - display.viewTo += lendiff; - } - } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap - resetView(cm); - } else if (from <= display.viewFrom) { // Top overlap - var cut = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cut) { - display.view = display.view.slice(cut.index); - display.viewFrom = cut.lineN; - display.viewTo += lendiff; - } else { - resetView(cm); - } - } else if (to >= display.viewTo) { // Bottom overlap - var cut = viewCuttingPoint(cm, from, from, -1); - if (cut) { - display.view = display.view.slice(0, cut.index); - display.viewTo = cut.lineN; - } else { - resetView(cm); - } - } else { // Gap in the middle - var cutTop = viewCuttingPoint(cm, from, from, -1); - var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cutTop && cutBot) { - display.view = display.view.slice(0, cutTop.index) - .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) - .concat(display.view.slice(cutBot.index)); - display.viewTo += lendiff; - } else { - resetView(cm); - } - } - - var ext = display.externalMeasured; - if (ext) { - if (to < ext.lineN) - ext.lineN += lendiff; - else if (from < ext.lineN + ext.size) - display.externalMeasured = null; - } - } - - // Register a change to a single line. Type must be one of "text", - // "gutter", "class", "widget" - function regLineChange(cm, line, type) { - cm.curOp.viewChanged = true; - var display = cm.display, ext = cm.display.externalMeasured; - if (ext && line >= ext.lineN && line < ext.lineN + ext.size) - display.externalMeasured = null; - - if (line < display.viewFrom || line >= display.viewTo) return; - var lineView = display.view[findViewIndex(cm, line)]; - if (lineView.node == null) return; - var arr = lineView.changes || (lineView.changes = []); - if (indexOf(arr, type) == -1) arr.push(type); - } - - // Clear the view. - function resetView(cm) { - cm.display.viewFrom = cm.display.viewTo = cm.doc.first; - cm.display.view = []; - cm.display.viewOffset = 0; - } - - // Find the view element corresponding to a given line. Return null - // when the line isn't visible. - function findViewIndex(cm, n) { - if (n >= cm.display.viewTo) return null; - n -= cm.display.viewFrom; - if (n < 0) return null; - var view = cm.display.view; - for (var i = 0; i < view.length; i++) { - n -= view[i].size; - if (n < 0) return i; - } - } - - function viewCuttingPoint(cm, oldN, newN, dir) { - var index = findViewIndex(cm, oldN), diff, view = cm.display.view; - if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) - return {index: index, lineN: newN}; - for (var i = 0, n = cm.display.viewFrom; i < index; i++) - n += view[i].size; - if (n != oldN) { - if (dir > 0) { - if (index == view.length - 1) return null; - diff = (n + view[index].size) - oldN; - index++; - } else { - diff = n - oldN; - } - oldN += diff; newN += diff; - } - while (visualLineNo(cm.doc, newN) != newN) { - if (index == (dir < 0 ? 0 : view.length - 1)) return null; - newN += dir * view[index - (dir < 0 ? 1 : 0)].size; - index += dir; - } - return {index: index, lineN: newN}; - } - - // Force the view to cover a given range, adding empty view element - // or clipping off existing ones as needed. - function adjustView(cm, from, to) { - var display = cm.display, view = display.view; - if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { - display.view = buildViewArray(cm, from, to); - display.viewFrom = from; - } else { - if (display.viewFrom > from) - display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); - else if (display.viewFrom < from) - display.view = display.view.slice(findViewIndex(cm, from)); - display.viewFrom = from; - if (display.viewTo < to) - display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); - else if (display.viewTo > to) - display.view = display.view.slice(0, findViewIndex(cm, to)); - } - display.viewTo = to; - } - - // Count the number of lines in the view whose DOM representation is - // out of date (or nonexistent). - function countDirtyView(cm) { - var view = cm.display.view, dirty = 0; - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty; - } - return dirty; - } - - // EVENT HANDLERS - - // Attach the necessary event handlers when initializing the editor - function registerEventHandlers(cm) { - var d = cm.display; - on(d.scroller, "mousedown", operation(cm, onMouseDown)); - // Older IE's will not fire a second mousedown for a double click - if (ie && ie_version < 11) - on(d.scroller, "dblclick", operation(cm, function(e) { - if (signalDOMEvent(cm, e)) return; - var pos = posFromMouse(cm, e); - if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; - e_preventDefault(e); - var word = cm.findWordAt(pos); - extendSelection(cm.doc, word.anchor, word.head); - })); - else - on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); }); - // Some browsers fire contextmenu *after* opening the menu, at - // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for these browsers. - if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); - - // Used to suppress mouse event handling when a touch happens - var touchFinished, prevTouch = {end: 0}; - function finishTouch() { - if (d.activeTouch) { - touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000); - prevTouch = d.activeTouch; - prevTouch.end = +new Date; - } - }; - function isMouseLikeTouchEvent(e) { - if (e.touches.length != 1) return false; - var touch = e.touches[0]; - return touch.radiusX <= 1 && touch.radiusY <= 1; - } - function farAway(touch, other) { - if (other.left == null) return true; - var dx = other.left - touch.left, dy = other.top - touch.top; - return dx * dx + dy * dy > 20 * 20; - } - on(d.scroller, "touchstart", function(e) { - if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) { - clearTimeout(touchFinished); - var now = +new Date; - d.activeTouch = {start: now, moved: false, - prev: now - prevTouch.end <= 300 ? prevTouch : null}; - if (e.touches.length == 1) { - d.activeTouch.left = e.touches[0].pageX; - d.activeTouch.top = e.touches[0].pageY; - } - } - }); - on(d.scroller, "touchmove", function() { - if (d.activeTouch) d.activeTouch.moved = true; - }); - on(d.scroller, "touchend", function(e) { - var touch = d.activeTouch; - if (touch && !eventInWidget(d, e) && touch.left != null && - !touch.moved && new Date - touch.start < 300) { - var pos = cm.coordsChar(d.activeTouch, "page"), range; - if (!touch.prev || farAway(touch, touch.prev)) // Single tap - range = new Range(pos, pos); - else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap - range = cm.findWordAt(pos); - else // Triple tap - range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); - cm.setSelection(range.anchor, range.head); - cm.focus(); - e_preventDefault(e); - } - finishTouch(); - }); - on(d.scroller, "touchcancel", finishTouch); - - // Sync scrolling between fake scrollbars and real scrollable - // area, ensure viewport is updated when scrolling. - on(d.scroller, "scroll", function() { - if (d.scroller.clientHeight) { - setScrollTop(cm, d.scroller.scrollTop); - setScrollLeft(cm, d.scroller.scrollLeft, true); - signal(cm, "scroll", cm); - } - }); - - // Listen to wheel events in order to try and update the viewport on time. - on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); - on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); - - // Prevent wrapper from ever scrolling - on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - - d.dragFunctions = { - enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);}, - over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }}, - start: function(e){onDragStart(cm, e);}, - drop: operation(cm, onDrop), - leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }} - }; - - var inp = d.input.getField(); - on(inp, "keyup", function(e) { onKeyUp.call(cm, e); }); - on(inp, "keydown", operation(cm, onKeyDown)); - on(inp, "keypress", operation(cm, onKeyPress)); - on(inp, "focus", bind(onFocus, cm)); - on(inp, "blur", bind(onBlur, cm)); - } - - function dragDropChanged(cm, value, old) { - var wasOn = old && old != CodeMirror.Init; - if (!value != !wasOn) { - var funcs = cm.display.dragFunctions; - var toggle = value ? on : off; - toggle(cm.display.scroller, "dragstart", funcs.start); - toggle(cm.display.scroller, "dragenter", funcs.enter); - toggle(cm.display.scroller, "dragover", funcs.over); - toggle(cm.display.scroller, "dragleave", funcs.leave); - toggle(cm.display.scroller, "drop", funcs.drop); - } - } - - // Called when the window resizes - function onResize(cm) { - var d = cm.display; - if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) - return; - // Might be a text scaling operation, clear size caches. - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - d.scrollbarsClipped = false; - cm.setSize(); - } - - // MOUSE EVENTS - - // Return true when the given mouse event happened in a widget - function eventInWidget(display, e) { - for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { - if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || - (n.parentNode == display.sizer && n != display.mover)) - return true; - } - } - - // Given a mouse event, find the corresponding position. If liberal - // is false, it checks whether a gutter or scrollbar was clicked, - // and returns null if it was. forRect is used by rectangular - // selections, and tries to estimate a character position even for - // coordinates beyond the right of the text. - function posFromMouse(cm, e, liberal, forRect) { - var display = cm.display; - if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") return null; - - var x, y, space = display.lineSpace.getBoundingClientRect(); - // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX - space.left; y = e.clientY - space.top; } - catch (e) { return null; } - var coords = coordsChar(cm, x, y), line; - if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { - var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; - coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); - } - return coords; - } - - // A mouse down can be a single click, double click, triple click, - // start of selection drag, start of text drag, new cursor - // (ctrl-click), rectangle drag (alt-drag), or xwin - // middle-click-paste. Or it might be a click on something we should - // not interfere with, such as a scrollbar or widget. - function onMouseDown(e) { - var cm = this, display = cm.display; - if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return; - display.shift = e.shiftKey; - - if (eventInWidget(display, e)) { - if (!webkit) { - // Briefly turn off draggability, to allow widgets to do - // normal dragging things. - display.scroller.draggable = false; - setTimeout(function(){display.scroller.draggable = true;}, 100); - } - return; - } - if (clickInGutter(cm, e)) return; - var start = posFromMouse(cm, e); - window.focus(); - - switch (e_button(e)) { - case 1: - // #3261: make sure, that we're not starting a second selection - if (cm.state.selectingText) - cm.state.selectingText(e); - else if (start) - leftButtonDown(cm, e, start); - else if (e_target(e) == display.scroller) - e_preventDefault(e); - break; - case 2: - if (webkit) cm.state.lastMiddleDown = +new Date; - if (start) extendSelection(cm.doc, start); - setTimeout(function() {display.input.focus();}, 20); - e_preventDefault(e); - break; - case 3: - if (captureRightClick) onContextMenu(cm, e); - else delayBlurEvent(cm); - break; - } - } - - var lastClick, lastDoubleClick; - function leftButtonDown(cm, e, start) { - if (ie) setTimeout(bind(ensureFocus, cm), 0); - else cm.curOp.focus = activeElt(); - - var now = +new Date, type; - if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { - type = "triple"; - } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { - type = "double"; - lastDoubleClick = {time: now, pos: start}; - } else { - type = "single"; - lastClick = {time: now, pos: start}; - } - - var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained; - if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && - type == "single" && (contained = sel.contains(start)) > -1 && - (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) && - (cmp(contained.to(), start) > 0 || start.xRel < 0)) - leftButtonStartDrag(cm, e, start, modifier); - else - leftButtonSelect(cm, e, start, type, modifier); - } - - // Start a text drag. When it ends, see if any dragging actually - // happen, and treat as a click if it didn't. - function leftButtonStartDrag(cm, e, start, modifier) { - var display = cm.display, startTime = +new Date; - var dragEnd = operation(cm, function(e2) { - if (webkit) display.scroller.draggable = false; - cm.state.draggingText = false; - off(document, "mouseup", dragEnd); - off(display.scroller, "drop", dragEnd); - if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { - e_preventDefault(e2); - if (!modifier && +new Date - 200 < startTime) - extendSelection(cm.doc, start); - // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) - if (webkit || ie && ie_version == 9) - setTimeout(function() {document.body.focus(); display.input.focus();}, 20); - else - display.input.focus(); - } - }); - // Let the drag handler handle this. - if (webkit) display.scroller.draggable = true; - cm.state.draggingText = dragEnd; - dragEnd.copy = mac ? e.altKey : e.ctrlKey - // IE's approach to draggable - if (display.scroller.dragDrop) display.scroller.dragDrop(); - on(document, "mouseup", dragEnd); - on(display.scroller, "drop", dragEnd); - } - - // Normal selection, as opposed to text dragging. - function leftButtonSelect(cm, e, start, type, addNew) { - var display = cm.display, doc = cm.doc; - e_preventDefault(e); - - var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; - if (addNew && !e.shiftKey) { - ourIndex = doc.sel.contains(start); - if (ourIndex > -1) - ourRange = ranges[ourIndex]; - else - ourRange = new Range(start, start); - } else { - ourRange = doc.sel.primary(); - ourIndex = doc.sel.primIndex; - } - - if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) { - type = "rect"; - if (!addNew) ourRange = new Range(start, start); - start = posFromMouse(cm, e, true, true); - ourIndex = -1; - } else if (type == "double") { - var word = cm.findWordAt(start); - if (cm.display.shift || doc.extend) - ourRange = extendRange(doc, ourRange, word.anchor, word.head); - else - ourRange = word; - } else if (type == "triple") { - var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0))); - if (cm.display.shift || doc.extend) - ourRange = extendRange(doc, ourRange, line.anchor, line.head); - else - ourRange = line; - } else { - ourRange = extendRange(doc, ourRange, start); - } - - if (!addNew) { - ourIndex = 0; - setSelection(doc, new Selection([ourRange], 0), sel_mouse); - startSel = doc.sel; - } else if (ourIndex == -1) { - ourIndex = ranges.length; - setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), - {scroll: false, origin: "*mouse"}); - } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) { - setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), - {scroll: false, origin: "*mouse"}); - startSel = doc.sel; - } else { - replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); - } - - var lastPos = start; - function extendTo(pos) { - if (cmp(lastPos, pos) == 0) return; - lastPos = pos; - - if (type == "rect") { - var ranges = [], tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); - var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); - for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); - line <= end; line++) { - var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); - if (left == right) - ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); - else if (text.length > leftPos) - ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); - } - if (!ranges.length) ranges.push(new Range(start, start)); - setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), - {origin: "*mouse", scroll: false}); - cm.scrollIntoView(pos); - } else { - var oldRange = ourRange; - var anchor = oldRange.anchor, head = pos; - if (type != "single") { - if (type == "double") - var range = cm.findWordAt(pos); - else - var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); - if (cmp(range.anchor, anchor) > 0) { - head = range.head; - anchor = minPos(oldRange.from(), range.anchor); - } else { - head = range.anchor; - anchor = maxPos(oldRange.to(), range.head); - } - } - var ranges = startSel.ranges.slice(0); - ranges[ourIndex] = new Range(clipPos(doc, anchor), head); - setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse); - } - } - - var editorSize = display.wrapper.getBoundingClientRect(); - // Used to ensure timeout re-tries don't fire when another extend - // happened in the meantime (clearTimeout isn't reliable -- at - // least on Chrome, the timeouts still happen even when cleared, - // if the clear happens after their scheduled firing time). - var counter = 0; - - function extend(e) { - var curCount = ++counter; - var cur = posFromMouse(cm, e, true, type == "rect"); - if (!cur) return; - if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt(); - extendTo(cur); - var visible = visibleLines(display, doc); - if (cur.line >= visible.to || cur.line < visible.from) - setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); - } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; - if (outside) setTimeout(operation(cm, function() { - if (counter != curCount) return; - display.scroller.scrollTop += outside; - extend(e); - }), 50); - } - } - - function done(e) { - cm.state.selectingText = false; - counter = Infinity; - e_preventDefault(e); - display.input.focus(); - off(document, "mousemove", move); - off(document, "mouseup", up); - doc.history.lastSelOrigin = null; - } - - var move = operation(cm, function(e) { - if (!e_button(e)) done(e); - else extend(e); - }); - var up = operation(cm, done); - cm.state.selectingText = up; - on(document, "mousemove", move); - on(document, "mouseup", up); - } - - // Determines whether an event happened in the gutter, and fires the - // handlers for the corresponding event. - function gutterEvent(cm, e, type, prevent) { - try { var mX = e.clientX, mY = e.clientY; } - catch(e) { return false; } - if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false; - if (prevent) e_preventDefault(e); - - var display = cm.display; - var lineBox = display.lineDiv.getBoundingClientRect(); - - if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e); - mY -= lineBox.top - display.viewOffset; - - for (var i = 0; i < cm.options.gutters.length; ++i) { - var g = display.gutters.childNodes[i]; - if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.doc, mY); - var gutter = cm.options.gutters[i]; - signal(cm, type, cm, line, gutter, e); - return e_defaultPrevented(e); - } - } - } - - function clickInGutter(cm, e) { - return gutterEvent(cm, e, "gutterClick", true); - } - - // Kludge to work around strange IE behavior where it'll sometimes - // re-fire a series of drag-related events right after the drop (#1551) - var lastDrop = 0; - - function onDrop(e) { - var cm = this; - clearDragCursor(cm); - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) - return; - e_preventDefault(e); - if (ie) lastDrop = +new Date; - var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; - if (!pos || cm.isReadOnly()) return; - // Might be a file drop, in which case we simply extract the text - // and insert it. - if (files && files.length && window.FileReader && window.File) { - var n = files.length, text = Array(n), read = 0; - var loadFile = function(file, i) { - if (cm.options.allowDropFileTypes && - indexOf(cm.options.allowDropFileTypes, file.type) == -1) - return; - - var reader = new FileReader; - reader.onload = operation(cm, function() { - var content = reader.result; - if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) content = ""; - text[i] = content; - if (++read == n) { - pos = clipPos(cm.doc, pos); - var change = {from: pos, to: pos, - text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), - origin: "paste"}; - makeChange(cm.doc, change); - setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); - } - }); - reader.readAsText(file); - }; - for (var i = 0; i < n; ++i) loadFile(files[i], i); - } else { // Normal drop - // Don't do a replace if the drop happened inside of the selected text. - if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { - cm.state.draggingText(e); - // Ensure the editor is re-focused - setTimeout(function() {cm.display.input.focus();}, 20); - return; - } - try { - var text = e.dataTransfer.getData("Text"); - if (text) { - if (cm.state.draggingText && !cm.state.draggingText.copy) - var selected = cm.listSelections(); - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); - if (selected) for (var i = 0; i < selected.length; ++i) - replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); - cm.replaceSelection(text, "around", "paste"); - cm.display.input.focus(); - } - } - catch(e){} - } - } - - function onDragStart(cm, e) { - if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; - - e.dataTransfer.setData("Text", cm.getSelection()); - e.dataTransfer.effectAllowed = "copyMove" - - // Use dummy image instead of default browsers image. - // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. - if (e.dataTransfer.setDragImage && !safari) { - var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); - img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (presto) { - img.width = img.height = 1; - cm.display.wrapper.appendChild(img); - // Force a relayout, or Opera won't use our image for some obscure reason - img._top = img.offsetTop; - } - e.dataTransfer.setDragImage(img, 0, 0); - if (presto) img.parentNode.removeChild(img); - } - } - - function onDragOver(cm, e) { - var pos = posFromMouse(cm, e); - if (!pos) return; - var frag = document.createDocumentFragment(); - drawSelectionCursor(cm, pos, frag); - if (!cm.display.dragCursor) { - cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); - cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); - } - removeChildrenAndAdd(cm.display.dragCursor, frag); - } - - function clearDragCursor(cm) { - if (cm.display.dragCursor) { - cm.display.lineSpace.removeChild(cm.display.dragCursor); - cm.display.dragCursor = null; - } - } - - // SCROLL EVENTS - - // Sync the scrollable area and scrollbars, ensure the viewport - // covers the visible area. - function setScrollTop(cm, val) { - if (Math.abs(cm.doc.scrollTop - val) < 2) return; - cm.doc.scrollTop = val; - if (!gecko) updateDisplaySimple(cm, {top: val}); - if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; - cm.display.scrollbars.setScrollTop(val); - if (gecko) updateDisplaySimple(cm); - startWorker(cm, 100); - } - // Sync scroller and scrollbar, ensure the gutter elements are - // aligned. - function setScrollLeft(cm, val, isScroller) { - if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return; - val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); - cm.doc.scrollLeft = val; - alignHorizontally(cm); - if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; - cm.display.scrollbars.setScrollLeft(val); - } - - // Since the delta values reported on mouse wheel events are - // unstandardized between browsers and even browser versions, and - // generally horribly unpredictable, this code starts by measuring - // the scroll effect that the first few mouse wheel events have, - // and, from that, detects the way it can convert deltas to pixel - // offsets afterwards. - // - // The reason we want to know the amount a wheel event will scroll - // is that it gives us a chance to update the display before the - // actual scrolling happens, reducing flickering. - - var wheelSamples = 0, wheelPixelsPerUnit = null; - // Fill in a browser-detected starting value on browsers where we - // know one. These don't have to be accurate -- the result of them - // being wrong would just be a slight flicker on the first wheel - // scroll (if it is large enough). - if (ie) wheelPixelsPerUnit = -.53; - else if (gecko) wheelPixelsPerUnit = 15; - else if (chrome) wheelPixelsPerUnit = -.7; - else if (safari) wheelPixelsPerUnit = -1/3; - - var wheelEventDelta = function(e) { - var dx = e.wheelDeltaX, dy = e.wheelDeltaY; - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; - else if (dy == null) dy = e.wheelDelta; - return {x: dx, y: dy}; - }; - CodeMirror.wheelEventPixels = function(e) { - var delta = wheelEventDelta(e); - delta.x *= wheelPixelsPerUnit; - delta.y *= wheelPixelsPerUnit; - return delta; - }; - - function onScrollWheel(cm, e) { - var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; - - var display = cm.display, scroll = display.scroller; - // Quit if there's nothing to scroll here - var canScrollX = scroll.scrollWidth > scroll.clientWidth; - var canScrollY = scroll.scrollHeight > scroll.clientHeight; - if (!(dx && canScrollX || dy && canScrollY)) return; - - // Webkit browsers on OS X abort momentum scrolls when the target - // of the scroll event is removed from the scrollable element. - // This hack (see related code in patchDisplay) makes sure the - // element is kept around. - if (dy && mac && webkit) { - outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { - for (var i = 0; i < view.length; i++) { - if (view[i].node == cur) { - cm.display.currentWheelTarget = cur; - break outer; - } - } - } - } - - // On some browsers, horizontal scrolling will cause redraws to - // happen before the gutter has been realigned, causing it to - // wriggle around in a most unseemly way. When we have an - // estimated pixels/delta value, we just handle horizontal - // scrolling entirely here. It'll be slightly off from native, but - // better than glitching out. - if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { - if (dy && canScrollY) - setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); - setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); - // Only prevent default scrolling if vertical scrolling is - // actually possible. Otherwise, it causes vertical scroll - // jitter on OSX trackpads when deltaX is small and deltaY - // is large (issue #3579) - if (!dy || (dy && canScrollY)) - e_preventDefault(e); - display.wheelStartX = null; // Abort measurement, if in progress - return; - } - - // 'Project' the visible viewport to cover the area that is being - // scrolled into view (if we know enough to estimate it). - if (dy && wheelPixelsPerUnit != null) { - var pixels = dy * wheelPixelsPerUnit; - var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; - if (pixels < 0) top = Math.max(0, top + pixels - 50); - else bot = Math.min(cm.doc.height, bot + pixels + 50); - updateDisplaySimple(cm, {top: top, bottom: bot}); - } - - if (wheelSamples < 20) { - if (display.wheelStartX == null) { - display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; - display.wheelDX = dx; display.wheelDY = dy; - setTimeout(function() { - if (display.wheelStartX == null) return; - var movedX = scroll.scrollLeft - display.wheelStartX; - var movedY = scroll.scrollTop - display.wheelStartY; - var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || - (movedX && display.wheelDX && movedX / display.wheelDX); - display.wheelStartX = display.wheelStartY = null; - if (!sample) return; - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); - ++wheelSamples; - }, 200); - } else { - display.wheelDX += dx; display.wheelDY += dy; - } - } - } - - // KEY EVENTS - - // Run a handler that was bound to a key. - function doHandleBinding(cm, bound, dropShift) { - if (typeof bound == "string") { - bound = commands[bound]; - if (!bound) return false; - } - // Ensure previous input has been read, so that the handler sees a - // consistent view of the document - cm.display.input.ensurePolled(); - var prevShift = cm.display.shift, done = false; - try { - if (cm.isReadOnly()) cm.state.suppressEdits = true; - if (dropShift) cm.display.shift = false; - done = bound(cm) != Pass; - } finally { - cm.display.shift = prevShift; - cm.state.suppressEdits = false; - } - return done; - } - - function lookupKeyForEditor(cm, name, handle) { - for (var i = 0; i < cm.state.keyMaps.length; i++) { - var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); - if (result) return result; - } - return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) - || lookupKey(name, cm.options.keyMap, handle, cm); - } - - var stopSeq = new Delayed; - function dispatchKey(cm, name, e, handle) { - var seq = cm.state.keySeq; - if (seq) { - if (isModifierKey(name)) return "handled"; - stopSeq.set(50, function() { - if (cm.state.keySeq == seq) { - cm.state.keySeq = null; - cm.display.input.reset(); - } - }); - name = seq + " " + name; - } - var result = lookupKeyForEditor(cm, name, handle); - - if (result == "multi") - cm.state.keySeq = name; - if (result == "handled") - signalLater(cm, "keyHandled", cm, name, e); - - if (result == "handled" || result == "multi") { - e_preventDefault(e); - restartBlink(cm); - } - - if (seq && !result && /\'$/.test(name)) { - e_preventDefault(e); - return true; - } - return !!result; - } - - // Handle a key from the keydown event. - function handleKeyBinding(cm, e) { - var name = keyName(e, true); - if (!name) return false; - - if (e.shiftKey && !cm.state.keySeq) { - // First try to resolve full name (including 'Shift-'). Failing - // that, see if there is a cursor-motion command (starting with - // 'go') bound to the keyname without 'Shift-'. - return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);}) - || dispatchKey(cm, name, e, function(b) { - if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) - return doHandleBinding(cm, b); - }); - } else { - return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); }); - } - } - - // Handle a key from the keypress event - function handleCharBinding(cm, e, ch) { - return dispatchKey(cm, "'" + ch + "'", e, - function(b) { return doHandleBinding(cm, b, true); }); - } - - var lastStoppedKey = null; - function onKeyDown(e) { - var cm = this; - cm.curOp.focus = activeElt(); - if (signalDOMEvent(cm, e)) return; - // IE does strange things with escape. - if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; - var code = e.keyCode; - cm.display.shift = code == 16 || e.shiftKey; - var handled = handleKeyBinding(cm, e); - if (presto) { - lastStoppedKey = handled ? code : null; - // Opera has no cut event... we try to at least catch the key combo - if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) - cm.replaceSelection("", null, "cut"); - } - - // Turn mouse into crosshair when Alt is held on Mac. - if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) - showCrossHair(cm); - } - - function showCrossHair(cm) { - var lineDiv = cm.display.lineDiv; - addClass(lineDiv, "CodeMirror-crosshair"); - - function up(e) { - if (e.keyCode == 18 || !e.altKey) { - rmClass(lineDiv, "CodeMirror-crosshair"); - off(document, "keyup", up); - off(document, "mouseover", up); - } - } - on(document, "keyup", up); - on(document, "mouseover", up); - } - - function onKeyUp(e) { - if (e.keyCode == 16) this.doc.sel.shift = false; - signalDOMEvent(this, e); - } - - function onKeyPress(e) { - var cm = this; - if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return; - var keyCode = e.keyCode, charCode = e.charCode; - if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} - if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) return; - var ch = String.fromCharCode(charCode == null ? keyCode : charCode); - if (handleCharBinding(cm, e, ch)) return; - cm.display.input.onKeyPress(e); - } - - // FOCUS/BLUR EVENTS - - function delayBlurEvent(cm) { - cm.state.delayingBlurEvent = true; - setTimeout(function() { - if (cm.state.delayingBlurEvent) { - cm.state.delayingBlurEvent = false; - onBlur(cm); - } - }, 100); - } - - function onFocus(cm) { - if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false; - - if (cm.options.readOnly == "nocursor") return; - if (!cm.state.focused) { - signal(cm, "focus", cm); - cm.state.focused = true; - addClass(cm.display.wrapper, "CodeMirror-focused"); - // This test prevents this from firing when a context - // menu is closed (since the input reset would kill the - // select-all detection hack) - if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { - cm.display.input.reset(); - if (webkit) setTimeout(function() { cm.display.input.reset(true); }, 20); // Issue #1730 - } - cm.display.input.receivedFocus(); - } - restartBlink(cm); - } - function onBlur(cm) { - if (cm.state.delayingBlurEvent) return; - - if (cm.state.focused) { - signal(cm, "blur", cm); - cm.state.focused = false; - rmClass(cm.display.wrapper, "CodeMirror-focused"); - } - clearInterval(cm.display.blinker); - setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); - } - - // CONTEXT MENU HANDLING - - // To make the context menu work, we need to briefly unhide the - // textarea (making it as unobtrusive as possible) to let the - // right-click take effect on it. - function onContextMenu(cm, e) { - if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return; - if (signalDOMEvent(cm, e, "contextmenu")) return; - cm.display.input.onContextMenu(e); - } - - function contextMenuInGutter(cm, e) { - if (!hasHandler(cm, "gutterContextMenu")) return false; - return gutterEvent(cm, e, "gutterContextMenu", false); - } - - // UPDATING - - // Compute the position of the end of a change (its 'to' property - // refers to the pre-change end). - var changeEnd = CodeMirror.changeEnd = function(change) { - if (!change.text) return change.to; - return Pos(change.from.line + change.text.length - 1, - lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); - }; - - // Adjust a position to refer to the post-change position of the - // same text, or the end of the change if the change covers it. - function adjustForChange(pos, change) { - if (cmp(pos, change.from) < 0) return pos; - if (cmp(pos, change.to) <= 0) return changeEnd(change); - - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; - if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch; - return Pos(line, ch); - } - - function computeSelAfterChange(doc, change) { - var out = []; - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - out.push(new Range(adjustForChange(range.anchor, change), - adjustForChange(range.head, change))); - } - return normalizeSelection(out, doc.sel.primIndex); - } - - function offsetPos(pos, old, nw) { - if (pos.line == old.line) - return Pos(nw.line, pos.ch - old.ch + nw.ch); - else - return Pos(nw.line + (pos.line - old.line), pos.ch); - } - - // Used by replaceSelections to allow moving the selection to the - // start or around the replaced test. Hint may be "start" or "around". - function computeReplacedSel(doc, changes, hint) { - var out = []; - var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - var from = offsetPos(change.from, oldPrev, newPrev); - var to = offsetPos(changeEnd(change), oldPrev, newPrev); - oldPrev = change.to; - newPrev = to; - if (hint == "around") { - var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; - out[i] = new Range(inv ? to : from, inv ? from : to); - } else { - out[i] = new Range(from, from); - } - } - return new Selection(out, doc.sel.primIndex); - } - - // Allow "beforeChange" event handlers to influence a change - function filterChange(doc, change, update) { - var obj = { - canceled: false, - from: change.from, - to: change.to, - text: change.text, - origin: change.origin, - cancel: function() { this.canceled = true; } - }; - if (update) obj.update = function(from, to, text, origin) { - if (from) this.from = clipPos(doc, from); - if (to) this.to = clipPos(doc, to); - if (text) this.text = text; - if (origin !== undefined) this.origin = origin; - }; - signal(doc, "beforeChange", doc, obj); - if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj); - - if (obj.canceled) return null; - return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}; - } - - // Apply a change to a document, and add it to the document's - // history, and propagating it to all linked documents. - function makeChange(doc, change, ignoreReadOnly) { - if (doc.cm) { - if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); - if (doc.cm.state.suppressEdits) return; - } - - if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { - change = filterChange(doc, change, true); - if (!change) return; - } - - // Possibly split or suppress the update based on the presence - // of read-only spans in its range. - var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); - if (split) { - for (var i = split.length - 1; i >= 0; --i) - makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); - } else { - makeChangeInner(doc, change); - } - } - - function makeChangeInner(doc, change) { - if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return; - var selAfter = computeSelAfterChange(doc, change); - addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); - - makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); - var rebased = []; - - linkedDocs(doc, function(doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); - }); - } - - // Revert a change stored in a document's history. - function makeChangeFromHistory(doc, type, allowSelectionOnly) { - if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) return; - - var hist = doc.history, event, selAfter = doc.sel; - var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; - - // Verify that there is a useable event (so that ctrl-z won't - // needlessly clear selection events) - for (var i = 0; i < source.length; i++) { - event = source[i]; - if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) - break; - } - if (i == source.length) return; - hist.lastOrigin = hist.lastSelOrigin = null; - - for (;;) { - event = source.pop(); - if (event.ranges) { - pushSelectionToHistory(event, dest); - if (allowSelectionOnly && !event.equals(doc.sel)) { - setSelection(doc, event, {clearRedo: false}); - return; - } - selAfter = event; - } - else break; - } - - // Build up a reverse change object to add to the opposite history - // stack (redo when undoing, and vice versa). - var antiChanges = []; - pushSelectionToHistory(selAfter, dest); - dest.push({changes: antiChanges, generation: hist.generation}); - hist.generation = event.generation || ++hist.maxGeneration; - - var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); - - for (var i = event.changes.length - 1; i >= 0; --i) { - var change = event.changes[i]; - change.origin = type; - if (filter && !filterChange(doc, change, false)) { - source.length = 0; - return; - } - - antiChanges.push(historyChangeFromChange(doc, change)); - - var after = i ? computeSelAfterChange(doc, change) : lst(source); - makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); - var rebased = []; - - // Propagate to the linked documents - linkedDocs(doc, function(doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); - }); - } - } - - // Sub-views need their line numbers shifted when text is added - // above or below them in the parent document. - function shiftDoc(doc, distance) { - if (distance == 0) return; - doc.first += distance; - doc.sel = new Selection(map(doc.sel.ranges, function(range) { - return new Range(Pos(range.anchor.line + distance, range.anchor.ch), - Pos(range.head.line + distance, range.head.ch)); - }), doc.sel.primIndex); - if (doc.cm) { - regChange(doc.cm, doc.first, doc.first - distance, distance); - for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) - regLineChange(doc.cm, l, "gutter"); - } - } - - // More lower-level change function, handling only a single document - // (not linked ones). - function makeChangeSingleDoc(doc, change, selAfter, spans) { - if (doc.cm && !doc.cm.curOp) - return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); - - if (change.to.line < doc.first) { - shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); - return; - } - if (change.from.line > doc.lastLine()) return; - - // Clip the change to the size of this doc - if (change.from.line < doc.first) { - var shift = change.text.length - 1 - (doc.first - change.from.line); - shiftDoc(doc, shift); - change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), - text: [lst(change.text)], origin: change.origin}; - } - var last = doc.lastLine(); - if (change.to.line > last) { - change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), - text: [change.text[0]], origin: change.origin}; - } - - change.removed = getBetween(doc, change.from, change.to); - - if (!selAfter) selAfter = computeSelAfterChange(doc, change); - if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans); - else updateDoc(doc, change, spans); - setSelectionNoUndo(doc, selAfter, sel_dontScroll); - } - - // Handle the interaction of a change to a document with the editor - // that this document is part of. - function makeChangeSingleDocInEditor(cm, change, spans) { - var doc = cm.doc, display = cm.display, from = change.from, to = change.to; - - var recomputeMaxLength = false, checkWidthStart = from.line; - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); - doc.iter(checkWidthStart, to.line + 1, function(line) { - if (line == display.maxLine) { - recomputeMaxLength = true; - return true; - } - }); - } - - if (doc.sel.contains(change.from, change.to) > -1) - signalCursorActivity(cm); - - updateDoc(doc, change, spans, estimateHeight(cm)); - - if (!cm.options.lineWrapping) { - doc.iter(checkWidthStart, from.line + change.text.length, function(line) { - var len = lineLength(line); - if (len > display.maxLineLength) { - display.maxLine = line; - display.maxLineLength = len; - display.maxLineChanged = true; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) cm.curOp.updateMaxLine = true; - } - - // Adjust frontier, schedule worker - doc.frontier = Math.min(doc.frontier, from.line); - startWorker(cm, 400); - - var lendiff = change.text.length - (to.line - from.line) - 1; - // Remember that these lines changed, for updating the display - if (change.full) - regChange(cm); - else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) - regLineChange(cm, from.line, "text"); - else - regChange(cm, from.line, to.line + 1, lendiff); - - var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); - if (changeHandler || changesHandler) { - var obj = { - from: from, to: to, - text: change.text, - removed: change.removed, - origin: change.origin - }; - if (changeHandler) signalLater(cm, "change", cm, obj); - if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); - } - cm.display.selForContextMenu = null; - } - - function replaceRange(doc, code, from, to, origin) { - if (!to) to = from; - if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } - if (typeof code == "string") code = doc.splitLines(code); - makeChange(doc, {from: from, to: to, text: code, origin: origin}); - } - - // SCROLLING THINGS INTO VIEW - - // If an editor sits on the top or bottom of the window, partially - // scrolled out of view, this ensures that the cursor is visible. - function maybeScrollWindow(cm, coords) { - if (signalDOMEvent(cm, "scrollCursorIntoView")) return; - - var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; - if (coords.top + box.top < 0) doScroll = true; - else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; - if (doScroll != null && !phantom) { - var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " + - (coords.top - display.viewOffset - paddingTop(cm.display)) + "px; height: " + - (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px; left: " + - coords.left + "px; width: 2px;"); - cm.display.lineSpace.appendChild(scrollNode); - scrollNode.scrollIntoView(doScroll); - cm.display.lineSpace.removeChild(scrollNode); - } - } - - // Scroll a given position into view (immediately), verifying that - // it actually became visible (as line heights are accurately - // measured, the position of something may 'drift' during drawing). - function scrollPosIntoView(cm, pos, end, margin) { - if (margin == null) margin = 0; - for (var limit = 0; limit < 5; limit++) { - var changed = false, coords = cursorCoords(cm, pos); - var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); - var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), - Math.min(coords.top, endCoords.top) - margin, - Math.max(coords.left, endCoords.left), - Math.max(coords.bottom, endCoords.bottom) + margin); - var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; - if (scrollPos.scrollTop != null) { - setScrollTop(cm, scrollPos.scrollTop); - if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true; - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true; - } - if (!changed) break; - } - return coords; - } - - // Scroll a given set of coordinates into view (immediately). - function scrollIntoView(cm, x1, y1, x2, y2) { - var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); - if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); - if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); - } - - // Calculate a new scroll position needed to scroll the given - // rectangle into view. Returns an object with scrollTop and - // scrollLeft properties. When these are undefined, the - // vertical/horizontal position does not need to be adjusted. - function calculateScrollPos(cm, x1, y1, x2, y2) { - var display = cm.display, snapMargin = textHeight(cm.display); - if (y1 < 0) y1 = 0; - var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; - var screen = displayHeight(cm), result = {}; - if (y2 - y1 > screen) y2 = y1 + screen; - var docBottom = cm.doc.height + paddingVert(display); - var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; - if (y1 < screentop) { - result.scrollTop = atTop ? 0 : y1; - } else if (y2 > screentop + screen) { - var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen); - if (newTop != screentop) result.scrollTop = newTop; - } - - var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; - var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); - var tooWide = x2 - x1 > screenw; - if (tooWide) x2 = x1 + screenw; - if (x1 < 10) - result.scrollLeft = 0; - else if (x1 < screenleft) - result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)); - else if (x2 > screenw + screenleft - 3) - result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw; - return result; - } - - // Store a relative adjustment to the scroll position in the current - // operation (to be applied when the operation finishes). - function addToScrollPos(cm, left, top) { - if (left != null || top != null) resolveScrollToPos(cm); - if (left != null) - cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left; - if (top != null) - cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; - } - - // Make sure that at the end of the operation the current cursor is - // shown. - function ensureCursorVisible(cm) { - resolveScrollToPos(cm); - var cur = cm.getCursor(), from = cur, to = cur; - if (!cm.options.lineWrapping) { - from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur; - to = Pos(cur.line, cur.ch + 1); - } - cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}; - } - - // When an operation has its scrollToPos property set, and another - // scroll action is applied before the end of the operation, this - // 'simulates' scrolling that position into view in a cheap way, so - // that the effect of intermediate scroll commands is not ignored. - function resolveScrollToPos(cm) { - var range = cm.curOp.scrollToPos; - if (range) { - cm.curOp.scrollToPos = null; - var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); - var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), - Math.min(from.top, to.top) - range.margin, - Math.max(from.right, to.right), - Math.max(from.bottom, to.bottom) + range.margin); - cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); - } - } - - // API UTILITIES - - // Indent the given line. The how parameter can be "smart", - // "add"/null, "subtract", or "prev". When aggressive is false - // (typically set to true for forced single-line indents), empty - // lines are not indented, and places where the mode returns Pass - // are left alone. - function indentLine(cm, n, how, aggressive) { - var doc = cm.doc, state; - if (how == null) how = "add"; - if (how == "smart") { - // Fall back to "prev" when the mode doesn't have an indentation - // method. - if (!doc.mode.indent) how = "prev"; - else state = getStateBefore(cm, n); - } - - var tabSize = cm.options.tabSize; - var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); - if (line.stateAfter) line.stateAfter = null; - var curSpaceString = line.text.match(/^\s*/)[0], indentation; - if (!aggressive && !/\S/.test(line.text)) { - indentation = 0; - how = "not"; - } else if (how == "smart") { - indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); - if (indentation == Pass || indentation > 150) { - if (!aggressive) return; - how = "prev"; - } - } - if (how == "prev") { - if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); - else indentation = 0; - } else if (how == "add") { - indentation = curSpace + cm.options.indentUnit; - } else if (how == "subtract") { - indentation = curSpace - cm.options.indentUnit; - } else if (typeof how == "number") { - indentation = curSpace + how; - } - indentation = Math.max(0, indentation); - - var indentString = "", pos = 0; - if (cm.options.indentWithTabs) - for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} - if (pos < indentation) indentString += spaceStr(indentation - pos); - - if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); - line.stateAfter = null; - return true; - } else { - // Ensure that, if the cursor was in the whitespace at the start - // of the line, it is moved to the end of that space. - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - if (range.head.line == n && range.head.ch < curSpaceString.length) { - var pos = Pos(n, curSpaceString.length); - replaceOneSelection(doc, i, new Range(pos, pos)); - break; - } - } - } - } - - // Utility for applying a change to a line by handle or number, - // returning the number and optionally registering the line as - // changed. - function changeLine(doc, handle, changeType, op) { - var no = handle, line = handle; - if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); - else no = lineNo(handle); - if (no == null) return null; - if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType); - return line; - } - - // Helper for deleting text near the selection(s), used to implement - // backspace, delete, and similar functionality. - function deleteNearSelection(cm, compute) { - var ranges = cm.doc.sel.ranges, kill = []; - // Build up a set of ranges to kill first, merging overlapping - // ranges. - for (var i = 0; i < ranges.length; i++) { - var toKill = compute(ranges[i]); - while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { - var replaced = kill.pop(); - if (cmp(replaced.from, toKill.from) < 0) { - toKill.from = replaced.from; - break; - } - } - kill.push(toKill); - } - // Next, remove those actual ranges. - runInOp(cm, function() { - for (var i = kill.length - 1; i >= 0; i--) - replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); - ensureCursorVisible(cm); - }); - } - - // Used for horizontal relative motion. Dir is -1 or 1 (left or - // right), unit can be "char", "column" (like char, but doesn't - // cross line boundaries), "word" (across next word), or "group" (to - // the start of next group of word or non-word-non-whitespace - // chars). The visually param controls whether, in right-to-left - // text, direction 1 means to move towards the next index in the - // string, or towards the character to the right of the current - // position. The resulting position will have a hitSide=true - // property if it reached the end of the document. - function findPosH(doc, pos, dir, unit, visually) { - var line = pos.line, ch = pos.ch, origDir = dir; - var lineObj = getLine(doc, line); - function findNextLine() { - var l = line + dir; - if (l < doc.first || l >= doc.first + doc.size) return false - line = l; - return lineObj = getLine(doc, l); - } - function moveOnce(boundToLine) { - var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); - if (next == null) { - if (!boundToLine && findNextLine()) { - if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); - else ch = dir < 0 ? lineObj.text.length : 0; - } else return false - } else ch = next; - return true; - } - - if (unit == "char") { - moveOnce() - } else if (unit == "column") { - moveOnce(true) - } else if (unit == "word" || unit == "group") { - var sawType = null, group = unit == "group"; - var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); - for (var first = true;; first = false) { - if (dir < 0 && !moveOnce(!first)) break; - var cur = lineObj.text.charAt(ch) || "\n"; - var type = isWordChar(cur, helper) ? "w" - : group && cur == "\n" ? "n" - : !group || /\s/.test(cur) ? null - : "p"; - if (group && !first && !type) type = "s"; - if (sawType && sawType != type) { - if (dir < 0) {dir = 1; moveOnce();} - break; - } - - if (type) sawType = type; - if (dir > 0 && !moveOnce(!first)) break; - } - } - var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true); - if (!cmp(pos, result)) result.hitSide = true; - return result; - } - - // For relative vertical movement. Dir may be -1 or 1. Unit can be - // "page" or "line". The resulting position will have a hitSide=true - // property if it reached the end of the document. - function findPosV(cm, pos, dir, unit) { - var doc = cm.doc, x = pos.left, y; - if (unit == "page") { - var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); - y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); - } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3; - } - for (;;) { - var target = coordsChar(cm, x, y); - if (!target.outside) break; - if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } - y += dir * 5; - } - return target; - } - - // EDITOR METHODS - - // The publicly visible API. Note that methodOp(f) means - // 'wrap f in an operation, performed on its `this` parameter'. - - // This is not the complete set of editor methods. Most of the - // methods defined on the Doc type are also injected into - // CodeMirror.prototype, for backwards compatibility and - // convenience. - - CodeMirror.prototype = { - constructor: CodeMirror, - focus: function(){window.focus(); this.display.input.focus();}, - - setOption: function(option, value) { - var options = this.options, old = options[option]; - if (options[option] == value && option != "mode") return; - options[option] = value; - if (optionHandlers.hasOwnProperty(option)) - operation(this, optionHandlers[option])(this, value, old); - }, - - getOption: function(option) {return this.options[option];}, - getDoc: function() {return this.doc;}, - - addKeyMap: function(map, bottom) { - this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); - }, - removeKeyMap: function(map) { - var maps = this.state.keyMaps; - for (var i = 0; i < maps.length; ++i) - if (maps[i] == map || maps[i].name == map) { - maps.splice(i, 1); - return true; - } - }, - - addOverlay: methodOp(function(spec, options) { - var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); - if (mode.startState) throw new Error("Overlays may not be stateful."); - insertSorted(this.state.overlays, - {mode: mode, modeSpec: spec, opaque: options && options.opaque, - priority: (options && options.priority) || 0}, - function(overlay) { return overlay.priority }) - this.state.modeGen++; - regChange(this); - }), - removeOverlay: methodOp(function(spec) { - var overlays = this.state.overlays; - for (var i = 0; i < overlays.length; ++i) { - var cur = overlays[i].modeSpec; - if (cur == spec || typeof spec == "string" && cur.name == spec) { - overlays.splice(i, 1); - this.state.modeGen++; - regChange(this); - return; - } - } - }), - - indentLine: methodOp(function(n, dir, aggressive) { - if (typeof dir != "string" && typeof dir != "number") { - if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; - else dir = dir ? "add" : "subtract"; - } - if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); - }), - indentSelection: methodOp(function(how) { - var ranges = this.doc.sel.ranges, end = -1; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty()) { - var from = range.from(), to = range.to(); - var start = Math.max(end, from.line); - end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; - for (var j = start; j < end; ++j) - indentLine(this, j, how); - var newRanges = this.doc.sel.ranges; - if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) - replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); - } else if (range.head.line > end) { - indentLine(this, range.head.line, how, true); - end = range.head.line; - if (i == this.doc.sel.primIndex) ensureCursorVisible(this); - } - } - }), - - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function(pos, precise) { - return takeToken(this, pos, precise); - }, - - getLineTokens: function(line, precise) { - return takeToken(this, Pos(line), precise, true); - }, - - getTokenTypeAt: function(pos) { - pos = clipPos(this.doc, pos); - var styles = getLineStyles(this, getLine(this.doc, pos.line)); - var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; - var type; - if (ch == 0) type = styles[2]; - else for (;;) { - var mid = (before + after) >> 1; - if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid; - else if (styles[mid * 2 + 1] < ch) before = mid + 1; - else { type = styles[mid * 2 + 2]; break; } - } - var cut = type ? type.indexOf("cm-overlay ") : -1; - return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); - }, - - getModeAt: function(pos) { - var mode = this.doc.mode; - if (!mode.innerMode) return mode; - return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode; - }, - - getHelper: function(pos, type) { - return this.getHelpers(pos, type)[0]; - }, - - getHelpers: function(pos, type) { - var found = []; - if (!helpers.hasOwnProperty(type)) return found; - var help = helpers[type], mode = this.getModeAt(pos); - if (typeof mode[type] == "string") { - if (help[mode[type]]) found.push(help[mode[type]]); - } else if (mode[type]) { - for (var i = 0; i < mode[type].length; i++) { - var val = help[mode[type][i]]; - if (val) found.push(val); - } - } else if (mode.helperType && help[mode.helperType]) { - found.push(help[mode.helperType]); - } else if (help[mode.name]) { - found.push(help[mode.name]); - } - for (var i = 0; i < help._global.length; i++) { - var cur = help._global[i]; - if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) - found.push(cur.val); - } - return found; - }, - - getStateAfter: function(line, precise) { - var doc = this.doc; - line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); - return getStateBefore(this, line + 1, precise); - }, - - cursorCoords: function(start, mode) { - var pos, range = this.doc.sel.primary(); - if (start == null) pos = range.head; - else if (typeof start == "object") pos = clipPos(this.doc, start); - else pos = start ? range.from() : range.to(); - return cursorCoords(this, pos, mode || "page"); - }, - - charCoords: function(pos, mode) { - return charCoords(this, clipPos(this.doc, pos), mode || "page"); - }, - - coordsChar: function(coords, mode) { - coords = fromCoordSystem(this, coords, mode || "page"); - return coordsChar(this, coords.left, coords.top); - }, - - lineAtHeight: function(height, mode) { - height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; - return lineAtHeight(this.doc, height + this.display.viewOffset); - }, - heightAtLine: function(line, mode) { - var end = false, lineObj; - if (typeof line == "number") { - var last = this.doc.first + this.doc.size - 1; - if (line < this.doc.first) line = this.doc.first; - else if (line > last) { line = last; end = true; } - lineObj = getLine(this.doc, line); - } else { - lineObj = line; - } - return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + - (end ? this.doc.height - heightAtLine(lineObj) : 0); - }, - - defaultTextHeight: function() { return textHeight(this.display); }, - defaultCharWidth: function() { return charWidth(this.display); }, - - setGutterMarker: methodOp(function(line, gutterID, value) { - return changeLine(this.doc, line, "gutter", function(line) { - var markers = line.gutterMarkers || (line.gutterMarkers = {}); - markers[gutterID] = value; - if (!value && isEmpty(markers)) line.gutterMarkers = null; - return true; - }); - }), - - clearGutter: methodOp(function(gutterID) { - var cm = this, doc = cm.doc, i = doc.first; - doc.iter(function(line) { - if (line.gutterMarkers && line.gutterMarkers[gutterID]) { - line.gutterMarkers[gutterID] = null; - regLineChange(cm, i, "gutter"); - if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; - } - ++i; - }); - }), - - lineInfo: function(line) { - if (typeof line == "number") { - if (!isLine(this.doc, line)) return null; - var n = line; - line = getLine(this.doc, line); - if (!line) return null; - } else { - var n = lineNo(line); - if (n == null) return null; - } - return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, - textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, - widgets: line.widgets}; - }, - - getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};}, - - addWidget: function(pos, node, scroll, vert, horiz) { - var display = this.display; - pos = cursorCoords(this, clipPos(this.doc, pos)); - var top = pos.bottom, left = pos.left; - node.style.position = "absolute"; - node.setAttribute("cm-ignore-events", "true"); - this.display.input.setUneditable(node); - display.sizer.appendChild(node); - if (vert == "over") { - top = pos.top; - } else if (vert == "above" || vert == "near") { - var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); - // Default to positioning above (if specified and possible); otherwise default to positioning below - if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) - top = pos.top - node.offsetHeight; - else if (pos.bottom + node.offsetHeight <= vspace) - top = pos.bottom; - if (left + node.offsetWidth > hspace) - left = hspace - node.offsetWidth; - } - node.style.top = top + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") left = 0; - else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; - node.style.left = left + "px"; - } - if (scroll) - scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); - }, - - triggerOnKeyDown: methodOp(onKeyDown), - triggerOnKeyPress: methodOp(onKeyPress), - triggerOnKeyUp: onKeyUp, - - execCommand: function(cmd) { - if (commands.hasOwnProperty(cmd)) - return commands[cmd].call(null, this); - }, - - triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), - - findPosH: function(from, amount, unit, visually) { - var dir = 1; - if (amount < 0) { dir = -1; amount = -amount; } - for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { - cur = findPosH(this.doc, cur, dir, unit, visually); - if (cur.hitSide) break; - } - return cur; - }, - - moveH: methodOp(function(dir, unit) { - var cm = this; - cm.extendSelectionsBy(function(range) { - if (cm.display.shift || cm.doc.extend || range.empty()) - return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually); - else - return dir < 0 ? range.from() : range.to(); - }, sel_move); - }), - - deleteH: methodOp(function(dir, unit) { - var sel = this.doc.sel, doc = this.doc; - if (sel.somethingSelected()) - doc.replaceSelection("", null, "+delete"); - else - deleteNearSelection(this, function(range) { - var other = findPosH(doc, range.head, dir, unit, false); - return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}; - }); - }), - - findPosV: function(from, amount, unit, goalColumn) { - var dir = 1, x = goalColumn; - if (amount < 0) { dir = -1; amount = -amount; } - for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { - var coords = cursorCoords(this, cur, "div"); - if (x == null) x = coords.left; - else coords.left = x; - cur = findPosV(this, coords, dir, unit); - if (cur.hitSide) break; - } - return cur; - }, - - moveV: methodOp(function(dir, unit) { - var cm = this, doc = this.doc, goals = []; - var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected(); - doc.extendSelectionsBy(function(range) { - if (collapse) - return dir < 0 ? range.from() : range.to(); - var headPos = cursorCoords(cm, range.head, "div"); - if (range.goalColumn != null) headPos.left = range.goalColumn; - goals.push(headPos.left); - var pos = findPosV(cm, headPos, dir, unit); - if (unit == "page" && range == doc.sel.primary()) - addToScrollPos(cm, null, charCoords(cm, pos, "div").top - headPos.top); - return pos; - }, sel_move); - if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++) - doc.sel.ranges[i].goalColumn = goals[i]; - }), - - // Find the word at the given position (as returned by coordsChar). - findWordAt: function(pos) { - var doc = this.doc, line = getLine(doc, pos.line).text; - var start = pos.ch, end = pos.ch; - if (line) { - var helper = this.getHelper(pos, "wordChars"); - if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; - var startChar = line.charAt(start); - var check = isWordChar(startChar, helper) - ? function(ch) { return isWordChar(ch, helper); } - : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} - : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; - while (start > 0 && check(line.charAt(start - 1))) --start; - while (end < line.length && check(line.charAt(end))) ++end; - } - return new Range(Pos(pos.line, start), Pos(pos.line, end)); - }, - - toggleOverwrite: function(value) { - if (value != null && value == this.state.overwrite) return; - if (this.state.overwrite = !this.state.overwrite) - addClass(this.display.cursorDiv, "CodeMirror-overwrite"); - else - rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); - - signal(this, "overwriteToggle", this, this.state.overwrite); - }, - hasFocus: function() { return this.display.input.getField() == activeElt(); }, - isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit); }, - - scrollTo: methodOp(function(x, y) { - if (x != null || y != null) resolveScrollToPos(this); - if (x != null) this.curOp.scrollLeft = x; - if (y != null) this.curOp.scrollTop = y; - }), - getScrollInfo: function() { - var scroller = this.display.scroller; - return {left: scroller.scrollLeft, top: scroller.scrollTop, - height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, - width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, - clientHeight: displayHeight(this), clientWidth: displayWidth(this)}; - }, - - scrollIntoView: methodOp(function(range, margin) { - if (range == null) { - range = {from: this.doc.sel.primary().head, to: null}; - if (margin == null) margin = this.options.cursorScrollMargin; - } else if (typeof range == "number") { - range = {from: Pos(range, 0), to: null}; - } else if (range.from == null) { - range = {from: range, to: null}; - } - if (!range.to) range.to = range.from; - range.margin = margin || 0; - - if (range.from.line != null) { - resolveScrollToPos(this); - this.curOp.scrollToPos = range; - } else { - var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left), - Math.min(range.from.top, range.to.top) - range.margin, - Math.max(range.from.right, range.to.right), - Math.max(range.from.bottom, range.to.bottom) + range.margin); - this.scrollTo(sPos.scrollLeft, sPos.scrollTop); - } - }), - - setSize: methodOp(function(width, height) { - var cm = this; - function interpret(val) { - return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; - } - if (width != null) cm.display.wrapper.style.width = interpret(width); - if (height != null) cm.display.wrapper.style.height = interpret(height); - if (cm.options.lineWrapping) clearLineMeasurementCache(this); - var lineNo = cm.display.viewFrom; - cm.doc.iter(lineNo, cm.display.viewTo, function(line) { - if (line.widgets) for (var i = 0; i < line.widgets.length; i++) - if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, "widget"); break; } - ++lineNo; - }); - cm.curOp.forceUpdate = true; - signal(cm, "refresh", this); - }), - - operation: function(f){return runInOp(this, f);}, - - refresh: methodOp(function() { - var oldHeight = this.display.cachedTextHeight; - regChange(this); - this.curOp.forceUpdate = true; - clearCaches(this); - this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop); - updateGutterSpace(this); - if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) - estimateLineHeights(this); - signal(this, "refresh", this); - }), - - swapDoc: methodOp(function(doc) { - var old = this.doc; - old.cm = null; - attachDoc(this, doc); - clearCaches(this); - this.display.input.reset(); - this.scrollTo(doc.scrollLeft, doc.scrollTop); - this.curOp.forceScroll = true; - signalLater(this, "swapDoc", this, old); - return old; - }), - - getInputField: function(){return this.display.input.getField();}, - getWrapperElement: function(){return this.display.wrapper;}, - getScrollerElement: function(){return this.display.scroller;}, - getGutterElement: function(){return this.display.gutters;} - }; - eventMixin(CodeMirror); - - // OPTION DEFAULTS - - // The default configuration options. - var defaults = CodeMirror.defaults = {}; - // Functions to run when options are changed. - var optionHandlers = CodeMirror.optionHandlers = {}; - - function option(name, deflt, handle, notOnInit) { - CodeMirror.defaults[name] = deflt; - if (handle) optionHandlers[name] = - notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; - } - - // Passed to option handlers when there is no old value. - var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; - - // These two are, on init, called from the constructor because they - // have to be initialized before the editor can start at all. - option("value", "", function(cm, val) { - cm.setValue(val); - }, true); - option("mode", null, function(cm, val) { - cm.doc.modeOption = val; - loadMode(cm); - }, true); - - option("indentUnit", 2, loadMode, true); - option("indentWithTabs", false); - option("smartIndent", true); - option("tabSize", 4, function(cm) { - resetModeState(cm); - clearCaches(cm); - regChange(cm); - }, true); - option("lineSeparator", null, function(cm, val) { - cm.doc.lineSep = val; - if (!val) return; - var newBreaks = [], lineNo = cm.doc.first; - cm.doc.iter(function(line) { - for (var pos = 0;;) { - var found = line.text.indexOf(val, pos); - if (found == -1) break; - pos = found + val.length; - newBreaks.push(Pos(lineNo, found)); - } - lineNo++; - }); - for (var i = newBreaks.length - 1; i >= 0; i--) - replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) - }); - option("specialChars", /[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) { - cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); - if (old != CodeMirror.Init) cm.refresh(); - }); - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true); - option("electricChars", true); - option("inputStyle", mobile ? "contenteditable" : "textarea", function() { - throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME - }, true); - option("spellcheck", false, function(cm, val) { - cm.getInputField().spellcheck = val - }, true); - option("rtlMoveVisually", !windows); - option("wholeLineUpdateBefore", true); - - option("theme", "default", function(cm) { - themeChanged(cm); - guttersChanged(cm); - }, true); - option("keyMap", "default", function(cm, val, old) { - var next = getKeyMap(val); - var prev = old != CodeMirror.Init && getKeyMap(old); - if (prev && prev.detach) prev.detach(cm, next); - if (next.attach) next.attach(cm, prev || null); - }); - option("extraKeys", null); - - option("lineWrapping", false, wrappingChanged, true); - option("gutters", [], function(cm) { - setGuttersForLineNumbers(cm.options); - guttersChanged(cm); - }, true); - option("fixedGutter", true, function(cm, val) { - cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; - cm.refresh(); - }, true); - option("coverGutterNextToScrollbar", false, function(cm) {updateScrollbars(cm);}, true); - option("scrollbarStyle", "native", function(cm) { - initScrollbars(cm); - updateScrollbars(cm); - cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); - cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); - }, true); - option("lineNumbers", false, function(cm) { - setGuttersForLineNumbers(cm.options); - guttersChanged(cm); - }, true); - option("firstLineNumber", 1, guttersChanged, true); - option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); - option("showCursorWhenSelecting", false, updateSelection, true); - - option("resetSelectionOnContextMenu", true); - option("lineWiseCopyCut", true); - - option("readOnly", false, function(cm, val) { - if (val == "nocursor") { - onBlur(cm); - cm.display.input.blur(); - cm.display.disabled = true; - } else { - cm.display.disabled = false; - } - cm.display.input.readOnlyChanged(val) - }); - option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true); - option("dragDrop", true, dragDropChanged); - option("allowDropFileTypes", null); - - option("cursorBlinkRate", 530); - option("cursorScrollMargin", 0); - option("cursorHeight", 1, updateSelection, true); - option("singleCursorHeightPerLine", true, updateSelection, true); - option("workTime", 100); - option("workDelay", 100); - option("flattenSpans", true, resetModeState, true); - option("addModeClass", false, resetModeState, true); - option("pollInterval", 100); - option("undoDepth", 200, function(cm, val){cm.doc.history.undoDepth = val;}); - option("historyEventDelay", 1250); - option("viewportMargin", 10, function(cm){cm.refresh();}, true); - option("maxHighlightLength", 10000, resetModeState, true); - option("moveInputWithCursor", true, function(cm, val) { - if (!val) cm.display.input.resetPosition(); - }); - - option("tabindex", null, function(cm, val) { - cm.display.input.getField().tabIndex = val || ""; - }); - option("autofocus", null); - - // MODE DEFINITION AND QUERYING - - // Known modes, by name and by MIME - var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; - - // Extra arguments are stored as the mode's dependencies, which is - // used by (legacy) mechanisms like loadmode.js to automatically - // load a mode. (Preferred mechanism is the require/define calls.) - CodeMirror.defineMode = function(name, mode) { - if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; - if (arguments.length > 2) - mode.dependencies = Array.prototype.slice.call(arguments, 2); - modes[name] = mode; - }; - - CodeMirror.defineMIME = function(mime, spec) { - mimeModes[mime] = spec; - }; - - // Given a MIME type, a {name, ...options} config object, or a name - // string, return a mode config object. - CodeMirror.resolveMode = function(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - var found = mimeModes[spec.name]; - if (typeof found == "string") found = {name: found}; - spec = createObj(found, spec); - spec.name = found.name; - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { - return CodeMirror.resolveMode("application/xml"); - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { - return CodeMirror.resolveMode("application/json"); - } - if (typeof spec == "string") return {name: spec}; - else return spec || {name: "null"}; - }; - - // Given a mode spec (anything that resolveMode accepts), find and - // initialize an actual mode object. - CodeMirror.getMode = function(options, spec) { - var spec = CodeMirror.resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) return CodeMirror.getMode(options, "text/plain"); - var modeObj = mfactory(options, spec); - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name]; - for (var prop in exts) { - if (!exts.hasOwnProperty(prop)) continue; - if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; - modeObj[prop] = exts[prop]; - } - } - modeObj.name = spec.name; - if (spec.helperType) modeObj.helperType = spec.helperType; - if (spec.modeProps) for (var prop in spec.modeProps) - modeObj[prop] = spec.modeProps[prop]; - - return modeObj; - }; - - // Minimal default mode. - CodeMirror.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; - }); - CodeMirror.defineMIME("text/plain", "null"); - - // This can be used to attach properties to mode objects from - // outside the actual mode definition. - var modeExtensions = CodeMirror.modeExtensions = {}; - CodeMirror.extendMode = function(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); - copyObj(properties, exts); - }; - - // EXTENSIONS - - CodeMirror.defineExtension = function(name, func) { - CodeMirror.prototype[name] = func; - }; - CodeMirror.defineDocExtension = function(name, func) { - Doc.prototype[name] = func; - }; - CodeMirror.defineOption = option; - - var initHooks = []; - CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; - - var helpers = CodeMirror.helpers = {}; - CodeMirror.registerHelper = function(type, name, value) { - if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []}; - helpers[type][name] = value; - }; - CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { - CodeMirror.registerHelper(type, name, value); - helpers[type]._global.push({pred: predicate, val: value}); - }; - - // MODE STATE HANDLING - - // Utility functions for working with state. Exported because nested - // modes need to do this for their inner modes. - - var copyState = CodeMirror.copyState = function(mode, state) { - if (state === true) return state; - if (mode.copyState) return mode.copyState(state); - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) val = val.concat([]); - nstate[n] = val; - } - return nstate; - }; - - var startState = CodeMirror.startState = function(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; - }; - - // Given a mode and a state (for that mode), find the inner mode and - // state at the position that the state refers to. - CodeMirror.innerMode = function(mode, state) { - while (mode.innerMode) { - var info = mode.innerMode(state); - if (!info || info.mode == mode) break; - state = info.state; - mode = info.mode; - } - return info || {mode: mode, state: state}; - }; - - // STANDARD COMMANDS - - // Commands are parameter-less actions that can be performed on an - // editor, mostly used for keybindings. - var commands = CodeMirror.commands = { - selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);}, - singleSelection: function(cm) { - cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); - }, - killLine: function(cm) { - deleteNearSelection(cm, function(range) { - if (range.empty()) { - var len = getLine(cm.doc, range.head.line).text.length; - if (range.head.ch == len && range.head.line < cm.lastLine()) - return {from: range.head, to: Pos(range.head.line + 1, 0)}; - else - return {from: range.head, to: Pos(range.head.line, len)}; - } else { - return {from: range.from(), to: range.to()}; - } - }); - }, - deleteLine: function(cm) { - deleteNearSelection(cm, function(range) { - return {from: Pos(range.from().line, 0), - to: clipPos(cm.doc, Pos(range.to().line + 1, 0))}; - }); - }, - delLineLeft: function(cm) { - deleteNearSelection(cm, function(range) { - return {from: Pos(range.from().line, 0), to: range.from()}; - }); - }, - delWrappedLineLeft: function(cm) { - deleteNearSelection(cm, function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var leftPos = cm.coordsChar({left: 0, top: top}, "div"); - return {from: leftPos, to: range.from()}; - }); - }, - delWrappedLineRight: function(cm) { - deleteNearSelection(cm, function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - return {from: range.from(), to: rightPos }; - }); - }, - undo: function(cm) {cm.undo();}, - redo: function(cm) {cm.redo();}, - undoSelection: function(cm) {cm.undoSelection();}, - redoSelection: function(cm) {cm.redoSelection();}, - goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, - goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, - goLineStart: function(cm) { - cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, - {origin: "+move", bias: 1}); - }, - goLineStartSmart: function(cm) { - cm.extendSelectionsBy(function(range) { - return lineStartSmart(cm, range.head); - }, {origin: "+move", bias: 1}); - }, - goLineEnd: function(cm) { - cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, - {origin: "+move", bias: -1}); - }, - goLineRight: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - }, sel_move); - }, - goLineLeft: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - return cm.coordsChar({left: 0, top: top}, "div"); - }, sel_move); - }, - goLineLeftSmart: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var pos = cm.coordsChar({left: 0, top: top}, "div"); - if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head); - return pos; - }, sel_move); - }, - goLineUp: function(cm) {cm.moveV(-1, "line");}, - goLineDown: function(cm) {cm.moveV(1, "line");}, - goPageUp: function(cm) {cm.moveV(-1, "page");}, - goPageDown: function(cm) {cm.moveV(1, "page");}, - goCharLeft: function(cm) {cm.moveH(-1, "char");}, - goCharRight: function(cm) {cm.moveH(1, "char");}, - goColumnLeft: function(cm) {cm.moveH(-1, "column");}, - goColumnRight: function(cm) {cm.moveH(1, "column");}, - goWordLeft: function(cm) {cm.moveH(-1, "word");}, - goGroupRight: function(cm) {cm.moveH(1, "group");}, - goGroupLeft: function(cm) {cm.moveH(-1, "group");}, - goWordRight: function(cm) {cm.moveH(1, "word");}, - delCharBefore: function(cm) {cm.deleteH(-1, "char");}, - delCharAfter: function(cm) {cm.deleteH(1, "char");}, - delWordBefore: function(cm) {cm.deleteH(-1, "word");}, - delWordAfter: function(cm) {cm.deleteH(1, "word");}, - delGroupBefore: function(cm) {cm.deleteH(-1, "group");}, - delGroupAfter: function(cm) {cm.deleteH(1, "group");}, - indentAuto: function(cm) {cm.indentSelection("smart");}, - indentMore: function(cm) {cm.indentSelection("add");}, - indentLess: function(cm) {cm.indentSelection("subtract");}, - insertTab: function(cm) {cm.replaceSelection("\t");}, - insertSoftTab: function(cm) { - var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].from(); - var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); - spaces.push(spaceStr(tabSize - col % tabSize)); - } - cm.replaceSelections(spaces); - }, - defaultTab: function(cm) { - if (cm.somethingSelected()) cm.indentSelection("add"); - else cm.execCommand("insertTab"); - }, - transposeChars: function(cm) { - runInOp(cm, function() { - var ranges = cm.listSelections(), newSel = []; - for (var i = 0; i < ranges.length; i++) { - var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; - if (line) { - if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1); - if (cur.ch > 0) { - cur = new Pos(cur.line, cur.ch + 1); - cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), - Pos(cur.line, cur.ch - 2), cur, "+transpose"); - } else if (cur.line > cm.doc.first) { - var prev = getLine(cm.doc, cur.line - 1).text; - if (prev) - cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + - prev.charAt(prev.length - 1), - Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose"); - } - } - newSel.push(new Range(cur, cur)); - } - cm.setSelections(newSel); - }); - }, - newlineAndIndent: function(cm) { - runInOp(cm, function() { - var len = cm.listSelections().length; - for (var i = 0; i < len; i++) { - var range = cm.listSelections()[i]; - cm.replaceRange(cm.doc.lineSeparator(), range.anchor, range.head, "+input"); - cm.indentLine(range.from().line + 1, null, true); - } - ensureCursorVisible(cm); - }); - }, - openLine: function(cm) {cm.replaceSelection("\n", "start")}, - toggleOverwrite: function(cm) {cm.toggleOverwrite();} - }; - - - // STANDARD KEYMAPS - - var keyMap = CodeMirror.keyMap = {}; - - keyMap.basic = { - "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", - "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", - "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", - "Tab": "defaultTab", "Shift-Tab": "indentAuto", - "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", - "Esc": "singleSelection" - }; - // Note that the save and find-related commands aren't defined by - // default. User code or addons can define them. Unknown commands - // are simply ignored. - keyMap.pcDefault = { - "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", - "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", - "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", - "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", - "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", - "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", - fallthrough: "basic" - }; - // Very basic readline/emacs-style bindings, which are standard on Mac. - keyMap.emacsy = { - "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", - "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", - "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", - "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", - "Ctrl-O": "openLine" - }; - keyMap.macDefault = { - "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", - "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", - "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", - "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", - "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", - "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", - fallthrough: ["basic", "emacsy"] - }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; - - // KEYMAP DISPATCH - - function normalizeKeyName(name) { - var parts = name.split(/-(?!$)/), name = parts[parts.length - 1]; - var alt, ctrl, shift, cmd; - for (var i = 0; i < parts.length - 1; i++) { - var mod = parts[i]; - if (/^(cmd|meta|m)$/i.test(mod)) cmd = true; - else if (/^a(lt)?$/i.test(mod)) alt = true; - else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true; - else if (/^s(hift)$/i.test(mod)) shift = true; - else throw new Error("Unrecognized modifier name: " + mod); - } - if (alt) name = "Alt-" + name; - if (ctrl) name = "Ctrl-" + name; - if (cmd) name = "Cmd-" + name; - if (shift) name = "Shift-" + name; - return name; - } - - // This is a kludge to keep keymaps mostly working as raw objects - // (backwards compatibility) while at the same time support features - // like normalization and multi-stroke key bindings. It compiles a - // new normalized keymap, and then updates the old object to reflect - // this. - CodeMirror.normalizeKeyMap = function(keymap) { - var copy = {}; - for (var keyname in keymap) if (keymap.hasOwnProperty(keyname)) { - var value = keymap[keyname]; - if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) continue; - if (value == "...") { delete keymap[keyname]; continue; } - - var keys = map(keyname.split(" "), normalizeKeyName); - for (var i = 0; i < keys.length; i++) { - var val, name; - if (i == keys.length - 1) { - name = keys.join(" "); - val = value; - } else { - name = keys.slice(0, i + 1).join(" "); - val = "..."; - } - var prev = copy[name]; - if (!prev) copy[name] = val; - else if (prev != val) throw new Error("Inconsistent bindings for " + name); - } - delete keymap[keyname]; - } - for (var prop in copy) keymap[prop] = copy[prop]; - return keymap; - }; - - var lookupKey = CodeMirror.lookupKey = function(key, map, handle, context) { - map = getKeyMap(map); - var found = map.call ? map.call(key, context) : map[key]; - if (found === false) return "nothing"; - if (found === "...") return "multi"; - if (found != null && handle(found)) return "handled"; - - if (map.fallthrough) { - if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") - return lookupKey(key, map.fallthrough, handle, context); - for (var i = 0; i < map.fallthrough.length; i++) { - var result = lookupKey(key, map.fallthrough[i], handle, context); - if (result) return result; - } - } - }; - - // Modifier key presses don't count as 'real' key presses for the - // purpose of keymap fallthrough. - var isModifierKey = CodeMirror.isModifierKey = function(value) { - var name = typeof value == "string" ? value : keyNames[value.keyCode]; - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; - }; - - // Look up the name of a key as indicated by an event object. - var keyName = CodeMirror.keyName = function(event, noShift) { - if (presto && event.keyCode == 34 && event["char"]) return false; - var base = keyNames[event.keyCode], name = base; - if (name == null || event.altGraphKey) return false; - if (event.altKey && base != "Alt") name = "Alt-" + name; - if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") name = "Ctrl-" + name; - if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") name = "Cmd-" + name; - if (!noShift && event.shiftKey && base != "Shift") name = "Shift-" + name; - return name; - }; - - function getKeyMap(val) { - return typeof val == "string" ? keyMap[val] : val; - } - - // FROMTEXTAREA - - CodeMirror.fromTextArea = function(textarea, options) { - options = options ? copyObj(options) : {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabIndex) - options.tabindex = textarea.tabIndex; - if (!options.placeholder && textarea.placeholder) - options.placeholder = textarea.placeholder; - // Set autofocus to true if this textarea is focused, or if it has - // autofocus and no other element is focused. - if (options.autofocus == null) { - var hasFocus = activeElt(); - options.autofocus = hasFocus == textarea || - textarea.getAttribute("autofocus") != null && hasFocus == document.body; - } - - function save() {textarea.value = cm.getValue();} - if (textarea.form) { - on(textarea.form, "submit", save); - // Deplorable hack to make the submit method do the right thing. - if (!options.leaveSubmitMethodAlone) { - var form = textarea.form, realSubmit = form.submit; - try { - var wrappedSubmit = form.submit = function() { - save(); - form.submit = realSubmit; - form.submit(); - form.submit = wrappedSubmit; - }; - } catch(e) {} - } - } - - options.finishInit = function(cm) { - cm.save = save; - cm.getTextArea = function() { return textarea; }; - cm.toTextArea = function() { - cm.toTextArea = isNaN; // Prevent this from being ran twice - save(); - textarea.parentNode.removeChild(cm.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - off(textarea.form, "submit", save); - if (typeof textarea.form.submit == "function") - textarea.form.submit = realSubmit; - } - }; - }; - - textarea.style.display = "none"; - var cm = CodeMirror(function(node) { - textarea.parentNode.insertBefore(node, textarea.nextSibling); - }, options); - return cm; - }; - - // STRING STREAM - - // Fed to the mode parsers, provides helper functions to make - // parsers more succinct. - - var StringStream = CodeMirror.StringStream = function(string, tabSize) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; - }; - - StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == this.lineStart;}, - peek: function() {return this.string.charAt(this.pos) || undefined;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); - this.lastColumnPos = this.start; - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }, - indentation: function() { - return countColumn(this.string, null, this.tabSize) - - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);}, - hideFirstChars: function(n, inner) { - this.lineStart += n; - try { return inner(); } - finally { this.lineStart -= n; } - } - }; - - // TEXTMARKERS - - // Created with markText and setBookmark methods. A TextMarker is a - // handle that can be used to clear or find a marked position in the - // document. Line objects hold arrays (markedSpans) containing - // {from, to, marker} object pointing to such marker objects, and - // indicating that such a marker is present on that line. Multiple - // lines may point to the same marker when it spans across lines. - // The spans will have null for their from/to properties when the - // marker continues beyond the start/end of the line. Markers have - // links back to the lines they currently touch. - - var nextMarkerId = 0; - - var TextMarker = CodeMirror.TextMarker = function(doc, type) { - this.lines = []; - this.type = type; - this.doc = doc; - this.id = ++nextMarkerId; - }; - eventMixin(TextMarker); - - // Clear the marker. - TextMarker.prototype.clear = function() { - if (this.explicitlyCleared) return; - var cm = this.doc.cm, withOp = cm && !cm.curOp; - if (withOp) startOperation(cm); - if (hasHandler(this, "clear")) { - var found = this.find(); - if (found) signalLater(this, "clear", found.from, found.to); - } - var min = null, max = null; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (cm && !this.collapsed) regLineChange(cm, lineNo(line), "text"); - else if (cm) { - if (span.to != null) max = lineNo(line); - if (span.from != null) min = lineNo(line); - } - line.markedSpans = removeMarkedSpan(line.markedSpans, span); - if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) - updateLineHeight(line, textHeight(cm.display)); - } - if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) { - var visual = visualLine(this.lines[i]), len = lineLength(visual); - if (len > cm.display.maxLineLength) { - cm.display.maxLine = visual; - cm.display.maxLineLength = len; - cm.display.maxLineChanged = true; - } - } - - if (min != null && cm && this.collapsed) regChange(cm, min, max + 1); - this.lines.length = 0; - this.explicitlyCleared = true; - if (this.atomic && this.doc.cantEdit) { - this.doc.cantEdit = false; - if (cm) reCheckSelection(cm.doc); - } - if (cm) signalLater(cm, "markerCleared", cm, this); - if (withOp) endOperation(cm); - if (this.parent) this.parent.clear(); - }; - - // Find the position of the marker in the document. Returns a {from, - // to} object by default. Side can be passed to get a specific side - // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the - // Pos objects returned contain a line object, rather than a line - // number (used to prevent looking up the same line twice). - TextMarker.prototype.find = function(side, lineObj) { - if (side == null && this.type == "bookmark") side = 1; - var from, to; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (span.from != null) { - from = Pos(lineObj ? line : lineNo(line), span.from); - if (side == -1) return from; - } - if (span.to != null) { - to = Pos(lineObj ? line : lineNo(line), span.to); - if (side == 1) return to; - } - } - return from && {from: from, to: to}; - }; - - // Signals that the marker's widget changed, and surrounding layout - // should be recomputed. - TextMarker.prototype.changed = function() { - var pos = this.find(-1, true), widget = this, cm = this.doc.cm; - if (!pos || !cm) return; - runInOp(cm, function() { - var line = pos.line, lineN = lineNo(pos.line); - var view = findViewForLine(cm, lineN); - if (view) { - clearLineMeasurementCacheFor(view); - cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; - } - cm.curOp.updateMaxLine = true; - if (!lineIsHidden(widget.doc, line) && widget.height != null) { - var oldHeight = widget.height; - widget.height = null; - var dHeight = widgetHeight(widget) - oldHeight; - if (dHeight) - updateLineHeight(line, line.height + dHeight); - } - }); - }; - - TextMarker.prototype.attachLine = function(line) { - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) - (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); - } - this.lines.push(line); - }; - TextMarker.prototype.detachLine = function(line) { - this.lines.splice(indexOf(this.lines, line), 1); - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); - } - }; - - // Collapsed markers have unique ids, in order to be able to order - // them, which is needed for uniquely determining an outer marker - // when they overlap (they may nest, but not partially overlap). - var nextMarkerId = 0; - - // Create a marker, wire it up to the right lines, and - function markText(doc, from, to, options, type) { - // Shared markers (across linked documents) are handled separately - // (markTextShared will call out to this again, once per - // document). - if (options && options.shared) return markTextShared(doc, from, to, options, type); - // Ensure we are in an operation. - if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); - - var marker = new TextMarker(doc, type), diff = cmp(from, to); - if (options) copyObj(options, marker, false); - // Don't connect empty markers unless clearWhenEmpty is false - if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) - return marker; - if (marker.replacedWith) { - // Showing up as a widget implies collapsed (widget replaces text) - marker.collapsed = true; - marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget"); - if (!options.handleMouseEvents) marker.widgetNode.setAttribute("cm-ignore-events", "true"); - if (options.insertLeft) marker.widgetNode.insertLeft = true; - } - if (marker.collapsed) { - if (conflictingCollapsedRange(doc, from.line, from, to, marker) || - from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) - throw new Error("Inserting collapsed marker partially overlapping an existing one"); - sawCollapsedSpans = true; - } - - if (marker.addToHistory) - addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); - - var curLine = from.line, cm = doc.cm, updateMaxLine; - doc.iter(curLine, to.line + 1, function(line) { - if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) - updateMaxLine = true; - if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0); - addMarkedSpan(line, new MarkedSpan(marker, - curLine == from.line ? from.ch : null, - curLine == to.line ? to.ch : null)); - ++curLine; - }); - // lineIsHidden depends on the presence of the spans, so needs a second pass - if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) { - if (lineIsHidden(doc, line)) updateLineHeight(line, 0); - }); - - if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); }); - - if (marker.readOnly) { - sawReadOnlySpans = true; - if (doc.history.done.length || doc.history.undone.length) - doc.clearHistory(); - } - if (marker.collapsed) { - marker.id = ++nextMarkerId; - marker.atomic = true; - } - if (cm) { - // Sync editor state - if (updateMaxLine) cm.curOp.updateMaxLine = true; - if (marker.collapsed) - regChange(cm, from.line, to.line + 1); - else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) - for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text"); - if (marker.atomic) reCheckSelection(cm.doc); - signalLater(cm, "markerAdded", cm, marker); - } - return marker; - } - - // SHARED TEXTMARKERS - - // A shared marker spans multiple linked documents. It is - // implemented as a meta-marker-object controlling multiple normal - // markers. - var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) { - this.markers = markers; - this.primary = primary; - for (var i = 0; i < markers.length; ++i) - markers[i].parent = this; - }; - eventMixin(SharedTextMarker); - - SharedTextMarker.prototype.clear = function() { - if (this.explicitlyCleared) return; - this.explicitlyCleared = true; - for (var i = 0; i < this.markers.length; ++i) - this.markers[i].clear(); - signalLater(this, "clear"); - }; - SharedTextMarker.prototype.find = function(side, lineObj) { - return this.primary.find(side, lineObj); - }; - - function markTextShared(doc, from, to, options, type) { - options = copyObj(options); - options.shared = false; - var markers = [markText(doc, from, to, options, type)], primary = markers[0]; - var widget = options.widgetNode; - linkedDocs(doc, function(doc) { - if (widget) options.widgetNode = widget.cloneNode(true); - markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); - for (var i = 0; i < doc.linked.length; ++i) - if (doc.linked[i].isParent) return; - primary = lst(markers); - }); - return new SharedTextMarker(markers, primary); - } - - function findSharedMarkers(doc) { - return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), - function(m) { return m.parent; }); - } - - function copySharedMarkers(doc, markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], pos = marker.find(); - var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); - if (cmp(mFrom, mTo)) { - var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); - marker.markers.push(subMark); - subMark.parent = marker; - } - } - } - - function detachSharedMarkers(markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], linked = [marker.primary.doc];; - linkedDocs(marker.primary.doc, function(d) { linked.push(d); }); - for (var j = 0; j < marker.markers.length; j++) { - var subMarker = marker.markers[j]; - if (indexOf(linked, subMarker.doc) == -1) { - subMarker.parent = null; - marker.markers.splice(j--, 1); - } - } - } - } - - // TEXTMARKER SPANS - - function MarkedSpan(marker, from, to) { - this.marker = marker; - this.from = from; this.to = to; - } - - // Search an array of spans for a span matching the given marker. - function getMarkedSpanFor(spans, marker) { - if (spans) for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.marker == marker) return span; - } - } - // Remove a span from an array, returning undefined if no spans are - // left (we don't store arrays for lines without spans). - function removeMarkedSpan(spans, span) { - for (var r, i = 0; i < spans.length; ++i) - if (spans[i] != span) (r || (r = [])).push(spans[i]); - return r; - } - // Add a span to a line. - function addMarkedSpan(line, span) { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; - span.marker.attachLine(line); - } - - // Used for the algorithm that adjusts markers for a change in the - // document. These functions cut an array of spans at a given - // character position, returning an array of remaining chunks (or - // undefined if nothing remains). - function markedSpansBefore(old, startCh, isInsert) { - if (old) for (var i = 0, nw; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); - if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); - (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); - } - } - return nw; - } - function markedSpansAfter(old, endCh, isInsert) { - if (old) for (var i = 0, nw; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); - if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); - (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, - span.to == null ? null : span.to - endCh)); - } - } - return nw; - } - - // Given a change object, compute the new set of marker spans that - // cover the line in which the change took place. Removes spans - // entirely within the change, reconnects spans belonging to the - // same marker that appear on both sides of the change, and cuts off - // spans partially within the change. Returns an array of span - // arrays with one element for each line in (after) the change. - function stretchSpansOverChange(doc, change) { - if (change.full) return null; - var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; - var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; - if (!oldFirst && !oldLast) return null; - - var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; - // Get the spans that 'stick out' on both sides - var first = markedSpansBefore(oldFirst, startCh, isInsert); - var last = markedSpansAfter(oldLast, endCh, isInsert); - - // Next, merge those two ends - var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); - if (first) { - // Fix up .to properties of first - for (var i = 0; i < first.length; ++i) { - var span = first[i]; - if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker); - if (!found) span.to = startCh; - else if (sameLine) span.to = found.to == null ? null : found.to + offset; - } - } - } - if (last) { - // Fix up .from in last (or move them into first in case of sameLine) - for (var i = 0; i < last.length; ++i) { - var span = last[i]; - if (span.to != null) span.to += offset; - if (span.from == null) { - var found = getMarkedSpanFor(first, span.marker); - if (!found) { - span.from = offset; - if (sameLine) (first || (first = [])).push(span); - } - } else { - span.from += offset; - if (sameLine) (first || (first = [])).push(span); - } - } - } - // Make sure we didn't create any zero-length spans - if (first) first = clearEmptySpans(first); - if (last && last != first) last = clearEmptySpans(last); - - var newMarkers = [first]; - if (!sameLine) { - // Fill gap with whole-line-spans - var gap = change.text.length - 2, gapMarkers; - if (gap > 0 && first) - for (var i = 0; i < first.length; ++i) - if (first[i].to == null) - (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null)); - for (var i = 0; i < gap; ++i) - newMarkers.push(gapMarkers); - newMarkers.push(last); - } - return newMarkers; - } - - // Remove spans that are empty and don't have a clearWhenEmpty - // option of false. - function clearEmptySpans(spans) { - for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) - spans.splice(i--, 1); - } - if (!spans.length) return null; - return spans; - } - - // Used for un/re-doing changes from the history. Combines the - // result of computing the existing spans with the set of spans that - // existed in the history (so that deleting around a span and then - // undoing brings back the span). - function mergeOldSpans(doc, change) { - var old = getOldSpans(doc, change); - var stretched = stretchSpansOverChange(doc, change); - if (!old) return stretched; - if (!stretched) return old; - - for (var i = 0; i < old.length; ++i) { - var oldCur = old[i], stretchCur = stretched[i]; - if (oldCur && stretchCur) { - spans: for (var j = 0; j < stretchCur.length; ++j) { - var span = stretchCur[j]; - for (var k = 0; k < oldCur.length; ++k) - if (oldCur[k].marker == span.marker) continue spans; - oldCur.push(span); - } - } else if (stretchCur) { - old[i] = stretchCur; - } - } - return old; - } - - // Used to 'clip' out readOnly ranges when making a change. - function removeReadOnlyRanges(doc, from, to) { - var markers = null; - doc.iter(from.line, to.line + 1, function(line) { - if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { - var mark = line.markedSpans[i].marker; - if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) - (markers || (markers = [])).push(mark); - } - }); - if (!markers) return null; - var parts = [{from: from, to: to}]; - for (var i = 0; i < markers.length; ++i) { - var mk = markers[i], m = mk.find(0); - for (var j = 0; j < parts.length; ++j) { - var p = parts[j]; - if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue; - var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); - if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) - newParts.push({from: p.from, to: m.from}); - if (dto > 0 || !mk.inclusiveRight && !dto) - newParts.push({from: m.to, to: p.to}); - parts.splice.apply(parts, newParts); - j += newParts.length - 1; - } - } - return parts; - } - - // Connect or disconnect spans from a line. - function detachMarkedSpans(line) { - var spans = line.markedSpans; - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.detachLine(line); - line.markedSpans = null; - } - function attachMarkedSpans(line, spans) { - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.attachLine(line); - line.markedSpans = spans; - } - - // Helpers used when computing which overlapping collapsed span - // counts as the larger one. - function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; } - function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; } - - // Returns a number indicating which of two overlapping collapsed - // spans is larger (and thus includes the other). Falls back to - // comparing ids when the spans cover exactly the same range. - function compareCollapsedMarkers(a, b) { - var lenDiff = a.lines.length - b.lines.length; - if (lenDiff != 0) return lenDiff; - var aPos = a.find(), bPos = b.find(); - var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); - if (fromCmp) return -fromCmp; - var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); - if (toCmp) return toCmp; - return b.id - a.id; - } - - // Find out whether a line ends or starts in a collapsed span. If - // so, return the marker for that span. - function collapsedSpanAtSide(line, start) { - var sps = sawCollapsedSpans && line.markedSpans, found; - if (sps) for (var sp, i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && - (!found || compareCollapsedMarkers(found, sp.marker) < 0)) - found = sp.marker; - } - return found; - } - function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); } - function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); } - - // Test whether there exists a collapsed span that partially - // overlaps (covers the start or end, but not both) of a new span. - // Such overlap is not allowed. - function conflictingCollapsedRange(doc, lineNo, from, to, marker) { - var line = getLine(doc, lineNo); - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) for (var i = 0; i < sps.length; ++i) { - var sp = sps[i]; - if (!sp.marker.collapsed) continue; - var found = sp.marker.find(0); - var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); - var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); - if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; - if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || - fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) - return true; - } - } - - // A visual line is a line as drawn on the screen. Folding, for - // example, can cause multiple logical lines to appear on the same - // visual line. This finds the start of the visual line that the - // given line is part of (usually that is the line itself). - function visualLine(line) { - var merged; - while (merged = collapsedSpanAtStart(line)) - line = merged.find(-1, true).line; - return line; - } - - // Returns an array of logical lines that continue the visual line - // started by the argument, or undefined if there are no such lines. - function visualLineContinued(line) { - var merged, lines; - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - (lines || (lines = [])).push(line); - } - return lines; - } - - // Get the line number of the start of the visual line that the - // given line number is part of. - function visualLineNo(doc, lineN) { - var line = getLine(doc, lineN), vis = visualLine(line); - if (line == vis) return lineN; - return lineNo(vis); - } - // Get the line number of the start of the next visual line after - // the given line. - function visualLineEndNo(doc, lineN) { - if (lineN > doc.lastLine()) return lineN; - var line = getLine(doc, lineN), merged; - if (!lineIsHidden(doc, line)) return lineN; - while (merged = collapsedSpanAtEnd(line)) - line = merged.find(1, true).line; - return lineNo(line) + 1; - } - - // Compute whether a line is hidden. Lines count as hidden when they - // are part of a visual line that starts with another line, or when - // they are entirely covered by collapsed, non-widget span. - function lineIsHidden(doc, line) { - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) for (var sp, i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (!sp.marker.collapsed) continue; - if (sp.from == null) return true; - if (sp.marker.widgetNode) continue; - if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) - return true; - } - } - function lineIsHiddenInner(doc, line, span) { - if (span.to == null) { - var end = span.marker.find(1, true); - return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); - } - if (span.marker.inclusiveRight && span.to == line.text.length) - return true; - for (var sp, i = 0; i < line.markedSpans.length; ++i) { - sp = line.markedSpans[i]; - if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && - (sp.to == null || sp.to != span.from) && - (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && - lineIsHiddenInner(doc, line, sp)) return true; - } - } - - // LINE WIDGETS - - // Line widgets are block elements displayed above or below a line. - - var LineWidget = CodeMirror.LineWidget = function(doc, node, options) { - if (options) for (var opt in options) if (options.hasOwnProperty(opt)) - this[opt] = options[opt]; - this.doc = doc; - this.node = node; - }; - eventMixin(LineWidget); - - function adjustScrollWhenAboveVisible(cm, line, diff) { - if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) - addToScrollPos(cm, null, diff); - } - - LineWidget.prototype.clear = function() { - var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); - if (no == null || !ws) return; - for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); - if (!ws.length) line.widgets = null; - var height = widgetHeight(this); - updateLineHeight(line, Math.max(0, line.height - height)); - if (cm) runInOp(cm, function() { - adjustScrollWhenAboveVisible(cm, line, -height); - regLineChange(cm, no, "widget"); - }); - }; - LineWidget.prototype.changed = function() { - var oldH = this.height, cm = this.doc.cm, line = this.line; - this.height = null; - var diff = widgetHeight(this) - oldH; - if (!diff) return; - updateLineHeight(line, line.height + diff); - if (cm) runInOp(cm, function() { - cm.curOp.forceUpdate = true; - adjustScrollWhenAboveVisible(cm, line, diff); - }); - }; - - function widgetHeight(widget) { - if (widget.height != null) return widget.height; - var cm = widget.doc.cm; - if (!cm) return 0; - if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;"; - if (widget.coverGutter) - parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; - if (widget.noHScroll) - parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; - removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); - } - return widget.height = widget.node.parentNode.offsetHeight; - } - - function addLineWidget(doc, handle, node, options) { - var widget = new LineWidget(doc, node, options); - var cm = doc.cm; - if (cm && widget.noHScroll) cm.display.alignWidgets = true; - changeLine(doc, handle, "widget", function(line) { - var widgets = line.widgets || (line.widgets = []); - if (widget.insertAt == null) widgets.push(widget); - else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); - widget.line = line; - if (cm && !lineIsHidden(doc, line)) { - var aboveVisible = heightAtLine(line) < doc.scrollTop; - updateLineHeight(line, line.height + widgetHeight(widget)); - if (aboveVisible) addToScrollPos(cm, null, widget.height); - cm.curOp.forceUpdate = true; - } - return true; - }); - return widget; - } - - // LINE DATA STRUCTURE - - // Line objects. These hold state related to a line, including - // highlighting info (the styles array). - var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) { - this.text = text; - attachMarkedSpans(this, markedSpans); - this.height = estimateHeight ? estimateHeight(this) : 1; - }; - eventMixin(Line); - Line.prototype.lineNo = function() { return lineNo(this); }; - - // Change the content (text, markers) of a line. Automatically - // invalidates cached information and tries to re-estimate the - // line's height. - function updateLine(line, text, markedSpans, estimateHeight) { - line.text = text; - if (line.stateAfter) line.stateAfter = null; - if (line.styles) line.styles = null; - if (line.order != null) line.order = null; - detachMarkedSpans(line); - attachMarkedSpans(line, markedSpans); - var estHeight = estimateHeight ? estimateHeight(line) : 1; - if (estHeight != line.height) updateLineHeight(line, estHeight); - } - - // Detach a line from the document tree and its markers. - function cleanUpLine(line) { - line.parent = null; - detachMarkedSpans(line); - } - - function extractLineClasses(type, output) { - if (type) for (;;) { - var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); - if (!lineClass) break; - type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); - var prop = lineClass[1] ? "bgClass" : "textClass"; - if (output[prop] == null) - output[prop] = lineClass[2]; - else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) - output[prop] += " " + lineClass[2]; - } - return type; - } - - function callBlankLine(mode, state) { - if (mode.blankLine) return mode.blankLine(state); - if (!mode.innerMode) return; - var inner = CodeMirror.innerMode(mode, state); - if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); - } - - function readToken(mode, stream, state, inner) { - for (var i = 0; i < 10; i++) { - if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode; - var style = mode.token(stream, state); - if (stream.pos > stream.start) return style; - } - throw new Error("Mode " + mode.name + " failed to advance stream."); - } - - // Utility for getTokenAt and getLineTokens - function takeToken(cm, pos, precise, asArray) { - function getObj(copy) { - return {start: stream.start, end: stream.pos, - string: stream.current(), - type: style || null, - state: copy ? copyState(doc.mode, state) : state}; - } - - var doc = cm.doc, mode = doc.mode, style; - pos = clipPos(doc, pos); - var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise); - var stream = new StringStream(line.text, cm.options.tabSize), tokens; - if (asArray) tokens = []; - while ((asArray || stream.pos < pos.ch) && !stream.eol()) { - stream.start = stream.pos; - style = readToken(mode, stream, state); - if (asArray) tokens.push(getObj(true)); - } - return asArray ? tokens : getObj(); - } - - // Run the given mode's parser over a line, calling f for each token. - function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { - var flattenSpans = mode.flattenSpans; - if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; - var curStart = 0, curStyle = null; - var stream = new StringStream(text, cm.options.tabSize), style; - var inner = cm.options.addModeClass && [null]; - if (text == "") extractLineClasses(callBlankLine(mode, state), lineClasses); - while (!stream.eol()) { - if (stream.pos > cm.options.maxHighlightLength) { - flattenSpans = false; - if (forceToEnd) processLine(cm, text, state, stream.pos); - stream.pos = text.length; - style = null; - } else { - style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses); - } - if (inner) { - var mName = inner[0].name; - if (mName) style = "m-" + (style ? mName + " " + style : mName); - } - if (!flattenSpans || curStyle != style) { - while (curStart < stream.start) { - curStart = Math.min(stream.start, curStart + 50000); - f(curStart, curStyle); - } - curStyle = style; - } - stream.start = stream.pos; - } - while (curStart < stream.pos) { - // Webkit seems to refuse to render text nodes longer than 57444 characters - var pos = Math.min(stream.pos, curStart + 50000); - f(pos, curStyle); - curStart = pos; - } - } - - // Compute a style array (an array starting with a mode generation - // -- for invalidation -- followed by pairs of end positions and - // style strings), which is used to highlight the tokens on the - // line. - function highlightLine(cm, line, state, forceToEnd) { - // A styles array always starts with a number identifying the - // mode/overlays that it is based on (for easy invalidation). - var st = [cm.state.modeGen], lineClasses = {}; - // Compute the base array of styles - runMode(cm, line.text, cm.doc.mode, state, function(end, style) { - st.push(end, style); - }, lineClasses, forceToEnd); - - // Run overlays, adjust style array. - for (var o = 0; o < cm.state.overlays.length; ++o) { - var overlay = cm.state.overlays[o], i = 1, at = 0; - runMode(cm, line.text, overlay.mode, true, function(end, style) { - var start = i; - // Ensure there's a token end at the current position, and that i points at it - while (at < end) { - var i_end = st[i]; - if (i_end > end) - st.splice(i, 1, end, st[i+1], i_end); - i += 2; - at = Math.min(end, i_end); - } - if (!style) return; - if (overlay.opaque) { - st.splice(start, i - start, end, "cm-overlay " + style); - i = start + 2; - } else { - for (; start < i; start += 2) { - var cur = st[start+1]; - st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style; - } - } - }, lineClasses); - } - - return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; - } - - function getLineStyles(cm, line, updateFrontier) { - if (!line.styles || line.styles[0] != cm.state.modeGen) { - var state = getStateBefore(cm, lineNo(line)); - var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state); - line.stateAfter = state; - line.styles = result.styles; - if (result.classes) line.styleClasses = result.classes; - else if (line.styleClasses) line.styleClasses = null; - if (updateFrontier === cm.doc.frontier) cm.doc.frontier++; - } - return line.styles; - } - - // Lightweight form of highlight -- proceed over this line and - // update state, but don't save a style array. Used for lines that - // aren't currently visible. - function processLine(cm, text, state, startAt) { - var mode = cm.doc.mode; - var stream = new StringStream(text, cm.options.tabSize); - stream.start = stream.pos = startAt || 0; - if (text == "") callBlankLine(mode, state); - while (!stream.eol()) { - readToken(mode, stream, state); - stream.start = stream.pos; - } - } - - // Convert a style as returned by a mode (either null, or a string - // containing one or more styles) to a CSS style. This is cached, - // and also looks for line-wide styles. - var styleToClassCache = {}, styleToClassCacheWithMode = {}; - function interpretTokenStyle(style, options) { - if (!style || /^\s*$/.test(style)) return null; - var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; - return cache[style] || - (cache[style] = style.replace(/\S+/g, "cm-$&")); - } - - // Render the DOM representation of the text of a line. Also builds - // up a 'line map', which points at the DOM nodes that represent - // specific stretches of text, and is used by the measuring code. - // The returned object contains the DOM node, this map, and - // information about line-wide styles that were set by the mode. - function buildLineContent(cm, lineView) { - // The padding-right forces the element to have a 'border', which - // is needed on Webkit to be able to get line-level bounding - // rectangles for it (in measureChar). - var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); - var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content, - col: 0, pos: 0, cm: cm, - trailingSpace: false, - splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; - lineView.measure = {}; - - // Iterate over the logical lines that make up this visual line. - for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { - var line = i ? lineView.rest[i - 1] : lineView.line, order; - builder.pos = 0; - builder.addToken = buildToken; - // Optionally wire in some hacks into the token-rendering - // algorithm, to deal with browser quirks. - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) - builder.addToken = buildTokenBadBidi(builder.addToken, order); - builder.map = []; - var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); - insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); - if (line.styleClasses) { - if (line.styleClasses.bgClass) - builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); - if (line.styleClasses.textClass) - builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); - } - - // Ensure at least a single node is present, for measuring. - if (builder.map.length == 0) - builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); - - // Store the map and a cache object for the current logical line - if (i == 0) { - lineView.measure.map = builder.map; - lineView.measure.cache = {}; - } else { - (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); - (lineView.measure.caches || (lineView.measure.caches = [])).push({}); - } - } - - // See issue #2901 - if (webkit) { - var last = builder.content.lastChild - if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) - builder.content.className = "cm-tab-wrap-hack"; - } - - signal(cm, "renderLine", cm, lineView.line, builder.pre); - if (builder.pre.className) - builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); - - return builder; - } - - function defaultSpecialCharPlaceholder(ch) { - var token = elt("span", "\u2022", "cm-invalidchar"); - token.title = "\\u" + ch.charCodeAt(0).toString(16); - token.setAttribute("aria-label", token.title); - return token; - } - - // Build up the DOM representation for a single token, and add it to - // the line map. Takes care to render special characters separately. - function buildToken(builder, text, style, startStyle, endStyle, title, css) { - if (!text) return; - var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text - var special = builder.cm.state.specialChars, mustWrap = false; - if (!special.test(text)) { - builder.col += text.length; - var content = document.createTextNode(displayText); - builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie && ie_version < 9) mustWrap = true; - builder.pos += text.length; - } else { - var content = document.createDocumentFragment(), pos = 0; - while (true) { - special.lastIndex = pos; - var m = special.exec(text); - var skipped = m ? m.index - pos : text.length - pos; - if (skipped) { - var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); - if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); - else content.appendChild(txt); - builder.map.push(builder.pos, builder.pos + skipped, txt); - builder.col += skipped; - builder.pos += skipped; - } - if (!m) break; - pos += skipped + 1; - if (m[0] == "\t") { - var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; - var txt = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); - txt.setAttribute("role", "presentation"); - txt.setAttribute("cm-text", "\t"); - builder.col += tabWidth; - } else if (m[0] == "\r" || m[0] == "\n") { - var txt = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); - txt.setAttribute("cm-text", m[0]); - builder.col += 1; - } else { - var txt = builder.cm.options.specialCharPlaceholder(m[0]); - txt.setAttribute("cm-text", m[0]); - if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); - else content.appendChild(txt); - builder.col += 1; - } - builder.map.push(builder.pos, builder.pos + 1, txt); - builder.pos++; - } - } - builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32 - if (style || startStyle || endStyle || mustWrap || css) { - var fullStyle = style || ""; - if (startStyle) fullStyle += startStyle; - if (endStyle) fullStyle += endStyle; - var token = elt("span", [content], fullStyle, css); - if (title) token.title = title; - return builder.content.appendChild(token); - } - builder.content.appendChild(content); - } - - function splitSpaces(text, trailingBefore) { - if (text.length > 1 && !/ /.test(text)) return text - var spaceBefore = trailingBefore, result = "" - for (var i = 0; i < text.length; i++) { - var ch = text.charAt(i) - if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) - ch = "\u00a0" - result += ch - spaceBefore = ch == " " - } - return result - } - - // Work around nonsense dimensions being reported for stretches of - // right-to-left text. - function buildTokenBadBidi(inner, order) { - return function(builder, text, style, startStyle, endStyle, title, css) { - style = style ? style + " cm-force-border" : "cm-force-border"; - var start = builder.pos, end = start + text.length; - for (;;) { - // Find the part that overlaps with the start of this text - for (var i = 0; i < order.length; i++) { - var part = order[i]; - if (part.to > start && part.from <= start) break; - } - if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title, css); - inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); - startStyle = null; - text = text.slice(part.to - start); - start = part.to; - } - }; - } - - function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.widgetNode; - if (widget) builder.map.push(builder.pos, builder.pos + size, widget); - if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { - if (!widget) - widget = builder.content.appendChild(document.createElement("span")); - widget.setAttribute("cm-marker", marker.id); - } - if (widget) { - builder.cm.display.input.setUneditable(widget); - builder.content.appendChild(widget); - } - builder.pos += size; - builder.trailingSpace = false - } - - // Outputs a number of spans to make up a line, taking highlighting - // and marked text into account. - function insertLineContent(line, builder, styles) { - var spans = line.markedSpans, allText = line.text, at = 0; - if (!spans) { - for (var i = 1; i < styles.length; i+=2) - builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); - return; - } - - var len = allText.length, pos = 0, i = 1, text = "", style, css; - var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; - for (;;) { - if (nextChange == pos) { // Update current marker set - spanStyle = spanEndStyle = spanStartStyle = title = css = ""; - collapsed = null; nextChange = Infinity; - var foundBookmarks = [], endStyles - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], m = sp.marker; - if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { - foundBookmarks.push(m); - } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { - if (sp.to != null && sp.to != pos && nextChange > sp.to) { - nextChange = sp.to; - spanEndStyle = ""; - } - if (m.className) spanStyle += " " + m.className; - if (m.css) css = (css ? css + ";" : "") + m.css; - if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; - if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to) - if (m.title && !title) title = m.title; - if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) - collapsed = sp; - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from; - } - } - if (endStyles) for (var j = 0; j < endStyles.length; j += 2) - if (endStyles[j + 1] == nextChange) spanEndStyle += " " + endStyles[j] - - if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j) - buildCollapsedSpan(builder, 0, foundBookmarks[j]); - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, - collapsed.marker, collapsed.from == null); - if (collapsed.to == null) return; - if (collapsed.to == pos) collapsed = false; - } - } - if (pos >= len) break; - - var upto = Math.min(len, nextChange); - while (true) { - if (text) { - var end = pos + text.length; - if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text; - builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, - spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); - } - if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} - pos = end; - spanStartStyle = ""; - } - text = allText.slice(at, at = styles[i++]); - style = interpretTokenStyle(styles[i++], builder.cm.options); - } - } - } - - // DOCUMENT DATA STRUCTURE - - // By default, updates that start and end at the beginning of a line - // are treated specially, in order to make the association of line - // widgets and marker elements with the text behave more intuitive. - function isWholeLineUpdate(doc, change) { - return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && - (!doc.cm || doc.cm.options.wholeLineUpdateBefore); - } - - // Perform a change on the document data structure. - function updateDoc(doc, change, markedSpans, estimateHeight) { - function spansFor(n) {return markedSpans ? markedSpans[n] : null;} - function update(line, text, spans) { - updateLine(line, text, spans, estimateHeight); - signalLater(line, "change", line, change); - } - function linesFor(start, end) { - for (var i = start, result = []; i < end; ++i) - result.push(new Line(text[i], spansFor(i), estimateHeight)); - return result; - } - - var from = change.from, to = change.to, text = change.text; - var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); - var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; - - // Adjust the line structure - if (change.full) { - doc.insert(0, linesFor(0, text.length)); - doc.remove(text.length, doc.size - text.length); - } else if (isWholeLineUpdate(doc, change)) { - // This is a whole-line replace. Treated specially to make - // sure line objects move the way they are supposed to. - var added = linesFor(0, text.length - 1); - update(lastLine, lastLine.text, lastSpans); - if (nlines) doc.remove(from.line, nlines); - if (added.length) doc.insert(from.line, added); - } else if (firstLine == lastLine) { - if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); - } else { - var added = linesFor(1, text.length - 1); - added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - doc.insert(from.line + 1, added); - } - } else if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); - doc.remove(from.line + 1, nlines); - } else { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); - var added = linesFor(1, text.length - 1); - if (nlines > 1) doc.remove(from.line + 1, nlines - 1); - doc.insert(from.line + 1, added); - } - - signalLater(doc, "change", doc, change); - } - - // The document is represented as a BTree consisting of leaves, with - // chunk of lines in them, and branches, with up to ten leaves or - // other branch nodes below them. The top node is always a branch - // node, and is the document object itself (meaning it has - // additional methods and properties). - // - // All nodes have parent links. The tree is used both to go from - // line numbers to line objects, and to go from objects to numbers. - // It also indexes by height, and is used to convert between height - // and line object, and to find the total height of the document. - // - // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html - - function LeafChunk(lines) { - this.lines = lines; - this.parent = null; - for (var i = 0, height = 0; i < lines.length; ++i) { - lines[i].parent = this; - height += lines[i].height; - } - this.height = height; - } - - LeafChunk.prototype = { - chunkSize: function() { return this.lines.length; }, - // Remove the n lines at offset 'at'. - removeInner: function(at, n) { - for (var i = at, e = at + n; i < e; ++i) { - var line = this.lines[i]; - this.height -= line.height; - cleanUpLine(line); - signalLater(line, "delete"); - } - this.lines.splice(at, n); - }, - // Helper used to collapse a small branch into a single leaf. - collapse: function(lines) { - lines.push.apply(lines, this.lines); - }, - // Insert the given array of lines at offset 'at', count them as - // having the given height. - insertInner: function(at, lines, height) { - this.height += height; - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); - for (var i = 0; i < lines.length; ++i) lines[i].parent = this; - }, - // Used to iterate over a part of the tree. - iterN: function(at, n, op) { - for (var e = at + n; at < e; ++at) - if (op(this.lines[at])) return true; - } - }; - - function BranchChunk(children) { - this.children = children; - var size = 0, height = 0; - for (var i = 0; i < children.length; ++i) { - var ch = children[i]; - size += ch.chunkSize(); height += ch.height; - ch.parent = this; - } - this.size = size; - this.height = height; - this.parent = null; - } - - BranchChunk.prototype = { - chunkSize: function() { return this.size; }, - removeInner: function(at, n) { - this.size -= n; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var rm = Math.min(n, sz - at), oldHeight = child.height; - child.removeInner(at, rm); - this.height -= oldHeight - child.height; - if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } - if ((n -= rm) == 0) break; - at = 0; - } else at -= sz; - } - // If the result is smaller than 25 lines, ensure that it is a - // single leaf node. - if (this.size - n < 25 && - (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { - var lines = []; - this.collapse(lines); - this.children = [new LeafChunk(lines)]; - this.children[0].parent = this; - } - }, - collapse: function(lines) { - for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines); - }, - insertInner: function(at, lines, height) { - this.size += lines.length; - this.height += height; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at <= sz) { - child.insertInner(at, lines, height); - if (child.lines && child.lines.length > 50) { - // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. - // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. - var remaining = child.lines.length % 25 + 25 - for (var pos = remaining; pos < child.lines.length;) { - var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); - child.height -= leaf.height; - this.children.splice(++i, 0, leaf); - leaf.parent = this; - } - child.lines = child.lines.slice(0, remaining); - this.maybeSpill(); - } - break; - } - at -= sz; - } - }, - // When a node has grown, check whether it should be split. - maybeSpill: function() { - if (this.children.length <= 10) return; - var me = this; - do { - var spilled = me.children.splice(me.children.length - 5, 5); - var sibling = new BranchChunk(spilled); - if (!me.parent) { // Become the parent node - var copy = new BranchChunk(me.children); - copy.parent = me; - me.children = [copy, sibling]; - me = copy; - } else { - me.size -= sibling.size; - me.height -= sibling.height; - var myIndex = indexOf(me.parent.children, me); - me.parent.children.splice(myIndex + 1, 0, sibling); - } - sibling.parent = me.parent; - } while (me.children.length > 10); - me.parent.maybeSpill(); - }, - iterN: function(at, n, op) { - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var used = Math.min(n, sz - at); - if (child.iterN(at, used, op)) return true; - if ((n -= used) == 0) break; - at = 0; - } else at -= sz; - } - } - }; - - var nextDocId = 0; - var Doc = CodeMirror.Doc = function(text, mode, firstLine, lineSep) { - if (!(this instanceof Doc)) return new Doc(text, mode, firstLine, lineSep); - if (firstLine == null) firstLine = 0; - - BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); - this.first = firstLine; - this.scrollTop = this.scrollLeft = 0; - this.cantEdit = false; - this.cleanGeneration = 1; - this.frontier = firstLine; - var start = Pos(firstLine, 0); - this.sel = simpleSelection(start); - this.history = new History(null); - this.id = ++nextDocId; - this.modeOption = mode; - this.lineSep = lineSep; - this.extend = false; - - if (typeof text == "string") text = this.splitLines(text); - updateDoc(this, {from: start, to: start, text: text}); - setSelection(this, simpleSelection(start), sel_dontScroll); - }; - - Doc.prototype = createObj(BranchChunk.prototype, { - constructor: Doc, - // Iterate over the document. Supports two forms -- with only one - // argument, it calls that for each line in the document. With - // three, it iterates over the range given by the first two (with - // the second being non-inclusive). - iter: function(from, to, op) { - if (op) this.iterN(from - this.first, to - from, op); - else this.iterN(this.first, this.first + this.size, from); - }, - - // Non-public interface for adding and removing lines. - insert: function(at, lines) { - var height = 0; - for (var i = 0; i < lines.length; ++i) height += lines[i].height; - this.insertInner(at - this.first, lines, height); - }, - remove: function(at, n) { this.removeInner(at - this.first, n); }, - - // From here, the methods are part of the public interface. Most - // are also available from CodeMirror (editor) instances. - - getValue: function(lineSep) { - var lines = getLines(this, this.first, this.first + this.size); - if (lineSep === false) return lines; - return lines.join(lineSep || this.lineSeparator()); - }, - setValue: docMethodOp(function(code) { - var top = Pos(this.first, 0), last = this.first + this.size - 1; - makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), - text: this.splitLines(code), origin: "setValue", full: true}, true); - setSelection(this, simpleSelection(top)); - }), - replaceRange: function(code, from, to, origin) { - from = clipPos(this, from); - to = to ? clipPos(this, to) : from; - replaceRange(this, code, from, to, origin); - }, - getRange: function(from, to, lineSep) { - var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); - if (lineSep === false) return lines; - return lines.join(lineSep || this.lineSeparator()); - }, - - getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, - - getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);}, - getLineNumber: function(line) {return lineNo(line);}, - - getLineHandleVisualStart: function(line) { - if (typeof line == "number") line = getLine(this, line); - return visualLine(line); - }, - - lineCount: function() {return this.size;}, - firstLine: function() {return this.first;}, - lastLine: function() {return this.first + this.size - 1;}, - - clipPos: function(pos) {return clipPos(this, pos);}, - - getCursor: function(start) { - var range = this.sel.primary(), pos; - if (start == null || start == "head") pos = range.head; - else if (start == "anchor") pos = range.anchor; - else if (start == "end" || start == "to" || start === false) pos = range.to(); - else pos = range.from(); - return pos; - }, - listSelections: function() { return this.sel.ranges; }, - somethingSelected: function() {return this.sel.somethingSelected();}, - - setCursor: docMethodOp(function(line, ch, options) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); - }), - setSelection: docMethodOp(function(anchor, head, options) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); - }), - extendSelection: docMethodOp(function(head, other, options) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); - }), - extendSelections: docMethodOp(function(heads, options) { - extendSelections(this, clipPosArray(this, heads), options); - }), - extendSelectionsBy: docMethodOp(function(f, options) { - var heads = map(this.sel.ranges, f); - extendSelections(this, clipPosArray(this, heads), options); - }), - setSelections: docMethodOp(function(ranges, primary, options) { - if (!ranges.length) return; - for (var i = 0, out = []; i < ranges.length; i++) - out[i] = new Range(clipPos(this, ranges[i].anchor), - clipPos(this, ranges[i].head)); - if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex); - setSelection(this, normalizeSelection(out, primary), options); - }), - addSelection: docMethodOp(function(anchor, head, options) { - var ranges = this.sel.ranges.slice(0); - ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); - setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); - }), - - getSelection: function(lineSep) { - var ranges = this.sel.ranges, lines; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - lines = lines ? lines.concat(sel) : sel; - } - if (lineSep === false) return lines; - else return lines.join(lineSep || this.lineSeparator()); - }, - getSelections: function(lineSep) { - var parts = [], ranges = this.sel.ranges; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - if (lineSep !== false) sel = sel.join(lineSep || this.lineSeparator()); - parts[i] = sel; - } - return parts; - }, - replaceSelection: function(code, collapse, origin) { - var dup = []; - for (var i = 0; i < this.sel.ranges.length; i++) - dup[i] = code; - this.replaceSelections(dup, collapse, origin || "+input"); - }, - replaceSelections: docMethodOp(function(code, collapse, origin) { - var changes = [], sel = this.sel; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin}; - } - var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); - for (var i = changes.length - 1; i >= 0; i--) - makeChange(this, changes[i]); - if (newSel) setSelectionReplaceHistory(this, newSel); - else if (this.cm) ensureCursorVisible(this.cm); - }), - undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), - redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), - undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), - redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), - - setExtending: function(val) {this.extend = val;}, - getExtending: function() {return this.extend;}, - - historySize: function() { - var hist = this.history, done = 0, undone = 0; - for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done; - for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone; - return {undo: done, redo: undone}; - }, - clearHistory: function() {this.history = new History(this.history.maxGeneration);}, - - markClean: function() { - this.cleanGeneration = this.changeGeneration(true); - }, - changeGeneration: function(forceSplit) { - if (forceSplit) - this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; - return this.history.generation; - }, - isClean: function (gen) { - return this.history.generation == (gen || this.cleanGeneration); - }, - - getHistory: function() { - return {done: copyHistoryArray(this.history.done), - undone: copyHistoryArray(this.history.undone)}; - }, - setHistory: function(histData) { - var hist = this.history = new History(this.history.maxGeneration); - hist.done = copyHistoryArray(histData.done.slice(0), null, true); - hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); - }, - - addLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass"; - if (!line[prop]) line[prop] = cls; - else if (classTest(cls).test(line[prop])) return false; - else line[prop] += " " + cls; - return true; - }); - }), - removeLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass"; - var cur = line[prop]; - if (!cur) return false; - else if (cls == null) line[prop] = null; - else { - var found = cur.match(classTest(cls)); - if (!found) return false; - var end = found.index + found[0].length; - line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; - } - return true; - }); - }), - - addLineWidget: docMethodOp(function(handle, node, options) { - return addLineWidget(this, handle, node, options); - }), - removeLineWidget: function(widget) { widget.clear(); }, - - markText: function(from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range"); - }, - setBookmark: function(pos, options) { - var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), - insertLeft: options && options.insertLeft, - clearWhenEmpty: false, shared: options && options.shared, - handleMouseEvents: options && options.handleMouseEvents}; - pos = clipPos(this, pos); - return markText(this, pos, pos, realOpts, "bookmark"); - }, - findMarksAt: function(pos) { - pos = clipPos(this, pos); - var markers = [], spans = getLine(this, pos.line).markedSpans; - if (spans) for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if ((span.from == null || span.from <= pos.ch) && - (span.to == null || span.to >= pos.ch)) - markers.push(span.marker.parent || span.marker); - } - return markers; - }, - findMarks: function(from, to, filter) { - from = clipPos(this, from); to = clipPos(this, to); - var found = [], lineNo = from.line; - this.iter(from.line, to.line + 1, function(line) { - var spans = line.markedSpans; - if (spans) for (var i = 0; i < spans.length; i++) { - var span = spans[i]; - if (!(span.to != null && lineNo == from.line && from.ch >= span.to || - span.from == null && lineNo != from.line || - span.from != null && lineNo == to.line && span.from >= to.ch) && - (!filter || filter(span.marker))) - found.push(span.marker.parent || span.marker); - } - ++lineNo; - }); - return found; - }, - getAllMarks: function() { - var markers = []; - this.iter(function(line) { - var sps = line.markedSpans; - if (sps) for (var i = 0; i < sps.length; ++i) - if (sps[i].from != null) markers.push(sps[i].marker); - }); - return markers; - }, - - posFromIndex: function(off) { - var ch, lineNo = this.first, sepSize = this.lineSeparator().length; - this.iter(function(line) { - var sz = line.text.length + sepSize; - if (sz > off) { ch = off; return true; } - off -= sz; - ++lineNo; - }); - return clipPos(this, Pos(lineNo, ch)); - }, - indexFromPos: function (coords) { - coords = clipPos(this, coords); - var index = coords.ch; - if (coords.line < this.first || coords.ch < 0) return 0; - var sepSize = this.lineSeparator().length; - this.iter(this.first, coords.line, function (line) { - index += line.text.length + sepSize; - }); - return index; - }, - - copy: function(copyHistory) { - var doc = new Doc(getLines(this, this.first, this.first + this.size), - this.modeOption, this.first, this.lineSep); - doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; - doc.sel = this.sel; - doc.extend = false; - if (copyHistory) { - doc.history.undoDepth = this.history.undoDepth; - doc.setHistory(this.getHistory()); - } - return doc; - }, - - linkedDoc: function(options) { - if (!options) options = {}; - var from = this.first, to = this.first + this.size; - if (options.from != null && options.from > from) from = options.from; - if (options.to != null && options.to < to) to = options.to; - var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep); - if (options.sharedHist) copy.history = this.history; - (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); - copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; - copySharedMarkers(copy, findSharedMarkers(this)); - return copy; - }, - unlinkDoc: function(other) { - if (other instanceof CodeMirror) other = other.doc; - if (this.linked) for (var i = 0; i < this.linked.length; ++i) { - var link = this.linked[i]; - if (link.doc != other) continue; - this.linked.splice(i, 1); - other.unlinkDoc(this); - detachSharedMarkers(findSharedMarkers(this)); - break; - } - // If the histories were shared, split them again - if (other.history == this.history) { - var splitIds = [other.id]; - linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true); - other.history = new History(null); - other.history.done = copyHistoryArray(this.history.done, splitIds); - other.history.undone = copyHistoryArray(this.history.undone, splitIds); - } - }, - iterLinkedDocs: function(f) {linkedDocs(this, f);}, - - getMode: function() {return this.mode;}, - getEditor: function() {return this.cm;}, - - splitLines: function(str) { - if (this.lineSep) return str.split(this.lineSep); - return splitLinesAuto(str); - }, - lineSeparator: function() { return this.lineSep || "\n"; } - }); - - // Public alias. - Doc.prototype.eachLine = Doc.prototype.iter; - - // Set up methods on CodeMirror's prototype to redirect to the editor's document. - var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); - for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) - CodeMirror.prototype[prop] = (function(method) { - return function() {return method.apply(this.doc, arguments);}; - })(Doc.prototype[prop]); - - eventMixin(Doc); - - // Call f for all linked documents. - function linkedDocs(doc, f, sharedHistOnly) { - function propagate(doc, skip, sharedHist) { - if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { - var rel = doc.linked[i]; - if (rel.doc == skip) continue; - var shared = sharedHist && rel.sharedHist; - if (sharedHistOnly && !shared) continue; - f(rel.doc, shared); - propagate(rel.doc, doc, shared); - } - } - propagate(doc, null, true); - } - - // Attach a document to an editor. - function attachDoc(cm, doc) { - if (doc.cm) throw new Error("This document is already in use."); - cm.doc = doc; - doc.cm = cm; - estimateLineHeights(cm); - loadMode(cm); - if (!cm.options.lineWrapping) findMaxLine(cm); - cm.options.mode = doc.modeOption; - regChange(cm); - } - - // LINE UTILITIES - - // Find the line object corresponding to the given line number. - function getLine(doc, n) { - n -= doc.first; - if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); - for (var chunk = doc; !chunk.lines;) { - for (var i = 0;; ++i) { - var child = chunk.children[i], sz = child.chunkSize(); - if (n < sz) { chunk = child; break; } - n -= sz; - } - } - return chunk.lines[n]; - } - - // Get the part of a document between two positions, as an array of - // strings. - function getBetween(doc, start, end) { - var out = [], n = start.line; - doc.iter(start.line, end.line + 1, function(line) { - var text = line.text; - if (n == end.line) text = text.slice(0, end.ch); - if (n == start.line) text = text.slice(start.ch); - out.push(text); - ++n; - }); - return out; - } - // Get the lines between from and to, as array of strings. - function getLines(doc, from, to) { - var out = []; - doc.iter(from, to, function(line) { out.push(line.text); }); - return out; - } - - // Update the height of a line, propagating the height change - // upwards to parent nodes. - function updateLineHeight(line, height) { - var diff = height - line.height; - if (diff) for (var n = line; n; n = n.parent) n.height += diff; - } - - // Given a line object, find its line number by walking up through - // its parent links. - function lineNo(line) { - if (line.parent == null) return null; - var cur = line.parent, no = indexOf(cur.lines, line); - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i = 0;; ++i) { - if (chunk.children[i] == cur) break; - no += chunk.children[i].chunkSize(); - } - } - return no + cur.first; - } - - // Find the line at the given vertical position, using the height - // information in the document tree. - function lineAtHeight(chunk, h) { - var n = chunk.first; - outer: do { - for (var i = 0; i < chunk.children.length; ++i) { - var child = chunk.children[i], ch = child.height; - if (h < ch) { chunk = child; continue outer; } - h -= ch; - n += child.chunkSize(); - } - return n; - } while (!chunk.lines); - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i], lh = line.height; - if (h < lh) break; - h -= lh; - } - return n + i; - } - - - // Find the height above the given line. - function heightAtLine(lineObj) { - lineObj = visualLine(lineObj); - - var h = 0, chunk = lineObj.parent; - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i]; - if (line == lineObj) break; - else h += line.height; - } - for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { - for (var i = 0; i < p.children.length; ++i) { - var cur = p.children[i]; - if (cur == chunk) break; - else h += cur.height; - } - } - return h; - } - - // Get the bidi ordering for the given line (and cache it). Returns - // false for lines that are fully left-to-right, and an array of - // BidiSpan objects otherwise. - function getOrder(line) { - var order = line.order; - if (order == null) order = line.order = bidiOrdering(line.text); - return order; - } - - // HISTORY - - function History(startGen) { - // Arrays of change events and selections. Doing something adds an - // event to done and clears undo. Undoing moves events from done - // to undone, redoing moves them in the other direction. - this.done = []; this.undone = []; - this.undoDepth = Infinity; - // Used to track when changes can be merged into a single undo - // event - this.lastModTime = this.lastSelTime = 0; - this.lastOp = this.lastSelOp = null; - this.lastOrigin = this.lastSelOrigin = null; - // Used by the isClean() method - this.generation = this.maxGeneration = startGen || 1; - } - - // Create a history change event from an updateDoc-style change - // object. - function historyChangeFromChange(doc, change) { - var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; - attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); - linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true); - return histChange; - } - - // Pop all selection events off the end of a history array. Stop at - // a change event. - function clearSelectionEvents(array) { - while (array.length) { - var last = lst(array); - if (last.ranges) array.pop(); - else break; - } - } - - // Find the top change event in the history. Pop off selection - // events that are in the way. - function lastChangeEvent(hist, force) { - if (force) { - clearSelectionEvents(hist.done); - return lst(hist.done); - } else if (hist.done.length && !lst(hist.done).ranges) { - return lst(hist.done); - } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { - hist.done.pop(); - return lst(hist.done); - } - } - - // Register a change in the history. Merges changes that are within - // a single operation, or are close together with an origin that - // allows merging (starting with "+") into a single event. - function addChangeToHistory(doc, change, selAfter, opId) { - var hist = doc.history; - hist.undone.length = 0; - var time = +new Date, cur; - - if ((hist.lastOp == opId || - hist.lastOrigin == change.origin && change.origin && - ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || - change.origin.charAt(0) == "*")) && - (cur = lastChangeEvent(hist, hist.lastOp == opId))) { - // Merge this change into the last event - var last = lst(cur.changes); - if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { - // Optimized case for simple insertion -- don't want to add - // new changesets for every character typed - last.to = changeEnd(change); - } else { - // Add new sub-event - cur.changes.push(historyChangeFromChange(doc, change)); - } - } else { - // Can not be merged, start a new event. - var before = lst(hist.done); - if (!before || !before.ranges) - pushSelectionToHistory(doc.sel, hist.done); - cur = {changes: [historyChangeFromChange(doc, change)], - generation: hist.generation}; - hist.done.push(cur); - while (hist.done.length > hist.undoDepth) { - hist.done.shift(); - if (!hist.done[0].ranges) hist.done.shift(); - } - } - hist.done.push(selAfter); - hist.generation = ++hist.maxGeneration; - hist.lastModTime = hist.lastSelTime = time; - hist.lastOp = hist.lastSelOp = opId; - hist.lastOrigin = hist.lastSelOrigin = change.origin; - - if (!last) signal(doc, "historyAdded"); - } - - function selectionEventCanBeMerged(doc, origin, prev, sel) { - var ch = origin.charAt(0); - return ch == "*" || - ch == "+" && - prev.ranges.length == sel.ranges.length && - prev.somethingSelected() == sel.somethingSelected() && - new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); - } - - // Called whenever the selection changes, sets the new selection as - // the pending selection in the history, and pushes the old pending - // selection into the 'done' array when it was significantly - // different (in number of selected ranges, emptiness, or time). - function addSelectionToHistory(doc, sel, opId, options) { - var hist = doc.history, origin = options && options.origin; - - // A new event is started when the previous origin does not match - // the current, or the origins don't allow matching. Origins - // starting with * are always merged, those starting with + are - // merged when similar and close together in time. - if (opId == hist.lastSelOp || - (origin && hist.lastSelOrigin == origin && - (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || - selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) - hist.done[hist.done.length - 1] = sel; - else - pushSelectionToHistory(sel, hist.done); - - hist.lastSelTime = +new Date; - hist.lastSelOrigin = origin; - hist.lastSelOp = opId; - if (options && options.clearRedo !== false) - clearSelectionEvents(hist.undone); - } - - function pushSelectionToHistory(sel, dest) { - var top = lst(dest); - if (!(top && top.ranges && top.equals(sel))) - dest.push(sel); - } - - // Used to store marked span information in the history. - function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], n = 0; - doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { - if (line.markedSpans) - (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; - ++n; - }); - } - - // When un/re-doing restores text containing marked spans, those - // that have been explicitly cleared should not be restored. - function removeClearedSpans(spans) { - if (!spans) return null; - for (var i = 0, out; i < spans.length; ++i) { - if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } - else if (out) out.push(spans[i]); - } - return !out ? spans : out.length ? out : null; - } - - // Retrieve and filter the old marked spans stored in a change event. - function getOldSpans(doc, change) { - var found = change["spans_" + doc.id]; - if (!found) return null; - for (var i = 0, nw = []; i < change.text.length; ++i) - nw.push(removeClearedSpans(found[i])); - return nw; - } - - // Used both to provide a JSON-safe object in .getHistory, and, when - // detaching a document, to split the history in two - function copyHistoryArray(events, newGroup, instantiateSel) { - for (var i = 0, copy = []; i < events.length; ++i) { - var event = events[i]; - if (event.ranges) { - copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); - continue; - } - var changes = event.changes, newChanges = []; - copy.push({changes: newChanges}); - for (var j = 0; j < changes.length; ++j) { - var change = changes[j], m; - newChanges.push({from: change.from, to: change.to, text: change.text}); - if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) { - if (indexOf(newGroup, Number(m[1])) > -1) { - lst(newChanges)[prop] = change[prop]; - delete change[prop]; - } - } - } - } - return copy; - } - - // Rebasing/resetting history to deal with externally-sourced changes - - function rebaseHistSelSingle(pos, from, to, diff) { - if (to < pos.line) { - pos.line += diff; - } else if (from < pos.line) { - pos.line = from; - pos.ch = 0; - } - } - - // Tries to rebase an array of history events given a change in the - // document. If the change touches the same lines as the event, the - // event, and everything 'behind' it, is discarded. If the change is - // before the event, the event's positions are updated. Uses a - // copy-on-write scheme for the positions, to avoid having to - // reallocate them all on every rebase, but also avoid problems with - // shared position objects being unsafely updated. - function rebaseHistArray(array, from, to, diff) { - for (var i = 0; i < array.length; ++i) { - var sub = array[i], ok = true; - if (sub.ranges) { - if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } - for (var j = 0; j < sub.ranges.length; j++) { - rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); - rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); - } - continue; - } - for (var j = 0; j < sub.changes.length; ++j) { - var cur = sub.changes[j]; - if (to < cur.from.line) { - cur.from = Pos(cur.from.line + diff, cur.from.ch); - cur.to = Pos(cur.to.line + diff, cur.to.ch); - } else if (from <= cur.to.line) { - ok = false; - break; - } - } - if (!ok) { - array.splice(0, i + 1); - i = 0; - } - } - } - - function rebaseHist(hist, change) { - var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; - rebaseHistArray(hist.done, from, to, diff); - rebaseHistArray(hist.undone, from, to, diff); - } - - // EVENT UTILITIES - - // Due to the fact that we still support jurassic IE versions, some - // compatibility wrappers are needed. - - var e_preventDefault = CodeMirror.e_preventDefault = function(e) { - if (e.preventDefault) e.preventDefault(); - else e.returnValue = false; - }; - var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) { - if (e.stopPropagation) e.stopPropagation(); - else e.cancelBubble = true; - }; - function e_defaultPrevented(e) { - return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; - } - var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);}; - - function e_target(e) {return e.target || e.srcElement;} - function e_button(e) { - var b = e.which; - if (b == null) { - if (e.button & 1) b = 1; - else if (e.button & 2) b = 3; - else if (e.button & 4) b = 2; - } - if (mac && e.ctrlKey && b == 1) b = 3; - return b; - } - - // EVENT HANDLING - - // Lightweight event framework. on/off also work on DOM nodes, - // registering native DOM handlers. - - var on = CodeMirror.on = function(emitter, type, f) { - if (emitter.addEventListener) - emitter.addEventListener(type, f, false); - else if (emitter.attachEvent) - emitter.attachEvent("on" + type, f); - else { - var map = emitter._handlers || (emitter._handlers = {}); - var arr = map[type] || (map[type] = []); - arr.push(f); - } - }; - - var noHandlers = [] - function getHandlers(emitter, type, copy) { - var arr = emitter._handlers && emitter._handlers[type] - if (copy) return arr && arr.length > 0 ? arr.slice() : noHandlers - else return arr || noHandlers - } - - var off = CodeMirror.off = function(emitter, type, f) { - if (emitter.removeEventListener) - emitter.removeEventListener(type, f, false); - else if (emitter.detachEvent) - emitter.detachEvent("on" + type, f); - else { - var handlers = getHandlers(emitter, type, false) - for (var i = 0; i < handlers.length; ++i) - if (handlers[i] == f) { handlers.splice(i, 1); break; } - } - }; - - var signal = CodeMirror.signal = function(emitter, type /*, values...*/) { - var handlers = getHandlers(emitter, type, true) - if (!handlers.length) return; - var args = Array.prototype.slice.call(arguments, 2); - for (var i = 0; i < handlers.length; ++i) handlers[i].apply(null, args); - }; - - var orphanDelayedCallbacks = null; - - // Often, we want to signal events at a point where we are in the - // middle of some work, but don't want the handler to start calling - // other methods on the editor, which might be in an inconsistent - // state or simply not expect any other events to happen. - // signalLater looks whether there are any handlers, and schedules - // them to be executed when the last operation ends, or, if no - // operation is active, when a timeout fires. - function signalLater(emitter, type /*, values...*/) { - var arr = getHandlers(emitter, type, false) - if (!arr.length) return; - var args = Array.prototype.slice.call(arguments, 2), list; - if (operationGroup) { - list = operationGroup.delayedCallbacks; - } else if (orphanDelayedCallbacks) { - list = orphanDelayedCallbacks; - } else { - list = orphanDelayedCallbacks = []; - setTimeout(fireOrphanDelayed, 0); - } - function bnd(f) {return function(){f.apply(null, args);};}; - for (var i = 0; i < arr.length; ++i) - list.push(bnd(arr[i])); - } - - function fireOrphanDelayed() { - var delayed = orphanDelayedCallbacks; - orphanDelayedCallbacks = null; - for (var i = 0; i < delayed.length; ++i) delayed[i](); - } - - // The DOM events that CodeMirror handles can be overridden by - // registering a (non-DOM) handler on the editor for the event name, - // and preventDefault-ing the event in that handler. - function signalDOMEvent(cm, e, override) { - if (typeof e == "string") - e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; - signal(cm, override || e.type, cm, e); - return e_defaultPrevented(e) || e.codemirrorIgnore; - } - - function signalCursorActivity(cm) { - var arr = cm._handlers && cm._handlers.cursorActivity; - if (!arr) return; - var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); - for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1) - set.push(arr[i]); - } - - function hasHandler(emitter, type) { - return getHandlers(emitter, type).length > 0 - } - - // Add on and off methods to a constructor's prototype, to make - // registering events on such objects more convenient. - function eventMixin(ctor) { - ctor.prototype.on = function(type, f) {on(this, type, f);}; - ctor.prototype.off = function(type, f) {off(this, type, f);}; - } - - // MISC UTILITIES - - // Number of pixels added to scroller and sizer to hide scrollbar - var scrollerGap = 30; - - // Returned or thrown by various protocols to signal 'I'm not - // handling this'. - var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; - - // Reused option objects for setSelection & friends - var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; - - function Delayed() {this.id = null;} - Delayed.prototype.set = function(ms, f) { - clearTimeout(this.id); - this.id = setTimeout(f, ms); - }; - - // Counts the column offset in a string, taking tabs into account. - // Used mostly to find indentation. - var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) end = string.length; - } - for (var i = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf("\t", i); - if (nextTab < 0 || nextTab >= end) - return n + (end - i); - n += nextTab - i; - n += tabSize - (n % tabSize); - i = nextTab + 1; - } - }; - - // The inverse of countColumn -- find the offset that corresponds to - // a particular column. - var findColumn = CodeMirror.findColumn = function(string, goal, tabSize) { - for (var pos = 0, col = 0;;) { - var nextTab = string.indexOf("\t", pos); - if (nextTab == -1) nextTab = string.length; - var skipped = nextTab - pos; - if (nextTab == string.length || col + skipped >= goal) - return pos + Math.min(skipped, goal - col); - col += nextTab - pos; - col += tabSize - (col % tabSize); - pos = nextTab + 1; - if (col >= goal) return pos; - } - } - - var spaceStrs = [""]; - function spaceStr(n) { - while (spaceStrs.length <= n) - spaceStrs.push(lst(spaceStrs) + " "); - return spaceStrs[n]; - } - - function lst(arr) { return arr[arr.length-1]; } - - var selectInput = function(node) { node.select(); }; - if (ios) // Mobile Safari apparently has a bug where select() is broken. - selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; - else if (ie) // Suppress mysterious IE10 errors - selectInput = function(node) { try { node.select(); } catch(_e) {} }; - - function indexOf(array, elt) { - for (var i = 0; i < array.length; ++i) - if (array[i] == elt) return i; - return -1; - } - function map(array, f) { - var out = []; - for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); - return out; - } - - function insertSorted(array, value, score) { - var pos = 0, priority = score(value) - while (pos < array.length && score(array[pos]) <= priority) pos++ - array.splice(pos, 0, value) - } - - function nothing() {} - - function createObj(base, props) { - var inst; - if (Object.create) { - inst = Object.create(base); - } else { - nothing.prototype = base; - inst = new nothing(); - } - if (props) copyObj(props, inst); - return inst; - }; - - function copyObj(obj, target, overwrite) { - if (!target) target = {}; - for (var prop in obj) - if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) - target[prop] = obj[prop]; - return target; - } - - function bind(f) { - var args = Array.prototype.slice.call(arguments, 1); - return function(){return f.apply(null, args);}; - } - - var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - var isWordCharBasic = CodeMirror.isWordChar = function(ch) { - return /\w/.test(ch) || ch > "\x80" && - (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); - }; - function isWordChar(ch, helper) { - if (!helper) return isWordCharBasic(ch); - if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true; - return helper.test(ch); - } - - function isEmpty(obj) { - for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; - return true; - } - - // Extending unicode characters. A series of a non-extending char + - // any number of extending chars is treated as a single unit as far - // as editing and measuring is concerned. This is not fully correct, - // since some scripts/fonts/browsers also treat other configurations - // of code points as a group. - var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; - function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); } - - // DOM UTILITIES - - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) e.className = className; - if (style) e.style.cssText = style; - if (typeof content == "string") e.appendChild(document.createTextNode(content)); - else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); - return e; - } - - var range; - if (document.createRange) range = function(node, start, end, endNode) { - var r = document.createRange(); - r.setEnd(endNode || node, end); - r.setStart(node, start); - return r; - }; - else range = function(node, start, end) { - var r = document.body.createTextRange(); - try { r.moveToElementText(node.parentNode); } - catch(e) { return r; } - r.collapse(true); - r.moveEnd("character", end); - r.moveStart("character", start); - return r; - }; - - function removeChildren(e) { - for (var count = e.childNodes.length; count > 0; --count) - e.removeChild(e.firstChild); - return e; - } - - function removeChildrenAndAdd(parent, e) { - return removeChildren(parent).appendChild(e); - } - - var contains = CodeMirror.contains = function(parent, child) { - if (child.nodeType == 3) // Android browser always returns false when child is a textnode - child = child.parentNode; - if (parent.contains) - return parent.contains(child); - do { - if (child.nodeType == 11) child = child.host; - if (child == parent) return true; - } while (child = child.parentNode); - }; - - function activeElt() { - var activeElement = document.activeElement; - while (activeElement && activeElement.root && activeElement.root.activeElement) - activeElement = activeElement.root.activeElement; - return activeElement; - } - // Older versions of IE throws unspecified error when touching - // document.activeElement in some cases (during loading, in iframe) - if (ie && ie_version < 11) activeElt = function() { - try { return document.activeElement; } - catch(e) { return document.body; } - }; - - function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); } - var rmClass = CodeMirror.rmClass = function(node, cls) { - var current = node.className; - var match = classTest(cls).exec(current); - if (match) { - var after = current.slice(match.index + match[0].length); - node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); - } - }; - var addClass = CodeMirror.addClass = function(node, cls) { - var current = node.className; - if (!classTest(cls).test(current)) node.className += (current ? " " : "") + cls; - }; - function joinClasses(a, b) { - var as = a.split(" "); - for (var i = 0; i < as.length; i++) - if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i]; - return b; - } - - // WINDOW-WIDE EVENTS - - // These must be handled carefully, because naively registering a - // handler for each editor will cause the editors to never be - // garbage collected. - - function forEachCodeMirror(f) { - if (!document.body.getElementsByClassName) return; - var byClass = document.body.getElementsByClassName("CodeMirror"); - for (var i = 0; i < byClass.length; i++) { - var cm = byClass[i].CodeMirror; - if (cm) f(cm); - } - } - - var globalsRegistered = false; - function ensureGlobalHandlers() { - if (globalsRegistered) return; - registerGlobalHandlers(); - globalsRegistered = true; - } - function registerGlobalHandlers() { - // When the window resizes, we need to refresh active editors. - var resizeTimer; - on(window, "resize", function() { - if (resizeTimer == null) resizeTimer = setTimeout(function() { - resizeTimer = null; - forEachCodeMirror(onResize); - }, 100); - }); - // When the window loses focus, we want to show the editor as blurred - on(window, "blur", function() { - forEachCodeMirror(onBlur); - }); - } - - // FEATURE DETECTION - - // Detect drag-and-drop - var dragAndDrop = function() { - // There is *some* kind of drag-and-drop support in IE6-8, but I - // couldn't get it to work yet. - if (ie && ie_version < 9) return false; - var div = elt('div'); - return "draggable" in div || "dragDrop" in div; - }(); - - var zwspSupported; - function zeroWidthElement(measure) { - if (zwspSupported == null) { - var test = elt("span", "\u200b"); - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); - if (measure.firstChild.offsetHeight != 0) - zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); - } - var node = zwspSupported ? elt("span", "\u200b") : - elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); - node.setAttribute("cm-text", ""); - return node; - } - - // Feature-detect IE's crummy client rect reporting for bidi text - var badBidiRects; - function hasBadBidiRects(measure) { - if (badBidiRects != null) return badBidiRects; - var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); - var r0 = range(txt, 0, 1).getBoundingClientRect(); - var r1 = range(txt, 1, 2).getBoundingClientRect(); - removeChildren(measure); - if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780) - return badBidiRects = (r1.right - r0.right < 3); - } - - // See if "".split is the broken IE version, if so, provide an - // alternative way to split lines. - var splitLinesAuto = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { - var pos = 0, result = [], l = string.length; - while (pos <= l) { - var nl = string.indexOf("\n", pos); - if (nl == -1) nl = string.length; - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); - var rt = line.indexOf("\r"); - if (rt != -1) { - result.push(line.slice(0, rt)); - pos += rt + 1; - } else { - result.push(line); - pos = nl + 1; - } - } - return result; - } : function(string){return string.split(/\r\n?|\n/);}; - - var hasSelection = window.getSelection ? function(te) { - try { return te.selectionStart != te.selectionEnd; } - catch(e) { return false; } - } : function(te) { - try {var range = te.ownerDocument.selection.createRange();} - catch(e) {} - if (!range || range.parentElement() != te) return false; - return range.compareEndPoints("StartToEnd", range) != 0; - }; - - var hasCopyEvent = (function() { - var e = elt("div"); - if ("oncopy" in e) return true; - e.setAttribute("oncopy", "return;"); - return typeof e.oncopy == "function"; - })(); - - var badZoomedRects = null; - function hasBadZoomedRects(measure) { - if (badZoomedRects != null) return badZoomedRects; - var node = removeChildrenAndAdd(measure, elt("span", "x")); - var normal = node.getBoundingClientRect(); - var fromRange = range(node, 0, 1).getBoundingClientRect(); - return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; - } - - // KEY NAMES - - var keyNames = CodeMirror.keyNames = { - 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", - 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", - 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", - 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", - 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", - 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", - 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" - }; - (function() { - // Number keys - for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i); - // Alphabetic keys - for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); - // Function keys - for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; - })(); - - // BIDI HELPERS - - function iterateBidiSections(order, from, to, f) { - if (!order) return f(from, to, "ltr"); - var found = false; - for (var i = 0; i < order.length; ++i) { - var part = order[i]; - if (part.from < to && part.to > from || from == to && part.to == from) { - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); - found = true; - } - } - if (!found) f(from, to, "ltr"); - } - - function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } - function bidiRight(part) { return part.level % 2 ? part.from : part.to; } - - function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } - function lineRight(line) { - var order = getOrder(line); - if (!order) return line.text.length; - return bidiRight(lst(order)); - } - - function lineStart(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLine(line); - if (visual != line) lineN = lineNo(visual); - var order = getOrder(visual); - var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); - return Pos(lineN, ch); - } - function lineEnd(cm, lineN) { - var merged, line = getLine(cm.doc, lineN); - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - lineN = null; - } - var order = getOrder(line); - var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); - return Pos(lineN == null ? lineNo(line) : lineN, ch); - } - function lineStartSmart(cm, pos) { - var start = lineStart(cm, pos.line); - var line = getLine(cm.doc, start.line); - var order = getOrder(line); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(0, line.text.search(/\S/)); - var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; - return Pos(start.line, inWS ? 0 : firstNonWS); - } - return start; - } - - function compareBidiLevel(order, a, b) { - var linedir = order[0].level; - if (a == linedir) return true; - if (b == linedir) return false; - return a < b; - } - var bidiOther; - function getBidiPartAt(order, pos) { - bidiOther = null; - for (var i = 0, found; i < order.length; ++i) { - var cur = order[i]; - if (cur.from < pos && cur.to > pos) return i; - if ((cur.from == pos || cur.to == pos)) { - if (found == null) { - found = i; - } else if (compareBidiLevel(order, cur.level, order[found].level)) { - if (cur.from != cur.to) bidiOther = found; - return i; - } else { - if (cur.from != cur.to) bidiOther = i; - return found; - } - } - } - return found; - } - - function moveInLine(line, pos, dir, byUnit) { - if (!byUnit) return pos + dir; - do pos += dir; - while (pos > 0 && isExtendingChar(line.text.charAt(pos))); - return pos; - } - - // This is needed in order to move 'visually' through bi-directional - // text -- i.e., pressing left should make the cursor go left, even - // when in RTL text. The tricky part is the 'jumps', where RTL and - // LTR text touch each other. This often requires the cursor offset - // to move more than one unit, in order to visually move one unit. - function moveVisually(line, start, dir, byUnit) { - var bidi = getOrder(line); - if (!bidi) return moveLogically(line, start, dir, byUnit); - var pos = getBidiPartAt(bidi, start), part = bidi[pos]; - var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit); - - for (;;) { - if (target > part.from && target < part.to) return target; - if (target == part.from || target == part.to) { - if (getBidiPartAt(bidi, target) == pos) return target; - part = bidi[pos += dir]; - return (dir > 0) == part.level % 2 ? part.to : part.from; - } else { - part = bidi[pos += dir]; - if (!part) return null; - if ((dir > 0) == part.level % 2) - target = moveInLine(line, part.to, -1, byUnit); - else - target = moveInLine(line, part.from, 1, byUnit); - } - } - } - - function moveLogically(line, start, dir, byUnit) { - var target = start + dir; - if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir; - return target < 0 || target > line.text.length ? null : target; - } - - // Bidirectional ordering algorithm - // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm - // that this (partially) implements. - - // One-char codes used for character types: - // L (L): Left-to-Right - // R (R): Right-to-Left - // r (AL): Right-to-Left Arabic - // 1 (EN): European Number - // + (ES): European Number Separator - // % (ET): European Number Terminator - // n (AN): Arabic Number - // , (CS): Common Number Separator - // m (NSM): Non-Spacing Mark - // b (BN): Boundary Neutral - // s (B): Paragraph Separator - // t (S): Segment Separator - // w (WS): Whitespace - // N (ON): Other Neutrals - - // Returns null if characters are ordered as they appear - // (left-to-right), or an array of sections ({from, to, level} - // objects) in the order in which they occur visually. - var bidiOrdering = (function() { - // Character types for codepoints 0 to 0xff - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; - // Character types for codepoints 0x600 to 0x6ff - var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm"; - function charType(code) { - if (code <= 0xf7) return lowTypes.charAt(code); - else if (0x590 <= code && code <= 0x5f4) return "R"; - else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600); - else if (0x6ee <= code && code <= 0x8ac) return "r"; - else if (0x2000 <= code && code <= 0x200b) return "w"; - else if (code == 0x200c) return "b"; - else return "L"; - } - - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; - // Browsers seem to always treat the boundaries of block elements as being L. - var outerType = "L"; - - function BidiSpan(level, from, to) { - this.level = level; - this.from = from; this.to = to; - } - - return function(str) { - if (!bidiRE.test(str)) return false; - var len = str.length, types = []; - for (var i = 0, type; i < len; ++i) - types.push(type = charType(str.charCodeAt(i))); - - // W1. Examine each non-spacing mark (NSM) in the level run, and - // change the type of the NSM to the type of the previous - // character. If the NSM is at the start of the level run, it will - // get the type of sor. - for (var i = 0, prev = outerType; i < len; ++i) { - var type = types[i]; - if (type == "m") types[i] = prev; - else prev = type; - } - - // W2. Search backwards from each instance of a European number - // until the first strong type (R, L, AL, or sor) is found. If an - // AL is found, change the type of the European number to Arabic - // number. - // W3. Change all ALs to R. - for (var i = 0, cur = outerType; i < len; ++i) { - var type = types[i]; - if (type == "1" && cur == "r") types[i] = "n"; - else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } - } - - // W4. A single European separator between two European numbers - // changes to a European number. A single common separator between - // two numbers of the same type changes to that type. - for (var i = 1, prev = types[0]; i < len - 1; ++i) { - var type = types[i]; - if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; - else if (type == "," && prev == types[i+1] && - (prev == "1" || prev == "n")) types[i] = prev; - prev = type; - } - - // W5. A sequence of European terminators adjacent to European - // numbers changes to all European numbers. - // W6. Otherwise, separators and terminators change to Other - // Neutral. - for (var i = 0; i < len; ++i) { - var type = types[i]; - if (type == ",") types[i] = "N"; - else if (type == "%") { - for (var end = i + 1; end < len && types[end] == "%"; ++end) {} - var replace = (i && types[i-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; - for (var j = i; j < end; ++j) types[j] = replace; - i = end - 1; - } - } - - // W7. Search backwards from each instance of a European number - // until the first strong type (R, L, or sor) is found. If an L is - // found, then change the type of the European number to L. - for (var i = 0, cur = outerType; i < len; ++i) { - var type = types[i]; - if (cur == "L" && type == "1") types[i] = "L"; - else if (isStrong.test(type)) cur = type; - } - - // N1. A sequence of neutrals takes the direction of the - // surrounding strong text if the text on both sides has the same - // direction. European and Arabic numbers act as if they were R in - // terms of their influence on neutrals. Start-of-level-run (sor) - // and end-of-level-run (eor) are used at level run boundaries. - // N2. Any remaining neutrals take the embedding direction. - for (var i = 0; i < len; ++i) { - if (isNeutral.test(types[i])) { - for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} - var before = (i ? types[i-1] : outerType) == "L"; - var after = (end < len ? types[end] : outerType) == "L"; - var replace = before || after ? "L" : "R"; - for (var j = i; j < end; ++j) types[j] = replace; - i = end - 1; - } - } - - // Here we depart from the documented algorithm, in order to avoid - // building up an actual levels array. Since there are only three - // levels (0, 1, 2) in an implementation that doesn't take - // explicit embedding into account, we can build up the order on - // the fly, without following the level-based algorithm. - var order = [], m; - for (var i = 0; i < len;) { - if (countsAsLeft.test(types[i])) { - var start = i; - for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} - order.push(new BidiSpan(0, start, i)); - } else { - var pos = i, at = order.length; - for (++i; i < len && types[i] != "L"; ++i) {} - for (var j = pos; j < i;) { - if (countsAsNum.test(types[j])) { - if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j)); - var nstart = j; - for (++j; j < i && countsAsNum.test(types[j]); ++j) {} - order.splice(at, 0, new BidiSpan(2, nstart, j)); - pos = j; - } else ++j; - } - if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i)); - } - } - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length; - order.unshift(new BidiSpan(0, 0, m[0].length)); - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length; - order.push(new BidiSpan(0, len - m[0].length, len)); - } - if (order[0].level == 2) - order.unshift(new BidiSpan(1, order[0].to, order[0].to)); - if (order[0].level != lst(order).level) - order.push(new BidiSpan(order[0].level, len, len)); - - return order; - }; - })(); - - // THE END - - CodeMirror.version = "5.18.2"; - - return CodeMirror; -}); diff --git a/pagure/static/codemirror/codemirror.css b/pagure/static/codemirror/codemirror.css deleted file mode 120000 index 9132274..0000000 --- a/pagure/static/codemirror/codemirror.css +++ /dev/null @@ -1 +0,0 @@ -codemirror-5.18.2.css \ No newline at end of file diff --git a/pagure/static/codemirror/codemirror.js b/pagure/static/codemirror/codemirror.js deleted file mode 120000 index 0b38438..0000000 --- a/pagure/static/codemirror/codemirror.js +++ /dev/null @@ -1 +0,0 @@ -codemirror-5.18.2.js \ No newline at end of file diff --git a/pagure/static/codemirror/solarized-5.18.2.css b/pagure/static/codemirror/solarized-5.18.2.css deleted file mode 100644 index 1f39c7e..0000000 --- a/pagure/static/codemirror/solarized-5.18.2.css +++ /dev/null @@ -1,169 +0,0 @@ -/* -Solarized theme for code-mirror -http://ethanschoonover.com/solarized -*/ - -/* -Solarized color palette -http://ethanschoonover.com/solarized/img/solarized-palette.png -*/ - -.solarized.base03 { color: #002b36; } -.solarized.base02 { color: #073642; } -.solarized.base01 { color: #586e75; } -.solarized.base00 { color: #657b83; } -.solarized.base0 { color: #839496; } -.solarized.base1 { color: #93a1a1; } -.solarized.base2 { color: #eee8d5; } -.solarized.base3 { color: #fdf6e3; } -.solarized.solar-yellow { color: #b58900; } -.solarized.solar-orange { color: #cb4b16; } -.solarized.solar-red { color: #dc322f; } -.solarized.solar-magenta { color: #d33682; } -.solarized.solar-violet { color: #6c71c4; } -.solarized.solar-blue { color: #268bd2; } -.solarized.solar-cyan { color: #2aa198; } -.solarized.solar-green { color: #859900; } - -/* Color scheme for code-mirror */ - -.cm-s-solarized { - line-height: 1.45em; - color-profile: sRGB; - rendering-intent: auto; -} -.cm-s-solarized.cm-s-dark { - color: #839496; - background-color: #002b36; - text-shadow: #002b36 0 1px; -} -.cm-s-solarized.cm-s-light { - background-color: #fdf6e3; - color: #657b83; - text-shadow: #eee8d5 0 1px; -} - -.cm-s-solarized .CodeMirror-widget { - text-shadow: none; -} - -.cm-s-solarized .cm-header { color: #586e75; } -.cm-s-solarized .cm-quote { color: #93a1a1; } - -.cm-s-solarized .cm-keyword { color: #cb4b16; } -.cm-s-solarized .cm-atom { color: #d33682; } -.cm-s-solarized .cm-number { color: #d33682; } -.cm-s-solarized .cm-def { color: #2aa198; } - -.cm-s-solarized .cm-variable { color: #839496; } -.cm-s-solarized .cm-variable-2 { color: #b58900; } -.cm-s-solarized .cm-variable-3 { color: #6c71c4; } - -.cm-s-solarized .cm-property { color: #2aa198; } -.cm-s-solarized .cm-operator { color: #6c71c4; } - -.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; } - -.cm-s-solarized .cm-string { color: #859900; } -.cm-s-solarized .cm-string-2 { color: #b58900; } - -.cm-s-solarized .cm-meta { color: #859900; } -.cm-s-solarized .cm-qualifier { color: #b58900; } -.cm-s-solarized .cm-builtin { color: #d33682; } -.cm-s-solarized .cm-bracket { color: #cb4b16; } -.cm-s-solarized .CodeMirror-matchingbracket { color: #859900; } -.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; } -.cm-s-solarized .cm-tag { color: #93a1a1; } -.cm-s-solarized .cm-attribute { color: #2aa198; } -.cm-s-solarized .cm-hr { - color: transparent; - border-top: 1px solid #586e75; - display: block; -} -.cm-s-solarized .cm-link { color: #93a1a1; cursor: pointer; } -.cm-s-solarized .cm-special { color: #6c71c4; } -.cm-s-solarized .cm-em { - color: #999; - text-decoration: underline; - text-decoration-style: dotted; -} -.cm-s-solarized .cm-strong { color: #eee; } -.cm-s-solarized .cm-error, -.cm-s-solarized .cm-invalidchar { - color: #586e75; - border-bottom: 1px dotted #dc322f; -} - -.cm-s-solarized.cm-s-dark div.CodeMirror-selected { background: #073642; } -.cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); } -.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection, .cm-s-dark .CodeMirror-line > span::-moz-selection, .cm-s-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(7, 54, 66, 0.99); } - -.cm-s-solarized.cm-s-light div.CodeMirror-selected { background: #eee8d5; } -.cm-s-solarized.cm-s-light .CodeMirror-line::selection, .cm-s-light .CodeMirror-line > span::selection, .cm-s-light .CodeMirror-line > span > span::selection { background: #eee8d5; } -.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection, .cm-s-ligh .CodeMirror-line > span::-moz-selection, .cm-s-ligh .CodeMirror-line > span > span::-moz-selection { background: #eee8d5; } - -/* Editor styling */ - - - -/* Little shadow on the view-port of the buffer view */ -.cm-s-solarized.CodeMirror { - -moz-box-shadow: inset 7px 0 12px -6px #000; - -webkit-box-shadow: inset 7px 0 12px -6px #000; - box-shadow: inset 7px 0 12px -6px #000; -} - -/* Remove gutter border */ -.cm-s-solarized .CodeMirror-gutters { - border-right: 0; -} - -/* Gutter colors and line number styling based of color scheme (dark / light) */ - -/* Dark */ -.cm-s-solarized.cm-s-dark .CodeMirror-gutters { - background-color: #073642; -} - -.cm-s-solarized.cm-s-dark .CodeMirror-linenumber { - color: #586e75; - text-shadow: #021014 0 -1px; -} - -/* Light */ -.cm-s-solarized.cm-s-light .CodeMirror-gutters { - background-color: #eee8d5; -} - -.cm-s-solarized.cm-s-light .CodeMirror-linenumber { - color: #839496; -} - -/* Common */ -.cm-s-solarized .CodeMirror-linenumber { - padding: 0 5px; -} -.cm-s-solarized .CodeMirror-guttermarker-subtle { color: #586e75; } -.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker { color: #ddd; } -.cm-s-solarized.cm-s-light .CodeMirror-guttermarker { color: #cb4b16; } - -.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text { - color: #586e75; -} - -/* Cursor */ -.cm-s-solarized .CodeMirror-cursor { border-left: 1px solid #819090; } - -/* Fat cursor */ -.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor { background: #77ee77; } -.cm-s-solarized.cm-s-light .cm-animate-fat-cursor { background-color: #77ee77; } -.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor { background: #586e75; } -.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor { background-color: #586e75; } - -/* Active line */ -.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background { - background: rgba(255, 255, 255, 0.06); -} -.cm-s-solarized.cm-s-light .CodeMirror-activeline-background { - background: rgba(0, 0, 0, 0.06); -} diff --git a/pagure/static/codemirror/solarized.css b/pagure/static/codemirror/solarized.css deleted file mode 120000 index 372d39a..0000000 --- a/pagure/static/codemirror/solarized.css +++ /dev/null @@ -1 +0,0 @@ -solarized-5.18.2.css \ No newline at end of file diff --git a/pagure/static/d3/d3.v3.js b/pagure/static/d3/d3.v3.js deleted file mode 100644 index ec7c983..0000000 --- a/pagure/static/d3/d3.v3.js +++ /dev/null @@ -1,9554 +0,0 @@ -!function() { - var d3 = { - version: "3.5.17" - }; - var d3_arraySlice = [].slice, d3_array = function(list) { - return d3_arraySlice.call(list); - }; - var d3_document = this.document; - function d3_documentElement(node) { - return node && (node.ownerDocument || node.document || node).documentElement; - } - function d3_window(node) { - return node && (node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView); - } - if (d3_document) { - try { - d3_array(d3_document.documentElement.childNodes)[0].nodeType; - } catch (e) { - d3_array = function(list) { - var i = list.length, array = new Array(i); - while (i--) array[i] = list[i]; - return array; - }; - } - } - if (!Date.now) Date.now = function() { - return +new Date(); - }; - if (d3_document) { - try { - d3_document.createElement("DIV").style.setProperty("opacity", 0, ""); - } catch (error) { - var d3_element_prototype = this.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = this.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty; - d3_element_prototype.setAttribute = function(name, value) { - d3_element_setAttribute.call(this, name, value + ""); - }; - d3_element_prototype.setAttributeNS = function(space, local, value) { - d3_element_setAttributeNS.call(this, space, local, value + ""); - }; - d3_style_prototype.setProperty = function(name, value, priority) { - d3_style_setProperty.call(this, name, value + "", priority); - }; - } - } - d3.ascending = d3_ascending; - function d3_ascending(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; - } - d3.descending = function(a, b) { - return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; - }; - d3.min = function(array, f) { - var i = -1, n = array.length, a, b; - if (arguments.length === 1) { - while (++i < n) if ((b = array[i]) != null && b >= b) { - a = b; - break; - } - while (++i < n) if ((b = array[i]) != null && a > b) a = b; - } else { - while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) { - a = b; - break; - } - while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b; - } - return a; - }; - d3.max = function(array, f) { - var i = -1, n = array.length, a, b; - if (arguments.length === 1) { - while (++i < n) if ((b = array[i]) != null && b >= b) { - a = b; - break; - } - while (++i < n) if ((b = array[i]) != null && b > a) a = b; - } else { - while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) { - a = b; - break; - } - while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b; - } - return a; - }; - d3.extent = function(array, f) { - var i = -1, n = array.length, a, b, c; - if (arguments.length === 1) { - while (++i < n) if ((b = array[i]) != null && b >= b) { - a = c = b; - break; - } - while (++i < n) if ((b = array[i]) != null) { - if (a > b) a = b; - if (c < b) c = b; - } - } else { - while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) { - a = c = b; - break; - } - while (++i < n) if ((b = f.call(array, array[i], i)) != null) { - if (a > b) a = b; - if (c < b) c = b; - } - } - return [ a, c ]; - }; - function d3_number(x) { - return x === null ? NaN : +x; - } - function d3_numeric(x) { - return !isNaN(x); - } - d3.sum = function(array, f) { - var s = 0, n = array.length, a, i = -1; - if (arguments.length === 1) { - while (++i < n) if (d3_numeric(a = +array[i])) s += a; - } else { - while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a; - } - return s; - }; - d3.mean = function(array, f) { - var s = 0, n = array.length, a, i = -1, j = n; - if (arguments.length === 1) { - while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j; - } else { - while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j; - } - if (j) return s / j; - }; - d3.quantile = function(values, p) { - var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h; - return e ? v + e * (values[h] - v) : v; - }; - d3.median = function(array, f) { - var numbers = [], n = array.length, a, i = -1; - if (arguments.length === 1) { - while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a); - } else { - while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a); - } - if (numbers.length) return d3.quantile(numbers.sort(d3_ascending), .5); - }; - d3.variance = function(array, f) { - var n = array.length, m = 0, a, d, s = 0, i = -1, j = 0; - if (arguments.length === 1) { - while (++i < n) { - if (d3_numeric(a = d3_number(array[i]))) { - d = a - m; - m += d / ++j; - s += d * (a - m); - } - } - } else { - while (++i < n) { - if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) { - d = a - m; - m += d / ++j; - s += d * (a - m); - } - } - } - if (j > 1) return s / (j - 1); - }; - d3.deviation = function() { - var v = d3.variance.apply(this, arguments); - return v ? Math.sqrt(v) : v; - }; - function d3_bisector(compare) { - return { - left: function(a, x, lo, hi) { - if (arguments.length < 3) lo = 0; - if (arguments.length < 4) hi = a.length; - while (lo < hi) { - var mid = lo + hi >>> 1; - if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid; - } - return lo; - }, - right: function(a, x, lo, hi) { - if (arguments.length < 3) lo = 0; - if (arguments.length < 4) hi = a.length; - while (lo < hi) { - var mid = lo + hi >>> 1; - if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1; - } - return lo; - } - }; - } - var d3_bisect = d3_bisector(d3_ascending); - d3.bisectLeft = d3_bisect.left; - d3.bisect = d3.bisectRight = d3_bisect.right; - d3.bisector = function(f) { - return d3_bisector(f.length === 1 ? function(d, x) { - return d3_ascending(f(d), x); - } : f); - }; - d3.shuffle = function(array, i0, i1) { - if ((m = arguments.length) < 3) { - i1 = array.length; - if (m < 2) i0 = 0; - } - var m = i1 - i0, t, i; - while (m) { - i = Math.random() * m-- | 0; - t = array[m + i0], array[m + i0] = array[i + i0], array[i + i0] = t; - } - return array; - }; - d3.permute = function(array, indexes) { - var i = indexes.length, permutes = new Array(i); - while (i--) permutes[i] = array[indexes[i]]; - return permutes; - }; - d3.pairs = function(array) { - var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n); - while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ]; - return pairs; - }; - d3.transpose = function(matrix) { - if (!(n = matrix.length)) return []; - for (var i = -1, m = d3.min(matrix, d3_transposeLength), transpose = new Array(m); ++i < m; ) { - for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n; ) { - row[j] = matrix[j][i]; - } - } - return transpose; - }; - function d3_transposeLength(d) { - return d.length; - } - d3.zip = function() { - return d3.transpose(arguments); - }; - d3.keys = function(map) { - var keys = []; - for (var key in map) keys.push(key); - return keys; - }; - d3.values = function(map) { - var values = []; - for (var key in map) values.push(map[key]); - return values; - }; - d3.entries = function(map) { - var entries = []; - for (var key in map) entries.push({ - key: key, - value: map[key] - }); - return entries; - }; - d3.merge = function(arrays) { - var n = arrays.length, m, i = -1, j = 0, merged, array; - while (++i < n) j += arrays[i].length; - merged = new Array(j); - while (--n >= 0) { - array = arrays[n]; - m = array.length; - while (--m >= 0) { - merged[--j] = array[m]; - } - } - return merged; - }; - var abs = Math.abs; - d3.range = function(start, stop, step) { - if (arguments.length < 3) { - step = 1; - if (arguments.length < 2) { - stop = start; - start = 0; - } - } - if ((stop - start) / step === Infinity) throw new Error("infinite range"); - var range = [], k = d3_range_integerScale(abs(step)), i = -1, j; - start *= k, stop *= k, step *= k; - if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k); - return range; - }; - function d3_range_integerScale(x) { - var k = 1; - while (x * k % 1) k *= 10; - return k; - } - function d3_class(ctor, properties) { - for (var key in properties) { - Object.defineProperty(ctor.prototype, key, { - value: properties[key], - enumerable: false - }); - } - } - d3.map = function(object, f) { - var map = new d3_Map(); - if (object instanceof d3_Map) { - object.forEach(function(key, value) { - map.set(key, value); - }); - } else if (Array.isArray(object)) { - var i = -1, n = object.length, o; - if (arguments.length === 1) while (++i < n) map.set(i, object[i]); else while (++i < n) map.set(f.call(object, o = object[i], i), o); - } else { - for (var key in object) map.set(key, object[key]); - } - return map; - }; - function d3_Map() { - this._ = Object.create(null); - } - var d3_map_proto = "__proto__", d3_map_zero = "\x00"; - d3_class(d3_Map, { - has: d3_map_has, - get: function(key) { - return this._[d3_map_escape(key)]; - }, - set: function(key, value) { - return this._[d3_map_escape(key)] = value; - }, - remove: d3_map_remove, - keys: d3_map_keys, - values: function() { - var values = []; - for (var key in this._) values.push(this._[key]); - return values; - }, - entries: function() { - var entries = []; - for (var key in this._) entries.push({ - key: d3_map_unescape(key), - value: this._[key] - }); - return entries; - }, - size: d3_map_size, - empty: d3_map_empty, - forEach: function(f) { - for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]); - } - }); - function d3_map_escape(key) { - return (key += "") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key; - } - function d3_map_unescape(key) { - return (key += "")[0] === d3_map_zero ? key.slice(1) : key; - } - function d3_map_has(key) { - return d3_map_escape(key) in this._; - } - function d3_map_remove(key) { - return (key = d3_map_escape(key)) in this._ && delete this._[key]; - } - function d3_map_keys() { - var keys = []; - for (var key in this._) keys.push(d3_map_unescape(key)); - return keys; - } - function d3_map_size() { - var size = 0; - for (var key in this._) ++size; - return size; - } - function d3_map_empty() { - for (var key in this._) return false; - return true; - } - d3.nest = function() { - var nest = {}, keys = [], sortKeys = [], sortValues, rollup; - function map(mapType, array, depth) { - if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array; - var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values; - while (++i < n) { - if (values = valuesByKey.get(keyValue = key(object = array[i]))) { - values.push(object); - } else { - valuesByKey.set(keyValue, [ object ]); - } - } - if (mapType) { - object = mapType(); - setter = function(keyValue, values) { - object.set(keyValue, map(mapType, values, depth)); - }; - } else { - object = {}; - setter = function(keyValue, values) { - object[keyValue] = map(mapType, values, depth); - }; - } - valuesByKey.forEach(setter); - return object; - } - function entries(map, depth) { - if (depth >= keys.length) return map; - var array = [], sortKey = sortKeys[depth++]; - map.forEach(function(key, keyMap) { - array.push({ - key: key, - values: entries(keyMap, depth) - }); - }); - return sortKey ? array.sort(function(a, b) { - return sortKey(a.key, b.key); - }) : array; - } - nest.map = function(array, mapType) { - return map(mapType, array, 0); - }; - nest.entries = function(array) { - return entries(map(d3.map, array, 0), 0); - }; - nest.key = function(d) { - keys.push(d); - return nest; - }; - nest.sortKeys = function(order) { - sortKeys[keys.length - 1] = order; - return nest; - }; - nest.sortValues = function(order) { - sortValues = order; - return nest; - }; - nest.rollup = function(f) { - rollup = f; - return nest; - }; - return nest; - }; - d3.set = function(array) { - var set = new d3_Set(); - if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]); - return set; - }; - function d3_Set() { - this._ = Object.create(null); - } - d3_class(d3_Set, { - has: d3_map_has, - add: function(key) { - this._[d3_map_escape(key += "")] = true; - return key; - }, - remove: d3_map_remove, - values: d3_map_keys, - size: d3_map_size, - empty: d3_map_empty, - forEach: function(f) { - for (var key in this._) f.call(this, d3_map_unescape(key)); - } - }); - d3.behavior = {}; - function d3_identity(d) { - return d; - } - d3.rebind = function(target, source) { - var i = 1, n = arguments.length, method; - while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]); - return target; - }; - function d3_rebind(target, source, method) { - return function() { - var value = method.apply(source, arguments); - return value === source ? target : value; - }; - } - function d3_vendorSymbol(object, name) { - if (name in object) return name; - name = name.charAt(0).toUpperCase() + name.slice(1); - for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) { - var prefixName = d3_vendorPrefixes[i] + name; - if (prefixName in object) return prefixName; - } - } - var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ]; - function d3_noop() {} - d3.dispatch = function() { - var dispatch = new d3_dispatch(), i = -1, n = arguments.length; - while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); - return dispatch; - }; - function d3_dispatch() {} - d3_dispatch.prototype.on = function(type, listener) { - var i = type.indexOf("."), name = ""; - if (i >= 0) { - name = type.slice(i + 1); - type = type.slice(0, i); - } - if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener); - if (arguments.length === 2) { - if (listener == null) for (type in this) { - if (this.hasOwnProperty(type)) this[type].on(name, null); - } - return this; - } - }; - function d3_dispatch_event(dispatch) { - var listeners = [], listenerByName = new d3_Map(); - function event() { - var z = listeners, i = -1, n = z.length, l; - while (++i < n) if (l = z[i].on) l.apply(this, arguments); - return dispatch; - } - event.on = function(name, listener) { - var l = listenerByName.get(name), i; - if (arguments.length < 2) return l && l.on; - if (l) { - l.on = null; - listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1)); - listenerByName.remove(name); - } - if (listener) listeners.push(listenerByName.set(name, { - on: listener - })); - return dispatch; - }; - return event; - } - d3.event = null; - function d3_eventPreventDefault() { - d3.event.preventDefault(); - } - function d3_eventSource() { - var e = d3.event, s; - while (s = e.sourceEvent) e = s; - return e; - } - function d3_eventDispatch(target) { - var dispatch = new d3_dispatch(), i = 0, n = arguments.length; - while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); - dispatch.of = function(thiz, argumentz) { - return function(e1) { - try { - var e0 = e1.sourceEvent = d3.event; - e1.target = target; - d3.event = e1; - dispatch[e1.type].apply(thiz, argumentz); - } finally { - d3.event = e0; - } - }; - }; - return dispatch; - } - d3.requote = function(s) { - return s.replace(d3_requote_re, "\\$&"); - }; - var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; - var d3_subclass = {}.__proto__ ? function(object, prototype) { - object.__proto__ = prototype; - } : function(object, prototype) { - for (var property in prototype) object[property] = prototype[property]; - }; - function d3_selection(groups) { - d3_subclass(groups, d3_selectionPrototype); - return groups; - } - var d3_select = function(s, n) { - return n.querySelector(s); - }, d3_selectAll = function(s, n) { - return n.querySelectorAll(s); - }, d3_selectMatches = function(n, s) { - var d3_selectMatcher = n.matches || n[d3_vendorSymbol(n, "matchesSelector")]; - d3_selectMatches = function(n, s) { - return d3_selectMatcher.call(n, s); - }; - return d3_selectMatches(n, s); - }; - if (typeof Sizzle === "function") { - d3_select = function(s, n) { - return Sizzle(s, n)[0] || null; - }; - d3_selectAll = Sizzle; - d3_selectMatches = Sizzle.matchesSelector; - } - d3.selection = function() { - return d3.select(d3_document.documentElement); - }; - var d3_selectionPrototype = d3.selection.prototype = []; - d3_selectionPrototype.select = function(selector) { - var subgroups = [], subgroup, subnode, group, node; - selector = d3_selection_selector(selector); - for (var j = -1, m = this.length; ++j < m; ) { - subgroups.push(subgroup = []); - subgroup.parentNode = (group = this[j]).parentNode; - for (var i = -1, n = group.length; ++i < n; ) { - if (node = group[i]) { - subgroup.push(subnode = selector.call(node, node.__data__, i, j)); - if (subnode && "__data__" in node) subnode.__data__ = node.__data__; - } else { - subgroup.push(null); - } - } - } - return d3_selection(subgroups); - }; - function d3_selection_selector(selector) { - return typeof selector === "function" ? selector : function() { - return d3_select(selector, this); - }; - } - d3_selectionPrototype.selectAll = function(selector) { - var subgroups = [], subgroup, node; - selector = d3_selection_selectorAll(selector); - for (var j = -1, m = this.length; ++j < m; ) { - for (var group = this[j], i = -1, n = group.length; ++i < n; ) { - if (node = group[i]) { - subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j))); - subgroup.parentNode = node; - } - } - } - return d3_selection(subgroups); - }; - function d3_selection_selectorAll(selector) { - return typeof selector === "function" ? selector : function() { - return d3_selectAll(selector, this); - }; - } - var d3_nsXhtml = "http://www.w3.org/1999/xhtml"; - var d3_nsPrefix = { - svg: "http://www.w3.org/2000/svg", - xhtml: d3_nsXhtml, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" - }; - d3.ns = { - prefix: d3_nsPrefix, - qualify: function(name) { - var i = name.indexOf(":"), prefix = name; - if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); - return d3_nsPrefix.hasOwnProperty(prefix) ? { - space: d3_nsPrefix[prefix], - local: name - } : name; - } - }; - d3_selectionPrototype.attr = function(name, value) { - if (arguments.length < 2) { - if (typeof name === "string") { - var node = this.node(); - name = d3.ns.qualify(name); - return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name); - } - for (value in name) this.each(d3_selection_attr(value, name[value])); - return this; - } - return this.each(d3_selection_attr(name, value)); - }; - function d3_selection_attr(name, value) { - name = d3.ns.qualify(name); - function attrNull() { - this.removeAttribute(name); - } - function attrNullNS() { - this.removeAttributeNS(name.space, name.local); - } - function attrConstant() { - this.setAttribute(name, value); - } - function attrConstantNS() { - this.setAttributeNS(name.space, name.local, value); - } - function attrFunction() { - var x = value.apply(this, arguments); - if (x == null) this.removeAttribute(name); else this.setAttribute(name, x); - } - function attrFunctionNS() { - var x = value.apply(this, arguments); - if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x); - } - return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant; - } - function d3_collapse(s) { - return s.trim().replace(/\s+/g, " "); - } - d3_selectionPrototype.classed = function(name, value) { - if (arguments.length < 2) { - if (typeof name === "string") { - var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1; - if (value = node.classList) { - while (++i < n) if (!value.contains(name[i])) return false; - } else { - value = node.getAttribute("class"); - while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false; - } - return true; - } - for (value in name) this.each(d3_selection_classed(value, name[value])); - return this; - } - return this.each(d3_selection_classed(name, value)); - }; - function d3_selection_classedRe(name) { - return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g"); - } - function d3_selection_classes(name) { - return (name + "").trim().split(/^|\s+/); - } - function d3_selection_classed(name, value) { - name = d3_selection_classes(name).map(d3_selection_classedName); - var n = name.length; - function classedConstant() { - var i = -1; - while (++i < n) name[i](this, value); - } - function classedFunction() { - var i = -1, x = value.apply(this, arguments); - while (++i < n) name[i](this, x); - } - return typeof value === "function" ? classedFunction : classedConstant; - } - function d3_selection_classedName(name) { - var re = d3_selection_classedRe(name); - return function(node, value) { - if (c = node.classList) return value ? c.add(name) : c.remove(name); - var c = node.getAttribute("class") || ""; - if (value) { - re.lastIndex = 0; - if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name)); - } else { - node.setAttribute("class", d3_collapse(c.replace(re, " "))); - } - }; - } - d3_selectionPrototype.style = function(name, value, priority) { - var n = arguments.length; - if (n < 3) { - if (typeof name !== "string") { - if (n < 2) value = ""; - for (priority in name) this.each(d3_selection_style(priority, name[priority], value)); - return this; - } - if (n < 2) { - var node = this.node(); - return d3_window(node).getComputedStyle(node, null).getPropertyValue(name); - } - priority = ""; - } - return this.each(d3_selection_style(name, value, priority)); - }; - function d3_selection_style(name, value, priority) { - function styleNull() { - this.style.removeProperty(name); - } - function styleConstant() { - this.style.setProperty(name, value, priority); - } - function styleFunction() { - var x = value.apply(this, arguments); - if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority); - } - return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant; - } - d3_selectionPrototype.property = function(name, value) { - if (arguments.length < 2) { - if (typeof name === "string") return this.node()[name]; - for (value in name) this.each(d3_selection_property(value, name[value])); - return this; - } - return this.each(d3_selection_property(name, value)); - }; - function d3_selection_property(name, value) { - function propertyNull() { - delete this[name]; - } - function propertyConstant() { - this[name] = value; - } - function propertyFunction() { - var x = value.apply(this, arguments); - if (x == null) delete this[name]; else this[name] = x; - } - return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant; - } - d3_selectionPrototype.text = function(value) { - return arguments.length ? this.each(typeof value === "function" ? function() { - var v = value.apply(this, arguments); - this.textContent = v == null ? "" : v; - } : value == null ? function() { - this.textContent = ""; - } : function() { - this.textContent = value; - }) : this.node().textContent; - }; - d3_selectionPrototype.html = function(value) { - return arguments.length ? this.each(typeof value === "function" ? function() { - var v = value.apply(this, arguments); - this.innerHTML = v == null ? "" : v; - } : value == null ? function() { - this.innerHTML = ""; - } : function() { - this.innerHTML = value; - }) : this.node().innerHTML; - }; - d3_selectionPrototype.append = function(name) { - name = d3_selection_creator(name); - return this.select(function() { - return this.appendChild(name.apply(this, arguments)); - }); - }; - function d3_selection_creator(name) { - function create() { - var document = this.ownerDocument, namespace = this.namespaceURI; - return namespace === d3_nsXhtml && document.documentElement.namespaceURI === d3_nsXhtml ? document.createElement(name) : document.createElementNS(namespace, name); - } - function createNS() { - return this.ownerDocument.createElementNS(name.space, name.local); - } - return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? createNS : create; - } - d3_selectionPrototype.insert = function(name, before) { - name = d3_selection_creator(name); - before = d3_selection_selector(before); - return this.select(function() { - return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null); - }); - }; - d3_selectionPrototype.remove = function() { - return this.each(d3_selectionRemove); - }; - function d3_selectionRemove() { - var parent = this.parentNode; - if (parent) parent.removeChild(this); - } - d3_selectionPrototype.data = function(value, key) { - var i = -1, n = this.length, group, node; - if (!arguments.length) { - value = new Array(n = (group = this[0]).length); - while (++i < n) { - if (node = group[i]) { - value[i] = node.__data__; - } - } - return value; - } - function bind(group, groupData) { - var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData; - if (key) { - var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue; - for (i = -1; ++i < n; ) { - if (node = group[i]) { - if (nodeByKeyValue.has(keyValue = key.call(node, node.__data__, i))) { - exitNodes[i] = node; - } else { - nodeByKeyValue.set(keyValue, node); - } - keyValues[i] = keyValue; - } - } - for (i = -1; ++i < m; ) { - if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) { - enterNodes[i] = d3_selection_dataNode(nodeData); - } else if (node !== true) { - updateNodes[i] = node; - node.__data__ = nodeData; - } - nodeByKeyValue.set(keyValue, true); - } - for (i = -1; ++i < n; ) { - if (i in keyValues && nodeByKeyValue.get(keyValues[i]) !== true) { - exitNodes[i] = group[i]; - } - } - } else { - for (i = -1; ++i < n0; ) { - node = group[i]; - nodeData = groupData[i]; - if (node) { - node.__data__ = nodeData; - updateNodes[i] = node; - } else { - enterNodes[i] = d3_selection_dataNode(nodeData); - } - } - for (;i < m; ++i) { - enterNodes[i] = d3_selection_dataNode(groupData[i]); - } - for (;i < n; ++i) { - exitNodes[i] = group[i]; - } - } - enterNodes.update = updateNodes; - enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode; - enter.push(enterNodes); - update.push(updateNodes); - exit.push(exitNodes); - } - var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]); - if (typeof value === "function") { - while (++i < n) { - bind(group = this[i], value.call(group, group.parentNode.__data__, i)); - } - } else { - while (++i < n) { - bind(group = this[i], value); - } - } - update.enter = function() { - return enter; - }; - update.exit = function() { - return exit; - }; - return update; - }; - function d3_selection_dataNode(data) { - return { - __data__: data - }; - } - d3_selectionPrototype.datum = function(value) { - return arguments.length ? this.property("__data__", value) : this.property("__data__"); - }; - d3_selectionPrototype.filter = function(filter) { - var subgroups = [], subgroup, group, node; - if (typeof filter !== "function") filter = d3_selection_filter(filter); - for (var j = 0, m = this.length; j < m; j++) { - subgroups.push(subgroup = []); - subgroup.parentNode = (group = this[j]).parentNode; - for (var i = 0, n = group.length; i < n; i++) { - if ((node = group[i]) && filter.call(node, node.__data__, i, j)) { - subgroup.push(node); - } - } - } - return d3_selection(subgroups); - }; - function d3_selection_filter(selector) { - return function() { - return d3_selectMatches(this, selector); - }; - } - d3_selectionPrototype.order = function() { - for (var j = -1, m = this.length; ++j < m; ) { - for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) { - if (node = group[i]) { - if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next); - next = node; - } - } - } - return this; - }; - d3_selectionPrototype.sort = function(comparator) { - comparator = d3_selection_sortComparator.apply(this, arguments); - for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator); - return this.order(); - }; - function d3_selection_sortComparator(comparator) { - if (!arguments.length) comparator = d3_ascending; - return function(a, b) { - return a && b ? comparator(a.__data__, b.__data__) : !a - !b; - }; - } - d3_selectionPrototype.each = function(callback) { - return d3_selection_each(this, function(node, i, j) { - callback.call(node, node.__data__, i, j); - }); - }; - function d3_selection_each(groups, callback) { - for (var j = 0, m = groups.length; j < m; j++) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) { - if (node = group[i]) callback(node, i, j); - } - } - return groups; - } - d3_selectionPrototype.call = function(callback) { - var args = d3_array(arguments); - callback.apply(args[0] = this, args); - return this; - }; - d3_selectionPrototype.empty = function() { - return !this.node(); - }; - d3_selectionPrototype.node = function() { - for (var j = 0, m = this.length; j < m; j++) { - for (var group = this[j], i = 0, n = group.length; i < n; i++) { - var node = group[i]; - if (node) return node; - } - } - return null; - }; - d3_selectionPrototype.size = function() { - var n = 0; - d3_selection_each(this, function() { - ++n; - }); - return n; - }; - function d3_selection_enter(selection) { - d3_subclass(selection, d3_selection_enterPrototype); - return selection; - } - var d3_selection_enterPrototype = []; - d3.selection.enter = d3_selection_enter; - d3.selection.enter.prototype = d3_selection_enterPrototype; - d3_selection_enterPrototype.append = d3_selectionPrototype.append; - d3_selection_enterPrototype.empty = d3_selectionPrototype.empty; - d3_selection_enterPrototype.node = d3_selectionPrototype.node; - d3_selection_enterPrototype.call = d3_selectionPrototype.call; - d3_selection_enterPrototype.size = d3_selectionPrototype.size; - d3_selection_enterPrototype.select = function(selector) { - var subgroups = [], subgroup, subnode, upgroup, group, node; - for (var j = -1, m = this.length; ++j < m; ) { - upgroup = (group = this[j]).update; - subgroups.push(subgroup = []); - subgroup.parentNode = group.parentNode; - for (var i = -1, n = group.length; ++i < n; ) { - if (node = group[i]) { - subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j)); - subnode.__data__ = node.__data__; - } else { - subgroup.push(null); - } - } - } - return d3_selection(subgroups); - }; - d3_selection_enterPrototype.insert = function(name, before) { - if (arguments.length < 2) before = d3_selection_enterInsertBefore(this); - return d3_selectionPrototype.insert.call(this, name, before); - }; - function d3_selection_enterInsertBefore(enter) { - var i0, j0; - return function(d, i, j) { - var group = enter[j].update, n = group.length, node; - if (j != j0) j0 = j, i0 = 0; - if (i >= i0) i0 = i + 1; - while (!(node = group[i0]) && ++i0 < n) ; - return node; - }; - } - d3.select = function(node) { - var group; - if (typeof node === "string") { - group = [ d3_select(node, d3_document) ]; - group.parentNode = d3_document.documentElement; - } else { - group = [ node ]; - group.parentNode = d3_documentElement(node); - } - return d3_selection([ group ]); - }; - d3.selectAll = function(nodes) { - var group; - if (typeof nodes === "string") { - group = d3_array(d3_selectAll(nodes, d3_document)); - group.parentNode = d3_document.documentElement; - } else { - group = d3_array(nodes); - group.parentNode = null; - } - return d3_selection([ group ]); - }; - d3_selectionPrototype.on = function(type, listener, capture) { - var n = arguments.length; - if (n < 3) { - if (typeof type !== "string") { - if (n < 2) listener = false; - for (capture in type) this.each(d3_selection_on(capture, type[capture], listener)); - return this; - } - if (n < 2) return (n = this.node()["__on" + type]) && n._; - capture = false; - } - return this.each(d3_selection_on(type, listener, capture)); - }; - function d3_selection_on(type, listener, capture) { - var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener; - if (i > 0) type = type.slice(0, i); - var filter = d3_selection_onFilters.get(type); - if (filter) type = filter, wrap = d3_selection_onFilter; - function onRemove() { - var l = this[name]; - if (l) { - this.removeEventListener(type, l, l.$); - delete this[name]; - } - } - function onAdd() { - var l = wrap(listener, d3_array(arguments)); - onRemove.call(this); - this.addEventListener(type, this[name] = l, l.$ = capture); - l._ = listener; - } - function removeAll() { - var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match; - for (var name in this) { - if (match = name.match(re)) { - var l = this[name]; - this.removeEventListener(match[1], l, l.$); - delete this[name]; - } - } - } - return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll; - } - var d3_selection_onFilters = d3.map({ - mouseenter: "mouseover", - mouseleave: "mouseout" - }); - if (d3_document) { - d3_selection_onFilters.forEach(function(k) { - if ("on" + k in d3_document) d3_selection_onFilters.remove(k); - }); - } - function d3_selection_onListener(listener, argumentz) { - return function(e) { - var o = d3.event; - d3.event = e; - argumentz[0] = this.__data__; - try { - listener.apply(this, argumentz); - } finally { - d3.event = o; - } - }; - } - function d3_selection_onFilter(listener, argumentz) { - var l = d3_selection_onListener(listener, argumentz); - return function(e) { - var target = this, related = e.relatedTarget; - if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) { - l.call(target, e); - } - }; - } - var d3_event_dragSelect, d3_event_dragId = 0; - function d3_event_dragSuppress(node) { - var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window(node)).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault); - if (d3_event_dragSelect == null) { - d3_event_dragSelect = "onselectstart" in node ? false : d3_vendorSymbol(node.style, "userSelect"); - } - if (d3_event_dragSelect) { - var style = d3_documentElement(node).style, select = style[d3_event_dragSelect]; - style[d3_event_dragSelect] = "none"; - } - return function(suppressClick) { - w.on(name, null); - if (d3_event_dragSelect) style[d3_event_dragSelect] = select; - if (suppressClick) { - var off = function() { - w.on(click, null); - }; - w.on(click, function() { - d3_eventPreventDefault(); - off(); - }, true); - setTimeout(off, 0); - } - }; - } - d3.mouse = function(container) { - return d3_mousePoint(container, d3_eventSource()); - }; - var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0; - function d3_mousePoint(container, e) { - if (e.changedTouches) e = e.changedTouches[0]; - var svg = container.ownerSVGElement || container; - if (svg.createSVGPoint) { - var point = svg.createSVGPoint(); - if (d3_mouse_bug44083 < 0) { - var window = d3_window(container); - if (window.scrollX || window.scrollY) { - svg = d3.select("body").append("svg").style({ - position: "absolute", - top: 0, - left: 0, - margin: 0, - padding: 0, - border: "none" - }, "important"); - var ctm = svg[0][0].getScreenCTM(); - d3_mouse_bug44083 = !(ctm.f || ctm.e); - svg.remove(); - } - } - if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX, - point.y = e.clientY; - point = point.matrixTransform(container.getScreenCTM().inverse()); - return [ point.x, point.y ]; - } - var rect = container.getBoundingClientRect(); - return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ]; - } - d3.touch = function(container, touches, identifier) { - if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches; - if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) { - if ((touch = touches[i]).identifier === identifier) { - return d3_mousePoint(container, touch); - } - } - }; - d3.behavior.drag = function() { - var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_window, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_identity, "touchmove", "touchend"); - function drag() { - this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart); - } - function dragstart(id, position, subject, move, end) { - return function() { - var that = this, target = d3.event.target.correspondingElement || d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId); - if (origin) { - dragOffset = origin.apply(that, arguments); - dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ]; - } else { - dragOffset = [ 0, 0 ]; - } - dispatch({ - type: "dragstart" - }); - function moved() { - var position1 = position(parent, dragId), dx, dy; - if (!position1) return; - dx = position1[0] - position0[0]; - dy = position1[1] - position0[1]; - dragged |= dx | dy; - position0 = position1; - dispatch({ - type: "drag", - x: position1[0] + dragOffset[0], - y: position1[1] + dragOffset[1], - dx: dx, - dy: dy - }); - } - function ended() { - if (!position(parent, dragId)) return; - dragSubject.on(move + dragName, null).on(end + dragName, null); - dragRestore(dragged); - dispatch({ - type: "dragend" - }); - } - }; - } - drag.origin = function(x) { - if (!arguments.length) return origin; - origin = x; - return drag; - }; - return d3.rebind(drag, event, "on"); - }; - function d3_behavior_dragTouchId() { - return d3.event.changedTouches[0].identifier; - } - d3.touches = function(container, touches) { - if (arguments.length < 2) touches = d3_eventSource().touches; - return touches ? d3_array(touches).map(function(touch) { - var point = d3_mousePoint(container, touch); - point.identifier = touch.identifier; - return point; - }) : []; - }; - var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π; - function d3_sgn(x) { - return x > 0 ? 1 : x < 0 ? -1 : 0; - } - function d3_cross2d(a, b, c) { - return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]); - } - function d3_acos(x) { - return x > 1 ? 0 : x < -1 ? π : Math.acos(x); - } - function d3_asin(x) { - return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x); - } - function d3_sinh(x) { - return ((x = Math.exp(x)) - 1 / x) / 2; - } - function d3_cosh(x) { - return ((x = Math.exp(x)) + 1 / x) / 2; - } - function d3_tanh(x) { - return ((x = Math.exp(2 * x)) - 1) / (x + 1); - } - function d3_haversin(x) { - return (x = Math.sin(x / 2)) * x; - } - var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4; - d3.interpolateZoom = function(p0, p1) { - var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S; - if (d2 < ε2) { - S = Math.log(w1 / w0) / ρ; - i = function(t) { - return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * t * S) ]; - }; - } else { - var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); - S = (r1 - r0) / ρ; - i = function(t) { - var s = t * S, coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0)); - return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ]; - }; - } - i.duration = S * 1e3; - return i; - }; - d3.behavior.zoom = function() { - var view = { - x: 0, - y: 0, - k: 1 - }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, duration = 250, zooming = 0, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1; - if (!d3_behavior_zoomWheel) { - d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() { - return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1); - }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() { - return d3.event.wheelDelta; - }, "mousewheel") : (d3_behavior_zoomDelta = function() { - return -d3.event.detail; - }, "MozMousePixelScroll"); - } - function zoom(g) { - g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted); - } - zoom.event = function(g) { - g.each(function() { - var dispatch = event.of(this, arguments), view1 = view; - if (d3_transitionInheritId) { - d3.select(this).transition().each("start.zoom", function() { - view = this.__chart__ || { - x: 0, - y: 0, - k: 1 - }; - zoomstarted(dispatch); - }).tween("zoom:zoom", function() { - var dx = size[0], dy = size[1], cx = center0 ? center0[0] : dx / 2, cy = center0 ? center0[1] : dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]); - return function(t) { - var l = i(t), k = dx / l[2]; - this.__chart__ = view = { - x: cx - l[0] * k, - y: cy - l[1] * k, - k: k - }; - zoomed(dispatch); - }; - }).each("interrupt.zoom", function() { - zoomended(dispatch); - }).each("end.zoom", function() { - zoomended(dispatch); - }); - } else { - this.__chart__ = view; - zoomstarted(dispatch); - zoomed(dispatch); - zoomended(dispatch); - } - }); - }; - zoom.translate = function(_) { - if (!arguments.length) return [ view.x, view.y ]; - view = { - x: +_[0], - y: +_[1], - k: view.k - }; - rescale(); - return zoom; - }; - zoom.scale = function(_) { - if (!arguments.length) return view.k; - view = { - x: view.x, - y: view.y, - k: null - }; - scaleTo(+_); - rescale(); - return zoom; - }; - zoom.scaleExtent = function(_) { - if (!arguments.length) return scaleExtent; - scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ]; - return zoom; - }; - zoom.center = function(_) { - if (!arguments.length) return center; - center = _ && [ +_[0], +_[1] ]; - return zoom; - }; - zoom.size = function(_) { - if (!arguments.length) return size; - size = _ && [ +_[0], +_[1] ]; - return zoom; - }; - zoom.duration = function(_) { - if (!arguments.length) return duration; - duration = +_; - return zoom; - }; - zoom.x = function(z) { - if (!arguments.length) return x1; - x1 = z; - x0 = z.copy(); - view = { - x: 0, - y: 0, - k: 1 - }; - return zoom; - }; - zoom.y = function(z) { - if (!arguments.length) return y1; - y1 = z; - y0 = z.copy(); - view = { - x: 0, - y: 0, - k: 1 - }; - return zoom; - }; - function location(p) { - return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ]; - } - function point(l) { - return [ l[0] * view.k + view.x, l[1] * view.k + view.y ]; - } - function scaleTo(s) { - view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s)); - } - function translateTo(p, l) { - l = point(l); - view.x += p[0] - l[0]; - view.y += p[1] - l[1]; - } - function zoomTo(that, p, l, k) { - that.__chart__ = { - x: view.x, - y: view.y, - k: view.k - }; - scaleTo(Math.pow(2, k)); - translateTo(center0 = p, l); - that = d3.select(that); - if (duration > 0) that = that.transition().duration(duration); - that.call(zoom.event); - } - function rescale() { - if (x1) x1.domain(x0.range().map(function(x) { - return (x - view.x) / view.k; - }).map(x0.invert)); - if (y1) y1.domain(y0.range().map(function(y) { - return (y - view.y) / view.k; - }).map(y0.invert)); - } - function zoomstarted(dispatch) { - if (!zooming++) dispatch({ - type: "zoomstart" - }); - } - function zoomed(dispatch) { - rescale(); - dispatch({ - type: "zoom", - scale: view.k, - translate: [ view.x, view.y ] - }); - } - function zoomended(dispatch) { - if (!--zooming) dispatch({ - type: "zoomend" - }), center0 = null; - } - function mousedowned() { - var that = this, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that); - d3_selection_interrupt.call(that); - zoomstarted(dispatch); - function moved() { - dragged = 1; - translateTo(d3.mouse(that), location0); - zoomed(dispatch); - } - function ended() { - subject.on(mousemove, null).on(mouseup, null); - dragRestore(dragged); - zoomended(dispatch); - } - } - function touchstarted() { - var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(that); - started(); - zoomstarted(dispatch); - subject.on(mousedown, null).on(touchstart, started); - function relocate() { - var touches = d3.touches(that); - scale0 = view.k; - touches.forEach(function(t) { - if (t.identifier in locations0) locations0[t.identifier] = location(t); - }); - return touches; - } - function started() { - var target = d3.event.target; - d3.select(target).on(touchmove, moved).on(touchend, ended); - targets.push(target); - var changed = d3.event.changedTouches; - for (var i = 0, n = changed.length; i < n; ++i) { - locations0[changed[i].identifier] = null; - } - var touches = relocate(), now = Date.now(); - if (touches.length === 1) { - if (now - touchtime < 500) { - var p = touches[0]; - zoomTo(that, p, locations0[p.identifier], Math.floor(Math.log(view.k) / Math.LN2) + 1); - d3_eventPreventDefault(); - } - touchtime = now; - } else if (touches.length > 1) { - var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1]; - distance0 = dx * dx + dy * dy; - } - } - function moved() { - var touches = d3.touches(that), p0, l0, p1, l1; - d3_selection_interrupt.call(that); - for (var i = 0, n = touches.length; i < n; ++i, l1 = null) { - p1 = touches[i]; - if (l1 = locations0[p1.identifier]) { - if (l0) break; - p0 = p1, l0 = l1; - } - } - if (l1) { - var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0); - p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ]; - l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ]; - scaleTo(scale1 * scale0); - } - touchtime = null; - translateTo(p0, l0); - zoomed(dispatch); - } - function ended() { - if (d3.event.touches.length) { - var changed = d3.event.changedTouches; - for (var i = 0, n = changed.length; i < n; ++i) { - delete locations0[changed[i].identifier]; - } - for (var identifier in locations0) { - return void relocate(); - } - } - d3.selectAll(targets).on(zoomName, null); - subject.on(mousedown, mousedowned).on(touchstart, touchstarted); - dragRestore(); - zoomended(dispatch); - } - } - function mousewheeled() { - var dispatch = event.of(this, arguments); - if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this), - translate0 = location(center0 = center || d3.mouse(this)), zoomstarted(dispatch); - mousewheelTimer = setTimeout(function() { - mousewheelTimer = null; - zoomended(dispatch); - }, 50); - d3_eventPreventDefault(); - scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k); - translateTo(center0, translate0); - zoomed(dispatch); - } - function dblclicked() { - var p = d3.mouse(this), k = Math.log(view.k) / Math.LN2; - zoomTo(this, p, location(p), d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1); - } - return d3.rebind(zoom, event, "on"); - }; - var d3_behavior_zoomInfinity = [ 0, Infinity ], d3_behavior_zoomDelta, d3_behavior_zoomWheel; - d3.color = d3_color; - function d3_color() {} - d3_color.prototype.toString = function() { - return this.rgb() + ""; - }; - d3.hsl = d3_hsl; - function d3_hsl(h, s, l) { - return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l); - } - var d3_hslPrototype = d3_hsl.prototype = new d3_color(); - d3_hslPrototype.brighter = function(k) { - k = Math.pow(.7, arguments.length ? k : 1); - return new d3_hsl(this.h, this.s, this.l / k); - }; - d3_hslPrototype.darker = function(k) { - k = Math.pow(.7, arguments.length ? k : 1); - return new d3_hsl(this.h, this.s, k * this.l); - }; - d3_hslPrototype.rgb = function() { - return d3_hsl_rgb(this.h, this.s, this.l); - }; - function d3_hsl_rgb(h, s, l) { - var m1, m2; - h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h; - s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s; - l = l < 0 ? 0 : l > 1 ? 1 : l; - m2 = l <= .5 ? l * (1 + s) : l + s - l * s; - m1 = 2 * l - m2; - function v(h) { - if (h > 360) h -= 360; else if (h < 0) h += 360; - if (h < 60) return m1 + (m2 - m1) * h / 60; - if (h < 180) return m2; - if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60; - return m1; - } - function vv(h) { - return Math.round(v(h) * 255); - } - return new d3_rgb(vv(h + 120), vv(h), vv(h - 120)); - } - d3.hcl = d3_hcl; - function d3_hcl(h, c, l) { - return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l); - } - var d3_hclPrototype = d3_hcl.prototype = new d3_color(); - d3_hclPrototype.brighter = function(k) { - return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1))); - }; - d3_hclPrototype.darker = function(k) { - return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1))); - }; - d3_hclPrototype.rgb = function() { - return d3_hcl_lab(this.h, this.c, this.l).rgb(); - }; - function d3_hcl_lab(h, c, l) { - if (isNaN(h)) h = 0; - if (isNaN(c)) c = 0; - return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c); - } - d3.lab = d3_lab; - function d3_lab(l, a, b) { - return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b); - } - var d3_lab_K = 18; - var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883; - var d3_labPrototype = d3_lab.prototype = new d3_color(); - d3_labPrototype.brighter = function(k) { - return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); - }; - d3_labPrototype.darker = function(k) { - return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); - }; - d3_labPrototype.rgb = function() { - return d3_lab_rgb(this.l, this.a, this.b); - }; - function d3_lab_rgb(l, a, b) { - var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200; - x = d3_lab_xyz(x) * d3_lab_X; - y = d3_lab_xyz(y) * d3_lab_Y; - z = d3_lab_xyz(z) * d3_lab_Z; - return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z)); - } - function d3_lab_hcl(l, a, b) { - return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l); - } - function d3_lab_xyz(x) { - return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037; - } - function d3_xyz_lab(x) { - return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29; - } - function d3_xyz_rgb(r) { - return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055)); - } - d3.rgb = d3_rgb; - function d3_rgb(r, g, b) { - return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b); - } - function d3_rgbNumber(value) { - return new d3_rgb(value >> 16, value >> 8 & 255, value & 255); - } - function d3_rgbString(value) { - return d3_rgbNumber(value) + ""; - } - var d3_rgbPrototype = d3_rgb.prototype = new d3_color(); - d3_rgbPrototype.brighter = function(k) { - k = Math.pow(.7, arguments.length ? k : 1); - var r = this.r, g = this.g, b = this.b, i = 30; - if (!r && !g && !b) return new d3_rgb(i, i, i); - if (r && r < i) r = i; - if (g && g < i) g = i; - if (b && b < i) b = i; - return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k)); - }; - d3_rgbPrototype.darker = function(k) { - k = Math.pow(.7, arguments.length ? k : 1); - return new d3_rgb(k * this.r, k * this.g, k * this.b); - }; - d3_rgbPrototype.hsl = function() { - return d3_rgb_hsl(this.r, this.g, this.b); - }; - d3_rgbPrototype.toString = function() { - return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b); - }; - function d3_rgb_hex(v) { - return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16); - } - function d3_rgb_parse(format, rgb, hsl) { - var r = 0, g = 0, b = 0, m1, m2, color; - m1 = /([a-z]+)\((.*)\)/.exec(format = format.toLowerCase()); - if (m1) { - m2 = m1[2].split(","); - switch (m1[1]) { - case "hsl": - { - return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100); - } - - case "rgb": - { - return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2])); - } - } - } - if (color = d3_rgb_names.get(format)) { - return rgb(color.r, color.g, color.b); - } - if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) { - if (format.length === 4) { - r = (color & 3840) >> 4; - r = r >> 4 | r; - g = color & 240; - g = g >> 4 | g; - b = color & 15; - b = b << 4 | b; - } else if (format.length === 7) { - r = (color & 16711680) >> 16; - g = (color & 65280) >> 8; - b = color & 255; - } - } - return rgb(r, g, b); - } - function d3_rgb_hsl(r, g, b) { - var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2; - if (d) { - s = l < .5 ? d / (max + min) : d / (2 - max - min); - if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4; - h *= 60; - } else { - h = NaN; - s = l > 0 && l < 1 ? 0 : h; - } - return new d3_hsl(h, s, l); - } - function d3_rgb_lab(r, g, b) { - r = d3_rgb_xyz(r); - g = d3_rgb_xyz(g); - b = d3_rgb_xyz(b); - var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z); - return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z)); - } - function d3_rgb_xyz(r) { - return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4); - } - function d3_rgb_parseNumber(c) { - var f = parseFloat(c); - return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f; - } - var d3_rgb_names = d3.map({ - aliceblue: 15792383, - antiquewhite: 16444375, - aqua: 65535, - aquamarine: 8388564, - azure: 15794175, - beige: 16119260, - bisque: 16770244, - black: 0, - blanchedalmond: 16772045, - blue: 255, - blueviolet: 9055202, - brown: 10824234, - burlywood: 14596231, - cadetblue: 6266528, - chartreuse: 8388352, - chocolate: 13789470, - coral: 16744272, - cornflowerblue: 6591981, - cornsilk: 16775388, - crimson: 14423100, - cyan: 65535, - darkblue: 139, - darkcyan: 35723, - darkgoldenrod: 12092939, - darkgray: 11119017, - darkgreen: 25600, - darkgrey: 11119017, - darkkhaki: 12433259, - darkmagenta: 9109643, - darkolivegreen: 5597999, - darkorange: 16747520, - darkorchid: 10040012, - darkred: 9109504, - darksalmon: 15308410, - darkseagreen: 9419919, - darkslateblue: 4734347, - darkslategray: 3100495, - darkslategrey: 3100495, - darkturquoise: 52945, - darkviolet: 9699539, - deeppink: 16716947, - deepskyblue: 49151, - dimgray: 6908265, - dimgrey: 6908265, - dodgerblue: 2003199, - firebrick: 11674146, - floralwhite: 16775920, - forestgreen: 2263842, - fuchsia: 16711935, - gainsboro: 14474460, - ghostwhite: 16316671, - gold: 16766720, - goldenrod: 14329120, - gray: 8421504, - green: 32768, - greenyellow: 11403055, - grey: 8421504, - honeydew: 15794160, - hotpink: 16738740, - indianred: 13458524, - indigo: 4915330, - ivory: 16777200, - khaki: 15787660, - lavender: 15132410, - lavenderblush: 16773365, - lawngreen: 8190976, - lemonchiffon: 16775885, - lightblue: 11393254, - lightcoral: 15761536, - lightcyan: 14745599, - lightgoldenrodyellow: 16448210, - lightgray: 13882323, - lightgreen: 9498256, - lightgrey: 13882323, - lightpink: 16758465, - lightsalmon: 16752762, - lightseagreen: 2142890, - lightskyblue: 8900346, - lightslategray: 7833753, - lightslategrey: 7833753, - lightsteelblue: 11584734, - lightyellow: 16777184, - lime: 65280, - limegreen: 3329330, - linen: 16445670, - magenta: 16711935, - maroon: 8388608, - mediumaquamarine: 6737322, - mediumblue: 205, - mediumorchid: 12211667, - mediumpurple: 9662683, - mediumseagreen: 3978097, - mediumslateblue: 8087790, - mediumspringgreen: 64154, - mediumturquoise: 4772300, - mediumvioletred: 13047173, - midnightblue: 1644912, - mintcream: 16121850, - mistyrose: 16770273, - moccasin: 16770229, - navajowhite: 16768685, - navy: 128, - oldlace: 16643558, - olive: 8421376, - olivedrab: 7048739, - orange: 16753920, - orangered: 16729344, - orchid: 14315734, - palegoldenrod: 15657130, - palegreen: 10025880, - paleturquoise: 11529966, - palevioletred: 14381203, - papayawhip: 16773077, - peachpuff: 16767673, - peru: 13468991, - pink: 16761035, - plum: 14524637, - powderblue: 11591910, - purple: 8388736, - rebeccapurple: 6697881, - red: 16711680, - rosybrown: 12357519, - royalblue: 4286945, - saddlebrown: 9127187, - salmon: 16416882, - sandybrown: 16032864, - seagreen: 3050327, - seashell: 16774638, - sienna: 10506797, - silver: 12632256, - skyblue: 8900331, - slateblue: 6970061, - slategray: 7372944, - slategrey: 7372944, - snow: 16775930, - springgreen: 65407, - steelblue: 4620980, - tan: 13808780, - teal: 32896, - thistle: 14204888, - tomato: 16737095, - turquoise: 4251856, - violet: 15631086, - wheat: 16113331, - white: 16777215, - whitesmoke: 16119285, - yellow: 16776960, - yellowgreen: 10145074 - }); - d3_rgb_names.forEach(function(key, value) { - d3_rgb_names.set(key, d3_rgbNumber(value)); - }); - function d3_functor(v) { - return typeof v === "function" ? v : function() { - return v; - }; - } - d3.functor = d3_functor; - d3.xhr = d3_xhrType(d3_identity); - function d3_xhrType(response) { - return function(url, mimeType, callback) { - if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType, - mimeType = null; - return d3_xhr(url, mimeType, response, callback); - }; - } - function d3_xhr(url, mimeType, response, callback) { - var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null; - if (this.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest(); - "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() { - request.readyState > 3 && respond(); - }; - function respond() { - var status = request.status, result; - if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) { - try { - result = response.call(xhr, request); - } catch (e) { - dispatch.error.call(xhr, e); - return; - } - dispatch.load.call(xhr, result); - } else { - dispatch.error.call(xhr, request); - } - } - request.onprogress = function(event) { - var o = d3.event; - d3.event = event; - try { - dispatch.progress.call(xhr, request); - } finally { - d3.event = o; - } - }; - xhr.header = function(name, value) { - name = (name + "").toLowerCase(); - if (arguments.length < 2) return headers[name]; - if (value == null) delete headers[name]; else headers[name] = value + ""; - return xhr; - }; - xhr.mimeType = function(value) { - if (!arguments.length) return mimeType; - mimeType = value == null ? null : value + ""; - return xhr; - }; - xhr.responseType = function(value) { - if (!arguments.length) return responseType; - responseType = value; - return xhr; - }; - xhr.response = function(value) { - response = value; - return xhr; - }; - [ "get", "post" ].forEach(function(method) { - xhr[method] = function() { - return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments))); - }; - }); - xhr.send = function(method, data, callback) { - if (arguments.length === 2 && typeof data === "function") callback = data, data = null; - request.open(method, url, true); - if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*"; - if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]); - if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType); - if (responseType != null) request.responseType = responseType; - if (callback != null) xhr.on("error", callback).on("load", function(request) { - callback(null, request); - }); - dispatch.beforesend.call(xhr, request); - request.send(data == null ? null : data); - return xhr; - }; - xhr.abort = function() { - request.abort(); - return xhr; - }; - d3.rebind(xhr, dispatch, "on"); - return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback)); - } - function d3_xhr_fixCallback(callback) { - return callback.length === 1 ? function(error, request) { - callback(error == null ? request : null); - } : callback; - } - function d3_xhrHasResponse(request) { - var type = request.responseType; - return type && type !== "text" ? request.response : request.responseText; - } - d3.dsv = function(delimiter, mimeType) { - var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0); - function dsv(url, row, callback) { - if (arguments.length < 3) callback = row, row = null; - var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback); - xhr.row = function(_) { - return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row; - }; - return xhr; - } - function response(request) { - return dsv.parse(request.responseText); - } - function typedResponse(f) { - return function(request) { - return dsv.parse(request.responseText, f); - }; - } - dsv.parse = function(text, f) { - var o; - return dsv.parseRows(text, function(row, i) { - if (o) return o(row, i - 1); - var a = new Function("d", "return {" + row.map(function(name, i) { - return JSON.stringify(name) + ": d[" + i + "]"; - }).join(",") + "}"); - o = f ? function(row, i) { - return f(a(row), i); - } : a; - }); - }; - dsv.parseRows = function(text, f) { - var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol; - function token() { - if (I >= N) return EOF; - if (eol) return eol = false, EOL; - var j = I; - if (text.charCodeAt(j) === 34) { - var i = j; - while (i++ < N) { - if (text.charCodeAt(i) === 34) { - if (text.charCodeAt(i + 1) !== 34) break; - ++i; - } - } - I = i + 2; - var c = text.charCodeAt(i + 1); - if (c === 13) { - eol = true; - if (text.charCodeAt(i + 2) === 10) ++I; - } else if (c === 10) { - eol = true; - } - return text.slice(j + 1, i).replace(/""/g, '"'); - } - while (I < N) { - var c = text.charCodeAt(I++), k = 1; - if (c === 10) eol = true; else if (c === 13) { - eol = true; - if (text.charCodeAt(I) === 10) ++I, ++k; - } else if (c !== delimiterCode) continue; - return text.slice(j, I - k); - } - return text.slice(j); - } - while ((t = token()) !== EOF) { - var a = []; - while (t !== EOL && t !== EOF) { - a.push(t); - t = token(); - } - if (f && (a = f(a, n++)) == null) continue; - rows.push(a); - } - return rows; - }; - dsv.format = function(rows) { - if (Array.isArray(rows[0])) return dsv.formatRows(rows); - var fieldSet = new d3_Set(), fields = []; - rows.forEach(function(row) { - for (var field in row) { - if (!fieldSet.has(field)) { - fields.push(fieldSet.add(field)); - } - } - }); - return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) { - return fields.map(function(field) { - return formatValue(row[field]); - }).join(delimiter); - })).join("\n"); - }; - dsv.formatRows = function(rows) { - return rows.map(formatRow).join("\n"); - }; - function formatRow(row) { - return row.map(formatValue).join(delimiter); - } - function formatValue(text) { - return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text; - } - return dsv; - }; - d3.csv = d3.dsv(",", "text/csv"); - d3.tsv = d3.dsv(" ", "text/tab-separated-values"); - var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_frame = this[d3_vendorSymbol(this, "requestAnimationFrame")] || function(callback) { - setTimeout(callback, 17); - }; - d3.timer = function() { - d3_timer.apply(this, arguments); - }; - function d3_timer(callback, delay, then) { - var n = arguments.length; - if (n < 2) delay = 0; - if (n < 3) then = Date.now(); - var time = then + delay, timer = { - c: callback, - t: time, - n: null - }; - if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer; - d3_timer_queueTail = timer; - if (!d3_timer_interval) { - d3_timer_timeout = clearTimeout(d3_timer_timeout); - d3_timer_interval = 1; - d3_timer_frame(d3_timer_step); - } - return timer; - } - function d3_timer_step() { - var now = d3_timer_mark(), delay = d3_timer_sweep() - now; - if (delay > 24) { - if (isFinite(delay)) { - clearTimeout(d3_timer_timeout); - d3_timer_timeout = setTimeout(d3_timer_step, delay); - } - d3_timer_interval = 0; - } else { - d3_timer_interval = 1; - d3_timer_frame(d3_timer_step); - } - } - d3.timer.flush = function() { - d3_timer_mark(); - d3_timer_sweep(); - }; - function d3_timer_mark() { - var now = Date.now(), timer = d3_timer_queueHead; - while (timer) { - if (now >= timer.t && timer.c(now - timer.t)) timer.c = null; - timer = timer.n; - } - return now; - } - function d3_timer_sweep() { - var t0, t1 = d3_timer_queueHead, time = Infinity; - while (t1) { - if (t1.c) { - if (t1.t < time) time = t1.t; - t1 = (t0 = t1).n; - } else { - t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n; - } - } - d3_timer_queueTail = t0; - return time; - } - function d3_format_precision(x, p) { - return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1); - } - d3.round = function(x, n) { - return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x); - }; - var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix); - d3.formatPrefix = function(value, precision) { - var i = 0; - if (value = +value) { - if (value < 0) value *= -1; - if (precision) value = d3.round(value, d3_format_precision(value, precision)); - i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10); - i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3)); - } - return d3_formatPrefixes[8 + i / 3]; - }; - function d3_formatPrefix(d, i) { - var k = Math.pow(10, abs(8 - i) * 3); - return { - scale: i > 8 ? function(d) { - return d / k; - } : function(d) { - return d * k; - }, - symbol: d - }; - } - function d3_locale_numberFormat(locale) { - var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) { - var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0; - while (i > 0 && g > 0) { - if (length + g + 1 > width) g = Math.max(1, width - length); - t.push(value.substring(i -= g, i + g)); - if ((length += g + 1) > width) break; - g = locale_grouping[j = (j + 1) % locale_grouping.length]; - } - return t.reverse().join(locale_thousands); - } : d3_identity; - return function(specifier) { - var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "-", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false, exponent = true; - if (precision) precision = +precision.substring(1); - if (zfill || fill === "0" && align === "=") { - zfill = fill = "0"; - align = "="; - } - switch (type) { - case "n": - comma = true; - type = "g"; - break; - - case "%": - scale = 100; - suffix = "%"; - type = "f"; - break; - - case "p": - scale = 100; - suffix = "%"; - type = "r"; - break; - - case "b": - case "o": - case "x": - case "X": - if (symbol === "#") prefix = "0" + type.toLowerCase(); - - case "c": - exponent = false; - - case "d": - integer = true; - precision = 0; - break; - - case "s": - scale = -1; - type = "r"; - break; - } - if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1]; - if (type == "r" && !precision) type = "g"; - if (precision != null) { - if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision)); - } - type = d3_format_types.get(type) || d3_format_typeDefault; - var zcomma = zfill && comma; - return function(value) { - var fullSuffix = suffix; - if (integer && value % 1) return ""; - var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign === "-" ? "" : sign; - if (scale < 0) { - var unit = d3.formatPrefix(value, precision); - value = unit.scale(value); - fullSuffix = unit.symbol + suffix; - } else { - value *= scale; - } - value = type(value, precision); - var i = value.lastIndexOf("."), before, after; - if (i < 0) { - var j = exponent ? value.lastIndexOf("e") : -1; - if (j < 0) before = value, after = ""; else before = value.substring(0, j), after = value.substring(j); - } else { - before = value.substring(0, i); - after = locale_decimal + value.substring(i + 1); - } - if (!zfill && comma) before = formatGroup(before, Infinity); - var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : ""; - if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity); - negative += prefix; - value = before + after; - return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix; - }; - }; - } - var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i; - var d3_format_types = d3.map({ - b: function(x) { - return x.toString(2); - }, - c: function(x) { - return String.fromCharCode(x); - }, - o: function(x) { - return x.toString(8); - }, - x: function(x) { - return x.toString(16); - }, - X: function(x) { - return x.toString(16).toUpperCase(); - }, - g: function(x, p) { - return x.toPrecision(p); - }, - e: function(x, p) { - return x.toExponential(p); - }, - f: function(x, p) { - return x.toFixed(p); - }, - r: function(x, p) { - return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p)))); - } - }); - function d3_format_typeDefault(x) { - return x + ""; - } - var d3_time = d3.time = {}, d3_date = Date; - function d3_date_utc() { - this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]); - } - d3_date_utc.prototype = { - getDate: function() { - return this._.getUTCDate(); - }, - getDay: function() { - return this._.getUTCDay(); - }, - getFullYear: function() { - return this._.getUTCFullYear(); - }, - getHours: function() { - return this._.getUTCHours(); - }, - getMilliseconds: function() { - return this._.getUTCMilliseconds(); - }, - getMinutes: function() { - return this._.getUTCMinutes(); - }, - getMonth: function() { - return this._.getUTCMonth(); - }, - getSeconds: function() { - return this._.getUTCSeconds(); - }, - getTime: function() { - return this._.getTime(); - }, - getTimezoneOffset: function() { - return 0; - }, - valueOf: function() { - return this._.valueOf(); - }, - setDate: function() { - d3_time_prototype.setUTCDate.apply(this._, arguments); - }, - setDay: function() { - d3_time_prototype.setUTCDay.apply(this._, arguments); - }, - setFullYear: function() { - d3_time_prototype.setUTCFullYear.apply(this._, arguments); - }, - setHours: function() { - d3_time_prototype.setUTCHours.apply(this._, arguments); - }, - setMilliseconds: function() { - d3_time_prototype.setUTCMilliseconds.apply(this._, arguments); - }, - setMinutes: function() { - d3_time_prototype.setUTCMinutes.apply(this._, arguments); - }, - setMonth: function() { - d3_time_prototype.setUTCMonth.apply(this._, arguments); - }, - setSeconds: function() { - d3_time_prototype.setUTCSeconds.apply(this._, arguments); - }, - setTime: function() { - d3_time_prototype.setTime.apply(this._, arguments); - } - }; - var d3_time_prototype = Date.prototype; - function d3_time_interval(local, step, number) { - function round(date) { - var d0 = local(date), d1 = offset(d0, 1); - return date - d0 < d1 - date ? d0 : d1; - } - function ceil(date) { - step(date = local(new d3_date(date - 1)), 1); - return date; - } - function offset(date, k) { - step(date = new d3_date(+date), k); - return date; - } - function range(t0, t1, dt) { - var time = ceil(t0), times = []; - if (dt > 1) { - while (time < t1) { - if (!(number(time) % dt)) times.push(new Date(+time)); - step(time, 1); - } - } else { - while (time < t1) times.push(new Date(+time)), step(time, 1); - } - return times; - } - function range_utc(t0, t1, dt) { - try { - d3_date = d3_date_utc; - var utc = new d3_date_utc(); - utc._ = t0; - return range(utc, t1, dt); - } finally { - d3_date = Date; - } - } - local.floor = local; - local.round = round; - local.ceil = ceil; - local.offset = offset; - local.range = range; - var utc = local.utc = d3_time_interval_utc(local); - utc.floor = utc; - utc.round = d3_time_interval_utc(round); - utc.ceil = d3_time_interval_utc(ceil); - utc.offset = d3_time_interval_utc(offset); - utc.range = range_utc; - return local; - } - function d3_time_interval_utc(method) { - return function(date, k) { - try { - d3_date = d3_date_utc; - var utc = new d3_date_utc(); - utc._ = date; - return method(utc, k)._; - } finally { - d3_date = Date; - } - }; - } - d3_time.year = d3_time_interval(function(date) { - date = d3_time.day(date); - date.setMonth(0, 1); - return date; - }, function(date, offset) { - date.setFullYear(date.getFullYear() + offset); - }, function(date) { - return date.getFullYear(); - }); - d3_time.years = d3_time.year.range; - d3_time.years.utc = d3_time.year.utc.range; - d3_time.day = d3_time_interval(function(date) { - var day = new d3_date(2e3, 0); - day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); - return day; - }, function(date, offset) { - date.setDate(date.getDate() + offset); - }, function(date) { - return date.getDate() - 1; - }); - d3_time.days = d3_time.day.range; - d3_time.days.utc = d3_time.day.utc.range; - d3_time.dayOfYear = function(date) { - var year = d3_time.year(date); - return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5); - }; - [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) { - i = 7 - i; - var interval = d3_time[day] = d3_time_interval(function(date) { - (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7); - return date; - }, function(date, offset) { - date.setDate(date.getDate() + Math.floor(offset) * 7); - }, function(date) { - var day = d3_time.year(date).getDay(); - return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i); - }); - d3_time[day + "s"] = interval.range; - d3_time[day + "s"].utc = interval.utc.range; - d3_time[day + "OfYear"] = function(date) { - var day = d3_time.year(date).getDay(); - return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7); - }; - }); - d3_time.week = d3_time.sunday; - d3_time.weeks = d3_time.sunday.range; - d3_time.weeks.utc = d3_time.sunday.utc.range; - d3_time.weekOfYear = d3_time.sundayOfYear; - function d3_locale_timeFormat(locale) { - var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths; - function d3_time_format(template) { - var n = template.length; - function format(date) { - var string = [], i = -1, j = 0, c, p, f; - while (++i < n) { - if (template.charCodeAt(i) === 37) { - string.push(template.slice(j, i)); - if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i); - if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p); - string.push(c); - j = i + 1; - } - } - string.push(template.slice(j, i)); - return string.join(""); - } - format.parse = function(string) { - var d = { - y: 1900, - m: 0, - d: 1, - H: 0, - M: 0, - S: 0, - L: 0, - Z: null - }, i = d3_time_parse(d, template, string, 0); - if (i != string.length) return null; - if ("p" in d) d.H = d.H % 12 + d.p * 12; - var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)(); - if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("W" in d || "U" in d) { - if (!("w" in d)) d.w = "W" in d ? 1 : 0; - date.setFullYear(d.y, 0, 1); - date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7); - } else date.setFullYear(d.y, d.m, d.d); - date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L); - return localZ ? date._ : date; - }; - format.toString = function() { - return template; - }; - return format; - } - function d3_time_parse(date, template, string, j) { - var c, p, t, i = 0, n = template.length, m = string.length; - while (i < n) { - if (j >= m) return -1; - c = template.charCodeAt(i++); - if (c === 37) { - t = template.charAt(i++); - p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t]; - if (!p || (j = p(date, string, j)) < 0) return -1; - } else if (c != string.charCodeAt(j++)) { - return -1; - } - } - return j; - } - d3_time_format.utc = function(template) { - var local = d3_time_format(template); - function format(date) { - try { - d3_date = d3_date_utc; - var utc = new d3_date(); - utc._ = date; - return local(utc); - } finally { - d3_date = Date; - } - } - format.parse = function(string) { - try { - d3_date = d3_date_utc; - var date = local.parse(string); - return date && date._; - } finally { - d3_date = Date; - } - }; - format.toString = local.toString; - return format; - }; - d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti; - var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths); - locale_periods.forEach(function(p, i) { - d3_time_periodLookup.set(p.toLowerCase(), i); - }); - var d3_time_formats = { - a: function(d) { - return locale_shortDays[d.getDay()]; - }, - A: function(d) { - return locale_days[d.getDay()]; - }, - b: function(d) { - return locale_shortMonths[d.getMonth()]; - }, - B: function(d) { - return locale_months[d.getMonth()]; - }, - c: d3_time_format(locale_dateTime), - d: function(d, p) { - return d3_time_formatPad(d.getDate(), p, 2); - }, - e: function(d, p) { - return d3_time_formatPad(d.getDate(), p, 2); - }, - H: function(d, p) { - return d3_time_formatPad(d.getHours(), p, 2); - }, - I: function(d, p) { - return d3_time_formatPad(d.getHours() % 12 || 12, p, 2); - }, - j: function(d, p) { - return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3); - }, - L: function(d, p) { - return d3_time_formatPad(d.getMilliseconds(), p, 3); - }, - m: function(d, p) { - return d3_time_formatPad(d.getMonth() + 1, p, 2); - }, - M: function(d, p) { - return d3_time_formatPad(d.getMinutes(), p, 2); - }, - p: function(d) { - return locale_periods[+(d.getHours() >= 12)]; - }, - S: function(d, p) { - return d3_time_formatPad(d.getSeconds(), p, 2); - }, - U: function(d, p) { - return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2); - }, - w: function(d) { - return d.getDay(); - }, - W: function(d, p) { - return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2); - }, - x: d3_time_format(locale_date), - X: d3_time_format(locale_time), - y: function(d, p) { - return d3_time_formatPad(d.getFullYear() % 100, p, 2); - }, - Y: function(d, p) { - return d3_time_formatPad(d.getFullYear() % 1e4, p, 4); - }, - Z: d3_time_zone, - "%": function() { - return "%"; - } - }; - var d3_time_parsers = { - a: d3_time_parseWeekdayAbbrev, - A: d3_time_parseWeekday, - b: d3_time_parseMonthAbbrev, - B: d3_time_parseMonth, - c: d3_time_parseLocaleFull, - d: d3_time_parseDay, - e: d3_time_parseDay, - H: d3_time_parseHour24, - I: d3_time_parseHour24, - j: d3_time_parseDayOfYear, - L: d3_time_parseMilliseconds, - m: d3_time_parseMonthNumber, - M: d3_time_parseMinutes, - p: d3_time_parseAmPm, - S: d3_time_parseSeconds, - U: d3_time_parseWeekNumberSunday, - w: d3_time_parseWeekdayNumber, - W: d3_time_parseWeekNumberMonday, - x: d3_time_parseLocaleDate, - X: d3_time_parseLocaleTime, - y: d3_time_parseYear, - Y: d3_time_parseFullYear, - Z: d3_time_parseZone, - "%": d3_time_parseLiteralPercent - }; - function d3_time_parseWeekdayAbbrev(date, string, i) { - d3_time_dayAbbrevRe.lastIndex = 0; - var n = d3_time_dayAbbrevRe.exec(string.slice(i)); - return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function d3_time_parseWeekday(date, string, i) { - d3_time_dayRe.lastIndex = 0; - var n = d3_time_dayRe.exec(string.slice(i)); - return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function d3_time_parseMonthAbbrev(date, string, i) { - d3_time_monthAbbrevRe.lastIndex = 0; - var n = d3_time_monthAbbrevRe.exec(string.slice(i)); - return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function d3_time_parseMonth(date, string, i) { - d3_time_monthRe.lastIndex = 0; - var n = d3_time_monthRe.exec(string.slice(i)); - return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function d3_time_parseLocaleFull(date, string, i) { - return d3_time_parse(date, d3_time_formats.c.toString(), string, i); - } - function d3_time_parseLocaleDate(date, string, i) { - return d3_time_parse(date, d3_time_formats.x.toString(), string, i); - } - function d3_time_parseLocaleTime(date, string, i) { - return d3_time_parse(date, d3_time_formats.X.toString(), string, i); - } - function d3_time_parseAmPm(date, string, i) { - var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase()); - return n == null ? -1 : (date.p = n, i); - } - return d3_time_format; - } - var d3_time_formatPads = { - "-": "", - _: " ", - "0": "0" - }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/; - function d3_time_formatPad(value, fill, width) { - var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length; - return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string); - } - function d3_time_formatRe(names) { - return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i"); - } - function d3_time_formatLookup(names) { - var map = new d3_Map(), i = -1, n = names.length; - while (++i < n) map.set(names[i].toLowerCase(), i); - return map; - } - function d3_time_parseWeekdayNumber(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i, i + 1)); - return n ? (date.w = +n[0], i + n[0].length) : -1; - } - function d3_time_parseWeekNumberSunday(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i)); - return n ? (date.U = +n[0], i + n[0].length) : -1; - } - function d3_time_parseWeekNumberMonday(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i)); - return n ? (date.W = +n[0], i + n[0].length) : -1; - } - function d3_time_parseFullYear(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i, i + 4)); - return n ? (date.y = +n[0], i + n[0].length) : -1; - } - function d3_time_parseYear(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i, i + 2)); - return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1; - } - function d3_time_parseZone(date, string, i) { - return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string, - i + 5) : -1; - } - function d3_time_expandYear(d) { - return d + (d > 68 ? 1900 : 2e3); - } - function d3_time_parseMonthNumber(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i, i + 2)); - return n ? (date.m = n[0] - 1, i + n[0].length) : -1; - } - function d3_time_parseDay(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i, i + 2)); - return n ? (date.d = +n[0], i + n[0].length) : -1; - } - function d3_time_parseDayOfYear(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i, i + 3)); - return n ? (date.j = +n[0], i + n[0].length) : -1; - } - function d3_time_parseHour24(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i, i + 2)); - return n ? (date.H = +n[0], i + n[0].length) : -1; - } - function d3_time_parseMinutes(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i, i + 2)); - return n ? (date.M = +n[0], i + n[0].length) : -1; - } - function d3_time_parseSeconds(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i, i + 2)); - return n ? (date.S = +n[0], i + n[0].length) : -1; - } - function d3_time_parseMilliseconds(date, string, i) { - d3_time_numberRe.lastIndex = 0; - var n = d3_time_numberRe.exec(string.slice(i, i + 3)); - return n ? (date.L = +n[0], i + n[0].length) : -1; - } - function d3_time_zone(d) { - var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = abs(z) / 60 | 0, zm = abs(z) % 60; - return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2); - } - function d3_time_parseLiteralPercent(date, string, i) { - d3_time_percentRe.lastIndex = 0; - var n = d3_time_percentRe.exec(string.slice(i, i + 1)); - return n ? i + n[0].length : -1; - } - function d3_time_formatMulti(formats) { - var n = formats.length, i = -1; - while (++i < n) formats[i][0] = this(formats[i][0]); - return function(date) { - var i = 0, f = formats[i]; - while (!f[1](date)) f = formats[++i]; - return f[0](date); - }; - } - d3.locale = function(locale) { - return { - numberFormat: d3_locale_numberFormat(locale), - timeFormat: d3_locale_timeFormat(locale) - }; - }; - var d3_locale_enUS = d3.locale({ - decimal: ".", - thousands: ",", - grouping: [ 3 ], - currency: [ "$", "" ], - dateTime: "%a %b %e %X %Y", - date: "%m/%d/%Y", - time: "%H:%M:%S", - periods: [ "AM", "PM" ], - days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], - shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], - months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], - shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ] - }); - d3.format = d3_locale_enUS.numberFormat; - d3.geo = {}; - function d3_adder() {} - d3_adder.prototype = { - s: 0, - t: 0, - add: function(y) { - d3_adderSum(y, this.t, d3_adderTemp); - d3_adderSum(d3_adderTemp.s, this.s, this); - if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t; - }, - reset: function() { - this.s = this.t = 0; - }, - valueOf: function() { - return this.s; - } - }; - var d3_adderTemp = new d3_adder(); - function d3_adderSum(a, b, o) { - var x = o.s = a + b, bv = x - a, av = x - bv; - o.t = a - av + (b - bv); - } - d3.geo.stream = function(object, listener) { - if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) { - d3_geo_streamObjectType[object.type](object, listener); - } else { - d3_geo_streamGeometry(object, listener); - } - }; - function d3_geo_streamGeometry(geometry, listener) { - if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) { - d3_geo_streamGeometryType[geometry.type](geometry, listener); - } - } - var d3_geo_streamObjectType = { - Feature: function(feature, listener) { - d3_geo_streamGeometry(feature.geometry, listener); - }, - FeatureCollection: function(object, listener) { - var features = object.features, i = -1, n = features.length; - while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener); - } - }; - var d3_geo_streamGeometryType = { - Sphere: function(object, listener) { - listener.sphere(); - }, - Point: function(object, listener) { - object = object.coordinates; - listener.point(object[0], object[1], object[2]); - }, - MultiPoint: function(object, listener) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]); - }, - LineString: function(object, listener) { - d3_geo_streamLine(object.coordinates, listener, 0); - }, - MultiLineString: function(object, listener) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0); - }, - Polygon: function(object, listener) { - d3_geo_streamPolygon(object.coordinates, listener); - }, - MultiPolygon: function(object, listener) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) d3_geo_streamPolygon(coordinates[i], listener); - }, - GeometryCollection: function(object, listener) { - var geometries = object.geometries, i = -1, n = geometries.length; - while (++i < n) d3_geo_streamGeometry(geometries[i], listener); - } - }; - function d3_geo_streamLine(coordinates, listener, closed) { - var i = -1, n = coordinates.length - closed, coordinate; - listener.lineStart(); - while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]); - listener.lineEnd(); - } - function d3_geo_streamPolygon(coordinates, listener) { - var i = -1, n = coordinates.length; - listener.polygonStart(); - while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1); - listener.polygonEnd(); - } - d3.geo.area = function(object) { - d3_geo_areaSum = 0; - d3.geo.stream(object, d3_geo_area); - return d3_geo_areaSum; - }; - var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder(); - var d3_geo_area = { - sphere: function() { - d3_geo_areaSum += 4 * π; - }, - point: d3_noop, - lineStart: d3_noop, - lineEnd: d3_noop, - polygonStart: function() { - d3_geo_areaRingSum.reset(); - d3_geo_area.lineStart = d3_geo_areaRingStart; - }, - polygonEnd: function() { - var area = 2 * d3_geo_areaRingSum; - d3_geo_areaSum += area < 0 ? 4 * π + area : area; - d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop; - } - }; - function d3_geo_areaRingStart() { - var λ00, φ00, λ0, cosφ0, sinφ0; - d3_geo_area.point = function(λ, φ) { - d3_geo_area.point = nextPoint; - λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), - sinφ0 = Math.sin(φ); - }; - function nextPoint(λ, φ) { - λ *= d3_radians; - φ = φ * d3_radians / 2 + π / 4; - var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ); - d3_geo_areaRingSum.add(Math.atan2(v, u)); - λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ; - } - d3_geo_area.lineEnd = function() { - nextPoint(λ00, φ00); - }; - } - function d3_geo_cartesian(spherical) { - var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ); - return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ]; - } - function d3_geo_cartesianDot(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; - } - function d3_geo_cartesianCross(a, b) { - return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ]; - } - function d3_geo_cartesianAdd(a, b) { - a[0] += b[0]; - a[1] += b[1]; - a[2] += b[2]; - } - function d3_geo_cartesianScale(vector, k) { - return [ vector[0] * k, vector[1] * k, vector[2] * k ]; - } - function d3_geo_cartesianNormalize(d) { - var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); - d[0] /= l; - d[1] /= l; - d[2] /= l; - } - function d3_geo_spherical(cartesian) { - return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ]; - } - function d3_geo_sphericalEqual(a, b) { - return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε; - } - d3.geo.bounds = function() { - var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range; - var bound = { - point: point, - lineStart: lineStart, - lineEnd: lineEnd, - polygonStart: function() { - bound.point = ringPoint; - bound.lineStart = ringStart; - bound.lineEnd = ringEnd; - dλSum = 0; - d3_geo_area.polygonStart(); - }, - polygonEnd: function() { - d3_geo_area.polygonEnd(); - bound.point = point; - bound.lineStart = lineStart; - bound.lineEnd = lineEnd; - if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90; - range[0] = λ0, range[1] = λ1; - } - }; - function point(λ, φ) { - ranges.push(range = [ λ0 = λ, λ1 = λ ]); - if (φ < φ0) φ0 = φ; - if (φ > φ1) φ1 = φ; - } - function linePoint(λ, φ) { - var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]); - if (p0) { - var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal); - d3_geo_cartesianNormalize(inflection); - inflection = d3_geo_spherical(inflection); - var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180; - if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) { - var φi = inflection[1] * d3_degrees; - if (φi > φ1) φ1 = φi; - } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) { - var φi = -inflection[1] * d3_degrees; - if (φi < φ0) φ0 = φi; - } else { - if (φ < φ0) φ0 = φ; - if (φ > φ1) φ1 = φ; - } - if (antimeridian) { - if (λ < λ_) { - if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; - } else { - if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; - } - } else { - if (λ1 >= λ0) { - if (λ < λ0) λ0 = λ; - if (λ > λ1) λ1 = λ; - } else { - if (λ > λ_) { - if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; - } else { - if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; - } - } - } - } else { - point(λ, φ); - } - p0 = p, λ_ = λ; - } - function lineStart() { - bound.point = linePoint; - } - function lineEnd() { - range[0] = λ0, range[1] = λ1; - bound.point = point; - p0 = null; - } - function ringPoint(λ, φ) { - if (p0) { - var dλ = λ - λ_; - dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ; - } else λ__ = λ, φ__ = φ; - d3_geo_area.point(λ, φ); - linePoint(λ, φ); - } - function ringStart() { - d3_geo_area.lineStart(); - } - function ringEnd() { - ringPoint(λ__, φ__); - d3_geo_area.lineEnd(); - if (abs(dλSum) > ε) λ0 = -(λ1 = 180); - range[0] = λ0, range[1] = λ1; - p0 = null; - } - function angle(λ0, λ1) { - return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1; - } - function compareRanges(a, b) { - return a[0] - b[0]; - } - function withinRange(x, range) { - return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x; - } - return function(feature) { - φ1 = λ1 = -(λ0 = φ0 = Infinity); - ranges = []; - d3.geo.stream(feature, bound); - var n = ranges.length; - if (n) { - ranges.sort(compareRanges); - for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) { - b = ranges[i]; - if (withinRange(b[0], a) || withinRange(b[1], a)) { - if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1]; - if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0]; - } else { - merged.push(a = b); - } - } - var best = -Infinity, dλ; - for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) { - b = merged[i]; - if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1]; - } - } - ranges = range = null; - return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ]; - }; - }(); - d3.geo.centroid = function(object) { - d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; - d3.geo.stream(object, d3_geo_centroid); - var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z; - if (m < ε2) { - x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1; - if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0; - m = x * x + y * y + z * z; - if (m < ε2) return [ NaN, NaN ]; - } - return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ]; - }; - var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2; - var d3_geo_centroid = { - sphere: d3_noop, - point: d3_geo_centroidPoint, - lineStart: d3_geo_centroidLineStart, - lineEnd: d3_geo_centroidLineEnd, - polygonStart: function() { - d3_geo_centroid.lineStart = d3_geo_centroidRingStart; - }, - polygonEnd: function() { - d3_geo_centroid.lineStart = d3_geo_centroidLineStart; - } - }; - function d3_geo_centroidPoint(λ, φ) { - λ *= d3_radians; - var cosφ = Math.cos(φ *= d3_radians); - d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ)); - } - function d3_geo_centroidPointXYZ(x, y, z) { - ++d3_geo_centroidW0; - d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0; - d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0; - d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0; - } - function d3_geo_centroidLineStart() { - var x0, y0, z0; - d3_geo_centroid.point = function(λ, φ) { - λ *= d3_radians; - var cosφ = Math.cos(φ *= d3_radians); - x0 = cosφ * Math.cos(λ); - y0 = cosφ * Math.sin(λ); - z0 = Math.sin(φ); - d3_geo_centroid.point = nextPoint; - d3_geo_centroidPointXYZ(x0, y0, z0); - }; - function nextPoint(λ, φ) { - λ *= d3_radians; - var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z); - d3_geo_centroidW1 += w; - d3_geo_centroidX1 += w * (x0 + (x0 = x)); - d3_geo_centroidY1 += w * (y0 + (y0 = y)); - d3_geo_centroidZ1 += w * (z0 + (z0 = z)); - d3_geo_centroidPointXYZ(x0, y0, z0); - } - } - function d3_geo_centroidLineEnd() { - d3_geo_centroid.point = d3_geo_centroidPoint; - } - function d3_geo_centroidRingStart() { - var λ00, φ00, x0, y0, z0; - d3_geo_centroid.point = function(λ, φ) { - λ00 = λ, φ00 = φ; - d3_geo_centroid.point = nextPoint; - λ *= d3_radians; - var cosφ = Math.cos(φ *= d3_radians); - x0 = cosφ * Math.cos(λ); - y0 = cosφ * Math.sin(λ); - z0 = Math.sin(φ); - d3_geo_centroidPointXYZ(x0, y0, z0); - }; - d3_geo_centroid.lineEnd = function() { - nextPoint(λ00, φ00); - d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd; - d3_geo_centroid.point = d3_geo_centroidPoint; - }; - function nextPoint(λ, φ) { - λ *= d3_radians; - var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u); - d3_geo_centroidX2 += v * cx; - d3_geo_centroidY2 += v * cy; - d3_geo_centroidZ2 += v * cz; - d3_geo_centroidW1 += w; - d3_geo_centroidX1 += w * (x0 + (x0 = x)); - d3_geo_centroidY1 += w * (y0 + (y0 = y)); - d3_geo_centroidZ1 += w * (z0 + (z0 = z)); - d3_geo_centroidPointXYZ(x0, y0, z0); - } - } - function d3_geo_compose(a, b) { - function compose(x, y) { - return x = a(x, y), b(x[0], x[1]); - } - if (a.invert && b.invert) compose.invert = function(x, y) { - return x = b.invert(x, y), x && a.invert(x[0], x[1]); - }; - return compose; - } - function d3_true() { - return true; - } - function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) { - var subject = [], clip = []; - segments.forEach(function(segment) { - if ((n = segment.length - 1) <= 0) return; - var n, p0 = segment[0], p1 = segment[n]; - if (d3_geo_sphericalEqual(p0, p1)) { - listener.lineStart(); - for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]); - listener.lineEnd(); - return; - } - var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false); - a.o = b; - subject.push(a); - clip.push(b); - a = new d3_geo_clipPolygonIntersection(p1, segment, null, false); - b = new d3_geo_clipPolygonIntersection(p1, null, a, true); - a.o = b; - subject.push(a); - clip.push(b); - }); - clip.sort(compare); - d3_geo_clipPolygonLinkCircular(subject); - d3_geo_clipPolygonLinkCircular(clip); - if (!subject.length) return; - for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) { - clip[i].e = entry = !entry; - } - var start = subject[0], points, point; - while (1) { - var current = start, isSubject = true; - while (current.v) if ((current = current.n) === start) return; - points = current.z; - listener.lineStart(); - do { - current.v = current.o.v = true; - if (current.e) { - if (isSubject) { - for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]); - } else { - interpolate(current.x, current.n.x, 1, listener); - } - current = current.n; - } else { - if (isSubject) { - points = current.p.z; - for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]); - } else { - interpolate(current.x, current.p.x, -1, listener); - } - current = current.p; - } - current = current.o; - points = current.z; - isSubject = !isSubject; - } while (!current.v); - listener.lineEnd(); - } - } - function d3_geo_clipPolygonLinkCircular(array) { - if (!(n = array.length)) return; - var n, i = 0, a = array[0], b; - while (++i < n) { - a.n = b = array[i]; - b.p = a; - a = b; - } - a.n = b = array[0]; - b.p = a; - } - function d3_geo_clipPolygonIntersection(point, points, other, entry) { - this.x = point; - this.z = points; - this.o = other; - this.e = entry; - this.v = false; - this.n = this.p = null; - } - function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) { - return function(rotate, listener) { - var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]); - var clip = { - point: point, - lineStart: lineStart, - lineEnd: lineEnd, - polygonStart: function() { - clip.point = pointRing; - clip.lineStart = ringStart; - clip.lineEnd = ringEnd; - segments = []; - polygon = []; - }, - polygonEnd: function() { - clip.point = point; - clip.lineStart = lineStart; - clip.lineEnd = lineEnd; - segments = d3.merge(segments); - var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon); - if (segments.length) { - if (!polygonStarted) listener.polygonStart(), polygonStarted = true; - d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener); - } else if (clipStartInside) { - if (!polygonStarted) listener.polygonStart(), polygonStarted = true; - listener.lineStart(); - interpolate(null, null, 1, listener); - listener.lineEnd(); - } - if (polygonStarted) listener.polygonEnd(), polygonStarted = false; - segments = polygon = null; - }, - sphere: function() { - listener.polygonStart(); - listener.lineStart(); - interpolate(null, null, 1, listener); - listener.lineEnd(); - listener.polygonEnd(); - } - }; - function point(λ, φ) { - var point = rotate(λ, φ); - if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ); - } - function pointLine(λ, φ) { - var point = rotate(λ, φ); - line.point(point[0], point[1]); - } - function lineStart() { - clip.point = pointLine; - line.lineStart(); - } - function lineEnd() { - clip.point = point; - line.lineEnd(); - } - var segments; - var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring; - function pointRing(λ, φ) { - ring.push([ λ, φ ]); - var point = rotate(λ, φ); - ringListener.point(point[0], point[1]); - } - function ringStart() { - ringListener.lineStart(); - ring = []; - } - function ringEnd() { - pointRing(ring[0][0], ring[0][1]); - ringListener.lineEnd(); - var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length; - ring.pop(); - polygon.push(ring); - ring = null; - if (!n) return; - if (clean & 1) { - segment = ringSegments[0]; - var n = segment.length - 1, i = -1, point; - if (n > 0) { - if (!polygonStarted) listener.polygonStart(), polygonStarted = true; - listener.lineStart(); - while (++i < n) listener.point((point = segment[i])[0], point[1]); - listener.lineEnd(); - } - return; - } - if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); - segments.push(ringSegments.filter(d3_geo_clipSegmentLength1)); - } - return clip; - }; - } - function d3_geo_clipSegmentLength1(segment) { - return segment.length > 1; - } - function d3_geo_clipBufferListener() { - var lines = [], line; - return { - lineStart: function() { - lines.push(line = []); - }, - point: function(λ, φ) { - line.push([ λ, φ ]); - }, - lineEnd: d3_noop, - buffer: function() { - var buffer = lines; - lines = []; - line = null; - return buffer; - }, - rejoin: function() { - if (lines.length > 1) lines.push(lines.pop().concat(lines.shift())); - } - }; - } - function d3_geo_clipSort(a, b) { - return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]); - } - var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]); - function d3_geo_clipAntimeridianLine(listener) { - var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean; - return { - lineStart: function() { - listener.lineStart(); - clean = 1; - }, - point: function(λ1, φ1) { - var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0); - if (abs(dλ - π) < ε) { - listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ); - listener.point(sλ0, φ0); - listener.lineEnd(); - listener.lineStart(); - listener.point(sλ1, φ0); - listener.point(λ1, φ0); - clean = 0; - } else if (sλ0 !== sλ1 && dλ >= π) { - if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε; - if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε; - φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1); - listener.point(sλ0, φ0); - listener.lineEnd(); - listener.lineStart(); - listener.point(sλ1, φ0); - clean = 0; - } - listener.point(λ0 = λ1, φ0 = φ1); - sλ0 = sλ1; - }, - lineEnd: function() { - listener.lineEnd(); - λ0 = φ0 = NaN; - }, - clean: function() { - return 2 - clean; - } - }; - } - function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) { - var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1); - return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2; - } - function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) { - var φ; - if (from == null) { - φ = direction * halfπ; - listener.point(-π, φ); - listener.point(0, φ); - listener.point(π, φ); - listener.point(π, 0); - listener.point(π, -φ); - listener.point(0, -φ); - listener.point(-π, -φ); - listener.point(-π, 0); - listener.point(-π, φ); - } else if (abs(from[0] - to[0]) > ε) { - var s = from[0] < to[0] ? π : -π; - φ = direction * s / 2; - listener.point(-s, φ); - listener.point(0, φ); - listener.point(s, φ); - } else { - listener.point(to[0], to[1]); - } - } - function d3_geo_pointInPolygon(point, polygon) { - var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0; - d3_geo_areaRingSum.reset(); - for (var i = 0, n = polygon.length; i < n; ++i) { - var ring = polygon[i], m = ring.length; - if (!m) continue; - var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1; - while (true) { - if (j === m) j = 0; - point = ring[j]; - var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ; - d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ))); - polarAngle += antimeridian ? dλ + sdλ * τ : dλ; - if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) { - var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point)); - d3_geo_cartesianNormalize(arc); - var intersection = d3_geo_cartesianCross(meridianNormal, arc); - d3_geo_cartesianNormalize(intersection); - var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]); - if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) { - winding += antimeridian ^ dλ >= 0 ? 1 : -1; - } - } - if (!j++) break; - λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point; - } - } - return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < -ε) ^ winding & 1; - } - function d3_geo_clipCircle(radius) { - var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians); - return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]); - function visible(λ, φ) { - return Math.cos(λ) * Math.cos(φ) > cr; - } - function clipLine(listener) { - var point0, c0, v0, v00, clean; - return { - lineStart: function() { - v00 = v0 = false; - clean = 1; - }, - point: function(λ, φ) { - var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0; - if (!point0 && (v00 = v0 = v)) listener.lineStart(); - if (v !== v0) { - point2 = intersect(point0, point1); - if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) { - point1[0] += ε; - point1[1] += ε; - v = visible(point1[0], point1[1]); - } - } - if (v !== v0) { - clean = 0; - if (v) { - listener.lineStart(); - point2 = intersect(point1, point0); - listener.point(point2[0], point2[1]); - } else { - point2 = intersect(point0, point1); - listener.point(point2[0], point2[1]); - listener.lineEnd(); - } - point0 = point2; - } else if (notHemisphere && point0 && smallRadius ^ v) { - var t; - if (!(c & c0) && (t = intersect(point1, point0, true))) { - clean = 0; - if (smallRadius) { - listener.lineStart(); - listener.point(t[0][0], t[0][1]); - listener.point(t[1][0], t[1][1]); - listener.lineEnd(); - } else { - listener.point(t[1][0], t[1][1]); - listener.lineEnd(); - listener.lineStart(); - listener.point(t[0][0], t[0][1]); - } - } - } - if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) { - listener.point(point1[0], point1[1]); - } - point0 = point1, v0 = v, c0 = c; - }, - lineEnd: function() { - if (v0) listener.lineEnd(); - point0 = null; - }, - clean: function() { - return clean | (v00 && v0) << 1; - } - }; - } - function intersect(a, b, two) { - var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b); - var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2; - if (!determinant) return !two && a; - var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2); - d3_geo_cartesianAdd(A, B); - var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1); - if (t2 < 0) return; - var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu); - d3_geo_cartesianAdd(q, A); - q = d3_geo_spherical(q); - if (!two) return q; - var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z; - if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z; - var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε; - if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z; - if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) { - var q1 = d3_geo_cartesianScale(u, (-w + t) / uu); - d3_geo_cartesianAdd(q1, A); - return [ q, d3_geo_spherical(q1) ]; - } - } - function code(λ, φ) { - var r = smallRadius ? radius : π - radius, code = 0; - if (λ < -r) code |= 1; else if (λ > r) code |= 2; - if (φ < -r) code |= 4; else if (φ > r) code |= 8; - return code; - } - } - function d3_geom_clipLine(x0, y0, x1, y1) { - return function(line) { - var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r; - r = x0 - ax; - if (!dx && r > 0) return; - r /= dx; - if (dx < 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } else if (dx > 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } - r = x1 - ax; - if (!dx && r < 0) return; - r /= dx; - if (dx < 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } else if (dx > 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } - r = y0 - ay; - if (!dy && r > 0) return; - r /= dy; - if (dy < 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } else if (dy > 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } - r = y1 - ay; - if (!dy && r < 0) return; - r /= dy; - if (dy < 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } else if (dy > 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } - if (t0 > 0) line.a = { - x: ax + t0 * dx, - y: ay + t0 * dy - }; - if (t1 < 1) line.b = { - x: ax + t1 * dx, - y: ay + t1 * dy - }; - return line; - }; - } - var d3_geo_clipExtentMAX = 1e9; - d3.geo.clipExtent = function() { - var x0, y0, x1, y1, stream, clip, clipExtent = { - stream: function(output) { - if (stream) stream.valid = false; - stream = clip(output); - stream.valid = true; - return stream; - }, - extent: function(_) { - if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; - clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]); - if (stream) stream.valid = false, stream = null; - return clipExtent; - } - }; - return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]); - }; - function d3_geo_clipExtent(x0, y0, x1, y1) { - return function(listener) { - var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring; - var clip = { - point: point, - lineStart: lineStart, - lineEnd: lineEnd, - polygonStart: function() { - listener = bufferListener; - segments = []; - polygon = []; - clean = true; - }, - polygonEnd: function() { - listener = listener_; - segments = d3.merge(segments); - var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length; - if (inside || visible) { - listener.polygonStart(); - if (inside) { - listener.lineStart(); - interpolate(null, null, 1, listener); - listener.lineEnd(); - } - if (visible) { - d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener); - } - listener.polygonEnd(); - } - segments = polygon = ring = null; - } - }; - function insidePolygon(p) { - var wn = 0, n = polygon.length, y = p[1]; - for (var i = 0; i < n; ++i) { - for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) { - b = v[j]; - if (a[1] <= y) { - if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn; - } else { - if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn; - } - a = b; - } - } - return wn !== 0; - } - function interpolate(from, to, direction, listener) { - var a = 0, a1 = 0; - if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) { - do { - listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0); - } while ((a = (a + direction + 4) % 4) !== a1); - } else { - listener.point(to[0], to[1]); - } - } - function pointVisible(x, y) { - return x0 <= x && x <= x1 && y0 <= y && y <= y1; - } - function point(x, y) { - if (pointVisible(x, y)) listener.point(x, y); - } - var x__, y__, v__, x_, y_, v_, first, clean; - function lineStart() { - clip.point = linePoint; - if (polygon) polygon.push(ring = []); - first = true; - v_ = false; - x_ = y_ = NaN; - } - function lineEnd() { - if (segments) { - linePoint(x__, y__); - if (v__ && v_) bufferListener.rejoin(); - segments.push(bufferListener.buffer()); - } - clip.point = point; - if (v_) listener.lineEnd(); - } - function linePoint(x, y) { - x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x)); - y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y)); - var v = pointVisible(x, y); - if (polygon) ring.push([ x, y ]); - if (first) { - x__ = x, y__ = y, v__ = v; - first = false; - if (v) { - listener.lineStart(); - listener.point(x, y); - } - } else { - if (v && v_) listener.point(x, y); else { - var l = { - a: { - x: x_, - y: y_ - }, - b: { - x: x, - y: y - } - }; - if (clipLine(l)) { - if (!v_) { - listener.lineStart(); - listener.point(l.a.x, l.a.y); - } - listener.point(l.b.x, l.b.y); - if (!v) listener.lineEnd(); - clean = false; - } else if (v) { - listener.lineStart(); - listener.point(x, y); - clean = false; - } - } - } - x_ = x, y_ = y, v_ = v; - } - return clip; - }; - function corner(p, direction) { - return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2; - } - function compare(a, b) { - return comparePoints(a.x, b.x); - } - function comparePoints(a, b) { - var ca = corner(a, 1), cb = corner(b, 1); - return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0]; - } - } - function d3_geo_conic(projectAt) { - var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1); - p.parallels = function(_) { - if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ]; - return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180); - }; - return p; - } - function d3_geo_conicEqualArea(φ0, φ1) { - var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n; - function forward(λ, φ) { - var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n; - return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ]; - } - forward.invert = function(x, y) { - var ρ0_y = ρ0 - y; - return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ]; - }; - return forward; - } - (d3.geo.conicEqualArea = function() { - return d3_geo_conic(d3_geo_conicEqualArea); - }).raw = d3_geo_conicEqualArea; - d3.geo.albers = function() { - return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070); - }; - d3.geo.albersUsa = function() { - var lower48 = d3.geo.albers(); - var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]); - var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]); - var point, pointStream = { - point: function(x, y) { - point = [ x, y ]; - } - }, lower48Point, alaskaPoint, hawaiiPoint; - function albersUsa(coordinates) { - var x = coordinates[0], y = coordinates[1]; - point = null; - (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y); - return point; - } - albersUsa.invert = function(coordinates) { - var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k; - return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates); - }; - albersUsa.stream = function(stream) { - var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream); - return { - point: function(x, y) { - lower48Stream.point(x, y); - alaskaStream.point(x, y); - hawaiiStream.point(x, y); - }, - sphere: function() { - lower48Stream.sphere(); - alaskaStream.sphere(); - hawaiiStream.sphere(); - }, - lineStart: function() { - lower48Stream.lineStart(); - alaskaStream.lineStart(); - hawaiiStream.lineStart(); - }, - lineEnd: function() { - lower48Stream.lineEnd(); - alaskaStream.lineEnd(); - hawaiiStream.lineEnd(); - }, - polygonStart: function() { - lower48Stream.polygonStart(); - alaskaStream.polygonStart(); - hawaiiStream.polygonStart(); - }, - polygonEnd: function() { - lower48Stream.polygonEnd(); - alaskaStream.polygonEnd(); - hawaiiStream.polygonEnd(); - } - }; - }; - albersUsa.precision = function(_) { - if (!arguments.length) return lower48.precision(); - lower48.precision(_); - alaska.precision(_); - hawaii.precision(_); - return albersUsa; - }; - albersUsa.scale = function(_) { - if (!arguments.length) return lower48.scale(); - lower48.scale(_); - alaska.scale(_ * .35); - hawaii.scale(_); - return albersUsa.translate(lower48.translate()); - }; - albersUsa.translate = function(_) { - if (!arguments.length) return lower48.translate(); - var k = lower48.scale(), x = +_[0], y = +_[1]; - lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point; - alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; - hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; - return albersUsa; - }; - return albersUsa.scale(1070); - }; - var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = { - point: d3_noop, - lineStart: d3_noop, - lineEnd: d3_noop, - polygonStart: function() { - d3_geo_pathAreaPolygon = 0; - d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart; - }, - polygonEnd: function() { - d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop; - d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2); - } - }; - function d3_geo_pathAreaRingStart() { - var x00, y00, x0, y0; - d3_geo_pathArea.point = function(x, y) { - d3_geo_pathArea.point = nextPoint; - x00 = x0 = x, y00 = y0 = y; - }; - function nextPoint(x, y) { - d3_geo_pathAreaPolygon += y0 * x - x0 * y; - x0 = x, y0 = y; - } - d3_geo_pathArea.lineEnd = function() { - nextPoint(x00, y00); - }; - } - var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1; - var d3_geo_pathBounds = { - point: d3_geo_pathBoundsPoint, - lineStart: d3_noop, - lineEnd: d3_noop, - polygonStart: d3_noop, - polygonEnd: d3_noop - }; - function d3_geo_pathBoundsPoint(x, y) { - if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x; - if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x; - if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y; - if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y; - } - function d3_geo_pathBuffer() { - var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = []; - var stream = { - point: point, - lineStart: function() { - stream.point = pointLineStart; - }, - lineEnd: lineEnd, - polygonStart: function() { - stream.lineEnd = lineEndPolygon; - }, - polygonEnd: function() { - stream.lineEnd = lineEnd; - stream.point = point; - }, - pointRadius: function(_) { - pointCircle = d3_geo_pathBufferCircle(_); - return stream; - }, - result: function() { - if (buffer.length) { - var result = buffer.join(""); - buffer = []; - return result; - } - } - }; - function point(x, y) { - buffer.push("M", x, ",", y, pointCircle); - } - function pointLineStart(x, y) { - buffer.push("M", x, ",", y); - stream.point = pointLine; - } - function pointLine(x, y) { - buffer.push("L", x, ",", y); - } - function lineEnd() { - stream.point = point; - } - function lineEndPolygon() { - buffer.push("Z"); - } - return stream; - } - function d3_geo_pathBufferCircle(radius) { - return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z"; - } - var d3_geo_pathCentroid = { - point: d3_geo_pathCentroidPoint, - lineStart: d3_geo_pathCentroidLineStart, - lineEnd: d3_geo_pathCentroidLineEnd, - polygonStart: function() { - d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart; - }, - polygonEnd: function() { - d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; - d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart; - d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd; - } - }; - function d3_geo_pathCentroidPoint(x, y) { - d3_geo_centroidX0 += x; - d3_geo_centroidY0 += y; - ++d3_geo_centroidZ0; - } - function d3_geo_pathCentroidLineStart() { - var x0, y0; - d3_geo_pathCentroid.point = function(x, y) { - d3_geo_pathCentroid.point = nextPoint; - d3_geo_pathCentroidPoint(x0 = x, y0 = y); - }; - function nextPoint(x, y) { - var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); - d3_geo_centroidX1 += z * (x0 + x) / 2; - d3_geo_centroidY1 += z * (y0 + y) / 2; - d3_geo_centroidZ1 += z; - d3_geo_pathCentroidPoint(x0 = x, y0 = y); - } - } - function d3_geo_pathCentroidLineEnd() { - d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; - } - function d3_geo_pathCentroidRingStart() { - var x00, y00, x0, y0; - d3_geo_pathCentroid.point = function(x, y) { - d3_geo_pathCentroid.point = nextPoint; - d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y); - }; - function nextPoint(x, y) { - var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); - d3_geo_centroidX1 += z * (x0 + x) / 2; - d3_geo_centroidY1 += z * (y0 + y) / 2; - d3_geo_centroidZ1 += z; - z = y0 * x - x0 * y; - d3_geo_centroidX2 += z * (x0 + x); - d3_geo_centroidY2 += z * (y0 + y); - d3_geo_centroidZ2 += z * 3; - d3_geo_pathCentroidPoint(x0 = x, y0 = y); - } - d3_geo_pathCentroid.lineEnd = function() { - nextPoint(x00, y00); - }; - } - function d3_geo_pathContext(context) { - var pointRadius = 4.5; - var stream = { - point: point, - lineStart: function() { - stream.point = pointLineStart; - }, - lineEnd: lineEnd, - polygonStart: function() { - stream.lineEnd = lineEndPolygon; - }, - polygonEnd: function() { - stream.lineEnd = lineEnd; - stream.point = point; - }, - pointRadius: function(_) { - pointRadius = _; - return stream; - }, - result: d3_noop - }; - function point(x, y) { - context.moveTo(x + pointRadius, y); - context.arc(x, y, pointRadius, 0, τ); - } - function pointLineStart(x, y) { - context.moveTo(x, y); - stream.point = pointLine; - } - function pointLine(x, y) { - context.lineTo(x, y); - } - function lineEnd() { - stream.point = point; - } - function lineEndPolygon() { - context.closePath(); - } - return stream; - } - function d3_geo_resample(project) { - var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16; - function resample(stream) { - return (maxDepth ? resampleRecursive : resampleNone)(stream); - } - function resampleNone(stream) { - return d3_geo_transformPoint(stream, function(x, y) { - x = project(x, y); - stream.point(x[0], x[1]); - }); - } - function resampleRecursive(stream) { - var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0; - var resample = { - point: point, - lineStart: lineStart, - lineEnd: lineEnd, - polygonStart: function() { - stream.polygonStart(); - resample.lineStart = ringStart; - }, - polygonEnd: function() { - stream.polygonEnd(); - resample.lineStart = lineStart; - } - }; - function point(x, y) { - x = project(x, y); - stream.point(x[0], x[1]); - } - function lineStart() { - x0 = NaN; - resample.point = linePoint; - stream.lineStart(); - } - function linePoint(λ, φ) { - var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ); - resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream); - stream.point(x0, y0); - } - function lineEnd() { - resample.point = point; - stream.lineEnd(); - } - function ringStart() { - lineStart(); - resample.point = ringPoint; - resample.lineEnd = ringEnd; - } - function ringPoint(λ, φ) { - linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0; - resample.point = linePoint; - } - function ringEnd() { - resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream); - resample.lineEnd = lineEnd; - lineEnd(); - } - return resample; - } - function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) { - var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy; - if (d2 > 4 * δ2 && depth--) { - var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2; - if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { - resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream); - stream.point(x2, y2); - resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream); - } - } - } - resample.precision = function(_) { - if (!arguments.length) return Math.sqrt(δ2); - maxDepth = (δ2 = _ * _) > 0 && 16; - return resample; - }; - return resample; - } - d3.geo.path = function() { - var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream; - function path(object) { - if (object) { - if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments)); - if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream); - d3.geo.stream(object, cacheStream); - } - return contextStream.result(); - } - path.area = function(object) { - d3_geo_pathAreaSum = 0; - d3.geo.stream(object, projectStream(d3_geo_pathArea)); - return d3_geo_pathAreaSum; - }; - path.centroid = function(object) { - d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; - d3.geo.stream(object, projectStream(d3_geo_pathCentroid)); - return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ]; - }; - path.bounds = function(object) { - d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity); - d3.geo.stream(object, projectStream(d3_geo_pathBounds)); - return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ]; - }; - path.projection = function(_) { - if (!arguments.length) return projection; - projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity; - return reset(); - }; - path.context = function(_) { - if (!arguments.length) return context; - contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_); - if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius); - return reset(); - }; - path.pointRadius = function(_) { - if (!arguments.length) return pointRadius; - pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_); - return path; - }; - function reset() { - cacheStream = null; - return path; - } - return path.projection(d3.geo.albersUsa()).context(null); - }; - function d3_geo_pathProjectStream(project) { - var resample = d3_geo_resample(function(x, y) { - return project([ x * d3_degrees, y * d3_degrees ]); - }); - return function(stream) { - return d3_geo_projectionRadians(resample(stream)); - }; - } - d3.geo.transform = function(methods) { - return { - stream: function(stream) { - var transform = new d3_geo_transform(stream); - for (var k in methods) transform[k] = methods[k]; - return transform; - } - }; - }; - function d3_geo_transform(stream) { - this.stream = stream; - } - d3_geo_transform.prototype = { - point: function(x, y) { - this.stream.point(x, y); - }, - sphere: function() { - this.stream.sphere(); - }, - lineStart: function() { - this.stream.lineStart(); - }, - lineEnd: function() { - this.stream.lineEnd(); - }, - polygonStart: function() { - this.stream.polygonStart(); - }, - polygonEnd: function() { - this.stream.polygonEnd(); - } - }; - function d3_geo_transformPoint(stream, point) { - return { - point: point, - sphere: function() { - stream.sphere(); - }, - lineStart: function() { - stream.lineStart(); - }, - lineEnd: function() { - stream.lineEnd(); - }, - polygonStart: function() { - stream.polygonStart(); - }, - polygonEnd: function() { - stream.polygonEnd(); - } - }; - } - d3.geo.projection = d3_geo_projection; - d3.geo.projectionMutator = d3_geo_projectionMutator; - function d3_geo_projection(project) { - return d3_geo_projectionMutator(function() { - return project; - })(); - } - function d3_geo_projectionMutator(projectAt) { - var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) { - x = project(x, y); - return [ x[0] * k + δx, δy - x[1] * k ]; - }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream; - function projection(point) { - point = projectRotate(point[0] * d3_radians, point[1] * d3_radians); - return [ point[0] * k + δx, δy - point[1] * k ]; - } - function invert(point) { - point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k); - return point && [ point[0] * d3_degrees, point[1] * d3_degrees ]; - } - projection.stream = function(output) { - if (stream) stream.valid = false; - stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output)))); - stream.valid = true; - return stream; - }; - projection.clipAngle = function(_) { - if (!arguments.length) return clipAngle; - preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians); - return invalidate(); - }; - projection.clipExtent = function(_) { - if (!arguments.length) return clipExtent; - clipExtent = _; - postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity; - return invalidate(); - }; - projection.scale = function(_) { - if (!arguments.length) return k; - k = +_; - return reset(); - }; - projection.translate = function(_) { - if (!arguments.length) return [ x, y ]; - x = +_[0]; - y = +_[1]; - return reset(); - }; - projection.center = function(_) { - if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ]; - λ = _[0] % 360 * d3_radians; - φ = _[1] % 360 * d3_radians; - return reset(); - }; - projection.rotate = function(_) { - if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ]; - δλ = _[0] % 360 * d3_radians; - δφ = _[1] % 360 * d3_radians; - δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0; - return reset(); - }; - d3.rebind(projection, projectResample, "precision"); - function reset() { - projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project); - var center = project(λ, φ); - δx = x - center[0] * k; - δy = y + center[1] * k; - return invalidate(); - } - function invalidate() { - if (stream) stream.valid = false, stream = null; - return projection; - } - return function() { - project = projectAt.apply(this, arguments); - projection.invert = project.invert && invert; - return reset(); - }; - } - function d3_geo_projectionRadians(stream) { - return d3_geo_transformPoint(stream, function(x, y) { - stream.point(x * d3_radians, y * d3_radians); - }); - } - function d3_geo_equirectangular(λ, φ) { - return [ λ, φ ]; - } - (d3.geo.equirectangular = function() { - return d3_geo_projection(d3_geo_equirectangular); - }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular; - d3.geo.rotation = function(rotate) { - rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0); - function forward(coordinates) { - coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians); - return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; - } - forward.invert = function(coordinates) { - coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians); - return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; - }; - return forward; - }; - function d3_geo_identityRotation(λ, φ) { - return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ]; - } - d3_geo_identityRotation.invert = d3_geo_equirectangular; - function d3_geo_rotation(δλ, δφ, δγ) { - return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation; - } - function d3_geo_forwardRotationλ(δλ) { - return function(λ, φ) { - return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ]; - }; - } - function d3_geo_rotationλ(δλ) { - var rotation = d3_geo_forwardRotationλ(δλ); - rotation.invert = d3_geo_forwardRotationλ(-δλ); - return rotation; - } - function d3_geo_rotationφγ(δφ, δγ) { - var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ); - function rotation(λ, φ) { - var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ; - return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ]; - } - rotation.invert = function(λ, φ) { - var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ; - return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ]; - }; - return rotation; - } - d3.geo.circle = function() { - var origin = [ 0, 0 ], angle, precision = 6, interpolate; - function circle() { - var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = []; - interpolate(null, null, 1, { - point: function(x, y) { - ring.push(x = rotate(x, y)); - x[0] *= d3_degrees, x[1] *= d3_degrees; - } - }); - return { - type: "Polygon", - coordinates: [ ring ] - }; - } - circle.origin = function(x) { - if (!arguments.length) return origin; - origin = x; - return circle; - }; - circle.angle = function(x) { - if (!arguments.length) return angle; - interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians); - return circle; - }; - circle.precision = function(_) { - if (!arguments.length) return precision; - interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians); - return circle; - }; - return circle.angle(90); - }; - function d3_geo_circleInterpolate(radius, precision) { - var cr = Math.cos(radius), sr = Math.sin(radius); - return function(from, to, direction, listener) { - var step = direction * precision; - if (from != null) { - from = d3_geo_circleAngle(cr, from); - to = d3_geo_circleAngle(cr, to); - if (direction > 0 ? from < to : from > to) from += direction * τ; - } else { - from = radius + direction * τ; - to = radius - .5 * step; - } - for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) { - listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]); - } - }; - } - function d3_geo_circleAngle(cr, point) { - var a = d3_geo_cartesian(point); - a[0] -= cr; - d3_geo_cartesianNormalize(a); - var angle = d3_acos(-a[1]); - return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI); - } - d3.geo.distance = function(a, b) { - var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t; - return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ); - }; - d3.geo.graticule = function() { - var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5; - function graticule() { - return { - type: "MultiLineString", - coordinates: lines() - }; - } - function lines() { - return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) { - return abs(x % DX) > ε; - }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) { - return abs(y % DY) > ε; - }).map(y)); - } - graticule.lines = function() { - return lines().map(function(coordinates) { - return { - type: "LineString", - coordinates: coordinates - }; - }); - }; - graticule.outline = function() { - return { - type: "Polygon", - coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ] - }; - }; - graticule.extent = function(_) { - if (!arguments.length) return graticule.minorExtent(); - return graticule.majorExtent(_).minorExtent(_); - }; - graticule.majorExtent = function(_) { - if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ]; - X0 = +_[0][0], X1 = +_[1][0]; - Y0 = +_[0][1], Y1 = +_[1][1]; - if (X0 > X1) _ = X0, X0 = X1, X1 = _; - if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _; - return graticule.precision(precision); - }; - graticule.minorExtent = function(_) { - if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; - x0 = +_[0][0], x1 = +_[1][0]; - y0 = +_[0][1], y1 = +_[1][1]; - if (x0 > x1) _ = x0, x0 = x1, x1 = _; - if (y0 > y1) _ = y0, y0 = y1, y1 = _; - return graticule.precision(precision); - }; - graticule.step = function(_) { - if (!arguments.length) return graticule.minorStep(); - return graticule.majorStep(_).minorStep(_); - }; - graticule.majorStep = function(_) { - if (!arguments.length) return [ DX, DY ]; - DX = +_[0], DY = +_[1]; - return graticule; - }; - graticule.minorStep = function(_) { - if (!arguments.length) return [ dx, dy ]; - dx = +_[0], dy = +_[1]; - return graticule; - }; - graticule.precision = function(_) { - if (!arguments.length) return precision; - precision = +_; - x = d3_geo_graticuleX(y0, y1, 90); - y = d3_geo_graticuleY(x0, x1, precision); - X = d3_geo_graticuleX(Y0, Y1, 90); - Y = d3_geo_graticuleY(X0, X1, precision); - return graticule; - }; - return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]); - }; - function d3_geo_graticuleX(y0, y1, dy) { - var y = d3.range(y0, y1 - ε, dy).concat(y1); - return function(x) { - return y.map(function(y) { - return [ x, y ]; - }); - }; - } - function d3_geo_graticuleY(x0, x1, dx) { - var x = d3.range(x0, x1 - ε, dx).concat(x1); - return function(y) { - return x.map(function(x) { - return [ x, y ]; - }); - }; - } - function d3_source(d) { - return d.source; - } - function d3_target(d) { - return d.target; - } - d3.geo.greatArc = function() { - var source = d3_source, source_, target = d3_target, target_; - function greatArc() { - return { - type: "LineString", - coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ] - }; - } - greatArc.distance = function() { - return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments)); - }; - greatArc.source = function(_) { - if (!arguments.length) return source; - source = _, source_ = typeof _ === "function" ? null : _; - return greatArc; - }; - greatArc.target = function(_) { - if (!arguments.length) return target; - target = _, target_ = typeof _ === "function" ? null : _; - return greatArc; - }; - greatArc.precision = function() { - return arguments.length ? greatArc : 0; - }; - return greatArc; - }; - d3.geo.interpolate = function(source, target) { - return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians); - }; - function d3_geo_interpolate(x0, y0, x1, y1) { - var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d); - var interpolate = d ? function(t) { - var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1; - return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ]; - } : function() { - return [ x0 * d3_degrees, y0 * d3_degrees ]; - }; - interpolate.distance = d; - return interpolate; - } - d3.geo.length = function(object) { - d3_geo_lengthSum = 0; - d3.geo.stream(object, d3_geo_length); - return d3_geo_lengthSum; - }; - var d3_geo_lengthSum; - var d3_geo_length = { - sphere: d3_noop, - point: d3_noop, - lineStart: d3_geo_lengthLineStart, - lineEnd: d3_noop, - polygonStart: d3_noop, - polygonEnd: d3_noop - }; - function d3_geo_lengthLineStart() { - var λ0, sinφ0, cosφ0; - d3_geo_length.point = function(λ, φ) { - λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ); - d3_geo_length.point = nextPoint; - }; - d3_geo_length.lineEnd = function() { - d3_geo_length.point = d3_geo_length.lineEnd = d3_noop; - }; - function nextPoint(λ, φ) { - var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t); - d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ); - λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ; - } - } - function d3_geo_azimuthal(scale, angle) { - function azimuthal(λ, φ) { - var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ); - return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ]; - } - azimuthal.invert = function(x, y) { - var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c); - return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ]; - }; - return azimuthal; - } - var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) { - return Math.sqrt(2 / (1 + cosλcosφ)); - }, function(ρ) { - return 2 * Math.asin(ρ / 2); - }); - (d3.geo.azimuthalEqualArea = function() { - return d3_geo_projection(d3_geo_azimuthalEqualArea); - }).raw = d3_geo_azimuthalEqualArea; - var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) { - var c = Math.acos(cosλcosφ); - return c && c / Math.sin(c); - }, d3_identity); - (d3.geo.azimuthalEquidistant = function() { - return d3_geo_projection(d3_geo_azimuthalEquidistant); - }).raw = d3_geo_azimuthalEquidistant; - function d3_geo_conicConformal(φ0, φ1) { - var cosφ0 = Math.cos(φ0), t = function(φ) { - return Math.tan(π / 4 + φ / 2); - }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n; - if (!n) return d3_geo_mercator; - function forward(λ, φ) { - if (F > 0) { - if (φ < -halfπ + ε) φ = -halfπ + ε; - } else { - if (φ > halfπ - ε) φ = halfπ - ε; - } - var ρ = F / Math.pow(t(φ), n); - return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ]; - } - forward.invert = function(x, y) { - var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y); - return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ]; - }; - return forward; - } - (d3.geo.conicConformal = function() { - return d3_geo_conic(d3_geo_conicConformal); - }).raw = d3_geo_conicConformal; - function d3_geo_conicEquidistant(φ0, φ1) { - var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0; - if (abs(n) < ε) return d3_geo_equirectangular; - function forward(λ, φ) { - var ρ = G - φ; - return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ]; - } - forward.invert = function(x, y) { - var ρ0_y = G - y; - return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ]; - }; - return forward; - } - (d3.geo.conicEquidistant = function() { - return d3_geo_conic(d3_geo_conicEquidistant); - }).raw = d3_geo_conicEquidistant; - var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) { - return 1 / cosλcosφ; - }, Math.atan); - (d3.geo.gnomonic = function() { - return d3_geo_projection(d3_geo_gnomonic); - }).raw = d3_geo_gnomonic; - function d3_geo_mercator(λ, φ) { - return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ]; - } - d3_geo_mercator.invert = function(x, y) { - return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ]; - }; - function d3_geo_mercatorProjection(project) { - var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto; - m.scale = function() { - var v = scale.apply(m, arguments); - return v === m ? clipAuto ? m.clipExtent(null) : m : v; - }; - m.translate = function() { - var v = translate.apply(m, arguments); - return v === m ? clipAuto ? m.clipExtent(null) : m : v; - }; - m.clipExtent = function(_) { - var v = clipExtent.apply(m, arguments); - if (v === m) { - if (clipAuto = _ == null) { - var k = π * scale(), t = translate(); - clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]); - } - } else if (clipAuto) { - v = null; - } - return v; - }; - return m.clipExtent(null); - } - (d3.geo.mercator = function() { - return d3_geo_mercatorProjection(d3_geo_mercator); - }).raw = d3_geo_mercator; - var d3_geo_orthographic = d3_geo_azimuthal(function() { - return 1; - }, Math.asin); - (d3.geo.orthographic = function() { - return d3_geo_projection(d3_geo_orthographic); - }).raw = d3_geo_orthographic; - var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) { - return 1 / (1 + cosλcosφ); - }, function(ρ) { - return 2 * Math.atan(ρ); - }); - (d3.geo.stereographic = function() { - return d3_geo_projection(d3_geo_stereographic); - }).raw = d3_geo_stereographic; - function d3_geo_transverseMercator(λ, φ) { - return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ]; - } - d3_geo_transverseMercator.invert = function(x, y) { - return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ]; - }; - (d3.geo.transverseMercator = function() { - var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate; - projection.center = function(_) { - return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]); - }; - projection.rotate = function(_) { - return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), - [ _[0], _[1], _[2] - 90 ]); - }; - return rotate([ 0, 0, 90 ]); - }).raw = d3_geo_transverseMercator; - d3.geom = {}; - function d3_geom_pointX(d) { - return d[0]; - } - function d3_geom_pointY(d) { - return d[1]; - } - d3.geom.hull = function(vertices) { - var x = d3_geom_pointX, y = d3_geom_pointY; - if (arguments.length) return hull(vertices); - function hull(data) { - if (data.length < 3) return []; - var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = []; - for (i = 0; i < n; i++) { - points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]); - } - points.sort(d3_geom_hullOrder); - for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]); - var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints); - var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = []; - for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]); - for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]); - return polygon; - } - hull.x = function(_) { - return arguments.length ? (x = _, hull) : x; - }; - hull.y = function(_) { - return arguments.length ? (y = _, hull) : y; - }; - return hull; - }; - function d3_geom_hullUpper(points) { - var n = points.length, hull = [ 0, 1 ], hs = 2; - for (var i = 2; i < n; i++) { - while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs; - hull[hs++] = i; - } - return hull.slice(0, hs); - } - function d3_geom_hullOrder(a, b) { - return a[0] - b[0] || a[1] - b[1]; - } - d3.geom.polygon = function(coordinates) { - d3_subclass(coordinates, d3_geom_polygonPrototype); - return coordinates; - }; - var d3_geom_polygonPrototype = d3.geom.polygon.prototype = []; - d3_geom_polygonPrototype.area = function() { - var i = -1, n = this.length, a, b = this[n - 1], area = 0; - while (++i < n) { - a = b; - b = this[i]; - area += a[1] * b[0] - a[0] * b[1]; - } - return area * .5; - }; - d3_geom_polygonPrototype.centroid = function(k) { - var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c; - if (!arguments.length) k = -1 / (6 * this.area()); - while (++i < n) { - a = b; - b = this[i]; - c = a[0] * b[1] - b[0] * a[1]; - x += (a[0] + b[0]) * c; - y += (a[1] + b[1]) * c; - } - return [ x * k, y * k ]; - }; - d3_geom_polygonPrototype.clip = function(subject) { - var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d; - while (++i < n) { - input = subject.slice(); - subject.length = 0; - b = this[i]; - c = input[(m = input.length - closed) - 1]; - j = -1; - while (++j < m) { - d = input[j]; - if (d3_geom_polygonInside(d, a, b)) { - if (!d3_geom_polygonInside(c, a, b)) { - subject.push(d3_geom_polygonIntersect(c, d, a, b)); - } - subject.push(d); - } else if (d3_geom_polygonInside(c, a, b)) { - subject.push(d3_geom_polygonIntersect(c, d, a, b)); - } - c = d; - } - if (closed) subject.push(subject[0]); - a = b; - } - return subject; - }; - function d3_geom_polygonInside(p, a, b) { - return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]); - } - function d3_geom_polygonIntersect(c, d, a, b) { - var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21); - return [ x1 + ua * x21, y1 + ua * y21 ]; - } - function d3_geom_polygonClosed(coordinates) { - var a = coordinates[0], b = coordinates[coordinates.length - 1]; - return !(a[0] - b[0] || a[1] - b[1]); - } - var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = []; - function d3_geom_voronoiBeach() { - d3_geom_voronoiRedBlackNode(this); - this.edge = this.site = this.circle = null; - } - function d3_geom_voronoiCreateBeach(site) { - var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach(); - beach.site = site; - return beach; - } - function d3_geom_voronoiDetachBeach(beach) { - d3_geom_voronoiDetachCircle(beach); - d3_geom_voronoiBeaches.remove(beach); - d3_geom_voronoiBeachPool.push(beach); - d3_geom_voronoiRedBlackNode(beach); - } - function d3_geom_voronoiRemoveBeach(beach) { - var circle = beach.circle, x = circle.x, y = circle.cy, vertex = { - x: x, - y: y - }, previous = beach.P, next = beach.N, disappearing = [ beach ]; - d3_geom_voronoiDetachBeach(beach); - var lArc = previous; - while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) { - previous = lArc.P; - disappearing.unshift(lArc); - d3_geom_voronoiDetachBeach(lArc); - lArc = previous; - } - disappearing.unshift(lArc); - d3_geom_voronoiDetachCircle(lArc); - var rArc = next; - while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) { - next = rArc.N; - disappearing.push(rArc); - d3_geom_voronoiDetachBeach(rArc); - rArc = next; - } - disappearing.push(rArc); - d3_geom_voronoiDetachCircle(rArc); - var nArcs = disappearing.length, iArc; - for (iArc = 1; iArc < nArcs; ++iArc) { - rArc = disappearing[iArc]; - lArc = disappearing[iArc - 1]; - d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex); - } - lArc = disappearing[0]; - rArc = disappearing[nArcs - 1]; - rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex); - d3_geom_voronoiAttachCircle(lArc); - d3_geom_voronoiAttachCircle(rArc); - } - function d3_geom_voronoiAddBeach(site) { - var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._; - while (node) { - dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x; - if (dxl > ε) node = node.L; else { - dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix); - if (dxr > ε) { - if (!node.R) { - lArc = node; - break; - } - node = node.R; - } else { - if (dxl > -ε) { - lArc = node.P; - rArc = node; - } else if (dxr > -ε) { - lArc = node; - rArc = node.N; - } else { - lArc = rArc = node; - } - break; - } - } - } - var newArc = d3_geom_voronoiCreateBeach(site); - d3_geom_voronoiBeaches.insert(lArc, newArc); - if (!lArc && !rArc) return; - if (lArc === rArc) { - d3_geom_voronoiDetachCircle(lArc); - rArc = d3_geom_voronoiCreateBeach(lArc.site); - d3_geom_voronoiBeaches.insert(newArc, rArc); - newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site); - d3_geom_voronoiAttachCircle(lArc); - d3_geom_voronoiAttachCircle(rArc); - return; - } - if (!rArc) { - newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site); - return; - } - d3_geom_voronoiDetachCircle(lArc); - d3_geom_voronoiDetachCircle(rArc); - var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = { - x: (cy * hb - by * hc) / d + ax, - y: (bx * hc - cx * hb) / d + ay - }; - d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex); - newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex); - rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex); - d3_geom_voronoiAttachCircle(lArc); - d3_geom_voronoiAttachCircle(rArc); - } - function d3_geom_voronoiLeftBreakPoint(arc, directrix) { - var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix; - if (!pby2) return rfocx; - var lArc = arc.P; - if (!lArc) return -Infinity; - site = lArc.site; - var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix; - if (!plby2) return lfocx; - var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2; - if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx; - return (rfocx + lfocx) / 2; - } - function d3_geom_voronoiRightBreakPoint(arc, directrix) { - var rArc = arc.N; - if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix); - var site = arc.site; - return site.y === directrix ? site.x : Infinity; - } - function d3_geom_voronoiCell(site) { - this.site = site; - this.edges = []; - } - d3_geom_voronoiCell.prototype.prepare = function() { - var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge; - while (iHalfEdge--) { - edge = halfEdges[iHalfEdge].edge; - if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1); - } - halfEdges.sort(d3_geom_voronoiHalfEdgeOrder); - return halfEdges.length; - }; - function d3_geom_voronoiCloseCells(extent) { - var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end; - while (iCell--) { - cell = cells[iCell]; - if (!cell || !cell.prepare()) continue; - halfEdges = cell.edges; - nHalfEdges = halfEdges.length; - iHalfEdge = 0; - while (iHalfEdge < nHalfEdges) { - end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y; - start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y; - if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) { - halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? { - x: x0, - y: abs(x2 - x0) < ε ? y2 : y1 - } : abs(y3 - y1) < ε && x1 - x3 > ε ? { - x: abs(y2 - y1) < ε ? x2 : x1, - y: y1 - } : abs(x3 - x1) < ε && y3 - y0 > ε ? { - x: x1, - y: abs(x2 - x1) < ε ? y2 : y0 - } : abs(y3 - y0) < ε && x3 - x0 > ε ? { - x: abs(y2 - y0) < ε ? x2 : x0, - y: y0 - } : null), cell.site, null)); - ++nHalfEdges; - } - } - } - } - function d3_geom_voronoiHalfEdgeOrder(a, b) { - return b.angle - a.angle; - } - function d3_geom_voronoiCircle() { - d3_geom_voronoiRedBlackNode(this); - this.x = this.y = this.arc = this.site = this.cy = null; - } - function d3_geom_voronoiAttachCircle(arc) { - var lArc = arc.P, rArc = arc.N; - if (!lArc || !rArc) return; - var lSite = lArc.site, cSite = arc.site, rSite = rArc.site; - if (lSite === rSite) return; - var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by; - var d = 2 * (ax * cy - ay * cx); - if (d >= -ε2) return; - var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by; - var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle(); - circle.arc = arc; - circle.site = cSite; - circle.x = x + bx; - circle.y = cy + Math.sqrt(x * x + y * y); - circle.cy = cy; - arc.circle = circle; - var before = null, node = d3_geom_voronoiCircles._; - while (node) { - if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) { - if (node.L) node = node.L; else { - before = node.P; - break; - } - } else { - if (node.R) node = node.R; else { - before = node; - break; - } - } - } - d3_geom_voronoiCircles.insert(before, circle); - if (!before) d3_geom_voronoiFirstCircle = circle; - } - function d3_geom_voronoiDetachCircle(arc) { - var circle = arc.circle; - if (circle) { - if (!circle.P) d3_geom_voronoiFirstCircle = circle.N; - d3_geom_voronoiCircles.remove(circle); - d3_geom_voronoiCirclePool.push(circle); - d3_geom_voronoiRedBlackNode(circle); - arc.circle = null; - } - } - function d3_geom_voronoiClipEdges(extent) { - var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e; - while (i--) { - e = edges[i]; - if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) { - e.a = e.b = null; - edges.splice(i, 1); - } - } - } - function d3_geom_voronoiConnectEdge(edge, extent) { - var vb = edge.b; - if (vb) return true; - var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb; - if (ry === ly) { - if (fx < x0 || fx >= x1) return; - if (lx > rx) { - if (!va) va = { - x: fx, - y: y0 - }; else if (va.y >= y1) return; - vb = { - x: fx, - y: y1 - }; - } else { - if (!va) va = { - x: fx, - y: y1 - }; else if (va.y < y0) return; - vb = { - x: fx, - y: y0 - }; - } - } else { - fm = (lx - rx) / (ry - ly); - fb = fy - fm * fx; - if (fm < -1 || fm > 1) { - if (lx > rx) { - if (!va) va = { - x: (y0 - fb) / fm, - y: y0 - }; else if (va.y >= y1) return; - vb = { - x: (y1 - fb) / fm, - y: y1 - }; - } else { - if (!va) va = { - x: (y1 - fb) / fm, - y: y1 - }; else if (va.y < y0) return; - vb = { - x: (y0 - fb) / fm, - y: y0 - }; - } - } else { - if (ly < ry) { - if (!va) va = { - x: x0, - y: fm * x0 + fb - }; else if (va.x >= x1) return; - vb = { - x: x1, - y: fm * x1 + fb - }; - } else { - if (!va) va = { - x: x1, - y: fm * x1 + fb - }; else if (va.x < x0) return; - vb = { - x: x0, - y: fm * x0 + fb - }; - } - } - } - edge.a = va; - edge.b = vb; - return true; - } - function d3_geom_voronoiEdge(lSite, rSite) { - this.l = lSite; - this.r = rSite; - this.a = this.b = null; - } - function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) { - var edge = new d3_geom_voronoiEdge(lSite, rSite); - d3_geom_voronoiEdges.push(edge); - if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va); - if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb); - d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite)); - d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite)); - return edge; - } - function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) { - var edge = new d3_geom_voronoiEdge(lSite, null); - edge.a = va; - edge.b = vb; - d3_geom_voronoiEdges.push(edge); - return edge; - } - function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) { - if (!edge.a && !edge.b) { - edge.a = vertex; - edge.l = lSite; - edge.r = rSite; - } else if (edge.l === rSite) { - edge.b = vertex; - } else { - edge.a = vertex; - } - } - function d3_geom_voronoiHalfEdge(edge, lSite, rSite) { - var va = edge.a, vb = edge.b; - this.edge = edge; - this.site = lSite; - this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y); - } - d3_geom_voronoiHalfEdge.prototype = { - start: function() { - return this.edge.l === this.site ? this.edge.a : this.edge.b; - }, - end: function() { - return this.edge.l === this.site ? this.edge.b : this.edge.a; - } - }; - function d3_geom_voronoiRedBlackTree() { - this._ = null; - } - function d3_geom_voronoiRedBlackNode(node) { - node.U = node.C = node.L = node.R = node.P = node.N = null; - } - d3_geom_voronoiRedBlackTree.prototype = { - insert: function(after, node) { - var parent, grandpa, uncle; - if (after) { - node.P = after; - node.N = after.N; - if (after.N) after.N.P = node; - after.N = node; - if (after.R) { - after = after.R; - while (after.L) after = after.L; - after.L = node; - } else { - after.R = node; - } - parent = after; - } else if (this._) { - after = d3_geom_voronoiRedBlackFirst(this._); - node.P = null; - node.N = after; - after.P = after.L = node; - parent = after; - } else { - node.P = node.N = null; - this._ = node; - parent = null; - } - node.L = node.R = null; - node.U = parent; - node.C = true; - after = node; - while (parent && parent.C) { - grandpa = parent.U; - if (parent === grandpa.L) { - uncle = grandpa.R; - if (uncle && uncle.C) { - parent.C = uncle.C = false; - grandpa.C = true; - after = grandpa; - } else { - if (after === parent.R) { - d3_geom_voronoiRedBlackRotateLeft(this, parent); - after = parent; - parent = after.U; - } - parent.C = false; - grandpa.C = true; - d3_geom_voronoiRedBlackRotateRight(this, grandpa); - } - } else { - uncle = grandpa.L; - if (uncle && uncle.C) { - parent.C = uncle.C = false; - grandpa.C = true; - after = grandpa; - } else { - if (after === parent.L) { - d3_geom_voronoiRedBlackRotateRight(this, parent); - after = parent; - parent = after.U; - } - parent.C = false; - grandpa.C = true; - d3_geom_voronoiRedBlackRotateLeft(this, grandpa); - } - } - parent = after.U; - } - this._.C = false; - }, - remove: function(node) { - if (node.N) node.N.P = node.P; - if (node.P) node.P.N = node.N; - node.N = node.P = null; - var parent = node.U, sibling, left = node.L, right = node.R, next, red; - if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right); - if (parent) { - if (parent.L === node) parent.L = next; else parent.R = next; - } else { - this._ = next; - } - if (left && right) { - red = next.C; - next.C = node.C; - next.L = left; - left.U = next; - if (next !== right) { - parent = next.U; - next.U = node.U; - node = next.R; - parent.L = node; - next.R = right; - right.U = next; - } else { - next.U = parent; - parent = next; - node = next.R; - } - } else { - red = node.C; - node = next; - } - if (node) node.U = parent; - if (red) return; - if (node && node.C) { - node.C = false; - return; - } - do { - if (node === this._) break; - if (node === parent.L) { - sibling = parent.R; - if (sibling.C) { - sibling.C = false; - parent.C = true; - d3_geom_voronoiRedBlackRotateLeft(this, parent); - sibling = parent.R; - } - if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) { - if (!sibling.R || !sibling.R.C) { - sibling.L.C = false; - sibling.C = true; - d3_geom_voronoiRedBlackRotateRight(this, sibling); - sibling = parent.R; - } - sibling.C = parent.C; - parent.C = sibling.R.C = false; - d3_geom_voronoiRedBlackRotateLeft(this, parent); - node = this._; - break; - } - } else { - sibling = parent.L; - if (sibling.C) { - sibling.C = false; - parent.C = true; - d3_geom_voronoiRedBlackRotateRight(this, parent); - sibling = parent.L; - } - if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) { - if (!sibling.L || !sibling.L.C) { - sibling.R.C = false; - sibling.C = true; - d3_geom_voronoiRedBlackRotateLeft(this, sibling); - sibling = parent.L; - } - sibling.C = parent.C; - parent.C = sibling.L.C = false; - d3_geom_voronoiRedBlackRotateRight(this, parent); - node = this._; - break; - } - } - sibling.C = true; - node = parent; - parent = parent.U; - } while (!node.C); - if (node) node.C = false; - } - }; - function d3_geom_voronoiRedBlackRotateLeft(tree, node) { - var p = node, q = node.R, parent = p.U; - if (parent) { - if (parent.L === p) parent.L = q; else parent.R = q; - } else { - tree._ = q; - } - q.U = parent; - p.U = q; - p.R = q.L; - if (p.R) p.R.U = p; - q.L = p; - } - function d3_geom_voronoiRedBlackRotateRight(tree, node) { - var p = node, q = node.L, parent = p.U; - if (parent) { - if (parent.L === p) parent.L = q; else parent.R = q; - } else { - tree._ = q; - } - q.U = parent; - p.U = q; - p.L = q.R; - if (p.L) p.L.U = p; - q.R = p; - } - function d3_geom_voronoiRedBlackFirst(node) { - while (node.L) node = node.L; - return node; - } - function d3_geom_voronoi(sites, bbox) { - var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle; - d3_geom_voronoiEdges = []; - d3_geom_voronoiCells = new Array(sites.length); - d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree(); - d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree(); - while (true) { - circle = d3_geom_voronoiFirstCircle; - if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) { - if (site.x !== x0 || site.y !== y0) { - d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site); - d3_geom_voronoiAddBeach(site); - x0 = site.x, y0 = site.y; - } - site = sites.pop(); - } else if (circle) { - d3_geom_voronoiRemoveBeach(circle.arc); - } else { - break; - } - } - if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox); - var diagram = { - cells: d3_geom_voronoiCells, - edges: d3_geom_voronoiEdges - }; - d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null; - return diagram; - } - function d3_geom_voronoiVertexOrder(a, b) { - return b.y - a.y || b.x - a.x; - } - d3.geom.voronoi = function(points) { - var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent; - if (points) return voronoi(points); - function voronoi(data) { - var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1]; - d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) { - var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) { - var s = e.start(); - return [ s.x, s.y ]; - }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : []; - polygon.point = data[i]; - }); - return polygons; - } - function sites(data) { - return data.map(function(d, i) { - return { - x: Math.round(fx(d, i) / ε) * ε, - y: Math.round(fy(d, i) / ε) * ε, - i: i - }; - }); - } - voronoi.links = function(data) { - return d3_geom_voronoi(sites(data)).edges.filter(function(edge) { - return edge.l && edge.r; - }).map(function(edge) { - return { - source: data[edge.l.i], - target: data[edge.r.i] - }; - }); - }; - voronoi.triangles = function(data) { - var triangles = []; - d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) { - var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l; - while (++j < m) { - e0 = e1; - s0 = s1; - e1 = edges[j].edge; - s1 = e1.l === site ? e1.r : e1.l; - if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) { - triangles.push([ data[i], data[s0.i], data[s1.i] ]); - } - } - }); - return triangles; - }; - voronoi.x = function(_) { - return arguments.length ? (fx = d3_functor(x = _), voronoi) : x; - }; - voronoi.y = function(_) { - return arguments.length ? (fy = d3_functor(y = _), voronoi) : y; - }; - voronoi.clipExtent = function(_) { - if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent; - clipExtent = _ == null ? d3_geom_voronoiClipExtent : _; - return voronoi; - }; - voronoi.size = function(_) { - if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1]; - return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]); - }; - return voronoi; - }; - var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ]; - function d3_geom_voronoiTriangleArea(a, b, c) { - return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y); - } - d3.geom.delaunay = function(vertices) { - return d3.geom.voronoi().triangles(vertices); - }; - d3.geom.quadtree = function(points, x1, y1, x2, y2) { - var x = d3_geom_pointX, y = d3_geom_pointY, compat; - if (compat = arguments.length) { - x = d3_geom_quadtreeCompatX; - y = d3_geom_quadtreeCompatY; - if (compat === 3) { - y2 = y1; - x2 = x1; - y1 = x1 = 0; - } - return quadtree(points); - } - function quadtree(data) { - var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_; - if (x1 != null) { - x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2; - } else { - x2_ = y2_ = -(x1_ = y1_ = Infinity); - xs = [], ys = []; - n = data.length; - if (compat) for (i = 0; i < n; ++i) { - d = data[i]; - if (d.x < x1_) x1_ = d.x; - if (d.y < y1_) y1_ = d.y; - if (d.x > x2_) x2_ = d.x; - if (d.y > y2_) y2_ = d.y; - xs.push(d.x); - ys.push(d.y); - } else for (i = 0; i < n; ++i) { - var x_ = +fx(d = data[i], i), y_ = +fy(d, i); - if (x_ < x1_) x1_ = x_; - if (y_ < y1_) y1_ = y_; - if (x_ > x2_) x2_ = x_; - if (y_ > y2_) y2_ = y_; - xs.push(x_); - ys.push(y_); - } - } - var dx = x2_ - x1_, dy = y2_ - y1_; - if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy; - function insert(n, d, x, y, x1, y1, x2, y2) { - if (isNaN(x) || isNaN(y)) return; - if (n.leaf) { - var nx = n.x, ny = n.y; - if (nx != null) { - if (abs(nx - x) + abs(ny - y) < .01) { - insertChild(n, d, x, y, x1, y1, x2, y2); - } else { - var nPoint = n.point; - n.x = n.y = n.point = null; - insertChild(n, nPoint, nx, ny, x1, y1, x2, y2); - insertChild(n, d, x, y, x1, y1, x2, y2); - } - } else { - n.x = x, n.y = y, n.point = d; - } - } else { - insertChild(n, d, x, y, x1, y1, x2, y2); - } - } - function insertChild(n, d, x, y, x1, y1, x2, y2) { - var xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym, i = below << 1 | right; - n.leaf = false; - n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode()); - if (right) x1 = xm; else x2 = xm; - if (below) y1 = ym; else y2 = ym; - insert(n, d, x, y, x1, y1, x2, y2); - } - var root = d3_geom_quadtreeNode(); - root.add = function(d) { - insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_); - }; - root.visit = function(f) { - d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_); - }; - root.find = function(point) { - return d3_geom_quadtreeFind(root, point[0], point[1], x1_, y1_, x2_, y2_); - }; - i = -1; - if (x1 == null) { - while (++i < n) { - insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_); - } - --i; - } else data.forEach(root.add); - xs = ys = data = d = null; - return root; - } - quadtree.x = function(_) { - return arguments.length ? (x = _, quadtree) : x; - }; - quadtree.y = function(_) { - return arguments.length ? (y = _, quadtree) : y; - }; - quadtree.extent = function(_) { - if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ]; - if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], - y2 = +_[1][1]; - return quadtree; - }; - quadtree.size = function(_) { - if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ]; - if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1]; - return quadtree; - }; - return quadtree; - }; - function d3_geom_quadtreeCompatX(d) { - return d.x; - } - function d3_geom_quadtreeCompatY(d) { - return d.y; - } - function d3_geom_quadtreeNode() { - return { - leaf: true, - nodes: [], - point: null, - x: null, - y: null - }; - } - function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) { - if (!f(node, x1, y1, x2, y2)) { - var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes; - if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy); - if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy); - if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2); - if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2); - } - } - function d3_geom_quadtreeFind(root, x, y, x0, y0, x3, y3) { - var minDistance2 = Infinity, closestPoint; - (function find(node, x1, y1, x2, y2) { - if (x1 > x3 || y1 > y3 || x2 < x0 || y2 < y0) return; - if (point = node.point) { - var point, dx = x - node.x, dy = y - node.y, distance2 = dx * dx + dy * dy; - if (distance2 < minDistance2) { - var distance = Math.sqrt(minDistance2 = distance2); - x0 = x - distance, y0 = y - distance; - x3 = x + distance, y3 = y + distance; - closestPoint = point; - } - } - var children = node.nodes, xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym; - for (var i = below << 1 | right, j = i + 4; i < j; ++i) { - if (node = children[i & 3]) switch (i & 3) { - case 0: - find(node, x1, y1, xm, ym); - break; - - case 1: - find(node, xm, y1, x2, ym); - break; - - case 2: - find(node, x1, ym, xm, y2); - break; - - case 3: - find(node, xm, ym, x2, y2); - break; - } - } - })(root, x0, y0, x3, y3); - return closestPoint; - } - d3.interpolateRgb = d3_interpolateRgb; - function d3_interpolateRgb(a, b) { - a = d3.rgb(a); - b = d3.rgb(b); - var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab; - return function(t) { - return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t)); - }; - } - d3.interpolateObject = d3_interpolateObject; - function d3_interpolateObject(a, b) { - var i = {}, c = {}, k; - for (k in a) { - if (k in b) { - i[k] = d3_interpolate(a[k], b[k]); - } else { - c[k] = a[k]; - } - } - for (k in b) { - if (!(k in a)) { - c[k] = b[k]; - } - } - return function(t) { - for (k in i) c[k] = i[k](t); - return c; - }; - } - d3.interpolateNumber = d3_interpolateNumber; - function d3_interpolateNumber(a, b) { - a = +a, b = +b; - return function(t) { - return a * (1 - t) + b * t; - }; - } - d3.interpolateString = d3_interpolateString; - function d3_interpolateString(a, b) { - var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = []; - a = a + "", b = b + ""; - while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) { - if ((bs = bm.index) > bi) { - bs = b.slice(bi, bs); - if (s[i]) s[i] += bs; else s[++i] = bs; - } - if ((am = am[0]) === (bm = bm[0])) { - if (s[i]) s[i] += bm; else s[++i] = bm; - } else { - s[++i] = null; - q.push({ - i: i, - x: d3_interpolateNumber(am, bm) - }); - } - bi = d3_interpolate_numberB.lastIndex; - } - if (bi < b.length) { - bs = b.slice(bi); - if (s[i]) s[i] += bs; else s[++i] = bs; - } - return s.length < 2 ? q[0] ? (b = q[0].x, function(t) { - return b(t) + ""; - }) : function() { - return b; - } : (b = q.length, function(t) { - for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }); - } - var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g"); - d3.interpolate = d3_interpolate; - function d3_interpolate(a, b) { - var i = d3.interpolators.length, f; - while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ; - return f; - } - d3.interpolators = [ function(a, b) { - var t = typeof b; - return (t === "string" ? d3_rgb_names.has(b.toLowerCase()) || /^(#|rgb\(|hsl\()/i.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b); - } ]; - d3.interpolateArray = d3_interpolateArray; - function d3_interpolateArray(a, b) { - var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i; - for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i])); - for (;i < na; ++i) c[i] = a[i]; - for (;i < nb; ++i) c[i] = b[i]; - return function(t) { - for (i = 0; i < n0; ++i) c[i] = x[i](t); - return c; - }; - } - var d3_ease_default = function() { - return d3_identity; - }; - var d3_ease = d3.map({ - linear: d3_ease_default, - poly: d3_ease_poly, - quad: function() { - return d3_ease_quad; - }, - cubic: function() { - return d3_ease_cubic; - }, - sin: function() { - return d3_ease_sin; - }, - exp: function() { - return d3_ease_exp; - }, - circle: function() { - return d3_ease_circle; - }, - elastic: d3_ease_elastic, - back: d3_ease_back, - bounce: function() { - return d3_ease_bounce; - } - }); - var d3_ease_mode = d3.map({ - "in": d3_identity, - out: d3_ease_reverse, - "in-out": d3_ease_reflect, - "out-in": function(f) { - return d3_ease_reflect(d3_ease_reverse(f)); - } - }); - d3.ease = function(name) { - var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in"; - t = d3_ease.get(t) || d3_ease_default; - m = d3_ease_mode.get(m) || d3_identity; - return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1)))); - }; - function d3_ease_clamp(f) { - return function(t) { - return t <= 0 ? 0 : t >= 1 ? 1 : f(t); - }; - } - function d3_ease_reverse(f) { - return function(t) { - return 1 - f(1 - t); - }; - } - function d3_ease_reflect(f) { - return function(t) { - return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t)); - }; - } - function d3_ease_quad(t) { - return t * t; - } - function d3_ease_cubic(t) { - return t * t * t; - } - function d3_ease_cubicInOut(t) { - if (t <= 0) return 0; - if (t >= 1) return 1; - var t2 = t * t, t3 = t2 * t; - return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75); - } - function d3_ease_poly(e) { - return function(t) { - return Math.pow(t, e); - }; - } - function d3_ease_sin(t) { - return 1 - Math.cos(t * halfπ); - } - function d3_ease_exp(t) { - return Math.pow(2, 10 * (t - 1)); - } - function d3_ease_circle(t) { - return 1 - Math.sqrt(1 - t * t); - } - function d3_ease_elastic(a, p) { - var s; - if (arguments.length < 2) p = .45; - if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4; - return function(t) { - return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p); - }; - } - function d3_ease_back(s) { - if (!s) s = 1.70158; - return function(t) { - return t * t * ((s + 1) * t - s); - }; - } - function d3_ease_bounce(t) { - return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375; - } - d3.interpolateHcl = d3_interpolateHcl; - function d3_interpolateHcl(a, b) { - a = d3.hcl(a); - b = d3.hcl(b); - var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al; - if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac; - if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; - return function(t) { - return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + ""; - }; - } - d3.interpolateHsl = d3_interpolateHsl; - function d3_interpolateHsl(a, b) { - a = d3.hsl(a); - b = d3.hsl(b); - var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al; - if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as; - if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; - return function(t) { - return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + ""; - }; - } - d3.interpolateLab = d3_interpolateLab; - function d3_interpolateLab(a, b) { - a = d3.lab(a); - b = d3.lab(b); - var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab; - return function(t) { - return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + ""; - }; - } - d3.interpolateRound = d3_interpolateRound; - function d3_interpolateRound(a, b) { - b -= a; - return function(t) { - return Math.round(a + b * t); - }; - } - d3.transform = function(string) { - var g = d3_document.createElementNS(d3.ns.prefix.svg, "g"); - return (d3.transform = function(string) { - if (string != null) { - g.setAttribute("transform", string); - var t = g.transform.baseVal.consolidate(); - } - return new d3_transform(t ? t.matrix : d3_transformIdentity); - })(string); - }; - function d3_transform(m) { - var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0; - if (r0[0] * r1[1] < r1[0] * r0[1]) { - r0[0] *= -1; - r0[1] *= -1; - kx *= -1; - kz *= -1; - } - this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees; - this.translate = [ m.e, m.f ]; - this.scale = [ kx, ky ]; - this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0; - } - d3_transform.prototype.toString = function() { - return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")"; - }; - function d3_transformDot(a, b) { - return a[0] * b[0] + a[1] * b[1]; - } - function d3_transformNormalize(a) { - var k = Math.sqrt(d3_transformDot(a, a)); - if (k) { - a[0] /= k; - a[1] /= k; - } - return k; - } - function d3_transformCombine(a, b, k) { - a[0] += k * b[0]; - a[1] += k * b[1]; - return a; - } - var d3_transformIdentity = { - a: 1, - b: 0, - c: 0, - d: 1, - e: 0, - f: 0 - }; - d3.interpolateTransform = d3_interpolateTransform; - function d3_interpolateTransformPop(s) { - return s.length ? s.pop() + "," : ""; - } - function d3_interpolateTranslate(ta, tb, s, q) { - if (ta[0] !== tb[0] || ta[1] !== tb[1]) { - var i = s.push("translate(", null, ",", null, ")"); - q.push({ - i: i - 4, - x: d3_interpolateNumber(ta[0], tb[0]) - }, { - i: i - 2, - x: d3_interpolateNumber(ta[1], tb[1]) - }); - } else if (tb[0] || tb[1]) { - s.push("translate(" + tb + ")"); - } - } - function d3_interpolateRotate(ra, rb, s, q) { - if (ra !== rb) { - if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360; - q.push({ - i: s.push(d3_interpolateTransformPop(s) + "rotate(", null, ")") - 2, - x: d3_interpolateNumber(ra, rb) - }); - } else if (rb) { - s.push(d3_interpolateTransformPop(s) + "rotate(" + rb + ")"); - } - } - function d3_interpolateSkew(wa, wb, s, q) { - if (wa !== wb) { - q.push({ - i: s.push(d3_interpolateTransformPop(s) + "skewX(", null, ")") - 2, - x: d3_interpolateNumber(wa, wb) - }); - } else if (wb) { - s.push(d3_interpolateTransformPop(s) + "skewX(" + wb + ")"); - } - } - function d3_interpolateScale(ka, kb, s, q) { - if (ka[0] !== kb[0] || ka[1] !== kb[1]) { - var i = s.push(d3_interpolateTransformPop(s) + "scale(", null, ",", null, ")"); - q.push({ - i: i - 4, - x: d3_interpolateNumber(ka[0], kb[0]) - }, { - i: i - 2, - x: d3_interpolateNumber(ka[1], kb[1]) - }); - } else if (kb[0] !== 1 || kb[1] !== 1) { - s.push(d3_interpolateTransformPop(s) + "scale(" + kb + ")"); - } - } - function d3_interpolateTransform(a, b) { - var s = [], q = []; - a = d3.transform(a), b = d3.transform(b); - d3_interpolateTranslate(a.translate, b.translate, s, q); - d3_interpolateRotate(a.rotate, b.rotate, s, q); - d3_interpolateSkew(a.skew, b.skew, s, q); - d3_interpolateScale(a.scale, b.scale, s, q); - a = b = null; - return function(t) { - var i = -1, n = q.length, o; - while (++i < n) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }; - } - function d3_uninterpolateNumber(a, b) { - b = (b -= a = +a) || 1 / b; - return function(x) { - return (x - a) / b; - }; - } - function d3_uninterpolateClamp(a, b) { - b = (b -= a = +a) || 1 / b; - return function(x) { - return Math.max(0, Math.min(1, (x - a) / b)); - }; - } - d3.layout = {}; - d3.layout.bundle = function() { - return function(links) { - var paths = [], i = -1, n = links.length; - while (++i < n) paths.push(d3_layout_bundlePath(links[i])); - return paths; - }; - }; - function d3_layout_bundlePath(link) { - var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ]; - while (start !== lca) { - start = start.parent; - points.push(start); - } - var k = points.length; - while (end !== lca) { - points.splice(k, 0, end); - end = end.parent; - } - return points; - } - function d3_layout_bundleAncestors(node) { - var ancestors = [], parent = node.parent; - while (parent != null) { - ancestors.push(node); - node = parent; - parent = parent.parent; - } - ancestors.push(node); - return ancestors; - } - function d3_layout_bundleLeastCommonAncestor(a, b) { - if (a === b) return a; - var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null; - while (aNode === bNode) { - sharedNode = aNode; - aNode = aNodes.pop(); - bNode = bNodes.pop(); - } - return sharedNode; - } - d3.layout.chord = function() { - var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords; - function relayout() { - var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j; - chords = []; - groups = []; - k = 0, i = -1; - while (++i < n) { - x = 0, j = -1; - while (++j < n) { - x += matrix[i][j]; - } - groupSums.push(x); - subgroupIndex.push(d3.range(n)); - k += x; - } - if (sortGroups) { - groupIndex.sort(function(a, b) { - return sortGroups(groupSums[a], groupSums[b]); - }); - } - if (sortSubgroups) { - subgroupIndex.forEach(function(d, i) { - d.sort(function(a, b) { - return sortSubgroups(matrix[i][a], matrix[i][b]); - }); - }); - } - k = (τ - padding * n) / k; - x = 0, i = -1; - while (++i < n) { - x0 = x, j = -1; - while (++j < n) { - var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k; - subgroups[di + "-" + dj] = { - index: di, - subindex: dj, - startAngle: a0, - endAngle: a1, - value: v - }; - } - groups[di] = { - index: di, - startAngle: x0, - endAngle: x, - value: groupSums[di] - }; - x += padding; - } - i = -1; - while (++i < n) { - j = i - 1; - while (++j < n) { - var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i]; - if (source.value || target.value) { - chords.push(source.value < target.value ? { - source: target, - target: source - } : { - source: source, - target: target - }); - } - } - } - if (sortChords) resort(); - } - function resort() { - chords.sort(function(a, b) { - return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2); - }); - } - chord.matrix = function(x) { - if (!arguments.length) return matrix; - n = (matrix = x) && matrix.length; - chords = groups = null; - return chord; - }; - chord.padding = function(x) { - if (!arguments.length) return padding; - padding = x; - chords = groups = null; - return chord; - }; - chord.sortGroups = function(x) { - if (!arguments.length) return sortGroups; - sortGroups = x; - chords = groups = null; - return chord; - }; - chord.sortSubgroups = function(x) { - if (!arguments.length) return sortSubgroups; - sortSubgroups = x; - chords = null; - return chord; - }; - chord.sortChords = function(x) { - if (!arguments.length) return sortChords; - sortChords = x; - if (chords) resort(); - return chord; - }; - chord.chords = function() { - if (!chords) relayout(); - return chords; - }; - chord.groups = function() { - if (!groups) relayout(); - return groups; - }; - return chord; - }; - d3.layout.force = function() { - var force = {}, event = d3.dispatch("start", "tick", "end"), timer, size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges; - function repulse(node) { - return function(quad, x1, _, x2) { - if (quad.point !== node) { - var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy; - if (dw * dw / theta2 < dn) { - if (dn < chargeDistance2) { - var k = quad.charge / dn; - node.px -= dx * k; - node.py -= dy * k; - } - return true; - } - if (quad.point && dn && dn < chargeDistance2) { - var k = quad.pointCharge / dn; - node.px -= dx * k; - node.py -= dy * k; - } - } - return !quad.charge; - }; - } - force.tick = function() { - if ((alpha *= .99) < .005) { - timer = null; - event.end({ - type: "end", - alpha: alpha = 0 - }); - return true; - } - var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y; - for (i = 0; i < m; ++i) { - o = links[i]; - s = o.source; - t = o.target; - x = t.x - s.x; - y = t.y - s.y; - if (l = x * x + y * y) { - l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l; - x *= l; - y *= l; - t.x -= x * (k = s.weight + t.weight ? s.weight / (s.weight + t.weight) : .5); - t.y -= y * k; - s.x += x * (k = 1 - k); - s.y += y * k; - } - } - if (k = alpha * gravity) { - x = size[0] / 2; - y = size[1] / 2; - i = -1; - if (k) while (++i < n) { - o = nodes[i]; - o.x += (x - o.x) * k; - o.y += (y - o.y) * k; - } - } - if (charge) { - d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges); - i = -1; - while (++i < n) { - if (!(o = nodes[i]).fixed) { - q.visit(repulse(o)); - } - } - } - i = -1; - while (++i < n) { - o = nodes[i]; - if (o.fixed) { - o.x = o.px; - o.y = o.py; - } else { - o.x -= (o.px - (o.px = o.x)) * friction; - o.y -= (o.py - (o.py = o.y)) * friction; - } - } - event.tick({ - type: "tick", - alpha: alpha - }); - }; - force.nodes = function(x) { - if (!arguments.length) return nodes; - nodes = x; - return force; - }; - force.links = function(x) { - if (!arguments.length) return links; - links = x; - return force; - }; - force.size = function(x) { - if (!arguments.length) return size; - size = x; - return force; - }; - force.linkDistance = function(x) { - if (!arguments.length) return linkDistance; - linkDistance = typeof x === "function" ? x : +x; - return force; - }; - force.distance = force.linkDistance; - force.linkStrength = function(x) { - if (!arguments.length) return linkStrength; - linkStrength = typeof x === "function" ? x : +x; - return force; - }; - force.friction = function(x) { - if (!arguments.length) return friction; - friction = +x; - return force; - }; - force.charge = function(x) { - if (!arguments.length) return charge; - charge = typeof x === "function" ? x : +x; - return force; - }; - force.chargeDistance = function(x) { - if (!arguments.length) return Math.sqrt(chargeDistance2); - chargeDistance2 = x * x; - return force; - }; - force.gravity = function(x) { - if (!arguments.length) return gravity; - gravity = +x; - return force; - }; - force.theta = function(x) { - if (!arguments.length) return Math.sqrt(theta2); - theta2 = x * x; - return force; - }; - force.alpha = function(x) { - if (!arguments.length) return alpha; - x = +x; - if (alpha) { - if (x > 0) { - alpha = x; - } else { - timer.c = null, timer.t = NaN, timer = null; - event.end({ - type: "end", - alpha: alpha = 0 - }); - } - } else if (x > 0) { - event.start({ - type: "start", - alpha: alpha = x - }); - timer = d3_timer(force.tick); - } - return force; - }; - force.start = function() { - var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o; - for (i = 0; i < n; ++i) { - (o = nodes[i]).index = i; - o.weight = 0; - } - for (i = 0; i < m; ++i) { - o = links[i]; - if (typeof o.source == "number") o.source = nodes[o.source]; - if (typeof o.target == "number") o.target = nodes[o.target]; - ++o.source.weight; - ++o.target.weight; - } - for (i = 0; i < n; ++i) { - o = nodes[i]; - if (isNaN(o.x)) o.x = position("x", w); - if (isNaN(o.y)) o.y = position("y", h); - if (isNaN(o.px)) o.px = o.x; - if (isNaN(o.py)) o.py = o.y; - } - distances = []; - if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance; - strengths = []; - if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength; - charges = []; - if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge; - function position(dimension, size) { - if (!neighbors) { - neighbors = new Array(n); - for (j = 0; j < n; ++j) { - neighbors[j] = []; - } - for (j = 0; j < m; ++j) { - var o = links[j]; - neighbors[o.source.index].push(o.target); - neighbors[o.target.index].push(o.source); - } - } - var candidates = neighbors[i], j = -1, l = candidates.length, x; - while (++j < l) if (!isNaN(x = candidates[j][dimension])) return x; - return Math.random() * size; - } - return force.resume(); - }; - force.resume = function() { - return force.alpha(.1); - }; - force.stop = function() { - return force.alpha(0); - }; - force.drag = function() { - if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend); - if (!arguments.length) return drag; - this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag); - }; - function dragmove(d) { - d.px = d3.event.x, d.py = d3.event.y; - force.resume(); - } - return d3.rebind(force, event, "on"); - }; - function d3_layout_forceDragstart(d) { - d.fixed |= 2; - } - function d3_layout_forceDragend(d) { - d.fixed &= ~6; - } - function d3_layout_forceMouseover(d) { - d.fixed |= 4; - d.px = d.x, d.py = d.y; - } - function d3_layout_forceMouseout(d) { - d.fixed &= ~4; - } - function d3_layout_forceAccumulate(quad, alpha, charges) { - var cx = 0, cy = 0; - quad.charge = 0; - if (!quad.leaf) { - var nodes = quad.nodes, n = nodes.length, i = -1, c; - while (++i < n) { - c = nodes[i]; - if (c == null) continue; - d3_layout_forceAccumulate(c, alpha, charges); - quad.charge += c.charge; - cx += c.charge * c.cx; - cy += c.charge * c.cy; - } - } - if (quad.point) { - if (!quad.leaf) { - quad.point.x += Math.random() - .5; - quad.point.y += Math.random() - .5; - } - var k = alpha * charges[quad.point.index]; - quad.charge += quad.pointCharge = k; - cx += k * quad.point.x; - cy += k * quad.point.y; - } - quad.cx = cx / quad.charge; - quad.cy = cy / quad.charge; - } - var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity; - d3.layout.hierarchy = function() { - var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue; - function hierarchy(root) { - var stack = [ root ], nodes = [], node; - root.depth = 0; - while ((node = stack.pop()) != null) { - nodes.push(node); - if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) { - var n, childs, child; - while (--n >= 0) { - stack.push(child = childs[n]); - child.parent = node; - child.depth = node.depth + 1; - } - if (value) node.value = 0; - node.children = childs; - } else { - if (value) node.value = +value.call(hierarchy, node, node.depth) || 0; - delete node.children; - } - } - d3_layout_hierarchyVisitAfter(root, function(node) { - var childs, parent; - if (sort && (childs = node.children)) childs.sort(sort); - if (value && (parent = node.parent)) parent.value += node.value; - }); - return nodes; - } - hierarchy.sort = function(x) { - if (!arguments.length) return sort; - sort = x; - return hierarchy; - }; - hierarchy.children = function(x) { - if (!arguments.length) return children; - children = x; - return hierarchy; - }; - hierarchy.value = function(x) { - if (!arguments.length) return value; - value = x; - return hierarchy; - }; - hierarchy.revalue = function(root) { - if (value) { - d3_layout_hierarchyVisitBefore(root, function(node) { - if (node.children) node.value = 0; - }); - d3_layout_hierarchyVisitAfter(root, function(node) { - var parent; - if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0; - if (parent = node.parent) parent.value += node.value; - }); - } - return root; - }; - return hierarchy; - }; - function d3_layout_hierarchyRebind(object, hierarchy) { - d3.rebind(object, hierarchy, "sort", "children", "value"); - object.nodes = object; - object.links = d3_layout_hierarchyLinks; - return object; - } - function d3_layout_hierarchyVisitBefore(node, callback) { - var nodes = [ node ]; - while ((node = nodes.pop()) != null) { - callback(node); - if ((children = node.children) && (n = children.length)) { - var n, children; - while (--n >= 0) nodes.push(children[n]); - } - } - } - function d3_layout_hierarchyVisitAfter(node, callback) { - var nodes = [ node ], nodes2 = []; - while ((node = nodes.pop()) != null) { - nodes2.push(node); - if ((children = node.children) && (n = children.length)) { - var i = -1, n, children; - while (++i < n) nodes.push(children[i]); - } - } - while ((node = nodes2.pop()) != null) { - callback(node); - } - } - function d3_layout_hierarchyChildren(d) { - return d.children; - } - function d3_layout_hierarchyValue(d) { - return d.value; - } - function d3_layout_hierarchySort(a, b) { - return b.value - a.value; - } - function d3_layout_hierarchyLinks(nodes) { - return d3.merge(nodes.map(function(parent) { - return (parent.children || []).map(function(child) { - return { - source: parent, - target: child - }; - }); - })); - } - d3.layout.partition = function() { - var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ]; - function position(node, x, dx, dy) { - var children = node.children; - node.x = x; - node.y = node.depth * dy; - node.dx = dx; - node.dy = dy; - if (children && (n = children.length)) { - var i = -1, n, c, d; - dx = node.value ? dx / node.value : 0; - while (++i < n) { - position(c = children[i], x, d = c.value * dx, dy); - x += d; - } - } - } - function depth(node) { - var children = node.children, d = 0; - if (children && (n = children.length)) { - var i = -1, n; - while (++i < n) d = Math.max(d, depth(children[i])); - } - return 1 + d; - } - function partition(d, i) { - var nodes = hierarchy.call(this, d, i); - position(nodes[0], 0, size[0], size[1] / depth(nodes[0])); - return nodes; - } - partition.size = function(x) { - if (!arguments.length) return size; - size = x; - return partition; - }; - return d3_layout_hierarchyRebind(partition, hierarchy); - }; - d3.layout.pie = function() { - var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ, padAngle = 0; - function pie(data) { - var n = data.length, values = data.map(function(d, i) { - return +value.call(pie, d, i); - }), a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle), da = (typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a, p = Math.min(Math.abs(da) / n, +(typeof padAngle === "function" ? padAngle.apply(this, arguments) : padAngle)), pa = p * (da < 0 ? -1 : 1), sum = d3.sum(values), k = sum ? (da - n * pa) / sum : 0, index = d3.range(n), arcs = [], v; - if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) { - return values[j] - values[i]; - } : function(i, j) { - return sort(data[i], data[j]); - }); - index.forEach(function(i) { - arcs[i] = { - data: data[i], - value: v = values[i], - startAngle: a, - endAngle: a += v * k + pa, - padAngle: p - }; - }); - return arcs; - } - pie.value = function(_) { - if (!arguments.length) return value; - value = _; - return pie; - }; - pie.sort = function(_) { - if (!arguments.length) return sort; - sort = _; - return pie; - }; - pie.startAngle = function(_) { - if (!arguments.length) return startAngle; - startAngle = _; - return pie; - }; - pie.endAngle = function(_) { - if (!arguments.length) return endAngle; - endAngle = _; - return pie; - }; - pie.padAngle = function(_) { - if (!arguments.length) return padAngle; - padAngle = _; - return pie; - }; - return pie; - }; - var d3_layout_pieSortByValue = {}; - d3.layout.stack = function() { - var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY; - function stack(data, index) { - if (!(n = data.length)) return data; - var series = data.map(function(d, i) { - return values.call(stack, d, i); - }); - var points = series.map(function(d) { - return d.map(function(v, i) { - return [ x.call(stack, v, i), y.call(stack, v, i) ]; - }); - }); - var orders = order.call(stack, points, index); - series = d3.permute(series, orders); - points = d3.permute(points, orders); - var offsets = offset.call(stack, points, index); - var m = series[0].length, n, i, j, o; - for (j = 0; j < m; ++j) { - out.call(stack, series[0][j], o = offsets[j], points[0][j][1]); - for (i = 1; i < n; ++i) { - out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]); - } - } - return data; - } - stack.values = function(x) { - if (!arguments.length) return values; - values = x; - return stack; - }; - stack.order = function(x) { - if (!arguments.length) return order; - order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault; - return stack; - }; - stack.offset = function(x) { - if (!arguments.length) return offset; - offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero; - return stack; - }; - stack.x = function(z) { - if (!arguments.length) return x; - x = z; - return stack; - }; - stack.y = function(z) { - if (!arguments.length) return y; - y = z; - return stack; - }; - stack.out = function(z) { - if (!arguments.length) return out; - out = z; - return stack; - }; - return stack; - }; - function d3_layout_stackX(d) { - return d.x; - } - function d3_layout_stackY(d) { - return d.y; - } - function d3_layout_stackOut(d, y0, y) { - d.y0 = y0; - d.y = y; - } - var d3_layout_stackOrders = d3.map({ - "inside-out": function(data) { - var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) { - return max[a] - max[b]; - }), top = 0, bottom = 0, tops = [], bottoms = []; - for (i = 0; i < n; ++i) { - j = index[i]; - if (top < bottom) { - top += sums[j]; - tops.push(j); - } else { - bottom += sums[j]; - bottoms.push(j); - } - } - return bottoms.reverse().concat(tops); - }, - reverse: function(data) { - return d3.range(data.length).reverse(); - }, - "default": d3_layout_stackOrderDefault - }); - var d3_layout_stackOffsets = d3.map({ - silhouette: function(data) { - var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = []; - for (j = 0; j < m; ++j) { - for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; - if (o > max) max = o; - sums.push(o); - } - for (j = 0; j < m; ++j) { - y0[j] = (max - sums[j]) / 2; - } - return y0; - }, - wiggle: function(data) { - var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = []; - y0[0] = o = o0 = 0; - for (j = 1; j < m; ++j) { - for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1]; - for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) { - for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) { - s3 += (data[k][j][1] - data[k][j - 1][1]) / dx; - } - s2 += s3 * data[i][j][1]; - } - y0[j] = o -= s1 ? s2 / s1 * dx : 0; - if (o < o0) o0 = o; - } - for (j = 0; j < m; ++j) y0[j] -= o0; - return y0; - }, - expand: function(data) { - var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = []; - for (j = 0; j < m; ++j) { - for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; - if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k; - } - for (j = 0; j < m; ++j) y0[j] = 0; - return y0; - }, - zero: d3_layout_stackOffsetZero - }); - function d3_layout_stackOrderDefault(data) { - return d3.range(data.length); - } - function d3_layout_stackOffsetZero(data) { - var j = -1, m = data[0].length, y0 = []; - while (++j < m) y0[j] = 0; - return y0; - } - function d3_layout_stackMaxIndex(array) { - var i = 1, j = 0, v = array[0][1], k, n = array.length; - for (;i < n; ++i) { - if ((k = array[i][1]) > v) { - j = i; - v = k; - } - } - return j; - } - function d3_layout_stackReduceSum(d) { - return d.reduce(d3_layout_stackSum, 0); - } - function d3_layout_stackSum(p, d) { - return p + d[1]; - } - d3.layout.histogram = function() { - var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges; - function histogram(data, i) { - var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x; - while (++i < m) { - bin = bins[i] = []; - bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]); - bin.y = 0; - } - if (m > 0) { - i = -1; - while (++i < n) { - x = values[i]; - if (x >= range[0] && x <= range[1]) { - bin = bins[d3.bisect(thresholds, x, 1, m) - 1]; - bin.y += k; - bin.push(data[i]); - } - } - } - return bins; - } - histogram.value = function(x) { - if (!arguments.length) return valuer; - valuer = x; - return histogram; - }; - histogram.range = function(x) { - if (!arguments.length) return ranger; - ranger = d3_functor(x); - return histogram; - }; - histogram.bins = function(x) { - if (!arguments.length) return binner; - binner = typeof x === "number" ? function(range) { - return d3_layout_histogramBinFixed(range, x); - } : d3_functor(x); - return histogram; - }; - histogram.frequency = function(x) { - if (!arguments.length) return frequency; - frequency = !!x; - return histogram; - }; - return histogram; - }; - function d3_layout_histogramBinSturges(range, values) { - return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1)); - } - function d3_layout_histogramBinFixed(range, n) { - var x = -1, b = +range[0], m = (range[1] - b) / n, f = []; - while (++x <= n) f[x] = m * x + b; - return f; - } - function d3_layout_histogramRange(values) { - return [ d3.min(values), d3.max(values) ]; - } - d3.layout.pack = function() { - var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius; - function pack(d, i) { - var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() { - return radius; - }; - root.x = root.y = 0; - d3_layout_hierarchyVisitAfter(root, function(d) { - d.r = +r(d.value); - }); - d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings); - if (padding) { - var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2; - d3_layout_hierarchyVisitAfter(root, function(d) { - d.r += dr; - }); - d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings); - d3_layout_hierarchyVisitAfter(root, function(d) { - d.r -= dr; - }); - } - d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h)); - return nodes; - } - pack.size = function(_) { - if (!arguments.length) return size; - size = _; - return pack; - }; - pack.radius = function(_) { - if (!arguments.length) return radius; - radius = _ == null || typeof _ === "function" ? _ : +_; - return pack; - }; - pack.padding = function(_) { - if (!arguments.length) return padding; - padding = +_; - return pack; - }; - return d3_layout_hierarchyRebind(pack, hierarchy); - }; - function d3_layout_packSort(a, b) { - return a.value - b.value; - } - function d3_layout_packInsert(a, b) { - var c = a._pack_next; - a._pack_next = b; - b._pack_prev = a; - b._pack_next = c; - c._pack_prev = b; - } - function d3_layout_packSplice(a, b) { - a._pack_next = b; - b._pack_prev = a; - } - function d3_layout_packIntersects(a, b) { - var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r; - return .999 * dr * dr > dx * dx + dy * dy; - } - function d3_layout_packSiblings(node) { - if (!(nodes = node.children) || !(n = nodes.length)) return; - var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n; - function bound(node) { - xMin = Math.min(node.x - node.r, xMin); - xMax = Math.max(node.x + node.r, xMax); - yMin = Math.min(node.y - node.r, yMin); - yMax = Math.max(node.y + node.r, yMax); - } - nodes.forEach(d3_layout_packLink); - a = nodes[0]; - a.x = -a.r; - a.y = 0; - bound(a); - if (n > 1) { - b = nodes[1]; - b.x = b.r; - b.y = 0; - bound(b); - if (n > 2) { - c = nodes[2]; - d3_layout_packPlace(a, b, c); - bound(c); - d3_layout_packInsert(a, c); - a._pack_prev = c; - d3_layout_packInsert(c, b); - b = a._pack_next; - for (i = 3; i < n; i++) { - d3_layout_packPlace(a, b, c = nodes[i]); - var isect = 0, s1 = 1, s2 = 1; - for (j = b._pack_next; j !== b; j = j._pack_next, s1++) { - if (d3_layout_packIntersects(j, c)) { - isect = 1; - break; - } - } - if (isect == 1) { - for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) { - if (d3_layout_packIntersects(k, c)) { - break; - } - } - } - if (isect) { - if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b); - i--; - } else { - d3_layout_packInsert(a, c); - b = c; - bound(c); - } - } - } - } - var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0; - for (i = 0; i < n; i++) { - c = nodes[i]; - c.x -= cx; - c.y -= cy; - cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y)); - } - node.r = cr; - nodes.forEach(d3_layout_packUnlink); - } - function d3_layout_packLink(node) { - node._pack_next = node._pack_prev = node; - } - function d3_layout_packUnlink(node) { - delete node._pack_next; - delete node._pack_prev; - } - function d3_layout_packTransform(node, x, y, k) { - var children = node.children; - node.x = x += k * node.x; - node.y = y += k * node.y; - node.r *= k; - if (children) { - var i = -1, n = children.length; - while (++i < n) d3_layout_packTransform(children[i], x, y, k); - } - } - function d3_layout_packPlace(a, b, c) { - var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y; - if (db && (dx || dy)) { - var da = b.r + c.r, dc = dx * dx + dy * dy; - da *= da; - db *= db; - var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc); - c.x = a.x + x * dx + y * dy; - c.y = a.y + x * dy - y * dx; - } else { - c.x = a.x + db; - c.y = a.y; - } - } - d3.layout.tree = function() { - var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null; - function tree(d, i) { - var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0); - d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z; - d3_layout_hierarchyVisitBefore(root1, secondWalk); - if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else { - var left = root0, right = root0, bottom = root0; - d3_layout_hierarchyVisitBefore(root0, function(node) { - if (node.x < left.x) left = node; - if (node.x > right.x) right = node; - if (node.depth > bottom.depth) bottom = node; - }); - var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1); - d3_layout_hierarchyVisitBefore(root0, function(node) { - node.x = (node.x + tx) * kx; - node.y = node.depth * ky; - }); - } - return nodes; - } - function wrapTree(root0) { - var root1 = { - A: null, - children: [ root0 ] - }, queue = [ root1 ], node1; - while ((node1 = queue.pop()) != null) { - for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) { - queue.push((children[i] = child = { - _: children[i], - parent: node1, - children: (child = children[i].children) && child.slice() || [], - A: null, - a: null, - z: 0, - m: 0, - c: 0, - s: 0, - t: null, - i: i - }).a = child); - } - } - return root1.children[0]; - } - function firstWalk(v) { - var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null; - if (children.length) { - d3_layout_treeShift(v); - var midpoint = (children[0].z + children[children.length - 1].z) / 2; - if (w) { - v.z = w.z + separation(v._, w._); - v.m = v.z - midpoint; - } else { - v.z = midpoint; - } - } else if (w) { - v.z = w.z + separation(v._, w._); - } - v.parent.A = apportion(v, w, v.parent.A || siblings[0]); - } - function secondWalk(v) { - v._.x = v.z + v.parent.m; - v.m += v.parent.m; - } - function apportion(v, w, ancestor) { - if (w) { - var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift; - while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) { - vom = d3_layout_treeLeft(vom); - vop = d3_layout_treeRight(vop); - vop.a = v; - shift = vim.z + sim - vip.z - sip + separation(vim._, vip._); - if (shift > 0) { - d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift); - sip += shift; - sop += shift; - } - sim += vim.m; - sip += vip.m; - som += vom.m; - sop += vop.m; - } - if (vim && !d3_layout_treeRight(vop)) { - vop.t = vim; - vop.m += sim - sop; - } - if (vip && !d3_layout_treeLeft(vom)) { - vom.t = vip; - vom.m += sip - som; - ancestor = v; - } - } - return ancestor; - } - function sizeNode(node) { - node.x *= size[0]; - node.y = node.depth * size[1]; - } - tree.separation = function(x) { - if (!arguments.length) return separation; - separation = x; - return tree; - }; - tree.size = function(x) { - if (!arguments.length) return nodeSize ? null : size; - nodeSize = (size = x) == null ? sizeNode : null; - return tree; - }; - tree.nodeSize = function(x) { - if (!arguments.length) return nodeSize ? size : null; - nodeSize = (size = x) == null ? null : sizeNode; - return tree; - }; - return d3_layout_hierarchyRebind(tree, hierarchy); - }; - function d3_layout_treeSeparation(a, b) { - return a.parent == b.parent ? 1 : 2; - } - function d3_layout_treeLeft(v) { - var children = v.children; - return children.length ? children[0] : v.t; - } - function d3_layout_treeRight(v) { - var children = v.children, n; - return (n = children.length) ? children[n - 1] : v.t; - } - function d3_layout_treeMove(wm, wp, shift) { - var change = shift / (wp.i - wm.i); - wp.c -= change; - wp.s += shift; - wm.c += change; - wp.z += shift; - wp.m += shift; - } - function d3_layout_treeShift(v) { - var shift = 0, change = 0, children = v.children, i = children.length, w; - while (--i >= 0) { - w = children[i]; - w.z += shift; - w.m += shift; - shift += w.s + (change += w.c); - } - } - function d3_layout_treeAncestor(vim, v, ancestor) { - return vim.a.parent === v.parent ? vim.a : ancestor; - } - d3.layout.cluster = function() { - var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false; - function cluster(d, i) { - var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0; - d3_layout_hierarchyVisitAfter(root, function(node) { - var children = node.children; - if (children && children.length) { - node.x = d3_layout_clusterX(children); - node.y = d3_layout_clusterY(children); - } else { - node.x = previousNode ? x += separation(node, previousNode) : 0; - node.y = 0; - previousNode = node; - } - }); - var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2; - d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) { - node.x = (node.x - root.x) * size[0]; - node.y = (root.y - node.y) * size[1]; - } : function(node) { - node.x = (node.x - x0) / (x1 - x0) * size[0]; - node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1]; - }); - return nodes; - } - cluster.separation = function(x) { - if (!arguments.length) return separation; - separation = x; - return cluster; - }; - cluster.size = function(x) { - if (!arguments.length) return nodeSize ? null : size; - nodeSize = (size = x) == null; - return cluster; - }; - cluster.nodeSize = function(x) { - if (!arguments.length) return nodeSize ? size : null; - nodeSize = (size = x) != null; - return cluster; - }; - return d3_layout_hierarchyRebind(cluster, hierarchy); - }; - function d3_layout_clusterY(children) { - return 1 + d3.max(children, function(child) { - return child.y; - }); - } - function d3_layout_clusterX(children) { - return children.reduce(function(x, child) { - return x + child.x; - }, 0) / children.length; - } - function d3_layout_clusterLeft(node) { - var children = node.children; - return children && children.length ? d3_layout_clusterLeft(children[0]) : node; - } - function d3_layout_clusterRight(node) { - var children = node.children, n; - return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node; - } - d3.layout.treemap = function() { - var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5)); - function scale(children, k) { - var i = -1, n = children.length, child, area; - while (++i < n) { - area = (child = children[i]).value * (k < 0 ? 0 : k); - child.area = isNaN(area) || area <= 0 ? 0 : area; - } - } - function squarify(node) { - var children = node.children; - if (children && children.length) { - var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n; - scale(remaining, rect.dx * rect.dy / node.value); - row.area = 0; - while ((n = remaining.length) > 0) { - row.push(child = remaining[n - 1]); - row.area += child.area; - if (mode !== "squarify" || (score = worst(row, u)) <= best) { - remaining.pop(); - best = score; - } else { - row.area -= row.pop().area; - position(row, u, rect, false); - u = Math.min(rect.dx, rect.dy); - row.length = row.area = 0; - best = Infinity; - } - } - if (row.length) { - position(row, u, rect, true); - row.length = row.area = 0; - } - children.forEach(squarify); - } - } - function stickify(node) { - var children = node.children; - if (children && children.length) { - var rect = pad(node), remaining = children.slice(), child, row = []; - scale(remaining, rect.dx * rect.dy / node.value); - row.area = 0; - while (child = remaining.pop()) { - row.push(child); - row.area += child.area; - if (child.z != null) { - position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length); - row.length = row.area = 0; - } - } - children.forEach(stickify); - } - } - function worst(row, u) { - var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length; - while (++i < n) { - if (!(r = row[i].area)) continue; - if (r < rmin) rmin = r; - if (r > rmax) rmax = r; - } - s *= s; - u *= u; - return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity; - } - function position(row, u, rect, flush) { - var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o; - if (u == rect.dx) { - if (flush || v > rect.dy) v = rect.dy; - while (++i < n) { - o = row[i]; - o.x = x; - o.y = y; - o.dy = v; - x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0); - } - o.z = true; - o.dx += rect.x + rect.dx - x; - rect.y += v; - rect.dy -= v; - } else { - if (flush || v > rect.dx) v = rect.dx; - while (++i < n) { - o = row[i]; - o.x = x; - o.y = y; - o.dx = v; - y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0); - } - o.z = false; - o.dy += rect.y + rect.dy - y; - rect.x += v; - rect.dx -= v; - } - } - function treemap(d) { - var nodes = stickies || hierarchy(d), root = nodes[0]; - root.x = root.y = 0; - if (root.value) root.dx = size[0], root.dy = size[1]; else root.dx = root.dy = 0; - if (stickies) hierarchy.revalue(root); - scale([ root ], root.dx * root.dy / root.value); - (stickies ? stickify : squarify)(root); - if (sticky) stickies = nodes; - return nodes; - } - treemap.size = function(x) { - if (!arguments.length) return size; - size = x; - return treemap; - }; - treemap.padding = function(x) { - if (!arguments.length) return padding; - function padFunction(node) { - var p = x.call(treemap, node, node.depth); - return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p); - } - function padConstant(node) { - return d3_layout_treemapPad(node, x); - } - var type; - pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ], - padConstant) : padConstant; - return treemap; - }; - treemap.round = function(x) { - if (!arguments.length) return round != Number; - round = x ? Math.round : Number; - return treemap; - }; - treemap.sticky = function(x) { - if (!arguments.length) return sticky; - sticky = x; - stickies = null; - return treemap; - }; - treemap.ratio = function(x) { - if (!arguments.length) return ratio; - ratio = x; - return treemap; - }; - treemap.mode = function(x) { - if (!arguments.length) return mode; - mode = x + ""; - return treemap; - }; - return d3_layout_hierarchyRebind(treemap, hierarchy); - }; - function d3_layout_treemapPadNull(node) { - return { - x: node.x, - y: node.y, - dx: node.dx, - dy: node.dy - }; - } - function d3_layout_treemapPad(node, padding) { - var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2]; - if (dx < 0) { - x += dx / 2; - dx = 0; - } - if (dy < 0) { - y += dy / 2; - dy = 0; - } - return { - x: x, - y: y, - dx: dx, - dy: dy - }; - } - d3.random = { - normal: function(µ, σ) { - var n = arguments.length; - if (n < 2) σ = 1; - if (n < 1) µ = 0; - return function() { - var x, y, r; - do { - x = Math.random() * 2 - 1; - y = Math.random() * 2 - 1; - r = x * x + y * y; - } while (!r || r > 1); - return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r); - }; - }, - logNormal: function() { - var random = d3.random.normal.apply(d3, arguments); - return function() { - return Math.exp(random()); - }; - }, - bates: function(m) { - var random = d3.random.irwinHall(m); - return function() { - return random() / m; - }; - }, - irwinHall: function(m) { - return function() { - for (var s = 0, j = 0; j < m; j++) s += Math.random(); - return s; - }; - } - }; - d3.scale = {}; - function d3_scaleExtent(domain) { - var start = domain[0], stop = domain[domain.length - 1]; - return start < stop ? [ start, stop ] : [ stop, start ]; - } - function d3_scaleRange(scale) { - return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range()); - } - function d3_scale_bilinear(domain, range, uninterpolate, interpolate) { - var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]); - return function(x) { - return i(u(x)); - }; - } - function d3_scale_nice(domain, nice) { - var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx; - if (x1 < x0) { - dx = i0, i0 = i1, i1 = dx; - dx = x0, x0 = x1, x1 = dx; - } - domain[i0] = nice.floor(x0); - domain[i1] = nice.ceil(x1); - return domain; - } - function d3_scale_niceStep(step) { - return step ? { - floor: function(x) { - return Math.floor(x / step) * step; - }, - ceil: function(x) { - return Math.ceil(x / step) * step; - } - } : d3_scale_niceIdentity; - } - var d3_scale_niceIdentity = { - floor: d3_identity, - ceil: d3_identity - }; - function d3_scale_polylinear(domain, range, uninterpolate, interpolate) { - var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1; - if (domain[k] < domain[0]) { - domain = domain.slice().reverse(); - range = range.slice().reverse(); - } - while (++j <= k) { - u.push(uninterpolate(domain[j - 1], domain[j])); - i.push(interpolate(range[j - 1], range[j])); - } - return function(x) { - var j = d3.bisect(domain, x, 1, k) - 1; - return i[j](u[j](x)); - }; - } - d3.scale.linear = function() { - return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false); - }; - function d3_scale_linear(domain, range, interpolate, clamp) { - var output, input; - function rescale() { - var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber; - output = linear(domain, range, uninterpolate, interpolate); - input = linear(range, domain, uninterpolate, d3_interpolate); - return scale; - } - function scale(x) { - return output(x); - } - scale.invert = function(y) { - return input(y); - }; - scale.domain = function(x) { - if (!arguments.length) return domain; - domain = x.map(Number); - return rescale(); - }; - scale.range = function(x) { - if (!arguments.length) return range; - range = x; - return rescale(); - }; - scale.rangeRound = function(x) { - return scale.range(x).interpolate(d3_interpolateRound); - }; - scale.clamp = function(x) { - if (!arguments.length) return clamp; - clamp = x; - return rescale(); - }; - scale.interpolate = function(x) { - if (!arguments.length) return interpolate; - interpolate = x; - return rescale(); - }; - scale.ticks = function(m) { - return d3_scale_linearTicks(domain, m); - }; - scale.tickFormat = function(m, format) { - return d3_scale_linearTickFormat(domain, m, format); - }; - scale.nice = function(m) { - d3_scale_linearNice(domain, m); - return rescale(); - }; - scale.copy = function() { - return d3_scale_linear(domain, range, interpolate, clamp); - }; - return rescale(); - } - function d3_scale_linearRebind(scale, linear) { - return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp"); - } - function d3_scale_linearNice(domain, m) { - d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2])); - d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2])); - return domain; - } - function d3_scale_linearTickRange(domain, m) { - if (m == null) m = 10; - var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step; - if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2; - extent[0] = Math.ceil(extent[0] / step) * step; - extent[1] = Math.floor(extent[1] / step) * step + step * .5; - extent[2] = step; - return extent; - } - function d3_scale_linearTicks(domain, m) { - return d3.range.apply(d3, d3_scale_linearTickRange(domain, m)); - } - function d3_scale_linearTickFormat(domain, m, format) { - var range = d3_scale_linearTickRange(domain, m); - if (format) { - var match = d3_format_re.exec(format); - match.shift(); - if (match[8] === "s") { - var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1]))); - if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2])); - match[8] = "f"; - format = d3.format(match.join("")); - return function(d) { - return format(prefix.scale(d)) + prefix.symbol; - }; - } - if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range); - format = match.join(""); - } else { - format = ",." + d3_scale_linearPrecision(range[2]) + "f"; - } - return d3.format(format); - } - var d3_scale_linearFormatSignificant = { - s: 1, - g: 1, - p: 1, - r: 1, - e: 1 - }; - function d3_scale_linearPrecision(value) { - return -Math.floor(Math.log(value) / Math.LN10 + .01); - } - function d3_scale_linearFormatPrecision(type, range) { - var p = d3_scale_linearPrecision(range[2]); - return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2; - } - d3.scale.log = function() { - return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]); - }; - function d3_scale_log(linear, base, positive, domain) { - function log(x) { - return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base); - } - function pow(x) { - return positive ? Math.pow(base, x) : -Math.pow(base, -x); - } - function scale(x) { - return linear(log(x)); - } - scale.invert = function(x) { - return pow(linear.invert(x)); - }; - scale.domain = function(x) { - if (!arguments.length) return domain; - positive = x[0] >= 0; - linear.domain((domain = x.map(Number)).map(log)); - return scale; - }; - scale.base = function(_) { - if (!arguments.length) return base; - base = +_; - linear.domain(domain.map(log)); - return scale; - }; - scale.nice = function() { - var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative); - linear.domain(niced); - domain = niced.map(pow); - return scale; - }; - scale.ticks = function() { - var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base; - if (isFinite(j - i)) { - if (positive) { - for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k); - ticks.push(pow(i)); - } else { - ticks.push(pow(i)); - for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k); - } - for (i = 0; ticks[i] < u; i++) {} - for (j = ticks.length; ticks[j - 1] > v; j--) {} - ticks = ticks.slice(i, j); - } - return ticks; - }; - scale.tickFormat = function(n, format) { - if (!arguments.length) return d3_scale_logFormat; - if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format); - var k = Math.max(1, base * n / scale.ticks().length); - return function(d) { - var i = d / pow(Math.round(log(d))); - if (i * base < base - .5) i *= base; - return i <= k ? format(d) : ""; - }; - }; - scale.copy = function() { - return d3_scale_log(linear.copy(), base, positive, domain); - }; - return d3_scale_linearRebind(scale, linear); - } - var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = { - floor: function(x) { - return -Math.ceil(-x); - }, - ceil: function(x) { - return -Math.floor(-x); - } - }; - d3.scale.pow = function() { - return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]); - }; - function d3_scale_pow(linear, exponent, domain) { - var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent); - function scale(x) { - return linear(powp(x)); - } - scale.invert = function(x) { - return powb(linear.invert(x)); - }; - scale.domain = function(x) { - if (!arguments.length) return domain; - linear.domain((domain = x.map(Number)).map(powp)); - return scale; - }; - scale.ticks = function(m) { - return d3_scale_linearTicks(domain, m); - }; - scale.tickFormat = function(m, format) { - return d3_scale_linearTickFormat(domain, m, format); - }; - scale.nice = function(m) { - return scale.domain(d3_scale_linearNice(domain, m)); - }; - scale.exponent = function(x) { - if (!arguments.length) return exponent; - powp = d3_scale_powPow(exponent = x); - powb = d3_scale_powPow(1 / exponent); - linear.domain(domain.map(powp)); - return scale; - }; - scale.copy = function() { - return d3_scale_pow(linear.copy(), exponent, domain); - }; - return d3_scale_linearRebind(scale, linear); - } - function d3_scale_powPow(e) { - return function(x) { - return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e); - }; - } - d3.scale.sqrt = function() { - return d3.scale.pow().exponent(.5); - }; - d3.scale.ordinal = function() { - return d3_scale_ordinal([], { - t: "range", - a: [ [] ] - }); - }; - function d3_scale_ordinal(domain, ranger) { - var index, range, rangeBand; - function scale(x) { - return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length]; - } - function steps(start, step) { - return d3.range(domain.length).map(function(i) { - return start + step * i; - }); - } - scale.domain = function(x) { - if (!arguments.length) return domain; - domain = []; - index = new d3_Map(); - var i = -1, n = x.length, xi; - while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi)); - return scale[ranger.t].apply(scale, ranger.a); - }; - scale.range = function(x) { - if (!arguments.length) return range; - range = x; - rangeBand = 0; - ranger = { - t: "range", - a: arguments - }; - return scale; - }; - scale.rangePoints = function(x, padding) { - if (arguments.length < 2) padding = 0; - var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2, - 0) : (stop - start) / (domain.length - 1 + padding); - range = steps(start + step * padding / 2, step); - rangeBand = 0; - ranger = { - t: "rangePoints", - a: arguments - }; - return scale; - }; - scale.rangeRoundPoints = function(x, padding) { - if (arguments.length < 2) padding = 0; - var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2), - 0) : (stop - start) / (domain.length - 1 + padding) | 0; - range = steps(start + Math.round(step * padding / 2 + (stop - start - (domain.length - 1 + padding) * step) / 2), step); - rangeBand = 0; - ranger = { - t: "rangeRoundPoints", - a: arguments - }; - return scale; - }; - scale.rangeBands = function(x, padding, outerPadding) { - if (arguments.length < 2) padding = 0; - if (arguments.length < 3) outerPadding = padding; - var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding); - range = steps(start + step * outerPadding, step); - if (reverse) range.reverse(); - rangeBand = step * (1 - padding); - ranger = { - t: "rangeBands", - a: arguments - }; - return scale; - }; - scale.rangeRoundBands = function(x, padding, outerPadding) { - if (arguments.length < 2) padding = 0; - if (arguments.length < 3) outerPadding = padding; - var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding)); - range = steps(start + Math.round((stop - start - (domain.length - padding) * step) / 2), step); - if (reverse) range.reverse(); - rangeBand = Math.round(step * (1 - padding)); - ranger = { - t: "rangeRoundBands", - a: arguments - }; - return scale; - }; - scale.rangeBand = function() { - return rangeBand; - }; - scale.rangeExtent = function() { - return d3_scaleExtent(ranger.a[0]); - }; - scale.copy = function() { - return d3_scale_ordinal(domain, ranger); - }; - return scale.domain(domain); - } - d3.scale.category10 = function() { - return d3.scale.ordinal().range(d3_category10); - }; - d3.scale.category20 = function() { - return d3.scale.ordinal().range(d3_category20); - }; - d3.scale.category20b = function() { - return d3.scale.ordinal().range(d3_category20b); - }; - d3.scale.category20c = function() { - return d3.scale.ordinal().range(d3_category20c); - }; - var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString); - var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString); - var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString); - var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString); - d3.scale.quantile = function() { - return d3_scale_quantile([], []); - }; - function d3_scale_quantile(domain, range) { - var thresholds; - function rescale() { - var k = 0, q = range.length; - thresholds = []; - while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q); - return scale; - } - function scale(x) { - if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)]; - } - scale.domain = function(x) { - if (!arguments.length) return domain; - domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending); - return rescale(); - }; - scale.range = function(x) { - if (!arguments.length) return range; - range = x; - return rescale(); - }; - scale.quantiles = function() { - return thresholds; - }; - scale.invertExtent = function(y) { - y = range.indexOf(y); - return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ]; - }; - scale.copy = function() { - return d3_scale_quantile(domain, range); - }; - return rescale(); - } - d3.scale.quantize = function() { - return d3_scale_quantize(0, 1, [ 0, 1 ]); - }; - function d3_scale_quantize(x0, x1, range) { - var kx, i; - function scale(x) { - return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))]; - } - function rescale() { - kx = range.length / (x1 - x0); - i = range.length - 1; - return scale; - } - scale.domain = function(x) { - if (!arguments.length) return [ x0, x1 ]; - x0 = +x[0]; - x1 = +x[x.length - 1]; - return rescale(); - }; - scale.range = function(x) { - if (!arguments.length) return range; - range = x; - return rescale(); - }; - scale.invertExtent = function(y) { - y = range.indexOf(y); - y = y < 0 ? NaN : y / kx + x0; - return [ y, y + 1 / kx ]; - }; - scale.copy = function() { - return d3_scale_quantize(x0, x1, range); - }; - return rescale(); - } - d3.scale.threshold = function() { - return d3_scale_threshold([ .5 ], [ 0, 1 ]); - }; - function d3_scale_threshold(domain, range) { - function scale(x) { - if (x <= x) return range[d3.bisect(domain, x)]; - } - scale.domain = function(_) { - if (!arguments.length) return domain; - domain = _; - return scale; - }; - scale.range = function(_) { - if (!arguments.length) return range; - range = _; - return scale; - }; - scale.invertExtent = function(y) { - y = range.indexOf(y); - return [ domain[y - 1], domain[y] ]; - }; - scale.copy = function() { - return d3_scale_threshold(domain, range); - }; - return scale; - } - d3.scale.identity = function() { - return d3_scale_identity([ 0, 1 ]); - }; - function d3_scale_identity(domain) { - function identity(x) { - return +x; - } - identity.invert = identity; - identity.domain = identity.range = function(x) { - if (!arguments.length) return domain; - domain = x.map(identity); - return identity; - }; - identity.ticks = function(m) { - return d3_scale_linearTicks(domain, m); - }; - identity.tickFormat = function(m, format) { - return d3_scale_linearTickFormat(domain, m, format); - }; - identity.copy = function() { - return d3_scale_identity(domain); - }; - return identity; - } - d3.svg = {}; - function d3_zero() { - return 0; - } - d3.svg.arc = function() { - var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, cornerRadius = d3_zero, padRadius = d3_svg_arcAuto, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle, padAngle = d3_svg_arcPadAngle; - function arc() { - var r0 = Math.max(0, +innerRadius.apply(this, arguments)), r1 = Math.max(0, +outerRadius.apply(this, arguments)), a0 = startAngle.apply(this, arguments) - halfπ, a1 = endAngle.apply(this, arguments) - halfπ, da = Math.abs(a1 - a0), cw = a0 > a1 ? 0 : 1; - if (r1 < r0) rc = r1, r1 = r0, r0 = rc; - if (da >= τε) return circleSegment(r1, cw) + (r0 ? circleSegment(r0, 1 - cw) : "") + "Z"; - var rc, cr, rp, ap, p0 = 0, p1 = 0, x0, y0, x1, y1, x2, y2, x3, y3, path = []; - if (ap = (+padAngle.apply(this, arguments) || 0) / 2) { - rp = padRadius === d3_svg_arcAuto ? Math.sqrt(r0 * r0 + r1 * r1) : +padRadius.apply(this, arguments); - if (!cw) p1 *= -1; - if (r1) p1 = d3_asin(rp / r1 * Math.sin(ap)); - if (r0) p0 = d3_asin(rp / r0 * Math.sin(ap)); - } - if (r1) { - x0 = r1 * Math.cos(a0 + p1); - y0 = r1 * Math.sin(a0 + p1); - x1 = r1 * Math.cos(a1 - p1); - y1 = r1 * Math.sin(a1 - p1); - var l1 = Math.abs(a1 - a0 - 2 * p1) <= π ? 0 : 1; - if (p1 && d3_svg_arcSweep(x0, y0, x1, y1) === cw ^ l1) { - var h1 = (a0 + a1) / 2; - x0 = r1 * Math.cos(h1); - y0 = r1 * Math.sin(h1); - x1 = y1 = null; - } - } else { - x0 = y0 = 0; - } - if (r0) { - x2 = r0 * Math.cos(a1 - p0); - y2 = r0 * Math.sin(a1 - p0); - x3 = r0 * Math.cos(a0 + p0); - y3 = r0 * Math.sin(a0 + p0); - var l0 = Math.abs(a0 - a1 + 2 * p0) <= π ? 0 : 1; - if (p0 && d3_svg_arcSweep(x2, y2, x3, y3) === 1 - cw ^ l0) { - var h0 = (a0 + a1) / 2; - x2 = r0 * Math.cos(h0); - y2 = r0 * Math.sin(h0); - x3 = y3 = null; - } - } else { - x2 = y2 = 0; - } - if (da > ε && (rc = Math.min(Math.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments))) > .001) { - cr = r0 < r1 ^ cw ? 0 : 1; - var rc1 = rc, rc0 = rc; - if (da < π) { - var oc = x3 == null ? [ x2, y2 ] : x1 == null ? [ x0, y0 ] : d3_geom_polygonIntersect([ x0, y0 ], [ x3, y3 ], [ x1, y1 ], [ x2, y2 ]), ax = x0 - oc[0], ay = y0 - oc[1], bx = x1 - oc[0], by = y1 - oc[1], kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2), lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]); - rc0 = Math.min(rc, (r0 - lc) / (kc - 1)); - rc1 = Math.min(rc, (r1 - lc) / (kc + 1)); - } - if (x1 != null) { - var t30 = d3_svg_arcCornerTangents(x3 == null ? [ x2, y2 ] : [ x3, y3 ], [ x0, y0 ], r1, rc1, cw), t12 = d3_svg_arcCornerTangents([ x1, y1 ], [ x2, y2 ], r1, rc1, cw); - if (rc === rc1) { - path.push("M", t30[0], "A", rc1, ",", rc1, " 0 0,", cr, " ", t30[1], "A", r1, ",", r1, " 0 ", 1 - cw ^ d3_svg_arcSweep(t30[1][0], t30[1][1], t12[1][0], t12[1][1]), ",", cw, " ", t12[1], "A", rc1, ",", rc1, " 0 0,", cr, " ", t12[0]); - } else { - path.push("M", t30[0], "A", rc1, ",", rc1, " 0 1,", cr, " ", t12[0]); - } - } else { - path.push("M", x0, ",", y0); - } - if (x3 != null) { - var t03 = d3_svg_arcCornerTangents([ x0, y0 ], [ x3, y3 ], r0, -rc0, cw), t21 = d3_svg_arcCornerTangents([ x2, y2 ], x1 == null ? [ x0, y0 ] : [ x1, y1 ], r0, -rc0, cw); - if (rc === rc0) { - path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t21[1], "A", r0, ",", r0, " 0 ", cw ^ d3_svg_arcSweep(t21[1][0], t21[1][1], t03[1][0], t03[1][1]), ",", 1 - cw, " ", t03[1], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]); - } else { - path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]); - } - } else { - path.push("L", x2, ",", y2); - } - } else { - path.push("M", x0, ",", y0); - if (x1 != null) path.push("A", r1, ",", r1, " 0 ", l1, ",", cw, " ", x1, ",", y1); - path.push("L", x2, ",", y2); - if (x3 != null) path.push("A", r0, ",", r0, " 0 ", l0, ",", 1 - cw, " ", x3, ",", y3); - } - path.push("Z"); - return path.join(""); - } - function circleSegment(r1, cw) { - return "M0," + r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + -r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + r1; - } - arc.innerRadius = function(v) { - if (!arguments.length) return innerRadius; - innerRadius = d3_functor(v); - return arc; - }; - arc.outerRadius = function(v) { - if (!arguments.length) return outerRadius; - outerRadius = d3_functor(v); - return arc; - }; - arc.cornerRadius = function(v) { - if (!arguments.length) return cornerRadius; - cornerRadius = d3_functor(v); - return arc; - }; - arc.padRadius = function(v) { - if (!arguments.length) return padRadius; - padRadius = v == d3_svg_arcAuto ? d3_svg_arcAuto : d3_functor(v); - return arc; - }; - arc.startAngle = function(v) { - if (!arguments.length) return startAngle; - startAngle = d3_functor(v); - return arc; - }; - arc.endAngle = function(v) { - if (!arguments.length) return endAngle; - endAngle = d3_functor(v); - return arc; - }; - arc.padAngle = function(v) { - if (!arguments.length) return padAngle; - padAngle = d3_functor(v); - return arc; - }; - arc.centroid = function() { - var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - halfπ; - return [ Math.cos(a) * r, Math.sin(a) * r ]; - }; - return arc; - }; - var d3_svg_arcAuto = "auto"; - function d3_svg_arcInnerRadius(d) { - return d.innerRadius; - } - function d3_svg_arcOuterRadius(d) { - return d.outerRadius; - } - function d3_svg_arcStartAngle(d) { - return d.startAngle; - } - function d3_svg_arcEndAngle(d) { - return d.endAngle; - } - function d3_svg_arcPadAngle(d) { - return d && d.padAngle; - } - function d3_svg_arcSweep(x0, y0, x1, y1) { - return (x0 - x1) * y0 - (y0 - y1) * x0 > 0 ? 0 : 1; - } - function d3_svg_arcCornerTangents(p0, p1, r1, rc, cw) { - var x01 = p0[0] - p1[0], y01 = p0[1] - p1[1], lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x1 = p0[0] + ox, y1 = p0[1] + oy, x2 = p1[0] + ox, y2 = p1[1] + oy, x3 = (x1 + x2) / 2, y3 = (y1 + y2) / 2, dx = x2 - x1, dy = y2 - y1, d2 = dx * dx + dy * dy, r = r1 - rc, D = x1 * y2 - x2 * y1, d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x3, dy0 = cy0 - y3, dx1 = cx1 - x3, dy1 = cy1 - y3; - if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1; - return [ [ cx0 - ox, cy0 - oy ], [ cx0 * r1 / r, cy0 * r1 / r ] ]; - } - function d3_svg_line(projection) { - var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7; - function line(data) { - var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y); - function segment() { - segments.push("M", interpolate(projection(points), tension)); - } - while (++i < n) { - if (defined.call(this, d = data[i], i)) { - points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]); - } else if (points.length) { - segment(); - points = []; - } - } - if (points.length) segment(); - return segments.length ? segments.join("") : null; - } - line.x = function(_) { - if (!arguments.length) return x; - x = _; - return line; - }; - line.y = function(_) { - if (!arguments.length) return y; - y = _; - return line; - }; - line.defined = function(_) { - if (!arguments.length) return defined; - defined = _; - return line; - }; - line.interpolate = function(_) { - if (!arguments.length) return interpolateKey; - if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; - return line; - }; - line.tension = function(_) { - if (!arguments.length) return tension; - tension = _; - return line; - }; - return line; - } - d3.svg.line = function() { - return d3_svg_line(d3_identity); - }; - var d3_svg_lineInterpolators = d3.map({ - linear: d3_svg_lineLinear, - "linear-closed": d3_svg_lineLinearClosed, - step: d3_svg_lineStep, - "step-before": d3_svg_lineStepBefore, - "step-after": d3_svg_lineStepAfter, - basis: d3_svg_lineBasis, - "basis-open": d3_svg_lineBasisOpen, - "basis-closed": d3_svg_lineBasisClosed, - bundle: d3_svg_lineBundle, - cardinal: d3_svg_lineCardinal, - "cardinal-open": d3_svg_lineCardinalOpen, - "cardinal-closed": d3_svg_lineCardinalClosed, - monotone: d3_svg_lineMonotone - }); - d3_svg_lineInterpolators.forEach(function(key, value) { - value.key = key; - value.closed = /-closed$/.test(key); - }); - function d3_svg_lineLinear(points) { - return points.length > 1 ? points.join("L") : points + "Z"; - } - function d3_svg_lineLinearClosed(points) { - return points.join("L") + "Z"; - } - function d3_svg_lineStep(points) { - var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; - while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]); - if (n > 1) path.push("H", p[0]); - return path.join(""); - } - function d3_svg_lineStepBefore(points) { - var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; - while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]); - return path.join(""); - } - function d3_svg_lineStepAfter(points) { - var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; - while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]); - return path.join(""); - } - function d3_svg_lineCardinalOpen(points, tension) { - return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, -1), d3_svg_lineCardinalTangents(points, tension)); - } - function d3_svg_lineCardinalClosed(points, tension) { - return points.length < 3 ? d3_svg_lineLinearClosed(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), - points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension)); - } - function d3_svg_lineCardinal(points, tension) { - return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension)); - } - function d3_svg_lineHermite(points, tangents) { - if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) { - return d3_svg_lineLinear(points); - } - var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1; - if (quad) { - path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1]; - p0 = points[1]; - pi = 2; - } - if (tangents.length > 1) { - t = tangents[1]; - p = points[pi]; - pi++; - path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; - for (var i = 2; i < tangents.length; i++, pi++) { - p = points[pi]; - t = tangents[i]; - path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; - } - } - if (quad) { - var lp = points[pi]; - path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1]; - } - return path; - } - function d3_svg_lineCardinalTangents(points, tension) { - var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length; - while (++i < n) { - p0 = p1; - p1 = p2; - p2 = points[i]; - tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]); - } - return tangents; - } - function d3_svg_lineBasis(points) { - if (points.length < 3) return d3_svg_lineLinear(points); - var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; - points.push(points[n - 1]); - while (++i <= n) { - pi = points[i]; - px.shift(); - px.push(pi[0]); - py.shift(); - py.push(pi[1]); - d3_svg_lineBasisBezier(path, px, py); - } - points.pop(); - path.push("L", pi); - return path.join(""); - } - function d3_svg_lineBasisOpen(points) { - if (points.length < 4) return d3_svg_lineLinear(points); - var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ]; - while (++i < 3) { - pi = points[i]; - px.push(pi[0]); - py.push(pi[1]); - } - path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py)); - --i; - while (++i < n) { - pi = points[i]; - px.shift(); - px.push(pi[0]); - py.shift(); - py.push(pi[1]); - d3_svg_lineBasisBezier(path, px, py); - } - return path.join(""); - } - function d3_svg_lineBasisClosed(points) { - var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = []; - while (++i < 4) { - pi = points[i % n]; - px.push(pi[0]); - py.push(pi[1]); - } - path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; - --i; - while (++i < m) { - pi = points[i % n]; - px.shift(); - px.push(pi[0]); - py.shift(); - py.push(pi[1]); - d3_svg_lineBasisBezier(path, px, py); - } - return path.join(""); - } - function d3_svg_lineBundle(points, tension) { - var n = points.length - 1; - if (n) { - var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t; - while (++i <= n) { - p = points[i]; - t = i / n; - p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx); - p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy); - } - } - return d3_svg_lineBasis(points); - } - function d3_svg_lineDot4(a, b) { - return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; - } - var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ]; - function d3_svg_lineBasisBezier(path, x, y) { - path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y)); - } - function d3_svg_lineSlope(p0, p1) { - return (p1[1] - p0[1]) / (p1[0] - p0[0]); - } - function d3_svg_lineFiniteDifferences(points) { - var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1); - while (++i < j) { - m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2; - } - m[i] = d; - return m; - } - function d3_svg_lineMonotoneTangents(points) { - var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1; - while (++i < j) { - d = d3_svg_lineSlope(points[i], points[i + 1]); - if (abs(d) < ε) { - m[i] = m[i + 1] = 0; - } else { - a = m[i] / d; - b = m[i + 1] / d; - s = a * a + b * b; - if (s > 9) { - s = d * 3 / Math.sqrt(s); - m[i] = s * a; - m[i + 1] = s * b; - } - } - } - i = -1; - while (++i <= j) { - s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i])); - tangents.push([ s || 0, m[i] * s || 0 ]); - } - return tangents; - } - function d3_svg_lineMonotone(points) { - return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points)); - } - d3.svg.line.radial = function() { - var line = d3_svg_line(d3_svg_lineRadial); - line.radius = line.x, delete line.x; - line.angle = line.y, delete line.y; - return line; - }; - function d3_svg_lineRadial(points) { - var point, i = -1, n = points.length, r, a; - while (++i < n) { - point = points[i]; - r = point[0]; - a = point[1] - halfπ; - point[0] = r * Math.cos(a); - point[1] = r * Math.sin(a); - } - return points; - } - function d3_svg_area(projection) { - var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7; - function area(data) { - var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() { - return x; - } : d3_functor(x1), fy1 = y0 === y1 ? function() { - return y; - } : d3_functor(y1), x, y; - function segment() { - segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z"); - } - while (++i < n) { - if (defined.call(this, d = data[i], i)) { - points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]); - points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]); - } else if (points0.length) { - segment(); - points0 = []; - points1 = []; - } - } - if (points0.length) segment(); - return segments.length ? segments.join("") : null; - } - area.x = function(_) { - if (!arguments.length) return x1; - x0 = x1 = _; - return area; - }; - area.x0 = function(_) { - if (!arguments.length) return x0; - x0 = _; - return area; - }; - area.x1 = function(_) { - if (!arguments.length) return x1; - x1 = _; - return area; - }; - area.y = function(_) { - if (!arguments.length) return y1; - y0 = y1 = _; - return area; - }; - area.y0 = function(_) { - if (!arguments.length) return y0; - y0 = _; - return area; - }; - area.y1 = function(_) { - if (!arguments.length) return y1; - y1 = _; - return area; - }; - area.defined = function(_) { - if (!arguments.length) return defined; - defined = _; - return area; - }; - area.interpolate = function(_) { - if (!arguments.length) return interpolateKey; - if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; - interpolateReverse = interpolate.reverse || interpolate; - L = interpolate.closed ? "M" : "L"; - return area; - }; - area.tension = function(_) { - if (!arguments.length) return tension; - tension = _; - return area; - }; - return area; - } - d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter; - d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore; - d3.svg.area = function() { - return d3_svg_area(d3_identity); - }; - d3.svg.area.radial = function() { - var area = d3_svg_area(d3_svg_lineRadial); - area.radius = area.x, delete area.x; - area.innerRadius = area.x0, delete area.x0; - area.outerRadius = area.x1, delete area.x1; - area.angle = area.y, delete area.y; - area.startAngle = area.y0, delete area.y0; - area.endAngle = area.y1, delete area.y1; - return area; - }; - d3.svg.chord = function() { - var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle; - function chord(d, i) { - var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i); - return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z"; - } - function subgroup(self, f, d, i) { - var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) - halfπ, a1 = endAngle.call(self, subgroup, i) - halfπ; - return { - r: r, - a0: a0, - a1: a1, - p0: [ r * Math.cos(a0), r * Math.sin(a0) ], - p1: [ r * Math.cos(a1), r * Math.sin(a1) ] - }; - } - function equals(a, b) { - return a.a0 == b.a0 && a.a1 == b.a1; - } - function arc(r, p, a) { - return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p; - } - function curve(r0, p0, r1, p1) { - return "Q 0,0 " + p1; - } - chord.radius = function(v) { - if (!arguments.length) return radius; - radius = d3_functor(v); - return chord; - }; - chord.source = function(v) { - if (!arguments.length) return source; - source = d3_functor(v); - return chord; - }; - chord.target = function(v) { - if (!arguments.length) return target; - target = d3_functor(v); - return chord; - }; - chord.startAngle = function(v) { - if (!arguments.length) return startAngle; - startAngle = d3_functor(v); - return chord; - }; - chord.endAngle = function(v) { - if (!arguments.length) return endAngle; - endAngle = d3_functor(v); - return chord; - }; - return chord; - }; - function d3_svg_chordRadius(d) { - return d.radius; - } - d3.svg.diagonal = function() { - var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection; - function diagonal(d, i) { - var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, { - x: p0.x, - y: m - }, { - x: p3.x, - y: m - }, p3 ]; - p = p.map(projection); - return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3]; - } - diagonal.source = function(x) { - if (!arguments.length) return source; - source = d3_functor(x); - return diagonal; - }; - diagonal.target = function(x) { - if (!arguments.length) return target; - target = d3_functor(x); - return diagonal; - }; - diagonal.projection = function(x) { - if (!arguments.length) return projection; - projection = x; - return diagonal; - }; - return diagonal; - }; - function d3_svg_diagonalProjection(d) { - return [ d.x, d.y ]; - } - d3.svg.diagonal.radial = function() { - var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection; - diagonal.projection = function(x) { - return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection; - }; - return diagonal; - }; - function d3_svg_diagonalRadialProjection(projection) { - return function() { - var d = projection.apply(this, arguments), r = d[0], a = d[1] - halfπ; - return [ r * Math.cos(a), r * Math.sin(a) ]; - }; - } - d3.svg.symbol = function() { - var type = d3_svg_symbolType, size = d3_svg_symbolSize; - function symbol(d, i) { - return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i)); - } - symbol.type = function(x) { - if (!arguments.length) return type; - type = d3_functor(x); - return symbol; - }; - symbol.size = function(x) { - if (!arguments.length) return size; - size = d3_functor(x); - return symbol; - }; - return symbol; - }; - function d3_svg_symbolSize() { - return 64; - } - function d3_svg_symbolType() { - return "circle"; - } - function d3_svg_symbolCircle(size) { - var r = Math.sqrt(size / π); - return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z"; - } - var d3_svg_symbols = d3.map({ - circle: d3_svg_symbolCircle, - cross: function(size) { - var r = Math.sqrt(size / 5) / 2; - return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z"; - }, - diamond: function(size) { - var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30; - return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z"; - }, - square: function(size) { - var r = Math.sqrt(size) / 2; - return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z"; - }, - "triangle-down": function(size) { - var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; - return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z"; - }, - "triangle-up": function(size) { - var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; - return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z"; - } - }); - d3.svg.symbolTypes = d3_svg_symbols.keys(); - var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians); - d3_selectionPrototype.transition = function(name) { - var id = d3_transitionInheritId || ++d3_transitionId, ns = d3_transitionNamespace(name), subgroups = [], subgroup, node, transition = d3_transitionInherit || { - time: Date.now(), - ease: d3_ease_cubicInOut, - delay: 0, - duration: 250 - }; - for (var j = -1, m = this.length; ++j < m; ) { - subgroups.push(subgroup = []); - for (var group = this[j], i = -1, n = group.length; ++i < n; ) { - if (node = group[i]) d3_transitionNode(node, i, ns, id, transition); - subgroup.push(node); - } - } - return d3_transition(subgroups, ns, id); - }; - d3_selectionPrototype.interrupt = function(name) { - return this.each(name == null ? d3_selection_interrupt : d3_selection_interruptNS(d3_transitionNamespace(name))); - }; - var d3_selection_interrupt = d3_selection_interruptNS(d3_transitionNamespace()); - function d3_selection_interruptNS(ns) { - return function() { - var lock, activeId, active; - if ((lock = this[ns]) && (active = lock[activeId = lock.active])) { - active.timer.c = null; - active.timer.t = NaN; - if (--lock.count) delete lock[activeId]; else delete this[ns]; - lock.active += .5; - active.event && active.event.interrupt.call(this, this.__data__, active.index); - } - }; - } - function d3_transition(groups, ns, id) { - d3_subclass(groups, d3_transitionPrototype); - groups.namespace = ns; - groups.id = id; - return groups; - } - var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit; - d3_transitionPrototype.call = d3_selectionPrototype.call; - d3_transitionPrototype.empty = d3_selectionPrototype.empty; - d3_transitionPrototype.node = d3_selectionPrototype.node; - d3_transitionPrototype.size = d3_selectionPrototype.size; - d3.transition = function(selection, name) { - return selection && selection.transition ? d3_transitionInheritId ? selection.transition(name) : selection : d3.selection().transition(selection); - }; - d3.transition.prototype = d3_transitionPrototype; - d3_transitionPrototype.select = function(selector) { - var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnode, node; - selector = d3_selection_selector(selector); - for (var j = -1, m = this.length; ++j < m; ) { - subgroups.push(subgroup = []); - for (var group = this[j], i = -1, n = group.length; ++i < n; ) { - if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - d3_transitionNode(subnode, i, ns, id, node[ns][id]); - subgroup.push(subnode); - } else { - subgroup.push(null); - } - } - } - return d3_transition(subgroups, ns, id); - }; - d3_transitionPrototype.selectAll = function(selector) { - var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnodes, node, subnode, transition; - selector = d3_selection_selectorAll(selector); - for (var j = -1, m = this.length; ++j < m; ) { - for (var group = this[j], i = -1, n = group.length; ++i < n; ) { - if (node = group[i]) { - transition = node[ns][id]; - subnodes = selector.call(node, node.__data__, i, j); - subgroups.push(subgroup = []); - for (var k = -1, o = subnodes.length; ++k < o; ) { - if (subnode = subnodes[k]) d3_transitionNode(subnode, k, ns, id, transition); - subgroup.push(subnode); - } - } - } - } - return d3_transition(subgroups, ns, id); - }; - d3_transitionPrototype.filter = function(filter) { - var subgroups = [], subgroup, group, node; - if (typeof filter !== "function") filter = d3_selection_filter(filter); - for (var j = 0, m = this.length; j < m; j++) { - subgroups.push(subgroup = []); - for (var group = this[j], i = 0, n = group.length; i < n; i++) { - if ((node = group[i]) && filter.call(node, node.__data__, i, j)) { - subgroup.push(node); - } - } - } - return d3_transition(subgroups, this.namespace, this.id); - }; - d3_transitionPrototype.tween = function(name, tween) { - var id = this.id, ns = this.namespace; - if (arguments.length < 2) return this.node()[ns][id].tween.get(name); - return d3_selection_each(this, tween == null ? function(node) { - node[ns][id].tween.remove(name); - } : function(node) { - node[ns][id].tween.set(name, tween); - }); - }; - function d3_transition_tween(groups, name, value, tween) { - var id = groups.id, ns = groups.namespace; - return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) { - node[ns][id].tween.set(name, tween(value.call(node, node.__data__, i, j))); - } : (value = tween(value), function(node) { - node[ns][id].tween.set(name, value); - })); - } - d3_transitionPrototype.attr = function(nameNS, value) { - if (arguments.length < 2) { - for (value in nameNS) this.attr(value, nameNS[value]); - return this; - } - var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS); - function attrNull() { - this.removeAttribute(name); - } - function attrNullNS() { - this.removeAttributeNS(name.space, name.local); - } - function attrTween(b) { - return b == null ? attrNull : (b += "", function() { - var a = this.getAttribute(name), i; - return a !== b && (i = interpolate(a, b), function(t) { - this.setAttribute(name, i(t)); - }); - }); - } - function attrTweenNS(b) { - return b == null ? attrNullNS : (b += "", function() { - var a = this.getAttributeNS(name.space, name.local), i; - return a !== b && (i = interpolate(a, b), function(t) { - this.setAttributeNS(name.space, name.local, i(t)); - }); - }); - } - return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween); - }; - d3_transitionPrototype.attrTween = function(nameNS, tween) { - var name = d3.ns.qualify(nameNS); - function attrTween(d, i) { - var f = tween.call(this, d, i, this.getAttribute(name)); - return f && function(t) { - this.setAttribute(name, f(t)); - }; - } - function attrTweenNS(d, i) { - var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local)); - return f && function(t) { - this.setAttributeNS(name.space, name.local, f(t)); - }; - } - return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween); - }; - d3_transitionPrototype.style = function(name, value, priority) { - var n = arguments.length; - if (n < 3) { - if (typeof name !== "string") { - if (n < 2) value = ""; - for (priority in name) this.style(priority, name[priority], value); - return this; - } - priority = ""; - } - function styleNull() { - this.style.removeProperty(name); - } - function styleString(b) { - return b == null ? styleNull : (b += "", function() { - var a = d3_window(this).getComputedStyle(this, null).getPropertyValue(name), i; - return a !== b && (i = d3_interpolate(a, b), function(t) { - this.style.setProperty(name, i(t), priority); - }); - }); - } - return d3_transition_tween(this, "style." + name, value, styleString); - }; - d3_transitionPrototype.styleTween = function(name, tween, priority) { - if (arguments.length < 3) priority = ""; - function styleTween(d, i) { - var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name)); - return f && function(t) { - this.style.setProperty(name, f(t), priority); - }; - } - return this.tween("style." + name, styleTween); - }; - d3_transitionPrototype.text = function(value) { - return d3_transition_tween(this, "text", value, d3_transition_text); - }; - function d3_transition_text(b) { - if (b == null) b = ""; - return function() { - this.textContent = b; - }; - } - d3_transitionPrototype.remove = function() { - var ns = this.namespace; - return this.each("end.transition", function() { - var p; - if (this[ns].count < 2 && (p = this.parentNode)) p.removeChild(this); - }); - }; - d3_transitionPrototype.ease = function(value) { - var id = this.id, ns = this.namespace; - if (arguments.length < 1) return this.node()[ns][id].ease; - if (typeof value !== "function") value = d3.ease.apply(d3, arguments); - return d3_selection_each(this, function(node) { - node[ns][id].ease = value; - }); - }; - d3_transitionPrototype.delay = function(value) { - var id = this.id, ns = this.namespace; - if (arguments.length < 1) return this.node()[ns][id].delay; - return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { - node[ns][id].delay = +value.call(node, node.__data__, i, j); - } : (value = +value, function(node) { - node[ns][id].delay = value; - })); - }; - d3_transitionPrototype.duration = function(value) { - var id = this.id, ns = this.namespace; - if (arguments.length < 1) return this.node()[ns][id].duration; - return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { - node[ns][id].duration = Math.max(1, value.call(node, node.__data__, i, j)); - } : (value = Math.max(1, value), function(node) { - node[ns][id].duration = value; - })); - }; - d3_transitionPrototype.each = function(type, listener) { - var id = this.id, ns = this.namespace; - if (arguments.length < 2) { - var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId; - try { - d3_transitionInheritId = id; - d3_selection_each(this, function(node, i, j) { - d3_transitionInherit = node[ns][id]; - type.call(node, node.__data__, i, j); - }); - } finally { - d3_transitionInherit = inherit; - d3_transitionInheritId = inheritId; - } - } else { - d3_selection_each(this, function(node) { - var transition = node[ns][id]; - (transition.event || (transition.event = d3.dispatch("start", "end", "interrupt"))).on(type, listener); - }); - } - return this; - }; - d3_transitionPrototype.transition = function() { - var id0 = this.id, id1 = ++d3_transitionId, ns = this.namespace, subgroups = [], subgroup, group, node, transition; - for (var j = 0, m = this.length; j < m; j++) { - subgroups.push(subgroup = []); - for (var group = this[j], i = 0, n = group.length; i < n; i++) { - if (node = group[i]) { - transition = node[ns][id0]; - d3_transitionNode(node, i, ns, id1, { - time: transition.time, - ease: transition.ease, - delay: transition.delay + transition.duration, - duration: transition.duration - }); - } - subgroup.push(node); - } - } - return d3_transition(subgroups, ns, id1); - }; - function d3_transitionNamespace(name) { - return name == null ? "__transition__" : "__transition_" + name + "__"; - } - function d3_transitionNode(node, i, ns, id, inherit) { - var lock = node[ns] || (node[ns] = { - active: 0, - count: 0 - }), transition = lock[id], time, timer, duration, ease, tweens; - function schedule(elapsed) { - var delay = transition.delay; - timer.t = delay + time; - if (delay <= elapsed) return start(elapsed - delay); - timer.c = start; - } - function start(elapsed) { - var activeId = lock.active, active = lock[activeId]; - if (active) { - active.timer.c = null; - active.timer.t = NaN; - --lock.count; - delete lock[activeId]; - active.event && active.event.interrupt.call(node, node.__data__, active.index); - } - for (var cancelId in lock) { - if (+cancelId < id) { - var cancel = lock[cancelId]; - cancel.timer.c = null; - cancel.timer.t = NaN; - --lock.count; - delete lock[cancelId]; - } - } - timer.c = tick; - d3_timer(function() { - if (timer.c && tick(elapsed || 1)) { - timer.c = null; - timer.t = NaN; - } - return 1; - }, 0, time); - lock.active = id; - transition.event && transition.event.start.call(node, node.__data__, i); - tweens = []; - transition.tween.forEach(function(key, value) { - if (value = value.call(node, node.__data__, i)) { - tweens.push(value); - } - }); - ease = transition.ease; - duration = transition.duration; - } - function tick(elapsed) { - var t = elapsed / duration, e = ease(t), n = tweens.length; - while (n > 0) { - tweens[--n].call(node, e); - } - if (t >= 1) { - transition.event && transition.event.end.call(node, node.__data__, i); - if (--lock.count) delete lock[id]; else delete node[ns]; - return 1; - } - } - if (!transition) { - time = inherit.time; - timer = d3_timer(schedule, 0, time); - transition = lock[id] = { - tween: new d3_Map(), - time: time, - timer: timer, - delay: inherit.delay, - duration: inherit.duration, - ease: inherit.ease, - index: i - }; - inherit = null; - ++lock.count; - } - } - d3.svg.axis = function() { - var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_; - function axis(g) { - g.each(function() { - var g = d3.select(this); - var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy(); - var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform; - var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), - d3.transition(path)); - tickEnter.append("line"); - tickEnter.append("text"); - var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"), sign = orient === "top" || orient === "left" ? -1 : 1, x1, x2, y1, y2; - if (orient === "bottom" || orient === "top") { - tickTransform = d3_svg_axisX, x1 = "x", y1 = "y", x2 = "x2", y2 = "y2"; - text.attr("dy", sign < 0 ? "0em" : ".71em").style("text-anchor", "middle"); - pathUpdate.attr("d", "M" + range[0] + "," + sign * outerTickSize + "V0H" + range[1] + "V" + sign * outerTickSize); - } else { - tickTransform = d3_svg_axisY, x1 = "y", y1 = "x", x2 = "y2", y2 = "x2"; - text.attr("dy", ".32em").style("text-anchor", sign < 0 ? "end" : "start"); - pathUpdate.attr("d", "M" + sign * outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + sign * outerTickSize); - } - lineEnter.attr(y2, sign * innerTickSize); - textEnter.attr(y1, sign * tickSpacing); - lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize); - textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing); - if (scale1.rangeBand) { - var x = scale1, dx = x.rangeBand() / 2; - scale0 = scale1 = function(d) { - return x(d) + dx; - }; - } else if (scale0.rangeBand) { - scale0 = scale1; - } else { - tickExit.call(tickTransform, scale1, scale0); - } - tickEnter.call(tickTransform, scale0, scale1); - tickUpdate.call(tickTransform, scale1, scale1); - }); - } - axis.scale = function(x) { - if (!arguments.length) return scale; - scale = x; - return axis; - }; - axis.orient = function(x) { - if (!arguments.length) return orient; - orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient; - return axis; - }; - axis.ticks = function() { - if (!arguments.length) return tickArguments_; - tickArguments_ = d3_array(arguments); - return axis; - }; - axis.tickValues = function(x) { - if (!arguments.length) return tickValues; - tickValues = x; - return axis; - }; - axis.tickFormat = function(x) { - if (!arguments.length) return tickFormat_; - tickFormat_ = x; - return axis; - }; - axis.tickSize = function(x) { - var n = arguments.length; - if (!n) return innerTickSize; - innerTickSize = +x; - outerTickSize = +arguments[n - 1]; - return axis; - }; - axis.innerTickSize = function(x) { - if (!arguments.length) return innerTickSize; - innerTickSize = +x; - return axis; - }; - axis.outerTickSize = function(x) { - if (!arguments.length) return outerTickSize; - outerTickSize = +x; - return axis; - }; - axis.tickPadding = function(x) { - if (!arguments.length) return tickPadding; - tickPadding = +x; - return axis; - }; - axis.tickSubdivide = function() { - return arguments.length && axis; - }; - return axis; - }; - var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = { - top: 1, - right: 1, - bottom: 1, - left: 1 - }; - function d3_svg_axisX(selection, x0, x1) { - selection.attr("transform", function(d) { - var v0 = x0(d); - return "translate(" + (isFinite(v0) ? v0 : x1(d)) + ",0)"; - }); - } - function d3_svg_axisY(selection, y0, y1) { - selection.attr("transform", function(d) { - var v0 = y0(d); - return "translate(0," + (isFinite(v0) ? v0 : y1(d)) + ")"; - }); - } - d3.svg.brush = function() { - var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0]; - function brush(g) { - g.each(function() { - var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart); - var background = g.selectAll(".background").data([ 0 ]); - background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"); - g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move"); - var resize = g.selectAll(".resize").data(resizes, d3_identity); - resize.exit().remove(); - resize.enter().append("g").attr("class", function(d) { - return "resize " + d; - }).style("cursor", function(d) { - return d3_svg_brushCursor[d]; - }).append("rect").attr("x", function(d) { - return /[ew]$/.test(d) ? -3 : null; - }).attr("y", function(d) { - return /^[ns]/.test(d) ? -3 : null; - }).attr("width", 6).attr("height", 6).style("visibility", "hidden"); - resize.style("display", brush.empty() ? "none" : null); - var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range; - if (x) { - range = d3_scaleRange(x); - backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]); - redrawX(gUpdate); - } - if (y) { - range = d3_scaleRange(y); - backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]); - redrawY(gUpdate); - } - redraw(gUpdate); - }); - } - brush.event = function(g) { - g.each(function() { - var event_ = event.of(this, arguments), extent1 = { - x: xExtent, - y: yExtent, - i: xExtentDomain, - j: yExtentDomain - }, extent0 = this.__chart__ || extent1; - this.__chart__ = extent1; - if (d3_transitionInheritId) { - d3.select(this).transition().each("start.brush", function() { - xExtentDomain = extent0.i; - yExtentDomain = extent0.j; - xExtent = extent0.x; - yExtent = extent0.y; - event_({ - type: "brushstart" - }); - }).tween("brush:brush", function() { - var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y); - xExtentDomain = yExtentDomain = null; - return function(t) { - xExtent = extent1.x = xi(t); - yExtent = extent1.y = yi(t); - event_({ - type: "brush", - mode: "resize" - }); - }; - }).each("end.brush", function() { - xExtentDomain = extent1.i; - yExtentDomain = extent1.j; - event_({ - type: "brush", - mode: "resize" - }); - event_({ - type: "brushend" - }); - }); - } else { - event_({ - type: "brushstart" - }); - event_({ - type: "brush", - mode: "resize" - }); - event_({ - type: "brushend" - }); - } - }); - }; - function redraw(g) { - g.selectAll(".resize").attr("transform", function(d) { - return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")"; - }); - } - function redrawX(g) { - g.select(".extent").attr("x", xExtent[0]); - g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]); - } - function redrawY(g) { - g.select(".extent").attr("y", yExtent[0]); - g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]); - } - function brushstart() { - var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(target), center, origin = d3.mouse(target), offset; - var w = d3.select(d3_window(target)).on("keydown.brush", keydown).on("keyup.brush", keyup); - if (d3.event.changedTouches) { - w.on("touchmove.brush", brushmove).on("touchend.brush", brushend); - } else { - w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend); - } - g.interrupt().selectAll("*").interrupt(); - if (dragging) { - origin[0] = xExtent[0] - origin[0]; - origin[1] = yExtent[0] - origin[1]; - } else if (resizing) { - var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing); - offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ]; - origin[0] = xExtent[ex]; - origin[1] = yExtent[ey]; - } else if (d3.event.altKey) center = origin.slice(); - g.style("pointer-events", "none").selectAll(".resize").style("display", null); - d3.select("body").style("cursor", eventTarget.style("cursor")); - event_({ - type: "brushstart" - }); - brushmove(); - function keydown() { - if (d3.event.keyCode == 32) { - if (!dragging) { - center = null; - origin[0] -= xExtent[1]; - origin[1] -= yExtent[1]; - dragging = 2; - } - d3_eventPreventDefault(); - } - } - function keyup() { - if (d3.event.keyCode == 32 && dragging == 2) { - origin[0] += xExtent[1]; - origin[1] += yExtent[1]; - dragging = 0; - d3_eventPreventDefault(); - } - } - function brushmove() { - var point = d3.mouse(target), moved = false; - if (offset) { - point[0] += offset[0]; - point[1] += offset[1]; - } - if (!dragging) { - if (d3.event.altKey) { - if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ]; - origin[0] = xExtent[+(point[0] < center[0])]; - origin[1] = yExtent[+(point[1] < center[1])]; - } else center = null; - } - if (resizingX && move1(point, x, 0)) { - redrawX(g); - moved = true; - } - if (resizingY && move1(point, y, 1)) { - redrawY(g); - moved = true; - } - if (moved) { - redraw(g); - event_({ - type: "brush", - mode: dragging ? "move" : "resize" - }); - } - } - function move1(point, scale, i) { - var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max; - if (dragging) { - r0 -= position; - r1 -= size + position; - } - min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i]; - if (dragging) { - max = (min += position) + size; - } else { - if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min)); - if (position < min) { - max = min; - min = position; - } else { - max = position; - } - } - if (extent[0] != min || extent[1] != max) { - if (i) yExtentDomain = null; else xExtentDomain = null; - extent[0] = min; - extent[1] = max; - return true; - } - } - function brushend() { - brushmove(); - g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null); - d3.select("body").style("cursor", null); - w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null); - dragRestore(); - event_({ - type: "brushend" - }); - } - } - brush.x = function(z) { - if (!arguments.length) return x; - x = z; - resizes = d3_svg_brushResizes[!x << 1 | !y]; - return brush; - }; - brush.y = function(z) { - if (!arguments.length) return y; - y = z; - resizes = d3_svg_brushResizes[!x << 1 | !y]; - return brush; - }; - brush.clamp = function(z) { - if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null; - if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z; - return brush; - }; - brush.extent = function(z) { - var x0, x1, y0, y1, t; - if (!arguments.length) { - if (x) { - if (xExtentDomain) { - x0 = xExtentDomain[0], x1 = xExtentDomain[1]; - } else { - x0 = xExtent[0], x1 = xExtent[1]; - if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1); - if (x1 < x0) t = x0, x0 = x1, x1 = t; - } - } - if (y) { - if (yExtentDomain) { - y0 = yExtentDomain[0], y1 = yExtentDomain[1]; - } else { - y0 = yExtent[0], y1 = yExtent[1]; - if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1); - if (y1 < y0) t = y0, y0 = y1, y1 = t; - } - } - return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ]; - } - if (x) { - x0 = z[0], x1 = z[1]; - if (y) x0 = x0[0], x1 = x1[0]; - xExtentDomain = [ x0, x1 ]; - if (x.invert) x0 = x(x0), x1 = x(x1); - if (x1 < x0) t = x0, x0 = x1, x1 = t; - if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ]; - } - if (y) { - y0 = z[0], y1 = z[1]; - if (x) y0 = y0[1], y1 = y1[1]; - yExtentDomain = [ y0, y1 ]; - if (y.invert) y0 = y(y0), y1 = y(y1); - if (y1 < y0) t = y0, y0 = y1, y1 = t; - if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ]; - } - return brush; - }; - brush.clear = function() { - if (!brush.empty()) { - xExtent = [ 0, 0 ], yExtent = [ 0, 0 ]; - xExtentDomain = yExtentDomain = null; - } - return brush; - }; - brush.empty = function() { - return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1]; - }; - return d3.rebind(brush, event, "on"); - }; - var d3_svg_brushCursor = { - n: "ns-resize", - e: "ew-resize", - s: "ns-resize", - w: "ew-resize", - nw: "nwse-resize", - ne: "nesw-resize", - se: "nwse-resize", - sw: "nesw-resize" - }; - var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ]; - var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat; - var d3_time_formatUtc = d3_time_format.utc; - var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ"); - d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso; - function d3_time_formatIsoNative(date) { - return date.toISOString(); - } - d3_time_formatIsoNative.parse = function(string) { - var date = new Date(string); - return isNaN(date) ? null : date; - }; - d3_time_formatIsoNative.toString = d3_time_formatIso.toString; - d3_time.second = d3_time_interval(function(date) { - return new d3_date(Math.floor(date / 1e3) * 1e3); - }, function(date, offset) { - date.setTime(date.getTime() + Math.floor(offset) * 1e3); - }, function(date) { - return date.getSeconds(); - }); - d3_time.seconds = d3_time.second.range; - d3_time.seconds.utc = d3_time.second.utc.range; - d3_time.minute = d3_time_interval(function(date) { - return new d3_date(Math.floor(date / 6e4) * 6e4); - }, function(date, offset) { - date.setTime(date.getTime() + Math.floor(offset) * 6e4); - }, function(date) { - return date.getMinutes(); - }); - d3_time.minutes = d3_time.minute.range; - d3_time.minutes.utc = d3_time.minute.utc.range; - d3_time.hour = d3_time_interval(function(date) { - var timezone = date.getTimezoneOffset() / 60; - return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5); - }, function(date, offset) { - date.setTime(date.getTime() + Math.floor(offset) * 36e5); - }, function(date) { - return date.getHours(); - }); - d3_time.hours = d3_time.hour.range; - d3_time.hours.utc = d3_time.hour.utc.range; - d3_time.month = d3_time_interval(function(date) { - date = d3_time.day(date); - date.setDate(1); - return date; - }, function(date, offset) { - date.setMonth(date.getMonth() + offset); - }, function(date) { - return date.getMonth(); - }); - d3_time.months = d3_time.month.range; - d3_time.months.utc = d3_time.month.utc.range; - function d3_time_scale(linear, methods, format) { - function scale(x) { - return linear(x); - } - scale.invert = function(x) { - return d3_time_scaleDate(linear.invert(x)); - }; - scale.domain = function(x) { - if (!arguments.length) return linear.domain().map(d3_time_scaleDate); - linear.domain(x); - return scale; - }; - function tickMethod(extent, count) { - var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target); - return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) { - return d / 31536e6; - }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i]; - } - scale.nice = function(interval, skip) { - var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval); - if (method) interval = method[0], skip = method[1]; - function skipped(date) { - return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length; - } - return scale.domain(d3_scale_nice(domain, skip > 1 ? { - floor: function(date) { - while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1); - return date; - }, - ceil: function(date) { - while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1); - return date; - } - } : interval)); - }; - scale.ticks = function(interval, skip) { - var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ { - range: interval - }, skip ]; - if (method) interval = method[0], skip = method[1]; - return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip); - }; - scale.tickFormat = function() { - return format; - }; - scale.copy = function() { - return d3_time_scale(linear.copy(), methods, format); - }; - return d3_scale_linearRebind(scale, linear); - } - function d3_time_scaleDate(t) { - return new Date(t); - } - var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ]; - var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ]; - var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) { - return d.getMilliseconds(); - } ], [ ":%S", function(d) { - return d.getSeconds(); - } ], [ "%I:%M", function(d) { - return d.getMinutes(); - } ], [ "%I %p", function(d) { - return d.getHours(); - } ], [ "%a %d", function(d) { - return d.getDay() && d.getDate() != 1; - } ], [ "%b %d", function(d) { - return d.getDate() != 1; - } ], [ "%B", function(d) { - return d.getMonth(); - } ], [ "%Y", d3_true ] ]); - var d3_time_scaleMilliseconds = { - range: function(start, stop, step) { - return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate); - }, - floor: d3_identity, - ceil: d3_identity - }; - d3_time_scaleLocalMethods.year = d3_time.year; - d3_time.scale = function() { - return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat); - }; - var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) { - return [ m[0].utc, m[1] ]; - }); - var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) { - return d.getUTCMilliseconds(); - } ], [ ":%S", function(d) { - return d.getUTCSeconds(); - } ], [ "%I:%M", function(d) { - return d.getUTCMinutes(); - } ], [ "%I %p", function(d) { - return d.getUTCHours(); - } ], [ "%a %d", function(d) { - return d.getUTCDay() && d.getUTCDate() != 1; - } ], [ "%b %d", function(d) { - return d.getUTCDate() != 1; - } ], [ "%B", function(d) { - return d.getUTCMonth(); - } ], [ "%Y", d3_true ] ]); - d3_time_scaleUtcMethods.year = d3_time.year.utc; - d3_time.scale.utc = function() { - return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat); - }; - d3.text = d3_xhrType(function(request) { - return request.responseText; - }); - d3.json = function(url, callback) { - return d3_xhr(url, "application/json", d3_json, callback); - }; - function d3_json(request) { - return JSON.parse(request.responseText); - } - d3.html = function(url, callback) { - return d3_xhr(url, "text/html", d3_html, callback); - }; - function d3_html(request) { - var range = d3_document.createRange(); - range.selectNode(d3_document.body); - return range.createContextualFragment(request.responseText); - } - d3.xml = d3_xhrType(function(request) { - return request.responseXML; - }); - if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3; -}(); \ No newline at end of file diff --git a/pagure/static/d3/d3.v3.min.js b/pagure/static/d3/d3.v3.min.js deleted file mode 100644 index 1664873..0000000 --- a/pagure/static/d3/d3.v3.min.js +++ /dev/null @@ -1,5 +0,0 @@ -!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function i(n){return!isNaN(n)}function u(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function f(n){return(n+="")===bo||n[0]===_o?_o+n:n}function s(n){return(n+="")[0]===_o?n.slice(1):n}function h(n){return f(n)in this._}function p(n){return(n=f(n))in this._&&delete this._[n]}function g(){var n=[];for(var t in this._)n.push(s(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function y(){this._=Object.create(null)}function m(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=wo.length;r>e;++e){var i=wo[e]+t;if(i in n)return i}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,i=-1,u=r.length;++ie;e++)for(var i,u=n[e],o=0,a=u.length;a>o;o++)(i=u[o])&&t(i,o,e);return n}function Z(n){return ko(n,qo),n}function V(n){var t,e;return function(r,i,u){var o,a=n[u].update,l=a.length;for(u!=e&&(e=u,t=0),i>=t&&(t=i+1);!(o=a[t])&&++t0&&(n=n.slice(0,a));var c=To.get(n);return c&&(n=c,l=B),a?t?i:r:t?b:u}function $(n,t){return function(e){var r=ao.event;ao.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ao.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Do,i="click"+r,u=ao.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ro&&(Ro="onselectstart"in e?!1:x(e.style,"userSelect")),Ro){var o=n(e).style,a=o[Ro];o[Ro]="none"}return function(n){if(u.on(r,null),Ro&&(o[Ro]=a),n){var t=function(){u.on(i,null)};u.on(i,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Po){var u=t(n);if(u.scrollX||u.scrollY){r=ao.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Po=!(o.f||o.e),r.remove()}}return Po?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ao.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?Fo:Math.acos(n)}function tn(n){return n>1?Io:-1>n?-Io:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function on(n){return(n=Math.sin(n/2))*n}function an(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?u+(o-u)*n/60:180>n?o:240>n?u+(o-u)*(240-n)/60:u}function i(n){return Math.round(255*r(n))}var u,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,u=2*e-o,new mn(i(n+120),i(n),i(n-120))}function fn(n,t,e){return this instanceof fn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof fn?new fn(n.h,n.c,n.l):n instanceof hn?gn(n.l,n.a,n.b):gn((n=Sn((n=ao.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new fn(n,t,e)}function sn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Yo)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof fn?sn(n.h,n.c,n.l):Sn((n=mn(n)).r,n.g,n.b):new hn(n,t,e)}function pn(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return i=vn(i)*na,r=vn(r)*ta,u=vn(u)*ea,new mn(yn(3.2404542*i-1.5371385*r-.4985314*u),yn(-.969266*i+1.8760108*r+.041556*u),yn(.0556434*i-.2040259*r+1.0572252*u))}function gn(n,t,e){return n>0?new fn(Math.atan2(e,t)*Zo,Math.sqrt(t*t+e*e),n):new fn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function yn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mn(n,t,e){return this instanceof mn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mn?new mn(n.r,n.g,n.b):_n(""+n,mn,cn):new mn(n,t,e)}function Mn(n){return new mn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(Nn(i[0]),Nn(i[1]),Nn(i[2]))}return(u=ua.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o=o>>4|o,a=240&u,a=a>>4|a,l=15&u,l=l<<4|l):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function wn(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=.5>l?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=NaN,i=l>0&&1>l?0:r),new ln(r,i,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/na),i=dn((.2126729*n+.7151522*t+.072175*e)/ta),u=dn((.0193339*n+.119192*t+.9503041*e)/ea);return hn(116*i-16,500*(r-i),200*(i-u))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function i(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(u,l)}catch(r){return void o.error.call(u,r)}o.load.call(u,n)}else o.error.call(u,l)}var u={},o=ao.dispatch("beforesend","progress","load","error"),a={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(n){var t=ao.event;ao.event=n;try{o.progress.call(u,l)}finally{ao.event=t}},u.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",u)},u.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",u):t},u.responseType=function(n){return arguments.length?(c=n,u):c},u.response=function(n){return e=n,u},["get","post"].forEach(function(n){u[n]=function(){return u.send.apply(u,[n].concat(co(arguments)))}}),u.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),l.setRequestHeader)for(var f in a)l.setRequestHeader(f,a[f]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=i&&u.on("error",i).on("load",function(n){i(null,n)}),o.beforesend.call(u,l),l.send(null==r?null:r),u},u.abort=function(){return l.abort(),u},ao.rebind(u,o,"on"),null==r?u:u.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var i=e+t,u={c:n,t:i,n:null};return aa?aa.n=u:oa=u,aa=u,la||(ca=clearTimeout(ca),la=1,fa(Tn)),u}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(ca),ca=setTimeout(Tn,t)),la=0):(la=1,fa(Tn))}function Rn(){for(var n=Date.now(),t=oa;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=oa,e=1/0;t;)t.c?(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}}function jn(n){var t=n.decimal,e=n.thousands,r=n.grouping,i=n.currency,u=r&&e?function(n,t){for(var i=n.length,u=[],o=0,a=r[0],l=0;i>0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),u.push(n.substring(i-=a,i+a)),!((l+=a+1)>t));)a=r[o=(o+1)%r.length];return u.reverse().join(e)}:m;return function(n){var e=ha.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",l=e[4]||"",c=e[5],f=+e[6],s=e[7],h=e[8],p=e[9],g=1,v="",d="",y=!1,m=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===o)&&(c=r="0",o="="),p){case"n":s=!0,p="g";break;case"%":g=100,d="%",p="f";break;case"p":g=100,d="%",p="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+p.toLowerCase());case"c":m=!1;case"d":y=!0,h=0;break;case"s":g=-1,p="r"}"$"===l&&(v=i[0],d=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):"e"!=p&&"f"!=p||(h=Math.max(0,Math.min(20,h)))),p=pa.get(p)||Fn;var M=c&&s;return function(n){var e=d;if(y&&n%1)return"";var i=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>g){var l=ao.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=g;n=p(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=m?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&s&&(x=u(x,1/0));var S=v.length+x.length+b.length+(M?0:i.length),k=f>S?new Array(S=f-S+1).join(r):"";return M&&(x=u(k+x,k.length?f-b.length:1/0)),i+=v,n=x+b,("<"===o?i+n+k:">"===o?k+i+n:"^"===o?k.substring(0,S>>=1)+i+n+k.substring(S):i+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=u(e,1);return r-t>t-e?e:r}function i(e){return t(e=n(new va(e-1)),1),e}function u(n,e){return t(n=new va(+n),e),n}function o(n,r,u){var o=i(n),a=[];if(u>1)for(;r>o;)e(o)%u||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{va=Hn;var r=new Hn;return r._=n,o(r,t,e)}finally{va=Date}}n.floor=n,n.round=r,n.ceil=i,n.offset=u,n.range=o;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(i),l.offset=In(u),l.range=a,n}function In(n){return function(t,e){try{va=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{va=Date}}}function Yn(n){function t(n){function t(t){for(var e,i,u,o=[],a=-1,l=0;++aa;){if(r>=c)return-1;if(i=t.charCodeAt(a++),37===i){if(o=t.charAt(a++),u=C[o in ya?t.charAt(a++):o],!u||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function f(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var s=n.dateTime,h=n.date,p=n.time,g=n.periods,v=n.days,d=n.shortDays,y=n.months,m=n.shortMonths;t.utc=function(n){function e(n){try{va=Hn;var t=new va;return t._=n,r(t)}finally{va=Date}}var r=t(n);return e.parse=function(n){try{va=Hn;var t=r.parse(n);return t&&t._}finally{va=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=ao.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(y),k=Xn(y),N=Vn(m),E=Xn(m);g.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return m[n.getMonth()]},B:function(n){return y[n.getMonth()]},c:t(s),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ga.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return g[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ga.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ga.mondayOfYear(n),t,2)},x:t(h),X:t(p),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:at,"%":function(){return"%"}},C={a:r,A:i,b:u,B:o,c:a,d:tt,e:tt,H:rt,I:rt,j:et,L:ot,m:nt,M:it,p:f,S:ut,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",i=(r?-n:n)+"",u=i.length;return r+(e>u?new Array(e-u+1).join(t)+i:i)}function Vn(n){return new RegExp("^(?:"+n.map(ao.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e68?1900:2e3)}function nt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function it(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ut(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ot(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function at(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=xo(t)/60|0,i=xo(t)%60;return e+Zn(r,"0",2)+Zn(i,"0",2)}function lt(n,t,e){Ma.lastIndex=0;var r=Ma.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e=0?1:-1,a=o*e,l=Math.cos(t),c=Math.sin(t),f=u*c,s=i*l+f*Math.cos(a),h=f*o*Math.sin(a);ka.add(Math.atan2(h,s)),r=n,i=l,u=c}var t,e,r,i,u;Na.point=function(o,a){Na.point=n,r=(t=o)*Yo,i=Math.cos(a=(e=a)*Yo/2+Fo/4),u=Math.sin(a)},Na.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function yt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function mt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return xo(n[0]-t[0])a;++a)i.point((e=n[a])[0],e[1]);return void i.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,u.push(l),o.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,u.push(l),o.push(c)}}),o.sort(t),qt(u),qt(o),u.length){for(var a=0,l=e,c=o.length;c>a;++a)o[a].e=l=!l;for(var f,s,h=u[0];;){for(var p=h,g=!0;p.v;)if((p=p.n)===h)return;f=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(g)for(var a=0,c=f.length;c>a;++a)i.point((s=f[a])[0],s[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(g){f=p.p.z;for(var a=f.length-1;a>=0;--a)i.point((s=f[a])[0],s[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,f=p.z,g=!g}while(!p.v);i.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r0){for(b||(u.polygonStart(),b=!0),u.lineStart();++o1&&2&t&&e.push(e.pop().concat(e.shift())),p.push(e.filter(Dt))}var p,g,v,d=t(u),y=i.invert(r[0],r[1]),m={point:o,lineStart:l,lineEnd:c,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=h,p=[],g=[]},polygonEnd:function(){m.point=o,m.lineStart=l,m.lineEnd=c,p=ao.merge(p);var n=Ot(y,g);p.length?(b||(u.polygonStart(),b=!0),Lt(p,Ut,n,e,u)):n&&(b||(u.polygonStart(),b=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),b&&(u.polygonEnd(),b=!1),p=g=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}},M=Pt(),x=t(M),b=!1;return m}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Ut(n,t){return((n=n.x)[0]<0?n[1]-Io-Uo:Io-n[1])-((t=t.x)[0]<0?t[1]-Io-Uo:Io-t[1])}function jt(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?Fo:-Fo,l=xo(u-e);xo(l-Fo)0?Io:-Io),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&l>=Fo&&(xo(e-i)Uo?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}function Ht(n,t,e,r){var i;if(null==n)i=e*Io,r.point(-Fo,i),r.point(0,i),r.point(Fo,i),r.point(Fo,0),r.point(Fo,-i),r.point(0,-i),r.point(-Fo,-i),r.point(-Fo,0),r.point(-Fo,i);else if(xo(n[0]-t[0])>Uo){var u=n[0]a;++a){var c=t[a],f=c.length;if(f)for(var s=c[0],h=s[0],p=s[1]/2+Fo/4,g=Math.sin(p),v=Math.cos(p),d=1;;){d===f&&(d=0),n=c[d];var y=n[0],m=n[1]/2+Fo/4,M=Math.sin(m),x=Math.cos(m),b=y-h,_=b>=0?1:-1,w=_*b,S=w>Fo,k=g*M;if(ka.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Ho:b,S^h>=e^y>=e){var N=mt(dt(s),dt(n));bt(N);var E=mt(i,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(-Uo>u||Uo>u&&-Uo>ka)^1&o}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>u}function e(n){var e,u,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=t(s,h),d=o?v?0:i(s,h):v?i(s+(0>s?Fo:-Fo),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(p=r(e,g),(wt(e,p)||wt(g,p))&&(g[0]+=Uo,g[1]+=Uo,v=t(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=r(g,e),n.point(p[0],p[1])):(p=r(e,g),n.point(p[0],p[1]),n.lineEnd()),e=p;else if(a&&e&&o^v){var y;d&u||!(y=r(g,e,!0))||(f=0,o?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||e&&wt(e,g)||n.point(g[0],g[1]),e=g,l=v,u=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return f|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),i=dt(t),o=[1,0,0],a=mt(r,i),l=yt(a,a),c=a[0],f=l-c*c;if(!f)return!e&&n;var s=u*l/f,h=-u*c/f,p=mt(o,a),g=xt(o,s),v=xt(a,h);Mt(g,v);var d=p,y=yt(g,d),m=yt(d,d),M=y*y-m*(yt(g,g)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-y-x)/m);if(Mt(b,g),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=xo(E-Fo)E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(xo(b[0]-w)Fo^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-y+x)/m);return Mt(z,g),[b,_t(z)]}}}function i(t,e){var r=o?n:Fo-n,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Math.cos(n),o=u>0,a=xo(u)>Uo,l=ve(n,6*Yo);return Rt(t,e,l,o?[0,-n]:[-Fo,n-Fo])}function Yt(n,t,e,r){return function(i){var u,o=i.a,a=i.b,l=o.x,c=o.y,f=a.x,s=a.y,h=0,p=1,g=f-l,v=s-c;if(u=n-l,g||!(u>0)){if(u/=g,0>g){if(h>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>h&&(h=u)}if(u=e-l,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>h&&(h=u)}else if(g>0){if(h>u)return;p>u&&(p=u)}if(u=t-c,v||!(u>0)){if(u/=v,0>v){if(h>u)return;p>u&&(p=u)}else if(v>0){if(u>p)return;u>h&&(h=u)}if(u=r-c,v||!(0>u)){if(u/=v,0>v){if(u>p)return;u>h&&(h=u)}else if(v>0){if(h>u)return;p>u&&(p=u)}return h>0&&(i.a={x:l+h*g,y:c+h*v}),1>p&&(i.b={x:l+p*g,y:c+p*v}),i}}}}}}function Zt(n,t,e,r){function i(r,i){return xo(r[0]-n)0?0:3:xo(r[0]-e)0?2:1:xo(r[1]-t)0?1:0:i>0?3:2}function u(n,t){return o(n.x,t.x)}function o(n,t){var e=i(n,1),r=i(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function l(n){for(var t=0,e=d.length,r=n[1],i=0;e>i;++i)for(var u,o=1,a=d[i],l=a.length,c=a[0];l>o;++o)u=a[o],c[1]<=r?u[1]>r&&Q(c,u,n)>0&&++t:u[1]<=r&&Q(c,u,n)<0&&--t,c=u;return 0!==t}function c(u,a,l,c){var f=0,s=0;if(null==u||(f=i(u,l))!==(s=i(a,l))||o(u,a)<0^l>0){do c.point(0===f||3===f?n:e,f>1?r:t);while((f=(f+l+4)%4)!==s)}else c.point(a[0],a[1])}function f(i,u){return i>=n&&e>=i&&u>=t&&r>=u}function s(n,t){f(n,t)&&a.point(n,t)}function h(){C.point=g,d&&d.push(y=[]),S=!0,w=!1,b=_=NaN}function p(){v&&(g(m,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=s,w&&a.lineEnd()}function g(n,t){n=Math.max(-Ha,Math.min(Ha,n)),t=Math.max(-Ha,Math.min(Ha,t));var e=f(n,t);if(d&&y.push([n,t]),S)m=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,y,m,M,x,b,_,w,S,k,N=a,E=Pt(),A=Yt(n,t,e,r),C={point:s,lineStart:h,lineEnd:p,polygonStart:function(){a=E,v=[],d=[],k=!0},polygonEnd:function(){a=N,v=ao.merge(v);var t=l([n,r]),e=k&&t,i=v.length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),c(null,null,1,a),a.lineEnd()),i&&Lt(v,u,t,c,a),a.polygonEnd()),v=d=y=null}};return C}}function Vt(n){var t=0,e=Fo/3,r=ae(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*Fo/180,e=n[1]*Fo/180):[t/Fo*180,e/Fo*180]},i}function Xt(n,t){function e(n,t){var e=Math.sqrt(u-2*i*Math.sin(t))/i;return[e*Math.sin(n*=i),o-e*Math.cos(n)]}var r=Math.sin(n),i=(r+Math.sin(t))/2,u=1+r*(2*i-r),o=Math.sqrt(u)/i;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/i,tn((u-(n*n+e*e)*i*i)/(2*i))]},e}function $t(){function n(n,t){Ia+=i*n-r*t,r=n,i=t}var t,e,r,i;$a.point=function(u,o){$a.point=n,t=r=u,e=i=o},$a.lineEnd=function(){n(t,e)}}function Bt(n,t){Ya>n&&(Ya=n),n>Va&&(Va=n),Za>t&&(Za=t),t>Xa&&(Xa=t)}function Wt(){function n(n,t){o.push("M",n,",",t,u)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function i(){o.push("Z")}var u=Jt(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return u=Jt(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ca+=n,za+=t,++La}function Kt(){function n(n,r){var i=n-t,u=r-e,o=Math.sqrt(i*i+u*u);qa+=o*(t+n)/2,Ta+=o*(e+r)/2,Ra+=o,Gt(t=n,e=r)}var t,e;Wa.point=function(r,i){Wa.point=n,Gt(t=r,e=i)}}function Qt(){Wa.point=Gt}function ne(){function n(n,t){var e=n-r,u=t-i,o=Math.sqrt(e*e+u*u);qa+=o*(r+n)/2,Ta+=o*(i+t)/2,Ra+=o,o=i*n-r*t,Da+=o*(r+n),Pa+=o*(i+t),Ua+=3*o,Gt(r=n,i=t)}var t,e,r,i;Wa.point=function(u,o){Wa.point=n,Gt(t=r=u,e=i=o)},Wa.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,Ho)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function i(){a.point=t}function u(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=i,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function ee(n){function t(n){return(a?r:e)(n)}function e(t){return ue(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=u,t.lineStart()}function u(e,r){var u=dt([e,r]),o=n(e,r);i(M,x,m,b,_,w,M=o[0],x=o[1],m=e,b=u[0],_=u[1],w=u[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function l(){ -r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g=x,v=b,d=_,y=w,S.point=u}function f(){i(M,x,m,b,_,w,p,g,s,v,d,y,a,t),S.lineEnd=o,o()}var s,h,p,g,v,d,y,m,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function i(t,e,r,a,l,c,f,s,h,p,g,v,d,y){var m=f-t,M=s-e,x=m*m+M*M;if(x>4*u&&d--){var b=a+p,_=l+g,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=xo(xo(w)-1)u||xo((m*z+M*L)/x-.5)>.3||o>a*p+l*g+c*v)&&(i(t,e,r,a,l,c,A,C,N,b/=S,_/=S,w,d,y),y.point(A,C),i(A,C,N,b,_,w,f,s,h,p,g,v,d,y))}}var u=.5,o=Math.cos(30*Yo),a=16;return t.precision=function(n){return arguments.length?(a=(u=n*n)>0&&16,t):Math.sqrt(u)},t}function re(n){var t=ee(function(t,e){return n([t*Zo,e*Zo])});return function(n){return le(t(n))}}function ie(n){this.stream=n}function ue(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function oe(n){return ae(function(){return n})()}function ae(n){function t(n){return n=a(n[0]*Yo,n[1]*Yo),[n[0]*h+l,c-n[1]*h]}function e(n){return n=a.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Zo,n[1]*Zo]}function r(){a=Ct(o=se(y,M,x),u);var n=u(v,d);return l=p-n[0]*h,c=g+n[1]*h,i()}function i(){return f&&(f.valid=!1,f=null),t}var u,o,a,l,c,f,s=ee(function(n,t){return n=u(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,p=480,g=250,v=0,d=0,y=0,M=0,x=0,b=Fa,_=m,w=null,S=null;return t.stream=function(n){return f&&(f.valid=!1),f=le(b(o,s(_(n)))),f.valid=!0,f},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Fa):It((w=+n)*Yo),i()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):m,i()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(p=+n[0],g=+n[1],r()):[p,g]},t.center=function(n){return arguments.length?(v=n[0]%360*Yo,d=n[1]%360*Yo,r()):[v*Zo,d*Zo]},t.rotate=function(n){return arguments.length?(y=n[0]%360*Yo,M=n[1]%360*Yo,x=n.length>2?n[2]%360*Yo:0,r()):[y*Zo,M*Zo,x*Zo]},ao.rebind(t,s,"precision"),function(){return u=n.apply(this,arguments),t.invert=u.invert&&e,r()}}function le(n){return ue(n,function(t,e){n.point(t*Yo,e*Yo)})}function ce(n,t){return[n,t]}function fe(n,t){return[n>Fo?n-Ho:-Fo>n?n+Ho:n,t]}function se(n,t,e){return n?t||e?Ct(pe(n),ge(t,e)):pe(n):t||e?ge(t,e):fe}function he(n){return function(t,e){return t+=n,[t>Fo?t-Ho:-Fo>t?t+Ho:t,e]}}function pe(n){var t=he(n);return t.invert=he(-n),t}function ge(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*r+a*i;return[Math.atan2(l*u-f*o,a*r-c*i),tn(f*u+l*o)]}var r=Math.cos(n),i=Math.sin(n),u=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*u-l*o;return[Math.atan2(l*u+c*o,a*r+f*i),tn(f*r-a*i)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=de(e,i),u=de(e,u),(o>0?u>i:i>u)&&(i+=o*Ho)):(i=n+o*Ho,u=n-.5*l);for(var c,f=i;o>0?f>u:u>f;f-=l)a.point((c=_t([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Uo)%(2*Math.PI)}function ye(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function me(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var i=Math.cos(t),u=Math.sin(t),o=Math.cos(r),a=Math.sin(r),l=i*Math.cos(n),c=i*Math.sin(n),f=o*Math.cos(e),s=o*Math.sin(e),h=2*Math.asin(Math.sqrt(on(r-t)+i*o*on(e-n))),p=1/Math.sin(h),g=h?function(n){var t=Math.sin(n*=h)*p,e=Math.sin(h-n)*p,r=e*l+t*f,i=e*c+t*s,o=e*u+t*a;return[Math.atan2(i,r)*Zo,Math.atan2(o,Math.sqrt(r*r+i*i))*Zo]}:function(){return[n*Zo,t*Zo]};return g.distance=h,g}function _e(){function n(n,i){var u=Math.sin(i*=Yo),o=Math.cos(i),a=xo((n*=Yo)-t),l=Math.cos(a);Ja+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*u-e*o*l)*a),e*u+r*o*l),t=n,e=u,r=o}var t,e,r;Ga.point=function(i,u){t=i*Yo,e=Math.sin(u*=Yo),r=Math.cos(u),Ga.point=n},Ga.lineEnd=function(){Ga.point=Ga.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}function Se(n,t){function e(n,t){o>0?-Io+Uo>t&&(t=-Io+Uo):t>Io-Uo&&(t=Io-Uo);var e=o/Math.pow(i(t),u);return[e*Math.sin(u*n),o-e*Math.cos(u*n)]}var r=Math.cos(n),i=function(n){return Math.tan(Fo/4+n/2)},u=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(i(t)/i(n)),o=r*Math.pow(i(n),u)/u;return u?(e.invert=function(n,t){var e=o-t,r=K(u)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/u,2*Math.atan(Math.pow(o/r,1/u))-Io]},e):Ne}function ke(n,t){function e(n,t){var e=u-t;return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}var r=Math.cos(n),i=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),u=r/i+n;return xo(i)i;i++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var i=n[0],u=e[0],o=t[0]-i,a=r[0]-u,l=n[1],c=e[1],f=t[1]-l,s=r[1]-c,h=(a*(l-c)-s*(i-u))/(s*o-a*f);return[i+h*o,l+h*f]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function Ue(n){var t=cl.pop()||new Pe;return t.site=n,t}function je(n){Be(n),ol.remove(n),cl.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,i={x:e,y:r},u=n.P,o=n.N,a=[n];je(n);for(var l=u;l.circle&&xo(e-l.circle.x)f;++f)c=a[f],l=a[f-1],nr(c.edge,l.site,c.site,i);l=a[0],c=a[s-1],c.edge=Ke(l.site,c.site,null,i),$e(l),$e(c)}function He(n){for(var t,e,r,i,u=n.x,o=n.y,a=ol._;a;)if(r=Oe(a,o)-u,r>Uo)a=a.L;else{if(i=u-Ie(a,o),!(i>Uo)){r>-Uo?(t=a.P,e=a):i>-Uo?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=Ue(n);if(ol.insert(t,l),t||e){if(t===e)return Be(t),e=Ue(t.site),ol.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};nr(e.edge,c,g,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,g,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-(1/0);e=o.site;var a=e.x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,i,u,o,a,l,c,f,s=n[0][0],h=n[1][0],p=n[0][1],g=n[1][1],v=ul,d=v.length;d--;)if(u=v[d],u&&u.prepare())for(a=u.edges,l=a.length,o=0;l>o;)f=a[o].end(),r=f.x,i=f.y,c=a[++o%l].start(),t=c.x,e=c.y,(xo(r-t)>Uo||xo(i-e)>Uo)&&(a.splice(o,0,new tr(Qe(u.site,f,xo(r-s)Uo?{x:s,y:xo(t-s)Uo?{x:xo(e-g)Uo?{x:h,y:xo(t-h)Uo?{x:xo(e-p)=-jo)){var p=l*l+c*c,g=f*f+s*s,v=(s*p-c*g)/h,d=(l*g-f*p)/h,s=d+a,y=fl.pop()||new Xe;y.arc=n,y.site=i,y.x=v+o,y.y=s+Math.sqrt(v*v+d*d),y.cy=s,n.circle=y;for(var m=null,M=ll._;M;)if(y.yd||d>=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.yr||r>1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.yp){if(u){if(u.x>=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.xu||s>o||r>h||i>p)){if(g=n.point){var g,v=t-n.x,d=e-n.y,y=v*v+d*d;if(l>y){var m=Math.sqrt(l=y);r=t-m,i=e-m,u=t+m,o=e+m,a=g}}for(var M=n.nodes,x=.5*(f+h),b=.5*(s+p),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,f,s,x,b);break;case 1:c(n,x,s,h,b);break;case 2:c(n,f,b,x,p);break;case 3:c(n,x,b,h,p)}}}(n,r,i,u,o),a}function vr(n,t){n=ao.rgb(n),t=ao.rgb(t);var e=n.r,r=n.g,i=n.b,u=t.r-e,o=t.g-r,a=t.b-i;return function(n){return"#"+bn(Math.round(e+u*n))+bn(Math.round(r+o*n))+bn(Math.round(i+a*n))}}function dr(n,t){var e,r={},i={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):i[e]=n[e];for(e in t)e in n||(i[e]=t[e]);return function(n){for(e in r)i[e]=r[e](n);return i}}function yr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function mr(n,t){var e,r,i,u=hl.lastIndex=pl.lastIndex=0,o=-1,a=[],l=[];for(n+="",t+="";(e=hl.exec(n))&&(r=pl.exec(t));)(i=r.index)>u&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:yr(e,r)})),u=pl.lastIndex;return ur;++r)a[(e=l[r]).i]=e.x(n);return a.join("")})}function Mr(n,t){for(var e,r=ao.interpolators.length;--r>=0&&!(e=ao.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(Mr(n[e],t[e]));for(;u>e;++e)i[e]=n[e];for(;o>e;++e)i[e]=t[e];return function(n){for(e=0;a>e;++e)i[e]=r[e](n);return i}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Io)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Ho*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Ho/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=ao.hcl(n),t=ao.hcl(t);var e=n.h,r=n.c,i=n.l,u=t.h-e,o=t.c-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return sn(e+u*n,r+o*n,i+a*n)+""}}function Dr(n,t){n=ao.hsl(n),t=ao.hsl(t);var e=n.h,r=n.s,i=n.l,u=t.h-e,o=t.s-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return cn(e+u*n,r+o*n,i+a*n)+""}}function Pr(n,t){n=ao.lab(n),t=ao.lab(t);var e=n.l,r=n.a,i=n.b,u=t.l-e,o=t.a-r,a=t.b-i;return function(n){return pn(e+u*n,r+o*n,i+a*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function jr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),i=Fr(t,e),u=Hr(Or(e,t,-i))||0;t[0]*e[1]180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:yr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:yr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=ao.transform(n),t=ao.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,i=-1,u=r.length;++i=0;)e.push(i[r])}function oi(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++oe;++e)(t=n[e][1])>i&&(r=e,i=t);return r}function yi(n){return n.reduce(mi,0)}function mi(n,t){return n+t[1]}function Mi(n,t){return xi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xi(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function bi(n){return[ao.min(n),ao.max(n)]}function _i(n,t){return n.value-t.value}function wi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Si(n,t){n._pack_next=t,t._pack_prev=n}function ki(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function Ni(n){function t(n){f=Math.min(n.x-n.r,f),s=Math.max(n.x+n.r,s),h=Math.min(n.y-n.r,h),p=Math.max(n.y+n.r,p)}if((e=n.children)&&(c=e.length)){var e,r,i,u,o,a,l,c,f=1/0,s=-(1/0),h=1/0,p=-(1/0);if(e.forEach(Ei),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(i=e[1],i.x=i.r,i.y=0,t(i),c>2))for(u=e[2],zi(r,i,u),t(u),wi(r,u),r._pack_prev=u,wi(u,i),i=r._pack_next,o=3;c>o;o++){zi(r,i,u=e[o]);var g=0,v=1,d=1;for(a=i._pack_next;a!==i;a=a._pack_next,v++)if(ki(a,u)){g=1;break}if(1==g)for(l=r._pack_prev;l!==a._pack_prev&&!ki(l,u);l=l._pack_prev,d++);g?(d>v||v==d&&i.ro;o++)u=e[o],u.x-=y,u.y-=m,M=Math.max(M,u.r+Math.sqrt(u.x*u.x+u.y*u.y));n.r=M,e.forEach(Ai)}}function Ei(n){n._pack_next=n._pack_prev=n}function Ai(n){delete n._pack_next,delete n._pack_prev}function Ci(n,t,e,r){var i=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,i)for(var u=-1,o=i.length;++u=0;)t=i[u],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pi(n,t,e){return n.a.parent===t.parent?n.a:e}function Ui(n){return 1+ao.max(n,function(n){return n.y})}function ji(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fi(n){var t=n.children;return t&&t.length?Fi(t[0]):n}function Hi(n){var t,e=n.children;return e&&(t=e.length)?Hi(e[t-1]):n}function Oi(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Ii(n,t){var e=n.x+t[3],r=n.y+t[0],i=n.dx-t[1]-t[3],u=n.dy-t[0]-t[2];return 0>i&&(e+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:e,y:r,dx:i,dy:u}}function Yi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zi(n){return n.rangeExtent?n.rangeExtent():Yi(n.range())}function Vi(n,t,e,r){var i=e(n[0],n[1]),u=r(t[0],t[1]);return function(n){return u(i(n))}}function Xi(n,t){var e,r=0,i=n.length-1,u=n[r],o=n[i];return u>o&&(e=r,r=i,i=e,e=u,u=o,o=e),n[r]=t.floor(u),n[i]=t.ceil(o),n}function $i(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Sl}function Bi(n,t,e,r){var i=[],u=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]2?Bi:Vi,l=r?Wr:Br;return o=i(n,t,l,e),a=i(t,n,l,Mr),u}function u(n){return o(n)}var o,a;return u.invert=function(n){return a(n)},u.domain=function(t){return arguments.length?(n=t.map(Number),i()):n},u.range=function(n){return arguments.length?(t=n,i()):t},u.rangeRound=function(n){return u.range(n).interpolate(Ur)},u.clamp=function(n){return arguments.length?(r=n,i()):r},u.interpolate=function(n){return arguments.length?(e=n,i()):e},u.ticks=function(t){return Qi(n,t)},u.tickFormat=function(t,e){return nu(n,t,e)},u.nice=function(t){return Gi(n,t),i()},u.copy=function(){return Wi(n,t,e,r)},i()}function Ji(n,t){return ao.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gi(n,t){return Xi(n,$i(Ki(n,t)[2])),Xi(n,$i(Ki(n,t)[2])),n}function Ki(n,t){null==t&&(t=10);var e=Yi(n),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),u=t/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Qi(n,t){return ao.range.apply(ao,Ki(n,t))}function nu(n,t,e){var r=Ki(n,t);if(e){var i=ha.exec(e);if(i.shift(),"s"===i[8]){var u=ao.formatPrefix(Math.max(xo(r[0]),xo(r[1])));return i[7]||(i[7]="."+tu(u.scale(r[2]))),i[8]="f",e=ao.format(i.join("")),function(n){return e(u.scale(n))+u.symbol}}i[7]||(i[7]="."+eu(i[8],r)),e=i.join("")}else e=",."+tu(r[2])+"f";return ao.format(e)}function tu(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function eu(n,t){var e=tu(t[2]);return n in kl?Math.abs(e-tu(Math.max(xo(t[0]),xo(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ru(n,t,e,r){function i(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function u(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(i(t))}return o.invert=function(t){return u(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(i)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(i)),o):t},o.nice=function(){var t=Xi(r.map(i),e?Math:El);return n.domain(t),r=t.map(u),o},o.ticks=function(){var n=Yi(r),o=[],a=n[0],l=n[1],c=Math.floor(i(a)),f=Math.ceil(i(l)),s=t%1?2:t;if(isFinite(f-c)){if(e){for(;f>c;c++)for(var h=1;s>h;h++)o.push(u(c)*h);o.push(u(c))}else for(o.push(u(c));c++0;h--)o.push(u(c)*h);for(c=0;o[c]l;f--);o=o.slice(c,f)}return o},o.tickFormat=function(n,e){if(!arguments.length)return Nl;arguments.length<2?e=Nl:"function"!=typeof e&&(e=ao.format(e));var r=Math.max(1,t*n/o.ticks().length);return function(n){var o=n/u(Math.round(i(n)));return t-.5>o*t&&(o*=t),r>=o?e(n):""}},o.copy=function(){return ru(n.copy(),t,e,r)},Ji(o,n)}function iu(n,t,e){function r(t){return n(i(t))}var i=uu(t),u=uu(1/t);return r.invert=function(t){return u(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(i)),r):e},r.ticks=function(n){return Qi(e,n)},r.tickFormat=function(n,t){return nu(e,n,t)},r.nice=function(n){return r.domain(Gi(e,n))},r.exponent=function(o){return arguments.length?(i=uu(t=o),u=uu(1/t),n.domain(e.map(i)),r):t},r.copy=function(){return iu(n.copy(),t,e)},Ji(r,n)}function uu(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ou(n,t){function e(e){return u[((i.get(e)||("range"===t.t?i.set(e,n.push(e)):NaN))-1)%u.length]}function r(t,e){return ao.range(n.length).map(function(n){return t+e*n})}var i,u,o;return e.domain=function(r){if(!arguments.length)return n;n=[],i=new c;for(var u,o=-1,a=r.length;++oe?[NaN,NaN]:[e>0?a[e-1]:n[0],et?NaN:t/u+n,[t,t+1/u]},r.copy=function(){return lu(n,t,e)},i()}function cu(n,t){function e(e){return e>=e?t[ao.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return cu(n,t)},e}function fu(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qi(n,t)},t.tickFormat=function(t,e){return nu(n,t,e)},t.copy=function(){return fu(n)},t}function su(){return 0}function hu(n){return n.innerRadius}function pu(n){return n.outerRadius}function gu(n){return n.startAngle}function vu(n){return n.endAngle}function du(n){return n&&n.padAngle}function yu(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function mu(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(0>y?-1:1)*Math.sqrt(Math.max(0,M*M*m-x*x)),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mu(n){function t(t){function o(){c.push("M",u(n(f),a))}for(var l,c=[],f=[],s=-1,h=t.length,p=En(e),g=En(r);++s1?n.join("L"):n+"Z"}function bu(n){return n.join("L")+"Z"}function _u(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1&&i.push("H",r[0]),i.join("")}function wu(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;c9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));for(a=-1;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}function Fu(n){return n.length<3?xu(n):n[0]+Au(n,ju(n))}function Hu(n){for(var t,e,r,i=-1,u=n.length;++i=t?o(n-t):void(f.c=o)}function o(e){var i=g.active,u=g[i];u&&(u.timer.c=null,u.timer.t=NaN,--g.count,delete g[i],u.event&&u.event.interrupt.call(n,n.__data__,u.index));for(var o in g)if(r>+o){var c=g[o];c.timer.c=null,c.timer.t=NaN,--g.count,delete g[o]}f.c=a,qn(function(){return f.c&&a(e||1)&&(f.c=null,f.t=NaN),1},0,l),g.active=r,v.event&&v.event.start.call(n,n.__data__,t),p=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&p.push(r)}),h=v.ease,s=v.duration}function a(i){for(var u=i/s,o=h(u),a=p.length;a>0;)p[--a].call(n,o);return u>=1?(v.event&&v.event.end.call(n,n.__data__,t),--g.count?delete g[r]:delete n[e],1):void 0}var l,f,s,h,p,g=n[e]||(n[e]={active:0,count:0}),v=g[r];v||(l=i.time,f=qn(u,0,l),v=g[r]={tween:new c,time:l,timer:f,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++g.count)}function no(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function to(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function eo(n){return n.toISOString()}function ro(n,t,e){function r(t){return n(t)}function i(n,e){var r=n[1]-n[0],i=r/e,u=ao.bisect(Kl,i);return u==Kl.length?[t.year,Ki(n.map(function(n){return n/31536e6}),e)[2]]:u?t[i/Kl[u-1]1?{floor:function(t){for(;e(t=n.floor(t));)t=io(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=io(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yi(r.domain()),u=null==n?i(e,10):"number"==typeof n?i(e,n):!n.range&&[{range:n},t];return u&&(n=u[0],t=u[1]),n.range(e[0],io(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ro(n.copy(),t,e)},Ji(r,n)}function io(n){return new Date(n)}function uo(n){return JSON.parse(n.responseText)}function oo(n){var t=fo.createRange();return t.selectNode(fo.body),t.createContextualFragment(n.responseText)}var ao={version:"3.5.17"},lo=[].slice,co=function(n){return lo.call(n)},fo=this.document;if(fo)try{co(fo.documentElement.childNodes)[0].nodeType}catch(so){co=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(ho){var po=this.Element.prototype,go=po.setAttribute,vo=po.setAttributeNS,yo=this.CSSStyleDeclaration.prototype,mo=yo.setProperty;po.setAttribute=function(n,t){go.call(this,n,t+"")},po.setAttributeNS=function(n,t,e){vo.call(this,n,t,e+"")},yo.setProperty=function(n,t,e){mo.call(this,n,t+"",e)}}ao.ascending=e,ao.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},ao.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ir&&(e=r)}else{for(;++i=r){e=r;break}for(;++ir&&(e=r)}return e},ao.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ie&&(e=r)}else{for(;++i=r){e=r;break}for(;++ie&&(e=r)}return e},ao.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u=r){e=i=r;break}for(;++ur&&(e=r),r>i&&(i=r))}else{for(;++u=r){e=i=r;break}for(;++ur&&(e=r),r>i&&(i=r))}return[e,i]},ao.sum=function(n,t){var e,r=0,u=n.length,o=-1;if(1===arguments.length)for(;++o1?l/(f-1):void 0},ao.deviation=function(){var n=ao.variance.apply(this,arguments);return n?Math.sqrt(n):n};var Mo=u(e);ao.bisectLeft=Mo.left,ao.bisect=ao.bisectRight=Mo.right,ao.bisector=function(n){return u(1===n.length?function(t,r){return e(n(t),r)}:n)},ao.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,2>u&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},ao.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ao.pairs=function(n){for(var t,e=0,r=n.length-1,i=n[0],u=new Array(0>r?0:r);r>e;)u[e]=[t=i,i=n[++e]];return u},ao.transpose=function(n){if(!(i=n.length))return[];for(var t=-1,e=ao.min(n,o),r=new Array(e);++t=0;)for(r=n[i],t=r.length;--t>=0;)e[--o]=r[t];return e};var xo=Math.abs;ao.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,i=[],u=a(xo(e)),o=-1;if(n*=u,t*=u,e*=u,0>e)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)=u.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,f,s,h,p=-1,g=o.length,v=u[a++],d=new c;++p=u.length)return n;var r=[],i=o[e++];return n.forEach(function(n,i){r.push({key:n,values:t(i,e)})}),i?r.sort(function(n,t){return i(n.key,t.key)}):r}var e,r,i={},u=[],o=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(ao.map,e,0),0)},i.key=function(n){return u.push(n),i},i.sortKeys=function(n){return o[u.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},ao.set=function(n){var t=new y;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(y,{has:h,add:function(n){return this._[f(n+="")]=!0,n},remove:p,values:g,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t))}}),ao.behavior={},ao.rebind=function(n,t){for(var e,r=1,i=arguments.length;++r=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ao.event=null,ao.requote=function(n){return n.replace(So,"\\$&")};var So=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},No=function(n,t){return t.querySelector(n)},Eo=function(n,t){return t.querySelectorAll(n)},Ao=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ao=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(No=function(n,t){return Sizzle(n,t)[0]||null},Eo=Sizzle,Ao=Sizzle.matchesSelector),ao.selection=function(){return ao.select(fo.documentElement)};var Co=ao.selection.prototype=[];Co.select=function(n){var t,e,r,i,u=[];n=A(n);for(var o=-1,a=this.length;++o=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Lo.hasOwnProperty(e)?{space:Lo[e],local:n}:n}},Co.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ao.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Co.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,i=-1;if(t=e.classList){for(;++ii){if("string"!=typeof n){2>i&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>i){var u=this.node();return t(u).getComputedStyle(u,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Co.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},Co.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Co.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Co.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Co.insert=function(n,t){return n=j(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Co.remove=function(){return this.each(F)},Co.data=function(n,t){function e(n,e){var r,i,u,o=n.length,s=e.length,h=Math.min(o,s),p=new Array(s),g=new Array(s),v=new Array(o);if(t){var d,y=new c,m=new Array(o);for(r=-1;++rr;++r)g[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}g.update=p,g.parentNode=p.parentNode=v.parentNode=n.parentNode,a.push(g),l.push(p),f.push(v)}var r,i,u=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++uu;u++){i.push(t=[]),t.parentNode=(e=this[u]).parentNode;for(var a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return E(i)},Co.order=function(){for(var n=-1,t=this.length;++n=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},Co.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++tn;n++)for(var e=this[n],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},Co.size=function(){var n=0;return Y(this,function(){++n}),n};var qo=[];ao.selection.enter=Z,ao.selection.enter.prototype=qo,qo.append=Co.append,qo.empty=Co.empty,qo.node=Co.node,qo.call=Co.call,qo.size=Co.size,qo.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++ar){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var To=ao.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&To.forEach(function(n){"on"+n in fo&&To.remove(n)});var Ro,Do=0;ao.mouse=function(n){return J(n,k())};var Po=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ao.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,i=0,u=t.length;u>i;++i)if((r=t[i]).identifier===e)return J(n,r)},ao.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",o)}function e(n,t,e,u,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],g|=n|e,M=r,p({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(y.on(u+d,null).on(o+d,null),m(g),p({type:"dragend"}))}var c,f=this,s=ao.event.target.correspondingElement||ao.event.target,h=f.parentNode,p=r.of(f,arguments),g=0,v=n(),d=".drag"+(null==v?"":"-"+v),y=ao.select(e(s)).on(u+d,a).on(o+d,l),m=W(s),M=t(h,v);i?(c=i.apply(f,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],p({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),i=null,u=e(b,ao.mouse,t,"mousemove","mouseup"),o=e(G,ao.touch,m,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},ao.rebind(n,r,"on")},ao.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?co(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Uo=1e-6,jo=Uo*Uo,Fo=Math.PI,Ho=2*Fo,Oo=Ho-Uo,Io=Fo/2,Yo=Fo/180,Zo=180/Fo,Vo=Math.SQRT2,Xo=2,$o=4;ao.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(jo>h)r=Math.log(c/o)/Vo,e=function(n){return[i+n*f,u+n*s,o*Math.exp(Vo*n*r)]};else{var p=Math.sqrt(h),g=(c*c-o*o+$o*h)/(2*o*Xo*p),v=(c*c-o*o-$o*h)/(2*c*Xo*p),d=Math.log(Math.sqrt(g*g+1)-g),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-d)/Vo,e=function(n){var t=n*r,e=rn(d),a=o/(Xo*p)*(e*un(Vo*t+d)-en(d));return[i+a*f,u+a*s,o*e/rn(Vo*t+d)]}}return e.duration=1e3*r,e},ao.behavior.zoom=function(){function n(n){n.on(L,s).on(Wo+".zoom",p).on("dblclick.zoom",g).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function i(n){k.k=Math.max(A[0],Math.min(A[1],n))}function u(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),u(d=e,r),t=ao.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function f(n){--z||(n({type:"zoomend"}),d=null)}function s(){function n(){a=1,u(ao.mouse(i),h),c(o)}function r(){s.on(q,null).on(T,null),p(a),f(o)}var i=this,o=D.of(i,arguments),a=0,s=ao.select(t(i)).on(q,n).on(T,r),h=e(ao.mouse(i)),p=W(i);Il.call(i),l(o)}function h(){function n(){var n=ao.touches(g);return p=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ao.event.target;ao.select(t).on(x,r).on(b,a),_.push(t);for(var e=ao.event.changedTouches,i=0,u=e.length;u>i;++i)d[e[i].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var f=l[0];o(g,f,d[f.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var f=l[0],s=l[1],h=f[0]-s[0],p=f[1]-s[1];y=h*h+p*p}}function r(){var n,t,e,r,o=ao.touches(g);Il.call(g);for(var a=0,l=o.length;l>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var f=(f=e[0]-n[0])*f+(f=e[1]-n[1])*f,s=y&&Math.sqrt(f/y);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],i(s*p)}M=null,u(n,t),c(v)}function a(){if(ao.event.touches.length){for(var t=ao.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var i in d)return void n()}ao.selectAll(_).on(m,null),w.on(L,s).on(R,h),N(),f(v)}var p,g=this,v=D.of(g,arguments),d={},y=0,m=".zoom-"+ao.event.changedTouches[0].identifier,x="touchmove"+m,b="touchend"+m,_=[],w=ao.select(g),N=W(g);t(),l(v),w.on(L,null).on(R,t)}function p(){var n=D.of(this,arguments);m?clearTimeout(m):(Il.call(this),v=e(d=y||ao.mouse(this)),l(n)),m=setTimeout(function(){m=null,f(n)},50),S(),i(Math.pow(2,.002*Bo())*k.k),u(d,v),c(n)}function g(){var n=ao.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ao.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,y,m,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Jo,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return Wo||(Wo="onwheel"in fo?(Bo=function(){return-ao.event.deltaY*(ao.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Bo=function(){return ao.event.wheelDelta},"mousewheel"):(Bo=function(){return-ao.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Hl?ao.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],i=d?d[0]:e/2,u=d?d[1]:r/2,o=ao.interpolateZoom([(i-k.x)/k.k,(u-k.y)/k.k,e/k.k],[(i-t.x)/t.k,(u-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:i-r[0]*a,y:u-r[1]*a,k:a},c(n)}}).each("interrupt.zoom",function(){f(n)}).each("end.zoom",function(){f(n)}):(this.__chart__=k,l(n),c(n),f(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+t),a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Jo:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(y=t&&[+t[0],+t[1]],n):y},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ao.rebind(n,D,"on")};var Bo,Wo,Jo=[0,1/0];ao.color=an,an.prototype.toString=function(){return this.rgb()+""},ao.hsl=ln;var Go=ln.prototype=new an;Go.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Go.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Go.rgb=function(){return cn(this.h,this.s,this.l)},ao.hcl=fn;var Ko=fn.prototype=new an;Ko.brighter=function(n){return new fn(this.h,this.c,Math.min(100,this.l+Qo*(arguments.length?n:1)))},Ko.darker=function(n){return new fn(this.h,this.c,Math.max(0,this.l-Qo*(arguments.length?n:1)))},Ko.rgb=function(){return sn(this.h,this.c,this.l).rgb()},ao.lab=hn;var Qo=18,na=.95047,ta=1,ea=1.08883,ra=hn.prototype=new an;ra.brighter=function(n){return new hn(Math.min(100,this.l+Qo*(arguments.length?n:1)),this.a,this.b)},ra.darker=function(n){return new hn(Math.max(0,this.l-Qo*(arguments.length?n:1)),this.a,this.b)},ra.rgb=function(){return pn(this.l,this.a,this.b)},ao.rgb=mn;var ia=mn.prototype=new an;ia.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&i>t&&(t=i),e&&i>e&&(e=i),r&&i>r&&(r=i),new mn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mn(i,i,i)},ia.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mn(n*this.r,n*this.g,n*this.b)},ia.hsl=function(){return wn(this.r,this.g,this.b)},ia.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ua=ao.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ua.forEach(function(n,t){ua.set(n,Mn(t))}),ao.functor=En,ao.xhr=An(m),ao.dsv=function(n,t){function e(n,e,u){arguments.length<3&&(u=e,e=null);var o=Cn(n,t,null==e?r:i(e),u);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:i(n)):e},o}function r(n){return e.parse(n.responseText)}function i(n){return function(t){return e.parse(t.responseText,n)}}function u(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(i(n),e)}:i})},e.parseRows=function(n,t){function e(){if(f>=c)return o;if(i)return i=!1,u;var t=f;if(34===n.charCodeAt(t)){for(var e=t;e++f;){var r=n.charCodeAt(f++),a=1;if(10===r)i=!0;else if(13===r)i=!0,10===n.charCodeAt(f)&&(++f,++a);else if(r!==l)continue;return n.slice(t,f-a)}return n.slice(t)}for(var r,i,u={},o={},a=[],c=n.length,f=0,s=0;(r=e())!==o;){for(var h=[];r!==u&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,s++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new y,i=[];return t.forEach(function(n){for(var t in n)r.has(t)||i.push(r.add(t))}),[i.map(o).join(n)].concat(t.map(function(t){return i.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(u).join("\n")},e},ao.csv=ao.dsv(",","text/csv"),ao.tsv=ao.dsv(" ","text/tab-separated-values");var oa,aa,la,ca,fa=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ao.timer=function(){qn.apply(this,arguments)},ao.timer.flush=function(){Rn(),Dn()},ao.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var sa=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Un);ao.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=ao.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),sa[8+e/3]};var ha=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pa=ao.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ao.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ga=ao.time={},va=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){da.setUTCDate.apply(this._,arguments)},setDay:function(){da.setUTCDay.apply(this._,arguments)},setFullYear:function(){da.setUTCFullYear.apply(this._,arguments)},setHours:function(){da.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){da.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){da.setUTCMinutes.apply(this._,arguments)},setMonth:function(){da.setUTCMonth.apply(this._,arguments)},setSeconds:function(){da.setUTCSeconds.apply(this._,arguments)},setTime:function(){da.setTime.apply(this._,arguments)}};var da=Date.prototype;ga.year=On(function(n){return n=ga.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ga.years=ga.year.range,ga.years.utc=ga.year.utc.range,ga.day=On(function(n){var t=new va(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ga.days=ga.day.range,ga.days.utc=ga.day.utc.range,ga.dayOfYear=function(n){var t=ga.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ga[n]=On(function(n){return(n=ga.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ga[n+"s"]=e.range,ga[n+"s"].utc=e.utc.range,ga[n+"OfYear"]=function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)}}),ga.week=ga.sunday,ga.weeks=ga.sunday.range,ga.weeks.utc=ga.sunday.utc.range,ga.weekOfYear=ga.sundayOfYear;var ya={"-":"",_:" ",0:"0"},ma=/^\s*\d+/,Ma=/^%/;ao.locale=function(n){return{numberFormat:jn(n),timeFormat:Yn(n)}};var xa=ao.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], -shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ao.format=xa.numberFormat,ao.geo={},ft.prototype={s:0,t:0,add:function(n){st(n,this.t,ba),st(ba.s,this.s,this),this.s?this.t+=ba.t:this.s=ba.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ba=new ft;ao.geo.stream=function(n,t){n&&_a.hasOwnProperty(n.type)?_a[n.type](n,t):ht(n,t)};var _a={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++rn?4*Fo+n:n,Na.lineStart=Na.lineEnd=Na.point=b}};ao.geo.bounds=function(){function n(n,t){M.push(x=[f=n,h=n]),s>t&&(s=t),t>p&&(p=t)}function t(t,e){var r=dt([t*Yo,e*Yo]);if(y){var i=mt(y,r),u=[i[1],-i[0],0],o=mt(u,i);bt(o),o=_t(o);var l=t-g,c=l>0?1:-1,v=o[0]*Zo*c,d=xo(l)>180;if(d^(v>c*g&&c*t>v)){var m=o[1]*Zo;m>p&&(p=m)}else if(v=(v+360)%360-180,d^(v>c*g&&c*t>v)){var m=-o[1]*Zo;s>m&&(s=m)}else s>e&&(s=e),e>p&&(p=e);d?g>t?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t):h>=f?(f>t&&(f=t),t>h&&(h=t)):t>g?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t)}else n(t,e);y=r,g=t}function e(){b.point=t}function r(){x[0]=f,x[1]=h,b.point=n,y=null}function i(n,e){if(y){var r=n-g;m+=xo(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Na.point(n,e),t(n,e)}function u(){Na.lineStart()}function o(){i(v,d),Na.lineEnd(),xo(m)>Uo&&(f=-(h=180)),x[0]=f,x[1]=h,y=null}function a(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nka?(f=-(h=180),s=-(p=90)):m>Uo?p=90:-Uo>m&&(s=-90),x[0]=f,x[1]=h}};return function(n){p=h=-(f=s=1/0),M=[],ao.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,i=M[0],u=[i];t>r;++r)e=M[r],c(e[0],i)||c(e[1],i)?(a(i[0],e[1])>a(i[0],i[1])&&(i[1]=e[1]),a(e[0],i[1])>a(i[0],i[1])&&(i[0]=e[0])):u.push(i=e);for(var o,e,g=-(1/0),t=u.length-1,r=0,i=u[t];t>=r;i=e,++r)e=u[r],(o=a(i[1],e[0]))>g&&(g=o,f=e[0],h=i[1])}return M=x=null,f===1/0||s===1/0?[[NaN,NaN],[NaN,NaN]]:[[f,s],[h,p]]}}(),ao.geo.centroid=function(n){Ea=Aa=Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,ja);var t=Da,e=Pa,r=Ua,i=t*t+e*e+r*r;return jo>i&&(t=qa,e=Ta,r=Ra,Uo>Aa&&(t=Ca,e=za,r=La),i=t*t+e*e+r*r,jo>i)?[NaN,NaN]:[Math.atan2(e,t)*Zo,tn(r/Math.sqrt(i))*Zo]};var Ea,Aa,Ca,za,La,qa,Ta,Ra,Da,Pa,Ua,ja={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){ja.lineStart=At},polygonEnd:function(){ja.lineStart=Nt}},Fa=Rt(zt,jt,Ht,[-Fo,-Fo/2]),Ha=1e9;ao.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),i=u(n),i.valid=!0,i},extent:function(a){return arguments.length?(u=Zt(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ao.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,ao.geo.albers=function(){return ao.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ao.geo.albersUsa=function(){function n(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}var t,e,r,i,u=ao.geo.albers(),o=ao.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ao.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?o:i>=.166&&.234>i&&r>=-.214&&-.115>r?a:u).invert(n)},n.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(u.precision(t),o.precision(t),a.precision(t),n):u.precision()},n.scale=function(t){return arguments.length?(u.scale(t),o.scale(.35*t),a.scale(t),n.translate(u.translate())):u.scale()},n.translate=function(t){if(!arguments.length)return u.translate();var c=u.scale(),f=+t[0],s=+t[1];return e=u.translate(t).clipExtent([[f-.455*c,s-.238*c],[f+.455*c,s+.238*c]]).stream(l).point,r=o.translate([f-.307*c,s+.201*c]).clipExtent([[f-.425*c+Uo,s+.12*c+Uo],[f-.214*c-Uo,s+.234*c-Uo]]).stream(l).point,i=a.translate([f-.205*c,s+.212*c]).clipExtent([[f-.214*c+Uo,s+.166*c+Uo],[f-.115*c-Uo,s+.234*c-Uo]]).stream(l).point,n},n.scale(1070)};var Oa,Ia,Ya,Za,Va,Xa,$a={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Ia=0,$a.lineStart=$t},polygonEnd:function(){$a.lineStart=$a.lineEnd=$a.point=b,Oa+=xo(Ia/2)}},Ba={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Wa={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Wa.lineStart=ne},polygonEnd:function(){Wa.point=Gt,Wa.lineStart=Kt,Wa.lineEnd=Qt}};ao.geo.path=function(){function n(n){return n&&("function"==typeof a&&u.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=i(u)),ao.geo.stream(n,o)),u.result()}function t(){return o=null,n}var e,r,i,u,o,a=4.5;return n.area=function(n){return Oa=0,ao.geo.stream(n,i($a)),Oa},n.centroid=function(n){return Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,i(Wa)),Ua?[Da/Ua,Pa/Ua]:Ra?[qa/Ra,Ta/Ra]:La?[Ca/La,za/La]:[NaN,NaN]},n.bounds=function(n){return Va=Xa=-(Ya=Za=1/0),ao.geo.stream(n,i(Ba)),[[Ya,Za],[Va,Xa]]},n.projection=function(n){return arguments.length?(i=(e=n)?n.stream||re(n):m,t()):e},n.context=function(n){return arguments.length?(u=null==(r=n)?new Wt:new te(n),"function"!=typeof a&&u.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(u.pointRadius(+t),+t),n):a},n.projection(ao.geo.albersUsa()).context(null)},ao.geo.transform=function(n){return{stream:function(t){var e=new ie(t);for(var r in n)e[r]=n[r];return e}}},ie.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ao.geo.projection=oe,ao.geo.projectionMutator=ae,(ao.geo.equirectangular=function(){return oe(ce)}).raw=ce.invert=ce,ao.geo.rotation=function(n){function t(t){return t=n(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t}return n=se(n[0]%360*Yo,n[1]*Yo,n.length>2?n[2]*Yo:0),t.invert=function(t){return t=n.invert(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t},t},fe.invert=ce,ao.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=se(-n[0]*Yo,-n[1]*Yo,0).invert,i=[];return e(null,null,1,{point:function(n,e){i.push(n=t(n,e)),n[0]*=Zo,n[1]*=Zo}}),{type:"Polygon",coordinates:[i]}}var t,e,r=[0,0],i=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Yo,i*Yo),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Yo,(i=+r)*Yo),n):i},n.angle(90)},ao.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Yo,i=n[1]*Yo,u=t[1]*Yo,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},ao.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ao.range(Math.ceil(u/d)*d,i,d).map(h).concat(ao.range(Math.ceil(c/y)*y,l,y).map(p)).concat(ao.range(Math.ceil(r/g)*g,e,g).filter(function(n){return xo(n%d)>Uo}).map(f)).concat(ao.range(Math.ceil(a/v)*v,o,v).filter(function(n){return xo(n%y)>Uo}).map(s))}var e,r,i,u,o,a,l,c,f,s,h,p,g=10,v=g,d=90,y=360,m=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(p(l).slice(1),h(i).reverse().slice(1),p(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(u=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],u>i&&(t=u,u=i,i=t),c>l&&(t=c,c=l,l=t),n.precision(m)):[[u,c],[i,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(m)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],y=+t[1],n):[d,y]},n.minorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],n):[g,v]},n.precision=function(t){return arguments.length?(m=+t,f=ye(a,o,90),s=me(r,e,m),h=ye(c,l,90),p=me(u,i,m),n):m},n.majorExtent([[-180,-90+Uo],[180,90-Uo]]).minorExtent([[-180,-80-Uo],[180,80+Uo]])},ao.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}var t,e,r=Me,i=xe;return n.distance=function(){return ao.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(i=t,e="function"==typeof t?null:t,n):i},n.precision=function(){return arguments.length?n:0},n},ao.geo.interpolate=function(n,t){return be(n[0]*Yo,n[1]*Yo,t[0]*Yo,t[1]*Yo)},ao.geo.length=function(n){return Ja=0,ao.geo.stream(n,Ga),Ja};var Ja,Ga={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Ka=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ao.geo.azimuthalEqualArea=function(){return oe(Ka)}).raw=Ka;var Qa=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},m);(ao.geo.azimuthalEquidistant=function(){return oe(Qa)}).raw=Qa,(ao.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(ao.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var nl=we(function(n){return 1/n},Math.atan);(ao.geo.gnomonic=function(){return oe(nl)}).raw=nl,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Io]},(ao.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var tl=we(function(){return 1},Math.asin);(ao.geo.orthographic=function(){return oe(tl)}).raw=tl;var el=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ao.geo.stereographic=function(){return oe(el)}).raw=el,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Io]},(ao.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,ao.geom={},ao.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,i=En(e),u=En(r),o=n.length,a=[],l=[];for(t=0;o>t;t++)a.push([+i.call(this,n[t],t),+u.call(this,n[t],t),t]);for(a.sort(qe),t=0;o>t;t++)l.push([a[t][0],-a[t][1]]);var c=Le(a),f=Le(l),s=f[0]===c[0],h=f[f.length-1]===c[c.length-1],p=[];for(t=c.length-1;t>=0;--t)p.push(n[a[c[t]][2]]);for(t=+s;t=r&&c.x<=u&&c.y>=i&&c.y<=o?[[r,o],[u,o],[u,i],[r,i]]:[];f.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(u(n,t)/Uo)*Uo,y:Math.round(o(n,t)/Uo)*Uo,i:t}})}var r=Ce,i=ze,u=r,o=i,a=sl;return n?t(n):(t.links=function(n){return ar(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return ar(e(n)).cells.forEach(function(e,r){for(var i,u,o=e.site,a=e.edges.sort(Ve),l=-1,c=a.length,f=a[c-1].edge,s=f.l===o?f.r:f.l;++l=c,h=r>=f,p=h<<1|s;n.leaf=!1,n=n.nodes[p]||(n.nodes[p]=hr()),s?i=c:a=c,h?o=f:l=f,u(n,t,e,r,i,o,a,l)}var f,s,h,p,g,v,d,y,m,M=En(a),x=En(l);if(null!=t)v=t,d=e,y=r,m=i;else if(y=m=-(v=d=1/0),s=[],h=[],g=n.length,o)for(p=0;g>p;++p)f=n[p],f.xy&&(y=f.x),f.y>m&&(m=f.y),s.push(f.x),h.push(f.y);else for(p=0;g>p;++p){var b=+M(f=n[p],p),_=+x(f,p);v>b&&(v=b),d>_&&(d=_),b>y&&(y=b),_>m&&(m=_),s.push(b),h.push(_)}var w=y-v,S=m-d;w>S?m=d+w:y=v+S;var k=hr();if(k.add=function(n){u(k,n,+M(n,++p),+x(n,p),v,d,y,m)},k.visit=function(n){pr(n,k,v,d,y,m)},k.find=function(n){return gr(k,n[0],n[1],v,d,y,m)},p=-1,null==t){for(;++p=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=vl.get(e)||gl,r=dl.get(r)||m,br(r(e.apply(null,lo.call(arguments,1))))},ao.interpolateHcl=Rr,ao.interpolateHsl=Dr,ao.interpolateLab=Pr,ao.interpolateRound=Ur,ao.transform=function(n){var t=fo.createElementNS(ao.ns.prefix.svg,"g");return(ao.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new jr(e?e.matrix:yl)})(n)},jr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yl={a:1,b:0,c:0,d:1,e:0,f:0};ao.interpolateTransform=$r,ao.layout={},ao.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++ea*a/y){if(v>l){var c=t.charge/l;n.px-=u*c,n.py-=o*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=u*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=ao.event.x,n.py=ao.event.y,l.resume()}var e,r,i,u,o,a,l={},c=ao.dispatch("start","tick","end"),f=[1,1],s=.9,h=ml,p=Ml,g=-30,v=xl,d=.1,y=.64,M=[],x=[];return l.tick=function(){if((i*=.99)<.005)return e=null,c.end({type:"end",alpha:i=0}),!0;var t,r,l,h,p,v,y,m,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,p=l.target,m=p.x-h.x,b=p.y-h.y,(v=m*m+b*b)&&(v=i*o[r]*((v=Math.sqrt(v))-u[r])/v,m*=v,b*=v,p.x-=m*(y=h.weight+p.weight?h.weight/(h.weight+p.weight):.5),p.y-=b*y,h.x+=m*(y=1-y),h.y+=b*y);if((y=i*d)&&(m=f[0]/2,b=f[1]/2,r=-1,y))for(;++r<_;)l=M[r],l.x+=(m-l.x)*y,l.y+=(b-l.y)*y;if(g)for(ri(t=ao.geom.quadtree(M),i,a),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*s,l.y-=(l.py-(l.py=l.y))*s);c.tick({type:"tick",alpha:i})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(f=n,l):f},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.friction=function(n){return arguments.length?(s=+n,l):s},l.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(y=n*n,l):Math.sqrt(y)},l.alpha=function(n){return arguments.length?(n=+n,i?n>0?i=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:i=0})):n>0&&(c.start({type:"start",alpha:i=n}),e=qn(l.tick)),l):i},l.start=function(){function n(n,r){if(!e){for(e=new Array(i),l=0;i>l;++l)e[l]=[];for(l=0;c>l;++l){var u=x[l];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var o,a=e[t],l=-1,f=a.length;++lt;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;i>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",s)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof h)for(t=0;c>t;++t)u[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)u[t]=h;if(o=[],"function"==typeof p)for(t=0;c>t;++t)o[t]=+p.call(this,x[t],t);else for(t=0;c>t;++t)o[t]=p;if(a=[],"function"==typeof g)for(t=0;i>t;++t)a[t]=+g.call(this,M[t],t);else for(t=0;i>t;++t)a[t]=g;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=ao.behavior.drag().origin(m).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",ni)),arguments.length?void this.on("mouseover.force",ti).on("mouseout.force",ei).call(r):r},ao.rebind(l,c,"on")};var ml=20,Ml=1,xl=1/0;ao.layout.hierarchy=function(){function n(i){var u,o=[i],a=[];for(i.depth=0;null!=(u=o.pop());)if(a.push(u),(c=e.call(n,u,u.depth))&&(l=c.length)){for(var l,c,f;--l>=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;r&&(u.value=0),u.children=c}else r&&(u.value=+r.call(n,u,u.depth)||0),delete u.children;return oi(i,function(n){var e,i;t&&(e=n.children)&&e.sort(t),r&&(i=n.parent)&&(i.value+=n.value)}),a}var t=ci,e=ai,r=li;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(ui(t,function(n){n.children&&(n.value=0)}),oi(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ao.layout.partition=function(){function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++cs?-1:1),g=ao.sum(c),v=g?(s-l*p)/g:0,d=ao.range(l),y=[];return null!=e&&d.sort(e===bl?function(n,t){return c[t]-c[n]}:function(n,t){return e(o[n],o[t])}),d.forEach(function(n){y[n]={data:o[n],value:a=c[n],startAngle:f,endAngle:f+=a*v+p,padAngle:h}}),y}var t=Number,e=bl,r=0,i=Ho,u=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(i=t,n):i},n.padAngle=function(t){return arguments.length?(u=t,n):u},n};var bl={};ao.layout.stack=function(){function n(a,l){if(!(h=a.length))return a;var c=a.map(function(e,r){return t.call(n,e,r)}),f=c.map(function(t){return t.map(function(t,e){return[u.call(n,t,e),o.call(n,t,e)]})}),s=e.call(n,f,l);c=ao.permute(c,s),f=ao.permute(f,s);var h,p,g,v,d=r.call(n,f,l),y=c[0].length;for(g=0;y>g;++g)for(i.call(n,c[0][g],v=d[g],f[0][g][1]),p=1;h>p;++p)i.call(n,c[p][g],v+=f[p-1][g][1],f[p][g][1]);return a}var t=m,e=gi,r=vi,i=pi,u=si,o=hi;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:_l.get(t)||gi,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:wl.get(t)||vi,n):r},n.x=function(t){return arguments.length?(u=t,n):u},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(i=t,n):i},n};var _l=ao.map({"inside-out":function(n){var t,e,r=n.length,i=n.map(di),u=n.map(yi),o=ao.range(r).sort(function(n,t){return i[n]-i[t]}),a=0,l=0,c=[],f=[];for(t=0;r>t;++t)e=o[t],l>a?(a+=u[e],c.push(e)):(l+=u[e],f.push(e));return f.reverse().concat(c)},reverse:function(n){return ao.range(n.length).reverse()},"default":gi}),wl=ao.map({silhouette:function(n){var t,e,r,i=n.length,u=n[0].length,o=[],a=0,l=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;u>e;++e)l[e]=(a-o[e])/2;return l},wiggle:function(n){var t,e,r,i,u,o,a,l,c,f=n.length,s=n[0],h=s.length,p=[];for(p[0]=l=c=0,e=1;h>e;++e){for(t=0,i=0;f>t;++t)i+=n[t][e][1];for(t=0,u=0,a=s[e][0]-s[e-1][0];f>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;u+=o*n[t][e][1]}p[e]=l-=i?u/i*a:0,c>l&&(c=l)}for(e=0;h>e;++e)p[e]-=c;return p},expand:function(n){var t,e,r,i=n.length,u=n[0].length,o=1/i,a=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];if(r)for(t=0;i>t;t++)n[t][e][1]/=r;else for(t=0;i>t;t++)n[t][e][1]=o}for(e=0;u>e;++e)a[e]=0;return a},zero:vi});ao.layout.histogram=function(){function n(n,u){for(var o,a,l=[],c=n.map(e,this),f=r.call(this,c,u),s=i.call(this,f,c,u),u=-1,h=c.length,p=s.length-1,g=t?1:1/h;++u0)for(u=-1;++u=f[0]&&a<=f[1]&&(o=l[ao.bisect(s,a,1,p)-1],o.y+=g,o.push(n[u]));return l}var t=!0,e=Number,r=bi,i=Mi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(i="number"==typeof t?function(n){return xi(n,t)}:En(t),n):i},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ao.layout.pack=function(){function n(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,oi(a,function(n){n.r=+f(n.value)}),oi(a,Ni),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;oi(a,function(n){n.r+=s}),oi(a,Ni),oi(a,function(n){n.r-=s})}return Ci(a,l/2,c/2,t?1:1/Math.max(2*a.r/l,2*a.r/c)),o}var t,e=ao.layout.hierarchy().sort(_i),r=0,i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},ii(n,e)},ao.layout.tree=function(){function n(n,i){var f=o.call(this,n,i),s=f[0],h=t(s);if(oi(h,e),h.parent.m=-h.z,ui(h,r),c)ui(s,u);else{var p=s,g=s,v=s;ui(s,function(n){n.xg.x&&(g=n),n.depth>v.depth&&(v=n)});var d=a(p,g)/2-p.x,y=l[0]/(g.x+a(g,p)/2+d),m=l[1]/(v.depth||1);ui(s,function(n){n.x=(n.x+d)*y,n.y=n.depth*m})}return f}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var i,u=t.children,o=0,a=u.length;a>o;++o)r.push((u[o]=i={_:u[o],parent:t,children:(i=u[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Di(n);var u=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-u):n.z=u}else r&&(n.z=r.z+a(n._,r._));n.parent.A=i(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function i(n,t,e){if(t){for(var r,i=n,u=n,o=t,l=i.parent.children[0],c=i.m,f=u.m,s=o.m,h=l.m;o=Ti(o),i=qi(i),o&&i;)l=qi(l),u=Ti(u),u.a=n,r=o.z+s-i.z-c+a(o._,i._),r>0&&(Ri(Pi(o,n,e),n,r),c+=r,f+=r),s+=o.m,c+=i.m,h+=l.m,f+=u.m;o&&!Ti(u)&&(u.t=o,u.m+=s-f),i&&!qi(l)&&(l.t=i,l.m+=c-h,e=n)}return e}function u(n){n.x*=l[0],n.y=n.depth*l[1]}var o=ao.layout.hierarchy().sort(null).value(null),a=Li,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(c=null==(l=t)?u:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:u,n):c?l:null},ii(n,o)},ao.layout.cluster=function(){function n(n,u){var o,a=t.call(this,n,u),l=a[0],c=0;oi(l,function(n){var t=n.children;t&&t.length?(n.x=ji(t),n.y=Ui(t)):(n.x=o?c+=e(n,o):0,n.y=0,o=n)});var f=Fi(l),s=Hi(l),h=f.x-e(f,s)/2,p=s.x+e(s,f)/2;return oi(l,i?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(p-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),a}var t=ao.layout.hierarchy().sort(null).value(null),e=Li,r=[1,1],i=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(i=null==(r=t),n):i?null:r},n.nodeSize=function(t){return arguments.length?(i=null!=(r=t),n):i?r:null},ii(n,t)},ao.layout.treemap=function(){function n(n,t){for(var e,r,i=-1,u=n.length;++it?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var u=e.children;if(u&&u.length){var o,a,l,c=s(e),f=[],h=u.slice(),g=1/0,v="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),f.area=0;(l=h.length)>0;)f.push(o=h[l-1]),f.area+=o.area,"squarify"!==p||(a=r(f,v))<=g?(h.pop(),g=a):(f.area-=f.pop().area,i(f,v,c,!1),v=Math.min(c.dx,c.dy),f.length=f.area=0,g=1/0);f.length&&(i(f,v,c,!0),f.length=f.area=0),u.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var u,o=s(t),a=r.slice(),l=[];for(n(a,o.dx*o.dy/t.value),l.area=0;u=a.pop();)l.push(u),l.area+=u.area,null!=u.z&&(i(l,u.z?o.dx:o.dy,o,!a.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++oe&&(u=e),e>i&&(i=e));return r*=r,t*=t,r?Math.max(t*i*g/r,r/(t*u*g)):1/0}function i(n,t,e,r){var i,u=-1,o=n.length,a=e.x,c=e.y,f=t?l(n.area/t):0; -if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++ue.dx)&&(f=e.dx);++ue&&(t=1),1>e&&(n=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var n=ao.random.normal.apply(ao,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ao.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ao.scale={};var Sl={floor:m,ceil:m};ao.scale.linear=function(){return Wi([0,1],[0,1],Mr,!1)};var kl={s:1,g:1,p:1,r:1,e:1};ao.scale.log=function(){return ru(ao.scale.linear().domain([0,1]),10,!0,[1,10])};var Nl=ao.format(".0e"),El={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ao.scale.pow=function(){return iu(ao.scale.linear(),1,[0,1])},ao.scale.sqrt=function(){return ao.scale.pow().exponent(.5)},ao.scale.ordinal=function(){return ou([],{t:"range",a:[[]]})},ao.scale.category10=function(){return ao.scale.ordinal().range(Al)},ao.scale.category20=function(){return ao.scale.ordinal().range(Cl)},ao.scale.category20b=function(){return ao.scale.ordinal().range(zl)},ao.scale.category20c=function(){return ao.scale.ordinal().range(Ll)};var Al=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Cl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),zl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),Ll=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);ao.scale.quantile=function(){return au([],[])},ao.scale.quantize=function(){return lu(0,1,[0,1])},ao.scale.threshold=function(){return cu([.5],[0,1])},ao.scale.identity=function(){return fu([0,1])},ao.svg={},ao.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),f=o.apply(this,arguments)-Io,s=a.apply(this,arguments)-Io,h=Math.abs(s-f),p=f>s?0:1;if(n>c&&(g=c,c=n,n=g),h>=Oo)return t(c,p)+(n?t(n,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+l.apply(this,arguments)||0)/2)&&(d=u===ql?Math.sqrt(n*n+c*c):+u.apply(this,arguments),p||(E*=-1),c&&(E=tn(d/c*Math.sin(y))),n&&(N=tn(d/n*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=Fo?0:1;if(E&&yu(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(n){_=n*Math.cos(s-N),w=n*Math.sin(s-N),S=n*Math.cos(f+N),k=n*Math.sin(f+N);var L=Math.abs(f-s+2*N)<=Fo?0:1;if(N&&yu(_,w,S,k)===1-p^L){var q=(f+s)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Uo&&(g=Math.min(Math.abs(c-n)/2,+i.apply(this,arguments)))>.001){v=c>n^p?0:1;var T=g,R=g;if(Fo>h){var D=null==S?[_,w]:null==x?[m,M]:Re([m,M],[S,k],[x,b],[_,w]),P=m-D[0],U=M-D[1],j=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*j+U*F)/(Math.sqrt(P*P+U*U)*Math.sqrt(j*j+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(g,(n-O)/(H-1)),T=Math.min(g,(c-O)/(H+1))}if(null!=x){var I=mu(null==S?[_,w]:[S,k],[m,M],c,T,p),Y=mu([x,b],[_,w],c,T,p);g===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-p^yu(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",p," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",m,",",M);if(null!=S){var Z=mu([m,M],[S,k],n,-R,p),V=mu([_,w],null==x?[m,M]:[x,b],n,-R,p);g===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",p^yu(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-p," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",m,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",p," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-p," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hu,r=pu,i=su,u=ql,o=gu,a=vu,l=du;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(i=En(t),n):i},n.padRadius=function(t){return arguments.length?(u=t==ql?ql:En(t),n):u},n.startAngle=function(t){return arguments.length?(o=En(t),n):o},n.endAngle=function(t){return arguments.length?(a=En(t),n):a},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Io;return[Math.cos(t)*n,Math.sin(t)*n]},n};var ql="auto";ao.svg.line=function(){return Mu(m)};var Tl=ao.map({linear:xu,"linear-closed":bu,step:_u,"step-before":wu,"step-after":Su,basis:zu,"basis-open":Lu,"basis-closed":qu,bundle:Tu,cardinal:Eu,"cardinal-open":ku,"cardinal-closed":Nu,monotone:Fu});Tl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Rl=[0,2/3,1/3,0],Dl=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];ao.svg.line.radial=function(){var n=Mu(Hu);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wu.reverse=Su,Su.reverse=wu,ao.svg.area=function(){return Ou(m)},ao.svg.area.radial=function(){var n=Ou(Hu);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ao.svg.chord=function(){function n(n,a){var l=t(this,u,n,a),c=t(this,o,n,a);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var i=t.call(n,e,r),u=a.call(n,i,r),o=l.call(n,i,r)-Io,f=c.call(n,i,r)-Io;return{r:u,a0:o,a1:f,p0:[u*Math.cos(o),u*Math.sin(o)],p1:[u*Math.cos(f),u*Math.sin(f)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Fo)+",1 "+t}function i(n,t,e,r){return"Q 0,0 "+r}var u=Me,o=xe,a=Iu,l=gu,c=vu;return n.radius=function(t){return arguments.length?(a=En(t),n):a},n.source=function(t){return arguments.length?(u=En(t),n):u},n.target=function(t){return arguments.length?(o=En(t),n):o},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},ao.svg.diagonal=function(){function n(n,i){var u=t.call(this,n,i),o=e.call(this,n,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yu;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ao.svg.diagonal.radial=function(){var n=ao.svg.diagonal(),t=Yu,e=n.projection;return n.projection=function(n){return arguments.length?e(Zu(t=n)):t},n},ao.svg.symbol=function(){function n(n,r){return(Ul.get(t.call(this,n,r))||$u)(e.call(this,n,r))}var t=Xu,e=Vu;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Ul=ao.map({circle:$u,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Fl)),e=t*Fl;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ao.svg.symbolTypes=Ul.keys();var jl=Math.sqrt(3),Fl=Math.tan(30*Yo);Co.transition=function(n){for(var t,e,r=Hl||++Zl,i=Ku(n),u=[],o=Ol||{time:Date.now(),ease:Nr,delay:0,duration:250},a=-1,l=this.length;++au;u++){i.push(t=[]);for(var e=this[u],a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return Wu(i,this.namespace,this.id)},Yl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(i){i[r][e].tween.set(n,t)})},Yl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function i(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function u(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?$r:Mr,a=ao.ns.qualify(n);return Ju(this,"attr."+n,t,a.local?u:i)},Yl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(i));return r&&function(n){this.setAttribute(i,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(i.space,i.local));return r&&function(n){this.setAttributeNS(i.space,i.local,r(n))}}var i=ao.ns.qualify(n);return this.tween("attr."+n,i.local?r:e)},Yl.style=function(n,e,r){function i(){this.style.removeProperty(n)}function u(e){return null==e?i:(e+="",function(){var i,u=t(this).getComputedStyle(this,null).getPropertyValue(n);return u!==e&&(i=Mr(u,e),function(t){this.style.setProperty(n,i(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ju(this,"style."+n,e,u)},Yl.styleTween=function(n,e,r){function i(i,u){var o=e.call(this,i,u,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,i)},Yl.text=function(n){return Ju(this,"text",n,Gu)},Yl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Yl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ao.ease.apply(ao,arguments)),Y(this,function(r){r[e][t].ease=n}))},Yl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,i,u){r[e][t].delay=+n.call(r,r.__data__,i,u)}:(n=+n,function(r){r[e][t].delay=n}))},Yl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,i,u){r[e][t].duration=Math.max(1,n.call(r,r.__data__,i,u))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Yl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var i=Ol,u=Hl;try{Hl=e,Y(this,function(t,i,u){Ol=t[r][e],n.call(t,t.__data__,i,u)})}finally{Ol=i,Hl=u}}else Y(this,function(i){var u=i[r][e];(u.event||(u.event=ao.dispatch("start","end","interrupt"))).on(n,t)});return this},Yl.transition=function(){for(var n,t,e,r,i=this.id,u=++Zl,o=this.namespace,a=[],l=0,c=this.length;c>l;l++){a.push(n=[]);for(var t=this[l],f=0,s=t.length;s>f;f++)(e=t[f])&&(r=e[o][i],Qu(e,f,o,u,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wu(a,o,u)},ao.svg.axis=function(){function n(n){n.each(function(){var n,c=ao.select(this),f=this.__chart__||e,s=this.__chart__=e.copy(),h=null==l?s.ticks?s.ticks.apply(s,a):s.domain():l,p=null==t?s.tickFormat?s.tickFormat.apply(s,a):m:t,g=c.selectAll(".tick").data(h,s),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Uo),d=ao.transition(g.exit()).style("opacity",Uo).remove(),y=ao.transition(g.order()).style("opacity",1),M=Math.max(i,0)+o,x=Zi(s),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ao.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=y.select("line"),C=g.select("text").text(p),z=v.select("text"),L=y.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=no,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*u+"V0H"+x[1]+"V"+q*u)):(n=to,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*u+","+x[0]+"H0V"+x[1]+"H"+q*u)),E.attr(N,q*i),z.attr(k,q*M),A.attr(S,0).attr(N,q*i),L.attr(w,0).attr(k,q*M),s.rangeBand){var T=s,R=T.rangeBand()/2;f=s=function(n){return T(n)+R}}else f.rangeBand?f=s:d.call(n,s,f);v.call(n,f,s),y.call(n,s,s)})}var t,e=ao.scale.linear(),r=Vl,i=6,u=6,o=3,a=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Xl?t+"":Vl,n):r},n.ticks=function(){return arguments.length?(a=co(arguments),n):a},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(i=+t,u=+arguments[e-1],n):i},n.innerTickSize=function(t){return arguments.length?(i=+t,n):i},n.outerTickSize=function(t){return arguments.length?(u=+t,n):u},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Vl="bottom",Xl={top:1,right:1,bottom:1,left:1};ao.svg.brush=function(){function n(t){t.each(function(){var t=ao.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,m);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return $l[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,s=ao.transition(t),h=ao.transition(o);c&&(l=Zi(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(s)),f&&(l=Zi(f),h.attr("y",l[0]).attr("height",l[1]-l[0]),i(s)),e(s)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function i(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){32==ao.event.keyCode&&(C||(M=null,L[0]-=s[1],L[1]-=h[1],C=2),S())}function v(){32==ao.event.keyCode&&2==C&&(L[0]+=s[1],L[1]+=h[1],C=0,S())}function d(){var n=ao.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ao.event.altKey?(M||(M=[(s[0]+s[1])/2,(h[0]+h[1])/2]),L[0]=s[+(n[0]f?(i=r,r=f):i=f),v[0]!=r||v[1]!=i?(e?a=null:o=null,v[0]=r,v[1]=i,!0):void 0}function m(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ao.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ao.select(ao.event.target),w=l.of(b,arguments),k=ao.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&f,C=_.classed("extent"),z=W(b),L=ao.mouse(b),q=ao.select(t(b)).on("keydown.brush",u).on("keyup.brush",v);if(ao.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",m):q.on("mousemove.brush",d).on("mouseup.brush",m),k.interrupt().selectAll("*").interrupt(),C)L[0]=s[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[s[1-T]-L[0],h[1-R]-L[1]],L[0]=s[T],L[1]=h[R]}else ao.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ao.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,l=N(n,"brushstart","brush","brushend"),c=null,f=null,s=[0,0],h=[0,0],p=!0,g=!0,v=Bl[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:s,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Hl?ao.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,s=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(s,t.x),r=xr(h,t.y);return o=a=null,function(i){s=t.x=e(i),h=t.y=r(i),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=Bl[!c<<1|!f],n):c},n.y=function(t){return arguments.length?(f=t,v=Bl[!c<<1|!f],n):f},n.clamp=function(t){return arguments.length?(c&&f?(p=!!t[0],g=!!t[1]):c?p=!!t:f&&(g=!!t),n):c&&f?[p,g]:c?p:f?g:null},n.extent=function(t){var e,r,i,u,l;return arguments.length?(c&&(e=t[0],r=t[1],f&&(e=e[0],r=r[0]),o=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),e==s[0]&&r==s[1]||(s=[e,r])),f&&(i=t[0],u=t[1],c&&(i=i[1],u=u[1]),a=[i,u],f.invert&&(i=f(i),u=f(u)),i>u&&(l=i,i=u,u=l),i==h[0]&&u==h[1]||(h=[i,u])),n):(c&&(o?(e=o[0],r=o[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),f&&(a?(i=a[0],u=a[1]):(i=h[0],u=h[1],f.invert&&(i=f.invert(i),u=f.invert(u)),i>u&&(l=i,i=u,u=l))),c&&f?[[e,i],[r,u]]:c?[e,r]:f&&[i,u])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!f&&h[0]==h[1]},ao.rebind(n,l,"on")};var $l={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Wl=ga.format=xa.timeFormat,Jl=Wl.utc,Gl=Jl("%Y-%m-%dT%H:%M:%S.%LZ");Wl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?eo:Gl,eo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},eo.toString=Gl.toString,ga.second=On(function(n){return new va(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ga.seconds=ga.second.range,ga.seconds.utc=ga.second.utc.range,ga.minute=On(function(n){return new va(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ga.minutes=ga.minute.range,ga.minutes.utc=ga.minute.utc.range,ga.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new va(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ga.hours=ga.hour.range,ga.hours.utc=ga.hour.utc.range,ga.month=On(function(n){return n=ga.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ga.months=ga.month.range,ga.months.utc=ga.month.utc.range;var Kl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ql=[[ga.second,1],[ga.second,5],[ga.second,15],[ga.second,30],[ga.minute,1],[ga.minute,5],[ga.minute,15],[ga.minute,30],[ga.hour,1],[ga.hour,3],[ga.hour,6],[ga.hour,12],[ga.day,1],[ga.day,2],[ga.week,1],[ga.month,1],[ga.month,3],[ga.year,1]],nc=Wl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),tc={range:function(n,t,e){return ao.range(Math.ceil(n/e)*e,+t,e).map(io)},floor:m,ceil:m};Ql.year=ga.year,ga.scale=function(){return ro(ao.scale.linear(),Ql,nc)};var ec=Ql.map(function(n){return[n[0].utc,n[1]]}),rc=Jl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);ec.year=ga.year.utc,ga.scale.utc=function(){return ro(ao.scale.linear(),ec,rc)},ao.text=An(function(n){return n.responseText}),ao.json=function(n,t){return Cn(n,"application/json",uo,t)},ao.html=function(n,t){return Cn(n,"text/html",oo,t)},ao.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=ao,define(ao)):"object"==typeof module&&module.exports?module.exports=ao:this.d3=ao}(); \ No newline at end of file diff --git a/pagure/static/emoji/emoji_strategy-1.3.1.json b/pagure/static/emoji/emoji_strategy-1.3.1.json deleted file mode 100644 index 169e6ca..0000000 --- a/pagure/static/emoji/emoji_strategy-1.3.1.json +++ /dev/null @@ -1 +0,0 @@ -{"wine_glass": {"keywords": "wine glass alcohol beverage booze bottle drink drunk fermented glass grapes tasting wine winery", "shortname": ":wine_glass:", "unicode": "1F377", "aliases": ""}, "clock830": {"keywords": "clock face eight-thirty clock time", "shortname": ":clock830:", "unicode": "1F563", "aliases": ""}, "rabbit": {"keywords": "rabbit face animal nature", "shortname": ":rabbit:", "unicode": "1F430", "aliases": ""}, "european_post_office": {"keywords": "european post office building", "shortname": ":european_post_office:", "unicode": "1F3E4", "aliases": ""}, "dollar": {"keywords": "banknote with dollar sign bill currency money dollar united states canada australia banknote money currency paper cash bills", "shortname": ":dollar:", "unicode": "1F4B5", "aliases": ""}, "alien": {"keywords": "extraterrestrial alien UFO paul alien ufo", "shortname": ":alien:", "unicode": "1F47D", "aliases": ""}, "crocodile": {"keywords": "crocodile animal nature crocodile croc alligator gator cranky", "shortname": ":crocodile:", "unicode": "1F40A", "aliases": ""}, "smoking": {"keywords": "smoking symbol cigarette kills tobacco smoking cigarette smoke cancer lungs inhale tar nicotine", "shortname": ":smoking:", "unicode": "1F6AC", "aliases": ""}, "white_square_button": {"keywords": "white square button shape", "shortname": ":white_square_button:", "unicode": "1F533", "aliases": ""}, "maple_leaf": {"keywords": "maple leaf canada nature plant vegetable maple leaf syrup canada tree", "shortname": ":maple_leaf:", "unicode": "1F341", "aliases": ""}, "no_bicycles": {"keywords": "no bicycles cyclist prohibited bicycle bike pedal no", "shortname": ":no_bicycles:", "unicode": "1F6B3", "aliases": ""}, "man_with_gua_pi_mao": {"keywords": "man with gua pi mao boy male skullcap chinese asian qing", "shortname": ":man_with_gua_pi_mao:", "unicode": "1F472", "aliases": ""}, "e-mail": {"keywords": "e-mail symbol communication inbox", "shortname": ":e-mail:", "unicode": "1F4E7", "aliases": ":email:"}, "tv": {"keywords": "television oldschool program show technology", "shortname": ":tv:", "unicode": "1F4FA", "aliases": ""}, "open_hands": {"keywords": "open hands sign butterfly fingers", "shortname": ":open_hands:", "unicode": "1F450", "aliases": ""}, "rotating_light": {"keywords": "police cars revolving light 911 ambulance emergency police light police emergency", "shortname": ":rotating_light:", "unicode": "1F6A8", "aliases": ""}, "part_alternation_mark": {"keywords": "part alternation mark graph sing song vocal music karaoke cue letter m japanese", "shortname": ":part_alternation_mark:", "unicode": "303D", "aliases": ""}, "tm": {"keywords": "trade mark sign brand trademark", "shortname": ":tm:", "unicode": "2122", "aliases": ""}, "mountain_cableway": {"keywords": "mountain cableway transportation vehicle mountain cable rail train railway", "shortname": ":mountain_cableway:", "unicode": "1F6A0", "aliases": ""}, "recycle": {"keywords": "black universal recycling symbol arrow environment garbage trash", "shortname": ":recycle:", "unicode": "267B", "aliases": ""}, "smile": {"keywords": "smiling face with open mouth and smiling eyes face funny haha happy joy laugh smile smiley smiling", "shortname": ":smile:", "unicode": "1F604", "aliases": ""}, "large_blue_circle": {"keywords": "large blue circle ", "shortname": ":large_blue_circle:", "unicode": "1F535", "aliases": ""}, "persevere": {"keywords": "persevering face endure persevere face no sick upset", "shortname": ":persevere:", "unicode": "1F623", "aliases": ""}, "open_file_folder": {"keywords": "open file folder documents load", "shortname": ":open_file_folder:", "unicode": "1F4C2", "aliases": ""}, "fax": {"keywords": "fax machine communication technology", "shortname": ":fax:", "unicode": "1F4E0", "aliases": ""}, "woman": {"keywords": "woman female girls", "shortname": ":woman:", "unicode": "1F469", "aliases": ""}, "eight_pointed_black_star": {"keywords": "eight pointed black star ", "shortname": ":eight_pointed_black_star:", "unicode": "2734", "aliases": ""}, "department_store": {"keywords": "department store building mall shopping department store retail sale merchandise", "shortname": ":department_store:", "unicode": "1F3EC", "aliases": ""}, "trident": {"keywords": "trident emblem spear weapon", "shortname": ":trident:", "unicode": "1F531", "aliases": ""}, "oncoming_automobile": {"keywords": "oncoming automobile car transportation vehicle sedan car automobile", "shortname": ":oncoming_automobile:", "unicode": "1F698", "aliases": ""}, "wave": {"keywords": "waving hand sign farewell gesture goodbye hands solong", "shortname": ":wave:", "unicode": "1F44B", "aliases": ""}, "u7a7a": {"keywords": "squared cjk unified ideograph-7a7a chinese empty japanese kanji", "shortname": ":u7a7a:", "unicode": "1F233", "aliases": ""}, "arrow_right": {"keywords": "black rightwards arrow blue-square next", "shortname": ":arrow_right:", "unicode": "27A1", "aliases": ""}, "ticket": {"keywords": "ticket concert event pass ticket show entertainment stub admission proof purchase", "shortname": ":ticket:", "unicode": "1F3AB", "aliases": ""}, "ramen": {"keywords": "steaming bowl chipsticks food japanese noodle ramen noodles bowl steaming soup", "shortname": ":ramen:", "unicode": "1F35C", "aliases": ""}, "twisted_rightwards_arrows": {"keywords": "twisted rightwards arrows blue-square", "shortname": ":twisted_rightwards_arrows:", "unicode": "1F500", "aliases": ""}, "cool": {"keywords": "squared cool blue-square words", "shortname": ":cool:", "unicode": "1F192", "aliases": ""}, "four": {"keywords": "digit four 4 blue-square numbers", "shortname": ":four:", "unicode": "0034-20E3", "aliases": ""}, "school": {"keywords": "school building school university elementary middle high college teach education", "shortname": ":school:", "unicode": "1F3EB", "aliases": ""}, "high_brightness": {"keywords": "high brightness symbol light summer sun", "shortname": ":high_brightness:", "unicode": "1F506", "aliases": ""}, "railway_car": {"keywords": "railway car transportation vehicle railway rail car coach train", "shortname": ":railway_car:", "unicode": "1F683", "aliases": ""}, "notes": {"keywords": "multiple musical notes music score musical music notes music sound melody", "shortname": ":notes:", "unicode": "1F3B6", "aliases": ""}, "white_flower": {"keywords": "white flower japanese white flower teacher school grade score brilliance intelligence homework student assignment praise", "shortname": ":white_flower:", "unicode": "1F4AE", "aliases": ""}, "gun": {"keywords": "pistol violence weapon", "shortname": ":gun:", "unicode": "1F52B", "aliases": ""}, "couple_with_heart": {"keywords": "couple with heart affection dating human like love marriage valentines", "shortname": ":couple_with_heart:", "unicode": "1F491", "aliases": ""}, "no_good": {"keywords": "face with no good gesture female girl woman no stop nope don't not", "shortname": ":no_good:", "unicode": "1F645", "aliases": ""}, "saxophone": {"keywords": "saxophone instrument music saxophone sax music instrument woodwind", "shortname": ":saxophone:", "unicode": "1F3B7", "aliases": ""}, "notebook_with_decorative_cover": {"keywords": "notebook with decorative cover classroom notes paper record", "shortname": ":notebook_with_decorative_cover:", "unicode": "1F4D4", "aliases": ""}, "triumph": {"keywords": "face with look of triumph face gas phew triumph steam breath", "shortname": ":triumph:", "unicode": "1F624", "aliases": ""}, "tea": {"keywords": "teacup without handle bowl breakfast british drink green tea leaf drink teacup hot beverage", "shortname": ":tea:", "unicode": "1F375", "aliases": ""}, "suspension_railway": {"keywords": "suspension railway transportation vehicle suspension railway rail train transportation", "shortname": ":suspension_railway:", "unicode": "1F69F", "aliases": ""}, "arrow_left": {"keywords": "leftwards black arrow arrow blue-square previous", "shortname": ":arrow_left:", "unicode": "2B05", "aliases": ""}, "zero": {"keywords": "digit zero blue-square null numbers", "shortname": ":zero:", "unicode": "0030-20E3", "aliases": ""}, "small_orange_diamond": {"keywords": "small orange diamond shape", "shortname": ":small_orange_diamond:", "unicode": "1F538", "aliases": ""}, "cactus": {"keywords": "cactus nature plant vegetable cactus desert drought spike poke", "shortname": ":cactus:", "unicode": "1F335", "aliases": ""}, "spaghetti": {"keywords": "spaghetti food italian noodle spaghetti noodles tomato sauce italian", "shortname": ":spaghetti:", "unicode": "1F35D", "aliases": ""}, "white_small_square": {"keywords": "white small square shape", "shortname": ":white_small_square:", "unicode": "25AB", "aliases": ""}, "ribbon": {"keywords": "ribbon bowtie decoration girl pink ribbon lace wrap decorate", "shortname": ":ribbon:", "unicode": "1F380", "aliases": ""}, "cinema": {"keywords": "cinema blue-square film movie record cinema movie theater motion picture", "shortname": ":cinema:", "unicode": "1F3A6", "aliases": ""}, "mega": {"keywords": "cheering megaphone sound speaker volume", "shortname": ":mega:", "unicode": "1F4E3", "aliases": ""}, "abc": {"keywords": "input symbol for latin letters alphabet blue-square", "shortname": ":abc:", "unicode": "1F524", "aliases": ""}, "purple_heart": {"keywords": "purple heart affection like love valentines purple violet heart love sensitive understanding compassionate compassion duty honor royalty veteran sacrifice", "shortname": ":purple_heart:", "unicode": "1F49C", "aliases": ""}, "love_letter": {"keywords": "love letter affection email envelope like valentines love letter kiss heart", "shortname": ":love_letter:", "unicode": "1F48C", "aliases": ""}, "file_folder": {"keywords": "file folder documents", "shortname": ":file_folder:", "unicode": "1F4C1", "aliases": ""}, "clipboard": {"keywords": "clipboard documents stationery", "shortname": ":clipboard:", "unicode": "1F4CB", "aliases": ""}, "baby_bottle": {"keywords": "baby bottle container food baby bottle milk mother nipple newborn formula", "shortname": ":baby_bottle:", "unicode": "1F37C", "aliases": ""}, "new": {"keywords": "squared new blue-square", "shortname": ":new:", "unicode": "1F195", "aliases": ""}, "bird": {"keywords": "bird animal fly nature tweet", "shortname": ":bird:", "unicode": "1F426", "aliases": ""}, "1234": {"keywords": "input symbol for numbers blue-square numbers", "shortname": ":1234:", "unicode": "1F522", "aliases": ""}, "smiling_imp": {"keywords": "smiling face with horns devil horns horns devil impish trouble", "shortname": ":smiling_imp:", "unicode": "1F608", "aliases": ""}, "no_smoking": {"keywords": "no smoking symbol cigarette no smoking cigarette smoke cancer lungs inhale tar nicotine", "shortname": ":no_smoking:", "unicode": "1F6AD", "aliases": ""}, "herb": {"keywords": "herb grass lawn medicine plant vegetable weed herb spice plant cook cooking", "shortname": ":herb:", "unicode": "1F33F", "aliases": ""}, "pouting_cat": {"keywords": "pouting cat face animal cats pout annoyed miffed glower frown", "shortname": ":pouting_cat:", "unicode": "1F63E", "aliases": ""}, "u5408": {"keywords": "squared cjk unified ideograph-5408 chinese japanese join kanji", "shortname": ":u5408:", "unicode": "1F234", "aliases": ""}, "punch": {"keywords": "fisted hand sign fist hand", "shortname": ":punch:", "unicode": "1F44A", "aliases": ""}, "surfer": {"keywords": "surfer ocean sea sports surfer surf wave ocean ride swell", "shortname": ":surfer:", "unicode": "1F3C4", "aliases": ""}, "house_with_garden": {"keywords": "house with garden home nature plant", "shortname": ":house_with_garden:", "unicode": "1F3E1", "aliases": ""}, "baseball": {"keywords": "baseball MLB balls sports", "shortname": ":baseball:", "unicode": "26BE", "aliases": ""}, "busstop": {"keywords": "bus stop transportation bus stop city transport transportation", "shortname": ":busstop:", "unicode": "1F68F", "aliases": ""}, "new_moon": {"keywords": "new moon symbol nature moon new sky night cheese phase", "shortname": ":new_moon:", "unicode": "1F311", "aliases": ""}, "100": {"keywords": "hundred points symbol numbers perfect score 100 percent a plus perfect school quiz score test exam", "shortname": ":100:", "unicode": "1F4AF", "aliases": ""}, "thumbsup": {"keywords": "thumbs up sign cool hand like yes", "shortname": ":thumbsup:", "unicode": "1F44D", "aliases": ":+1:"}, "bust_in_silhouette": {"keywords": "bust in silhouette human man person user silhouette person user member account guest icon avatar profile me myself i", "shortname": ":bust_in_silhouette:", "unicode": "1F464", "aliases": ""}, "boy": {"keywords": "boy guy male man", "shortname": ":boy:", "unicode": "1F466", "aliases": ""}, "arrow_lower_left": {"keywords": "south west arrow arrow blue-square", "shortname": ":arrow_lower_left:", "unicode": "2199", "aliases": ""}, "no_entry": {"keywords": "no entry bad denied limit privacy security stop", "shortname": ":no_entry:", "unicode": "26D4", "aliases": ""}, "see_no_evil": {"keywords": "see-no-evil monkey animal monkey nature monkey see eyes vision sight mizaru", "shortname": ":see_no_evil:", "unicode": "1F648", "aliases": ""}, "metro": {"keywords": "metro blue-square mrt transportation tube underground metro subway underground train", "shortname": ":metro:", "unicode": "1F687", "aliases": ""}, "leaves": {"keywords": "leaf fluttering in wind grass lawn nature plant tree vegetable leaves leaf wind float fluttering", "shortname": ":leaves:", "unicode": "1F343", "aliases": ""}, "heavy_plus_sign": {"keywords": "heavy plus sign calculation math", "shortname": ":heavy_plus_sign:", "unicode": "2795", "aliases": ""}, "roller_coaster": {"keywords": "roller coaster carnival fun photo play playground roller coaster amusement park fair ride entertainment", "shortname": ":roller_coaster:", "unicode": "1F3A2", "aliases": ""}, "thought_balloon": {"keywords": "thought balloon bubble cloud speech thought balloon comic think day dream wonder", "shortname": ":thought_balloon:", "unicode": "1F4AD", "aliases": ""}, "bow": {"keywords": "person bowing deeply boy male man sorry bow respect curtsy bend", "shortname": ":bow:", "unicode": "1F647", "aliases": ""}, "dragon_face": {"keywords": "dragon face animal chinese green myth nature dragon head fire legendary myth", "shortname": ":dragon_face:", "unicode": "1F432", "aliases": ""}, "hamster": {"keywords": "hamster face animal nature", "shortname": ":hamster:", "unicode": "1F439", "aliases": ""}, "waxing_gibbous_moon": {"keywords": "waxing gibbous moon symbol nature", "shortname": ":waxing_gibbous_moon:", "unicode": "1F314", "aliases": ""}, "cookie": {"keywords": "cookie chocolate food oreo snack cookie dessert biscuit sweet chocolate", "shortname": ":cookie:", "unicode": "1F36A", "aliases": ""}, "massage": {"keywords": "face massage female girl woman", "shortname": ":massage:", "unicode": "1F486", "aliases": ""}, "children_crossing": {"keywords": "children crossing school children kids caution crossing street crosswalk slow", "shortname": ":children_crossing:", "unicode": "1F6B8", "aliases": ""}, "apple": {"keywords": "red apple fruit mac apple fruit electronics red doctor teacher school core", "shortname": ":apple:", "unicode": "1F34E", "aliases": ""}, "family": {"keywords": "family child dad father home mom mother parents family mother father child girl boy group unit", "shortname": ":family:", "unicode": "1F46A", "aliases": ""}, "arrow_up_down": {"keywords": "up down arrow blue-square", "shortname": ":arrow_up_down:", "unicode": "2195", "aliases": ""}, "mount_fuji": {"keywords": "mount fuji japan mountain nature photo", "shortname": ":mount_fuji:", "unicode": "1F5FB", "aliases": ""}, "keycap_ten": {"keywords": "keycap ten 10 blue-square numbers", "shortname": ":keycap_ten:", "unicode": "1F51F", "aliases": ""}, "outbox_tray": {"keywords": "outbox tray email inbox", "shortname": ":outbox_tray:", "unicode": "1F4E4", "aliases": ""}, "clock330": {"keywords": "clock face three-thirty clock time", "shortname": ":clock330:", "unicode": "1F55E", "aliases": ""}, "cloud": {"keywords": "cloud sky weather", "shortname": ":cloud:", "unicode": "2601", "aliases": ""}, "honey_pot": {"keywords": "honey pot bees sweet honey pot bees pooh bear", "shortname": ":honey_pot:", "unicode": "1F36F", "aliases": ""}, "red_car": {"keywords": "automobile transportation vehicle", "shortname": ":red_car:", "unicode": "1F697", "aliases": ""}, "sake": {"keywords": "sake bottle and cup beverage drink drunk wine sake wine rice ferment alcohol japanese drink", "shortname": ":sake:", "unicode": "1F376", "aliases": ""}, "confounded": {"keywords": "confounded face confused face sick unwell confound amaze perplex puzzle mystify", "shortname": ":confounded:", "unicode": "1F616", "aliases": ""}, "angry": {"keywords": "angry face angry livid mad vexed irritated annoyed face frustrated mad", "shortname": ":angry:", "unicode": "1F620", "aliases": ""}, "poodle": {"keywords": "poodle 101 animal dog nature poodle dog clip showy sophisticated vain", "shortname": ":poodle:", "unicode": "1F429", "aliases": ""}, "frog": {"keywords": "frog face animal nature", "shortname": ":frog:", "unicode": "1F438", "aliases": ""}, "musical_note": {"keywords": "musical note score musical music note music sound", "shortname": ":musical_note:", "unicode": "1F3B5", "aliases": ""}, "camera": {"keywords": "camera gadgets photo", "shortname": ":camera:", "unicode": "1F4F7", "aliases": ""}, "iphone": {"keywords": "mobile phone apple dial gadgets technology", "shortname": ":iphone:", "unicode": "1F4F1", "aliases": ""}, "sweat_smile": {"keywords": "smiling face with open mouth and cold sweat face happy hot smiling cold sweat perspiration", "shortname": ":sweat_smile:", "unicode": "1F605", "aliases": ""}, "aries": {"keywords": "aries aries ram astrology greek constellation stars zodiac sign purple-square sign zodiac horoscope", "shortname": ":aries:", "unicode": "2648", "aliases": ""}, "ear_of_rice": {"keywords": "ear of rice nature plant ear rice food plant seed", "shortname": ":ear_of_rice:", "unicode": "1F33E", "aliases": ""}, "video_camera": {"keywords": "video camera film record", "shortname": ":video_camera:", "unicode": "1F4F9", "aliases": ""}, "mouse2": {"keywords": "mouse animal nature mouse mice rodent", "shortname": ":mouse2:", "unicode": "1F401", "aliases": ""}, "chestnut": {"keywords": "chestnut food squirrel chestnut roasted food tree", "shortname": ":chestnut:", "unicode": "1F330", "aliases": ""}, "pencil": {"keywords": "memo documents paper station write", "shortname": ":pencil:", "unicode": "1F4DD", "aliases": ""}, "guardsman": {"keywords": "guardsman british gb male man uk guardsman guard bearskin hat british queen ceremonial military", "shortname": ":guardsman:", "unicode": "1F482", "aliases": ""}, "door": {"keywords": "door entry exit house door doorway entrance enter exit entry", "shortname": ":door:", "unicode": "1F6AA", "aliases": ""}, "steam_locomotive": {"keywords": "steam locomotive train transportation vehicle locomotive steam train engine", "shortname": ":steam_locomotive:", "unicode": "1F682", "aliases": ""}, "tangerine": {"keywords": "tangerine food fruit nature tangerine citrus orange", "shortname": ":tangerine:", "unicode": "1F34A", "aliases": ""}, "bike": {"keywords": "bicycle bicycle exercise hipster sports bike pedal bicycle transportation", "shortname": ":bike:", "unicode": "1F6B2", "aliases": ""}, "melon": {"keywords": "melon food fruit nature melon cantaloupe honeydew", "shortname": ":melon:", "unicode": "1F348", "aliases": ""}, "train": {"keywords": "Tram Car tram rail", "shortname": ":train:", "unicode": "1F68B", "aliases": ""}, "beers": {"keywords": "clinking beer mugs beverage drink drunk party pub relax beer beers cheers mug toast celebrate pub bar jolly hops clink", "shortname": ":beers:", "unicode": "1F37B", "aliases": ""}, "water_buffalo": {"keywords": "water buffalo animal cow nature ox water buffalo asia bovine milk dairy", "shortname": ":water_buffalo:", "unicode": "1F403", "aliases": ""}, "baby": {"keywords": "baby boy child infant", "shortname": ":baby:", "unicode": "1F476", "aliases": ""}, "mailbox_closed": {"keywords": "closed mailbox with lowered flag communication email inbox", "shortname": ":mailbox_closed:", "unicode": "1F4EA", "aliases": ""}, "curly_loop": {"keywords": "curly loop scribble", "shortname": ":curly_loop:", "unicode": "27B0", "aliases": ""}, "sleeping": {"keywords": "sleeping face face sleepy tired sleep sleepy sleeping snore", "shortname": ":sleeping:", "unicode": "1F634", "aliases": ""}, "pouch": {"keywords": "pouch accessories bag pouch bag cosmetic packing grandma makeup", "shortname": ":pouch:", "unicode": "1F45D", "aliases": ""}, "jack_o_lantern": {"keywords": "jack-o-lantern halloween jack-o-lantern pumpkin halloween holiday carve autumn fall october saints costume spooky horror scary scared dead", "shortname": ":jack_o_lantern:", "unicode": "1F383", "aliases": ""}, "izakaya_lantern": {"keywords": "izakaya lantern light izakaya lantern stay drink alcohol bar sake restaurant", "shortname": ":izakaya_lantern:", "unicode": "1F3EE", "aliases": ""}, "palm_tree": {"keywords": "palm tree nature plant vegetable palm tree coconuts fronds warm tropical", "shortname": ":palm_tree:", "unicode": "1F334", "aliases": ""}, "cat": {"keywords": "cat face animal meow", "shortname": ":cat:", "unicode": "1F431", "aliases": ""}, "dizzy": {"keywords": "dizzy symbol shoot sparkle star dizzy drunk sick intoxicated squeans starburst star", "shortname": ":dizzy:", "unicode": "1F4AB", "aliases": ""}, "nine": {"keywords": "digit nine 9 blue-square numbers", "shortname": ":nine:", "unicode": "0039-20E3", "aliases": ""}, "chocolate_bar": {"keywords": "chocolate bar desert food snack chocolate bar candy coca hershey's", "shortname": ":chocolate_bar:", "unicode": "1F36B", "aliases": ""}, "v": {"keywords": "victory hand fingers hand ohyeah peace two victory", "shortname": ":v:", "unicode": "270C", "aliases": ""}, "running_shirt_with_sash": {"keywords": "running shirt with sash pageant play running run shirt cloths compete sports", "shortname": ":running_shirt_with_sash:", "unicode": "1F3BD", "aliases": ""}, "raised_hands": {"keywords": "person raising both hands in celebration gesture hooray winning woot yay banzai", "shortname": ":raised_hands:", "unicode": "1F64C", "aliases": ""}, "put_litter_in_its_place": {"keywords": "put litter in its place symbol blue-square litter waste trash garbage receptacle can", "shortname": ":put_litter_in_its_place:", "unicode": "1F6AE", "aliases": ""}, "game_die": {"keywords": "game die dice game die dice craps gamble play", "shortname": ":game_die:", "unicode": "1F3B2", "aliases": ""}, "abcd": {"keywords": "input symbol for latin small letters alphabet blue-square", "shortname": ":abcd:", "unicode": "1F521", "aliases": ""}, "heart": {"keywords": "heavy black heart like love red pink black heart love passion romance intense desire death evil cold valentines", "shortname": ":heart:", "unicode": "2764", "aliases": ""}, "chart_with_upwards_trend": {"keywords": "chart with upwards trend graph", "shortname": ":chart_with_upwards_trend:", "unicode": "1F4C8", "aliases": ""}, "green_heart": {"keywords": "green heart affection like love valentines green heart love nature rebirth reborn jealous clingy envious possessive", "shortname": ":green_heart:", "unicode": "1F49A", "aliases": ""}, "hamburger": {"keywords": "hamburger food meat hamburger burger meat cow beef", "shortname": ":hamburger:", "unicode": "1F354", "aliases": ""}, "pushpin": {"keywords": "pushpin stationery", "shortname": ":pushpin:", "unicode": "1F4CC", "aliases": ""}, "lock": {"keywords": "lock password security", "shortname": ":lock:", "unicode": "1F512", "aliases": ""}, "dolphin": {"keywords": "dolphin animal fins fish flipper nature ocean sea", "shortname": ":dolphin:", "unicode": "1F42C", "aliases": ""}, "confused": {"keywords": "confused face confused confuse daze perplex puzzle indifference skeptical undecided uneasy hesitant", "shortname": ":confused:", "unicode": "1F615", "aliases": ""}, "accept": {"keywords": "circled ideograph accept agree chinese good kanji ok yes", "shortname": ":accept:", "unicode": "1F251", "aliases": ""}, "night_with_stars": {"keywords": "night with stars night star cloudless evening planets space sky", "shortname": ":night_with_stars:", "unicode": "1F303", "aliases": ""}, "pig2": {"keywords": "pig animal nature pig piggy pork ham hog bacon oink slop livestock greed greedy", "shortname": ":pig2:", "unicode": "1F416", "aliases": ""}, "white_medium_small_square": {"keywords": "white medium small square shape", "shortname": ":white_medium_small_square:", "unicode": "25FD", "aliases": ""}, "sunglasses": {"keywords": "smiling face with sunglasses cool face smiling sunglasses sun glasses sunny cool smooth", "shortname": ":sunglasses:", "unicode": "1F60E", "aliases": ""}, "airplane": {"keywords": "airplane flight transportation vehicle airplane plane airport travel airlines fly jet jumbo boeing airbus", "shortname": ":airplane:", "unicode": "2708", "aliases": ""}, "dress": {"keywords": "dress clothes fashion", "shortname": ":dress:", "unicode": "1F457", "aliases": ""}, "kissing_closed_eyes": {"keywords": "kissing face with closed eyes affection face infatuation like love valentines kissing kiss passion puckered heart love smooch", "shortname": ":kissing_closed_eyes:", "unicode": "1F61A", "aliases": ""}, "earth_americas": {"keywords": "earth globe americas USA globe international world earth globe space planet north south america americas home", "shortname": ":earth_americas:", "unicode": "1F30E", "aliases": ""}, "scorpius": {"keywords": "scorpius scorpius scorpion scorpio astrology greek constellation stars zodiac sign sign zodiac horoscope", "shortname": ":scorpius:", "unicode": "264F", "aliases": ""}, "sailboat": {"keywords": "sailboat ship transportation", "shortname": ":sailboat:", "unicode": "26F5", "aliases": ""}, "speedboat": {"keywords": "speedboat ship transportation vehicle motor speed ski power boat", "shortname": ":speedboat:", "unicode": "1F6A4", "aliases": ""}, "six": {"keywords": "digit six 6 blue-square numbers", "shortname": ":six:", "unicode": "0036-20E3", "aliases": ""}, "ledger": {"keywords": "ledger notes paper", "shortname": ":ledger:", "unicode": "1F4D2", "aliases": ""}, "id": {"keywords": "squared id purple-square words", "shortname": ":id:", "unicode": "1F194", "aliases": ""}, "tomato": {"keywords": "tomato food fruit nature vegetable tomato fruit sauce italian", "shortname": ":tomato:", "unicode": "1F345", "aliases": ""}, "leftwards_arrow_with_hook": {"keywords": "leftwards arrow with hook ", "shortname": ":leftwards_arrow_with_hook:", "unicode": "21A9", "aliases": ""}, "rewind": {"keywords": "black left-pointing double triangle blue-square play", "shortname": ":rewind:", "unicode": "23EA", "aliases": ""}, "wavy_dash": {"keywords": "wavy dash draw line", "shortname": ":wavy_dash:", "unicode": "3030", "aliases": ""}, "earth_asia": {"keywords": "earth globe asia-australia east globe international world earth globe space planet asia australia home", "shortname": ":earth_asia:", "unicode": "1F30F", "aliases": ""}, "goat": {"keywords": "goat animal nature goat sheep kid billy livestock", "shortname": ":goat:", "unicode": "1F410", "aliases": ""}, "pizza": {"keywords": "slice of pizza food party pizza pie new york italian italy slice peperoni", "shortname": ":pizza:", "unicode": "1F355", "aliases": ""}, "heavy_check_mark": {"keywords": "heavy check mark nike ok", "shortname": ":heavy_check_mark:", "unicode": "2714", "aliases": ""}, "bouquet": {"keywords": "bouquet flowers nature", "shortname": ":bouquet:", "unicode": "1F490", "aliases": ""}, "disappointed_relieved": {"keywords": "disappointed but relieved face face nervous phew sweat disappoint relief", "shortname": ":disappointed_relieved:", "unicode": "1F625", "aliases": ""}, "sunny": {"keywords": "black sun with rays brightness weather", "shortname": ":sunny:", "unicode": "2600", "aliases": ""}, "customs": {"keywords": "customs border passport customs travel foreign goods check authority government", "shortname": ":customs:", "unicode": "1F6C3", "aliases": ""}, "sun_with_face": {"keywords": "sun with face morning sun anthropomorphic face sky", "shortname": ":sun_with_face:", "unicode": "1F31E", "aliases": ""}, "birthday": {"keywords": "birthday cake cake party birthday birth cake dessert wish celebrate", "shortname": ":birthday:", "unicode": "1F382", "aliases": ""}, "fast_forward": {"keywords": "black right-pointing double triangle blue-square", "shortname": ":fast_forward:", "unicode": "23E9", "aliases": ""}, "heartpulse": {"keywords": "growing heart affection like love valentines", "shortname": ":heartpulse:", "unicode": "1F497", "aliases": ""}, "mag": {"keywords": "left-pointing magnifying glass search zoom detective investigator detail details", "shortname": ":mag:", "unicode": "1F50D", "aliases": ""}, "date": {"keywords": "calendar calendar schedule", "shortname": ":date:", "unicode": "1F4C5", "aliases": ""}, "sparkles": {"keywords": "sparkles cool shine shiny stars", "shortname": ":sparkles:", "unicode": "2728", "aliases": ""}, "man": {"keywords": "man classy dad father guy mustashe", "shortname": ":man:", "unicode": "1F468", "aliases": ""}, "a": {"keywords": "negative squared latin capital letter a alphabet letter red-square", "shortname": ":a:", "unicode": "1F170", "aliases": ""}, "headphones": {"keywords": "headphone gadgets music score headphone sound music ears beats buds audio listen", "shortname": ":headphones:", "unicode": "1F3A7", "aliases": ""}, "curry": {"keywords": "curry and rice food hot indian spicy curry spice flavor food meal", "shortname": ":curry:", "unicode": "1F35B", "aliases": ""}, "wheelchair": {"keywords": "wheelchair symbol blue-square disabled", "shortname": ":wheelchair:", "unicode": "267F", "aliases": ""}, "dragon": {"keywords": "dragon animal chinese green myth nature dragon fire legendary myth", "shortname": ":dragon:", "unicode": "1F409", "aliases": ""}, "tulip": {"keywords": "tulip flowers nature plant tulip flower bulb spring easter", "shortname": ":tulip:", "unicode": "1F337", "aliases": ""}, "truck": {"keywords": "delivery truck cars transportation truck delivery package", "shortname": ":truck:", "unicode": "1F69A", "aliases": ""}, "wrench": {"keywords": "wrench diy ikea tools", "shortname": ":wrench:", "unicode": "1F527", "aliases": ""}, "ambulance": {"keywords": "ambulance 911 health ambulance emergency medical help assistance", "shortname": ":ambulance:", "unicode": "1F691", "aliases": ""}, "sa": {"keywords": "squared katakana sa blue-square japanese", "shortname": ":sa:", "unicode": "1F202", "aliases": ""}, "point_up_2": {"keywords": "white up pointing backhand index direction fingers hand", "shortname": ":point_up_2:", "unicode": "1F446", "aliases": ""}, "egg": {"keywords": "cooking breakfast food egg fry pan flat cook frying cooking utensil", "shortname": ":egg:", "unicode": "1F373", "aliases": ""}, "small_red_triangle": {"keywords": "up-pointing red triangle shape", "shortname": ":small_red_triangle:", "unicode": "1F53A", "aliases": ""}, "office": {"keywords": "office building building bureau work", "shortname": ":office:", "unicode": "1F3E2", "aliases": ""}, "mute": {"keywords": "speaker with cancellation stroke sound volume", "shortname": ":mute:", "unicode": "1F507", "aliases": ""}, "clapper": {"keywords": "clapper board film movie record clapper board clapboard movie film take", "shortname": ":clapper:", "unicode": "1F3AC", "aliases": ""}, "haircut": {"keywords": "haircut female girl woman", "shortname": ":haircut:", "unicode": "1F487", "aliases": ""}, "soon": {"keywords": "soon with rightwards arrow above arrow words", "shortname": ":soon:", "unicode": "1F51C", "aliases": ""}, "symbols": {"keywords": "input symbol for symbols blue-square", "shortname": ":symbols:", "unicode": "1F523", "aliases": ""}, "sob": {"keywords": "loudly crying face cry face sad tears upset cry sob tears sad melancholy morn somber hurt", "shortname": ":sob:", "unicode": "1F62D", "aliases": ""}, "wolf": {"keywords": "wolf face animal nature", "shortname": ":wolf:", "unicode": "1F43A", "aliases": ""}, "japan": {"keywords": "silhouette of japan nation", "shortname": ":japan:", "unicode": "1F5FE", "aliases": ""}, "post_office": {"keywords": "japanese post office building communication email", "shortname": ":post_office:", "unicode": "1F3E3", "aliases": ""}, "last_quarter_moon_with_face": {"keywords": "last quarter moon with face nature moon last quarter anthropomorphic face sky night cheese phase", "shortname": ":last_quarter_moon_with_face:", "unicode": "1F31C", "aliases": ""}, "pray": {"keywords": "person with folded hands highfive hope namaste please wish pray high five hands sorrow regret sorry", "shortname": ":pray:", "unicode": "1F64F", "aliases": ""}, "flushed": {"keywords": "flushed face blush face flattered flush blush red pink cheeks shy", "shortname": ":flushed:", "unicode": "1F633", "aliases": ""}, "dizzy_face": {"keywords": "dizzy face dizzy drunk inebriated face spent unconscious xox", "shortname": ":dizzy_face:", "unicode": "1F635", "aliases": ""}, "rugby_football": {"keywords": "rugby football sports rugby football ball sport team england", "shortname": ":rugby_football:", "unicode": "1F3C9", "aliases": ""}, "currency_exchange": {"keywords": "currency exchange dollar money travel", "shortname": ":currency_exchange:", "unicode": "1F4B1", "aliases": ""}, "paperclip": {"keywords": "paperclip documents stationery", "shortname": ":paperclip:", "unicode": "1F4CE", "aliases": ""}, "moneybag": {"keywords": "money bag coins dollar payment", "shortname": ":moneybag:", "unicode": "1F4B0", "aliases": ""}, "mailbox_with_no_mail": {"keywords": "open mailbox with lowered flag email inbox", "shortname": ":mailbox_with_no_mail:", "unicode": "1F4ED", "aliases": ""}, "soccer": {"keywords": "soccer ball balls fifa football sports european football", "shortname": ":soccer:", "unicode": "26BD", "aliases": ""}, "dolls": {"keywords": "japanese dolls japanese kimono toy dolls japan japanese day girls emperor empress pray blessing imperial family royal", "shortname": ":dolls:", "unicode": "1F38E", "aliases": ""}, "poop": {"keywords": "pile of poo poop shit shitface turd poo", "shortname": ":poop:", "unicode": "1F4A9", "aliases": ":shit: :hankey: :poo:"}, "coffee": {"keywords": "hot beverage beverage cafe drink espresso", "shortname": ":coffee:", "unicode": "2615", "aliases": ""}, "full_moon_with_face": {"keywords": "full moon with face night moon full anthropomorphic face sky night cheese phase spooky werewolves monsters", "shortname": ":full_moon_with_face:", "unicode": "1F31D", "aliases": ""}, "neutral_face": {"keywords": "neutral face face indifference neutral objective impartial blank", "shortname": ":neutral_face:", "unicode": "1F610", "aliases": ""}, "elephant": {"keywords": "elephant animal nature nose thailand", "shortname": ":elephant:", "unicode": "1F418", "aliases": ""}, "open_mouth": {"keywords": "face with open mouth face impressed mouth open jaw gapping surprise wow", "shortname": ":open_mouth:", "unicode": "1F62E", "aliases": ""}, "bar_chart": {"keywords": "bar chart graph presentation stats", "shortname": ":bar_chart:", "unicode": "1F4CA", "aliases": ""}, "european_castle": {"keywords": "european castle building history royalty castle european residence royalty disneyland disney fort fortified moat tower princess prince lord king queen fortress nobel stronghold", "shortname": ":european_castle:", "unicode": "1F3F0", "aliases": ""}, "signal_strength": {"keywords": "antenna with bars blue-square", "shortname": ":signal_strength:", "unicode": "1F4F6", "aliases": ""}, "monkey_face": {"keywords": "monkey face animal nature", "shortname": ":monkey_face:", "unicode": "1F435", "aliases": ""}, "snake": {"keywords": "snake animal evil", "shortname": ":snake:", "unicode": "1F40D", "aliases": ""}, "kiss": {"keywords": "kiss mark affection face like lips love valentines", "shortname": ":kiss:", "unicode": "1F48B", "aliases": ""}, "blue_car": {"keywords": "recreational vehicle car suv car wagon automobile", "shortname": ":blue_car:", "unicode": "1F699", "aliases": ""}, "confetti_ball": {"keywords": "confetti ball festival party party congratulations confetti ball celebrate win birthday new years wedding", "shortname": ":confetti_ball:", "unicode": "1F38A", "aliases": ""}, "bath": {"keywords": "bath clean shower bath tub basin wash bubble soak bathroom soap water clean shampoo lather water", "shortname": ":bath:", "unicode": "1F6C0", "aliases": ""}, "bank": {"keywords": "bank building", "shortname": ":bank:", "unicode": "1F3E6", "aliases": ""}, "bread": {"keywords": "bread breakfast food toast wheat bread loaf yeast", "shortname": ":bread:", "unicode": "1F35E", "aliases": ""}, "rice_ball": {"keywords": "rice ball food japanese rice ball white nori seaweed japanese", "shortname": ":rice_ball:", "unicode": "1F359", "aliases": ""}, "oncoming_police_car": {"keywords": "oncoming police car enforcement law vehicle police car emergency ticket citation crime help officer", "shortname": ":oncoming_police_car:", "unicode": "1F694", "aliases": ""}, "tram": {"keywords": "tram transportation vehicle tram transportation transport", "shortname": ":tram:", "unicode": "1F68A", "aliases": ""}, "point_left": {"keywords": "white left pointing backhand index direction fingers hand", "shortname": ":point_left:", "unicode": "1F448", "aliases": ""}, "tokyo_tower": {"keywords": "tokyo tower japan photo", "shortname": ":tokyo_tower:", "unicode": "1F5FC", "aliases": ""}, "sos": {"keywords": "squared sos emergency help red-square words", "shortname": ":sos:", "unicode": "1F198", "aliases": ""}, "weary": {"keywords": "weary face face frustrated sad sleepy tired weary sleepy tired tiredness study finals school exhausted", "shortname": ":weary:", "unicode": "1F629", "aliases": ""}, "clock930": {"keywords": "clock face nine-thirty clock time", "shortname": ":clock930:", "unicode": "1F564", "aliases": ""}, "fishing_pole_and_fish": {"keywords": "fishing pole and fish food hobby fish fishing pole", "shortname": ":fishing_pole_and_fish:", "unicode": "1F3A3", "aliases": ""}, "repeat_one": {"keywords": "clockwise rightwards and leftwards open circle arr blue-square loop", "shortname": ":repeat_one:", "unicode": "1F502", "aliases": ""}, "bowling": {"keywords": "bowling fun play sports bowl bowling ball pin strike spare game", "shortname": ":bowling:", "unicode": "1F3B3", "aliases": ""}, "thumbsdown": {"keywords": "thumbs down sign hand no", "shortname": ":thumbsdown:", "unicode": "1F44E", "aliases": ":-1:"}, "older_woman": {"keywords": "older woman female girl women grandma grandmother", "shortname": ":older_woman:", "unicode": "1F475", "aliases": ":grandma:"}, "smiley_cat": {"keywords": "smiling cat face with open mouth animal cats happy smile smiley cat happy", "shortname": ":smiley_cat:", "unicode": "1F63A", "aliases": ""}, "information_source": {"keywords": "information source alphabet blue-square letter", "shortname": ":information_source:", "unicode": "2139", "aliases": ""}, "telescope": {"keywords": "telescope space stars", "shortname": ":telescope:", "unicode": "1F52D", "aliases": ""}, "beginner": {"keywords": "japanese symbol for beginner badge shield", "shortname": ":beginner:", "unicode": "1F530", "aliases": ""}, "postal_horn": {"keywords": "postal horn instrument music", "shortname": ":postal_horn:", "unicode": "1F4EF", "aliases": ""}, "house": {"keywords": "house building building home house home residence dwelling mansion bungalow ranch craftsman", "shortname": ":house:", "unicode": "1F3E0", "aliases": ""}, "fish": {"keywords": "fish animal food nature", "shortname": ":fish:", "unicode": "1F41F", "aliases": ""}, "construction_worker": {"keywords": "construction worker human male man wip", "shortname": ":construction_worker:", "unicode": "1F477", "aliases": ""}, "u7121": {"keywords": "squared cjk unified ideograph-7121 chinese japanese kanji no nothing orange-square", "shortname": ":u7121:", "unicode": "1F21A", "aliases": ""}, "mobile_phone_off": {"keywords": "mobile phone off mute", "shortname": ":mobile_phone_off:", "unicode": "1F4F4", "aliases": ""}, "unlock": {"keywords": "open lock privacy security", "shortname": ":unlock:", "unicode": "1F513", "aliases": ""}, "books": {"keywords": "books library literature", "shortname": ":books:", "unicode": "1F4DA", "aliases": ""}, "fist": {"keywords": "raised fist fingers grasp hand", "shortname": ":fist:", "unicode": "270A", "aliases": ""}, "beetle": {"keywords": "lady beetle insect nature lady bug ladybug ladybird beetle cow lady cow insect endearment", "shortname": ":beetle:", "unicode": "1F41E", "aliases": ""}, "lock_with_ink_pen": {"keywords": "lock with ink pen secret security", "shortname": ":lock_with_ink_pen:", "unicode": "1F50F", "aliases": ""}, "girl": {"keywords": "girl female woman", "shortname": ":girl:", "unicode": "1F467", "aliases": ""}, "calling": {"keywords": "mobile phone with rightwards arrow at left incoming iphone", "shortname": ":calling:", "unicode": "1F4F2", "aliases": ""}, "sunrise": {"keywords": "sunrise morning photo vacation view sunrise sun morning color sky", "shortname": ":sunrise:", "unicode": "1F305", "aliases": ""}, "briefcase": {"keywords": "briefcase business documents work", "shortname": ":briefcase:", "unicode": "1F4BC", "aliases": ""}, "exclamation": {"keywords": "heavy exclamation mark symbol surprise", "shortname": ":exclamation:", "unicode": "2757", "aliases": ""}, "video_game": {"keywords": "video game PS4 console controller play video game console controller nintendo xbox playstation", "shortname": ":video_game:", "unicode": "1F3AE", "aliases": ""}, "lipstick": {"keywords": "lipstick fashion female girl", "shortname": ":lipstick:", "unicode": "1F484", "aliases": ""}, "smirk": {"keywords": "smirking face mean prank smile smug smirking smirk smug smile half-smile conceited", "shortname": ":smirk:", "unicode": "1F60F", "aliases": ""}, "fish_cake": {"keywords": "fish cake with swirl design food fish cake kamboko swirl ramen noodles naruto", "shortname": ":fish_cake:", "unicode": "1F365", "aliases": ""}, "factory": {"keywords": "factory building", "shortname": ":factory:", "unicode": "1F3ED", "aliases": ""}, "baggage_claim": {"keywords": "baggage claim airport blue-square transport bag baggage luggage travel", "shortname": ":baggage_claim:", "unicode": "1F6C4", "aliases": ""}, "cherry_blossom": {"keywords": "cherry blossom flower nature plant cherry blossom tree flower", "shortname": ":cherry_blossom:", "unicode": "1F338", "aliases": ""}, "sparkle": {"keywords": "sparkle green-square stars", "shortname": ":sparkle:", "unicode": "2747", "aliases": ""}, "fountain": {"keywords": "fountain photo", "shortname": ":fountain:", "unicode": "26F2", "aliases": ""}, "zap": {"keywords": "high voltage sign lightning bolt thunder weather", "shortname": ":zap:", "unicode": "26A1", "aliases": ""}, "speak_no_evil": {"keywords": "speak-no-evil monkey animal monkey monkey mouth talk say words verbal verbalize oral iwazaru", "shortname": ":speak_no_evil:", "unicode": "1F64A", "aliases": ""}, "cyclone": {"keywords": "cyclone blue cloud swirl weather cyclone hurricane typhoon storm ocean", "shortname": ":cyclone:", "unicode": "1F300", "aliases": ""}, "blue_book": {"keywords": "blue book knowledge library read", "shortname": ":blue_book:", "unicode": "1F4D8", "aliases": ""}, "dancers": {"keywords": "woman with bunny ears bunny female girls women dancing dancers showgirl playboy costume bunny cancan", "shortname": ":dancers:", "unicode": "1F46F", "aliases": ""}, "flower_playing_cards": {"keywords": "flower playing cards playing card flower game august moon special", "shortname": ":flower_playing_cards:", "unicode": "1F3B4", "aliases": ""}, "umbrella": {"keywords": "umbrella with rain drops rain weather", "shortname": ":umbrella:", "unicode": "2614", "aliases": ""}, "octopus": {"keywords": "octopus animal creature ocean sea", "shortname": ":octopus:", "unicode": "1F419", "aliases": ""}, "hatching_chick": {"keywords": "hatching chick born chicken egg chick egg baby bird chicken young woman cute", "shortname": ":hatching_chick:", "unicode": "1F423", "aliases": ""}, "free": {"keywords": "squared free blue-square words", "shortname": ":free:", "unicode": "1F193", "aliases": ""}, "traffic_light": {"keywords": "horizontal traffic light traffic transportation traffic light stop go yield horizontal", "shortname": ":traffic_light:", "unicode": "1F6A5", "aliases": ""}, "grimacing": {"keywords": "grimacing face face grimace teeth grimace disapprove pain", "shortname": ":grimacing:", "unicode": "1F62C", "aliases": ""}, "bullettrain_side": {"keywords": "high-speed train transportation vehicle train bullet rail", "shortname": ":bullettrain_side:", "unicode": "1F684", "aliases": ""}, "poultry_leg": {"keywords": "poultry leg food meat poultry leg chicken fried", "shortname": ":poultry_leg:", "unicode": "1F357", "aliases": ""}, "grapes": {"keywords": "grapes food fruit grapes wine vinegar fruit cluster vine", "shortname": ":grapes:", "unicode": "1F347", "aliases": ""}, "smirk_cat": {"keywords": "cat face with wry smile animal cats smirk smirking wry confident confidence", "shortname": ":smirk_cat:", "unicode": "1F63C", "aliases": ""}, "lollipop": {"keywords": "lollipop candy food snack sweet lollipop stick lick sweet sugar candy", "shortname": ":lollipop:", "unicode": "1F36D", "aliases": ""}, "high_heel": {"keywords": "high-heeled shoe fashion female shoes", "shortname": ":high_heel:", "unicode": "1F460", "aliases": ""}, "black_medium_small_square": {"keywords": "black medium small square ", "shortname": ":black_medium_small_square:", "unicode": "25FE", "aliases": ""}, "green_book": {"keywords": "green book knowledge library read", "shortname": ":green_book:", "unicode": "1F4D7", "aliases": ""}, "atm": {"keywords": "automated teller machine atm cash withdrawal money deposit financial bank adam payday bank blue-square cash money payment", "shortname": ":atm:", "unicode": "1F3E7", "aliases": ""}, "fork_and_knife": {"keywords": "fork and knife cutlery kitchen fork knife restaurant meal food eat", "shortname": ":fork_and_knife:", "unicode": "1F374", "aliases": ""}, "passport_control": {"keywords": "passport control blue-square custom passport official travel control foreign identification", "shortname": ":passport_control:", "unicode": "1F6C2", "aliases": ""}, "bookmark": {"keywords": "bookmark favorite", "shortname": ":bookmark:", "unicode": "1F516", "aliases": ""}, "small_blue_diamond": {"keywords": "small blue diamond shape", "shortname": ":small_blue_diamond:", "unicode": "1F539", "aliases": ""}, "yum": {"keywords": "face savouring delicious food face happy joy smile tongue delicious savoring food eat yummy yum tasty savory", "shortname": ":yum:", "unicode": "1F60B", "aliases": ""}, "closed_lock_with_key": {"keywords": "closed lock with key privacy security", "shortname": ":closed_lock_with_key:", "unicode": "1F510", "aliases": ""}, "heartbeat": {"keywords": "beating heart affection like love valentines", "shortname": ":heartbeat:", "unicode": "1F493", "aliases": ""}, "blush": {"keywords": "smiling face with smiling eyes crush embarrassed face flushed happy shy smile smiling smile smiley", "shortname": ":blush:", "unicode": "1F60A", "aliases": ""}, "warning": {"keywords": "warning sign exclamation wip", "shortname": ":warning:", "unicode": "26A0", "aliases": ""}, "ophiuchus": {"keywords": "ophiuchus ophiuchus serpent snake astrology greek constellation stars zodiac purple-square sign horoscope", "shortname": ":ophiuchus:", "unicode": "26CE", "aliases": ""}, "revolving_hearts": {"keywords": "revolving hearts affection like love valentines heart hearts revolving moving circle multiple lovers", "shortname": ":revolving_hearts:", "unicode": "1F49E", "aliases": ""}, "fire_engine": {"keywords": "fire engine cars transportation vehicle fire fighter engine truck emergency medical", "shortname": ":fire_engine:", "unicode": "1F692", "aliases": ""}, "one": {"keywords": "digit one 1 blue-square numbers", "shortname": ":one:", "unicode": "0031-20E3", "aliases": ""}, "feet": {"keywords": "paw prints animal cat dog footprints paw pet tracking paw prints mark imprints footsteps animal lion bear dog cat raccoon critter feet pawsteps", "shortname": ":feet:", "unicode": "1F43E", "aliases": ""}, "sparkler": {"keywords": "firework sparkler night shine stars", "shortname": ":sparkler:", "unicode": "1F387", "aliases": ""}, "cow2": {"keywords": "cow animal beef nature ox cow milk dairy beef bessie moo", "shortname": ":cow2:", "unicode": "1F404", "aliases": ""}, "scissors": {"keywords": "black scissors cut stationery", "shortname": ":scissors:", "unicode": "2702", "aliases": ""}, "ring": {"keywords": "ring marriage propose valentines wedding", "shortname": ":ring:", "unicode": "1F48D", "aliases": ""}, "whale": {"keywords": "spouting whale animal nature ocean sea", "shortname": ":whale:", "unicode": "1F433", "aliases": ""}, "point_right": {"keywords": "white right pointing backhand index direction fingers hand", "shortname": ":point_right:", "unicode": "1F449", "aliases": ""}, "sheep": {"keywords": "sheep animal nature sheep wool flock follower ewe female lamb", "shortname": ":sheep:", "unicode": "1F411", "aliases": ""}, "horse": {"keywords": "horse face animal brown", "shortname": ":horse:", "unicode": "1F434", "aliases": ""}, "basketball": {"keywords": "basketball and hoop NBA balls sports basketball bball dribble hoop net swish rip city", "shortname": ":basketball:", "unicode": "1F3C0", "aliases": ""}, "monkey": {"keywords": "monkey animal nature monkey primate banana silly", "shortname": ":monkey:", "unicode": "1F412", "aliases": ""}, "blossom": {"keywords": "blossom flowers nature yellow blossom daisy flower", "shortname": ":blossom:", "unicode": "1F33C", "aliases": ""}, "gift_heart": {"keywords": "heart with ribbon love valentines", "shortname": ":gift_heart:", "unicode": "1F49D", "aliases": ""}, "top": {"keywords": "top with upwards arrow above blue-square words", "shortname": ":top:", "unicode": "1F51D", "aliases": ""}, "arrow_upper_right": {"keywords": "north east arrow blue-square", "shortname": ":arrow_upper_right:", "unicode": "2197", "aliases": ""}, "clock630": {"keywords": "clock face six-thirty clock time", "shortname": ":clock630:", "unicode": "1F561", "aliases": ""}, "station": {"keywords": "station public transportation vehicle station train subway", "shortname": ":station:", "unicode": "1F689", "aliases": ""}, "clock730": {"keywords": "clock face seven-thirty clock time", "shortname": ":clock730:", "unicode": "1F562", "aliases": ""}, "banana": {"keywords": "banana food fruit banana peel bunch", "shortname": ":banana:", "unicode": "1F34C", "aliases": ""}, "crescent_moon": {"keywords": "crescent moon night moon crescent waxing sky night cheese phase", "shortname": ":crescent_moon:", "unicode": "1F319", "aliases": ""}, "nail_care": {"keywords": "nail polish beauty manicure", "shortname": ":nail_care:", "unicode": "1F485", "aliases": ""}, "eyes": {"keywords": "eyes look peek stalk watch", "shortname": ":eyes:", "unicode": "1F440", "aliases": ""}, "shell": {"keywords": "spiral shell beach nature sea shell spiral beach sand crab nautilus", "shortname": ":shell:", "unicode": "1F41A", "aliases": ""}, "relieved": {"keywords": "relieved face face happiness massage phew relaxed relieved satisfied phew relief", "shortname": ":relieved:", "unicode": "1F60C", "aliases": ""}, "hotel": {"keywords": "hotel accomodation building checkin whotel hotel motel holiday inn hospital", "shortname": ":hotel:", "unicode": "1F3E8", "aliases": ""}, "small_red_triangle_down": {"keywords": "down-pointing red triangle shape", "shortname": ":small_red_triangle_down:", "unicode": "1F53B", "aliases": ""}, "broken_heart": {"keywords": "broken heart sad sorry", "shortname": ":broken_heart:", "unicode": "1F494", "aliases": ""}, "nut_and_bolt": {"keywords": "nut and bolt handy tools", "shortname": ":nut_and_bolt:", "unicode": "1F529", "aliases": ""}, "aerial_tramway": {"keywords": "aerial tramway transportation vehicle aerial tram tramway cable transport", "shortname": ":aerial_tramway:", "unicode": "1F6A1", "aliases": ""}, "sweat_drops": {"keywords": "splashing sweat symbol water", "shortname": ":sweat_drops:", "unicode": "1F4A6", "aliases": ""}, "panda_face": {"keywords": "panda face animal nature panda bear face cub cute endearment friendship love bamboo china black white", "shortname": ":panda_face:", "unicode": "1F43C", "aliases": ""}, "minibus": {"keywords": "minibus car transportation vehicle bus city transport transportation", "shortname": ":minibus:", "unicode": "1F690", "aliases": ""}, "b": {"keywords": "negative squared latin capital letter b alphabet letter red-square", "shortname": ":b:", "unicode": "1F171", "aliases": ""}, "unamused": {"keywords": "unamused face bored face indifference serious straight face unamused not amused depressed unhappy disapprove lame", "shortname": ":unamused:", "unicode": "1F612", "aliases": ""}, "fuelpump": {"keywords": "fuel pump gas station petroleum", "shortname": ":fuelpump:", "unicode": "26FD", "aliases": ""}, "bee": {"keywords": "honeybee animal insect bee queen buzz flower pollen sting honey hive bumble pollination", "shortname": ":bee:", "unicode": "1F41D", "aliases": ""}, "scream_cat": {"keywords": "weary cat face animal cats munch weary sleepy tired tiredness study finals school exhausted scream painting artist", "shortname": ":scream_cat:", "unicode": "1F640", "aliases": ""}, "musical_score": {"keywords": "musical score clef treble music musical score clef g-clef stave staff", "shortname": ":musical_score:", "unicode": "1F3BC", "aliases": ""}, "hourglass_flowing_sand": {"keywords": "hourglass with flowing sand countdown oldschool time", "shortname": ":hourglass_flowing_sand:", "unicode": "23F3", "aliases": ""}, "round_pushpin": {"keywords": "round pushpin stationery", "shortname": ":round_pushpin:", "unicode": "1F4CD", "aliases": ""}, "tophat": {"keywords": "top hat classy gentleman magic top hat cap beaver high tall stove pipe chimney topper london period piece magic magician", "shortname": ":tophat:", "unicode": "1F3A9", "aliases": ""}, "six_pointed_star": {"keywords": "six pointed star with middle dot purple-square", "shortname": ":six_pointed_star:", "unicode": "1F52F", "aliases": ""}, "dog2": {"keywords": "dog animal doge friend nature pet dog puppy pet friend woof bark fido", "shortname": ":dog2:", "unicode": "1F415", "aliases": ""}, "tractor": {"keywords": "tractor agriculture car farming vehicle tractor farm construction machine digger", "shortname": ":tractor:", "unicode": "1F69C", "aliases": ""}, "u6709": {"keywords": "squared cjk unified ideograph-6709 chinese have kanji orange-square", "shortname": ":u6709:", "unicode": "1F236", "aliases": ""}, "u6708": {"keywords": "squared cjk unified ideograph-6708 chinese japanese kanji moon orange-square", "shortname": ":u6708:", "unicode": "1F237", "aliases": ""}, "crying_cat_face": {"keywords": "crying cat face animal cats sad tears weep cry cat sob tears sad melancholy morn somber hurt", "shortname": ":crying_cat_face:", "unicode": "1F63F", "aliases": ""}, "loud_sound": {"keywords": "speaker with three sound waves ", "shortname": ":loud_sound:", "unicode": "1F50A", "aliases": ""}, "arrow_backward": {"keywords": "black left-pointing triangle arrow blue-square", "shortname": ":arrow_backward:", "unicode": "25C0", "aliases": ""}, "runner": {"keywords": "runner exercise man walking run runner jog exercise sprint race dash", "shortname": ":runner:", "unicode": "1F3C3", "aliases": ""}, "ram": {"keywords": "ram animal nature sheep ram sheep male horn horns", "shortname": ":ram:", "unicode": "1F40F", "aliases": ""}, "notebook": {"keywords": "notebook notes paper record stationery", "shortname": ":notebook:", "unicode": "1F4D3", "aliases": ""}, "dash": {"keywords": "dash symbol air fast shoo wind", "shortname": ":dash:", "unicode": "1F4A8", "aliases": ""}, "rat": {"keywords": "rat animal mouse rat rodent crooked snitch", "shortname": ":rat:", "unicode": "1F400", "aliases": ""}, "information_desk_person": {"keywords": "information desk person female girl human woman information help question answer sassy unimpressed attitude snarky", "shortname": ":information_desk_person:", "unicode": "1F481", "aliases": ""}, "anger": {"keywords": "anger symbol anger angry mad", "shortname": ":anger:", "unicode": "1F4A2", "aliases": ""}, "mailbox_with_mail": {"keywords": "open mailbox with raised flag communication email inbox", "shortname": ":mailbox_with_mail:", "unicode": "1F4EC", "aliases": ""}, "milky_way": {"keywords": "milky way photo space milky galaxy star stars planets space sky", "shortname": ":milky_way:", "unicode": "1F30C", "aliases": ""}, "pencil2": {"keywords": "pencil paper stationery write", "shortname": ":pencil2:", "unicode": "270F", "aliases": ""}, "microphone": {"keywords": "microphone PA music sound microphone mic audio sound voice karaoke", "shortname": ":microphone:", "unicode": "1F3A4", "aliases": ""}, "koala": {"keywords": "koala animal nature", "shortname": ":koala:", "unicode": "1F428", "aliases": ""}, "necktie": {"keywords": "necktie cloth fashion formal shirt suitup", "shortname": ":necktie:", "unicode": "1F454", "aliases": ""}, "wink": {"keywords": "winking face face happy mischievous secret wink winking friendly joke", "shortname": ":wink:", "unicode": "1F609", "aliases": ""}, "monorail": {"keywords": "monorail transportation vehicle train mono rail transport", "shortname": ":monorail:", "unicode": "1F69D", "aliases": ""}, "kissing_cat": {"keywords": "kissing cat face with closed eyes animal cats passion kiss puckered heart love", "shortname": ":kissing_cat:", "unicode": "1F63D", "aliases": ""}, "u55b6": {"keywords": "squared cjk unified ideograph-55b6 japanese opening hours", "shortname": ":u55b6:", "unicode": "1F23A", "aliases": ""}, "globe_with_meridians": {"keywords": "globe with meridians earth international world earth meridian globe space planet home", "shortname": ":globe_with_meridians:", "unicode": "1F310", "aliases": ""}, "snowflake": {"keywords": "snowflake christmas cold season weather winter xmas snowflake snow frozen droplet ice crystal cold chilly winter unique special below zero elsa", "shortname": ":snowflake:", "unicode": "2744", "aliases": ""}, "hibiscus": {"keywords": "hibiscus flowers plant vegetable hibiscus flower warm", "shortname": ":hibiscus:", "unicode": "1F33A", "aliases": ""}, "crystal_ball": {"keywords": "crystal ball disco party", "shortname": ":crystal_ball:", "unicode": "1F52E", "aliases": ""}, "koko": {"keywords": "squared katakana koko blue-square destination here japanese katakana", "shortname": ":koko:", "unicode": "1F201", "aliases": ""}, "chart": {"keywords": "chart with upwards trend and yen sign graph green-square", "shortname": ":chart:", "unicode": "1F4B9", "aliases": ""}, "credit_card": {"keywords": "credit card bill dollar money pay payment credit card loan purchase shopping mastercard visa american express wallet signature", "shortname": ":credit_card:", "unicode": "1F4B3", "aliases": ""}, "checkered_flag": {"keywords": "chequered flag contest finishline gokart rase checkered chequred race flag finish complete end", "shortname": ":checkered_flag:", "unicode": "1F3C1", "aliases": ""}, "eight": {"keywords": "digit eight 8 blue-square numbers", "shortname": ":eight:", "unicode": "0038-20E3", "aliases": ""}, "handbag": {"keywords": "handbag accessories accessory bag fashion", "shortname": ":handbag:", "unicode": "1F45C", "aliases": ""}, "pensive": {"keywords": "pensive face face okay sad pensive thoughtful think reflective wistful meditate serious", "shortname": ":pensive:", "unicode": "1F614", "aliases": ""}, "pager": {"keywords": "pager bbcall oldschool", "shortname": ":pager:", "unicode": "1F4DF", "aliases": ""}, "arrows_clockwise": {"keywords": "clockwise downwards and upwards open circle arrows sync", "shortname": ":arrows_clockwise:", "unicode": "1F503", "aliases": ""}, "ballot_box_with_check": {"keywords": "ballot box with check agree ok", "shortname": ":ballot_box_with_check:", "unicode": "2611", "aliases": ""}, "fried_shrimp": {"keywords": "fried shrimp animal food shrimp fried seafood small fish", "shortname": ":fried_shrimp:", "unicode": "1F364", "aliases": ""}, "mans_shoe": {"keywords": "mans shoe fashion male", "shortname": ":mans_shoe:", "unicode": "1F45E", "aliases": ""}, "raised_hand": {"keywords": "raised hand female girl woman", "shortname": ":raised_hand:", "unicode": "270B", "aliases": ""}, "m": {"keywords": "circled latin capital letter m alphabet blue-circle letter", "shortname": ":m:", "unicode": "24C2", "aliases": ""}, "dog": {"keywords": "dog face animal friend nature woof", "shortname": ":dog:", "unicode": "1F436", "aliases": ""}, "police_car": {"keywords": "police car cars enforcement law transportation vehicle police car emergency ticket citation crime help officer", "shortname": ":police_car:", "unicode": "1F693", "aliases": ""}, "new_moon_with_face": {"keywords": "new moon with face nature moon new anthropomorphic face sky night cheese phase", "shortname": ":new_moon_with_face:", "unicode": "1F31A", "aliases": ""}, "ideograph_advantage": {"keywords": "circled ideograph advantage chinese get kanji obtain", "shortname": ":ideograph_advantage:", "unicode": "1F250", "aliases": ""}, "pineapple": {"keywords": "pineapple food fruit nature pineapple pina tropical flower", "shortname": ":pineapple:", "unicode": "1F34D", "aliases": ""}, "black_circle": {"keywords": "medium black circle shape", "shortname": ":black_circle:", "unicode": "26AB", "aliases": ""}, "scream": {"keywords": "face screaming in fear face munch scream painting artist alien", "shortname": ":scream:", "unicode": "1F631", "aliases": ""}, "taxi": {"keywords": "taxi cars transportation uber vehicle taxi car automobile city transport service", "shortname": ":taxi:", "unicode": "1F695", "aliases": ""}, "walking": {"keywords": "pedestrian human man walk pedestrian stroll stride foot feet", "shortname": ":walking:", "unicode": "1F6B6", "aliases": ""}, "golf": {"keywords": "flag in hole business sports", "shortname": ":golf:", "unicode": "26F3", "aliases": ""}, "minidisc": {"keywords": "minidisc data disc disk record technology", "shortname": ":minidisc:", "unicode": "1F4BD", "aliases": ""}, "horse_racing": {"keywords": "horse racing animal betting competition horse race racing jockey triple crown", "shortname": ":horse_racing:", "unicode": "1F3C7", "aliases": ""}, "radio": {"keywords": "radio communication music podcast program", "shortname": ":radio:", "unicode": "1F4FB", "aliases": ""}, "point_down": {"keywords": "white down pointing backhand index direction fingers hand", "shortname": ":point_down:", "unicode": "1F447", "aliases": ""}, "chicken": {"keywords": "chicken animal cluck chicken hen poultry livestock", "shortname": ":chicken:", "unicode": "1F414", "aliases": ""}, "copyright": {"keywords": "copyright sign ip license", "shortname": ":copyright:", "unicode": "00A9", "aliases": ""}, "arrow_lower_right": {"keywords": "south east arrow arrow blue-square", "shortname": ":arrow_lower_right:", "unicode": "2198", "aliases": ""}, "city_sunset": {"keywords": "sunset over buildings photo city scape sunrise dawn light morning metropolitan rise sun", "shortname": ":city_sunset:", "unicode": "1F307", "aliases": ":city_sunrise:"}, "camel": {"keywords": "bactrian camel animal hot nature bactrian camel hump desert central asia heat hot water hump day wednesday sex", "shortname": ":camel:", "unicode": "1F42B", "aliases": ""}, "waning_crescent_moon": {"keywords": "waning crescent moon symbol nature moon crescent waning sky night cheese phase", "shortname": ":waning_crescent_moon:", "unicode": "1F318", "aliases": ""}, "cupid": {"keywords": "heart with arrow affection heart like love valentines", "shortname": ":cupid:", "unicode": "1F498", "aliases": ""}, "mens": {"keywords": "mens symbol restroom toilet wc men bathroom restroom sign boy male avatar", "shortname": ":mens:", "unicode": "1F6B9", "aliases": ""}, "virgo": {"keywords": "virgo sign virgo maiden astrology greek constellation stars zodiac sign zodiac horoscope", "shortname": ":virgo:", "unicode": "264D", "aliases": ""}, "libra": {"keywords": "libra libra scales astrology greek constellation stars zodiac sign purple-square sign zodiac horoscope", "shortname": ":libra:", "unicode": "264E", "aliases": ""}, "busts_in_silhouette": {"keywords": "busts in silhouette group human man person team user silhouette silhouettes people user members accounts relationship shadow", "shortname": ":busts_in_silhouette:", "unicode": "1F465", "aliases": ""}, "rice": {"keywords": "cooked rice food rice white grain food bowl", "shortname": ":rice:", "unicode": "1F35A", "aliases": ""}, "lips": {"keywords": "mouth kiss mouth", "shortname": ":lips:", "unicode": "1F444", "aliases": ""}, "alarm_clock": {"keywords": "alarm clock time wake", "shortname": ":alarm_clock:", "unicode": "23F0", "aliases": ""}, "couplekiss": {"keywords": "kiss dating like love marriage valentines", "shortname": ":couplekiss:", "unicode": "1F48F", "aliases": ""}, "sagittarius": {"keywords": "sagittarius sagittarius centaur archer astrology greek constellation stars zodiac sign sign zodiac horoscope", "shortname": ":sagittarius:", "unicode": "2650", "aliases": ""}, "electric_plug": {"keywords": "electric plug charger power", "shortname": ":electric_plug:", "unicode": "1F50C", "aliases": ""}, "circus_tent": {"keywords": "circus tent carnival festival party circus tent event carnival big top canvas", "shortname": ":circus_tent:", "unicode": "1F3AA", "aliases": ""}, "watch": {"keywords": "watch accessories time", "shortname": ":watch:", "unicode": "231A", "aliases": ""}, "arrow_up": {"keywords": "upwards black arrow blue-square", "shortname": ":arrow_up:", "unicode": "2B06", "aliases": ""}, "bear": {"keywords": "bear face animal nature", "shortname": ":bear:", "unicode": "1F43B", "aliases": ""}, "frowning": {"keywords": "frowning face with open mouth aw face frown sad pout sulk glower", "shortname": ":frowning:", "unicode": "1F626", "aliases": ""}, "incoming_envelope": {"keywords": "incoming envelope email inbox", "shortname": ":incoming_envelope:", "unicode": "1F4E8", "aliases": ""}, "watermelon": {"keywords": "watermelon food fruit melon watermelon summer fruit large", "shortname": ":watermelon:", "unicode": "1F349", "aliases": ""}, "wedding": {"keywords": "wedding affection bride couple groom like love marriage", "shortname": ":wedding:", "unicode": "1F492", "aliases": ""}, "yellow_heart": {"keywords": "yellow heart affection like love valentines yellow gold heart love friendship happy happiness trust compassionate respectful honest caring selfless", "shortname": ":yellow_heart:", "unicode": "1F49B", "aliases": ""}, "no_mobile_phones": {"keywords": "no mobile phones iphone mute", "shortname": ":no_mobile_phones:", "unicode": "1F4F5", "aliases": ""}, "negative_squared_cross_mark": {"keywords": "negative squared cross mark deny green-square no x", "shortname": ":negative_squared_cross_mark:", "unicode": "274E", "aliases": ""}, "cry": {"keywords": "crying face face sad sad cry tear weep tears", "shortname": ":cry:", "unicode": "1F622", "aliases": ""}, "worried": {"keywords": "worried face concern face nervous worried anxious distressed nervous tense", "shortname": ":worried:", "unicode": "1F61F", "aliases": ""}, "microscope": {"keywords": "microscope experiment laboratory zoomin", "shortname": ":microscope:", "unicode": "1F52C", "aliases": ""}, "older_man": {"keywords": "older man human male men", "shortname": ":older_man:", "unicode": "1F474", "aliases": ""}, "whale2": {"keywords": "whale animal nature ocean sea whale blubber bloated fat large massive", "shortname": ":whale2:", "unicode": "1F40B", "aliases": ""}, "x": {"keywords": "cross mark delete no remove", "shortname": ":x:", "unicode": "274C", "aliases": ""}, "interrobang": {"keywords": "exclamation question mark punctuation surprise wat", "shortname": ":interrobang:", "unicode": "2049", "aliases": ""}, "japanese_ogre": {"keywords": "japanese ogre monster japanese oni demon troll ogre folklore monster devil mask theater horns teeth", "shortname": ":japanese_ogre:", "unicode": "1F479", "aliases": ""}, "evergreen_tree": {"keywords": "evergreen tree nature plant evergreen tree needles christmas", "shortname": ":evergreen_tree:", "unicode": "1F332", "aliases": ""}, "oncoming_taxi": {"keywords": "oncoming taxi cars uber vehicle taxi car automobile city transport service", "shortname": ":oncoming_taxi:", "unicode": "1F696", "aliases": ""}, "man_with_turban": {"keywords": "man with turban male turban headdress headwear pagri india indian mummy wisdom peace", "shortname": ":man_with_turban:", "unicode": "1F473", "aliases": ""}, "arrow_up_small": {"keywords": "up-pointing small red triangle blue-square", "shortname": ":arrow_up_small:", "unicode": "1F53C", "aliases": ""}, "art": {"keywords": "artist palette design draw paint artist palette art colors paint draw brush pastels oils", "shortname": ":art:", "unicode": "1F3A8", "aliases": ""}, "cocktail": {"keywords": "cocktail glass alcohol beverage drink drunk cocktail mixed drink alcohol glass martini bar", "shortname": ":cocktail:", "unicode": "1F378", "aliases": ""}, "fries": {"keywords": "french fries chips food fries french potato fry russet idaho", "shortname": ":fries:", "unicode": "1F35F", "aliases": ""}, "hear_no_evil": {"keywords": "hear-no-evil monkey animal monkey monkey ears hear sound kikazaru", "shortname": ":hear_no_evil:", "unicode": "1F649", "aliases": ""}, "convenience_store": {"keywords": "convenience store building", "shortname": ":convenience_store:", "unicode": "1F3EA", "aliases": ""}, "seat": {"keywords": "seat sit", "shortname": ":seat:", "unicode": "1F4BA", "aliases": ""}, "computer": {"keywords": "personal computer laptop tech", "shortname": ":computer:", "unicode": "1F4BB", "aliases": ""}, "arrow_down": {"keywords": "downwards black arrow arrow blue-square", "shortname": ":arrow_down:", "unicode": "2B07", "aliases": ""}, "arrow_upper_left": {"keywords": "north west arrow blue-square", "shortname": ":arrow_upper_left:", "unicode": "2196", "aliases": ""}, "parking": {"keywords": "negative squared latin capital letter p alphabet blue-square cars letter", "shortname": ":parking:", "unicode": "1F17F", "aliases": ""}, "pisces": {"keywords": "pisces pisces fish astrology greek constellation stars zodiac sign purple-square sign zodiac horoscope", "shortname": ":pisces:", "unicode": "2653", "aliases": ""}, "calendar": {"keywords": "tear-off calendar schedule", "shortname": ":calendar:", "unicode": "1F4C6", "aliases": ""}, "hammer": {"keywords": "hammer done judge law ruling tools verdict", "shortname": ":hammer:", "unicode": "1F528", "aliases": ""}, "bomb": {"keywords": "bomb boom explode", "shortname": ":bomb:", "unicode": "1F4A3", "aliases": ""}, "hourglass": {"keywords": "hourglass clock oldschool time", "shortname": ":hourglass:", "unicode": "231B", "aliases": ""}, "loudspeaker": {"keywords": "public address loudspeaker sound volume", "shortname": ":loudspeaker:", "unicode": "1F4E2", "aliases": ""}, "shower": {"keywords": "shower bath clean wash bathroom shower soap water clean shampoo lather", "shortname": ":shower:", "unicode": "1F6BF", "aliases": ""}, "black_joker": {"keywords": "playing card black joker cards game poker", "shortname": ":black_joker:", "unicode": "1F0CF", "aliases": ""}, "ferris_wheel": {"keywords": "ferris wheel carnival londoneye photo farris wheel amusement park fair ride entertainment", "shortname": ":ferris_wheel:", "unicode": "1F3A1", "aliases": ""}, "bicyclist": {"keywords": "bicyclist bike exercise hipster sports bicyclist road bike pedal bicycle transportation", "shortname": ":bicyclist:", "unicode": "1F6B4", "aliases": ""}, "no_mouth": {"keywords": "face without mouth face hellokitty mouth silent vapid", "shortname": ":no_mouth:", "unicode": "1F636", "aliases": ""}, "postbox": {"keywords": "postbox email envelope letter", "shortname": ":postbox:", "unicode": "1F4EE", "aliases": ""}, "large_blue_diamond": {"keywords": "large blue diamond shape", "shortname": ":large_blue_diamond:", "unicode": "1F537", "aliases": ""}, "non-potable_water": {"keywords": "non-potable water symbol drink faucet tap non-potable water not drinkable dirty gross aqua h20", "shortname": ":non-potable_water:", "unicode": "1F6B1", "aliases": ""}, "icecream": {"keywords": "soft ice cream desert food hot icecream ice cream dairy dessert cold soft serve cone yogurt", "shortname": ":icecream:", "unicode": "1F366", "aliases": ""}, "diamonds": {"keywords": "black diamond suit cards poker", "shortname": ":diamonds:", "unicode": "2666", "aliases": ""}, "princess": {"keywords": "princess blond crown female girl woman princess royal royalty king queen daughter disney high-maintenance", "shortname": ":princess:", "unicode": "1F478", "aliases": ""}, "no_entry_sign": {"keywords": "no entry sign denied disallow forbid limit stop no stop entry", "shortname": ":no_entry_sign:", "unicode": "1F6AB", "aliases": ""}, "shaved_ice": {"keywords": "shaved ice desert hot shaved ice dessert treat syrup flavoring", "shortname": ":shaved_ice:", "unicode": "1F367", "aliases": ""}, "tent": {"keywords": "tent camp outdoors photo", "shortname": ":tent:", "unicode": "26FA", "aliases": ""}, "flashlight": {"keywords": "electric torch dark", "shortname": ":flashlight:", "unicode": "1F526", "aliases": ""}, "raising_hand": {"keywords": "happy person raising one hand female girl woman hand raise notice attention answer", "shortname": ":raising_hand:", "unicode": "1F64B", "aliases": ""}, "wc": {"keywords": "water closet blue-square restroom toilet water closet toilet bathroom throne porcelain waste flush plumbing", "shortname": ":wc:", "unicode": "1F6BE", "aliases": ""}, "joy": {"keywords": "face with tears of joy cry face haha happy tears tears cry joy happy weep", "shortname": ":joy:", "unicode": "1F602", "aliases": ""}, "moyai": {"keywords": "moyai island stone", "shortname": ":moyai:", "unicode": "1F5FF", "aliases": ""}, "aquarius": {"keywords": "aquarius aquarius water bearer astrology greek constellation stars zodiac sign purple-square sign zodiac horoscope", "shortname": ":aquarius:", "unicode": "2652", "aliases": ""}, "mailbox": {"keywords": "closed mailbox with raised flag communication email inbox", "shortname": ":mailbox:", "unicode": "1F4EB", "aliases": ""}, "guitar": {"keywords": "guitar instrument music guitar string music instrument jam rock acoustic electric", "shortname": ":guitar:", "unicode": "1F3B8", "aliases": ""}, "ok_woman": {"keywords": "face with ok gesture female girl human pink women yes ok okay accept", "shortname": ":ok_woman:", "unicode": "1F646", "aliases": ""}, "key": {"keywords": "key door lock password", "shortname": ":key:", "unicode": "1F511", "aliases": ""}, "blue_heart": {"keywords": "blue heart affection like love valentines blue heart love stability truth loyalty trust", "shortname": ":blue_heart:", "unicode": "1F499", "aliases": ""}, "statue_of_liberty": {"keywords": "statue of liberty american newyork", "shortname": ":statue_of_liberty:", "unicode": "1F5FD", "aliases": ""}, "cop": {"keywords": "police officer arrest enforcement law man police", "shortname": ":cop:", "unicode": "1F46E", "aliases": ""}, "clock1230": {"keywords": "clock face twelve-thirty clock time", "shortname": ":clock1230:", "unicode": "1F567", "aliases": ""}, "tropical_drink": {"keywords": "tropical drink beverage tropical drink mixed pineapple coconut pina fruit umbrella", "shortname": ":tropical_drink:", "unicode": "1F379", "aliases": ""}, "cow": {"keywords": "cow face animal beef ox", "shortname": ":cow:", "unicode": "1F42E", "aliases": ""}, "restroom": {"keywords": "restroom blue-square woman man unisex bathroom restroom sign shared toilet", "shortname": ":restroom:", "unicode": "1F6BB", "aliases": ""}, "white_large_square": {"keywords": "white large square shape", "shortname": ":white_large_square:", "unicode": "2B1C", "aliases": ""}, "eggplant": {"keywords": "aubergine aubergine food nature vegetable eggplant aubergine fruit purple penis", "shortname": ":eggplant:", "unicode": "1F346", "aliases": ""}, "low_brightness": {"keywords": "low brightness symbol summer sun", "shortname": ":low_brightness:", "unicode": "1F505", "aliases": ""}, "four_leaf_clover": {"keywords": "four leaf clover lucky nature plant vegetable clover four leaf luck irish saint patrick green", "shortname": ":four_leaf_clover:", "unicode": "1F340", "aliases": ""}, "space_invader": {"keywords": "alien monster arcade game", "shortname": ":space_invader:", "unicode": "1F47E", "aliases": ""}, "pig_nose": {"keywords": "pig nose animal oink pig nose snout food eat cute oink pink smell truffle", "shortname": ":pig_nose:", "unicode": "1F43D", "aliases": ""}, "cancer": {"keywords": "cancer cancer crab astrology greek constellation stars zodiac sign sign zodiac horoscope", "shortname": ":cancer:", "unicode": "264B", "aliases": ""}, "bell": {"keywords": "bell chime christmas notification sound xmas", "shortname": ":bell:", "unicode": "1F514", "aliases": ""}, "battery": {"keywords": "battery energy power sustain", "shortname": ":battery:", "unicode": "1F50B", "aliases": ""}, "jeans": {"keywords": "jeans fashion shopping jeans pants blue denim levi's levi designer work skinny", "shortname": ":jeans:", "unicode": "1F456", "aliases": ""}, "leo": {"keywords": "leo leo lion astrology greek constellation stars zodiac sign purple-square sign zodiac horoscope", "shortname": ":leo:", "unicode": "264C", "aliases": ""}, "cd": {"keywords": "optical disc disc disk dvd technology", "shortname": ":cd:", "unicode": "1F4BF", "aliases": ""}, "dancer": {"keywords": "dancer female fun girl woman dance dancer dress fancy boogy party celebrate ballet tango cha cha music", "shortname": ":dancer:", "unicode": "1F483", "aliases": ""}, "page_facing_up": {"keywords": "page facing up documents", "shortname": ":page_facing_up:", "unicode": "1F4C4", "aliases": ""}, "church": {"keywords": "church building christ religion", "shortname": ":church:", "unicode": "26EA", "aliases": ""}, "boar": {"keywords": "boar animal nature", "shortname": ":boar:", "unicode": "1F417", "aliases": ""}, "trumpet": {"keywords": "trumpet brass music trumpet brass music instrument", "shortname": ":trumpet:", "unicode": "1F3BA", "aliases": ""}, "angel": {"keywords": "baby angel baby angel halo cupid wings halo heaven wings jesus", "shortname": ":angel:", "unicode": "1F47C", "aliases": ""}, "imp": {"keywords": "imp angry devil evil horns cute devil", "shortname": ":imp:", "unicode": "1F47F", "aliases": ""}, "underage": {"keywords": "no one under eighteen symbol 18 drink night pub", "shortname": ":underage:", "unicode": "1F51E", "aliases": ""}, "three": {"keywords": "digit three 3 blue-square numbers prime", "shortname": ":three:", "unicode": "0033-20E3", "aliases": ""}, "oden": {"keywords": "oden food japanese oden seafood casserole stew", "shortname": ":oden:", "unicode": "1F362", "aliases": ""}, "beer": {"keywords": "beer mug beverage drink drunk party pub relax beer hops mug barley malt yeast portland oregon brewery micro pint boot", "shortname": ":beer:", "unicode": "1F37A", "aliases": ""}, "clock430": {"keywords": "clock face four-thirty clock time", "shortname": ":clock430:", "unicode": "1F55F", "aliases": ""}, "stuck_out_tongue_closed_eyes": {"keywords": "face with stuck-out tongue and tightly-closed eyes face mischievous playful prank tongue kidding silly playful ecstatic", "shortname": ":stuck_out_tongue_closed_eyes:", "unicode": "1F61D", "aliases": ""}, "helicopter": {"keywords": "helicopter transportation vehicle helicopter helo gyro gyrocopter", "shortname": ":helicopter:", "unicode": "1F681", "aliases": ""}, "heavy_division_sign": {"keywords": "heavy division sign calculation divide math", "shortname": ":heavy_division_sign:", "unicode": "2797", "aliases": ""}, "disappointed": {"keywords": "disappointed face disappointed disappoint frown depressed discouraged face sad upset", "shortname": ":disappointed:", "unicode": "1F61E", "aliases": ""}, "performing_arts": {"keywords": "performing arts acting drama theater performing arts performance entertainment acting story mask masks", "shortname": ":performing_arts:", "unicode": "1F3AD", "aliases": ""}, "mushroom": {"keywords": "mushroom plant vegetable mushroom fungi food fungus", "shortname": ":mushroom:", "unicode": "1F344", "aliases": ""}, "fire": {"keywords": "fire cook hot flame", "shortname": ":fire:", "unicode": "1F525", "aliases": ":flame:"}, "two_hearts": {"keywords": "two hearts affection like love valentines heart hearts two love emotion", "shortname": ":two_hearts:", "unicode": "1F495", "aliases": ""}, "arrow_down_small": {"keywords": "down-pointing small red triangle arrow blue-square", "shortname": ":arrow_down_small:", "unicode": "1F53D", "aliases": ""}, "tiger": {"keywords": "tiger face animal", "shortname": ":tiger:", "unicode": "1F42F", "aliases": ""}, "cold_sweat": {"keywords": "face with open mouth and cold sweat face nervous sweat exasperated frustrated", "shortname": ":cold_sweat:", "unicode": "1F630", "aliases": ""}, "bulb": {"keywords": "electric light bulb electricity light idea bulb light", "shortname": ":bulb:", "unicode": "1F4A1", "aliases": ""}, "heart_eyes": {"keywords": "smiling face with heart-shaped eyes affection crush face infatuation like love valentines smiling heart lovestruck love flirt smile heart-shaped", "shortname": ":heart_eyes:", "unicode": "1F60D", "aliases": ""}, "sound": {"keywords": "speaker with one sound wave speaker volume", "shortname": ":sound:", "unicode": "1F509", "aliases": ""}, "ant": {"keywords": "ant animal insect ant queen insect team", "shortname": ":ant:", "unicode": "1F41C", "aliases": ""}, "blowfish": {"keywords": "blowfish food nature ocean sea blowfish pufferfish puffer ballonfish toadfish fugu fish sushi", "shortname": ":blowfish:", "unicode": "1F421", "aliases": ""}, "speech_balloon": {"keywords": "speech balloon bubble words speech balloon talk conversation communication comic dialogue", "shortname": ":speech_balloon:", "unicode": "1F4AC", "aliases": ""}, "earth_africa": {"keywords": "earth globe europe-africa globe international world earth globe space planet africa europe home", "shortname": ":earth_africa:", "unicode": "1F30D", "aliases": ""}, "arrow_right_hook": {"keywords": "rightwards arrow with hook blue-square", "shortname": ":arrow_right_hook:", "unicode": "21AA", "aliases": ""}, "seedling": {"keywords": "seedling grass lawn nature plant seedling plant new start grow", "shortname": ":seedling:", "unicode": "1F331", "aliases": ""}, "fearful": {"keywords": "fearful face face nervous oops scared terrified fear fearful scared frightened", "shortname": ":fearful:", "unicode": "1F628", "aliases": ""}, "envelope_with_arrow": {"keywords": "envelope with downwards arrow above email", "shortname": ":envelope_with_arrow:", "unicode": "1F4E9", "aliases": ""}, "gem": {"keywords": "gem stone blue ruby", "shortname": ":gem:", "unicode": "1F48E", "aliases": ""}, "grinning": {"keywords": "grinning face face happy joy smile grin grinning smiling smile smiley", "shortname": ":grinning:", "unicode": "1F600", "aliases": ""}, "bikini": {"keywords": "bikini beach fashion female girl swimming woman", "shortname": ":bikini:", "unicode": "1F459", "aliases": ""}, "gemini": {"keywords": "gemini gemini twins astrology greek constellation stars zodiac sign sign zodiac horoscope", "shortname": ":gemini:", "unicode": "264A", "aliases": ""}, "vertical_traffic_light": {"keywords": "vertical traffic light transportation traffic light stop go yield vertical", "shortname": ":vertical_traffic_light:", "unicode": "1F6A6", "aliases": ""}, "newspaper": {"keywords": "newspaper headline press", "shortname": ":newspaper:", "unicode": "1F4F0", "aliases": ""}, "kissing": {"keywords": "kissing face 3 face infatuation like love valentines kissing kiss pucker lips smooch", "shortname": ":kissing:", "unicode": "1F617", "aliases": ""}, "bathtub": {"keywords": "bathtub clean shower bath tub basin wash bubble soak bathroom soap water clean shampoo lather water", "shortname": ":bathtub:", "unicode": "1F6C1", "aliases": ""}, "anchor": {"keywords": "anchor ferry ship anchor ship boat ocean harbor marina shipyard sailor tattoo", "shortname": ":anchor:", "unicode": "2693", "aliases": ""}, "loop": {"keywords": "double curly loop curly", "shortname": ":loop:", "unicode": "27BF", "aliases": ""}, "swimmer": {"keywords": "swimmer sports swimmer swim water pool laps freestyle butterfly breaststroke backstroke", "shortname": ":swimmer:", "unicode": "1F3CA", "aliases": ""}, "seven": {"keywords": "digit seven 7 blue-square numbers prime", "shortname": ":seven:", "unicode": "0037-20E3", "aliases": ""}, "pound": {"keywords": "banknote with pound sign bills british currency england money sterling uk pound britain british banknote money currency paper cash bills", "shortname": ":pound:", "unicode": "1F4B7", "aliases": ""}, "two_women_holding_hands": {"keywords": "two women holding hands couple female friends like love women hands girlfriends friends sisters mother daughter gay homosexual couple unity", "shortname": ":two_women_holding_hands:", "unicode": "1F46D", "aliases": ""}, "sushi": {"keywords": "sushi food japanese sushi fish raw nigiri japanese", "shortname": ":sushi:", "unicode": "1F363", "aliases": ""}, "purse": {"keywords": "purse accessories fashion money purse clutch bag handbag coin bag accessory money ladies shopping", "shortname": ":purse:", "unicode": "1F45B", "aliases": ""}, "telephone": {"keywords": "black telephone communication dial technology", "shortname": ":telephone:", "unicode": "260E", "aliases": ""}, "u5272": {"keywords": "squared cjk unified ideograph-5272 chinese cut divide kanji pink", "shortname": ":u5272:", "unicode": "1F239", "aliases": ""}, "rooster": {"keywords": "rooster animal chicken nature rooster cockerel cock male cock-a-doodle-doo crowing", "shortname": ":rooster:", "unicode": "1F413", "aliases": ""}, "rice_scene": {"keywords": "moon viewing ceremony photo moon viewing observing otsukimi tsukimi rice scene festival autumn", "shortname": ":rice_scene:", "unicode": "1F391", "aliases": ""}, "vs": {"keywords": "squared vs orange-square words", "shortname": ":vs:", "unicode": "1F19A", "aliases": ""}, "arrow_forward": {"keywords": "black right-pointing triangle arrow blue-square", "shortname": ":arrow_forward:", "unicode": "25B6", "aliases": ""}, "violin": {"keywords": "violin instrument music violin fiddle music instrument", "shortname": ":violin:", "unicode": "1F3BB", "aliases": ""}, "bullettrain_front": {"keywords": "high-speed train with bullet nose transportation train bullet rail", "shortname": ":bullettrain_front:", "unicode": "1F685", "aliases": ""}, "mouse": {"keywords": "mouse face animal nature", "shortname": ":mouse:", "unicode": "1F42D", "aliases": ""}, "bookmark_tabs": {"keywords": "bookmark tabs favorite", "shortname": ":bookmark_tabs:", "unicode": "1F4D1", "aliases": ""}, "shirt": {"keywords": "t-shirt cloth fashion", "shortname": ":shirt:", "unicode": "1F455", "aliases": ""}, "white_circle": {"keywords": "medium white circle shape", "shortname": ":white_circle:", "unicode": "26AA", "aliases": ""}, "balloon": {"keywords": "balloon celebration party balloon birthday celebration helium gas children float", "shortname": ":balloon:", "unicode": "1F388", "aliases": ""}, "heart_decoration": {"keywords": "heart decoration like love purple-square", "shortname": ":heart_decoration:", "unicode": "1F49F", "aliases": ""}, "joy_cat": {"keywords": "cat face with tears of joy animal cats haha happy tears happy tears cry joy", "shortname": ":joy_cat:", "unicode": "1F639", "aliases": ""}, "kimono": {"keywords": "kimono dress fashion female japanese women", "shortname": ":kimono:", "unicode": "1F458", "aliases": ""}, "speaker": {"keywords": "speaker sound listen hear noise", "shortname": ":speaker:", "unicode": "1F508", "aliases": ""}, "train2": {"keywords": "train transportation vehicle train locomotive rail", "shortname": ":train2:", "unicode": "1F686", "aliases": ""}, "first_quarter_moon": {"keywords": "first quarter moon symbol nature moon quarter first sky night cheese phase", "shortname": ":first_quarter_moon:", "unicode": "1F313", "aliases": ""}, "left_luggage": {"keywords": "left luggage blue-square travel bag baggage luggage travel", "shortname": ":left_luggage:", "unicode": "1F6C5", "aliases": ""}, "meat_on_bone": {"keywords": "meat on bone food good meat bone animal cooked", "shortname": ":meat_on_bone:", "unicode": "1F356", "aliases": ""}, "light_rail": {"keywords": "light rail transportation vehicle train rail light", "shortname": ":light_rail:", "unicode": "1F688", "aliases": ""}, "satellite": {"keywords": "satellite antenna communication", "shortname": ":satellite:", "unicode": "1F4E1", "aliases": ""}, "arrow_heading_up": {"keywords": "arrow pointing rightwards then curving upwards arrow blue-square", "shortname": ":arrow_heading_up:", "unicode": "2934", "aliases": ""}, "snail": {"keywords": "snail animal shell slow snail slow escargot french appetizer", "shortname": ":snail:", "unicode": "1F40C", "aliases": ""}, "rainbow": {"keywords": "rainbow happy nature photo sky unicorn rainbow color pride diversity spectrum refract leprechaun gold", "shortname": ":rainbow:", "unicode": "1F308", "aliases": ""}, "u6307": {"keywords": "squared cjk unified ideograph-6307 chinese green-square kanji point", "shortname": ":u6307:", "unicode": "1F22F", "aliases": ""}, "leopard": {"keywords": "leopard animal nature leopard cat spot spotted sexy", "shortname": ":leopard:", "unicode": "1F406", "aliases": ""}, "diamond_shape_with_a_dot_inside": {"keywords": "diamond shape with a dot inside diamond cute cuteness kawaii japanese glyph adorable", "shortname": ":diamond_shape_with_a_dot_inside:", "unicode": "1F4A0", "aliases": ""}, "barber": {"keywords": "barber pole hair salon style", "shortname": ":barber:", "unicode": "1F488", "aliases": ""}, "christmas_tree": {"keywords": "christmas tree celebration december festival vacation xmas christmas xmas santa holiday winter december santa evergreen ornaments jesus gifts presents", "shortname": ":christmas_tree:", "unicode": "1F384", "aliases": ""}, "slot_machine": {"keywords": "slot machine bet gamble vegas slot machine gamble one-armed bandit slots luck", "shortname": ":slot_machine:", "unicode": "1F3B0", "aliases": ""}, "ice_cream": {"keywords": "ice cream desert food hot icecream ice cream dairy dessert cold soft serve cone waffle", "shortname": ":ice_cream:", "unicode": "1F368", "aliases": ""}, "foggy": {"keywords": "foggy mountain photo bridge weather fog foggy", "shortname": ":foggy:", "unicode": "1F301", "aliases": ""}, "euro": {"keywords": "banknote with euro sign currency dollar money euro europe banknote money currency paper cash bills", "shortname": ":euro:", "unicode": "1F4B6", "aliases": ""}, "crossed_flags": {"keywords": "crossed flags japan", "shortname": ":crossed_flags:", "unicode": "1F38C", "aliases": ""}, "smile_cat": {"keywords": "grinning cat face with smiling eyes animal cats cat smile grin grinning", "shortname": ":smile_cat:", "unicode": "1F638", "aliases": ""}, "hushed": {"keywords": "hushed face face woo quiet hush whisper silent", "shortname": ":hushed:", "unicode": "1F62F", "aliases": ""}, "triangular_ruler": {"keywords": "triangular ruler architect math sketch stationery", "shortname": ":triangular_ruler:", "unicode": "1F4D0", "aliases": ""}, "ocean": {"keywords": "water wave sea water wave ocean wave surf beach tide", "shortname": ":ocean:", "unicode": "1F30A", "aliases": ""}, "page_with_curl": {"keywords": "page with curl documents", "shortname": ":page_with_curl:", "unicode": "1F4C3", "aliases": ""}, "flags": {"keywords": "carp streamer banner carp fish japanese koinobori children kids boys celebration happiness carp streamers japanese holiday flags", "shortname": ":flags:", "unicode": "1F38F", "aliases": ""}, "hearts": {"keywords": "black heart suit cards poker", "shortname": ":hearts:", "unicode": "2665", "aliases": ""}, "muscle": {"keywords": "flexed biceps arm flex hand strong muscle bicep", "shortname": ":muscle:", "unicode": "1F4AA", "aliases": ""}, "love_hotel": {"keywords": "love hotel affection dating like love hotel love sex romance leisure adultery prostitution hospital birth happy", "shortname": ":love_hotel:", "unicode": "1F3E9", "aliases": ""}, "snowman": {"keywords": "snowman without snow christmas cold season weather winter xmas", "shortname": ":snowman:", "unicode": "26C4", "aliases": ""}, "eyeglasses": {"keywords": "eyeglasses accessories eyesight fashion eyeglasses spectacles eye sight nearsightedness myopia farsightedness hyperopia frames vision see blurry contacts", "shortname": ":eyeglasses:", "unicode": "1F453", "aliases": ""}, "rocket": {"keywords": "rocket launch ship staffmode rocket space spacecraft astronaut cosmonaut", "shortname": ":rocket:", "unicode": "1F680", "aliases": ""}, "yen": {"keywords": "banknote with yen sign currency dollar japanese money yen japan japanese banknote money currency paper cash bill", "shortname": ":yen:", "unicode": "1F4B4", "aliases": ""}, "straight_ruler": {"keywords": "straight ruler stationery", "shortname": ":straight_ruler:", "unicode": "1F4CF", "aliases": ""}, "u7533": {"keywords": "squared cjk unified ideograph-7533 chinese japanese kanji", "shortname": ":u7533:", "unicode": "1F238", "aliases": ""}, "racehorse": {"keywords": "horse animal gamble horse powerful draft calvary cowboy cowgirl mounted race ride gallop trot colt filly mare stallion gelding yearling thoroughbred pony", "shortname": ":racehorse:", "unicode": "1F40E", "aliases": ""}, "sleepy": {"keywords": "sleepy face face rest tired sleepy tired exhausted", "shortname": ":sleepy:", "unicode": "1F62A", "aliases": ""}, "green_apple": {"keywords": "green apple fruit nature apple fruit green pie granny smith core", "shortname": ":green_apple:", "unicode": "1F34F", "aliases": ""}, "bridge_at_night": {"keywords": "bridge at night photo sanfrancisco bridge night water road evening suspension golden gate", "shortname": ":bridge_at_night:", "unicode": "1F309", "aliases": ""}, "doughnut": {"keywords": "doughnut desert food snack sweet doughnut donut pastry fried dessert breakfast police homer sweet", "shortname": ":doughnut:", "unicode": "1F369", "aliases": ""}, "first_quarter_moon_with_face": {"keywords": "first quarter moon with face nature moon first quarter anthropomorphic face sky night cheese phase", "shortname": ":first_quarter_moon_with_face:", "unicode": "1F31B", "aliases": ""}, "womans_hat": {"keywords": "womans hat accessories fashion female", "shortname": ":womans_hat:", "unicode": "1F452", "aliases": ""}, "sandal": {"keywords": "womans sandal fashion shoes", "shortname": ":sandal:", "unicode": "1F461", "aliases": ""}, "white_medium_square": {"keywords": "white medium square shape", "shortname": ":white_medium_square:", "unicode": "25FB", "aliases": ""}, "snowboarder": {"keywords": "snowboarder sports winter snow boarding sports freestyle halfpipe board mountain alpine winter", "shortname": ":snowboarder:", "unicode": "1F3C2", "aliases": ""}, "sunflower": {"keywords": "sunflower nature plant sunflower sun flower seeds yellow", "shortname": ":sunflower:", "unicode": "1F33B", "aliases": ""}, "grey_exclamation": {"keywords": "white exclamation mark ornament surprise", "shortname": ":grey_exclamation:", "unicode": "2755", "aliases": ""}, "rose": {"keywords": "rose flowers love valentines rose fragrant flower thorns love petals romance", "shortname": ":rose:", "unicode": "1F339", "aliases": ""}, "cl": {"keywords": "squared cl alphabet red-square words", "shortname": ":cl:", "unicode": "1F191", "aliases": ""}, "tropical_fish": {"keywords": "tropical fish animal swim", "shortname": ":tropical_fish:", "unicode": "1F420", "aliases": ""}, "cherries": {"keywords": "cherries food fruit cherry cherries tree fruit pit", "shortname": ":cherries:", "unicode": "1F352", "aliases": ""}, "innocent": {"keywords": "smiling face with halo angel face halo halo angel innocent ring circle heaven", "shortname": ":innocent:", "unicode": "1F607", "aliases": ""}, "rice_cracker": {"keywords": "rice cracker food japanese rice cracker seaweed food japanese", "shortname": ":rice_cracker:", "unicode": "1F358", "aliases": ""}, "ski": {"keywords": "ski and ski boot cold sports winter ski downhill cross-country poles snow winter mountain alpine powder slalom freestyle", "shortname": ":ski:", "unicode": "1F3BF", "aliases": ""}, "pill": {"keywords": "pill health medicine", "shortname": ":pill:", "unicode": "1F48A", "aliases": ""}, "musical_keyboard": {"keywords": "musical keyboard instrument piano music keyboard piano organ instrument electric", "shortname": ":musical_keyboard:", "unicode": "1F3B9", "aliases": ""}, "boom": {"keywords": "collision symbol bomb explode explosion boom bang collision fire emphasis wow bam", "shortname": ":boom:", "unicode": "1F4A5", "aliases": ""}, "full_moon": {"keywords": "full moon symbol nature yellow moon full sky night cheese phase monster spooky werewolves twilight", "shortname": ":full_moon:", "unicode": "1F315", "aliases": ""}, "orange_book": {"keywords": "orange book knowledge library read", "shortname": ":orange_book:", "unicode": "1F4D9", "aliases": ""}, "couple": {"keywords": "man and woman holding hands affection date dating human like love marriage people valentines", "shortname": ":couple:", "unicode": "1F46B", "aliases": ""}, "japanese_goblin": {"keywords": "japanese goblin evil mask red japanese tengu supernatural avian demon goblin mask theater nose frown mustache anger frustration", "shortname": ":japanese_goblin:", "unicode": "1F47A", "aliases": ""}, "inbox_tray": {"keywords": "inbox tray documents email", "shortname": ":inbox_tray:", "unicode": "1F4E5", "aliases": ""}, "clock1": {"keywords": "clock face one oclock clock time", "shortname": ":clock1:", "unicode": "1F550", "aliases": ""}, "clock2": {"keywords": "clock face two oclock clock time", "shortname": ":clock2:", "unicode": "1F551", "aliases": ""}, "clock3": {"keywords": "clock face three oclock clock time", "shortname": ":clock3:", "unicode": "1F552", "aliases": ""}, "five": {"keywords": "digit five blue-square numbers prime", "shortname": ":five:", "unicode": "0035-20E3", "aliases": ""}, "clock5": {"keywords": "clock face five oclock clock time", "shortname": ":clock5:", "unicode": "1F554", "aliases": ""}, "clock6": {"keywords": "clock face six oclock clock time", "shortname": ":clock6:", "unicode": "1F555", "aliases": ""}, "clock7": {"keywords": "clock face seven oclock clock time", "shortname": ":clock7:", "unicode": "1F556", "aliases": ""}, "clock8": {"keywords": "clock face eight oclock clock time", "shortname": ":clock8:", "unicode": "1F557", "aliases": ""}, "clock9": {"keywords": "clock face nine oclock clock time", "shortname": ":clock9:", "unicode": "1F558", "aliases": ""}, "clock130": {"keywords": "clock face one-thirty clock time", "shortname": ":clock130:", "unicode": "1F55C", "aliases": ""}, "name_badge": {"keywords": "name badge fire forbid", "shortname": ":name_badge:", "unicode": "1F4DB", "aliases": ""}, "grin": {"keywords": "grinning face with smiling eyes face happy joy smile grin grinning smiling smile smiley", "shortname": ":grin:", "unicode": "1F601", "aliases": ""}, "womans_clothes": {"keywords": "womans clothes fashion woman clothing clothes blouse shirt wardrobe breasts cleavage shopping shop dressing dressed", "shortname": ":womans_clothes:", "unicode": "1F45A", "aliases": ""}, "gift": {"keywords": "wrapped present birthday christmas present xmas gift present wrap package birthday wedding", "shortname": ":gift:", "unicode": "1F381", "aliases": ""}, "bangbang": {"keywords": "double exclamation mark exclamation surprise", "shortname": ":bangbang:", "unicode": "203C", "aliases": ""}, "stuck_out_tongue_winking_eye": {"keywords": "face with stuck-out tongue and winking eye childish face mischievous playful prank tongue wink winking kidding silly playful crazy", "shortname": ":stuck_out_tongue_winking_eye:", "unicode": "1F61C", "aliases": ""}, "candy": {"keywords": "candy desert snack candy sugar sweet hard", "shortname": ":candy:", "unicode": "1F36C", "aliases": ""}, "arrows_counterclockwise": {"keywords": "anticlockwise downwards and upwards open circle ar blue-square sync", "shortname": ":arrows_counterclockwise:", "unicode": "1F504", "aliases": ""}, "capricorn": {"keywords": "capricorn capricorn sea-goat goat-horned astrology greek constellation stars zodiac sign sign zodiac horoscope", "shortname": ":capricorn:", "unicode": "2651", "aliases": ""}, "hotsprings": {"keywords": "hot springs bath relax warm", "shortname": ":hotsprings:", "unicode": "2668", "aliases": ""}, "laughing": {"keywords": "smiling face with open mouth and tightly-closed ey happy joy lol smiling laughing laugh", "shortname": ":laughing:", "unicode": "1F606", "aliases": ":satisfied:"}, "trolleybus": {"keywords": "trolleybus bart transportation vehicle trolley bus city transport transportation", "shortname": ":trolleybus:", "unicode": "1F68E", "aliases": ""}, "potable_water": {"keywords": "potable water symbol blue-square cleaning faucet liquid restroom potable water drinkable pure clear clean aqua h20", "shortname": ":potable_water:", "unicode": "1F6B0", "aliases": ""}, "city_dusk": {"keywords": "cityscape at dusk photo city scape sunset dusk lights evening metropolitan night dark", "shortname": ":city_dusk:", "unicode": "1F306", "aliases": ""}, "clap": {"keywords": "clapping hands sign applause congrats hands praise clapping appreciation approval sound encouragement enthusiasm", "shortname": ":clap:", "unicode": "1F44F", "aliases": ""}, "clock230": {"keywords": "clock face two-thirty clock time", "shortname": ":clock230:", "unicode": "1F55D", "aliases": ""}, "left_right_arrow": {"keywords": "left right arrow shape", "shortname": ":left_right_arrow:", "unicode": "2194", "aliases": ""}, "japanese_castle": {"keywords": "japanese castle building photo castle japanese residence royalty fort fortified fortress", "shortname": ":japanese_castle:", "unicode": "1F3EF", "aliases": ""}, "waning_gibbous_moon": {"keywords": "waning gibbous moon symbol nature moon waning gibbous sky night cheese phase", "shortname": ":waning_gibbous_moon:", "unicode": "1F316", "aliases": ""}, "crown": {"keywords": "crown king kod leader royalty", "shortname": ":crown:", "unicode": "1F451", "aliases": ""}, "back": {"keywords": "back with leftwards arrow above arrow", "shortname": ":back:", "unicode": "1F519", "aliases": ""}, "sparkling_heart": {"keywords": "sparkling heart affection like love valentines", "shortname": ":sparkling_heart:", "unicode": "1F496", "aliases": ""}, "clubs": {"keywords": "black club suit cards poker", "shortname": ":clubs:", "unicode": "2663", "aliases": ""}, "rage": {"keywords": "pouting face angry despise hate mad pout anger rage irate", "shortname": ":rage:", "unicode": "1F621", "aliases": ""}, "person_with_pouting_face": {"keywords": "person with pouting face female girl woman pout sexy cute annoyed", "shortname": ":person_with_pouting_face:", "unicode": "1F64E", "aliases": ""}, "rabbit2": {"keywords": "rabbit animal nature rabbit bunny easter reproduction prolific", "shortname": ":rabbit2:", "unicode": "1F407", "aliases": ""}, "two_men_holding_hands": {"keywords": "two men holding hands bromance couple friends like love men gay homosexual friends hands holding team unity", "shortname": ":two_men_holding_hands:", "unicode": "1F46C", "aliases": ""}, "tired_face": {"keywords": "tired face face frustrated sick upset whine exhausted sleepy tired", "shortname": ":tired_face:", "unicode": "1F62B", "aliases": ""}, "anguished": {"keywords": "anguished face face nervous stunned pain anguish ouch misery distress grief", "shortname": ":anguished:", "unicode": "1F627", "aliases": ""}, "tanabata_tree": {"keywords": "tanabata tree nature plant tanabata tree festival star wish holiday", "shortname": ":tanabata_tree:", "unicode": "1F38B", "aliases": ""}, "carousel_horse": {"keywords": "carousel horse carnival horse photo carousel horse amusement park ride entertainment park fair", "shortname": ":carousel_horse:", "unicode": "1F3A0", "aliases": ""}, "large_orange_diamond": {"keywords": "large orange diamond shape", "shortname": ":large_orange_diamond:", "unicode": "1F536", "aliases": ""}, "deciduous_tree": {"keywords": "deciduous tree nature plant deciduous tree leaves fall color", "shortname": ":deciduous_tree:", "unicode": "1F333", "aliases": ""}, "o2": {"keywords": "negative squared latin capital letter o alphabet letter red-square", "shortname": ":o2:", "unicode": "1F17E", "aliases": ""}, "knife": {"keywords": "hocho ", "shortname": ":knife:", "unicode": "1F52A", "aliases": ""}, "nose": {"keywords": "nose smell sniff", "shortname": ":nose:", "unicode": "1F443", "aliases": ""}, "point_up": {"keywords": "white up pointing index direction fingers hand", "shortname": ":point_up:", "unicode": "261D", "aliases": ""}, "heavy_minus_sign": {"keywords": "heavy minus sign calculation math", "shortname": ":heavy_minus_sign:", "unicode": "2796", "aliases": ""}, "zzz": {"keywords": "sleeping symbol sleepy tired", "shortname": ":zzz:", "unicode": "1F4A4", "aliases": ""}, "corn": {"keywords": "ear of maize food plant vegetable corn maize food iowa kernel popcorn husk yellow stalk cob ear", "shortname": ":corn:", "unicode": "1F33D", "aliases": ""}, "kissing_smiling_eyes": {"keywords": "kissing face with smiling eyes affection face infatuation valentines kissing kiss smile pucker lips smooch", "shortname": ":kissing_smiling_eyes:", "unicode": "1F619", "aliases": ""}, "clock4": {"keywords": "clock face four oclock clock time", "shortname": ":clock4:", "unicode": "1F553", "aliases": ""}, "closed_umbrella": {"keywords": "closed umbrella drizzle rain weather umbrella closed rain moisture protection sun ultraviolet uv", "shortname": ":closed_umbrella:", "unicode": "1F302", "aliases": ""}, "stew": {"keywords": "pot of food food meat stew hearty soup thick hot pot", "shortname": ":stew:", "unicode": "1F372", "aliases": ""}, "santa": {"keywords": "father christmas christmas father christmas festival male man xmas santa saint nick jolly ho ho ho north pole presents gifts naughty nice sleigh father christmas holiday", "shortname": ":santa:", "unicode": "1F385", "aliases": ""}, "volcano": {"keywords": "volcano nature photo volcano lava magma hot explode", "shortname": ":volcano:", "unicode": "1F30B", "aliases": ""}, "kissing_heart": {"keywords": "face throwing a kiss affection face infatuation kiss blowing kiss heart love lips like love valentines", "shortname": ":kissing_heart:", "unicode": "1F618", "aliases": ""}, "no_pedestrians": {"keywords": "no pedestrians crossing rules walking no walk pedestrian stroll stride foot feet", "shortname": ":no_pedestrians:", "unicode": "1F6B7", "aliases": ""}, "bamboo": {"keywords": "pine decoration nature plant vegetable pine bamboo decoration new years spirits harvest prosperity longevity fortune luck welcome farming agriculture", "shortname": ":bamboo:", "unicode": "1F38D", "aliases": ""}, "eight_spoked_asterisk": {"keywords": "eight spoked asterisk green-square sparkle star", "shortname": ":eight_spoked_asterisk:", "unicode": "2733", "aliases": ""}, "person_with_blond_hair": {"keywords": "person with blond hair male man blonde young western westerner occidental", "shortname": ":person_with_blond_hair:", "unicode": "1F471", "aliases": ""}, "trophy": {"keywords": "trophy award ceremony contest ftw place win trophy first show place win reward achievement medal", "shortname": ":trophy:", "unicode": "1F3C6", "aliases": ""}, "on": {"keywords": "on with exclamation mark with left right arrow abo arrow words", "shortname": ":on:", "unicode": "1F51B", "aliases": ""}, "ok": {"keywords": "squared ok agree blue-square good yes", "shortname": ":ok:", "unicode": "1F197", "aliases": ""}, "package": {"keywords": "package gift mail", "shortname": ":package:", "unicode": "1F4E6", "aliases": ""}, "black_small_square": {"keywords": "black small square ", "shortname": ":black_small_square:", "unicode": "25AA", "aliases": ""}, "school_satchel": {"keywords": "school satchel bag education student school satchel backpack bag packing pack hike education adventure travel sightsee", "shortname": ":school_satchel:", "unicode": "1F392", "aliases": ""}, "o": {"keywords": "heavy large circle circle round", "shortname": ":o:", "unicode": "2B55", "aliases": ""}, "clock12": {"keywords": "clock face twelve oclock clock time", "shortname": ":clock12:", "unicode": "1F55B", "aliases": ""}, "chart_with_downwards_trend": {"keywords": "chart with downwards trend graph", "shortname": ":chart_with_downwards_trend:", "unicode": "1F4C9", "aliases": ""}, "clock10": {"keywords": "clock face ten oclock clock time", "shortname": ":clock10:", "unicode": "1F559", "aliases": ""}, "clock11": {"keywords": "clock face eleven oclock clock time", "shortname": ":clock11:", "unicode": "1F55A", "aliases": ""}, "no_bell": {"keywords": "bell with cancellation stroke mute sound volume", "shortname": ":no_bell:", "unicode": "1F515", "aliases": ""}, "sweat": {"keywords": "face with cold sweat cold sweat sick anxious worried clammy diaphoresis face hot", "shortname": ":sweat:", "unicode": "1F613", "aliases": ""}, "ox": {"keywords": "ox animal beef cow", "shortname": ":ox:", "unicode": "1F402", "aliases": ""}, "mountain_railway": {"keywords": "mountain railway transportation mountain railway rail train transport", "shortname": ":mountain_railway:", "unicode": "1F69E", "aliases": ""}, "tongue": {"keywords": "tongue mouth playful tongue mouth taste buds food silly playful tease kiss french kiss lick tasty playfulness silliness intimacy", "shortname": ":tongue:", "unicode": "1F445", "aliases": ""}, "womens": {"keywords": "womens symbol purple-square woman bathroom restroom sign girl female avatar", "shortname": ":womens:", "unicode": "1F6BA", "aliases": ""}, "baby_symbol": {"keywords": "baby symbol child orange-square baby crawl newborn human diaper small babe", "shortname": ":baby_symbol:", "unicode": "1F6BC", "aliases": ""}, "hospital": {"keywords": "hospital building doctor health surgery", "shortname": ":hospital:", "unicode": "1F3E5", "aliases": ""}, "baby_chick": {"keywords": "baby chick animal chicken chick baby bird chicken young woman cute", "shortname": ":baby_chick:", "unicode": "1F424", "aliases": ""}, "turtle": {"keywords": "turtle animal slow turtle shell tortoise chelonian reptile slow snap steady", "shortname": ":turtle:", "unicode": "1F422", "aliases": ""}, "black_square_button": {"keywords": "black square button frame", "shortname": ":black_square_button:", "unicode": "1F532", "aliases": ""}, "do_not_litter": {"keywords": "do not litter symbol bin garbage trash litter garbage waste no can trash", "shortname": ":do_not_litter:", "unicode": "1F6AF", "aliases": ""}, "wind_chime": {"keywords": "wind chime ding nature wind chime bell f\u016brin instrument music spirits soothing protective spiritual sound", "shortname": ":wind_chime:", "unicode": "1F390", "aliases": ""}, "waxing_crescent_moon": {"keywords": "waxing crescent moon symbol nature moon waxing sky night cheese phase", "shortname": ":waxing_crescent_moon:", "unicode": "1F312", "aliases": ""}, "tiger2": {"keywords": "tiger animal nature tiger cat striped tony tigger hobs", "shortname": ":tiger2:", "unicode": "1F405", "aliases": ""}, "two": {"keywords": "digit two 2 blue-square numbers prime", "shortname": ":two:", "unicode": "0032-20E3", "aliases": ""}, "dango": {"keywords": "dango food dango japanese dumpling mochi balls skewer", "shortname": ":dango:", "unicode": "1F361", "aliases": ""}, "red_circle": {"keywords": "large red circle shape", "shortname": ":red_circle:", "unicode": "1F534", "aliases": ""}, "syringe": {"keywords": "syringe blood drugs health hospital medicine needle", "shortname": ":syringe:", "unicode": "1F489", "aliases": ""}, "last_quarter_moon": {"keywords": "last quarter moon symbol nature moon last quarter sky night cheese phase", "shortname": ":last_quarter_moon:", "unicode": "1F317", "aliases": ""}, "tada": {"keywords": "party popper contulations party party popper tada celebration victory announcement climax congratulations", "shortname": ":tada:", "unicode": "1F389", "aliases": ""}, "ok_hand": {"keywords": "ok hand sign fingers limbs perfect okay ok smoke smoking marijuana joint pot 420", "shortname": ":ok_hand:", "unicode": "1F44C", "aliases": ""}, "custard": {"keywords": "custard desert food custard cream rich butter dessert cr\u00e8me br\u00fbl\u00e9e french", "shortname": ":custard:", "unicode": "1F36E", "aliases": ""}, "rowboat": {"keywords": "rowboat hobby ship sports water boat row oar paddle", "shortname": ":rowboat:", "unicode": "1F6A3", "aliases": ""}, "clock530": {"keywords": "clock face five-thirty clock time", "shortname": ":clock530:", "unicode": "1F560", "aliases": ""}, "heavy_multiplication_x": {"keywords": "heavy multiplication x calculation math", "shortname": ":heavy_multiplication_x:", "unicode": "2716", "aliases": ""}, "white_check_mark": {"keywords": "white heavy check mark agree green-square ok", "shortname": ":white_check_mark:", "unicode": "2705", "aliases": ""}, "tennis": {"keywords": "tennis racquet and ball balls green sports tennis racket racquet ball game net court love", "shortname": ":tennis:", "unicode": "1F3BE", "aliases": ""}, "question": {"keywords": "black question mark ornament confused doubt", "shortname": ":question:", "unicode": "2753", "aliases": ""}, "secret": {"keywords": "circled ideograph secret privacy", "shortname": ":secret:", "unicode": "3299", "aliases": ""}, "stars": {"keywords": "shooting star night photo shooting shoot star sky night comet meteoroid", "shortname": ":stars:", "unicode": "1F320", "aliases": ""}, "capital_abcd": {"keywords": "input symbol for latin capital letters alphabet blue-square words", "shortname": ":capital_abcd:", "unicode": "1F520", "aliases": ""}, "mahjong": {"keywords": "mahjong tile red dragon chinese game kanji", "shortname": ":mahjong:", "unicode": "1F004", "aliases": ""}, "bus": {"keywords": "bus car transportation vehicle bus school city transportation public", "shortname": ":bus:", "unicode": "1F68C", "aliases": ""}, "registered": {"keywords": "registered sign alphabet circle", "shortname": ":registered:", "unicode": "00AE", "aliases": ""}, "fireworks": {"keywords": "fireworks carnival congratulations festival photo fireworks independence celebration explosion july 4th rocket sky idea excitement", "shortname": ":fireworks:", "unicode": "1F386", "aliases": ""}, "construction": {"keywords": "construction sign caution progress wip", "shortname": ":construction:", "unicode": "1F6A7", "aliases": ""}, "link": {"keywords": "link symbol rings url", "shortname": ":link:", "unicode": "1F517", "aliases": ""}, "fallen_leaf": {"keywords": "fallen leaf leaves nature plant vegetable leaf fall color deciduous autumn", "shortname": ":fallen_leaf:", "unicode": "1F342", "aliases": ""}, "astonished": {"keywords": "astonished face face xox shocked surprise astonished", "shortname": ":astonished:", "unicode": "1F632", "aliases": ""}, "card_index": {"keywords": "card index business stationery", "shortname": ":card_index:", "unicode": "1F4C7", "aliases": ""}, "ear": {"keywords": "ear face hear listen sound", "shortname": ":ear:", "unicode": "1F442", "aliases": ""}, "radio_button": {"keywords": "radio button input", "shortname": ":radio_button:", "unicode": "1F518", "aliases": ""}, "bug": {"keywords": "bug insect nature bug insect virus error", "shortname": ":bug:", "unicode": "1F41B", "aliases": ""}, "penguin": {"keywords": "penguin animal nature", "shortname": ":penguin:", "unicode": "1F427", "aliases": ""}, "football": {"keywords": "american football NFL balls sports football ball sport america american", "shortname": ":football:", "unicode": "1F3C8", "aliases": ""}, "arrow_heading_down": {"keywords": "arrow pointing rightwards then curving downwards arrow blue-square", "shortname": ":arrow_heading_down:", "unicode": "2935", "aliases": ""}, "congratulations": {"keywords": "circled ideograph congratulation chinese japanese kanji", "shortname": ":congratulations:", "unicode": "3297", "aliases": ""}, "dromedary_camel": {"keywords": "dromedary camel animal desert hot dromedary camel hump desert middle east heat hot water hump day wednesday sex", "shortname": ":dromedary_camel:", "unicode": "1F42A", "aliases": ""}, "skull": {"keywords": "skull dead skeleton dying", "shortname": ":skull:", "unicode": "1F480", "aliases": ":skeleton:"}, "bride_with_veil": {"keywords": "bride with veil couple marriage wedding bride wedding planning veil gown dress engagement white", "shortname": ":bride_with_veil:", "unicode": "1F470", "aliases": ""}, "stuck_out_tongue": {"keywords": "face with stuck-out tongue childish face mischievous playful prank tongue silly playful cheeky", "shortname": ":stuck_out_tongue:", "unicode": "1F61B", "aliases": ""}, "relaxed": {"keywords": "white smiling face blush face happiness massage smile", "shortname": ":relaxed:", "unicode": "263A", "aliases": ""}, "grey_question": {"keywords": "white question mark ornament doubts", "shortname": ":grey_question:", "unicode": "2754", "aliases": ""}, "vhs": {"keywords": "videocassette oldschool record video", "shortname": ":vhs:", "unicode": "1F4FC", "aliases": ""}, "strawberry": {"keywords": "strawberry food fruit nature strawberry short cake berry", "shortname": ":strawberry:", "unicode": "1F353", "aliases": ""}, "cat2": {"keywords": "cat animal meow pet cat kitten meow", "shortname": ":cat2:", "unicode": "1F408", "aliases": ""}, "athletic_shoe": {"keywords": "athletic shoe shoes sports", "shortname": ":athletic_shoe:", "unicode": "1F45F", "aliases": ""}, "star2": {"keywords": "glowing star night sparkle glow glowing star five points classic", "shortname": ":star2:", "unicode": "1F31F", "aliases": ""}, "cake": {"keywords": "shortcake desert food cake short dessert strawberry", "shortname": ":cake:", "unicode": "1F370", "aliases": ""}, "arrow_double_up": {"keywords": "black up-pointing double triangle arrow blue-square", "shortname": ":arrow_double_up:", "unicode": "23EB", "aliases": ""}, "toilet": {"keywords": "toilet restroom wc toilet bathroom throne porcelain waste flush plumbing", "shortname": ":toilet:", "unicode": "1F6BD", "aliases": ""}, "ab": {"keywords": "negative squared ab alphabet red-square", "shortname": ":ab:", "unicode": "1F18E", "aliases": ""}, "hash": {"keywords": "number sign symbol", "shortname": ":hash:", "unicode": "0023-20E3", "aliases": ""}, "sweet_potato": {"keywords": "roasted sweet potato food nature sweet potato potassium roasted roast", "shortname": ":sweet_potato:", "unicode": "1F360", "aliases": ""}, "mortar_board": {"keywords": "graduation cap cap college degree graduation hat school university graduation cap mortarboard academic education ceremony square tassel", "shortname": ":mortar_board:", "unicode": "1F393", "aliases": ""}, "up": {"keywords": "squared up with exclamation mark blue-square", "shortname": ":up:", "unicode": "1F199", "aliases": ""}, "hatched_chick": {"keywords": "front-facing baby chick baby chicken chick baby bird chicken young woman cute", "shortname": ":hatched_chick:", "unicode": "1F425", "aliases": ""}, "triangular_flag_on_post": {"keywords": "triangular flag on post triangle triangular flag golf post flagpole", "shortname": ":triangular_flag_on_post:", "unicode": "1F6A9", "aliases": ""}, "black_nib": {"keywords": "black nib pen stationery", "shortname": ":black_nib:", "unicode": "2712", "aliases": ""}, "pig": {"keywords": "pig face animal oink", "shortname": ":pig:", "unicode": "1F437", "aliases": ""}, "floppy_disk": {"keywords": "floppy disk oldschool save technology floppy disk storage information computer drive megabyte", "shortname": ":floppy_disk:", "unicode": "1F4BE", "aliases": ""}, "black_large_square": {"keywords": "black large square shape", "shortname": ":black_large_square:", "unicode": "2B1B", "aliases": ""}, "ship": {"keywords": "ship titanic transportation ferry ship boat", "shortname": ":ship:", "unicode": "1F6A2", "aliases": ""}, "8ball": {"keywords": "billiards pool billiards eight ball pool pocket ball cue", "shortname": ":8ball:", "unicode": "1F3B1", "aliases": ""}, "telephone_receiver": {"keywords": "telephone receiver communication dial technology", "shortname": ":telephone_receiver:", "unicode": "1F4DE", "aliases": ""}, "u7981": {"keywords": "squared cjk unified ideograph-7981 chinese forbidden japanese kanji limit restricted", "shortname": ":u7981:", "unicode": "1F232", "aliases": ""}, "person_frowning": {"keywords": "person frowning female girl woman dejected rejected sad frown", "shortname": ":person_frowning:", "unicode": "1F64D", "aliases": ""}, "movie_camera": {"keywords": "movie camera film record movie camera camcorder video motion picture", "shortname": ":movie_camera:", "unicode": "1F3A5", "aliases": ""}, "lemon": {"keywords": "lemon fruit nature lemon yellow citrus", "shortname": ":lemon:", "unicode": "1F34B", "aliases": ""}, "arrow_double_down": {"keywords": "black down-pointing double triangle arrow blue-square", "shortname": ":arrow_double_down:", "unicode": "23EC", "aliases": ""}, "peach": {"keywords": "peach food fruit nature peach fruit juicy pit", "shortname": ":peach:", "unicode": "1F351", "aliases": ""}, "boot": {"keywords": "womans boots fashion shoes", "shortname": ":boot:", "unicode": "1F462", "aliases": ""}, "ng": {"keywords": "squared ng blue-square", "shortname": ":ng:", "unicode": "1F196", "aliases": ""}, "end": {"keywords": "end with leftwards arrow above arrow words", "shortname": ":end:", "unicode": "1F51A", "aliases": ""}, "mountain_bicyclist": {"keywords": "mountain bicyclist human sports transportation bicyclist mountain bike pedal bicycle transportation", "shortname": ":mountain_bicyclist:", "unicode": "1F6B5", "aliases": ""}, "book": {"keywords": "open book library literature", "shortname": ":book:", "unicode": "1F4D6", "aliases": ""}, "clock1130": {"keywords": "clock face eleven-thirty clock time", "shortname": ":clock1130:", "unicode": "1F566", "aliases": ""}, "oncoming_bus": {"keywords": "oncoming bus transportation vehicle bus school city transportation public", "shortname": ":oncoming_bus:", "unicode": "1F68D", "aliases": ""}, "clock1030": {"keywords": "clock face ten-thirty clock time", "shortname": ":clock1030:", "unicode": "1F565", "aliases": ""}, "heart_eyes_cat": {"keywords": "smiling cat face with heart-shaped eyes affection animal cats like love valentines lovestruck love heart", "shortname": ":heart_eyes_cat:", "unicode": "1F63B", "aliases": ""}, "repeat": {"keywords": "clockwise rightwards and leftwards open circle arr loop record", "shortname": ":repeat:", "unicode": "1F501", "aliases": ""}, "star": {"keywords": "white medium star night yellow", "shortname": ":star:", "unicode": "2B50", "aliases": ""}, "dart": {"keywords": "direct hit bar game direct hit bullseye dart archery game fletching arrow sport", "shortname": ":dart:", "unicode": "1F3AF", "aliases": ""}, "envelope": {"keywords": "envelope communication letter mail postal", "shortname": ":envelope:", "unicode": "2709", "aliases": ""}, "footprints": {"keywords": "footprints feet", "shortname": ":footprints:", "unicode": "1F463", "aliases": ""}, "smiley": {"keywords": "smiling face with open mouth face haha happy joy smiling smile smiley", "shortname": ":smiley:", "unicode": "1F603", "aliases": ""}, "pear": {"keywords": "pear fruit nature pear fruit shape", "shortname": ":pear:", "unicode": "1F350", "aliases": ""}, "taurus": {"keywords": "taurus purple-square sign taurus bull astrology greek constellation stars zodiac sign zodiac horoscope", "shortname": ":taurus:", "unicode": "2649", "aliases": ""}, "articulated_lorry": {"keywords": "articulated lorry cars transportation vehicle truck delivery semi lorry articulated", "shortname": ":articulated_lorry:", "unicode": "1F69B", "aliases": ""}, "u6e80": {"keywords": "squared cjk unified ideograph-6e80 chinese full japanese kanji red-square", "shortname": ":u6e80:", "unicode": "1F235", "aliases": ""}, "money_with_wings": {"keywords": "money with wings bills dollar payment money wings easy spend work lost blown burned gift cash dollar", "shortname": ":money_with_wings:", "unicode": "1F4B8", "aliases": ""}, "black_medium_square": {"keywords": "black medium square shape", "shortname": ":black_medium_square:", "unicode": "25FC", "aliases": ""}, "closed_book": {"keywords": "closed book knowledge library read", "shortname": ":closed_book:", "unicode": "1F4D5", "aliases": ""}, "ghost": {"keywords": "ghost halloween", "shortname": ":ghost:", "unicode": "1F47B", "aliases": ""}, "droplet": {"keywords": "droplet drip faucet water drop droplet h20 water aqua tear sweat rain moisture wet moist spit", "shortname": ":droplet:", "unicode": "1F4A7", "aliases": ""}, "spades": {"keywords": "black spade suit cards poker", "shortname": ":spades:", "unicode": "2660", "aliases": ""}, "vibration_mode": {"keywords": "vibration mode orange-square phone", "shortname": ":vibration_mode:", "unicode": "1F4F3", "aliases": ""}, "expressionless": {"keywords": "expressionless face expressionless blank void vapid without expression face indifferent", "shortname": ":expressionless:", "unicode": "1F611", "aliases": ""}, "dvd": {"keywords": "dvd cd disc disk", "shortname": ":dvd:", "unicode": "1F4C0", "aliases": ""}, "mask": {"keywords": "face with medical mask face ill sick sick virus flu medical mask", "shortname": ":mask:", "unicode": "1F637", "aliases": ""}, "mag_right": {"keywords": "right-pointing magnifying glass search zoom detective investigator detail details", "shortname": ":mag_right:", "unicode": "1F50E", "aliases": ""}, "bento": {"keywords": "bento box box food japanese bento japanese rice meal box obento convenient lunchbox", "shortname": ":bento:", "unicode": "1F371", "aliases": ""}, "sunrise_over_mountains": {"keywords": "sunrise over mountains photo vacation view sunrise sun morning mountain rural color sky", "shortname": ":sunrise_over_mountains:", "unicode": "1F304", "aliases": ""}, "partly_sunny": {"keywords": "sun behind cloud cloud morning nature weather", "shortname": ":partly_sunny:", "unicode": "26C5", "aliases": ""}, "heavy_dollar_sign": {"keywords": "heavy dollar sign currency money payment dollar currency money cash sale purchase value", "shortname": ":heavy_dollar_sign:", "unicode": "1F4B2", "aliases": ""}, "scroll": {"keywords": "scroll documents", "shortname": ":scroll:", "unicode": "1F4DC", "aliases": ""}} \ No newline at end of file diff --git a/pagure/static/emoji/emoji_strategy.json b/pagure/static/emoji/emoji_strategy.json deleted file mode 120000 index c74068b..0000000 --- a/pagure/static/emoji/emoji_strategy.json +++ /dev/null @@ -1 +0,0 @@ -emoji_strategy-1.3.1.json \ No newline at end of file diff --git a/pagure/static/emoji/emojione-1.3.1.js b/pagure/static/emoji/emojione-1.3.1.js deleted file mode 100644 index e961706..0000000 --- a/pagure/static/emoji/emojione-1.3.1.js +++ /dev/null @@ -1,466 +0,0 @@ -/* jshint maxerr: 10000 */ -/* jslint unused: true */ -/* jshint shadow: true */ -/* jshint -W075 */ -(function(ns){ - - ns.emojioneList = {':hash:':["0023-fe0f-20e3","0023-20e3"],':zero:':["0030-fe0f-20e3","0030-20e3"],':one:':["0031-fe0f-20e3","0031-20e3"],':two:':["0032-fe0f-20e3","0032-20e3"],':three:':["0033-fe0f-20e3","0033-20e3"],':four:':["0034-fe0f-20e3","0034-20e3"],':five:':["0035-fe0f-20e3","0035-20e3"],':six:':["0036-fe0f-20e3","0036-20e3"],':seven:':["0037-fe0f-20e3","0037-20e3"],':eight:':["0038-fe0f-20e3","0038-20e3"],':nine:':["0039-fe0f-20e3","0039-20e3"],':copyright:':["00a9"],':registered:':["00ae"],':bangbang:':["203c-fe0f","203c"],':interrobang:':["2049-fe0f","2049"],':tm:':["2122"],':information_source:':["2139-fe0f","2139"],':left_right_arrow:':["2194-fe0f","2194"],':arrow_up_down:':["2195-fe0f","2195"],':arrow_upper_left:':["2196-fe0f","2196"],':arrow_upper_right:':["2197-fe0f","2197"],':arrow_lower_right:':["2198-fe0f","2198"],':arrow_lower_left:':["2199-fe0f","2199"],':leftwards_arrow_with_hook:':["21a9-fe0f","21a9"],':arrow_right_hook:':["21aa-fe0f","21aa"],':watch:':["231a-fe0f","231a"],':hourglass:':["231b-fe0f","231b"],':fast_forward:':["23e9"],':rewind:':["23ea"],':arrow_double_up:':["23eb"],':arrow_double_down:':["23ec"],':alarm_clock:':["23f0"],':hourglass_flowing_sand:':["23f3"],':m:':["24c2-fe0f","24c2"],':black_small_square:':["25aa-fe0f","25aa"],':white_small_square:':["25ab-fe0f","25ab"],':arrow_forward:':["25b6-fe0f","25b6"],':arrow_backward:':["25c0-fe0f","25c0"],':white_medium_square:':["25fb-fe0f","25fb"],':black_medium_square:':["25fc-fe0f","25fc"],':white_medium_small_square:':["25fd-fe0f","25fd"],':black_medium_small_square:':["25fe-fe0f","25fe"],':sunny:':["2600-fe0f","2600"],':cloud:':["2601-fe0f","2601"],':telephone:':["260e-fe0f","260e"],':ballot_box_with_check:':["2611-fe0f","2611"],':umbrella:':["2614-fe0f","2614"],':coffee:':["2615-fe0f","2615"],':point_up:':["261d-fe0f","261d"],':relaxed:':["263a-fe0f","263a"],':aries:':["2648-fe0f","2648"],':taurus:':["2649-fe0f","2649"],':gemini:':["264a-fe0f","264a"],':cancer:':["264b-fe0f","264b"],':leo:':["264c-fe0f","264c"],':virgo:':["264d-fe0f","264d"],':libra:':["264e-fe0f","264e"],':scorpius:':["264f-fe0f","264f"],':sagittarius:':["2650-fe0f","2650"],':capricorn:':["2651-fe0f","2651"],':aquarius:':["2652-fe0f","2652"],':pisces:':["2653-fe0f","2653"],':spades:':["2660-fe0f","2660"],':clubs:':["2663-fe0f","2663"],':hearts:':["2665-fe0f","2665"],':diamonds:':["2666-fe0f","2666"],':hotsprings:':["2668-fe0f","2668"],':recycle:':["267b-fe0f","267b"],':wheelchair:':["267f-fe0f","267f"],':anchor:':["2693-fe0f","2693"],':warning:':["26a0-fe0f","26a0"],':zap:':["26a1-fe0f","26a1"],':white_circle:':["26aa-fe0f","26aa"],':black_circle:':["26ab-fe0f","26ab"],':soccer:':["26bd-fe0f","26bd"],':baseball:':["26be-fe0f","26be"],':snowman:':["26c4-fe0f","26c4"],':partly_sunny:':["26c5-fe0f","26c5"],':ophiuchus:':["26ce"],':no_entry:':["26d4-fe0f","26d4"],':church:':["26ea-fe0f","26ea"],':fountain:':["26f2-fe0f","26f2"],':golf:':["26f3-fe0f","26f3"],':sailboat:':["26f5-fe0f","26f5"],':tent:':["26fa-fe0f","26fa"],':fuelpump:':["26fd-fe0f","26fd"],':scissors:':["2702-fe0f","2702"],':white_check_mark:':["2705"],':airplane:':["2708-fe0f","2708"],':envelope:':["2709-fe0f","2709"],':fist:':["270a"],':raised_hand:':["270b"],':v:':["270c-fe0f","270c"],':pencil2:':["270f-fe0f","270f"],':black_nib:':["2712-fe0f","2712"],':heavy_check_mark:':["2714-fe0f","2714"],':heavy_multiplication_x:':["2716-fe0f","2716"],':sparkles:':["2728"],':eight_spoked_asterisk:':["2733-fe0f","2733"],':eight_pointed_black_star:':["2734-fe0f","2734"],':snowflake:':["2744-fe0f","2744"],':sparkle:':["2747-fe0f","2747"],':x:':["274c"],':negative_squared_cross_mark:':["274e"],':question:':["2753"],':grey_question:':["2754"],':grey_exclamation:':["2755"],':exclamation:':["2757-fe0f","2757"],':heart:':["2764-fe0f","2764"],':heavy_plus_sign:':["2795"],':heavy_minus_sign:':["2796"],':heavy_division_sign:':["2797"],':arrow_right:':["27a1-fe0f","27a1"],':curly_loop:':["27b0"],':arrow_heading_up:':["2934-fe0f","2934"],':arrow_heading_down:':["2935-fe0f","2935"],':arrow_left:':["2b05-fe0f","2b05"],':arrow_up:':["2b06-fe0f","2b06"],':arrow_down:':["2b07-fe0f","2b07"],':black_large_square:':["2b1b-fe0f","2b1b"],':white_large_square:':["2b1c-fe0f","2b1c"],':star:':["2b50-fe0f","2b50"],':o:':["2b55-fe0f","2b55"],':wavy_dash:':["3030"],':part_alternation_mark:':["303d-fe0f","303d"],':congratulations:':["3297-fe0f","3297"],':secret:':["3299-fe0f","3299"],':mahjong:':["1f004-fe0f","1f004"],':black_joker:':["1f0cf"],':a:':["1f170"],':b:':["1f171"],':o2:':["1f17e"],':parking:':["1f17f-fe0f","1f17f"],':ab:':["1f18e"],':cl:':["1f191"],':cool:':["1f192"],':free:':["1f193"],':id:':["1f194"],':new:':["1f195"],':ng:':["1f196"],':ok:':["1f197"],':sos:':["1f198"],':up:':["1f199"],':vs:':["1f19a"],':cn:':["1f1e8-1f1f3"],':de:':["1f1e9-1f1ea"],':es:':["1f1ea-1f1f8"],':fr:':["1f1eb-1f1f7"],':gb:':["1f1ec-1f1e7"],':it:':["1f1ee-1f1f9"],':jp:':["1f1ef-1f1f5"],':kr:':["1f1f0-1f1f7"],':us:':["1f1fa-1f1f8"],':ru:':["1f1f7-1f1fa"],':koko:':["1f201"],':sa:':["1f202"],':u7121:':["1f21a-fe0f","1f21a"],':u6307:':["1f22f-fe0f","1f22f"],':u7981:':["1f232"],':u7a7a:':["1f233"],':u5408:':["1f234"],':u6e80:':["1f235"],':u6709:':["1f236"],':u6708:':["1f237"],':u7533:':["1f238"],':u5272:':["1f239"],':u55b6:':["1f23a"],':ideograph_advantage:':["1f250"],':accept:':["1f251"],':cyclone:':["1f300"],':foggy:':["1f301"],':closed_umbrella:':["1f302"],':night_with_stars:':["1f303"],':sunrise_over_mountains:':["1f304"],':sunrise:':["1f305"],':city_dusk:':["1f306"],':city_sunset:':["1f307"],':city_sunrise:':["1f307"],':rainbow:':["1f308"],':bridge_at_night:':["1f309"],':ocean:':["1f30a"],':volcano:':["1f30b"],':milky_way:':["1f30c"],':earth_asia:':["1f30f"],':new_moon:':["1f311"],':first_quarter_moon:':["1f313"],':waxing_gibbous_moon:':["1f314"],':full_moon:':["1f315"],':crescent_moon:':["1f319"],':first_quarter_moon_with_face:':["1f31b"],':star2:':["1f31f"],':stars:':["1f320"],':chestnut:':["1f330"],':seedling:':["1f331"],':palm_tree:':["1f334"],':cactus:':["1f335"],':tulip:':["1f337"],':cherry_blossom:':["1f338"],':rose:':["1f339"],':hibiscus:':["1f33a"],':sunflower:':["1f33b"],':blossom:':["1f33c"],':corn:':["1f33d"],':ear_of_rice:':["1f33e"],':herb:':["1f33f"],':four_leaf_clover:':["1f340"],':maple_leaf:':["1f341"],':fallen_leaf:':["1f342"],':leaves:':["1f343"],':mushroom:':["1f344"],':tomato:':["1f345"],':eggplant:':["1f346"],':grapes:':["1f347"],':melon:':["1f348"],':watermelon:':["1f349"],':tangerine:':["1f34a"],':banana:':["1f34c"],':pineapple:':["1f34d"],':apple:':["1f34e"],':green_apple:':["1f34f"],':peach:':["1f351"],':cherries:':["1f352"],':strawberry:':["1f353"],':hamburger:':["1f354"],':pizza:':["1f355"],':meat_on_bone:':["1f356"],':poultry_leg:':["1f357"],':rice_cracker:':["1f358"],':rice_ball:':["1f359"],':rice:':["1f35a"],':curry:':["1f35b"],':ramen:':["1f35c"],':spaghetti:':["1f35d"],':bread:':["1f35e"],':fries:':["1f35f"],':sweet_potato:':["1f360"],':dango:':["1f361"],':oden:':["1f362"],':sushi:':["1f363"],':fried_shrimp:':["1f364"],':fish_cake:':["1f365"],':icecream:':["1f366"],':shaved_ice:':["1f367"],':ice_cream:':["1f368"],':doughnut:':["1f369"],':cookie:':["1f36a"],':chocolate_bar:':["1f36b"],':candy:':["1f36c"],':lollipop:':["1f36d"],':custard:':["1f36e"],':honey_pot:':["1f36f"],':cake:':["1f370"],':bento:':["1f371"],':stew:':["1f372"],':egg:':["1f373"],':fork_and_knife:':["1f374"],':tea:':["1f375"],':sake:':["1f376"],':wine_glass:':["1f377"],':cocktail:':["1f378"],':tropical_drink:':["1f379"],':beer:':["1f37a"],':beers:':["1f37b"],':ribbon:':["1f380"],':gift:':["1f381"],':birthday:':["1f382"],':jack_o_lantern:':["1f383"],':christmas_tree:':["1f384"],':santa:':["1f385"],':fireworks:':["1f386"],':sparkler:':["1f387"],':balloon:':["1f388"],':tada:':["1f389"],':confetti_ball:':["1f38a"],':tanabata_tree:':["1f38b"],':crossed_flags:':["1f38c"],':bamboo:':["1f38d"],':dolls:':["1f38e"],':flags:':["1f38f"],':wind_chime:':["1f390"],':rice_scene:':["1f391"],':school_satchel:':["1f392"],':mortar_board:':["1f393"],':carousel_horse:':["1f3a0"],':ferris_wheel:':["1f3a1"],':roller_coaster:':["1f3a2"],':fishing_pole_and_fish:':["1f3a3"],':microphone:':["1f3a4"],':movie_camera:':["1f3a5"],':cinema:':["1f3a6"],':headphones:':["1f3a7"],':art:':["1f3a8"],':tophat:':["1f3a9"],':circus_tent:':["1f3aa"],':ticket:':["1f3ab"],':clapper:':["1f3ac"],':performing_arts:':["1f3ad"],':video_game:':["1f3ae"],':dart:':["1f3af"],':slot_machine:':["1f3b0"],':8ball:':["1f3b1"],':game_die:':["1f3b2"],':bowling:':["1f3b3"],':flower_playing_cards:':["1f3b4"],':musical_note:':["1f3b5"],':notes:':["1f3b6"],':saxophone:':["1f3b7"],':guitar:':["1f3b8"],':musical_keyboard:':["1f3b9"],':trumpet:':["1f3ba"],':violin:':["1f3bb"],':musical_score:':["1f3bc"],':running_shirt_with_sash:':["1f3bd"],':tennis:':["1f3be"],':ski:':["1f3bf"],':basketball:':["1f3c0"],':checkered_flag:':["1f3c1"],':snowboarder:':["1f3c2"],':runner:':["1f3c3"],':surfer:':["1f3c4"],':trophy:':["1f3c6"],':football:':["1f3c8"],':swimmer:':["1f3ca"],':house:':["1f3e0"],':house_with_garden:':["1f3e1"],':office:':["1f3e2"],':post_office:':["1f3e3"],':hospital:':["1f3e5"],':bank:':["1f3e6"],':atm:':["1f3e7"],':hotel:':["1f3e8"],':love_hotel:':["1f3e9"],':convenience_store:':["1f3ea"],':school:':["1f3eb"],':department_store:':["1f3ec"],':factory:':["1f3ed"],':izakaya_lantern:':["1f3ee"],':japanese_castle:':["1f3ef"],':european_castle:':["1f3f0"],':snail:':["1f40c"],':snake:':["1f40d"],':racehorse:':["1f40e"],':sheep:':["1f411"],':monkey:':["1f412"],':chicken:':["1f414"],':boar:':["1f417"],':elephant:':["1f418"],':octopus:':["1f419"],':shell:':["1f41a"],':bug:':["1f41b"],':ant:':["1f41c"],':bee:':["1f41d"],':beetle:':["1f41e"],':fish:':["1f41f"],':tropical_fish:':["1f420"],':blowfish:':["1f421"],':turtle:':["1f422"],':hatching_chick:':["1f423"],':baby_chick:':["1f424"],':hatched_chick:':["1f425"],':bird:':["1f426"],':penguin:':["1f427"],':koala:':["1f428"],':poodle:':["1f429"],':camel:':["1f42b"],':dolphin:':["1f42c"],':mouse:':["1f42d"],':cow:':["1f42e"],':tiger:':["1f42f"],':rabbit:':["1f430"],':cat:':["1f431"],':dragon_face:':["1f432"],':whale:':["1f433"],':horse:':["1f434"],':monkey_face:':["1f435"],':dog:':["1f436"],':pig:':["1f437"],':frog:':["1f438"],':hamster:':["1f439"],':wolf:':["1f43a"],':bear:':["1f43b"],':panda_face:':["1f43c"],':pig_nose:':["1f43d"],':feet:':["1f43e"],':eyes:':["1f440"],':ear:':["1f442"],':nose:':["1f443"],':lips:':["1f444"],':tongue:':["1f445"],':point_up_2:':["1f446"],':point_down:':["1f447"],':point_left:':["1f448"],':point_right:':["1f449"],':punch:':["1f44a"],':wave:':["1f44b"],':ok_hand:':["1f44c"],':thumbsup:':["1f44d"],':+1:':["1f44d"],':thumbsdown:':["1f44e"],':-1:':["1f44e"],':clap:':["1f44f"],':open_hands:':["1f450"],':crown:':["1f451"],':womans_hat:':["1f452"],':eyeglasses:':["1f453"],':necktie:':["1f454"],':shirt:':["1f455"],':jeans:':["1f456"],':dress:':["1f457"],':kimono:':["1f458"],':bikini:':["1f459"],':womans_clothes:':["1f45a"],':purse:':["1f45b"],':handbag:':["1f45c"],':pouch:':["1f45d"],':mans_shoe:':["1f45e"],':athletic_shoe:':["1f45f"],':high_heel:':["1f460"],':sandal:':["1f461"],':boot:':["1f462"],':footprints:':["1f463"],':bust_in_silhouette:':["1f464"],':boy:':["1f466"],':girl:':["1f467"],':man:':["1f468"],':woman:':["1f469"],':family:':["1f46a"],':couple:':["1f46b"],':cop:':["1f46e"],':dancers:':["1f46f"],':bride_with_veil:':["1f470"],':person_with_blond_hair:':["1f471"],':man_with_gua_pi_mao:':["1f472"],':man_with_turban:':["1f473"],':older_man:':["1f474"],':older_woman:':["1f475"],':grandma:':["1f475"],':baby:':["1f476"],':construction_worker:':["1f477"],':princess:':["1f478"],':japanese_ogre:':["1f479"],':japanese_goblin:':["1f47a"],':ghost:':["1f47b"],':angel:':["1f47c"],':alien:':["1f47d"],':space_invader:':["1f47e"],':imp:':["1f47f"],':skull:':["1f480"],':skeleton:':["1f480"],':card_index:':["1f4c7"],':information_desk_person:':["1f481"],':guardsman:':["1f482"],':dancer:':["1f483"],':lipstick:':["1f484"],':nail_care:':["1f485"],':ledger:':["1f4d2"],':massage:':["1f486"],':notebook:':["1f4d3"],':haircut:':["1f487"],':notebook_with_decorative_cover:':["1f4d4"],':barber:':["1f488"],':closed_book:':["1f4d5"],':syringe:':["1f489"],':book:':["1f4d6"],':pill:':["1f48a"],':green_book:':["1f4d7"],':kiss:':["1f48b"],':blue_book:':["1f4d8"],':love_letter:':["1f48c"],':orange_book:':["1f4d9"],':ring:':["1f48d"],':books:':["1f4da"],':gem:':["1f48e"],':name_badge:':["1f4db"],':couplekiss:':["1f48f"],':scroll:':["1f4dc"],':bouquet:':["1f490"],':pencil:':["1f4dd"],':couple_with_heart:':["1f491"],':telephone_receiver:':["1f4de"],':wedding:':["1f492"],':pager:':["1f4df"],':fax:':["1f4e0"],':heartbeat:':["1f493"],':satellite:':["1f4e1"],':loudspeaker:':["1f4e2"],':broken_heart:':["1f494"],':mega:':["1f4e3"],':outbox_tray:':["1f4e4"],':two_hearts:':["1f495"],':inbox_tray:':["1f4e5"],':package:':["1f4e6"],':sparkling_heart:':["1f496"],':e-mail:':["1f4e7"],':email:':["1f4e7"],':incoming_envelope:':["1f4e8"],':heartpulse:':["1f497"],':envelope_with_arrow:':["1f4e9"],':mailbox_closed:':["1f4ea"],':cupid:':["1f498"],':mailbox:':["1f4eb"],':postbox:':["1f4ee"],':blue_heart:':["1f499"],':newspaper:':["1f4f0"],':iphone:':["1f4f1"],':green_heart:':["1f49a"],':calling:':["1f4f2"],':vibration_mode:':["1f4f3"],':yellow_heart:':["1f49b"],':mobile_phone_off:':["1f4f4"],':signal_strength:':["1f4f6"],':purple_heart:':["1f49c"],':camera:':["1f4f7"],':video_camera:':["1f4f9"],':gift_heart:':["1f49d"],':tv:':["1f4fa"],':radio:':["1f4fb"],':revolving_hearts:':["1f49e"],':vhs:':["1f4fc"],':arrows_clockwise:':["1f503"],':heart_decoration:':["1f49f"],':loud_sound:':["1f50a"],':battery:':["1f50b"],':diamond_shape_with_a_dot_inside:':["1f4a0"],':electric_plug:':["1f50c"],':mag:':["1f50d"],':bulb:':["1f4a1"],':mag_right:':["1f50e"],':lock_with_ink_pen:':["1f50f"],':anger:':["1f4a2"],':closed_lock_with_key:':["1f510"],':key:':["1f511"],':bomb:':["1f4a3"],':lock:':["1f512"],':unlock:':["1f513"],':zzz:':["1f4a4"],':bell:':["1f514"],':bookmark:':["1f516"],':boom:':["1f4a5"],':link:':["1f517"],':radio_button:':["1f518"],':sweat_drops:':["1f4a6"],':back:':["1f519"],':end:':["1f51a"],':droplet:':["1f4a7"],':on:':["1f51b"],':soon:':["1f51c"],':dash:':["1f4a8"],':top:':["1f51d"],':underage:':["1f51e"],':poop:':["1f4a9"],':shit:':["1f4a9"],':hankey:':["1f4a9"],':poo:':["1f4a9"],':keycap_ten:':["1f51f"],':muscle:':["1f4aa"],':capital_abcd:':["1f520"],':abcd:':["1f521"],':dizzy:':["1f4ab"],':1234:':["1f522"],':symbols:':["1f523"],':speech_balloon:':["1f4ac"],':abc:':["1f524"],':fire:':["1f525"],':flame:':["1f525"],':white_flower:':["1f4ae"],':flashlight:':["1f526"],':wrench:':["1f527"],':100:':["1f4af"],':hammer:':["1f528"],':nut_and_bolt:':["1f529"],':moneybag:':["1f4b0"],':knife:':["1f52a"],':gun:':["1f52b"],':currency_exchange:':["1f4b1"],':crystal_ball:':["1f52e"],':heavy_dollar_sign:':["1f4b2"],':six_pointed_star:':["1f52f"],':credit_card:':["1f4b3"],':beginner:':["1f530"],':trident:':["1f531"],':yen:':["1f4b4"],':black_square_button:':["1f532"],':white_square_button:':["1f533"],':dollar:':["1f4b5"],':red_circle:':["1f534"],':large_blue_circle:':["1f535"],':money_with_wings:':["1f4b8"],':large_orange_diamond:':["1f536"],':large_blue_diamond:':["1f537"],':chart:':["1f4b9"],':small_orange_diamond:':["1f538"],':small_blue_diamond:':["1f539"],':seat:':["1f4ba"],':small_red_triangle:':["1f53a"],':small_red_triangle_down:':["1f53b"],':computer:':["1f4bb"],':arrow_up_small:':["1f53c"],':briefcase:':["1f4bc"],':arrow_down_small:':["1f53d"],':clock1:':["1f550"],':minidisc:':["1f4bd"],':clock2:':["1f551"],':floppy_disk:':["1f4be"],':clock3:':["1f552"],':cd:':["1f4bf"],':clock4:':["1f553"],':dvd:':["1f4c0"],':clock5:':["1f554"],':clock6:':["1f555"],':file_folder:':["1f4c1"],':clock7:':["1f556"],':clock8:':["1f557"],':open_file_folder:':["1f4c2"],':clock9:':["1f558"],':clock10:':["1f559"],':page_with_curl:':["1f4c3"],':clock11:':["1f55a"],':clock12:':["1f55b"],':page_facing_up:':["1f4c4"],':mount_fuji:':["1f5fb"],':tokyo_tower:':["1f5fc"],':date:':["1f4c5"],':statue_of_liberty:':["1f5fd"],':japan:':["1f5fe"],':calendar:':["1f4c6"],':moyai:':["1f5ff"],':grin:':["1f601"],':joy:':["1f602"],':smiley:':["1f603"],':chart_with_upwards_trend:':["1f4c8"],':smile:':["1f604"],':sweat_smile:':["1f605"],':chart_with_downwards_trend:':["1f4c9"],':laughing:':["1f606"],':satisfied:':["1f606"],':wink:':["1f609"],':bar_chart:':["1f4ca"],':blush:':["1f60a"],':yum:':["1f60b"],':clipboard:':["1f4cb"],':relieved:':["1f60c"],':heart_eyes:':["1f60d"],':pushpin:':["1f4cc"],':smirk:':["1f60f"],':unamused:':["1f612"],':round_pushpin:':["1f4cd"],':sweat:':["1f613"],':pensive:':["1f614"],':paperclip:':["1f4ce"],':confounded:':["1f616"],':kissing_heart:':["1f618"],':straight_ruler:':["1f4cf"],':kissing_closed_eyes:':["1f61a"],':stuck_out_tongue_winking_eye:':["1f61c"],':triangular_ruler:':["1f4d0"],':stuck_out_tongue_closed_eyes:':["1f61d"],':disappointed:':["1f61e"],':bookmark_tabs:':["1f4d1"],':angry:':["1f620"],':rage:':["1f621"],':cry:':["1f622"],':persevere:':["1f623"],':triumph:':["1f624"],':disappointed_relieved:':["1f625"],':fearful:':["1f628"],':weary:':["1f629"],':sleepy:':["1f62a"],':tired_face:':["1f62b"],':sob:':["1f62d"],':cold_sweat:':["1f630"],':scream:':["1f631"],':astonished:':["1f632"],':flushed:':["1f633"],':dizzy_face:':["1f635"],':mask:':["1f637"],':smile_cat:':["1f638"],':joy_cat:':["1f639"],':smiley_cat:':["1f63a"],':heart_eyes_cat:':["1f63b"],':smirk_cat:':["1f63c"],':kissing_cat:':["1f63d"],':pouting_cat:':["1f63e"],':crying_cat_face:':["1f63f"],':scream_cat:':["1f640"],':no_good:':["1f645"],':ok_woman:':["1f646"],':bow:':["1f647"],':see_no_evil:':["1f648"],':hear_no_evil:':["1f649"],':speak_no_evil:':["1f64a"],':raising_hand:':["1f64b"],':raised_hands:':["1f64c"],':person_frowning:':["1f64d"],':person_with_pouting_face:':["1f64e"],':pray:':["1f64f"],':rocket:':["1f680"],':railway_car:':["1f683"],':bullettrain_side:':["1f684"],':bullettrain_front:':["1f685"],':metro:':["1f687"],':station:':["1f689"],':bus:':["1f68c"],':busstop:':["1f68f"],':ambulance:':["1f691"],':fire_engine:':["1f692"],':police_car:':["1f693"],':taxi:':["1f695"],':red_car:':["1f697"],':blue_car:':["1f699"],':truck:':["1f69a"],':ship:':["1f6a2"],':speedboat:':["1f6a4"],':traffic_light:':["1f6a5"],':construction:':["1f6a7"],':rotating_light:':["1f6a8"],':triangular_flag_on_post:':["1f6a9"],':door:':["1f6aa"],':no_entry_sign:':["1f6ab"],':smoking:':["1f6ac"],':no_smoking:':["1f6ad"],':bike:':["1f6b2"],':walking:':["1f6b6"],':mens:':["1f6b9"],':womens:':["1f6ba"],':restroom:':["1f6bb"],':baby_symbol:':["1f6bc"],':toilet:':["1f6bd"],':wc:':["1f6be"],':bath:':["1f6c0"],':grinning:':["1f600"],':innocent:':["1f607"],':smiling_imp:':["1f608"],':sunglasses:':["1f60e"],':neutral_face:':["1f610"],':expressionless:':["1f611"],':confused:':["1f615"],':kissing:':["1f617"],':kissing_smiling_eyes:':["1f619"],':stuck_out_tongue:':["1f61b"],':worried:':["1f61f"],':frowning:':["1f626"],':anguished:':["1f627"],':grimacing:':["1f62c"],':open_mouth:':["1f62e"],':hushed:':["1f62f"],':sleeping:':["1f634"],':no_mouth:':["1f636"],':helicopter:':["1f681"],':steam_locomotive:':["1f682"],':train2:':["1f686"],':light_rail:':["1f688"],':tram:':["1f68a"],':oncoming_bus:':["1f68d"],':trolleybus:':["1f68e"],':minibus:':["1f690"],':oncoming_police_car:':["1f694"],':oncoming_taxi:':["1f696"],':oncoming_automobile:':["1f698"],':articulated_lorry:':["1f69b"],':tractor:':["1f69c"],':monorail:':["1f69d"],':mountain_railway:':["1f69e"],':suspension_railway:':["1f69f"],':mountain_cableway:':["1f6a0"],':aerial_tramway:':["1f6a1"],':rowboat:':["1f6a3"],':vertical_traffic_light:':["1f6a6"],':put_litter_in_its_place:':["1f6ae"],':do_not_litter:':["1f6af"],':potable_water:':["1f6b0"],':non-potable_water:':["1f6b1"],':no_bicycles:':["1f6b3"],':bicyclist:':["1f6b4"],':mountain_bicyclist:':["1f6b5"],':no_pedestrians:':["1f6b7"],':children_crossing:':["1f6b8"],':shower:':["1f6bf"],':bathtub:':["1f6c1"],':passport_control:':["1f6c2"],':customs:':["1f6c3"],':baggage_claim:':["1f6c4"],':left_luggage:':["1f6c5"],':earth_africa:':["1f30d"],':earth_americas:':["1f30e"],':globe_with_meridians:':["1f310"],':waxing_crescent_moon:':["1f312"],':waning_gibbous_moon:':["1f316"],':last_quarter_moon:':["1f317"],':waning_crescent_moon:':["1f318"],':new_moon_with_face:':["1f31a"],':last_quarter_moon_with_face:':["1f31c"],':full_moon_with_face:':["1f31d"],':sun_with_face:':["1f31e"],':evergreen_tree:':["1f332"],':deciduous_tree:':["1f333"],':lemon:':["1f34b"],':pear:':["1f350"],':baby_bottle:':["1f37c"],':horse_racing:':["1f3c7"],':rugby_football:':["1f3c9"],':european_post_office:':["1f3e4"],':rat:':["1f400"],':mouse2:':["1f401"],':ox:':["1f402"],':water_buffalo:':["1f403"],':cow2:':["1f404"],':tiger2:':["1f405"],':leopard:':["1f406"],':rabbit2:':["1f407"],':cat2:':["1f408"],':dragon:':["1f409"],':crocodile:':["1f40a"],':whale2:':["1f40b"],':ram:':["1f40f"],':goat:':["1f410"],':rooster:':["1f413"],':dog2:':["1f415"],':pig2:':["1f416"],':dromedary_camel:':["1f42a"],':busts_in_silhouette:':["1f465"],':two_men_holding_hands:':["1f46c"],':two_women_holding_hands:':["1f46d"],':thought_balloon:':["1f4ad"],':euro:':["1f4b6"],':pound:':["1f4b7"],':mailbox_with_mail:':["1f4ec"],':mailbox_with_no_mail:':["1f4ed"],':postal_horn:':["1f4ef"],':no_mobile_phones:':["1f4f5"],':twisted_rightwards_arrows:':["1f500"],':repeat:':["1f501"],':repeat_one:':["1f502"],':arrows_counterclockwise:':["1f504"],':low_brightness:':["1f505"],':high_brightness:':["1f506"],':mute:':["1f507"],':sound:':["1f509"],':no_bell:':["1f515"],':microscope:':["1f52c"],':telescope:':["1f52d"],':clock130:':["1f55c"],':clock230:':["1f55d"],':clock330:':["1f55e"],':clock430:':["1f55f"],':clock530:':["1f560"],':clock630:':["1f561"],':clock730:':["1f562"],':clock830:':["1f563"],':clock930:':["1f564"],':clock1030:':["1f565"],':clock1130:':["1f566"],':clock1230:':["1f567"],':speaker:':["1f508"],':train:':["1f68b"],':loop:':["27bf"],':af:':["1f1e6-1f1eb"],':al:':["1f1e6-1f1f1"],':dz:':["1f1e9-1f1ff"],':ad:':["1f1e6-1f1e9"],':ao:':["1f1e6-1f1f4"],':ag:':["1f1e6-1f1ec"],':ar:':["1f1e6-1f1f7"],':am:':["1f1e6-1f1f2"],':au:':["1f1e6-1f1fa"],':at:':["1f1e6-1f1f9"],':az:':["1f1e6-1f1ff"],':bs:':["1f1e7-1f1f8"],':bh:':["1f1e7-1f1ed"],':bd:':["1f1e7-1f1e9"],':bb:':["1f1e7-1f1e7"],':by:':["1f1e7-1f1fe"],':be:':["1f1e7-1f1ea"],':bz:':["1f1e7-1f1ff"],':bj:':["1f1e7-1f1ef"],':bt:':["1f1e7-1f1f9"],':bo:':["1f1e7-1f1f4"],':ba:':["1f1e7-1f1e6"],':bw:':["1f1e7-1f1fc"],':br:':["1f1e7-1f1f7"],':bn:':["1f1e7-1f1f3"],':bg:':["1f1e7-1f1ec"],':bf:':["1f1e7-1f1eb"],':bi:':["1f1e7-1f1ee"],':kh:':["1f1f0-1f1ed"],':cm:':["1f1e8-1f1f2"],':ca:':["1f1e8-1f1e6"],':cv:':["1f1e8-1f1fb"],':cf:':["1f1e8-1f1eb"],':td:':["1f1f9-1f1e9"],':chile:':["1f1e8-1f1f1"],':co:':["1f1e8-1f1f4"],':km:':["1f1f0-1f1f2"],':cr:':["1f1e8-1f1f7"],':ci:':["1f1e8-1f1ee"],':hr:':["1f1ed-1f1f7"],':cu:':["1f1e8-1f1fa"],':cy:':["1f1e8-1f1fe"],':cz:':["1f1e8-1f1ff"],':congo:':["1f1e8-1f1e9"],':dk:':["1f1e9-1f1f0"],':dj:':["1f1e9-1f1ef"],':dm:':["1f1e9-1f1f2"],':do:':["1f1e9-1f1f4"],':tl:':["1f1f9-1f1f1"],':ec:':["1f1ea-1f1e8"],':eg:':["1f1ea-1f1ec"],':sv:':["1f1f8-1f1fb"],':gq:':["1f1ec-1f1f6"],':er:':["1f1ea-1f1f7"],':ee:':["1f1ea-1f1ea"],':et:':["1f1ea-1f1f9"],':fj:':["1f1eb-1f1ef"],':fi:':["1f1eb-1f1ee"],':ga:':["1f1ec-1f1e6"],':gm:':["1f1ec-1f1f2"],':ge:':["1f1ec-1f1ea"],':gh:':["1f1ec-1f1ed"],':gr:':["1f1ec-1f1f7"],':gd:':["1f1ec-1f1e9"],':gt:':["1f1ec-1f1f9"],':gn:':["1f1ec-1f1f3"],':gw:':["1f1ec-1f1fc"],':gy:':["1f1ec-1f1fe"],':ht:':["1f1ed-1f1f9"],':hn:':["1f1ed-1f1f3"],':hu:':["1f1ed-1f1fa"],':is:':["1f1ee-1f1f8"],':in:':["1f1ee-1f1f3"],':indonesia:':["1f1ee-1f1e9"],':ir:':["1f1ee-1f1f7"],':iq:':["1f1ee-1f1f6"],':ie:':["1f1ee-1f1ea"],':il:':["1f1ee-1f1f1"],':jm:':["1f1ef-1f1f2"],':jo:':["1f1ef-1f1f4"],':kz:':["1f1f0-1f1ff"],':ke:':["1f1f0-1f1ea"],':ki:':["1f1f0-1f1ee"],':xk:':["1f1fd-1f1f0"],':kw:':["1f1f0-1f1fc"],':kg:':["1f1f0-1f1ec"],':la:':["1f1f1-1f1e6"],':lv:':["1f1f1-1f1fb"],':lb:':["1f1f1-1f1e7"],':ls:':["1f1f1-1f1f8"],':lr:':["1f1f1-1f1f7"],':ly:':["1f1f1-1f1fe"],':li:':["1f1f1-1f1ee"],':lt:':["1f1f1-1f1f9"],':lu:':["1f1f1-1f1fa"],':mk:':["1f1f2-1f1f0"],':mg:':["1f1f2-1f1ec"],':mw:':["1f1f2-1f1fc"],':my:':["1f1f2-1f1fe"],':mv:':["1f1f2-1f1fb"],':ml:':["1f1f2-1f1f1"],':mt:':["1f1f2-1f1f9"],':mh:':["1f1f2-1f1ed"],':mr:':["1f1f2-1f1f7"],':mu:':["1f1f2-1f1fa"],':mx:':["1f1f2-1f1fd"],':fm:':["1f1eb-1f1f2"],':md:':["1f1f2-1f1e9"],':mc:':["1f1f2-1f1e8"],':mn:':["1f1f2-1f1f3"],':me:':["1f1f2-1f1ea"],':ma:':["1f1f2-1f1e6"],':mz:':["1f1f2-1f1ff"],':mm:':["1f1f2-1f1f2"],':na:':["1f1f3-1f1e6"],':nr:':["1f1f3-1f1f7"],':np:':["1f1f3-1f1f5"],':nl:':["1f1f3-1f1f1"],':nz:':["1f1f3-1f1ff"],':ni:':["1f1f3-1f1ee"],':ne:':["1f1f3-1f1ea"],':nigeria:':["1f1f3-1f1ec"],':kp:':["1f1f0-1f1f5"],':no:':["1f1f3-1f1f4"],':om:':["1f1f4-1f1f2"],':pk:':["1f1f5-1f1f0"],':pw:':["1f1f5-1f1fc"],':pa:':["1f1f5-1f1e6"],':pg:':["1f1f5-1f1ec"],':py:':["1f1f5-1f1fe"],':pe:':["1f1f5-1f1ea"],':ph:':["1f1f5-1f1ed"],':pl:':["1f1f5-1f1f1"],':pt:':["1f1f5-1f1f9"],':qa:':["1f1f6-1f1e6"],':tw:':["1f1f9-1f1fc"],':cg:':["1f1e8-1f1ec"],':ro:':["1f1f7-1f1f4"],':rw:':["1f1f7-1f1fc"],':kn:':["1f1f0-1f1f3"],':lc:':["1f1f1-1f1e8"],':vc:':["1f1fb-1f1e8"],':ws:':["1f1fc-1f1f8"],':sm:':["1f1f8-1f1f2"],':st:':["1f1f8-1f1f9"],':saudiarabia:':["1f1f8-1f1e6"],':saudi:':["1f1f8-1f1e6"],':sn:':["1f1f8-1f1f3"],':rs:':["1f1f7-1f1f8"],':sc:':["1f1f8-1f1e8"],':sl:':["1f1f8-1f1f1"],':sg:':["1f1f8-1f1ec"],':sk:':["1f1f8-1f1f0"],':si:':["1f1f8-1f1ee"],':sb:':["1f1f8-1f1e7"],':so:':["1f1f8-1f1f4"],':za:':["1f1ff-1f1e6"],':lk:':["1f1f1-1f1f0"],':sd:':["1f1f8-1f1e9"],':sr:':["1f1f8-1f1f7"],':sz:':["1f1f8-1f1ff"],':se:':["1f1f8-1f1ea"],':ch:':["1f1e8-1f1ed"],':sy:':["1f1f8-1f1fe"],':tj:':["1f1f9-1f1ef"],':tz:':["1f1f9-1f1ff"],':th:':["1f1f9-1f1ed"],':tg:':["1f1f9-1f1ec"],':to:':["1f1f9-1f1f4"],':tt:':["1f1f9-1f1f9"],':tn:':["1f1f9-1f1f3"],':tr:':["1f1f9-1f1f7"],':turkmenistan:':["1f1f9-1f1f2"],':tuvalu:':["1f1f9-1f1fb"],':ug:':["1f1fa-1f1ec"],':ua:':["1f1fa-1f1e6"],':ae:':["1f1e6-1f1ea"],':uy:':["1f1fa-1f1fe"],':uz:':["1f1fa-1f1ff"],':vu:':["1f1fb-1f1fa"],':va:':["1f1fb-1f1e6"],':ve:':["1f1fb-1f1ea"],':vn:':["1f1fb-1f1f3"],':eh:':["1f1ea-1f1ed"],':ye:':["1f1fe-1f1ea"],':zm:':["1f1ff-1f1f2"],':zw:':["1f1ff-1f1fc"],':pr:':["1f1f5-1f1f7"],':ky:':["1f1f0-1f1fe"],':bm:':["1f1e7-1f1f2"],':pf:':["1f1f5-1f1eb"],':ps:':["1f1f5-1f1f8"],':nc:':["1f1f3-1f1e8"],':sh:':["1f1f8-1f1ed"],':aw:':["1f1e6-1f1fc"],':vi:':["1f1fb-1f1ee"],':hk:':["1f1ed-1f1f0"],':ac:':["1f1e6-1f1e8"],':ms:':["1f1f2-1f1f8"],':gu:':["1f1ec-1f1fa"],':gl:':["1f1ec-1f1f1"],':nu:':["1f1f3-1f1fa"],':wf:':["1f1fc-1f1eb"],':mo:':["1f1f2-1f1f4"],':fo:':["1f1eb-1f1f4"],':fk:':["1f1eb-1f1f0"],':je:':["1f1ef-1f1ea"],':ai:':["1f1e6-1f1ee"],':gi:':["1f1ec-1f1ee"]}; - ns.asciiList = { - '<3':'2764', - ':)':'1f606', - '>;)':'1f606', - '>:-)':'1f606', - '>=)':'1f606', - ';)':'1f609', - ';-)':'1f609', - '*-)':'1f609', - '*)':'1f609', - ';-]':'1f609', - ';]':'1f609', - ';D':'1f609', - ';^)':'1f609', - '\':(':'1f613', - '\':-(':'1f613', - '\'=(':'1f613', - ':*':'1f618', - ':-*':'1f618', - '=*':'1f618', - ':^*':'1f618', - '>:P':'1f61c', - 'X-P':'1f61c', - 'x-p':'1f61c', - '>:[':'1f61e', - ':-(':'1f61e', - ':(':'1f61e', - ':-[':'1f61e', - ':[':'1f61e', - '=(':'1f61e', - '>:(':'1f620', - '>:-(':'1f620', - ':@':'1f620', - ':\'(':'1f622', - ':\'-(':'1f622', - ';(':'1f622', - ';-(':'1f622', - '>.<':'1f623', - ':$':'1f633', - '=$':'1f633', - '#-)':'1f635', - '#)':'1f635', - '%-)':'1f635', - '%)':'1f635', - 'X)':'1f635', - 'X-)':'1f635', - '*\\0/*':'1f646', - '\\0/':'1f646', - '*\\O/*':'1f646', - '\\O/':'1f646', - 'O:-)':'1f607', - '0:-3':'1f607', - '0:3':'1f607', - '0:-)':'1f607', - '0:)':'1f607', - '0;^)':'1f607', - 'O:)':'1f607', - 'O;-)':'1f607', - 'O=)':'1f607', - '0;-)':'1f607', - 'O:-3':'1f607', - 'O:3':'1f607', - 'B-)':'1f60e', - 'B)':'1f60e', - '8)':'1f60e', - '8-)':'1f60e', - 'B-D':'1f60e', - '8-D':'1f60e', - '-_-':'1f611', - '-__-':'1f611', - '-___-':'1f611', - '>:\\':'1f615', - '>:/':'1f615', - ':-/':'1f615', - ':-.':'1f615', - ':/':'1f615', - ':\\':'1f615', - '=/':'1f615', - '=\\':'1f615', - ':L':'1f615', - '=L':'1f615', - ':P':'1f61b', - ':-P':'1f61b', - '=P':'1f61b', - ':-p':'1f61b', - ':p':'1f61b', - '=p':'1f61b', - ':-Þ':'1f61b', - ':Þ':'1f61b', - ':þ':'1f61b', - ':-þ':'1f61b', - ':-b':'1f61b', - ':b':'1f61b', - 'd:':'1f61b', - ':-O':'1f62e', - ':O':'1f62e', - ':-o':'1f62e', - ':o':'1f62e', - 'O_O':'1f62e', - '>:O':'1f62e', - ':-X':'1f636', - ':X':'1f636', - ':-#':'1f636', - ':#':'1f636', - '=X':'1f636', - '=x':'1f636', - ':x':'1f636', - ':-x':'1f636', - '=#':'1f636' - }; - ns.asciiRegexp = '(\\<3|<3|\\<\\/3|<\\/3|\\:\'\\)|\\:\'\\-\\)|\\:D|\\:\\-D|\\=D|\\:\\)|\\:\\-\\)|\\=\\]|\\=\\)|\\:\\]|\'\\:\\)|\'\\:\\-\\)|\'\\=\\)|\'\\:D|\'\\:\\-D|\'\\=D|\\>\\:\\)|>\\:\\)|\\>;\\)|>;\\)|\\>\\:\\-\\)|>\\:\\-\\)|\\>\\=\\)|>\\=\\)|;\\)|;\\-\\)|\\*\\-\\)|\\*\\)|;\\-\\]|;\\]|;D|;\\^\\)|\'\\:\\(|\'\\:\\-\\(|\'\\=\\(|\\:\\*|\\:\\-\\*|\\=\\*|\\:\\^\\*|\\>\\:P|>\\:P|X\\-P|x\\-p|\\>\\:\\[|>\\:\\[|\\:\\-\\(|\\:\\(|\\:\\-\\[|\\:\\[|\\=\\(|\\>\\:\\(|>\\:\\(|\\>\\:\\-\\(|>\\:\\-\\(|\\:@|\\:\'\\(|\\:\'\\-\\(|;\\(|;\\-\\(|\\>\\.\\<|>\\.<|\\:\\$|\\=\\$|#\\-\\)|#\\)|%\\-\\)|%\\)|X\\)|X\\-\\)|\\*\\\\0\\/\\*|\\\\0\\/|\\*\\\\O\\/\\*|\\\\O\\/|O\\:\\-\\)|0\\:\\-3|0\\:3|0\\:\\-\\)|0\\:\\)|0;\\^\\)|O\\:\\-\\)|O\\:\\)|O;\\-\\)|O\\=\\)|0;\\-\\)|O\\:\\-3|O\\:3|B\\-\\)|B\\)|8\\)|8\\-\\)|B\\-D|8\\-D|\\-_\\-|\\-__\\-|\\-___\\-|\\>\\:\\\\|>\\:\\\\|\\>\\:\\/|>\\:\\/|\\:\\-\\/|\\:\\-\\.|\\:\\/|\\:\\\\|\\=\\/|\\=\\\\|\\:L|\\=L|\\:P|\\:\\-P|\\=P|\\:\\-p|\\:p|\\=p|\\:\\-Þ|\\:\\-Þ|\\:Þ|\\:Þ|\\:þ|\\:þ|\\:\\-þ|\\:\\-þ|\\:\\-b|\\:b|d\\:|\\:\\-O|\\:O|\\:\\-o|\\:o|O_O|\\>\\:O|>\\:O|\\:\\-X|\\:X|\\:\\-#|\\:#|\\=X|\\=x|\\:x|\\:\\-x|\\=#)'; - ns.unicodeRegexp = '(#\\uFE0F\\u20E3|#\\u20E3|0\\uFE0F\\u20E3|0\\u20E3|1\\uFE0F\\u20E3|1\\u20E3|2\\uFE0F\\u20E3|2\\u20E3|3\\uFE0F\\u20E3|3\\u20E3|4\\uFE0F\\u20E3|4\\u20E3|5\\uFE0F\\u20E3|5\\u20E3|6\\uFE0F\\u20E3|6\\u20E3|7\\uFE0F\\u20E3|7\\u20E3|8\\uFE0F\\u20E3|8\\u20E3|9\\uFE0F\\u20E3|9\\u20E3|\\u00A9|\\u00AE|\\u203C\\uFE0F|\\u203C|\\u2049\\uFE0F|\\u2049|\\u2122|\\u2139\\uFE0F|\\u2139|\\u2194\\uFE0F|\\u2194|\\u2195\\uFE0F|\\u2195|\\u2196\\uFE0F|\\u2196|\\u2197\\uFE0F|\\u2197|\\u2198\\uFE0F|\\u2198|\\u2199\\uFE0F|\\u2199|\\u21A9\\uFE0F|\\u21A9|\\u21AA\\uFE0F|\\u21AA|\\u231A\\uFE0F|\\u231A|\\u231B\\uFE0F|\\u231B|\\u23E9|\\u23EA|\\u23EB|\\u23EC|\\u23F0|\\u23F3|\\u24C2\\uFE0F|\\u24C2|\\u25AA\\uFE0F|\\u25AA|\\u25AB\\uFE0F|\\u25AB|\\u25B6\\uFE0F|\\u25B6|\\u25C0\\uFE0F|\\u25C0|\\u25FB\\uFE0F|\\u25FB|\\u25FC\\uFE0F|\\u25FC|\\u25FD\\uFE0F|\\u25FD|\\u25FE\\uFE0F|\\u25FE|\\u2600\\uFE0F|\\u2600|\\u2601\\uFE0F|\\u2601|\\u260E\\uFE0F|\\u260E|\\u2611\\uFE0F|\\u2611|\\u2614\\uFE0F|\\u2614|\\u2615\\uFE0F|\\u2615|\\u261D\\uFE0F|\\u261D|\\u263A\\uFE0F|\\u263A|\\u2648\\uFE0F|\\u2648|\\u2649\\uFE0F|\\u2649|\\u264A\\uFE0F|\\u264A|\\u264B\\uFE0F|\\u264B|\\u264C\\uFE0F|\\u264C|\\u264D\\uFE0F|\\u264D|\\u264E\\uFE0F|\\u264E|\\u264F\\uFE0F|\\u264F|\\u2650\\uFE0F|\\u2650|\\u2651\\uFE0F|\\u2651|\\u2652\\uFE0F|\\u2652|\\u2653\\uFE0F|\\u2653|\\u2660\\uFE0F|\\u2660|\\u2663\\uFE0F|\\u2663|\\u2665\\uFE0F|\\u2665|\\u2666\\uFE0F|\\u2666|\\u2668\\uFE0F|\\u2668|\\u267B\\uFE0F|\\u267B|\\u267F\\uFE0F|\\u267F|\\u2693\\uFE0F|\\u2693|\\u26A0\\uFE0F|\\u26A0|\\u26A1\\uFE0F|\\u26A1|\\u26AA\\uFE0F|\\u26AA|\\u26AB\\uFE0F|\\u26AB|\\u26BD\\uFE0F|\\u26BD|\\u26BE\\uFE0F|\\u26BE|\\u26C4\\uFE0F|\\u26C4|\\u26C5\\uFE0F|\\u26C5|\\u26CE|\\u26D4\\uFE0F|\\u26D4|\\u26EA\\uFE0F|\\u26EA|\\u26F2\\uFE0F|\\u26F2|\\u26F3\\uFE0F|\\u26F3|\\u26F5\\uFE0F|\\u26F5|\\u26FA\\uFE0F|\\u26FA|\\u26FD\\uFE0F|\\u26FD|\\u2702\\uFE0F|\\u2702|\\u2705|\\u2708\\uFE0F|\\u2708|\\u2709\\uFE0F|\\u2709|\\u270A|\\u270B|\\u270C\\uFE0F|\\u270C|\\u270F\\uFE0F|\\u270F|\\u2712\\uFE0F|\\u2712|\\u2714\\uFE0F|\\u2714|\\u2716\\uFE0F|\\u2716|\\u2728|\\u2733\\uFE0F|\\u2733|\\u2734\\uFE0F|\\u2734|\\u2744\\uFE0F|\\u2744|\\u2747\\uFE0F|\\u2747|\\u274C|\\u274E|\\u2753|\\u2754|\\u2755|\\u2757\\uFE0F|\\u2757|\\u2764\\uFE0F|\\u2764|\\u2795|\\u2796|\\u2797|\\u27A1\\uFE0F|\\u27A1|\\u27B0|\\u2934\\uFE0F|\\u2934|\\u2935\\uFE0F|\\u2935|\\u2B05\\uFE0F|\\u2B05|\\u2B06\\uFE0F|\\u2B06|\\u2B07\\uFE0F|\\u2B07|\\u2B1B\\uFE0F|\\u2B1B|\\u2B1C\\uFE0F|\\u2B1C|\\u2B50\\uFE0F|\\u2B50|\\u2B55\\uFE0F|\\u2B55|\\u3030|\\u303D\\uFE0F|\\u303D|\\u3297\\uFE0F|\\u3297|\\u3299\\uFE0F|\\u3299|\\uD83C\\uDC04\\uFE0F|\\uD83C\\uDC04|\\uD83C\\uDCCF|\\uD83C\\uDD70|\\uD83C\\uDD71|\\uD83C\\uDD7E|\\uD83C\\uDD7F\\uFE0F|\\uD83C\\uDD7F|\\uD83C\\uDD8E|\\uD83C\\uDD91|\\uD83C\\uDD92|\\uD83C\\uDD93|\\uD83C\\uDD94|\\uD83C\\uDD95|\\uD83C\\uDD96|\\uD83C\\uDD97|\\uD83C\\uDD98|\\uD83C\\uDD99|\\uD83C\\uDD9A|\\uD83C\\uDDE8\\uD83C\\uDDF3|\\uD83C\\uDDE9\\uD83C\\uDDEA|\\uD83C\\uDDEA\\uD83C\\uDDF8|\\uD83C\\uDDEB\\uD83C\\uDDF7|\\uD83C\\uDDEC\\uD83C\\uDDE7|\\uD83C\\uDDEE\\uD83C\\uDDF9|\\uD83C\\uDDEF\\uD83C\\uDDF5|\\uD83C\\uDDF0\\uD83C\\uDDF7|\\uD83C\\uDDFA\\uD83C\\uDDF8|\\uD83C\\uDDF7\\uD83C\\uDDFA|\\uD83C\\uDE01|\\uD83C\\uDE02|\\uD83C\\uDE1A\\uFE0F|\\uD83C\\uDE1A|\\uD83C\\uDE2F\\uFE0F|\\uD83C\\uDE2F|\\uD83C\\uDE32|\\uD83C\\uDE33|\\uD83C\\uDE34|\\uD83C\\uDE35|\\uD83C\\uDE36|\\uD83C\\uDE37|\\uD83C\\uDE38|\\uD83C\\uDE39|\\uD83C\\uDE3A|\\uD83C\\uDE50|\\uD83C\\uDE51|\\uD83C\\uDF00|\\uD83C\\uDF01|\\uD83C\\uDF02|\\uD83C\\uDF03|\\uD83C\\uDF04|\\uD83C\\uDF05|\\uD83C\\uDF06|\\uD83C\\uDF07|\\uD83C\\uDF08|\\uD83C\\uDF09|\\uD83C\\uDF0A|\\uD83C\\uDF0B|\\uD83C\\uDF0C|\\uD83C\\uDF0F|\\uD83C\\uDF11|\\uD83C\\uDF13|\\uD83C\\uDF14|\\uD83C\\uDF15|\\uD83C\\uDF19|\\uD83C\\uDF1B|\\uD83C\\uDF1F|\\uD83C\\uDF20|\\uD83C\\uDF30|\\uD83C\\uDF31|\\uD83C\\uDF34|\\uD83C\\uDF35|\\uD83C\\uDF37|\\uD83C\\uDF38|\\uD83C\\uDF39|\\uD83C\\uDF3A|\\uD83C\\uDF3B|\\uD83C\\uDF3C|\\uD83C\\uDF3D|\\uD83C\\uDF3E|\\uD83C\\uDF3F|\\uD83C\\uDF40|\\uD83C\\uDF41|\\uD83C\\uDF42|\\uD83C\\uDF43|\\uD83C\\uDF44|\\uD83C\\uDF45|\\uD83C\\uDF46|\\uD83C\\uDF47|\\uD83C\\uDF48|\\uD83C\\uDF49|\\uD83C\\uDF4A|\\uD83C\\uDF4C|\\uD83C\\uDF4D|\\uD83C\\uDF4E|\\uD83C\\uDF4F|\\uD83C\\uDF51|\\uD83C\\uDF52|\\uD83C\\uDF53|\\uD83C\\uDF54|\\uD83C\\uDF55|\\uD83C\\uDF56|\\uD83C\\uDF57|\\uD83C\\uDF58|\\uD83C\\uDF59|\\uD83C\\uDF5A|\\uD83C\\uDF5B|\\uD83C\\uDF5C|\\uD83C\\uDF5D|\\uD83C\\uDF5E|\\uD83C\\uDF5F|\\uD83C\\uDF60|\\uD83C\\uDF61|\\uD83C\\uDF62|\\uD83C\\uDF63|\\uD83C\\uDF64|\\uD83C\\uDF65|\\uD83C\\uDF66|\\uD83C\\uDF67|\\uD83C\\uDF68|\\uD83C\\uDF69|\\uD83C\\uDF6A|\\uD83C\\uDF6B|\\uD83C\\uDF6C|\\uD83C\\uDF6D|\\uD83C\\uDF6E|\\uD83C\\uDF6F|\\uD83C\\uDF70|\\uD83C\\uDF71|\\uD83C\\uDF72|\\uD83C\\uDF73|\\uD83C\\uDF74|\\uD83C\\uDF75|\\uD83C\\uDF76|\\uD83C\\uDF77|\\uD83C\\uDF78|\\uD83C\\uDF79|\\uD83C\\uDF7A|\\uD83C\\uDF7B|\\uD83C\\uDF80|\\uD83C\\uDF81|\\uD83C\\uDF82|\\uD83C\\uDF83|\\uD83C\\uDF84|\\uD83C\\uDF85|\\uD83C\\uDF86|\\uD83C\\uDF87|\\uD83C\\uDF88|\\uD83C\\uDF89|\\uD83C\\uDF8A|\\uD83C\\uDF8B|\\uD83C\\uDF8C|\\uD83C\\uDF8D|\\uD83C\\uDF8E|\\uD83C\\uDF8F|\\uD83C\\uDF90|\\uD83C\\uDF91|\\uD83C\\uDF92|\\uD83C\\uDF93|\\uD83C\\uDFA0|\\uD83C\\uDFA1|\\uD83C\\uDFA2|\\uD83C\\uDFA3|\\uD83C\\uDFA4|\\uD83C\\uDFA5|\\uD83C\\uDFA6|\\uD83C\\uDFA7|\\uD83C\\uDFA8|\\uD83C\\uDFA9|\\uD83C\\uDFAA|\\uD83C\\uDFAB|\\uD83C\\uDFAC|\\uD83C\\uDFAD|\\uD83C\\uDFAE|\\uD83C\\uDFAF|\\uD83C\\uDFB0|\\uD83C\\uDFB1|\\uD83C\\uDFB2|\\uD83C\\uDFB3|\\uD83C\\uDFB4|\\uD83C\\uDFB5|\\uD83C\\uDFB6|\\uD83C\\uDFB7|\\uD83C\\uDFB8|\\uD83C\\uDFB9|\\uD83C\\uDFBA|\\uD83C\\uDFBB|\\uD83C\\uDFBC|\\uD83C\\uDFBD|\\uD83C\\uDFBE|\\uD83C\\uDFBF|\\uD83C\\uDFC0|\\uD83C\\uDFC1|\\uD83C\\uDFC2|\\uD83C\\uDFC3|\\uD83C\\uDFC4|\\uD83C\\uDFC6|\\uD83C\\uDFC8|\\uD83C\\uDFCA|\\uD83C\\uDFE0|\\uD83C\\uDFE1|\\uD83C\\uDFE2|\\uD83C\\uDFE3|\\uD83C\\uDFE5|\\uD83C\\uDFE6|\\uD83C\\uDFE7|\\uD83C\\uDFE8|\\uD83C\\uDFE9|\\uD83C\\uDFEA|\\uD83C\\uDFEB|\\uD83C\\uDFEC|\\uD83C\\uDFED|\\uD83C\\uDFEE|\\uD83C\\uDFEF|\\uD83C\\uDFF0|\\uD83D\\uDC0C|\\uD83D\\uDC0D|\\uD83D\\uDC0E|\\uD83D\\uDC11|\\uD83D\\uDC12|\\uD83D\\uDC14|\\uD83D\\uDC17|\\uD83D\\uDC18|\\uD83D\\uDC19|\\uD83D\\uDC1A|\\uD83D\\uDC1B|\\uD83D\\uDC1C|\\uD83D\\uDC1D|\\uD83D\\uDC1E|\\uD83D\\uDC1F|\\uD83D\\uDC20|\\uD83D\\uDC21|\\uD83D\\uDC22|\\uD83D\\uDC23|\\uD83D\\uDC24|\\uD83D\\uDC25|\\uD83D\\uDC26|\\uD83D\\uDC27|\\uD83D\\uDC28|\\uD83D\\uDC29|\\uD83D\\uDC2B|\\uD83D\\uDC2C|\\uD83D\\uDC2D|\\uD83D\\uDC2E|\\uD83D\\uDC2F|\\uD83D\\uDC30|\\uD83D\\uDC31|\\uD83D\\uDC32|\\uD83D\\uDC33|\\uD83D\\uDC34|\\uD83D\\uDC35|\\uD83D\\uDC36|\\uD83D\\uDC37|\\uD83D\\uDC38|\\uD83D\\uDC39|\\uD83D\\uDC3A|\\uD83D\\uDC3B|\\uD83D\\uDC3C|\\uD83D\\uDC3D|\\uD83D\\uDC3E|\\uD83D\\uDC40|\\uD83D\\uDC42|\\uD83D\\uDC43|\\uD83D\\uDC44|\\uD83D\\uDC45|\\uD83D\\uDC46|\\uD83D\\uDC47|\\uD83D\\uDC48|\\uD83D\\uDC49|\\uD83D\\uDC4A|\\uD83D\\uDC4B|\\uD83D\\uDC4C|\\uD83D\\uDC4D|\\uD83D\\uDC4E|\\uD83D\\uDC4F|\\uD83D\\uDC50|\\uD83D\\uDC51|\\uD83D\\uDC52|\\uD83D\\uDC53|\\uD83D\\uDC54|\\uD83D\\uDC55|\\uD83D\\uDC56|\\uD83D\\uDC57|\\uD83D\\uDC58|\\uD83D\\uDC59|\\uD83D\\uDC5A|\\uD83D\\uDC5B|\\uD83D\\uDC5C|\\uD83D\\uDC5D|\\uD83D\\uDC5E|\\uD83D\\uDC5F|\\uD83D\\uDC60|\\uD83D\\uDC61|\\uD83D\\uDC62|\\uD83D\\uDC63|\\uD83D\\uDC64|\\uD83D\\uDC66|\\uD83D\\uDC67|\\uD83D\\uDC68|\\uD83D\\uDC69|\\uD83D\\uDC6A|\\uD83D\\uDC6B|\\uD83D\\uDC6E|\\uD83D\\uDC6F|\\uD83D\\uDC70|\\uD83D\\uDC71|\\uD83D\\uDC72|\\uD83D\\uDC73|\\uD83D\\uDC74|\\uD83D\\uDC75|\\uD83D\\uDC76|\\uD83D\\uDC77|\\uD83D\\uDC78|\\uD83D\\uDC79|\\uD83D\\uDC7A|\\uD83D\\uDC7B|\\uD83D\\uDC7C|\\uD83D\\uDC7D|\\uD83D\\uDC7E|\\uD83D\\uDC7F|\\uD83D\\uDC80|\\uD83D\\uDCC7|\\uD83D\\uDC81|\\uD83D\\uDC82|\\uD83D\\uDC83|\\uD83D\\uDC84|\\uD83D\\uDC85|\\uD83D\\uDCD2|\\uD83D\\uDC86|\\uD83D\\uDCD3|\\uD83D\\uDC87|\\uD83D\\uDCD4|\\uD83D\\uDC88|\\uD83D\\uDCD5|\\uD83D\\uDC89|\\uD83D\\uDCD6|\\uD83D\\uDC8A|\\uD83D\\uDCD7|\\uD83D\\uDC8B|\\uD83D\\uDCD8|\\uD83D\\uDC8C|\\uD83D\\uDCD9|\\uD83D\\uDC8D|\\uD83D\\uDCDA|\\uD83D\\uDC8E|\\uD83D\\uDCDB|\\uD83D\\uDC8F|\\uD83D\\uDCDC|\\uD83D\\uDC90|\\uD83D\\uDCDD|\\uD83D\\uDC91|\\uD83D\\uDCDE|\\uD83D\\uDC92|\\uD83D\\uDCDF|\\uD83D\\uDCE0|\\uD83D\\uDC93|\\uD83D\\uDCE1|\\uD83D\\uDCE2|\\uD83D\\uDC94|\\uD83D\\uDCE3|\\uD83D\\uDCE4|\\uD83D\\uDC95|\\uD83D\\uDCE5|\\uD83D\\uDCE6|\\uD83D\\uDC96|\\uD83D\\uDCE7|\\uD83D\\uDCE8|\\uD83D\\uDC97|\\uD83D\\uDCE9|\\uD83D\\uDCEA|\\uD83D\\uDC98|\\uD83D\\uDCEB|\\uD83D\\uDCEE|\\uD83D\\uDC99|\\uD83D\\uDCF0|\\uD83D\\uDCF1|\\uD83D\\uDC9A|\\uD83D\\uDCF2|\\uD83D\\uDCF3|\\uD83D\\uDC9B|\\uD83D\\uDCF4|\\uD83D\\uDCF6|\\uD83D\\uDC9C|\\uD83D\\uDCF7|\\uD83D\\uDCF9|\\uD83D\\uDC9D|\\uD83D\\uDCFA|\\uD83D\\uDCFB|\\uD83D\\uDC9E|\\uD83D\\uDCFC|\\uD83D\\uDD03|\\uD83D\\uDC9F|\\uD83D\\uDD0A|\\uD83D\\uDD0B|\\uD83D\\uDCA0|\\uD83D\\uDD0C|\\uD83D\\uDD0D|\\uD83D\\uDCA1|\\uD83D\\uDD0E|\\uD83D\\uDD0F|\\uD83D\\uDCA2|\\uD83D\\uDD10|\\uD83D\\uDD11|\\uD83D\\uDCA3|\\uD83D\\uDD12|\\uD83D\\uDD13|\\uD83D\\uDCA4|\\uD83D\\uDD14|\\uD83D\\uDD16|\\uD83D\\uDCA5|\\uD83D\\uDD17|\\uD83D\\uDD18|\\uD83D\\uDCA6|\\uD83D\\uDD19|\\uD83D\\uDD1A|\\uD83D\\uDCA7|\\uD83D\\uDD1B|\\uD83D\\uDD1C|\\uD83D\\uDCA8|\\uD83D\\uDD1D|\\uD83D\\uDD1E|\\uD83D\\uDCA9|\\uD83D\\uDD1F|\\uD83D\\uDCAA|\\uD83D\\uDD20|\\uD83D\\uDD21|\\uD83D\\uDCAB|\\uD83D\\uDD22|\\uD83D\\uDD23|\\uD83D\\uDCAC|\\uD83D\\uDD24|\\uD83D\\uDD25|\\uD83D\\uDCAE|\\uD83D\\uDD26|\\uD83D\\uDD27|\\uD83D\\uDCAF|\\uD83D\\uDD28|\\uD83D\\uDD29|\\uD83D\\uDCB0|\\uD83D\\uDD2A|\\uD83D\\uDD2B|\\uD83D\\uDCB1|\\uD83D\\uDD2E|\\uD83D\\uDCB2|\\uD83D\\uDD2F|\\uD83D\\uDCB3|\\uD83D\\uDD30|\\uD83D\\uDD31|\\uD83D\\uDCB4|\\uD83D\\uDD32|\\uD83D\\uDD33|\\uD83D\\uDCB5|\\uD83D\\uDD34|\\uD83D\\uDD35|\\uD83D\\uDCB8|\\uD83D\\uDD36|\\uD83D\\uDD37|\\uD83D\\uDCB9|\\uD83D\\uDD38|\\uD83D\\uDD39|\\uD83D\\uDCBA|\\uD83D\\uDD3A|\\uD83D\\uDD3B|\\uD83D\\uDCBB|\\uD83D\\uDD3C|\\uD83D\\uDCBC|\\uD83D\\uDD3D|\\uD83D\\uDD50|\\uD83D\\uDCBD|\\uD83D\\uDD51|\\uD83D\\uDCBE|\\uD83D\\uDD52|\\uD83D\\uDCBF|\\uD83D\\uDD53|\\uD83D\\uDCC0|\\uD83D\\uDD54|\\uD83D\\uDD55|\\uD83D\\uDCC1|\\uD83D\\uDD56|\\uD83D\\uDD57|\\uD83D\\uDCC2|\\uD83D\\uDD58|\\uD83D\\uDD59|\\uD83D\\uDCC3|\\uD83D\\uDD5A|\\uD83D\\uDD5B|\\uD83D\\uDCC4|\\uD83D\\uDDFB|\\uD83D\\uDDFC|\\uD83D\\uDCC5|\\uD83D\\uDDFD|\\uD83D\\uDDFE|\\uD83D\\uDCC6|\\uD83D\\uDDFF|\\uD83D\\uDE01|\\uD83D\\uDE02|\\uD83D\\uDE03|\\uD83D\\uDCC8|\\uD83D\\uDE04|\\uD83D\\uDE05|\\uD83D\\uDCC9|\\uD83D\\uDE06|\\uD83D\\uDE09|\\uD83D\\uDCCA|\\uD83D\\uDE0A|\\uD83D\\uDE0B|\\uD83D\\uDCCB|\\uD83D\\uDE0C|\\uD83D\\uDE0D|\\uD83D\\uDCCC|\\uD83D\\uDE0F|\\uD83D\\uDE12|\\uD83D\\uDCCD|\\uD83D\\uDE13|\\uD83D\\uDE14|\\uD83D\\uDCCE|\\uD83D\\uDE16|\\uD83D\\uDE18|\\uD83D\\uDCCF|\\uD83D\\uDE1A|\\uD83D\\uDE1C|\\uD83D\\uDCD0|\\uD83D\\uDE1D|\\uD83D\\uDE1E|\\uD83D\\uDCD1|\\uD83D\\uDE20|\\uD83D\\uDE21|\\uD83D\\uDE22|\\uD83D\\uDE23|\\uD83D\\uDE24|\\uD83D\\uDE25|\\uD83D\\uDE28|\\uD83D\\uDE29|\\uD83D\\uDE2A|\\uD83D\\uDE2B|\\uD83D\\uDE2D|\\uD83D\\uDE30|\\uD83D\\uDE31|\\uD83D\\uDE32|\\uD83D\\uDE33|\\uD83D\\uDE35|\\uD83D\\uDE37|\\uD83D\\uDE38|\\uD83D\\uDE39|\\uD83D\\uDE3A|\\uD83D\\uDE3B|\\uD83D\\uDE3C|\\uD83D\\uDE3D|\\uD83D\\uDE3E|\\uD83D\\uDE3F|\\uD83D\\uDE40|\\uD83D\\uDE45|\\uD83D\\uDE46|\\uD83D\\uDE47|\\uD83D\\uDE48|\\uD83D\\uDE49|\\uD83D\\uDE4A|\\uD83D\\uDE4B|\\uD83D\\uDE4C|\\uD83D\\uDE4D|\\uD83D\\uDE4E|\\uD83D\\uDE4F|\\uD83D\\uDE80|\\uD83D\\uDE83|\\uD83D\\uDE84|\\uD83D\\uDE85|\\uD83D\\uDE87|\\uD83D\\uDE89|\\uD83D\\uDE8C|\\uD83D\\uDE8F|\\uD83D\\uDE91|\\uD83D\\uDE92|\\uD83D\\uDE93|\\uD83D\\uDE95|\\uD83D\\uDE97|\\uD83D\\uDE99|\\uD83D\\uDE9A|\\uD83D\\uDEA2|\\uD83D\\uDEA4|\\uD83D\\uDEA5|\\uD83D\\uDEA7|\\uD83D\\uDEA8|\\uD83D\\uDEA9|\\uD83D\\uDEAA|\\uD83D\\uDEAB|\\uD83D\\uDEAC|\\uD83D\\uDEAD|\\uD83D\\uDEB2|\\uD83D\\uDEB6|\\uD83D\\uDEB9|\\uD83D\\uDEBA|\\uD83D\\uDEBB|\\uD83D\\uDEBC|\\uD83D\\uDEBD|\\uD83D\\uDEBE|\\uD83D\\uDEC0|\\uD83D\\uDE00|\\uD83D\\uDE07|\\uD83D\\uDE08|\\uD83D\\uDE0E|\\uD83D\\uDE10|\\uD83D\\uDE11|\\uD83D\\uDE15|\\uD83D\\uDE17|\\uD83D\\uDE19|\\uD83D\\uDE1B|\\uD83D\\uDE1F|\\uD83D\\uDE26|\\uD83D\\uDE27|\\uD83D\\uDE2C|\\uD83D\\uDE2E|\\uD83D\\uDE2F|\\uD83D\\uDE34|\\uD83D\\uDE36|\\uD83D\\uDE81|\\uD83D\\uDE82|\\uD83D\\uDE86|\\uD83D\\uDE88|\\uD83D\\uDE8A|\\uD83D\\uDE8D|\\uD83D\\uDE8E|\\uD83D\\uDE90|\\uD83D\\uDE94|\\uD83D\\uDE96|\\uD83D\\uDE98|\\uD83D\\uDE9B|\\uD83D\\uDE9C|\\uD83D\\uDE9D|\\uD83D\\uDE9E|\\uD83D\\uDE9F|\\uD83D\\uDEA0|\\uD83D\\uDEA1|\\uD83D\\uDEA3|\\uD83D\\uDEA6|\\uD83D\\uDEAE|\\uD83D\\uDEAF|\\uD83D\\uDEB0|\\uD83D\\uDEB1|\\uD83D\\uDEB3|\\uD83D\\uDEB4|\\uD83D\\uDEB5|\\uD83D\\uDEB7|\\uD83D\\uDEB8|\\uD83D\\uDEBF|\\uD83D\\uDEC1|\\uD83D\\uDEC2|\\uD83D\\uDEC3|\\uD83D\\uDEC4|\\uD83D\\uDEC5|\\uD83C\\uDF0D|\\uD83C\\uDF0E|\\uD83C\\uDF10|\\uD83C\\uDF12|\\uD83C\\uDF16|\\uD83C\\uDF17|\\uD83C\\uDF18|\\uD83C\\uDF1A|\\uD83C\\uDF1C|\\uD83C\\uDF1D|\\uD83C\\uDF1E|\\uD83C\\uDF32|\\uD83C\\uDF33|\\uD83C\\uDF4B|\\uD83C\\uDF50|\\uD83C\\uDF7C|\\uD83C\\uDFC7|\\uD83C\\uDFC9|\\uD83C\\uDFE4|\\uD83D\\uDC00|\\uD83D\\uDC01|\\uD83D\\uDC02|\\uD83D\\uDC03|\\uD83D\\uDC04|\\uD83D\\uDC05|\\uD83D\\uDC06|\\uD83D\\uDC07|\\uD83D\\uDC08|\\uD83D\\uDC09|\\uD83D\\uDC0A|\\uD83D\\uDC0B|\\uD83D\\uDC0F|\\uD83D\\uDC10|\\uD83D\\uDC13|\\uD83D\\uDC15|\\uD83D\\uDC16|\\uD83D\\uDC2A|\\uD83D\\uDC65|\\uD83D\\uDC6C|\\uD83D\\uDC6D|\\uD83D\\uDCAD|\\uD83D\\uDCB6|\\uD83D\\uDCB7|\\uD83D\\uDCEC|\\uD83D\\uDCED|\\uD83D\\uDCEF|\\uD83D\\uDCF5|\\uD83D\\uDD00|\\uD83D\\uDD01|\\uD83D\\uDD02|\\uD83D\\uDD04|\\uD83D\\uDD05|\\uD83D\\uDD06|\\uD83D\\uDD07|\\uD83D\\uDD09|\\uD83D\\uDD15|\\uD83D\\uDD2C|\\uD83D\\uDD2D|\\uD83D\\uDD5C|\\uD83D\\uDD5D|\\uD83D\\uDD5E|\\uD83D\\uDD5F|\\uD83D\\uDD60|\\uD83D\\uDD61|\\uD83D\\uDD62|\\uD83D\\uDD63|\\uD83D\\uDD64|\\uD83D\\uDD65|\\uD83D\\uDD66|\\uD83D\\uDD67|\\uD83D\\uDD08|\\uD83D\\uDE8B|\\u27BF|\\uD83C\\uDDE6\\uD83C\\uDDEB|\\uD83C\\uDDE6\\uD83C\\uDDF1|\\uD83C\\uDDE9\\uD83C\\uDDFF|\\uD83C\\uDDE6\\uD83C\\uDDE9|\\uD83C\\uDDE6\\uD83C\\uDDF4|\\uD83C\\uDDE6\\uD83C\\uDDEC|\\uD83C\\uDDE6\\uD83C\\uDDF7|\\uD83C\\uDDE6\\uD83C\\uDDF2|\\uD83C\\uDDE6\\uD83C\\uDDFA|\\uD83C\\uDDE6\\uD83C\\uDDF9|\\uD83C\\uDDE6\\uD83C\\uDDFF|\\uD83C\\uDDE7\\uD83C\\uDDF8|\\uD83C\\uDDE7\\uD83C\\uDDED|\\uD83C\\uDDE7\\uD83C\\uDDE9|\\uD83C\\uDDE7\\uD83C\\uDDE7|\\uD83C\\uDDE7\\uD83C\\uDDFE|\\uD83C\\uDDE7\\uD83C\\uDDEA|\\uD83C\\uDDE7\\uD83C\\uDDFF|\\uD83C\\uDDE7\\uD83C\\uDDEF|\\uD83C\\uDDE7\\uD83C\\uDDF9|\\uD83C\\uDDE7\\uD83C\\uDDF4|\\uD83C\\uDDE7\\uD83C\\uDDE6|\\uD83C\\uDDE7\\uD83C\\uDDFC|\\uD83C\\uDDE7\\uD83C\\uDDF7|\\uD83C\\uDDE7\\uD83C\\uDDF3|\\uD83C\\uDDE7\\uD83C\\uDDEC|\\uD83C\\uDDE7\\uD83C\\uDDEB|\\uD83C\\uDDE7\\uD83C\\uDDEE|\\uD83C\\uDDF0\\uD83C\\uDDED|\\uD83C\\uDDE8\\uD83C\\uDDF2|\\uD83C\\uDDE8\\uD83C\\uDDE6|\\uD83C\\uDDE8\\uD83C\\uDDFB|\\uD83C\\uDDE8\\uD83C\\uDDEB|\\uD83C\\uDDF9\\uD83C\\uDDE9|\\uD83C\\uDDE8\\uD83C\\uDDF1|\\uD83C\\uDDE8\\uD83C\\uDDF4|\\uD83C\\uDDF0\\uD83C\\uDDF2|\\uD83C\\uDDE8\\uD83C\\uDDF7|\\uD83C\\uDDE8\\uD83C\\uDDEE|\\uD83C\\uDDED\\uD83C\\uDDF7|\\uD83C\\uDDE8\\uD83C\\uDDFA|\\uD83C\\uDDE8\\uD83C\\uDDFE|\\uD83C\\uDDE8\\uD83C\\uDDFF|\\uD83C\\uDDE8\\uD83C\\uDDE9|\\uD83C\\uDDE9\\uD83C\\uDDF0|\\uD83C\\uDDE9\\uD83C\\uDDEF|\\uD83C\\uDDE9\\uD83C\\uDDF2|\\uD83C\\uDDE9\\uD83C\\uDDF4|\\uD83C\\uDDF9\\uD83C\\uDDF1|\\uD83C\\uDDEA\\uD83C\\uDDE8|\\uD83C\\uDDEA\\uD83C\\uDDEC|\\uD83C\\uDDF8\\uD83C\\uDDFB|\\uD83C\\uDDEC\\uD83C\\uDDF6|\\uD83C\\uDDEA\\uD83C\\uDDF7|\\uD83C\\uDDEA\\uD83C\\uDDEA|\\uD83C\\uDDEA\\uD83C\\uDDF9|\\uD83C\\uDDEB\\uD83C\\uDDEF|\\uD83C\\uDDEB\\uD83C\\uDDEE|\\uD83C\\uDDEC\\uD83C\\uDDE6|\\uD83C\\uDDEC\\uD83C\\uDDF2|\\uD83C\\uDDEC\\uD83C\\uDDEA|\\uD83C\\uDDEC\\uD83C\\uDDED|\\uD83C\\uDDEC\\uD83C\\uDDF7|\\uD83C\\uDDEC\\uD83C\\uDDE9|\\uD83C\\uDDEC\\uD83C\\uDDF9|\\uD83C\\uDDEC\\uD83C\\uDDF3|\\uD83C\\uDDEC\\uD83C\\uDDFC|\\uD83C\\uDDEC\\uD83C\\uDDFE|\\uD83C\\uDDED\\uD83C\\uDDF9|\\uD83C\\uDDED\\uD83C\\uDDF3|\\uD83C\\uDDED\\uD83C\\uDDFA|\\uD83C\\uDDEE\\uD83C\\uDDF8|\\uD83C\\uDDEE\\uD83C\\uDDF3|\\uD83C\\uDDEE\\uD83C\\uDDE9|\\uD83C\\uDDEE\\uD83C\\uDDF7|\\uD83C\\uDDEE\\uD83C\\uDDF6|\\uD83C\\uDDEE\\uD83C\\uDDEA|\\uD83C\\uDDEE\\uD83C\\uDDF1|\\uD83C\\uDDEF\\uD83C\\uDDF2|\\uD83C\\uDDEF\\uD83C\\uDDF4|\\uD83C\\uDDF0\\uD83C\\uDDFF|\\uD83C\\uDDF0\\uD83C\\uDDEA|\\uD83C\\uDDF0\\uD83C\\uDDEE|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDF0\\uD83C\\uDDFC|\\uD83C\\uDDF0\\uD83C\\uDDEC|\\uD83C\\uDDF1\\uD83C\\uDDE6|\\uD83C\\uDDF1\\uD83C\\uDDFB|\\uD83C\\uDDF1\\uD83C\\uDDE7|\\uD83C\\uDDF1\\uD83C\\uDDF8|\\uD83C\\uDDF1\\uD83C\\uDDF7|\\uD83C\\uDDF1\\uD83C\\uDDFE|\\uD83C\\uDDF1\\uD83C\\uDDEE|\\uD83C\\uDDF1\\uD83C\\uDDF9|\\uD83C\\uDDF1\\uD83C\\uDDFA|\\uD83C\\uDDF2\\uD83C\\uDDF0|\\uD83C\\uDDF2\\uD83C\\uDDEC|\\uD83C\\uDDF2\\uD83C\\uDDFC|\\uD83C\\uDDF2\\uD83C\\uDDFE|\\uD83C\\uDDF2\\uD83C\\uDDFB|\\uD83C\\uDDF2\\uD83C\\uDDF1|\\uD83C\\uDDF2\\uD83C\\uDDF9|\\uD83C\\uDDF2\\uD83C\\uDDED|\\uD83C\\uDDF2\\uD83C\\uDDF7|\\uD83C\\uDDF2\\uD83C\\uDDFA|\\uD83C\\uDDF2\\uD83C\\uDDFD|\\uD83C\\uDDEB\\uD83C\\uDDF2|\\uD83C\\uDDF2\\uD83C\\uDDE9|\\uD83C\\uDDF2\\uD83C\\uDDE8|\\uD83C\\uDDF2\\uD83C\\uDDF3|\\uD83C\\uDDF2\\uD83C\\uDDEA|\\uD83C\\uDDF2\\uD83C\\uDDE6|\\uD83C\\uDDF2\\uD83C\\uDDFF|\\uD83C\\uDDF2\\uD83C\\uDDF2|\\uD83C\\uDDF3\\uD83C\\uDDE6|\\uD83C\\uDDF3\\uD83C\\uDDF7|\\uD83C\\uDDF3\\uD83C\\uDDF5|\\uD83C\\uDDF3\\uD83C\\uDDF1|\\uD83C\\uDDF3\\uD83C\\uDDFF|\\uD83C\\uDDF3\\uD83C\\uDDEE|\\uD83C\\uDDF3\\uD83C\\uDDEA|\\uD83C\\uDDF3\\uD83C\\uDDEC|\\uD83C\\uDDF0\\uD83C\\uDDF5|\\uD83C\\uDDF3\\uD83C\\uDDF4|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83C\\uDDF5\\uD83C\\uDDF0|\\uD83C\\uDDF5\\uD83C\\uDDFC|\\uD83C\\uDDF5\\uD83C\\uDDE6|\\uD83C\\uDDF5\\uD83C\\uDDEC|\\uD83C\\uDDF5\\uD83C\\uDDFE|\\uD83C\\uDDF5\\uD83C\\uDDEA|\\uD83C\\uDDF5\\uD83C\\uDDED|\\uD83C\\uDDF5\\uD83C\\uDDF1|\\uD83C\\uDDF5\\uD83C\\uDDF9|\\uD83C\\uDDF6\\uD83C\\uDDE6|\\uD83C\\uDDF9\\uD83C\\uDDFC|\\uD83C\\uDDE8\\uD83C\\uDDEC|\\uD83C\\uDDF7\\uD83C\\uDDF4|\\uD83C\\uDDF7\\uD83C\\uDDFC|\\uD83C\\uDDF0\\uD83C\\uDDF3|\\uD83C\\uDDF1\\uD83C\\uDDE8|\\uD83C\\uDDFB\\uD83C\\uDDE8|\\uD83C\\uDDFC\\uD83C\\uDDF8|\\uD83C\\uDDF8\\uD83C\\uDDF2|\\uD83C\\uDDF8\\uD83C\\uDDF9|\\uD83C\\uDDF8\\uD83C\\uDDE6|\\uD83C\\uDDF8\\uD83C\\uDDF3|\\uD83C\\uDDF7\\uD83C\\uDDF8|\\uD83C\\uDDF8\\uD83C\\uDDE8|\\uD83C\\uDDF8\\uD83C\\uDDF1|\\uD83C\\uDDF8\\uD83C\\uDDEC|\\uD83C\\uDDF8\\uD83C\\uDDF0|\\uD83C\\uDDF8\\uD83C\\uDDEE|\\uD83C\\uDDF8\\uD83C\\uDDE7|\\uD83C\\uDDF8\\uD83C\\uDDF4|\\uD83C\\uDDFF\\uD83C\\uDDE6|\\uD83C\\uDDF1\\uD83C\\uDDF0|\\uD83C\\uDDF8\\uD83C\\uDDE9|\\uD83C\\uDDF8\\uD83C\\uDDF7|\\uD83C\\uDDF8\\uD83C\\uDDFF|\\uD83C\\uDDF8\\uD83C\\uDDEA|\\uD83C\\uDDE8\\uD83C\\uDDED|\\uD83C\\uDDF8\\uD83C\\uDDFE|\\uD83C\\uDDF9\\uD83C\\uDDEF|\\uD83C\\uDDF9\\uD83C\\uDDFF|\\uD83C\\uDDF9\\uD83C\\uDDED|\\uD83C\\uDDF9\\uD83C\\uDDEC|\\uD83C\\uDDF9\\uD83C\\uDDF4|\\uD83C\\uDDF9\\uD83C\\uDDF9|\\uD83C\\uDDF9\\uD83C\\uDDF3|\\uD83C\\uDDF9\\uD83C\\uDDF7|\\uD83C\\uDDF9\\uD83C\\uDDF2|\\uD83C\\uDDF9\\uD83C\\uDDFB|\\uD83C\\uDDFA\\uD83C\\uDDEC|\\uD83C\\uDDFA\\uD83C\\uDDE6|\\uD83C\\uDDE6\\uD83C\\uDDEA|\\uD83C\\uDDFA\\uD83C\\uDDFE|\\uD83C\\uDDFA\\uD83C\\uDDFF|\\uD83C\\uDDFB\\uD83C\\uDDFA|\\uD83C\\uDDFB\\uD83C\\uDDE6|\\uD83C\\uDDFB\\uD83C\\uDDEA|\\uD83C\\uDDFB\\uD83C\\uDDF3|\\uD83C\\uDDEA\\uD83C\\uDDED|\\uD83C\\uDDFE\\uD83C\\uDDEA|\\uD83C\\uDDFF\\uD83C\\uDDF2|\\uD83C\\uDDFF\\uD83C\\uDDFC|\\uD83C\\uDDF5\\uD83C\\uDDF7|\\uD83C\\uDDF0\\uD83C\\uDDFE|\\uD83C\\uDDE7\\uD83C\\uDDF2|\\uD83C\\uDDF5\\uD83C\\uDDEB|\\uD83C\\uDDF5\\uD83C\\uDDF8|\\uD83C\\uDDF3\\uD83C\\uDDE8|\\uD83C\\uDDF8\\uD83C\\uDDED|\\uD83C\\uDDE6\\uD83C\\uDDFC|\\uD83C\\uDDFB\\uD83C\\uDDEE|\\uD83C\\uDDED\\uD83C\\uDDF0|\\uD83C\\uDDE6\\uD83C\\uDDE8|\\uD83C\\uDDF2\\uD83C\\uDDF8|\\uD83C\\uDDEC\\uD83C\\uDDFA|\\uD83C\\uDDEC\\uD83C\\uDDF1|\\uD83C\\uDDF3\\uD83C\\uDDFA|\\uD83C\\uDDFC\\uD83C\\uDDEB|\\uD83C\\uDDF2\\uD83C\\uDDF4|\\uD83C\\uDDEB\\uD83C\\uDDF4|\\uD83C\\uDDEB\\uD83C\\uDDF0|\\uD83C\\uDDEF\\uD83C\\uDDEA|\\uD83C\\uDDE6\\uD83C\\uDDEE|\\uD83C\\uDDEC\\uD83C\\uDDEE)'; - ns.jsecapeMap = {"#\uFE0F\u20E3":"0023-20E3","#\u20E3":"0023-20E3","0\uFE0F\u20E3":"0030-20E3","0\u20E3":"0030-20E3","1\uFE0F\u20E3":"0031-20E3","1\u20E3":"0031-20E3","2\uFE0F\u20E3":"0032-20E3","2\u20E3":"0032-20E3","3\uFE0F\u20E3":"0033-20E3","3\u20E3":"0033-20E3","4\uFE0F\u20E3":"0034-20E3","4\u20E3":"0034-20E3","5\uFE0F\u20E3":"0035-20E3","5\u20E3":"0035-20E3","6\uFE0F\u20E3":"0036-20E3","6\u20E3":"0036-20E3","7\uFE0F\u20E3":"0037-20E3","7\u20E3":"0037-20E3","8\uFE0F\u20E3":"0038-20E3","8\u20E3":"0038-20E3","9\uFE0F\u20E3":"0039-20E3","9\u20E3":"0039-20E3","\u00A9":"00A9","\u00AE":"00AE","\u203C\uFE0F":"203C","\u203C":"203C","\u2049\uFE0F":"2049","\u2049":"2049","\u2122":"2122","\u2139\uFE0F":"2139","\u2139":"2139","\u2194\uFE0F":"2194","\u2194":"2194","\u2195\uFE0F":"2195","\u2195":"2195","\u2196\uFE0F":"2196","\u2196":"2196","\u2197\uFE0F":"2197","\u2197":"2197","\u2198\uFE0F":"2198","\u2198":"2198","\u2199\uFE0F":"2199","\u2199":"2199","\u21A9\uFE0F":"21A9","\u21A9":"21A9","\u21AA\uFE0F":"21AA","\u21AA":"21AA","\u231A\uFE0F":"231A","\u231A":"231A","\u231B\uFE0F":"231B","\u231B":"231B","\u23E9":"23E9","\u23EA":"23EA","\u23EB":"23EB","\u23EC":"23EC","\u23F0":"23F0","\u23F3":"23F3","\u24C2\uFE0F":"24C2","\u24C2":"24C2","\u25AA\uFE0F":"25AA","\u25AA":"25AA","\u25AB\uFE0F":"25AB","\u25AB":"25AB","\u25B6\uFE0F":"25B6","\u25B6":"25B6","\u25C0\uFE0F":"25C0","\u25C0":"25C0","\u25FB\uFE0F":"25FB","\u25FB":"25FB","\u25FC\uFE0F":"25FC","\u25FC":"25FC","\u25FD\uFE0F":"25FD","\u25FD":"25FD","\u25FE\uFE0F":"25FE","\u25FE":"25FE","\u2600\uFE0F":"2600","\u2600":"2600","\u2601\uFE0F":"2601","\u2601":"2601","\u260E\uFE0F":"260E","\u260E":"260E","\u2611\uFE0F":"2611","\u2611":"2611","\u2614\uFE0F":"2614","\u2614":"2614","\u2615\uFE0F":"2615","\u2615":"2615","\u261D\uFE0F":"261D","\u261D":"261D","\u263A\uFE0F":"263A","\u263A":"263A","\u2648\uFE0F":"2648","\u2648":"2648","\u2649\uFE0F":"2649","\u2649":"2649","\u264A\uFE0F":"264A","\u264A":"264A","\u264B\uFE0F":"264B","\u264B":"264B","\u264C\uFE0F":"264C","\u264C":"264C","\u264D\uFE0F":"264D","\u264D":"264D","\u264E\uFE0F":"264E","\u264E":"264E","\u264F\uFE0F":"264F","\u264F":"264F","\u2650\uFE0F":"2650","\u2650":"2650","\u2651\uFE0F":"2651","\u2651":"2651","\u2652\uFE0F":"2652","\u2652":"2652","\u2653\uFE0F":"2653","\u2653":"2653","\u2660\uFE0F":"2660","\u2660":"2660","\u2663\uFE0F":"2663","\u2663":"2663","\u2665\uFE0F":"2665","\u2665":"2665","\u2666\uFE0F":"2666","\u2666":"2666","\u2668\uFE0F":"2668","\u2668":"2668","\u267B\uFE0F":"267B","\u267B":"267B","\u267F\uFE0F":"267F","\u267F":"267F","\u2693\uFE0F":"2693","\u2693":"2693","\u26A0\uFE0F":"26A0","\u26A0":"26A0","\u26A1\uFE0F":"26A1","\u26A1":"26A1","\u26AA\uFE0F":"26AA","\u26AA":"26AA","\u26AB\uFE0F":"26AB","\u26AB":"26AB","\u26BD\uFE0F":"26BD","\u26BD":"26BD","\u26BE\uFE0F":"26BE","\u26BE":"26BE","\u26C4\uFE0F":"26C4","\u26C4":"26C4","\u26C5\uFE0F":"26C5","\u26C5":"26C5","\u26CE":"26CE","\u26D4\uFE0F":"26D4","\u26D4":"26D4","\u26EA\uFE0F":"26EA","\u26EA":"26EA","\u26F2\uFE0F":"26F2","\u26F2":"26F2","\u26F3\uFE0F":"26F3","\u26F3":"26F3","\u26F5\uFE0F":"26F5","\u26F5":"26F5","\u26FA\uFE0F":"26FA","\u26FA":"26FA","\u26FD\uFE0F":"26FD","\u26FD":"26FD","\u2702\uFE0F":"2702","\u2702":"2702","\u2705":"2705","\u2708\uFE0F":"2708","\u2708":"2708","\u2709\uFE0F":"2709","\u2709":"2709","\u270A":"270A","\u270B":"270B","\u270C\uFE0F":"270C","\u270C":"270C","\u270F\uFE0F":"270F","\u270F":"270F","\u2712\uFE0F":"2712","\u2712":"2712","\u2714\uFE0F":"2714","\u2714":"2714","\u2716\uFE0F":"2716","\u2716":"2716","\u2728":"2728","\u2733\uFE0F":"2733","\u2733":"2733","\u2734\uFE0F":"2734","\u2734":"2734","\u2744\uFE0F":"2744","\u2744":"2744","\u2747\uFE0F":"2747","\u2747":"2747","\u274C":"274C","\u274E":"274E","\u2753":"2753","\u2754":"2754","\u2755":"2755","\u2757\uFE0F":"2757","\u2757":"2757","\u2764\uFE0F":"2764","\u2764":"2764","\u2795":"2795","\u2796":"2796","\u2797":"2797","\u27A1\uFE0F":"27A1","\u27A1":"27A1","\u27B0":"27B0","\u2934\uFE0F":"2934","\u2934":"2934","\u2935\uFE0F":"2935","\u2935":"2935","\u2B05\uFE0F":"2B05","\u2B05":"2B05","\u2B06\uFE0F":"2B06","\u2B06":"2B06","\u2B07\uFE0F":"2B07","\u2B07":"2B07","\u2B1B\uFE0F":"2B1B","\u2B1B":"2B1B","\u2B1C\uFE0F":"2B1C","\u2B1C":"2B1C","\u2B50\uFE0F":"2B50","\u2B50":"2B50","\u2B55\uFE0F":"2B55","\u2B55":"2B55","\u3030":"3030","\u303D\uFE0F":"303D","\u303D":"303D","\u3297\uFE0F":"3297","\u3297":"3297","\u3299\uFE0F":"3299","\u3299":"3299","\uD83C\uDC04\uFE0F":"1F004","\uD83C\uDC04":"1F004","\uD83C\uDCCF":"1F0CF","\uD83C\uDD70":"1F170","\uD83C\uDD71":"1F171","\uD83C\uDD7E":"1F17E","\uD83C\uDD7F\uFE0F":"1F17F","\uD83C\uDD7F":"1F17F","\uD83C\uDD8E":"1F18E","\uD83C\uDD91":"1F191","\uD83C\uDD92":"1F192","\uD83C\uDD93":"1F193","\uD83C\uDD94":"1F194","\uD83C\uDD95":"1F195","\uD83C\uDD96":"1F196","\uD83C\uDD97":"1F197","\uD83C\uDD98":"1F198","\uD83C\uDD99":"1F199","\uD83C\uDD9A":"1F19A","\uD83C\uDDE8\uD83C\uDDF3":"1F1E8-1F1F3","\uD83C\uDDE9\uD83C\uDDEA":"1F1E9-1F1EA","\uD83C\uDDEA\uD83C\uDDF8":"1F1EA-1F1F8","\uD83C\uDDEB\uD83C\uDDF7":"1F1EB-1F1F7","\uD83C\uDDEC\uD83C\uDDE7":"1F1EC-1F1E7","\uD83C\uDDEE\uD83C\uDDF9":"1F1EE-1F1F9","\uD83C\uDDEF\uD83C\uDDF5":"1F1EF-1F1F5","\uD83C\uDDF0\uD83C\uDDF7":"1F1F0-1F1F7","\uD83C\uDDFA\uD83C\uDDF8":"1F1FA-1F1F8","\uD83C\uDDF7\uD83C\uDDFA":"1F1F7-1F1FA","\uD83C\uDE01":"1F201","\uD83C\uDE02":"1F202","\uD83C\uDE1A\uFE0F":"1F21A","\uD83C\uDE1A":"1F21A","\uD83C\uDE2F\uFE0F":"1F22F","\uD83C\uDE2F":"1F22F","\uD83C\uDE32":"1F232","\uD83C\uDE33":"1F233","\uD83C\uDE34":"1F234","\uD83C\uDE35":"1F235","\uD83C\uDE36":"1F236","\uD83C\uDE37":"1F237","\uD83C\uDE38":"1F238","\uD83C\uDE39":"1F239","\uD83C\uDE3A":"1F23A","\uD83C\uDE50":"1F250","\uD83C\uDE51":"1F251","\uD83C\uDF00":"1F300","\uD83C\uDF01":"1F301","\uD83C\uDF02":"1F302","\uD83C\uDF03":"1F303","\uD83C\uDF04":"1F304","\uD83C\uDF05":"1F305","\uD83C\uDF06":"1F306","\uD83C\uDF07":"1F307","\uD83C\uDF08":"1F308","\uD83C\uDF09":"1F309","\uD83C\uDF0A":"1F30A","\uD83C\uDF0B":"1F30B","\uD83C\uDF0C":"1F30C","\uD83C\uDF0F":"1F30F","\uD83C\uDF11":"1F311","\uD83C\uDF13":"1F313","\uD83C\uDF14":"1F314","\uD83C\uDF15":"1F315","\uD83C\uDF19":"1F319","\uD83C\uDF1B":"1F31B","\uD83C\uDF1F":"1F31F","\uD83C\uDF20":"1F320","\uD83C\uDF30":"1F330","\uD83C\uDF31":"1F331","\uD83C\uDF34":"1F334","\uD83C\uDF35":"1F335","\uD83C\uDF37":"1F337","\uD83C\uDF38":"1F338","\uD83C\uDF39":"1F339","\uD83C\uDF3A":"1F33A","\uD83C\uDF3B":"1F33B","\uD83C\uDF3C":"1F33C","\uD83C\uDF3D":"1F33D","\uD83C\uDF3E":"1F33E","\uD83C\uDF3F":"1F33F","\uD83C\uDF40":"1F340","\uD83C\uDF41":"1F341","\uD83C\uDF42":"1F342","\uD83C\uDF43":"1F343","\uD83C\uDF44":"1F344","\uD83C\uDF45":"1F345","\uD83C\uDF46":"1F346","\uD83C\uDF47":"1F347","\uD83C\uDF48":"1F348","\uD83C\uDF49":"1F349","\uD83C\uDF4A":"1F34A","\uD83C\uDF4C":"1F34C","\uD83C\uDF4D":"1F34D","\uD83C\uDF4E":"1F34E","\uD83C\uDF4F":"1F34F","\uD83C\uDF51":"1F351","\uD83C\uDF52":"1F352","\uD83C\uDF53":"1F353","\uD83C\uDF54":"1F354","\uD83C\uDF55":"1F355","\uD83C\uDF56":"1F356","\uD83C\uDF57":"1F357","\uD83C\uDF58":"1F358","\uD83C\uDF59":"1F359","\uD83C\uDF5A":"1F35A","\uD83C\uDF5B":"1F35B","\uD83C\uDF5C":"1F35C","\uD83C\uDF5D":"1F35D","\uD83C\uDF5E":"1F35E","\uD83C\uDF5F":"1F35F","\uD83C\uDF60":"1F360","\uD83C\uDF61":"1F361","\uD83C\uDF62":"1F362","\uD83C\uDF63":"1F363","\uD83C\uDF64":"1F364","\uD83C\uDF65":"1F365","\uD83C\uDF66":"1F366","\uD83C\uDF67":"1F367","\uD83C\uDF68":"1F368","\uD83C\uDF69":"1F369","\uD83C\uDF6A":"1F36A","\uD83C\uDF6B":"1F36B","\uD83C\uDF6C":"1F36C","\uD83C\uDF6D":"1F36D","\uD83C\uDF6E":"1F36E","\uD83C\uDF6F":"1F36F","\uD83C\uDF70":"1F370","\uD83C\uDF71":"1F371","\uD83C\uDF72":"1F372","\uD83C\uDF73":"1F373","\uD83C\uDF74":"1F374","\uD83C\uDF75":"1F375","\uD83C\uDF76":"1F376","\uD83C\uDF77":"1F377","\uD83C\uDF78":"1F378","\uD83C\uDF79":"1F379","\uD83C\uDF7A":"1F37A","\uD83C\uDF7B":"1F37B","\uD83C\uDF80":"1F380","\uD83C\uDF81":"1F381","\uD83C\uDF82":"1F382","\uD83C\uDF83":"1F383","\uD83C\uDF84":"1F384","\uD83C\uDF85":"1F385","\uD83C\uDF86":"1F386","\uD83C\uDF87":"1F387","\uD83C\uDF88":"1F388","\uD83C\uDF89":"1F389","\uD83C\uDF8A":"1F38A","\uD83C\uDF8B":"1F38B","\uD83C\uDF8C":"1F38C","\uD83C\uDF8D":"1F38D","\uD83C\uDF8E":"1F38E","\uD83C\uDF8F":"1F38F","\uD83C\uDF90":"1F390","\uD83C\uDF91":"1F391","\uD83C\uDF92":"1F392","\uD83C\uDF93":"1F393","\uD83C\uDFA0":"1F3A0","\uD83C\uDFA1":"1F3A1","\uD83C\uDFA2":"1F3A2","\uD83C\uDFA3":"1F3A3","\uD83C\uDFA4":"1F3A4","\uD83C\uDFA5":"1F3A5","\uD83C\uDFA6":"1F3A6","\uD83C\uDFA7":"1F3A7","\uD83C\uDFA8":"1F3A8","\uD83C\uDFA9":"1F3A9","\uD83C\uDFAA":"1F3AA","\uD83C\uDFAB":"1F3AB","\uD83C\uDFAC":"1F3AC","\uD83C\uDFAD":"1F3AD","\uD83C\uDFAE":"1F3AE","\uD83C\uDFAF":"1F3AF","\uD83C\uDFB0":"1F3B0","\uD83C\uDFB1":"1F3B1","\uD83C\uDFB2":"1F3B2","\uD83C\uDFB3":"1F3B3","\uD83C\uDFB4":"1F3B4","\uD83C\uDFB5":"1F3B5","\uD83C\uDFB6":"1F3B6","\uD83C\uDFB7":"1F3B7","\uD83C\uDFB8":"1F3B8","\uD83C\uDFB9":"1F3B9","\uD83C\uDFBA":"1F3BA","\uD83C\uDFBB":"1F3BB","\uD83C\uDFBC":"1F3BC","\uD83C\uDFBD":"1F3BD","\uD83C\uDFBE":"1F3BE","\uD83C\uDFBF":"1F3BF","\uD83C\uDFC0":"1F3C0","\uD83C\uDFC1":"1F3C1","\uD83C\uDFC2":"1F3C2","\uD83C\uDFC3":"1F3C3","\uD83C\uDFC4":"1F3C4","\uD83C\uDFC6":"1F3C6","\uD83C\uDFC8":"1F3C8","\uD83C\uDFCA":"1F3CA","\uD83C\uDFE0":"1F3E0","\uD83C\uDFE1":"1F3E1","\uD83C\uDFE2":"1F3E2","\uD83C\uDFE3":"1F3E3","\uD83C\uDFE5":"1F3E5","\uD83C\uDFE6":"1F3E6","\uD83C\uDFE7":"1F3E7","\uD83C\uDFE8":"1F3E8","\uD83C\uDFE9":"1F3E9","\uD83C\uDFEA":"1F3EA","\uD83C\uDFEB":"1F3EB","\uD83C\uDFEC":"1F3EC","\uD83C\uDFED":"1F3ED","\uD83C\uDFEE":"1F3EE","\uD83C\uDFEF":"1F3EF","\uD83C\uDFF0":"1F3F0","\uD83D\uDC0C":"1F40C","\uD83D\uDC0D":"1F40D","\uD83D\uDC0E":"1F40E","\uD83D\uDC11":"1F411","\uD83D\uDC12":"1F412","\uD83D\uDC14":"1F414","\uD83D\uDC17":"1F417","\uD83D\uDC18":"1F418","\uD83D\uDC19":"1F419","\uD83D\uDC1A":"1F41A","\uD83D\uDC1B":"1F41B","\uD83D\uDC1C":"1F41C","\uD83D\uDC1D":"1F41D","\uD83D\uDC1E":"1F41E","\uD83D\uDC1F":"1F41F","\uD83D\uDC20":"1F420","\uD83D\uDC21":"1F421","\uD83D\uDC22":"1F422","\uD83D\uDC23":"1F423","\uD83D\uDC24":"1F424","\uD83D\uDC25":"1F425","\uD83D\uDC26":"1F426","\uD83D\uDC27":"1F427","\uD83D\uDC28":"1F428","\uD83D\uDC29":"1F429","\uD83D\uDC2B":"1F42B","\uD83D\uDC2C":"1F42C","\uD83D\uDC2D":"1F42D","\uD83D\uDC2E":"1F42E","\uD83D\uDC2F":"1F42F","\uD83D\uDC30":"1F430","\uD83D\uDC31":"1F431","\uD83D\uDC32":"1F432","\uD83D\uDC33":"1F433","\uD83D\uDC34":"1F434","\uD83D\uDC35":"1F435","\uD83D\uDC36":"1F436","\uD83D\uDC37":"1F437","\uD83D\uDC38":"1F438","\uD83D\uDC39":"1F439","\uD83D\uDC3A":"1F43A","\uD83D\uDC3B":"1F43B","\uD83D\uDC3C":"1F43C","\uD83D\uDC3D":"1F43D","\uD83D\uDC3E":"1F43E","\uD83D\uDC40":"1F440","\uD83D\uDC42":"1F442","\uD83D\uDC43":"1F443","\uD83D\uDC44":"1F444","\uD83D\uDC45":"1F445","\uD83D\uDC46":"1F446","\uD83D\uDC47":"1F447","\uD83D\uDC48":"1F448","\uD83D\uDC49":"1F449","\uD83D\uDC4A":"1F44A","\uD83D\uDC4B":"1F44B","\uD83D\uDC4C":"1F44C","\uD83D\uDC4D":"1F44D","\uD83D\uDC4E":"1F44E","\uD83D\uDC4F":"1F44F","\uD83D\uDC50":"1F450","\uD83D\uDC51":"1F451","\uD83D\uDC52":"1F452","\uD83D\uDC53":"1F453","\uD83D\uDC54":"1F454","\uD83D\uDC55":"1F455","\uD83D\uDC56":"1F456","\uD83D\uDC57":"1F457","\uD83D\uDC58":"1F458","\uD83D\uDC59":"1F459","\uD83D\uDC5A":"1F45A","\uD83D\uDC5B":"1F45B","\uD83D\uDC5C":"1F45C","\uD83D\uDC5D":"1F45D","\uD83D\uDC5E":"1F45E","\uD83D\uDC5F":"1F45F","\uD83D\uDC60":"1F460","\uD83D\uDC61":"1F461","\uD83D\uDC62":"1F462","\uD83D\uDC63":"1F463","\uD83D\uDC64":"1F464","\uD83D\uDC66":"1F466","\uD83D\uDC67":"1F467","\uD83D\uDC68":"1F468","\uD83D\uDC69":"1F469","\uD83D\uDC6A":"1F46A","\uD83D\uDC6B":"1F46B","\uD83D\uDC6E":"1F46E","\uD83D\uDC6F":"1F46F","\uD83D\uDC70":"1F470","\uD83D\uDC71":"1F471","\uD83D\uDC72":"1F472","\uD83D\uDC73":"1F473","\uD83D\uDC74":"1F474","\uD83D\uDC75":"1F475","\uD83D\uDC76":"1F476","\uD83D\uDC77":"1F477","\uD83D\uDC78":"1F478","\uD83D\uDC79":"1F479","\uD83D\uDC7A":"1F47A","\uD83D\uDC7B":"1F47B","\uD83D\uDC7C":"1F47C","\uD83D\uDC7D":"1F47D","\uD83D\uDC7E":"1F47E","\uD83D\uDC7F":"1F47F","\uD83D\uDC80":"1F480","\uD83D\uDCC7":"1F4C7","\uD83D\uDC81":"1F481","\uD83D\uDC82":"1F482","\uD83D\uDC83":"1F483","\uD83D\uDC84":"1F484","\uD83D\uDC85":"1F485","\uD83D\uDCD2":"1F4D2","\uD83D\uDC86":"1F486","\uD83D\uDCD3":"1F4D3","\uD83D\uDC87":"1F487","\uD83D\uDCD4":"1F4D4","\uD83D\uDC88":"1F488","\uD83D\uDCD5":"1F4D5","\uD83D\uDC89":"1F489","\uD83D\uDCD6":"1F4D6","\uD83D\uDC8A":"1F48A","\uD83D\uDCD7":"1F4D7","\uD83D\uDC8B":"1F48B","\uD83D\uDCD8":"1F4D8","\uD83D\uDC8C":"1F48C","\uD83D\uDCD9":"1F4D9","\uD83D\uDC8D":"1F48D","\uD83D\uDCDA":"1F4DA","\uD83D\uDC8E":"1F48E","\uD83D\uDCDB":"1F4DB","\uD83D\uDC8F":"1F48F","\uD83D\uDCDC":"1F4DC","\uD83D\uDC90":"1F490","\uD83D\uDCDD":"1F4DD","\uD83D\uDC91":"1F491","\uD83D\uDCDE":"1F4DE","\uD83D\uDC92":"1F492","\uD83D\uDCDF":"1F4DF","\uD83D\uDCE0":"1F4E0","\uD83D\uDC93":"1F493","\uD83D\uDCE1":"1F4E1","\uD83D\uDCE2":"1F4E2","\uD83D\uDC94":"1F494","\uD83D\uDCE3":"1F4E3","\uD83D\uDCE4":"1F4E4","\uD83D\uDC95":"1F495","\uD83D\uDCE5":"1F4E5","\uD83D\uDCE6":"1F4E6","\uD83D\uDC96":"1F496","\uD83D\uDCE7":"1F4E7","\uD83D\uDCE8":"1F4E8","\uD83D\uDC97":"1F497","\uD83D\uDCE9":"1F4E9","\uD83D\uDCEA":"1F4EA","\uD83D\uDC98":"1F498","\uD83D\uDCEB":"1F4EB","\uD83D\uDCEE":"1F4EE","\uD83D\uDC99":"1F499","\uD83D\uDCF0":"1F4F0","\uD83D\uDCF1":"1F4F1","\uD83D\uDC9A":"1F49A","\uD83D\uDCF2":"1F4F2","\uD83D\uDCF3":"1F4F3","\uD83D\uDC9B":"1F49B","\uD83D\uDCF4":"1F4F4","\uD83D\uDCF6":"1F4F6","\uD83D\uDC9C":"1F49C","\uD83D\uDCF7":"1F4F7","\uD83D\uDCF9":"1F4F9","\uD83D\uDC9D":"1F49D","\uD83D\uDCFA":"1F4FA","\uD83D\uDCFB":"1F4FB","\uD83D\uDC9E":"1F49E","\uD83D\uDCFC":"1F4FC","\uD83D\uDD03":"1F503","\uD83D\uDC9F":"1F49F","\uD83D\uDD0A":"1F50A","\uD83D\uDD0B":"1F50B","\uD83D\uDCA0":"1F4A0","\uD83D\uDD0C":"1F50C","\uD83D\uDD0D":"1F50D","\uD83D\uDCA1":"1F4A1","\uD83D\uDD0E":"1F50E","\uD83D\uDD0F":"1F50F","\uD83D\uDCA2":"1F4A2","\uD83D\uDD10":"1F510","\uD83D\uDD11":"1F511","\uD83D\uDCA3":"1F4A3","\uD83D\uDD12":"1F512","\uD83D\uDD13":"1F513","\uD83D\uDCA4":"1F4A4","\uD83D\uDD14":"1F514","\uD83D\uDD16":"1F516","\uD83D\uDCA5":"1F4A5","\uD83D\uDD17":"1F517","\uD83D\uDD18":"1F518","\uD83D\uDCA6":"1F4A6","\uD83D\uDD19":"1F519","\uD83D\uDD1A":"1F51A","\uD83D\uDCA7":"1F4A7","\uD83D\uDD1B":"1F51B","\uD83D\uDD1C":"1F51C","\uD83D\uDCA8":"1F4A8","\uD83D\uDD1D":"1F51D","\uD83D\uDD1E":"1F51E","\uD83D\uDCA9":"1F4A9","\uD83D\uDD1F":"1F51F","\uD83D\uDCAA":"1F4AA","\uD83D\uDD20":"1F520","\uD83D\uDD21":"1F521","\uD83D\uDCAB":"1F4AB","\uD83D\uDD22":"1F522","\uD83D\uDD23":"1F523","\uD83D\uDCAC":"1F4AC","\uD83D\uDD24":"1F524","\uD83D\uDD25":"1F525","\uD83D\uDCAE":"1F4AE","\uD83D\uDD26":"1F526","\uD83D\uDD27":"1F527","\uD83D\uDCAF":"1F4AF","\uD83D\uDD28":"1F528","\uD83D\uDD29":"1F529","\uD83D\uDCB0":"1F4B0","\uD83D\uDD2A":"1F52A","\uD83D\uDD2B":"1F52B","\uD83D\uDCB1":"1F4B1","\uD83D\uDD2E":"1F52E","\uD83D\uDCB2":"1F4B2","\uD83D\uDD2F":"1F52F","\uD83D\uDCB3":"1F4B3","\uD83D\uDD30":"1F530","\uD83D\uDD31":"1F531","\uD83D\uDCB4":"1F4B4","\uD83D\uDD32":"1F532","\uD83D\uDD33":"1F533","\uD83D\uDCB5":"1F4B5","\uD83D\uDD34":"1F534","\uD83D\uDD35":"1F535","\uD83D\uDCB8":"1F4B8","\uD83D\uDD36":"1F536","\uD83D\uDD37":"1F537","\uD83D\uDCB9":"1F4B9","\uD83D\uDD38":"1F538","\uD83D\uDD39":"1F539","\uD83D\uDCBA":"1F4BA","\uD83D\uDD3A":"1F53A","\uD83D\uDD3B":"1F53B","\uD83D\uDCBB":"1F4BB","\uD83D\uDD3C":"1F53C","\uD83D\uDCBC":"1F4BC","\uD83D\uDD3D":"1F53D","\uD83D\uDD50":"1F550","\uD83D\uDCBD":"1F4BD","\uD83D\uDD51":"1F551","\uD83D\uDCBE":"1F4BE","\uD83D\uDD52":"1F552","\uD83D\uDCBF":"1F4BF","\uD83D\uDD53":"1F553","\uD83D\uDCC0":"1F4C0","\uD83D\uDD54":"1F554","\uD83D\uDD55":"1F555","\uD83D\uDCC1":"1F4C1","\uD83D\uDD56":"1F556","\uD83D\uDD57":"1F557","\uD83D\uDCC2":"1F4C2","\uD83D\uDD58":"1F558","\uD83D\uDD59":"1F559","\uD83D\uDCC3":"1F4C3","\uD83D\uDD5A":"1F55A","\uD83D\uDD5B":"1F55B","\uD83D\uDCC4":"1F4C4","\uD83D\uDDFB":"1F5FB","\uD83D\uDDFC":"1F5FC","\uD83D\uDCC5":"1F4C5","\uD83D\uDDFD":"1F5FD","\uD83D\uDDFE":"1F5FE","\uD83D\uDCC6":"1F4C6","\uD83D\uDDFF":"1F5FF","\uD83D\uDE01":"1F601","\uD83D\uDE02":"1F602","\uD83D\uDE03":"1F603","\uD83D\uDCC8":"1F4C8","\uD83D\uDE04":"1F604","\uD83D\uDE05":"1F605","\uD83D\uDCC9":"1F4C9","\uD83D\uDE06":"1F606","\uD83D\uDE09":"1F609","\uD83D\uDCCA":"1F4CA","\uD83D\uDE0A":"1F60A","\uD83D\uDE0B":"1F60B","\uD83D\uDCCB":"1F4CB","\uD83D\uDE0C":"1F60C","\uD83D\uDE0D":"1F60D","\uD83D\uDCCC":"1F4CC","\uD83D\uDE0F":"1F60F","\uD83D\uDE12":"1F612","\uD83D\uDCCD":"1F4CD","\uD83D\uDE13":"1F613","\uD83D\uDE14":"1F614","\uD83D\uDCCE":"1F4CE","\uD83D\uDE16":"1F616","\uD83D\uDE18":"1F618","\uD83D\uDCCF":"1F4CF","\uD83D\uDE1A":"1F61A","\uD83D\uDE1C":"1F61C","\uD83D\uDCD0":"1F4D0","\uD83D\uDE1D":"1F61D","\uD83D\uDE1E":"1F61E","\uD83D\uDCD1":"1F4D1","\uD83D\uDE20":"1F620","\uD83D\uDE21":"1F621","\uD83D\uDE22":"1F622","\uD83D\uDE23":"1F623","\uD83D\uDE24":"1F624","\uD83D\uDE25":"1F625","\uD83D\uDE28":"1F628","\uD83D\uDE29":"1F629","\uD83D\uDE2A":"1F62A","\uD83D\uDE2B":"1F62B","\uD83D\uDE2D":"1F62D","\uD83D\uDE30":"1F630","\uD83D\uDE31":"1F631","\uD83D\uDE32":"1F632","\uD83D\uDE33":"1F633","\uD83D\uDE35":"1F635","\uD83D\uDE37":"1F637","\uD83D\uDE38":"1F638","\uD83D\uDE39":"1F639","\uD83D\uDE3A":"1F63A","\uD83D\uDE3B":"1F63B","\uD83D\uDE3C":"1F63C","\uD83D\uDE3D":"1F63D","\uD83D\uDE3E":"1F63E","\uD83D\uDE3F":"1F63F","\uD83D\uDE40":"1F640","\uD83D\uDE45":"1F645","\uD83D\uDE46":"1F646","\uD83D\uDE47":"1F647","\uD83D\uDE48":"1F648","\uD83D\uDE49":"1F649","\uD83D\uDE4A":"1F64A","\uD83D\uDE4B":"1F64B","\uD83D\uDE4C":"1F64C","\uD83D\uDE4D":"1F64D","\uD83D\uDE4E":"1F64E","\uD83D\uDE4F":"1F64F","\uD83D\uDE80":"1F680","\uD83D\uDE83":"1F683","\uD83D\uDE84":"1F684","\uD83D\uDE85":"1F685","\uD83D\uDE87":"1F687","\uD83D\uDE89":"1F689","\uD83D\uDE8C":"1F68C","\uD83D\uDE8F":"1F68F","\uD83D\uDE91":"1F691","\uD83D\uDE92":"1F692","\uD83D\uDE93":"1F693","\uD83D\uDE95":"1F695","\uD83D\uDE97":"1F697","\uD83D\uDE99":"1F699","\uD83D\uDE9A":"1F69A","\uD83D\uDEA2":"1F6A2","\uD83D\uDEA4":"1F6A4","\uD83D\uDEA5":"1F6A5","\uD83D\uDEA7":"1F6A7","\uD83D\uDEA8":"1F6A8","\uD83D\uDEA9":"1F6A9","\uD83D\uDEAA":"1F6AA","\uD83D\uDEAB":"1F6AB","\uD83D\uDEAC":"1F6AC","\uD83D\uDEAD":"1F6AD","\uD83D\uDEB2":"1F6B2","\uD83D\uDEB6":"1F6B6","\uD83D\uDEB9":"1F6B9","\uD83D\uDEBA":"1F6BA","\uD83D\uDEBB":"1F6BB","\uD83D\uDEBC":"1F6BC","\uD83D\uDEBD":"1F6BD","\uD83D\uDEBE":"1F6BE","\uD83D\uDEC0":"1F6C0","\uD83D\uDE00":"1F600","\uD83D\uDE07":"1F607","\uD83D\uDE08":"1F608","\uD83D\uDE0E":"1F60E","\uD83D\uDE10":"1F610","\uD83D\uDE11":"1F611","\uD83D\uDE15":"1F615","\uD83D\uDE17":"1F617","\uD83D\uDE19":"1F619","\uD83D\uDE1B":"1F61B","\uD83D\uDE1F":"1F61F","\uD83D\uDE26":"1F626","\uD83D\uDE27":"1F627","\uD83D\uDE2C":"1F62C","\uD83D\uDE2E":"1F62E","\uD83D\uDE2F":"1F62F","\uD83D\uDE34":"1F634","\uD83D\uDE36":"1F636","\uD83D\uDE81":"1F681","\uD83D\uDE82":"1F682","\uD83D\uDE86":"1F686","\uD83D\uDE88":"1F688","\uD83D\uDE8A":"1F68A","\uD83D\uDE8D":"1F68D","\uD83D\uDE8E":"1F68E","\uD83D\uDE90":"1F690","\uD83D\uDE94":"1F694","\uD83D\uDE96":"1F696","\uD83D\uDE98":"1F698","\uD83D\uDE9B":"1F69B","\uD83D\uDE9C":"1F69C","\uD83D\uDE9D":"1F69D","\uD83D\uDE9E":"1F69E","\uD83D\uDE9F":"1F69F","\uD83D\uDEA0":"1F6A0","\uD83D\uDEA1":"1F6A1","\uD83D\uDEA3":"1F6A3","\uD83D\uDEA6":"1F6A6","\uD83D\uDEAE":"1F6AE","\uD83D\uDEAF":"1F6AF","\uD83D\uDEB0":"1F6B0","\uD83D\uDEB1":"1F6B1","\uD83D\uDEB3":"1F6B3","\uD83D\uDEB4":"1F6B4","\uD83D\uDEB5":"1F6B5","\uD83D\uDEB7":"1F6B7","\uD83D\uDEB8":"1F6B8","\uD83D\uDEBF":"1F6BF","\uD83D\uDEC1":"1F6C1","\uD83D\uDEC2":"1F6C2","\uD83D\uDEC3":"1F6C3","\uD83D\uDEC4":"1F6C4","\uD83D\uDEC5":"1F6C5","\uD83C\uDF0D":"1F30D","\uD83C\uDF0E":"1F30E","\uD83C\uDF10":"1F310","\uD83C\uDF12":"1F312","\uD83C\uDF16":"1F316","\uD83C\uDF17":"1F317","\uD83C\uDF18":"1F318","\uD83C\uDF1A":"1F31A","\uD83C\uDF1C":"1F31C","\uD83C\uDF1D":"1F31D","\uD83C\uDF1E":"1F31E","\uD83C\uDF32":"1F332","\uD83C\uDF33":"1F333","\uD83C\uDF4B":"1F34B","\uD83C\uDF50":"1F350","\uD83C\uDF7C":"1F37C","\uD83C\uDFC7":"1F3C7","\uD83C\uDFC9":"1F3C9","\uD83C\uDFE4":"1F3E4","\uD83D\uDC00":"1F400","\uD83D\uDC01":"1F401","\uD83D\uDC02":"1F402","\uD83D\uDC03":"1F403","\uD83D\uDC04":"1F404","\uD83D\uDC05":"1F405","\uD83D\uDC06":"1F406","\uD83D\uDC07":"1F407","\uD83D\uDC08":"1F408","\uD83D\uDC09":"1F409","\uD83D\uDC0A":"1F40A","\uD83D\uDC0B":"1F40B","\uD83D\uDC0F":"1F40F","\uD83D\uDC10":"1F410","\uD83D\uDC13":"1F413","\uD83D\uDC15":"1F415","\uD83D\uDC16":"1F416","\uD83D\uDC2A":"1F42A","\uD83D\uDC65":"1F465","\uD83D\uDC6C":"1F46C","\uD83D\uDC6D":"1F46D","\uD83D\uDCAD":"1F4AD","\uD83D\uDCB6":"1F4B6","\uD83D\uDCB7":"1F4B7","\uD83D\uDCEC":"1F4EC","\uD83D\uDCED":"1F4ED","\uD83D\uDCEF":"1F4EF","\uD83D\uDCF5":"1F4F5","\uD83D\uDD00":"1F500","\uD83D\uDD01":"1F501","\uD83D\uDD02":"1F502","\uD83D\uDD04":"1F504","\uD83D\uDD05":"1F505","\uD83D\uDD06":"1F506","\uD83D\uDD07":"1F507","\uD83D\uDD09":"1F509","\uD83D\uDD15":"1F515","\uD83D\uDD2C":"1F52C","\uD83D\uDD2D":"1F52D","\uD83D\uDD5C":"1F55C","\uD83D\uDD5D":"1F55D","\uD83D\uDD5E":"1F55E","\uD83D\uDD5F":"1F55F","\uD83D\uDD60":"1F560","\uD83D\uDD61":"1F561","\uD83D\uDD62":"1F562","\uD83D\uDD63":"1F563","\uD83D\uDD64":"1F564","\uD83D\uDD65":"1F565","\uD83D\uDD66":"1F566","\uD83D\uDD67":"1F567","\uD83D\uDD08":"1F508","\uD83D\uDE8B":"1F68B","\u27BF":"27BF","\uD83C\uDDE6\uD83C\uDDEB":"1F1E6-1F1EB","\uD83C\uDDE6\uD83C\uDDF1":"1F1E6-1F1F1","\uD83C\uDDE9\uD83C\uDDFF":"1F1E9-1F1FF","\uD83C\uDDE6\uD83C\uDDE9":"1F1E6-1F1E9","\uD83C\uDDE6\uD83C\uDDF4":"1F1E6-1F1F4","\uD83C\uDDE6\uD83C\uDDEC":"1F1E6-1F1EC","\uD83C\uDDE6\uD83C\uDDF7":"1F1E6-1F1F7","\uD83C\uDDE6\uD83C\uDDF2":"1F1E6-1F1F2","\uD83C\uDDE6\uD83C\uDDFA":"1F1E6-1F1FA","\uD83C\uDDE6\uD83C\uDDF9":"1F1E6-1F1F9","\uD83C\uDDE6\uD83C\uDDFF":"1F1E6-1F1FF","\uD83C\uDDE7\uD83C\uDDF8":"1F1E7-1F1F8","\uD83C\uDDE7\uD83C\uDDED":"1F1E7-1F1ED","\uD83C\uDDE7\uD83C\uDDE9":"1F1E7-1F1E9","\uD83C\uDDE7\uD83C\uDDE7":"1F1E7-1F1E7","\uD83C\uDDE7\uD83C\uDDFE":"1F1E7-1F1FE","\uD83C\uDDE7\uD83C\uDDEA":"1F1E7-1F1EA","\uD83C\uDDE7\uD83C\uDDFF":"1F1E7-1F1FF","\uD83C\uDDE7\uD83C\uDDEF":"1F1E7-1F1EF","\uD83C\uDDE7\uD83C\uDDF9":"1F1E7-1F1F9","\uD83C\uDDE7\uD83C\uDDF4":"1F1E7-1F1F4","\uD83C\uDDE7\uD83C\uDDE6":"1F1E7-1F1E6","\uD83C\uDDE7\uD83C\uDDFC":"1F1E7-1F1FC","\uD83C\uDDE7\uD83C\uDDF7":"1F1E7-1F1F7","\uD83C\uDDE7\uD83C\uDDF3":"1F1E7-1F1F3","\uD83C\uDDE7\uD83C\uDDEC":"1F1E7-1F1EC","\uD83C\uDDE7\uD83C\uDDEB":"1F1E7-1F1EB","\uD83C\uDDE7\uD83C\uDDEE":"1F1E7-1F1EE","\uD83C\uDDF0\uD83C\uDDED":"1F1F0-1F1ED","\uD83C\uDDE8\uD83C\uDDF2":"1F1E8-1F1F2","\uD83C\uDDE8\uD83C\uDDE6":"1F1E8-1F1E6","\uD83C\uDDE8\uD83C\uDDFB":"1F1E8-1F1FB","\uD83C\uDDE8\uD83C\uDDEB":"1F1E8-1F1EB","\uD83C\uDDF9\uD83C\uDDE9":"1F1F9-1F1E9","\uD83C\uDDE8\uD83C\uDDF1":"1F1E8-1F1F1","\uD83C\uDDE8\uD83C\uDDF4":"1F1E8-1F1F4","\uD83C\uDDF0\uD83C\uDDF2":"1F1F0-1F1F2","\uD83C\uDDE8\uD83C\uDDF7":"1F1E8-1F1F7","\uD83C\uDDE8\uD83C\uDDEE":"1F1E8-1F1EE","\uD83C\uDDED\uD83C\uDDF7":"1F1ED-1F1F7","\uD83C\uDDE8\uD83C\uDDFA":"1F1E8-1F1FA","\uD83C\uDDE8\uD83C\uDDFE":"1F1E8-1F1FE","\uD83C\uDDE8\uD83C\uDDFF":"1F1E8-1F1FF","\uD83C\uDDE8\uD83C\uDDE9":"1F1E8-1F1E9","\uD83C\uDDE9\uD83C\uDDF0":"1F1E9-1F1F0","\uD83C\uDDE9\uD83C\uDDEF":"1F1E9-1F1EF","\uD83C\uDDE9\uD83C\uDDF2":"1F1E9-1F1F2","\uD83C\uDDE9\uD83C\uDDF4":"1F1E9-1F1F4","\uD83C\uDDF9\uD83C\uDDF1":"1F1F9-1F1F1","\uD83C\uDDEA\uD83C\uDDE8":"1F1EA-1F1E8","\uD83C\uDDEA\uD83C\uDDEC":"1F1EA-1F1EC","\uD83C\uDDF8\uD83C\uDDFB":"1F1F8-1F1FB","\uD83C\uDDEC\uD83C\uDDF6":"1F1EC-1F1F6","\uD83C\uDDEA\uD83C\uDDF7":"1F1EA-1F1F7","\uD83C\uDDEA\uD83C\uDDEA":"1F1EA-1F1EA","\uD83C\uDDEA\uD83C\uDDF9":"1F1EA-1F1F9","\uD83C\uDDEB\uD83C\uDDEF":"1F1EB-1F1EF","\uD83C\uDDEB\uD83C\uDDEE":"1F1EB-1F1EE","\uD83C\uDDEC\uD83C\uDDE6":"1F1EC-1F1E6","\uD83C\uDDEC\uD83C\uDDF2":"1F1EC-1F1F2","\uD83C\uDDEC\uD83C\uDDEA":"1F1EC-1F1EA","\uD83C\uDDEC\uD83C\uDDED":"1F1EC-1F1ED","\uD83C\uDDEC\uD83C\uDDF7":"1F1EC-1F1F7","\uD83C\uDDEC\uD83C\uDDE9":"1F1EC-1F1E9","\uD83C\uDDEC\uD83C\uDDF9":"1F1EC-1F1F9","\uD83C\uDDEC\uD83C\uDDF3":"1F1EC-1F1F3","\uD83C\uDDEC\uD83C\uDDFC":"1F1EC-1F1FC","\uD83C\uDDEC\uD83C\uDDFE":"1F1EC-1F1FE","\uD83C\uDDED\uD83C\uDDF9":"1F1ED-1F1F9","\uD83C\uDDED\uD83C\uDDF3":"1F1ED-1F1F3","\uD83C\uDDED\uD83C\uDDFA":"1F1ED-1F1FA","\uD83C\uDDEE\uD83C\uDDF8":"1F1EE-1F1F8","\uD83C\uDDEE\uD83C\uDDF3":"1F1EE-1F1F3","\uD83C\uDDEE\uD83C\uDDE9":"1F1EE-1F1E9","\uD83C\uDDEE\uD83C\uDDF7":"1F1EE-1F1F7","\uD83C\uDDEE\uD83C\uDDF6":"1F1EE-1F1F6","\uD83C\uDDEE\uD83C\uDDEA":"1F1EE-1F1EA","\uD83C\uDDEE\uD83C\uDDF1":"1F1EE-1F1F1","\uD83C\uDDEF\uD83C\uDDF2":"1F1EF-1F1F2","\uD83C\uDDEF\uD83C\uDDF4":"1F1EF-1F1F4","\uD83C\uDDF0\uD83C\uDDFF":"1F1F0-1F1FF","\uD83C\uDDF0\uD83C\uDDEA":"1F1F0-1F1EA","\uD83C\uDDF0\uD83C\uDDEE":"1F1F0-1F1EE","\uD83C\uDDFD\uD83C\uDDF0":"1F1FD-1F1F0","\uD83C\uDDF0\uD83C\uDDFC":"1F1F0-1F1FC","\uD83C\uDDF0\uD83C\uDDEC":"1F1F0-1F1EC","\uD83C\uDDF1\uD83C\uDDE6":"1F1F1-1F1E6","\uD83C\uDDF1\uD83C\uDDFB":"1F1F1-1F1FB","\uD83C\uDDF1\uD83C\uDDE7":"1F1F1-1F1E7","\uD83C\uDDF1\uD83C\uDDF8":"1F1F1-1F1F8","\uD83C\uDDF1\uD83C\uDDF7":"1F1F1-1F1F7","\uD83C\uDDF1\uD83C\uDDFE":"1F1F1-1F1FE","\uD83C\uDDF1\uD83C\uDDEE":"1F1F1-1F1EE","\uD83C\uDDF1\uD83C\uDDF9":"1F1F1-1F1F9","\uD83C\uDDF1\uD83C\uDDFA":"1F1F1-1F1FA","\uD83C\uDDF2\uD83C\uDDF0":"1F1F2-1F1F0","\uD83C\uDDF2\uD83C\uDDEC":"1F1F2-1F1EC","\uD83C\uDDF2\uD83C\uDDFC":"1F1F2-1F1FC","\uD83C\uDDF2\uD83C\uDDFE":"1F1F2-1F1FE","\uD83C\uDDF2\uD83C\uDDFB":"1F1F2-1F1FB","\uD83C\uDDF2\uD83C\uDDF1":"1F1F2-1F1F1","\uD83C\uDDF2\uD83C\uDDF9":"1F1F2-1F1F9","\uD83C\uDDF2\uD83C\uDDED":"1F1F2-1F1ED","\uD83C\uDDF2\uD83C\uDDF7":"1F1F2-1F1F7","\uD83C\uDDF2\uD83C\uDDFA":"1F1F2-1F1FA","\uD83C\uDDF2\uD83C\uDDFD":"1F1F2-1F1FD","\uD83C\uDDEB\uD83C\uDDF2":"1F1EB-1F1F2","\uD83C\uDDF2\uD83C\uDDE9":"1F1F2-1F1E9","\uD83C\uDDF2\uD83C\uDDE8":"1F1F2-1F1E8","\uD83C\uDDF2\uD83C\uDDF3":"1F1F2-1F1F3","\uD83C\uDDF2\uD83C\uDDEA":"1F1F2-1F1EA","\uD83C\uDDF2\uD83C\uDDE6":"1F1F2-1F1E6","\uD83C\uDDF2\uD83C\uDDFF":"1F1F2-1F1FF","\uD83C\uDDF2\uD83C\uDDF2":"1F1F2-1F1F2","\uD83C\uDDF3\uD83C\uDDE6":"1F1F3-1F1E6","\uD83C\uDDF3\uD83C\uDDF7":"1F1F3-1F1F7","\uD83C\uDDF3\uD83C\uDDF5":"1F1F3-1F1F5","\uD83C\uDDF3\uD83C\uDDF1":"1F1F3-1F1F1","\uD83C\uDDF3\uD83C\uDDFF":"1F1F3-1F1FF","\uD83C\uDDF3\uD83C\uDDEE":"1F1F3-1F1EE","\uD83C\uDDF3\uD83C\uDDEA":"1F1F3-1F1EA","\uD83C\uDDF3\uD83C\uDDEC":"1F1F3-1F1EC","\uD83C\uDDF0\uD83C\uDDF5":"1F1F0-1F1F5","\uD83C\uDDF3\uD83C\uDDF4":"1F1F3-1F1F4","\uD83C\uDDF4\uD83C\uDDF2":"1F1F4-1F1F2","\uD83C\uDDF5\uD83C\uDDF0":"1F1F5-1F1F0","\uD83C\uDDF5\uD83C\uDDFC":"1F1F5-1F1FC","\uD83C\uDDF5\uD83C\uDDE6":"1F1F5-1F1E6","\uD83C\uDDF5\uD83C\uDDEC":"1F1F5-1F1EC","\uD83C\uDDF5\uD83C\uDDFE":"1F1F5-1F1FE","\uD83C\uDDF5\uD83C\uDDEA":"1F1F5-1F1EA","\uD83C\uDDF5\uD83C\uDDED":"1F1F5-1F1ED","\uD83C\uDDF5\uD83C\uDDF1":"1F1F5-1F1F1","\uD83C\uDDF5\uD83C\uDDF9":"1F1F5-1F1F9","\uD83C\uDDF6\uD83C\uDDE6":"1F1F6-1F1E6","\uD83C\uDDF9\uD83C\uDDFC":"1F1F9-1F1FC","\uD83C\uDDE8\uD83C\uDDEC":"1F1E8-1F1EC","\uD83C\uDDF7\uD83C\uDDF4":"1F1F7-1F1F4","\uD83C\uDDF7\uD83C\uDDFC":"1F1F7-1F1FC","\uD83C\uDDF0\uD83C\uDDF3":"1F1F0-1F1F3","\uD83C\uDDF1\uD83C\uDDE8":"1F1F1-1F1E8","\uD83C\uDDFB\uD83C\uDDE8":"1F1FB-1F1E8","\uD83C\uDDFC\uD83C\uDDF8":"1F1FC-1F1F8","\uD83C\uDDF8\uD83C\uDDF2":"1F1F8-1F1F2","\uD83C\uDDF8\uD83C\uDDF9":"1F1F8-1F1F9","\uD83C\uDDF8\uD83C\uDDE6":"1F1F8-1F1E6","\uD83C\uDDF8\uD83C\uDDF3":"1F1F8-1F1F3","\uD83C\uDDF7\uD83C\uDDF8":"1F1F7-1F1F8","\uD83C\uDDF8\uD83C\uDDE8":"1F1F8-1F1E8","\uD83C\uDDF8\uD83C\uDDF1":"1F1F8-1F1F1","\uD83C\uDDF8\uD83C\uDDEC":"1F1F8-1F1EC","\uD83C\uDDF8\uD83C\uDDF0":"1F1F8-1F1F0","\uD83C\uDDF8\uD83C\uDDEE":"1F1F8-1F1EE","\uD83C\uDDF8\uD83C\uDDE7":"1F1F8-1F1E7","\uD83C\uDDF8\uD83C\uDDF4":"1F1F8-1F1F4","\uD83C\uDDFF\uD83C\uDDE6":"1F1FF-1F1E6","\uD83C\uDDF1\uD83C\uDDF0":"1F1F1-1F1F0","\uD83C\uDDF8\uD83C\uDDE9":"1F1F8-1F1E9","\uD83C\uDDF8\uD83C\uDDF7":"1F1F8-1F1F7","\uD83C\uDDF8\uD83C\uDDFF":"1F1F8-1F1FF","\uD83C\uDDF8\uD83C\uDDEA":"1F1F8-1F1EA","\uD83C\uDDE8\uD83C\uDDED":"1F1E8-1F1ED","\uD83C\uDDF8\uD83C\uDDFE":"1F1F8-1F1FE","\uD83C\uDDF9\uD83C\uDDEF":"1F1F9-1F1EF","\uD83C\uDDF9\uD83C\uDDFF":"1F1F9-1F1FF","\uD83C\uDDF9\uD83C\uDDED":"1F1F9-1F1ED","\uD83C\uDDF9\uD83C\uDDEC":"1F1F9-1F1EC","\uD83C\uDDF9\uD83C\uDDF4":"1F1F9-1F1F4","\uD83C\uDDF9\uD83C\uDDF9":"1F1F9-1F1F9","\uD83C\uDDF9\uD83C\uDDF3":"1F1F9-1F1F3","\uD83C\uDDF9\uD83C\uDDF7":"1F1F9-1F1F7","\uD83C\uDDF9\uD83C\uDDF2":"1F1F9-1F1F2","\uD83C\uDDF9\uD83C\uDDFB":"1F1F9-1F1FB","\uD83C\uDDFA\uD83C\uDDEC":"1F1FA-1F1EC","\uD83C\uDDFA\uD83C\uDDE6":"1F1FA-1F1E6","\uD83C\uDDE6\uD83C\uDDEA":"1F1E6-1F1EA","\uD83C\uDDFA\uD83C\uDDFE":"1F1FA-1F1FE","\uD83C\uDDFA\uD83C\uDDFF":"1F1FA-1F1FF","\uD83C\uDDFB\uD83C\uDDFA":"1F1FB-1F1FA","\uD83C\uDDFB\uD83C\uDDE6":"1F1FB-1F1E6","\uD83C\uDDFB\uD83C\uDDEA":"1F1FB-1F1EA","\uD83C\uDDFB\uD83C\uDDF3":"1F1FB-1F1F3","\uD83C\uDDEA\uD83C\uDDED":"1F1EA-1F1ED","\uD83C\uDDFE\uD83C\uDDEA":"1F1FE-1F1EA","\uD83C\uDDFF\uD83C\uDDF2":"1F1FF-1F1F2","\uD83C\uDDFF\uD83C\uDDFC":"1F1FF-1F1FC","\uD83C\uDDF5\uD83C\uDDF7":"1F1F5-1F1F7","\uD83C\uDDF0\uD83C\uDDFE":"1F1F0-1F1FE","\uD83C\uDDE7\uD83C\uDDF2":"1F1E7-1F1F2","\uD83C\uDDF5\uD83C\uDDEB":"1F1F5-1F1EB","\uD83C\uDDF5\uD83C\uDDF8":"1F1F5-1F1F8","\uD83C\uDDF3\uD83C\uDDE8":"1F1F3-1F1E8","\uD83C\uDDF8\uD83C\uDDED":"1F1F8-1F1ED","\uD83C\uDDE6\uD83C\uDDFC":"1F1E6-1F1FC","\uD83C\uDDFB\uD83C\uDDEE":"1F1FB-1F1EE","\uD83C\uDDED\uD83C\uDDF0":"1F1ED-1F1F0","\uD83C\uDDE6\uD83C\uDDE8":"1F1E6-1F1E8","\uD83C\uDDF2\uD83C\uDDF8":"1F1F2-1F1F8","\uD83C\uDDEC\uD83C\uDDFA":"1F1EC-1F1FA","\uD83C\uDDEC\uD83C\uDDF1":"1F1EC-1F1F1","\uD83C\uDDF3\uD83C\uDDFA":"1F1F3-1F1FA","\uD83C\uDDFC\uD83C\uDDEB":"1F1FC-1F1EB","\uD83C\uDDF2\uD83C\uDDF4":"1F1F2-1F1F4","\uD83C\uDDEB\uD83C\uDDF4":"1F1EB-1F1F4","\uD83C\uDDEB\uD83C\uDDF0":"1F1EB-1F1F0","\uD83C\uDDEF\uD83C\uDDEA":"1F1EF-1F1EA","\uD83C\uDDE6\uD83C\uDDEE":"1F1E6-1F1EE","\uD83C\uDDEC\uD83C\uDDEE":"1F1EC-1F1EE"}; - ns.shortnameRegexp = ':([-+\\w]+):'; - ns.imagePathPNG = '//cdn.jsdelivr.net/emojione/assets/png/'; - ns.imagePathSVG = '//cdn.jsdelivr.net/emojione/assets/svg/'; - ns.imagePathSVGSprites = './../assets/sprites/emojione.sprites.svg'; - ns.imageType = 'png'; // or svg - ns.sprites = false; // if this is true then sprite markup will be used (if SVG image type is set then you must include the SVG sprite file locally) - ns.unicodeAlt = true; // use the unicode char as the alt attribute (makes copy and pasting the resulting text better) - ns.ascii = false; // change to true to convert ascii smileys - ns.cacheBustParam = '?v=1.2.4'; // you can [optionally] modify this to force browsers to refresh their cache. it will be appended to the send of the filenames - - ns.toImage = function(str) { - str = ns.unicodeToImage(str); - str = ns.shortnameToImage(str); - return str; - }; - - // Uses toShort to transform all unicode into a standard shortname - // then transforms the shortname into unicode - // This is done for standardization when converting several unicode types - ns.unifyUnicode = function(str) { - str = ns.toShort(str); - str = ns.shortnameToUnicode(str); - return str; - }; - - // Replace shortnames (:wink:) with Ascii equivalents ( ;^) ) - // Useful for systems that dont support unicode nor images - ns.shortnameToAscii = function(str) { - var unicode, - // something to keep in mind here is that array flip will destroy - // half of the ascii text "emojis" because the unicode numbers are duplicated - // this is ok for what it's being used for - unicodeToAscii = ns.objectFlip(ns.asciiList); - - str = str.replace(new RegExp("]*>.*?<\/object>|]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+ns.shortnameRegexp+")", "gi"),function(shortname) { - if( (typeof shortname === 'undefined') || (shortname === '') || (!(shortname in ns.emojioneList)) ) { - // if the shortname doesnt exist just return the entire match - return shortname; - } - else { - unicode = ns.emojioneList[shortname][ns.emojioneList[shortname].length-1].toLowerCase(); - if(typeof unicodeToAscii[unicode] !== 'undefined') { - return unicodeToAscii[unicode]; - } else { - return shortname; - } - } - }); - return str; - }; - - // will output unicode from shortname - // useful for sending emojis back to mobile devices - ns.shortnameToUnicode = function(str) { - // replace regular shortnames first - var unicode; - str = str.replace(new RegExp("]*>.*?<\/object>|]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+ns.shortnameRegexp+")", "gi"),function(shortname) { - if( (typeof shortname === 'undefined') || (shortname === '') || (!(shortname in ns.emojioneList)) ) { - // if the shortname doesnt exist just return the entire match - return shortname; - } - unicode = ns.emojioneList[shortname][ns.emojioneList[shortname].length-1].toUpperCase(); - return ns.convert(unicode); - }); - - // if ascii smileys are turned on, then we'll replace them! - if (ns.ascii) { - - str = str.replace(new RegExp("]*>.*?<\/object>|]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)"+ns.asciiRegexp+"(?=\\s|$|[!,\.]))","g"),function(entire, m1, m2, m3) { - if( (typeof m3 === 'undefined') || (m3 === '') || (!(ns.unescapeHTML(m3) in ns.asciiList)) ) { - // if the shortname doesnt exist just return the entire match - return entire; - } - - m3 = ns.unescapeHTML(m3); - unicode = ns.asciiList[m3].toUpperCase(); - return m2+ns.convert(unicode); - }); - } - - return str; - }; - - ns.shortnameToImage = function(str) { - // replace regular shortnames first - var replaceWith,unicode,alt; - str = str.replace(new RegExp("]*>.*?<\/object>|]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+ns.shortnameRegexp+")", "gi"),function(shortname) { - if( (typeof shortname === 'undefined') || (shortname === '') || (!(shortname in ns.emojioneList)) ) { - // if the shortname doesnt exist just return the entire match - return shortname; - } - else { - unicode = ns.emojioneList[shortname][ns.emojioneList[shortname].length-1].toUpperCase(); - - // depending on the settings, we'll either add the native unicode as the alt tag, otherwise the shortname - alt = (ns.unicodeAlt) ? ns.convert(unicode) : shortname; - - if(ns.imageType === 'png') { - if(ns.sprites) { - replaceWith = ''+alt+''; - } - else { - replaceWith = ''+alt+''; - } - } - else { - // svg - if(ns.sprites) { - replaceWith = ''+alt+''; - } - else { - replaceWith = ''+alt+''; - } - } - - return replaceWith; - } - }); - - // if ascii smileys are turned on, then we'll replace them! - if (ns.ascii) { - - str = str.replace(new RegExp("]*>.*?<\/object>|]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)"+ns.asciiRegexp+"(?=\\s|$|[!,\.]))","g"),function(entire, m1, m2, m3) { - if( (typeof m3 === 'undefined') || (m3 === '') || (!(ns.unescapeHTML(m3) in ns.asciiList)) ) { - // if the shortname doesnt exist just return the entire match - return entire; - } - - m3 = ns.unescapeHTML(m3); - unicode = ns.asciiList[m3].toUpperCase(); - - // depending on the settings, we'll either add the native unicode as the alt tag, otherwise the shortname - alt = (ns.unicodeAlt) ? ns.convert(unicode) : ns.escapeHTML(m3); - - if(ns.imageType === 'png') { - if(ns.sprites) { - replaceWith = m2+''+alt+''; - } - else { - replaceWith = m2+''+alt+''; - } - } - else { - // svg - if(ns.sprites) { - replaceWith = ''+alt+''; - } - else { - replaceWith = m2+''+alt+''; - } - } - - return replaceWith; - }); - } - - return str; - }; - - ns.unicodeToImage = function(str) { - - var replaceWith,unicode,alt; - - if((!ns.unicodeAlt) || (ns.sprites)) { - // if we are using the shortname as the alt tag then we need a reversed array to map unicode code point to shortnames - var mappedUnicode = ns.mapShortToUnicode(); - } - - str = str.replace(new RegExp("]*>.*?<\/object>|]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+ns.unicodeRegexp+")", "gi"),function(unicodeChar) { - if( (typeof unicodeChar === 'undefined') || (unicodeChar === '') || (!(unicodeChar in ns.jsecapeMap)) ) { - // if the unicodeChar doesnt exist just return the entire match - return unicodeChar; - } - else { - // get the unicode codepoint from the actual char - unicode = ns.jsecapeMap[unicodeChar]; - - // depending on the settings, we'll either add the native unicode as the alt tag, otherwise the shortname - alt = (ns.unicodeAlt) ? ns.convert(unicode) : mappedUnicode[unicode]; - - if(ns.imageType === 'png') { - if(ns.sprites) { - replaceWith = ''+alt+''; - } - else { - replaceWith = ''+alt+''; - } - } - else { - // svg - if(ns.sprites) { - replaceWith = ''+alt+''; - } - else { - replaceWith = ''+alt+''; - } - } - - return replaceWith; - } - }); - - return str; - }; - - // super simple loop to replace all unicode emoji to shortnames - // needs to be improved into one big replacement instead, for performance reasons - ns.toShort = function(str) { // this is really just unicodeToShortname() but I opted for the shorthand name to match toImage() - for (var shortcode in ns.emojioneList) { - if (!ns.emojioneList.hasOwnProperty(shortcode)) { continue; } - for (var ukey in ns.emojioneList[shortcode]) { - if (!ns.emojioneList[shortcode].hasOwnProperty(ukey)) { continue; } - var unicode = ns.emojioneList[shortcode][ukey].toUpperCase(); - str = ns.replaceAll(str,ns.convert(unicode),shortcode); - } - } - return str; - }; - - // for converting unicode code points and code pairs to their respective characters - ns.convert = function(unicode) { - if(unicode.indexOf("-") > -1) { - var parts = []; - var s = unicode.split('-'); - for(var i = 0; i < s.length; i++) { - var part = parseInt(s[i], 16); - if (part >= 0x10000 && part <= 0x10FFFF) { - var hi = Math.floor((part - 0x10000) / 0x400) + 0xD800; - var lo = ((part - 0x10000) % 0x400) + 0xDC00; - part = (String.fromCharCode(hi) + String.fromCharCode(lo)); - } - else { - part = String.fromCharCode(part); - } - parts.push(part); - } - return parts.join(''); - } - else { - var s = parseInt(unicode, 16); - if (s >= 0x10000 && s <= 0x10FFFF) { - var hi = Math.floor((s - 0x10000) / 0x400) + 0xD800; - var lo = ((s - 0x10000) % 0x400) + 0xDC00; - return (String.fromCharCode(hi) + String.fromCharCode(lo)); - } - else { - return String.fromCharCode(s); - } - } - }; - - ns.escapeHTML = function (string) { - var escaped = { - '&' : '&', - '<' : '<', - '>' : '>', - '"' : '"', - '\'': ''' - }; - - return string.replace(/[&<>"']/g, function (match) { - return escaped[match]; - }); - }; - ns.unescapeHTML = function (string) { - var unescaped = { - '&' : '&', - '&' : '&', - '&' : '&', - '<' : '<', - '<' : '<', - '<' : '<', - '>' : '>', - '>' : '>', - '>' : '>', - '"' : '"', - '"' : '"', - '"' : '"', - ''' : '\'', - ''' : '\'', - ''' : '\'' - }; - - return string.replace(/&(?:amp|#38|#x26|lt|#60|#x3C|gt|#62|#x3E|apos|#39|#x27|quot|#34|#x22);/ig, function (match) { - return unescaped[match]; - }); - }; - ns.mapShortToUnicode = function() { - var new_obj = {}; - for (var shortname in ns.emojioneList) { - if (!ns.emojioneList.hasOwnProperty(shortname)) { continue; } - for (var ukey in ns.emojioneList[shortname]) { - if (!ns.emojioneList[shortname].hasOwnProperty(ukey)) { continue; } - new_obj[ns.emojioneList[shortname][ukey].toUpperCase()] = shortname; - } - } - return new_obj; - }; - //reverse an object - ns.objectFlip = function (obj) { - var key, tmp_obj = {}; - - for (key in obj) { - if (obj.hasOwnProperty(key)) { - tmp_obj[obj[key]] = key; - } - } - - return tmp_obj; - }; - - ns.escapeRegExp = function(string) { - return string.replace(/[-[\]{}()*+?.,;:&\\^$|#\s]/g, "\\$&"); - }; - - ns.replaceAll = function(string, find, replaceWith) { - - var search = new RegExp("]*>.*?<\/object>|]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+find+")", "gi"); - - // callback prevents replacing anything inside of these common html tags as well as between an tag - var replace = function(entire, m1) { - return ((typeof m1 === 'undefined') || (m1 === '')) ? entire : replaceWith; - }; - - return string.replace(search,replace); - }; - -}(this.emojione = this.emojione || {})); -if(typeof module === "object") module.exports = this.emojione; diff --git a/pagure/static/emoji/emojione-1.3.1.min.js b/pagure/static/emoji/emojione-1.3.1.min.js deleted file mode 100644 index a4091d6..0000000 --- a/pagure/static/emoji/emojione-1.3.1.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! emojione 13-04-2015 */ -!function(a){a.emojioneList={":hash:":["0023-fe0f-20e3","0023-20e3"],":zero:":["0030-fe0f-20e3","0030-20e3"],":one:":["0031-fe0f-20e3","0031-20e3"],":two:":["0032-fe0f-20e3","0032-20e3"],":three:":["0033-fe0f-20e3","0033-20e3"],":four:":["0034-fe0f-20e3","0034-20e3"],":five:":["0035-fe0f-20e3","0035-20e3"],":six:":["0036-fe0f-20e3","0036-20e3"],":seven:":["0037-fe0f-20e3","0037-20e3"],":eight:":["0038-fe0f-20e3","0038-20e3"],":nine:":["0039-fe0f-20e3","0039-20e3"],":copyright:":["00a9"],":registered:":["00ae"],":bangbang:":["203c-fe0f","203c"],":interrobang:":["2049-fe0f","2049"],":tm:":["2122"],":information_source:":["2139-fe0f","2139"],":left_right_arrow:":["2194-fe0f","2194"],":arrow_up_down:":["2195-fe0f","2195"],":arrow_upper_left:":["2196-fe0f","2196"],":arrow_upper_right:":["2197-fe0f","2197"],":arrow_lower_right:":["2198-fe0f","2198"],":arrow_lower_left:":["2199-fe0f","2199"],":leftwards_arrow_with_hook:":["21a9-fe0f","21a9"],":arrow_right_hook:":["21aa-fe0f","21aa"],":watch:":["231a-fe0f","231a"],":hourglass:":["231b-fe0f","231b"],":fast_forward:":["23e9"],":rewind:":["23ea"],":arrow_double_up:":["23eb"],":arrow_double_down:":["23ec"],":alarm_clock:":["23f0"],":hourglass_flowing_sand:":["23f3"],":m:":["24c2-fe0f","24c2"],":black_small_square:":["25aa-fe0f","25aa"],":white_small_square:":["25ab-fe0f","25ab"],":arrow_forward:":["25b6-fe0f","25b6"],":arrow_backward:":["25c0-fe0f","25c0"],":white_medium_square:":["25fb-fe0f","25fb"],":black_medium_square:":["25fc-fe0f","25fc"],":white_medium_small_square:":["25fd-fe0f","25fd"],":black_medium_small_square:":["25fe-fe0f","25fe"],":sunny:":["2600-fe0f","2600"],":cloud:":["2601-fe0f","2601"],":telephone:":["260e-fe0f","260e"],":ballot_box_with_check:":["2611-fe0f","2611"],":umbrella:":["2614-fe0f","2614"],":coffee:":["2615-fe0f","2615"],":point_up:":["261d-fe0f","261d"],":relaxed:":["263a-fe0f","263a"],":aries:":["2648-fe0f","2648"],":taurus:":["2649-fe0f","2649"],":gemini:":["264a-fe0f","264a"],":cancer:":["264b-fe0f","264b"],":leo:":["264c-fe0f","264c"],":virgo:":["264d-fe0f","264d"],":libra:":["264e-fe0f","264e"],":scorpius:":["264f-fe0f","264f"],":sagittarius:":["2650-fe0f","2650"],":capricorn:":["2651-fe0f","2651"],":aquarius:":["2652-fe0f","2652"],":pisces:":["2653-fe0f","2653"],":spades:":["2660-fe0f","2660"],":clubs:":["2663-fe0f","2663"],":hearts:":["2665-fe0f","2665"],":diamonds:":["2666-fe0f","2666"],":hotsprings:":["2668-fe0f","2668"],":recycle:":["267b-fe0f","267b"],":wheelchair:":["267f-fe0f","267f"],":anchor:":["2693-fe0f","2693"],":warning:":["26a0-fe0f","26a0"],":zap:":["26a1-fe0f","26a1"],":white_circle:":["26aa-fe0f","26aa"],":black_circle:":["26ab-fe0f","26ab"],":soccer:":["26bd-fe0f","26bd"],":baseball:":["26be-fe0f","26be"],":snowman:":["26c4-fe0f","26c4"],":partly_sunny:":["26c5-fe0f","26c5"],":ophiuchus:":["26ce"],":no_entry:":["26d4-fe0f","26d4"],":church:":["26ea-fe0f","26ea"],":fountain:":["26f2-fe0f","26f2"],":golf:":["26f3-fe0f","26f3"],":sailboat:":["26f5-fe0f","26f5"],":tent:":["26fa-fe0f","26fa"],":fuelpump:":["26fd-fe0f","26fd"],":scissors:":["2702-fe0f","2702"],":white_check_mark:":["2705"],":airplane:":["2708-fe0f","2708"],":envelope:":["2709-fe0f","2709"],":fist:":["270a"],":raised_hand:":["270b"],":v:":["270c-fe0f","270c"],":pencil2:":["270f-fe0f","270f"],":black_nib:":["2712-fe0f","2712"],":heavy_check_mark:":["2714-fe0f","2714"],":heavy_multiplication_x:":["2716-fe0f","2716"],":sparkles:":["2728"],":eight_spoked_asterisk:":["2733-fe0f","2733"],":eight_pointed_black_star:":["2734-fe0f","2734"],":snowflake:":["2744-fe0f","2744"],":sparkle:":["2747-fe0f","2747"],":x:":["274c"],":negative_squared_cross_mark:":["274e"],":question:":["2753"],":grey_question:":["2754"],":grey_exclamation:":["2755"],":exclamation:":["2757-fe0f","2757"],":heart:":["2764-fe0f","2764"],":heavy_plus_sign:":["2795"],":heavy_minus_sign:":["2796"],":heavy_division_sign:":["2797"],":arrow_right:":["27a1-fe0f","27a1"],":curly_loop:":["27b0"],":arrow_heading_up:":["2934-fe0f","2934"],":arrow_heading_down:":["2935-fe0f","2935"],":arrow_left:":["2b05-fe0f","2b05"],":arrow_up:":["2b06-fe0f","2b06"],":arrow_down:":["2b07-fe0f","2b07"],":black_large_square:":["2b1b-fe0f","2b1b"],":white_large_square:":["2b1c-fe0f","2b1c"],":star:":["2b50-fe0f","2b50"],":o:":["2b55-fe0f","2b55"],":wavy_dash:":["3030"],":part_alternation_mark:":["303d-fe0f","303d"],":congratulations:":["3297-fe0f","3297"],":secret:":["3299-fe0f","3299"],":mahjong:":["1f004-fe0f","1f004"],":black_joker:":["1f0cf"],":a:":["1f170"],":b:":["1f171"],":o2:":["1f17e"],":parking:":["1f17f-fe0f","1f17f"],":ab:":["1f18e"],":cl:":["1f191"],":cool:":["1f192"],":free:":["1f193"],":id:":["1f194"],":new:":["1f195"],":ng:":["1f196"],":ok:":["1f197"],":sos:":["1f198"],":up:":["1f199"],":vs:":["1f19a"],":cn:":["1f1e8-1f1f3"],":de:":["1f1e9-1f1ea"],":es:":["1f1ea-1f1f8"],":fr:":["1f1eb-1f1f7"],":gb:":["1f1ec-1f1e7"],":it:":["1f1ee-1f1f9"],":jp:":["1f1ef-1f1f5"],":kr:":["1f1f0-1f1f7"],":us:":["1f1fa-1f1f8"],":ru:":["1f1f7-1f1fa"],":koko:":["1f201"],":sa:":["1f202"],":u7121:":["1f21a-fe0f","1f21a"],":u6307:":["1f22f-fe0f","1f22f"],":u7981:":["1f232"],":u7a7a:":["1f233"],":u5408:":["1f234"],":u6e80:":["1f235"],":u6709:":["1f236"],":u6708:":["1f237"],":u7533:":["1f238"],":u5272:":["1f239"],":u55b6:":["1f23a"],":ideograph_advantage:":["1f250"],":accept:":["1f251"],":cyclone:":["1f300"],":foggy:":["1f301"],":closed_umbrella:":["1f302"],":night_with_stars:":["1f303"],":sunrise_over_mountains:":["1f304"],":sunrise:":["1f305"],":city_dusk:":["1f306"],":city_sunset:":["1f307"],":city_sunrise:":["1f307"],":rainbow:":["1f308"],":bridge_at_night:":["1f309"],":ocean:":["1f30a"],":volcano:":["1f30b"],":milky_way:":["1f30c"],":earth_asia:":["1f30f"],":new_moon:":["1f311"],":first_quarter_moon:":["1f313"],":waxing_gibbous_moon:":["1f314"],":full_moon:":["1f315"],":crescent_moon:":["1f319"],":first_quarter_moon_with_face:":["1f31b"],":star2:":["1f31f"],":stars:":["1f320"],":chestnut:":["1f330"],":seedling:":["1f331"],":palm_tree:":["1f334"],":cactus:":["1f335"],":tulip:":["1f337"],":cherry_blossom:":["1f338"],":rose:":["1f339"],":hibiscus:":["1f33a"],":sunflower:":["1f33b"],":blossom:":["1f33c"],":corn:":["1f33d"],":ear_of_rice:":["1f33e"],":herb:":["1f33f"],":four_leaf_clover:":["1f340"],":maple_leaf:":["1f341"],":fallen_leaf:":["1f342"],":leaves:":["1f343"],":mushroom:":["1f344"],":tomato:":["1f345"],":eggplant:":["1f346"],":grapes:":["1f347"],":melon:":["1f348"],":watermelon:":["1f349"],":tangerine:":["1f34a"],":banana:":["1f34c"],":pineapple:":["1f34d"],":apple:":["1f34e"],":green_apple:":["1f34f"],":peach:":["1f351"],":cherries:":["1f352"],":strawberry:":["1f353"],":hamburger:":["1f354"],":pizza:":["1f355"],":meat_on_bone:":["1f356"],":poultry_leg:":["1f357"],":rice_cracker:":["1f358"],":rice_ball:":["1f359"],":rice:":["1f35a"],":curry:":["1f35b"],":ramen:":["1f35c"],":spaghetti:":["1f35d"],":bread:":["1f35e"],":fries:":["1f35f"],":sweet_potato:":["1f360"],":dango:":["1f361"],":oden:":["1f362"],":sushi:":["1f363"],":fried_shrimp:":["1f364"],":fish_cake:":["1f365"],":icecream:":["1f366"],":shaved_ice:":["1f367"],":ice_cream:":["1f368"],":doughnut:":["1f369"],":cookie:":["1f36a"],":chocolate_bar:":["1f36b"],":candy:":["1f36c"],":lollipop:":["1f36d"],":custard:":["1f36e"],":honey_pot:":["1f36f"],":cake:":["1f370"],":bento:":["1f371"],":stew:":["1f372"],":egg:":["1f373"],":fork_and_knife:":["1f374"],":tea:":["1f375"],":sake:":["1f376"],":wine_glass:":["1f377"],":cocktail:":["1f378"],":tropical_drink:":["1f379"],":beer:":["1f37a"],":beers:":["1f37b"],":ribbon:":["1f380"],":gift:":["1f381"],":birthday:":["1f382"],":jack_o_lantern:":["1f383"],":christmas_tree:":["1f384"],":santa:":["1f385"],":fireworks:":["1f386"],":sparkler:":["1f387"],":balloon:":["1f388"],":tada:":["1f389"],":confetti_ball:":["1f38a"],":tanabata_tree:":["1f38b"],":crossed_flags:":["1f38c"],":bamboo:":["1f38d"],":dolls:":["1f38e"],":flags:":["1f38f"],":wind_chime:":["1f390"],":rice_scene:":["1f391"],":school_satchel:":["1f392"],":mortar_board:":["1f393"],":carousel_horse:":["1f3a0"],":ferris_wheel:":["1f3a1"],":roller_coaster:":["1f3a2"],":fishing_pole_and_fish:":["1f3a3"],":microphone:":["1f3a4"],":movie_camera:":["1f3a5"],":cinema:":["1f3a6"],":headphones:":["1f3a7"],":art:":["1f3a8"],":tophat:":["1f3a9"],":circus_tent:":["1f3aa"],":ticket:":["1f3ab"],":clapper:":["1f3ac"],":performing_arts:":["1f3ad"],":video_game:":["1f3ae"],":dart:":["1f3af"],":slot_machine:":["1f3b0"],":8ball:":["1f3b1"],":game_die:":["1f3b2"],":bowling:":["1f3b3"],":flower_playing_cards:":["1f3b4"],":musical_note:":["1f3b5"],":notes:":["1f3b6"],":saxophone:":["1f3b7"],":guitar:":["1f3b8"],":musical_keyboard:":["1f3b9"],":trumpet:":["1f3ba"],":violin:":["1f3bb"],":musical_score:":["1f3bc"],":running_shirt_with_sash:":["1f3bd"],":tennis:":["1f3be"],":ski:":["1f3bf"],":basketball:":["1f3c0"],":checkered_flag:":["1f3c1"],":snowboarder:":["1f3c2"],":runner:":["1f3c3"],":surfer:":["1f3c4"],":trophy:":["1f3c6"],":football:":["1f3c8"],":swimmer:":["1f3ca"],":house:":["1f3e0"],":house_with_garden:":["1f3e1"],":office:":["1f3e2"],":post_office:":["1f3e3"],":hospital:":["1f3e5"],":bank:":["1f3e6"],":atm:":["1f3e7"],":hotel:":["1f3e8"],":love_hotel:":["1f3e9"],":convenience_store:":["1f3ea"],":school:":["1f3eb"],":department_store:":["1f3ec"],":factory:":["1f3ed"],":izakaya_lantern:":["1f3ee"],":japanese_castle:":["1f3ef"],":european_castle:":["1f3f0"],":snail:":["1f40c"],":snake:":["1f40d"],":racehorse:":["1f40e"],":sheep:":["1f411"],":monkey:":["1f412"],":chicken:":["1f414"],":boar:":["1f417"],":elephant:":["1f418"],":octopus:":["1f419"],":shell:":["1f41a"],":bug:":["1f41b"],":ant:":["1f41c"],":bee:":["1f41d"],":beetle:":["1f41e"],":fish:":["1f41f"],":tropical_fish:":["1f420"],":blowfish:":["1f421"],":turtle:":["1f422"],":hatching_chick:":["1f423"],":baby_chick:":["1f424"],":hatched_chick:":["1f425"],":bird:":["1f426"],":penguin:":["1f427"],":koala:":["1f428"],":poodle:":["1f429"],":camel:":["1f42b"],":dolphin:":["1f42c"],":mouse:":["1f42d"],":cow:":["1f42e"],":tiger:":["1f42f"],":rabbit:":["1f430"],":cat:":["1f431"],":dragon_face:":["1f432"],":whale:":["1f433"],":horse:":["1f434"],":monkey_face:":["1f435"],":dog:":["1f436"],":pig:":["1f437"],":frog:":["1f438"],":hamster:":["1f439"],":wolf:":["1f43a"],":bear:":["1f43b"],":panda_face:":["1f43c"],":pig_nose:":["1f43d"],":feet:":["1f43e"],":eyes:":["1f440"],":ear:":["1f442"],":nose:":["1f443"],":lips:":["1f444"],":tongue:":["1f445"],":point_up_2:":["1f446"],":point_down:":["1f447"],":point_left:":["1f448"],":point_right:":["1f449"],":punch:":["1f44a"],":wave:":["1f44b"],":ok_hand:":["1f44c"],":thumbsup:":["1f44d"],":+1:":["1f44d"],":thumbsdown:":["1f44e"],":-1:":["1f44e"],":clap:":["1f44f"],":open_hands:":["1f450"],":crown:":["1f451"],":womans_hat:":["1f452"],":eyeglasses:":["1f453"],":necktie:":["1f454"],":shirt:":["1f455"],":jeans:":["1f456"],":dress:":["1f457"],":kimono:":["1f458"],":bikini:":["1f459"],":womans_clothes:":["1f45a"],":purse:":["1f45b"],":handbag:":["1f45c"],":pouch:":["1f45d"],":mans_shoe:":["1f45e"],":athletic_shoe:":["1f45f"],":high_heel:":["1f460"],":sandal:":["1f461"],":boot:":["1f462"],":footprints:":["1f463"],":bust_in_silhouette:":["1f464"],":boy:":["1f466"],":girl:":["1f467"],":man:":["1f468"],":woman:":["1f469"],":family:":["1f46a"],":couple:":["1f46b"],":cop:":["1f46e"],":dancers:":["1f46f"],":bride_with_veil:":["1f470"],":person_with_blond_hair:":["1f471"],":man_with_gua_pi_mao:":["1f472"],":man_with_turban:":["1f473"],":older_man:":["1f474"],":older_woman:":["1f475"],":grandma:":["1f475"],":baby:":["1f476"],":construction_worker:":["1f477"],":princess:":["1f478"],":japanese_ogre:":["1f479"],":japanese_goblin:":["1f47a"],":ghost:":["1f47b"],":angel:":["1f47c"],":alien:":["1f47d"],":space_invader:":["1f47e"],":imp:":["1f47f"],":skull:":["1f480"],":skeleton:":["1f480"],":card_index:":["1f4c7"],":information_desk_person:":["1f481"],":guardsman:":["1f482"],":dancer:":["1f483"],":lipstick:":["1f484"],":nail_care:":["1f485"],":ledger:":["1f4d2"],":massage:":["1f486"],":notebook:":["1f4d3"],":haircut:":["1f487"],":notebook_with_decorative_cover:":["1f4d4"],":barber:":["1f488"],":closed_book:":["1f4d5"],":syringe:":["1f489"],":book:":["1f4d6"],":pill:":["1f48a"],":green_book:":["1f4d7"],":kiss:":["1f48b"],":blue_book:":["1f4d8"],":love_letter:":["1f48c"],":orange_book:":["1f4d9"],":ring:":["1f48d"],":books:":["1f4da"],":gem:":["1f48e"],":name_badge:":["1f4db"],":couplekiss:":["1f48f"],":scroll:":["1f4dc"],":bouquet:":["1f490"],":pencil:":["1f4dd"],":couple_with_heart:":["1f491"],":telephone_receiver:":["1f4de"],":wedding:":["1f492"],":pager:":["1f4df"],":fax:":["1f4e0"],":heartbeat:":["1f493"],":satellite:":["1f4e1"],":loudspeaker:":["1f4e2"],":broken_heart:":["1f494"],":mega:":["1f4e3"],":outbox_tray:":["1f4e4"],":two_hearts:":["1f495"],":inbox_tray:":["1f4e5"],":package:":["1f4e6"],":sparkling_heart:":["1f496"],":e-mail:":["1f4e7"],":email:":["1f4e7"],":incoming_envelope:":["1f4e8"],":heartpulse:":["1f497"],":envelope_with_arrow:":["1f4e9"],":mailbox_closed:":["1f4ea"],":cupid:":["1f498"],":mailbox:":["1f4eb"],":postbox:":["1f4ee"],":blue_heart:":["1f499"],":newspaper:":["1f4f0"],":iphone:":["1f4f1"],":green_heart:":["1f49a"],":calling:":["1f4f2"],":vibration_mode:":["1f4f3"],":yellow_heart:":["1f49b"],":mobile_phone_off:":["1f4f4"],":signal_strength:":["1f4f6"],":purple_heart:":["1f49c"],":camera:":["1f4f7"],":video_camera:":["1f4f9"],":gift_heart:":["1f49d"],":tv:":["1f4fa"],":radio:":["1f4fb"],":revolving_hearts:":["1f49e"],":vhs:":["1f4fc"],":arrows_clockwise:":["1f503"],":heart_decoration:":["1f49f"],":loud_sound:":["1f50a"],":battery:":["1f50b"],":diamond_shape_with_a_dot_inside:":["1f4a0"],":electric_plug:":["1f50c"],":mag:":["1f50d"],":bulb:":["1f4a1"],":mag_right:":["1f50e"],":lock_with_ink_pen:":["1f50f"],":anger:":["1f4a2"],":closed_lock_with_key:":["1f510"],":key:":["1f511"],":bomb:":["1f4a3"],":lock:":["1f512"],":unlock:":["1f513"],":zzz:":["1f4a4"],":bell:":["1f514"],":bookmark:":["1f516"],":boom:":["1f4a5"],":link:":["1f517"],":radio_button:":["1f518"],":sweat_drops:":["1f4a6"],":back:":["1f519"],":end:":["1f51a"],":droplet:":["1f4a7"],":on:":["1f51b"],":soon:":["1f51c"],":dash:":["1f4a8"],":top:":["1f51d"],":underage:":["1f51e"],":poop:":["1f4a9"],":shit:":["1f4a9"],":hankey:":["1f4a9"],":poo:":["1f4a9"],":keycap_ten:":["1f51f"],":muscle:":["1f4aa"],":capital_abcd:":["1f520"],":abcd:":["1f521"],":dizzy:":["1f4ab"],":1234:":["1f522"],":symbols:":["1f523"],":speech_balloon:":["1f4ac"],":abc:":["1f524"],":fire:":["1f525"],":flame:":["1f525"],":white_flower:":["1f4ae"],":flashlight:":["1f526"],":wrench:":["1f527"],":100:":["1f4af"],":hammer:":["1f528"],":nut_and_bolt:":["1f529"],":moneybag:":["1f4b0"],":knife:":["1f52a"],":gun:":["1f52b"],":currency_exchange:":["1f4b1"],":crystal_ball:":["1f52e"],":heavy_dollar_sign:":["1f4b2"],":six_pointed_star:":["1f52f"],":credit_card:":["1f4b3"],":beginner:":["1f530"],":trident:":["1f531"],":yen:":["1f4b4"],":black_square_button:":["1f532"],":white_square_button:":["1f533"],":dollar:":["1f4b5"],":red_circle:":["1f534"],":large_blue_circle:":["1f535"],":money_with_wings:":["1f4b8"],":large_orange_diamond:":["1f536"],":large_blue_diamond:":["1f537"],":chart:":["1f4b9"],":small_orange_diamond:":["1f538"],":small_blue_diamond:":["1f539"],":seat:":["1f4ba"],":small_red_triangle:":["1f53a"],":small_red_triangle_down:":["1f53b"],":computer:":["1f4bb"],":arrow_up_small:":["1f53c"],":briefcase:":["1f4bc"],":arrow_down_small:":["1f53d"],":clock1:":["1f550"],":minidisc:":["1f4bd"],":clock2:":["1f551"],":floppy_disk:":["1f4be"],":clock3:":["1f552"],":cd:":["1f4bf"],":clock4:":["1f553"],":dvd:":["1f4c0"],":clock5:":["1f554"],":clock6:":["1f555"],":file_folder:":["1f4c1"],":clock7:":["1f556"],":clock8:":["1f557"],":open_file_folder:":["1f4c2"],":clock9:":["1f558"],":clock10:":["1f559"],":page_with_curl:":["1f4c3"],":clock11:":["1f55a"],":clock12:":["1f55b"],":page_facing_up:":["1f4c4"],":mount_fuji:":["1f5fb"],":tokyo_tower:":["1f5fc"],":date:":["1f4c5"],":statue_of_liberty:":["1f5fd"],":japan:":["1f5fe"],":calendar:":["1f4c6"],":moyai:":["1f5ff"],":grin:":["1f601"],":joy:":["1f602"],":smiley:":["1f603"],":chart_with_upwards_trend:":["1f4c8"],":smile:":["1f604"],":sweat_smile:":["1f605"],":chart_with_downwards_trend:":["1f4c9"],":laughing:":["1f606"],":satisfied:":["1f606"],":wink:":["1f609"],":bar_chart:":["1f4ca"],":blush:":["1f60a"],":yum:":["1f60b"],":clipboard:":["1f4cb"],":relieved:":["1f60c"],":heart_eyes:":["1f60d"],":pushpin:":["1f4cc"],":smirk:":["1f60f"],":unamused:":["1f612"],":round_pushpin:":["1f4cd"],":sweat:":["1f613"],":pensive:":["1f614"],":paperclip:":["1f4ce"],":confounded:":["1f616"],":kissing_heart:":["1f618"],":straight_ruler:":["1f4cf"],":kissing_closed_eyes:":["1f61a"],":stuck_out_tongue_winking_eye:":["1f61c"],":triangular_ruler:":["1f4d0"],":stuck_out_tongue_closed_eyes:":["1f61d"],":disappointed:":["1f61e"],":bookmark_tabs:":["1f4d1"],":angry:":["1f620"],":rage:":["1f621"],":cry:":["1f622"],":persevere:":["1f623"],":triumph:":["1f624"],":disappointed_relieved:":["1f625"],":fearful:":["1f628"],":weary:":["1f629"],":sleepy:":["1f62a"],":tired_face:":["1f62b"],":sob:":["1f62d"],":cold_sweat:":["1f630"],":scream:":["1f631"],":astonished:":["1f632"],":flushed:":["1f633"],":dizzy_face:":["1f635"],":mask:":["1f637"],":smile_cat:":["1f638"],":joy_cat:":["1f639"],":smiley_cat:":["1f63a"],":heart_eyes_cat:":["1f63b"],":smirk_cat:":["1f63c"],":kissing_cat:":["1f63d"],":pouting_cat:":["1f63e"],":crying_cat_face:":["1f63f"],":scream_cat:":["1f640"],":no_good:":["1f645"],":ok_woman:":["1f646"],":bow:":["1f647"],":see_no_evil:":["1f648"],":hear_no_evil:":["1f649"],":speak_no_evil:":["1f64a"],":raising_hand:":["1f64b"],":raised_hands:":["1f64c"],":person_frowning:":["1f64d"],":person_with_pouting_face:":["1f64e"],":pray:":["1f64f"],":rocket:":["1f680"],":railway_car:":["1f683"],":bullettrain_side:":["1f684"],":bullettrain_front:":["1f685"],":metro:":["1f687"],":station:":["1f689"],":bus:":["1f68c"],":busstop:":["1f68f"],":ambulance:":["1f691"],":fire_engine:":["1f692"],":police_car:":["1f693"],":taxi:":["1f695"],":red_car:":["1f697"],":blue_car:":["1f699"],":truck:":["1f69a"],":ship:":["1f6a2"],":speedboat:":["1f6a4"],":traffic_light:":["1f6a5"],":construction:":["1f6a7"],":rotating_light:":["1f6a8"],":triangular_flag_on_post:":["1f6a9"],":door:":["1f6aa"],":no_entry_sign:":["1f6ab"],":smoking:":["1f6ac"],":no_smoking:":["1f6ad"],":bike:":["1f6b2"],":walking:":["1f6b6"],":mens:":["1f6b9"],":womens:":["1f6ba"],":restroom:":["1f6bb"],":baby_symbol:":["1f6bc"],":toilet:":["1f6bd"],":wc:":["1f6be"],":bath:":["1f6c0"],":grinning:":["1f600"],":innocent:":["1f607"],":smiling_imp:":["1f608"],":sunglasses:":["1f60e"],":neutral_face:":["1f610"],":expressionless:":["1f611"],":confused:":["1f615"],":kissing:":["1f617"],":kissing_smiling_eyes:":["1f619"],":stuck_out_tongue:":["1f61b"],":worried:":["1f61f"],":frowning:":["1f626"],":anguished:":["1f627"],":grimacing:":["1f62c"],":open_mouth:":["1f62e"],":hushed:":["1f62f"],":sleeping:":["1f634"],":no_mouth:":["1f636"],":helicopter:":["1f681"],":steam_locomotive:":["1f682"],":train2:":["1f686"],":light_rail:":["1f688"],":tram:":["1f68a"],":oncoming_bus:":["1f68d"],":trolleybus:":["1f68e"],":minibus:":["1f690"],":oncoming_police_car:":["1f694"],":oncoming_taxi:":["1f696"],":oncoming_automobile:":["1f698"],":articulated_lorry:":["1f69b"],":tractor:":["1f69c"],":monorail:":["1f69d"],":mountain_railway:":["1f69e"],":suspension_railway:":["1f69f"],":mountain_cableway:":["1f6a0"],":aerial_tramway:":["1f6a1"],":rowboat:":["1f6a3"],":vertical_traffic_light:":["1f6a6"],":put_litter_in_its_place:":["1f6ae"],":do_not_litter:":["1f6af"],":potable_water:":["1f6b0"],":non-potable_water:":["1f6b1"],":no_bicycles:":["1f6b3"],":bicyclist:":["1f6b4"],":mountain_bicyclist:":["1f6b5"],":no_pedestrians:":["1f6b7"],":children_crossing:":["1f6b8"],":shower:":["1f6bf"],":bathtub:":["1f6c1"],":passport_control:":["1f6c2"],":customs:":["1f6c3"],":baggage_claim:":["1f6c4"],":left_luggage:":["1f6c5"],":earth_africa:":["1f30d"],":earth_americas:":["1f30e"],":globe_with_meridians:":["1f310"],":waxing_crescent_moon:":["1f312"],":waning_gibbous_moon:":["1f316"],":last_quarter_moon:":["1f317"],":waning_crescent_moon:":["1f318"],":new_moon_with_face:":["1f31a"],":last_quarter_moon_with_face:":["1f31c"],":full_moon_with_face:":["1f31d"],":sun_with_face:":["1f31e"],":evergreen_tree:":["1f332"],":deciduous_tree:":["1f333"],":lemon:":["1f34b"],":pear:":["1f350"],":baby_bottle:":["1f37c"],":horse_racing:":["1f3c7"],":rugby_football:":["1f3c9"],":european_post_office:":["1f3e4"],":rat:":["1f400"],":mouse2:":["1f401"],":ox:":["1f402"],":water_buffalo:":["1f403"],":cow2:":["1f404"],":tiger2:":["1f405"],":leopard:":["1f406"],":rabbit2:":["1f407"],":cat2:":["1f408"],":dragon:":["1f409"],":crocodile:":["1f40a"],":whale2:":["1f40b"],":ram:":["1f40f"],":goat:":["1f410"],":rooster:":["1f413"],":dog2:":["1f415"],":pig2:":["1f416"],":dromedary_camel:":["1f42a"],":busts_in_silhouette:":["1f465"],":two_men_holding_hands:":["1f46c"],":two_women_holding_hands:":["1f46d"],":thought_balloon:":["1f4ad"],":euro:":["1f4b6"],":pound:":["1f4b7"],":mailbox_with_mail:":["1f4ec"],":mailbox_with_no_mail:":["1f4ed"],":postal_horn:":["1f4ef"],":no_mobile_phones:":["1f4f5"],":twisted_rightwards_arrows:":["1f500"],":repeat:":["1f501"],":repeat_one:":["1f502"],":arrows_counterclockwise:":["1f504"],":low_brightness:":["1f505"],":high_brightness:":["1f506"],":mute:":["1f507"],":sound:":["1f509"],":no_bell:":["1f515"],":microscope:":["1f52c"],":telescope:":["1f52d"],":clock130:":["1f55c"],":clock230:":["1f55d"],":clock330:":["1f55e"],":clock430:":["1f55f"],":clock530:":["1f560"],":clock630:":["1f561"],":clock730:":["1f562"],":clock830:":["1f563"],":clock930:":["1f564"],":clock1030:":["1f565"],":clock1130:":["1f566"],":clock1230:":["1f567"],":speaker:":["1f508"],":train:":["1f68b"],":loop:":["27bf"],":af:":["1f1e6-1f1eb"],":al:":["1f1e6-1f1f1"],":dz:":["1f1e9-1f1ff"],":ad:":["1f1e6-1f1e9"],":ao:":["1f1e6-1f1f4"],":ag:":["1f1e6-1f1ec"],":ar:":["1f1e6-1f1f7"],":am:":["1f1e6-1f1f2"],":au:":["1f1e6-1f1fa"],":at:":["1f1e6-1f1f9"],":az:":["1f1e6-1f1ff"],":bs:":["1f1e7-1f1f8"],":bh:":["1f1e7-1f1ed"],":bd:":["1f1e7-1f1e9"],":bb:":["1f1e7-1f1e7"],":by:":["1f1e7-1f1fe"],":be:":["1f1e7-1f1ea"],":bz:":["1f1e7-1f1ff"],":bj:":["1f1e7-1f1ef"],":bt:":["1f1e7-1f1f9"],":bo:":["1f1e7-1f1f4"],":ba:":["1f1e7-1f1e6"],":bw:":["1f1e7-1f1fc"],":br:":["1f1e7-1f1f7"],":bn:":["1f1e7-1f1f3"],":bg:":["1f1e7-1f1ec"],":bf:":["1f1e7-1f1eb"],":bi:":["1f1e7-1f1ee"],":kh:":["1f1f0-1f1ed"],":cm:":["1f1e8-1f1f2"],":ca:":["1f1e8-1f1e6"],":cv:":["1f1e8-1f1fb"],":cf:":["1f1e8-1f1eb"],":td:":["1f1f9-1f1e9"],":chile:":["1f1e8-1f1f1"],":co:":["1f1e8-1f1f4"],":km:":["1f1f0-1f1f2"],":cr:":["1f1e8-1f1f7"],":ci:":["1f1e8-1f1ee"],":hr:":["1f1ed-1f1f7"],":cu:":["1f1e8-1f1fa"],":cy:":["1f1e8-1f1fe"],":cz:":["1f1e8-1f1ff"],":congo:":["1f1e8-1f1e9"],":dk:":["1f1e9-1f1f0"],":dj:":["1f1e9-1f1ef"],":dm:":["1f1e9-1f1f2"],":do:":["1f1e9-1f1f4"],":tl:":["1f1f9-1f1f1"],":ec:":["1f1ea-1f1e8"],":eg:":["1f1ea-1f1ec"],":sv:":["1f1f8-1f1fb"],":gq:":["1f1ec-1f1f6"],":er:":["1f1ea-1f1f7"],":ee:":["1f1ea-1f1ea"],":et:":["1f1ea-1f1f9"],":fj:":["1f1eb-1f1ef"],":fi:":["1f1eb-1f1ee"],":ga:":["1f1ec-1f1e6"],":gm:":["1f1ec-1f1f2"],":ge:":["1f1ec-1f1ea"],":gh:":["1f1ec-1f1ed"],":gr:":["1f1ec-1f1f7"],":gd:":["1f1ec-1f1e9"],":gt:":["1f1ec-1f1f9"],":gn:":["1f1ec-1f1f3"],":gw:":["1f1ec-1f1fc"],":gy:":["1f1ec-1f1fe"],":ht:":["1f1ed-1f1f9"],":hn:":["1f1ed-1f1f3"],":hu:":["1f1ed-1f1fa"],":is:":["1f1ee-1f1f8"],":in:":["1f1ee-1f1f3"],":indonesia:":["1f1ee-1f1e9"],":ir:":["1f1ee-1f1f7"],":iq:":["1f1ee-1f1f6"],":ie:":["1f1ee-1f1ea"],":il:":["1f1ee-1f1f1"],":jm:":["1f1ef-1f1f2"],":jo:":["1f1ef-1f1f4"],":kz:":["1f1f0-1f1ff"],":ke:":["1f1f0-1f1ea"],":ki:":["1f1f0-1f1ee"],":xk:":["1f1fd-1f1f0"],":kw:":["1f1f0-1f1fc"],":kg:":["1f1f0-1f1ec"],":la:":["1f1f1-1f1e6"],":lv:":["1f1f1-1f1fb"],":lb:":["1f1f1-1f1e7"],":ls:":["1f1f1-1f1f8"],":lr:":["1f1f1-1f1f7"],":ly:":["1f1f1-1f1fe"],":li:":["1f1f1-1f1ee"],":lt:":["1f1f1-1f1f9"],":lu:":["1f1f1-1f1fa"],":mk:":["1f1f2-1f1f0"],":mg:":["1f1f2-1f1ec"],":mw:":["1f1f2-1f1fc"],":my:":["1f1f2-1f1fe"],":mv:":["1f1f2-1f1fb"],":ml:":["1f1f2-1f1f1"],":mt:":["1f1f2-1f1f9"],":mh:":["1f1f2-1f1ed"],":mr:":["1f1f2-1f1f7"],":mu:":["1f1f2-1f1fa"],":mx:":["1f1f2-1f1fd"],":fm:":["1f1eb-1f1f2"],":md:":["1f1f2-1f1e9"],":mc:":["1f1f2-1f1e8"],":mn:":["1f1f2-1f1f3"],":me:":["1f1f2-1f1ea"],":ma:":["1f1f2-1f1e6"],":mz:":["1f1f2-1f1ff"],":mm:":["1f1f2-1f1f2"],":na:":["1f1f3-1f1e6"],":nr:":["1f1f3-1f1f7"],":np:":["1f1f3-1f1f5"],":nl:":["1f1f3-1f1f1"],":nz:":["1f1f3-1f1ff"],":ni:":["1f1f3-1f1ee"],":ne:":["1f1f3-1f1ea"],":nigeria:":["1f1f3-1f1ec"],":kp:":["1f1f0-1f1f5"],":no:":["1f1f3-1f1f4"],":om:":["1f1f4-1f1f2"],":pk:":["1f1f5-1f1f0"],":pw:":["1f1f5-1f1fc"],":pa:":["1f1f5-1f1e6"],":pg:":["1f1f5-1f1ec"],":py:":["1f1f5-1f1fe"],":pe:":["1f1f5-1f1ea"],":ph:":["1f1f5-1f1ed"],":pl:":["1f1f5-1f1f1"],":pt:":["1f1f5-1f1f9"],":qa:":["1f1f6-1f1e6"],":tw:":["1f1f9-1f1fc"],":cg:":["1f1e8-1f1ec"],":ro:":["1f1f7-1f1f4"],":rw:":["1f1f7-1f1fc"],":kn:":["1f1f0-1f1f3"],":lc:":["1f1f1-1f1e8"],":vc:":["1f1fb-1f1e8"],":ws:":["1f1fc-1f1f8"],":sm:":["1f1f8-1f1f2"],":st:":["1f1f8-1f1f9"],":saudiarabia:":["1f1f8-1f1e6"],":saudi:":["1f1f8-1f1e6"],":sn:":["1f1f8-1f1f3"],":rs:":["1f1f7-1f1f8"],":sc:":["1f1f8-1f1e8"],":sl:":["1f1f8-1f1f1"],":sg:":["1f1f8-1f1ec"],":sk:":["1f1f8-1f1f0"],":si:":["1f1f8-1f1ee"],":sb:":["1f1f8-1f1e7"],":so:":["1f1f8-1f1f4"],":za:":["1f1ff-1f1e6"],":lk:":["1f1f1-1f1f0"],":sd:":["1f1f8-1f1e9"],":sr:":["1f1f8-1f1f7"],":sz:":["1f1f8-1f1ff"],":se:":["1f1f8-1f1ea"],":ch:":["1f1e8-1f1ed"],":sy:":["1f1f8-1f1fe"],":tj:":["1f1f9-1f1ef"],":tz:":["1f1f9-1f1ff"],":th:":["1f1f9-1f1ed"],":tg:":["1f1f9-1f1ec"],":to:":["1f1f9-1f1f4"],":tt:":["1f1f9-1f1f9"],":tn:":["1f1f9-1f1f3"],":tr:":["1f1f9-1f1f7"],":turkmenistan:":["1f1f9-1f1f2"],":tuvalu:":["1f1f9-1f1fb"],":ug:":["1f1fa-1f1ec"],":ua:":["1f1fa-1f1e6"],":ae:":["1f1e6-1f1ea"],":uy:":["1f1fa-1f1fe"],":uz:":["1f1fa-1f1ff"],":vu:":["1f1fb-1f1fa"],":va:":["1f1fb-1f1e6"],":ve:":["1f1fb-1f1ea"],":vn:":["1f1fb-1f1f3"],":eh:":["1f1ea-1f1ed"],":ye:":["1f1fe-1f1ea"],":zm:":["1f1ff-1f1f2"],":zw:":["1f1ff-1f1fc"],":pr:":["1f1f5-1f1f7"],":ky:":["1f1f0-1f1fe"],":bm:":["1f1e7-1f1f2"],":pf:":["1f1f5-1f1eb"],":ps:":["1f1f5-1f1f8"],":nc:":["1f1f3-1f1e8"],":sh:":["1f1f8-1f1ed"],":aw:":["1f1e6-1f1fc"],":vi:":["1f1fb-1f1ee"],":hk:":["1f1ed-1f1f0"],":ac:":["1f1e6-1f1e8"],":ms:":["1f1f2-1f1f8"],":gu:":["1f1ec-1f1fa"],":gl:":["1f1ec-1f1f1"],":nu:":["1f1f3-1f1fa"],":wf:":["1f1fc-1f1eb"],":mo:":["1f1f2-1f1f4"],":fo:":["1f1eb-1f1f4"],":fk:":["1f1eb-1f1f0"],":je:":["1f1ef-1f1ea"],":ai:":["1f1e6-1f1ee"],":gi:":["1f1ec-1f1ee"]},a.asciiList={"<3":"2764",":)":"1f606",">;)":"1f606",">:-)":"1f606",">=)":"1f606",";)":"1f609",";-)":"1f609","*-)":"1f609","*)":"1f609",";-]":"1f609",";]":"1f609",";D":"1f609",";^)":"1f609","':(":"1f613","':-(":"1f613","'=(":"1f613",":*":"1f618",":-*":"1f618","=*":"1f618",":^*":"1f618",">:P":"1f61c","X-P":"1f61c","x-p":"1f61c",">:[":"1f61e",":-(":"1f61e",":(":"1f61e",":-[":"1f61e",":[":"1f61e","=(":"1f61e",">:(":"1f620",">:-(":"1f620",":@":"1f620",":'(":"1f622",":'-(":"1f622",";(":"1f622",";-(":"1f622",">.<":"1f623",":$":"1f633","=$":"1f633","#-)":"1f635","#)":"1f635","%-)":"1f635","%)":"1f635","X)":"1f635","X-)":"1f635","*\\0/*":"1f646","\\0/":"1f646","*\\O/*":"1f646","\\O/":"1f646","O:-)":"1f607","0:-3":"1f607","0:3":"1f607","0:-)":"1f607","0:)":"1f607","0;^)":"1f607","O:)":"1f607","O;-)":"1f607","O=)":"1f607","0;-)":"1f607","O:-3":"1f607","O:3":"1f607","B-)":"1f60e","B)":"1f60e","8)":"1f60e","8-)":"1f60e","B-D":"1f60e","8-D":"1f60e","-_-":"1f611","-__-":"1f611","-___-":"1f611",">:\\":"1f615",">:/":"1f615",":-/":"1f615",":-.":"1f615",":/":"1f615",":\\":"1f615","=/":"1f615","=\\":"1f615",":L":"1f615","=L":"1f615",":P":"1f61b",":-P":"1f61b","=P":"1f61b",":-p":"1f61b",":p":"1f61b","=p":"1f61b",":-Þ":"1f61b",":Þ":"1f61b",":þ":"1f61b",":-þ":"1f61b",":-b":"1f61b",":b":"1f61b","d:":"1f61b",":-O":"1f62e",":O":"1f62e",":-o":"1f62e",":o":"1f62e",O_O:"1f62e",">:O":"1f62e",":-X":"1f636",":X":"1f636",":-#":"1f636",":#":"1f636","=X":"1f636","=x":"1f636",":x":"1f636",":-x":"1f636","=#":"1f636"},a.asciiRegexp="(\\<3|<3|\\<\\/3|<\\/3|\\:'\\)|\\:'\\-\\)|\\:D|\\:\\-D|\\=D|\\:\\)|\\:\\-\\)|\\=\\]|\\=\\)|\\:\\]|'\\:\\)|'\\:\\-\\)|'\\=\\)|'\\:D|'\\:\\-D|'\\=D|\\>\\:\\)|>\\:\\)|\\>;\\)|>;\\)|\\>\\:\\-\\)|>\\:\\-\\)|\\>\\=\\)|>\\=\\)|;\\)|;\\-\\)|\\*\\-\\)|\\*\\)|;\\-\\]|;\\]|;D|;\\^\\)|'\\:\\(|'\\:\\-\\(|'\\=\\(|\\:\\*|\\:\\-\\*|\\=\\*|\\:\\^\\*|\\>\\:P|>\\:P|X\\-P|x\\-p|\\>\\:\\[|>\\:\\[|\\:\\-\\(|\\:\\(|\\:\\-\\[|\\:\\[|\\=\\(|\\>\\:\\(|>\\:\\(|\\>\\:\\-\\(|>\\:\\-\\(|\\:@|\\:'\\(|\\:'\\-\\(|;\\(|;\\-\\(|\\>\\.\\<|>\\.<|\\:\\$|\\=\\$|#\\-\\)|#\\)|%\\-\\)|%\\)|X\\)|X\\-\\)|\\*\\\\0\\/\\*|\\\\0\\/|\\*\\\\O\\/\\*|\\\\O\\/|O\\:\\-\\)|0\\:\\-3|0\\:3|0\\:\\-\\)|0\\:\\)|0;\\^\\)|O\\:\\-\\)|O\\:\\)|O;\\-\\)|O\\=\\)|0;\\-\\)|O\\:\\-3|O\\:3|B\\-\\)|B\\)|8\\)|8\\-\\)|B\\-D|8\\-D|\\-_\\-|\\-__\\-|\\-___\\-|\\>\\:\\\\|>\\:\\\\|\\>\\:\\/|>\\:\\/|\\:\\-\\/|\\:\\-\\.|\\:\\/|\\:\\\\|\\=\\/|\\=\\\\|\\:L|\\=L|\\:P|\\:\\-P|\\=P|\\:\\-p|\\:p|\\=p|\\:\\-Þ|\\:\\-Þ|\\:Þ|\\:Þ|\\:þ|\\:þ|\\:\\-þ|\\:\\-þ|\\:\\-b|\\:b|d\\:|\\:\\-O|\\:O|\\:\\-o|\\:o|O_O|\\>\\:O|>\\:O|\\:\\-X|\\:X|\\:\\-#|\\:#|\\=X|\\=x|\\:x|\\:\\-x|\\=#)",a.unicodeRegexp="(#\\uFE0F\\u20E3|#\\u20E3|0\\uFE0F\\u20E3|0\\u20E3|1\\uFE0F\\u20E3|1\\u20E3|2\\uFE0F\\u20E3|2\\u20E3|3\\uFE0F\\u20E3|3\\u20E3|4\\uFE0F\\u20E3|4\\u20E3|5\\uFE0F\\u20E3|5\\u20E3|6\\uFE0F\\u20E3|6\\u20E3|7\\uFE0F\\u20E3|7\\u20E3|8\\uFE0F\\u20E3|8\\u20E3|9\\uFE0F\\u20E3|9\\u20E3|\\u00A9|\\u00AE|\\u203C\\uFE0F|\\u203C|\\u2049\\uFE0F|\\u2049|\\u2122|\\u2139\\uFE0F|\\u2139|\\u2194\\uFE0F|\\u2194|\\u2195\\uFE0F|\\u2195|\\u2196\\uFE0F|\\u2196|\\u2197\\uFE0F|\\u2197|\\u2198\\uFE0F|\\u2198|\\u2199\\uFE0F|\\u2199|\\u21A9\\uFE0F|\\u21A9|\\u21AA\\uFE0F|\\u21AA|\\u231A\\uFE0F|\\u231A|\\u231B\\uFE0F|\\u231B|\\u23E9|\\u23EA|\\u23EB|\\u23EC|\\u23F0|\\u23F3|\\u24C2\\uFE0F|\\u24C2|\\u25AA\\uFE0F|\\u25AA|\\u25AB\\uFE0F|\\u25AB|\\u25B6\\uFE0F|\\u25B6|\\u25C0\\uFE0F|\\u25C0|\\u25FB\\uFE0F|\\u25FB|\\u25FC\\uFE0F|\\u25FC|\\u25FD\\uFE0F|\\u25FD|\\u25FE\\uFE0F|\\u25FE|\\u2600\\uFE0F|\\u2600|\\u2601\\uFE0F|\\u2601|\\u260E\\uFE0F|\\u260E|\\u2611\\uFE0F|\\u2611|\\u2614\\uFE0F|\\u2614|\\u2615\\uFE0F|\\u2615|\\u261D\\uFE0F|\\u261D|\\u263A\\uFE0F|\\u263A|\\u2648\\uFE0F|\\u2648|\\u2649\\uFE0F|\\u2649|\\u264A\\uFE0F|\\u264A|\\u264B\\uFE0F|\\u264B|\\u264C\\uFE0F|\\u264C|\\u264D\\uFE0F|\\u264D|\\u264E\\uFE0F|\\u264E|\\u264F\\uFE0F|\\u264F|\\u2650\\uFE0F|\\u2650|\\u2651\\uFE0F|\\u2651|\\u2652\\uFE0F|\\u2652|\\u2653\\uFE0F|\\u2653|\\u2660\\uFE0F|\\u2660|\\u2663\\uFE0F|\\u2663|\\u2665\\uFE0F|\\u2665|\\u2666\\uFE0F|\\u2666|\\u2668\\uFE0F|\\u2668|\\u267B\\uFE0F|\\u267B|\\u267F\\uFE0F|\\u267F|\\u2693\\uFE0F|\\u2693|\\u26A0\\uFE0F|\\u26A0|\\u26A1\\uFE0F|\\u26A1|\\u26AA\\uFE0F|\\u26AA|\\u26AB\\uFE0F|\\u26AB|\\u26BD\\uFE0F|\\u26BD|\\u26BE\\uFE0F|\\u26BE|\\u26C4\\uFE0F|\\u26C4|\\u26C5\\uFE0F|\\u26C5|\\u26CE|\\u26D4\\uFE0F|\\u26D4|\\u26EA\\uFE0F|\\u26EA|\\u26F2\\uFE0F|\\u26F2|\\u26F3\\uFE0F|\\u26F3|\\u26F5\\uFE0F|\\u26F5|\\u26FA\\uFE0F|\\u26FA|\\u26FD\\uFE0F|\\u26FD|\\u2702\\uFE0F|\\u2702|\\u2705|\\u2708\\uFE0F|\\u2708|\\u2709\\uFE0F|\\u2709|\\u270A|\\u270B|\\u270C\\uFE0F|\\u270C|\\u270F\\uFE0F|\\u270F|\\u2712\\uFE0F|\\u2712|\\u2714\\uFE0F|\\u2714|\\u2716\\uFE0F|\\u2716|\\u2728|\\u2733\\uFE0F|\\u2733|\\u2734\\uFE0F|\\u2734|\\u2744\\uFE0F|\\u2744|\\u2747\\uFE0F|\\u2747|\\u274C|\\u274E|\\u2753|\\u2754|\\u2755|\\u2757\\uFE0F|\\u2757|\\u2764\\uFE0F|\\u2764|\\u2795|\\u2796|\\u2797|\\u27A1\\uFE0F|\\u27A1|\\u27B0|\\u2934\\uFE0F|\\u2934|\\u2935\\uFE0F|\\u2935|\\u2B05\\uFE0F|\\u2B05|\\u2B06\\uFE0F|\\u2B06|\\u2B07\\uFE0F|\\u2B07|\\u2B1B\\uFE0F|\\u2B1B|\\u2B1C\\uFE0F|\\u2B1C|\\u2B50\\uFE0F|\\u2B50|\\u2B55\\uFE0F|\\u2B55|\\u3030|\\u303D\\uFE0F|\\u303D|\\u3297\\uFE0F|\\u3297|\\u3299\\uFE0F|\\u3299|\\uD83C\\uDC04\\uFE0F|\\uD83C\\uDC04|\\uD83C\\uDCCF|\\uD83C\\uDD70|\\uD83C\\uDD71|\\uD83C\\uDD7E|\\uD83C\\uDD7F\\uFE0F|\\uD83C\\uDD7F|\\uD83C\\uDD8E|\\uD83C\\uDD91|\\uD83C\\uDD92|\\uD83C\\uDD93|\\uD83C\\uDD94|\\uD83C\\uDD95|\\uD83C\\uDD96|\\uD83C\\uDD97|\\uD83C\\uDD98|\\uD83C\\uDD99|\\uD83C\\uDD9A|\\uD83C\\uDDE8\\uD83C\\uDDF3|\\uD83C\\uDDE9\\uD83C\\uDDEA|\\uD83C\\uDDEA\\uD83C\\uDDF8|\\uD83C\\uDDEB\\uD83C\\uDDF7|\\uD83C\\uDDEC\\uD83C\\uDDE7|\\uD83C\\uDDEE\\uD83C\\uDDF9|\\uD83C\\uDDEF\\uD83C\\uDDF5|\\uD83C\\uDDF0\\uD83C\\uDDF7|\\uD83C\\uDDFA\\uD83C\\uDDF8|\\uD83C\\uDDF7\\uD83C\\uDDFA|\\uD83C\\uDE01|\\uD83C\\uDE02|\\uD83C\\uDE1A\\uFE0F|\\uD83C\\uDE1A|\\uD83C\\uDE2F\\uFE0F|\\uD83C\\uDE2F|\\uD83C\\uDE32|\\uD83C\\uDE33|\\uD83C\\uDE34|\\uD83C\\uDE35|\\uD83C\\uDE36|\\uD83C\\uDE37|\\uD83C\\uDE38|\\uD83C\\uDE39|\\uD83C\\uDE3A|\\uD83C\\uDE50|\\uD83C\\uDE51|\\uD83C\\uDF00|\\uD83C\\uDF01|\\uD83C\\uDF02|\\uD83C\\uDF03|\\uD83C\\uDF04|\\uD83C\\uDF05|\\uD83C\\uDF06|\\uD83C\\uDF07|\\uD83C\\uDF08|\\uD83C\\uDF09|\\uD83C\\uDF0A|\\uD83C\\uDF0B|\\uD83C\\uDF0C|\\uD83C\\uDF0F|\\uD83C\\uDF11|\\uD83C\\uDF13|\\uD83C\\uDF14|\\uD83C\\uDF15|\\uD83C\\uDF19|\\uD83C\\uDF1B|\\uD83C\\uDF1F|\\uD83C\\uDF20|\\uD83C\\uDF30|\\uD83C\\uDF31|\\uD83C\\uDF34|\\uD83C\\uDF35|\\uD83C\\uDF37|\\uD83C\\uDF38|\\uD83C\\uDF39|\\uD83C\\uDF3A|\\uD83C\\uDF3B|\\uD83C\\uDF3C|\\uD83C\\uDF3D|\\uD83C\\uDF3E|\\uD83C\\uDF3F|\\uD83C\\uDF40|\\uD83C\\uDF41|\\uD83C\\uDF42|\\uD83C\\uDF43|\\uD83C\\uDF44|\\uD83C\\uDF45|\\uD83C\\uDF46|\\uD83C\\uDF47|\\uD83C\\uDF48|\\uD83C\\uDF49|\\uD83C\\uDF4A|\\uD83C\\uDF4C|\\uD83C\\uDF4D|\\uD83C\\uDF4E|\\uD83C\\uDF4F|\\uD83C\\uDF51|\\uD83C\\uDF52|\\uD83C\\uDF53|\\uD83C\\uDF54|\\uD83C\\uDF55|\\uD83C\\uDF56|\\uD83C\\uDF57|\\uD83C\\uDF58|\\uD83C\\uDF59|\\uD83C\\uDF5A|\\uD83C\\uDF5B|\\uD83C\\uDF5C|\\uD83C\\uDF5D|\\uD83C\\uDF5E|\\uD83C\\uDF5F|\\uD83C\\uDF60|\\uD83C\\uDF61|\\uD83C\\uDF62|\\uD83C\\uDF63|\\uD83C\\uDF64|\\uD83C\\uDF65|\\uD83C\\uDF66|\\uD83C\\uDF67|\\uD83C\\uDF68|\\uD83C\\uDF69|\\uD83C\\uDF6A|\\uD83C\\uDF6B|\\uD83C\\uDF6C|\\uD83C\\uDF6D|\\uD83C\\uDF6E|\\uD83C\\uDF6F|\\uD83C\\uDF70|\\uD83C\\uDF71|\\uD83C\\uDF72|\\uD83C\\uDF73|\\uD83C\\uDF74|\\uD83C\\uDF75|\\uD83C\\uDF76|\\uD83C\\uDF77|\\uD83C\\uDF78|\\uD83C\\uDF79|\\uD83C\\uDF7A|\\uD83C\\uDF7B|\\uD83C\\uDF80|\\uD83C\\uDF81|\\uD83C\\uDF82|\\uD83C\\uDF83|\\uD83C\\uDF84|\\uD83C\\uDF85|\\uD83C\\uDF86|\\uD83C\\uDF87|\\uD83C\\uDF88|\\uD83C\\uDF89|\\uD83C\\uDF8A|\\uD83C\\uDF8B|\\uD83C\\uDF8C|\\uD83C\\uDF8D|\\uD83C\\uDF8E|\\uD83C\\uDF8F|\\uD83C\\uDF90|\\uD83C\\uDF91|\\uD83C\\uDF92|\\uD83C\\uDF93|\\uD83C\\uDFA0|\\uD83C\\uDFA1|\\uD83C\\uDFA2|\\uD83C\\uDFA3|\\uD83C\\uDFA4|\\uD83C\\uDFA5|\\uD83C\\uDFA6|\\uD83C\\uDFA7|\\uD83C\\uDFA8|\\uD83C\\uDFA9|\\uD83C\\uDFAA|\\uD83C\\uDFAB|\\uD83C\\uDFAC|\\uD83C\\uDFAD|\\uD83C\\uDFAE|\\uD83C\\uDFAF|\\uD83C\\uDFB0|\\uD83C\\uDFB1|\\uD83C\\uDFB2|\\uD83C\\uDFB3|\\uD83C\\uDFB4|\\uD83C\\uDFB5|\\uD83C\\uDFB6|\\uD83C\\uDFB7|\\uD83C\\uDFB8|\\uD83C\\uDFB9|\\uD83C\\uDFBA|\\uD83C\\uDFBB|\\uD83C\\uDFBC|\\uD83C\\uDFBD|\\uD83C\\uDFBE|\\uD83C\\uDFBF|\\uD83C\\uDFC0|\\uD83C\\uDFC1|\\uD83C\\uDFC2|\\uD83C\\uDFC3|\\uD83C\\uDFC4|\\uD83C\\uDFC6|\\uD83C\\uDFC8|\\uD83C\\uDFCA|\\uD83C\\uDFE0|\\uD83C\\uDFE1|\\uD83C\\uDFE2|\\uD83C\\uDFE3|\\uD83C\\uDFE5|\\uD83C\\uDFE6|\\uD83C\\uDFE7|\\uD83C\\uDFE8|\\uD83C\\uDFE9|\\uD83C\\uDFEA|\\uD83C\\uDFEB|\\uD83C\\uDFEC|\\uD83C\\uDFED|\\uD83C\\uDFEE|\\uD83C\\uDFEF|\\uD83C\\uDFF0|\\uD83D\\uDC0C|\\uD83D\\uDC0D|\\uD83D\\uDC0E|\\uD83D\\uDC11|\\uD83D\\uDC12|\\uD83D\\uDC14|\\uD83D\\uDC17|\\uD83D\\uDC18|\\uD83D\\uDC19|\\uD83D\\uDC1A|\\uD83D\\uDC1B|\\uD83D\\uDC1C|\\uD83D\\uDC1D|\\uD83D\\uDC1E|\\uD83D\\uDC1F|\\uD83D\\uDC20|\\uD83D\\uDC21|\\uD83D\\uDC22|\\uD83D\\uDC23|\\uD83D\\uDC24|\\uD83D\\uDC25|\\uD83D\\uDC26|\\uD83D\\uDC27|\\uD83D\\uDC28|\\uD83D\\uDC29|\\uD83D\\uDC2B|\\uD83D\\uDC2C|\\uD83D\\uDC2D|\\uD83D\\uDC2E|\\uD83D\\uDC2F|\\uD83D\\uDC30|\\uD83D\\uDC31|\\uD83D\\uDC32|\\uD83D\\uDC33|\\uD83D\\uDC34|\\uD83D\\uDC35|\\uD83D\\uDC36|\\uD83D\\uDC37|\\uD83D\\uDC38|\\uD83D\\uDC39|\\uD83D\\uDC3A|\\uD83D\\uDC3B|\\uD83D\\uDC3C|\\uD83D\\uDC3D|\\uD83D\\uDC3E|\\uD83D\\uDC40|\\uD83D\\uDC42|\\uD83D\\uDC43|\\uD83D\\uDC44|\\uD83D\\uDC45|\\uD83D\\uDC46|\\uD83D\\uDC47|\\uD83D\\uDC48|\\uD83D\\uDC49|\\uD83D\\uDC4A|\\uD83D\\uDC4B|\\uD83D\\uDC4C|\\uD83D\\uDC4D|\\uD83D\\uDC4E|\\uD83D\\uDC4F|\\uD83D\\uDC50|\\uD83D\\uDC51|\\uD83D\\uDC52|\\uD83D\\uDC53|\\uD83D\\uDC54|\\uD83D\\uDC55|\\uD83D\\uDC56|\\uD83D\\uDC57|\\uD83D\\uDC58|\\uD83D\\uDC59|\\uD83D\\uDC5A|\\uD83D\\uDC5B|\\uD83D\\uDC5C|\\uD83D\\uDC5D|\\uD83D\\uDC5E|\\uD83D\\uDC5F|\\uD83D\\uDC60|\\uD83D\\uDC61|\\uD83D\\uDC62|\\uD83D\\uDC63|\\uD83D\\uDC64|\\uD83D\\uDC66|\\uD83D\\uDC67|\\uD83D\\uDC68|\\uD83D\\uDC69|\\uD83D\\uDC6A|\\uD83D\\uDC6B|\\uD83D\\uDC6E|\\uD83D\\uDC6F|\\uD83D\\uDC70|\\uD83D\\uDC71|\\uD83D\\uDC72|\\uD83D\\uDC73|\\uD83D\\uDC74|\\uD83D\\uDC75|\\uD83D\\uDC76|\\uD83D\\uDC77|\\uD83D\\uDC78|\\uD83D\\uDC79|\\uD83D\\uDC7A|\\uD83D\\uDC7B|\\uD83D\\uDC7C|\\uD83D\\uDC7D|\\uD83D\\uDC7E|\\uD83D\\uDC7F|\\uD83D\\uDC80|\\uD83D\\uDCC7|\\uD83D\\uDC81|\\uD83D\\uDC82|\\uD83D\\uDC83|\\uD83D\\uDC84|\\uD83D\\uDC85|\\uD83D\\uDCD2|\\uD83D\\uDC86|\\uD83D\\uDCD3|\\uD83D\\uDC87|\\uD83D\\uDCD4|\\uD83D\\uDC88|\\uD83D\\uDCD5|\\uD83D\\uDC89|\\uD83D\\uDCD6|\\uD83D\\uDC8A|\\uD83D\\uDCD7|\\uD83D\\uDC8B|\\uD83D\\uDCD8|\\uD83D\\uDC8C|\\uD83D\\uDCD9|\\uD83D\\uDC8D|\\uD83D\\uDCDA|\\uD83D\\uDC8E|\\uD83D\\uDCDB|\\uD83D\\uDC8F|\\uD83D\\uDCDC|\\uD83D\\uDC90|\\uD83D\\uDCDD|\\uD83D\\uDC91|\\uD83D\\uDCDE|\\uD83D\\uDC92|\\uD83D\\uDCDF|\\uD83D\\uDCE0|\\uD83D\\uDC93|\\uD83D\\uDCE1|\\uD83D\\uDCE2|\\uD83D\\uDC94|\\uD83D\\uDCE3|\\uD83D\\uDCE4|\\uD83D\\uDC95|\\uD83D\\uDCE5|\\uD83D\\uDCE6|\\uD83D\\uDC96|\\uD83D\\uDCE7|\\uD83D\\uDCE8|\\uD83D\\uDC97|\\uD83D\\uDCE9|\\uD83D\\uDCEA|\\uD83D\\uDC98|\\uD83D\\uDCEB|\\uD83D\\uDCEE|\\uD83D\\uDC99|\\uD83D\\uDCF0|\\uD83D\\uDCF1|\\uD83D\\uDC9A|\\uD83D\\uDCF2|\\uD83D\\uDCF3|\\uD83D\\uDC9B|\\uD83D\\uDCF4|\\uD83D\\uDCF6|\\uD83D\\uDC9C|\\uD83D\\uDCF7|\\uD83D\\uDCF9|\\uD83D\\uDC9D|\\uD83D\\uDCFA|\\uD83D\\uDCFB|\\uD83D\\uDC9E|\\uD83D\\uDCFC|\\uD83D\\uDD03|\\uD83D\\uDC9F|\\uD83D\\uDD0A|\\uD83D\\uDD0B|\\uD83D\\uDCA0|\\uD83D\\uDD0C|\\uD83D\\uDD0D|\\uD83D\\uDCA1|\\uD83D\\uDD0E|\\uD83D\\uDD0F|\\uD83D\\uDCA2|\\uD83D\\uDD10|\\uD83D\\uDD11|\\uD83D\\uDCA3|\\uD83D\\uDD12|\\uD83D\\uDD13|\\uD83D\\uDCA4|\\uD83D\\uDD14|\\uD83D\\uDD16|\\uD83D\\uDCA5|\\uD83D\\uDD17|\\uD83D\\uDD18|\\uD83D\\uDCA6|\\uD83D\\uDD19|\\uD83D\\uDD1A|\\uD83D\\uDCA7|\\uD83D\\uDD1B|\\uD83D\\uDD1C|\\uD83D\\uDCA8|\\uD83D\\uDD1D|\\uD83D\\uDD1E|\\uD83D\\uDCA9|\\uD83D\\uDD1F|\\uD83D\\uDCAA|\\uD83D\\uDD20|\\uD83D\\uDD21|\\uD83D\\uDCAB|\\uD83D\\uDD22|\\uD83D\\uDD23|\\uD83D\\uDCAC|\\uD83D\\uDD24|\\uD83D\\uDD25|\\uD83D\\uDCAE|\\uD83D\\uDD26|\\uD83D\\uDD27|\\uD83D\\uDCAF|\\uD83D\\uDD28|\\uD83D\\uDD29|\\uD83D\\uDCB0|\\uD83D\\uDD2A|\\uD83D\\uDD2B|\\uD83D\\uDCB1|\\uD83D\\uDD2E|\\uD83D\\uDCB2|\\uD83D\\uDD2F|\\uD83D\\uDCB3|\\uD83D\\uDD30|\\uD83D\\uDD31|\\uD83D\\uDCB4|\\uD83D\\uDD32|\\uD83D\\uDD33|\\uD83D\\uDCB5|\\uD83D\\uDD34|\\uD83D\\uDD35|\\uD83D\\uDCB8|\\uD83D\\uDD36|\\uD83D\\uDD37|\\uD83D\\uDCB9|\\uD83D\\uDD38|\\uD83D\\uDD39|\\uD83D\\uDCBA|\\uD83D\\uDD3A|\\uD83D\\uDD3B|\\uD83D\\uDCBB|\\uD83D\\uDD3C|\\uD83D\\uDCBC|\\uD83D\\uDD3D|\\uD83D\\uDD50|\\uD83D\\uDCBD|\\uD83D\\uDD51|\\uD83D\\uDCBE|\\uD83D\\uDD52|\\uD83D\\uDCBF|\\uD83D\\uDD53|\\uD83D\\uDCC0|\\uD83D\\uDD54|\\uD83D\\uDD55|\\uD83D\\uDCC1|\\uD83D\\uDD56|\\uD83D\\uDD57|\\uD83D\\uDCC2|\\uD83D\\uDD58|\\uD83D\\uDD59|\\uD83D\\uDCC3|\\uD83D\\uDD5A|\\uD83D\\uDD5B|\\uD83D\\uDCC4|\\uD83D\\uDDFB|\\uD83D\\uDDFC|\\uD83D\\uDCC5|\\uD83D\\uDDFD|\\uD83D\\uDDFE|\\uD83D\\uDCC6|\\uD83D\\uDDFF|\\uD83D\\uDE01|\\uD83D\\uDE02|\\uD83D\\uDE03|\\uD83D\\uDCC8|\\uD83D\\uDE04|\\uD83D\\uDE05|\\uD83D\\uDCC9|\\uD83D\\uDE06|\\uD83D\\uDE09|\\uD83D\\uDCCA|\\uD83D\\uDE0A|\\uD83D\\uDE0B|\\uD83D\\uDCCB|\\uD83D\\uDE0C|\\uD83D\\uDE0D|\\uD83D\\uDCCC|\\uD83D\\uDE0F|\\uD83D\\uDE12|\\uD83D\\uDCCD|\\uD83D\\uDE13|\\uD83D\\uDE14|\\uD83D\\uDCCE|\\uD83D\\uDE16|\\uD83D\\uDE18|\\uD83D\\uDCCF|\\uD83D\\uDE1A|\\uD83D\\uDE1C|\\uD83D\\uDCD0|\\uD83D\\uDE1D|\\uD83D\\uDE1E|\\uD83D\\uDCD1|\\uD83D\\uDE20|\\uD83D\\uDE21|\\uD83D\\uDE22|\\uD83D\\uDE23|\\uD83D\\uDE24|\\uD83D\\uDE25|\\uD83D\\uDE28|\\uD83D\\uDE29|\\uD83D\\uDE2A|\\uD83D\\uDE2B|\\uD83D\\uDE2D|\\uD83D\\uDE30|\\uD83D\\uDE31|\\uD83D\\uDE32|\\uD83D\\uDE33|\\uD83D\\uDE35|\\uD83D\\uDE37|\\uD83D\\uDE38|\\uD83D\\uDE39|\\uD83D\\uDE3A|\\uD83D\\uDE3B|\\uD83D\\uDE3C|\\uD83D\\uDE3D|\\uD83D\\uDE3E|\\uD83D\\uDE3F|\\uD83D\\uDE40|\\uD83D\\uDE45|\\uD83D\\uDE46|\\uD83D\\uDE47|\\uD83D\\uDE48|\\uD83D\\uDE49|\\uD83D\\uDE4A|\\uD83D\\uDE4B|\\uD83D\\uDE4C|\\uD83D\\uDE4D|\\uD83D\\uDE4E|\\uD83D\\uDE4F|\\uD83D\\uDE80|\\uD83D\\uDE83|\\uD83D\\uDE84|\\uD83D\\uDE85|\\uD83D\\uDE87|\\uD83D\\uDE89|\\uD83D\\uDE8C|\\uD83D\\uDE8F|\\uD83D\\uDE91|\\uD83D\\uDE92|\\uD83D\\uDE93|\\uD83D\\uDE95|\\uD83D\\uDE97|\\uD83D\\uDE99|\\uD83D\\uDE9A|\\uD83D\\uDEA2|\\uD83D\\uDEA4|\\uD83D\\uDEA5|\\uD83D\\uDEA7|\\uD83D\\uDEA8|\\uD83D\\uDEA9|\\uD83D\\uDEAA|\\uD83D\\uDEAB|\\uD83D\\uDEAC|\\uD83D\\uDEAD|\\uD83D\\uDEB2|\\uD83D\\uDEB6|\\uD83D\\uDEB9|\\uD83D\\uDEBA|\\uD83D\\uDEBB|\\uD83D\\uDEBC|\\uD83D\\uDEBD|\\uD83D\\uDEBE|\\uD83D\\uDEC0|\\uD83D\\uDE00|\\uD83D\\uDE07|\\uD83D\\uDE08|\\uD83D\\uDE0E|\\uD83D\\uDE10|\\uD83D\\uDE11|\\uD83D\\uDE15|\\uD83D\\uDE17|\\uD83D\\uDE19|\\uD83D\\uDE1B|\\uD83D\\uDE1F|\\uD83D\\uDE26|\\uD83D\\uDE27|\\uD83D\\uDE2C|\\uD83D\\uDE2E|\\uD83D\\uDE2F|\\uD83D\\uDE34|\\uD83D\\uDE36|\\uD83D\\uDE81|\\uD83D\\uDE82|\\uD83D\\uDE86|\\uD83D\\uDE88|\\uD83D\\uDE8A|\\uD83D\\uDE8D|\\uD83D\\uDE8E|\\uD83D\\uDE90|\\uD83D\\uDE94|\\uD83D\\uDE96|\\uD83D\\uDE98|\\uD83D\\uDE9B|\\uD83D\\uDE9C|\\uD83D\\uDE9D|\\uD83D\\uDE9E|\\uD83D\\uDE9F|\\uD83D\\uDEA0|\\uD83D\\uDEA1|\\uD83D\\uDEA3|\\uD83D\\uDEA6|\\uD83D\\uDEAE|\\uD83D\\uDEAF|\\uD83D\\uDEB0|\\uD83D\\uDEB1|\\uD83D\\uDEB3|\\uD83D\\uDEB4|\\uD83D\\uDEB5|\\uD83D\\uDEB7|\\uD83D\\uDEB8|\\uD83D\\uDEBF|\\uD83D\\uDEC1|\\uD83D\\uDEC2|\\uD83D\\uDEC3|\\uD83D\\uDEC4|\\uD83D\\uDEC5|\\uD83C\\uDF0D|\\uD83C\\uDF0E|\\uD83C\\uDF10|\\uD83C\\uDF12|\\uD83C\\uDF16|\\uD83C\\uDF17|\\uD83C\\uDF18|\\uD83C\\uDF1A|\\uD83C\\uDF1C|\\uD83C\\uDF1D|\\uD83C\\uDF1E|\\uD83C\\uDF32|\\uD83C\\uDF33|\\uD83C\\uDF4B|\\uD83C\\uDF50|\\uD83C\\uDF7C|\\uD83C\\uDFC7|\\uD83C\\uDFC9|\\uD83C\\uDFE4|\\uD83D\\uDC00|\\uD83D\\uDC01|\\uD83D\\uDC02|\\uD83D\\uDC03|\\uD83D\\uDC04|\\uD83D\\uDC05|\\uD83D\\uDC06|\\uD83D\\uDC07|\\uD83D\\uDC08|\\uD83D\\uDC09|\\uD83D\\uDC0A|\\uD83D\\uDC0B|\\uD83D\\uDC0F|\\uD83D\\uDC10|\\uD83D\\uDC13|\\uD83D\\uDC15|\\uD83D\\uDC16|\\uD83D\\uDC2A|\\uD83D\\uDC65|\\uD83D\\uDC6C|\\uD83D\\uDC6D|\\uD83D\\uDCAD|\\uD83D\\uDCB6|\\uD83D\\uDCB7|\\uD83D\\uDCEC|\\uD83D\\uDCED|\\uD83D\\uDCEF|\\uD83D\\uDCF5|\\uD83D\\uDD00|\\uD83D\\uDD01|\\uD83D\\uDD02|\\uD83D\\uDD04|\\uD83D\\uDD05|\\uD83D\\uDD06|\\uD83D\\uDD07|\\uD83D\\uDD09|\\uD83D\\uDD15|\\uD83D\\uDD2C|\\uD83D\\uDD2D|\\uD83D\\uDD5C|\\uD83D\\uDD5D|\\uD83D\\uDD5E|\\uD83D\\uDD5F|\\uD83D\\uDD60|\\uD83D\\uDD61|\\uD83D\\uDD62|\\uD83D\\uDD63|\\uD83D\\uDD64|\\uD83D\\uDD65|\\uD83D\\uDD66|\\uD83D\\uDD67|\\uD83D\\uDD08|\\uD83D\\uDE8B|\\u27BF|\\uD83C\\uDDE6\\uD83C\\uDDEB|\\uD83C\\uDDE6\\uD83C\\uDDF1|\\uD83C\\uDDE9\\uD83C\\uDDFF|\\uD83C\\uDDE6\\uD83C\\uDDE9|\\uD83C\\uDDE6\\uD83C\\uDDF4|\\uD83C\\uDDE6\\uD83C\\uDDEC|\\uD83C\\uDDE6\\uD83C\\uDDF7|\\uD83C\\uDDE6\\uD83C\\uDDF2|\\uD83C\\uDDE6\\uD83C\\uDDFA|\\uD83C\\uDDE6\\uD83C\\uDDF9|\\uD83C\\uDDE6\\uD83C\\uDDFF|\\uD83C\\uDDE7\\uD83C\\uDDF8|\\uD83C\\uDDE7\\uD83C\\uDDED|\\uD83C\\uDDE7\\uD83C\\uDDE9|\\uD83C\\uDDE7\\uD83C\\uDDE7|\\uD83C\\uDDE7\\uD83C\\uDDFE|\\uD83C\\uDDE7\\uD83C\\uDDEA|\\uD83C\\uDDE7\\uD83C\\uDDFF|\\uD83C\\uDDE7\\uD83C\\uDDEF|\\uD83C\\uDDE7\\uD83C\\uDDF9|\\uD83C\\uDDE7\\uD83C\\uDDF4|\\uD83C\\uDDE7\\uD83C\\uDDE6|\\uD83C\\uDDE7\\uD83C\\uDDFC|\\uD83C\\uDDE7\\uD83C\\uDDF7|\\uD83C\\uDDE7\\uD83C\\uDDF3|\\uD83C\\uDDE7\\uD83C\\uDDEC|\\uD83C\\uDDE7\\uD83C\\uDDEB|\\uD83C\\uDDE7\\uD83C\\uDDEE|\\uD83C\\uDDF0\\uD83C\\uDDED|\\uD83C\\uDDE8\\uD83C\\uDDF2|\\uD83C\\uDDE8\\uD83C\\uDDE6|\\uD83C\\uDDE8\\uD83C\\uDDFB|\\uD83C\\uDDE8\\uD83C\\uDDEB|\\uD83C\\uDDF9\\uD83C\\uDDE9|\\uD83C\\uDDE8\\uD83C\\uDDF1|\\uD83C\\uDDE8\\uD83C\\uDDF4|\\uD83C\\uDDF0\\uD83C\\uDDF2|\\uD83C\\uDDE8\\uD83C\\uDDF7|\\uD83C\\uDDE8\\uD83C\\uDDEE|\\uD83C\\uDDED\\uD83C\\uDDF7|\\uD83C\\uDDE8\\uD83C\\uDDFA|\\uD83C\\uDDE8\\uD83C\\uDDFE|\\uD83C\\uDDE8\\uD83C\\uDDFF|\\uD83C\\uDDE8\\uD83C\\uDDE9|\\uD83C\\uDDE9\\uD83C\\uDDF0|\\uD83C\\uDDE9\\uD83C\\uDDEF|\\uD83C\\uDDE9\\uD83C\\uDDF2|\\uD83C\\uDDE9\\uD83C\\uDDF4|\\uD83C\\uDDF9\\uD83C\\uDDF1|\\uD83C\\uDDEA\\uD83C\\uDDE8|\\uD83C\\uDDEA\\uD83C\\uDDEC|\\uD83C\\uDDF8\\uD83C\\uDDFB|\\uD83C\\uDDEC\\uD83C\\uDDF6|\\uD83C\\uDDEA\\uD83C\\uDDF7|\\uD83C\\uDDEA\\uD83C\\uDDEA|\\uD83C\\uDDEA\\uD83C\\uDDF9|\\uD83C\\uDDEB\\uD83C\\uDDEF|\\uD83C\\uDDEB\\uD83C\\uDDEE|\\uD83C\\uDDEC\\uD83C\\uDDE6|\\uD83C\\uDDEC\\uD83C\\uDDF2|\\uD83C\\uDDEC\\uD83C\\uDDEA|\\uD83C\\uDDEC\\uD83C\\uDDED|\\uD83C\\uDDEC\\uD83C\\uDDF7|\\uD83C\\uDDEC\\uD83C\\uDDE9|\\uD83C\\uDDEC\\uD83C\\uDDF9|\\uD83C\\uDDEC\\uD83C\\uDDF3|\\uD83C\\uDDEC\\uD83C\\uDDFC|\\uD83C\\uDDEC\\uD83C\\uDDFE|\\uD83C\\uDDED\\uD83C\\uDDF9|\\uD83C\\uDDED\\uD83C\\uDDF3|\\uD83C\\uDDED\\uD83C\\uDDFA|\\uD83C\\uDDEE\\uD83C\\uDDF8|\\uD83C\\uDDEE\\uD83C\\uDDF3|\\uD83C\\uDDEE\\uD83C\\uDDE9|\\uD83C\\uDDEE\\uD83C\\uDDF7|\\uD83C\\uDDEE\\uD83C\\uDDF6|\\uD83C\\uDDEE\\uD83C\\uDDEA|\\uD83C\\uDDEE\\uD83C\\uDDF1|\\uD83C\\uDDEF\\uD83C\\uDDF2|\\uD83C\\uDDEF\\uD83C\\uDDF4|\\uD83C\\uDDF0\\uD83C\\uDDFF|\\uD83C\\uDDF0\\uD83C\\uDDEA|\\uD83C\\uDDF0\\uD83C\\uDDEE|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDF0\\uD83C\\uDDFC|\\uD83C\\uDDF0\\uD83C\\uDDEC|\\uD83C\\uDDF1\\uD83C\\uDDE6|\\uD83C\\uDDF1\\uD83C\\uDDFB|\\uD83C\\uDDF1\\uD83C\\uDDE7|\\uD83C\\uDDF1\\uD83C\\uDDF8|\\uD83C\\uDDF1\\uD83C\\uDDF7|\\uD83C\\uDDF1\\uD83C\\uDDFE|\\uD83C\\uDDF1\\uD83C\\uDDEE|\\uD83C\\uDDF1\\uD83C\\uDDF9|\\uD83C\\uDDF1\\uD83C\\uDDFA|\\uD83C\\uDDF2\\uD83C\\uDDF0|\\uD83C\\uDDF2\\uD83C\\uDDEC|\\uD83C\\uDDF2\\uD83C\\uDDFC|\\uD83C\\uDDF2\\uD83C\\uDDFE|\\uD83C\\uDDF2\\uD83C\\uDDFB|\\uD83C\\uDDF2\\uD83C\\uDDF1|\\uD83C\\uDDF2\\uD83C\\uDDF9|\\uD83C\\uDDF2\\uD83C\\uDDED|\\uD83C\\uDDF2\\uD83C\\uDDF7|\\uD83C\\uDDF2\\uD83C\\uDDFA|\\uD83C\\uDDF2\\uD83C\\uDDFD|\\uD83C\\uDDEB\\uD83C\\uDDF2|\\uD83C\\uDDF2\\uD83C\\uDDE9|\\uD83C\\uDDF2\\uD83C\\uDDE8|\\uD83C\\uDDF2\\uD83C\\uDDF3|\\uD83C\\uDDF2\\uD83C\\uDDEA|\\uD83C\\uDDF2\\uD83C\\uDDE6|\\uD83C\\uDDF2\\uD83C\\uDDFF|\\uD83C\\uDDF2\\uD83C\\uDDF2|\\uD83C\\uDDF3\\uD83C\\uDDE6|\\uD83C\\uDDF3\\uD83C\\uDDF7|\\uD83C\\uDDF3\\uD83C\\uDDF5|\\uD83C\\uDDF3\\uD83C\\uDDF1|\\uD83C\\uDDF3\\uD83C\\uDDFF|\\uD83C\\uDDF3\\uD83C\\uDDEE|\\uD83C\\uDDF3\\uD83C\\uDDEA|\\uD83C\\uDDF3\\uD83C\\uDDEC|\\uD83C\\uDDF0\\uD83C\\uDDF5|\\uD83C\\uDDF3\\uD83C\\uDDF4|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83C\\uDDF5\\uD83C\\uDDF0|\\uD83C\\uDDF5\\uD83C\\uDDFC|\\uD83C\\uDDF5\\uD83C\\uDDE6|\\uD83C\\uDDF5\\uD83C\\uDDEC|\\uD83C\\uDDF5\\uD83C\\uDDFE|\\uD83C\\uDDF5\\uD83C\\uDDEA|\\uD83C\\uDDF5\\uD83C\\uDDED|\\uD83C\\uDDF5\\uD83C\\uDDF1|\\uD83C\\uDDF5\\uD83C\\uDDF9|\\uD83C\\uDDF6\\uD83C\\uDDE6|\\uD83C\\uDDF9\\uD83C\\uDDFC|\\uD83C\\uDDE8\\uD83C\\uDDEC|\\uD83C\\uDDF7\\uD83C\\uDDF4|\\uD83C\\uDDF7\\uD83C\\uDDFC|\\uD83C\\uDDF0\\uD83C\\uDDF3|\\uD83C\\uDDF1\\uD83C\\uDDE8|\\uD83C\\uDDFB\\uD83C\\uDDE8|\\uD83C\\uDDFC\\uD83C\\uDDF8|\\uD83C\\uDDF8\\uD83C\\uDDF2|\\uD83C\\uDDF8\\uD83C\\uDDF9|\\uD83C\\uDDF8\\uD83C\\uDDE6|\\uD83C\\uDDF8\\uD83C\\uDDF3|\\uD83C\\uDDF7\\uD83C\\uDDF8|\\uD83C\\uDDF8\\uD83C\\uDDE8|\\uD83C\\uDDF8\\uD83C\\uDDF1|\\uD83C\\uDDF8\\uD83C\\uDDEC|\\uD83C\\uDDF8\\uD83C\\uDDF0|\\uD83C\\uDDF8\\uD83C\\uDDEE|\\uD83C\\uDDF8\\uD83C\\uDDE7|\\uD83C\\uDDF8\\uD83C\\uDDF4|\\uD83C\\uDDFF\\uD83C\\uDDE6|\\uD83C\\uDDF1\\uD83C\\uDDF0|\\uD83C\\uDDF8\\uD83C\\uDDE9|\\uD83C\\uDDF8\\uD83C\\uDDF7|\\uD83C\\uDDF8\\uD83C\\uDDFF|\\uD83C\\uDDF8\\uD83C\\uDDEA|\\uD83C\\uDDE8\\uD83C\\uDDED|\\uD83C\\uDDF8\\uD83C\\uDDFE|\\uD83C\\uDDF9\\uD83C\\uDDEF|\\uD83C\\uDDF9\\uD83C\\uDDFF|\\uD83C\\uDDF9\\uD83C\\uDDED|\\uD83C\\uDDF9\\uD83C\\uDDEC|\\uD83C\\uDDF9\\uD83C\\uDDF4|\\uD83C\\uDDF9\\uD83C\\uDDF9|\\uD83C\\uDDF9\\uD83C\\uDDF3|\\uD83C\\uDDF9\\uD83C\\uDDF7|\\uD83C\\uDDF9\\uD83C\\uDDF2|\\uD83C\\uDDF9\\uD83C\\uDDFB|\\uD83C\\uDDFA\\uD83C\\uDDEC|\\uD83C\\uDDFA\\uD83C\\uDDE6|\\uD83C\\uDDE6\\uD83C\\uDDEA|\\uD83C\\uDDFA\\uD83C\\uDDFE|\\uD83C\\uDDFA\\uD83C\\uDDFF|\\uD83C\\uDDFB\\uD83C\\uDDFA|\\uD83C\\uDDFB\\uD83C\\uDDE6|\\uD83C\\uDDFB\\uD83C\\uDDEA|\\uD83C\\uDDFB\\uD83C\\uDDF3|\\uD83C\\uDDEA\\uD83C\\uDDED|\\uD83C\\uDDFE\\uD83C\\uDDEA|\\uD83C\\uDDFF\\uD83C\\uDDF2|\\uD83C\\uDDFF\\uD83C\\uDDFC|\\uD83C\\uDDF5\\uD83C\\uDDF7|\\uD83C\\uDDF0\\uD83C\\uDDFE|\\uD83C\\uDDE7\\uD83C\\uDDF2|\\uD83C\\uDDF5\\uD83C\\uDDEB|\\uD83C\\uDDF5\\uD83C\\uDDF8|\\uD83C\\uDDF3\\uD83C\\uDDE8|\\uD83C\\uDDF8\\uD83C\\uDDED|\\uD83C\\uDDE6\\uD83C\\uDDFC|\\uD83C\\uDDFB\\uD83C\\uDDEE|\\uD83C\\uDDED\\uD83C\\uDDF0|\\uD83C\\uDDE6\\uD83C\\uDDE8|\\uD83C\\uDDF2\\uD83C\\uDDF8|\\uD83C\\uDDEC\\uD83C\\uDDFA|\\uD83C\\uDDEC\\uD83C\\uDDF1|\\uD83C\\uDDF3\\uD83C\\uDDFA|\\uD83C\\uDDFC\\uD83C\\uDDEB|\\uD83C\\uDDF2\\uD83C\\uDDF4|\\uD83C\\uDDEB\\uD83C\\uDDF4|\\uD83C\\uDDEB\\uD83C\\uDDF0|\\uD83C\\uDDEF\\uD83C\\uDDEA|\\uD83C\\uDDE6\\uD83C\\uDDEE|\\uD83C\\uDDEC\\uD83C\\uDDEE)", -a.jsecapeMap={"#️⃣":"0023-20E3","#⃣":"0023-20E3","0️⃣":"0030-20E3","0⃣":"0030-20E3","1️⃣":"0031-20E3","1⃣":"0031-20E3","2️⃣":"0032-20E3","2⃣":"0032-20E3","3️⃣":"0033-20E3","3⃣":"0033-20E3","4️⃣":"0034-20E3","4⃣":"0034-20E3","5️⃣":"0035-20E3","5⃣":"0035-20E3","6️⃣":"0036-20E3","6⃣":"0036-20E3","7️⃣":"0037-20E3","7⃣":"0037-20E3","8️⃣":"0038-20E3","8⃣":"0038-20E3","9️⃣":"0039-20E3","9⃣":"0039-20E3","©":"00A9","®":"00AE","‼️":"203C","‼":"203C","⁉️":"2049","⁉":"2049","™":"2122","ℹ️":"2139","ℹ":"2139","↔️":"2194","↔":"2194","↕️":"2195","↕":"2195","↖️":"2196","↖":"2196","↗️":"2197","↗":"2197","↘️":"2198","↘":"2198","↙️":"2199","↙":"2199","↩️":"21A9","↩":"21A9","↪️":"21AA","↪":"21AA","⌚️":"231A","⌚":"231A","⌛️":"231B","⌛":"231B","⏩":"23E9","⏪":"23EA","⏫":"23EB","⏬":"23EC","⏰":"23F0","⏳":"23F3","Ⓜ️":"24C2","Ⓜ":"24C2","▪️":"25AA","▪":"25AA","▫️":"25AB","▫":"25AB","▶️":"25B6","▶":"25B6","◀️":"25C0","◀":"25C0","◻️":"25FB","◻":"25FB","◼️":"25FC","◼":"25FC","◽️":"25FD","◽":"25FD","◾️":"25FE","◾":"25FE","☀️":"2600","☀":"2600","☁️":"2601","☁":"2601","☎️":"260E","☎":"260E","☑️":"2611","☑":"2611","☔️":"2614","☔":"2614","☕️":"2615","☕":"2615","☝️":"261D","☝":"261D","☺️":"263A","☺":"263A","♈️":"2648","♈":"2648","♉️":"2649","♉":"2649","♊️":"264A","♊":"264A","♋️":"264B","♋":"264B","♌️":"264C","♌":"264C","♍️":"264D","♍":"264D","♎️":"264E","♎":"264E","♏️":"264F","♏":"264F","♐️":"2650","♐":"2650","♑️":"2651","♑":"2651","♒️":"2652","♒":"2652","♓️":"2653","♓":"2653","♠️":"2660","♠":"2660","♣️":"2663","♣":"2663","♥️":"2665","♥":"2665","♦️":"2666","♦":"2666","♨️":"2668","♨":"2668","♻️":"267B","♻":"267B","♿️":"267F","♿":"267F","⚓️":"2693","⚓":"2693","⚠️":"26A0","⚠":"26A0","⚡️":"26A1","⚡":"26A1","⚪️":"26AA","⚪":"26AA","⚫️":"26AB","⚫":"26AB","⚽️":"26BD","⚽":"26BD","⚾️":"26BE","⚾":"26BE","⛄️":"26C4","⛄":"26C4","⛅️":"26C5","⛅":"26C5","⛎":"26CE","⛔️":"26D4","⛔":"26D4","⛪️":"26EA","⛪":"26EA","⛲️":"26F2","⛲":"26F2","⛳️":"26F3","⛳":"26F3","⛵️":"26F5","⛵":"26F5","⛺️":"26FA","⛺":"26FA","⛽️":"26FD","⛽":"26FD","✂️":"2702","✂":"2702","✅":"2705","✈️":"2708","✈":"2708","✉️":"2709","✉":"2709","✊":"270A","✋":"270B","✌️":"270C","✌":"270C","✏️":"270F","✏":"270F","✒️":"2712","✒":"2712","✔️":"2714","✔":"2714","✖️":"2716","✖":"2716","✨":"2728","✳️":"2733","✳":"2733","✴️":"2734","✴":"2734","❄️":"2744","❄":"2744","❇️":"2747","❇":"2747","❌":"274C","❎":"274E","❓":"2753","❔":"2754","❕":"2755","❗️":"2757","❗":"2757","❤️":"2764","❤":"2764","➕":"2795","➖":"2796","➗":"2797","➡️":"27A1","➡":"27A1","➰":"27B0","⤴️":"2934","⤴":"2934","⤵️":"2935","⤵":"2935","⬅️":"2B05","⬅":"2B05","⬆️":"2B06","⬆":"2B06","⬇️":"2B07","⬇":"2B07","⬛️":"2B1B","⬛":"2B1B","⬜️":"2B1C","⬜":"2B1C","⭐️":"2B50","⭐":"2B50","⭕️":"2B55","⭕":"2B55","〰":"3030","〽️":"303D","〽":"303D","㊗️":"3297","㊗":"3297","㊙️":"3299","㊙":"3299","🀄️":"1F004","🀄":"1F004","🃏":"1F0CF","🅰":"1F170","🅱":"1F171","🅾":"1F17E","🅿️":"1F17F","🅿":"1F17F","🆎":"1F18E","🆑":"1F191","🆒":"1F192","🆓":"1F193","🆔":"1F194","🆕":"1F195","🆖":"1F196","🆗":"1F197","🆘":"1F198","🆙":"1F199","🆚":"1F19A","🇨🇳":"1F1E8-1F1F3","🇩🇪":"1F1E9-1F1EA","🇪🇸":"1F1EA-1F1F8","🇫🇷":"1F1EB-1F1F7","🇬🇧":"1F1EC-1F1E7","🇮🇹":"1F1EE-1F1F9","🇯🇵":"1F1EF-1F1F5","🇰🇷":"1F1F0-1F1F7","🇺🇸":"1F1FA-1F1F8","🇷🇺":"1F1F7-1F1FA","🈁":"1F201","🈂":"1F202","🈚️":"1F21A","🈚":"1F21A","🈯️":"1F22F","🈯":"1F22F","🈲":"1F232","🈳":"1F233","🈴":"1F234","🈵":"1F235","🈶":"1F236","🈷":"1F237","🈸":"1F238","🈹":"1F239","🈺":"1F23A","🉐":"1F250","🉑":"1F251","🌀":"1F300","🌁":"1F301","🌂":"1F302","🌃":"1F303","🌄":"1F304","🌅":"1F305","🌆":"1F306","🌇":"1F307","🌈":"1F308","🌉":"1F309","🌊":"1F30A","🌋":"1F30B","🌌":"1F30C","🌏":"1F30F","🌑":"1F311","🌓":"1F313","🌔":"1F314","🌕":"1F315","🌙":"1F319","🌛":"1F31B","🌟":"1F31F","🌠":"1F320","🌰":"1F330","🌱":"1F331","🌴":"1F334","🌵":"1F335","🌷":"1F337","🌸":"1F338","🌹":"1F339","🌺":"1F33A","🌻":"1F33B","🌼":"1F33C","🌽":"1F33D","🌾":"1F33E","🌿":"1F33F","🍀":"1F340","🍁":"1F341","🍂":"1F342","🍃":"1F343","🍄":"1F344","🍅":"1F345","🍆":"1F346","🍇":"1F347","🍈":"1F348","🍉":"1F349","🍊":"1F34A","🍌":"1F34C","🍍":"1F34D","🍎":"1F34E","🍏":"1F34F","🍑":"1F351","🍒":"1F352","🍓":"1F353","🍔":"1F354","🍕":"1F355","🍖":"1F356","🍗":"1F357","🍘":"1F358","🍙":"1F359","🍚":"1F35A","🍛":"1F35B","🍜":"1F35C","🍝":"1F35D","🍞":"1F35E","🍟":"1F35F","🍠":"1F360","🍡":"1F361","🍢":"1F362","🍣":"1F363","🍤":"1F364","🍥":"1F365","🍦":"1F366","🍧":"1F367","🍨":"1F368","🍩":"1F369","🍪":"1F36A","🍫":"1F36B","🍬":"1F36C","🍭":"1F36D","🍮":"1F36E","🍯":"1F36F","🍰":"1F370","🍱":"1F371","🍲":"1F372","🍳":"1F373","🍴":"1F374","🍵":"1F375","🍶":"1F376","🍷":"1F377","🍸":"1F378","🍹":"1F379","🍺":"1F37A","🍻":"1F37B","🎀":"1F380","🎁":"1F381","🎂":"1F382","🎃":"1F383","🎄":"1F384","🎅":"1F385","🎆":"1F386","🎇":"1F387","🎈":"1F388","🎉":"1F389","🎊":"1F38A","🎋":"1F38B","🎌":"1F38C","🎍":"1F38D","🎎":"1F38E","🎏":"1F38F","🎐":"1F390","🎑":"1F391","🎒":"1F392","🎓":"1F393","🎠":"1F3A0","🎡":"1F3A1","🎢":"1F3A2","🎣":"1F3A3","🎤":"1F3A4","🎥":"1F3A5","🎦":"1F3A6","🎧":"1F3A7","🎨":"1F3A8","🎩":"1F3A9","🎪":"1F3AA","🎫":"1F3AB","🎬":"1F3AC","🎭":"1F3AD","🎮":"1F3AE","🎯":"1F3AF","🎰":"1F3B0","🎱":"1F3B1","🎲":"1F3B2","🎳":"1F3B3","🎴":"1F3B4","🎵":"1F3B5","🎶":"1F3B6","🎷":"1F3B7","🎸":"1F3B8","🎹":"1F3B9","🎺":"1F3BA","🎻":"1F3BB","🎼":"1F3BC","🎽":"1F3BD","🎾":"1F3BE","🎿":"1F3BF","🏀":"1F3C0","🏁":"1F3C1","🏂":"1F3C2","🏃":"1F3C3","🏄":"1F3C4","🏆":"1F3C6","🏈":"1F3C8","🏊":"1F3CA","🏠":"1F3E0","🏡":"1F3E1","🏢":"1F3E2","🏣":"1F3E3","🏥":"1F3E5","🏦":"1F3E6","🏧":"1F3E7","🏨":"1F3E8","🏩":"1F3E9","🏪":"1F3EA","🏫":"1F3EB","🏬":"1F3EC","🏭":"1F3ED","🏮":"1F3EE","🏯":"1F3EF","🏰":"1F3F0","🐌":"1F40C","🐍":"1F40D","🐎":"1F40E","🐑":"1F411","🐒":"1F412","🐔":"1F414","🐗":"1F417","🐘":"1F418","🐙":"1F419","🐚":"1F41A","🐛":"1F41B","🐜":"1F41C","🐝":"1F41D","🐞":"1F41E","🐟":"1F41F","🐠":"1F420","🐡":"1F421","🐢":"1F422","🐣":"1F423","🐤":"1F424","🐥":"1F425","🐦":"1F426","🐧":"1F427","🐨":"1F428","🐩":"1F429","🐫":"1F42B","🐬":"1F42C","🐭":"1F42D","🐮":"1F42E","🐯":"1F42F","🐰":"1F430","🐱":"1F431","🐲":"1F432","🐳":"1F433","🐴":"1F434","🐵":"1F435","🐶":"1F436","🐷":"1F437","🐸":"1F438","🐹":"1F439","🐺":"1F43A","🐻":"1F43B","🐼":"1F43C","🐽":"1F43D","🐾":"1F43E","👀":"1F440","👂":"1F442","👃":"1F443","👄":"1F444","👅":"1F445","👆":"1F446","👇":"1F447","👈":"1F448","👉":"1F449","👊":"1F44A","👋":"1F44B","👌":"1F44C","👍":"1F44D","👎":"1F44E","👏":"1F44F","👐":"1F450","👑":"1F451","👒":"1F452","👓":"1F453","👔":"1F454","👕":"1F455","👖":"1F456","👗":"1F457","👘":"1F458","👙":"1F459","👚":"1F45A","👛":"1F45B","👜":"1F45C","👝":"1F45D","👞":"1F45E","👟":"1F45F","👠":"1F460","👡":"1F461","👢":"1F462","👣":"1F463","👤":"1F464","👦":"1F466","👧":"1F467","👨":"1F468","👩":"1F469","👪":"1F46A","👫":"1F46B","👮":"1F46E","👯":"1F46F","👰":"1F470","👱":"1F471","👲":"1F472","👳":"1F473","👴":"1F474","👵":"1F475","👶":"1F476","👷":"1F477","👸":"1F478","👹":"1F479","👺":"1F47A","👻":"1F47B","👼":"1F47C","👽":"1F47D","👾":"1F47E","👿":"1F47F","💀":"1F480","📇":"1F4C7","💁":"1F481","💂":"1F482","💃":"1F483","💄":"1F484","💅":"1F485","📒":"1F4D2","💆":"1F486","📓":"1F4D3","💇":"1F487","📔":"1F4D4","💈":"1F488","📕":"1F4D5","💉":"1F489","📖":"1F4D6","💊":"1F48A","📗":"1F4D7","💋":"1F48B","📘":"1F4D8","💌":"1F48C","📙":"1F4D9","💍":"1F48D","📚":"1F4DA","💎":"1F48E","📛":"1F4DB","💏":"1F48F","📜":"1F4DC","💐":"1F490","📝":"1F4DD","💑":"1F491","📞":"1F4DE","💒":"1F492","📟":"1F4DF","📠":"1F4E0","💓":"1F493","📡":"1F4E1","📢":"1F4E2","💔":"1F494","📣":"1F4E3","📤":"1F4E4","💕":"1F495","📥":"1F4E5","📦":"1F4E6","💖":"1F496","📧":"1F4E7","📨":"1F4E8","💗":"1F497","📩":"1F4E9","📪":"1F4EA","💘":"1F498","📫":"1F4EB","📮":"1F4EE","💙":"1F499","📰":"1F4F0","📱":"1F4F1","💚":"1F49A","📲":"1F4F2","📳":"1F4F3","💛":"1F49B","📴":"1F4F4","📶":"1F4F6","💜":"1F49C","📷":"1F4F7","📹":"1F4F9","💝":"1F49D","📺":"1F4FA","📻":"1F4FB","💞":"1F49E","📼":"1F4FC","🔃":"1F503","💟":"1F49F","🔊":"1F50A","🔋":"1F50B","💠":"1F4A0","🔌":"1F50C","🔍":"1F50D","💡":"1F4A1","🔎":"1F50E","🔏":"1F50F","💢":"1F4A2","🔐":"1F510","🔑":"1F511","💣":"1F4A3","🔒":"1F512","🔓":"1F513","💤":"1F4A4","🔔":"1F514","🔖":"1F516","💥":"1F4A5","🔗":"1F517","🔘":"1F518","💦":"1F4A6","🔙":"1F519","🔚":"1F51A","💧":"1F4A7","🔛":"1F51B","🔜":"1F51C","💨":"1F4A8","🔝":"1F51D","🔞":"1F51E","💩":"1F4A9","🔟":"1F51F","💪":"1F4AA","🔠":"1F520","🔡":"1F521","💫":"1F4AB","🔢":"1F522","🔣":"1F523","💬":"1F4AC","🔤":"1F524","🔥":"1F525","💮":"1F4AE","🔦":"1F526","🔧":"1F527","💯":"1F4AF","🔨":"1F528","🔩":"1F529","💰":"1F4B0","🔪":"1F52A","🔫":"1F52B","💱":"1F4B1","🔮":"1F52E","💲":"1F4B2","🔯":"1F52F","💳":"1F4B3","🔰":"1F530","🔱":"1F531","💴":"1F4B4","🔲":"1F532","🔳":"1F533","💵":"1F4B5","🔴":"1F534","🔵":"1F535","💸":"1F4B8","🔶":"1F536","🔷":"1F537","💹":"1F4B9","🔸":"1F538","🔹":"1F539","💺":"1F4BA","🔺":"1F53A","🔻":"1F53B","💻":"1F4BB","🔼":"1F53C","💼":"1F4BC","🔽":"1F53D","🕐":"1F550","💽":"1F4BD","🕑":"1F551","💾":"1F4BE","🕒":"1F552","💿":"1F4BF","🕓":"1F553","📀":"1F4C0","🕔":"1F554","🕕":"1F555","📁":"1F4C1","🕖":"1F556","🕗":"1F557","📂":"1F4C2","🕘":"1F558","🕙":"1F559","📃":"1F4C3","🕚":"1F55A","🕛":"1F55B","📄":"1F4C4","🗻":"1F5FB","🗼":"1F5FC","📅":"1F4C5","🗽":"1F5FD","🗾":"1F5FE","📆":"1F4C6","🗿":"1F5FF","😁":"1F601","😂":"1F602","😃":"1F603","📈":"1F4C8","😄":"1F604","😅":"1F605","📉":"1F4C9","😆":"1F606","😉":"1F609","📊":"1F4CA","😊":"1F60A","😋":"1F60B","📋":"1F4CB","😌":"1F60C","😍":"1F60D","📌":"1F4CC","😏":"1F60F","😒":"1F612","📍":"1F4CD","😓":"1F613","😔":"1F614","📎":"1F4CE","😖":"1F616","😘":"1F618","📏":"1F4CF","😚":"1F61A","😜":"1F61C","📐":"1F4D0","😝":"1F61D","😞":"1F61E","📑":"1F4D1","😠":"1F620","😡":"1F621","😢":"1F622","😣":"1F623","😤":"1F624","😥":"1F625","😨":"1F628","😩":"1F629","😪":"1F62A","😫":"1F62B","😭":"1F62D","😰":"1F630","😱":"1F631","😲":"1F632","😳":"1F633","😵":"1F635","😷":"1F637","😸":"1F638","😹":"1F639","😺":"1F63A","😻":"1F63B","😼":"1F63C","😽":"1F63D","😾":"1F63E","😿":"1F63F","🙀":"1F640","🙅":"1F645","🙆":"1F646","🙇":"1F647","🙈":"1F648","🙉":"1F649","🙊":"1F64A","🙋":"1F64B","🙌":"1F64C","🙍":"1F64D","🙎":"1F64E","🙏":"1F64F","🚀":"1F680","🚃":"1F683","🚄":"1F684","🚅":"1F685","🚇":"1F687","🚉":"1F689","🚌":"1F68C","🚏":"1F68F","🚑":"1F691","🚒":"1F692","🚓":"1F693","🚕":"1F695","🚗":"1F697","🚙":"1F699","🚚":"1F69A","🚢":"1F6A2","🚤":"1F6A4","🚥":"1F6A5","🚧":"1F6A7","🚨":"1F6A8","🚩":"1F6A9","🚪":"1F6AA","🚫":"1F6AB","🚬":"1F6AC","🚭":"1F6AD","🚲":"1F6B2","🚶":"1F6B6","🚹":"1F6B9","🚺":"1F6BA","🚻":"1F6BB","🚼":"1F6BC","🚽":"1F6BD","🚾":"1F6BE","🛀":"1F6C0","😀":"1F600","😇":"1F607","😈":"1F608","😎":"1F60E","😐":"1F610","😑":"1F611","😕":"1F615","😗":"1F617","😙":"1F619","😛":"1F61B","😟":"1F61F","😦":"1F626","😧":"1F627","😬":"1F62C","😮":"1F62E","😯":"1F62F","😴":"1F634","😶":"1F636","🚁":"1F681","🚂":"1F682","🚆":"1F686","🚈":"1F688","🚊":"1F68A","🚍":"1F68D","🚎":"1F68E","🚐":"1F690","🚔":"1F694","🚖":"1F696","🚘":"1F698","🚛":"1F69B","🚜":"1F69C","🚝":"1F69D","🚞":"1F69E","🚟":"1F69F","🚠":"1F6A0","🚡":"1F6A1","🚣":"1F6A3","🚦":"1F6A6","🚮":"1F6AE","🚯":"1F6AF","🚰":"1F6B0","🚱":"1F6B1","🚳":"1F6B3","🚴":"1F6B4","🚵":"1F6B5","🚷":"1F6B7","🚸":"1F6B8","🚿":"1F6BF","🛁":"1F6C1","🛂":"1F6C2","🛃":"1F6C3","🛄":"1F6C4","🛅":"1F6C5","🌍":"1F30D","🌎":"1F30E","🌐":"1F310","🌒":"1F312","🌖":"1F316","🌗":"1F317","🌘":"1F318","🌚":"1F31A","🌜":"1F31C","🌝":"1F31D","🌞":"1F31E","🌲":"1F332","🌳":"1F333","🍋":"1F34B","🍐":"1F350","🍼":"1F37C","🏇":"1F3C7","🏉":"1F3C9","🏤":"1F3E4","🐀":"1F400","🐁":"1F401","🐂":"1F402","🐃":"1F403","🐄":"1F404","🐅":"1F405","🐆":"1F406","🐇":"1F407","🐈":"1F408","🐉":"1F409","🐊":"1F40A","🐋":"1F40B","🐏":"1F40F","🐐":"1F410","🐓":"1F413","🐕":"1F415","🐖":"1F416","🐪":"1F42A","👥":"1F465","👬":"1F46C","👭":"1F46D","💭":"1F4AD","💶":"1F4B6","💷":"1F4B7","📬":"1F4EC","📭":"1F4ED","📯":"1F4EF","📵":"1F4F5","🔀":"1F500","🔁":"1F501","🔂":"1F502","🔄":"1F504","🔅":"1F505","🔆":"1F506","🔇":"1F507","🔉":"1F509","🔕":"1F515","🔬":"1F52C","🔭":"1F52D","🕜":"1F55C","🕝":"1F55D","🕞":"1F55E","🕟":"1F55F","🕠":"1F560","🕡":"1F561","🕢":"1F562","🕣":"1F563","🕤":"1F564","🕥":"1F565","🕦":"1F566","🕧":"1F567","🔈":"1F508","🚋":"1F68B","➿":"27BF","🇦🇫":"1F1E6-1F1EB","🇦🇱":"1F1E6-1F1F1","🇩🇿":"1F1E9-1F1FF","🇦🇩":"1F1E6-1F1E9","🇦🇴":"1F1E6-1F1F4","🇦🇬":"1F1E6-1F1EC","🇦🇷":"1F1E6-1F1F7","🇦🇲":"1F1E6-1F1F2","🇦🇺":"1F1E6-1F1FA","🇦🇹":"1F1E6-1F1F9","🇦🇿":"1F1E6-1F1FF","🇧🇸":"1F1E7-1F1F8","🇧🇭":"1F1E7-1F1ED","🇧🇩":"1F1E7-1F1E9","🇧🇧":"1F1E7-1F1E7","🇧🇾":"1F1E7-1F1FE","🇧🇪":"1F1E7-1F1EA","🇧🇿":"1F1E7-1F1FF","🇧🇯":"1F1E7-1F1EF","🇧🇹":"1F1E7-1F1F9","🇧🇴":"1F1E7-1F1F4","🇧🇦":"1F1E7-1F1E6","🇧🇼":"1F1E7-1F1FC","🇧🇷":"1F1E7-1F1F7","🇧🇳":"1F1E7-1F1F3","🇧🇬":"1F1E7-1F1EC","🇧🇫":"1F1E7-1F1EB","🇧🇮":"1F1E7-1F1EE","🇰🇭":"1F1F0-1F1ED","🇨🇲":"1F1E8-1F1F2","🇨🇦":"1F1E8-1F1E6","🇨🇻":"1F1E8-1F1FB","🇨🇫":"1F1E8-1F1EB","🇹🇩":"1F1F9-1F1E9","🇨🇱":"1F1E8-1F1F1","🇨🇴":"1F1E8-1F1F4","🇰🇲":"1F1F0-1F1F2","🇨🇷":"1F1E8-1F1F7","🇨🇮":"1F1E8-1F1EE","🇭🇷":"1F1ED-1F1F7","🇨🇺":"1F1E8-1F1FA","🇨🇾":"1F1E8-1F1FE","🇨🇿":"1F1E8-1F1FF","🇨🇩":"1F1E8-1F1E9","🇩🇰":"1F1E9-1F1F0","🇩🇯":"1F1E9-1F1EF","🇩🇲":"1F1E9-1F1F2","🇩🇴":"1F1E9-1F1F4","🇹🇱":"1F1F9-1F1F1","🇪🇨":"1F1EA-1F1E8","🇪🇬":"1F1EA-1F1EC","🇸🇻":"1F1F8-1F1FB","🇬🇶":"1F1EC-1F1F6","🇪🇷":"1F1EA-1F1F7","🇪🇪":"1F1EA-1F1EA","🇪🇹":"1F1EA-1F1F9","🇫🇯":"1F1EB-1F1EF","🇫🇮":"1F1EB-1F1EE","🇬🇦":"1F1EC-1F1E6","🇬🇲":"1F1EC-1F1F2","🇬🇪":"1F1EC-1F1EA","🇬🇭":"1F1EC-1F1ED","🇬🇷":"1F1EC-1F1F7","🇬🇩":"1F1EC-1F1E9","🇬🇹":"1F1EC-1F1F9","🇬🇳":"1F1EC-1F1F3","🇬🇼":"1F1EC-1F1FC","🇬🇾":"1F1EC-1F1FE","🇭🇹":"1F1ED-1F1F9","🇭🇳":"1F1ED-1F1F3","🇭🇺":"1F1ED-1F1FA","🇮🇸":"1F1EE-1F1F8","🇮🇳":"1F1EE-1F1F3","🇮🇩":"1F1EE-1F1E9","🇮🇷":"1F1EE-1F1F7","🇮🇶":"1F1EE-1F1F6","🇮🇪":"1F1EE-1F1EA","🇮🇱":"1F1EE-1F1F1","🇯🇲":"1F1EF-1F1F2","🇯🇴":"1F1EF-1F1F4","🇰🇿":"1F1F0-1F1FF","🇰🇪":"1F1F0-1F1EA","🇰🇮":"1F1F0-1F1EE","🇽🇰":"1F1FD-1F1F0","🇰🇼":"1F1F0-1F1FC","🇰🇬":"1F1F0-1F1EC","🇱🇦":"1F1F1-1F1E6","🇱🇻":"1F1F1-1F1FB","🇱🇧":"1F1F1-1F1E7","🇱🇸":"1F1F1-1F1F8","🇱🇷":"1F1F1-1F1F7","🇱🇾":"1F1F1-1F1FE","🇱🇮":"1F1F1-1F1EE","🇱🇹":"1F1F1-1F1F9","🇱🇺":"1F1F1-1F1FA","🇲🇰":"1F1F2-1F1F0","🇲🇬":"1F1F2-1F1EC","🇲🇼":"1F1F2-1F1FC","🇲🇾":"1F1F2-1F1FE","🇲🇻":"1F1F2-1F1FB","🇲🇱":"1F1F2-1F1F1","🇲🇹":"1F1F2-1F1F9","🇲🇭":"1F1F2-1F1ED","🇲🇷":"1F1F2-1F1F7","🇲🇺":"1F1F2-1F1FA","🇲🇽":"1F1F2-1F1FD","🇫🇲":"1F1EB-1F1F2","🇲🇩":"1F1F2-1F1E9","🇲🇨":"1F1F2-1F1E8","🇲🇳":"1F1F2-1F1F3","🇲🇪":"1F1F2-1F1EA","🇲🇦":"1F1F2-1F1E6","🇲🇿":"1F1F2-1F1FF","🇲🇲":"1F1F2-1F1F2","🇳🇦":"1F1F3-1F1E6","🇳🇷":"1F1F3-1F1F7","🇳🇵":"1F1F3-1F1F5","🇳🇱":"1F1F3-1F1F1","🇳🇿":"1F1F3-1F1FF","🇳🇮":"1F1F3-1F1EE","🇳🇪":"1F1F3-1F1EA","🇳🇬":"1F1F3-1F1EC","🇰🇵":"1F1F0-1F1F5","🇳🇴":"1F1F3-1F1F4","🇴🇲":"1F1F4-1F1F2","🇵🇰":"1F1F5-1F1F0","🇵🇼":"1F1F5-1F1FC","🇵🇦":"1F1F5-1F1E6","🇵🇬":"1F1F5-1F1EC","🇵🇾":"1F1F5-1F1FE","🇵🇪":"1F1F5-1F1EA","🇵🇭":"1F1F5-1F1ED","🇵🇱":"1F1F5-1F1F1","🇵🇹":"1F1F5-1F1F9","🇶🇦":"1F1F6-1F1E6","🇹🇼":"1F1F9-1F1FC","🇨🇬":"1F1E8-1F1EC","🇷🇴":"1F1F7-1F1F4","🇷🇼":"1F1F7-1F1FC","🇰🇳":"1F1F0-1F1F3","🇱🇨":"1F1F1-1F1E8","🇻🇨":"1F1FB-1F1E8","🇼🇸":"1F1FC-1F1F8","🇸🇲":"1F1F8-1F1F2","🇸🇹":"1F1F8-1F1F9","🇸🇦":"1F1F8-1F1E6","🇸🇳":"1F1F8-1F1F3","🇷🇸":"1F1F7-1F1F8","🇸🇨":"1F1F8-1F1E8","🇸🇱":"1F1F8-1F1F1","🇸🇬":"1F1F8-1F1EC","🇸🇰":"1F1F8-1F1F0","🇸🇮":"1F1F8-1F1EE","🇸🇧":"1F1F8-1F1E7","🇸🇴":"1F1F8-1F1F4","🇿🇦":"1F1FF-1F1E6","🇱🇰":"1F1F1-1F1F0","🇸🇩":"1F1F8-1F1E9","🇸🇷":"1F1F8-1F1F7","🇸🇿":"1F1F8-1F1FF","🇸🇪":"1F1F8-1F1EA","🇨🇭":"1F1E8-1F1ED","🇸🇾":"1F1F8-1F1FE","🇹🇯":"1F1F9-1F1EF","🇹🇿":"1F1F9-1F1FF","🇹🇭":"1F1F9-1F1ED","🇹🇬":"1F1F9-1F1EC","🇹🇴":"1F1F9-1F1F4","🇹🇹":"1F1F9-1F1F9","🇹🇳":"1F1F9-1F1F3","🇹🇷":"1F1F9-1F1F7","🇹🇲":"1F1F9-1F1F2","🇹🇻":"1F1F9-1F1FB","🇺🇬":"1F1FA-1F1EC","🇺🇦":"1F1FA-1F1E6","🇦🇪":"1F1E6-1F1EA","🇺🇾":"1F1FA-1F1FE","🇺🇿":"1F1FA-1F1FF","🇻🇺":"1F1FB-1F1FA","🇻🇦":"1F1FB-1F1E6","🇻🇪":"1F1FB-1F1EA","🇻🇳":"1F1FB-1F1F3","🇪🇭":"1F1EA-1F1ED","🇾🇪":"1F1FE-1F1EA","🇿🇲":"1F1FF-1F1F2","🇿🇼":"1F1FF-1F1FC","🇵🇷":"1F1F5-1F1F7","🇰🇾":"1F1F0-1F1FE","🇧🇲":"1F1E7-1F1F2","🇵🇫":"1F1F5-1F1EB","🇵🇸":"1F1F5-1F1F8","🇳🇨":"1F1F3-1F1E8","🇸🇭":"1F1F8-1F1ED","🇦🇼":"1F1E6-1F1FC","🇻🇮":"1F1FB-1F1EE","🇭🇰":"1F1ED-1F1F0","🇦🇨":"1F1E6-1F1E8","🇲🇸":"1F1F2-1F1F8","🇬🇺":"1F1EC-1F1FA","🇬🇱":"1F1EC-1F1F1","🇳🇺":"1F1F3-1F1FA","🇼🇫":"1F1FC-1F1EB","🇲🇴":"1F1F2-1F1F4","🇫🇴":"1F1EB-1F1F4","🇫🇰":"1F1EB-1F1F0","🇯🇪":"1F1EF-1F1EA","🇦🇮":"1F1E6-1F1EE","🇬🇮":"1F1EC-1F1EE"},a.shortnameRegexp=":([-+\\w]+):",a.imagePathPNG="//cdn.jsdelivr.net/emojione/assets/png/",a.imagePathSVG="//cdn.jsdelivr.net/emojione/assets/svg/",a.imagePathSVGSprites="./../assets/sprites/emojione.sprites.svg",a.imageType="png",a.sprites=!1,a.unicodeAlt=!0,a.ascii=!1,a.cacheBustParam="?v=1.2.4",a.toImage=function(b){return b=a.unicodeToImage(b),b=a.shortnameToImage(b)},a.unifyUnicode=function(b){return b=a.toShort(b),b=a.shortnameToUnicode(b)},a.shortnameToAscii=function(b){var c,d=a.objectFlip(a.asciiList);return b=b.replace(new RegExp("]*>.*?|]*>.*?
      |<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+a.shortnameRegexp+")","gi"),function(b){return"undefined"!=typeof b&&""!==b&&b in a.emojioneList?(c=a.emojioneList[b][a.emojioneList[b].length-1].toLowerCase(),"undefined"!=typeof d[c]?d[c]:b):b})},a.shortnameToUnicode=function(b){var c;return b=b.replace(new RegExp("]*>.*?|]*>.*?
      |<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+a.shortnameRegexp+")","gi"),function(b){return"undefined"!=typeof b&&""!==b&&b in a.emojioneList?(c=a.emojioneList[b][a.emojioneList[b].length-1].toUpperCase(),a.convert(c)):b}),a.ascii&&(b=b.replace(new RegExp("]*>.*?|]*>.*?|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)"+a.asciiRegexp+"(?=\\s|$|[!,.]))","g"),function(b,d,e,f){return"undefined"!=typeof f&&""!==f&&a.unescapeHTML(f)in a.asciiList?(f=a.unescapeHTML(f),c=a.asciiList[f].toUpperCase(),e+a.convert(c)):b})),b},a.shortnameToImage=function(b){var c,d,e;return b=b.replace(new RegExp("]*>.*?|]*>.*?|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+a.shortnameRegexp+")","gi"),function(b){return"undefined"!=typeof b&&""!==b&&b in a.emojioneList?(d=a.emojioneList[b][a.emojioneList[b].length-1].toUpperCase(),e=a.unicodeAlt?a.convert(d):b,c="png"===a.imageType?a.sprites?''+e+"":''+e+'':a.sprites?''+e+'':''+e+""):b}),a.ascii&&(b=b.replace(new RegExp("]*>.*?|]*>.*?|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)"+a.asciiRegexp+"(?=\\s|$|[!,.]))","g"),function(b,f,g,h){return"undefined"!=typeof h&&""!==h&&a.unescapeHTML(h)in a.asciiList?(h=a.unescapeHTML(h),d=a.asciiList[h].toUpperCase(),e=a.unicodeAlt?a.convert(d):a.escapeHTML(h),c="png"===a.imageType?a.sprites?g+''+e+"":g+''+e+'':a.sprites?''+e+'':g+''+e+""):b})),b},a.unicodeToImage=function(b){var c,d,e;if(!a.unicodeAlt||a.sprites)var f=a.mapShortToUnicode();return b=b.replace(new RegExp("]*>.*?|]*>.*?|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+a.unicodeRegexp+")","gi"),function(b){return"undefined"!=typeof b&&""!==b&&b in a.jsecapeMap?(d=a.jsecapeMap[b],e=a.unicodeAlt?a.convert(d):f[d],c="png"===a.imageType?a.sprites?''+e+"":''+e+'':a.sprites?''+e+'':''+e+''):b})},a.toShort=function(b){for(var c in a.emojioneList)if(a.emojioneList.hasOwnProperty(c))for(var d in a.emojioneList[c])if(a.emojioneList[c].hasOwnProperty(d)){var e=a.emojioneList[c][d].toUpperCase();b=a.replaceAll(b,a.convert(e),c)}return b},a.convert=function(a){if(a.indexOf("-")>-1){for(var b=[],c=a.split("-"),d=0;d=65536&&1114111>=e){var f=Math.floor((e-65536)/1024)+55296,g=(e-65536)%1024+56320;e=String.fromCharCode(f)+String.fromCharCode(g)}else e=String.fromCharCode(e);b.push(e)}return b.join("")}var c=parseInt(a,16);if(c>=65536&&1114111>=c){var f=Math.floor((c-65536)/1024)+55296,g=(c-65536)%1024+56320;return String.fromCharCode(f)+String.fromCharCode(g)}return String.fromCharCode(c)},a.escapeHTML=function(a){var b={"&":"&","<":"<",">":">",'"':""","'":"'"};return a.replace(/[&<>"']/g,function(a){return b[a]})},a.unescapeHTML=function(a){var b={"&":"&","&":"&","&":"&","<":"<","<":"<","<":"<",">":">",">":">",">":">",""":'"',""":'"',""":'"',"'":"'","'":"'","'":"'"};return a.replace(/&(?:amp|#38|#x26|lt|#60|#x3C|gt|#62|#x3E|apos|#39|#x27|quot|#34|#x22);/gi,function(a){return b[a]})},a.mapShortToUnicode=function(){var b={};for(var c in a.emojioneList)if(a.emojioneList.hasOwnProperty(c))for(var d in a.emojioneList[c])a.emojioneList[c].hasOwnProperty(d)&&(b[a.emojioneList[c][d].toUpperCase()]=c);return b},a.objectFlip=function(a){var b,c={};for(b in a)a.hasOwnProperty(b)&&(c[a[b]]=b);return c},a.escapeRegExp=function(a){return a.replace(/[-[\]{}()*+?.,;:&\\^$|#\s]/g,"\\$&")},a.replaceAll=function(a,b,c){var d=new RegExp("]*>.*?|]*>.*?|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+b+")","gi"),e=function(a,b){return"undefined"==typeof b||""===b?a:c};return a.replace(d,e)}}(this.emojione=this.emojione||{}),"object"==typeof module&&(module.exports=this.emojione); diff --git a/pagure/static/emoji/emojione.js b/pagure/static/emoji/emojione.js deleted file mode 120000 index 8dd95a4..0000000 --- a/pagure/static/emoji/emojione.js +++ /dev/null @@ -1 +0,0 @@ -emojione-1.3.1.js \ No newline at end of file diff --git a/pagure/static/emoji/emojione.min.js b/pagure/static/emoji/emojione.min.js deleted file mode 120000 index edcc80b..0000000 --- a/pagure/static/emoji/emojione.min.js +++ /dev/null @@ -1 +0,0 @@ -emojione-1.3.1.min.js \ No newline at end of file diff --git a/pagure/static/emoji/emojione.sprites-1.3.1.css b/pagure/static/emoji/emojione.sprites-1.3.1.css deleted file mode 100644 index 06c1394..0000000 --- a/pagure/static/emoji/emojione.sprites-1.3.1.css +++ /dev/null @@ -1,4298 +0,0 @@ -[class*=emojione-] { - text-indent: -9999em; - image-rendering: optimizeQuality; - font-size: inherit; - height: 1.3em; - width: 1.3em; - top: -3px; - position: relative; - display: inline-block; - margin: 0 .15em; - line-height: normal; - vertical-align: middle; - background-image: url("emojione.sprites.png"); - background-size: 3300%; - background-repeat: no-repeat -} - -.emojione-0023-20E3 { - background-position: 3.125% 0% -} - -.emojione-0030-20E3 { - background-position: 21.875% 64.51613% -} - -.emojione-0031-20E3 { - background-position: 0% 3.22581% -} - -.emojione-0032-20E3 { - background-position: 3.125% 3.22581% -} - -.emojione-0033-20E3 { - background-position: 6.25% 0% -} - -.emojione-0034-20E3 { - background-position: 6.25% 3.22581% -} - -.emojione-0035-20E3 { - background-position: 0% 6.45161% -} - -.emojione-0036-20E3 { - background-position: 3.125% 6.45161% -} - -.emojione-0037-20E3 { - background-position: 6.25% 6.45161% -} - -.emojione-0038-20E3 { - background-position: 9.375% 0% -} - -.emojione-0039-20E3 { - background-position: 9.375% 3.22581% -} - -.emojione-00A9 { - background-position: 9.375% 6.45161% -} - -.emojione-00AE { - background-position: 0% 9.67742% -} - -.emojione-1F004 { - background-position: 3.125% 9.67742% -} - -.emojione-1F0CF { - background-position: 6.25% 9.67742% -} - -.emojione-1F170 { - background-position: 9.375% 9.67742% -} - -.emojione-1F171 { - background-position: 12.5% 0% -} - -.emojione-1F17E { - background-position: 12.5% 3.22581% -} - -.emojione-1F17F { - background-position: 12.5% 6.45161% -} - -.emojione-1F18E { - background-position: 12.5% 9.67742% -} - -.emojione-1F191 { - background-position: 0% 12.90323% -} - -.emojione-1F192 { - background-position: 3.125% 12.90323% -} - -.emojione-1F193 { - background-position: 6.25% 12.90323% -} - -.emojione-1F194 { - background-position: 9.375% 12.90323% -} - -.emojione-1F195 { - background-position: 12.5% 12.90323% -} - -.emojione-1F196 { - background-position: 15.625% 0% -} - -.emojione-1F197 { - background-position: 15.625% 3.22581% -} - -.emojione-1F198 { - background-position: 15.625% 6.45161% -} - -.emojione-1F199 { - background-position: 15.625% 9.67742% -} - -.emojione-1F19A { - background-position: 15.625% 12.90323% -} - -.emojione-1F1E6-1F1E8 { - background-position: 0% 16.12903% -} - -.emojione-1F1E6-1F1E9 { - background-position: 3.125% 16.12903% -} - -.emojione-1F1E6-1F1EA { - background-position: 6.25% 16.12903% -} - -.emojione-1F1E6-1F1EB { - background-position: 9.375% 16.12903% -} - -.emojione-1F1E6-1F1EC { - background-position: 12.5% 16.12903% -} - -.emojione-1F1E6-1F1EE { - background-position: 15.625% 16.12903% -} - -.emojione-1F1E6-1F1F1 { - background-position: 18.75% 0% -} - -.emojione-1F1E6-1F1F2 { - background-position: 18.75% 3.22581% -} - -.emojione-1F1E6-1F1F4 { - background-position: 18.75% 6.45161% -} - -.emojione-1F1E6-1F1F7 { - background-position: 18.75% 9.67742% -} - -.emojione-1F1E6-1F1F9 { - background-position: 18.75% 12.90323% -} - -.emojione-1F1E6-1F1FA { - background-position: 18.75% 16.12903% -} - -.emojione-1F1E6-1F1FC { - background-position: 0% 19.35484% -} - -.emojione-1F1E6-1F1FF { - background-position: 3.125% 19.35484% -} - -.emojione-1F1E7-1F1E6 { - background-position: 6.25% 19.35484% -} - -.emojione-1F1E7-1F1E7 { - background-position: 9.375% 19.35484% -} - -.emojione-1F1E7-1F1E9 { - background-position: 12.5% 19.35484% -} - -.emojione-1F1E7-1F1EA { - background-position: 15.625% 19.35484% -} - -.emojione-1F1E7-1F1EB { - background-position: 18.75% 19.35484% -} - -.emojione-1F1E7-1F1EC { - background-position: 21.875% 0% -} - -.emojione-1F1E7-1F1ED { - background-position: 21.875% 3.22581% -} - -.emojione-1F1E7-1F1EE { - background-position: 21.875% 6.45161% -} - -.emojione-1F1E7-1F1EF { - background-position: 21.875% 9.67742% -} - -.emojione-1F1E7-1F1F2 { - background-position: 21.875% 12.90323% -} - -.emojione-1F1E7-1F1F3 { - background-position: 21.875% 16.12903% -} - -.emojione-1F1E7-1F1F4 { - background-position: 21.875% 19.35484% -} - -.emojione-1F1E7-1F1F7 { - background-position: 0% 22.58065% -} - -.emojione-1F1E7-1F1F8 { - background-position: 3.125% 22.58065% -} - -.emojione-1F1E7-1F1F9 { - background-position: 6.25% 22.58065% -} - -.emojione-1F1E7-1F1FC { - background-position: 9.375% 22.58065% -} - -.emojione-1F1E7-1F1FE { - background-position: 12.5% 22.58065% -} - -.emojione-1F1E7-1F1FF { - background-position: 15.625% 22.58065% -} - -.emojione-1F1E8-1F1E6 { - background-position: 18.75% 22.58065% -} - -.emojione-1F1E8-1F1E9 { - background-position: 21.875% 22.58065% -} - -.emojione-1F1E8-1F1EB { - background-position: 25% 0% -} - -.emojione-1F1E8-1F1EC { - background-position: 25% 3.22581% -} - -.emojione-1F1E8-1F1ED { - background-position: 25% 6.45161% -} - -.emojione-1F1E8-1F1EE { - background-position: 25% 9.67742% -} - -.emojione-1F1E8-1F1F1 { - background-position: 25% 12.90323% -} - -.emojione-1F1E8-1F1F2 { - background-position: 25% 16.12903% -} - -.emojione-1F1E8-1F1F3 { - background-position: 25% 19.35484% -} - -.emojione-1F1E8-1F1F4 { - background-position: 25% 22.58065% -} - -.emojione-1F1E8-1F1F7 { - background-position: 0% 25.80645% -} - -.emojione-1F1E8-1F1FA { - background-position: 3.125% 25.80645% -} - -.emojione-1F1E8-1F1FB { - background-position: 6.25% 25.80645% -} - -.emojione-1F1E8-1F1FE { - background-position: 9.375% 25.80645% -} - -.emojione-1F1E8-1F1FF { - background-position: 12.5% 25.80645% -} - -.emojione-1F1E9-1F1EA { - background-position: 15.625% 25.80645% -} - -.emojione-1F1E9-1F1EF { - background-position: 18.75% 25.80645% -} - -.emojione-1F1E9-1F1F0 { - background-position: 21.875% 25.80645% -} - -.emojione-1F1E9-1F1F2 { - background-position: 25% 25.80645% -} - -.emojione-1F1E9-1F1F4 { - background-position: 28.125% 0% -} - -.emojione-1F1E9-1F1FF { - background-position: 28.125% 3.22581% -} - -.emojione-1F1EA-1F1E8 { - background-position: 28.125% 6.45161% -} - -.emojione-1F1EA-1F1EA { - background-position: 28.125% 9.67742% -} - -.emojione-1F1EA-1F1EC { - background-position: 28.125% 12.90323% -} - -.emojione-1F1EA-1F1ED { - background-position: 28.125% 16.12903% -} - -.emojione-1F1EA-1F1F7 { - background-position: 28.125% 19.35484% -} - -.emojione-1F1EA-1F1F8 { - background-position: 28.125% 22.58065% -} - -.emojione-1F1EA-1F1F9 { - background-position: 28.125% 25.80645% -} - -.emojione-1F1EB-1F1EE { - background-position: 0% 29.03226% -} - -.emojione-1F1EB-1F1EF { - background-position: 3.125% 29.03226% -} - -.emojione-1F1EB-1F1F0 { - background-position: 6.25% 29.03226% -} - -.emojione-1F1EB-1F1F2 { - background-position: 9.375% 29.03226% -} - -.emojione-1F1EB-1F1F4 { - background-position: 12.5% 29.03226% -} - -.emojione-1F1EB-1F1F7 { - background-position: 15.625% 29.03226% -} - -.emojione-1F1EC-1F1E6 { - background-position: 18.75% 29.03226% -} - -.emojione-1F1EC-1F1E7 { - background-position: 21.875% 29.03226% -} - -.emojione-1F1EC-1F1E9 { - background-position: 25% 29.03226% -} - -.emojione-1F1EC-1F1EA { - background-position: 28.125% 29.03226% -} - -.emojione-1F1EC-1F1ED { - background-position: 31.25% 0% -} - -.emojione-1F1EC-1F1EE { - background-position: 31.25% 3.22581% -} - -.emojione-1F1EC-1F1F1 { - background-position: 31.25% 6.45161% -} - -.emojione-1F1EC-1F1F2 { - background-position: 31.25% 9.67742% -} - -.emojione-1F1EC-1F1F3 { - background-position: 31.25% 12.90323% -} - -.emojione-1F1EC-1F1F6 { - background-position: 31.25% 16.12903% -} - -.emojione-1F1EC-1F1F7 { - background-position: 31.25% 19.35484% -} - -.emojione-1F1EC-1F1F9 { - background-position: 31.25% 22.58065% -} - -.emojione-1F1EC-1F1FA { - background-position: 31.25% 25.80645% -} - -.emojione-1F1EC-1F1FC { - background-position: 31.25% 29.03226% -} - -.emojione-1F1EC-1F1FE { - background-position: 0% 32.25806% -} - -.emojione-1F1ED-1F1F0 { - background-position: 3.125% 32.25806% -} - -.emojione-1F1ED-1F1F3 { - background-position: 6.25% 32.25806% -} - -.emojione-1F1ED-1F1F7 { - background-position: 9.375% 32.25806% -} - -.emojione-1F1ED-1F1F9 { - background-position: 12.5% 32.25806% -} - -.emojione-1F1ED-1F1FA { - background-position: 15.625% 32.25806% -} - -.emojione-1F1EE-1F1E9 { - background-position: 18.75% 32.25806% -} - -.emojione-1F1EE-1F1EA { - background-position: 21.875% 32.25806% -} - -.emojione-1F1EE-1F1F1 { - background-position: 25% 32.25806% -} - -.emojione-1F1EE-1F1F3 { - background-position: 28.125% 32.25806% -} - -.emojione-1F1EE-1F1F6 { - background-position: 31.25% 32.25806% -} - -.emojione-1F1EE-1F1F7 { - background-position: 34.375% 0% -} - -.emojione-1F1EE-1F1F8 { - background-position: 34.375% 3.22581% -} - -.emojione-1F1EE-1F1F9 { - background-position: 34.375% 6.45161% -} - -.emojione-1F1EF-1F1EA { - background-position: 34.375% 9.67742% -} - -.emojione-1F1EF-1F1F2 { - background-position: 34.375% 12.90323% -} - -.emojione-1F1EF-1F1F4 { - background-position: 34.375% 16.12903% -} - -.emojione-1F1EF-1F1F5 { - background-position: 34.375% 19.35484% -} - -.emojione-1F1F0-1F1EA { - background-position: 34.375% 22.58065% -} - -.emojione-1F1F0-1F1EC { - background-position: 34.375% 25.80645% -} - -.emojione-1F1F0-1F1ED { - background-position: 34.375% 29.03226% -} - -.emojione-1F1F0-1F1EE { - background-position: 34.375% 32.25806% -} - -.emojione-1F1F0-1F1F2 { - background-position: 0% 35.48387% -} - -.emojione-1F1F0-1F1F3 { - background-position: 3.125% 35.48387% -} - -.emojione-1F1F0-1F1F5 { - background-position: 6.25% 35.48387% -} - -.emojione-1F1F0-1F1F7 { - background-position: 9.375% 35.48387% -} - -.emojione-1F1F0-1F1FC { - background-position: 12.5% 35.48387% -} - -.emojione-1F1F0-1F1FE { - background-position: 15.625% 35.48387% -} - -.emojione-1F1F0-1F1FF { - background-position: 18.75% 35.48387% -} - -.emojione-1F1F1-1F1E6 { - background-position: 21.875% 35.48387% -} - -.emojione-1F1F1-1F1E7 { - background-position: 25% 35.48387% -} - -.emojione-1F1F1-1F1E8 { - background-position: 28.125% 35.48387% -} - -.emojione-1F1F1-1F1EE { - background-position: 31.25% 35.48387% -} - -.emojione-1F1F1-1F1F0 { - background-position: 34.375% 35.48387% -} - -.emojione-1F1F1-1F1F7 { - background-position: 37.5% 0% -} - -.emojione-1F1F1-1F1F8 { - background-position: 37.5% 3.22581% -} - -.emojione-1F1F1-1F1F9 { - background-position: 37.5% 6.45161% -} - -.emojione-1F1F1-1F1FA { - background-position: 37.5% 9.67742% -} - -.emojione-1F1F1-1F1FB { - background-position: 37.5% 12.90323% -} - -.emojione-1F1F1-1F1FE { - background-position: 37.5% 16.12903% -} - -.emojione-1F1F2-1F1E6 { - background-position: 37.5% 19.35484% -} - -.emojione-1F1F2-1F1E8 { - background-position: 37.5% 22.58065% -} - -.emojione-1F1F2-1F1E9 { - background-position: 37.5% 25.80645% -} - -.emojione-1F1F2-1F1EA { - background-position: 37.5% 29.03226% -} - -.emojione-1F1F2-1F1EC { - background-position: 37.5% 32.25806% -} - -.emojione-1F1F2-1F1ED { - background-position: 37.5% 35.48387% -} - -.emojione-1F1F2-1F1F0 { - background-position: 0% 38.70968% -} - -.emojione-1F1F2-1F1F1 { - background-position: 3.125% 38.70968% -} - -.emojione-1F1F2-1F1F2 { - background-position: 6.25% 38.70968% -} - -.emojione-1F1F2-1F1F3 { - background-position: 9.375% 38.70968% -} - -.emojione-1F1F2-1F1F4 { - background-position: 12.5% 38.70968% -} - -.emojione-1F1F2-1F1F7 { - background-position: 15.625% 38.70968% -} - -.emojione-1F1F2-1F1F8 { - background-position: 18.75% 38.70968% -} - -.emojione-1F1F2-1F1F9 { - background-position: 21.875% 38.70968% -} - -.emojione-1F1F2-1F1FA { - background-position: 25% 38.70968% -} - -.emojione-1F1F2-1F1FB { - background-position: 28.125% 38.70968% -} - -.emojione-1F1F2-1F1FC { - background-position: 31.25% 38.70968% -} - -.emojione-1F1F2-1F1FD { - background-position: 34.375% 38.70968% -} - -.emojione-1F1F2-1F1FE { - background-position: 37.5% 38.70968% -} - -.emojione-1F1F2-1F1FF { - background-position: 40.625% 0% -} - -.emojione-1F1F3-1F1E6 { - background-position: 40.625% 3.22581% -} - -.emojione-1F1F3-1F1E8 { - background-position: 40.625% 6.45161% -} - -.emojione-1F1F3-1F1EA { - background-position: 40.625% 9.67742% -} - -.emojione-1F1F3-1F1EC { - background-position: 40.625% 12.90323% -} - -.emojione-1F1F3-1F1EE { - background-position: 40.625% 16.12903% -} - -.emojione-1F1F3-1F1F1 { - background-position: 40.625% 19.35484% -} - -.emojione-1F1F3-1F1F4 { - background-position: 40.625% 22.58065% -} - -.emojione-1F1F3-1F1F5 { - background-position: 40.625% 25.80645% -} - -.emojione-1F1F3-1F1F7 { - background-position: 40.625% 29.03226% -} - -.emojione-1F1F3-1F1FA { - background-position: 40.625% 32.25806% -} - -.emojione-1F1F3-1F1FF { - background-position: 40.625% 35.48387% -} - -.emojione-1F1F4-1F1F2 { - background-position: 40.625% 38.70968% -} - -.emojione-1F1F5-1F1E6 { - background-position: 0% 41.93548% -} - -.emojione-1F1F5-1F1EA { - background-position: 3.125% 41.93548% -} - -.emojione-1F1F5-1F1EB { - background-position: 6.25% 41.93548% -} - -.emojione-1F1F5-1F1EC { - background-position: 9.375% 41.93548% -} - -.emojione-1F1F5-1F1ED { - background-position: 12.5% 41.93548% -} - -.emojione-1F1F5-1F1F0 { - background-position: 15.625% 41.93548% -} - -.emojione-1F1F5-1F1F1 { - background-position: 18.75% 41.93548% -} - -.emojione-1F1F5-1F1F7 { - background-position: 21.875% 41.93548% -} - -.emojione-1F1F5-1F1F8 { - background-position: 25% 41.93548% -} - -.emojione-1F1F5-1F1F9 { - background-position: 28.125% 41.93548% -} - -.emojione-1F1F5-1F1FC { - background-position: 31.25% 41.93548% -} - -.emojione-1F1F5-1F1FE { - background-position: 34.375% 41.93548% -} - -.emojione-1F1F6-1F1E6 { - background-position: 37.5% 41.93548% -} - -.emojione-1F1F7-1F1F4 { - background-position: 40.625% 41.93548% -} - -.emojione-1F1F7-1F1F8 { - background-position: 43.75% 0% -} - -.emojione-1F1F7-1F1FA { - background-position: 43.75% 3.22581% -} - -.emojione-1F1F7-1F1FC { - background-position: 43.75% 6.45161% -} - -.emojione-1F1F8-1F1E6 { - background-position: 43.75% 9.67742% -} - -.emojione-1F1F8-1F1E7 { - background-position: 43.75% 12.90323% -} - -.emojione-1F1F8-1F1E8 { - background-position: 43.75% 16.12903% -} - -.emojione-1F1F8-1F1E9 { - background-position: 43.75% 19.35484% -} - -.emojione-1F1F8-1F1EA { - background-position: 43.75% 22.58065% -} - -.emojione-1F1F8-1F1EC { - background-position: 43.75% 25.80645% -} - -.emojione-1F1F8-1F1ED { - background-position: 43.75% 29.03226% -} - -.emojione-1F1F8-1F1EE { - background-position: 43.75% 32.25806% -} - -.emojione-1F1F8-1F1F0 { - background-position: 43.75% 35.48387% -} - -.emojione-1F1F8-1F1F1 { - background-position: 43.75% 38.70968% -} - -.emojione-1F1F8-1F1F2 { - background-position: 43.75% 41.93548% -} - -.emojione-1F1F8-1F1F3 { - background-position: 0% 45.16129% -} - -.emojione-1F1F8-1F1F4 { - background-position: 3.125% 45.16129% -} - -.emojione-1F1F8-1F1F7 { - background-position: 6.25% 45.16129% -} - -.emojione-1F1F8-1F1F9 { - background-position: 9.375% 45.16129% -} - -.emojione-1F1F8-1F1FB { - background-position: 12.5% 45.16129% -} - -.emojione-1F1F8-1F1FE { - background-position: 15.625% 45.16129% -} - -.emojione-1F1F8-1F1FF { - background-position: 18.75% 45.16129% -} - -.emojione-1F1F9-1F1E9 { - background-position: 21.875% 45.16129% -} - -.emojione-1F1F9-1F1EC { - background-position: 25% 45.16129% -} - -.emojione-1F1F9-1F1ED { - background-position: 28.125% 45.16129% -} - -.emojione-1F1F9-1F1EF { - background-position: 31.25% 45.16129% -} - -.emojione-1F1F9-1F1F1 { - background-position: 34.375% 45.16129% -} - -.emojione-1F1F9-1F1F2 { - background-position: 37.5% 45.16129% -} - -.emojione-1F1F9-1F1F3 { - background-position: 40.625% 45.16129% -} - -.emojione-1F1F9-1F1F4 { - background-position: 43.75% 45.16129% -} - -.emojione-1F1F9-1F1F7 { - background-position: 46.875% 0% -} - -.emojione-1F1F9-1F1F9 { - background-position: 46.875% 3.22581% -} - -.emojione-1F1F9-1F1FB { - background-position: 46.875% 6.45161% -} - -.emojione-1F1F9-1F1FC { - background-position: 46.875% 9.67742% -} - -.emojione-1F1F9-1F1FF { - background-position: 46.875% 12.90323% -} - -.emojione-1F1FA-1F1E6 { - background-position: 46.875% 16.12903% -} - -.emojione-1F1FA-1F1EC { - background-position: 46.875% 19.35484% -} - -.emojione-1F1FA-1F1F8 { - background-position: 46.875% 22.58065% -} - -.emojione-1F1FA-1F1FE { - background-position: 46.875% 25.80645% -} - -.emojione-1F1FA-1F1FF { - background-position: 46.875% 29.03226% -} - -.emojione-1F1FB-1F1E6 { - background-position: 46.875% 32.25806% -} - -.emojione-1F1FB-1F1E8 { - background-position: 46.875% 35.48387% -} - -.emojione-1F1FB-1F1EA { - background-position: 46.875% 38.70968% -} - -.emojione-1F1FB-1F1EE { - background-position: 46.875% 41.93548% -} - -.emojione-1F1FB-1F1F3 { - background-position: 46.875% 45.16129% -} - -.emojione-1F1FB-1F1FA { - background-position: 0% 48.3871% -} - -.emojione-1F1FC-1F1EB { - background-position: 3.125% 48.3871% -} - -.emojione-1F1FC-1F1F8 { - background-position: 6.25% 48.3871% -} - -.emojione-1F1FD-1F1F0 { - background-position: 9.375% 48.3871% -} - -.emojione-1F1FE-1F1EA { - background-position: 12.5% 48.3871% -} - -.emojione-1F1FF-1F1E6 { - background-position: 15.625% 48.3871% -} - -.emojione-1F1FF-1F1F2 { - background-position: 18.75% 48.3871% -} - -.emojione-1F1FF-1F1FC { - background-position: 21.875% 48.3871% -} - -.emojione-1F201 { - background-position: 25% 48.3871% -} - -.emojione-1F202 { - background-position: 28.125% 48.3871% -} - -.emojione-1F21A { - background-position: 31.25% 48.3871% -} - -.emojione-1F22F { - background-position: 34.375% 48.3871% -} - -.emojione-1F232 { - background-position: 37.5% 48.3871% -} - -.emojione-1F233 { - background-position: 40.625% 48.3871% -} - -.emojione-1F234 { - background-position: 43.75% 48.3871% -} - -.emojione-1F235 { - background-position: 46.875% 48.3871% -} - -.emojione-1F236 { - background-position: 50% 0% -} - -.emojione-1F237 { - background-position: 50% 3.22581% -} - -.emojione-1F238 { - background-position: 50% 6.45161% -} - -.emojione-1F239 { - background-position: 50% 9.67742% -} - -.emojione-1F23A { - background-position: 50% 12.90323% -} - -.emojione-1F250 { - background-position: 50% 16.12903% -} - -.emojione-1F251 { - background-position: 50% 19.35484% -} - -.emojione-1F300 { - background-position: 50% 22.58065% -} - -.emojione-1F301 { - background-position: 50% 25.80645% -} - -.emojione-1F302 { - background-position: 50% 29.03226% -} - -.emojione-1F303 { - background-position: 50% 32.25806% -} - -.emojione-1F304 { - background-position: 50% 35.48387% -} - -.emojione-1F305 { - background-position: 50% 38.70968% -} - -.emojione-1F306 { - background-position: 50% 41.93548% -} - -.emojione-1F307 { - background-position: 50% 45.16129% -} - -.emojione-1F308 { - background-position: 50% 48.3871% -} - -.emojione-1F309 { - background-position: 0% 51.6129% -} - -.emojione-1F30A { - background-position: 3.125% 51.6129% -} - -.emojione-1F30B { - background-position: 6.25% 51.6129% -} - -.emojione-1F30C { - background-position: 9.375% 51.6129% -} - -.emojione-1F30D { - background-position: 12.5% 51.6129% -} - -.emojione-1F30E { - background-position: 15.625% 51.6129% -} - -.emojione-1F30F { - background-position: 18.75% 51.6129% -} - -.emojione-1F310 { - background-position: 21.875% 51.6129% -} - -.emojione-1F311 { - background-position: 25% 51.6129% -} - -.emojione-1F312 { - background-position: 28.125% 51.6129% -} - -.emojione-1F313 { - background-position: 31.25% 51.6129% -} - -.emojione-1F314 { - background-position: 34.375% 51.6129% -} - -.emojione-1F315 { - background-position: 37.5% 51.6129% -} - -.emojione-1F316 { - background-position: 40.625% 51.6129% -} - -.emojione-1F317 { - background-position: 43.75% 51.6129% -} - -.emojione-1F318 { - background-position: 46.875% 51.6129% -} - -.emojione-1F319 { - background-position: 50% 51.6129% -} - -.emojione-1F31A { - background-position: 53.125% 0% -} - -.emojione-1F31B { - background-position: 53.125% 3.22581% -} - -.emojione-1F31C { - background-position: 53.125% 6.45161% -} - -.emojione-1F31D { - background-position: 53.125% 9.67742% -} - -.emojione-1F31E { - background-position: 53.125% 12.90323% -} - -.emojione-1F31F { - background-position: 53.125% 16.12903% -} - -.emojione-1F320 { - background-position: 53.125% 19.35484% -} - -.emojione-1F330 { - background-position: 53.125% 22.58065% -} - -.emojione-1F331 { - background-position: 53.125% 25.80645% -} - -.emojione-1F332 { - background-position: 53.125% 29.03226% -} - -.emojione-1F333 { - background-position: 53.125% 32.25806% -} - -.emojione-1F334 { - background-position: 53.125% 35.48387% -} - -.emojione-1F335 { - background-position: 53.125% 38.70968% -} - -.emojione-1F337 { - background-position: 53.125% 41.93548% -} - -.emojione-1F338 { - background-position: 53.125% 45.16129% -} - -.emojione-1F339 { - background-position: 53.125% 48.3871% -} - -.emojione-1F33A { - background-position: 53.125% 51.6129% -} - -.emojione-1F33B { - background-position: 0% 54.83871% -} - -.emojione-1F33C { - background-position: 3.125% 54.83871% -} - -.emojione-1F33D { - background-position: 6.25% 54.83871% -} - -.emojione-1F33E { - background-position: 9.375% 54.83871% -} - -.emojione-1F33F { - background-position: 12.5% 54.83871% -} - -.emojione-1F340 { - background-position: 15.625% 54.83871% -} - -.emojione-1F341 { - background-position: 18.75% 54.83871% -} - -.emojione-1F342 { - background-position: 21.875% 54.83871% -} - -.emojione-1F343 { - background-position: 25% 54.83871% -} - -.emojione-1F344 { - background-position: 28.125% 54.83871% -} - -.emojione-1F345 { - background-position: 31.25% 54.83871% -} - -.emojione-1F346 { - background-position: 34.375% 54.83871% -} - -.emojione-1F347 { - background-position: 37.5% 54.83871% -} - -.emojione-1F348 { - background-position: 40.625% 54.83871% -} - -.emojione-1F349 { - background-position: 43.75% 54.83871% -} - -.emojione-1F34A { - background-position: 46.875% 54.83871% -} - -.emojione-1F34B { - background-position: 50% 54.83871% -} - -.emojione-1F34C { - background-position: 53.125% 54.83871% -} - -.emojione-1F34D { - background-position: 56.25% 0% -} - -.emojione-1F34E { - background-position: 56.25% 3.22581% -} - -.emojione-1F34F { - background-position: 56.25% 6.45161% -} - -.emojione-1F350 { - background-position: 56.25% 9.67742% -} - -.emojione-1F351 { - background-position: 56.25% 12.90323% -} - -.emojione-1F352 { - background-position: 56.25% 16.12903% -} - -.emojione-1F353 { - background-position: 56.25% 19.35484% -} - -.emojione-1F354 { - background-position: 56.25% 22.58065% -} - -.emojione-1F355 { - background-position: 56.25% 25.80645% -} - -.emojione-1F356 { - background-position: 56.25% 29.03226% -} - -.emojione-1F357 { - background-position: 56.25% 32.25806% -} - -.emojione-1F358 { - background-position: 56.25% 35.48387% -} - -.emojione-1F359 { - background-position: 56.25% 38.70968% -} - -.emojione-1F35A { - background-position: 56.25% 41.93548% -} - -.emojione-1F35B { - background-position: 56.25% 45.16129% -} - -.emojione-1F35C { - background-position: 56.25% 48.3871% -} - -.emojione-1F35D { - background-position: 56.25% 51.6129% -} - -.emojione-1F35E { - background-position: 56.25% 54.83871% -} - -.emojione-1F35F { - background-position: 0% 58.06452% -} - -.emojione-1F360 { - background-position: 3.125% 58.06452% -} - -.emojione-1F361 { - background-position: 6.25% 58.06452% -} - -.emojione-1F362 { - background-position: 9.375% 58.06452% -} - -.emojione-1F363 { - background-position: 12.5% 58.06452% -} - -.emojione-1F364 { - background-position: 15.625% 58.06452% -} - -.emojione-1F365 { - background-position: 18.75% 58.06452% -} - -.emojione-1F366 { - background-position: 21.875% 58.06452% -} - -.emojione-1F367 { - background-position: 25% 58.06452% -} - -.emojione-1F368 { - background-position: 28.125% 58.06452% -} - -.emojione-1F369 { - background-position: 31.25% 58.06452% -} - -.emojione-1F36A { - background-position: 34.375% 58.06452% -} - -.emojione-1F36B { - background-position: 37.5% 58.06452% -} - -.emojione-1F36C { - background-position: 40.625% 58.06452% -} - -.emojione-1F36D { - background-position: 43.75% 58.06452% -} - -.emojione-1F36E { - background-position: 46.875% 58.06452% -} - -.emojione-1F36F { - background-position: 50% 58.06452% -} - -.emojione-1F370 { - background-position: 53.125% 58.06452% -} - -.emojione-1F371 { - background-position: 56.25% 58.06452% -} - -.emojione-1F372 { - background-position: 59.375% 0% -} - -.emojione-1F373 { - background-position: 59.375% 3.22581% -} - -.emojione-1F374 { - background-position: 59.375% 6.45161% -} - -.emojione-1F375 { - background-position: 59.375% 9.67742% -} - -.emojione-1F376 { - background-position: 59.375% 12.90323% -} - -.emojione-1F377 { - background-position: 59.375% 16.12903% -} - -.emojione-1F378 { - background-position: 59.375% 19.35484% -} - -.emojione-1F379 { - background-position: 59.375% 22.58065% -} - -.emojione-1F37A { - background-position: 59.375% 25.80645% -} - -.emojione-1F37B { - background-position: 59.375% 29.03226% -} - -.emojione-1F37C { - background-position: 59.375% 32.25806% -} - -.emojione-1F380 { - background-position: 59.375% 35.48387% -} - -.emojione-1F381 { - background-position: 59.375% 38.70968% -} - -.emojione-1F382 { - background-position: 59.375% 41.93548% -} - -.emojione-1F383 { - background-position: 59.375% 45.16129% -} - -.emojione-1F384 { - background-position: 59.375% 48.3871% -} - -.emojione-1F385 { - background-position: 59.375% 51.6129% -} - -.emojione-1F386 { - background-position: 59.375% 54.83871% -} - -.emojione-1F387 { - background-position: 59.375% 58.06452% -} - -.emojione-1F388 { - background-position: 0% 61.29032% -} - -.emojione-1F389 { - background-position: 3.125% 61.29032% -} - -.emojione-1F38A { - background-position: 6.25% 61.29032% -} - -.emojione-1F38B { - background-position: 9.375% 61.29032% -} - -.emojione-1F38C { - background-position: 12.5% 61.29032% -} - -.emojione-1F38D { - background-position: 15.625% 61.29032% -} - -.emojione-1F38E { - background-position: 18.75% 61.29032% -} - -.emojione-1F38F { - background-position: 21.875% 61.29032% -} - -.emojione-1F390 { - background-position: 25% 61.29032% -} - -.emojione-1F391 { - background-position: 28.125% 61.29032% -} - -.emojione-1F392 { - background-position: 31.25% 61.29032% -} - -.emojione-1F393 { - background-position: 34.375% 61.29032% -} - -.emojione-1F3A0 { - background-position: 37.5% 61.29032% -} - -.emojione-1F3A1 { - background-position: 40.625% 61.29032% -} - -.emojione-1F3A2 { - background-position: 43.75% 61.29032% -} - -.emojione-1F3A3 { - background-position: 46.875% 61.29032% -} - -.emojione-1F3A4 { - background-position: 50% 61.29032% -} - -.emojione-1F3A5 { - background-position: 53.125% 61.29032% -} - -.emojione-1F3A6 { - background-position: 56.25% 61.29032% -} - -.emojione-1F3A7 { - background-position: 59.375% 61.29032% -} - -.emojione-1F3A8 { - background-position: 62.5% 0% -} - -.emojione-1F3A9 { - background-position: 62.5% 3.22581% -} - -.emojione-1F3AA { - background-position: 62.5% 6.45161% -} - -.emojione-1F3AB { - background-position: 62.5% 9.67742% -} - -.emojione-1F3AC { - background-position: 62.5% 12.90323% -} - -.emojione-1F3AD { - background-position: 62.5% 16.12903% -} - -.emojione-1F3AE { - background-position: 62.5% 19.35484% -} - -.emojione-1F3AF { - background-position: 62.5% 22.58065% -} - -.emojione-1F3B0 { - background-position: 62.5% 25.80645% -} - -.emojione-1F3B1 { - background-position: 62.5% 29.03226% -} - -.emojione-1F3B2 { - background-position: 62.5% 32.25806% -} - -.emojione-1F3B3 { - background-position: 62.5% 35.48387% -} - -.emojione-1F3B4 { - background-position: 62.5% 38.70968% -} - -.emojione-1F3B5 { - background-position: 62.5% 41.93548% -} - -.emojione-1F3B6 { - background-position: 62.5% 45.16129% -} - -.emojione-1F3B7 { - background-position: 62.5% 48.3871% -} - -.emojione-1F3B8 { - background-position: 62.5% 51.6129% -} - -.emojione-1F3B9 { - background-position: 62.5% 54.83871% -} - -.emojione-1F3BA { - background-position: 62.5% 58.06452% -} - -.emojione-1F3BB { - background-position: 62.5% 61.29032% -} - -.emojione-1F3BC { - background-position: 0% 64.51613% -} - -.emojione-1F3BD { - background-position: 3.125% 64.51613% -} - -.emojione-1F3BE { - background-position: 6.25% 64.51613% -} - -.emojione-1F3BF { - background-position: 9.375% 64.51613% -} - -.emojione-1F3C0 { - background-position: 12.5% 64.51613% -} - -.emojione-1F3C1 { - background-position: 15.625% 64.51613% -} - -.emojione-1F3C2 { - background-position: 18.75% 64.51613% -} - -.emojione-1F3C3 { - background-position: 0% 0% -} - -.emojione-1F3C4 { - background-position: 25% 64.51613% -} - -.emojione-1F3C6 { - background-position: 28.125% 64.51613% -} - -.emojione-1F3C7 { - background-position: 31.25% 64.51613% -} - -.emojione-1F3C8 { - background-position: 34.375% 64.51613% -} - -.emojione-1F3C9 { - background-position: 37.5% 64.51613% -} - -.emojione-1F3CA { - background-position: 40.625% 64.51613% -} - -.emojione-1F3E0 { - background-position: 43.75% 64.51613% -} - -.emojione-1F3E1 { - background-position: 46.875% 64.51613% -} - -.emojione-1F3E2 { - background-position: 50% 64.51613% -} - -.emojione-1F3E3 { - background-position: 53.125% 64.51613% -} - -.emojione-1F3E4 { - background-position: 56.25% 64.51613% -} - -.emojione-1F3E5 { - background-position: 59.375% 64.51613% -} - -.emojione-1F3E6 { - background-position: 62.5% 64.51613% -} - -.emojione-1F3E7 { - background-position: 65.625% 0% -} - -.emojione-1F3E8 { - background-position: 65.625% 3.22581% -} - -.emojione-1F3E9 { - background-position: 65.625% 6.45161% -} - -.emojione-1F3EA { - background-position: 65.625% 9.67742% -} - -.emojione-1F3EB { - background-position: 65.625% 12.90323% -} - -.emojione-1F3EC { - background-position: 65.625% 16.12903% -} - -.emojione-1F3ED { - background-position: 65.625% 19.35484% -} - -.emojione-1F3EE { - background-position: 65.625% 22.58065% -} - -.emojione-1F3EF { - background-position: 65.625% 25.80645% -} - -.emojione-1F3F0 { - background-position: 65.625% 29.03226% -} - -.emojione-1F400 { - background-position: 65.625% 32.25806% -} - -.emojione-1F401 { - background-position: 65.625% 35.48387% -} - -.emojione-1F402 { - background-position: 65.625% 38.70968% -} - -.emojione-1F403 { - background-position: 65.625% 41.93548% -} - -.emojione-1F404 { - background-position: 65.625% 45.16129% -} - -.emojione-1F405 { - background-position: 65.625% 48.3871% -} - -.emojione-1F406 { - background-position: 65.625% 51.6129% -} - -.emojione-1F407 { - background-position: 65.625% 54.83871% -} - -.emojione-1F408 { - background-position: 65.625% 58.06452% -} - -.emojione-1F409 { - background-position: 65.625% 61.29032% -} - -.emojione-1F40A { - background-position: 65.625% 64.51613% -} - -.emojione-1F40B { - background-position: 0% 67.74194% -} - -.emojione-1F40C { - background-position: 3.125% 67.74194% -} - -.emojione-1F40D { - background-position: 6.25% 67.74194% -} - -.emojione-1F40E { - background-position: 9.375% 67.74194% -} - -.emojione-1F40F { - background-position: 12.5% 67.74194% -} - -.emojione-1F410 { - background-position: 15.625% 67.74194% -} - -.emojione-1F411 { - background-position: 18.75% 67.74194% -} - -.emojione-1F412 { - background-position: 21.875% 67.74194% -} - -.emojione-1F413 { - background-position: 25% 67.74194% -} - -.emojione-1F414 { - background-position: 28.125% 67.74194% -} - -.emojione-1F415 { - background-position: 31.25% 67.74194% -} - -.emojione-1F416 { - background-position: 34.375% 67.74194% -} - -.emojione-1F417 { - background-position: 37.5% 67.74194% -} - -.emojione-1F418 { - background-position: 40.625% 67.74194% -} - -.emojione-1F419 { - background-position: 43.75% 67.74194% -} - -.emojione-1F41A { - background-position: 46.875% 67.74194% -} - -.emojione-1F41B { - background-position: 50% 67.74194% -} - -.emojione-1F41C { - background-position: 53.125% 67.74194% -} - -.emojione-1F41D { - background-position: 56.25% 67.74194% -} - -.emojione-1F41E { - background-position: 59.375% 67.74194% -} - -.emojione-1F41F { - background-position: 62.5% 67.74194% -} - -.emojione-1F420 { - background-position: 65.625% 67.74194% -} - -.emojione-1F421 { - background-position: 68.75% 0% -} - -.emojione-1F422 { - background-position: 68.75% 3.22581% -} - -.emojione-1F423 { - background-position: 68.75% 6.45161% -} - -.emojione-1F424 { - background-position: 68.75% 9.67742% -} - -.emojione-1F425 { - background-position: 68.75% 12.90323% -} - -.emojione-1F426 { - background-position: 68.75% 16.12903% -} - -.emojione-1F427 { - background-position: 68.75% 19.35484% -} - -.emojione-1F428 { - background-position: 68.75% 22.58065% -} - -.emojione-1F429 { - background-position: 68.75% 25.80645% -} - -.emojione-1F42A { - background-position: 68.75% 29.03226% -} - -.emojione-1F42B { - background-position: 68.75% 32.25806% -} - -.emojione-1F42C { - background-position: 68.75% 35.48387% -} - -.emojione-1F42D { - background-position: 68.75% 38.70968% -} - -.emojione-1F42E { - background-position: 68.75% 41.93548% -} - -.emojione-1F42F { - background-position: 68.75% 45.16129% -} - -.emojione-1F430 { - background-position: 68.75% 48.3871% -} - -.emojione-1F431 { - background-position: 68.75% 51.6129% -} - -.emojione-1F432 { - background-position: 68.75% 54.83871% -} - -.emojione-1F433 { - background-position: 68.75% 58.06452% -} - -.emojione-1F434 { - background-position: 68.75% 61.29032% -} - -.emojione-1F435 { - background-position: 68.75% 64.51613% -} - -.emojione-1F436 { - background-position: 68.75% 67.74194% -} - -.emojione-1F437 { - background-position: 0% 70.96774% -} - -.emojione-1F438 { - background-position: 3.125% 70.96774% -} - -.emojione-1F439 { - background-position: 6.25% 70.96774% -} - -.emojione-1F43A { - background-position: 9.375% 70.96774% -} - -.emojione-1F43B { - background-position: 12.5% 70.96774% -} - -.emojione-1F43C { - background-position: 15.625% 70.96774% -} - -.emojione-1F43D { - background-position: 18.75% 70.96774% -} - -.emojione-1F43E { - background-position: 21.875% 70.96774% -} - -.emojione-1F440 { - background-position: 25% 70.96774% -} - -.emojione-1F442 { - background-position: 28.125% 70.96774% -} - -.emojione-1F443 { - background-position: 31.25% 70.96774% -} - -.emojione-1F444 { - background-position: 34.375% 70.96774% -} - -.emojione-1F445 { - background-position: 37.5% 70.96774% -} - -.emojione-1F446 { - background-position: 40.625% 70.96774% -} - -.emojione-1F447 { - background-position: 43.75% 70.96774% -} - -.emojione-1F448 { - background-position: 46.875% 70.96774% -} - -.emojione-1F449 { - background-position: 50% 70.96774% -} - -.emojione-1F44A { - background-position: 53.125% 70.96774% -} - -.emojione-1F44B { - background-position: 56.25% 70.96774% -} - -.emojione-1F44C { - background-position: 59.375% 70.96774% -} - -.emojione-1F44D { - background-position: 62.5% 70.96774% -} - -.emojione-1F44E { - background-position: 65.625% 70.96774% -} - -.emojione-1F44F { - background-position: 68.75% 70.96774% -} - -.emojione-1F450 { - background-position: 71.875% 0% -} - -.emojione-1F451 { - background-position: 71.875% 3.22581% -} - -.emojione-1F452 { - background-position: 71.875% 6.45161% -} - -.emojione-1F453 { - background-position: 71.875% 9.67742% -} - -.emojione-1F454 { - background-position: 71.875% 12.90323% -} - -.emojione-1F455 { - background-position: 71.875% 16.12903% -} - -.emojione-1F456 { - background-position: 71.875% 19.35484% -} - -.emojione-1F457 { - background-position: 71.875% 22.58065% -} - -.emojione-1F458 { - background-position: 71.875% 25.80645% -} - -.emojione-1F459 { - background-position: 71.875% 29.03226% -} - -.emojione-1F45A { - background-position: 71.875% 32.25806% -} - -.emojione-1F45B { - background-position: 71.875% 35.48387% -} - -.emojione-1F45C { - background-position: 71.875% 38.70968% -} - -.emojione-1F45D { - background-position: 71.875% 41.93548% -} - -.emojione-1F45E { - background-position: 71.875% 45.16129% -} - -.emojione-1F45F { - background-position: 71.875% 48.3871% -} - -.emojione-1F460 { - background-position: 71.875% 51.6129% -} - -.emojione-1F461 { - background-position: 71.875% 54.83871% -} - -.emojione-1F462 { - background-position: 71.875% 58.06452% -} - -.emojione-1F463 { - background-position: 71.875% 61.29032% -} - -.emojione-1F464 { - background-position: 71.875% 64.51613% -} - -.emojione-1F465 { - background-position: 71.875% 67.74194% -} - -.emojione-1F466 { - background-position: 71.875% 70.96774% -} - -.emojione-1F467 { - background-position: 0% 74.19355% -} - -.emojione-1F468 { - background-position: 3.125% 74.19355% -} - -.emojione-1F469 { - background-position: 6.25% 74.19355% -} - -.emojione-1F46A { - background-position: 9.375% 74.19355% -} - -.emojione-1F46B { - background-position: 12.5% 74.19355% -} - -.emojione-1F46C { - background-position: 15.625% 74.19355% -} - -.emojione-1F46D { - background-position: 18.75% 74.19355% -} - -.emojione-1F46E { - background-position: 21.875% 74.19355% -} - -.emojione-1F46F { - background-position: 25% 74.19355% -} - -.emojione-1F470 { - background-position: 28.125% 74.19355% -} - -.emojione-1F471 { - background-position: 31.25% 74.19355% -} - -.emojione-1F472 { - background-position: 34.375% 74.19355% -} - -.emojione-1F473 { - background-position: 37.5% 74.19355% -} - -.emojione-1F474 { - background-position: 40.625% 74.19355% -} - -.emojione-1F475 { - background-position: 43.75% 74.19355% -} - -.emojione-1F476 { - background-position: 46.875% 74.19355% -} - -.emojione-1F477 { - background-position: 50% 74.19355% -} - -.emojione-1F478 { - background-position: 53.125% 74.19355% -} - -.emojione-1F479 { - background-position: 56.25% 74.19355% -} - -.emojione-1F47A { - background-position: 59.375% 74.19355% -} - -.emojione-1F47B { - background-position: 62.5% 74.19355% -} - -.emojione-1F47C { - background-position: 65.625% 74.19355% -} - -.emojione-1F47D { - background-position: 68.75% 74.19355% -} - -.emojione-1F47E { - background-position: 71.875% 74.19355% -} - -.emojione-1F47F { - background-position: 75% 0% -} - -.emojione-1F480 { - background-position: 75% 3.22581% -} - -.emojione-1F481 { - background-position: 75% 6.45161% -} - -.emojione-1F482 { - background-position: 75% 9.67742% -} - -.emojione-1F483 { - background-position: 75% 12.90323% -} - -.emojione-1F484 { - background-position: 75% 16.12903% -} - -.emojione-1F485 { - background-position: 75% 19.35484% -} - -.emojione-1F486 { - background-position: 75% 22.58065% -} - -.emojione-1F487 { - background-position: 75% 25.80645% -} - -.emojione-1F488 { - background-position: 75% 29.03226% -} - -.emojione-1F489 { - background-position: 75% 32.25806% -} - -.emojione-1F48A { - background-position: 75% 35.48387% -} - -.emojione-1F48B { - background-position: 75% 38.70968% -} - -.emojione-1F48C { - background-position: 75% 41.93548% -} - -.emojione-1F48D { - background-position: 75% 45.16129% -} - -.emojione-1F48E { - background-position: 75% 48.3871% -} - -.emojione-1F48F { - background-position: 75% 51.6129% -} - -.emojione-1F490 { - background-position: 75% 54.83871% -} - -.emojione-1F491 { - background-position: 75% 58.06452% -} - -.emojione-1F492 { - background-position: 75% 61.29032% -} - -.emojione-1F493 { - background-position: 75% 64.51613% -} - -.emojione-1F494 { - background-position: 75% 67.74194% -} - -.emojione-1F495 { - background-position: 75% 70.96774% -} - -.emojione-1F496 { - background-position: 75% 74.19355% -} - -.emojione-1F497 { - background-position: 0% 77.41935% -} - -.emojione-1F498 { - background-position: 3.125% 77.41935% -} - -.emojione-1F499 { - background-position: 6.25% 77.41935% -} - -.emojione-1F49A { - background-position: 9.375% 77.41935% -} - -.emojione-1F49B { - background-position: 12.5% 77.41935% -} - -.emojione-1F49C { - background-position: 15.625% 77.41935% -} - -.emojione-1F49D { - background-position: 18.75% 77.41935% -} - -.emojione-1F49E { - background-position: 21.875% 77.41935% -} - -.emojione-1F49F { - background-position: 25% 77.41935% -} - -.emojione-1F4A0 { - background-position: 28.125% 77.41935% -} - -.emojione-1F4A1 { - background-position: 31.25% 77.41935% -} - -.emojione-1F4A2 { - background-position: 34.375% 77.41935% -} - -.emojione-1F4A3 { - background-position: 37.5% 77.41935% -} - -.emojione-1F4A4 { - background-position: 40.625% 77.41935% -} - -.emojione-1F4A5 { - background-position: 43.75% 77.41935% -} - -.emojione-1F4A6 { - background-position: 46.875% 77.41935% -} - -.emojione-1F4A7 { - background-position: 50% 77.41935% -} - -.emojione-1F4A8 { - background-position: 53.125% 77.41935% -} - -.emojione-1F4A9 { - background-position: 56.25% 77.41935% -} - -.emojione-1F4AA { - background-position: 59.375% 77.41935% -} - -.emojione-1F4AB { - background-position: 62.5% 77.41935% -} - -.emojione-1F4AC { - background-position: 65.625% 77.41935% -} - -.emojione-1F4AD { - background-position: 68.75% 77.41935% -} - -.emojione-1F4AE { - background-position: 71.875% 77.41935% -} - -.emojione-1F4AF { - background-position: 75% 77.41935% -} - -.emojione-1F4B0 { - background-position: 78.125% 0% -} - -.emojione-1F4B1 { - background-position: 78.125% 3.22581% -} - -.emojione-1F4B2 { - background-position: 78.125% 6.45161% -} - -.emojione-1F4B3 { - background-position: 78.125% 9.67742% -} - -.emojione-1F4B4 { - background-position: 78.125% 12.90323% -} - -.emojione-1F4B5 { - background-position: 78.125% 16.12903% -} - -.emojione-1F4B6 { - background-position: 78.125% 19.35484% -} - -.emojione-1F4B7 { - background-position: 78.125% 22.58065% -} - -.emojione-1F4B8 { - background-position: 78.125% 25.80645% -} - -.emojione-1F4B9 { - background-position: 78.125% 29.03226% -} - -.emojione-1F4BA { - background-position: 78.125% 32.25806% -} - -.emojione-1F4BB { - background-position: 78.125% 35.48387% -} - -.emojione-1F4BC { - background-position: 78.125% 38.70968% -} - -.emojione-1F4BD { - background-position: 78.125% 41.93548% -} - -.emojione-1F4BE { - background-position: 78.125% 45.16129% -} - -.emojione-1F4BF { - background-position: 78.125% 48.3871% -} - -.emojione-1F4C0 { - background-position: 78.125% 51.6129% -} - -.emojione-1F4C1 { - background-position: 78.125% 54.83871% -} - -.emojione-1F4C2 { - background-position: 78.125% 58.06452% -} - -.emojione-1F4C3 { - background-position: 78.125% 61.29032% -} - -.emojione-1F4C4 { - background-position: 78.125% 64.51613% -} - -.emojione-1F4C5 { - background-position: 78.125% 67.74194% -} - -.emojione-1F4C6 { - background-position: 78.125% 70.96774% -} - -.emojione-1F4C7 { - background-position: 78.125% 74.19355% -} - -.emojione-1F4C8 { - background-position: 78.125% 77.41935% -} - -.emojione-1F4C9 { - background-position: 0% 80.64516% -} - -.emojione-1F4CA { - background-position: 3.125% 80.64516% -} - -.emojione-1F4CB { - background-position: 6.25% 80.64516% -} - -.emojione-1F4CC { - background-position: 9.375% 80.64516% -} - -.emojione-1F4CD { - background-position: 12.5% 80.64516% -} - -.emojione-1F4CE { - background-position: 15.625% 80.64516% -} - -.emojione-1F4CF { - background-position: 18.75% 80.64516% -} - -.emojione-1F4D0 { - background-position: 21.875% 80.64516% -} - -.emojione-1F4D1 { - background-position: 25% 80.64516% -} - -.emojione-1F4D2 { - background-position: 28.125% 80.64516% -} - -.emojione-1F4D3 { - background-position: 31.25% 80.64516% -} - -.emojione-1F4D4 { - background-position: 34.375% 80.64516% -} - -.emojione-1F4D5 { - background-position: 37.5% 80.64516% -} - -.emojione-1F4D6 { - background-position: 40.625% 80.64516% -} - -.emojione-1F4D7 { - background-position: 43.75% 80.64516% -} - -.emojione-1F4D8 { - background-position: 46.875% 80.64516% -} - -.emojione-1F4D9 { - background-position: 50% 80.64516% -} - -.emojione-1F4DA { - background-position: 53.125% 80.64516% -} - -.emojione-1F4DB { - background-position: 56.25% 80.64516% -} - -.emojione-1F4DC { - background-position: 59.375% 80.64516% -} - -.emojione-1F4DD { - background-position: 62.5% 80.64516% -} - -.emojione-1F4DE { - background-position: 65.625% 80.64516% -} - -.emojione-1F4DF { - background-position: 68.75% 80.64516% -} - -.emojione-1F4E0 { - background-position: 71.875% 80.64516% -} - -.emojione-1F4E1 { - background-position: 75% 80.64516% -} - -.emojione-1F4E2 { - background-position: 78.125% 80.64516% -} - -.emojione-1F4E3 { - background-position: 81.25% 0% -} - -.emojione-1F4E4 { - background-position: 81.25% 3.22581% -} - -.emojione-1F4E5 { - background-position: 81.25% 6.45161% -} - -.emojione-1F4E6 { - background-position: 81.25% 9.67742% -} - -.emojione-1F4E7 { - background-position: 81.25% 12.90323% -} - -.emojione-1F4E8 { - background-position: 81.25% 16.12903% -} - -.emojione-1F4E9 { - background-position: 81.25% 19.35484% -} - -.emojione-1F4EA { - background-position: 81.25% 22.58065% -} - -.emojione-1F4EB { - background-position: 81.25% 25.80645% -} - -.emojione-1F4EC { - background-position: 81.25% 29.03226% -} - -.emojione-1F4ED { - background-position: 81.25% 32.25806% -} - -.emojione-1F4EE { - background-position: 81.25% 35.48387% -} - -.emojione-1F4EF { - background-position: 81.25% 38.70968% -} - -.emojione-1F4F0 { - background-position: 81.25% 41.93548% -} - -.emojione-1F4F1 { - background-position: 81.25% 45.16129% -} - -.emojione-1F4F2 { - background-position: 81.25% 48.3871% -} - -.emojione-1F4F3 { - background-position: 81.25% 51.6129% -} - -.emojione-1F4F4 { - background-position: 81.25% 54.83871% -} - -.emojione-1F4F5 { - background-position: 81.25% 58.06452% -} - -.emojione-1F4F6 { - background-position: 81.25% 61.29032% -} - -.emojione-1F4F7 { - background-position: 81.25% 64.51613% -} - -.emojione-1F4F9 { - background-position: 81.25% 67.74194% -} - -.emojione-1F4FA { - background-position: 81.25% 70.96774% -} - -.emojione-1F4FB { - background-position: 81.25% 74.19355% -} - -.emojione-1F4FC { - background-position: 81.25% 77.41935% -} - -.emojione-1F500 { - background-position: 81.25% 80.64516% -} - -.emojione-1F501 { - background-position: 0% 83.87097% -} - -.emojione-1F502 { - background-position: 3.125% 83.87097% -} - -.emojione-1F503 { - background-position: 6.25% 83.87097% -} - -.emojione-1F504 { - background-position: 9.375% 83.87097% -} - -.emojione-1F505 { - background-position: 12.5% 83.87097% -} - -.emojione-1F506 { - background-position: 15.625% 83.87097% -} - -.emojione-1F507 { - background-position: 18.75% 83.87097% -} - -.emojione-1F508 { - background-position: 21.875% 83.87097% -} - -.emojione-1F509 { - background-position: 25% 83.87097% -} - -.emojione-1F50A { - background-position: 28.125% 83.87097% -} - -.emojione-1F50B { - background-position: 31.25% 83.87097% -} - -.emojione-1F50C { - background-position: 34.375% 83.87097% -} - -.emojione-1F50D { - background-position: 37.5% 83.87097% -} - -.emojione-1F50E { - background-position: 40.625% 83.87097% -} - -.emojione-1F50F { - background-position: 43.75% 83.87097% -} - -.emojione-1F510 { - background-position: 46.875% 83.87097% -} - -.emojione-1F511 { - background-position: 50% 83.87097% -} - -.emojione-1F512 { - background-position: 53.125% 83.87097% -} - -.emojione-1F513 { - background-position: 56.25% 83.87097% -} - -.emojione-1F514 { - background-position: 59.375% 83.87097% -} - -.emojione-1F515 { - background-position: 62.5% 83.87097% -} - -.emojione-1F516 { - background-position: 65.625% 83.87097% -} - -.emojione-1F517 { - background-position: 68.75% 83.87097% -} - -.emojione-1F518 { - background-position: 71.875% 83.87097% -} - -.emojione-1F519 { - background-position: 75% 83.87097% -} - -.emojione-1F51A { - background-position: 78.125% 83.87097% -} - -.emojione-1F51B { - background-position: 81.25% 83.87097% -} - -.emojione-1F51C { - background-position: 84.375% 0% -} - -.emojione-1F51D { - background-position: 84.375% 3.22581% -} - -.emojione-1F51E { - background-position: 84.375% 6.45161% -} - -.emojione-1F51F { - background-position: 84.375% 9.67742% -} - -.emojione-1F520 { - background-position: 84.375% 12.90323% -} - -.emojione-1F521 { - background-position: 84.375% 16.12903% -} - -.emojione-1F522 { - background-position: 84.375% 19.35484% -} - -.emojione-1F523 { - background-position: 84.375% 22.58065% -} - -.emojione-1F524 { - background-position: 84.375% 25.80645% -} - -.emojione-1F525 { - background-position: 84.375% 29.03226% -} - -.emojione-1F526 { - background-position: 84.375% 32.25806% -} - -.emojione-1F527 { - background-position: 84.375% 35.48387% -} - -.emojione-1F528 { - background-position: 84.375% 38.70968% -} - -.emojione-1F529 { - background-position: 84.375% 41.93548% -} - -.emojione-1F52A { - background-position: 84.375% 45.16129% -} - -.emojione-1F52B { - background-position: 84.375% 48.3871% -} - -.emojione-1F52C { - background-position: 84.375% 51.6129% -} - -.emojione-1F52D { - background-position: 84.375% 54.83871% -} - -.emojione-1F52E { - background-position: 84.375% 58.06452% -} - -.emojione-1F52F { - background-position: 84.375% 61.29032% -} - -.emojione-1F530 { - background-position: 84.375% 64.51613% -} - -.emojione-1F531 { - background-position: 84.375% 67.74194% -} - -.emojione-1F532 { - background-position: 84.375% 70.96774% -} - -.emojione-1F533 { - background-position: 84.375% 74.19355% -} - -.emojione-1F534 { - background-position: 84.375% 77.41935% -} - -.emojione-1F535 { - background-position: 84.375% 80.64516% -} - -.emojione-1F536 { - background-position: 84.375% 83.87097% -} - -.emojione-1F537 { - background-position: 0% 87.09677% -} - -.emojione-1F538 { - background-position: 3.125% 87.09677% -} - -.emojione-1F539 { - background-position: 6.25% 87.09677% -} - -.emojione-1F53A { - background-position: 9.375% 87.09677% -} - -.emojione-1F53B { - background-position: 12.5% 87.09677% -} - -.emojione-1F53C { - background-position: 15.625% 87.09677% -} - -.emojione-1F53D { - background-position: 18.75% 87.09677% -} - -.emojione-1F550 { - background-position: 21.875% 87.09677% -} - -.emojione-1F551 { - background-position: 25% 87.09677% -} - -.emojione-1F552 { - background-position: 28.125% 87.09677% -} - -.emojione-1F553 { - background-position: 31.25% 87.09677% -} - -.emojione-1F554 { - background-position: 34.375% 87.09677% -} - -.emojione-1F555 { - background-position: 37.5% 87.09677% -} - -.emojione-1F556 { - background-position: 40.625% 87.09677% -} - -.emojione-1F557 { - background-position: 43.75% 87.09677% -} - -.emojione-1F558 { - background-position: 46.875% 87.09677% -} - -.emojione-1F559 { - background-position: 50% 87.09677% -} - -.emojione-1F55A { - background-position: 53.125% 87.09677% -} - -.emojione-1F55B { - background-position: 56.25% 87.09677% -} - -.emojione-1F55C { - background-position: 59.375% 87.09677% -} - -.emojione-1F55D { - background-position: 62.5% 87.09677% -} - -.emojione-1F55E { - background-position: 65.625% 87.09677% -} - -.emojione-1F55F { - background-position: 68.75% 87.09677% -} - -.emojione-1F560 { - background-position: 71.875% 87.09677% -} - -.emojione-1F561 { - background-position: 75% 87.09677% -} - -.emojione-1F562 { - background-position: 78.125% 87.09677% -} - -.emojione-1F563 { - background-position: 81.25% 87.09677% -} - -.emojione-1F564 { - background-position: 84.375% 87.09677% -} - -.emojione-1F565 { - background-position: 87.5% 0% -} - -.emojione-1F566 { - background-position: 87.5% 3.22581% -} - -.emojione-1F567 { - background-position: 87.5% 6.45161% -} - -.emojione-1F5FB { - background-position: 87.5% 9.67742% -} - -.emojione-1F5FC { - background-position: 87.5% 12.90323% -} - -.emojione-1F5FD { - background-position: 87.5% 16.12903% -} - -.emojione-1F5FE { - background-position: 87.5% 19.35484% -} - -.emojione-1F5FF { - background-position: 87.5% 22.58065% -} - -.emojione-1F600 { - background-position: 87.5% 25.80645% -} - -.emojione-1F601 { - background-position: 87.5% 29.03226% -} - -.emojione-1F602 { - background-position: 87.5% 32.25806% -} - -.emojione-1F603 { - background-position: 87.5% 35.48387% -} - -.emojione-1F604 { - background-position: 87.5% 38.70968% -} - -.emojione-1F605 { - background-position: 87.5% 41.93548% -} - -.emojione-1F606 { - background-position: 87.5% 45.16129% -} - -.emojione-1F607 { - background-position: 87.5% 48.3871% -} - -.emojione-1F608 { - background-position: 87.5% 51.6129% -} - -.emojione-1F609 { - background-position: 87.5% 54.83871% -} - -.emojione-1F60A { - background-position: 87.5% 58.06452% -} - -.emojione-1F60B { - background-position: 87.5% 61.29032% -} - -.emojione-1F60C { - background-position: 87.5% 64.51613% -} - -.emojione-1F60D { - background-position: 87.5% 67.74194% -} - -.emojione-1F60E { - background-position: 87.5% 70.96774% -} - -.emojione-1F60F { - background-position: 87.5% 74.19355% -} - -.emojione-1F610 { - background-position: 87.5% 77.41935% -} - -.emojione-1F611 { - background-position: 87.5% 80.64516% -} - -.emojione-1F612 { - background-position: 87.5% 83.87097% -} - -.emojione-1F613 { - background-position: 87.5% 87.09677% -} - -.emojione-1F614 { - background-position: 0% 90.32258% -} - -.emojione-1F615 { - background-position: 3.125% 90.32258% -} - -.emojione-1F616 { - background-position: 6.25% 90.32258% -} - -.emojione-1F617 { - background-position: 9.375% 90.32258% -} - -.emojione-1F618 { - background-position: 12.5% 90.32258% -} - -.emojione-1F619 { - background-position: 15.625% 90.32258% -} - -.emojione-1F61A { - background-position: 18.75% 90.32258% -} - -.emojione-1F61B { - background-position: 21.875% 90.32258% -} - -.emojione-1F61C { - background-position: 25% 90.32258% -} - -.emojione-1F61D { - background-position: 28.125% 90.32258% -} - -.emojione-1F61E { - background-position: 31.25% 90.32258% -} - -.emojione-1F61F { - background-position: 34.375% 90.32258% -} - -.emojione-1F620 { - background-position: 37.5% 90.32258% -} - -.emojione-1F621 { - background-position: 40.625% 90.32258% -} - -.emojione-1F622 { - background-position: 43.75% 90.32258% -} - -.emojione-1F623 { - background-position: 46.875% 90.32258% -} - -.emojione-1F624 { - background-position: 50% 90.32258% -} - -.emojione-1F625 { - background-position: 53.125% 90.32258% -} - -.emojione-1F626 { - background-position: 56.25% 90.32258% -} - -.emojione-1F627 { - background-position: 59.375% 90.32258% -} - -.emojione-1F628 { - background-position: 62.5% 90.32258% -} - -.emojione-1F629 { - background-position: 65.625% 90.32258% -} - -.emojione-1F62A { - background-position: 68.75% 90.32258% -} - -.emojione-1F62B { - background-position: 71.875% 90.32258% -} - -.emojione-1F62C { - background-position: 75% 90.32258% -} - -.emojione-1F62D { - background-position: 78.125% 90.32258% -} - -.emojione-1F62E { - background-position: 81.25% 90.32258% -} - -.emojione-1F62F { - background-position: 84.375% 90.32258% -} - -.emojione-1F630 { - background-position: 87.5% 90.32258% -} - -.emojione-1F631 { - background-position: 90.625% 0% -} - -.emojione-1F632 { - background-position: 90.625% 3.22581% -} - -.emojione-1F633 { - background-position: 90.625% 6.45161% -} - -.emojione-1F634 { - background-position: 90.625% 9.67742% -} - -.emojione-1F635 { - background-position: 90.625% 12.90323% -} - -.emojione-1F636 { - background-position: 90.625% 16.12903% -} - -.emojione-1F637 { - background-position: 90.625% 19.35484% -} - -.emojione-1F638 { - background-position: 90.625% 22.58065% -} - -.emojione-1F639 { - background-position: 90.625% 25.80645% -} - -.emojione-1F63A { - background-position: 90.625% 29.03226% -} - -.emojione-1F63B { - background-position: 90.625% 32.25806% -} - -.emojione-1F63C { - background-position: 90.625% 35.48387% -} - -.emojione-1F63D { - background-position: 90.625% 38.70968% -} - -.emojione-1F63E { - background-position: 90.625% 41.93548% -} - -.emojione-1F63F { - background-position: 90.625% 45.16129% -} - -.emojione-1F640 { - background-position: 90.625% 48.3871% -} - -.emojione-1F645 { - background-position: 90.625% 51.6129% -} - -.emojione-1F646 { - background-position: 90.625% 54.83871% -} - -.emojione-1F647 { - background-position: 90.625% 58.06452% -} - -.emojione-1F648 { - background-position: 90.625% 61.29032% -} - -.emojione-1F649 { - background-position: 90.625% 64.51613% -} - -.emojione-1F64A { - background-position: 90.625% 67.74194% -} - -.emojione-1F64B { - background-position: 90.625% 70.96774% -} - -.emojione-1F64C { - background-position: 90.625% 74.19355% -} - -.emojione-1F64D { - background-position: 90.625% 77.41935% -} - -.emojione-1F64E { - background-position: 90.625% 80.64516% -} - -.emojione-1F64F { - background-position: 90.625% 83.87097% -} - -.emojione-1F680 { - background-position: 90.625% 87.09677% -} - -.emojione-1F681 { - background-position: 90.625% 90.32258% -} - -.emojione-1F682 { - background-position: 0% 93.54839% -} - -.emojione-1F683 { - background-position: 3.125% 93.54839% -} - -.emojione-1F684 { - background-position: 6.25% 93.54839% -} - -.emojione-1F685 { - background-position: 9.375% 93.54839% -} - -.emojione-1F686 { - background-position: 12.5% 93.54839% -} - -.emojione-1F687 { - background-position: 15.625% 93.54839% -} - -.emojione-1F688 { - background-position: 18.75% 93.54839% -} - -.emojione-1F689 { - background-position: 21.875% 93.54839% -} - -.emojione-1F68A { - background-position: 25% 93.54839% -} - -.emojione-1F68B { - background-position: 28.125% 93.54839% -} - -.emojione-1F68C { - background-position: 31.25% 93.54839% -} - -.emojione-1F68D { - background-position: 34.375% 93.54839% -} - -.emojione-1F68E { - background-position: 37.5% 93.54839% -} - -.emojione-1F68F { - background-position: 40.625% 93.54839% -} - -.emojione-1F690 { - background-position: 43.75% 93.54839% -} - -.emojione-1F691 { - background-position: 46.875% 93.54839% -} - -.emojione-1F692 { - background-position: 50% 93.54839% -} - -.emojione-1F693 { - background-position: 53.125% 93.54839% -} - -.emojione-1F694 { - background-position: 56.25% 93.54839% -} - -.emojione-1F695 { - background-position: 59.375% 93.54839% -} - -.emojione-1F696 { - background-position: 62.5% 93.54839% -} - -.emojione-1F697 { - background-position: 65.625% 93.54839% -} - -.emojione-1F698 { - background-position: 68.75% 93.54839% -} - -.emojione-1F699 { - background-position: 71.875% 93.54839% -} - -.emojione-1F69A { - background-position: 75% 93.54839% -} - -.emojione-1F69B { - background-position: 78.125% 93.54839% -} - -.emojione-1F69C { - background-position: 81.25% 93.54839% -} - -.emojione-1F69D { - background-position: 84.375% 93.54839% -} - -.emojione-1F69E { - background-position: 87.5% 93.54839% -} - -.emojione-1F69F { - background-position: 90.625% 93.54839% -} - -.emojione-1F6A0 { - background-position: 93.75% 0% -} - -.emojione-1F6A1 { - background-position: 93.75% 3.22581% -} - -.emojione-1F6A2 { - background-position: 93.75% 6.45161% -} - -.emojione-1F6A3 { - background-position: 93.75% 9.67742% -} - -.emojione-1F6A4 { - background-position: 93.75% 12.90323% -} - -.emojione-1F6A5 { - background-position: 93.75% 16.12903% -} - -.emojione-1F6A6 { - background-position: 93.75% 19.35484% -} - -.emojione-1F6A7 { - background-position: 93.75% 22.58065% -} - -.emojione-1F6A8 { - background-position: 93.75% 25.80645% -} - -.emojione-1F6A9 { - background-position: 93.75% 29.03226% -} - -.emojione-1F6AA { - background-position: 93.75% 32.25806% -} - -.emojione-1F6AB { - background-position: 93.75% 35.48387% -} - -.emojione-1F6AC { - background-position: 93.75% 38.70968% -} - -.emojione-1F6AD { - background-position: 93.75% 41.93548% -} - -.emojione-1F6AE { - background-position: 93.75% 45.16129% -} - -.emojione-1F6AF { - background-position: 93.75% 48.3871% -} - -.emojione-1F6B0 { - background-position: 93.75% 51.6129% -} - -.emojione-1F6B1 { - background-position: 93.75% 54.83871% -} - -.emojione-1F6B2 { - background-position: 93.75% 58.06452% -} - -.emojione-1F6B3 { - background-position: 93.75% 61.29032% -} - -.emojione-1F6B4 { - background-position: 93.75% 64.51613% -} - -.emojione-1F6B5 { - background-position: 93.75% 67.74194% -} - -.emojione-1F6B6 { - background-position: 93.75% 70.96774% -} - -.emojione-1F6B7 { - background-position: 93.75% 74.19355% -} - -.emojione-1F6B8 { - background-position: 93.75% 77.41935% -} - -.emojione-1F6B9 { - background-position: 93.75% 80.64516% -} - -.emojione-1F6BA { - background-position: 93.75% 83.87097% -} - -.emojione-1F6BB { - background-position: 93.75% 87.09677% -} - -.emojione-1F6BC { - background-position: 93.75% 90.32258% -} - -.emojione-1F6BD { - background-position: 93.75% 93.54839% -} - -.emojione-1F6BE { - background-position: 0% 96.77419% -} - -.emojione-1F6BF { - background-position: 3.125% 96.77419% -} - -.emojione-1F6C0 { - background-position: 6.25% 96.77419% -} - -.emojione-1F6C1 { - background-position: 9.375% 96.77419% -} - -.emojione-1F6C2 { - background-position: 12.5% 96.77419% -} - -.emojione-1F6C3 { - background-position: 15.625% 96.77419% -} - -.emojione-1F6C4 { - background-position: 18.75% 96.77419% -} - -.emojione-1F6C5 { - background-position: 21.875% 96.77419% -} - -.emojione-203C { - background-position: 25% 96.77419% -} - -.emojione-2049 { - background-position: 28.125% 96.77419% -} - -.emojione-2122 { - background-position: 31.25% 96.77419% -} - -.emojione-2139 { - background-position: 34.375% 96.77419% -} - -.emojione-2194 { - background-position: 37.5% 96.77419% -} - -.emojione-2195 { - background-position: 40.625% 96.77419% -} - -.emojione-2196 { - background-position: 43.75% 96.77419% -} - -.emojione-2197 { - background-position: 46.875% 96.77419% -} - -.emojione-2198 { - background-position: 50% 96.77419% -} - -.emojione-2199 { - background-position: 53.125% 96.77419% -} - -.emojione-21A9 { - background-position: 56.25% 96.77419% -} - -.emojione-21AA { - background-position: 59.375% 96.77419% -} - -.emojione-231A { - background-position: 62.5% 96.77419% -} - -.emojione-231B { - background-position: 65.625% 96.77419% -} - -.emojione-23E9 { - background-position: 68.75% 96.77419% -} - -.emojione-23EA { - background-position: 71.875% 96.77419% -} - -.emojione-23EB { - background-position: 75% 96.77419% -} - -.emojione-23EC { - background-position: 78.125% 96.77419% -} - -.emojione-23F0 { - background-position: 81.25% 96.77419% -} - -.emojione-23F3 { - background-position: 84.375% 96.77419% -} - -.emojione-24C2 { - background-position: 87.5% 96.77419% -} - -.emojione-25AA { - background-position: 90.625% 96.77419% -} - -.emojione-25AB { - background-position: 93.75% 96.77419% -} - -.emojione-25B6 { - background-position: 96.875% 0% -} - -.emojione-25C0 { - background-position: 96.875% 3.22581% -} - -.emojione-25FB { - background-position: 96.875% 6.45161% -} - -.emojione-25FC { - background-position: 96.875% 9.67742% -} - -.emojione-25FD { - background-position: 96.875% 12.90323% -} - -.emojione-25FE { - background-position: 96.875% 16.12903% -} - -.emojione-2600 { - background-position: 96.875% 19.35484% -} - -.emojione-2601 { - background-position: 96.875% 22.58065% -} - -.emojione-260E { - background-position: 96.875% 25.80645% -} - -.emojione-2611 { - background-position: 96.875% 29.03226% -} - -.emojione-2614 { - background-position: 96.875% 32.25806% -} - -.emojione-2615 { - background-position: 96.875% 35.48387% -} - -.emojione-261D { - background-position: 96.875% 38.70968% -} - -.emojione-263A { - background-position: 96.875% 41.93548% -} - -.emojione-2648 { - background-position: 96.875% 45.16129% -} - -.emojione-2649 { - background-position: 96.875% 48.3871% -} - -.emojione-264A { - background-position: 96.875% 51.6129% -} - -.emojione-264B { - background-position: 96.875% 54.83871% -} - -.emojione-264C { - background-position: 96.875% 58.06452% -} - -.emojione-264D { - background-position: 96.875% 61.29032% -} - -.emojione-264E { - background-position: 96.875% 64.51613% -} - -.emojione-264F { - background-position: 96.875% 67.74194% -} - -.emojione-2650 { - background-position: 96.875% 70.96774% -} - -.emojione-2651 { - background-position: 96.875% 74.19355% -} - -.emojione-2652 { - background-position: 96.875% 77.41935% -} - -.emojione-2653 { - background-position: 96.875% 80.64516% -} - -.emojione-2660 { - background-position: 96.875% 83.87097% -} - -.emojione-2663 { - background-position: 96.875% 87.09677% -} - -.emojione-2665 { - background-position: 96.875% 90.32258% -} - -.emojione-2666 { - background-position: 96.875% 93.54839% -} - -.emojione-2668 { - background-position: 96.875% 96.77419% -} - -.emojione-267B { - background-position: 0% 100% -} - -.emojione-267F { - background-position: 3.125% 100% -} - -.emojione-2693 { - background-position: 6.25% 100% -} - -.emojione-26A0 { - background-position: 9.375% 100% -} - -.emojione-26A1 { - background-position: 12.5% 100% -} - -.emojione-26AA { - background-position: 15.625% 100% -} - -.emojione-26AB { - background-position: 18.75% 100% -} - -.emojione-26BD { - background-position: 21.875% 100% -} - -.emojione-26BE { - background-position: 25% 100% -} - -.emojione-26C4 { - background-position: 28.125% 100% -} - -.emojione-26C5 { - background-position: 31.25% 100% -} - -.emojione-26CE { - background-position: 34.375% 100% -} - -.emojione-26D4 { - background-position: 37.5% 100% -} - -.emojione-26EA { - background-position: 40.625% 100% -} - -.emojione-26F2 { - background-position: 43.75% 100% -} - -.emojione-26F3 { - background-position: 46.875% 100% -} - -.emojione-26F5 { - background-position: 50% 100% -} - -.emojione-26FA { - background-position: 53.125% 100% -} - -.emojione-26FD { - background-position: 56.25% 100% -} - -.emojione-2702 { - background-position: 59.375% 100% -} - -.emojione-2705 { - background-position: 62.5% 100% -} - -.emojione-2708 { - background-position: 65.625% 100% -} - -.emojione-2709 { - background-position: 68.75% 100% -} - -.emojione-270A { - background-position: 71.875% 100% -} - -.emojione-270B { - background-position: 75% 100% -} - -.emojione-270C { - background-position: 78.125% 100% -} - -.emojione-270F { - background-position: 81.25% 100% -} - -.emojione-2712 { - background-position: 84.375% 100% -} - -.emojione-2714 { - background-position: 87.5% 100% -} - -.emojione-2716 { - background-position: 90.625% 100% -} - -.emojione-2728 { - background-position: 93.75% 100% -} - -.emojione-2733 { - background-position: 96.875% 100% -} - -.emojione-2734 { - background-position: 100% 0% -} - -.emojione-2744 { - background-position: 100% 3.22581% -} - -.emojione-2747 { - background-position: 100% 6.45161% -} - -.emojione-274C { - background-position: 100% 9.67742% -} - -.emojione-274E { - background-position: 100% 12.90323% -} - -.emojione-2753 { - background-position: 100% 16.12903% -} - -.emojione-2754 { - background-position: 100% 19.35484% -} - -.emojione-2755 { - background-position: 100% 22.58065% -} - -.emojione-2757 { - background-position: 100% 25.80645% -} - -.emojione-2764 { - background-position: 100% 29.03226% -} - -.emojione-2795 { - background-position: 100% 32.25806% -} - -.emojione-2796 { - background-position: 100% 35.48387% -} - -.emojione-2797 { - background-position: 100% 38.70968% -} - -.emojione-27A1 { - background-position: 100% 41.93548% -} - -.emojione-27B0 { - background-position: 100% 45.16129% -} - -.emojione-27BF { - background-position: 100% 48.3871% -} - -.emojione-2934 { - background-position: 100% 51.6129% -} - -.emojione-2935 { - background-position: 100% 54.83871% -} - -.emojione-2B05 { - background-position: 100% 58.06452% -} - -.emojione-2B06 { - background-position: 100% 61.29032% -} - -.emojione-2B07 { - background-position: 100% 64.51613% -} - -.emojione-2B1B { - background-position: 100% 67.74194% -} - -.emojione-2B1C { - background-position: 100% 70.96774% -} - -.emojione-2B50 { - background-position: 100% 74.19355% -} - -.emojione-2B55 { - background-position: 100% 77.41935% -} - -.emojione-3030 { - background-position: 100% 80.64516% -} - -.emojione-303D { - background-position: 100% 83.87097% -} - -.emojione-3297 { - background-position: 100% 87.09677% -} - -.emojione-3299 { - background-position: 100% 90.32258% -} - - -/* AutoComplete styles for Emoji One */ -.dropdown-menu { - list-style: none; - padding: .3em 0 0; - margin: 0; - border: 1px solid #6E6E6E; - background-color: white; - border-radius: 5px; - overflow: hidden; - font-size: inherit; - letter-spacing: .025em; - box-shadow: 3px 3px 3px rgba(0,0,0,.2); -} -.dropdown-menu a:hover { - cursor: pointer; -} -.dropdown-menu li { - letter-spacing: 0; - display: block; - float: none; - margin: 0; - padding: 0; - border:none; -} -.dropdown-menu li:before { - display: none; -} -.dropdown-menu .textcomplete-footer { - margin-top: .3em; - background: #e6e6e6; -} -.dropdown-menu .textcomplete-footer a { - color: #999999; - text-decoration: none; - text-transform: uppercase; - letter-spacing: .05em; - line-height: 2.1818em; - padding-left: 1.8181em; - font-size: .84em; -} -.dropdown-menu .textcomplete-footer .arrow { - margin-left: .8em; - font-size: 1.3em; -} -.dropdown-menu li .emojione { - vertical-align: middle; - font-size: 1.23em; - width: 1em; - height: 1em; - top: -1px; - margin: 0 .3em 0 0; -} -.dropdown-menu li a { - display: block; - height: 100%; - line-height: 1.8em; - padding: 0 1.54em 0 .615em; - color: #4f4f4f; -} -.dropdown-menu .active, -.dropdown-menu li:hover { - background: #6E6E6E; - color: white; -} -.dropdown-menu .active a, -.dropdown-menu li:hover a { - color: inherit; -} diff --git a/pagure/static/emoji/emojione.sprites-1.3.1.png b/pagure/static/emoji/emojione.sprites-1.3.1.png deleted file mode 100644 index 1f2aecc..0000000 Binary files a/pagure/static/emoji/emojione.sprites-1.3.1.png and /dev/null differ diff --git a/pagure/static/emoji/emojione.sprites.css b/pagure/static/emoji/emojione.sprites.css deleted file mode 120000 index 8f31e00..0000000 --- a/pagure/static/emoji/emojione.sprites.css +++ /dev/null @@ -1 +0,0 @@ -emojione.sprites.min-1.3.1.css \ No newline at end of file diff --git a/pagure/static/emoji/emojione.sprites.min-1.3.1.css b/pagure/static/emoji/emojione.sprites.min-1.3.1.css deleted file mode 100755 index cca9e95..0000000 --- a/pagure/static/emoji/emojione.sprites.min-1.3.1.css +++ /dev/null @@ -1,71 +0,0 @@ -[class*=emojione-]{text-indent:-9999em;image-rendering:optimizeQuality;font-size:inherit;height:1.3em;width:1.3em;top:-3px;position:relative;display:inline-block;margin:0 .15em;line-height:normal;vertical-align:middle;background-image:url("emojione.sprites.png");background-size:3300%;background-repeat:no-repeat}.emojione-0023-20E3{background-position:3.125% 0%}.emojione-0030-20E3{background-position:21.875% 64.51613%}.emojione-0031-20E3{background-position:0% 3.22581%}.emojione-0032-20E3{background-position:3.125% 3.22581%}.emojione-0033-20E3{background-position:6.25% 0%}.emojione-0034-20E3{background-position:6.25% 3.22581%}.emojione-0035-20E3{background-position:0% 6.45161%}.emojione-0036-20E3{background-position:3.125% 6.45161%}.emojione-0037-20E3{background-position:6.25% 6.45161%}.emojione-0038-20E3{background-position:9.375% 0%}.emojione-0039-20E3{background-position:9.375% 3.22581%}.emojione-00A9{background-position:9.375% 6.45161%}.emojione-00AE{background-position:0% 9.67742%}.emojione-1F004{background-position:3.125% 9.67742%}.emojione-1F0CF{background-position:6.25% 9.67742%}.emojione-1F170{background-position:9.375% 9.67742%}.emojione-1F171{background-position:12.5% 0%}.emojione-1F17E{background-position:12.5% 3.22581%}.emojione-1F17F{background-position:12.5% 6.45161%}.emojione-1F18E{background-position:12.5% 9.67742%}.emojione-1F191{background-position:0% 12.90323%}.emojione-1F192{background-position:3.125% 12.90323%}.emojione-1F193{background-position:6.25% 12.90323%}.emojione-1F194{background-position:9.375% 12.90323%}.emojione-1F195{background-position:12.5% 12.90323%}.emojione-1F196{background-position:15.625% 0%}.emojione-1F197{background-position:15.625% 3.22581%}.emojione-1F198{background-position:15.625% 6.45161%}.emojione-1F199{background-position:15.625% 9.67742%}.emojione-1F19A{background-position:15.625% 12.90323%}.emojione-1F1E6-1F1E8{background-position:0% 16.12903%}.emojione-1F1E6-1F1E9{background-position:3.125% 16.12903%}.emojione-1F1E6-1F1EA{background-position:6.25% 16.12903%}.emojione-1F1E6-1F1EB{background-position:9.375% 16.12903%}.emojione-1F1E6-1F1EC{background-position:12.5% 16.12903%}.emojione-1F1E6-1F1EE{background-position:15.625% 16.12903%}.emojione-1F1E6-1F1F1{background-position:18.75% 0%}.emojione-1F1E6-1F1F2{background-position:18.75% 3.22581%}.emojione-1F1E6-1F1F4{background-position:18.75% 6.45161%}.emojione-1F1E6-1F1F7{background-position:18.75% 9.67742%}.emojione-1F1E6-1F1F9{background-position:18.75% 12.90323%}.emojione-1F1E6-1F1FA{background-position:18.75% 16.12903%}.emojione-1F1E6-1F1FC{background-position:0% 19.35484%}.emojione-1F1E6-1F1FF{background-position:3.125% 19.35484%}.emojione-1F1E7-1F1E6{background-position:6.25% 19.35484%}.emojione-1F1E7-1F1E7{background-position:9.375% 19.35484%}.emojione-1F1E7-1F1E9{background-position:12.5% 19.35484%}.emojione-1F1E7-1F1EA{background-position:15.625% 19.35484%}.emojione-1F1E7-1F1EB{background-position:18.75% 19.35484%}.emojione-1F1E7-1F1EC{background-position:21.875% 0%}.emojione-1F1E7-1F1ED{background-position:21.875% 3.22581%}.emojione-1F1E7-1F1EE{background-position:21.875% 6.45161%}.emojione-1F1E7-1F1EF{background-position:21.875% 9.67742%}.emojione-1F1E7-1F1F2{background-position:21.875% 12.90323%}.emojione-1F1E7-1F1F3{background-position:21.875% 16.12903%}.emojione-1F1E7-1F1F4{background-position:21.875% 19.35484%}.emojione-1F1E7-1F1F7{background-position:0% 22.58065%}.emojione-1F1E7-1F1F8{background-position:3.125% 22.58065%}.emojione-1F1E7-1F1F9{background-position:6.25% 22.58065%}.emojione-1F1E7-1F1FC{background-position:9.375% 22.58065%}.emojione-1F1E7-1F1FE{background-position:12.5% 22.58065%}.emojione-1F1E7-1F1FF{background-position:15.625% 22.58065%}.emojione-1F1E8-1F1E6{background-position:18.75% 22.58065%}.emojione-1F1E8-1F1E9{background-position:21.875% 22.58065%}.emojione-1F1E8-1F1EB{background-position:25% 0%}.emojione-1F1E8-1F1EC{background-position:25% 3.22581%}.emojione-1F1E8-1F1ED{background-position:25% 6.45161%}.emojione-1F1E8-1F1EE{background-position:25% 9.67742%}.emojione-1F1E8-1F1F1{background-position:25% 12.90323%}.emojione-1F1E8-1F1F2{background-position:25% 16.12903%}.emojione-1F1E8-1F1F3{background-position:25% 19.35484%}.emojione-1F1E8-1F1F4{background-position:25% 22.58065%}.emojione-1F1E8-1F1F7{background-position:0% 25.80645%}.emojione-1F1E8-1F1FA{background-position:3.125% 25.80645%}.emojione-1F1E8-1F1FB{background-position:6.25% 25.80645%}.emojione-1F1E8-1F1FE{background-position:9.375% 25.80645%}.emojione-1F1E8-1F1FF{background-position:12.5% 25.80645%}.emojione-1F1E9-1F1EA{background-position:15.625% 25.80645%}.emojione-1F1E9-1F1EF{background-position:18.75% 25.80645%}.emojione-1F1E9-1F1F0{background-position:21.875% 25.80645%}.emojione-1F1E9-1F1F2{background-position:25% 25.80645%}.emojione-1F1E9-1F1F4{background-position:28.125% 0%}.emojione-1F1E9-1F1FF{background-position:28.125% 3.22581%}.emojione-1F1EA-1F1E8{background-position:28.125% 6.45161%}.emojione-1F1EA-1F1EA{background-position:28.125% 9.67742%}.emojione-1F1EA-1F1EC{background-position:28.125% 12.90323%}.emojione-1F1EA-1F1ED{background-position:28.125% 16.12903%}.emojione-1F1EA-1F1F7{background-position:28.125% 19.35484%}.emojione-1F1EA-1F1F8{background-position:28.125% 22.58065%}.emojione-1F1EA-1F1F9{background-position:28.125% 25.80645%}.emojione-1F1EB-1F1EE{background-position:0% 29.03226%}.emojione-1F1EB-1F1EF{background-position:3.125% 29.03226%}.emojione-1F1EB-1F1F0{background-position:6.25% 29.03226%}.emojione-1F1EB-1F1F2{background-position:9.375% 29.03226%}.emojione-1F1EB-1F1F4{background-position:12.5% 29.03226%}.emojione-1F1EB-1F1F7{background-position:15.625% 29.03226%}.emojione-1F1EC-1F1E6{background-position:18.75% 29.03226%}.emojione-1F1EC-1F1E7{background-position:21.875% 29.03226%}.emojione-1F1EC-1F1E9{background-position:25% 29.03226%}.emojione-1F1EC-1F1EA{background-position:28.125% 29.03226%}.emojione-1F1EC-1F1ED{background-position:31.25% 0%}.emojione-1F1EC-1F1EE{background-position:31.25% 3.22581%}.emojione-1F1EC-1F1F1{background-position:31.25% 6.45161%}.emojione-1F1EC-1F1F2{background-position:31.25% 9.67742%}.emojione-1F1EC-1F1F3{background-position:31.25% 12.90323%}.emojione-1F1EC-1F1F6{background-position:31.25% 16.12903%}.emojione-1F1EC-1F1F7{background-position:31.25% 19.35484%}.emojione-1F1EC-1F1F9{background-position:31.25% 22.58065%}.emojione-1F1EC-1F1FA{background-position:31.25% 25.80645%}.emojione-1F1EC-1F1FC{background-position:31.25% 29.03226%}.emojione-1F1EC-1F1FE{background-position:0% 32.25806%}.emojione-1F1ED-1F1F0{background-position:3.125% 32.25806%}.emojione-1F1ED-1F1F3{background-position:6.25% 32.25806%}.emojione-1F1ED-1F1F7{background-position:9.375% 32.25806%}.emojione-1F1ED-1F1F9{background-position:12.5% 32.25806%}.emojione-1F1ED-1F1FA{background-position:15.625% 32.25806%}.emojione-1F1EE-1F1E9{background-position:18.75% 32.25806%}.emojione-1F1EE-1F1EA{background-position:21.875% 32.25806%}.emojione-1F1EE-1F1F1{background-position:25% 32.25806%}.emojione-1F1EE-1F1F3{background-position:28.125% 32.25806%}.emojione-1F1EE-1F1F6{background-position:31.25% 32.25806%}.emojione-1F1EE-1F1F7{background-position:34.375% 0%}.emojione-1F1EE-1F1F8{background-position:34.375% 3.22581%}.emojione-1F1EE-1F1F9{background-position:34.375% 6.45161%}.emojione-1F1EF-1F1EA{background-position:34.375% 9.67742%}.emojione-1F1EF-1F1F2{background-position:34.375% 12.90323%}.emojione-1F1EF-1F1F4{background-position:34.375% 16.12903%}.emojione-1F1EF-1F1F5{background-position:34.375% 19.35484%}.emojione-1F1F0-1F1EA{background-position:34.375% 22.58065%}.emojione-1F1F0-1F1EC{background-position:34.375% 25.80645%}.emojione-1F1F0-1F1ED{background-position:34.375% 29.03226%}.emojione-1F1F0-1F1EE{background-position:34.375% 32.25806%}.emojione-1F1F0-1F1F2{background-position:0% 35.48387%}.emojione-1F1F0-1F1F3{background-position:3.125% 35.48387%}.emojione-1F1F0-1F1F5{background-position:6.25% 35.48387%}.emojione-1F1F0-1F1F7{background-position:9.375% 35.48387%}.emojione-1F1F0-1F1FC{background-position:12.5% 35.48387%}.emojione-1F1F0-1F1FE{background-position:15.625% 35.48387%}.emojione-1F1F0-1F1FF{background-position:18.75% 35.48387%}.emojione-1F1F1-1F1E6{background-position:21.875% 35.48387%}.emojione-1F1F1-1F1E7{background-position:25% 35.48387%}.emojione-1F1F1-1F1E8{background-position:28.125% 35.48387%}.emojione-1F1F1-1F1EE{background-position:31.25% 35.48387%}.emojione-1F1F1-1F1F0{background-position:34.375% 35.48387%}.emojione-1F1F1-1F1F7{background-position:37.5% 0%}.emojione-1F1F1-1F1F8{background-position:37.5% 3.22581%}.emojione-1F1F1-1F1F9{background-position:37.5% 6.45161%}.emojione-1F1F1-1F1FA{background-position:37.5% 9.67742%}.emojione-1F1F1-1F1FB{background-position:37.5% 12.90323%}.emojione-1F1F1-1F1FE{background-position:37.5% 16.12903%}.emojione-1F1F2-1F1E6{background-position:37.5% 19.35484%}.emojione-1F1F2-1F1E8{background-position:37.5% 22.58065%}.emojione-1F1F2-1F1E9{background-position:37.5% 25.80645%}.emojione-1F1F2-1F1EA{background-position:37.5% 29.03226%}.emojione-1F1F2-1F1EC{background-position:37.5% 32.25806%}.emojione-1F1F2-1F1ED{background-position:37.5% 35.48387%}.emojione-1F1F2-1F1F0{background-position:0% 38.70968%}.emojione-1F1F2-1F1F1{background-position:3.125% 38.70968%}.emojione-1F1F2-1F1F2{background-position:6.25% 38.70968%}.emojione-1F1F2-1F1F3{background-position:9.375% 38.70968%}.emojione-1F1F2-1F1F4{background-position:12.5% 38.70968%}.emojione-1F1F2-1F1F7{background-position:15.625% 38.70968%}.emojione-1F1F2-1F1F8{background-position:18.75% 38.70968%}.emojione-1F1F2-1F1F9{background-position:21.875% 38.70968%}.emojione-1F1F2-1F1FA{background-position:25% 38.70968%}.emojione-1F1F2-1F1FB{background-position:28.125% 38.70968%}.emojione-1F1F2-1F1FC{background-position:31.25% 38.70968%}.emojione-1F1F2-1F1FD{background-position:34.375% 38.70968%}.emojione-1F1F2-1F1FE{background-position:37.5% 38.70968%}.emojione-1F1F2-1F1FF{background-position:40.625% 0%}.emojione-1F1F3-1F1E6{background-position:40.625% 3.22581%}.emojione-1F1F3-1F1E8{background-position:40.625% 6.45161%}.emojione-1F1F3-1F1EA{background-position:40.625% 9.67742%}.emojione-1F1F3-1F1EC{background-position:40.625% 12.90323%}.emojione-1F1F3-1F1EE{background-position:40.625% 16.12903%}.emojione-1F1F3-1F1F1{background-position:40.625% 19.35484%}.emojione-1F1F3-1F1F4{background-position:40.625% 22.58065%}.emojione-1F1F3-1F1F5{background-position:40.625% 25.80645%}.emojione-1F1F3-1F1F7{background-position:40.625% 29.03226%}.emojione-1F1F3-1F1FA{background-position:40.625% 32.25806%}.emojione-1F1F3-1F1FF{background-position:40.625% 35.48387%}.emojione-1F1F4-1F1F2{background-position:40.625% 38.70968%}.emojione-1F1F5-1F1E6{background-position:0% 41.93548%}.emojione-1F1F5-1F1EA{background-position:3.125% 41.93548%}.emojione-1F1F5-1F1EB{background-position:6.25% 41.93548%}.emojione-1F1F5-1F1EC{background-position:9.375% 41.93548%}.emojione-1F1F5-1F1ED{background-position:12.5% 41.93548%}.emojione-1F1F5-1F1F0{background-position:15.625% 41.93548%}.emojione-1F1F5-1F1F1{background-position:18.75% 41.93548%}.emojione-1F1F5-1F1F7{background-position:21.875% 41.93548%}.emojione-1F1F5-1F1F8{background-position:25% 41.93548%}.emojione-1F1F5-1F1F9{background-position:28.125% 41.93548%}.emojione-1F1F5-1F1FC{background-position:31.25% 41.93548%}.emojione-1F1F5-1F1FE{background-position:34.375% 41.93548%}.emojione-1F1F6-1F1E6{background-position:37.5% 41.93548%}.emojione-1F1F7-1F1F4{background-position:40.625% 41.93548%}.emojione-1F1F7-1F1F8{background-position:43.75% 0%}.emojione-1F1F7-1F1FA{background-position:43.75% 3.22581%}.emojione-1F1F7-1F1FC{background-position:43.75% 6.45161%}.emojione-1F1F8-1F1E6{background-position:43.75% 9.67742%}.emojione-1F1F8-1F1E7{background-position:43.75% 12.90323%}.emojione-1F1F8-1F1E8{background-position:43.75% 16.12903%}.emojione-1F1F8-1F1E9{background-position:43.75% 19.35484%}.emojione-1F1F8-1F1EA{background-position:43.75% 22.58065%}.emojione-1F1F8-1F1EC{background-position:43.75% 25.80645%}.emojione-1F1F8-1F1ED{background-position:43.75% 29.03226%}.emojione-1F1F8-1F1EE{background-position:43.75% 32.25806%}.emojione-1F1F8-1F1F0{background-position:43.75% 35.48387%}.emojione-1F1F8-1F1F1{background-position:43.75% 38.70968%}.emojione-1F1F8-1F1F2{background-position:43.75% 41.93548%}.emojione-1F1F8-1F1F3{background-position:0% 45.16129%}.emojione-1F1F8-1F1F4{background-position:3.125% 45.16129%}.emojione-1F1F8-1F1F7{background-position:6.25% 45.16129%}.emojione-1F1F8-1F1F9{background-position:9.375% 45.16129%}.emojione-1F1F8-1F1FB{background-position:12.5% 45.16129%}.emojione-1F1F8-1F1FE{background-position:15.625% 45.16129%}.emojione-1F1F8-1F1FF{background-position:18.75% 45.16129%}.emojione-1F1F9-1F1E9{background-position:21.875% 45.16129%}.emojione-1F1F9-1F1EC{background-position:25% 45.16129%}.emojione-1F1F9-1F1ED{background-position:28.125% 45.16129%}.emojione-1F1F9-1F1EF{background-position:31.25% 45.16129%}.emojione-1F1F9-1F1F1{background-position:34.375% 45.16129%}.emojione-1F1F9-1F1F2{background-position:37.5% 45.16129%}.emojione-1F1F9-1F1F3{background-position:40.625% 45.16129%}.emojione-1F1F9-1F1F4{background-position:43.75% 45.16129%}.emojione-1F1F9-1F1F7{background-position:46.875% 0%}.emojione-1F1F9-1F1F9{background-position:46.875% 3.22581%}.emojione-1F1F9-1F1FB{background-position:46.875% 6.45161%}.emojione-1F1F9-1F1FC{background-position:46.875% 9.67742%}.emojione-1F1F9-1F1FF{background-position:46.875% 12.90323%}.emojione-1F1FA-1F1E6{background-position:46.875% 16.12903%}.emojione-1F1FA-1F1EC{background-position:46.875% 19.35484%}.emojione-1F1FA-1F1F8{background-position:46.875% 22.58065%}.emojione-1F1FA-1F1FE{background-position:46.875% 25.80645%}.emojione-1F1FA-1F1FF{background-position:46.875% 29.03226%}.emojione-1F1FB-1F1E6{background-position:46.875% 32.25806%}.emojione-1F1FB-1F1E8{background-position:46.875% 35.48387%}.emojione-1F1FB-1F1EA{background-position:46.875% 38.70968%}.emojione-1F1FB-1F1EE{background-position:46.875% 41.93548%}.emojione-1F1FB-1F1F3{background-position:46.875% 45.16129%}.emojione-1F1FB-1F1FA{background-position:0% 48.3871%}.emojione-1F1FC-1F1EB{background-position:3.125% 48.3871%}.emojione-1F1FC-1F1F8{background-position:6.25% 48.3871%}.emojione-1F1FD-1F1F0{background-position:9.375% 48.3871%}.emojione-1F1FE-1F1EA{background-position:12.5% 48.3871%}.emojione-1F1FF-1F1E6{background-position:15.625% 48.3871%}.emojione-1F1FF-1F1F2{background-position:18.75% 48.3871%}.emojione-1F1FF-1F1FC{background-position:21.875% 48.3871%}.emojione-1F201{background-position:25% 48.3871%}.emojione-1F202{background-position:28.125% 48.3871%}.emojione-1F21A{background-position:31.25% 48.3871%}.emojione-1F22F{background-position:34.375% 48.3871%}.emojione-1F232{background-position:37.5% 48.3871%}.emojione-1F233{background-position:40.625% 48.3871%}.emojione-1F234{background-position:43.75% 48.3871%}.emojione-1F235{background-position:46.875% 48.3871%}.emojione-1F236{background-position:50% 0%}.emojione-1F237{background-position:50% 3.22581%}.emojione-1F238{background-position:50% 6.45161%}.emojione-1F239{background-position:50% 9.67742%}.emojione-1F23A{background-position:50% 12.90323%}.emojione-1F250{background-position:50% 16.12903%}.emojione-1F251{background-position:50% 19.35484%}.emojione-1F300{background-position:50% 22.58065%}.emojione-1F301{background-position:50% 25.80645%}.emojione-1F302{background-position:50% 29.03226%}.emojione-1F303{background-position:50% 32.25806%}.emojione-1F304{background-position:50% 35.48387%}.emojione-1F305{background-position:50% 38.70968%}.emojione-1F306{background-position:50% 41.93548%}.emojione-1F307{background-position:50% 45.16129%}.emojione-1F308{background-position:50% 48.3871%}.emojione-1F309{background-position:0% 51.6129%}.emojione-1F30A{background-position:3.125% 51.6129%}.emojione-1F30B{background-position:6.25% 51.6129%}.emojione-1F30C{background-position:9.375% 51.6129%}.emojione-1F30D{background-position:12.5% 51.6129%}.emojione-1F30E{background-position:15.625% 51.6129%}.emojione-1F30F{background-position:18.75% 51.6129%}.emojione-1F310{background-position:21.875% 51.6129%}.emojione-1F311{background-position:25% 51.6129%}.emojione-1F312{background-position:28.125% 51.6129%}.emojione-1F313{background-position:31.25% 51.6129%}.emojione-1F314{background-position:34.375% 51.6129%}.emojione-1F315{background-position:37.5% 51.6129%}.emojione-1F316{background-position:40.625% 51.6129%}.emojione-1F317{background-position:43.75% 51.6129%}.emojione-1F318{background-position:46.875% 51.6129%}.emojione-1F319{background-position:50% 51.6129%}.emojione-1F31A{background-position:53.125% 0%}.emojione-1F31B{background-position:53.125% 3.22581%}.emojione-1F31C{background-position:53.125% 6.45161%}.emojione-1F31D{background-position:53.125% 9.67742%}.emojione-1F31E{background-position:53.125% 12.90323%}.emojione-1F31F{background-position:53.125% 16.12903%}.emojione-1F320{background-position:53.125% 19.35484%}.emojione-1F330{background-position:53.125% 22.58065%}.emojione-1F331{background-position:53.125% 25.80645%}.emojione-1F332{background-position:53.125% 29.03226%}.emojione-1F333{background-position:53.125% 32.25806%}.emojione-1F334{background-position:53.125% 35.48387%}.emojione-1F335{background-position:53.125% 38.70968%}.emojione-1F337{background-position:53.125% 41.93548%}.emojione-1F338{background-position:53.125% 45.16129%}.emojione-1F339{background-position:53.125% 48.3871%}.emojione-1F33A{background-position:53.125% 51.6129%}.emojione-1F33B{background-position:0% 54.83871%}.emojione-1F33C{background-position:3.125% 54.83871%}.emojione-1F33D{background-position:6.25% 54.83871%}.emojione-1F33E{background-position:9.375% 54.83871%}.emojione-1F33F{background-position:12.5% 54.83871%}.emojione-1F340{background-position:15.625% 54.83871%}.emojione-1F341{background-position:18.75% 54.83871%}.emojione-1F342{background-position:21.875% 54.83871%}.emojione-1F343{background-position:25% 54.83871%}.emojione-1F344{background-position:28.125% 54.83871%}.emojione-1F345{background-position:31.25% 54.83871%}.emojione-1F346{background-position:34.375% 54.83871%}.emojione-1F347{background-position:37.5% 54.83871%}.emojione-1F348{background-position:40.625% 54.83871%}.emojione-1F349{background-position:43.75% 54.83871%}.emojione-1F34A{background-position:46.875% 54.83871%}.emojione-1F34B{background-position:50% 54.83871%}.emojione-1F34C{background-position:53.125% 54.83871%}.emojione-1F34D{background-position:56.25% 0%}.emojione-1F34E{background-position:56.25% 3.22581%}.emojione-1F34F{background-position:56.25% 6.45161%}.emojione-1F350{background-position:56.25% 9.67742%}.emojione-1F351{background-position:56.25% 12.90323%}.emojione-1F352{background-position:56.25% 16.12903%}.emojione-1F353{background-position:56.25% 19.35484%}.emojione-1F354{background-position:56.25% 22.58065%}.emojione-1F355{background-position:56.25% 25.80645%}.emojione-1F356{background-position:56.25% 29.03226%}.emojione-1F357{background-position:56.25% 32.25806%}.emojione-1F358{background-position:56.25% 35.48387%}.emojione-1F359{background-position:56.25% 38.70968%}.emojione-1F35A{background-position:56.25% 41.93548%}.emojione-1F35B{background-position:56.25% 45.16129%}.emojione-1F35C{background-position:56.25% 48.3871%}.emojione-1F35D{background-position:56.25% 51.6129%}.emojione-1F35E{background-position:56.25% 54.83871%}.emojione-1F35F{background-position:0% 58.06452%}.emojione-1F360{background-position:3.125% 58.06452%}.emojione-1F361{background-position:6.25% 58.06452%}.emojione-1F362{background-position:9.375% 58.06452%}.emojione-1F363{background-position:12.5% 58.06452%}.emojione-1F364{background-position:15.625% 58.06452%}.emojione-1F365{background-position:18.75% 58.06452%}.emojione-1F366{background-position:21.875% 58.06452%}.emojione-1F367{background-position:25% 58.06452%}.emojione-1F368{background-position:28.125% 58.06452%}.emojione-1F369{background-position:31.25% 58.06452%}.emojione-1F36A{background-position:34.375% 58.06452%}.emojione-1F36B{background-position:37.5% 58.06452%}.emojione-1F36C{background-position:40.625% 58.06452%}.emojione-1F36D{background-position:43.75% 58.06452%}.emojione-1F36E{background-position:46.875% 58.06452%}.emojione-1F36F{background-position:50% 58.06452%}.emojione-1F370{background-position:53.125% 58.06452%}.emojione-1F371{background-position:56.25% 58.06452%}.emojione-1F372{background-position:59.375% 0%}.emojione-1F373{background-position:59.375% 3.22581%}.emojione-1F374{background-position:59.375% 6.45161%}.emojione-1F375{background-position:59.375% 9.67742%}.emojione-1F376{background-position:59.375% 12.90323%}.emojione-1F377{background-position:59.375% 16.12903%}.emojione-1F378{background-position:59.375% 19.35484%}.emojione-1F379{background-position:59.375% 22.58065%}.emojione-1F37A{background-position:59.375% 25.80645%}.emojione-1F37B{background-position:59.375% 29.03226%}.emojione-1F37C{background-position:59.375% 32.25806%}.emojione-1F380{background-position:59.375% 35.48387%}.emojione-1F381{background-position:59.375% 38.70968%}.emojione-1F382{background-position:59.375% 41.93548%}.emojione-1F383{background-position:59.375% 45.16129%}.emojione-1F384{background-position:59.375% 48.3871%}.emojione-1F385{background-position:59.375% 51.6129%}.emojione-1F386{background-position:59.375% 54.83871%}.emojione-1F387{background-position:59.375% 58.06452%}.emojione-1F388{background-position:0% 61.29032%}.emojione-1F389{background-position:3.125% 61.29032%}.emojione-1F38A{background-position:6.25% 61.29032%}.emojione-1F38B{background-position:9.375% 61.29032%}.emojione-1F38C{background-position:12.5% 61.29032%}.emojione-1F38D{background-position:15.625% 61.29032%}.emojione-1F38E{background-position:18.75% 61.29032%}.emojione-1F38F{background-position:21.875% 61.29032%}.emojione-1F390{background-position:25% 61.29032%}.emojione-1F391{background-position:28.125% 61.29032%}.emojione-1F392{background-position:31.25% 61.29032%}.emojione-1F393{background-position:34.375% 61.29032%}.emojione-1F3A0{background-position:37.5% 61.29032%}.emojione-1F3A1{background-position:40.625% 61.29032%}.emojione-1F3A2{background-position:43.75% 61.29032%}.emojione-1F3A3{background-position:46.875% 61.29032%}.emojione-1F3A4{background-position:50% 61.29032%}.emojione-1F3A5{background-position:53.125% 61.29032%}.emojione-1F3A6{background-position:56.25% 61.29032%}.emojione-1F3A7{background-position:59.375% 61.29032%}.emojione-1F3A8{background-position:62.5% 0%}.emojione-1F3A9{background-position:62.5% 3.22581%}.emojione-1F3AA{background-position:62.5% 6.45161%}.emojione-1F3AB{background-position:62.5% 9.67742%}.emojione-1F3AC{background-position:62.5% 12.90323%}.emojione-1F3AD{background-position:62.5% 16.12903%}.emojione-1F3AE{background-position:62.5% 19.35484%}.emojione-1F3AF{background-position:62.5% 22.58065%}.emojione-1F3B0{background-position:62.5% 25.80645%}.emojione-1F3B1{background-position:62.5% 29.03226%}.emojione-1F3B2{background-position:62.5% 32.25806%}.emojione-1F3B3{background-position:62.5% 35.48387%}.emojione-1F3B4{background-position:62.5% 38.70968%}.emojione-1F3B5{background-position:62.5% 41.93548%}.emojione-1F3B6{background-position:62.5% 45.16129%}.emojione-1F3B7{background-position:62.5% 48.3871%}.emojione-1F3B8{background-position:62.5% 51.6129%}.emojione-1F3B9{background-position:62.5% 54.83871%}.emojione-1F3BA{background-position:62.5% 58.06452%}.emojione-1F3BB{background-position:62.5% 61.29032%}.emojione-1F3BC{background-position:0% 64.51613%}.emojione-1F3BD{background-position:3.125% 64.51613%}.emojione-1F3BE{background-position:6.25% 64.51613%}.emojione-1F3BF{background-position:9.375% 64.51613%}.emojione-1F3C0{background-position:12.5% 64.51613%}.emojione-1F3C1{background-position:15.625% 64.51613%}.emojione-1F3C2{background-position:18.75% 64.51613%}.emojione-1F3C3{background-position:0% 0%}.emojione-1F3C4{background-position:25% 64.51613%}.emojione-1F3C6{background-position:28.125% 64.51613%}.emojione-1F3C7{background-position:31.25% 64.51613%}.emojione-1F3C8{background-position:34.375% 64.51613%}.emojione-1F3C9{background-position:37.5% 64.51613%}.emojione-1F3CA{background-position:40.625% 64.51613%}.emojione-1F3E0{background-position:43.75% 64.51613%}.emojione-1F3E1{background-position:46.875% 64.51613%}.emojione-1F3E2{background-position:50% 64.51613%}.emojione-1F3E3{background-position:53.125% 64.51613%}.emojione-1F3E4{background-position:56.25% 64.51613%}.emojione-1F3E5{background-position:59.375% 64.51613%}.emojione-1F3E6{background-position:62.5% 64.51613%}.emojione-1F3E7{background-position:65.625% 0%}.emojione-1F3E8{background-position:65.625% 3.22581%}.emojione-1F3E9{background-position:65.625% 6.45161%}.emojione-1F3EA{background-position:65.625% 9.67742%}.emojione-1F3EB{background-position:65.625% 12.90323%}.emojione-1F3EC{background-position:65.625% 16.12903%}.emojione-1F3ED{background-position:65.625% 19.35484%}.emojione-1F3EE{background-position:65.625% 22.58065%}.emojione-1F3EF{background-position:65.625% 25.80645%}.emojione-1F3F0{background-position:65.625% 29.03226%}.emojione-1F400{background-position:65.625% 32.25806%}.emojione-1F401{background-position:65.625% 35.48387%}.emojione-1F402{background-position:65.625% 38.70968%}.emojione-1F403{background-position:65.625% 41.93548%}.emojione-1F404{background-position:65.625% 45.16129%}.emojione-1F405{background-position:65.625% 48.3871%}.emojione-1F406{background-position:65.625% 51.6129%}.emojione-1F407{background-position:65.625% 54.83871%}.emojione-1F408{background-position:65.625% 58.06452%}.emojione-1F409{background-position:65.625% 61.29032%}.emojione-1F40A{background-position:65.625% 64.51613%}.emojione-1F40B{background-position:0% 67.74194%}.emojione-1F40C{background-position:3.125% 67.74194%}.emojione-1F40D{background-position:6.25% 67.74194%}.emojione-1F40E{background-position:9.375% 67.74194%}.emojione-1F40F{background-position:12.5% 67.74194%}.emojione-1F410{background-position:15.625% 67.74194%}.emojione-1F411{background-position:18.75% 67.74194%}.emojione-1F412{background-position:21.875% 67.74194%}.emojione-1F413{background-position:25% 67.74194%}.emojione-1F414{background-position:28.125% 67.74194%}.emojione-1F415{background-position:31.25% 67.74194%}.emojione-1F416{background-position:34.375% 67.74194%}.emojione-1F417{background-position:37.5% 67.74194%}.emojione-1F418{background-position:40.625% 67.74194%}.emojione-1F419{background-position:43.75% 67.74194%}.emojione-1F41A{background-position:46.875% 67.74194%}.emojione-1F41B{background-position:50% 67.74194%}.emojione-1F41C{background-position:53.125% 67.74194%}.emojione-1F41D{background-position:56.25% 67.74194%}.emojione-1F41E{background-position:59.375% 67.74194%}.emojione-1F41F{background-position:62.5% 67.74194%}.emojione-1F420{background-position:65.625% 67.74194%}.emojione-1F421{background-position:68.75% 0%}.emojione-1F422{background-position:68.75% 3.22581%}.emojione-1F423{background-position:68.75% 6.45161%}.emojione-1F424{background-position:68.75% 9.67742%}.emojione-1F425{background-position:68.75% 12.90323%}.emojione-1F426{background-position:68.75% 16.12903%}.emojione-1F427{background-position:68.75% 19.35484%}.emojione-1F428{background-position:68.75% 22.58065%}.emojione-1F429{background-position:68.75% 25.80645%}.emojione-1F42A{background-position:68.75% 29.03226%}.emojione-1F42B{background-position:68.75% 32.25806%}.emojione-1F42C{background-position:68.75% 35.48387%}.emojione-1F42D{background-position:68.75% 38.70968%}.emojione-1F42E{background-position:68.75% 41.93548%}.emojione-1F42F{background-position:68.75% 45.16129%}.emojione-1F430{background-position:68.75% 48.3871%}.emojione-1F431{background-position:68.75% 51.6129%}.emojione-1F432{background-position:68.75% 54.83871%}.emojione-1F433{background-position:68.75% 58.06452%}.emojione-1F434{background-position:68.75% 61.29032%}.emojione-1F435{background-position:68.75% 64.51613%}.emojione-1F436{background-position:68.75% 67.74194%}.emojione-1F437{background-position:0% 70.96774%}.emojione-1F438{background-position:3.125% 70.96774%}.emojione-1F439{background-position:6.25% 70.96774%}.emojione-1F43A{background-position:9.375% 70.96774%}.emojione-1F43B{background-position:12.5% 70.96774%}.emojione-1F43C{background-position:15.625% 70.96774%}.emojione-1F43D{background-position:18.75% 70.96774%}.emojione-1F43E{background-position:21.875% 70.96774%}.emojione-1F440{background-position:25% 70.96774%}.emojione-1F442{background-position:28.125% 70.96774%}.emojione-1F443{background-position:31.25% 70.96774%}.emojione-1F444{background-position:34.375% 70.96774%}.emojione-1F445{background-position:37.5% 70.96774%}.emojione-1F446{background-position:40.625% 70.96774%}.emojione-1F447{background-position:43.75% 70.96774%}.emojione-1F448{background-position:46.875% 70.96774%}.emojione-1F449{background-position:50% 70.96774%}.emojione-1F44A{background-position:53.125% 70.96774%}.emojione-1F44B{background-position:56.25% 70.96774%}.emojione-1F44C{background-position:59.375% 70.96774%}.emojione-1F44D{background-position:62.5% 70.96774%}.emojione-1F44E{background-position:65.625% 70.96774%}.emojione-1F44F{background-position:68.75% 70.96774%}.emojione-1F450{background-position:71.875% 0%}.emojione-1F451{background-position:71.875% 3.22581%}.emojione-1F452{background-position:71.875% 6.45161%}.emojione-1F453{background-position:71.875% 9.67742%}.emojione-1F454{background-position:71.875% 12.90323%}.emojione-1F455{background-position:71.875% 16.12903%}.emojione-1F456{background-position:71.875% 19.35484%}.emojione-1F457{background-position:71.875% 22.58065%}.emojione-1F458{background-position:71.875% 25.80645%}.emojione-1F459{background-position:71.875% 29.03226%}.emojione-1F45A{background-position:71.875% 32.25806%}.emojione-1F45B{background-position:71.875% 35.48387%}.emojione-1F45C{background-position:71.875% 38.70968%}.emojione-1F45D{background-position:71.875% 41.93548%}.emojione-1F45E{background-position:71.875% 45.16129%}.emojione-1F45F{background-position:71.875% 48.3871%}.emojione-1F460{background-position:71.875% 51.6129%}.emojione-1F461{background-position:71.875% 54.83871%}.emojione-1F462{background-position:71.875% 58.06452%}.emojione-1F463{background-position:71.875% 61.29032%}.emojione-1F464{background-position:71.875% 64.51613%}.emojione-1F465{background-position:71.875% 67.74194%}.emojione-1F466{background-position:71.875% 70.96774%}.emojione-1F467{background-position:0% 74.19355%}.emojione-1F468{background-position:3.125% 74.19355%}.emojione-1F469{background-position:6.25% 74.19355%}.emojione-1F46A{background-position:9.375% 74.19355%}.emojione-1F46B{background-position:12.5% 74.19355%}.emojione-1F46C{background-position:15.625% 74.19355%}.emojione-1F46D{background-position:18.75% 74.19355%}.emojione-1F46E{background-position:21.875% 74.19355%}.emojione-1F46F{background-position:25% 74.19355%}.emojione-1F470{background-position:28.125% 74.19355%}.emojione-1F471{background-position:31.25% 74.19355%}.emojione-1F472{background-position:34.375% 74.19355%}.emojione-1F473{background-position:37.5% 74.19355%}.emojione-1F474{background-position:40.625% 74.19355%}.emojione-1F475{background-position:43.75% 74.19355%}.emojione-1F476{background-position:46.875% 74.19355%}.emojione-1F477{background-position:50% 74.19355%}.emojione-1F478{background-position:53.125% 74.19355%}.emojione-1F479{background-position:56.25% 74.19355%}.emojione-1F47A{background-position:59.375% 74.19355%}.emojione-1F47B{background-position:62.5% 74.19355%}.emojione-1F47C{background-position:65.625% 74.19355%}.emojione-1F47D{background-position:68.75% 74.19355%}.emojione-1F47E{background-position:71.875% 74.19355%}.emojione-1F47F{background-position:75% 0%}.emojione-1F480{background-position:75% 3.22581%}.emojione-1F481{background-position:75% 6.45161%}.emojione-1F482{background-position:75% 9.67742%}.emojione-1F483{background-position:75% 12.90323%}.emojione-1F484{background-position:75% 16.12903%}.emojione-1F485{background-position:75% 19.35484%}.emojione-1F486{background-position:75% 22.58065%}.emojione-1F487{background-position:75% 25.80645%}.emojione-1F488{background-position:75% 29.03226%}.emojione-1F489{background-position:75% 32.25806%}.emojione-1F48A{background-position:75% 35.48387%}.emojione-1F48B{background-position:75% 38.70968%}.emojione-1F48C{background-position:75% 41.93548%}.emojione-1F48D{background-position:75% 45.16129%}.emojione-1F48E{background-position:75% 48.3871%}.emojione-1F48F{background-position:75% 51.6129%}.emojione-1F490{background-position:75% 54.83871%}.emojione-1F491{background-position:75% 58.06452%}.emojione-1F492{background-position:75% 61.29032%}.emojione-1F493{background-position:75% 64.51613%}.emojione-1F494{background-position:75% 67.74194%}.emojione-1F495{background-position:75% 70.96774%}.emojione-1F496{background-position:75% 74.19355%}.emojione-1F497{background-position:0% 77.41935%}.emojione-1F498{background-position:3.125% 77.41935%}.emojione-1F499{background-position:6.25% 77.41935%}.emojione-1F49A{background-position:9.375% 77.41935%}.emojione-1F49B{background-position:12.5% 77.41935%}.emojione-1F49C{background-position:15.625% 77.41935%}.emojione-1F49D{background-position:18.75% 77.41935%}.emojione-1F49E{background-position:21.875% 77.41935%}.emojione-1F49F{background-position:25% 77.41935%}.emojione-1F4A0{background-position:28.125% 77.41935%}.emojione-1F4A1{background-position:31.25% 77.41935%}.emojione-1F4A2{background-position:34.375% 77.41935%}.emojione-1F4A3{background-position:37.5% 77.41935%}.emojione-1F4A4{background-position:40.625% 77.41935%}.emojione-1F4A5{background-position:43.75% 77.41935%}.emojione-1F4A6{background-position:46.875% 77.41935%}.emojione-1F4A7{background-position:50% 77.41935%}.emojione-1F4A8{background-position:53.125% 77.41935%}.emojione-1F4A9{background-position:56.25% 77.41935%}.emojione-1F4AA{background-position:59.375% 77.41935%}.emojione-1F4AB{background-position:62.5% 77.41935%}.emojione-1F4AC{background-position:65.625% 77.41935%}.emojione-1F4AD{background-position:68.75% 77.41935%}.emojione-1F4AE{background-position:71.875% 77.41935%}.emojione-1F4AF{background-position:75% 77.41935%}.emojione-1F4B0{background-position:78.125% 0%}.emojione-1F4B1{background-position:78.125% 3.22581%}.emojione-1F4B2{background-position:78.125% 6.45161%}.emojione-1F4B3{background-position:78.125% 9.67742%}.emojione-1F4B4{background-position:78.125% 12.90323%}.emojione-1F4B5{background-position:78.125% 16.12903%}.emojione-1F4B6{background-position:78.125% 19.35484%}.emojione-1F4B7{background-position:78.125% 22.58065%}.emojione-1F4B8{background-position:78.125% 25.80645%}.emojione-1F4B9{background-position:78.125% 29.03226%}.emojione-1F4BA{background-position:78.125% 32.25806%}.emojione-1F4BB{background-position:78.125% 35.48387%}.emojione-1F4BC{background-position:78.125% 38.70968%}.emojione-1F4BD{background-position:78.125% 41.93548%}.emojione-1F4BE{background-position:78.125% 45.16129%}.emojione-1F4BF{background-position:78.125% 48.3871%}.emojione-1F4C0{background-position:78.125% 51.6129%}.emojione-1F4C1{background-position:78.125% 54.83871%}.emojione-1F4C2{background-position:78.125% 58.06452%}.emojione-1F4C3{background-position:78.125% 61.29032%}.emojione-1F4C4{background-position:78.125% 64.51613%}.emojione-1F4C5{background-position:78.125% 67.74194%}.emojione-1F4C6{background-position:78.125% 70.96774%}.emojione-1F4C7{background-position:78.125% 74.19355%}.emojione-1F4C8{background-position:78.125% 77.41935%}.emojione-1F4C9{background-position:0% 80.64516%}.emojione-1F4CA{background-position:3.125% 80.64516%}.emojione-1F4CB{background-position:6.25% 80.64516%}.emojione-1F4CC{background-position:9.375% 80.64516%}.emojione-1F4CD{background-position:12.5% 80.64516%}.emojione-1F4CE{background-position:15.625% 80.64516%}.emojione-1F4CF{background-position:18.75% 80.64516%}.emojione-1F4D0{background-position:21.875% 80.64516%}.emojione-1F4D1{background-position:25% 80.64516%}.emojione-1F4D2{background-position:28.125% 80.64516%}.emojione-1F4D3{background-position:31.25% 80.64516%}.emojione-1F4D4{background-position:34.375% 80.64516%}.emojione-1F4D5{background-position:37.5% 80.64516%}.emojione-1F4D6{background-position:40.625% 80.64516%}.emojione-1F4D7{background-position:43.75% 80.64516%}.emojione-1F4D8{background-position:46.875% 80.64516%}.emojione-1F4D9{background-position:50% 80.64516%}.emojione-1F4DA{background-position:53.125% 80.64516%}.emojione-1F4DB{background-position:56.25% 80.64516%}.emojione-1F4DC{background-position:59.375% 80.64516%}.emojione-1F4DD{background-position:62.5% 80.64516%}.emojione-1F4DE{background-position:65.625% 80.64516%}.emojione-1F4DF{background-position:68.75% 80.64516%}.emojione-1F4E0{background-position:71.875% 80.64516%}.emojione-1F4E1{background-position:75% 80.64516%}.emojione-1F4E2{background-position:78.125% 80.64516%}.emojione-1F4E3{background-position:81.25% 0%}.emojione-1F4E4{background-position:81.25% 3.22581%}.emojione-1F4E5{background-position:81.25% 6.45161%}.emojione-1F4E6{background-position:81.25% 9.67742%}.emojione-1F4E7{background-position:81.25% 12.90323%}.emojione-1F4E8{background-position:81.25% 16.12903%}.emojione-1F4E9{background-position:81.25% 19.35484%}.emojione-1F4EA{background-position:81.25% 22.58065%}.emojione-1F4EB{background-position:81.25% 25.80645%}.emojione-1F4EC{background-position:81.25% 29.03226%}.emojione-1F4ED{background-position:81.25% 32.25806%}.emojione-1F4EE{background-position:81.25% 35.48387%}.emojione-1F4EF{background-position:81.25% 38.70968%}.emojione-1F4F0{background-position:81.25% 41.93548%}.emojione-1F4F1{background-position:81.25% 45.16129%}.emojione-1F4F2{background-position:81.25% 48.3871%}.emojione-1F4F3{background-position:81.25% 51.6129%}.emojione-1F4F4{background-position:81.25% 54.83871%}.emojione-1F4F5{background-position:81.25% 58.06452%}.emojione-1F4F6{background-position:81.25% 61.29032%}.emojione-1F4F7{background-position:81.25% 64.51613%}.emojione-1F4F9{background-position:81.25% 67.74194%}.emojione-1F4FA{background-position:81.25% 70.96774%}.emojione-1F4FB{background-position:81.25% 74.19355%}.emojione-1F4FC{background-position:81.25% 77.41935%}.emojione-1F500{background-position:81.25% 80.64516%}.emojione-1F501{background-position:0% 83.87097%}.emojione-1F502{background-position:3.125% 83.87097%}.emojione-1F503{background-position:6.25% 83.87097%}.emojione-1F504{background-position:9.375% 83.87097%}.emojione-1F505{background-position:12.5% 83.87097%}.emojione-1F506{background-position:15.625% 83.87097%}.emojione-1F507{background-position:18.75% 83.87097%}.emojione-1F508{background-position:21.875% 83.87097%}.emojione-1F509{background-position:25% 83.87097%}.emojione-1F50A{background-position:28.125% 83.87097%}.emojione-1F50B{background-position:31.25% 83.87097%}.emojione-1F50C{background-position:34.375% 83.87097%}.emojione-1F50D{background-position:37.5% 83.87097%}.emojione-1F50E{background-position:40.625% 83.87097%}.emojione-1F50F{background-position:43.75% 83.87097%}.emojione-1F510{background-position:46.875% 83.87097%}.emojione-1F511{background-position:50% 83.87097%}.emojione-1F512{background-position:53.125% 83.87097%}.emojione-1F513{background-position:56.25% 83.87097%}.emojione-1F514{background-position:59.375% 83.87097%}.emojione-1F515{background-position:62.5% 83.87097%}.emojione-1F516{background-position:65.625% 83.87097%}.emojione-1F517{background-position:68.75% 83.87097%}.emojione-1F518{background-position:71.875% 83.87097%}.emojione-1F519{background-position:75% 83.87097%}.emojione-1F51A{background-position:78.125% 83.87097%}.emojione-1F51B{background-position:81.25% 83.87097%}.emojione-1F51C{background-position:84.375% 0%}.emojione-1F51D{background-position:84.375% 3.22581%}.emojione-1F51E{background-position:84.375% 6.45161%}.emojione-1F51F{background-position:84.375% 9.67742%}.emojione-1F520{background-position:84.375% 12.90323%}.emojione-1F521{background-position:84.375% 16.12903%}.emojione-1F522{background-position:84.375% 19.35484%}.emojione-1F523{background-position:84.375% 22.58065%}.emojione-1F524{background-position:84.375% 25.80645%}.emojione-1F525{background-position:84.375% 29.03226%}.emojione-1F526{background-position:84.375% 32.25806%}.emojione-1F527{background-position:84.375% 35.48387%}.emojione-1F528{background-position:84.375% 38.70968%}.emojione-1F529{background-position:84.375% 41.93548%}.emojione-1F52A{background-position:84.375% 45.16129%}.emojione-1F52B{background-position:84.375% 48.3871%}.emojione-1F52C{background-position:84.375% 51.6129%}.emojione-1F52D{background-position:84.375% 54.83871%}.emojione-1F52E{background-position:84.375% 58.06452%}.emojione-1F52F{background-position:84.375% 61.29032%}.emojione-1F530{background-position:84.375% 64.51613%}.emojione-1F531{background-position:84.375% 67.74194%}.emojione-1F532{background-position:84.375% 70.96774%}.emojione-1F533{background-position:84.375% 74.19355%}.emojione-1F534{background-position:84.375% 77.41935%}.emojione-1F535{background-position:84.375% 80.64516%}.emojione-1F536{background-position:84.375% 83.87097%}.emojione-1F537{background-position:0% 87.09677%}.emojione-1F538{background-position:3.125% 87.09677%}.emojione-1F539{background-position:6.25% 87.09677%}.emojione-1F53A{background-position:9.375% 87.09677%}.emojione-1F53B{background-position:12.5% 87.09677%}.emojione-1F53C{background-position:15.625% 87.09677%}.emojione-1F53D{background-position:18.75% 87.09677%}.emojione-1F550{background-position:21.875% 87.09677%}.emojione-1F551{background-position:25% 87.09677%}.emojione-1F552{background-position:28.125% 87.09677%}.emojione-1F553{background-position:31.25% 87.09677%}.emojione-1F554{background-position:34.375% 87.09677%}.emojione-1F555{background-position:37.5% 87.09677%}.emojione-1F556{background-position:40.625% 87.09677%}.emojione-1F557{background-position:43.75% 87.09677%}.emojione-1F558{background-position:46.875% 87.09677%}.emojione-1F559{background-position:50% 87.09677%}.emojione-1F55A{background-position:53.125% 87.09677%}.emojione-1F55B{background-position:56.25% 87.09677%}.emojione-1F55C{background-position:59.375% 87.09677%}.emojione-1F55D{background-position:62.5% 87.09677%}.emojione-1F55E{background-position:65.625% 87.09677%}.emojione-1F55F{background-position:68.75% 87.09677%}.emojione-1F560{background-position:71.875% 87.09677%}.emojione-1F561{background-position:75% 87.09677%}.emojione-1F562{background-position:78.125% 87.09677%}.emojione-1F563{background-position:81.25% 87.09677%}.emojione-1F564{background-position:84.375% 87.09677%}.emojione-1F565{background-position:87.5% 0%}.emojione-1F566{background-position:87.5% 3.22581%}.emojione-1F567{background-position:87.5% 6.45161%}.emojione-1F5FB{background-position:87.5% 9.67742%}.emojione-1F5FC{background-position:87.5% 12.90323%}.emojione-1F5FD{background-position:87.5% 16.12903%}.emojione-1F5FE{background-position:87.5% 19.35484%}.emojione-1F5FF{background-position:87.5% 22.58065%}.emojione-1F600{background-position:87.5% 25.80645%}.emojione-1F601{background-position:87.5% 29.03226%}.emojione-1F602{background-position:87.5% 32.25806%}.emojione-1F603{background-position:87.5% 35.48387%}.emojione-1F604{background-position:87.5% 38.70968%}.emojione-1F605{background-position:87.5% 41.93548%}.emojione-1F606{background-position:87.5% 45.16129%}.emojione-1F607{background-position:87.5% 48.3871%}.emojione-1F608{background-position:87.5% 51.6129%}.emojione-1F609{background-position:87.5% 54.83871%}.emojione-1F60A{background-position:87.5% 58.06452%}.emojione-1F60B{background-position:87.5% 61.29032%}.emojione-1F60C{background-position:87.5% 64.51613%}.emojione-1F60D{background-position:87.5% 67.74194%}.emojione-1F60E{background-position:87.5% 70.96774%}.emojione-1F60F{background-position:87.5% 74.19355%}.emojione-1F610{background-position:87.5% 77.41935%}.emojione-1F611{background-position:87.5% 80.64516%}.emojione-1F612{background-position:87.5% 83.87097%}.emojione-1F613{background-position:87.5% 87.09677%}.emojione-1F614{background-position:0% 90.32258%}.emojione-1F615{background-position:3.125% 90.32258%}.emojione-1F616{background-position:6.25% 90.32258%}.emojione-1F617{background-position:9.375% 90.32258%}.emojione-1F618{background-position:12.5% 90.32258%}.emojione-1F619{background-position:15.625% 90.32258%}.emojione-1F61A{background-position:18.75% 90.32258%}.emojione-1F61B{background-position:21.875% 90.32258%}.emojione-1F61C{background-position:25% 90.32258%}.emojione-1F61D{background-position:28.125% 90.32258%}.emojione-1F61E{background-position:31.25% 90.32258%}.emojione-1F61F{background-position:34.375% 90.32258%}.emojione-1F620{background-position:37.5% 90.32258%}.emojione-1F621{background-position:40.625% 90.32258%}.emojione-1F622{background-position:43.75% 90.32258%}.emojione-1F623{background-position:46.875% 90.32258%}.emojione-1F624{background-position:50% 90.32258%}.emojione-1F625{background-position:53.125% 90.32258%}.emojione-1F626{background-position:56.25% 90.32258%}.emojione-1F627{background-position:59.375% 90.32258%}.emojione-1F628{background-position:62.5% 90.32258%}.emojione-1F629{background-position:65.625% 90.32258%}.emojione-1F62A{background-position:68.75% 90.32258%}.emojione-1F62B{background-position:71.875% 90.32258%}.emojione-1F62C{background-position:75% 90.32258%}.emojione-1F62D{background-position:78.125% 90.32258%}.emojione-1F62E{background-position:81.25% 90.32258%}.emojione-1F62F{background-position:84.375% 90.32258%}.emojione-1F630{background-position:87.5% 90.32258%}.emojione-1F631{background-position:90.625% 0%}.emojione-1F632{background-position:90.625% 3.22581%}.emojione-1F633{background-position:90.625% 6.45161%}.emojione-1F634{background-position:90.625% 9.67742%}.emojione-1F635{background-position:90.625% 12.90323%}.emojione-1F636{background-position:90.625% 16.12903%}.emojione-1F637{background-position:90.625% 19.35484%}.emojione-1F638{background-position:90.625% 22.58065%}.emojione-1F639{background-position:90.625% 25.80645%}.emojione-1F63A{background-position:90.625% 29.03226%}.emojione-1F63B{background-position:90.625% 32.25806%}.emojione-1F63C{background-position:90.625% 35.48387%}.emojione-1F63D{background-position:90.625% 38.70968%}.emojione-1F63E{background-position:90.625% 41.93548%}.emojione-1F63F{background-position:90.625% 45.16129%}.emojione-1F640{background-position:90.625% 48.3871%}.emojione-1F645{background-position:90.625% 51.6129%}.emojione-1F646{background-position:90.625% 54.83871%}.emojione-1F647{background-position:90.625% 58.06452%}.emojione-1F648{background-position:90.625% 61.29032%}.emojione-1F649{background-position:90.625% 64.51613%}.emojione-1F64A{background-position:90.625% 67.74194%}.emojione-1F64B{background-position:90.625% 70.96774%}.emojione-1F64C{background-position:90.625% 74.19355%}.emojione-1F64D{background-position:90.625% 77.41935%}.emojione-1F64E{background-position:90.625% 80.64516%}.emojione-1F64F{background-position:90.625% 83.87097%}.emojione-1F680{background-position:90.625% 87.09677%}.emojione-1F681{background-position:90.625% 90.32258%}.emojione-1F682{background-position:0% 93.54839%}.emojione-1F683{background-position:3.125% 93.54839%}.emojione-1F684{background-position:6.25% 93.54839%}.emojione-1F685{background-position:9.375% 93.54839%}.emojione-1F686{background-position:12.5% 93.54839%}.emojione-1F687{background-position:15.625% 93.54839%}.emojione-1F688{background-position:18.75% 93.54839%}.emojione-1F689{background-position:21.875% 93.54839%}.emojione-1F68A{background-position:25% 93.54839%}.emojione-1F68B{background-position:28.125% 93.54839%}.emojione-1F68C{background-position:31.25% 93.54839%}.emojione-1F68D{background-position:34.375% 93.54839%}.emojione-1F68E{background-position:37.5% 93.54839%}.emojione-1F68F{background-position:40.625% 93.54839%}.emojione-1F690{background-position:43.75% 93.54839%}.emojione-1F691{background-position:46.875% 93.54839%}.emojione-1F692{background-position:50% 93.54839%}.emojione-1F693{background-position:53.125% 93.54839%}.emojione-1F694{background-position:56.25% 93.54839%}.emojione-1F695{background-position:59.375% 93.54839%}.emojione-1F696{background-position:62.5% 93.54839%}.emojione-1F697{background-position:65.625% 93.54839%}.emojione-1F698{background-position:68.75% 93.54839%}.emojione-1F699{background-position:71.875% 93.54839%}.emojione-1F69A{background-position:75% 93.54839%}.emojione-1F69B{background-position:78.125% 93.54839%}.emojione-1F69C{background-position:81.25% 93.54839%}.emojione-1F69D{background-position:84.375% 93.54839%}.emojione-1F69E{background-position:87.5% 93.54839%}.emojione-1F69F{background-position:90.625% 93.54839%}.emojione-1F6A0{background-position:93.75% 0%}.emojione-1F6A1{background-position:93.75% 3.22581%}.emojione-1F6A2{background-position:93.75% 6.45161%}.emojione-1F6A3{background-position:93.75% 9.67742%}.emojione-1F6A4{background-position:93.75% 12.90323%}.emojione-1F6A5{background-position:93.75% 16.12903%}.emojione-1F6A6{background-position:93.75% 19.35484%}.emojione-1F6A7{background-position:93.75% 22.58065%}.emojione-1F6A8{background-position:93.75% 25.80645%}.emojione-1F6A9{background-position:93.75% 29.03226%}.emojione-1F6AA{background-position:93.75% 32.25806%}.emojione-1F6AB{background-position:93.75% 35.48387%}.emojione-1F6AC{background-position:93.75% 38.70968%}.emojione-1F6AD{background-position:93.75% 41.93548%}.emojione-1F6AE{background-position:93.75% 45.16129%}.emojione-1F6AF{background-position:93.75% 48.3871%}.emojione-1F6B0{background-position:93.75% 51.6129%}.emojione-1F6B1{background-position:93.75% 54.83871%}.emojione-1F6B2{background-position:93.75% 58.06452%}.emojione-1F6B3{background-position:93.75% 61.29032%}.emojione-1F6B4{background-position:93.75% 64.51613%}.emojione-1F6B5{background-position:93.75% 67.74194%}.emojione-1F6B6{background-position:93.75% 70.96774%}.emojione-1F6B7{background-position:93.75% 74.19355%}.emojione-1F6B8{background-position:93.75% 77.41935%}.emojione-1F6B9{background-position:93.75% 80.64516%}.emojione-1F6BA{background-position:93.75% 83.87097%}.emojione-1F6BB{background-position:93.75% 87.09677%}.emojione-1F6BC{background-position:93.75% 90.32258%}.emojione-1F6BD{background-position:93.75% 93.54839%}.emojione-1F6BE{background-position:0% 96.77419%}.emojione-1F6BF{background-position:3.125% 96.77419%}.emojione-1F6C0{background-position:6.25% 96.77419%}.emojione-1F6C1{background-position:9.375% 96.77419%}.emojione-1F6C2{background-position:12.5% 96.77419%}.emojione-1F6C3{background-position:15.625% 96.77419%}.emojione-1F6C4{background-position:18.75% 96.77419%}.emojione-1F6C5{background-position:21.875% 96.77419%}.emojione-203C{background-position:25% 96.77419%}.emojione-2049{background-position:28.125% 96.77419%}.emojione-2122{background-position:31.25% 96.77419%}.emojione-2139{background-position:34.375% 96.77419%}.emojione-2194{background-position:37.5% 96.77419%}.emojione-2195{background-position:40.625% 96.77419%}.emojione-2196{background-position:43.75% 96.77419%}.emojione-2197{background-position:46.875% 96.77419%}.emojione-2198{background-position:50% 96.77419%}.emojione-2199{background-position:53.125% 96.77419%}.emojione-21A9{background-position:56.25% 96.77419%}.emojione-21AA{background-position:59.375% 96.77419%}.emojione-231A{background-position:62.5% 96.77419%}.emojione-231B{background-position:65.625% 96.77419%}.emojione-23E9{background-position:68.75% 96.77419%}.emojione-23EA{background-position:71.875% 96.77419%}.emojione-23EB{background-position:75% 96.77419%}.emojione-23EC{background-position:78.125% 96.77419%}.emojione-23F0{background-position:81.25% 96.77419%}.emojione-23F3{background-position:84.375% 96.77419%}.emojione-24C2{background-position:87.5% 96.77419%}.emojione-25AA{background-position:90.625% 96.77419%}.emojione-25AB{background-position:93.75% 96.77419%}.emojione-25B6{background-position:96.875% 0%}.emojione-25C0{background-position:96.875% 3.22581%}.emojione-25FB{background-position:96.875% 6.45161%}.emojione-25FC{background-position:96.875% 9.67742%}.emojione-25FD{background-position:96.875% 12.90323%}.emojione-25FE{background-position:96.875% 16.12903%}.emojione-2600{background-position:96.875% 19.35484%}.emojione-2601{background-position:96.875% 22.58065%}.emojione-260E{background-position:96.875% 25.80645%}.emojione-2611{background-position:96.875% 29.03226%}.emojione-2614{background-position:96.875% 32.25806%}.emojione-2615{background-position:96.875% 35.48387%}.emojione-261D{background-position:96.875% 38.70968%}.emojione-263A{background-position:96.875% 41.93548%}.emojione-2648{background-position:96.875% 45.16129%}.emojione-2649{background-position:96.875% 48.3871%}.emojione-264A{background-position:96.875% 51.6129%}.emojione-264B{background-position:96.875% 54.83871%}.emojione-264C{background-position:96.875% 58.06452%}.emojione-264D{background-position:96.875% 61.29032%}.emojione-264E{background-position:96.875% 64.51613%}.emojione-264F{background-position:96.875% 67.74194%}.emojione-2650{background-position:96.875% 70.96774%}.emojione-2651{background-position:96.875% 74.19355%}.emojione-2652{background-position:96.875% 77.41935%}.emojione-2653{background-position:96.875% 80.64516%}.emojione-2660{background-position:96.875% 83.87097%}.emojione-2663{background-position:96.875% 87.09677%}.emojione-2665{background-position:96.875% 90.32258%}.emojione-2666{background-position:96.875% 93.54839%}.emojione-2668{background-position:96.875% 96.77419%}.emojione-267B{background-position:0% 100%}.emojione-267F{background-position:3.125% 100%}.emojione-2693{background-position:6.25% 100%}.emojione-26A0{background-position:9.375% 100%}.emojione-26A1{background-position:12.5% 100%}.emojione-26AA{background-position:15.625% 100%}.emojione-26AB{background-position:18.75% 100%}.emojione-26BD{background-position:21.875% 100%}.emojione-26BE{background-position:25% 100%}.emojione-26C4{background-position:28.125% 100%}.emojione-26C5{background-position:31.25% 100%}.emojione-26CE{background-position:34.375% 100%}.emojione-26D4{background-position:37.5% 100%}.emojione-26EA{background-position:40.625% 100%}.emojione-26F2{background-position:43.75% 100%}.emojione-26F3{background-position:46.875% 100%}.emojione-26F5{background-position:50% 100%}.emojione-26FA{background-position:53.125% 100%}.emojione-26FD{background-position:56.25% 100%}.emojione-2702{background-position:59.375% 100%}.emojione-2705{background-position:62.5% 100%}.emojione-2708{background-position:65.625% 100%}.emojione-2709{background-position:68.75% 100%}.emojione-270A{background-position:71.875% 100%}.emojione-270B{background-position:75% 100%}.emojione-270C{background-position:78.125% 100%}.emojione-270F{background-position:81.25% 100%}.emojione-2712{background-position:84.375% 100%}.emojione-2714{background-position:87.5% 100%}.emojione-2716{background-position:90.625% 100%}.emojione-2728{background-position:93.75% 100%}.emojione-2733{background-position:96.875% 100%}.emojione-2734{background-position:100% 0%}.emojione-2744{background-position:100% 3.22581%}.emojione-2747{background-position:100% 6.45161%}.emojione-274C{background-position:100% 9.67742%}.emojione-274E{background-position:100% 12.90323%}.emojione-2753{background-position:100% 16.12903%}.emojione-2754{background-position:100% 19.35484%}.emojione-2755{background-position:100% 22.58065%}.emojione-2757{background-position:100% 25.80645%}.emojione-2764{background-position:100% 29.03226%}.emojione-2795{background-position:100% 32.25806%}.emojione-2796{background-position:100% 35.48387%}.emojione-2797{background-position:100% 38.70968%}.emojione-27A1{background-position:100% 41.93548%}.emojione-27B0{background-position:100% 45.16129%}.emojione-27BF{background-position:100% 48.3871%}.emojione-2934{background-position:100% 51.6129%}.emojione-2935{background-position:100% 54.83871%}.emojione-2B05{background-position:100% 58.06452%}.emojione-2B06{background-position:100% 61.29032%}.emojione-2B07{background-position:100% 64.51613%}.emojione-2B1B{background-position:100% 67.74194%}.emojione-2B1C{background-position:100% 70.96774%}.emojione-2B50{background-position:100% 74.19355%}.emojione-2B55{background-position:100% 77.41935%}.emojione-3030{background-position:100% 80.64516%}.emojione-303D{background-position:100% 83.87097%}.emojione-3297{background-position:100% 87.09677%}.emojione-3299{background-position:100% 90.32258%} - - -/* AutoComplete styles for Emoji One */ -.dropdown-menu { - list-style: none; - padding: .3em 0 0; - margin: 0; - border: 1px solid #6E6E6E; - background-color: white; - border-radius: 5px; - overflow: hidden; - font-size: inherit; - letter-spacing: .025em; - box-shadow: 3px 3px 3px rgba(0,0,0,.2); -} -.dropdown-menu a:hover { - cursor: pointer; -} -.dropdown-menu li { - letter-spacing: 0; - display: block; - float: none; - margin: 0; - padding: 0; - border:none; -} -.dropdown-menu li:before { - display: none; -} -.dropdown-menu .textcomplete-footer { - margin-top: .3em; - background: #e6e6e6; -} -.dropdown-menu .textcomplete-footer a { - color: #999999; - text-decoration: none; - text-transform: uppercase; - letter-spacing: .05em; - line-height: 2.1818em; - padding-left: 1.8181em; - font-size: .84em; -} -.dropdown-menu .textcomplete-footer .arrow { - margin-left: .8em; - font-size: 1.3em; -} -.dropdown-menu li .emojione { - vertical-align: middle; - font-size: 1.23em; - width: 1em; - height: 1em; - top: -1px; - margin: 0 .3em 0 0; -} -.dropdown-menu li a { - display: block; - height: 100%; - line-height: 1.8em; - padding: 0 1.54em 0 .615em; - color: #4f4f4f; -} -.dropdown-menu .active, -.dropdown-menu li:hover { - background: #6E6E6E; - color: white; -} -.dropdown-menu .active a, -.dropdown-menu li:hover a { - color: inherit; -} diff --git a/pagure/static/emoji/emojione.sprites.png b/pagure/static/emoji/emojione.sprites.png deleted file mode 120000 index cc9e491..0000000 --- a/pagure/static/emoji/emojione.sprites.png +++ /dev/null @@ -1 +0,0 @@ -emojione.sprites-1.3.1.png \ No newline at end of file diff --git a/pagure/static/emoji/jquery.textcomplete-1.7.1.js b/pagure/static/emoji/jquery.textcomplete-1.7.1.js deleted file mode 100644 index 87463c4..0000000 --- a/pagure/static/emoji/jquery.textcomplete-1.7.1.js +++ /dev/null @@ -1,1482 +0,0 @@ -(function (factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['jquery'], factory); - } else if (typeof module === "object" && module.exports) { - var $ = require('jquery'); - module.exports = factory($); - } else { - // Browser globals - factory(jQuery); - } -}(function (jQuery) { - -/*! - * jQuery.textcomplete - * - * Repository: https://github.com/yuku-t/jquery-textcomplete - * License: MIT (https://github.com/yuku-t/jquery-textcomplete/blob/master/LICENSE) - * Author: Yuku Takahashi - */ - -if (typeof jQuery === 'undefined') { - throw new Error('jQuery.textcomplete requires jQuery'); -} - -+function ($) { - 'use strict'; - - var warn = function (message) { - if (console.warn) { console.warn(message); } - }; - - var id = 1; - - $.fn.textcomplete = function (strategies, option) { - var args = Array.prototype.slice.call(arguments); - return this.each(function () { - var self = this; - var $this = $(this); - var completer = $this.data('textComplete'); - if (!completer) { - option || (option = {}); - option._oid = id++; // unique object id - completer = new $.fn.textcomplete.Completer(this, option); - $this.data('textComplete', completer); - } - if (typeof strategies === 'string') { - if (!completer) return; - args.shift() - completer[strategies].apply(completer, args); - if (strategies === 'destroy') { - $this.removeData('textComplete'); - } - } else { - // For backward compatibility. - // TODO: Remove at v0.4 - $.each(strategies, function (obj) { - $.each(['header', 'footer', 'placement', 'maxCount'], function (name) { - if (obj[name]) { - completer.option[name] = obj[name]; - warn(name + 'as a strategy param is deprecated. Use option.'); - delete obj[name]; - } - }); - }); - completer.register($.fn.textcomplete.Strategy.parse(strategies, { - el: self, - $el: $this - })); - } - }); - }; - -}(jQuery); - -+function ($) { - 'use strict'; - - // Exclusive execution control utility. - // - // func - The function to be locked. It is executed with a function named - // `free` as the first argument. Once it is called, additional - // execution are ignored until the free is invoked. Then the last - // ignored execution will be replayed immediately. - // - // Examples - // - // var lockedFunc = lock(function (free) { - // setTimeout(function { free(); }, 1000); // It will be free in 1 sec. - // console.log('Hello, world'); - // }); - // lockedFunc(); // => 'Hello, world' - // lockedFunc(); // none - // lockedFunc(); // none - // // 1 sec past then - // // => 'Hello, world' - // lockedFunc(); // => 'Hello, world' - // lockedFunc(); // none - // - // Returns a wrapped function. - var lock = function (func) { - var locked, queuedArgsToReplay; - - return function () { - // Convert arguments into a real array. - var args = Array.prototype.slice.call(arguments); - if (locked) { - // Keep a copy of this argument list to replay later. - // OK to overwrite a previous value because we only replay - // the last one. - queuedArgsToReplay = args; - return; - } - locked = true; - var self = this; - args.unshift(function replayOrFree() { - if (queuedArgsToReplay) { - // Other request(s) arrived while we were locked. - // Now that the lock is becoming available, replay - // the latest such request, then call back here to - // unlock (or replay another request that arrived - // while this one was in flight). - var replayArgs = queuedArgsToReplay; - queuedArgsToReplay = undefined; - replayArgs.unshift(replayOrFree); - func.apply(self, replayArgs); - } else { - locked = false; - } - }); - func.apply(this, args); - }; - }; - - var isString = function (obj) { - return Object.prototype.toString.call(obj) === '[object String]'; - }; - - var uniqueId = 0; - - function Completer(element, option) { - this.$el = $(element); - this.id = 'textcomplete' + uniqueId++; - this.strategies = []; - this.views = []; - this.option = $.extend({}, Completer.defaults, option); - - if (!this.$el.is('input[type=text]') && !this.$el.is('input[type=search]') && !this.$el.is('textarea') && !element.isContentEditable && element.contentEditable != 'true') { - throw new Error('textcomplete must be called on a Textarea or a ContentEditable.'); - } - - // use ownerDocument to fix iframe / IE issues - if (element === element.ownerDocument.activeElement) { - // element has already been focused. Initialize view objects immediately. - this.initialize() - } else { - // Initialize view objects lazily. - var self = this; - this.$el.one('focus.' + this.id, function () { self.initialize(); }); - - // Special handling for CKEditor: lazy init on instance load - if ((!this.option.adapter || this.option.adapter == 'CKEditor') && typeof CKEDITOR != 'undefined' && (this.$el.is('textarea'))) { - CKEDITOR.on("instanceReady", function(event) { - event.editor.once("focus", function(event2) { - // replace the element with the Iframe element and flag it as CKEditor - self.$el = $(event.editor.editable().$); - if (!self.option.adapter) { - self.option.adapter = $.fn.textcomplete['CKEditor']; - } - self.initialize(); - }); - }); - } - } - } - - Completer.defaults = { - appendTo: 'body', - className: '', // deprecated option - dropdownClassName: 'dropdown-menu textcomplete-dropdown', - maxCount: 10, - zIndex: '100', - rightEdgeOffset: 30 - }; - - $.extend(Completer.prototype, { - // Public properties - // ----------------- - - id: null, - option: null, - strategies: null, - adapter: null, - dropdown: null, - $el: null, - $iframe: null, - - // Public methods - // -------------- - - initialize: function () { - var element = this.$el.get(0); - - // check if we are in an iframe - // we need to alter positioning logic if using an iframe - if (this.$el.prop('ownerDocument') !== document && window.frames.length) { - for (var iframeIndex = 0; iframeIndex < window.frames.length; iframeIndex++) { - if (this.$el.prop('ownerDocument') === window.frames[iframeIndex].document) { - this.$iframe = $(window.frames[iframeIndex].frameElement); - break; - } - } - } - - - // Initialize view objects. - this.dropdown = new $.fn.textcomplete.Dropdown(element, this, this.option); - var Adapter, viewName; - if (this.option.adapter) { - Adapter = this.option.adapter; - } else { - if (this.$el.is('textarea') || this.$el.is('input[type=text]') || this.$el.is('input[type=search]')) { - viewName = typeof element.selectionEnd === 'number' ? 'Textarea' : 'IETextarea'; - } else { - viewName = 'ContentEditable'; - } - Adapter = $.fn.textcomplete[viewName]; - } - this.adapter = new Adapter(element, this, this.option); - }, - - destroy: function () { - this.$el.off('.' + this.id); - if (this.adapter) { - this.adapter.destroy(); - } - if (this.dropdown) { - this.dropdown.destroy(); - } - this.$el = this.adapter = this.dropdown = null; - }, - - deactivate: function () { - if (this.dropdown) { - this.dropdown.deactivate(); - } - }, - - // Invoke textcomplete. - trigger: function (text, skipUnchangedTerm) { - if (!this.dropdown) { this.initialize(); } - text != null || (text = this.adapter.getTextFromHeadToCaret()); - var searchQuery = this._extractSearchQuery(text); - if (searchQuery.length) { - var term = searchQuery[1]; - // Ignore shift-key, ctrl-key and so on. - if (skipUnchangedTerm && this._term === term && term !== "") { return; } - this._term = term; - this._search.apply(this, searchQuery); - } else { - this._term = null; - this.dropdown.deactivate(); - } - }, - - fire: function (eventName) { - var args = Array.prototype.slice.call(arguments, 1); - this.$el.trigger(eventName, args); - return this; - }, - - register: function (strategies) { - Array.prototype.push.apply(this.strategies, strategies); - }, - - // Insert the value into adapter view. It is called when the dropdown is clicked - // or selected. - // - // value - The selected element of the array callbacked from search func. - // strategy - The Strategy object. - // e - Click or keydown event object. - select: function (value, strategy, e) { - this._term = null; - this.adapter.select(value, strategy, e); - this.fire('change').fire('textComplete:select', value, strategy); - this.adapter.focus(); - }, - - // Private properties - // ------------------ - - _clearAtNext: true, - _term: null, - - // Private methods - // --------------- - - // Parse the given text and extract the first matching strategy. - // - // Returns an array including the strategy, the query term and the match - // object if the text matches an strategy; otherwise returns an empty array. - _extractSearchQuery: function (text) { - for (var i = 0; i < this.strategies.length; i++) { - var strategy = this.strategies[i]; - var context = strategy.context(text); - if (context || context === '') { - var matchRegexp = $.isFunction(strategy.match) ? strategy.match(text) : strategy.match; - if (isString(context)) { text = context; } - var match = text.match(matchRegexp); - if (match) { return [strategy, match[strategy.index], match]; } - } - } - return [] - }, - - // Call the search method of selected strategy.. - _search: lock(function (free, strategy, term, match) { - var self = this; - strategy.search(term, function (data, stillSearching) { - if (!self.dropdown.shown) { - self.dropdown.activate(); - } - if (self._clearAtNext) { - // The first callback in the current lock. - self.dropdown.clear(); - self._clearAtNext = false; - } - self.dropdown.setPosition(self.adapter.getCaretPosition()); - self.dropdown.render(self._zip(data, strategy, term)); - if (!stillSearching) { - // The last callback in the current lock. - free(); - self._clearAtNext = true; // Call dropdown.clear at the next time. - } - }, match); - }), - - // Build a parameter for Dropdown#render. - // - // Examples - // - // this._zip(['a', 'b'], 's'); - // //=> [{ value: 'a', strategy: 's' }, { value: 'b', strategy: 's' }] - _zip: function (data, strategy, term) { - return $.map(data, function (value) { - return { value: value, strategy: strategy, term: term }; - }); - } - }); - - $.fn.textcomplete.Completer = Completer; -}(jQuery); - -+function ($) { - 'use strict'; - - var $window = $(window); - - var include = function (zippedData, datum) { - var i, elem; - var idProperty = datum.strategy.idProperty - for (i = 0; i < zippedData.length; i++) { - elem = zippedData[i]; - if (elem.strategy !== datum.strategy) continue; - if (idProperty) { - if (elem.value[idProperty] === datum.value[idProperty]) return true; - } else { - if (elem.value === datum.value) return true; - } - } - return false; - }; - - var dropdownViews = {}; - $(document).on('click', function (e) { - var id = e.originalEvent && e.originalEvent.keepTextCompleteDropdown; - $.each(dropdownViews, function (key, view) { - if (key !== id) { view.deactivate(); } - }); - }); - - var commands = { - SKIP_DEFAULT: 0, - KEY_UP: 1, - KEY_DOWN: 2, - KEY_ENTER: 3, - KEY_PAGEUP: 4, - KEY_PAGEDOWN: 5, - KEY_ESCAPE: 6 - }; - - // Dropdown view - // ============= - - // Construct Dropdown object. - // - // element - Textarea or contenteditable element. - function Dropdown(element, completer, option) { - this.$el = Dropdown.createElement(option); - this.completer = completer; - this.id = completer.id + 'dropdown'; - this._data = []; // zipped data. - this.$inputEl = $(element); - this.option = option; - - // Override setPosition method. - if (option.listPosition) { this.setPosition = option.listPosition; } - if (option.height) { this.$el.height(option.height); } - var self = this; - $.each(['maxCount', 'placement', 'footer', 'header', 'noResultsMessage', 'className'], function (_i, name) { - if (option[name] != null) { self[name] = option[name]; } - }); - this._bindEvents(element); - dropdownViews[this.id] = this; - } - - $.extend(Dropdown, { - // Class methods - // ------------- - - createElement: function (option) { - var $parent = option.appendTo; - if (!($parent instanceof $)) { $parent = $($parent); } - var $el = $('
        ') - .addClass(option.dropdownClassName) - .attr('id', 'textcomplete-dropdown-' + option._oid) - .css({ - display: 'none', - left: 0, - position: 'absolute', - zIndex: option.zIndex - }) - .appendTo($parent); - return $el; - } - }); - - $.extend(Dropdown.prototype, { - // Public properties - // ----------------- - - $el: null, // jQuery object of ul.dropdown-menu element. - $inputEl: null, // jQuery object of target textarea. - completer: null, - footer: null, - header: null, - id: null, - maxCount: null, - placement: '', - shown: false, - data: [], // Shown zipped data. - className: '', - - // Public methods - // -------------- - - destroy: function () { - // Don't remove $el because it may be shared by several textcompletes. - this.deactivate(); - - this.$el.off('.' + this.id); - this.$inputEl.off('.' + this.id); - this.clear(); - this.$el.remove(); - this.$el = this.$inputEl = this.completer = null; - delete dropdownViews[this.id] - }, - - render: function (zippedData) { - var contentsHtml = this._buildContents(zippedData); - var unzippedData = $.map(this.data, function (d) { return d.value; }); - if (this.data.length) { - var strategy = zippedData[0].strategy; - if (strategy.id) { - this.$el.attr('data-strategy', strategy.id); - } else { - this.$el.removeAttr('data-strategy'); - } - this._renderHeader(unzippedData); - this._renderFooter(unzippedData); - if (contentsHtml) { - this._renderContents(contentsHtml); - this._fitToBottom(); - this._fitToRight(); - this._activateIndexedItem(); - } - this._setScroll(); - } else if (this.noResultsMessage) { - this._renderNoResultsMessage(unzippedData); - } else if (this.shown) { - this.deactivate(); - } - }, - - setPosition: function (pos) { - // Make the dropdown fixed if the input is also fixed - // This can't be done during init, as textcomplete may be used on multiple elements on the same page - // Because the same dropdown is reused behind the scenes, we need to recheck every time the dropdown is showed - var position = 'absolute'; - // Check if input or one of its parents has positioning we need to care about - this.$inputEl.add(this.$inputEl.parents()).each(function() { - if($(this).css('position') === 'absolute') // The element has absolute positioning, so it's all OK - return false; - if($(this).css('position') === 'fixed') { - pos.top -= $window.scrollTop(); - pos.left -= $window.scrollLeft(); - position = 'fixed'; - return false; - } - }); - this.$el.css(this._applyPlacement(pos)); - this.$el.css({ position: position }); // Update positioning - - return this; - }, - - clear: function () { - this.$el.html(''); - this.data = []; - this._index = 0; - this._$header = this._$footer = this._$noResultsMessage = null; - }, - - activate: function () { - if (!this.shown) { - this.clear(); - this.$el.show(); - if (this.className) { this.$el.addClass(this.className); } - this.completer.fire('textComplete:show'); - this.shown = true; - } - return this; - }, - - deactivate: function () { - if (this.shown) { - this.$el.hide(); - if (this.className) { this.$el.removeClass(this.className); } - this.completer.fire('textComplete:hide'); - this.shown = false; - } - return this; - }, - - isUp: function (e) { - return e.keyCode === 38 || (e.ctrlKey && e.keyCode === 80); // UP, Ctrl-P - }, - - isDown: function (e) { - return e.keyCode === 40 || (e.ctrlKey && e.keyCode === 78); // DOWN, Ctrl-N - }, - - isEnter: function (e) { - var modifiers = e.ctrlKey || e.altKey || e.metaKey || e.shiftKey; - return !modifiers && (e.keyCode === 13 || e.keyCode === 9 || (this.option.completeOnSpace === true && e.keyCode === 32)) // ENTER, TAB - }, - - isPageup: function (e) { - return e.keyCode === 33; // PAGEUP - }, - - isPagedown: function (e) { - return e.keyCode === 34; // PAGEDOWN - }, - - isEscape: function (e) { - return e.keyCode === 27; // ESCAPE - }, - - // Private properties - // ------------------ - - _data: null, // Currently shown zipped data. - _index: null, - _$header: null, - _$noResultsMessage: null, - _$footer: null, - - // Private methods - // --------------- - - _bindEvents: function () { - this.$el.on('mousedown.' + this.id, '.textcomplete-item', $.proxy(this._onClick, this)); - this.$el.on('touchstart.' + this.id, '.textcomplete-item', $.proxy(this._onClick, this)); - this.$el.on('mouseover.' + this.id, '.textcomplete-item', $.proxy(this._onMouseover, this)); - this.$inputEl.on('keydown.' + this.id, $.proxy(this._onKeydown, this)); - }, - - _onClick: function (e) { - var $el = $(e.target); - e.preventDefault(); - e.originalEvent.keepTextCompleteDropdown = this.id; - if (!$el.hasClass('textcomplete-item')) { - $el = $el.closest('.textcomplete-item'); - } - var datum = this.data[parseInt($el.data('index'), 10)]; - this.completer.select(datum.value, datum.strategy, e); - var self = this; - // Deactive at next tick to allow other event handlers to know whether - // the dropdown has been shown or not. - setTimeout(function () { - self.deactivate(); - if (e.type === 'touchstart') { - self.$inputEl.focus(); - } - }, 0); - }, - - // Activate hovered item. - _onMouseover: function (e) { - var $el = $(e.target); - e.preventDefault(); - if (!$el.hasClass('textcomplete-item')) { - $el = $el.closest('.textcomplete-item'); - } - this._index = parseInt($el.data('index'), 10); - this._activateIndexedItem(); - }, - - _onKeydown: function (e) { - if (!this.shown) { return; } - - var command; - - if ($.isFunction(this.option.onKeydown)) { - command = this.option.onKeydown(e, commands); - } - - if (command == null) { - command = this._defaultKeydown(e); - } - - switch (command) { - case commands.KEY_UP: - e.preventDefault(); - this._up(); - break; - case commands.KEY_DOWN: - e.preventDefault(); - this._down(); - break; - case commands.KEY_ENTER: - e.preventDefault(); - this._enter(e); - break; - case commands.KEY_PAGEUP: - e.preventDefault(); - this._pageup(); - break; - case commands.KEY_PAGEDOWN: - e.preventDefault(); - this._pagedown(); - break; - case commands.KEY_ESCAPE: - e.preventDefault(); - this.deactivate(); - break; - } - }, - - _defaultKeydown: function (e) { - if (this.isUp(e)) { - return commands.KEY_UP; - } else if (this.isDown(e)) { - return commands.KEY_DOWN; - } else if (this.isEnter(e)) { - return commands.KEY_ENTER; - } else if (this.isPageup(e)) { - return commands.KEY_PAGEUP; - } else if (this.isPagedown(e)) { - return commands.KEY_PAGEDOWN; - } else if (this.isEscape(e)) { - return commands.KEY_ESCAPE; - } - }, - - _up: function () { - if (this._index === 0) { - this._index = this.data.length - 1; - } else { - this._index -= 1; - } - this._activateIndexedItem(); - this._setScroll(); - }, - - _down: function () { - if (this._index === this.data.length - 1) { - this._index = 0; - } else { - this._index += 1; - } - this._activateIndexedItem(); - this._setScroll(); - }, - - _enter: function (e) { - var datum = this.data[parseInt(this._getActiveElement().data('index'), 10)]; - this.completer.select(datum.value, datum.strategy, e); - this.deactivate(); - }, - - _pageup: function () { - var target = 0; - var threshold = this._getActiveElement().position().top - this.$el.innerHeight(); - this.$el.children().each(function (i) { - if ($(this).position().top + $(this).outerHeight() > threshold) { - target = i; - return false; - } - }); - this._index = target; - this._activateIndexedItem(); - this._setScroll(); - }, - - _pagedown: function () { - var target = this.data.length - 1; - var threshold = this._getActiveElement().position().top + this.$el.innerHeight(); - this.$el.children().each(function (i) { - if ($(this).position().top > threshold) { - target = i; - return false - } - }); - this._index = target; - this._activateIndexedItem(); - this._setScroll(); - }, - - _activateIndexedItem: function () { - this.$el.find('.textcomplete-item.active').removeClass('active'); - this._getActiveElement().addClass('active'); - }, - - _getActiveElement: function () { - return this.$el.children('.textcomplete-item:nth(' + this._index + ')'); - }, - - _setScroll: function () { - var $activeEl = this._getActiveElement(); - var itemTop = $activeEl.position().top; - var itemHeight = $activeEl.outerHeight(); - var visibleHeight = this.$el.innerHeight(); - var visibleTop = this.$el.scrollTop(); - if (this._index === 0 || this._index == this.data.length - 1 || itemTop < 0) { - this.$el.scrollTop(itemTop + visibleTop); - } else if (itemTop + itemHeight > visibleHeight) { - this.$el.scrollTop(itemTop + itemHeight + visibleTop - visibleHeight); - } - }, - - _buildContents: function (zippedData) { - var datum, i, index; - var html = ''; - for (i = 0; i < zippedData.length; i++) { - if (this.data.length === this.maxCount) break; - datum = zippedData[i]; - if (include(this.data, datum)) { continue; } - index = this.data.length; - this.data.push(datum); - html += '
      • '; - html += datum.strategy.template(datum.value, datum.term); - html += '
      • '; - } - return html; - }, - - _renderHeader: function (unzippedData) { - if (this.header) { - if (!this._$header) { - this._$header = $('
      • ').prependTo(this.$el); - } - var html = $.isFunction(this.header) ? this.header(unzippedData) : this.header; - this._$header.html(html); - } - }, - - _renderFooter: function (unzippedData) { - if (this.footer) { - if (!this._$footer) { - this._$footer = $('').appendTo(this.$el); - } - var html = $.isFunction(this.footer) ? this.footer(unzippedData) : this.footer; - this._$footer.html(html); - } - }, - - _renderNoResultsMessage: function (unzippedData) { - if (this.noResultsMessage) { - if (!this._$noResultsMessage) { - this._$noResultsMessage = $('
      • ').appendTo(this.$el); - } - var html = $.isFunction(this.noResultsMessage) ? this.noResultsMessage(unzippedData) : this.noResultsMessage; - this._$noResultsMessage.html(html); - } - }, - - _renderContents: function (html) { - if (this._$footer) { - this._$footer.before(html); - } else { - this.$el.append(html); - } - }, - - _fitToBottom: function() { - var windowScrollBottom = $window.scrollTop() + $window.height(); - var height = this.$el.height(); - if ((this.$el.position().top + height) > windowScrollBottom) { - // only do this if we are not in an iframe - if (!this.completer.$iframe) { - this.$el.offset({top: windowScrollBottom - height}); - } - } - }, - - _fitToRight: function() { - // We don't know how wide our content is until the browser positions us, and at that point it clips us - // to the document width so we don't know if we would have overrun it. As a heuristic to avoid that clipping - // (which makes our elements wrap onto the next line and corrupt the next item), if we're close to the right - // edge, move left. We don't know how far to move left, so just keep nudging a bit. - var tolerance = this.option.rightEdgeOffset; // pixels. Make wider than vertical scrollbar because we might not be able to use that space. - var lastOffset = this.$el.offset().left, offset; - var width = this.$el.width(); - var maxLeft = $window.width() - tolerance; - while (lastOffset + width > maxLeft) { - this.$el.offset({left: lastOffset - tolerance}); - offset = this.$el.offset().left; - if (offset >= lastOffset) { break; } - lastOffset = offset; - } - }, - - _applyPlacement: function (position) { - // If the 'placement' option set to 'top', move the position above the element. - if (this.placement.indexOf('top') !== -1) { - // Overwrite the position object to set the 'bottom' property instead of the top. - position = { - top: 'auto', - bottom: this.$el.parent().height() - position.top + position.lineHeight, - left: position.left - }; - } else { - position.bottom = 'auto'; - delete position.lineHeight; - } - if (this.placement.indexOf('absleft') !== -1) { - position.left = 0; - } else if (this.placement.indexOf('absright') !== -1) { - position.right = 0; - position.left = 'auto'; - } - return position; - } - }); - - $.fn.textcomplete.Dropdown = Dropdown; - $.extend($.fn.textcomplete, commands); -}(jQuery); - -+function ($) { - 'use strict'; - - // Memoize a search function. - var memoize = function (func) { - var memo = {}; - return function (term, callback) { - if (memo[term]) { - callback(memo[term]); - } else { - func.call(this, term, function (data) { - memo[term] = (memo[term] || []).concat(data); - callback.apply(null, arguments); - }); - } - }; - }; - - function Strategy(options) { - $.extend(this, options); - if (this.cache) { this.search = memoize(this.search); } - } - - Strategy.parse = function (strategiesArray, params) { - return $.map(strategiesArray, function (strategy) { - var strategyObj = new Strategy(strategy); - strategyObj.el = params.el; - strategyObj.$el = params.$el; - return strategyObj; - }); - }; - - $.extend(Strategy.prototype, { - // Public properties - // ----------------- - - // Required - match: null, - replace: null, - search: null, - - // Optional - id: null, - cache: false, - context: function () { return true; }, - index: 2, - template: function (obj) { return obj; }, - idProperty: null - }); - - $.fn.textcomplete.Strategy = Strategy; - -}(jQuery); - -+function ($) { - 'use strict'; - - var now = Date.now || function () { return new Date().getTime(); }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // `wait` msec. - // - // This utility function was originally implemented at Underscore.js. - var debounce = function (func, wait) { - var timeout, args, context, timestamp, result; - var later = function () { - var last = now() - timestamp; - if (last < wait) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - result = func.apply(context, args); - context = args = null; - } - }; - - return function () { - context = this; - args = arguments; - timestamp = now(); - if (!timeout) { - timeout = setTimeout(later, wait); - } - return result; - }; - }; - - function Adapter () {} - - $.extend(Adapter.prototype, { - // Public properties - // ----------------- - - id: null, // Identity. - completer: null, // Completer object which creates it. - el: null, // Textarea element. - $el: null, // jQuery object of the textarea. - option: null, - - // Public methods - // -------------- - - initialize: function (element, completer, option) { - this.el = element; - this.$el = $(element); - this.id = completer.id + this.constructor.name; - this.completer = completer; - this.option = option; - - if (this.option.debounce) { - this._onKeyup = debounce(this._onKeyup, this.option.debounce); - } - - this._bindEvents(); - }, - - destroy: function () { - this.$el.off('.' + this.id); // Remove all event handlers. - this.$el = this.el = this.completer = null; - }, - - // Update the element with the given value and strategy. - // - // value - The selected object. It is one of the item of the array - // which was callbacked from the search function. - // strategy - The Strategy associated with the selected value. - select: function (/* value, strategy */) { - throw new Error('Not implemented'); - }, - - // Returns the caret's relative coordinates from body's left top corner. - getCaretPosition: function () { - var position = this._getCaretRelativePosition(); - var offset = this.$el.offset(); - - // Calculate the left top corner of `this.option.appendTo` element. - var $parent = this.option.appendTo; - if ($parent) { - if (!($parent instanceof $)) { $parent = $($parent); } - var parentOffset = $parent.offsetParent().offset(); - offset.top -= parentOffset.top; - offset.left -= parentOffset.left; - } - - position.top += offset.top; - position.left += offset.left; - return position; - }, - - // Focus on the element. - focus: function () { - this.$el.focus(); - }, - - // Private methods - // --------------- - - _bindEvents: function () { - this.$el.on('keyup.' + this.id, $.proxy(this._onKeyup, this)); - }, - - _onKeyup: function (e) { - if (this._skipSearch(e)) { return; } - this.completer.trigger(this.getTextFromHeadToCaret(), true); - }, - - // Suppress searching if it returns true. - _skipSearch: function (clickEvent) { - switch (clickEvent.keyCode) { - case 9: // TAB - case 13: // ENTER - case 40: // DOWN - case 38: // UP - case 27: // ESC - return true; - } - if (clickEvent.ctrlKey) switch (clickEvent.keyCode) { - case 78: // Ctrl-N - case 80: // Ctrl-P - return true; - } - } - }); - - $.fn.textcomplete.Adapter = Adapter; -}(jQuery); - -+function ($) { - 'use strict'; - - // Textarea adapter - // ================ - // - // Managing a textarea. It doesn't know a Dropdown. - function Textarea(element, completer, option) { - this.initialize(element, completer, option); - } - - $.extend(Textarea.prototype, $.fn.textcomplete.Adapter.prototype, { - // Public methods - // -------------- - - // Update the textarea with the given value and strategy. - select: function (value, strategy, e) { - var pre = this.getTextFromHeadToCaret(); - var post = this.el.value.substring(this.el.selectionEnd); - var newSubstr = strategy.replace(value, e); - var regExp; - if (typeof newSubstr !== 'undefined') { - if ($.isArray(newSubstr)) { - post = newSubstr[1] + post; - newSubstr = newSubstr[0]; - } - regExp = $.isFunction(strategy.match) ? strategy.match(pre) : strategy.match; - pre = pre.replace(regExp, newSubstr); - this.$el.val(pre + post); - this.el.selectionStart = this.el.selectionEnd = pre.length; - } - }, - - getTextFromHeadToCaret: function () { - return this.el.value.substring(0, this.el.selectionEnd); - }, - - // Private methods - // --------------- - - _getCaretRelativePosition: function () { - var p = $.fn.textcomplete.getCaretCoordinates(this.el, this.el.selectionStart); - return { - top: p.top + this._calculateLineHeight() - this.$el.scrollTop(), - left: p.left - this.$el.scrollLeft(), - lineHeight: this._calculateLineHeight() - }; - }, - - _calculateLineHeight: function () { - var lineHeight = parseInt(this.$el.css('line-height'), 10); - if (isNaN(lineHeight)) { - // http://stackoverflow.com/a/4515470/1297336 - var parentNode = this.el.parentNode; - var temp = document.createElement(this.el.nodeName); - var style = this.el.style; - temp.setAttribute( - 'style', - 'margin:0px;padding:0px;font-family:' + style.fontFamily + ';font-size:' + style.fontSize - ); - temp.innerHTML = 'test'; - parentNode.appendChild(temp); - lineHeight = temp.clientHeight; - parentNode.removeChild(temp); - } - return lineHeight; - } - }); - - $.fn.textcomplete.Textarea = Textarea; -}(jQuery); - -+function ($) { - 'use strict'; - - var sentinelChar = '吶'; - - function IETextarea(element, completer, option) { - this.initialize(element, completer, option); - $('' + sentinelChar + '').css({ - position: 'absolute', - top: -9999, - left: -9999 - }).insertBefore(element); - } - - $.extend(IETextarea.prototype, $.fn.textcomplete.Textarea.prototype, { - // Public methods - // -------------- - - select: function (value, strategy, e) { - var pre = this.getTextFromHeadToCaret(); - var post = this.el.value.substring(pre.length); - var newSubstr = strategy.replace(value, e); - var regExp; - if (typeof newSubstr !== 'undefined') { - if ($.isArray(newSubstr)) { - post = newSubstr[1] + post; - newSubstr = newSubstr[0]; - } - regExp = $.isFunction(strategy.match) ? strategy.match(pre) : strategy.match; - pre = pre.replace(regExp, newSubstr); - this.$el.val(pre + post); - this.el.focus(); - var range = this.el.createTextRange(); - range.collapse(true); - range.moveEnd('character', pre.length); - range.moveStart('character', pre.length); - range.select(); - } - }, - - getTextFromHeadToCaret: function () { - this.el.focus(); - var range = document.selection.createRange(); - range.moveStart('character', -this.el.value.length); - var arr = range.text.split(sentinelChar) - return arr.length === 1 ? arr[0] : arr[1]; - } - }); - - $.fn.textcomplete.IETextarea = IETextarea; -}(jQuery); - -// NOTE: TextComplete plugin has contenteditable support but it does not work -// fine especially on old IEs. -// Any pull requests are REALLY welcome. - -+function ($) { - 'use strict'; - - // ContentEditable adapter - // ======================= - // - // Adapter for contenteditable elements. - function ContentEditable (element, completer, option) { - this.initialize(element, completer, option); - } - - $.extend(ContentEditable.prototype, $.fn.textcomplete.Adapter.prototype, { - // Public methods - // -------------- - - // Update the content with the given value and strategy. - // When an dropdown item is selected, it is executed. - select: function (value, strategy, e) { - var pre = this.getTextFromHeadToCaret(); - // use ownerDocument instead of window to support iframes - var sel = this.el.ownerDocument.getSelection(); - - var range = sel.getRangeAt(0); - var selection = range.cloneRange(); - selection.selectNodeContents(range.startContainer); - var content = selection.toString(); - var post = content.substring(range.startOffset); - var newSubstr = strategy.replace(value, e); - var regExp; - if (typeof newSubstr !== 'undefined') { - if ($.isArray(newSubstr)) { - post = newSubstr[1] + post; - newSubstr = newSubstr[0]; - } - regExp = $.isFunction(strategy.match) ? strategy.match(pre) : strategy.match; - pre = pre.replace(regExp, newSubstr) - .replace(/ $/, " "); //   necessary at least for CKeditor to not eat spaces - range.selectNodeContents(range.startContainer); - range.deleteContents(); - - // create temporary elements - var preWrapper = this.el.ownerDocument.createElement("div"); - preWrapper.innerHTML = pre; - var postWrapper = this.el.ownerDocument.createElement("div"); - postWrapper.innerHTML = post; - - // create the fragment thats inserted - var fragment = this.el.ownerDocument.createDocumentFragment(); - var childNode; - var lastOfPre; - while (childNode = preWrapper.firstChild) { - lastOfPre = fragment.appendChild(childNode); - } - while (childNode = postWrapper.firstChild) { - fragment.appendChild(childNode); - } - - // insert the fragment & jump behind the last node in "pre" - range.insertNode(fragment); - range.setStartAfter(lastOfPre); - - range.collapse(true); - sel.removeAllRanges(); - sel.addRange(range); - } - }, - - // Private methods - // --------------- - - // Returns the caret's relative position from the contenteditable's - // left top corner. - // - // Examples - // - // this._getCaretRelativePosition() - // //=> { top: 18, left: 200, lineHeight: 16 } - // - // Dropdown's position will be decided using the result. - _getCaretRelativePosition: function () { - var range = this.el.ownerDocument.getSelection().getRangeAt(0).cloneRange(); - var node = this.el.ownerDocument.createElement('span'); - range.insertNode(node); - range.selectNodeContents(node); - range.deleteContents(); - var $node = $(node); - var position = $node.offset(); - position.left -= this.$el.offset().left; - position.top += $node.height() - this.$el.offset().top; - position.lineHeight = $node.height(); - - // special positioning logic for iframes - // this is typically used for contenteditables such as tinymce or ckeditor - if (this.completer.$iframe) { - var iframePosition = this.completer.$iframe.offset(); - position.top += iframePosition.top; - position.left += iframePosition.left; - //subtract scrollTop from element in iframe - position.top -= this.$el.scrollTop(); - } - - $node.remove(); - return position; - }, - - // Returns the string between the first character and the caret. - // Completer will be triggered with the result for start autocompleting. - // - // Example - // - // // Suppose the html is 'hello wor|ld' and | is the caret. - // this.getTextFromHeadToCaret() - // // => ' wor' // not 'hello wor' - getTextFromHeadToCaret: function () { - var range = this.el.ownerDocument.getSelection().getRangeAt(0); - var selection = range.cloneRange(); - selection.selectNodeContents(range.startContainer); - return selection.toString().substring(0, range.startOffset); - } - }); - - $.fn.textcomplete.ContentEditable = ContentEditable; -}(jQuery); - -// NOTE: TextComplete plugin has contenteditable support but it does not work -// fine especially on old IEs. -// Any pull requests are REALLY welcome. - -+function ($) { - 'use strict'; - - // CKEditor adapter - // ======================= - // - // Adapter for CKEditor, based on contenteditable elements. - function CKEditor (element, completer, option) { - this.initialize(element, completer, option); - } - - $.extend(CKEditor.prototype, $.fn.textcomplete.ContentEditable.prototype, { - _bindEvents: function () { - var $this = this; - CKEDITOR.instances["issue_notes"].on('key', function(event) { - var domEvent = event.data; - $this._onKeyup(domEvent); - if ($this.completer.dropdown.shown && $this._skipSearch(domEvent)) { - return false; - } - }, null, null, 1); // 1 = Priority = Important! - // we actually also need the native event, as the CKEditor one is happening to late - this.$el.on('keyup.' + this.id, $.proxy(this._onKeyup, this)); - }, -}); - - $.fn.textcomplete.CKEditor = CKEditor; -}(jQuery); - -// The MIT License (MIT) -// -// Copyright (c) 2015 Jonathan Ong me@jongleberry.com -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -// associated documentation files (the "Software"), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, publish, distribute, -// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// https://github.com/component/textarea-caret-position - -(function ($) { - -// The properties that we copy into a mirrored div. -// Note that some browsers, such as Firefox, -// do not concatenate properties, i.e. padding-top, bottom etc. -> padding, -// so we have to do every single property specifically. -var properties = [ - 'direction', // RTL support - 'boxSizing', - 'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does - 'height', - 'overflowX', - 'overflowY', // copy the scrollbar for IE - - 'borderTopWidth', - 'borderRightWidth', - 'borderBottomWidth', - 'borderLeftWidth', - 'borderStyle', - - 'paddingTop', - 'paddingRight', - 'paddingBottom', - 'paddingLeft', - - // https://developer.mozilla.org/en-US/docs/Web/CSS/font - 'fontStyle', - 'fontVariant', - 'fontWeight', - 'fontStretch', - 'fontSize', - 'fontSizeAdjust', - 'lineHeight', - 'fontFamily', - - 'textAlign', - 'textTransform', - 'textIndent', - 'textDecoration', // might not make a difference, but better be safe - - 'letterSpacing', - 'wordSpacing', - - 'tabSize', - 'MozTabSize' - -]; - -var isBrowser = (typeof window !== 'undefined'); -var isFirefox = (isBrowser && window.mozInnerScreenX != null); - -function getCaretCoordinates(element, position, options) { - if(!isBrowser) { - throw new Error('textarea-caret-position#getCaretCoordinates should only be called in a browser'); - } - - var debug = options && options.debug || false; - if (debug) { - var el = document.querySelector('#input-textarea-caret-position-mirror-div'); - if ( el ) { el.parentNode.removeChild(el); } - } - - // mirrored div - var div = document.createElement('div'); - div.id = 'input-textarea-caret-position-mirror-div'; - document.body.appendChild(div); - - var style = div.style; - var computed = window.getComputedStyle? getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9 - - // default textarea styles - style.whiteSpace = 'pre-wrap'; - if (element.nodeName !== 'INPUT') - style.wordWrap = 'break-word'; // only for textarea-s - - // position off-screen - style.position = 'absolute'; // required to return coordinates properly - if (!debug) - style.visibility = 'hidden'; // not 'display: none' because we want rendering - - // transfer the element's properties to the div - properties.forEach(function (prop) { - style[prop] = computed[prop]; - }); - - if (isFirefox) { - // Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275 - if (element.scrollHeight > parseInt(computed.height)) - style.overflowY = 'scroll'; - } else { - style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll' - } - - div.textContent = element.value.substring(0, position); - // the second special handling for input type="text" vs textarea: spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037 - if (element.nodeName === 'INPUT') - div.textContent = div.textContent.replace(/\s/g, '\u00a0'); - - var span = document.createElement('span'); - // Wrapping must be replicated *exactly*, including when a long word gets - // onto the next line, with whitespace at the end of the line before (#7). - // The *only* reliable way to do that is to copy the *entire* rest of the - // textarea's content into the created at the caret position. - // for inputs, just '.' would be enough, but why bother? - span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all - div.appendChild(span); - - var coordinates = { - top: span.offsetTop + parseInt(computed['borderTopWidth']), - left: span.offsetLeft + parseInt(computed['borderLeftWidth']) - }; - - if (debug) { - span.style.backgroundColor = '#aaa'; - } else { - document.body.removeChild(div); - } - - return coordinates; -} - -$.fn.textcomplete.getCaretCoordinates = getCaretCoordinates; - -}(jQuery)); - -return jQuery; -})); diff --git a/pagure/static/emoji/jquery.textcomplete-1.7.1.min.js b/pagure/static/emoji/jquery.textcomplete-1.7.1.min.js deleted file mode 100644 index 32f6414..0000000 --- a/pagure/static/emoji/jquery.textcomplete-1.7.1.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! jquery-textcomplete - v1.7.1 - 2016-08-29 */ -!function(a){if("function"==typeof define&&define.amd)define(["jquery"],a);else if("object"==typeof module&&module.exports){var b=require("jquery");module.exports=a(b)}else a(jQuery)}(function(a){if("undefined"==typeof a)throw new Error("jQuery.textcomplete requires jQuery");return+function(a){"use strict";var b=function(a){console.warn&&console.warn(a)},c=1;a.fn.textcomplete=function(d,e){var f=Array.prototype.slice.call(arguments);return this.each(function(){var g=this,h=a(this),i=h.data("textComplete");if(i||(e||(e={}),e._oid=c++,i=new a.fn.textcomplete.Completer(this,e),h.data("textComplete",i)),"string"==typeof d){if(!i)return;f.shift(),i[d].apply(i,f),"destroy"===d&&h.removeData("textComplete")}else a.each(d,function(c){a.each(["header","footer","placement","maxCount"],function(a){c[a]&&(i.option[a]=c[a],b(a+"as a strategy param is deprecated. Use option."),delete c[a])})}),i.register(a.fn.textcomplete.Strategy.parse(d,{el:g,$el:h}))})}}(a),+function(a){"use strict";function b(c,d){if(this.$el=a(c),this.id="textcomplete"+e++,this.strategies=[],this.views=[],this.option=a.extend({},b.defaults,d),!(this.$el.is("input[type=text]")||this.$el.is("input[type=search]")||this.$el.is("textarea")||c.isContentEditable||"true"==c.contentEditable))throw new Error("textcomplete must be called on a Textarea or a ContentEditable.");if(c===c.ownerDocument.activeElement)this.initialize();else{var f=this;this.$el.one("focus."+this.id,function(){f.initialize()}),this.option.adapter&&"CKEditor"!=this.option.adapter||"undefined"==typeof CKEDITOR||!this.$el.is("textarea")||CKEDITOR.on("instanceReady",function(b){b.editor.once("focus",function(c){f.$el=a(b.editor.editable().$),f.option.adapter||(f.option.adapter=a.fn.textcomplete.CKEditor),f.initialize()})})}}var c=function(a){var b,c;return function(){var d=Array.prototype.slice.call(arguments);if(b)return void(c=d);b=!0;var e=this;d.unshift(function f(){if(c){var d=c;c=void 0,d.unshift(f),a.apply(e,d)}else b=!1}),a.apply(this,d)}},d=function(a){return"[object String]"===Object.prototype.toString.call(a)},e=0;b.defaults={appendTo:"body",className:"",dropdownClassName:"dropdown-menu textcomplete-dropdown",maxCount:10,zIndex:"100",rightEdgeOffset:30},a.extend(b.prototype,{id:null,option:null,strategies:null,adapter:null,dropdown:null,$el:null,$iframe:null,initialize:function(){var b=this.$el.get(0);if(this.$el.prop("ownerDocument")!==document&&window.frames.length)for(var c=0;c").addClass(b.dropdownClassName).attr("id","textcomplete-dropdown-"+b._oid).css({display:"none",left:0,position:"absolute",zIndex:b.zIndex}).appendTo(c);return d}}),a.extend(b.prototype,{$el:null,$inputEl:null,completer:null,footer:null,header:null,id:null,maxCount:null,placement:"",shown:!1,data:[],className:"",destroy:function(){this.deactivate(),this.$el.off("."+this.id),this.$inputEl.off("."+this.id),this.clear(),this.$el.remove(),this.$el=this.$inputEl=this.completer=null,delete e[this.id]},render:function(b){var c=this._buildContents(b),d=a.map(this.data,function(a){return a.value});if(this.data.length){var e=b[0].strategy;e.id?this.$el.attr("data-strategy",e.id):this.$el.removeAttr("data-strategy"),this._renderHeader(d),this._renderFooter(d),c&&(this._renderContents(c),this._fitToBottom(),this._fitToRight(),this._activateIndexedItem()),this._setScroll()}else this.noResultsMessage?this._renderNoResultsMessage(d):this.shown&&this.deactivate()},setPosition:function(b){var d="absolute";return this.$inputEl.add(this.$inputEl.parents()).each(function(){return"absolute"===a(this).css("position")?!1:"fixed"===a(this).css("position")?(b.top-=c.scrollTop(),b.left-=c.scrollLeft(),d="fixed",!1):void 0}),this.$el.css(this._applyPlacement(b)),this.$el.css({position:d}),this},clear:function(){this.$el.html(""),this.data=[],this._index=0,this._$header=this._$footer=this._$noResultsMessage=null},activate:function(){return this.shown||(this.clear(),this.$el.show(),this.className&&this.$el.addClass(this.className),this.completer.fire("textComplete:show"),this.shown=!0),this},deactivate:function(){return this.shown&&(this.$el.hide(),this.className&&this.$el.removeClass(this.className),this.completer.fire("textComplete:hide"),this.shown=!1),this},isUp:function(a){return 38===a.keyCode||a.ctrlKey&&80===a.keyCode},isDown:function(a){return 40===a.keyCode||a.ctrlKey&&78===a.keyCode},isEnter:function(a){var b=a.ctrlKey||a.altKey||a.metaKey||a.shiftKey;return!b&&(13===a.keyCode||9===a.keyCode||this.option.completeOnSpace===!0&&32===a.keyCode)},isPageup:function(a){return 33===a.keyCode},isPagedown:function(a){return 34===a.keyCode},isEscape:function(a){return 27===a.keyCode},_data:null,_index:null,_$header:null,_$noResultsMessage:null,_$footer:null,_bindEvents:function(){this.$el.on("mousedown."+this.id,".textcomplete-item",a.proxy(this._onClick,this)),this.$el.on("touchstart."+this.id,".textcomplete-item",a.proxy(this._onClick,this)),this.$el.on("mouseover."+this.id,".textcomplete-item",a.proxy(this._onMouseover,this)),this.$inputEl.on("keydown."+this.id,a.proxy(this._onKeydown,this))},_onClick:function(b){var c=a(b.target);b.preventDefault(),b.originalEvent.keepTextCompleteDropdown=this.id,c.hasClass("textcomplete-item")||(c=c.closest(".textcomplete-item"));var d=this.data[parseInt(c.data("index"),10)];this.completer.select(d.value,d.strategy,b);var e=this;setTimeout(function(){e.deactivate(),"touchstart"===b.type&&e.$inputEl.focus()},0)},_onMouseover:function(b){var c=a(b.target);b.preventDefault(),c.hasClass("textcomplete-item")||(c=c.closest(".textcomplete-item")),this._index=parseInt(c.data("index"),10),this._activateIndexedItem()},_onKeydown:function(b){if(this.shown){var c;switch(a.isFunction(this.option.onKeydown)&&(c=this.option.onKeydown(b,f)),null==c&&(c=this._defaultKeydown(b)),c){case f.KEY_UP:b.preventDefault(),this._up();break;case f.KEY_DOWN:b.preventDefault(),this._down();break;case f.KEY_ENTER:b.preventDefault(),this._enter(b);break;case f.KEY_PAGEUP:b.preventDefault(),this._pageup();break;case f.KEY_PAGEDOWN:b.preventDefault(),this._pagedown();break;case f.KEY_ESCAPE:b.preventDefault(),this.deactivate()}}},_defaultKeydown:function(a){return this.isUp(a)?f.KEY_UP:this.isDown(a)?f.KEY_DOWN:this.isEnter(a)?f.KEY_ENTER:this.isPageup(a)?f.KEY_PAGEUP:this.isPagedown(a)?f.KEY_PAGEDOWN:this.isEscape(a)?f.KEY_ESCAPE:void 0},_up:function(){0===this._index?this._index=this.data.length-1:this._index-=1,this._activateIndexedItem(),this._setScroll()},_down:function(){this._index===this.data.length-1?this._index=0:this._index+=1,this._activateIndexedItem(),this._setScroll()},_enter:function(a){var b=this.data[parseInt(this._getActiveElement().data("index"),10)];this.completer.select(b.value,b.strategy,a),this.deactivate()},_pageup:function(){var b=0,c=this._getActiveElement().position().top-this.$el.innerHeight();this.$el.children().each(function(d){return a(this).position().top+a(this).outerHeight()>c?(b=d,!1):void 0}),this._index=b,this._activateIndexedItem(),this._setScroll()},_pagedown:function(){var b=this.data.length-1,c=this._getActiveElement().position().top+this.$el.innerHeight();this.$el.children().each(function(d){return a(this).position().top>c?(b=d,!1):void 0}),this._index=b,this._activateIndexedItem(),this._setScroll()},_activateIndexedItem:function(){this.$el.find(".textcomplete-item.active").removeClass("active"),this._getActiveElement().addClass("active")},_getActiveElement:function(){return this.$el.children(".textcomplete-item:nth("+this._index+")")},_setScroll:function(){var a=this._getActiveElement(),b=a.position().top,c=a.outerHeight(),d=this.$el.innerHeight(),e=this.$el.scrollTop();0===this._index||this._index==this.data.length-1||0>b?this.$el.scrollTop(b+e):b+c>d&&this.$el.scrollTop(b+c+e-d)},_buildContents:function(a){var b,c,e,f="";for(c=0;c',f+=b.strategy.template(b.value,b.term),f+="");return f},_renderHeader:function(b){if(this.header){this._$header||(this._$header=a('
      • ').prependTo(this.$el));var c=a.isFunction(this.header)?this.header(b):this.header;this._$header.html(c)}},_renderFooter:function(b){if(this.footer){this._$footer||(this._$footer=a('').appendTo(this.$el));var c=a.isFunction(this.footer)?this.footer(b):this.footer;this._$footer.html(c)}},_renderNoResultsMessage:function(b){if(this.noResultsMessage){this._$noResultsMessage||(this._$noResultsMessage=a('
      • ').appendTo(this.$el));var c=a.isFunction(this.noResultsMessage)?this.noResultsMessage(b):this.noResultsMessage;this._$noResultsMessage.html(c)}},_renderContents:function(a){this._$footer?this._$footer.before(a):this.$el.append(a)},_fitToBottom:function(){var a=c.scrollTop()+c.height(),b=this.$el.height();this.$el.position().top+b>a&&(this.completer.$iframe||this.$el.offset({top:a-b}))},_fitToRight:function(){for(var a,b=this.option.rightEdgeOffset,d=this.$el.offset().left,e=this.$el.width(),f=c.width()-b;d+e>f&&(this.$el.offset({left:d-b}),a=this.$el.offset().left,!(a>=d));)d=a},_applyPlacement:function(a){return-1!==this.placement.indexOf("top")?a={top:"auto",bottom:this.$el.parent().height()-a.top+a.lineHeight,left:a.left}:(a.bottom="auto",delete a.lineHeight),-1!==this.placement.indexOf("absleft")?a.left=0:-1!==this.placement.indexOf("absright")&&(a.right=0,a.left="auto"),a}}),a.fn.textcomplete.Dropdown=b,a.extend(a.fn.textcomplete,f)}(a),+function(a){"use strict";function b(b){a.extend(this,b),this.cache&&(this.search=c(this.search))}var c=function(a){var b={};return function(c,d){b[c]?d(b[c]):a.call(this,c,function(a){b[c]=(b[c]||[]).concat(a),d.apply(null,arguments)})}};b.parse=function(c,d){return a.map(c,function(a){var c=new b(a);return c.el=d.el,c.$el=d.$el,c})},a.extend(b.prototype,{match:null,replace:null,search:null,id:null,cache:!1,context:function(){return!0},index:2,template:function(a){return a},idProperty:null}),a.fn.textcomplete.Strategy=b}(a),+function(a){"use strict";function b(){}var c=Date.now||function(){return(new Date).getTime()},d=function(a,b){var d,e,f,g,h,i=function(){var j=c()-g;b>j?d=setTimeout(i,b-j):(d=null,h=a.apply(f,e),f=e=null)};return function(){return f=this,e=arguments,g=c(),d||(d=setTimeout(i,b)),h}};a.extend(b.prototype,{id:null,completer:null,el:null,$el:null,option:null,initialize:function(b,c,e){this.el=b,this.$el=a(b),this.id=c.id+this.constructor.name,this.completer=c,this.option=e,this.option.debounce&&(this._onKeyup=d(this._onKeyup,this.option.debounce)),this._bindEvents()},destroy:function(){this.$el.off("."+this.id),this.$el=this.el=this.completer=null},select:function(){throw new Error("Not implemented")},getCaretPosition:function(){var b=this._getCaretRelativePosition(),c=this.$el.offset(),d=this.option.appendTo;if(d){d instanceof a||(d=a(d));var e=d.offsetParent().offset();c.top-=e.top,c.left-=e.left}return b.top+=c.top,b.left+=c.left,b},focus:function(){this.$el.focus()},_bindEvents:function(){this.$el.on("keyup."+this.id,a.proxy(this._onKeyup,this))},_onKeyup:function(a){this._skipSearch(a)||this.completer.trigger(this.getTextFromHeadToCaret(),!0)},_skipSearch:function(a){switch(a.keyCode){case 9:case 13:case 40:case 38:case 27:return!0}if(a.ctrlKey)switch(a.keyCode){case 78:case 80:return!0}}}),a.fn.textcomplete.Adapter=b}(a),+function(a){"use strict";function b(a,b,c){this.initialize(a,b,c)}a.extend(b.prototype,a.fn.textcomplete.Adapter.prototype,{select:function(b,c,d){var e,f=this.getTextFromHeadToCaret(),g=this.el.value.substring(this.el.selectionEnd),h=c.replace(b,d);"undefined"!=typeof h&&(a.isArray(h)&&(g=h[1]+g,h=h[0]),e=a.isFunction(c.match)?c.match(f):c.match,f=f.replace(e,h),this.$el.val(f+g),this.el.selectionStart=this.el.selectionEnd=f.length)},getTextFromHeadToCaret:function(){return this.el.value.substring(0,this.el.selectionEnd)},_getCaretRelativePosition:function(){var b=a.fn.textcomplete.getCaretCoordinates(this.el,this.el.selectionStart);return{top:b.top+this._calculateLineHeight()-this.$el.scrollTop(),left:b.left-this.$el.scrollLeft(),lineHeight:this._calculateLineHeight()}},_calculateLineHeight:function(){var a=parseInt(this.$el.css("line-height"),10);if(isNaN(a)){var b=this.el.parentNode,c=document.createElement(this.el.nodeName),d=this.el.style;c.setAttribute("style","margin:0px;padding:0px;font-family:"+d.fontFamily+";font-size:"+d.fontSize),c.innerHTML="test",b.appendChild(c),a=c.clientHeight,b.removeChild(c)}return a}}),a.fn.textcomplete.Textarea=b}(a),+function(a){"use strict";function b(b,d,e){this.initialize(b,d,e),a(""+c+"").css({position:"absolute",top:-9999,left:-9999}).insertBefore(b)}var c="吶";a.extend(b.prototype,a.fn.textcomplete.Textarea.prototype,{select:function(b,c,d){var e,f=this.getTextFromHeadToCaret(),g=this.el.value.substring(f.length),h=c.replace(b,d);if("undefined"!=typeof h){a.isArray(h)&&(g=h[1]+g,h=h[0]),e=a.isFunction(c.match)?c.match(f):c.match,f=f.replace(e,h),this.$el.val(f+g),this.el.focus();var i=this.el.createTextRange();i.collapse(!0),i.moveEnd("character",f.length),i.moveStart("character",f.length),i.select()}},getTextFromHeadToCaret:function(){this.el.focus();var a=document.selection.createRange();a.moveStart("character",-this.el.value.length);var b=a.text.split(c);return 1===b.length?b[0]:b[1]}}),a.fn.textcomplete.IETextarea=b}(a),+function(a){"use strict";function b(a,b,c){this.initialize(a,b,c)}a.extend(b.prototype,a.fn.textcomplete.Adapter.prototype,{select:function(b,c,d){var e=this.getTextFromHeadToCaret(),f=this.el.ownerDocument.getSelection(),g=f.getRangeAt(0),h=g.cloneRange();h.selectNodeContents(g.startContainer);var i,j=h.toString(),k=j.substring(g.startOffset),l=c.replace(b,d);if("undefined"!=typeof l){a.isArray(l)&&(k=l[1]+k,l=l[0]),i=a.isFunction(c.match)?c.match(e):c.match,e=e.replace(i,l).replace(/ $/," "),g.selectNodeContents(g.startContainer),g.deleteContents();var m=this.el.ownerDocument.createElement("div");m.innerHTML=e;var n=this.el.ownerDocument.createElement("div");n.innerHTML=k;for(var o,p,q=this.el.ownerDocument.createDocumentFragment();o=m.firstChild;)p=q.appendChild(o);for(;o=n.firstChild;)q.appendChild(o);g.insertNode(q),g.setStartAfter(p),g.collapse(!0),f.removeAllRanges(),f.addRange(g)}},_getCaretRelativePosition:function(){var b=this.el.ownerDocument.getSelection().getRangeAt(0).cloneRange(),c=this.el.ownerDocument.createElement("span");b.insertNode(c),b.selectNodeContents(c),b.deleteContents();var d=a(c),e=d.offset();if(e.left-=this.$el.offset().left,e.top+=d.height()-this.$el.offset().top,e.lineHeight=d.height(),this.completer.$iframe){var f=this.completer.$iframe.offset();e.top+=f.top,e.left+=f.left,e.top-=this.$el.scrollTop()}return d.remove(),e},getTextFromHeadToCaret:function(){var a=this.el.ownerDocument.getSelection().getRangeAt(0),b=a.cloneRange();return b.selectNodeContents(a.startContainer),b.toString().substring(0,a.startOffset)}}),a.fn.textcomplete.ContentEditable=b}(a),+function(a){"use strict";function b(a,b,c){this.initialize(a,b,c)}a.extend(b.prototype,a.fn.textcomplete.ContentEditable.prototype,{_bindEvents:function(){var b=this;CKEDITOR.instances.issue_notes.on("key",function(a){var c=a.data;return b._onKeyup(c),b.completer.dropdown.shown&&b._skipSearch(c)?!1:void 0},null,null,1),this.$el.on("keyup."+this.id,a.proxy(this._onKeyup,this))}}),a.fn.textcomplete.CKEditor=b}(a),function(a){function b(a,b,f){if(!d)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var g=f&&f.debug||!1;if(g){var h=document.querySelector("#input-textarea-caret-position-mirror-div");h&&h.parentNode.removeChild(h)}var i=document.createElement("div");i.id="input-textarea-caret-position-mirror-div",document.body.appendChild(i);var j=i.style,k=window.getComputedStyle?getComputedStyle(a):a.currentStyle;j.whiteSpace="pre-wrap","INPUT"!==a.nodeName&&(j.wordWrap="break-word"),j.position="absolute",g||(j.visibility="hidden"),c.forEach(function(a){j[a]=k[a]}),e?a.scrollHeight>parseInt(k.height)&&(j.overflowY="scroll"):j.overflow="hidden",i.textContent=a.value.substring(0,b),"INPUT"===a.nodeName&&(i.textContent=i.textContent.replace(/\s/g," "));var l=document.createElement("span");l.textContent=a.value.substring(b)||".",i.appendChild(l);var m={top:l.offsetTop+parseInt(k.borderTopWidth),left:l.offsetLeft+parseInt(k.borderLeftWidth)};return g?l.style.backgroundColor="#aaa":document.body.removeChild(i),m}var c=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],d="undefined"!=typeof window,e=d&&null!=window.mozInnerScreenX;a.fn.textcomplete.getCaretCoordinates=b}(a),a}); -//# sourceMappingURL=dist/jquery.textcomplete.min.map \ No newline at end of file diff --git a/pagure/static/emoji/jquery.textcomplete.js b/pagure/static/emoji/jquery.textcomplete.js deleted file mode 120000 index a2bee68..0000000 --- a/pagure/static/emoji/jquery.textcomplete.js +++ /dev/null @@ -1 +0,0 @@ -jquery.textcomplete-1.7.1.js \ No newline at end of file diff --git a/pagure/static/emoji/jquery.textcomplete.min.js b/pagure/static/emoji/jquery.textcomplete.min.js deleted file mode 120000 index 8406123..0000000 --- a/pagure/static/emoji/jquery.textcomplete.min.js +++ /dev/null @@ -1 +0,0 @@ -jquery.textcomplete-1.7.1.min.js \ No newline at end of file diff --git a/pagure/static/hack_fonts/css/hack-extended-2.020.css b/pagure/static/hack_fonts/css/hack-extended-2.020.css deleted file mode 100644 index 0f98461..0000000 --- a/pagure/static/hack_fonts/css/hack-extended-2.020.css +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * Hack v2.020 - https://sourcefoundry.org/hack/ - * Licenses - Fonts: Hack Open Font License + Bitstream Vera license, CSS: MIT License - */ -/* FONT PATHS - * -------------------------- */ -@font-face { - font-family: 'Hack'; - src: url('../fonts/eot/hack-regular-webfont.eot?v=2.020'); - src: url('../fonts/eot/hack-regular-webfont.eot?#iefix&v=2.020') format('embedded-opentype'), url('../fonts/woff2/hack-regular-webfont.woff2?v=2.020') format('woff2'), url('../fonts/woff/hack-regular-webfont.woff?v=2.020') format('woff'), url('../fonts/web-ttf/hack-regular-webfont.ttf?v=2.020') format('truetype'); - font-weight: 400; - font-style: normal; -} - -@font-face { - font-family: 'Hack'; - src: url('../fonts/eot/hack-bold-webfont.eot?v=2.020'); - src: url('../fonts/eot/hack-bold-webfont.eot?#iefix&v=2.020') format('embedded-opentype'), url('../fonts/woff2/hack-bold-webfont.woff2?v=2.020') format('woff2'), url('../fonts/woff/hack-bold-webfont.woff?v=2.020') format('woff'), url('../fonts/web-ttf/hack-bold-webfont.ttf?v=2.020') format('truetype'); - font-weight: 700; - font-style: normal; -} - -@font-face { - font-family: 'Hack'; - src: url('../fonts/eot/hack-italic-webfont.eot?v=2.020'); - src: url('../fonts/eot/hack-italic-webfont.eot?#iefix&v=2.020') format('embedded-opentype'), url('../fonts/woff2/hack-italic-webfont.woff2?v=2.020') format('woff2'), url('../fonts/woff/hack-italic-webfont.woff?v=2.020') format('woff'), url('../fonts/web-ttf/hack-italic-webfont.ttf?v=2.020') format('truetype'); - font-weight: 400; - font-style: italic; -} - -@font-face { - font-family: 'Hack'; - src: url('../fonts/eot/hack-bolditalic-webfont.eot?v=2.020'); - src: url('../fonts/eot/hack-bolditalic-webfont.eot?#iefix&v=2.020') format('embedded-opentype'), url('../fonts/woff2/hack-bolditalic-webfont.woff2?v=2.020') format('woff2'), url('../fonts/woff/hack-bolditalic-webfont.woff?v=2.020') format('woff'), url('../fonts/web-ttf/hack-bolditalic-webfont.ttf?v=2.020') format('truetype'); - font-weight: 700; - font-style: italic; -} - diff --git a/pagure/static/hack_fonts/css/hack-extended-2.020.min.css b/pagure/static/hack_fonts/css/hack-extended-2.020.min.css deleted file mode 100644 index 11f9859..0000000 --- a/pagure/static/hack_fonts/css/hack-extended-2.020.min.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! - * Hack v2.020 - https://sourcefoundry.org/hack/ - * Licenses - Fonts: Hack Open Font License + Bitstream Vera license, CSS: MIT License - */@font-face{font-family:'Hack';src:url('../fonts/eot/hack-regular-webfont.eot?v=2.020');src:url('../fonts/eot/hack-regular-webfont.eot?#iefix&v=2.020') format('embedded-opentype'),url('../fonts/woff2/hack-regular-webfont.woff2?v=2.020') format('woff2'),url('../fonts/woff/hack-regular-webfont.woff?v=2.020') format('woff'),url('../fonts/web-ttf/hack-regular-webfont.ttf?v=2.020') format('truetype');font-weight:400;font-style:normal}@font-face{font-family:'Hack';src:url('../fonts/eot/hack-bold-webfont.eot?v=2.020');src:url('../fonts/eot/hack-bold-webfont.eot?#iefix&v=2.020') format('embedded-opentype'),url('../fonts/woff2/hack-bold-webfont.woff2?v=2.020') format('woff2'),url('../fonts/woff/hack-bold-webfont.woff?v=2.020') format('woff'),url('../fonts/web-ttf/hack-bold-webfont.ttf?v=2.020') format('truetype');font-weight:700;font-style:normal}@font-face{font-family:'Hack';src:url('../fonts/eot/hack-italic-webfont.eot?v=2.020');src:url('../fonts/eot/hack-italic-webfont.eot?#iefix&v=2.020') format('embedded-opentype'),url('../fonts/woff2/hack-italic-webfont.woff2?v=2.020') format('woff2'),url('../fonts/woff/hack-italic-webfont.woff?v=2.020') format('woff'),url('../fonts/web-ttf/hack-italic-webfont.ttf?v=2.020') format('truetype');font-weight:400;font-style:italic}@font-face{font-family:'Hack';src:url('../fonts/eot/hack-bolditalic-webfont.eot?v=2.020');src:url('../fonts/eot/hack-bolditalic-webfont.eot?#iefix&v=2.020') format('embedded-opentype'),url('../fonts/woff2/hack-bolditalic-webfont.woff2?v=2.020') format('woff2'),url('../fonts/woff/hack-bolditalic-webfont.woff?v=2.020') format('woff'),url('../fonts/web-ttf/hack-bolditalic-webfont.ttf?v=2.020') format('truetype');font-weight:700;font-style:italic} \ No newline at end of file diff --git a/pagure/static/hack_fonts/css/hack-extended.css b/pagure/static/hack_fonts/css/hack-extended.css deleted file mode 120000 index f08cb16..0000000 --- a/pagure/static/hack_fonts/css/hack-extended.css +++ /dev/null @@ -1 +0,0 @@ -hack-extended-2.020.css \ No newline at end of file diff --git a/pagure/static/hack_fonts/css/hack-extended.min.css b/pagure/static/hack_fonts/css/hack-extended.min.css deleted file mode 120000 index ceb0a59..0000000 --- a/pagure/static/hack_fonts/css/hack-extended.min.css +++ /dev/null @@ -1 +0,0 @@ -hack-extended-2.020.min.css \ No newline at end of file diff --git a/pagure/static/hack_fonts/fonts/eot/hack-bold-webfont.eot b/pagure/static/hack_fonts/fonts/eot/hack-bold-webfont.eot deleted file mode 100755 index a87e0ab..0000000 Binary files a/pagure/static/hack_fonts/fonts/eot/hack-bold-webfont.eot and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/eot/hack-bolditalic-webfont.eot b/pagure/static/hack_fonts/fonts/eot/hack-bolditalic-webfont.eot deleted file mode 100755 index c99503b..0000000 Binary files a/pagure/static/hack_fonts/fonts/eot/hack-bolditalic-webfont.eot and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/eot/hack-italic-webfont.eot b/pagure/static/hack_fonts/fonts/eot/hack-italic-webfont.eot deleted file mode 100755 index c64c219..0000000 Binary files a/pagure/static/hack_fonts/fonts/eot/hack-italic-webfont.eot and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/eot/hack-regular-webfont.eot b/pagure/static/hack_fonts/fonts/eot/hack-regular-webfont.eot deleted file mode 100755 index 00725f4..0000000 Binary files a/pagure/static/hack_fonts/fonts/eot/hack-regular-webfont.eot and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/eot/latin/hack-bold-latin-webfont.eot b/pagure/static/hack_fonts/fonts/eot/latin/hack-bold-latin-webfont.eot deleted file mode 100755 index 65ffecc..0000000 Binary files a/pagure/static/hack_fonts/fonts/eot/latin/hack-bold-latin-webfont.eot and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/eot/latin/hack-bolditalic-latin-webfont.eot b/pagure/static/hack_fonts/fonts/eot/latin/hack-bolditalic-latin-webfont.eot deleted file mode 100755 index 487526a..0000000 Binary files a/pagure/static/hack_fonts/fonts/eot/latin/hack-bolditalic-latin-webfont.eot and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/eot/latin/hack-italic-latin-webfont.eot b/pagure/static/hack_fonts/fonts/eot/latin/hack-italic-latin-webfont.eot deleted file mode 100755 index 22f0d06..0000000 Binary files a/pagure/static/hack_fonts/fonts/eot/latin/hack-italic-latin-webfont.eot and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/eot/latin/hack-regular-latin-webfont.eot b/pagure/static/hack_fonts/fonts/eot/latin/hack-regular-latin-webfont.eot deleted file mode 100755 index 7edc826..0000000 Binary files a/pagure/static/hack_fonts/fonts/eot/latin/hack-regular-latin-webfont.eot and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/svg/hack-bold-webfont.svg b/pagure/static/hack_fonts/fonts/svg/hack-bold-webfont.svg deleted file mode 100755 index 555785c..0000000 --- a/pagure/static/hack_fonts/fonts/svg/hack-bold-webfont.svg +++ /dev/null @@ -1,1645 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pagure/static/hack_fonts/fonts/svg/hack-bolditalic-webfont.svg b/pagure/static/hack_fonts/fonts/svg/hack-bolditalic-webfont.svg deleted file mode 100755 index c6f655a..0000000 --- a/pagure/static/hack_fonts/fonts/svg/hack-bolditalic-webfont.svg +++ /dev/null @@ -1,1591 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pagure/static/hack_fonts/fonts/svg/hack-italic-webfont.svg b/pagure/static/hack_fonts/fonts/svg/hack-italic-webfont.svg deleted file mode 100755 index 1544287..0000000 --- a/pagure/static/hack_fonts/fonts/svg/hack-italic-webfont.svg +++ /dev/null @@ -1,1588 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pagure/static/hack_fonts/fonts/svg/hack-regular-webfont.svg b/pagure/static/hack_fonts/fonts/svg/hack-regular-webfont.svg deleted file mode 100755 index 0c1d1dd..0000000 --- a/pagure/static/hack_fonts/fonts/svg/hack-regular-webfont.svg +++ /dev/null @@ -1,1570 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pagure/static/hack_fonts/fonts/svg/latin/hack-bold-latin-webfont.svg b/pagure/static/hack_fonts/fonts/svg/latin/hack-bold-latin-webfont.svg deleted file mode 100755 index 3c84205..0000000 --- a/pagure/static/hack_fonts/fonts/svg/latin/hack-bold-latin-webfont.svg +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pagure/static/hack_fonts/fonts/svg/latin/hack-bolditalic-latin-webfont.svg b/pagure/static/hack_fonts/fonts/svg/latin/hack-bolditalic-latin-webfont.svg deleted file mode 100755 index 4aa1f74..0000000 --- a/pagure/static/hack_fonts/fonts/svg/latin/hack-bolditalic-latin-webfont.svg +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pagure/static/hack_fonts/fonts/svg/latin/hack-italic-latin-webfont.svg b/pagure/static/hack_fonts/fonts/svg/latin/hack-italic-latin-webfont.svg deleted file mode 100755 index 8f31418..0000000 --- a/pagure/static/hack_fonts/fonts/svg/latin/hack-italic-latin-webfont.svg +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pagure/static/hack_fonts/fonts/svg/latin/hack-regular-latin-webfont.svg b/pagure/static/hack_fonts/fonts/svg/latin/hack-regular-latin-webfont.svg deleted file mode 100755 index 3a9a01b..0000000 --- a/pagure/static/hack_fonts/fonts/svg/latin/hack-regular-latin-webfont.svg +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pagure/static/hack_fonts/fonts/web-ttf/hack-bold-webfont.ttf b/pagure/static/hack_fonts/fonts/web-ttf/hack-bold-webfont.ttf deleted file mode 100755 index ecd9950..0000000 Binary files a/pagure/static/hack_fonts/fonts/web-ttf/hack-bold-webfont.ttf and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/web-ttf/hack-bolditalic-webfont.ttf b/pagure/static/hack_fonts/fonts/web-ttf/hack-bolditalic-webfont.ttf deleted file mode 100755 index c17383a..0000000 Binary files a/pagure/static/hack_fonts/fonts/web-ttf/hack-bolditalic-webfont.ttf and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/web-ttf/hack-italic-webfont.ttf b/pagure/static/hack_fonts/fonts/web-ttf/hack-italic-webfont.ttf deleted file mode 100755 index 1266f84..0000000 Binary files a/pagure/static/hack_fonts/fonts/web-ttf/hack-italic-webfont.ttf and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/web-ttf/hack-regular-webfont.ttf b/pagure/static/hack_fonts/fonts/web-ttf/hack-regular-webfont.ttf deleted file mode 100755 index 16c1a01..0000000 Binary files a/pagure/static/hack_fonts/fonts/web-ttf/hack-regular-webfont.ttf and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-bold-latin-webfont.ttf b/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-bold-latin-webfont.ttf deleted file mode 100755 index 16325d5..0000000 Binary files a/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-bold-latin-webfont.ttf and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-bolditalic-latin-webfont.ttf b/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-bolditalic-latin-webfont.ttf deleted file mode 100755 index b233262..0000000 Binary files a/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-bolditalic-latin-webfont.ttf and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-italic-latin-webfont.ttf b/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-italic-latin-webfont.ttf deleted file mode 100755 index 7878678..0000000 Binary files a/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-italic-latin-webfont.ttf and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-regular-latin-webfont.ttf b/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-regular-latin-webfont.ttf deleted file mode 100755 index 0566ead..0000000 Binary files a/pagure/static/hack_fonts/fonts/web-ttf/latin/hack-regular-latin-webfont.ttf and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff/hack-bold-webfont.woff b/pagure/static/hack_fonts/fonts/woff/hack-bold-webfont.woff deleted file mode 100755 index 0eee5ab..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff/hack-bold-webfont.woff and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff/hack-bolditalic-webfont.woff b/pagure/static/hack_fonts/fonts/woff/hack-bolditalic-webfont.woff deleted file mode 100755 index 486912c..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff/hack-bolditalic-webfont.woff and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff/hack-italic-webfont.woff b/pagure/static/hack_fonts/fonts/woff/hack-italic-webfont.woff deleted file mode 100755 index 6121166..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff/hack-italic-webfont.woff and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff/hack-regular-webfont.woff b/pagure/static/hack_fonts/fonts/woff/hack-regular-webfont.woff deleted file mode 100755 index 334f02e..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff/hack-regular-webfont.woff and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff/latin/hack-bold-latin-webfont.woff b/pagure/static/hack_fonts/fonts/woff/latin/hack-bold-latin-webfont.woff deleted file mode 100755 index 247cdeb..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff/latin/hack-bold-latin-webfont.woff and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff/latin/hack-bolditalic-latin-webfont.woff b/pagure/static/hack_fonts/fonts/woff/latin/hack-bolditalic-latin-webfont.woff deleted file mode 100755 index 08c1a0a..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff/latin/hack-bolditalic-latin-webfont.woff and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff/latin/hack-italic-latin-webfont.woff b/pagure/static/hack_fonts/fonts/woff/latin/hack-italic-latin-webfont.woff deleted file mode 100755 index c200b42..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff/latin/hack-italic-latin-webfont.woff and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff/latin/hack-regular-latin-webfont.woff b/pagure/static/hack_fonts/fonts/woff/latin/hack-regular-latin-webfont.woff deleted file mode 100755 index 9e20c8e..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff/latin/hack-regular-latin-webfont.woff and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff2/hack-bold-webfont.woff2 b/pagure/static/hack_fonts/fonts/woff2/hack-bold-webfont.woff2 deleted file mode 100755 index e581886..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff2/hack-bold-webfont.woff2 and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff2/hack-bolditalic-webfont.woff2 b/pagure/static/hack_fonts/fonts/woff2/hack-bolditalic-webfont.woff2 deleted file mode 100755 index 2cee731..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff2/hack-bolditalic-webfont.woff2 and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff2/hack-italic-webfont.woff2 b/pagure/static/hack_fonts/fonts/woff2/hack-italic-webfont.woff2 deleted file mode 100755 index 0aa5119..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff2/hack-italic-webfont.woff2 and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff2/hack-regular-webfont.woff2 b/pagure/static/hack_fonts/fonts/woff2/hack-regular-webfont.woff2 deleted file mode 100755 index 3889738..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff2/hack-regular-webfont.woff2 and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff2/latin/hack-bold-latin-webfont.woff2 b/pagure/static/hack_fonts/fonts/woff2/latin/hack-bold-latin-webfont.woff2 deleted file mode 100755 index 34e13e7..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff2/latin/hack-bold-latin-webfont.woff2 and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff2/latin/hack-bolditalic-latin-webfont.woff2 b/pagure/static/hack_fonts/fonts/woff2/latin/hack-bolditalic-latin-webfont.woff2 deleted file mode 100755 index 7c7d5a1..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff2/latin/hack-bolditalic-latin-webfont.woff2 and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff2/latin/hack-italic-latin-webfont.woff2 b/pagure/static/hack_fonts/fonts/woff2/latin/hack-italic-latin-webfont.woff2 deleted file mode 100755 index 6e96597..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff2/latin/hack-italic-latin-webfont.woff2 and /dev/null differ diff --git a/pagure/static/hack_fonts/fonts/woff2/latin/hack-regular-latin-webfont.woff2 b/pagure/static/hack_fonts/fonts/woff2/latin/hack-regular-latin-webfont.woff2 deleted file mode 100755 index f608ee1..0000000 Binary files a/pagure/static/hack_fonts/fonts/woff2/latin/hack-regular-latin-webfont.woff2 and /dev/null differ diff --git a/pagure/static/jdenticon-1.3.2.js b/pagure/static/jdenticon-1.3.2.js deleted file mode 100644 index c56ee80..0000000 --- a/pagure/static/jdenticon-1.3.2.js +++ /dev/null @@ -1,801 +0,0 @@ -/** - * Jdenticon 1.3.2 - * http://jdenticon.com - * - * Built: 2015-10-10T11:55:57.451Z - * - * Copyright (c) 2014-2015 Daniel Mester Pirttijärvi - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source distribution. - * - */ - -/*jslint bitwise: true */ - -(function (global, name, factory) { - var jQuery = global["jQuery"], - jdenticon = factory(global, jQuery); - - // Node.js - if (typeof module !== "undefined" && "exports" in module) { - module["exports"] = jdenticon; - } - // RequireJS - else if (typeof define === "function" && define["amd"]) { - define([], function () { return jdenticon; }); - } - // No module loader - else { - global[name] = jdenticon; - } -})(this, "jdenticon", function (global, jQuery) { - "use strict"; - - - - - /** - * Represents a point. - * @private - * @constructor - */ - function Point(x, y) { - this.x = x; - this.y = y; - }; - - - /** - * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, - * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly. - * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle. - * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle. - * @param {number} size The size of the transformed rectangle. - * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad - * @private - * @constructor - */ - function Transform(x, y, size, rotation) { - this._x = x; - this._y = y; - this._size = size; - this._rotation = rotation; - } - Transform.prototype = { - /** - * Transforms the specified point based on the translation and rotation specification for this Transform. - * @param {number} x x-coordinate - * @param {number} y y-coordinate - * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle. - * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle. - */ - transformPoint: function (x, y, w, h) { - var right = this._x + this._size, - bottom = this._y + this._size; - return this._rotation === 1 ? new Point(right - y - (h || 0), this._y + x) : - this._rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) : - this._rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) : - new Point(this._x + x, this._y + y); - } - }; - Transform.noTransform = new Transform(0, 0, 0, 0); - - - - /** - * Provides helper functions for rendering common basic shapes. - * @private - * @constructor - */ - function Graphics(renderer) { - this._renderer = renderer; - this._transform = Transform.noTransform; - } - Graphics.prototype = { - /** - * Adds a polygon to the underlying renderer. - * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ] - * @param {boolean=} invert Specifies if the polygon will be inverted. - */ - addPolygon: function (points, invert) { - var di = invert ? -2 : 2, - transform = this._transform, - transformedPoints = [], - i; - - for (i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) { - transformedPoints.push(transform.transformPoint(points[i], points[i + 1])); - } - - this._renderer.addPolygon(transformedPoints); - }, - - /** - * Adds a polygon to the underlying renderer. - * Source: http://stackoverflow.com/a/2173084 - * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse. - * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse. - * @param {number} size The size of the ellipse. - * @param {boolean=} invert Specifies if the ellipse will be inverted. - */ - addCircle: function (x, y, size, invert) { - var p = this._transform.transformPoint(x, y, size, size); - this._renderer.addCircle(p, size, invert); - }, - - /** - * Adds a rectangle to the underlying renderer. - * @param {number} x The x-coordinate of the upper left corner of the rectangle. - * @param {number} y The y-coordinate of the upper left corner of the rectangle. - * @param {number} w The width of the rectangle. - * @param {number} h The height of the rectangle. - * @param {boolean=} invert Specifies if the rectangle will be inverted. - */ - addRectangle: function (x, y, w, h, invert) { - this.addPolygon([ - x, y, - x + w, y, - x + w, y + h, - x, y + h - ], invert); - }, - - /** - * Adds a right triangle to the underlying renderer. - * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle. - * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle. - * @param {number} w The width of the triangle. - * @param {number} h The height of the triangle. - * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle. - * @param {boolean=} invert Specifies if the triangle will be inverted. - */ - addTriangle: function (x, y, w, h, r, invert) { - var points = [ - x + w, y, - x + w, y + h, - x, y + h, - x, y - ]; - points.splice(((r || 0) % 4) * 2, 2); - this.addPolygon(points, invert); - }, - - /** - * Adds a rhombus to the underlying renderer. - * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus. - * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus. - * @param {number} w The width of the rhombus. - * @param {number} h The height of the rhombus. - * @param {boolean=} invert Specifies if the rhombus will be inverted. - */ - addRhombus: function (x, y, w, h, invert) { - this.addPolygon([ - x + w / 2, y, - x + w, y + h / 2, - x + w / 2, y + h, - x, y + h / 2 - ], invert); - } - }; - - - - - var shapes = { - center: [ - /** @param {Graphics} g */ - function (g, cell, index) { - var k = cell * 0.42; - g.addPolygon([ - 0, 0, - cell, 0, - cell, cell - k * 2, - cell - k, cell, - 0, cell - ]); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - var w = 0 | (cell * 0.5), - h = 0 | (cell * 0.8); - g.addTriangle(cell - w, 0, w, h, 2); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - var s = 0 | (cell / 3); - g.addRectangle(s, s, cell - s, cell - s); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - var inner = 0 | (cell * 0.1), - outer = 0 | (cell * 0.25); - g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - var m = 0 | (cell * 0.15), - s = 0 | (cell * 0.5); - g.addCircle(cell - s - m, cell - s - m, s); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - var inner = cell * 0.1, - outer = inner * 4; - - g.addRectangle(0, 0, cell, cell); - g.addPolygon([ - outer, outer, - cell - inner, outer, - outer + (cell - outer - inner) / 2, cell - inner - ], true); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - g.addPolygon([ - 0, 0, - cell, 0, - cell, cell * 0.7, - cell * 0.4, cell * 0.4, - cell * 0.7, cell, - 0, cell - ]); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - g.addRectangle(0, 0, cell, cell / 2); - g.addRectangle(0, cell / 2, cell / 2, cell / 2); - g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - var inner = 0 | (cell * 0.14), - outer = 0 | (cell * 0.35); - g.addRectangle(0, 0, cell, cell); - g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - var inner = cell * 0.12, - outer = inner * 3; - - g.addRectangle(0, 0, cell, cell); - g.addCircle(outer, outer, cell - inner - outer, true); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - var m = cell * 0.25; - g.addRectangle(0, 0, cell, cell); - g.addRhombus(m, m, cell - m, cell - m, true); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - var m = cell * 0.4, s = cell * 1.2; - if (!index) { - g.addCircle(m, m, s); - } - } - ], - - outer: [ - /** @param {Graphics} g */ - function (g, cell, index) { - g.addTriangle(0, 0, cell, cell, 0); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - g.addTriangle(0, cell / 2, cell, cell / 2, 0); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - g.addRhombus(0, 0, cell, cell); - }, - /** @param {Graphics} g */ - function (g, cell, index) { - var m = cell / 6; - g.addCircle(m, m, cell - 2 * m); - } - ] - }; - - - - - function decToHex(v) { - v |= 0; // Ensure integer value - return v < 0 ? "00" : - v < 16 ? "0" + v.toString(16) : - v < 256 ? v.toString(16) : - "ff"; - } - - function hueToRgb(m1, m2, h) { - h = h < 0 ? h + 6 : h > 6 ? h - 6 : h; - return decToHex(255 * ( - h < 1 ? m1 + (m2 - m1) * h : - h < 3 ? m2 : - h < 4 ? m1 + (m2 - m1) * (4 - h) : - m1)); - } - - /** - * Functions for converting colors to hex-rgb representations. - * @private - */ - var color = { - /** - * @param {number} r Red channel [0, 255] - * @param {number} g Green channel [0, 255] - * @param {number} b Blue channel [0, 255] - */ - rgb: function (r, g, b) { - return "#" + decToHex(r) + decToHex(g) + decToHex(b); - }, - /** - * @param h Hue [0, 1] - * @param s Saturation [0, 1] - * @param l Lightness [0, 1] - */ - hsl: function (h, s, l) { - // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color - if (s == 0) { - var partialHex = decToHex(l * 255); - return "#" + partialHex + partialHex + partialHex; - } - else { - var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s, - m1 = l * 2 - m2; - return "#" + - hueToRgb(m1, m2, h * 6 + 2) + - hueToRgb(m1, m2, h * 6) + - hueToRgb(m1, m2, h * 6 - 2); - } - }, - // This function will correct the lightness for the "dark" hues - correctedHsl: function (h, s, l) { - // The corrector specifies the perceived middle lightnesses for each hue - var correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ], - corrector = correctors[(h * 6 + 0.5) | 0]; - - // Adjust the input lightness relative to the corrector - l = l < 0.5 ? l * corrector * 2 : corrector + (l - 0.5) * (1 - corrector) * 2; - - return color.hsl(h, s, l); - } - }; - - - - - /** - * Gets a set of identicon color candidates for a specified hue and config. - */ - function colorTheme(hue, config) { - return [ - // Dark gray - color.hsl(0, 0, config.grayscaleLightness(0)), - // Mid color - color.correctedHsl(hue, config.saturation, config.colorLightness(0.5)), - // Light gray - color.hsl(0, 0, config.grayscaleLightness(1)), - // Light color - color.correctedHsl(hue, config.saturation, config.colorLightness(1)), - // Dark color - color.correctedHsl(hue, config.saturation, config.colorLightness(0)) - ]; - } - - - - - /** - * Draws an identicon to a specified renderer. - */ - function iconGenerator(renderer, hash, x, y, size, padding, config) { - var undefined; - - // Calculate padding - padding = (size * (padding === undefined ? 0.08 : padding)) | 0; - size -= padding * 2; - - // Sizes smaller than 30 px are not supported. If really needed, apply a scaling transformation - // to the context before passing it to this function. - if (size < 30) { - throw new Error("Jdenticon cannot render identicons smaller than 30 pixels."); - } - if (!/^[0-9a-f]{11,}$/i.test(hash)) { - throw new Error("Invalid hash passed to Jdenticon."); - } - - var graphics = new Graphics(renderer); - - // Calculate cell size and ensure it is an integer - var cell = 0 | (size / 4); - - // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon - x += 0 | (padding + size / 2 - cell * 2); - y += 0 | (padding + size / 2 - cell * 2); - - function renderShape(colorIndex, shapes, index, rotationIndex, positions) { - var r = rotationIndex ? parseInt(hash.charAt(rotationIndex), 16) : 0, - shape = shapes[parseInt(hash.charAt(index), 16) % shapes.length], - i; - - renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]); - - for (i = 0; i < positions.length; i++) { - graphics._transform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4); - shape(graphics, cell, i); - } - - renderer.endShape(); - } - - // AVAILABLE COLORS - var hue = parseInt(hash.substr(-7), 16) / 0xfffffff, - - // Available colors for this icon - availableColors = colorTheme(hue, config), - - // The index of the selected colors - selectedColorIndexes = [], - index; - - function isDuplicate(values) { - if (values.indexOf(index) >= 0) { - for (var i = 0; i < values.length; i++) { - if (selectedColorIndexes.indexOf(values[i]) >= 0) { - return true; - } - } - } - } - - for (var i = 0; i < 3; i++) { - index = parseInt(hash.charAt(8 + i), 16) % availableColors.length; - if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo - isDuplicate([2, 3])) { // Disallow light gray and light color combo - index = 1; - } - selectedColorIndexes.push(index); - } - - // ACTUAL RENDERING - // Sides - renderShape(0, shapes.outer, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]); - // Corners - renderShape(1, shapes.outer, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]); - // Center - renderShape(2, shapes.center, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]); - }; - - - - /** - * Represents an SVG path element. - * @private - * @constructor - */ - function SvgPath() { - /** - * This property holds the data string (path.d) of the SVG path. - */ - this.dataString = ""; - } - SvgPath.prototype = { - /** - * Adds a polygon with the current fill color to the SVG path. - * @param points An array of Point objects. - */ - addPolygon: function (points) { - var dataString = "M" + points[0].x + " " + points[0].y; - for (var i = 1; i < points.length; i++) { - dataString += "L" + points[i].x + " " + points[i].y; - } - this.dataString += dataString + "Z"; - }, - /** - * Adds a circle with the current fill color to the SVG path. - * @param {Point} point The upper left corner of the circle bounding box. - * @param {number} diameter The diameter of the circle. - * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path). - */ - addCircle: function (point, diameter, counterClockwise) { - var sweepFlag = counterClockwise ? 0 : 1, - radius = diameter / 2; - this.dataString += - "M" + (point.x) + " " + (point.y + radius) + - "a" + radius + "," + radius + " 0 1," + sweepFlag + " " + diameter + ",0" + - "a" + radius + "," + radius + " 0 1," + sweepFlag + " " + (-diameter) + ",0"; - } - }; - - - - /** - * Renderer producing SVG output. - * @private - * @constructor - */ - function SvgRenderer(width, height) { - this._pathsByColor = { }; - this._size = { w: width, h: height }; - } - SvgRenderer.prototype = { - /** - * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape. - * @param {string} color Fill color on format #xxxxxx. - */ - beginShape: function (color) { - this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath()); - }, - /** - * Marks the end of the currently drawn shape. - */ - endShape: function () { }, - /** - * Adds a polygon with the current fill color to the SVG. - * @param points An array of Point objects. - */ - addPolygon: function (points) { - this._path.addPolygon(points); - }, - /** - * Adds a circle with the current fill color to the SVG. - * @param {Point} point The upper left corner of the circle bounding box. - * @param {number} diameter The diameter of the circle. - * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path). - */ - addCircle: function (point, diameter, counterClockwise) { - this._path.addCircle(point, diameter, counterClockwise); - }, - /** - * Gets the rendered image as an SVG string. - * @param {boolean=} fragment If true, the container svg element is not included in the result. - */ - toSvg: function (fragment) { - var svg = fragment ? '' : - ''; - - for (var color in this._pathsByColor) { - svg += ''; - } - - return fragment ? svg : - svg + ''; - } - }; - - - - /** - * Renderer redirecting drawing commands to a canvas context. - * @private - * @constructor - */ - function CanvasRenderer(ctx, width, height) { - this._ctx = ctx; - ctx.clearRect(0, 0, width, height); - } - CanvasRenderer.prototype = { - /** - * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape. - * @param {string} color Fill color on format #xxxxxx. - */ - beginShape: function (color) { - this._ctx.fillStyle = color; - this._ctx.beginPath(); - }, - /** - * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas. - */ - endShape: function () { - this._ctx.fill(); - }, - /** - * Adds a polygon to the rendering queue. - * @param points An array of Point objects. - */ - addPolygon: function (points) { - var ctx = this._ctx, i; - ctx.moveTo(points[0].x, points[0].y); - for (i = 1; i < points.length; i++) { - ctx.lineTo(points[i].x, points[i].y); - } - ctx.closePath(); - }, - /** - * Adds a circle to the rendering queue. - * @param {Point} point The upper left corner of the circle bounding box. - * @param {number} diameter The diameter of the circle. - * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path). - */ - addCircle: function (point, diameter, counterClockwise) { - var ctx = this._ctx, - radius = diameter / 2; - ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise); - ctx.closePath(); - } - }; - - - - - - - var /** @const */ - HASH_ATTRIBUTE = "data-jdenticon-hash", - supportsQuerySelectorAll = "document" in global && "querySelectorAll" in document; - - /** - * Gets the normalized current Jdenticon color configuration. Missing fields have default values. - */ - function getCurrentConfig() { - var configObject = jdenticon["config"] || global["jdenticon_config"] || { }, - lightnessConfig = configObject["lightness"] || { }, - saturation = configObject["saturation"]; - - /** - * Creates a lightness range. - */ - function lightness(configName, defaultMin, defaultMax) { - var range = lightnessConfig[configName] instanceof Array ? lightnessConfig[configName] : [defaultMin, defaultMax]; - - /** - * Gets a lightness relative the specified value in the specified lightness range. - */ - return function (value) { - value = range[0] + value * (range[1] - range[0]); - return value < 0 ? 0 : value > 1 ? 1 : value; - }; - } - - return { - saturation: typeof saturation == "number" ? saturation : 0.5, - colorLightness: lightness("color", 0.4, 0.8), - grayscaleLightness: lightness("grayscale", 0.3, 0.9) - } - } - - /** - * Updates the identicon in the specified canvas or svg elements. - * @param {string=} hash Optional hash to be rendered. If not specified, the hash specified by the data-jdenticon-hash is used. - * @param {number=} padding Optional padding in percents. Extra padding might be added to center the rendered identicon. - */ - function update(el, hash, padding) { - if (typeof(el) === "string") { - if (supportsQuerySelectorAll) { - var elements = document.querySelectorAll(el); - for (var i = 0; i < elements.length; i++) { - update(elements[i], hash, padding); - } - } - return; - } - if (!el || !el["tagName"]) { - // No element found - return; - } - hash = hash || el.getAttribute(HASH_ATTRIBUTE); - if (!hash) { - // No hash specified - return; - } - - var isSvg = el["tagName"].toLowerCase() == "svg", - isCanvas = el["tagName"].toLowerCase() == "canvas"; - - // Ensure we have a supported element - if (!isSvg && !(isCanvas && "getContext" in el)) { - return; - } - - var width = Number(el.getAttribute("width")) || el.clientWidth || 0, - height = Number(el.getAttribute("height")) || el.clientHeight || 0, - renderer = isSvg ? new SvgRenderer(width, height) : new CanvasRenderer(el.getContext("2d"), width, height), - size = Math.min(width, height); - - // Draw icon - iconGenerator(renderer, hash, 0, 0, size, padding, getCurrentConfig()); - - // SVG needs postprocessing - if (isSvg) { - // Parse svg to a temporary span element. - // Simply using innerHTML does unfortunately not work on IE. - var wrapper = document.createElement("span"); - wrapper.innerHTML = renderer.toSvg(false); - - // Then replace the content of the target element with the parsed svg. - while (el.firstChild) { - el.removeChild(el.firstChild); - } - var newNodes = wrapper.firstChild.childNodes; - while (newNodes.length) { - el.appendChild(newNodes[0]); - } - - // Set viewBox attribute to ensure the svg scales nicely. - el.setAttribute("viewBox", "0 0 " + width + " " + height); - } - } - - /** - * Draws an identicon to a context. - */ - function drawIcon(ctx, hash, size) { - if (!ctx) { - throw new Error("No canvas specified."); - } - - var renderer = new CanvasRenderer(ctx, size, size); - iconGenerator(renderer, hash, 0, 0, size, 0, getCurrentConfig()); - } - - /** - * Draws an identicon to a context. - * @param {number=} padding Optional padding in percents. Extra padding might be added to center the rendered identicon. - */ - function toSvg(hash, size, padding) { - var renderer = new SvgRenderer(size, size); - iconGenerator(renderer, hash, 0, 0, size, padding, getCurrentConfig()); - return renderer.toSvg(); - } - - /** - * Updates all canvas elements with the data-jdenticon-hash attribute. - */ - function jdenticon() { - if (supportsQuerySelectorAll) { - update("svg[" + HASH_ATTRIBUTE + "],canvas[" + HASH_ATTRIBUTE + "]"); - } - } - - // Public API - jdenticon["drawIcon"] = drawIcon; - jdenticon["toSvg"] = toSvg; - jdenticon["update"] = update; - jdenticon["version"] = "1.3.2"; - - // Basic jQuery plugin - if (jQuery) { - jQuery["fn"]["jdenticon"] = function (hash, padding) { - this["each"](function (index, el) { - update(el, hash, padding); - }); - return this; - }; - } - - // Schedule to render all identicons on the page once it has been loaded. - if (typeof setTimeout === "function") { - setTimeout(jdenticon, 0); - } - - return jdenticon; - -}); \ No newline at end of file diff --git a/pagure/static/jdenticon-1.3.2.min.js b/pagure/static/jdenticon-1.3.2.min.js deleted file mode 100644 index 610d18e..0000000 --- a/pagure/static/jdenticon-1.3.2.min.js +++ /dev/null @@ -1,13 +0,0 @@ -// Jdenticon 1.3.2 | jdenticon.com | zlib licensed | (c) 2014-2015 Daniel Mester Pirttijärvi -(function(k,g,h){var l=h(k,k.jQuery);"undefined"!==typeof module&&"exports"in module?module.exports=l:"function"===typeof define&&define.amd?define([],function(){return l}):k[g]=l})(this,"jdenticon",function(k,g){function h(b,a){this.x=b;this.y=a}function l(b,a,c,d){this.o=b;this.s=a;this.f=c;this.l=d}function A(b){this.C=b;this.m=l.O}function m(b){b|=0;return 0>b?"00":16>b?"0"+b.toString(16):256>b?b.toString(16):"ff"}function q(b,a,c){c=0>c?c+6:6c?b+(a-b)*c:3>c?a:4>c?b+(a- -b)*(4-c):b))}function D(b,a){return[n.w(0,0,a.H(0)),n.v(b,a.A,a.u(.5)),n.w(0,0,a.H(1)),n.v(b,a.A,a.u(1)),n.v(b,a.A,a.u(0))]}function r(b,a,c,d,t){var f=0,u=0;function v(c,d,t,e,g){e=e?parseInt(a.charAt(e),16):0;d=d[parseInt(a.charAt(t),16)%d.length];b.F(n[m[c]]);for(c=0;cc)throw Error("Jdenticon cannot render identicons smaller than 30 pixels."); -if(!/^[0-9a-f]{11,}$/i.test(a))throw Error("Invalid hash passed to Jdenticon.");var k=new A(b),h=0|c/4,f=f+(0|d+c/2-2*h),u=u+(0|d+c/2-2*h),n=D(parseInt(a.substr(-7),16)/268435455,t),m=[],g;for(c=0;3>c;c++){g=parseInt(a.charAt(8+c),16)%n.length;if(e([0,4])||e([2,3]))g=1;m.push(g)}v(0,w.J,2,3,[[1,0],[2,0],[2,3],[1,3],[0,1],[3,1],[3,2],[0,2]]);v(1,w.J,4,5,[[0,0],[3,0],[3,3],[0,3]]);v(2,w.N,1,null,[[1,1],[2,1],[2,2],[1,2]])}function B(){this.i=""}function x(b,a){this.j={};this.f={M:b,I:a}}function y(b, -a,c){this.h=b;b.clearRect(0,0,a,c)}function z(){function b(a,b,f){var e=c[a]instanceof Array?c[a]:[b,f];return function(a){a=e[0]+a*(e[1]-e[0]);return 0>a?0:1=c?c*(a+1):c+a-c*a;c=2*c-a;return"#"+q(c,a,6*b+2)+q(c,a,6*b)+q(c,a,6*b-2)},v:function(b,a,c){var d=[.55,.5,.5,.46,.6,.55,.55][6*b+.5|0];return n.w(b,a,.5>c?c*d*2:d+(c-.5)*(1-d)*2)}};B.prototype={a:function(b){for(var a="M"+b[0].x+" "+b[0].y,c=1;c< -b.length;c++)a+="L"+b[c].x+" "+b[c].y;this.i+=a+"Z"},b:function(b,a,c){c=c?0:1;var d=a/2;this.i+="M"+b.x+" "+(b.y+d)+"a"+d+","+d+" 0 1,"+c+" "+a+",0a"+d+","+d+" 0 1,"+c+" "+-a+",0"}};x.prototype={F:function(b){this.B=this.j[b]||(this.j[b]=new B)},G:function(){},a:function(b){this.B.a(b)},b:function(b,a,c){this.B.b(b,a,c)},K:function(b){var a=b?"":'', -c;for(c in this.j)a+='';return b?a:a+""}};y.prototype={F:function(b){this.h.fillStyle=b;this.h.beginPath()},G:function(){this.h.fill()},a:function(b){var a=this.h,c;a.moveTo(b[0].x,b[0].y);for(c=1;c type pairs - class2type = {}, - - // List of deleted data cache ids, so we can reuse them - core_deletedIds = [], - - core_version = "1.10.2", - - // Save a reference to some core methods - core_concat = core_deletedIds.concat, - core_push = core_deletedIds.push, - core_slice = core_deletedIds.slice, - core_indexOf = core_deletedIds.indexOf, - core_toString = class2type.toString, - core_hasOwn = class2type.hasOwnProperty, - core_trim = core_version.trim, - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Used for matching numbers - core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, - - // Used for splitting on whitespace - core_rnotwhite = /\S+/g, - - // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, - rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }, - - // The ready event handler - completed = function( event ) { - - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { - detach(); - jQuery.ready(); - } - }, - // Clean-up method for dom ready events - detach = function() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: core_version, - - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return core_slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; - }, - - slice: function() { - return this.pushStack( core_slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: core_push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), - - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger("ready").off("ready"); - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - /* jshint eqeqeq: false */ - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - return !isNaN( parseFloat(obj) ) && isFinite( obj ); - }, - - type: function( obj ) { - if ( obj == null ) { - return String( obj ); - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ core_toString.call(obj) ] || "object" : - typeof obj; - }, - - isPlainObject: function( obj ) { - var key; - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !core_hasOwn.call(obj, "constructor") && - !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Support: IE<9 - // Handle iteration over inherited properties before own properties. - if ( jQuery.support.ownLast ) { - for ( key in obj ) { - return core_hasOwn.call( obj, key ); - } - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - for ( key in obj ) {} - - return key === undefined || core_hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw new Error( msg ); - }, - - // data: string of html - // context (optional): If specified, the fragment will be created in this context, defaults to document - // keepScripts (optional): If true, will include scripts passed in the html string - parseHTML: function( data, context, keepScripts ) { - if ( !data || typeof data !== "string" ) { - return null; - } - if ( typeof context === "boolean" ) { - keepScripts = context; - context = false; - } - context = context || document; - - var parsed = rsingleTag.exec( data ), - scripts = !keepScripts && []; - - // Single tag - if ( parsed ) { - return [ context.createElement( parsed[1] ) ]; - } - - parsed = jQuery.buildFragment( [ data ], context, scripts ); - if ( scripts ) { - jQuery( scripts ).remove(); - } - return jQuery.merge( [], parsed.childNodes ); - }, - - parseJSON: function( data ) { - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - if ( data === null ) { - return data; - } - - if ( typeof data === "string" ) { - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - if ( data ) { - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - } - } - } - - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - var xml, tmp; - if ( !data || typeof data !== "string" ) { - return null; - } - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Use native String.trim function wherever possible - trim: core_trim && !core_trim.call("\uFEFF\xA0") ? - function( text ) { - return text == null ? - "" : - core_trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - core_push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( core_indexOf ) { - return core_indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var l = second.length, - i = first.length, - j = 0; - - if ( typeof l === "number" ) { - for ( ; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var retVal, - ret = [], - i = 0, - length = elems.length; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return core_concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var args, proxy, tmp; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = core_slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - // Multifunctional method to get and set values of a collection - // The value/s can optionally be executed if it's a function - access: function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; - }, - - now: function() { - return ( new Date() ).getTime(); - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations. - // Note: this method belongs to the css module but it's needed here for the support module. - // If support gets modularized, this method should be moved back to the css module. - swap: function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; - } -}); - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || type !== "function" && - ( length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj ); -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); -/*! - * Sizzle CSS Selector Engine v1.10.2 - * http://sizzlejs.com/ - * - * Copyright 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2013-07-03 - */ -(function( window, undefined ) { - -var i, - support, - cachedruns, - Expr, - getText, - isXML, - compile, - outermostContext, - sortInput, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - hasDuplicate = false, - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - return 0; - }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + - "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", - - // Prefer arguments quoted, - // then not containing pseudos/brackets, - // then attribute selectors/non-parenthetical expressions, - // then anything else - // These preferences are here to reduce the number of selectors - // needing tokenize in the PSEUDO preFilter - pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rsibling = new RegExp( whitespace + "*[+~]" ), - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - // BMP codepoint - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && context.parentNode || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key += " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Detect xml - * @param {Element|Object} elem An element or a document - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent.attachEvent && parent !== parent.top ) { - parent.attachEvent( "onbeforeunload", function() { - setDocument(); - }); - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = assert(function( div ) { - div.innerHTML = "
        "; - - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - - // Support: Opera 10-12/IE8 - // ^= $= *= and empty values - // Should not select anything - // Support: Windows 8 Native Apps - // The type attribute is restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "t", "" ); - - if ( div.querySelectorAll("[t^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = docElem.compareDocumentPosition ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); - - if ( compare ) { - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } - - // Not directly comparable, sort on existence of method - return a.compareDocumentPosition ? -1 : 1; - } : - function( a, b ) { - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Parentless nodes are either documents or disconnected - } else if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [elem] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val === undefined ? - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null : - val; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - for ( ; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (see #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[5] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] && match[4] !== undefined ) { - match[2] = match[4]; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), - // not comment, processing instructions, or others - // Thanks to Diego Perini for the nodeName shortcut - // Greater than "@" means alpha characters (specifically not starting with "#" or "?") - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -function tokenize( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( tokens = [] ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -} - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var data, cache, outerCache, - dirkey = dirruns + " " + doneName; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { - if ( (data = cache[1]) === true || data === cachedruns ) { - return data === true; - } - } else { - cache = outerCache[ dir ] = [ dirkey ]; - cache[1] = matcher( elem, context, xml ) || cachedruns; - if ( cache[1] === true ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - // A counter to specify which element is currently being matched - var matcherCachedRuns = 0, - bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, expandContext ) { - var elem, j, matcher, - setMatched = [], - matchedCount = 0, - i = "0", - unmatched = seed && [], - outermost = expandContext != null, - contextBackup = outermostContext, - // We must always have either seed elements or context - elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); - - if ( outermost ) { - outermostContext = context !== document && context; - cachedruns = matcherCachedRuns; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - for ( ; (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - cachedruns = ++matcherCachedRuns; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !group ) { - group = tokenize( selector ); - } - i = group.length; - while ( i-- ) { - cached = matcherFromTokens( group[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - } - return cached; -}; - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function select( selector, context, results, seed ) { - var i, tokens, token, type, find, - match = tokenize( selector ); - - if ( !seed ) { - // Try to minimize operations if there is only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - } - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && context.parentNode || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - } - - // Compile and execute a filtering function - // Provide `match` to avoid retokenization if we modified the selector above - compile( selector, match )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) - ); - return results; -} - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome<14 -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - elem[ name ] === true ? name.toLowerCase() : null; - } - }); -} - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})( window ); -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var action = tuple[ 0 ], - fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = core_slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; - if( values === progressValues ) { - deferred.notifyWith( contexts, values ); - } else if ( !( --remaining ) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); -jQuery.support = (function( support ) { - - var all, a, input, select, fragment, opt, eventName, isSupported, i, - div = document.createElement("div"); - - // Setup - div.setAttribute( "className", "t" ); - div.innerHTML = "
        a"; - - // Finish early in limited (non-browser) environments - all = div.getElementsByTagName("*") || []; - a = div.getElementsByTagName("a")[ 0 ]; - if ( !a || !a.style || !all.length ) { - return support; - } - - // First batch of tests - select = document.createElement("select"); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName("input")[ 0 ]; - - a.style.cssText = "top:1px;float:left;opacity:.5"; - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - support.getSetAttribute = div.className !== "t"; - - // IE strips leading whitespace when .innerHTML is used - support.leadingWhitespace = div.firstChild.nodeType === 3; - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - support.tbody = !div.getElementsByTagName("tbody").length; - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - support.htmlSerialize = !!div.getElementsByTagName("link").length; - - // Get the style information from getAttribute - // (IE uses .cssText instead) - support.style = /top/.test( a.getAttribute("style") ); - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - support.hrefNormalized = a.getAttribute("href") === "/a"; - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - support.opacity = /^0.5/.test( a.style.opacity ); - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - support.cssFloat = !!a.style.cssFloat; - - // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) - support.checkOn = !!input.value; - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - support.optSelected = opt.selected; - - // Tests for enctype support on a form (#6743) - support.enctype = !!document.createElement("form").enctype; - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>"; - - // Will be defined later - support.inlineBlockNeedsLayout = false; - support.shrinkWrapBlocks = false; - support.pixelPosition = false; - support.deleteExpando = true; - support.noCloneEvent = true; - support.reliableMarginRight = true; - support.boxSizingReliable = true; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Support: IE<9 - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - // Check if we can trust getAttribute("value") - input = document.createElement("input"); - input.setAttribute( "value", "" ); - support.input = input.getAttribute( "value" ) === ""; - - // Check if an input maintains its value after becoming a radio - input.value = "t"; - input.setAttribute( "type", "radio" ); - support.radioValue = input.value === "t"; - - // #11217 - WebKit loses check when the name is after the checked attribute - input.setAttribute( "checked", "t" ); - input.setAttribute( "name", "t" ); - - fragment = document.createDocumentFragment(); - fragment.appendChild( input ); - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) - for ( i in { submit: true, change: true, focusin: true }) { - div.setAttribute( eventName = "on" + i, "t" ); - - support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; - } - - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - // Support: IE<9 - // Iteration over object's inherited properties before its own. - for ( i in jQuery( support ) ) { - break; - } - support.ownLast = i !== "0"; - - // Run tests that need a body at doc ready - jQuery(function() { - var container, marginDiv, tds, - divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - container = document.createElement("div"); - container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; - - body.appendChild( container ).appendChild( div ); - - // Support: IE8 - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - div.innerHTML = "
        t
        "; - tds = div.getElementsByTagName("td"); - tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Support: IE8 - // Check if empty table cells still have offsetWidth/Height - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - // Check box-sizing and margin behavior. - div.innerHTML = ""; - div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; - - // Workaround failing boxSizing test due to offsetWidth returning wrong value - // with some non-1 values of body zoom, ticket #13543 - jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { - support.boxSizing = div.offsetWidth === 4; - }); - - // Use window.getComputedStyle because jsdom on node.js will break without it. - if ( window.getComputedStyle ) { - support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; - support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. (#3333) - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - marginDiv = div.appendChild( document.createElement("div") ); - marginDiv.style.cssText = div.style.cssText = divReset; - marginDiv.style.marginRight = marginDiv.style.width = "0"; - div.style.width = "1px"; - - support.reliableMarginRight = - !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); - } - - if ( typeof div.style.zoom !== core_strundefined ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.innerHTML = ""; - div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); - - // Support: IE6 - // Check if elements with layout shrink-wrap their children - div.style.display = "block"; - div.innerHTML = "
        "; - div.firstChild.style.width = "5px"; - support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); - - if ( support.inlineBlockNeedsLayout ) { - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); - - // Null elements to avoid leaks in IE - container = div = tds = marginDiv = null; - }); - - // Null elements to avoid leaks in IE - all = select = fragment = opt = a = input = null; - - return support; -})({}); - -var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, - rmultiDash = /([A-Z])/g; - -function internalData( elem, name, data, pvt /* Internal Use Only */ ){ - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var ret, thisCache, - internalKey = jQuery.expando, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - // Avoid exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( typeof name === "string" ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - i = name.length; - while ( i-- ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - /* jshint eqeqeq: false */ - } else if ( jQuery.support.deleteExpando || cache != cache.window ) { - /* jshint eqeqeq: true */ - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "applet": true, - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - // Do not set data on non-element because it will not be cleared (#8335). - if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { - return false; - } - - var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; - - // nodes accept data unless otherwise specified; rejection can be conditional - return !noData || noData !== true && elem.getAttribute("classid") === noData; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var attrs, name, - data = null, - i = 0, - elem = this[0]; - - // Special expections of .data basically thwart jQuery.access, - // so implement the relevant behavior ourselves - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - attrs = elem.attributes; - for ( ; i < attrs.length; i++ ) { - name = attrs[i].name; - - if ( name.indexOf("data-") === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - - dataAttr( elem, name, data[ name ] ); - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return arguments.length > 1 ? - - // Sets one value - this.each(function() { - jQuery.data( this, key, value ); - }) : - - // Gets one value - // Try to fetch any internally stored data first - elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var nodeHook, boolHook, - rclass = /[\t\r\n\f]/g, - rreturn = /\r/g, - rfocusable = /^(?:input|select|textarea|button|object)$/i, - rclickable = /^(?:a|area)$/i, - ruseDefault = /^(?:checked|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - getSetInput = jQuery.support.input; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classes, elem, cur, clazz, j, - i = 0, - len = this.length, - proceed = typeof value === "string" && value; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call( this, j, this.className ) ); - }); - } - - if ( proceed ) { - // The disjunction here is for better compressibility (see removeClass) - classes = ( value || "" ).match( core_rnotwhite ) || []; - - for ( ; i < len; i++ ) { - elem = this[ i ]; - cur = elem.nodeType === 1 && ( elem.className ? - ( " " + elem.className + " " ).replace( rclass, " " ) : - " " - ); - - if ( cur ) { - j = 0; - while ( (clazz = classes[j++]) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - elem.className = jQuery.trim( cur ); - - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, clazz, j, - i = 0, - len = this.length, - proceed = arguments.length === 0 || typeof value === "string" && value; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call( this, j, this.className ) ); - }); - } - if ( proceed ) { - classes = ( value || "" ).match( core_rnotwhite ) || []; - - for ( ; i < len; i++ ) { - elem = this[ i ]; - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( elem.className ? - ( " " + elem.className + " " ).replace( rclass, " " ) : - "" - ); - - if ( cur ) { - j = 0; - while ( (clazz = classes[j++]) ) { - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - elem.className = value ? jQuery.trim( cur ) : ""; - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value; - - if ( typeof stateVal === "boolean" && type === "string" ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - classNames = value.match( core_rnotwhite ) || []; - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( type === core_strundefined || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // If the element has a class name or if we're passed "false", - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var ret, hooks, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // Use proper attribute retrieval(#6932, #12072) - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - elem.text; - } - }, - select: { - get: function( elem ) { - var value, option, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one" || index < 0, - values = one ? null : [], - max = one ? index + 1 : options.length, - i = index < 0 ? - max : - one ? index : 0; - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // oldIE doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - // Don't return options that are disabled or in a disabled optgroup - ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && - ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { - optionSet = true; - } - } - - // force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attr: function( elem, name, value ) { - var hooks, ret, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === core_strundefined ) { - return jQuery.prop( elem, name, value ); - } - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - - } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, value + "" ); - return value; - } - - } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var name, propName, - i = 0, - attrNames = value && value.match( core_rnotwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( (name = attrNames[i++]) ) { - propName = jQuery.propFix[ name ] || name; - - // Boolean attributes get special treatment (#10870) - if ( jQuery.expr.match.bool.test( name ) ) { - // Set corresponding property to false - if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { - elem[ propName ] = false; - // Support: IE<9 - // Also clear defaultChecked/defaultSelected (if appropriate) - } else { - elem[ jQuery.camelCase( "default-" + name ) ] = - elem[ propName ] = false; - } - - // See #9699 for explanation of this approach (setting first, then removal) - } else { - jQuery.attr( elem, name, "" ); - } - - elem.removeAttribute( getSetAttribute ? name : propName ); - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to default in case type is set after value during creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? - ret : - ( elem[ name ] = value ); - - } else { - return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? - ret : - elem[ name ]; - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - return tabindex ? - parseInt( tabindex, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - -1; - } - } - } -}); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { - // IE<8 needs the *property* name - elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); - - // Use defaultChecked and defaultSelected for oldIE - } else { - elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; - } - - return name; - } -}; -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { - var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; - - jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? - function( elem, name, isXML ) { - var fn = jQuery.expr.attrHandle[ name ], - ret = isXML ? - undefined : - /* jshint eqeqeq: false */ - (jQuery.expr.attrHandle[ name ] = undefined) != - getter( elem, name, isXML ) ? - - name.toLowerCase() : - null; - jQuery.expr.attrHandle[ name ] = fn; - return ret; - } : - function( elem, name, isXML ) { - return isXML ? - undefined : - elem[ jQuery.camelCase( "default-" + name ) ] ? - name.toLowerCase() : - null; - }; -}); - -// fix oldIE attroperties -if ( !getSetInput || !getSetAttribute ) { - jQuery.attrHooks.value = { - set: function( elem, value, name ) { - if ( jQuery.nodeName( elem, "input" ) ) { - // Does not return so that setAttribute is also used - elem.defaultValue = value; - } else { - // Use nodeHook if defined (#1954); otherwise setAttribute is fine - return nodeHook && nodeHook.set( elem, value, name ); - } - } - }; -} - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = { - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - elem.setAttributeNode( - (ret = elem.ownerDocument.createAttribute( name )) - ); - } - - ret.value = value += ""; - - // Break association with cloned elements by also using setAttribute (#9646) - return name === "value" || value === elem.getAttribute( name ) ? - value : - undefined; - } - }; - jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = - // Some attributes are constructed with empty-string values when not defined - function( elem, name, isXML ) { - var ret; - return isXML ? - undefined : - (ret = elem.getAttributeNode( name )) && ret.value !== "" ? - ret.value : - null; - }; - jQuery.valHooks.button = { - get: function( elem, name ) { - var ret = elem.getAttributeNode( name ); - return ret && ret.specified ? - ret.value : - undefined; - }, - set: nodeHook.set - }; - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - set: function( elem, value, name ) { - nodeHook.set( elem, value === "" ? false : value, name ); - } - }; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }; - }); -} - - -// Some attributes require a special call on IE -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !jQuery.support.hrefNormalized ) { - // href/src property should get the full normalized URL (#10299/#12915) - jQuery.each([ "href", "src" ], function( i, name ) { - jQuery.propHooks[ name ] = { - get: function( elem ) { - return elem.getAttribute( name, 4 ); - } - }; - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Note: IE uppercases css property names, but if we were to .toLowerCase() - // .cssText, that would destroy case senstitivity in URL's, like in "background" - return elem.style.cssText || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = value + "" ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }; -} - -jQuery.each([ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -}); - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }; - if ( !jQuery.support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - // Support: Webkit - // "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - }; - } -}); -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( core_rnotwhite ) || [""]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( core_rnotwhite ) || [""]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = core_hasOwn.call( event, "type" ) ? event.type : event, - namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { - event.preventDefault(); - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, ret, handleObj, matched, j, - handlerQueue = [], - args = core_slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var sel, handleObj, matches, i, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - /* jshint eqeqeq: false */ - for ( ; cur != this; cur = cur.parentNode || this ) { - /* jshint eqeqeq: true */ - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Even when returnValue equals to undefined Firefox will still show alert - if ( event.result !== undefined ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === core_strundefined ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); -var isSimple = /^.[^:#\[\.,]*$/, - rparentsprev = /^(?:parents|prev(?:Until|All))/, - rneedsContext = jQuery.expr.match.needsContext, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - ret = [], - self = this, - len = self.length; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - ret = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - cur = ret.push( cur ); - break; - } - } - } - - return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( jQuery.unique(all) ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - ret = jQuery.unique( ret ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - } - - return this.pushStack( ret ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( isSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; - }); -} -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
        ", "
        " ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
        " ], - tr: [ 2, "", "
        " ], - col: [ 2, "", "
        " ], - td: [ 3, "", "
        " ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
        ", "
        " ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -jQuery.fn.extend({ - text: function( value ) { - return jQuery.access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - // keepData is for internal use only--do not document - remove: function( selector, keepData ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function () { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return jQuery.access( this, function( value ) { - var elem = this[0] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var - // Snapshot the DOM in case .domManip sweeps something relevant into its fragment - args = jQuery.map( this, function( elem ) { - return [ elem.nextSibling, elem.parentNode ]; - }), - i = 0; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - var next = args[ i++ ], - parent = args[ i++ ]; - - if ( parent ) { - // Don't use the snapshot next if it has moved (#13810) - if ( next && next.parentNode !== parent ) { - next = this.nextSibling; - } - jQuery( this ).remove(); - parent.insertBefore( elem, next ); - } - // Allow new content to include elements from the context set - }, true ); - - // Force removal if there was no new content (e.g., from empty arguments) - return i ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback, allowIntersection ) { - - // Flatten any nested arrays - args = core_concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, self.html() ); - } - self.domManip( args, callback, allowIntersection ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[i], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Hope ajax is available... - jQuery._evalUrl( node.src ); - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -// Support: IE<8 -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - core_push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( manipulation_rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !jQuery.support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
        " && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !jQuery.support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = jQuery.support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== core_strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - core_deletedIds.push( id ); - } - } - } - } - }, - - _evalUrl: function( url ) { - return jQuery.ajax({ - url: url, - type: "GET", - dataType: "script", - async: false, - global: false, - "throws": true - }); - } -}); -jQuery.fn.extend({ - wrapAll: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapAll( html.call(this, i) ); - }); - } - - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); - - if ( this[0].parentNode ) { - wrap.insertBefore( this[0] ); - } - - wrap.map(function() { - var elem = this; - - while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { - elem = elem.firstChild; - } - - return elem; - }).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapInner( html.call(this, i) ); - }); - } - - return this.each(function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - }); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each(function(i) { - jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); - }); - }, - - unwrap: function() { - return this.parent().each(function() { - if ( !jQuery.nodeName( this, "body" ) ) { - jQuery( this ).replaceWith( this.childNodes ); - } - }).end(); - } -}); -var iframe, getStyles, curCSS, - ralpha = /alpha\([^)]*\)/i, - ropacity = /opacity\s*=\s*([^)]*)/, - rposition = /^(top|right|bottom|left)$/, - // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" - // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rmargin = /^margin/, - rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), - rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), - rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), - elemdisplay = { BODY: "block" }, - - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: 0, - fontWeight: 400 - }, - - cssExpand = [ "Top", "Right", "Bottom", "Left" ], - cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; - -// return a css property mapped to a potentially vendor prefixed property -function vendorPropName( style, name ) { - - // shortcut for names that are not vendor prefixed - if ( name in style ) { - return name; - } - - // check for vendor prefixed names - var capName = name.charAt(0).toUpperCase() + name.slice(1), - origName = name, - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in style ) { - return name; - } - } - - return origName; -} - -function isHidden( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); -} - -function showHide( elements, show ) { - var display, elem, hidden, - values = [], - index = 0, - length = elements.length; - - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - values[ index ] = jQuery._data( elem, "olddisplay" ); - display = elem.style.display; - if ( show ) { - // Reset the inline display of this element to learn if it is - // being hidden by cascaded rules or not - if ( !values[ index ] && display === "none" ) { - elem.style.display = ""; - } - - // Set elements which have been overridden with display: none - // in a stylesheet to whatever the default browser style is - // for such an element - if ( elem.style.display === "" && isHidden( elem ) ) { - values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); - } - } else { - - if ( !values[ index ] ) { - hidden = isHidden( elem ); - - if ( display && display !== "none" || !hidden ) { - jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); - } - } - } - } - - // Set the display of most of the elements in a second loop - // to avoid the constant reflow - for ( index = 0; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - if ( !show || elem.style.display === "none" || elem.style.display === "" ) { - elem.style.display = show ? values[ index ] || "" : "none"; - } - } - - return elements; -} - -jQuery.fn.extend({ - css: function( name, value ) { - return jQuery.access( this, function( elem, name, value ) { - var len, styles, - map = {}, - i = 0; - - if ( jQuery.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - }, - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each(function() { - if ( isHidden( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - }); - } -}); - -jQuery.extend({ - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "columnCount": true, - "fillOpacity": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - // normalize float css property - "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - style = elem.style; - - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // convert relative number strings (+= or -=) to relative numbers. #7345 - if ( type === "string" && (ret = rrelNum.exec( value )) ) { - value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); - // Fixes bug #9237 - type = "number"; - } - - // Make sure that NaN and null values aren't set. See: #7116 - if ( value == null || type === "number" && isNaN( value ) ) { - return; - } - - // If a number was passed in, add 'px' to the (except for certain CSS properties) - if ( type === "number" && !jQuery.cssNumber[ origName ] ) { - value += "px"; - } - - // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, - // but it would mean to define eight (for every problematic property) identical functions - if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { - - // Wrapped to prevent IE from throwing errors when 'invalid' values are provided - // Fixes bug #5509 - try { - style[ name ] = value; - } catch(e) {} - } - - } else { - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var num, val, hooks, - origName = jQuery.camelCase( name ); - - // Make sure that we're working with the right name - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - //convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Return, converting to number if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; - } - return val; - } -}); - -// NOTE: we've included the "window" in window.getComputedStyle -// because jsdom on node.js will break without it. -if ( window.getComputedStyle ) { - getStyles = function( elem ) { - return window.getComputedStyle( elem, null ); - }; - - curCSS = function( elem, name, _computed ) { - var width, minWidth, maxWidth, - computed = _computed || getStyles( elem ), - - // getPropertyValue is only needed for .css('filter') in IE9, see #12537 - ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, - style = elem.style; - - if ( computed ) { - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right - // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels - // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values - if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret; - }; -} else if ( document.documentElement.currentStyle ) { - getStyles = function( elem ) { - return elem.currentStyle; - }; - - curCSS = function( elem, name, _computed ) { - var left, rs, rsLeft, - computed = _computed || getStyles( elem ), - ret = computed ? computed[ name ] : undefined, - style = elem.style; - - // Avoid setting ret to empty string here - // so we don't default to auto - if ( ret == null && style && style[ name ] ) { - ret = style[ name ]; - } - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - // but not position css attributes, as those are proportional to the parent element instead - // and we can't measure the parent instead because it might trigger a "stacking dolls" problem - if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { - - // Remember the original values - left = style.left; - rs = elem.runtimeStyle; - rsLeft = rs && rs.left; - - // Put in the new values to get a computed value out - if ( rsLeft ) { - rs.left = elem.currentStyle.left; - } - style.left = name === "fontSize" ? "1em" : ret; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - if ( rsLeft ) { - rs.left = rsLeft; - } - } - - return ret === "" ? "auto" : ret; - }; -} - -function setPositiveNumber( elem, value, subtract ) { - var matches = rnumsplit.exec( value ); - return matches ? - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { - var i = extra === ( isBorderBox ? "border" : "content" ) ? - // If we already have the right measurement, avoid augmentation - 4 : - // Otherwise initialize for horizontal or vertical properties - name === "width" ? 1 : 0, - - val = 0; - - for ( ; i < 4; i += 2 ) { - // both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); - } - - if ( isBorderBox ) { - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // at this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } else { - // at this point, extra isn't content, so add padding - val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // at this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with offset property, which is equivalent to the border-box value - var valueIsBorderBox = true, - val = name === "width" ? elem.offsetWidth : elem.offsetHeight, - styles = getStyles( elem ), - isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // some non-html elements return undefined for offsetWidth, so check for null/undefined - // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 - // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 - if ( val <= 0 || val == null ) { - // Fall back to computed then uncomputed css if necessary - val = curCSS( elem, name, styles ); - if ( val < 0 || val == null ) { - val = elem.style[ name ]; - } - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test(val) ) { - return val; - } - - // we need the check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - } - - // use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles - ) - ) + "px"; -} - -// Try to determine the default display value of an element -function css_defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - // Use the already-created iframe if possible - iframe = ( iframe || - jQuery("