library.define('I (wait for|wait|look for|search|find) (?:the|a|an) (' + htmlTags.sort(function (a, b){return b-a}).join('|') + ')',
9688
function (action, selector, done) {
			var ctx = this;
			ctx.plugins[step.name].devices.each(function (device, next) {
				wdApi.getElement({
					ctx: ctx,
					wait: Boolean(action.match(/wait/)),
					device: device,
					selector: selector
				}, next);
			}, done);
		}
1341245
function startTagToTokens(startTag) {
            const tokens = [startTag.tagOpen]

            for (const attr of startTag.attributes) {
                tokens.push(attr)
            }

            tokens.push(startTag.tagClose)

            return tokens
                .filter(t => Boolean(t))
                .sort((a, b) => a.range[0] - b.range[0])
        }
598979
function or(matches, pattern, file) {
  var length = matches.length
  var note = pattern.note
  var id = pattern.id
  var index = -1
  var match
  var next
  var siblings
  var sibling
  var value
  var nodes
  var start
  var end

  while (++index < length) {
    match = matches[index]
    siblings = match.parent.children
    nodes = match.nodes
    value = toString(nodes)
    next = matches[index + 1]

    if (next && next.parent === match.parent && next.type !== match.type) {
      start = match.end
      end = next.start

      while (++start < end) {
        sibling = siblings[start]

        if (
          sibling.type === ws ||
          (sibling.type === word && /(and|or)/.test(normalize(sibling))) ||
          (sibling.type === punc && normalize(sibling) === '/')
        ) {
          continue
        }

        break
      }

      /* If we didn't break... */
      if (start === end) {
        index++
        continue
      }
    }

    warn(
      file,
      id,
      value,
      pattern.considerate,
      nodes[0],
      note,
      pattern.condition
    )
  }
}
53816
function current_word_ends_with(sentence, i, parameter) {
  var word = sentence.taggedWords[i].token;
  if (!parameter || (parameter.length > word.length)) {
    return false;
  }
  return(word.indexOf(parameter) === (word.length - parameter.length));
}
456097
function (html) {
        var self = this;
        var matchedList = html.match(new RegExp(self.DEFINE_LEFT + '.+' + self.RIGHT, 'g'));
        matchedList = _.map(matchedList, function (matched) {
            return matched.substring(self.DEFINE_LEFT.length, matched.length - self.RIGHT.length);
        });
        return matchedList;
    }
225898
function find(definitions, existing) {
  return one

  function one(node) {
    var url = node.url

    existing.push(node.identifier)

    if (!own.call(definitions, url)) {
      definitions[url] = {}
    }

    definitions[url][node.title] = node
  }
}
1052981
function indexOf(match) {
        var i = matches.length;
        while (i--) {
          if (matches[i] === match) {
            return i;
          }
        }

        return -1;
      }
756833
function(a, b) {
       if (typeof a != typeof b) return
       if (a === b) return true
       if (a instanceof RegExp)
         return a.toString() === b.toString()
       if (a instanceof Date)
         return Number(a) === Number(b)
       if (typeof a != 'object') return
       if (a.length !== undefined)
         if (a.length !== b.length) return
         else
           for (var i = 0, len = a.length; i < len; ++i)
             if (!equal(a[i], b[i]))
               return
       for (var key in a)
         if (!equal(a[key], b[key]))
           return
       return true
     }
496348
function (selector) {
        if (typeof selector == 'function') {
          return DomQuery(grep(this.toArray(), function (item, i) {
            return selector(i, item);
          }));
        }

        return DomQuery(DomQuery.filter(selector, this.toArray()));
      }
217683
function matches(node, query) {
  return (node.matches =
    node.matchesSelector ||
    node.mozMatchesSelector ||
    node.msMatchesSelector ||
    node.oMatchesSelector ||
    node.webkitMatchesSelector ||
    function(s) {
      const matches = (this.document || this.ownerDocument).querySelectorAll(s);
      let i = matches.length;
      while (--i >= 0 && matches.item(i) !== this) {}
      return i > -1;
    }).call(node, query);
}
298850
function sortTags(tagA, tagB) {

    if ((tagA[0] === tagA[0].toUpperCase()) && (tagB[0] !== tagB[0].toUpperCase())) {
        return 1;
    }
    else if ((tagA[0] !== tagA[0].toUpperCase()) && (tagB[0] === tagB[0].toUpperCase())) {
        return -1;
    }
    else {
        return tagA < tagB;
    }
}
1027612
function orderBy(expression) {

        //Check arguments
        if (!expression)
            throw new Error("Expression is invalid");
		
		//Define sort action estracting values from objects
		var sortAction = function(a, b){
		
			//Get value for "a" and "b" element
			var aValue = expression(a);
			var bValue = expression(b);
		
			//Check if one element is greater then the second one
			if(aValue < bValue) return -1;
			if(aValue > bValue) return 1;
			return 0;
		};
		
		//Copy array in order to avoid modifications on original
		var outData = [];
		for(var i = 0; i < this.items.length; i++){
			outData.push(this.items[i]);
		}

        //Define output array
        var sortedData = outData.sort(sortAction);
        
        //Return for chaining
        return new jslinq(sortedData);
    }
1046663
function collectionFind(filter, options) {
        if (!filter) {
            // TODO - limit of ten by
            return collections[ this['_collection'] ]
        }

        if ( typeof(filter) !== 'object' ) { // == findAll
            throw new Error('filter must be an object');
        } else {
            //console.log('search into ', this['_collection'], collections[ this['_collection'] ], collections);
            var content             = collections[ this['_collection'] ]
                , condition         = filter.count()
                , i                 = 0
                , found             = []
                , localeLowerCase   = '';

            for (var o in content) {
                for (var f in filter) {
                    localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];
                    if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] != 'null' && content[o][f] != 'undefined' ) {
                        if (found.indexOf(content[o][f]) < 0 ) {
                            found[i] = content[o][f];
                            ++i
                        }

                    } else if ( typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] === filter[f] ) {
                        found[i] = content[o];
                        ++i
                    }
                }
            }
        }

        return found
    }
63407
function (query, items) {
            var sortExpressions = query.query.sort,
                self = this;

            if(sortExpressions){
                return items.sort(function (a, b) {
                    var sortExpression,
                        ret = 0;
                    for (var i = 0; i < sortExpressions.length; i++) {
                        sortExpression = sortExpressions[i];
                        ret = self._compareExpression(a, b, sortExpression);
                        if (ret !== 0) {
                            return ret;
                        }
                    }
                    return ret;
                });
            } else {
                return items;
            }

        }
220827
function queryMatchesAfterIncluding(matches, includeClause) {
  if (!includeClause) {
    return matches;
  }

  const includeClauses = includeClause.split(',');
  matches = _.map(matches, match => {
    for (let i = 0; i < includeClauses.length; i++) {
      const paths = includeClauses[i].split('.');
      match = includePaths(match, paths);
    }
    return match;
  });

  return matches;
}
542159
function (selector, value) {
    return this.waitForDOM(selector).execute(function (selector, value) {
      var element = document.querySelector(selector);
      if (element) {
        element.value = value;
      }
    }, [ selector, value ]);
  }
220034
function indexOf(list, element, comparator) {
			for (var i=0,item; item=list[i]; i++) {
				if (equals(item, element, comparator)) {
					return i;
				}
			}
			return -1;
		}