Used for sorting the manager's Overlays by z-index.
@method compareZIndexDesc
@private
@return {Number} 0, 1, or -1, depending on where the Overlay should
fall in the stacking order.
177550
function (o1, o2) {

            var zIndex1 = (o1.cfg) ? o1.cfg.getProperty("zIndex") : null, // Sort invalid (destroyed)
                zIndex2 = (o2.cfg) ? o2.cfg.getProperty("zIndex") : null; // objects at bottom.

            if (zIndex1 === null && zIndex2 === null) {
                return 0;
            } else if (zIndex1 === null){
                return 1;
            } else if (zIndex2 === null) {
                return -1;
            } else if (zIndex1 > zIndex2) {
                return -1;
            } else if (zIndex1 < zIndex2) {
                return 1;
            } else {
                return 0;
            }
        }
1164876
function findLastIndex(array, exp) {

  if(!isArray(array) || isUndefined(exp)) {
    return array;
  }
  //return the the index of the last member
  var index = (array.length - 1) - findInArray(reverse(array), $parse(exp), true);
  //if it's a NaN
  return index === index ? index : -1;
}
1171715
function _sortZ(a, b) {
         return b.pos && a.pos ? b.pos.z - a.pos.z : a.pos ? -Infinity : Infinity;
       }
999244
function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
	    // convert -0 to +0
	    if (NEGATIVE_ZERO$1) return $native$1.apply(this, arguments) || 0;
	    var O = _toIobject(this);
	    var length = _toLength(O.length);
	    var index = length - 1;
	    if (arguments.length > 1) index = Math.min(index, _toInteger(arguments[1]));
	    if (index < 0) index = length + index;
	    for (; index >= 0; index--) {
	      if (index in O) if (O[index] === searchElement) return index || 0;
	    }return -1;
	  }
1359036
function calculateVertexCount() {

		var count = ( radialSegments + 1 ) * ( heightSegments + 1 );

		if ( openEnded === false ) {

			count += ( ( radialSegments + 1 ) * nbCap ) + ( radialSegments * nbCap );

		}

		return count;

	}
351830
function (idx) {
		var r = this.getRed(idx),
			g = this.getGreen(idx),
			b = this.getBlue(idx);

		r = Math.floor((0.393 * r) + (0.769 * g) + (0.189 * b));
		g = Math.floor((0.349 * r) + (0.686 * g) + (0.168 * b));
		b = Math.floor((0.272 * r) + (0.534 * g) + (0.131 * b));

		r = r < 0 ? 0 : (r > 255 ? 255 : r);
		g = g < 0 ? 0 : (g > 255 ? 255 : g);
		b = b < 0 ? 0 : (b > 255 ? 255 : b);

		return {red: r, green: g, blue: b};
	}
864229
function() {
    var self = this;
    var index = -1;
    this.gmapsMap.overlayMapTypes.forEach(
      function(layer, i) {
        if (layer == self) {
          index = i;
        }
      }
    );
    return index;
  }
196560
function binarySearchIndices( value ) {

			function binarySearch( start, end ) {

				// return closest larger index
				// if exact number is not found

				if ( end < start )
					return start;

				var mid = start + Math.floor( ( end - start ) / 2 );

				if ( cumulativeAreas[ mid ] > value ) {

					return binarySearch( start, mid - 1 );

				} else if ( cumulativeAreas[ mid ] < value ) {

					return binarySearch( mid + 1, end );

				} else {

					return mid;

				}

			}

			var result = binarySearch( 0, cumulativeAreas.length - 1 )
			return result;

		}
349564
function getGridDimension(diff, step) {

        // return step if diff = 0
        if (!diff) return step;

        var absDiff = Math.abs(diff);
        var numSteps = Math.round(absDiff / step);

        // return absDiff if less than one step apart
        if (!numSteps) return absDiff;

        // otherwise, return corrected step
        var roundedDiff = numSteps * step;
        var remainder = absDiff - roundedDiff;
        var stepCorrection = remainder / numSteps;

        return step + stepCorrection;
    }
898140
function blackHeight(x, z) {
    if (x === z) {
        return 0;
    }
    else {
        var hL = blackHeight(x.l, z);
        if (hL >= 0) {
            var hR = blackHeight(x.r, z);
            if (hR >= 0) {
                if (hR === hR) {
                    return x.flag ? hL : hL + 1;
                }
            }
        }
        return -1;
    }
}
796589
function compareGrabberAndMousePosition(m) {
			if (isScrollbarOver(m)) {
				if (ctrl.horizontal) {
					var start = getScrollbarArea().left + getGrabberOffsetPixelFromPercent(getGrabberOffsetPercentFromBegin($scope.ngBegin));
					if (m.x < start)
						return -1;
					var end = start + getGrabberSizePixelFromPercent(getGrabberSizePercentFromScopeValues());
					if (m.x > end)
						return 1;
					if (m.x >= start && m.x <= end)
						return 0;
				} else {
					var start = getScrollbarArea().top + getGrabberOffsetPixelFromPercent(getGrabberOffsetPercentFromBegin($scope.ngBegin));
					if (m.y < start)
						return -1;
					var end = start + getGrabberSizePixelFromPercent(getGrabberSizePercentFromScopeValues());
					if (m.y > end)
						return 1;
					if (m.y >= start && m.y <= end)
						return 0;
				}
			}
			return Number.NaN;
		}
883540
function (idx) {
		var r = this.getRed(idx),
			g = this.getGreen(idx),
			b = this.getBlue(idx);

		return Math.floor((Math.max(r, g, b) + Math.min(r, g, b)) / 2);
	}
924512
function parentInorder(n, x) {
  if(n <= 0) {
    return -1
  }
  var r = rootInorder(n)
  if(x > r) {
    var q = parentInorder(n-r-1, x-r-1)
    if(q < 0) {
      return r
    } else {
      return q + r + 1
    }
  } else if(x === r) {
    return -1
  }
  var q =  parentInorder(r, x)
  if(q < 0) {
    return r
  }
  return q
}
335498
function sortCssDecls (cssDecls, sortOrder) {
  if (sortOrder === 'alphabetically') {
    timsort(cssDecls, (a, b) => {
      if (a.type === 'decl' && b.type === 'decl') {
        return comparator(a.prop, b.prop);
      } else {
        return compareDifferentType(a, b);
      }
    });
  } else {
    timsort(cssDecls, (a, b) => {
      if (a.type === 'decl' && b.type === 'decl') {
        const aIndex = sortOrder.indexOf(a.prop);
        const bIndex = sortOrder.indexOf(b.prop);
        return comparator(aIndex, bIndex);
      } else {
        return compareDifferentType(a, b);
      }
    });
  }
}
443637
function heightInorder(n, x) {
  if(n <= 0) {
    return 0
  }
  var r = rootInorder(n)
  if(x > r) {
    return heightInorder(n-r-1, x-r-1)
  } else if(x === r) {
    return bits.log2(n)
  }
  return heightInorder(r, x)
}
594099
function() {
            var d = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]);
            var m0 = this.m[3] * d;
            var m1 = -this.m[1] * d;
            var m2 = -this.m[2] * d;
            var m3 = this.m[0] * d;
            var m4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]);
            var m5 = d * (this.m[1] * this.m[4] - this.m[0] * this.m[5]);
            this.m[0] = m0;
            this.m[1] = m1;
            this.m[2] = m2;
            this.m[3] = m3;
            this.m[4] = m4;
            this.m[5] = m5;
            return this;
        }
61321
function selectDimensionsAndMaterials() {
  let reverbLength = document.getElementById('reverbLengthSelect').value;
  switch (reverbLength) {
    case 'none':
    default:
    {
      return {
        dimensions: {
          width: 0,
          height: 0,
          depth: 0,
        },
        materials: {
          left: 'transparent',
          right: 'transparent',
          front: 'transparent',
          back: 'transparent',
          up: 'transparent',
          down: 'transparent',
        },
      };
    }
    break;
    case 'short':
    {
      return {
        dimensions: {
          width: 1.5,
          height: 1.5,
          depth: 1.5,
        },
        materials: {
          left: 'uniform',
          right: 'uniform',
          front: 'uniform',
          back: 'uniform',
          up: 'uniform',
          down: 'uniform',
        },
      };
    }
    break;
    case 'medium':
    {
      return {
        dimensions: {
          width: 6,
          height: 6,
          depth: 6,
        },
        materials: {
          left: 'uniform',
          right: 'uniform',
          front: 'uniform',
          back: 'uniform',
          up: 'uniform',
          down: 'uniform',
        },
      };
    }
    break;
    case 'long':
    {
      return {
        dimensions: {
          width: 24,
          height: 24,
          depth: 24,
        },
        materials: {
          left: 'uniform',
          right: 'uniform',
          front: 'uniform',
          back: 'uniform',
          up: 'uniform',
          down: 'uniform',
        },
      };
    }
    break;
  }
}