{"version":3,"file":"dexie.js","sources":["../C:/repos/dexie-release/tools/tmp/src/utils.js","../C:/repos/dexie-release/tools/tmp/src/chaining-functions.js","../C:/repos/dexie-release/tools/tmp/src/errors.js","../C:/repos/dexie-release/tools/tmp/src/Events.js","../C:/repos/dexie-release/tools/tmp/src/Promise.js","../C:/repos/dexie-release/tools/tmp/src/Dexie.js"],"sourcesContent":["/*\r\n* Dexie.js - a minimalistic wrapper for IndexedDB\r\n* ===============================================\r\n*\r\n* By David Fahlander, david.fahlander@gmail.com\r\n*\r\n* Version {version}, {date}\r\n* www.dexie.com\r\n* Apache License Version 2.0, January 2004, http://www.apache.org/licenses/\r\n*/\nimport Promise from './Promise';\n\nexport var keys = Object.keys;\nexport var isArray = Array.isArray;\nexport var _global = typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;\n\nexport function extend(obj, extension) {\n if (typeof extension !== 'object') extension = extension(); // Allow to supply a function returning the extension. Useful for simplifying private scopes.\n keys(extension).forEach(function (key) {\n obj[key] = extension[key];\n });\n return obj;\n}\n\nexport function derive(Child) {\n return {\n from: function (Parent) {\n Child.prototype = Object.create(Parent.prototype);\n Child.prototype.constructor = Child;\n return {\n extend: function (extension) {\n extend(Child.prototype, typeof extension !== 'object' ? extension(Parent.prototype) : extension);\n }\n };\n }\n };\n}\n\nvar _slice = [].slice;\nexport function slice(args, start, end) {\n return _slice.call(args, start, end);\n}\n\nexport function override(origFunc, overridedFactory) {\n return overridedFactory(origFunc);\n}\n\nexport function doFakeAutoComplete(fn) {\n var to = setTimeout(fn, 1000);\n clearTimeout(to);\n}\n\nexport function assert(b) {\n if (!b) throw new exceptions.Internal(\"Assertion failed\");\n}\n\nexport function asap(fn) {\n if (_global.setImmediate) setImmediate(fn);else setTimeout(fn, 0);\n}\n\nexport function miniTryCatch(fn, onerror) {\n try {\n fn();\n } catch (ex) {\n onerror && onerror(ex);\n }\n}\n\nexport function fail(err) {\n // Get the call stack and return a rejected promise.\n try {\n throw err;\n } catch (e) {\n return Promise.reject(err);\n }\n}\n\nexport function getByKeyPath(obj, keyPath) {\n // http://www.w3.org/TR/IndexedDB/#steps-for-extracting-a-key-from-a-value-using-a-key-path\n if (obj.hasOwnProperty(keyPath)) return obj[keyPath]; // This line is moved from last to first for optimization purpose.\n if (!keyPath) return obj;\n if (typeof keyPath !== 'string') {\n var rv = [];\n for (var i = 0, l = keyPath.length; i < l; ++i) {\n var val = getByKeyPath(obj, keyPath[i]);\n rv.push(val);\n }\n return rv;\n }\n var period = keyPath.indexOf('.');\n if (period !== -1) {\n var innerObj = obj[keyPath.substr(0, period)];\n return innerObj === undefined ? undefined : getByKeyPath(innerObj, keyPath.substr(period + 1));\n }\n return undefined;\n}\n\nexport function setByKeyPath(obj, keyPath, value) {\n if (!obj || keyPath === undefined) return;\n if ('isFrozen' in Object && Object.isFrozen(obj)) return;\n if (typeof keyPath !== 'string' && 'length' in keyPath) {\n assert(typeof value !== 'string' && 'length' in value);\n for (var i = 0, l = keyPath.length; i < l; ++i) {\n setByKeyPath(obj, keyPath[i], value[i]);\n }\n } else {\n var period = keyPath.indexOf('.');\n if (period !== -1) {\n var currentKeyPath = keyPath.substr(0, period);\n var remainingKeyPath = keyPath.substr(period + 1);\n if (remainingKeyPath === \"\") {\n if (value === undefined) delete obj[currentKeyPath];else obj[currentKeyPath] = value;\n } else {\n var innerObj = obj[currentKeyPath];\n if (!innerObj) innerObj = obj[currentKeyPath] = {};\n setByKeyPath(innerObj, remainingKeyPath, value);\n }\n } else {\n if (value === undefined) delete obj[keyPath];else obj[keyPath] = value;\n }\n }\n}\n\nexport function delByKeyPath(obj, keyPath) {\n if (typeof keyPath === 'string') setByKeyPath(obj, keyPath, undefined);else if ('length' in keyPath) [].map.call(keyPath, function (kp) {\n setByKeyPath(obj, kp, undefined);\n });\n}\n\nexport function shallowClone(obj) {\n var rv = {};\n for (var m in obj) {\n if (obj.hasOwnProperty(m)) rv[m] = obj[m];\n }\n return rv;\n}\n\nexport function deepClone(any) {\n if (!any || typeof any !== 'object') return any;\n var rv;\n if (isArray(any)) {\n rv = [];\n for (var i = 0, l = any.length; i < l; ++i) {\n rv.push(deepClone(any[i]));\n }\n } else if (any instanceof Date) {\n rv = new Date();\n rv.setTime(any.getTime());\n } else {\n rv = any.constructor ? Object.create(any.constructor.prototype) : {};\n for (var prop in any) {\n if (any.hasOwnProperty(prop)) {\n rv[prop] = deepClone(any[prop]);\n }\n }\n }\n return rv;\n}\n\nexport function getObjectDiff(a, b, rv, prfx) {\n // This is a simplified version that will always return keypaths on the root level.\n // If for example a and b differs by: (a.somePropsObject.x != b.somePropsObject.x), we will return that \"somePropsObject\" is changed\n // and not \"somePropsObject.x\". This is acceptable and true but could be optimized to support nestled changes if that would give a\n // big optimization benefit.\n rv = rv || {};\n prfx = prfx || '';\n for (var prop in a) {\n if (a.hasOwnProperty(prop)) {\n if (!b.hasOwnProperty(prop)) rv[prfx + prop] = undefined; // Property removed\n else {\n var ap = a[prop],\n bp = b[prop];\n if (typeof ap === 'object' && typeof bp === 'object') getObjectDiff(ap, bp, rv, prfx + prop + \".\");else if (ap !== bp) rv[prfx + prop] = b[prop]; // Primitive value changed\n }\n }\n }for (var prop in b) {\n if (b.hasOwnProperty(prop) && !a.hasOwnProperty(prop)) {\n rv[prfx + prop] = b[prop]; // Property added\n }\n }return rv;\n}\n\nexport function idbp(idbOperation) {\n return new Promise(function (resolve, reject) {\n var req = idbOperation();\n req.onerror = reject;\n req.onsuccess = resolve;\n });\n}","import { extend } from './utils';\n\nexport function nop() {}\nexport function mirror(val) {\n return val;\n}\nexport function pureFunctionChain(f1, f2) {\n // Enables chained events that takes ONE argument and returns it to the next function in chain.\n // This pattern is used in the hook(\"reading\") event.\n if (f1 == null || f1 === mirror) return f2;\n return function (val) {\n return f2(f1(val));\n };\n}\n\nexport function callBoth(on1, on2) {\n return function () {\n on1.apply(this, arguments);\n on2.apply(this, arguments);\n };\n}\n\nexport function hookCreatingChain(f1, f2) {\n // Enables chained events that takes several arguments and may modify first argument by making a modification and then returning the same instance.\n // This pattern is used in the hook(\"creating\") event.\n if (f1 === nop) return f2;\n return function () {\n var res = f1.apply(this, arguments);\n if (res !== undefined) arguments[0] = res;\n var onsuccess = this.onsuccess,\n // In case event listener has set this.onsuccess\n onerror = this.onerror; // In case event listener has set this.onerror\n this.onsuccess = null;\n this.onerror = null;\n var res2 = f2.apply(this, arguments);\n if (onsuccess) this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;\n if (onerror) this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;\n return res2 !== undefined ? res2 : res;\n };\n}\n\nexport function hookDeletingChain(f1, f2) {\n if (f1 === nop) return f2;\n return function () {\n f1.apply(this, arguments);\n var onsuccess = this.onsuccess,\n // In case event listener has set this.onsuccess\n onerror = this.onerror; // In case event listener has set this.onerror\n this.onsuccess = this.onerror = null;\n f2.apply(this, arguments);\n if (onsuccess) this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;\n if (onerror) this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;\n };\n}\n\nexport function hookUpdatingChain(f1, f2) {\n if (f1 === nop) return f2;\n return function () {\n var res = f1.apply(this, arguments);\n if (res !== undefined) extend(arguments[0], res); // If f1 returns new modifications, extend caller's modifications with the result before calling next in chain.\n var onsuccess = this.onsuccess,\n // In case event listener has set this.onsuccess\n onerror = this.onerror; // In case event listener has set this.onerror\n this.onsuccess = null;\n this.onerror = null;\n var res2 = f2.apply(this, arguments);\n if (onsuccess) this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;\n if (onerror) this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;\n return res === undefined ? res2 === undefined ? undefined : res2 : res2 === undefined ? res : extend(res, res2);\n };\n}\n\nexport function stoppableEventChain(f1, f2) {\n // Enables chained events that may return false to stop the event chain.\n if (f1 === nop) return f2;\n return function () {\n if (f1.apply(this, arguments) === false) return false;\n return f2.apply(this, arguments);\n };\n}\n\nexport function reverseStoppableEventChain(f1, f2) {\n if (f1 === nop) return f2;\n return function () {\n if (f2.apply(this, arguments) === false) return false;\n return f1.apply(this, arguments);\n };\n}\n\nexport function nonStoppableEventChain(f1, f2) {\n if (f1 === nop) return f2;\n return function () {\n f1.apply(this, arguments);\n f2.apply(this, arguments);\n };\n}\n\nexport function promisableChain(f1, f2) {\n if (f1 === nop) return f2;\n return function () {\n var res = f1.apply(this, arguments);\n if (res && typeof res.then === 'function') {\n var thiz = this,\n args = arguments;\n return res.then(function () {\n return f2.apply(thiz, args);\n });\n }\n return f2.apply(this, arguments);\n };\n}","import { derive } from './utils';\n\nvar dexieErrorNames = ['Modify', 'Bulk', 'OpenFailed', 'VersionChange', 'Schema', 'Upgrade', 'InvalidTable', 'MissingAPI', 'NoSuchDatabase', 'InvalidArgument', 'SubTransaction', 'Unsupported', 'Internal', 'DatabaseClosed'];\n\nvar idbDomErrorNames = ['Unknown', 'Constraint', 'Data', 'TransactionInactive', 'ReadOnly', 'Version', 'NotFound', 'InvalidState', 'InvalidAccess', 'Abort', 'Timeout', 'QuotaExceeded', 'Syntax', 'DataClone'];\n\nvar errorList = dexieErrorNames.concat(idbDomErrorNames);\n\nvar defaultTexts = {\n VersionChanged: \"Database version changed by other database connection\",\n DatabaseClosed: \"Database has been closed\"\n};\n\n//\n// DexieError - base class of all out exceptions.\n//\nexport function DexieError(name, msg) {\n // Reason we don't use ES6 classes is because:\n // 1. It bloats transpiled code and increases size of minified code.\n // 2. It doesn't give us much in this case.\n // 3. It would require sub classes to call super(), which\n // is not needed when deriving from Error.\n this.name = name;\n this.message = msg;\n}\nderive(DexieError).from(Error);\n\nfunction getMultiErrorMessage(msg, failures) {\n return msg + \". Errors: \" + failures.map(function (f) {\n return f.toString();\n }).filter(function (v, i, s) {\n return s.indexOf(v) === i;\n }) // Only unique error strings\n .join('\\n');\n}\n//\n// ModifyError - thrown in WriteableCollection.modify()\n// Specific constructor because it contains members failures and failedKeys.\n//\nexport function ModifyError(msg, failures, successCount, failedKeys) {\n this.name = \"ModifyError\";\n this.failures = failures;\n this.failedKeys = failedKeys;\n this.successCount = successCount;\n this.message = getMultiErrorMessage(msg, failures);\n}\nderive(ModifyError).from(DexieError);\n\nexport function BulkError(msg, failures) {\n this.name = \"BulkError\";\n this.failures = failures;\n this.message = getMultiErrorMessage(msg, failures);\n}\nderive(BulkError).from(DexieError);\n\n//\n//\n// Dynamically generate error names and exception classes based\n// on the names in errorList.\n//\n//\n\n// Map of {ErrorName -> ErrorName + \"Error\"}\nexport var errnames = errorList.reduce(function (obj, name) {\n return obj[name] = name + \"Error\", obj;\n}, {});\n\n// Need an alias for DexieError because we're gonna create subclasses with the same name.\nvar BaseException = DexieError;\n// Map of {ErrorName -> exception constructor}\nexport var exceptions = errorList.reduce(function (obj, name) {\n // Let the name be \"DexieError\" because this name may\n // be shown in call stack and when debugging. DexieError is\n // the most true name because it derives from DexieError,\n // and we cannot change Function.name programatically without\n // dynamically create a Function object, which would be considered\n // 'eval-evil'.\n var fullName = name + \"Error\";\n function DexieError(msgOrInner, inner) {\n this.name = fullName;\n if (typeof msgOrInner === 'string') {\n this.message = msgOrInner;\n this.inner = inner || null;\n } else if (typeof msgOrInner === 'object') {\n this.message = msgOrInner.name + ' ' + msgOrInner.message;\n this.inner = msgOrInner;\n } else {\n this.message = defaultTexts[name];\n this.inner = null;\n }\n }\n derive(DexieError).from(BaseException);\n obj[name] = DexieError;\n return obj;\n}, {});\n\n// Use ECMASCRIPT standard exceptions where applicable:\nexceptions.Syntax = SyntaxError;\nexceptions.Type = TypeError;\nexceptions.Range = RangeError;\n\nexport var exceptionMap = idbDomErrorNames.reduce(function (obj, name) {\n obj[name + \"Error\"] = exceptions[name];\n return obj;\n}, {});\n\nexport function mapError(domError, message) {\n var rv = domError;\n if (!(domError instanceof DexieError) && domError.name && exceptionMap[domError.name]) {\n rv = new exceptionMap[domError.name](message || domError.message, domError);\n if (domError.stack) rv.stack = domError.stack;\n }\n return rv;\n}\n\nexport function stack(error) {\n if (error.stack) return error;\n try {\n throw new Error();\n } catch (e) {\n error.stack = e.stack;\n }\n return error;\n}\n\nexport var fullNameExceptions = errorList.reduce(function (obj, name) {\n if ([\"Syntax\", \"Type\", \"Range\"].indexOf(name) === -1) obj[name + \"Error\"] = exceptions[name];\n return obj;\n}, {});\n\nfullNameExceptions.ModifyError = ModifyError;\nfullNameExceptions.DexieError = DexieError;\nfullNameExceptions.BulkError = BulkError;","import { slice, keys, isArray, asap, _global } from './utils';\nimport { nop, stoppableEventChain } from './chaining-functions';\nimport { exceptions } from './errors';\n\nexport default function Events(ctx, eventNames) {\n var args = arguments;\n var evs = {};\n var rv = function (eventName, subscriber) {\n if (subscriber) {\n // Subscribe\n var args = slice(arguments, 1);\n var ev = evs[eventName];\n ev.subscribe.apply(ev, args);\n return ctx;\n } else if (typeof eventName === 'string') {\n // Return interface allowing to fire or unsubscribe from event\n return evs[eventName];\n }\n };\n rv.addEventType = add;\n\n function add(eventName, chainFunction, defaultFunction) {\n if (isArray(eventName)) return addEventGroup(eventName);\n if (typeof eventName === 'object') return addConfiguredEvents(eventName);\n if (!chainFunction) chainFunction = stoppableEventChain;\n if (!defaultFunction) defaultFunction = nop;\n\n var context = {\n subscribers: [],\n fire: defaultFunction,\n subscribe: function (cb) {\n context.subscribers.push(cb);\n context.fire = chainFunction(context.fire, cb);\n },\n unsubscribe: function (cb) {\n context.subscribers = context.subscribers.filter(function (fn) {\n return fn !== cb;\n });\n context.fire = context.subscribers.reduce(chainFunction, defaultFunction);\n }\n };\n evs[eventName] = rv[eventName] = context;\n return context;\n }\n\n function addConfiguredEvents(cfg) {\n // events(this, {reading: [functionChain, nop]});\n keys(cfg).forEach(function (eventName) {\n var args = cfg[eventName];\n if (isArray(args)) {\n add(eventName, cfg[eventName][0], cfg[eventName][1]);\n } else if (args === 'asap') {\n // Rather than approaching event subscription using a functional approach, we here do it in a for-loop where subscriber is executed in its own stack\n // enabling that any exception that occur wont disturb the initiator and also not nescessary be catched and forgotten.\n var context = add(eventName, null, function fire() {\n var args = arguments;\n context.subscribers.forEach(function (fn) {\n asap(function fireEvent() {\n fn.apply(_global, args);\n });\n });\n });\n context.subscribe = function (fn) {\n // Change how subscribe works to not replace the fire function but to just add the subscriber to subscribers\n if (context.subscribers.indexOf(fn) === -1) context.subscribers.push(fn);\n };\n context.unsubscribe = function (fn) {\n // Change how unsubscribe works for the same reason as above.\n var idxOfFn = context.subscribers.indexOf(fn);\n if (idxOfFn !== -1) context.subscribers.splice(idxOfFn, 1);\n };\n } else throw new exceptions.InvalidArgument(\"Invalid event config\");\n });\n }\n\n function addEventGroup(eventGroup) {\n // promise-based event group (i.e. we promise to call one and only one of the events in the pair, and to only call it once.\n var done = false;\n eventGroup.forEach(function (name) {\n add(name).subscribe(checkDone);\n });\n function checkDone() {\n if (done) return false;\n done = true;\n }\n }\n\n for (var i = 1, l = args.length; i < l; ++i) {\n add(args[i]);\n }\n\n return rv;\n}","import { _global, slice, isArray, doFakeAutoComplete } from './utils';\nimport { nop } from './chaining-functions';\nimport Events from './Events';\n\n//\n// Promise Class\n//\n// A variant of promise-light (https://github.com/taylorhakes/promise-light) by https://github.com/taylorhakes - an A+ and ECMASCRIPT 6 compliant Promise implementation.\n//\n// Modified by David Fahlander to be indexedDB compliant (See discussion: https://github.com/promises-aplus/promises-spec/issues/45) .\n// This implementation will not use setTimeout or setImmediate when it's not needed. The behavior is 100% Promise/A+ compliant since\n// the caller of new Promise() can be certain that the promise wont be triggered the lines after constructing the promise. We fix this by using the member variable constructing to check\n// whether the object is being constructed when reject or resolve is called. If so, the use setTimeout/setImmediate to fulfill the promise, otherwise, we know that it's not needed.\n//\n// This topic was also discussed in the following thread: https://github.com/promises-aplus/promises-spec/issues/45 and this implementation solves that issue.\n//\n// Another feature with this Promise implementation is that reject will return false in case no one catched the reject call. This is used\n// to stopPropagation() on the IDBRequest error event in case it was catched but not otherwise.\n//\n// Also, the event new Promise().onuncatched is called in case no one catches a reject call. This is used for us to manually bubble any request\n// errors to the transaction. We must not rely on IndexedDB implementation to do this, because it only does so when the source of the rejection\n// is an error event on a request, not in case an ordinary exception is thrown.\n\nvar _asap = _global.setImmediate || function (fn) {\n var args = slice(arguments, 1);\n\n // If not FF13 and earlier failed, we could use this call here instead: setTimeout.call(this, [fn, 0].concat(arguments));\n setTimeout(function () {\n fn.apply(_global, args);\n }, 0);\n};\n\ndoFakeAutoComplete(function () {\n // Simplify the job for VS Intellisense. This piece of code is one of the keys to the new marvellous intellisense support in Dexie.\n _asap = asap = enqueueImmediate = function (fn) {\n var args = arguments;setTimeout(function () {\n fn.apply(_global, slice(args, 1));\n }, 0);\n };\n});\n\nvar asap = _asap,\n isRootExecution = true;\n\nvar operationsQueue = [];\nvar tickFinalizers = [];\nfunction enqueueImmediate(fn, args) {\n operationsQueue.push([fn, slice(arguments, 1)]);\n}\n\nfunction executeOperationsQueue() {\n var queue = operationsQueue;\n operationsQueue = [];\n for (var i = 0, l = queue.length; i < l; ++i) {\n var item = queue[i];\n item[0].apply(_global, item[1]);\n }\n}\n\nexport default function Promise(fn) {\n if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n this._state = null; // null (=pending), false (=rejected) or true (=resolved)\n this._value = null; // error or result\n this._deferreds = [];\n this._catched = false; // for onuncatched\n //this._id = ++PromiseID;\n var self = this;\n var constructing = true;\n this._PSD = Promise.PSD;\n\n try {\n doResolve(this, fn, function (data) {\n if (constructing) asap(resolve, self, data);else resolve(self, data);\n }, function (reason) {\n if (constructing) {\n asap(reject, self, reason);\n return false;\n } else {\n return reject(self, reason);\n }\n });\n } finally {\n constructing = false;\n }\n}\n\nfunction handle(self, deferred) {\n if (self._state === null) {\n self._deferreds.push(deferred);\n return;\n }\n\n var cb = self._state ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n // This Deferred doesnt have a listener for the event being triggered (onFulfilled or onReject) so lets forward the event to any eventual listeners on the Promise instance returned by then() or catch()\n return (self._state ? deferred.resolve : deferred.reject)(self._value);\n }\n var ret,\n isRootExec = isRootExecution;\n isRootExecution = false;\n asap = enqueueImmediate;\n try {\n var outerPSD = Promise.PSD;\n Promise.PSD = self._PSD;\n ret = cb(self._value);\n if (!self._state && (!ret || typeof ret.then !== 'function' || ret._state !== false)) setCatched(self); // Caller did 'return Promise.reject(err);' - don't regard it as catched!\n deferred.resolve(ret);\n } catch (e) {\n deferred.reject(e);\n } finally {\n Promise.PSD = outerPSD;\n if (isRootExec) {\n do {\n while (operationsQueue.length > 0) {\n executeOperationsQueue();\n }var finalizer = tickFinalizers.pop();\n if (finalizer) try {\n finalizer();\n } catch (e) {}\n } while (tickFinalizers.length > 0 || operationsQueue.length > 0);\n asap = _asap;\n isRootExecution = true;\n }\n }\n}\n\nfunction _rootExec(fn) {\n var isRootExec = isRootExecution;\n isRootExecution = false;\n asap = enqueueImmediate;\n try {\n return fn();\n } finally {\n if (isRootExec) {\n do {\n while (operationsQueue.length > 0) {\n executeOperationsQueue();\n }var finalizer = tickFinalizers.pop();\n if (finalizer) try {\n finalizer();\n } catch (e) {}\n } while (tickFinalizers.length > 0 || operationsQueue.length > 0);\n asap = _asap;\n isRootExecution = true;\n }\n }\n}\n\nfunction setCatched(promise) {\n promise._catched = true;\n if (promise._parent && !promise._parent._catched) setCatched(promise._parent);\n}\n\nfunction resolve(promise, newValue) {\n var outerPSD = Promise.PSD;\n Promise.PSD = promise._PSD;\n try {\n //Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === promise) throw new TypeError('A promise cannot be resolved with itself.');\n if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {\n if (typeof newValue.then === 'function') {\n if (newValue instanceof Promise && newValue._state !== null) {\n promise._state = newValue._state;\n promise._value = newValue._value;\n finale.call(promise);\n return;\n }\n doResolve(promise, function (resolve, reject) {\n //newValue instanceof Promise ? newValue._then(resolve, reject) : newValue.then(resolve, reject);\n newValue.then(resolve, reject);\n }, function (data) {\n resolve(promise, data);\n }, function (reason) {\n reject(promise, reason);\n });\n return;\n }\n }\n promise._state = true;\n promise._value = newValue;\n finale.call(promise);\n } catch (e) {\n reject(e);\n } finally {\n Promise.PSD = outerPSD;\n }\n}\n\nfunction reject(promise, newValue) {\n var outerPSD = Promise.PSD;\n Promise.PSD = promise._PSD;\n promise._state = false;\n promise._value = newValue;\n\n finale.call(promise);\n if (!promise._catched) {\n try {\n if (promise.onuncatched) promise.onuncatched(promise._value);else Promise.on.error.fire(promise._value);\n } catch (e) {}\n }\n Promise.PSD = outerPSD;\n return promise._catched;\n}\n\nfunction finale() {\n for (var i = 0, len = this._deferreds.length; i < len; i++) {\n handle(this, this._deferreds[i]);\n }\n this._deferreds = [];\n}\n\nfunction Deferred(onFulfilled, onRejected, resolve, reject) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.resolve = resolve;\n this.reject = reject;\n}\n\n/**\r\n * Take a potentially misbehaving resolver function and make sure\r\n * onFulfilled and onRejected are only called once.\r\n *\r\n * Makes no guarantees about asynchrony.\r\n */\nfunction doResolve(promise, fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function Promise_resolve(value) {\n if (done) return;\n done = true;\n onFulfilled(value);\n }, function Promise_reject(reason) {\n if (done) return promise._catched;\n done = true;\n return onRejected(reason);\n });\n } catch (ex) {\n if (done) return;\n return onRejected(ex);\n }\n}\n\nPromise.all = function () {\n var args = slice(arguments.length === 1 && isArray(arguments[0]) ? arguments[0] : arguments);\n\n return new Promise(function (resolve, reject) {\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(val, function (val) {\n res(i, val);\n }, reject);\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\n/* Prototype Methods */\nPromise.prototype.then = function (onFulfilled, onRejected) {\n var self = this;\n var p = new Promise(function (resolve, reject) {\n if (self._state === null) handle(self, new Deferred(onFulfilled, onRejected, resolve, reject));else asap(handle, self, new Deferred(onFulfilled, onRejected, resolve, reject));\n });\n p._PSD = this._PSD;\n p.onuncatched = this.onuncatched; // Needed when exception occurs in a then() clause of a successful parent promise. Want onuncatched to be called even in callbacks of callbacks of the original promise.\n p._parent = this; // Used for recursively calling onuncatched event on self and all parents.\n return p;\n};\n\nPromise.prototype._then = function (onFulfilled, onRejected) {\n handle(this, new Deferred(onFulfilled, onRejected, nop, nop));\n};\n\nPromise.prototype['catch'] = function (onRejected) {\n if (arguments.length === 1) return this.then(null, onRejected);\n // First argument is the Error type to catch\n var type = arguments[0],\n callback = arguments[1];\n if (typeof type === 'function') return this.then(null, function (e) {\n // Catching errors by its constructor type (similar to java / c++ / c#)\n // Sample: promise.catch(TypeError, function (e) { ... });\n if (e instanceof type) return callback(e);else return Promise.reject(e);\n });else return this.then(null, function (e) {\n // Catching errors by the error.name property. Makes sense for indexedDB where error type\n // is always DOMError but where e.name tells the actual error type.\n // Sample: promise.catch('ConstraintError', function (e) { ... });\n if (e && e.name === type) return callback(e);else return Promise.reject(e);\n });\n};\n\nPromise.prototype['finally'] = function (onFinally) {\n return this.then(function (value) {\n onFinally();\n return value;\n }, function (err) {\n onFinally();\n return Promise.reject(err);\n });\n};\n\nPromise.prototype.onuncatched = null; // Optional event triggered if promise is rejected but no one listened.\n\nPromise.resolve = function (value) {\n if (value && typeof value.then === 'function') return value;\n var p = new Promise(function () {});\n p._state = true;\n p._value = value;\n return p;\n};\n\nPromise.reject = function (value) {\n var p = new Promise(function () {});\n p._state = false;\n p._value = value;\n return p;\n};\n\nPromise.race = function (values) {\n return new Promise(function (resolve, reject) {\n values.map(function (value) {\n value.then(resolve, reject);\n });\n });\n};\n\nPromise.PSD = null; // Promise Specific Data - a TLS Pattern (Thread Local Storage) for Promises. TODO: Rename Promise.PSD to Promise.data\n\nPromise.newPSD = function (fn) {\n // Create new PSD scope (Promise Specific Data)\n var outerScope = Promise.PSD;\n Promise.PSD = outerScope ? Object.create(outerScope) : {};\n try {\n return fn();\n } finally {\n Promise.PSD = outerScope;\n }\n};\n\nPromise.usePSD = function (psd, fn) {\n var outerScope = Promise.PSD;\n Promise.PSD = psd;\n try {\n return fn();\n } finally {\n Promise.PSD = outerScope;\n }\n};\n\nPromise._rootExec = _rootExec;\nPromise._tickFinalize = function (callback) {\n if (isRootExecution) throw new Error(\"Not in a virtual tick\");\n tickFinalizers.push(callback);\n};\n\nPromise.on = Events(null, { \"error\": [function (f1, f2) {\n return f2;\n }, // Only use the most recent handler (only allow one handler at a time).\n defaultErrorHandler] // Default to defaultErrorHandler\n});\n\n// By default, log uncaught errors to the console\nfunction defaultErrorHandler(e) {\n console.error('Uncaught Promise: ' + (e.stack || e));\n}","/*\r\n * Dexie.js - a minimalistic wrapper for IndexedDB\r\n * ===============================================\r\n *\r\n * By David Fahlander, david.fahlander@gmail.com\r\n *\r\n * Version {version}, {date}\r\n *\r\n * www.dexie.com\r\n *\r\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/\r\n */\n\nimport { keys, isArray, extend, derive, slice, override, _global, doFakeAutoComplete, assert, asap, miniTryCatch, fail, getByKeyPath, setByKeyPath, delByKeyPath, shallowClone, deepClone, getObjectDiff } from './utils';\nimport { DexieError, ModifyError, BulkError, errnames, exceptions, fullNameExceptions, mapError, stack } from './errors';\nimport Promise from './Promise';\nimport Events from './Events';\nimport { nop, mirror, pureFunctionChain, callBoth, hookCreatingChain, hookUpdatingChain, hookDeletingChain, nonStoppableEventChain, promisableChain, reverseStoppableEventChain, stoppableEventChain } from './chaining-functions';\n\nvar maxString = String.fromCharCode(65535),\n\n// maxKey is an Array if indexedDB implementations supports array keys (not supported by IE,Edge or Safari at the moment)\n// Otherwise maxKey is maxString. This is handy when needing an open upper border without limit.\nmaxKey = function () {\n try {\n IDBKeyRange.only([[]]);return [[]];\n } catch (e) {\n return maxString;\n }\n}(),\n INVALID_KEY_ARGUMENT = \"Invalid key provided. Keys must be of type string, number, Date or Array.\",\n STRING_EXPECTED = \"String expected.\",\n connections = [],\n isIEOrEdge = typeof navigator !== 'undefined' && /(MSIE|Trident|Edge)/.test(navigator.userAgent),\n hasIEDeleteObjectStoreBug = isIEOrEdge,\n hangsOnDeleteLargeKeyRange = isIEOrEdge;\n\nexport default function Dexie(dbName, options) {\n /// Specify only if you wich to control which addons that should run on this instance\n var deps = Dexie.dependencies;\n var opts = extend({\n // Default Options\n addons: Dexie.addons, // Pick statically registered addons by default\n autoOpen: true, // Don't require db.open() explicitely.\n indexedDB: deps.indexedDB, // Backend IndexedDB api. Default to IDBShim or browser env.\n IDBKeyRange: deps.IDBKeyRange // Backend IDBKeyRange api. Default to IDBShim or browser env.\n }, options || {});\n var addons = opts.addons,\n autoOpen = opts.autoOpen,\n indexedDB = opts.indexedDB,\n IDBKeyRange = opts.IDBKeyRange;\n\n var globalSchema = this._dbSchema = {};\n var versions = [];\n var dbStoreNames = [];\n var allTables = {};\n var notInTransFallbackTables = {};\n ///\n var idbdb = null; // Instance of IDBDatabase\n var db_is_blocked = true;\n var dbOpenError = null;\n var isBeingOpened = false;\n var READONLY = \"readonly\",\n READWRITE = \"readwrite\";\n var db = this;\n var pausedResumeables = [];\n var autoSchema = true;\n var hasNativeGetDatabaseNames = !!getNativeGetDatabaseNamesFn(indexedDB);\n\n function init() {\n // Default subscribers to \"versionchange\" and \"blocked\".\n // Can be overridden by custom handlers. If custom handlers return false, these default\n // behaviours will be prevented.\n db.on(\"versionchange\", function (ev) {\n // Default behavior for versionchange event is to close database connection.\n // Caller can override this behavior by doing db.on(\"versionchange\", function(){ return false; });\n // Let's not block the other window from making it's delete() or open() call.\n // NOTE! This event is never fired in IE,Edge or Safari.\n if (ev.newVersion > 0) console.warn('Another connection wants to upgrade database \\'' + db.name + '\\'. Closing db now to resume the upgrade.');else console.warn('Another connection wants to delete database \\'' + db.name + '\\'. Closing db now to resume the delete request.');\n db.close();\n // In many web applications, it would be recommended to force window.reload()\n // when this event occurs. To do that, subscribe to the versionchange event\n // and call window.location.reload(true) if ev.newVersion > 0 (not a deletion)\n // The reason for this is that your current web app obviously has old schema code that needs\n // to be updated. Another window got a newer version of the app and needs to upgrade DB but\n // your window is blocking it unless we close it here.\n });\n db.on(\"blocked\", function (ev) {\n if (!ev.newVersion || ev.newVersion < ev.oldVersion) console.warn('Dexie.delete(\\'' + db.name + '\\') was blocked');else console.warn('Upgrade \\'' + db.name + '\\' blocked by other connection holding version ' + ev.oldVersion / 10);\n });\n }\n\n //\n //\n //\n // ------------------------- Versioning Framework---------------------------\n //\n //\n //\n\n this.version = function (versionNumber) {\n /// \n /// \n if (idbdb || isBeingOpened) throw new exceptions.Schema(\"Cannot add version when database is open\");\n this.verno = Math.max(this.verno, versionNumber);\n var versionInstance = versions.filter(function (v) {\n return v._cfg.version === versionNumber;\n })[0];\n if (versionInstance) return versionInstance;\n versionInstance = new Version(versionNumber);\n versions.push(versionInstance);\n versions.sort(lowerVersionFirst);\n return versionInstance;\n };\n\n function Version(versionNumber) {\n this._cfg = {\n version: versionNumber,\n storesSource: null,\n dbschema: {},\n tables: {},\n contentUpgrade: null\n };\n this.stores({}); // Derive earlier schemas by default.\n }\n\n extend(Version.prototype, {\n stores: function (stores) {\n /// \n /// Defines the schema for a particular version\n /// \n /// \n /// Example:
\n /// {users: \"id++,first,last,&username,*email\",
\n /// passwords: \"id++,&username\"}
\n ///
\n /// Syntax: {Table: \"[primaryKey][++],[&][*]index1,[&][*]index2,...\"}

\n /// Special characters:
\n /// \"&\" means unique key,
\n /// \"*\" means value is multiEntry,
\n /// \"++\" means auto-increment and only applicable for primary key
\n /// \n this._cfg.storesSource = this._cfg.storesSource ? extend(this._cfg.storesSource, stores) : stores;\n\n // Derive stores from earlier versions if they are not explicitely specified as null or a new syntax.\n var storesSpec = {};\n versions.forEach(function (version) {\n // 'versions' is always sorted by lowest version first.\n extend(storesSpec, version._cfg.storesSource);\n });\n\n var dbschema = this._cfg.dbschema = {};\n this._parseStoresSpec(storesSpec, dbschema);\n // Update the latest schema to this version\n // Update API\n globalSchema = db._dbSchema = dbschema;\n removeTablesApi([allTables, db, notInTransFallbackTables]);\n setApiOnPlace([notInTransFallbackTables], tableNotInTransaction, keys(dbschema), READWRITE, dbschema);\n setApiOnPlace([allTables, db, this._cfg.tables], db._transPromiseFactory, keys(dbschema), READWRITE, dbschema, true);\n dbStoreNames = keys(dbschema);\n return this;\n },\n upgrade: function (upgradeFunction) {\n /// Function that performs upgrading actions.\n var self = this;\n fakeAutoComplete(function () {\n upgradeFunction(db._createTransaction(READWRITE, keys(self._cfg.dbschema), self._cfg.dbschema)); // BUGBUG: No code completion for prev version's tables wont appear.\n });\n this._cfg.contentUpgrade = upgradeFunction;\n return this;\n },\n _parseStoresSpec: function (stores, outSchema) {\n keys(stores).forEach(function (tableName) {\n if (stores[tableName] !== null) {\n var instanceTemplate = {};\n var indexes = parseIndexSyntax(stores[tableName]);\n var primKey = indexes.shift();\n if (primKey.multi) throw new exceptions.Schema(\"Primary key cannot be multi-valued\");\n if (primKey.keyPath) setByKeyPath(instanceTemplate, primKey.keyPath, primKey.auto ? 0 : primKey.keyPath);\n indexes.forEach(function (idx) {\n if (idx.auto) throw new exceptions.Schema(\"Only primary key can be marked as autoIncrement (++)\");\n if (!idx.keyPath) throw new exceptions.Schema(\"Index must have a name and cannot be an empty string\");\n setByKeyPath(instanceTemplate, idx.keyPath, idx.compound ? idx.keyPath.map(function () {\n return \"\";\n }) : \"\");\n });\n outSchema[tableName] = new TableSchema(tableName, primKey, indexes, instanceTemplate);\n }\n });\n }\n });\n\n function runUpgraders(oldVersion, idbtrans, reject, openReq) {\n if (oldVersion === 0) {\n //globalSchema = versions[versions.length - 1]._cfg.dbschema;\n // Create tables:\n keys(globalSchema).forEach(function (tableName) {\n createTable(idbtrans, tableName, globalSchema[tableName].primKey, globalSchema[tableName].indexes);\n });\n // Populate data\n var t = db._createTransaction(READWRITE, dbStoreNames, globalSchema);\n t.idbtrans = idbtrans;\n t.idbtrans.onerror = eventRejectHandler(reject, [\"populating database\"]);\n t.on('error').subscribe(reject);\n Promise.newPSD(function () {\n Promise.PSD.trans = t;\n try {\n db.on(\"populate\").fire(t);\n } catch (err) {\n openReq.onerror = idbtrans.onerror = function (ev) {\n ev.preventDefault();\n }; // Prohibit AbortError fire on db.on(\"error\") in Firefox.\n try {\n idbtrans.abort();\n } catch (e) {}\n idbtrans.db.close();\n reject(err);\n }\n });\n } else {\n // Upgrade version to version, step-by-step from oldest to newest version.\n // Each transaction object will contain the table set that was current in that version (but also not-yet-deleted tables from its previous version)\n var queue = [];\n var oldVersionStruct = versions.filter(function (version) {\n return version._cfg.version === oldVersion;\n })[0];\n if (!oldVersionStruct) throw new exceptions.Upgrade(\"Dexie specification of currently installed DB version is missing\");\n globalSchema = db._dbSchema = oldVersionStruct._cfg.dbschema;\n var anyContentUpgraderHasRun = false;\n\n var versToRun = versions.filter(function (v) {\n return v._cfg.version > oldVersion;\n });\n versToRun.forEach(function (version) {\n /// \n var oldSchema = globalSchema;\n var newSchema = version._cfg.dbschema;\n adjustToExistingIndexNames(oldSchema, idbtrans);\n adjustToExistingIndexNames(newSchema, idbtrans);\n globalSchema = db._dbSchema = newSchema;\n {\n var diff = getSchemaDiff(oldSchema, newSchema);\n diff.add.forEach(function (tuple) {\n queue.push(function (idbtrans, cb) {\n createTable(idbtrans, tuple[0], tuple[1].primKey, tuple[1].indexes);\n cb();\n });\n });\n diff.change.forEach(function (change) {\n if (change.recreate) {\n throw new exceptions.Upgrade(\"Not yet support for changing primary key\");\n } else {\n queue.push(function (idbtrans, cb) {\n var store = idbtrans.objectStore(change.name);\n change.add.forEach(function (idx) {\n addIndex(store, idx);\n });\n change.change.forEach(function (idx) {\n store.deleteIndex(idx.name);\n addIndex(store, idx);\n });\n change.del.forEach(function (idxName) {\n store.deleteIndex(idxName);\n });\n cb();\n });\n }\n });\n if (version._cfg.contentUpgrade) {\n queue.push(function (idbtrans, cb) {\n anyContentUpgraderHasRun = true;\n var t = db._createTransaction(READWRITE, slice(idbtrans.db.objectStoreNames), newSchema);\n t.idbtrans = idbtrans;\n var uncompletedRequests = 0;\n t._promise = override(t._promise, function (orig_promise) {\n return function (mode, fn, writeLock) {\n ++uncompletedRequests;\n function proxy(fn) {\n return function () {\n fn.apply(this, arguments);\n if (--uncompletedRequests === 0) cb(); // A called db operation has completed without starting a new operation. The flow is finished, now run next upgrader.\n };\n }\n return orig_promise.call(this, mode, function (resolve, reject, trans) {\n arguments[0] = proxy(resolve);\n arguments[1] = proxy(reject);\n fn.apply(this, arguments);\n }, writeLock);\n };\n });\n idbtrans.onerror = eventRejectHandler(reject, [\"running upgrader function for version\", version._cfg.version]);\n t.on('error').subscribe(reject);\n version._cfg.contentUpgrade(t);\n if (uncompletedRequests === 0) cb(); // contentUpgrade() didnt call any db operations at all.\n });\n }\n if (!anyContentUpgraderHasRun || hasIEDeleteObjectStoreBug) {\n // Dont delete old tables if ieBug is present and a content upgrader has run. Let tables be left in DB so far. This needs to be taken care of.\n queue.push(function (idbtrans, cb) {\n // Delete old tables\n deleteRemovedTables(newSchema, idbtrans);\n cb();\n });\n }\n }\n });\n\n // Now, create a queue execution engine\n var runNextQueuedFunction = function () {\n try {\n if (queue.length) queue.shift()(idbtrans, runNextQueuedFunction);else createMissingTables(globalSchema, idbtrans); // At last, make sure to create any missing tables. (Needed by addons that add stores to DB without specifying version)\n } catch (err) {\n openReq.onerror = idbtrans.onerror = function (ev) {\n ev.preventDefault();\n }; // Prohibit AbortError fire on db.on(\"error\") in Firefox.\n try {\n idbtrans.abort();\n } catch (e) {}\n idbtrans.db.close();\n reject(err);\n }\n };\n runNextQueuedFunction();\n }\n }\n\n function getSchemaDiff(oldSchema, newSchema) {\n var diff = {\n del: [], // Array of table names\n add: [], // Array of [tableName, newDefinition]\n change: [] // Array of {name: tableName, recreate: newDefinition, del: delIndexNames, add: newIndexDefs, change: changedIndexDefs}\n };\n for (var table in oldSchema) {\n if (!newSchema[table]) diff.del.push(table);\n }\n for (var table in newSchema) {\n var oldDef = oldSchema[table],\n newDef = newSchema[table];\n if (!oldDef) diff.add.push([table, newDef]);else {\n var change = {\n name: table,\n def: newSchema[table],\n recreate: false,\n del: [],\n add: [],\n change: []\n };\n if (oldDef.primKey.src !== newDef.primKey.src) {\n // Primary key has changed. Remove and re-add table.\n change.recreate = true;\n diff.change.push(change);\n } else {\n var oldIndexes = oldDef.indexes.reduce(function (prev, current) {\n prev[current.name] = current;return prev;\n }, {});\n var newIndexes = newDef.indexes.reduce(function (prev, current) {\n prev[current.name] = current;return prev;\n }, {});\n for (var idxName in oldIndexes) {\n if (!newIndexes[idxName]) change.del.push(idxName);\n }\n for (var idxName in newIndexes) {\n var oldIdx = oldIndexes[idxName],\n newIdx = newIndexes[idxName];\n if (!oldIdx) change.add.push(newIdx);else if (oldIdx.src !== newIdx.src) change.change.push(newIdx);\n }\n if (change.recreate || change.del.length > 0 || change.add.length > 0 || change.change.length > 0) {\n diff.change.push(change);\n }\n }\n }\n }\n return diff;\n }\n\n function createTable(idbtrans, tableName, primKey, indexes) {\n /// \n var store = idbtrans.db.createObjectStore(tableName, primKey.keyPath ? { keyPath: primKey.keyPath, autoIncrement: primKey.auto } : { autoIncrement: primKey.auto });\n indexes.forEach(function (idx) {\n addIndex(store, idx);\n });\n return store;\n }\n\n function createMissingTables(newSchema, idbtrans) {\n keys(newSchema).forEach(function (tableName) {\n if (!idbtrans.db.objectStoreNames.contains(tableName)) {\n createTable(idbtrans, tableName, newSchema[tableName].primKey, newSchema[tableName].indexes);\n }\n });\n }\n\n function deleteRemovedTables(newSchema, idbtrans) {\n for (var i = 0; i < idbtrans.db.objectStoreNames.length; ++i) {\n var storeName = idbtrans.db.objectStoreNames[i];\n if (newSchema[storeName] === null || newSchema[storeName] === undefined) {\n idbtrans.db.deleteObjectStore(storeName);\n }\n }\n }\n\n function addIndex(store, idx) {\n store.createIndex(idx.name, idx.keyPath, { unique: idx.unique, multiEntry: idx.multi });\n }\n\n function executePausedResumeables() {\n pausedResumeables.forEach(function (resumable) {\n // Resume all stalled operations. They will fail once they wake up.\n resumable.resume();\n });\n }\n\n //\n //\n // Dexie Protected API\n //\n //\n\n this._allTables = allTables;\n\n this._tableFactory = function createTable(mode, tableSchema, transactionPromiseFactory) {\n /// \n if (mode === READONLY) return new Table(tableSchema.name, transactionPromiseFactory, tableSchema, Collection);else return new WriteableTable(tableSchema.name, transactionPromiseFactory, tableSchema);\n };\n\n this._createTransaction = function (mode, storeNames, dbschema, parentTransaction) {\n return new Transaction(mode, storeNames, dbschema, parentTransaction);\n };\n\n function tableNotInTransaction(mode, storeNames) {\n throw new exceptions.InvalidTable(\"Table \" + storeNames[0] + \" not part of transaction. Original Scope Function Source: \" + Dexie.Promise.PSD.trans.scopeFunc.toString());\n }\n\n this._transPromiseFactory = function transactionPromiseFactory(mode, storeNames, fn) {\n // Last argument is \"writeLocked\". But this doesnt apply to oneshot direct db operations, so we ignore it.\n if (db_is_blocked && (!Promise.PSD || !Promise.PSD.letThrough)) {\n // Database is paused. Wait til resumed.\n if (!isBeingOpened && !autoOpen) {\n return fail(new exceptions.DatabaseClosed());\n }\n var blockedPromise = new Promise(function (resolve, reject) {\n pausedResumeables.push({\n resume: function () {\n var p = db._transPromiseFactory(mode, storeNames, fn);\n blockedPromise.onuncatched = p.onuncatched;\n p.then(resolve, reject);\n }\n });\n });\n if (autoOpen && !isBeingOpened) {\n db.open().catch(nop); // catching to get rid of error logging of uncaught Promise. dbOpenError will be returned again as a rejected Promise.\n }\n return blockedPromise;\n } else {\n var trans = db._createTransaction(mode, storeNames, globalSchema);\n return trans._promise(mode, function (resolve, reject) {\n // An uncatched operation will bubble to this anonymous transaction. Make sure\n // to continue bubbling it up to db.on('error'):\n trans.error(function (err) {\n db.on('error').fire(err);\n });\n Promise.newPSD(function () {\n Promise.PSD.trans = trans;\n fn(function (value) {\n // Instead of resolving value directly, wait with resolving it until transaction has completed.\n // Otherwise the data would not be in the DB if requesting it in the then() operation.\n // Specifically, to ensure that the following expression will work:\n //\n // db.friends.put({name: \"Arne\"}).then(function () {\n // db.friends.where(\"name\").equals(\"Arne\").count(function(count) {\n // assert (count === 1);\n // });\n // });\n //\n trans.complete(function () {\n resolve(value);\n });\n }, reject, trans);\n });\n });\n }\n };\n\n this._whenReady = function (fn) {\n if (!fake && db_is_blocked && (!Promise.PSD || !Promise.PSD.letThrough)) {\n if (!isBeingOpened) {\n if (autoOpen) {\n db.open().catch(nop); // catching to get rid of error logging of uncaught Promise. dbOpenError will be returned again as a rejected Promise.\n } else {\n return fail(new exceptions.DatabaseClosed());\n }\n }\n return new Promise(function (resolve, reject) {\n pausedResumeables.push({\n resume: function () {\n fn(resolve, reject);\n }\n });\n });\n }\n return new Promise(fn);\n };\n\n //\n //\n //\n //\n // Dexie API\n //\n //\n //\n\n this.verno = 0;\n\n this.open = function () {\n if (idbdb) return Promise.resolve(db);\n if (isBeingOpened) return new Promise(function (resolve, reject) {\n return db._whenReady(function () {\n resolve(db);\n }, function (e) {\n reject(e);\n });\n });\n dbOpenError = null;\n isBeingOpened = true;\n db_is_blocked = true;\n return new Promise(function (resolve, reject) {\n if (fake) resolve();\n var req,\n dbWasCreated = false;\n function openError(err) {\n try {\n req.transaction.abort();\n } catch (e) {}\n if (idbdb) try {\n idbdb.close();\n } catch (e) {}\n idbdb = null;\n isBeingOpened = false;\n dbOpenError = mapError(err);\n db_is_blocked = false;\n reject(dbOpenError);\n executePausedResumeables();\n }\n try {\n // Make sure caller has specified at least one version\n if (versions.length > 0) autoSchema = false;\n\n // Multiply db.verno with 10 will be needed to workaround upgrading bug in IE:\n // IE fails when deleting objectStore after reading from it.\n // A future version of Dexie.js will stopover an intermediate version to workaround this.\n // At that point, we want to be backward compatible. Could have been multiplied with 2, but by using 10, it is easier to map the number to the real version number.\n if (!indexedDB) throw new exceptions.MissingAPI(\"indexedDB API not found. If using IE10+, make sure to run your code on a server URL \" + \"(not locally). If using Safari, make sure to include indexedDB polyfill.\");\n req = autoSchema ? indexedDB.open(dbName) : indexedDB.open(dbName, Math.round(db.verno * 10));\n if (!req) throw new exceptions.MissingAPI(\"IndexedDB API not available\"); // May happen in Safari private mode, see https://github.com/dfahlander/Dexie.js/issues/134\n req.onerror = eventRejectHandler(openError, [\"opening database\", dbName]);\n req.onblocked = fireOnBlocked;\n req.onupgradeneeded = trycatch(function (e) {\n if (autoSchema && !db._allowEmptyDB) {\n // Unless an addon has specified db._allowEmptyDB, lets make the call fail.\n // Caller did not specify a version or schema. Doing that is only acceptable for opening alread existing databases.\n // If onupgradeneeded is called it means database did not exist. Reject the open() promise and make sure that we\n // do not create a new database by accident here.\n req.onerror = function (event) {\n event.preventDefault();\n }; // Prohibit onabort error from firing before we're done!\n req.transaction.abort(); // Abort transaction (would hope that this would make DB disappear but it doesnt.)\n // Close database and delete it.\n req.result.close();\n var delreq = indexedDB.deleteDatabase(dbName); // The upgrade transaction is atomic, and javascript is single threaded - meaning that there is no risk that we delete someone elses database here!\n delreq.onsuccess = delreq.onerror = function () {\n openError(new exceptions.NoSuchDatabase('Database ' + dbName + ' doesnt exist'));\n };\n } else {\n if (e.oldVersion === 0) dbWasCreated = true;\n req.transaction.onerror = eventRejectHandler(openError);\n var oldVer = e.oldVersion > Math.pow(2, 62) ? 0 : e.oldVersion; // Safari 8 fix.\n runUpgraders(oldVer / 10, req.transaction, openError, req);\n }\n }, openError);\n req.onsuccess = trycatch(function (e) {\n isBeingOpened = false;\n idbdb = req.result;\n if (autoSchema) readGlobalSchema();else if (idbdb.objectStoreNames.length > 0) {\n try {\n adjustToExistingIndexNames(globalSchema, idbdb.transaction(safariMultiStoreFix(idbdb.objectStoreNames), READONLY));\n } catch (e) {\n // Safari may bail out if > 1 store names. However, this shouldnt be a showstopper. Issue #120.\n }\n }\n\n idbdb.onversionchange = function (ev) {\n db._vcFired = true; // detect implementations that not support versionchange (IE/Edge/Safari)\n db.on(\"versionchange\").fire(ev);\n };\n if (!hasNativeGetDatabaseNames) {\n // Update localStorage with list of database names\n globalDatabaseList(function (databaseNames) {\n if (databaseNames.indexOf(dbName) === -1) return databaseNames.push(dbName);\n });\n }\n // Now, let any subscribers to the on(\"ready\") fire BEFORE any other db operations resume!\n // If an the on(\"ready\") subscriber returns a Promise, we will wait til promise completes or rejects before\n Promise.newPSD(function () {\n Promise.PSD.letThrough = true; // Set a Promise-Specific Data property informing that onready is firing. This will make db._whenReady() let the subscribers use the DB but block all others (!). Quite cool ha?\n try {\n var res = db.on.ready.fire();\n if (res && typeof res.then === 'function') {\n // If on('ready') returns a promise, wait for it to complete and then resume any pending operations.\n res.then(resume, function (err) {\n idbdb.close();\n idbdb = null;\n openError(err);\n });\n } else {\n asap(resume); // Cannot call resume directly because then the pauseResumables would inherit from our PSD scope.\n }\n } catch (e) {\n openError(e);\n }\n\n function resume() {\n db_is_blocked = false;\n executePausedResumeables();\n resolve();\n }\n });\n }, openError);\n } catch (err) {\n openError(err);\n }\n }).then(function () {\n connections.push(db);\n return db;\n });\n };\n\n this.close = function () {\n var idx = connections.indexOf(db);\n if (idx >= 0) connections.splice(idx, 1);\n if (idbdb) {\n idbdb.close();\n idbdb = null;\n autoOpen = false;\n if (db_is_blocked) {\n executePausedResumeables();\n }\n db_is_blocked = false;\n dbOpenError = new exceptions.DatabaseClosed();\n } else if (isBeingOpened) {\n db.on('ready', function () {\n return Promise.reject(new exceptions.DatabaseClosed());\n });\n }\n };\n\n this.delete = function () {\n var args = arguments;\n return new Promise(function (resolve, reject) {\n if (args.length > 0) throw new exceptions.InvalidArgument(\"Arguments not allowed in db.delete()\");\n function doDelete() {\n db.close();\n var req = indexedDB.deleteDatabase(dbName);\n req.onsuccess = function () {\n if (!hasNativeGetDatabaseNames) {\n globalDatabaseList(function (databaseNames) {\n var pos = databaseNames.indexOf(dbName);\n if (pos >= 0) return databaseNames.splice(pos, 1);\n });\n }\n resolve();\n };\n req.onerror = eventRejectHandler(reject, [\"deleting\", dbName]);\n req.onblocked = fireOnBlocked;\n }\n if (isBeingOpened) {\n pausedResumeables.push({ resume: doDelete });\n } else {\n doDelete();\n }\n });\n };\n\n this.backendDB = function () {\n return idbdb;\n };\n\n this.isOpen = function () {\n return idbdb !== null;\n };\n this.hasFailed = function () {\n return dbOpenError !== null;\n };\n this.dynamicallyOpened = function () {\n return autoSchema;\n };\n\n //\n // Properties\n //\n this.name = dbName;\n\n // db.tables - an array of all Table instances.\n // TODO: Change so that tables is a simple member and make sure to update it whenever allTables changes.\n Object.defineProperty(this, \"tables\", {\n get: function () {\n /// \n return keys(allTables).map(function (name) {\n return allTables[name];\n });\n }\n });\n\n //\n // Events\n //\n this.on = Events(this, \"error\", \"populate\", { blocked: [reverseStoppableEventChain, nop], \"ready\": [promisableChain, nop], \"versionchange\": [reverseStoppableEventChain, nop] });\n\n // Handle on('ready') specifically: If DB is already open, trigger the event immediately. Also, default to unsubscribe immediately after being triggered.\n this.on.ready.subscribe = override(this.on.ready.subscribe, function (origSubscribe) {\n return function (subscriber, bSticky) {\n function proxy() {\n if (!bSticky) db.on.ready.unsubscribe(proxy);\n return subscriber.apply(this, arguments);\n }\n origSubscribe.call(this, proxy);\n if (db.isOpen()) {\n if (db_is_blocked) {\n pausedResumeables.push({ resume: proxy });\n } else {\n proxy();\n }\n }\n };\n });\n\n fakeAutoComplete(function () {\n db.on(\"populate\").fire(db._createTransaction(READWRITE, dbStoreNames, globalSchema));\n db.on(\"error\").fire(new Error());\n });\n\n this.transaction = function (mode, tableInstances, scopeFunc) {\n /// \n ///\n /// \n /// \"r\" for readonly, or \"rw\" for readwrite\n /// Table instance, Array of Table instances, String or String Array of object stores to include in the transaction\n /// Function to execute with transaction\n\n // Let table arguments be all arguments between mode and last argument.\n tableInstances = slice(arguments, 1, arguments.length - 1);\n // Let scopeFunc be the last argument\n scopeFunc = arguments[arguments.length - 1];\n var parentTransaction = Promise.PSD && Promise.PSD.trans;\n // Check if parent transactions is bound to this db instance, and if caller wants to reuse it\n if (!parentTransaction || parentTransaction.db !== db || mode.indexOf('!') !== -1) parentTransaction = null;\n var onlyIfCompatible = mode.indexOf('?') !== -1;\n mode = mode.replace('!', '').replace('?', '');\n //\n // Get storeNames from arguments. Either through given table instances, or through given table names.\n //\n var tables = isArray(tableInstances[0]) ? tableInstances.reduce(function (a, b) {\n return a.concat(b);\n }) : tableInstances;\n var error = null;\n var storeNames = tables.map(function (tableInstance) {\n if (typeof tableInstance === \"string\") {\n return tableInstance;\n } else {\n if (!(tableInstance instanceof Table)) error = error || new TypeError(\"Invalid type. Arguments following mode must be instances of Table or String\");\n return tableInstance.name;\n }\n });\n\n //\n // Resolve mode. Allow shortcuts \"r\" and \"rw\".\n //\n if (mode == \"r\" || mode == READONLY) mode = READONLY;else if (mode == \"rw\" || mode == READWRITE) mode = READWRITE;else error = new exceptions.InvalidArgument(\"Invalid transaction mode: \" + mode);\n\n if (parentTransaction) {\n // Basic checks\n if (!error) {\n if (parentTransaction && parentTransaction.mode === READONLY && mode === READWRITE) {\n if (onlyIfCompatible) parentTransaction = null; // Spawn new transaction instead.\n else error = error || new exceptions.SubTransaction(\"Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY\");\n }\n if (parentTransaction) {\n storeNames.forEach(function (storeName) {\n if (!parentTransaction.tables.hasOwnProperty(storeName)) {\n if (onlyIfCompatible) parentTransaction = null; // Spawn new transaction instead.\n else error = error || new exceptions.SubTransaction(\"Table \" + storeName + \" not included in parent transaction. Parent Transaction function: \" + parentTransaction.scopeFunc.toString());\n }\n });\n }\n }\n }\n if (parentTransaction) {\n // If this is a sub-transaction, lock the parent and then launch the sub-transaction.\n return parentTransaction._promise(mode, enterTransactionScope, \"lock\");\n } else {\n // If this is a root-level transaction, wait til database is ready and then launch the transaction.\n return db._whenReady(enterTransactionScope);\n }\n\n function enterTransactionScope(resolve, reject) {\n // Our transaction. To be set later.\n var trans = null;\n var isConstructing = true;\n\n try {\n // Throw any error if any of the above checks failed.\n // Real error defined some lines up. We throw it here from within a Promise to reject Promise\n // rather than make caller need to both use try..catch and promise catching. The reason we still\n // throw here rather than do Promise.reject(error) is that we like to have the stack attached to the\n // error. Also because there is a catch() clause bound to this try() that will bubble the error\n // to the parent transaction.\n if (error) throw error;\n\n //\n // Create Transaction instance\n //\n trans = db._createTransaction(mode, storeNames, globalSchema, parentTransaction);\n\n // Provide arguments to the scope function (for backward compatibility)\n var tableArgs = storeNames.map(function (name) {\n return trans.tables[name];\n });\n tableArgs.push(trans);\n\n // If transaction completes, resolve the Promise with the return value of scopeFunc.\n var returnValue;\n var uncompletedRequests = 0;\n\n // Create a new PSD frame to hold Promise.PSD.trans. Must not be bound to the current PSD frame since we want\n // it to pop before then() callback is called of our returned Promise.\n Promise.newPSD(function () {\n // Let the transaction instance be part of a Promise-specific data (PSD) value.\n Promise.PSD.trans = trans;\n trans.scopeFunc = scopeFunc; // For Error (\"Table \" + storeNames[0] + \" not part of transaction\") when it happens. This may help localizing the code that started a transaction used on another place.\n\n if (parentTransaction) {\n // Emulate transaction commit awareness for inner transaction (must 'commit' when the inner transaction has no more operations ongoing)\n trans.idbtrans = parentTransaction.idbtrans;\n trans._promise = override(trans._promise, function (orig) {\n return function (mode, fn, writeLock) {\n ++uncompletedRequests;\n function proxy(fn2) {\n return function (val) {\n var retval;\n // _rootExec needed so that we do not loose any IDBTransaction in a setTimeout() call.\n Promise._rootExec(function () {\n retval = fn2(val);\n // _tickFinalize makes sure to support lazy micro tasks executed in Promise._rootExec().\n // We certainly do not want to copy the bad pattern from IndexedDB but instead allow\n // execution of Promise.then() callbacks until the're all done.\n Promise._tickFinalize(function () {\n if (--uncompletedRequests === 0 && trans.active) {\n trans.active = false;\n trans.on.complete.fire(); // A called db operation has completed without starting a new operation. The flow is finished\n }\n });\n });\n return retval;\n };\n }\n return orig.call(this, mode, function (resolve2, reject2, trans) {\n return fn(proxy(resolve2), proxy(reject2), trans);\n }, writeLock);\n };\n });\n }\n trans.complete(function () {\n resolve(returnValue);\n });\n // If transaction fails, reject the Promise and bubble to db if noone catched this rejection.\n trans.error(function (e) {\n if (trans.idbtrans) trans.idbtrans.onerror = preventDefault; // Prohibit AbortError from firing.\n try {\n trans.abort();\n } catch (e2) {}\n if (parentTransaction) {\n parentTransaction.active = false;\n parentTransaction.on.error.fire(e); // Bubble to parent transaction\n }\n\n if (isConstructing) asap(doReject);else doReject();\n function doReject() {\n var catched = reject(e);\n if (!parentTransaction && !catched) {\n db.on.error.fire(e); // If not catched, bubble error to db.on(\"error\").\n }\n }\n });\n\n // Finally, call the scope function with our table and transaction arguments.\n Promise._rootExec(function () {\n returnValue = scopeFunc.apply(trans, tableArgs); // NOTE: returnValue is used in trans.on.complete() not as a returnValue to this func.\n if (returnValue && typeof returnValue.next === 'function' && typeof returnValue.throw === 'function') {\n // scopeFunc returned an iterable. Handle yield as await.\n returnValue = awaitIterable(returnValue);\n }\n });\n });\n if (!trans.idbtrans || parentTransaction && uncompletedRequests === 0) {\n trans._nop(); // Make sure transaction is being used so that it will resolve.\n }\n } catch (e) {\n // If exception occur, abort the transaction and reject Promise.\n if (trans && trans.idbtrans) trans.idbtrans.onerror = preventDefault; // Prohibit AbortError from firing.\n if (trans) trans.abort();\n if (parentTransaction) parentTransaction.on.error.fire(e);\n asap(function () {\n // Need to use asap(=setImmediate/setTimeout) before calling reject because we are in the Promise constructor and reject() will always return false if so.\n if (!reject(e)) db.on(\"error\").fire(e); // If not catched, bubble exception to db.on(\"error\");\n });\n }\n isConstructing = false;\n }\n };\n\n this.table = function (tableName) {\n /// \n if (fake && autoSchema) return new WriteableTable(tableName);\n if (!allTables.hasOwnProperty(tableName)) {\n throw new exceptions.InvalidTable('Table ' + tableName + ' does not exist');\n }\n return allTables[tableName];\n };\n\n //\n //\n //\n // Table Class\n //\n //\n //\n function Table(name, transactionPromiseFactory, tableSchema, collClass) {\n /// \n this.name = name;\n this.schema = tableSchema;\n this.hook = allTables[name] ? allTables[name].hook : Events(null, {\n \"creating\": [hookCreatingChain, nop],\n \"reading\": [pureFunctionChain, mirror],\n \"updating\": [hookUpdatingChain, nop],\n \"deleting\": [hookDeletingChain, nop]\n });\n this._tpf = transactionPromiseFactory;\n this._collClass = collClass || Collection;\n }\n\n extend(Table.prototype, function () {\n function failReadonly() {\n // It's ok to throw here because this can only happen within a transaction,\n // and will always be caught by the transaction scope and returned as a\n // failed promise.\n throw new exceptions.ReadOnly(\"Current Transaction is READONLY\");\n }\n return {\n //\n // Table Protected Methods\n //\n\n _trans: function getTransaction(mode, fn, writeLocked) {\n return this._tpf(mode, [this.name], fn, writeLocked);\n },\n _idbstore: function getIDBObjectStore(mode, fn, writeLocked) {\n if (fake) return new Promise(fn); // Simplify the work for Intellisense/Code completion.\n var self = this;\n return this._tpf(mode, [this.name], function (resolve, reject, trans) {\n fn(resolve, reject, trans.idbtrans.objectStore(self.name), trans);\n }, writeLocked);\n },\n\n //\n // Table Public Methods\n //\n get: function (key, cb) {\n var self = this;\n return this._idbstore(READONLY, function (resolve, reject, idbstore) {\n fake && resolve(self.schema.instanceTemplate);\n var req = idbstore.get(key);\n req.onerror = eventRejectHandler(reject, [\"getting\", key, \"from\", self.name]);\n req.onsuccess = function () {\n resolve(self.hook.reading.fire(req.result));\n };\n }).then(cb);\n },\n where: function (indexName) {\n return new WhereClause(this, indexName);\n },\n count: function (cb) {\n return this.toCollection().count(cb);\n },\n offset: function (offset) {\n return this.toCollection().offset(offset);\n },\n limit: function (numRows) {\n return this.toCollection().limit(numRows);\n },\n reverse: function () {\n return this.toCollection().reverse();\n },\n filter: function (filterFunction) {\n return this.toCollection().and(filterFunction);\n },\n each: function (fn) {\n return this.toCollection().each(fn);\n },\n toArray: function (cb) {\n return this.toCollection().toArray(cb);\n },\n orderBy: function (index) {\n return new this._collClass(new WhereClause(this, index));\n },\n\n toCollection: function () {\n return new this._collClass(new WhereClause(this));\n },\n\n mapToClass: function (constructor, structure) {\n /// \n /// Map table to a javascript constructor function. Objects returned from the database will be instances of this class, making\n /// it possible to the instanceOf operator as well as extending the class using constructor.prototype.method = function(){...}.\n /// \n /// Constructor function representing the class.\n /// Helps IDE code completion by knowing the members that objects contain and not just the indexes. Also\n /// know what type each member has. Example: {name: String, emailAddresses: [String], password}\n this.schema.mappedClass = constructor;\n var instanceTemplate = Object.create(constructor.prototype);\n if (structure) {\n // structure and instanceTemplate is for IDE code competion only while constructor.prototype is for actual inheritance.\n applyStructure(instanceTemplate, structure);\n }\n this.schema.instanceTemplate = instanceTemplate;\n\n // Now, subscribe to the when(\"reading\") event to make all objects that come out from this table inherit from given class\n // no matter which method to use for reading (Table.get() or Table.where(...)... )\n var readHook = function (obj) {\n if (!obj) return obj; // No valid object. (Value is null). Return as is.\n // Create a new object that derives from constructor:\n var res = Object.create(constructor.prototype);\n // Clone members:\n for (var m in obj) {\n if (obj.hasOwnProperty(m)) res[m] = obj[m];\n }return res;\n };\n\n if (this.schema.readHook) {\n this.hook.reading.unsubscribe(this.schema.readHook);\n }\n this.schema.readHook = readHook;\n this.hook(\"reading\", readHook);\n return constructor;\n },\n defineClass: function (structure) {\n /// \n /// Define all members of the class that represents the table. This will help code completion of when objects are read from the database\n /// as well as making it possible to extend the prototype of the returned constructor function.\n /// \n /// Helps IDE code completion by knowing the members that objects contain and not just the indexes. Also\n /// know what type each member has. Example: {name: String, emailAddresses: [String], properties: {shoeSize: Number}}\n return this.mapToClass(Dexie.defineClass(structure), structure);\n },\n add: failReadonly,\n put: failReadonly,\n 'delete': failReadonly,\n clear: failReadonly,\n update: failReadonly\n };\n });\n\n //\n //\n //\n // WriteableTable Class (extends Table)\n //\n //\n //\n function WriteableTable(name, transactionPromiseFactory, tableSchema, collClass) {\n Table.call(this, name, transactionPromiseFactory, tableSchema, collClass || WriteableCollection);\n }\n\n function BulkErrorHandlerCatchAll(errorList, done) {\n var psd = Promise.PSD;\n return function (ev) {\n try {\n if (ev.stopPropagation) ev.stopPropagation();\n if (ev.preventDefault) ev.preventDefault();\n var err = ev.target.error;\n errorList.push(err);\n if (ev.target._err) {\n Promise.usePSD(psd, ev.target._err.bind(null, err));\n }\n } finally {\n if (done) done();\n }\n };\n }\n\n function BulkErrorHandler(done) {\n var psd = Promise.PSD;\n return function (ev) {\n var err = void 0;\n try {\n err = ev.target.error;\n if (ev.target._err) {\n Promise.usePSD(psd, ev.target._err.bind(null, err));\n }\n } finally {\n done(err);\n }\n };\n }\n\n function BulkSuccessHandler(done, hookListener) {\n var psd = Promise.PSD;\n return hookListener ? function (ev) {\n var res = void 0;\n try {\n res = ev.target.result;\n ev.target._suc && Promise.usePSD(psd, ev.target._suc.bind(null, res));\n } finally {\n if (done) done(res);\n }\n } : function (ev) {\n done(ev.target.result);\n };\n }\n\n function bulkDelete(idbstore, trans, keysOrTuples, hasDeleteHook, deletingHook) {\n // If hasDeleteHook, keysOrTuples must be an array of tuples: [[key1, value2],[key2,value2],...],\n // else keysOrTuples must be just an array of keys: [key1, key2, ...].\n return new Promise(function (resolve, reject) {\n var len = keysOrTuples.length,\n lastItem = len - 1;\n if (len === 0) return resolve();\n if (!hasDeleteHook) {\n for (var i = 0; i < len; ++i) {\n var req = idbstore.delete(keysOrTuples[i]);\n req.onerror = function (ev) {\n return reject(mapError(ev.target.error));\n };\n if (i === lastItem) req.onsuccess = function () {\n return resolve();\n };\n }\n } else {\n (function () {\n var hookCtx = { onsuccess: null, onerror: null },\n errorHandler = BulkErrorHandler(function (e) {\n return reject(mapError(e));\n }),\n successHandler = BulkSuccessHandler(null, true);\n miniTryCatch(function () {\n for (var i = 0; i < len; ++i) {\n var tuple = keysOrTuples[i];\n deletingHook.call(hookCtx, tuple[0], tuple[1], trans);\n var req = idbstore.delete(tuple[0]);\n if (hookCtx.onerror) req._err = hookCtx.onerror;\n if (hookCtx.onsuccess) req._suc = hookCtx.onsuccess;\n req.onerror = errorHandler;\n if (i === lastItem) req.onsuccess = BulkSuccessHandler(resolve, true);else req.onsuccess = successHandler;\n hookCtx.onsuccess = null;\n hookCtx.onerror = null;\n }\n }, function (err) {\n hookCtx.onerror && hookCtx.onerror(err);\n throw err;\n });\n })();\n }\n });\n }\n\n derive(WriteableTable).from(Table).extend(function () {\n\n return {\n bulkDelete: function (keys) {\n if (this.hook.deleting.fire === nop) {\n return this._idbstore(READWRITE, function (resolve, reject, idbstore, trans) {\n resolve(bulkDelete(idbstore, trans, keys, false, nop));\n });\n } else {\n return this.where(':id').anyOf(keys).delete().then(function () {}); // Resolve with undefined.\n }\n },\n bulkPut: function (objects, keys) {\n var _this = this;\n\n return this._idbstore(READWRITE, function (resolve, reject, idbstore, trans) {\n if (!idbstore.keyPath && !_this.schema.primKey.auto && !keys) throw new exceptions.InvalidArgument(\"bulkPut() with non-inbound keys requires keys array in second argument\");\n if (idbstore.keyPath && keys) throw new exceptions.InvalidArgument(\"bulkPut(): keys argument invalid on tables with inbound keys\");\n if (keys && keys.length !== objects.length) throw new exceptions.InvalidArgument(\"Arguments objects and keys must have the same length\");\n if (objects.length === 0) return resolve(); // Caller provided empty list.\n var done = function (result) {\n if (errorList.length === 0) resolve(result);else reject(new BulkError(_this.name + '.bulkPut(): ' + errorList.length + ' of ' + numObjs + ' operations failed', errorList));\n };\n var req,\n errorList = [],\n errorHandler,\n successHandler,\n numObjs = objects.length,\n table = trans.tables[_this.name]; // Enable us to do stuff in several steps with same transaction.\n if (_this.hook.creating.fire === nop && _this.hook.updating.fire === nop) {\n //\n // Standard Bulk (no 'creating' or 'updating' hooks to care about)\n //\n errorHandler = BulkErrorHandlerCatchAll(errorList);\n for (var i = 0, l = objects.length; i < l; ++i) {\n req = keys ? idbstore.put(objects[i], keys[i]) : idbstore.put(objects[i]);\n req.onerror = errorHandler;\n }\n // Only need to catch success or error on the last operation\n // according to the IDB spec.\n req.onerror = BulkErrorHandlerCatchAll(errorList, done);\n req.onsuccess = BulkSuccessHandler(done);\n } else {\n (function () {\n var effectiveKeys = keys || idbstore.keyPath && objects.map(function (o) {\n return getByKeyPath(o, idbstore.keyPath);\n });\n var objectLookup = effectiveKeys && effectiveKeys.reduce(function (res, key, i) {\n if (key != null) res[key] = objects[i];\n return res;\n }, {}); // Generates map of {[key]: object}\n\n var promise = !effectiveKeys ?\n\n // Auto-incremented key-less objects only without any keys argument.\n table.bulkAdd(objects) :\n\n // Keys provided. Either as inbound in provided objects, or as a keys argument.\n // Begin with updating those that exists in DB:\n table.where(':id').anyOf(Object.keys(objectLookup)).modify(function () {\n this.value = objectLookup[this.primKey];\n objectLookup[this.primKey] = null; // Mark as \"don't add this\"\n }).then(function () {\n // Now, let's examine which items didnt exist so we can add them:\n var objsToAdd = [],\n keysToAdd = keys && [];\n effectiveKeys.forEach(function (key, i) {\n if (key == null || objectLookup[key]) {\n objsToAdd.push(objects[i]);\n keys && keysToAdd.push(key);\n }\n });\n return table.bulkAdd(objsToAdd, keysToAdd);\n }).then(function (lastAddedKey) {\n // Resolve with key of the last object in given arguments to bulkPut():\n var lastEffectiveKey = effectiveKeys[effectiveKeys.length - 1]; // Key was provided.\n return lastEffectiveKey != null ? lastEffectiveKey : lastAddedKey;\n });\n\n promise.then(resolve).catch(ModifyError, function (e) {\n // Map ModifyError to BulkError\n reject(new BulkError(e.msg, e.failures));\n }).catch(reject);\n })();\n }\n }, \"locked\"); // If called from transaction scope, lock transaction til all steps are done.\n },\n bulkAdd: function (objects, keys) {\n var self = this,\n creatingHook = this.hook.creating.fire;\n return this._idbstore(READWRITE, function (resolve, reject, idbstore, trans) {\n if (!idbstore.keyPath && !self.schema.primKey.auto && !keys) throw new exceptions.InvalidArgument(\"bulkAdd() with non-inbound keys requires keys array in second argument\");\n if (idbstore.keyPath && keys) throw new exceptions.InvalidArgument(\"bulkAdd(): keys argument invalid on tables with inbound keys\");\n if (keys && keys.length !== objects.length) throw new exceptions.InvalidArgument(\"Arguments objects and keys must have the same length\");\n if (objects.length === 0) return resolve(); // Caller provided empty list.\n function done(result) {\n if (errorList.length === 0) resolve(result);else reject(new BulkError(self.name + '.bulkAdd(): ' + errorList.length + ' of ' + numObjs + ' operations failed', errorList));\n }\n var req,\n errorList = [],\n errorHandler,\n successHandler,\n numObjs = objects.length;\n if (creatingHook !== nop) {\n //\n // There are subscribers to hook('creating')\n // Must behave as documented.\n //\n var keyPath = idbstore.keyPath,\n hookCtx = { onerror: null, onsuccess: null };\n errorHandler = BulkErrorHandlerCatchAll(errorList, null);\n successHandler = BulkSuccessHandler(null, true);\n\n miniTryCatch(function () {\n for (var i = 0, l = objects.length; i < l; ++i) {\n var key = keys && keys[i];\n var obj = objects[i],\n effectiveKey = keys ? key : keyPath ? getByKeyPath(obj, keyPath) : undefined,\n keyToUse = creatingHook.call(hookCtx, effectiveKey, obj, trans);\n if (effectiveKey == null && keyToUse != null) {\n if (keyPath) {\n obj = deepClone(obj);\n setByKeyPath(obj, keyPath, keyToUse);\n } else {\n key = keyToUse;\n }\n }\n req = key != null ? idbstore.add(obj, key) : idbstore.add(obj);\n if (hookCtx.onerror) req._err = hookCtx.onerror;\n if (hookCtx.onsuccess) req._suc = hookCtx.onsuccess;\n if (i < l - 1) {\n req.onerror = errorHandler;\n if (hookCtx.onsuccess) req.onsuccess = successHandler;\n // Reset event listeners for next iteration.\n hookCtx.onerror = null;\n hookCtx.onsuccess = null;\n }\n }\n }, function (err) {\n hookCtx.onerror && hookCtx.onerror(err);\n throw err;\n });\n\n req.onerror = BulkErrorHandlerCatchAll(errorList, done);\n req.onsuccess = BulkSuccessHandler(done, true);\n } else {\n //\n // Standard Bulk (no 'creating' hook to care about)\n //\n errorHandler = BulkErrorHandlerCatchAll(errorList);\n for (var i = 0, l = objects.length; i < l; ++i) {\n req = keys ? idbstore.add(objects[i], keys[i]) : idbstore.add(objects[i]);\n req.onerror = errorHandler;\n }\n // Only need to catch success or error on the last operation\n // according to the IDB spec.\n req.onerror = BulkErrorHandlerCatchAll(errorList, done);\n req.onsuccess = BulkSuccessHandler(done);\n }\n });\n },\n add: function (obj, key) {\n /// \n /// Add an object to the database. In case an object with same primary key already exists, the object will not be added.\n /// \n /// A javascript object to insert\n /// Primary key\n var self = this,\n creatingHook = this.hook.creating.fire;\n return this._idbstore(READWRITE, function (resolve, reject, idbstore, trans) {\n var thisCtx = { onsuccess: null, onerror: null };\n if (creatingHook !== nop) {\n var effectiveKey = key != null ? key : idbstore.keyPath ? getByKeyPath(obj, idbstore.keyPath) : undefined;\n var keyToUse = creatingHook.call(thisCtx, effectiveKey, obj, trans); // Allow subscribers to when(\"creating\") to generate the key.\n if (effectiveKey == null && keyToUse != null) {\n // Using \"==\" and \"!=\" to check for either null or undefined!\n if (idbstore.keyPath) setByKeyPath(obj, idbstore.keyPath, keyToUse);else key = keyToUse;\n }\n }\n try {\n var req = key != null ? idbstore.add(obj, key) : idbstore.add(obj),\n psd = Promise.PSD;\n req.onerror = eventRejectHandler(function (e) {\n if (thisCtx.onerror) Promise.usePSD(psd, thisCtx.onerror.bind(thisCtx, e));\n return reject(e);\n }, [\"adding\", obj, \"into\", self.name]);\n req.onsuccess = function (ev) {\n var keyPath = idbstore.keyPath;\n if (keyPath) setByKeyPath(obj, keyPath, ev.target.result);\n if (thisCtx.onsuccess) Promise.usePSD(psd, thisCtx.onsuccess.bind(thisCtx, ev.target.result));\n resolve(req.result);\n };\n } catch (e) {\n if (thisCtx.onerror) thisCtx.onerror(e);\n throw e;\n }\n });\n },\n\n put: function (obj, key) {\n /// \n /// Add an object to the database but in case an object with same primary key alread exists, the existing one will get updated.\n /// \n /// A javascript object to insert or update\n /// Primary key\n var self = this,\n creatingHook = this.hook.creating.fire,\n updatingHook = this.hook.updating.fire;\n if (creatingHook !== nop || updatingHook !== nop) {\n //\n // People listens to when(\"creating\") or when(\"updating\") events!\n // We must know whether the put operation results in an CREATE or UPDATE.\n //\n return this._trans(READWRITE, function (resolve, reject, trans) {\n // Since key is optional, make sure we get it from obj if not provided\n var effectiveKey = key !== undefined ? key : self.schema.primKey.keyPath && getByKeyPath(obj, self.schema.primKey.keyPath);\n if (effectiveKey == null) {\n // \"== null\" means checking for either null or undefined.\n // No primary key. Must use add().\n trans.tables[self.name].add(obj).then(resolve, reject);\n } else {\n // Primary key exist. Lock transaction and try modifying existing. If nothing modified, call add().\n trans._lock(); // Needed because operation is splitted into modify() and add().\n // clone obj before this async call. If caller modifies obj the line after put(), the IDB spec requires that it should not affect operation.\n obj = deepClone(obj);\n trans.tables[self.name].where(\":id\").equals(effectiveKey).modify(function (value) {\n // Replace extisting value with our object\n // CRUD event firing handled in WriteableCollection.modify()\n this.value = obj;\n }).then(function (count) {\n if (count === 0) {\n // Object's key was not found. Add the object instead.\n // CRUD event firing will be done in add()\n return trans.tables[self.name].add(obj, key); // Resolving with another Promise. Returned Promise will then resolve with the new key.\n } else {\n return effectiveKey; // Resolve with the provided key.\n }\n }).finally(function () {\n trans._unlock();\n }).then(resolve, reject);\n }\n });\n } else {\n // Use the standard IDB put() method.\n return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\n var req = key !== undefined ? idbstore.put(obj, key) : idbstore.put(obj);\n req.onerror = eventRejectHandler(reject, [\"putting\", obj, \"into\", self.name]);\n req.onsuccess = function (ev) {\n var keyPath = idbstore.keyPath;\n if (keyPath) setByKeyPath(obj, keyPath, ev.target.result);\n resolve(req.result);\n };\n });\n }\n },\n\n 'delete': function (key) {\n /// Primary key of the object to delete\n if (this.hook.deleting.subscribers.length) {\n // People listens to when(\"deleting\") event. Must implement delete using WriteableCollection.delete() that will\n // call the CRUD event. Only WriteableCollection.delete() will know whether an object was actually deleted.\n return this.where(\":id\").equals(key).delete();\n } else {\n // No one listens. Use standard IDB delete() method.\n return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\n var req = idbstore.delete(key);\n req.onerror = eventRejectHandler(reject, [\"deleting\", key, \"from\", idbstore.name]);\n req.onsuccess = function (ev) {\n resolve(req.result);\n };\n });\n }\n },\n\n clear: function () {\n if (this.hook.deleting.subscribers.length) {\n // People listens to when(\"deleting\") event. Must implement delete using WriteableCollection.delete() that will\n // call the CRUD event. Only WriteableCollection.delete() will knows which objects that are actually deleted.\n return this.toCollection().delete();\n } else {\n return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\n var req = idbstore.clear();\n req.onerror = eventRejectHandler(reject, [\"clearing\", idbstore.name]);\n req.onsuccess = function (ev) {\n resolve(req.result);\n };\n });\n }\n },\n\n update: function (keyOrObject, modifications) {\n if (typeof modifications !== 'object' || isArray(modifications)) throw new exceptions.InvalidArgument(\"db.update(keyOrObject, modifications). modifications must be an object.\");\n if (typeof keyOrObject === 'object' && !isArray(keyOrObject)) {\n // object to modify. Also modify given object with the modifications:\n keys(modifications).forEach(function (keyPath) {\n setByKeyPath(keyOrObject, keyPath, modifications[keyPath]);\n });\n var key = getByKeyPath(keyOrObject, this.schema.primKey.keyPath);\n if (key === undefined) Promise.reject(new exceptions.InvalidArgument(\"Given object does not contain its primary key\"));\n return this.where(\":id\").equals(key).modify(modifications);\n } else {\n // key to modify\n return this.where(\":id\").equals(keyOrObject).modify(modifications);\n }\n }\n };\n });\n\n //\n //\n //\n // Transaction Class\n //\n //\n //\n function Transaction(mode, storeNames, dbschema, parent) {\n /// \n /// Transaction class. Represents a database transaction. All operations on db goes through a Transaction.\n /// \n /// Any of \"readwrite\" or \"readonly\"\n /// Array of table names to operate on\n var self = this;\n this.db = db;\n this.mode = mode;\n this.storeNames = storeNames;\n this.idbtrans = null;\n this.on = Events(this, [\"complete\", \"error\"], \"abort\");\n this._reculock = 0;\n this._blockedFuncs = [];\n this._psd = null;\n this.active = true;\n this._dbschema = dbschema;\n if (parent) this.parent = parent;\n this._tpf = transactionPromiseFactory;\n this.tables = Object.create(notInTransFallbackTables); // ...so that all non-included tables exists as instances (possible to call table.name for example) but will fail as soon as trying to execute a query on it.\n\n function transactionPromiseFactory(mode, storeNames, fn, writeLocked) {\n // Creates a Promise instance and calls fn (resolve, reject, trans) where trans is the instance of this transaction object.\n // Support for write-locking the transaction during the promise life time from creation to success/failure.\n // This is actually not needed when just using single operations on IDB, since IDB implements this internally.\n // However, when implementing a write operation as a series of operations on top of IDB(collection.delete() and collection.modify() for example),\n // lock is indeed needed if Dexie APIshould behave in a consistent manner for the API user.\n // Another example of this is if we want to support create/update/delete events,\n // we need to implement put() using a series of other IDB operations but still need to lock the transaction all the way.\n return self._promise(mode, fn, writeLocked);\n }\n\n for (var i = storeNames.length - 1; i !== -1; --i) {\n var name = storeNames[i];\n var table = db._tableFactory(mode, dbschema[name], transactionPromiseFactory);\n this.tables[name] = table;\n if (!this[name]) this[name] = table;\n }\n }\n\n extend(Transaction.prototype, {\n //\n // Transaction Protected Methods (not required by API users, but needed internally and eventually by dexie extensions)\n //\n\n _lock: function () {\n // Temporary set all requests into a pending queue if they are called before database is ready.\n ++this._reculock; // Recursive read/write lock pattern using PSD (Promise Specific Data) instead of TLS (Thread Local Storage)\n if (this._reculock === 1 && Promise.PSD) Promise.PSD.lockOwnerFor = this;\n return this;\n },\n _unlock: function () {\n if (--this._reculock === 0) {\n if (Promise.PSD) Promise.PSD.lockOwnerFor = null;\n while (this._blockedFuncs.length > 0 && !this._locked()) {\n var fn = this._blockedFuncs.shift();\n try {\n fn();\n } catch (e) {}\n }\n }\n return this;\n },\n _locked: function () {\n // Checks if any write-lock is applied on this transaction.\n // To simplify the Dexie API for extension implementations, we support recursive locks.\n // This is accomplished by using \"Promise Specific Data\" (PSD).\n // PSD data is bound to a Promise and any child Promise emitted through then() or resolve( new Promise() ).\n // Promise.PSD is local to code executing on top of the call stacks of any of any code executed by Promise():\n // * callback given to the Promise() constructor (function (resolve, reject){...})\n // * callbacks given to then()/catch()/finally() methods (function (value){...})\n // If creating a new independant Promise instance from within a Promise call stack, the new Promise will derive the PSD from the call stack of the parent Promise.\n // Derivation is done so that the inner PSD __proto__ points to the outer PSD.\n // Promise.PSD.lockOwnerFor will point to current transaction object if the currently executing PSD scope owns the lock.\n return this._reculock && (!Promise.PSD || Promise.PSD.lockOwnerFor !== this);\n },\n _nop: function (cb) {\n // An asyncronic no-operation that may call given callback when done doing nothing. An alternative to asap() if we must not lose the transaction.\n this.tables[this.storeNames[0]].get(0).then(cb);\n },\n _promise: function (mode, fn, bWriteLock) {\n var self = this;\n return Promise.newPSD(function () {\n var p;\n // Read lock always\n if (!self._locked()) {\n p = self.active ? new Promise(function (resolve, reject) {\n if (!self.idbtrans && mode) {\n if (!idbdb) throw !dbOpenError || [\"DatabaseClosedError\", \"MissingAPIError\"].indexOf(dbOpenError.name) >= 0 ? dbOpenError : // Errors where it is no difference whether it was caused by the user operation or an earlier call to db.open()\n new exceptions.OpenFailed(dbOpenError); // Make it clear that the user operation was not what caused the error - the error had occurred earlier on db.open()!\n\n var idbtrans = self.idbtrans = idbdb.transaction(safariMultiStoreFix(self.storeNames), self.mode);\n idbtrans.onerror = function (e) {\n self.on(\"error\").fire(e && e.target.error);\n e.preventDefault(); // Prohibit default bubbling to window.error\n self.abort(); // Make sure transaction is aborted since we preventDefault.\n };\n idbtrans.onabort = function (e) {\n // Workaround for issue #78 - low disk space on chrome.\n // onabort is called but never onerror. Call onerror explicitely.\n // Do this in a future tick so we allow default onerror to execute before doing the fallback.\n asap(function () {\n self.on('error').fire(new exceptions.Abort(\"Transaction aborted for unknown reason\"));\n });\n\n self.active = false;\n self.on(\"abort\").fire(e);\n };\n idbtrans.oncomplete = function (e) {\n self.active = false;\n self.on(\"complete\").fire(e);\n };\n }\n if (bWriteLock) self._lock(); // Write lock if write operation is requested\n try {\n fn(resolve, reject, self);\n } catch (e) {\n (function () {\n // Direct exception happened when doing operation.\n // We must immediately fire the error and abort the transaction.\n // When this happens we are still constructing the Promise so we don't yet know\n // whether the caller is about to catch() the error or not. Have to make\n // transaction fail. Catching such an error wont stop transaction from failing.\n // This is a limitation we have to live with.\n var e2 = stack(mapError(e));\n Dexie.ignoreTransaction(function () {\n self.on('error').fire(e2);\n });\n self.abort();\n reject(e2);\n })();\n }\n }) : Promise.reject(stack(new exceptions.TransactionInactive(\"Transaction is inactive. Original Scope Function Source: \" + self.scopeFunc.toString())));\n if (self.active && bWriteLock) p.finally(function () {\n self._unlock();\n });\n } else {\n // Transaction is write-locked. Wait for mutex.\n p = new Promise(function (resolve, reject) {\n self._blockedFuncs.push(function () {\n self._promise(mode, fn, bWriteLock).then(resolve, reject);\n });\n });\n }\n p.onuncatched = function (e) {\n // Bubble to transaction. Even though IDB does this internally, it would just do it for error events and not for caught exceptions.\n Dexie.ignoreTransaction(function () {\n self.on(\"error\").fire(e);\n });\n self.abort();\n };\n return p;\n });\n },\n\n //\n // Transaction Public Methods\n //\n\n complete: function (cb) {\n return this.on(\"complete\", cb);\n },\n error: function (cb) {\n return this.on(\"error\", cb);\n },\n abort: function () {\n if (this.idbtrans && this.active) try {\n // TODO: if !this.idbtrans, enqueue an abort() operation.\n this.active = false;\n this.idbtrans.abort();\n this.on.error.fire(new exceptions.Abort(\"Transaction Aborted\"));\n } catch (e) {}\n },\n table: function (name) {\n if (!this.tables.hasOwnProperty(name)) {\n throw new exceptions.InvalidTable(\"Table \" + name + \" not in transaction\");\n }\n return this.tables[name];\n }\n });\n\n //\n //\n //\n // WhereClause\n //\n //\n //\n function WhereClause(table, index, orCollection) {\n /// \n /// \n /// \n this._ctx = {\n table: table,\n index: index === \":id\" ? null : index,\n collClass: table._collClass,\n or: orCollection\n };\n }\n\n extend(WhereClause.prototype, function () {\n\n // WhereClause private methods\n\n function fail(c, err, T) {\n var collection = c instanceof WhereClause ? new c._ctx.collClass(c) : c;\n try {\n throw T ? new T(err) : new TypeError(err);\n } catch (e) {\n collection._ctx.error = e;\n }\n return collection;\n }\n\n function emptyCollection(whereClause) {\n return new whereClause._ctx.collClass(whereClause, function () {\n return IDBKeyRange.only(\"\");\n }).limit(0);\n }\n\n function getSetArgs(args) {\n return slice(args.length === 1 && isArray(args[0]) ? args[0] : args);\n }\n\n function upperFactory(dir) {\n return dir === \"next\" ? function (s) {\n return s.toUpperCase();\n } : function (s) {\n return s.toLowerCase();\n };\n }\n function lowerFactory(dir) {\n return dir === \"next\" ? function (s) {\n return s.toLowerCase();\n } : function (s) {\n return s.toUpperCase();\n };\n }\n function nextCasing(key, lowerKey, upperNeedle, lowerNeedle, cmp, dir) {\n var length = Math.min(key.length, lowerNeedle.length);\n var llp = -1;\n for (var i = 0; i < length; ++i) {\n var lwrKeyChar = lowerKey[i];\n if (lwrKeyChar !== lowerNeedle[i]) {\n if (cmp(key[i], upperNeedle[i]) < 0) return key.substr(0, i) + upperNeedle[i] + upperNeedle.substr(i + 1);\n if (cmp(key[i], lowerNeedle[i]) < 0) return key.substr(0, i) + lowerNeedle[i] + upperNeedle.substr(i + 1);\n if (llp >= 0) return key.substr(0, llp) + lowerKey[llp] + upperNeedle.substr(llp + 1);\n return null;\n }\n if (cmp(key[i], lwrKeyChar) < 0) llp = i;\n }\n if (length < lowerNeedle.length && dir === \"next\") return key + upperNeedle.substr(key.length);\n if (length < key.length && dir === \"prev\") return key.substr(0, upperNeedle.length);\n return llp < 0 ? null : key.substr(0, llp) + lowerNeedle[llp] + upperNeedle.substr(llp + 1);\n }\n\n function addIgnoreCaseAlgorithm(whereClause, match, needles, suffix) {\n /// \n var upper,\n lower,\n compare,\n upperNeedles,\n lowerNeedles,\n direction,\n nextKeySuffix,\n needlesLen = needles.length;\n function initDirection(dir) {\n upper = upperFactory(dir);\n lower = lowerFactory(dir);\n compare = dir === \"next\" ? simpleCompare : simpleCompareReverse;\n var needleBounds = needles.map(function (needle) {\n return { lower: lower(needle), upper: upper(needle) };\n }).sort(function (a, b) {\n return compare(a.lower, b.lower);\n });\n upperNeedles = needleBounds.map(function (nb) {\n return nb.upper;\n });\n lowerNeedles = needleBounds.map(function (nb) {\n return nb.lower;\n });\n direction = dir;\n nextKeySuffix = dir === \"next\" ? \"\" : suffix;\n }\n initDirection(\"next\");\n\n var c = new whereClause._ctx.collClass(whereClause, function () {\n return IDBKeyRange.bound(upperNeedles[0], lowerNeedles[needlesLen - 1] + suffix);\n });\n\n c._ondirectionchange = function (direction) {\n // This event onlys occur before filter is called the first time.\n initDirection(direction);\n };\n\n var firstPossibleNeedle = 0;\n\n c._addAlgorithm(function (cursor, advance, resolve) {\n /// \n /// \n /// \n var key = cursor.key;\n if (typeof key !== 'string') return false;\n var lowerKey = lower(key);\n if (match(lowerKey, lowerNeedles, firstPossibleNeedle)) {\n return true;\n } else {\n var lowestPossibleCasing = null;\n for (var i = firstPossibleNeedle; i < needlesLen; ++i) {\n var casing = nextCasing(key, lowerKey, upperNeedles[i], lowerNeedles[i], compare, direction);\n if (casing === null && lowestPossibleCasing === null) firstPossibleNeedle = i + 1;else if (lowestPossibleCasing === null || compare(lowestPossibleCasing, casing) > 0) {\n lowestPossibleCasing = casing;\n }\n }\n if (lowestPossibleCasing !== null) {\n advance(function () {\n cursor.continue(lowestPossibleCasing + nextKeySuffix);\n });\n } else {\n advance(resolve);\n }\n return false;\n }\n });\n return c;\n }\n\n //\n // WhereClause public methods\n //\n return {\n between: function (lower, upper, includeLower, includeUpper) {\n /// \n /// Filter out records whose where-field lays between given lower and upper values. Applies to Strings, Numbers and Dates.\n /// \n /// \n /// \n /// Whether items that equals lower should be included. Default true.\n /// Whether items that equals upper should be included. Default false.\n /// \n includeLower = includeLower !== false; // Default to true\n includeUpper = includeUpper === true; // Default to false\n try {\n if (cmp(lower, upper) > 0 || cmp(lower, upper) === 0 && (includeLower || includeUpper) && !(includeLower && includeUpper)) return emptyCollection(this); // Workaround for idiotic W3C Specification that DataError must be thrown if lower > upper. The natural result would be to return an empty collection.\n return new this._ctx.collClass(this, function () {\n return IDBKeyRange.bound(lower, upper, !includeLower, !includeUpper);\n });\n } catch (e) {\n return fail(this, INVALID_KEY_ARGUMENT);\n }\n },\n equals: function (value) {\n return new this._ctx.collClass(this, function () {\n return IDBKeyRange.only(value);\n });\n },\n above: function (value) {\n return new this._ctx.collClass(this, function () {\n return IDBKeyRange.lowerBound(value, true);\n });\n },\n aboveOrEqual: function (value) {\n return new this._ctx.collClass(this, function () {\n return IDBKeyRange.lowerBound(value);\n });\n },\n below: function (value) {\n return new this._ctx.collClass(this, function () {\n return IDBKeyRange.upperBound(value, true);\n });\n },\n belowOrEqual: function (value) {\n return new this._ctx.collClass(this, function () {\n return IDBKeyRange.upperBound(value);\n });\n },\n startsWith: function (str) {\n /// \n if (typeof str !== 'string') return fail(this, STRING_EXPECTED);\n return this.between(str, str + maxString, true, true);\n },\n startsWithIgnoreCase: function (str) {\n /// \n if (typeof str !== 'string') return fail(this, STRING_EXPECTED);\n if (str === \"\") return this.startsWith(str);\n return addIgnoreCaseAlgorithm(this, function (x, a) {\n return x.indexOf(a[0]) === 0;\n }, [str], maxString);\n },\n equalsIgnoreCase: function (str) {\n /// \n if (typeof str !== 'string') return fail(this, STRING_EXPECTED);\n return addIgnoreCaseAlgorithm(this, function (x, a) {\n return x === a[0];\n }, [str], \"\");\n },\n anyOfIgnoreCase: function (stringsToFind) {\n var set = getSetArgs(arguments);\n if (set.length === 0) return emptyCollection(this);\n if (!set.every(function (s) {\n return typeof s === 'string';\n })) {\n return fail(this, \"anyOfIgnoreCase() only works with strings\");\n }\n return addIgnoreCaseAlgorithm(this, function (x, a) {\n return a.indexOf(x) !== -1;\n }, set, \"\");\n },\n startsWithAnyOfIgnoreCase: function (stringsToFind) {\n var set = getSetArgs(arguments);\n if (set.length === 0) return emptyCollection(this);\n if (!set.every(function (s) {\n return typeof s === 'string';\n })) {\n return fail(this, \"startsWithAnyOfIgnoreCase() only works with strings\");\n }\n return addIgnoreCaseAlgorithm(this, function (x, a) {\n return a.some(function (n) {\n return x.indexOf(n) === 0;\n });\n }, set, maxString);\n },\n anyOf: function (valueArray) {\n var set = getSetArgs(arguments);\n var compare = ascending;\n try {\n set.sort(compare);\n } catch (e) {\n return fail(this, INVALID_KEY_ARGUMENT);\n }\n if (set.length === 0) return emptyCollection(this);\n var c = new this._ctx.collClass(this, function () {\n return IDBKeyRange.bound(set[0], set[set.length - 1]);\n });\n\n c._ondirectionchange = function (direction) {\n compare = direction === \"next\" ? ascending : descending;\n set.sort(compare);\n };\n var i = 0;\n c._addAlgorithm(function (cursor, advance, resolve) {\n var key = cursor.key;\n while (compare(key, set[i]) > 0) {\n // The cursor has passed beyond this key. Check next.\n ++i;\n if (i === set.length) {\n // There is no next. Stop searching.\n advance(resolve);\n return false;\n }\n }\n if (compare(key, set[i]) === 0) {\n // The current cursor value should be included and we should continue a single step in case next item has the same key or possibly our next key in set.\n return true;\n } else {\n // cursor.key not yet at set[i]. Forward cursor to the next key to hunt for.\n advance(function () {\n cursor.continue(set[i]);\n });\n return false;\n }\n });\n return c;\n },\n\n notEqual: function (value) {\n return this.inAnyRange([[-Infinity, value], [value, maxKey]], { includeLowers: false, includeUppers: false });\n },\n\n noneOf: function (valueArray) {\n var set = getSetArgs(arguments);\n if (set.length === 0) return new this._ctx.collClass(this); // Return entire collection.\n try {\n set.sort(ascending);\n } catch (e) {\n return fail(this, INVALID_KEY_ARGUMENT);\n }\n // Transform [\"a\",\"b\",\"c\"] to a set of ranges for between/above/below: [[-Infinity,\"a\"], [\"a\",\"b\"], [\"b\",\"c\"], [\"c\",maxKey]]\n var ranges = set.reduce(function (res, val) {\n return res ? res.concat([[res[res.length - 1][1], val]]) : [[-Infinity, val]];\n }, null);\n ranges.push([set[set.length - 1], maxKey]);\n return this.inAnyRange(ranges, { includeLowers: false, includeUppers: false });\n },\n\n /** Filter out values withing given set of ranges.\r\n * Example, give children and elders a rebate of 50%:\r\n *\r\n * db.friends.where('age').inAnyRange([[0,18],[65,Infinity]]).modify({Rebate: 1/2});\r\n *\r\n * @param {(string|number|Date|Array)[][]} ranges\r\n * @param {{includeLowers: boolean, includeUppers: boolean}} options\r\n */\n inAnyRange: function (ranges, options) {\n var ctx = this._ctx;\n if (ranges.length === 0) return emptyCollection(this);\n if (!ranges.every(function (range) {\n return range[0] !== undefined && range[1] !== undefined && ascending(range[0], range[1]) <= 0;\n })) {\n return fail(this, \"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower\", exceptions.InvalidArgument);\n }\n var includeLowers = !options || options.includeLowers !== false; // Default to true\n var includeUppers = options && options.includeUppers === true; // Default to false\n\n function addRange(ranges, newRange) {\n for (var i = 0, l = ranges.length; i < l; ++i) {\n var range = ranges[i];\n if (cmp(newRange[0], range[1]) < 0 && cmp(newRange[1], range[0]) > 0) {\n range[0] = min(range[0], newRange[0]);\n range[1] = max(range[1], newRange[1]);\n break;\n }\n }\n if (i === l) ranges.push(newRange);\n return ranges;\n }\n\n var sortDirection = ascending;\n function rangeSorter(a, b) {\n return sortDirection(a[0], b[0]);\n }\n\n // Join overlapping ranges\n var set;\n try {\n set = ranges.reduce(addRange, []);\n set.sort(rangeSorter);\n } catch (ex) {\n return fail(this, INVALID_KEY_ARGUMENT);\n }\n\n var i = 0;\n var keyIsBeyondCurrentEntry = includeUppers ? function (key) {\n return ascending(key, set[i][1]) > 0;\n } : function (key) {\n return ascending(key, set[i][1]) >= 0;\n };\n\n var keyIsBeforeCurrentEntry = includeLowers ? function (key) {\n return descending(key, set[i][0]) > 0;\n } : function (key) {\n return descending(key, set[i][0]) >= 0;\n };\n\n function keyWithinCurrentRange(key) {\n return !keyIsBeyondCurrentEntry(key) && !keyIsBeforeCurrentEntry(key);\n }\n\n var checkKey = keyIsBeyondCurrentEntry;\n\n var c = new ctx.collClass(this, function () {\n return IDBKeyRange.bound(set[0][0], set[set.length - 1][1], !includeLowers, !includeUppers);\n });\n\n c._ondirectionchange = function (direction) {\n if (direction === \"next\") {\n checkKey = keyIsBeyondCurrentEntry;\n sortDirection = ascending;\n } else {\n checkKey = keyIsBeforeCurrentEntry;\n sortDirection = descending;\n }\n set.sort(rangeSorter);\n };\n\n c._addAlgorithm(function (cursor, advance, resolve) {\n var key = cursor.key;\n while (checkKey(key)) {\n // The cursor has passed beyond this key. Check next.\n ++i;\n if (i === set.length) {\n // There is no next. Stop searching.\n advance(resolve);\n return false;\n }\n }\n if (keyWithinCurrentRange(key)) {\n // The current cursor value should be included and we should continue a single step in case next item has the same key or possibly our next key in set.\n return true;\n } else if (cmp(key, set[i][1]) === 0 || cmp(key, set[i][0]) === 0) {\n // includeUpper or includeLower is false so keyWithinCurrentRange() returns false even though we are at range border.\n // Continue to next key but don't include this one.\n return false;\n } else {\n // cursor.key not yet at set[i]. Forward cursor to the next key to hunt for.\n advance(function () {\n if (sortDirection === ascending) cursor.continue(set[i][0]);else cursor.continue(set[i][1]);\n });\n return false;\n }\n });\n return c;\n },\n startsWithAnyOf: function (valueArray) {\n var set = getSetArgs(arguments);\n\n if (!set.every(function (s) {\n return typeof s === 'string';\n })) {\n return fail(this, \"startsWithAnyOf() only works with strings\");\n }\n if (set.length === 0) return emptyCollection(this);\n\n return this.inAnyRange(set.map(function (str) {\n return [str, str + maxString];\n }));\n }\n };\n });\n\n //\n //\n //\n // Collection Class\n //\n //\n //\n function Collection(whereClause, keyRangeGenerator) {\n /// \n ///\n /// \n /// Where clause instance\n /// \n var keyRange = null,\n error = null;\n if (keyRangeGenerator) try {\n keyRange = keyRangeGenerator();\n } catch (ex) {\n error = stack(mapError(ex));\n }\n\n var whereCtx = whereClause._ctx,\n table = whereCtx.table;\n this._ctx = {\n table: table,\n index: whereCtx.index,\n isPrimKey: !whereCtx.index || table.schema.primKey.keyPath && whereCtx.index === table.schema.primKey.name,\n range: keyRange,\n keysOnly: false,\n dir: \"next\",\n unique: \"\",\n algorithm: null,\n filter: null,\n replayFilter: null,\n isMatch: null,\n offset: 0,\n limit: Infinity,\n error: error, // If set, any promise must be rejected with this error\n or: whereCtx.or,\n valueFilter: table.hook.reading.fire\n };\n }\n\n extend(Collection.prototype, function () {\n\n //\n // Collection Private Functions\n //\n\n function addFilter(ctx, fn) {\n ctx.filter = combine(ctx.filter, fn);\n }\n\n function addReplayFilter(ctx, factory) {\n var curr = ctx.replayFilter;\n ctx.replayFilter = curr ? function () {\n return combine(curr(), factory());\n } : factory;\n }\n\n function addMatchFilter(ctx, fn) {\n ctx.isMatch = combine(ctx.isMatch, fn);\n }\n\n function getIndexOrStore(ctx, store) {\n if (ctx.isPrimKey) return store;\n var indexSpec = ctx.table.schema.idxByName[ctx.index];\n if (!indexSpec) throw new exceptions.Schema(\"KeyPath \" + ctx.index + \" on object store \" + store.name + \" is not indexed\");\n return store.index(indexSpec.name);\n }\n\n function openCursor(ctx, store) {\n var idxOrStore = getIndexOrStore(ctx, store);\n return ctx.keysOnly && 'openKeyCursor' in idxOrStore ? idxOrStore.openKeyCursor(ctx.range || null, ctx.dir + ctx.unique) : idxOrStore.openCursor(ctx.range || null, ctx.dir + ctx.unique);\n }\n\n function iter(ctx, fn, resolve, reject, idbstore) {\n var filter = ctx.replayFilter ? combine(ctx.filter, ctx.replayFilter()) : ctx.filter;\n if (!ctx.or) {\n iterate(openCursor(ctx, idbstore), combine(ctx.algorithm, filter), fn, resolve, reject, !ctx.keysOnly && ctx.valueFilter);\n } else {\n (function () {\n var set = {};\n var resolved = 0;\n\n function resolveboth() {\n if (++resolved === 2) resolve(); // Seems like we just support or btwn max 2 expressions, but there are no limit because we do recursion.\n }\n\n function union(item, cursor, advance) {\n if (!filter || filter(cursor, advance, resolveboth, reject)) {\n var key = cursor.primaryKey.toString(); // Converts any Date to String, String to String, Number to String and Array to comma-separated string\n if (!set.hasOwnProperty(key)) {\n set[key] = true;\n fn(item, cursor, advance);\n }\n }\n }\n\n ctx.or._iterate(union, resolveboth, reject, idbstore);\n iterate(openCursor(ctx, idbstore), ctx.algorithm, union, resolveboth, reject, !ctx.keysOnly && ctx.valueFilter);\n })();\n }\n }\n function getInstanceTemplate(ctx) {\n return ctx.table.schema.instanceTemplate;\n }\n\n return {\n\n //\n // Collection Protected Functions\n //\n\n _read: function (fn, cb) {\n var ctx = this._ctx;\n if (ctx.error) return ctx.table._trans(null, function rejector(resolve, reject) {\n reject(ctx.error);\n });else return ctx.table._idbstore(READONLY, fn).then(cb);\n },\n _write: function (fn) {\n var ctx = this._ctx;\n if (ctx.error) return ctx.table._trans(null, function rejector(resolve, reject) {\n reject(ctx.error);\n });else return ctx.table._idbstore(READWRITE, fn, \"locked\"); // When doing write operations on collections, always lock the operation so that upcoming operations gets queued.\n },\n _addAlgorithm: function (fn) {\n var ctx = this._ctx;\n ctx.algorithm = combine(ctx.algorithm, fn);\n },\n\n _iterate: function (fn, resolve, reject, idbstore) {\n return iter(this._ctx, fn, resolve, reject, idbstore);\n },\n\n clone: function (props) {\n var rv = Object.create(this.constructor.prototype),\n ctx = Object.create(this._ctx);\n if (props) extend(ctx, props);\n rv._ctx = ctx;\n return rv;\n },\n\n raw: function () {\n this._ctx.valueFilter = null;\n return this;\n },\n\n //\n // Collection Public methods\n //\n\n each: function (fn) {\n var ctx = this._ctx;\n\n fake && fn(getInstanceTemplate(ctx));\n\n return this._read(function (resolve, reject, idbstore) {\n iter(ctx, fn, resolve, reject, idbstore);\n });\n },\n\n count: function (cb) {\n if (fake) return Promise.resolve(0).then(cb);\n var self = this,\n ctx = this._ctx;\n\n if (ctx.filter || ctx.algorithm || ctx.or || ctx.replayFilter) {\n // When filters are applied or 'ored' collections are used, we must count manually\n var count = 0;\n return this._read(function (resolve, reject, idbstore) {\n iter(ctx, function () {\n ++count;return false;\n }, function () {\n resolve(count);\n }, reject, idbstore);\n }, cb);\n } else {\n // Otherwise, we can use the count() method if the index.\n return this._read(function (resolve, reject, idbstore) {\n var idx = getIndexOrStore(ctx, idbstore);\n var req = ctx.range ? idx.count(ctx.range) : idx.count();\n req.onerror = eventRejectHandler(reject, [\"calling\", \"count()\", \"on\", self.name]);\n req.onsuccess = function (e) {\n resolve(e.target.result);\n };\n }, cb);\n }\n },\n\n sortBy: function (keyPath, cb) {\n /// \n var parts = keyPath.split('.').reverse(),\n lastPart = parts[0],\n lastIndex = parts.length - 1;\n function getval(obj, i) {\n if (i) return getval(obj[parts[i]], i - 1);\n return obj[lastPart];\n }\n var order = this._ctx.dir === \"next\" ? 1 : -1;\n\n function sorter(a, b) {\n var aVal = getval(a, lastIndex),\n bVal = getval(b, lastIndex);\n return aVal < bVal ? -order : aVal > bVal ? order : 0;\n }\n return this.toArray(function (a) {\n return a.sort(sorter);\n }).then(cb);\n },\n\n toArray: function (cb) {\n var ctx = this._ctx;\n return this._read(function (resolve, reject, idbstore) {\n fake && resolve([getInstanceTemplate(ctx)]);\n var a = [];\n iter(ctx, function (item) {\n a.push(item);\n }, function arrayComplete() {\n resolve(a);\n }, reject, idbstore);\n }, cb);\n },\n\n offset: function (offset) {\n var ctx = this._ctx;\n if (offset <= 0) return this;\n ctx.offset += offset; // For count()\n if (!ctx.or && !ctx.algorithm && !ctx.filter && !ctx.replayFilter) {\n addReplayFilter(ctx, function () {\n var offsetLeft = offset;\n return function offsetFilter(cursor, advance, resolve) {\n if (offsetLeft === 0) return true;\n if (offsetLeft === 1) {\n --offsetLeft;return false;\n }\n advance(function () {\n cursor.advance(offsetLeft);offsetLeft = 0;\n });\n return false;\n };\n });\n } else {\n addReplayFilter(ctx, function () {\n var offsetLeft = offset;\n return function () {\n return --offsetLeft < 0;\n };\n });\n }\n return this;\n },\n\n limit: function (numRows) {\n this._ctx.limit = Math.min(this._ctx.limit, numRows); // For count()\n addReplayFilter(this._ctx, function () {\n var rowsLeft = numRows;\n return function (cursor, advance, resolve) {\n if (--rowsLeft <= 0) advance(resolve); // Stop after this item has been included\n return rowsLeft >= 0; // If numRows is already below 0, return false because then 0 was passed to numRows initially. Otherwise we wouldnt come here.\n };\n });\n return this;\n },\n\n until: function (filterFunction, bIncludeStopEntry) {\n var ctx = this._ctx;\n fake && filterFunction(getInstanceTemplate(ctx));\n addFilter(this._ctx, function (cursor, advance, resolve) {\n if (filterFunction(cursor.value)) {\n advance(resolve);\n return bIncludeStopEntry;\n } else {\n return true;\n }\n });\n return this;\n },\n\n first: function (cb) {\n return this.limit(1).toArray(function (a) {\n return a[0];\n }).then(cb);\n },\n\n last: function (cb) {\n return this.reverse().first(cb);\n },\n\n and: function (filterFunction) {\n /// function(val){return true/false}\n fake && filterFunction(getInstanceTemplate(this._ctx));\n addFilter(this._ctx, function (cursor) {\n return filterFunction(cursor.value);\n });\n addMatchFilter(this._ctx, filterFunction); // match filters not used in Dexie.js but can be used by 3rd part libraries to test a collection for a match without querying DB. Used by Dexie.Observable.\n return this;\n },\n\n or: function (indexName) {\n return new WhereClause(this._ctx.table, indexName, this);\n },\n\n reverse: function () {\n this._ctx.dir = this._ctx.dir === \"prev\" ? \"next\" : \"prev\";\n if (this._ondirectionchange) this._ondirectionchange(this._ctx.dir);\n return this;\n },\n\n desc: function () {\n return this.reverse();\n },\n\n eachKey: function (cb) {\n var ctx = this._ctx;\n fake && cb(getByKeyPath(getInstanceTemplate(this._ctx), this._ctx.index ? this._ctx.table.schema.idxByName[this._ctx.index].keyPath : this._ctx.table.schema.primKey.keyPath));\n ctx.keysOnly = true;\n return this.each(function (val, cursor) {\n cb(cursor.key, cursor);\n });\n },\n\n eachUniqueKey: function (cb) {\n this._ctx.unique = \"unique\";\n return this.eachKey(cb);\n },\n\n keys: function (cb) {\n var ctx = this._ctx;\n ctx.keysOnly = true;\n var a = [];\n if (fake) return new Promise(this.eachKey.bind(this)).then(function (x) {\n return [x];\n }).then(cb);\n return this.each(function (item, cursor) {\n a.push(cursor.key);\n }).then(function () {\n return a;\n }).then(cb);\n },\n\n uniqueKeys: function (cb) {\n this._ctx.unique = \"unique\";\n return this.keys(cb);\n },\n\n firstKey: function (cb) {\n return this.limit(1).keys(function (a) {\n return a[0];\n }).then(cb);\n },\n\n lastKey: function (cb) {\n return this.reverse().firstKey(cb);\n },\n\n distinct: function () {\n var ctx = this._ctx,\n idx = ctx.index && ctx.table.schema.idxByName[ctx.index];\n if (!idx || !idx.multi) return this; // distinct() only makes differencies on multiEntry indexes.\n var set = {};\n addFilter(this._ctx, function (cursor) {\n var strKey = cursor.primaryKey.toString(); // Converts any Date to String, String to String, Number to String and Array to comma-separated string\n var found = set.hasOwnProperty(strKey);\n set[strKey] = true;\n return !found;\n });\n return this;\n }\n };\n });\n\n //\n //\n // WriteableCollection Class\n //\n //\n function WriteableCollection() {\n Collection.apply(this, arguments);\n }\n\n derive(WriteableCollection).from(Collection).extend({\n\n //\n // WriteableCollection Public Methods\n //\n\n modify: function (changes) {\n var self = this,\n ctx = this._ctx,\n hook = ctx.table.hook,\n updatingHook = hook.updating.fire,\n deletingHook = hook.deleting.fire;\n\n fake && typeof changes === 'function' && changes.call({ value: ctx.table.schema.instanceTemplate }, ctx.table.schema.instanceTemplate);\n\n return this._write(function (resolve, reject, idbstore, trans) {\n var modifyer;\n if (typeof changes === 'function') {\n // Changes is a function that may update, add or delete propterties or even require a deletion the object itself (delete this.item)\n if (updatingHook === nop && deletingHook === nop) {\n // Noone cares about what is being changed. Just let the modifier function be the given argument as is.\n modifyer = changes;\n } else {\n // People want to know exactly what is being modified or deleted.\n // Let modifyer be a proxy function that finds out what changes the caller is actually doing\n // and call the hooks accordingly!\n modifyer = function (item) {\n var origItem = deepClone(item); // Clone the item first so we can compare laters.\n if (changes.call(this, item, this) === false) return false; // Call the real modifyer function (If it returns false explicitely, it means it dont want to modify anyting on this object)\n if (!this.hasOwnProperty(\"value\")) {\n // The real modifyer function requests a deletion of the object. Inform the deletingHook that a deletion is taking place.\n deletingHook.call(this, this.primKey, item, trans);\n } else {\n // No deletion. Check what was changed\n var objectDiff = getObjectDiff(origItem, this.value);\n var additionalChanges = updatingHook.call(this, objectDiff, this.primKey, origItem, trans);\n if (additionalChanges) {\n // Hook want to apply additional modifications. Make sure to fullfill the will of the hook.\n item = this.value;\n keys(additionalChanges).forEach(function (keyPath) {\n setByKeyPath(item, keyPath, additionalChanges[keyPath]); // Adding {keyPath: undefined} means that the keyPath should be deleted. Handled by setByKeyPath\n });\n }\n }\n };\n }\n } else if (updatingHook === nop) {\n // changes is a set of {keyPath: value} and no one is listening to the updating hook.\n var keyPaths = keys(changes);\n var numKeys = keyPaths.length;\n modifyer = function (item) {\n var anythingModified = false;\n for (var i = 0; i < numKeys; ++i) {\n var keyPath = keyPaths[i],\n val = changes[keyPath];\n if (getByKeyPath(item, keyPath) !== val) {\n setByKeyPath(item, keyPath, val); // Adding {keyPath: undefined} means that the keyPath should be deleted. Handled by setByKeyPath\n anythingModified = true;\n }\n }\n return anythingModified;\n };\n } else {\n // changes is a set of {keyPath: value} and people are listening to the updating hook so we need to call it and\n // allow it to add additional modifications to make.\n var origChanges = changes;\n changes = shallowClone(origChanges); // Let's work with a clone of the changes keyPath/value set so that we can restore it in case a hook extends it.\n modifyer = function (item) {\n var anythingModified = false;\n var additionalChanges = updatingHook.call(this, changes, this.primKey, deepClone(item), trans);\n if (additionalChanges) extend(changes, additionalChanges);\n keys(changes).forEach(function (keyPath) {\n var val = changes[keyPath];\n if (getByKeyPath(item, keyPath) !== val) {\n setByKeyPath(item, keyPath, val);\n anythingModified = true;\n }\n });\n if (additionalChanges) changes = shallowClone(origChanges); // Restore original changes for next iteration\n return anythingModified;\n };\n }\n\n var count = 0;\n var successCount = 0;\n var iterationComplete = false;\n var failures = [];\n var failKeys = [];\n var currentKey = null;\n\n function modifyItem(item, cursor, advance) {\n currentKey = cursor.primaryKey;\n var thisContext = {\n primKey: cursor.primaryKey,\n value: item,\n onsuccess: null,\n onerror: null\n };\n\n function onerror(e) {\n failures.push(e);\n failKeys.push(thisContext.primKey);\n if (thisContext.onerror) Promise.newPSD(function () {\n Promise.PSD.trans = trans;\n thisContext.onerror(e);\n });\n checkFinished();\n return true; // Catch these errors and let a final rejection decide whether or not to abort entire transaction\n }\n\n if (modifyer.call(thisContext, item, thisContext) !== false) {\n // If a callback explicitely returns false, do not perform the update!\n var bDelete = !thisContext.hasOwnProperty(\"value\");\n ++count;\n miniTryCatch(function () {\n var req = bDelete ? cursor.delete() : cursor.update(thisContext.value);\n req.onerror = eventRejectHandler(onerror, bDelete ? [\"deleting\", item, \"from\", ctx.table.name] : [\"modifying\", item, \"on\", ctx.table.name]);\n req.onsuccess = function (ev) {\n if (thisContext.onsuccess) Promise.newPSD(function () {\n Promise.PSD.trans = trans;\n thisContext.onsuccess(thisContext.value);\n });\n ++successCount;\n checkFinished();\n };\n }, onerror);\n } else if (thisContext.onsuccess) {\n // Hook will expect either onerror or onsuccess to always be called!\n thisContext.onsuccess(thisContext.value);\n }\n }\n\n function doReject(e) {\n if (e) {\n failures.push(e);\n failKeys.push(currentKey);\n }\n return reject(new ModifyError(\"Error modifying one or more objects\", failures, successCount, failKeys));\n }\n\n function checkFinished() {\n if (iterationComplete && successCount + failures.length === count) {\n if (failures.length > 0) doReject();else resolve(successCount);\n }\n }\n self.clone().raw()._iterate(modifyItem, function () {\n iterationComplete = true;\n checkFinished();\n }, doReject, idbstore);\n });\n },\n\n 'delete': function () {\n var _this2 = this;\n\n var ctx = this._ctx,\n range = ctx.range,\n deletingHook = ctx.table.hook.deleting.fire,\n hasDeleteHook = deletingHook !== nop;\n if (!hasDeleteHook && !ctx.or && !ctx.algorithm && !ctx.filter && !ctx.replayFilter && (ctx.isPrimKey && !hangsOnDeleteLargeKeyRange || !range)) // if no range, we'll use clear().\n {\n // May use IDBObjectStore.delete(IDBKeyRange) in this case (Issue #208)\n // For chromium, this is the way most optimized version.\n // For IE/Edge, this could hang the indexedDB engine and make operating system instable\n // (https://gist.github.com/dfahlander/5a39328f029de18222cf2125d56c38f7)\n return this._write(function (resolve, reject, idbstore) {\n // Our API contract is to return a count of deleted items, so we have to count() before delete().\n var onerror = eventRejectHandler(reject, [\"deleting range from\", ctx.table.name]);\n var countReq = range ? idbstore.count(range) : idbstore.count();\n countReq.onerror = onerror;\n countReq.onsuccess = function () {\n var count = countReq.result;\n miniTryCatch(function () {\n var delReq = range ? idbstore.delete(range) : idbstore.clear();\n delReq.onerror = onerror;\n delReq.onsuccess = function () {\n return resolve(count);\n };\n }, function (err) {\n return reject(mapError(err));\n });\n };\n });\n }\n\n // Default version to use when collection is not a vanilla IDBKeyRange on the primary key.\n // Divide into chunks to not starve RAM.\n // If has delete hook, we will have to collect not just keys but also objects, so it will use\n // more memory and need lower chunk size.\n var CHUNKSIZE = hasDeleteHook ? 2000 : 10000;\n\n return this._write(function (resolve, reject, idbstore, trans) {\n var totalCount = 0;\n // Clone table and change the way transaction promises are generated.\n // This is to be able to call other Collection methods within the same\n // transaction even if the caller calls us without a transaction.\n var table = Object.create(ctx.table);\n table._tpf = trans._tpf; // Enable us to keep same transaction even if called without transaction.\n // Clone collection and change its table and set a limit of CHUNKSIZE on the cloned Collection instance.\n var collection = _this2.clone({\n table: table, // Execute in same transaction\n keysOnly: !hasDeleteHook }) // load just keys (unless deleteHook has subscribers)\n .distinct() // In case multiEntry is used, never delete same key twice because resulting count\n // would become larger than actual delete count.\n .limit(CHUNKSIZE).raw(); // Don't filter through reading-hooks (like mapped classes etc)\n\n var keysOrTuples = [];\n\n // We're gonna do things on as many chunks that are needed.\n // Use recursion of nextChunk function:\n var nextChunk = function () {\n return collection.each(hasDeleteHook ? function (val, cursor) {\n // Somebody subscribes to hook('deleting'). Collect all primary keys and their values,\n // so that the hook can be called with its values in bulkDelete().\n keysOrTuples.push([cursor.primaryKey, cursor.value]);\n } : function (val, cursor) {\n // No one subscribes to hook('deleting'). Collect only primary keys:\n keysOrTuples.push(cursor.primaryKey);\n }).then(function () {\n // Chromium deletes faster when doing it in sort order.\n hasDeleteHook ? keysOrTuples.sort(function (a, b) {\n return ascending(a[0], b[0]);\n }) : keysOrTuples.sort(ascending);\n return bulkDelete(idbstore, trans, keysOrTuples, hasDeleteHook, deletingHook);\n }).then(function () {\n var count = keysOrTuples.length;\n totalCount += count;\n keysOrTuples = [];\n return count < CHUNKSIZE ? totalCount : nextChunk();\n });\n };\n\n resolve(nextChunk());\n });\n }\n });\n\n //\n //\n //\n // ------------------------- Help functions ---------------------------\n //\n //\n //\n\n function lowerVersionFirst(a, b) {\n return a._cfg.version - b._cfg.version;\n }\n\n function setApiOnPlace(objs, transactionPromiseFactory, tableNames, mode, dbschema, enableProhibitedDB) {\n tableNames.forEach(function (tableName) {\n var tableInstance = db._tableFactory(mode, dbschema[tableName], transactionPromiseFactory);\n objs.forEach(function (obj) {\n if (!obj[tableName]) {\n if (enableProhibitedDB) {\n Object.defineProperty(obj, tableName, {\n configurable: true,\n enumerable: true,\n get: function () {\n var currentTrans = Promise.PSD && Promise.PSD.trans;\n if (currentTrans && currentTrans.db === db) {\n return currentTrans.tables[tableName];\n }\n return tableInstance;\n }\n });\n } else {\n obj[tableName] = tableInstance;\n }\n }\n });\n });\n }\n\n function removeTablesApi(objs) {\n objs.forEach(function (obj) {\n for (var key in obj) {\n if (obj[key] instanceof Table) delete obj[key];\n }\n });\n }\n\n function iterate(req, filter, fn, resolve, reject, valueFilter) {\n valueFilter = valueFilter || mirror;\n if (!req.onerror) req.onerror = eventRejectHandler(reject);\n if (filter) {\n req.onsuccess = trycatch(function filter_record(e) {\n var cursor = req.result;\n if (cursor) {\n var c = function () {\n cursor.continue();\n };\n if (filter(cursor, function (advancer) {\n c = advancer;\n }, resolve, reject)) fn(valueFilter(cursor.value), cursor, function (advancer) {\n c = advancer;\n });\n c();\n } else {\n resolve();\n }\n }, reject);\n } else {\n req.onsuccess = trycatch(function filter_record(e) {\n var cursor = req.result;\n if (cursor) {\n var c = function () {\n cursor.continue();\n };\n fn(valueFilter(cursor.value), cursor, function (advancer) {\n c = advancer;\n });\n c();\n } else {\n resolve();\n }\n }, reject);\n }\n }\n\n function parseIndexSyntax(indexes) {\n /// \n /// \n var rv = [];\n indexes.split(',').forEach(function (index) {\n index = index.trim();\n var name = index.replace(\"&\", \"\").replace(\"++\", \"\").replace(\"*\", \"\");\n var keyPath = name.indexOf('[') !== 0 ? name : index.substring(index.indexOf('[') + 1, index.indexOf(']')).split('+');\n\n rv.push(new IndexSpec(name, keyPath || null, index.indexOf('&') !== -1, index.indexOf('*') !== -1, index.indexOf(\"++\") !== -1, isArray(keyPath), keyPath.indexOf('.') !== -1));\n });\n return rv;\n }\n\n function cmp(key1, key2) {\n return indexedDB.cmp(key1, key2);\n }\n\n function min(a, b) {\n return cmp(a, b) < 0 ? a : b;\n }\n\n function max(a, b) {\n return cmp(a, b) > 0 ? a : b;\n }\n\n function ascending(a, b) {\n return indexedDB.cmp(a, b);\n }\n\n function descending(a, b) {\n return indexedDB.cmp(b, a);\n }\n\n function simpleCompare(a, b) {\n return a < b ? -1 : a === b ? 0 : 1;\n }\n\n function simpleCompareReverse(a, b) {\n return a > b ? -1 : a === b ? 0 : 1;\n }\n\n function combine(filter1, filter2) {\n return filter1 ? filter2 ? function () {\n return filter1.apply(this, arguments) && filter2.apply(this, arguments);\n } : filter1 : filter2;\n }\n\n function readGlobalSchema() {\n db.verno = idbdb.version / 10;\n db._dbSchema = globalSchema = {};\n dbStoreNames = slice(idbdb.objectStoreNames, 0);\n if (dbStoreNames.length === 0) return; // Database contains no stores.\n var trans = idbdb.transaction(safariMultiStoreFix(dbStoreNames), 'readonly');\n dbStoreNames.forEach(function (storeName) {\n var store = trans.objectStore(storeName),\n keyPath = store.keyPath,\n dotted = keyPath && typeof keyPath === 'string' && keyPath.indexOf('.') !== -1;\n var primKey = new IndexSpec(keyPath, keyPath || \"\", false, false, !!store.autoIncrement, keyPath && typeof keyPath !== 'string', dotted);\n var indexes = [];\n for (var j = 0; j < store.indexNames.length; ++j) {\n var idbindex = store.index(store.indexNames[j]);\n keyPath = idbindex.keyPath;\n dotted = keyPath && typeof keyPath === 'string' && keyPath.indexOf('.') !== -1;\n var index = new IndexSpec(idbindex.name, keyPath, !!idbindex.unique, !!idbindex.multiEntry, false, keyPath && typeof keyPath !== 'string', dotted);\n indexes.push(index);\n }\n globalSchema[storeName] = new TableSchema(storeName, primKey, indexes, {});\n });\n setApiOnPlace([allTables], db._transPromiseFactory, keys(globalSchema), READWRITE, globalSchema);\n }\n\n function adjustToExistingIndexNames(schema, idbtrans) {\n /// \n /// Issue #30 Problem with existing db - adjust to existing index names when migrating from non-dexie db\n /// \n /// Map between name and TableSchema\n /// \n var storeNames = idbtrans.db.objectStoreNames;\n for (var i = 0; i < storeNames.length; ++i) {\n var storeName = storeNames[i];\n var store = idbtrans.objectStore(storeName);\n for (var j = 0; j < store.indexNames.length; ++j) {\n var indexName = store.indexNames[j];\n var keyPath = store.index(indexName).keyPath;\n var dexieName = typeof keyPath === 'string' ? keyPath : \"[\" + slice(keyPath).join('+') + \"]\";\n if (schema[storeName]) {\n var indexSpec = schema[storeName].idxByName[dexieName];\n if (indexSpec) indexSpec.name = indexName;\n }\n }\n }\n }\n\n function fireOnBlocked(ev) {\n db.on(\"blocked\").fire(ev);\n // Workaround (not fully*) for missing \"versionchange\" event in IE,Edge and Safari:\n connections.filter(function (c) {\n return c.name === db.name && c !== db && !c._vcFired;\n }).map(function (c) {\n return c.on(\"versionchange\").fire(ev);\n });\n }\n\n extend(this, {\n Collection: Collection,\n Table: Table,\n Transaction: Transaction,\n Version: Version,\n WhereClause: WhereClause,\n WriteableCollection: WriteableCollection,\n WriteableTable: WriteableTable\n });\n\n init();\n\n addons.forEach(function (fn) {\n fn(db);\n });\n}\n\nvar fakeAutoComplete = function () {}; // Will never be changed. We just fake for the IDE that we change it (see doFakeAutoComplete())\nvar fake = false; // Will never be changed. We just fake for the IDE that we change it (see doFakeAutoComplete())\n\nfunction trycatch(fn, reject) {\n var psd = Promise.PSD;\n return function () {\n var outerPSD = Promise.PSD; // Support Promise-specific data (PSD) in callback calls\n Promise.PSD = psd;\n try {\n fn.apply(this, arguments);\n } catch (e) {\n reject(e);\n } finally {\n Promise.PSD = outerPSD;\n }\n };\n}\n\nfunction parseType(type) {\n if (typeof type === 'function') {\n return new type();\n } else if (isArray(type)) {\n return [parseType(type[0])];\n } else if (type && typeof type === 'object') {\n var rv = {};\n applyStructure(rv, type);\n return rv;\n } else {\n return type;\n }\n}\n\nfunction applyStructure(obj, structure) {\n keys(structure).forEach(function (member) {\n var value = parseType(structure[member]);\n obj[member] = value;\n });\n return obj;\n}\n\nfunction eventRejectHandler(reject, sentance) {\n return function (event) {\n var errObj = event && event.target.error || new Error(\"\");\n if (sentance) {\n var occurredWhen = \" occurred when \" + sentance.map(function (word) {\n switch (typeof word) {\n case 'function':\n return word();\n case 'string':\n return word;\n default:\n return JSON.stringify(word);\n }\n }).join(\" \");\n if (errObj.message && errObj.message != errObj.name) occurredWhen += \". \" + errObj.message;\n if (errObj.name) {\n errObj = mapError(errObj, errObj.name + occurredWhen);\n } else {\n // Non-standard exceptions from IndexedDBPolyfill\n errObj = errObj + occurredWhen;\n }\n };\n reject(errObj);\n\n if (event) {\n // Old versions of IndexedDBShim doesnt provide an error event\n // Stop error from propagating to IDBTransaction. Let us handle that manually instead.\n if (event.stopPropagation) // IndexedDBShim doesnt support this\n event.stopPropagation();\n if (event.preventDefault) // IndexedDBShim doesnt support this\n event.preventDefault();\n }\n\n return false;\n };\n}\n\nfunction preventDefault(e) {\n e.preventDefault();\n}\n\nfunction globalDatabaseList(cb) {\n var val,\n localStorage = Dexie.dependencies.localStorage;\n if (!localStorage) return cb([]); // Envs without localStorage support\n try {\n val = JSON.parse(localStorage.getItem('Dexie.DatabaseNames') || \"[]\");\n } catch (e) {\n val = [];\n }\n if (cb(val)) {\n localStorage.setItem('Dexie.DatabaseNames', JSON.stringify(val));\n }\n}\n\nfunction awaitIterable(iterable) {\n var callNext = function (result) {\n return iterable.next(result);\n },\n doThrow = function (error) {\n return iterable.throw(error);\n },\n onSuccess = step(callNext),\n onError = step(doThrow);\n\n function step(getNext) {\n return function (val) {\n var next = getNext(val),\n value = next.value;\n\n return next.done ? value : !value || typeof value.then !== 'function' ? Array.isArray(value) ? awaitAll(value, 0) : onSuccess(value) : value.then(onSuccess, onError);\n };\n }\n\n function awaitAll(values, i) {\n if (i === values.length) return onSuccess(values);\n var value = values[i];\n return value.constructor && typeof value.constructor.all == 'function' ? value.constructor.all(values).then(onSuccess, onError) : awaitAll(values, i + 1);\n }\n\n return step(callNext)();\n}\n\n//\n// IndexSpec struct\n//\nfunction IndexSpec(name, keyPath, unique, multi, auto, compound, dotted) {\n /// \n /// \n /// \n /// \n /// \n /// \n /// \n this.name = name;\n this.keyPath = keyPath;\n this.unique = unique;\n this.multi = multi;\n this.auto = auto;\n this.compound = compound;\n this.dotted = dotted;\n var keyPathSrc = typeof keyPath === 'string' ? keyPath : keyPath && '[' + [].join.call(keyPath, '+') + ']';\n this.src = (unique ? '&' : '') + (multi ? '*' : '') + (auto ? \"++\" : \"\") + keyPathSrc;\n}\n\n//\n// TableSchema struct\n//\nfunction TableSchema(name, primKey, indexes, instanceTemplate) {\n /// \n /// \n /// \n /// \n this.name = name;\n this.primKey = primKey || new IndexSpec();\n this.indexes = indexes || [new IndexSpec()];\n this.instanceTemplate = instanceTemplate;\n this.mappedClass = null;\n this.idxByName = indexes.reduce(function (hashSet, index) {\n hashSet[index.name] = index;\n return hashSet;\n }, {});\n}\n\n//\n// Static delete() method.\n//\nDexie.delete = function (databaseName) {\n var db = new Dexie(databaseName),\n promise = db.delete();\n promise.onblocked = function (fn) {\n db.on(\"blocked\", fn);\n return this;\n };\n return promise;\n};\n\n//\n// Static exists() method.\n//\nDexie.exists = function (name) {\n return new Dexie(name).open().then(function (db) {\n db.close();\n return true;\n }).catch(Dexie.NoSuchDatabaseError, function () {\n return false;\n });\n};\n\n//\n// Static method for retrieving a list of all existing databases at current host.\n//\nDexie.getDatabaseNames = function (cb) {\n return new Promise(function (resolve, reject) {\n var getDatabaseNames = getNativeGetDatabaseNamesFn(indexedDB);\n if (getDatabaseNames) {\n // In case getDatabaseNames() becomes standard, let's prepare to support it:\n var req = getDatabaseNames();\n req.onsuccess = function (event) {\n resolve(slice(event.target.result, 0)); // Converst DOMStringList to Array\n };\n req.onerror = eventRejectHandler(reject);\n } else {\n globalDatabaseList(function (val) {\n resolve(val);\n return false;\n });\n }\n }).then(cb);\n};\n\nDexie.defineClass = function (structure) {\n /// \n /// Create a javascript constructor based on given template for which properties to expect in the class.\n /// Any property that is a constructor function will act as a type. So {name: String} will be equal to {name: new String()}.\n /// \n /// Helps IDE code completion by knowing the members that objects contain and not just the indexes. Also\n /// know what type each member has. Example: {name: String, emailAddresses: [String], properties: {shoeSize: Number}}\n\n // Default constructor able to copy given properties into this object.\n function Class(properties) {\n /// Properties to initialize object with.\n /// \n properties ? extend(this, properties) : fake && applyStructure(this, structure);\n }\n return Class;\n};\n\nDexie.applyStructure = applyStructure;\n\nDexie.ignoreTransaction = function (scopeFunc) {\n // In case caller is within a transaction but needs to create a separate transaction.\n // Example of usage:\n //\n // Let's say we have a logger function in our app. Other application-logic should be unaware of the\n // logger function and not need to include the 'logentries' table in all transaction it performs.\n // The logging should always be done in a separate transaction and not be dependant on the current\n // running transaction context. Then you could use Dexie.ignoreTransaction() to run code that starts a new transaction.\n //\n // Dexie.ignoreTransaction(function() {\n // db.logentries.add(newLogEntry);\n // });\n //\n // Unless using Dexie.ignoreTransaction(), the above example would try to reuse the current transaction\n // in current Promise-scope.\n //\n // An alternative to Dexie.ignoreTransaction() would be setImmediate() or setTimeout(). The reason we still provide an\n // API for this because\n // 1) The intention of writing the statement could be unclear if using setImmediate() or setTimeout().\n // 2) setTimeout() would wait unnescessary until firing. This is however not the case with setImmediate().\n // 3) setImmediate() is not supported in the ES standard.\n return Promise.newPSD(function () {\n Promise.PSD.trans = null;\n return scopeFunc();\n });\n};\n\nDexie.vip = function (fn) {\n // To be used by subscribers to the on('ready') event.\n // This will let caller through to access DB even when it is blocked while the db.ready() subscribers are firing.\n // This would have worked automatically if we were certain that the Provider was using Dexie.Promise for all asyncronic operations. The promise PSD\n // from the provider.connect() call would then be derived all the way to when provider would call localDatabase.applyChanges(). But since\n // the provider more likely is using non-promise async APIs or other thenable implementations, we cannot assume that.\n // Note that this method is only useful for on('ready') subscribers that is returning a Promise from the event. If not using vip()\n // the database could deadlock since it wont open until the returned Promise is resolved, and any non-VIPed operation started by\n // the caller will not resolve until database is opened.\n return Promise.newPSD(function () {\n Promise.PSD.letThrough = true; // Make sure we are let through if still blocking db due to onready is firing.\n return fn();\n });\n};\n\nDexie.async = function (generatorFn) {\n return function () {\n try {\n var rv = awaitIterable(generatorFn.apply(this, arguments));\n if (!rv || typeof rv.then !== 'function') return Dexie.Promise.resolve(rv);\n return rv;\n } catch (e) {\n return Dexie.Promise.reject(e);\n }\n };\n};\n\nDexie.spawn = function (generatorFn, args, thiz) {\n try {\n var rv = awaitIterable(generatorFn.apply(thiz, args || []));\n if (!rv || typeof rv.then !== 'function') return Dexie.Promise.resolve(rv);\n return rv;\n } catch (e) {\n return Dexie.Promise.reject(e);\n }\n};\n\n// Dexie.currentTransaction property. Only applicable for transactions entered using the new \"transact()\" method.\nObject.defineProperty(Dexie, \"currentTransaction\", {\n get: function () {\n /// \n return Promise.PSD && Promise.PSD.trans || null;\n }\n});\n\nfunction safariMultiStoreFix(storeNames) {\n return storeNames.length === 1 ? storeNames[0] : storeNames;\n}\n\n// Export our Promise implementation since it can be handy as a standalone Promise implementation\nDexie.Promise = Promise;\n// Export our derive/extend/override methodology\nDexie.derive = derive;\nDexie.extend = extend;\nDexie.override = override;\n// Export our Events() function - can be handy as a toolkit\nDexie.Events = Dexie.events = Events; // Backward compatible lowercase version.\n// Utilities\nDexie.getByKeyPath = getByKeyPath;\nDexie.setByKeyPath = setByKeyPath;\nDexie.delByKeyPath = delByKeyPath;\nDexie.shallowClone = shallowClone;\nDexie.deepClone = deepClone;\nDexie.addons = [];\nDexie.fakeAutoComplete = fakeAutoComplete;\nDexie.asap = asap;\nDexie.maxKey = maxKey;\nDexie.connections = connections;\n\n// Export Error classes\nextend(Dexie, fullNameExceptions); // Dexie.XXXError = class XXXError {...};\nDexie.MultiModifyError = Dexie.ModifyError; // Backward compatibility 0.9.8\nDexie.errnames = errnames;\n\n// Export other static classes\nDexie.IndexSpec = IndexSpec;\nDexie.TableSchema = TableSchema;\n\n//\n// Dependencies\n//\n// These will automatically work in browsers with indexedDB support, or where an indexedDB polyfill has been included.\n//\n// In node.js, however, these properties must be set \"manually\" before instansiating a new Dexie(). For node.js, you need to require indexeddb-js or similar and then set these deps.\n//\nvar idbshim = _global.idbModules && _global.idbModules.shimIndexedDB ? _global.idbModules : {};\nDexie.dependencies = {\n // Required:\n indexedDB: idbshim.shimIndexedDB || _global.indexedDB || _global.mozIndexedDB || _global.webkitIndexedDB || _global.msIndexedDB,\n IDBKeyRange: idbshim.IDBKeyRange || _global.IDBKeyRange || _global.webkitIDBKeyRange\n};\nminiTryCatch(function () {\n // Optional dependencies\n // localStorage\n Dexie.dependencies.localStorage = (typeof chrome !== \"undefined\" && chrome !== null ? chrome.storage : void 0) != null ? null : _global.localStorage;\n});\n\n// API Version Number: Type Number, make sure to always set a version number that can be comparable correctly. Example: 0.9, 0.91, 0.92, 1.0, 1.01, 1.1, 1.2, 1.21, etc.\nDexie.semVer = \"{version}\";\nDexie.version = Dexie.semVer.split('.').map(function (n) {\n return parseInt(n);\n}).reduce(function (p, c, i) {\n return p + c / Math.pow(10, i * 2);\n});\n\nfunction getNativeGetDatabaseNamesFn(indexedDB) {\n var fn = indexedDB && (indexedDB.getDatabaseNames || indexedDB.webkitGetDatabaseNames);\n return fn && fn.bind(indexedDB);\n}\n\n// Fool IDE to improve autocomplete. Tested with Visual Studio 2013 and 2015.\ndoFakeAutoComplete(function () {\n Dexie.fakeAutoComplete = fakeAutoComplete = doFakeAutoComplete;\n Dexie.fake = fake = true;\n});\n\n// https://github.com/dfahlander/Dexie.js/issues/186\n// typescript compiler tsc in mode ts-->es5 & commonJS, will expect require() to return\n// x.default. Workaround: Set Dexie.default = Dexie.\nDexie.default = Dexie;"],"names":["exceptions","asap"],"mappings":";;;;;;IAYO,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI;IACtB,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO;IAC3B,IAAI,OAAO,GAAG,OAAO,IAAI,KAAK,WAAW,GAAG,IAAI,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM;;IAElG,SAAS,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE;QACnC,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;QAC3D,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,UAAU,GAAG,EAA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