(function(factory){var registeredInModuleLoader=false;if(typeof define==='function'&&define.amd){define(['jquery','jquery/jquery.cookie'],factory);registeredInModuleLoader=true;} if(typeof exports==='object'){module.exports=factory();registeredInModuleLoader=true;} if(!registeredInModuleLoader){var OldStorages=window.Storages;var api=window.Storages=factory();api.noConflict=function(){window.Storages=OldStorages;return api;};}}(function(){var class2type={};var toString=class2type.toString;var hasOwn=class2type.hasOwnProperty;var fnToString=hasOwn.toString;var ObjectFunctionString=fnToString.call(Object);var getProto=Object.getPrototypeOf;var apis={};var cookie_local_prefix="ls_";var cookie_session_prefix="ss_";function _get(){var storage=this._type,l=arguments.length,s=window[storage],a=arguments,a0=a[0],vi,ret,tmp,i,j;if(l<1){throw new Error('Minimum 1 argument must be given');}else if(Array.isArray(a0)){ret={};for(i in a0){if(a0.hasOwnProperty(i)){vi=a0[i];try{ret[vi]=JSON.parse(s.getItem(vi));}catch(e){ret[vi]=s.getItem(vi);}}} return ret;}else if(l==1){try{return JSON.parse(s.getItem(a0));}catch(e){return s.getItem(a0);}}else{try{ret=JSON.parse(s.getItem(a0));if(!ret){throw new ReferenceError(a0+' is not defined in this storage');}}catch(e){throw new ReferenceError(a0+' is not defined in this storage');} for(i=1;i0){o=_get.apply(this,arguments);}else{o=s;} if(o&&o._cookie){var cookies=Cookies.get();for(var key in cookies){if(cookies.hasOwnProperty(key)&&key!=''){keys.push(key.replace(o._prefix,''));}}}else{for(var i in o){if(o.hasOwnProperty(i)){keys.push(i);}}} return keys;} function _createNamespace(name){if(!name||typeof name!="string"){throw new Error('First parameter must be a string');} if(storage_available){if(!window.localStorage.getItem(name)){window.localStorage.setItem(name,'{}');} if(!window.sessionStorage.getItem(name)){window.sessionStorage.setItem(name,'{}');}}else{if(!window.localCookieStorage.getItem(name)){window.localCookieStorage.setItem(name,'{}');} if(!window.sessionCookieStorage.getItem(name)){window.sessionCookieStorage.setItem(name,'{}');}} var ns={localStorage:_extend({},apis.localStorage,{_ns:name}),sessionStorage:_extend({},apis.sessionStorage,{_ns:name})};if(cookies_available){if(!window.cookieStorage.getItem(name)){window.cookieStorage.setItem(name,'{}');} ns.cookieStorage=_extend({},apis.cookieStorage,{_ns:name});} apis.namespaceStorages[name]=ns;return ns;} function _testStorage(name){var foo='jsapi';try{if(!window[name]){return false;} window[name].setItem(foo,foo);window[name].removeItem(foo);return true;}catch(e){return false;}} function _isPlainObject(obj){var proto,Ctor;if(!obj||toString.call(obj)!=="[object Object]"){return false;} proto=getProto(obj);if(!proto){return true;} Ctor=hasOwn.call(proto,"constructor")&&proto.constructor;return typeof Ctor==="function"&&fnToString.call(Ctor)===ObjectFunctionString;} function _isEmptyObject(obj){var name;for(name in obj){return false;} return true;} function _extend(){var i=1;var result=arguments[0];for(;i