diff options
author | Minteck <contact@minteck.org> | 2022-01-12 18:58:54 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-01-12 18:58:54 +0100 |
commit | d0982c5250d2e33c824ddccb8bd245ca39faa724 (patch) | |
tree | 0b1fac648c4214c29f22629555ada2f3a2dcdb5d | |
parent | 6dc0f517f78af1ff3f7d9fd763873194517ff4fd (diff) | |
download | genealogy-d0982c5250d2e33c824ddccb8bd245ca39faa724.tar.gz genealogy-d0982c5250d2e33c824ddccb8bd245ca39faa724.tar.bz2 genealogy-d0982c5250d2e33c824ddccb8bd245ca39faa724.zip |
Upadte
54 files changed, 4629 insertions, 49 deletions
@@ -1 +1 @@ -private
\ No newline at end of file +private/data
\ No newline at end of file diff --git a/dllib/.gitignore b/dllib/.gitignore new file mode 100644 index 0000000..dacf83a --- /dev/null +++ b/dllib/.gitignore @@ -0,0 +1,2 @@ +*.code-workspace +prepros.config diff --git a/dllib/LICENSE b/dllib/LICENSE new file mode 100644 index 0000000..4c1e58f --- /dev/null +++ b/dllib/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) Sérgio Dinis Lopes + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/dllib/README.md b/dllib/README.md new file mode 100644 index 0000000..2700445 --- /dev/null +++ b/dllib/README.md @@ -0,0 +1,20 @@ +jQuery.Flexdatalist +====== + +Flexdatalist is (another) jQuery autocomplete plugin with support for <code><datalist></code>. Check the documentation page to see the plugin in action. + +## Demo & Documentation ## + +Check out the [examples and documentation](http://projects.sergiodinislopes.pt/flexdatalist/) page. + +## Roadmap + +- Improve accessibility +- Allow the search to be disabled on flexdatalist and just use the given list (from server-side) +- Use CSS grid to list multiple selected values +- Regex in JS has bad support for special and accented characters, I'll try to make some improvements __(it works since v2.3.0, but it won't highlight the word, though)__ +- Make it jQuery independent (this will take a while to make it to a release) + +### License +Flexdatalist is licensed under the [MIT license](http://opensource.org/licenses/MIT). +Copyright (c) 2016 - 2021 [Sérgio Dinis Lopes](http://github.com/sergiodlopes)
\ No newline at end of file diff --git a/dllib/bower.json b/dllib/bower.json new file mode 100644 index 0000000..69ff491 --- /dev/null +++ b/dllib/bower.json @@ -0,0 +1,8 @@ +{ + "name": "jquery-flexdatalist", + "version": "2.3.0", + "main": ["jquery.flexdatalist.js"], + "dependencies": { + "jquery": ">=1.8" + } +} diff --git a/dllib/jquery.flexdatalist.css b/dllib/jquery.flexdatalist.css new file mode 100644 index 0000000..03e1b9c --- /dev/null +++ b/dllib/jquery.flexdatalist.css @@ -0,0 +1,134 @@ +/** + * jQuery Flexdatalist basic stylesheet. + * + * Version: + * 2.2.1 + * + * Github: + * https://github.com/sergiodlopes/jquery-flexdatalist/ + * + */ +.flexdatalist-results { + position: absolute; + top: 0; + left: 0; + border: 1px solid #444; + border-top: none; + background: #fff; + z-index: 100000; + max-height: 300px; + overflow-y: auto; + box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15); + color: #333; + list-style: none; + margin: 0; + padding: 0; +} +.flexdatalist-results li { + border-bottom: 1px solid #ccc; + padding: 8px 15px; + font-size: 14px; + line-height: 20px; +} +.flexdatalist-results li span.highlight { + font-weight: 700; + text-decoration: underline; +} +.flexdatalist-results li.active { + background: #2B82C9; + color: #fff; + cursor: pointer; +} +.flexdatalist-results li.no-results { + font-style: italic; + color: #888; +} + +/** + * Grouped items + */ +.flexdatalist-results li.group { + background: #F3F3F4; + color: #666; + padding: 8px 8px; +} +.flexdatalist-results li .group-name { + font-weight: 700; +} +.flexdatalist-results li .group-item-count { + font-size: 85%; + color: #777; + display: inline-block; + padding-left: 10px; +} + +/** + * Multiple items + */ +.flexdatalist-multiple:before { + content: ''; + display: block; + clear: both; +} +.flexdatalist-multiple { + width: 100%; + margin: 0; + padding: 0; + list-style: none; + text-align: left; + cursor: text; +} +.flexdatalist-multiple.disabled { + background-color: #eee; + cursor: default; +} +.flexdatalist-multiple:after { + content: ''; + display: block; + clear: both; +} +.flexdatalist-multiple li { + display: inline-block; + position: relative; + margin: 5px; +} +.flexdatalist-multiple li.input-container, +.flexdatalist-multiple li.input-container input { + border: none; + height: auto; + padding: 0 0 0 4px; + line-height: 24px; +} + +.flexdatalist-multiple li.value { + display: inline-block; + padding: 2px 25px 2px 7px; + background: #efefef; + border-radius: 3px; + color: #444; + line-height: 20px; + float: left; +} +.flexdatalist-multiple li.toggle { + cursor: pointer; + transition: opacity ease-in-out 300ms; +} +.flexdatalist-multiple li.toggle.disabled { + text-decoration: line-through; + opacity: 0.80; +} + +.flexdatalist-multiple li.value span.fdl-remove { + font-weight: 700; + padding: 2px 5px; + font-size: 20px; + line-height: 20px; + cursor: pointer; + position: absolute; + top: 0; + right: 0; + opacity: 0.70; +} +.flexdatalist-multiple li.value span.fdl-remove:hover { + opacity: 1; +} diff --git a/dllib/jquery.flexdatalist.js b/dllib/jquery.flexdatalist.js new file mode 100644 index 0000000..6fef98b --- /dev/null +++ b/dllib/jquery.flexdatalist.js @@ -0,0 +1,2083 @@ +/** + * jQuery Flexdatalist. + * Autocomplete input fields, with support for datalists. + * + * Version: + * 2.3.0 + * + * Depends: + * jquery.js > 1.8.3 + * + * Demo and Documentation: + * http://projects.sergiodinislopes.pt/flexdatalist/ + * + * Github: + * https://github.com/sergiodlopes/jquery-flexdatalist/ + * + */ + +jQuery.fn.flexdatalist = function (_option, _value) { + 'use strict'; + + var destroy = function ($flex, clear) { + $flex.each(function () { + var $this = $(this), + data = $this.data(), + options = data.flexdatalist, + $aliascontainer = data.aliascontainer; + + if ($aliascontainer) { + $this.removeClass('flexdatalist-set') + .attr({'style': null, 'tabindex': null}) + .val((options && options.originalValue && !clear ? options.originalValue : '')) + .removeData('flexdatalist') + .removeData('aliascontainer') + .off(); + $aliascontainer.remove(); + } + }); + } + + // Callable stuff + if (typeof _option === 'string' && _option !== 'reset') { + if (typeof this[0] === 'object' && typeof this[0].fvalue !== 'undefined') { + var target = this[0]; + if (_option === 'destroy') { + destroy(this, _value); + // Get/Set value + } else if (_option === 'value') { + if (typeof _value === 'undefined') { + return target.fvalue.get(); + } + target.fvalue.set(_value); + // Add value + } else if (_option === 'add') { + if (typeof _value === 'undefined') { + return target.debug('Missing value to add!'); + } + target.fvalue.add(_value); + // Toggle value + } else if (_option === 'toggle') { + if (typeof _value === 'undefined') { + return target.debug('Missing value to toggle!'); + } + target.fvalue.toggle(_value); + // Remove value + } else if (_option === 'remove') { + if (typeof _value === 'undefined') { + return target.debug('Missing value to remove!'); + } + target.fvalue.remove(_value); + // Disabled/enabled + } else if (_option === 'disabled') { + if (typeof _value === 'undefined') { + return target.fdisabled(); + } + target.fdisabled(_value); + // Option(s) + } else if (typeof _option === 'string') { + if (typeof _value === 'undefined') { + return target.options.get(_option); + } + target.options.set(_option, _value); + } + return this; + } + _option = {_option: _value}; + } + + // Destroy if already set + if (this.length > 0 && typeof this[0].fvalue !== 'undefined') { + destroy(this); + } + + var _options = $.extend({ + url: null, + data: [], + params: {}, + relatives: null, + chainedRelatives: false, + cache: true, + cacheLifetime: 60, + minLength: 3, + groupBy: false, + selectionRequired: false, + focusFirstResult: false, + textProperty: null, + valueProperty: null, + visibleProperties: [], + iconProperty: 'thumb', + searchIn: ['label'], + searchContain: false, + searchEqual: false, + searchByWord: false, + searchDisabled: false, + searchDelay: 400, + normalizeString: null, + multiple: null, + disabled: null, + maxShownResults: 100, + removeOnBackspace: true, + noResultsText: 'No results found for "{keyword}"', + toggleSelected: false, + allowDuplicateValues: false, + redoSearchOnFocus: true, + requestType: 'get', + requestContentType: 'x-www-form-urlencoded', + requestHeaders: null, + resultsProperty: 'results', + keywordParamName: 'keyword', + searchContainParamName: 'contain', + limitOfValues: 0, + valuesSeparator: ',', + debug: true + }, _option); + + return this.each(function (id) { + var $this = $(this), + _this = this, + _searchTimeout = null, + _values = [], + fid = 'flex' + id, + $alias = null, + $multiple = null; + + /** + * Initialization + */ + this.init = function () { + var options = this.options.init(); + this.set.up(); + + $alias + // Focusin + .on('focusin', function (event) { + _this.action.redoSearchFocus(event); + _this.action.showAllResults(event); + if ($multiple) { + $multiple.addClass('focus'); + } + }) + // Keydown + .on('input keydown', function (event) { + if (_this.keyNum(event) === 9) { + _this.results.remove(); + } + _this.action.keypressValue(event, 188); + _this.action.backSpaceKeyRemove(event); + }) + // Keyup + .on('input keyup', function (event) { + _this.action.keypressValue(event, 13); + _this.action.keypressSearch(event); + _this.action.copyValue(event); + _this.action.backSpaceKeyRemove(event); + _this.action.showAllResults(event); + _this.action.clearValue(event); + _this.action.removeResults(event); + _this.action.inputWidth(event); + }) + // Focusout + .on('focusout', function (event) { + if ($multiple) { + $multiple.removeClass('focus'); + } + _this.action.clearText(event); + _this.action.clearValue(event); + }); + + window.onresize = function (event) { + _this.position(); + }; + + // Run garbage collector + this.cache.gc(); + + if (options.selectionRequired) { + _this.fvalue.clear(true, true); + } + this.fvalue._load(options.originalValue, function (values, matches) { + _this.fdisabled(options.disabled); + $this.trigger('init:flexdatalist', [options]); + }, true); + } + + /** + * Handle user actions. + */ + this.action = { + /** + * Add value on comma or enter keypress. + */ + keypressValue: function (event, keyCode) { + var key = _this.keyNum(event), + val = $alias[0].value, + options = _this.options.get(); + + if (val.length > 0 + && key === keyCode + && !options.selectionRequired + && options.multiple) { + var val = $alias[0].value; + event.preventDefault(); + event.stopPropagation(); + _this.fvalue.extract(val); + _this.results.remove(); + } + }, + /** + * Check if keypress is valid. + */ + keypressSearch: function (event) { + var key = _this.keyNum(event), + keyword = $alias.val(), + length = keyword.length, + options = _this.options.get(); + + clearTimeout(_searchTimeout); + if (!key || (key !== 13 && (key < 37 || key > 40))) { + _searchTimeout = setTimeout(function () { + if ((options.minLength === 0 && length > 0) || (options.minLength > 0 && length >= options.minLength)) { + _this.data.load(function (data) { + _this.search.get(keyword, data, function (matches) { + _this.results.show(matches); + }); + }); + } + }, options.searchDelay); + } + }, + /** + * Redo search if input get's back on focus and no value selected. + */ + redoSearchFocus: function (event) { + var val = _this.fvalue.get(), + options = _this.options.get(), + alias = $alias.val(); + if (options.redoSearchOnFocus && ((alias.length > 0 && options.multiple) || (alias.length > 0 && val.length === 0))) { + this.keypressSearch(event); + } + }, + /** + * Copy value from alias to target input. + */ + copyValue: function (event) { + if (_this.keyNum(event) !== 13) { + var keyword = $alias.val(), + val = _this.fvalue.get(true), + options = _this.options.get(); + if (!options.multiple && !options.selectionRequired && keyword.length !== val.length) { + _this.fvalue.extract(keyword); + } + } + }, + /** + * Remove value on backspace key (multiple input only). + */ + backSpaceKeyRemove: function (event) { + var options = _this.options.get(); + if (options.removeOnBackspace && options.multiple) { + var val = $alias.val(), + $remove = $alias.data('_remove'); + if (_this.keyNum(event) === 8) { + if (val.length === 0) { + if ($remove) { + _this.fvalue.remove($remove); + $alias.data('_remove', null); + } else { + $alias.data('_remove', $alias.parents('li:eq(0)').prev()); + } + } else { + $alias.data('_remove', null); + } + } + } + }, + /** + * Show all results if minLength option is 0. + */ + showAllResults: function (event) { + var val = $alias.val(); + val = $.trim(val); + if (val === '' && _this.options.get('minLength') === 0) { + _this.data.load(function (data) { + _this.results.show(data); + }); + } + }, + /** + * Calculate input width by number of characters. + */ + inputWidth: function (event) { + var options = _this.options.get(); + if (options.multiple) { + var keyword = $alias.val(), + fontSize = parseInt($alias.css('fontSize').replace('px', '')), + minWidth = 40, + maxWidth = $this.innerWidth(), + width = ((keyword.length + 1) * fontSize); + + if (width >= minWidth && width <= maxWidth) { + $alias[0].style.width = width + 'px'; + } + } + }, + /** + * Clear text/alias input when criteria is met. + */ + clearText: function (event) { + var val = _this.fvalue.get(), + options = _this.options.get(); + + if (!options.multiple && options.selectionRequired && val.length === 0) { + $alias[0].value = ''; + } + }, + /** + * Clear value when criteria is met. + */ + clearValue: function (event) { + var val = _this.fvalue.get(), + keyword = $alias.val(), + options = _this.options.get(); + + if (!options.multiple && options.selectionRequired && keyword.length <= options.minLength) { + _this.fvalue.clear(); + } + }, + /** + * Remove results when criteria is met. + */ + removeResults: function (event) { + var keyword = $alias.val(), + options = _this.options.get(); + if (options.minLength > 0 && keyword.length < options.minLength) { + _this.results.remove(); + } + } + } + + /** + * Setup flex. + */ + this.set = { + /** + * Prepare input replacement. + */ + up: function () { + $alias = this.getAlias(); + if (_this.options.get('multiple')) { + $multiple = this.multipleInput($alias); + } else { + $alias.insertAfter($this); + } + + this.accessibility($alias); + + // Respect autofocus attribute + if ($this.attr('autofocus')) { + $alias.trigger('focus'); + } + + $this.data('aliascontainer', ($multiple ? $multiple : $alias)).addClass('flexdatalist flexdatalist-set').css({ + 'position': 'absolute', + 'top': -14000, + 'left': -14000 + }).attr('tabindex', -1); + + // update input label with alias id + var inputId = $this.attr('id'), + aliasId = $alias.attr('id'); + $('label[for="' + inputId + '"]').attr('for', aliasId); + + this.chained(); + }, + /** + * Create and return the alias input field for single value input. + */ + getAlias: function () { + var aliasid = ($this.attr('id') ? $this.attr('id') + '-flexdatalist' : fid); + var $alias = $('<input type="text">') + .attr({ + 'class': $this.attr('class'), + 'name': ($this.attr('name') ? 'flexdatalist-' + $this.attr('name') : null), + 'id': aliasid, + 'placeholder': $this.attr('placeholder') + }) + .addClass('flexdatalist-alias ' + aliasid) + .removeClass('flexdatalist') + .attr('autocomplete', 'off'); + return $alias; + }, + /** + * Multiple values input/list + */ + multipleInput: function ($alias) { + $multiple = $('<ul tabindex="1">') + .addClass('flexdatalist-multiple ' + fid) + .css({ + 'border-color': $this.css('border-left-color'), + 'border-width': $this.css('border-left-width'), + 'border-style': $this.css('border-left-style'), + 'border-radius': $this.css('border-top-left-radius'), + 'background-color': $this.css('background-color') + }) + .insertAfter($this).on('click', function () { + $(this).find('input').trigger('focus'); + }); + + $('<li class="input-container">') + .addClass('flexdatalist-multiple-value') + .append($alias) + .appendTo($multiple); + + return $multiple; + }, + /** + * Chained inputs handling. + */ + chained: function () { + var options = _this.options.get(); + if (options.relatives && options.chainedRelatives) { + var toggle = function (init) { + options.relatives.each(function () { + var emptyRelative = _this.isEmpty($(this).val()), + empty = _this.isEmpty(_this.value); + // If disabling, clear all values + if (emptyRelative || !empty) { + _this.fvalue.clear(); + } + _this.fdisabled(emptyRelative); + }); + }; + options.relatives.on('change', function () { + toggle(); + }); + toggle(true); + } + }, + /** + * Accessibility. + */ + accessibility: function ($input) { + var aliasid = ($this.attr('id') ? $this.attr('id') + '-flexdatalist' : fid); + var scrReaderAttr = { + 'aria-autocomplete': 'list', + 'aria-expanded': 'false', + 'aria-owns': aliasid + '-results', + }; + + $input.attr(scrReaderAttr); + } + } + + /** + * Process input value(s) (where the magic happens). + */ + this.fvalue = { + /** + * Get value(s). + */ + get: function (asString) { + var val = _this.value, + options = _this.options.get(); + if ((options.multiple || this.isJSON()) && !asString) { + return this.toObj(val); + } + return val; + }, + /** + * Set value. + * Parse value if necessary. + */ + set: function (val, append) { + if (!_this.fdisabled()) { + if (!append) { + this.clear(true); + } + this._load(val); + } + return $this; + }, + /** + * Add value. + */ + add: function (val) { + if (_this.options.get('multiple')) { + this.set(val, true); + } + return this; + }, + /** + * Toggle value. + */ + toggle: function (val) { + if (!_this.fdisabled()) { + this.multiple.toggle(val); + } + return this; + }, + /** + * Remove value. + */ + remove: function (val) { + if (!_this.fdisabled()) { + val = this.toObj(val); + $this.trigger('before:flexdatalist.remove', [val]); + var result = []; + if (_this.isArray(val)) { + $.each(val, function (i, value) { + var removed = _this.fvalue.multiple.remove(value); + if (removed) { + result.push(removed); + } + }); + } else { + var _result = this.multiple.remove(val); + if (_result) { + result.push(_result); + } + } + $this + .trigger('after:flexdatalist.remove', [val, result]) + .trigger('change:flexdatalist', [result, _this.options.get()]) + .trigger('change'); + } + return this; + }, + /** + * Load (remote?) value(s). + */ + _load: function (values, callback, init) { + var options = _this.options.get(), + valueProp = options.valueProperty, + _values = this.toStr(values), + _val = this.get(true); + + callback = (callback ? callback : $.noop); + // If nothing changes, return + if (_values.length == 0 && _val.length == 0) { + callback(values); + return; + } + values = this.toObj(values); + if (!_this.isEmpty(values) && !_this.isEmpty(valueProp) && valueProp !== '*') { + if (!_this.isObject(valueProp)) { + valueProp = valueProp.split(','); + } + // Load data + _this.data.load(function (data) { + if (!_this.isObject(values)) { + values = values.split(','); + } else if (!_this.isArray(values)) { + values = [values]; + } + var found = []; + for (var idxv = 0; idxv < values.length; idxv++) { + var value = values[idxv]; + for (var i = 0; i < data.length; i++) { + var item = data[i]; + for (var idx = 0; idx < valueProp.length; idx++) { + var prop = valueProp[idx], + value = _this.isDefined(value, prop) ? value[prop] : value; + if (_this.isDefined(item, prop) && value === item[prop]) { + found.push(item); + } + } + } + } + if (found.length > 0) { + _this.fvalue.extract(found, true); + } + callback(values); + }, values); + return; + } + callback(values); + _this.fvalue.extract(values, init); + }, + /** + * Extract value and text. + */ + extract: function (values, init) { + var options = _this.options.get(), + result = []; + + if (!init) { + $this.trigger('before:flexdatalist.value', [values, options]); + } + + if (_this.isArray(values)) { + $.each(values, function (i, value) { + result.push(_this.fvalue._extract(value)); + }); + } else { + result = _this.fvalue._extract(values); + } + + if (!init) { + $this + .data('result_selected', values) + .trigger('after:flexdatalist.value', [result, options]) + .trigger('change:flexdatalist', [result, options]) + .trigger('change'); + } + }, + /** + * @inherited. + */ + _extract: function (val) { + var txt = this.text(val), + value = this.value(val), + options = _this.options.get(); + + if (options.multiple) { + // For allowDuplicateValues + if (!_this.isEmpty(txt)) { + if (_this.isDup(txt)) { + return; + } + _values.push(txt); + this.multiple.add(value, txt); + } + } else { + this.single(value, txt); + } + + return {value: value, text: txt}; + }, + /** + * Default input value. + */ + single: function (val, txt) { + if (txt && txt !== $alias.val()) { + $alias[0].value = txt; + } + _this.value = val; + }, + /** + * Input with multiple values. + */ + multiple: { + /** + * Add value and item on list. + */ + add: function (val, txt) { + var _multiple = this, + $li = this.li(val, txt); + + // Toggle + $li.on('click', function () { + _multiple.toggle($(this)); + // Remove + }).find('.fdl-remove').on('click', function () { + _this.fvalue.remove($(this).parent()); + }); + + this.push(val); + $alias[0].value = ''; + this.handleLimit(); + }, + /** + * Push value to input. + */ + push: function (val, index) { + var current = _this.fvalue.get(); + if (current.includes(val)) { + return; + } + val = _this.fvalue.toObj(val); + current.push(val); + val = _this.fvalue.toStr(current); + _this.value = val; + }, + /** + * Toggle value. + */ + toggle: function (val) { + var options = _this.options.get(); + if (!options.toggleSelected) { + return; + } + + var $li = this.findLi(val); + if (!$li) { + return; + } + + var data = $li.data(), + action = $li.hasClass('disabled') ? 'enable' : 'disable', + eventArgs = [{value: data.value, text: data.text, action: action}, options]; + + $this.trigger('before:flexdatalist.toggle', eventArgs); + + if (action === 'enable') { + $li.removeClass('disabled'); + } else { + $li.addClass('disabled'); + } + + var current = []; + $multiple.find('li.toggle:not(.disabled)').each(function () { + var $item = $(this); + current.push($item.data('value')); + }); + + current = _this.fvalue.toStr(current); + _this.value = current; + + $this + .trigger('after:flexdatalist.toggle', eventArgs) + .trigger('change:flexdatalist', eventArgs) + .trigger('change'); + + }, + /** + * Remove value from input. + */ + remove: function (val) { + var $li = this.findLi(val); + if (!$li) { + return; + } + + var values = _this.fvalue.get(), + index = $li.index(), + data = $li.data(), + arg = {value: data.value, text: data.text}; + + values.splice(index, 1); + values = _this.fvalue.toStr(values); + _this.value = values; + $li.remove(); + _this.fvalue.multiple.handleLimit(); + + // For allowDuplicateValues + _values.splice(index, 1); + + this.handleLimit(); + + return arg; + }, + /** + * Remove all. + */ + removeAll: function () { + var values = _this.fvalue.get(), + options = _this.options.get(); + + $this.trigger('before:flexdatalist.remove.all', [values, options]); + + $multiple.find('li:not(.input-container)').remove(); + + _this.value = ''; + _values = []; + + this.handleLimit(); + + $this.trigger('after:flexdatalist.remove.all', [values, options]); + }, + /** + * Create new item and return it. + */ + li: function (val, txt) { + var $inputContainer = $multiple.find('li.input-container'); + var options = _this.options.get(); + return $('<li>') + .addClass('value' + (options.toggleSelected ? ' toggle' : '')) + .append('<span class="text">' + txt + '</span>') + .append('<span class="fdl-remove">×</span>') + .data({ + 'text': txt, + 'value': _this.fvalue.toStr(val) + }) + .insertBefore($inputContainer); + }, + /** + * Handle the limit. + * + * @return void + */ + handleLimit: function () { + var isAtLimit = this.isAtLimit(); + var $input = $multiple.find('li.input-container'); + isAtLimit ? $input.hide() : $input.show(); + }, + /** + * Check the limit of items. + * + * @return bool True if reached the limit, false otherwise + */ + isAtLimit: function () { + var limit = _this.options.get('limitOfValues'); + if (!(limit > 0)) { + return false; + } + return limit == _values.length; + }, + /** + * Get li item from value. + */ + findLi: function ($li) { + if (!($li instanceof jQuery)) { + var val = $li; + $li = null; + $multiple.find('li:not(.input-container)').each(function () { + var $_li = $(this); + if ($_li.data('value') === val) { + $li = $_li; + return false; + } + }); + } else if ($li.length === 0) { + $li = null; + } + return $li; + }, + /** + * Get li item from value. + */ + isEmpty: function () { + return this.get().length > 0; + } + }, + /** + * Get value that will be set on input field. + */ + value: function (item) { + var value = item, + options = _this.options.get(), + valueProperty = options.valueProperty; + + if (_this.isObject(item)) { + if (this.isJSON() || this.isMixed()) { + delete item.name_highlight; + if (_this.isArray(valueProperty)) { + var _value = {}; + for (var i = 0; i < valueProperty.length; i++) { + var propValue = _this.getPropertyValue(item, valueProperty[i]); + if (propValue) { + _value[valueProperty[i]] = propValue; + } + } + value = this.toStr(_value); + } else { + value = this.toStr(item); + } + } else if (_this.isDefined(item, valueProperty)) { + value = _this.getPropertyValue(item, valueProperty); + } else if (_this.isDefined(item, options.searchIn[0])) { + value = _this.getPropertyValue(item, options.searchIn[0]); + } else { + value = null; + } + } + return value; + }, + /** + * Get text that will be shown to user on the alias input field. + */ + text: function (item) { + var text = item, + options = _this.options.get(); + + if (_this.isObject(item)) { + text = _this.getPropertyValue(item, options.searchIn[0]); + if (_this.isDefined(item, options.textProperty)) { + text = _this.getPropertyValue(item, options.textProperty); + } else { + text = this.placeholders.replace(item, options.textProperty, text); + } + } + + text = _this.escapeHtml(text); + + return text; + }, + /** + * Process text placeholders. + */ + placeholders: { + replace: function (item, pattern, fallback) { + if (_this.isObject(item) && typeof pattern === 'string') { + var properties = this.parse(pattern); + if (!_this.isEmpty(item) && properties) { + $.each(properties, function (string, property) { + if (_this.isDefined(item, property)) { + pattern = pattern.replace(string, _this.getPropertyValue(item, property)); + } + }); + return pattern; + } + } + return fallback; + }, + parse: function (pattern) { + var matches = pattern.match(/\{.+?\}/g); + if (!matches) { + return false; + } + var properties = {}; + matches.map(function (string) { + properties[string] = string.slice(1, -1); + }); + return properties; + } + }, + /** + * Clear input value(s). + */ + clear: function (alias, init) { + var current = _this.value, + options = _this.options.get(); + + if (options.multiple) { + this.multiple.removeAll(); + } + + _this.value = ''; + if (alias) { + $alias[0].value = ''; + } + if (current !== '' && !init) { + $this + .trigger('change:flexdatalist', [{value: '', text: ''}, options]) + .trigger('clear:flexdatalist', [{value: '', text: ''}, options]) + .trigger('change'); + } + _values = []; + return this; + }, + /** + * Value to object. + */ + toObj: function (val) { + if (typeof val !== 'object') { + var options = _this.options.get(); + if (_this.isEmpty(val) || !_this.isDefined(val)) { + val = options.multiple ? [] : (this.isJSON() ? {} : ''); + } else if (this.isCSV()) { + val = val.toString().split(options.valuesSeparator); + val = val.map(function (v) { + return v.trim(); + }); + } else if ((this.isMixed() || this.isJSON()) && this.isJSON(val)) { + val = JSON.parse(val); + } else if (typeof val === 'number') { + val = val.toString(); + } + } + return val; + }, + /** + * Is value expected to be JSON (either object or string). + */ + toStr: function (val) { + if (typeof val !== 'string') { + if (_this.isEmpty(val) || !_this.isDefined(val)) { + val = ''; + } else if (typeof val === 'number') { + val = val.toString(); + } else if (this.isCSV()) { + val = val.join(_this.options.get('valuesSeparator')); + } else if (this.isJSON() || this.isMixed()) { + val = JSON.stringify(val); + } + } + return $.trim(val); + }, + /** + * If argument is passed, will check if is a valid JSON object/string. + * otherwise will check if JSON is the value expected for input + */ + isJSON: function (str) { + if (typeof str !== 'undefined') { + if (_this.isObject(str)) { + str = JSON.stringify(str); + } else if (typeof str !== 'string') { + return false; + } + return (str.indexOf('{') === 0 || str.indexOf('[{') === 0); + } + var options = _this.options.get(), + prop = options.valueProperty; + return (_this.isObject(prop) || prop === '*'); + }, + /** + * Is value expected to be JSON (either object or string). + */ + isMixed: function () { + var options = _this.options.get(); + return !options.selectionRequired && options.valueProperty === '*'; + }, + /** + * Is value expected to be CSV? + */ + isCSV: function () { + return (!this.isJSON() && _this.options.get('multiple')); + } + } + + /** + * Data. + */ + this.data = { + /** + * Load data from all sources. + */ + load: function (callback, load) { + var __this = this, + data = []; + $this.trigger('before:flexdatalist.data'); + // Remote data + this.url(function (remote) { + data = data.concat(remote); + // Static data + __this.static(function (_static) { + data = data.concat(_static); + // Datalist + __this.datalist(function (list) { + data = data.concat(list); + + $this.trigger('after:flexdatalist.data', [data]); + callback(data); + }); + }); + }, load); + }, + /** + * Get static data. + */ + static: function (callback) { + var __this = this, + options = _this.options.get(); + // Remote source + if (typeof options.data === 'string') { + var url = options.data, + cache = _this.cache.read(url, true); + if (cache) { + callback(cache); + return; + } + this.remote({ + url: url, + success: function (data) { + options.data = data; + callback(data); + _this.cache.write(url, data, options.cacheLifetime, true); + } + }); + } else { + if (typeof options.data !== 'object') { + options.data = []; + } + callback(options.data); + } + }, + /** + * Get datalist values. + */ + datalist: function (callback) { + var list = $this.attr('list'), + datalist = []; + if (!_this.isEmpty(list)) { + $('#' + list).find('option').each(function () { + var $option = $(this), + val = $option.val(), + label = $option.text(); + datalist.push({ + label: (label.length > 0 ? label : val), + value: val + }); + }); + } + callback(datalist); + }, + /** + * Get remote data. + */ + url: function (callback, load) { + var keyword = $alias.val(), + options = _this.options.get(), + keywordParamName = options.keywordParamName, + searchContainParamName = options.searchContainParamName, + value = _this.fvalue.get(), + relatives = this.relativesData(); + + if (_this.isEmpty(options.url)) { + return callback([]); + } + + var _opts = {}; + if (options.requestType === 'post') { + $.each(options, function (option, value) { + if (option.indexOf('_') == 0 || option == 'data') { + return; + } + _opts[option] = value; + }); + delete _opts.relatives; + } + + // Cache + var cacheKey = _this.cache.keyGen({ + relative: relatives, + load: load, + keyword: keyword, + contain: options.searchContain + }, options.url), + cache = _this.cache.read(cacheKey, true); + + if (cache) { + callback(cache); + return; + } + + var params = typeof(options.params) == 'function' ? + options.params.call($this[0], keyword) : + options.params; + + var data = $.extend( + relatives, + params, + { + load: load, + selected: value, + original: options.originalValue, + options: _opts + } + ); + + data[keywordParamName] = keyword; + data[searchContainParamName] = options.searchContain; + + this.remote({ + url: options.url, + data: data, + success: function (_data) { + var _keyword = $alias.val(); + // Is this really needed? + if (_keyword.length >= keyword.length) { + callback(_data); + } + _this.cache.write(cacheKey, _data, options.cacheLifetime, true); + } + }); + }, + /** + * AJAX request. + */ + remote: function (settings) { + var __this = this, + options = _this.options.get(); + + // Prevent get data when pressing backspace button + if ($this.hasClass('flexdatalist-loading')) { + return; + } + $this.addClass('flexdatalist-loading'); + + if (options.requestContentType === 'json') { + settings.data = JSON.stringify(settings.data); + } + + $.ajax($.extend( + { + type: options.requestType, + dataType: 'json', + headers: options.requestHeaders, + contentType: 'application/' + options.requestContentType + '; charset=UTF-8', + complete: function () { + $this.removeClass('flexdatalist-loading'); + } + }, settings, { + success: function (data) { + data = __this.extractRemoteData(data); + settings.success(data); + } + } + )); + }, + /** + * Extract remote data from server response. + */ + extractRemoteData: function (data) { + var options = _this.options.get(), + _data = _this.isDefined(data, options.resultsProperty) ? data[options.resultsProperty] : data; + + if (typeof _data === 'string' && _data.indexOf('[{') === 0) { + _data = JSON.parse(_data); + } + if (_data && _data.options) { + _this.options.set($.extend({}, options, _data.options)); + } + if (_this.isObject(_data)) { + return _data; + } + return []; + }, + /** + * Extract remote data from server response. + */ + relativesData: function () { + var relatives = _this.options.get('relatives'), + data = {}; + if (relatives) { + data['relatives'] = {}; + relatives.each(function () { + var $_input = $(this), + name = $_input.attr('name') + .split('][').join('-') + .split(']').join('-') + .split('[').join('-') + .replace(/^\|+|\-+$/g, ''); + data['relatives'][name] = $_input.val(); + }); + } + return data; + } + } + + /** + * Search. + */ + this.search = { + /** + * Search for keywords in data and return matches to given callback. + */ + get: function (keywords, data, callback) { + var __this = this, + options = _this.options.get(), + matches = data; + + if (!options.searchDisabled) { + var matches = _this.cache.read(keywords); + if (!matches) { + $this.trigger('before:flexdatalist.search', [keywords, data]); + if (!_this.isEmpty(keywords)) { + matches = []; + var words = __this.split(keywords); + for (var index = 0; index < data.length; index++) { + var item = data[index]; + if (_this.isDup(item)) { + continue; + } + item = __this.matches(item, words); + if (item) { + matches.push(item); + } + } + } + _this.cache.write(keywords, matches, 2); + $this.trigger('after:flexdatalist.search', [keywords, data, matches]); + } + } + + callback(matches); + }, + /** + * Match against searchable properties. + */ + matches: function (item, keywords) { + var _item = $.extend({}, item), + found = [], + options = _this.options.get(), + searchIn = options.searchIn; + + if (keywords.length > 0) { + for (var index = 0; index < searchIn.length; index++) { + var searchProperty = searchIn[index]; + if (!_this.isDefined(item, searchProperty) || !item[searchProperty]) { + continue; + } + + var text = item[searchProperty].toString(), + highlight = text, + strings = this.split(text); + + for (var kwindex = 0; kwindex < keywords.length; kwindex++) { + var keyword = keywords[kwindex]; + if (this.find(keyword, strings)) { + found.push(keyword); + highlight = this.highlight(keyword, highlight); + } + } + + if (highlight !== text) { + _item[searchProperty + '_highlight'] = this.highlight(highlight); + } + } + + } + + if (found.length === 0 || (options.searchByWord && found.length < (keywords.length - 1))) { + return false; + } + + return _item; + }, + /** + * Wrap found keyword with span.highlight. + */ + highlight: function (keyword, text) { + if (text) { + // Fix by https://github.com/antunesl + keyword = keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + return text.replace( + new RegExp(keyword, (_this.options.get('searchContain') ? "ig" : "i")), + '|:|$&|::|' + ); + } + keyword = keyword.split('|:|').join('<span class="highlight">'); + return keyword.split('|::|').join('</span>'); + }, + /** + * Search for keyword(s) in string. + */ + find: function (keyword, splitted) { + var options = _this.options.get(); + for (var index = 0; index < splitted.length; index++) { + var text = splitted[index]; + text = this.normalizeString(text), + keyword = this.normalizeString(keyword); + if (options.searchEqual) { + return text == keyword; + } + if ((options.searchContain ? (text.indexOf(keyword) >= 0) : (text.indexOf(keyword) === 0))) { + return true; + } + } + return false; + }, + /** + * Split string by words if needed. + */ + split: function (keywords) { + if (typeof keywords === 'string') { + keywords = [$.trim(keywords)]; + } + if (_this.options.get('searchByWord')) { + for (var index = 0; index < keywords.length; index++) { + var keyword = $.trim(keywords[index]); + if (keyword.indexOf(' ') > 0) { + var words = keyword.split(' '); + $.merge(keywords, words); + } + } + } + return keywords; + }, + /** + * Normalize string to a consistent one to perform the search/match. + */ + normalizeString: function (string) { + if (typeof string === 'string') { + var normalizeString = _this.options.get('normalizeString'); + if (typeof normalizeString === 'function') { + string = normalizeString(string); + } + string = string.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); + return string.toUpperCase(); + } + return string; + } + } + + /** + * Handle results. + */ + this.results = { + /** + * Save key = value data in local storage (if supported) + * + * @param string key Data key string + */ + show: function (results) { + var __this = this, + options = _this.options.get(); + + this.remove(true); + + if (!results) { + return; + } else if(results.length === 0) { + this.empty(options.noResultsText); + return; + } + + var $ul = this.container(); + if (!options.groupBy) { + this.items(results, $ul); + } else { + results = this.group(results); + Object.keys(results).forEach(function (groupName, index) { + var items = results[groupName], + property = options.groupBy, + groupText = _this.results.highlight(items[0], property, groupName); + + var $li = $('<li>') + .addClass('group') + .append($('<span>') + .addClass('group-name') + .html(groupText) + ) + .append($('<span>') + .addClass('group-item-count') + .text(' ' + items.length) + ) + .appendTo($ul); + + __this.items(items, $ul); + }); + } + + var $li = $ul.find('li:not(.group)'); + + // Listen to result's item events + $li.on('click', function (event) { + var item = $(this).data('item'); + if (item) { + _this.fvalue.extract(item); + __this.remove(); + $this.trigger('select:flexdatalist', [item, options]); + } + }).on('hover', function () { + $li.removeClass('active'); + $(this).addClass('active').trigger('active:flexdatalist.results', [$(this).data('item')]); + }, function () { + $(this).removeClass('active'); + }); + + if (options.focusFirstResult) { + $li.filter(':first').addClass('active'); + } + }, + /** + * Remove results container. + */ + empty: function (text) { + if (_this.isEmpty(text)) { + return; + } + var $container = this.container(), + keyword = $alias.val(); + + text = text.split('{keyword}').join(keyword); + $('<li>') + .addClass('item no-results') + .append(text) + .appendTo($container) + + $this.trigger('empty:flexdatalist.results', [text]); + }, + /** + * Items iteration. + */ + items: function (items, $resultsContainer) { + var max = _this.options.get('maxShownResults'); + + $this.trigger('show:flexdatalist.results', [items]); + + for (var index = 0; index < items.length; index++) { + if (max > 0 && max === index) { + break; + } + this.item(items[index], index, items.length).appendTo($resultsContainer); + } + + $this.trigger('shown:flexdatalist.results', [items]); + }, + /** + * Result item creation. + */ + item: function (item, index, total) { + var $li = $('<li>') + .attr({ + 'role': 'option', + 'tabindex': '-1', + 'aria-posinset': index + 1, + 'aria-setsize': total + }) + .data('item', item) + .addClass('item'), + options = _this.options.get(), + visibleProperties = options.visibleProperties; + + for (var index = 0; index < visibleProperties.length; index++) { + var visibleProperty = visibleProperties[index]; + + if (visibleProperty.indexOf('{') > -1) { + var str = _this.fvalue.placeholders.replace(item, visibleProperty), + parsed = _this.fvalue.placeholders.parse(visibleProperty); + $item = $('<span>') + .addClass('item item-' + Object.values(parsed).join('-')) + .html(str + ' '); + } else { + if (options.groupBy && options.groupBy === visibleProperty || !_this.isDefined(item, visibleProperty)) { + continue; + } + var $item = {}; + if (visibleProperty === options.iconProperty) { + // Icon + $item = $('<img>') + .addClass('item item-' + visibleProperty) + .attr('src', item[visibleProperty]); + } else { + var propertyText = _this.results.highlight(item, visibleProperty); + // Other text properties + $item = $('<span>') + .addClass('item item-' + visibleProperty) + .html(propertyText + ' '); + } + } + + $item.appendTo($li); + } + + $this.trigger('item:flexdatalist.results', [$li, item]); + + return $li; + }, + /** + * Results container + */ + container: function () { + var $target = $this; + + if ($multiple) { + $target = $multiple; + } + + var $container = $('ul.flexdatalist-results'); + + if ($container.length === 0) { + $container = $('<ul>') + .addClass('flexdatalist-results ') + .appendTo('body') + .attr({ + 'id': $alias.attr('id') + '-results', + 'role': 'listbox' + }) + .css({ + 'border-color': $target.css("border-left-color"), + 'border-width': '1px', + 'border-bottom-left-radius': $target.css("border-bottom-left-radius"), + 'border-bottom-right-radius': $target.css("border-bottom-right-radius") + }).data({ + target: ($multiple ? $multiple : $alias), + input: $this + }); + _this.position($alias); + } + + return $container; + }, + /** + * Results container + */ + group: function (results) { + var data = [], + groupProperty = _this.options.get('groupBy'); + + for (var index = 0; index < results.length; index++) { + var _data = results[index]; + if (_this.isDefined(_data, groupProperty)) { + var propertyValue = _data[groupProperty]; + if (!_this.isDefined(data, propertyValue)) { + data[propertyValue] = []; + } + data[propertyValue].push(_data); + } + } + + return data; + }, + /** + * Check if highlighted property value exists, + * if true, return it, if not, fallback to given string + */ + highlight: function (item, property, fallback) { + if (_this.isDefined(item, property + '_highlight')) { + return item[property + '_highlight']; + } + return (_this.isDefined(item, property) ? item[property] : fallback); + }, + /** + * Set given item as active + */ + active: function ($item) { + + }, + /** + * Remove results + */ + remove: function (itemsOnly) { + var selector = 'ul.flexdatalist-results'; + if (itemsOnly) { + selector = 'ul.flexdatalist-results li'; + } + $this.trigger('remove:flexdatalist.results'); + $(selector).remove(); + $this.trigger('removed:flexdatalist.results'); + } + } + + /** + * Interface for localStorage. + */ + this.cache = { + /** + * Save key = value data in local storage (if supported) + * + * @param string key Data key string + * @param mixed value Value to be saved + * @param int lifetime In Seconds + * @return mixed + */ + write: function (key, value, lifetime, global) { + if (_this.cache.isSupported()) { + key = this.keyGen(key, undefined, global); + var object = { + value: value, + // Get current UNIX timestamp + timestamp: _this.unixtime(), + lifetime: (lifetime ? lifetime : false) + }; + localStorage.setItem(key, JSON.stringify(object)); + } + }, + /** + * Read data associated with given key + * + * @param string key Data key string + * @return mixed + */ + read: function (key, global) { + if (_this.cache.isSupported()) { + key = this.keyGen(key, undefined, global); + var data = localStorage.getItem(key); + if (data) { + var object = JSON.parse(data); + if (!this.expired(object)) { + return object.value; + } + localStorage.removeItem(key); + } + } + return null; + }, + /** + * Remove data associated with given key. + * + * @param string key Data key string + */ + delete: function (key, global) { + if (_this.cache.isSupported()) { + key = this.keyGen(key, undefined, global); + localStorage.removeItem(key); + } + }, + /** + * Clear all data. + */ + clear: function () { + if (_this.cache.isSupported()) { + for (var key in localStorage){ + if (key.indexOf(fid) > -1 || key.indexOf('global') > -1) { + localStorage.removeItem(key); + } + } + localStorage.clear(); + } + }, + /** + * Run cache garbage collector to prevent using all localStorage's + * available space. + */ + gc: function () { + if (_this.cache.isSupported()) { + for (var key in localStorage){ + if (key.indexOf(fid) > -1 || key.indexOf('global') > -1) { + var data = localStorage.getItem(key); + data = JSON.parse(data); + if (this.expired(data)) { + localStorage.removeItem(key); + } + } + } + } + }, + /** + * Check if browser supports localtorage. + * + * @return boolean True if supports, false otherwise + */ + isSupported: function () { + if (_this.options.get('cache')) { + try { + return 'localStorage' in window && window['localStorage'] !== null; + } catch (e) { + return false; + } + } + return false; + }, + /** + * Check if cache data as expired. + * + * @param object object Data to check + * @return boolean True if expired, false otherwise + */ + expired: function (object) { + if (object.lifetime) { + var diff = (_this.unixtime() - object.timestamp); + return object.lifetime <= diff; + } + return false; + }, + /** + * Generate cache key from object or string. + * + * @return string Cache key + */ + keyGen: function (str, seed, global) { + if (typeof str === 'object') { + str = JSON.stringify(str); + } + var i, l, + hval = (seed === undefined) ? 0x811c9dc5 : seed; + + for (i = 0, l = str.length; i < l; i++) { + hval ^= str.charCodeAt(i); + hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24); + } + return (global ? 'global' : fid) + ("0000000" + (hval >>> 0).toString(16)).substr(-8); + } + } + + /** + * Options handler. + */ + this.options = { + init: function () { + var options = $.extend({}, + _options, + $this.data(), + { + multiple: (_options.multiple === null ? $this.is('[multiple]') : _options.multiple), + disabled: (_options.disabled === null ? $this.is('[disabled]') : _options.disabled), + originalValue: _this.value + } + ); + this.set(options); + return options; + }, + get: function (option) { + var options = $this.data('flexdatalist'); + if (!option) { + return options ? options : {}; + } + return _this.isDefined(options, option) ? options[option] : null; + }, + set: function (option, value) { + var options = this.get(); + if (_this.isDefined(options, option) && _this.isDefined(value)) { + options[option] = value; + } else if (_this.isObject(option)) { + options = this._normalize(option); + } + $this.data('flexdatalist', options); + return $this; + }, + _normalize: function (options) { + options.searchIn = _this.csvToArray(options.searchIn); + options.relatives = options.relatives && $(options.relatives).length > 0 ? $(options.relatives) : null; + options.textProperty = options.textProperty === null ? options.searchIn[0] : options.textProperty; + options.visibleProperties = _this.csvToArray(options.visibleProperties, options.searchIn); + if (options.valueProperty === '*' && options.multiple && !options.selectionRequired) { + throw new Error('Selection must be required for multiple, JSON fields!'); + } + return options; + } + } + + /** + * Position results below parent element. + */ + this.position = function () { + var $results = $('ul.flexdatalist-results'), + $target = $results.data('target'); + if ($results.length > 0) { + // Set some required CSS properties + $results.css({ + 'width': $target.outerWidth() + 'px', + 'top': (($target.offset().top + $target.outerHeight())) + 'px', + 'left': $target.offset().left + 'px' + }); + } + } + + /** + * Handle disabled state. + */ + this.fdisabled = function (disabled) { + if (this.isDefined(disabled)) { + $this.prop('disabled', disabled); + $alias.prop('disabled', disabled); + if ($multiple) { + $multiple.css('background-color', $this.css('background-color')); + var $btns = $multiple.find('li .fdl-remove'), + $input = $multiple.find('li.input-container'); + if (disabled) { + $multiple.addClass('disabled'); + if ($btns.length > 0) { + $input.hide(); + } + $btns.hide(); + } else { + $multiple.removeClass('disabled'); + $input.show(); + $btns.show(); + } + } + this.options.set('disabled', disabled); + } + return this.options.get('disabled'); + } + + /** + * Check for dup values. + */ + this.isDup = function (val) { + if (!this.options.get('allowDuplicateValues')) { + return _values.length > 0 && _values.indexOf(this.fvalue.text(val)) > -1; + } + return false; + } + + /** + * Get key code from event. + */ + this.keyNum = function (event) { + return event.which || event.keyCode; + } + + /** + * Is variable empty. + */ + this.isEmpty = function (value) { + if (!_this.isDefined(value)) { + return true; + } else if (value === null) { + return true; + } else if (value === true) { + return false; + } else if (this.length(value) === 0) { + return true; + } else if ($.trim(value) === '') { + return true; + } + return false; + } + + /** + * Is variable an object. + */ + this.isObject = function (value) { + return (value && typeof value === 'object'); + } + + /** + * Get length of variable. + */ + this.length = function (value) { + if (this.isObject(value)) { + return Object.keys(value).length; + } else if (typeof value === 'number' || typeof value.length === 'number') { + return value.toString().length; + } + return 0; + } + + /** + * Check if variable (and optionally property) is defined. + */ + this.isDefined = function (variable, property) { + var _variable = (typeof variable !== 'undefined'); + if (_variable && typeof property !== 'undefined') { + return (typeof this.getPropertyValue(variable, property) !== 'undefined'); + } + return _variable; + } + + /** + * Check if variable is an array. + */ + this.isArray = function (variable) { + return Object.prototype.toString.call(variable) === '[object Array]'; + } + + /** + * Get unixtime stamp. + * + * @return boolean True if supports, false otherwise + */ + this.unixtime = function (time) { + var date = new Date(); + if (time) { + date = new Date(time); + } + return Math.round(date.getTime() / 1000); + } + + /** + * To array. + */ + this.csvToArray = function (value, _default) { + if (value.length === 0) { + return _default; + } + return typeof value === 'string' ? value.split(_this.options.get('valuesSeparator')) : value; + }, + /** + * A function to take a string written in dot notation style, and use it to + * find a nested object property inside of an object. + * + * Useful in a plugin or module that accepts a JSON array of objects, but + * you want to let the user specify where to find various bits of data + * inside of each custom object instead of forcing a standardized + * property list. + * + * Thanks to https://github.com/sylvainblot for the PR. + * + * @param object object (optional) The object to search + * @param string path A dot notation style path to the value (ie "urls.small") + * @return the value of the property in question + * @see https://github.com/sergiodlopes/jquery-flexdatalist/pull/195 + */ + this.getPropertyValue = function (obj, path) { + if (!obj || typeof path !== 'string') { + return undefined; + } + + var parts = path.split('.'); + while (parts.length && (obj = obj[parts.shift()])); + return obj; + } + /** + * Escape HTML special characters. + * + * @param string str String to escape HTML + * @return string String with HTML special characters escaped + */ + this.escapeHtml = function (str) { + return str + .replace(/&/g, "&") + .replace(/</g, "<") + .replace(/>/g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + } + + /** + * Plugin warnings for debug. + */ + this.debug = function (msg, data) { + var options = _this.options.get(); + if (!options.debug) { + return; + } + if (!data) { + data = {}; + } + msg = 'Flexdatalist: ' + msg; + console.warn(msg); + console.log($.extend({ + inputName: $this.attr('name'), + options: options + }, data)); + console.log('--- /flexdatalist ---'); + } + + // Go! + this.init(); + }); +} + +jQuery(function ($) { + var $document = $(document); + // Handle results selection list keyboard shortcuts and events. + if (!$document.data('flexdatalist')) { + // Remove results on outside click + $(document).on('mouseup', function (event) { + var $container = $('.flexdatalist-results'), + $target = $container.data('target'); + if ((!$target || !$target.is(':focus')) && !$container.is(event.target) && $container.has(event.target).length === 0) { + $container.remove(); + } + // Keyboard navigation + }).on('keydown', function (event) { + var $ul = $('.flexdatalist-results'), + $li = $ul.find('li'), + $active = $li.filter('.active'), + index = $active.index(), + length = $li.length, + keynum = event.which || event.keyCode; + + if (length === 0) { + return; + } + + // on escape key, remove results + if (keynum === 27) { + $ul.remove(); + return; + } + + // Enter/tab key + if (keynum === 13) { + event.preventDefault(); + $active.trigger('click'); + // Up/Down key + } else if (keynum === 40 || keynum === 38) { + event.preventDefault(); + // Down key + if (keynum === 40) { + if (index < length && $active.nextAll('.item').first().length > 0) { + $active = $active.removeClass('active').nextAll('.item').first().addClass('active'); + } else { + $active = $li.removeClass('active').filter('.item:first').addClass('active'); + } + // Up key + } else if (keynum === 38) { + if (index > 0 && $active.prevAll('.item').first().length > 0) { + $active = $active.removeClass('active').prevAll('.item').first().addClass('active'); + } else { + $active = $li.removeClass('active').filter('.item:last').addClass('active'); + } + } + + $active.trigger('active:flexdatalist.results', [$active.data('item')]); + + // Scroll to + var position = ($active.prev().length === 0 ? $active : $active.prev()).position().top; + $ul.animate({ + scrollTop: position + $ul.scrollTop() + }, 100); + } + }).data('flexdatalist', true); + } + + jQuery('input.flexdatalist:not(.flexdatalist-set):not(.autodiscover-disabled)').flexdatalist(); +}); + +(function ($) { + var jVal = $.fn.val; + $.fn.val = function (value) { + var isFlex = this.length > 0 && typeof this[0].fvalue !== 'undefined'; + if (typeof value === 'undefined') { + return isFlex ? this[0].fvalue.get(true) : jVal.call(this); + } + return isFlex ? this[0].fvalue.set(value) : jVal.call(this, value); + }; +})(jQuery); diff --git a/dllib/jquery.flexdatalist.min.css b/dllib/jquery.flexdatalist.min.css new file mode 100644 index 0000000..e5729e5 --- /dev/null +++ b/dllib/jquery.flexdatalist.min.css @@ -0,0 +1 @@ +.flexdatalist-results{position:absolute;top:0;left:0;border:1px solid #444;border-top:none;background:#fff;z-index:100000;max-height:300px;overflow-y:auto;box-shadow:0 4px 5px rgba(0,0,0,0.15);color:#333;list-style:none;margin:0;padding:0}.flexdatalist-results li{border-bottom:1px solid #ccc;padding:8px 15px;font-size:14px;line-height:20px}.flexdatalist-results li span.highlight{font-weight:700;text-decoration:underline}.flexdatalist-results li.active{background:#2B82C9;color:#fff;cursor:pointer}.flexdatalist-results li.no-results{font-style:italic;color:#888}.flexdatalist-results li.group{background:#F3F3F4;color:#666;padding:8px 8px}.flexdatalist-results li .group-name{font-weight:700}.flexdatalist-results li .group-item-count{font-size:85%;color:#777;display:inline-block;padding-left:10px}.flexdatalist-multiple:before{content:'';display:block;clear:both}.flexdatalist-multiple{width:100%;margin:0;padding:0;list-style:none;text-align:left;cursor:text}.flexdatalist-multiple.disabled{background-color:#eee;cursor:default}.flexdatalist-multiple:after{content:'';display:block;clear:both}.flexdatalist-multiple li{display:inline-block;position:relative;margin:5px}.flexdatalist-multiple li.input-container,.flexdatalist-multiple li.input-container input{border:none;height:auto;padding:0 0 0 4px;line-height:24px}.flexdatalist-multiple li.value{display:inline-block;padding:2px 25px 2px 7px;background:#efefef;border-radius:3px;color:#444;line-height:20px;float:left}.flexdatalist-multiple li.toggle{cursor:pointer;transition:opacity ease-in-out 300ms}.flexdatalist-multiple li.toggle.disabled{text-decoration:line-through;opacity:0.80}.flexdatalist-multiple li.value span.fdl-remove{font-weight:700;padding:2px 5px;font-size:20px;line-height:20px;cursor:pointer;position:absolute;top:0;right:0;opacity:0.70}.flexdatalist-multiple li.value span.fdl-remove:hover{opacity:1}
\ No newline at end of file diff --git a/dllib/jquery.flexdatalist.min.js b/dllib/jquery.flexdatalist.min.js new file mode 100644 index 0000000..ba0493a --- /dev/null +++ b/dllib/jquery.flexdatalist.min.js @@ -0,0 +1,2 @@ +jQuery.fn.flexdatalist=function(e,t){"use strict";var i=function(e,t){e.each((function(){var e=$(this),i=e.data(),a=i.flexdatalist,r=i.aliascontainer;r&&(e.removeClass("flexdatalist-set").attr({style:null,tabindex:null}).val(a&&a.originalValue&&!t?a.originalValue:"").removeData("flexdatalist").removeData("aliascontainer").off(),r.remove())}))};if("string"==typeof e&&"reset"!==e){if("object"==typeof this[0]&&void 0!==this[0].fvalue){var a=this[0];if("destroy"===e)i(this,t);else if("value"===e){if(void 0===t)return a.fvalue.get();a.fvalue.set(t)}else if("add"===e){if(void 0===t)return a.debug("Missing value to add!");a.fvalue.add(t)}else if("toggle"===e){if(void 0===t)return a.debug("Missing value to toggle!");a.fvalue.toggle(t)}else if("remove"===e){if(void 0===t)return a.debug("Missing value to remove!");a.fvalue.remove(t)}else if("disabled"===e){if(void 0===t)return a.fdisabled();a.fdisabled(t)}else if("string"==typeof e){if(void 0===t)return a.options.get(e);a.options.set(e,t)}return this}e={_option:t}}this.length>0&&void 0!==this[0].fvalue&&i(this);var r=$.extend({url:null,data:[],params:{},relatives:null,chainedRelatives:!1,cache:!0,cacheLifetime:60,minLength:3,groupBy:!1,selectionRequired:!1,focusFirstResult:!1,textProperty:null,valueProperty:null,visibleProperties:[],iconProperty:"thumb",searchIn:["label"],searchContain:!1,searchEqual:!1,searchByWord:!1,searchDisabled:!1,searchDelay:400,normalizeString:null,multiple:null,disabled:null,maxShownResults:100,removeOnBackspace:!0,noResultsText:'No results found for "{keyword}"',toggleSelected:!1,allowDuplicateValues:!1,redoSearchOnFocus:!0,requestType:"get",requestContentType:"x-www-form-urlencoded",requestHeaders:null,resultsProperty:"results",keywordParamName:"keyword",searchContainParamName:"contain",limitOfValues:0,valuesSeparator:",",debug:!0},e);return this.each((function(e){var t=$(this),i=this,a=null,s=[],n="flex"+e,l=null,o=null;this.init=function(){var e=this.options.init();this.set.up(),l.on("focusin",(function(e){i.action.redoSearchFocus(e),i.action.showAllResults(e),o&&o.addClass("focus")})).on("input keydown",(function(e){9===i.keyNum(e)&&i.results.remove(),i.action.keypressValue(e,188),i.action.backSpaceKeyRemove(e)})).on("input keyup",(function(e){i.action.keypressValue(e,13),i.action.keypressSearch(e),i.action.copyValue(e),i.action.backSpaceKeyRemove(e),i.action.showAllResults(e),i.action.clearValue(e),i.action.removeResults(e),i.action.inputWidth(e)})).on("focusout",(function(e){o&&o.removeClass("focus"),i.action.clearText(e),i.action.clearValue(e)})),window.onresize=function(e){i.position()},this.cache.gc(),e.selectionRequired&&i.fvalue.clear(!0,!0),this.fvalue._load(e.originalValue,(function(a,r){i.fdisabled(e.disabled),t.trigger("init:flexdatalist",[e])}),!0)},this.action={keypressValue:function(e,t){var a=i.keyNum(e),r=l[0].value,s=i.options.get();if(r.length>0&&a===t&&!s.selectionRequired&&s.multiple){r=l[0].value;e.preventDefault(),e.stopPropagation(),i.fvalue.extract(r),i.results.remove()}},keypressSearch:function(e){var t=i.keyNum(e),r=l.val(),s=r.length,n=i.options.get();clearTimeout(a),(!t||13!==t&&(t<37||t>40))&&(a=setTimeout((function(){(0===n.minLength&&s>0||n.minLength>0&&s>=n.minLength)&&i.data.load((function(e){i.search.get(r,e,(function(e){i.results.show(e)}))}))}),n.searchDelay))},redoSearchFocus:function(e){var t=i.fvalue.get(),a=i.options.get(),r=l.val();a.redoSearchOnFocus&&(r.length>0&&a.multiple||r.length>0&&0===t.length)&&this.keypressSearch(e)},copyValue:function(e){if(13!==i.keyNum(e)){var t=l.val(),a=i.fvalue.get(!0),r=i.options.get();r.multiple||r.selectionRequired||t.length===a.length||i.fvalue.extract(t)}},backSpaceKeyRemove:function(e){var t=i.options.get();if(t.removeOnBackspace&&t.multiple){var a=l.val(),r=l.data("_remove");8===i.keyNum(e)&&(0===a.length?r?(i.fvalue.remove(r),l.data("_remove",null)):l.data("_remove",l.parents("li:eq(0)").prev()):l.data("_remove",null))}},showAllResults:function(e){var t=l.val();""===(t=$.trim(t))&&0===i.options.get("minLength")&&i.data.load((function(e){i.results.show(e)}))},inputWidth:function(e){if(i.options.get().multiple){var a=l.val(),r=parseInt(l.css("fontSize").replace("px","")),s=t.innerWidth(),n=(a.length+1)*r;n>=40&&n<=s&&(l[0].style.width=n+"px")}},clearText:function(e){var t=i.fvalue.get(),a=i.options.get();!a.multiple&&a.selectionRequired&&0===t.length&&(l[0].value="")},clearValue:function(e){i.fvalue.get();var t=l.val(),a=i.options.get();!a.multiple&&a.selectionRequired&&t.length<=a.minLength&&i.fvalue.clear()},removeResults:function(e){var t=l.val(),a=i.options.get();a.minLength>0&&t.length<a.minLength&&i.results.remove()}},this.set={up:function(){l=this.getAlias(),i.options.get("multiple")?o=this.multipleInput(l):l.insertAfter(t),this.accessibility(l),t.attr("autofocus")&&l.trigger("focus"),t.data("aliascontainer",o||l).addClass("flexdatalist flexdatalist-set").css({position:"absolute",top:-14e3,left:-14e3}).attr("tabindex",-1);var e=t.attr("id"),a=l.attr("id");$('label[for="'+e+'"]').attr("for",a),this.chained()},getAlias:function(){var e=t.attr("id")?t.attr("id")+"-flexdatalist":n;return $('<input type="text">').attr({class:t.attr("class"),name:t.attr("name")?"flexdatalist-"+t.attr("name"):null,id:e,placeholder:t.attr("placeholder")}).addClass("flexdatalist-alias "+e).removeClass("flexdatalist").attr("autocomplete","off")},multipleInput:function(e){return o=$('<ul tabindex="1">').addClass("flexdatalist-multiple "+n).css({"border-color":t.css("border-left-color"),"border-width":t.css("border-left-width"),"border-style":t.css("border-left-style"),"border-radius":t.css("border-top-left-radius"),"background-color":t.css("background-color")}).insertAfter(t).on("click",(function(){$(this).find("input").trigger("focus")})),$('<li class="input-container">').addClass("flexdatalist-multiple-value").append(e).appendTo(o),o},chained:function(){var e=i.options.get();if(e.relatives&&e.chainedRelatives){var t=function(t){e.relatives.each((function(){var e=i.isEmpty($(this).val()),t=i.isEmpty(i.value);!e&&t||i.fvalue.clear(),i.fdisabled(e)}))};e.relatives.on("change",(function(){t()})),t()}},accessibility:function(e){var i={"aria-autocomplete":"list","aria-expanded":"false","aria-owns":(t.attr("id")?t.attr("id")+"-flexdatalist":n)+"-results"};e.attr(i)}},this.fvalue={get:function(e){var t=i.value;return!i.options.get().multiple&&!this.isJSON()||e?t:this.toObj(t)},set:function(e,a){return i.fdisabled()||(a||this.clear(!0),this._load(e)),t},add:function(e){return i.options.get("multiple")&&this.set(e,!0),this},toggle:function(e){return i.fdisabled()||this.multiple.toggle(e),this},remove:function(e){if(!i.fdisabled()){e=this.toObj(e),t.trigger("before:flexdatalist.remove",[e]);var a=[];if(i.isArray(e))$.each(e,(function(e,t){var r=i.fvalue.multiple.remove(t);r&&a.push(r)}));else{var r=this.multiple.remove(e);r&&a.push(r)}t.trigger("after:flexdatalist.remove",[e,a]).trigger("change:flexdatalist",[a,i.options.get()]).trigger("change")}return this},_load:function(e,t,a){var r=i.options.get().valueProperty,s=this.toStr(e),n=this.get(!0);if(t=t||$.noop,0!=s.length||0!=n.length){if(e=this.toObj(e),!i.isEmpty(e)&&!i.isEmpty(r)&&"*"!==r)return i.isObject(r)||(r=r.split(",")),void i.data.load((function(a){i.isObject(e)?i.isArray(e)||(e=[e]):e=e.split(",");for(var s=[],n=0;n<e.length;n++)for(var l=e[n],o=0;o<a.length;o++)for(var u=a[o],c=0;c<r.length;c++){var f=r[c];l=i.isDefined(l,f)?l[f]:l;i.isDefined(u,f)&&l===u[f]&&s.push(u)}s.length>0&&i.fvalue.extract(s,!0),t(e)}),e);t(e),i.fvalue.extract(e,a)}else t(e)},extract:function(e,a){var r=i.options.get(),s=[];a||t.trigger("before:flexdatalist.value",[e,r]),i.isArray(e)?$.each(e,(function(e,t){s.push(i.fvalue._extract(t))})):s=i.fvalue._extract(e),a||t.data("result_selected",e).trigger("after:flexdatalist.value",[s,r]).trigger("change:flexdatalist",[s,r]).trigger("change")},_extract:function(e){var t=this.text(e),a=this.value(e);if(i.options.get().multiple){if(!i.isEmpty(t)){if(i.isDup(t))return;s.push(t),this.multiple.add(a,t)}}else this.single(a,t);return{value:a,text:t}},single:function(e,t){t&&t!==l.val()&&(l[0].value=t),i.value=e},multiple:{add:function(e,t){var a=this;this.li(e,t).on("click",(function(){a.toggle($(this))})).find(".fdl-remove").on("click",(function(){i.fvalue.remove($(this).parent())})),this.push(e),l[0].value="",this.handleLimit()},push:function(e,t){var a=i.fvalue.get();a.includes(e)||(e=i.fvalue.toObj(e),a.push(e),e=i.fvalue.toStr(a),i.value=e)},toggle:function(e){var a=i.options.get();if(a.toggleSelected){var r=this.findLi(e);if(r){var s=r.data(),n=r.hasClass("disabled")?"enable":"disable",l=[{value:s.value,text:s.text,action:n},a];t.trigger("before:flexdatalist.toggle",l),"enable"===n?r.removeClass("disabled"):r.addClass("disabled");var u=[];o.find("li.toggle:not(.disabled)").each((function(){var e=$(this);u.push(e.data("value"))})),u=i.fvalue.toStr(u),i.value=u,t.trigger("after:flexdatalist.toggle",l).trigger("change:flexdatalist",l).trigger("change")}}},remove:function(e){var t=this.findLi(e);if(t){var a=i.fvalue.get(),r=t.index(),n=t.data(),l={value:n.value,text:n.text};return a.splice(r,1),a=i.fvalue.toStr(a),i.value=a,t.remove(),i.fvalue.multiple.handleLimit(),s.splice(r,1),this.handleLimit(),l}},removeAll:function(){var e=i.fvalue.get(),a=i.options.get();t.trigger("before:flexdatalist.remove.all",[e,a]),o.find("li:not(.input-container)").remove(),i.value="",s=[],this.handleLimit(),t.trigger("after:flexdatalist.remove.all",[e,a])},li:function(e,t){var a=o.find("li.input-container"),r=i.options.get();return $("<li>").addClass("value"+(r.toggleSelected?" toggle":"")).append('<span class="text">'+t+"</span>").append('<span class="fdl-remove">×</span>').data({text:t,value:i.fvalue.toStr(e)}).insertBefore(a)},handleLimit:function(){var e=this.isAtLimit(),t=o.find("li.input-container");e?t.hide():t.show()},isAtLimit:function(){var e=i.options.get("limitOfValues");return e>0&&e==s.length},findLi:function(e){if(e instanceof jQuery)0===e.length&&(e=null);else{var t=e;e=null,o.find("li:not(.input-container)").each((function(){var i=$(this);if(i.data("value")===t)return e=i,!1}))}return e},isEmpty:function(){return this.get().length>0}},value:function(e){var t=e,a=i.options.get(),r=a.valueProperty;if(i.isObject(e))if(this.isJSON()||this.isMixed())if(delete e.name_highlight,i.isArray(r)){for(var s={},n=0;n<r.length;n++){var l=i.getPropertyValue(e,r[n]);l&&(s[r[n]]=l)}t=this.toStr(s)}else t=this.toStr(e);else t=i.isDefined(e,r)?i.getPropertyValue(e,r):i.isDefined(e,a.searchIn[0])?i.getPropertyValue(e,a.searchIn[0]):null;return t},text:function(e){var t=e,a=i.options.get();return i.isObject(e)&&(t=i.getPropertyValue(e,a.searchIn[0]),t=i.isDefined(e,a.textProperty)?i.getPropertyValue(e,a.textProperty):this.placeholders.replace(e,a.textProperty,t)),t=i.escapeHtml(t)},placeholders:{replace:function(e,t,a){if(i.isObject(e)&&"string"==typeof t){var r=this.parse(t);if(!i.isEmpty(e)&&r)return $.each(r,(function(a,r){i.isDefined(e,r)&&(t=t.replace(a,i.getPropertyValue(e,r)))})),t}return a},parse:function(e){var t=e.match(/\{.+?\}/g);if(!t)return!1;var i={};return t.map((function(e){i[e]=e.slice(1,-1)})),i}},clear:function(e,a){var r=i.value,n=i.options.get();return n.multiple&&this.multiple.removeAll(),i.value="",e&&(l[0].value=""),""===r||a||t.trigger("change:flexdatalist",[{value:"",text:""},n]).trigger("clear:flexdatalist",[{value:"",text:""},n]).trigger("change"),s=[],this},toObj:function(e){if("object"!=typeof e){var t=i.options.get();i.isEmpty(e)||!i.isDefined(e)?e=t.multiple?[]:this.isJSON()?{}:"":this.isCSV()?e=(e=e.toString().split(t.valuesSeparator)).map((function(e){return e.trim()})):(this.isMixed()||this.isJSON())&&this.isJSON(e)?e=JSON.parse(e):"number"==typeof e&&(e=e.toString())}return e},toStr:function(e){return"string"!=typeof e&&(i.isEmpty(e)||!i.isDefined(e)?e="":"number"==typeof e?e=e.toString():this.isCSV()?e=e.join(i.options.get("valuesSeparator")):(this.isJSON()||this.isMixed())&&(e=JSON.stringify(e))),$.trim(e)},isJSON:function(e){if(void 0!==e){if(i.isObject(e))e=JSON.stringify(e);else if("string"!=typeof e)return!1;return 0===e.indexOf("{")||0===e.indexOf("[{")}var t=i.options.get().valueProperty;return i.isObject(t)||"*"===t},isMixed:function(){var e=i.options.get();return!e.selectionRequired&&"*"===e.valueProperty},isCSV:function(){return!this.isJSON()&&i.options.get("multiple")}},this.data={load:function(e,i){var a=this,r=[];t.trigger("before:flexdatalist.data"),this.url((function(i){r=r.concat(i),a.static((function(i){r=r.concat(i),a.datalist((function(i){r=r.concat(i),t.trigger("after:flexdatalist.data",[r]),e(r)}))}))}),i)},static:function(e){var t=i.options.get();if("string"==typeof t.data){var a=t.data,r=i.cache.read(a,!0);if(r)return void e(r);this.remote({url:a,success:function(r){t.data=r,e(r),i.cache.write(a,r,t.cacheLifetime,!0)}})}else"object"!=typeof t.data&&(t.data=[]),e(t.data)},datalist:function(e){var a=t.attr("list"),r=[];i.isEmpty(a)||$("#"+a).find("option").each((function(){var e=$(this),t=e.val(),i=e.text();r.push({label:i.length>0?i:t,value:t})})),e(r)},url:function(e,a){var r=l.val(),s=i.options.get(),n=s.keywordParamName,o=s.searchContainParamName,u=i.fvalue.get(),c=this.relativesData();if(i.isEmpty(s.url))return e([]);var f={};"post"===s.requestType&&($.each(s,(function(e,t){0!=e.indexOf("_")&&"data"!=e&&(f[e]=t)})),delete f.relatives);var d=i.cache.keyGen({relative:c,load:a,keyword:r,contain:s.searchContain},s.url),h=i.cache.read(d,!0);if(h)e(h);else{var p="function"==typeof s.params?s.params.call(t[0],r):s.params,g=$.extend(c,p,{load:a,selected:u,original:s.originalValue,options:f});g[n]=r,g[o]=s.searchContain,this.remote({url:s.url,data:g,success:function(t){l.val().length>=r.length&&e(t),i.cache.write(d,t,s.cacheLifetime,!0)}})}},remote:function(e){var a=this,r=i.options.get();t.hasClass("flexdatalist-loading")||(t.addClass("flexdatalist-loading"),"json"===r.requestContentType&&(e.data=JSON.stringify(e.data)),$.ajax($.extend({type:r.requestType,dataType:"json",headers:r.requestHeaders,contentType:"application/"+r.requestContentType+"; charset=UTF-8",complete:function(){t.removeClass("flexdatalist-loading")}},e,{success:function(t){t=a.extractRemoteData(t),e.success(t)}})))},extractRemoteData:function(e){var t=i.options.get(),a=i.isDefined(e,t.resultsProperty)?e[t.resultsProperty]:e;return"string"==typeof a&&0===a.indexOf("[{")&&(a=JSON.parse(a)),a&&a.options&&i.options.set($.extend({},t,a.options)),i.isObject(a)?a:[]},relativesData:function(){var e=i.options.get("relatives"),t={};return e&&(t.relatives={},e.each((function(){var e=$(this),i=e.attr("name").split("][").join("-").split("]").join("-").split("[").join("-").replace(/^\|+|\-+$/g,"");t.relatives[i]=e.val()}))),t}},this.search={get:function(e,a,r){var s=a;if(!i.options.get().searchDisabled&&!(s=i.cache.read(e))){if(t.trigger("before:flexdatalist.search",[e,a]),!i.isEmpty(e)){s=[];for(var n=this.split(e),l=0;l<a.length;l++){var o=a[l];i.isDup(o)||(o=this.matches(o,n))&&s.push(o)}}i.cache.write(e,s,2),t.trigger("after:flexdatalist.search",[e,a,s])}r(s)},matches:function(e,t){var a=$.extend({},e),r=[],s=i.options.get(),n=s.searchIn;if(t.length>0)for(var l=0;l<n.length;l++){var o=n[l];if(i.isDefined(e,o)&&e[o]){for(var u=e[o].toString(),c=u,f=this.split(u),d=0;d<t.length;d++){var h=t[d];this.find(h,f)&&(r.push(h),c=this.highlight(h,c))}c!==u&&(a[o+"_highlight"]=this.highlight(c))}}return!(0===r.length||s.searchByWord&&r.length<t.length-1)&&a},highlight:function(e,t){return t?(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t.replace(new RegExp(e,i.options.get("searchContain")?"ig":"i"),"|:|$&|::|")):(e=e.split("|:|").join('<span class="highlight">')).split("|::|").join("</span>")},find:function(e,t){for(var a=i.options.get(),r=0;r<t.length;r++){var s=t[r];if(s=this.normalizeString(s),e=this.normalizeString(e),a.searchEqual)return s==e;if(a.searchContain?s.indexOf(e)>=0:0===s.indexOf(e))return!0}return!1},split:function(e){if("string"==typeof e&&(e=[$.trim(e)]),i.options.get("searchByWord"))for(var t=0;t<e.length;t++){var a=$.trim(e[t]);if(a.indexOf(" ")>0){var r=a.split(" ");$.merge(e,r)}}return e},normalizeString:function(e){if("string"==typeof e){var t=i.options.get("normalizeString");return"function"==typeof t&&(e=t(e)),(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")).toUpperCase()}return e}},this.results={show:function(e){var a=this,r=i.options.get();if(this.remove(!0),e)if(0!==e.length){var s=this.container();r.groupBy?(e=this.group(e),Object.keys(e).forEach((function(t,n){var l=e[t],o=r.groupBy,u=i.results.highlight(l[0],o,t);$("<li>").addClass("group").append($("<span>").addClass("group-name").html(u)).append($("<span>").addClass("group-item-count").text(" "+l.length)).appendTo(s);a.items(l,s)}))):this.items(e,s);var n=s.find("li:not(.group)");n.on("click",(function(e){var s=$(this).data("item");s&&(i.fvalue.extract(s),a.remove(),t.trigger("select:flexdatalist",[s,r]))})).on("hover",(function(){n.removeClass("active"),$(this).addClass("active").trigger("active:flexdatalist.results",[$(this).data("item")])}),(function(){$(this).removeClass("active")})),r.focusFirstResult&&n.filter(":first").addClass("active")}else this.empty(r.noResultsText)},empty:function(e){if(!i.isEmpty(e)){var a=this.container(),r=l.val();e=e.split("{keyword}").join(r),$("<li>").addClass("item no-results").append(e).appendTo(a),t.trigger("empty:flexdatalist.results",[e])}},items:function(e,a){var r=i.options.get("maxShownResults");t.trigger("show:flexdatalist.results",[e]);for(var s=0;s<e.length&&!(r>0&&r===s);s++)this.item(e[s],s,e.length).appendTo(a);t.trigger("shown:flexdatalist.results",[e])},item:function(e,a,r){var s=$("<li>").attr({role:"option",tabindex:"-1","aria-posinset":a+1,"aria-setsize":r}).data("item",e).addClass("item"),n=i.options.get(),l=n.visibleProperties;for(a=0;a<l.length;a++){var o=l[a];if(o.indexOf("{")>-1){var u=i.fvalue.placeholders.replace(e,o),c=i.fvalue.placeholders.parse(o);f=$("<span>").addClass("item item-"+Object.values(c).join("-")).html(u+" ")}else{if(n.groupBy&&n.groupBy===o||!i.isDefined(e,o))continue;var f={};if(o===n.iconProperty)f=$("<img>").addClass("item item-"+o).attr("src",e[o]);else{var d=i.results.highlight(e,o);f=$("<span>").addClass("item item-"+o).html(d+" ")}}f.appendTo(s)}return t.trigger("item:flexdatalist.results",[s,e]),s},container:function(){var e=t;o&&(e=o);var a=$("ul.flexdatalist-results");return 0===a.length&&(a=$("<ul>").addClass("flexdatalist-results ").appendTo("body").attr({id:l.attr("id")+"-results",role:"listbox"}).css({"border-color":e.css("border-left-color"),"border-width":"1px","border-bottom-left-radius":e.css("border-bottom-left-radius"),"border-bottom-right-radius":e.css("border-bottom-right-radius")}).data({target:o||l,input:t}),i.position(l)),a},group:function(e){for(var t=[],a=i.options.get("groupBy"),r=0;r<e.length;r++){var s=e[r];if(i.isDefined(s,a)){var n=s[a];i.isDefined(t,n)||(t[n]=[]),t[n].push(s)}}return t},highlight:function(e,t,a){return i.isDefined(e,t+"_highlight")?e[t+"_highlight"]:i.isDefined(e,t)?e[t]:a},active:function(e){},remove:function(e){var i="ul.flexdatalist-results";e&&(i="ul.flexdatalist-results li"),t.trigger("remove:flexdatalist.results"),$(i).remove(),t.trigger("removed:flexdatalist.results")}},this.cache={write:function(e,t,a,r){if(i.cache.isSupported()){e=this.keyGen(e,void 0,r);var s={value:t,timestamp:i.unixtime(),lifetime:a||!1};localStorage.setItem(e,JSON.stringify(s))}},read:function(e,t){if(i.cache.isSupported()){e=this.keyGen(e,void 0,t);var a=localStorage.getItem(e);if(a){var r=JSON.parse(a);if(!this.expired(r))return r.value;localStorage.removeItem(e)}}return null},delete:function(e,t){i.cache.isSupported()&&(e=this.keyGen(e,void 0,t),localStorage.removeItem(e))},clear:function(){if(i.cache.isSupported()){for(var e in localStorage)(e.indexOf(n)>-1||e.indexOf("global")>-1)&&localStorage.removeItem(e);localStorage.clear()}},gc:function(){if(i.cache.isSupported())for(var e in localStorage)if(e.indexOf(n)>-1||e.indexOf("global")>-1){var t=localStorage.getItem(e);t=JSON.parse(t),this.expired(t)&&localStorage.removeItem(e)}},isSupported:function(){if(i.options.get("cache"))try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}return!1},expired:function(e){if(e.lifetime){var t=i.unixtime()-e.timestamp;return e.lifetime<=t}return!1},keyGen:function(e,t,i){"object"==typeof e&&(e=JSON.stringify(e));var a,r,s=void 0===t?2166136261:t;for(a=0,r=e.length;a<r;a++)s^=e.charCodeAt(a),s+=(s<<1)+(s<<4)+(s<<7)+(s<<8)+(s<<24);return(i?"global":n)+("0000000"+(s>>>0).toString(16)).substr(-8)}},this.options={init:function(){var e=$.extend({},r,t.data(),{multiple:null===r.multiple?t.is("[multiple]"):r.multiple,disabled:null===r.disabled?t.is("[disabled]"):r.disabled,originalValue:i.value});return this.set(e),e},get:function(e){var a=t.data("flexdatalist");return e?i.isDefined(a,e)?a[e]:null:a||{}},set:function(e,a){var r=this.get();return i.isDefined(r,e)&&i.isDefined(a)?r[e]=a:i.isObject(e)&&(r=this._normalize(e)),t.data("flexdatalist",r),t},_normalize:function(e){if(e.searchIn=i.csvToArray(e.searchIn),e.relatives=e.relatives&&$(e.relatives).length>0?$(e.relatives):null,e.textProperty=null===e.textProperty?e.searchIn[0]:e.textProperty,e.visibleProperties=i.csvToArray(e.visibleProperties,e.searchIn),"*"===e.valueProperty&&e.multiple&&!e.selectionRequired)throw new Error("Selection must be required for multiple, JSON fields!");return e}},this.position=function(){var e=$("ul.flexdatalist-results"),t=e.data("target");e.length>0&&e.css({width:t.outerWidth()+"px",top:t.offset().top+t.outerHeight()+"px",left:t.offset().left+"px"})},this.fdisabled=function(e){if(this.isDefined(e)){if(t.prop("disabled",e),l.prop("disabled",e),o){o.css("background-color",t.css("background-color"));var i=o.find("li .fdl-remove"),a=o.find("li.input-container");e?(o.addClass("disabled"),i.length>0&&a.hide(),i.hide()):(o.removeClass("disabled"),a.show(),i.show())}this.options.set("disabled",e)}return this.options.get("disabled")},this.isDup=function(e){return!this.options.get("allowDuplicateValues")&&(s.length>0&&s.indexOf(this.fvalue.text(e))>-1)},this.keyNum=function(e){return e.which||e.keyCode},this.isEmpty=function(e){return!i.isDefined(e)||(null===e||!0!==e&&(0===this.length(e)||""===$.trim(e)))},this.isObject=function(e){return e&&"object"==typeof e},this.length=function(e){return this.isObject(e)?Object.keys(e).length:"number"==typeof e||"number"==typeof e.length?e.toString().length:0},this.isDefined=function(e,t){var i=void 0!==e;return i&&void 0!==t?void 0!==this.getPropertyValue(e,t):i},this.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},this.unixtime=function(e){var t=new Date;return e&&(t=new Date(e)),Math.round(t.getTime()/1e3)},this.csvToArray=function(e,t){return 0===e.length?t:"string"==typeof e?e.split(i.options.get("valuesSeparator")):e},this.getPropertyValue=function(e,t){if(e&&"string"==typeof t){for(var i=t.split(".");i.length&&(e=e[i.shift()]););return e}},this.escapeHtml=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},this.debug=function(e,a){var r=i.options.get();r.debug&&(a||(a={}),e="Flexdatalist: "+e,console.warn(e),console.log($.extend({inputName:t.attr("name"),options:r},a)),console.log("--- /flexdatalist ---"))},this.init()}))},jQuery((function(e){e(document).data("flexdatalist")||e(document).on("mouseup",(function(t){var i=e(".flexdatalist-results"),a=i.data("target");a&&a.is(":focus")||i.is(t.target)||0!==i.has(t.target).length||i.remove()})).on("keydown",(function(t){var i=e(".flexdatalist-results"),a=i.find("li"),r=a.filter(".active"),s=r.index(),n=a.length,l=t.which||t.keyCode;if(0!==n)if(27!==l){if(13===l)t.preventDefault(),r.trigger("click");else if(40===l||38===l){t.preventDefault(),40===l?r=s<n&&r.nextAll(".item").first().length>0?r.removeClass("active").nextAll(".item").first().addClass("active"):a.removeClass("active").filter(".item:first").addClass("active"):38===l&&(r=s>0&&r.prevAll(".item").first().length>0?r.removeClass("active").prevAll(".item").first().addClass("active"):a.removeClass("active").filter(".item:last").addClass("active")),r.trigger("active:flexdatalist.results",[r.data("item")]);var o=(0===r.prev().length?r:r.prev()).position().top;i.animate({scrollTop:o+i.scrollTop()},100)}}else i.remove()})).data("flexdatalist",!0),jQuery("input.flexdatalist:not(.flexdatalist-set):not(.autodiscover-disabled)").flexdatalist()})),function(e){var t=e.fn.val;e.fn.val=function(e){var i=this.length>0&&void 0!==this[0].fvalue;return void 0===e?i?this[0].fvalue.get(!0):t.call(this):i?this[0].fvalue.set(e):t.call(this,e)}}(jQuery); +//# sourceMappingURL=jquery.flexdatalist.min.js.map
\ No newline at end of file diff --git a/dllib/jquery.flexdatalist.min.js.map b/dllib/jquery.flexdatalist.min.js.map new file mode 100644 index 0000000..27d4ef7 --- /dev/null +++ b/dllib/jquery.flexdatalist.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["jquery.flexdatalist.js"],"names":[],"mappings":"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"}
\ No newline at end of file diff --git a/dllib/jquery.js b/dllib/jquery.js new file mode 100644 index 0000000..200b54e --- /dev/null +++ b/dllib/jquery.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Se(this,e,Ce),!1},trigger:function(){return Se(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Me=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ie=new RegExp(ne.join("|"),"i");function We(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Pe.test(a)&&Ie.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var Be=["Webkit","Moz","ms"],$e=E.createElement("div").style,_e={};function ze(e){var t=S.cssProps[e]||_e[e];return t||(e in $e?e:_e[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Be.length;while(n--)if((e=Be[n]+t)in $e)return e}(e)||e)}var Ue=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ve={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Je(e,t,n){var r=Re(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Qe(e,t,n||(i?"border":"content"),o,r,a)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Xe.test(t),l=e.style;if(u||(t=ze(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Xe.test(t)||(t=ze(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ue.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,u,n):Me(e,Ve,function(){return Je(e,u,n)})},set:function(e,t,n){var r,i=Re(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Qe(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Qe(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Ye(0,t,s)}}}),S.cssHooks.marginLeft=Fe(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Me(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Ye)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=Ke).prototype={constructor:Ke,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}}).init.prototype=Ke.prototype,(Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[ze(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Ke.prototype.init,S.fx.step={};var Ze,et,tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){et&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(ot):C.setTimeout(ot,S.fx.interval),S.fx.tick())}function at(){return C.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=Ze||at(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:Ze||at(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=lt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ut,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(lt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],lt.tweeners[n]=lt.tweeners[n]||[],lt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],rt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ut(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?lt.prefilters.unshift(e):lt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=lt(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&it.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(st(r,!0),e,t,n)}}),S.each({slideDown:st("show"),slideUp:st("hide"),slideToggle:st("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(Ze=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),Ze=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){et||(et=!0,ot())},S.fx.stop=function(){et=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},tt=E.createElement("input"),nt=E.createElement("select").appendChild(E.createElement("option")),tt.type="checkbox",y.checkOn=""!==tt.value,y.optSelected=nt.selected,(tt=E.createElement("input")).value="t",tt.type="radio",y.radioValue="t"===tt.value;var ct,ft=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=ft[t]||S.find.attr;ft[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=ft[o],ft[o]=r,r=null!=a(e,t,n)?o:null,ft[o]=i),r}});var pt=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;function ht(e){return(e.match(P)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,gt(this)))});if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,gt(this)))});if(!arguments.length)return this.attr("class","");if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,gt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=vt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=gt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+ht(gt(n))+" ").indexOf(t))return!0;return!1}});var yt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(yt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ht(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var mt=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!mt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,mt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,xt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,xt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var bt=C.location,wt={guid:Date.now()},Tt=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Ct=/\[\]$/,Et=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,kt=/^(?:input|select|textarea|keygen)/i;function At(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||Ct.test(n)?i(n,t):At(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)At(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)At(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&kt.test(this.nodeName)&&!St.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(Et,"\r\n")}}):{name:t.name,value:n.replace(Et,"\r\n")}}).get()}});var Nt=/%20/g,jt=/#.*$/,Dt=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Ht=/^\/\//,Ot={},Pt={},Rt="*/".concat("*"),Mt=E.createElement("a");function It(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Wt(t,i,o,a){var s={},u=t===Pt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Ft(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=bt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,S.ajaxSettings),t):Ft(S.ajaxSettings,e)},ajaxPrefilter:It(Ot),ajaxTransport:It(Pt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=qt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||bt.href)+"").replace(Ht,bt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Wt(Ot,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Lt.test(v.type),f=v.url.replace(jt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Tt.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Dt,"$1"),o=(Tt.test(f)?"&":"?")+"_="+wt.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+Rt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Wt(Pt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&S.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},$t=S.ajaxSettings.xhr();y.cors=!!$t&&"withCredentials"in $t,y.ajax=$t=!!$t,S.ajaxTransport(function(i){var o,a;if(y.cors||$t&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Bt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=ht(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Xt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Xt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Vt=C.jQuery,Gt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Gt),e&&C.jQuery===S&&(C.jQuery=Vt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
\ No newline at end of file diff --git a/dllib/org.js b/dllib/org.js new file mode 100644 index 0000000..6c1bad1 --- /dev/null +++ b/dllib/org.js @@ -0,0 +1 @@ +var OrgChart=function(t,e){var r=this;if(this.element=t,this.config={lazyLoading:!0,enableDragDrop:!1,enableSearch:!0,enableTouch:!1,enableKeyNavigation:!1,miniMap:!1,nodeMenu:null,nodeCircleMenu:null,nodeContextMenu:null,menu:null,toolbar:!1,sticky:!0,nodeMouseClick:OrgChart.action.details,nodeMouseDbClick:OrgChart.none,mouseScrool:OrgChart.action.zoom,showXScroll:OrgChart.none,showYScroll:OrgChart.none,template:"ana",tags:{},min:!1,nodeBinding:{},linkBinding:{},searchFields:[],searchDisplayField:null,searchFieldsWeight:null,nodes:[],clinks:[],slinks:[],levelSeparation:60,siblingSeparation:20,subtreeSeparation:40,mixedHierarchyNodesSeparation:15,assistantSeparation:100,minPartnerSeparation:50,partnerChildrenSplitSeparation:20,partnerNodeSeparation:15,columns:10,padding:30,orientation:OrgChart.orientation.top,layout:OrgChart.normal,scaleInitial:1,scaleMin:.1,scaleMax:5,orderBy:null,editUI:null,searchUI:null,xScrollUI:null,yScrollUI:null,nodeMenuUI:null,nodeCircleMenuUI:null,nodeContextMenuUI:null,toolbarUI:null,notifierUI:null,menuUI:null,exportUrl:"https://balkan.app/export",collapse:{},expand:{},align:OrgChart.CENTER,UI:null,anim:{func:OrgChart.anim.outPow,duration:200},zoom:{speed:120,smooth:12},roots:null,state:null},e)for(var i in this.config)"object"!=typeof e[i]||Array.isArray(e[i])?void 0!==e[i]&&(this.config[i]=e[i]):this.config[i]=OrgChart._mergeObject(this.config[i],e[i]);if(this._layoutConfigs={base:{orientation:this.config.orientation,levelSeparation:this.config.levelSeparation,mixedHierarchyNodesSeparation:this.config.mixedHierarchyNodesSeparation,assistantSeparation:this.config.assistantSeparation,subtreeSeparation:this.config.subtreeSeparation,siblingSeparation:this.config.siblingSeparation,layout:this.config.layout,columns:this.config.columns,collapse:this.config.collapse,partnerNodeSeparation:this.config.partnerNodeSeparation}},this.config.tags)for(var a in this.config.tags){var n=this.config.tags[a];null!=n.subTreeConfig&&(this._layoutConfigs[a]={orientation:null!=n.subTreeConfig.orientation?n.subTreeConfig.orientation:this.config.orientation,levelSeparation:null!=n.subTreeConfig.levelSeparation?n.subTreeConfig.levelSeparation:this.config.levelSeparation,mixedHierarchyNodesSeparation:null!=n.subTreeConfig.mixedHierarchyNodesSeparation?n.subTreeConfig.mixedHierarchyNodesSeparation:this.config.mixedHierarchyNodesSeparation,assistantSeparation:null!=n.subTreeConfig.assistantSeparation?n.subTreeConfig.assistantSeparation:this.config.assistantSeparation,subtreeSeparation:null!=n.subTreeConfig.subtreeSeparation?n.subTreeConfig.subtreeSeparation:this.config.subtreeSeparation,siblingSeparation:null!=n.subTreeConfig.siblingSeparation?n.subTreeConfig.siblingSeparation:this.config.siblingSeparation,layout:null!=n.subTreeConfig.layout?n.subTreeConfig.layout:this.config.layout,columns:null!=n.subTreeConfig.columns?n.subTreeConfig.columns:this.config.columns,collapse:null!=n.subTreeConfig.collapse?n.subTreeConfig.collapse:this.config.collapse,partnerNodeSeparation:null!=n.subTreeConfig.partnerNodeSeparation?n.subTreeConfig.partnerNodeSeparation:this.config.partnerNodeSeparation})}if(this._event_id=OrgChart._guid(),!this.config.searchFields.length&&this.config.nodeBinding)for(var o in this.config.nodeBinding)-1==o.indexOf("img")&&"function"!=typeof this.config.nodeBinding[o]&&this.config.searchFields.push(this.config.nodeBinding[o]);OrgChart._validateConfig(this.config)&&(this.server=null,this._vScroll={},this.config.ui||(this.ui=OrgChart.ui),this.config.editUI?this.editUI=this.config.editUI:this.editUI=new OrgChart.editUI,this.editUI.init(this),null===this.server&&(this.server=new OrgChart.server(this.config,this._layoutConfigs)),this.config.searchUI?this.searchUI=this.config.searchUI:this.searchUI=new OrgChart.searchUI,this.searchUI.init(this),this.config.nodeMenuUI?this.nodeMenuUI=this.config.nodeMenuUI:this.nodeMenuUI=new OrgChart.menuUI,this.nodeMenuUI.init(this,this.config.nodeMenu),this.config.nodeCircleMenuUI?this.nodeCircleMenuUI=this.config.nodeCircleMenuUI:this.nodeCircleMenuUI=new OrgChart.circleMenuUI,this.nodeCircleMenuUI.init(this,this.config.nodeCircleMenu),this.config.nodeContextMenuUI?this.nodeContextMenuUI=this.config.nodeContextMenuUI:this.nodeContextMenuUI=new OrgChart.menuUI,this.nodeContextMenuUI.init(this,this.config.nodeContextMenu),this.config.toolbarUI?this.toolbarUI=this.config.toolbarUI:this.toolbarUI=new OrgChart.toolbarUI,this.config.notifierUI?this.notifierUI=this.config.notifierUI:this.notifierUI=new OrgChart.notifierUI,this.notifierUI.init(this),this.config.menuUI?this.menuUI=this.config.menuUI:this.menuUI=new OrgChart.menuUI,this.menuUI.init(this,this.config.menu),this.config.xScrollUI||(this.xScrollUI=new OrgChart.xScrollUI(this.element,this.config,function(){return{boundary:r.response.boundary,scale:r.getScale(),viewBox:r.getViewBox(),padding:r.config.padding}},function(t){r.setViewBox(t)},function(){r._draw(!0,OrgChart.action.xScroll)})),this.config.yScrollUI||(this.yScrollUI=new OrgChart.yScrollUI(this.element,this.config,function(){return{boundary:r.response.boundary,scale:r.getScale(),viewBox:r.getViewBox(),padding:r.config.padding}},function(t){r.setViewBox(t)},function(){r._draw(!0,OrgChart.action.xScroll)})),this._gragStartedId=null,this._timeout=null,this._touch=null,this._initialized=!1,this._moveInterval=null,this._movePosition=null,this.response=null,this.nodes=null,this._setInitialSizeIfNotSet(),0<this.config.nodes.length&&this._draw(!1,OrgChart.action.init))};OrgChart.prototype.load=function(t){return this.config.nodes=t,this._draw(!1,OrgChart.action.init),this},OrgChart.prototype.loadXML=function(t){var e=OrgChart._xml2json(t);this.load(e)},OrgChart.prototype.getXML=function(){return OrgChart._json2xml(this.config.nodes)},OrgChart.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.prototype.draw=function(t,e,r){null==t&&(t=OrgChart.action.update),this._draw(!1,t,e,r)},OrgChart.prototype._draw=function(t,m,O,y){var v=this;this._hideBeforeAnimationCompleted=!1;var e=m==OrgChart.action.init?null:this.getViewBox();this.server.read(t,this.width(),this.height(),e,m,O,function(t){m!=OrgChart.action.exporting&&(v.nodes=t.nodes,v.visibleNodeIds=t.visibleNodeIds,v.roots=t.roots),v.editUI.fields=t.allFields;var e={defs:""};OrgChart.events.publish("renderdefs",[v,e]);var r=v.ui.defs(e.defs),i=v.getScale(t.viewBox);r+=v.ui.pointer(v.config,m,i);var a=v.getViewBox(),n=t.viewBox;e={content:r,res:t};OrgChart.events.publish("prerender",[v,e]),r=e.content;for(var o=0;o<t.visibleNodeIds.length;o++){var l=t.nodes[t.visibleNodeIds[o]],s=v._get(l.id);r+=v.ui.node(l,s,t.animations,v.config,void 0,void 0,void 0,m,i,v)}for(o=0;o<t.visibleNodeIds.length;o++){l=t.nodes[t.visibleNodeIds[o]],s=v._get(l.id);r+=v.ui.link(l,v,i,t.bordersByRootIdAndLevel,t.nodes,m),r+=v.ui.expandCollapseBtn(v,l,v._layoutConfigs,m,i)}e={content:r,res:t};if(OrgChart.events.publish("render",[v,e]),r=e.content,t=e.res,r+=v.ui.lonely(v.config),m!==OrgChart.action.exporting){m!==OrgChart.action.centerNode&&m!==OrgChart.action.insert&&m!==OrgChart.action.expand&&m!==OrgChart.action.collapse&&m!==OrgChart.action.update||(n=a),m===OrgChart.action.init&&null!=a&&(n=a),v.response=t;C=v.ui.svg(v.width(),v.height(),n,v.config,r);if(v._initialized){var h=v.getSvg(),d=h.parentNode;d.removeChild(h),d.insertAdjacentHTML("afterbegin",C),v._attachEventHandlers(),v.xScrollUI.addListener(v.getSvg()),v.yScrollUI.addListener(v.getSvg()),v.xScrollUI.setPosition(),v.yScrollUI.setPosition()}else v.element.innerHTML=v.ui.css()+v.ui.exportMenuButton(v.config)+C,v._attachInitEventHandlers(),v._attachEventHandlers(),v.xScrollUI.create(v.width(),v.config.padding),v.xScrollUI.setPosition(),v.xScrollUI.addListener(v.getSvg()),v.yScrollUI.create(v.height(),v.config.padding),v.yScrollUI.setPosition(),v.yScrollUI.addListener(v.getSvg()),v.config.enableSearch&&v.searchUI.addSearchControl(),v.toolbarUI.init(v,v.config.toolbar);var c=!1;v.notifierUI.show(t.notif);var g=v.response.animations;if(0<g[0].length){v._hideBeforeAnimation(g[0].length);for(o=0;o<g[0].length;o++)g[0][o]=v.getNodeElement(g[0][o]);OrgChart.anim(g[0],g[1],g[2],v.config.anim.duration,v.config.anim.func,function(){c||(y&&y(),OrgChart.events.publish("redraw",[v]),v._showAfterAnimation(),c=!0)})}m===OrgChart.action.centerNode?OrgChart.anim(v.getSvg(),{viewbox:a},{viewbox:v.response.viewBox},v.config.anim.duration,v.config.anim.func,function(){v.ripple(O.options.rippleId),c||(y&&y(),OrgChart.events.publish("redraw",[v]),v._showAfterAnimation(),c=!0)},function(){v.xScrollUI.setPosition(),v.yScrollUI.setPosition()}):!a||!v.response||a[0]==v.response.viewBox[0]&&a[1]==v.response.viewBox[1]&&a[2]==v.response.viewBox[2]&&a[3]==v.response.viewBox[3]||m!==OrgChart.action.insert&&m!==OrgChart.action.expand&&m!==OrgChart.action.collapse&&m!==OrgChart.action.update&&m!==OrgChart.action.init?0==g[0].length&&(c||(y&&y(),OrgChart.events.publish("redraw",[v]),c=!0)):OrgChart.anim(v.getSvg(),{viewbox:a},{viewbox:v.response.viewBox},500,OrgChart.anim.inOutPow,function(){v.xScrollUI.setPosition(),v.yScrollUI.setPosition(),c||(y&&y(),OrgChart.events.publish("redraw",[v]),c=!0)}),v._initialized||(v._initialized=!0,OrgChart.events.publish("init",[v]))}else{var p=t.boundary,f=p.maxX-p.minX,u=p.maxY-p.minY,C=v.ui.svg(f,u,[p.minX,p.minY,f,u],v.config,r,i);y(C)}},function(t){OrgChart.events.publish("ready",[v,t])})},OrgChart.prototype._setInitialSizeIfNotSet=function(){this.element.style.overflow="hidden",this.element.style.position="relative",0==this.element.offsetHeight&&(this.element.style.height="100%",0==this.element.offsetHeight&&(this.element.style.height="700px")),0==this.element.offsetWidth&&(this.element.style.width="100%",0==this.element.offsetWidth&&(this.element.style.width="700px"))},OrgChart.prototype.getViewBox=function(){var t=this.getSvg();return OrgChart._getViewBox(t)},OrgChart.prototype.setViewBox=function(t){this.getSvg().setAttribute("viewBox",t.toString())},OrgChart.prototype.width=function(){return this.element.offsetWidth},OrgChart.prototype.height=function(){return this.element.offsetHeight},OrgChart.prototype.getScale=function(t){return t||(t=this.getViewBox()),OrgChart.getScale(t,this.width(),this.height(),this.config.scaleInitial,this.config.scaleMax,this.config.scaleMin)},OrgChart.prototype.ripple=function(t,e,r){var i=this.getNode(t);if(null!=i){var a=this.getNodeElement(t);if(null!=a){var n=this.getScale(),o=i.w/2,l=i.h/2;if(void 0!==e&&void 0!==r){var s=a.getBoundingClientRect();o=e/n-s.left/n,l=r/n-s.top/n}var h=i.w,d=i.h,c=o<h-o?h-o:o,g=l<d-l?d-l:l,p=(g=g)<(c=c)?c:g,f=document.createElementNS("http://www.w3.org/2000/svg","g"),u=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),C=document.createElementNS("http://www.w3.org/2000/svg","rect"),m=document.createElementNS("http://www.w3.org/2000/svg","circle"),O=OrgChart.randomId();u.setAttribute("id",O);var y={ripple:OrgChart.t(i.templateName,i.min,this.getScale()).ripple,node:i};OrgChart.events.publish("ripple",[this,y]),C.setAttribute("x",y.ripple.rect?y.ripple.rect.x:0),C.setAttribute("y",y.ripple.rect?y.ripple.rect.y:0),C.setAttribute("width",y.ripple.rect?y.ripple.rect.width:i.w),C.setAttribute("height",y.ripple.rect?y.ripple.rect.height:i.h),C.setAttribute("rx",y.ripple.radius),C.setAttribute("ry",y.ripple.radius),m.setAttribute("clip-path","url(#"+O+")"),m.setAttribute("cx",o),m.setAttribute("cy",l),m.setAttribute("r",0),m.setAttribute("fill",y.ripple.color),m.setAttribute("class","ripple"),u.appendChild(C),f.appendChild(u),f.appendChild(m),a.appendChild(f),OrgChart.anim(m,{r:0,opacity:1},{r:p,opacity:0},500,OrgChart.anim.outPow,function(){a.removeChild(f)})}}},OrgChart.prototype.center=function(t,e,r){var i,a,n=t,o=!0,l=!0;e&&null!=e.parentState&&(i=e.parentState),e&&null!=e.childrenState&&(a=e.childrenState),e&&null!=e.rippleId&&(n=e.rippleId),e&&null!=e.vertical&&(o=e.vertical),e&&null!=e.horizontal&&(l=e.horizontal);var s={parentState:i,childrenState:a,rippleId:n,vertical:o,horizontal:l};this._draw(!1,OrgChart.action.centerNode,{id:t,options:s},r)},OrgChart.prototype.fit=function(t){this.config.scaleInitial=OrgChart.match.boundary,this._draw(!0,OrgChart.action.init,{method:"fit"},t)},OrgChart.prototype.toggleFullScreen=function(){var t=document.querySelector("["+OrgChart.attr.tlbr+"r='fullScreen']");document.fullscreenElement==this.element||document.webkitFullscreenElement==this.element||document.mozFullScreenElement==this.element||document.msFullscreenElement==this.element?(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),t&&(t.innerHTML=OrgChart.toolbarUI.openFullScreenIcon)):(this.element.requestFullscreen?this.element.requestFullscreen():this.element.mozRequestFullScreen?this.element.mozRequestFullScreen():this.element.webkitRequestFullscreen?this.element.webkitRequestFullscreen():this.element.msRequestFullscreen&&this.element.msRequestFullscreen(),t&&(t.innerHTML=OrgChart.toolbarUI.closeFullScreenIcon))},OrgChart.prototype.getNode=function(t){return this.nodes[t]},OrgChart.prototype.setLayout=function(t,e){e||(e="base"),this._layoutConfigs[e].layout=t,this._draw(!1,OrgChart.action.update)},OrgChart.prototype.setOrientation=function(t,e){e||(e="base"),this._layoutConfigs[e].orientation=t,this._draw(!1,OrgChart.action.update)},OrgChart.prototype.find=function(t){return this.search(t)},OrgChart.prototype.search=function(t,e,r){return OrgChart.isNullOrEmpty(e)&&(e=this.config.searchFields),OrgChart.isNullOrEmpty(r)&&(r=e),OrgChart._search.search(this.config.nodes,t,e,r,this.config.searchDisplayField,this.config.searchFieldsWeight)},OrgChart.prototype._hideBeforeAnimation=function(t){if(1!=this._hideBeforeAnimationCompleted&&!(t&&t<OrgChart.ANIM_THRESHOLD)){var e=this.element.getElementsByTagName("text");if(e.length>OrgChart.TEXT_THRESHOLD)for(var r=0;r<e.length;r++)e[r].style.display="none";var i=this.element.getElementsByTagName("image");if(i.length>OrgChart.IMAGES_THRESHOLD)for(r=0;r<i.length;r++)i[r].style.display="none";var a=this.element.querySelectorAll("["+OrgChart.attr.link_id+"]");if(a.length>OrgChart.LINKS_THRESHOLD)for(r=0;r<a.length;r++)a[r].style.display="none";var n=this.element.querySelectorAll("["+OrgChart.attr.control_expcoll_id+"]");if(n.length>OrgChart.EXPCOLL_THRESHOLD)for(r=0;r<n.length;r++)n[r].style.display="none";this._hideBeforeAnimationCompleted=!0}},OrgChart.prototype._showAfterAnimation=function(){for(var t=this.element.getElementsByTagName("text"),e=0;e<t.length;e++)t[e].style.display="";var r=this.element.getElementsByTagName("image");for(e=0;e<r.length;e++)r[e].style.display="";var i=this.element.querySelectorAll("["+OrgChart.attr.link_id+"]");for(e=0;e<i.length;e++)i[e].style.display="";var a=this.element.querySelectorAll("["+OrgChart.attr.control_expcoll_id+"]");for(e=0;e<a.length;e++)a[e].style.display="";this._hideBeforeAnimationCompleted=!1},OrgChart.prototype.isChild=function(t,e){for(var r=this.getNode(e);r;){if(r.id==t)return!0;r=r.parent?r.parent:r.stParent}return!1},OrgChart.prototype.getCollapsedIds=function(t){for(var e=[],r=0;r<t.childrenIds.length;r++){var i=this.getNode(t.childrenIds[r]);1==i.collapsed&&e.push(i.id)}return e},OrgChart.prototype.stateToUrl=function(){if(this.server.state){var t={};return t.exp=this.server.state.exp.join("*"),t.min=this.server.state.min.join("*"),t.adjustify=this.server.state.adjustify.x+"*"+this.server.state.adjustify.y,t.scale=this.server.state.scale,t.y=this.server.state.x,t.x=this.server.state.y,new URLSearchParams(t).toString()}return""},OrgChart.prototype.generateId=function(){for(;;){var t="_"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4);if(!this.nodes.hasOwnProperty(t))return t}},OrgChart.prototype.destroy=function(){this._removeEvent(window,"resize"),OrgChart.events.removeForEventId(this._event_id),this.element.innerHTML=null},OrgChart.localStorage={},OrgChart.localStorage.getItem=function(t){return localStorage.getItem(t)},OrgChart.localStorage.setItem=function(t,e){try{localStorage.setItem(t,e)}catch(t){t.code==t.QUOTA_EXCEEDED_ERR?(console.warn("Local storage quota exceeded"),localStorage.clear()):(console.error("Local storage error code:"+t.code),console.error(t))}},OrgChart.prototype._canUpdateLink=function(t,e){if(null==e||null==e)return!1;if(null==t||null==t)return!1;if(t==e)return!1;var r=this.getNode(e),i=this.getNode(t);return!(r&&i&&(r.isAssistant||r.isPartner||r.hasPartners&&i.isAssistant||r.hasAssistants&&i.isPartner))&&!this.isChild(t,e)},OrgChart.prototype.updateNode=function(t,e,r){var i=this,a=this.get(t.id);if(!0===r&&!1===OrgChart.events.publish("update",[this,a,t]))return!1;this.update(t);var n=this.getNode(t.id),o=n.pid;null==o&&(o=n.stpid),this._draw(!1,OrgChart.action.update,{id:o},function(){i.ripple(t.id),e&&e(),OrgChart.events.publish("updated",[i,a,t])})},OrgChart.prototype.update=function(t){for(var e=0;e<this.config.nodes.length;e++)if(this.config.nodes[e].id==t.id){this.config.nodes[e]=t;break}return this},OrgChart.prototype.removeNode=function(t,e,r){var i=this,a=this._getNewPidsAndStpidsForIds(t);if(!0===r&&!1===OrgChart.events.publish("remove",[this,t,a]))return!1;return this.remove(t),this._draw(!1,OrgChart.action.update,null,function(){i.config.sticky&&OrgChart._moveToBoundaryArea(i.getSvg(),i.getViewBox(),i.response.boundary),e&&e(),OrgChart.events.publish("removed",[i,t,a])}),!0},OrgChart.prototype.remove=function(t){var e=this.get(t);if(e)for(var r=this.config.nodes.length-1;0<=r;r--)this.config.nodes[r].pid!=t&&this.config.nodes[r].stpid!=t||(this.config.nodes[r].pid=e.pid,this.config.nodes[r].stpid=e.stpid),this.config.nodes[r].id==t&&this.config.nodes.splice(r,1);return this},OrgChart.prototype._getNewPidsAndStpidsForIds=function(t){var e=this.get(t),r={},i={};if(e)for(var a=this.config.nodes.length-1;0<=a;a--)this.config.nodes[a].pid==t?r[this.config.nodes[a].id]=e.pid:this.config.nodes[a].stpid==t&&(i[this.config.nodes[a].id]=e.stpid);return{newPidsForIds:r,newStpidsForIds:i}},OrgChart.prototype.addNode=function(t,e,r){var i=this;if(!0===r&&!1===OrgChart.events.publish("add",[this,t]))return!1;this.add(t),i._draw(!1,OrgChart.action.insert,{id:t.pid,insertedNodeId:t.id},function(){i.ripple(t.id),e&&e(),OrgChart.events.publish("added",[i,t.id])}),OrgChart.events.publish("adding",[i,t.id])},OrgChart.prototype.add=function(t){return null==t.id&&console.error("Call addNode without id"),this.config.nodes.push(t),this},OrgChart.prototype._get=function(t){for(var e=0;e<this.config.nodes.length;e++)if(this.config.nodes[e].id==t)return this.config.nodes[e];return null},OrgChart.prototype.get=function(t){for(var e=0;e<this.config.nodes.length;e++)if(this.config.nodes[e].id==t)return JSON.parse(JSON.stringify(this.config.nodes[e]));return null},void 0===OrgChart&&(OrgChart={}),OrgChart._ajax=function(t,e,r,i,a){null==i&&(i="arraybuffer");var n=new XMLHttpRequest;n.onload=function(t){4==n.readyState&&200===this.status&&(null==t.target?a(this.response):a(t.target.response))},n.onerror=function(t){a({error:t})},n.open(e,t),n.responseType=i,n.setRequestHeader("Content-Type","application/json"),null==r?n.send():n.send(r)},void 0===OrgChart&&(OrgChart={}),OrgChart.anim=function(c,g,p,f,u,C,m){var O,y=1,v=f/10+1;document.getElementsByTagName("g");return Array.isArray(c)||(c=[c]),Array.isArray(g)||(g=[g]),Array.isArray(p)||(p=[p]),O=setInterval(function(){for(var t=0;t<c.length;t++)for(var e in p[t]){var r=OrgChart._arrayContains(["top","left","right","bottom","width","height"],e.toLowerCase())?"px":"";switch(e.toLowerCase()){case"d":var i=u((10*y-10)/f)*(p[t][e][0]-g[t][e][0])+g[t][e][0],a=u((10*y-10)/f)*(p[t][e][1]-g[t][e][1])+g[t][e][1];c[t].setAttribute("d",c[t].getAttribute("d")+" L"+i+" "+a);break;case"r":var n=u((10*y-10)/f)*(p[t][e]-g[t][e])+g[t][e];c[t].setAttribute("r",n);break;case"x1":n=u((10*y-10)/f)*(p[t][e]-g[t][e])+g[t][e],c[t].setAttribute("x1",n);break;case"x2":n=u((10*y-10)/f)*(p[t][e]-g[t][e])+g[t][e],c[t].setAttribute("x2",n);break;case"y1":n=u((10*y-10)/f)*(p[t][e]-g[t][e])+g[t][e],c[t].setAttribute("y1",n);break;case"y2":n=u((10*y-10)/f)*(p[t][e]-g[t][e])+g[t][e],c[t].setAttribute("y2",n);break;case"rotate3d":if(p[t][e]){var o=g[t][e],l=p[t][e],s=[0,0,0,0];for(var h in o)s[h]=u((10*y-10)/f)*(l[h]-o[h])+o[h];c[t].style.transform="rotate3d("+s.toString()+"deg)"}break;case"transform":if(p[t][e]){for(var h in o=g[t][e],l=p[t][e],s=[0,0,0,0,0,0],o)s[h]=u((10*y-10)/f)*(l[h]-o[h])+o[h];c[t].hasAttribute("transform")?c[t].setAttribute("transform","matrix("+s.toString()+")"):c[t].style.transform="matrix("+s.toString()+")"}break;case"viewbox":if(p[t][e]){for(var h in o=g[t][e],l=p[t][e],s=[0,0,0,0],o)s[h]=u((10*y-10)/f)*(l[h]-o[h])+o[h];c[t].setAttribute("viewBox",s.toString())}break;case"margin":if(p[t][e]){for(var h in o=g[t][e],l=p[t][e],s=[0,0,0,0],o)s[h]=u((10*y-10)/f)*(l[h]-o[h])+o[h];var d="";for(h=0;h<s.length;h++)d+=parseInt(s[h])+"px ";c[t]&&c[t].style&&(c[t].style[e]=d)}break;case"scrolly":n=u((10*y-10)/f)*(p[t][e]-g[t][e])+g[t][e],c[t].scrollTo(0,n);break;default:n=u((10*y-10)/f)*(p[t][e]-g[t][e])+g[t][e],c[t]&&c[t].style&&(c[t].style[e]=n+r)}}m&&m(),1+v<(y+=1)&&(clearInterval(O),C&&C(c))},10)},OrgChart.anim.inPow=function(t){return t<0?0:1<t?1:Math.pow(t,2)},OrgChart.anim.outPow=function(t){if(t<0)return 0;if(1<t)return 1;return-1*(Math.pow(t-1,2)+-1)},OrgChart.anim.inOutPow=function(t){if(t<0)return 0;if(1<t)return 1;if((t*=2)<1)return OrgChart.anim.inPow(t,2)/2;return-.5*(Math.pow(t-2,2)+-2)},OrgChart.anim.inSin=function(t){return t<0?0:1<t?1:1-Math.cos(t*(Math.PI/2))},OrgChart.anim.outSin=function(t){return t<0?0:1<t?1:Math.sin(t*(Math.PI/2))},OrgChart.anim.inOutSin=function(t){return t<0?0:1<t?1:-.5*(Math.cos(Math.PI*t)-1)},OrgChart.anim.inExp=function(t){return t<0?0:1<t?1:Math.pow(2,10*(t-1))},OrgChart.anim.outExp=function(t){return t<0?0:1<t?1:1-Math.pow(2,-10*t)},OrgChart.anim.inOutExp=function(t){return t<0?0:1<t?1:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,10*(-2*t+1)))},OrgChart.anim.inCirc=function(t){return t<0?0:1<t?1:-(Math.sqrt(1-t*t)-1)},OrgChart.anim.outCirc=function(t){return t<0?0:1<t?1:Math.sqrt(1-(t-1)*(t-1))},OrgChart.anim.inOutCirc=function(t){return t<0?0:1<t?1:t<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(2*t-2)*(2*t-2))+1)},OrgChart.anim.rebound=function(t){return t<0?0:1<t?1:t<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-1.5/2.75)*(t-1.5/2.75)+.75):t<2.5/2.75?1-(7.5625*(t-2.25/2.75)*(t-2.25/2.75)+.9375):1-(7.5625*(t-2.625/2.75)*(t-2.625/2.75)+.984375)},OrgChart.anim.inBack=function(t){return t<0?0:1<t?1:t*t*(2.70158*t-1.70158)},OrgChart.anim.outBack=function(t){return t<0?0:1<t?1:(t-1)*(t-1)*(2.70158*(t-1)+1.70158)+1},OrgChart.anim.inOutBack=function(t){return t<0?0:1<t?1:t<.5?4*t*t*(7.1898*t-2.5949)*.5:.5*((2*t-2)*(2*t-2)*(3.5949*(2*t-2)+2.5949)+2)},OrgChart.anim.impulse=function(t){var e=2*t;return e*Math.exp(1-e)},OrgChart.anim.expPulse=function(t){return Math.exp(-2*Math.pow(t,2))},void 0===OrgChart&&(OrgChart={}),OrgChart.prototype._attachInitEventHandlers=function(t){this._addEvent(window,"resize",this._resizeHandler)},OrgChart.prototype._attachEventHandlers=function(t){t=this.getSvg();var e=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;this.config.enableTouch||e||/Mobi/i.test(navigator.userAgent)||/Android/i.test(navigator.userAgent)?(this._addEvent(t,"touchstart",this._globalMouseDownHandler),this._addEvent(t,"touchend",this._globalClickHandler)):(this._addEvent(t,"mousedown",this._globalMouseDownHandler),this._addEvent(t,"click",this._globalClickHandler),this._addEvent(t,"contextmenu",this._globalContextHandler),this._addEvent(t,"dblclick",this._globalDbClickHandler),this.config.mouseScrool!=OrgChart.action.zoom&&this.config.mouseScrool!=OrgChart.action.ctrlZoom||(this._addEvent(t,"DOMMouseScroll",this._mouseScrollHandler),this._addEvent(t,"mousewheel",this._mouseScrollHandler)));var r=this.getExportMenuButton();r&&this._addEvent(r,"click",this._exportMenuClickHandler)},OrgChart.prototype._addEvent=function(e,t,r,i){var a,n;(i||(i=""),e.getListenerList||(e.getListenerList={}),e.getListenerList[t+i])||(a=this,n=r,r=function(){if(n)return n.apply(a,[this,arguments[0]])},e.addEventListener?"mousewheel"==t?e.addEventListener(t,o,{passive:!1}):e.addEventListener(t,o,!1):e.attachEvent("on"+t,function(){var t=r.call(e,window.event);return!1===t&&(window.event.returnValue=!1,window.event.cancelBubble=!0),t}),e.getListenerList[t+i]=o);function o(t){var e=r.apply(this,arguments);return!1===e&&(t.stopPropagation(),t.preventDefault()),e}},OrgChart.prototype._removeEvent=function(t,e){if(t.getListenerList[e]){var r=t.getListenerList[e];t.removeEventListener(e,r,!1),delete t.getListenerList[e]}},void 0===OrgChart&&(OrgChart={}),OrgChart.VERSION="7.10.44",OrgChart.orientation={},OrgChart.orientation.top=0,OrgChart.orientation.bottom=1,OrgChart.orientation.right=2,OrgChart.orientation.left=3,OrgChart.orientation.top_left=4,OrgChart.orientation.bottom_left=5,OrgChart.orientation.right_top=6,OrgChart.orientation.left_top=7,OrgChart.CENTER=8,OrgChart.ORIENTATION=9,OrgChart.TEXT_THRESHOLD=250,OrgChart.IMAGES_THRESHOLD=70,OrgChart.LINKS_THRESHOLD=150,OrgChart.EXPCOLL_THRESHOLD=40,OrgChart.ANIM_THRESHOLD=50,OrgChart.attr={},OrgChart.attr.l="data-l",OrgChart.attr.id="data-id",OrgChart.attr.sl="data-sl",OrgChart.attr.lbl="data-lbl",OrgChart.attr.val="data-val",OrgChart.attr.tlbr="data-tlbr",OrgChart.attr.item="data-item",OrgChart.attr.layout="data-layout",OrgChart.attr.node_id="data-n-id",OrgChart.attr.link_id="data-l-id",OrgChart.attr.field_name="data-f-name",OrgChart.attr.c_link_to="data-c-l-to",OrgChart.attr.c_link_from="data-c-l-from",OrgChart.attr.s_link_to="data-s-l-to",OrgChart.attr.s_link_from="data-s-l-from",OrgChart.attr.search_item_id="data-search-item-id",OrgChart.attr.control_add="data-ctrl-add",OrgChart.attr.control_expcoll_id="data-ctrl-ec-id",OrgChart.attr.control_export_menu="data-ctrl-exp-menu",OrgChart.attr.control_node_menu_id="data-ctrl-n-menu-id",OrgChart.attr.control_node_circle_menu_id="data-ctrl-n-crcl-menu-id",OrgChart.attr.control_node_circle_menu_name="data-ctrl-n-crcl-menu-name",OrgChart.attr.control_node_circle_menu_wrraper_id="data-ctrl-n-crcl-menu-wrapper-id",OrgChart.attr.width="data-width",OrgChart.attr.text_overflow="data-text-overflow",OrgChart.attr={},OrgChart.attr.l="l",OrgChart.attr.id="data-id",OrgChart.attr.sl="sl",OrgChart.attr.lbl="lbl",OrgChart.attr.val="val",OrgChart.attr.tlbr="data-tlbr",OrgChart.attr.item="data-item",OrgChart.attr.layout="data-layout",OrgChart.attr.node_id="node-id",OrgChart.attr.link_id="link-id",OrgChart.attr.field_name="data-field-name",OrgChart.attr.c_link_to="c-link-to",OrgChart.attr.c_link_from="c-link-from",OrgChart.attr.s_link_to="s-link-to",OrgChart.attr.s_link_from="s-link-from",OrgChart.attr.search_item_id="data-search-item-id",OrgChart.attr.control_add="control-add",OrgChart.attr.control_expcoll_id="control-expcoll-id",OrgChart.attr.control_export_menu="control-export-menu",OrgChart.attr.control_node_menu_id="control-node-menu-id",OrgChart.attr.control_node_circle_menu_id="data-ctrl-n-crcl-menu-id",OrgChart.attr.control_node_circle_menu_name="data-ctrl-n-crcl-menu-name",OrgChart.attr.control_node_circle_menu_wrraper_id="data-ctrl-n-crcl-menu-wrapper-id",OrgChart.attr.width="width",OrgChart.attr.text_overflow="text-overflow",OrgChart.ID="id",OrgChart.PID="pid",OrgChart.STPID="stpid",OrgChart.TAGS="tags",OrgChart.NODES="nodes",OrgChart.ELASTIC="elastic",OrgChart.MAX_DEPTH=200,OrgChart.SCALE_FACTOR=1.44,OrgChart.LAZY_LOADING_FACTOR=500,OrgChart.action={},OrgChart.action.expand=0,OrgChart.action.collapse=1,OrgChart.action.maximize=101,OrgChart.action.minimize=102,OrgChart.action.expandCollapse=501,OrgChart.action.edit=1,OrgChart.action.zoom=2,OrgChart.action.ctrlZoom=22,OrgChart.action.scroll=41,OrgChart.action.xScroll=3,OrgChart.action.yScroll=4,OrgChart.action.none=5,OrgChart.action.init=6,OrgChart.action.update=7,OrgChart.action.pan=8,OrgChart.action.centerNode=9,OrgChart.action.resize=10,OrgChart.action.insert=11,OrgChart.action.insertfirst=12,OrgChart.action.details=13,OrgChart.action.exporting=14,OrgChart.none=400001,OrgChart.scroll={},OrgChart.scroll.visible=1,OrgChart.scroll.smooth=12,OrgChart.scroll.speed=120,OrgChart.scroll.safari={smooth:12,speed:250},OrgChart.match={},OrgChart.match.height=100001,OrgChart.match.width=100002,OrgChart.match.boundary=100003,OrgChart.COLLAPSE_PARENT_NEIGHBORS=1,OrgChart.COLLAPSE_SUB_CHILDRENS=2,OrgChart.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED=3,OrgChart.normal=0,OrgChart.mixed=1,OrgChart.tree=2,OrgChart.treeLeftOffset=3,OrgChart.treeRightOffset=4,OrgChart.nodeOpenTag="<g "+OrgChart.attr.node_id+'="{id}" style="opacity: {opacity}" transform="matrix(1,0,0,1,{x},{y})" class="{class}" '+OrgChart.attr.sl+'="{sl}" '+OrgChart.attr.l+"={level} {lcn}>",OrgChart.linkOpenTag="<g "+OrgChart.attr.link_id+'="[{id}][{child-id}]" class="{class}">',OrgChart.expcollOpenTag="<g "+OrgChart.attr.control_expcoll_id+'="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">',OrgChart.linkFieldsOpenTag='<g transform="matrix(1,0,0,1,{x},{y}) rotate({rotate})">',OrgChart.grCloseTag="</g>",OrgChart.IT_IS_LONELY_HERE='<g transform="translate(-100, 0)" style="cursor:pointer;" '+OrgChart.attr.control_add+'="control-add"><text fill="#039be5">{link}</text></g>',OrgChart.RES={},OrgChart.RES.IT_IS_LONELY_HERE_LINK="It's lonely here, add your first node",OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE=3,OrgChart.STRING_TAGS=!1,OrgChart.MAX_NODES_MESS="The trial has expired or 200 nodes limit was reached! <br /><a style='color: #039BE5;' target='_blank' href='https://balkangraph.com/OrgChartJS/Docs/Evaluation'>See more</a>",OrgChart.OFFLINE_MESS="The evaluation version requires internet connection! <br /><a style='color: #039BE5;' target='_blank' href='https://balkangraph.com/OrgChartJS/Docs/Evaluation'>See more</a>",OrgChart.SEARCH_PLACEHOLDER="Search",OrgChart.IMPORT_MESSAGE="Choose the columns (fields) in your data file that contain the required information.",OrgChart.FIXED_POSITION_ON_CLICK=!1,OrgChart.ADD_NEW_FIELD="Add new field",OrgChart.ASSISTANT="Assistant",OrgChart.A4w=595,OrgChart.A4h=842,OrgChart.A3w=842,OrgChart.A3h=1191,OrgChart.A2w=1191,OrgChart.A2h=1684,OrgChart.A1w=1684,OrgChart.A1h=2384,OrgChart.Letterw=612,OrgChart.Letterh=791,OrgChart.Legalw=612,OrgChart.Legalh=1009,OrgChart.LINK_ROUNDED_CORNERS=8,OrgChart.MOVE_STEP=5,OrgChart.MOVE_INTERVAL=25,OrgChart.MIXED_LAYOUT_ALL_NODES=!0,OrgChart.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN=!1,OrgChart.CLINK_CURVE=1,OrgChart.SEARCH_RESULT_LIMIT=10,"undefined"!=typeof module&&(module.exports=OrgChart),OrgChart.input=function(t,e,r,i,a,n){null==i&&(i=!1);var o=document.createElement("div"),l=document.createElement("div"),s=document.createElement("input"),h=document.createElement("hr"),d=document.createElement("button");if(d.innerHTML="Upload",d.style.position="absolute",d.style.right=0,o.style.margin="14px 14px 7px 14px",o.style.textAlign="left",o.style.position="relative",o.setAttribute(OrgChart.attr.field_name,t),h.style.border="1px solid #d7d7d7",h.style.backgroundColor="#d7d7d7",h.style.display="block",h.style.width="100%",l.style.color="#bcbcbc",s.style.border="none",s.style.outline="none",s.style.width="100%",s.setAttribute(OrgChart.attr.val,""),a&&(s.style.width="80%"),s.style.fontSize="16px",s.readOnly=i,null!=e&&null!=e&&(s.value=e),null!=r&&null!=r&&(s.placeholder=r),null!=t&&null!=t&&(l.innerHTML=t),l.setAttribute(OrgChart.attr.lbl,""),s.style.color="#7a7a7a",i||s.addEventListener("focus",function(){var t=this.parentNode.getElementsByTagName("hr")[0];t.style.border="1px solid #039BE5",OrgChart.anim(t,{width:10},{width:o.clientWidth},250,OrgChart.anim.inOutSin)}),d.addEventListener("click",function(){var e=this,t=document.createElement("INPUT");t.setAttribute("type","file"),t.style.display="none",t.onchange=function(){var t=this.files[0];OrgChart.events.publish("imageuploaded",[n,t,e.parentNode.querySelector("input")])},document.body.appendChild(t),t.click()}),s.addEventListener("blur",function(){this.parentNode.getElementsByTagName("hr")[0].style.border="1px solid #d7d7d7"}),o.appendChild(l),o.appendChild(s),a&&o.appendChild(d),o.appendChild(h),OrgChart.addValidation){var c={wrapper:o,label:l,input:s,hr:h};OrgChart.addValidation(t,e,c)}return o},OrgChart._intersects=function(t,e,r){var i=t.x-r.siblingSeparation/4,a=t.y,n=t.x+t.w+r.siblingSeparation/4,o=t.y;switch(r.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:i=t.x,a=t.y-r.siblingSeparation/4,n=t.x,o=t.y+t.h+r.siblingSeparation/4}var l,s,h,d=e.p,c=e.q,g=e.r,p=e.s;return 0!=(l=(n-i)*(p-c)-(g-d)*(o-a))&&(s=((a-o)*(g-i)+(n-i)*(p-a))/l,0<(h=((p-c)*(g-i)+(d-g)*(p-a))/l)&&h<1&&0<s&&s<1)},OrgChart._addPoint=function(t,e,r,i,a){switch(r.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:return OrgChart._addPointTop(t,e,r,i,a);case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:return OrgChart._addPointBottom(t,e,r,i,a);case OrgChart.orientation.left:case OrgChart.orientation.left_top:return OrgChart._addPointLeft(t,e,r,i,a);case OrgChart.orientation.right:case OrgChart.orientation.right_top:return OrgChart._addPointRight(t,e,r,i,a)}},OrgChart._addPointTop=function(t,e,r,i,a){var n,o,l;return"left"==a?n=t.leftNeighbor?t.x+(t.leftNeighbor.x+t.leftNeighbor.w-t.x)/2:t.x-r.siblingSeparation/2:"right"==a&&(n=t.rightNeighbor?t.x+t.w+(t.rightNeighbor.x-(t.x+t.w))/2:t.x+t.w+r.siblingSeparation/2),e.push([n,e[e.length-1][1]]),e.push([n,t.y-r.levelSeparation/3]),o=e[e.length-1][1],l=n,i.p=n,i.q=o,i.r=l,i},OrgChart._addPointBottom=function(t,e,r,i,a){var n,o,l;return"left"==a?n=t.leftNeighbor?t.x+(t.leftNeighbor.x+t.leftNeighbor.w-t.x)/2:t.x-r.siblingSeparation/2:"right"==a&&(n=t.rightNeighbor?t.x+t.w+(t.rightNeighbor.x-(t.x+t.w))/2:t.x+t.w+r.siblingSeparation/2),e.push([n,e[e.length-1][1]]),e.push([n,t.y+t.h+r.levelSeparation/3]),o=e[e.length-1][1],l=n,i.p=n,i.q=o,i.r=l,i},OrgChart._addPointLeft=function(t,e,r,i,a){var n,o=e[e.length-1][0];return"bottom"==a?n=t.rightNeighbor?t.y+t.h+(t.rightNeighbor.y-(t.y+t.h))/2:t.y+t.h+r.siblingSeparation/2:"top"==a&&(n=t.leftNeighbor?t.y+(t.leftNeighbor.y+t.leftNeighbor.h-t.y)/2:t.y-r.siblingSeparation/2),e.push([e[e.length-1][0],n]),e.push([t.x-r.levelSeparation/3,n]),o=e[e.length-1][0],s=n,i.p=o,i.q=n,i.s=s,i},OrgChart._addPointRight=function(t,e,r,i,a){var n,o=e[e.length-1][0];return"bottom"==a?n=t.rightNeighbor?t.y+t.h+(t.rightNeighbor.y-(t.y+t.h))/2:t.y+t.h+r.siblingSeparation/2:"top"==a&&(n=t.leftNeighbor?t.y+(t.leftNeighbor.y+t.leftNeighbor.h-t.y)/2:t.y-r.siblingSeparation/2),e.push([e[e.length-1][0],n]),e.push([t.x+t.w+r.levelSeparation/3,n]),o=e[e.length-1][0],s=n,i.p=o,i.q=n,i.s=s,i},OrgChart.editUI=function(){},OrgChart.editUI.prototype.init=function(t){this.obj=t,this.fields=null,this.node=null,this._event_id=OrgChart._guid()},OrgChart.editUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.editUI.prototype.show=function(t,e){if(this.hide(),!1===OrgChart.events.publish("show",[this,t]))return!1;this.node=this.obj.getNode(t),this.wrapperElement=document.getElementById("bgEditForm"),this.wrapperElement&&this.obj.element.removeChild(this.wrapperElement),this.wrapperElement=document.createElement("div"),this.wrapperElement.className="edit-wrapper";var r=document.createElement("div");r.className="edit-view";var i=document.createElement("div");i.className="details-view";var a="400px";window.matchMedia("(max-width: 1150px)").matches&&(a="100%"),Object.assign(this.wrapperElement.style,{width:a,position:"absolute",top:0,right:"-150px",opacity:0,"border-left":"1px solid #d7d7d7","text-align":"left",height:"100%","background-color":"#ffffff"}),e?this._createDetailsView(this.node,i):this._createEditView(this.node,r)},OrgChart.editUI.prototype._createDetailsView=function(t,e){var r=this,i=document.createElement("div");i.className="edit-photo";var a=document.createElement("div"),n=document.createElement("div");n.className="edit-fields";var o=document.createElement("div");o.className="edit-tags",a.innerHTML='<svg style="width: 34px; height: 34px;"><path style="fill:#ffffff;" d="M21.205,5.007c-0.429-0.444-1.143-0.444-1.587,0c-0.429,0.429-0.429,1.143,0,1.571l8.047,8.047H1.111 C0.492,14.626,0,15.118,0,15.737c0,0.619,0.492,1.127,1.111,1.127h26.554l-8.047,8.032c-0.429,0.444-0.429,1.159,0,1.587 c0.444,0.444,1.159,0.444,1.587,0l9.952-9.952c0.444-0.429,0.444-1.143,0-1.571L21.205,5.007z"></path></svg>',Object.assign(a.style,{cursor:"pointer",width:"34px",height:"34px",position:"absolute",top:"7px",right:"7px"}),Object.assign(n.style,{"overflow-x":"hidden","overflow-y":"auto"}),Object.assign(i.style,{"background-color":"#039BE5","min-height":"50px",textAlign:"center",position:"relative"}),Object.assign(o.style,{margin:"12px"}),this.wrapperElement.appendChild(e),e.appendChild(i),e.appendChild(n),n.appendChild(o),i.appendChild(a),OrgChart.htmlRipple(i);for(var l=this.fields,s=this.obj._get(t.id),h=0;h<l.length;h++){var d=s[l[h]];if(OrgChart._fieldIsImg(this.obj.config,l[h])){var c=document.createElement("img");c.src=d,c.style.width="100px",c.style.margin="10px",c.style.borderRadius="50px",this._addField(i,c,l[h],"details")}else if("tags"==l[h]){if(d)for(var g=0;g<d.length;g++){var p=document.createElement("span");Object.assign(p.style,{"background-color":"#F57C00",color:"#ffffff",margin:"2px",padding:"2px 12px","border-radius":"10px",display:"inline-block",border:"1px solid #FFCA28","user-select":"none"}),p.innerHTML=d[g],this._addField(o,p,d[g],"details-tag")}}else this._addField(n,OrgChart.input(l[h],d,null,!0,void 0,r),l[h],"details")}this.obj.element.appendChild(this.wrapperElement),i.addEventListener("click",function(){r.hide(!1)}),this.obj._hideBeforeAnimation(),OrgChart.anim(this.wrapperElement,{right:-150,opacity:0},{right:0,opacity:.9},300,OrgChart.anim.inOutSin,function(){r.obj._showAfterAnimation(),n.style.height=r.obj.element.offsetHeight-i.offsetHeight+"px"})},OrgChart.editUI.prototype._addField=function(t,e,r,i){var a={name:r,field:e,type:i};!1!==OrgChart.events.publish("field",[this,a])&&t.appendChild(a.field)},OrgChart.editUI.prototype._createEditView=function(t,e){var i=this,r=document.createElement("div");r.className="edit-photo";var a=document.createElement("div"),n=document.createElement("div"),o=document.createElement("div");o.className="edit-fields";var l=document.createElement("div");l.className="edit-assistant-button-content",a.innerHTML='<svg style="width: 34px; height: 34px;"><path style="fill:#ffffff;" d="M21.205,5.007c-0.429-0.444-1.143-0.444-1.587,0c-0.429,0.429-0.429,1.143,0,1.571l8.047,8.047H1.111 C0.492,14.626,0,15.118,0,15.737c0,0.619,0.492,1.127,1.111,1.127h26.554l-8.047,8.032c-0.429,0.444-0.429,1.159,0,1.587 c0.444,0.444,1.159,0.444,1.587,0l9.952-9.952c0.444-0.429,0.444-1.143,0-1.571L21.205,5.007z"></path></svg>',this.wrapperElement.id="bgEditForm",Object.assign(a.style,{cursor:"pointer",width:"34px",height:"34px",position:"absolute",top:"7px",right:"7px"}),Object.assign(o.style,{"overflow-x":"hidden","overflow-y":"auto"}),Object.assign(r.style,{"background-color":"#039BE5","min-height":"50px",textAlign:"center",position:"relative"}),Object.assign(n.style,{margin:"14px 14px 7px",color:"#4285F4",cursor:"pointer"}),Object.assign(l.style,{margin:"14px 14px 7px",color:"rgb(188, 188, 188)"}),n.innerHTML=OrgChart.ADD_NEW_FIELD;var s=OrgChart._arrayContains(this.node.tags,"assistant")?"checked":"";l.setAttribute(OrgChart.attr.field_name,"isAssistant"),l.innerHTML='<div style="margin-top: 10px;display:inline-block;">'+OrgChart.ASSISTANT+'</div><label class="bg-switch"><input val type="checkbox" '+s+'><span class="bg-slider round"></span></label>',this.wrapperElement.appendChild(e),e.appendChild(r),e.appendChild(o),r.appendChild(a),OrgChart.htmlRipple(r);for(var h=this.fields,d=this.obj._get(t.id),c=0;c<h.length;c++){var g=d[h[c]];if("tags"!=h[c])if(OrgChart._fieldIsImg(this.obj.config,h[c])){if(g){var p=document.createElement("img");p.src=g,p.style.width="100px",p.style.margin="10px",p.style.borderRadius="50px",r.appendChild(p)}this._addField(o,OrgChart.input(h[c],g,null,!1,!0,i),h[c],"edit")}else this._addField(o,OrgChart.input(h[c],g,null,!1,void 0,i),h[c],"edit")}0==t.childrenIds.length&&t.parent&&this._addField(o,l,"isAssistant","edit"),this._addField(o,n,OrgChart.ADD_NEW_FIELD,"edit"),this.obj.element.appendChild(this.wrapperElement),r.addEventListener("click",function(){i.hide(!0)}),n.addEventListener("click",function(){if("Save"==n.innerHTML)OrgChart.anim(n,{opacity:1},{opacity:0},200,OrgChart.anim.inSin,function(){n.innerHTML=OrgChart.ADD_NEW_FIELD,n.style.textAlign="left";var t=document.getElementById("bgNewField"),e=t.getElementsByTagName("input")[0].value;if(o.removeChild(t),e&&!OrgChart._arrayContains(i.fields,e)){var r=OrgChart.input(e);r.style.opacity=0,o.insertBefore(r,n),OrgChart.anim(r,{opacity:0},{opacity:1},200,OrgChart.anim.inSin,function(){r.getElementsByTagName("input")[0].focus()})}OrgChart.anim(n,{opacity:0},{opacity:1},200,OrgChart.anim.inSin)});else{OrgChart.anim(n,{opacity:1},{opacity:0},200,OrgChart.anim.inSin,function(){n.innerHTML="Save",n.style.textAlign="right",OrgChart.anim(n,{opacity:0},{opacity:1},200,OrgChart.anim.inSin)});var t=OrgChart.input(null,null,"Field name");t.style.opacity=0,t.id="bgNewField",o.appendChild(t),OrgChart.anim(t,{opacity:0},{opacity:1},200,OrgChart.anim.inSin,function(){t.getElementsByTagName("input")[0].focus()})}}),this.obj._hideBeforeAnimation(),OrgChart.anim(this.wrapperElement,{right:-150,opacity:0},{right:0,opacity:.9},300,OrgChart.anim.inOutSin,function(){i.obj._showAfterAnimation(),o.style.height=i.obj.element.offsetHeight-r.offsetHeight+"px",1<i.wrapperElement.getElementsByTagName("input").length&&i.wrapperElement.getElementsByTagName("input")[0].focus()})},OrgChart.editUI.prototype.hide=function(t){if(this.wrapperElement){if(!1===OrgChart.events.publish("hide",[this]))return!1;var e=this.obj.get(this.node.id);if(t){for(var r=this.wrapperElement.querySelectorAll("["+OrgChart.attr.field_name+"]"),i=0;i<r.length;i++){var a=r[i].getAttribute(OrgChart.attr.field_name);if(a){var n=r[i].querySelector("["+OrgChart.attr.val+"]").value;if(a===OrgChart.TAGS)e.tags=n.split(",");else if("isAssistant"===a){var o=r[i].querySelector("["+OrgChart.attr.val+"]").checked;o&&e.tags?OrgChart._arrayContains(this.node.tags,"assistant")||(OrgChart.STRING_TAGS?e.tags+=",assistant":e.tags.push("assistant")):o&&!e.tags?OrgChart.STRING_TAGS?e.tags="assistant":e.tags=["assistant"]:!o&&e.tags&&-1!=this.node.tags.indexOf("assistant")&&e.tags.splice(e.tags.indexOf("assistant"),1)}else null!=e[a]?e[a]=n:""!=n&&(e[a]=n)}}var l=this;this.obj._hideBeforeAnimation(),OrgChart.anim(l.wrapperElement,{right:0,opacity:1},{right:-150,opacity:0},300,OrgChart.anim.inOutSin,function(){l.obj._showAfterAnimation(),l.obj.updateNode(e,null,!0),l.obj.element.removeChild(l.wrapperElement),l.wrapperElement=null})}else this.obj.element.removeChild(this.wrapperElement),this.wrapperElement=null}},OrgChart.prototype.getSvg=function(){var t=this.element.getElementsByTagName("svg");return t&&t.length?t[0]:null},OrgChart.prototype.getPointerElement=function(){return this.element.querySelector("g[data-pointer]")},OrgChart.prototype.getNodeElement=function(t){return this.element.querySelector("g["+OrgChart.attr.node_id+"='"+t+"']")},OrgChart.prototype.getExportMenuButton=function(){return this.element.querySelector("["+OrgChart.attr.control_export_menu+"]")},OrgChart.menuUI=function(){},OrgChart.menuUI.prototype.init=function(t,e){this.obj=t,this.wrapper=null,this.menu=e,this._event_id=OrgChart._guid()},OrgChart.menuUI.prototype.showStickIn=function(t,e,r,i){this._show(t,null,e,r,i)},OrgChart.menuUI.prototype.show=function(t,e,r,i,a){this._show(t,e,r,i,a)},OrgChart.menuUI.prototype._show=function(t,e,n,o,l){var s=this;this.hide();var r="";l||(l=this.menu);var i={firstNodeId:n,secondNodeId:o,menu:l};if(!1===OrgChart.events.publish("show",[this,i]))return!1;for(var a in l=i.menu){var h=l[a].icon,d=l[a].text;void 0===h&&(h=OrgChart.icon[a](24,24,"#7A7A7A")),"function"==typeof d&&(d=d()),"function"==typeof h&&(h=h()),r+="<div "+OrgChart.attr.item+'="'+a+'" style="border-bottom: 1px solid #D7D7D7; padding: 7px 10px;color: #7A7A7A;">'+h+"<span> "+d+"</span></div>"}if(""!=r){if(this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{opacity:0,"background-color":"#FFFEFF","box-shadow":"#DCDCDC 0px 1px 2px 0px",display:"inline-block",border:"1px solid #D7D7D7;border-radius:5px","z-index":1e3,position:"absolute","text-align":"left","user-select":"none"}),this.wrapper.className="chart-menu",this.wrapper.style.left="-99999px",this.wrapper.style.top="-99999px",this.wrapper.innerHTML=r,this.obj.element.appendChild(this.wrapper),null==e){var c=OrgChart._menuPosition(t,this.wrapper,this.obj.getSvg());t=c.x,e=c.y}var g=t+45;this.wrapper.style.left=g+"px",this.wrapper.style.top=e+"px",this.wrapper.style.left=g-this.wrapper.offsetWidth+"px";var p=t-this.wrapper.offsetWidth;OrgChart.anim(this.wrapper,{opacity:0,left:g-this.wrapper.offsetWidth},{opacity:1,left:p},300,OrgChart.anim.inOutPow);for(var f=this.wrapper.getElementsByTagName("div"),u=0;u<f.length;u++){(a=f[u]).addEventListener("mouseover",function(){this.style.backgroundColor="#F0F0F0"}),a.addEventListener("mouseleave",function(){this.style.backgroundColor="#FFFFFF"}),a.addEventListener("click",function(t){var e,r=this.getAttribute(OrgChart.attr.item);if(void 0===l[r].onClick)if("add"===r){var i={id:s.obj.generateId(),pid:n};s.obj.addNode(i,null,!0)}else if("edit"===r){var a=s.obj.getNode(n);s.obj.editUI.show(a.id)}else if("details"===r){a=s.obj.getNode(n);s.obj.editUI.show(a.id,!0)}else"remove"===r?s.obj.removeNode(n,null,!0):"svg"===r?s.obj.exportSVG({filename:"OrgChart.svg",expandChildren:!1,nodeId:n}):"pdf"===r?s.obj.exportPDF({filename:"OrgChart.pdf",expandChildren:!1,nodeId:n}):"png"===r?s.obj.exportPNG({filename:"OrgChart.png",expandChildren:!1,nodeId:n}):"csv"===r?s.obj.exportCSV():"xml"===r&&s.obj.exportXML();else e=l[r].onClick.call(s.obj,n,o);0!=e&&s.hide()})}}},OrgChart.menuUI.prototype.hide=function(){null!=this.wrapper&&(this.obj.element.removeChild(this.wrapper),this.wrapper=null)},OrgChart.menuUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.circleMenuUI=function(){},OrgChart.circleMenuUI.prototype.init=function(t,e){this.obj=t,this.menu=e,this._buttonsInterval=[],this._linesInterval=[],this._event_id=OrgChart._guid()},OrgChart.circleMenuUI.prototype.show=function(t,e){this._show(t,e)},OrgChart.circleMenuUI.prototype._show=function(t,e){var i=this,r=this.obj.getNode(t),a=OrgChart.t(r.templateName,r.min,this.obj.getScale());if(!OrgChart.isNullOrEmpty(a.nodeCircleMenuButton)){var n=this.obj.getSvg(),o=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_id+'="'+t+'"]'),l=this.obj.getNodeElement(t),s=OrgChart._getTransform(o),h=OrgChart._getTransform(l),d=s[4]+h[4],c=s[5]+h[5],g=o.querySelectorAll("line"),p=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_wrraper_id+"]");if(OrgChart.isNullOrEmpty(p)||p.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id)!=t){this.hide(),e||(e=this.menu);var f={nodeId:t,menu:e};if(!1===OrgChart.events.publish("show",[this,f]))return!1;this.menu=f.menu;for(var u=0,C=Object.keys(this.menu).length,m=2*a.nodeCircleMenuButton.radius+4,O=2*Math.PI*m,y=O/C-(2*a.nodeCircleMenuButton.radius+2);y<0;)m+=8,y=(O=2*Math.PI*m)/C-(2*a.nodeCircleMenuButton.radius+2);for(var v in(p=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id,t),p.setAttribute("transform","matrix(1,0,0,1,"+d+","+c+")"),n.appendChild(p),this.menu){var x=this.menu[v].icon,b=this.menu[v].color,_=this.menu[v].text;"function"==typeof x&&(x=x()),"function"==typeof b&&(b=b()),"function"==typeof _&&(_=_());var w=document.createElementNS("http://www.w3.org/2000/svg","g");w.setAttribute("transform","matrix(1,0,0,1,0,0)"),w.setAttribute(OrgChart.attr.control_node_circle_menu_name,v),w.style.cursor="pointer";var k=document.createElementNS("http://www.w3.org/2000/svg","title");OrgChart.isNullOrEmpty(_)||(k.innerHTML=_);var S=document.createElementNS("http://www.w3.org/2000/svg","circle");S.setAttribute("cx",0),S.setAttribute("cy",0),S.setAttribute("r",a.nodeCircleMenuButton.radius),S.setAttribute("fill",b),S.setAttribute("stroke-width","1"),S.setAttribute("stroke",a.nodeCircleMenuButton.stroke),w.appendChild(S),w.appendChild(k),w.innerHTML+=x,p.appendChild(w);var I=w.getElementsByTagName("svg")[0];if(I.setAttribute("pointer-events","none"),I){var A=parseInt(I.getAttribute("width")),E=parseInt(I.getAttribute("height"));I.setAttribute("x",-A/2),I.setAttribute("y",-E/2)}var M=u*Math.PI/(C/2);u++;var L=Math.cos(M)*m,N=Math.sin(M)*m;this._buttonsInterval.push(OrgChart.anim(w,{transform:[1,0,0,1,0,0]},{transform:[1,0,0,1,L,N]},250,OrgChart.anim.outBack,function(t){var e=t[0].getAttribute(OrgChart.attr.control_node_circle_menu_name),r=t[0].parentNode.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id);t[0].addEventListener("mouseenter",function(t){OrgChart.events.publish("mouseenter",[i,{from:r,menuItem:i.menu[e],menuItemName:e,event:t}])}),t[0].addEventListener("mouseout",function(t){OrgChart.events.publish("mouseout",[i,{from:r,menuItem:i.menu[e],menuItemName:e,event:t}])})}))}this._linesInterval.push(OrgChart.anim(g[0],{x1:-a.nodeCircleMenuButton.radius/2,y1:-6,x2:a.nodeCircleMenuButton.radius/2,y2:-6},{x1:-7,y1:-7,x2:7,y2:7},500,OrgChart.anim.inOutSin)),this._linesInterval.push(OrgChart.anim(g[1],{x1:-a.nodeCircleMenuButton.radius/2,y1:0,x2:a.nodeCircleMenuButton.radius/2,y2:0},{x1:0,y1:0,x2:0,y2:0},500,OrgChart.anim.inOutSin)),this._linesInterval.push(OrgChart.anim(g[2],{x1:-a.nodeCircleMenuButton.radius/2,y1:6,x2:a.nodeCircleMenuButton.radius/2,y2:6},{x1:-7,y1:7,x2:7,y2:-7},500,OrgChart.anim.inOutSin))}else this.hide()}},OrgChart.circleMenuUI.prototype.hide=function(){for(var t=this._buttonsInterval.length-1;0<=t;t--)clearInterval(this._buttonsInterval[t]),this._buttonsInterval.splice(t,1);this._buttonsInterval=[];for(t=this._linesInterval.length-1;0<=t;t--)clearInterval(this._linesInterval[t]),this._linesInterval.splice(t,1);this._linesInterval=[];var e=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_wrraper_id+"]");if(null!=e){var r=e.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id),i=this.obj.getNode(r),a=OrgChart.t(i.templateName,i.min,this.obj.getScale()),n=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_id+'="'+r+'"]').querySelectorAll("line");n[0].setAttribute("x1",-a.nodeCircleMenuButton.radius/2),n[0].setAttribute("x2",a.nodeCircleMenuButton.radius/2),n[0].setAttribute("y1",-6),n[0].setAttribute("y2",-6),n[1].setAttribute("x1",-a.nodeCircleMenuButton.radius/2),n[1].setAttribute("x2",a.nodeCircleMenuButton.radius/2),n[1].setAttribute("y1",0),n[1].setAttribute("y2",0),n[2].setAttribute("x1",-a.nodeCircleMenuButton.radius/2),n[2].setAttribute("x2",a.nodeCircleMenuButton.radius/2),n[2].setAttribute("y1",6),n[2].setAttribute("y2",6),e.parentElement.removeChild(e),e=null}},OrgChart.circleMenuUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},void 0===OrgChart&&(OrgChart={}),OrgChart.idb={version:1,dbName:"balkangraph",tableName:"orgchart-js",keyPath:"id"},OrgChart.idb.db=null,OrgChart.idb._open=function(e){if(OrgChart._browser().msie)e&&e(!1);else if((0<navigator.userAgent.toLowerCase().indexOf("safari")||0<navigator.userAgent.toLowerCase().indexOf("firefox"))&&window.location!==window.parent.location)e&&e(!1);else{if(!window.indexedDB)return console.error("Your browser doesn't support a stable version of IndexedDB."),void(e&&e(!1));if(null==OrgChart.idb.db){var t=indexedDB.open(OrgChart.idb.dbName,OrgChart.idb.version);t.onerror=function(t){console.error("Cannot open database!"),e&&e(!1)},t.onsuccess=function(t){OrgChart.idb.db=t.target.result,e&&e(!0)},t.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(OrgChart.idb.tableName)&&e.deleteObjectStore(OrgChart.idb.tableName);e.createObjectStore(OrgChart.idb.tableName,{keyPath:OrgChart.idb.keyPath})}}else e&&e(!0)}},OrgChart.idb.read=function(r,i){OrgChart.idb._open(function(t){if(t){var e=OrgChart.idb.db.transaction([OrgChart.idb.tableName]).objectStore(OrgChart.idb.tableName).get(r);e.onerror=function(t){console.error("Unable to retrieve data from database!"),i&&i(!1)},e.onsuccess=function(t){e.result?i&&i(!0,e.result):i&&i(null)}}else i&&i(!1)})},OrgChart.idb.write=function(r,i){OrgChart.idb.read(r.id,function(t){if(null==t){var e=OrgChart.idb.db.transaction([OrgChart.idb.tableName],"readwrite").objectStore(OrgChart.idb.tableName).add(r);e.onerror=function(t){console.error("Unable to add data to database!"),i&&i(!1)},e.onsuccess=function(t){i&&i(!0)}}else i&&i(t)})},OrgChart.idb.put=function(r,i){OrgChart.idb._open(function(t){if(t){var e=OrgChart.idb.db.transaction([OrgChart.idb.tableName],"readwrite").objectStore(OrgChart.idb.tableName).put(r);e.onerror=function(t){console.error("Unable to put data to database!"),i&&i(!1)},e.onsuccess=function(t){i&&i(!0)}}else i&&i(!1)})},OrgChart.idb.delete=function(r,i){OrgChart.idb._open(function(t){if(t){var e=OrgChart.idb.db.transaction([OrgChart.idb.tableName],"readwrite").objectStore(OrgChart.idb.tableName).delete(r);e.onerror=function(t){console.error("Unable to retrieve data from database!"),i&&i(!1)},e.onsuccess=function(t){e.error?i&&i(!1):i&&i(!0)}}else i&&i(!1)})},OrgChart.toolbarUI=function(){},OrgChart.toolbarUI.expandAllIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><marker id="arrow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="4" markerHeight="4" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#757575" /></marker><line x1="11" y1="11" x2="6" y2="6" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><line x1="21" y1="11" x2="26" y2="6" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><line x1="21" y1="21" x2="26" y2="26" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><line x1="11" y1="21" x2="6" y2="26" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><rect x="12" y="12" width="8" height="8" fill="#757575"></rect></svg>',OrgChart.toolbarUI.fitIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M4,11 L4,4 L11,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,11 L28,4 L21,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,21 L28,28 L21,28"></path><path stroke-width="3" fill="none" stroke="#757575" d="M4,21 L4,28 L11,28"></path><circle cx="16" cy="16" r="5" fill="#757575"></circle></svg>',OrgChart.toolbarUI.openFullScreenIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M4,11 L4,4 L11,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,11 L28,4 L21,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,21 L28,28 L21,28"></path><path stroke-width="3" fill="none" stroke="#757575" d="M4,21 L4,28 L11,28"></path><line x1="5" y1="5" x2="27" y2="27" stroke-width="3" stroke="#757575"></line><line x1="5" y1="27" x2="27" y2="5" stroke-width="3" stroke="#757575"></line></svg>',OrgChart.toolbarUI.closeFullScreenIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M4,11 L4,4 L11,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,11 L28,4 L21,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,21 L28,28 L21,28"></path><path stroke-width="3" fill="none" stroke="#757575" d="M4,21 L4,28 L11,28"></path><rect x="11" y="11" width="10" height="10" stroke-width="3" fill="none" stroke="#757575" ></rect></svg>',OrgChart.toolbarUI.zoomInIcon='<svg style="box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border-left: 1px solid #cacaca; border-right: 1px solid #cacaca; border-top: 1px solid #cacaca; background-color: #f9f9f9;display: block; cursor: pointer;" width="32px" height="32px" ><g><rect fill="#f9f9f9" x="0" y="0" width="32" height="32" ></rect><line x1="8" y1="16" x2="24" y2="16" stroke-width="3" stroke="#757575"></line><line x1="16" y1="8" x2="16" y2="24" stroke-width="3" stroke="#757575"></line></g><line x1="4" y1="32" x2="28" y2="32" stroke-width="1" stroke="#cacaca"></line></svg>',OrgChart.toolbarUI.zoomOutIcon='<svg style="box-shadow: 0px 1px 4px rgba(0,0,0,0.3); margin-bottom:7px; border-left: 1px solid #cacaca; border-right: 1px solid #cacaca; border-bottom: 1px solid #cacaca; background-color: #f9f9f9;display: block; cursor: pointer;" width="32px" height="32px" ><g><rect fill="#f9f9f9" x="0" y="0" width="32" height="32" ></rect><line x1="8" y1="16" x2="24" y2="16" stroke-width="3" stroke="#757575"></line></g></svg>',OrgChart.toolbarUI.layoutIcon="<svg "+OrgChart.attr.tlbr+'="layout" style="box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M8,24 L16,14 L24,24"></path><path stroke-width="3" fill="none" stroke="#757575" d="M8,16 L16,8 L24,16"></path></svg>',OrgChart.toolbarUI.prototype.init=function(t,e){if(e){this.obj=t,this.toolbar=e,this._visible=!1,this.div=document.createElement("div"),this.div.classList.add("bg-toolbar-container"),Object.assign(this.div.style,{position:"absolute",padding:"3px",right:this.obj.config.padding+"px",bottom:this.obj.config.padding+"px"}),e.expandAll&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="expand">'+OrgChart.toolbarUI.expandAllIcon+"</div>"),e.fit&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="fit">'+OrgChart.toolbarUI.fitIcon+"</div>"),e.zoom&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="plus">'+OrgChart.toolbarUI.zoomInIcon+"</div>",this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="minus">'+OrgChart.toolbarUI.zoomOutIcon+"</div>"),e.layout&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="layout">'+OrgChart.toolbarUI.layoutIcon+"</div>",this.layouts=document.createElement("div"),this.layouts.innerHTML="<svg "+OrgChart.attr.layout+'="normal" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="41" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="35" stroke-width="1"></line><line stroke="#000000" x1="32" x2="88" y1="35" y2="35" stroke-width="1"></line><line stroke="#000000" x1="32" x2="32" y1="35" y2="41" stroke-width="1"></line><line stroke="#000000" x1="88" x2="88" y1="35" y2="41" stroke-width="1"></line></svg><svg '+OrgChart.attr.layout+'="treeRightOffset" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="40" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="40" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="35" stroke-width="1"></line><line stroke="#000000" x1="60" x2="35" y1="35" y2="35" stroke-width="1"></line><line stroke="#000000" x1="35" x2="35" y1="35" y2="86" stroke-width="1"></line><line stroke="#000000" x1="35" x2="40" y1="86" y2="86" stroke-width="1"></line><line stroke="#000000" x1="35" x2="40" y1="54" y2="54" stroke-width="1"></line></svg><svg '+OrgChart.attr.layout+'="treeLeftOffset" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="30" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="30" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="35" stroke-width="1"></line><line stroke="#000000" x1="60" x2="85" y1="35" y2="35" stroke-width="1"></line><line stroke="#000000" x1="85" x2="85" y1="35" y2="86" stroke-width="1"></line><line stroke="#000000" x1="80" x2="85" y1="86" y2="86" stroke-width="1"></line><line stroke="#000000" x1="80" x2="85" y1="54" y2="54" stroke-width="1"></line></svg><svg '+OrgChart.attr.layout+'="mixed" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="35" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="35" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="41" stroke-width="1"></line><line stroke="#000000" x1="60" x2="60" y1="68" y2="73" stroke-width="1"></line></svg><svg '+OrgChart.attr.layout+'="tree" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="73" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="86" stroke-width="1"></line><line stroke="#000000" x1="57" x2="63" y1="54" y2="54" stroke-width="1"></line><line stroke="#000000" x1="57" x2="63" y1="86" y2="86" stroke-width="1"></line></svg>',this.obj.element.appendChild(this.layouts),Object.assign(this.layouts.style,{position:"absolute",width:"100%",left:"0",bottom:"-145px","box-shadow":"0px 1px 4px rgba(0,0,0,0.3)","background-color":"#f9f9f9",height:"123px","padding-top":"20px","border-top":"1px solid #cacaca"})),e.fullScreen&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="fullScreen">'+OrgChart.toolbarUI.openFullScreenIcon+"</div>"),this.obj.element.appendChild(this.div),this.layoutBtn=this.div.querySelector("["+OrgChart.attr.tlbr+'="layout"]');var r=this.div.querySelector("["+OrgChart.attr.tlbr+'="plus"]'),i=this.div.querySelector("["+OrgChart.attr.tlbr+'="minus"]'),a=this.div.querySelector("["+OrgChart.attr.tlbr+'="fit"]'),n=this.div.querySelector("["+OrgChart.attr.tlbr+'="fullScreen"]'),o=this.div.querySelector("["+OrgChart.attr.tlbr+'="expand"]'),l=this;r&&r.addEventListener("click",function(){l.obj.zoom(!0,null,!0)}),i&&i.addEventListener("click",function(){l.obj.zoom(!1,null,!0)}),a&&a.addEventListener("click",function(){l.obj.fit()}),n&&n.addEventListener("click",function(){l.obj.toggleFullScreen()}),o&&o.addEventListener("click",function(){l.obj.expand(null,"all")}),this.layoutBtn&&this.layoutBtn.addEventListener("click",function(){l._visible?l.hideLayout():l.showLayout()}),this.layouts&&this.layouts.addEventListener("click",function(t){for(var e=t.target;e;){if(e.hasAttribute&&e.hasAttribute(OrgChart.attr.layout)){e=e.getAttribute(OrgChart.attr.layout),l.obj.setLayout(OrgChart[e]);break}e=e.parentNode}})}},OrgChart.toolbarUI.prototype.showLayout=function(){this._visible=!0,this.layoutBtn.style.transform="rotate(180deg) translateX(0px) translateY(0px)",OrgChart.anim(this.div,{bottom:this.obj.config.padding},{bottom:this.obj.config.padding+145},this.obj.config.anim.duration,this.obj.config.anim.func),OrgChart.anim(this.layouts,{bottom:-145},{bottom:0},this.obj.config.anim.duration,this.obj.config.anim.func)},OrgChart.toolbarUI.prototype.hideLayout=function(){this._visible=!1,this.layoutBtn.style.transform="rotate(0deg) translateX(0px) translateY(0px)",OrgChart.anim(this.div,{bottom:this.obj.config.padding+145},{bottom:this.obj.config.padding},this.obj.config.anim.duration,this.obj.config.anim.func),OrgChart.anim(this.layouts,{bottom:0},{bottom:-145},this.obj.config.anim.duration,this.obj.config.anim.func)},OrgChart.notifierUI=function(){},OrgChart.notifierUI.prototype.init=function(t){this.obj=t},OrgChart.notifierUI.prototype.show=function(t,e){if(null!=t){1==t&&(t=OrgChart.MAX_NODES_MESS,e="#FFCA28"),2==t&&(t=OrgChart.OFFLINE_MESS,e="#FFCA28");var r=document.createElement("div");r.innerHTML=t,Object.assign(r.style,{position:"absolute","background-color":e,color:"#ffffff",padding:"15px","border-radius":"40px",opacity:0,overflow:"hidden","white-space":"nowrap","text-align":"center"}),this.obj.element.appendChild(r);var i=this.obj.width()/2-r.offsetWidth/2,a=this.obj.height()/2-r.offsetHeight/2;r.style.left=i+"px",r.style.top=a+"px";var n=r.offsetWidth;r.style.width="20px",OrgChart.anim(r,{opacity:0,width:10},{opacity:1,width:n},this.obj.config.anim.duration,this.obj.config.anim.func)}},OrgChart.icon={},OrgChart.icon.png=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M146.747,276.708c0-13.998-9.711-22.352-26.887-22.352c-6.99,0-11.726,0.675-14.204,1.355v44.927 c2.932,0.676,6.539,0.896,11.52,0.896C135.449,301.546,146.747,292.28,146.747,276.708z"/><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M234.344,335.86v45.831h-31.601V229.524h40.184 l31.611,55.759c9.025,16.031,18.064,34.983,24.825,52.154h0.675c-2.257-20.103-2.933-40.643-2.933-63.44v-44.473h31.614v152.167 h-36.117l-32.516-58.703c-9.049-16.253-18.971-35.892-26.438-53.727l-0.665,0.222C233.906,289.58,234.344,311.027,234.344,335.86z M71.556,381.691V231.56c10.613-1.804,25.516-3.159,46.506-3.159c21.215,0,36.353,4.061,46.509,12.192 c9.698,7.673,16.255,20.313,16.255,35.219c0,14.897-4.959,27.549-13.999,36.123c-11.738,11.063-29.123,16.031-49.441,16.031 c-4.522,0-8.593-0.231-11.736-0.675v54.411H71.556V381.691z M453.601,523.353H97.2V419.302h356.4V523.353z M485.652,374.688 c-10.61,3.607-30.713,8.585-50.805,8.585c-27.759,0-47.872-7.003-61.857-20.545c-13.995-13.1-21.684-32.97-21.452-55.318 c0.222-50.569,37.03-79.463,86.917-79.463c19.644,0,34.783,3.829,42.219,7.446l-7.214,27.543c-8.369-3.617-18.752-6.55-35.458-6.55 c-28.656,0-50.341,16.256-50.341,49.22c0,31.382,19.649,49.892,47.872,49.892c7.895,0,14.218-0.901,16.934-2.257v-31.835h-23.493 v-26.869h56.679V374.688z"/></svg>'},OrgChart.icon.pdf=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M160.381,282.225c0-14.832-10.299-23.684-28.474-23.684c-7.414,0-12.437,0.715-15.071,1.432V307.6 c3.114,0.707,6.942,0.949,12.192,0.949C148.419,308.549,160.381,298.74,160.381,282.225z"/><path fill="'+r+'" d="M272.875,259.019c-8.145,0-13.397,0.717-16.519,1.435v105.523c3.116,0.729,8.142,0.729,12.69,0.729 c33.017,0.231,54.554-17.946,54.554-56.474C323.842,276.719,304.215,259.019,272.875,259.019z"/><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M362.359,309.023c0,30.876-11.243,52.165-26.82,65.333 c-16.971,14.117-42.82,20.814-74.396,20.814c-18.9,0-32.297-1.197-41.401-2.389V234.365c13.399-2.149,30.878-3.346,49.304-3.346 c30.612,0,50.478,5.508,66.039,17.226C351.828,260.69,362.359,280.547,362.359,309.023z M80.7,393.499V234.365 c11.241-1.904,27.042-3.346,49.296-3.346c22.491,0,38.527,4.308,49.291,12.928c10.292,8.131,17.215,21.534,17.215,37.328 c0,15.799-5.25,29.198-14.829,38.285c-12.442,11.728-30.865,16.996-52.407,16.996c-4.778,0-9.1-0.243-12.435-0.723v57.67H80.7 V393.499z M453.601,523.353H97.2V419.302h356.4V523.353z M484.898,262.127h-61.989v36.851h57.913v29.674h-57.913v64.848h-36.593 V232.216h98.582V262.127z"/></svg>'},OrgChart.icon.svg=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M338.871,225.672L284.545,386.96h-42.591 l-51.69-161.288h39.967l19.617,68.196c5.508,19.143,10.531,37.567,14.36,57.67h0.717c4.061-19.385,9.089-38.527,14.592-56.953 l20.585-68.918h38.77V225.672z M68.458,379.54l7.415-30.153c9.811,5.021,24.888,10.051,40.439,10.051 c16.751,0,25.607-6.935,25.607-17.465c0-10.052-7.662-15.795-27.05-22.734c-26.8-9.328-44.263-24.168-44.263-47.611 c0-27.524,22.971-48.579,61.014-48.579c18.188,0,31.591,3.823,41.159,8.131l-8.126,29.437c-6.465-3.116-17.945-7.657-33.745-7.657 c-15.791,0-23.454,7.183-23.454,15.552c0,10.296,9.089,14.842,29.917,22.731c28.468,10.536,41.871,25.365,41.871,48.094 c0,27.042-20.812,50.013-65.09,50.013C95.731,389.349,77.538,384.571,68.458,379.54z M453.601,523.353H97.2V419.302h356.4V523.353z M488.911,379.54c-11.243,3.823-32.537,9.103-53.831,9.103c-29.437,0-50.73-7.426-65.57-21.779 c-14.839-13.875-22.971-34.942-22.738-58.625c0.253-53.604,39.255-84.235,92.137-84.235c20.81,0,36.852,4.073,44.74,7.896 l-7.657,29.202c-8.859-3.829-19.849-6.95-37.567-6.95c-30.396,0-53.357,17.233-53.357,52.173c0,33.265,20.81,52.882,50.73,52.882 c8.375,0,15.072-0.96,17.94-2.395v-33.745h-24.875v-28.471h60.049V379.54L488.911,379.54z" /></svg>'},OrgChart.icon.csv=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 548.29 548.291" ><path fill="'+r+'" d="M486.2,196.121h-13.164V132.59c0-0.399-0.064-0.795-0.116-1.2c-0.021-2.52-0.824-5-2.551-6.96L364.656,3.677 c-0.031-0.034-0.064-0.044-0.085-0.075c-0.629-0.707-1.364-1.292-2.141-1.796c-0.231-0.157-0.462-0.286-0.704-0.419 c-0.672-0.365-1.386-0.672-2.121-0.893c-0.199-0.052-0.377-0.134-0.576-0.188C358.229,0.118,357.4,0,356.562,0H96.757 C84.893,0,75.256,9.649,75.256,21.502v174.613H62.093c-16.972,0-30.733,13.756-30.733,30.73v159.81 c0,16.966,13.761,30.736,30.733,30.736h13.163V526.79c0,11.854,9.637,21.501,21.501,21.501h354.777 c11.853,0,21.502-9.647,21.502-21.501V417.392H486.2c16.966,0,30.729-13.764,30.729-30.731v-159.81 C516.93,209.872,503.166,196.121,486.2,196.121z M96.757,21.502h249.053v110.006c0,5.94,4.818,10.751,10.751,10.751h94.973v53.861 H96.757V21.502z M258.618,313.18c-26.68-9.291-44.063-24.053-44.063-47.389c0-27.404,22.861-48.368,60.733-48.368 c18.107,0,31.447,3.811,40.968,8.107l-8.09,29.3c-6.43-3.107-17.862-7.632-33.59-7.632c-15.717,0-23.339,7.149-23.339,15.485 c0,10.247,9.047,14.769,29.78,22.632c28.341,10.479,41.681,25.239,41.681,47.874c0,26.909-20.721,49.786-64.792,49.786 c-18.338,0-36.449-4.776-45.497-9.77l7.38-30.016c9.772,5.014,24.775,10.006,40.264,10.006c16.671,0,25.488-6.908,25.488-17.396 C285.536,325.789,277.909,320.078,258.618,313.18z M69.474,302.692c0-54.781,39.074-85.269,87.654-85.269 c18.822,0,33.113,3.811,39.549,7.149l-7.392,28.816c-7.38-3.084-17.632-5.939-30.491-5.939c-28.822,0-51.206,17.375-51.206,53.099 c0,32.158,19.051,52.4,51.456,52.4c10.947,0,23.097-2.378,30.241-5.238l5.483,28.346c-6.672,3.34-21.674,6.919-41.208,6.919 C98.06,382.976,69.474,348.424,69.474,302.692z M451.534,520.962H96.757v-103.57h354.777V520.962z M427.518,380.583h-42.399 l-51.45-160.536h39.787l19.526,67.894c5.479,19.046,10.479,37.386,14.299,57.397h0.709c4.048-19.298,9.045-38.352,14.526-56.693 l20.487-68.598h38.599L427.518,380.583z" /></svg>'},OrgChart.icon.excel=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="#ECEFF1" d="M496,432.011H272c-8.832,0-16-7.168-16-16s0-311.168,0-320s7.168-16,16-16h224 c8.832,0,16,7.168,16,16v320C512,424.843,504.832,432.011,496,432.011z" /><path fill="'+r+'" d="M336,176.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,176.011,336,176.011z" /><path fill="'+r+'" d="M336,240.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,240.011,336,240.011z" /><path fill="'+r+'" d="M336,304.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,304.011,336,304.011z" /><path fill="'+r+'" d="M336,368.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,368.011,336,368.011z" /><path fill="'+r+'" d="M432,176.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,176.011,432,176.011z" /><path fill="'+r+'" d="M432,240.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,240.011,432,240.011z" /><path fill="'+r+'" d="M432,304.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,304.011,432,304.011z" /><path fill="'+r+'" d="M432,368.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,368.011,432,368.011z" /><path fill="'+r+'" d="M282.208,19.691c-3.648-3.04-8.544-4.352-13.152-3.392l-256,48C5.472,65.707,0,72.299,0,80.011v352 c0,7.68,5.472,14.304,13.056,15.712l256,48c0.96,0.192,1.952,0.288,2.944,0.288c3.712,0,7.328-1.28,10.208-3.68 c3.68-3.04,5.792-7.584,5.792-12.32v-448C288,27.243,285.888,22.731,282.208,19.691z" /><path fill="#FAFAFA" d="M220.032,309.483l-50.592-57.824l51.168-65.792c5.44-6.976,4.16-17.024-2.784-22.464 c-6.944-5.44-16.992-4.16-22.464,2.784l-47.392,60.928l-39.936-45.632c-5.856-6.72-15.968-7.328-22.56-1.504 c-6.656,5.824-7.328,15.936-1.504,22.56l44,50.304L83.36,310.187c-5.44,6.976-4.16,17.024,2.784,22.464 c2.944,2.272,6.432,3.36,9.856,3.36c4.768,0,9.472-2.112,12.64-6.176l40.8-52.48l46.528,53.152 c3.168,3.648,7.584,5.504,12.032,5.504c3.744,0,7.488-1.312,10.528-3.968C225.184,326.219,225.856,316.107,220.032,309.483z" /></svg>'},OrgChart.icon.edit=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 528.899 528.899"><path fill="'+r+'" d="M328.883,89.125l107.59,107.589l-272.34,272.34L56.604,361.465L328.883,89.125z M518.113,63.177l-47.981-47.981 c-18.543-18.543-48.653-18.543-67.259,0l-45.961,45.961l107.59,107.59l53.611-53.611 C532.495,100.753,532.495,77.559,518.113,63.177z M0.3,512.69c-1.958,8.812,5.998,16.708,14.811,14.565l119.891-29.069 L27.473,390.597L0.3,512.69z" /></svg>'},OrgChart.icon.details=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="'+r+'" d="M447.933,103.629c-0.034-3.076-1.224-6.09-3.485-8.352L352.683,3.511c-0.004-0.004-0.007-0.005-0.011-0.008 C350.505,1.338,347.511,0,344.206,0H89.278C75.361,0,64.04,11.32,64.04,25.237v461.525c0,13.916,11.32,25.237,25.237,25.237 h333.444c13.916,0,25.237-11.32,25.237-25.237V103.753C447.96,103.709,447.937,103.672,447.933,103.629z M356.194,40.931 l50.834,50.834h-49.572c-0.695,0-1.262-0.567-1.262-1.262V40.931z M423.983,486.763c0,0.695-0.566,1.261-1.261,1.261H89.278 c-0.695,0-1.261-0.566-1.261-1.261V25.237c0-0.695,0.566-1.261,1.261-1.261h242.94v66.527c0,13.916,11.322,25.239,25.239,25.239 h66.527V486.763z"/><path fill="'+r+'" d="M362.088,164.014H149.912c-6.62,0-11.988,5.367-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175 c6.62,0,11.988-5.368,11.988-11.988C374.076,169.381,368.707,164.014,362.088,164.014z"/><path fill="'+r+'" d="M362.088,236.353H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175 c6.62,0,11.988-5.368,11.988-11.988C374.076,241.721,368.707,236.353,362.088,236.353z"/><path fill="'+r+'" d="M362.088,308.691H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988h212.175 c6.62,0,11.988-5.367,11.988-11.988C374.076,314.06,368.707,308.691,362.088,308.691z"/><path fill="'+r+'" d="M256,381.031H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988H256 c6.62,0,11.988-5.367,11.988-11.988C267.988,386.398,262.62,381.031,256,381.031z"/></svg>'},OrgChart.icon.remove=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 900.5 900.5"><path fill="'+r+'" d="M176.415,880.5c0,11.046,8.954,20,20,20h507.67c11.046,0,20-8.954,20-20V232.487h-547.67V880.5L176.415,880.5z M562.75,342.766h75v436.029h-75V342.766z M412.75,342.766h75v436.029h-75V342.766z M262.75,342.766h75v436.029h-75V342.766z"/><path fill="'+r+'" d="M618.825,91.911V20c0-11.046-8.954-20-20-20h-297.15c-11.046,0-20,8.954-20,20v71.911v12.5v12.5H141.874 c-11.046,0-20,8.954-20,20v50.576c0,11.045,8.954,20,20,20h34.541h547.67h34.541c11.046,0,20-8.955,20-20v-50.576 c0-11.046-8.954-20-20-20H618.825v-12.5V91.911z M543.825,112.799h-187.15v-8.389v-12.5V75h187.15v16.911v12.5V112.799z"/></svg>'},OrgChart.icon.add=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 922 922"><path fill="'+r+'" d="M922,453V81c0-11.046-8.954-20-20-20H410c-11.045,0-20,8.954-20,20v149h318c24.812,0,45,20.187,45,45v198h149 C913.046,473.001,922,464.046,922,453z" /><path fill="'+r+'" d="M557,667.001h151c11.046,0,20-8.954,20-20v-174v-198c0-11.046-8.954-20-20-20H390H216c-11.045,0-20,8.954-20,20v149h194 h122c24.812,0,45,20.187,45,45v4V667.001z" /><path fill="'+r+'" d="M0,469v372c0,11.046,8.955,20,20,20h492c11.046,0,20-8.954,20-20V692v-12.501V667V473v-4c0-11.046-8.954-20-20-20H390H196 h-12.5H171H20C8.955,449,0,457.955,0,469z" /></svg>'},OrgChart.icon.search=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 485.213 485.213"><path fill="'+r+'" d="M471.882,407.567L360.567,296.243c-16.586,25.795-38.536,47.734-64.331,64.321l111.324,111.324 c17.772,17.768,46.587,17.768,64.321,0C489.654,454.149,489.654,425.334,471.882,407.567z" /><path fill="'+r+'" d="M363.909,181.955C363.909,81.473,282.44,0,181.956,0C81.474,0,0.001,81.473,0.001,181.955s81.473,181.951,181.955,181.951 C282.44,363.906,363.909,282.437,363.909,181.955z M181.956,318.416c-75.252,0-136.465-61.208-136.465-136.46 c0-75.252,61.213-136.465,136.465-136.465c75.25,0,136.468,61.213,136.468,136.465 C318.424,257.208,257.206,318.416,181.956,318.416z" /><path fill="'+r+'" d="M75.817,181.955h30.322c0-41.803,34.014-75.814,75.816-75.814V75.816C123.438,75.816,75.817,123.437,75.817,181.955z" /></svg>'},OrgChart.icon.xml=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M369.531,374.53h-32.058l-2.156-55.519 c-0.644-17.434-1.298-38.518-1.298-59.611h-0.633c-4.514,18.516-10.547,39.166-16.137,56.162l-17.645,56.601h-25.618 l-15.494-56.157c-4.725-16.996-9.671-37.658-13.123-56.6h-0.43c-0.854,19.585-1.508,41.961-2.586,60.038l-2.576,55.086h-30.343 l9.26-145.035h43.677l14.207,48.421c4.517,16.774,9.041,34.847,12.258,51.843h0.654c4.081-16.77,9.038-35.923,13.774-52.064 l15.493-48.199h42.82L369.531,374.53z M69.992,374.53l41.955-73.385l-40.444-71.65h37.655l12.688,26.465 c4.316,8.828,7.533,15.928,10.99,24.092h0.422c3.438-9.242,6.23-15.694,9.893-24.092l12.274-26.465h37.434l-40.89,70.796 l43.044,74.239h-37.866l-13.134-26.257c-5.376-10.108-8.817-17.639-12.909-26.04h-0.433c-3.009,8.401-6.674,15.932-11.19,26.04 l-12.042,26.257H69.992z M453.601,523.353H97.2V419.302h356.4V523.353z M485.325,374.53h-90.608V229.495h32.933v117.497h57.682 v27.538H485.325z"/></svg>'},OrgChart.icon.link=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512.092 512.092" ><path fill="'+r+'" d="M312.453,199.601c-6.066-6.102-12.792-11.511-20.053-16.128c-19.232-12.315-41.59-18.859-64.427-18.859 c-31.697-0.059-62.106,12.535-84.48,34.987L34.949,308.23c-22.336,22.379-34.89,52.7-34.91,84.318 c-0.042,65.98,53.41,119.501,119.39,119.543c31.648,0.11,62.029-12.424,84.395-34.816l89.6-89.6 c1.628-1.614,2.537-3.816,2.524-6.108c-0.027-4.713-3.87-8.511-8.583-8.484h-3.413c-18.72,0.066-37.273-3.529-54.613-10.581 c-3.195-1.315-6.867-0.573-9.301,1.877l-64.427,64.512c-20.006,20.006-52.442,20.006-72.448,0 c-20.006-20.006-20.006-52.442,0-72.448l108.971-108.885c19.99-19.965,52.373-19.965,72.363,0 c13.472,12.679,34.486,12.679,47.957,0c5.796-5.801,9.31-13.495,9.899-21.675C322.976,216.108,319.371,206.535,312.453,199.601z" /><path fill="'+r+'" d="M477.061,34.993c-46.657-46.657-122.303-46.657-168.96,0l-89.515,89.429c-2.458,2.47-3.167,6.185-1.792,9.387 c1.359,3.211,4.535,5.272,8.021,5.205h3.157c18.698-0.034,37.221,3.589,54.528,10.667c3.195,1.315,6.867,0.573,9.301-1.877 l64.256-64.171c20.006-20.006,52.442-20.006,72.448,0c20.006,20.006,20.006,52.442,0,72.448l-80.043,79.957l-0.683,0.768 l-27.989,27.819c-19.99,19.965-52.373,19.965-72.363,0c-13.472-12.679-34.486-12.679-47.957,0 c-5.833,5.845-9.35,13.606-9.899,21.845c-0.624,9.775,2.981,19.348,9.899,26.283c9.877,9.919,21.433,18.008,34.133,23.893 c1.792,0.853,3.584,1.536,5.376,2.304c1.792,0.768,3.669,1.365,5.461,2.048c1.792,0.683,3.669,1.28,5.461,1.792l5.035,1.365 c3.413,0.853,6.827,1.536,10.325,2.133c4.214,0.626,8.458,1.025,12.715,1.195h5.973h0.512l5.12-0.597 c1.877-0.085,3.84-0.512,6.059-0.512h2.901l5.888-0.853l2.731-0.512l4.949-1.024h0.939c20.961-5.265,40.101-16.118,55.381-31.403 l108.629-108.629C523.718,157.296,523.718,81.65,477.061,34.993z" /></svg>'},OrgChart.icon.happy=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="'+r+'" d="M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M256,480 C132.288,480,32,379.712,32,256S132.288,32,256,32s224,100.288,224,224S379.712,480,256,480z"/><path fill="'+r+'" d="M176,176c17.673,0,32,14.327,32,32h32c0-35.346-28.654-64-64-64c-35.346,0-64,28.654-64,64h32 C144,190.327,158.327,176,176,176z"/><path fill="'+r+'" d="M336,144c-35.346,0-64,28.654-64,64h32c0-17.673,14.327-32,32-32c17.673,0,32,14.327,32,32h32 C400,172.654,371.346,144,336,144z"/><path fill="'+r+'" d="M256,368c-53.019,0-96-42.981-96-96h-32c0,70.692,57.308,128,128,128s128-57.308,128-128h-32 C352,325.019,309.019,368,256,368z"/></svg>'},OrgChart.icon.sad=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="'+r+'" d="M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M256,480 C132.288,480,32,379.712,32,256S132.288,32,256,32s224,100.288,224,224S379.712,480,256,480z"/><path fill="'+r+'" d="M336,192c-17.673,0-32-14.327-32-32h-32c0,35.346,28.654,64,64,64c35.346,0,64-28.654,64-64h-32 C368,177.673,353.673,192,336,192z"/><path fill="'+r+'" d="M176,224c35.346,0,64-28.654,64-64h-32c0,17.673-14.327,32-32,32s-32-14.327-32-32h-32C112,195.346,140.654,224,176,224z "/><path fill="'+r+'" d="M256,256c-70.692,0-128,57.308-128,128h32c0-53.019,42.981-96,96-96s96,42.981,96,96h32C384,313.308,326.692,256,256,256 z"/></svg>'},OrgChart.prototype.exportPDF=function(t,e){t=this._defaultExportOptions(t,"pdf"),this._export(t,e)},OrgChart.prototype.exportPNG=function(t,e){t=this._defaultExportOptions(t,"png"),this._export(t,e)},OrgChart.prototype.exportSVG=function(t,e){t=this._defaultExportOptions(t,"svg"),this._export(t,e)},OrgChart.prototype._defaultExportOptions=function(t,e){return null==t&&(t={}),"svg"==e?(t.ext="svg",t.mime="image/svg+xml"):"pdf"==e?(t.mime="application/pdf",t.ext="pdf"):"png"==e&&(t.mime="image/png",t.ext="png"),null==t.margin&&(t.margin=[50,40,50,40]),null==t.padding&&(t.padding=0),null==t.landscape&&(t.landscape=!1),null==t.filename&&(t.filename="OrgChart."+t.ext),null==t.scale&&(t.scale="fit"),null==t.format&&(t.format="fit"),null==t.header&&(t.header=""),null==t.footer&&(t.footer="Page {current-page} of {total-pages}"),null==t.openInNewTab&&(t.openInNewTab=!1),t},OrgChart.prototype._export=function(o,l){var s=this,t={id:o.nodeId,expandChildren:o.expandChildren};o.margin&&o.margin[0]<2&&(o.margin[0]=2),o.margin&&o.margin[1]<2&&(o.margin[1]=2),o.margin&&o.margin[2]<2&&(o.margin[2]=2),o.margin&&o.margin[3]<2&&(o.margin[3]=2),this._draw(!1,OrgChart.action.exporting,t,function(t){var r=document.createElement("div");if(r.innerHTML=t,0<o.padding){var e=r.querySelector("svg"),i=OrgChart._getViewBox(e);i[0]-=o.padding,i[1]-=o.padding,i[2]+=2*o.padding,i[3]+=2*o.padding,e.setAttribute("viewBox",i.join()),e.setAttribute("width",i[2]),e.setAttribute("height",i[3])}if("svg"==o.ext)if(l)l(o,r.innerHTML);else{var a={content:r.innerHTML,options:o,styles:""},n=OrgChart.events.publish("exportstart",[s,a]);if(a.styles&&(r.childNodes[0].insertAdjacentHTML("afterbegin",a.styles),a.content=r.innerHTML),!1===n)return!1;if(!1===(n=OrgChart.events.publish("exportend",[s,a])))return!1;OrgChart._downloadFile(o.mime,a.content,a.options.filename,a.options.openInNewTab)}else s._pages(o,r.querySelector("svg"),function(t){var e={content:r.innerHTML,options:o,pages:t,styles:""};if(!1===OrgChart.events.publish("exportstart",[s,e]))return!1;l||OrgChart.loading.show(s),l?l(s,e,r.querySelector("svg")):(e=JSON.stringify(e),OrgChart._ajax(s.config.exportUrl+"/v3","POST",e,"arraybuffer",function(t){var e=OrgChart.events.publish("exportend",[s,t]);if(OrgChart.loading.hide(s),!1===e)return!1;OrgChart._downloadFile(o.mime,t,o.filename,o.openInNewTab)}))})})},OrgChart.prototype.exportCSV=function(t){t||(t="OrgChart.csv");var e={ext:"csv",filename:t,nodes:JSON.parse(JSON.stringify(this.config.nodes))};if(!1===OrgChart.events.publish("exportstart",[this,e]))return!1;var r=OrgChart._json2csv(e.nodes),i={ext:e.ext,filename:e.filename,nodes:e.nodes,content:r};if(!1===OrgChart.events.publish("exportend",[this,i]))return!1;OrgChart._downloadFile("text/csv;charset=utf-8;","\ufeff"+i.content,i.filename,i.openInNewTab)},OrgChart.prototype.exportXML=function(t){t||(t="OrgChart.xml");var e={ext:"xml",filename:t,nodes:JSON.parse(JSON.stringify(this.config.nodes))};if(!1===OrgChart.events.publish("exportstart",[this,e]))return!1;var r=OrgChart._json2xml(e.nodes),i={ext:e.ext,filename:e.filename,nodes:e.nodes,content:r};if(!1===OrgChart.events.publish("exportend",[this,i]))return!1;OrgChart._downloadFile("application/xml",i.content,i.filename,i.openInNewTab)},OrgChart.prototype._pages=function(t,e,r){"A4"==t.format&&"fit"!=t.scale||"A3"==t.format&&"fit"!=t.scale||"A2"==t.format&&"fit"!=t.scale||"A1"==t.format&&"fit"!=t.scale||"Letter"==t.format&&"fit"!=t.scale||"Legal"==t.format&&"fit"!=t.scale?r(this._pagesA100(t,e,t.scale)):"A4"==t.format&&"fit"==t.scale||"A3"==t.format&&"fit"==t.scale||"A2"==t.format&&"fit"==t.scale||"A1"==t.format&&"fit"==t.scale||"Letter"==t.format&&"fit"==t.scale||"Legal"==t.format&&"fit"==t.scale?r(this._pagesAfit(t,e)):"fit"==t.format&&r(this._pagesFit(t,e))},OrgChart.prototype._pagesFit=function(t,e){var r=e.getAttribute("width"),i=e.getAttribute("height"),a=OrgChart._getViewBox(e),n={w:parseFloat(r),h:parseFloat(i)};return[{vb:a,size:{w:n.w+(t.margin[1]+t.margin[3]),h:n.h+(t.margin[0]+t.margin[2])},innerSize:n}]},OrgChart.prototype._pagesAfit=function(t,e){var r=e.getAttribute("width"),i=0,a=0;switch(t.format){case"A4":i=OrgChart.A4w,a=OrgChart.A4h;break;case"A3":i=OrgChart.A3w,a=OrgChart.A3h;break;case"A2":i=OrgChart.A2w,a=OrgChart.A2h;break;case"A1":i=OrgChart.A1w,a=OrgChart.A1h;break;case"Letter":i=OrgChart.Letterw,a=OrgChart.Letterh;break;case"Legal":i=OrgChart.Legalw,a=OrgChart.Legalh}var n=t.landscape?a-(t.margin[1]+t.margin[3]):i-(t.margin[1]+t.margin[3]),o=(t.landscape?(t.margin[0],t.margin[2]):(t.margin[0],t.margin[2]),n/r);return this._pagesA100(t,e,100*o)},OrgChart.prototype._pagesA100=function(t,e,r){var i=OrgChart._getViewBox(e),a=0,n=0;switch(t.format){case"A4":a=OrgChart.A4w,n=OrgChart.A4h;break;case"A3":a=OrgChart.A3w,n=OrgChart.A3h;break;case"A2":a=OrgChart.A2w,n=OrgChart.A2h;break;case"A1":a=OrgChart.A1w,n=OrgChart.A1h;break;case"Letter":a=OrgChart.Letterw,n=OrgChart.Letterh;break;case"Legal":a=OrgChart.Legalw,n=OrgChart.Legalh}var o=i[0],l=i[1],s=i[2],h=i[3],d={w:t.landscape?n-(t.margin[1]+t.margin[3]):a-(t.margin[1]+t.margin[3]),h:t.landscape?a-(t.margin[0]+t.margin[2]):n-(t.margin[0]+t.margin[2])},c={w:t.landscape?n:a,h:t.landscape?a:n};e.setAttribute("preserveAspectRatio","xMinYMin slice"),e.setAttribute("width",d.w),e.setAttribute("height",d.h);for(var g=d.w*(100/r),p=d.h*(100/r),f=o,u=l,C=[];f<s+o;){for(;u<h+l;){var m=[f,u,g,p];m=m.join(),C.push({vb:m,innerSize:d,size:c}),u+=p}f+=g,u=l}return C},void 0===OrgChart&&(OrgChart={}),OrgChart.events=function(){var o={};return{on:function(t,e,r){Array.isArray(o[t])||(o[t]=[]),o[t].push({listener:e,event_id:r})},removeAll:function(t){Array.isArray(o[t])||(o[t]=[]),o[t]=[]},removeForEventId:function(t){for(var e in o)if(Array.isArray(o[e]))for(var r=o[e].length-1;0<=r;r--)o[e][r].event_id==t&&o[e].splice(r,1)},publish:function(t,e){if(o[t]){for(var r=[],i=0;i<o[t].length;i++){var a=o[t][i];null!=a.event_id&&a.event_id!=e[0]._event_id||r.push(a.listener)}if(0<r.length){var n=!0;for(i=0;i<r.length;i++)1==e.length?n=r[i](e[0])&&n:2==e.length?n=r[i](e[0],e[1])&&n:3==e.length?n=r[i](e[0],e[1],e[2])&&n:4==e.length?n=r[i](e[0],e[1],e[2],e[3])&&n:5==e.length&&(n=r[i](e[0],e[1],e[2],e[3],e[4])&&n);return n}}}}}(),OrgChart.prototype.importCSV=function(){var h=this,t=document.createElement("INPUT");t.setAttribute("type","file"),t.setAttribute("accept",".csv"),t.style.display="none",t.onchange=function(t){var e=t.target,r=new FileReader;r.onload=function(){var t=r.result,l=OrgChart._csvToArray(t,","),s=[],e=l[0];OrgChart._importSetColumnNames(e,function(t){for(var e=1;e<l.length;e++){for(var r={},i=0;i<l[e].length;i++){var a=t[i],n=l[e][i];if("tags"==a&&""!=n)n=n.split(",");else if("tags"==a&&""==n)continue;r[a]=n}""!=r.id.trim()&&s.push(r)}var o={nodes:s,columnNames:l[0]};0!=OrgChart.events.publish("import",[h,o])&&(h.config.nodes=o.nodes,h.draw())})},r.readAsText(e.files[0])},t.click()},OrgChart._importSetColumnNames=function(a,n){if(-1==a.indexOf("id")||-1==a.indexOf("pid")){var t=document.createElement("DIV"),e=document.createElement("P");e.style.padding="5px",e.style.color="rgb(122, 122, 122)",e.innerHTML=OrgChart.IMPORT_MESSAGE,t.appendChild(e);var o=document.createElement("div"),r=document.createElement("div"),i=document.createElement("div"),l=document.createElement("span");o.setAttribute("id","sampleDialog"),o.style.height="260px",o.style.width="400px",o.style.background="white",o.style.border="0.5px solid grey",o.style.position="fixed",o.style.overflow="hidden",o.style.zIndex="99",r.setAttribute("id","title"),r.style.backgroundColor="#e5e5e5",r.style.fontWeight="bold",r.style.color="rgb(122, 122, 122)",r.style.height="20px",r.style.padding="3px 0 0 7px",l.setAttribute("id","close"),l.style.cursor="pointer",l.style.position="absolute",l.style.color="rgb(122, 122, 122)",l.style.fontWeight="bold",l.style.top="2px",l.style.zIndex=100,i.setAttribute("id","content"),i.style.padding="2px",r.innerHTML="Import Organizational Chart Data",l.innerHTML="×";var s=document.createElement("HR");s.style.height="0.1px",s.style.backgroundColor="#aeaeae",s.style.border="none",s.style.margin="0",o.appendChild(r),o.appendChild(s),i.appendChild(t),o.appendChild(i),o.appendChild(l),document.body.appendChild(o),OrgChart._importCenter(o),l.style.left=o.offsetWidth-20+"px";var h=document.createElement("div");h.setAttribute("id","overlay"),h.style.width="100%",h.style.height="100%",h.style.left=0,h.style.top=0,h.style.position="fixed",h.style.background="grey",h.style.opacity="0.5",h.style.zIndex=98,document.body.appendChild(h),o._overlay=h;var d=document.createElement("LABEL"),c=document.createTextNode("Name:");d.setAttribute("for","id-select"),d.appendChild(c),d.style.fontSize="16px",d.style.color="rgb(122, 122, 122)",d.style.padding="5px",d.style.margin="5px",d.style.width="30%",d.style.textAlign="right",d.style.display="inline-block",t.appendChild(d);var g=document.createElement("SELECT");g.id="id-select",g.style.fontSize="16px",g.style.color="rgb(122, 122, 122)",g.style.padding="5px",g.style.margin="5px",g.style.width="60%",g.style.border="1px solid #aeaeae",t.appendChild(g);var p=document.createElement("BR");t.appendChild(p);for(var f=0;f<a.length;f++){(y=document.createElement("option")).setAttribute("value",a[f]);var u=document.createTextNode(a[f]);y.appendChild(u),g.appendChild(y)}var C=document.createElement("LABEL"),m=document.createTextNode("Reports to:");C.setAttribute("for","pid-select"),C.appendChild(m),C.style.fontSize="16px",C.style.color="rgb(122, 122, 122)",C.style.padding="5px",C.style.margin="5px",C.style.width="30%",C.style.textAlign="right",C.style.display="inline-block",t.appendChild(C);var O=document.createElement("SELECT");O.id="pid-select",O.style.fontSize="16px",O.style.color="rgb(122, 122, 122)",O.style.padding="5px",O.style.margin="5px",O.style.width="60%",O.style.border="1px solid #aeaeae",t.appendChild(O);for(f=0;f<a.length;f++){var y;(y=document.createElement("option")).setAttribute("value",a[f]);u=document.createTextNode(a[f]);y.appendChild(u),O.appendChild(y)}var v=document.createElement("BUTTON");v.innerHTML="Import",v.style.fontSize="16px",v.style.color="rgb(122, 122, 122)",v.style.padding="5px 20px",v.style.margin="20px auto",v.style.display="block",v.onclick=function(){o.style.display="none",o._overlay&&o._overlay.parentNode.removeChild(o._overlay);var t=g.options[g.selectedIndex].value,e=a.indexOf(t);a[e]="id";var r=O.options[O.selectedIndex].value,i=a.indexOf(r);a[i]="pid",n(a)};var x=document.createElement("DIV");return x.appendChild(v),t.appendChild(x),l.onclick=function(t){o._overlay&&o._overlay.parentNode.removeChild(o._overlay),o.parentNode.removeChild(o),t.stopPropagation()},r.onmousedown=function(t){t=t||window.event,o._dragging=!0,o._originalLeft=o.offsetLeft,o._originalTop=o.offsetTop,o._mouseLeft=t.clientX,o._mouseTop=t.clientY},document.onmousemove=function(t){t=t||window.event,o._dragging&&(o.style.left=o._originalLeft+t.clientX-o._mouseLeft+"px",o.style.top=o._originalTop+t.clientY-o._mouseTop+"px")},document.onmouseup=function(t){t=t||window.event,o._dragging&&(o.style.left=o._originalLeft+t.clientX-o._mouseLeft+"px",o.style.top=o._originalTop+t.clientY-o._mouseTop+"px",o._dragging=!1)},o}n(a)},OrgChart._importCenter=function(t){t&&(t.style.left=(window.innerWidth-t.offsetWidth)/2+"px",t.style.top=(window.innerHeight-t.offsetHeight)/2+"px")},OrgChart.prototype.importXML=function(){var i=this,t=document.createElement("INPUT");t.setAttribute("type","file"),t.setAttribute("accept",".xml"),t.style.display="none",t.onchange=function(t){var e=t.target,r=new FileReader;r.onload=function(){var t=r.result,e=OrgChart._xml2json(t);0!=OrgChart.events.publish("import",[i,e])&&(i.config.nodes=e,i.draw())},r.readAsText(e.files[0])},t.click()},OrgChart.prototype.expand=function(t,e,r){var i={id:t,ids:e};this._draw(!1,OrgChart.action.expand,i,r)},OrgChart.prototype.collapse=function(t,e,r){var i={id:t,ids:e};this._draw(!1,OrgChart.action.collapse,i,r)},OrgChart.prototype.expandCollapse=function(t,e,r,i){Array.isArray(e)||(e=[]),Array.isArray(r)||(r=[]);var a={id:t,expandIds:e,collapseIds:r,ids:e.concat(r)};this._draw(!1,OrgChart.action.collapse,a,i)},OrgChart.prototype.expandCollapseToLevel=function(t,e,r,i){this.config.collapse=e,null==r&&(r={}),this.config.expand=r;var a={id:t,method:"expandCollapseToLevel"};this._draw(!1,OrgChart.action.collapse,a,i)},OrgChart.prototype.maximize=function(t,e,r,i){var a=this,n={id:t,options:{}};n.options.horizontal=!1,n.options.vertical=!1,e&&(n.options.horizontal=e),r&&(n.options.vertical=r),this._draw(!1,OrgChart.action.maximize,n,function(){a.ripple(t),i&&i()})},OrgChart.prototype.minimize=function(t,e){var r=this,i={id:t};this._draw(!1,OrgChart.action.minimize,i,function(){r.ripple(t),e&&e()})},OrgChart.prototype._expCollHandler=function(t){this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var e=this.getNode(t),r=this.getCollapsedIds(e);if(r.length){if(!1===OrgChart.events.publish("expcollclick",[this,!1,t,r]))return!1;this.expand(t,r,!1)}else{if(!1===OrgChart.events.publish("expcollclick",[this,!0,t,e.childrenIds]))return!1;this.collapse(t,e.childrenIds,!1)}},String.prototype.replaceAll||(String.prototype.replaceAll=function(t,e){return this.replace(new RegExp(t,"g"),e)}),String.prototype.splice=function(t,e,r){return this.slice(0,t)+r+this.slice(t+Math.abs(e))},String.prototype.insert=function(t,e){return 0<t?this.substring(0,t)+e+this.substr(t):e+this},Object.defineProperty(Array.prototype,"has",{value:function(t){for(var e=0;e<this.length;e++)if(this[e]==t)return!0;return!1},writable:!0,configurable:!0,enumerable:!1}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){"use strict";if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),i=1;i<arguments.length;i++){var a=arguments[i];if(null!=a)for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(r[n]=a[n])}return r},writable:!0,configurable:!0}),"function"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(t){return-1!==this.indexOf(t,this.length-t.length)}),OrgChart.prototype._globalMouseDownHandler=function(t,e){var r={move:"mousemove",up:"mouseup",leave:"mouseleave"};if(-1!=e.type.indexOf("touch")&&(1==e.touches.length?this._touch={x:e.touches[0].clientX,y:e.touches[0].clientY}:this._touch=null,r={move:"touchmove",up:"touchend",touchstart:"touchstart"}),t==e.target)return e.stopPropagation(),e.preventDefault(),void this._mouseDownHandler(t,e,r);if(this.config.nodeMouseClick==OrgChart.action.pan){for(var i=e.target;i!=t&&!i.hasAttribute(OrgChart.attr.control_expcoll_id);)i=i.parentNode;if(!i.hasAttribute(OrgChart.attr.control_expcoll_id))return e.stopPropagation(),e.preventDefault(),void this._mouseDownHandler(t,e,r)}for(var a=e.target;a!=t;){if(a.hasAttribute(OrgChart.attr.node_id))return void this._nodeMouseDownHandler(a,e,r);if(a.hasAttribute(OrgChart.attr.control_node_circle_menu_name))return e.stopPropagation(),e.preventDefault(),void this._nodeCircleNodeMenuItemMouseDownHandler(a,e,r);a=a.parentNode}},OrgChart.prototype._globalClickHandler=function(t,e){if(-1!=e.type.indexOf("touch")&&this._touch&&1==e.changedTouches.length){if(e.changedTouches.length){var r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY,a=OrgChart.t(this.config.template,!1,this.getScale()).size,n=this.getScale(),o=Math.abs(r-this._touch.x)/n,l=Math.abs(i-this._touch.y)/n;if(this._touch=null,o>a[0]/10)return;if(l>a[1]/10)return}}else if(-1!=e.type.indexOf("touch")&&null==this._touch)return;for(var s=e.target;s!=t;){if(s.hasAttribute(OrgChart.attr.control_expcoll_id)){var h=s.getAttribute(OrgChart.attr.control_expcoll_id),d=this.getNode(h);return void this._expCollHandler(d.id)}if(s.hasAttribute(OrgChart.attr.node_id)){h=s.getAttribute(OrgChart.attr.node_id),d=this.getNode(h);return void this._nodeClickHandler(d.id,e)}if(s.hasAttribute(OrgChart.attr.control_node_menu_id)){e.stopPropagation(),e.preventDefault();h=s.getAttribute(OrgChart.attr.control_node_menu_id),d=this.getNode(h);return void this._nodeMenuClickHandler(d.id,s,e)}if(s.hasAttribute(OrgChart.attr.control_node_circle_menu_id)){e.stopPropagation(),e.preventDefault();h=s.getAttribute(OrgChart.attr.control_node_circle_menu_id);return void this._nodeCircleMenuClickHandler(h)}if(s.hasAttribute(OrgChart.attr.control_node_circle_menu_name))return e.stopPropagation(),e.preventDefault(),void this._nodeCircleMenuItemClickHandler(s,e);if(s.hasAttribute(OrgChart.attr.control_add))return void this._lonelyButtonHandler();if(s.hasAttribute(OrgChart.attr.c_link_from))return void OrgChart.events.publish("clink-click",[this,{from:s.getAttribute(OrgChart.attr.c_link_from),to:s.getAttribute(OrgChart.attr.c_link_to),event:e}]);if(s.hasAttribute(OrgChart.attr.s_link_from))return void OrgChart.events.publish("slink-click",[this,{from:s.getAttribute(OrgChart.attr.s_link_from),to:s.getAttribute(OrgChart.attr.s_link_to),event:e}]);s=s.parentNode}},OrgChart.prototype._globalContextHandler=function(t,e){for(var r=e.target;r!=t;){if(r.hasAttribute(OrgChart.attr.node_id)){var i=r.getAttribute(OrgChart.attr.node_id),a=this.getNode(i);return void this._nodeContextHandler(a.id,e)}r=r.parentNode}},OrgChart.prototype._nodeContextHandler=function(t,e){e.preventDefault(),this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var r=this.get(t),i=null;if(null!=r&&Array.isArray(r.tags))for(var a=0;a<r.tags.length;a++){var n=r.tags[a];this.config.tags[n]&&this.config.tags[n].nodeContextMenu&&(i=this.config.tags[n].nodeContextMenu)}this.nodeContextMenuUI.show(e.pageX,e.pageY,t,null,i)},OrgChart.prototype._globalDbClickHandler=function(t,e){for(var r=e.target;r!=t;){if(r.hasAttribute(OrgChart.attr.node_id)){var i=r.getAttribute(OrgChart.attr.node_id),a=this.getNode(i);return void this._nodeDbClickHandler(a.id,e)}r=r.parentNode}},OrgChart.prototype._mouseScrollHandler=function(t,e){if(this.config.mouseScrool!=OrgChart.action.ctrlZoom||e.ctrlKey){var r=this,i=!1,a=this.config.zoom.speed,n=this.config.zoom.smooth,o=0,l=this.getScale(),s=OrgChart._centerPointInPercent(r.getSvg(),e.pageX,e.pageY),h=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)};e.preventDefault();var d=e.delta||e.wheelDelta;void 0===d&&(d=-e.detail),d=Math.max(-1,Math.min(1,d)),o+=-d*a,i||function t(){i=!0;var e=(o-l)/n;0<e?e++:e--,l+=e,r.zoom(1-e/12/50,s),parseInt(l)==parseInt(o)?i=!1:h(t)}()}},OrgChart.prototype._nodeCircleNodeMenuItemMouseDownHandler=function(O,t,r){var e=O.parentNode.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id),y=O.getAttribute(OrgChart.attr.control_node_circle_menu_name),v=this.nodeCircleMenuUI.menu[y];if(v.draggable){var x=this,i=OrgChart._getClientXY(t),a=this.getNode(e);O._dragEventFired=!1;var b=x.getScale(),_=null,w=null;this._gragStartedId=e,document.body.style.mozUserSelect=document.body.style.webkitUserSelect=document.body.style.userSelect="none";var k=this.getSvg(),S={x:i.x,y:i.y},I=O.cloneNode(!0);k.insertBefore(I,k.firstChild);var A=OrgChart._getTransform(I),E=A[4],M=A[5],L=function(t){for(;t&&!t.hasAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id);)t=t.parentNode;if(t){var e=OrgChart._getTransform(t);return{x:e[4],y:e[5]}}console.error("cannot find parent"+OrgChart.attr.control_node_circle_menu_wrraper_id)}(O);I.setAttribute("transform","matrix(1,0,0,1,"+(E+L.x)+","+(M+L.y)+")"),I.style.opacity=.7;var N=function(t,e){if(null!=t){e.classList.remove("drag-over");for(var r=OrgChart.getStParentNodes(x.getNode(_)),i=0;i<r.length;i++){var a=x.getNodeElement(r[i].id);a&&(a.style.opacity=1)}}},n=function(t){if(S){var e=OrgChart._getClientXY(t),r=t.target;e.x+=L.x*b,e.y+=L.y*b;var i=OrgChart._getOffsetXY(x.element,t),a={left:x.width()-(i.x+x.config.padding)<0,right:i.x-x.config.padding<0,down:x.height()-(i.y+x.config.padding)<0,up:i.y-x.config.padding<0};if(a.left||a.right||a.up||a.down){k.classList&&(k.classList.remove("cursor-grab"),k.classList.add("cursor-move"),k.classList.remove("cursor-nodrop"),k.classList.remove("cursor-copy"));var n=A[4],o=A[5],l=S.x,s=S.y,h=e.x,d=e.y;x.startMove(a,function(t){A[4]=n+t.x,A[5]=o+t.y,S.x=l-t.xWithoutScale,S.y=s-t.yWithoutScale,e.x=h-t.xWithoutScale,e.y=d-t.yWithoutScale,I.setAttribute("transform","matrix("+A.toString()+")")})}else{for(x.stopMove(),k.classList&&(k.classList.add("cursor-grab"),k.classList.remove("cursor-move"),k.classList.remove("cursor-nodrop"),k.classList.remove("cursor-copy")),N(_,w),w=_=null;null!=r&&r!=k;){if(r.hasAttribute&&r.hasAttribute(OrgChart.attr.node_id)){var c=r.getAttribute(OrgChart.attr.node_id);_=c,w=r;break}r=r.parentNode}if(null!=_){w.classList.add("drag-over");for(var g=x.getNode(_),p=OrgChart.getStParentNodes(g),f=0;f<p.length;f++){var u=x.getNodeElement(p[f].id);u&&(u.style.opacity=.1)}k.classList.remove("cursor-grab"),k.classList.remove("cursor-move"),k.classList.add("cursor-copy"),k.classList.remove("cursor-nodrop")}var C=(e.x-S.x)/b,m=(e.y-S.y)/b;if(A[4]=E+C,A[5]=M+m,!O._dragEventFired&&(Math.abs(e.x-S.x)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE||Math.abs(e.y-S.y)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE))!1===OrgChart.events.publish("drag",[x.nodeCircleMenuUI,{from:c,menuItem:v,menuItemName:y}])&&T(),O._dragEventFired=!0;I.setAttribute("transform","matrix("+A.toString()+")")}}},T=function(t){if(x.stopMove(),k.classList&&(k.classList.remove("cursor-grab"),k.classList.remove("cursor-move"),k.classList.remove("cursor-nodrop"),k.classList.remove("cursor-copy")),k.removeEventListener(r.move,n),k.removeEventListener(r.up,T),r.leave&&k.removeEventListener(r.leave,T),a.id==_||null==_)return k.removeChild(I),x._gragStartedId=null,void(O._dragEventFired&&OrgChart.events.publish("drop",[x.nodeCircleMenuUI,{from:a.id,menuItemName:y,menuItem:v}]));var e=x.getNode(_);OrgChart.events.publish("drop",[x.nodeCircleMenuUI,{from:a.id,to:e.id,menuItem:v,menuItemName:y}]),N(_,w),k.removeChild(I),x._gragStartedId=null};k.addEventListener(r.move,n),k.addEventListener(r.up,T),r.leave&&k.addEventListener(r.leave,T)}},OrgChart.prototype._nodeMouseDownHandler=function(O,t,i){if(this.config.enableDragDrop){var e=OrgChart._getClientXY(t),r=O.getAttribute(OrgChart.attr.node_id),y=this.getNode(r);O._dragEventFired=!1;var v=null,x=null;this._gragStartedId=r,document.body.style.mozUserSelect=document.body.style.webkitUserSelect=document.body.style.userSelect="none";var b=this,_=this.getSvg(),w={x:e.x,y:e.y},k=OrgChart._getTransform(O),S=k[4],I=k[5],A=b.getScale(),E=O.cloneNode(!0);_.insertBefore(E,_.firstChild),E.style.opacity=.7;var M=function(t,e){if(null!=t){e.classList.remove("drag-over");for(var r=b.getNode(v),i=OrgChart.getStParentNodes(r),a=0;a<i.length;a++){var n=b.getNodeElement(i[a].id);n&&(n.style.opacity=1)}}},a=function(t){if(w){var e=OrgChart._getClientXY(t),r=t.target,i=OrgChart._getOffsetXY(b.element,t),a={left:b.width()-(i.x+b.config.padding)<0,right:i.x-b.config.padding<0,down:b.height()-(i.y+b.config.padding)<0,up:i.y-b.config.padding<0};if(a.left||a.right||a.up||a.down){_.classList&&(_.classList.remove("cursor-grab"),_.classList.add("cursor-move"),_.classList.remove("cursor-nodrop"),_.classList.remove("cursor-copy"));var n=k[4],o=k[5],l=w.x,s=w.y,h=e.x,d=e.y;b.startMove(a,function(t){k[4]=n+t.x,k[5]=o+t.y,w.x=l-t.xWithoutScale,w.y=s-t.yWithoutScale,e.x=h-t.xWithoutScale,e.y=d-t.yWithoutScale,E.setAttribute("transform","matrix("+k.toString()+")")})}else{if(b.stopMove(),_.classList&&(_.classList.add("cursor-grab"),_.classList.remove("cursor-move"),_.classList.remove("cursor-nodrop"),_.classList.remove("cursor-copy")),M(v,x),x=v=null,b.config.enableDragDrop)for(;null!=r&&r!=_;){if(r.hasAttribute&&r.hasAttribute(OrgChart.attr.node_id)){var c=r.getAttribute(OrgChart.attr.node_id);if(b._gragStartedId&&c!=b._gragStartedId){v=c,x=r;break}}r=r.parentNode}if(null!=v){x.classList.add("drag-over");for(var g=b.getNode(v),p=OrgChart.getStParentNodes(g),f=0;f<p.length;f++){var u=b.getNodeElement(p[f].id);u&&(u.style.opacity=.1)}!b._canUpdateLink(y.id,v)&&_.classList?(_.classList.remove("cursor-grab"),_.classList.remove("cursor-move"),_.classList.remove("cursor-copy"),_.classList.add("cursor-nodrop")):_.classList&&(_.classList.remove("cursor-grab"),_.classList.remove("cursor-move"),_.classList.add("cursor-copy"),_.classList.remove("cursor-nodrop"))}var C=(e.x-w.x)/A,m=(e.y-w.y)/A;if(k[4]=S+C,k[5]=I+m,!O._dragEventFired&&(Math.abs(e.x-w.x)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE||Math.abs(e.y-w.y)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE))!1===OrgChart.events.publish("drag",[b,c])&&L(),O._dragEventFired=!0;E.setAttribute("transform","matrix("+k.toString()+")")}}},L=function(t){if(b.stopMove(),_.classList&&(_.classList.remove("cursor-grab"),_.classList.remove("cursor-move"),_.classList.remove("cursor-nodrop"),_.classList.remove("cursor-copy")),_.removeEventListener(i.move,a),_.removeEventListener(i.up,L),i.leave&&_.removeEventListener(i.leave,L),y.id!=v&&null!=v){var e=b.getNode(v);if(!1===OrgChart.events.publish("drop",[b,y.id,e.id]))return M(v,x),_.removeChild(E),void(b._gragStartedId=null);if(b._canUpdateLink(y.id,v)){var r=b.get(y.id);r.pid=v,r.stpid=null,b.updateNode(r,null,!0)}else _.removeChild(E),M(v,x);b._gragStartedId=null}else{_.removeChild(E),b._gragStartedId=null;OrgChart._getClientXY(t);O._dragEventFired&&OrgChart.events.publish("drop",[b,y.id])}};_.addEventListener(i.move,a),_.addEventListener(i.up,L),i.leave&&_.addEventListener(i.leave,L)}},OrgChart.prototype._resizeHandler=function(t,e){var r=this.getViewBox(),i=this.getSvg(),a=i.getAttribute("width"),n=i.getAttribute("height"),o=a/r[2],l=n/r[3],s=l<o?l:o;i.setAttribute("width",this.width()),i.setAttribute("height",this.height()),r[2]=this.width()/s,r[3]=this.height()/s,this.setViewBox(r),this.xScrollUI.create(this.width()),this.yScrollUI.create(this.height()),this._draw(!1,OrgChart.action.resize)},OrgChart.prototype._nodeDbClickHandler=function(t,e){if(!1===OrgChart.events.publish("dbclick",[this,this.get(t)]))return!1;this._commonClickHandler(t,e,this.config.nodeMouseDbClick)},OrgChart.prototype._nodeClickHandler=function(t,e){var r=this.getNodeElement(t);if(r._dragEventFired)r._dragEventFired=!1;else{if(!1===OrgChart.events.publish("click",[this,{node:this.getNode(t),event:e}]))return!1;this._commonClickHandler(t,e,this.config.nodeMouseClick)}},OrgChart.prototype._nodeCircleMenuItemClickHandler=function(t,e){var r=t.parentNode.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id),i=t.getAttribute(OrgChart.attr.control_node_circle_menu_name),a=this.nodeCircleMenuUI.menu[i];OrgChart.events.publish("click",[this.nodeCircleMenuUI,{nodeId:r,menuItemName:i,menuItem:a,event:e}])},OrgChart.prototype._nodeCircleMenuClickHandler=function(t){this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide();var e=this.getNode(t),r=null;if(Array.isArray(e.tags))for(var i=0;i<e.tags.length;i++){var a=e.tags[i];this.config.tags[a]&&this.config.tags[a].nodeCircleMenu&&(r=this.config.tags[a].nodeCircleMenu)}this.nodeCircleMenuUI.show(t,r)},OrgChart.prototype._commonClickHandler=function(t,e,r){if(this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide(),r==OrgChart.action.expandCollapse&&this.toggleExpandCollapse(t,e),r==OrgChart.action.edit){var i=this.getNode(t);this.editUI.show(i.id),this.ripple(i.id,e.clientX,e.clientY)}if(r==OrgChart.action.details){i=this.getNode(t);this.editUI.show(i.id,!0),this.ripple(i.id,e.clientX,e.clientY)}},OrgChart.prototype._menuHandlerMouseDownHandler=function(t,e){e.stopPropagation(),e.preventDefault()},OrgChart.prototype._nodeMenuClickHandler=function(t,e,r){this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var i=this.getNode(t),a=null;if(Array.isArray(i.tags))for(var n=0;n<i.tags.length;n++){var o=i.tags[n];this.config.tags[o]&&this.config.tags[o].nodeMenu&&(a=this.config.tags[o].nodeMenu)}this.nodeMenuUI.showStickIn(e,t,null,a)},OrgChart.prototype._exportMenuClickHandler=function(t,e){e.stopPropagation(),e.preventDefault(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.show(t.offsetLeft,t.offsetTop)},OrgChart.prototype._lonelyButtonHandler=function(){var t={id:this.generateId()};!1!==this.addNode(t,null,!0)&&this.center(t.id)},OrgChart.prototype.toggleExpandCollapse=function(t,e){var r=this.getNode(t),i=this.getCollapsedIds(r);if(i.length){if(!1===OrgChart.events.publish("expcollclick",[this,!1,t,i]))return!1;this.expand(t,i,!1)}else{if(!1===OrgChart.events.publish("expcollclick",[this,!0,t,r.childrenIds]))return!1;this.collapse(t,r.childrenIds,!1)}e&&this.ripple(r.id,e.clientX,e.clientY)},OrgChart.prototype._move=function(t,e,r){r[0]=e,r[1]=t,this.setViewBox(r),this.xScrollUI.setPosition(),this.yScrollUI.setPosition()},OrgChart.prototype.startMove=function(t,e){if(t){if(this._movePosition=t,!this._moveInterval){var r=this,i=this.getViewBox().slice(0),a=this.getScale(),n=0,o=0;this._moveInterval=setInterval(function(){var t={x:0,y:0,xWithoutScale:0,yWithoutScale:0};r._movePosition.left&&(n++,t.x=n*OrgChart.MOVE_STEP/a,t.xWithoutScale=n*OrgChart.MOVE_STEP),r._movePosition.right&&(n++,t.x=-n*OrgChart.MOVE_STEP/a,t.xWithoutScale=-n*OrgChart.MOVE_STEP),r._movePosition.up&&(o++,t.y=-o*OrgChart.MOVE_STEP/a,t.yWithoutScale=-o*OrgChart.MOVE_STEP),r._movePosition.down&&(o++,t.y=o*OrgChart.MOVE_STEP/a,t.yWithoutScale=o*OrgChart.MOVE_STEP),r.setViewBox([i[0]+t.x,i[1]+t.y,i[2],i[3]]),r.xScrollUI.setPosition(),r.yScrollUI.setPosition(),e&&e(t)},OrgChart.MOVE_INTERVAL)}}else console.error("movePosition parameter not defined")},OrgChart.prototype.stopMove=function(){this._moveInterval&&(clearInterval(this._moveInterval),this._moveInterval=null,this._movePosition=null)},void 0===OrgChart&&(OrgChart={}),OrgChart.node=function(t,e,r,i){this.templateName=i,this.id=t,this.pid=e,this.children=[],this.childrenIds=[],this.parent=null,this.stpid=null,this.stParent=null,this.stChildren=[],this.stChildrenIds=[],this.tags=r,this.tags||(this.tags=[])},OrgChart.prototype._mouseDownHandler=function(t,e,r){var s=this;this.editUI.hide(),this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var h=this.getViewBox(),d=this.getScale(),i=OrgChart._getClientTouchesXY(e,0),a=OrgChart._getClientTouchesXY(e,1),c={diffX:0,diffY:0,x0:i.x,y0:i.y,type:"pan",viewBoxLeft:h[0],viewBoxTop:h[1]};e.touches&&1<e.touches.length&&(c.type="pinch",c.dist=Math.sqrt((i.x-a.x)*(i.x-a.x)+(i.y-a.y)*(i.y-a.y)));var n=this.getPointerElement();if("pan"==c.type){this._hideBeforeAnimation();var o=OrgChart._getOffsetXY(this.element,e),l=o.x/d+h[0]-16/d,g=o.y/d+h[1]-16/d;n.style.display="inherit",n.setAttribute("transform","matrix(0,0,0,0,"+l+","+g+")"),OrgChart.anim(n,{transform:[0,0,0,0,l,g],opacity:0},{transform:[1/d,0,0,1/d,l,g],opacity:1},300,OrgChart.anim.outBack)}var p=function(t){var e=OrgChart._getClientTouchesXY(t,0);if(c&&"pan"==c.type){s._hideBeforeAnimation(),c.diffX=e.x-c.x0,c.diffY=e.y-c.y0;var r=-c.diffY/d+c.viewBoxTop,i=-c.diffX/d+c.viewBoxLeft;s._move(r,i,h)}else if(c&&"pinch"==c.type){var a=OrgChart._getClientTouchesXY(t,1),n=Math.sqrt((e.x-a.x)*(e.x-a.x)+(e.y-a.y)*(e.y-a.y)),o=1+(n-c.dist)/(c.dist/100)/100;c.dist=n;var l=OrgChart._pinchMiddlePointInPercent(s.element,s.width(),s.height(),t);s.zoom(o,l)}},f=function(){"pan"==c.type&&s.config.sticky?setTimeout(function(){OrgChart._moveToBoundaryArea(t,s.getViewBox(),s.response.boundary,function(){s._draw(!0,OrgChart.action.pan)})},0):"pan"!=c.type||s.config.sticky||s._draw(!0,OrgChart.action.pan),c=null,n.style.display="none",t.removeEventListener(r.move,p),t.removeEventListener(r.up,f),r.leave&&t.removeEventListener(r.leave,f),r.touchstart&&t.removeEventListener(r.touchstart,f)};t.addEventListener(r.move,p),t.addEventListener(r.up,f),r.leave&&t.addEventListener(r.leave,f),r.touchstart&&t.addEventListener(r.touchstart,f)},void 0===OrgChart&&(OrgChart={}),void 0===OrgChart.remote&&(OrgChart.remote={}),OrgChart.LIMIT_NODES=!0,OrgChart.remote._fromResDTO=function(t,e,r,i,a){var n=e[t.id];t.x=n.p[0],t.y=n.p[1],t.w=n.p[2],t.h=n.p[3],null!=n.ln&&(t.leftNeighbor=a[n.ln]),null!=n.rn&&(t.rightNeighbor=a[n.rn]);for(var o=0;o<t.stChildren.length;o++)OrgChart.remote._fromResDTO(t.stChildren[o],e,r,i,a);for(o=0;o<t.children.length;o++)OrgChart.remote._fromResDTO(t.children[o],e,r,i,a)},OrgChart.remote._toReqDTO=function(t,e){var r={p:[t.id,null!=t.parent?t.parent.id:null,null!=t.stParent?t.stParent.id:null,t.w,t.h]};0<t.children.length&&(r.c=OrgChart.remote._convertToIdArray(t.children)),0<t.stChildren.length&&(r.v=OrgChart.remote._convertToIdArray(t.stChildren)),null!=t.layout&&0!=t.layout&&(r.l=t.layout),t.isAssistant&&(r.a=1),t.isSplit&&(r.s=t.isSplit),t.padding&&(r.q=t.padding),t.lcn&&(r.k=t.lcn),t.stContainerNodes&&(r.b=OrgChart.remote._convertToIdArray(t.stContainerNodes)),t._m&&(r.m=t._m.id),t.isPartner&&(r.i=t.isPartner),t.hasPartners&&(r.g=t.hasPartners),t.ppid&&(r.u=t.ppid),t.partnerSeparation&&(r.e=t.partnerSeparation),e.push(r);for(var i=0;i<t.stChildren.length;i++)OrgChart.remote._toReqDTO(t.stChildren[i],e);for(i=0;i<t.children.length;i++)OrgChart.remote._toReqDTO(t.children[i],e)},OrgChart.remote._toReqLayoutConfigsDTO=function(t){var e={};for(var r in t){var i=t[r];e[r]||(e[r]=[]),e[r][0]=i.orientation,e[r][1]=i.levelSeparation,e[r][2]=i.mixedHierarchyNodesSeparation,e[r][3]=i.subtreeSeparation,e[r][4]=i.siblingSeparation,e[r][5]=i.layout,e[r][6]=i.columns,e[r][7]=i.collapse,e[r][8]=i.assistantSeparation,e[r][9]=i.partnerNodeSeparation}return e},OrgChart.remote._convertToIdArray=function(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].id);return e},OrgChart.remote._setPositions=function(r,t,i,a){for(var e=[],n=[],o=OrgChart.remote._toReqLayoutConfigsDTO(t),l=0;l<r.length;l++)n.push(r[l].id),OrgChart.remote._toReqDTO(r[l],e);var s={n:e,c:o,r:n,v:"7.10.37"};if(OrgChart.LIMIT_NODES||(s.l=!0),null!=OrgChart.remote._fromReqDTO)OrgChart.remote._fromReqDTO(s.n,s.r,s.c,function(t){for(var e=0;e<r.length;e++)OrgChart.remote._fromResDTO(r[e],t,0,r,a);i()});else{s=JSON.stringify(s);var h=OrgChart.localStorage.getItem(s);h?OrgChart.remote._proceed(r,JSON.parse(h),a,i):OrgChart.remote._findRegion(function(t){OrgChart._ajax(t,"post",s,"json",function(t){t.error?i(2):(OrgChart.remote._proceed(r,t,a,i),OrgChart.localStorage.setItem(s,JSON.stringify(t)))})})}},OrgChart.remote._proceed=function(t,e,r,i){if("string"==typeof e&&(e=JSON.parse(e)),e.limit&&1==e.limit)i(e.limit);else{for(var a=0;a<t.length;a++)OrgChart.remote._fromResDTO(t[a],e,0,t,r);i()}},OrgChart.remote._findRegion=function(r){var t=OrgChart.localStorage.getItem("funcUrl");if(t)r(t);else{for(var i=["au-e","au-se","brs","ca","ca-e","easia","eus-2","eus","fr","ind","jp-e","jp-w","kr","n-eu","se-asia","s-ind","uk-s","uk-w","us","us-n-c","us-s-c","w-c-us","w-eu","w-ind","w-us-2","wus"],a=[],n=0;n<i.length;n++)a.push(new XMLHttpRequest);for(n=0;n<i.length;n++)!function(){var e="https://"+i[n]+"-balkangraph.azurewebsites.net/api/OrgChartJS",t=a[n];t.onreadystatechange=function(){if(4==this.readyState&&200==this.status){OrgChart.localStorage.setItem("funcUrl",e),r(e);for(var t=0;t<a.length;t++)a[t].abort()}},t.open("GET",e,!0),t.send()}()}},OrgChart.searchUI=function(){},OrgChart.searchUI.prototype.init=function(t){this.obj=t},OrgChart.searchUI.prototype.hide=function(){var t=this.obj.element.querySelector("["+OrgChart.attr.id+'="search"]');if(t){var e=t.querySelector("["+OrgChart.attr.id+'="cell-1"]'),r=this.obj.element.getElementsByTagName("input")[0],i=this.obj.element.querySelector("["+OrgChart.attr.id+'="container"]');r.value="",i.innerHTML="","none"!=e.style.display&&"none"!=t.style.display&&OrgChart.anim(e,{opacity:e.style.opacity},{opacity:0},200,OrgChart.anim.inOutSin,function(){e.style.display="none",OrgChart.anim(t,{width:300,opacity:1},{width:50,opacity:0},300,OrgChart.anim.inBack,function(){t.style.display="none"})})}},OrgChart.searchUI.prototype.show=function(t){var e=this.obj.element.querySelector("["+OrgChart.attr.id+'="search"]'),r=e.querySelector("["+OrgChart.attr.id+'="cell-1"]');r.style.display="none",e.style.width="50px",e.style.display="block",e.style.opacity=0,OrgChart.anim(e,{width:50,opacity:0},{width:300,opacity:1},300,OrgChart.anim.outBack,function(){r.style.display="inherit",r.style.opacity=0,OrgChart.anim(r,{opacity:0},{opacity:1},200,OrgChart.anim.inOutSin),t&&t()})},OrgChart.searchUI.prototype.addSearchControl=function(){var i=this,t=document.createElement("div");t.innerHTML=OrgChart.searchUI.createSearchIcon(this.obj.config.padding),t.innerHTML+=OrgChart.searchUI.createInputField(this.obj.config.padding),this.obj.element.appendChild(t);var e=this.obj.element.querySelector("["+OrgChart.attr.id+'="search-icon"]'),a=this.obj.element.querySelector("["+OrgChart.attr.id+'="search"]'),r=this.obj.element.getElementsByTagName("input")[0];e.addEventListener("mouseover",function(){i.show()}),a.addEventListener("mouseleave",function(){document.activeElement!=r&&i.hide()}),a.addEventListener("click",function(){r.focus()}),r.addEventListener("keypress",function(t){13==t.keyCode&&t.preventDefault()}),r.addEventListener("keyup",function(t){40==t.keyCode?n():38==t.keyCode?o():13==t.keyCode?l():27==t.keyCode?i.hide():i._serverSearch(this.value)});var n=function(){var t=a.querySelectorAll("["+OrgChart.attr.search_item_id+"]"),e=a.querySelector('[data-selected="yes"]');null==e&&0<t.length?(t[0].setAttribute("data-selected","yes"),t[0].style.backgroundColor="#F0F0F0"):0<t.length&&e.nextSibling&&(e.setAttribute("data-selected","no"),e.style.backgroundColor="inherit",e.nextSibling.setAttribute("data-selected","yes"),e.nextSibling.style.backgroundColor="#F0F0F0")},o=function(){var t=a.querySelectorAll("["+OrgChart.attr.search_item_id+"]"),e=a.querySelector('[data-selected="yes"]');null==e&&0<t.length?(t[t.length-1].setAttribute("data-selected","yes"),t[t.length-1].style.backgroundColor="#F0F0F0"):0<t.length&&e.previousSibling&&(e.setAttribute("data-selected","no"),e.style.backgroundColor="inherit",e.previousSibling.setAttribute("data-selected","yes"),e.previousSibling.style.backgroundColor="#F0F0F0")},l=function(){var t=a.querySelector('[data-selected="yes"]');if(t){var e=t.getAttribute(OrgChart.attr.search_item_id),r=OrgChart.events.publish("searchclick",[i.obj,e]);null!=r&&1!=r||i.obj.center(e)}}},OrgChart.searchUI.prototype.find=function(e){var r=this;this.show(function(){var t=r.obj.element.getElementsByTagName("input")[0];t.value=e,r._serverSearch(e),t.focus()})},OrgChart.searchUI.prototype._serverSearch=function(t){for(var e=this,r=this.obj.element.querySelector("["+OrgChart.attr.id+'="container"]'),i=this.obj.element.querySelector("["+OrgChart.attr.id+'="search"]'),a=OrgChart._search.search(this.obj.config.nodes,t,this.obj.config.searchFields,this.obj.config.searchFields,this.obj.config.searchDisplayField,this.obj.config.searchFieldsWeight),n=OrgChart._getFistImgField(this.obj.config),o="",l=0;l<a.length&&!(l>=OrgChart.SEARCH_RESULT_LIMIT);l++){var s=a[l],h="";if(n){var d=this.obj._get(s.id);"function"==typeof n?h=n(this.obj,this.obj.getNode(s.id),d):d[n]&&(h=d[n]),h&&(h='<img style="padding: 2px 0px 2px 7px;width:32px;height:32px;" src="'+h+'" / >')}var c="",g="";this.obj.config.searchDisplayField==s.__searchField?c=s.__searchMarks:this.obj.config.searchDisplayField?(c=s[this.obj.config.searchDisplayField],OrgChart.isNullOrEmpty(c)&&(c=""),g=s.__searchMarks):c=s.__searchMarks,o+=OrgChart.searchUI.createItem(h,s.id,c,g)}r.innerHTML=o;var p=i.querySelectorAll("["+OrgChart.attr.search_item_id+"]");for(l=0;l<p.length;l++)p[l].addEventListener("click",function(){var t=OrgChart.events.publish("searchclick",[e.obj,this.getAttribute(OrgChart.attr.search_item_id)]);null!=t&&1!=t||e.obj.center(this.getAttribute(OrgChart.attr.search_item_id))}),p[l].addEventListener("mouseover",function(){this.setAttribute("data-selected","yes"),this.style.backgroundColor="#F0F0F0"}),p[l].addEventListener("mouseleave",function(){this.style.backgroundColor="inherit",this.setAttribute("data-selected","no")})},OrgChart.searchUI.createInputField=function(t){return"<div "+OrgChart.attr.id+'="search" style="display:none;border-radius: 20px 20px;padding:5px; box-shadow: #808080 0px 1px 2px 0px; font-family:Roboto-Regular, Helvetica;color:#7a7a7a;font-size:14px;border:1px solid #d7d7d7;width:300px;position:absolute;top:'+t+"px;left:"+t+'px;background-color:#ffffff;"><div><div style="float:left;">'+OrgChart.icon.search(32,32,"#757575")+"</div><div "+OrgChart.attr.id+'="cell-1" style="float:right; width:83%"><input title="'+OrgChart.SEARCH_PLACEHOLDER+'" placeholder="'+OrgChart.SEARCH_PLACEHOLDER+'" style="font-size:14px;font-family:Roboto-Regular, Helvetica;color:#7a7a7a;width:98%;border:none;outline:none; padding-top:10px;" type="text" /></div><div style="clear:both;"></div></div><div '+OrgChart.attr.id+'="container"></div></div>'},OrgChart.searchUI.createItem=function(t,e,r,i){return"<div "+OrgChart.attr.search_item_id+'="'+e+'" style="border-top:1px solid #d7d7d7; padding: 7px 0 7px 0;cursor:pointer;"><div style="float:left;">'+t+'</div><div style="float:right; width:83%"><div style="overflow:hidden; white-space: nowrap;text-overflow:ellipsis;text-align:left;">'+r+'</div><div style="overflow:hidden; white-space: nowrap;text-overflow:ellipsis;text-align:left;">'+i+'</div></div><div style="clear:both;"></div></div>'},OrgChart.searchUI.createSearchIcon=function(t){return"<div "+OrgChart.attr.id+'="search-icon" style="padding:5px; position:absolute;top:'+t+"px;left:"+t+'px;border:1px solid transparent;"><div><div style="float:left;">'+OrgChart.icon.search(32,32,"#757575")+"</div></div></div>"},void 0===OrgChart&&(OrgChart={}),OrgChart.server=function(t,e){this.config=t,this.layoutConfigs=e,this.visibleNodeIds=[],this.viewBox=null,this.action=null,this.actionParams=null,this.nodes={},this.oldNodes={},this.maxX=null,this.maxY=null,this.minX=null,this.minY=null,this.bordersByRootIdAndLevel=null,this.roots=null,this.state=null,this.vbIsInitializedFromState=!1},OrgChart.server.prototype.read=function(h,d,c,g,p,f,u,C){var m=this;OrgChart.state._get(this.config.state,d,c,function(t){m.state=t,m.action=p,m.actionParams=f,p!=OrgChart.action.init||!m.state||f&&f.method&&"fit"==f.method?(m.viewBox=g,m.vbIsInitializedFromState=!1):(m.viewBox=m.state.vb,m.vbIsInitializedFromState=!0);var r=m.maxX,i=m.maxY,a=m.minX,n=m.minY,o=m.bordersByRootIdAndLevel,l=m.roots,s=m.nodes;if(h){var e=OrgChart.server._getResponse(d,c,m.visibleNodeIds,m.config,r,i,a,n,m.viewBox,l,m.action,m.actionParams,s,m.oldNodes,m.vbIsInitializedFromState);p!=OrgChart.action.exporting&&(m.maxX=r,m.maxY=i,m.minX=a,m.minY=n,m.roots=l,m.nodes=s,m.visibleNodeIds=e.visibleNodeIds),e.bordersByRootIdAndLevel=o,e.roots=l,e.adjustify={x:0,y:0},m.state&&(e.adjustify=m.state.adjustify),u(e)}else m.oldNodes=s||null,m._read(function(t){r=t.maxX,i=t.maxY,a=t.minX,n=t.minY,o=t.bordersByRootIdAndLevel,l=t.roots,s=t.nodes;var e=OrgChart.server._getResponse(d,c,m.visibleNodeIds,m.config,r,i,a,n,m.viewBox,l,m.action,m.actionParams,s,m.oldNodes,m.vbIsInitializedFromState);e.notif=t.limit,e.roots=l,e.bordersByRootIdAndLevel=o,e.adjustify=t.adjustify,p!=OrgChart.action.exporting&&(m.maxX=r,m.maxY=i,m.minX=a,m.minY=n,m.roots=l,m.nodes=s,m.visibleNodeIds=e.visibleNodeIds,m.bordersByRootIdAndLevel=o),u(e)},C)})},OrgChart.server.prototype._read=function(n,t){var o=this,e=OrgChart.server._createNodes(o.config,o.layoutConfigs,o.action,o.actionParams,o.oldNodes,o.state);t(e);var l=e.nodes,s=e.roots,r=OrgChart.remote;null==r&&(r=OrgChart.local),r._setPositions(s,o.layoutConfigs,function(t){var e=OrgChart.server._doNotChangePositionOfClickedNodeIfAny(s,l,o.action,o.actionParams,o.oldNodes,o.config.orientation);o.state&&o.action==OrgChart.action.init&&(e=o.state.adjustify);for(var r={minX:null,minY:null,maxX:null,maxY:null},i={},a=0;a<s.length;a++)OrgChart.server._setMinMaxXYAdjustifyIterate(s[a],s[a],r,0,i,e,o.config.orientation);n({minX:r.minX,minY:r.minY,maxX:r.maxX,maxY:r.maxY,bordersByRootIdAndLevel:i,nodes:l,roots:s,limit:t,adjustify:e})},l)},void 0===OrgChart&&(OrgChart={}),OrgChart.server._initDinamicNode=function(t,e,r){e&&(t.lcn=e),r&&(t.isAssistant=!0);var i=OrgChart.t(t.templateName);t.w=i&&i.size?i.size[0]:0,t.h=i&&i.size?i.size[1]:0,t.isSplit="split"==t.templateName},OrgChart.server._setCollpasedProperty=function(t,e,r,i,a,n,o){null==t.collapsed&&e.collapse&&e.collapse.allChildren?t.collapsed=!0:null==t.collapsed&&(t.collapsed=!1),a==OrgChart.action.expand&&-1!=r.ids.indexOf(t.id)&&(t.collapsed=!1),a==OrgChart.action.collapse&&(r.expandIds||r.collapseIds)?r.expandIds&&-1!=r.expandIds.indexOf(t.id)?t.collapsed=!1:r.collapseIds&&-1!=r.collapseIds.indexOf(t.id)&&(t.collapsed=!0):a==OrgChart.action.collapse&&-1!=r.ids.indexOf(t.id)&&(t.collapsed=!0),a==OrgChart.action.expand&&"all"==r.ids&&(t.collapsed=!1),a==OrgChart.action.exporting&&r.expandChildren&&(t.collapsed=!1),a==OrgChart.action.init&&null!=o?t.collapsed=!o.exp.has(t.id):a==OrgChart.action.init?t.collapsed=e.collapse&&n>=e.collapse.level-1&&-1==i.indexOf(t.id):a!=OrgChart.action.centerNode&&a!=OrgChart.action.insert||-1!=i.indexOf(t.id)&&(t.collapsed=!1)},OrgChart.server._initNode=function(t,e,r,i,a,n,o,l,s,h,d){var c=n[r||"base"];null==t.parent&&OrgChart.server._setCollpasedProperty(t,c,s,l,a,i-1,d);for(var g=0;g<t.childrenIds.length;g++){var p=e[t.childrenIds[g]];OrgChart.server._setCollpasedProperty(p,c,s,l,a,i,d),p.collapsed||(p.parent=t,-1==p.tags.indexOf("left-partner")&&-1==p.tags.indexOf("right-partner")&&-1==p.tags.indexOf("partner")&&null==p.ppid||-1==h.indexOf(t.id)&&h.push(t.id),t.children.push(p))}if(t.min||a!=OrgChart.action.minimize||s.id!=t.id||(t.min=!0),!0===t.min&&a==OrgChart.action.maximize&&s.id==t.id&&(t.min=!1),a==OrgChart.action.init&&null!=d&&(t.min=d.min.has(t.id)),!t.min)for(g=0;g<t.stChildrenIds.length;g++){((p=e[t.stChildrenIds[g]]).stParent=t).stChildren.push(p)}var f=OrgChart.t(t.templateName,t.min);t.w=f&&f.size?f.size[0]:0,t.h=f&&f.size?f.size[1]:0,t.padding=f&&f.padding?f.padding:[0,0,0,0],null!=i&&(t.level=i),r&&(t.lcn=r);var u=OrgChart._getSubLevels(t.tags,o.tags);0<u&&(t.subLevels=u),-1!=t.tags.indexOf("assistant")&&null!=t.parent&&(t.isAssistant=!0),OrgChart.events.publish("node-created",[t])},OrgChart.server._iterate=function(t,e,r,i,a,n,o,l,s,h,d,c,g,p,f,u){if(OrgChart.server._initNode(e,r,s,i,c,h,d,g,p,f,u),e.isAssistant&&(n[e.pid]||(n[e.pid]=[]),n[e.pid].push(e.id)),0<e.subLevels&&o.push(e.id),OrgChart.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN&&!e.isAssistant&&e.parent){if(e.parent&&e.parent.children.length&&e.parent.children[e.parent.children.length-1]==e){for(var C=[],m=0,O=0,y=0;y<e.parent.children.length;y++){-1==(v=e.parent.children[y]).tags.indexOf("partner")&&-1==v.tags.indexOf("left-partner")&&-1==v.tags.indexOf("right-partner")&&-1==v.tags.indexOf("assistant")&&0==v.children.length?C.push(v.id):-1!=v.tags.indexOf("assistant")?m++:-1==v.tags.indexOf("partner")&&-1==v.tags.indexOf("left-partner")&&-1==v.tags.indexOf("right-partner")||O++}OrgChart.MIXED_LAYOUT_ALL_NODES&&1<C.length&&C.length==e.parent.children.length-m-O?l[e.pid]=C:!OrgChart.MIXED_LAYOUT_ALL_NODES&&1<C.length&&(l[e.pid]=C)}}else if(!e.isAssistant&&0==e.childrenIds.length&&e.parent&&!l[e.pid]){for(C=[],m=0,O=0,y=0;y<e.parent.children.length;y++){var v;-1==(v=e.parent.children[y]).tags.indexOf("partner")&&-1==v.tags.indexOf("left-partner")&&-1==v.tags.indexOf("right-partner")&&-1==v.tags.indexOf("assistant")&&0==v.childrenIds.length?C.push(v.id):-1!=v.tags.indexOf("assistant")?m++:-1==v.tags.indexOf("partner")&&-1==v.tags.indexOf("left-partner")&&-1==v.tags.indexOf("right-partner")||O++}OrgChart.MIXED_LAYOUT_ALL_NODES&&1<C.length&&C.length==e.parent.childrenIds.length-m-O?l[e.pid]=C:!OrgChart.MIXED_LAYOUT_ALL_NODES&&1<C.length&&(l[e.pid]=C)}e.stChildren.length&&(t.stContainerNodes||(t.stContainerNodes=[]),t.stContainerNodes.push(e));for(var x=0;x<e.stChildren.length;x++){var b="";for(y=0;y<e.tags.length;y++)if(h[e.tags[y]]){b=e.tags[y];break}a.push(e.stChildren[x].id),OrgChart.server._iterate(t,e.stChildren[x],r,0,a,n,o,l,b,h,d,c,g,p,f,u)}i++;for(x=0;x<e.children.length;x++)OrgChart.server._iterate(t,e.children[x],r,i,a,n,o,l,s,h,d,c,g,p,f,u)},OrgChart.server._createNodes=function(a,t,e,r,i,n){for(var o=a.nodes,l={},s=[],h=[],d=0;d<o.length;d++){var c,g=o[d];c=OrgChart.STRING_TAGS?g.tags?g.tags.split(","):[]:Array.isArray(g.tags)?g.tags.slice(0):[];var p=OrgChart._getTemplate(c,a.tags,a.template),f=new OrgChart.node(g.id,g.pid,c,p);null!=g.ppid&&(f.ppid=g.ppid),OrgChart.isNullOrEmpty(g.stpid)||(f.stpid=g.stpid),null!=a.orderBy&&(f.order=OrgChart.server._getOrderFieldValue(g,a.orderBy)),l[g.id]=f,s.push(g.id)}null!=a.orderBy&&s.sort(function(t,e){var r=l[t].order,i=l[e].order;return"number"==typeof r||"number"==typeof i?(null==r&&(r=-1),null==i&&(i=-1),a.orderBy.desc?i-r:r-i):"string"==typeof r||"string"==typeof i?(null==r&&(r=""),null==i&&(i=""),a.orderBy.desc?i.localeCompare(r):r.localeCompare(i)):void 0});for(d=0;d<s.length;d++){var u=s[d],f=l[u],C=i?i[u]:null,m=l[f.stpid],O=l[f.pid];if(m||(f.stpid=null),O||(f.pid=null),m){var y=i?i[m.id]:null;y&&(m.min=y.min),m.stChildrenIds.push(f.id)}else O?(C&&(f.collapsed=C.collapsed,f.min=C.min),O.childrenIds.push(f.id)):(C&&(f.collapsed=C.collapsed,f.min=C.min),h.push(f));e==OrgChart.action.init&&(f.min=OrgChart._getMin(f,a))}if(null!=a.roots){h=[];for(d=0;d<a.roots.length;d++){var v=l[a.roots[d]];if(v&&e==OrgChart.action.centerNode){for(var x=v;null!=x.pid||null!=x.stpid;)x=null==x.pid&&null!=x.stpid?l[x.stpid]:l[x.pid];for(var b=l[r.id];null!=b.pid||null!=b.stpid;)b=null==b.pid&&null!=b.stpid?l[b.stpid]:l[b.pid];x==b&&(v=x)}if(v){for(var _=!1,w=0;w<h.length;w++)if(h[w].id==v.id){_=!0;break}if(!_){if(!OrgChart.isNullOrEmpty(v.pid))-1<(X=(O=l[v.pid]).childrenIds.indexOf(v.id))&&O.childrenIds.splice(X,1);h.push(v)}}}a.roots=[];for(d=0;d<h.length;d++)a.roots.push(h[d].id)}e==OrgChart.action.exporting&&null!=r.id&&((f=l[r.id])&&(f.pid=null,h=[f]));var k=[];if(e==OrgChart.action.init&&a.expand&&a.expand.nodes&&null==n)for(d=0;d<a.expand.nodes.length;d++){f=l[a.expand.nodes[d]];for(!0===a.expand.allChildren&&OrgChart.server._addExpandedNodeIdsIterate(f,l,k);f;)k.push(f.id),null==f.pid&&null!=f.stpid?(f=l[f.stpid]).min=!1:f=l[f.pid]}else if(e==OrgChart.action.centerNode){for(var S=l[r.id];S;){if(k.push(S.id),r.options.parentState===OrgChart.COLLAPSE_PARENT_NEIGHBORS&&S)for(d=0;d<S.childrenIds.length;d++){(Y=l[S.childrenIds[d]]).collapsed=!0}null==S.pid&&null!=S.stpid?(S=l[S.stpid]).min=!1:S=l[S.pid]}S=l[r.id];if(r.options.childrenState===OrgChart.COLLAPSE_SUB_CHILDRENS)for(d=0;d<S.childrenIds.length;d++){(A=l[S.childrenIds[d]]).collapsed=!1;for(var I=0;I<A.childrenIds.length;I++){l[A.childrenIds[I]].collapsed=!0}}if(r.options.parentState===OrgChart.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED)if(O=l[S.pid])for(d=0;d<O.childrenIds.length;d++){var A;if((A=l[O.childrenIds[d]])!=S){A.collapsed=!1;for(I=0;I<A.childrenIds.length;I++){l[A.childrenIds[I]].collapsed=!0}}}}else if(e==OrgChart.action.insert)for(f=l[r.insertedNodeId];f;)k.push(f.id),null==f.pid&&null!=f.stpid?(f=l[f.stpid]).min=!1:f=l[f.pid];var E=[],M={},L=[],N={},T=[];for(d=0;d<h.length;d++)OrgChart.server._iterate(h[d],h[d],l,0,E,M,L,N,"",t,a,e,k,r,T,n);for(d=h.length-1;0<=d;d--)h[d].collapsed&&h.splice(d,1);for(d=0;d<T.length;d++){f=l[T[d]];var B=[],P=[],F=[],z={},U=0,H=0,j=0,R=[],D=[];for(I=0;I<f.children.length;I++){(Y=f.children[I]).isAssistant||(-1!=Y.tags.indexOf("right-partner")?(Y.isPartner=1,Y.children=[],P.push(Y.id)):-1!=Y.tags.indexOf("left-partner")?(Y.isPartner=2,Y.children=[],F.push(Y.id)):-1==Y.tags.indexOf("partner")||U%2?-1!=Y.tags.indexOf("partner")&&U%2?(Y.isPartner=2,Y.children=[],F.push(Y.id),U++):null!=Y.ppid?(z[Y.ppid]||(z[Y.ppid]=[]),z[Y.ppid].push(Y.id)):B.push(Y.id):(Y.isPartner=1,Y.children=[],P.push(Y.id),U++))}f.children=[];for(I=0;I<P.length;I++){var Y=l[P[I]];f.children.push(Y)}for(I=0;I<F.length;I++){Y=l[F[I]];f.children.push(Y)}for(I=F.length-1;0<=I;I--)if(z[F[I]])for(w=0;w<z[F[I]].length;w++)f.children.push(l[z[F[I]][w]]),H++,-1==D.indexOf(F[I])&&D.push(F[I]);for(I=0;I<B.length;I++){Y=l[B[I]];f.children.push(Y)}for(I=0;I<P.length;I++)if(z[P[I]])for(w=0;w<z[P[I]].length;w++)f.children.push(l[z[P[I]][w]]),j++,-1==R.indexOf(P[I])&&R.push(P[I]);f.partnerSeparation=Math.max(D.length,R.length)*a.partnerChildrenSplitSeparation+a.minPartnerSeparation,B.length||!H||j?B.length||H||!j?B.length||1!=H||1!=j?B.length||H||j?!B.length||H||j?B.length&&(H||j)?f.hasPartners=7:f.hasPartners=1:f.hasPartners=6:f.hasPartners=5:f.hasPartners=4:f.hasPartners=3:f.hasPartners=2}for(d=0;d<L.length;d++){if((nt=t[(f=l[L[d]]).lcn?f.lcn:"base"]).layout==OrgChart.normal||!N[f.pid])for(I=0;I<f.subLevels;I++){var X,q=new OrgChart.node(f.id+"_sub_level_index_"+I,f.pid,[],"subLevel");if(OrgChart.server._initDinamicNode(q,f.lcn),O=f.parent)-1<(X=O.children.indexOf(f))&&(O.children.splice(X,1),O.children.splice(X,0,q)),q.children.push(f),q.parent=O,f.parent=q,l[q.id]=q}}for(var V in M){(O=l[V]).hasAssistants=!0;q=new OrgChart.node(O.id+"_split_0",O.id,["assistant"],"split");OrgChart.server._initDinamicNode(q,O.lcn,!0),l[q.id]=q;var W=[];for(I=O.children.length-1;0<=I;I--){(Y=O.children[I]).isAssistant?(Y.parent=null,O.children.splice(I,1),W.splice(0,0,Y.id)):Y.isPartner||((Y.parent=q).children.unshift(Y),O.children.splice(I,1))}if(W.length%2){var G=l[W[W.length-1]],K=new OrgChart.node(G.id+"_mirror",G.pid,[],"mirror");OrgChart.server._initDinamicNode(K,G.lcn,!0),G._m=K.id,K.isAssistant=!0,K.w=G.w,K.h=G.h,l[K.id]=K,W.splice(W.length-1,0,K.id)}var J=1;for(I=W.length-1;0<=I;I--)if(I%2&&I!=W.length-1){var Z=new OrgChart.node(O.id+"_split_"+J,null,[],"split");OrgChart.server._initDinamicNode(Z,O.lcn,!0),l[Z.id]=Z,W.splice(I,0,Z.id),J++}else I%2&&W.splice(I,0,q.id);for(I=0;I<W.length;I+=3){var Q=null;Q=0==I?O:l[W[I-2]];var $=l[W[I]],tt=l[W[I+1]],et=l[W[I+2]];$.parent=Q,tt.parent=Q,(et.parent=Q).children.push($),Q.children.push(tt),Q.children.push(et)}}var rt=!1;for(var it in t){if((nt=t[it]).layout==OrgChart.mixed||nt.layout==OrgChart.tree||nt.layout==OrgChart.treeRightOffset||nt.layout==OrgChart.treeLeftOffset){rt=!0;break}}if(rt){var at={nodes:l,config:a,action:e,actionParams:r};for(var V in N){var nt;if((nt=t[(O=l[V]).lcn?O.lcn:"base"]).layout==OrgChart.mixed||nt.layout==OrgChart.tree||nt.layout==OrgChart.treeRightOffset||nt.layout==OrgChart.treeLeftOffset)if(at.pnode=O,at.layout=nt.layout,at.childrenIds=N[V],at.lastChildrenPidIds=N,OrgChart.events.publish("layout",[at]),at.layout==OrgChart.mixed){var ot=at.childrenIds;for(d=ot.length-1;0<=d;d--){O=(Y=l[ot[d]]).parent,Y.layout=OrgChart.mixed;for(I=O.children.length-1;0<=I;I--)if(Y.id==O.children[I].id){O.children.splice(I,1);break}if(0<d){var lt=l[ot[d-1]];Y.parent=lt,Y.layout=OrgChart.mixed,lt.children.push(Y)}else O.children.push(Y)}}else if(at.layout==OrgChart.tree||at.layout==OrgChart.treeRightOffset||at.layout==OrgChart.treeLeftOffset){q=new OrgChart.node(O.id+"_split_0",O.id,[],"split");OrgChart.server._initDinamicNode(q,O.lcn),(l[q.id]=q).layout=OrgChart.tree;var st=[];for(d=at.childrenIds.length-1;0<=d;d--){for(Y=l[at.childrenIds[d]],I=0;I<O.children.length;I++)O.children[I].id==Y.id&&O.children.splice(I,1);if(Y.parent=null,Y.layout=OrgChart.tree,at.layout==OrgChart.treeRightOffset&&st.splice(0,0,Y.id),at.layout==OrgChart.treeLeftOffset||at.layout==OrgChart.treeRightOffset){var ht=new OrgChart.node(Y.id+"_mirror",null,[],"mirror");OrgChart.server._initDinamicNode(ht,Y.lcn),ht.layout=OrgChart.tree,l[ht.id]=ht,st.splice(0,0,ht.id)}at.layout!=OrgChart.treeRightOffset&&st.splice(0,0,Y.id)}for(J=1,I=st.length-1;0<=I;I--)if(I%2&&I!=st.length-1){Z=new OrgChart.node(O.id+"_split_"+J,null,[],"split");OrgChart.server._initDinamicNode(Z,O.lcn),Z.layout=OrgChart.tree,l[Z.id]=Z,st.splice(I,0,Z.id),J++}else I%2&&st.splice(I,0,q.id);for(I=0;I<st.length;I+=3){Q=null;0==I&&(Q=O);$=l[st[I]],tt=l[st[I+1]],et=l[st[I+2]];0!=I&&(Q=l[st[I-3]]),0==I||tt||(Q=l[st[I-2]]),($.parent=Q).children.push($),tt&&(0!=I&&(Q=l[st[I-2]]),(tt.parent=Q).children.push(tt)),et&&(0!=I&&(Q=l[st[I-1]]),(et.parent=Q).children.push(et))}}}}return{nodes:l,roots:h}},OrgChart.server._getOrderFieldValue=function(t,e){var r=e;return e.field&&(r=e.field),t[r]},OrgChart.server._getNodeWidth=function(t,e){switch(e.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:return t.w;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:return t.h}return 0},OrgChart.server._isVisible=function(t,e,r,i){if(null!=t.x&&null!=t.y){if(e.lazyLoading&&i!==OrgChart.action.exporting){function a(t,e){var r=t.x,i=t.y,a=t.w,n=t.h,o=e[0]-OrgChart.LAZY_LOADING_FACTOR,l=e[2]+OrgChart.LAZY_LOADING_FACTOR+e[0],s=e[1]-OrgChart.LAZY_LOADING_FACTOR,h=e[3]+OrgChart.LAZY_LOADING_FACTOR+e[1],d=o<r+a&&r<l;return d&&(d=s<i+n&&i<h),d}if(a(t,r))return!0;for(var n=0;n<t.children.length;n++)if(a(t.children[n],r))return!0;return!1}return!0}},OrgChart.server.getAllFields=function(t){var e=[OrgChart.TAGS];for(var r in t.nodeBinding)e.push(t.nodeBinding[r]);for(r=0;r<t.nodes.length;r++)for(var i in t.nodes[r])i!==OrgChart.ID&&i!==OrgChart.TAGS&&i!==OrgChart.NODES&&i!==OrgChart.PID&&i!==OrgChart.STPID&&(t.nodeBinding[i]||OrgChart._arrayContains(e,i)||e.push(i));return e},OrgChart.server._getMostDeepChild=function(t){if(t){var i=t;return function t(e){e.sl>i.sl&&(i=e);for(var r=0;r<e.children.length;r++)t(e.children[r])}(t),i}},OrgChart.server._getResponse=function(t,e,r,i,a,n,o,l,s,h,d,c,g,p,f){var u=h[0],C=[],m={top:null,left:null,bottom:null,right:null,minX:null,maxX:null,minY:null,maxY:null},O=[[],[],[]],y=a-o+2*i.padding,v=n-l+2*i.padding,x=OrgChart.getScale(s,t,e,i.scaleInitial,i.scaleMax,i.scaleMin,y,v);if(m.top=l-i.padding,m.left=o-i.padding,m.bottom=n+i.padding-e/x,m.right=a+i.padding-t/x,m.maxX=a,m.minX=o,m.maxY=n,m.minY=l,0==h.length||null==s&&!f&&i.align==OrgChart.CENTER){var b=Math.ceil(t/x),_=Math.ceil(e/x),w=0,k=0;if(b-2*i.padding>=a-o)switch(w=(a+o)/2-b/2,i.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:w=(o-a)/2-b/2}else switch(w=u.x-b/2+OrgChart.server._getNodeWidth(u,i)/2,i.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:(w=-(b/2-(o-a)/2))<i.padding-b&&(w=i.padding-b);break;case OrgChart.orientation.left:case OrgChart.orientation.bottom_left:case OrgChart.orientation.top_left:case OrgChart.orientation.left_top:(w=-(b/2-(a-o)/2))>-i.padding&&(w=-i.padding)}if(_-2*i.padding>=n-l)switch(k=(n+l)/2-_/2,i.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:k=(l-n)/2-_/2}else switch((k=-(_/2-(n-l)/2))>-i.padding&&(k=-i.padding),i.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:(k=-(_/2-(l-n)/2))<i.padding-_&&(k=i.padding-_);break;case OrgChart.orientation.left:case OrgChart.orientation.right:k=u.y-_/2+OrgChart.server._getNodeWidth(u,i)/2}s=[w,k,b,_]}else if(null==s&&!f&&i.align==OrgChart.ORIENTATION){b=Math.ceil(t/x),_=Math.ceil(e/x),w=0,k=0;switch(i.orientation){case OrgChart.orientation.top:w=u.x-b/2+OrgChart.server._getNodeWidth(u,i)/2,k=-i.padding;break;case OrgChart.orientation.bottom:w=u.x-b/2+OrgChart.server._getNodeWidth(u,i)/2,k=i.padding-_;break;case OrgChart.orientation.left:w=-i.padding,k=u.y-_/2+OrgChart.server._getNodeWidth(u,i)/2;break;case OrgChart.orientation.right:w=i.padding-b,k=u.y-_/2+OrgChart.server._getNodeWidth(u,i)/2;break;case OrgChart.orientation.top_left:w=-i.padding,k=-i.padding;break;case OrgChart.orientation.right_top:w=i.padding-b,k=-i.padding;break;case OrgChart.orientation.left_top:w=-i.padding,k=-i.padding;break;case OrgChart.orientation.bottom_left:w=-i.padding,k=i.padding-_}s=[w,k,b,_],i.sticky&&(s[0]<m.left&&s[0]<m.right&&(s[0]=m.left>m.right?m.right:m.left),s[0]>m.right&&s[0]>m.left&&(s[0]=m.left>m.right?m.left:m.right),s[1]<m.top&&s[1]<m.bottom&&(s[1]=m.top>m.bottom?m.bottom:m.top),s[1]>m.bottom&&s[1]>m.top&&(s[1]=m.top>m.bottom?m.top:m.bottom))}if(d==OrgChart.action.centerNode||d==OrgChart.action.maximize){var S=g[c.id];1==c.options.horizontal&&(s[0]=S.x+S.w/2-s[2]/2),1==c.options.vertical&&(s[1]=S.y+S.h/2-s[3]/2),i.sticky&&(s[0]<m.left&&s[0]<m.right&&(s[0]=m.left>m.right?m.right:m.left),s[0]>m.right&&s[0]>m.left&&(s[0]=m.left>m.right?m.left:m.right),s[1]<m.top&&s[1]<m.bottom&&(s[1]=m.top>m.bottom?m.bottom:m.top),s[1]>m.bottom&&s[1]>m.top&&(s[1]=m.top>m.bottom?m.top:m.bottom))}if(d==OrgChart.action.insert||d==OrgChart.action.expand||d==OrgChart.action.collapse||d==OrgChart.action.update||d==OrgChart.action.centerNode||d==OrgChart.action.maximize){var I=null;if(d==OrgChart.action.insert&&c&&null!=c.insertedNodeId&&null!=c.insertedNodeId)I=g[c.insertedNodeId];else if(d==OrgChart.action.update&&c&&null!=c.visId&&null!=c.visId)I=g[c.visId];else if(d!=OrgChart.action.expand&&d!=OrgChart.action.collapse&&d!=OrgChart.action.maximize||!c||null==c.id||null==c.id){if(d==OrgChart.action.centerNode||d==OrgChart.action.maximize){switch(i.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:c.options.vertical||(I=g[c.id]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:c.options.horizontal||(I=g[c.id])}I&&(I=OrgChart.server._getMostDeepChild(I,g))}}else I=g[c.id],I=OrgChart.server._getMostDeepChild(I,g);if(!OrgChart.FIXED_POSITION_ON_CLICK&&I)switch(i.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:var A=I.y+I.h-s[3]+i.padding;s[1]<A&&(s[1]=A);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:A=I.y-i.padding;s[1]>A&&(s[1]=A);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:A=I.x-i.padding;s[0]>A&&(s[0]=A);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:A=I.x+I.w-s[2]+i.padding;s[0]<A&&(s[0]=A)}}for(var E=0;E<h.length;E++)OrgChart.server._iterate2(h[E],g,i,s,d,c,C,p,r,O);return{animations:O,boundary:m,viewBox:s,visibleNodeIds:C,nodes:g,allFields:OrgChart.server.getAllFields(i)}},OrgChart.server._iterate2=function(t,e,r,i,a,n,o,l,s,h){if(OrgChart.server._isVisible(t,r,i,a)){o.push(t.id);var d=null;if((a==OrgChart.action.expand||a==OrgChart.action.collapse||a==OrgChart.action.maximize)&&l&&l[t.id]&&"expandCollapseToLevel"==n.method){if(d={x:(u=l[t.id]).x,y:u.y},u){d={x:u.x,y:u.y};for(var c=t,g=null;null!=c;)l[c.id]&&l[c.id].collapsed&&(g=c),c=c.parent;g&&g.parent&&(d={x:g.parent.x,y:g.parent.y})}if(p=e[n.id]){for(c=t.parent;null!=c;)c=c.parent;c&&(d={x:p.x+p.w/2-t.w/2,y:p.y+p.h/2-t.h/2})}}else if((a==OrgChart.action.expand||a==OrgChart.action.collapse)&&l&&l[t.id]){var p;if(d={x:(u=l[t.id]).x,y:u.y},"all"==n.ids&&u){d={x:u.x,y:u.y};for(c=t,g=null;null!=c;)l[c.id]&&l[c.id].collapsed&&(g=c),c=c.parent;g&&g.parent&&(d={x:g.parent.x,y:g.parent.y})}if(p=e[n.id]){for(c=t.parent;null!=c&&-1==n.ids.indexOf(t.id)&&-1==n.ids.indexOf(c.id);)c=c.parent;c&&(d={x:p.x+p.w/2-t.w/2,y:p.y+p.h/2-t.h/2})}}else if(a==OrgChart.action.centerNode&&l&&l[t.id]){if(null!=(u=l[t.id]).x&&null!=u.y&&(d={x:u.x,y:u.y}),(f=e[n.id])&&f==t)(c=t.parent)&&c.id==n.id&&(d={x:f.x+f.w/2-t.w/2,y:f.y+f.h/2-t.h/2})}else if(a==OrgChart.action.maximize&&l&&l[t.id]){var f;if(null!=(u=l[t.id]).x&&null!=u.y&&(d={x:u.x,y:u.y}),(f=e[n.id])&&f==t)(c=t.parent)&&c.id==n.id&&(d={x:f.x+f.w/2-t.w/2,y:f.y+f.h/2-t.h/2})}else if(a==OrgChart.action.minimize&&l&&l[t.id]){d={x:(u=l[t.id]).x,y:u.y}}else if(a==OrgChart.action.insert&&n&&n.insertedNodeId==t.id&&t.parent)d={x:t.parent.x,y:t.parent.y};else if((a==OrgChart.action.update||a==OrgChart.action.insert)&&l&&l[t.id]){var u;d={x:(u=l[t.id]).x,y:u.y}}else a!==OrgChart.action.exporting&&a!==OrgChart.action.init&&-1==s.indexOf(t.id)&&(h[0].push(t.id),h[1].push({opacity:0}),h[2].push({opacity:1}));null!=d&&null!=d.x&&null!=d.y&&(d.x==t.x&&d.y==t.y||(h[0].push(t.id),h[1].push({transform:[1,0,0,1,d.x,d.y]}),h[2].push({transform:[1,0,0,1,t.x,t.y]})))}for(var C=0;C<t.stChildren.length;C++)OrgChart.server._iterate2(t.stChildren[C],e,r,i,a,n,o,l,s,h);for(C=0;C<t.children.length;C++)OrgChart.server._iterate2(t.children[C],e,r,i,a,n,o,l,s,h)},OrgChart.server._addExpandedNodeIdsIterate=function(t,e,r){for(var i=0;i<t.childrenIds.length;i++)r.push(t.childrenIds[i]),OrgChart.server._addExpandedNodeIdsIterate(e[t.childrenIds[i]],e,r)},OrgChart.server._setMinMaxXYAdjustifyIterate=function(t,e,r,i,a,n,o){switch(o){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:t.x+=n.x;break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:t.y+=n.y}OrgChart._setMinMaxXY(t,r);for(var l=0;l<t.stChildren.length;l++)OrgChart.server._setMinMaxXYAdjustifyIterate(t.stChildren[l],t.stChildren[l],r,0,a,n,o);t.isPartner?t.sl=i-1:t.sl=i,null==a[e.id]&&(a[e.id]={}),null==a[e.id][t.sl]&&(a[e.id][t.sl]={minX:null,minY:null,maxX:null,maxY:null}),t.layout||OrgChart._setMinMaxXY(t,a[e.id][t.sl]),i++;for(l=0;l<t.children.length;l++)OrgChart.server._setMinMaxXYAdjustifyIterate(t.children[l],e,r,i,a,n,o)},OrgChart.server._doNotChangePositionOfClickedNodeIfAny=function(t,e,r,i,a,n){if(r!=OrgChart.action.expand&&r!=OrgChart.action.collapse&&r!=OrgChart.action.minimize&&r!=OrgChart.action.maximize&&r!=OrgChart.action.centerNode&&r!=OrgChart.action.update&&r!=OrgChart.action.insert)return{x:0,y:0};if(r==OrgChart.action.update&&(!i||null==i.id)){if(!t||!t.length)return{x:0,y:0};i={id:t[0].id}}if(null==i.id)return{x:0,y:0};var o=i.id;(r==OrgChart.action.minimize&&e[o].parent||r==OrgChart.action.maximize&&e[o].parent)&&(o=e[o].pid);var l=e[o],s=a[o];return s?{x:(s.x?s.x:0)-l.x,y:(s.y?s.y:0)-l.y}:{x:0,y:0}},void 0===OrgChart&&(OrgChart={}),OrgChart.templates={},OrgChart.templates.base={defs:"",size:[250,120],expandCollapseSize:30,linkAdjuster:{fromX:0,fromY:0,toX:0,toY:0},ripple:{radius:0,color:"#e6e6e6",rect:null},assistanseLink:'<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="2px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} {xd},{yd} L{xe},{ye}"/>',svg:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>',link:'<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} L{xd},{yd}"/>',pointer:'<g data-pointer="pointer" transform="matrix(0,0,0,0,100,100)"><radialGradient id="pointerGradient"><stop stop-color="#ffffff" offset="0" /><stop stop-color="#C1C1C1" offset="1" /></radialGradient><circle cx="16" cy="16" r="16" stroke-width="1" stroke="#acacac" fill="url(#pointerGradient)"></circle></g>',node:'<rect x="0" y="0" height="120" width="250" fill="none" stroke-width="1" stroke="#aeaeae"></rect>',plus:'<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#aeaeae"></line>',minus:'<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line>',nodeMenuButton:'<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>',exportMenuButton:'<div style="position:absolute;right:{p}px;top:{p}px; width:40px;height:50px;cursor:pointer;" '+OrgChart.attr.control_export_menu+'=""><hr style="background-color: #7A7A7A; height: 3px; border: none;"><hr style="background-color: #7A7A7A; height: 3px; border: none;"><hr style="background-color: #7A7A7A; height: 3px; border: none;"></div>',img_0:'<clipPath id="{randId}"><circle cx="60" cy="60" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="20" y="20" width="80" height="80"></image>',link_field_0:'<text text-anchor="middle" fill="#aeaeae" '+OrgChart.attr.width+'="290" x="0" y="0" style="font-size:10px;">{val}</text>'},OrgChart.templates.ana={defs:"",size:[250,120],linkAdjuster:{fromX:0,fromY:0,toX:0,toY:0},ripple:{radius:0,color:"#e6e6e6",rect:null},expandCollapseSize:30,svg:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>',link:'<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="{rounded}" />',assistanseLink:'<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="2px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} {xd},{yd} L{xe},{ye}"/>',pointer:'<g data-pointer="pointer" transform="matrix(0,0,0,0,100,100)"><radialGradient id="pointerGradient"><stop stop-color="#ffffff" offset="0" /><stop stop-color="#C1C1C1" offset="1" /></radialGradient><circle cx="16" cy="16" r="16" stroke-width="1" stroke="#acacac" fill="url(#pointerGradient)"></circle></g>',node:'<rect x="0" y="0" height="{h}" width="{w}" fill="#039BE5" stroke-width="1" stroke="#aeaeae" rx="5" ry="5"></rect>',plus:'<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#aeaeae"></line>',minus:'<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line>',nodeMenuButton:'<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>',exportMenuButton:'<div style="position:absolute;right:{p}px;top:{p}px; width:40px;height:50px;cursor:pointer;" '+OrgChart.attr.control_export_menu+'=""><hr style="background-color: #7A7A7A; height: 3px; border: none;"><hr style="background-color: #7A7A7A; height: 3px; border: none;"><hr style="background-color: #7A7A7A; height: 3px; border: none;"></div>',img_0:'<clipPath id="{randId}"><circle cx="50" cy="30" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="-10" width="80" height="80"></image>',link_field_0:'<text text-anchor="middle" fill="#aeaeae" '+OrgChart.attr.width+'="290" x="0" y="0" style="font-size:10px;">{val}</text>',field_0:"<text "+OrgChart.attr.width+'="230" style="font-size: 18px;" fill="#ffffff" x="125" y="95" text-anchor="middle">{val}</text>',field_1:"<text "+OrgChart.attr.width+'="130" '+OrgChart.attr.text_overflow+'="multiline" style="font-size: 14px;" fill="#ffffff" x="230" y="30" text-anchor="end">{val}</text>',padding:[50,20,35,20]},OrgChart.templates.split=Object.assign({},OrgChart.templates.ana),OrgChart.templates.split.size=[10,10],OrgChart.templates.split.node='<circle cx="5" cy="5" r="5" fill="none" stroke-width="1" stroke="#aeaeae"></circle>',OrgChart.templates.group=Object.assign({},OrgChart.templates.ana),OrgChart.templates.group.size=[250,120],OrgChart.templates.group.node='<rect rx="50" ry="50" x="0" y="0" height="{h}" width="{w}" fill="#f2f2f2" stroke-width="0"></rect>',OrgChart.templates.group.link='<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>',OrgChart.templates.group.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,{ew},25)" '+OrgChart.attr.control_node_menu_id+'="{id}"><g transform="matrix(1,0,0,1,-22,-8)"><rect x="0" y="0" fill="red" fill-opacity="0" width="18" height="22"></rect><line x1="0" y1="2" x2="9" y2="2" stroke="#aeaeae" stroke-width="1"></line><line x1="0" y1="9" x2="18" y2="9" stroke="#aeaeae" stroke-width="1"></line><line x1="0" y1="16" x2="22" y2="16" stroke="#aeaeae" stroke-width="1"></line></g></g>',OrgChart.templates.group.field_0="<text "+OrgChart.attr.width+'="230" style="font-size: 18px;" fill="#aeaeae" x="{cw}" y="30" text-anchor="middle">{val}</text>',OrgChart.templates.group.field_1="",OrgChart.templates.group.ripple={radius:50,color:"#aeaeae"},OrgChart.templates.invisibleGroup=Object.assign({},OrgChart.templates.group),OrgChart.templates.invisibleGroup.node="",OrgChart.templates.invisibleGroup.padding=[0,0,0,0],OrgChart.templates.invisibleGroup.field_0="",OrgChart.templates.invisibleGroup.nodeMenuButton="",OrgChart.templates.mirror={linkAdjuster:{},link:"",node:"",nodeMenuButton:"",size:[0,0]},OrgChart.templates.ula=Object.assign({},OrgChart.templates.ana),OrgChart.templates.ula.field_0="<text "+OrgChart.attr.width+'="145" style="font-size: 18px;" fill="#039BE5" x="100" y="55">{val}</text>',OrgChart.templates.ula.field_1="<text "+OrgChart.attr.width+'="145" '+OrgChart.attr.text_overflow+'="multiline" style="font-size: 14px;" fill="#afafaf" x="100" y="76">{val}</text>',OrgChart.templates.ula.node='<rect x="0" y="0" height="{h}" width="{w}" fill="#ffffff" stroke-width="1" stroke="#aeaeae"></rect><line x1="0" y1="0" x2="250" y2="0" stroke-width="2" stroke="#039BE5"></line>',OrgChart.templates.ula.img_0='<clipPath id="{randId}"><circle cx="50" cy="60" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="20" width="80" height="80" ></image>',OrgChart.templates.ula.menu='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,12)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#ffffff" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#039BE5"></circle><circle cx="7" cy="0" r="2" fill="#039BE5"></circle><circle cx="14" cy="0" r="2" fill="#039BE5"></circle></g>',OrgChart.templates.ula.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="7" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="14" cy="0" r="2" fill="#AEAEAE"></circle></g>',OrgChart.templates.olivia=Object.assign({},OrgChart.templates.ana),OrgChart.templates.olivia.field_0="<text "+OrgChart.attr.width+'="145" style="font-size: 18px;" fill="#757575" x="100" y="55">{val}</text>',OrgChart.templates.olivia.field_1="<text "+OrgChart.attr.width+'="145" style="font-size: 14px;" fill="#757575" x="100" y="76">{val}</text>',OrgChart.templates.olivia.defs='<linearGradient id="{randId}" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:#fff;stop-opacity:1" /><stop offset="100%" style="stop-color:#eee;stop-opacity:1" /></linearGradient>',OrgChart.templates.olivia.node='<rect fill="url(#{randId})" x="0" y="0" height="{h}" width="{w}" stroke-width="1" stroke="#aeaeae" rx="5" ry="5"></rect>',OrgChart.templates.olivia.img_0='<clipPath id="{randId}"><circle cx="50" cy="60" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="20" width="80" height="80" ></image>',OrgChart.templates.olivia.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="7" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="14" cy="0" r="2" fill="#AEAEAE"></circle></g>',OrgChart.templates.belinda=Object.assign({},OrgChart.templates.ana),OrgChart.templates.belinda.size=[180,180],OrgChart.templates.belinda.ripple={radius:90,color:"#e6e6e6",rect:null},OrgChart.templates.belinda.node='<circle cx="90" cy="90" r="90" fill="#039BE5" stroke-width="1" stroke="#aeaeae"></circle>',OrgChart.templates.belinda.img_0='<clipPath id="{randId}"><circle cx="90" cy="45" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="50" y="5" width="80" height="80" ></image>',OrgChart.templates.belinda.field_0="<text "+OrgChart.attr.width+'="170" style="font-size: 18px;" text-anchor="middle" fill="#ffffff" x="90" y="105">{val}</text>',OrgChart.templates.belinda.field_1="<text "+OrgChart.attr.width+'="160" style="font-size: 14px;" text-anchor="middle" fill="#ffffff" x="90" y="125">{val}</text>',OrgChart.templates.belinda.link='<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>',OrgChart.templates.belinda.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,79,5)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="0" y="0" fill="#000000" fill-opacity="0" width="22" height="22"></rect><line stroke-width="2" stroke="#000" x1="0" y1="3" x2="22" y2="3"></line><line stroke-width="2" stroke="#000" x1="0" y1="9" x2="22" y2="9"></line><line stroke-width="2" stroke="#000" x1="0" y1="15" x2="22" y2="15"></line></g>',OrgChart.templates.rony=Object.assign({},OrgChart.templates.ana),OrgChart.templates.rony.svg='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="background-color:#E8E8E8;display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>',OrgChart.templates.rony.defs='<filter id="{randId}" x="0" y="0" width="200%" height="200%"><feOffset result="offOut" in="SourceAlpha" dx="5" dy="5"></feOffset><feGaussianBlur result="blurOut" in="offOut" stdDeviation="5"></feGaussianBlur><feBlend in="SourceGraphic" in2="blurOut" mode="normal"></feBlend></filter>',OrgChart.templates.rony.size=[180,250],OrgChart.templates.rony.ripple={color:"#F57C00",radius:5,rect:null},OrgChart.templates.rony.img_0='<clipPath id="{randId}"><circle cx="90" cy="160" r="60"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="30" y="100" width="120" height="120"></image>',OrgChart.templates.rony.node='<rect filter="url(#{randId})" x="0" y="0" height="250" width="180" fill="#ffffff" stroke-width="0" rx="5" ry="5"></rect>',OrgChart.templates.rony.field_0="<text "+OrgChart.attr.width+'="165" style="font-size: 18px;" fill="#039BE5" x="90" y="40" text-anchor="middle">{val}</text>',OrgChart.templates.rony.field_1="<text "+OrgChart.attr.width+'="165" style="font-size: 14px;" fill="#F57C00" x="90" y="60" text-anchor="middle">{val}</text>',OrgChart.templates.rony.field_2="<text "+OrgChart.attr.width+'="165" style="font-size: 14px;" fill="#FFCA28" x="90" y="80" text-anchor="middle">{val}</text>',OrgChart.templates.rony.link='<path stroke="#039BE5" stroke-width="1px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} L{xd},{yd}"/>',OrgChart.templates.rony.plus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#039BE5" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#039BE5"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#039BE5"></line>',OrgChart.templates.rony.minus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#039BE5" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#039BE5"></line>',OrgChart.templates.rony.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,155,235)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#F57C00"></circle><circle cx="7" cy="0" r="2" fill="#F57C00"></circle><circle cx="14" cy="0" r="2" fill="#F57C00"></circle></g>',OrgChart.templates.mery=Object.assign({},OrgChart.templates.ana),OrgChart.templates.mery.ripple={color:"#e6e6e6",radius:50,rect:null},OrgChart.templates.mery.node='<rect x="0" y="0" height="120" width="250" fill="#ffffff" stroke-width="1" stroke="#686868" rx="50" ry="50"></rect><rect x="0" y="45" height="30" width="250" fill="#039BE5" stroke-width="1"></rect>',OrgChart.templates.mery.link='<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}" />',OrgChart.templates.mery.img_0='<clipPath id="{randId}"><circle cx="125" cy="60" r="24"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="95" y="33" width="60" height="60"></image>',OrgChart.templates.mery.field_0="<text "+OrgChart.attr.width+'="220" style="font-size: 18px;" fill="#039BE5" x="125" y="30" text-anchor="middle">{val}</text>',OrgChart.templates.mery.field_1="<text "+OrgChart.attr.width+'="220" style="font-size: 14px;" fill="#039BE5" x="125" y="100" text-anchor="middle">{val}</text>',OrgChart.templates.mery.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,60)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>',OrgChart.templates.polina=Object.assign({},OrgChart.templates.ana),OrgChart.templates.polina.size=[300,80],OrgChart.templates.polina.ripple={color:"#e6e6e6",radius:40,rect:null},OrgChart.templates.polina.node='<rect x="0" y="0" height="80" width="300" fill="#039BE5" stroke-width="1" stroke="#686868" rx="40" ry="40"></rect>',OrgChart.templates.polina.img_0='<clipPath id="{randId}"><circle cx="40" cy="40" r="35"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="0" y="0" width="80" height="80"></image>',OrgChart.templates.polina.field_0="<text "+OrgChart.attr.width+'="210" style="font-size: 18px;" fill="#ffffff" x="80" y="30" text-anchor="start">{val}</text>',OrgChart.templates.polina.field_1="<text "+OrgChart.attr.width+'="210" style="font-size: 14px;" fill="#ffffff" x="80" y="55" text-anchor="start">{val}</text>',OrgChart.templates.polina.link='<path stroke="#686868" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}" />',OrgChart.templates.polina.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,285,33)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="0" cy="7" r="2" fill="#ffffff"></circle><circle cx="0" cy="14" r="2" fill="#ffffff"></circle></g>',OrgChart.templates.mila=Object.assign({},OrgChart.templates.ana),OrgChart.templates.mila.node='<rect x="0" y="0" height="120" width="250" fill="#039BE5" stroke-width="1" stroke="#aeaeae"></rect><rect x="-5" y="70" height="30" width="260" fill="#ffffff" stroke-width="1" stroke="#039BE5"></rect><line x1="-5" x2="0" y1="100" y2="105" stroke-width="1" stroke="#039BE5"/><line x1="255" x2="250" y1="100" y2="105" stroke-width="1" stroke="#039BE5"/>',OrgChart.templates.mila.img_0='<image preserveAspectRatio="xMidYMid slice" xlink:href="{val}" x="20" y="5" width="64" height="64"></image>',OrgChart.templates.mila.field_0="<text "+OrgChart.attr.width+'="240" style="font-size: 18px;" fill="#039BE5" x="125" y="92" text-anchor="middle">{val}</text>',OrgChart.templates.mila.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,110)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>',OrgChart.templates.diva=Object.assign({},OrgChart.templates.ana),OrgChart.templates.diva.size=[200,170],OrgChart.templates.diva.node='<rect x="0" y="80" height="90" width="200" fill="#039BE5"></rect><circle cx="100" cy="50" fill="#ffffff" r="50" stroke="#039BE5" stroke-width="2"></circle>',OrgChart.templates.diva.img_0='<clipPath id="{randId}"><circle cx="100" cy="50" r="45"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="50" y="0" width="100" height="100"></image>',OrgChart.templates.diva.field_0="<text "+OrgChart.attr.width+'="185" style="font-size: 18px;" fill="#ffffff" x="100" y="125" text-anchor="middle">{val}</text>',OrgChart.templates.diva.field_1="<text "+OrgChart.attr.width+'="185" style="font-size: 14px;" fill="#ffffff" x="100" y="145" text-anchor="middle">{val}</text>',OrgChart.templates.diva.pointer='<g data-pointer="pointer" transform="matrix(0,0,0,0,100,100)"><radialGradient id="pointerGradient"><stop stop-color="#ffffff" offset="0" /><stop stop-color="#039BE5" offset="1" /></radialGradient><circle cx="16" cy="16" r="16" stroke-width="1" stroke="#acacac" fill="url(#pointerGradient)"></circle></g>',OrgChart.templates.diva.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,175,155)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>',OrgChart.templates.luba=Object.assign({},OrgChart.templates.ana),OrgChart.templates.luba.svg='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;background-color: #2E2E2E;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>',OrgChart.templates.luba.defs='<linearGradient id="{randId}" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:#646464;stop-opacity:1" /><stop offset="100%" style="stop-color:#363636;stop-opacity:1" /></linearGradient>',OrgChart.templates.luba.node='<rect fill="url(#{randId})" x="0" y="0" height="120" width="250" stroke-width="1" stroke="#aeaeae" rx="5" ry="5"></rect>',OrgChart.templates.luba.img_0='<clipPath id="{randId}"><circle cx="50" cy="25" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="-15" width="80" height="80"></image>',OrgChart.templates.luba.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#aeaeae"></circle><circle cx="7" cy="0" r="2" fill="#aeaeae"></circle><circle cx="14" cy="0" r="2" fill="#aeaeae"></circle></g>',OrgChart.templates.luba.field_0="<text "+OrgChart.attr.width+'="235" style="font-size: 18px;" fill="#aeaeae" x="125" y="90" text-anchor="middle">{val}</text>',OrgChart.templates.luba.field_1="<text "+OrgChart.attr.width+'="140" style="font-size: 14px;" fill="#aeaeae" x="240" y="30" text-anchor="end">{val}</text>',OrgChart.templates.luba.plus='<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect><line x1="4" y1="18" x2="32" y2="18" stroke-width="1" stroke="#aeaeae"></line><line x1="18" y1="4" x2="18" y2="32" stroke-width="1" stroke="#aeaeae"></line>',OrgChart.templates.luba.minus='<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect><line x1="4" y1="18" x2="32" y2="18" stroke-width="1" stroke="#aeaeae"></line>',OrgChart.templates.luba.expandCollapseSize=36,OrgChart.templates.derek=Object.assign({},OrgChart.templates.ana),OrgChart.templates.derek.link='<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>',OrgChart.templates.derek.field_0="<text "+OrgChart.attr.width+'="235" style="font-size: 24px;" fill="#aeaeae" x="125" y="90" text-anchor="middle">{val}</text>',OrgChart.templates.derek.field_1="<text "+OrgChart.attr.width+'="130" style="font-size: 16px;" fill="#aeaeae" x="230" y="30" text-anchor="end">{val}</text>',OrgChart.templates.derek.node='<rect x="0" y="0" height="120" width="250" fill="#ffffff" stroke-width="0" stroke="none" rx="5" ry="5"></rect><path d="M1.0464172536455116 0.43190469224125483 C53.84241668202045 -0.788936709486018, 103.41786516460891 -0.7020837047025514, 252.36637077877316 2.5880308844586395 M2.9051048929845287 1.416953777798454 C94.33574460557007 1.0012759229446266, 189.39715875173388 0.6456731199982935, 252.78978918302985 2.4201778360648074 M253.62699063660838 2.9193391477217157 C249.73034548542307 47.55931231380586, 252.87525930998083 91.26715478378368, 253.10179184315842 121.7440626272514 M251.37132919216776 1.8733470844542213 C252.2809675089866 32.73212950193807, 251.34402714677282 62.11470833534073, 251.87050951184997 121.58550827952904 M253.33945599552268 122.05611967964798 C171.36076589155192 123.47737863766969, 88.83808249906167 125.27259840604118, 3.1999393565128846 121.26868651191393 M252.26165120810887 122.5938901158243 C192.76996487394138 123.44664377223289, 131.37122563794998 122.94880221756583, 1.2373006891045732 121.88999197324904 M2.223863211672736 121.04511533445009 C1.4438124377596486 86.38398979211773, 2.8540468486809294 55.805566409478374, 3.8890451480896644 1.7483404843613926 M2.244347335490432 122.60147677858153 C2.100672267495622 92.31058899219087, 1.6261027388218166 64.160806803772, 1.6325734600065367 1.1945909353588222" stroke="#aeaeae" ></path>',OrgChart.templates.derek.defs=' <filter id="grayscale"><feColorMatrix type="matrix" values="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"/></filter>',OrgChart.templates.derek.img_0='<clipPath id="{randId}"><circle cx="60" cy="30" r="36"></circle></clipPath><path d="M59.27394950148486 -8.301766751084706 C67.69473471187919 -8.865443566034696, 80.29031463018414 -4.859224005049532, 87.18598909426663 0.33238763875740673 C94.08166355834912 5.523999282564345, 98.98110545022442 14.745947814116153, 100.64799628597981 22.847903111756924 C102.31488712173521 30.949858409397695, 101.71467046207992 41.576461864335656, 97.187334108799 48.944119424602036 C92.65999775551809 56.311776984868416, 82.03610997730354 64.08326918912249, 73.48397816629435 67.05384847335519 C64.93184635528516 70.02442775758789, 54.01035575000908 69.7708463163516, 45.874543242743854 66.76759512999827 C37.738730735478626 63.76434394364495, 29.04872278114092 56.18846598822666, 24.669103122702957 49.034341355235284 C20.289483464264993 41.88021672224391, 18.158053754175985 31.830144088547545, 19.596825292116065 23.84284733205002 C21.035596830056146 15.855550575552495, 25.795252700735308 6.49424361294595, 33.30173235034344 1.1105608162501355 C40.80821199995158 -4.273121980445679, 58.92971347412665 -7.0427741956040295, 64.63570318976488 -8.459249448124865 C70.34169290540312 -9.8757247006457, 67.62192977382313 -7.857597534262704, 67.53767064417285 -7.388290698874876 M62.748378255307365 -8.335850348284236 C71.26603403676657 -8.411982637093757, 83.3134559967999 -3.2332675886967737, 89.65944437868365 2.387927626929269 C96.00543276056739 8.00912284255531, 99.8018539626104 17.389209313563462, 100.82430854660979 25.39132094547202 C101.84676313060918 33.39343257738058, 100.69202080288338 43.23907526327184, 95.79417188267999 50.40059741838061 C90.8963229624766 57.56211957348938, 80.19607375493683 65.6933432424228, 71.43721502538948 68.36045387612462 C62.678356295842114 71.02756450982645, 51.31858275833087 70.03148525422704, 43.241019505395826 66.40326122059156 C35.16345625246078 62.775037186956084, 26.840434236544123 54.120081952867466, 22.971835507779204 46.59110967431175 C19.103236779014285 39.06213739575604, 17.94937086132579 28.992694575765086, 20.029427132806305 21.22942754925726 C22.10948340428682 13.466160522749433, 28.239699334668693 5.033316212766326, 35.452173136662296 0.011507515264803203 C42.6646469386559 -5.010301182236719, 59.029629541347575 -7.774813789367088, 63.30426994476793 -8.901424635751876 C67.57891034818829 -10.028035482136666, 61.20261013623477 -7.6019933587127815, 61.10001555718443 -6.748157563043929" style="stroke: #aeaeae; stroke-width: 2; fill: none;"></path><image filter="url(#grayscale)" preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="20" y="-10" width="80" height="80"></image>',OrgChart.templates.derek.minus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke-width="0"></circle><path d="M17.23891044927774 1.1814294501322902 C20.29160626452551 1.030769196657948, 23.947970993006972 3.1719335544839753, 26.394853759110717 5.588671983418923 C28.84173652521446 8.005410412353871, 31.246576051221126 12.511831935158815, 31.920207045900206 15.681860023741976 C32.593838040579286 18.85188811232514, 32.286699675240925 21.948848714186923, 30.436639727185195 24.60884051491789 C28.586579779129462 27.268832315648858, 24.05246578668338 30.675892912089505, 20.819847357565806 31.64181082812777 C17.58722892844823 32.60772874416604, 13.992479948405318 31.588687222722193, 11.040929152479746 30.404348011147484 C8.089378356554175 29.220008799572774, 4.476346434761303 27.363985211380037, 3.110542582012373 24.535775558679525 C1.7447387292634435 21.707565905979013, 2.0125141957866703 16.770753327135857, 2.8461060359861694 13.435090094944405 C3.6796978761856685 10.099426862752953, 4.99838568665378 6.33816589513267, 8.112093623209367 4.521796165530812 C11.225801559764953 2.7054264359289544, 18.764666760207586 2.8505106971937155, 21.528353655319687 2.5368717173332556 C24.29204055043179 2.2232327374727956, 24.87088035867136 2.534909813412478, 24.69421499388197 2.6399622863680516 M17.281640595209783 0.19007885243722633 C20.364244435145494 -0.11577004716725742, 25.135133405402318 3.2303746945812075, 27.855952721223584 5.7353294427454955 C30.57677203704485 8.240284190909783, 33.34617538156587 11.802005102645245, 33.606556490137386 15.219807341422953 C33.8669375987089 18.637609580200664, 31.337125602828454 23.632355493641384, 29.418239372652685 26.24214287541175 C27.499353142476917 28.85193025718212, 25.044077583504755 30.13224182494988, 22.093239109082777 30.87853163204516 C19.1424006346608 31.62482143914044, 14.787723024669972 31.933646092018286, 11.713208526120809 30.719881717983426 C8.638694027571646 29.506117343948567, 5.1333408130933655 26.55826769548724, 3.6461521177877945 23.595945387835997 C2.1589634224822234 20.633623080184755, 1.9785010696309286 16.25773192692332, 2.7900763542873843 12.945947872075987 C3.60165163894384 9.634163817228652, 5.999109831161897 5.87039683716568, 8.51560382572653 3.7252410587519886 C11.032097820291161 1.5800852803382974, 16.377503419445155 0.40900388408914673, 17.88904032167518 0.0750132015938405 C19.400577223905202 -0.2589774809014657, 17.448582822593046 1.2406055078364167, 17.584825239106664 1.7212969637801514" style="stroke: rgb(174, 174, 174); stroke-width: 1; fill: none;"></path><path d="M8.571186416504453 17.64803469305822 C12.085276840999553 15.452815349785006, 19.337130848197884 16.101685575250833, 26.855223350440756 18.889299472836626 M7.857231507904164 16.840024354210055 C15.011849298914942 18.06824852479784, 22.352469730756894 17.800410681835732, 26.732355140012178 16.88515873797708" style="stroke: #aeaeae; stroke-width: 1; fill: none;"></path>',OrgChart.templates.derek.plus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke-width="0"></circle><path d="M12.257463787262992 2.40166003616363 C15.548960627027807 1.1768586505919105, 20.323768339136134 1.874732142276981, 23.661947633240565 3.0864861053786417 C27.000126927344997 4.298240068480302, 30.703811226452725 6.729324000523814, 32.286539551889575 9.672183814773595 C33.86926787732643 12.615043629023376, 33.788018167397944 17.557781915741554, 33.158317585861674 20.743644990877332 C32.528617004325405 23.92950806601311, 31.137543762406274 26.899980401737224, 28.508336062671955 28.787362265588257 C25.879128362937635 30.67474412943929, 21.064677192956335 31.99302804642975, 17.383071387455747 32.06793617398354 C13.701465581955157 32.14284430153733, 9.342085269075854 31.17242931287016, 6.418701229668416 29.236811030911003 C3.4953171902609785 27.301192748951845, 0.29124975331190645 23.792422306170057, -0.15723284898887968 20.454226482228595 C-0.6057154512896659 17.116030658287134, 1.5769138742615705 12.178626667602387, 3.7278056158636996 9.207636087262241 C5.878697357465828 6.236645506922095, 10.970632450860041 3.8471017540469195, 12.748117600623896 2.6282830001877198 C14.525602750387751 1.4094642463285199, 14.289563699001825 1.9470094191022314, 14.392716514446832 1.894723564107041 M22.43549828180672 1.2256088400576157 C25.69018250895055 1.7704365119039576, 29.24546322166512 4.979269460398017, 31.051492912414023 8.188373611713667 C32.85752260316293 11.397477763029316, 33.67207918890526 17.17514768034262, 33.27167642630015 20.480233747951512 C32.871273663695035 23.785319815560406, 31.41050911947538 25.966765564166938, 28.649076336783356 28.01889001736704 C25.887643554091333 30.07101447056714, 20.094058835586818 32.38500719321419, 16.70307973014802 32.79298046715211 C13.31210062470922 33.20095374109003, 10.940906263905317 32.367748192606626, 8.303201704150565 30.46672966099454 C5.665497144395813 28.565711129382457, 2.097338248187536 24.641108687248686, 0.8768523716195098 21.386869277479594 C-0.34363350494851663 18.132629867710502, -0.763694313917872 14.0433435213021, 0.980286444742406 10.941293202379995 C2.7242672034026842 7.83924288345789, 7.945090366802328 4.317959037402062, 11.340736923581177 2.774567363946959 C14.736383480360027 1.231175690491856, 19.39979547907987 1.5862021443476335, 21.354165785415507 1.6809431616493775 C23.308536091751144 1.7756841789511215, 22.887857886273373 3.132249638930103, 23.06695876159499 3.343013467757423" style="stroke: rgb(174, 174, 174); stroke-width: 1; fill: none;"></path><path d="M7.0048103933165935 18.109075284628886 C12.152504846776358 18.486044066779655, 15.926735549928488 18.85477711845977, 26.641287664541796 15.553207106118496 M6.796084928139555 16.174781745374535 C14.085050058006614 16.53898319893461, 19.579209483395115 16.725914747038104, 27.441803598385356 17.277875712554966" style="stroke: #aeaeae; stroke-width: 1; fill: none;"></path><path d="M16.293755471804 6.234638030793387 C17.448668211406996 11.453666045700338, 16.27043554943843 18.842895411477887, 16.90423703847114 28.952046969222806 M17.809777051185264 7.011866752183222 C17.599122858612276 13.07833796918755, 16.995204905243295 18.587342115968614, 17.888568853882067 26.844926419317094" style="stroke: #aeaeae; stroke-width: 1; fill: none;"></path>',OrgChart.templates.derek.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,210,80)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-4" fill="#000000" fill-opacity="0" width="30" height="30"></rect><path d="M28.28024041166867 10.015533059199505 C16.45705393905741 10.81309700412131, 9.85276157405196 9.87162723980281, 3.5441213169168515 7.075531655648353 M27.551825308513525 8.923800642512257 C18.159502224784205 9.337153563754718, 7.451197502628936 9.284728719203128, 1.8548423867425456 8.753004894810802 M27.907104120536573 17.662200828300364 C18.343063985797404 18.998694042201137, 6.69417200021006 18.568117962359516, 2.7668346274558218 17.84920936843539 M26.99365966559525 17.444217688828093 C18.288291344549645 16.258053076066645, 10.047008592341617 16.913684103209345, 2.1772395910449567 17.55258716848472 M25.754130110044443 24.79648729629354 C19.716463597004157 24.059273917380096, 12.571903015673474 24.723484329803995, 1.2709092686545498 25.961416660790483 M26.031268385778997 24.853114475295413 C16.16958752624931 25.047162545233455, 7.4039608372111765 23.9169859615211, 1.4736400026930716 24.342985647697336" style="stroke: rgb(174, 174, 174); stroke-width: 1; fill: none;"></path></g>',OrgChart.templates.isla=Object.assign({},OrgChart.templates.ana),OrgChart.templates.isla.defs='<filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="isla-shadow"><feOffset dx="0" dy="4" in="SourceAlpha" result="shadowOffsetOuter1" /><feGaussianBlur stdDeviation="10" in="shadowOffsetOuter1" result="shadowBlurOuter1" /><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" in="shadowBlurOuter1" type="matrix" result="shadowMatrixOuter1" /><feMerge><feMergeNode in="shadowMatrixOuter1" /><feMergeNode in="SourceGraphic" /></feMerge></filter>',OrgChart.templates.isla.size=[180,120],OrgChart.templates.isla.node='<rect filter="url(#isla-shadow)" x="0" y="20" rx="5" ry="5" height="100" width="180" fill="#FFF" stroke-width="1" stroke="#039BE5" ></rect><rect x="25" y="75" rx="10" ry="10" height="20" width="130" fill="#039BE5" stroke-width="3" stroke="#039BE5"></rect><rect fill="#ffffff" stroke="#039BE5" stroke-width="1" x="70" y="0" rx="13" ry="13" width="40" height="40"></rect><circle stroke="#FFCA28" stroke-width="3" fill="none" cx="90" cy="12" r="8"></circle><path d="M75,34 C75,17 105,17 105,34" stroke="#FFCA28" stroke-width="3" fill="none"></path>',OrgChart.templates.isla.field_0="<text "+OrgChart.attr.width+'="120" style="font-size: 12px;" fill="#fff" x="90" y="90" text-anchor="middle">{val}</text>',OrgChart.templates.isla.field_1="<text "+OrgChart.attr.width+'="160" style="font-size: 13px;" fill="#039BE5" x="90" y="64" text-anchor="middle">{val}</text>',OrgChart.templates.isla.img_0='<clipPath id="{randId}"><rect filter="url(#isla-shadow)" fill="#ffffff" stroke="#039BE5" stroke-width="1" x="70" y="0" rx="13" ry="13" width="40" height="40"></rect></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="70" y="0" width="40" height="40"></image>',OrgChart.templates.isla.minus='<circle cx="15" cy="15" r="15" fill="#F57C00" stroke="#F57C00" stroke-width="1"></circle><line x1="8" y1="15" x2="22" y2="15" stroke-width="1" stroke="#ffffff"></line>',OrgChart.templates.isla.plus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#039BE5" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#039BE5"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#039BE5"></line>',OrgChart.templates.isla.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,83,45)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#F57C00"></circle><circle cx="7" cy="0" r="2" fill="#F57C00"></circle><circle cx="14" cy="0" r="2" fill="#F57C00"></circle></g>',OrgChart.templates.isla.ripple={radius:0,color:"#F57C00",rect:{x:0,y:20,width:180,height:100}},OrgChart.templates.deborah=Object.assign({},OrgChart.templates.polina),OrgChart.templates.deborah.size=[150,150],OrgChart.templates.deborah.node='<rect x="0" y="0" height="150" width="150" fill="#039BE5" stroke-width="1" stroke="#686868" rx="15" ry="15"></rect>',OrgChart.templates.deborah.img_0='<clipPath id="{randId}"><rect fill="#ffffff" stroke="#039BE5" stroke-width="1" x="5" y="5" rx="15" ry="15" width="140" height="140"></rect></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="5" y="5" width="140" height="140"></image><rect x="3" y="5" height="30" width="144" fill="#039BE5" opacity="0.5" rx="3" ry="3"></rect><rect x="3" y="115" height="30" width="144" fill="#039BE5" opacity="0.5" rx="3" ry="3"></rect>',OrgChart.templates.deborah.field_0="<text "+OrgChart.attr.width+'="125" '+OrgChart.attr.text_overflow+'="ellipsis" style="font-size: 18px;" fill="#ffffff" x="15" y="25" text-anchor="start">{val}</text>',OrgChart.templates.deborah.field_1="<text "+OrgChart.attr.width+'="105" '+OrgChart.attr.text_overflow+'="ellipsis" style="font-size: 11px;" fill="#ffffff" x="15" y="135" text-anchor="start">{val}</text>',OrgChart.templates.deborah.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,125,130)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>',OrgChart.templates.subLevel=Object.assign({},OrgChart.templates.base),OrgChart.templates.subLevel.size=[0,0],OrgChart.templates.subLevel.node="",OrgChart.templates.subLevel.plus="",OrgChart.templates.subLevel.minus="",OrgChart.templates.subLevel.nodeMenuButton="",OrgChart.ui={_defsIds:{},defs:function(t){var e="";for(var r in OrgChart.templates){var i=OrgChart.templates[r];i.defs&&(OrgChart.ui._defsIds[r]=OrgChart.randomId(),e+=i.defs.replace("{randId}",OrgChart.ui._defsIds[r]))}return"<defs>"+e+t+"</defs>"},css:function(){return'<style>.bg-ripple-container {position: absolute; top: 0; right: 0; bottom: 0; left: 0; }.drag-over rect { opacity: 0.5; } .bg-ripple-container span {transform: scale(0);border-radius:100%;position:absolute;opacity:0.75;background-color:#fff;animation: bg-ripple 1000ms; }@-moz-keyframes bg-ripple {to {opacity: 0;transform: scale(2);}}@-webkit-keyframes bg-ripple {to {opacity: 0;transform: scale(2);}}@-o-keyframes bg-ripple {to {opacity: 0;transform: scale(2);}}@keyframes bg-ripple {to {opacity: 0;transform: scale(2);}}.bg-switch {position:relative;display:inline-block;width:60px;height:24px;float:right;}.bg-switch input {opacity:0;width:0;height:0;}.bg-slider {position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color: #ccc;-webkit-transition:.4s;transition: .4s;}.bg-slider:before {position:absolute;content:"";height:16px;width:16px;left:4px;bottom:4px;background-color:white;-webkit-transition:.4s;transition:.4s;}input:checked + .bg-slider {background-color:#2196F3;}input:focus + .bg-slider {box-shadow:0 0 1px #2196F3;}input:checked + .bg-slider:before {-webkit-transform:translateX(34px);-ms-transform:translateX(34px);transform:translateX(34px);}.bg-slider.round {border-radius:24px;}.bg-slider.round:before {border-radius:50%;}svg text:hover {cursor:default;}svg.cursor-grab, svg.cursor-grab text:hover {cursor:grab;}svg.cursor-nodrop, svg.cursor-nodrop text:hover {cursor:no-drop;}svg.cursor-copy, svg.cursor-copy text:hover {cursor:copy;}svg.cursor-move, svg.cursor-move text:hover {cursor:move;}#close-btn:hover, #close-btn:focus {color: #000; text-decoration: none; cursor: pointer;} #id-select:focus, #pid-select:focus {outline: 0.5px solid #aeaeae;} #sampleDialog #title:hover{ cursor:default; background:gray;}</style>'},lonely:function(t){return t.nodes&&t.nodes.length?"":OrgChart.IT_IS_LONELY_HERE.replace("{link}",OrgChart.RES.IT_IS_LONELY_HERE_LINK)},pointer:function(t,e,r){return e===OrgChart.action.exporting?"":OrgChart.t(t.template,!1,r).pointer},node:function(t,e,r,i,a,n,o,l,s,h){var d=OrgChart.t(t.templateName,t.min,s),c=d.node.replaceAll("{w}",t.w).replaceAll("{h}",t.h);d.defs&&(c=c.replace("{randId}",OrgChart.ui._defsIds[t.templateName])),null==o&&(o=i.nodeBinding);var g={node:t,data:e};for(var p in o){var f,u=o[p];if(e&&(f=e[u]),"function"==typeof u&&(f=u(h,t,e)),g.value=f,g.element=d[p],g.name=u,!1!==OrgChart.events.publish("field",[h,g]))if(null!=g.value&&null!=g.value&&null!=g.element)c+=(OrgChart._lblIsImg(i,p)||"string"!=typeof g.value||(g.value=OrgChart.wrapText(g.value,g.element)),g.element.replace("{val}",function(){return g.value})).replaceAll("{ew}",t.w-(t.padding?t.padding[1]:0)).replaceAll("{cw}",t.w/2).replaceAll("{randId}",OrgChart.randomId()).replaceAll("{randId2}",OrgChart.randomId())}var C=OrgChart._getPosition(r,t,a,n),m="node";Array.isArray(t.tags)&&t.tags.length&&(m+=" "+t.tags.join(" ")),t.layout&&(m+=" tree-layout");var O="";t.lcn&&(O='lcn="'+t.lcn+'"');var y=OrgChart.nodeOpenTag.replace("{lcn}",O).replace("{id}",t.id).replace("{class}",m).replace("{sl}",t.sl).replace("{level}",t.level).replace("{x}",C.x).replace("{y}",C.y),v=OrgChart._getOpacity(r,t);(y=y.replace("{opacity}",v),null!=i.nodeMenu&&"split"!=t.templateName&&l!==OrgChart.action.exporting)&&(c+=d.nodeMenuButton.replace("{id}",t.id).replace("{cw}",t.w/2).replace("{ew}",t.w-(t.padding?t.padding[1]:0)));null!=i.nodeCircleMenu&&"split"!=t.templateName&&l!==OrgChart.action.exporting&&(OrgChart.isNullOrEmpty(d.nodeCircleMenuButton)||(c+='<g style="cursor:pointer;" transform="matrix(1,0,0,1,'+d.nodeCircleMenuButton.x+","+d.nodeCircleMenuButton.y+')" '+OrgChart.attr.control_node_circle_menu_id+'="'+t.id+'"><circle cx="0" cy="0" fill="'+d.nodeCircleMenuButton.color+'" r="'+d.nodeCircleMenuButton.radius+'" stroke-width="1" stroke="'+d.nodeCircleMenuButton.stroke+'"></circle><line x1="-'+d.nodeCircleMenuButton.radius/2+'" y1="-6" x2="'+d.nodeCircleMenuButton.radius/2+'" y2="-6" stroke-width="2" stroke="'+d.nodeCircleMenuButton.stroke+'"></line><line x1="-'+d.nodeCircleMenuButton.radius/2+'" y1="0" x2="'+d.nodeCircleMenuButton.radius/2+'" y2="0" stroke-width="2" stroke="'+d.nodeCircleMenuButton.stroke+'"></line><line x1="-'+d.nodeCircleMenuButton.radius/2+'" y1="6" x2="'+d.nodeCircleMenuButton.radius/2+'" y2="6" stroke-width="2" stroke="'+d.nodeCircleMenuButton.stroke+'"></line></g>'));return c=y+c+OrgChart.grCloseTag},expandCollapseBtn:function(t,e,r,i,a){var n="";if(i!==OrgChart.action.exporting&&0<e.childrenIds.length&&"split"!=e.templateName){if(e.hasPartners){for(var o=!1,l=0;l<e.children.length;l++)null!=e.children[l].ppid||e.children[l].isPartner||(o=!0);if(!o)return""}var s=r[e.lcn?e.lcn:"base"],h=0,d=0,c=OrgChart.t(e.templateName,e.min,a);switch(s.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:h=e.x+e.w/2,d=e.y+e.h;break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:h=e.x+e.w/2,d=e.y;break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:h=e.x,d=e.y+e.h/2;break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:h=e.x+e.w,d=e.y+e.h/2}if(h-=c.expandCollapseSize/2,d-=c.expandCollapseSize/2,t.getCollapsedIds(e).length?(n+=OrgChart.expcollOpenTag.replace("{id}",e.id).replace("{x}",h).replace("{y}",d),n+=c.plus):(n+=OrgChart.expcollOpenTag.replace("{id}",e.id).replace("{x}",h).replace("{y}",d),n+=c.minus),(n+=OrgChart.grCloseTag).indexOf("{collapsed-children-count}")){var g=OrgChart.collapsedChildrenCount(t,e);n=n.replace("{collapsed-children-count}",g)}}var p={html:n,node:e};return OrgChart.events.publish("renderbuttons",[t,p]),p.html},link:function(t,e,r,i,a,n){var o=t.lcn?t.lcn:"base",l=e._layoutConfigs[o],s=OrgChart.t(t.templateName,t.min,r),h=[],d=l.levelSeparation/2;t.layout!=OrgChart.mixed&&t.layout!=OrgChart.tree||(d=l.mixedHierarchyNodesSeparation/2);var c=0,g=OrgChart.getRootOf(t).id,p=i[g][t.sl],f=void 0;if(t.hasPartners){f={ids:[],indexes:{},ppnodes:{},lastLeft:null,firstRight:null,maxSidePartnersWithChildren:0,rightIds:[],leftIds:[],partnerChildrenSplitSeparation:e.config.partnerChildrenSplitSeparation};for(var u=0;u<t.children.length;u++){var C=null;null!=(m=t.children[u]).ppid&&(C=a[m.ppid]),C?(f.ppnodes[m.id]=C,f.ids.push(m.id),1==C.isPartner?(-1==f.rightIds.indexOf(C.id)&&f.rightIds.push(C.id),f.indexes[m.id]=f.rightIds.indexOf(C.id),f.firstRight||(f.firstRight=m)):2==C.isPartner&&(-1==f.leftIds.indexOf(C.id)&&f.leftIds.push(C.id),f.indexes[m.id]=f.leftIds.indexOf(C.id),f.lastLeft=m)):m.isPartner||(f.lastLeft=m,f.firstRight||(f.firstRight=m))}f.maxSidePartnersWithChildren=Math.max(f.leftIds.length,f.rightIds.length),c=0==f.maxSidePartnersWithChildren?e.config.minPartnerSeparation/2:e.config.minPartnerSeparation/2+f.partnerChildrenSplitSeparation*f.maxSidePartnersWithChildren+f.partnerChildrenSplitSeparation/2}for(u=0;u<t.children.length;u++){var m=t.children[u],O=i[g][m.sl],y={xa:0,ya:0,xb:0,yb:0,xc:0,yc:0,xd:0,yd:0,x:0,y:0,rotate:0},v=(s=OrgChart.t(m.templateName,m.min,r)).link;if(f&&-1!=f.ids.indexOf(m.id))switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:y=OrgChart.ui._linkPpTop(f,t,m,O,p,s);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:y=OrgChart.ui._linkPpBottom(f,t,m,O,p,s);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:y=OrgChart.ui._linkPpRight(f,t,m,O,p,s);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:y=OrgChart.ui._linkPpLeft(f,t,m,O,p,s)}else if((m.isAssistant||2==m.layout)&&m.rightNeighbor&&m.rightNeighbor.isSplit)switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:y=OrgChart.ui._linkRightToLeft(m.rightNeighbor,m,s,d);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:y=OrgChart.ui._linkRightToLeft(m.rightNeighbor,m,s,d);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:y=OrgChart.ui._linkBottomToTop(m.rightNeighbor,m,s,d);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:y=OrgChart.ui._linkBottomToTop(m.rightNeighbor,m,s,d)}else if((m.isAssistant||2==m.layout)&&m.leftNeighbor&&m.leftNeighbor.isSplit)switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:y=OrgChart.ui._linkLeftToRight(m.leftNeighbor,m,s,d);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:y=OrgChart.ui._linkLeftToRight(m.leftNeighbor,m,s,d);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:y=OrgChart.ui._linkTopToBottom(m.leftNeighbor,m,s,d);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:y=OrgChart.ui._linkTopToBottom(m.leftNeighbor,m,s,d)}else switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:if(1==m.isPartner)y=OrgChart.ui._linkLeftToRight(t,m,s,c);else if(2==m.isPartner)y=OrgChart.ui._linkRightToLeft(t,m,s,c);else{var x=1==m.layout?void 0:O.minY-(O.minY-p.maxY)/2;y=OrgChart.ui._linkTopToBottom(t,m,s,d,x)}break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:if(1==m.isPartner)y=OrgChart.ui._linkLeftToRight(t,m,s,c);else if(2==m.isPartner)y=OrgChart.ui._linkRightToLeft(t,m,s,c);else{x=1==m.layout?void 0:O.maxY-(O.maxY-p.minY)/2;y=OrgChart.ui._linkBottomToTop(t,m,s,d,x)}break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:if(1==m.isPartner)y=OrgChart.ui._linkTopToBottom(t,m,s,c);else if(2==m.isPartner)y=OrgChart.ui._linkBottomToTop(t,m,s,c);else{x=1==m.layout?void 0:O.maxX-(O.maxX-p.minX)/2;y=OrgChart.ui._linkRightToLeft(t,m,s,d,x)}break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:if(1==m.isPartner)y=OrgChart.ui._linkTopToBottom(t,m,s,c);else if(2==m.isPartner)y=OrgChart.ui._linkBottomToTop(t,m,s,c);else{x=1==m.layout?void 0:O.minX-(O.minX-p.maxX)/2;y=OrgChart.ui._linkLeftToRight(t,m,s,d,x)}}if(-1!=v.indexOf("{rounded}"))if(y.xa==y.xb&&y.xa==y.xc&&y.xa==y.xd||y.ya==y.yb&&y.ya==y.yc&&y.ya==y.yd)v=v.replace("{rounded}","M"+y.xa+","+y.ya+" L"+y.xd+","+y.yd);else{var b=OrgChart.ui._roundedEdge(y.xa,y.ya,y.xb,y.yb,y.xc,y.yc),_=OrgChart.ui._roundedEdge(y.xb,y.yb,y.xc,y.yc,y.xd,y.yd);v=v.replace("{rounded}","M"+b.x1+","+b.y1+" "+b.x2+","+b.y2+" Q"+b.qx1+","+b.qy1+" "+b.qx2+","+b.qy2+" L"+_.x2+","+_.y2+" Q"+_.qx1+","+_.qy1+" "+_.qx2+","+_.qy2+" L"+_.x3+","+_.y3)}else v=-1!=v.indexOf("{edge}")?v.replace("{edge}","M"+y.xa+","+y.ya+" "+y.xb+","+y.yb+" "+y.xc+","+y.yc+" L"+y.xd+","+y.yd):-1!=v.indexOf("{curve}")?v.replace("{curve}","M"+y.xa+","+y.ya+" C"+y.xb+","+y.yb+" "+y.xc+","+y.yc+" "+y.xd+","+y.yd):v.replaceAll("{xa}",y.xa).replaceAll("{ya}",y.ya).replaceAll("{xb}",y.xb).replaceAll("{yb}",y.yb).replaceAll("{xc}",y.xc).replaceAll("{yc}",y.yc).replaceAll("{xd}",y.xd).replaceAll("{yd}",y.yd);h.push(OrgChart.linkOpenTag.replace("{id}",t.id).replace("{class}","link "+m.tags.join(" ")).replace("{child-id}",m.id));var w={node:t,cnode:m,p:y,html:v,action:n};OrgChart.events.publish("render-link",[e,w]),h.push(w.html);var k="";for(var S in e.config.linkBinding){var I=e.config.linkBinding[S],A=e._get(m.id);if(A){var E=A[I];w.value=E,w.element=s[S],w.name=I,!1!==OrgChart.events.publish("label",[e,w])&&(OrgChart.isNullOrEmpty(w.value)||OrgChart.isNullOrEmpty(w.element)||(k+=w.element.replace("{val}",w.value)))}}""!=k&&(k=OrgChart.linkFieldsOpenTag.replace("{x}",y.x).replace("{y}",y.y).replace("{rotate}",0)+k+OrgChart.grCloseTag,h.push(k)),h.push(OrgChart.grCloseTag)}return h.join("")},svg:function(t,e,r,i,a,n){return OrgChart.t(i.template,!1,n).svg.replace("{w}",t).replace("{h}",e).replace("{viewBox}",r).replace("{content}",function(){return a})},exportMenuButton:function(t){return null==t.menu?"":OrgChart.t(t.template,!1).exportMenuButton.replaceAll("{p}",t.padding)},_roundedEdge:function(t,e,r,i,a,n){var o,l,s,h=0;return t==r&&t==a||e==i&&e==n?(o=s=r,l=h=i):(t!=a&&r==a&&(o=s=r,l=i,e<n?h=i+OrgChart.LINK_ROUNDED_CORNERS:n<e&&(h=i-OrgChart.LINK_ROUNDED_CORNERS)),t<a&&r==a?r-=OrgChart.LINK_ROUNDED_CORNERS:a<t&&r==a&&(r+=OrgChart.LINK_ROUNDED_CORNERS),e!=n&&i==n&&(o=r,l=h=i,t<a?s=r+OrgChart.LINK_ROUNDED_CORNERS:a<t&&(s=r-OrgChart.LINK_ROUNDED_CORNERS)),e<n&&i==n?i-=OrgChart.LINK_ROUNDED_CORNERS:n<e&&i==n&&(i+=OrgChart.LINK_ROUNDED_CORNERS)),{x1:t,y1:e,x2:r,y2:i,x3:a,y3:n,qx1:o,qy1:l,qx2:s,qy2:h}},_linkTopToBottom:function(t,e,r,i,a){var n,o,l,s,h,d,c,g=0;return n=t.x+t.w/2+r.linkAdjuster.toX,o=t.y+t.h+r.linkAdjuster.toY,h=s=e.x+e.w/2+r.linkAdjuster.fromX,d=e.y+r.linkAdjuster.fromY,{xa:l=n,ya:o,xb:l,yb:g=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.y+t.rightNeighbor.h+i:"split"!=t.templateName||!e.isAssistant&&2!=e.layout?"split"==e.templateName?o+i:null!=a?a:d-i:d,xc:c=s,yc:g,xd:h,yd:d,x:c,y:g+16,rotate:0}},_linkBottomToTop:function(t,e,r,i,a){var n,o,l,s,h,d,c,g=0;return n=t.x+t.w/2+r.linkAdjuster.toX,o=t.y+r.linkAdjuster.toY,h=s=e.x+e.w/2+r.linkAdjuster.fromX,d=e.y+e.h+r.linkAdjuster.fromY,{xa:l=n,ya:o,xb:l,yb:g=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.y-i:"split"!=t.templateName||!e.isAssistant&&2!=e.layout?"split"==e.templateName?o-i:null!=a?a:d+i:d,xc:c=s,yc:g,xd:h,yd:d,x:c,y:g-14,rotate:0}},_linkRightToLeft:function(t,e,r,i,a){var n,o,l,s,h,d,c,g=0;return n=t.x+r.linkAdjuster.toX,o=t.y+t.h/2+r.linkAdjuster.toY,h=e.x+e.w+r.linkAdjuster.fromX,d=s=e.y+e.h/2+r.linkAdjuster.fromY,{xa:n,ya:l=o,xb:g=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.x-i:"split"!=t.templateName||!e.isAssistant&&2!=e.layout?"split"==e.templateName?n-i:null!=a?a:h+i:h,yb:l,xc:g,yc:c=s,xd:h,yd:d,x:g-16,y:c,rotate:90}},_linkLeftToRight:function(t,e,r,i,a){var n,o,l,s,h,d,c,g=0;return n=t.x+t.w+r.linkAdjuster.toX,o=t.y+t.h/2+r.linkAdjuster.toY,h=e.x+r.linkAdjuster.fromX,d=s=e.y+e.h/2+r.linkAdjuster.fromY,{xa:n,ya:l=o,xb:g=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.x+t.rightNeighbor.w+i:"split"!=t.templateName||!e.isAssistant&&2!=e.layout?"split"==e.templateName?n+i:null!=a?a:h-i:h,yb:l,xc:g,yc:c=s,xd:h,yd:d,x:g+14,y:c,rotate:270}},_linkPpTop:function(t,e,r,i,a,n){var o=t.ppnodes[r.id],l=o.y+o.h/2,s=i.minY-(i.minY-a.maxY)/2,h=(i.minY-a.maxY)/t.maxSidePartnersWithChildren/4,d=OrgChart.ui.__linkPpBottomTop(t,e,r,s,h,o),c=d.x;return s=d.mid,OrgChart.ui._linkTopToBottom({x:c,y:l,w:0,h:0},r,n,0,s)},_linkPpBottom:function(t,e,r,i,a,n){var o=t.ppnodes[r.id],l=o.y+o.h/2,s=i.maxY-(i.maxY-a.minY)/2,h=(i.maxY-a.minY)/t.maxSidePartnersWithChildren/4,d=OrgChart.ui.__linkPpBottomTop(t,e,r,s,h,o),c=d.x;return s=d.mid,OrgChart.ui._linkBottomToTop({x:c,y:l,w:0,h:0},r,n,0,s)},_linkPpLeft:function(t,e,r,i,a,n){var o=t.ppnodes[r.id],l=i.minX-(i.minX-a.maxX)/2,s=(i.minX-a.maxX)/t.maxSidePartnersWithChildren/4,h=o.x+o.w/2,d=OrgChart.ui.__linkPpLeftRight(t,e,r,l,s,o),c=d.y;return l=d.mid,OrgChart.ui._linkLeftToRight({x:h,y:c,w:0,h:0},r,n,0,l)},_linkPpRight:function(t,e,r,i,a,n){var o=t.ppnodes[r.id],l=i.maxX-(i.maxX-a.minX)/2,s=(i.maxX-a.minX)/t.maxSidePartnersWithChildren/4,h=o.x+o.w/2,d=OrgChart.ui.__linkPpLeftRight(t,e,r,l,s,o),c=d.y;return l=d.mid,OrgChart.ui._linkRightToLeft({x:h,y:c,w:0,h:0},r,n,0,l)},__linkPpBottomTop:function(t,e,r,i,a,n){var o=0;return 1==n.isPartner?(o=n.x-e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.rightIds.length-1)*t.partnerChildrenSplitSeparation/2,t.lastLeft&&o<t.lastLeft.x+t.lastLeft.w/2?o<r.x+r.w/2?i-=(t.indexes[r.id]+1)*a:i-=(t.rightIds.length-t.indexes[r.id])*a:o<r.x+r.w/2?i+=(t.rightIds.length-t.indexes[r.id])*a:i+=(t.indexes[r.id]+1)*a):2==n.isPartner&&(o=n.x+n.w+e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.leftIds.length-1)*t.partnerChildrenSplitSeparation/2,t.firstRight&&o>t.firstRight.x+t.firstRight.w/2?o<r.x+r.w/2?i-=(t.indexes[r.id]+1)*a:i-=(t.leftIds.length-t.indexes[r.id])*a:o<r.x+r.w/2?i+=(t.leftIds.length-t.indexes[r.id])*a:i+=(t.indexes[r.id]+1)*a),{x:o,mid:i}},__linkPpLeftRight:function(t,e,r,i,a,n){var o=0;return 1==n.isPartner?(o=n.y-e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.rightIds.length-1)*t.partnerChildrenSplitSeparation/2,t.lastLeft&&o<t.lastLeft.y+t.lastLeft.h/2?o<r.y+r.h/2?i-=(t.indexes[r.id]+1)*a:i-=(t.rightIds.length-t.indexes[r.id])*a:o<r.y+r.h/2?i+=(t.rightIds.length-t.indexes[r.id])*a:i+=(t.indexes[r.id]+1)*a):2==n.isPartner&&(o=n.y+n.h+e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.leftIds.length-1)*t.partnerChildrenSplitSeparation/2,t.firstRight&&o>t.firstRight.y+t.firstRight.h/2?o<r.y+r.h/2?i-=(t.indexes[r.id]+1)*a:i-=(t.leftIds.length-t.indexes[r.id])*a:o<r.y+r.h/2?i+=(t.leftIds.length-t.indexes[r.id])*a:i+=(t.indexes[r.id]+1)*a),{y:o,mid:i}}},void 0===OrgChart&&(OrgChart={}),OrgChart._validateConfig=function(t){return!!t||(console.error("config is not defined"),!1)},OrgChart._arrayContains=function(t,e){if(t&&Array.isArray(t))for(var r=t.length;r--;)if(t[r]===e)return!0;return!1},OrgChart._interceptions=function(t,e){if(!t)return[];if(!e)return[];var r=[];if(Array.isArray(t)&&Array.isArray(e))for(var i in t)for(var a in e)t[i]==e[a]&&r.push(t[i]);else if(Array.isArray(t)&&!Array.isArray(e))for(var i in t)for(var a in e)t[i]==a&&r.push(t[i]);else if(!Array.isArray(t)&&Array.isArray(e))for(var i in t)for(var a in e)i==e[a]&&r.push(e[a]);return r},OrgChart._getTags=function(t){return t.tags&&!Array.isArray(t.tags)?t.tags.split(","):t.tags&&Array.isArray(t.tags)?t.tags:[]},OrgChart._centerPointInPercent=function(t,e,r){var i=t.getBoundingClientRect(),a=e-i.left,n=r-i.top;return[a/(i.width/100),n/(i.height/100)]},OrgChart._trim=function(t){return t.replace(/^\s+|\s+$/g,"")},OrgChart._getTransform=function(t){var e=t.getAttribute("transform");return e=e.replace("matrix","").replace("(","").replace(")",""),OrgChart._browser().msie&&(e=e.replace(/ /g,",")),e="["+(e=OrgChart._trim(e))+"]",e=JSON.parse(e)},OrgChart.getScale=function(t,e,r,i,a,n,o,l){var s=1;if(t||i!==OrgChart.match.boundary)if(t||i!==OrgChart.match.width)if(t||i!==OrgChart.match.height)if(t){var h,d=e/t[2];s=(h=r/t[3])<d?h:d}else s=i;else s=r/l;else s=e/o;else s=(h=r/l)<(d=e/o)?h:d;return s&&a<s&&(s=a),s&&s<n&&(s=n),s},OrgChart._mergeObject=function(t,e){var r={};for(var i in t)r[i]=t[i];for(i in e)r[i]=e[i];return r},OrgChart._lblIsImg=function(t,e){return!(!t.nodeBinding||"string"!=typeof e||-1==e.indexOf("img")||!t.nodeBinding[e])},OrgChart._getFistImgField=function(t){if(t.nodeBinding)for(var e in t.nodeBinding)if(-1!=e.indexOf("img"))return t.nodeBinding[e];return!1},OrgChart._fieldIsImg=function(t,e){if(t.nodeBinding)for(var r in t.nodeBinding)if(t.nodeBinding[r]==e)return OrgChart._lblIsImg(t,r);return!1},OrgChart._guid=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},OrgChart.htmlRipple=function(o){var t=document.createElement("style");t.type="text/css",t.innerHTML=" .bg-ripple-container {position: absolute; top: 0; right: 0; bottom: 0; left: 0; } .bg-ripple-container span {transform: scale(0);border-radius:100%;position:absolute;opacity:0.75;background-color:#fff;animation: bg-ripple 1000ms; }@-moz-keyframes bg-ripple {to {opacity: 0;transform: scale(2);}}@-webkit-keyframes bg-ripple {to {opacity: 0;transform: scale(2);}}@-o-keyframes bg-ripple {to {opacity: 0;transform: scale(2);}}@keyframes bg-ripple {to {opacity: 0;transform: scale(2);}}",document.head.appendChild(t);var r,i,a,e=document.createElement("div");e.className="bg-ripple-container",o.addEventListener("mousedown",function(t){var e,r,i,a,n;return r=document.createElement("span"),i=this.offsetWidth,e=this.getBoundingClientRect(),n=t.pageX-e.left-i/2,a="top:"+(t.pageY-e.top-i/2)+"px; left: "+n+"px; height: "+i+"px; width: "+i+"px;",o.rippleContainer.appendChild(r),r.setAttribute("style",a)}),o.addEventListener("mouseup",(r=function(){for(;this.rippleContainer.firstChild;)this.rippleContainer.removeChild(this.rippleContainer.firstChild)},i=2e3,a=void 0,function(){var t,e;return e=this,t=arguments,clearTimeout(a),a=setTimeout(function(){return r.apply(e,t)},i)})),o.rippleContainer=e,o.appendChild(e)},OrgChart._moveToBoundaryArea=function(t,e,r,i){var a=e.slice(0);e[0]<r.left&&e[0]<r.right&&(a[0]=r.left>r.right?r.right:r.left),e[0]>r.right&&e[0]>r.left&&(a[0]=r.left>r.right?r.left:r.right),e[1]<r.top&&e[1]<r.bottom&&(a[1]=r.top>r.bottom?r.bottom:r.top),e[1]>r.bottom&&e[1]>r.top&&(a[1]=r.top>r.bottom?r.top:r.bottom),e[0]!==a[0]||e[1]!==a[1]?OrgChart.anim(t,{viewBox:e},{viewBox:a},300,OrgChart.anim.outPow,function(){i&&i()}):i&&i()},OrgChart.randomId=function(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)},OrgChart._getClientXY=function(t){return-1==t.type.indexOf("touch")?{x:t.clientX,y:t.clientY}:t.changedTouches.length?{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY}:void 0},OrgChart._getClientTouchesXY=function(t,e){return-1!=t.type.indexOf("touch")?t.touches.length<e+1?{x:null,y:null}:{x:t.touches[e].clientX,y:t.touches[e].clientY}:{x:t.clientX,y:t.clientY}},OrgChart._getOffset=function(t,e){t&&(e.x+=t.offsetLeft,e.y+=t.offsetTop,OrgChart._getOffset(t.offsetParent,e))},OrgChart._getTopLeft=function(t){var e={x:0,y:0};return OrgChart._getOffset(t,e),e},OrgChart._getOffsetXY=function(t,e){if(-1==e.type.indexOf("touch"))return{x:e.offsetX,y:e.offsetY};if(e.touches.length){var r=OrgChart._getTopLeft(t);return{x:e.touches[0].pageX-r.x,y:e.touches[0].pageY-r.y}}if(e.changedTouches.length){r=OrgChart._getTopLeft(t);return{x:e.changedTouches[0].pageX-r.x,y:e.changedTouches[0].pageY-r.y}}},OrgChart._pinchMiddlePointInPercent=function(t,e,r,i){var a=OrgChart._getTopLeft(t),n=i.touches[0].pageX-a.x,o=i.touches[0].pageY-a.y,l=i.touches[1].pageX-a.x,s=i.touches[1].pageY-a.y;return[((n-l)/2+l)/(e/100),((o-s)/2+s)/(r/100)]},OrgChart._browser=function(){var t=!!window.opr&&!!opr.addons||!!window.opera||0<=navigator.userAgent.indexOf(" OPR/"),e="undefined"!=typeof InstallTrigger,r=/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString(),i=!!document.documentMode,a=!i&&!!window.StyleMedia,n=!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime);return{opera:t,firefox:e,safari:r,msie:i,edge:a,chrome:n,blink:(n||t)&&!!window.CSS}},OrgChart._menuPosition=function(t,e,r){var i=t.getBoundingClientRect(),a=r.getBoundingClientRect(),n=e.getBoundingClientRect(),o=i.left-a.left,l=i.top-a.top;return i.top+n.height>a.top+a.height&&(l-=n.height),i.left-n.width<a.left&&(o+=n.width),{x:o,y:l}},OrgChart._getTemplate=function(t,e,r){if(Array.isArray(t))for(var i=0;i<t.length;i++){var a=e[t[i]];if(a&&a.template)return a.template}return r},OrgChart._getMin=function(t,e){if(t.tags&&t.tags.length&&e.tags)for(var r=0;r<t.tags.length;r++){var i=e.tags[t.tags[r]];if(i&&!0===i.min)return!0}return e.min},OrgChart._getSubLevels=function(t,e){if(t&&t.length)for(var r=0;r<t.length;r++){var i=e[t[r]];if(i&&i.subLevels)return i.subLevels}return 0},OrgChart._isHTML=function(t){var e=document.createElement("div");e.innerHTML=t;for(var r=e.childNodes,i=r.length;i--;)if(1==r[i].nodeType)return!0;return!1},OrgChart._getTestDiv=function(){var t=document.getElementById("orgchart_js_test_div");return t||((t=document.createElement("div")).id="orgchart_js_test_div",t.style.position="fixed",t.style.top="-10000px",t.style.left="-10000px",document.body.appendChild(t)),t},OrgChart._getLabelSize=function(t){var e=OrgChart._getTestDiv();return e.innerHTML="<svg>"+t+"</svg>",e.querySelector("text").getBoundingClientRect()},OrgChart.wrapText=function(t,e){var r=e.toLowerCase();if(-1==r.indexOf("<text"))return t;if(-1==r.indexOf(OrgChart.attr.width))return t;if(-1!=r.indexOf("foreignobject"))return t;if(-1==e.indexOf(OrgChart.attr.width))return t;if(OrgChart._isHTML(t))return t;var i=OrgChart._getTestDiv();e=e.replaceAll("{cw}",0),i.innerHTML="<svg>"+e+"</svg>";var a,n,o=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("text")[0],l=parseFloat(o.getAttribute("x")),s=parseFloat(o.getAttribute("y")),h=o.getAttribute("text-anchor"),d=o.getAttribute(OrgChart.attr.width),c=o.getAttribute(OrgChart.attr.text_overflow),g="http://www.w3.org/2000/svg",p=i.getElementsByTagName("svg")[0].getElementsByTagName("text")[0];c||(c="ellipsis");var f=c.split("-");if(1<f.length&&(a=parseInt(c.split("-")[1]),2<f.length&&"ellipsis"==f[2]&&(n=!0)),!d)return t;if(d=parseFloat(d),l||(l=0),s||(s=0),l||(h="start"),"ellipsis"==c){p.removeChild(p.firstChild),p.textContent=t;for(var u=p.getComputedTextLength(),C=2;d<u;)p.textContent=t.substring(0,t.length-C),p.textContent+="...",u=p.getComputedTextLength(),C++;return 2<C?"<title>"+t+"</title>"+p.textContent:t}if(-1!=c.indexOf("multiline")){var m=t.split(" "),O=p.getBBox().height;p.textContent="";var y=document.createElementNS(g,"tspan"),v=document.createTextNode(m[0]);y.setAttributeNS(null,"x",l),y.setAttributeNS(null,"y",s),y.setAttributeNS(null,"text-anchor",h),y.appendChild(v),p.appendChild(y);C=1;for(var x=1,b=1;b<m.length;b++){var _=y.firstChild.data.length;if(y.firstChild.data+=" "+m[b],y.getComputedTextLength()>d){if(y.firstChild.data=y.firstChild.data.slice(0,_),x++,a&&a<x){if(n&&p.children.length==a){var w=p.children[a-1].textContent;p.children[a-1].textContent=w.substring(0,w.length-3)+"..."}break}(y=document.createElementNS(g,"tspan")).setAttributeNS(null,"x",l),y.setAttributeNS(null,"y",s+O*C),y.setAttributeNS(null,"text-anchor",h),v=document.createTextNode(m[b]),y.appendChild(v),p.appendChild(y),C++}}var k="";if(null!=p.innerHTML)k=p.innerHTML,p.innerHTML="";else{var S="";for(b=p.childNodes.length-1;0<=b;b--)S=XMLSerializer().serializeToString(p.childNodes[b])+S,p.removeChild(p.childNodes[b]);k=S}return k}},OrgChart._downloadFile=function(t,e,r,i){var a=new Blob([e],{type:t});if(1==i){var n=URL.createObjectURL(a);window.open(n,"_blank").focus()}else if(navigator.msSaveBlob)navigator.msSaveBlob(a,r);else{var o=document.createElement("a");if(void 0!==o.download){n=URL.createObjectURL(a);o.setAttribute("href",n),o.setAttribute("download",r),o.style.visibility="hidden",document.body.appendChild(o),o.click(),document.body.removeChild(o)}}},OrgChart._getPosition=function(t,e,r,i){var a={x:e.x,y:e.y};if(null!=r&&(a.x=r),null!=i&&(a.y=r),t&&3==t.length){var n=t[0].indexOf(e.id);-1!=n&&null!=t[1][n].transform&&(null==r&&(a.x=t[1][n].transform[4]),null==i&&(a.y=t[1][n].transform[5]))}return a},OrgChart._getOpacity=function(t,e){var r=1;if(t&&3==t.length){var i=t[0].indexOf(e.id);-1!=i&&null!=t[1][i].opacity&&(r=t[1][i].opacity)}return r},OrgChart.t=function(t,e,r){var i=OrgChart.templates[t],a=null;if(null!=r&&i.scaleLessThen){var n=[];for(var o in i.scaleLessThen){var l=parseFloat(o);r<l&&n.push(l)}if(0<n.length){n.sort(function(t,e){return t-e});var s=i.scaleLessThen[n[0]];for(var h in s)null==a&&(a=Object.assign({},i)),a[h]=s[h]}}return e?null==a?i.min?i.min:i:a.min?a.min:a:null==a?i:a},OrgChart.setNodeSize=function(t){var e=OrgChart.t(t.templateName,t.min);t.w=e&&e.size?e.size[0]:0,t.h=e&&e.size?e.size[1]:0},OrgChart._imgs2base64=function(t,e,i,a){var n=t.getElementsByTagName(e),o=n.length;0==o&&a();for(var l=0;l<o;l++)!function(){var e=l,r=n[e];OrgChart._getDataUri(r.getAttribute(i),function(t){t.success&&r.setAttribute(i,t.result),e==o-1&&a()})}()},OrgChart._getDataUri=function(t,e){if(-1!=t.indexOf("base64"))e({success:!1});else{var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){200===r.status?i.readAsDataURL(r.response):404===r.status&&e({success:!1,result:r.status})};var i=new FileReader;i.onloadend=function(){e({success:!0,result:i.result})},r.send()}},OrgChart._csvToArray=function(t,e){e=e||",";for(var r=new RegExp("(\\"+e+'|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\'+e+"\\r\\n]*))","gi"),i=[[]],a=null;a=r.exec(t);){var n,o=a[1];o.length&&o!==e&&i.push([]),n=a[2]?a[2].replace(new RegExp('""',"g"),'"'):a[3],i[i.length-1].push(n)}return i},OrgChart._json2xml=function(t){for(var e=document.implementation.createDocument("","",null),r=e.createElement("nodes"),i=0;i<t.length;i++){var a=e.createElement("node"),n=t[i];for(var o in n){var l=n[o];"tags"==o&&(l=l.join()),a.setAttribute(o,l)}r.appendChild(a)}return e.appendChild(r),'<?xml version="1.0" encoding="utf-8" ?>'+(new XMLSerializer).serializeToString(e.documentElement)},OrgChart._xml2json=function(t){for(var e=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("node"),r=[],i=0;i<e.length;i++){for(var a=e[i],n={},o=0;o<a.attributes.length;o++){var l=a.attributes[o],s=l.value;"tags"==l.name&&(s=s.split(",")),n[l.name]=s}r.push(n)}return r},OrgChart._json2csv=function(t){for(var n=[],e=function(t){for(var e="",r=0;r<n.length;r++){var i;(i="reportsTo"==n[r]?null:null==t[n[r]]?"":t[n[r]])instanceof Date&&(i=i.toLocaleString());var a=(i=null===i?"":i.toString()).replace(/"/g,'""');0<=a.search(/("|,|\n)/g)&&(a='"'+a+'"'),0<r&&(e+=","),e+=a}return e+"\n"},r="",i=0;i<t.length;i++)for(var a in t[i])OrgChart._arrayContains(n,a)||(n.push(a),r+=a+",");r=r.substring(0,r.length-1),r+="\n";for(i=0;i<t.length;i++)r+=e(t[i]);return r=r.substring(0,r.length-1)},OrgChart.accentFold=function(t){return(t=t.toString().toLowerCase()).replace(/([à áâãäå])|([ç])|([èéêë])|([ìÃîï])|([ñ])|([òóôõöø])|([ß])|([ùúûü])|([ÿ])|([æ])/g,function(t,e,r,i,a,n,o,l,s,h,d){return e?"a":r?"c":i?"e":a?"i":n?"n":o?"o":l?"s":s?"u":h?"y":d?"ae":void 0})},OrgChart.copy=function(t){if(null===t||"object"!=typeof t||"isActiveClone"in t)return t;if(t instanceof Date)var e=new t.constructor;else e=t.constructor();for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t.isActiveClone=null,e[r]=OrgChart.copy(t[r]),delete t.isActiveClone);return e},OrgChart._getScrollSensitivity=function(){var t=OrgChart._browser();return t.msie&&OrgChart.scroll.ie?OrgChart.scroll.ie:t.edge&&OrgChart.scroll.edge?OrgChart.scroll.edge:t.safari&&OrgChart.scroll.safari?OrgChart.scroll.safari:t.chrome&&OrgChart.scroll.chrome?OrgChart.scroll.chrome:t.firefox&&OrgChart.scroll.firefox?OrgChart.scroll.firefox:t.opera&&OrgChart.scroll.opera?OrgChart.scroll.opera:{smooth:OrgChart.scroll.smooth,speed:OrgChart.scroll.speed}},OrgChart.isTrial=function(){return void 0!==OrgChart.remote},OrgChart.childrenCount=function(t,e,r){null==r&&(r=0);for(var i=0;i<e.childrenIds.length;i++){var a=t.nodes[e.childrenIds[i]];a&&(r++,OrgChart.childrenCount(t,a,r))}return r},OrgChart.collapsedChildrenCount=function(t,e,r){null==r&&(r=0);for(var i=0;i<e.childrenIds.length;i++){var a=t.nodes[e.childrenIds[i]];a&&(!0===a.collapsed&&r++,OrgChart.collapsedChildrenCount(t,a,r))}return r},OrgChart._setMinMaxXY=function(t,e){(null==e.minX||null!=t.x&&t.x<e.minX)&&(e.minX=t.x),(null==e.minY||null!=t.y&&t.y<e.minY)&&(e.minY=t.y),(null==e.maxX||null!=t.x&&t.x+t.w>e.maxX)&&(e.maxX=t.x+t.w),(null==e.maxY||null!=t.y&&t.y+t.h>e.maxY)&&(e.maxY=t.y+t.h)},OrgChart.getStParentNodes=function(t,e){for(e||(e=[]);t.parent;)t=t.parent;return t.stParent&&(e.push(t.stParent),OrgChart.getStParentNodes(t.stParent,e)),e},OrgChart.getRootOf=function(t){for(;t&&t.parent;)t=t.parent;return t},OrgChart._getViewBox=function(t){var e=null;return t?(e=(e="["+(e=t.getAttribute("viewBox"))+"]").replace(/\ /g,","),e=JSON.parse(e)):null},OrgChart.isNullOrEmpty=function(t){return null==t||""===t},OrgChart.attributesWithDataPrefix=function(){for(var t in OrgChart.attr)OrgChart.attr[t].includes("data")||(OrgChart.attr[t]="data-"+OrgChart.attr[t])},OrgChart.xScrollUI=function(t,e,r,i,a){this.element=t,this.requestParams=r,this.config=e,this.onSetViewBoxCallback=i,this.onDrawCallback=a,this.pos=0},OrgChart.xScrollUI.prototype.addListener=function(t){var o=this;if((this.config.mouseScrool==OrgChart.action.xScroll||this.config.mouseScrool==OrgChart.action.scroll)&&this.bar){var e=OrgChart._getScrollSensitivity();!function(t,i,e){var a=!1;function n(){a=!0;var t=(o.pos-o.bar.scrollLeft)/e;if(0<t)t++;else{if(0==t)return void(a=!1);t--}Math.ceil(o.bar.scrollLeft)==Math.ceil(o.pos)?a=!1:(o.bar.scrollLeft+=t,r(n))}t.addEventListener("wheel",function(t){var e=0;if(o.config.mouseScrool==OrgChart.action.xScroll)(e=t.deltaX||t.wheelDeltaX)||(e=t.deltaY||t.wheelDeltaY);else if(o.config.mouseScrool==OrgChart.action.scroll&&!(e=t.shiftKey?t.deltaY||t.wheelDeltaY:t.deltaX||t.wheelDeltaX))return;e=-e,e=Math.max(-1,Math.min(1,e)),o.pos+=-e*i;var r=parseFloat(o.innerBar.clientWidth)-parseFloat(o.bar.clientWidth);o.pos<0&&(o.pos=0),o.pos>r&&(o.pos=r),a||n()},{passive:!0});var r=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)}}(t,e.speed,e.smooth)}},OrgChart.xScrollUI.prototype.create=function(t){if(this.config.showXScroll===OrgChart.scroll.visible||this.config.mouseScrool===OrgChart.action.scroll||this.config.mouseScrool===OrgChart.action.xScroll){var a=this;this.bar&&this.bar.parentNode.removeChild(this.bar),this.bar=document.createElement("div"),this.config.showXScroll!==OrgChart.scroll.visible&&(this.bar.style.visibility="hidden"),this.innerBar=document.createElement("div");this.requestParams();this.innerBar.innerHTML=" ",Object.assign(this.bar.style,{position:"absolute",left:0,bottom:0,width:t+"px","overflow-x":"scroll",height:"20px"}),this.element.appendChild(this.bar),this.bar.appendChild(this.innerBar),this.bar.addEventListener("scroll",function(){if(this.ignore)this.ignore=!1;else{var t=a.requestParams(),e=(parseFloat(a.innerBar.clientWidth)-parseFloat(a.bar.clientWidth))/100,r=this.scrollLeft/e,i=(t.boundary.right-t.boundary.left)/100;t.viewBox[0]=r*i+t.boundary.left,a.onSetViewBoxCallback(t.viewBox),clearTimeout(this._timeout),this._timeout=setTimeout(function(){a.onDrawCallback()},500)}})}},OrgChart.xScrollUI.prototype.setPosition=function(){if(this.bar){var t=this.requestParams(),e=Math.abs(t.boundary.maxX-t.boundary.minX)*t.scale;switch(this.config.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:innerHeight=Math.abs(t.boundary.minY*t.scale);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:e=Math.abs(t.boundary.minX*t.scale)}this.innerBar.style.width=e+"px";var r=(t.boundary.right-t.boundary.left)/100,i=(t.viewBox[0]-t.boundary.left)/r;i<0?i=0:100<i&&(i=100);var a=(parseFloat(this.innerBar.clientWidth)-parseFloat(this.bar.clientWidth))/100,n=i*a;this.bar.ignore=!0,this.bar.scrollLeft=n,this.pos=this.bar.scrollLeft,this.bar.style.visibility=a<=0?"hidden":""}},OrgChart.yScrollUI=function(t,e,r,i,a){this.element=t,this.requestParams=r,this.config=e,this.onSetViewBoxCallback=i,this.onDrawCallback=a,this.pos=0},OrgChart.yScrollUI.prototype.addListener=function(t){var o=this;if(this.config.mouseScrool==OrgChart.action.yScroll||this.config.mouseScrool==OrgChart.action.scroll){var e=OrgChart._getScrollSensitivity();!function(t,i,e){var a=!1;function n(){a=!0;var t=(o.pos-o.bar.scrollTop)/e;if(0<t)t++;else{if(0==t)return void(a=!1);t--}Math.ceil(o.bar.scrollTop)==Math.ceil(o.pos)?a=!1:(o.bar.scrollTop+=t,r(n))}t.addEventListener("wheel",function(t){var e=0;if(o.config.mouseScrool==OrgChart.action.yScroll)(e=t.deltaY||t.wheelDeltaY)||(e=t.deltaX||t.wheelDeltaX);else if(o.config.mouseScrool==OrgChart.action.scroll&&!(e=t.shiftKey?t.deltaX||t.wheelDeltaX:t.deltaY||t.wheelDeltaY))return;e=-e,e=Math.max(-1,Math.min(1,e)),o.pos+=-e*i;var r=parseFloat(o.innerBar.clientHeight)-parseFloat(o.bar.clientHeight);o.pos<0&&(o.pos=0),o.pos>r&&(o.pos=r),a||n()},{passive:!0});var r=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)}}(t,e.speed,e.smooth)}},OrgChart.yScrollUI.prototype.create=function(t){if(this.config.showYScroll===OrgChart.scroll.visible||this.config.mouseScrool===OrgChart.action.scroll||this.config.mouseScrool===OrgChart.action.yScroll){var a=this;this.bar&&this.bar.parentNode.removeChild(this.bar),this.bar=document.createElement("div"),this.config.showYScroll!==OrgChart.scroll.visible&&(this.bar.style.visibility="hidden"),this.innerBar=document.createElement("div"),this.innerBar.innerHTML=" ",Object.assign(this.bar.style,{position:"absolute",right:0,bottom:0,height:t+"px","overflow-y":"scroll",width:"20px"}),this.element.appendChild(this.bar),this.bar.appendChild(this.innerBar),this.bar.addEventListener("scroll",function(){if(this.ignore)this.ignore=!1;else{var t=a.requestParams(),e=(parseFloat(a.innerBar.clientHeight)-parseFloat(a.bar.clientHeight))/100,r=this.scrollTop/e,i=(t.boundary.bottom-t.boundary.top)/100;t.viewBox[1]=r*i+t.boundary.top,a.onSetViewBoxCallback(t.viewBox),clearTimeout(this._timeout),this._timeout=setTimeout(function(){a.onDrawCallback()},500)}})}},OrgChart.yScrollUI.prototype.setPosition=function(){if(this.bar){var t=this.requestParams(),e=t.boundary.maxY*t.scale;switch(this.config.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:e=Math.abs(t.boundary.minY*t.scale);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:innerWidth=Math.abs(t.boundary.minX*t.scale)}this.innerBar.style.height=e+"px";var r=(t.boundary.bottom-t.boundary.top)/100,i=(t.viewBox[1]-t.boundary.top)/Math.abs(r);i<0?i=0:100<i&&(i=100);var a=(parseFloat(this.innerBar.clientHeight)-parseFloat(this.bar.clientHeight))/100,n=i*a;this.bar.ignore=!0,this.bar.scrollTop=n,this.pos=this.bar.scrollTop,this.bar.style.visibility=a<=0?"hidden":""}},OrgChart.prototype.zoom=function(t,e,r){var i=this.getViewBox().slice(0),a=i,n=i[2],o=i[3];!0===t?(i[2]=i[2]/OrgChart.SCALE_FACTOR,i[3]=i[3]/OrgChart.SCALE_FACTOR):!1===t?(i[2]=i[2]*OrgChart.SCALE_FACTOR,i[3]=i[3]*OrgChart.SCALE_FACTOR):(i[2]=i[2]/t,i[3]=i[3]/t),e||(e=[50,50]),i[0]=a[0]-(i[2]-n)/(100/e[0]),i[1]=a[1]-(i[3]-o)/(100/e[1]);var l=this.getScale(i);if(i[2]=this.width()/l,i[3]=this.height()/l,!0===t&&l<this.config.scaleMax||!1===t&&l>this.config.scaleMin||0!=t&&1!=t&&l<this.config.scaleMax&&l>this.config.scaleMin){this._hideBeforeAnimation();var s=this;r?(clearTimeout(s._timeout),OrgChart.anim(this.getSvg(),{viewbox:this.getViewBox()},{viewbox:i},this.config.anim.duration,this.config.anim.func,function(){clearTimeout(s._timeout),s._timeout=setTimeout(function(){s._draw(!0,OrgChart.action.zoom)},500)})):(this.setViewBox(i),clearTimeout(s._timeout),s._timeout=setTimeout(function(){s._draw(!0,OrgChart.action.zoom)},500))}},OrgChart.loading={},OrgChart.loading.show=function(t){var e=document.createElement("div");e.id="bg-loading",e.innerHTML='<style>@-webkit-keyframes dot-keyframes {0% { opacity: .4; -webkit-transform: scale(1, 1);transform: scale(1, 1);}50% {opacity: 1;-webkit-transform: scale(1.2, 1.2);transform: scale(1.2, 1.2);}100% {opacity: .4;-webkit-transform: scale(1, 1);transform: scale(1, 1);}}@keyframes dot-keyframes {0% {opacity: .4;-webkit-transform: scale(1, 1);transform: scale(1, 1);}50% {opacity: 1;-webkit-transform: scale(1.2, 1.2);transform: scale(1.2, 1.2);}100% {opacity: .4;-webkit-transform: scale(1, 1);transform: scale(1, 1);}}.bg-loading-dots div {margin: 10px;} .bg-dot-1 {background-color: #039BE5;}.bg-dot-2 {background-color: #F57C00;}.bg-dot-3 {background-color: #FFCA28;} .bg-loading-dots {text-align: center;width: 100%; position: absolute; top: 0;}.bg-loading-dots--dot {-webkit-animation: dot-keyframes 1.5s infinite ease-in-out;animation: dot-keyframes 1.5s infinite ease-in-out; border-radius: 10px;display: inline-block;height: 10px;width: 10px;}.bg-loading-dots--dot:nth-child(2) {-webkit-animation-delay: .5s;animation-delay: .5s;}.bg-loading-dots--dot:nth-child(3) {-webkit-animation-delay: 1s;animation-delay: 1s;}</style><div class="bg-loading-dots"><div class="bg-loading-dots--dot bg-dot-1"></div><div class="bg-loading-dots--dot bg-dot-2"></div><div class="bg-loading-dots--dot bg-dot-3"></div></div>',t.element.appendChild(e)},OrgChart.loading.hide=function(t){var e=t.element.querySelector("#bg-loading");e&&e.parentNode.removeChild(e)},OrgChart.pdfPrevUI={},OrgChart.loc||(OrgChart.loc={}),OrgChart.loc.ppdfCmdTitle="PDF Preview",OrgChart.loc.ppdfSave="Save",OrgChart.loc.ppdfCancel="Cancel",OrgChart.loc.ppdfFormat="Format",OrgChart.loc.ppdfFitToDrwaing="Fit",OrgChart.loc.ppdfA4="A4",OrgChart.loc.ppdfA3="A3",OrgChart.loc.ppdfA2="A2",OrgChart.loc.ppdfA1="A1",OrgChart.loc.ppdfLetter="Letter",OrgChart.loc.ppdfLegal="Legal",OrgChart.loc.ppdfLayout="Layout",OrgChart.loc.ppdfPortrait="Portrait",OrgChart.loc.ppdfLandscape="Landscape",OrgChart.loc.ppdfFittopagewidth="Fit to page width",OrgChart.loc.ppdfMargin="Margin",OrgChart.loc.ppdfHeader="Header",OrgChart.loc.ppdfFooter="Footer",OrgChart.loc.ppdfScale="Scale",OrgChart.pdfPrevUI.show=function(r,i){i=r._defaultExportOptions(i,"pdf");var t=document.createElement("div");t.id="bg-ppdf-btns",Object.assign(t.style,{position:"absolute",top:0,left:0,"background-color":"#fff","z-index":5,margin:"0 0 0 -250px","box-shadow":"0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)",width:"250px",height:"100%","font-family":"Roboto,Helvetica",color:"#757575","text-align":"right",padding:"10px"}),r.element.appendChild(t),t.innerHTML="<h1>"+OrgChart.loc.ppdfCmdTitle+'</h1><div><button type="button" id="bg-prev-save" style="font-size: 14px; width: 90px;">'+OrgChart.loc.ppdfSave+'</button> <button type="button" id="bg-prev-cancel" style="width: 90px;font-size: 14px;">'+OrgChart.loc.ppdfCancel+'</button></div><div style="margin-top:30px; height:10px;border-bottom:1px solid #eeeeee;"></div><div style="padding-top:30px;"><label for="bg-size">'+OrgChart.loc.ppdfFormat+': </label><select id="bg-ppdf-size" style="color: #757575; width: 150px; font-size: 14px;" id="bg-size"><option value="fit">'+OrgChart.loc.ppdfFitToDrwaing+'</option><option value="A4">'+OrgChart.loc.ppdfA4+'</option><option value="A3">'+OrgChart.loc.ppdfA3+'</option><option value="A2">'+OrgChart.loc.ppdfA2+'</option><option value="A1">'+OrgChart.loc.ppdfA1+'</option><option value="Letter">'+OrgChart.loc.ppdfLetter+'</option><option value="Legal">'+OrgChart.loc.ppdfLegal+'</option></select></div><div style="padding-top:10px;"><label for="bg-ppdf-layout">'+OrgChart.loc.ppdfLayout+': </label><select id="bg-ppdf-layout" style="color: #757575; width: 150px;font-size: 14px;" ><option value="false">'+OrgChart.loc.ppdfPortrait+'</option><option value="true">'+OrgChart.loc.ppdfLandscape+'</option></select></div><div style="padding-top:10px;"><label for="bg-scale">'+OrgChart.loc.ppdfScale+': </label><select id="bg-ppdf-scale" style="color: #757575; width: 150px;font-size: 14px;" id="bg-scale"><option value="fit">'+OrgChart.loc.ppdfFittopagewidth+'</option><option value="10">10%</option><option value="20">20%</option><option value="30">30%</option><option value="40">40%</option><option value="50">50%</option><option value="60">60%</option><option value="70">70%</option><option value="80">80%</option><option value="90">90%</option><option value="100">100%</option><option value="110">110%</option><option value="120">120%</option><option value="130">130%</option><option value="140">140%</option><option value="150">150%</option><option value="160">160%</option><option value="170">170%</option><option value="180">180%</option><option value="190">190%</option><option value="200">200%</option></select></div><div style="margin-top:10px;margin-bottom:10px; height:10px;border-bottom:1px solid #eeeeee;"></div><div style="padding-top:10px;"><label for="bg-ppdf-header">'+OrgChart.loc.ppdfHeader+': </label><input id="bg-ppdf-header" type="text" style="color: #757575; width: 100px;font-size: 14px;" ></div><div style="padding-top:10px;"><label for="bg-ppdf-footer">'+OrgChart.loc.ppdfFooter+': </label><input id="bg-ppdf-footer" type="text" style="color: #757575; width: 100px;font-size: 14px;" ></div><div style="padding-top:10px;"><label for="bg-ppdf-margin">'+OrgChart.loc.ppdfMargin+': </label><input id="bg-ppdf-margin" type="text" style="color: #757575; width: 100px;font-size: 14px;" ></div>';var e=document.createElement("div");e.id="bg-ppdf-wrapper",Object.assign(e.style,{"overflow-y":"scroll",position:"absolute",top:0,left:"270px","background-color":"#eee",width:r.width()-270+"px",height:"100%"}),r.element.appendChild(e),e.innerHTML='<div id="bg-ppdf-content" style="width: 100%;margin-top:10px;margin-bottom:10px;opacity:0;"></div>';var a,n,o,l=r.element.querySelector("#bg-ppdf-size"),s=r.element.querySelector("#bg-ppdf-layout"),h=r.element.querySelector("#bg-ppdf-scale"),d=r.element.querySelector("#bg-ppdf-margin"),c=r.element.querySelector("#bg-ppdf-header"),g=r.element.querySelector("#bg-ppdf-footer");l.value=i.format,s.value=i.landscape,h.value=i.scale,d.value=i.margin,c.value=i.header,g.value=i.footer,OrgChart.anim(r.element.querySelector("#bg-ppdf-btns"),{margin:[0,0,0,-250]},{margin:[0,0,0,0]},300,OrgChart.anim.outSin,function(){r.exportPDF(i,OrgChart.pdfPrevUI._handler)}),r.element.querySelector("#bg-prev-cancel").addEventListener("click",function(){OrgChart.pdfPrevUI.hide(r)}),r.element.querySelector("#bg-prev-save").addEventListener("click",function(){r.exportPDF(i),OrgChart.pdfPrevUI.hide(r)}),OrgChart.pdfPrevUI._showHide(l,s,h),l.addEventListener("change",function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.format=l.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(l,s,h)})}),s.addEventListener("change",function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.landscape="true"==s.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(l,s,h)})}),h.addEventListener("change",function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.scale=h.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(l,s,h)})}),d.addEventListener("keyup",function(){clearTimeout(a),a=setTimeout(function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="";var t=d.value.split(",");if(4==t.length){for(var e=0;e<t.length;e++)t[e]=parseInt(t[e]);i.margin=t,r.exportPDF(i,OrgChart.pdfPrevUI._handler)}})},1e3)}),c.addEventListener("keyup",function(){clearTimeout(n),n=setTimeout(function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.header=c.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler)})},1e3)}),g.addEventListener("keyup",function(){clearTimeout(o),o=setTimeout(function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.footer=g.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler)})},1e3)})},OrgChart.pdfPrevUI._showHide=function(t,e,r){"A4"==t.value||"A3"==t.value||"A2"==t.value||"A1"==t.value||"Letter"==t.value||"Legal"==t.value?(e.parentNode.style.display="block",r.parentNode.style.display="block"):(e.parentNode.style.display="none",r.parentNode.style.display="none")},OrgChart.pdfPrevUI._handler=function(t,e,r){var i=e.options,a=e.pages,n=i.margin[0],o=i.margin[2],l=document.createElement("div");l.innerHTML=r.outerHTML,OrgChart._browser().msie&&(l.innerHTML=(new XMLSerializer).serializeToString(r));for(var s=l.querySelector("svg"),h=t.element.querySelector("#bg-ppdf-content"),d=0;d<a.length;d++){var c=document.createElement("iframe");Object.assign(c.style,{display:"block",margin:"10px auto",border:"1px solid #eeeeee","box-shadow":"0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)"}),h.appendChild(c),s&&s.style.backgroundColor?c.style.backgroundColor=s.style.backgroundColor:c.style.backgroundColor="#fff";var g=c.contentWindow.document;g.open(),c.style.width=a[d].size.w+"px",c.style.height=a[d].size.h+"px",c.style.margin="10 auto",a[d].backgroundColor&&(c.style.backgroundColor=a[d].backgroundColor);var p=i.header;a[d].header&&(p=a[d].header),p&&(p=p.replace("{current-page}",d+1).replace("{total-pages}",a.length));var f=i.footer;a[d].footer&&(f=a[d].footer),f&&(f=f.replace("{current-page}",d+1).replace("{total-pages}",a.length)),a[d].html?g.write(OrgChart._exportHtml(a[d].html+e.styles,i,a[d].innerSize.w,a[d].innerSize.h,p,f)):(s.setAttribute("viewBox",a[d].vb),g.write(OrgChart._exportHtml(l.innerHTML+e.styles,i,a[d].innerSize.w,a[d].innerSize.h,p,f)));var u=g.getElementById("bg-header"),C=g.getElementById("bg-footer");if(u){var m=n-u.offsetHeight-7;u.style.top=m+"px"}if(C){var O=o-C.offsetHeight-7;C.style.bottom=O+"px"}g.close()}var y=t.element.querySelector("#bg-ppdf-content");OrgChart.anim(y,{opacity:0},{opacity:1},300,OrgChart.anim.outSin)},OrgChart.pdfPrevUI._getViewBox=function(t){var e=null;return t?(e=(e="["+(e=t.getAttribute("viewBox"))+"]").replace(/\ /g,","),e=JSON.parse(e)):null},OrgChart._exportHtml=function(t,e,r,i,a,n){for(var o="",l=0;l<e.margin.length;l++)o+=e.margin[l]+"px ";var s='<!DOCTYPE html><html style="margin:0;padding:0;"><head></head><body style="margin:0; padding:0;"><div style="margin: '+o+";overflow:hidden;width:"+r+"px;height:"+i+'px">';return a&&(s+='<div id="bg-header" style="width:'+r+"px;color:#757575;position:absolute;left:"+e.margin[3]+'px;top:0;">'+a+"</div>"),s+=t,n&&(s+='<div id="bg-footer" style="width:'+r+"px;color:#757575;position:absolute;left:"+e.margin[3]+'px;bottom:0;">'+n+"</div>"),s+="</div>",s+="</body></html>"},OrgChart.pdfPrevUI.hide=function(e){var r=e.element.querySelector("#bg-ppdf-wrapper");r&&OrgChart.anim(r,{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.parentNode.removeChild(r);var t=e.element.querySelector("#bg-ppdf-btns");OrgChart.anim(t,{margin:[0,0,0,0]},{margin:[0,0,0,-280]},300,OrgChart.anim.inSin,function(){t.parentNode.removeChild(t)})})},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("renderdefs",function(t,e){for(var r=0;r<t.config.clinks.length;r++){var i=t.config.clinks[r].template;i||(i="orange");var a=OrgChart.clinkTemplates[i];e.defs+=a.defs}}),OrgChart.events.on("render",function(t,e){t._clink(t,e)}),OrgChart.prototype._clink=function(t,e){for(var r,i,a,n,o,l="",s=0;s<this.config.clinks.length;s++){var h=this.config.clinks[s],d=t.getNode(h.from),c=t.getNode(h.to);if(d&&-1!=e.res.visibleNodeIds.indexOf(d.id)&&(c&&-1!=e.res.visibleNodeIds.indexOf(c.id))){var g=d.x,p=d.y,f=c.x,u=c.y,C={},m={},O=g+d.w/2,y=f+c.w/2,v=p+d.h/2,x=u+c.h/2,b=1;switch(this.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:O<=y?(b=1,C.x=O+d.w/10,m.x=y-c.w/10):(b=-1,C.x=O-d.w/10,m.x=y+c.w/10),p==u?(b=1,C.y=p,m.y=u):u<p?(C.y=p,m.y=u+c.h):(C.y=p+d.h,m.y=u);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:C.x=O<=y?(b=-1,O+d.w/10):(b=1,O-d.w/10),m.x=y+c.w/10,p==u?(b=-1,C.y=p+d.h,m.y=u+c.h):u<p?(C.y=p,m.y=u+c.h):(C.y=p+d.h,m.y=u);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:C.y=v<=x?(b=-1,v+d.h/5):(b=1,v-d.h/5),m.y=x+c.h/5,g==f?(b=-1,C.x=g,m.x=f):f<g?(C.x=g,m.x=f+c.w):(C.x=g+d.w,m.x=f);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:C.y=v<=x?(b=1,v+d.h/5):(b=-1,v-d.h/5),m.y=x+c.h/5,g==f?(b=1,C.x=g+d.w,m.x=f+c.w):f<g?(C.x=g,m.x=f+c.w):(C.x=g+d.w,m.x=f)}var _=A(C,m,b),w=h.template;w||(w="orange");var k=OrgChart.clinkTemplates[w],S=(r=C,a=_,void 0,n=((i=m).x-r.x)/2+r.x,o=(i.y-r.y)/2+r.y,{x:(n-a.x)/2+a.x,y:(o-a.y)/2+a.y});h.label&&(l+=k.label.replace("{x}",S.x).replace("{y}",S.y).replace("{val}",h.label));var I="M"+C.x+","+C.y+"C"+C.x+","+C.y+" "+_.x+","+_.y+" "+m.x+","+m.y;l+=("<g "+OrgChart.attr.c_link_from+'="{from}" '+OrgChart.attr.c_link_to+'="{to}">').replace("{from}",d.id).replace("{to}",c.id)+k.link.replaceAll("{d}",I)+'<path stroke="transparent" stroke-width="15" fill="none" d="'+I+'" />',l+=OrgChart.grCloseTag}function A(t,e,r){null==r&&(r=1);var i=e.x-t.x,a=e.y-t.y,n=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))/3;return n=n/(Math.sqrt(i*i+a*a)*r)*OrgChart.CLINK_CURVE,{x:t.x+i/2-a*n,y:t.y+a/2+i*n}}}e.content+=l},OrgChart.prototype.addClink=function(t,e,r,i){return this.removeClink(t,e),this.config.clinks.push({from:t,to:e,label:r,template:i}),this},OrgChart.prototype.removeClink=function(t,e){for(var r=this.config.clinks.length-1;0<=r;r--){var i=this.config.clinks[r];i.from==t&&i.to==e&&this.config.clinks.splice(r,1)}return this},OrgChart.clinkTemplates={},OrgChart.clinkTemplates.orange={defs:'<marker id="arrowOrange" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#F57C00" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotOrange" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#F57C00" /></marker>',link:'<path marker-start="url(#dotOrange)" marker-end="url(#arrowOrange)" stroke="#F57C00" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#F57C00" text-anchor="middle" x="{x}" y="{y}">{val}</text>'},OrgChart.clinkTemplates.blue={defs:'<marker id="arrowBlue" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#039BE5" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotBlue" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#039BE5" /></marker>',link:'<path marker-start="url(#dotBlue)" marker-end="url(#arrowBlue)" stroke="#039BE5" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#039BE5" text-anchor="middle" x="{x}" y="{y}">{val}</text>'},OrgChart.clinkTemplates.yellow={defs:'<marker id="arrowYellow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#FFCA28" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotYellow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#FFCA28" /></marker>',link:'<path marker-start="url(#dotYellow)" marker-end="url(#arrowYellow)" stroke="#FFCA28" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#FFCA28" text-anchor="middle" x="{x}" y="{y}">{val}</text>'},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("renderdefs",function(t,e){for(var r=0;r<t.config.slinks.length;r++){var i=t.config.slinks[r].template;i||(i="orange");var a=OrgChart.slinkTemplates[i];e.defs+=a.defs}}),OrgChart.events.on("render",function(t,e){t._slinks(t,e)}),OrgChart.prototype._slinks=function(S,t){var I="",A=this.getScale(),E=t.res.boundary;function e(t,e,r){var i=[],a=null,n="left",o=t.lcn?t.lcn:"base",l=S._layoutConfigs[o];switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:e.x>t.x&&(n="right");break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:case OrgChart.orientation.right:case OrgChart.orientation.right_top:n="top",e.y>t.y&&(n="bottom")}var s=OrgChart.t(t.templateName,t.min,A),h=l.levelSeparation;(t.parent&&t.parent.layout==OrgChart.mixed||t.parent&&t.parent.layout==OrgChart.tree)&&(h=l.mixedHierarchyNodesSeparation);var d={p:t.x+t.w/2+s.expandCollapseSize,q:t.y,r:t.x+t.w/2+s.expandCollapseSize,s:E.minY+h};if(t.level==e.level)switch(a=e,l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:i.push([d.p,d.q]),i.push([d.p,d.q-h/3]),s=OrgChart.t(a.templateName,a.min,A),i.push([a.x+a.w/2+s.expandCollapseSize,i[i.length-1][1]]),i.push([i[i.length-1][0],a.y]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:d.q=t.y+t.h,d.s=E.maxY-h,i.push([d.p,d.q]),i.push([d.r,t.y+t.h+h/3]),s=OrgChart.t(a.templateName,a.min,A),i.push([a.x+a.w/2+s.expandCollapseSize,i[i.length-1][1]]),i.push([i[i.length-1][0],a.y+a.h]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:d.p=t.x,d.q=t.y+t.h/2+s.expandCollapseSize,d.r=E.minX-h,d.s=t.y+t.h/2+s.expandCollapseSize,i.push([d.p,d.q]),i.push([t.x-h/3,d.q]),s=OrgChart.t(a.templateName,a.min,A),i.push([i[i.length-1][0],a.y+a.h/2+s.expandCollapseSize]),i.push([a.x,i[i.length-1][1]]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:d.p=t.x+t.w,d.q=t.y+t.h/2+s.expandCollapseSize,d.r=E.maxX+h,d.s=t.y+t.h/2+s.expandCollapseSize,i.push([d.p,d.q]),i.push([t.x+t.w+h/3,d.q]),s=OrgChart.t(a.templateName,a.min,A),i.push([i[i.length-1][0],a.y+a.h/2+s.expandCollapseSize]),i.push([a.x+a.w,i[i.length-1][1]])}else{switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:i.push([d.p,d.q]),i.push([d.r,t.y-h/3]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:d.q=t.y+t.h,d.s=E.maxY-h,i.push([d.p,d.q]),i.push([d.r,t.y+t.h+h/3]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:d.p=t.x,d.q=t.y+t.h/2+s.expandCollapseSize,d.r=E.minX-h,d.s=t.y+t.h/2+s.expandCollapseSize,i.push([d.p,d.q]),i.push([t.x-h/3,d.q]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:d.p=t.x+t.w,d.q=t.y+t.h/2+s.expandCollapseSize,d.r=E.maxX+h,d.s=t.y+t.h/2+s.expandCollapseSize,i.push([d.p,d.q]),i.push([t.x+t.w+h/3,d.q])}for(var c=t;null==a;){var g=!1,p=c.parent,f=p.leftNeighbor,u=p.rightNeighbor;if(p.id==e.id?a=p:OrgChart._intersects(p,d,S.config)&&(d=OrgChart._addPoint(p,i,S.config,d,n),g=!0),p.id!=e.id){for(;f;){if(f.id==e.id){a=f;break}OrgChart._intersects(f,d,S.config)&&(d=OrgChart._addPoint(f,i,S.config,d,n),g=!0),f=f.leftNeighbor}for(;u;){if(u.id==e.id){a=u;break}OrgChart._intersects(u,d,S.config)&&(d=OrgChart._addPoint(u,i,S.config,d,n),g=!0),u=u.rightNeighbor}}if(!g){var C=i[i.length-1][0],m=0;if(p.parent)switch(h=l.levelSeparation,p.parent.layout!=OrgChart.mixed&&p.parent.layout!=OrgChart.tree||(h=l.mixedHierarchyNodesSeparation),l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:m=p.parent.y+p.parent.h+h*(2/3);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:m=p.parent.y-h*(2/3);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:C=p.parent.x+p.parent.w+h*(2/3),m=i[i.length-1][1];break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:C=p.parent.x-h*(2/3),m=i[i.length-1][1]}i.push([C,m])}c=p}switch(s=OrgChart.t(a.templateName,a.min,A),i.splice(i.length-1,1),l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:i.push([a.x+a.w/2+s.expandCollapseSize,i[i.length-1][1]]),i.push([i[i.length-1][0],a.y+a.h]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:i.push([a.x+a.w/2+s.expandCollapseSize,i[i.length-1][1]]),i.push([i[i.length-1][0],a.y]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:i.push([i[i.length-1][0],a.y+a.h/2+s.expandCollapseSize]),i.push([a.x+a.w,i[i.length-1][1]]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:i.push([i[i.length-1][0],a.y+a.h/2+s.expandCollapseSize]),i.push([a.x,i[i.length-1][1]])}}var O=M.template;O||(O="orange");var y=null;switch((s=OrgChart.slinkTemplates[O]).labelPosition){case"start":y={x:i[1][0],y:i[1][1]};break;case"middle":var v=Math.ceil(i.length/2);y=function(t,e){return{x:(t[0]+e[0])/2,y:(t[1]+e[1])/2}}(i[v],i[v-1]);break;case"end":y={x:i[i.length-2][0],y:i[i.length-2][1]}}r&&(i=i.reverse()),i[0]="M"+i[0].join(",");for(var x=1;x<i.length;x++)i[x]="L"+i[x].join(",");var b=i.join(" ");if(M.label){var _=s.label.replace("{x}",y.x).replace("{y}",y.y).replace("{val}",M.label),w=OrgChart._getLabelSize(_),k=-w.height/2;switch(l.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:k=w.height}I+=s.label.replace("{x}",y.x).replace("{y}",y.y+k).replace("{val}",M.label)}I+=("<g "+OrgChart.attr.s_link_from+'="{from}" '+OrgChart.attr.s_link_to+'="{to}">').replace("{from}",t.id).replace("{to}",e.id)+s.link.replaceAll("{d}",b)+'<path stroke="transparent" stroke-width="15" fill="none" d="'+b+'" />',I+=OrgChart.grCloseTag}for(var r=0;r<this.config.slinks.length;r++){var M=this.config.slinks[r],i=S.getNode(M.from),a=S.getNode(M.to);i&&a&&-1!=t.res.visibleNodeIds.indexOf(a.id)&&-1!=t.res.visibleNodeIds.indexOf(i.id)&&(i.level>=a.level?e(i,a,!1):e(a,i,!0))}t.content+=I},OrgChart.prototype.addSlink=function(t,e,r,i){return this.removeClink(t,e),this.config.slinks.push({from:t,to:e,label:r,template:i}),this},OrgChart.prototype.removeSlink=function(t,e){for(var r=this.config.slinks.length-1;0<=r;r--){var i=this.config.slinks[r];i.from==t&&i.to==e&&this.config.slinks.splice(r,1)}return this},OrgChart.slinkTemplates={},OrgChart.slinkTemplates.orange={defs:'<marker id="arrowSlinkOrange" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#F57C00" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotSlinkOrange" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#F57C00" /></marker>',link:'<path stroke-dasharray="4, 2" marker-start="url(#dotSlinkOrange)" marker-end="url(#arrowSlinkOrange)" stroke-linejoin="round" stroke="#F57C00" stroke-width="2" fill="none" d="{d}" />',label:'<text dominant-baseline="middle" fill="#F57C00" alignment-baseline="middle" text-anchor="middle" x="{x}" y="{y}">{val}</text>',labelPosition:"middle"},OrgChart.slinkTemplates.blue={defs:'<marker id="arrowSlinkBlue" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#039BE5" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotSlinkBlue" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#039BE5" /></marker>',link:'<path stroke-dasharray="4, 2" marker-start="url(#dotSlinkBlue)" marker-end="url(#arrowSlinkBlue)" stroke-linejoin="round" stroke="#039BE5" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#039BE5" text-anchor="middle" x="{x}" y="{y}">{val}</text>',labelPosition:"middle"},OrgChart.slinkTemplates.yellow={defs:'<marker id="arrowSlinkYellow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#FFCA28" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotSlinkYellow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#FFCA28" /></marker>',link:'<path stroke-dasharray="4, 2" marker-start="url(#dotSlinkYellow)" marker-end="url(#arrowSlinkYellow)" stroke-linejoin="round" stroke="#FFCA28" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#FFCA28" text-anchor="middle" x="{x}" y="{y}">{val}</text>',labelPosition:"middle"},OrgChart.events.on("redraw",function(t,e){if(t.config.miniMap){var r=OrgChart.miniMap._getCanvas(t),a=r.getContext("2d");r.width=r.width,r.height=r.height;var i=t.response.boundary.maxX-t.response.boundary.minX,n=t.response.boundary.maxY-t.response.boundary.minY,o=Math.min(r.width/i,r.height/n),l=(r.width-i*o)/2,s=(r.height-n*o)/2;a.clearRect(0,0,r.width,r.height),a.translate(-t.response.boundary.minX*o+l,-t.response.boundary.minY*o+s),a.scale(o,o);var h=0,d=[];!function t(e,r){if(Array.isArray(r))for(var i=0;i<r.length;i++)t(e,r[i]);else{for(a.fillStyle=OrgChart.miniMap.colors[3],a.beginPath(),a.lineWidth="0.5",a.fillRect(r.x,r.y,r.w,r.h),a.strokeRect(r.x,r.y,r.w,r.h),i=0;i<r.stChildrenIds.length;i++)h++,d.includes(r.id)||(1==h?a.fillStyle=OrgChart.miniMap.colors[0]:2==h?a.fillStyle=OrgChart.miniMap.colors[1]:3==h&&(a.fillStyle=OrgChart.miniMap.colors[2]),a.beginPath(),a.fillRect(r.x,r.y,r.w,r.h),a.strokeRect(r.x,r.y,r.w,r.h),d.push(r.id)),t(e,e.getNode(r.stChildrenIds[i])),h--;for(i=0;i<r.childrenIds.length;i++)t(e,e.getNode(r.childrenIds[i]))}}(t,t.roots);var c=t.getViewBox()[0],g=t.getViewBox()[1],p=t.getViewBox()[2],f=t.getViewBox()[3];a.lineWidth=.5/o,a.strokeStyle="#f57c00",a.strokeRect(c,g,p,f),a.globalAlpha=.4,a.fillStyle=OrgChart.miniMap.selectorBackgroundColor,a.fillRect(c,g,p,f)}}),OrgChart.miniMap={},OrgChart.miniMap._getCanvas=function(t){if(!(e=t.element.querySelector("["+OrgChart.attr.id+'="mini-map"]'))){var e;(e=document.createElement("canvas")).width=250,e.height=140,e.setAttribute(OrgChart.attr.id,"mini-map"),e.style.display="inline-block",e.style.backgroundColor=OrgChart.miniMap.backgroundColor;var r=document.createElement("div");r.classList.add("mini-map"),r.style.position="absolute",r.style.bottom="10px",r.style.left="10px",r.style.border="1px solid #aeaeae",r.style.padding="5px",r.style.margin=t.config.padding+"px",r.style.backgroundColor=OrgChart.miniMap.backgroundColor,r.appendChild(e),t.element.appendChild(r)}return e},OrgChart.miniMap.colors=["#E0E0E0","#BDBDBD","#9E9E9E","#757575"],OrgChart.miniMap.selectorBackgroundColor="white",OrgChart.miniMap.backgroundColor="white",OrgChart._search={},OrgChart._search.search=function(t,e,r,i,a,n){var o=[],l=e.toLowerCase().split(" ");l=l.filter(function(t,e,r){return r.indexOf(t)===e});for(var s={},h=0;h<t.length;h++)for(var d=t[h],c=0;c<r.length;c++){var g=r[c];if(!OrgChart.isNullOrEmpty(d[g])){var p=d[g];if(null!=(e=OrgChart._search.searchAndComputeScore(l,p,g,n))){var f=d.id;if(s[f]){if(s[f]&&s[f]<e.__score){s[f]=e.__score;for(var u=o.length-1;0<=u;u--)o[u].id==f&&o.splice(u,1);OrgChart._search.addNodeToResult(o,i,d,e,g,a)}}else s[f]=e.__score,OrgChart._search.addNodeToResult(o,i,d,e,g,a)}}}return o.sort(function(t,e){return t.__score<e.__score?1:t.__score>e.__score?-1:0}),o},OrgChart._search.addNodeToResult=function(t,e,r,i,a,n){var o={};o.id=r.id,OrgChart.isNullOrEmpty(r[n])||(o[n]=r[n]);for(var l=0;l<e.length;l++){var s=e[l];OrgChart.isNullOrEmpty(r[s])||OrgChart.isNullOrEmpty(o[s])&&(o[s]=r[s])}null!=i&&(OrgChart.isNullOrEmpty(o.__score)&&(o.__score=i.__score),OrgChart.isNullOrEmpty(o.__searchField)&&(o.__searchField=a),OrgChart.isNullOrEmpty(o.__searchMarks)&&(o.__searchMarks=i.__searchMarks)),t.push(o)},OrgChart._search.searchAndComputeScore=function(t,e,r,i){if(OrgChart.isNullOrEmpty(e))return null;if(OrgChart.isNullOrEmpty(t))return null;if(!t.length)return null;"string"!=typeof e&&(e=e.toString());var a=e.toLowerCase(),n=OrgChart._search.searchIndexesOf(a,t);if(!n.length)return null;var o=a.length/100,l=0,s=0,h=0<l?100:0;if(n.length){s=n[0].start;for(var d=0;d<n.length;d++)if(l+=n[d].length,n[d].start<s&&(s=n[d].start),1<=d&&n[d-1].start>n[d].start){h=0;break}}var c=0;0!=l&&(c=l/o);var g=0<l?100:0;0!=s&&(g=100-s/o);var p=0;i&&i[r]&&(p=i[r]),0<c&&(c=c/100*20),0<g&&(g=g/100*20),0<h&&(h=h/100*20),0<p&&(p=p/100*40);var f=parseInt(c+g+h+p);100<f&&(f=100),n.sort(function(t,e){return t.start<e.start?-1:t.start>e.start?1:0});var u=e;for(d=n.length-1;0<=d;d--)u=(u=u.insert(n[d].start+n[d].length,"</mark>")).insert(n[d].start,"<mark>");return{__searchMarks:u,__score:f}},OrgChart._search.searchIndexesOf=function(t,e){var l=[];if(!OrgChart.isNullOrEmpty(t))for(var r=0;r<e.length;r++){var i=e[r];if(!OrgChart.isNullOrEmpty(i))for(var a=0;-1<(a=t.indexOf(i,a));)l.push({length:i.length,start:a}),a+=i.length}return l.sort(function(t,e){return t.length<e.length?1:t.length>e.length?-1:t.start<e.start?-1:t.start>e.start?1:0}),l=l.filter(function(t){for(var e=!1,r=0;r<l.length;r++){var i=l[r].start,a=l[r].start+l[r].length-1,n=t.start,o=t.start+t.length-1;if(i==n&&a==o){e=!1;break}if(n<=i&&a<=o){e=!0;break}if(i<=n&&o<=a){e=!0;break}}return!e})},OrgChart.events.on("redraw",function(t,e){if(t.config.state){var i=[],a=[];!function t(e){if(Array.isArray(e))for(var r=0;r<e.length;r++)t(e[r]);else{for(("string"!=typeof e.id||"string"==typeof e.id&&-1==e.id.indexOf("split")&&-1==e.id.indexOf("mirror"))&&(i.push(e.id),1==e.min&&a.push(e.id)),r=0;r<e.stChildren.length;r++)t(e.stChildren[r]);for(r=0;r<e.children.length;r++)t(e.children[r])}}(t.roots),OrgChart.state._put(t.width(),t.height(),t.response.viewBox,i,a,t.response.adjustify,t.config.state)}}),OrgChart.state={},OrgChart.state._buildStateNames=function(t){return{paramScale:t+"-scale",paramX:t+"-x",paramY:t+"-y",paramExp:t+"-exp",paramMin:t+"-min",paramAdjustify:t+"-adjustify"}},OrgChart.state._put=function(t,e,r,i,a,n,o){if(o){var l=OrgChart.state._buildStateNames(o.name),s={scale:Math.min(t/r[2],e/r[3]),x:r[0],y:r[1],exp:i,min:a,adjustify:n};if(o.writeToUrlParams){var h=new URLSearchParams(window.location.search);h.has(l.paramScale)?h.set(l.paramScale,s.scale):h.append(l.paramScale,s.scale),h.has(l.paramX)?h.set(l.paramX,s.x):h.append(l.paramX,s.x),h.has(l.paramY)?h.set(l.paramY,s.y):h.append(l.paramY,s.y),h.has(l.paramExp)?h.set(l.paramExp,s.exp.join("*")):h.append(l.paramExp,s.exp.join("*")),h.has(l.paramMin)?h.set(l.paramMin,s.min.join("*")):h.append(l.paramMin,s.min.join("*")),h.has(l.paramAdjustify)?h.set(l.paramAdjustify,s.adjustify.x+"*"+s.adjustify.y):h.append(l.paramAdjustify,s.adjustify.x+"*"+s.adjustify.y),window.history.replaceState(null,null,"?"+h)}o.writeToIndexedDB&&(s.id=o.name,OrgChart.idb.put(s,function(t){0==t&&console.error("Cannot write row - "+o.name)})),o.writeToLocalStorage&&OrgChart.localStorage.setItem(o.name,JSON.stringify(s))}},OrgChart.state._get=function(i,a,n,o){if(i){var t=OrgChart.state._buildStateNames(i.name);if(i.readFromUrlParams){var e=new URLSearchParams(window.location.search);if(e.has(t.paramScale)&&e.has(t.paramX)&&e.has(t.paramY)&&e.has(t.paramExp)&&e.has(t.paramMin)&&e.has(t.paramAdjustify)){var r={},l=parseFloat(e.get(t.paramScale)),s=parseFloat(e.get(t.paramX)),h=parseFloat(e.get(t.paramY));(c=[])[0]=s,c[1]=h,c[2]=a/l,c[3]=n/l,r.vb=c,r.scale=l,r.x=s,r.y=h,r.exp=e.get(t.paramExp).split("*"),r.min=e.get(t.paramMin).split("*");var d=e.get(t.paramAdjustify).split("*");return r.adjustify={x:parseFloat(d[0]),y:parseFloat(d[1])},void o(r)}if(!i.readFromIndexedDB&&!i.readFromLocalStorage)return void o(null)}if(i.readFromLocalStorage){var c;if(null!=(r=OrgChart.localStorage.getItem(i.name)))return r=JSON.parse(r),(c=[])[0]=r.x,c[1]=r.y,c[2]=a/r.scale,c[3]=n/r.scale,r.vb=c,void o(r);if(!i.readFromIndexedDB)return void o(null)}i.readFromIndexedDB&&OrgChart.idb.read(i.name,function(t,e){if(0==t)console.error("Cannot read from - "+i.name),o(null);else if(null==t)o(null);else{var r=[];r[0]=e.x,r[1]=e.y,r[2]=a/e.scale,r[3]=n/e.scale,e.vb=r,o(e)}})}else o(null)},OrgChart.state.clear=function(e){if(!e)return!1;var t=OrgChart.state._buildStateNames(e),r=new URLSearchParams(window.location.search);r.has(t.paramScale)&&r.delete(t.paramScale),r.has(t.paramX)&&r.delete(t.paramX),r.has(t.paramY)&&r.delete(t.paramY),r.has(t.paramExp)&&r.delete(t.paramExp),r.has(t.paramMin)&&r.delete(t.paramMin),r.has(t.paramAdjustify)&&r.delete(t.paramAdjustify),window.history.replaceState(null,null,"?"+r),OrgChart.idb.delete(e,function(t){0==t&&console.error("Cannot delete row - "+e)})},OrgChart._magnify={},OrgChart.prototype.magnify=function(t,e,r,i,a){i||(i=this.config.anim);var n=this.getNode(t),o=this.getNodeElement(t);if(n||o){var l=OrgChart._magnify[t];if(l&&(null!=l.timer&&clearInterval(l.timer),null!=l.timerBack&&clearInterval(l.timerBack),o.setAttribute("transform","matrix("+l.transformStart.toString()+")"),OrgChart._magnify[t]),r)o=o.cloneNode(!0),this.getSvg().appendChild(o);var s=OrgChart._getTransform(o),h=JSON.parse(JSON.stringify(s));h[0]=e,h[3]=e;var d=n.w+n.w*(e-1),c=n.h+n.h*(e-1);h[4]+=(n.w-d)/2,h[5]+=(n.h-c)/2;var g=OrgChart.anim(o,{transform:s},{transform:h},i.duration,i.func);OrgChart._magnify[t]={timer:g,transformStart:s,nodeElement:o,front:r},a&&a(o)}},OrgChart.prototype.magnifyBack=function(t,e,r){e||(e=this.config.anim);var i=OrgChart._magnify[t];if(i){null!=i.timer&&clearInterval(i.timer),null!=i.timerBack&&clearInterval(i.timerBack);var a=OrgChart._getTransform(i.nodeElement);i.timerBack=OrgChart.anim(i.nodeElement,{transform:a},{transform:i.transformStart},e.duration,e.func,function(t){var e=t[0].getAttribute(OrgChart.attr.node_id);OrgChart._magnify[e]&&OrgChart._magnify[e].front&&(t[0].parentNode.removeChild(t[0]),OrgChart._magnify[e]=null),r&&r(t[0])})}},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("init",function(t,e){t.config.enableKeyNavigation&&(t._addEvent(window,"keydown",t._windowKeyDownHandler),OrgChart.isNullOrEmpty(t._keyNavigationActiveNodeId)&&t.roots&&t.roots.length&&(t._keyNavigationActiveNodeId=t.roots[0].id,t.center(t._keyNavigationActiveNodeId)))}),OrgChart.prototype._windowKeyDownHandler=function(t,e){for(var r=e.target,i=null;r&&r!=this.element;){if(r.hasAttribute&&r.hasAttribute(OrgChart.attr.node_id)){i=r.getAttribute(OrgChart.attr.node_id);break}r=r.parentNode}if(r){var a=i?this.getNode(i):null,n={node:a,data:i?this.get(i):null,event:e};if(!1!==OrgChart.events.publish("key-down",[this,n])&&a)if("KeyF"==e.code)this.searchUI.find("");else if("ArrowRight"==e.code||a.isAssistant&&"ArrowDown"==e.code||a.isPartner&&"ArrowDown"==e.code){if(s=this.getNode(a.pid)){var o=s.childrenIds.indexOf(a.id);if(++o<s.childrenIds.length){var l=s.childrenIds[o];this._keyNavigationActiveNodeId=l,this.center(l)}}}else if("ArrowLeft"==e.code){if(s=this.getNode(a.pid)){o=s.childrenIds.indexOf(a.id);if(0<=--o){l=s.childrenIds[o];this._keyNavigationActiveNodeId=l,this.center(l)}}}else if("ArrowUp"==e.code){var s;if(s=this.getNode(a.pid)){l=s.id;if(a.isAssistant||s.hasAssistants||a.isPartner||s.hasPartners){o=s.childrenIds.indexOf(a.id);0<=--o&&(l=s.childrenIds[o])}this._keyNavigationActiveNodeId=l,this.center(l)}}else if("ArrowDown"==e.code)a.childrenIds.length&&(this._keyNavigationActiveNodeId=a.childrenIds[0],this.center(a.childrenIds[0]));else if("Space"==e.code){var h=r.getAttribute(OrgChart.attr.node_id);return void this.toggleExpandCollapse(h,e)}}},OrgChart.events.on("redraw",function(t,e){t.config.enableKeyNavigation&&OrgChart._keyNavigation(t)}),OrgChart.events.on("click",function(t,e){t.config&&t.config.enableKeyNavigation&&(t._keyNavigationActiveNodeId=e.node.id,t.center(e.node.id))}),OrgChart._keyNavigation=function(t){var e=t.element.querySelector(":focus");if(e&&e.parentElement&&e.parentElement.hasAttribute(OrgChart.attr.node_id)){var r=e.parentElement;(a=(i=e).querySelector("title"))&&a.parentNode.removeChild(a),i.removeAttribute("tabindex")}if(!OrgChart.isNullOrEmpty(t._keyNavigationActiveNodeId)&&((r=t.getNodeElement(t._keyNavigationActiveNodeId))&&r.children.length)){var i;(i=r.children[0]).setAttribute("tabindex",2);var a,n={text:"",id:t._keyNavigationActiveNodeId};if(OrgChart.events.publish("screen-reader-text",[t,n]),!OrgChart.isNullOrEmpty(n.text))(a=document.createElementNS("http://www.w3.org/2000/svg","title")).innerHTML=n.text,i.appendChild(a);t.searchUI.hide(),i.focus()}};
\ No newline at end of file diff --git a/dllib/package.json b/dllib/package.json new file mode 100644 index 0000000..a9dda3e --- /dev/null +++ b/dllib/package.json @@ -0,0 +1,30 @@ +{ + "name": "jQuery.Flexdatalist", + "description": "jQuery Datalist Autocomplete plugin", + "version": "2.3.0", + "repository": { + "type": "git", + "url": "https://github.com/sergiodlopes/jquery-flexdatalist.git" + }, + "bugs": { + "url": "https://github.com/sergiodlopes/jquery-flexdatalist/issues" + }, + "dependencies": { + "jquery": ">=1.8" + }, + "author": "Sérgio Dinis Lopes", + "license": "MIT", + "homepage": "http://projects.sergiodinislopes.pt/flexdatalist/", + "autoupdate": { + "source": "git", + "target": "git://github.com/sergiodlopes/jquery-flexdatalist.git", + "fileMap": [ + { + "basePath": "", + "files": [ + "jquery.flexdatalist*" + ] + } + ] + } +}
\ No newline at end of file diff --git a/fonts/Nunito-Italic-VariableFont_wght.ttf b/fonts/Nunito-Italic-VariableFont_wght.ttf Binary files differnew file mode 100644 index 0000000..97a40fa --- /dev/null +++ b/fonts/Nunito-Italic-VariableFont_wght.ttf diff --git a/fonts/Nunito-VariableFont_wght.ttf b/fonts/Nunito-VariableFont_wght.ttf Binary files differnew file mode 100644 index 0000000..edc20b8 --- /dev/null +++ b/fonts/Nunito-VariableFont_wght.ttf @@ -1,49 +1,188 @@ -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; - -/** @var string $_FULLNAME - * @var string $_USER - * @var string $_SUID - * @var array $_PROFILE - */ - -?> - -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Familine Help</title> - <link rel="icon" href="https://familine.minteck.org/icns/familine-help.svg"> - <link rel="stylesheet" href="https://familine.minteck.org/styles.css"> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script> - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> -</head> -<body> - <div class="container" style="margin-top:30px;"> - <h1>Centre d'aide de Familine</h1> - <p>Obtenez de l'aide avec Familine, rapidement et simplement. Pour commencer, choisissez la catégorie correspondante à votre question.</p> - <div class="list-group"> - <a href="/account" class="list-group-item list-group-item-action">Compte Familine</a> - <a href="/media" class="list-group-item list-group-item-action">Service en ligne multimédia (Familine Movies et Photos)</a> - <a href="/money" class="list-group-item list-group-item-action">Comptes bancaires Familine Money (Faminey)</a> - <a href="/review" class="list-group-item list-group-item-action">Stockage en réseau (Familine Review)</a> - <a href="/share" class="list-group-item list-group-item-action">Partager des fichiers avec Familine Share</a> - <a href="/wiki" class="list-group-item list-group-item-action">Accéder à la nouvelle version de Famiwiki (Familine Docs)</a> - <a href="/legal" class="list-group-item list-group-item-action">Mentions légales</a> - </div> +<?php $_TITLE = "Accueil"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container" style="text-align: center;"> + <h1>Familine Recall</h1> + <p><i>La généalogie familiale simplifiée et accessible à tous</i></p> + + <h2>Pour vous</h2> + <div class="list-group"> + <a href="/me" class="list-group-item list-group-item-action">Consulter la généalogie à partir de vous</a> </div> - <script> - console.log("Injecting Familine header") - document.body.innerHTML = document.body.innerHTML + "<iframe style=\"position:fixed;left:0;right:0;top:0;border: none;width: 100%;height:32px;\" src=\"https://<?= /** @var array $_CONFIG */ - $_CONFIG["Global"]["domain"] ?>/statusbar.php\"></iframe>"; - document.getElementsByTagName("html")[0].style.marginTop = "32px"; - document.getElementsByTagName("html")[0].style.height = "calc(100vh - 32px)"; - </script> -</body> -</html>
\ No newline at end of file + <br> + + <h2>Statistiques</h2> + <ul class="list-group"> + <li class="list-group-item"><?= count($data); ?> personnes</li> + <li class="list-group-item"> + <?php + + $male = 0; + $female = 0; + foreach ($data as $id => $person) { + if (isset($person["sex"])) { + if ($person["sex"] === "F") { + $female++; + } else { + $male++; + } + } + } + $total = $male + $female; + echo(round(($female/$total) * 100, 2) . "% de femmes pour " . round(($male/$total) * 100, 2) . "% d'hommes"); + + ?> + </li> + <li class="list-group-item"><?php + + $uniqueNames = []; + foreach ($data as $person) { + if (!in_array($person["famname"], $uniqueNames)) { + $uniqueNames[] = $person["famname"]; + } + } + + echo(count($uniqueNames) . " noms de familles uniques") + + ?></li> + <li class="list-group-item"><?= round(filesize($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json") / 1024) ?> Ko de données</li> + <li class="list-group-item"> + <?php + + $numChildren = []; + foreach ($data as $person) { + if (isset($person["family"])) { + $numChildren[] = count($person["family"]["children"]); + } + } + echo(round(array_sum($numChildren)/count($numChildren), 2) . " enfants en moyenne par famille"); + echo(" <span class='text-muted'>(statistiques calculées sur " . count($numChildren) . " familles)</span>"); + + ?> + </li> + <li class="list-group-item"> + <?php + + $deathAge = []; + foreach ($data as $id => $person) { + if (isset($person["death"]["date"]["year"]) && isset($person["birth"]["date"]["year"])) { + $deathAge[$id] = $person["death"]["date"]["year"] - $person["birth"]["date"]["year"]; + } + } + echo("Décès en moyenne à " . round(array_sum($deathAge)/count($deathAge), 2) . " ans"); + echo(" <span class='text-muted'>(statistiques calculées sur " . count($deathAge) . " personnes)</span>"); + + ?> + </li> + <li class="list-group-item"> + <?php + + $deathAge = []; + foreach ($data as $id => $person) { + if (isset($person["death"]["date"]["year"]) && isset($person["birth"]["date"]["year"])) { + $deathAge[$id] = $person["death"]["date"]["year"] - $person["birth"]["date"]["year"]; + } + } + echo("Personne la plus vieille décédée à " . max($deathAge) . " ans"); + echo(" (<a href='/person/?_=" . array_search(max($deathAge), $deathAge) . "'>" . $data[array_search(max($deathAge), $deathAge)]["famname"] . " " . $data[array_search(max($deathAge), $deathAge)]["surname"] . "</a>, †" . $data[array_search(max($deathAge), $deathAge)]["death"]["date"]["year"] . ")"); + echo(" <span class='text-muted'>(statistiques calculées sur " . count($deathAge) . " personnes)</span>"); + + ?> + </li> + <li class="list-group-item"> + <?php + + $deathAge = []; + foreach ($data as $id => $person) { + if (isset($person["death"]["date"]["year"]) && isset($person["birth"]["date"]["year"])) { + $deathAge[$id] = $person["death"]["date"]["year"] - $person["birth"]["date"]["year"]; + } + } + echo("Personne la plus jeune décédée à " . min($deathAge) . " ans"); + echo(" (<a href='/person/?_=" . array_search(min($deathAge), $deathAge) . "'>" . $data[array_search(min($deathAge), $deathAge)]["famname"] . " " . $data[array_search(min($deathAge), $deathAge)]["surname"] . "</a>, †" . $data[array_search(min($deathAge), $deathAge)]["death"]["date"]["year"] . ")"); + echo(" <span class='text-muted'>(statistiques calculées sur " . count($deathAge) . " personnes)</span>"); + + ?> + </li> + <li class="list-group-item"> + <?php + + $numChildren = []; + foreach ($data as $id => $person) { + if (isset($person["family"])) { + $numChildren[$id] = count($person["family"]["children"]); + } + } + echo("Famille la plus grande avec " . max($numChildren) . " enfants"); + echo(" (<a href='/person/?_=" . array_search(max($numChildren), $numChildren) . "'>" . $data[array_search(max($numChildren), $numChildren)]["famname"] . " " . $data[array_search(max($numChildren), $numChildren)]["surname"] . "</a>)"); + echo(" <span class='text-muted'>(statistiques calculées sur " . count($numChildren) . " familles)</span>"); + + ?> + </li> + + <li class="list-group-item"> + <?php + + $ageWhenMarried = []; + foreach ($data as $id => $person) { + if (isset($person["family"])) { + if (isset($person["family"]["marriage"]["date"]["year"]) && isset($person["birth"]["date"]["year"])) { + $ageWhenMarried[$id] = $person["family"]["marriage"]["date"]["year"] - $person["birth"]["date"]["year"]; + } + } + } + echo("Mariage en moyenne à " . round(array_sum($ageWhenMarried)/count($ageWhenMarried), 2) . " ans"); + echo(" <span class='text-muted'>(statistiques calculées sur " . count($ageWhenMarried) . " familles)</span>"); + + ?> + </li> + <li class="list-group-item"> + <?php + + $ageWhenMarried = []; + foreach ($data as $id => $person) { + if (isset($person["family"])) { + if (isset($person["family"]["marriage"]["date"]["year"]) && isset($person["birth"]["date"]["year"])) { + $ageWhenMarried[$id] = $person["family"]["marriage"]["date"]["year"] - $person["birth"]["date"]["year"]; + } + } + } + echo("Mariage le plus tard à " . max($ageWhenMarried) . " ans"); + echo(" (<a href='/person/?_=" . array_search(max($ageWhenMarried), $ageWhenMarried) . "'>" . $data[array_search(max($ageWhenMarried), $ageWhenMarried)]["famname"] . " " . $data[array_search(max($ageWhenMarried), $ageWhenMarried)]["surname"] . "</a>)"); + echo(" <span class='text-muted'>(statistiques calculées sur " . count($ageWhenMarried) . " familles)</span>"); + + ?> + </li> + <li class="list-group-item"> + <?php + + $ageWhenMarried = []; + foreach ($data as $id => $person) { + if (isset($person["family"])) { + if (isset($person["family"]["marriage"]["date"]["year"]) && isset($person["birth"]["date"]["year"])) { + $ageWhenMarried[$id] = $person["family"]["marriage"]["date"]["year"] - $person["birth"]["date"]["year"]; + } + } + } + echo("Mariage le plus tôt à " . min($ageWhenMarried) . " ans"); + echo(" (<a href='/person/?_=" . array_search(min($ageWhenMarried), $ageWhenMarried) . "'>" . $data[array_search(min($ageWhenMarried), $ageWhenMarried)]["famname"] . " " . $data[array_search(min($ageWhenMarried), $ageWhenMarried)]["surname"] . "</a>)"); + echo(" <span class='text-muted'>(statistiques calculées sur " . count($ageWhenMarried) . " familles)</span>"); + + ?> + </li> + </ul> + <br> + + <h2>Lancer une recherche</h2> + <div class="list-group"> + <a href="/search/name" class="list-group-item list-group-item-action">Rechercher par prénom</a> + <a href="/search/lastname" class="list-group-item list-group-item-action">Rechercher par nom</a> + <a href="/search/birth" class="list-group-item list-group-item-action">Rechercher par date de naissance</a> + <a href="/search/death" class="list-group-item list-group-item-action">Rechercher par date de décès</a> + <a href="/search/marriage" class="list-group-item list-group-item-action">Rechercher par date de mariage</a> + <a href="/search/city" class="list-group-item list-group-item-action">Rechercher par ville</a> + <a href="/search/dept" class="list-group-item list-group-item-action">Rechercher par département</a> + <a href="/search/state" class="list-group-item list-group-item-action">Rechercher par région</a> + </div> + +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/lib/LICENSE b/lib/LICENSE new file mode 100644 index 0000000..6fd9ab3 --- /dev/null +++ b/lib/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Remi-Leclercq-Blondel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/tree_maker-min.css b/lib/tree_maker-min.css new file mode 100644 index 0000000..944d36e --- /dev/null +++ b/lib/tree_maker-min.css @@ -0,0 +1 @@ +#from_tree__container__step__card__first,.tree__container,.tree__container__branch{display:flex;flex-direction:row;justify-content:center}.tree__container__step__card{text-align:center;margin:20px}.tree__container__step__card p{padding:10px;box-shadow:0 0 4px 1px rgba(121,121,121,.3);border-radius:4px;text-align:center;width:150px;display:inline-block;margin:0!important}#tree__svg-container{z-index:-1;position:absolute}.tree__container__step{flex:1 1 0px;width:auto;padding:0}.tree__container__step__card__p{cursor:pointer;transition:transform .2s ease}.tree__container__step__card__p:hover{transform:translateX(3px)}
\ No newline at end of file diff --git a/lib/tree_maker-min.js b/lib/tree_maker-min.js new file mode 100644 index 0000000..8a56741 --- /dev/null +++ b/lib/tree_maker-min.js @@ -0,0 +1 @@ +let treeParamas,pathNumber=1,allLinks=[],strokeWidth="5px",strokeColor="#000000";function treeMaker(t,e){let r=document.getElementById(e.id);treeParamas=void 0===e.treeParams?{}:e.treeParams,void 0!==e.link_width&&(strokeWidth=e.link_width),void 0!==e.link_color&&(strokeColor=e.link_color);pathNumber=1;allLinks=[];let n=document.createElement("div");n.id="tree__svg-container",r.appendChild(n);let a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.id="tree__svg-container__svg",n.appendChild(a);let i=document.createElement("div");i.id="tree__container",r.appendChild(i);let s=document.createElement("div");s.classList="tree__container__step__card",s.id="tree__container__step__card__first",i.appendChild(s);let o=void 0!==treeParamas[Object.keys(t)[0]]&&void 0!==treeParamas[Object.keys(t)[0]].trad?treeParamas[Object.keys(t)[0]].trad:Object.keys(t)[0].trad;s.innerHTML='<p class="tree__container__step__card__p" id="card_'+Object.keys(t)[0]+'">'+o+"</p>",addStyleToCard(treeParamas[Object.keys(t)[0]],Object.keys(t)[0]),iterate(t[Object.keys(t)[0]],!0,"tree__container__step__card__first"),connectCard();let d=document.querySelectorAll(".tree__container__step__card__p");for(let t=0;d.length>t;t++)d[t].addEventListener("click",function(t){e.card_click(t.target)});window.onresize=function(){n.setAttribute("height","0"),n.setAttribute("width","0"),connectCard()}}function connectCard(){let t=document.getElementById("tree__svg-container__svg");for(let e=0;allLinks.length>e;e++)connectElements(t,document.getElementById(allLinks[e][0]),document.getElementById(allLinks[e][1]),document.getElementById(allLinks[e][2]))}function iterate(t,e=!1,r=""){let n=document.getElementById("tree__svg-container__svg"),a=document.createElement("div");a.id="from_"+r,a.classList.add("tree__container__branch"),document.getElementById(r).after(a);for(const i in t){let s=void 0!==treeParamas[i]&&void 0!==treeParamas[i].trad?treeParamas[i].trad:i;if(a.innerHTML+='<div class="tree__container__step"><div class="tree__container__step__card" id="'+i+'"><p id="card_'+i+'" class="tree__container__step__card__p">'+s+"</p></div></div>",addStyleToCard(treeParamas[i],i),""!==r&&!e){let t=document.createElementNS("http://www.w3.org/2000/svg","path");t.id="path"+pathNumber,t.setAttribute("stroke",strokeColor),t.setAttribute("fill","none"),t.setAttribute("stroke-width",strokeWidth),n.appendChild(t),allLinks.push(["path"+pathNumber,r,i]),pathNumber++}if(e){let t=document.createElementNS("http://www.w3.org/2000/svg","path");t.id="path"+pathNumber,t.setAttribute("stroke",strokeColor),t.setAttribute("fill","none"),t.setAttribute("stroke-width",strokeWidth),n.appendChild(t),allLinks.push(["path"+pathNumber,"tree__container__step__card__first",i]),pathNumber++}Object.keys(t[i]).length>0&&iterate(t[i],!1,i)}}function addStyleToCard(t,e){if(void 0!==t&&void 0!==t.styles){let r=document.getElementById("card_"+e);for(const n in treeParamas[e].styles)r.style[n]=t.styles[n]}}function signum(t){return t<0?-1:1}function absolute(t){return t<0?-t:t}function drawPath(t,e,r,n,a,i){let s=parseFloat(e.getAttribute("stroke-width"));t.getAttribute("height")<i&&t.setAttribute("height",i),t.getAttribute("width")<r+s&&t.setAttribute("width",r+s),t.getAttribute("width")<a+s&&t.setAttribute("width",a+s);let o=.15*(a-r),d=.15*(i-n),l=d<absolute(o)?d:absolute(o),c=0,_=1;r>a&&(c=1,_=0),e.setAttribute("d","M"+r+" "+n+" V"+(n+l)+" A"+l+" "+l+" 0 0 "+c+" "+(r+l*signum(o))+" "+(n+2*l)+" H"+(a-l*signum(o))+" A"+l+" "+l+" 0 0 "+_+" "+a+" "+(n+3*l)+" V"+i)}function connectElements(t,e,r,n){let a=document.getElementById("tree__svg-container");if(r.offsetTop>n.offsetTop){let t=r;r=n,n=t}let i=a.offsetTop,s=a.offsetLeft;drawPath(t,e,r.offsetLeft+.5*r.offsetWidth-s,r.offsetTop+r.offsetHeight-i,n.offsetLeft+.5*n.offsetWidth-s,n.offsetTop-i)} diff --git a/me/index.php b/me/index.php new file mode 100644 index 0000000..dff5ad0 --- /dev/null +++ b/me/index.php @@ -0,0 +1,38 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$first = strtolower(explode(" ", $_FULLNAME)[1]); +$last = strtolower(explode(" ", $_FULLNAME)[0]); + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +$found = null; +foreach ($data as $id => $person) { + if (strtolower($person["surname"]) === $first && strtolower($person["famname"]) === $last) { + $found = $id; + } +} + +$id = $found; + +if (isset($found)): + header("Location: /person/?_=" . $id); + die(); +else: ?> + <?php $_TITLE = "Erreur"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> + <div class="container"> + <h1>Erreur</h1> + <div class="alert alert-danger"> + Aucune entrée vous correspondant n'a été trouvée dans la généalogie. Si vous pensez qu'il s'agit d'une erreur, utilisez la fonction de recherche pour vous trouver. + </div> + </div> + <br> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?> +<?php endif; ?> diff --git a/person/index.php b/person/index.php new file mode 100644 index 0000000..f44651b --- /dev/null +++ b/person/index.php @@ -0,0 +1,360 @@ +<?php + +setlocale(LC_ALL, 'fr_FR.UTF-8'); +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +function getplace($place) { + $info = false; + + if (isset($place["city"])) { + $info = true; + echo("<a href='/search/city/?q=" . $place["city"] . "'>" . $place["city"] . "</a><br>"); + } + + if (isset($place["dept"])) { + $info = true; + echo("<a href='/search/dept/?q=" . $place["dept"] . "'>" . $place["dept"] . "</a><br>"); + } + + if (isset($place["country"])) { + $info = true; + echo($place["country"] . "<br>"); + } + + if (!$info) { + echo("Non renseigné"); + } +} + +if (isset($_GET['_']) && trim($_GET['_']) !== "" && isset($data[$_GET['_']])) { + $id = $_GET['_']; + $person = $data[$_GET['_']]; +} else { + header("Location: /"); + die(); +} + +$_TITLE = $person["famname"] . " " . $person["surname"] . " (#" . $id . ")"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container"> + <h1> + <?= $person["famname"] . " " . $person["surname"] . " <span class='text-muted'>#" . $id . "</span>" ?> + <a style="float:right;position: relative;top: 7px;" href="/tree/?_=<?= $id ?>" class="btn btn-outline-primary">Voir l'arbre</a> + </h1> + <br> + + <table class="table table-bordered table-dark"> + <tbody> + <tr> + <td colspan="2"> + <b>Noms et prénoms</b> + </td> + </tr> + <tr> + <td class="text-muted">Nom de famille</td> + <td><a href="/search/lastname/?q=<?= ucfirst(strtolower($person["famname"])) ?>"><?= strtoupper($person["famname"]) ?></a></td> + </tr> + <tr> + <td class="text-muted">Premier prénom</td> + <td><a href="/search/name/?q=<?= ucfirst(strtolower($person["surname"])) ?>"><?= $person["surname"] ?></a></td> + </tr> + <tr> + <td class="text-muted">Prénoms alternatifs</td> + <td><?php + + if (count($person["altnames"]) < 1) { + echo("Non applicable"); + } else { + foreach ($person["altnames"] as $name) { + echo('<a href="/search/name/?q=' . ucfirst(strtolower($name)) . '">' . $name . '</a><br>'); + } + } + + ?></td> + </tr> + <tr> + <td class="text-muted">Nom complet</td> + <td><?= strtoupper($person["famname"]) ?> <?= strtoupper($person["surname"]) ?> <?= strtoupper(implode(" ", $person["altnames"])) ?></td> + </tr> + </tbody> + </table> + + <table class="table table-bordered table-dark"> + <tbody> + <tr> + <td colspan="2"> + <b>Informations générales</b> + </td> + </tr> + <tr> + <td class="text-muted">Identifiant généalogique</td> + <td>#<?= $id ?></td> + </tr> + <tr> + <td class="text-muted">Sexe</td> + <td><?php + + if ($person["sex"] === "F") { + echo("Féminin"); + } else { + echo("Masculin"); + } + + ?></td> + </tr> + <?php if (isset($person["birth"]["date"]["day"])): ?> + <tr> + <td class="text-muted">Date de naissance</td> + <td><?= strftime("%A %e %B", strtotime($person["birth"]["date"]["day"] . "-" . $person["birth"]["date"]["month"] . "-" . $person["birth"]["date"]["year"])) ?> <a href="/search/birth/?q=<?= $person["birth"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["birth"]["date"]["year"])) ?></a></td> + </tr> + <?php elseif (isset($person["birth"]["date"]["month"])): ?> + <tr> + <td class="text-muted">Mois de naissance</td> + <td><?= strftime("%B", strtotime("1-" . $person["death"]["date"]["month"] . "-" . $person["death"]["date"]["year"])) ?> <a href="/search/birth/?q=<?= $person["birth"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["birth"]["date"]["year"])) ?></a></td> + </tr> + <?php elseif (isset($person["birth"]["date"]["year"])): ?> + <tr> + <td class="text-muted">Année de naissance</td> + <td><a href="/search/birth/?q=<?= $person["birth"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["birth"]["date"]["year"])) ?></a></td> + </tr> + <?php else: ?> + <tr> + <td class="text-muted">Date de naissance</td> + <td>Non renseignée</td> + </tr> + <?php endif; ?> + </tbody> + </table> + + <table class="table table-bordered table-dark"> + <tbody> + <tr> + <td colspan="2"> + <b>Lieux et endroits</b> + </td> + </tr> + <tr> + <td class="text-muted">Lieu de naissance</td> + <td><?php + + getplace($person["birth"]["place"]); + + ?></td> + </tr> + <tr> + <td class="text-muted">Lieu de décès</td> + <td><?php + + getplace($person["death"]["place"]); + + ?></td> + </tr> + <?php if (isset($person["family"]) && isset($person["family"]["marriage"])): ?> + <tr> + <td class="text-muted">Lieu de mariage</td> + <td><?php + + getplace($person["family"]["marriage"]["place"]); + + ?></td> + </tr> + <?php endif; ?> + </tbody> + </table> + + <table class="table table-bordered table-dark"> + <tbody> + <tr> + <td colspan="2"> + <b>Dates</b> + </td> + </tr> + <?php if (isset($person["birth"]["date"]["day"])): ?> + <tr> + <td class="text-muted">Date de naissance</td> + <td><?= strftime("%A %e %B", strtotime($person["birth"]["date"]["day"] . "-" . $person["birth"]["date"]["month"] . "-" . $person["birth"]["date"]["year"])) ?> <a href="/search/birth/?q=<?= $person["birth"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["birth"]["date"]["year"])) ?></a></td> + </tr> + <?php elseif (isset($person["birth"]["date"]["month"])): ?> + <tr> + <td class="text-muted">Mois de naissance</td> + <td><?= strftime("%B", strtotime("1-" . $person["birth"]["date"]["month"] . "-" . $person["birth"]["date"]["year"])) ?> <a href="/search/birth/?q=<?= $person["birth"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["birth"]["date"]["year"])) ?></a></td> + </tr> + <?php elseif (isset($person["birth"]["date"]["year"])): ?> + <tr> + <td class="text-muted">Année de naissance</td> + <td><a href="/search/birth/?q=<?= $person["birth"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["birth"]["date"]["year"])) ?></a></td> + </tr> + <?php else: ?> + <tr> + <td class="text-muted">Date de naissance</td> + <td>Non renseigné</td> + </tr> + <?php endif; ?> + <?php if (isset($person["death"]["date"]["day"])): ?> + <tr> + <td class="text-muted">Date de décès</td> + <td><?= strftime("%A %e %B", strtotime($person["death"]["date"]["day"] . "-" . $person["death"]["date"]["month"] . "-" . $person["death"]["date"]["year"])) ?> <a href="/search/death/?q=<?= $person["death"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["death"]["date"]["year"])) ?></a></td> + </tr> + <?php elseif (isset($person["death"]["date"]["month"])): ?> + <tr> + <td class="text-muted">Mois de décès</td> + <td><?= strftime("%B", strtotime("1-" . $person["death"]["date"]["month"] . "-" . $person["death"]["date"]["year"])) ?> <a href="/search/death/?q=<?= $person["death"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["death"]["date"]["year"])) ?></a></td> + </tr> + <?php elseif (isset($person["death"]["date"]["year"])): ?> + <tr> + <td class="text-muted">Année de décès</td> + <td><a href="/search/death/?q=<?= $person["death"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["death"]["date"]["year"])) ?></a></td> + </tr> + <?php else: ?> + <tr> + <td class="text-muted">Date de décès</td> + <td>Non applicable</td> + </tr> + <?php endif; ?> + <?php if (isset($person["family"]) && isset($person["family"]["marriage"])): ?> + <?php if (isset($person["family"]["marriage"]["date"]["day"])): ?> + <tr> + <td class="text-muted">Date de mariage</td> + <td><?= strftime("%A %e %B", strtotime($person["family"]["marriage"]["date"]["day"] . "-" . $person["family"]["marriage"]["date"]["month"] . "-" . $person["family"]["marriage"]["date"]["year"])) ?> <a href="/search/marriage/?q=<?= $person["family"]["marriage"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["family"]["marriage"]["date"]["year"])) ?></a></td> + </tr> + <?php elseif (isset($person["family"]["marriage"]["date"]["month"])): ?> + <tr> + <td class="text-muted">Mois de mariage</td> + <td><?= strftime("%B", strtotime("1-" . $person["family"]["marriage"]["date"]["month"] . "-" . $person["family"]["marriage"]["date"]["year"])) ?> <a href="/search/marriage/?q=<?= $person["family"]["marriage"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["family"]["marriage"]["date"]["year"])) ?></a></td> + </tr> + <?php elseif (isset($person["family"]["marriage"]["date"]["year"])): ?> + <tr> + <td class="text-muted">Année de mariage</td> + <td><a href="/search/marriage/?q=<?= $person["family"]["marriage"]["date"]["year"] ?>"><?= strftime("%Y", strtotime("1-1-" . $person["family"]["marriage"]["date"]["year"])) ?></a></td> + </tr> + <?php else: ?> + <tr> + <td class="text-muted">Date de mariage</td> + <td>Non applicable</td> + </tr> + <?php endif; ?> + <?php else: ?> + <tr> + <td class="text-muted">Date de mariage</td> + <td>Non applicable</td> + </tr> + <?php endif; ?> + </tbody> + </table> + + <table class="table table-bordered table-dark"> + <tbody> + <tr> + <td colspan="2"> + <b>Liens de parenté</b> + </td> + </tr> + <tr> + <td class="text-muted"><?= $person["sex"] === "F" ? "Époux" : "Épouse" ?></td> + <td><?php + + $soid = $person["sex"] === "F" ? "husband" : "wife"; + + if (isset($person["family"]) && isset($person["family"][$soid])) { + echo("<a href='/person/?_=" . $person["family"][$soid] . "'>" . $data[$person["family"][$soid]]["famname"] . " " . $data[$person["family"][$soid]]["surname"] . " (#" . $person["family"][$soid] . ")</a>"); + } else { + echo("Non applicable"); + } + + if (isset($person["family"]["marriage"]) && isset($person["family"]["marriage"]["date"]["year"]) && isset($person["birth"]["date"]["year"])) { + echo(" (marié" . ($person["sex"] === "F" ? "e" : "") . " à " . ($person["family"]["marriage"]["date"]["year"] - $person["birth"]["date"]["year"]) . " ans)"); + } else if (!isset($person["family"]["marriage"])) { + echo(" (pas de mariage)"); + } + + ?></td> + </tr> + <tr> + <td class="text-muted">Enfant<?php + + if (isset($person["family"]) && isset($person["family"]["children"])) { + if (count($person["family"]["children"]) > 1) { + echo("s"); + } + } + + ?></td> + <td><?php + + $found = false; + if (isset($person["family"]) && isset($person["family"]["children"])) { + foreach ($person["family"]["children"] as $child) { + $found = true; + echo("<a href='/person/?_=" . $child . "'>" . $data[$child]["famname"] . " " . $data[$child]["surname"] . " (#" . $child . ")</a>"); + if (isset($person["birth"]["date"]["year"]) && isset($data[$child]["birth"]["date"]["year"])) { + echo(" (né" . ($data[$child]["sex"] === "F" ? "e" : "") . " à " . ($data[$child]["birth"]["date"]["year"] - $person["birth"]["date"]["year"]) . " ans)"); + } + echo("<br>"); + } + } + + if (!$found) { + echo("Non applicable"); + } + + ?></td> + </tr> + <tr> + <td class="text-muted">Père</td> + <td><?php + + $found = false; + foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($id, $potential["family"]["children"]) && $potential["sex"] !== "F") { + $found = true; + echo("<a href='/person/?_=" . $potid . "'>" . $potential["famname"] . " " . $potential["surname"] . " (#" . $potid . ")</a><br>"); + } + } + + if (!$found) { + echo("Non renseigné"); + } + + ?></td> + </tr> + <tr> + <td class="text-muted">Mère</td> + <td><?php + + $found = false; + foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($id, $potential["family"]["children"]) && $potential["sex"] === "F") { + $found = true; + echo("<a href='/person/?_=" . $potid . "'>" . $potential["famname"] . " " . $potential["surname"] . " (#" . $potid . ")</a><br>"); + } + } + + if (!$found) { + echo("Non renseigné"); + } + + ?></td> + </tr> + </tbody> + </table> + + <style> + .table { + border-radius: 5px; + } + + .table td { + width: 50%; + } + + .table td:nth-child(1) { + text-align: right; + } + + .table td[colspan="2"] { + text-align: center; + } + </style> + +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/private/footer.php b/private/footer.php new file mode 100644 index 0000000..0e6e65c --- /dev/null +++ b/private/footer.php @@ -0,0 +1,16 @@ + <script> + <?php global $_CONFIG; ?>console.log("Injecting Familine header") + document.body.innerHTML = document.body.innerHTML + "<iframe style=\"position:fixed;left:0;right:0;top:0;border: none;width: 100%;height:32px;\" src=\"https://<?= /** @var array $_CONFIG */ + $_CONFIG["Global"]["domain"] ?>/statusbar.php\"></iframe>"; + document.getElementsByTagName("html")[0].style.marginTop = "32px"; + document.getElementsByTagName("html")[0].style.height = "calc(100vh - 32px)"; + </script> + <?php if (isset($_GET['q'])): ?> + <script> + window.addEventListener('load', () => { + $(".flexdatalist").flexdatalist('value', "<?= strip_tags(str_replace("\"", "''", $_GET['q'])) ?>"); + }); + </script> + <?php endif; ?> +</body> +</html>
\ No newline at end of file diff --git a/private/header.php b/private/header.php new file mode 100644 index 0000000..a648f27 --- /dev/null +++ b/private/header.php @@ -0,0 +1,125 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +if (isset($_PROFILE["projectRoles"]) && is_array($_PROFILE["projectRoles"]) && isset($_PROFILE["projectRoles"][0]) && is_array($_PROFILE["projectRoles"][0]) && isset($_PROFILE["projectRoles"][0]["role"]) && is_array($_PROFILE["projectRoles"][0]["role"]) && isset($_PROFILE["projectRoles"][0]["role"]["key"]) && is_string($_PROFILE["projectRoles"][0]["role"]["key"]) && $_PROFILE["projectRoles"][0]["role"]["key"] === "system-admin") { + $_ADMIN = true; +} else { + $_ADMIN = false; +} + +?> +<?php + +$_USER = $_PROFILE['login']; + +global $_USER; + +if (!isset($_TITLE)) { + $_TITLE = "Accueil"; +} + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +?> +<!DOCTYPE html> +<html lang="fr"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link href="/dllib/jquery.flexdatalist.min.css" rel="stylesheet" type="text/css"> + <script src="/dllib/jquery.js"></script> + <script src="/dllib/org.js"></script> + <title><?= $_TITLE ?> | Familine Recall</title> + <style> + :root { + --primary-color: #217ca3; + --shadow-color: rgba(0, 157, 255, 0.25); + --border-color: #80bbff; + --primary: var(--primary-color); + } + + .btn-outline-primary { + border-color: var(--primary-color) !important; + color: var(--primary-color) !important; + } + + .btn-outline-primary:hover { + background: var(--primary-color) !important; + color: white !important; + } + + .btn-primary, .alert-primary, .bg-primary, .table-primary, .badge-primary, .dropdown-item:active, .dropdown-item.active { + background-color: var(--primary-color) !important; + } + + .border-primary, .btn-primary { + border-color: var(--primary-color) !important; + } + + .text-primary { + color: var(--primary-color) !important; + } + + a:not(.navbar-brand):not(.dropdown-item):not(.btn):not(.nav-link), a:not(.navbar-brand):not(.dropdown-item):not(.btn):not(.nav-link):hover, a:not(.navbar-brand):not(.dropdown-item):not(.btn):not(.nav-link):active, a:not(.navbar-brand):not(.dropdown-item):not(.btn):not(.nav-link):focus { + color: var(--primary-color) !important; + } + + a:not(.navbar-brand):not(.dropdown-item):not(.btn):not(.nav-link):hover { + opacity: .75; + } + + a:not(.navbar-brand):not(.dropdown-item):not(.btn):not(.nav-link):active, a:not(.navbar-brand):not(.dropdown-item):not(.btn):not(.nav-link):focus { + opacity: .5; + } + + .form-control:focus, .btn:focus { + border-color: var(--border-color) !important; + box-shadow: 0 0 0 .2rem var(--shadow-color) !important; + } + </style> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> + <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> + <link rel="stylesheet" href="/styles/common.css"> + <link rel="icon" href="https://<?= $_CONFIG["Global"]["domain"] ?>/icns/familine-recall.svg"> +</head> +<body> + <nav class="navbar navbar-expand-sm bg-light navbar-light"> + <a class="navbar-brand" href="/">Familine Recall</a> + <ul class="navbar-nav" style="width: 100%;"> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown"> + Rechercher + </a> + <div class="dropdown-menu"> + <a class="dropdown-item" href="/search/name">Par prénom</a> + <a class="dropdown-item" href="/search/lastname">Par nom</a> + <div class="dropdown-divider"></div> + <a class="dropdown-item" href="/search/birth">Par date de naissance</a> + <a class="dropdown-item" href="/search/death">Par date de décès</a> + <a class="dropdown-item" href="/search/marriage">Par date de mariage</a> + <div class="dropdown-divider"></div> + <a class="dropdown-item" href="/search/city">Par ville</a> + <a class="dropdown-item" href="/search/dept">Par département</a> + <a class="dropdown-item" href="/search/state">Par région</a> + </div> + </li> + <li class="nav-item"> + <a class="nav-link" href="/me">Ma famille</a> + </li> + </ul> + + <span class="navbar-text" style="width:100%;text-align:right;"> + @<?= $_USER ?> + </span> + </nav> + <br> diff --git a/search/birth/data.json/index.php b/search/birth/data.json/index.php new file mode 100644 index 0000000..5baf427 --- /dev/null +++ b/search/birth/data.json/index.php @@ -0,0 +1,39 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +header("Content-Type: application/json"); + +$arr = []; +$names = []; +$counts = []; + +foreach ($data as $id => $person) { + if (isset($person["birth"]["date"]) && isset($person["birth"]["date"]["year"])) { + if (isset($counts[(string)$person["birth"]["date"]["year"]])) { + $counts[(string)$person["birth"]["date"]["year"]]++; + } else { + $counts[(string)$person["birth"]["date"]["year"]] = 1; + } + if (!in_array((string)$person["birth"]["date"]["year"], $names)) { + $names[] = (string)$person["birth"]["date"]["year"]; + } + } +} + +foreach ($names as $name) { + $arr[] = [ + 'name' => $name, + 'occurrences' => $counts[$name] . " personne" . ($counts[$name] > 1 ? "s" : "") + ]; +} + +echo(json_encode($arr));
\ No newline at end of file diff --git a/search/birth/index.php b/search/birth/index.php new file mode 100644 index 0000000..2e412a4 --- /dev/null +++ b/search/birth/index.php @@ -0,0 +1,73 @@ +<?php $_TITLE = "Recherche par date de naissance"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container"> + <h2>Rechercher par date de naissance</h2> + <p id="preview">Patientez...</p> + <script src="/dllib/jquery.flexdatalist.min.js"></script> + <div class="input-group mt-3 mb-3"> + <div class="input-group-prepend"> + <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> + Par date de naissance + </button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="/search/name">Par prénom</a> + <a class="dropdown-item" href="/search/lastname">Par nom</a> + <a class="dropdown-item active" href="/search/birth">Par date de naissance</a> + <a class="dropdown-item" href="/search/death">Par date de décès</a> + <a class="dropdown-item" href="/search/marriage">Par date de mariage</a> + <a class="dropdown-item" href="/search/city">Par ville</a> + <a class="dropdown-item" href="/search/dept">Par département</a> + <a class="dropdown-item" href="/search/state">Par région</a> + </div> + </div> + <input onchange="reload();" class="form-control" type="text" + placeholder="Commencer à taper une année..." + id="search"> + </div> + <script> + setInterval(() => { + if (document.getElementById("search").value.trim() !== "") { + document.getElementById("preview").innerText = "Affiche toutes les personnes nées en " + document.getElementById("search").value; + } else { + document.getElementById("preview").innerText = "Sélectionnez une année"; + } + }, 100) + + function reload() { + window.fetch("./results/?q=" + encodeURI(document.getElementById("search").value.trim())).then((a) => { + a.text().then((b) => { + document.getElementById("results").innerHTML = b; + }) + }) + } + + window.addEventListener("load", () => { + i = Math.random().toString().substr(2); + document.getElementById('search').classList.add(i); + $('#search.' + i).flexdatalist({ + cache: false, + minLength: 0, + selectionRequired: true, + visibleProperties: ["name","occurrences"], + searchIn: 'name', + data: "data.json" + }); + }) + </script> + <style> + .flexdatalist-results li { + cursor: pointer; + } + .flexdatalist-results li .item-occurrences { + color: rgba(0, 0, 0, .25); + } + .flexdatalist-results li:hover { + opacity: .75; + } + .flexdatalist-results li:active { + opacity: .5; + } + </style> + <div id="results"></div> +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/search/birth/results/index.php b/search/birth/results/index.php new file mode 100644 index 0000000..6104373 --- /dev/null +++ b/search/birth/results/index.php @@ -0,0 +1,38 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +if (isset($_GET['q']) && trim($_GET['q']) !== "") { + $q = $_GET['q']; +} else { + die(); +} + +$results = []; + +foreach ($data as $id => $person) { + if (isset($person["birth"]["date"]) && isset($person["birth"]["date"]["year"])) { + if ((string)$person["birth"]["date"]["year"] === $q) { + $results[] = $id; + } + } +} +if (count($results) === 0): ?> +<ul class="list-group"> + <li class="list-group-item">Aucun résultat correspondant</li> +</ul> +<?php else: ?> +<div class="list-group"> + <?php foreach ($results as $result): $p = $data[$result]; ?> + <a href="/person/?_=<?= $result ?>" class="list-group-item list-group-item-action"><?= $p["famname"] ?> <?= $p["surname"] ?> <span class="text-muted">#<?= $result ?></span></a> + <?php endforeach; ?> +</div> +<?php endif; ?>
\ No newline at end of file diff --git a/search/city/data.json/index.php b/search/city/data.json/index.php new file mode 100644 index 0000000..fdf0665 --- /dev/null +++ b/search/city/data.json/index.php @@ -0,0 +1,39 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +header("Content-Type: application/json"); + +$arr = []; +$names = []; +$counts = []; + +foreach ($data as $id => $person) { + if (isset($person["birth"]["place"]) && isset($person["birth"]["place"]["city"])) { + if (isset($counts[$person["birth"]["place"]["city"]])) { + $counts[$person["birth"]["place"]["city"]]++; + } else { + $counts[$person["birth"]["place"]["city"]] = 1; + } + if (!in_array($person["birth"]["place"]["city"], $names)) { + $names[] = $person["birth"]["place"]["city"]; + } + } +} + +foreach ($names as $name) { + $arr[] = [ + 'name' => $name, + 'occurrences' => $counts[$name] . " personne" . ($counts[$name] > 1 ? "s" : "") + ]; +} + +echo(json_encode($arr));
\ No newline at end of file diff --git a/search/city/index.php b/search/city/index.php new file mode 100644 index 0000000..0c3825e --- /dev/null +++ b/search/city/index.php @@ -0,0 +1,73 @@ +<?php $_TITLE = "Recherche par ville de naissance"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container"> + <h2>Rechercher par ville de naissance</h2> + <p id="preview">Patientez...</p> + <script src="/dllib/jquery.flexdatalist.min.js"></script> + <div class="input-group mt-3 mb-3"> + <div class="input-group-prepend"> + <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> + Par ville + </button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="/search/name">Par prénom</a> + <a class="dropdown-item" href="/search/lastname">Par nom</a> + <a class="dropdown-item" href="/search/birth">Par date de naissance</a> + <a class="dropdown-item" href="/search/death">Par date de décès</a> + <a class="dropdown-item" href="/search/marriage">Par date de mariage</a> + <a class="dropdown-item active" href="/search/city">Par ville</a> + <a class="dropdown-item" href="/search/dept">Par département</a> + <a class="dropdown-item" href="/search/state">Par région</a> + </div> + </div> + <input onchange="reload();" class="form-control" type="text" + placeholder="Commencer à taper une ville..." + id="search"> + </div> + <script> + setInterval(() => { + if (document.getElementById("search").value.trim() !== "") { + document.getElementById("preview").innerText = "Affiche toutes les personnes nées à " + document.getElementById("search").value; + } else { + document.getElementById("preview").innerText = "Sélectionnez une ville"; + } + }, 100) + + function reload() { + window.fetch("./results/?q=" + encodeURI(document.getElementById("search").value.trim())).then((a) => { + a.text().then((b) => { + document.getElementById("results").innerHTML = b; + }) + }) + } + + window.addEventListener("load", () => { + i = Math.random().toString().substr(2); + document.getElementById('search').classList.add(i); + $('#search.' + i).flexdatalist({ + cache: false, + minLength: 0, + selectionRequired: true, + visibleProperties: ["name","occurrences"], + searchIn: 'name', + data: "data.json" + }); + }) + </script> + <style> + .flexdatalist-results li { + cursor: pointer; + } + .flexdatalist-results li .item-occurrences { + color: rgba(0, 0, 0, .25); + } + .flexdatalist-results li:hover { + opacity: .75; + } + .flexdatalist-results li:active { + opacity: .5; + } + </style> + <div id="results"></div> +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/search/city/results/index.php b/search/city/results/index.php new file mode 100644 index 0000000..8dafdfa --- /dev/null +++ b/search/city/results/index.php @@ -0,0 +1,38 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +if (isset($_GET['q']) && trim($_GET['q']) !== "") { + $q = $_GET['q']; +} else { + die(); +} + +$results = []; + +foreach ($data as $id => $person) { + if (isset($person["birth"]["place"]) && isset($person["birth"]["place"]["city"])) { + if ($person["birth"]["place"]["city"] === $q) { + $results[] = $id; + } + } +} +if (count($results) === 0): ?> +<ul class="list-group"> + <li class="list-group-item">Aucun résultat correspondant</li> +</ul> +<?php else: ?> +<div class="list-group"> + <?php foreach ($results as $result): $p = $data[$result]; ?> + <a href="/person/?_=<?= $result ?>" class="list-group-item list-group-item-action"><?= $p["famname"] ?> <?= $p["surname"] ?> <span class="text-muted">#<?= $result ?></span></a> + <?php endforeach; ?> +</div> +<?php endif; ?>
\ No newline at end of file diff --git a/search/death/data.json/index.php b/search/death/data.json/index.php new file mode 100644 index 0000000..8cc8708 --- /dev/null +++ b/search/death/data.json/index.php @@ -0,0 +1,39 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +header("Content-Type: application/json"); + +$arr = []; +$names = []; +$counts = []; + +foreach ($data as $id => $person) { + if (isset($person["death"]["date"]) && isset($person["death"]["date"]["year"])) { + if (isset($counts[(string)$person["death"]["date"]["year"]])) { + $counts[(string)$person["death"]["date"]["year"]]++; + } else { + $counts[(string)$person["death"]["date"]["year"]] = 1; + } + if (!in_array((string)$person["death"]["date"]["year"], $names)) { + $names[] = (string)$person["death"]["date"]["year"]; + } + } +} + +foreach ($names as $name) { + $arr[] = [ + 'name' => $name, + 'occurrences' => $counts[$name] . " personne" . ($counts[$name] > 1 ? "s" : "") + ]; +} + +echo(json_encode($arr));
\ No newline at end of file diff --git a/search/death/index.php b/search/death/index.php new file mode 100644 index 0000000..73b7742 --- /dev/null +++ b/search/death/index.php @@ -0,0 +1,73 @@ +<?php $_TITLE = "Recherche par date de décès"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container"> + <h2>Rechercher par date de décès</h2> + <p id="preview">Patientez...</p> + <script src="/dllib/jquery.flexdatalist.min.js"></script> + <div class="input-group mt-3 mb-3"> + <div class="input-group-prepend"> + <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> + Par date de décès + </button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="/search/name">Par prénom</a> + <a class="dropdown-item" href="/search/lastname">Par nom</a> + <a class="dropdown-item" href="/search/birth">Par date de naissance</a> + <a class="dropdown-item active" href="/search/death">Par date de décès</a> + <a class="dropdown-item" href="/search/marriage">Par date de mariage</a> + <a class="dropdown-item" href="/search/city">Par ville</a> + <a class="dropdown-item" href="/search/dept">Par département</a> + <a class="dropdown-item" href="/search/state">Par région</a> + </div> + </div> + <input onchange="reload();" class="form-control" type="text" + placeholder="Commencer à taper une année..." + id="search"> + </div> + <script> + setInterval(() => { + if (document.getElementById("search").value.trim() !== "") { + document.getElementById("preview").innerText = "Affiche toutes les personnes décédées en " + document.getElementById("search").value; + } else { + document.getElementById("preview").innerText = "Sélectionnez une année"; + } + }, 100) + + function reload() { + window.fetch("./results/?q=" + encodeURI(document.getElementById("search").value.trim())).then((a) => { + a.text().then((b) => { + document.getElementById("results").innerHTML = b; + }) + }) + } + + window.addEventListener("load", () => { + i = Math.random().toString().substr(2); + document.getElementById('search').classList.add(i); + $('#search.' + i).flexdatalist({ + cache: false, + minLength: 0, + selectionRequired: true, + visibleProperties: ["name","occurrences"], + searchIn: 'name', + data: "data.json" + }); + }) + </script> + <style> + .flexdatalist-results li { + cursor: pointer; + } + .flexdatalist-results li .item-occurrences { + color: rgba(0, 0, 0, .25); + } + .flexdatalist-results li:hover { + opacity: .75; + } + .flexdatalist-results li:active { + opacity: .5; + } + </style> + <div id="results"></div> +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/search/death/results/index.php b/search/death/results/index.php new file mode 100644 index 0000000..4b0201b --- /dev/null +++ b/search/death/results/index.php @@ -0,0 +1,38 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +if (isset($_GET['q']) && trim($_GET['q']) !== "") { + $q = $_GET['q']; +} else { + die(); +} + +$results = []; + +foreach ($data as $id => $person) { + if (isset($person["death"]["date"]) && isset($person["death"]["date"]["year"])) { + if ((string)$person["death"]["date"]["year"] === $q) { + $results[] = $id; + } + } +} +if (count($results) === 0): ?> +<ul class="list-group"> + <li class="list-group-item">Aucun résultat correspondant</li> +</ul> +<?php else: ?> +<div class="list-group"> + <?php foreach ($results as $result): $p = $data[$result]; ?> + <a href="/person/?_=<?= $result ?>" class="list-group-item list-group-item-action"><?= $p["famname"] ?> <?= $p["surname"] ?> <span class="text-muted">#<?= $result ?></span></a> + <?php endforeach; ?> +</div> +<?php endif; ?>
\ No newline at end of file diff --git a/search/dept/data.json/index.php b/search/dept/data.json/index.php new file mode 100644 index 0000000..5a0ed2a --- /dev/null +++ b/search/dept/data.json/index.php @@ -0,0 +1,39 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +header("Content-Type: application/json"); + +$arr = []; +$names = []; +$counts = []; + +foreach ($data as $id => $person) { + if (isset($person["birth"]["place"]) && isset($person["birth"]["place"]["dept"])) { + if (isset($counts[$person["birth"]["place"]["dept"]])) { + $counts[$person["birth"]["place"]["dept"]]++; + } else { + $counts[$person["birth"]["place"]["dept"]] = 1; + } + if (!in_array($person["birth"]["place"]["dept"], $names)) { + $names[] = $person["birth"]["place"]["dept"]; + } + } +} + +foreach ($names as $name) { + $arr[] = [ + 'name' => $name, + 'occurrences' => $counts[$name] . " personne" . ($counts[$name] > 1 ? "s" : "") + ]; +} + +echo(json_encode($arr));
\ No newline at end of file diff --git a/search/dept/index.php b/search/dept/index.php new file mode 100644 index 0000000..4c75745 --- /dev/null +++ b/search/dept/index.php @@ -0,0 +1,73 @@ +<?php $_TITLE = "Recherche par département de naissance"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container"> + <h2>Rechercher par département de naissance</h2> + <p id="preview">Patientez...</p> + <script src="/dllib/jquery.flexdatalist.min.js"></script> + <div class="input-group mt-3 mb-3"> + <div class="input-group-prepend"> + <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> + Par département + </button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="/search/name">Par prénom</a> + <a class="dropdown-item" href="/search/lastname">Par nom</a> + <a class="dropdown-item" href="/search/birth">Par date de naissance</a> + <a class="dropdown-item" href="/search/death">Par date de décès</a> + <a class="dropdown-item" href="/search/marriage">Par date de mariage</a> + <a class="dropdown-item" href="/search/city">Par ville</a> + <a class="dropdown-item active" href="/search/dept">Par département</a> + <a class="dropdown-item" href="/search/state">Par région</a> + </div> + </div> + <input onchange="reload();" class="form-control" type="text" + placeholder="Commencer à taper un département..." + id="search"> + </div> + <script> + setInterval(() => { + if (document.getElementById("search").value.trim() !== "") { + document.getElementById("preview").innerText = "Affiche toutes les personnes nées dans le " + document.getElementById("search").value; + } else { + document.getElementById("preview").innerText = "Sélectionnez un département"; + } + }, 100) + + function reload() { + window.fetch("./results/?q=" + encodeURI(document.getElementById("search").value.trim())).then((a) => { + a.text().then((b) => { + document.getElementById("results").innerHTML = b; + }) + }) + } + + window.addEventListener("load", () => { + i = Math.random().toString().substr(2); + document.getElementById('search').classList.add(i); + $('#search.' + i).flexdatalist({ + cache: false, + minLength: 0, + selectionRequired: true, + visibleProperties: ["name","occurrences"], + searchIn: 'name', + data: "data.json" + }); + }) + </script> + <style> + .flexdatalist-results li { + cursor: pointer; + } + .flexdatalist-results li .item-occurrences { + color: rgba(0, 0, 0, .25); + } + .flexdatalist-results li:hover { + opacity: .75; + } + .flexdatalist-results li:active { + opacity: .5; + } + </style> + <div id="results"></div> +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/search/dept/results/index.php b/search/dept/results/index.php new file mode 100644 index 0000000..b84ff89 --- /dev/null +++ b/search/dept/results/index.php @@ -0,0 +1,38 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +if (isset($_GET['q']) && trim($_GET['q']) !== "") { + $q = $_GET['q']; +} else { + die(); +} + +$results = []; + +foreach ($data as $id => $person) { + if (isset($person["birth"]["place"]) && isset($person["birth"]["place"]["dept"])) { + if ($person["birth"]["place"]["dept"] === $q) { + $results[] = $id; + } + } +} +if (count($results) === 0): ?> +<ul class="list-group"> + <li class="list-group-item">Aucun résultat correspondant</li> +</ul> +<?php else: ?> +<div class="list-group"> + <?php foreach ($results as $result): $p = $data[$result]; ?> + <a href="/person/?_=<?= $result ?>" class="list-group-item list-group-item-action"><?= $p["famname"] ?> <?= $p["surname"] ?> <span class="text-muted">#<?= $result ?></span></a> + <?php endforeach; ?> +</div> +<?php endif; ?>
\ No newline at end of file diff --git a/search/index.php b/search/index.php new file mode 100644 index 0000000..384c996 --- /dev/null +++ b/search/index.php @@ -0,0 +1 @@ +<?php header("Location: /"); die();
\ No newline at end of file diff --git a/search/lastname/data.json/index.php b/search/lastname/data.json/index.php new file mode 100644 index 0000000..861b791 --- /dev/null +++ b/search/lastname/data.json/index.php @@ -0,0 +1,39 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +header("Content-Type: application/json"); + +$arr = []; +$names = []; +$counts = []; + +foreach ($data as $id => $person) { + $name = ucfirst(strtolower($person["famname"])); + + if (isset($counts[$name])) { + $counts[$name]++; + } else { + $counts[$name] = 1; + } + if (!in_array($name, $names)) { + $names[] = $name; + } +} + +foreach ($names as $name) { + $arr[] = [ + 'name' => $name, + 'occurrences' => $counts[$name] . " personne" . ($counts[$name] > 1 ? "s" : "") + ]; +} + +echo(json_encode($arr));
\ No newline at end of file diff --git a/search/lastname/index.php b/search/lastname/index.php new file mode 100644 index 0000000..1b932f0 --- /dev/null +++ b/search/lastname/index.php @@ -0,0 +1,73 @@ +<?php $_TITLE = "Recherche par prénom"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container"> + <h2>Rechercher par nom</h2> + <p id="preview">Patientez...</p> + <script src="/dllib/jquery.flexdatalist.min.js"></script> + <div class="input-group mt-3 mb-3"> + <div class="input-group-prepend"> + <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> + Par nom + </button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="/search/name">Par prénom</a> + <a class="dropdown-item active" href="/search/lastname">Par nom</a> + <a class="dropdown-item" href="/search/birth">Par date de naissance</a> + <a class="dropdown-item" href="/search/death">Par date de décès</a> + <a class="dropdown-item" href="/search/marriage">Par date de mariage</a> + <a class="dropdown-item" href="/search/city">Par ville</a> + <a class="dropdown-item" href="/search/dept">Par département</a> + <a class="dropdown-item" href="/search/state">Par région</a> + </div> + </div> + <input onchange="reload();" class="form-control" type="text" + placeholder="Commencer à taper un nom..." + id="search"> + </div> + <script> + setInterval(() => { + if (document.getElementById("search").value.trim() !== "") { + document.getElementById("preview").innerText = "Affiche toutes les personnes nommées " + document.getElementById("search").value; + } else { + document.getElementById("preview").innerText = "Sélectionnez un nom"; + } + }, 100) + + function reload() { + window.fetch("./results/?q=" + encodeURI(document.getElementById("search").value.trim())).then((a) => { + a.text().then((b) => { + document.getElementById("results").innerHTML = b; + }) + }) + } + + window.addEventListener("load", () => { + i = Math.random().toString().substr(2); + document.getElementById('search').classList.add(i); + $('#search.' + i).flexdatalist({ + cache: false, + minLength: 0, + selectionRequired: true, + visibleProperties: ["name","occurrences"], + searchIn: 'name', + data: "data.json" + }); + }) + </script> + <style> + .flexdatalist-results li { + cursor: pointer; + } + .flexdatalist-results li .item-occurrences { + color: rgba(0, 0, 0, .25); + } + .flexdatalist-results li:hover { + opacity: .75; + } + .flexdatalist-results li:active { + opacity: .5; + } + </style> + <div id="results"></div> +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/search/lastname/results/index.php b/search/lastname/results/index.php new file mode 100644 index 0000000..80bc75b --- /dev/null +++ b/search/lastname/results/index.php @@ -0,0 +1,36 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +if (isset($_GET['q']) && trim($_GET['q']) !== "") { + $q = $_GET['q']; +} else { + die(); +} + +$results = []; + +foreach ($data as $id => $person) { + if (ucfirst(strtolower($person["famname"])) === ucfirst(strtolower($q))) { + $results[] = $id; + } +} +if (count($results) === 0): ?> +<ul class="list-group"> + <li class="list-group-item">Aucun résultat correspondant</li> +</ul> +<?php else: ?> +<div class="list-group"> + <?php foreach ($results as $result): $p = $data[$result]; ?> + <a href="/person/?_=<?= $result ?>" class="list-group-item list-group-item-action"><?= $p["famname"] ?> <?= $p["surname"] ?> <span class="text-muted">#<?= $result ?></span></a> + <?php endforeach; ?> +</div> +<?php endif; ?>
\ No newline at end of file diff --git a/search/marriage/data.json/index.php b/search/marriage/data.json/index.php new file mode 100644 index 0000000..8a999a4 --- /dev/null +++ b/search/marriage/data.json/index.php @@ -0,0 +1,39 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +header("Content-Type: application/json"); + +$arr = []; +$names = []; +$counts = []; + +foreach ($data as $id => $person) { + if (isset($person["family"]) && isset($person["family"]["marriage"]["date"]) && isset($person["family"]["marriage"]["date"]["year"])) { + if (isset($counts[(string)$person["family"]["marriage"]["date"]["year"]])) { + $counts[(string)$person["family"]["marriage"]["date"]["year"]]++; + } else { + $counts[(string)$person["family"]["marriage"]["date"]["year"]] = 1; + } + if (!in_array((string)$person["family"]["marriage"]["date"]["year"], $names)) { + $names[] = (string)$person["family"]["marriage"]["date"]["year"]; + } + } +} + +foreach ($names as $name) { + $arr[] = [ + 'name' => $name, + 'occurrences' => $counts[$name] . " personne" . ($counts[$name] > 1 ? "s" : "") + ]; +} + +echo(json_encode($arr));
\ No newline at end of file diff --git a/search/marriage/index.php b/search/marriage/index.php new file mode 100644 index 0000000..85129bc --- /dev/null +++ b/search/marriage/index.php @@ -0,0 +1,73 @@ +<?php $_TITLE = "Recherche par date de mariage"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container"> + <h2>Rechercher par date de mariage</h2> + <p id="preview">Patientez...</p> + <script src="/dllib/jquery.flexdatalist.min.js"></script> + <div class="input-group mt-3 mb-3"> + <div class="input-group-prepend"> + <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> + Par date de mariage + </button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="/search/name">Par prénom</a> + <a class="dropdown-item" href="/search/lastname">Par nom</a> + <a class="dropdown-item" href="/search/birth">Par date de naissance</a> + <a class="dropdown-item" href="/search/death">Par date de décès</a> + <a class="dropdown-item active" href="/search/marriage">Par date de mariage</a> + <a class="dropdown-item" href="/search/city">Par ville</a> + <a class="dropdown-item" href="/search/dept">Par département</a> + <a class="dropdown-item" href="/search/state">Par région</a> + </div> + </div> + <input onchange="reload();" class="form-control" type="text" + placeholder="Commencer à taper une année..." + id="search"> + </div> + <script> + setInterval(() => { + if (document.getElementById("search").value.trim() !== "") { + document.getElementById("preview").innerText = "Affiche toutes les personnes mariées en " + document.getElementById("search").value; + } else { + document.getElementById("preview").innerText = "Sélectionnez une année"; + } + }, 100) + + function reload() { + window.fetch("./results/?q=" + encodeURI(document.getElementById("search").value.trim())).then((a) => { + a.text().then((b) => { + document.getElementById("results").innerHTML = b; + }) + }) + } + + window.addEventListener("load", () => { + i = Math.random().toString().substr(2); + document.getElementById('search').classList.add(i); + $('#search.' + i).flexdatalist({ + cache: false, + minLength: 0, + selectionRequired: true, + visibleProperties: ["name","occurrences"], + searchIn: 'name', + data: "data.json" + }); + }) + </script> + <style> + .flexdatalist-results li { + cursor: pointer; + } + .flexdatalist-results li .item-occurrences { + color: rgba(0, 0, 0, .25); + } + .flexdatalist-results li:hover { + opacity: .75; + } + .flexdatalist-results li:active { + opacity: .5; + } + </style> + <div id="results"></div> +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/search/marriage/results/index.php b/search/marriage/results/index.php new file mode 100644 index 0000000..172a124 --- /dev/null +++ b/search/marriage/results/index.php @@ -0,0 +1,38 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +if (isset($_GET['q']) && trim($_GET['q']) !== "") { + $q = $_GET['q']; +} else { + die(); +} + +$results = []; + +foreach ($data as $id => $person) { + if (isset($person["family"]) && isset($person["family"]["marriage"]["date"]) && isset($person["family"]["marriage"]["date"]["year"])) { + if ((string)$person["family"]["marriage"]["date"]["year"] === $q) { + $results[] = $id; + } + } +} +if (count($results) === 0): ?> +<ul class="list-group"> + <li class="list-group-item">Aucun résultat correspondant</li> +</ul> +<?php else: ?> +<div class="list-group"> + <?php foreach ($results as $result): $p = $data[$result]; ?> + <a href="/person/?_=<?= $result ?>" class="list-group-item list-group-item-action"><?= $p["famname"] ?> <?= $p["surname"] ?> <span class="text-muted">#<?= $result ?></span></a> + <?php endforeach; ?> +</div> +<?php endif; ?>
\ No newline at end of file diff --git a/search/name/data.json/index.php b/search/name/data.json/index.php new file mode 100644 index 0000000..7eeed57 --- /dev/null +++ b/search/name/data.json/index.php @@ -0,0 +1,39 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +header("Content-Type: application/json"); + +$arr = []; +$names = []; +$counts = []; + +foreach ($data as $id => $person) { + $name = ucfirst(strtolower($person["surname"])); + + if (isset($counts[$name])) { + $counts[$name]++; + } else { + $counts[$name] = 1; + } + if (!in_array($name, $names)) { + $names[] = $name; + } +} + +foreach ($names as $name) { + $arr[] = [ + 'name' => $name, + 'occurrences' => $counts[$name] . " personne" . ($counts[$name] > 1 ? "s" : "") + ]; +} + +echo(json_encode($arr));
\ No newline at end of file diff --git a/search/name/index.php b/search/name/index.php new file mode 100644 index 0000000..c8a8f5a --- /dev/null +++ b/search/name/index.php @@ -0,0 +1,73 @@ +<?php $_TITLE = "Recherche par prénom"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container"> + <h2>Rechercher par prénom</h2> + <p id="preview">Patientez...</p> + <script src="/dllib/jquery.flexdatalist.min.js"></script> + <div class="input-group mt-3 mb-3"> + <div class="input-group-prepend"> + <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> + Par prénom + </button> + <div class="dropdown-menu"> + <a class="dropdown-item active" href="/search/name">Par prénom</a> + <a class="dropdown-item" href="/search/lastname">Par nom</a> + <a class="dropdown-item" href="/search/birth">Par date de naissance</a> + <a class="dropdown-item" href="/search/death">Par date de décès</a> + <a class="dropdown-item" href="/search/marriage">Par date de mariage</a> + <a class="dropdown-item" href="/search/city">Par ville</a> + <a class="dropdown-item" href="/search/dept">Par département</a> + <a class="dropdown-item" href="/search/state">Par région</a> + </div> + </div> + <input onchange="reload();" class="form-control" type="text" + placeholder="Commencer à taper un prénom..." + id="search"> + </div> + <script> + setInterval(() => { + if (document.getElementById("search").value.trim() !== "") { + document.getElementById("preview").innerText = "Affiche toutes les personnes prénommées " + document.getElementById("search").value; + } else { + document.getElementById("preview").innerText = "Sélectionnez un prénom"; + } + }, 100) + + function reload() { + window.fetch("./results/?q=" + encodeURI(document.getElementById("search").value.trim())).then((a) => { + a.text().then((b) => { + document.getElementById("results").innerHTML = b; + }) + }) + } + + window.addEventListener("load", () => { + i = Math.random().toString().substr(2); + document.getElementById('search').classList.add(i); + $('#search.' + i).flexdatalist({ + cache: false, + minLength: 0, + selectionRequired: true, + visibleProperties: ["name","occurrences"], + searchIn: 'name', + data: "data.json" + }); + }) + </script> + <style> + .flexdatalist-results li { + cursor: pointer; + } + .flexdatalist-results li .item-occurrences { + color: rgba(0, 0, 0, .25); + } + .flexdatalist-results li:hover { + opacity: .75; + } + .flexdatalist-results li:active { + opacity: .5; + } + </style> + <div id="results"></div> +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/search/name/results/index.php b/search/name/results/index.php new file mode 100644 index 0000000..3850287 --- /dev/null +++ b/search/name/results/index.php @@ -0,0 +1,36 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +if (isset($_GET['q']) && trim($_GET['q']) !== "") { + $q = $_GET['q']; +} else { + die(); +} + +$results = []; + +foreach ($data as $id => $person) { + if (ucfirst(strtolower($person["surname"])) === ucfirst(strtolower($q))) { + $results[] = $id; + } +} +if (count($results) === 0): ?> +<ul class="list-group"> + <li class="list-group-item">Aucun résultat correspondant</li> +</ul> +<?php else: ?> +<div class="list-group"> + <?php foreach ($results as $result): $p = $data[$result]; ?> + <a href="/person/?_=<?= $result ?>" class="list-group-item list-group-item-action"><?= $p["famname"] ?> <?= $p["surname"] ?> <span class="text-muted">#<?= $result ?></span></a> + <?php endforeach; ?> +</div> +<?php endif; ?>
\ No newline at end of file diff --git a/search/state/data.json/index.php b/search/state/data.json/index.php new file mode 100644 index 0000000..6445118 --- /dev/null +++ b/search/state/data.json/index.php @@ -0,0 +1,39 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +header("Content-Type: application/json"); + +$arr = []; +$names = []; +$counts = []; + +foreach ($data as $id => $person) { + if (isset($person["birth"]["place"]) && isset($person["birth"]["place"]["state"])) { + if (isset($counts[$person["birth"]["place"]["state"]])) { + $counts[$person["birth"]["place"]["state"]]++; + } else { + $counts[$person["birth"]["place"]["state"]] = 1; + } + if (!in_array($person["birth"]["place"]["state"], $names)) { + $names[] = $person["birth"]["place"]["state"]; + } + } +} + +foreach ($names as $name) { + $arr[] = [ + 'name' => $name, + 'occurrences' => $counts[$name] . " personne" . ($counts[$name] > 1 ? "s" : "") + ]; +} + +echo(json_encode($arr));
\ No newline at end of file diff --git a/search/state/index.php b/search/state/index.php new file mode 100644 index 0000000..da20419 --- /dev/null +++ b/search/state/index.php @@ -0,0 +1,73 @@ +<?php $_TITLE = "Recherche par région de naissance"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container"> + <h2>Rechercher par région de naissance</h2> + <p id="preview">Patientez...</p> + <script src="/dllib/jquery.flexdatalist.min.js"></script> + <div class="input-group mt-3 mb-3"> + <div class="input-group-prepend"> + <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> + Par région + </button> + <div class="dropdown-menu"> + <a class="dropdown-item" href="/search/name">Par prénom</a> + <a class="dropdown-item" href="/search/lastname">Par nom</a> + <a class="dropdown-item" href="/search/birth">Par date de naissance</a> + <a class="dropdown-item" href="/search/death">Par date de décès</a> + <a class="dropdown-item" href="/search/marriage">Par date de mariage</a> + <a class="dropdown-item" href="/search/city">Par ville</a> + <a class="dropdown-item" href="/search/dept">Par département</a> + <a class="dropdown-item active" href="/search/state">Par région</a> + </div> + </div> + <input onchange="reload();" class="form-control" type="text" + placeholder="Commencer à taper une région..." + id="search"> + </div> + <script> + setInterval(() => { + if (document.getElementById("search").value.trim() !== "") { + document.getElementById("preview").innerText = "Affiche toutes les personnes nées dans la région " + document.getElementById("search").value; + } else { + document.getElementById("preview").innerText = "Sélectionnez une région"; + } + }, 100) + + function reload() { + window.fetch("./results/?q=" + encodeURI(document.getElementById("search").value.trim())).then((a) => { + a.text().then((b) => { + document.getElementById("results").innerHTML = b; + }) + }) + } + + window.addEventListener("load", () => { + i = Math.random().toString().substr(2); + document.getElementById('search').classList.add(i); + $('#search.' + i).flexdatalist({ + cache: false, + minLength: 0, + selectionRequired: true, + visibleProperties: ["name","occurrences"], + searchIn: 'name', + data: "data.json" + }); + }) + </script> + <style> + .flexdatalist-results li { + cursor: pointer; + } + .flexdatalist-results li .item-occurrences { + color: rgba(0, 0, 0, .25); + } + .flexdatalist-results li:hover { + opacity: .75; + } + .flexdatalist-results li:active { + opacity: .5; + } + </style> + <div id="results"></div> +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/search/state/results/index.php b/search/state/results/index.php new file mode 100644 index 0000000..6251ebf --- /dev/null +++ b/search/state/results/index.php @@ -0,0 +1,38 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var array $_CONFIG + */ + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +if (isset($_GET['q']) && trim($_GET['q']) !== "") { + $q = $_GET['q']; +} else { + die(); +} + +$results = []; + +foreach ($data as $id => $person) { + if (isset($person["birth"]["place"]) && isset($person["birth"]["place"]["state"])) { + if ($person["birth"]["place"]["state"] === $q) { + $results[] = $id; + } + } +} +if (count($results) === 0): ?> +<ul class="list-group"> + <li class="list-group-item">Aucun résultat correspondant</li> +</ul> +<?php else: ?> +<div class="list-group"> + <?php foreach ($results as $result): $p = $data[$result]; ?> + <a href="/person/?_=<?= $result ?>" class="list-group-item list-group-item-action"><?= $p["famname"] ?> <?= $p["surname"] ?> <span class="text-muted">#<?= $result ?></span></a> + <?php endforeach; ?> +</div> +<?php endif; ?>
\ No newline at end of file diff --git a/style/LICENSE b/style/LICENSE new file mode 100644 index 0000000..6fd9ab3 --- /dev/null +++ b/style/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Remi-Leclercq-Blondel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/style/tree_maker.css b/style/tree_maker.css new file mode 100644 index 0000000..2067e8d --- /dev/null +++ b/style/tree_maker.css @@ -0,0 +1,40 @@ +.tree__container, #from_tree__container__step__card__first, .tree__container__branch { + display: flex; + flex-direction: row; + justify-content: center; +} + +.tree__container__step__card { + text-align: center; + margin: 20px; +} + +.tree__container__step__card p { + padding: 10px; + box-shadow: 0 0 4px 1px rgba(121, 121, 121, 0.3); + border-radius: 4px; + text-align: center; + width: 150px; + display: inline-block; + margin: 0 !important; +} + +#tree__svg-container { + z-index: -1; + position: absolute; +} + +.tree__container__step { + flex: 1 1 0px; + width: auto; + padding: 0; +} + +.tree__container__step__card__p { + cursor: pointer; + transition: transform .2s ease; +} + +.tree__container__step__card__p:hover { + transform: translateX(3px); +} diff --git a/styles/common.css b/styles/common.css new file mode 100644 index 0000000..2973aab --- /dev/null +++ b/styles/common.css @@ -0,0 +1,49 @@ +@import "dark.css"; + +@font-face { + font-family: "Nunito"; + src: url("/fonts/Nunito-VariableFont_wght.ttf"); + font-weight: 125 950; + font-stretch: 75% 125%; + font-style: normal; +} + +@font-face { + font-family: "Nunito"; + src: url("/fonts/Nunito-Italic-VariableFont_wght.ttf"); + font-weight: 125 950; + font-stretch: 75% 125%; + font-style: italic; +} + +* { + font-family: "Nunito", sans-serif !important; +} + +body, html { + margin: 0; + overflow-x: hidden; + height: 100%; +} + +center { + display: block; + text-align: center; +} + +.list-group-item.d-flex.justify-content-between.align-items-center { + flex-wrap: wrap; +} + +.big-head { + font-size: 64px; +} + +big { + font-size: 64px; + vertical-align: middle; +} + +nav.navbar.navbar-expand-sm.bg-dark.navbar-dark { + background-color: #333 !important; +} diff --git a/styles/dark.css b/styles/dark.css new file mode 100644 index 0000000..c24bd9a --- /dev/null +++ b/styles/dark.css @@ -0,0 +1,54 @@ +@media (prefers-color-scheme: dark) { + + nav.navbar { + background-color: #252525 !important; + color: white !important; + } + + nav.navbar .navbar-brand { + color: #ffffff !important; + } + + nav.navbar .navbar-brand:hover { + color: rgba(255, 255, 255, 0.9) !important; + } + + nav.navbar .navbar-brand:focus, nav.navbar .navbar-brand:active { + color: rgba(255, 255, 255, 0.75) !important; + } + + nav.navbar .nav-link { + color: white !important; + } + + nav.navbar .nav-link:hover { + color: white !important; + } + + nav.navbar .nav-link:focus, nav.navbar .nav-link:active { + color: white !important; + } + + nav.navbar .navbar-text { + color: rgba(255,255,255,.5); + } + + html, body { + background: black !important; + color: white !important; + } + + .list-group-item { + background-color: #151515 !important; + } + + .card-header, .card-footer { + background-color: rgba(255,255,255,.03) !important; + border-bottom: 1px solid rgba(255,255,255,.125) !important; + } + + .card { + background-color: #151515 !important; + } + +}
\ No newline at end of file diff --git a/tree/index.php b/tree/index.php new file mode 100644 index 0000000..837c6f1 --- /dev/null +++ b/tree/index.php @@ -0,0 +1,49 @@ +<?php + +setlocale(LC_ALL, 'fr_FR.UTF-8'); +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +function getplace($place) { + $info = false; + + if (isset($place["city"])) { + $info = true; + echo("<a href='/search/city/?q=" . $place["city"] . "'>" . $place["city"] . "</a><br>"); + } + + if (isset($place["dept"])) { + $info = true; + echo("<a href='/search/dept/?q=" . $place["dept"] . "'>" . $place["dept"] . "</a><br>"); + } + + if (isset($place["country"])) { + $info = true; + echo($place["country"] . "<br>"); + } + + if (!$info) { + echo("Non renseigné"); + } +} + +if (isset($_GET['_']) && trim($_GET['_']) !== "" && isset($data[$_GET['_']])) { + $id = $_GET['_']; + $person = $data[$_GET['_']]; +} else { + header("Location: /"); + die(); +} + +$_TITLE = "Arbre généalogique | " . $person["famname"] . " " . $person["surname"] . " (#" . $id . ")"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +<div class="container"> + <h1> + <?= $person["famname"] . " " . $person["surname"] . " <span class='text-muted'>#" . $id . "</span>" ?> + <a style="float:right;position: relative;top: 7px;" href="/person/?_=<?= $id ?>" class="btn btn-outline-primary">Voir les détails</a> + </h1> + <br> + <br> + + <iframe src="/tree/mktree.php?_=<?= $id ?>" style="border:none;width:100%;height:50vh;border-radius:5px;"></iframe> +</div> +<br> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?>
\ No newline at end of file diff --git a/tree/mktree.php b/tree/mktree.php new file mode 100644 index 0000000..d296c61 --- /dev/null +++ b/tree/mktree.php @@ -0,0 +1,165 @@ +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/../session.php"; + +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/data/people.json"), true); + +if (isset($_GET['_']) && trim($_GET['_']) !== "" && isset($data[$_GET['_']])) { + $id = $_GET['_']; + $person = $data[$_GET['_']]; +} else { + // TODO: handle error + die(); +} + +// Father +$found = false; +foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($id, $potential["family"]["children"]) && $potential["sex"] !== "F") { + $found = true; + $dad = $potential["famname"] . " " . $potential["surname"]; + $dadId = $potid; + } +} + +if (!$found) { + $dad = "???"; +} + +// Mother +$found = false; +foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($id, $potential["family"]["children"]) && $potential["sex"] === "F") { + $found = true; + $mom = $potential["famname"] . " " . $potential["surname"]; + $momId = $potid; + } +} + +if (!$found) { + $mom = "???"; +} + +// Mother's data +if (isset($momId)) { + // Father + $found = false; + foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($momId, $potential["family"]["children"]) && $potential["sex"] !== "F") { + $found = true; + $momDad = $potential["famname"] . " " . $potential["surname"]; + $momDadId = $potid; + } + } + + if (!$found) { + $momDad = "???"; + } + + // Mother + $found = false; + foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($momId, $potential["family"]["children"]) && $potential["sex"] === "F") { + $found = true; + $momMom = $potential["famname"] . " " . $potential["surname"]; + $momMomId = $potid; + } + } + + if (!$found) { + $momMom = "???"; + } +} else { + $momMom = "???"; + $momDad = "???"; +} + +// Father's data +if (isset($dadId)) { + // Father + $found = false; + foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($dadId, $potential["family"]["children"]) && $potential["sex"] !== "F") { + $found = true; + $dadDad = $potential["famname"] . " " . $potential["surname"]; + $dadDadId = $potid; + } + } + + if (!$found) { + $dadDad = "???"; + } + + // Mother + $found = false; + foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($dadId, $potential["family"]["children"]) && $potential["sex"] === "F") { + $found = true; + $dadMom = $potential["famname"] . " " . $potential["surname"]; + $dadMomId = $potid; + } + } + + if (!$found) { + $dadMom = "???"; + } +} else { + $dadMom = "???"; + $dadDad = "???"; +} + +?> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Tree maker 🌳</title> + <link rel="stylesheet" href="../lib/tree_maker-min.css"> + <script type="text/javascript" src="../lib/tree_maker-min.js"></script> +</head> +<body> +<div id="my_tree"></div> +<script type="text/javascript"> + let tree = { + 0: { + 1: { + 3: '', + 4: '' + }, + 2: { + 5: '', + 6: '' + } + } + }; + + let treeParams = { + 0: {trad: "<b><?= $person["famname"] ?> <?= $person["surname"] ?></b>", id: "<?= $id ?>"}, + 1: {trad: "<?= $mom ?>", id: "<?= $momId ?>"}, + 2: {trad: "<?= $dad ?>", id: "<?= $dadId ?>"}, + 3: {trad: "<?= $momMom ?>", id: "<?= $momMomId ?>"}, + 4: {trad: "<?= $momDad ?>", id: "<?= $momDadId ?>"}, + 5: {trad: "<?= $dadMom ?>", id: "<?= $dadMomId ?>"}, + 6: {trad: "<?= $dadDad ?>", id: "<?= $dadDadId ?>"}, + }; + + treeMaker(tree, { + id: 'my_tree', card_click: function (element) { + if (treeParams[element.id.substr(5)].trad !== "???") window.parent.location.href = "/tree/?_=" + treeParams[element.id.substr(5)].id; + }, + treeParams: treeParams, + 'link_width': '4px', + 'link_color': '#fff', + }); +</script> +<style> + body, html { + font-family: sans-serif; + } + .tree__container__step__card__p { + background: white; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + } +</style> +</body> +</html> |