/*! ngstorage 0.3.10 | Copyright (c) 2016 Gias Kay Lee | MIT License */!function(a,b){"use strict";"function"==typeofdefine&&define.amd?define(["angular"],b):a.hasOwnProperty("angular")?b(a.angular):"object"==typeofexports&&(module.exports=b(require("angular")))}(this,function(a){"use strict";functionb(a,b){varc;try{c=a[b]}catch(d){c=!1}if(c){vare="__"+Math.round(1e7*Math.random());try{a[b].setItem(e,e),a[b].removeItem(e,e)}catch(d){c=!1}}returnc}functionc(c){vard=b(window,c);returnfunction(){vare="ngStorage-";this.setKeyPrefix=function(a){if("string"!=typeofa)thrownewTypeError("[ngStorage] - "+c+"Provider.setKeyPrefix() expects a String.");e=a};varf=a.toJson,g=a.fromJson;this.setSerializer=function(a){if("function"!=typeofa)thrownewTypeError("[ngStorage] - "+c+"Provider.setSerializer expects a function.");f=a},this.setDeserializer=function(a){if("function"!=typeofa)thrownewTypeError("[ngStorage] - "+c+"Provider.setDeserializer expects a function.");g=a},this.supported=function(){return!!d},this.get=function(a){returnd&&g(d.getItem(e+a))},this.set=function(a,b){returnd&&d.setItem(e+a,f(b))},this.remove=function(a){d&&d.removeItem(e+a)},this.$get=["$rootScope","$window","$log","$timeout","$document",function(d,h,i,j,k){varl,m,n=e.length,o=b(h,c),p=o||(i.warn("This browser does not support Web Storage!"),{setItem:a.noop,getItem:a.noop,removeItem:a.noop}),q={$default:function(b){for(varcinb)a.isDefined(q[c])||(q[c]=a.copy(b[c]));returnq.$sync(),q},$reset:function(a){for(varbinq)"$"===b[0]||deleteq[b]&&p.removeItem(e+b);returnq.$default(a)},$sync:function(){for(vara,b=0,c=p.length;c>b;b++)(a=p.key(b))&&e===a.slice(0,n)&&(q[a.slice(n)]=g(p.getItem(a)))},$apply:function(){varb;if(m=null,!a.equals(q,l)){b=a.copy(l),a.forEach(q,function(c,d){a.isDefined(c)&&"$"!==d[0]&&(p.setItem(e+d,f(c)),deleteb[d])});for(varcinb)p.removeItem(e+c);l=a.copy(q)}},$supported:function(){return!!o}};returnq.$sync(),l=a.copy(q),d.$watch(function(){m||(m=j(q.$apply,100,!1))}),h.addEventListener&&h.addEventListener("storage",function(b){if(b.key){varc=k[0];c.hasFocus&&c.hasFocus()||e!==b.key.slice(0,n)||(b.newValue?q[b.key.slice(n)]=g(b.newValue):deleteq[b.key.slice(n)],l=a.copy(q),d.$apply())}}),h.addEventListener&&h.addEventListener("beforeunload",function(){q.$apply()}),q}]}}returna=a&&a.module?a:window.angular,a.module("ngStorage",[]).provider("$localStorage",c("localStorage")).provider("$sessionStorage",c("sessionStorage"))});