diff --git a/config.py b/config.py index 33921a5..bcf3231 100644 --- a/config.py +++ b/config.py @@ -8,6 +8,6 @@ default_options = { "FileParsers": "media, text, picture" # media, text, picture } -index_every = 50000 +index_every = 10000 nGramMin = 3 nGramMax = 3 diff --git a/indexer.py b/indexer.py index cad88cb..679dc9d 100644 --- a/indexer.py +++ b/indexer.py @@ -78,7 +78,8 @@ class Indexer: self.es.indices.put_mapping(body={"properties": { "path": {"type": "text", "analyzer": "path_analyser", "copy_to": "suggest-path"}, "suggest-path": {"type": "completion", "analyzer": "keyword"}, - "mime": {"type": "text", "analyzer": "path_analyser"}, + "mime": {"type": "text", "analyzer": "path_analyser", "copy_to": "mime_kw"}, + "mime_kw": {"type": "keyword"}, "directory": {"type": "keyword"}, "name": {"analyzer": "my_nGram", "type": "text"}, "album": {"analyzer": "my_nGram", "type": "text"}, diff --git a/run.py b/run.py index 5f6f87a..016d9c1 100644 --- a/run.py +++ b/run.py @@ -8,6 +8,7 @@ import humanfriendly from search import Search from PIL import Image from io import BytesIO +from collections import defaultdict app = Flask(__name__) app.secret_key = "A very secret key" @@ -94,7 +95,32 @@ def thumb(doc_id): @app.route("/") def search_page(): - return render_template("search.html", directories=storage.dirs()) + + mime_map = defaultdict(list) + mime_list = [] + mime_types = search.get_mime_types() + + for mime in mime_types: + splited_mime = os.path.split(mime["key"]) + mime_map[splited_mime[0]].append(splited_mime[1]) + + for mime in mime_map: + category = dict() + category["text"] = mime + + children = [] + for m in mime_map[mime]: + child = dict() + child["text"] = m + child["id"] = mime + "/" + m + children.append(child) + + if len(children) > 0: + category["children"] = children + + mime_list.append(category) + + return render_template("search.html", directories=storage.dirs(), mime_list=mime_list) @app.route("/list") diff --git a/search.py b/search.py index 77a1783..f9e5da6 100644 --- a/search.py +++ b/search.py @@ -51,6 +51,18 @@ class Search: except: return 0 + def get_mime_types(self): + + query = self.es.search(body={ + "aggs": { + "mimeTypes": { + "terms": {"field": "mime_kw"} + } + } + }) + + return query["aggregations"]["mimeTypes"]["buckets"] + def search(self, query): print(query) diff --git a/static/css/inspire-tree-light.css b/static/css/inspire-tree-light.css new file mode 100644 index 0000000..f245733 --- /dev/null +++ b/static/css/inspire-tree-light.css @@ -0,0 +1,311 @@ +.inspire-tree .btn { + background-color: rgba(255, 255, 255, 0.4); + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 3px; + display: inline-block; + height: 20px; + -webkit-transition: all 150ms linear; + transition: all 150ms linear; + width: 20px; } +.inspire-tree .btn:hover { + -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1); } +.inspire-tree .btn + .btn { + margin-left: 5px; } +.inspire-tree .btn.icon { + position: relative; } +.inspire-tree .btn.icon::before { + display: block; + height: 14px; + left: 50%; + position: absolute; + top: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + width: 14px; } + +.inspire-tree .btn-group { + display: inline-block; + height: 25px; + line-height: 25px; } + +/* ~~@@@~~~~~ Context Menu ~~~~~@@@~~ */ +.itree-menu { + background: #ddd; + border: 1px solid #c4c4c4; + border-radius: 3px; + font-family: sans-serif; + list-style: none; + margin: 0; + min-width: 150px; + padding: 0; + position: absolute; + z-index: 10; } +.itree-menu a { + display: block; + padding: 3px 8px; } +.itree-menu a:hover { + background: rgba(218, 250, 255, 0.5); + color: rgba(164, 234, 245, 0.5); } + +.inspire-tree { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* ~~@@@~~~~~ Lists ~~~~~@@@~~ */ + /* ~~@@@~~~~~ Node Content ~~~~~@@@~~ */ } +.inspire-tree:focus { + outline: none; } +.inspire-tree, .inspire-tree * { + -webkit-box-sizing: border-box; + box-sizing: border-box; } +.inspire-tree ol { + list-style: none; + margin: 0; + padding: 0; } +.inspire-tree ol ol { + padding-left: 20px; } +.inspire-tree .collapsed > ol, .inspire-tree .hidden { + display: none; } +.inspire-tree li > .title-wrap { + min-height: 25px; + position: relative; + z-index: 2; } +.inspire-tree .toggle { + height: 25px; + left: 0; + position: absolute; + top: 0; + width: 25px; + z-index: 2; } +.inspire-tree .toggle::before { + display: block; + left: 50%; + position: absolute; + top: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); } +.inspire-tree [type="checkbox"] { + left: 22px; + position: absolute; + top: 7px; + width: 20px; + z-index: 2; } +.inspire-tree .title { + cursor: default; + display: block; + height: 25px; + line-height: 25px; + overflow: hidden; + padding-left: 42px; + position: relative; + text-overflow: ellipsis; + vertical-align: middle; + white-space: nowrap; + z-index: 1; } +.inspire-tree .title.load-more { + color: #476cb8; + cursor: pointer; } +.inspire-tree .title.load-more:hover { + text-decoration: underline; } +.inspire-tree .title::before { + left: 24px; + position: absolute; + top: 50%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + vertical-align: top; } +.inspire-tree .title:focus { + outline: none; } + +.inspire-tree.drag-and-drop li:not(.drop-target) { + opacity: .5; } + +.drag-targeting.drag-targeting-insert.inspire-tree, +.drag-targeting.drag-targeting-insert > .title-wrap > .title { + border: 1px solid #2dadc5; } + +.drag-targeting.drag-targeting-above > .title-wrap > .title { + border-top: 3px solid #2dadc5; } + +.drag-targeting.drag-targeting-below > .title-wrap > .title { + border-bottom: 3px solid #2dadc5; } + +.inspire-tree .editable form { + display: inline-block; + height: 25px; + line-height: 25px; + padding-top: 2px; } +.inspire-tree .editable form input { + height: 20px; } +.inspire-tree .editable form input, .inspire-tree .editable form .btn { + vertical-align: top; } + +.inspire-tree .editable > .btn-group { + display: none; + padding-top: 2px; + position: absolute; + right: 10px; + z-index: 3; } + +.inspire-tree .editable:hover > .btn-group { + display: block; } + +.inspire-tree input + .btn-group { + margin-left: 10px; } + +.inspire-tree > .btn.icon { + margin-left: 2px; } + +.inspire-tree > ol > .folder:first-child:not(:only-child) { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAMCAYAAACji9dXAAAAFUlEQVQIW2M8d+HSf0YGBgYGRpJZAJ2uFKcp4HfpAAAAAElFTkSuQmCC"); + background-position: 11px 13px; + background-repeat: no-repeat; } + +.inspire-tree .folder:last-child:not(:only-child), .inspire-tree li .folder:last-child { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAMCAYAAACji9dXAAAAFUlEQVQIW2M8d+HSf0YGBgYGRpJZAJ2uFKcp4HfpAAAAAElFTkSuQmCC"); + background-position: 11px 0; + background-repeat: no-repeat; } + +.inspire-tree.editable-add > ol > .folder:last-child:not(:only-child) { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAFUlEQVQIW2M8d+HSf0YGBgYGRrqyABKeKU0SV+t2AAAAAElFTkSuQmCC"); + background-repeat: repeat-y; } + +.inspire-tree > ol .expanded:not(:last-child):not(:first-child), .inspire-tree li:not(:last-child) { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAFUlEQVQIW2M8d+HSf0YGBgYGRrqyABKeKU0SV+t2AAAAAElFTkSuQmCC"); + background-position: 11px 0; + background-repeat: no-repeat; } + +.inspire-tree li.expanded:not(:last-child) > ol { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAFUlEQVQIW2M8d+HSf0YGBgYGRrqyABKeKU0SV+t2AAAAAElFTkSuQmCC"); + background-position: 11px 0; + background-repeat: repeat-y; } + +.inspire-tree li.expanded.folder:not(.loading) > .title-wrap { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAMCAYAAACji9dXAAAAFUlEQVQIW2M8d+HSf0YGBgYGRpJZAJ2uFKcp4HfpAAAAAElFTkSuQmCC"); + background-position: 31px 13px; + background-repeat: no-repeat; } + +.inspire-tree .leaf:not(:last-child):not(.detached) { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAYCAYAAAAh8HdUAAAAN0lEQVQ4T2M8d+HSfyMDPUYGEgBJimHmMo7aBAmK0dCDJgl4ioClDGLo0dBDDz0SMu5o2oMFFgBXbEeI0XwYIwAAAABJRU5ErkJgggAA"); + background-position: 11px 0; + background-repeat: no-repeat; } + +.inspire-tree .leaf:last-child { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAKklEQVQoU2M8d+HSfyMDPUYGEgBJimHmMo7aBAmK0dCDJgl4ioClDGJoAGUZM32Z0U8tAAAAAElFTkSuQmCC"); + background-position: 11px 0; + background-repeat: no-repeat; } + +.inspire-tree .leaf.detached:last-child { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAMCAYAAACji9dXAAAAFUlEQVQIW2M8d+HSf0YGBgYGRpJZAJ2uFKcp4HfpAAAAAElFTkSuQmCC"); + background-position: 11px 0; + background-repeat: no-repeat; } + +.inspire-tree.editable-add > ol > .leaf:last-child { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAYCAYAAAAh8HdUAAAAN0lEQVQ4T2M8d+HSfyMDPUYGEgBJimHmMo7aBAmK0dCDJgl4ioClDGLo0dBDDz0SMu5o2oMFFgBXbEeI0XwYIwAAAABJRU5ErkJgggAA"); } + +.inspire-tree .icon::before { + background-position: 0 0; + background-repeat: no-repeat; + content: ''; + display: inline-block; + height: 14px; + width: 14px; } + +.inspire-tree .icon-check::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%236a6a6a%22%20d%3D%22M27%204l-15%2015-7-7-5%205%2012%2012%2020-20z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .icon-check:hover::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%230ccc0a%22%20d%3D%22M27%204l-15%2015-7-7-5%205%2012%2012%2020-20z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .icon-collapse::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23aaa%22%20d%3D%22M4%201h16q1.242%200%202.121%200.879t0.879%202.121v16q0%201.242-0.879%202.121t-2.121%200.879h-16q-1.242%200-2.121-0.879t-0.879-2.121v-16q0-1.242%200.879-2.121t2.121-0.879zM20%203h-16q-0.414%200-0.707%200.293t-0.293%200.707v16q0%200.414%200.293%200.707t0.707%200.293h16q0.414%200%200.707-0.293t0.293-0.707v-16q0-0.414-0.293-0.707t-0.707-0.293zM8%2011h8q0.414%200%200.707%200.293t0.293%200.707-0.293%200.707-0.707%200.293h-8q-0.414%200-0.707-0.293t-0.293-0.707%200.293-0.707%200.707-0.293z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); + background-color: white; + border-radius: 3px; + margin-left: -1px; } + +.inspire-tree .icon-cross::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%236a6a6a%22%20d%3D%22M31.708%2025.708c-0-0-0-0-0-0l-9.708-9.708%209.708-9.708c0-0%200-0%200-0%200.105-0.105%200.18-0.227%200.229-0.357%200.133-0.356%200.057-0.771-0.229-1.057l-4.586-4.586c-0.286-0.286-0.702-0.361-1.057-0.229-0.13%200.048-0.252%200.124-0.357%200.228%200%200-0%200-0%200l-9.708%209.708-9.708-9.708c-0-0-0-0-0-0-0.105-0.104-0.227-0.18-0.357-0.228-0.356-0.133-0.771-0.057-1.057%200.229l-4.586%204.586c-0.286%200.286-0.361%200.702-0.229%201.057%200.049%200.13%200.124%200.252%200.229%200.357%200%200%200%200%200%200l9.708%209.708-9.708%209.708c-0%200-0%200-0%200-0.104%200.105-0.18%200.227-0.229%200.357-0.133%200.355-0.057%200.771%200.229%201.057l4.586%204.586c0.286%200.286%200.702%200.361%201.057%200.229%200.13-0.049%200.252-0.124%200.357-0.229%200-0%200-0%200-0l9.708-9.708%209.708%209.708c0%200%200%200%200%200%200.105%200.105%200.227%200.18%200.357%200.229%200.356%200.133%200.771%200.057%201.057-0.229l4.586-4.586c0.286-0.286%200.362-0.702%200.229-1.057-0.049-0.13-0.124-0.252-0.229-0.357z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .icon-cross:hover::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23c00%22%20d%3D%22M31.708%2025.708c-0-0-0-0-0-0l-9.708-9.708%209.708-9.708c0-0%200-0%200-0%200.105-0.105%200.18-0.227%200.229-0.357%200.133-0.356%200.057-0.771-0.229-1.057l-4.586-4.586c-0.286-0.286-0.702-0.361-1.057-0.229-0.13%200.048-0.252%200.124-0.357%200.228%200%200-0%200-0%200l-9.708%209.708-9.708-9.708c-0-0-0-0-0-0-0.105-0.104-0.227-0.18-0.357-0.228-0.356-0.133-0.771-0.057-1.057%200.229l-4.586%204.586c-0.286%200.286-0.361%200.702-0.229%201.057%200.049%200.13%200.124%200.252%200.229%200.357%200%200%200%200%200%200l9.708%209.708-9.708%209.708c-0%200-0%200-0%200-0.104%200.105-0.18%200.227-0.229%200.357-0.133%200.355-0.057%200.771%200.229%201.057l4.586%204.586c0.286%200.286%200.702%200.361%201.057%200.229%200.13-0.049%200.252-0.124%200.357-0.229%200-0%200-0%200-0l9.708-9.708%209.708%209.708c0%200%200%200%200%200%200.105%200.105%200.227%200.18%200.357%200.229%200.356%200.133%200.771%200.057%201.057-0.229l4.586-4.586c0.286-0.286%200.362-0.702%200.229-1.057-0.049-0.13-0.124-0.252-0.229-0.357z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .icon-expand::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23aaa%22%20d%3D%22M4%201h16q1.242%200%202.121%200.879t0.879%202.121v16q0%201.242-0.879%202.121t-2.121%200.879h-16q-1.242%200-2.121-0.879t-0.879-2.121v-16q0-1.242%200.879-2.121t2.121-0.879zM20%203h-16q-0.414%200-0.707%200.293t-0.293%200.707v16q0%200.414%200.293%200.707t0.707%200.293h16q0.414%200%200.707-0.293t0.293-0.707v-16q0-0.414-0.293-0.707t-0.707-0.293zM12%207q0.414%200%200.707%200.293t0.293%200.707v3h3q0.414%200%200.707%200.293t0.293%200.707-0.293%200.707-0.707%200.293h-3v3q0%200.414-0.293%200.707t-0.707%200.293-0.707-0.293-0.293-0.707v-3h-3q-0.414%200-0.707-0.293t-0.293-0.707%200.293-0.707%200.707-0.293h3v-3q0-0.414%200.293-0.707t0.707-0.293z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); + background-color: white; + border-radius: 3px; + margin-left: -1px; } + +.inspire-tree .icon-file-empty::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23a5a5a5%22%20d%3D%22M28.681%207.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378%200-2.5%201.121-2.5%202.5v27c0%201.378%201.122%202.5%202.5%202.5h23c1.378%200%202.5-1.122%202.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543%205.457c0.959%200.959%201.712%201.825%202.268%202.543h-4.811v-4.811c0.718%200.556%201.584%201.309%202.543%202.268zM28%2029.5c0%200.271-0.229%200.5-0.5%200.5h-23c-0.271%200-0.5-0.229-0.5-0.5v-27c0-0.271%200.229-0.5%200.5-0.5%200%200%2015.499-0%2015.5%200v7c0%200.552%200.448%201%201%201h7v19.5z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .icon-folder::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%236a6a6a%22%20d%3D%22M14%204l4%204h14v22h-32v-26z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .icon-folder-open::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%236a6a6a%22%20d%3D%22M26%2030l6-16h-26l-6%2016zM4%2012l-4%2018v-26h9l4%204h13v4z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E%0A"); } + +.inspire-tree .icon-minus::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%236a6a6a%22%20d%3D%22M0%2013v6c0%200.552%200.448%201%201%201h30c0.552%200%201-0.448%201-1v-6c0-0.552-0.448-1-1-1h-30c-0.552%200-1%200.448-1%201z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .icon-minus:hover::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23c00%22%20d%3D%22M0%2013v6c0%200.552%200.448%201%201%201h30c0.552%200%201-0.448%201-1v-6c0-0.552-0.448-1-1-1h-30c-0.552%200-1%200.448-1%201z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .icon-more::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%236a6a6a%22%20d%3D%22M12%209.984c1.078%200%202.016%200.938%202.016%202.016s-0.938%202.016-2.016%202.016-2.016-0.938-2.016-2.016%200.938-2.016%202.016-2.016zM18%209.984c1.078%200%202.016%200.938%202.016%202.016s-0.938%202.016-2.016%202.016-2.016-0.938-2.016-2.016%200.938-2.016%202.016-2.016zM6%209.984c1.078%200%202.016%200.938%202.016%202.016s-0.938%202.016-2.016%202.016-2.016-0.938-2.016-2.016%200.938-2.016%202.016-2.016z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .icon-pencil::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%236a6a6a%22%20d%3D%22M27%200c2.761%200%205%202.239%205%205%200%201.126-0.372%202.164-1%203l-2%202-7-7%202-2c0.836-0.628%201.874-1%203-1zM2%2023l-2%209%209-2%2018.5-18.5-7-7-18.5%2018.5zM22.362%2011.362l-14%2014-1.724-1.724%2014-14%201.724%201.724z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E%0A"); } + +.inspire-tree .icon-pencil:hover::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%230ccc0a%22%20d%3D%22M27%200c2.761%200%205%202.239%205%205%200%201.126-0.372%202.164-1%203l-2%202-7-7%202-2c0.836-0.628%201.874-1%203-1zM2%2023l-2%209%209-2%2018.5-18.5-7-7-18.5%2018.5zM22.362%2011.362l-14%2014-1.724-1.724%2014-14%201.724%201.724z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E%0A"); } + +.inspire-tree .icon-plus::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%236a6a6a%22%20d%3D%22M31%2012h-11v-11c0-0.552-0.448-1-1-1h-6c-0.552%200-1%200.448-1%201v11h-11c-0.552%200-1%200.448-1%201v6c0%200.552%200.448%201%201%201h11v11c0%200.552%200.448%201%201%201h6c0.552%200%201-0.448%201-1v-11h11c0.552%200%201-0.448%201-1v-6c0-0.552-0.448-1-1-1z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .icon-plus:hover::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%230ccc0a%22%20d%3D%22M31%2012h-11v-11c0-0.552-0.448-1-1-1h-6c-0.552%200-1%200.448-1%201v11h-11c-0.552%200-1%200.448-1%201v6c0%200.552%200.448%201%201%201h11v11c0%200.552%200.448%201%201%201h6c0.552%200%201-0.448%201-1v-11h11c0.552%200%201-0.448%201-1v-6c0-0.552-0.448-1-1-1z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .selected > .title-wrap .icon-folder::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23179bb9%22%20d%3D%22M14%204l4%204h14v22h-32v-26z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .selected > .title-wrap .icon-folder-open::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23179bb9%22%20d%3D%22M26%2030l6-16h-26l-6%2016zM4%2012l-4%2018v-26h9l4%204h13v4z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E%0A"); } + +.inspire-tree .selected > .title-wrap .icon-file-empty::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23179bb9%22%20d%3D%22M28.681%207.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378%200-2.5%201.121-2.5%202.5v27c0%201.378%201.122%202.5%202.5%202.5h23c1.378%200%202.5-1.122%202.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543%205.457c0.959%200.959%201.712%201.825%202.268%202.543h-4.811v-4.811c0.718%200.556%201.584%201.309%202.543%202.268zM28%2029.5c0%200.271-0.229%200.5-0.5%200.5h-23c-0.271%200-0.5-0.229-0.5-0.5v-27c0-0.271%200.229-0.5%200.5-0.5%200%200%2015.499-0%2015.5%200v7c0%200.552%200.448%201%201%201h7v19.5z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); } + +.inspire-tree .loading > .title-wrap input { + display: none; } + +.inspire-tree .loading > .title-wrap .title::before { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2714px%27%20height%3D%2714px%27%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%20preserveAspectRatio%3D%22xMidYMid%22%20class%3D%22uil-ring%22%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%22100%22%20height%3D%22100%22%20fill%3D%22none%22%20class%3D%22bk%22%3E%3C%2Frect%3E%3Cdefs%3E%3Cfilter%20id%3D%22uil-ring-shadow%22%20x%3D%22-100%25%22%20y%3D%22-100%25%22%20width%3D%22300%25%22%20height%3D%22300%25%22%3E%3CfeOffset%20result%3D%22offOut%22%20in%3D%22SourceGraphic%22%20dx%3D%220%22%20dy%3D%220%22%3E%3C%2FfeOffset%3E%3CfeGaussianBlur%20result%3D%22blurOut%22%20in%3D%22offOut%22%20stdDeviation%3D%220%22%3E%3C%2FfeGaussianBlur%3E%3CfeBlend%20in%3D%22SourceGraphic%22%20in2%3D%22blurOut%22%20mode%3D%22normal%22%3E%3C%2FfeBlend%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cpath%20d%3D%22M10%2C50c0%2C0%2C0%2C0.5%2C0.1%2C1.4c0%2C0.5%2C0.1%2C1%2C0.2%2C1.7c0%2C0.3%2C0.1%2C0.7%2C0.1%2C1.1c0.1%2C0.4%2C0.1%2C0.8%2C0.2%2C1.2c0.2%2C0.8%2C0.3%2C1.8%2C0.5%2C2.8%20c0.3%2C1%2C0.6%2C2.1%2C0.9%2C3.2c0.3%2C1.1%2C0.9%2C2.3%2C1.4%2C3.5c0.5%2C1.2%2C1.2%2C2.4%2C1.8%2C3.7c0.3%2C0.6%2C0.8%2C1.2%2C1.2%2C1.9c0.4%2C0.6%2C0.8%2C1.3%2C1.3%2C1.9%20c1%2C1.2%2C1.9%2C2.6%2C3.1%2C3.7c2.2%2C2.5%2C5%2C4.7%2C7.9%2C6.7c3%2C2%2C6.5%2C3.4%2C10.1%2C4.6c3.6%2C1.1%2C7.5%2C1.5%2C11.2%2C1.6c4-0.1%2C7.7-0.6%2C11.3-1.6%20c3.6-1.2%2C7-2.6%2C10-4.6c3-2%2C5.8-4.2%2C7.9-6.7c1.2-1.2%2C2.1-2.5%2C3.1-3.7c0.5-0.6%2C0.9-1.3%2C1.3-1.9c0.4-0.6%2C0.8-1.3%2C1.2-1.9%20c0.6-1.3%2C1.3-2.5%2C1.8-3.7c0.5-1.2%2C1-2.4%2C1.4-3.5c0.3-1.1%2C0.6-2.2%2C0.9-3.2c0.2-1%2C0.4-1.9%2C0.5-2.8c0.1-0.4%2C0.1-0.8%2C0.2-1.2%20c0-0.4%2C0.1-0.7%2C0.1-1.1c0.1-0.7%2C0.1-1.2%2C0.2-1.7C90%2C50.5%2C90%2C50%2C90%2C50s0%2C0.5%2C0%2C1.4c0%2C0.5%2C0%2C1%2C0%2C1.7c0%2C0.3%2C0%2C0.7%2C0%2C1.1%20c0%2C0.4-0.1%2C0.8-0.1%2C1.2c-0.1%2C0.9-0.2%2C1.8-0.4%2C2.8c-0.2%2C1-0.5%2C2.1-0.7%2C3.3c-0.3%2C1.2-0.8%2C2.4-1.2%2C3.7c-0.2%2C0.7-0.5%2C1.3-0.8%2C1.9%20c-0.3%2C0.7-0.6%2C1.3-0.9%2C2c-0.3%2C0.7-0.7%2C1.3-1.1%2C2c-0.4%2C0.7-0.7%2C1.4-1.2%2C2c-1%2C1.3-1.9%2C2.7-3.1%2C4c-2.2%2C2.7-5%2C5-8.1%2C7.1%20c-0.8%2C0.5-1.6%2C1-2.4%2C1.5c-0.8%2C0.5-1.7%2C0.9-2.6%2C1.3L66%2C87.7l-1.4%2C0.5c-0.9%2C0.3-1.8%2C0.7-2.8%2C1c-3.8%2C1.1-7.9%2C1.7-11.8%2C1.8L47%2C90.8%20c-1%2C0-2-0.2-3-0.3l-1.5-0.2l-0.7-0.1L41.1%2C90c-1-0.3-1.9-0.5-2.9-0.7c-0.9-0.3-1.9-0.7-2.8-1L34%2C87.7l-1.3-0.6%20c-0.9-0.4-1.8-0.8-2.6-1.3c-0.8-0.5-1.6-1-2.4-1.5c-3.1-2.1-5.9-4.5-8.1-7.1c-1.2-1.2-2.1-2.7-3.1-4c-0.5-0.6-0.8-1.4-1.2-2%20c-0.4-0.7-0.8-1.3-1.1-2c-0.3-0.7-0.6-1.3-0.9-2c-0.3-0.7-0.6-1.3-0.8-1.9c-0.4-1.3-0.9-2.5-1.2-3.7c-0.3-1.2-0.5-2.3-0.7-3.3%20c-0.2-1-0.3-2-0.4-2.8c-0.1-0.4-0.1-0.8-0.1-1.2c0-0.4%2C0-0.7%2C0-1.1c0-0.7%2C0-1.2%2C0-1.7C10%2C50.5%2C10%2C50%2C10%2C50z%22%20fill%3D%22%23013138%22%20filter%3D%22url(%23uil-ring-shadow)%22%3E%3CanimateTransform%20attributeName%3D%22transform%22%20type%3D%22rotate%22%20from%3D%220%2050%2050%22%20to%3D%22360%2050%2050%22%20repeatCount%3D%22indefinite%22%20dur%3D%221s%22%3E%3C%2FanimateTransform%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); + content: ''; + height: 14px; + width: 14px; } + +.inspire-tree > ol { + position: relative; } + +.inspire-tree .wholerow { + height: 25px; + left: 0; + margin-top: -25px; + position: absolute; + width: 100%; + z-index: 1; } + +.inspire-tree .focused:not(.selected) > .wholerow { + outline: 1px dotted black; } + +.inspire-tree .title-wrap:hover { + background: rgba(0,0,0,.075); } + +.inspire-tree .selected > .wholerow, +.inspire-tree .selected > .title-wrap:hover + .wholerow { + background: #BBDEFB; } + +.inspire-tree a { + color: #495057; +} \ No newline at end of file diff --git a/static/css/normalize.css b/static/css/normalize.css deleted file mode 100644 index 47b010e..0000000 --- a/static/css/normalize.css +++ /dev/null @@ -1,341 +0,0 @@ -/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ - -/* Document - ========================================================================== */ - -/** - * 1. Correct the line height in all browsers. - * 2. Prevent adjustments of font size after orientation changes in iOS. - */ - -html { - line-height: 1.15; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/* Sections - ========================================================================== */ - -/** - * Remove the margin in all browsers. - */ - -body { - margin: 0; -} - -/** - * Correct the font size and margin on `h1` elements within `section` and - * `article` contexts in Chrome, Firefox, and Safari. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/* Grouping content - ========================================================================== */ - -/** - * 1. Add the correct box sizing in Firefox. - * 2. Show the overflow in Edge and IE. - */ - -hr { - box-sizing: content-box; /* 1 */ - height: 0; /* 1 */ - overflow: visible; /* 2 */ -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -pre { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Remove the gray background on active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * 1. Remove the bottom border in Chrome 57- - * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. - */ - -abbr[title] { - border-bottom: none; /* 1 */ - text-decoration: underline; /* 2 */ - text-decoration: underline dotted; /* 2 */ -} - -/** - * Add the correct font weight in Chrome, Edge, and Safari. - */ - -b, -strong { - font-weight: bolder; -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -code, -kbd, -samp { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/** - * Add the correct font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` elements from affecting the line height in - * all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove the border on images inside links in IE 10. - */ - -img { - border-style: none; -} - -/* Forms - ========================================================================== */ - -/** - * 1. Change the font styles in all browsers. - * 2. Remove the margin in Firefox and Safari. - */ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ -} - -/** - * Show the overflow in IE. - * 1. Show the overflow in Edge. - */ - -button, -input { /* 1 */ - overflow: visible; -} - -/** - * Remove the inheritance of text transform in Edge, Firefox, and IE. - * 1. Remove the inheritance of text transform in Firefox. - */ - -button, -select { /* 1 */ - text-transform: none; -} - -/** - * Correct the inability to style clickable types in iOS and Safari. - */ - -button, -[type="button"], -[type="reset"], -[type="submit"] { - -webkit-appearance: button; -} - -/** - * Remove the inner border and padding in Firefox. - */ - -button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0; -} - -/** - * Restore the focus styles unset by the previous rule. - */ - -button:-moz-focusring, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { - outline: 1px dotted ButtonText; -} - -/** - * Correct the padding in Firefox. - */ - -fieldset { - padding: 0.35em 0.75em 0.625em; -} - -/** - * 1. Correct the text wrapping in Edge and IE. - * 2. Correct the color inheritance from `fieldset` elements in IE. - * 3. Remove the padding so developers are not caught out when they zero out - * `fieldset` elements in all browsers. - */ - -legend { - box-sizing: border-box; /* 1 */ - color: inherit; /* 2 */ - display: table; /* 1 */ - max-width: 100%; /* 1 */ - padding: 0; /* 3 */ - white-space: normal; /* 1 */ -} - -/** - * Add the correct vertical alignment in Chrome, Firefox, and Opera. - */ - -progress { - vertical-align: baseline; -} - -/** - * Remove the default vertical scrollbar in IE 10+. - */ - -textarea { - overflow: auto; -} - -/** - * 1. Add the correct box sizing in IE 10. - * 2. Remove the padding in IE 10. - */ - -[type="checkbox"], -[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Correct the cursor style of increment and decrement buttons in Chrome. - */ - -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Correct the odd appearance in Chrome and Safari. - * 2. Correct the outline style in Safari. - */ - -[type="search"] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/** - * Remove the inner padding in Chrome and Safari on macOS. - */ - -[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * 1. Correct the inability to style clickable types in iOS and Safari. - * 2. Change font properties to `inherit` in Safari. - */ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* Interactive - ========================================================================== */ - -/* - * Add the correct display in Edge, IE 10+, and Firefox. - */ - -details { - display: block; -} - -/* - * Add the correct display in all browsers. - */ - -summary { - display: list-item; -} - -/* Misc - ========================================================================== */ - -/** - * Add the correct display in IE 10+. - */ - -template { - display: none; -} - -/** - * Add the correct display in IE 10. - */ - -[hidden] { - display: none; -} diff --git a/static/js/inspire-tree-dom.min.js b/static/js/inspire-tree-dom.min.js new file mode 100644 index 0000000..019919e --- /dev/null +++ b/static/js/inspire-tree-dom.min.js @@ -0,0 +1,8 @@ +/* Inspire Tree DOM + * @version 4.0.3 + * https://github.com/helion3/inspire-tree-dom + * @copyright Copyright 2015 Helion3, and other contributors + * @license Licensed under MIT + * see https://github.com/helion3/inspire-tree-dom/blob/master/LICENSE + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("lodash"),require("inspire-tree")):"function"==typeof define&&define.amd?define(["lodash","inspire-tree"],t):e.InspireTreeDOM=t(e._,e.InspireTree)}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return t={exports:{}},e(t,t.exports),t.exports}function o(t,n){var r=n.dirty||!1;return r||e.each(Object.keys(n),function(e){if("dirty"!==e&&n[e]!==t[e])return r=!0,!1}),r}t=t&&t.hasOwnProperty("default")?t.default:t;var i=r(function(e,t){function n(e){return!c(e.prototype)&&!c(e.prototype.render)}function r(e){var t=typeof e;return"string"===t||"number"===t}function o(e){return c(e)||s(e)}function i(e){return s(e)||!1===e||u(e)||c(e)}function a(e){return"function"==typeof e}function d(e){return"string"==typeof e}function l(e){return"number"==typeof e}function s(e){return null===e}function u(e){return!0===e}function c(e){return void 0===e}function p(e){return"object"==typeof e}function f(e){throw e||(e=st),new Error("Inferno Error: "+e)}function h(e,t){var n={};if(e)for(var r in e)n[r]=e[r];if(t)for(var o in t)n[o]=t[o];return n}function v(){this.listeners=[]}function g(e,t,n,r){var o=xt.get(e);if(n)o||((o={items:new Map,docEvent:null}).docEvent=_(e,o),xt.set(e,o)),t||Nt&&"onClick"===e&&N(r),o.items.set(r,n);else if(o){var i=o.items;i.delete(r)&&0===i.size&&(document.removeEventListener(y(e),o.docEvent),xt.delete(e))}}function m(e,t,n,r,o,i){for(var a=t;r>0;){if(o&&a.disabled)return;var d=n.get(a);if(d&&(r--,i.dom=a,d.event?d.event(d.data,e):d(e),e.cancelBubble))return;if(null===(a=a.parentNode))return}}function y(e){return e.substr(2).toLowerCase()}function b(){this.cancelBubble=!0,this.stopImmediatePropagation()}function _(e,t){var n=function(e){var n=t.items.size;if(n>0){e.stopPropagation=b;var r={dom:document};try{Object.defineProperty(e,"currentTarget",{configurable:!0,get:function(){return r.dom}})}catch(e){}m(e,e.target,t.items,n,"click"===e.type,r)}};return document.addEventListener(y(e),n),n}function k(){}function N(e){e.onclick=k}function x(e){return"checkbox"===e||"radio"===e}function C(e){var t=this.vNode,n=t.props||Mt,r=t.dom,o=n.value;if(n.onInput){var i=n.onInput;i.event?i.event(i.data,e):i(e)}else n.oninput&&n.oninput(e);var a=this.vNode.props||Mt;o!==a.value&&O(a,r)}function w(e){var t=(this.vNode.props||Mt).onChange;t.event?t.event(t.data,e):t(e)}function D(e){e.stopPropagation();var t=this.vNode,n=t.props||Mt,r=t.dom;if(n.onClick){var o=n.onClick;o.event?o.event(o.data,e):o(e)}else n.onclick&&n.onclick(e);O(this.vNode.props||Mt,r)}function S(e,t,n,r,o){O(n,t),o&&(t.vNode=e,r&&(x(n.type)?(t.onclick=D,t.onclick.wrapped=!0):(t.oninput=C,t.oninput.wrapped=!0),n.onChange&&(t.onchange=w,t.onchange.wrapped=!0)))}function O(e,t){var n=e.type,r=e.value,i=e.checked,a=e.multiple,d=e.defaultValue,l=!o(r);n&&n!==t.type&&t.setAttribute("type",n),a&&a!==t.multiple&&(t.multiple=a),o(d)||l||(t.defaultValue=d+""),x(n)?(l&&(t.value=r),o(i)||(t.checked=i)):l&&t.value!==r?(t.defaultValue=r,t.value=r):o(i)||(t.checked=i)}function M(e,t){if("optgroup"===e.type){var n=e.children;if(ct(n))for(var r=0,o=n.length;r0?S(t,n,r,o,i):(2048&e)>0?P(t,n,r,o,i):(1024&e)>0&&A(t,n,r,o,i)}function j(e){return e.type&&x(e.type)?!o(e.checked):!o(e.value)}function F(e){for(var t=e.firstChild;t;)if(8===t.nodeType)if("!"===t.data){var n=document.createTextNode("");e.replaceChild(n,t),t=t.nextSibling}else{var r=t.previousSibling;e.removeChild(t),t=r||e.firstChild}else t=t.nextSibling}function $(e,t,n,r,o,i){var a=e.type,d=e.ref,l=e.props||Mt;if(i){var s=t.namespaceURI===vt,u=Me(e,a,l,r,s,n),c=u._lastInput;u._vNode=e,q(c,t,n,u._childContext,s),e.dom=c.dom,De(e,d,u,n),u._updating=!1,pt.findDOMNodeEnabled&&Dt.set(u,t)}else{var p=Pe(e,a,l,r);q(p,t,n,r,o),e.children=p,e.dom=p.dom,Se(l,d,t,n)}return t}function W(e,t,n,r,a){var d=e.children,l=e.props,s=e.className,u=e.flags,c=e.ref;if(a=a||(128&u)>0,1!==t.nodeType||t.tagName.toLowerCase()!==e.type){var p=xe(e,null,n,r,a);return e.dom=p,je(t.parentNode,p,t),p}if(e.dom=t,i(d)?null===t.firstChild||Ke(t,l)||(t.textContent=""):B(d,t,n,r,a),l){var f=!1,h=(3584&u)>0;h&&(f=j(l));for(var v in l)ge(v,null,l[v],t,a,f);h&&R(u,e,t,l,!0,f)}return o(s)?""!==t.className&&t.removeAttribute("class"):a?t.setAttribute("class",s):t.className=s,c&&Oe(t,c,n),t}function B(e,t,n,o,i){F(t);var a=t.firstChild;if(r(e))s(a)||3!==a.nodeType?""===e?t.appendChild(document.createTextNode("")):t.textContent=e:a.nodeValue!==e&&(a.nodeValue=e),s(a)||(a=a.nextSibling);else if(ct(e))for(var d=0,l=e.length;d0):3970&i?W(e,t,n,r,o):1&i?H(e,t):4096&i?K(e,t):f()}function z(e,t,n){if(!s(t)){var r=t.firstChild;if(!s(r)){for(q(e,r,n,Mt,!1),r=t.firstChild;r=r.nextSibling;)t.removeChild(r);return!0}}return!1}function G(e,t,n,r){var o=e.type,i=wt.get(o);if(!c(i)){var a=e.key,d=null===a?i.nonKeyed:i.keyed.get(a);if(!c(d)){var l=d.pop();if(!c(l))return de(l,e,null,t,n,r,!0),e.dom}}return null}function Y(e){var t=e.type,n=e.key,r=wt.get(t);if(c(r)&&(r={keyed:new Map,nonKeyed:[]},wt.set(t,r)),s(n))r.nonKeyed.push(e);else{var o=r.keyed.get(n);c(o)&&(o=[],r.keyed.set(n,o)),o.push(e)}}function J(e,t,n,r){var o=e.type,i=Ct.get(o);if(!c(i)){var a=e.key,d=null===a?i.nonKeyed:i.keyed.get(a);if(!c(d)){var l=d.pop();if(!c(l)&&!se(l,e,null,t,n,r,(4&e.flags)>0,!0))return e.dom}}return null}function Q(e){var t=e.ref;if(!(t&&(t.onComponentWillMount||t.onComponentWillUnmount||t.onComponentDidMount||t.onComponentWillUpdate||t.onComponentDidUpdate))){var n=e.type,r=e.key,o=Ct.get(n);if(c(o)&&(o={keyed:new Map,nonKeyed:[]},Ct.set(n,o)),s(r))o.nonKeyed.push(e);else{var i=o.keyed.get(r);c(i)&&(i=[],o.keyed.set(r,i)),i.push(e)}}}function X(e,t,n,r,d){var l=e.flags,u=e.dom;if(28&l){var f=e.children,h=(4&l)>0,v=e.props||Mt,g=e.ref;d||(h?f._unmounted||(s(pt.beforeUnmount)||pt.beforeUnmount(e),c(f.componentWillUnmount)||f.componentWillUnmount(),g&&!d&&g(null),f._unmounted=!0,pt.findDOMNodeEnabled&&Dt.delete(f),X(f._lastInput,null,f._lifecycle,!1,d)):(o(g)||o(g.onComponentWillUnmount)||g.onComponentWillUnmount(u,v),X(f,null,n,!1,d))),pt.recyclingEnabled&&!h&&(t||r)&&Q(e)}else if(3970&l){var m=e.ref,y=e.props;!d&&a(m)&&m(null);var b=e.children;if(!o(b))if(ct(b))for(var _=0,k=b.length;_0;28&d?se(e,t,n,r,o,i,s,a):Ee(n,we(t,null,r,o,i,s),e,r,a)}else 3970&l?3970&d?de(e,t,n,r,o,i,a):Ee(n,xe(t,null,r,o,i),e,r,a):1&l?1&d?ue(e,t):Ee(n,ke(t,null),e,r,a):4096&l?4096&d?ce(e,t):Ee(n,Ne(t,null),e,r,a):Te(e,t,n,r,o,i,a)}}function ae(e,t,n,r){Qe(e)?X(e,t,n,!0,r):ct(e)?$e(t,e,n,r):t.textContent=""}function de(e,t,n,r,i,a,d){var l=t.type;if(e.type!==l)Re(e,t,n,r,i,a,d);else{var s=e.dom,u=e.props,c=t.props,p=e.children,f=t.children,h=e.flags,v=t.flags,g=t.ref,m=e.className,y=t.className;if(t.dom=s,a=a||(128&v)>0,p!==f&&le(h,v,p,f,s,r,i,!0===a&&"foreignObject"!==t.type,d),u!==c){var b=u||Mt,_=c||Mt,k=!1;if(_!==Mt){var N=(3584&v)>0;N&&(k=j(_));for(var x in _){var C=_[x];ge(x,b[x],C,s,a,k)}N&&R(v,t,s,_,d,k)}if(b!==Mt)for(var w in b)o(_[w])&&!o(b[w])&&be(w,b[w],s,v)}m!==y&&(o(y)?s.removeAttribute("class"):a?s.setAttribute("class",y):s.className=y),g&&(e.ref!==g||d)&&Oe(s,g,r)}}function le(e,t,n,o,a,d,l,s,u){var c=!1,p=!1;if(64&t?c=!0:(32&e)>0&&(32&t)>0?(p=!0,c=!0):i(o)?ae(n,a,d,u):i(n)?r(o)?Le(a,o):ct(o)?Ce(o,a,d,l,s):_e(o,a,d,l,s):r(o)?r(n)?Ve(a,o):(ae(n,a,d,u),Le(a,o)):ct(o)?ct(n)?(c=!0,Be(n,o)&&(p=!0)):(ae(n,a,d,u),Ce(o,a,d,l,s)):ct(n)?($e(a,n,d,u),_e(o,a,d,l,s)):Qe(o)&&(Qe(n)?ie(n,o,a,d,l,s,u):(ae(n,a,d,u),_e(o,a,d,l,s))),c){var f=n.length,h=o.length;0===f?h>0&&Ce(o,a,d,l,s):0===h?$e(a,n,d,u):p?fe(n,o,a,d,l,s,u,f,h):pe(n,o,a,d,l,s,u,f,h)}}function se(e,t,n,a,d,l,u,v){var g=e.type,m=t.type,y=e.key,b=t.key;if(g!==m||y!==b)return Re(e,t,n,a,d,l,v),!1;var _=t.props||Mt;if(u){var k=e.children;if(k._updating=!0,k._unmounted){if(s(n))return!0;je(n,we(t,null,a,d,l,(4&t.flags)>0),e.dom)}else{var N=!c(k.componentDidUpdate),x=k.state,C=N?h(x,null):x,w=k.props;t.children=k,k._isSVG=l;var D=k._lastInput,S=k._updateComponent(C,x,w,_,d,!1,!1);if(k._unmounted)return!1;var O,M=!0;o(k.getChildContext)||(O=k.getChildContext()),O=o(O)?d:h(d,O),k._childContext=O,i(S)?S=Ye():S===lt?(S=D,M=!1):r(S)?S=Je(S,null):ct(S)?f():p(S)&&(s(S.dom)||(S=ze(S))),28&S.flags?S.parentVNode=t:28&D.flags&&(D.parentVNode=t),k._lastInput=S,k._vNode=t,M&&(ie(D,S,n,a,O,l,v),N&&k.componentDidUpdate&&k.componentDidUpdate(w,C),s(pt.afterUpdate)||pt.afterUpdate(t),pt.findDOMNodeEnabled&&Dt.set(k,S.dom)),t.dom=S.dom}k._updating=!1}else{var T=!0,E=e.props,P=t.ref,L=!o(P),V=e.children,I=V;t.dom=e.dom,t.children=V,y!==b?T=!0:L&&!o(P.onComponentShouldUpdate)&&(T=P.onComponentShouldUpdate(E,_)),!1!==T&&(L&&!o(P.onComponentWillUpdate)&&P.onComponentWillUpdate(E,_),i(I=m(_,d))?I=Ye():r(I)&&I!==lt?I=Je(I,null):ct(I)?f():p(I)&&(s(I.dom)||(I=ze(I))),I!==lt&&(ie(V,I,n,a,d,l,v),t.children=I,L&&!o(P.onComponentDidUpdate)&&P.onComponentDidUpdate(E,_),t.dom=I.dom)),28&I.flags?I.parentVNode=t:28&V.flags&&(V.parentVNode=t)}return!1}function ue(e,t){var n=t.children,r=e.dom;t.dom=r,e.children!==n&&(r.nodeValue=n)}function ce(e,t){t.dom=e.dom}function pe(e,t,n,r,o,i,a,d,l){for(var s=d>l?l:d,u=0;ul)for(u=s;uy||k>b)break e;N=e[_],(x=t[k]).dom&&(t[k]=x=ze(x))}for(;C.key===w.key;){if(ie(C,w,n,r,o,i,a),y--,b--,_>y||k>b)break e;C=e[y],(w=t[b]).dom&&(t[b]=w=ze(w))}}if(_>y){if(k<=b)for(v=(g=b+1)b)for(;_<=y;)X(e[_++],n,r,!1,a);else{var D=y-_+1,S=b-k+1,O=new Array(S);for(u=0;up?M=!0:T=p,h.dom&&(t[p]=h=ze(h)),ie(f,h,n,r,o,i,a),E++,e[u]=null;break}}else{var P=new Map;for(u=k;u<=b;u++)P.set(t[u].key,u);for(u=_;u<=y;u++)f=e[u],Ep?M=!0:T=p,h.dom&&(t[p]=h=ze(h)),ie(f,h,n,r,o,i,a),E++,e[u]=null))}if(D===d&&0===E)for($e(n,e,r,a);k0;)s(f=e[_++])||(X(f,n,r,!0,a),u--);if(M){var L=he(O);for(p=L.length-1,u=S-1;u>=0;u--)-1===O[u]?((m=t[T=u+k]).dom&&(t[T]=m=ze(m)),g=T+1,Ae(n,_e(m,null,r,o,i),g=0;u--)-1===O[u]&&((m=t[T=u+k]).dom&&(t[T]=m=ze(m)),g=T+1,Ae(n,_e(m,null,r,o,i),g0&&(a[t]=d[r-1]),d[r]=t)}}for(o=d[(r=d.length)-1];r-- >0;)d[r]=o,o=a[o];return d}function ve(e){return"o"===e[0]&&"n"===e[1]}function ge(e,t,n,r,i,a){if(t!==n){if(_t.has(e)||a&&"value"===e)return;if(mt.has(e))r[e="autoFocus"===e?e.toLowerCase():e]=!!n;else if(gt.has(e)){var d=o(n)?"":n;r[e]!==d&&(r[e]=d)}else if(ve(e))me(e,t,n,r);else if(o(n))r.removeAttribute(e);else if("style"===e)ye(t,n,r);else if("dangerouslySetInnerHTML"===e){var l=t&&t.__html,s=n&&n.__html;l!==s&&(o(s)||He(r,s)||(r.innerHTML=s))}else i&&yt.has(e)?r.setAttributeNS(yt.get(e),e,n):r.setAttribute(e,n)}}function me(e,t,n,r){if(t!==n)if(kt.has(e))g(e,t,n,r);else{var i=e.toLowerCase(),d=r[i];if(d&&d.wrapped)return;if(a(n)||o(n))r[i]=n;else{var l=n.event;l&&a(l)?r[i]=function(e){l(n.data,e)}:f()}}}function ye(e,t,n){var r,i,a=n.style;if(d(t))a.cssText=t;else if(o(e)||d(e))for(r in t)i=t[r],a[r]=!l(i)||bt.has(r)?i:i+"px";else{for(r in t)(i=t[r])!==e[r]&&(a[r]=!l(i)||bt.has(r)?i:i+"px");for(r in e)o(t[r])&&(a[r]="")}}function be(e,t,n,r){"value"===e?n.value=2048&r?null:"":"style"===e?n.removeAttribute("style"):ve(e)?g(e,t,null,n):n.removeAttribute(e)}function _e(e,t,n,r,o){var i=e.flags;return 3970&i?xe(e,t,n,r,o):28&i?we(e,t,n,r,o,(4&i)>0):4096&i?Ne(e,t):1&i?ke(e,t):void f()}function ke(e,t){var n=document.createTextNode(e.children);return e.dom=n,s(t)||Ie(t,n),n}function Ne(e,t){var n=document.createTextNode("");return e.dom=n,s(t)||Ie(t,n),n}function xe(e,t,n,o,a){var d;if(pt.recyclingEnabled&&(d=G(e,n,o,a),!s(d)))return s(t)||Ie(t,d),d;var l=e.flags;a=a||(128&l)>0,d=Ue(e.type,a);var u=e.children,c=e.props,p=e.className,f=e.ref;if(e.dom=d,!i(u))if(r(u))Le(d,u);else{var h=!0===a&&"foreignObject"!==e.type;ct(u)?Ce(u,d,n,o,h):Qe(u)&&_e(u,d,n,o,h)}if(!s(c)){var v=!1,g=(3584&l)>0;g&&(v=j(c));for(var m in c)ge(m,null,c[m],d,a,v);g&&R(l,e,d,c,!0,v)}return null!==p&&(a?d.setAttribute("class",p):d.className=p),s(f)||Oe(d,f,n),s(t)||Ie(t,d),d}function Ce(e,t,n,r,o){for(var a=0,d=e.length;a0&&!o(t[0])&&!o(t[0].key)&&e.length>0&&!o(e[0])&&!o(e[0].key)}function He(e,t){var n=document.createElement("i");return n.innerHTML=t,n.innerHTML===e.innerHTML}function Ke(e,t){return Boolean(t&&t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html&&He(e,t.dangerouslySetInnerHTML.__html))}function qe(e,t,r,o,i,a,d,l){16&e&&(e=n(t)?4:8);var s={children:void 0===o?null:o,className:void 0===r?null:r,dom:null,flags:e,key:void 0===a?null:a,props:void 0===i?null:i,ref:void 0===d?null:d,type:t};return!0!==l&&at(s),null!==pt.createVNode&&pt.createVNode(s),s}function ze(e){var t,n=e.flags;if(28&n){var o,a=e.props;if(s(a))o=Mt;else{o={};for(var d in a)o[d]=a[d]}var l=(t=qe(n,e.type,null,null,o,e.key,e.ref,!0)).props,u=l.children;if(u)if(ct(u)){var c=u.length;if(c>0){for(var p=[],f=0;f0;)n[o]=arguments[o+2];var a=n,d=n.length;d>0&&!c(n[0])&&(t||(t={}),1===d&&(a=n[0]),c(a)||(t.children=a));var l;if(ct(e)){for(var s=[],u=0,p=e.length;u0){for(var k=[],N=0;N<_;N++){var x=b[N];r(x)?k.push(x):!i(x)&&Qe(x)&&k.push(ze(x))}y.children=k}}else Qe(b)&&(y.children=ze(b))}l.children=null}else 3970&f?(a=t&&!c(t.children)?t.children:e.children,l=qe(f,e.type,v,a,e.props||t?h(e.props,t):Mt,g,m,!1)):1&f&&(l=Je(e.children,g))}return l}function Ye(){return qe(4096,null)}function Je(e,t){return qe(1,null,null,e,null,t)}function Qe(e){return!!e.flags}function Xe(e,t){return t.key=e,t}function Ze(e,t){return l(e)&&(e="."+e),s(t.key)||"."===t.key[0]?Xe(e,t):t}function et(e,t){return t.key=e+t.key,t}function tt(e,t,n,o){for(var a=e.length;n0&&(N.dom=D)}else e.state=e._pendingState,e._pendingState=null;i(l)&&l.call(e)}}Object.defineProperty(t,"__esModule",{value:!0});var g="$NO_OP",m="a runtime error occured! Use Inferno in development environment to find the error.",y=Array.isArray;p.prototype.addListener=function(e){this.listeners.push(e)},p.prototype.trigger=function(){for(var e,t=this.listeners;e=t.shift();)e()};var b=new Map,_=Promise.resolve(),k=function(e,t){this.state=null,this._blockRender=!1,this._blockSetState=!0,this._pendingSetState=!1,this._pendingState=null,this._lastInput=null,this._vNode=null,this._unmounted=!1,this._lifecycle=null,this._childContext=null,this._isSVG=!1,this._updating=!0,this.props=e||a.EMPTY_OBJ,this.context=t||a.EMPTY_OBJ};k.prototype.forceUpdate=function(e){this._unmounted||v(this,!0,e)},k.prototype.setState=function(e,t){this._unmounted||(this._blockSetState?u():h(this,e,t))},k.prototype._updateComponent=function(e,t,n,o,i,d,l){if(!0===this._unmounted&&u(),n!==o||o===a.EMPTY_OBJ||e!==t||d){if(n!==o||o===a.EMPTY_OBJ){if(!r(this.componentWillReceiveProps)&&!l){if(this._blockRender=!0,this.componentWillReceiveProps(o,i),this._unmounted)return g;this._blockRender=!1}this._pendingSetState&&(t=c(t,this._pendingState),this._pendingSetState=!1,this._pendingState=null)}if(d||r(this.shouldComponentUpdate)||this.shouldComponentUpdate&&this.shouldComponentUpdate(o,t,i)){r(this.componentWillUpdate)||(this._blockSetState=!0,this.componentWillUpdate(o,t,i),this._blockSetState=!1),this.props=o,this.state=t,this.context=i,a.options.beforeRender&&a.options.beforeRender(this);var s=this.render(o,t,i);return a.options.afterRender&&a.options.afterRender(this),s}this.props=o,this.state=t,this.context=i}return g},k.prototype.render=function(e,t,n){},t.default=k});n(l);var s=r(function(e){e.exports=l.default,e.exports.default=e.exports}),u=(function(){function e(e){this.value=e}function t(t){function n(e,t){return new Promise(function(n,o){var d={key:e,arg:t,resolve:n,reject:o,next:null};a?a=a.next=d:(i=a=d,r(e,t))})}function r(n,i){try{var a=t[n](i),d=a.value;d instanceof e?Promise.resolve(d.value).then(function(e){r("next",e)},function(e){r("throw",e)}):o(a.done?"return":"normal",a.value)}catch(e){o("throw",e)}}function o(e,t){switch(e){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}(i=i.next)?r(i.key,i.arg):a=null}var i,a;this._invoke=n,"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),c=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"li",r=t.itree[n].attributes,o=[],i=r.class||r.className;return e.isFunction(i)&&(i=i(t)),e.isEmpty(i)||(e.isString(i)?o=o.concat(i.split(/[\s\.]+/)):e.isArray(i)&&(o=o.concat(i))),o},y=a.createVNode,b=function(e){function t(){return u(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,e),c(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"add",value:function(e){e.stopPropagation(),this.props.node.addChild({text:"New Node",itree:{state:{editing:!0,focused:!0}}}),this.props.node.expand()}},{key:"edit",value:function(e){e.stopPropagation(),this.props.node.toggleEditing()}},{key:"remove",value:function(e){e.stopPropagation(),this.props.node.remove()}},{key:"render",value:function(){var e=[];return this.props.dom._tree.config.editing.edit&&e.push(y(2,"a","btn icon icon-pencil",null,{onclick:this.edit.bind(this),title:"Edit this node"})),this.props.dom._tree.config.editing.add&&e.push(y(2,"a","btn icon icon-plus",null,{onclick:this.add.bind(this),title:"Add a child node"})),this.props.dom._tree.config.editing.remove&&e.push(y(2,"a","btn icon icon-minus",null,{onclick:this.remove.bind(this),title:"Remove this node"})),y(2,"span","btn-group",e)}}]),t}(s),k=a.createVNode,N=function(e){function t(){return u(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,e),c(t,[{key:"render",value:function(){return k(2,"ol",null,k(2,"li","leaf",k(2,"span","title icon icon-file-empty empty",this.props.text)))}}]),t}(s),x=a.createVNode,C=function(e){function t(e){u(this,t);var n=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state=n.getStateFromNodes(e.node),n}return f(t,e),c(t,[{key:"getStateFromNodes",value:function(e){return{text:e.text}}},{key:"componentWillReceiveProps",value:function(e){this.setState(this.getStateFromNodes(e.node))}},{key:"shouldComponentUpdate",value:function(e,t){return o(this.state,t)}},{key:"click",value:function(e){var t=this,n=function(){t.props.node.toggleCheck()};this.props.dom._tree.emit("node.click",e,this.props.node,n),e.treeDefaultPrevented||n()}},{key:"keypress",value:function(e){if(12===e.which)return this.save()}},{key:"input",value:function(e){this.setState({text:e.target.value})}},{key:"cancel",value:function(e){e&&e.stopPropagation(),this.props.node.toggleEditing()}},{key:"save",value:function(e){e&&e.stopPropagation();var t=this.props.node.text,n=this.ref.value;this.props.node.set("text",n),this.props.node.state("editing",!1),this.props.node.markDirty(),this.props.dom._tree.applyChanges(),t!==n&&this.props.dom._tree.emit("node.edited",this.props.node,t,n)}},{key:"render",value:function(){var e=this;return x(2,"form",null,[x(512,"input",null,null,{onClick:function(e){return e.stopPropagation},onInput:this.input.bind(this),onKeyPress:this.keypress.bind(this),value:this.state.text},null,function(t){return e.ref=t}),x(2,"span","btn-group",[x(2,"button","btn icon icon-check",null,{onClick:this.save.bind(this),title:"Save",type:"button"}),x(2,"button","btn icon icon-cross",null,{onClick:this.cancel.bind(this),title:"Cancel",type:"button"})])],{onsubmit:function(e){return e.preventDefault}})}}]),t}(s),w=a.createVNode,D=function(e){function t(){return u(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,e),c(t,[{key:"blur",value:function(){this.props.node.blur()}},{key:"click",value:function(e){var t=this,n=this.props,r=n.node,o=n.dom,i=function(){if(e.preventDefault(),!t.props.editing){if((e.metaKey||e.ctrlKey||e.shiftKey)&&o._tree.disableDeselection(),e.shiftKey){o.clearSelection();var n=o._tree.lastSelectedNode();n&&o._tree.selectBetween.apply(o._tree,o._tree.boundingNodes(n,r))}r.selected()?o._tree.config.selection.disableDirectDeselection||r.deselect():r.select(),o._tree.enableDeselection()}};o._tree.emit("node.click",e,r,i),e.treeDefaultPrevented||i()}},{key:"contextMenu",value:function(e){var t=this.props,n=t.node;t.dom._tree.emit("node.contextmenu",e,n)}},{key:"dblclick",value:function(e){var t=this.props,n=t.node,r=t.dom,o=function(){r.clearSelection(),n.toggleCollapse()};r._tree.emit("node.dblclick",e,n,o),e.treeDefaultPrevented||o()}},{key:"focus",value:function(e){this.props.node.focus(e)}},{key:"mousedown",value:function(){this.props.dom.isDragDropEnabled&&(this.props.dom.isMouseHeld=!0)}},{key:"render",value:function(){var e=this.props.node,t=_.clone(e.itree.a.attributes)||{};t.tabindex=1,t.unselectable="on";var n=m(e,"a").concat(["title","icon"]);if(!this.props.dom.config.showCheckboxes){var r=this.props.expanded?"icon-folder-open":"icon-folder";n.push(e.itree.icon||(this.props.hasOrWillHaveChildren?r:"icon-file-empty"))}t.className=n.join(" ");var o=e.text;return e.editing()&&(o=w(16,C,null,null,{dom:this.props.dom,node:this.props.node})),w(2,"a",null,o,p({"data-uid":e.id,onBlur:this.blur.bind(this),onClick:this.click.bind(this),onContextMenu:this.contextMenu.bind(this),onDblClick:this.dblclick.bind(this),onFocus:this.focus.bind(this),onMouseDown:this.mousedown.bind(this)},t))}}]),t}(s),S=a.createVNode,O=function(e){function t(){return u(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,e),c(t,[{key:"className",value:function(){return"toggle icon "+(this.props.collapsed?"icon-expand":"icon-collapse")}},{key:"render",value:function(){return S(2,"a",this.className(),null,{onClick:this.props.node.toggleCollapse.bind(this.props.node)})}}]),t}(s),M=a.createVNode,T=function(e){function n(e){u(this,n);var t=h(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state=t.stateFromNode(e.node),t}return f(n,e),c(n,[{key:"stateFromNode",value:function(e){return{dirty:e.itree.dirty}}},{key:"componentWillReceiveProps",value:function(e){this.setState(this.stateFromNode(e.node))}},{key:"shouldComponentUpdate",value:function(e,t){return t.dirty}},{key:"getAttributes",value:function(){var e=this.props.node,t=_.clone(e.itree.li.attributes)||{};return t.className=this.getClassNames(),t["data-uid"]=e.id,this.props.dom.config.dragAndDrop.enabled&&(t.draggable=e.state("draggable"),t.onDragEnd=this.onDragEnd.bind(this),t.onDragEnter=this.onDragEnter.bind(this),t.onDragLeave=this.onDragLeave.bind(this),t.onDragStart=this.onDragStart.bind(this),e.state("drop-target")?(t.onDragOver=this.onDragOver.bind(this),t.onDrop=this.onDrop.bind(this)):(t.onDragOver=null,t.onDrop=null)),t}},{key:"getClassNames",value:function(){var e=this.props.node,t=e.itree.state,n=m(e);return _.each(Object.keys(t),function(e){t[e]&&n.push(e)}),!e.hidden()&&e.removed()&&n.push("hidden"),e.expanded()&&n.push("expanded"),n.push(e.hasOrWillHaveChildren()?"folder":"leaf"),n.join(" ")}},{key:"getTargetDirection",value:function(e,t){var n=e.clientY,r=t.getBoundingClientRect(),o=r.top+r.height/3,i=r.bottom-r.height/3,a=0;return n<=o?a=-1:n>=i&&(a=1),a}},{key:"onDragStart",value:function(e){e.stopPropagation(),e.dataTransfer.effectAllowed="move",e.dataTransfer.dropEffect="move";var n=this.props.node;if(this.props.dom._activeDragNode=n,e.dataTransfer.setData("treeId",n.tree().id),e.dataTransfer.setData("nodeId",n.id),n.state("drop-target",!1),n.hasChildren()&&n.children.stateDeep("drop-target",!1),"dragstart"===this.props.dom.config.dragAndDrop.validateOn){var r=this.props.dom.config.dragAndDrop.validate,o=_.isFunction(r);this.props.dom._tree.batch(),function e(n,r){t.isTreeNodes(n)?_.each(n,function(t){e(t,r)}):t.isTreeNode(n)&&!1!==r(n)&&n.hasChildren()&&e(n.children,r)}(this.props.dom._tree.model,function(e){var t=e.id!==n.id;return t&&(t=!e.hasAncestor(n)),t&&o&&(t=r(n,e)),e.state("drop-target",t),t}),this.props.dom._tree.end()}this.props.dom._tree.emit("node.dragstart",e)}},{key:"onDragEnd",value:function(e){e.preventDefault(),e.stopPropagation(),this.unhighlightTarget(),this.props.dom._tree.emit("node.dragend",e)}},{key:"onDragEnter",value:function(e){e.preventDefault(),e.stopPropagation(),this.props.node.recurseUp(this.unhighlightTarget),this.props.node.state("drag-targeting",!0),this.props.dom._tree.emit("node.dragenter",e)}},{key:"onDragLeave",value:function(e){e.preventDefault(),e.stopPropagation(),this.unhighlightTarget(),this.props.dom._tree.emit("node.dragleave",e)}},{key:"onDragOver",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.props.dom._activeDragNode,n=this.props.node,r=this.getTargetDirection(e,n.itree.ref.querySelector("a"));if("dragover"===this.props.dom.config.dragAndDrop.validateOn){var o=this.props.dom.config.dragAndDrop.validate,i=_.isFunction(o),a=t.id!==n.id;if(a&&(a=!n.hasAncestor(t)),a&&i&&(a=o(t,n,r)),n.state("drop-target",a),this.props.dom._tree.applyChanges(),!a)return}this.props.dom._tree.batch(),n.state("drag-targeting",!0),n.state("drag-targeting-above",-1===r),n.state("drag-targeting-below",1===r),n.state("drag-targeting-insert",0===r),this.props.dom._tree.end(),this.props.dom._tree.emit("node.dragover",e,r)}},{key:"onDrop",value:function(e){e.preventDefault(),e.stopPropagation(),this.unhighlightTarget();var t=e.dataTransfer.getData("treeId"),n=e.dataTransfer.getData("nodeId"),r=this.props.node;this.props.dom._activeDragNode=null;var o=this.getTargetDirection(e,e.target),i=void 0,a=(i=t===this.props.dom._tree.id?this.props.dom._tree:document.querySelector('[data-uid="'+t+'"]').inspireTree).node(n);a.state("drop-target",!0);var d=a.remove(!0),l=r.context().indexOf(r),s=void 0,u=void 0;0===o?(s=r.addChild(d),u=r.children.indexOf(s),r.expand()):(u=1===o?++l:l,s=r.context().insertAt(u,d)),this.props.dom._tree.emit("node.drop",e,s,r,u)}},{key:"unhighlightTarget",value:function(e){(e||this.props.node).states(["drag-targeting","drag-targeting-above","drag-targeting-below","drag-targeting-insert"],!1)}},{key:"renderCheckbox",value:function(){var e=this.props.node;if(this.props.dom.config.showCheckboxes)return M(16,g,null,null,{checked:e.checked(),dom:this.props.dom,indeterminate:e.indeterminate(),node:e})}},{key:"renderChildren",value:function(){var e=this.props,t=e.node,n=e.dom;if(t.hasChildren()){var r=t.children,o=n.loading,i=r.pagination();return M(16,P,null,null,{context:t,dom:n,limit:i.limit,loading:o,nodes:r,total:i.total})}if(this.props.dom.isDynamic&&t.children)return t.hasLoadedChildren()?M(16,N,null,null,{text:"No Results"}):M(16,N,null,null,{text:"Loading..."})}},{key:"renderEditToolbar",value:function(){if(this.props.dom._tree.config.editing.edit&&!this.props.node.editing())return M(16,b,null,null,{dom:this.props.dom,node:this.props.node})}},{key:"renderToggle",value:function(){var e=this.props.node;if(this.props.dom.isDynamic?Boolean(e.children):e.hasVisibleChildren())return M(16,O,null,null,{collapsed:e.collapsed(),node:e})}},{key:"render",value:function(){var e=this,t=this.props.node,n=M(2,"li",null,[this.renderEditToolbar(),M(2,"div","title-wrap",[this.renderToggle(),this.renderCheckbox(),M(16,D,null,null,{dom:this.props.dom,editing:t.editing(),expanded:t.expanded(),hasOrWillHaveChildren:t.hasOrWillHaveChildren(),node:t,text:t.text})]),M(2,"div","wholerow"),this.renderChildren()],p({},this.getAttributes()),null,function(t){return e.node=e.props.node.itree.ref=t});return this.props.node.state("rendered",!0),this.props.node.itree.dirty=!1,n}}]),n}(s),E=a.createVNode,P=function(e){function t(){return u(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,e),c(t,[{key:"shouldComponentUpdate",value:function(e){return _.find(e.nodes,"itree.dirty")||o(this.props,e)}},{key:"isDeferred",value:function(){return this.props.dom.config.deferredRendering||this.props.dom._tree.config.deferredLoading}},{key:"loadMore",value:function(e){e.preventDefault(),this.props.context?this.props.context.loadMore(e):this.props.dom._tree.loadMore(e)}},{key:"renderLoadMoreNode",value:function(){return E(2,"li","leaf detached",E(2,"a","title icon icon-more load-more","Load More",{onClick:this.loadMore.bind(this)}))}},{key:"renderLoadingTextNode",value:function(){return E(2,"li","leaf",E(2,"span","title icon icon-more","Loading..."))}},{key:"render",value:function(){var e=this,t=this.props.nodes,n=t.pagination();if(this.props.dom.config.deferredRendering){var r=0;t=this.props.nodes.filter(function(e){var t=!(e.hidden()||e.removed());return t&&r++,r<=n.limit&&t})}var o=_.map(t,function(t){return E(16,T,null,null,{dom:e.props.dom,node:t},t.id)});return this.isDeferred()&&n.limit0?r:e.ceil(this.$scrollLayer.clientHeight/this.config.nodeHeight),this.config.autoLoadMore&&this.$target.addEventListener("scroll",e.throttle(this.scrollListener.bind(this),20))}this.$target.inspireTree=this._tree}},{key:"clearSelection",value:function(){document.selection&&document.selection.empty?document.selection.empty():window.getSelection&&window.getSelection().removeAllRanges()}},{key:"getElement",value:function(t){var n=void 0;if(t instanceof HTMLElement)n=t;else if(e.isObject(t)&&e.isObject(t[0]))n=t[0];else if(e.isString(t)){var r=document.querySelector(t);r&&(n=r)}return n}},{key:"getScrollableAncestor",value:function(e){return e instanceof Element&&"auto"!==getComputedStyle(e).overflow&&e.parentNode&&(e=this.getScrollableAncestor(e.parentNode)),e}},{key:"keyboardListener",value:function(e){if(e.stopPropagation(),!([40,12,37,39,38].indexOf(e.which)<0)){var t=this._tree.focused();if(t.length)switch(e.preventDefault(),e.which){case 40:this.moveFocusDownFrom(t[0]);break;case 12:t[0].toggleSelect();break;case 37:t[0].collapse();break;case 39:t[0].expand();break;case 38:this.moveFocusUpFrom(t[0])}}}},{key:"moveFocusDownFrom",value:function(e){var t=e.nextVisibleNode();t&&t.focus()}},{key:"moveFocusUpFrom",value:function(e){var t=e.previousVisibleNode();t&&t.focus()}},{key:"nodeFromTitleDOMElement",value:function(e){var t=e.parentNode.parentNode.getAttribute("data-uid");return this._tree.node(t)}},{key:"onDragEnter",value:function(e){e.preventDefault(),e.target.classList.add("drag-targeting","drag-targeting-insert")}},{key:"onDragLeave",value:function(e){e.preventDefault(),this.unhighlightTarget(e.target)}},{key:"onDragOver",value:function(e){e.preventDefault()}},{key:"onDrop",value:function(e){e.preventDefault(),this.unhighlightTarget(e.target);var t=e.dataTransfer.getData("treeId"),r=e.dataTransfer.getData("nodeId"),o=n.getTreeById(t).node(r);o.state("drop-target",!0);var i=o.remove(!0),a=this._tree.addNode(i),d=this._tree.indexOf(a);this._tree.emit("node.drop",e,a,null,d)}},{key:"renderNodes",value:function(e){d(I(16,V,null,null,{dom:this,nodes:e||this._tree.nodes()}),this.$target)}},{key:"scrollListener",value:function(t){var n=this;if(!this.rendering&&!this.loading){var r=this.$scrollLayer.getBoundingClientRect(),o=document.querySelectorAll(".load-more");e.each(o,function(e){var o=e.getBoundingClientRect();if(!(r.righto.right||r.bottomo.bottom)){var i=void 0,a=e.parentNode.parentNode.parentNode;"LI"===a.tagName&&(i=n._tree.node(a.getAttribute("data-uid"))),n._tree.loadMore(i,t)}})}}},{key:"scrollSelectedIntoView",value:function(){var e=this.$target.querySelector(".selected");e&&this.$scrollLayer&&(this.$scrollLayer.scrollTop=e.offsetTop)}},{key:"unhighlightTarget",value:function(e){e&&e.classList.remove("drag-targeting","drag-targeting-insert")}}],[{key:"getTreeById",value:function(e){var t=document.querySelector('[data-uid="'+e+'"]');if(t)return t.inspireTree}}]),n}()}); diff --git a/static/js/inspire-tree.min.js b/static/js/inspire-tree.min.js new file mode 100644 index 0000000..92e57e2 --- /dev/null +++ b/static/js/inspire-tree.min.js @@ -0,0 +1,15 @@ +/* Inspire Tree + * @version 4.3.1 + * https://github.com/helion3/inspire-tree + * @copyright Copyright 2015 Helion3, and other contributors + * @license Licensed under MIT + * see https://github.com/helion3/inspire-tree/blob/master/LICENSE + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],t):e.InspireTree=t(e._)}(this,function(e){"use strict";function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function n(e,t){return t={exports:{}},e(t,t.exports),t.exports}function i(e,t){var n=t||0,i=_;return i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]}function r(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var r=(e=e||{}).random||(e.rng||k)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t)for(var s=0;s<16;++s)t[i+s]=r[s];return t||m(r)}function s(t){return e.each(t._tree.defaultState,function(e,n){t.state(n,e)}),t}function o(e,t,n,i,r){return i.state(e)!==t&&(i._tree.batch(),i._tree.config.nodes.resetStateOnRestore&&"restored"===n&&s(i),i.state(e,t),i._tree.emit("node."+n,i,!1),r&&i.hasChildren()&&i.children.recurseDown(function(i){o(e,t,n,i)}),i.markDirty(),i._tree.end()),i}function a(e,t){if(t)return this.extract(e);var n=c(e);return this.flatten(function(t){return("removed"===e||!t.removed())&&n(t)})}function u(t,n,i,r){return n=e.castArray(n),t._tree.batch(),t[r?"recurseDown":"each"](function(t){e.each(n,function(n){e.isFunction(t[n])&&t[n].apply(t,i)})}),t._tree.end(),t}function c(t){var n=t;return e.isString(t)&&(n=function(n){return e.isFunction(n[t])?n[t]():n[t]}),n}function l(t,n){var i=void 0;return t instanceof P?e.each(t,function(e){return i=l(e,n)}):t instanceof S&&!1!==(i=n(t))&&t.hasChildren()&&(i=l(t.children,n)),i}function h(t){return new w(function(n,i){if(!e.isObject(t))return i(new Error("Invalid Promise"));e.isFunction(t.then)&&t.then(n),e.isFunction(t.error)?t.error(i):e.isFunction(t.catch)&&t.catch(i)})}function d(t,n){var i={};return(n=e.castArray(n)).push("ref"),e.each(t,function(t,r){e.includes(n,r)||(i[r]=e.cloneDeep(t))}),i}function f(t,n,i){n.id=n.id||b(),"string"!=typeof n.id&&"number"!=typeof n.id&&(n.id=n.id.toString());var r=n.itree=n.itree||{};r.icon=r.icon||!1,r.dirty=!1;var s=r.li=r.li||{};s.attributes=s.attributes||{};var o=r.a=r.a||{};o.attributes=o.attributes||{};var a=r.state=r.state||{};return a.collapsed="boolean"==typeof a.collapsed?a.collapsed:t.defaultState.collapsed,a.selectable="boolean"==typeof a.selectable?a.selectable:t.defaultState.selectable,a.draggable="boolean"==typeof a.draggable?a.draggable:t.defaultState.draggable,a["drop-target"]="boolean"==typeof a["drop-target"]?a["drop-target"]:t.defaultState["drop-target"],a.checked="boolean"==typeof a.checked&&a.checked,a.editable="boolean"==typeof a.editable?a.editable:t.defaultState.editable,a.editing="boolean"==typeof a.editing?a.editing:t.defaultState.editing,a.focused=a.focused||t.defaultState.focused,a.hidden=a.hidden||t.defaultState.hidden,a.indeterminate=a.indeterminate||t.defaultState.indeterminate,a.loading=a.loading||t.defaultState.loading,a.removed=a.removed||t.defaultState.removed,a.rendered=a.rendered||t.defaultState.rendered,a.selected=a.selected||t.defaultState.selected,n.itree.parent=i,n=e.assign(new S(t),n),e.isArrayLike(n.children)&&(n.children=v(t,n.children,n)),t.allowsLoadEvents&&e.each(t.config.allowLoadEvents,function(e){a[e]&&t.emit("node."+e,n,!0)}),n}function v(t,n,i){var r=new P(t);return t.config.sort&&(n=e.sortBy(n,t.config.sort)),e.each(n,function(e){r.push(f(t,e,i))}),r._context=i,r}function y(e,t,n){return e.model[t].apply(e.model,n)}for(var p="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},k=n(function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}}),_=[],g=0;g<256;++g)_[g]=(g+256).toString(16).substr(1);var m=i,b=r,w=n(function(e,n){/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.2+97478eb6 + */ +!function(n,i){e.exports=function(){function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function n(e){return"function"==typeof e}function i(e){q=e}function r(e){H=e}function s(){return void 0!==U?function(){U(a)}:o()}function o(){var e=setTimeout;return function(){return e(a,1)}}function a(){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:this;this._tree.batch();var i=this[e].remove(),r=n.insertAt(t,i);return this._tree.emit("node.moved",r,this,e,n,t),this._tree.end(),r}},{key:"node",value:function(e){var t=void 0;return this.recurseDown(function(n){if(n.id===e)return t=n,!1}),t}},{key:"nodes",value:function(t){var i=void 0;return e.isArray(t)&&(i=new n(this._tree),this.recurseDown(function(e){t.indexOf(e.id)>-1&&i.push(e)})),e.isArray(t)?i:this}},{key:"pagination",value:function(){return this._pagination}},{key:"recurseDown",value:function(e){return l(this,e),this}},{key:"remove",value:function(t){return e.remove(this,{id:t.id}),e.invoke(this._context,"markDirty"),this._tree.applyChanges(),this}},{key:"removed",value:function(e){return a.call(this,"removed",e)}},{key:"restore",value:function(){return this.invoke("restore")}},{key:"restoreDeep",value:function(){return this.invokeDeep("restore")}},{key:"select",value:function(){return this.invoke("select")}},{key:"selectable",value:function(e){return a.call(this,"selectable",e)}},{key:"selectDeep",value:function(){return this.invokeDeep("select")}},{key:"selected",value:function(e){return a.call(this,"selected",e)}},{key:"show",value:function(){return this.invoke("show")}},{key:"showDeep",value:function(){return this.invokeDeep("show")}},{key:"softRemove",value:function(){return this.invoke("softRemove")}},{key:"sortBy",value:function(t){var n=this;if(t=t||this._tree.config.sort){var i=e.sortBy(this,t);this.length=0,e.each(i,function(e){n.push(e)})}return this}},{key:"state",value:function(){return this.invoke("state",arguments)}},{key:"stateDeep",value:function(){return this.invokeDeep("state",arguments)}},{key:"swap",value:function(e,t){this._tree.batch();var n=e.context(),i=t.context(),r=n.indexOf(e),s=i.indexOf(t);return n===i?(this[r]=t,this[s]=e,this._tree.emit("node.moved",e,n,r,i,s),this._tree.emit("node.moved",t,i,s,n,r)):(n.move(r,i.indexOf(t),i),i.move(i.indexOf(t),r,n)),this._tree.end(),this._tree.emit("node.swapped",e,n,r,t,i,s),this}},{key:"tree",value:function(){return this._tree}},{key:"toArray",value:function(){var t=[];return e.each(this,function(e){t.push(e.toObject())}),t}},{key:"visible",value:function(e){return a.call(this,"visible",e)}}]),n}(function(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)),S=function(){function t(n,i,r){var s=this;x(this,t),this._tree=n,i instanceof t&&((r=e.castArray(r)).push("_tree"),e.each(i,function(t,n){e.includes(r,n)||(e.isObject(t)?s[n]=t instanceof P?t.clone():"itree"===n?d(t):e.cloneDeep(t):s[n]=t)}))}return D(t,[{key:"addChild",value:function(t){return!e.isArray(this.children)&&e.isArrayLike(this.children)||(this.children=new P(this._tree),this.children._context=this),this.children.addNode(t)}},{key:"addChildren",value:function(t){var n=this,i=new P(this._tree);return this._tree.batch(),e.each(t,function(e){i.push(n.addChild(e))}),this._tree.end(),i}},{key:"allowDynamicLoad",value:function(){return this._tree.isDynamic&&(e.isArrayLike(this.children)||!0===this.children)}},{key:"available",value:function(){return!this.hidden()&&!this.removed()}},{key:"blur",value:function(){return this.state("editing",!1),o("focused",!1,"blurred",this)}},{key:"check",value:function(e){return this._tree.batch(),o("checked",!0,"checked",this,!e&&this._tree.config.checkbox.autoCheckChildren),this.state("indeterminate",!1),this.hasParent()&&this.getParent().refreshIndeterminateState(),this._tree.end(),this}},{key:"checked",value:function(){return this.state("checked")}},{key:"clean",value:function(){return this.recurseUp(function(e){if(e.hasParent()){var t=e.getParent();t.hasVisibleChildren()||t.hide()}}),this}},{key:"clone",value:function(e){return new t(this._tree,this,e)}},{key:"collapse",value:function(){return o("collapsed",!0,"collapsed",this)}},{key:"collapsed",value:function(){return this.state("collapsed")}},{key:"context",value:function(){return this.hasParent()?this.getParent().children:this._tree.model}},{key:"copy",value:function(t){var n=this;return t&&(n=n.copyHierarchy()),{to:function(t){if(!e.isFunction(t.addNode))throw new Error("Destination must be an Inspire Tree instance.");return t.addNode(n.toObject())}}}},{key:"copyHierarchy",value:function(t){var n=[],i=this.getParents();if(e.each(i,function(e){n.push(e.toObject(t))}),i=n.reverse(),!t){var r=this.toObject(!0);this.hasChildren()&&(r.children=this.children.filterBy(function(e){return!e.state("hidden")}).toArray(),r.children._context=r),n.push(r)}var s=n[0],o=s,a=n.length;return e.each(n,function(e,t){var i=[];t+11)&&(this._tree.batch(),o("selected",!1,"deselected",this,!e&&this._tree.config.selection.autoSelectChildren),this._tree.end()),this}},{key:"editable",value:function(){return this._tree.config.editable&&this._tree.config.editing.edit&&this.state("editable")}},{key:"editing",value:function(){return this.state("editing")}},{key:"expand",value:function(){var e=this;return new w(function(t,n){(e.hasChildren()||e._tree.isDynamic&&!0===e.children)&&(e.collapsed()||e.hidden())?(e.state("collapsed",!1),e.state("hidden",!1),e._tree.emit("node.expanded",e),e._tree.isDynamic&&!0===e.children?e.loadChildren().then(t).catch(n):(e.markDirty(),e._tree.applyChanges(),t(e))):t(e)})}},{key:"expanded",value:function(){return!this.collapsed()}},{key:"expandParents",value:function(){return this.hasParent()&&this.getParent().recurseUp(function(e){e.expand()}),this}},{key:"focus",value:function(){return this.focused()||(this._tree.batch(),this._tree.blurDeep(),this.state("focused",!0),this._tree.emit("node.focused",this),this.markDirty(),this._tree.end()),this}},{key:"focused",value:function(){return this.state("focused")}},{key:"getChildren",value:function(){return this.hasChildren()?this.children:new P(this._tree)}},{key:"getParent",value:function(){return this.itree.parent}},{key:"getParents",value:function(){var e=new P(this._tree);return this.hasParent()&&this.getParent().recurseUp(function(t){e.push(t)}),e}},{key:"getTextualHierarchy",value:function(){var e=[];return this.recurseUp(function(t){e.unshift(t.text)}),e}},{key:"hasAncestor",value:function(e){var t=!1;return this.recurseUp(function(n){return!(t=n.id===e.id)}),t}},{key:"hasChildren",value:function(){return e.isArrayLike(this.children)&&this.children.length>0}},{key:"hasLoadedChildren",value:function(){return e.isArrayLike(this.children)}},{key:"hasOrWillHaveChildren",value:function(){return e.isArrayLike(this.children)?Boolean(this.children.length):this.allowDynamicLoad()}},{key:"hasParent",value:function(){return Boolean(this.itree.parent)}},{key:"hasVisibleChildren",value:function(){var e=!1;return this.hasChildren()&&(e=this.children.filterBy("available").length>0),e}},{key:"hide",value:function(){var e=o("hidden",!0,"hidden",this);return e.hasChildren()&&e.children.hide(),e}},{key:"hidden",value:function(){return this.state("hidden")}},{key:"indexPath",value:function(){var t=[];return this.recurseUp(function(n){t.push(e.indexOf(n.context(),n))}),t.reverse().join(".")}},{key:"indeterminate",value:function(){return this.state("indeterminate")}},{key:"lastDeepestVisibleChild",value:function(){var t=void 0;if(this.hasChildren()&&!this.collapsed()){var n=(t=e.findLast(this.children,function(e){return e.visible()})).lastDeepestVisibleChild();n&&(t=n)}return t}},{key:"loadChildren",value:function(){var t=this;return new w(function(n,i){if(!t.allowDynamicLoad())return i(new Error("Node does not have or support dynamic children."));t.state("loading",!0),t.markDirty(),t._tree.applyChanges();var r=function(r,s){if(!e.isArrayLike(r))return i(new TypeError("Loader requires an array-like `nodes` parameter."));t._tree.batch(),t.state("loading",!1);var o=v(t._tree,r,t);e.isArrayLike(t.children)?t.children=t.children.concat(o):t.children=o,e.parseInt(s)>r.length&&(t.children._pagination.total=e.parseInt(s)),"checkbox"===t._tree.config.selection.mode&&t.selected()&&t.children.select(),t.markDirty(),t._tree.end(),n(t.children),t._tree.emit("children.loaded",t)},s=function(e){t.state("loading",!1),t.children=new P(t._tree),t.children._context=t,t.markDirty(),t._tree.applyChanges(),i(e),t._tree.emit("tree.loaderror",e)},o=t._tree.constructor.isTreeNodes(t.children)?t.children.pagination():null,a=t._tree.config.data(t,r,s,o);e.isObject(a)&&h(a).then(r).catch(s)})}},{key:"loading",value:function(){return this.state("loading")}},{key:"loadMore",value:function(){return this.children&&!0!==this.children?this.children.loadMore():w.reject(new Error("Children have not yet been loaded."))}},{key:"markDirty",value:function(){return this.itree.dirty||(this.itree.dirty=!0,this.hasParent()&&this.getParent().markDirty()),this}},{key:"matched",value:function(){return this.state("matched")}},{key:"nextVisibleAncestralSiblingNode",value:function(){var e=void 0;if(this.hasParent()){var t=this.getParent();(e=t.nextVisibleSiblingNode())||(e=t.nextVisibleAncestralSiblingNode())}return e}},{key:"nextVisibleChildNode",value:function(){var t=void 0;return this.hasChildren()&&(t=e.find(this.children,function(e){return e.visible()})),t}},{key:"nextVisibleNode",value:function(){var e=void 0;return(e=this.nextVisibleChildNode())||(e=this.nextVisibleSiblingNode()),e||(e=this.nextVisibleAncestralSiblingNode()),e}},{key:"nextVisibleSiblingNode",value:function(){var t=this.hasParent()?this.getParent().children:this._tree.nodes(),n=e.findIndex(t,{id:this.id});return e.find(e.slice(t,n+1),function(e){return e.visible()})}},{key:"pagination",value:function(){return e.get(this,"children._pagination")}},{key:"previousVisibleNode",value:function(){var e=void 0;return(e=this.previousVisibleSiblingNode())&&e.hasChildren()&&!e.collapsed()&&(e=e.lastDeepestVisibleChild()),!e&&this.hasParent()&&(e=this.getParent()),e}},{key:"previousVisibleSiblingNode",value:function(){var t=this.hasParent()?this.getParent().children:this._tree.nodes(),n=e.findIndex(t,{id:this.id});return e.findLast(e.slice(t,0,n),function(e){return e.visible()})}},{key:"recurseDown",value:function(e){return l(this,e),this}},{key:"recurseUp",value:function(e){return!1!==e(this)&&this.hasParent()&&this.getParent().recurseUp(e),this}},{key:"refreshIndeterminateState",value:function(){var e=this.indeterminate();if(this.state("indeterminate",!1),this.hasChildren()){var t=this.children.length,n=0,i=0;this.children.each(function(e){e.checked()&&i++,e.indeterminate()&&n++}),i===t?o("checked",!0,"checked",this):o("checked",!1,"unchecked",this),this.checked()||this.state("indeterminate",n>0||t>0&&i>0&&i0&&void 0!==arguments[0]&&arguments[0],t=this.getParent();this.context().remove(this),t&&(t.refreshIndeterminateState(),t.markDirty()),(t?t.pagination():this._tree.pagination()).total--;var n=this.toObject(!1,e);return this._tree.emit("node.removed",n,t),this._tree.applyChanges(),n}},{key:"removed",value:function(){return this.state("removed")}},{key:"rendered",value:function(){return this.state("rendered")}},{key:"restore",value:function(){return o("removed",!1,"restored",this)}},{key:"select",value:function(e){if(!this.selected()&&this.selectable()){if(this._tree.batch(),this._tree.canAutoDeselect()){var t=this._tree.config.selection.require;this._tree.config.selection.require=!1,this._tree.deselectDeep(),this._tree.config.selection.require=t}o("selected",!0,"selected",this,!e&&this._tree.config.selection.autoSelectChildren),this._tree._lastSelectedNode=this,this.markDirty(),this._tree.end()}return this}},{key:"selectable",value:function(){var e=this._tree.config.selection.allow(this);return"boolean"==typeof e?e:this.state("selectable")}},{key:"selected",value:function(){return this.state("selected")}},{key:"set",value:function(e,t){return this[e]=t,this.markDirty(),this._tree.applyChanges(),this}},{key:"show",value:function(){return o("hidden",!1,"shown",this)}},{key:"state",value:function(e,t){var n=this.itree.state[e];return void 0!==t&&n!==t&&(this.itree.state[e]=t,"rendered"!==e&&this.markDirty(),this._tree.emit("node.state.changed",this,e,n,t)),n}},{key:"states",value:function(t,n){var i=this,r=[];return this._tree.batch(),e.each(t,function(e){r.push(i.state(e,n))}),this._tree.end(),r}},{key:"swap",value:function(e){return this.context().swap(this,e),this}},{key:"softRemove",value:function(){return o("removed",!0,"softremoved",this,"softRemove")}},{key:"toggleCheck",value:function(){return this.checked()?this.uncheck():this.check()}},{key:"toggleCollapse",value:function(){return this.collapsed()?this.expand():this.collapse()}},{key:"toggleEditing",value:function(){return this.state("editing",!this.state("editing")),this.markDirty(),this._tree.applyChanges(),this}},{key:"toggleSelect",value:function(){return this.selected()?this.deselect():this.select()}},{key:"toObject",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={},s=e.pull(Object.keys(this),"_tree","children","itree");e.each(s,function(e){r[e]=t[e]});var o=r.itree={};return o.a=this.itree.a,o.icon=this.itree.icon,o.li=this.itree.li,i&&(o.state=this.itree.state),!n&&this.hasChildren()&&e.isFunction(this.children.toArray)&&(r.children=this.children.toArray()),r}},{key:"toString",value:function(){return this.text}},{key:"tree",value:function(){return this.context().tree()}},{key:"uncheck",value:function(e){return this._tree.batch(),o("checked",!1,"unchecked",this,!e&&this._tree.config.checkbox.autoCheckChildren),this.state("indeterminate",!1),this.hasParent()&&this.getParent().refreshIndeterminateState(),this._tree.end(),this}},{key:"visible",value:function(){return!(this.hidden()||this.removed()||this._tree.usesNativeDOM&&!this.rendered())&&(!this.hasParent()||!this.getParent().collapsed()&&this.getParent().visible())}}]),t}();return function(t){function n(t){x(this,n);var i=L(this,(n.__proto__||Object.getPrototypeOf(n)).call(this)),r=i;r._lastSelectedNode,r._muted=!1,r.allowsLoadEvents=!1,r.batching=0,r.id=b(),r.initialized=!1,r.isDynamic=!1,r.opts=t,r.preventDeselection=!1,r.config=e.defaultsDeep({},t,{allowLoadEvents:[],checkbox:{autoCheckChildren:!0},contextMenu:!1,data:!1,editable:!1,editing:{add:!1,edit:!1,remove:!1},nodes:{resetStateOnRestore:!0},pagination:{limit:-1},renderer:!1,search:{matcher:!1,matchProcessor:!1},selection:{allow:e.noop,autoDeselect:!0,autoSelectChildren:!1,disableDirectDeselection:!1,mode:"default",multiple:!1,require:!1},showCheckboxes:!1,sort:!1}),"checkbox"===r.config.selection.mode&&(r.config.selection.autoSelectChildren=!0,r.on("node.checked",function(e){e.selected()||e.select(!0)}),r.on("node.selected",function(e){e.checked()||e.check(!0)}),r.on("node.unchecked",function(e){e.selected()&&e.deselect(!0)}),r.on("node.deselected",function(e){e.checked()&&e.uncheck(!0)})),r.config.selection.autoSelectChildren&&(r.config.selection.multiple=!0,r.config.selection.autoDeselect=!1),t.editable&&!t.editing&&(r.config.editing.add=!0,r.config.editing.edit=!0,r.config.editing.remove=!0),e.isFunction(t.search)&&(r.config.search={matcher:t.search,matchProcessor:!1}),r.defaultState={collapsed:!0,editable:e.get(r,"config.editing.edit"),editing:!1,draggable:!0,"drop-target":!0,focused:!1,hidden:!1,indeterminate:!1,loading:!1,matched:!1,removed:!1,rendered:!1,selectable:!0,selected:!1},r.allowsLoadEvents=e.isArray(r.config.allowLoadEvents)&&r.config.allowLoadEvents.length>0,r.isDynamic=e.isFunction(r.config.data);var s=r.emit;return r.emit=function(t){if(!r.isEventMuted(t)){if(e.isFunction(e.get(arguments,"[1].preventDefault"))){var n=arguments[1];n.treeDefaultPrevented=!1,n.preventTreeDefault=function(){n.treeDefaultPrevented=!0}}s.apply(r,arguments)}},r.model=new P(r),r.config.data&&r.load(r.config.data),r.initialized=!0,i}return A(n,t),D(n,[{key:"addNode",value:function(){return y(this,"addNode",arguments)}},{key:"addNodes",value:function(t){var n=this;this.batch();var i=new P(this);return e.each(t,function(e){i.push(n.addNode(e))}),this.end(),i}},{key:"applyChanges",value:function(){this.batching>0||this.emit("changes.applied")}},{key:"available",value:function(){return y(this,"available",arguments)}},{key:"batch",value:function(){this.batching<0&&(this.batching=0),this.batching++}},{key:"blur",value:function(){return y(this,"blur",arguments)}},{key:"blurDeep",value:function(){return y(this,"blurDeep",arguments)}},{key:"boundingNodes",value:function(){var t=e.transform(arguments,function(e,t){e[t.indexPath().replace(/\./g,"")]=t},{}),n=e.sortBy(Object.keys(t)),i=C(n),r=i[0],s=i.slice(1);return[e.get(t,r),e.get(t,s)]}},{key:"canAutoDeselect",value:function(){return this.config.selection.autoDeselect&&!this.preventDeselection}},{key:"checked",value:function(){return y(this,"checked",arguments)}},{key:"clean",value:function(){return y(this,"clean",arguments)}},{key:"clearSearch",value:function(){return this.matched().state("matched",!1),this.showDeep().collapseDeep().tree()}},{key:"clone",value:function(){return y(this,"clone",arguments)}},{key:"collapse",value:function(){return y(this,"collapse",arguments)}},{key:"collapsed",value:function(){return y(this,"collapsed",arguments)}},{key:"collapseDeep",value:function(){return y(this,"collapseDeep",arguments)}},{key:"concat",value:function(){return y(this,"concat",arguments)}},{key:"copy",value:function(){return y(this,"copy",arguments)}},{key:"createNode",value:function(e){return n.isTreeNode(e)?e:f(this,e)}},{key:"deepest",value:function(){return y(this,"deepest",arguments)}},{key:"deselect",value:function(){return y(this,"deselect",arguments)}},{key:"deselectDeep",value:function(){return y(this,"deselectDeep",arguments)}},{key:"disableDeselection",value:function(){return this.config.selection.multiple&&(this.preventDeselection=!0),this}},{key:"each",value:function(){return y(this,"each",arguments)}},{key:"every",value:function(){return y(this,"every",arguments)}},{key:"editable",value:function(){return y(this,"editable",arguments)}},{key:"editing",value:function(){return y(this,"editing",arguments)}},{key:"enableDeselection",value:function(){return this.preventDeselection=!1,this}},{key:"end",value:function(){0===--this.batching&&this.applyChanges()}},{key:"expand",value:function(){return y(this,"expand",arguments)}},{key:"expandDeep",value:function(){return y(this,"expandDeep",arguments)}},{key:"expanded",value:function(){return y(this,"expanded",arguments)}},{key:"extract",value:function(){return y(this,"extract",arguments)}},{key:"filter",value:function(){return y(this,"filter",arguments)}},{key:"filterBy",value:function(){return y(this,"filterBy",arguments)}},{key:"flatten",value:function(){return y(this,"flatten",arguments)}},{key:"focused",value:function(){return y(this,"focused",arguments)}},{key:"forEach",value:function(){return y(this,"each",arguments)}},{key:"get",value:function(){return y(this,"get",arguments)}},{key:"hidden",value:function(){return y(this,"hidden",arguments)}},{key:"hide",value:function(){return y(this,"hide",arguments)}},{key:"hideDeep",value:function(){return y(this,"hideDeep",arguments)}},{key:"indeterminate",value:function(){return y(this,"indeterminate",arguments)}},{key:"indexOf",value:function(){return y(this,"indexOf",arguments)}},{key:"insertAt",value:function(){return y(this,"insertAt",arguments)}},{key:"invoke",value:function(){return y(this,"invoke",arguments)}},{key:"invokeDeep",value:function(){return y(this,"invokeDeep",arguments)}},{key:"isEventMuted",value:function(t){return e.isBoolean(this.muted())?this.muted():e.includes(this.muted(),t)}},{key:"isTree",value:function(e){return e instanceof n}},{key:"join",value:function(){return y(this,"join",arguments)}},{key:"lastSelectedNode",value:function(){return this._lastSelectedNode}},{key:"load",value:function(t){var n=this,i=new w(function(i,r){var s=function(t,s){if(!e.isArrayLike(t))return r(new TypeError("Loader requires an array-like `nodes` parameter."));!n.initialized&&e.isArrayLike(t)?setTimeout(function(){n.emit("data.loaded",t)}):n.emit("data.loaded",t);var o=v(n,t);n.config.deferredLoading?n.model=n.model.concat(o):n.model=o,n.model._pagination.total=t.length,e.parseInt(s)>t.length&&(n.model._pagination.total=e.parseInt(s)),s||n.model.recurseDown(function(e){e.hasChildren()&&(e.children._pagination.total=e.children.length)}),n.config.selection.require&&!n.selected().length&&n.selectFirstAvailableNode();var a=function(){n.emit("model.loaded",n.model),i(n.model),n.applyChanges()};!n.initialized&&e.isArray(t)?setTimeout(a):a()};if(e.isArrayLike(t))s(t);else if(e.isFunction(t)){var o=t(null,s,r,n.pagination());o&&(t=o)}e.isObject(t)?h(t).then(s).catch(r):error(new Error("Invalid data loader."))});return i.catch(function(e){n.emit("data.loaderror",e)}),this._loader={promise:i},i}},{key:"loading",value:function(){return y(this,"loading",arguments)}},{key:"loadMore",value:function(){return y(this,"loadMore",arguments)}},{key:"map",value:function(){return y(this,"map",arguments)}},{key:"matched",value:function(){return y(this,"matched",arguments)}},{key:"move",value:function(){return y(this,"move",arguments)}},{key:"mute",value:function(t){return e.isString(t)||e.isArray(t)?this._muted=e.castArray(t):this._muted=!0,this}},{key:"muted",value:function(){return this._muted}},{key:"node",value:function(){return y(this,"node",arguments)}},{key:"nodes",value:function(){return y(this,"nodes",arguments)}},{key:"pagination",value:function(){return y(this,"pagination",arguments)}},{key:"pop",value:function(){return y(this,"pop",arguments)}},{key:"push",value:function(){return y(this,"push",arguments)}},{key:"recurseDown",value:function(){return y(this,"recurseDown",arguments)}},{key:"reduce",value:function(){return y(this,"reduce",arguments)}},{key:"reduceRight",value:function(){return y(this,"reduceRight",arguments)}},{key:"reload",value:function(){return this.removeAll(),this.load(this.opts.data||this.config.data)}},{key:"remove",value:function(){return y(this,"remove",arguments)}},{key:"removeAll",value:function(){return this.model=new P(this),this.applyChanges(),this}},{key:"removed",value:function(){return y(this,"removed",arguments)}},{key:"restore",value:function(){return y(this,"restore",arguments)}},{key:"restoreDeep",value:function(){return y(this,"restoreDeep",arguments)}},{key:"reverse",value:function(){return y(this,"reverse",arguments)}},{key:"search",value:function(t){var i=this,r=this.config.search,s=r.matcher,o=r.matchProcessor;return!t||e.isString(t)&&e.isEmpty(t)?w.resolve(this.clearSearch()):(this.batch(),this.recurseDown(function(e){e.state("hidden",!0),e.state("matched",!1)}),this.end(),s=e.isFunction(s)?s:function(t,n){var r=new P(i);e.isString(t)&&(t=new RegExp(t,"i"));var s=void 0;s=e.isRegExp(t)?function(e){return t.test(e.text)}:t,i.model.recurseDown(function(e){e.removed()||s(e)&&r.push(e)}),n(r)},o=e.isFunction(o)?o:function(e){e.each(function(e){e.show().state("matched",!0),e.expandParents().collapse(),e.hasChildren()&&e.children.showDeep()})},new w(function(r,a){s(t,function(t){n.isTreeNodes(t)||(t=i.nodes(e.map(t,"id"))),i.batch(),o(t),i.end(),r(t)},a)}))}},{key:"select",value:function(){return y(this,"select",arguments)}},{key:"selectable",value:function(){return y(this,"selectable",arguments)}},{key:"selectBetween",value:function(e,t){this.batch();for(var n=e.nextVisibleNode();n.id!==t.id;)n.select(),n=n.nextVisibleNode();return this.end(),this}},{key:"selectDeep",value:function(){return y(this,"selectDeep",arguments)}},{key:"selected",value:function(){return y(this,"selected",arguments)}},{key:"selectFirstAvailableNode",value:function(){var e=this.model.filterBy("available").get(0);return e&&e.select(),e}},{key:"shift",value:function(){return y(this,"shift",arguments)}},{key:"show",value:function(){return y(this,"show",arguments)}},{key:"showDeep",value:function(){return y(this,"showDeep",arguments)}},{key:"slice",value:function(){return y(this,"slice",arguments)}},{key:"softRemove",value:function(){return y(this,"softRemove",arguments)}},{key:"some",value:function(){return y(this,"some",arguments)}},{key:"sort",value:function(){return y(this,"sort",arguments)}},{key:"sortBy",value:function(){return y(this,"sortBy",arguments)}},{key:"splice",value:function(){return y(this,"slice",arguments)}},{key:"state",value:function(){return y(this,"state",arguments)}},{key:"stateDeep",value:function(){return y(this,"stateDeep",arguments)}},{key:"swap",value:function(){return y(this,"swap",arguments)}},{key:"toArray",value:function(){return y(this,"toArray",arguments)}},{key:"toString",value:function(){return y(this,"toString",arguments)}},{key:"unmute",value:function(t){return e.isString(t)||e.isArray(t)?(this._muted=e.difference(this._muted,e.castArray(t)),this._muted.length||(this._muted=!1)):this._muted=!1,this}},{key:"unshift",value:function(){return y(this,"unshift",arguments)}},{key:"visible",value:function(){return y(this,"visible",arguments)}}],[{key:"isTreeNode",value:function(e){return e instanceof S}},{key:"isTreeNodes",value:function(e){return e instanceof P}}]),n}(n(function(e,t){!function(t){function n(){this._events={},this._conf&&i.call(this,this._conf)}function i(e){e?(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),this._maxListeners=e.maxListeners!==t?e.maxListeners:c,e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this._newListener=e.newListener),e.removeListener&&(this._removeListener=e.removeListener),e.verboseMemoryLeak&&(this.verboseMemoryLeak=e.verboseMemoryLeak),this.wildcard&&(this.listenerTree={})):this._maxListeners=c}function r(e,t){var n="(node) warning: possible EventEmitter memory leak detected. "+e+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(n+=" Event name: "+t+"."),"undefined"!=typeof process&&process.emitWarning){var i=new Error(n);i.name="MaxListenersExceededWarning",i.emitter=this,i.count=e,process.emitWarning(i)}else console.error(n),console.trace&&console.trace()}function s(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,i.call(this,e)}function o(e,t,n,i){if(!n)return[];var r,s,a,u,c,l,h,d=[],f=t.length,v=t[i],y=t[i+1];if(i===f&&n._listeners){if("function"==typeof n._listeners)return e&&e.push(n._listeners),[n];for(r=0,s=n._listeners.length;r0&&o._listeners.length>this._maxListeners&&(o._listeners.warned=!0,r.call(this,o._listeners.length,a))):o._listeners=n,!0;a=e.shift()}return!0}var u=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},c=10;s.EventEmitter2=s,s.prototype.delimiter=".",s.prototype.setMaxListeners=function(e){e!==t&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},s.prototype.event="",s.prototype.once=function(e,t){return this._once(e,t,!1)},s.prototype.prependOnceListener=function(e,t){return this._once(e,t,!0)},s.prototype._once=function(e,t,n){return this._many(e,1,t,n),this},s.prototype.many=function(e,t,n){return this._many(e,t,n,!1)},s.prototype.prependMany=function(e,t,n){return this._many(e,t,n,!0)},s.prototype._many=function(e,t,n,i){function r(){return 0==--t&&s.off(e,r),n.apply(this,arguments)}var s=this;if("function"!=typeof n)throw new Error("many only accepts instances of Function");return r._origin=n,this._on(e,r,i),s},s.prototype.emit=function(){this._events||n.call(this);var e=arguments[0];if("newListener"===e&&!this._newListener&&!this._events.newListener)return!1;var t,i,r,s,a,u=arguments.length;if(this._all&&this._all.length){if(a=this._all.slice(),u>3)for(t=new Array(u),s=0;s3)for(t=new Array(u-1),s=1;s3)for(t=new Array(c),s=1;s3)for(t=new Array(c-1),s=1;s0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,r.call(this,this._events[e].length,e))):this._events[e]=t,this)},s.prototype.off=function(e,n){function i(e){if(e!==t){var n=Object.keys(e);for(var r in n){var s=n[r],o=e[s];o instanceof Function||"object"!=typeof o||null===o||(Object.keys(o).length>0&&i(e[s]),0===Object.keys(o).length&&delete e[s])}}}if("function"!=typeof n)throw new Error("removeListener only takes instances of Function");var r,s=[];if(this.wildcard){var a="string"==typeof e?e.split(this.delimiter):e.slice();s=o.call(this,null,a,this.listenerTree,0)}else{if(!this._events[e])return this;r=this._events[e],s.push({_listeners:r})}for(var c=0;c0){for(n=0,i=(t=this._all).length;n"']/g,G=RegExp(V.source),H=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nn=/^\w*$/,tn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,en=RegExp(rn.source),un=/^\s+|\s+$/g,on=/^\s+/,fn=/\s+$/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,an=/\{\n\/\* \[wrapped with (.+)\] \*/,ln=/,? & /,sn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_n=/\w*$/,vn=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,dn=/^\[object .+?Constructor\]$/,yn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jn=/($^)/,wn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",An="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,kn="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",En=RegExp("['\u2019]","g"),Sn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),On=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+kn+mn,"g"),In=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",An].join("|"),"g"),Rn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),zn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Bn={}; +Bn["[object Float32Array]"]=Bn["[object Float64Array]"]=Bn["[object Int8Array]"]=Bn["[object Int16Array]"]=Bn["[object Int32Array]"]=Bn["[object Uint8Array]"]=Bn["[object Uint8ClampedArray]"]=Bn["[object Uint16Array]"]=Bn["[object Uint32Array]"]=true,Bn["[object Arguments]"]=Bn["[object Array]"]=Bn["[object ArrayBuffer]"]=Bn["[object Boolean]"]=Bn["[object DataView]"]=Bn["[object Date]"]=Bn["[object Error]"]=Bn["[object Function]"]=Bn["[object Map]"]=Bn["[object Number]"]=Bn["[object Object]"]=Bn["[object RegExp]"]=Bn["[object Set]"]=Bn["[object String]"]=Bn["[object WeakMap]"]=false; +var Ln={};Ln["[object Arguments]"]=Ln["[object Array]"]=Ln["[object ArrayBuffer]"]=Ln["[object DataView]"]=Ln["[object Boolean]"]=Ln["[object Date]"]=Ln["[object Float32Array]"]=Ln["[object Float64Array]"]=Ln["[object Int8Array]"]=Ln["[object Int16Array]"]=Ln["[object Int32Array]"]=Ln["[object Map]"]=Ln["[object Number]"]=Ln["[object Object]"]=Ln["[object RegExp]"]=Ln["[object Set]"]=Ln["[object String]"]=Ln["[object Symbol]"]=Ln["[object Uint8Array]"]=Ln["[object Uint8ClampedArray]"]=Ln["[object Uint16Array]"]=Ln["[object Uint32Array]"]=true, +Ln["[object Error]"]=Ln["[object Function]"]=Ln["[object WeakMap]"]=false;var Un,Cn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Dn=parseFloat,Mn=parseInt,Tn=typeof global=="object"&&global&&global.Object===Object&&global,$n=typeof self=="object"&&self&&self.Object===Object&&self,Fn=Tn||$n||Function("return this")(),Nn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Pn=Nn&&typeof module=="object"&&module&&!module.nodeType&&module,Zn=Pn&&Pn.exports===Nn,qn=Zn&&Tn.process; +n:{try{Un=qn&&qn.binding&&qn.binding("util");break n}catch(n){}Un=void 0}var Vn=Un&&Un.isArrayBuffer,Kn=Un&&Un.isDate,Gn=Un&&Un.isMap,Hn=Un&&Un.isRegExp,Jn=Un&&Un.isSet,Yn=Un&&Un.isTypedArray,Qn=b("length"),Xn=x({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I", +"\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C", +"\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i", +"\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S", +"\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe", +"\u0149":"'n","\u017f":"s"}),nt=x({"&":"&","<":"<",">":">",'"':""","'":"'"}),tt=x({"&":"&","<":"<",">":">",""":'"',"'":"'"}),rt=function x(mn){function An(n){if(du(n)&&!of(n)&&!(n instanceof Un)){if(n instanceof On)return n;if(ii.call(n,"__wrapped__"))return $e(n)}return new On(n)}function kn(){}function On(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=T}function Un(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1, +this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Cn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function _t(n,t,e,u,i,o){var f,c=1&t,a=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==T)return f;if(!gu(n))return n;if(u=of(n)){if(f=me(n),!c)return Ur(n,f)}else{var s=_o(n),h="[object Function]"==s||"[object GeneratorFunction]"==s;if(cf(n))return Ir(n,c);if("[object Object]"==s||"[object Arguments]"==s||h&&!i){if(f=a||h?{}:Ae(n),!c)return a?Mr(n,lt(f,n)):Dr(n,at(f,n))}else{if(!Ln[s])return i?n:{};f=ke(n,s,c)}}if(o||(o=new Pn), +i=o.get(n))return i;if(o.set(n,f),hf(n))return n.forEach(function(r){f.add(_t(r,t,e,r,n,o))}),f;if(lf(n))return n.forEach(function(r,u){f.set(u,_t(r,t,e,u,n,o))}),f;var a=l?a?ve:_e:a?Wu:zu,p=u?T:a(n);return r(p||n,function(r,u){p&&(u=r,r=n[u]),ot(f,u,_t(r,t,e,u,n,o))}),f}function vt(n){var t=zu(n);return function(r){return gt(r,n,t)}}function gt(n,t,r){var e=r.length;if(null==n)return!e;for(n=Yu(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===T&&!(u in n)||!i(o))return false}return true}function dt(n,t,r){if(typeof n!="function")throw new ni("Expected a function"); +return yo(function(){n.apply(T,r)},t)}function yt(n,t,r,e){var u=-1,i=o,a=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,E(r))),e?(i=f,a=false):200<=t.length&&(i=O,a=false,t=new Nn(t));n:for(;++ut}function Rt(n,t){return null!=n&&ii.call(n,t)}function zt(n,t){return null!=n&&t in Yu(n)}function Wt(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=Vu(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,E(t))),s=Ui(p.length,s), +l[a]=!r&&(t||120<=u&&120<=p.length)?new Nn(a&&p):T}var p=n[0],_=-1,v=l[0];n:for(;++_r.length?t:Et(t,hr(r,0,-1)),r=null==t?t:t[De(qe(r))],null==r?T:n(r,t,e)}function Ut(n){return du(n)&&"[object Arguments]"==Ot(n)}function Ct(n){ +return du(n)&&"[object ArrayBuffer]"==Ot(n)}function Dt(n){return du(n)&&"[object Date]"==Ot(n)}function Mt(n,t,r,e,u){if(n===t)t=true;else if(null==n||null==t||!du(n)&&!du(t))t=n!==n&&t!==t;else n:{var i=of(n),o=of(t),f=i?"[object Array]":_o(n),c=o?"[object Array]":_o(t),f="[object Arguments]"==f?"[object Object]":f,c="[object Arguments]"==c?"[object Object]":c,a="[object Object]"==f,o="[object Object]"==c;if((c=f==c)&&cf(n)){if(!cf(t)){t=false;break n}i=true,a=false}if(c&&!a)u||(u=new Pn),t=i||pf(n)?se(n,t,r,e,Mt,u):he(n,t,f,r,e,Mt,u);else{ +if(!(1&r)&&(i=a&&ii.call(n,"__wrapped__"),f=o&&ii.call(t,"__wrapped__"),i||f)){n=i?n.value():n,t=f?t.value():t,u||(u=new Pn),t=Mt(n,t,r,e,u);break n}if(c)t:if(u||(u=new Pn),i=1&r,f=_e(n),o=f.length,c=_e(t).length,o==c||i){for(a=o;a--;){var l=f[a];if(!(i?l in t:ii.call(t,l))){t=false;break t}}if((c=u.get(n))&&u.get(t))t=c==t;else{c=true,u.set(n,t),u.set(t,n);for(var s=i;++at?r:0,Se(t,r)?n[t]:T}function Xt(n,t,r){var e=-1;return t=c(t.length?t:[Tu],E(ye())), +n=Gt(n,function(n){return{a:c(t,function(t){return t(n)}),b:++e,c:n}}),w(n,function(n,t){var e;n:{e=-1;for(var u=n.a,i=t.a,o=u.length,f=r.length;++e=f?c:c*("desc"==r[e]?-1:1);break n}}e=n.b-t.b}return e})}function nr(n,t){return tr(n,t,function(t,r){return Ru(n,r)})}function tr(n,t,r){for(var e=-1,u=t.length,i={};++et||9007199254740991t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Vu(u);++e=u){for(;e>>1,o=n[i];null!==o&&!ju(o)&&(r?o<=t:ot.length?n:Et(n,hr(t,0,-1)),null==n||delete n[De(qe(t))]}function jr(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++ie)return e?br(n[0]):[];for(var u=-1,i=Vu(e);++u=e?n:hr(n,t,r)}function Ir(n,t){if(t)return n.slice();var r=n.length,r=vi?vi(r):new n.constructor(r);return n.copy(r),r}function Rr(n){var t=new n.constructor(n.byteLength);return new _i(t).set(new _i(n)), +t}function zr(n,t){return new n.constructor(t?Rr(n.buffer):n.buffer,n.byteOffset,n.length)}function Wr(n,t){if(n!==t){var r=n!==T,e=null===n,u=n===n,i=ju(n),o=t!==T,f=null===t,c=t===t,a=ju(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&nu?T:i,u=1),t=Yu(t);++eo&&f[0]!==a&&f[o-1]!==a?[]:L(f,a), +o-=c.length,or?r?or(t,n):t:(r=or(t,Si(n/D(t))),Rn.test(t)?Or(M(r),0,n).join(""):r.slice(0,n))}function te(t,r,e,u){function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=Vu(l+c),h=this&&this!==Fn&&this instanceof i?f:t;++at||e)&&(1&n&&(i[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Br(e,r,h[4]):r,i[4]=e?L(i[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=i[5],i[5]=e?Lr(e,r,h[6]):r,i[6]=e?L(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&n&&(i[8]=null==i[8]?h[8]:Ui(i[8],h[8])),null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=t),n=i[0],t=i[1], +r=i[2],e=i[3],u=i[4],f=i[9]=i[9]===T?c?0:n.length:Li(i[9]-a,0),!f&&24&t&&(t&=-25),Le((h?fo:go)(t&&1!=t?8==t||16==t?Kr(n,t,f):32!=t&&33!=t||u.length?Jr.apply(T,i):te(n,t,r,e):Pr(n,t,r),i),n,t)}function ce(n,t,r,e){return n===T||au(n,ri[r])&&!ii.call(e,r)?t:n}function ae(n,t,r,e,u,i){return gu(n)&&gu(t)&&(i.set(t,n),Yt(n,t,T,ae,i),i.delete(t)),n}function le(n){return bu(n)?T:n}function se(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(n))&&i.get(t))return c==t;var c=-1,a=true,l=2&r?new Nn:T; +for(i.set(n,t),i.set(t,n);++cr&&(r=Li(e+r,0)),_(n,ye(t,3),r)):-1}function Ne(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==T&&(u=Au(r),u=0>r?Li(e+u,0):Ui(u,e-1)),_(n,ye(t,3),u,true)}function Pe(n){return(null==n?0:n.length)?wt(n,1):[]}function Ze(n){ +return n&&n.length?n[0]:T}function qe(n){var t=null==n?0:n.length;return t?n[t-1]:T}function Ve(n,t){return n&&n.length&&t&&t.length?er(n,t):n}function Ke(n){return null==n?n:Ti.call(n)}function Ge(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){if(su(n))return t=Li(n.length,t),true}),A(t,function(t){return c(n,b(t))})}function He(t,r){if(!t||!t.length)return[];var e=Ge(t);return null==r?e:c(e,function(t){return n(r,T,t)})}function Je(n){return n=An(n),n.__chain__=true,n}function Ye(n,t){ +return t(n)}function Qe(){return this}function Xe(n,t){return(of(n)?r:eo)(n,ye(t,3))}function nu(n,t){return(of(n)?e:uo)(n,ye(t,3))}function tu(n,t){return(of(n)?c:Gt)(n,ye(t,3))}function ru(n,t,r){return t=r?T:t,t=n&&null==t?n.length:t,fe(n,128,T,T,T,T,t)}function eu(n,t){var r;if(typeof t!="function")throw new ni("Expected a function");return n=Au(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=T),r}}function uu(n,t,r){return t=r?T:t,n=fe(n,8,T,T,T,T,T,t),n.placeholder=uu.placeholder, +n}function iu(n,t,r){return t=r?T:t,n=fe(n,16,T,T,T,T,T,t),n.placeholder=iu.placeholder,n}function ou(n,t,r){function e(t){var r=c,e=a;return c=a=T,_=t,s=n.apply(e,r)}function u(n){var r=n-p;return n-=_,p===T||r>=t||0>r||g&&n>=l}function i(){var n=Ko();if(u(n))return o(n);var r,e=yo;r=n-_,n=t-(n-p),r=g?Ui(n,l-r):n,h=e(i,r)}function o(n){return h=T,d&&c?e(n):(c=a=T,s)}function f(){var n=Ko(),r=u(n);if(c=arguments,a=this,p=n,r){if(h===T)return _=n=p,h=yo(i,t),v?e(n):s;if(g)return h=yo(i,t),e(p)}return h===T&&(h=yo(i,t)), +s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof n!="function")throw new ni("Expected a function");return t=Eu(t)||0,gu(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Li(Eu(r.maxWait)||0,t):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==T&&ao(h),_=0,c=p=a=h=T},f.flush=function(){return h===T?s:o(Ko())},f}function fu(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;return i.has(u)?i.get(u):(e=n.apply(this,e),r.cache=i.set(u,e)||i,e)}if(typeof n!="function"||null!=t&&typeof t!="function")throw new ni("Expected a function"); +return r.cache=new(fu.Cache||$n),r}function cu(n){if(typeof n!="function")throw new ni("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function au(n,t){return n===t||n!==n&&t!==t}function lu(n){return null!=n&&vu(n.length)&&!pu(n)}function su(n){return du(n)&&lu(n)}function hu(n){if(!du(n))return false;var t=Ot(n);return"[object Error]"==t||"[object DOMException]"==t||typeof n.message=="string"&&typeof n.name=="string"&&!bu(n); +}function pu(n){return!!gu(n)&&(n=Ot(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function _u(n){return typeof n=="number"&&n==Au(n)}function vu(n){return typeof n=="number"&&-1=n}function gu(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function du(n){return null!=n&&typeof n=="object"}function yu(n){return typeof n=="number"||du(n)&&"[object Number]"==Ot(n)}function bu(n){return!(!du(n)||"[object Object]"!=Ot(n))&&(n=gi(n), +null===n||(n=ii.call(n,"constructor")&&n.constructor,typeof n=="function"&&n instanceof n&&ui.call(n)==ai))}function xu(n){return typeof n=="string"||!of(n)&&du(n)&&"[object String]"==Ot(n)}function ju(n){return typeof n=="symbol"||du(n)&&"[object Symbol]"==Ot(n)}function wu(n){if(!n)return[];if(lu(n))return xu(n)?M(n):Ur(n);if(ji&&n[ji]){n=n[ji]();for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}return t=_o(n),("[object Map]"==t?W:"[object Set]"==t?U:Lu)(n)}function mu(n){return n?(n=Eu(n), +n===$||n===-$?1.7976931348623157e308*(0>n?-1:1):n===n?n:0):0===n?n:0}function Au(n){n=mu(n);var t=n%1;return n===n?t?n-t:n:0}function ku(n){return n?pt(Au(n),0,4294967295):0}function Eu(n){if(typeof n=="number")return n;if(ju(n))return F;if(gu(n)&&(n=typeof n.valueOf=="function"?n.valueOf():n,n=gu(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(un,"");var t=gn.test(n);return t||yn.test(n)?Mn(n.slice(2),t?2:8):vn.test(n)?F:+n}function Su(n){return Cr(n,Wu(n))}function Ou(n){return null==n?"":yr(n); +}function Iu(n,t,r){return n=null==n?T:Et(n,t),n===T?r:n}function Ru(n,t){return null!=n&&we(n,t,zt)}function zu(n){return lu(n)?qn(n):Vt(n)}function Wu(n){if(lu(n))n=qn(n,true);else if(gu(n)){var t,r=ze(n),e=[];for(t in n)("constructor"!=t||!r&&ii.call(n,t))&&e.push(t);n=e}else{if(t=[],null!=n)for(r in Yu(n))t.push(r);n=t}return n}function Bu(n,t){if(null==n)return{};var r=c(ve(n),function(n){return[n]});return t=ye(t),tr(n,r,function(n,r){return t(n,r[0])})}function Lu(n){return null==n?[]:S(n,zu(n)); +}function Uu(n){return Tf(Ou(n).toLowerCase())}function Cu(n){return(n=Ou(n))&&n.replace(xn,Xn).replace(Sn,"")}function Du(n,t,r){return n=Ou(n),t=r?T:t,t===T?zn.test(n)?n.match(In)||[]:n.match(sn)||[]:n.match(t)||[]}function Mu(n){return function(){return n}}function Tu(n){return n}function $u(n){return qt(typeof n=="function"?n:_t(n,1))}function Fu(n,t,e){var u=zu(t),i=kt(t,u);null!=e||gu(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=kt(t,zu(t)));var o=!(gu(e)&&"chain"in e&&!e.chain),f=pu(n);return r(i,function(r){ +var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Ur(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function Nu(){}function Pu(n){return Ie(n)?b(De(n)):rr(n)}function Zu(){return[]}function qu(){return false}mn=null==mn?Fn:rt.defaults(Fn.Object(),mn,rt.pick(Fn,Wn));var Vu=mn.Array,Ku=mn.Date,Gu=mn.Error,Hu=mn.Function,Ju=mn.Math,Yu=mn.Object,Qu=mn.RegExp,Xu=mn.String,ni=mn.TypeError,ti=Vu.prototype,ri=Yu.prototype,ei=mn["__core-js_shared__"],ui=Hu.prototype.toString,ii=ri.hasOwnProperty,oi=0,fi=function(){ +var n=/[^.]+$/.exec(ei&&ei.keys&&ei.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ci=ri.toString,ai=ui.call(Yu),li=Fn._,si=Qu("^"+ui.call(ii).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hi=Zn?mn.Buffer:T,pi=mn.Symbol,_i=mn.Uint8Array,vi=hi?hi.f:T,gi=B(Yu.getPrototypeOf,Yu),di=Yu.create,yi=ri.propertyIsEnumerable,bi=ti.splice,xi=pi?pi.isConcatSpreadable:T,ji=pi?pi.iterator:T,wi=pi?pi.toStringTag:T,mi=function(){try{var n=je(Yu,"defineProperty"); +return n({},"",{}),n}catch(n){}}(),Ai=mn.clearTimeout!==Fn.clearTimeout&&mn.clearTimeout,ki=Ku&&Ku.now!==Fn.Date.now&&Ku.now,Ei=mn.setTimeout!==Fn.setTimeout&&mn.setTimeout,Si=Ju.ceil,Oi=Ju.floor,Ii=Yu.getOwnPropertySymbols,Ri=hi?hi.isBuffer:T,zi=mn.isFinite,Wi=ti.join,Bi=B(Yu.keys,Yu),Li=Ju.max,Ui=Ju.min,Ci=Ku.now,Di=mn.parseInt,Mi=Ju.random,Ti=ti.reverse,$i=je(mn,"DataView"),Fi=je(mn,"Map"),Ni=je(mn,"Promise"),Pi=je(mn,"Set"),Zi=je(mn,"WeakMap"),qi=je(Yu,"create"),Vi=Zi&&new Zi,Ki={},Gi=Me($i),Hi=Me(Fi),Ji=Me(Ni),Yi=Me(Pi),Qi=Me(Zi),Xi=pi?pi.prototype:T,no=Xi?Xi.valueOf:T,to=Xi?Xi.toString:T,ro=function(){ +function n(){}return function(t){return gu(t)?di?di(t):(n.prototype=t,t=new n,n.prototype=T,t):{}}}();An.templateSettings={escape:J,evaluate:Y,interpolate:Q,variable:"",imports:{_:An}},An.prototype=kn.prototype,An.prototype.constructor=An,On.prototype=ro(kn.prototype),On.prototype.constructor=On,Un.prototype=ro(kn.prototype),Un.prototype.constructor=Un,Cn.prototype.clear=function(){this.__data__=qi?qi(null):{},this.size=0},Cn.prototype.delete=function(n){return n=this.has(n)&&delete this.__data__[n], +this.size-=n?1:0,n},Cn.prototype.get=function(n){var t=this.__data__;return qi?(n=t[n],"__lodash_hash_undefined__"===n?T:n):ii.call(t,n)?t[n]:T},Cn.prototype.has=function(n){var t=this.__data__;return qi?t[n]!==T:ii.call(t,n)},Cn.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=qi&&t===T?"__lodash_hash_undefined__":t,this},Tn.prototype.clear=function(){this.__data__=[],this.size=0},Tn.prototype.delete=function(n){var t=this.__data__;return n=ft(t,n),!(0>n)&&(n==t.length-1?t.pop():bi.call(t,n,1), +--this.size,true)},Tn.prototype.get=function(n){var t=this.__data__;return n=ft(t,n),0>n?T:t[n][1]},Tn.prototype.has=function(n){return-1e?(++this.size,r.push([n,t])):r[e][1]=t,this},$n.prototype.clear=function(){this.size=0,this.__data__={hash:new Cn,map:new(Fi||Tn),string:new Cn}},$n.prototype.delete=function(n){return n=be(this,n).delete(n),this.size-=n?1:0,n},$n.prototype.get=function(n){return be(this,n).get(n); +},$n.prototype.has=function(n){return be(this,n).has(n)},$n.prototype.set=function(n,t){var r=be(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Nn.prototype.add=Nn.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},Nn.prototype.has=function(n){return this.__data__.has(n)},Pn.prototype.clear=function(){this.__data__=new Tn,this.size=0},Pn.prototype.delete=function(n){var t=this.__data__;return n=t.delete(n),this.size=t.size,n},Pn.prototype.get=function(n){ +return this.__data__.get(n)},Pn.prototype.has=function(n){return this.__data__.has(n)},Pn.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Tn){var e=r.__data__;if(!Fi||199>e.length)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new $n(e)}return r.set(n,t),this.size=r.size,this};var eo=Fr(mt),uo=Fr(At,true),io=Nr(),oo=Nr(true),fo=Vi?function(n,t){return Vi.set(n,t),n}:Tu,co=mi?function(n,t){return mi(n,"toString",{configurable:true,enumerable:false,value:Mu(t),writable:true})}:Tu,ao=Ai||function(n){ +return Fn.clearTimeout(n)},lo=Pi&&1/U(new Pi([,-0]))[1]==$?function(n){return new Pi(n)}:Nu,so=Vi?function(n){return Vi.get(n)}:Nu,ho=Ii?function(n){return null==n?[]:(n=Yu(n),i(Ii(n),function(t){return yi.call(n,t)}))}:Zu,po=Ii?function(n){for(var t=[];n;)a(t,ho(n)),n=gi(n);return t}:Zu,_o=Ot;($i&&"[object DataView]"!=_o(new $i(new ArrayBuffer(1)))||Fi&&"[object Map]"!=_o(new Fi)||Ni&&"[object Promise]"!=_o(Ni.resolve())||Pi&&"[object Set]"!=_o(new Pi)||Zi&&"[object WeakMap]"!=_o(new Zi))&&(_o=function(n){ +var t=Ot(n);if(n=(n="[object Object]"==t?n.constructor:T)?Me(n):"")switch(n){case Gi:return"[object DataView]";case Hi:return"[object Map]";case Ji:return"[object Promise]";case Yi:return"[object Set]";case Qi:return"[object WeakMap]"}return t});var vo=ei?pu:qu,go=Ue(fo),yo=Ei||function(n,t){return Fn.setTimeout(n,t)},bo=Ue(co),xo=function(n){n=fu(n,function(n){return 500===t.size&&t.clear(),n});var t=n.cache;return n}(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(tn,function(n,r,e,u){ +t.push(e?u.replace(hn,"$1"):r||n)}),t}),jo=fr(function(n,t){return su(n)?yt(n,wt(t,1,su,true)):[]}),wo=fr(function(n,t){var r=qe(t);return su(r)&&(r=T),su(n)?yt(n,wt(t,1,su,true),ye(r,2)):[]}),mo=fr(function(n,t){var r=qe(t);return su(r)&&(r=T),su(n)?yt(n,wt(t,1,su,true),T,r):[]}),Ao=fr(function(n){var t=c(n,kr);return t.length&&t[0]===n[0]?Wt(t):[]}),ko=fr(function(n){var t=qe(n),r=c(n,kr);return t===qe(r)?t=T:r.pop(),r.length&&r[0]===n[0]?Wt(r,ye(t,2)):[]}),Eo=fr(function(n){var t=qe(n),r=c(n,kr);return(t=typeof t=="function"?t:T)&&r.pop(), +r.length&&r[0]===n[0]?Wt(r,T,t):[]}),So=fr(Ve),Oo=pe(function(n,t){var r=null==n?0:n.length,e=ht(n,t);return ur(n,c(t,function(n){return Se(n,r)?+n:n}).sort(Wr)),e}),Io=fr(function(n){return br(wt(n,1,su,true))}),Ro=fr(function(n){var t=qe(n);return su(t)&&(t=T),br(wt(n,1,su,true),ye(t,2))}),zo=fr(function(n){var t=qe(n),t=typeof t=="function"?t:T;return br(wt(n,1,su,true),T,t)}),Wo=fr(function(n,t){return su(n)?yt(n,t):[]}),Bo=fr(function(n){return mr(i(n,su))}),Lo=fr(function(n){var t=qe(n);return su(t)&&(t=T), +mr(i(n,su),ye(t,2))}),Uo=fr(function(n){var t=qe(n),t=typeof t=="function"?t:T;return mr(i(n,su),T,t)}),Co=fr(Ge),Do=fr(function(n){var t=n.length,t=1=t}),uf=Ut(function(){return arguments}())?Ut:function(n){return du(n)&&ii.call(n,"callee")&&!yi.call(n,"callee")},of=Vu.isArray,ff=Vn?E(Vn):Ct,cf=Ri||qu,af=Kn?E(Kn):Dt,lf=Gn?E(Gn):Tt,sf=Hn?E(Hn):Nt,hf=Jn?E(Jn):Pt,pf=Yn?E(Yn):Zt,_f=ee(Kt),vf=ee(function(n,t){return n<=t}),gf=$r(function(n,t){ +if(ze(t)||lu(t))Cr(t,zu(t),n);else for(var r in t)ii.call(t,r)&&ot(n,r,t[r])}),df=$r(function(n,t){Cr(t,Wu(t),n)}),yf=$r(function(n,t,r,e){Cr(t,Wu(t),n,e)}),bf=$r(function(n,t,r,e){Cr(t,zu(t),n,e)}),xf=pe(ht),jf=fr(function(n,t){n=Yu(n);var r=-1,e=t.length,u=2--n)return t.apply(this,arguments)}},An.ary=ru,An.assign=gf,An.assignIn=df,An.assignInWith=yf,An.assignWith=bf,An.at=xf,An.before=eu,An.bind=Go,An.bindAll=Ff,An.bindKey=Ho,An.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return of(n)?n:[n]},An.chain=Je,An.chunk=function(n,t,r){if(t=(r?Oe(n,t,r):t===T)?1:Li(Au(t),0),r=null==n?0:n.length,!r||1>t)return[];for(var e=0,u=0,i=Vu(Si(r/t));et?0:t,e)):[]},An.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Au(t),t=e-t,hr(n,0,0>t?0:t)):[]},An.dropRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true,true):[]; +},An.dropWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true):[]},An.fill=function(n,t,r,e){var u=null==n?0:n.length;if(!u)return[];for(r&&typeof r!="number"&&Oe(n,t,r)&&(r=0,e=u),u=n.length,r=Au(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:Au(e),0>e&&(e+=u),e=r>e?0:ku(e);r>>0,r?(n=Ou(n))&&(typeof t=="string"||null!=t&&!sf(t))&&(t=yr(t),!t&&Rn.test(n))?Or(M(n),0,r):n.split(t,r):[]},An.spread=function(t,r){if(typeof t!="function")throw new ni("Expected a function");return r=null==r?0:Li(Au(r),0), +fr(function(e){var u=e[r];return e=Or(e,0,r),u&&a(e,u),n(t,this,e)})},An.tail=function(n){var t=null==n?0:n.length;return t?hr(n,1,t):[]},An.take=function(n,t,r){return n&&n.length?(t=r||t===T?1:Au(t),hr(n,0,0>t?0:t)):[]},An.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Au(t),t=e-t,hr(n,0>t?0:t,e)):[]},An.takeRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),false,true):[]},An.takeWhile=function(n,t){return n&&n.length?jr(n,ye(t,3)):[]},An.tap=function(n,t){return t(n), +n},An.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ni("Expected a function");return gu(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),ou(n,t,{leading:e,maxWait:t,trailing:u})},An.thru=Ye,An.toArray=wu,An.toPairs=Rf,An.toPairsIn=zf,An.toPath=function(n){return of(n)?c(n,De):ju(n)?[n]:Ur(xo(Ou(n)))},An.toPlainObject=Su,An.transform=function(n,t,e){var u=of(n),i=u||cf(n)||pf(n);if(t=ye(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:gu(n)&&pu(o)?ro(gi(n)):{}; +}return(i?r:mt)(n,function(n,r,u){return t(e,n,r,u)}),e},An.unary=function(n){return ru(n,1)},An.union=Io,An.unionBy=Ro,An.unionWith=zo,An.uniq=function(n){return n&&n.length?br(n):[]},An.uniqBy=function(n,t){return n&&n.length?br(n,ye(t,2)):[]},An.uniqWith=function(n,t){return t=typeof t=="function"?t:T,n&&n.length?br(n,T,t):[]},An.unset=function(n,t){return null==n||xr(n,t)},An.unzip=Ge,An.unzipWith=He,An.update=function(n,t,r){return null==n?n:lr(n,t,Er(r)(Et(n,t)),void 0)},An.updateWith=function(n,t,r,e){ +return e=typeof e=="function"?e:T,null!=n&&(n=lr(n,t,Er(r)(Et(n,t)),e)),n},An.values=Lu,An.valuesIn=function(n){return null==n?[]:S(n,Wu(n))},An.without=Wo,An.words=Du,An.wrap=function(n,t){return Xo(Er(t),n)},An.xor=Bo,An.xorBy=Lo,An.xorWith=Uo,An.zip=Co,An.zipObject=function(n,t){return Ar(n||[],t||[],ot)},An.zipObjectDeep=function(n,t){return Ar(n||[],t||[],lr)},An.zipWith=Do,An.entries=Rf,An.entriesIn=zf,An.extend=df,An.extendWith=yf,Fu(An,An),An.add=Yf,An.attempt=$f,An.camelCase=Wf,An.capitalize=Uu, +An.ceil=Qf,An.clamp=function(n,t,r){return r===T&&(r=t,t=T),r!==T&&(r=Eu(r),r=r===r?r:0),t!==T&&(t=Eu(t),t=t===t?t:0),pt(Eu(n),t,r)},An.clone=function(n){return _t(n,4)},An.cloneDeep=function(n){return _t(n,5)},An.cloneDeepWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,5,t)},An.cloneWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,4,t)},An.conformsTo=function(n,t){return null==t||gt(n,t,zu(t))},An.deburr=Cu,An.defaultTo=function(n,t){return null==n||n!==n?t:n},An.divide=Xf,An.endsWith=function(n,t,r){ +n=Ou(n),t=yr(t);var e=n.length,e=r=r===T?e:pt(Au(r),0,e);return r-=t.length,0<=r&&n.slice(r,e)==t},An.eq=au,An.escape=function(n){return(n=Ou(n))&&H.test(n)?n.replace(K,nt):n},An.escapeRegExp=function(n){return(n=Ou(n))&&en.test(n)?n.replace(rn,"\\$&"):n},An.every=function(n,t,r){var e=of(n)?u:bt;return r&&Oe(n,t,r)&&(t=T),e(n,ye(t,3))},An.find=$o,An.findIndex=Fe,An.findKey=function(n,t){return p(n,ye(t,3),mt)},An.findLast=Fo,An.findLastIndex=Ne,An.findLastKey=function(n,t){return p(n,ye(t,3),At); +},An.floor=nc,An.forEach=Xe,An.forEachRight=nu,An.forIn=function(n,t){return null==n?n:io(n,ye(t,3),Wu)},An.forInRight=function(n,t){return null==n?n:oo(n,ye(t,3),Wu)},An.forOwn=function(n,t){return n&&mt(n,ye(t,3))},An.forOwnRight=function(n,t){return n&&At(n,ye(t,3))},An.get=Iu,An.gt=rf,An.gte=ef,An.has=function(n,t){return null!=n&&we(n,t,Rt)},An.hasIn=Ru,An.head=Ze,An.identity=Tu,An.includes=function(n,t,r,e){return n=lu(n)?n:Lu(n),r=r&&!e?Au(r):0,e=n.length,0>r&&(r=Li(e+r,0)),xu(n)?r<=e&&-1r&&(r=Li(e+r,0)),v(n,t,r)):-1},An.inRange=function(n,t,r){return t=mu(t),r===T?(r=t,t=0):r=mu(r),n=Eu(n),n>=Ui(t,r)&&n=n},An.isSet=hf,An.isString=xu,An.isSymbol=ju,An.isTypedArray=pf,An.isUndefined=function(n){return n===T},An.isWeakMap=function(n){return du(n)&&"[object WeakMap]"==_o(n)},An.isWeakSet=function(n){return du(n)&&"[object WeakSet]"==Ot(n)},An.join=function(n,t){return null==n?"":Wi.call(n,t)},An.kebabCase=Bf,An.last=qe,An.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;if(r!==T&&(u=Au(r),u=0>u?Li(e+u,0):Ui(u,e-1)), +t===t){for(r=u+1;r--&&n[r]!==t;);n=r}else n=_(n,d,u,true);return n},An.lowerCase=Lf,An.lowerFirst=Uf,An.lt=_f,An.lte=vf,An.max=function(n){return n&&n.length?xt(n,Tu,It):T},An.maxBy=function(n,t){return n&&n.length?xt(n,ye(t,2),It):T},An.mean=function(n){return y(n,Tu)},An.meanBy=function(n,t){return y(n,ye(t,2))},An.min=function(n){return n&&n.length?xt(n,Tu,Kt):T},An.minBy=function(n,t){return n&&n.length?xt(n,ye(t,2),Kt):T},An.stubArray=Zu,An.stubFalse=qu,An.stubObject=function(){return{}},An.stubString=function(){ +return""},An.stubTrue=function(){return true},An.multiply=tc,An.nth=function(n,t){return n&&n.length?Qt(n,Au(t)):T},An.noConflict=function(){return Fn._===this&&(Fn._=li),this},An.noop=Nu,An.now=Ko,An.pad=function(n,t,r){n=Ou(n);var e=(t=Au(t))?D(n):0;return!t||e>=t?n:(t=(t-e)/2,ne(Oi(t),r)+n+ne(Si(t),r))},An.padEnd=function(n,t,r){n=Ou(n);var e=(t=Au(t))?D(n):0;return t&&et){var e=n;n=t,t=e}return r||n%1||t%1?(r=Mi(),Ui(n+r*(t-n+Dn("1e-"+((r+"").length-1))),t)):ir(n,t)},An.reduce=function(n,t,r){var e=of(n)?l:j,u=3>arguments.length;return e(n,ye(t,4),r,u,eo)},An.reduceRight=function(n,t,r){var e=of(n)?s:j,u=3>arguments.length; +return e(n,ye(t,4),r,u,uo)},An.repeat=function(n,t,r){return t=(r?Oe(n,t,r):t===T)?1:Au(t),or(Ou(n),t)},An.replace=function(){var n=arguments,t=Ou(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},An.result=function(n,t,r){t=Sr(t,n);var e=-1,u=t.length;for(u||(u=1,n=T);++en||9007199254740991=i)return n;if(i=r-D(e),1>i)return e;if(r=o?Or(o,0,i).join(""):n.slice(0,i),u===T)return r+e;if(o&&(i+=r.length-i),sf(u)){if(n.slice(i).search(u)){var f=r;for(u.global||(u=Qu(u.source,Ou(_n.exec(u))+"g")), +u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===T?i:c)}}else n.indexOf(yr(u),i)!=i&&(u=r.lastIndexOf(u),-1e.__dir__?"Right":"")}),e},Un.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;Un.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({ +iteratee:ye(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){var r="take"+(t?"Right":"");Un.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Un.prototype[n]=function(){return this.__filtered__?new Un(this):this[r](1)}}),Un.prototype.compact=function(){return this.filter(Tu)},Un.prototype.find=function(n){return this.filter(n).head()},Un.prototype.findLast=function(n){return this.reverse().find(n); +},Un.prototype.invokeMap=fr(function(n,t){return typeof n=="function"?new Un(this):this.map(function(r){return Lt(r,n,t)})}),Un.prototype.reject=function(n){return this.filter(cu(ye(n)))},Un.prototype.slice=function(n,t){n=Au(n);var r=this;return r.__filtered__&&(0t)?new Un(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==T&&(t=Au(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},Un.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Un.prototype.toArray=function(){return this.take(4294967295); +},mt(Un.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=An[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(An.prototype[t]=function(){function t(n){return n=u.apply(An,a([n],f)),e&&h?n[0]:n}var o=this.__wrapped__,f=e?[1]:arguments,c=o instanceof Un,l=f[0],s=c||of(o);s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,l=i&&!h,c=c&&!p;return!i&&s?(o=c?o:new Un(this),o=n.apply(o,f),o.__actions__.push({ +func:Ye,args:[t],thisArg:T}),new On(o,h)):l&&c?n.apply(this,f):(o=this.thru(t),l?e?o.value()[0]:o.value():o)})}),r("pop push shift sort splice unshift".split(" "),function(n){var t=ti[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);An.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(of(u)?u:[],n)}return this[r](function(r){return t.apply(of(r)?r:[],n)})}}),mt(Un.prototype,function(n,t){var r=An[t];if(r){var e=r.name+""; +(Ki[e]||(Ki[e]=[])).push({name:t,func:r})}}),Ki[Jr(T,2).name]=[{name:"wrapper",func:T}],Un.prototype.clone=function(){var n=new Un(this.__wrapped__);return n.__actions__=Ur(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Ur(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Ur(this.__views__),n},Un.prototype.reverse=function(){if(this.__filtered__){var n=new Un(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n; +},Un.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=of(t),u=0>r,i=e?t.length:0;n=i;for(var o=this.__views__,f=0,c=-1,a=o.length;++c=this.__values__.length;return{done:n,value:n?T:this.__values__[this.__index__++]}},An.prototype.plant=function(n){for(var t,r=this;r instanceof kn;){ +var e=$e(r);e.__index__=0,e.__values__=T,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},An.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Un?(this.__actions__.length&&(n=new Un(this)),n=n.reverse(),n.__actions__.push({func:Ye,args:[Ke],thisArg:T}),new On(n,this.__chain__)):this.thru(Ke)},An.prototype.toJSON=An.prototype.valueOf=An.prototype.value=function(){return wr(this.__wrapped__,this.__actions__)},An.prototype.first=An.prototype.head,ji&&(An.prototype[ji]=Qe), +An}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Fn._=rt, define(function(){return rt})):Pn?((Pn.exports=rt)._=rt,Nn._=rt):Fn._=rt}).call(this); \ No newline at end of file diff --git a/templates/layout.html b/templates/layout.html index 3916c89..0b26f9a 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -12,13 +12,19 @@ - + + + + +{# #} + +
@@ -161,30 +174,23 @@
- +
- -
- -
-