/* store.js - Copyright (c) 2010-2017 Marcus Westin */ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.store=t()}}(function(){var define,module,exports;return function t(e,n,r){function o(i,u){if(!n[i]){if(!e[i]){var a="function"==typeof require&&require;if(!u&&a)return a(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[i]={exports:{}};e[i][0].call(f.exports,function(t){var n=e[i][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[i].exports}for(var s="function"==typeof require&&require,i=0;i1)for(var n=1;n/g,">");return''+n+""}}function r(t){var e=o[t];return function(t){return e[0]+t+e[1]}}var o=e.exports={grey:["",""],green:["",""],yellow:["",""],red:["",""]},s="undefined"!=typeof t.window;for(var i in o)o.hasOwnProperty(i)&&(o[i]=s?n(i):r(i))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(t,e,n){(function(n){function r(t){o(m,t),x.t0=new Date,x._runNextTest()}function o(t,e,n,r){t||(t={});for(var o=1;o");m.outputEl.appendChild(document.createElement("div")).innerHTML=t.join(" "),x.hasFailedTest||(document.documentElement.scrollTop=document.body.scrollTop=99999999)}else f.apply(this,arguments)}function c(){var t=0;console.log=function(){var e=Array.prototype.slice.call(arguments);e.unshift(h.grey(t+" console.log():")),t+=1,a.apply(this,e)}}function f(){f.consoleLog.apply(console,arguments)}function l(){for(var t in v)"_old"!=t&&v.hasOwnProperty(t)&&(this[t]=v._old[t])}function p(t){d(),m.onDone?m.onDone(t):g.process&&g.process.exit&&n.exit(t)}function d(){for(var t=x.tests.length,e=x.failedTests.length,n=t-e,r=[],o=0;o0?(setTimeout(function(){n(t-1,2*e)},0),!1):assert(!1))})}function r(n,r){var o=(new Date).getTime()+n;t.set("foo","bar",o),r("bar"==t.get("foo"))&&setTimeout(function(){r((new Date).getTime()>o)&&r(void 0==t.get("foo"))&&(t.set("foo","bar"),setTimeout(function(){r("bar"==t.get("foo"))&&e()},5))},n)}n(5,10)}),test("remove expired keys",function(){var e="expired";t.set(e,"bar",(new Date).getTime()-1e3),assert(t.getExpiration(e)>0),t.removeExpiredKeys(),assert(!t.getExpiration(e))})}e.exports={plugin:t("./expire"),setup:r}},{"./expire":15}],17:[function(t,e,n){"use strict";function r(){return t("./lib/json2"),{}}e.exports=r},{"./lib/json2":19}],18:[function(t,e,n){"use strict";function r(t){test("serialization with json2",function(){t.set("foo",{bar:"cat"}),assert("cat"===t.get("foo").bar)})}e.exports={plugin:t("./json2"),setup:r}},{"./json2":17}],19:[function(require,module,exports){"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};"object"!==("undefined"==typeof JSON?"undefined":_typeof(JSON))&&(JSON={}),function(){function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var n,r,o,s,i,u=gap,a=e[t];switch(a&&"object"===("undefined"==typeof a?"undefined":_typeof(a))&&"function"==typeof a.toJSON&&(a=a.toJSON(t)),"function"==typeof rep&&(a=rep.call(e,t,a)),"undefined"==typeof a?"undefined":_typeof(a)){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";if(gap+=indent,i=[],"[object Array]"===Object.prototype.toString.apply(a)){for(s=a.length,n=0;n>>8,n[2*r+1]=i%256}return n},decompressFromUint8Array:function(t){if(null===t||void 0===t)return s.decompress(t);for(var n=new Array(t.length/2),r=0,o=n.length;r>=1}else{for(o=1,r=0;r>=1}l--,0==l&&(l=Math.pow(2,d),d++),delete u[f]}else for(o=i[f],r=0;r>=1;l--,0==l&&(l=Math.pow(2,d),d++),i[c]=p++,f=String(a)}if(""!==f){if(Object.prototype.hasOwnProperty.call(u,f)){if(f.charCodeAt(0)<256){for(r=0;r>=1}else{for(o=1,r=0;r>=1}l--,0==l&&(l=Math.pow(2,d),d++),delete u[f]}else for(o=i[f],r=0;r>=1;l--,0==l&&(l=Math.pow(2,d),d++)}for(o=2,r=0;r>=1;for(;;){if(g<<=1,v==e-1){h.push(n(g));break}v++}return h.join("")},decompress:function(t){return null==t?"":""==t?null:s._decompress(t.length,32768,function(e){return t.charCodeAt(e)})},_decompress:function(t,n,r){var o,s,i,u,a,c,f,l,p=[],d=4,h=4,g=3,v="",m=[],b={val:r(0),position:n,index:1};for(s=0;s<3;s+=1)p[s]=s;for(u=0,c=Math.pow(2,2),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;switch(o=u){case 0:for(u=0,c=Math.pow(2,8),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;l=e(u);break;case 1:for(u=0,c=Math.pow(2,16),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;l=e(u);break;case 2:return""}for(p[3]=l,i=l,m.push(l);;){if(b.index>t)return"";for(u=0,c=Math.pow(2,g),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;switch(l=u){case 0:for(u=0,c=Math.pow(2,8),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;p[h++]=e(u),l=h-1,d--;break;case 1:for(u=0,c=Math.pow(2,16),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;p[h++]=e(u),l=h-1,d--;break;case 2:return m.join("")}if(0==d&&(d=Math.pow(2,g),g++),p[l])v=p[l];else{if(l!==h)return null;v=i+i.charAt(0)}m.push(v),p[h++]=i+v.charAt(0),d--,i=v,0==d&&(d=Math.pow(2,g),g++)}}};return s}();"function"==typeof define&&define.amd?define(function(){return r}):"undefined"!=typeof e&&null!=e&&(e.exports=r)},{}],21:[function(t,e,n){"use strict";function r(){function t(t,e,n){var r=this.watch(e,n);return n(this.get(e)),r}function e(t,e){this.unwatch(e)}return{observe:t,unobserve:e}}var o=t("./events");e.exports=[o,r]},{"./events":13}],22:[function(t,e,n){"use strict";function r(t){test("observe",function(){t.clearAll();var e=-1,n=[void 0],r=t.observe("foo",function(t,r){e+=1,assert(n[e]==t),assert(n[e-1]==r)});t.unobserve(r),n.push("bar"),t.set("foo","bar"),t.observe("foo",function(t,r){e+=1,assert(n[e]==t),assert(n[e-1]==r)}),n.push("bar2"),t.set("foo","bar2"),assert(e+1==n.length)})}e.exports={plugin:t("./observe"),setup:r}},{"./observe":21}],23:[function(t,e,n){"use strict";function r(){function t(t,e,n,r,o,s){return a.call(this,"push",arguments)}function e(t,e){return a.call(this,"pop",arguments)}function n(t,e){return a.call(this,"shift",arguments)}function r(t,e,n,r,o,s){return a.call(this,"unshift",arguments)}function s(t,e,n,r,s,a){var c=i(arguments,2);return this.update(e,{},function(t){if("object"!=("undefined"==typeof t?"undefined":o(t)))throw new Error('store.assign called for non-object value with key "'+e+'"');return c.unshift(t),u.apply(Object,c)})}function a(t,e){var n,r=e[1],o=i(e,2);return this.update(r,[],function(e){n=Array.prototype[t].apply(e,o)}),n}return{push:t,pop:e,shift:n,unshift:r,assign:s}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=t("../src/util"),i=s.slice,u=s.assign,a=t("./update");e.exports=[a,r]},{"../src/util":30,"./update":25}],24:[function(t,e,n){"use strict";function r(t){function e(e,n,r){var o="test-"+e;t.set(o,n),n=n||[];var i=n[e],u=t[e];s(r,function(e){var r=i.apply(n,e),s=u.apply(t,[o].concat(e));assert(a(r,s));var c=t.get(o);assert(a(n,c))})}test("push",function(){e("push",[],[[],["a"],["b","c"],[null],[[],{}]])}),test("unshift",function(){e("unshift",void 0,[[],["a"],["b","c"],[null],[[],{}]])}),test("pop",function(){var t=["a","b","c",null,[[],{}]],n=i(t,function(){return[]}).concat([]);e("pop",t,n)}),test("shift",function(){var t=["a","b","c",null,[[],{}]],n=i(t,function(){return[]}).concat([]);e("shift",t,n)}),test("assign",function(){t.clearAll();var e={bar:"cat",mat:{hat:"bat",arr:[1,2,3]}};t.assign("foo",e),assert(a(t.get("foo"),e));var n={bar:"cat2",mat:{hat:"bat2"},newProp:"newProp"};t.assign("foo",n),s(n,function(t,n){e[n]=t}),assert(a(t.get("foo"),e))})}var o=t("../src/util"),s=o.each,i=o.map,u=t("../tests/util"),a=u.deepEqual;e.exports={plugin:t("./operations"),setup:r}},{"../src/util":30,"../tests/util":44,"./operations":23}],25:[function(t,e,n){"use strict";function r(){function t(t,e,n,r){3==arguments.length&&(r=n,n=void 0);var o=this.get(e,n),s=r(o);this.set(e,void 0!=s?s:o)}return{update:t}}e.exports=r},{}],26:[function(t,e,n){"use strict";function r(t){test("update",function(){t.set("foo",{cat:"mat"}),assert("mat"==t.get("foo").cat),t.update("foo",function(t){t.cat="mat2"}),assert("mat2"==t.get("foo").cat)}),test("update return value",function(){t.clearAll(),t.update("foo",function(t){return assert(void 0==t),{cat:"mat4"}}),assert("mat4"==t.get("foo").cat)}),test("update default value",function(){t.clearAll(),t.update("foo2",{},function(t){t.bar="cat"}),assert("cat"==t.get("foo2").bar)}),test("update default value + return",function(){t.clearAll(),t.update("foo2",[],function(t){return{bar2:"cat2"}}),assert("object"==o(t.get("foo2"))),assert(void 0==t.get("foo2").bar),assert("cat2"==t.get("foo2").bar2)})}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports={plugin:t("./update"),setup:r}},{"./update":25}],27:[function(t,e,n){"use strict";function r(){return this.disabled=!this.enabled,{has:o,transact:s,clear:i,forEach:u,getAll:a,serialize:c,deserialize:f}}function o(t,e){return void 0!==this.get(e)}function s(t,e,n,r){null==r&&(r=n,n=null),null==n&&(n={});var o=this.get(e,n),s=r(o);this.set(e,void 0===s?o:s)}function i(t){return this.clearAll.call(this)}function u(t,e){return this.each.call(this,function(t,n){e(n,t)})}function a(t){return this.dump.call(this)}function c(t,e){return JSON.stringify(e)}function f(t,e){if("string"==typeof e)try{return JSON.parse(e)}catch(n){return e||void 0}}var l=t("./dump"),p=t("./json2");e.exports=[l,p,r]},{"./dump":11,"./json2":17}],28:[function(t,e,n){"use strict";function r(t){test("backwards compatability with v1",function(){t.clear(),assert("boolean"==typeof t.disabled),assert("boolean"==typeof t.enabled),assert("string"==typeof t.version),assert("function"==typeof t.set),assert("function"==typeof t.get),assert("function"==typeof t.has),assert("function"==typeof t.remove),assert("function"==typeof t.clear),assert("function"==typeof t.transact),assert("function"==typeof t.getAll),assert("function"==typeof t.forEach),assert("function"==typeof t.serialize),assert("function"==typeof t.deserialize),t.transact("foosact",function(t){assert("object"==("undefined"==typeof t?"undefined":o(t)),"new key is not an object at beginning of transaction"),t.foo="foo"}),t.transact("foosact",function(t){assert("foo"==t.foo,"first transaction did not register"),t.bar="bar"}),assert("foo"==t.getAll().foosact.foo);var e=!1;t.forEach(function(t,n){e=!0,assert("foosact"==t),assert("foo"==n.foo)}),assert(e),assert("{}"==t.serialize({})),assert("bar"==t.get("foosact").bar,"second transaction did not register")})}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports={plugin:t("./v1-backcompat"),setup:r}},{"./v1-backcompat":27}],29:[function(t,e,n){"use strict";function r(){var t="undefined"==typeof console?null:console;if(t){var e=t.warn?t.warn:t.log;e.apply(t,arguments)}}function o(t,e,n){n||(n=""),t&&!l(t)&&(t=[t]),e&&!l(e)&&(e=[e]);var o=n?"__storejs_"+n+"_":"",s=n?new RegExp("^"+o):null,g=/^[a-zA-Z0-9_\-]*$/;if(!g.test(n))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var v={_namespacePrefix:o,_namespaceRegexp:s,_testStorage:function(t){try{var e="__storejs__test__";t.write(e,e);var n=t.read(e)===e;return t.remove(e),n}catch(r){return!1}},_assignPluginFnProp:function(t,e){var n=this[e];this[e]=function(){function e(){if(n)return a(arguments,function(t,e){r[e]=t}),n.apply(o,r)}var r=i(arguments,0),o=this,s=[e].concat(r);return t.apply(o,s)}},_serialize:function(t){return JSON.stringify(t)},_deserialize:function(t,e){if(!t)return e;var n="";try{n=JSON.parse(t)}catch(r){n=t}return void 0!==n?n:e},_addStorage:function(t){this.enabled||this._testStorage(t)&&(this.storage=t,this.enabled=!0)},_addPlugin:function(t){var e=this;if(l(t))return void a(t,function(t){e._addPlugin(t)});var n=u(this.plugins,function(e){return t===e});if(!n){if(this.plugins.push(t),!p(t))throw new Error("Plugins must be function values that return objects");var r=t.call(this);if(!d(r))throw new Error("Plugins must return an object of function properties");a(r,function(n,r){if(!p(n))throw new Error("Bad plugin property: "+r+" from plugin "+t.name+". Plugins should only return functions.");e._assignPluginFnProp(n,r)})}},addStorage:function(t){r("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(t)}},m=f(v,h,{plugins:[]});return m.raw={},a(m,function(t,e){p(t)&&(m.raw[e]=c(m,t))}),a(t,function(t){m._addStorage(t)}),a(e,function(t){m._addPlugin(t)}),m}var s=t("./util"),i=s.slice,u=s.pluck,a=s.each,c=s.bind,f=s.create,l=s.isList,p=s.isFunction,d=s.isObject;e.exports={createStore:o};var h={version:"2.0.12",enabled:!1,get:function(t,e){var n=this.storage.read(this._namespacePrefix+t);return this._deserialize(n,e)},set:function(t,e){return void 0===e?this.remove(t):(this.storage.write(this._namespacePrefix+t,this._serialize(e)),e)},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var e=this;this.storage.each(function(n,r){t.call(e,e._deserialize(n),(r||"").replace(e._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return o.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return o(this.storage,this.plugins,t)}}},{"./util":30}],30:[function(t,e,n){(function(t){"use strict";function n(){return Object.assign?Object.assign:function(t,e,n,r){for(var o=1;o=0;n--)if(l(e[n])){var r=e[n].split("="),o=unescape(r[0]),s=unescape(r[1]);t(s,o)}}function s(t,e){t&&(p.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function i(t){t&&a(t)&&(p.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function u(){o(function(t,e){i(e)})}function a(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(p.cookie)}var c=t("../src/util"),f=c.Global,l=c.trim;e.exports={name:"cookieStorage",read:r,write:s,each:o,remove:i,clearAll:u};var p=f.document},{"../src/util":30}],33:[function(t,e,n){"use strict";function r(){return f.localStorage}function o(t){return r().getItem(t)}function s(t,e){return r().setItem(t,e)}function i(t){for(var e=r().length-1;e>=0;e--){var n=r().key(e);t(o(n),n)}}function u(t){return r().removeItem(t)}function a(){return r().clear()}var c=t("../src/util"),f=c.Global;e.exports={name:"localStorage",read:o,write:s,each:i,remove:u,clearAll:a}},{"../src/util":30}],34:[function(t,e,n){"use strict";function r(t){return a[t]}function o(t,e){a[t]=e}function s(t){for(var e in a)a.hasOwnProperty(e)&&t(a[e],e)}function i(t){delete a[t]}function u(t){a={}}e.exports={name:"memoryStorage",read:r,write:o,each:s,remove:i,clearAll:u};var a={}},{}],35:[function(t,e,n){"use strict";function r(t){return f[t]}function o(t,e){f[t]=e}function s(t){for(var e=f.length-1;e>=0;e--){var n=f.key(e);t(f[n],n)}}function i(t){return f.removeItem(t)}function u(){s(function(t,e){delete f[t]})}var a=t("../src/util"),c=a.Global;e.exports={name:"oldFF-globalStorage",read:r,write:o,each:s,remove:i,clearAll:u};var f=c.globalStorage},{"../src/util":30}],36:[function(t,e,n){"use strict";function r(t,e){if(!g){var n=a(t);h(function(t){t.setAttribute(n,e),t.save(p)})}}function o(t){if(!g){var e=a(t),n=null;return h(function(t){n=t.getAttribute(e)}),n}}function s(t){h(function(e){for(var n=e.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var o=n[r];t(e.getAttribute(o.name),o.name)}})}function i(t){var e=a(t);h(function(t){t.removeAttribute(e),t.save(p)})}function u(){h(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(p);for(var n=e.length-1;n>=0;n--)t.removeAttribute(e[n].name);t.save(p)})}function a(t){return t.replace(/^\d/,"___$&").replace(v,"___")}function c(){if(!d||!d.documentElement||!d.documentElement.addBehavior)return null;var t,e,n,r="script";try{e=new ActiveXObject("htmlfile"),e.open(),e.write("<"+r+">document.w=window'),e.close(),t=e.w.frames[0].document,n=t.createElement("div")}catch(o){n=d.createElement("div"),t=d.body}return function(e){var r=[].slice.call(arguments,0);r.unshift(n),t.appendChild(n),n.addBehavior("#default#userData"),n.load(p),e.apply(this,r),t.removeChild(n)}}var f=t("../src/util"),l=f.Global;e.exports={name:"oldIE-userDataStorage",write:r,read:o,each:s,remove:i,clearAll:u};var p="storejs",d=l.document,h=c(),g=(l.navigator?l.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./),v=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g")},{"../src/util":30}],37:[function(t,e,n){"use strict";function r(){return f.sessionStorage}function o(t){return r().getItem(t)}function s(t,e){return r().setItem(t,e)}function i(t){for(var e=r().length-1;e>=0;e--){var n=r().key(e);t(o(n),n)}}function u(t){return r().removeItem(t)}function a(){return r().clear()}var c=t("../src/util"),f=c.Global;e.exports={name:"sessionStorage",read:o,write:s,each:i,remove:u,clearAll:a}},{"../src/util":30}],38:[function(t,e,n){"use strict";test.group("bugs",function(){test('gh-215: "Expire plugin doesn\'t factor custom namespaces"',function(){t("./gh-215")}),test('gh-235: "Expire and Events plugins conflict with each other"',function(){t("./gh-235")}),test('gh-236: "No supported storage has been added"',function(){t("./gh-236")}),test('gh-239: "No supported storage has been added! Add one"',function(){t("./gh-239")})})},{"./gh-215":39,"./gh-235":40,"./gh-236":41,"./gh-239":42}],39:[function(t,e,n){"use strict";var r=t("../../src/store-engine"),o=[t("../../storages/memoryStorage")],s=[t("../../plugins/expire")],i=r.createStore(o,s,""),u=i.namespace("store2"),a=i.namespace("store3"),c=10*Math.floor((new Date).getTime()/10),f=c+1001,l=null,p=c+3003,d="foo",h="bar";i.set(d,h,f),u.set(d,h,l),a.set(d,h,p),assert(i.getExpiration(d)==f),assert(u.getExpiration(d)==l),assert(a.getExpiration(d)==p)},{"../../plugins/expire":15,"../../src/store-engine":29,"../../storages/memoryStorage":34}],40:[function(t,e,n){"use strict";var r=t("../../src/store-engine"),o=r.createStore([t("../../storages/localStorage"),t("../../storages/memoryStorage")],[t("../../plugins/expire"),t("../../plugins/events")]);o.set("foo","bar",(new Date).getTime()-1),o.set("foo","bar"),o.set("foo","bar")},{"../../plugins/events":13,"../../plugins/expire":15,"../../src/store-engine":29,"../../storages/localStorage":33,"../../storages/memoryStorage":34}],41:[function(t,e,n){"use strict";var r=t("../..");r.get("token")},{"../..":1}],42:[function(t,e,n){"use strict";t("../..")},{"../..":1}],43:[function(t,e,n){"use strict";function r(){s(),p(d,function(t){test.group(t.name,function(){o(t)||test.skip("disabled"),test("Storage tests",function(){var e=f([t]);i(e)}),p(h,function(e,n){var r=e.plugin;test.group("plugin: "+n,function(){var n=f([t],[r]);e.setup(n)})})})}),t("./bugs/all"),a.runTests({failFast:!1})}function o(t){if(!t)return print("Skip unsupported storage:",t.name),!1;var e=f([t]);return!!e.enabled||(print("Skip disabled storage:",t.name),!1)}function s(t){test("Addon super_fn args",function(){function t(){return{set:function(t,e,n,o,s){assert("keyappended"==e),assert("val"==n),assert("overridden-customArg1"==o),assert("customArg2"==s),r++}}}function e(){return{set:function(t,e,n){t(e+"appended",n,"overridden-customArg1"),r++}}}var n=f(d.memoryStorage,[t,e]),r=0;n.set("key","val","customArg1","customArg2"),assert(2==r)})}function i(t){assert(t.enabled&&t.enabled,"store should be enabled"),t.clearAll(),t.get("unsetValue"),t.set("foo","bar"),assert("bar"==t.get("foo"),"stored key 'foo' not equal to stored value 'bar'"),t.remove("foo"),assert(void 0===t.get("foo"),"removed key 'foo' not undefined"),assert(void 0===t.get("foo"),"key 'foo' exists when it shouldn't"),assert("value"==t.set("foo","value"),"store#set returns the stored value"),assert(void 0!==t.get("foo"),"key 'foo' doesn't exist when it should"),t.set("foo","bar1"),t.set("foo","bar2"),assert("bar2"==t.get("foo"),"key 'foo' is not equal to second value set 'bar2'"),t.set("foo","bar"),t.set("bar","foo"),t.remove("foo"),assert(void 0===t.get("foo"),"key 'foo' exists when it shouldn't"),assert("foo"==t.get("bar"),"removing key 'foo' also removed key 'bar'"),t.set("foo","bar"),t.set("bar","foo"),t.clearAll(),assert(void 0===t.get("foo")&&void 0===t.get("bar"),"keys foo and bar not cleared after store cleared"),assert(123==t.get("defaultVal",123),"store.get should return default value"),t.set("foo",{name:"marcus",arr:[1,2,3]}),assert("object"==u(t.get("foo")),"type of stored object 'foo' is not 'object'"),assert(t.get("foo")instanceof Object,"stored object 'foo' is not an instance of Object"),assert("marcus"==t.get("foo").name,"property 'name' of stored object 'foo' is not 'marcus'"),assert(t.get("foo").arr instanceof Array,"Array property 'arr' of stored object 'foo' is not an instance of Array"),assert(3==t.get("foo").arr.length,"The length of Array property 'arr' stored on object 'foo' is not 3"),t.remove("circularReference");var e={},n={one:e};e.two=n;var r=!1;try{t.set("circularReference",e)}catch(o){r=!0}assert(r,"storing object with circular reference did not throw"),assert(!t.get("circularReference"),"attempting to store object with circular reference which should have faile affected store state");var s={"int":42,bool:!0,"float":3.141592653,string:"Don't Panic",odd_string:"{ZYX'} abc:;::)))"};for(var i in s)t.storage.write(i,s[i]),assert(t.get(i)==s[i],i+" was not correctly promoted to valid JSON"),t.remove(i);t.clearAll();var a=0;t.each(function(){a+=1}),assert(0===a)}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=t("tinytest");a.hijackConsoleLog();var c=t("../src/store-engine"),f=c.createStore,l=t("../src/util"),p=l.each,d=t("../storages/all"),h=t("../plugins/all_tests");e.exports={output:null,outputError:null,runTests:r,failed:!1}},{"../plugins/all_tests":6,"../src/store-engine":29,"../src/util":30,"../storages/all":31,"./bugs/all":38,tinytest:5}],44:[function(t,e,n){"use strict";function r(t,e){if(("undefined"==typeof t?"undefined":o(t))!=("undefined"==typeof e?"undefined":o(e)))return!1;if("object"!=("undefined"==typeof t?"undefined":o(t)))return t===e;var n;for(n in t)if(!r(t[n],e[n]))return!1;for(n in e)if(!r(e[n],t[n]))return!1;return!0}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports={deepEqual:r}},{}]},{},[2])(2)});