text: "undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="pouchdb"),function(t,e,n){"use strict";e.module("pouchdb",[]).constant("POUCHDB_METHODS",{destroy:"qify",put:"qify",post:"qify",get:"qify",remove:"qify",bulkDocs:"qify",allDocs:"qify",putAttachment:"qify",getAttachment:"qify",removeAttachment:"qify",query:"qify",viewCleanup:"qify",info:"qify",compact:"qify",revsDiff:"qify",changes:"eventEmitter",sync:"eventEmitter",replicate:{to:"eventEmitter",from:"eventEmitter"}}).service("pouchDBDecorators",["$q",function(t){this.qify=function(e){return function(){return t.when(e.apply(this,arguments))}},this.eventEmitter=function(e){return function(){var n=t.defer(),o=e.apply(this,arguments).on("change",function(t){return n.notify({change:t})}).on("uptodate",function(t){return n.notify({uptodate:t})}).on("complete",function(t){return n.resolve(t)}).on("error",function(t){return n.reject(t)});return o.$promise=n.promise,o}}}]).provider("pouchDB",["POUCHDB_METHODS",function(t){var n=this;n.methods=t,n.$get=["$window","pouchDBDecorators",function(t,o){function r(t,n,i){for(var u in n){var f=n[u];e.isString(f)?(f=o[f],i?t[i][u]=f(t[i][u]):t[u]=f(t[u])):r(t,f,u)}return t}return function(e,o){var i=new t.PouchDB(e,o);return r(i,n.methods)}}]}])}(window,window.angular);