@nethserver/ns8-ui-lib 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -162,7 +162,6 @@ import ChevronRight16 from '@carbon/icons-vue/es/chevron--right/16';
162
162
  import ChevronDown16 from '@carbon/icons-vue/es/chevron--down/16';
163
163
  import CvCheckbox$1 from '@carbon/vue/src/components/cv-checkbox/cv-checkbox';
164
164
  import { mapState } from 'vuex';
165
- import Mark from 'mark.js';
166
165
 
167
166
  //
168
167
  var script$C = {
@@ -18576,9 +18575,9 @@ var root = _freeGlobal || freeSelf || Function('return this')();
18576
18575
  var _root = root;
18577
18576
 
18578
18577
  /** Built-in value references. */
18579
- var Symbol = _root.Symbol;
18578
+ var Symbol$1 = _root.Symbol;
18580
18579
 
18581
- var _Symbol = Symbol;
18580
+ var _Symbol = Symbol$1;
18582
18581
 
18583
18582
  /** Used for built-in method references. */
18584
18583
  var objectProto$c = Object.prototype;
@@ -23607,6 +23606,1074 @@ const __vue_component__$m = /*#__PURE__*/normalizeComponent({
23607
23606
 
23608
23607
  var __vue_component__$n = __vue_component__$m;
23609
23608
 
23609
+ /*!***************************************************
23610
+ * mark.js v8.11.1
23611
+ * https://markjs.io/
23612
+ * Copyright (c) 2014–2018, Julian Kühnel
23613
+ * Released under the MIT license https://git.io/vwTVl
23614
+ *****************************************************/
23615
+
23616
+ var mark = createCommonjsModule(function (module, exports) {
23617
+ (function (global, factory) {
23618
+ module.exports = factory() ;
23619
+ }(commonjsGlobal, (function () {
23620
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
23621
+ return typeof obj;
23622
+ } : function (obj) {
23623
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
23624
+ };
23625
+
23626
+
23627
+
23628
+
23629
+
23630
+
23631
+
23632
+
23633
+
23634
+
23635
+
23636
+ var classCallCheck = function (instance, Constructor) {
23637
+ if (!(instance instanceof Constructor)) {
23638
+ throw new TypeError("Cannot call a class as a function");
23639
+ }
23640
+ };
23641
+
23642
+ var createClass = function () {
23643
+ function defineProperties(target, props) {
23644
+ for (var i = 0; i < props.length; i++) {
23645
+ var descriptor = props[i];
23646
+ descriptor.enumerable = descriptor.enumerable || false;
23647
+ descriptor.configurable = true;
23648
+ if ("value" in descriptor) descriptor.writable = true;
23649
+ Object.defineProperty(target, descriptor.key, descriptor);
23650
+ }
23651
+ }
23652
+
23653
+ return function (Constructor, protoProps, staticProps) {
23654
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
23655
+ if (staticProps) defineProperties(Constructor, staticProps);
23656
+ return Constructor;
23657
+ };
23658
+ }();
23659
+
23660
+
23661
+
23662
+
23663
+
23664
+
23665
+
23666
+ var _extends = Object.assign || function (target) {
23667
+ for (var i = 1; i < arguments.length; i++) {
23668
+ var source = arguments[i];
23669
+
23670
+ for (var key in source) {
23671
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
23672
+ target[key] = source[key];
23673
+ }
23674
+ }
23675
+ }
23676
+
23677
+ return target;
23678
+ };
23679
+
23680
+ var DOMIterator = function () {
23681
+ function DOMIterator(ctx) {
23682
+ var iframes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
23683
+ var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
23684
+ var iframesTimeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5000;
23685
+ classCallCheck(this, DOMIterator);
23686
+
23687
+ this.ctx = ctx;
23688
+ this.iframes = iframes;
23689
+ this.exclude = exclude;
23690
+ this.iframesTimeout = iframesTimeout;
23691
+ }
23692
+
23693
+ createClass(DOMIterator, [{
23694
+ key: 'getContexts',
23695
+ value: function getContexts() {
23696
+ var ctx = void 0,
23697
+ filteredCtx = [];
23698
+ if (typeof this.ctx === 'undefined' || !this.ctx) {
23699
+ ctx = [];
23700
+ } else if (NodeList.prototype.isPrototypeOf(this.ctx)) {
23701
+ ctx = Array.prototype.slice.call(this.ctx);
23702
+ } else if (Array.isArray(this.ctx)) {
23703
+ ctx = this.ctx;
23704
+ } else if (typeof this.ctx === 'string') {
23705
+ ctx = Array.prototype.slice.call(document.querySelectorAll(this.ctx));
23706
+ } else {
23707
+ ctx = [this.ctx];
23708
+ }
23709
+ ctx.forEach(function (ctx) {
23710
+ var isDescendant = filteredCtx.filter(function (contexts) {
23711
+ return contexts.contains(ctx);
23712
+ }).length > 0;
23713
+ if (filteredCtx.indexOf(ctx) === -1 && !isDescendant) {
23714
+ filteredCtx.push(ctx);
23715
+ }
23716
+ });
23717
+ return filteredCtx;
23718
+ }
23719
+ }, {
23720
+ key: 'getIframeContents',
23721
+ value: function getIframeContents(ifr, successFn) {
23722
+ var errorFn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
23723
+
23724
+ var doc = void 0;
23725
+ try {
23726
+ var ifrWin = ifr.contentWindow;
23727
+ doc = ifrWin.document;
23728
+ if (!ifrWin || !doc) {
23729
+ throw new Error('iframe inaccessible');
23730
+ }
23731
+ } catch (e) {
23732
+ errorFn();
23733
+ }
23734
+ if (doc) {
23735
+ successFn(doc);
23736
+ }
23737
+ }
23738
+ }, {
23739
+ key: 'isIframeBlank',
23740
+ value: function isIframeBlank(ifr) {
23741
+ var bl = 'about:blank',
23742
+ src = ifr.getAttribute('src').trim(),
23743
+ href = ifr.contentWindow.location.href;
23744
+ return href === bl && src !== bl && src;
23745
+ }
23746
+ }, {
23747
+ key: 'observeIframeLoad',
23748
+ value: function observeIframeLoad(ifr, successFn, errorFn) {
23749
+ var _this = this;
23750
+
23751
+ var called = false,
23752
+ tout = null;
23753
+ var listener = function listener() {
23754
+ if (called) {
23755
+ return;
23756
+ }
23757
+ called = true;
23758
+ clearTimeout(tout);
23759
+ try {
23760
+ if (!_this.isIframeBlank(ifr)) {
23761
+ ifr.removeEventListener('load', listener);
23762
+ _this.getIframeContents(ifr, successFn, errorFn);
23763
+ }
23764
+ } catch (e) {
23765
+ errorFn();
23766
+ }
23767
+ };
23768
+ ifr.addEventListener('load', listener);
23769
+ tout = setTimeout(listener, this.iframesTimeout);
23770
+ }
23771
+ }, {
23772
+ key: 'onIframeReady',
23773
+ value: function onIframeReady(ifr, successFn, errorFn) {
23774
+ try {
23775
+ if (ifr.contentWindow.document.readyState === 'complete') {
23776
+ if (this.isIframeBlank(ifr)) {
23777
+ this.observeIframeLoad(ifr, successFn, errorFn);
23778
+ } else {
23779
+ this.getIframeContents(ifr, successFn, errorFn);
23780
+ }
23781
+ } else {
23782
+ this.observeIframeLoad(ifr, successFn, errorFn);
23783
+ }
23784
+ } catch (e) {
23785
+ errorFn();
23786
+ }
23787
+ }
23788
+ }, {
23789
+ key: 'waitForIframes',
23790
+ value: function waitForIframes(ctx, done) {
23791
+ var _this2 = this;
23792
+
23793
+ var eachCalled = 0;
23794
+ this.forEachIframe(ctx, function () {
23795
+ return true;
23796
+ }, function (ifr) {
23797
+ eachCalled++;
23798
+ _this2.waitForIframes(ifr.querySelector('html'), function () {
23799
+ if (! --eachCalled) {
23800
+ done();
23801
+ }
23802
+ });
23803
+ }, function (handled) {
23804
+ if (!handled) {
23805
+ done();
23806
+ }
23807
+ });
23808
+ }
23809
+ }, {
23810
+ key: 'forEachIframe',
23811
+ value: function forEachIframe(ctx, filter, each) {
23812
+ var _this3 = this;
23813
+
23814
+ var end = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {};
23815
+
23816
+ var ifr = ctx.querySelectorAll('iframe'),
23817
+ open = ifr.length,
23818
+ handled = 0;
23819
+ ifr = Array.prototype.slice.call(ifr);
23820
+ var checkEnd = function checkEnd() {
23821
+ if (--open <= 0) {
23822
+ end(handled);
23823
+ }
23824
+ };
23825
+ if (!open) {
23826
+ checkEnd();
23827
+ }
23828
+ ifr.forEach(function (ifr) {
23829
+ if (DOMIterator.matches(ifr, _this3.exclude)) {
23830
+ checkEnd();
23831
+ } else {
23832
+ _this3.onIframeReady(ifr, function (con) {
23833
+ if (filter(ifr)) {
23834
+ handled++;
23835
+ each(con);
23836
+ }
23837
+ checkEnd();
23838
+ }, checkEnd);
23839
+ }
23840
+ });
23841
+ }
23842
+ }, {
23843
+ key: 'createIterator',
23844
+ value: function createIterator(ctx, whatToShow, filter) {
23845
+ return document.createNodeIterator(ctx, whatToShow, filter, false);
23846
+ }
23847
+ }, {
23848
+ key: 'createInstanceOnIframe',
23849
+ value: function createInstanceOnIframe(contents) {
23850
+ return new DOMIterator(contents.querySelector('html'), this.iframes);
23851
+ }
23852
+ }, {
23853
+ key: 'compareNodeIframe',
23854
+ value: function compareNodeIframe(node, prevNode, ifr) {
23855
+ var compCurr = node.compareDocumentPosition(ifr),
23856
+ prev = Node.DOCUMENT_POSITION_PRECEDING;
23857
+ if (compCurr & prev) {
23858
+ if (prevNode !== null) {
23859
+ var compPrev = prevNode.compareDocumentPosition(ifr),
23860
+ after = Node.DOCUMENT_POSITION_FOLLOWING;
23861
+ if (compPrev & after) {
23862
+ return true;
23863
+ }
23864
+ } else {
23865
+ return true;
23866
+ }
23867
+ }
23868
+ return false;
23869
+ }
23870
+ }, {
23871
+ key: 'getIteratorNode',
23872
+ value: function getIteratorNode(itr) {
23873
+ var prevNode = itr.previousNode();
23874
+ var node = void 0;
23875
+ if (prevNode === null) {
23876
+ node = itr.nextNode();
23877
+ } else {
23878
+ node = itr.nextNode() && itr.nextNode();
23879
+ }
23880
+ return {
23881
+ prevNode: prevNode,
23882
+ node: node
23883
+ };
23884
+ }
23885
+ }, {
23886
+ key: 'checkIframeFilter',
23887
+ value: function checkIframeFilter(node, prevNode, currIfr, ifr) {
23888
+ var key = false,
23889
+ handled = false;
23890
+ ifr.forEach(function (ifrDict, i) {
23891
+ if (ifrDict.val === currIfr) {
23892
+ key = i;
23893
+ handled = ifrDict.handled;
23894
+ }
23895
+ });
23896
+ if (this.compareNodeIframe(node, prevNode, currIfr)) {
23897
+ if (key === false && !handled) {
23898
+ ifr.push({
23899
+ val: currIfr,
23900
+ handled: true
23901
+ });
23902
+ } else if (key !== false && !handled) {
23903
+ ifr[key].handled = true;
23904
+ }
23905
+ return true;
23906
+ }
23907
+ if (key === false) {
23908
+ ifr.push({
23909
+ val: currIfr,
23910
+ handled: false
23911
+ });
23912
+ }
23913
+ return false;
23914
+ }
23915
+ }, {
23916
+ key: 'handleOpenIframes',
23917
+ value: function handleOpenIframes(ifr, whatToShow, eCb, fCb) {
23918
+ var _this4 = this;
23919
+
23920
+ ifr.forEach(function (ifrDict) {
23921
+ if (!ifrDict.handled) {
23922
+ _this4.getIframeContents(ifrDict.val, function (con) {
23923
+ _this4.createInstanceOnIframe(con).forEachNode(whatToShow, eCb, fCb);
23924
+ });
23925
+ }
23926
+ });
23927
+ }
23928
+ }, {
23929
+ key: 'iterateThroughNodes',
23930
+ value: function iterateThroughNodes(whatToShow, ctx, eachCb, filterCb, doneCb) {
23931
+ var _this5 = this;
23932
+
23933
+ var itr = this.createIterator(ctx, whatToShow, filterCb);
23934
+ var ifr = [],
23935
+ elements = [],
23936
+ node = void 0,
23937
+ prevNode = void 0,
23938
+ retrieveNodes = function retrieveNodes() {
23939
+ var _getIteratorNode = _this5.getIteratorNode(itr);
23940
+
23941
+ prevNode = _getIteratorNode.prevNode;
23942
+ node = _getIteratorNode.node;
23943
+
23944
+ return node;
23945
+ };
23946
+ while (retrieveNodes()) {
23947
+ if (this.iframes) {
23948
+ this.forEachIframe(ctx, function (currIfr) {
23949
+ return _this5.checkIframeFilter(node, prevNode, currIfr, ifr);
23950
+ }, function (con) {
23951
+ _this5.createInstanceOnIframe(con).forEachNode(whatToShow, function (ifrNode) {
23952
+ return elements.push(ifrNode);
23953
+ }, filterCb);
23954
+ });
23955
+ }
23956
+ elements.push(node);
23957
+ }
23958
+ elements.forEach(function (node) {
23959
+ eachCb(node);
23960
+ });
23961
+ if (this.iframes) {
23962
+ this.handleOpenIframes(ifr, whatToShow, eachCb, filterCb);
23963
+ }
23964
+ doneCb();
23965
+ }
23966
+ }, {
23967
+ key: 'forEachNode',
23968
+ value: function forEachNode(whatToShow, each, filter) {
23969
+ var _this6 = this;
23970
+
23971
+ var done = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {};
23972
+
23973
+ var contexts = this.getContexts();
23974
+ var open = contexts.length;
23975
+ if (!open) {
23976
+ done();
23977
+ }
23978
+ contexts.forEach(function (ctx) {
23979
+ var ready = function ready() {
23980
+ _this6.iterateThroughNodes(whatToShow, ctx, each, filter, function () {
23981
+ if (--open <= 0) {
23982
+ done();
23983
+ }
23984
+ });
23985
+ };
23986
+ if (_this6.iframes) {
23987
+ _this6.waitForIframes(ctx, ready);
23988
+ } else {
23989
+ ready();
23990
+ }
23991
+ });
23992
+ }
23993
+ }], [{
23994
+ key: 'matches',
23995
+ value: function matches(element, selector) {
23996
+ var selectors = typeof selector === 'string' ? [selector] : selector,
23997
+ fn = element.matches || element.matchesSelector || element.msMatchesSelector || element.mozMatchesSelector || element.oMatchesSelector || element.webkitMatchesSelector;
23998
+ if (fn) {
23999
+ var match = false;
24000
+ selectors.every(function (sel) {
24001
+ if (fn.call(element, sel)) {
24002
+ match = true;
24003
+ return false;
24004
+ }
24005
+ return true;
24006
+ });
24007
+ return match;
24008
+ } else {
24009
+ return false;
24010
+ }
24011
+ }
24012
+ }]);
24013
+ return DOMIterator;
24014
+ }();
24015
+
24016
+ var Mark$1 = function () {
24017
+ function Mark(ctx) {
24018
+ classCallCheck(this, Mark);
24019
+
24020
+ this.ctx = ctx;
24021
+ this.ie = false;
24022
+ var ua = window.navigator.userAgent;
24023
+ if (ua.indexOf('MSIE') > -1 || ua.indexOf('Trident') > -1) {
24024
+ this.ie = true;
24025
+ }
24026
+ }
24027
+
24028
+ createClass(Mark, [{
24029
+ key: 'log',
24030
+ value: function log(msg) {
24031
+ var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'debug';
24032
+
24033
+ var log = this.opt.log;
24034
+ if (!this.opt.debug) {
24035
+ return;
24036
+ }
24037
+ if ((typeof log === 'undefined' ? 'undefined' : _typeof(log)) === 'object' && typeof log[level] === 'function') {
24038
+ log[level]('mark.js: ' + msg);
24039
+ }
24040
+ }
24041
+ }, {
24042
+ key: 'escapeStr',
24043
+ value: function escapeStr(str) {
24044
+ return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
24045
+ }
24046
+ }, {
24047
+ key: 'createRegExp',
24048
+ value: function createRegExp(str) {
24049
+ if (this.opt.wildcards !== 'disabled') {
24050
+ str = this.setupWildcardsRegExp(str);
24051
+ }
24052
+ str = this.escapeStr(str);
24053
+ if (Object.keys(this.opt.synonyms).length) {
24054
+ str = this.createSynonymsRegExp(str);
24055
+ }
24056
+ if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
24057
+ str = this.setupIgnoreJoinersRegExp(str);
24058
+ }
24059
+ if (this.opt.diacritics) {
24060
+ str = this.createDiacriticsRegExp(str);
24061
+ }
24062
+ str = this.createMergedBlanksRegExp(str);
24063
+ if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
24064
+ str = this.createJoinersRegExp(str);
24065
+ }
24066
+ if (this.opt.wildcards !== 'disabled') {
24067
+ str = this.createWildcardsRegExp(str);
24068
+ }
24069
+ str = this.createAccuracyRegExp(str);
24070
+ return str;
24071
+ }
24072
+ }, {
24073
+ key: 'createSynonymsRegExp',
24074
+ value: function createSynonymsRegExp(str) {
24075
+ var syn = this.opt.synonyms,
24076
+ sens = this.opt.caseSensitive ? '' : 'i',
24077
+ joinerPlaceholder = this.opt.ignoreJoiners || this.opt.ignorePunctuation.length ? '\0' : '';
24078
+ for (var index in syn) {
24079
+ if (syn.hasOwnProperty(index)) {
24080
+ var value = syn[index],
24081
+ k1 = this.opt.wildcards !== 'disabled' ? this.setupWildcardsRegExp(index) : this.escapeStr(index),
24082
+ k2 = this.opt.wildcards !== 'disabled' ? this.setupWildcardsRegExp(value) : this.escapeStr(value);
24083
+ if (k1 !== '' && k2 !== '') {
24084
+ str = str.replace(new RegExp('(' + this.escapeStr(k1) + '|' + this.escapeStr(k2) + ')', 'gm' + sens), joinerPlaceholder + ('(' + this.processSynomyms(k1) + '|') + (this.processSynomyms(k2) + ')') + joinerPlaceholder);
24085
+ }
24086
+ }
24087
+ }
24088
+ return str;
24089
+ }
24090
+ }, {
24091
+ key: 'processSynomyms',
24092
+ value: function processSynomyms(str) {
24093
+ if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
24094
+ str = this.setupIgnoreJoinersRegExp(str);
24095
+ }
24096
+ return str;
24097
+ }
24098
+ }, {
24099
+ key: 'setupWildcardsRegExp',
24100
+ value: function setupWildcardsRegExp(str) {
24101
+ str = str.replace(/(?:\\)*\?/g, function (val) {
24102
+ return val.charAt(0) === '\\' ? '?' : '\x01';
24103
+ });
24104
+ return str.replace(/(?:\\)*\*/g, function (val) {
24105
+ return val.charAt(0) === '\\' ? '*' : '\x02';
24106
+ });
24107
+ }
24108
+ }, {
24109
+ key: 'createWildcardsRegExp',
24110
+ value: function createWildcardsRegExp(str) {
24111
+ var spaces = this.opt.wildcards === 'withSpaces';
24112
+ return str.replace(/\u0001/g, spaces ? '[\\S\\s]?' : '\\S?').replace(/\u0002/g, spaces ? '[\\S\\s]*?' : '\\S*');
24113
+ }
24114
+ }, {
24115
+ key: 'setupIgnoreJoinersRegExp',
24116
+ value: function setupIgnoreJoinersRegExp(str) {
24117
+ return str.replace(/[^(|)\\]/g, function (val, indx, original) {
24118
+ var nextChar = original.charAt(indx + 1);
24119
+ if (/[(|)\\]/.test(nextChar) || nextChar === '') {
24120
+ return val;
24121
+ } else {
24122
+ return val + '\0';
24123
+ }
24124
+ });
24125
+ }
24126
+ }, {
24127
+ key: 'createJoinersRegExp',
24128
+ value: function createJoinersRegExp(str) {
24129
+ var joiner = [];
24130
+ var ignorePunctuation = this.opt.ignorePunctuation;
24131
+ if (Array.isArray(ignorePunctuation) && ignorePunctuation.length) {
24132
+ joiner.push(this.escapeStr(ignorePunctuation.join('')));
24133
+ }
24134
+ if (this.opt.ignoreJoiners) {
24135
+ joiner.push('\\u00ad\\u200b\\u200c\\u200d');
24136
+ }
24137
+ return joiner.length ? str.split(/\u0000+/).join('[' + joiner.join('') + ']*') : str;
24138
+ }
24139
+ }, {
24140
+ key: 'createDiacriticsRegExp',
24141
+ value: function createDiacriticsRegExp(str) {
24142
+ var sens = this.opt.caseSensitive ? '' : 'i',
24143
+ dct = this.opt.caseSensitive ? ['aàáảãạăằắẳẵặâầấẩẫậäåāą', 'AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ', 'cçćč', 'CÇĆČ', 'dđď', 'DĐĎ', 'eèéẻẽẹêềếểễệëěēę', 'EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ', 'iìíỉĩịîïī', 'IÌÍỈĨỊÎÏĪ', 'lł', 'LŁ', 'nñňń', 'NÑŇŃ', 'oòóỏõọôồốổỗộơởỡớờợöøō', 'OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ', 'rř', 'RŘ', 'sšśșş', 'SŠŚȘŞ', 'tťțţ', 'TŤȚŢ', 'uùúủũụưừứửữựûüůū', 'UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ', 'yýỳỷỹỵÿ', 'YÝỲỶỸỴŸ', 'zžżź', 'ZŽŻŹ'] : ['aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ', 'cçćčCÇĆČ', 'dđďDĐĎ', 'eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ', 'iìíỉĩịîïīIÌÍỈĨỊÎÏĪ', 'lłLŁ', 'nñňńNÑŇŃ', 'oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ', 'rřRŘ', 'sšśșşSŠŚȘŞ', 'tťțţTŤȚŢ', 'uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ', 'yýỳỷỹỵÿYÝỲỶỸỴŸ', 'zžżźZŽŻŹ'];
24144
+ var handled = [];
24145
+ str.split('').forEach(function (ch) {
24146
+ dct.every(function (dct) {
24147
+ if (dct.indexOf(ch) !== -1) {
24148
+ if (handled.indexOf(dct) > -1) {
24149
+ return false;
24150
+ }
24151
+ str = str.replace(new RegExp('[' + dct + ']', 'gm' + sens), '[' + dct + ']');
24152
+ handled.push(dct);
24153
+ }
24154
+ return true;
24155
+ });
24156
+ });
24157
+ return str;
24158
+ }
24159
+ }, {
24160
+ key: 'createMergedBlanksRegExp',
24161
+ value: function createMergedBlanksRegExp(str) {
24162
+ return str.replace(/[\s]+/gmi, '[\\s]+');
24163
+ }
24164
+ }, {
24165
+ key: 'createAccuracyRegExp',
24166
+ value: function createAccuracyRegExp(str) {
24167
+ var _this = this;
24168
+
24169
+ var chars = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~¡¿';
24170
+ var acc = this.opt.accuracy,
24171
+ val = typeof acc === 'string' ? acc : acc.value,
24172
+ ls = typeof acc === 'string' ? [] : acc.limiters,
24173
+ lsJoin = '';
24174
+ ls.forEach(function (limiter) {
24175
+ lsJoin += '|' + _this.escapeStr(limiter);
24176
+ });
24177
+ switch (val) {
24178
+ case 'partially':
24179
+ default:
24180
+ return '()(' + str + ')';
24181
+ case 'complementary':
24182
+ lsJoin = '\\s' + (lsJoin ? lsJoin : this.escapeStr(chars));
24183
+ return '()([^' + lsJoin + ']*' + str + '[^' + lsJoin + ']*)';
24184
+ case 'exactly':
24185
+ return '(^|\\s' + lsJoin + ')(' + str + ')(?=$|\\s' + lsJoin + ')';
24186
+ }
24187
+ }
24188
+ }, {
24189
+ key: 'getSeparatedKeywords',
24190
+ value: function getSeparatedKeywords(sv) {
24191
+ var _this2 = this;
24192
+
24193
+ var stack = [];
24194
+ sv.forEach(function (kw) {
24195
+ if (!_this2.opt.separateWordSearch) {
24196
+ if (kw.trim() && stack.indexOf(kw) === -1) {
24197
+ stack.push(kw);
24198
+ }
24199
+ } else {
24200
+ kw.split(' ').forEach(function (kwSplitted) {
24201
+ if (kwSplitted.trim() && stack.indexOf(kwSplitted) === -1) {
24202
+ stack.push(kwSplitted);
24203
+ }
24204
+ });
24205
+ }
24206
+ });
24207
+ return {
24208
+ 'keywords': stack.sort(function (a, b) {
24209
+ return b.length - a.length;
24210
+ }),
24211
+ 'length': stack.length
24212
+ };
24213
+ }
24214
+ }, {
24215
+ key: 'isNumeric',
24216
+ value: function isNumeric(value) {
24217
+ return Number(parseFloat(value)) == value;
24218
+ }
24219
+ }, {
24220
+ key: 'checkRanges',
24221
+ value: function checkRanges(array) {
24222
+ var _this3 = this;
24223
+
24224
+ if (!Array.isArray(array) || Object.prototype.toString.call(array[0]) !== '[object Object]') {
24225
+ this.log('markRanges() will only accept an array of objects');
24226
+ this.opt.noMatch(array);
24227
+ return [];
24228
+ }
24229
+ var stack = [];
24230
+ var last = 0;
24231
+ array.sort(function (a, b) {
24232
+ return a.start - b.start;
24233
+ }).forEach(function (item) {
24234
+ var _callNoMatchOnInvalid = _this3.callNoMatchOnInvalidRanges(item, last),
24235
+ start = _callNoMatchOnInvalid.start,
24236
+ end = _callNoMatchOnInvalid.end,
24237
+ valid = _callNoMatchOnInvalid.valid;
24238
+
24239
+ if (valid) {
24240
+ item.start = start;
24241
+ item.length = end - start;
24242
+ stack.push(item);
24243
+ last = end;
24244
+ }
24245
+ });
24246
+ return stack;
24247
+ }
24248
+ }, {
24249
+ key: 'callNoMatchOnInvalidRanges',
24250
+ value: function callNoMatchOnInvalidRanges(range, last) {
24251
+ var start = void 0,
24252
+ end = void 0,
24253
+ valid = false;
24254
+ if (range && typeof range.start !== 'undefined') {
24255
+ start = parseInt(range.start, 10);
24256
+ end = start + parseInt(range.length, 10);
24257
+ if (this.isNumeric(range.start) && this.isNumeric(range.length) && end - last > 0 && end - start > 0) {
24258
+ valid = true;
24259
+ } else {
24260
+ this.log('Ignoring invalid or overlapping range: ' + ('' + JSON.stringify(range)));
24261
+ this.opt.noMatch(range);
24262
+ }
24263
+ } else {
24264
+ this.log('Ignoring invalid range: ' + JSON.stringify(range));
24265
+ this.opt.noMatch(range);
24266
+ }
24267
+ return {
24268
+ start: start,
24269
+ end: end,
24270
+ valid: valid
24271
+ };
24272
+ }
24273
+ }, {
24274
+ key: 'checkWhitespaceRanges',
24275
+ value: function checkWhitespaceRanges(range, originalLength, string) {
24276
+ var end = void 0,
24277
+ valid = true,
24278
+ max = string.length,
24279
+ offset = originalLength - max,
24280
+ start = parseInt(range.start, 10) - offset;
24281
+ start = start > max ? max : start;
24282
+ end = start + parseInt(range.length, 10);
24283
+ if (end > max) {
24284
+ end = max;
24285
+ this.log('End range automatically set to the max value of ' + max);
24286
+ }
24287
+ if (start < 0 || end - start < 0 || start > max || end > max) {
24288
+ valid = false;
24289
+ this.log('Invalid range: ' + JSON.stringify(range));
24290
+ this.opt.noMatch(range);
24291
+ } else if (string.substring(start, end).replace(/\s+/g, '') === '') {
24292
+ valid = false;
24293
+ this.log('Skipping whitespace only range: ' + JSON.stringify(range));
24294
+ this.opt.noMatch(range);
24295
+ }
24296
+ return {
24297
+ start: start,
24298
+ end: end,
24299
+ valid: valid
24300
+ };
24301
+ }
24302
+ }, {
24303
+ key: 'getTextNodes',
24304
+ value: function getTextNodes(cb) {
24305
+ var _this4 = this;
24306
+
24307
+ var val = '',
24308
+ nodes = [];
24309
+ this.iterator.forEachNode(NodeFilter.SHOW_TEXT, function (node) {
24310
+ nodes.push({
24311
+ start: val.length,
24312
+ end: (val += node.textContent).length,
24313
+ node: node
24314
+ });
24315
+ }, function (node) {
24316
+ if (_this4.matchesExclude(node.parentNode)) {
24317
+ return NodeFilter.FILTER_REJECT;
24318
+ } else {
24319
+ return NodeFilter.FILTER_ACCEPT;
24320
+ }
24321
+ }, function () {
24322
+ cb({
24323
+ value: val,
24324
+ nodes: nodes
24325
+ });
24326
+ });
24327
+ }
24328
+ }, {
24329
+ key: 'matchesExclude',
24330
+ value: function matchesExclude(el) {
24331
+ return DOMIterator.matches(el, this.opt.exclude.concat(['script', 'style', 'title', 'head', 'html']));
24332
+ }
24333
+ }, {
24334
+ key: 'wrapRangeInTextNode',
24335
+ value: function wrapRangeInTextNode(node, start, end) {
24336
+ var hEl = !this.opt.element ? 'mark' : this.opt.element,
24337
+ startNode = node.splitText(start),
24338
+ ret = startNode.splitText(end - start);
24339
+ var repl = document.createElement(hEl);
24340
+ repl.setAttribute('data-markjs', 'true');
24341
+ if (this.opt.className) {
24342
+ repl.setAttribute('class', this.opt.className);
24343
+ }
24344
+ repl.textContent = startNode.textContent;
24345
+ startNode.parentNode.replaceChild(repl, startNode);
24346
+ return ret;
24347
+ }
24348
+ }, {
24349
+ key: 'wrapRangeInMappedTextNode',
24350
+ value: function wrapRangeInMappedTextNode(dict, start, end, filterCb, eachCb) {
24351
+ var _this5 = this;
24352
+
24353
+ dict.nodes.every(function (n, i) {
24354
+ var sibl = dict.nodes[i + 1];
24355
+ if (typeof sibl === 'undefined' || sibl.start > start) {
24356
+ if (!filterCb(n.node)) {
24357
+ return false;
24358
+ }
24359
+ var s = start - n.start,
24360
+ e = (end > n.end ? n.end : end) - n.start,
24361
+ startStr = dict.value.substr(0, n.start),
24362
+ endStr = dict.value.substr(e + n.start);
24363
+ n.node = _this5.wrapRangeInTextNode(n.node, s, e);
24364
+ dict.value = startStr + endStr;
24365
+ dict.nodes.forEach(function (k, j) {
24366
+ if (j >= i) {
24367
+ if (dict.nodes[j].start > 0 && j !== i) {
24368
+ dict.nodes[j].start -= e;
24369
+ }
24370
+ dict.nodes[j].end -= e;
24371
+ }
24372
+ });
24373
+ end -= e;
24374
+ eachCb(n.node.previousSibling, n.start);
24375
+ if (end > n.end) {
24376
+ start = n.end;
24377
+ } else {
24378
+ return false;
24379
+ }
24380
+ }
24381
+ return true;
24382
+ });
24383
+ }
24384
+ }, {
24385
+ key: 'wrapMatches',
24386
+ value: function wrapMatches(regex, ignoreGroups, filterCb, eachCb, endCb) {
24387
+ var _this6 = this;
24388
+
24389
+ var matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1;
24390
+ this.getTextNodes(function (dict) {
24391
+ dict.nodes.forEach(function (node) {
24392
+ node = node.node;
24393
+ var match = void 0;
24394
+ while ((match = regex.exec(node.textContent)) !== null && match[matchIdx] !== '') {
24395
+ if (!filterCb(match[matchIdx], node)) {
24396
+ continue;
24397
+ }
24398
+ var pos = match.index;
24399
+ if (matchIdx !== 0) {
24400
+ for (var i = 1; i < matchIdx; i++) {
24401
+ pos += match[i].length;
24402
+ }
24403
+ }
24404
+ node = _this6.wrapRangeInTextNode(node, pos, pos + match[matchIdx].length);
24405
+ eachCb(node.previousSibling);
24406
+ regex.lastIndex = 0;
24407
+ }
24408
+ });
24409
+ endCb();
24410
+ });
24411
+ }
24412
+ }, {
24413
+ key: 'wrapMatchesAcrossElements',
24414
+ value: function wrapMatchesAcrossElements(regex, ignoreGroups, filterCb, eachCb, endCb) {
24415
+ var _this7 = this;
24416
+
24417
+ var matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1;
24418
+ this.getTextNodes(function (dict) {
24419
+ var match = void 0;
24420
+ while ((match = regex.exec(dict.value)) !== null && match[matchIdx] !== '') {
24421
+ var start = match.index;
24422
+ if (matchIdx !== 0) {
24423
+ for (var i = 1; i < matchIdx; i++) {
24424
+ start += match[i].length;
24425
+ }
24426
+ }
24427
+ var end = start + match[matchIdx].length;
24428
+ _this7.wrapRangeInMappedTextNode(dict, start, end, function (node) {
24429
+ return filterCb(match[matchIdx], node);
24430
+ }, function (node, lastIndex) {
24431
+ regex.lastIndex = lastIndex;
24432
+ eachCb(node);
24433
+ });
24434
+ }
24435
+ endCb();
24436
+ });
24437
+ }
24438
+ }, {
24439
+ key: 'wrapRangeFromIndex',
24440
+ value: function wrapRangeFromIndex(ranges, filterCb, eachCb, endCb) {
24441
+ var _this8 = this;
24442
+
24443
+ this.getTextNodes(function (dict) {
24444
+ var originalLength = dict.value.length;
24445
+ ranges.forEach(function (range, counter) {
24446
+ var _checkWhitespaceRange = _this8.checkWhitespaceRanges(range, originalLength, dict.value),
24447
+ start = _checkWhitespaceRange.start,
24448
+ end = _checkWhitespaceRange.end,
24449
+ valid = _checkWhitespaceRange.valid;
24450
+
24451
+ if (valid) {
24452
+ _this8.wrapRangeInMappedTextNode(dict, start, end, function (node) {
24453
+ return filterCb(node, range, dict.value.substring(start, end), counter);
24454
+ }, function (node) {
24455
+ eachCb(node, range);
24456
+ });
24457
+ }
24458
+ });
24459
+ endCb();
24460
+ });
24461
+ }
24462
+ }, {
24463
+ key: 'unwrapMatches',
24464
+ value: function unwrapMatches(node) {
24465
+ var parent = node.parentNode;
24466
+ var docFrag = document.createDocumentFragment();
24467
+ while (node.firstChild) {
24468
+ docFrag.appendChild(node.removeChild(node.firstChild));
24469
+ }
24470
+ parent.replaceChild(docFrag, node);
24471
+ if (!this.ie) {
24472
+ parent.normalize();
24473
+ } else {
24474
+ this.normalizeTextNode(parent);
24475
+ }
24476
+ }
24477
+ }, {
24478
+ key: 'normalizeTextNode',
24479
+ value: function normalizeTextNode(node) {
24480
+ if (!node) {
24481
+ return;
24482
+ }
24483
+ if (node.nodeType === 3) {
24484
+ while (node.nextSibling && node.nextSibling.nodeType === 3) {
24485
+ node.nodeValue += node.nextSibling.nodeValue;
24486
+ node.parentNode.removeChild(node.nextSibling);
24487
+ }
24488
+ } else {
24489
+ this.normalizeTextNode(node.firstChild);
24490
+ }
24491
+ this.normalizeTextNode(node.nextSibling);
24492
+ }
24493
+ }, {
24494
+ key: 'markRegExp',
24495
+ value: function markRegExp(regexp, opt) {
24496
+ var _this9 = this;
24497
+
24498
+ this.opt = opt;
24499
+ this.log('Searching with expression "' + regexp + '"');
24500
+ var totalMatches = 0,
24501
+ fn = 'wrapMatches';
24502
+ var eachCb = function eachCb(element) {
24503
+ totalMatches++;
24504
+ _this9.opt.each(element);
24505
+ };
24506
+ if (this.opt.acrossElements) {
24507
+ fn = 'wrapMatchesAcrossElements';
24508
+ }
24509
+ this[fn](regexp, this.opt.ignoreGroups, function (match, node) {
24510
+ return _this9.opt.filter(node, match, totalMatches);
24511
+ }, eachCb, function () {
24512
+ if (totalMatches === 0) {
24513
+ _this9.opt.noMatch(regexp);
24514
+ }
24515
+ _this9.opt.done(totalMatches);
24516
+ });
24517
+ }
24518
+ }, {
24519
+ key: 'mark',
24520
+ value: function mark(sv, opt) {
24521
+ var _this10 = this;
24522
+
24523
+ this.opt = opt;
24524
+ var totalMatches = 0,
24525
+ fn = 'wrapMatches';
24526
+
24527
+ var _getSeparatedKeywords = this.getSeparatedKeywords(typeof sv === 'string' ? [sv] : sv),
24528
+ kwArr = _getSeparatedKeywords.keywords,
24529
+ kwArrLen = _getSeparatedKeywords.length,
24530
+ sens = this.opt.caseSensitive ? '' : 'i',
24531
+ handler = function handler(kw) {
24532
+ var regex = new RegExp(_this10.createRegExp(kw), 'gm' + sens),
24533
+ matches = 0;
24534
+ _this10.log('Searching with expression "' + regex + '"');
24535
+ _this10[fn](regex, 1, function (term, node) {
24536
+ return _this10.opt.filter(node, kw, totalMatches, matches);
24537
+ }, function (element) {
24538
+ matches++;
24539
+ totalMatches++;
24540
+ _this10.opt.each(element);
24541
+ }, function () {
24542
+ if (matches === 0) {
24543
+ _this10.opt.noMatch(kw);
24544
+ }
24545
+ if (kwArr[kwArrLen - 1] === kw) {
24546
+ _this10.opt.done(totalMatches);
24547
+ } else {
24548
+ handler(kwArr[kwArr.indexOf(kw) + 1]);
24549
+ }
24550
+ });
24551
+ };
24552
+
24553
+ if (this.opt.acrossElements) {
24554
+ fn = 'wrapMatchesAcrossElements';
24555
+ }
24556
+ if (kwArrLen === 0) {
24557
+ this.opt.done(totalMatches);
24558
+ } else {
24559
+ handler(kwArr[0]);
24560
+ }
24561
+ }
24562
+ }, {
24563
+ key: 'markRanges',
24564
+ value: function markRanges(rawRanges, opt) {
24565
+ var _this11 = this;
24566
+
24567
+ this.opt = opt;
24568
+ var totalMatches = 0,
24569
+ ranges = this.checkRanges(rawRanges);
24570
+ if (ranges && ranges.length) {
24571
+ this.log('Starting to mark with the following ranges: ' + JSON.stringify(ranges));
24572
+ this.wrapRangeFromIndex(ranges, function (node, range, match, counter) {
24573
+ return _this11.opt.filter(node, range, match, counter);
24574
+ }, function (element, range) {
24575
+ totalMatches++;
24576
+ _this11.opt.each(element, range);
24577
+ }, function () {
24578
+ _this11.opt.done(totalMatches);
24579
+ });
24580
+ } else {
24581
+ this.opt.done(totalMatches);
24582
+ }
24583
+ }
24584
+ }, {
24585
+ key: 'unmark',
24586
+ value: function unmark(opt) {
24587
+ var _this12 = this;
24588
+
24589
+ this.opt = opt;
24590
+ var sel = this.opt.element ? this.opt.element : '*';
24591
+ sel += '[data-markjs]';
24592
+ if (this.opt.className) {
24593
+ sel += '.' + this.opt.className;
24594
+ }
24595
+ this.log('Removal selector "' + sel + '"');
24596
+ this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT, function (node) {
24597
+ _this12.unwrapMatches(node);
24598
+ }, function (node) {
24599
+ var matchesSel = DOMIterator.matches(node, sel),
24600
+ matchesExclude = _this12.matchesExclude(node);
24601
+ if (!matchesSel || matchesExclude) {
24602
+ return NodeFilter.FILTER_REJECT;
24603
+ } else {
24604
+ return NodeFilter.FILTER_ACCEPT;
24605
+ }
24606
+ }, this.opt.done);
24607
+ }
24608
+ }, {
24609
+ key: 'opt',
24610
+ set: function set$$1(val) {
24611
+ this._opt = _extends({}, {
24612
+ 'element': '',
24613
+ 'className': '',
24614
+ 'exclude': [],
24615
+ 'iframes': false,
24616
+ 'iframesTimeout': 5000,
24617
+ 'separateWordSearch': true,
24618
+ 'diacritics': true,
24619
+ 'synonyms': {},
24620
+ 'accuracy': 'partially',
24621
+ 'acrossElements': false,
24622
+ 'caseSensitive': false,
24623
+ 'ignoreJoiners': false,
24624
+ 'ignoreGroups': 0,
24625
+ 'ignorePunctuation': [],
24626
+ 'wildcards': 'disabled',
24627
+ 'each': function each() {},
24628
+ 'noMatch': function noMatch() {},
24629
+ 'filter': function filter() {
24630
+ return true;
24631
+ },
24632
+ 'done': function done() {},
24633
+ 'debug': false,
24634
+ 'log': window.console
24635
+ }, val);
24636
+ },
24637
+ get: function get$$1() {
24638
+ return this._opt;
24639
+ }
24640
+ }, {
24641
+ key: 'iterator',
24642
+ get: function get$$1() {
24643
+ return new DOMIterator(this.ctx, this.opt.iframes, this.opt.exclude, this.opt.iframesTimeout);
24644
+ }
24645
+ }]);
24646
+ return Mark;
24647
+ }();
24648
+
24649
+ function Mark(ctx) {
24650
+ var _this = this;
24651
+
24652
+ var instance = new Mark$1(ctx);
24653
+ this.mark = function (sv, opt) {
24654
+ instance.mark(sv, opt);
24655
+ return _this;
24656
+ };
24657
+ this.markRegExp = function (sv, opt) {
24658
+ instance.markRegExp(sv, opt);
24659
+ return _this;
24660
+ };
24661
+ this.markRanges = function (sv, opt) {
24662
+ instance.markRanges(sv, opt);
24663
+ return _this;
24664
+ };
24665
+ this.unmark = function (opt) {
24666
+ instance.unmark(opt);
24667
+ return _this;
24668
+ };
24669
+ return this;
24670
+ }
24671
+
24672
+ return Mark;
24673
+
24674
+ })));
24675
+ });
24676
+
23610
24677
  //
23611
24678
  var script = {
23612
24679
  name: "NsComboSearchBox",
@@ -23723,7 +24790,7 @@ var script = {
23723
24790
  setTimeout(() => {
23724
24791
  // mark textQuery in internalResults
23725
24792
  const searchResults = document.querySelector(".search-results");
23726
- this.markInstance = new Mark(searchResults);
24793
+ this.markInstance = new mark(searchResults);
23727
24794
  this.markInstance.mark(this.lastQuery.split(""), {
23728
24795
  className: "marked-bold"
23729
24796
  });