UNPKG

youbetter-desktop-app

Version:
2 lines 343 kB
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(10),i=r(o),a=n(125),s=n(91),u=r(s);n(102);var c=n(21),l=r(c),d=n(98),p=r(d),f=n(89),h=r(f),v=n(96),m=r(v),g=n(95),y=r(g),_=n(92),E=r(_),b=[{action:"welcome",text:"welcome",component:p["default"],index:!0},{action:"activity",text:"Activity",component:h["default"]},{action:"consumption",text:"Consumption",component:E["default"]},{action:"exertion",text:"Exertion",component:y["default"],props:["db","userId"]},{action:"reflection",text:"Reflection",component:m["default"]}],N=function(e,t,n){var r=new l["default"]("user_"+t);r.sync(n,{live:!0,retry:!0}),(0,a.render)(i["default"].createElement(u["default"],{name:"You Better",db:r,userId:t,routes:b}),e)};window.youBetter=N,t["default"]=N},function(e,t){function n(){c=!1,a.length?u=a.concat(u):l=-1,u.length&&r()}function r(){if(!c){var e=setTimeout(n);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,c=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function i(){}var a,s=e.exports={},u=[],c=!1,l=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new o(e,t)),1!==u.length||c||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=i,s.addListener=i,s.once=i,s.off=i,s.removeListener=i,s.removeAllListeners=i,s.emit=i,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t,n){(function(t){"use strict";function n(e,n,r,o,i,a,s,u){if("production"!==t.env.NODE_ENV&&void 0===n)throw new Error("invariant requires an error message argument");if(!e){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,o,i,a,s,u],d=0;c=new Error(n.replace(/%s/g,function(){return l[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}e.exports=n}).call(t,n(1))},function(e,t){"use strict";function n(e,t){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(e),r=Object.prototype.hasOwnProperty,o=1;o<arguments.length;o++){var i=arguments[o];if(null!=i){var a=Object(i);for(var s in a)r.call(a,s)&&(n[s]=a[s])}}return n}e.exports=n},function(e,t,n){(function(t){"use strict";var r=n(11),o=r;"production"!==t.env.NODE_ENV&&(o=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;n>o;o++)r[o-2]=arguments[o];if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){var i=0,a="Warning: "+t.replace(/%s/g,function(){return r[i++]});"undefined"!=typeof console&&console.error(a);try{throw new Error(a)}catch(s){}}}),e.exports=o}).call(t,n(1))},function(e,t){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};e.exports=r},function(e,t,n){(function(t){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;n>r;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function o(e){return e?e.nodeType===H?e.documentElement:e.firstChild:null}function i(e){var t=o(e);return t&&ee.getID(t)}function a(e){var n=s(e);if(n)if(W.hasOwnProperty(n)){var r=W[n];r!==e&&(d(r,n)?"production"!==t.env.NODE_ENV?V(!1,"ReactMount: Two valid but unequal nodes with the same `%s`: %s",B,n):V(!1):void 0,W[n]=e)}else W[n]=e;return n}function s(e){return e&&e.getAttribute&&e.getAttribute(B)||""}function u(e,t){var n=s(e);n!==t&&delete W[n],e.setAttribute(B,t),W[t]=e}function c(e){return W.hasOwnProperty(e)&&d(W[e],e)||(W[e]=ee.findReactNodeByID(e)),W[e]}function l(e){var t=O.get(e)._rootNodeID;return D.isNullComponentID(t)?null:(W.hasOwnProperty(t)&&d(W[t],t)||(W[t]=ee.findReactNodeByID(t)),W[t])}function d(e,n){if(e){s(e)!==n?"production"!==t.env.NODE_ENV?V(!1,"ReactMount: Unexpected modification of `%s`",B):V(!1):void 0;var r=ee.findReactContainerForID(n);if(r&&P(r,e))return!0}return!1}function p(e){delete W[e]}function f(e){var t=W[e];return t&&d(t,e)?void($=t):!1}function h(e){$=null,x.traverseAncestors(e,f);var t=$;return $=null,t}function v(e,n,r,o,i,a){if(C.useCreateElement&&(a=M({},a),r.nodeType===H?a[z]=r:a[z]=r.ownerDocument),"production"!==t.env.NODE_ENV){a===A&&(a={});var s=r.nodeName.toLowerCase();a[U.ancestorInfoContextKey]=U.updatedAncestorInfo(null,s,null)}var u=T.mountComponent(e,n,o,a);e._renderedComponent._topLevelWrapper=e,ee._mountImageIntoNode(u,r,i,o)}function m(e,t,n,r,o){var i=I.ReactReconcileTransaction.getPooled(r);i.perform(v,null,e,t,n,i,r,o),I.ReactReconcileTransaction.release(i)}function g(e,t){for(T.unmountComponent(e),t.nodeType===H&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function y(e){var t=i(e);return t?t!==x.getReactRootIDFromNodeID(t):!1}function _(e){for(;e&&e.parentNode!==e;e=e.parentNode)if(1===e.nodeType){var t=s(e);if(t){var n,r=x.getReactRootIDFromNodeID(t),o=e;do if(n=s(o),o=o.parentNode,null==o)return null;while(n!==r);if(o===X[r])return e}}return null}var E=n(16),b=n(27),N=n(13),C=n(67),w=n(7),D=n(74),x=n(19),O=n(24),S=n(77),k=n(8),T=n(17),R=n(41),I=n(9),M=n(3),A=n(20),P=n(55),L=n(48),V=n(2),q=n(34),j=n(51),U=n(53),F=n(4),B=E.ID_ATTRIBUTE_NAME,W={},K=1,H=9,Y=11,z="__ReactMount_ownerDocument$"+Math.random().toString(36).slice(2),G={},X={};if("production"!==t.env.NODE_ENV)var J={};var Q=[],$=null,Z=function(){};Z.prototype.isReactComponent={},"production"!==t.env.NODE_ENV&&(Z.displayName="TopLevelWrapper"),Z.prototype.render=function(){return this.props};var ee={TopLevelWrapper:Z,_instancesByReactRootID:G,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,n,r,a){return ee.scrollMonitor(r,function(){R.enqueueElementInternal(e,n),a&&R.enqueueCallbackInternal(e,a)}),"production"!==t.env.NODE_ENV&&(J[i(r)]=o(r)),e},_registerComponent:function(e,n){!n||n.nodeType!==K&&n.nodeType!==H&&n.nodeType!==Y?"production"!==t.env.NODE_ENV?V(!1,"_registerComponent(...): Target container is not a DOM element."):V(!1):void 0,b.ensureScrollValueMonitoring();var r=ee.registerContainer(n);return G[r]=e,r},_renderNewRootComponent:function(e,n,r,i){"production"!==t.env.NODE_ENV?F(null==N.current,"_renderNewRootComponent(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of %s.",N.current&&N.current.getName()||"ReactCompositeComponent"):void 0;var a=L(e,null),s=ee._registerComponent(a,n);return I.batchedUpdates(m,a,s,n,r,i),"production"!==t.env.NODE_ENV&&(J[s]=o(n)),a},renderSubtreeIntoContainer:function(e,n,r,o){return null==e||null==e._reactInternalInstance?"production"!==t.env.NODE_ENV?V(!1,"parentComponent must be a valid React Component"):V(!1):void 0,ee._renderSubtreeIntoContainer(e,n,r,o)},_renderSubtreeIntoContainer:function(e,n,r,a){w.isValidElement(n)?void 0:"production"!==t.env.NODE_ENV?V(!1,"ReactDOM.render(): Invalid component element.%s","string"==typeof n?" Instead of passing an element string, make sure to instantiate it by passing it to React.createElement.":"function"==typeof n?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":null!=n&&void 0!==n.props?" This may be caused by unintentionally loading two independent copies of React.":""):V(!1),"production"!==t.env.NODE_ENV?F(!r||!r.tagName||"BODY"!==r.tagName.toUpperCase(),"render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app."):void 0;var u=new w(Z,null,null,null,null,null,n),c=G[i(r)];if(c){var l=c._currentElement,d=l.props;if(j(d,n)){var p=c._renderedComponent.getPublicInstance(),f=a&&function(){a.call(p)};return ee._updateRootComponent(c,u,r,f),p}ee.unmountComponentAtNode(r)}var h=o(r),v=h&&!!s(h),m=y(r);if("production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?F(!m,"render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."):void 0,!v||h.nextSibling))for(var g=h;g;){if(s(g)){"production"!==t.env.NODE_ENV?F(!1,"render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup."):void 0;break}g=g.nextSibling}var _=v&&!c&&!m,E=ee._renderNewRootComponent(u,r,_,null!=e?e._reactInternalInstance._processChildContext(e._reactInternalInstance._context):A)._renderedComponent.getPublicInstance();return a&&a.call(E),E},render:function(e,t,n){return ee._renderSubtreeIntoContainer(null,e,t,n)},registerContainer:function(e){var t=i(e);return t&&(t=x.getReactRootIDFromNodeID(t)),t||(t=x.createReactRootID()),X[t]=e,t},unmountComponentAtNode:function(e){"production"!==t.env.NODE_ENV?F(null==N.current,"unmountComponentAtNode(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of %s.",N.current&&N.current.getName()||"ReactCompositeComponent"):void 0,!e||e.nodeType!==K&&e.nodeType!==H&&e.nodeType!==Y?"production"!==t.env.NODE_ENV?V(!1,"unmountComponentAtNode(...): Target container is not a DOM element."):V(!1):void 0;var n=i(e),r=G[n];if(!r){var o=y(e),a=s(e),u=a&&a===x.getReactRootIDFromNodeID(a);return"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?F(!o,"unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",u?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component."):void 0),!1}return I.batchedUpdates(g,r,e),delete G[n],delete X[n],"production"!==t.env.NODE_ENV&&delete J[n],!0},findReactContainerForID:function(e){var n=x.getReactRootIDFromNodeID(e),r=X[n];if("production"!==t.env.NODE_ENV){var o=J[n];if(o&&o.parentNode!==r){"production"!==t.env.NODE_ENV?F(s(o)===n,"ReactMount: Root element ID differed from reactRootID."):void 0;var i=r.firstChild;i&&n===s(i)?J[n]=i:"production"!==t.env.NODE_ENV?F(!1,"ReactMount: Root element has been removed from its original container. New container: %s",o.parentNode):void 0}}return r},findReactNodeByID:function(e){var t=ee.findReactContainerForID(e);return ee.findComponentRoot(t,e)},getFirstReactDOM:function(e){return _(e)},findComponentRoot:function(e,n){var r=Q,o=0,i=h(n)||e;for("production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?F(null!=i,"React can't find the root component node for data-reactid value `%s`. If you're seeing this message, it probably means that you've loaded two copies of React on the page. At this time, only a single copy of React can be loaded at a time.",n):void 0),r[0]=i.firstChild,r.length=1;o<r.length;){for(var a,s=r[o++];s;){var u=ee.getID(s);u?n===u?a=s:x.isAncestorIDOf(u,n)&&(r.length=o=0,r.push(s.firstChild)):r.push(s.firstChild),s=s.nextSibling}if(a)return r.length=0,a}r.length=0,"production"!==t.env.NODE_ENV?V(!1,"findComponentRoot(..., %s): Unable to find element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID `%s`.",n,ee.getID(e)):V(!1)},_mountImageIntoNode:function(e,n,i,a){if(!n||n.nodeType!==K&&n.nodeType!==H&&n.nodeType!==Y?"production"!==t.env.NODE_ENV?V(!1,"mountComponentIntoNode(...): Target container is not valid."):V(!1):void 0,i){var s=o(n);if(S.canReuseMarkup(e,s))return;var u=s.getAttribute(S.CHECKSUM_ATTR_NAME);s.removeAttribute(S.CHECKSUM_ATTR_NAME);var c=s.outerHTML;s.setAttribute(S.CHECKSUM_ATTR_NAME,u);var l=e;if("production"!==t.env.NODE_ENV){var d;n.nodeType===K?(d=document.createElement("div"),d.innerHTML=e,l=d.innerHTML):(d=document.createElement("iframe"),document.body.appendChild(d),d.contentDocument.write(e),l=d.contentDocument.documentElement.outerHTML,document.body.removeChild(d))}var p=r(l,c),f=" (client) "+l.substring(p-20,p+20)+"\n (server) "+c.substring(p-20,p+20);n.nodeType===H?"production"!==t.env.NODE_ENV?V(!1,"You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s",f):V(!1):void 0,"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?F(!1,"React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:\n%s",f):void 0)}if(n.nodeType===H?"production"!==t.env.NODE_ENV?V(!1,"You're trying to render a component to the document but you didn't use server rendering. We can't do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering."):V(!1):void 0,a.useCreateElement){for(;n.lastChild;)n.removeChild(n.lastChild);n.appendChild(e)}else q(n,e)},ownerDocumentContextKey:z,getReactRootID:i,getID:a,setID:u,getNode:c,getNodeFromInstance:l,isValid:d,purgeID:p};k.measureMethods(ee,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),e.exports=ee}).call(t,n(1))},function(e,t,n){(function(t){"use strict";var r=n(13),o=n(3),i=n(32),a="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,s={key:!0,ref:!0,__self:!0,__source:!0},u=function(e,n,r,o,s,u,c){var l={$$typeof:a,type:e,key:n,ref:r,props:c,_owner:u};return"production"!==t.env.NODE_ENV&&(l._store={},i?(Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s})):(l._store.validated=!1,l._self=o,l._source=s),Object.freeze(l.props),Object.freeze(l)),l};u.createElement=function(e,t,n){var o,i={},a=null,c=null,l=null,d=null;if(null!=t){c=void 0===t.ref?null:t.ref,a=void 0===t.key?null:""+t.key,l=void 0===t.__self?null:t.__self,d=void 0===t.__source?null:t.__source;for(o in t)t.hasOwnProperty(o)&&!s.hasOwnProperty(o)&&(i[o]=t[o])}var p=arguments.length-2;if(1===p)i.children=n;else if(p>1){for(var f=Array(p),h=0;p>h;h++)f[h]=arguments[h+2];i.children=f}if(e&&e.defaultProps){var v=e.defaultProps;for(o in v)"undefined"==typeof i[o]&&(i[o]=v[o])}return u(e,a,c,l,d,r.current,i)},u.createFactory=function(e){var t=u.createElement.bind(null,e);return t.type=e,t},u.cloneAndReplaceKey=function(e,t){var n=u(e.type,t,e.ref,e._self,e._source,e._owner,e.props);return n},u.cloneAndReplaceProps=function(e,n){var r=u(e.type,e.key,e.ref,e._self,e._source,e._owner,n);return"production"!==t.env.NODE_ENV&&(r._store.validated=e._store.validated),r},u.cloneElement=function(e,t,n){var i,a=o({},e.props),c=e.key,l=e.ref,d=e._self,p=e._source,f=e._owner;if(null!=t){void 0!==t.ref&&(l=t.ref,f=r.current),void 0!==t.key&&(c=""+t.key);for(i in t)t.hasOwnProperty(i)&&!s.hasOwnProperty(i)&&(a[i]=t[i])}var h=arguments.length-2;if(1===h)a.children=n;else if(h>1){for(var v=Array(h),m=0;h>m;m++)v[m]=arguments[m+2];a.children=v}return u(e.type,c,l,d,p,f,a)},u.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},e.exports=u}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function n(e,t,n){return n}var r={enableMeasure:!1,storedMeasure:n,measureMethods:function(e,n,o){if("production"!==t.env.NODE_ENV)for(var i in o)o.hasOwnProperty(i)&&(e[i]=r.measure(n,o[i],e[i]))},measure:function(e,n,o){if("production"!==t.env.NODE_ENV){var i=null,a=function(){return r.enableMeasure?(i||(i=r.storedMeasure(e,n,o)),i.apply(this,arguments)):o.apply(this,arguments)};return a.displayName=e+"_"+n,a}return o},injection:{injectMeasure:function(e){r.storedMeasure=e}}};e.exports=r}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(){x.ReactReconcileTransaction&&E?void 0:"production"!==t.env.NODE_ENV?m(!1,"ReactUpdates: must inject a reconcile transaction class and batching strategy"):m(!1)}function o(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=l.getPooled(),this.reconcileTransaction=x.ReactReconcileTransaction.getPooled(!1)}function i(e,t,n,o,i,a){r(),E.batchedUpdates(e,t,n,o,i,a)}function a(e,t){return e._mountOrder-t._mountOrder}function s(e){var n=e.dirtyComponentsLength;n!==g.length?"production"!==t.env.NODE_ENV?m(!1,"Expected flush transaction's stored dirty-components length (%s) to match dirty-components array length (%s).",n,g.length):m(!1):void 0,g.sort(a);for(var r=0;n>r;r++){var o=g[r],i=o._pendingCallbacks;if(o._pendingCallbacks=null,f.performUpdateIfNecessary(o,e.reconcileTransaction),i)for(var s=0;s<i.length;s++)e.callbackQueue.enqueue(i[s],o.getPublicInstance())}}function u(e){return r(),E.isBatchingUpdates?void g.push(e):void E.batchedUpdates(u,e)}function c(e,n){E.isBatchingUpdates?void 0:"production"!==t.env.NODE_ENV?m(!1,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."):m(!1),y.enqueue(e,n),_=!0}var l=n(35),d=n(15),p=n(8),f=n(17),h=n(31),v=n(3),m=n(2),g=[],y=l.getPooled(),_=!1,E=null,b={initialize:function(){this.dirtyComponentsLength=g.length},close:function(){this.dirtyComponentsLength!==g.length?(g.splice(0,this.dirtyComponentsLength),w()):g.length=0}},N={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},C=[b,N];v(o.prototype,h.Mixin,{getTransactionWrappers:function(){return C},destructor:function(){this.dirtyComponentsLength=null,l.release(this.callbackQueue),this.callbackQueue=null,x.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return h.Mixin.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),d.addPoolingTo(o);var w=function(){for(;g.length||_;){if(g.length){var e=o.getPooled();e.perform(s,null,e),o.release(e)}if(_){_=!1;var t=y;y=l.getPooled(),t.notifyAll(),l.release(t)}}};w=p.measure("ReactUpdates","flushBatchedUpdates",w);var D={injectReconcileTransaction:function(e){e?void 0:"production"!==t.env.NODE_ENV?m(!1,"ReactUpdates: must provide a reconcile transaction class"):m(!1),x.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e?void 0:"production"!==t.env.NODE_ENV?m(!1,"ReactUpdates: must provide a batching strategy"):m(!1),"function"!=typeof e.batchedUpdates?"production"!==t.env.NODE_ENV?m(!1,"ReactUpdates: must provide a batchedUpdates() function"):m(!1):void 0,"boolean"!=typeof e.isBatchingUpdates?"production"!==t.env.NODE_ENV?m(!1,"ReactUpdates: must provide an isBatchingUpdates boolean attribute"):m(!1):void 0,E=e}},x={ReactReconcileTransaction:null,batchedUpdates:i,enqueueUpdate:u,flushBatchedUpdates:w,injection:D,asap:c};e.exports=x}).call(t,n(1))},function(e,t,n){"use strict";e.exports=n(137)},function(e,t){"use strict";function n(e){return function(){return e}}function r(){}r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";var r=n(26),o=r({bubbled:null,captured:null}),i=r({topAbort:null,topBlur:null,topCanPlay:null,topCanPlayThrough:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topContextMenu:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topDurationChange:null,topEmptied:null,topEncrypted:null,topEnded:null,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topLoadedData:null,topLoadedMetadata:null,topLoadStart:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topPause:null,topPlay:null,topPlaying:null,topProgress:null,topRateChange:null,topReset:null,topScroll:null,topSeeked:null,topSeeking:null,topSelectionChange:null,topStalled:null,topSubmit:null,topSuspend:null,topTextInput:null,topTimeUpdate:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topVolumeChange:null,topWaiting:null,topWheel:null}),a={topLevelTypes:i,PropagationPhases:o};e.exports=a},function(e,t){"use strict";var n={current:null};e.exports=n},function(e,t){"use strict";var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=n},function(e,t,n){(function(t){"use strict";var r=n(2),o=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,n,r),i}return new o(e,t,n,r)},u=function(e,t,n,r,o){var i=this;if(i.instancePool.length){var a=i.instancePool.pop();return i.call(a,e,t,n,r,o),a}return new i(e,t,n,r,o)},c=function(e){var n=this;e instanceof n?void 0:"production"!==t.env.NODE_ENV?r(!1,"Trying to release an instance into a pool of a different type."):r(!1),e.destructor(),n.instancePool.length<n.poolSize&&n.instancePool.push(e)},l=10,d=o,p=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||d,n.poolSize||(n.poolSize=l),n.release=c,n},f={addPoolingTo:p,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:a,fourArgumentPooler:s,fiveArgumentPooler:u};e.exports=f}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e,t){return(e&t)===t}var o=n(2),i={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var n=i,a=e.Properties||{},u=e.DOMAttributeNamespaces||{},c=e.DOMAttributeNames||{},l=e.DOMPropertyNames||{},d=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var p in a){s.properties.hasOwnProperty(p)?"production"!==t.env.NODE_ENV?o(!1,"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.",p):o(!1):void 0;var f=p.toLowerCase(),h=a[p],v={attributeName:f,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseAttribute:r(h,n.MUST_USE_ATTRIBUTE),mustUseProperty:r(h,n.MUST_USE_PROPERTY),hasSideEffects:r(h,n.HAS_SIDE_EFFECTS),hasBooleanValue:r(h,n.HAS_BOOLEAN_VALUE),hasNumericValue:r(h,n.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(h,n.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(h,n.HAS_OVERLOADED_BOOLEAN_VALUE)};if(v.mustUseAttribute&&v.mustUseProperty?"production"!==t.env.NODE_ENV?o(!1,"DOMProperty: Cannot require using both attribute and property: %s",p):o(!1):void 0,!v.mustUseProperty&&v.hasSideEffects?"production"!==t.env.NODE_ENV?o(!1,"DOMProperty: Properties that have side effects must use property: %s",p):o(!1):void 0,v.hasBooleanValue+v.hasNumericValue+v.hasOverloadedBooleanValue<=1?void 0:"production"!==t.env.NODE_ENV?o(!1,"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s",p):o(!1),"production"!==t.env.NODE_ENV&&(s.getPossibleStandardName[f]=p),c.hasOwnProperty(p)){var m=c[p];v.attributeName=m,"production"!==t.env.NODE_ENV&&(s.getPossibleStandardName[m]=p)}u.hasOwnProperty(p)&&(v.attributeNamespace=u[p]),l.hasOwnProperty(p)&&(v.propertyName=l[p]),d.hasOwnProperty(p)&&(v.mutationMethod=d[p]),s.properties[p]=v}}},a={},s={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:"production"!==t.env.NODE_ENV?{}:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++){var n=s._isCustomAttributeFunctions[t];if(n(e))return!0}return!1},getDefaultValueForProperty:function(e,t){var n,r=a[e];return r||(a[e]=r={}),t in r||(n=document.createElement(e),r[t]=n[t]),r[t]},injection:i};e.exports=s}).call(t,n(1))},function(e,t,n){"use strict";function r(){o.attachRefs(this,this._currentElement)}var o=n(158),i={mountComponent:function(e,t,n,o){var i=e.mountComponent(t,n,o);return e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e),i},unmountComponent:function(e){o.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||i!==e._context){var s=o.shouldUpdateRefs(a,t);s&&o.detachRefs(e,a),e.receiveComponent(t,n,i),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}};e.exports=i},function(e,t,n){(function(t){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n,this.target=r,this.currentTarget=r;var o=this.constructor.Interface;for(var i in o)if(o.hasOwnProperty(i)){var s=o[i];s?this[i]=s(n):this[i]=n[i]}var u=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;u?this.isDefaultPrevented=a.thatReturnsTrue:this.isDefaultPrevented=a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse}var o=n(15),i=n(3),a=n(11),s=n(4),u={type:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};i(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?s(e,"This synthetic event is reused for performance reasons. If you're seeing this, you're calling `preventDefault` on a released/nullified synthetic event. This is a no-op. See https://fb.me/react-event-pooling for more information."):void 0),e&&(e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?s(e,"This synthetic event is reused for performance reasons. If you're seeing this, you're calling `stopPropagation` on a released/nullified synthetic event. This is a no-op. See https://fb.me/react-event-pooling for more information."):void 0),e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),r.Interface=u,r.augmentClass=function(e,t){var n=this,r=Object.create(n.prototype);i(r,e.prototype),e.prototype=r,e.prototype.constructor=e,e.Interface=i({},n.Interface,t),e.augmentClass=n.augmentClass,o.addPoolingTo(e,o.fourArgumentPooler)},o.addPoolingTo(r,o.fourArgumentPooler),e.exports=r}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e){return f+e.toString(36)}function o(e,t){return e.charAt(t)===f||t===e.length}function i(e){return""===e||e.charAt(0)===f&&e.charAt(e.length-1)!==f}function a(e,t){return 0===t.indexOf(e)&&o(t,e.length)}function s(e){return e?e.substr(0,e.lastIndexOf(f)):""}function u(e,n){if(i(e)&&i(n)?void 0:"production"!==t.env.NODE_ENV?p(!1,"getNextDescendantID(%s, %s): Received an invalid React DOM ID.",e,n):p(!1),a(e,n)?void 0:"production"!==t.env.NODE_ENV?p(!1,"getNextDescendantID(...): React has made an invalid assumption about the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.",e,n):p(!1),e===n)return e;var r,s=e.length+h;for(r=s;r<n.length&&!o(n,r);r++);return n.substr(0,r)}function c(e,n){var r=Math.min(e.length,n.length);if(0===r)return"";for(var a=0,s=0;r>=s;s++)if(o(e,s)&&o(n,s))a=s;else if(e.charAt(s)!==n.charAt(s))break;var u=e.substr(0,a);return i(u)?void 0:"production"!==t.env.NODE_ENV?p(!1,"getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s",e,n,u):p(!1),u}function l(e,n,r,o,i,c){e=e||"",n=n||"",e===n?"production"!==t.env.NODE_ENV?p(!1,"traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.",e):p(!1):void 0;var l=a(n,e);l||a(e,n)?void 0:"production"!==t.env.NODE_ENV?p(!1,"traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do not have a parent path.",e,n):p(!1);for(var d=0,f=l?s:u,h=e;;h=f(h,n)){var m;if(i&&h===e||c&&h===n||(m=r(h,l,o)),m===!1||h===n)break;d++<v?void 0:"production"!==t.env.NODE_ENV?p(!1,"traverseParentPath(%s, %s, ...): Detected an infinite loop while traversing the React DOM ID tree. This may be due to malformed IDs: %s",e,n,h):p(!1)}}var d=n(82),p=n(2),f=".",h=f.length,v=1e4,m={createReactRootID:function(){return r(d.createReactRootIndex())},createReactID:function(e,t){return e+t},getReactRootIDFromNodeID:function(e){if(e&&e.charAt(0)===f&&e.length>1){var t=e.indexOf(f,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,o){var i=c(e,t);i!==e&&l(e,i,n,r,!1,!0),i!==t&&l(i,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(l("",e,t,n,!0,!1),l(e,"",t,n,!1,!0))},traverseTwoPhaseSkipTarget:function(e,t,n){e&&(l("",e,t,n,!0,!0),l(e,"",t,n,!0,!0))},traverseAncestors:function(e,t,n){l("",e,t,n,!0,!1)},getFirstCommonAncestorID:c,_getNextDescendantID:u,isAncestorIDOf:a,SEPARATOR:f};e.exports=m}).call(t,n(1))},function(e,t,n){(function(t){"use strict";var n={};"production"!==t.env.NODE_ENV&&Object.freeze(n),e.exports=n}).call(t,n(1))},function(e,t,n){(function(t,r){"use strict";function o(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(n){if("TypeError"!==n.name)throw n;for(var r="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,o=new r,i=0;i<e.length;i+=1)o.append(e[i]);return o.getBlob(t.type)}}function i(e,t){if("undefined"==typeof FileReader)return t((new FileReaderSync).readAsArrayBuffer(e)); var n=new FileReader;n.onloadend=function(e){var n=e.target.result||new ArrayBuffer(0);t(n)},n.readAsArrayBuffer(e)}function a(){for(var e={},t=new or(function(t,n){e.resolve=t,e.reject=n}),n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.promise=t,or.resolve().then(function(){return fetch.apply(null,n)}).then(function(t){e.resolve(t)})["catch"](function(t){e.reject(t)}),e}function s(e,t){var n,r,o,s=new Headers,u={method:e.method,credentials:"include",headers:s};return e.json&&(s.set("Accept","application/json"),s.set("Content-Type",e.headers["Content-Type"]||"application/json")),e.body&&e.body instanceof Blob?i(e.body,function(e){u.body=e}):e.body&&e.processData&&"string"!=typeof e.body?u.body=JSON.stringify(e.body):"body"in e?u.body=e.body:u.body=null,Object.keys(e.headers).forEach(function(t){e.headers.hasOwnProperty(t)&&s.set(t,e.headers[t])}),n=a(e.url,u),e.timeout>0&&(r=setTimeout(function(){n.reject(new Error("Load timeout for resource: "+e.url))},e.timeout)),n.promise.then(function(t){return o={statusCode:t.status},e.timeout>0&&clearTimeout(r),o.statusCode>=200&&o.statusCode<300?e.binary?t.blob():t.text():t.json()}).then(function(e){o.statusCode>=200&&o.statusCode<300?t(null,o,e):t(e,o)})["catch"](function(e){t(e,o)}),{abort:n.reject}}function u(e,t){var n,r,a=function(){n.abort()};n=e.xhr?new e.xhr:new XMLHttpRequest;try{n.open(e.method,e.url)}catch(s){t(s,{statusCode:413})}n.withCredentials="withCredentials"in e?e.withCredentials:!0,"GET"===e.method?delete e.headers["Content-Type"]:e.json&&(e.headers.Accept="application/json",e.headers["Content-Type"]=e.headers["Content-Type"]||"application/json",e.body&&e.processData&&"string"!=typeof e.body&&(e.body=JSON.stringify(e.body))),e.binary&&(n.responseType="arraybuffer"),"body"in e||(e.body=null);for(var u in e.headers)e.headers.hasOwnProperty(u)&&n.setRequestHeader(u,e.headers[u]);return e.timeout>0&&(r=setTimeout(a,e.timeout),n.onprogress=function(){clearTimeout(r),r=setTimeout(a,e.timeout)},"undefined"!=typeof n.upload&&(n.upload.onprogress=n.onprogress)),n.onreadystatechange=function(){if(4===n.readyState){var r={statusCode:n.status};if(n.status>=200&&n.status<300){var i;i=e.binary?o([n.response||""],{type:n.getResponseHeader("Content-Type")}):n.responseText,t(null,r,i)}else{var a={};try{a=JSON.parse(n.response)}catch(s){}t(a,r)}}},e.body&&e.body instanceof Blob?i(e.body,function(e){n.send(e)}):n.send(e.body),{abort:a}}function c(){try{return new XMLHttpRequest,!0}catch(e){return!1}}function l(e,t){return ir||e.xhr?u(e,t):s(e,t)}function d(e){Error.call(this,e.reason),this.status=e.status,this.name=e.error,this.message=e.reason,this.error=!0}function p(e,t,n){function r(t){for(var r in e)"function"!=typeof e[r]&&(this[r]=e[r]);void 0!==n&&(this.name=n),void 0!==t&&(this.reason=t)}return r.prototype=d.prototype,new r(t)}function f(e){var t,n,r,o,i;return n=e.error===!0&&"string"==typeof e.name?e.name:e.error,i=e.reason,r=Rr("name",n,i),e.missing||"missing"===i||"deleted"===i||"not_found"===n?r=ur:"doc_validation"===n?(r=yr,o=i):"bad_request"===n&&r.message!==i&&(r=_r),r||(r=Rr("status",e.status,i)||hr),t=p(r,i,n),o&&(t.message=o),e.id&&(t.id=e.id),e.status&&(t.status=e.status),e.missing&&(t.missing=e.missing),t}function h(e){return e instanceof ArrayBuffer||"undefined"!=typeof Blob&&e instanceof Blob}function v(e){if("function"==typeof e.slice)return e.slice(0);var t=new ArrayBuffer(e.byteLength),n=new Uint8Array(t),r=new Uint8Array(e);return n.set(r),t}function m(e){if(e instanceof ArrayBuffer)return v(e);var t=e.size,n=e.type;return"function"==typeof e.slice?e.slice(0,t,n):e.webkitSlice(0,t,n)}function g(e){var t,n,r;if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){for(t=[],n=0,r=e.length;r>n;n++)t[n]=g(e[n]);return t}if(e instanceof Date)return e.toISOString();if(h(e))return m(e);t={};for(n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=g(e[n]);"undefined"!=typeof o&&(t[n]=o)}return t}function y(){return""}function _(e,t){function n(t,n,r){if(!e.binary&&e.json&&"string"==typeof t)try{t=JSON.parse(t)}catch(o){return r(o)}Array.isArray(t)&&(t=t.map(function(e){return e.error||e.missing?f(e):e})),e.binary&&Ir(t,n),r(null,t,n)}function r(e,t){var n,r;if(e.code&&e.status){var o=new Error(e.message||e.code);return o.status=e.status,t(o)}try{n=JSON.parse(e.responseText),r=f(n)}catch(i){r=f(e)}t(r)}e=g(e);var o={method:"GET",headers:{},json:!0,processData:!0,timeout:1e4,cache:!1};return e=Hn.extend(o,e),e.json&&(e.binary||(e.headers.Accept="application/json"),e.headers["Content-Type"]=e.headers["Content-Type"]||"application/json"),e.binary&&(e.encoding=null,e.json=!1),e.processData||(e.json=!1),l(e,function(o,i,a){if(o)return o.status=i?i.statusCode:400,r(o,t);var s,u=i.headers&&i.headers["content-type"],c=a||y();if(!e.binary&&(e.json||!e.processData)&&"object"!=typeof c&&(/json/.test(u)||/^[\s]*\{/.test(c)&&/\}[\s]*$/.test(c)))try{c=JSON.parse(c.toString())}catch(l){}i.statusCode>=200&&i.statusCode<300?n(c,i,t):(s=f(c),s.status=i.statusCode,t(s))})}function E(e,t){var n=navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",r=-1!==n.indexOf("safari")&&-1===n.indexOf("chrome"),o=-1!==n.indexOf("msie"),i=r&&"POST"===e.method||o&&"GET"===e.method,a="cache"in e?e.cache:!0;if(i||!a){var s=-1!==e.url.indexOf("?");e.url+=(s?"&":"?")+"_nonce="+Date.now()}return _(e,t)}function b(e){var t=!1;return Jn(function(n){if(t)throw new Error("once called more than once");t=!0,e.apply(this,n)})}function N(e){return Jn(function(n){n=g(n);var r,o=this,i="function"==typeof n[n.length-1]?n.pop():!1;i&&(r=function(e,n){t.nextTick(function(){i(e,n)})});var a=new or(function(t,r){var i;try{var a=b(function(e,n){e?r(e):t(n)});n.push(a),i=e.apply(o,n),i&&"function"==typeof i.then&&t(i)}catch(s){r(s)}});return r&&a.then(function(e){r(null,e)},r),a})}function C(e,t){function n(e,t,n){if(Mr.enabled){for(var r=[e._db_name,t],o=0;o<n.length-1;o++)r.push(n[o]);Mr.apply(null,r);var i=n[n.length-1];n[n.length-1]=function(n,r){var o=[e._db_name,t];o=o.concat(n?["error",n]:["success",r]),Mr.apply(null,o),i(n,r)}}}return N(Jn(function(r){if(this._closed)return or.reject(new Error("database is closed"));var o=this;return n(o,e,r),this.taskqueue.isReady?t.apply(this,r):new or(function(t,n){o.taskqueue.addTask(function(i){i?n(i):t(o[e].apply(o,r))})})}))}function w(e,t){for(var n={},r=0,o=t.length;o>r;r++){var i=t[r];i in e&&(n[i]=e[i])}return n}function D(e,t,n){return new or(function(r,o){e.get(t,function(i,a){if(i){if(404!==i.status)return o(i);a={}}var s=a._rev,u=n(a);return u?(u._id=t,u._rev=s,void r(x(e,u,n))):r({updated:!1,rev:s})})})}function x(e,t,n){return e.put(t).then(function(e){return{updated:!0,rev:e.rev}},function(r){if(409!==r.status)throw r;return D(e,t._id,n)})}function O(e){for(var t,n,r,o,i=e.rev_tree.slice();o=i.pop();){var a=o.ids,s=a[2],u=o.pos;if(s.length)for(var c=0,l=s.length;l>c;c++)i.push({pos:u+1,ids:s[c]});else{var d=!!a[1].deleted,p=a[0];(!t||(r!==d?r:n!==u?u>n:p>t))&&(t=p,n=u,r=d)}}return n+"-"+t}function S(e){return e.ids}function k(e,t){t||(t=O(e));for(var n,r=t.substring(t.indexOf("-")+1),o=e.rev_tree.map(S);n=o.pop();){if(n[0]===r)return!!n[1].deleted;o=o.concat(n[2])}}function T(e){return tr("return "+e+";",{})}function R(e){return new Function("doc",["var emitted = false;","var emit = function (a, b) {"," emitted = true;","};","var view = "+e+";","view(doc);","if (emitted) {"," return true;","}"].join("\n"))}function I(e){if(!e)return null;var t=e.split("/");return 2===t.length?t:1===t.length?[e,e]:null}function M(e){var t=I(e);return t?t.join("/"):null}function A(e,t){for(var n,r=e.slice();n=r.pop();)for(var o=n.pos,i=n.ids,a=i[2],s=t(0===a.length,o,i[0],n.ctx,i[1]),u=0,c=a.length;c>u;u++)r.push({pos:o+1,ids:a[u],ctx:s})}function P(e,t){return e.pos-t.pos}function L(e){var t=[];A(e,function(e,n,r,o,i){e&&t.push({rev:n+"-"+r,pos:n,opts:i})}),t.sort(P).reverse();for(var n=0,r=t.length;r>n;n++)delete t[n].pos;return t}function V(e){for(var t=O(e),n=L(e.rev_tree),r=[],o=0,i=n.length;i>o;o++){var a=n[o];a.rev===t||a.opts.deleted||r.push(a.rev)}return r}function q(e,t,n){function r(){o.cancel()}Xn.EventEmitter.call(this);var o=this;this.db=e,t=t?g(t):{};var i=t.complete=b(function(t,n){t?o.emit("error",t):o.emit("complete",n),o.removeAllListeners(),e.removeListener("destroyed",r)});n&&(o.on("complete",function(e){n(null,e)}),o.on("error",n)),e.once("destroyed",r),t.onChange=function(e){t.isCancelled||(o.emit("change",e),o.startSeq&&o.startSeq<=e.seq&&(o.startSeq=!1))};var a=new or(function(e,n){t.complete=function(t,r){t?n(t):e(r)}});o.once("cancel",function(){e.removeListener("destroyed",r),t.complete(null,{status:"cancelled"})}),this.then=a.then.bind(a),this["catch"]=a["catch"].bind(a),this.then(function(e){i(null,e)},i),e.taskqueue.isReady?o.doChanges(t):e.taskqueue.addTask(function(){o.isCancelled?o.emit("cancel"):o.doChanges(t)})}function j(e,t,n){var r=[{rev:e._rev}];"all_docs"===n.style&&(r=L(t.rev_tree).map(function(e){return{rev:e.rev}}));var o={id:t.id,changes:r,doc:e};return k(t,e._rev)&&(o.deleted=!0),n.conflicts&&(o.doc._conflicts=V(t),o.doc._conflicts.length||delete o.doc._conflicts),o}function U(e,t,n){function r(){var e=[];l.forEach(function(t){t.docs.forEach(function(n){e.push({id:t.id,docs:[n]})})}),n(null,{results:e})}function o(){++c===u&&r()}function i(e,t,n){l[e]={id:t,docs:n},o()}var a=Array.isArray(t)?t:t.docs,s={};a.forEach(function(e){e.id in s?s[e.id].push(e):s[e.id]=[e]});var u=Object.keys(s).length,c=0,l=new Array(u);Object.keys(s).forEach(function(n,r){var o=s[n],a=w(o[0],["atts_since","attachments"]);a.open_revs=o.map(function(e){return e.rev}),a.open_revs=a.open_revs.filter(function(e){return e});var u=function(e){return e};0===a.open_revs.length&&(delete a.open_revs,u=function(e){return[{ok:e}]}),["revs","attachments","binary"].forEach(function(e){e in t&&(a[e]=t[e])}),e.get(n,a,function(e,t){i(r,n,e?[{error:e}]:u(t))})})}function F(e){return/^_local/.test(e)}function B(e){for(var t,n=[],r=e.slice();t=r.pop();){var o=t.pos,i=t.ids,a=i[0],s=i[1],u=i[2],c=0===u.length,l=t.history?t.history.slice():[];l.push({id:a,opts:s}),c&&n.push({pos:o+1-l.length,ids:l});for(var d=0,p=u.length;p>d;d++)r.push({pos:o+1,ids:u[d],history:l})}return n.reverse()}function W(e){return 0|Math.random()*e}function K(e,t){t=t||Ar.length;var n="",r=-1;if(e){for(;++r<e;)n+=Ar[W(t)];return n}for(;++r<36;)switch(r){case 8:case 13:case 18:case 23:n+="-";break;case 19:n+=Ar[3&W(16)|8];break;default:n+=Ar[W(16)]}return n}function H(e){return e.reduce(function(e,t){return e[t]=!0,e},{})}function Y(e){var t;if(e?"string"!=typeof e?t=p(lr):/^_/.test(e)&&!/^_(design|local)/.test(e)&&(t=p(pr)):t=p(dr),t)throw t}function z(e){if(!/^\d+\-./.test(e))return p(xr);var t=e.indexOf("-"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:parseInt(n,10),id:r}}function G(e,t){for(var n=e.start-e.ids.length+1,r=e.ids,o=[r[0],t,[]],i=1,a=r.length;a>i;i++)o=[r[i],{status:"missing"},[o]];return[{pos:n,ids:o}]}function X(e,t){var n,r,o,i={status:"available"};if(e._deleted&&(i.deleted=!0),t)if(e._id||(e._id=K()),r=K(32,16).toLowerCase(),e._rev){if(o=z(e._rev),o.error)return o;e._rev_tree=[{pos:o.prefix,ids:[o.id,{status:"missing"},[[r,i,[]]]]}],n=o.prefix+1}else e._rev_tree=[{pos:1,ids:[r,i,[]]}],n=1;else if(e._revisions&&(e._rev_tree=G(e._revisions,i),n=e._revisions.start,r=e._revisions.ids[0]),!e._rev_tree){if(o=z(e._rev),o.error)return o;n=o.prefix,r=o.id,e._rev_tree=[{pos:n,ids:[r,i,[]]}]}Y(e._id),e._rev=n+"-"+r;var a={metadata:{},data:{}};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var u="_"===s[0];if(u&&!Pr[s]){var c=p(yr,s);throw c.message=yr.message+": "+s,c}u&&!Lr[s]?a.metadata[s.slice(1)]=e[s]:a.data[s]=e[s]}return a}function J(e,t){return t>e?-1:e>t?1:0}function Q(e,t){for(var n=0;n<e.length;n++)if(t(e[n],n)===!0)return e[n]}function $(e){return function(t,n){t||n[0]&&n[0].error?e(t||n[0]):e(null,n.length?n[0]:n)}}function Z(e){for(var t=0;t<e.length;t++){var n=e[t];if(n._deleted)delete n._attachments;else if(n._attachments)for(var r=Object.keys(n._attachments),o=0;o<r.length;o++){var i=r[o];n._attachments[i]=w(n._attachments[i],["data","digest","content_type","length","revpos","stub"])}}}function ee(e,t){var n=J(e._id,t._id);if(0!==n)return n;var r=e._revisions?e._revisions.start:0,o=t._revisions?t._revisions.start:0;return J(r,o)}function te(e){var t={},n=[];return A(e,function(e,r,o,i){var a=r+"-"+o;return e&&(t[a]=0),void 0!==i&&n.push({from:i,to:a}),a}),n.reverse(),n.forEach(function(e){void 0===t[e.from]?t[e.from]=1+t[e.to]:t[e.from]=Math.min(t[e.from],1+t[e.to])}),t}function ne(e,t,n){var r="limit"in t?t.keys.slice(t.skip,t.limit+t.skip):t.skip>0?t.keys.slice(t.skip):t.keys;if(t.descending&&r.reverse(),!r.length)return e._allDocs({limit:0},n);var o={offset:t.skip};return or.all(r.map(function(n){var r=Hn.extend({key:n,deleted:"ok"},t);return["limit","skip","keys"].forEach(function(e){delete r[e]}),new or(function(t,i){e._allDocs(r,function(e,r){return e?i(e):(o.total_rows=r.total_rows,void t(r.rows[0]||{key:n,error:"not_found"}))})})})).then(function(e){return o.rows=e,o})}function re(e){var n=e._compactionQueue[0],r=n.opts,o=n.callback;e.get("_local/compaction")["catch"](function(){return!1}).then(function(n){n&&n.last_seq&&(r.last_seq=n.last_seq),e._compact(r,function(n,r){n?o(n):o(null,r),t.nextTick(function(){e._compactionQueue.shift(),e._compactionQueue.length&&re(e)})})})}function oe(e){return"_"===e.charAt(0)?e+"is not a valid attachment name, attachment names cannot start with '_'":!1}function ie(){Xn.EventEmitter.call(this)}function ae(){this.isReady=!1,this.failed=!1,this.queue=[]}function se(e){e&&r.debug&&console.error(e)}function ue(e,t){function n(){i.emit("destroyed",o),i.emit(o,"destroyed")}function r(){e.removeListener("destroyed",n),e.emit("destroyed",e)}var o=t.originalName,i=e.constructor,a=i._destructionListeners;e.once("destroyed",n),a.has(o)||a.set(o,[]),a.get(o).push(r)}function ce(e,t,n){if(!(this instanceof ce))return new ce(e,t,n);var r=this;("function"==typeof t||"undefined"==typeof t)&&(n=t,t={}),e&&"object"==typeof e&&(t=e,e=void 0),"undefined"==typeof n&&(n=se),e=e||t.name,t=g(t),delete t.name,this.__opts=t;var o=n;r.auto_compaction=t.auto_compaction,r.prefix=ce.prefix,ie.call(r),r.taskqueue=new ae;var i=new or(function(o,i){n=function(e,t){return e?i(e):(delete t.then,void o(t))},t=g(t);var a,s,u=t.name||e;return function(){try{if("string"!=typeof u)throw s=new Error("Missing/invalid DB name"),s.code=400,s;if(a=ce.parseAdapter(u,t),t.originalName=u,t.name=a.name,t.prefix&&"http"!==a.adapter&&"https"!==a.adapter&&(t.name=t.prefix+t.name),t.adapter=t.adapter||a.adapter,r._adapter=t.adapter,Qn("pouchdb:adapter")("Picked adapter: "+t.adapter),r._db_name=u,!ce.adapters[t.adapter])throw s=new Error("Adapter is missing"),s.code=404,s;if(!ce.adapters[t.adapter].valid())throw s=new Error("Invalid Adapter"),s.code=404,s}catch(e){r.taskqueue.fail(e)}}(),s?i(s):(r.adapter=t.adapter,r.replicate={},r.replicate.from=function(e,t,n){return r.constructor.replicate(e,r,t,n)},r.replicate.to=function(e,t,n){return r.constructor.replicate(r,e,t,n)},r.sync=function(e,t,n){return r.constructor.sync(r,e,t,n)},r.replicate.sync=r.sync,void ce.adapters[t.adapter].call(r,t,function(e){return e?(r.taskqueue.fail(e),void n(e)):(ue(r,t),r.emit("created",r),ce.emit("created",t.originalName),r.taskqueue.ready(r),void n(null,r))}))});i.then(function(e){o(null,e)},o),r.then=i.then.bind(i),r["catch"]=i["catch"].bind(i)}function le(){return"undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage&&"undefined"!=typeof chrome.storage.local}function de(){return Vr}function pe(e){Object.keys(Xn.EventEmitter.prototype).forEach(function(t){"function"==typeof Xn.EventEmitter.prototype[t]&&(e[t]=jr[t].bind(jr))});var t=e._destructionListeners=new Gn.Map;e.on("destroyed",function(e){t.has(e)&&(t.get(e).forEach(function(e){e()}),t["delete"](e))})}function fe(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=0;t>o;o++)r[o]=e.charCodeAt(o);return n}function he(e,t){return o([fe(e)],{type:t})}function ve(e){for(var t=Hr.exec(e),n={},r=14;r--;){var o=Br[r],i=t[r]||"",a=-1!==["user","password"].indexOf(o);n[o]=a?decodeURIComponent(i):i}return n[Wr]={},n[Br[12]].replace(Kr,function(e,t,r){t&&(n[Wr][t]=r)}),n}function me(e,t,n){try{return!e(t,n)}catch(r){var o="Filter function threw: "+r.toString();return p(_r,o)}}function ge(e){var t={},n=e.filter&&"function"==typeof e.filter;return t.query=e.query_params,function(r){r.doc||(r.doc={});var o=n&&me(e.filter,r.doc,t);if("object"==typeof o)return o;if(o)return!1;if(e.include_docs){if(!e.attachments)for(var i in r.doc._attachments)r.doc._attachments.hasOwnProperty(i)&&(r.doc._attachments[i].stub=!0)}else delete r.doc;return!0}}function ye(e,t){"console"in r&&"info"in console&&console.info("The above "+e+" is totally normal. "+t)}function _e(e,t,n,r,o){return e.get(t)["catch"](function(n){if(404===n.status)return"http"===e.type()&&ye(404,"PouchDB is just checking if a remote checkpoint exists."),{session_id:r,_id:t,history:[],replicator:Jr,version:Xr};throw n}).then(function(i){return o.cancelled?void 0:(i.history=(i.history||[]).filter(function(e){return e.session_id!==r}),i.history.unshift({last_seq:n,session_id:r}),i.history=i.history.slice(0,Qr),i.version=Xr,i.replicator=Jr,i.session_id=r,i.last_seq=n,e.put(i)["catch"](function(i){if(409===i.status)return _e(e,t,n,r,o);throw i}))})}function Ee(e,t,n,r){this.src=e,this.target=t,this.id=n,this.returnValue=r}function be(e,t){if(e.session_id===t.session_id)return{last_seq:e.last_seq,history:e.history||[]};var n=e.history||[],r=t.history||[];return Ne(n,r)}function Ne(e,t){var n=e[0],r=e.slice(1),o=t[0],i=t.slice(1);if(!n||0===t.length)return{last_seq:$r,history:[]};var a=n.session_id;if(Ce(a,t))return{last_seq:n.last_seq,history:e};var s=o.session_id;return Ce(s,r)?{last_seq:o.la