Skip to content

Instantly share code, notes, and snippets.

@sethvincent
Created August 1, 2015 04:12
Show Gist options
  • Save sethvincent/886dbb9589b5f3642bdd to your computer and use it in GitHub Desktop.
Save sethvincent/886dbb9589b5f3642bdd to your computer and use it in GitHub Desktop.
requirebin sketch
var diff = require('virtual-dom/diff')
var patch = require('virtual-dom/patch')
var createElement = require('virtual-dom/create-element')
var raf = require('raf')
var dataCards = require('data-cards')({
height: window.innerHeight - 100,
rowHeight: 200
})
function render () {
return dataCards.render()
}
var i = 0
setInterval(function() {
dataCards.write({
title: 'this is title ' + i,
description: 'this has long text that cuts off its cool this has long text that cuts off its cool this has long text that cuts off its cool this has long text that cuts off its cool this has long text that cuts off its cool ',
someField: 'this is a field',
another: '123123'
})
i++
}, 1000)
var tree = render()
var rootNode = createElement(tree)
document.body.appendChild(rootNode)
raf(function tick () {
var newTree = render()
var patches = diff(tree, newTree)
rootNode = patch(rootNode, patches)
tree = newTree
raf(tick)
})
require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&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}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";module.exports=function isObject(x){return typeof x==="object"&&x!==null}},{}],2:[function(require,module,exports){var nativeIsArray=Array.isArray;var toString=Object.prototype.toString;module.exports=nativeIsArray||isArray;function isArray(obj){return toString.call(obj)==="[object Array]"}},{}],3:[function(require,module,exports){var isVNode=require("./is-vnode");var isVText=require("./is-vtext");var isWidget=require("./is-widget");var isThunk=require("./is-thunk");module.exports=handleThunk;function handleThunk(a,b){var renderedA=a;var renderedB=b;if(isThunk(b)){renderedB=renderThunk(b,a)}if(isThunk(a)){renderedA=renderThunk(a,null)}return{a:renderedA,b:renderedB}}function renderThunk(thunk,previous){var renderedThunk=thunk.vnode;if(!renderedThunk){renderedThunk=thunk.vnode=thunk.render(previous)}if(!(isVNode(renderedThunk)||isVText(renderedThunk)||isWidget(renderedThunk))){throw new Error("thunk did not return a valid node")}return renderedThunk}},{"./is-thunk":4,"./is-vnode":6,"./is-vtext":7,"./is-widget":8}],4:[function(require,module,exports){module.exports=isThunk;function isThunk(t){return t&&t.type==="Thunk"}},{}],5:[function(require,module,exports){module.exports=isHook;function isHook(hook){return hook&&(typeof hook.hook==="function"&&!hook.hasOwnProperty("hook")||typeof hook.unhook==="function"&&!hook.hasOwnProperty("unhook"))}},{}],6:[function(require,module,exports){var version=require("./version");module.exports=isVirtualNode;function isVirtualNode(x){return x&&x.type==="VirtualNode"&&x.version===version}},{"./version":9}],7:[function(require,module,exports){var version=require("./version");module.exports=isVirtualText;function isVirtualText(x){return x&&x.type==="VirtualText"&&x.version===version}},{"./version":9}],8:[function(require,module,exports){module.exports=isWidget;function isWidget(w){return w&&w.type==="Widget"}},{}],9:[function(require,module,exports){module.exports="2"},{}],10:[function(require,module,exports){var version=require("./version");VirtualPatch.NONE=0;VirtualPatch.VTEXT=1;VirtualPatch.VNODE=2;VirtualPatch.WIDGET=3;VirtualPatch.PROPS=4;VirtualPatch.ORDER=5;VirtualPatch.INSERT=6;VirtualPatch.REMOVE=7;VirtualPatch.THUNK=8;module.exports=VirtualPatch;function VirtualPatch(type,vNode,patch){this.type=Number(type);this.vNode=vNode;this.patch=patch}VirtualPatch.prototype.version=version;VirtualPatch.prototype.type="VirtualPatch"},{"./version":9}],11:[function(require,module,exports){var isObject=require("is-object");var isHook=require("../vnode/is-vhook");module.exports=diffProps;function diffProps(a,b){var diff;for(var aKey in a){if(!(aKey in b)){diff=diff||{};diff[aKey]=undefined}var aValue=a[aKey];var bValue=b[aKey];if(aValue===bValue){continue}else if(isObject(aValue)&&isObject(bValue)){if(getPrototype(bValue)!==getPrototype(aValue)){diff=diff||{};diff[aKey]=bValue}else if(isHook(bValue)){diff=diff||{};diff[aKey]=bValue}else{var objectDiff=diffProps(aValue,bValue);if(objectDiff){diff=diff||{};diff[aKey]=objectDiff}}}else{diff=diff||{};diff[aKey]=bValue}}for(var bKey in b){if(!(bKey in a)){diff=diff||{};diff[bKey]=b[bKey]}}return diff}function getPrototype(value){if(Object.getPrototypeOf){return Object.getPrototypeOf(value)}else if(value.__proto__){return value.__proto__}else if(value.constructor){return value.constructor.prototype}}},{"../vnode/is-vhook":5,"is-object":1}],12:[function(require,module,exports){var isArray=require("x-is-array");var VPatch=require("../vnode/vpatch");var isVNode=require("../vnode/is-vnode");var isVText=require("../vnode/is-vtext");var isWidget=require("../vnode/is-widget");var isThunk=require("../vnode/is-thunk");var handleThunk=require("../vnode/handle-thunk");var diffProps=require("./diff-props");module.exports=diff;function diff(a,b){var patch={a:a};walk(a,b,patch,0);return patch}function walk(a,b,patch,index){if(a===b){return}var apply=patch[index];var applyClear=false;if(isThunk(a)||isThunk(b)){thunks(a,b,patch,index)}else if(b==null){if(!isWidget(a)){clearState(a,patch,index);apply=patch[index]}apply=appendPatch(apply,new VPatch(VPatch.REMOVE,a,b))}else if(isVNode(b)){if(isVNode(a)){if(a.tagName===b.tagName&&a.namespace===b.namespace&&a.key===b.key){var propsPatch=diffProps(a.properties,b.properties);if(propsPatch){apply=appendPatch(apply,new VPatch(VPatch.PROPS,a,propsPatch))}apply=diffChildren(a,b,patch,apply,index)}else{apply=appendPatch(apply,new VPatch(VPatch.VNODE,a,b));applyClear=true}}else{apply=appendPatch(apply,new VPatch(VPatch.VNODE,a,b));applyClear=true}}else if(isVText(b)){if(!isVText(a)){apply=appendPatch(apply,new VPatch(VPatch.VTEXT,a,b));applyClear=true}else if(a.text!==b.text){apply=appendPatch(apply,new VPatch(VPatch.VTEXT,a,b))}}else if(isWidget(b)){if(!isWidget(a)){applyClear=true}apply=appendPatch(apply,new VPatch(VPatch.WIDGET,a,b))}if(apply){patch[index]=apply}if(applyClear){clearState(a,patch,index)}}function diffChildren(a,b,patch,apply,index){var aChildren=a.children;var orderedSet=reorder(aChildren,b.children);var bChildren=orderedSet.children;var aLen=aChildren.length;var bLen=bChildren.length;var len=aLen>bLen?aLen:bLen;for(var i=0;i<len;i++){var leftNode=aChildren[i];var rightNode=bChildren[i];index+=1;if(!leftNode){if(rightNode){apply=appendPatch(apply,new VPatch(VPatch.INSERT,null,rightNode))}}else{walk(leftNode,rightNode,patch,index)}if(isVNode(leftNode)&&leftNode.count){index+=leftNode.count}}if(orderedSet.moves){apply=appendPatch(apply,new VPatch(VPatch.ORDER,a,orderedSet.moves))}return apply}function clearState(vNode,patch,index){unhook(vNode,patch,index);destroyWidgets(vNode,patch,index)}function destroyWidgets(vNode,patch,index){if(isWidget(vNode)){if(typeof vNode.destroy==="function"){patch[index]=appendPatch(patch[index],new VPatch(VPatch.REMOVE,vNode,null))}}else if(isVNode(vNode)&&(vNode.hasWidgets||vNode.hasThunks)){var children=vNode.children;var len=children.length;for(var i=0;i<len;i++){var child=children[i];index+=1;destroyWidgets(child,patch,index);if(isVNode(child)&&child.count){index+=child.count}}}else if(isThunk(vNode)){thunks(vNode,null,patch,index)}}function thunks(a,b,patch,index){var nodes=handleThunk(a,b);var thunkPatch=diff(nodes.a,nodes.b);if(hasPatches(thunkPatch)){patch[index]=new VPatch(VPatch.THUNK,null,thunkPatch)}}function hasPatches(patch){for(var index in patch){if(index!=="a"){return true}}return false}function unhook(vNode,patch,index){if(isVNode(vNode)){if(vNode.hooks){patch[index]=appendPatch(patch[index],new VPatch(VPatch.PROPS,vNode,undefinedKeys(vNode.hooks)))}if(vNode.descendantHooks||vNode.hasThunks){var children=vNode.children;var len=children.length;for(var i=0;i<len;i++){var child=children[i];index+=1;unhook(child,patch,index);if(isVNode(child)&&child.count){index+=child.count}}}}else if(isThunk(vNode)){thunks(vNode,null,patch,index)}}function undefinedKeys(obj){var result={};for(var key in obj){result[key]=undefined}return result}function reorder(aChildren,bChildren){var bChildIndex=keyIndex(bChildren);var bKeys=bChildIndex.keys;var bFree=bChildIndex.free;if(bFree.length===bChildren.length){return{children:bChildren,moves:null}}var aChildIndex=keyIndex(aChildren);var aKeys=aChildIndex.keys;var aFree=aChildIndex.free;if(aFree.length===aChildren.length){return{children:bChildren,moves:null}}var newChildren=[];var freeIndex=0;var freeCount=bFree.length;var deletedItems=0;for(var i=0;i<aChildren.length;i++){var aItem=aChildren[i];var itemIndex;if(aItem.key){if(bKeys.hasOwnProperty(aItem.key)){itemIndex=bKeys[aItem.key];newChildren.push(bChildren[itemIndex])}else{itemIndex=i-deletedItems++;newChildren.push(null)}}else{if(freeIndex<freeCount){itemIndex=bFree[freeIndex++];newChildren.push(bChildren[itemIndex])}else{itemIndex=i-deletedItems++;newChildren.push(null)}}}var lastFreeIndex=freeIndex>=bFree.length?bChildren.length:bFree[freeIndex];for(var j=0;j<bChildren.length;j++){var newItem=bChildren[j];if(newItem.key){if(!aKeys.hasOwnProperty(newItem.key)){newChildren.push(newItem)}}else if(j>=lastFreeIndex){newChildren.push(newItem)}}var simulate=newChildren.slice();var simulateIndex=0;var removes=[];var inserts=[];var simulateItem;for(var k=0;k<bChildren.length;){var wantedItem=bChildren[k];simulateItem=simulate[simulateIndex];while(simulateItem===null&&simulate.length){removes.push(remove(simulate,simulateIndex,null));simulateItem=simulate[simulateIndex]}if(!simulateItem||simulateItem.key!==wantedItem.key){if(wantedItem.key){if(simulateItem&&simulateItem.key){if(bKeys[simulateItem.key]!==k+1){removes.push(remove(simulate,simulateIndex,simulateItem.key));simulateItem=simulate[simulateIndex];if(!simulateItem||simulateItem.key!==wantedItem.key){inserts.push({key:wantedItem.key,to:k})}else{simulateIndex++}}else{inserts.push({key:wantedItem.key,to:k})}}else{inserts.push({key:wantedItem.key,to:k})}k++}else if(simulateItem&&simulateItem.key){removes.push(remove(simulate,simulateIndex,simulateItem.key))}}else{simulateIndex++;k++}}while(simulateIndex<simulate.length){simulateItem=simulate[simulateIndex];removes.push(remove(simulate,simulateIndex,simulateItem&&simulateItem.key))}if(removes.length===deletedItems&&!inserts.length){return{children:newChildren,moves:null}}return{children:newChildren,moves:{removes:removes,inserts:inserts}}}function remove(arr,index,key){arr.splice(index,1);return{from:index,key:key}}function keyIndex(children){var keys={};var free=[];var length=children.length;for(var i=0;i<length;i++){var child=children[i];if(child.key){keys[child.key]=i}else{free.push(i)}}return{keys:keys,free:free}}function appendPatch(apply,patch){if(apply){if(isArray(apply)){apply.push(patch)}else{apply=[apply,patch]}return apply}else{return patch}}},{"../vnode/handle-thunk":3,"../vnode/is-thunk":4,"../vnode/is-vnode":6,"../vnode/is-vtext":7,"../vnode/is-widget":8,"../vnode/vpatch":10,"./diff-props":11,"x-is-array":2}],"virtual-dom/diff":[function(require,module,exports){var diff=require("./vtree/diff.js");module.exports=diff},{"./vtree/diff.js":12}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&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}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){(function(global){var topLevel=typeof global!=="undefined"?global:typeof window!=="undefined"?window:{};var minDoc=require("min-document");if(typeof document!=="undefined"){module.exports=document}else{var doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"];if(!doccy){doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"]=minDoc}module.exports=doccy}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"min-document":1}],3:[function(require,module,exports){"use strict";module.exports=function isObject(x){return typeof x==="object"&&x!==null}},{}],4:[function(require,module,exports){var nativeIsArray=Array.isArray;var toString=Object.prototype.toString;module.exports=nativeIsArray||isArray;function isArray(obj){return toString.call(obj)==="[object Array]"}},{}],5:[function(require,module,exports){var isObject=require("is-object");var isHook=require("../vnode/is-vhook.js");module.exports=applyProperties;function applyProperties(node,props,previous){for(var propName in props){var propValue=props[propName];if(propValue===undefined){removeProperty(node,propName,propValue,previous)}else if(isHook(propValue)){removeProperty(node,propName,propValue,previous);if(propValue.hook){propValue.hook(node,propName,previous?previous[propName]:undefined)}}else{if(isObject(propValue)){patchObject(node,props,previous,propName,propValue)}else{node[propName]=propValue}}}}function removeProperty(node,propName,propValue,previous){if(previous){var previousValue=previous[propName];if(!isHook(previousValue)){if(propName==="attributes"){for(var attrName in previousValue){node.removeAttribute(attrName)}}else if(propName==="style"){for(var i in previousValue){node.style[i]=""}}else if(typeof previousValue==="string"){node[propName]=""}else{node[propName]=null}}else if(previousValue.unhook){previousValue.unhook(node,propName,propValue)}}}function patchObject(node,props,previous,propName,propValue){var previousValue=previous?previous[propName]:undefined;if(propName==="attributes"){for(var attrName in propValue){var attrValue=propValue[attrName];if(attrValue===undefined){node.removeAttribute(attrName)}else{node.setAttribute(attrName,attrValue)}}return}if(previousValue&&isObject(previousValue)&&getPrototype(previousValue)!==getPrototype(propValue)){node[propName]=propValue;return}if(!isObject(node[propName])){node[propName]={}}var replacer=propName==="style"?"":undefined;for(var k in propValue){var value=propValue[k];node[propName][k]=value===undefined?replacer:value}}function getPrototype(value){if(Object.getPrototypeOf){return Object.getPrototypeOf(value)}else if(value.__proto__){return value.__proto__}else if(value.constructor){return value.constructor.prototype}}},{"../vnode/is-vhook.js":13,"is-object":3}],6:[function(require,module,exports){var document=require("global/document");var applyProperties=require("./apply-properties");var isVNode=require("../vnode/is-vnode.js");var isVText=require("../vnode/is-vtext.js");var isWidget=require("../vnode/is-widget.js");var handleThunk=require("../vnode/handle-thunk.js");module.exports=createElement;function createElement(vnode,opts){var doc=opts?opts.document||document:document;var warn=opts?opts.warn:null;vnode=handleThunk(vnode).a;if(isWidget(vnode)){return vnode.init()}else if(isVText(vnode)){return doc.createTextNode(vnode.text)}else if(!isVNode(vnode)){if(warn){warn("Item is not a valid virtual dom node",vnode)}return null}var node=vnode.namespace===null?doc.createElement(vnode.tagName):doc.createElementNS(vnode.namespace,vnode.tagName);var props=vnode.properties;applyProperties(node,props);var children=vnode.children;for(var i=0;i<children.length;i++){var childNode=createElement(children[i],opts);if(childNode){node.appendChild(childNode)}}return node}},{"../vnode/handle-thunk.js":11,"../vnode/is-vnode.js":14,"../vnode/is-vtext.js":15,"../vnode/is-widget.js":16,"./apply-properties":5,"global/document":2}],7:[function(require,module,exports){var noChild={};module.exports=domIndex;function domIndex(rootNode,tree,indices,nodes){if(!indices||indices.length===0){return{}}else{indices.sort(ascending);return recurse(rootNode,tree,indices,nodes,0)}}function recurse(rootNode,tree,indices,nodes,rootIndex){nodes=nodes||{};if(rootNode){if(indexInRange(indices,rootIndex,rootIndex)){nodes[rootIndex]=rootNode}var vChildren=tree.children;if(vChildren){var childNodes=rootNode.childNodes;for(var i=0;i<tree.children.length;i++){rootIndex+=1;var vChild=vChildren[i]||noChild;var nextIndex=rootIndex+(vChild.count||0);if(indexInRange(indices,rootIndex,nextIndex)){recurse(childNodes[i],vChild,indices,nodes,rootIndex)}rootIndex=nextIndex}}}return nodes}function indexInRange(indices,left,right){if(indices.length===0){return false}var minIndex=0;var maxIndex=indices.length-1;var currentIndex;var currentItem;while(minIndex<=maxIndex){currentIndex=(maxIndex+minIndex)/2>>0;currentItem=indices[currentIndex];if(minIndex===maxIndex){return currentItem>=left&&currentItem<=right}else if(currentItem<left){minIndex=currentIndex+1}else if(currentItem>right){maxIndex=currentIndex-1}else{return true}}return false}function ascending(a,b){return a>b?1:-1}},{}],8:[function(require,module,exports){var applyProperties=require("./apply-properties");var isWidget=require("../vnode/is-widget.js");var VPatch=require("../vnode/vpatch.js");var updateWidget=require("./update-widget");module.exports=applyPatch;function applyPatch(vpatch,domNode,renderOptions){var type=vpatch.type;var vNode=vpatch.vNode;var patch=vpatch.patch;switch(type){case VPatch.REMOVE:return removeNode(domNode,vNode);case VPatch.INSERT:return insertNode(domNode,patch,renderOptions);case VPatch.VTEXT:return stringPatch(domNode,vNode,patch,renderOptions);case VPatch.WIDGET:return widgetPatch(domNode,vNode,patch,renderOptions);case VPatch.VNODE:return vNodePatch(domNode,vNode,patch,renderOptions);case VPatch.ORDER:reorderChildren(domNode,patch);return domNode;case VPatch.PROPS:applyProperties(domNode,patch,vNode.properties);return domNode;case VPatch.THUNK:return replaceRoot(domNode,renderOptions.patch(domNode,patch,renderOptions));default:return domNode}}function removeNode(domNode,vNode){var parentNode=domNode.parentNode;if(parentNode){parentNode.removeChild(domNode)}destroyWidget(domNode,vNode);return null}function insertNode(parentNode,vNode,renderOptions){var newNode=renderOptions.render(vNode,renderOptions);if(parentNode){parentNode.appendChild(newNode)}return parentNode}function stringPatch(domNode,leftVNode,vText,renderOptions){var newNode;if(domNode.nodeType===3){domNode.replaceData(0,domNode.length,vText.text);newNode=domNode}else{var parentNode=domNode.parentNode;newNode=renderOptions.render(vText,renderOptions);if(parentNode&&newNode!==domNode){parentNode.replaceChild(newNode,domNode)}}return newNode}function widgetPatch(domNode,leftVNode,widget,renderOptions){var updating=updateWidget(leftVNode,widget);var newNode;if(updating){newNode=widget.update(leftVNode,domNode)||domNode}else{newNode=renderOptions.render(widget,renderOptions)}var parentNode=domNode.parentNode;if(parentNode&&newNode!==domNode){parentNode.replaceChild(newNode,domNode)}if(!updating){destroyWidget(domNode,leftVNode)}return newNode}function vNodePatch(domNode,leftVNode,vNode,renderOptions){var parentNode=domNode.parentNode;var newNode=renderOptions.render(vNode,renderOptions);if(parentNode&&newNode!==domNode){parentNode.replaceChild(newNode,domNode)}return newNode}function destroyWidget(domNode,w){if(typeof w.destroy==="function"&&isWidget(w)){w.destroy(domNode)}}function reorderChildren(domNode,moves){var childNodes=domNode.childNodes;var keyMap={};var node;var remove;var insert;for(var i=0;i<moves.removes.length;i++){remove=moves.removes[i];node=childNodes[remove.from];if(remove.key){keyMap[remove.key]=node}domNode.removeChild(node)}var length=childNodes.length;for(var j=0;j<moves.inserts.length;j++){insert=moves.inserts[j];node=keyMap[insert.key];domNode.insertBefore(node,insert.to>=length++?null:childNodes[insert.to])}}function replaceRoot(oldRoot,newRoot){if(oldRoot&&newRoot&&oldRoot!==newRoot&&oldRoot.parentNode){oldRoot.parentNode.replaceChild(newRoot,oldRoot)}return newRoot}},{"../vnode/is-widget.js":16,"../vnode/vpatch.js":18,"./apply-properties":5,"./update-widget":10}],9:[function(require,module,exports){var document=require("global/document");var isArray=require("x-is-array");var render=require("./create-element");var domIndex=require("./dom-index");var patchOp=require("./patch-op");module.exports=patch;function patch(rootNode,patches,renderOptions){renderOptions=renderOptions||{};renderOptions.patch=renderOptions.patch||patchRecursive;renderOptions.render=renderOptions.render||render;return renderOptions.patch(rootNode,patches,renderOptions)}function patchRecursive(rootNode,patches,renderOptions){var indices=patchIndices(patches);if(indices.length===0){return rootNode}var index=domIndex(rootNode,patches.a,indices);var ownerDocument=rootNode.ownerDocument;if(!renderOptions.document&&ownerDocument!==document){renderOptions.document=ownerDocument}for(var i=0;i<indices.length;i++){var nodeIndex=indices[i];rootNode=applyPatch(rootNode,index[nodeIndex],patches[nodeIndex],renderOptions)}return rootNode}function applyPatch(rootNode,domNode,patchList,renderOptions){if(!domNode){return rootNode}var newNode;if(isArray(patchList)){for(var i=0;i<patchList.length;i++){newNode=patchOp(patchList[i],domNode,renderOptions);if(domNode===rootNode){rootNode=newNode}}}else{newNode=patchOp(patchList,domNode,renderOptions);if(domNode===rootNode){rootNode=newNode}}return rootNode}function patchIndices(patches){var indices=[];for(var key in patches){if(key!=="a"){indices.push(Number(key))}}return indices}},{"./create-element":6,"./dom-index":7,"./patch-op":8,"global/document":2,"x-is-array":4}],10:[function(require,module,exports){var isWidget=require("../vnode/is-widget.js");module.exports=updateWidget;function updateWidget(a,b){if(isWidget(a)&&isWidget(b)){if("name"in a&&"name"in b){return a.id===b.id}else{return a.init===b.init}}return false}},{"../vnode/is-widget.js":16}],11:[function(require,module,exports){var isVNode=require("./is-vnode");var isVText=require("./is-vtext");var isWidget=require("./is-widget");var isThunk=require("./is-thunk");module.exports=handleThunk;function handleThunk(a,b){var renderedA=a;var renderedB=b;if(isThunk(b)){renderedB=renderThunk(b,a)}if(isThunk(a)){renderedA=renderThunk(a,null)}return{a:renderedA,b:renderedB}}function renderThunk(thunk,previous){var renderedThunk=thunk.vnode;if(!renderedThunk){renderedThunk=thunk.vnode=thunk.render(previous)}if(!(isVNode(renderedThunk)||isVText(renderedThunk)||isWidget(renderedThunk))){throw new Error("thunk did not return a valid node")}return renderedThunk}},{"./is-thunk":12,"./is-vnode":14,"./is-vtext":15,"./is-widget":16}],12:[function(require,module,exports){module.exports=isThunk;function isThunk(t){return t&&t.type==="Thunk"}},{}],13:[function(require,module,exports){module.exports=isHook;function isHook(hook){return hook&&(typeof hook.hook==="function"&&!hook.hasOwnProperty("hook")||typeof hook.unhook==="function"&&!hook.hasOwnProperty("unhook"))}},{}],14:[function(require,module,exports){var version=require("./version");module.exports=isVirtualNode;function isVirtualNode(x){return x&&x.type==="VirtualNode"&&x.version===version}},{"./version":17}],15:[function(require,module,exports){var version=require("./version");module.exports=isVirtualText;function isVirtualText(x){return x&&x.type==="VirtualText"&&x.version===version}},{"./version":17}],16:[function(require,module,exports){module.exports=isWidget;function isWidget(w){return w&&w.type==="Widget"}},{}],17:[function(require,module,exports){module.exports="2"},{}],18:[function(require,module,exports){var version=require("./version");VirtualPatch.NONE=0;VirtualPatch.VTEXT=1;VirtualPatch.VNODE=2;VirtualPatch.WIDGET=3;VirtualPatch.PROPS=4;VirtualPatch.ORDER=5;VirtualPatch.INSERT=6;VirtualPatch.REMOVE=7;VirtualPatch.THUNK=8;module.exports=VirtualPatch;function VirtualPatch(type,vNode,patch){this.type=Number(type);this.vNode=vNode;this.patch=patch}VirtualPatch.prototype.version=version;VirtualPatch.prototype.type="VirtualPatch"},{"./version":17}],"virtual-dom/patch":[function(require,module,exports){var patch=require("./vdom/patch.js");module.exports=patch},{"./vdom/patch.js":9}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&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}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){(function(global){var topLevel=typeof global!=="undefined"?global:typeof window!=="undefined"?window:{};var minDoc=require("min-document");if(typeof document!=="undefined"){module.exports=document}else{var doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"];if(!doccy){doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"]=minDoc}module.exports=doccy}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"min-document":1}],3:[function(require,module,exports){"use strict";module.exports=function isObject(x){return typeof x==="object"&&x!==null}},{}],4:[function(require,module,exports){var isObject=require("is-object");var isHook=require("../vnode/is-vhook.js");module.exports=applyProperties;function applyProperties(node,props,previous){for(var propName in props){var propValue=props[propName];if(propValue===undefined){removeProperty(node,propName,propValue,previous)}else if(isHook(propValue)){removeProperty(node,propName,propValue,previous);if(propValue.hook){propValue.hook(node,propName,previous?previous[propName]:undefined)}}else{if(isObject(propValue)){patchObject(node,props,previous,propName,propValue)}else{node[propName]=propValue}}}}function removeProperty(node,propName,propValue,previous){if(previous){var previousValue=previous[propName];if(!isHook(previousValue)){if(propName==="attributes"){for(var attrName in previousValue){node.removeAttribute(attrName)}}else if(propName==="style"){for(var i in previousValue){node.style[i]=""}}else if(typeof previousValue==="string"){node[propName]=""}else{node[propName]=null}}else if(previousValue.unhook){previousValue.unhook(node,propName,propValue)}}}function patchObject(node,props,previous,propName,propValue){var previousValue=previous?previous[propName]:undefined;if(propName==="attributes"){for(var attrName in propValue){var attrValue=propValue[attrName];if(attrValue===undefined){node.removeAttribute(attrName)}else{node.setAttribute(attrName,attrValue)}}return}if(previousValue&&isObject(previousValue)&&getPrototype(previousValue)!==getPrototype(propValue)){node[propName]=propValue;return}if(!isObject(node[propName])){node[propName]={}}var replacer=propName==="style"?"":undefined;for(var k in propValue){var value=propValue[k];node[propName][k]=value===undefined?replacer:value}}function getPrototype(value){if(Object.getPrototypeOf){return Object.getPrototypeOf(value)}else if(value.__proto__){return value.__proto__}else if(value.constructor){return value.constructor.prototype}}},{"../vnode/is-vhook.js":8,"is-object":3}],5:[function(require,module,exports){var document=require("global/document");var applyProperties=require("./apply-properties");var isVNode=require("../vnode/is-vnode.js");var isVText=require("../vnode/is-vtext.js");var isWidget=require("../vnode/is-widget.js");var handleThunk=require("../vnode/handle-thunk.js");module.exports=createElement;function createElement(vnode,opts){var doc=opts?opts.document||document:document;var warn=opts?opts.warn:null;vnode=handleThunk(vnode).a;if(isWidget(vnode)){return vnode.init()}else if(isVText(vnode)){return doc.createTextNode(vnode.text)}else if(!isVNode(vnode)){if(warn){warn("Item is not a valid virtual dom node",vnode)}return null}var node=vnode.namespace===null?doc.createElement(vnode.tagName):doc.createElementNS(vnode.namespace,vnode.tagName);var props=vnode.properties;applyProperties(node,props);var children=vnode.children;for(var i=0;i<children.length;i++){var childNode=createElement(children[i],opts);if(childNode){node.appendChild(childNode)}}return node}},{"../vnode/handle-thunk.js":6,"../vnode/is-vnode.js":9,"../vnode/is-vtext.js":10,"../vnode/is-widget.js":11,"./apply-properties":4,"global/document":2}],6:[function(require,module,exports){var isVNode=require("./is-vnode");var isVText=require("./is-vtext");var isWidget=require("./is-widget");var isThunk=require("./is-thunk");module.exports=handleThunk;function handleThunk(a,b){var renderedA=a;var renderedB=b;if(isThunk(b)){renderedB=renderThunk(b,a)}if(isThunk(a)){renderedA=renderThunk(a,null)}return{a:renderedA,b:renderedB}}function renderThunk(thunk,previous){var renderedThunk=thunk.vnode;if(!renderedThunk){renderedThunk=thunk.vnode=thunk.render(previous)}if(!(isVNode(renderedThunk)||isVText(renderedThunk)||isWidget(renderedThunk))){throw new Error("thunk did not return a valid node")}return renderedThunk}},{"./is-thunk":7,"./is-vnode":9,"./is-vtext":10,"./is-widget":11}],7:[function(require,module,exports){module.exports=isThunk;function isThunk(t){return t&&t.type==="Thunk"}},{}],8:[function(require,module,exports){module.exports=isHook;function isHook(hook){return hook&&(typeof hook.hook==="function"&&!hook.hasOwnProperty("hook")||typeof hook.unhook==="function"&&!hook.hasOwnProperty("unhook"))}},{}],9:[function(require,module,exports){var version=require("./version");module.exports=isVirtualNode;function isVirtualNode(x){return x&&x.type==="VirtualNode"&&x.version===version}},{"./version":12}],10:[function(require,module,exports){var version=require("./version");module.exports=isVirtualText;function isVirtualText(x){return x&&x.type==="VirtualText"&&x.version===version}},{"./version":12}],11:[function(require,module,exports){module.exports=isWidget;function isWidget(w){return w&&w.type==="Widget"}},{}],12:[function(require,module,exports){module.exports="2"},{}],"virtual-dom/create-element":[function(require,module,exports){var createElement=require("./vdom/create-element.js");module.exports=createElement},{"./vdom/create-element.js":5}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&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}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],2:[function(require,module,exports){(function(process){(function(){var getNanoSeconds,hrtime,loadTime;if(typeof performance!=="undefined"&&performance!==null&&performance.now){module.exports=function(){return performance.now()}}else if(typeof process!=="undefined"&&process!==null&&process.hrtime){module.exports=function(){return(getNanoSeconds()-loadTime)/1e6};hrtime=process.hrtime;getNanoSeconds=function(){var hr;hr=hrtime();return hr[0]*1e9+hr[1]};loadTime=getNanoSeconds()}else if(Date.now){module.exports=function(){
return Date.now()-loadTime};loadTime=Date.now()}else{module.exports=function(){return(new Date).getTime()-loadTime};loadTime=(new Date).getTime()}}).call(this)}).call(this,require("_process"))},{_process:1}],raf:[function(require,module,exports){var now=require("performance-now"),global=typeof window==="undefined"?{}:window,vendors=["moz","webkit"],suffix="AnimationFrame",raf=global["request"+suffix],caf=global["cancel"+suffix]||global["cancelRequest"+suffix],isNative=true;for(var i=0;i<vendors.length&&!raf;i++){raf=global[vendors[i]+"Request"+suffix];caf=global[vendors[i]+"Cancel"+suffix]||global[vendors[i]+"CancelRequest"+suffix]}if(!raf||!caf){isNative=false;var last=0,id=0,queue=[],frameDuration=1e3/60;raf=function(callback){if(queue.length===0){var _now=now(),next=Math.max(0,frameDuration-(_now-last));last=next+_now;setTimeout(function(){var cp=queue.slice(0);queue.length=0;for(var i=0;i<cp.length;i++){if(!cp[i].cancelled){try{cp[i].callback(last)}catch(e){setTimeout(function(){throw e},0)}}}},Math.round(next))}queue.push({handle:++id,callback:callback,cancelled:false});return id};caf=function(handle){for(var i=0;i<queue.length;i++){if(queue[i].handle===handle){queue[i].cancelled=true}}}}module.exports=function(fn){if(!isNative){return raf.call(global,fn)}return raf.call(global,function(){try{fn.apply(this,arguments)}catch(e){setTimeout(function(){throw e},0)}})};module.exports.cancel=function(){caf.apply(global,arguments)}},{"performance-now":2}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&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}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){arguments[4][1][0].apply(exports,arguments)},{dup:1}],3:[function(require,module,exports){var base64=require("base64-js");var ieee754=require("ieee754");var isArray=require("is-array");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;Buffer.poolSize=8192;var kMaxLength=1073741823;var rootParent={};Buffer.TYPED_ARRAY_SUPPORT=function(){try{var buf=new ArrayBuffer(0);var arr=new Uint8Array(buf);arr.foo=function(){return 42};return 42===arr.foo()&&typeof arr.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(e){return false}}();function Buffer(subject,encoding,noZero){if(!(this instanceof Buffer))return new Buffer(subject,encoding,noZero);var type=typeof subject;var length;if(type==="number")length=subject>0?subject>>>0:0;else if(type==="string"){length=Buffer.byteLength(subject,encoding)}else if(type==="object"&&subject!==null){if(subject.type==="Buffer"&&isArray(subject.data))subject=subject.data;length=+subject.length>0?Math.floor(+subject.length):0}else throw new TypeError("must start with number, buffer, array or string");if(length>kMaxLength)throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength.toString(16)+" bytes");var buf;if(Buffer.TYPED_ARRAY_SUPPORT){buf=Buffer._augment(new Uint8Array(length))}else{buf=this;buf.length=length;buf._isBuffer=true}var i;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof subject.byteLength==="number"){buf._set(subject)}else if(isArrayish(subject)){if(Buffer.isBuffer(subject)){for(i=0;i<length;i++)buf[i]=subject.readUInt8(i)}else{for(i=0;i<length;i++)buf[i]=(subject[i]%256+256)%256}}else if(type==="string"){buf.write(subject,0,encoding)}else if(type==="number"&&!Buffer.TYPED_ARRAY_SUPPORT&&!noZero){for(i=0;i<length;i++){buf[i]=0}}if(length>0&&length<=Buffer.poolSize)buf.parent=rootParent;return buf}function SlowBuffer(subject,encoding,noZero){if(!(this instanceof SlowBuffer))return new SlowBuffer(subject,encoding,noZero);var buf=new Buffer(subject,encoding,noZero);delete buf.parent;return buf}Buffer.isBuffer=function(b){return!!(b!=null&&b._isBuffer)};Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len&&a[i]===b[i];i++){}if(i!==len){x=a[i];y=b[i]}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function(list,totalLength){if(!isArray(list))throw new TypeError("Usage: Buffer.concat(list[, length])");if(list.length===0){return new Buffer(0)}else if(list.length===1){return list[0]}var i;if(totalLength===undefined){totalLength=0;for(i=0;i<list.length;i++){totalLength+=list[i].length}}var buf=new Buffer(totalLength);var pos=0;for(i=0;i<list.length;i++){var item=list[i];item.copy(buf,pos);pos+=item.length}return buf};Buffer.byteLength=function(str,encoding){var ret;str=str+"";switch(encoding||"utf8"){case"ascii":case"binary":case"raw":ret=str.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=str.length*2;break;case"hex":ret=str.length>>>1;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"base64":ret=base64ToBytes(str).length;break;default:ret=str.length}return ret};Buffer.prototype.length=undefined;Buffer.prototype.parent=undefined;Buffer.prototype.toString=function(encoding,start,end){var loweredCase=false;start=start>>>0;end=end===undefined||end===Infinity?this.length:end>>>0;if(!encoding)encoding="utf8";if(start<0)start=0;if(end>this.length)end=this.length;if(end<=start)return"";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return"<Buffer "+str+">"};Buffer.prototype.compare=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)};Buffer.prototype.get=function(offset){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(offset)};Buffer.prototype.set=function(v,offset){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(v,offset)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;i<length;i++){var byte=parseInt(string.substr(i*2,2),16);if(isNaN(byte))throw new Error("Invalid hex string");buf[offset+i]=byte}return i}function utf8Write(buf,string,offset,length){var charsWritten=blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length);return charsWritten}function asciiWrite(buf,string,offset,length){var charsWritten=blitBuffer(asciiToBytes(string),buf,offset,length);return charsWritten}function binaryWrite(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){var charsWritten=blitBuffer(base64ToBytes(string),buf,offset,length);return charsWritten}function utf16leWrite(buf,string,offset,length){var charsWritten=blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length,2);return charsWritten}Buffer.prototype.write=function(string,offset,length,encoding){if(isFinite(offset)){if(!isFinite(length)){encoding=length;length=undefined}}else{var swap=encoding;encoding=offset;offset=length;length=swap}offset=Number(offset)||0;if(length<0||offset<0||offset>this.length)throw new RangeError("attempt to write outside buffer bounds");var remaining=this.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new TypeError("Unknown encoding: "+encoding)}return ret};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){if(buf[i]<=127){res+=decodeUtf8Char(tmp)+String.fromCharCode(buf[i]);tmp=""}else{tmp+="%"+buf[i].toString(16)}}return res+decodeUtf8Char(tmp)}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i]&127)}return ret}function binarySlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i])}return ret}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;i++){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;var newBuf;if(Buffer.TYPED_ARRAY_SUPPORT){newBuf=Buffer._augment(this.subarray(start,end))}else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,undefined,true);for(var i=0;i<sliceLen;i++){newBuf[i]=this[i+start]}}if(newBuf.length)newBuf.parent=this.parent||this;return newBuf};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256))val+=this[offset+i]*mul;return val};Buffer.prototype.readUIntBE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256))val+=this[offset+--byteLength]*mul;return val};Buffer.prototype.readUInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256))val+=this[offset+i]*mul;mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256))val+=this[offset+--i]*mul;mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||value<min)throw new RangeError("value is out of bounds");if(offset+ext>buf.length)throw new RangeError("index out of range")}Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength),0);var mul=1;var i=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256))this[offset+i]=value/mul>>>0&255;return offset+byteLength};Buffer.prototype.writeUIntBE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength),0);var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256))this[offset+i]=value/mul>>>0&255;return offset+byteLength};Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i<j;i++){buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i<j;i++){buf[offset+i]=value>>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength-1)-1,-Math.pow(2,8*byteLength-1))}var i=0;var mul=1;var sub=value<0?1:0;this[offset]=value&255;while(++i<byteLength&&(mul*=256))this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength};Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength-1)-1,-Math.pow(2,8*byteLength-1))}var i=byteLength-1;var mul=1;var sub=value<0?1:0;this[offset+i]=value&255;while(--i>=0&&(mul*=256))this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength};Buffer.prototype.writeInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||value<min)throw new RangeError("value is out of bounds");if(offset+ext>buf.length)throw new RangeError("index out of range");if(offset<0)throw new RangeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38);ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308);ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(!start)start=0;if(!end&&end!==0)end=this.length;if(target_start>=target.length)target_start=target.length;if(!target_start)target_start=0;if(end>0&&end<start)end=start;if(end===start)return 0;if(target.length===0||source.length===0)return 0;if(target_start<0)throw new RangeError("targetStart out of bounds");if(start<0||start>=source.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-target_start<end-start)end=target.length-target_start+start;var len=end-start;if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i<len;i++){target[i+target_start]=this[i+start]}}else{target._set(this.subarray(start,start+len),target_start)}return len};Buffer.prototype.fill=function(value,start,end){if(!value)value=0;if(!start)start=0;if(!end)end=this.length;if(end<start)throw new RangeError("end < start");if(end===start)return;if(this.length===0)return;if(start<0||start>=this.length)throw new RangeError("start out of bounds");if(end<0||end>this.length)throw new RangeError("end out of bounds");var i;if(typeof value==="number"){for(i=start;i<end;i++){this[i]=value}}else{var bytes=utf8ToBytes(value.toString());var len=bytes.length;for(i=start;i<end;i++){this[i]=bytes[i%len]}}return this};Buffer.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(Buffer.TYPED_ARRAY_SUPPORT){return new Buffer(this).buffer}else{var buf=new Uint8Array(this.length);for(var i=0,len=buf.length;i<len;i+=1){buf[i]=this[i]}return buf.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var BP=Buffer.prototype;Buffer._augment=function(arr){arr.constructor=Buffer;arr._isBuffer=true;arr._get=arr.get;arr._set=arr.set;arr.get=BP.get;arr.set=BP.set;arr.write=BP.write;arr.toString=BP.toString;arr.toLocaleString=BP.toString;arr.toJSON=BP.toJSON;arr.equals=BP.equals;arr.compare=BP.compare;arr.copy=BP.copy;arr.slice=BP.slice;arr.readUIntLE=BP.readUIntLE;arr.readUIntBE=BP.readUIntBE;arr.readUInt8=BP.readUInt8;arr.readUInt16LE=BP.readUInt16LE;arr.readUInt16BE=BP.readUInt16BE;arr.readUInt32LE=BP.readUInt32LE;arr.readUInt32BE=BP.readUInt32BE;arr.readIntLE=BP.readIntLE;arr.readIntBE=BP.readIntBE;arr.readInt8=BP.readInt8;arr.readInt16LE=BP.readInt16LE;arr.readInt16BE=BP.readInt16BE;arr.readInt32LE=BP.readInt32LE;arr.readInt32BE=BP.readInt32BE;arr.readFloatLE=BP.readFloatLE;arr.readFloatBE=BP.readFloatBE;arr.readDoubleLE=BP.readDoubleLE;arr.readDoubleBE=BP.readDoubleBE;arr.writeUInt8=BP.writeUInt8;arr.writeUIntLE=BP.writeUIntLE;arr.writeUIntBE=BP.writeUIntBE;arr.writeUInt16LE=BP.writeUInt16LE;arr.writeUInt16BE=BP.writeUInt16BE;arr.writeUInt32LE=BP.writeUInt32LE;arr.writeUInt32BE=BP.writeUInt32BE;arr.writeIntLE=BP.writeIntLE;arr.writeIntBE=BP.writeIntBE;arr.writeInt8=BP.writeInt8;arr.writeInt16LE=BP.writeInt16LE;arr.writeInt16BE=BP.writeInt16BE;arr.writeInt32LE=BP.writeInt32LE;arr.writeInt32BE=BP.writeInt32BE;arr.writeFloatLE=BP.writeFloatLE;arr.writeFloatBE=BP.writeFloatBE;arr.writeDoubleLE=BP.writeDoubleLE;arr.writeDoubleBE=BP.writeDoubleBE;arr.fill=BP.fill;arr.inspect=BP.inspect;arr.toArrayBuffer=BP.toArrayBuffer;return arr};var INVALID_BASE64_RE=/[^+\/0-9A-z\-]/g;function base64clean(str){str=stringtrim(str).replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function stringtrim(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,"")}function isArrayish(subject){return isArray(subject)||Buffer.isBuffer(subject)||subject&&typeof subject==="object"&&typeof subject.length==="number"}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(string,units){var codePoint,length=string.length;var leadSurrogate=null;units=units||Infinity;var bytes=[];var i=0;for(;i<length;i++){codePoint=string.charCodeAt(i);if(codePoint>55295&&codePoint<57344){if(leadSurrogate){if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}else{codePoint=leadSurrogate-55296<<10|codePoint-56320|65536;leadSurrogate=null}}else{if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}else{leadSurrogate=codePoint;continue}}}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=null}if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<2097152){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str,units){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;i++){if((units-=2)<0)break;c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length,unitSize){if(unitSize)length-=length%unitSize;for(var i=0;i<length;i++){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}},{"base64-js":4,ieee754:5,"is-array":6}],4:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);var PLUS_URL_SAFE="-".charCodeAt(0);var SLASH_URL_SAFE="_".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS||code===PLUS_URL_SAFE)return 62;if(code===SLASH||code===SLASH_URL_SAFE)return 63;if(code<NUMBER)return-1;if(code<NUMBER+10)return code-NUMBER+26+26;if(code<UPPER+26)return code-UPPER;if(code<LOWER+26)return code-LOWER+26}function b64ToByteArray(b64){var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i<l;i+=4,j+=3){tmp=decode(b64.charAt(i))<<18|decode(b64.charAt(i+1))<<12|decode(b64.charAt(i+2))<<6|decode(b64.charAt(i+3));push((tmp&16711680)>>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i<length;i+=3){temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output+=tripletToBase64(temp)}switch(extraBytes){case 1:temp=uint8[uint8.length-1];output+=encode(temp>>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],5:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8);m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8);if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8);e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=s*128}},{}],6:[function(require,module,exports){var isArray=Array.isArray;var str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}],7:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(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(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){
from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:8}],8:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],9:[function(require,module,exports){var hasOwn=Object.prototype.hasOwnProperty;var toStr=Object.prototype.toString;var undefined;var isArray=function isArray(arr){if(typeof Array.isArray==="function"){return Array.isArray(arr)}return toStr.call(arr)==="[object Array]"};var isPlainObject=function isPlainObject(obj){"use strict";if(!obj||toStr.call(obj)!=="[object Object]"){return false}var has_own_constructor=hasOwn.call(obj,"constructor");var has_is_property_of_method=obj.constructor&&obj.constructor.prototype&&hasOwn.call(obj.constructor.prototype,"isPrototypeOf");if(obj.constructor&&!has_own_constructor&&!has_is_property_of_method){return false}var key;for(key in obj){}return key===undefined||hasOwn.call(obj,key)};module.exports=function extend(){"use strict";var options,name,src,copy,copyIsArray,clone,target=arguments[0],i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2}else if(typeof target!=="object"&&typeof target!=="function"||target==null){target={}}for(;i<length;++i){options=arguments[i];if(options!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue}if(deep&&copy&&(isPlainObject(copy)||(copyIsArray=isArray(copy)))){if(copyIsArray){copyIsArray=false;clone=src&&isArray(src)?src:[]}else{clone=src&&isPlainObject(src)?src:{}}target[name]=extend(deep,clone,copy)}else if(copy!==undefined){target[name]=copy}}}}return target}},{}],10:[function(require,module,exports){"use strict";var typeOf=require("kind-of");var filterKeys=require("filter-keys");var filterValues=require("filter-values");var sortObject=require("sort-object");var extend=require("extend-shallow");module.exports=function filterObject(o,patterns,options){if(o==null){throw new Error("filter-object expects an object")}if(patterns==null)return o;if(typeOf(patterns)==="function"){return filterValues(o,patterns,options)}var keys=filterKeys(o,patterns,options);return sortObject(o,extend({keys:keys},options))}},{"extend-shallow":11,"filter-keys":12,"filter-values":47,"kind-of":51,"sort-object":52}],11:[function(require,module,exports){"use strict";var typeOf=require("kind-of");module.exports=extend;function extend(o){if(typeOf(o)!=="object"){return{}}var args=arguments;var len=args.length-1;for(var i=0;i<len;i++){var obj=args[i+1];if(typeOf(obj)==="object"&&typeOf(obj)!=="regexp"){for(var key in obj){if(obj.hasOwnProperty(key)){o[key]=obj[key]}}}}return o}},{"kind-of":51}],12:[function(require,module,exports){"use strict";var mm=require("micromatch");module.exports=function filterKeys(o,patterns,options){if(o==null){throw new Error("filter-keys expects an object")}var keys=Object.keys(o);if(!patterns||arguments.length===1){return keys}return mm(keys,patterns,options)}},{micromatch:13}],13:[function(require,module,exports){"use strict";var diff=require("arr-diff");var typeOf=require("kind-of");var omit=require("object.omit");var unique=require("array-unique");var cache=require("regex-cache");var isGlob=require("is-glob");var expand=require("./lib/expand");var utils=require("./lib/utils");function micromatch(files,patterns,opts){if(!files||!patterns)return[];opts=opts||{};if(typeof opts.cache==="undefined"){opts.cache=true}if(!Array.isArray(patterns)){return match(files,patterns,opts)}var len=patterns.length,i=0;var omit=[],keep=[];while(len--){var glob=patterns[i++];if(glob.charCodeAt(0)===33){omit.push.apply(omit,match(files,glob.slice(1),opts))}else{keep.push.apply(keep,match(files,glob,opts))}}return diff(keep,omit)}function match(files,pattern,opts){if(typeOf(files)!=="string"&&!Array.isArray(files)){throw new Error(msg("match","files","a string or array"))}files=utils.arrayify(files);opts=opts||{};var negate=opts.negate||false;var orig=pattern;if(typeof pattern==="string"&&opts.nonegate!==true){negate=pattern.charAt(0)==="!";if(negate){pattern=pattern.slice(1)}}var _isMatch=matcher(pattern,opts);var len=files.length,i=0;var res=[];while(i<len){var file=files[i++];var fp=utils.unixify(file,opts);if(!_isMatch(fp)){continue}res.push(fp)}if(res.length===0){if(opts.failglob===true){throw new Error('micromatch.match() found no matches for: "'+orig+'".')}if(opts.nonull||opts.nullglob){res.push(utils.unescapeGlob(orig))}}if(negate){res=diff(files,res)}if(opts.ignore&&opts.ignore.length){pattern=opts.ignore;opts=omit(opts,["ignore"]);res=diff(res,micromatch(res,pattern,opts))}if(opts.nodupes){return unique(res)}return res}function filter(patterns,opts){if(!Array.isArray(patterns)&&typeof patterns!=="string"){throw new TypeError(msg("filter","patterns","a string or array"))}patterns=utils.arrayify(patterns);return function(fp){if(fp==null)return[];var len=patterns.length,i=0;var res=true;fp=utils.unixify(fp,opts);while(i<len){var fn=matcher(patterns[i++],opts);if(!fn(fp)){res=false;break}}return res}}function isMatch(fp,pattern,opts){if(typeof fp!=="string"){throw new TypeError(msg("isMatch","filepath","a string"))}fp=utils.unixify(fp,opts);if(typeOf(pattern)==="object"){return matcher(fp,pattern)}return matcher(pattern,opts)(fp)}function contains(fp,pattern,opts){if(typeof fp!=="string"){throw new TypeError(msg("contains","pattern","a string"))}opts=opts||{};opts.contains=pattern!=="";fp=utils.unixify(fp,opts);if(opts.contains&&!isGlob(pattern)){return fp.indexOf(pattern)!==-1}return matcher(pattern,opts)(fp)}function any(fp,patterns,opts){if(!Array.isArray(patterns)&&typeof patterns!=="string"){throw new TypeError(msg("any","patterns","a string or array"))}patterns=utils.arrayify(patterns);var len=patterns.length;fp=utils.unixify(fp,opts);while(len--){var isMatch=matcher(patterns[len],opts);if(isMatch(fp)){return true}}return false}function matchKeys(obj,glob,options){if(typeOf(obj)!=="object"){throw new TypeError(msg("matchKeys","first argument","an object"))}var fn=matcher(glob,options);var res={};for(var key in obj){if(obj.hasOwnProperty(key)&&fn(key)){res[key]=obj[key]}}return res}function matcher(pattern,opts){if(typeof pattern==="function"){return pattern}if(pattern instanceof RegExp){return function(fp){return pattern.test(fp)}}pattern=utils.unixify(pattern,opts);if(!isGlob(pattern)){return utils.matchPath(pattern,opts)}var re=makeRe(pattern,opts);if(opts&&opts.matchBase){return utils.hasFilename(re,opts)}return function(fp){fp=utils.unixify(fp,opts);return re.test(fp)}}function toRegex(glob,options){if(typeOf(glob)!=="string"){throw new Error(msg("toRegex","glob","a string"))}var opts=Object.create(options||{});var flags=opts.flags||"";if(opts.nocase&&flags.indexOf("i")===-1){flags+="i"}var parsed=expand(glob,opts);opts.negated=opts.negated||parsed.negated;opts.negate=opts.negated;glob=wrapGlob(parsed.pattern,opts);var re;try{re=new RegExp(glob,flags);return re}catch(err){var msg="micromatch invalid regex: ("+re+")";if(opts.strict)throw new SyntaxError(msg+err)}return/$^/}function wrapGlob(glob,opts){var prefix=opts&&!opts.contains?"^":"";var after=opts&&!opts.contains?"$":"";glob="(?:"+glob+")"+after;if(opts&&opts.negate){return prefix+("(?!^"+glob+").*$")}return prefix+glob}function makeRe(glob,opts){return cache(toRegex,glob,opts)}function msg(method,what,type){return"micromatch."+method+"(): "+what+" should be "+type+"."}micromatch.any=any;micromatch.braces=micromatch.braceExpand=require("braces");micromatch.contains=contains;micromatch.expand=expand;micromatch.filter=filter;micromatch.isMatch=isMatch;micromatch.makeRe=makeRe;micromatch.match=match;micromatch.matcher=matcher;micromatch.matchKeys=matchKeys;module.exports=micromatch},{"./lib/expand":15,"./lib/utils":17,"arr-diff":18,"array-unique":20,braces:21,"is-glob":34,"kind-of":51,"object.omit":35,"regex-cache":44}],14:[function(require,module,exports){"use strict";var reverse=function(object,prepender){return Object.keys(object).reduce(function(reversed,key){var newKey=prepender?prepender+key:key;reversed[object[key]]=newKey;return reversed},{})};var chars={};chars.escapeRegex={"?":/\?/g,"@":/\@/g,"!":/\!/g,"+":/\+/g,"*":/\*/g,"(":/\(/g,")":/\)/g,"[":/\[/g,"]":/\]/g};chars.ESC={"?":"__UNESC_QMRK__","@":"__UNESC_AMPE__","!":"__UNESC_EXCL__","+":"__UNESC_PLUS__","*":"__UNESC_STAR__",",":"__UNESC_COMMA__","(":"__UNESC_LTPAREN__",")":"__UNESC_RTPAREN__","[":"__UNESC_LTBRACK__","]":"__UNESC_RTBRACK__"};chars.UNESC=reverse(chars.ESC,"\\");chars.ESC_TEMP={"?":"__TEMP_QMRK__","@":"__TEMP_AMPE__","!":"__TEMP_EXCL__","*":"__TEMP_STAR__","+":"__TEMP_PLUS__",",":"__TEMP_COMMA__","(":"__TEMP_LTPAREN__",")":"__TEMP_RTPAREN__","[":"__TEMP_LTBRACK__","]":"__TEMP_RTBRACK__"};chars.TEMP=reverse(chars.ESC_TEMP);module.exports=chars},{}],15:[function(require,module,exports){"use strict";var utils=require("./utils");var Glob=require("./glob");module.exports=expand;function expand(pattern,options){if(typeof pattern!=="string"){throw new TypeError("micromatch.expand(): argument should be a string.")}var glob=new Glob(pattern,options||{});var opts=glob.options;if(typeof opts.braces!=="boolean"&&typeof opts.nobraces!=="boolean"){opts.braces=true}if(specialCase(pattern)&&opts.safemode){return new RegExp(utils.escapeRe(pattern),"g")}if(glob.pattern===".*"){return{pattern:"\\."+star,tokens:tok,options:opts}}if(glob.pattern==="."){return{pattern:"\\.",tokens:tok,options:opts}}if(glob.pattern==="*"){return{pattern:oneStar(opts.dot),tokens:tok,options:opts}}glob.parse();var tok=glob.tokens;tok.is.negated=opts.negated;if((opts.dotfiles===true||tok.is.dotfile)&&opts.dot!==false){opts.dotfiles=true;opts.dot=true}if((opts.dotdirs===true||tok.is.dotdir)&&opts.dot!==false){opts.dotdirs=true;opts.dot=true}if(/[{,]\./.test(glob.pattern)){opts.makeRe=false;opts.dot=true}if(opts.nonegate!==true){opts.negated=glob.negated}if(glob.pattern.charAt(0)==="."&&glob.pattern.charAt(1)!=="/"){glob.pattern="\\"+glob.pattern}glob.track("before brackets");if(tok.is.brackets){glob.brackets()}glob.track("after brackets");glob.track("before braces");if(tok.is.braces){glob.braces()}glob.track("after braces");glob.track("before extglob");if(tok.is.extglob){glob.extglob()}glob.track("after extglob");glob._replace("[!","[^");glob._replace("(?","(%~");glob._replace("[]","\\[\\]");glob._replace("/[","/"+(opts.dot?dotfiles:nodot)+"[",true);glob._replace("/?","/"+(opts.dot?dotfiles:nodot)+"[^/]",true);glob._replace("/.","/(?=.)\\.",true);glob._replace(/^(\w):([\\\/]+?)/gi,"(?=.)$1:$2",true);if(glob.pattern.indexOf("[^")!==-1){glob.pattern=negateSlash(glob.pattern)}if(opts.globstar!==false&&glob.pattern==="**"){glob.pattern=globstar(opts.dot)}else{glob._replace(/(\/\*)+/g,function(match){var len=match.length/2;if(len===1){return match}return"(?:\\/*){"+len+"}"});glob.pattern=balance(glob.pattern,"[","]");glob.escape(glob.pattern);if(tok.is.globstar){glob.pattern=collapse(glob.pattern,"/**");glob.pattern=collapse(glob.pattern,"**/");glob._replace(/\*{2,}/g,"**");glob._replace(/(\w+)\*(?!\/)/g,"$1[^/]*?",true);glob._replace(/\*\*\/\*(\w)/g,globstar(opts.dot)+"\\/"+(opts.dot?dotfiles:nodot)+"[^/]*?$1",true);if(opts.dot!==true){glob._replace(/\*\*\/(.)/g,"(?:**\\/|)$1")}if(tok.path.dirname!==""||/,\*\*|\*\*,/.test(glob.orig)){glob._replace("**",globstar(opts.dot),true)}}glob._replace(/\/\*$/,"\\/"+oneStar(opts.dot),true);glob._replace(/(?!\/)\*$/,star,true);glob._replace(/([^\/]+)\*/,"$1"+oneStar(true),true);glob._replace("*",oneStar(opts.dot),true);glob._replace("?.","?\\.",true);glob._replace("?:","?:",true);glob._replace(/\?+/g,function(match){var len=match.length;if(len===1){return qmark}return qmark+"{"+len+"}"});glob._replace(/\.([*\w]+)/g,"\\.$1");glob._replace(/\[\^[\\\/]+\]/g,qmark);glob._replace(/\/+/g,"\\/");glob._replace(/\\{2,}/g,"\\")}glob.unescape(glob.pattern);glob._replace("__UNESC_STAR__","*");glob._replace("?.","?\\.");glob._replace("[^\\/]",qmark);if(glob.pattern.length>1){if(glob.pattern.indexOf("\\/")===0&&glob.pattern.indexOf("\\/"+nodot)!==0){glob.pattern="\\/"+nodot+glob.pattern.slice(2)}else if(/^[\[?*]/.test(glob.pattern)){glob.pattern=(opts.dot?dotfiles:nodot)+glob.pattern}}return glob}function specialCase(glob){if(glob==="\\"){return true}return false}function collapse(str,ch){var res=str.split(ch);var isFirst=res[0]==="";var isLast=res[res.length-1]==="";res=res.filter(Boolean);if(isFirst)res.unshift("");if(isLast)res.push("");return res.join(ch)}function negateSlash(str){return str.replace(/\[\^([^\]]*?)\]/g,function(match,inner){if(inner.indexOf("/")===-1){inner="\\/"+inner}return"[^"+inner+"]"})}function balance(str,a,b){var aarr=str.split(a);var alen=aarr.join("").length;var blen=str.split(b).join("").length;if(alen!==blen){str=aarr.join("\\"+a);return str.split(b).join("\\"+b)}return str}var qmark="[^/]";var star=qmark+"*?";var nodot="(?!\\.)(?=.)";var dotfileGlob="(?:\\/|^)\\.{1,2}($|\\/)";var dotfiles="(?!"+dotfileGlob+")(?=.)";var twoStarDot="(?:(?!"+dotfileGlob+").)*?";function oneStar(dotfile){return dotfile?"(?!"+dotfileGlob+")(?=.)"+star:nodot+star}function globstar(dotfile){if(dotfile){return twoStarDot}return"(?:(?!(?:\\/|^)\\.).)*?"}},{"./glob":16,"./utils":17}],16:[function(require,module,exports){"use strict";var braces=require("braces");var brackets=require("expand-brackets");var extglob=require("extglob");var parse=require("parse-glob");var chars=require("./chars");module.exports=Glob;function Glob(pattern,options){this.options=options||{};this.pattern=pattern;this.history=[];this.tokens={};this.init(pattern)}Glob.prototype.init=function(pattern){this.orig=pattern;this.negated=this.isNegated();this.options.track=this.options.track||false;this.options.makeRe=true};Glob.prototype.track=function(msg){if(this.options.track){this.history.push({msg:msg,pattern:this.pattern})}};Glob.prototype.has=function(pattern,ch){if(ch instanceof RegExp){return ch.test(pattern)}return pattern.indexOf(ch)!==-1};Glob.prototype.isNegated=function(){if(this.tokens.isNegated)return true;if(this.pattern.charCodeAt(0)===33){this.pattern=this.pattern.slice(1);return true}return false};Glob.prototype.braces=function(){if(this.options.nobraces!==true&&this.options.nobrace!==true){var a=this.pattern.match(/[\{\(\[]/g);var b=this.pattern.match(/[\}\)\]]/g);if(a&&b&&a.length!==b.length){this.options.makeRe=false}var expanded=braces(this.pattern,this.options);this.pattern=expanded.join("|")}};Glob.prototype.brackets=function(){if(this.options.nobrackets!==true){this.pattern=brackets(this.pattern)}};Glob.prototype.extglob=function(){if(this.options.noextglob!==true){this.pattern=extglob(this.pattern,{escape:true})}};Glob.prototype.parse=function(pattern){this.tokens=parse(pattern||this.pattern,true);return this.tokens};Glob.prototype._replace=function(a,b,escape){this.track('before (find): "'+a+'" (replace with): "'+b+'"');if(escape)b=esc(b);if(a&&b&&typeof a==="string"){this.pattern=this.pattern.split(a).join(b)}else if(a instanceof RegExp){this.pattern=this.pattern.replace(a,b)}this.track("after")};Glob.prototype.escape=function(str){this.track("before escape: ");var re=/["\\](['"]?[^"'\\]['"]?)/g;this.pattern=str.replace(re,function($0,$1){var o=chars.ESC;var ch=o&&o[$1];if(ch){return ch}if(/[a-z]/i.test($0)){return $0.split("\\").join("")}return $0});this.track("after escape: ")};Glob.prototype.unescape=function(str){var re=/__([A-Z]+)_([A-Z]+)__/g;this.pattern=str.replace(re,function($0,$1){return chars[$1][$0]});this.pattern=unesc(this.pattern)};function esc(str){str=str.split("?").join("%~");str=str.split("*").join("%%");return str}function unesc(str){str=str.split("%~").join("?");str=str.split("%%").join("*");return str}},{"./chars":14,braces:21,"expand-brackets":30,extglob:31,"parse-glob":39}],17:[function(require,module,exports){(function(process){"use strict";var path=require("path");var fileRe=require("filename-regex");var win32=process&&process.platform==="win32";var utils=module.exports;utils.filename=function filename(fp){var seg=fp.match(fileRe());return seg&&seg[0]};utils.isPath=function isPath(pattern,opts){return function(fp){return utils.unixify(fp,opts)===pattern}};utils.hasPath=function hasPath(pattern,opts){return function(fp){return utils.unixify(fp,opts).indexOf(pattern)!==-1}};utils.matchPath=function matchPath(pattern,opts){var fn=opts&&opts.contains?utils.hasPath(pattern,opts):utils.isPath(pattern,opts);return fn};utils.hasFilename=function hasFilename(re){return function(fp){var name=utils.filename(fp);return name&&re.test(name)}};utils.arrayify=function arrayify(val){return!Array.isArray(val)?[val]:val};utils.unixify=function unixify(fp,opts){if(opts&&opts.unixify===false)return fp;if(opts&&opts.unixify===true||win32||path.sep==="\\"){return fp.split("\\").join("/")}if(opts&&opts.unescape===true){return fp?fp.toString().replace(/\\(\w)/g,"$1"):""}return fp};utils.escapePath=function escapePath(fp){return fp.replace(/[\\.]/g,"\\$&")};utils.unescapeGlob=function unescapeGlob(fp){return fp.replace(/[\\"']/g,"")};utils.escapeRe=function escapeRe(str){return str.replace(/[-[\\$*+?.#^\s{}(|)\]]/g,"\\$&")}}).call(this,require("_process"))},{_process:8,"filename-regex":33,path:7}],18:[function(require,module,exports){"use strict";var slice=require("array-slice");module.exports=diff;function diff(a,b,c){var len=a.length;var arr=[];var rest;if(!b){return a}if(!c){rest=b}else{rest=[].concat.apply([],slice(arguments,1))}while(len--){if(rest.indexOf(a[len])===-1){arr.unshift(a[len])}}return arr}},{"array-slice":19}],19:[function(require,module,exports){"use strict";module.exports=function slice(arr,start,end){var len=arr.length>>>0;var range=[];start=idx(arr,start);end=idx(arr,end,len);while(start<end){range.push(arr[start++])}return range};function idx(arr,pos,end){var len=arr.length>>>0;if(pos==null){pos=end||0}else if(pos<0){pos=Math.max(len+pos,0)}else{pos=Math.min(pos,len)}return pos}},{}],20:[function(require,module,exports){"use strict";module.exports=function unique(arr){if(!Array.isArray(arr)){throw new TypeError("array-unique expects an array.")}var len=arr.length;var i=-1;while(i++<len){var j=i+1;for(;j<arr.length;++j){if(arr[i]===arr[j]){arr.splice(j--,1)}}}return arr}},{}],21:[function(require,module,exports){"use strict";var expand=require("expand-range");var repeat=require("repeat-element");var tokens=require("preserve");var cache={};module.exports=function(str,options){if(typeof str!=="string"){throw new Error("braces expects a string")}return braces(str,options)};function braces(str,arr,options){if(str===""){return[]}if(!Array.isArray(arr)){options=arr;arr=[]}var opts=options||{};arr=arr||[];if(typeof opts.nodupes==="undefined"){opts.nodupes=true}var fn=opts.fn;var es6;if(typeof opts==="function"){fn=opts;opts={}}if(!(patternRe instanceof RegExp)){patternRe=patternRegex()}var matches=str.match(patternRe)||[];var m=matches[0];switch(m){case"\\,":return escapeCommas(str,arr,opts);case"\\.":return escapeDots(str,arr,opts);case"/.":return escapePaths(str,arr,opts);case" ":return splitWhitespace(str);case"{,}":return exponential(str,opts,braces);case"{}":return emptyBraces(str,arr,opts);case"\\{":case"\\}":return escapeBraces(str,arr,opts);case"${":if(!/\{[^{]+\{/.test(str)){return arr.concat(str)}else{es6=true;str=tokens.before(str,es6Regex())}}if(!(braceRe instanceof RegExp)){braceRe=braceRegex()}var match=braceRe.exec(str);if(match==null){return[str]}var outter=match[1];var inner=match[2];if(inner===""){return[str]}var segs,segsLength;if(inner.indexOf("..")!==-1){segs=expand(inner,opts,fn)||inner.split(",");segsLength=segs.length}else if(inner[0]==='"'||inner[0]==="'"){return arr.concat(str.split(/['"]/).join(""))}else{segs=inner.split(",");if(opts.makeRe){return braces(str.replace(outter,wrap(segs,"|")),opts)}segsLength=segs.length;if(segsLength===1&&opts.bash){segs[0]=wrap(segs[0],"\\")}}var len=segs.length;var i=0,val;while(len--){var path=segs[i++];var bash=false;if(/(\.[^.\/])/.test(path)){if(segsLength>1){return segs}else{return[str]}}val=splice(str,outter,path);if(/\{[^{}]+?\}/.test(val)){arr=braces(val,arr,opts)}else if(val!==""){if(opts.nodupes&&arr.indexOf(val)!==-1){continue}arr.push(es6?tokens.after(val):val)}}if(opts.strict){return filter(arr,filterEmpty)}return arr}function exponential(str,options,fn){if(typeof options==="function"){fn=options;options=null}var opts=options||{};var esc="__ESC_EXP__";var exp=0;var res;var parts=str.split("{,}");if(opts.nodupes){return fn(parts.join(""),opts)}exp=parts.length-1;res=fn(parts.join(esc),opts);var len=res.length;var arr=[];var i=0;while(len--){var ele=res[i++];var idx=ele.indexOf(esc);if(idx===-1){arr.push(ele)}else{ele=ele.split("__ESC_EXP__").join("");if(!!ele&&opts.nodupes!==false){arr.push(ele)}else{var num=Math.pow(2,exp);arr.push.apply(arr,repeat(ele,num))}}}return arr}function wrap(val,ch){if(ch==="|"){return"("+val.join(ch)+")"}if(ch===","){return"{"+val.join(ch)+"}"}if(ch==="-"){return"["+val.join(ch)+"]"}if(ch==="\\"){return"\\{"+val+"\\}"}}function emptyBraces(str,arr,opts){return braces(str.split("{}").join("\\{\\}"),arr,opts)}function filterEmpty(ele){return!!ele&&ele!=="\\"}function splitWhitespace(str){var segs=str.split(" ");var len=segs.length;var res=[];var i=0;while(len--){res.push.apply(res,braces(segs[i++]))}return res}function escapeBraces(str,arr,opts){if(!/\{[^{]+\{/.test(str)){return arr.concat(str.split("\\").join(""))}else{str=str.split("\\{").join("__LT_BRACE__");str=str.split("\\}").join("__RT_BRACE__");return map(braces(str,arr,opts),function(ele){ele=ele.split("__LT_BRACE__").join("{");return ele.split("__RT_BRACE__").join("}")})}}function escapeDots(str,arr,opts){if(!/[^\\]\..+\\\./.test(str)){return arr.concat(str.split("\\").join(""))}else{str=str.split("\\.").join("__ESC_DOT__");return map(braces(str,arr,opts),function(ele){return ele.split("__ESC_DOT__").join(".")})}}function escapePaths(str,arr,opts){str=str.split("/.").join("__ESC_PATH__");return map(braces(str,arr,opts),function(ele){return ele.split("__ESC_PATH__").join("/.")})}function escapeCommas(str,arr,opts){if(!/\w,/.test(str)){return arr.concat(str.split("\\").join(""))}else{str=str.split("\\,").join("__ESC_COMMA__");return map(braces(str,arr,opts),function(ele){return ele.split("__ESC_COMMA__").join(",")})}}function patternRegex(){return/\$\{|[ \t]|{}|{,}|\\,|\/\.|\\\.|\\{|\\}/}function braceRegex(){return/.*(\\?\{([^}]+)\})/}function es6Regex(){return/\$\{([^}]+)\}/}var braceRe;var patternRe;function splice(str,token,replacement){var i=str.indexOf(token);return str.substr(0,i)+replacement+str.substr(i+token.length)}function map(arr,fn){if(arr==null){return[]}var len=arr.length;var res=new Array(len);var i=-1;while(++i<len){res[i]=fn(arr[i],i,arr)}return res}function filter(arr,cb){if(arr==null)return[];if(typeof cb!=="function"){throw new TypeError("braces: filter expects a callback function.")}var len=arr.length;var res=arr.slice();var i=0;while(len--){if(!cb(arr[len],i++)){res.splice(len,1)}}return res}},{"expand-range":22,preserve:28,"repeat-element":29}],22:[function(require,module,exports){"use strict";var fill=require("fill-range");module.exports=function expandRange(str,options,fn){if(typeof str!=="string"){throw new TypeError("expand-range expects a string.")}if(typeof options==="function"){fn=options;options={}}if(typeof options==="boolean"){options={};options.makeRe=true}var opts=options||{};var args=str.split("..");var len=args.length;if(len>3){return str}if(len===1){return args}if(typeof fn==="boolean"&&fn===true){opts.makeRe=true}args.push(opts);return fill.apply(fill,args.concat(fn))}},{"fill-range":23}],23:[function(require,module,exports){"use strict";var isObject=require("isobject");var isNumber=require("is-number");var randomize=require("randomatic");var repeatStr=require("repeat-string");var repeat=require("repeat-element");module.exports=fillRange;function fillRange(a,b,step,options,fn){if(a==null||b==null){throw new Error("fill-range expects the first and second args to be strings.")}if(typeof step==="function"){fn=step;options={};step=null}if(typeof options==="function"){fn=options;options={}}if(isObject(step)){options=step;step=""}var expand,regex=false,sep="";var opts=options||{};if(typeof opts.silent==="undefined"){opts.silent=true}step=step||opts.step;var origA=a,origB=b;b=b.toString()==="-0"?0:b;if(opts.optimize||opts.makeRe){step=step?step+="~":step;expand=true;regex=true;sep="~"}if(typeof step==="string"){var match=stepRe().exec(step);if(match){var i=match.index;var m=match[0];if(m==="+"){return repeat(a,b)}else if(m==="?"){return[randomize(a,b)]}else if(m===">"){step=step.substr(0,i)+step.substr(i+1);expand=true}else if(m==="|"){step=step.substr(0,i)+step.substr(i+1);expand=true;regex=true;sep=m}else if(m==="~"){step=step.substr(0,i)+step.substr(i+1);expand=true;regex=true;sep=m}}else if(!isNumber(step)){if(!opts.silent){throw new TypeError("fill-range: invalid step.")}return null}}if(/[.&*()[\]^%$#@!]/.test(a)||/[.&*()[\]^%$#@!]/.test(b)){if(!opts.silent){throw new RangeError("fill-range: invalid range arguments.")}return null}if(!noAlphaNum(a)||!noAlphaNum(b)||hasBoth(a)||hasBoth(b)){if(!opts.silent){throw new RangeError("fill-range: invalid range arguments.")}return null}var isNumA=isNumber(zeros(a));var isNumB=isNumber(zeros(b));if(!isNumA&&isNumB||isNumA&&!isNumB){if(!opts.silent){throw new TypeError("fill-range: first range argument is incompatible with second.")}return null}var isNum=isNumA;var num=formatStep(step);if(isNum){a=+a;b=+b}else{a=a.charCodeAt(0);b=b.charCodeAt(0)}var isDescending=a>b;if(a<0||b<0){expand=false;regex=false}var padding=isPadded(origA,origB);var res,pad,arr=[];var ii=0;if(regex){if(shouldExpand(a,b,num,isNum,padding,opts)){if(sep==="|"||sep==="~"){sep=detectSeparator(a,b,num,isNum,isDescending)}return wrap([origA,origB],sep,opts)}}while(isDescending?a>=b:a<=b){if(padding&&isNum){pad=padding(a)}if(typeof fn==="function"){res=fn(a,isNum,pad,ii++)}else if(!isNum){if(regex&&isInvalidChar(a)){res=null}else{res=String.fromCharCode(a)}}else{res=formatPadding(a,pad)}if(res!==null)arr.push(res);if(isDescending){a-=num}else{a+=num}}if((regex||expand)&&!opts.noexpand){if(sep==="|"||sep==="~"){sep=detectSeparator(a,b,num,isNum,isDescending)}if(arr.length===1||a<0||b<0){return arr}return wrap(arr,sep,opts)}return arr}function wrap(arr,sep,opts){if(sep==="~"){sep="-"}var str=arr.join(sep);var pre=opts&&opts.regexPrefix;if(sep==="|"){str=pre?pre+str:str;str="("+str+")"}if(sep==="-"){str=pre&&pre==="^"?pre+str:str;str="["+str+"]"}return[str]}function isCharClass(a,b,step,isNum,isDescending){if(isDescending){return false}if(isNum){return a<=9&&b<=9}if(a<b){return step===1}return false}function shouldExpand(a,b,num,isNum,padding,opts){if(isNum&&(a>9||b>9)){return false}return!padding&&num===1&&a<b}function detectSeparator(a,b,step,isNum,isDescending){var isChar=isCharClass(a,b,step,isNum,isDescending);if(!isChar){return"|"}return"~"}function formatStep(step){return Math.abs(step>>0)||1}function formatPadding(ch,pad){var res=pad?pad+ch:ch;if(pad&&ch.toString().charAt(0)==="-"){res="-"+pad+ch.toString().substr(1)}return res.toString()}function isInvalidChar(str){var ch=toStr(str);return ch==="\\"||ch==="["||ch==="]"||ch==="^"||ch==="("||ch===")"||ch==="`"}function toStr(ch){return String.fromCharCode(ch)}function stepRe(){return/\?|>|\||\+|\~/g}function noAlphaNum(val){return/[a-z0-9]/i.test(val)}function hasBoth(val){return/[a-z][0-9]|[0-9][a-z]/i.test(val)}function zeros(val){if(/^-*0+$/.test(val.toString())){return"0"}return val}function hasZeros(val){return/[^.]\.|^-*0+[0-9]/.test(val)}function isPadded(origA,origB){if(hasZeros(origA)||hasZeros(origB)){var alen=length(origA);var blen=length(origB);var len=alen>=blen?alen:blen;return function(a){return repeatStr("0",len-length(a))}}return false}function length(val){return val.toString().length}},{"is-number":24,isobject:25,randomatic:26,"repeat-element":29,"repeat-string":27}],24:[function(require,module,exports){"use strict";module.exports=function isNumber(n){return!!+n&&!Array.isArray(n)&&isFinite(n)||n==="0"||n===0}},{}],25:[function(require,module,exports){"use strict";module.exports=function isObject(val){return val!=null&&typeof val==="object"&&!Array.isArray(val)}},{}],26:[function(require,module,exports){"use strict";var isNumber=require("is-number");var typeOf=require("kind-of");module.exports=randomatic;var type={lower:"abcdefghijklmnopqrstuvwxyz",upper:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",number:"0123456789",special:"~!@#$%^&()_+-={}[];',."};type.all=type.lower+type.upper+type.number;function randomatic(pattern,length,options){if(typeof pattern==="undefined"){throw new Error("randomatic expects a string or number.")}var custom=false;if(arguments.length===1){if(typeof pattern==="string"){length=pattern.length}else if(isNumber(pattern)){options={};length=pattern;pattern="*"}}if(typeOf(length)==="object"&&length.hasOwnProperty("chars")){options=length;pattern=options.chars;length=pattern.length;custom=true}var opts=options||{};var mask="";var res="";if(pattern.indexOf("?")!==-1)mask+=opts.chars;if(pattern.indexOf("a")!==-1)mask+=type.lower;if(pattern.indexOf("A")!==-1)mask+=type.upper;
if(pattern.indexOf("0")!==-1)mask+=type.number;if(pattern.indexOf("!")!==-1)mask+=type.special;if(pattern.indexOf("*")!==-1)mask+=type.all;if(custom)mask+=pattern;while(length--){res+=mask.charAt(parseInt(Math.random()*mask.length))}return res}},{"is-number":24,"kind-of":51}],27:[function(require,module,exports){"use strict";module.exports=repeat;function repeat(str,num){if(typeof str!=="string"){throw new TypeError("repeat-string expects a string.")}if(num===1)return str;if(num===2)return str+str;var max=str.length*num;if(cache!==str||typeof cache==="undefined"){cache=str;res=""}while(max>res.length&&num>0){if(num&1){res+=str}num>>=1;if(!num)break;str+=str}return res.substr(0,max)}var res="";var cache},{}],28:[function(require,module,exports){"use strict";exports.before=function before(str,re){return str.replace(re,function(match){var id=randomize();cache[id]=match;return"__ID"+id+"__"})};exports.after=function after(str){return str.replace(/__ID(.{5})__/g,function(_,id){return cache[id]})};function randomize(){return Math.random().toString().slice(2,7)}var cache={}},{}],29:[function(require,module,exports){"use strict";module.exports=function repeat(ele,num){var arr=new Array(num);for(var i=0;i<num;i++){arr[i]=ele}return arr}},{}],30:[function(require,module,exports){"use strict";var POSIX={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E",punct:"!\"#$%&'()\\*+,-./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};module.exports=brackets;function brackets(str){var negated=false;if(str.indexOf("[^")!==-1){negated=true;str=str.split("[^").join("[")}if(str.indexOf("[!")!==-1){negated=true;str=str.split("[!").join("[")}var a=str.split("[");var b=str.split("]");var imbalanced=a.length!==b.length;var parts=str.split(/(?::\]\[:|\[?\[:|:\]\]?)/);var len=parts.length,i=0;var end="",beg="";var res=[];while(len--){var inner=parts[i++];if(inner==="^[!"||inner==="[!"){inner="";negated=true}var prefix=negated?"^":"";var ch=POSIX[inner];if(ch){res.push("["+prefix+ch+"]")}else if(inner){if(/^\[?\w-\w\]?$/.test(inner)){if(i===parts.length){res.push("["+prefix+inner)}else if(i===1){res.push(prefix+inner+"]")}else{res.push(prefix+inner)}}else{if(i===1){beg+=inner}else if(i===parts.length){end+=inner}else{res.push("["+prefix+inner+"]")}}}}var result=res.join("|");var len=res.length||1;if(len>1){result="(?:"+result+")";len=1}if(beg){len++;if(beg.charAt(0)==="["){if(imbalanced){beg="\\["+beg.slice(1)}else{beg+="]"}}result=beg+result}if(end){len++;if(end.slice(-1)==="]"){if(imbalanced){end=end.slice(0,end.length-1)+"\\]"}else{end="["+end}}result+=end}if(len>1){result=result.split("][").join("]|[");if(result.indexOf("|")!==-1&&!/\(\?/.test(result)){result="(?:"+result+")"}}result=result.replace(/\[+=|=\]+/g,"\\b");return result}brackets.makeRe=function(pattern){try{return new RegExp(brackets(pattern))}catch(err){}};brackets.isMatch=function(str,pattern){try{return brackets.makeRe(pattern).test(str)}catch(err){return false}};brackets.match=function(arr,pattern){var len=arr.length,i=0;var res=arr.slice();var re=brackets.makeRe(pattern);while(i<len){var ele=arr[i++];if(!re.test(ele)){continue}res.splice(i,1)}return res}},{}],31:[function(require,module,exports){"use strict";var isExtglob=require("is-extglob");var re,cache={};module.exports=extglob;function extglob(str,opts){opts=opts||{};var o={},i=0;var key=str+!!opts.regex+!!opts.contains+!!opts.escape;if(cache.hasOwnProperty(key)){return cache[key]}if(!(re instanceof RegExp)){re=regex()}var negate=false;while(isExtglob(str)){var match=re.exec(str);if(!match)break;var prefix=match[1];var id="__EXTGLOB_"+i++ +"__";o[id]=wrap(match[3],prefix,opts.escape);str=str.split(match[0]).join(id);if(prefix==="!"){negate=true}}var keys=Object.keys(o);var len=keys.length;while(len--){var prop=keys[len];str=str.split(prop).join(o[prop])}var result=opts.regex?toRegex(str,opts.contains,negate):str;return cache[key]=result}function wrap(str,prefix,esc){switch(prefix){case"!":return"(?!"+str+")[^/]"+(esc?"%%%~":"*?");case"@":return"(?:"+str+")";case"+":return"(?:"+str+")+";case"*":return"(?:"+str+")"+(esc?"%%":"*");case"?":return"(?:"+str+")"+(esc?"%~":"?");default:return str}}function regex(){return/(\\?[@?!+*$]\\?)(\(([^()]*?)\))/}function toRegex(pattern,contains,negate){var prefix=contains?"^":"";var after=contains?"$":"";pattern="(?:"+pattern+")"+after;if(negate){pattern=prefix+("(?!^"+pattern+").*$")}return new RegExp(prefix+pattern)}},{"is-extglob":32}],32:[function(require,module,exports){module.exports=function isExtglob(str){return typeof str==="string"&&/[@?!+*]\(/.test(str)}},{}],33:[function(require,module,exports){module.exports=function filenameRegex(){return/([^\\\/]+)$/}},{}],34:[function(require,module,exports){module.exports=function isGlob(str){return typeof str==="string"&&/[!*{}?(|)[\]]/.test(str)}},{}],35:[function(require,module,exports){"use strict";var isObject=require("isobject");var forOwn=require("for-own");module.exports=function omit(obj,keys){if(!isObject(obj))return{};if(!keys)return obj;keys=Array.isArray(keys)?keys:[keys];var res={};forOwn(obj,function(value,key){if(keys.indexOf(key)===-1){res[key]=value}});return res}},{"for-own":36,isobject:38}],36:[function(require,module,exports){"use strict";var forIn=require("for-in");var hasOwn=Object.prototype.hasOwnProperty;module.exports=function forOwn(o,fn,thisArg){forIn(o,function(val,key){if(hasOwn.call(o,key)){return fn.call(thisArg,o[key],key,o)}})}},{"for-in":37}],37:[function(require,module,exports){"use strict";module.exports=function forIn(o,fn,thisArg){for(var key in o){if(fn.call(thisArg,o[key],key,o)===false){break}}}},{}],38:[function(require,module,exports){arguments[4][25][0].apply(exports,arguments)},{dup:25}],39:[function(require,module,exports){"use strict";var isGlob=require("is-glob");var findBase=require("glob-base");var extglob=require("is-extglob");var dotfile=require("is-dotfile");var cache=module.exports.cache={};module.exports=function parseGlob(glob){if(cache.hasOwnProperty(glob)){return cache[glob]}var tok={};tok.orig=glob;tok.is={};glob=escape(glob);var parsed=findBase(glob);tok.is.glob=parsed.isGlob;tok.glob=parsed.glob;tok.base=parsed.base;var segs=/([^\/]*)$/.exec(glob);tok.path={};tok.path.dirname="";tok.path.basename=segs[1]||"";tok.path.dirname=glob.split(tok.path.basename).join("")||"";var basename=(tok.path.basename||"").split(".")||"";tok.path.filename=basename[0]||"";tok.path.extname=basename.slice(1).join(".")||"";tok.path.ext="";if(isGlob(tok.path.dirname)&&!tok.path.basename){if(!/\/$/.test(tok.glob)){tok.path.basename=tok.glob}tok.path.dirname=tok.base}if(glob.indexOf("/")===-1&&!tok.is.globstar){tok.path.dirname="";tok.path.basename=tok.orig}var dot=tok.path.basename.indexOf(".");if(dot!==-1){tok.path.filename=tok.path.basename.slice(0,dot);tok.path.extname=tok.path.basename.slice(dot)}if(tok.path.extname.charAt(0)==="."){var exts=tok.path.extname.split(".");tok.path.ext=exts[exts.length-1]}tok.glob=unescape(tok.glob);tok.path.dirname=unescape(tok.path.dirname);tok.path.basename=unescape(tok.path.basename);tok.path.filename=unescape(tok.path.filename);tok.path.extname=unescape(tok.path.extname);var is=glob&&tok.is.glob;tok.is.negated=glob&&glob.charAt(0)==="!";tok.is.extglob=glob&&extglob(glob);tok.is.braces=has(is,glob,"{");tok.is.brackets=has(is,glob,"[:");tok.is.globstar=has(is,glob,"**");tok.is.dotfile=dotfile(tok.path.basename)||dotfile(tok.path.filename);tok.is.dotdir=dotdir(tok.path.dirname);return cache[glob]=tok};function dotdir(base){if(base.indexOf("/.")!==-1){return true}if(base.charAt(0)==="."&&base.charAt(1)!=="/"){return true}return false}function has(is,glob,ch){return is&&glob.indexOf(ch)!==-1}function escape(str){var re=/\{([^{}]*?)}|\(([^()]*?)\)|\[([^\[\]]*?)\]/g;return str.replace(re,function(outter,braces,parens,brackets){var inner=braces||parens||brackets;if(!inner){return outter}return outter.split(inner).join(esc(inner))})}function esc(str){str=str.split("/").join("__SLASH__");str=str.split(".").join("__DOT__");return str}function unescape(str){str=str.split("__SLASH__").join("/");str=str.split("__DOT__").join(".");return str}},{"glob-base":40,"is-dotfile":42,"is-extglob":43,"is-glob":34}],40:[function(require,module,exports){"use strict";var path=require("path");var parent=require("glob-parent");module.exports=function globBase(pattern){if(typeof pattern!=="string"){throw new TypeError("glob-base expects a string.")}var res={};res.base=parent(pattern);res.isGlob=res.base!==pattern;if(res.base!=="."){res.glob=pattern.substr(res.base.length);if(res.glob.charAt(0)==="/"){res.glob=res.glob.substr(1)}}else{res.glob=pattern}if(!res.isGlob){res.base=dirname(pattern);res.glob=res.base!=="."?pattern.substr(res.base.length):pattern}if(res.glob.substr(0,2)==="./"){res.glob=res.glob.substr(2)}if(res.glob.charAt(0)==="/"){res.glob=res.glob.substr(1)}return res};function dirname(glob){if(glob.slice(-1)==="/")return glob;return path.dirname(glob)}},{"glob-parent":41,path:7}],41:[function(require,module,exports){"use strict";var path=require("path");var isglob=require("is-glob");module.exports=function globParent(str){while(isglob(str))str=path.dirname(str);return str}},{"is-glob":34,path:7}],42:[function(require,module,exports){module.exports=function(str){if(str.charCodeAt(0)===46&&str.indexOf("/",1)===-1){return true}var last=str.lastIndexOf("/");return last!==-1?str.charCodeAt(last+1)===46:false}},{}],43:[function(require,module,exports){arguments[4][32][0].apply(exports,arguments)},{dup:32}],44:[function(require,module,exports){"use strict";var isPrimitive=require("is-primitive");var equal=require("is-equal-shallow");module.exports=regexCache;function regexCache(fn,str,opts){var key="_default_",regex,cached;if(!str&&!opts){if(typeof fn!=="function"){return fn}return basic[key]||(basic[key]=fn())}var isString=typeof str==="string";if(isString){if(!opts){return basic[str]||(basic[str]=fn(str))}key=str}else{opts=str}cached=cache[key];if(cached&&equal(cached.opts,opts)){return cached.regex}memo(key,opts,regex=fn(str,opts));return regex}function memo(key,opts,regex){cache[key]={regex:regex,opts:opts}}var cache=module.exports.cache={};var basic=module.exports.basic={}},{"is-equal-shallow":45,"is-primitive":46}],45:[function(require,module,exports){"use strict";var isPrimitive=require("is-primitive");module.exports=function isEqual(a,b){if(!a&&!b){return true}if(!a&&b||a&&!b){return false}var numKeysA=0,numKeysB=0,key;for(key in b){numKeysB++;if(!isPrimitive(b[key])||!a.hasOwnProperty(key)||a[key]!==b[key]){return false}}for(key in a){numKeysA++}return numKeysA===numKeysB}},{"is-primitive":46}],46:[function(require,module,exports){"use strict";module.exports=function isPrimitive(value){return value==null||typeof value!=="function"&&typeof value!=="object"}},{}],47:[function(require,module,exports){var forOwn=require("for-own");var iterator=require("make-iterator");module.exports=function filterValues(obj,cb,thisArg){cb=iterator(cb,thisArg);var res={};forOwn(obj,function(val,key,o){if(cb(val,key,o)){res[key]=val}});return res}},{"for-own":48,"make-iterator":50}],48:[function(require,module,exports){arguments[4][36][0].apply(exports,arguments)},{dup:36,"for-in":49}],49:[function(require,module,exports){arguments[4][37][0].apply(exports,arguments)},{dup:37}],50:[function(require,module,exports){"use strict";var forOwn=require("for-own");module.exports=function makeIterator(src,thisArg){if(src==null){return noop}switch(typeof src){case"function":return typeof thisArg!=="undefined"?function(val,i,arr){return src.call(thisArg,val,i,arr)}:src;case"object":return function(val){return deepMatches(val,src)};case"string":case"number":return prop(src)}};function containsMatch(array,value){var len=array.length;var i=-1;while(++i<len){if(deepMatches(array[i],value)){return true}}return false}function matchArray(o,value){var len=value.length;var i=-1;while(++i<len){if(!containsMatch(o,value[i])){return false}}return true}function matchObject(o,value){var res=true;forOwn(value,function(val,key){if(!deepMatches(o[key],val)){return res=false}});return res}function deepMatches(o,value){if(o&&typeof o==="object"){if(Array.isArray(o)&&Array.isArray(value)){return matchArray(o,value)}else{return matchObject(o,value)}}else{return o===value}}function prop(name){return function(obj){return obj[name]}}function noop(val){return val}},{"for-own":48}],51:[function(require,module,exports){(function(Buffer){var toString=Object.prototype.toString;module.exports=function kindOf(val){if(val===undefined){return"undefined"}if(val===null){return"null"}if(val===true||val===false||val instanceof Boolean){return"boolean"}if(typeof val!=="object"){return typeof val}if(Array.isArray(val)){return"array"}var type=toString.call(val);if(val instanceof RegExp||type==="[object RegExp]"){return"regexp"}if(val instanceof Date||type==="[object Date]"){return"date"}if(type==="[object Function]"){return"function"}if(type==="[object Arguments]"){return"arguments"}if(typeof Buffer!=="undefined"&&Buffer.isBuffer(val)){return"buffer"}return type.slice(8,-1).toLowerCase()}}).call(this,require("buffer").Buffer)},{buffer:3}],52:[function(require,module,exports){"use strict";var sortDesc=require("sort-desc");var sortAsc=require("sort-asc");module.exports=function(obj,options){var sort={desc:sortDesc,asc:sortAsc};var fn,opts={},keys=Object.keys(obj);if(Array.isArray(options)){opts.keys=options;options={}}else if(typeof options==="function"){fn=options}else{for(var opt in options){if(options.hasOwnProperty(opt)){opts[opt]=options[opt]}}}fn=opts.sort||sortDesc;if(Boolean(opts.sortOrder)){fn=sort[opts.sortOrder.toLowerCase()]}if(Boolean(opts.sortBy)){keys=opts.sortBy(obj);fn=null}if(Boolean(opts.keys)){keys=opts.keys;if(!opts.sort&&!opts.sortOrder&&!opts.sortBy){fn=null}}if(fn){keys=keys.sort(fn)}var o={};var len=keys.length;var i=-1;while(++i<len){o[keys[i]]=obj[keys[i]]}return o}},{"sort-asc":53,"sort-desc":54}],53:[function(require,module,exports){"use strict";module.exports=function(a,b){return b<a?-1:1}},{}],54:[function(require,module,exports){"use strict";module.exports=function(a,b){return a<b?-1:1}},{}],55:[function(require,module,exports){var BaseElement=require("base-element");var xtend=require("xtend/mutable");var inherits=require("inherits");var attachCSS=require("attach-css");function ViewList(params){var self=this;if(!(self instanceof ViewList))return new ViewList(params);params=params||{};BaseElement.call(self,params.appendTo||document.body);this.on("load",function(node){self.height=node.offsetHeight});self._lastData=[];xtend(this,{tagName:"ul",childTagName:"li",className:"view-list",onscroll:function(){self._scrollTop=this.scrollTop;self.render(self._lastData);self.send("scroll",this)},eachrow:function(row){return this.html(self.childTagName,{style:{height:self.rowHeight}},[row])},height:500,rowHeight:30,_scrollTop:0,_visibleStart:0,_visibleEnd:0,_displayStart:0,_displayEnd:0},params)}inherits(ViewList,BaseElement);module.exports=ViewList;ViewList.prototype._calculateScroll=function(data){var total=data.length;var rowsPerBody=Math.floor((this.height-2)/this.rowHeight);this._visibleStart=Math.round(Math.floor(this._scrollTop/this.rowHeight));this._visibleEnd=Math.round(Math.min(this._visibleStart+rowsPerBody));this._displayStart=Math.round(Math.max(0,Math.floor(this._scrollTop/this.rowHeight)-rowsPerBody*1.5));this._displayEnd=Math.round(Math.min(this._displayStart+4*rowsPerBody,total))};ViewList.prototype.render=function(data){var self=this;this._lastData=data;this._calculateScroll(data);var rows=data.slice(this._displayStart,this._displayEnd);rows=rows.map(function(row){return self.eachrow.call(self,row)});rows.unshift(this.html(this.childTagName,{className:"top",style:{height:this._displayStart*this.rowHeight,padding:0,margin:0}}));rows.push(this.html(this.childTagName,{className:"bottom",style:{height:(data.length-this._displayEnd)*this.rowHeight,padding:0,margin:0}}));return this.afterRender(this.html(this.tagName,this,rows))};ViewList.prototype.css=function(){var tagName=this.tagName;var childTagName=this.childTagName;return attachCSS([tagName+" {","margin: 0;","padding: 0;","overflow: auto;","}",tagName+" "+childTagName+" {","list-style: none;","}"].join("\n"),this.vtree)}},{"attach-css":56,"base-element":79,inherits:82,"xtend/mutable":83}],56:[function(require,module,exports){var css=require("css");module.exports=function(src,vtree,opts){var ast=css.parse(src,opts);prefixSelector(ast.stylesheet.rules,vtree);return css.stringify(ast,opts)};function prefixSelector(rules,vtree){var props=vtree.properties||{};var rootClass=props.className;var rootId=props.id;if(!rootClass&&!rootId)throw new Error("The top level VirtualNode must have a className or an id");rootClass=rootClass.split(" ")[0];var rootTag=vtree.tagName.toLowerCase();rules=rules.map(function(rule){rule.selectors=rule.selectors.map(function(selector){var parts=selector.split(" ");if(parts[0].toLowerCase()===rootTag){selector=parts[0]+"."+rootClass;if(parts.length>1)selector+=" "+parts.slice(1).join(" ");return selector}else if(parts[0]==="#"+rootId||parts[0]==="."+rootClass||rootClass&&parts[0].slice(1,rootClass.length+1)===rootClass||rootId&&parts[0].slice(1,rootId.length+1)===rootId){return selector}return"."+rootClass+" "+selector});return rule})}},{css:57}],57:[function(require,module,exports){exports.parse=require("./lib/parse");exports.stringify=require("./lib/stringify")},{"./lib/parse":58,"./lib/stringify":62}],58:[function(require,module,exports){var commentre=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//g;module.exports=function(css,options){options=options||{};var lineno=1;var column=1;function updatePosition(str){var lines=str.match(/\n/g);if(lines)lineno+=lines.length;var i=str.lastIndexOf("\n");column=~i?str.length-i:column+str.length}function position(){var start={line:lineno,column:column};return function(node){node.position=new Position(start);whitespace();return node}}function Position(start){this.start=start;this.end={line:lineno,column:column};this.source=options.source}Position.prototype.content=css;var errorsList=[];function error(msg){var err=new Error(options.source+":"+lineno+":"+column+": "+msg);err.reason=msg;err.filename=options.source;err.line=lineno;err.column=column;err.source=css;if(options.silent){errorsList.push(err)}else{throw err}}function stylesheet(){var rulesList=rules();return{type:"stylesheet",stylesheet:{rules:rulesList,parsingErrors:errorsList}}}function open(){return match(/^{\s*/)}function close(){return match(/^}/)}function rules(){var node;var rules=[];whitespace();comments(rules);while(css.length&&css.charAt(0)!="}"&&(node=atrule()||rule())){if(node!==false){rules.push(node);comments(rules)}}return rules}function match(re){var m=re.exec(css);if(!m)return;var str=m[0];updatePosition(str);css=css.slice(str.length);return m}function whitespace(){match(/^\s*/)}function comments(rules){var c;rules=rules||[];while(c=comment()){if(c!==false){rules.push(c)}}return rules}function comment(){var pos=position();if("/"!=css.charAt(0)||"*"!=css.charAt(1))return;var i=2;while(""!=css.charAt(i)&&("*"!=css.charAt(i)||"/"!=css.charAt(i+1)))++i;i+=2;if(""===css.charAt(i-1)){return error("End of comment missing")}var str=css.slice(2,i-2);column+=2;updatePosition(str);css=css.slice(i);column+=2;return pos({type:"comment",comment:str})}function selector(){var m=match(/^([^{]+)/);if(!m)return;return trim(m[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(m){return m.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(s){return s.replace(/\u200C/g,",")})}function declaration(){var pos=position();var prop=match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!prop)return;prop=trim(prop[0]);if(!match(/^:\s*/))return error("property missing ':'");var val=match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);var ret=pos({type:"declaration",property:prop.replace(commentre,""),value:val?trim(val[0]).replace(commentre,""):""});match(/^[;\s]*/);return ret}function declarations(){var decls=[];if(!open())return error("missing '{'");comments(decls);var decl;while(decl=declaration()){if(decl!==false){decls.push(decl);comments(decls)}}if(!close())return error("missing '}'");return decls}function keyframe(){var m;var vals=[];var pos=position();while(m=match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/)){vals.push(m[1]);match(/^,\s*/)}if(!vals.length)return;return pos({type:"keyframe",values:vals,declarations:declarations()})}function atkeyframes(){var pos=position();var m=match(/^@([-\w]+)?keyframes\s*/);if(!m)return;var vendor=m[1];var m=match(/^([-\w]+)\s*/);if(!m)return error("@keyframes missing name");var name=m[1];if(!open())return error("@keyframes missing '{'");var frame;var frames=comments();while(frame=keyframe()){frames.push(frame);frames=frames.concat(comments())}if(!close())return error("@keyframes missing '}'");return pos({type:"keyframes",name:name,vendor:vendor,keyframes:frames})}function atsupports(){var pos=position();var m=match(/^@supports *([^{]+)/);if(!m)return;var supports=trim(m[1]);if(!open())return error("@supports missing '{'");var style=comments().concat(rules());if(!close())return error("@supports missing '}'");return pos({type:"supports",supports:supports,rules:style})}function athost(){var pos=position();var m=match(/^@host\s*/);if(!m)return;if(!open())return error("@host missing '{'");var style=comments().concat(rules());if(!close())return error("@host missing '}'");return pos({type:"host",rules:style})}function atmedia(){var pos=position();var m=match(/^@media *([^{]+)/);if(!m)return;var media=trim(m[1]);if(!open())return error("@media missing '{'");var style=comments().concat(rules());if(!close())return error("@media missing '}'");return pos({type:"media",media:media,rules:style})}function atcustommedia(){var pos=position();var m=match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(!m)return;return pos({type:"custom-media",name:trim(m[1]),media:trim(m[2])})}function atpage(){var pos=position();var m=match(/^@page */);if(!m)return;var sel=selector()||[];if(!open())return error("@page missing '{'");var decls=comments();var decl;while(decl=declaration()){decls.push(decl);decls=decls.concat(comments())}if(!close())return error("@page missing '}'");return pos({type:"page",selectors:sel,declarations:decls})}function atdocument(){var pos=position();var m=match(/^@([-\w]+)?document *([^{]+)/);if(!m)return;var vendor=trim(m[1]);var doc=trim(m[2]);if(!open())return error("@document missing '{'");var style=comments().concat(rules());if(!close())return error("@document missing '}'");return pos({type:"document",document:doc,vendor:vendor,rules:style})}function atfontface(){var pos=position();var m=match(/^@font-face\s*/);if(!m)return;if(!open())return error("@font-face missing '{'");var decls=comments();var decl;while(decl=declaration()){decls.push(decl);decls=decls.concat(comments())}if(!close())return error("@font-face missing '}'");return pos({type:"font-face",declarations:decls})}var atimport=_compileAtrule("import");var atcharset=_compileAtrule("charset");var atnamespace=_compileAtrule("namespace");function _compileAtrule(name){var re=new RegExp("^@"+name+"\\s*([^;]+);");return function(){var pos=position();var m=match(re);if(!m)return;var ret={type:name};ret[name]=m[1].trim();return pos(ret)}}function atrule(){if(css[0]!="@")return;return atkeyframes()||atmedia()||atcustommedia()||atsupports()||atimport()||atcharset()||atnamespace()||atdocument()||atpage()||athost()||atfontface()}function rule(){var pos=position();var sel=selector();if(!sel)return error("selector missing");comments();return pos({type:"rule",selectors:sel,declarations:declarations()})}return addParent(stylesheet())};function trim(str){return str?str.replace(/^\s+|\s+$/g,""):""}function addParent(obj,parent){var isNode=obj&&typeof obj.type==="string";var childParent=isNode?obj:parent;for(var k in obj){var value=obj[k];if(Array.isArray(value)){value.forEach(function(v){addParent(v,childParent)})}else if(value&&typeof value==="object"){addParent(value,childParent)}}if(isNode){Object.defineProperty(obj,"parent",{configurable:true,writable:true,enumerable:false,value:parent||null})}return obj}},{}],59:[function(require,module,exports){module.exports=Compiler;function Compiler(opts){this.options=opts||{}}Compiler.prototype.emit=function(str){return str};Compiler.prototype.visit=function(node){return this[node.type](node)};Compiler.prototype.mapVisit=function(nodes,delim){var buf="";delim=delim||"";for(var i=0,length=nodes.length;i<length;i++){buf+=this.visit(nodes[i]);if(delim&&i<length-1)buf+=this.emit(delim)}return buf}},{}],60:[function(require,module,exports){var Base=require("./compiler");var inherits=require("inherits");module.exports=Compiler;function Compiler(options){Base.call(this,options)}inherits(Compiler,Base);Compiler.prototype.compile=function(node){return node.stylesheet.rules.map(this.visit,this).join("")};Compiler.prototype.comment=function(node){return this.emit("",node.position)};Compiler.prototype.import=function(node){return this.emit("@import "+node.import+";",node.position)};Compiler.prototype.media=function(node){return this.emit("@media "+node.media,node.position)+this.emit("{")+this.mapVisit(node.rules)+this.emit("}")};Compiler.prototype.document=function(node){var doc="@"+(node.vendor||"")+"document "+node.document;return this.emit(doc,node.position)+this.emit("{")+this.mapVisit(node.rules)+this.emit("}")};Compiler.prototype.charset=function(node){return this.emit("@charset "+node.charset+";",node.position)};Compiler.prototype.namespace=function(node){return this.emit("@namespace "+node.namespace+";",node.position)};Compiler.prototype.supports=function(node){return this.emit("@supports "+node.supports,node.position)+this.emit("{")+this.mapVisit(node.rules)+this.emit("}")};Compiler.prototype.keyframes=function(node){return this.emit("@"+(node.vendor||"")+"keyframes "+node.name,node.position)+this.emit("{")+this.mapVisit(node.keyframes)+this.emit("}")};Compiler.prototype.keyframe=function(node){var decls=node.declarations;return this.emit(node.values.join(","),node.position)+this.emit("{")+this.mapVisit(decls)+this.emit("}")};Compiler.prototype.page=function(node){var sel=node.selectors.length?node.selectors.join(", "):"";return this.emit("@page "+sel,node.position)+this.emit("{")+this.mapVisit(node.declarations)+this.emit("}")};Compiler.prototype["font-face"]=function(node){return this.emit("@font-face",node.position)+this.emit("{")+this.mapVisit(node.declarations)+this.emit("}")};Compiler.prototype.host=function(node){return this.emit("@host",node.position)+this.emit("{")+this.mapVisit(node.rules)+this.emit("}")};Compiler.prototype["custom-media"]=function(node){return this.emit("@custom-media "+node.name+" "+node.media+";",node.position)};Compiler.prototype.rule=function(node){var decls=node.declarations;if(!decls.length)return"";return this.emit(node.selectors.join(","),node.position)+this.emit("{")+this.mapVisit(decls)+this.emit("}")};Compiler.prototype.declaration=function(node){return this.emit(node.property+":"+node.value,node.position)+this.emit(";")}},{"./compiler":59,inherits:82}],61:[function(require,module,exports){var Base=require("./compiler");var inherits=require("inherits");module.exports=Compiler;function Compiler(options){options=options||{};Base.call(this,options);this.indentation=options.indent}inherits(Compiler,Base);Compiler.prototype.compile=function(node){return this.stylesheet(node)};Compiler.prototype.stylesheet=function(node){return this.mapVisit(node.stylesheet.rules,"\n\n")};Compiler.prototype.comment=function(node){return this.emit(this.indent()+"/*"+node.comment+"*/",node.position)};Compiler.prototype.import=function(node){return this.emit("@import "+node.import+";",node.position)};Compiler.prototype.media=function(node){return this.emit("@media "+node.media,node.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(node.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")};Compiler.prototype.document=function(node){var doc="@"+(node.vendor||"")+"document "+node.document;return this.emit(doc,node.position)+this.emit(" "+" {\n"+this.indent(1))+this.mapVisit(node.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")};Compiler.prototype.charset=function(node){return this.emit("@charset "+node.charset+";",node.position)};Compiler.prototype.namespace=function(node){return this.emit("@namespace "+node.namespace+";",node.position)};Compiler.prototype.supports=function(node){return this.emit("@supports "+node.supports,node.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(node.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")};Compiler.prototype.keyframes=function(node){return this.emit("@"+(node.vendor||"")+"keyframes "+node.name,node.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(node.keyframes,"\n")+this.emit(this.indent(-1)+"}")};Compiler.prototype.keyframe=function(node){var decls=node.declarations;return this.emit(this.indent())+this.emit(node.values.join(", "),node.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(decls,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")};Compiler.prototype.page=function(node){var sel=node.selectors.length?node.selectors.join(", ")+" ":"";return this.emit("@page "+sel,node.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(node.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")};Compiler.prototype["font-face"]=function(node){return this.emit("@font-face ",node.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(node.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")};Compiler.prototype.host=function(node){return this.emit("@host",node.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(node.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")};Compiler.prototype["custom-media"]=function(node){return this.emit("@custom-media "+node.name+" "+node.media+";",node.position)};Compiler.prototype.rule=function(node){var indent=this.indent();var decls=node.declarations;if(!decls.length)return"";return this.emit(node.selectors.map(function(s){return indent+s}).join(",\n"),node.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(decls,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}")};Compiler.prototype.declaration=function(node){return this.emit(this.indent())+this.emit(node.property+": "+node.value,node.position)+this.emit(";")};Compiler.prototype.indent=function(level){this.level=this.level||1;if(null!=level){this.level+=level;return""}return Array(this.level).join(this.indentation||" ")}},{"./compiler":59,inherits:82}],62:[function(require,module,exports){var Compressed=require("./compress");var Identity=require("./identity");module.exports=function(node,options){options=options||{};var compiler=options.compress?new Compressed(options):new Identity(options);if(options.sourcemap){var sourcemaps=require("./source-map-support");sourcemaps(compiler);var code=compiler.compile(node);compiler.applySourceMaps();var map=options.sourcemap==="generator"?compiler.map:compiler.map.toJSON();return{code:code,map:map}}var code=compiler.compile(node);return code}},{"./compress":60,"./identity":61,"./source-map-support":63}],63:[function(require,module,exports){var SourceMap=require("source-map").SourceMapGenerator;var SourceMapConsumer=require("source-map").SourceMapConsumer;var sourceMapResolve=require("source-map-resolve");var urix=require("urix");var fs=require("fs");var path=require("path");module.exports=mixin;function mixin(compiler){compiler._comment=compiler.comment;compiler.map=new SourceMap;compiler.position={line:1,column:1};compiler.files={};for(var k in exports)compiler[k]=exports[k]}exports.updatePosition=function(str){var lines=str.match(/\n/g);if(lines)this.position.line+=lines.length;
var i=str.lastIndexOf("\n");this.position.column=~i?str.length-i:this.position.column+str.length};exports.emit=function(str,pos){if(pos){var sourceFile=urix(pos.source||"source.css");this.map.addMapping({source:sourceFile,generated:{line:this.position.line,column:Math.max(this.position.column-1,0)},original:{line:pos.start.line,column:pos.start.column-1}});this.addFile(sourceFile,pos)}this.updatePosition(str);return str};exports.addFile=function(file,pos){if(typeof pos.content!=="string")return;if(Object.prototype.hasOwnProperty.call(this.files,file))return;this.files[file]=pos.content};exports.applySourceMaps=function(){Object.keys(this.files).forEach(function(file){var content=this.files[file];this.map.setSourceContent(file,content);if(this.options.inputSourcemaps!==false){var originalMap=sourceMapResolve.resolveSync(content,file,fs.readFileSync);if(originalMap){var map=new SourceMapConsumer(originalMap.map);var relativeTo=originalMap.sourcesRelativeTo;this.map.applySourceMap(map,file,urix(path.dirname(relativeTo)))}}},this)};exports.comment=function(node){if(/^# sourceMappingURL=/.test(node.comment))return this.emit("",node.position);else return this._comment(node)}},{fs:1,path:7,"source-map":67,"source-map-resolve":66,urix:78}],64:[function(require,module,exports){void function(root,factory){if(typeof define==="function"&&define.amd){define(factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.resolveUrl=factory()}}(this,function(){function resolveUrl(){var numUrls=arguments.length;if(numUrls===0){throw new Error("resolveUrl requires at least one argument; got none.")}var base=document.createElement("base");base.href=arguments[0];if(numUrls===1){return base.href}var head=document.getElementsByTagName("head")[0];head.insertBefore(base,head.firstChild);var a=document.createElement("a");var resolved;for(var index=1;index<numUrls;index++){a.href=arguments[index];resolved=a.href;base.href=resolved}head.removeChild(base);return resolved}return resolveUrl})},{}],65:[function(require,module,exports){void function(root,factory){if(typeof define==="function"&&define.amd){define(factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.sourceMappingURL=factory()}}(this,function(){var innerRegex=/[#@] sourceMappingURL=([^\s'"]*)/;var regex=RegExp("(?:"+"/\\*"+"(?:\\s*\r?\n(?://)?)?"+"(?:"+innerRegex.source+")"+"\\s*"+"\\*/"+"|"+"//(?:"+innerRegex.source+")"+")"+"\\s*$");return{regex:regex,_innerRegex:innerRegex,getFrom:function(code){var match=code.match(regex);return match?match[1]||match[2]||"":null},existsIn:function(code){return regex.test(code)},removeFrom:function(code){return code.replace(regex,"")},insertBefore:function(code,string){var match=code.match(regex);if(match){return code.slice(0,match.index)+string+code.slice(match.index)}else{return code+string}}}})},{}],66:[function(require,module,exports){void function(root,factory){if(typeof define==="function"&&define.amd){define(["source-map-url","resolve-url"],factory)}else if(typeof exports==="object"){var sourceMappingURL=require("source-map-url");var resolveUrl=require("resolve-url");module.exports=factory(sourceMappingURL,resolveUrl)}else{root.sourceMapResolve=factory(root.sourceMappingURL,root.resolveUrl)}}(this,function(sourceMappingURL,resolveUrl){function callbackAsync(callback,error,result){setImmediate(function(){callback(error,result)})}function parseMapToJSON(string){return JSON.parse(string.replace(/^\)\]\}'/,""))}function resolveSourceMap(code,codeUrl,read,callback){var mapData;try{mapData=resolveSourceMapHelper(code,codeUrl)}catch(error){return callbackAsync(callback,error)}if(!mapData||mapData.map){return callbackAsync(callback,null,mapData)}read(mapData.url,function(error,result){if(error){return callback(error)}try{mapData.map=parseMapToJSON(String(result))}catch(error){return callback(error)}callback(null,mapData)})}function resolveSourceMapSync(code,codeUrl,read){var mapData=resolveSourceMapHelper(code,codeUrl);if(!mapData||mapData.map){return mapData}mapData.map=parseMapToJSON(String(read(mapData.url)));return mapData}var dataUriRegex=/^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/;var jsonMimeTypeRegex=/^(?:application|text)\/json$/;function resolveSourceMapHelper(code,codeUrl){var url=sourceMappingURL.getFrom(code);if(!url){return null}var dataUri=url.match(dataUriRegex);if(dataUri){var mimeType=dataUri[1];var lastParameter=dataUri[2];var encoded=dataUri[3];if(!jsonMimeTypeRegex.test(mimeType)){throw new Error("Unuseful data uri mime type: "+(mimeType||"text/plain"))}return{sourceMappingURL:url,url:null,sourcesRelativeTo:codeUrl,map:parseMapToJSON(lastParameter===";base64"?atob(encoded):decodeURIComponent(encoded))}}var mapUrl=resolveUrl(codeUrl,url);return{sourceMappingURL:url,url:mapUrl,sourcesRelativeTo:mapUrl,map:null}}function resolveSources(map,mapUrl,read,options,callback){if(typeof options==="function"){callback=options;options={}}var pending=map.sources.length;var errored=false;var result={sourcesResolved:[],sourcesContent:[]};var done=function(error){if(errored){return}if(error){errored=true;return callback(error)}pending--;if(pending===0){callback(null,result)}};resolveSourcesHelper(map,mapUrl,options,function(fullUrl,sourceContent,index){result.sourcesResolved[index]=fullUrl;if(typeof sourceContent==="string"){result.sourcesContent[index]=sourceContent;callbackAsync(done,null)}else{read(fullUrl,function(error,source){result.sourcesContent[index]=String(source);done(error)})}})}function resolveSourcesSync(map,mapUrl,read,options){var result={sourcesResolved:[],sourcesContent:[]};resolveSourcesHelper(map,mapUrl,options,function(fullUrl,sourceContent,index){result.sourcesResolved[index]=fullUrl;if(read!==null){if(typeof sourceContent==="string"){result.sourcesContent[index]=sourceContent}else{result.sourcesContent[index]=String(read(fullUrl))}}});return result}var endingSlash=/\/?$/;function resolveSourcesHelper(map,mapUrl,options,fn){options=options||{};var fullUrl;var sourceContent;for(var index=0,len=map.sources.length;index<len;index++){if(map.sourceRoot&&!options.ignoreSourceRoot){fullUrl=resolveUrl(mapUrl,map.sourceRoot.replace(endingSlash,"/"),map.sources[index])}else{fullUrl=resolveUrl(mapUrl,map.sources[index])}sourceContent=(map.sourcesContent||[])[index];fn(fullUrl,sourceContent,index)}}function resolve(code,codeUrl,read,options,callback){if(typeof options==="function"){callback=options;options={}}resolveSourceMap(code,codeUrl,read,function(error,mapData){if(error){return callback(error)}if(!mapData){return callback(null,null)}resolveSources(mapData.map,mapData.sourcesRelativeTo,read,options,function(error,result){if(error){return callback(error)}mapData.sourcesResolved=result.sourcesResolved;mapData.sourcesContent=result.sourcesContent;callback(null,mapData)})})}function resolveSync(code,codeUrl,read,options){var mapData=resolveSourceMapSync(code,codeUrl,read);if(!mapData){return null}var result=resolveSourcesSync(mapData.map,mapData.sourcesRelativeTo,read,options);mapData.sourcesResolved=result.sourcesResolved;mapData.sourcesContent=result.sourcesContent;return mapData}return{resolveSourceMap:resolveSourceMap,resolveSourceMapSync:resolveSourceMapSync,resolveSources:resolveSources,resolveSourcesSync:resolveSourcesSync,resolve:resolve,resolveSync:resolveSync}})},{"resolve-url":64,"source-map-url":65}],67:[function(require,module,exports){exports.SourceMapGenerator=require("./source-map/source-map-generator").SourceMapGenerator;exports.SourceMapConsumer=require("./source-map/source-map-consumer").SourceMapConsumer;exports.SourceNode=require("./source-map/source-node").SourceNode},{"./source-map/source-map-consumer":73,"./source-map/source-map-generator":74,"./source-map/source-node":75}],68:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var util=require("./util");function ArraySet(){this._array=[];this._set={}}ArraySet.fromArray=function ArraySet_fromArray(aArray,aAllowDuplicates){var set=new ArraySet;for(var i=0,len=aArray.length;i<len;i++){set.add(aArray[i],aAllowDuplicates)}return set};ArraySet.prototype.add=function ArraySet_add(aStr,aAllowDuplicates){var isDuplicate=this.has(aStr);var idx=this._array.length;if(!isDuplicate||aAllowDuplicates){this._array.push(aStr)}if(!isDuplicate){this._set[util.toSetString(aStr)]=idx}};ArraySet.prototype.has=function ArraySet_has(aStr){return Object.prototype.hasOwnProperty.call(this._set,util.toSetString(aStr))};ArraySet.prototype.indexOf=function ArraySet_indexOf(aStr){if(this.has(aStr)){return this._set[util.toSetString(aStr)]}throw new Error('"'+aStr+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(aIdx){if(aIdx>=0&&aIdx<this._array.length){return this._array[aIdx]}throw new Error("No element indexed by "+aIdx)};ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()};exports.ArraySet=ArraySet})},{"./util":76,amdefine:77}],69:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var base64=require("./base64");var VLQ_BASE_SHIFT=5;var VLQ_BASE=1<<VLQ_BASE_SHIFT;var VLQ_BASE_MASK=VLQ_BASE-1;var VLQ_CONTINUATION_BIT=VLQ_BASE;function toVLQSigned(aValue){return aValue<0?(-aValue<<1)+1:(aValue<<1)+0}function fromVLQSigned(aValue){var isNegative=(aValue&1)===1;var shifted=aValue>>1;return isNegative?-shifted:shifted}exports.encode=function base64VLQ_encode(aValue){var encoded="";var digit;var vlq=toVLQSigned(aValue);do{digit=vlq&VLQ_BASE_MASK;vlq>>>=VLQ_BASE_SHIFT;if(vlq>0){digit|=VLQ_CONTINUATION_BIT}encoded+=base64.encode(digit)}while(vlq>0);return encoded};exports.decode=function base64VLQ_decode(aStr,aOutParam){var i=0;var strLen=aStr.length;var result=0;var shift=0;var continuation,digit;do{if(i>=strLen){throw new Error("Expected more digits in base 64 VLQ value.")}digit=base64.decode(aStr.charAt(i++));continuation=!!(digit&VLQ_CONTINUATION_BIT);digit&=VLQ_BASE_MASK;result=result+(digit<<shift);shift+=VLQ_BASE_SHIFT}while(continuation);aOutParam.value=fromVLQSigned(result);aOutParam.rest=aStr.slice(i)}})},{"./base64":70,amdefine:77}],70:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var charToIntMap={};var intToCharMap={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(ch,index){charToIntMap[ch]=index;intToCharMap[index]=ch});exports.encode=function base64_encode(aNumber){if(aNumber in intToCharMap){return intToCharMap[aNumber]}throw new TypeError("Must be between 0 and 63: "+aNumber)};exports.decode=function base64_decode(aChar){if(aChar in charToIntMap){return charToIntMap[aChar]}throw new TypeError("Not a valid base 64 digit: "+aChar)}})},{amdefine:77}],71:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){function recursiveSearch(aLow,aHigh,aNeedle,aHaystack,aCompare){var mid=Math.floor((aHigh-aLow)/2)+aLow;var cmp=aCompare(aNeedle,aHaystack[mid],true);if(cmp===0){return mid}else if(cmp>0){if(aHigh-mid>1){return recursiveSearch(mid,aHigh,aNeedle,aHaystack,aCompare)}return mid}else{if(mid-aLow>1){return recursiveSearch(aLow,mid,aNeedle,aHaystack,aCompare)}return aLow<0?-1:aLow}}exports.search=function search(aNeedle,aHaystack,aCompare){if(aHaystack.length===0){return-1}return recursiveSearch(-1,aHaystack.length,aNeedle,aHaystack,aCompare)}})},{amdefine:77}],72:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var util=require("./util");function generatedPositionAfter(mappingA,mappingB){var lineA=mappingA.generatedLine;var lineB=mappingB.generatedLine;var columnA=mappingA.generatedColumn;var columnB=mappingB.generatedColumn;return lineB>lineA||lineB==lineA&&columnB>=columnA||util.compareByGeneratedPositions(mappingA,mappingB)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(aCallback,aThisArg){this._array.forEach(aCallback,aThisArg)};MappingList.prototype.add=function MappingList_add(aMapping){var mapping;if(generatedPositionAfter(this._last,aMapping)){this._last=aMapping;this._array.push(aMapping)}else{this._sorted=false;this._array.push(aMapping)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(util.compareByGeneratedPositions);this._sorted=true}return this._array};exports.MappingList=MappingList})},{"./util":76,amdefine:77}],73:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var util=require("./util");var binarySearch=require("./binary-search");var ArraySet=require("./array-set").ArraySet;var base64VLQ=require("./base64-vlq");function SourceMapConsumer(aSourceMap){var sourceMap=aSourceMap;if(typeof aSourceMap==="string"){sourceMap=JSON.parse(aSourceMap.replace(/^\)\]\}'/,""))}var version=util.getArg(sourceMap,"version");var sources=util.getArg(sourceMap,"sources");var names=util.getArg(sourceMap,"names",[]);var sourceRoot=util.getArg(sourceMap,"sourceRoot",null);var sourcesContent=util.getArg(sourceMap,"sourcesContent",null);var mappings=util.getArg(sourceMap,"mappings");var file=util.getArg(sourceMap,"file",null);if(version!=this._version){throw new Error("Unsupported version: "+version)}sources=sources.map(util.normalize);this._names=ArraySet.fromArray(names,true);this._sources=ArraySet.fromArray(sources,true);this.sourceRoot=sourceRoot;this.sourcesContent=sourcesContent;this._mappings=mappings;this.file=file}SourceMapConsumer.fromSourceMap=function SourceMapConsumer_fromSourceMap(aSourceMap){var smc=Object.create(SourceMapConsumer.prototype);smc._names=ArraySet.fromArray(aSourceMap._names.toArray(),true);smc._sources=ArraySet.fromArray(aSourceMap._sources.toArray(),true);smc.sourceRoot=aSourceMap._sourceRoot;smc.sourcesContent=aSourceMap._generateSourcesContent(smc._sources.toArray(),smc.sourceRoot);smc.file=aSourceMap._file;smc.__generatedMappings=aSourceMap._mappings.toArray().slice();smc.__originalMappings=aSourceMap._mappings.toArray().slice().sort(util.compareByOriginalPositions);return smc};SourceMapConsumer.prototype._version=3;Object.defineProperty(SourceMapConsumer.prototype,"sources",{get:function(){return this._sources.toArray().map(function(s){return this.sourceRoot!=null?util.join(this.sourceRoot,s):s},this)}});SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{get:function(){if(!this.__generatedMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{get:function(){if(!this.__originalMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._nextCharIsMappingSeparator=function SourceMapConsumer_nextCharIsMappingSeparator(aStr){var c=aStr.charAt(0);return c===";"||c===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(aStr,aSourceRoot){var generatedLine=1;var previousGeneratedColumn=0;var previousOriginalLine=0;var previousOriginalColumn=0;var previousSource=0;var previousName=0;var str=aStr;var temp={};var mapping;while(str.length>0){if(str.charAt(0)===";"){generatedLine++;str=str.slice(1);previousGeneratedColumn=0}else if(str.charAt(0)===","){str=str.slice(1)}else{mapping={};mapping.generatedLine=generatedLine;base64VLQ.decode(str,temp);mapping.generatedColumn=previousGeneratedColumn+temp.value;previousGeneratedColumn=mapping.generatedColumn;str=temp.rest;if(str.length>0&&!this._nextCharIsMappingSeparator(str)){base64VLQ.decode(str,temp);mapping.source=this._sources.at(previousSource+temp.value);previousSource+=temp.value;str=temp.rest;if(str.length===0||this._nextCharIsMappingSeparator(str)){throw new Error("Found a source, but no line and column")}base64VLQ.decode(str,temp);mapping.originalLine=previousOriginalLine+temp.value;previousOriginalLine=mapping.originalLine;mapping.originalLine+=1;str=temp.rest;if(str.length===0||this._nextCharIsMappingSeparator(str)){throw new Error("Found a source and line, but no column")}base64VLQ.decode(str,temp);mapping.originalColumn=previousOriginalColumn+temp.value;previousOriginalColumn=mapping.originalColumn;str=temp.rest;if(str.length>0&&!this._nextCharIsMappingSeparator(str)){base64VLQ.decode(str,temp);mapping.name=this._names.at(previousName+temp.value);previousName+=temp.value;str=temp.rest}}this.__generatedMappings.push(mapping);if(typeof mapping.originalLine==="number"){this.__originalMappings.push(mapping)}}}this.__generatedMappings.sort(util.compareByGeneratedPositions);this.__originalMappings.sort(util.compareByOriginalPositions)};SourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(aNeedle,aMappings,aLineName,aColumnName,aComparator){if(aNeedle[aLineName]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+aNeedle[aLineName])}if(aNeedle[aColumnName]<0){throw new TypeError("Column must be greater than or equal to 0, got "+aNeedle[aColumnName])}return binarySearch.search(aNeedle,aMappings,aComparator)};SourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var index=0;index<this._generatedMappings.length;++index){var mapping=this._generatedMappings[index];if(index+1<this._generatedMappings.length){var nextMapping=this._generatedMappings[index+1];if(mapping.generatedLine===nextMapping.generatedLine){mapping.lastGeneratedColumn=nextMapping.generatedColumn-1;continue}}mapping.lastGeneratedColumn=Infinity}};SourceMapConsumer.prototype.originalPositionFor=function SourceMapConsumer_originalPositionFor(aArgs){var needle={generatedLine:util.getArg(aArgs,"line"),generatedColumn:util.getArg(aArgs,"column")};var index=this._findMapping(needle,this._generatedMappings,"generatedLine","generatedColumn",util.compareByGeneratedPositions);if(index>=0){var mapping=this._generatedMappings[index];if(mapping.generatedLine===needle.generatedLine){var source=util.getArg(mapping,"source",null);if(source!=null&&this.sourceRoot!=null){source=util.join(this.sourceRoot,source)}return{source:source,line:util.getArg(mapping,"originalLine",null),column:util.getArg(mapping,"originalColumn",null),name:util.getArg(mapping,"name",null)}}}return{source:null,line:null,column:null,name:null}};SourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(aSource){if(!this.sourcesContent){return null}if(this.sourceRoot!=null){aSource=util.relative(this.sourceRoot,aSource)}if(this._sources.has(aSource)){return this.sourcesContent[this._sources.indexOf(aSource)]}var url;if(this.sourceRoot!=null&&(url=util.urlParse(this.sourceRoot))){var fileUriAbsPath=aSource.replace(/^file:\/\//,"");if(url.scheme=="file"&&this._sources.has(fileUriAbsPath)){return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]}if((!url.path||url.path=="/")&&this._sources.has("/"+aSource)){return this.sourcesContent[this._sources.indexOf("/"+aSource)]}}throw new Error('"'+aSource+'" is not in the SourceMap.')};SourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(aArgs){var needle={source:util.getArg(aArgs,"source"),originalLine:util.getArg(aArgs,"line"),originalColumn:util.getArg(aArgs,"column")};if(this.sourceRoot!=null){needle.source=util.relative(this.sourceRoot,needle.source)}var index=this._findMapping(needle,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions);if(index>=0){var mapping=this._originalMappings[index];return{line:util.getArg(mapping,"generatedLine",null),column:util.getArg(mapping,"generatedColumn",null),lastColumn:util.getArg(mapping,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(aArgs){var needle={source:util.getArg(aArgs,"source"),originalLine:util.getArg(aArgs,"line"),originalColumn:Infinity};if(this.sourceRoot!=null){needle.source=util.relative(this.sourceRoot,needle.source)}var mappings=[];var index=this._findMapping(needle,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions);if(index>=0){var mapping=this._originalMappings[index];while(mapping&&mapping.originalLine===needle.originalLine){mappings.push({line:util.getArg(mapping,"generatedLine",null),column:util.getArg(mapping,"generatedColumn",null),lastColumn:util.getArg(mapping,"lastGeneratedColumn",null)});mapping=this._originalMappings[--index]}}return mappings.reverse()};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(aCallback,aContext,aOrder){var context=aContext||null;var order=aOrder||SourceMapConsumer.GENERATED_ORDER;var mappings;switch(order){case SourceMapConsumer.GENERATED_ORDER:mappings=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:mappings=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var sourceRoot=this.sourceRoot;mappings.map(function(mapping){var source=mapping.source;if(source!=null&&sourceRoot!=null){source=util.join(sourceRoot,source)}return{source:source,generatedLine:mapping.generatedLine,generatedColumn:mapping.generatedColumn,originalLine:mapping.originalLine,originalColumn:mapping.originalColumn,name:mapping.name}}).forEach(aCallback,context)};exports.SourceMapConsumer=SourceMapConsumer})},{"./array-set":68,"./base64-vlq":69,"./binary-search":71,"./util":76,amdefine:77}],74:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var base64VLQ=require("./base64-vlq");var util=require("./util");var ArraySet=require("./array-set").ArraySet;var MappingList=require("./mapping-list").MappingList;function SourceMapGenerator(aArgs){if(!aArgs){aArgs={}}this._file=util.getArg(aArgs,"file",null);this._sourceRoot=util.getArg(aArgs,"sourceRoot",null);this._skipValidation=util.getArg(aArgs,"skipValidation",false);this._sources=new ArraySet;this._names=new ArraySet;this._mappings=new MappingList;this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(aSourceMapConsumer){var sourceRoot=aSourceMapConsumer.sourceRoot;var generator=new SourceMapGenerator({file:aSourceMapConsumer.file,sourceRoot:sourceRoot});aSourceMapConsumer.eachMapping(function(mapping){var newMapping={generated:{line:mapping.generatedLine,column:mapping.generatedColumn}};if(mapping.source!=null){newMapping.source=mapping.source;if(sourceRoot!=null){newMapping.source=util.relative(sourceRoot,newMapping.source)}newMapping.original={line:mapping.originalLine,column:mapping.originalColumn};if(mapping.name!=null){newMapping.name=mapping.name}}generator.addMapping(newMapping)});aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){generator.setSourceContent(sourceFile,content)}});return generator};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(aArgs){var generated=util.getArg(aArgs,"generated");var original=util.getArg(aArgs,"original",null);var source=util.getArg(aArgs,"source",null);var name=util.getArg(aArgs,"name",null);if(!this._skipValidation){this._validateMapping(generated,original,source,name)}if(source!=null&&!this._sources.has(source)){this._sources.add(source)}if(name!=null&&!this._names.has(name)){this._names.add(name)}this._mappings.add({generatedLine:generated.line,generatedColumn:generated.column,originalLine:original!=null&&original.line,originalColumn:original!=null&&original.column,source:source,name:name})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(aSourceFile,aSourceContent){var source=aSourceFile;if(this._sourceRoot!=null){source=util.relative(this._sourceRoot,source)}if(aSourceContent!=null){if(!this._sourcesContents){this._sourcesContents={}}this._sourcesContents[util.toSetString(source)]=aSourceContent}else if(this._sourcesContents){delete this._sourcesContents[util.toSetString(source)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(aSourceMapConsumer,aSourceFile,aSourceMapPath){var sourceFile=aSourceFile;if(aSourceFile==null){if(aSourceMapConsumer.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}sourceFile=aSourceMapConsumer.file}var sourceRoot=this._sourceRoot;if(sourceRoot!=null){sourceFile=util.relative(sourceRoot,sourceFile)}var newSources=new ArraySet;var newNames=new ArraySet;this._mappings.unsortedForEach(function(mapping){if(mapping.source===sourceFile&&mapping.originalLine!=null){var original=aSourceMapConsumer.originalPositionFor({line:mapping.originalLine,column:mapping.originalColumn});if(original.source!=null){mapping.source=original.source;if(aSourceMapPath!=null){mapping.source=util.join(aSourceMapPath,mapping.source)}if(sourceRoot!=null){mapping.source=util.relative(sourceRoot,mapping.source)}mapping.originalLine=original.line;mapping.originalColumn=original.column;if(original.name!=null){mapping.name=original.name}}}var source=mapping.source;if(source!=null&&!newSources.has(source)){newSources.add(source)}var name=mapping.name;if(name!=null&&!newNames.has(name)){newNames.add(name)}},this);this._sources=newSources;this._names=newNames;aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){if(aSourceMapPath!=null){sourceFile=util.join(aSourceMapPath,sourceFile)}if(sourceRoot!=null){sourceFile=util.relative(sourceRoot,sourceFile)}this.setSourceContent(sourceFile,content)}},this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(aGenerated,aOriginal,aSource,aName){if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aGenerated.line>0&&aGenerated.column>=0&&!aOriginal&&!aSource&&!aName){return}else if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aOriginal&&"line"in aOriginal&&"column"in aOriginal&&aGenerated.line>0&&aGenerated.column>=0&&aOriginal.line>0&&aOriginal.column>=0&&aSource){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:aGenerated,source:aSource,original:aOriginal,name:aName}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var previousGeneratedColumn=0;var previousGeneratedLine=1;var previousOriginalColumn=0;var previousOriginalLine=0;var previousName=0;var previousSource=0;var result="";var mapping;var mappings=this._mappings.toArray();for(var i=0,len=mappings.length;i<len;i++){mapping=mappings[i];if(mapping.generatedLine!==previousGeneratedLine){previousGeneratedColumn=0;while(mapping.generatedLine!==previousGeneratedLine){result+=";";previousGeneratedLine++}}else{if(i>0){if(!util.compareByGeneratedPositions(mapping,mappings[i-1])){continue}result+=","}}result+=base64VLQ.encode(mapping.generatedColumn-previousGeneratedColumn);previousGeneratedColumn=mapping.generatedColumn;if(mapping.source!=null){result+=base64VLQ.encode(this._sources.indexOf(mapping.source)-previousSource);previousSource=this._sources.indexOf(mapping.source);result+=base64VLQ.encode(mapping.originalLine-1-previousOriginalLine);previousOriginalLine=mapping.originalLine-1;result+=base64VLQ.encode(mapping.originalColumn-previousOriginalColumn);previousOriginalColumn=mapping.originalColumn;if(mapping.name!=null){result+=base64VLQ.encode(this._names.indexOf(mapping.name)-previousName);previousName=this._names.indexOf(mapping.name)}}}return result};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(aSources,aSourceRoot){return aSources.map(function(source){if(!this._sourcesContents){return null}if(aSourceRoot!=null){source=util.relative(aSourceRoot,source)}var key=util.toSetString(source);return Object.prototype.hasOwnProperty.call(this._sourcesContents,key)?this._sourcesContents[key]:null},this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){map.file=this._file}if(this._sourceRoot!=null){map.sourceRoot=this._sourceRoot}if(this._sourcesContents){map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot)}return map};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this)};exports.SourceMapGenerator=SourceMapGenerator})},{"./array-set":68,"./base64-vlq":69,"./mapping-list":72,"./util":76,amdefine:77}],75:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var SourceMapGenerator=require("./source-map-generator").SourceMapGenerator;var util=require("./util");var REGEX_NEWLINE=/(\r?\n)/;var NEWLINE_CODE=10;var isSourceNode="$$$isSourceNode$$$";function SourceNode(aLine,aColumn,aSource,aChunks,aName){this.children=[];this.sourceContents={};this.line=aLine==null?null:aLine;this.column=aColumn==null?null:aColumn;this.source=aSource==null?null:aSource;this.name=aName==null?null:aName;this[isSourceNode]=true;if(aChunks!=null)this.add(aChunks)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(aGeneratedCode,aSourceMapConsumer,aRelativePath){var node=new SourceNode;var remainingLines=aGeneratedCode.split(REGEX_NEWLINE);var shiftNextLine=function(){var lineContents=remainingLines.shift();var newLine=remainingLines.shift()||"";return lineContents+newLine};var lastGeneratedLine=1,lastGeneratedColumn=0;var lastMapping=null;aSourceMapConsumer.eachMapping(function(mapping){if(lastMapping!==null){if(lastGeneratedLine<mapping.generatedLine){var code="";addMappingWithCode(lastMapping,shiftNextLine());lastGeneratedLine++;lastGeneratedColumn=0}else{var nextLine=remainingLines[0];var code=nextLine.substr(0,mapping.generatedColumn-lastGeneratedColumn);remainingLines[0]=nextLine.substr(mapping.generatedColumn-lastGeneratedColumn);lastGeneratedColumn=mapping.generatedColumn;addMappingWithCode(lastMapping,code);lastMapping=mapping;return}}while(lastGeneratedLine<mapping.generatedLine){node.add(shiftNextLine());lastGeneratedLine++}if(lastGeneratedColumn<mapping.generatedColumn){var nextLine=remainingLines[0];node.add(nextLine.substr(0,mapping.generatedColumn));remainingLines[0]=nextLine.substr(mapping.generatedColumn);lastGeneratedColumn=mapping.generatedColumn}lastMapping=mapping},this);if(remainingLines.length>0){if(lastMapping){addMappingWithCode(lastMapping,shiftNextLine())}node.add(remainingLines.join(""))}aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){if(aRelativePath!=null){sourceFile=util.join(aRelativePath,sourceFile)}node.setSourceContent(sourceFile,content)}});return node;function addMappingWithCode(mapping,code){if(mapping===null||mapping.source===undefined){
node.add(code)}else{var source=aRelativePath?util.join(aRelativePath,mapping.source):mapping.source;node.add(new SourceNode(mapping.originalLine,mapping.originalColumn,source,code,mapping.name))}}};SourceNode.prototype.add=function SourceNode_add(aChunk){if(Array.isArray(aChunk)){aChunk.forEach(function(chunk){this.add(chunk)},this)}else if(aChunk[isSourceNode]||typeof aChunk==="string"){if(aChunk){this.children.push(aChunk)}}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk)}return this};SourceNode.prototype.prepend=function SourceNode_prepend(aChunk){if(Array.isArray(aChunk)){for(var i=aChunk.length-1;i>=0;i--){this.prepend(aChunk[i])}}else if(aChunk[isSourceNode]||typeof aChunk==="string"){this.children.unshift(aChunk)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk)}return this};SourceNode.prototype.walk=function SourceNode_walk(aFn){var chunk;for(var i=0,len=this.children.length;i<len;i++){chunk=this.children[i];if(chunk[isSourceNode]){chunk.walk(aFn)}else{if(chunk!==""){aFn(chunk,{source:this.source,line:this.line,column:this.column,name:this.name})}}}};SourceNode.prototype.join=function SourceNode_join(aSep){var newChildren;var i;var len=this.children.length;if(len>0){newChildren=[];for(i=0;i<len-1;i++){newChildren.push(this.children[i]);newChildren.push(aSep)}newChildren.push(this.children[i]);this.children=newChildren}return this};SourceNode.prototype.replaceRight=function SourceNode_replaceRight(aPattern,aReplacement){var lastChild=this.children[this.children.length-1];if(lastChild[isSourceNode]){lastChild.replaceRight(aPattern,aReplacement)}else if(typeof lastChild==="string"){this.children[this.children.length-1]=lastChild.replace(aPattern,aReplacement)}else{this.children.push("".replace(aPattern,aReplacement))}return this};SourceNode.prototype.setSourceContent=function SourceNode_setSourceContent(aSourceFile,aSourceContent){this.sourceContents[util.toSetString(aSourceFile)]=aSourceContent};SourceNode.prototype.walkSourceContents=function SourceNode_walkSourceContents(aFn){for(var i=0,len=this.children.length;i<len;i++){if(this.children[i][isSourceNode]){this.children[i].walkSourceContents(aFn)}}var sources=Object.keys(this.sourceContents);for(var i=0,len=sources.length;i<len;i++){aFn(util.fromSetString(sources[i]),this.sourceContents[sources[i]])}};SourceNode.prototype.toString=function SourceNode_toString(){var str="";this.walk(function(chunk){str+=chunk});return str};SourceNode.prototype.toStringWithSourceMap=function SourceNode_toStringWithSourceMap(aArgs){var generated={code:"",line:1,column:0};var map=new SourceMapGenerator(aArgs);var sourceMappingActive=false;var lastOriginalSource=null;var lastOriginalLine=null;var lastOriginalColumn=null;var lastOriginalName=null;this.walk(function(chunk,original){generated.code+=chunk;if(original.source!==null&&original.line!==null&&original.column!==null){if(lastOriginalSource!==original.source||lastOriginalLine!==original.line||lastOriginalColumn!==original.column||lastOriginalName!==original.name){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name})}lastOriginalSource=original.source;lastOriginalLine=original.line;lastOriginalColumn=original.column;lastOriginalName=original.name;sourceMappingActive=true}else if(sourceMappingActive){map.addMapping({generated:{line:generated.line,column:generated.column}});lastOriginalSource=null;sourceMappingActive=false}for(var idx=0,length=chunk.length;idx<length;idx++){if(chunk.charCodeAt(idx)===NEWLINE_CODE){generated.line++;generated.column=0;if(idx+1===length){lastOriginalSource=null;sourceMappingActive=false}else if(sourceMappingActive){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name})}}else{generated.column++}}});this.walkSourceContents(function(sourceFile,sourceContent){map.setSourceContent(sourceFile,sourceContent)});return{code:generated.code,map:map}};exports.SourceNode=SourceNode})},{"./source-map-generator":74,"./util":76,amdefine:77}],76:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs){return aArgs[aName]}else if(arguments.length===3){return aDefaultValue}else{throw new Error('"'+aName+'" is a required argument.')}}exports.getArg=getArg;var urlRegexp=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;var dataUrlRegexp=/^data:.+\,.+$/;function urlParse(aUrl){var match=aUrl.match(urlRegexp);if(!match){return null}return{scheme:match[1],auth:match[2],host:match[3],port:match[4],path:match[5]}}exports.urlParse=urlParse;function urlGenerate(aParsedUrl){var url="";if(aParsedUrl.scheme){url+=aParsedUrl.scheme+":"}url+="//";if(aParsedUrl.auth){url+=aParsedUrl.auth+"@"}if(aParsedUrl.host){url+=aParsedUrl.host}if(aParsedUrl.port){url+=":"+aParsedUrl.port}if(aParsedUrl.path){url+=aParsedUrl.path}return url}exports.urlGenerate=urlGenerate;function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){return aPath}path=url.path}var isAbsolute=path.charAt(0)==="/";var parts=path.split(/\/+/);for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i];if(part==="."){parts.splice(i,1)}else if(part===".."){up++}else if(up>0){if(part===""){parts.splice(i+1,up);up=0}else{parts.splice(i,2);up--}}}path=parts.join("/");if(path===""){path=isAbsolute?"/":"."}if(url){url.path=path;return urlGenerate(url)}return path}exports.normalize=normalize;function join(aRoot,aPath){if(aRoot===""){aRoot="."}if(aPath===""){aPath="."}var aPathUrl=urlParse(aPath);var aRootUrl=urlParse(aRoot);if(aRootUrl){aRoot=aRootUrl.path||"/"}if(aPathUrl&&!aPathUrl.scheme){if(aRootUrl){aPathUrl.scheme=aRootUrl.scheme}return urlGenerate(aPathUrl)}if(aPathUrl||aPath.match(dataUrlRegexp)){return aPath}if(aRootUrl&&!aRootUrl.host&&!aRootUrl.path){aRootUrl.host=aPath;return urlGenerate(aRootUrl)}var joined=aPath.charAt(0)==="/"?aPath:normalize(aRoot.replace(/\/+$/,"")+"/"+aPath);if(aRootUrl){aRootUrl.path=joined;return urlGenerate(aRootUrl)}return joined}exports.join=join;function relative(aRoot,aPath){if(aRoot===""){aRoot="."}aRoot=aRoot.replace(/\/$/,"");var url=urlParse(aRoot);if(aPath.charAt(0)=="/"&&url&&url.path=="/"){return aPath.slice(1)}return aPath.indexOf(aRoot+"/")===0?aPath.substr(aRoot.length+1):aPath}exports.relative=relative;function toSetString(aStr){return"$"+aStr}exports.toSetString=toSetString;function fromSetString(aStr){return aStr.substr(1)}exports.fromSetString=fromSetString;function strcmp(aStr1,aStr2){var s1=aStr1||"";var s2=aStr2||"";return(s1>s2)-(s1<s2)}function compareByOriginalPositions(mappingA,mappingB,onlyCompareOriginal){var cmp;cmp=strcmp(mappingA.source,mappingB.source);if(cmp){return cmp}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp){return cmp}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp||onlyCompareOriginal){return cmp}cmp=strcmp(mappingA.name,mappingB.name);if(cmp){return cmp}cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp){return cmp}return mappingA.generatedColumn-mappingB.generatedColumn}exports.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositions(mappingA,mappingB,onlyCompareGenerated){var cmp;cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp){return cmp}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp||onlyCompareGenerated){return cmp}cmp=strcmp(mappingA.source,mappingB.source);if(cmp){return cmp}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp){return cmp}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp){return cmp}return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositions=compareByGeneratedPositions})},{amdefine:77}],77:[function(require,module,exports){(function(process,__filename){"use strict";function amdefine(module,requireFn){"use strict";var defineCache={},loaderCache={},alreadyCalled=false,path=require("path"),makeRequire,stringRequire;function trimDots(ary){var i,part;for(i=0;ary[i];i+=1){part=ary[i];if(part==="."){ary.splice(i,1);i-=1}else if(part===".."){if(i===1&&(ary[2]===".."||ary[0]==="..")){break}else if(i>0){ary.splice(i-1,2);i-=2}}}}function normalize(name,baseName){var baseParts;if(name&&name.charAt(0)==="."){if(baseName){baseParts=baseName.split("/");baseParts=baseParts.slice(0,baseParts.length-1);baseParts=baseParts.concat(name.split("/"));trimDots(baseParts);name=baseParts.join("/")}}return name}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(id){function load(value){loaderCache[id]=value}load.fromText=function(id,text){throw new Error("amdefine does not implement load.fromText")};return load}makeRequire=function(systemRequire,exports,module,relId){function amdRequire(deps,callback){if(typeof deps==="string"){return stringRequire(systemRequire,exports,module,deps,relId)}else{deps=deps.map(function(depName){return stringRequire(systemRequire,exports,module,depName,relId)});if(callback){process.nextTick(function(){callback.apply(null,deps)})}}}amdRequire.toUrl=function(filePath){if(filePath.indexOf(".")===0){return normalize(filePath,path.dirname(module.filename))}else{return filePath}};return amdRequire};requireFn=requireFn||function req(){return module.require.apply(module,arguments)};function runFactory(id,deps,factory){var r,e,m,result;if(id){e=loaderCache[id]={};m={id:id,uri:__filename,exports:e};r=makeRequire(requireFn,e,m,id)}else{if(alreadyCalled){throw new Error("amdefine with no module ID cannot be called more than once per file.")}alreadyCalled=true;e=module.exports;m=module;r=makeRequire(requireFn,e,m,module.id)}if(deps){deps=deps.map(function(depName){return r(depName)})}if(typeof factory==="function"){result=factory.apply(m.exports,deps)}else{result=factory}if(result!==undefined){m.exports=result;if(id){loaderCache[id]=m.exports}}}stringRequire=function(systemRequire,exports,module,id,relId){var index=id.indexOf("!"),originalId=id,prefix,plugin;if(index===-1){id=normalize(id,relId);if(id==="require"){return makeRequire(systemRequire,exports,module,relId)}else if(id==="exports"){return exports}else if(id==="module"){return module}else if(loaderCache.hasOwnProperty(id)){return loaderCache[id]}else if(defineCache[id]){runFactory.apply(null,defineCache[id]);return loaderCache[id]}else{if(systemRequire){return systemRequire(originalId)}else{throw new Error("No module with ID: "+id)}}}else{prefix=id.substring(0,index);id=id.substring(index+1,id.length);plugin=stringRequire(systemRequire,exports,module,prefix,relId);if(plugin.normalize){id=plugin.normalize(id,makeNormalize(relId))}else{id=normalize(id,relId)}if(loaderCache[id]){return loaderCache[id]}else{plugin.load(id,makeRequire(systemRequire,exports,module,relId),makeLoad(id),{});return loaderCache[id]}}};function define(id,deps,factory){if(Array.isArray(id)){factory=deps;deps=id;id=undefined}else if(typeof id!=="string"){factory=id;id=deps=undefined}if(deps&&!Array.isArray(deps)){factory=deps;deps=undefined}if(!deps){deps=["require","exports","module"]}if(id){defineCache[id]=[id,deps,factory]}else{runFactory(id,deps,factory)}}define.require=function(id){if(loaderCache[id]){return loaderCache[id]}if(defineCache[id]){runFactory.apply(null,defineCache[id]);return loaderCache[id]}};define.amd={};return define}module.exports=amdefine}).call(this,require("_process"),"/node_modules/view-list/node_modules/attach-css/node_modules/css/node_modules/source-map/node_modules/amdefine/amdefine.js")},{_process:8,path:7}],78:[function(require,module,exports){var path=require("path");"use strict";function urix(aPath){if(path.sep==="\\"){return aPath.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/")}return aPath}module.exports=urix},{path:7}],79:[function(require,module,exports){module.exports=BaseElement;var document=require("global/document");var serialize=require("min-document/serialize");var h=require("virtual-dom/h");var diff=require("virtual-dom/diff");var patch=require("virtual-dom/patch");var createElement=require("virtual-dom/create-element");function BaseElement(el){if(!(this instanceof BaseElement))return new BaseElement(el);this.vtree=null;this.element=null;this.__appendTo__=typeof el==="undefined"||el===null?document.body:el;this.__events__=Object.create(null);this.__BaseElementSig__="be-"+Date.now();this.__onload__=new Onload(this.send.bind(this))}BaseElement.prototype.html=function(){return h.apply(this,arguments)};BaseElement.prototype.afterRender=function(vtree){if(this.hasOwnProperty("__BaseElementSig__")){return BaseElement.prototype.render.call(this,vtree)}return vtree};BaseElement.prototype.render=function(vtree){if(typeof vtree==="function"){vtree=vtree.call(this)}if(vtree&&vtree.properties&&!vtree.properties.className){vtree.properties.className=this.__BaseElementSig__}if(!this.vtree){this.vtree=vtree;this.element=createElement(this.vtree);if(this.__appendTo__!==false){this.__appendTo__.appendChild(this.element)}}else{var patches=diff(this.vtree,vtree);this.element=patch(this.element,patches);this.vtree=vtree}return this.vtree};BaseElement.prototype.toString=function(){this.render.apply(this,arguments);try{return serialize(this.element)}catch(err){return this.element.outerHTML}};BaseElement.prototype.send=function(name){var found=this.__events__[name];if(!found)return this;var args=Array.prototype.slice.call(arguments,1);for(var i=0;i<found.length;i++){var fn=found[i];if(typeof fn==="function")fn.apply(this,args)}return this};BaseElement.prototype.on=function(name,cb){if(!Array.isArray(this.__events__[name]))this.__events__[name]=[];this.__events__[name].push(cb)};function Onload(cb){this.cb=cb}Onload.prototype.hook=function(node){var self=this;setTimeout(function(){self.cb("load",node)},10)};Onload.prototype.unhook=function(node){var self=this;setTimeout(function(){self.cb("unload",node)},10)}},{"global/document":80,"min-document/serialize":81,"virtual-dom/create-element":84,"virtual-dom/diff":85,"virtual-dom/h":86,"virtual-dom/patch":94}],80:[function(require,module,exports){(function(global){var topLevel=typeof global!=="undefined"?global:typeof window!=="undefined"?window:{};var minDoc=require("min-document");if(typeof document!=="undefined"){module.exports=document}else{var doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"];if(!doccy){doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"]=minDoc}module.exports=doccy}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"min-document":2}],81:[function(require,module,exports){module.exports=serializeNode;var voidElements=/area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr/i;function serializeNode(node){switch(node.nodeType){case 3:return escapeText(node.data);case 8:return"<!--"+node.data+"-->";default:return serializeElement(node)}}function serializeElement(elem){var strings=[];var tagname=elem.tagName;if(elem.namespaceURI==="http://www.w3.org/1999/xhtml"){tagname=tagname.toLowerCase()}strings.push("<"+tagname+properties(elem)+datasetify(elem));if(voidElements.test(tagname)){strings.push(" />")}else{strings.push(">");if(elem.childNodes.length){strings.push.apply(strings,elem.childNodes.map(serializeNode))}else{strings.push(escapeText(elem.textContent||elem.innerText||""))}strings.push("</"+tagname+">")}return strings.join("")}function isProperty(elem,key){var type=typeof elem[key];if(key==="style"&&Object.keys(elem.style).length>0){return true}return elem.hasOwnProperty(key)&&(type==="string"||type==="boolean"||type==="number")&&key!=="nodeName"&&key!=="className"&&key!=="tagName"&&key!=="textContent"&&key!=="innerText"&&key!=="namespaceURI"}function stylify(styles){var attr="";Object.keys(styles).forEach(function(key){var value=styles[key];attr+=key+":"+value+";"});return attr}function datasetify(elem){var ds=elem.dataset;var props=[];for(var key in ds){props.push({name:"data-"+key,value:ds[key]})}return props.length?stringify(props):""}function stringify(list){var attributes=[];list.forEach(function(tuple){var name=tuple.name;var value=tuple.value;if(name==="style"){value=stylify(value)}attributes.push(name+"="+'"'+escapeAttributeValue(value)+'"')});return attributes.length?" "+attributes.join(" "):""}function properties(elem){var props=[];for(var key in elem){if(isProperty(elem,key)){props.push({name:key,value:elem[key]})}}for(var ns in elem._attributes){for(var attribute in elem._attributes[ns]){var name=(ns!=="null"?ns+":":"")+attribute;props.push({name:name,value:elem._attributes[ns][attribute]})}}if(elem.className){props.push({name:"class",value:elem.className})}return props.length?stringify(props):""}function escapeText(str){return str.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function escapeAttributeValue(str){return escapeText(str).replace(/"/g,"&quot;")}},{}],82:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],83:[function(require,module,exports){module.exports=extend;function extend(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(source.hasOwnProperty(key)){target[key]=source[key]}}}return target}},{}],84:[function(require,module,exports){var createElement=require("./vdom/create-element.js");module.exports=createElement},{"./vdom/create-element.js":96}],85:[function(require,module,exports){var diff=require("./vtree/diff.js");module.exports=diff},{"./vtree/diff.js":116}],86:[function(require,module,exports){var h=require("./virtual-hyperscript/index.js");module.exports=h},{"./virtual-hyperscript/index.js":103}],87:[function(require,module,exports){module.exports=function split(undef){var nativeSplit=String.prototype.split,compliantExecNpcg=/()??/.exec("")[1]===undef,self;self=function(str,separator,limit){if(Object.prototype.toString.call(separator)!=="[object RegExp]"){return nativeSplit.call(str,separator,limit)}var output=[],flags=(separator.ignoreCase?"i":"")+(separator.multiline?"m":"")+(separator.extended?"x":"")+(separator.sticky?"y":""),lastLastIndex=0,separator=new RegExp(separator.source,flags+"g"),separator2,match,lastIndex,lastLength;str+="";if(!compliantExecNpcg){separator2=new RegExp("^"+separator.source+"$(?!\\s)",flags)}limit=limit===undef?-1>>>0:limit>>>0;while(match=separator.exec(str)){lastIndex=match.index+match[0].length;if(lastIndex>lastLastIndex){output.push(str.slice(lastLastIndex,match.index));if(!compliantExecNpcg&&match.length>1){match[0].replace(separator2,function(){for(var i=1;i<arguments.length-2;i++){if(arguments[i]===undef){match[i]=undef}}})}if(match.length>1&&match.index<str.length){Array.prototype.push.apply(output,match.slice(1))}lastLength=match[0].length;lastLastIndex=lastIndex;if(output.length>=limit){break}}if(separator.lastIndex===match.index){separator.lastIndex++}}if(lastLastIndex===str.length){if(lastLength||!separator.test("")){output.push("")}}else{output.push(str.slice(lastLastIndex))}return output.length>limit?output.slice(0,limit):output};return self}()},{}],88:[function(require,module,exports){"use strict";var OneVersionConstraint=require("individual/one-version");var MY_VERSION="7";OneVersionConstraint("ev-store",MY_VERSION);var hashKey="__EV_STORE_KEY@"+MY_VERSION;module.exports=EvStore;function EvStore(elem){var hash=elem[hashKey];if(!hash){hash=elem[hashKey]={}}return hash}},{"individual/one-version":90}],89:[function(require,module,exports){(function(global){"use strict";var root=typeof window!=="undefined"?window:typeof global!=="undefined"?global:{};module.exports=Individual;function Individual(key,value){if(key in root){return root[key]}root[key]=value;return value}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],90:[function(require,module,exports){"use strict";var Individual=require("./index.js");module.exports=OneVersion;function OneVersion(moduleName,version,defaultValue){var key="__INDIVIDUAL_ONE_VERSION_"+moduleName;var enforceKey=key+"_ENFORCE_SINGLETON";var versionValue=Individual(enforceKey,version);if(versionValue!==version){throw new Error("Can only have one copy of "+moduleName+".\n"+"You already have version "+versionValue+" installed.\n"+"This means you cannot install version "+version)}return Individual(key,defaultValue)}},{"./index.js":89}],91:[function(require,module,exports){(function(global){var topLevel=typeof global!=="undefined"?global:typeof window!=="undefined"?window:{};var minDoc=require("min-document");if(typeof document!=="undefined"){module.exports=document}else{var doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"];if(!doccy){doccy=topLevel["__GLOBAL_DOCUMENT_CACHE@4"]=minDoc}module.exports=doccy}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"min-document":2}],92:[function(require,module,exports){"use strict";module.exports=function isObject(x){return typeof x==="object"&&x!==null}},{}],93:[function(require,module,exports){var nativeIsArray=Array.isArray;var toString=Object.prototype.toString;module.exports=nativeIsArray||isArray;function isArray(obj){return toString.call(obj)==="[object Array]"}},{}],94:[function(require,module,exports){var patch=require("./vdom/patch.js");module.exports=patch},{"./vdom/patch.js":99}],95:[function(require,module,exports){var isObject=require("is-object");var isHook=require("../vnode/is-vhook.js");module.exports=applyProperties;function applyProperties(node,props,previous){for(var propName in props){var propValue=props[propName];if(propValue===undefined){removeProperty(node,propName,propValue,previous)}else if(isHook(propValue)){removeProperty(node,propName,propValue,previous);if(propValue.hook){propValue.hook(node,propName,previous?previous[propName]:undefined)}}else{if(isObject(propValue)){patchObject(node,props,previous,propName,propValue)}else{node[propName]=propValue}}}}function removeProperty(node,propName,propValue,previous){if(previous){var previousValue=previous[propName];if(!isHook(previousValue)){if(propName==="attributes"){for(var attrName in previousValue){node.removeAttribute(attrName)}}else if(propName==="style"){for(var i in previousValue){node.style[i]=""}}else if(typeof previousValue==="string"){node[propName]=""}else{node[propName]=null}}else if(previousValue.unhook){previousValue.unhook(node,propName,propValue)}}}function patchObject(node,props,previous,propName,propValue){var previousValue=previous?previous[propName]:undefined;if(propName==="attributes"){for(var attrName in propValue){var attrValue=propValue[attrName];if(attrValue===undefined){node.removeAttribute(attrName)}else{node.setAttribute(attrName,attrValue)}}return}if(previousValue&&isObject(previousValue)&&getPrototype(previousValue)!==getPrototype(propValue)){node[propName]=propValue;return}if(!isObject(node[propName])){node[propName]={}}var replacer=propName==="style"?"":undefined;for(var k in propValue){var value=propValue[k];node[propName][k]=value===undefined?replacer:value}}function getPrototype(value){if(Object.getPrototypeOf){return Object.getPrototypeOf(value)}else if(value.__proto__){return value.__proto__}else if(value.constructor){return value.constructor.prototype}}},{"../vnode/is-vhook.js":107,"is-object":92}],96:[function(require,module,exports){var document=require("global/document");var applyProperties=require("./apply-properties");var isVNode=require("../vnode/is-vnode.js");var isVText=require("../vnode/is-vtext.js");var isWidget=require("../vnode/is-widget.js");var handleThunk=require("../vnode/handle-thunk.js");module.exports=createElement;function createElement(vnode,opts){var doc=opts?opts.document||document:document;var warn=opts?opts.warn:null;vnode=handleThunk(vnode).a;if(isWidget(vnode)){return vnode.init()}else if(isVText(vnode)){return doc.createTextNode(vnode.text)}else if(!isVNode(vnode)){if(warn){warn("Item is not a valid virtual dom node",vnode)}return null}var node=vnode.namespace===null?doc.createElement(vnode.tagName):doc.createElementNS(vnode.namespace,vnode.tagName);var props=vnode.properties;applyProperties(node,props);var children=vnode.children;for(var i=0;i<children.length;i++){var childNode=createElement(children[i],opts);if(childNode){node.appendChild(childNode)}}return node}},{"../vnode/handle-thunk.js":105,"../vnode/is-vnode.js":108,"../vnode/is-vtext.js":109,"../vnode/is-widget.js":110,"./apply-properties":95,"global/document":91}],97:[function(require,module,exports){var noChild={};module.exports=domIndex;function domIndex(rootNode,tree,indices,nodes){if(!indices||indices.length===0){return{}}else{indices.sort(ascending);return recurse(rootNode,tree,indices,nodes,0)}}function recurse(rootNode,tree,indices,nodes,rootIndex){nodes=nodes||{};if(rootNode){if(indexInRange(indices,rootIndex,rootIndex)){nodes[rootIndex]=rootNode}var vChildren=tree.children;if(vChildren){var childNodes=rootNode.childNodes;for(var i=0;i<tree.children.length;i++){rootIndex+=1;var vChild=vChildren[i]||noChild;var nextIndex=rootIndex+(vChild.count||0);if(indexInRange(indices,rootIndex,nextIndex)){recurse(childNodes[i],vChild,indices,nodes,rootIndex)}rootIndex=nextIndex}}}return nodes}function indexInRange(indices,left,right){if(indices.length===0){return false}var minIndex=0;var maxIndex=indices.length-1;var currentIndex;var currentItem;while(minIndex<=maxIndex){currentIndex=(maxIndex+minIndex)/2>>0;currentItem=indices[currentIndex];if(minIndex===maxIndex){return currentItem>=left&&currentItem<=right}else if(currentItem<left){minIndex=currentIndex+1}else if(currentItem>right){maxIndex=currentIndex-1}else{return true}}return false}function ascending(a,b){return a>b?1:-1}},{}],98:[function(require,module,exports){var applyProperties=require("./apply-properties");var isWidget=require("../vnode/is-widget.js");var VPatch=require("../vnode/vpatch.js");var updateWidget=require("./update-widget");module.exports=applyPatch;function applyPatch(vpatch,domNode,renderOptions){var type=vpatch.type;var vNode=vpatch.vNode;var patch=vpatch.patch;switch(type){case VPatch.REMOVE:return removeNode(domNode,vNode);case VPatch.INSERT:return insertNode(domNode,patch,renderOptions);case VPatch.VTEXT:return stringPatch(domNode,vNode,patch,renderOptions);case VPatch.WIDGET:return widgetPatch(domNode,vNode,patch,renderOptions);case VPatch.VNODE:return vNodePatch(domNode,vNode,patch,renderOptions);case VPatch.ORDER:reorderChildren(domNode,patch);return domNode;case VPatch.PROPS:applyProperties(domNode,patch,vNode.properties);return domNode;case VPatch.THUNK:return replaceRoot(domNode,renderOptions.patch(domNode,patch,renderOptions));default:return domNode}}function removeNode(domNode,vNode){var parentNode=domNode.parentNode;if(parentNode){parentNode.removeChild(domNode)}destroyWidget(domNode,vNode);return null}function insertNode(parentNode,vNode,renderOptions){var newNode=renderOptions.render(vNode,renderOptions);if(parentNode){parentNode.appendChild(newNode)}return parentNode}function stringPatch(domNode,leftVNode,vText,renderOptions){var newNode;if(domNode.nodeType===3){domNode.replaceData(0,domNode.length,vText.text);newNode=domNode}else{var parentNode=domNode.parentNode;newNode=renderOptions.render(vText,renderOptions);if(parentNode&&newNode!==domNode){parentNode.replaceChild(newNode,domNode)}}return newNode}function widgetPatch(domNode,leftVNode,widget,renderOptions){var updating=updateWidget(leftVNode,widget);var newNode;if(updating){newNode=widget.update(leftVNode,domNode)||domNode}else{newNode=renderOptions.render(widget,renderOptions)}var parentNode=domNode.parentNode;if(parentNode&&newNode!==domNode){parentNode.replaceChild(newNode,domNode)}if(!updating){destroyWidget(domNode,leftVNode)}return newNode}function vNodePatch(domNode,leftVNode,vNode,renderOptions){var parentNode=domNode.parentNode;var newNode=renderOptions.render(vNode,renderOptions);if(parentNode&&newNode!==domNode){parentNode.replaceChild(newNode,domNode)}return newNode}function destroyWidget(domNode,w){if(typeof w.destroy==="function"&&isWidget(w)){w.destroy(domNode)}}function reorderChildren(domNode,moves){var childNodes=domNode.childNodes;var keyMap={};var node;var remove;var insert;for(var i=0;i<moves.removes.length;i++){remove=moves.removes[i];node=childNodes[remove.from];if(remove.key){keyMap[remove.key]=node}domNode.removeChild(node)}var length=childNodes.length;for(var j=0;j<moves.inserts.length;j++){insert=moves.inserts[j];node=keyMap[insert.key];domNode.insertBefore(node,insert.to>=length++?null:childNodes[insert.to])}}function replaceRoot(oldRoot,newRoot){if(oldRoot&&newRoot&&oldRoot!==newRoot&&oldRoot.parentNode){oldRoot.parentNode.replaceChild(newRoot,oldRoot)}return newRoot}},{"../vnode/is-widget.js":110,"../vnode/vpatch.js":113,"./apply-properties":95,"./update-widget":100}],99:[function(require,module,exports){var document=require("global/document");var isArray=require("x-is-array");var render=require("./create-element");var domIndex=require("./dom-index");var patchOp=require("./patch-op");module.exports=patch;function patch(rootNode,patches,renderOptions){renderOptions=renderOptions||{};renderOptions.patch=renderOptions.patch||patchRecursive;renderOptions.render=renderOptions.render||render;return renderOptions.patch(rootNode,patches,renderOptions)}function patchRecursive(rootNode,patches,renderOptions){var indices=patchIndices(patches);if(indices.length===0){return rootNode}var index=domIndex(rootNode,patches.a,indices);var ownerDocument=rootNode.ownerDocument;if(!renderOptions.document&&ownerDocument!==document){renderOptions.document=ownerDocument}for(var i=0;i<indices.length;i++){var nodeIndex=indices[i];rootNode=applyPatch(rootNode,index[nodeIndex],patches[nodeIndex],renderOptions)}return rootNode}function applyPatch(rootNode,domNode,patchList,renderOptions){if(!domNode){return rootNode}var newNode;if(isArray(patchList)){for(var i=0;i<patchList.length;i++){newNode=patchOp(patchList[i],domNode,renderOptions);if(domNode===rootNode){rootNode=newNode}}}else{newNode=patchOp(patchList,domNode,renderOptions);if(domNode===rootNode){rootNode=newNode}}return rootNode}function patchIndices(patches){var indices=[];for(var key in patches){if(key!=="a"){indices.push(Number(key))}}return indices}},{"./create-element":96,"./dom-index":97,"./patch-op":98,"global/document":91,"x-is-array":93}],100:[function(require,module,exports){var isWidget=require("../vnode/is-widget.js");module.exports=updateWidget;function updateWidget(a,b){if(isWidget(a)&&isWidget(b)){if("name"in a&&"name"in b){return a.id===b.id}else{return a.init===b.init}}return false}},{"../vnode/is-widget.js":110}],101:[function(require,module,exports){"use strict";var EvStore=require("ev-store");module.exports=EvHook;function EvHook(value){if(!(this instanceof EvHook)){return new EvHook(value)}this.value=value}EvHook.prototype.hook=function(node,propertyName){var es=EvStore(node);var propName=propertyName.substr(3);es[propName]=this.value};EvHook.prototype.unhook=function(node,propertyName){var es=EvStore(node);var propName=propertyName.substr(3);es[propName]=undefined}},{"ev-store":88}],102:[function(require,module,exports){"use strict";module.exports=SoftSetHook;function SoftSetHook(value){if(!(this instanceof SoftSetHook)){return new SoftSetHook(value)}this.value=value}SoftSetHook.prototype.hook=function(node,propertyName){
if(node[propertyName]!==this.value){node[propertyName]=this.value}}},{}],103:[function(require,module,exports){"use strict";var isArray=require("x-is-array");var VNode=require("../vnode/vnode.js");var VText=require("../vnode/vtext.js");var isVNode=require("../vnode/is-vnode");var isVText=require("../vnode/is-vtext");var isWidget=require("../vnode/is-widget");var isHook=require("../vnode/is-vhook");var isVThunk=require("../vnode/is-thunk");var parseTag=require("./parse-tag.js");var softSetHook=require("./hooks/soft-set-hook.js");var evHook=require("./hooks/ev-hook.js");module.exports=h;function h(tagName,properties,children){var childNodes=[];var tag,props,key,namespace;if(!children&&isChildren(properties)){children=properties;props={}}props=props||properties||{};tag=parseTag(tagName,props);if(props.hasOwnProperty("key")){key=props.key;props.key=undefined}if(props.hasOwnProperty("namespace")){namespace=props.namespace;props.namespace=undefined}if(tag==="INPUT"&&!namespace&&props.hasOwnProperty("value")&&props.value!==undefined&&!isHook(props.value)){props.value=softSetHook(props.value)}transformProperties(props);if(children!==undefined&&children!==null){addChild(children,childNodes,tag,props)}return new VNode(tag,props,childNodes,key,namespace)}function addChild(c,childNodes,tag,props){if(typeof c==="string"){childNodes.push(new VText(c))}else if(typeof c==="number"){childNodes.push(new VText(String(c)))}else if(isChild(c)){childNodes.push(c)}else if(isArray(c)){for(var i=0;i<c.length;i++){addChild(c[i],childNodes,tag,props)}}else if(c===null||c===undefined){return}else{throw UnexpectedVirtualElement({foreignObject:c,parentVnode:{tagName:tag,properties:props}})}}function transformProperties(props){for(var propName in props){if(props.hasOwnProperty(propName)){var value=props[propName];if(isHook(value)){continue}if(propName.substr(0,3)==="ev-"){props[propName]=evHook(value)}}}}function isChild(x){return isVNode(x)||isVText(x)||isWidget(x)||isVThunk(x)}function isChildren(x){return typeof x==="string"||isArray(x)||isChild(x)}function UnexpectedVirtualElement(data){var err=new Error;err.type="virtual-hyperscript.unexpected.virtual-element";err.message="Unexpected virtual child passed to h().\n"+"Expected a VNode / Vthunk / VWidget / string but:\n"+"got:\n"+errorString(data.foreignObject)+".\n"+"The parent vnode is:\n"+errorString(data.parentVnode);"\n"+"Suggested fix: change your `h(..., [ ... ])` callsite.";err.foreignObject=data.foreignObject;err.parentVnode=data.parentVnode;return err}function errorString(obj){try{return JSON.stringify(obj,null," ")}catch(e){return String(obj)}}},{"../vnode/is-thunk":106,"../vnode/is-vhook":107,"../vnode/is-vnode":108,"../vnode/is-vtext":109,"../vnode/is-widget":110,"../vnode/vnode.js":112,"../vnode/vtext.js":114,"./hooks/ev-hook.js":101,"./hooks/soft-set-hook.js":102,"./parse-tag.js":104,"x-is-array":93}],104:[function(require,module,exports){"use strict";var split=require("browser-split");var classIdSplit=/([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/;var notClassId=/^\.|#/;module.exports=parseTag;function parseTag(tag,props){if(!tag){return"DIV"}var noId=!props.hasOwnProperty("id");var tagParts=split(tag,classIdSplit);var tagName=null;if(notClassId.test(tagParts[1])){tagName="DIV"}var classes,part,type,i;for(i=0;i<tagParts.length;i++){part=tagParts[i];if(!part){continue}type=part.charAt(0);if(!tagName){tagName=part}else if(type==="."){classes=classes||[];classes.push(part.substring(1,part.length))}else if(type==="#"&&noId){props.id=part.substring(1,part.length)}}if(classes){if(props.className){classes.push(props.className)}props.className=classes.join(" ")}return props.namespace?tagName:tagName.toUpperCase()}},{"browser-split":87}],105:[function(require,module,exports){var isVNode=require("./is-vnode");var isVText=require("./is-vtext");var isWidget=require("./is-widget");var isThunk=require("./is-thunk");module.exports=handleThunk;function handleThunk(a,b){var renderedA=a;var renderedB=b;if(isThunk(b)){renderedB=renderThunk(b,a)}if(isThunk(a)){renderedA=renderThunk(a,null)}return{a:renderedA,b:renderedB}}function renderThunk(thunk,previous){var renderedThunk=thunk.vnode;if(!renderedThunk){renderedThunk=thunk.vnode=thunk.render(previous)}if(!(isVNode(renderedThunk)||isVText(renderedThunk)||isWidget(renderedThunk))){throw new Error("thunk did not return a valid node")}return renderedThunk}},{"./is-thunk":106,"./is-vnode":108,"./is-vtext":109,"./is-widget":110}],106:[function(require,module,exports){module.exports=isThunk;function isThunk(t){return t&&t.type==="Thunk"}},{}],107:[function(require,module,exports){module.exports=isHook;function isHook(hook){return hook&&(typeof hook.hook==="function"&&!hook.hasOwnProperty("hook")||typeof hook.unhook==="function"&&!hook.hasOwnProperty("unhook"))}},{}],108:[function(require,module,exports){var version=require("./version");module.exports=isVirtualNode;function isVirtualNode(x){return x&&x.type==="VirtualNode"&&x.version===version}},{"./version":111}],109:[function(require,module,exports){var version=require("./version");module.exports=isVirtualText;function isVirtualText(x){return x&&x.type==="VirtualText"&&x.version===version}},{"./version":111}],110:[function(require,module,exports){module.exports=isWidget;function isWidget(w){return w&&w.type==="Widget"}},{}],111:[function(require,module,exports){module.exports="2"},{}],112:[function(require,module,exports){var version=require("./version");var isVNode=require("./is-vnode");var isWidget=require("./is-widget");var isThunk=require("./is-thunk");var isVHook=require("./is-vhook");module.exports=VirtualNode;var noProperties={};var noChildren=[];function VirtualNode(tagName,properties,children,key,namespace){this.tagName=tagName;this.properties=properties||noProperties;this.children=children||noChildren;this.key=key!=null?String(key):undefined;this.namespace=typeof namespace==="string"?namespace:null;var count=children&&children.length||0;var descendants=0;var hasWidgets=false;var hasThunks=false;var descendantHooks=false;var hooks;for(var propName in properties){if(properties.hasOwnProperty(propName)){var property=properties[propName];if(isVHook(property)&&property.unhook){if(!hooks){hooks={}}hooks[propName]=property}}}for(var i=0;i<count;i++){var child=children[i];if(isVNode(child)){descendants+=child.count||0;if(!hasWidgets&&child.hasWidgets){hasWidgets=true}if(!hasThunks&&child.hasThunks){hasThunks=true}if(!descendantHooks&&(child.hooks||child.descendantHooks)){descendantHooks=true}}else if(!hasWidgets&&isWidget(child)){if(typeof child.destroy==="function"){hasWidgets=true}}else if(!hasThunks&&isThunk(child)){hasThunks=true}}this.count=count+descendants;this.hasWidgets=hasWidgets;this.hasThunks=hasThunks;this.hooks=hooks;this.descendantHooks=descendantHooks}VirtualNode.prototype.version=version;VirtualNode.prototype.type="VirtualNode"},{"./is-thunk":106,"./is-vhook":107,"./is-vnode":108,"./is-widget":110,"./version":111}],113:[function(require,module,exports){var version=require("./version");VirtualPatch.NONE=0;VirtualPatch.VTEXT=1;VirtualPatch.VNODE=2;VirtualPatch.WIDGET=3;VirtualPatch.PROPS=4;VirtualPatch.ORDER=5;VirtualPatch.INSERT=6;VirtualPatch.REMOVE=7;VirtualPatch.THUNK=8;module.exports=VirtualPatch;function VirtualPatch(type,vNode,patch){this.type=Number(type);this.vNode=vNode;this.patch=patch}VirtualPatch.prototype.version=version;VirtualPatch.prototype.type="VirtualPatch"},{"./version":111}],114:[function(require,module,exports){var version=require("./version");module.exports=VirtualText;function VirtualText(text){this.text=String(text)}VirtualText.prototype.version=version;VirtualText.prototype.type="VirtualText"},{"./version":111}],115:[function(require,module,exports){var isObject=require("is-object");var isHook=require("../vnode/is-vhook");module.exports=diffProps;function diffProps(a,b){var diff;for(var aKey in a){if(!(aKey in b)){diff=diff||{};diff[aKey]=undefined}var aValue=a[aKey];var bValue=b[aKey];if(aValue===bValue){continue}else if(isObject(aValue)&&isObject(bValue)){if(getPrototype(bValue)!==getPrototype(aValue)){diff=diff||{};diff[aKey]=bValue}else if(isHook(bValue)){diff=diff||{};diff[aKey]=bValue}else{var objectDiff=diffProps(aValue,bValue);if(objectDiff){diff=diff||{};diff[aKey]=objectDiff}}}else{diff=diff||{};diff[aKey]=bValue}}for(var bKey in b){if(!(bKey in a)){diff=diff||{};diff[bKey]=b[bKey]}}return diff}function getPrototype(value){if(Object.getPrototypeOf){return Object.getPrototypeOf(value)}else if(value.__proto__){return value.__proto__}else if(value.constructor){return value.constructor.prototype}}},{"../vnode/is-vhook":107,"is-object":92}],116:[function(require,module,exports){var isArray=require("x-is-array");var VPatch=require("../vnode/vpatch");var isVNode=require("../vnode/is-vnode");var isVText=require("../vnode/is-vtext");var isWidget=require("../vnode/is-widget");var isThunk=require("../vnode/is-thunk");var handleThunk=require("../vnode/handle-thunk");var diffProps=require("./diff-props");module.exports=diff;function diff(a,b){var patch={a:a};walk(a,b,patch,0);return patch}function walk(a,b,patch,index){if(a===b){return}var apply=patch[index];var applyClear=false;if(isThunk(a)||isThunk(b)){thunks(a,b,patch,index)}else if(b==null){if(!isWidget(a)){clearState(a,patch,index);apply=patch[index]}apply=appendPatch(apply,new VPatch(VPatch.REMOVE,a,b))}else if(isVNode(b)){if(isVNode(a)){if(a.tagName===b.tagName&&a.namespace===b.namespace&&a.key===b.key){var propsPatch=diffProps(a.properties,b.properties);if(propsPatch){apply=appendPatch(apply,new VPatch(VPatch.PROPS,a,propsPatch))}apply=diffChildren(a,b,patch,apply,index)}else{apply=appendPatch(apply,new VPatch(VPatch.VNODE,a,b));applyClear=true}}else{apply=appendPatch(apply,new VPatch(VPatch.VNODE,a,b));applyClear=true}}else if(isVText(b)){if(!isVText(a)){apply=appendPatch(apply,new VPatch(VPatch.VTEXT,a,b));applyClear=true}else if(a.text!==b.text){apply=appendPatch(apply,new VPatch(VPatch.VTEXT,a,b))}}else if(isWidget(b)){if(!isWidget(a)){applyClear=true}apply=appendPatch(apply,new VPatch(VPatch.WIDGET,a,b))}if(apply){patch[index]=apply}if(applyClear){clearState(a,patch,index)}}function diffChildren(a,b,patch,apply,index){var aChildren=a.children;var orderedSet=reorder(aChildren,b.children);var bChildren=orderedSet.children;var aLen=aChildren.length;var bLen=bChildren.length;var len=aLen>bLen?aLen:bLen;for(var i=0;i<len;i++){var leftNode=aChildren[i];var rightNode=bChildren[i];index+=1;if(!leftNode){if(rightNode){apply=appendPatch(apply,new VPatch(VPatch.INSERT,null,rightNode))}}else{walk(leftNode,rightNode,patch,index)}if(isVNode(leftNode)&&leftNode.count){index+=leftNode.count}}if(orderedSet.moves){apply=appendPatch(apply,new VPatch(VPatch.ORDER,a,orderedSet.moves))}return apply}function clearState(vNode,patch,index){unhook(vNode,patch,index);destroyWidgets(vNode,patch,index)}function destroyWidgets(vNode,patch,index){if(isWidget(vNode)){if(typeof vNode.destroy==="function"){patch[index]=appendPatch(patch[index],new VPatch(VPatch.REMOVE,vNode,null))}}else if(isVNode(vNode)&&(vNode.hasWidgets||vNode.hasThunks)){var children=vNode.children;var len=children.length;for(var i=0;i<len;i++){var child=children[i];index+=1;destroyWidgets(child,patch,index);if(isVNode(child)&&child.count){index+=child.count}}}else if(isThunk(vNode)){thunks(vNode,null,patch,index)}}function thunks(a,b,patch,index){var nodes=handleThunk(a,b);var thunkPatch=diff(nodes.a,nodes.b);if(hasPatches(thunkPatch)){patch[index]=new VPatch(VPatch.THUNK,null,thunkPatch)}}function hasPatches(patch){for(var index in patch){if(index!=="a"){return true}}return false}function unhook(vNode,patch,index){if(isVNode(vNode)){if(vNode.hooks){patch[index]=appendPatch(patch[index],new VPatch(VPatch.PROPS,vNode,undefinedKeys(vNode.hooks)))}if(vNode.descendantHooks||vNode.hasThunks){var children=vNode.children;var len=children.length;for(var i=0;i<len;i++){var child=children[i];index+=1;unhook(child,patch,index);if(isVNode(child)&&child.count){index+=child.count}}}}else if(isThunk(vNode)){thunks(vNode,null,patch,index)}}function undefinedKeys(obj){var result={};for(var key in obj){result[key]=undefined}return result}function reorder(aChildren,bChildren){var bChildIndex=keyIndex(bChildren);var bKeys=bChildIndex.keys;var bFree=bChildIndex.free;if(bFree.length===bChildren.length){return{children:bChildren,moves:null}}var aChildIndex=keyIndex(aChildren);var aKeys=aChildIndex.keys;var aFree=aChildIndex.free;if(aFree.length===aChildren.length){return{children:bChildren,moves:null}}var newChildren=[];var freeIndex=0;var freeCount=bFree.length;var deletedItems=0;for(var i=0;i<aChildren.length;i++){var aItem=aChildren[i];var itemIndex;if(aItem.key){if(bKeys.hasOwnProperty(aItem.key)){itemIndex=bKeys[aItem.key];newChildren.push(bChildren[itemIndex])}else{itemIndex=i-deletedItems++;newChildren.push(null)}}else{if(freeIndex<freeCount){itemIndex=bFree[freeIndex++];newChildren.push(bChildren[itemIndex])}else{itemIndex=i-deletedItems++;newChildren.push(null)}}}var lastFreeIndex=freeIndex>=bFree.length?bChildren.length:bFree[freeIndex];for(var j=0;j<bChildren.length;j++){var newItem=bChildren[j];if(newItem.key){if(!aKeys.hasOwnProperty(newItem.key)){newChildren.push(newItem)}}else if(j>=lastFreeIndex){newChildren.push(newItem)}}var simulate=newChildren.slice();var simulateIndex=0;var removes=[];var inserts=[];var simulateItem;for(var k=0;k<bChildren.length;){var wantedItem=bChildren[k];simulateItem=simulate[simulateIndex];while(simulateItem===null&&simulate.length){removes.push(remove(simulate,simulateIndex,null));simulateItem=simulate[simulateIndex]}if(!simulateItem||simulateItem.key!==wantedItem.key){if(wantedItem.key){if(simulateItem&&simulateItem.key){if(bKeys[simulateItem.key]!==k+1){removes.push(remove(simulate,simulateIndex,simulateItem.key));simulateItem=simulate[simulateIndex];if(!simulateItem||simulateItem.key!==wantedItem.key){inserts.push({key:wantedItem.key,to:k})}else{simulateIndex++}}else{inserts.push({key:wantedItem.key,to:k})}}else{inserts.push({key:wantedItem.key,to:k})}k++}else if(simulateItem&&simulateItem.key){removes.push(remove(simulate,simulateIndex,simulateItem.key))}}else{simulateIndex++;k++}}while(simulateIndex<simulate.length){simulateItem=simulate[simulateIndex];removes.push(remove(simulate,simulateIndex,simulateItem&&simulateItem.key))}if(removes.length===deletedItems&&!inserts.length){return{children:newChildren,moves:null}}return{children:newChildren,moves:{removes:removes,inserts:inserts}}}function remove(arr,index,key){arr.splice(index,1);return{from:index,key:key}}function keyIndex(children){var keys={};var free=[];var length=children.length;for(var i=0;i<length;i++){var child=children[i];if(child.key){keys[child.key]=i}else{free.push(i)}}return{keys:keys,free:free}}function appendPatch(apply,patch){if(apply){if(isArray(apply)){apply.push(patch)}else{apply=[apply,patch]}return apply}else{return patch}}},{"../vnode/handle-thunk":105,"../vnode/is-thunk":106,"../vnode/is-vnode":108,"../vnode/is-vtext":109,"../vnode/is-widget":110,"../vnode/vpatch":113,"./diff-props":115,"x-is-array":93}],"data-cards":[function(require,module,exports){var filter=require("filter-object");var ViewList=require("view-list");var h=require("virtual-dom/h");var extend=require("extend");module.exports=function(opts){var options=extend({className:"data-card-list",eachrow:rows,titleField:"title"},opts);function rows(row){var title=row[options.titleField];var fields=filter(row,["*","!"+options.titleField]);var fieldElements=Object.keys(fields).map(eachField);function eachField(key,i){return h("li.data-card-field",[h("span.data-card-field-key."+key,key),h("span.data-card-field-value",fields[key])])}return h("li.data-card",[h("h2.data-card-title",title),h("ul.data-card-fields",fieldElements)])}return new ViewList(options)}},{extend:9,"filter-object":10,"view-list":55,"virtual-dom/h":86}]},{},[]);var diff=require("virtual-dom/diff");var patch=require("virtual-dom/patch");var createElement=require("virtual-dom/create-element");var raf=require("raf");var dataCards=require("data-cards")({height:window.innerHeight-100,rowHeight:200});function render(){return dataCards.render()}var i=0;setInterval(function(){dataCards.write({title:"this is title "+i,description:"this has long text that cuts off its cool this has long text that cuts off its cool this has long text that cuts off its cool this has long text that cuts off its cool this has long text that cuts off its cool ",someField:"this is a field",another:"123123"});i++},1e3);var tree=render();var rootNode=createElement(tree);document.body.appendChild(rootNode);raf(function tick(){var newTree=render();var patches=diff(tree,newTree);rootNode=patch(rootNode,patches);tree=newTree;raf(tick)});
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"virtual-dom": "2.1.0",
"raf": "2.0.4",
"data-cards": "0.0.1"
}
}
<!-- contents of this file will be placed inside the <body> -->
<style>
.data-card-list {
margin: 0px;
padding: 0px;
height: 100%;
overflow: auto;
}
.data-card-list li {
list-style-type: none;
}
.data-card {
background-color: #fff;
border-bottom: 1px solid #aeaeae;
border-right: 1px solid #ccc;
padding: 12px;
margin: 0px 0px 20px 0px;
}
.data-card-title {
font-weight: 600;
margin: 0px 0px 10px 0px;
}
.data-card-fields {
margin: 0px;
padding: 0px;
border: 1px solid #efefea;
border-bottom: 0px;
}
.data-card-field {
font-size: 13px;
border-bottom: 1px solid #efefea;
}
.data-card-field-key {
font-weight: 600;
color: #666;
display: inline-block;
background-color: #fcfcfa;
padding: 3px 5px 3px 3px;
width: 33%;
height: 30px;
text-align: right;
vertical-align: top;
line-height: 27px;
overflow: hidden;
}
.data-card-field-value {
font-weight: 400;
color: #444;
display: inline-block;
padding: 3px 3px 3px 5px;
overflow: hidden;
width: 66%;
height: 30px;
vertical-align: top;
line-height: 27px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment