forked from apache/usergrid-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
usergrid.min.js
27 lines (27 loc) · 174 KB
/
usergrid.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*!
*Licensed to the Apache Software Foundation (ASF) under one
*or more contributor license agreements. See the NOTICE file
*distributed with this work for additional information
*regarding copyright ownership. The ASF licenses this file
*to you under the Apache License, Version 2.0 (the
*"License"); you may not use this file except in compliance
*with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing,
*software distributed under the License is distributed on an
*"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
*KIND, either express or implied. See the License for the
*specific language governing permissions and limitations
*under the License.
*
*
* [email protected] 2016-10-14
*/
"use strict";!function(global){function Promise(){this.complete=!1,this.result=null,this.callbacks=[]}var name="Promise",overwrittenName=global[name];return Promise.prototype.then=function(callback,context){var f=function(){return callback.apply(context,arguments)};this.complete?f(this.result):this.callbacks.push(f)},Promise.prototype.done=function(result){this.complete=!0,this.result=result,this.callbacks&&(_.forEach(this.callbacks,function(callback){callback(result)}),this.callbacks.length=0)},Promise.join=function(promises){function notifier(i){return function(result){completed+=1,results[i]=result,completed===total&&p.done(results)}}for(var p=new Promise,total=promises.length,completed=0,results=[],i=0;total>i;i++)promises[i]().then(notifier(i));return p},Promise.chain=function(promises,result){var p=new Promise;return null===promises||0===promises.length?p.done(result):promises[0](result).then(function(res){promises.splice(0,1),promises?Promise.chain(promises,res).then(function(r){p.done(r)}):p.done(res)}),p},global[name]=Promise,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),Promise},global[name]}(this),function(){function addMapEntry(map,pair){return map.set(pair[0],pair[1]),map}function addSetEntry(set,value){return set.add(value),set}function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayAggregator(array,setter,iteratee,accumulator){for(var index=-1,length=array?array.length:0;++index<length;){var value=array[index];setter(accumulator,value,iteratee(value),array)}return accumulator}function arrayEach(array,iteratee){for(var index=-1,length=array?array.length:0;++index<length&&iteratee(array[index],index,array)!==!1;);return array}function arrayEachRight(array,iteratee){for(var length=array?array.length:0;length--&&iteratee(array[length],length,array)!==!1;);return array}function arrayEvery(array,predicate){for(var index=-1,length=array?array.length:0;++index<length;)if(!predicate(array[index],index,array))return!1;return!0}function arrayFilter(array,predicate){for(var index=-1,length=array?array.length:0,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function arrayIncludes(array,value){var length=array?array.length:0;return!!length&&baseIndexOf(array,value,0)>-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index<length;)if(comparator(value,array[index]))return!0;return!1}function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=array?array.length:0;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function arrayReduceRight(array,iteratee,accumulator,initAccum){var length=array?array.length:0;for(initAccum&&length&&(accumulator=array[--length]);length--;)accumulator=iteratee(accumulator,array[length],length,array);return accumulator}function arraySome(array,predicate){for(var index=-1,length=array?array.length:0;++index<length;)if(predicate(array[index],index,array))return!0;return!1}function asciiToArray(string){return string.split("")}function asciiWords(string){return string.match(reAsciiWord)||[]}function baseFindKey(collection,predicate,eachFunc){var result;return eachFunc(collection,function(value,key,collection){return predicate(value,key,collection)?(result=key,!1):void 0}),result}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?1:-1);fromRight?index--:++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIndexOf(array,value,fromIndex){return value===value?strictIndexOf(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}function baseIndexOfWith(array,value,fromIndex,comparator){for(var index=fromIndex-1,length=array.length;++index<length;)if(comparator(array[index],value))return index;return-1}function baseIsNaN(value){return value!==value}function baseMean(array,iteratee){var length=array?array.length:0;return length?baseSum(array,iteratee)/length:NAN}function baseProperty(key){return function(object){return null==object?undefined:object[key]}}function basePropertyOf(object){return function(key){return null==object?undefined:object[key]}}function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){return eachFunc(collection,function(value,index,collection){accumulator=initAccum?(initAccum=!1,value):iteratee(accumulator,value,index,collection)}),accumulator}function baseSortBy(array,comparer){var length=array.length;for(array.sort(comparer);length--;)array[length]=array[length].value;return array}function baseSum(array,iteratee){for(var result,index=-1,length=array.length;++index<length;){var current=iteratee(array[index]);current!==undefined&&(result=result===undefined?current:result+current)}return result}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}function baseToPairs(object,props){return arrayMap(props,function(key){return[key,object[key]]})}function baseUnary(func){return function(value){return func(value)}}function baseValues(object,props){return arrayMap(props,function(key){return object[key]})}function cacheHas(cache,key){return cache.has(key)}function charsStartIndex(strSymbols,chrSymbols){for(var index=-1,length=strSymbols.length;++index<length&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function countHolders(array,placeholder){for(var length=array.length,result=0;length--;)array[length]===placeholder&&++result;return result}function escapeStringChar(chr){return"\\"+stringEscapes[chr]}function getValue(object,key){return null==object?undefined:object[key]}function hasUnicode(string){return reHasUnicode.test(string)}function hasUnicodeWord(string){return reHasUnicodeWord.test(string)}function iteratorToArray(iterator){for(var data,result=[];!(data=iterator.next()).done;)result.push(data.value);return result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function replaceHolders(array,placeholder){for(var index=-1,length=array.length,resIndex=0,result=[];++index<length;){var value=array[index];(value===placeholder||value===PLACEHOLDER)&&(array[index]=PLACEHOLDER,result[resIndex++]=index)}return result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}function setToPairs(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=[value,value]}),result}function strictIndexOf(array,value,fromIndex){for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}function strictLastIndexOf(array,value,fromIndex){for(var index=fromIndex+1;index--;)if(array[index]===value)return index;return index}function stringSize(string){return hasUnicode(string)?unicodeSize(string):asciiSize(string)}function stringToArray(string){return hasUnicode(string)?unicodeToArray(string):asciiToArray(string)}function unicodeSize(string){for(var result=reUnicode.lastIndex=0;reUnicode.test(string);)++result;return result}function unicodeToArray(string){return string.match(reUnicode)||[]}function unicodeWords(string){return string.match(reUnicodeWord)||[]}var undefined,VERSION="4.16.4",LARGE_ARRAY_SIZE=200,CORE_ERROR_TEXT="Unsupported core-js use. Try https://github.com/es-shims.",FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",MAX_MEMOIZE_SIZE=500,PLACEHOLDER="__lodash_placeholder__",BIND_FLAG=1,BIND_KEY_FLAG=2,CURRY_BOUND_FLAG=4,CURRY_FLAG=8,CURRY_RIGHT_FLAG=16,PARTIAL_FLAG=32,PARTIAL_RIGHT_FLAG=64,ARY_FLAG=128,REARG_FLAG=256,FLIP_FLAG=512,UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,DEFAULT_TRUNC_LENGTH=30,DEFAULT_TRUNC_OMISSION="...",HOT_COUNT=500,HOT_SPAN=16,LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2,LAZY_WHILE_FLAG=3,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,MAX_ARRAY_LENGTH=4294967295,MAX_ARRAY_INDEX=MAX_ARRAY_LENGTH-1,HALF_MAX_ARRAY_LENGTH=MAX_ARRAY_LENGTH>>>1,wrapFlags=[["ary",ARY_FLAG],["bind",BIND_FLAG],["bindKey",BIND_KEY_FLAG],["curry",CURRY_FLAG],["curryRight",CURRY_RIGHT_FLAG],["flip",FLIP_FLAG],["partial",PARTIAL_FLAG],["partialRight",PARTIAL_RIGHT_FLAG],["rearg",REARG_FLAG]],argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",promiseTag="[object Promise]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",weakMapTag="[object WeakMap]",weakSetTag="[object WeakSet]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g,reEscapedHtml=/&(?:amp|lt|gt|quot|#39);/g,reUnescapedHtml=/[&<>"']/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source),reEscape=/<%-([\s\S]+?)%>/g,reEvaluate=/<%([\s\S]+?)%>/g,reInterpolate=/<%=([\s\S]+?)%>/g,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source),reTrim=/^\s+|\s+$/g,reTrimStart=/^\s+/,reTrimEnd=/\s+$/,reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /,reAsciiWord=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,reEscapeChar=/\\(\\)?/g,reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,reFlags=/\w*$/,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,reNoMatch=/($^)/,reUnescapedString=/['\n\r\u2028\u2029\\]/g,rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f\\ufe20-\\ufe23",rsComboSymbolsRange="\\u20d0-\\u20f0",rsDingbatRange="\\u2700-\\u27bf",rsLowerRange="a-z\\xdf-\\xf6\\xf8-\\xff",rsMathOpRange="\\xac\\xb1\\xd7\\xf7",rsNonCharRange="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rsPunctuationRange="\\u2000-\\u206f",rsSpaceRange=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",rsUpperRange="A-Z\\xc0-\\xd6\\xd8-\\xde",rsVarRange="\\ufe0e\\ufe0f",rsBreakRange=rsMathOpRange+rsNonCharRange+rsPunctuationRange+rsSpaceRange,rsApos="['’]",rsAstral="["+rsAstralRange+"]",rsBreak="["+rsBreakRange+"]",rsCombo="["+rsComboMarksRange+rsComboSymbolsRange+"]",rsDigits="\\d+",rsDingbat="["+rsDingbatRange+"]",rsLower="["+rsLowerRange+"]",rsMisc="[^"+rsAstralRange+rsBreakRange+rsDigits+rsDingbatRange+rsLowerRange+rsUpperRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsUpper="["+rsUpperRange+"]",rsZWJ="\\u200d",rsLowerMisc="(?:"+rsLower+"|"+rsMisc+")",rsUpperMisc="(?:"+rsUpper+"|"+rsMisc+")",rsOptLowerContr="(?:"+rsApos+"(?:d|ll|m|re|s|t|ve))?",rsOptUpperContr="(?:"+rsApos+"(?:D|LL|M|RE|S|T|VE))?",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsEmoji="(?:"+[rsDingbat,rsRegional,rsSurrPair].join("|")+")"+rsSeq,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reApos=RegExp(rsApos,"g"),reComboMark=RegExp(rsCombo,"g"),reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reUnicodeWord=RegExp([rsUpper+"?"+rsLower+"+"+rsOptLowerContr+"(?="+[rsBreak,rsUpper,"$"].join("|")+")",rsUpperMisc+"+"+rsOptUpperContr+"(?="+[rsBreak,rsUpper+rsLowerMisc,"$"].join("|")+")",rsUpper+"?"+rsLowerMisc+"+"+rsOptLowerContr,rsUpper+"+"+rsOptUpperContr,rsDigits,rsEmoji].join("|"),"g"),reHasUnicode=RegExp("["+rsZWJ+rsAstralRange+rsComboMarksRange+rsComboSymbolsRange+rsVarRange+"]"),reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,contextProps=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],templateCounter=-1,typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var deburredLetters={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"},htmlUnescapes={"&":"&","<":"<",">":">",""":'"',"'":"'"},stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},freeParseFloat=parseFloat,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsArrayBuffer=nodeUtil&&nodeUtil.isArrayBuffer,nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,asciiSize=baseProperty("length"),deburrLetter=basePropertyOf(deburredLetters),escapeHtmlChar=basePropertyOf(htmlEscapes),unescapeHtmlChar=basePropertyOf(htmlUnescapes),runInContext=function runInContext(context){function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper)return value;if(hasOwnProperty.call(value,"__wrapped__"))return wrapperClone(value)}return new LodashWrapper(value)}function baseLodash(){}function LodashWrapper(value,chainAll){this.__wrapped__=value,this.__actions__=[],this.__chain__=!!chainAll,this.__index__=0,this.__values__=undefined}function LazyWrapper(value){this.__wrapped__=value,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=MAX_ARRAY_LENGTH,this.__views__=[]}function lazyClone(){var result=new LazyWrapper(this.__wrapped__);return result.__actions__=copyArray(this.__actions__),result.__dir__=this.__dir__,result.__filtered__=this.__filtered__,result.__iteratees__=copyArray(this.__iteratees__),result.__takeCount__=this.__takeCount__,result.__views__=copyArray(this.__views__),result}function lazyReverse(){if(this.__filtered__){var result=new LazyWrapper(this);result.__dir__=-1,result.__filtered__=!0}else result=this.clone(),result.__dir__*=-1;return result}function lazyValue(){var array=this.__wrapped__.value(),dir=this.__dir__,isArr=isArray(array),isRight=0>dir,arrLength=isArr?array.length:0,view=getView(0,arrLength,this.__views__),start=view.start,end=view.end,length=end-start,index=isRight?end:start-1,iteratees=this.__iteratees__,iterLength=iteratees.length,resIndex=0,takeCount=nativeMin(length,this.__takeCount__);if(!isArr||LARGE_ARRAY_SIZE>arrLength||arrLength==length&&takeCount==length)return baseWrapperValue(array,this.__actions__);var result=[];outer:for(;length--&&takeCount>resIndex;){index+=dir;for(var iterIndex=-1,value=array[index];++iterIndex<iterLength;){var data=iteratees[iterIndex],iteratee=data.iteratee,type=data.type,computed=iteratee(value);if(type==LAZY_MAP_FLAG)value=computed;else if(!computed){if(type==LAZY_FILTER_FLAG)continue outer;break outer}}result[resIndex++]=value}return result}function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(key){var result=this.has(key)&&delete this.__data__[key];return this.size-=result?1:0,result}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?undefined:result}return hasOwnProperty.call(data,key)?data[key]:undefined}function hashHas(key){var data=this.__data__;return nativeCreate?data[key]!==undefined:hasOwnProperty.call(data,key)}function hashSet(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&value===undefined?HASH_UNDEFINED:value,this}function ListCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function listCacheClear(){this.__data__=[],this.size=0}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);if(0>index)return!1;var lastIndex=data.length-1;return index==lastIndex?data.pop():splice.call(data,index,1),--this.size,!0}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return 0>index?undefined:data[index][1]}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return 0>index?(++this.size,data.push([key,value])):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(key){var result=getMapData(this,key)["delete"](key);return this.size-=result?1:0,result}function mapCacheGet(key){return getMapData(this,key).get(key)}function mapCacheHas(key){return getMapData(this,key).has(key)}function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this}function SetCache(values){var index=-1,length=values?values.length:0;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function setCacheAdd(value){return this.__data__.set(value,HASH_UNDEFINED),this}function setCacheHas(value){return this.__data__.has(value)}function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(key){var data=this.__data__,result=data["delete"](key);return this.size=data.size,result}function stackGet(key){return this.__data__.get(key)}function stackHas(key){return this.__data__.has(key)}function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<LARGE_ARRAY_SIZE-1)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this}function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}function arraySample(array){var length=array.length;return length?array[baseRandom(0,length-1)]:undefined}function arraySampleSize(array,n){return shuffleSelf(copyArray(array),baseClamp(n,0,array.length))}function arrayShuffle(array){return shuffleSelf(copyArray(array))}function assignInDefaults(objValue,srcValue,key,object){return objValue===undefined||eq(objValue,objectProto[key])&&!hasOwnProperty.call(object,key)?srcValue:objValue}function assignMergeValue(object,key,value){(value!==undefined&&!eq(object[key],value)||value===undefined&&!(key in object))&&baseAssignValue(object,key,value)}function assignValue(object,key,value){var objValue=object[key];hasOwnProperty.call(object,key)&&eq(objValue,value)&&(value!==undefined||key in object)||baseAssignValue(object,key,value)}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}function baseAggregator(collection,setter,iteratee,accumulator){return baseEach(collection,function(value,key,collection){setter(accumulator,value,iteratee(value),collection)}),accumulator}function baseAssign(object,source){return object&©Object(source,keys(source),object)}function baseAssignValue(object,key,value){"__proto__"==key&&defineProperty?defineProperty(object,key,{configurable:!0,enumerable:!0,value:value,writable:!0}):object[key]=value}function baseAt(object,paths){for(var index=-1,isNil=null==object,length=paths.length,result=Array(length);++index<length;)result[index]=isNil?undefined:get(object,paths[index]);return result}function baseClamp(number,lower,upper){return number===number&&(upper!==undefined&&(number=upper>=number?number:upper),lower!==undefined&&(number=number>=lower?number:lower)),number}function baseClone(value,isDeep,isFull,customizer,key,object,stack){var result;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),result!==undefined)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=initCloneArray(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value))return cloneBuffer(value,isDeep);if(tag==objectTag||tag==argsTag||isFunc&&!object){if(result=initCloneObject(isFunc?{}:value),!isDeep)return copySymbols(value,baseAssign(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,baseClone,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;stack.set(value,result);var props=isArr?undefined:(isFull?getAllKeys:keys)(value);return arrayEach(props||value,function(subValue,key){props&&(key=subValue,subValue=value[key]),assignValue(result,key,baseClone(subValue,isDeep,isFull,customizer,key,value,stack))}),result}function baseConforms(source){var props=keys(source);return function(object){return baseConformsTo(object,source,props)}}function baseConformsTo(object,source,props){var length=props.length;if(null==object)return!length;for(object=Object(object);length--;){var key=props[length],predicate=source[key],value=object[key];if(value===undefined&&!(key in object)||!predicate(value))return!1}return!0}function baseDelay(func,wait,args){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return setTimeout(function(){func.apply(undefined,args)},wait)}function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=!0,length=array.length,result=[],valuesLength=values.length;if(!length)return result;iteratee&&(values=arrayMap(values,baseUnary(iteratee))),comparator?(includes=arrayIncludesWith,isCommon=!1):values.length>=LARGE_ARRAY_SIZE&&(includes=cacheHas,isCommon=!1,values=new SetCache(values));outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,isCommon&&computed===computed){for(var valuesIndex=valuesLength;valuesIndex--;)if(values[valuesIndex]===computed)continue outer;result.push(value)}else includes(values,computed,comparator)||result.push(value)}return result}function baseEvery(collection,predicate){var result=!0;return baseEach(collection,function(value,index,collection){return result=!!predicate(value,index,collection)}),result}function baseExtremum(array,iteratee,comparator){for(var index=-1,length=array.length;++index<length;){var value=array[index],current=iteratee(value);if(null!=current&&(computed===undefined?current===current&&!isSymbol(current):comparator(current,computed)))var computed=current,result=value}return result}function baseFill(array,value,start,end){var length=array.length;for(start=toInteger(start),0>start&&(start=-start>length?0:length+start),end=end===undefined||end>length?length:toInteger(end),0>end&&(end+=length),end=start>end?0:toLength(end);end>start;)array[start++]=value;return array}function baseFilter(collection,predicate){var result=[];return baseEach(collection,function(value,index,collection){predicate(value,index,collection)&&result.push(value)}),result}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];depth>0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys)}function baseFunctions(object,props){return arrayFilter(props,function(key){return isFunction(object[key])})}function baseGet(object,path){path=isKey(path,object)?[path]:castPath(path);for(var index=0,length=path.length;null!=object&&length>index;)object=object[toKey(path[index++])];return index&&index==length?object:undefined}function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function baseGetTag(value){return objectToString.call(value)}function baseGt(value,other){return value>other}function baseHas(object,key){return null!=object&&hasOwnProperty.call(object,key)}function baseHasIn(object,key){return null!=object&&key in Object(object)}function baseInRange(number,start,end){return number>=nativeMin(start,end)&&number<nativeMax(start,end)}function baseIntersection(arrays,iteratee,comparator){for(var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=1/0,result=[];othIndex--;){var array=arrays[othIndex];othIndex&&iteratee&&(array=arrayMap(array,baseUnary(iteratee))),maxLength=nativeMin(array.length,maxLength),caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):undefined}array=arrays[0];var index=-1,seen=caches[0];outer:for(;++index<length&&result.length<maxLength;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,!(seen?cacheHas(seen,computed):includes(result,computed,comparator))){for(othIndex=othLength;--othIndex;){var cache=caches[othIndex];if(!(cache?cacheHas(cache,computed):includes(arrays[othIndex],computed,comparator)))continue outer}seen&&seen.push(computed),result.push(value)}}return result}function baseInverter(object,setter,iteratee,accumulator){return baseForOwn(object,function(value,key,object){setter(accumulator,iteratee(value),key,object)}),accumulator}function baseInvoke(object,path,args){isKey(path,object)||(path=castPath(path),object=parent(object,path),path=last(path));var func=null==object?object:object[toKey(path)];return null==func?undefined:apply(func,object,args)}function baseIsArguments(value){return isObjectLike(value)&&objectToString.call(value)==argsTag}function baseIsArrayBuffer(value){return isObjectLike(value)&&objectToString.call(value)==arrayBufferTag}function baseIsDate(value){return isObjectLike(value)&&objectToString.call(value)==dateTag}function baseIsEqual(value,other,customizer,bitmask,stack){
return value===other?!0:null==value||null==other||!isObject(value)&&!isObjectLike(other)?value!==value&&other!==other:baseIsEqualDeep(value,other,baseIsEqual,customizer,bitmask,stack)}function baseIsEqualDeep(object,other,equalFunc,customizer,bitmask,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=arrayTag,othTag=arrayTag;objIsArr||(objTag=getTag(object),objTag=objTag==argsTag?objectTag:objTag),othIsArr||(othTag=getTag(other),othTag=othTag==argsTag?objectTag:othTag);var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,equalFunc,customizer,bitmask,stack):equalByTag(object,other,objTag,equalFunc,customizer,bitmask,stack);if(!(bitmask&PARTIAL_COMPARE_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,customizer,bitmask,stack)}}return isSameTag?(stack||(stack=new Stack),equalObjects(object,other,equalFunc,customizer,bitmask,stack)):!1}function baseIsMap(value){return isObjectLike(value)&&getTag(value)==mapTag}function baseIsMatch(object,source,matchData,customizer){var index=matchData.length,length=index,noCustomizer=!customizer;if(null==object)return!length;for(object=Object(object);index--;){var data=matchData[index];if(noCustomizer&&data[2]?data[1]!==object[data[0]]:!(data[0]in object))return!1}for(;++index<length;){data=matchData[index];var key=data[0],objValue=object[key],srcValue=data[1];if(noCustomizer&&data[2]){if(objValue===undefined&&!(key in object))return!1}else{var stack=new Stack;if(customizer)var result=customizer(objValue,srcValue,key,object,source,stack);if(!(result===undefined?baseIsEqual(srcValue,objValue,customizer,UNORDERED_COMPARE_FLAG|PARTIAL_COMPARE_FLAG,stack):result))return!1}}return!0}function baseIsNative(value){if(!isObject(value)||isMasked(value))return!1;var pattern=isFunction(value)?reIsNative:reIsHostCtor;return pattern.test(toSource(value))}function baseIsRegExp(value){return isObject(value)&&objectToString.call(value)==regexpTag}function baseIsSet(value){return isObjectLike(value)&&getTag(value)==setTag}function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[objectToString.call(value)]}function baseIteratee(value){return"function"==typeof value?value:null==value?identity:"object"==typeof value?isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value):property(value)}function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty.call(object,key)&&"constructor"!=key&&result.push(key);return result}function baseKeysIn(object){if(!isObject(object))return nativeKeysIn(object);var isProto=isPrototype(object),result=[];for(var key in object)("constructor"!=key||!isProto&&hasOwnProperty.call(object,key))&&result.push(key);return result}function baseLt(value,other){return other>value}function baseMap(collection,iteratee){var index=-1,result=isArrayLike(collection)?Array(collection.length):[];return baseEach(collection,function(value,key,collection){result[++index]=iteratee(value,key,collection)}),result}function baseMatches(source){var matchData=getMatchData(source);return 1==matchData.length&&matchData[0][2]?matchesStrictComparable(matchData[0][0],matchData[0][1]):function(object){return object===source||baseIsMatch(object,source,matchData)}}function baseMatchesProperty(path,srcValue){return isKey(path)&&isStrictComparable(srcValue)?matchesStrictComparable(toKey(path),srcValue):function(object){var objValue=get(object,path);return objValue===undefined&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,undefined,UNORDERED_COMPARE_FLAG|PARTIAL_COMPARE_FLAG)}}function baseMerge(object,source,srcIndex,customizer,stack){object!==source&&baseFor(source,function(srcValue,key){if(isObject(srcValue))stack||(stack=new Stack),baseMergeDeep(object,source,key,srcIndex,baseMerge,customizer,stack);else{var newValue=customizer?customizer(object[key],srcValue,key+"",object,source,stack):undefined;newValue===undefined&&(newValue=srcValue),assignMergeValue(object,key,newValue)}},keysIn)}function baseMergeDeep(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=object[key],srcValue=source[key],stacked=stack.get(srcValue);if(stacked)return void assignMergeValue(object,key,stacked);var newValue=customizer?customizer(objValue,srcValue,key+"",object,source,stack):undefined,isCommon=newValue===undefined;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue,isArr||isBuff||isTyped?isArray(objValue)?newValue=objValue:isArrayLikeObject(objValue)?newValue=copyArray(objValue):isBuff?(isCommon=!1,newValue=cloneBuffer(srcValue,!0)):isTyped?(isCommon=!1,newValue=cloneTypedArray(srcValue,!0)):newValue=[]:isPlainObject(srcValue)||isArguments(srcValue)?(newValue=objValue,isArguments(objValue)?newValue=toPlainObject(objValue):(!isObject(objValue)||srcIndex&&isFunction(objValue))&&(newValue=initCloneObject(srcValue))):isCommon=!1}isCommon&&(stack.set(srcValue,newValue),mergeFunc(newValue,srcValue,srcIndex,customizer,stack),stack["delete"](srcValue)),assignMergeValue(object,key,newValue)}function baseNth(array,n){var length=array.length;if(length)return n+=0>n?length:0,isIndex(n,length)?array[n]:undefined}function baseOrderBy(collection,iteratees,orders){var index=-1;iteratees=arrayMap(iteratees.length?iteratees:[identity],baseUnary(getIteratee()));var result=baseMap(collection,function(value,key,collection){var criteria=arrayMap(iteratees,function(iteratee){return iteratee(value)});return{criteria:criteria,index:++index,value:value}});return baseSortBy(result,function(object,other){return compareMultiple(object,other,orders)})}function basePick(object,props){return object=Object(object),basePickBy(object,props,function(value,key){return key in object})}function basePickBy(object,props,predicate){for(var index=-1,length=props.length,result={};++index<length;){var key=props[index],value=object[key];predicate(value,key)&&baseAssignValue(result,key,value)}return result}function basePropertyDeep(path){return function(object){return baseGet(object,path)}}function basePullAll(array,values,iteratee,comparator){var indexOf=comparator?baseIndexOfWith:baseIndexOf,index=-1,length=values.length,seen=array;for(array===values&&(values=copyArray(values)),iteratee&&(seen=arrayMap(array,baseUnary(iteratee)));++index<length;)for(var fromIndex=0,value=values[index],computed=iteratee?iteratee(value):value;(fromIndex=indexOf(seen,computed,fromIndex,comparator))>-1;)seen!==array&&splice.call(seen,fromIndex,1),splice.call(array,fromIndex,1);return array}function basePullAt(array,indexes){for(var length=array?indexes.length:0,lastIndex=length-1;length--;){var index=indexes[length];if(length==lastIndex||index!==previous){var previous=index;if(isIndex(index))splice.call(array,index,1);else if(isKey(index,array))delete array[toKey(index)];else{var path=castPath(index),object=parent(array,path);null!=object&&delete object[toKey(last(path))]}}}return array}function baseRandom(lower,upper){return lower+nativeFloor(nativeRandom()*(upper-lower+1))}function baseRange(start,end,step,fromRight){for(var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);length--;)result[fromRight?length:++index]=start,start+=step;return result}function baseRepeat(string,n){var result="";if(!string||1>n||n>MAX_SAFE_INTEGER)return result;do n%2&&(result+=string),n=nativeFloor(n/2),n&&(string+=string);while(n);return result}function baseRest(func,start){return setToString(overRest(func,start,identity),func+"")}function baseSample(collection){return arraySample(values(collection))}function baseSampleSize(collection,n){var array=values(collection);return shuffleSelf(array,baseClamp(n,0,array.length))}function baseSet(object,path,value,customizer){if(!isObject(object))return object;path=isKey(path,object)?[path]:castPath(path);for(var index=-1,length=path.length,lastIndex=length-1,nested=object;null!=nested&&++index<length;){var key=toKey(path[index]),newValue=value;if(index!=lastIndex){var objValue=nested[key];newValue=customizer?customizer(objValue,key,nested):undefined,newValue===undefined&&(newValue=isObject(objValue)?objValue:isIndex(path[index+1])?[]:{})}assignValue(nested,key,newValue),nested=nested[key]}return object}function baseShuffle(collection){return shuffleSelf(values(collection))}function baseSlice(array,start,end){var index=-1,length=array.length;0>start&&(start=-start>length?0:length+start),end=end>length?length:end,0>end&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index<length;)result[index]=array[index+start];return result}function baseSome(collection,predicate){var result;return baseEach(collection,function(value,index,collection){return result=predicate(value,index,collection),!result}),!!result}function baseSortedIndex(array,value,retHighest){var low=0,high=array?array.length:low;if("number"==typeof value&&value===value&&HALF_MAX_ARRAY_LENGTH>=high){for(;high>low;){var mid=low+high>>>1,computed=array[mid];null!==computed&&!isSymbol(computed)&&(retHighest?value>=computed:value>computed)?low=mid+1:high=mid}return high}return baseSortedIndexBy(array,value,identity,retHighest)}function baseSortedIndexBy(array,value,iteratee,retHighest){value=iteratee(value);for(var low=0,high=array?array.length:0,valIsNaN=value!==value,valIsNull=null===value,valIsSymbol=isSymbol(value),valIsUndefined=value===undefined;high>low;){var mid=nativeFloor((low+high)/2),computed=iteratee(array[mid]),othIsDefined=computed!==undefined,othIsNull=null===computed,othIsReflexive=computed===computed,othIsSymbol=isSymbol(computed);if(valIsNaN)var setLow=retHighest||othIsReflexive;else setLow=valIsUndefined?othIsReflexive&&(retHighest||othIsDefined):valIsNull?othIsReflexive&&othIsDefined&&(retHighest||!othIsNull):valIsSymbol?othIsReflexive&&othIsDefined&&!othIsNull&&(retHighest||!othIsSymbol):othIsNull||othIsSymbol?!1:retHighest?value>=computed:value>computed;setLow?low=mid+1:high=mid}return nativeMin(high,MAX_ARRAY_INDEX)}function baseSortedUniq(array,iteratee){for(var index=-1,length=array.length,resIndex=0,result=[];++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(!index||!eq(computed,seen)){var seen=computed;result[resIndex++]=0===value?0:value}}return result}function baseToNumber(value){return"number"==typeof value?value:isSymbol(value)?NAN:+value}function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(comparator)isCommon=!1,includes=arrayIncludesWith;else if(length>=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,isCommon&&computed===computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}function baseUnset(object,path){path=isKey(path,object)?[path]:castPath(path),object=parent(object,path);var key=toKey(last(path));return!(null!=object&&hasOwnProperty.call(object,key))||delete object[key]}function baseUpdate(object,path,updater,customizer){return baseSet(object,path,updater(baseGet(object,path)),customizer)}function baseWhile(array,predicate,isDrop,fromRight){for(var length=array.length,index=fromRight?length:-1;(fromRight?index--:++index<length)&&predicate(array[index],index,array););return isDrop?baseSlice(array,fromRight?0:index,fromRight?index+1:length):baseSlice(array,fromRight?index+1:0,fromRight?length:index)}function baseWrapperValue(value,actions){var result=value;return result instanceof LazyWrapper&&(result=result.value()),arrayReduce(actions,function(result,action){return action.func.apply(action.thisArg,arrayPush([result],action.args))},result)}function baseXor(arrays,iteratee,comparator){for(var index=-1,length=arrays.length;++index<length;)var result=result?arrayPush(baseDifference(result,arrays[index],iteratee,comparator),baseDifference(arrays[index],result,iteratee,comparator)):arrays[index];return result&&result.length?baseUniq(result,iteratee,comparator):[]}function baseZipObject(props,values,assignFunc){for(var index=-1,length=props.length,valsLength=values.length,result={};++index<length;){var value=valsLength>index?values[index]:undefined;assignFunc(result,props[index],value)}return result}function castArrayLikeObject(value){return isArrayLikeObject(value)?value:[]}function castFunction(value){return"function"==typeof value?value:identity}function castPath(value){return isArray(value)?value:stringToPath(value)}function castSlice(array,start,end){var length=array.length;return end=end===undefined?length:end,!start&&end>=length?array:baseSlice(array,start,end)}function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)),result}function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}function cloneMap(map,isDeep,cloneFunc){var array=isDeep?cloneFunc(mapToArray(map),!0):mapToArray(map);return arrayReduce(array,addMapEntry,new map.constructor)}function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));return result.lastIndex=regexp.lastIndex,result}function cloneSet(set,isDeep,cloneFunc){var array=isDeep?cloneFunc(setToArray(set),!0):setToArray(set);return arrayReduce(array,addSetEntry,new set.constructor)}function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{}}function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}function compareAscending(value,other){if(value!==other){var valIsDefined=value!==undefined,valIsNull=null===value,valIsReflexive=value===value,valIsSymbol=isSymbol(value),othIsDefined=other!==undefined,othIsNull=null===other,othIsReflexive=other===other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&other>value||othIsSymbol&&valIsDefined&&valIsReflexive&&!valIsNull&&!valIsSymbol||othIsNull&&valIsDefined&&valIsReflexive||!othIsDefined&&valIsReflexive||!othIsReflexive)return-1}return 0}function compareMultiple(object,other,orders){for(var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length,ordersLength=orders.length;++index<length;){var result=compareAscending(objCriteria[index],othCriteria[index]);if(result){if(index>=ordersLength)return result;var order=orders[index];return result*("desc"==order?-1:1)}}return object.index-other.index}function composeArgs(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;++leftIndex<leftLength;)result[leftIndex]=partials[leftIndex];for(;++argsIndex<holdersLength;)(isUncurried||argsLength>argsIndex)&&(result[holders[argsIndex]]=args[argsIndex]);for(;rangeLength--;)result[leftIndex++]=args[argsIndex++];return result}function composeArgsRight(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersIndex=-1,holdersLength=holders.length,rightIndex=-1,rightLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(rangeLength+rightLength),isUncurried=!isCurried;++argsIndex<rangeLength;)result[argsIndex]=args[argsIndex];for(var offset=argsIndex;++rightIndex<rightLength;)result[offset+rightIndex]=partials[rightIndex];for(;++holdersIndex<holdersLength;)(isUncurried||argsLength>argsIndex)&&(result[offset+holders[holdersIndex]]=args[argsIndex++]);return result}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index<length;)array[index]=source[index];return array}function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index<length;){var key=props[index],newValue=customizer?customizer(object[key],source[key],key,object,source):undefined;newValue===undefined&&(newValue=source[key]),isNew?baseAssignValue(object,key,newValue):assignValue(object,key,newValue)}return object}function copySymbols(source,object){return copyObject(source,getSymbols(source),object)}function createAggregator(setter,initializer){return function(collection,iteratee){var func=isArray(collection)?arrayAggregator:baseAggregator,accumulator=initializer?initializer():{};return func(collection,setter,getIteratee(iteratee,2),accumulator)}}function createAssigner(assigner){return baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):undefined,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=3>length?undefined:customizer,length=1),object=Object(object);++index<length;){var source=sources[index];source&&assigner(object,source,index,customizer)}return object})}function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index<length)&&iteratee(iterable[index],index,iterable)!==!1;);return collection}}function createBaseFor(fromRight){return function(object,iteratee,keysFunc){for(var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;length--;){var key=props[fromRight?length:++index];if(iteratee(iterable[key],key,iterable)===!1)break}return object}}function createBind(func,bitmask,thisArg){function wrapper(){var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return fn.apply(isBind?thisArg:this,arguments)}var isBind=bitmask&BIND_FLAG,Ctor=createCtor(func);return wrapper}function createCaseFirst(methodName){return function(string){string=toString(string);var strSymbols=hasUnicode(string)?stringToArray(string):undefined,chr=strSymbols?strSymbols[0]:string.charAt(0),trailing=strSymbols?castSlice(strSymbols,1).join(""):string.slice(1);return chr[methodName]()+trailing}}function createCompounder(callback){return function(string){return arrayReduce(words(deburr(string).replace(reApos,"")),callback,"")}}function createCtor(Ctor){return function(){var args=arguments;switch(args.length){case 0:return new Ctor;case 1:return new Ctor(args[0]);case 2:return new Ctor(args[0],args[1]);case 3:return new Ctor(args[0],args[1],args[2]);case 4:return new Ctor(args[0],args[1],args[2],args[3]);case 5:return new Ctor(args[0],args[1],args[2],args[3],args[4]);case 6:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5]);case 7:return new Ctor(args[0],args[1],args[2],args[3],args[4],args[5],args[6])}var thisBinding=baseCreate(Ctor.prototype),result=Ctor.apply(thisBinding,args);return isObject(result)?result:thisBinding}}function createCurry(func,bitmask,arity){function wrapper(){for(var length=arguments.length,args=Array(length),index=length,placeholder=getHolder(wrapper);index--;)args[index]=arguments[index];var holders=3>length&&args[0]!==placeholder&&args[length-1]!==placeholder?[]:replaceHolders(args,placeholder);if(length-=holders.length,arity>length)return createRecurry(func,bitmask,createHybrid,wrapper.placeholder,undefined,args,holders,undefined,undefined,arity-length);var fn=this&&this!==root&&this instanceof wrapper?Ctor:func;return apply(fn,this,args)}var Ctor=createCtor(func);return wrapper}function createFind(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=getIteratee(predicate,3);collection=keys(collection),predicate=function(key){return iteratee(iterable[key],key,iterable)}}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:undefined}}function createFlow(fromRight){return flatRest(function(funcs){var length=funcs.length,index=length,prereq=LodashWrapper.prototype.thru;for(fromRight&&funcs.reverse();index--;){var func=funcs[index];if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);if(prereq&&!wrapper&&"wrapper"==getFuncName(func))var wrapper=new LodashWrapper([],!0)}for(index=wrapper?index:length;++index<length;){func=funcs[index];var funcName=getFuncName(func),data="wrapper"==funcName?getData(func):undefined;wrapper=data&&isLaziable(data[0])&&data[1]==(ARY_FLAG|CURRY_FLAG|PARTIAL_FLAG|REARG_FLAG)&&!data[4].length&&1==data[9]?wrapper[getFuncName(data[0])].apply(wrapper,data[3]):1==func.length&&isLaziable(func)?wrapper[funcName]():wrapper.thru(func)}return function(){var args=arguments,value=args[0];if(wrapper&&1==args.length&&isArray(value)&&value.length>=LARGE_ARRAY_SIZE)return wrapper.plant(value).value();for(var index=0,result=length?funcs[index].apply(this,args):value;++index<length;)result=funcs[index].call(this,result);return result}})}function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){function wrapper(){for(var length=arguments.length,args=Array(length),index=length;index--;)args[index]=arguments[index];if(isCurried)var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder);if(partials&&(args=composeArgs(args,partials,holders,isCurried)),partialsRight&&(args=composeArgsRight(args,partialsRight,holdersRight,isCurried)),length-=holdersCount,isCurried&&arity>length){var newHolders=replaceHolders(args,placeholder);return createRecurry(func,bitmask,createHybrid,wrapper.placeholder,thisArg,args,newHolders,argPos,ary,arity-length)}var thisBinding=isBind?thisArg:this,fn=isBindKey?thisBinding[func]:func;return length=args.length,argPos?args=reorder(args,argPos):isFlip&&length>1&&args.reverse(),isAry&&length>ary&&(args.length=ary),this&&this!==root&&this instanceof wrapper&&(fn=Ctor||createCtor(fn)),fn.apply(thisBinding,args)}var isAry=bitmask&ARY_FLAG,isBind=bitmask&BIND_FLAG,isBindKey=bitmask&BIND_KEY_FLAG,isCurried=bitmask&(CURRY_FLAG|CURRY_RIGHT_FLAG),isFlip=bitmask&FLIP_FLAG,Ctor=isBindKey?undefined:createCtor(func);return wrapper}function createInverter(setter,toIteratee){return function(object,iteratee){return baseInverter(object,setter,toIteratee(iteratee),{})}}function createMathOperation(operator,defaultValue){return function(value,other){var result;if(value===undefined&&other===undefined)return defaultValue;if(value!==undefined&&(result=value),other!==undefined){if(result===undefined)return other;"string"==typeof value||"string"==typeof other?(value=baseToString(value),other=baseToString(other)):(value=baseToNumber(value),other=baseToNumber(other)),result=operator(value,other)}return result}}function createOver(arrayFunc){return flatRest(function(iteratees){return iteratees=arrayMap(iteratees,baseUnary(getIteratee())),baseRest(function(args){var thisArg=this;return arrayFunc(iteratees,function(iteratee){return apply(iteratee,thisArg,args)})})})}function createPadding(length,chars){chars=chars===undefined?" ":baseToString(chars);var charsLength=chars.length;if(2>charsLength)return charsLength?baseRepeat(chars,length):chars;var result=baseRepeat(chars,nativeCeil(length/stringSize(chars)));return hasUnicode(chars)?castSlice(stringToArray(result),0,length).join(""):result.slice(0,length)}function createPartial(func,bitmask,thisArg,partials){function wrapper(){for(var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength),fn=this&&this!==root&&this instanceof wrapper?Ctor:func;++leftIndex<leftLength;)args[leftIndex]=partials[leftIndex];for(;argsLength--;)args[leftIndex++]=arguments[++argsIndex];return apply(fn,isBind?thisArg:this,args)}var isBind=bitmask&BIND_FLAG,Ctor=createCtor(func);return wrapper}function createRange(fromRight){return function(start,end,step){return step&&"number"!=typeof step&&isIterateeCall(start,end,step)&&(end=step=undefined),start=toFinite(start),end===undefined?(end=start,start=0):end=toFinite(end),step=step===undefined?end>start?1:-1:toFinite(step),baseRange(start,end,step,fromRight)}}function createRelationalOperation(operator){return function(value,other){return("string"!=typeof value||"string"!=typeof other)&&(value=toNumber(value),other=toNumber(other)),operator(value,other)}}function createRecurry(func,bitmask,wrapFunc,placeholder,thisArg,partials,holders,argPos,ary,arity){var isCurry=bitmask&CURRY_FLAG,newHolders=isCurry?holders:undefined,newHoldersRight=isCurry?undefined:holders,newPartials=isCurry?partials:undefined,newPartialsRight=isCurry?undefined:partials;bitmask|=isCurry?PARTIAL_FLAG:PARTIAL_RIGHT_FLAG,bitmask&=~(isCurry?PARTIAL_RIGHT_FLAG:PARTIAL_FLAG),bitmask&CURRY_BOUND_FLAG||(bitmask&=~(BIND_FLAG|BIND_KEY_FLAG));var newData=[func,bitmask,thisArg,newPartials,newHolders,newPartialsRight,newHoldersRight,argPos,ary,arity],result=wrapFunc.apply(undefined,newData);return isLaziable(func)&&setData(result,newData),result.placeholder=placeholder,setWrapToString(result,func,bitmask)}function createRound(methodName){var func=Math[methodName];return function(number,precision){if(number=toNumber(number),precision=nativeMin(toInteger(precision),292)){var pair=(toString(number)+"e").split("e"),value=func(pair[0]+"e"+(+pair[1]+precision));return pair=(toString(value)+"e").split("e"),+(pair[0]+"e"+(+pair[1]-precision))}return func(number)}}function createToPairs(keysFunc){return function(object){var tag=getTag(object);return tag==mapTag?mapToArray(object):tag==setTag?setToPairs(object):baseToPairs(object,keysFunc(object))}}function createWrap(func,bitmask,thisArg,partials,holders,argPos,ary,arity){var isBindKey=bitmask&BIND_KEY_FLAG;if(!isBindKey&&"function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);var length=partials?partials.length:0;if(length||(bitmask&=~(PARTIAL_FLAG|PARTIAL_RIGHT_FLAG),partials=holders=undefined),ary=ary===undefined?ary:nativeMax(toInteger(ary),0),arity=arity===undefined?arity:toInteger(arity),length-=holders?holders.length:0,bitmask&PARTIAL_RIGHT_FLAG){var partialsRight=partials,holdersRight=holders;partials=holders=undefined}var data=isBindKey?undefined:getData(func),newData=[func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity];if(data&&mergeData(newData,data),func=newData[0],bitmask=newData[1],thisArg=newData[2],partials=newData[3],holders=newData[4],arity=newData[9]=null==newData[9]?isBindKey?0:func.length:nativeMax(newData[9]-length,0),!arity&&bitmask&(CURRY_FLAG|CURRY_RIGHT_FLAG)&&(bitmask&=~(CURRY_FLAG|CURRY_RIGHT_FLAG)),bitmask&&bitmask!=BIND_FLAG)result=bitmask==CURRY_FLAG||bitmask==CURRY_RIGHT_FLAG?createCurry(func,bitmask,arity):bitmask!=PARTIAL_FLAG&&bitmask!=(BIND_FLAG|PARTIAL_FLAG)||holders.length?createHybrid.apply(undefined,newData):createPartial(func,bitmask,thisArg,partials);else var result=createBind(func,bitmask,thisArg);var setter=data?baseSetData:setData;return setWrapToString(setter(result,newData),func,bitmask)}function equalArrays(array,other,equalFunc,customizer,bitmask,stack){var isPartial=bitmask&PARTIAL_COMPARE_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:undefined;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(compared!==undefined){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,function(othValue,othIndex){return cacheHas(seen,othIndex)||arrValue!==othValue&&!equalFunc(arrValue,othValue,customizer,bitmask,stack)?void 0:seen.push(othIndex)})){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,customizer,bitmask,stack)){result=!1;break}}return stack["delete"](array),stack["delete"](other),result}function equalByTag(object,other,tag,equalFunc,customizer,bitmask,stack){switch(tag){case dataViewTag:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case arrayBufferTag:return object.byteLength==other.byteLength&&equalFunc(new Uint8Array(object),new Uint8Array(other))?!0:!1;case boolTag:case dateTag:case numberTag:return eq(+object,+other);case errorTag:return object.name==other.name&&object.message==other.message;case regexpTag:case stringTag:return object==other+"";case mapTag:var convert=mapToArray;case setTag:var isPartial=bitmask&PARTIAL_COMPARE_FLAG;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=UNORDERED_COMPARE_FLAG,stack.set(object,other);var result=equalArrays(convert(object),convert(other),equalFunc,customizer,bitmask,stack);return stack["delete"](object),result;case symbolTag:if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}function equalObjects(object,other,equalFunc,customizer,bitmask,stack){var isPartial=bitmask&PARTIAL_COMPARE_FLAG,objProps=keys(object),objLength=objProps.length,othProps=keys(other),othLength=othProps.length;if(objLength!=othLength&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty.call(other,key)))return!1}var stacked=stack.get(object);if(stacked&&stack.get(other))return stacked==other;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(compared===undefined?objValue===othValue||equalFunc(objValue,othValue,customizer,bitmask,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor!=othCtor&&"constructor"in object&&"constructor"in other&&!("function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor)&&(result=!1);
}return stack["delete"](object),stack["delete"](other),result}function flatRest(func){return setToString(overRest(func,undefined,flatten),func+"")}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function getAllKeysIn(object){return baseGetAllKeys(object,keysIn,getSymbolsIn)}function getFuncName(func){for(var result=func.name+"",array=realNames[result],length=hasOwnProperty.call(realNames,result)?array.length:0;length--;){var data=array[length],otherFunc=data.func;if(null==otherFunc||otherFunc==func)return data.name}return result}function getHolder(func){var object=hasOwnProperty.call(lodash,"placeholder")?lodash:func;return object.placeholder}function getIteratee(){var result=lodash.iteratee||iteratee;return result=result===iteratee?baseIteratee:result,arguments.length?result(arguments[0],arguments[1]):result}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data["string"==typeof key?"string":"hash"]:data.map}function getMatchData(object){for(var result=keys(object),length=result.length;length--;){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)]}return result}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:undefined}function getView(start,end,transforms){for(var index=-1,length=transforms.length;++index<length;){var data=transforms[index],size=data.size;switch(data.type){case"drop":start+=size;break;case"dropRight":end-=size;break;case"take":end=nativeMin(end,start+size);break;case"takeRight":start=nativeMax(start,end-size)}}return{start:start,end:end}}function getWrapDetails(source){var match=source.match(reWrapDetails);return match?match[1].split(reSplitDetails):[]}function hasPath(object,path,hasFunc){path=isKey(path,object)?[path]:castPath(path);for(var index=-1,length=path.length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:(length=object?object.length:0,!!length&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object)))}function initCloneArray(array){var length=array.length,result=array.constructor(length);return length&&"string"==typeof array[0]&&hasOwnProperty.call(array,"index")&&(result.index=array.index,result.input=array.input),result}function initCloneObject(object){return"function"!=typeof object.constructor||isPrototype(object)?{}:baseCreate(getPrototype(object))}function initCloneByTag(object,tag,cloneFunc,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return cloneDataView(object,isDeep);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:return cloneTypedArray(object,isDeep);case mapTag:return cloneMap(object,isDeep,cloneFunc);case numberTag:case stringTag:return new Ctor(object);case regexpTag:return cloneRegExp(object);case setTag:return cloneSet(object,isDeep,cloneFunc);case symbolTag:return cloneSymbol(object)}}function insertWrapDetails(source,details){var length=details.length;if(!length)return source;var lastIndex=length-1;return details[lastIndex]=(length>1?"& ":"")+details[lastIndex],details=details.join(length>2?", ":" "),source.replace(reWrapComment,"{\n/* [wrapped with "+details+"] */\n")}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function isIndex(value,length){return length=null==length?MAX_SAFE_INTEGER:length,!!length&&("number"==typeof value||reIsUint.test(value))&&value>-1&&value%1==0&&length>value}function isIterateeCall(value,index,object){if(!isObject(object))return!1;var type=typeof index;return("number"==type?isArrayLike(object)&&isIndex(index,object.length):"string"==type&&index in object)?eq(object[index],value):!1}function isKey(value,object){if(isArray(value))return!1;var type=typeof value;return"number"==type||"symbol"==type||"boolean"==type||null==value||isSymbol(value)?!0:reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object)}function isKeyable(value){var type=typeof value;return"string"==type||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value}function isLaziable(func){var funcName=getFuncName(func),other=lodash[funcName];if("function"!=typeof other||!(funcName in LazyWrapper.prototype))return!1;if(func===other)return!0;var data=getData(other);return!!data&&func===data[0]}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}function isPrototype(value){var Ctor=value&&value.constructor,proto="function"==typeof Ctor&&Ctor.prototype||objectProto;return value===proto}function isStrictComparable(value){return value===value&&!isObject(value)}function matchesStrictComparable(key,srcValue){return function(object){return null==object?!1:object[key]===srcValue&&(srcValue!==undefined||key in Object(object))}}function memoizeCapped(func){var result=memoize(func,function(key){return cache.size===MAX_MEMOIZE_SIZE&&cache.clear(),key}),cache=result.cache;return result}function mergeData(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask,isCommon=(BIND_FLAG|BIND_KEY_FLAG|ARY_FLAG)>newBitmask,isCombo=srcBitmask==ARY_FLAG&&bitmask==CURRY_FLAG||srcBitmask==ARY_FLAG&&bitmask==REARG_FLAG&&data[7].length<=source[8]||srcBitmask==(ARY_FLAG|REARG_FLAG)&&source[7].length<=source[8]&&bitmask==CURRY_FLAG;if(!isCommon&&!isCombo)return data;srcBitmask&BIND_FLAG&&(data[2]=source[2],newBitmask|=bitmask&BIND_FLAG?0:CURRY_BOUND_FLAG);var value=source[3];if(value){var partials=data[3];data[3]=partials?composeArgs(partials,value,source[4]):value,data[4]=partials?replaceHolders(data[3],PLACEHOLDER):source[4]}return value=source[5],value&&(partials=data[5],data[5]=partials?composeArgsRight(partials,value,source[6]):value,data[6]=partials?replaceHolders(data[5],PLACEHOLDER):source[6]),value=source[7],value&&(data[7]=value),srcBitmask&ARY_FLAG&&(data[8]=null==data[8]?source[8]:nativeMin(data[8],source[8])),null==data[9]&&(data[9]=source[9]),data[0]=source[0],data[1]=newBitmask,data}function mergeDefaults(objValue,srcValue,key,object,source,stack){return isObject(objValue)&&isObject(srcValue)&&(stack.set(srcValue,objValue),baseMerge(objValue,srcValue,undefined,mergeDefaults,stack),stack["delete"](srcValue)),objValue}function nativeKeysIn(object){var result=[];if(null!=object)for(var key in Object(object))result.push(key);return result}function overRest(func,start,transform){return start=nativeMax(start===undefined?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=transform(array),apply(func,this,otherArgs)}}function parent(object,path){return 1==path.length?object:baseGet(object,baseSlice(path,0,-1))}function reorder(array,indexes){for(var arrLength=array.length,length=nativeMin(indexes.length,arrLength),oldArray=copyArray(array);length--;){var index=indexes[length];array[length]=isIndex(index,arrLength)?oldArray[index]:undefined}return array}function setWrapToString(wrapper,reference,bitmask){var source=reference+"";return setToString(wrapper,insertWrapDetails(source,updateWrapDetails(getWrapDetails(source),bitmask)))}function shortOut(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=HOT_SPAN-(stamp-lastCalled);if(lastCalled=stamp,remaining>0){if(++count>=HOT_COUNT)return arguments[0]}else count=0;return func.apply(undefined,arguments)}}function shuffleSelf(array,size){var index=-1,length=array.length,lastIndex=length-1;for(size=size===undefined?length:size;++index<size;){var rand=baseRandom(index,lastIndex),value=array[rand];array[rand]=array[index],array[index]=value}return array.length=size,array}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function updateWrapDetails(details,bitmask){return arrayEach(wrapFlags,function(pair){var value="_."+pair[0];bitmask&pair[1]&&!arrayIncludes(details,value)&&details.push(value)}),details.sort()}function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper)return wrapper.clone();var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);return result.__actions__=copyArray(wrapper.__actions__),result.__index__=wrapper.__index__,result.__values__=wrapper.__values__,result}function chunk(array,size,guard){size=(guard?isIterateeCall(array,size,guard):size===undefined)?1:nativeMax(toInteger(size),0);var length=array?array.length:0;if(!length||1>size)return[];for(var index=0,resIndex=0,result=Array(nativeCeil(length/size));length>index;)result[resIndex++]=baseSlice(array,index,index+=size);return result}function compact(array){for(var index=-1,length=array?array.length:0,resIndex=0,result=[];++index<length;){var value=array[index];value&&(result[resIndex++]=value)}return result}function concat(){var length=arguments.length;if(!length)return[];for(var args=Array(length-1),array=arguments[0],index=length;index--;)args[index-1]=arguments[index];return arrayPush(isArray(array)?copyArray(array):[array],baseFlatten(args,1))}function drop(array,n,guard){var length=array?array.length:0;return length?(n=guard||n===undefined?1:toInteger(n),baseSlice(array,0>n?0:n,length)):[]}function dropRight(array,n,guard){var length=array?array.length:0;return length?(n=guard||n===undefined?1:toInteger(n),n=length-n,baseSlice(array,0,0>n?0:n)):[]}function dropRightWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!0,!0):[]}function dropWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!0):[]}function fill(array,value,start,end){var length=array?array.length:0;return length?(start&&"number"!=typeof start&&isIterateeCall(array,value,start)&&(start=0,end=length),baseFill(array,value,start,end)):[]}function findIndex(array,predicate,fromIndex){var length=array?array.length:0;if(!length)return-1;var index=null==fromIndex?0:toInteger(fromIndex);return 0>index&&(index=nativeMax(length+index,0)),baseFindIndex(array,getIteratee(predicate,3),index)}function findLastIndex(array,predicate,fromIndex){var length=array?array.length:0;if(!length)return-1;var index=length-1;return fromIndex!==undefined&&(index=toInteger(fromIndex),index=0>fromIndex?nativeMax(length+index,0):nativeMin(index,length-1)),baseFindIndex(array,getIteratee(predicate,3),index,!0)}function flatten(array){var length=array?array.length:0;return length?baseFlatten(array,1):[]}function flattenDeep(array){var length=array?array.length:0;return length?baseFlatten(array,INFINITY):[]}function flattenDepth(array,depth){var length=array?array.length:0;return length?(depth=depth===undefined?1:toInteger(depth),baseFlatten(array,depth)):[]}function fromPairs(pairs){for(var index=-1,length=pairs?pairs.length:0,result={};++index<length;){var pair=pairs[index];result[pair[0]]=pair[1]}return result}function head(array){return array&&array.length?array[0]:undefined}function indexOf(array,value,fromIndex){var length=array?array.length:0;if(!length)return-1;var index=null==fromIndex?0:toInteger(fromIndex);return 0>index&&(index=nativeMax(length+index,0)),baseIndexOf(array,value,index)}function initial(array){var length=array?array.length:0;return length?baseSlice(array,0,-1):[]}function join(array,separator){return array?nativeJoin.call(array,separator):""}function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}function lastIndexOf(array,value,fromIndex){var length=array?array.length:0;if(!length)return-1;var index=length;return fromIndex!==undefined&&(index=toInteger(fromIndex),index=0>index?nativeMax(length+index,0):nativeMin(index,length-1)),value===value?strictLastIndexOf(array,value,index):baseFindIndex(array,baseIsNaN,index,!0)}function nth(array,n){return array&&array.length?baseNth(array,toInteger(n)):undefined}function pullAll(array,values){return array&&array.length&&values&&values.length?basePullAll(array,values):array}function pullAllBy(array,values,iteratee){return array&&array.length&&values&&values.length?basePullAll(array,values,getIteratee(iteratee,2)):array}function pullAllWith(array,values,comparator){return array&&array.length&&values&&values.length?basePullAll(array,values,undefined,comparator):array}function remove(array,predicate){var result=[];if(!array||!array.length)return result;var index=-1,indexes=[],length=array.length;for(predicate=getIteratee(predicate,3);++index<length;){var value=array[index];predicate(value,index,array)&&(result.push(value),indexes.push(index))}return basePullAt(array,indexes),result}function reverse(array){return array?nativeReverse.call(array):array}function slice(array,start,end){var length=array?array.length:0;return length?(end&&"number"!=typeof end&&isIterateeCall(array,start,end)?(start=0,end=length):(start=null==start?0:toInteger(start),end=end===undefined?length:toInteger(end)),baseSlice(array,start,end)):[]}function sortedIndex(array,value){return baseSortedIndex(array,value)}function sortedIndexBy(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2))}function sortedIndexOf(array,value){var length=array?array.length:0;if(length){var index=baseSortedIndex(array,value);if(length>index&&eq(array[index],value))return index}return-1}function sortedLastIndex(array,value){return baseSortedIndex(array,value,!0)}function sortedLastIndexBy(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2),!0)}function sortedLastIndexOf(array,value){var length=array?array.length:0;if(length){var index=baseSortedIndex(array,value,!0)-1;if(eq(array[index],value))return index}return-1}function sortedUniq(array){return array&&array.length?baseSortedUniq(array):[]}function sortedUniqBy(array,iteratee){return array&&array.length?baseSortedUniq(array,getIteratee(iteratee,2)):[]}function tail(array){var length=array?array.length:0;return length?baseSlice(array,1,length):[]}function take(array,n,guard){return array&&array.length?(n=guard||n===undefined?1:toInteger(n),baseSlice(array,0,0>n?0:n)):[]}function takeRight(array,n,guard){var length=array?array.length:0;return length?(n=guard||n===undefined?1:toInteger(n),n=length-n,baseSlice(array,0>n?0:n,length)):[]}function takeRightWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),!1,!0):[]}function takeWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3)):[]}function uniq(array){return array&&array.length?baseUniq(array):[]}function uniqBy(array,iteratee){return array&&array.length?baseUniq(array,getIteratee(iteratee,2)):[]}function uniqWith(array,comparator){return array&&array.length?baseUniq(array,undefined,comparator):[]}function unzip(array){if(!array||!array.length)return[];var length=0;return array=arrayFilter(array,function(group){return isArrayLikeObject(group)?(length=nativeMax(group.length,length),!0):void 0}),baseTimes(length,function(index){return arrayMap(array,baseProperty(index))})}function unzipWith(array,iteratee){if(!array||!array.length)return[];var result=unzip(array);return null==iteratee?result:arrayMap(result,function(group){return apply(iteratee,undefined,group)})}function zipObject(props,values){return baseZipObject(props||[],values||[],assignValue)}function zipObjectDeep(props,values){return baseZipObject(props||[],values||[],baseSet)}function chain(value){var result=lodash(value);return result.__chain__=!0,result}function tap(value,interceptor){return interceptor(value),value}function thru(value,interceptor){return interceptor(value)}function wrapperChain(){return chain(this)}function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)}function wrapperNext(){this.__values__===undefined&&(this.__values__=toArray(this.value()));var done=this.__index__>=this.__values__.length,value=done?undefined:this.__values__[this.__index__++];return{done:done,value:value}}function wrapperToIterator(){return this}function wrapperPlant(value){for(var result,parent=this;parent instanceof baseLodash;){var clone=wrapperClone(parent);clone.__index__=0,clone.__values__=undefined,result?previous.__wrapped__=clone:result=clone;var previous=clone;parent=parent.__wrapped__}return previous.__wrapped__=value,result}function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;return this.__actions__.length&&(wrapped=new LazyWrapper(this)),wrapped=wrapped.reverse(),wrapped.__actions__.push({func:thru,args:[reverse],thisArg:undefined}),new LodashWrapper(wrapped,this.__chain__)}return this.thru(reverse)}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,getIteratee(predicate,3))}function filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,getIteratee(predicate,3))}function flatMap(collection,iteratee){return baseFlatten(map(collection,iteratee),1)}function flatMapDeep(collection,iteratee){return baseFlatten(map(collection,iteratee),INFINITY)}function flatMapDepth(collection,iteratee,depth){return depth=depth===undefined?1:toInteger(depth),baseFlatten(map(collection,iteratee),depth)}function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,getIteratee(iteratee,3))}function forEachRight(collection,iteratee){var func=isArray(collection)?arrayEachRight:baseEachRight;return func(collection,getIteratee(iteratee,3))}function includes(collection,value,fromIndex,guard){collection=isArrayLike(collection)?collection:values(collection),fromIndex=fromIndex&&!guard?toInteger(fromIndex):0;var length=collection.length;return 0>fromIndex&&(fromIndex=nativeMax(length+fromIndex,0)),isString(collection)?length>=fromIndex&&collection.indexOf(value,fromIndex)>-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1}function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,getIteratee(iteratee,3))}function orderBy(collection,iteratees,orders,guard){return null==collection?[]:(isArray(iteratees)||(iteratees=null==iteratees?[]:[iteratees]),orders=guard?undefined:orders,isArray(orders)||(orders=null==orders?[]:[orders]),baseOrderBy(collection,iteratees,orders))}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEach)}function reduceRight(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduceRight:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEachRight)}function reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(getIteratee(predicate,3)))}function sample(collection){var func=isArray(collection)?arraySample:baseSample;return func(collection)}function sampleSize(collection,n,guard){n=(guard?isIterateeCall(collection,n,guard):n===undefined)?1:toInteger(n);var func=isArray(collection)?arraySampleSize:baseSampleSize;return func(collection,n)}function shuffle(collection){var func=isArray(collection)?arrayShuffle:baseShuffle;return func(collection)}function size(collection){if(null==collection)return 0;if(isArrayLike(collection))return isString(collection)?stringSize(collection):collection.length;var tag=getTag(collection);return tag==mapTag||tag==setTag?collection.size:baseKeys(collection).length}function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,getIteratee(predicate,3))}function after(n,func){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){return--n<1?func.apply(this,arguments):void 0}}function ary(func,n,guard){return n=guard?undefined:n,n=func&&null==n?func.length:n,createWrap(func,ARY_FLAG,undefined,undefined,undefined,undefined,n)}function before(n,func){var result;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){return--n>0&&(result=func.apply(this,arguments)),1>=n&&(func=undefined),result}}function curry(func,arity,guard){arity=guard?undefined:arity;var result=createWrap(func,CURRY_FLAG,undefined,undefined,undefined,undefined,undefined,arity);return result.placeholder=curry.placeholder,result}function curryRight(func,arity,guard){arity=guard?undefined:arity;var result=createWrap(func,CURRY_RIGHT_FLAG,undefined,undefined,undefined,undefined,undefined,arity);return result.placeholder=curryRight.placeholder,result}function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=undefined,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,result=wait-timeSinceLastCall;return maxing?nativeMin(result,maxWait-timeSinceLastInvoke):result}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return lastCallTime===undefined||timeSinceLastCall>=wait||0>timeSinceLastCall||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();return shouldInvoke(time)?trailingEdge(time):void(timerId=setTimeout(timerExpired,remainingWait(time)))}function trailingEdge(time){return timerId=undefined,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=undefined,result)}function cancel(){timerId!==undefined&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=undefined}function flush(){return timerId===undefined?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(timerId===undefined)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return timerId===undefined&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function flip(func){return createWrap(func,FLIP_FLAG)}function memoize(func,resolver){if("function"!=typeof func||resolver&&"function"!=typeof resolver)throw new TypeError(FUNC_ERROR_TEXT);var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache),memoized}function negate(predicate){if("function"!=typeof predicate)throw new TypeError(FUNC_ERROR_TEXT);return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2])}return!predicate.apply(this,args)}}function once(func){return before(2,func)}function rest(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=start===undefined?start:toInteger(start),baseRest(func,start)}function spread(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=start===undefined?0:nativeMax(toInteger(start),0),baseRest(function(args){var array=args[start],otherArgs=castSlice(args,0,start);return array&&arrayPush(otherArgs,array),apply(func,this,otherArgs)})}function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})}function unary(func){return ary(func,1)}function wrap(value,wrapper){return wrapper=null==wrapper?identity:wrapper,partial(wrapper,value)}function castArray(){if(!arguments.length)return[];var value=arguments[0];return isArray(value)?value:[value]}function clone(value){return baseClone(value,!1,!0)}function cloneWith(value,customizer){return baseClone(value,!1,!0,customizer)}function cloneDeep(value){return baseClone(value,!0,!0)}function cloneDeepWith(value,customizer){return baseClone(value,!0,!0,customizer)}function conformsTo(object,source){return null==source||baseConformsTo(object,source,keys(source))}function eq(value,other){return value===other||value!==value&&other!==other}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isBoolean(value){return value===!0||value===!1||isObjectLike(value)&&objectToString.call(value)==boolTag}function isElement(value){return null!=value&&1===value.nodeType&&isObjectLike(value)&&!isPlainObject(value)}function isEmpty(value){if(isArrayLike(value)&&(isArray(value)||"string"==typeof value||"function"==typeof value.splice||isBuffer(value)||isTypedArray(value)||isArguments(value)))return!value.length;var tag=getTag(value);if(tag==mapTag||tag==setTag)return!value.size;if(isPrototype(value))return!baseKeys(value).length;for(var key in value)if(hasOwnProperty.call(value,key))return!1;return!0}function isEqual(value,other){return baseIsEqual(value,other)}function isEqualWith(value,other,customizer){customizer="function"==typeof customizer?customizer:undefined;var result=customizer?customizer(value,other):undefined;return result===undefined?baseIsEqual(value,other,customizer):!!result}function isError(value){return isObjectLike(value)?objectToString.call(value)==errorTag||"string"==typeof value.message&&"string"==typeof value.name:!1}function isFinite(value){return"number"==typeof value&&nativeIsFinite(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag||tag==proxyTag}function isInteger(value){return"number"==typeof value&&value==toInteger(value)}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&MAX_SAFE_INTEGER>=value}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isObjectLike(value){return null!=value&&"object"==typeof value}function isMatch(object,source){return object===source||baseIsMatch(object,source,getMatchData(source))}function isMatchWith(object,source,customizer){return customizer="function"==typeof customizer?customizer:undefined,baseIsMatch(object,source,getMatchData(source),customizer)}function isNaN(value){return isNumber(value)&&value!=+value}function isNative(value){if(isMaskable(value))throw new Error(CORE_ERROR_TEXT);return baseIsNative(value)}function isNull(value){return null===value}function isNil(value){return null==value}function isNumber(value){return"number"==typeof value||isObjectLike(value)&&objectToString.call(value)==numberTag}function isPlainObject(value){if(!isObjectLike(value)||objectToString.call(value)!=objectTag)return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}function isSafeInteger(value){return isInteger(value)&&value>=-MAX_SAFE_INTEGER&&MAX_SAFE_INTEGER>=value}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&objectToString.call(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function isUndefined(value){return value===undefined}function isWeakMap(value){return isObjectLike(value)&&getTag(value)==weakMapTag}function isWeakSet(value){return isObjectLike(value)&&objectToString.call(value)==weakSetTag}function toArray(value){if(!value)return[];if(isArrayLike(value))return isString(value)?stringToArray(value):copyArray(value);if(iteratorSymbol&&value[iteratorSymbol])return iteratorToArray(value[iteratorSymbol]());var tag=getTag(value),func=tag==mapTag?mapToArray:tag==setTag?setToArray:values;return func(value)}function toFinite(value){if(!value)return 0===value?value:0;if(value=toNumber(value),value===INFINITY||value===-INFINITY){var sign=0>value?-1:1;return sign*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toLength(value){return value?baseClamp(toInteger(value),0,MAX_ARRAY_LENGTH):0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toPlainObject(value){return copyObject(value,keysIn(value))}function toSafeInteger(value){return baseClamp(toInteger(value),-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER)}function toString(value){return null==value?"":baseToString(value)}function create(prototype,properties){var result=baseCreate(prototype);return properties?baseAssign(result,properties):result}function findKey(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwn)}function findLastKey(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwnRight)}function forIn(object,iteratee){return null==object?object:baseFor(object,getIteratee(iteratee,3),keysIn)}function forInRight(object,iteratee){return null==object?object:baseForRight(object,getIteratee(iteratee,3),keysIn)}function forOwn(object,iteratee){return object&&baseForOwn(object,getIteratee(iteratee,3))}function forOwnRight(object,iteratee){return object&&baseForOwnRight(object,getIteratee(iteratee,3))}function functions(object){return null==object?[]:baseFunctions(object,keys(object))}function functionsIn(object){return null==object?[]:baseFunctions(object,keysIn(object))}function get(object,path,defaultValue){var result=null==object?undefined:baseGet(object,path);return result===undefined?defaultValue:result}function has(object,path){return null!=object&&hasPath(object,path,baseHas)}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}function mapKeys(object,iteratee){var result={};return iteratee=getIteratee(iteratee,3),
baseForOwn(object,function(value,key,object){baseAssignValue(result,iteratee(value,key,object),value)}),result}function mapValues(object,iteratee){var result={};return iteratee=getIteratee(iteratee,3),baseForOwn(object,function(value,key,object){baseAssignValue(result,key,iteratee(value,key,object))}),result}function omitBy(object,predicate){return pickBy(object,negate(getIteratee(predicate)))}function pickBy(object,predicate){return null==object?{}:basePickBy(object,getAllKeysIn(object),getIteratee(predicate))}function result(object,path,defaultValue){path=isKey(path,object)?[path]:castPath(path);var index=-1,length=path.length;for(length||(object=undefined,length=1);++index<length;){var value=null==object?undefined:object[toKey(path[index])];value===undefined&&(index=length,value=defaultValue),object=isFunction(value)?value.call(object):value}return object}function set(object,path,value){return null==object?object:baseSet(object,path,value)}function setWith(object,path,value,customizer){return customizer="function"==typeof customizer?customizer:undefined,null==object?object:baseSet(object,path,value,customizer)}function transform(object,iteratee,accumulator){var isArr=isArray(object),isArrLike=isArr||isBuffer(object)||isTypedArray(object);if(iteratee=getIteratee(iteratee,4),null==accumulator){var Ctor=object&&object.constructor;accumulator=isArrLike?isArr?new Ctor:[]:isObject(object)&&isFunction(Ctor)?baseCreate(getPrototype(object)):{}}return(isArrLike?arrayEach:baseForOwn)(object,function(value,index,object){return iteratee(accumulator,value,index,object)}),accumulator}function unset(object,path){return null==object?!0:baseUnset(object,path)}function update(object,path,updater){return null==object?object:baseUpdate(object,path,castFunction(updater))}function updateWith(object,path,updater,customizer){return customizer="function"==typeof customizer?customizer:undefined,null==object?object:baseUpdate(object,path,castFunction(updater),customizer)}function values(object){return object?baseValues(object,keys(object)):[]}function valuesIn(object){return null==object?[]:baseValues(object,keysIn(object))}function clamp(number,lower,upper){return upper===undefined&&(upper=lower,lower=undefined),upper!==undefined&&(upper=toNumber(upper),upper=upper===upper?upper:0),lower!==undefined&&(lower=toNumber(lower),lower=lower===lower?lower:0),baseClamp(toNumber(number),lower,upper)}function inRange(number,start,end){return start=toFinite(start),end===undefined?(end=start,start=0):end=toFinite(end),number=toNumber(number),baseInRange(number,start,end)}function random(lower,upper,floating){if(floating&&"boolean"!=typeof floating&&isIterateeCall(lower,upper,floating)&&(upper=floating=undefined),floating===undefined&&("boolean"==typeof upper?(floating=upper,upper=undefined):"boolean"==typeof lower&&(floating=lower,lower=undefined)),lower===undefined&&upper===undefined?(lower=0,upper=1):(lower=toFinite(lower),upper===undefined?(upper=lower,lower=0):upper=toFinite(upper)),lower>upper){var temp=lower;lower=upper,upper=temp}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat("1e-"+((rand+"").length-1))),upper)}return baseRandom(lower,upper)}function capitalize(string){return upperFirst(toString(string).toLowerCase())}function deburr(string){return string=toString(string),string&&string.replace(reLatin,deburrLetter).replace(reComboMark,"")}function endsWith(string,target,position){string=toString(string),target=baseToString(target);var length=string.length;position=position===undefined?length:baseClamp(toInteger(position),0,length);var end=position;return position-=target.length,position>=0&&string.slice(position,end)==target}function escape(string){return string=toString(string),string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string}function escapeRegExp(string){return string=toString(string),string&&reHasRegExpChar.test(string)?string.replace(reRegExpChar,"\\$&"):string}function pad(string,length,chars){string=toString(string),length=toInteger(length);var strLength=length?stringSize(string):0;if(!length||strLength>=length)return string;var mid=(length-strLength)/2;return createPadding(nativeFloor(mid),chars)+string+createPadding(nativeCeil(mid),chars)}function padEnd(string,length,chars){string=toString(string),length=toInteger(length);var strLength=length?stringSize(string):0;return length&&length>strLength?string+createPadding(length-strLength,chars):string}function padStart(string,length,chars){string=toString(string),length=toInteger(length);var strLength=length?stringSize(string):0;return length&&length>strLength?createPadding(length-strLength,chars)+string:string}function parseInt(string,radix,guard){return guard||null==radix?radix=0:radix&&(radix=+radix),nativeParseInt(toString(string).replace(reTrimStart,""),radix||0)}function repeat(string,n,guard){return n=(guard?isIterateeCall(string,n,guard):n===undefined)?1:toInteger(n),baseRepeat(toString(string),n)}function replace(){var args=arguments,string=toString(args[0]);return args.length<3?string:string.replace(args[1],args[2])}function split(string,separator,limit){return limit&&"number"!=typeof limit&&isIterateeCall(string,separator,limit)&&(separator=limit=undefined),(limit=limit===undefined?MAX_ARRAY_LENGTH:limit>>>0)?(string=toString(string),string&&("string"==typeof separator||null!=separator&&!isRegExp(separator))&&(separator=baseToString(separator),!separator&&hasUnicode(string))?castSlice(stringToArray(string),0,limit):string.split(separator,limit)):[]}function startsWith(string,target,position){return string=toString(string),position=baseClamp(toInteger(position),0,string.length),target=baseToString(target),string.slice(position,position+target.length)==target}function template(string,options,guard){var settings=lodash.templateSettings;guard&&isIterateeCall(string,options,guard)&&(options=undefined),string=toString(string),options=assignInWith({},options,settings,assignInDefaults);var isEscaping,isEvaluating,imports=assignInWith({},options.imports,settings.imports,assignInDefaults),importsKeys=keys(imports),importsValues=baseValues(imports,importsKeys),index=0,interpolate=options.interpolate||reNoMatch,source="__p += '",reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g"),sourceURL="//# sourceURL="+("sourceURL"in options?options.sourceURL:"lodash.templateSources["+ ++templateCounter+"]")+"\n";string.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){return interpolateValue||(interpolateValue=esTemplateValue),source+=string.slice(index,offset).replace(reUnescapedString,escapeStringChar),escapeValue&&(isEscaping=!0,source+="' +\n__e("+escapeValue+") +\n'"),evaluateValue&&(isEvaluating=!0,source+="';\n"+evaluateValue+";\n__p += '"),interpolateValue&&(source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"),index=offset+match.length,match}),source+="';\n";var variable=options.variable;variable||(source="with (obj) {\n"+source+"\n}\n"),source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;"),source="function("+(variable||"obj")+") {\n"+(variable?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(isEscaping?", __e = _.escape":"")+(isEvaluating?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var result=attempt(function(){return Function(importsKeys,sourceURL+"return "+source).apply(undefined,importsValues)});if(result.source=source,isError(result))throw result;return result}function toLower(value){return toString(value).toLowerCase()}function toUpper(value){return toString(value).toUpperCase()}function trim(string,chars,guard){if(string=toString(string),string&&(guard||chars===undefined))return string.replace(reTrim,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars),start=charsStartIndex(strSymbols,chrSymbols),end=charsEndIndex(strSymbols,chrSymbols)+1;return castSlice(strSymbols,start,end).join("")}function trimEnd(string,chars,guard){if(string=toString(string),string&&(guard||chars===undefined))return string.replace(reTrimEnd,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),end=charsEndIndex(strSymbols,stringToArray(chars))+1;return castSlice(strSymbols,0,end).join("")}function trimStart(string,chars,guard){if(string=toString(string),string&&(guard||chars===undefined))return string.replace(reTrimStart,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),start=charsStartIndex(strSymbols,stringToArray(chars));return castSlice(strSymbols,start).join("")}function truncate(string,options){var length=DEFAULT_TRUNC_LENGTH,omission=DEFAULT_TRUNC_OMISSION;if(isObject(options)){var separator="separator"in options?options.separator:separator;length="length"in options?toInteger(options.length):length,omission="omission"in options?baseToString(options.omission):omission}string=toString(string);var strLength=string.length;if(hasUnicode(string)){var strSymbols=stringToArray(string);strLength=strSymbols.length}if(length>=strLength)return string;var end=length-stringSize(omission);if(1>end)return omission;var result=strSymbols?castSlice(strSymbols,0,end).join(""):string.slice(0,end);if(separator===undefined)return result+omission;if(strSymbols&&(end+=result.length-end),isRegExp(separator)){if(string.slice(end).search(separator)){var match,substring=result;for(separator.global||(separator=RegExp(separator.source,toString(reFlags.exec(separator))+"g")),separator.lastIndex=0;match=separator.exec(substring);)var newEnd=match.index;result=result.slice(0,newEnd===undefined?end:newEnd)}}else if(string.indexOf(baseToString(separator),end)!=end){var index=result.lastIndexOf(separator);index>-1&&(result=result.slice(0,index))}return result+omission}function unescape(string){return string=toString(string),string&&reHasEscapedHtml.test(string)?string.replace(reEscapedHtml,unescapeHtmlChar):string}function words(string,pattern,guard){return string=toString(string),pattern=guard?undefined:pattern,pattern===undefined?hasUnicodeWord(string)?unicodeWords(string):asciiWords(string):string.match(pattern)||[]}function cond(pairs){var length=pairs?pairs.length:0,toIteratee=getIteratee();return pairs=length?arrayMap(pairs,function(pair){if("function"!=typeof pair[1])throw new TypeError(FUNC_ERROR_TEXT);return[toIteratee(pair[0]),pair[1]]}):[],baseRest(function(args){for(var index=-1;++index<length;){var pair=pairs[index];if(apply(pair[0],this,args))return apply(pair[1],this,args)}})}function conforms(source){return baseConforms(baseClone(source,!0))}function constant(value){return function(){return value}}function defaultTo(value,defaultValue){return null==value||value!==value?defaultValue:value}function identity(value){return value}function iteratee(func){return baseIteratee("function"==typeof func?func:baseClone(func,!0))}function matches(source){return baseMatches(baseClone(source,!0))}function matchesProperty(path,srcValue){return baseMatchesProperty(path,baseClone(srcValue,!0))}function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);null!=options||isObject(source)&&(methodNames.length||!props.length)||(options=source,source=object,object=this,methodNames=baseFunctions(source,keys(source)));var chain=!(isObject(options)&&"chain"in options&&!options.chain),isFunc=isFunction(object);return arrayEach(methodNames,function(methodName){var func=source[methodName];object[methodName]=func,isFunc&&(object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);return actions.push({func:func,args:arguments,thisArg:object}),result.__chain__=chainAll,result}return func.apply(object,arrayPush([this.value()],arguments))})}),object}function noConflict(){return root._===this&&(root._=oldDash),this}function noop(){}function nthArg(n){return n=toInteger(n),baseRest(function(args){return baseNth(args,n)})}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}function propertyOf(object){return function(path){return null==object?undefined:baseGet(object,path)}}function stubArray(){return[]}function stubFalse(){return!1}function stubObject(){return{}}function stubString(){return""}function stubTrue(){return!0}function times(n,iteratee){if(n=toInteger(n),1>n||n>MAX_SAFE_INTEGER)return[];var index=MAX_ARRAY_LENGTH,length=nativeMin(n,MAX_ARRAY_LENGTH);iteratee=getIteratee(iteratee),n-=MAX_ARRAY_LENGTH;for(var result=baseTimes(length,iteratee);++index<n;)iteratee(index);return result}function toPath(value){return isArray(value)?arrayMap(value,toKey):isSymbol(value)?[value]:copyArray(stringToPath(value))}function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id}function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined}function maxBy(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseGt):undefined}function mean(array){return baseMean(array,identity)}function meanBy(array,iteratee){return baseMean(array,getIteratee(iteratee,2))}function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined}function minBy(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseLt):undefined}function sum(array){return array&&array.length?baseSum(array,identity):0}function sumBy(array,iteratee){return array&&array.length?baseSum(array,getIteratee(iteratee,2)):0}context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Date=context.Date,Error=context.Error,Function=context.Function,Math=context.Math,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=context["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,idCounter=0,objectCtorString=funcToString.call(Object),objectToString=objectProto.toString,oldDash=root._,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?context.Buffer:undefined,Symbol=context.Symbol,Uint8Array=context.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:undefined,getPrototype=overArg(Object.getPrototypeOf,Object),iteratorSymbol=Symbol?Symbol.iterator:undefined,objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:undefined,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),ctxClearTimeout=context.clearTimeout!==root.clearTimeout&&context.clearTimeout,ctxNow=Date&&Date.now!==root.Date.now&&Date.now,ctxSetTimeout=context.setTimeout!==root.setTimeout&&context.setTimeout,nativeCeil=Math.ceil,nativeFloor=Math.floor,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeIsFinite=context.isFinite,nativeJoin=arrayProto.join,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max,nativeMin=Math.min,nativeNow=Date.now,nativeParseInt=context.parseInt,nativeRandom=Math.random,nativeReverse=arrayProto.reverse,DataView=getNative(context,"DataView"),Map=getNative(context,"Map"),Promise=getNative(context,"Promise"),Set=getNative(context,"Set"),WeakMap=getNative(context,"WeakMap"),nativeCreate=getNative(Object,"create"),metaMap=WeakMap&&new WeakMap,realNames={},dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined,symbolToString=symbolProto?symbolProto.toString:undefined,baseCreate=function(){function object(){}return function(proto){if(!isObject(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=undefined,result}}();lodash.templateSettings={escape:reEscape,evaluate:reEvaluate,interpolate:reInterpolate,variable:"",imports:{_:lodash}},lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=baseCreate(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=baseCreate(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=hashClear,Hash.prototype["delete"]=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype["delete"]=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype["delete"]=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype["delete"]=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=createBaseEach(baseForOwn),baseEachRight=createBaseEach(baseForOwnRight,!0),baseFor=createBaseFor(),baseForRight=createBaseFor(!0),baseSetData=metaMap?function(func,data){return metaMap.set(func,data),func}:identity,baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity,castRest=baseRest,clearTimeout=ctxClearTimeout||function(id){return root.clearTimeout(id)},createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getData=metaMap?function(func){return metaMap.get(func)}:noop,getSymbols=nativeGetSymbols?overArg(nativeGetSymbols,Object):stubArray,getSymbolsIn=nativeGetSymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):undefined;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});var isMaskable=coreJsData?isFunction:stubFalse,setData=shortOut(baseSetData),setTimeout=ctxSetTimeout||function(func,wait){return root.setTimeout(func,wait)},setToString=shortOut(baseSetToString),stringToPath=memoizeCapped(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(rePropName,function(match,number,quote,string){result.push(quote?string.replace(reEscapeChar,"$1"):number||match)}),result}),difference=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0)):[]}),differenceBy=baseRest(function(array,values){var iteratee=last(values);return isArrayLikeObject(iteratee)&&(iteratee=undefined),isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0),getIteratee(iteratee,2)):[]}),differenceWith=baseRest(function(array,values){var comparator=last(values);return isArrayLikeObject(comparator)&&(comparator=undefined),isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0),undefined,comparator):[]}),intersection=baseRest(function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[]}),intersectionBy=baseRest(function(arrays){var iteratee=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);return iteratee===last(mapped)?iteratee=undefined:mapped.pop(),mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,getIteratee(iteratee,2)):[]}),intersectionWith=baseRest(function(arrays){var comparator=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);return comparator===last(mapped)?comparator=undefined:mapped.pop(),mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,undefined,comparator):[]}),pull=baseRest(pullAll),pullAt=flatRest(function(array,indexes){var length=array?array.length:0,result=baseAt(array,indexes);return basePullAt(array,arrayMap(indexes,function(index){return isIndex(index,length)?+index:index}).sort(compareAscending)),result}),union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))}),unionBy=baseRest(function(arrays){var iteratee=last(arrays);return isArrayLikeObject(iteratee)&&(iteratee=undefined),baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0),getIteratee(iteratee,2))}),unionWith=baseRest(function(arrays){var comparator=last(arrays);return isArrayLikeObject(comparator)&&(comparator=undefined),baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0),undefined,comparator)}),without=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[]}),xor=baseRest(function(arrays){return baseXor(arrayFilter(arrays,isArrayLikeObject))}),xorBy=baseRest(function(arrays){var iteratee=last(arrays);return isArrayLikeObject(iteratee)&&(iteratee=undefined),baseXor(arrayFilter(arrays,isArrayLikeObject),getIteratee(iteratee,2))}),xorWith=baseRest(function(arrays){var comparator=last(arrays);return isArrayLikeObject(comparator)&&(comparator=undefined),baseXor(arrayFilter(arrays,isArrayLikeObject),undefined,comparator)}),zip=baseRest(unzip),zipWith=baseRest(function(arrays){var length=arrays.length,iteratee=length>1?arrays[length-1]:undefined;return iteratee="function"==typeof iteratee?(arrays.pop(),iteratee):undefined,unzipWith(arrays,iteratee)}),wrapperAt=flatRest(function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function(object){return baseAt(object,paths)};return!(length>1||this.__actions__.length)&&value instanceof LazyWrapper&&isIndex(start)?(value=value.slice(start,+start+(length?1:0)),value.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(value,this.__chain__).thru(function(array){return length&&!array.length&&array.push(undefined),array})):this.thru(interceptor)}),countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:baseAssignValue(result,key,1)}),find=createFind(findIndex),findLast=createFind(findLastIndex),groupBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key].push(value):baseAssignValue(result,key,[value])}),invokeMap=baseRest(function(collection,path,args){var index=-1,isFunc="function"==typeof path,isProp=isKey(path),result=isArrayLike(collection)?Array(collection.length):[];return baseEach(collection,function(value){var func=isFunc?path:isProp&&null!=value?value[path]:undefined;result[++index]=func?apply(func,value,args):baseInvoke(value,path,args)}),result}),keyBy=createAggregator(function(result,value,key){baseAssignValue(result,key,value)}),partition=createAggregator(function(result,value,key){result[key?0:1].push(value)},function(){return[[],[]]}),sortBy=baseRest(function(collection,iteratees){if(null==collection)return[];var length=iteratees.length;return length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])}),now=ctxNow||function(){return root.Date.now()},bind=baseRest(function(func,thisArg,partials){var bitmask=BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=PARTIAL_FLAG}return createWrap(func,bitmask,thisArg,partials,holders)}),bindKey=baseRest(function(object,key,partials){var bitmask=BIND_FLAG|BIND_KEY_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bindKey));bitmask|=PARTIAL_FLAG}return createWrap(key,bitmask,object,partials,holders)}),defer=baseRest(function(func,args){return baseDelay(func,1,args)}),delay=baseRest(function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args)});memoize.Cache=MapCache;var overArgs=castRest(function(func,transforms){transforms=1==transforms.length&&isArray(transforms[0])?arrayMap(transforms[0],baseUnary(getIteratee())):arrayMap(baseFlatten(transforms,1),baseUnary(getIteratee()));var funcsLength=transforms.length;return baseRest(function(args){for(var index=-1,length=nativeMin(args.length,funcsLength);++index<length;)args[index]=transforms[index].call(this,args[index]);return apply(func,this,args)})}),partial=baseRest(function(func,partials){var holders=replaceHolders(partials,getHolder(partial));return createWrap(func,PARTIAL_FLAG,undefined,partials,holders)}),partialRight=baseRest(function(func,partials){var holders=replaceHolders(partials,getHolder(partialRight));return createWrap(func,PARTIAL_RIGHT_FLAG,undefined,partials,holders)}),rearg=flatRest(function(func,indexes){return createWrap(func,REARG_FLAG,undefined,undefined,undefined,indexes)}),gt=createRelationalOperation(baseGt),gte=createRelationalOperation(function(value,other){return value>=other}),isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,isArrayBuffer=nodeIsArrayBuffer?baseUnary(nodeIsArrayBuffer):baseIsArrayBuffer,isBuffer=nativeIsBuffer||stubFalse,isDate=nodeIsDate?baseUnary(nodeIsDate):baseIsDate,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,lt=createRelationalOperation(baseLt),lte=createRelationalOperation(function(value,other){return other>=value}),assign=createAssigner(function(object,source){if(isPrototype(source)||isArrayLike(source))return void copyObject(source,keys(source),object);for(var key in source)hasOwnProperty.call(source,key)&&assignValue(object,key,source[key])}),assignIn=createAssigner(function(object,source){copyObject(source,keysIn(source),object)}),assignInWith=createAssigner(function(object,source,srcIndex,customizer){copyObject(source,keysIn(source),object,customizer)}),assignWith=createAssigner(function(object,source,srcIndex,customizer){copyObject(source,keys(source),object,customizer)}),at=flatRest(baseAt),defaults=baseRest(function(args){return args.push(undefined,assignInDefaults),apply(assignInWith,undefined,args)}),defaultsDeep=baseRest(function(args){return args.push(undefined,mergeDefaults),apply(mergeWith,undefined,args)}),invert=createInverter(function(result,value,key){result[value]=key},constant(identity)),invertBy=createInverter(function(result,value,key){hasOwnProperty.call(result,value)?result[value].push(key):result[value]=[key]},getIteratee),invoke=baseRest(baseInvoke),merge=createAssigner(function(object,source,srcIndex){baseMerge(object,source,srcIndex)}),mergeWith=createAssigner(function(object,source,srcIndex,customizer){baseMerge(object,source,srcIndex,customizer)}),omit=flatRest(function(object,props){return null==object?{}:(props=arrayMap(props,toKey),basePick(object,baseDifference(getAllKeysIn(object),props)))}),pick=flatRest(function(object,props){return null==object?{}:basePick(object,arrayMap(props,toKey))}),toPairs=createToPairs(keys),toPairsIn=createToPairs(keysIn),camelCase=createCompounder(function(result,word,index){return word=word.toLowerCase(),result+(index?capitalize(word):word)}),kebabCase=createCompounder(function(result,word,index){return result+(index?"-":"")+word.toLowerCase()}),lowerCase=createCompounder(function(result,word,index){return result+(index?" ":"")+word.toLowerCase()}),lowerFirst=createCaseFirst("toLowerCase"),snakeCase=createCompounder(function(result,word,index){return result+(index?"_":"")+word.toLowerCase()}),startCase=createCompounder(function(result,word,index){return result+(index?" ":"")+upperFirst(word)}),upperCase=createCompounder(function(result,word,index){return result+(index?" ":"")+word.toUpperCase()}),upperFirst=createCaseFirst("toUpperCase"),attempt=baseRest(function(func,args){try{return apply(func,undefined,args)}catch(e){return isError(e)?e:new Error(e)}}),bindAll=flatRest(function(object,methodNames){return arrayEach(methodNames,function(key){key=toKey(key),baseAssignValue(object,key,bind(object[key],object))}),object}),flow=createFlow(),flowRight=createFlow(!0),method=baseRest(function(path,args){return function(object){return baseInvoke(object,path,args)}}),methodOf=baseRest(function(object,args){return function(path){return baseInvoke(object,path,args)}}),over=createOver(arrayMap),overEvery=createOver(arrayEvery),overSome=createOver(arraySome),range=createRange(),rangeRight=createRange(!0),add=createMathOperation(function(augend,addend){return augend+addend},0),ceil=createRound("ceil"),divide=createMathOperation(function(dividend,divisor){return dividend/divisor},1),floor=createRound("floor"),multiply=createMathOperation(function(multiplier,multiplicand){return multiplier*multiplicand},1),round=createRound("round"),subtract=createMathOperation(function(minuend,subtrahend){return minuend-subtrahend},0);return lodash.after=after,lodash.ary=ary,lodash.assign=assign,lodash.assignIn=assignIn,lodash.assignInWith=assignInWith,lodash.assignWith=assignWith,lodash.at=at,lodash.before=before,lodash.bind=bind,lodash.bindAll=bindAll,lodash.bindKey=bindKey,lodash.castArray=castArray,lodash.chain=chain,lodash.chunk=chunk,lodash.compact=compact,lodash.concat=concat,lodash.cond=cond,lodash.conforms=conforms,lodash.constant=constant,lodash.countBy=countBy,lodash.create=create,lodash.curry=curry,lodash.curryRight=curryRight,lodash.debounce=debounce,lodash.defaults=defaults,lodash.defaultsDeep=defaultsDeep,lodash.defer=defer,lodash.delay=delay,lodash.difference=difference,lodash.differenceBy=differenceBy,lodash.differenceWith=differenceWith,lodash.drop=drop,lodash.dropRight=dropRight,lodash.dropRightWhile=dropRightWhile,lodash.dropWhile=dropWhile,lodash.fill=fill,lodash.filter=filter,lodash.flatMap=flatMap,lodash.flatMapDeep=flatMapDeep,lodash.flatMapDepth=flatMapDepth,lodash.flatten=flatten,lodash.flattenDeep=flattenDeep,lodash.flattenDepth=flattenDepth,lodash.flip=flip,lodash.flow=flow,lodash.flowRight=flowRight,lodash.fromPairs=fromPairs,lodash.functions=functions,lodash.functionsIn=functionsIn,lodash.groupBy=groupBy,lodash.initial=initial,lodash.intersection=intersection,lodash.intersectionBy=intersectionBy,lodash.intersectionWith=intersectionWith,lodash.invert=invert,lodash.invertBy=invertBy,lodash.invokeMap=invokeMap,lodash.iteratee=iteratee,lodash.keyBy=keyBy,lodash.keys=keys,lodash.keysIn=keysIn,lodash.map=map,lodash.mapKeys=mapKeys,lodash.mapValues=mapValues,lodash.matches=matches,lodash.matchesProperty=matchesProperty,
lodash.memoize=memoize,lodash.merge=merge,lodash.mergeWith=mergeWith,lodash.method=method,lodash.methodOf=methodOf,lodash.mixin=mixin,lodash.negate=negate,lodash.nthArg=nthArg,lodash.omit=omit,lodash.omitBy=omitBy,lodash.once=once,lodash.orderBy=orderBy,lodash.over=over,lodash.overArgs=overArgs,lodash.overEvery=overEvery,lodash.overSome=overSome,lodash.partial=partial,lodash.partialRight=partialRight,lodash.partition=partition,lodash.pick=pick,lodash.pickBy=pickBy,lodash.property=property,lodash.propertyOf=propertyOf,lodash.pull=pull,lodash.pullAll=pullAll,lodash.pullAllBy=pullAllBy,lodash.pullAllWith=pullAllWith,lodash.pullAt=pullAt,lodash.range=range,lodash.rangeRight=rangeRight,lodash.rearg=rearg,lodash.reject=reject,lodash.remove=remove,lodash.rest=rest,lodash.reverse=reverse,lodash.sampleSize=sampleSize,lodash.set=set,lodash.setWith=setWith,lodash.shuffle=shuffle,lodash.slice=slice,lodash.sortBy=sortBy,lodash.sortedUniq=sortedUniq,lodash.sortedUniqBy=sortedUniqBy,lodash.split=split,lodash.spread=spread,lodash.tail=tail,lodash.take=take,lodash.takeRight=takeRight,lodash.takeRightWhile=takeRightWhile,lodash.takeWhile=takeWhile,lodash.tap=tap,lodash.throttle=throttle,lodash.thru=thru,lodash.toArray=toArray,lodash.toPairs=toPairs,lodash.toPairsIn=toPairsIn,lodash.toPath=toPath,lodash.toPlainObject=toPlainObject,lodash.transform=transform,lodash.unary=unary,lodash.union=union,lodash.unionBy=unionBy,lodash.unionWith=unionWith,lodash.uniq=uniq,lodash.uniqBy=uniqBy,lodash.uniqWith=uniqWith,lodash.unset=unset,lodash.unzip=unzip,lodash.unzipWith=unzipWith,lodash.update=update,lodash.updateWith=updateWith,lodash.values=values,lodash.valuesIn=valuesIn,lodash.without=without,lodash.words=words,lodash.wrap=wrap,lodash.xor=xor,lodash.xorBy=xorBy,lodash.xorWith=xorWith,lodash.zip=zip,lodash.zipObject=zipObject,lodash.zipObjectDeep=zipObjectDeep,lodash.zipWith=zipWith,lodash.entries=toPairs,lodash.entriesIn=toPairsIn,lodash.extend=assignIn,lodash.extendWith=assignInWith,mixin(lodash,lodash),lodash.add=add,lodash.attempt=attempt,lodash.camelCase=camelCase,lodash.capitalize=capitalize,lodash.ceil=ceil,lodash.clamp=clamp,lodash.clone=clone,lodash.cloneDeep=cloneDeep,lodash.cloneDeepWith=cloneDeepWith,lodash.cloneWith=cloneWith,lodash.conformsTo=conformsTo,lodash.deburr=deburr,lodash.defaultTo=defaultTo,lodash.divide=divide,lodash.endsWith=endsWith,lodash.eq=eq,lodash.escape=escape,lodash.escapeRegExp=escapeRegExp,lodash.every=every,lodash.find=find,lodash.findIndex=findIndex,lodash.findKey=findKey,lodash.findLast=findLast,lodash.findLastIndex=findLastIndex,lodash.findLastKey=findLastKey,lodash.floor=floor,lodash.forEach=forEach,lodash.forEachRight=forEachRight,lodash.forIn=forIn,lodash.forInRight=forInRight,lodash.forOwn=forOwn,lodash.forOwnRight=forOwnRight,lodash.get=get,lodash.gt=gt,lodash.gte=gte,lodash.has=has,lodash.hasIn=hasIn,lodash.head=head,lodash.identity=identity,lodash.includes=includes,lodash.indexOf=indexOf,lodash.inRange=inRange,lodash.invoke=invoke,lodash.isArguments=isArguments,lodash.isArray=isArray,lodash.isArrayBuffer=isArrayBuffer,lodash.isArrayLike=isArrayLike,lodash.isArrayLikeObject=isArrayLikeObject,lodash.isBoolean=isBoolean,lodash.isBuffer=isBuffer,lodash.isDate=isDate,lodash.isElement=isElement,lodash.isEmpty=isEmpty,lodash.isEqual=isEqual,lodash.isEqualWith=isEqualWith,lodash.isError=isError,lodash.isFinite=isFinite,lodash.isFunction=isFunction,lodash.isInteger=isInteger,lodash.isLength=isLength,lodash.isMap=isMap,lodash.isMatch=isMatch,lodash.isMatchWith=isMatchWith,lodash.isNaN=isNaN,lodash.isNative=isNative,lodash.isNil=isNil,lodash.isNull=isNull,lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isObjectLike=isObjectLike,lodash.isPlainObject=isPlainObject,lodash.isRegExp=isRegExp,lodash.isSafeInteger=isSafeInteger,lodash.isSet=isSet,lodash.isString=isString,lodash.isSymbol=isSymbol,lodash.isTypedArray=isTypedArray,lodash.isUndefined=isUndefined,lodash.isWeakMap=isWeakMap,lodash.isWeakSet=isWeakSet,lodash.join=join,lodash.kebabCase=kebabCase,lodash.last=last,lodash.lastIndexOf=lastIndexOf,lodash.lowerCase=lowerCase,lodash.lowerFirst=lowerFirst,lodash.lt=lt,lodash.lte=lte,lodash.max=max,lodash.maxBy=maxBy,lodash.mean=mean,lodash.meanBy=meanBy,lodash.min=min,lodash.minBy=minBy,lodash.stubArray=stubArray,lodash.stubFalse=stubFalse,lodash.stubObject=stubObject,lodash.stubString=stubString,lodash.stubTrue=stubTrue,lodash.multiply=multiply,lodash.nth=nth,lodash.noConflict=noConflict,lodash.noop=noop,lodash.now=now,lodash.pad=pad,lodash.padEnd=padEnd,lodash.padStart=padStart,lodash.parseInt=parseInt,lodash.random=random,lodash.reduce=reduce,lodash.reduceRight=reduceRight,lodash.repeat=repeat,lodash.replace=replace,lodash.result=result,lodash.round=round,lodash.runInContext=runInContext,lodash.sample=sample,lodash.size=size,lodash.snakeCase=snakeCase,lodash.some=some,lodash.sortedIndex=sortedIndex,lodash.sortedIndexBy=sortedIndexBy,lodash.sortedIndexOf=sortedIndexOf,lodash.sortedLastIndex=sortedLastIndex,lodash.sortedLastIndexBy=sortedLastIndexBy,lodash.sortedLastIndexOf=sortedLastIndexOf,lodash.startCase=startCase,lodash.startsWith=startsWith,lodash.subtract=subtract,lodash.sum=sum,lodash.sumBy=sumBy,lodash.template=template,lodash.times=times,lodash.toFinite=toFinite,lodash.toInteger=toInteger,lodash.toLength=toLength,lodash.toLower=toLower,lodash.toNumber=toNumber,lodash.toSafeInteger=toSafeInteger,lodash.toString=toString,lodash.toUpper=toUpper,lodash.trim=trim,lodash.trimEnd=trimEnd,lodash.trimStart=trimStart,lodash.truncate=truncate,lodash.unescape=unescape,lodash.uniqueId=uniqueId,lodash.upperCase=upperCase,lodash.upperFirst=upperFirst,lodash.each=forEach,lodash.eachRight=forEachRight,lodash.first=head,mixin(lodash,function(){var source={};return baseForOwn(lodash,function(func,methodName){hasOwnProperty.call(lodash.prototype,methodName)||(source[methodName]=func)}),source}(),{chain:!1}),lodash.VERSION=VERSION,arrayEach(["bind","bindKey","curry","curryRight","partial","partialRight"],function(methodName){lodash[methodName].placeholder=lodash}),arrayEach(["drop","take"],function(methodName,index){LazyWrapper.prototype[methodName]=function(n){var filtered=this.__filtered__;if(filtered&&!index)return new LazyWrapper(this);n=n===undefined?1:nativeMax(toInteger(n),0);var result=this.clone();return filtered?result.__takeCount__=nativeMin(n,result.__takeCount__):result.__views__.push({size:nativeMin(n,MAX_ARRAY_LENGTH),type:methodName+(result.__dir__<0?"Right":"")}),result},LazyWrapper.prototype[methodName+"Right"]=function(n){return this.reverse()[methodName](n).reverse()}}),arrayEach(["filter","map","takeWhile"],function(methodName,index){var type=index+1,isFilter=type==LAZY_FILTER_FLAG||type==LAZY_WHILE_FLAG;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();return result.__iteratees__.push({iteratee:getIteratee(iteratee,3),type:type}),result.__filtered__=result.__filtered__||isFilter,result}}),arrayEach(["head","last"],function(methodName,index){var takeName="take"+(index?"Right":"");LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0]}}),arrayEach(["initial","tail"],function(methodName,index){var dropName="drop"+(index?"":"Right");LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1)}}),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head()},LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate)},LazyWrapper.prototype.invokeMap=baseRest(function(path,args){return"function"==typeof path?new LazyWrapper(this):this.map(function(value){return baseInvoke(value,path,args)})}),LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)))},LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;return result.__filtered__&&(start>0||0>end)?new LazyWrapper(result):(0>start?result=result.takeRight(-start):start&&(result=result.drop(start)),end!==undefined&&(end=toInteger(end),result=0>end?result.dropRight(-end):result.take(end-start)),result)},LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH)},baseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?"take"+("last"==methodName?"Right":""):methodName],retUnwrapped=isTaker||/^find/.test(methodName);lodashFunc&&(lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value),interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result};useLazy&&checkIteratee&&"function"==typeof iteratee&&1!=iteratee.length&&(isLazy=useLazy=!1);var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);return result.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(result,chainAll)}return isUnwrapped&&onlyLazy?func.apply(this,args):(result=this.thru(interceptor),isUnwrapped?isTaker?result.value()[0]:result.value():result)})}),arrayEach(["pop","push","shift","sort","splice","unshift"],function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?"tap":"thru",retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args)}return this[chainName](function(value){return func.apply(isArray(value)?value:[],args)})}}),baseForOwn(LazyWrapper.prototype,function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+"",names=realNames[key]||(realNames[key]=[]);names.push({name:methodName,func:lodashFunc})}}),realNames[createHybrid(undefined,BIND_KEY_FLAG).name]=[{name:"wrapper",func:undefined}],LazyWrapper.prototype.clone=lazyClone,LazyWrapper.prototype.reverse=lazyReverse,LazyWrapper.prototype.value=lazyValue,lodash.prototype.at=wrapperAt,lodash.prototype.chain=wrapperChain,lodash.prototype.commit=wrapperCommit,lodash.prototype.next=wrapperNext,lodash.prototype.plant=wrapperPlant,lodash.prototype.reverse=wrapperReverse,lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=wrapperValue,lodash.prototype.first=lodash.prototype.head,iteratorSymbol&&(lodash.prototype[iteratorSymbol]=wrapperToIterator),lodash},_=runInContext();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(root._=_,define(function(){return _})):freeModule?((freeModule.exports=_)._=_,freeExports._=_):root._=_}.call(this);var UsergridAuthMode=Object.freeze({NONE:"none",USER:"user",APP:"app"}),UsergridDirection=Object.freeze({IN:"connecting",OUT:"connections"}),UsergridHttpMethod=Object.freeze({GET:"GET",PUT:"PUT",POST:"POST",DELETE:"DELETE"}),UsergridQueryOperator=Object.freeze({EQUAL:"=",GREATER_THAN:">",GREATER_THAN_EQUAL_TO:">=",LESS_THAN:"<",LESS_THAN_EQUAL_TO:"<="}),UsergridQuerySortOrder=Object.freeze({ASC:"asc",DESC:"desc"}),UsergridApplicationJSONHeaderValue="application/json";!function(global){function UsergridHelpers(){}var name="UsergridHelpers",overwrittenName=global[name];UsergridHelpers.DefaultHeaders=Object.freeze({"Content-Type":UsergridApplicationJSONHeaderValue,Accept:UsergridApplicationJSONHeaderValue}),UsergridHelpers.validateAndRetrieveClient=function(args){var client=_.first([args,args[0],_.get(args,"client"),Usergrid.isInitialized?Usergrid:void 0].filter(function(client){return client instanceof UsergridClient}));if(!client)throw new Error("this method requires either the Usergrid shared instance to be initialized or a UsergridClient instance as the first argument");return client},UsergridHelpers.inherits=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},UsergridHelpers.flattenArgs=function(args){return _.flattenDeep(Array.prototype.slice.call(args))},UsergridHelpers.callback=function(){var args=UsergridHelpers.flattenArgs(arguments).reverse(),emptyFunc=function(){};return _.first(_.flattenDeep([args,_.get(args,"0.callback"),emptyFunc]).filter(_.isFunction))},UsergridHelpers.authForRequests=function(client){var authForRequests=void 0;return _.get(client,"tempAuth.isValid")?(authForRequests=client.tempAuth,client.tempAuth=void 0):_.get(client,"currentUser.auth.isValid")&&client.authMode===UsergridAuthMode.USER?authForRequests=client.currentUser.auth:_.get(client,"appAuth.isValid")&&client.authMode===UsergridAuthMode.APP&&(authForRequests=client.appAuth),authForRequests},UsergridHelpers.userLoginBody=function(options){var body={grant_type:"password",password:options.password};return options.tokenTtl&&(body.ttl=options.tokenTtl),body[options.username?"username":"email"]=options.username?options.username:options.email,body},UsergridHelpers.appLoginBody=function(options){var body={grant_type:"client_credentials",client_id:options.clientId,client_secret:options.clientSecret};return options.tokenTtl&&(body.ttl=options.tokenTtl),body},UsergridHelpers.userResetPasswordBody=function(args){return{oldpassword:_.isPlainObject(args[0])?args[0].oldPassword:_.isString(args[0])?args[0]:void 0,newpassword:_.isPlainObject(args[0])?args[0].newPassword:_.isString(args[1])?args[1]:void 0}},UsergridHelpers.calculateExpiry=function(expires_in){return Date.now()+1e3*(expires_in?expires_in-5:0)};var uuidValueRegex=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;return UsergridHelpers.isUUID=function(uuid){return uuid?uuidValueRegex.test(uuid):!1},UsergridHelpers.useQuotesIfRequired=function(value){return _.isFinite(value)||UsergridHelpers.isUUID(value)||_.isBoolean(value)||_.isObject(value)&&!_.isFunction(value)||_.isArray(value)?value:"'"+value+"'"},UsergridHelpers.setReadOnly=function(obj,key){return _.isArray(key)?key.forEach(function(k){UsergridHelpers.setReadOnly(obj,k)}):_.isPlainObject(obj[key])?Object.freeze(obj[key]):_.isPlainObject(obj)&&void 0===key?Object.freeze(obj):_.has(obj,key)?Object.defineProperty(obj,key,{writable:!1}):obj},UsergridHelpers.setWritable=function(obj,key){return _.isArray(key)?key.forEach(function(k){UsergridHelpers.setWritable(obj,k)}):_.isPlainObject(obj[key])?_.clone(obj[key]):_.isPlainObject(obj)&&void 0===key?_.clone(obj):_.has(obj,key)?Object.defineProperty(obj,key,{writable:!0}):obj},UsergridHelpers.assignPrefabOptions=function(args){return _.isObject(args[0])&&!_.isFunction(args[0])&&_.has(args,"method")&&_.assign(this,args[0]),this},UsergridHelpers.normalize=function(str){return str=str.replace(/\/+/g,"/"),str=str.replace(/:\//g,"://"),str=str.replace(/\/(\?|&|#[^!])/g,"$1"),str=str.replace(/(\?.+)\?/g,"$1&")},UsergridHelpers.urljoin=function(){var input=arguments,options={};"object"==typeof arguments[0]&&(input=arguments[0],options=arguments[1]||{});var joined=[].slice.call(input,0).join("/");return UsergridHelpers.normalize(joined,options)},UsergridHelpers.parseResponseHeaders=function(headerStr){var headers={};if(headerStr)for(var headerPairs=headerStr.split("\r\n"),i=0;i<headerPairs.length;i++){var headerPair=headerPairs[i],index=headerPair.indexOf(": ");if(index>0){var key=headerPair.substring(0,index).toLowerCase();headers[key]=headerPair.substring(index+2)}}return headers},UsergridHelpers.uri=function(client,options){var path="";path=options instanceof UsergridEntity?options.type:options instanceof UsergridQuery?options._type:_.isString(options)?options:_.isArray(options)?_.get(options,"0.type")||_.get(options,"0.path"):options.path||options.type||_.get(options,"entity.type")||_.get(options,"query._type")||_.get(options,"body.type")||_.get(options,"body.path");var uuidOrName="";return options.method!==UsergridHttpMethod.POST&&(uuidOrName=_.first([options.uuidOrName,options.uuid,options.name,_.get(options,"entity.uuid"),_.get(options,"entity.name"),_.get(options,"body.uuid"),_.get(options,"body.name"),""].filter(_.isString))),UsergridHelpers.urljoin(client.baseUrl,client.orgId,client.appId,path,uuidOrName)},UsergridHelpers.updateEntityFromRemote=function(entity,usergridResponse){UsergridHelpers.setWritable(entity,["uuid","name","type","created"]),_.assign(entity,usergridResponse.entity),UsergridHelpers.setReadOnly(entity,["uuid","name","type","created"])},UsergridHelpers.headers=function(client,options,defaultHeaders){var returnHeaders={};_.defaults(returnHeaders,options.headers,defaultHeaders),_.assign(returnHeaders,{"User-Agent":"usergrid-js/v"+UsergridSDKVersion});var authForRequests=UsergridHelpers.authForRequests(client);return authForRequests&&_.assign(returnHeaders,{authorization:"Bearer "+authForRequests.token}),returnHeaders},UsergridHelpers.setEntity=function(options,args){return options.entity=_.first([options.entity,args[0]].filter(function(property){return property instanceof UsergridEntity})),void 0!==options.entity&&(options.type=options.entity.type),options},UsergridHelpers.setAsset=function(options,args){return options.asset=_.first([options.asset,_.get(options,"entity.asset"),args[1],args[0]].filter(function(property){return property instanceof UsergridAsset})),options},UsergridHelpers.setUuidOrName=function(options,args){return options.uuidOrName=_.first([options.uuidOrName,options.uuid,options.name,_.get(options,"entity.uuid"),_.get(options,"body.uuid"),_.get(options,"entity.name"),_.get(options,"body.name"),_.get(args,"0.uuid"),_.get(args,"0.name"),_.get(args,"2"),_.get(args,"1")].filter(_.isString)),options},UsergridHelpers.setPathOrType=function(options,args){var pathOrType=_.first([args.type,_.get(args,"0.type"),_.get(options,"entity.type"),_.get(args,"body.type"),_.get(options,"body.0.type"),_.isArray(args)?args[0]:void 0].filter(_.isString));return options[/\//.test(pathOrType)?"path":"type"]=pathOrType,options},UsergridHelpers.setQs=function(options,args){return options.path&&(options.qs=_.first([options.qs,args[2],args[1],args[0]].filter(_.isPlainObject))),options},UsergridHelpers.setQuery=function(options,args){return options.query=_.first([options,options.query,args[0]].filter(function(property){return property instanceof UsergridQuery})),options},UsergridHelpers.setAsset=function(options,args){return options.asset=_.first([options.asset,_.get(options,"entity.asset"),args[1],args[0]].filter(function(property){return property instanceof UsergridAsset})),options},UsergridHelpers.setBody=function(options,args){var body=_.first([args.entity,args.body,args[0].entity,args[0].body,args[2],args[1],args[0]].filter(function(property){return _.isObject(property)&&!_.isFunction(property)&&!(property instanceof UsergridQuery)&&!(property instanceof UsergridAsset)}));return body instanceof UsergridEntity?body=body.jsonValue():_.isArray(body)&&body[0]instanceof UsergridEntity&&(body=_.map(body,function(entity){return entity.jsonValue()})),options.body=body,options},UsergridHelpers.buildRequest=function(client,method,args){var options={client:client,method:method,queryParams:args.queryParams||_.get(args,"0.queryParams"),callback:UsergridHelpers.callback(args)};if(UsergridHelpers.assignPrefabOptions(options,args),UsergridHelpers.setEntity(options,args),!(method!==UsergridHttpMethod.POST&&method!==UsergridHttpMethod.PUT||(UsergridHelpers.setAsset(options,args),options.asset||(UsergridHelpers.setBody(options,args),options.body))))throw new Error("'body' is required when making a "+options.method+" request");return UsergridHelpers.setUuidOrName(options,args),UsergridHelpers.setPathOrType(options,args),UsergridHelpers.setQs(options,args),UsergridHelpers.setQuery(options,args),options.uri=UsergridHelpers.uri(client,options),new UsergridRequest(options)},UsergridHelpers.buildAppAuthRequest=function(client,auth,callback){var requestOptions={client:client,method:UsergridHttpMethod.POST,uri:UsergridHelpers.uri(client,{path:"token"}),body:UsergridHelpers.appLoginBody(auth),callback:callback};return new UsergridRequest(requestOptions)},UsergridHelpers.buildConnectionRequest=function(client,method,args){var options={client:client,method:method,entity:{},to:{},callback:UsergridHelpers.callback(args)};if(UsergridHelpers.assignPrefabOptions.call(options,args),_.isObject(options.from)&&(options.to=options.from),_.isObject(args[0])&&_.has(args[0],"entity")&&_.has(args[0],"to")&&(_.assign(options.entity,args[0].entity),options.relationship=_.get(args,"0.relationship"),_.assign(options.to,args[0].to)),_.isObject(args[0])&&!_.isFunction(args[0])&&_.isString(args[1])&&(_.assign(options.entity,args[0]),options.relationship=_.first([options.relationship,args[1]].filter(_.isString))),_.isObject(args[2])&&!_.isFunction(args[2])&&_.assign(options.to,args[2]),options.entity.uuidOrName=_.first([options.entity.uuidOrName,options.entity.uuid,options.entity.name,args[1]].filter(_.isString)),options.entity.type||(options.entity.type=_.first([options.entity.type,args[0]].filter(_.isString))),options.relationship=_.first([options.relationship,args[2]].filter(_.isString)),_.isString(args[3])&&!UsergridHelpers.isUUID(args[3])&&_.isString(args[4])?options.to.type=args[3]:_.isString(args[2])&&!UsergridHelpers.isUUID(args[2])&&_.isString(args[3])&&_.isObject(args[0])&&!_.isFunction(args[0])&&(options.to.type=args[2]),options.to.uuidOrName=_.first([options.to.uuidOrName,options.to.uuid,options.to.name,args[4],args[3],args[2]].filter(function(property){return _.isString(options.to.type)&&_.isString(property)||UsergridHelpers.isUUID(property)})),!_.isString(options.entity.uuidOrName))throw new Error("source entity 'uuidOrName' is required when connecting or disconnecting entities");if(!_.isString(options.to.uuidOrName))throw new Error("target entity 'uuidOrName' is required when connecting or disconnecting entities");if(!_.isString(options.to.type)&&!UsergridHelpers.isUUID(options.to.uuidOrName))throw new Error("target 'type' (collection name) parameter is required connecting or disconnecting entities by name");return options.uri=UsergridHelpers.urljoin(client.baseUrl,client.orgId,client.appId,_.isString(options.entity.type)?options.entity.type:"",_.isString(options.entity.uuidOrName)?options.entity.uuidOrName:"",options.relationship,_.isString(options.to.type)?options.to.type:"",_.isString(options.to.uuidOrName)?options.to.uuidOrName:""),new UsergridRequest(options)},UsergridHelpers.buildGetConnectionRequest=function(client,args){var options={client:client,method:"GET",callback:UsergridHelpers.callback(args)};if(UsergridHelpers.assignPrefabOptions.call(options,args),_.isObject(args[1])&&!_.isFunction(args[1])&&_.assign(options,args[1]),options.direction=_.first([options.direction,args[0]].filter(function(property){return property===UsergridDirection.IN||property===UsergridDirection.OUT})),options.relationship=_.first([options.relationship,args[3],args[2]].filter(_.isString)),options.uuidOrName=_.first([options.uuidOrName,options.uuid,options.name,args[2]].filter(_.isString)),options.type=_.first([options.type,args[1]].filter(_.isString)),!_.isString(options.type))throw new Error("'type' (collection name) parameter is required when retrieving connections");if(!_.isString(options.uuidOrName))throw new Error("target entity 'uuidOrName' is required when retrieving connections");return options.uri=UsergridHelpers.urljoin(client.baseUrl,client.orgId,client.appId,_.isString(options.type)?options.type:"",_.isString(options.uuidOrName)?options.uuidOrName:"",options.direction,options.relationship),new UsergridRequest(options)},global[name]=UsergridHelpers,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),UsergridHelpers},global[name]}(this);var UsergridClientDefaultOptions={baseUrl:"https://api.usergrid.com",authMode:UsergridAuthMode.USER},UsergridClient=function(options){var __appAuth,self=this;if(self.tempAuth=void 0,self.isSharedInstance=!1,2===arguments.length&&(self.orgId=arguments[0],self.appId=arguments[1]),_.defaults(self,options,UsergridClientDefaultOptions),!self.orgId||!self.appId)throw new Error("'orgId' and 'appId' parameters are required when instantiating UsergridClient");return Object.defineProperty(self,"clientId",{enumerable:!1}),Object.defineProperty(self,"clientSecret",{enumerable:!1}),Object.defineProperty(self,"appAuth",{get:function(){return __appAuth},set:function(options){options instanceof UsergridAppAuth?__appAuth=options:"undefined"!=typeof options&&(__appAuth=new UsergridAppAuth(options))}}),self.clientId&&self.clientSecret&&self.setAppAuth(self.clientId,self.clientSecret),self};UsergridClient.prototype={sendRequest:function(usergridRequest){return usergridRequest.sendRequest()},GET:function(){var usergridRequest=UsergridHelpers.buildRequest(this,UsergridHttpMethod.GET,UsergridHelpers.flattenArgs(arguments));return this.sendRequest(usergridRequest)},PUT:function(){var usergridRequest=UsergridHelpers.buildRequest(this,UsergridHttpMethod.PUT,UsergridHelpers.flattenArgs(arguments));return this.sendRequest(usergridRequest)},POST:function(){var usergridRequest=UsergridHelpers.buildRequest(this,UsergridHttpMethod.POST,UsergridHelpers.flattenArgs(arguments));return this.sendRequest(usergridRequest)},DELETE:function(){var usergridRequest=UsergridHelpers.buildRequest(this,UsergridHttpMethod.DELETE,UsergridHelpers.flattenArgs(arguments));return this.sendRequest(usergridRequest)},connect:function(){var usergridRequest=UsergridHelpers.buildConnectionRequest(this,UsergridHttpMethod.POST,UsergridHelpers.flattenArgs(arguments));return this.sendRequest(usergridRequest)},disconnect:function(){var usergridRequest=UsergridHelpers.buildConnectionRequest(this,UsergridHttpMethod.DELETE,UsergridHelpers.flattenArgs(arguments));return this.sendRequest(usergridRequest)},getConnections:function(){var usergridRequest=UsergridHelpers.buildGetConnectionRequest(this,UsergridHelpers.flattenArgs(arguments));return this.sendRequest(usergridRequest)},usingAuth:function(auth){var self=this;return _.isString(auth)?self.tempAuth=new UsergridAuth(auth):auth instanceof UsergridAuth?self.tempAuth=auth:self.tempAuth=void 0,self},setAppAuth:function(){this.appAuth=new UsergridAppAuth(UsergridHelpers.flattenArgs(arguments))},authenticateApp:function(options){var self=this,authenticateAppCallback=UsergridHelpers.callback(UsergridHelpers.flattenArgs(arguments)),auth=_.first([options,self.appAuth,new UsergridAppAuth(options),new UsergridAppAuth(self.clientId,self.clientSecret)].filter(function(p){return p instanceof UsergridAppAuth}));if(!(auth instanceof UsergridAppAuth))throw new Error("App auth context was not defined when attempting to call .authenticateApp()");if(!auth.clientId||!auth.clientSecret)throw new Error("authenticateApp() failed because clientId or clientSecret are missing");var callback=function(error,usergridResponse){var token=_.get(usergridResponse.responseJSON,"access_token"),expiresIn=_.get(usergridResponse.responseJSON,"expires_in");usergridResponse.ok&&(self.appAuth||(self.appAuth=auth),self.appAuth.token=token,self.appAuth.expiry=UsergridHelpers.calculateExpiry(expiresIn),self.appAuth.tokenTtl=expiresIn),authenticateAppCallback(error,usergridResponse,token)},usergridRequest=UsergridHelpers.buildAppAuthRequest(self,auth,callback);return self.sendRequest(usergridRequest)},authenticateUser:function(options){var self=this,args=UsergridHelpers.flattenArgs(arguments),callback=UsergridHelpers.callback(args),setAsCurrentUser=void 0!==_.last(args.filter(_.isBoolean))?_.last(args.filter(_.isBoolean)):!0,userToAuthenticate=new UsergridUser(options);userToAuthenticate.login(self,function(error,usergridResponse,token){usergridResponse.ok&&setAsCurrentUser&&(self.currentUser=userToAuthenticate),callback(usergridResponse.error,usergridResponse,token)})},downloadAsset:function(){var self=this,usergridRequest=UsergridHelpers.buildRequest(self,UsergridHttpMethod.GET,UsergridHelpers.flattenArgs(arguments)),assetContentType=_.get(usergridRequest,"entity.file-metadata.content-type");void 0!==assetContentType&&_.assign(usergridRequest.headers,{Accept:assetContentType});var realDownloadAssetCallback=usergridRequest.callback;return usergridRequest.callback=function(error,usergridResponse){var entity=usergridRequest.entity;entity.asset=usergridResponse.asset,realDownloadAssetCallback(error,usergridResponse,entity)},self.sendRequest(usergridRequest)},uploadAsset:function(){var self=this,usergridRequest=UsergridHelpers.buildRequest(self,UsergridHttpMethod.PUT,UsergridHelpers.flattenArgs(arguments));if(void 0===usergridRequest.asset)throw new Error("An UsergridAsset was not defined when attempting to call .uploadAsset()");var realUploadAssetCallback=usergridRequest.callback;return usergridRequest.callback=function(error,usergridResponse){var requestEntity=usergridRequest.entity,responseEntity=usergridResponse.entity,requestAsset=usergridRequest.asset;usergridResponse.ok&&void 0!==responseEntity&&(UsergridHelpers.updateEntityFromRemote(requestEntity,usergridResponse),requestEntity.asset=requestAsset,responseEntity&&(responseEntity.asset=requestAsset)),realUploadAssetCallback(error,usergridResponse,requestEntity)},self.sendRequest(usergridRequest)}};var UsergridSDKVersion="2.0.0",UsergridClientSharedInstance=function(){var self=this;return self.isInitialized=!1,self.isSharedInstance=!0,self};UsergridHelpers.inherits(UsergridClientSharedInstance,UsergridClient);var Usergrid=new UsergridClientSharedInstance;Usergrid.initSharedInstance=function(options){return Usergrid.isInitialized?console.log("Usergrid shared instance is already initialized"):(_.assign(Usergrid,new UsergridClient(options)),Usergrid.isInitialized=!0,Usergrid.isSharedInstance=!0),Usergrid},Usergrid.init=Usergrid.initSharedInstance;var UsergridQuery=function(type){var queryString,sort,self=this,query="",urlTerms={},__nextIsNot=!1;return self._type=type,_.assign(self,{type:function(value){return self._type=value,self},collection:function(value){return self._type=value,self},limit:function(value){return self._limit=value,self},cursor:function(value){return self._cursor=value,self},eq:function(key,value){return query=self.andJoin(key+" "+UsergridQueryOperator.EQUAL+" "+UsergridHelpers.useQuotesIfRequired(value)),self},equal:this.eq,gt:function(key,value){return query=self.andJoin(key+" "+UsergridQueryOperator.GREATER_THAN+" "+UsergridHelpers.useQuotesIfRequired(value)),self},greaterThan:this.gt,gte:function(key,value){return query=self.andJoin(key+" "+UsergridQueryOperator.GREATER_THAN_EQUAL_TO+" "+UsergridHelpers.useQuotesIfRequired(value)),self},greaterThanOrEqual:this.gte,lt:function(key,value){return query=self.andJoin(key+" "+UsergridQueryOperator.LESS_THAN+" "+UsergridHelpers.useQuotesIfRequired(value)),self},lessThan:this.lt,lte:function(key,value){return query=self.andJoin(key+" "+UsergridQueryOperator.LESS_THAN_EQUAL_TO+" "+UsergridHelpers.useQuotesIfRequired(value)),self},lessThanOrEqual:this.lte,contains:function(key,value){return query=self.andJoin(key+" contains "+UsergridHelpers.useQuotesIfRequired(value)),self},locationWithin:function(distanceInMeters,lat,lng){return query=self.andJoin("location within "+distanceInMeters+" of "+lat+", "+lng),self},asc:function(key){return self.sort(key,UsergridQuerySortOrder.ASC),self},desc:function(key){return self.sort(key,UsergridQuerySortOrder.DESC),self},sort:function(key,order){return sort=key&&order?" order by "+key+" "+order:"",self},fromString:function(string){return queryString=string,
self},urlTerm:function(key,value){return"ql"===key?self.fromString():urlTerms[key]=value,self},andJoin:function(append){return __nextIsNot&&(append="not "+append,__nextIsNot=!1),append?0===query.length?append:_.endsWith(query,"and")||_.endsWith(query,"or")?query+" "+append:query+" and "+append:query},orJoin:function(){return query.length>0&&!_.endsWith(query,"or")?query+" or":query}}),Object.defineProperty(self,"_ql",{get:function(){var ql="select * ";return void 0!==queryString?ql=queryString:(ql+=query.length>0?"where "+(query||""):"",ql+=void 0!==sort?sort:""),ql}}),Object.defineProperty(self,"encodedStringValue",{get:function(){var self=this,limit=self._limit,cursor=self._cursor,requirementsString=self._ql,returnString=void 0;if(void 0!==limit&&(returnString="limit"+UsergridQueryOperator.EQUAL+limit),!_.isEmpty(cursor)){var cursorString="cursor"+UsergridQueryOperator.EQUAL+cursor;_.isEmpty(returnString)?returnString=cursorString:returnString+="&"+cursorString}if(_.forEach(urlTerms,function(value,key){var encodedURLTermString=encodeURIComponent(key)+UsergridQueryOperator.EQUAL+encodeURIComponent(value);_.isEmpty(returnString)?returnString=encodedURLTermString:returnString+="&"+encodedURLTermString}),!_.isEmpty(requirementsString)){var qLString="ql="+encodeURIComponent(requirementsString);_.isEmpty(returnString)?returnString=qLString:returnString+="&"+qLString}return _.isEmpty(returnString)||(returnString="?"+returnString),_.isEmpty(returnString)?void 0:returnString}}),Object.defineProperty(self,"and",{get:function(){return query=self.andJoin(""),self}}),Object.defineProperty(self,"or",{get:function(){return query=self.orJoin(),self}}),Object.defineProperty(self,"not",{get:function(){return __nextIsNot=!0,self}}),self},UsergridRequest=function(options){var self=this,client=UsergridHelpers.validateAndRetrieveClient(options);if(!_.isString(options.type)&&!_.isString(options.path)&&!_.isString(options.uri))throw new Error("one of 'type' (collection name), 'path', or 'uri' parameters are required when initializing a UsergridRequest");if(!_.includes(["GET","PUT","POST","DELETE"],options.method))throw new Error("'method' parameter is required when initializing a UsergridRequest");self.method=options.method,self.callback=options.callback,self.uri=options.uri||UsergridHelpers.uri(client,options),self.entity=options.entity,self.body=options.body,self.asset=options.asset,self.query=options.query,self.queryParams=options.queryParams||options.qs;var defaultHeadersToUse=self.asset?{}:UsergridHelpers.DefaultHeaders;if(self.headers=UsergridHelpers.headers(client,options,defaultHeadersToUse),void 0!==self.query&&(self.uri+=UsergridHelpers.normalize(self.query.encodedStringValue,{})),self.queryParams&&(_.forOwn(self.queryParams,function(value,key){self.uri+="?"+encodeURIComponent(key)+UsergridQueryOperator.EQUAL+encodeURIComponent(value)}),self.uri=UsergridHelpers.normalize(self.uri,{})),self.asset)self.body=new FormData,self.body.append(self.asset.filename,self.asset.data);else try{_.isPlainObject(self.body)?self.body=JSON.stringify(self.body):_.isArray(self.body)&&(self.body=JSON.stringify(self.body))}catch(exception){console.warn("Unable to convert 'UsergridRequest.body' to a JSON String: "+exception)}return self};UsergridRequest.prototype.sendRequest=function(){var self=this,requestPromise=function(){var promise=new Promise,xmlHttpRequest=new XMLHttpRequest;return xmlHttpRequest.open(self.method,self.uri,!0),xmlHttpRequest.onload=function(){promise.done(xmlHttpRequest)},_.forOwn(self.headers,function(value,key){xmlHttpRequest.setRequestHeader(key,value)}),self.method===UsergridHttpMethod.GET&&_.get(self.headers,"Accept")!==UsergridApplicationJSONHeaderValue&&(xmlHttpRequest.responseType="blob"),xmlHttpRequest.send(self.body),promise},responsePromise=function(xmlRequest){var promise=new Promise,usergridResponse=new UsergridResponse(xmlRequest,self);return promise.done(usergridResponse),promise},onCompletePromise=function(usergridResponse){self.callback(usergridResponse.error,usergridResponse)};return Promise.chain([requestPromise,responsePromise]).then(onCompletePromise),self};var UsergridAuth=function(token,expiry){var self=this;self.token=token,self.expiry=expiry||0;var usingToken=token?!0:!1;return Object.defineProperty(self,"hasToken",{get:function(){return void 0!==self.token},configurable:!0}),Object.defineProperty(self,"isExpired",{get:function(){return usingToken?!1:Date.now()>=self.expiry},configurable:!0}),Object.defineProperty(self,"isValid",{get:function(){return!self.isExpired&&self.hasToken},configurable:!0}),Object.defineProperty(self,"tokenTtl",{configurable:!0,writable:!0}),_.assign(self,{destroy:function(){self.token=void 0,self.expiry=0,self.tokenTtl=void 0}}),self},UsergridAppAuth=function(){var self=this,args=UsergridHelpers.flattenArgs(arguments);return _.isPlainObject(args[0])?(self.clientId=args[0].clientId,self.clientSecret=args[0].clientSecret,self.tokenTtl=args[0].tokenTtl):(self.clientId=args[0],self.clientSecret=args[1],self.tokenTtl=args[2]),UsergridAuth.call(self),_.assign(self,UsergridAuth),self};UsergridHelpers.inherits(UsergridAppAuth,UsergridAuth);var UsergridUserAuth=function(options){var self=this,args=_.flattenDeep(UsergridHelpers.flattenArgs(arguments));return _.isPlainObject(args[0])&&(options=args[0]),self.username=options.username||args[0],self.email=options.email,(options.password||args[1])&&(self.password=options.password||args[1]),self.tokenTtl=options.tokenTtl||args[2],UsergridAuth.call(self),_.assign(self,UsergridAuth),self};UsergridHelpers.inherits(UsergridUserAuth,UsergridAuth);var UsergridEntity=function(){var self=this,args=UsergridHelpers.flattenArgs(arguments);if(0===args.length)throw new Error("A UsergridEntity object cannot be initialized without passing one or more arguments");if(self.asset=void 0,_.isPlainObject(args[0])?_.assign(self,args[0]):(self.type||(self.type=_.isString(args[0])?args[0]:void 0),self.name||(self.name=_.isString(args[1])?args[1]:void 0)),!_.isString(self.type))throw new Error("'type' (or 'collection') parameter is required when initializing a UsergridEntity object");return Object.defineProperty(self,"isUser",{get:function(){return"user"===self.type.toLowerCase()}}),Object.defineProperty(self,"hasAsset",{get:function(){return _.has(self,"file-metadata")}}),UsergridHelpers.setReadOnly(self,["uuid","name","type","created"]),self};UsergridEntity.prototype={jsonValue:function(){var jsonValue={};return _.forOwn(this,function(value,key){jsonValue[key]=value}),jsonValue},putProperty:function(key,value){this[key]=value},putProperties:function(obj){_.assign(this,obj)},removeProperty:function(key){this.removeProperties([key])},removeProperties:function(keys){var self=this;keys.forEach(function(key){delete self[key]})},insert:function(key,value,idx){_.isArray(this[key])||(this[key]=this[key]?[this[key]]:[]),this[key].splice.apply(this[key],[idx,0].concat(value))},append:function(key,value){this.insert(key,value,Number.MAX_VALUE)},prepend:function(key,value){this.insert(key,value,0)},pop:function(key){_.isArray(this[key])&&this[key].pop()},shift:function(key){_.isArray(this[key])&&this[key].shift()},reload:function(){var self=this,args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args),callback=UsergridHelpers.callback(args);client.GET(self,function(error,usergridResponse){UsergridHelpers.updateEntityFromRemote(self,usergridResponse),callback(error,usergridResponse,self)}.bind(self))},save:function(){var self=this,args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args),callback=UsergridHelpers.callback(args),currentAsset=self.asset;client.PUT(self,function(error,usergridResponse){UsergridHelpers.updateEntityFromRemote(self,usergridResponse),self.hasAsset&&(self.asset=currentAsset),callback(error,usergridResponse,self)}.bind(self))},remove:function(){var self=this,args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args),callback=UsergridHelpers.callback(args);client.DELETE(self,function(error,usergridResponse){callback(error,usergridResponse,self)}.bind(self))},attachAsset:function(asset){this.asset=asset},uploadAsset:function(){var self=this,args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args),callback=UsergridHelpers.callback(args);if(_.has(self,"asset.contentType"))client.uploadAsset(self,callback);else{var response=UsergridResponse.responseWithError({name:"asset_not_found",description:"The specified entity does not have a valid asset attached"});callback(response.error,response,self)}},downloadAsset:function(){var self=this,args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args),callback=UsergridHelpers.callback(args);if(_.has(self,"asset.contentType"))client.downloadAsset(self,callback);else{var response=UsergridResponse.responseWithError({name:"asset_not_found",description:"The specified entity does not have a valid asset attached"});callback(response.error,response,self)}},connect:function(){var args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args);return args[0]=this,client.connect.apply(client,args)},disconnect:function(){var args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args);return args[0]=this,client.disconnect.apply(client,args)},getConnections:function(){var args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args);return args.shift(),args.splice(1,0,this),client.getConnections.apply(client,args)}};var UsergridUser=function(obj){if(!_.has(obj,"email")&&!_.has(obj,"username"))throw new Error("'email' or 'username' property is required when initializing a UsergridUser object");var self=this;return _.assign(self,obj,UsergridEntity),UsergridEntity.call(self,"user"),UsergridHelpers.setWritable(self,"name"),self};UsergridUser.CheckAvailable=function(){var args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args),callback=UsergridHelpers.callback(args),username=args[0].username||args[1].username,email=args[0].email||args[1].email;if(!username&&!email)throw new Error("'username' or 'email' property is required when checking for available users");var checkQuery=new UsergridQuery("users");username&&checkQuery.eq("username",username),email&&checkQuery.or.eq("email",email),client.GET(checkQuery,function(error,usergridResponse){callback(error,usergridResponse,usergridResponse.entities.length>0)})},UsergridHelpers.inherits(UsergridUser,UsergridEntity),UsergridUser.prototype.uniqueId=function(){var self=this;return _.first([self.uuid,self.username,self.email].filter(_.isString))},UsergridUser.prototype.create=function(){var self=this,args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args),callback=UsergridHelpers.callback(args);client.POST(self,function(error,usergridResponse){delete self.password,_.assign(self,usergridResponse.user),callback(error,usergridResponse,self)}.bind(self))},UsergridUser.prototype.login=function(){var self=this,args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args),callback=UsergridHelpers.callback(args);client.POST("token",UsergridHelpers.userLoginBody(self),function(error,usergridResponse){delete self.password;var responseJSON=usergridResponse.responseJSON,token=_.get(responseJSON,"access_token"),expiresIn=_.get(responseJSON,"expires_in");usergridResponse.ok&&(self.auth=new UsergridUserAuth(self),self.auth.token=token,self.auth.expiry=UsergridHelpers.calculateExpiry(expiresIn),self.auth.tokenTtl=expiresIn),callback(error,usergridResponse,token)})},UsergridUser.prototype.logout=function(){var self=this,args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args),callback=UsergridHelpers.callback(args);if(self.auth&&self.auth.isValid){var revokeAll=_.first(args.filter(_.isBoolean))||!1,requestOptions={client:client,path:["users",self.uniqueId(),"revoketoken"+(revokeAll?"s":"")].join("/"),method:UsergridHttpMethod.PUT,callback:function(error,usergridResponse){self.auth.destroy(),callback(error,usergridResponse,usergridResponse.ok)}.bind(self)};revokeAll||(requestOptions.queryParams={token:self.auth.token});var request=new UsergridRequest(requestOptions);client.sendRequest(request)}else{var response=UsergridResponse.responseWithError({name:"no_valid_token",description:"this user does not have a valid token"});callback(response.error,response)}},UsergridUser.prototype.logoutAllSessions=function(){var args=UsergridHelpers.flattenArgs(arguments);return args=_.concat([UsergridHelpers.validateAndRetrieveClient(args),!0],args),this.logout.apply(this,args)},UsergridUser.prototype.resetPassword=function(){var self=this,args=UsergridHelpers.flattenArgs(arguments),client=UsergridHelpers.validateAndRetrieveClient(args),callback=UsergridHelpers.callback(args);args[0]instanceof UsergridClient&&args.shift();var body=UsergridHelpers.userResetPasswordBody(args);if(!body.oldpassword||!body.newpassword)throw new Error("'oldPassword' and 'newPassword' properties are required when resetting a user password");client.PUT(["users",self.uniqueId(),"password"].join("/"),body,callback)};var UsergridResponseError=function(options){var self=this;return _.assign(self,options),self};UsergridResponseError.fromJSON=function(responseErrorObject){var usergridResponseError,error={name:_.get(responseErrorObject,"error")};return error.name&&(_.assign(error,{exception:_.get(responseErrorObject,"exception"),description:_.get(responseErrorObject,"error_description")||_.get(responseErrorObject,"description")}),usergridResponseError=new UsergridResponseError(error)),usergridResponseError};var UsergridResponse=function(xmlRequest,usergridRequest){var self=this;if(self.ok=!1,self.request=usergridRequest,xmlRequest){self.statusCode=parseInt(xmlRequest.status),self.ok=self.statusCode<400,self.headers=UsergridHelpers.parseResponseHeaders(xmlRequest.getAllResponseHeaders());var responseContentType=_.get(self.headers,"content-type");if(responseContentType===UsergridApplicationJSONHeaderValue)try{var responseJSON=JSON.parse(xmlRequest.responseText);responseJSON&&self.parseResponseJSON(responseJSON)}catch(e){}else self.asset=new UsergridAsset(xmlRequest.response)}return self};UsergridResponse.responseWithError=function(options){var usergridResponse=new UsergridResponse;return usergridResponse.error=new UsergridResponseError(options),usergridResponse},UsergridResponse.prototype={parseResponseJSON:function(responseJSON){var self=this;if(self.responseJSON=_.cloneDeep(responseJSON),self.ok){self.cursor=_.get(self,"responseJSON.cursor"),self.hasNextPage=!_.isNil(self.cursor);var entitiesJSON=_.get(responseJSON,"entities");entitiesJSON&&(self.parseResponseEntities(entitiesJSON),delete self.responseJSON.entities)}else self.error=UsergridResponseError.fromJSON(responseJSON);UsergridHelpers.setReadOnly(self.responseJSON)},parseResponseEntities:function(entitiesJSON){var self=this;self.entities=_.map(entitiesJSON,function(entityJSON){var entity=new UsergridEntity(entityJSON);return entity.isUser&&(entity=new UsergridUser(entity)),entity}),self.first=_.first(self.entities),self.entity=self.first,self.last=_.last(self.entities),"/users"===_.get(self,"responseJSON.path")&&(self.user=self.first,self.users=self.entities)},loadNextPage:function(){var self=this,args=UsergridHelpers.flattenArgs(arguments),callback=UsergridHelpers.callback(args),cursor=self.cursor;if(cursor){var client=UsergridHelpers.validateAndRetrieveClient(args),type=_.last(_.get(self,"responseJSON.path").split("/")),limit=_.first(_.get(self,"responseJSON.params.limit")),ql=_.first(_.get(self,"responseJSON.params.ql")),query=new UsergridQuery(type).fromString(ql).cursor(cursor).limit(limit);client.GET(query,callback)}else callback(UsergridResponse.responseWithError({name:"cursor_not_found",description:"Cursor must be present in order perform loadNextPage()."}))}};var UsergridAssetDefaultFileName="file",UsergridAsset=function(fileOrBlob){if(!fileOrBlob instanceof File||!fileOrBlob instanceof Blob)throw new Error("UsergridAsset must be initialized with a 'File' or 'Blob'");var self=this;return self.data=fileOrBlob,self.filename=fileOrBlob.name||UsergridAssetDefaultFileName,self.contentLength=fileOrBlob.size,self.contentType=fileOrBlob.type,self};