!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.openscadOpenJscadParser=f()}}(function(){var define;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=null==array?0:array.length;++index-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>>1,wrapFlags=[["ary",WRAP_ARY_FLAG],["bind",WRAP_BIND_FLAG],["bindKey",WRAP_BIND_KEY_FLAG],["curry",WRAP_CURRY_FLAG],["curryRight",WRAP_CURRY_RIGHT_FLAG],["flip",WRAP_FLIP_FLAG],["partial",WRAP_PARTIAL_FLAG],["partialRight",WRAP_PARTIAL_RIGHT_FLAG],["rearg",WRAP_REARG_FLAG]],argsTag="[object Arguments]",arrayTag="[object Array]",asyncTag="[object AsyncFunction]",boolTag="[object Boolean]",dateTag="[object Date]",domExcTag="[object DOMException]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",nullTag="[object Null]",objectTag="[object Object]",promiseTag="[object Promise]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",undefinedTag="[object Undefined]",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",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,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="["+rsComboRange+"]",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",rsMiscLower="(?:"+rsLower+"|"+rsMisc+")",rsMiscUpper="(?:"+rsUpper+"|"+rsMisc+")",rsOptContrLower="(?:"+rsApos+"(?:d|ll|m|re|s|t|ve))?",rsOptContrUpper="(?:"+rsApos+"(?:D|LL|M|RE|S|T|VE))?",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsOrdLower="\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",rsOrdUpper="\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)",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+"+"+rsOptContrLower+"(?="+[rsBreak,rsUpper,"$"].join("|")+")",rsMiscUpper+"+"+rsOptContrUpper+"(?="+[rsBreak,rsUpper+rsMiscLower,"$"].join("|")+")",rsUpper+"?"+rsMiscLower+"+"+rsOptContrLower,rsUpper+"+"+rsOptContrUpper,rsOrdUpper,rsOrdLower,rsDigits,rsEmoji].join("|"),"g"),reHasUnicode=RegExp("["+rsZWJ+rsAstralRange+rsComboRange+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&&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=dir<0,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||!isRight&&arrLength==length&&takeCount==length)return baseWrapperValue(array,this.__actions__);var result=[];outer:for(;length--&&resIndex-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index=lower?number:lower)),number}function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=bitmask&CLONE_DEEP_FLAG,isFlat=bitmask&CLONE_FLAT_FLAG,isFull=bitmask&CLONE_SYMBOLS_FLAG;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=isFlat||isFunc?{}:initCloneObject(value),!isDeep)return isFlat?copySymbolsIn(value,baseAssignIn(result,value)):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 keysFunc=isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys,props=isArr?undefined:keysFunc(value);return arrayEach(props||value,function(subValue,key){props&&(key=subValue,subValue=value[key]),assignValue(result,key,baseClone(subValue,bitmask,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(;++indexlength?0:length+start),end=end===undefined||end>length?length:toInteger(end),end<0&&(end+=length),end=start>end?0:toLength(end);start0&&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=castPath(path,object);for(var index=0,length=path.length;null!=object&&indexother}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=120&&array.length>=120)?new SetCache(othIndex&&array):undefined}array=arrays[0];var index=-1,seen=caches[0];outer:for(;++index-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;isIndex(index)?splice.call(array,index,1):baseUnset(array,index)}}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||n<1||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=castPath(path,object);for(var index=-1,length=path.length,lastIndex=length-1,nested=object;null!=nested&&++indexlength?0:length+start),end=end>length?length:end,end<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index>>1,computed=array[mid];null!==computed&&!isSymbol(computed)&&(retHighest?computed<=value:computed=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?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),CLONE_DEEP_FLAG):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),CLONE_DEEP_FLAG):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&&value=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;++leftIndex1?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=length<3?undefined:customizer,length=1),object=Object(object);++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;++index1&&args.reverse(),isAry&&aryarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache:undefined;for(stack.set(array,other),stack.set(other,array);++index1?"& ":"")+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&&value0){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=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 fromIndex<0&&(fromIndex=nativeMax(length+fromIndex,0)),isString(collection)?fromIndex<=length&&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(){if(--n<1)return func.apply(this,arguments)}}function ary(func,n,guard){return n=guard?undefined:n,n=func&&null==n?func.length:n,createWrap(func,WRAP_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)),n<=1&&(func=undefined),result}}function curry(func,arity,guard){arity=guard?undefined:arity;var result=createWrap(func,WRAP_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,WRAP_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||timeSinceLastCall<0||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,WRAP_FLIP_FLAG)}function memoize(func,resolver){if("function"!=typeof func||null!=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=null==start?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 partial(castFunction(wrapper),value)}function castArray(){if(!arguments.length)return[];var value=arguments[0];return isArray(value)?value:[value]}function clone(value){return baseClone(value,CLONE_SYMBOLS_FLAG)}function cloneWith(value,customizer){return customizer="function"==typeof customizer?customizer:undefined,baseClone(value,CLONE_SYMBOLS_FLAG,customizer)}function cloneDeep(value){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)}function cloneDeepWith(value,customizer){return customizer="function"==typeof customizer?customizer:undefined,baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG,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)&&baseGetTag(value)==boolTag}function isElement(value){return isObjectLike(value)&&1===value.nodeType&&!isPlainObject(value)}function isEmpty(value){if(null==value)return!0;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,undefined,customizer):!!result}function isError(value){if(!isObjectLike(value))return!1;var tag=baseGetTag(value);return tag==errorTag||tag==domExcTag||"string"==typeof value.message&&"string"==typeof value.name&&!isPlainObject(value)}function isFinite(value){return"number"==typeof value&&nativeIsFinite(value)}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}function isInteger(value){return"number"==typeof value&&value==toInteger(value)}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}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)&&baseGetTag(value)==numberTag}function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(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&&value<=MAX_SAFE_INTEGER}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}function isUndefined(value){return value===undefined}function isWeakMap(value){return isObjectLike(value)&&getTag(value)==weakMapTag}function isWeakSet(value){return isObjectLike(value)&&baseGetTag(value)==weakSetTag}function toArray(value){if(!value)return[];if(isArrayLike(value))return isString(value)?stringToArray(value):copyArray(value);if(symIterator&&value[symIterator])return iteratorToArray(value[symIterator]());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=value<0?-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 value?baseClamp(toInteger(value),-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER):0===value?value:0}function toString(value){return null==value?"":baseToString(value)}function create(prototype,properties){var result=baseCreate(prototype);return null==properties?result:baseAssign(result,properties)}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){if(null==object)return{};var props=arrayMap(getAllKeysIn(object),function(prop){return[prop]});return predicate=getIteratee(predicate),basePickBy(object,props,function(value,path){return predicate(value,path[0])})}function result(object,path,defaultValue){path=castPath(path,object);var index=-1,length=path.length;for(length||(length=1,object=undefined);++indexupper){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&&strLength>>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=null==position?0: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,customDefaultsAssignIn);var isEscaping,isEvaluating,imports=assignInWith({},options.imports,settings.imports,customDefaultsAssignIn),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(end<1)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=null==pairs?0:pairs.length,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;++indexMAX_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);++index1?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,result=isArrayLike(collection)?Array(collection.length):[];return baseEach(collection,function(value){result[++index]=isFunc?apply(path,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=WRAP_BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=WRAP_PARTIAL_FLAG}return createWrap(func,bitmask,thisArg,partials,holders)}),bindKey=baseRest(function(object,key,partials){var bitmask=WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bindKey));bitmask|=WRAP_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=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 value<=other}),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,customDefaultsAssignIn),apply(assignInWith,undefined,args)}),defaultsDeep=baseRest(function(args){return args.push(undefined,customDefaultsMerge),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,paths){var result={};if(null==object)return result;var isDeep=!1;paths=arrayMap(paths,function(path){return path=castPath(path,object),isDeep||(isDeep=path.length>1),path}),copyObject(object,getAllKeysIn(object),result),isDeep&&(result=baseClone(result,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone));for(var length=paths.length;length--;)baseUnset(result,paths[length]);return result}),pick=flatRest(function(object,paths){return null==object?{}:basePick(object,paths)}),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){n=n===undefined?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();return result.__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||end<0)?new LazyWrapper(result):(start<0?result=result.takeRight(-start):start&&(result=result.drop(start)),end!==undefined&&(end=toInteger(end),result=end<0?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,WRAP_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,symIterator&&(lodash.prototype[symIterator]=wrapperToIterator),lodash},_=runInContext();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(root._=_,define(function(){return _})):freeModule?((freeModule.exports=_)._=_,freeExports._=_):root._=_}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){for(var up=0,i=parts.length-1;i>=0;i--){var last=parts[i];"."===last?parts.splice(i,1):".."===last?(parts.splice(i,1),up++):up&&(parts.splice(i,1),up--)}if(allowAboveRoot)for(;up--;up)parts.unshift("..");return parts}function filter(xs,f){if(xs.filter)return xs.filter(f);for(var res=[],i=0;i=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if("string"!=typeof path)throw new TypeError("Arguments to path.resolve must be strings");path&&(resolvedPath=path+"/"+resolvedPath,resolvedAbsolute="/"===path.charAt(0))}return resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/"),(resolvedAbsolute?"/":"")+resolvedPath||"."},exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash="/"===substr(path,-1);return path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/"),path||isAbsolute||(path="."),path&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},exports.isAbsolute=function(path){return"/"===path.charAt(0)},exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if("string"!=typeof p)throw new TypeError("Arguments to path.join must be strings");return p}).join("/"))},exports.relative=function(from,to){function trim(arr){for(var start=0;start=0&&""===arr[end];end--);return start>end?[]:arr.slice(start,end-start+1)}from=exports.resolve(from).substr(1),to=exports.resolve(to).substr(1);for(var fromParts=trim(from.split("/")),toParts=trim(to.split("/")),length=Math.min(fromParts.length,toParts.length),samePartsLength=length,i=0;i1)for(var i=1;i3||direction.elements.length>3)return null;var mod=direction.modulus();return 0===mod?null:(this.anchor=anchor,this.direction=_vector.Vector.create([direction.elements[0]/mod,direction.elements[1]/mod,direction.elements[2]/mod]),this)}}],[{key:"create",value:function(anchor,direction){var L=new Line;return L.setVectors(anchor,direction)}}]),Line}(),Segment=exports.Segment=function(){function Segment(){_classCallCheck(this,Segment)}return _createClass(Segment,[{key:"eql",value:function(segment){return this.start.eql(segment.start)&&this.end.eql(segment.end)||this.start.eql(segment.end)&&this.end.eql(segment.start)}},{key:"dup",value:function(){return Segment.create(this.start,this.end)}},{key:"length",value:function(){var A=this.start.elements,B=this.end.elements,C1=B[0]-A[0],C2=B[1]-A[1],C3=B[2]-A[2];return Math.sqrt(C1*C1+C2*C2+C3*C3)}},{key:"toVector",value:function(){var A=this.start.elements,B=this.end.elements;return _vector.Vector.create([B[0]-A[0],B[1]-A[1],B[2]-A[2]])}},{key:"midpoint",value:function(){var A=this.start.elements,B=this.end.elements;return _vector.Vector.create([(B[0]+A[0])/2,(B[1]+A[1])/2,(B[2]+A[2])/2])}},{key:"bisectingPlane",value:function(){return _plane.Plane.create(this.midpoint(),this.toVector())}},{key:"translate",value:function(vector){var V=vector.elements||vector,S=this.start.elements,E=this.end.elements;return Segment.create([S[0]+V[0],S[1]+V[1],S[2]+(V[2]||0)],[E[0]+V[0],E[1]+V[1],E[2]+(V[2]||0)])}},{key:"isParallelTo",value:function(obj){return this.line.isParallelTo(obj)}},{key:"distanceFrom",value:function(obj){var P=this.pointClosestTo(obj);return null===P?null:P.distanceFrom(obj)}},{key:"contains",value:function(obj){if(obj.start&&obj.end)return this.contains(obj.start)&&this.contains(obj.end);var P=(obj.elements||obj).slice();if(2===P.length&&P.push(0),this.start.eql(P))return!0;var S=this.start.elements,V=_vector.Vector.create([S[0]-P[0],S[1]-P[1],S[2]-(P[2]||0)]),vect=this.toVector();return V.isAntiparallelTo(vect)&&V.modulus()<=vect.modulus()}},{key:"intersects",value:function(obj){return null!==this.intersectionWith(obj)}},{key:"intersectionWith",value:function(obj){if(!this.line.intersects(obj))return null;var P=this.line.intersectionWith(obj);return this.contains(P)?P:null}},{key:"pointClosestTo",value:function(obj){if(obj.normal){var V=this.line.intersectionWith(obj);return null===V?null:this.pointClosestTo(V)}var P=this.line.pointClosestTo(obj);return null===P?null:this.contains(P)?P:(this.line.positionOf(P)<0?this.start:this.end).dup()}},{key:"setPoints",value:function(startPoint,endPoint){return startPoint=_vector.Vector.create(startPoint).to3D(),endPoint=_vector.Vector.create(endPoint).to3D(),null===startPoint||null===endPoint?null:(this.line=Line.create(startPoint,endPoint.subtract(startPoint)),this.start=startPoint,this.end=endPoint,this)}}],[{key:"create",value:function(v1,v2){var S=new Segment;return S.setPoints(v1,v2)}}]),Segment}();Line.X=Line.create(_vector.Vector.Zero(3),_vector.Vector.i),Line.Y=Line.create(_vector.Vector.Zero(3),_vector.Vector.j),Line.Z=Line.create(_vector.Vector.Zero(3),_vector.Vector.k),Line.Segment=Segment},{"./matrix":7,"./plane":8,"./sylvester":9,"./vector":10}],7:[function(require,module,exports){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj.default=obj,newObj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function sign(x){return x<0?-1:1}function identSize(M,m,n,k){for(var e=M.elements,i=k-1;i--;){for(var row=[],j=0;j1&&void 0!==arguments[1]?arguments[1]:pca(this).U,Ureduce=U.slice(1,U.rows(),1,k);return{Z:this.x(Ureduce),U:U}}},{key:"pcaRecover",value:function(U){var k=this.cols(),Ureduce=U.slice(1,U.rows(),1,k);return this.x(Ureduce.transpose())}},{key:"triu",value:function(k){return k||(k=0),this.map(function(x,i,j){return j-i>=k?x:0})}},{key:"unroll",value:function(){for(var v=[],i=1;i<=this.cols();i++)for(var j=1;j<=this.rows();j++)v.push(this.e(j,i));return _vector.Vector.create(v)}},{key:"slice",value:function(startRow,endRow,startCol,endCol){var x=[];0===endRow&&(endRow=this.rows()),0===endCol&&(endCol=this.cols());for(var i=startRow;i<=endRow;i++){for(var row=[],j=startCol;j<=endCol;j++)row.push(this.e(i,j)); x.push(row)}return Matrix.create(x)}},{key:"e",value:function(i,j){return i<1||i>this.elements.length||j<1||j>this.elements[0].length?null:this.elements[i-1][j-1]}},{key:"row",value:function(i){return i>this.elements.length?null:_vector.Vector.create(this.elements[i-1])}},{key:"col",value:function col(j){if(j>this.elements[0].length)return null;for(var col=[],n=this.elements.length,i=0;i(precision||_sylvester.Sylvester.precision))return!1;return!0}},{key:"dup",value:function(){return Matrix.create(this.elements)}},{key:"map",value:function(fn){for(var els=[],i=this.elements.length,nj=this.elements[0].length,j=void 0;i--;)for(j=nj,els[i]=[];j--;)els[i][j]=fn(this.elements[i][j],i+1,j+1);return Matrix.create(els)}},{key:"isSameSizeAs",value:function(matrix){var M=matrix.elements||matrix;return"undefined"==typeof M[0][0]&&(M=Matrix.create(M).elements),this.elements.length===M.length&&this.elements[0].length===M[0].length}},{key:"add",value:function(matrix){if("number"==typeof matrix)return this.map(function(x){return x+matrix});var M=matrix.elements||matrix;return"undefined"==typeof M[0][0]&&(M=Matrix.create(M).elements),this.isSameSizeAs(M)?this.map(function(x,i,j){return x+M[i-1][j-1]}):null}},{key:"subtract",value:function(matrix){if("number"==typeof matrix)return this.map(function(x){return x-matrix});var M=matrix.elements||matrix;return"undefined"==typeof M[0][0]&&(M=Matrix.create(M).elements),this.isSameSizeAs(M)?this.map(function(x,i,j){return x-M[i-1][j-1]}):null}},{key:"canMultiplyFromLeft",value:function(matrix){var M=matrix.elements||matrix;return"undefined"==typeof M[0][0]&&(M=Matrix.create(M).elements),this.elements[0].length===M.length}},{key:"mulOp",value:function(matrix,op){if(!matrix.elements)return this.map(function(x){return op(x,matrix)});var returnVector=Boolean(matrix.modulus),M=matrix.elements||matrix;if("undefined"==typeof M[0][0]&&(M=Matrix.create(M).elements),!this.canMultiplyFromLeft(M))return null;for(var e=this.elements,rowThis=void 0,rowElem=void 0,elements=[],sum=void 0,m=e.length,n=M[0].length,o=e[0].length,i=m,j=void 0,k=void 0;i--;){for(rowElem=[],rowThis=e[i],j=n;j--;){for(sum=0,k=o;k--;)sum+=op(rowThis[k],M[k][j]);rowElem[j]=sum}elements[i]=rowElem}var output=Matrix.create(elements);return returnVector?output.col(1):output}},{key:"div",value:function(matrix){return this.mulOp(matrix,function(x,y){return x/y})}},{key:"multiply",value:function(matrix){return this.mulOp(matrix,function(x,y){return x*y})}},{key:"x",value:function(matrix){return this.multiply(matrix)}},{key:"elementMultiply",value:function(v){return this.map(function(k,i,j){return v.e(i,j)*k})}},{key:"sum",value:function sum(){var sum=0;return this.map(function(x){sum+=x}),sum}},{key:"mean",value:function(){for(var dim=this.dimensions(),r=[],i=1;i<=dim.cols;i++)r.push(this.col(i).sum()/dim.rows);return _vector.Vector.create(r)}},{key:"std",value:function(){for(var dim=this.dimensions(),mMean=this.mean(),r=[],i=1;i<=dim.cols;i++){var meanDiff=this.col(i).subtract(mMean.e(i));meanDiff=meanDiff.multiply(meanDiff),r.push(Math.sqrt(meanDiff.sum()/dim.rows))}return _vector.Vector.create(r)}},{key:"column",value:function(n){return this.col(n)}},{key:"log",value:function(){return this.map(function(x){return Math.log(x)})}},{key:"minor",value:function(a,b,c,d){for(var elements=[],ni=c,i=void 0,nj=void 0,j=void 0,rows=this.elements.length,cols=this.elements[0].length;ni--;)for(i=c-ni-1,elements[i]=[],nj=d;nj--;)j=d-nj-1,elements[i][j]=this.elements[(a+i-1)%rows][(b+j-1)%cols];return Matrix.create(elements)}},{key:"transpose",value:function(){for(var rows=this.elements.length,cols=this.elements[0].length,elements=[],i=cols,j=void 0;i--;)for(j=rows,elements[i]=[];j--;)elements[i][j]=this.elements[j][i];return Matrix.create(elements)}},{key:"isSquare",value:function(){return this.elements.length===this.elements[0].length}},{key:"max",value:function(){for(var m=0,i=this.elements.length,nj=this.elements[0].length,j=void 0;i--;)for(j=nj;j--;)Math.abs(this.elements[i][j])>Math.abs(m)&&(m=this.elements[i][j]);return m}},{key:"indexOf",value:function(x){var ni=this.elements.length,i=void 0,nj=this.elements[0].length,j=void 0;for(i=0;i_sylvester.Sylvester.precision){rank++;break}return rank}},{key:"rk",value:function(){return this.rank()}},{key:"augment",value:function(matrix){var M=matrix.elements||matrix;"undefined"==typeof M[0][0]&&(M=Matrix.create(M).elements);var T=this.dup(),cols=T.elements[0].length,i=T.elements.length,nj=M[0].length,j=void 0;if(i!==M.length)return null;for(;i--;)for(j=nj;j--;)T.elements[i][cols+j]=M[i][j];return T}},{key:"inverse",value:function(){if(!this.isSquare()||this.isSingular())return null;for(var n=this.elements.length,i=n,j=void 0,M=this.augment(Matrix.I(n)).toRightTriangular(),np=M.elements[0].length,p=void 0,els=void 0,divisor=void 0,inverseElements=[],newElement=void 0;i--;){for(els=[],inverseElements[i]=[],divisor=M.elements[i][i],p=0;p=n&&inverseElements[i].push(newElement);for(M.elements[i]=els,j=i;j--;){for(els=[],p=0;pmax)&&(max=this.e(i,j),maxIndex=j);maxes.push(maxIndex)}return _vector.Vector.create(maxes)}},{key:"maxColumns",value:function(){for(var maxes=[],i=1;i<=this.rows();i++){for(var max=null,j=1;j<=this.cols();j++)(null===max||this.e(i,j)>max)&&(max=this.e(i,j));maxes.push(max)}return _vector.Vector.create(maxes)}},{key:"minColumnIndexes",value:function(){for(var mins=[],i=1;i<=this.rows();i++){for(var min=null,minIndex=-1,j=1;j<=this.cols();j++)(null===min||this.e(i,j)maxValue&&(maxValue=Math.abs(A.e(k,j)),maxIndex=i);if(maxIndex!==k){var tmp=A.elements[k-1];A.elements[k-1]=A.elements[maxIndex-1],A.elements[maxIndex-1]=tmp,P.elements[k-1][k-1]=0,P.elements[k-1][maxIndex-1]=1,P.elements[maxIndex-1][maxIndex-1]=0,P.elements[maxIndex-1][k-1]=1}return P}},{key:"forwardSubstitute",value:function(b){for(var xa=[],i=1;i<=this.rows();i++){for(var w=0,j=1;j0;i--){for(var w=0,j=this.cols();j>i;j--)w+=this.e(i,j)*xa[this.rows()-j];xa.push((b.e(i)-w)/this.e(i,i))}return _vector.Vector.create(xa.reverse())}},{key:"svdJs",value:function(){for(var A=this,V=Matrix.I(A.rows()),S=A.transpose(),U=Matrix.I(A.cols()),err=Number.MAX_VALUE,i=0,maxLoop=100;err>2.2737e-13&&i1&&matrix.push(d)}var M=new Matrix;return M.setElements(matrix)}},{key:"Diagonal",value:function(elements){for(var i=elements.length,M=Matrix.I(i);i--;)M.elements[i][i]=elements[i];return M}},{key:"Rotation",value:function(theta,a){if(!a)return Matrix.create([[Math.cos(theta),-Math.sin(theta)],[Math.sin(theta),Math.cos(theta)]]);var axis=a.dup();if(3!==axis.elements.length)return null;var mod=axis.modulus(),x=axis.elements[0]/mod,y=axis.elements[1]/mod,z=axis.elements[2]/mod,s=Math.sin(theta),c=Math.cos(theta),t=1-c;return Matrix.create([[t*x*x+c,t*x*y-s*z,t*x*z+s*y],[t*x*y+s*z,t*y*y+c,t*y*z-s*x],[t*x*z-s*y,t*y*z+s*x,t*z*z+c]])}},{key:"RotationX",value:function(t){var c=Math.cos(t),s=Math.sin(t);return Matrix.create([[1,0,0],[0,c,-s],[0,s,c]])}},{key:"RotationY",value:function(t){var c=Math.cos(t),s=Math.sin(t);return Matrix.create([[c,0,s],[0,1,0],[-s,0,c]])}},{key:"RotationZ",value:function(t){var c=Math.cos(t),s=Math.sin(t);return Matrix.create([[c,-s,0],[s,c,0],[0,0,1]])}},{key:"Random",value:function(n,m){return 1===arguments.length&&(m=n),Matrix.Zero(n,m).map(function(){return Math.random()})}},{key:"Fill",value:function(n,m,v){2===arguments.length&&(v=m,m=n);for(var els=[],i=n,j=void 0;i--;)for(j=m,els[i]=[];j--;)els[i][j]=v;return Matrix.create(els)}},{key:"Zero",value:function(n,m){return Matrix.Fill(n,m,0)}},{key:"Zeros",value:function(n,m){return Matrix.Zero(n,m)}},{key:"One",value:function(n,m){return Matrix.Fill(n,m,1)}},{key:"Ones",value:function(n,m){return Matrix.One(n,m)}}]),Matrix}();lapack?(Matrix.prototype.svd=Matrix.prototype.svdPack,Matrix.prototype.qr=Matrix.prototype.qrPack,Matrix.prototype.lu=Matrix.prototype.luPack):(Matrix.prototype.svd=Matrix.prototype.svdJs,Matrix.prototype.qr=Matrix.prototype.qrJs,Matrix.prototype.lu=Matrix.prototype.luJs)},{"./sylvester":9,"./vector":10,fs:1,lapack:1}],8:[function(require,module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Plane=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i2){if(A=list[n-1].elements,B=list[n-2].elements,C=list[n-3].elements,N=_vector.Vector.create([(A[1]-B[1])*(C[2]-B[2])-(A[2]-B[2])*(C[1]-B[1]),(A[2]-B[2])*(C[0]-B[0])-(A[0]-B[0])*(C[2]-B[2]),(A[0]-B[0])*(C[1]-B[1])-(A[1]-B[1])*(C[0]-B[0])]).toUnitVector(),n>3&&(theta=N.angleFrom(prevN),null!==theta&&!(Math.abs(theta)<=_sylvester.Sylvester.precision||Math.abs(theta-Math.PI)<=_sylvester.Sylvester.precision)))return null;totalN=totalN.add(N),prevN=N}}A=list[1].elements,B=list[0].elements,C=list[n-1].elements;var D=list[n-2].elements;return totalN=totalN.add(_vector.Vector.create([(A[1]-B[1])*(C[2]-B[2])-(A[2]-B[2])*(C[1]-B[1]),(A[2]-B[2])*(C[0]-B[0])-(A[0]-B[0])*(C[2]-B[2]),(A[0]-B[0])*(C[1]-B[1])-(A[1]-B[1])*(C[0]-B[0])]).toUnitVector()).add(_vector.Vector.create([(B[1]-C[1])*(D[2]-C[2])-(B[2]-C[2])*(D[1]-C[1]),(B[2]-C[2])*(D[0]-C[0])-(B[0]-C[0])*(D[2]-C[2]),(B[0]-C[0])*(D[1]-C[1])-(B[1]-C[1])*(D[0]-C[0])]).toUnitVector()),Plane.create(list[0],totalN)}}]),Plane}();Plane.XY=Plane.YX=Plane.create(_vector.Vector.Zero(3),_vector.Vector.k),Plane.YZ=Plane.ZY=Plane.create(_vector.Vector.Zero(3),_vector.Vector.i),Plane.ZX=Plane.XZ=Plane.create(_vector.Vector.Zero(3),_vector.Vector.j)},{"./line":6,"./matrix":7,"./sylvester":9,"./vector":10}],9:[function(require,module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});exports.Sylvester={precision:1e-6,approxPrecision:1e-5},exports.DimensionalityMismatchError=function(_Error){function DimensionalityMismatchError(){return _classCallCheck(this,DimensionalityMismatchError),_possibleConstructorReturn(this,(DimensionalityMismatchError.__proto__||Object.getPrototypeOf(DimensionalityMismatchError)).apply(this,arguments))}return _inherits(DimensionalityMismatchError,_Error),DimensionalityMismatchError}(Error)},{}],10:[function(require,module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Vector=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;ithis.elements.length?null:this.elements[i-1]}},{key:"dimensions",value:function(){return{rows:1,cols:this.elements.length}}},{key:"rows",value:function(){return 1}},{key:"cols",value:function(){return this.elements.length}},{key:"eql",value:function(vector){var n=this.elements.length,V=vector.elements||vector;if(n!==V.length)return!1;for(;n--;)if(Math.abs(this.elements[n]-V[n])>_sylvester.Sylvester.precision)return!1;return!0}},{key:"map",value:function(fn){for(var n=this.elements.length,elements=new Array(n),i=0;i1&&(theta=1),Math.acos(theta)}},{key:"isParallelTo",value:function(vector){var angle=this.angleFrom(vector);return null!==angle&&angle<=_sylvester.Sylvester.precision}},{key:"isAntiparallelTo",value:function(vector){var angle=this.angleFrom(vector);return null!==angle&&Math.abs(angle-Math.PI)<=_sylvester.Sylvester.precision}},{key:"isPerpendicularTo",value:function(vector){return Math.abs(this.dot(vector))<=_sylvester.Sylvester.precision}},{key:"_runBinaryOp",value:function(value,operator){if("number"==typeof value)return this.map(function(v){return operator(v,value)});var values=value.elements||value;if(this.elements.length!==values.length)throw new _sylvester.DimensionalityMismatchError("Cannot add vectors with different dimensions.");return this.map(function(x,i){return operator(x,values[i-1])})}},{key:"add",value:function(value){return this._runBinaryOp(value,function(a,b){return a+b})}},{key:"subtract",value:function(value){return this._runBinaryOp(value,function(a,b){return a-b})}},{key:"multiply",value:function(value){return this._runBinaryOp(value,function(a,b){return a*b})}},{key:"sum",value:function sum(){var sum=0;return this.each(function(x){sum+=x}),sum}},{key:"chomp",value:function(n){for(var elements=[],i=n;iMath.abs(m)&&(m=this.elements[i]);return m}},{key:"maxIndex",value:function maxIndex(){for(var m=0,i=this.elements.length,maxIndex=-1;i--;)Math.abs(this.elements[i])>Math.abs(m)&&(m=this.elements[i],maxIndex=i+1);return maxIndex}},{key:"indexOf",value:function(x){for(var index=null,n=this.elements.length,i=0;i"}},{key:"setElements",value:function(els){return this.elements=(els.elements||els).slice(),this}},{key:"toJSON",value:function(){return this.elements}}],[{key:"create",value:function(elements){var V=new Vector;return V.setElements(elements)}},{key:"Random",value:function(n){for(var elements=[];n--;)elements.push(Math.random());return Vector.create(elements)}},{key:"Fill",value:function(n,v){for(var elements=[];n--;)elements.push(v);return Vector.create(elements)}},{key:"Zero",value:function(n){return Vector.Fill(n,0)}},{key:"One",value:function(n){return Vector.Fill(n,1)}},{key:"log",value:function(v){return v.map(function(x){return Math.log(x)})}}]),Vector}();Vector.i=Vector.create([1,0,0]),Vector.j=Vector.create([0,1,0]),Vector.k=Vector.create([0,0,1]),Vector.prototype.modulus=Vector.prototype.magnitude,Vector.prototype.norm=Vector.prototype.magnitude,Vector.prototype.dup=function(){return this.map(function(x){return x})}},{"./matrix":7,"./sylvester":9}],11:[function(require,module,exports){module.exports=function(){this.argname,this.argexpr}},{}],12:[function(require,module,exports){ module.exports=function(){this.argnames=[],this.argexpr=[]}},{}],13:[function(require,module,exports){function CSGModule(factory,csgOperation){this.csgOperation=csgOperation,this.factory=factory}var Context=require("./Context"),_=(require("./Globals"),require("lodash"));CSGModule.prototype.evaluate=function(parentContext,inst){for(var context=new Context(parentContext),childModules=[],i=0;i=0;i--){var ctx=Globals.context_stack[i];if(void 0!==ctx.inst_p){if(childIndex0?parseInt(fn):parseInt(Math.ceil(Math.max(Math.min(360/fa,2*r*Math.PI/fs),5)))};var functionNameLookup={cos:function(degree){if(!_.isUndefined(degree)&&!_.isNaN(degree))return Math.cos(deg2rad(degree))},sin:function(degree){if(!_.isUndefined(degree)&&!_.isNaN(degree))return Math.sin(deg2rad(degree))},acos:function(degree){if(!_.isUndefined(degree)&&!_.isNaN(degree))return rad2deg(Math.acos(degree))},asin:function(degree){if(!_.isUndefined(degree)&&!_.isNaN(degree))return rad2deg(Math.asin(degree))},atan:function(degree){if(!_.isUndefined(degree)&&!_.isNaN(degree))return rad2deg(Math.atan(degree))},atan2:function(x,y){if(!(_.isUndefined(x)||_.isNaN(x)||_.isUndefined(y)||_.isNaN(y)))return rad2deg(Math.atan2(x,y))},tan:function(degree){if(!_.isUndefined(degree)&&!_.isNaN(degree))return Math.tan(deg2rad(degree))},rands:function(min_value,max_value,value_count,seed_value){var values=[];void 0!==seed_value&&Math.seedrandom(seed_value);for(var i=0;i0?1:x<0?-1:0},lookup:function(){var low_p,low_v,high_p,high_v;if(arguments.length<2)return void console.log("Lookup arguments are invalid. Incorrect parameter count. "+arguments);var p=arguments[0],vector=arguments[1];if(!_.isNumber(p)||!_.isArray(vector)||vector.length<2||vector.length>=2&&!_.isArray(vector[0]))return void console.log("Lookup arguments are invalid. Incorrect parameters. "+arguments);if(2!=vector[0].length)return void console.log("Lookup arguments are invalid. First vector has incorrect number of values. "+p+", "+vector);if(low_p=vector[0][0],low_v=vector[0][1],high_p=low_p,high_v=low_v,_.each(vector.slice(1),function(v){if(2==v.length){var this_p=v[0],this_v=v[1];this_p<=p&&(this_p>low_p||low_p>p)&&(low_p=this_p,low_v=this_v),this_p>=p&&(this_p=high_p)return high_v;var f=(p-low_p)/(high_p-low_p);return high_v*f+low_v*(1-f)}};module.exports=Context},{"./Globals":19,lodash:2}],16:[function(require,module,exports){function ControlModule(factory){this.factory=factory}function IfStatement(a){ControlModule.call(this,a)}function ForLoopStatement(factory,args){ControlModule.call(this,factory),this.csgOp=args.csgOp,this.evaluatedChildren=[],this.forEval=function(parentEvaluatedChildren,inst,recurs_length,call_argnames,call_argvalues,arg_context){if(this.evaluatedChildren=parentEvaluatedChildren,call_argnames.length>recurs_length){var it_name=call_argnames[recurs_length],it_values=call_argvalues[recurs_length],context=new Context(arg_context);if(it_values instanceof Range){var range=it_values;if(range.end0&&(range.begin-range.end)/range.step<1e4)for(var i=range.begin;i<=range.end;i+=range.step)context.setVariable(it_name,i),this.forEval(this.evaluatedChildren,inst,recurs_length+1,call_argnames,call_argvalues,context)}else if(_.isArray(it_values))for(var i=0;i0){var evaluatedInstanceChildren=inst.evaluateChildren(arg_context);_.isArray(evaluatedInstanceChildren)?this.evaluatedChildren=this.evaluatedChildren.concat(evaluatedInstanceChildren):this.evaluatedChildren.push(evaluatedInstanceChildren)}if(_.isArray(this.evaluatedChildren)&&(this.evaluatedChildren=_.reject(this.evaluatedChildren,function(x){return _.isEmpty(x)})),_.isArray(this.evaluatedChildren)&&this.evaluatedChildren.length>1){var unionedEvaluatedChildren=_.first(this.evaluatedChildren)+"."+this.csgOp+"(["+_.tail(this.evaluatedChildren)+"])";this.evaluatedChildren=[unionedEvaluatedChildren]}return this.evaluatedChildren}}function Echo(a){ControlModule.call(this,a)}var _=require("lodash"),Context=require("./Context"),Globals=require("./Globals"),Range=require("./Range");IfStatement.prototype.evaluate=function(parentContext,inst){inst.argvalues=[],_.each(inst.argexpr,function(expr,index,list){inst.argvalues.push(expr.evaluate(parentContext))});for(var context=Context.newContext(parentContext,[],[],inst),childrenToEvaluate=inst.argvalues.length>0&&inst.argvalues[0]?inst.children:inst.else_children,childModules=[],i=0;i1?_.first(childModules)+".union(["+_.tail(childModules)+"])":childModules[0]},ForLoopStatement.prototype.evaluate=function(context,inst){return void 0===inst.context&&(inst.context=context),this.forEval([],inst,0,inst.argnames,inst.argvalues,inst.context)},Echo.prototype.evaluate=function(parentContext,inst){var context=new Context(parentContext),argvalues=[];_.each(inst.argexpr,function(expr,index,list){argvalues.push(Globals.convertForStrFunction(expr.evaluate(context)))}),console.log(_.template("ECHO: <%=argvalues%>")({argvalues:argvalues}))},module.exports={Echo:Echo,ForLoopStatement:ForLoopStatement,IfStatement:IfStatement}},{"./Context":15,"./Globals":19,"./Range":28,lodash:2}],17:[function(require,module,exports){function Expression(value){this.children=[],this.const_value=value,this.var_name,this.call_funcname,this.call_argnames=[],this.type="C"}function isMatrix(x){return _.isArray(x)&&_.isArray(x[0])}function isVector(x){return _.isArray(x)&&!_.isArray(x[0])}function getValueObject(x){return isMatrix(x)?Sylvester.$M(x):isVector(x)?Sylvester.$V(x):x}var Range=require("./Range"),Sylvester=require("sylvester"),_=require("lodash");Sylvester.Matrix.prototype.toString=function(){var x=_.map(this.elements,function(y){return"["+y.join(",")+"]"});return"["+x.join(",")+"]"},Sylvester.Vector.prototype.toString=function(){return"["+this.elements.join(",")+"]"},Expression.prototype.evaluate=function(context){switch(this.type){case"!":return!this.children[0].evaluate(context);case"&&":var c1=this.children[0].evaluate(context),c2=this.children[1].evaluate(context);return!(_.isUndefined(c1)||_.isUndefined(c2)||_.isNaN(c1)||_.isNaN(c2))&&(!(!_.isArray(c1)&&!_.isArray(c2))||c1&&c2);case"||":var c1=this.children[0].evaluate(context),c2=this.children[1].evaluate(context);return!!(_.isUndefined(c1)||_.isUndefined(c2)||_.isNaN(c1)||_.isNaN(c2))||(!(!_.isArray(c1)&&!_.isArray(c2))||(c1||c2));case"*":var c1=this.children[0].evaluate(context),c2=this.children[1].evaluate(context);if(_.isUndefined(c1)||_.isUndefined(c2)||_.isNaN(c1)||_.isNaN(c2))return;if(_.isArray(c1)||_.isArray(c2)){var v1=getValueObject(c1),v2=getValueObject(c2);return isVector(c1)&&isVector(c2)?v1.dot(v2):isVector(c1)&&isMatrix(c2)?[v1.dot(v2.col(1)),v1.dot(v2.col(2)),v1.dot(v2.col(3))]:_.isNumber(c1)?v2.multiply(v1):v1.multiply(v2)}return c1*c2;case"/":var c1=this.children[0].evaluate(context),c2=this.children[1].evaluate(context);if(_.isUndefined(c1)||_.isUndefined(c2)||_.isNaN(c1)||_.isNaN(c2))return;if(_.isArray(c1)||_.isArray(c2)){var v1=getValueObject(c1),v2=getValueObject(c2);if(_.isArray(c1)&&_.isArray(c2))return;if(isMatrix(c1)&&_.isNumber(c2))return v1.multiply(1/v2);if(_.isNumber(c1)&&isMatrix(c2)){for(var result=[],i=0;i=":var c1=this.children[0].evaluate(context),c2=this.children[1].evaluate(context);return!!(_.isUndefined(c1)||_.isUndefined(c2)||_.isNaN(c1)||_.isNaN(c2))||(!(!_.isArray(c1)&&!_.isArray(c2))||c1>=c2);case">":var c1=this.children[0].evaluate(context),c2=this.children[1].evaluate(context);return!(_.isUndefined(c1)||_.isUndefined(c2)||_.isNaN(c1)||_.isNaN(c2))&&(!_.isArray(c1)&&!_.isArray(c2)&&c1>c2);case"?:":var v=this.children[0].evaluate(context);return this.children[v?1:2].evaluate(context);case"I":var c1=this.children[0].evaluate(context);return _.isArray(c1)?_.map(c1,function(x){return-x}):-c1;case"C":return this.const_value;case"R":var v1=this.children[0].evaluate(context),v2=this.children[1].evaluate(context),v3=this.children[2].evaluate(context);if(_.isNumber(v1)&&_.isNumber(v2)&&_.isNumber(v3))return new Range(v1,v2,v3);return;case"V":for(var vec=[],i=0;i]*)>;?/gm,includedLibraryRegex:/include <([^>]*)>;?/gm}},{lodash:2}],20:[function(require,module,exports){function IfElseModuleInstantiation(){ModuleInstantiation.call(this),this.name="if",this.else_children=[]}var ModuleInstantiation=require("./ModuleInstantiation");IfElseModuleInstantiation.prototype=new ModuleInstantiation,IfElseModuleInstantiation.prototype.constructor=IfElseModuleInstantiation,module.exports=IfElseModuleInstantiation},{"./ModuleInstantiation":24}],21:[function(require,module,exports){function Import(factory){this.factory=factory}var Context=require("./Context"),StlDecoder=(require("./Globals"),require("./StlDecoder"));Import.prototype.evaluate=function(parentContext,inst){var context=new Context(parentContext),argnames=["file","filename","convexity"],argexpr=[];context.args(argnames,argexpr,inst.argnames,inst.argvalues);var filename=Context.contextVariableLookup(context,"file",null)||Context.contextVariableLookup(context,"filename",null),importCache=(Context.contextVariableLookup(context,"convexity",5),Context.contextVariableLookup(context,"importCache",{})),fileContents=importCache[filename];if(void 0!==fileContents){var stlDecoder=new StlDecoder(atob(fileContents));return stlDecoder.decode(),stlDecoder.getCSGString()}},module.Exports=Import},{"./Context":15,"./Globals":19,"./StlDecoder":29}],22:[function(require,module,exports){function Module(name){this.name=name,this.children=[],this.assignments_var={},this.functions={},this.modules=[],this.argnames=[],this.argexpr=[]}var _=require("lodash"),Context=require("./Context"),Globals=require("./Globals");Module.prototype.evaluate=function(parentContext,inst){var lines=[],context=new Context(parentContext);void 0===parentContext&&(context.setVariable("$fn",Globals.DEFAULT_RESOLUTION),context.setVariable("$fs",2),context.setVariable("$fa",12)),void 0!==inst&&(context.args(this.argnames,this.argexpr,inst.argnames,inst.argvalues),context.setVariable("$children",inst.children.length)),context.inst_p=inst,context.functions_p=this.functions,context.modules_p=this.modules,_.each(this.assignments_var,function(value,key,list){context.setVariable(key,value.evaluate(context))});var controlChildren=_.filter(this.children,function(child){return child&&"echo"==child.name});_.each(controlChildren,function(child,index,list){child.evaluate(context)});var nonControlChildren=_.reject(this.children,function(child){return!child||"echo"==child.name}),evaluatedLines=[];_.each(nonControlChildren,function(child,index,list){var evaluatedChild=child.evaluate(context);void 0==evaluatedChild||_.isArray(evaluatedChild)&&_.isEmpty(evaluatedChild)||evaluatedLines.push(evaluatedChild)});var cleanedLines=_.compact(evaluatedLines);return 1==cleanedLines.length?lines.push(cleanedLines[0]):cleanedLines.length>1&&lines.push(_.head(cleanedLines)+".union(["+_.tail(cleanedLines)+"])"),lines},module.exports=Module},{"./Context":15,"./Globals":19,lodash:2}],23:[function(require,module,exports){function ModuleAdaptor(){}ModuleAdaptor.prototype.evaluate=function(parentContext,inst){return inst.isSubmodule=!0,parentContext.evaluateModule(inst)},module.exports=ModuleAdaptor},{}],24:[function(require,module,exports){function ModuleInstantiation(){this.name,this.argnames=[],this.argvalues=[],this.argexpr=[],this.children=[],this.isSubmodule=!1,this.context}var _=require("lodash"),OpenjscadSolidFactorySingleton=require("./OpenjscadSolidFactorySingleton");ModuleInstantiation.prototype.evaluate=function(context){var evaluatedModule,that=this;return this.argvalues=[],_.each(this.argexpr,function(expr,index,list){that.argvalues.push(expr.evaluate(context))}),that.context=context,evaluatedModule=context.evaluateModule(that,OpenjscadSolidFactorySingleton.getInstance()),that.context=null,that.argvalues=[],evaluatedModule},ModuleInstantiation.prototype.evaluateChildren=function(context){for(var childModules=[],i=0;i], radius: <%= radius %>, resolution: <%= resolution%>})")(openjscadParameters)},Cylinder.prototype.evaluate=function(parentContext,inst){var context=new Context(parentContext),argnames=["h","r1","r2","center","$fn","$fa","$fs"],argexpr=[];context.args(argnames,argexpr,inst.argnames,inst.argvalues);var openjscadArgs={start:[0,0,0],end:[0,0,1],radiusStart:1,radiusEnd:1,resolution:Globals.DEFAULT_RESOLUTION},isCentered=Context.contextVariableLookup(context,"center",!1),h=Context.contextVariableLookup(context,"h",1),r=Context.contextVariableLookup(context,"r",1),r1=Context.contextVariableLookup(context,"r1",void 0),r2=Context.contextVariableLookup(context,"r2",void 0),startZ=isCentered?-(h/2):0,endZ=isCentered?h/2:h;if(openjscadArgs.start=[0,0,startZ],openjscadArgs.end=[0,0,endZ],_.has(context.vars,"r")&&(openjscadArgs.radiusStart=r,openjscadArgs.radiusEnd=r),_.has(context.vars,"r1")&&(openjscadArgs.radiusStart=r1),_.has(context.vars,"r2")&&(openjscadArgs.radiusEnd=r2),openjscadArgs.resolution=Context.get_fragments_from_r(Math.max(openjscadArgs.radiusStart,openjscadArgs.radiusEnd),context),0!=openjscadArgs.radiusStart||0!=openjscadArgs.radiusEnd)return _.template("CSG.cylinder({start: [<%=start%>], end: [<%=end%>],radiusStart: <%=radiusStart%>, radiusEnd: <%=radiusEnd%>, resolution: <%=resolution%>})")(openjscadArgs)},Cube.prototype.evaluate=function(parentContext,inst){var context=Context.newContext(parentContext,["size","center"],[],inst),openjscadArgs={resolution:Globals.DEFAULT_RESOLUTION},isCentered=Context.contextVariableLookup(context,"center",!1),size=Context.contextVariableLookup(context,"size",1);return size instanceof Array?openjscadArgs.radius=[size[0]/2,size[1]/2,size[2]/2]:openjscadArgs.radius=[size/2,size/2,size/2],isCentered?openjscadArgs.centerVector=[0,0,0]:openjscadArgs.centerVector=[openjscadArgs.radius[0],openjscadArgs.radius[1],openjscadArgs.radius[2]],_.template("CSG.cube({center: [<%=String(centerVector)%>],radius: [<%= radius %>], resolution: <%= resolution%>})")(openjscadArgs)},Circle.prototype.evaluate=function(parentContext,inst){var context=Context.newContext(parentContext,["r","$fn"],[],inst),r=Context.contextVariableLookup(context,"r",1),resolution=Context.get_fragments_from_r(r,context);return _.template("CAG.circle({center: [0,0], radius: <%=r%>, resolution: <%=resolution%>})")({r:r,resolution:resolution})},Square.prototype.evaluate=function(parentContext,inst){var context=Context.newContext(parentContext,["size","center"],[],inst),size=Context.contextVariableLookup(context,"size",[.5,.5]),center=Context.contextVariableLookup(context,"center",!1),radius=_.isArray(size)?radius=[size[0]/2,size[1]/2]:[size/2,size/2],centerPoint=[0,0];return center||(centerPoint=[size[0]/2,size[1]/2]),_.template("CAG.rectangle({center: [<%=centerPoint%>], radius: [<%=radius%>]})")({centerPoint:centerPoint,radius:radius})},Polygon.prototype.evaluate=function(parentContext,inst){function formatPoints(points){return _.map(points,function(x){return _.template("[<%=x%>]")({x:x})})}var context=Context.newContext(parentContext,["points","paths","convexity"],[],inst),points=Context.contextVariableLookup(context,"points",[]),paths=Context.contextVariableLookup(context,"paths",[]),pointsMap=[];if(_.isEmpty(paths))return _.template("CAG.fromPoints([<%=points%>])")({points:formatPoints(points)});if(paths.length>1){var lines="";_.each(_.first(paths),function(x){pointsMap.push(points[x])}),lines+=_.template("(new CSG.Path2D([<%=points%>],true)).innerToCAG().subtract([")({points:formatPoints(pointsMap)});var holes=[];return _.each(_.tail(paths),function(shape){pointsMap=[],_.each(shape,function(x){pointsMap.push(points[x])}),holes.push(_.template("(new CSG.Path2D([<%=points%>],true)).innerToCAG()")({points:formatPoints(pointsMap)}))}),lines+=holes.join(",")+"])"}return _.each(paths[0],function(x){pointsMap.push(points[x])}),_.template("(new CSG.Path2D([<%=points%>],true)).innerToCAG()")({points:formatPoints(pointsMap)})},Polyhedron.prototype.evaluate=function(parentContext,inst){var context=Context.newContext(parentContext,["points","triangles","convexity"],[],inst),points=Context.contextVariableLookup(context,"points",[]),triangles=Context.contextVariableLookup(context,"triangles",[]),polygons=[];return _.each(triangles,function(triangle){polygons.push(_.template("new CSG.Polygon([new CSG.Vertex(new CSG.Vector3D([<%=vec1%>])),new CSG.Vertex(new CSG.Vector3D([<%=vec2%>])),new CSG.Vertex(new CSG.Vector3D([<%=vec3%>]))])")({vec1:points[triangle[2]],vec2:points[triangle[1]],vec3:points[triangle[0]]}))}),_.template("CSG.fromPolygons([<%=polygons%>])")({polygons:polygons})},module.exports={Sphere:Sphere,Cube:Cube,Cylinder:Cylinder,Circle:Circle,Square:Square,Polygon:Polygon,Polyhedron:Polyhedron}},{"./Context":15,"./Globals":19,lodash:2}],28:[function(require,module,exports){function Range(begin,step,end){this.begin=begin,this.step=step,this.end=end}module.exports=Range},{}],29:[function(require,module,exports){function STL(data){var buf=new ArrayBuffer(data.length);this.data=new Uint8Array(buf);for(var i=0,dataLen=data.length;i>=1;mask=128;for(var j=0;j<8;j++)0!=(byteArray[2]&mask)&&(num+=1/Math.pow(2,j+8)),mask>>=1;mask=128;for(var k=0;k<8;k++)0!=(byteArray[2]&mask)&&(num+=1/Math.pow(2,k+16)),mask>>=1;return num+1},STL.prototype.readNormal=function(index){var sttPos=this.listNormal[index],endPos=this.findEndPos(sttPos),vString=this.bin2String(sttPos,endPos),pos=vString.indexOf(this.TYPE_NORMAL);vString=vString.substring(pos+this.TYPE_NORMAL.length+1,vString.length);for(var list=vString.split(" "),normal=new Array,i=0;i=0)for(this.dataType=this.TYPE_ASCII,this.listVertex=new Array,this.listNormal=new Array;endPos=0?this.listVertex.push(sttPos):str.indexOf(this.TYPE_NORMAL)>=0&&this.listNormal.push(sttPos),sttPos=endPos+1;else this.dataType=this.TYPE_BINARY;return this.dataType},STL.prototype.getCSG=function(){var numTriangles,csgPolygons=[];if(this.dataType==this.TYPE_BINARY?(this.pos=HDR_LEN,numTriangles=this.readUInt32()):(this.pos=0,numTriangles=this.listVertex.length/3),this.dataType==this.TYPE_BINARY)for(i=0;i]), 1)")({normal:normal}),0);j<3;j++){var x=this.readReal32(),y=this.readReal32(),z=this.readReal32();csgVertices.push(_.template("new CSG.Vertex(new CSG.Vector3D([<%=vertex%>]))")({vertex:[x,y,z]}))}this.pos+=2,csgPolygons.push(_.template("new CSG.Polygon([<%=vertices%>], null)")({vertices:csgVertices}))}else for(i=0;i]))")({vertex:vertex}))}csgPolygons.push(_.template("new CSG.Polygon([<%=vertices%>], null)")({vertices:csgVertices}))}return _.template("CSG.fromPolygons([<%=polygons%>])")({polygons:csgPolygons})},STL.prototype.drawWireFrame=function(context,w,h,mag,rX,rY,rZ){var numTriangles,i;if(this.dataType==this.TYPE_BINARY?(this.pos=HDR_LEN,numTriangles=this.readUInt32()):numTriangles=this.listVertex.length/3,this.dataType==this.TYPE_BINARY)for(i=0;i1?_.first(childModules)+".union(["+_.tail(childModules)+"])":void 0}}function ColorTransform(a){TransformModule.call(this,a)}function MirrorTransform(a){TransformModule.call(this,a)}function RotateTransform(a){TransformModule.call(this,a)}function ScaleTransform(a){TransformModule.call(this,a)}function TranslateTransform(a){TransformModule.call(this,a)}function RenderModule(a){TransformModule.call(this,a)}function MultimatrixTransform(a){TransformModule.call(this,a),this.transposeMatrix=function(m){var t=[],ti=0;for(var j in _.range(4))for(var i in _.range(4))t[ti++]=m[i][j];return t}}function ExtrudeTransform(a){TransformModule.call(this,a)}var _=require("lodash"),Context=require("./Context"),Globals=require("./Globals");ColorTransform.prototype.evaluate=function(parentContext,inst){inst.argvalues=[],_.each(inst.argexpr,function(expr,index,list){inst.argvalues.push(expr.evaluate(parentContext))});var context=Context.newContext(parentContext,["c","alpha"],[],inst),c=Context.contextVariableLookup(context,"c",void 0),color="white";void 0!==c&&(color=_.isString(c)?colorNameLookup[Globals.stripString(c.toLowerCase())]:c);var alpha=Context.contextVariableLookup(context,"alpha",void 0);return void 0!==alpha&&(color[3]=alpha),this.transformChildren(inst.children,context,function(){return _.template(".setColor(<%=color%>)")({color:color})})},MirrorTransform.prototype.evaluate=function(parentContext,inst){inst.argvalues=[],_.each(inst.argexpr,function(expr,index,list){inst.argvalues.push(expr.evaluate(parentContext))});var context=Context.newContext(parentContext,["v"],[],inst),v=Context.contextVariableLookup(context,"v",[0,0,0]);if(!(v instanceof Array)){var val=v;v=[val,val,val]}return this.transformChildren(inst.children,context,function(){return _.template(".mirrored(CSG.Plane.fromNormalAndPoint([<%=v%>], [0,0,0]))")({v:v})})},RotateTransform.prototype.evaluate=function(parentContext,inst){inst.argvalues=[],_.each(inst.argexpr,function(expr,index,list){inst.argvalues.push(expr.evaluate(parentContext))});var context=Context.newContext(parentContext,["a","v"],[],inst),a=Context.contextVariableLookup(context,"a",void 0);if(_.isArray(a))return this.transformChildren(inst.children,context,function(){return _.template(".rotateX(<%=degreeX%>).rotateY(<%=degreeY%>).rotateZ(<%=degreeZ%>)")({degreeX:a[0],degreeY:a[1],degreeZ:a[2]})});var v=Context.contextVariableLookup(context,"v",void 0);return this.transformChildren(inst.children,context,function(){return void 0!==v&&"0,0,0"!=v.toString()||(v=[0,0,1]),_.template(".transform(CSG.Matrix4x4.rotation([0,0,0], [<%=vector%>], <%=degree%>))")({degree:a,vector:v})})},ScaleTransform.prototype.evaluate=function(parentContext,inst){inst.argvalues=[],_.each(inst.argexpr,function(expr,index,list){inst.argvalues.push(expr.evaluate(parentContext))});var context=Context.newContext(parentContext,["v"],[],inst),v=Context.contextVariableLookup(context,"v",[0,0,0]);if(!(v instanceof Array)){var val=v;v=[val,val,val]}return this.transformChildren(inst.children,context,function(){return _.template(".scale([<%=v%>])")({v:v})})},TranslateTransform.prototype.evaluate=function(parentContext,inst){inst.argvalues=[],_.each(inst.argexpr,function(expr,index,list){inst.argvalues.push(expr.evaluate(parentContext))});var context=Context.newContext(parentContext,["v"],[],inst),v=Context.contextVariableLookup(context,"v",[0,0,0]);return this.transformChildren(inst.children,context,function(){return _.template(".translate([<%=v%>])")({v:v})})},RenderModule.prototype.evaluate=function(parentContext,inst){inst.argvalues=[],_.each(inst.argexpr,function(expr,index,list){inst.argvalues.push(expr.evaluate(parentContext))});var context=Context.newContext(parentContext,[],[],inst),childIndex=0;return void 0!==inst.argvalues[0]&&(childIndex=inst.argvalues[0]),this.transformChildren(inst.children,context,function(){return""})},MultimatrixTransform.prototype.evaluate=function(parentContext,inst){inst.argvalues=[],_.each(inst.argexpr,function(expr,index,list){inst.argvalues.push(expr.evaluate(parentContext))});var matrix,context=Context.newContext(parentContext,["m"],[],inst),m=Context.contextVariableLookup(context,"m",void 0);return void 0!==m&&(matrix=this.transposeMatrix(m)),this.transformChildren(inst.children,context,function(){return _.template(".transform(new CSG.Matrix4x4( [<%= matrix %>] ))")({matrix:matrix})})},ExtrudeTransform.prototype.evaluate=function(parentContext,inst){inst.argvalues=[],_.each(inst.argexpr,function(expr,index,list){inst.argvalues.push(expr.evaluate(parentContext))});var context=Context.newContext(parentContext,["file","layer","height","origin","scale","center","twist","slices","$fn","$fs","$fa"],[],inst),height=Context.contextVariableLookup(context,"height",100),center=Context.contextVariableLookup(context,"center",!1),twist=Number(Context.contextVariableLookup(context,"twist",0))/-1,slices=Context.contextVariableLookup(context,"slices",void 0);Context.contextVariableLookup(context,"$fn",Globals.FN_DEFAULT),Context.contextVariableLookup(context,"$fs",Globals.FS_DEFAULT),Context.contextVariableLookup(context,"$fa",Globals.FA_DEFAULT);return void 0===slices&&(slices=parseInt(Math.max(2,Math.abs(Context.get_fragments_from_r(height,context)*twist/360)))),this.transformChildren(inst.children,context,function(){var template=_.template(".extrude({offset: [0, 0, <%=height%>], twistangle: <%=twist%>,twiststeps: <%=slices%>})")({height:height,twist:twist,slices:slices});if(center){var offset=-height/2;template+=_.template(".translate([0,0,<%=offset%>])")({offset:offset})}return template})};var colorNameLookup={indianred:[.804,.361,.361],lightcoral:[.941,.502,.502],salmon:[.98,.502,.447],darksalmon:[.914,.588,.478],lightsalmon:[1,.627,.478],red:[1,0,0],crimson:[.863,.078,.235],firebrick:[.698,.133,.133],darkred:[.545,0,0],pink:[1,.753,.796],lightpink:[1,.714,.757],hotpink:[1,.412,.706],deeppink:[1,.078,.576],mediumvioletred:[.78,.082,.522],palevioletred:[.859,.439,.576],lightsalmon:[1,.627,.478],coral:[1,.498,.314],tomato:[1,.388,.278],orangered:[1,.271,0],darkorange:[1,.549,0],orange:[1,.647,0],gold:[1,.843,0],yellow:[1,1,0],lightyellow:[1,1,.878],lemonchiffon:[1,.98,.804],lightgoldenrodyellow:[.98,.98,.824],papayawhip:[1,.937,.835],moccasin:[1,.894,.71],peachpuff:[1,.855,.725],palegoldenrod:[.933,.91,.667],khaki:[.941,.902,.549],darkkhaki:[.741,.718,.42],lavender:[.902,.902,.98],thistle:[.847,.749,.847],plum:[.867,.627,.867],violet:[.933,.51,.933],orchid:[.855,.439,.839],fuchsia:[1,0,1],magenta:[1,0,1],mediumorchid:[.729,.333,.827],mediumpurple:[.576,.439,.859],blueviolet:[.541,.169,.886],darkviolet:[.58,0,.827],darkorchid:[.6,.196,.8],darkmagenta:[.545,0,.545],purple:[.502,0,.502],indigo:[.294,0,.51],darkslateblue:[.282,.239,.545],slateblue:[.416,.353,.804],mediumslateblue:[.482,.408,.933],greenyellow:[.678,1,.184],chartreuse:[.498,1,0],lawngreen:[.486,.988,0],lime:[0,1,0],limegreen:[.196,.804,.196],palegreen:[.596,.984,.596],lightgreen:[.565,.933,.565],mediumspringgreen:[0,.98,.604],springgreen:[0,1,.498],mediumseagreen:[.235,.702,.443],seagreen:[.18,.545,.341],forestgreen:[.133,.545,.133],green:[0,.502,0],darkgreen:[0,.392,0],yellowgreen:[.604,.804,.196],olivedrab:[.42,.557,.137],olive:[.502,.502,0],darkolivegreen:[.333,.42,.184],mediumaquamarine:[.4,.804,.667],darkseagreen:[.561,.737,.561],lightseagreen:[.125,.698,.667],darkcyan:[0,.545,.545],teal:[0,.502,.502],aqua:[0,1,1],cyan:[0,1,1],lightcyan:[.878,1,1],paleturquoise:[.686,.933,.933],aquamarine:[.498,1,.831],turquoise:[.251,.878,.816],mediumturquoise:[.282,.82,.8],darkturquoise:[0,.808,.82],cadetblue:[.373,.62,.627],steelblue:[.275,.51,.706],lightsteelblue:[.69,.769,.871],powderblue:[.69,.878,.902],lightblue:[.678,.847,.902],skyblue:[.529,.808,.922],lightskyblue:[.529,.808,.98],deepskyblue:[0,.749,1],dodgerblue:[.118,.565,1],cornflowerblue:[.392,.584,.929],royalblue:[.255,.412,.882],blue:[0,0,1],mediumblue:[0,0,.804],darkblue:[0,0,.545],navy:[0,0,.502],midnightblue:[.098,.098,.439],cornsilk:[1,.973,.863],blanchedalmond:[1,.922,.804],bisque:[1,.894,.769],navajowhite:[1,.871,.678],wheat:[.961,.871,.702],burlywood:[.871,.722,.529],tan:[.824,.706,.549],rosybrown:[.737,.561,.561],sandybrown:[.957,.643,.376],goldenrod:[.855,.647,.125],darkgoldenrod:[.722,.525,.043],peru:[.804,.522,.247],chocolate:[.824,.412,.118],saddlebrown:[.545,.271,.075],sienna:[.627,.322,.176],brown:[.647,.165,.165],maroon:[.502,0,0],white:[1,1,1],snow:[1,.98,.98],honeydew:[.941,1,.941],mintcream:[.961,1,.98],azure:[.941,1,1],aliceblue:[.941,.973,1],ghostwhite:[.973,.973,1],whitesmoke:[.961,.961,.961],seashell:[1,.961,.933],beige:[.961,.961,.863],oldlace:[.992,.961,.902],floralwhite:[1,.98,.941],ivory:[1,1,.941],antiquewhite:[.98,.922,.843],linen:[.98,.941,.902],lavenderblush:[1,.941,.961],mistyrose:[1,.894,.882],gainsboro:[.863,.863,.863],lightgrey:[.827,.827,.827],silver:[.753,.753,.753],darkgray:[.663,.663,.663],gray:[.502,.502,.502],dimgray:[.412,.412,.412],lightslategray:[.467,.533,.6],slategray:[.439,.502,.565],darkslategray:[.184,.31,.31],black:[0,0,0]};module.exports={Translate:TranslateTransform,Scale:ScaleTransform,Rotate:RotateTransform,Mirror:MirrorTransform,Color:ColorTransform,Render:RenderModule,Multimatrix:MultimatrixTransform,Extrude:ExtrudeTransform}},{"./Context":15,"./Globals":19,lodash:2}],31:[function(require,module,exports){function resetModule(){currmodule=new Module("root"),Globals.context_stack=[],Globals.module_stack=[]}function processModule(yy){var lines=[];lines.push("function main(){"),lines.push("\n");var context=void 0;context=void 0!==yy.context?yy.context:new Context,void 0!==yy.importCache&&context.setVariable("importCache",yy.importCache);var res=currmodule.evaluate(context),evaluatedLines=_.flatten(res);1==evaluatedLines.length?lines.push("return "+evaluatedLines[0]+";"):evaluatedLines.length>1&&(lines.push("return "+_.first(evaluatedLines)+".union(["),lines.push(_.tail(evaluatedLines)),lines.push("]);")),lines.push("};");var x={lines:lines,context:Globals.context_stack[Globals.context_stack.length-1]};return resetModule(),x}function stashModule(newName,newArgNames,newArgExpr){var p_currmodule=currmodule;Globals.module_stack.push(currmodule),currmodule=new Module(newName),p_currmodule.modules.push(currmodule),currmodule.argnames=newArgNames,currmodule.argexpr=newArgExpr}function popModule(){Globals.module_stack.length>0&&(currmodule=Globals.module_stack.pop())}function addModuleChild(child){currmodule.children.push(child)}function addModuleAssignmentVar(name,value){currmodule.assignments_var[name]=value}function addModuleFunction(name,expr,argnames,argexpr){var func=new FunctionDef;func.argnames=argnames,func.argexpr=argexpr,func.expr=expr,currmodule.functions[name]=func}var _=require("lodash"),Module=require("./Module"),Context=require("./Context"),Globals=require("./Globals"),FunctionDef=require("./FunctionDef"),currmodule=(require("./openscad-parser-support"),new Module("root"));module.exports={processModule:processModule,stashModule:stashModule,popModule:popModule,addModuleChild:addModuleChild,addModuleAssignmentVar:addModuleAssignmentVar,addModuleFunction:addModuleFunction}},{"./Context":15,"./FunctionDef":18,"./Globals":19,"./Module":22,"./openscad-parser-support":32,lodash:2}],32:[function(require,module,exports){!function(pool,math,width,chunks,significance,overflow,startdenom){function ARC4(key){var t,u,me=this,keylen=key.length,i=0,j=me.i=me.j=me.m=0;for(me.S=[],me.c=[],keylen||(key=[keylen++]);i=overflow;)n/=2,d/=2,x>>>=1;return(n+x)/d},seed},startdenom=math.pow(width,chunks),significance=math.pow(2,significance),overflow=2*significance,mixkey(math.random(),pool)}([],Math,256,6,52)},{}],33:[function(require,module,exports){(function(process){const ext=require("./openscad-parser-ext"),ArgContainer=require("./ArgContainer"),ArgsContainer=require("./ArgsContainer"),Expression=require("./Expression"),ModuleInstantiation=require("./ModuleInstantiation"),IfElseModuleInstantiation=require("./IfElseModuleInstantiation");var parser=function(){function Parser(){this.yy={}}var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9,10,15,16,21,22,26,31,32,33,34],$V1=[10,15,16,21,22,26,31,32,33,34],$V2=[2,7],$V3=[1,5],$V4=[1,20],$V5=[1,15],$V6=[1,16],$V7=[1,17],$V8=[1,18],$V9=[1,9,10,15,16,17,21,22,26,31,32,33,34],$Va=[9,10,15,16,17,21,22,26,31,32,33,34],$Vb=[1,24],$Vc=[1,30],$Vd=[1,29],$Ve=[1,9,10,15,16,17,21,22,26,28,31,32,33,34],$Vf=[1,44],$Vg=[1,51],$Vh=[1,50],$Vi=[1,41],$Vj=[1,42],$Vk=[1,43],$Vl=[1,45],$Vm=[1,46],$Vn=[1,47],$Vo=[1,48],$Vp=[1,49],$Vq=[14,57],$Vr=[2,70],$Vs=[1,55],$Vt=[10,17,26,31,32,33,34],$Vu=[10,15,16,26,31,32,33,34],$Vv=[2,65],$Vw=[1,62],$Vx=[1,67],$Vy=[1,65],$Vz=[1,64],$VA=[1,79],$VB=[1,66],$VC=[1,68],$VD=[1,69],$VE=[1,70],$VF=[1,71],$VG=[1,72],$VH=[1,73],$VI=[1,74],$VJ=[1,75],$VK=[1,76],$VL=[1,77],$VM=[1,78],$VN=[14,15,33,34,38,41,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57],$VO=[2,33],$VP=[1,80],$VQ=[2,62],$VR=[1,84],$VS=[1,90],$VT=[1,97],$VU=[43,57],$VV=[10,11,14,31,35,36,37,39,40,41,43,46,47],$VW=[14,15,42,43,46,47,48,49,50,51,52,53,54,55,56,57],$VX=[14,15,33,34,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57],$VY=[14,15,42,43,48,49,52,53,54,55,56,57],$VZ=[14,15,42,43,48,49,50,51,52,53,54,55,56,57],$V_=[2,61],parser={trace:function(){},yy:{},symbols_:{error:2,program:3,input:4,statement:5,inner_input:6,statement_begin:7,statement_end:8,TOK_MODULE:9,TOK_ID:10,"(":11,arguments_decl:12,optional_commas:13,")":14,";":15,"{":16,"}":17,module_instantiation:18,"=":19,expr:20,TOK_FUNCTION:21,BR:22,children_instantiation:23,module_instantiation_list:24,if_statement:25,TOK_IF:26,ifelse_statement:27,TOK_ELSE:28,single_module_instantiation:29,arguments_call:30,"!":31,"#":32,"%":33,"*":34,TOK_TRUE:35,TOK_FALSE:36,TOK_UNDEF:37,".":38,TOK_STRING:39,TOK_NUMBER:40,"[":41,":":42,"]":43,vector_expr:44,"/":45,"+":46,"-":47,"<":48,LE:49,EQ:50,NE:51,GE:52,">":53,AND:54,OR:55,"?":56,",":57,argument_decl:58,argument_call:59,$accept:0,$end:1},terminals_:{2:"error",9:"TOK_MODULE",10:"TOK_ID",11:"(",14:")",15:";",16:"{",17:"}",19:"=",21:"TOK_FUNCTION",22:"BR",26:"TOK_IF",28:"TOK_ELSE",31:"!",32:"#",33:"%",34:"*",35:"TOK_TRUE",36:"TOK_FALSE",37:"TOK_UNDEF",38:".",39:"TOK_STRING",40:"TOK_NUMBER",41:"[",42:":",43:"]",45:"/",46:"+",47:"-",48:"<",49:"LE",50:"EQ",51:"NE",52:"GE",53:">",54:"AND",55:"OR",56:"?",57:","},productions_:[0,[3,1],[4,0],[4,2],[6,0],[6,2],[5,2],[7,0],[7,6],[8,1],[8,3],[8,1],[8,4],[8,9],[8,1],[23,1],[23,3],[25,5],[27,1],[27,3],[18,2],[18,2],[18,1],[24,0],[24,2],[29,4],[29,2],[29,2],[29,2],[29,2],[20,1],[20,1],[20,1],[20,1],[20,3],[20,1],[20,1],[20,5],[20,7],[20,3],[20,4],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,3],[20,2],[20,2],[20,2],[20,3],[20,5],[20,4],[20,4],[13,2],[13,0],[44,1],[44,4],[12,0],[12,1],[12,4],[58,1],[58,3],[30,0],[30,1],[30,4],[59,1],[59,3]],performAction:function(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return ext.processModule(yy);case 8:ext.stashModule($$[$0-4],$$[$0-2].argnames,$$[$0-2].argexpr),delete $$[$0-2];break;case 9:break;case 10:ext.popModule();break;case 11:ext.addModuleChild($$[$0]);break;case 12:ext.addModuleAssignmentVar($$[$0-3],$$[$0-1]);break;case 13:ext.addModuleFunction($$[$0-7],$$[$0-1],$$[$0-5].argnames,$$[$0-5].argexpr),delete $$[$0-5];break;case 15:this.$=new ModuleInstantiation,$$[$0]&&this.$.children.push($$[$0]);break;case 16:case 20:this.$=$$[$0-1];break;case 17:if(this.$=new IfElseModuleInstantiation,this.$.argnames.push(""),this.$.argexpr.push($$[$0-2]),this.$)this.$.children=$$[$0].children;else for(var i=0;i<$$[$0].children.size();i++)delete $$[$0].children[i];delete $$[$0];break;case 18:case 22:case 54:this.$=$$[$0];break;case 19:if(this.$=$$[$0-2],this.$)this.$.else_children=$$[$0].children;else for(var i=0;i<$$[$0].children.size();i++)delete $$[$0].children[i];delete $$[$0];break;case 21:if(this.$=$$[$0-1],this.$)this.$.children=$$[$0].children;else for(var i=0;i<$$[$0].children.length;i++)delete $$[$0].children[i];delete $$[$0];break;case 23:this.$=new ModuleInstantiation;break;case 24:this.$=$$[$0-1],this.$?$$[$0]&&this.$.children.push($$[$0]):delete $$[$0];break;case 25:this.$=new ModuleInstantiation,this.$.name=$$[$0-3],this.$.argnames=$$[$0-1].argnames,this.$.argexpr=$$[$0-1].argexpr,delete $$[$0-1];break;case 26:this.$=$$[$0],this.$&&(this.$.tag_root=!0);break;case 27:this.$=$$[$0],this.$&&(this.$.tag_highlight=!0);break;case 28:delete $$[$0],this.$=void 0;break;case 29:delete $$[$0],this.$=void 0;break;case 30:this.$=new Expression(!0);break;case 31:this.$=new Expression(!1);break;case 32:this.$=new Expression(void 0);break;case 33:this.$=new Expression,this.$.type="L",this.$.var_name=$$[$0];break;case 34:this.$=new Expression,this.$.type="N",this.$.children.push($$[$0-2]),this.$.var_name=$$[$0];break;case 35:this.$=new Expression(String($$[$0]));break;case 36:this.$=new Expression(Number($$[$0]));break;case 37:var e_one=new Expression(1);this.$=new Expression,this.$.type="R",this.$.children.push($$[$0-3]),this.$.children.push(e_one),this.$.children.push($$[$0-1]);break;case 38:this.$=new Expression,this.$.type="R",this.$.children.push($$[$0-5]),this.$.children.push($$[$0-3]),this.$.children.push($$[$0-1]);break;case 39:this.$=new Expression([]);break;case 40:this.$=$$[$0-2];break;case 41:this.$=new Expression,this.$.type="*",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 42:this.$=new Expression,this.$.type="/",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 43:this.$=new Expression,this.$.type="%",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 44:this.$=new Expression,this.$.type="+",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 45:this.$=new Expression,this.$.type="-",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 46:this.$=new Expression,this.$.type="<",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 47:this.$=new Expression,this.$.type="<=",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 48:this.$=new Expression,this.$.type="==",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 49:this.$=new Expression,this.$.type="!=",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 50:this.$=new Expression,this.$.type=">=",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 51:this.$=new Expression,this.$.type=">",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 52:this.$=new Expression,this.$.type="&&",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 53:this.$=new Expression,this.$.type="||",this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 55:this.$=new Expression,this.$.type="I",this.$.children.push($$[$0]);break;case 56:this.$=new Expression,this.$.type="!",this.$.children.push($$[$0]);break;case 57:this.$=$$[$0-1];break;case 58:this.$=new Expression,this.$.type="?:",this.$.children.push($$[$0-4]),this.$.children.push($$[$0-2]),this.$.children.push($$[$0]);break;case 59:this.$=new Expression,this.$.type="[]",this.$.children.push($$[$0-3]),this.$.children.push($$[$0-1]);break;case 60:this.$=new Expression,this.$.type="F",this.$.call_funcname=$$[$0-3],this.$.call_argnames=$$[$0-1].argnames,this.$.children=$$[$0-1].argexpr,delete $$[$0-1];break;case 63:this.$=new Expression,this.$.type="V",this.$.children.push($$[$0]);break;case 64:this.$=$$[$0-3],this.$.children.push($$[$0]);break;case 65:case 70:this.$=new ArgsContainer;break;case 66:case 71:this.$=new ArgsContainer,this.$.argnames.push($$[$0].argname),this.$.argexpr.push($$[$0].argexpr),delete $$[$0];break;case 67:case 72:this.$=$$[$0-3],this.$.argnames.push($$[$0].argname),this.$.argexpr.push($$[$0].argexpr),delete $$[$0];break;case 68:this.$=new ArgContainer,this.$.argname=$$[$0],this.$.argexpr=void 0;break;case 69:case 74:this.$=new ArgContainer,this.$.argname=$$[$0-2],this.$.argexpr=$$[$0];break;case 73:this.$=new ArgContainer,this.$.argexpr=$$[$0]}},table:[o($V0,[2,2],{3:1,4:2}),{1:[3]},o($V1,$V2,{5:3,7:4,1:[2,1],9:$V3}),o($V0,[2,3]),{8:6,10:[1,10],15:[1,7],16:[1,8],18:9,21:[1,11],22:[1,12],25:19,26:$V4,27:14,29:13,31:$V5,32:$V6,33:$V7,34:$V8},{10:[1,21]},o($V9,[2,6]),o($V9,[2,9]),o($Va,[2,4],{6:22}),o($V9,[2,11]),{11:$Vb,19:[1,23]},{10:[1,25]},o($V9,[2,14]),{10:$Vc,15:[1,26],16:$Vd,18:28,23:27,25:19,26:$V4,27:14,29:13,31:$V5,32:$V6,33:$V7,34:$V8},o($Ve,[2,22]),{10:$Vc,29:31,31:$V5,32:$V6,33:$V7,34:$V8},{10:$Vc,29:32,31:$V5,32:$V6,33:$V7,34:$V8},{10:$Vc,29:33,31:$V5,32:$V6,33:$V7,34:$V8},{10:$Vc,29:34,31:$V5,32:$V6,33:$V7,34:$V8},o($V9,[2,18],{28:[1,35]}),{11:[1,36]},{11:[1,37]},o($V1,$V2,{7:4,5:39,9:$V3,17:[1,38]}),{10:$Vf,11:$Vg,20:40,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},o($Vq,$Vr,{30:52,59:53,20:54,10:$Vs,11:$Vg,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp}),{11:[1,56]},o($Ve,[2,20]),o($Ve,[2,21]),o($Ve,[2,15]),o($Vt,[2,23],{24:57}),{11:$Vb},o($Vu,[2,26]),o($Vu,[2,27]),o($Vu,[2,28]),o($Vu,[2,29]),{10:$Vc,16:$Vd,18:28,23:58,25:19,26:$V4,27:14,29:13,31:$V5,32:$V6,33:$V7,34:$V8},{10:$Vf,11:$Vg,20:59,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},o($Vq,$Vv,{12:60,58:61,10:$Vw}),o($V9,[2,10]),o($Va,[2,5]),{15:[1,63],33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM},o($VN,[2,30]),o($VN,[2,31]),o($VN,[2,32]),o($VN,$VO,{11:$VP}),o($VN,[2,35]),o($VN,[2,36]),{10:$Vf,11:$Vg,13:82,20:81,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,43:$VQ,44:83,46:$Vo,47:$Vp,57:$VR},{10:$Vf,11:$Vg,20:85,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:86,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:87,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:88,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{14:[1,89],57:$VS},o($Vq,[2,71]),o($Vq,[2,73],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM}),o([14,33,34,38,41,45,46,47,48,49,50,51,52,53,54,55,56,57],$VO,{11:$VP,19:[1,91]}),o($Vq,$Vv,{58:61,12:92,10:$Vw}),{10:$Vc,17:[1,93],18:94,25:19,26:$V4,27:14,29:13,31:$V5,32:$V6,33:$V7,34:$V8},o($Ve,[2,19]),{14:[1,95],33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM},{13:96,14:$VQ,57:$VT},o($Vq,[2,66]),o($Vq,[2,68],{19:[1,98]}),o($V9,[2,12]),{10:[1,99]},{10:$Vf,11:$Vg,20:100,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:101,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:102,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:103,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:104,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:105,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:106,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:107,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:108,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:109,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:110,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:111,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:112,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:113,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{10:$Vf,11:$Vg,20:114,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},o($Vq,$Vr,{59:53,20:54,30:115,10:$Vs,11:$Vg,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp}),o($VU,[2,63],{33:$Vx,34:$Vy,38:$Vz,41:$VA,42:[1,116],45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM}),{43:[1,117] },{13:118,43:$VQ,57:[1,119]},o($VV,$VQ,{13:120,57:$VR}),o($VW,[2,54],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB}),o($VW,[2,55],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB}),o($VW,[2,56],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB}),{14:[1,121],33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM},o($Vu,[2,25]),o([10,11,31,35,36,37,39,40,41,46,47],$VQ,{13:122,57:$VR}),{10:$Vf,11:$Vg,20:123,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{13:124,14:$VQ,57:$VT},o($Ve,[2,16]),o($Vt,[2,24]),{10:$Vc,16:$Vd,18:28,23:125,25:19,26:$V4,27:14,29:13,31:$V5,32:$V6,33:$V7,34:$V8},{14:[1,126]},o([10,14],$VQ,{13:127,57:$VR}),{10:$Vf,11:$Vg,20:128,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},o($VN,[2,34]),o($VX,[2,41],{38:$Vz,41:$VA}),o($VX,[2,42],{38:$Vz,41:$VA}),o($VX,[2,43],{38:$Vz,41:$VA}),o($VW,[2,44],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB}),o($VW,[2,45],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB}),o($VY,[2,46],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,50:$VG,51:$VH}),o($VY,[2,47],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,50:$VG,51:$VH}),o($VZ,[2,48],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD}),o($VZ,[2,49],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD}),o($VY,[2,50],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,50:$VG,51:$VH}),o($VY,[2,51],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,50:$VG,51:$VH}),o([14,15,42,43,54,55,56,57],[2,52],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ}),o([14,15,42,43,55,56,57],[2,53],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK}),{33:$Vx,34:$Vy,38:$Vz,41:$VA,42:[1,129],45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM},{33:$Vx,34:$Vy,38:$Vz,41:$VA,43:[1,130],45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM},{14:[1,131],57:$VS},{10:$Vf,11:$Vg,20:132,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},o($VN,[2,39]),{43:[1,133]},o([10,11,31,35,36,37,39,40,41,43,46,47],$VQ,{13:134,57:$VR}),o($VV,$V_),o($VN,[2,57]),{10:$Vs,11:$Vg,20:54,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp,59:135},o($Vq,[2,74],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM}),{14:[1,136]},o($Ve,[2,17]),o($V1,[2,8]),{10:$Vw,14:$V_,58:137},o($Vq,[2,69],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM}),{10:$Vf,11:$Vg,20:138,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},o($VN,[2,59]),o($VN,[2,60]),{33:$Vx,34:$Vy,38:$Vz,41:$VA,42:[1,140],43:[1,139],45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM},o($VN,[2,40]),{10:$Vf,11:$Vg,20:141,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,43:$V_,46:$Vo,47:$Vp},o($Vq,[2,72]),{19:[1,142]},o($Vq,[2,67]),o([14,15,42,43,57],[2,58],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM}),o($VN,[2,37]),{10:$Vf,11:$Vg,20:143,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},o($VU,[2,64],{33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM}),{10:$Vf,11:$Vg,20:144,31:$Vh,35:$Vi,36:$Vj,37:$Vk,39:$Vl,40:$Vm,41:$Vn,46:$Vo,47:$Vp},{33:$Vx,34:$Vy,38:$Vz,41:$VA,43:[1,145],45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM},{15:[1,146],33:$Vx,34:$Vy,38:$Vz,41:$VA,45:$VB,46:$VC,47:$VD,48:$VE,49:$VF,50:$VG,51:$VH,52:$VI,53:$VJ,54:$VK,55:$VL,56:$VM},o($VN,[2,38]),o($V9,[2,13])],defaultActions:{},parseError:function(str,hash){function _parseError(msg,hash){this.message=msg,this.hash=hash}if(!hash.recoverable)throw _parseError.prototype=Error,new _parseError(str,hash);this.trace(str)},parse:function(input){var self=this,stack=[0],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,recovering=0,TERROR=2,EOF=1,args=lstack.slice.call(arguments,1),lexer=Object.create(this.lexer),sharedState={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(sharedState.yy[k]=this.yy[k]);lexer.setInput(input,sharedState.yy),sharedState.yy.lexer=lexer,sharedState.yy.parser=this,"undefined"==typeof lexer.yylloc&&(lexer.yylloc={});var yyloc=lexer.yylloc;lstack.push(yyloc);var ranges=lexer.options&&lexer.options.ranges;"function"==typeof sharedState.yy.parseError?this.parseError=sharedState.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var symbol,preErrorSymbol,state,action,r,p,len,newState,expected,lex=function(){var token;return token=lexer.lex()||EOF,"number"!=typeof token&&(token=self.symbols_[token]||token),token},yyval={};;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:(null!==symbol&&"undefined"!=typeof symbol||(symbol=lex()),action=table[state]&&table[state][symbol]),"undefined"==typeof action||!action.length||!action[0]){var errStr="";expected=[];for(p in table[state])this.terminals_[p]&&p>TERROR&&expected.push("'"+this.terminals_[p]+"'");errStr=lexer.showPosition?"Parse error on line "+(yylineno+1)+":\n"+lexer.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(symbol==EOF?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:lexer.match,token:this.terminals_[symbol]||symbol,line:lexer.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(lexer.yytext),lstack.push(lexer.yylloc),stack.push(action[1]),symbol=null,preErrorSymbol?(symbol=preErrorSymbol,preErrorSymbol=null):(yyleng=lexer.yyleng,yytext=lexer.yytext,yylineno=lexer.yylineno,yyloc=lexer.yylloc,recovering>0&&recovering--);break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args)),"undefined"!=typeof r)return r;len&&(stack=stack.slice(0,-1*len*2),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0}},lexer=function(){var lexer={EOF:1,parseError:function(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},setInput:function(input,yy){return this.yy=yy||this.yy||{},this._input=input,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var ch=this._input[0];this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch;var lines=ch.match(/(?:\r\n?|\n).*/g);return lines?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ch},unput:function(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len),this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),lines.length-1&&(this.yylineno-=lines.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},test_match:function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer&&(backup={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(backup.yylloc.range=this.yylloc.range.slice(0))),lines=match[0].match(/(?:\r\n?|\n).*/g),lines&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token)return token;if(this._backtrack){for(var k in backup)this[k]=backup[k];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var token,match,tempMatch,index;this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;imatch[0].length)){if(match=tempMatch,index=i,this.options.backtrack_lexer){if(token=this.test_match(tempMatch,rules[i]),token!==!1)return token;if(this._backtrack){match=!1;continue}return!1}if(!this.options.flex)break}return match?(token=this.test_match(match,rules[index]),token!==!1&&token):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r?r:this.lex()},begin:function(condition){this.conditionStack.push(condition)},popState:function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},pushState:function(condition){this.begin(condition)},stateStackSize:function(){return this.conditionStack.length},options:{flex:!0},performAction:function(yy,yy_,$avoiding_name_collisions,YY_START){switch($avoiding_name_collisions){case 0:this.begin("cond_include");break;case 1:yy.filepath=yy_.yytext;break;case 2:yy.filename=yy_.yytext;break;case 3:this.popState();break;case 4:this.begin("cond_use");break;case 5:yy.filename=yy_.yytext;break;case 6:this.popState();break;case 7:return 9;case 8:return 21;case 9:return 26;case 10:return 28;case 11:return 35;case 12:return 36;case 13:return 37;case 14:stringcontents+=" ";break;case 15:stringcontents+="\n";break;case 16:stringcontents+='"';break;case 17:stringcontents+="\r";break;case 18:stringcontents+="\\";break;case 19:stringcontents+="\0";break;case 20:stringcontents+="a";break;case 21:stringcontents+="\b";break;case 22:stringcontents+="\t";break;case 23:stringcontents+="\n";break;case 24:stringcontents+="\v";break;case 25:stringcontents+="\f";break;case 26:stringcontents+="e";break;case 27:stringcontents+=yy_.yytext;break;case 28:return this.popState(),yy_.yytext=stringcontents,39;case 29:this.begin("cond_string"),stringcontents="";break;case 30:break;case 31:break;case 32:break;case 33:break;case 34:return 40;case 35:return 40;case 36:return 40;case 37:return 10;case 38:return 49;case 39:return 52;case 40:return 50;case 41:return 51;case 42:return 54;case 43:return 55;case 44:return yy_.yytext;case 45:console.log(yy_.yytext)}},rules:[/^(?:include[ \t\r\n>]*<)/,/^(?:[^\t\r\n>]*\/)/,/^(?:[^\t\r\n>\/]+)/,/^(?:>)/,/^(?:use[ \t\r\n>]*<)/,/^(?:[^\t\r\n>]+)/,/^(?:>)/,/^(?:module)/,/^(?:function)/,/^(?:if)/,/^(?:else)/,/^(?:true)/,/^(?:false)/,/^(?:undef)/,/^(?:\\t)/,/^(?:\\n)/,/^(?:\\")/,/^(?:\\r)/,/^(?:\\\\)/,/^(?:\\0)/,/^(?:\\a)/,/^(?:\\b)/,/^(?:\\t)/,/^(?:\\n)/,/^(?:\\v)/,/^(?:\\f)/,/^(?:\\e)/,/^(?:[^\\\n\"]+)/,/^(?:")/,/^(?:[\"])/,/^(?:[\n])/,/^(?:[\r\t ])/,/^(?:\/\/[^\n]*\n?)/,/^(?:\/\*.+\*\/)/,/^(?:([0-9])*\.([0-9])+([Ee][+-]?([0-9])+)?)/,/^(?:([0-9])+\.([0-9])*([Ee][+-]?([0-9])+)?)/,/^(?:([0-9])+([Ee][+-]?([0-9])+)?)/,/^(?:\$?[a-zA-Z0-9_]+)/,/^(?:<=)/,/^(?:>=)/,/^(?:==)/,/^(?:!=)/,/^(?:&&)/,/^(?:\|\|)/,/^(?:.)/,/^(?:.)/],conditions:{cond_include:{rules:[0,1,2,3,4,7,8,9,10,11,12,13,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},cond_use:{rules:[0,4,5,6,7,8,9,10,11,12,13,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},cond_comment:{rules:[0,4,7,8,9,10,11,12,13,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},cond_string:{rules:[0,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},cond_import:{rules:[0,4,7,8,9,10,11,12,13,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},INITIAL:{rules:[0,4,7,8,9,10,11,12,13,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}};return lexer}();return parser.lexer=lexer,Parser.prototype=parser,parser.Parser=Parser,new Parser}();"undefined"!=typeof require&&"undefined"!=typeof exports&&(exports.parser=parser,exports.Parser=parser.Parser,exports.parse=function(){return parser.parse.apply(parser,arguments)},exports.main=function(args){args[1]||(console.log("Usage: "+args[0]+" FILE"),process.exit(1));var source=require("fs").readFileSync(require("path").normalize(args[1]),"utf8");return exports.parser.parse(source)},"undefined"!=typeof module&&require.main===module&&exports.main(process.argv.slice(1)))}).call(this,require("_process"))},{"./ArgContainer":11,"./ArgsContainer":12,"./Expression":17,"./IfElseModuleInstantiation":20,"./ModuleInstantiation":24,"./openscad-parser-ext":31,_process:4,fs:1,path:3}],34:[function(require,module,exports){var parser=require("./parserCJS"),Globals=require("./Globals");module.exports={parse:function(text){void 0===parser.yy&&(parser.yy={});var openSCADText=Globals.preParse(text),openJSCADResult=parser.parse(openSCADText);return openJSCADResult.lines.join("\n")}}},{"./Globals":19,"./parserCJS":33}]},{},[34])(34)});