Files
standardnotes-app-web/dist/javascripts/app.js

30 lines
832 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=72)}([function(e,t,n){e.exports=n(43)},function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=247)}([function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(){var e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},i=r.lib={},o=i.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(o=0;o<i;o+=4)t[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],i=function(t){t=t;var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o<t;o+=4){var s=i(4294967296*(n||e.random()));n=987654071*s(),r.push(4294967296*s()|0)}return new a.init(r,t)}}),s=r.enc={},c=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new a.init(n,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new a.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},f=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,s=i/(4*o),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,u=e.min(4*c,i);if(c){for(var l=0;l<c;l+=o)this._doProcessBlock(r,l);var f=r.splice(0,c);n.sigBytes-=u}return new a.init(f,u)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),d=(i.Hasher=f.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new d.HMAC.init(e,n).finalize(t)}}}),r.algo={});return r}(Math);return e},"object"===s(t)?e.exports=t=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,o=r.WordArray,a=r.BufferedBlockAlgorithm,s=n.enc,c=(s.Utf8,s.Base64),u=n.algo.EvpKDF,l=r.Cipher=a.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()}),f=(r.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),n.mode={}),d=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=f.CBC=function(){var e=d.extend();function n(e,n,r){var i=this._iv;if(i){var o=i;this._iv=t}else o=this._prevBlock;for(var a=0;a<r;a++)e[n+a]^=o[a]}return e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,o=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=o}}),e}(),h=(n.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,a=[],s=0;s<r;s+=4)a.push(i);var c=o.create(a,r);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},v=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:p,padding:h}),reset:function(){l.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else r=n.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==r?this._mode.init(this,t&&t.words):(this._mode=r.call(n,this,t&&t.words),this._mode.__creator=r)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4}),r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),m=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=o.create([1398893684,1701076831]).concat(n).concat(t);else r=t;return r.toString(c)},parse:function(e){var t=c.parse(e),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var r=o.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return v.create({ciphertext:t,salt:r})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),a=i.cfg;return v.create({ciphertext:o,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),g=(n.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=o.random(8));var i=u.create({keySize:t+n}).compute(e,r),a=o.create(i.words.slice(t),4*n);return i.sigBytes=4*t,v.create({key:i,iv:a,salt:r})}},b=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:g}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var o=y.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()},"object"===s(t)?e.exports=t=a(n(0),n(7)):(i=[n(0),n(7)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r=n(31),i=n(192);e.exports=function(e,t){var n=[];if(!e||!e.length)return n;var o=-1,a=[],s=e.length;for(t=r(t,3);++o<s;){var c=e[o];t(c,o,e)&&(n.push(c),a.push(o))}return i(e,a),n}},function(e,t,n){var r=n(128)(n(189));e.exports=r},function(e,t,n){var r=n(119)(n(234));e.exports=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";(function(e){function r(){return"undefined"!=typeof window?window:void 0!==e?e:null}function i(){return null!==r()}function o(){return!("undefined"!=typeof document&&document.documentMode||/Edge/.test(navigator.userAgent))&&r().crypto&&r().crypto.subtle}function a(){var e=r(),t=e.crypto||e.msCrypto;if(t){var n=new Uint32Array(4);t.getRandomValues(n);var i=-1;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){i++;var t=n[i>>3]>>i%8*4&15;return("x"==e?t:3&t|8).toString(16)}))}var o=(new Date).getTime();return e.performance&&"function"==typeof e.performance.now&&(o+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(o+16*Math.random())%16|0;return o=Math.floor(o/16),("x"==e?t:3&t|8).toString(16)}))}n.d(t,"b",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a}))}).call(this,n(89))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n,r,i,o,a,s;return r=(n=(t=e).lib).Base,i=n.WordArray,a=(o=t.algo).MD5,s=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=n.hasher.create(),o=i.create(),a=o.words,s=n.keySize,c=n.iterations;a.length<s;){u&&r.update(u);var u=r.update(e).finalize(t);r.reset();for(var l=1;l<c;l++)u=r.finalize(u),r.reset();o.concat(u)}return o.sigBytes=4*s,o}}),t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)},e.EvpKDF},"object"===s(t)?e.exports=t=a(n(0),n(19),n(20)):(i=[n(0),n(19),n(20)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n;return n=(t=e).lib.WordArray,t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)i.push(r.charAt(a>>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<r.length;o++)i[r.charCodeAt(o)]=o}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return function(e,t,r){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=r[e.charCodeAt(a-1)]<<a%4*2,c=r[e.charCodeAt(a)]>>>6-a%4*2;i[o>>>2]|=(s|c)<<24-o%4*8,o++}return n.create(i,o)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===s(t)?e.exports=t=a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,a=n.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],p=e[t+2],h=e[t+3],v=e[t+4],m=e[t+5],y=e[t+6],g=e[t+7],b=e[t+8],w=e[t+9],k=e[t+10],x=e[t+11],$=e[t+12],_=e[t+13],S=e[t+14],M=e[t+15],C=o[0],A=o[1],I=o[2],E=o[3];C=u(C,A,I,E,a,7,s[0]),E=u(E,C,A,I,c,12,s[1]),I=u(I,E,C,A,p,17,s[2]),A=u(A,I,E,C,h,22,s[3]),C=u(C,A,I,E,v,7,s[4]),E=u(E,C,A,I,m,12,s[5]),I=u(I,E,C,A,y,17,s[6]),A=u(A,I,E,C,g,22,s[7]),C=u(C,A,I,E,b,7,s[8]),E=u(E,C,A,I,w,12,s[9]),I=u(I,E,C,A,k,17,s[10]),A=u(A,I,E,C,x,22,s[11]),C=u(C,A,I,E,$,7,s[12]),E=u(E,C,A,I,_,12,s[13]),I=u(I,E,C,A,S,17,s[14]),C=l(C,A=u(A,I,E,C,M,22,s[15]),I,E,c,5,s[16]),E=l(E,C,A,I,y,9,s[17]),I=l(I,E,C,A,x,14,s[18]),A=l(A,I,E,C,a,20,s[19]),C=l(C,A,I,E,m,5,s[20]),E=l(E,C,A,I,k,9,s[21]),I=l(I,E,C,A,M,14,s[22]),A=l(A,I,E,C,v,20,s[23]),C=l(C,A,I,E,w,5,s[24]),E=l(E,C,A,I,S,9,s[25]),I=l(I,E,C,A,h,14,s[26]),A=l(A,I,E,C,b,20,s[27]),C=l(C,A,I,E,_,5,s[28]),E=l(E,C,A,I,p,9,s[29]),I=l(I,E,C,A,g,14,s[30]),C=f(C,A=l(A,I,E,C,$,20,s[31]),I,E,m,4,s[32]),E=f(E,C,A,I,b,11,s[33]),I=f(I,E,C,A,x,16,s[34]),A=f(A,I,E,C,S,23,s[35]),C=f(C,A,I,E,c,4,s[36]),E=f(E,C,A,I,v,11,s[37]),I=f(I,E,C,A,g,16,s[38]),A=f(A,I,E,C,k,23,s[39]),C=f(C,A,I,E,_,4,s[40]),E=f(E,C,A,I,a,11,s[41]),I=f(I,E,C,A,h,16,s[42]),A=f(A,I,E,C,y,23,s[43]),C=f(C,A,I,E,w,4,s[44]),E=f(E,C,A,I,$,11,s[45]),I=f(I,E,C,A,M,16,s[46]),C=d(C,A=f(A,I,E,C,p,23,s[47]),I,E,a,6,s[48]),E=d(E,C,A,I,g,10,s[49]),I=d(I,E,C,A,S,15,s[50]),A=d(A,I,E,C,m,21,s[51]),C=d(C,A,I,E,$,6,s[52]),E=d(E,C,A,I,h,10,s[53]),I=d(I,E,C,A,k,15,s[54]),A=d(A,I,E,C,c,21,s[55]),C=d(C,A,I,E,b,6,s[56]),E=d(E,C,A,I,M,10,s[57]),I=d(I,E,C,A,y,15,s[58]),A=d(A,I,E,C,_,21,s[59]),C=d(C,A,I,E,v,6,s[60]),E=d(E,C,A,I,x,10,s[61]),I=d(I,E,C,A,p,15,s[62]),A=d(A,I,E,C,w,21,s[63]),o[0]=o[0]+C|0,o[1]=o[1]+A|0,o[2]=o[2]+I|0,o[3]=o[3]+E|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+i+a;return(s<<o|s>>>32-o)+t}function l(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+i+a;return(s<<o|s>>>32-o)+t}function f(e,t,n,r,i,o,a){var s=e+(t^n^r)+i+a;return(s<<o|s>>>32-o)+t}function d(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+i+a;return(s<<o|s>>>32-o)+t}n.MD5=o._createHelper(c),n.HmacMD5=o._createHmacHelper(c)}(Math),e.MD5},"object"===s(t)?e.exports=t=a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){var t=n(e);return null!=e&&("object"==t||"function"==t)}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(90),o="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,a=i||o||Function("return this")();e.exports=a},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return null!=e&&"object"==n(e)}},function(e,t,n){var r=n(109),i=n(118)((function(e,t,n){r(e,t,n)}));e.exports=i},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n,r,i,o;return n=(t=e).lib,r=n.Base,i=n.WordArray,(o=t.x64={}).Word=r.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var o=e[r];n.push(o.high),n.push(o.low)}return i.create(n,this.sigBytes)},clone:function(){for(var e=r.clone.call(this),t=e.words=this.words.slice(0),n=t.length,i=0;i<n;i++)t[i]=t[i].clone();return e}}),e},"object"===s(t)?e.exports=t=a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r=n(46),i=n(53);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){var r=n(141),i=n(146);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(21),i=n(142),o=n(143),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t,n){var r=n(100),i=n(171),o=n(15);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n,r,i,o,a,s;return n=(t=e).lib,r=n.WordArray,i=n.Hasher,o=t.algo,a=[],s=o.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],c=n[4],u=0;u<80;u++){if(u<16)a[u]=0|e[t+u];else{var l=a[u-3]^a[u-8]^a[u-14]^a[u-16];a[u]=l<<1|l>>>31}var f=(r<<5|r>>>27)+c+a[u];f+=u<20?1518500249+(i&o|~i&s):u<40?1859775393+(i^o^s):u<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,c=s,s=o,o=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s),e.SHA1},"object"===s(t)?e.exports=t=a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n,r;n=(t=e).lib.Base,r=t.enc.Utf8,t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),a=this._iKey=t.clone(),s=o.words,c=a.words,u=0;u<n;u++)s[u]^=1549556828,c[u]^=909522486;o.sigBytes=a.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})},"object"===s(t)?e.exports=t=a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r=n(11).Symbol;e.exports=r},function(e,t,n){var r=n(5),i=n(56),o=n(179),a=n(182);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t,n){var r=n(42);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(62),i=n(58);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var u=t[s],l=o?o(n[u],e[u],u,n,e):void 0;void 0===l&&(l=e[u]),a?i(n,u,l):r(n,u,l)}return n}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var i=n(e);return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},function(e,t,n){var r=n(239);e.exports=function(e){return e&&e.length?r(e):[]}},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,a=n.algo,s=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),c[i]=n(t.pow(r,1/3)),i++),r++}();var u=[],l=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],f=n[6],d=n[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],v=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=u[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=v+u[p-7]+y+u[p-16]}var g=r&i^r&o^i&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&f)+c[p]+u[p];d=f,f=l,l=s,s=a+w|0,a=o,o=i,i=r,r=w+(b+g)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+d|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=o._createHelper(l),n.HmacSHA256=o._createHmacHelper(l)}(Math),e.SHA256},"object"===s(t)?e.exports=t=a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(){var t=e,n=t.lib.Hasher,r=t.x64,i=r.Word,o=r.WordArray,a=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var l=a.SHA512=n.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],f=n[6],d=n[7],p=r.high,h=r.low,v=i.high,m=i.low,y=o.high,g=o.low,b=a.high,w=a.low,k=s.high,x=s.low,$=l.high,_=l.low,S=f.high,M=f.low,C=d.high,A=d.low,I=p,E=h,O=v,D=m,R=y,P=g,T=b,j=w,F=k,N=x,L=$,U=_,B=S,H=M,z=C,V=A,W=0;W<80;W++){var K=u[W];if(W<16)var q=K.high=0|e[t+2*W],J=K.low=0|e[t+2*W+1];else{var G=u[W-15],Y=G.high,Z=G.low,X=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,Q=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),ee=u[W-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),oe=u[W-7],ae=oe.high,se=oe.low,ce=u[W-16],ue=ce.high,le=ce.low;q=(q=(q=X+ae+((J=Q+se)>>>0<Q>>>0?1:0))+re+((J+=ie)>>>0<ie>>>0?1:0))+ue+((J+=le)>>>0<le>>>0?1:0),K.high=q,K.low=J}var fe,de=F&L^~F&B,pe=N&U^~N&H,he=I&O^I&R^O&R,ve=E&D^E&P^D&P,me=(I>>>28|E<<4)^(I<<30|E>>>2)^(I<<25|E>>>7),ye=(E>>>28|I<<4)^(E<<30|I>>>2)^(E<<25|I>>>7),ge=(F>>>14|N<<18)^(F>>>18|N<<14)^(F<<23|N>>>9),be=(N>>>14|F<<18)^(N>>>18|F<<14)^(N<<23|F>>>9),we=c[W],ke=we.high,xe=we.low,$e=z+ge+((fe=V+be)>>>0<V>>>0?1:0),_e=ye+ve;z=B,V=H,B=L,H=U,L=F,U=N,F=T+($e=($e=($e=$e+de+((fe+=pe)>>>0<pe>>>0?1:0))+ke+((fe+=xe)>>>0<xe>>>0?1:0))+q+((fe+=J)>>>0<J>>>0?1:0))+((N=j+fe|0)>>>0<j>>>0?1:0)|0,T=R,j=P,R=O,P=D,O=I,D=E,I=$e+(me+he+(_e>>>0<ye>>>0?1:0))+((E=fe+_e|0)>>>0<fe>>>0?1:0)|0}h=r.low=h+E,r.high=p+I+(h>>>0<E>>>0?1:0),m=i.low=m+D,i.high=v+O+(m>>>0<D>>>0?1:0),g=o.low=g+P,o.high=y+R+(g>>>0<P>>>0?1:0),w=a.low=w+j,a.high=b+T+(w>>>0<j>>>0?1:0),x=s.low=x+N,s.high=k+F+(x>>>0<N>>>0?1:0),_=l.low=_+U,l.high=$+L+(_>>>0<U>>>0?1:0),M=f.low=M+H,f.high=S+B+(M>>>0<H>>>0?1:0),A=d.low=A+V,d.high=C+z+(A>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=n._createHelper(l),t.HmacSHA512=n._createHmacHelper(l)}(),e.SHA512},"object"===s(t)?e.exports=t=a(n(0),n(14)):(i=[n(0),n(14)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(129),o=n(177),a=n(57),s=n(5),c=n(186);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==r(e)?s(e)?o(e[0],e[1]):i(e):c(e)}},function(e,t,n){var r=n(33),i=n(136),o=n(137),a=n(138),s=n(139),c=n(140);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(131),i=n(132),o=n(133),a=n(134),s=n(135);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=s,e.exports=c},function(e,t,n){var r=n(25);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(16)(Object,"create");e.exports=r},function(e,t,n){var r=n(155);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(168),i=n(12),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},function(e,t,n){(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(11),o=n(169),a="object"==r(t)&&t&&!t.nodeType&&t,s=a&&"object"==r(e)&&e&&!e.nodeType&&e,c=s&&s.exports===a?i.Buffer:void 0,u=(c?c.isBuffer:void 0)||o;e.exports=u}).call(this,n(51)(e))},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){var r=n(173),i=n(45),o=n(174),a=n(102),s=n(175),c=n(17),u=n(91),l=u(r),f=u(i),d=u(o),p=u(a),h=u(s),v=c;(r&&"[object DataView]"!=v(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=v(new i)||o&&"[object Promise]"!=v(o.resolve())||a&&"[object Set]"!=v(new a)||s&&"[object WeakMap]"!=v(new s))&&(v=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case l:return"[object DataView]";case f:return"[object Map]";case d:return"[object Promise]";case p:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=v},function(e,t,n){var r=n(22),i=n(23);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(17),o=n(12);e.exports=function(e){return"symbol"==r(e)||o(e)&&"[object Symbol]"==i(e)}},function(e,t,n){var r=n(100),i=n(201),o=n(15);e.exports=function(e){return o(e)?r(e,!0):i(e)}},function(e,t,n){var r=n(27),i=n(208),o=n(108),a=n(22),s=n(24),c=n(223),u=n(124),l=n(123),f=u((function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,(function(t){return t=a(t,e),u||(u=t.length>1),t})),s(e,l(e),n),u&&(n=i(n,7,c));for(var f=t.length;f--;)o(n,t[f]);return n}));e.exports=f},function(e,t,n){var r=n(16)(n(11),"Map");e.exports=r},function(e,t,n){var r=n(17),i=n(10);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(147),i=n(154),o=n(156),a=n(157),s=n(158);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=s,e.exports=c},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},function(e,t,n){var r=n(166),i=n(99),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(170),i=n(39),o=n(54),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(90),o="object"==r(t)&&t&&!t.nodeType&&t,a=o&&"object"==r(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o&&i.process,c=function(){try{return a&&a.require&&a.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=c}).call(this,n(51)(e))},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(5),o=n(42),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(i(e))return!1;var n=r(e);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||s.test(e)||!a.test(e)||null!=t&&e in Object(t)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(111);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(96);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(101)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(58),i=n(25),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(106),i=n(236),o=n(237);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},function(e,t,n){var r=n(63),i=n(15),o=n(244),a=n(107),s=n(245),c=Math.max;e.exports=function(e,t,n,u){e=i(e)?e:s(e),n=n&&!u?a(n):0;var l=e.length;return n<0&&(n=c(l+n,0)),o(e)?n<=l&&e.indexOf(t,n)>-1:!!l&&r(e,t,n)>-1}},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return e},"object"===s(t)?e.exports=t=a(n(0),n(14),n(66),n(67),n(8),n(9),n(19),n(29),n(68),n(30),n(69),n(70),n(71),n(20),n(72),n(7),n(1),n(73),n(74),n(75),n(76),n(77),n(78),n(79),n(80),n(81),n(82),n(83),n(84),n(85),n(86),n(87),n(88)):(i=[n(0),n(14),n(66),n(67),n(8),n(9),n(19),n(29),n(68),n(30),n(69),n(70),n(71),n(20),n(72),n(7),n(1),n(73),n(74),n(75),n(76),n(77),n(78),n(79),n(80),n(81),n(82),n(83),n(84),n(85),n(86),n(87),n(88)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,n=t.init;(t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],i=0;i<t;i++)r[i>>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=t}}(),e.lib.WordArray},"object"===s(t)?e.exports=t=a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(){var t=e,n=t.lib.WordArray,r=t.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var o=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o+=2){var a=i(t[o>>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,r=[],o=0;o<t;o++)r[o>>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return n.create(r,2*t)}}}(),e.enc.Utf16},"object"===s(t)?e.exports=t=a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n,r,i,o;return n=(t=e).lib.WordArray,r=t.algo,i=r.SHA256,o=r.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}}),t.SHA224=i._createHelper(o),t.HmacSHA224=i._createHmacHelper(o),e.SHA224},"object"===s(t)?e.exports=t=a(n(0),n(29)):(i=[n(0),n(29)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n,r,i,o,a,s;return n=(t=e).x64,r=n.Word,i=n.WordArray,o=t.algo,a=o.SHA512,s=o.SHA384=a.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=a._createHelper(s),t.HmacSHA384=a._createHmacHelper(s),e.SHA384},"object"===s(t)?e.exports=t=a(n(0),n(14),n(30)):(i=[n(0),n(14),n(30)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,a=n.x64.Word,s=n.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,f=0,d=0;d<7;d++){if(1&i){var p=(1<<d)-1;p<32?f^=1<<p:s^=1<<p-32}128&i?i=i<<1^113:i<<=1}l[o]=a.create(s,f)}}();var f=[];!function(){for(var e=0;e<25;e++)f[e]=a.create()}();var d=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var o=e[t+2*i],a=e[t+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(A=n[i]).high^=a,A.low^=o}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var p=0,h=0,v=0;v<5;v++)p^=(A=n[d+5*v]).high,h^=A.low;var m=f[d];m.high=p,m.low=h}for(d=0;d<5;d++){var y=f[(d+4)%5],g=f[(d+1)%5],b=g.high,w=g.low;for(p=y.high^(b<<1|w>>>31),h=y.low^(w<<1|b>>>31),v=0;v<5;v++)(A=n[d+5*v]).high^=p,A.low^=h}for(var k=1;k<25;k++){var x=(A=n[k]).high,$=A.low,_=c[k];_<32?(p=x<<_|$>>>32-_,h=$<<_|x>>>32-_):(p=$<<_-32|x>>>64-_,h=x<<_-32|$>>>64-_);var S=f[u[k]];S.high=p,S.low=h}var M=f[0],C=n[0];for(M.high=C.high,M.low=C.low,d=0;d<5;d++)for(v=0;v<5;v++){var A=n[k=d+5*v],I=f[k],E=f[(d+1)%5+5*v],O=f[(d+2)%5+5*v];A.high=I.high^~E.high&O.high,A.low=I.low^~E.low&O.low}A=n[0];var D=l[s];A.high^=D.high,A.low^=D.low}},_doFinalize:function(){var e=this._data,n=e.words,r=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l<c;l++){var f=a[l],d=f.high,p=f.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(d)}return new i.init(u,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=o._createHelper(d),n.HmacSHA3=o._createHmacHelper(d)}(Math),e.SHA3},"object"===s(t)?e.exports=t=a(n(0),n(14)):(i=[n(0),n(14)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){
/** @preserve
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,a=n.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,p,w,k,x,$,_,S,M,C,A=this._hash.words,I=f.words,E=d.words,O=s.words,D=c.words,R=u.words,P=l.words;for(x=o=A[0],$=a=A[1],_=p=A[2],S=w=A[3],M=k=A[4],n=0;n<80;n+=1)C=o+e[t+O[n]]|0,C+=n<16?h(a,p,w)+I[0]:n<32?v(a,p,w)+I[1]:n<48?m(a,p,w)+I[2]:n<64?y(a,p,w)+I[3]:g(a,p,w)+I[4],C=(C=b(C|=0,R[n]))+k|0,o=k,k=w,w=b(p,10),p=a,a=C,C=x+e[t+D[n]]|0,C+=n<16?g($,_,S)+E[0]:n<32?y($,_,S)+E[1]:n<48?m($,_,S)+E[2]:n<64?v($,_,S)+E[3]:h($,_,S)+E[4],C=(C=b(C|=0,P[n]))+M|0,x=M,M=S,S=b(_,10),_=$,$=C;C=A[1]+p+S|0,A[1]=A[2]+w+M|0,A[2]=A[3]+k+x|0,A[3]=A[4]+o+$|0,A[4]=A[0]+a+_|0,A[0]=C},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function h(e,t,n){return e^t^n}function v(e,t,n){return e&t|~e&n}function m(e,t,n){return(e|~t)^n}function y(e,t,n){return e&n|t&~n}function g(e,t,n){return e^(t|~n)}function b(e,t){return e<<t|e>>>32-t}n.RIPEMD160=o._createHelper(p),n.HmacRIPEMD160=o._createHmacHelper(p)}(Math),e.RIPEMD160},"object"===s(t)?e.exports=t=a(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n,r,i,o,a,s,c;return r=(n=(t=e).lib).Base,i=n.WordArray,a=(o=t.algo).SHA1,s=o.HMAC,c=o.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=s.create(n.hasher,e),o=i.create(),a=i.create([1]),c=o.words,u=a.words,l=n.keySize,f=n.iterations;c.length<l;){var d=r.update(t).finalize(a);r.reset();for(var p=d.words,h=p.length,v=d,m=1;m<f;m++){v=r.finalize(v),r.reset();for(var y=v.words,g=0;g<h;g++)p[g]^=y[g]}o.concat(d),u[0]++}return o.sigBytes=4*l,o}}),t.PBKDF2=function(e,t,n){return c.create(n).compute(e,t)},e.PBKDF2},"object"===s(t)?e.exports=t=a(n(0),n(19),n(20)):(i=[n(0),n(19),n(20)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function n(e,t,n,r){var i=this._iv;if(i){var o=i.slice(0);this._iv=void 0}else o=this._prevBlock;r.encryptBlock(o,0);for(var a=0;a<n;a++)e[t+a]^=o[a]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i,r),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,o=e.slice(t,t+i);n.call(this,e,t,i,r),this._prevBlock=o}}),t}(),e.mode.CFB},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n;return e.mode.CTR=(n=(t=e.lib.BlockCipherMode.extend()).Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0);var a=o.slice(0);n.encryptBlock(a,0),o[r-1]=o[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=a[s]}}),t.Decryptor=n,t),e.mode.CTR},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){
/** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*/
return e.mode.CTRGladman=function(){var t=e.lib.BlockCipherMode.extend();function n(e){if(255==(e>>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var r=t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=n(e[0]))&&(e[1]=n(e[1]))}(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c<i;c++)e[t+c]^=s[c]}});return t.Decryptor=r,t}(),e.mode.CTRGladman},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n;return e.mode.OFB=(n=(t=e.lib.BlockCipherMode.extend()).Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,o=this._keystream;i&&(o=this._keystream=i.slice(0),this._iv=void 0),n.encryptBlock(o,0);for(var a=0;a<r;a++)e[t+a]^=o[a]}}),t.Decryptor=n,t),e.mode.OFB},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t;return e.mode.ECB=((t=e.lib.BlockCipherMode.extend()).Encryptor=t.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),t),e.mode.ECB},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return e.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=4*t,i=r-n%r,o=n+i-1;e.clamp(),e.words[o>>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return e.pad.Iso10126={pad:function(t,n){var r=4*n,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){for(var t=e.words,n=e.sigBytes-1;!(t[n>>>2]>>>24-n%4*8&255);)n--;e.sigBytes=n+1}},e.pad.ZeroPadding},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){var t,n,r;return n=(t=e).lib.CipherParams,r=t.enc.Hex,t.format.Hex={stringify:function(e){return e.ciphertext.toString(r)},parse:function(e){var t=r.parse(e);return n.create({ciphertext:t})}},e.format.Hex},"object"===s(t)?e.exports=t=a(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(){var t=e,n=t.lib.BlockCipher,r=t.algo,i=[],o=[],a=[],s=[],c=[],u=[],l=[],f=[],d=[],p=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var h=r^r<<1^r<<2^r<<3^r<<4;h=h>>>8^255&h^99,i[n]=h,o[h]=n;var v=e[n],m=e[v],y=e[m],g=257*e[h]^16843008*h;a[n]=g<<24|g>>>8,s[n]=g<<16|g>>>16,c[n]=g<<8|g>>>24,u[n]=g,g=16843009*y^65537*m^257*v^16843008*n,l[h]=g<<24|g>>>8,f[h]=g<<16|g>>>16,d[h]=g<<8|g>>>24,p[h]=g,n?(n=v^e[e[e[y^v]]],r^=e[e[r]]):n=r=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],v=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a<r;a++)if(a<n)o[a]=t[a];else{var s=o[a-1];a%n?n>6&&a%n==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=h[a/n|0]<<24),o[a]=o[a-n]^s}for(var c=this._invKeySchedule=[],u=0;u<r;u++)a=r-u,s=u%4?o[a]:o[a-4],c[u]=u<4||a<=4?s:l[i[s>>>24]]^f[i[s>>>16&255]]^d[i[s>>>8&255]]^p[i[255&s]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,f,d,p,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,a,s){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],f=e[t+2]^n[2],d=e[t+3]^n[3],p=4,h=1;h<c;h++){var v=r[u>>>24]^i[l>>>16&255]^o[f>>>8&255]^a[255&d]^n[p++],m=r[l>>>24]^i[f>>>16&255]^o[d>>>8&255]^a[255&u]^n[p++],y=r[f>>>24]^i[d>>>16&255]^o[u>>>8&255]^a[255&l]^n[p++],g=r[d>>>24]^i[u>>>16&255]^o[l>>>8&255]^a[255&f]^n[p++];u=v,l=m,f=y,d=g}v=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&d])^n[p++],m=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[d>>>8&255]<<8|s[255&u])^n[p++],y=(s[f>>>24]<<24|s[d>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^n[p++],g=(s[d>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^n[p++],e[t]=v,e[t+1]=m,e[t+2]=y,e[t+3]=g},keySize:8});t.AES=n._createHelper(v)}(),e.AES},"object"===s(t)?e.exports=t=a(n(0),n(8),n(9),n(7),n(1)):(i=[n(0),n(8),n(9),n(7),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.BlockCipher,o=t.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=a[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var u=i[o]=[],l=c[o];for(n=0;n<24;n++)u[n/6|0]|=t[(s[n]-1+l)%28]<<31-n%6,u[4+(n/6|0)]|=t[28+(s[n+24]-1+l)%28]<<31-n%6;for(u[0]=u[0]<<1|u[0]>>>31,n=1;n<7;n++)u[n]=u[n]>>>4*(n-1)+3;u[7]=u[7]<<5|u[7]>>>27}var f=this._invSubKeys=[];for(n=0;n<16;n++)f[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],d.call(this,4,252645135),d.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),d.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],o=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^i[c])&l[c])>>>0];this._lBlock=a,this._rBlock=o^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,d.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function p(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}t.DES=i._createHelper(f);var h=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;this._des1=f.createEncryptor(r.create(e.slice(0,2))),this._des2=f.createEncryptor(r.create(e.slice(2,4))),this._des3=f.createEncryptor(r.create(e.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(h)}(),e.TripleDES},"object"===s(t)?e.exports=t=a(n(0),n(8),n(9),n(7),n(1)):(i=[n(0),n(8),n(9),n(7),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=r.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var a=i%n,s=t[a>>>2]>>>24-a%4*8&255;o=(o+r[i]+s)%256;var c=r[i];r[i]=r[o],r[o]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[n],e[n]=o,r|=e[(e[t]+e[n])%256]<<24-8*i}return this._i=t,this._j=n,r}t.RC4=n._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});t.RC4Drop=n._createHelper(a)}(),e.RC4},"object"===s(t)?e.exports=t=a(n(0),n(8),n(9),n(7),n(1)):(i=[n(0),n(8),n(9),n(7),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],o=[],a=[],s=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=u>>>16|4294901760&l,d=l<<16|65535&u;for(i[0]^=u,i[1]^=f,i[2]^=l,i[3]^=d,i[4]^=u,i[5]^=f,i[6]^=l,i[7]^=d,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=n._createHelper(s)}(),e.Rabbit},"object"===s(t)?e.exports=t=a(n(0),n(8),n(9),n(7),n(1)):(i=[n(0),n(8),n(9),n(7),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,a;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],o=[],a=[],s=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=u>>>16|4294901760&l,d=l<<16|65535&u;for(r[0]^=u,r[1]^=f,r[2]^=l,r[3]^=d,r[4]^=u,r[5]^=f,r[6]^=l,r[7]^=d,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.RabbitLegacy=n._createHelper(s)}(),e.RabbitLegacy},"object"===s(t)?e.exports=t=a(n(0),n(8),n(9),n(7),n(1)):(i=[n(0),n(8),n(9),n(7),n(1)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}e.exports=r},function(e,t,n){(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r="object"==(void 0===t?"undefined":n(t))&&t&&t.Object===Object&&t;e.exports=r}).call(this,n(89))},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(159),i=n(12);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},function(e,t,n){var r=n(94),i=n(162),o=n(95);e.exports=function(e,t,n,a,s,c){var u=1&n,l=e.length,f=t.length;if(l!=f&&!(u&&f>l))return!1;var d=c.get(e);if(d&&c.get(t))return d==t;var p=-1,h=!0,v=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++p<l;){var m=e[p],y=t[p];if(a)var g=u?a(y,m,p,t,e,c):a(m,y,p,e,t,c);if(void 0!==g){if(g)continue;h=!1;break}if(v){if(!i(t,(function(e,t){if(!o(v,t)&&(m===e||s(m,e,n,a,c)))return v.push(t)}))){h=!1;break}}else if(m!==y&&!s(m,y,n,a,c)){h=!1;break}}return c.delete(e),c.delete(t),h}},function(e,t,n){var r=n(47),i=n(160),o=n(161);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(11).Uint8Array;e.exports=r},function(e,t,n){var r=n(98),i=n(50),o=n(18);e.exports=function(e){return r(e,o,i)}},function(e,t,n){var r=n(49),i=n(5);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(167),i=n(37),o=n(5),a=n(38),s=n(26),c=n(52),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),l=!n&&i(e),f=!n&&!l&&a(e),d=!n&&!l&&!f&&c(e),p=n||l||f||d,h=p?r(e.length,String):[],v=h.length;for(var m in e)!t&&!u.call(e,m)||p&&("length"==m||f&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,v))||h.push(m);return h}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(16)(n(11),"Set");e.exports=r},function(e,t,n){var r=n(10);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},function(e,t,n){var r=n(184),i=n(185);e.exports=function(e,t){return null!=e&&i(e,t,r)}},function(e,t){e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},function(e,t,n){var r=n(190);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var r=n(22),i=n(193),o=n(194),a=n(23);e.exports=function(e,t){return t=r(t,e),null==(e=o(e,t))||delete e[a(i(t))]}},function(e,t,n){var r=n(32),i=n(110),o=n(112),a=n(197),s=n(10),c=n(43),u=n(117);e.exports=function e(t,n,l,f,d){t!==n&&o(n,(function(o,c){if(d||(d=new r),s(o))a(t,n,c,l,e,f,d);else{var p=f?f(u(t,c),o,c+"",t,n,d):void 0;void 0===p&&(p=o),i(t,c,p)}}),c)}},function(e,t,n){var r=n(58),i=n(25);e.exports=function(e,t,n){(void 0===n||i(e[t],n))&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(16),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t,n){var r=n(196)();e.exports=r},function(e,t,n){(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(11),o="object"==r(t)&&t&&!t.nodeType&&t,a=o&&"object"==r(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o?i.Buffer:void 0,c=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=c?c(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(51)(e))},function(e,t,n){var r=n(59);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(198),i=n(61),o=n(55);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},function(e,t,n){var r=n(17),i=n(61),o=n(12),a=Function.prototype,s=Object.prototype,c=a.toString,u=s.hasOwnProperty,l=c.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==l}},function(e,t){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},function(e,t,n){var r=n(119),i=n(207);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var c=n[r];c&&e(t,c,r,a)}return t}))}},function(e,t,n){var r=n(57),i=n(120),o=n(121);e.exports=function(e,t){return o(i(e,t,r),e+"")}},function(e,t,n){var r=n(203),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),c=Array(s);++a<s;)c[a]=o[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=o[a];return u[t]=n(c),r(e,this,u)}}},function(e,t,n){var r=n(204),i=n(206)(r);e.exports=i},function(e,t,n){var r=n(49),i=n(61),o=n(50),a=n(99),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},function(e,t,n){var r=n(98),i=n(122),o=n(43);e.exports=function(e){return r(e,o,i)}},function(e,t,n){var r=n(224),i=n(120),o=n(121);e.exports=function(e){return o(i(e,void 0,r),e+"")}},function(e,t,n){var r=n(109),i=n(118)((function(e,t,n,i){r(e,t,n,i)}));e.exports=i},function(e,t,n){var r=n(227),i=n(124)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},function(e,t,n){var r=n(27),i=n(31),o=n(230),a=n(5);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},function(e,t,n){var r=n(31),i=n(15),o=n(18);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var c=r(n,3);t=o(t),n=function(e){return c(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[c?t[u]:u]:void 0}}},function(e,t,n){var r=n(130),i=n(176),o=n(104);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(32),i=n(92);e.exports=function(e,t,n,o){var a=n.length,s=a,c=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<s;){var l=(u=n[a])[0],f=e[l],d=u[1];if(c&&u[2]){if(void 0===f&&!(l in e))return!1}else{var p=new r;if(o)var h=o(f,d,l,e,t,p);if(!(void 0===h?i(d,f,3,o,p):h))return!1}}return!0}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(34),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(34);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(34);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(34);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(33);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(33),i=n(45),o=n(47);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(46),i=n(144),o=n(10),a=n(91),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,f=u.hasOwnProperty,d=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:s).test(a(e))}},function(e,t,n){var r=n(21),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,i=n(145),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(11)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(148),i=n(33),o=n(45);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(e,t,n){var r=n(149),i=n(150),o=n(151),a=n(152),s=n(153);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=s,e.exports=c},function(e,t,n){var r=n(35);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(35),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(35),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},function(e,t,n){var r=n(35);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,n){var r=n(36);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){var t=n(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(36);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(36);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(36);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},function(e,t,n){var r=n(32),i=n(93),o=n(163),a=n(165),s=n(40),c=n(5),u=n(38),l=n(52),f="[object Arguments]",d="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,m,y){var g=c(e),b=c(t),w=g?d:s(e),k=b?d:s(t),x=(w=w==f?p:w)==p,$=(k=k==f?p:k)==p,_=w==k;if(_&&u(e)){if(!u(t))return!1;g=!0,x=!1}if(_&&!x)return y||(y=new r),g||l(e)?i(e,t,n,v,m,y):o(e,t,w,n,v,m,y);if(!(1&n)){var S=x&&h.call(e,"__wrapped__"),M=$&&h.call(t,"__wrapped__");if(S||M){var C=S?e.value():e,A=M?t.value():t;return y||(y=new r),m(C,A,n,v,y)}}return!!_&&(y||(y=new r),a(e,t,n,v,m,y))}},function(e,t){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t,n){var r=n(21),i=n(96),o=n(25),a=n(93),s=n(164),c=n(48),u=r?r.prototype:void 0,l=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,f,d){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!f(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var h=1&r;if(p||(p=c),e.size!=t.size&&!h)return!1;var v=d.get(e);if(v)return v==t;r|=2,d.set(e,t);var m=a(p(e),p(t),r,u,f,d);return d.delete(e),m;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},function(e,t,n){var r=n(97),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var c=1&n,u=r(e),l=u.length;if(l!=r(t).length&&!c)return!1;for(var f=l;f--;){var d=u[f];if(!(c?d in t:i.call(t,d)))return!1}var p=s.get(e);if(p&&s.get(t))return p==t;var h=!0;s.set(e,t),s.set(t,e);for(var v=c;++f<l;){var m=e[d=u[f]],y=t[d];if(o)var g=c?o(y,m,d,t,e,s):o(m,y,d,e,t,s);if(!(void 0===g?m===y||a(m,y,n,o,s):g)){h=!1;break}v||(v="constructor"==d)}if(h&&!v){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(h=!1)}return s.delete(e),s.delete(t),h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(17),i=n(12);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(17),i=n(53),o=n(12),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},function(e,t,n){var r=n(55),i=n(172),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(101)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(16)(n(11),"DataView");e.exports=r},function(e,t,n){var r=n(16)(n(11),"Promise");e.exports=r},function(e,t,n){var r=n(16)(n(11),"WeakMap");e.exports=r},function(e,t,n){var r=n(103),i=n(18);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},function(e,t,n){var r=n(92),i=n(178),o=n(105),a=n(56),s=n(103),c=n(104),u=n(23);e.exports=function(e,t){return a(e)&&s(t)?c(u(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},function(e,t,n){var r=n(41);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t,n){var r=n(180),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},function(e,t,n){var r=n(181);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t,n){var r=n(47),i="Expected a function";function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(i);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},function(e,t,n){var r=n(183);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(21),i=n(27),o=n(5),a=n(42),s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(22),i=n(37),o=n(5),a=n(26),s=n(53),c=n(23);e.exports=function(e,t,n){for(var u=-1,l=(t=r(t,e)).length,f=!1;++u<l;){var d=c(t[u]);if(!(f=null!=e&&n(e,d)))break;e=e[d]}return f||++u!=l?f:!!(l=null==e?0:e.length)&&s(l)&&a(d,l)&&(o(e)||i(e))}},function(e,t,n){var r=n(187),i=n(188),o=n(56),a=n(23);e.exports=function(e){return o(e)?r(a(e)):i(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(41);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(106),i=n(31),o=n(107),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var c=null==n?0:o(n);return c<0&&(c=a(s+c,0)),r(e,i(t,3),c)}},function(e,t,n){var r=n(191);e.exports=function(e){return e?(e=r(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},function(e,t,n){var r=n(10),i=n(42),o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},function(e,t,n){var r=n(108),i=n(26),o=Array.prototype.splice;e.exports=function(e,t){for(var n=e?t.length:0,a=n-1;n--;){var s=t[n];if(n==a||s!==c){var c=s;i(s)?o.call(e,s,1):r(e,s)}}return e}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var r=n(41),i=n(195);e.exports=function(e,t){return t.length<2?e:r(e,i(t,0,-1))}},function(e,t){e.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}},function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===n(o[c],c,o))break}return t}}},function(e,t,n){var r=n(110),i=n(113),o=n(114),a=n(60),s=n(115),c=n(37),u=n(5),l=n(199),f=n(38),d=n(46),p=n(10),h=n(116),v=n(52),m=n(117),y=n(200);e.exports=function(e,t,n,g,b,w,k){var x=m(e,n),$=m(t,n),_=k.get($);if(_)r(e,n,_);else{var S=w?w(x,$,n+"",e,t,k):void 0,M=void 0===S;if(M){var C=u($),A=!C&&f($),I=!C&&!A&&v($);S=$,C||A||I?u(x)?S=x:l(x)?S=a(x):A?(M=!1,S=i($,!0)):I?(M=!1,S=o($,!0)):S=[]:h($)||c($)?(S=x,c(x)?S=y(x):p(x)&&!d(x)||(S=s($))):M=!1}M&&(k.set($,S),b(S,$,g,w,k),k.delete($)),r(e,n,S)}}},function(e,t,n){var r=n(10),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},function(e,t,n){var r=n(15),i=n(12);e.exports=function(e){return i(e)&&r(e)}},function(e,t,n){var r=n(24),i=n(43);e.exports=function(e){return r(e,i(e))}},function(e,t,n){var r=n(10),i=n(55),o=n(202),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(205),i=n(111),o=n(57),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var n=Date.now;e.exports=function(e){var t=0,r=0;return function(){var i=n(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(25),o=n(15),a=n(26),s=n(10);e.exports=function(e,t,n){if(!s(n))return!1;var c=r(t);return!!("number"==c?o(n)&&a(t,n.length):"string"==c&&t in n)&&i(n[t],e)}},function(e,t,n){var r=n(32),i=n(209),o=n(62),a=n(210),s=n(211),c=n(113),u=n(60),l=n(212),f=n(213),d=n(97),p=n(123),h=n(40),v=n(214),m=n(215),y=n(115),g=n(5),b=n(38),w=n(219),k=n(10),x=n(221),$=n(18),_="[object Arguments]",S="[object Function]",M="[object Object]",C={};C[_]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[M]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[S]=C["[object WeakMap]"]=!1,e.exports=function e(t,n,A,I,E,O){var D,R=1&n,P=2&n,T=4&n;if(A&&(D=E?A(t,I,E,O):A(t)),void 0!==D)return D;if(!k(t))return t;var j=g(t);if(j){if(D=v(t),!R)return u(t,D)}else{var F=h(t),N=F==S||"[object GeneratorFunction]"==F;if(b(t))return c(t,R);if(F==M||F==_||N&&!E){if(D=P||N?{}:y(t),!R)return P?f(t,s(D,t)):l(t,a(D,t))}else{if(!C[F])return E?t:{};D=m(t,F,R)}}O||(O=new r);var L=O.get(t);if(L)return L;O.set(t,D),x(t)?t.forEach((function(r){D.add(e(r,n,A,r,t,O))})):w(t)&&t.forEach((function(r,i){D.set(i,e(r,n,A,i,t,O))}));var U=T?P?p:d:P?keysIn:$,B=j?void 0:U(t);return i(B||t,(function(r,i){B&&(r=t[i=r]),o(D,i,e(r,n,A,i,t,O))})),D}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t,n){var r=n(24),i=n(18);e.exports=function(e,t){return e&&r(t,i(t),e)}},function(e,t,n){var r=n(24),i=n(43);e.exports=function(e,t){return e&&r(t,i(t),e)}},function(e,t,n){var r=n(24),i=n(50);e.exports=function(e,t){return r(e,i(e),t)}},function(e,t,n){var r=n(24),i=n(122);e.exports=function(e,t){return r(e,i(e),t)}},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(59),i=n(216),o=n(217),a=n(218),s=n(114);e.exports=function(e,t,n){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return o(e);case"[object Set]":return new c;case"[object Symbol]":return a(e)}}},function(e,t,n){var r=n(59);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(21),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},function(e,t,n){var r=n(220),i=n(39),o=n(54),a=o&&o.isMap,s=a?i(a):r;e.exports=s},function(e,t,n){var r=n(40),i=n(12);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},function(e,t,n){var r=n(222),i=n(39),o=n(54),a=o&&o.isSet,s=a?i(a):r;e.exports=s},function(e,t,n){var r=n(40),i=n(12);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},function(e,t,n){var r=n(116);e.exports=function(e){return r(e)?void 0:e}},function(e,t,n){var r=n(225);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},function(e,t,n){var r=n(49),i=n(226);e.exports=function e(t,n,o,a,s){var c=-1,u=t.length;for(o||(o=i),s||(s=[]);++c<u;){var l=t[c];n>0&&o(l)?n>1?e(l,n-1,o,a,s):r(s,l):a||(s[s.length]=l)}return s}},function(e,t,n){var r=n(21),i=n(37),o=n(5),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},function(e,t,n){var r=n(228),i=n(105);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},function(e,t,n){var r=n(41),i=n(229),o=n(22);e.exports=function(e,t,n){for(var a=-1,s=t.length,c={};++a<s;){var u=t[a],l=r(e,u);n(l,u)&&i(c,o(u,e),l)}return c}},function(e,t,n){var r=n(62),i=n(22),o=n(26),a=n(10),s=n(23);e.exports=function(e,t,n,c){if(!a(e))return e;for(var u=-1,l=(t=i(t,e)).length,f=l-1,d=e;null!=d&&++u<l;){var p=s(t[u]),h=n;if(u!=f){var v=d[p];void 0===(h=c?c(v,p,d):void 0)&&(h=a(v)?v:o(t[u+1])?[]:{})}r(d,p,h),d=d[p]}return e}},function(e,t,n){var r=n(231),i=n(15);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},function(e,t,n){var r=n(232),i=n(233)(r);e.exports=i},function(e,t,n){var r=n(112),i=n(18);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){var r=n(15);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},function(e,t,n){var r=n(235);e.exports=function(e,t){return e&&e.length&&t&&t.length?r(e,t):e}},function(e,t,n){var r=n(27),i=n(63),o=n(238),a=n(39),s=n(60),c=Array.prototype.splice;e.exports=function(e,t,n,u){var l=u?o:i,f=-1,d=t.length,p=e;for(e===t&&(t=s(t)),n&&(p=r(e,a(n)));++f<d;)for(var h=0,v=t[f],m=n?n(v):v;(h=l(p,m,h,u))>-1;)p!==e&&c.call(p,h,1),c.call(e,h,1);return e}},function(e,t){e.exports=function(e){return e!=e}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},function(e,t){e.exports=function(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}},function(e,t,n){var r=n(94),i=n(240),o=n(241),a=n(95),s=n(242),c=n(48);e.exports=function(e,t,n){var u=-1,l=i,f=e.length,d=!0,p=[],h=p;if(n)d=!1,l=o;else if(f>=200){var v=t?null:s(e);if(v)return c(v);d=!1,l=a,h=new r}else h=t?[]:p;e:for(;++u<f;){var m=e[u],y=t?t(m):m;if(m=n||0!==m?m:0,d&&y==y){for(var g=h.length;g--;)if(h[g]===y)continue e;t&&h.push(y),p.push(m)}else l(h,y,n)||(h!==p&&h.push(y),p.push(m))}return p}},function(e,t,n){var r=n(63);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},function(e,t){e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},function(e,t,n){var r=n(102),i=n(243),o=n(48),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(17),i=n(5),o=n(12);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},function(e,t,n){var r=n(246),i=n(18);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){var r=n(27);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},function(e,t,n){"use strict";n.r(t);var r=n(6);function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=n(65),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.DefaultPBKDF2Length=768}var t,n;return t=e,(n=[{key:"generateUUIDSync",value:function(){return Object(r.a)()}},{key:"generateUUID",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(r.a)());case 1:case"end":return e.stop()}}))}},{key:"timingSafeEqual",value:function(e,t){var n=String(e),r=String(t),i=n.length,o=0;i!==r.length&&(r=n,o=1);for(var a=0;a<i;a++)o|=n.charCodeAt(a)^r.charCodeAt(a);return 0===o}},{key:"generateRandomKey",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o.lib.WordArray.random(e/8).toString());case 1:case"end":return t.stop()}}))}},{key:"generateItemEncryptionKey",value:function(){var e,t,n,r;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return e=512,t=1,i.next=3,regeneratorRuntime.awrap(this.generateRandomKey(e));case 3:return n=i.sent,i.next=6,regeneratorRuntime.awrap(this.generateRandomKey(e));case 6:return r=i.sent,i.abrupt("return",this.pbkdf2(r,n,t,e));case 8:case"end":return i.stop()}}),null,this)}},{key:"firstHalfOfKey",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.substring(0,e.length/2));case 1:case"end":return t.stop()}}))}},{key:"secondHalfOfKey",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.substring(e.length/2,e.length));case 1:case"end":return t.stop()}}))}},{key:"base64",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(r.b)().btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)}))));case 1:case"end":return t.stop()}}))}},{key:"base64Decode",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(r.b)().atob(e));case 1:case"end":return t.stop()}}))}},{key:"sha256",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o.SHA256(e).toString());case 1:case"end":return t.stop()}}))}},{key:"hmac256",value:function(e,t){var n,r,i;return regeneratorRuntime.async((function(a){for(;;)switch(a.prev=a.next){case 0:return n=o.enc.Hex.parse(t),r=o.enc.Utf8.parse(e),i=o.HmacSHA256(r,n).toString(),a.abrupt("return",i);case 4:case"end":return a.stop()}}))}},{key:"generateSymmetricKeyPair",value:function(){var e,t,n,r,i,o,a,s,c,u,l=arguments;return regeneratorRuntime.async((function(f){for(;;)switch(f.prev=f.next){case 0:return e=l.length>0&&void 0!==l[0]?l[0]:{},t=e.password,n=e.pw_salt,r=e.pw_cost,f.next=3,regeneratorRuntime.awrap(this.pbkdf2(t,n,r,this.DefaultPBKDF2Length));case 3:return i=f.sent,o=i.length,a=o/3,s=i.slice(0,a),c=i.slice(a,2*a),u=i.slice(2*a,3*a),f.abrupt("return",[s,c,u]);case 10:case"end":return f.stop()}}),null,this)}}])&&i(t.prototype,n),e}();function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var f=Object(r.b)().crypto?Object(r.b)().crypto.subtle:null,d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,u(t).apply(this,arguments))}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e),n=t,(r=[{key:"pbkdf2",value:function(e,t,n,r){var i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,regeneratorRuntime.awrap(this.webCryptoImportKey(e,"PBKDF2",["deriveBits"]));case 2:if(i=o.sent){o.next=6;break}return console.log("Key is null, unable to continue"),o.abrupt("return",null);case 6:return o.abrupt("return",this.webCryptoDeriveBits(i,t,n,r));case 7:case"end":return o.stop()}}),null,this)}},{key:"generateRandomKey",value:function(e){var t=this;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",f.generateKey({name:"AES-CBC",length:e},!0,["encrypt","decrypt"]).then((function(e){return f.exportKey("raw",e).then((function(e){var n;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,regeneratorRuntime.awrap(t.arrayBufferToHexString(new Uint8Array(e)));case 2:return n=r.sent,r.abrupt("return",n);case 4:case"end":return r.stop()}}))})).catch((function(e){console.error("Error exporting key",e)}))})).catch((function(e){console.error("Error generating key",e)})));case 2:case"end":return n.stop()}}))}},{key:"generateItemEncryptionKey",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all([this.generateRandomKey(256),this.generateRandomKey(256)]).then((function(e){return e.join("")})));case 2:case"end":return e.stop()}}),null,this)}},{key:"aes256CbcDecrypt",value:function(e,t,n){var r,i,o,a=this;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:return n||(n=new ArrayBuffer(16)),r={name:"AES-CBC",iv:n},s.next=4,regeneratorRuntime.awrap(this.webCryptoImportKey(t,r.name,["decrypt"]));case 4:return i=s.sent,s.next=7,regeneratorRuntime.awrap(this.base64ToArrayBuffer(e));case 7:return o=s.sent,s.abrupt("return",crypto.subtle.decrypt(r,i,o).then((function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(a.arrayBufferToString(e));case 2:return t=n.sent,n.abrupt("return",t);case 4:case"end":return n.stop()}}))})).catch((function(e){console.error("Error decrypting:",e)})));case 9:case"end":return s.stop()}}),null,this)}},{key:"aes256CbcEncrypt",value:function(e,t,n){var r,i,o,a,s;return regeneratorRuntime.async((function(c){for(;;)switch(c.prev=c.next){case 0:return n||(n=new ArrayBuffer(16)),r={name:"AES-CBC",iv:n},c.next=4,regeneratorRuntime.awrap(this.webCryptoImportKey(t,r.name,["encrypt"]));case 4:return i=c.sent,c.next=7,regeneratorRuntime.awrap(this.stringToArrayBuffer(e));case 7:return o=c.sent,c.next=10,regeneratorRuntime.awrap(crypto.subtle.encrypt(r,i,o));case 10:return a=c.sent,c.next=13,regeneratorRuntime.awrap(this.arrayBufferToBase64(a));case 13:return s=c.sent,c.abrupt("return",s);case 15:case"end":return c.stop()}}),null,this)}},{key:"hmac256",value:function(e,t){var n,r,i,o=this;return regeneratorRuntime.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,regeneratorRuntime.awrap(this.hexStringToArrayBuffer(t));case 2:return n=a.sent,a.next=5,regeneratorRuntime.awrap(this.webCryptoImportKey(n,"HMAC",["sign"],{name:"SHA-256"}));case 5:return r=a.sent,a.next=8,regeneratorRuntime.awrap(this.stringToArrayBuffer(e));case 8:return i=a.sent,a.abrupt("return",crypto.subtle.sign({name:"HMAC"},r,i).then((function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(o.arrayBufferToHexString(e));case 2:return t=n.sent,n.abrupt("return",t);case 4:case"end":return n.stop()}}))})).catch((function(e){console.error("Error computing hmac",e)})));case 10:case"end":return a.stop()}}),null,this)}},{key:"webCryptoImportKey",value:function(e,t,n,r){var i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:if("string"!=typeof e){o.next=6;break}return o.next=3,regeneratorRuntime.awrap(this.stringToArrayBuffer(e));case 3:o.t0=o.sent,o.next=7;break;case 6:o.t0=e;case 7:return i=o.t0,o.abrupt("return",f.importKey("raw",i,{name:t,hash:r},!1,n).then((function(e){return e})).catch((function(e){return console.error(e),null})));case 9:case"end":return o.stop()}}),null,this)}},{key:"webCryptoDeriveBits",value:function(e,t,n,r){var i,o=this;return regeneratorRuntime.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,regeneratorRuntime.awrap(this.stringToArrayBuffer(t));case 2:return a.t0=a.sent,a.t1=n,a.t2={name:"SHA-512"},i={name:"PBKDF2",salt:a.t0,iterations:a.t1,hash:a.t2},a.abrupt("return",f.deriveBits(i,e,r).then((function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(o.arrayBufferToHexString(new Uint8Array(e)));case 2:return t=n.sent,n.abrupt("return",t);case 4:case"end":return n.stop()}}))})).catch((function(e){return console.error(e),null})));case 7:case"end":return a.stop()}}),null,this)}},{key:"stringToArrayBuffer",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){var r=new Blob([e]),i=new FileReader;i.onload=function(e){t(e.target.result)},i.readAsArrayBuffer(r)})));case 1:case"end":return t.stop()}}))}},{key:"arrayBufferToString",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){var r=new Blob([e]),i=new FileReader;i.onload=function(e){t(e.target.result)},i.readAsText(r)})));case 1:case"end":return t.stop()}}))}},{key:"arrayBufferToHexString",value:function(e){var t,n,r,i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:for(t=new Uint8Array(e),n="",i=0;i<t.byteLength;i++)(r=t[i].toString(16)).length<2&&(r="0"+r),n+=r;return o.abrupt("return",n);case 4:case"end":return o.stop()}}))}},{key:"hexStringToArrayBuffer",value:function(e){var t,n;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:for(t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return r.abrupt("return",new Uint8Array(t));case 2:case"end":return r.stop()}}))}},{key:"base64ToArrayBuffer",value:function(e){var t,n,r,i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,regeneratorRuntime.awrap(this.base64Decode(e));case 2:for(t=o.sent,n=t.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=t.charCodeAt(i);return o.abrupt("return",r.buffer);case 7:case"end":return o.stop()}}),null,this)}},{key:"arrayBufferToBase64",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){var r=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(e){var n=e.target.result;t(n.substr(n.indexOf(",")+1))},i.readAsDataURL(r)})));case 1:case"end":return t.stop()}}))}}])&&c(n.prototype,r),t}(a);function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var y=n(65),g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,v(t).apply(this,arguments))}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,e),n=t,(r=[{key:"pbkdf2",value:function(e,t,n,r){var i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return i={keySize:r/32,hasher:y.algo.SHA512,iterations:n},o.abrupt("return",y.PBKDF2(e,t,i).toString());case 2:case"end":return o.stop()}}))}},{key:"hexStringToArrayBuffer",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",y.enc.Hex.parse(e));case 1:case"end":return t.stop()}}))}},{key:"aes256CbcDecrypt",value:function(e,t,n){var r;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return r=y.AES.decrypt(e,t,{iv:n,mode:y.mode.CBC,padding:y.pad.Pkcs7}),i.abrupt("return",r.toString(y.enc.Utf8));case 2:case"end":return i.stop()}}))}},{key:"aes256CbcEncrypt",value:function(e,t,n){var r;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return r=y.AES.encrypt(e,t,{iv:n,mode:y.mode.CBC,padding:y.pad.Pkcs7}),i.abrupt("return",r.toString());case 2:case"end":return i.stop()}}))}}])&&h(n.prototype,r),t}(a);function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var w=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.crypto=t}var t,n;return t=e,(n=[{key:"decryptText",value:function(){var e,t,n,r,i,o,a,s,c,u,l=arguments;return regeneratorRuntime.async((function(f){for(;;)switch(f.prev=f.next){case 0:if(e=l.length>0&&void 0!==l[0]?l[0]:{},t=e.ciphertextToAuth,n=e.contentCiphertext,r=e.encryptionKey,i=e.iv,o=e.authHash,a=e.authKey,!(l.length>1?l[1]:void 0)||o){f.next=5;break}return console.error("Auth hash is required."),f.abrupt("return");case 5:if(!o){f.next=12;break}return f.next=8,regeneratorRuntime.awrap(this.crypto.hmac256(t,a));case 8:if(s=f.sent,!1!==this.crypto.timingSafeEqual(o,s)){f.next=12;break}return console.error("Auth hash does not match, returning null."),f.abrupt("return",null);case 12:return f.next=14,regeneratorRuntime.awrap(this.crypto.hexStringToArrayBuffer(r));case 14:return c=f.sent,f.next=17,regeneratorRuntime.awrap(this.crypto.hexStringToArrayBuffer(i||""));case 17:return u=f.sent,f.abrupt("return",this.crypto.aes256CbcDecrypt(n,c,u));case 19:case"end":return f.stop()}}),null,this)}},{key:"encryptText",value:function(e,t,n){var r,i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,regeneratorRuntime.awrap(this.crypto.hexStringToArrayBuffer(t));case 2:return r=o.sent,o.next=5,regeneratorRuntime.awrap(this.crypto.hexStringToArrayBuffer(n||""));case 5:return i=o.sent,o.abrupt("return",this.crypto.aes256CbcEncrypt(e,r,i));case 7:case"end":return o.stop()}}),null,this)}}])&&b(t.prototype,n),e}();function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $(e){return($=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,$(t).apply(this,arguments))}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(t,e),n=t,i=[{key:"pwCost",value:function(){return 3e3}},{key:"versionString",value:function(){return"001"}}],(r=[{key:"generateSalt",value:function(e,t,n,r){var i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,regeneratorRuntime.awrap(this.crypto.sha256([e,"SF",t,n,r].join(":")));case 2:return i=o.sent,o.abrupt("return",i);case 4:case"end":return o.stop()}}),null,this)}},{key:"computeEncryptionKeysForUser",value:function(e,t){var n,r,i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return n=t.pw_salt,o.next=3,regeneratorRuntime.awrap(this.crypto.generateSymmetricKeyPair({password:e,pw_salt:n,pw_cost:t.pw_cost}));case 3:return r=o.sent,i={pw:r[0],mk:r[1],ak:r[2]},o.abrupt("return",i);case 6:case"end":return o.stop()}}),null,this)}},{key:"_private_encryptString",value:function(e,t,n,r,i){var o,a;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(this.encryptText(e,t,null));case 2:return a=n.sent,o=i.version+a,n.abrupt("return",o);case 5:case"end":return n.stop()}}),null,this)}},{key:"encryptItem",value:function(e,t,n){var r,i,o,a,s,c;return regeneratorRuntime.async((function(u){for(;;)switch(u.prev=u.next){case 0:return r={},u.next=3,regeneratorRuntime.awrap(this.crypto.generateItemEncryptionKey());case 3:return i=u.sent,u.next=6,regeneratorRuntime.awrap(this.encryptText(i,t.mk,null));case 6:return r.enc_item_key=u.sent,u.next=9,regeneratorRuntime.awrap(this.crypto.firstHalfOfKey(i));case 9:return o=u.sent,u.next=12,regeneratorRuntime.awrap(this.crypto.secondHalfOfKey(i));case 12:return a=u.sent,u.next=15,regeneratorRuntime.awrap(this._private_encryptString(JSON.stringify(e.createContentJSONFromProperties()),o,a,e.uuid,n));case 15:return s=u.sent,u.next=18,regeneratorRuntime.awrap(this.crypto.hmac256(s,a));case 18:return c=u.sent,r.auth_hash=c,r.content=s,u.abrupt("return",r);case 22:case"end":return u.stop()}}),null,this)}},{key:"encryptionComponentsFromString",value:function(e,t,n){var r=e.substring(0,3);return{contentCiphertext:e.substring(3,e.length),encryptionVersion:r,ciphertextToAuth:e,iv:null,authHash:null,encryptionKey:t,authKey:n}}},{key:"decryptItem",value:function(e,t){var n,r,i,o,a,s,c,u;return regeneratorRuntime.async((function(l){for(;;)switch(l.prev=l.next){case 0:if("string"==typeof e.content){l.next=2;break}return l.abrupt("return");case 2:if(!e.content.startsWith("000")){l.next=14;break}return l.prev=3,l.t0=JSON,l.next=7,regeneratorRuntime.awrap(this.crypto.base64Decode(e.content.substring(3,e.content.length)));case 7:l.t1=l.sent,e.content=l.t0.parse.call(l.t0,l.t1),l.next=13;break;case 11:l.prev=11,l.t2=l.catch(3);case 13:return l.abrupt("return");case 14:if(e.enc_item_key){l.next=17;break}return console.log("Missing item encryption key, skipping decryption."),l.abrupt("return");case 17:if(n=e.enc_item_key,r=!0,n="001"+n,r=!1,!(i=this.encryptionComponentsFromString(n,t.mk,t.ak)).uuid||i.uuid===e.uuid){l.next=27;break}return console.error("Item key params UUID does not match item UUID"),e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,l.abrupt("return");case 27:return l.next=29,regeneratorRuntime.awrap(this.decryptText(i,r));case 29:if(o=l.sent){l.next=35;break}return console.log("Error decrypting item",e),e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,l.abrupt("return");case 35:return l.next=37,regeneratorRuntime.awrap(this.crypto.firstHalfOfKey(o));case 37:return a=l.sent,l.next=40,regeneratorRuntime.awrap(this.crypto.secondHalfOfKey(o));case 40:return s=l.sent,c=this.encryptionComponentsFromString(e.content,a,s),l.prev=42,l.t3=JSON,l.next=46,regeneratorRuntime.awrap(this.crypto.base64Decode(c.authParams));case 46:l.t4=l.sent,e.auth_params=l.t3.parse.call(l.t3,l.t4),l.next=52;break;case 50:l.prev=50,l.t5=l.catch(42);case 52:if(!c.uuid||c.uuid===e.uuid){l.next=56;break}return e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,l.abrupt("return");case 56:return c.authHash||(c.authHash=e.auth_hash),l.next=59,regeneratorRuntime.awrap(this.decryptText(c,!0));case 59:(u=l.sent)?(1==e.errorDecrypting&&(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!1,e.content=u):(e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0);case 61:case"end":return l.stop()}}),null,this,[[3,11],[42,50]])}}])&&x(n.prototype,r),i&&x(n,i),t}(w);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var E=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==M(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,A(t).apply(this,arguments))}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(t,e),n=t,i=[{key:"pwCost",value:function(){return 3e3}},{key:"versionString",value:function(){return"002"}}],(r=[{key:"generateSalt",value:function(e,t,n,r){var i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,regeneratorRuntime.awrap(this.crypto.sha256([e,"SF",t,n,r].join(":")));case 2:return i=o.sent,o.abrupt("return",i);case 4:case"end":return o.stop()}}),null,this)}},{key:"computeEncryptionKeysForUser",value:function(e,t){var n,r,i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return n=t.pw_salt,o.next=3,regeneratorRuntime.awrap(this.crypto.generateSymmetricKeyPair({password:e,pw_salt:n,pw_cost:t.pw_cost}));case 3:return r=o.sent,i={pw:r[0],mk:r[1],ak:r[2]},o.abrupt("return",i);case 6:case"end":return o.stop()}}),null,this)}},{key:"_private_encryptString",value:function(e,t,n,r,i){var o,a,s,c,u,l;return regeneratorRuntime.async((function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,regeneratorRuntime.awrap(this.crypto.generateRandomKey(128));case 2:return s=f.sent,f.next=5,regeneratorRuntime.awrap(this.encryptText(e,t,s));case 5:return a=f.sent,c=[i.version,r,s,a].join(":"),f.next=9,regeneratorRuntime.awrap(this.crypto.hmac256(c,n));case 9:return u=f.sent,f.next=12,regeneratorRuntime.awrap(this.crypto.base64(JSON.stringify(i)));case 12:return l=f.sent,o=[i.version,u,r,s,a,l].join(":"),f.abrupt("return",o);case 15:case"end":return f.stop()}}),null,this)}},{key:"encryptItem",value:function(e,t,n){var r,i,o,a,s;return regeneratorRuntime.async((function(c){for(;;)switch(c.prev=c.next){case 0:return r={},c.next=3,regeneratorRuntime.awrap(this.crypto.generateItemEncryptionKey());case 3:return i=c.sent,c.next=6,regeneratorRuntime.awrap(this._private_encryptString(i,t.mk,t.ak,e.uuid,n));case 6:return r.enc_item_key=c.sent,c.next=9,regeneratorRuntime.awrap(this.crypto.firstHalfOfKey(i));case 9:return o=c.sent,c.next=12,regeneratorRuntime.awrap(this.crypto.secondHalfOfKey(i));case 12:return a=c.sent,c.next=15,regeneratorRuntime.awrap(this._private_encryptString(JSON.stringify(e.createContentJSONFromProperties()),o,a,e.uuid,n));case 15:return s=c.sent,r.content=s,c.abrupt("return",r);case 18:case"end":return c.stop()}}),null,this)}},{key:"encryptionComponentsFromString",value:function(e,t,n){e.substring(0,3);var r=e.split(":");return{encryptionVersion:r[0],authHash:r[1],uuid:r[2],iv:r[3],contentCiphertext:r[4],authParams:r[5],ciphertextToAuth:[r[0],r[2],r[3],r[4]].join(":"),encryptionKey:t,authKey:n}}},{key:"decryptItem",value:function(e,t){var n,r,i,o,a,s,c,u;return regeneratorRuntime.async((function(l){for(;;)switch(l.prev=l.next){case 0:if("string"==typeof e.content){l.next=2;break}return l.abrupt("return");case 2:if(!e.content.startsWith("000")){l.next=14;break}return l.prev=3,l.t0=JSON,l.next=7,regeneratorRuntime.awrap(this.crypto.base64Decode(e.content.substring(3,e.content.length)));case 7:l.t1=l.sent,e.content=l.t0.parse.call(l.t0,l.t1),l.next=13;break;case 11:l.prev=11,l.t2=l.catch(3);case 13:return l.abrupt("return");case 14:if(e.enc_item_key){l.next=17;break}return console.log("Missing item encryption key, skipping decryption."),l.abrupt("return");case 17:if(n=e.enc_item_key,r=!0,!(i=this.encryptionComponentsFromString(n,t.mk,t.ak)).uuid||i.uuid===e.uuid){l.next=25;break}return console.error("Item key params UUID does not match item UUID"),e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,l.abrupt("return");case 25:return l.next=27,regeneratorRuntime.awrap(this.decryptText(i,r));case 27:if(o=l.sent){l.next=33;break}return console.log("Error decrypting item",e),e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,l.abrupt("return");case 33:return l.next=35,regeneratorRuntime.awrap(this.crypto.firstHalfOfKey(o));case 35:return a=l.sent,l.next=38,regeneratorRuntime.awrap(this.crypto.secondHalfOfKey(o));case 38:return s=l.sent,c=this.encryptionComponentsFromString(e.content,a,s),l.prev=40,l.t3=JSON,l.next=44,regeneratorRuntime.awrap(this.crypto.base64Decode(c.authParams));case 44:l.t4=l.sent,e.auth_params=l.t3.parse.call(l.t3,l.t4),l.next=50;break;case 48:l.prev=48,l.t5=l.catch(40);case 50:if(!c.uuid||c.uuid===e.uuid){l.next=54;break}return e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,l.abrupt("return");case 54:return l.next=56,regeneratorRuntime.awrap(this.decryptText(c,!0));case 56:(u=l.sent)?(1==e.errorDecrypting&&(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!1,e.content=u):(e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0);case 58:case"end":return l.stop()}}),null,this,[[3,11],[40,48]])}}])&&C(n.prototype,r),i&&C(n,i),t}(w);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var T=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,R(t).apply(this,arguments))}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(t,e),n=t,i=[{key:"pwCost",value:function(){return 11e4}},{key:"versionString",value:function(){return"003"}}],(r=[{key:"generateSalt",value:function(e,t,n,r){var i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,regeneratorRuntime.awrap(this.crypto.sha256([e,"SF",t,n,r].join(":")));case 2:return i=o.sent,o.abrupt("return",i);case 4:case"end":return o.stop()}}),null,this)}},{key:"computeEncryptionKeysForUser",value:function(e,t){var n,r,i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(t.identifier){o.next=3;break}return console.error("authParams is missing identifier."),o.abrupt("return");case 3:return o.next=5,regeneratorRuntime.awrap(this.generateSalt(t.identifier,t.version,t.pw_cost,t.pw_nonce));case 5:return n=o.sent,o.next=8,regeneratorRuntime.awrap(this.crypto.generateSymmetricKeyPair({password:e,pw_salt:n,pw_cost:t.pw_cost}));case 8:return r=o.sent,i={pw:r[0],mk:r[1],ak:r[2]},o.abrupt("return",i);case 11:case"end":return o.stop()}}),null,this)}},{key:"generateInitialKeysAndAuthParamsForUser",value:function(e,t){var n,r,i,o,a,s,c;return regeneratorRuntime.async((function(u){for(;;)switch(u.prev=u.next){case 0:return n=this.constructor.versionString(),r=this.constructor.pwCost(),u.next=4,regeneratorRuntime.awrap(this.crypto.generateRandomKey(256));case 4:return i=u.sent,u.next=7,regeneratorRuntime.awrap(this.generateSalt(e,n,r,i));case 7:return o=u.sent,u.next=10,regeneratorRuntime.awrap(this.crypto.generateSymmetricKeyPair({password:t,pw_salt:o,pw_cost:r}));case 10:return a=u.sent,s={pw_nonce:i,pw_cost:r,identifier:e,version:n},c={pw:a[0],mk:a[1],ak:a[2]},u.abrupt("return",{keys:c,authParams:s});case 14:case"end":return u.stop()}}),null,this)}},{key:"_private_encryptString",value:function(e,t,n,r,i){var o,a,s,c,u,l;return regeneratorRuntime.async((function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,regeneratorRuntime.awrap(this.crypto.generateRandomKey(128));case 2:return s=f.sent,f.next=5,regeneratorRuntime.awrap(this.encryptText(e,t,s));case 5:return a=f.sent,c=[i.version,r,s,a].join(":"),f.next=9,regeneratorRuntime.awrap(this.crypto.hmac256(c,n));case 9:return u=f.sent,f.next=12,regeneratorRuntime.awrap(this.crypto.base64(JSON.stringify(i)));case 12:return l=f.sent,o=[i.version,u,r,s,a,l].join(":"),f.abrupt("return",o);case 15:case"end":return f.stop()}}),null,this)}},{key:"encryptItem",value:function(e,t,n){var r,i,o,a,s;return regeneratorRuntime.async((function(c){for(;;)switch(c.prev=c.next){case 0:return r={},c.next=3,regeneratorRuntime.awrap(this.crypto.generateItemEncryptionKey());case 3:return i=c.sent,c.next=6,regeneratorRuntime.awrap(this._private_encryptString(i,t.mk,t.ak,e.uuid,n));case 6:return r.enc_item_key=c.sent,c.next=9,regeneratorRuntime.awrap(this.crypto.firstHalfOfKey(i));case 9:return o=c.sent,c.next=12,regeneratorRuntime.awrap(this.crypto.secondHalfOfKey(i));case 12:return a=c.sent,c.next=15,regeneratorRuntime.awrap(this._private_encryptString(JSON.stringify(e.createContentJSONFromProperties()),o,a,e.uuid,n));case 15:return s=c.sent,r.content=s,c.abrupt("return",r);case 18:case"end":return c.stop()}}),null,this)}},{key:"encryptionComponentsFromString",value:function(e,t,n){e.substring(0,3);var r=e.split(":");return{encryptionVersion:r[0],authHash:r[1],uuid:r[2],iv:r[3],contentCiphertext:r[4],authParams:r[5],ciphertextToAuth:[r[0],r[2],r[3],r[4]].join(":"),encryptionKey:t,authKey:n}}},{key:"decryptItem",value:function(e,t){var n,r,i,o,a,s,c,u;return regeneratorRuntime.async((function(l){for(;;)switch(l.prev=l.next){case 0:if("string"==typeof e.content){l.next=2;break}return l.abrupt("return");case 2:if(!e.content.startsWith("000")){l.next=14;break}return l.prev=3,l.t0=JSON,l.next=7,regeneratorRuntime.awrap(this.crypto.base64Decode(e.content.substring(3,e.content.length)));case 7:l.t1=l.sent,e.content=l.t0.parse.call(l.t0,l.t1),l.next=13;break;case 11:l.prev=11,l.t2=l.catch(3);case 13:return l.abrupt("return");case 14:if(e.enc_item_key){l.next=17;break}return console.log("Missing item encryption key, skipping decryption."),l.abrupt("return");case 17:if(n=e.enc_item_key,r=!0,!(i=this.encryptionComponentsFromString(n,t.mk,t.ak)).uuid||i.uuid===e.uuid){l.next=25;break}return console.error("Item key params UUID does not match item UUID"),e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,l.abrupt("return");case 25:return l.next=27,regeneratorRuntime.awrap(this.decryptText(i,r));case 27:if(o=l.sent){l.next=33;break}return console.log("Error decrypting item",e),e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,l.abrupt("return");case 33:return l.next=35,regeneratorRuntime.awrap(this.crypto.firstHalfOfKey(o));case 35:return a=l.sent,l.next=38,regeneratorRuntime.awrap(this.crypto.secondHalfOfKey(o));case 38:return s=l.sent,c=this.encryptionComponentsFromString(e.content,a,s),l.prev=40,l.t3=JSON,l.next=44,regeneratorRuntime.awrap(this.crypto.base64Decode(c.authParams));case 44:l.t4=l.sent,e.auth_params=l.t3.parse.call(l.t3,l.t4),l.next=50;break;case 48:l.prev=48,l.t5=l.catch(40);case 50:if(!c.uuid||c.uuid===e.uuid){l.next=54;break}return e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,l.abrupt("return");case 54:return l.next=56,regeneratorRuntime.awrap(this.decryptText(c,!0));case 56:(u=l.sent)?(1==e.errorDecrypting&&(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!1,e.content=u):(e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0);case 58:case"end":return l.stop()}}),null,this,[[3,11],[40,48]])}}])&&D(n.prototype,r),i&&D(n,i),t}(w);function j(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var F=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.operators=[],!t&&Object(r.d)()?Object(r.c)()?this.crypto=new d:this.crypto=new g:this.crypto=t}var t,n;return t=e,(n=[{key:"version",value:function(){return"003"}},{key:"supportsPasswordDerivationCost",value:function(e){return!(e>5e3)||this.crypto instanceof d}},{key:"supportedVersions",value:function(){return["001","002","003"]}},{key:"isVersionNewerThanLibraryVersion",value:function(e){var t=this.version();return parseInt(e)>parseInt(t)}},{key:"isProtocolVersionOutdated",value:function(e){var t={"001":Date.parse("2018-01-01"),"002":Date.parse("2020-01-01")}[e];return!!t&&new Date>t}},{key:"costMinimumForVersion",value:function(e){return{"001":S.pwCost(),"002":E.pwCost(),"003":T.pwCost()}[e]}},{key:"defaultPasswordGenerationCost",value:function(){return this.costMinimumForVersion(this.version())}},{key:"versionForItem",value:function(e){return e.content.substring(0,3)}},{key:"createOperatorForLatestVersion",value:function(){return this.createOperatorForVersion(this.version())}},{key:"createOperatorForVersion",value:function(e){if("001"===e)return new S(this.crypto);if("002"===e)return new E(this.crypto);if("003"===e)return new T(this.crypto);if("000"===e)return this.createOperatorForLatestVersion();throw"Unable to find operator for version ".concat(e)}},{key:"operatorForVersion",value:function(e){var t=e,n=this.operators[t];return n||(n=this.createOperatorForVersion(e),this.operators[t]=n),n}},{key:"defaultOperator",value:function(){return this.operatorForVersion(this.version())}},{key:"computeEncryptionKeysForUser",value:function(e,t){var n,r;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return n=t.version,r=this.operatorForVersion(n),i.abrupt("return",r.computeEncryptionKeysForUser(e,t));case 3:case"end":return i.stop()}}),null,this)}},{key:"generateInitialKeysAndAuthParamsForUser",value:function(e,t){var n;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=this.defaultOperator(),r.abrupt("return",n.generateInitialKeysAndAuthParamsForUser(e,t));case 2:case"end":return r.stop()}}),null,this)}},{key:"decryptItem",value:function(e,t){var n,r;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return n=this.versionForItem(e),r=this.operatorForVersion(n),i.abrupt("return",r.decryptItem(e,t));case 3:case"end":return i.stop()}}),null,this)}},{key:"encryptItem",value:function(e,t,n){var r,i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return r=n.version,i=this.operatorForVersion(r),o.abrupt("return",i.encryptItem(e,t,n));case 3:case"end":return o.stop()}}),null,this)}},{key:"decryptMultipleItems",value:function(e,t,n){var r,i=this;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return r=function(e){return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e){r.next=2;break}return r.abrupt("return");case 2:if(!0!==e.deleted||null!==e.content){r.next=4;break}return r.abrupt("return");case 4:if(!("string"==typeof e.content||e.content instanceof String)){r.next=19;break}return r.prev=6,r.next=9,regeneratorRuntime.awrap(i.decryptItem(e,t));case 9:r.next=19;break;case 11:if(r.prev=11,r.t0=r.catch(6),e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,!n){r.next=17;break}throw r.t0;case 17:return console.error("Error decrypting item",e,r.t0),r.abrupt("return");case 19:case"end":return r.stop()}}),null,null,[[6,11]])},o.abrupt("return",Promise.all(e.map((function(e){return r(e)}))));case 2:case"end":return o.stop()}}))}}])&&j(t.prototype,n),e}(),N=new F,L=n(3),U=n.n(L),B=n(2),H=n.n(B),z=n(5),V=n.n(z),W=n(125),K=n.n(W);function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var J,G=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keypath=t,this.operator=n,this.value=r,e.IsRecursiveOperator(this.operator)&&(this.value=this.value.map(e.fromArray))}var t,n;return t=e,(n=[{key:"fromArray",value:function(t){return new e(t[0],t[1],t[2])}},{key:"ObjectSatisfiesPredicate",value:function(t,n){if(Array.isArray(n)&&(n=this.fromArray(n)),e.IsRecursiveOperator(n.operator)){if("and"===n.operator){var r=!0,i=!1,o=void 0;try{for(var a,s=n.value[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value;if(!this.ObjectSatisfiesPredicate(t,c))return!1}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return!0}if("or"===n.operator){var u=!0,l=!1,f=void 0;try{for(var d,p=n.value[Symbol.iterator]();!(u=(d=p.next()).done);u=!0)if(c=d.value,this.ObjectSatisfiesPredicate(t,c))return!0}catch(e){l=!0,f=e}finally{try{u||null==p.return||p.return()}finally{if(l)throw f}}return!1}}var h=n.value;"string"==typeof h&&h.includes(".ago")&&(h=this.DateFromString(h));var v=n.keypath.split(".").reduce((function(e,t){return e&&e[t]}),t),m=[!1,"",null,void 0,NaN];return null==v?"!="==n.operator?!m.includes(n.value):m.includes(n.value):"="==n.operator?Array.isArray(v)?JSON.stringify(v)==JSON.stringify(h):v==h:"!="==n.operator?Array.isArray(v)?JSON.stringify(v)!=JSON.stringify(h):v!==h:"<"==n.operator?v<h:">"==n.operator?v>h:"<="==n.operator?v<=h:">="==n.operator?v>=h:"startsWith"==n.operator?v.startsWith(h):"in"==n.operator?-1!=h.indexOf(v):"includes"==n.operator?this.resolveIncludesPredicate(v,h):"matches"==n.operator&&new RegExp(h).test(v)}},{key:"resolveIncludesPredicate",value:function(t,n){if("string"==typeof n)return t.includes(n);var r;r=Array.isArray(n)?e.fromArray(n):n;var i=!0,o=!1,a=void 0;try{for(var s,c=t[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value;if(this.ObjectSatisfiesPredicate(u,r))return!0}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}return!1}},{key:"ItemSatisfiesPredicate",value:function(t,n){return Array.isArray(n)&&(n=e.fromArray(n)),this.ObjectSatisfiesPredicate(t,n)}},{key:"ItemSatisfiesPredicates",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(!this.ItemSatisfiesPredicate(e,s))return!1}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!0}},{key:"DateFromString",value:function(e){var t=e.split("."),n=t[1],r=new Date,i=parseInt(t[0]);return"days"==n?r.setDate(r.getDate()-i):"hours"==n&&r.setHours(r.getHours()-i),r}},{key:"IsRecursiveOperator",value:function(e){return["and","or"].includes(e)}}])&&q(t,n),e}();function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var X=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.content={},this.referencingObjects=[],this.updateFromJSON(t),this.uuid||Object(r.d)()&&(this.uuid=N.crypto.generateUUIDSync()),"object"!==Y(this.content)||this.content.references||(this.content.references=[])}var t,n,i;return t=e,i=[{key:"deepMerge",value:function(e,t){return K()(e,t,(function(e,t){if(V()(e))return t})),e}},{key:"AreItemContentsEqual",value:function(t){var n=t.leftContent,r=t.rightContent,i=t.keysToIgnore,o=t.appDataKeysToIgnore,a=function(e,t){if(!e)return e;var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)delete e[o.value]}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return e};return(n=JSON.parse(JSON.stringify(n))).appData&&a(n.appData[e.AppDomain],o),n=a(n,i),(r=JSON.parse(JSON.stringify(r))).appData&&a(r.appData[e.AppDomain],o),r=a(r,i),JSON.stringify(n)===JSON.stringify(r)}}],(n=[{key:"initUUID",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.uuid){e.next=4;break}return e.next=3,regeneratorRuntime.awrap(N.crypto.generateUUID());case 3:this.uuid=e.sent;case 4:case"end":return e.stop()}}),null,this)}},{key:"updateFromJSON",value:function(t){if(t){this.deleted=t.deleted,this.uuid=t.uuid,this.enc_item_key=t.enc_item_key,this.auth_hash=t.auth_hash,this.auth_params=t.auth_params;for(var n=0,r=["errorDecrypting","dirty","dirtyCount","dirtiedDate","dummy"];n<r.length;n++){var i=r[n];void 0!==t[i]&&(this[i]=t[i])}if(this.dirtiedDate&&"string"==typeof this.dirtiedDate&&(this.dirtiedDate=new Date(this.dirtiedDate)),this.content_type||(this.content_type=t.content_type),t.errorDecrypting)this.content=t.content;else try{var o="string"==typeof t.content?JSON.parse(t.content):t.content;e.deepMerge(this.contentObject,o)}catch(e){console.log("Error while updating item from json",e)}t.created_at&&(this.created_at=t.created_at),t.updated_at&&(this.updated_at=t.updated_at),this.created_at?this.created_at=new Date(this.created_at):this.created_at=new Date,this.updated_at?this.updated_at=new Date(this.updated_at):this.updated_at=new Date(0),this._client_updated_at=null,t.content?this.mapContentToLocalProperties(this.contentObject):1==t.deleted&&this.handleDeletedContent()}}},{key:"mapContentToLocalProperties",value:function(e){}},{key:"createContentJSONFromProperties",value:function(){var t=this.structureParams();return e.deepMerge(this.contentObject,t),t}},{key:"structureParams",value:function(){return this.getContentCopy()}},{key:"handleDeletedContent",value:function(){}},{key:"setDirty",value:function(e,t){this.dirty=e,this.dirtyCount||(this.dirtyCount=0),e?this.dirtyCount++:this.dirtyCount=0,this.dirtiedDate=new Date,e&&t?this.client_updated_at=new Date:this.hasRawClientUpdatedAtValue()||(this.client_updated_at=new Date(this.updated_at))}},{key:"updateLocalRelationships",value:function(){}},{key:"addItemAsRelationship",value:function(e){if(e.setIsBeingReferencedBy(this),!this.hasRelationshipWithItem(e)){var t=this.content.references||[];t.push({uuid:e.uuid,content_type:e.content_type}),this.content.references=t}}},{key:"removeItemAsRelationship",value:function(e){e.setIsNoLongerBeingReferencedBy(this),this.removeReferenceWithUuid(e.uuid)}},{key:"setIsBeingReferencedBy",value:function(e){U()(this.referencingObjects,{uuid:e.uuid})||this.referencingObjects.push(e)}},{key:"setIsNoLongerBeingReferencedBy",value:function(e){H()(this.referencingObjects,{uuid:e.uuid}),this.hasRelationshipWithItem(e)&&(this.removeReferenceWithUuid(e.uuid),this.setDirty(!0))}},{key:"removeReferenceWithUuid",value:function(e){var t=this.content.references||[];t=t.filter((function(t){return t.uuid!=e})),this.content.references=t}},{key:"hasRelationshipWithItem",value:function(e){return null!=this.content.references.find((function(t){return t.uuid==e.uuid}))}},{key:"isBeingRemovedLocally",value:function(){}},{key:"didFinishSyncing",value:function(){}},{key:"informReferencesOfUUIDChange",value:function(e,t){}},{key:"potentialItemOfInterestHasChangedItsUUID",value:function(e,t,n){if(!this.errorDecrypting){var r=!0,i=!1,o=void 0;try{for(var a,s=this.content.references[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value;c.uuid==t&&(c.uuid=n,this.setDirty(!0))}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}}},{key:"doNotEncrypt",value:function(){return!1}},{key:"setDomainDataItem",value:function(e,t,n){if(n){if(!this.errorDecrypting){this.content.appData||(this.content.appData={});var r=this.content.appData[n];r||(r={}),r[e]=t,this.content.appData[n]=r}}else console.error("SFItem.AppDomain needs to be set.")}},{key:"getDomainDataItem",value:function(e,t){if(t){if(!this.errorDecrypting){this.content.appData||(this.content.appData={});var n=this.content.appData[t];return n?n[e]:null}}else console.error("SFItem.AppDomain needs to be set.")}},{key:"setAppDataItem",value:function(t,n){this.setDomainDataItem(t,n,e.AppDomain)}},{key:"getAppDataItem",value:function(t){return this.getDomainDataItem(t,e.AppDomain)}},{key:"hasRawClientUpdatedAtValue",value:function(){return null!=this.getAppDataItem("client_updated_at")}},{key:"keysToIgnoreWhenCheckingContentEquality",value:function(){return[]}},{key:"appDataKeysToIgnoreWhenCheckingContentEquality",value:function(){return["client_updated_at"]}},{key:"getContentCopy",value:function(){return JSON.parse(JSON.stringify(this.content))}},{key:"isItemContentEqualWith",value:function(t){return e.AreItemContentsEqual({leftContent:this.content,rightContent:t.content,keysToIgnore:this.keysToIgnoreWhenCheckingContentEquality(),appDataKeysToIgnore:this.appDataKeysToIgnoreWhenCheckingContentEquality()})}},{key:"satisfiesPredicate",value:function(e){return G.ItemSatisfiesPredicate(this,e)}},{key:"createdAtString",value:function(){return this.dateToLocalizedString(this.created_at)}},{key:"updatedAtString",value:function(){return this.dateToLocalizedString(this.client_updated_at)}},{key:"updatedAtTimestamp",value:function(){return this.updated_at.getTime()}},{key:"dateToLocalizedString",value:function(e){if("undefined"!=typeof Intl&&Intl.DateTimeFormat){if(!J){var t=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;J=new Intl.DateTimeFormat(t,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"})}return J.format(e)}return e.toDateString()+" "+e.toLocaleTimeString()}},{key:"contentObject",get:function(){if(this.errorDecrypting)return this.content;if(!this.content)return this.content={},this.content;if(null!==this.content&&"object"===Y(this.content))return this.content;try{var e=JSON.parse(this.content);return this.content=e,this.content}catch(e){return console.log("Error parsing json",e,this),this.content={},this.content}}},{key:"pinned",get:function(){return this.getAppDataItem("pinned")}},{key:"archived",get:function(){return this.getAppDataItem("archived")}},{key:"locked",get:function(){return this.getAppDataItem("locked")}},{key:"displayName",get:function(){return"Item"}},{key:"client_updated_at",get:function(){if(!this._client_updated_at){var e=this.getAppDataItem("client_updated_at");this._client_updated_at=e?new Date(e):new Date(this.updated_at)}return this._client_updated_at},set:function(e){this._client_updated_at=e,this.setAppDataItem("client_updated_at",e)}}])&&Z(t.prototype,n),i&&Z(t,i),e}(),Q=n(44),ee=n.n(Q),te=n(13),ne=n.n(te),re=n(126),ie=n.n(re);function oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ae=function(){function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.item=t,this.keys=n,this.auth_params=r,this.keys&&!this.auth_params)throw"SFItemParams.auth_params must be supplied if supplying keys.";if(this.auth_params&&!this.auth_params.version)throw"SFItemParams.auth_params is missing version"}var t,n;return t=e,(n=[{key:"paramsForExportFile",value:function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.forExportFile=!0,!e){n.next=5;break}return n.abrupt("return",this.__params());case 5:return n.next=7,regeneratorRuntime.awrap(this.__params());case 7:return t=n.sent,n.abrupt("return",ee()(t,["deleted"]));case 9:case"end":return n.stop()}}),null,this)}},{key:"paramsForExtension",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.paramsForExportFile());case 1:case"end":return e.stop()}}),null,this)}},{key:"paramsForLocalStorage",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return this.additionalFields=["dirty","dirtiedDate","errorDecrypting"],this.forExportFile=!0,e.abrupt("return",this.__params());case 3:case"end":return e.stop()}}),null,this)}},{key:"paramsForSync",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.__params());case 1:case"end":return e.stop()}}),null,this)}},{key:"__params",value:function(){var e,t,n;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e={uuid:this.item.uuid,content_type:this.item.content_type,deleted:this.item.deleted,created_at:this.item.created_at,updated_at:this.item.updated_at},this.item.errorDecrypting){r.next=23;break}if(t=this.item.doNotEncrypt()&&!this.forExportFile,!this.keys||t){r.next=11;break}return r.next=6,regeneratorRuntime.awrap(N.encryptItem(this.item,this.keys,this.auth_params));case 6:n=r.sent,ne()(e,n),"001"!==this.auth_params.version&&(e.auth_hash=null),r.next=21;break;case 11:if(!this.forExportFile){r.next=15;break}r.t0=this.item.createContentJSONFromProperties(),r.next=19;break;case 15:return r.next=17,regeneratorRuntime.awrap(N.crypto.base64(JSON.stringify(this.item.createContentJSONFromProperties())));case 17:r.t1=r.sent,r.t0="000"+r.t1;case 19:e.content=r.t0,this.forExportFile||(e.enc_item_key=null,e.auth_hash=null);case 21:r.next=26;break;case 23:e.content=this.item.content,e.enc_item_key=this.item.enc_item_key,e.auth_hash=this.item.auth_hash;case 26:return this.additionalFields&&ne()(e,ie()(this.item,this.additionalFields)),r.abrupt("return",e);case 28:case"end":return r.stop()}}),null,this)}}])&&oe(t.prototype,n),e}();function se(e){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ue(e,t,n){return(ue="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=le(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var de=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==se(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,le(t).call(this,e))).content_type||(n.content_type="Tag"),n.notes||(n.notes=[]),n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fe(e,t)}(t,e),n=t,i=[{key:"arrayToDisplayString",value:function(e){return e.sort((function(e,t){return e.title>t.title})).map((function(e,t){return"#"+e.title})).join(" ")}}],(r=[{key:"mapContentToLocalProperties",value:function(e){ue(le(t.prototype),"mapContentToLocalProperties",this).call(this,e),this.title=e.title}},{key:"structureParams",value:function(){var e={title:this.title},n=ue(le(t.prototype),"structureParams",this).call(this);return Object.assign(n,e),n}},{key:"addItemAsRelationship",value:function(e){"Note"==e.content_type&&(U()(this.notes,{uuid:e.uuid})||(this.notes.push(e),e.tags.push(this))),ue(le(t.prototype),"addItemAsRelationship",this).call(this,e)}},{key:"removeItemAsRelationship",value:function(e){"Note"==e.content_type&&(H()(this.notes,{uuid:e.uuid}),H()(e.tags,{uuid:this.uuid})),ue(le(t.prototype),"removeItemAsRelationship",this).call(this,e)}},{key:"updateLocalRelationships",value:function(){var e=this.content.references.map((function(e){return e.uuid}));this.notes.slice().forEach(function(t){e.includes(t.uuid)||(H()(t.tags,{uuid:this.uuid}),H()(this.notes,{uuid:t.uuid}),t.setIsNoLongerBeingReferencedBy(this))}.bind(this))}},{key:"isBeingRemovedLocally",value:function(){var e=this;this.notes.forEach((function(t){H()(t.tags,{uuid:e.uuid}),t.setIsNoLongerBeingReferencedBy(e)})),this.notes.length=0,ue(le(t.prototype),"isBeingRemovedLocally",this).call(this)}},{key:"informReferencesOfUUIDChange",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.notes[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;H()(s.tags,{uuid:e}),s.tags.push(this)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"didFinishSyncing",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.notes[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.tagDidFinishSyncing(this)}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}},{key:"isSmartTag",value:function(){return"SN|SmartTag"==this.content_type}},{key:"displayName",get:function(){return"Tag"}}])&&ce(n.prototype,r),i&&ce(n,i),t}(X);function pe(e){return(pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function he(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ve(e,t,n){return(ve="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=me(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function me(e){return(me=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ye(e,t){return(ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ge=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==pe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,me(t).call(this,e))).text||(n.text=""),n.tags||(n.tags=[]),n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ye(e,t)}(t,e),n=t,i=[{key:"filterDummyNotes",value:function(e){return e.filter((function(e){return 0==e.dummy||null==e.dummy}))}}],(r=[{key:"mapContentToLocalProperties",value:function(e){ve(me(t.prototype),"mapContentToLocalProperties",this).call(this,e),this.title=e.title,this.text=e.text}},{key:"structureParams",value:function(){var e={title:this.title,text:this.text},n=ve(me(t.prototype),"structureParams",this).call(this);return Object.assign(n,e),n}},{key:"addItemAsRelationship",value:function(e){"Tag"==e.content_type&&e.addItemAsRelationship(this),ve(me(t.prototype),"addItemAsRelationship",this).call(this,e)}},{key:"setIsBeingReferencedBy",value:function(e){ve(me(t.prototype),"setIsBeingReferencedBy",this).call(this,e),this.clearSavedTagsString()}},{key:"setIsNoLongerBeingReferencedBy",value:function(e){ve(me(t.prototype),"setIsNoLongerBeingReferencedBy",this).call(this,e),this.clearSavedTagsString()}},{key:"isBeingRemovedLocally",value:function(){this.tags.forEach(function(e){H()(e.notes,{uuid:this.uuid})}.bind(this)),ve(me(t.prototype),"isBeingRemovedLocally",this).call(this)}},{key:"informReferencesOfUUIDChange",value:function(e,n){ve(me(t.prototype),"informReferencesOfUUIDChange",this).call(this);var r=!0,i=!1,o=void 0;try{for(var a,s=this.tags[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value;H()(c.notes,{uuid:e}),c.notes.push(this)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}},{key:"tagDidFinishSyncing",value:function(e){this.clearSavedTagsString()}},{key:"safeText",value:function(){return this.text||""}},{key:"safeTitle",value:function(){return this.title||""}},{key:"clearSavedTagsString",value:function(){this.savedTagsString=null}},{key:"tagsString",value:function(){return this.savedTagsString=de.arrayToDisplayString(this.tags),this.savedTagsString}},{key:"content_type",get:function(){return"Note"}},{key:"displayName",get:function(){return"Note"}}])&&he(n.prototype,r),i&&he(n,i),t}(X);function be(e){return(be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function we(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ke(e){return(ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function xe(e,t){return(xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $e=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==be(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,ke(t).call(this,e))).content_type="SN|SmartTag",n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xe(e,t)}(t,e),n=t,(r=[{key:"systemSmartTags",value:function(){return[new t({uuid:t.SystemSmartTagIdAllNotes,dummy:!0,content:{title:"All notes",isSystemTag:!0,isAllTag:!0,predicate:new G.fromArray(["content_type","=","Note"])}}),new t({uuid:t.SystemSmartTagIdArchivedNotes,dummy:!0,content:{title:"Archived",isSystemTag:!0,isArchiveTag:!0,predicate:new G.fromArray(["archived","=",!0])}}),new t({uuid:t.SystemSmartTagIdTrashedNotes,dummy:!0,content:{title:"Trash",isSystemTag:!0,isTrashTag:!0,predicate:new G.fromArray(["content.trashed","=",!0])}})]}}])&&we(n,r),t}(de);function _e(e){return(_e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Me(e){return(Me=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ce(e,t){return(Ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}$e.SystemSmartTagIdAllNotes="all-notes",$e.SystemSmartTagIdArchivedNotes="archived-notes",$e.SystemSmartTagIdTrashedNotes="trashed-notes";var Ae=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==_e(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,Me(t).call(this,e))}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ce(e,t)}(t,e),n=t,(r=[{key:"doNotEncrypt",value:function(){return!0}},{key:"content_type",get:function(){return"SF|MFA"}}])&&Se(n.prototype,r),t}(X);function Ie(e){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oe(e,t,n){return(Oe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=De(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function De(e){return(De=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Re(e,t){return(Re=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Pe=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==Ie(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,De(t).apply(this,arguments))}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Re(e,t)}(t,e),n=t,(r=[{key:"mapContentToLocalProperties",value:function(e){Oe(De(t.prototype),"mapContentToLocalProperties",this).call(this,e),this.url=e.url}},{key:"doNotEncrypt",value:function(){return!0}},{key:"content_type",get:function(){return"SF|Extension"}}])&&Ee(n.prototype,r),t}(X);function Te(e){return(Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function je(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fe(e,t,n){return(Fe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ne(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function Ne(e){return(Ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Le(e,t){return(Le=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ue=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e.window=null,(n=function(e,t){return!t||"object"!==Te(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,Ne(t).call(this,e))).componentData||(n.componentData={}),n.disassociatedItemIds||(n.disassociatedItemIds=[]),n.associatedItemIds||(n.associatedItemIds=[]),n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Le(e,t)}(t,e),n=t,i=[{key:"associativeAreas",value:function(){return["editor-editor"]}}],(r=[{key:"mapContentToLocalProperties",value:function(e){Fe(Ne(t.prototype),"mapContentToLocalProperties",this).call(this,e),e.hosted_url||(this.legacy_url=e.url),this.local_url=e.local_url,this.hosted_url=e.hosted_url||e.url,this.offlineOnly=e.offlineOnly,e.valid_until&&(this.valid_until=new Date(e.valid_until)),this.name=e.name,this.autoupdateDisabled=e.autoupdateDisabled,this.package_info=e.package_info,this.area=e.area,this.permissions=e.permissions,this.permissions||(this.permissions=[]),this.active=e.active,this.componentData=e.componentData||{},this.disassociatedItemIds=e.disassociatedItemIds||[],this.associatedItemIds=e.associatedItemIds||[]}},{key:"handleDeletedContent",value:function(){Fe(Ne(t.prototype),"handleDeletedContent",this).call(this),this.active=!1}},{key:"structureParams",value:function(){var e={legacy_url:this.legacy_url,hosted_url:this.hosted_url,local_url:this.local_url,valid_until:this.valid_until,offlineOnly:this.offlineOnly,name:this.name,area:this.area,package_info:this.package_info,permissions:this.permissions,active:this.active,autoupdateDisabled:this.autoupdateDisabled,componentData:this.componentData,disassociatedItemIds:this.disassociatedItemIds,associatedItemIds:this.associatedItemIds},n=Fe(Ne(t.prototype),"structureParams",this).call(this);return Object.assign(n,e),n}},{key:"isEditor",value:function(){return"editor-editor"==this.area}},{key:"isTheme",value:function(){return"SN|Theme"==this.content_type||"themes"==this.area}},{key:"isDefaultEditor",value:function(){return 1==this.getAppDataItem("defaultEditor")}},{key:"setLastSize",value:function(e){this.setAppDataItem("lastSize",e)}},{key:"getLastSize",value:function(){return this.getAppDataItem("lastSize")}},{key:"acceptsThemes",value:function(){return!(this.content.package_info&&"acceptsThemes"in this.content.package_info)||this.content.package_info.acceptsThemes}},{key:"getClientDataKey",value:function(){return this.legacy_url?this.legacy_url:this.uuid}},{key:"hasValidHostedUrl",value:function(){return this.hosted_url||this.legacy_url}},{key:"keysToIgnoreWhenCheckingContentEquality",value:function(){return["active","disassociatedItemIds","associatedItemIds"].concat(Fe(Ne(t.prototype),"keysToIgnoreWhenCheckingContentEquality",this).call(this))}},{key:"isAssociative",value:function(){return Component.associativeAreas().includes(this.area)}},{key:"associateWithItem",value:function(e){this.associatedItemIds.push(e.uuid)}},{key:"isExplicitlyEnabledForItem",value:function(e){return-1!==this.associatedItemIds.indexOf(e.uuid)}},{key:"isExplicitlyDisabledForItem",value:function(e){return-1!==this.disassociatedItemIds.indexOf(e.uuid)}},{key:"content_type",get:function(){return"SN|Component"}}])&&je(n.prototype,r),i&&je(n,i),t}(X),Be=n(127),He=n.n(Be),ze=n(4),Ve=n.n(ze);function We(e){return(We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ke(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qe(e,t,n){return(qe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Je(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function Je(e){return(Je=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ge(e,t){return(Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ye=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==We(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,Je(t).call(this,e))).notes||(n.notes=[]),n.data||(n.data={}),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ge(e,t)}(t,e),n=t,(r=[{key:"mapContentToLocalProperties",value:function(e){qe(Je(t.prototype),"mapContentToLocalProperties",this).call(this,e),this.url=e.url,this.name=e.name,this.data=e.data||{},this.default=e.default,this.systemEditor=e.systemEditor}},{key:"structureParams",value:function(){var e={url:this.url,name:this.name,data:this.data,default:this.default,systemEditor:this.systemEditor},n=qe(Je(t.prototype),"structureParams",this).call(this);return Object.assign(n,e),n}},{key:"referenceParams",value:function(){return He()(this.notes,(function(e){return{uuid:e.uuid,content_type:e.content_type}}))}},{key:"addItemAsRelationship",value:function(e){"Note"==e.content_type&&(U()(this.notes,e)||this.notes.push(e)),qe(Je(t.prototype),"addItemAsRelationship",this).call(this,e)}},{key:"removeItemAsRelationship",value:function(e){"Note"==e.content_type&&Ve()(this.notes,e),qe(Je(t.prototype),"removeItemAsRelationship",this).call(this,e)}},{key:"removeAndDirtyAllRelationships",value:function(){qe(Je(t.prototype),"removeAndDirtyAllRelationships",this).call(this),this.notes=[]}},{key:"removeReferencesNotPresentIn",value:function(e){qe(Je(t.prototype),"removeReferencesNotPresentIn",this).call(this,e);var n=e.map((function(e){return e.uuid}));this.notes.forEach(function(e){n.includes(e.uuid)||H()(this.notes,{uuid:e.uuid})}.bind(this))}},{key:"potentialItemOfInterestHasChangedItsUUID",value:function(e,t,n){"Note"===e.content_type&&U()(this.notes,{uuid:t})&&(H()(this.notes,{uuid:t}),this.notes.push(e))}},{key:"setData",value:function(e,t){return!(JSON.stringify(this.data[e])===JSON.stringify(t)||(this.data[e]=t,0))}},{key:"dataForKey",value:function(e){return this.data[e]||{}}},{key:"content_type",get:function(){return"SN|Editor"}}])&&Ke(n.prototype,r),t}(X);function Ze(e){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qe(e,t,n){return(Qe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=et(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function et(e){return(et=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function tt(e,t){return(tt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var rt=function e(t){nt(this,e),ne()(this,t),this.running=!1,this.error=!1,this.lastExecuted&&(this.lastExecuted=new Date(this.lastExecuted))},it=function(e){function t(e){var n;return nt(this,t),n=function(e,t){return!t||"object"!==Ze(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,et(t).call(this,e)),e.actions&&(n.actions=e.actions.map((function(e){return new rt(e)}))),n.actions||(n.actions=[]),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tt(e,t)}(t,e),n=t,(r=[{key:"actionsWithContextForItem",value:function(e){return this.actions.filter((function(t){return t.context==e.content_type||"Item"==t.context}))}},{key:"mapContentToLocalProperties",value:function(e){Qe(et(t.prototype),"mapContentToLocalProperties",this).call(this,e),this.description=e.description,this.url=e.url,this.name=e.name,this.package_info=e.package_info,this.supported_types=e.supported_types,e.actions&&(this.actions=e.actions.map((function(e){return new rt(e)})))}},{key:"structureParams",value:function(){var e={name:this.name,url:this.url,package_info:this.package_info,description:this.description,actions:this.actions.map((function(e){return ee()(e,["subrows","subactions"])})),supported_types:this.supported_types},n=Qe(et(t.prototype),"structureParams",this).call(this);return Object.assign(n,e),n}},{key:"content_type",get:function(){return"Extension"}}])&&Xe(n.prototype,r),t}(X);function ot(e){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function at(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function st(e){return(st=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ct(e,t){return(ct=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ut=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==ot(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,st(t).call(this,e))).area="themes",n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ct(e,t)}(t,e),n=t,(r=[{key:"isLayerable",value:function(){return this.package_info&&this.package_info.layerable}},{key:"setMobileRules",value:function(e){this.setAppDataItem("mobileRules",e)}},{key:"getMobileRules",value:function(){return this.getAppDataItem("mobileRules")||{constants:{},rules:{}}}},{key:"hasMobileRules",value:function(){return this.getAppDataItem("mobileRules")}},{key:"setNotAvailOnMobile",value:function(e){this.setAppDataItem("notAvailableOnMobile",e)}},{key:"getNotAvailOnMobile",value:function(){return this.getAppDataItem("notAvailableOnMobile")}},{key:"setMobileActive",value:function(e){this.setAppDataItem("mobileActive",e)}},{key:"isMobileActive",value:function(){return this.getAppDataItem("mobileActive")}},{key:"content_type",get:function(){return"SN|Theme"}},{key:"displayName",get:function(){return"Theme"}}])&&at(n.prototype,r),t}(Ue);function lt(e){return(lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dt(e,t,n){return(dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=pt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function pt(e){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ht(e,t){return(ht=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var vt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==lt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,pt(t).apply(this,arguments))}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ht(e,t)}(t,e),n=t,(r=[{key:"mapContentToLocalProperties",value:function(e){dt(pt(t.prototype),"mapContentToLocalProperties",this).call(this,e),this.storage=e.storage}},{key:"content_type",get:function(){return"SN|EncryptedStorage"}}])&&ft(n.prototype,r),t}(X),mt=n(28),yt=n.n(mt),gt=n(64),bt=n.n(gt);function wt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function kt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var xt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),e.MappingSourceRemoteRetrieved="MappingSourceRemoteRetrieved",e.MappingSourceRemoteSaved="MappingSourceRemoteSaved",e.MappingSourceLocalSaved="MappingSourceLocalSaved",e.MappingSourceLocalRetrieved="MappingSourceLocalRetrieved",e.MappingSourceLocalDirtied="MappingSourceLocalDirtied",e.MappingSourceComponentRetrieved="MappingSourceComponentRetrieved",e.MappingSourceDesktopInstalled="MappingSourceDesktopInstalled",e.MappingSourceRemoteActionRetrieved="MappingSourceRemoteActionRetrieved",e.MappingSourceFileImport="MappingSourceFileImport",e.isMappingSourceRetrieved=function(t){return[e.MappingSourceRemoteRetrieved,e.MappingSourceComponentRetrieved,e.MappingSourceRemoteActionRetrieved].includes(t)},this.$timeout=t||setTimeout.bind(window),this.itemSyncObservers=[],this.items=[],this.itemsHash={},this.missedReferences={},this.uuidChangeObservers=[]}var t,n;return t=e,(n=[{key:"handleSignout",value:function(){this.items.length=0,this.itemsHash={},this.missedReferences={}}},{key:"addModelUuidChangeObserver",value:function(e,t){this.uuidChangeObservers.push({id:e,callback:t})}},{key:"notifyObserversOfUuidChange",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.uuidChangeObservers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;try{s.callback(e,t)}catch(e){console.error("Notify observers of uuid change exception:",e)}}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"alternateUUIDForItem",value:function(t){var n,r,i,o,a,s,c;return regeneratorRuntime.async((function(u){for(;;)switch(u.prev=u.next){case 0:return n=this.createItem(t),u.next=3,regeneratorRuntime.awrap(N.crypto.generateUUID());case 3:for(n.uuid=u.sent,n.informReferencesOfUUIDChange(t.uuid,n.uuid),this.informModelsOfUUIDChangeForItem(n,t.uuid,n.uuid),r=!0,i=!1,o=void 0,u.prev=9,a=t.referencingObjects[Symbol.iterator]();!(r=(s=a.next()).done);r=!0)(c=s.value).setIsNoLongerBeingReferencedBy(t),t.setIsNoLongerBeingReferencedBy(c),c.addItemAsRelationship(n);u.next=17;break;case 13:u.prev=13,u.t0=u.catch(9),i=!0,o=u.t0;case 17:u.prev=17,u.prev=18,r||null==a.return||a.return();case 20:if(u.prev=20,!i){u.next=23;break}throw o;case 23:return u.finish(20);case 24:return u.finish(17);case 25:return this.setItemsDirty(t.referencingObjects,!0),this.resolveReferencesForItem(n),this.loggingEnabled&&console.log(t.uuid,"--\x3e",n.uuid),t.deleted=!0,t.content.references=[],this.setItemDirty(t,!1,!1,e.MappingSourceLocalSaved),u.next=33,regeneratorRuntime.awrap(this.mapResponseItemsToLocalModels([t],e.MappingSourceLocalSaved));case 33:return this.addItem(n),this.setItemDirty(n,!0,!0,e.MappingSourceLocalSaved),this.notifyObserversOfUuidChange(t,n),u.abrupt("return",n);case 37:case"end":return u.stop()}}),null,this,[[9,13,17,25],[18,,20,24]])}},{key:"informModelsOfUUIDChangeForItem",value:function(e,t,n){var r=!0,i=!1,o=void 0;try{for(var a,s=this.items[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)a.value.potentialItemOfInterestHasChangedItsUUID(e,t,n)}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}},{key:"didSyncModelsOffline",value:function(t){this.notifySyncObserversOfModels(t,e.MappingSourceLocalSaved)}},{key:"mapResponseItemsToLocalModels",value:function(e,t,n){return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.mapResponseItemsToLocalModelsWithOptions({items:e,source:t,sourceKey:n}));case 1:case"end":return r.stop()}}),null,this)}},{key:"mapResponseItemsToLocalModelsOmittingFields",value:function(e,t,n,r){return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",this.mapResponseItemsToLocalModelsWithOptions({items:e,omitFields:t,source:n,sourceKey:r}));case 1:case"end":return i.stop()}}),null,this)}},{key:"mapResponseItemsToLocalModelsWithOptions",value:function(e){var t,n,r,i,o,a,s,c,u,l,f,d,p,h,v,m,y,g,b,w,k,x,$,_,S,M,C,A,I,E,O,D,R,P,T,j,F,N,L;return regeneratorRuntime.async((function(U){for(;;)switch(U.prev=U.next){case 0:t=e.items,n=e.omitFields,r=e.source,i=e.sourceKey,e.options,o=[],a=[],s=[],c=!0,u=!1,l=void 0,U.prev=5,f=t[Symbol.iterator]();case 7:if(c=(d=f.next()).done){U.next=58;break}if(p=d.value){U.next=11;break}return U.abrupt("continue",55);case 11:if(h=!p.content&&!p.errorDecrypting,p.content_type&&p.uuid&&!h||p.deleted){U.next=16;break}return console.error("Server response item is corrupt:",p),U.abrupt("continue",55);case 16:if(!Array.isArray(n)){U.next=36;break}for(v=!0,m=!1,y=void 0,U.prev=20,g=n[Symbol.iterator]();!(v=(b=g.next()).done);v=!0)w=b.value,delete p[w];U.next=28;break;case 24:U.prev=24,U.t0=U.catch(20),m=!0,y=U.t0;case 28:U.prev=28,U.prev=29,v||null==g.return||g.return();case 31:if(U.prev=31,!m){U.next=34;break}throw y;case 34:return U.finish(31);case 35:return U.finish(28);case 36:if((k=this.findItem(p.uuid))&&(k.updateFromJSON(p),k.dummy=!1),x=p.content_type||k&&k.content_type,!this.acceptableContentTypes||this.acceptableContentTypes.includes(x)){U.next=42;break}return U.abrupt("continue",55);case 42:if($=!1,1!=p.deleted){U.next=50;break}if(!p.dirty){U.next=48;break}$=!0,U.next=50;break;case 48:return k&&(o.push(k),s.push(k),this.removeItemLocally(k)),U.abrupt("continue",55);case 50:k||(k=this.createItem(p)),this.addItem(k,$),k.errorDecrypting||s.push(k),o.push(k),a.push(p);case 55:c=!0,U.next=7;break;case 58:U.next=64;break;case 60:U.prev=60,U.t1=U.catch(5),u=!0,l=U.t1;case 64:U.prev=64,U.prev=65,c||null==f.return||f.return();case 67:if(U.prev=67,!u){U.next=70;break}throw l;case 70:return U.finish(67);case 71:return U.finish(64);case 72:for(_=!0,S=!1,M=void 0,U.prev=75,C=a.entries()[Symbol.iterator]();!(_=(A=C.next()).done);_=!0)I=wt(A.value,2),E=I[0],O=I[1],D=o[E],O.content&&this.resolveReferencesForItem(D),D.didFinishSyncing();U.next=83;break;case 79:U.prev=79,U.t2=U.catch(75),S=!0,M=U.t2;case 83:U.prev=83,U.prev=84,_||null==C.return||C.return();case 86:if(U.prev=86,!S){U.next=89;break}throw M;case 89:return U.finish(86);case 90:return U.finish(83);case 91:for(R=this.popMissedReferenceStructsForObjects(a),P=!0,T=!1,j=void 0,U.prev=95,F=function(){var e=L.value,t=o.find((function(t){return t.uuid==e.reference_uuid}));t&&e.for_item.addItemAsRelationship(t)},N=R[Symbol.iterator]();!(P=(L=N.next()).done);P=!0)F();U.next=104;break;case 100:U.prev=100,U.t3=U.catch(95),T=!0,j=U.t3;case 104:U.prev=104,U.prev=105,P||null==N.return||N.return();case 107:if(U.prev=107,!T){U.next=110;break}throw j;case 110:return U.finish(107);case 111:return U.finish(104);case 112:return U.next=114,regeneratorRuntime.awrap(this.notifySyncObserversOfModels(s,r,i));case 114:return U.abrupt("return",o);case 115:case"end":return U.stop()}}),null,this,[[5,60,64,72],[20,24,28,36],[29,,31,35],[65,,67,71],[75,79,83,91],[84,,86,90],[95,100,104,112],[105,,107,111]])}},{key:"missedReferenceBuildKey",value:function(e,t){return"".concat(e,":").concat(t)}},{key:"popMissedReferenceStructsForObjects",value:function(e){if(!e||0==e.length)return[];for(var t=[],n=[],r=e.map((function(e){return e.uuid})),i=r[0].length,o=0,a=Object.keys(this.missedReferences);o<a.length;o++){var s=a[o];r.includes(s.substring(0,i))&&(t.push(this.missedReferences[s]),n.push(s))}for(var c=0,u=n;c<u.length;c++){var l=u[c];delete this.missedReferences[l]}return t}},{key:"resolveReferencesForItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.errorDecrypting){var n=e.contentObject;if(e.updateLocalRelationships(),n.references){var r=n.references.slice(),i=r.map((function(e){return e.uuid})),o=!0,a=this.findItems(i,o),s=!0,c=!1,u=void 0;try{for(var l,f=a.entries()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var d=wt(l.value,2),p=d[0],h=d[1];if(h)e.addItemAsRelationship(h),t&&this.setItemDirty(h,!0);else{var v=i[p],m=this.missedReferenceBuildKey(v,e.uuid);if(!this.missedReferences[m]){var y={reference_uuid:v,for_item:e};this.missedReferences[m]=y}}}}catch(e){c=!0,u=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw u}}}}}},{key:"notifySyncObserversOfModels",value:function(e,t,n){var r,i,o,a,s,c,u,l=this;return regeneratorRuntime.async((function(f){for(;;)switch(f.prev=f.next){case 0:r=this.itemSyncObservers.sort((function(e,t){return e.priority<t.priority?-1:1})),i=!0,o=!1,a=void 0,f.prev=4,s=function(){var r,i,o,a,s,c,f,d,p,h;return regeneratorRuntime.async((function(v){for(;;)switch(v.prev=v.next){case 0:for(r=u.value,i=r.types.includes("*")?e:e.filter((function(e){return r.types.includes(e.content_type)})),o=[],a=[],s=!0,c=!1,f=void 0,v.prev=6,d=i[Symbol.iterator]();!(s=(p=d.next()).done);s=!0)(h=p.value).deleted?a.push(h):o.push(h);v.next=14;break;case 10:v.prev=10,v.t0=v.catch(6),c=!0,f=v.t0;case 14:v.prev=14,v.prev=15,s||null==d.return||d.return();case 17:if(v.prev=17,!c){v.next=20;break}throw f;case 20:return v.finish(17);case 21:return v.finish(14);case 22:if(!(i.length>0)){v.next=25;break}return v.next=25,regeneratorRuntime.awrap(l._callSyncObserverCallbackWithTimeout(r,i,o,a,t,n));case 25:case"end":return v.stop()}}),null,null,[[6,10,14,22],[15,,17,21]])},c=r[Symbol.iterator]();case 7:if(i=(u=c.next()).done){f.next=13;break}return f.next=10,regeneratorRuntime.awrap(s());case 10:i=!0,f.next=7;break;case 13:f.next=19;break;case 15:f.prev=15,f.t0=f.catch(4),o=!0,a=f.t0;case 19:f.prev=19,f.prev=20,i||null==c.return||c.return();case 22:if(f.prev=22,!o){f.next=25;break}throw a;case 25:return f.finish(22);case 26:return f.finish(19);case 27:case"end":return f.stop()}}),null,this,[[4,15,19,27],[20,,22,26]])}},{key:"_callSyncObserverCallbackWithTimeout",value:function(e,t,n,r,i,o){var a=this;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",new Promise((function(s,c){a.$timeout((function(){try{e.callback(t,n,r,i,o)}catch(e){console.error("Sync observer exception",e)}finally{s()}}))})));case 1:case"end":return s.stop()}}))}},{key:"setItemDirty",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;this.setItemsDirty([e],t,n,r,i)}},{key:"setItemsDirty",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=!0,s=!1,c=void 0;try{for(var u,l=t[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var f=u.value;f.setDirty(n,r)}}catch(e){s=!0,c=e}finally{try{a||null==l.return||l.return()}finally{if(s)throw c}}this.notifySyncObserversOfModels(t,i||e.MappingSourceLocalDirtied,o)}},{key:"createItem",value:function(t){var n=e.ContentTypeClassMapping&&e.ContentTypeClassMapping[t.content_type];return n||(n=X),new n(t)}},{key:"createDuplicateItemFromResponseItem",value:function(e){var t,n;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:if("function"!=typeof e.setDirty){r.next=3;break}return console.error("Attempting to create conflicted copy of non-response item."),r.abrupt("return",null);case 3:return t=JSON.parse(JSON.stringify(e)),r.next=6,regeneratorRuntime.awrap(N.crypto.generateUUID());case 6:return t.uuid=r.sent,n=this.createItem(t),r.abrupt("return",n);case 9:case"end":return r.stop()}}),null,this)}},{key:"duplicateItemAndAddAsConflict",value:function(e){return this.duplicateItemWithCustomContentAndAddAsConflict({content:e.content,duplicateOf:e})}},{key:"duplicateItemWithCustomContentAndAddAsConflict",value:function(e){var t=e.content,n=e.duplicateOf,r=this.duplicateItemWithCustomContent({content:t,duplicateOf:n});return this.addDuplicatedItemAsConflict({duplicate:r,duplicateOf:n}),r}},{key:"addDuplicatedItemAsConflict",value:function(e){var t=e.duplicate,n=e.duplicateOf;this.addDuplicatedItem(t,n),t.content.conflict_of=n.uuid}},{key:"duplicateItemWithCustomContent",value:function(e){var t=e.content,n=e.duplicateOf,r=new n.constructor({content:t});return r.created_at=n.created_at,r.content_type||(r.content_type=n.content_type),r}},{key:"duplicateItemAndAdd",value:function(e){var t=this.duplicateItemWithoutAdding(e);return this.addDuplicatedItem(t,e),t}},{key:"duplicateItemWithoutAdding",value:function(e){var t=new e.constructor({content:e.content});return t.created_at=e.created_at,t.content_type||(t.content_type=e.content_type),t}},{key:"addDuplicatedItem",value:function(e,t){this.addItem(e);var n=!0,r=!1,i=void 0;try{for(var o,a=t.referencingObjects[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;s.addItemAsRelationship(e),this.setItemDirty(s,!0)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.resolveReferencesForItem(e),this.setItemDirty(e,!0)}},{key:"addItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.addItems([e],t)}},{key:"addItems",value:function(e){var t=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1],e.forEach((function(e){t.itemsHash[e.uuid]||(t.itemsHash[e.uuid]=e,t.items.push(e))}))}},{key:"addItemSyncObserver",value:function(e,t,n){this.addItemSyncObserverWithPriority({id:e,types:t,callback:n,priority:1})}},{key:"addItemSyncObserverWithPriority",value:function(e){var t=e.id,n=e.priority,r=e.types,i=e.callback;Array.isArray(r)||(r=[r]),this.itemSyncObservers.push({id:t,types:r,priority:n,callback:i})}},{key:"removeItemSyncObserver",value:function(e){H()(this.itemSyncObservers,U()(this.itemSyncObservers,{id:e}))}},{key:"getDirtyItems",value:function(){return this.items.filter((function(e){return 1==e.dirty&&!e.dummy&&(!e.errorDecrypting||e.deleted)}))}},{key:"clearDirtyItems",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)i.value.setDirty(!1)}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"removeAndDirtyAllRelationshipsForItem",value:function(e){if(!e.errorDecrypting){var t=!0,n=!1,r=void 0;try{for(var i,o=e.content.references[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=this.findItem(a.uuid);s&&(e.removeItemAsRelationship(s),s.hasRelationshipWithItem(e)&&(s.removeItemAsRelationship(e),this.setItemDirty(s,!0)))}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}var c=!0,u=!1,l=void 0;try{for(var f,d=e.referencingObjects[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var p=f.value;p.removeItemAsRelationship(e),this.setItemDirty(p,!0)}}catch(e){u=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(u)throw l}}e.referencingObjects=[]}},{key:"setAllItemsDirty",value:function(){var e=this.allItems;this.setItemsDirty(e,!0)}},{key:"setItemToBeDeleted",value:function(e){e.deleted=!0,e.dummy||this.setItemDirty(e,!0),this.removeAndDirtyAllRelationshipsForItem(e)}},{key:"removeItemLocally",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:H()(this.items,{uuid:e.uuid}),delete this.itemsHash[e.uuid],e.isBeingRemovedLocally();case 3:case"end":return t.stop()}}),null,this)}},{key:"allItemsMatchingTypes",value:function(e){return this.allItems.filter((function(t){return(bt()(e,t.content_type)||bt()(e,"*"))&&!t.dummy}))}},{key:"invalidItems",value:function(){return this.allItems.filter((function(e){return e.errorDecrypting}))}},{key:"validItemsForContentType",value:function(e){return this.allItems.filter((function(t){return t.content_type==e&&!t.errorDecrypting}))}},{key:"findItem",value:function(e){return this.itemsHash[e]}},{key:"findItems",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value,u=this.itemsHash[c];(u||t)&&n.push(u)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}},{key:"itemsMatchingPredicate",value:function(e){return this.itemsMatchingPredicates([e])}},{key:"itemsMatchingPredicates",value:function(e){return this.filterItemsWithPredicates(this.allItems,e)}},{key:"filterItemsWithPredicates",value:function(e,t){return e.filter((function(e){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(!e.satisfiesPredicate(s))return!1}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!0}))}},{key:"importItems",value:function(t){var n,r,i,o,a,s,c,u,l,f,d,p,h,v,m,y,g,b,w,k,x,$,_,S,M,C,A;return regeneratorRuntime.async((function(I){for(;;)switch(I.prev=I.next){case 0:n=[],r={},i=!0,o=!1,a=void 0,I.prev=5,s=t[Symbol.iterator]();case 7:if(i=(c=s.next()).done){I.next=18;break}if(u=c.value,l=this.findItem(u.uuid)){I.next=13;break}return r[u.uuid]={},I.abrupt("continue",15);case 13:f=this.duplicateItemWithoutAdding(l),r[u.uuid]={frozenValue:f,itemRef:l};case 15:i=!0,I.next=7;break;case 18:I.next=24;break;case 20:I.prev=20,I.t0=I.catch(5),o=!0,a=I.t0;case 24:I.prev=24,I.prev=25,i||null==s.return||s.return();case 27:if(I.prev=27,!o){I.next=30;break}throw a;case 30:return I.finish(27);case 31:return I.finish(24);case 32:d=!0,p=!1,h=void 0,I.prev=35,v=t[Symbol.iterator]();case 37:if(d=(m=v.next()).done){I.next=52;break}if(y=m.value,g=r[y.uuid],b=g.frozenValue,w=g.itemRef,!b||w.errorDecrypting){I.next=47;break}return I.next=43,regeneratorRuntime.awrap(this.createDuplicateItemFromResponseItem(y));case 43:k=I.sent,y.deleted||b.isItemContentEqualWith(k)||(this.addDuplicatedItemAsConflict({duplicate:k,duplicateOf:w}),n.push(k)),I.next=49;break;case 47:n.push(y),w&&w.errorDecrypting&&(w.errorDecrypting=!1);case 49:d=!0,I.next=37;break;case 52:I.next=58;break;case 54:I.prev=54,I.t1=I.catch(35),p=!0,h=I.t1;case 58:I.prev=58,I.prev=59,d||null==v.return||v.return();case 61:if(I.prev=61,!p){I.next=64;break}throw h;case 64:return I.finish(61);case 65:return I.finish(58);case 66:return I.next=68,regeneratorRuntime.awrap(this.mapResponseItemsToLocalModels(n,e.MappingSourceFileImport));case 68:for(x=I.sent,$=!0,_=!1,S=void 0,I.prev=72,M=x[Symbol.iterator]();!($=(C=M.next()).done);$=!0)A=C.value,this.setItemDirty(A,!0,!1),A.deleted=!1;I.next=80;break;case 76:I.prev=76,I.t2=I.catch(72),_=!0,S=I.t2;case 80:I.prev=80,I.prev=81,$||null==M.return||M.return();case 83:if(I.prev=83,!_){I.next=86;break}throw S;case 86:return I.finish(83);case 87:return I.finish(80);case 88:return I.abrupt("return",x);case 89:case"end":return I.stop()}}),null,this,[[5,20,24,32],[25,,27,31],[35,54,58,66],[59,,61,65],[72,76,80,88],[81,,83,87]])}},{key:"getAllItemsJSONData",value:function(e,t,n){return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.getJSONDataForItems(this.allItems,e,t,n));case 1:case"end":return r.stop()}}),null,this)}},{key:"getJSONDataForItems",value:function(e,t,n,r){return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Promise.all(e.map((function(e){return new SFItemParams(e,t,n).paramsForExportFile()}))).then((function(e){if(r&&0==e.length)return null;var i={items:e};return t&&(i.auth_params=n),JSON.stringify(i,null,2)})));case 1:case"end":return i.stop()}}))}},{key:"computeDataIntegrityHash",value:function(){var e,t,n,r;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,e=this.allNondummyItems.sort((function(e,t){return t.updated_at-e.updated_at})),t=e.map((function(e){return e.updatedAtTimestamp()})),n=t.join(","),i.next=6,regeneratorRuntime.awrap(N.crypto.sha256(n));case 6:return r=i.sent,i.abrupt("return",r);case 10:return i.prev=10,i.t0=i.catch(0),console.error("Error computing data integrity hash",i.t0),i.abrupt("return",null);case 14:case"end":return i.stop()}}),null,this,[[0,10]])}},{key:"allItems",get:function(){return this.items.slice()}},{key:"allNondummyItems",get:function(){return this.items.filter((function(e){return!e.dummy}))}}])&&kt(t.prototype,n),e}();function $t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var _t=function(){function e(t){var n=t.modelManager,r=t.syncManager,i=t.desktopManager,o=t.nativeExtManager,a=t.alertManager,s=t.$uiRunner,c=t.$timeout,u=t.environment,l=t.platform;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),e.ClientDataDomain="org.standardnotes.sn.components",this.$uiRunner=s||function(e){e()},this.$timeout=c||setTimeout.bind(window),this.modelManager=n,this.syncManager=r,this.desktopManager=i,this.nativeExtManager=o,this.alertManager=a,this.streamObservers=[],this.contextStreamObservers=[],this.activeComponents=[],this.environment=u,this.platform=l,this.isDesktop="desktop"==this.environment,this.isMobile="mobile"==this.environment,"mobile"!=u&&this.configureForNonMobileUsage(),this.configureForGeneralUsage(),this.permissionDialogs=[],this.handlers=[]}var t,n;return t=e,(n=[{key:"configureForGeneralUsage",value:function(){var e=this;this.modelManager.addItemSyncObserver("component-manager","*",(function(t,n,r,i,o){var a=t.filter((function(e){return"SN|Component"===e.content_type||"SN|Theme"==e.content_type}));a.length>0&&i!=xt.MappingSourceRemoteSaved&&e.isDesktop&&e.desktopManager.syncComponentsInstallation(a);var s=!0,c=!1,u=void 0;try{for(var l,f=a[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var d=l.value,p=U()(e.activeComponents,{uuid:d.uuid});!d.active||d.deleted||p?!d.active&&p&&e.deactivateComponent(d):e.activateComponent(d)}}catch(e){c=!0,u=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw u}}var h=!0,v=!1,m=void 0;try{for(var y,g=function(){var n=y.value;if(o&&o==n.component.uuid)return"continue";var r=t.filter((function(e){return-1!==n.contentTypes.indexOf(e.content_type)}));if(0==r.length)return"continue";var i=[{name:"stream-items",content_types:n.contentTypes.sort()}];e.runWithPermissions(n.component,i,(function(){e.sendItemsInReply(n.component,r,n.originalMessage)}))},b=e.streamObservers[Symbol.iterator]();!(h=(y=b.next()).done);h=!0)g()}catch(e){v=!0,m=e}finally{try{h||null==b.return||b.return()}finally{if(v)throw m}}var w=[{name:"stream-context-item"}],k=!0,x=!1,$=void 0;try{for(var _,S=function(){var n=_.value;if(o&&o==n.component.uuid)return"continue";var r=!0,a=!1,s=void 0;try{for(var c,u=e.handlers[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var l=c.value;(l.areas.includes(n.component.area)||l.areas.includes("*"))&&l.contextRequestHandler&&(C=l.contextRequestHandler(n.component))&&(A=U()(t,{uuid:C.uuid}))&&e.runWithPermissions(n.component,w,(function(){e.sendContextItemInReply(n.component,A,n.originalMessage,i)}))}}catch(e){a=!0,s=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw s}}},M=e.contextStreamObservers[Symbol.iterator]();!(k=(_=M.next()).done);k=!0){var C,A;S()}}catch(e){x=!0,$=e}finally{try{k||null==M.return||M.return()}finally{if(x)throw $}}}))}},{key:"configureForNonMobileUsage",value:function(){var e=this,t=function(t){var n=!0,r=!1,i=void 0;try{for(var o,a=e.activeComponents[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(document.activeElement==e.iframeForComponent(s)){e.$timeout((function(){e.focusChangedForComponent(s)}));break}}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}};window.addEventListener?window.addEventListener("focus",t,!0):window.attachEvent("onfocusout",t),window.addEventListener?window.addEventListener("blur",t,!0):window.attachEvent("onblur",t),this.desktopManager.registerUpdateObserver((function(t){t.active&&t.isTheme()&&e.postActiveThemesToAllComponents()})),window.addEventListener("message",(function(t){e.loggingEnabled&&console.log("Web app: received message",t),t.data.sessionKey&&e.handleMessage(e.componentForSessionKey(t.data.sessionKey),t.data)}),!1)}},{key:"postActiveThemesToAllComponents",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.components[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;!o.isTheme()&&o.active&&o.window&&this.postActiveThemesToComponent(o)}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}},{key:"getActiveThemes",value:function(){return this.componentsForArea("themes").filter((function(e){return e.active}))}},{key:"urlsForActiveThemes",value:function(){var e=this;return this.getActiveThemes().map((function(t){return e.urlForComponent(t)}))}},{key:"postActiveThemesToComponent",value:function(e){var t={themes:this.urlsForActiveThemes()};this.sendMessageToComponent(e,{action:"themes",data:t})}},{key:"contextItemDidChangeInArea",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this.handlers[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(!1!==a.areas.includes(e)||a.areas.includes("*")){var s=this.contextStreamObservers.filter((function(t){return t.component.area===e})),c=!0,u=!1,l=void 0;try{for(var f,d=s[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var p=f.value;if(a.contextRequestHandler){var h=a.contextRequestHandler(p.component);h&&this.sendContextItemInReply(p.component,h,p.originalMessage)}}}catch(e){u=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(u)throw l}}}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"setComponentHidden",value:function(e,t){if(t)e.hidden=!0;else if(e.hidden){e.hidden=!1;var n=U()(this.contextStreamObservers,{identifier:e.uuid});n&&this.handleStreamContextItemMessage(e,n.originalMessage);var r=U()(this.streamObservers,{identifier:e.uuid});r&&this.handleStreamItemsMessage(e,r.originalMessage)}}},{key:"jsonForItem",value:function(t,n,r){var i={uuid:t.uuid,content_type:t.content_type,created_at:t.created_at,updated_at:t.updated_at,deleted:t.deleted};return i.content=t.createContentJSONFromProperties(),i.clientData=t.getDomainDataItem(n.getClientDataKey(),e.ClientDataDomain)||{},!r||r!=xt.MappingSourceRemoteSaved&&r!=xt.MappingSourceLocalSaved||(i.isMetadataUpdate=!0),this.removePrivatePropertiesFromResponseItems([i],n,{type:"outgoing"}),i}},{key:"sendItemsInReply",value:function(e,t,n,r){var i=this;this.loggingEnabled&&console.log("Web|componentManager|sendItemsInReply",e,t,n);var o={items:{}},a=t.map((function(t){return i.jsonForItem(t,e,r)}));o.items=a,this.replyToMessage(e,n,o)}},{key:"sendContextItemInReply",value:function(e,t,n,r){this.loggingEnabled&&console.log("Web|componentManager|sendContextItemInReply",e,t,n);var i={item:this.jsonForItem(t,e,r)};this.replyToMessage(e,n,i)}},{key:"replyToMessage",value:function(e,t,n){var r={action:"reply",original:t,data:n};this.sendMessageToComponent(e,r)}},{key:"sendMessageToComponent",value:function(e,t){if(!e.hidden||["component-registered","themes"].includes(t.action)){this.loggingEnabled&&console.log("Web|sendMessageToComponent",e,t);var n=this.urlForComponent(e);n.startsWith("http")||n.startsWith("file")||(n=window.location.href+n),e.window||this.alertManager.alert({text:"Standard Notes is trying to communicate with ".concat(e.name,", but an error is occurring. Please restart this extension and try again.")}),this.isMobile&&(t=JSON.stringify(t)),e.window.postMessage(t,n)}else this.loggingEnabled&&console.log("Component disabled for current item, not sending any messages.",e.name)}},{key:"componentsForArea",value:function(e){return this.components.filter((function(t){return t.area===e}))}},{key:"urlForComponent",value:function(e){if(e.offlineOnly&&!this.isDesktop)return null;if(e.offlineOnly||this.isDesktop&&e.local_url)return e.local_url&&e.local_url.replace("sn://",this.desktopManager.getExtServerHost());var t=e.hosted_url||e.legacy_url;if(this.isMobile){var n="ios"==this.platform?"localhost":"10.0.2.2";t=t.replace("localhost",n).replace("sn.local",n)}return t}},{key:"componentForUrl",value:function(e){return this.components.filter((function(t){return t.hosted_url===e||t.legacy_url===e}))[0]}},{key:"componentForSessionKey",value:function(e){var t=U()(this.components,{sessionKey:e});if(!t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.handlers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s.componentForSessionKeyHandler&&(t=s.componentForSessionKeyHandler(e)))break}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}return t}},{key:"handleMessage",value:function(e,t){var n=this;if(!e)return console.log("Component not defined for message, returning",t),void this.alertManager.alert({text:"An extension is trying to communicate with Standard Notes, but there is an error establishing a bridge. Please restart the app and try again."});if(e.readonly&&["save-items","associate-item","deassociate-item","create-item","create-items","delete-items","set-component-data"].includes(t.action))this.alertManager.alert({text:"The extension ".concat(e.name," is trying to save, but it is in a locked state and cannot accept changes.")});else{if("stream-items"===t.action)this.handleStreamItemsMessage(e,t);else if("stream-context-item"===t.action)this.handleStreamContextItemMessage(e,t);else if("set-component-data"===t.action)this.handleSetComponentDataMessage(e,t);else if("delete-items"===t.action)this.handleDeleteItemsMessage(e,t);else if("create-items"===t.action||"create-item"===t.action)this.handleCreateItemsMessage(e,t);else if("save-items"===t.action)this.handleSaveItemsMessage(e,t);else if("toggle-activate-component"===t.action){var r=this.modelManager.findItem(t.data.uuid);this.handleToggleComponentMessage(e,r,t)}else"request-permissions"===t.action?this.handleRequestPermissionsMessage(e,t):"install-local-component"===t.action?this.handleInstallLocalComponentMessage(e,t):"duplicate-item"===t.action&&this.handleDuplicateItemMessage(e,t);var i=!0,o=!1,a=void 0;try{for(var s,c=function(){var r=s.value;r.actionHandler&&(r.areas.includes(e.area)||r.areas.includes("*"))&&n.$timeout((function(){r.actionHandler(e,t.action,t.data)}))},u=this.handlers[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)c()}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}}}},{key:"removePrivatePropertiesFromResponseItems",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("incoming"==n.type){var r=["updated_at"],i=!0,o=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value;if("function"!=typeof u.setDirty){var l=!0,f=!1,d=void 0;try{for(var p,h=r[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){var v=p.value;delete u[v]}}catch(e){f=!0,d=e}finally{try{l||null==h.return||h.return()}finally{if(f)throw d}}}else console.error("Attempting to pass object. Use JSON.")}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}}if(!(t&&this.nativeExtManager&&this.nativeExtManager.isSystemExtension(t))){var m=["autoupdateDisabled","permissions","active"];n&&n.includeUrls&&(m=m.concat(["url","hosted_url","local_url"]));var y=!0,g=!1,b=void 0;try{for(var w,k=e[Symbol.iterator]();!(y=(w=k.next()).done);y=!0){var x=w.value;if("function"!=typeof x.setDirty){var $=!0,_=!1,S=void 0;try{for(var M,C=m[Symbol.iterator]();!($=(M=C.next()).done);$=!0){var A=M.value;delete x.content[A]}}catch(e){_=!0,S=e}finally{try{$||null==C.return||C.return()}finally{if(_)throw S}}}else console.error("Attempting to pass object. Use JSON.")}}catch(e){g=!0,b=e}finally{try{y||null==k.return||k.return()}finally{if(g)throw b}}}}},{key:"handleStreamItemsMessage",value:function(e,t){var n=this,r=[{name:"stream-items",content_types:t.data.content_types.sort()}];this.runWithPermissions(e,r,(function(){U()(n.streamObservers,{identifier:e.uuid})||n.streamObservers.push({identifier:e.uuid,component:e,originalMessage:t,contentTypes:t.data.content_types});var r=[],i=!0,o=!1,a=void 0;try{for(var s,c=t.data.content_types[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value;r=r.concat(n.modelManager.validItemsForContentType(u))}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}n.sendItemsInReply(e,r,t)}))}},{key:"handleStreamContextItemMessage",value:function(e,t){var n=this;this.runWithPermissions(e,[{name:"stream-context-item"}],(function(){U()(n.contextStreamObservers,{identifier:e.uuid})||n.contextStreamObservers.push({identifier:e.uuid,component:e,originalMessage:t});var r=!0,i=!1,o=void 0;try{for(var a,s=n.handlersForArea(e.area)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value;if(c.contextRequestHandler){var u=c.contextRequestHandler(e);u&&n.sendContextItemInReply(e,u,t)}}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}))}},{key:"isItemIdWithinComponentContextJurisdiction",value:function(e,t){return this.itemIdsInContextJurisdictionForComponent(t).includes(e)}},{key:"itemIdsInContextJurisdictionForComponent",value:function(e){var t=[],n=!0,r=!1,i=void 0;try{for(var o,a=this.handlersForArea(e.area)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s.contextRequestHandler){var c=s.contextRequestHandler(e);c&&t.push(c.uuid)}}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}},{key:"handlersForArea",value:function(e){return this.handlers.filter((function(t){return t.areas.includes(e)}))}},{key:"handleSaveItemsMessage",value:function(t,n){var r,i,o,a,s,c,u,l,f,d,p,h=this;return regeneratorRuntime.async((function(v){for(;;)switch(v.prev=v.next){case 0:r=n.data.items,i=[],o=this.itemIdsInContextJurisdictionForComponent(t),a=r.slice(),s=!0,c=!1,u=void 0,v.prev=7,l=r.slice()[Symbol.iterator]();case 9:if(s=(f=l.next()).done){v.next=18;break}if(d=f.value,!o.includes(d.uuid)){v.next=15;break}return i.push({name:"stream-context-item"}),Ve()(a,d),v.abrupt("break",18);case 15:s=!0,v.next=9;break;case 18:v.next=24;break;case 20:v.prev=20,v.t0=v.catch(7),c=!0,u=v.t0;case 24:v.prev=24,v.prev=25,s||null==l.return||l.return();case 27:if(v.prev=27,!c){v.next=30;break}throw u;case 30:return v.finish(27);case 31:return v.finish(24);case 32:a.length>0&&(p=yt()(a.map((function(e){return e.content_type}))).sort(),i.push({name:"stream-items",content_types:p})),this.runWithPermissions(t,i,(function(){var i,o,a,s,c,u,l,f,d,p,v,m,y,g,b,w,k,x,$;return regeneratorRuntime.async((function(_){for(;;)switch(_.prev=_.next){case 0:for(h.removePrivatePropertiesFromResponseItems(r,t,{includeUrls:!0,type:"incoming"}),i=r.map((function(e){return e.uuid})),o=h.modelManager.findItems(i),a=0,s=!0,c=!1,u=void 0,_.prev=7,l=o[Symbol.iterator]();!(s=(f=l.next()).done);s=!0)(d=f.value).locked&&(H()(r,{uuid:d.uuid}),a++);_.next=15;break;case 11:_.prev=11,_.t0=_.catch(7),c=!0,u=_.t0;case 15:_.prev=15,_.prev=16,s||null==l.return||l.return();case 18:if(_.prev=18,!c){_.next=21;break}throw u;case 21:return _.finish(18);case 22:return _.finish(15);case 23:return a>0&&(p=1==a?"item":"items",v=1==a?"is":"are",h.alertManager.alert({title:"Items Locked",text:"".concat(a," ").concat(p," you are attempting to save ").concat(v," locked and cannot be edited.")})),_.next=26,regeneratorRuntime.awrap(h.modelManager.mapResponseItemsToLocalModels(r,xt.MappingSourceComponentRetrieved,t.uuid));case 26:m=_.sent,y=!0,g=!1,b=void 0,_.prev=30,w=r[Symbol.iterator]();case 32:if(y=(k=w.next()).done){_.next=42;break}if(x=k.value,$=U()(m,{uuid:x.uuid})){_.next=38;break}return h.alertManager.alert({text:"The extension ".concat(t.name," is trying to save an item with type ").concat(x.content_type,", but that item does not exist. Please restart this extension and try again.")}),_.abrupt("continue",39);case 38:$.locked||(x.clientData&&$.setDomainDataItem(t.getClientDataKey(),x.clientData,e.ClientDataDomain),h.modelManager.setItemDirty($,!0,!0,xt.MappingSourceComponentRetrieved,t.uuid));case 39:y=!0,_.next=32;break;case 42:_.next=48;break;case 44:_.prev=44,_.t1=_.catch(30),g=!0,b=_.t1;case 48:_.prev=48,_.prev=49,y||null==w.return||w.return();case 51:if(_.prev=51,!g){_.next=54;break}throw b;case 54:return _.finish(51);case 55:return _.finish(48);case 56:h.syncManager.sync().then((function(e){var r=Object.assign({},n);r.action=e&&e.error?"save-error":"save-success",h.replyToMessage(t,n,{error:e&&e.error}),h.handleMessage(t,r)}));case 57:case"end":return _.stop()}}),null,null,[[7,11,15,23],[16,,18,22],[30,44,48,56],[49,,51,55]])}));case 34:case"end":return v.stop()}}),null,this,[[7,20,24,32],[25,,27,31]])}},{key:"handleDuplicateItemMessage",value:function(e,t){var n=this,r=t.data.item,i=this.modelManager.findItem(r.uuid),o=[{name:"stream-items",content_types:[i.content_type]}];this.runWithPermissions(e,o,(function(){var r=n.modelManager.duplicateItemAndAdd(i);n.syncManager.sync(),n.replyToMessage(e,t,{item:n.jsonForItem(r,e)})}))}},{key:"handleCreateItemsMessage",value:function(t,n){var r=this,i=n.data.item?[n.data.item]:n.data.items,o=[{name:"stream-items",content_types:yt()(i.map((function(e){return e.content_type})))}];this.runWithPermissions(t,o,(function(){r.removePrivatePropertiesFromResponseItems(i,t,{type:"incoming"});var o=[],a=!0,s=!1,c=void 0;try{for(var u,l=i[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var f=u.value,d=r.modelManager.createItem(f);f.clientData&&d.setDomainDataItem(t.getClientDataKey(),f.clientData,e.ClientDataDomain),r.modelManager.addItem(d),r.modelManager.resolveReferencesForItem(d,!0),r.modelManager.setItemDirty(d,!0),o.push(d)}}catch(e){s=!0,c=e}finally{try{a||null==l.return||l.return()}finally{if(s)throw c}}r.syncManager.sync();var p="create-item"==n.action?{item:r.jsonForItem(o[0],t)}:{items:o.map((function(e){return r.jsonForItem(e,t)}))};r.replyToMessage(t,n,p)}))}},{key:"handleDeleteItemsMessage",value:function(e,t){var n=this,r=[{name:"stream-items",content_types:yt()(t.data.items.map((function(e){return e.content_type}))).sort()}];this.runWithPermissions(e,r,(function(){var r,i,o,a,s,c,u,l,f,d,p;return regeneratorRuntime.async((function(h){for(;;)switch(h.prev=h.next){case 0:return r=t.data.items,i=1==r.length?"item":"items",o=null,a=!0,h.next=6,regeneratorRuntime.awrap(n.alertManager.confirm({text:"Are you sure you want to delete ".concat(r.length," ").concat(i,"?")}).catch((function(){a=!1})));case 6:if(!a){h.next=42;break}s=!0,c=!1,u=void 0,h.prev=10,l=r[Symbol.iterator]();case 12:if(s=(f=l.next()).done){h.next=24;break}if(d=f.value,p=n.modelManager.findItem(d.uuid)){h.next=18;break}return n.alertManager.alert({text:"The item you are trying to delete cannot be found."}),h.abrupt("continue",21);case 18:["SN|Component","SN|Theme"].includes(p.content_type)&&n.deactivateComponent(p,!0),n.modelManager.setItemToBeDeleted(p),n.modelManager.notifySyncObserversOfModels([p],xt.MappingSourceRemoteSaved);case 21:s=!0,h.next=12;break;case 24:h.next=30;break;case 26:h.prev=26,h.t0=h.catch(10),c=!0,u=h.t0;case 30:h.prev=30,h.prev=31,s||null==l.return||l.return();case 33:if(h.prev=33,!c){h.next=36;break}throw u;case 36:return h.finish(33);case 37:return h.finish(30);case 38:n.syncManager.sync(),o={deleted:!0},h.next=43;break;case 42:o={deleted:!1};case 43:n.replyToMessage(e,t,o);case 44:case"end":return h.stop()}}),null,null,[[10,26,30,38],[31,,33,37]])}))}},{key:"handleRequestPermissionsMessage",value:function(e,t){var n=this;this.runWithPermissions(e,t.data.permissions,(function(){n.replyToMessage(e,t,{approved:!0})}))}},{key:"handleSetComponentDataMessage",value:function(e,t){var n=this;this.runWithPermissions(e,[],(function(){e.componentData=t.data.componentData,n.modelManager.setItemDirty(e,!0),n.syncManager.sync()}))}},{key:"handleToggleComponentMessage",value:function(e,t,n){this.toggleComponent(t)}},{key:"toggleComponent",value:function(e){var t=this;if("modal"==e.area)this.openModalComponent(e);else if(e.active)this.deactivateComponent(e);else if("SN|Theme"==e.content_type){var n=this.getActiveThemes();this.activateComponent(e),e.isLayerable()||setTimeout((function(){var e=!0,r=!1,i=void 0;try{for(var o,a=n[Symbol.iterator]();!(e=(o=a.next()).done);e=!0){var s=o.value;s&&!s.isLayerable()&&t.deactivateComponent(s)}}catch(e){r=!0,i=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw i}}}),10)}else this.activateComponent(e)}},{key:"handleInstallLocalComponentMessage",value:function(e,t){if(!this.nativeExtManager||this.nativeExtManager.isSystemExtension(e)){var n=this.modelManager.findItem(t.data.uuid);this.desktopManager.installComponent(n)}}},{key:"runWithPermissions",value:function(e,t,n){e.permissions||(e.permissions=[]),t=JSON.parse(JSON.stringify(t));var r=e.permissions,i=!0,o=!1,a=void 0;try{for(var s,c=function(){var e=s.value,n=r.find((function(t){return t.name==e.name}));if(!n)return"continue";var i=e.content_types;if(!i)return Ve()(t,e),"continue";var o=!0,a=!1,c=void 0;try{for(var u,l=n.content_types[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var f=u.value;Ve()(i,f)}}catch(e){a=!0,c=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw c}}0==i.length&&Ve()(t,e)},u=t.slice()[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)c()}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}t.length>0?this.promptForPermissions(e,t,(function(e){e&&n()})):n()}},{key:"promptForPermissions",value:function(e,t,n){var r=this,i={};i.component=e,i.permissions=t,i.permissionsString=this.permissionsStringForPermissions(t,e),i.actionBlock=n,i.callback=function(n){if(n){var o=!0,a=!1,s=void 0;try{for(var c,u=function(){var t=c.value,n=e.permissions.find((function(e){return e.name==t.name}));if(n){var r=n.content_types||[];n.content_types=yt()(r.concat(t.content_types))}else e.permissions.push(t)},l=t[Symbol.iterator]();!(o=(c=l.next()).done);o=!0)u()}catch(e){a=!0,s=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw s}}r.modelManager.setItemDirty(e,!0),r.syncManager.sync()}r.permissionDialogs=r.permissionDialogs.filter((function(r){return r==i?(r.actionBlock&&r.actionBlock(n),!1):!!(r.component!=e||r.permissions!=t&&(o=t,r.permissions.some((function(e){return!o.find((function(t){return JSON.stringify(t)===JSON.stringify(e)}))}))))||(n&&r.actionBlock&&r.actionBlock(n),!1);var o})),r.permissionDialogs.length>0&&r.presentPermissionsDialog(r.permissionDialogs[0])};var o=U()(this.permissionDialogs,{component:e});this.permissionDialogs.push(i),o?console.log("Existing dialog, not presenting."):this.presentPermissionsDialog(i)}},{key:"presentPermissionsDialog",value:function(e){console.error("Must override")}},{key:"openModalComponent",value:function(e){console.error("Must override")}},{key:"registerHandler",value:function(e){this.handlers.push(e)}},{key:"deregisterHandler",value:function(e){var t=U()(this.handlers,{identifier:e});t?this.handlers.splice(this.handlers.indexOf(t),1):console.log("Attempting to deregister non-existing handler")}},{key:"registerComponentWindow",value:function(e,t){return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return e.window===t&&this.loggingEnabled&&console.log("Web|componentManager","attempting to re-register same component window."),this.loggingEnabled&&console.log("Web|componentManager|registerComponentWindow",e),e.window=t,n.next=5,regeneratorRuntime.awrap(N.crypto.generateUUID());case 5:e.sessionKey=n.sent,this.sendMessageToComponent(e,{action:"component-registered",sessionKey:e.sessionKey,componentData:e.componentData,data:{uuid:e.uuid,environment:this.environment,platform:this.platform,activeThemeUrls:this.urlsForActiveThemes()}}),this.postActiveThemesToComponent(e),this.desktopManager&&this.desktopManager.notifyComponentActivation(e);case 9:case"end":return n.stop()}}),null,this)}},{key:"activateComponent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=1!=e.active;e.active=!0;var i=!0,o=!1,a=void 0;try{for(var s,c=function(){var n=s.value;(n.areas.includes(e.area)||n.areas.includes("*"))&&t.$uiRunner((function(){n.activationHandler&&n.activationHandler(e)}))},u=this.handlers[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)c()}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}r&&!n&&(this.modelManager.setItemDirty(e,!0),this.syncManager.sync()),this.activeComponents.includes(e)||this.activeComponents.push(e),"themes"==e.area&&this.postActiveThemesToAllComponents()}},{key:"deactivateComponent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0!=e.active;e.active=!1,e.sessionKey=null;var i=!0,o=!1,a=void 0;try{for(var s,c=function(){var n=s.value;(n.areas.includes(e.area)||n.areas.includes("*"))&&t.$uiRunner((function(){n.activationHandler&&n.activationHandler(e)}))},u=this.handlers[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)c()}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}r&&!n&&(this.modelManager.setItemDirty(e,!0),this.syncManager.sync()),Ve()(this.activeComponents,e),this.streamObservers=this.streamObservers.filter((function(t){return t.component!==e})),this.contextStreamObservers=this.contextStreamObservers.filter((function(t){return t.component!==e})),"themes"==e.area&&this.postActiveThemesToAllComponents()}},{key:"reloadComponent",value:function(e){var t,n,r,i,o,a,s=this;return regeneratorRuntime.async((function(c){for(;;)switch(c.prev=c.next){case 0:for(e.active=!1,t=!0,n=!1,r=void 0,c.prev=4,i=function(){var t=a.value;(t.areas.includes(e.area)||t.areas.includes("*"))&&s.$uiRunner((function(){t.activationHandler&&t.activationHandler(e)}))},o=this.handlers[Symbol.iterator]();!(t=(a=o.next()).done);t=!0)i();c.next=13;break;case 9:c.prev=9,c.t0=c.catch(4),n=!0,r=c.t0;case 13:c.prev=13,c.prev=14,t||null==o.return||o.return();case 16:if(c.prev=16,!n){c.next=19;break}throw r;case 19:return c.finish(16);case 20:return c.finish(13);case 21:return this.streamObservers=this.streamObservers.filter((function(t){return t.component!==e})),this.contextStreamObservers=this.contextStreamObservers.filter((function(t){return t.component!==e})),"themes"==e.area&&this.postActiveThemesToAllComponents(),c.abrupt("return",new Promise((function(t,n){s.$timeout((function(){e.active=!0;var n=!0,r=!1,i=void 0;try{for(var o,a=s.handlers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var c=o.value;(c.areas.includes(e.area)||c.areas.includes("*"))&&s.$uiRunner((function(){c.activationHandler&&c.activationHandler(e),t()}))}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}s.activeComponents.includes(e)||s.activeComponents.push(e),"themes"==e.area&&s.postActiveThemesToAllComponents(),t()}))})));case 25:case"end":return c.stop()}}),null,this,[[4,9,13,21],[14,,16,20]])}},{key:"deleteComponent",value:function(e){this.modelManager.setItemToBeDeleted(e),this.syncManager.sync()}},{key:"isComponentActive",value:function(e){return e.active}},{key:"iframeForComponent",value:function(e){for(var t=0,n=Array.from(document.getElementsByTagName("iframe"));t<n.length;t++){var r=n[t];if(r.dataset.componentId===e.uuid)return r}}},{key:"focusChangedForComponent",value:function(e){var t=document.activeElement==this.iframeForComponent(e),n=!0,r=!1,i=void 0;try{for(var o,a=this.handlers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;s.focusHandler&&s.focusHandler(e,t)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"handleSetSizeEvent",value:function(e,t){var n=function(e,n){var r="string"==typeof n.width?n.width:"".concat(t.width,"px"),i="string"==typeof n.height?n.height:"".concat(t.height,"px");e&&e.setAttribute("style","width:".concat(r,"; height:").concat(i,";"))};if("rooms"==e.area||"modal"==e.area){var r="rooms"==e.area?"inner":"outer",i=document.getElementById("component-content-".concat(r,"-").concat(e.uuid));i&&n(i,t)}else{var o=this.iframeForComponent(e);if(!o)return;if(n(o,t),"editor-stack"==e.area){var a=o.parentElement;a&&n(a,t)}}}},{key:"editorForNote",value:function(e){var t=this.componentsForArea("editor-editor"),n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s.isExplicitlyEnabledForItem(e))return s}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}if(this.isMobile){if(!e.content.mobilePrefersPlainEditor)return this.getDefaultEditor()}else if(!e.getAppDataItem("prefersPlainEditor"))return t.filter((function(e){return e.isDefaultEditor()}))[0]}},{key:"permissionsStringForPermissions",value:function(e,t){var n=this,r="",i=e.length,o=function(e,t){return e>0?e==t-1?2==t?" and ":", and ":", ":""};return e.forEach((function(e,a){if("stream-items"===e.name){for(var s=e.content_types.map((function(e){var t=n.modelManager.humanReadableDisplayForContentType(e);return t?t+"s":"items of type "+e})),c="",u=0;u<s.length;u++){var l=s[u];c+=o(u,s.length+i-a-1),c+=l}r+=o(a,i),r+=c,s.length>=2&&a<i-1&&(r+=", ")}else"stream-context-item"===e.name&&(r+=o(a,i),r+={"editor-stack":"working note","note-tags":"working note","editor-editor":"working note"}[t.area])})),r+"."}},{key:"components",get:function(){return this.modelManager.allItemsMatchingTypes(["SN|Component","SN|Theme"])}}])&&$t(t.prototype,n),e}();function St(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Mt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.item=X.deepMerge({},t),this.defaultContentKeyToDiffOn="text",this.textCharDiffLength=0,"string"==typeof this.item.updated_at&&(this.item.updated_at=new Date(this.item.updated_at))}var t,n;return t=e,(n=[{key:"setPreviousEntry",value:function(e){this.hasPreviousEntry=null!=e,this.item.content[this.defaultContentKeyToDiffOn]&&(this.textCharDiffLength=e?this.item.content[this.defaultContentKeyToDiffOn].length-e.item.content[this.defaultContentKeyToDiffOn].length:this.item.content[this.defaultContentKeyToDiffOn].length)}},{key:"operationVector",value:function(){return null!=this.textCharDiffLength?this.hasPreviousEntry&&0!=this.textCharDiffLength?this.textCharDiffLength<0?-1:1:0:1}},{key:"deltaSize",value:function(){return null!=this.textCharDiffLength?Math.abs(this.textCharDiffLength):1}},{key:"isSameAsEntry",value:function(e){if(!e)return!1;var t=new X(this.item),n=new X(e.item);return t.isItemContentEqualWith(n)}}])&&St(t.prototype,n),e}();function Ct(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var At=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.entries||(this.entries=[]),t.entries){var n=!0,r=!1,i=void 0;try{for(var o,a=t.entries[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,c=this.createEntryForItem(s.item);c.setPreviousEntry(this.getLastEntry()),this.entries.push(c)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}}var t,n;return t=e,(n=[{key:"createEntryForItem",value:function(t){var n=e.HistoryEntryClassMapping&&e.HistoryEntryClassMapping[t.content_type];return n||(n=Mt),new n(t)}},{key:"getLastEntry",value:function(){return this.entries[this.entries.length-1]}},{key:"addHistoryEntryForItem",value:function(e){var t=this.createEntryForItem(e),n=this.getLastEntry();if(t.setPreviousEntry(n),!t.isSameAsEntry(n))return this.entries.push(t),t}},{key:"clear",value:function(){this.entries.length=0}},{key:"optimize",value:function(){var t=this,n=[],r=function(t){return t.deltaSize()>e.LargeEntryDeltaThreshold},i=function(e,i,o){if(o?n.push(e):-1!==(i=n.indexOf(e))&&n.splice(i,1),o&&r(e)&&-1==e.operationVector()){var a=t.entries[i-1];a&&n.push(a)}};this.entries.forEach((function(e,n){if(0==n||n==t.entries.length-1)i(e,n,!0);else{var o=r(e);i(e,n,o)}})),this.entries=this.entries.filter((function(e,t){return-1!==n.indexOf(e)}))}}])&&Ct(t.prototype,n),e}();function It(e){return(It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Et(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ot(e){return(Ot=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Dt(e,t){return(Dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}At.LargeEntryDeltaThreshold=15;var Rt=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==It(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,Ot(t).call(this,e))).content.itemUUIDToItemHistoryMapping||(n.content.itemUUIDToItemHistoryMapping={}),Object.keys(n.content.itemUUIDToItemHistoryMapping).forEach((function(e){var t=n.content.itemUUIDToItemHistoryMapping[e];n.content.itemUUIDToItemHistoryMapping[e]=new At(t)})),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Dt(e,t)}(t,e),n=t,(r=[{key:"addEntryForItem",value:function(e){return this.historyForItem(e).addHistoryEntryForItem(e)}},{key:"historyForItem",value:function(e){var t=this.content.itemUUIDToItemHistoryMapping[e.uuid];return t||(t=this.content.itemUUIDToItemHistoryMapping[e.uuid]=new At),t}},{key:"clearItemHistory",value:function(e){this.historyForItem(e).clear()}},{key:"clearAllHistory",value:function(){this.content.itemUUIDToItemHistoryMapping={}}},{key:"optimizeHistoryForItem",value:function(e){var n=this.historyForItem(e);n.entries.length>t.LargeItemEntryAmountThreshold&&n.optimize()}}])&&Et(n.prototype,r),t}(X);function Pt(e){return(Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tt(e){return(Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function jt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ft(e,t,n){return t&&jt(e.prototype,t),n&&jt(e,n),e}function Nt(e,t){return(Nt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Rt.LargeItemEntryAmountThreshold=60;var Lt=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==Pt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,Tt(t).call(this,e))).content.desktopPrivileges||(n.content.desktopPrivileges={}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Nt(e,t)}(t,e),Ft(t,null,[{key:"contentType",value:function(){return"SN|Privileges"}}]),Ft(t,[{key:"setCredentialsForAction",value:function(e,t){this.content.desktopPrivileges[e]=t}},{key:"getCredentialsForAction",value:function(e){return this.content.desktopPrivileges[e]||[]}},{key:"toggleCredentialForAction",value:function(e,t){this.isCredentialRequiredForAction(e,t)?this.removeCredentialForAction(e,t):this.addCredentialForAction(e,t)}},{key:"removeCredentialForAction",value:function(e,t){Ve()(this.content.desktopPrivileges[e],t)}},{key:"addCredentialForAction",value:function(e,t){var n=this.getCredentialsForAction(e);n.push(t),this.setCredentialsForAction(e,n)}},{key:"isCredentialRequiredForAction",value:function(e,t){return this.getCredentialsForAction(e).includes(t)}}]),t}(X);function Ut(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bt(e,t,n){return t&&Ut(e.prototype,t),n&&Ut(e,n),e}var Ht=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$timeout=t||setTimeout.bind(Object(r.b)())}return Bt(e,null,[{key:"getApiVersion",value:function(){return"20190520"}}]),Bt(e,[{key:"setJWTRequestHandler",value:function(e){this.jwtRequestHandler=e}},{key:"setAuthHeadersForRequest",value:function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(this.jwtRequestHandler());case 2:(t=n.sent)&&e.setRequestHeader("Authorization","Bearer "+t);case 4:case"end":return n.stop()}}),null,this)}},{key:"postAbsolute",value:function(e,t,n,r){return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",this.httpRequest("post",e,t,n,r));case 1:case"end":return i.stop()}}),null,this)}},{key:"postAuthenticatedAbsolute",value:function(e,t,n,r){return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",this.httpRequest("post",e,t,n,r,!0));case 1:case"end":return i.stop()}}),null,this)}},{key:"patchAbsolute",value:function(e,t,n,r){return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",this.httpRequest("patch",e,t,n,r));case 1:case"end":return i.stop()}}),null,this)}},{key:"getAbsolute",value:function(e,t,n,r){return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",this.httpRequest("get",e,t,n,r));case 1:case"end":return i.stop()}}),null,this)}},{key:"httpRequest",value:function(e,t,n,r,i){var o,a=this,s=arguments;return regeneratorRuntime.async((function(c){for(;;)switch(c.prev=c.next){case 0:return o=s.length>5&&void 0!==s[5]&&s[5],c.abrupt("return",new Promise((function(s,c){var u;return regeneratorRuntime.async((function(l){for(;;)switch(l.prev=l.next){case 0:if((u=new XMLHttpRequest).onreadystatechange=function(){if(4==u.readyState){var e=u.responseText;if(e)try{e=JSON.parse(e)}catch(e){}u.status>=200&&u.status<=299?a.$timeout((function(){r(e),s(e)})):(console.error("Request error:",e),a.$timeout((function(){i(e,u.status),c(e)})))}},"get"==e&&Object.keys(n).length>0&&(t=a.urlForUrlAndParams(t,n)),u.open(e,t,!0),u.setRequestHeader("Content-type","application/json"),!o){l.next=8;break}return l.next=8,regeneratorRuntime.awrap(a.setAuthHeadersForRequest(u));case 8:"post"==e||"patch"==e?u.send(JSON.stringify(n)):u.send();case 9:case"end":return l.stop()}}))})));case 2:case"end":return c.stop()}}))}},{key:"urlForUrlAndParams",value:function(e,t){var n=Object.keys(t).map((function(e){return e+"="+encodeURIComponent(t[e])})).join("&");return e.includes("?")?e+"&"+n:e+"?"+n}}]),e}();function zt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Vt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"setItem",value:function(e,t){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}))}},{key:"getItem",value:function(e){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}))}},{key:"removeItem",value:function(e){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}))}},{key:"clear",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}))}},{key:"getAllModels",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}))}},{key:"saveModel",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.saveModels([e]));case 1:case"end":return t.stop()}}),null,this)}},{key:"saveModels",value:function(e){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}))}},{key:"deleteModel",value:function(e){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}))}},{key:"clearAllModels",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}))}},{key:"clearAllData",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all([this.clear(),this.clearAllModels()]));case 1:case"end":return e.stop()}}),null,this)}}])&&zt(t.prototype,n),e}();function Wt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Kt=function(){function e(t,n,r,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),e.KeyRequestLoadLocal="KeyRequestLoadLocal",e.KeyRequestSaveLocal="KeyRequestSaveLocal",e.KeyRequestLoadSaveAccount="KeyRequestLoadSaveAccount",this.httpManager=r,this.modelManager=t,this.storageManager=n,this.$interval=o||setInterval.bind(window),this.$timeout=i||setTimeout.bind(window),this.syncStatus={},this.syncStatusObservers=[],this.eventHandlers=[],this.PerSyncItemUploadLimit=150,this.ServerItemDownloadLimit=150,this.MajorDataChangeThreshold=15,this.MaxDiscordanceBeforeOutOfSync=5,this.syncDiscordance=0,this.outOfSync=!1}var t,n;return t=e,(n=[{key:"handleServerIntegrityHash",value:function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(e&&0!=e.length){n.next=2;break}return n.abrupt("return",!0);case 2:return n.next=4,regeneratorRuntime.awrap(this.modelManager.computeDataIntegrityHash());case 4:if(t=n.sent){n.next=7;break}return n.abrupt("return",!0);case 7:if(t===e){n.next=13;break}return this.syncDiscordance++,this.syncDiscordance>=this.MaxDiscordanceBeforeOutOfSync&&(this.outOfSync||(this.outOfSync=!0,this.notifyEvent("enter-out-of-sync"))),n.abrupt("return",!1);case 13:return this.outOfSync&&(this.outOfSync=!1,this.notifyEvent("exit-out-of-sync")),this.syncDiscordance=0,n.abrupt("return",!0);case 16:case"end":return n.stop()}}),null,this)}},{key:"isOutOfSync",value:function(){return this.outOfSync}},{key:"getServerURL",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,regeneratorRuntime.awrap(this.storageManager.getItem("server"));case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0=window._default_sf_server;case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}}),null,this)}},{key:"getSyncURL",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,regeneratorRuntime.awrap(this.getServerURL());case 2:return e.t0=e.sent,e.abrupt("return",e.t0+"/items/sync");case 4:case"end":return e.stop()}}),null,this)}},{key:"registerSyncStatusObserver",value:function(e){var t={key:new Date,callback:e};return this.syncStatusObservers.push(t),t}},{key:"removeSyncStatusObserver",value:function(e){Ve()(this.syncStatusObservers,e)}},{key:"syncStatusDidChange",value:function(){var e=this;this.syncStatusObservers.forEach((function(t){t.callback(e.syncStatus)}))}},{key:"addEventHandler",value:function(e){return this.eventHandlers.push(e),e}},{key:"removeEventHandler",value:function(e){Ve()(this.eventHandlers,e)}},{key:"notifyEvent",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.eventHandlers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)(0,o.value)(e,t||{})}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"setKeyRequestHandler",value:function(e){this.keyRequestHandler=e}},{key:"getActiveKeyInfo",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.keyRequestHandler(e));case 1:case"end":return t.stop()}}),null,this)}},{key:"initialDataLoaded",value:function(){return!0===this._initialDataLoaded}},{key:"_sortLocalItems",value:function(e){var t=this;return e.sort((function(e,n){var r=new Date(n.updated_at)-new Date(e.updated_at),i=t.contentTypeLoadPriority,o=0,a=0;return i&&(o=i.indexOf(e.content_type),a=i.indexOf(n.content_type),-1==o&&(o=i.length),-1==a&&(a=i.length)),o==a?r:o<a?-1:1}))}},{key:"loadLocalItems",value:function(){var t,n,r,i,o,a=this,s=arguments;return regeneratorRuntime.async((function(c){for(;;)switch(c.prev=c.next){case 0:if(t=s.length>0&&void 0!==s[0]?s[0]:{},n=t.incrementalCallback,r=t.batchSize,!(i=t.options)||!i.simulateHighLatency){c.next=5;break}return o=i.simulatedLatency||1e3,c.next=5,regeneratorRuntime.awrap(this._awaitSleep(o));case 5:if(!this.loadLocalDataPromise){c.next=7;break}return c.abrupt("return",this.loadLocalDataPromise);case 7:return r||(r=100),this.loadLocalDataPromise=this.storageManager.getAllModels().then((function(t){var i=(t=(t=a._sortLocalItems(t)).filter((function(e){var t=a.modelManager.findItem(e.uuid);return!t||new Date(e.dirtiedDate)>t.dirtiedDate}))).length,o=0,s=[];return function c(){var u,l;return regeneratorRuntime.async((function(f){for(;;)switch(f.prev=f.next){case 0:return u=t.slice(o,o+r),f.next=3,regeneratorRuntime.awrap(a.handleItemsResponse(u,null,xt.MappingSourceLocalRetrieved,e.KeyRequestLoadLocal));case 3:if(l=f.sent,s.push(l),!((o+=u.length)<i)){f.next=10;break}return f.abrupt("return",new Promise((function(e,t){a.$timeout((function(){a.notifyEvent("local-data-incremental-load"),n&&n(o,i),c().then(e)}))})));case 10:a._initialDataLoaded=!0,a.notifyEvent("local-data-loaded");case 12:case"end":return f.stop()}}))}()})),c.abrupt("return",this.loadLocalDataPromise);case 10:case"end":return c.stop()}}),null,this)}},{key:"writeItemsToLocalStorage",value:function(t,n){var r=this;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(0!=t.length){i.next=2;break}return i.abrupt("return");case 2:return i.abrupt("return",new Promise((function(i,o){var a,s,c,u,l,f,d,p,h,v;return regeneratorRuntime.async((function(m){for(;;)switch(m.prev=m.next){case 0:for(a=[],s=[],c=!0,u=!1,l=void 0,m.prev=4,f=t[Symbol.iterator]();!(c=(d=f.next()).done);c=!0)!0!==(p=d.value).deleted||p.dirty?a.push(p):s.push(p);m.next=12;break;case 8:m.prev=8,m.t0=m.catch(4),u=!0,l=m.t0;case 12:m.prev=12,m.prev=13,c||null==f.return||f.return();case 15:if(m.prev=15,!u){m.next=18;break}throw l;case 18:return m.finish(15);case 19:return m.finish(12);case 20:if(!(s.length>0)){m.next=23;break}return m.next=23,regeneratorRuntime.awrap(Promise.all(s.map((function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.storageManager.deleteModel(e));case 1:case"end":return t.stop()}}))}))));case 23:return m.next=25,regeneratorRuntime.awrap(r.getActiveKeyInfo(e.KeyRequestSaveLocal));case 25:if(h=m.sent,!(a.length>0)){m.next=33;break}return m.next=29,regeneratorRuntime.awrap(Promise.all(a.map((function(e){var t;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=new ae(e,h.keys,h.auth_params),r.next=3,regeneratorRuntime.awrap(t.paramsForLocalStorage());case 3:return t=r.sent,n&&delete t.dirty,r.abrupt("return",t);case 6:case"end":return r.stop()}}))}))).catch((function(e){return o(e)})));case 29:return v=m.sent,m.next=32,regeneratorRuntime.awrap(r.storageManager.saveModels(v).catch((function(e){console.error("Error writing items",e),r.syncStatus.localError=e,r.syncStatusDidChange(),o()})));case 32:r.syncStatus.localError&&(r.syncStatus.localError=null,r.syncStatusDidChange());case 33:i();case 34:case"end":return m.stop()}}),null,null,[[4,8,12,20],[13,,15,19]])})));case 3:case"end":return i.stop()}}))}},{key:"syncOffline",value:function(e){var t,n,r,i,o,a=this;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:for(t=!0,n=!1,r=void 0,s.prev=3,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.updated_at=new Date;s.next=11;break;case 7:s.prev=7,s.t0=s.catch(3),n=!0,r=s.t0;case 11:s.prev=11,s.prev=12,t||null==i.return||i.return();case 14:if(s.prev=14,!n){s.next=17;break}throw r;case 17:return s.finish(14);case 18:return s.finish(11);case 19:return s.abrupt("return",this.writeItemsToLocalStorage(e,!0).then((function(t){var n=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var c=o.value;c.deleted&&a.modelManager.removeItemLocally(c)}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}return a.modelManager.clearDirtyItems(e),a.modelManager.didSyncModelsOffline(e),a.notifyEvent("sync:completed",{savedItems:e}),{saved_items:e}})));case 20:case"end":return s.stop()}}),null,this,[[3,7,11,19],[12,,14,18]])}},{key:"markAllItemsDirtyAndSaveOffline",value:function(e){var t,n,r,i,o,a,s,c,u,l,f,d,p;return regeneratorRuntime.async((function(h){for(;;)switch(h.prev=h.next){case 0:if(!e){h.next=28;break}t=this.modelManager.allNondummyItems.filter((function(e){return!e.errorDecrypting})).slice(),n=!0,r=!1,i=void 0,h.prev=5,o=t[Symbol.iterator]();case 7:if(n=(a=o.next()).done){h.next=14;break}return s=a.value,h.next=11,regeneratorRuntime.awrap(this.modelManager.alternateUUIDForItem(s));case 11:n=!0,h.next=7;break;case 14:h.next=20;break;case 16:h.prev=16,h.t0=h.catch(5),r=!0,i=h.t0;case 20:h.prev=20,h.prev=21,n||null==o.return||o.return();case 23:if(h.prev=23,!r){h.next=26;break}throw i;case 26:return h.finish(23);case 27:return h.finish(20);case 28:for(c=this.modelManager.allNondummyItems,u=!0,l=!1,f=void 0,h.prev=32,d=c[Symbol.iterator]();!(u=(p=d.next()).done);u=!0)p.value.setDirty(!0);h.next=40;break;case 36:h.prev=36,h.t1=h.catch(32),l=!0,f=h.t1;case 40:h.prev=40,h.prev=41,u||null==d.return||d.return();case 43:if(h.prev=43,!l){h.next=46;break}throw f;case 46:return h.finish(43);case 47:return h.finish(40);case 48:return h.abrupt("return",this.writeItemsToLocalStorage(c,!1));case 49:case"end":return h.stop()}}),null,this,[[5,16,20,28],[21,,23,27],[32,36,40,48],[41,,43,47]])}},{key:"setSyncToken",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return this._syncToken=e,t.next=3,regeneratorRuntime.awrap(this.storageManager.setItem("syncToken",e));case 3:case"end":return t.stop()}}),null,this)}},{key:"getSyncToken",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._syncToken){e.next=4;break}return e.next=3,regeneratorRuntime.awrap(this.storageManager.getItem("syncToken"));case 3:this._syncToken=e.sent;case 4:return e.abrupt("return",this._syncToken);case 5:case"end":return e.stop()}}),null,this)}},{key:"setCursorToken",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._cursorToken=e,!e){t.next=6;break}return t.next=4,regeneratorRuntime.awrap(this.storageManager.setItem("cursorToken",e));case 4:t.next=8;break;case 6:return t.next=8,regeneratorRuntime.awrap(this.storageManager.removeItem("cursorToken"));case 8:case"end":return t.stop()}}),null,this)}},{key:"getCursorToken",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._cursorToken){e.next=4;break}return e.next=3,regeneratorRuntime.awrap(this.storageManager.getItem("cursorToken"));case 3:this._cursorToken=e.sent;case 4:return e.abrupt("return",this._cursorToken);case 5:case"end":return e.stop()}}),null,this)}},{key:"clearQueuedCallbacks",value:function(){this._queuedCallbacks=[]}},{key:"callQueuedCallbacks",value:function(e){var t=this.queuedCallbacks;if(t.length){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)(0,o.value)(e)}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.clearQueuedCallbacks()}}},{key:"beginCheckingIfSyncIsTakingTooLong",value:function(){this.syncStatus.checker&&this.stopCheckingIfSyncIsTakingTooLong(),this.syncStatus.checker=this.$interval(function(){(new Date-this.syncStatus.syncStart)/1e3>5&&(this.notifyEvent("sync:taking-too-long"),this.stopCheckingIfSyncIsTakingTooLong())}.bind(this),500)}},{key:"stopCheckingIfSyncIsTakingTooLong",value:function(){this.$interval.hasOwnProperty("cancel")?this.$interval.cancel(this.syncStatus.checker):clearInterval(this.syncStatus.checker),this.syncStatus.checker=null}},{key:"lockSyncing",value:function(){this.syncLocked=!0}},{key:"unlockSyncing",value:function(){this.syncLocked=!1}},{key:"sync",value:function(){var t,n=this,r=arguments;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[0]:{},!this.syncLocked){i.next=4;break}return console.log("Sync Locked, Returning;"),i.abrupt("return");case 4:return i.abrupt("return",new Promise((function(r,i){var o,a,s,c,u,l,f,d,p,h,v,m,y,g;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return t||(t={}),o=n.modelManager.getDirtyItems(),a=o.filter((function(e){return!n.lastDirtyItemsSave||e.dirtiedDate>n.lastDirtyItemsSave})),i.next=5,regeneratorRuntime.awrap(n.getActiveKeyInfo(e.KeyRequestLoadSaveAccount));case 5:if(s=i.sent,c=n.syncStatus.syncOpInProgress,u=n.initialDataLoaded(),!c&&u){i.next=16;break}return n.performSyncAgainOnCompletion=!0,n.lastDirtyItemsSave=new Date,i.next=13,regeneratorRuntime.awrap(n.writeItemsToLocalStorage(a,!1));case 13:return c&&(n.queuedCallbacks.push(r),n.loggingEnabled&&console.warn("Attempting to sync while existing sync is in progress.")),u||(n.loggingEnabled&&console.warn("(1) Attempting to perform online sync before local data has loaded"),r()),i.abrupt("return");case 16:if(n.syncStatus.syncOpInProgress=!0,!s.offline){i.next=19;break}return i.abrupt("return",n.syncOffline(o).then((function(e){n.syncStatus.syncOpInProgress=!1,r(e)})).catch((function(e){n.notifyEvent("sync-exception",e)})));case 19:if(n.initialDataLoaded()){i.next=22;break}return console.error("Attempting to perform online sync before local data has loaded"),i.abrupt("return");case 22:return n.loggingEnabled&&console.log("Syncing online user."),l=n.syncStatus.needsMoreSync,n.syncStatus.syncStart=new Date,n.beginCheckingIfSyncIsTakingTooLong(),f=n.PerSyncItemUploadLimit,(d=o.slice(0,f)).length<o.length?n.syncStatus.needsMoreSync=!0:n.syncStatus.needsMoreSync=!1,l||(n.syncStatus.total=o.length,n.syncStatus.current=0),n.syncStatus.current>n.syncStatus.total&&(n.syncStatus.total=n.syncStatus.current),n.syncStatusDidChange(),i.next=34,regeneratorRuntime.awrap(n.writeItemsToLocalStorage(a,!1));case 34:return n.lastDirtyItemsSave=new Date,t.onPreSyncSave&&t.onPreSyncSave(),n.allRetreivedItems||(n.allRetreivedItems=[]),n.allSavedItems||(n.allSavedItems=[]),(p={}).limit=n.ServerItemDownloadLimit,t.performIntegrityCheck&&(p.compute_integrity=!0),i.prev=41,i.next=44,regeneratorRuntime.awrap(Promise.all(d.map((function(e){var n=new ae(e,s.keys,s.auth_params);return n.additionalFields=t.additionalFields,n.paramsForSync()}))).then((function(e){p.items=e})));case 44:i.next=49;break;case 46:i.prev=46,i.t0=i.catch(41),n.notifyEvent("sync-exception",i.t0);case 49:for(h=!0,v=!1,m=void 0,i.prev=52,y=d[Symbol.iterator]();!(h=(g=y.next()).done);h=!0)g.value.dirtyCount=0;i.next=60;break;case 56:i.prev=56,i.t1=i.catch(52),v=!0,m=i.t1;case 60:i.prev=60,i.prev=61,h||null==y.return||y.return();case 63:if(i.prev=63,!v){i.next=66;break}throw m;case 66:return i.finish(63);case 67:return i.finish(60);case 68:return i.next=70,regeneratorRuntime.awrap(n.getSyncToken());case 70:return p.sync_token=i.sent,i.next=73,regeneratorRuntime.awrap(n.getCursorToken());case 73:return p.cursor_token=i.sent,p.api=Ht.getApiVersion(),n.loggingEnabled&&console.log("Syncing with params",p),i.prev=76,i.t2=n.httpManager,i.next=80,regeneratorRuntime.awrap(n.getSyncURL());case 80:i.t3=i.sent,i.t4=p,i.t5=function(e){n.handleSyncSuccess(d,e,t).then((function(){r(e)})).catch((function(e){console.log("Caught sync success exception:",e),n.handleSyncError(e,null,o).then((function(t){n.notifyEvent("sync-exception",e),r(t)}))}))},i.t6=function(e,t){n.handleSyncError(e,t,o).then((function(e){r(e)}))},i.t2.postAuthenticatedAbsolute.call(i.t2,i.t3,i.t4,i.t5,i.t6),i.next=90;break;case 87:i.prev=87,i.t7=i.catch(76),console.log("Sync exception caught:",i.t7);case 90:case"end":return i.stop()}}),null,null,[[41,46],[52,56,60,68],[61,,63,67],[76,87]])})));case 5:case"end":return i.stop()}}),null,this)}},{key:"_awaitSleep",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return console.warn("Simulating high latency sync request",e),t.abrupt("return",new Promise((function(t,n){setTimeout((function(){t()}),e)})));case 2:case"end":return t.stop()}}))}},{key:"handleSyncSuccess",value:function(t,n,r){var i,o,a,s,c,u,l,f,d,p,h,v,m,y,g,b,w=this;return regeneratorRuntime.async((function(k){for(;;)switch(k.prev=k.next){case 0:if(!r.simulateHighLatency){k.next=4;break}return i=r.simulatedLatency||1e3,k.next=4,regeneratorRuntime.awrap(this._awaitSleep(i));case 4:for(this.syncStatus.error=null,this.loggingEnabled&&console.log("Sync response",n),o=this.allSavedItems.map((function(e){return e.uuid})),a=n.saved_items.map((function(e){return e.uuid})),n.retrieved_items=n.retrieved_items.filter((function(e){var t=o.includes(e.uuid),n=a.includes(e.uuid);if(t||n)return!1;var r=w.modelManager.findItem(e.uuid);return!r||!r.dirty})),s=[],c=!0,u=!1,l=void 0,k.prev=13,f=t[Symbol.iterator]();!(c=(d=f.next()).done);c=!0)0==(p=d.value).dirtyCount&&s.push(p);k.next=21;break;case 17:k.prev=17,k.t0=k.catch(13),u=!0,l=k.t0;case 21:k.prev=21,k.prev=22,c||null==f.return||f.return();case 24:if(k.prev=24,!u){k.next=27;break}throw l;case 27:return k.finish(24);case 28:return k.finish(21);case 29:return this.modelManager.clearDirtyItems(s),k.next=32,regeneratorRuntime.awrap(this.handleItemsResponse(n.retrieved_items,null,xt.MappingSourceRemoteRetrieved,e.KeyRequestLoadSaveAccount));case 32:return h=k.sent,this.allRetreivedItems=this.allRetreivedItems.concat(h),this.syncStatus.retrievedCount=this.allRetreivedItems.length,v=["content","auth_hash"],k.next=38,regeneratorRuntime.awrap(this.handleItemsResponse(n.saved_items,v,xt.MappingSourceRemoteSaved,e.KeyRequestLoadSaveAccount));case 38:return m=k.sent,this.allSavedItems=this.allSavedItems.concat(m),y=n.unsaved,k.next=43,regeneratorRuntime.awrap(this.deprecated_handleUnsavedItemsResponse(y));case 43:return k.next=45,regeneratorRuntime.awrap(this.handleConflictsResponse(n.conflicts));case 45:if(g=k.sent,b=g&&g.length>0,!g){k.next=50;break}return k.next=50,regeneratorRuntime.awrap(this.writeItemsToLocalStorage(g,!1));case 50:return k.next=52,regeneratorRuntime.awrap(this.writeItemsToLocalStorage(m,!1));case 52:return k.next=54,regeneratorRuntime.awrap(this.writeItemsToLocalStorage(h,!1));case 54:if(!n.integrity_hash||n.cursor_token){k.next=59;break}return k.next=57,regeneratorRuntime.awrap(this.handleServerIntegrityHash(n.integrity_hash));case 57:k.sent||this.syncDiscordance<this.MaxDiscordanceBeforeOutOfSync&&(this.performSyncAgainOnCompletion=!0);case 59:return this.syncStatus.syncOpInProgress=!1,this.syncStatus.current+=t.length,this.syncStatusDidChange(),this.setSyncToken(n.sync_token),this.setCursorToken(n.cursor_token),this.stopCheckingIfSyncIsTakingTooLong(),k.next=67,regeneratorRuntime.awrap(this.getCursorToken());case 67:if(!k.sent&&!this.syncStatus.needsMoreSync){k.next=72;break}return k.abrupt("return",new Promise((function(e,t){setTimeout(function(){this.sync(r).then(e)}.bind(w),10)})));case 72:if(!b){k.next=77;break}return this.performSyncAgainOnCompletion=!1,k.abrupt("return",new Promise((function(e,t){setTimeout((function(){w.sync(r).then(e)}),10)})));case 77:return this.syncStatus.retrievedCount=0,this.syncStatus.current=0,this.syncStatus.total=0,this.syncStatusDidChange(),(this.allRetreivedItems.length>=this.majorDataChangeThreshold||m.length>=this.majorDataChangeThreshold||y&&y.length>=this.majorDataChangeThreshold||g&&g.length>=this.majorDataChangeThreshold)&&this.notifyEvent("major-data-change"),this.callQueuedCallbacks(n),this.notifyEvent("sync:completed",{retrievedItems:this.allRetreivedItems,savedItems:this.allSavedItems}),this.allRetreivedItems=[],this.allSavedItems=[],this.performSyncAgainOnCompletion&&(this.performSyncAgainOnCompletion=!1,setTimeout((function(){w.sync(r)}),10)),k.abrupt("return",n);case 88:case"end":return k.stop()}}),null,this,[[13,17,21,29],[22,,24,28]])}},{key:"handleSyncError",value:function(e,t,n){return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return console.log("Sync error: ",e),401==t&&this.notifyEvent("sync-session-invalid"),e?"string"==typeof e&&(e={error:{message:e}}):e={error:{message:"Could not connect to server."}},this.syncStatus.syncOpInProgress=!1,this.syncStatus.error=e.error,this.syncStatusDidChange(),this.writeItemsToLocalStorage(n,!1),this.modelManager.didSyncModelsOffline(n),this.stopCheckingIfSyncIsTakingTooLong(),this.notifyEvent("sync:error",e.error),this.callQueuedCallbacks({error:"Sync error"}),r.abrupt("return",e);case 12:case"end":return r.stop()}}),null,this)}},{key:"handleItemsResponse",value:function(e,t,n,r){var i,o,a;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,regeneratorRuntime.awrap(this.getActiveKeyInfo(r));case 2:return i=s.sent.keys,s.next=5,regeneratorRuntime.awrap(N.decryptMultipleItems(e,i));case 5:return s.next=7,regeneratorRuntime.awrap(this.modelManager.mapResponseItemsToLocalModelsOmittingFields(e,t,n));case 7:return o=s.sent,(a=o.filter((function(e){var t=e.errorDecryptingValueChanged;return e.errorDecryptingValueChanged=!1,t}))).length>0&&this.writeItemsToLocalStorage(a,!1),s.abrupt("return",o);case 11:case"end":return s.stop()}}),null,this)}},{key:"refreshErroredItems",value:function(){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(!((t=this.modelManager.allNondummyItems.filter((function(e){return 1==e.errorDecrypting}))).length>0)){n.next=3;break}return n.abrupt("return",this.handleItemsResponse(t,null,xt.MappingSourceLocalRetrieved,e.KeyRequestLoadSaveAccount));case 3:case"end":return n.stop()}}),null,this)}},{key:"handleConflictsResponse",value:function(t){var n,r,i,o,a,s,c,u,l,f,d,p,h,v,m,y,g,b,w,k,x,$,_,S,M,C,A,I,E,O,D;return regeneratorRuntime.async((function(R){for(;;)switch(R.prev=R.next){case 0:if(t&&0!=t.length){R.next=2;break}return R.abrupt("return");case 2:this.loggingEnabled&&console.log("Handle Conflicted Items:",t),n={},r=!0,i=!1,o=void 0,R.prev=7,a=t[Symbol.iterator]();case 9:if(r=(s=a.next()).done){R.next=21;break}if(c=s.value,u=c.server_item||c.unsaved_item,l=this.modelManager.findItem(u.uuid)){R.next=16;break}return n[u.uuid]={},R.abrupt("continue",18);case 16:f=l.getContentCopy(),n[u.uuid]={frozenContent:f,itemRef:l};case 18:r=!0,R.next=9;break;case 21:R.next=27;break;case 23:R.prev=23,R.t0=R.catch(7),i=!0,o=R.t0;case 27:R.prev=27,R.prev=28,r||null==a.return||a.return();case 30:if(R.prev=30,!i){R.next=33;break}throw o;case 33:return R.finish(30);case 34:return R.finish(27);case 35:d=[],p=!0,h=!1,v=void 0,R.prev=39,m=t[Symbol.iterator]();case 41:if(p=(y=m.next()).done){R.next=93;break}return g=y.value,b=g.server_item||g.unsaved_item,R.t1=regeneratorRuntime,R.t2=N,R.t3=[b],R.next=49,regeneratorRuntime.awrap(this.getActiveKeyInfo(e.KeyRequestLoadSaveAccount));case 49:return R.t4=R.sent.keys,R.t5=R.t2.decryptMultipleItems.call(R.t2,R.t3,R.t4),R.next=53,R.t1.awrap.call(R.t1,R.t5);case 53:if(w=n[b.uuid],k=w.frozenContent,x=w.itemRef){R.next=56;break}return R.abrupt("continue",90);case 56:if(d.push(x),"uuid_conflict"!==g.type){R.next=64;break}return R.next=60,regeneratorRuntime.awrap(this.modelManager.alternateUUIDForItem(x));case 60:$=R.sent,d.push($),R.next=90;break;case 64:if("sync_conflict"!==g.type){R.next=88;break}return R.next=67,regeneratorRuntime.awrap(this.modelManager.createDuplicateItemFromResponseItem(b));case 67:if(_=R.sent,S=this.modelManager.duplicateItemWithCustomContent({content:k,duplicateOf:x}),M=!S.isItemContentEqualWith(_),C=!x.isItemContentEqualWith(_),A=!1,I=!1,E=!1,O=!1,b.deleted||x.deleted?O=!0:M?(new Date-x.client_updated_at)/1e3<20?(E=!0,I=!0):(A=!0,O=!0):C?SFItem.AreItemContentsEqual({leftContent:x.content,rightContent:_.content,keysToIgnore:x.keysToIgnoreWhenCheckingContentEquality().concat(["references"]),appDataKeysToIgnore:x.appDataKeysToIgnoreWhenCheckingContentEquality()})?E=!0:(A=!0,O=!0):O=!0,!A){R.next=81;break}return R.next=79,regeneratorRuntime.awrap(this.modelManager.duplicateItemWithCustomContentAndAddAsConflict({content:k,duplicateOf:x}));case 79:D=R.sent,d.push(D);case 81:if(I&&(this.modelManager.addDuplicatedItemAsConflict({duplicate:_,duplicateOf:x}),d.push(_)),!O){R.next=85;break}return R.next=85,regeneratorRuntime.awrap(this.modelManager.mapResponseItemsToLocalModelsOmittingFields([b],null,xt.MappingSourceRemoteRetrieved));case 85:E&&(x.updated_at=_.updated_at,x.setDirty(!0)),R.next=90;break;case 88:return console.error("Unsupported conflict type",g.type),R.abrupt("continue",90);case 90:p=!0,R.next=41;break;case 93:R.next=99;break;case 95:R.prev=95,R.t6=R.catch(39),h=!0,v=R.t6;case 99:R.prev=99,R.prev=100,p||null==m.return||m.return();case 102:if(R.prev=102,!h){R.next=105;break}throw v;case 105:return R.finish(102);case 106:return R.finish(99);case 107:return R.abrupt("return",d);case 108:case"end":return R.stop()}}),null,this,[[7,23,27,35],[28,,30,34],[39,95,99,107],[100,,102,106]])}},{key:"deprecated_handleUnsavedItemsResponse",value:function(t){var n,r,i,o,a,s,c,u,l,f;return regeneratorRuntime.async((function(d){for(;;)switch(d.prev=d.next){case 0:if(t&&0!=t.length){d.next=2;break}return d.abrupt("return");case 2:this.loggingEnabled&&console.log("Handle Unsaved Items:",t),n=!0,r=!1,i=void 0,d.prev=6,o=t[Symbol.iterator]();case 8:if(n=(a=o.next()).done){d.next=37;break}return s=a.value,c=s.item,d.t0=regeneratorRuntime,d.t1=N,d.t2=[c],d.next=16,regeneratorRuntime.awrap(this.getActiveKeyInfo(e.KeyRequestLoadSaveAccount));case 16:return d.t3=d.sent.keys,d.t4=d.t1.decryptMultipleItems.call(d.t1,d.t2,d.t3),d.next=20,d.t0.awrap.call(d.t0,d.t4);case 20:if(u=this.modelManager.findItem(c.uuid)){d.next=23;break}return d.abrupt("continue",34);case 23:if("uuid_conflict"!==(l=s.error).tag){d.next=29;break}return d.next=27,regeneratorRuntime.awrap(this.modelManager.alternateUUIDForItem(u));case 27:d.next=34;break;case 29:if("sync_conflict"!==l.tag){d.next=34;break}return d.next=32,regeneratorRuntime.awrap(this.modelManager.createDuplicateItemFromResponseItem(c));case 32:f=d.sent,c.deleted||u.isItemContentEqualWith(f)||this.modelManager.addDuplicatedItemAsConflict({duplicate:f,duplicateOf:u});case 34:n=!0,d.next=8;break;case 37:d.next=43;break;case 39:d.prev=39,d.t5=d.catch(6),r=!0,i=d.t5;case 43:d.prev=43,d.prev=44,n||null==o.return||o.return();case 46:if(d.prev=46,!r){d.next=49;break}throw i;case 49:return d.finish(46);case 50:return d.finish(43);case 51:case"end":return d.stop()}}),null,this,[[6,39,43,51],[44,,46,50]])}},{key:"stateless_downloadAllItems",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((function(r,i){var o;return regeneratorRuntime.async((function(a){for(;;)switch(a.prev=a.next){case 0:return o={limit:n.limit||500,sync_token:n.syncToken,cursor_token:n.cursorToken,content_type:n.contentType,event:n.event,api:Ht.getApiVersion()},a.prev=1,a.t0=t.httpManager,a.next=5,regeneratorRuntime.awrap(t.getSyncURL());case 5:a.t1=a.sent,a.t2=o,a.t3=function(i){var o,a;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:return n.retrievedItems||(n.retrievedItems=[]),o=i.retrieved_items,s.next=4,regeneratorRuntime.awrap(t.getActiveKeyInfo(e.KeyRequestLoadSaveAccount));case 4:return a=s.sent.keys,s.next=7,regeneratorRuntime.awrap(N.decryptMultipleItems(o,a));case 7:n.retrievedItems=n.retrievedItems.concat(o.map((function(e){return t.modelManager.createItem(e)}))),n.syncToken=i.sync_token,n.cursorToken=i.cursor_token,n.cursorToken?t.stateless_downloadAllItems(n).then(r):r(n.retrievedItems);case 11:case"end":return s.stop()}}))},a.t4=function(e,t){i(e)},a.t0.postAuthenticatedAbsolute.call(a.t0,a.t1,a.t2,a.t3,a.t4),a.next=16;break;case 12:a.prev=12,a.t5=a.catch(1),console.log("Download all items exception caught:",a.t5),i(a.t5);case 16:case"end":return a.stop()}}),null,null,[[1,12]])}))}},{key:"resolveOutOfSync",value:function(){var e=this;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.stateless_downloadAllItems({event:"resolve-out-of-sync"}).then((function(t){var n,r,i,o,a,s,c,u;return regeneratorRuntime.async((function(l){for(;;)switch(l.prev=l.next){case 0:n=[],r=!0,i=!1,o=void 0,l.prev=4,a=t[Symbol.iterator]();case 6:if(r=(s=a.next()).done){l.next=18;break}if(c=s.value,!(u=e.modelManager.findItem(c.uuid))){l.next=14;break}if(c.isItemContentEqualWith(u)){l.next=14;break}return l.next=14,regeneratorRuntime.awrap(e.modelManager.duplicateItemAndAddAsConflict(u));case 14:n.push(c);case 15:r=!0,l.next=6;break;case 18:l.next=24;break;case 20:l.prev=20,l.t0=l.catch(4),i=!0,o=l.t0;case 24:l.prev=24,l.prev=25,r||null==a.return||a.return();case 27:if(l.prev=27,!i){l.next=30;break}throw o;case 30:return l.finish(27);case 31:return l.finish(24);case 32:return l.next=34,regeneratorRuntime.awrap(e.modelManager.mapResponseItemsToLocalModelsWithOptions({items:n,source:xt.MappingSourceRemoteRetrieved}));case 34:return l.next=36,regeneratorRuntime.awrap(e.writeItemsToLocalStorage(e.modelManager.allNondummyItems));case 36:return l.abrupt("return",e.sync({performIntegrityCheck:!0}));case 37:case"end":return l.stop()}}),null,null,[[4,20,24,32],[25,,27,31]])})));case 1:case"end":return t.stop()}}),null,this)}},{key:"handleSignout",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return this.outOfSync=!1,this.loadLocalDataPromise=null,this.performSyncAgainOnCompletion=!1,this.syncStatus.syncOpInProgress=!1,this._queuedCallbacks=[],this.syncStatus={},e.abrupt("return",this.clearSyncToken());case 7:case"end":return e.stop()}}),null,this)}},{key:"clearSyncToken",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return this._syncToken=null,this._cursorToken=null,e.abrupt("return",this.storageManager.removeItem("syncToken"));case 3:case"end":return e.stop()}}),null,this)}},{key:"__setLocalDataNotLoaded",value:function(){this.loadLocalDataPromise=null,this._initialDataLoaded=!1}},{key:"queuedCallbacks",get:function(){return this._queuedCallbacks||(this._queuedCallbacks=[]),this._queuedCallbacks}}])&&Wt(t.prototype,n),e}();function qt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Jt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"alert",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){window.alert(e.text),t()})));case 1:case"end":return t.stop()}}))}},{key:"confirm",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){window.confirm(e.text)?t():n()})));case 1:case"end":return t.stop()}}))}}])&&qt(t.prototype,n),e}();function Gt(e){return(Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Zt=function(){function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),e.DidSignOutEvent="DidSignOutEvent",e.WillSignInEvent="WillSignInEvent",e.DidSignInEvent="DidSignInEvent",this.httpManager=n,this.storageManager=t,this.alertManager=r||new Jt,this.$timeout=i||setTimeout.bind(window),this.eventHandlers=[]}var t,n;return t=e,(n=[{key:"addEventHandler",value:function(e){return this.eventHandlers.push(e),e}},{key:"removeEventHandler",value:function(e){Ve()(this.eventHandlers,e)}},{key:"notifyEvent",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.eventHandlers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)(0,o.value)(e,t||{})}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"saveKeys",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return this._keys=e,t.next=3,regeneratorRuntime.awrap(this.storageManager.setItem("mk",e.mk));case 3:return t.next=5,regeneratorRuntime.awrap(this.storageManager.setItem("ak",e.ak));case 5:case"end":return t.stop()}}),null,this)}},{key:"signout",value:function(t){var n=this;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(this._keys=null,this._authParams=null,!t){r.next=6;break}return r.abrupt("return",this.storageManager.clearAllData().then((function(){n.notifyEvent(e.DidSignOutEvent)})));case 6:this.notifyEvent(e.DidSignOutEvent);case 7:case"end":return r.stop()}}),null,this)}},{key:"keys",value:function(){var e;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._keys){t.next=11;break}return t.next=3,regeneratorRuntime.awrap(this.storageManager.getItem("mk"));case 3:if(e=t.sent){t.next=6;break}return t.abrupt("return",null);case 6:return t.t0=e,t.next=9,regeneratorRuntime.awrap(this.storageManager.getItem("ak"));case 9:t.t1=t.sent,this._keys={mk:t.t0,ak:t.t1};case 11:return t.abrupt("return",this._keys);case 12:case"end":return t.stop()}}),null,this)}},{key:"getAuthParams",value:function(){var e;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._authParams){t.next=5;break}return t.next=3,regeneratorRuntime.awrap(this.storageManager.getItem("auth_params"));case 3:e=t.sent,this._authParams=JSON.parse(e);case 5:if(!this._authParams||this._authParams.version){t.next=9;break}return t.next=8,regeneratorRuntime.awrap(this.defaultProtocolVersion());case 8:this._authParams.version=t.sent;case 9:return t.abrupt("return",this._authParams);case 10:case"end":return t.stop()}}),null,this)}},{key:"defaultProtocolVersion",value:function(){var e;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,regeneratorRuntime.awrap(this.keys());case 2:if(!(e=t.sent)||!e.ak){t.next=7;break}return t.abrupt("return","002");case 7:return t.abrupt("return","001");case 8:case"end":return t.stop()}}),null,this)}},{key:"protocolVersion",value:function(){var e;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,regeneratorRuntime.awrap(this.getAuthParams());case 2:if(!(e=t.sent)||!e.version){t.next=5;break}return t.abrupt("return",e.version);case 5:return t.abrupt("return",this.defaultProtocolVersion());case 6:case"end":return t.stop()}}),null,this)}},{key:"getAuthParamsForEmail",value:function(e,t,n){var r,i=this;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return(r=ne()({email:t},n)).api=Ht.getApiVersion(),o.abrupt("return",new Promise((function(t,n){var o=e+"/auth/params";i.httpManager.getAbsolute(o,r,(function(e){t(e)}),(function(e){console.error("Error getting auth params",e),"object"!==Gt(e)&&(e={error:{message:"A server error occurred while trying to sign in. Please try again."}}),t(e)}))})));case 3:case"end":return o.stop()}}))}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"isLocked",value:function(){return 1==this.locked}},{key:"unlockAndResolve",value:function(e,t){this.unlock(),e(t)}},{key:"login",value:function(t,n,r,i,o){var a=this;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",new Promise((function(s,c){var u,l,f,d,p,h,v,m,y,g;return regeneratorRuntime.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,regeneratorRuntime.awrap(a.keys());case 2:if(null==c.sent){c.next=6;break}return s({error:{message:"Cannot log in because already signed in."}}),c.abrupt("return");case 6:if(!a.isLocked()){c.next=9;break}return s({error:{message:"Login already in progress."}}),c.abrupt("return");case 9:return a.lock(),a.notifyEvent(e.WillSignInEvent),c.next=13,regeneratorRuntime.awrap(a.getAuthParamsForEmail(t,n,o));case 13:if((u=c.sent).identifier=n,!u.error){c.next=18;break}return a.unlockAndResolve(s,u),c.abrupt("return");case 18:if(u&&u.pw_cost){c.next=21;break}return a.unlockAndResolve(s,{error:{message:"Invalid email or password."}}),c.abrupt("return");case 21:if(N.supportedVersions().includes(u.version)){c.next=25;break}return l=N.isVersionNewerThanLibraryVersion(u.version)?"This version of the application does not support your newer account type. Please upgrade to the latest version of Standard Notes to sign in.":"The protocol version associated with your account is outdated and no longer supported by this application. Please visit standardnotes.org/help/security for more information.",a.unlockAndResolve(s,{error:{message:l}}),c.abrupt("return");case 25:if(!N.isProtocolVersionOutdated(u.version)){c.next=32;break}return f="The encryption version for your account, ".concat(u.version,", is outdated and requires upgrade. You may proceed with login, but are advised to perform a security update using the web or desktop application. Please visit standardnotes.org/help/security for more information."),d=!1,c.next=30,regeneratorRuntime.awrap(a.alertManager.confirm({title:"Update Needed",text:f,confirmButtonText:"Sign In"}).catch((function(){a.unlockAndResolve(s,{error:{}}),d=!0})));case 30:if(!d){c.next=32;break}return c.abrupt("return");case 32:if(N.supportsPasswordDerivationCost(u.pw_cost)){c.next=36;break}return a.unlockAndResolve(s,{error:{message:"Your account was created on a platform with higher security capabilities than this browser supports. If we attempted to generate your login keys here, it would take hours. Please use a browser with more up to date security capabilities, like Google Chrome or Firefox, to log in."}}),c.abrupt("return");case 36:if(p=N.costMinimumForVersion(u.version),!(u.pw_cost<p)){c.next=41;break}return a.unlockAndResolve(s,{error:{message:"Unable to login due to insecure password parameters. Please visit standardnotes.org/help/security for more information."}}),c.abrupt("return");case 41:if(!i){c.next=47;break}if(h=N.version(),u.version===h){c.next=47;break}return v="Strict sign in refused server sign in parameters. The latest security version is ".concat(h,", but your account is reported to have version ").concat(u.version,". If you'd like to proceed with sign in anyway, please disable strict sign in and try again."),a.unlockAndResolve(s,{error:{message:v}}),c.abrupt("return");case 47:return c.next=49,regeneratorRuntime.awrap(N.computeEncryptionKeysForUser(r,u));case 49:m=c.sent,y=t+"/auth/sign_in",(g=ne()({password:m.pw,email:n},o)).api=Ht.getApiVersion(),a.httpManager.postAbsolute(y,g,(function(r){return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,regeneratorRuntime.awrap(a.handleAuthResponse(r,n,t,u,m));case 2:a.notifyEvent(e.DidSignInEvent),a.$timeout((function(){return a.unlockAndResolve(s,r)}));case 4:case"end":return i.stop()}}))}),(function(e){console.error("Error logging in",e),"object"!==Gt(e)&&(e={error:{message:"A server error occurred while trying to sign in. Please try again."}}),a.$timeout((function(){return a.unlockAndResolve(s,e)}))}));case 54:case"end":return c.stop()}}))})));case 1:case"end":return s.stop()}}))}},{key:"register",value:function(e,t,n){var r=this;return new Promise((function(i,o){var a,s,c,u,l,f;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(!r.isLocked()){o.next=3;break}return i({error:{message:"Register already in progress."}}),o.abrupt("return");case 3:if(!(n.length<8)){o.next=8;break}return a="Your password must be at least ".concat(8," characters in length. For your security, please choose a longer password or, ideally, a passphrase, and try again."),i({error:{message:a}}),o.abrupt("return");case 8:return r.lock(),o.next=11,regeneratorRuntime.awrap(N.generateInitialKeysAndAuthParamsForUser(t,n));case 11:s=o.sent,c=s.keys,u=s.authParams,l=e+"/auth",(f=ne()({password:c.pw,email:t},u)).api=Ht.getApiVersion(),r.httpManager.postAbsolute(l,f,(function(n){return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,regeneratorRuntime.awrap(r.handleAuthResponse(n,t,e,u,c));case 2:r.unlockAndResolve(i,n);case 3:case"end":return o.stop()}}))}),(function(e){console.error("Registration error",e),"object"!==Gt(e)&&(e={error:{message:"A server error occurred while trying to register. Please try again."}}),r.unlockAndResolve(i,e)}));case 18:case"end":return o.stop()}}))}))}},{key:"changePassword",value:function(e,t,n,r,i){var o=this;return regeneratorRuntime.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",new Promise((function(a,s){var c,u,l;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:if(!o.isLocked()){s.next=3;break}return a({error:{message:"Change password already in progress."}}),s.abrupt("return");case 3:o.lock(),c=r.pw,u=e+"/auth/change_pw",(l=ne()({new_password:c,current_password:n},i)).api=Ht.getApiVersion(),o.httpManager.postAuthenticatedAbsolute(u,l,(function(e){return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(o.handleAuthResponse(e,t,null,i,r));case 2:o.unlockAndResolve(a,e);case 3:case"end":return n.stop()}}))}),(function(e){"object"!==Gt(e)&&(e={error:{message:"Something went wrong while changing your password. Your password was not changed. Please try again."}}),o.unlockAndResolve(a,e)}));case 9:case"end":return s.stop()}}))})));case 1:case"end":return a.stop()}}))}},{key:"handleAuthResponse",value:function(e,t,n,r,i){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=3;break}return t.next=3,regeneratorRuntime.awrap(this.storageManager.setItem("server",n));case 3:return this._authParams=r,t.next=6,regeneratorRuntime.awrap(this.storageManager.setItem("auth_params",JSON.stringify(r)));case 6:return t.next=8,regeneratorRuntime.awrap(this.storageManager.setItem("jwt",e.token));case 8:return t.abrupt("return",this.saveKeys(i));case 9:case"end":return t.stop()}}),null,this)}}])&&Yt(t.prototype,n),e}();function Xt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Qt=function(){function e(t,n,r,i){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modelManager=t,this.syncManager=n,this.storageManager=r,this.completionHandlers=[],this.loadMigrations();var a=!1,s=i.addEventHandler((function(e){e==Zt.DidSignInEvent&&(a=!0)}));this.receivedLocalDataEvent=n.initialDataLoaded(),this.syncManager.addEventHandler((function(e,t){var n,r,c,u,l,f,d,p,h;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(r="sync:completed"==e,!(n="local-data-loaded"==e)&&!r){t.next=40;break}if(n?o.receivedLocalDataEvent=!0:r&&(o.receivedSyncCompletedEvent=!0),!o.receivedLocalDataEvent||!o.receivedSyncCompletedEvent){t.next=40;break}if(!a){t.next=39;break}return a=!1,i.removeEventHandler(s),t.next=10,regeneratorRuntime.awrap(o.getCompletedMigrations());case 10:c=t.sent.slice(),u=!0,l=!1,f=void 0,t.prev=14,d=c[Symbol.iterator]();case 16:if(u=(p=d.next()).done){t.next=25;break}return h=p.value,t.next=20,regeneratorRuntime.awrap(o.migrationForEncodedName(h));case 20:t.sent.runOnlyOnce||Ve()(o._completed,h);case 22:u=!0,t.next=16;break;case 25:t.next=31;break;case 27:t.prev=27,t.t0=t.catch(14),l=!0,f=t.t0;case 31:t.prev=31,t.prev=32,u||null==d.return||d.return();case 34:if(t.prev=34,!l){t.next=37;break}throw f;case 37:return t.finish(34);case 38:return t.finish(31);case 39:o.runPendingMigrations();case 40:case"end":return t.stop()}}),null,null,[[14,27,31,39],[32,,34,38]])}))}var t,n;return t=e,(n=[{key:"addCompletionHandler",value:function(e){this.completionHandlers.push(e)}},{key:"removeCompletionHandler",value:function(e){Ve()(this.completionHandlers,e)}},{key:"migrationForEncodedName",value:function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(this.decode(e));case 2:return t=n.sent,n.abrupt("return",this.migrations.find((function(e){return e.name==t})));case 4:case"end":return n.stop()}}),null,this)}},{key:"loadMigrations",value:function(){this.migrations=this.registeredMigrations()}},{key:"registeredMigrations",value:function(){}},{key:"runPendingMigrations",value:function(){var e,t,n,r,i,o,a,s,c,u,l,f,d,p,h,v,m,y,g,b,w,k,x,$,_,S,M,C;return regeneratorRuntime.async((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,regeneratorRuntime.awrap(this.getPendingMigrations());case 2:for(e=A.sent,t=!0,n=!1,r=void 0,A.prev=6,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)(a=o.value).items=[];A.next=14;break;case 10:A.prev=10,A.t0=A.catch(6),n=!0,r=A.t0;case 14:A.prev=14,A.prev=15,t||null==i.return||i.return();case 17:if(A.prev=17,!n){A.next=20;break}throw r;case 20:return A.finish(17);case 21:return A.finish(14);case 22:s=!0,c=!1,u=void 0,A.prev=25,l=this.modelManager.allNondummyItems[Symbol.iterator]();case 27:if(s=(f=l.next()).done){A.next=51;break}for(d=f.value,p=!0,h=!1,v=void 0,A.prev=32,m=e[Symbol.iterator]();!(p=(y=m.next()).done);p=!0)a=y.value,d.content_type==a.content_type&&a.items.push(d);A.next=40;break;case 36:A.prev=36,A.t1=A.catch(32),h=!0,v=A.t1;case 40:A.prev=40,A.prev=41,p||null==m.return||m.return();case 43:if(A.prev=43,!h){A.next=46;break}throw v;case 46:return A.finish(43);case 47:return A.finish(40);case 48:s=!0,A.next=27;break;case 51:A.next=57;break;case 53:A.prev=53,A.t2=A.catch(25),c=!0,u=A.t2;case 57:A.prev=57,A.prev=58,s||null==l.return||l.return();case 60:if(A.prev=60,!c){A.next=63;break}throw u;case 63:return A.finish(60);case 64:return A.finish(57);case 65:g=!0,b=!1,w=void 0,A.prev=68,k=e[Symbol.iterator]();case 70:if(g=(x=k.next()).done){A.next=81;break}if(!((a=x.value).items&&a.items.length>0||a.customHandler)){A.next=77;break}return A.next=75,regeneratorRuntime.awrap(this.runMigration(a,a.items));case 75:A.next=78;break;case 77:this.markMigrationCompleted(a);case 78:g=!0,A.next=70;break;case 81:A.next=87;break;case 83:A.prev=83,A.t3=A.catch(68),b=!0,w=A.t3;case 87:A.prev=87,A.prev=88,g||null==k.return||k.return();case 90:if(A.prev=90,!b){A.next=93;break}throw w;case 93:return A.finish(90);case 94:return A.finish(87);case 95:for($=!0,_=!1,S=void 0,A.prev=98,M=this.completionHandlers[Symbol.iterator]();!($=(C=M.next()).done);$=!0)(0,C.value)();A.next=106;break;case 102:A.prev=102,A.t4=A.catch(98),_=!0,S=A.t4;case 106:A.prev=106,A.prev=107,$||null==M.return||M.return();case 109:if(A.prev=109,!_){A.next=112;break}throw S;case 112:return A.finish(109);case 113:return A.finish(106);case 114:case"end":return A.stop()}}),null,this,[[6,10,14,22],[15,,17,21],[25,53,57,65],[32,36,40,48],[41,,43,47],[58,,60,64],[68,83,87,95],[88,,90,94],[98,102,106,114],[107,,109,113]])}},{key:"encode",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",window.btoa(e));case 1:case"end":return t.stop()}}))}},{key:"decode",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",window.atob(e));case 1:case"end":return t.stop()}}))}},{key:"getCompletedMigrations",value:function(){var e;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._completed){t.next=5;break}return t.next=3,regeneratorRuntime.awrap(this.storageManager.getItem("migrations"));case 3:e=t.sent,this._completed=e?JSON.parse(e):[];case 5:return t.abrupt("return",this._completed);case 6:case"end":return t.stop()}}),null,this)}},{key:"getPendingMigrations",value:function(){var e,t,n,r,i,o,a,s;return regeneratorRuntime.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,regeneratorRuntime.awrap(this.getCompletedMigrations());case 2:e=c.sent,t=[],n=!0,r=!1,i=void 0,c.prev=7,o=this.migrations[Symbol.iterator]();case 9:if(n=(a=o.next()).done){c.next=22;break}return s=a.value,c.t0=e,c.next=14,regeneratorRuntime.awrap(this.encode(s.name));case 14:if(c.t1=c.sent,c.t2=c.t0.indexOf.call(c.t0,c.t1),c.t3=-1,c.t2!=c.t3){c.next=19;break}t.push(s);case 19:n=!0,c.next=9;break;case 22:c.next=28;break;case 24:c.prev=24,c.t4=c.catch(7),r=!0,i=c.t4;case 28:c.prev=28,c.prev=29,n||null==o.return||o.return();case 31:if(c.prev=31,!r){c.next=34;break}throw i;case 34:return c.finish(31);case 35:return c.finish(28);case 36:return c.abrupt("return",t);case 37:case"end":return c.stop()}}),null,this,[[7,24,28,36],[29,,31,35]])}},{key:"markMigrationCompleted",value:function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(this.getCompletedMigrations());case 2:return t=n.sent,n.t0=t,n.next=6,regeneratorRuntime.awrap(this.encode(e.name));case 6:n.t1=n.sent,n.t0.push.call(n.t0,n.t1),this.storageManager.setItem("migrations",JSON.stringify(t)),e.running=!1;case 10:case"end":return n.stop()}}),null,this)}},{key:"runMigration",value:function(e,t){var n=this;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.running){r.next=2;break}return r.abrupt("return");case 2:if(console.log("Running migration:",e.name),e.running=!0,!e.customHandler){r.next=8;break}return r.abrupt("return",e.customHandler().then((function(){n.markMigrationCompleted(e)})));case 8:return r.abrupt("return",e.handler(t).then((function(){n.markMigrationCompleted(e)})));case 9:case"end":return r.stop()}}))}}])&&Xt(t.prototype,n),e}();function en(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var tn=function(){function e(t,n,r,i,o){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modelManager=t,this.storageManager=n,this.$timeout=o||setTimeout.bind(window),this.keyRequestHandler=r,this.loadFromDisk().then((function(){a.modelManager.addItemSyncObserver("session-history",i,(function(e,t,n,r,i){if(r!==xt.MappingSourceLocalDirtied){var o=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var f=u.value;try{a.addHistoryEntryForItem(f)}catch(e){console.log("Caught exception while trying to add item history entry",e)}}}catch(e){s=!0,c=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw c}}}}))}))}var t,n;return t=e,(n=[{key:"encryptionParams",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.keyRequestHandler());case 1:case"end":return e.stop()}}),null,this)}},{key:"addHistoryEntryForItem",value:function(e){var t=this,n={uuid:e.uuid,content_type:e.content_type,updated_at:e.updated_at,content:e.getContentCopy()},r=this.historySession.addEntryForItem(n);this.autoOptimize&&this.historySession.optimizeHistoryForItem(e),r&&this.diskEnabled&&(this.diskTimeout&&(this.$timeout.hasOwnProperty("cancel")?this.$timeout.cancel(this.diskTimeout):clearTimeout(this.diskTimeout)),this.diskTimeout=this.$timeout((function(){t.saveToDisk()}),2e3))}},{key:"historyForItem",value:function(e){return this.historySession.historyForItem(e)}},{key:"clearHistoryForItem",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return this.historySession.clearItemHistory(e),t.abrupt("return",this.saveToDisk());case 2:case"end":return t.stop()}}),null,this)}},{key:"clearAllHistory",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return this.historySession.clearAllHistory(),e.abrupt("return",this.storageManager.removeItem("sessionHistory_revisions"));case 2:case"end":return e.stop()}}),null,this)}},{key:"toggleDiskSaving",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.diskEnabled=!this.diskEnabled,!this.diskEnabled){e.next=6;break}this.storageManager.setItem("sessionHistory_persist",JSON.stringify(!0)),this.saveToDisk(),e.next=8;break;case 6:return this.storageManager.setItem("sessionHistory_persist",JSON.stringify(!1)),e.abrupt("return",this.storageManager.removeItem("sessionHistory_revisions"));case 8:case"end":return e.stop()}}),null,this)}},{key:"saveToDisk",value:function(){var e,t=this;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.diskEnabled){n.next=2;break}return n.abrupt("return");case 2:return n.next=4,regeneratorRuntime.awrap(this.encryptionParams());case 4:e=n.sent,new ae(this.historySession,e.keys,e.auth_params).paramsForSync().then((function(e){t.storageManager.setItem("sessionHistory_revisions",JSON.stringify(e))}));case 7:case"end":return n.stop()}}),null,this)}},{key:"loadFromDisk",value:function(){var e,t,n,r,i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,regeneratorRuntime.awrap(this.storageManager.getItem("sessionHistory_persist"));case 2:return(e=o.sent)&&(this.diskEnabled=JSON.parse(e)),o.next=6,regeneratorRuntime.awrap(this.storageManager.getItem("sessionHistory_revisions"));case 6:if(!(t=o.sent)){o.next=18;break}return t=JSON.parse(t),o.next=11,regeneratorRuntime.awrap(this.encryptionParams());case 11:return n=o.sent,o.next=14,regeneratorRuntime.awrap(N.decryptItem(t,n.keys));case 14:r=new Rt(t),this.historySession=r,o.next=19;break;case 18:this.historySession=new Rt;case 19:return o.next=21,regeneratorRuntime.awrap(this.storageManager.getItem("sessionHistory_autoOptimize"));case 21:i=o.sent,this.autoOptimize=!i||JSON.parse(i);case 23:case"end":return o.stop()}}),null,this)}},{key:"toggleAutoOptimize",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.autoOptimize=!this.autoOptimize,this.autoOptimize?this.storageManager.setItem("sessionHistory_autoOptimize",JSON.stringify(!0)):this.storageManager.setItem("sessionHistory_autoOptimize",JSON.stringify(!1));case 2:case"end":return e.stop()}}),null,this)}}])&&en(t.prototype,n),e}();function nn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var rn=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modelManager=t,this.syncManager=n,this.singletonManager=r,this.loadPrivileges(),e.CredentialAccountPassword="CredentialAccountPassword",e.CredentialLocalPasscode="CredentialLocalPasscode",e.ActionManageExtensions="ActionManageExtensions",e.ActionManageBackups="ActionManageBackups",e.ActionViewProtectedNotes="ActionViewProtectedNotes",e.ActionManagePrivileges="ActionManagePrivileges",e.ActionManagePasscode="ActionManagePasscode",e.ActionDeleteNote="ActionDeleteNote",e.SessionExpiresAtKey="SessionExpiresAtKey",e.SessionLengthKey="SessionLengthKey",e.SessionLengthNone=0,e.SessionLengthFiveMinutes=300,e.SessionLengthOneHour=3600,e.SessionLengthOneWeek=604800,this.availableActions=[e.ActionViewProtectedNotes,e.ActionDeleteNote,e.ActionManagePasscode,e.ActionManageBackups,e.ActionManageExtensions,e.ActionManagePrivileges],this.availableCredentials=[e.CredentialAccountPassword,e.CredentialLocalPasscode],this.sessionLengths=[e.SessionLengthNone,e.SessionLengthFiveMinutes,e.SessionLengthOneHour,e.SessionLengthOneWeek,e.SessionLengthIndefinite]}var t,n;return t=e,(n=[{key:"setDelegate",value:function(e){this.delegate=e}},{key:"getAvailableActions",value:function(){return this.availableActions}},{key:"getAvailableCredentials",value:function(){return this.availableCredentials}},{key:"netCredentialsForAction",value:function(t){var n,r,i,o,a,s,c,u;return regeneratorRuntime.async((function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,regeneratorRuntime.awrap(this.getPrivileges());case 2:l.t0=t,n=l.sent.getCredentialsForAction(l.t0),r=[],i=!0,o=!1,a=void 0,l.prev=8,s=n[Symbol.iterator]();case 10:if(i=(c=s.next()).done){l.next=27;break}if((u=c.value)!=e.CredentialAccountPassword){l.next=19;break}return l.next=15,regeneratorRuntime.awrap(this.delegate.isOffline());case 15:l.sent||r.push(u),l.next=24;break;case 19:if(u!=e.CredentialLocalPasscode){l.next=24;break}return l.next=22,regeneratorRuntime.awrap(this.delegate.hasLocalPasscode());case 22:l.sent&&r.push(u);case 24:i=!0,l.next=10;break;case 27:l.next=33;break;case 29:l.prev=29,l.t1=l.catch(8),o=!0,a=l.t1;case 33:l.prev=33,l.prev=34,i||null==s.return||s.return();case 36:if(l.prev=36,!o){l.next=39;break}throw a;case 39:return l.finish(36);case 40:return l.finish(33);case 41:return l.abrupt("return",r);case 42:case"end":return l.stop()}}),null,this,[[8,29,33,41],[34,,36,40]])}},{key:"loadPrivileges",value:function(){var e=this;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.loadPromise){t.next=2;break}return t.abrupt("return",this.loadPromise);case 2:return this.loadPromise=new Promise((function(t,n){var r=Lt.contentType(),i=new G("content_type","=",r);e.singletonManager.registerSingleton([i],(function(n){e.privileges=n,t(n)}),(function(n){var i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(i=new Lt({content_type:r}),N.crypto.generateUUIDSync){o.next=4;break}return o.next=4,regeneratorRuntime.awrap(i.initUUID());case 4:e.modelManager.addItem(i),e.modelManager.setItemDirty(i,!0),e.syncManager.sync(),n(i),t(i);case 9:case"end":return o.stop()}}))}))})),t.abrupt("return",this.loadPromise);case 4:case"end":return t.stop()}}),null,this)}},{key:"getPrivileges",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.privileges){e.next=4;break}return e.abrupt("return",this.privileges);case 4:return e.abrupt("return",this.loadPrivileges());case 5:case"end":return e.stop()}}),null,this)}},{key:"displayInfoForCredential",value:function(t){var n={};return n[e.CredentialAccountPassword]={label:"Account Password",prompt:"Please enter your account password."},n[e.CredentialLocalPasscode]={label:"Local Passcode",prompt:"Please enter your local passcode."},n[t]}},{key:"displayInfoForAction",value:function(t){var n={};return n[e.ActionManageExtensions]={label:"Manage Extensions"},n[e.ActionManageBackups]={label:"Download/Import Backups"},n[e.ActionViewProtectedNotes]={label:"View Protected Notes"},n[e.ActionManagePrivileges]={label:"Manage Privileges"},n[e.ActionManagePasscode]={label:"Manage Passcode"},n[e.ActionDeleteNote]={label:"Delete Notes"},n[t]}},{key:"getSessionLengthOptions",value:function(){return[{value:e.SessionLengthNone,label:"Don't Remember"},{value:e.SessionLengthFiveMinutes,label:"5 Minutes"},{value:e.SessionLengthOneHour,label:"1 Hour"},{value:e.SessionLengthOneWeek,label:"1 Week"}]}},{key:"setSessionLength",value:function(t){var n;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return i=t,o=void 0,(o=new Date).setSeconds(o.getSeconds()+i),n=o,r.abrupt("return",Promise.all([this.delegate.saveToStorage(e.SessionExpiresAtKey,JSON.stringify(n)),this.delegate.saveToStorage(e.SessionLengthKey,JSON.stringify(t))]));case 3:case"end":return r.stop()}var i,o}),null,this)}},{key:"clearSession",value:function(){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.setSessionLength(e.SessionLengthNone));case 1:case"end":return t.stop()}}),null,this)}},{key:"getSelectedSessionLength",value:function(){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(this.delegate.getFromStorage(e.SessionLengthKey));case 2:if(!(t=n.sent)){n.next=7;break}return n.abrupt("return",JSON.parse(t));case 7:return n.abrupt("return",e.SessionLengthNone);case 8:case"end":return n.stop()}}),null,this)}},{key:"getSessionExpirey",value:function(){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(this.delegate.getFromStorage(e.SessionExpiresAtKey));case 2:if(!(t=n.sent)){n.next=7;break}return n.abrupt("return",new Date(JSON.parse(t)));case 7:return n.abrupt("return",new Date);case 8:case"end":return n.stop()}}),null,this)}},{key:"actionHasPrivilegesConfigured",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,regeneratorRuntime.awrap(this.netCredentialsForAction(e));case 2:return t.t0=t.sent.length,t.abrupt("return",t.t0>0);case 4:case"end":return t.stop()}}),null,this)}},{key:"actionRequiresPrivilege",value:function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(this.getSessionExpirey());case 2:if(!(n.sent>new Date)){n.next=5;break}return n.abrupt("return",!1);case 5:return n.next=7,regeneratorRuntime.awrap(this.netCredentialsForAction(e));case 7:return t=n.sent,n.abrupt("return",t.length>0);case 9:case"end":return n.stop()}}),null,this)}},{key:"savePrivileges",value:function(){var e;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,regeneratorRuntime.awrap(this.getPrivileges());case 2:e=t.sent,this.modelManager.setItemDirty(e,!0),this.syncManager.sync();case 5:case"end":return t.stop()}}),null,this)}},{key:"authenticateAction",value:function(e,t){var n,r,i,o,a,s,c,u,l;return regeneratorRuntime.async((function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,regeneratorRuntime.awrap(this.netCredentialsForAction(e));case 2:n=f.sent,r=[],i=[],o=!0,a=!1,s=void 0,f.prev=7,c=n[Symbol.iterator]();case 9:if(o=(u=c.next()).done){f.next=18;break}return l=u.value,f.next=13,regeneratorRuntime.awrap(this._verifyAuthenticationParameters(l,t[l]));case 13:f.sent?r.push(l):i.push(l);case 15:o=!0,f.next=9;break;case 18:f.next=24;break;case 20:f.prev=20,f.t0=f.catch(7),a=!0,s=f.t0;case 24:f.prev=24,f.prev=25,o||null==c.return||c.return();case 27:if(f.prev=27,!a){f.next=30;break}throw s;case 30:return f.finish(27);case 31:return f.finish(24);case 32:return f.abrupt("return",{success:0==i.length,successfulCredentials:r,failedCredentials:i});case 33:case"end":return f.stop()}}),null,this,[[7,20,24,32],[25,,27,31]])}},{key:"_verifyAuthenticationParameters",value:function(t,n){var r,i,o=this;return regeneratorRuntime.async((function(a){for(;;)switch(a.prev=a.next){case 0:if(r=function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o.delegate.verifyAccountPassword(e));case 1:case"end":return t.stop()}}))},i=function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o.delegate.verifyLocalPasscode(e));case 1:case"end":return t.stop()}}))},t!=e.CredentialAccountPassword){a.next=6;break}return a.abrupt("return",r(n));case 6:if(t!=e.CredentialLocalPasscode){a.next=8;break}return a.abrupt("return",i(n));case 8:case"end":return a.stop()}}))}}])&&nn(t.prototype,n),e}();function on(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var an=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.syncManager=n,this.modelManager=t,this.singletonHandlers=[],t.addItemSyncObserverWithPriority({id:"sf-singleton-manager",types:"*",priority:-1,callback:function(e,n,i,o,a){o!==xt.MappingSourceLocalDirtied&&r.resolveSingletons(t.allNondummyItems,null,!0)}}),n.addEventHandler((function(e,n){if("local-data-loaded"==e)r.resolveSingletons(t.allNondummyItems,null,!0),r.initialDataLoaded=!0;else if("sync:completed"==e){if(!r.initialDataLoaded)return;r.resolveSingletons(n.retrievedItems,n.savedItems)}})),t.addModelUuidChangeObserver("singleton-manager",(function(e,t){var n=!0,i=!1,o=void 0;try{for(var a,s=r.singletonHandlers[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var c=a.value;c.singleton&&G.ItemSatisfiesPredicates(t,c.predicates)&&(c.singleton=null,r.resolveSingletons([t]))}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}))}var t,n;return t=e,(n=[{key:"registerSingleton",value:function(e,t,n){this.singletonHandlers.push({predicates:e,resolutionCallback:t,createBlock:n})}},{key:"resolveSingletons",value:function(e,t,n){var r=this;e=e||[],t=t||[];var i=!0,o=!1,a=void 0;try{for(var s,c=function(){var i=s.value,o=i.predicates.slice(),a=r.modelManager.filterItemsWithPredicates(e,o),c=function(){i.createBlock&&(i.pendingCreateBlockCallback=!0,i.createBlock((function(e){i.singleton=e,i.pendingCreateBlockCallback=!1,i.resolutionCallback&&i.resolutionCallback(e)})))},u=r.modelManager.filterItemsWithPredicates(t,o).length;if(a.length>0||u>0){var l=r.modelManager.itemsMatchingPredicates(o);if(l.length>=2){var f=l.sort((function(e,t){return e.errorDecrypting?1:t.errorDecrypting?-1:e.created_at<t.created_at?-1:1})),d=f[0],p=f.slice(1,f.length),h=!0,v=!1,m=void 0;try{for(var y,g=p[Symbol.iterator]();!(h=(y=g.next()).done);h=!0){var b=y.value;r.modelManager.setItemToBeDeleted(b)}}catch(e){v=!0,m=e}finally{try{h||null==g.return||g.return()}finally{if(v)throw m}}r.syncManager.sync(),i.singleton=d,i.resolutionCallback&&i.resolutionCallback(d)}else if(1==l.length){var w=l[0];w.errorDecrypting?(r.modelManager.setItemToBeDeleted(w),c()):i.singleton&&i.singleton===w||(i.singleton=w,i.resolutionCallback&&i.resolutionCallback(w))}}else i.singleton||n||i.pendingCreateBlockCallback||c()},u=this.singletonHandlers[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)c()}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}}}])&&on(t.prototype,n),e}();n.d(t,"SNCryptoManager",(function(){return F})),n.d(t,"cryptoManager",(function(){return N})),n.d(t,"SFItem",(function(){return X})),n.d(t,"SFItemParams",(function(){return ae})),n.d(t,"SFPredicate",(function(){return G})),n.d(t,"SNNote",(function(){return ge})),n.d(t,"SNTag",(function(){return de})),n.d(t,"SNSmartTag",(function(){return $e})),n.d(t,"SNMfa",(function(){return Ae})),n.d(t,"SNServerExtension",(function(){return Pe})),n.d(t,"SNComponent",(function(){return Ue})),n.d(t,"SNEditor",(function(){return Ye})),n.d(t,"SNExtension",(function(){return it})),n.d(t,"Action",(function(){return rt})),n.d(t,"SNTheme",(function(){return ut})),n.d(t,"SNEncryptedStorage",(function(){return vt})),n.d(t,"SNComponentManager",(function(){return _t})),n.d(t,"SFHistorySession",(function(){return Rt})),n.d(t,"SFItemHistory",(function(){return At})),n.d(t,"SFItemHistoryEntry",(function(){return Mt})),n.d(t,"SFPrivileges",(function(){return Lt})),n.d(t,"SFAbstractCrypto",(function(){return a})),n.d(t,"SFCryptoWeb",(function(){return d})),n.d(t,"SFCryptoJS",(function(){return g})),n.d(t,"SFModelManager",(function(){return xt})),n.d(t,"SFHttpManager",(function(){return Ht})),n.d(t,"SFStorageManager",(function(){return Vt})),n.d(t,"SFSyncManager",(function(){return Kt})),n.d(t,"SFAuthManager",(function(){return Zt})),n.d(t,"SFMigrationManager",(function(){return Qt})),n.d(t,"SFAlertManager",(function(){return Jt})),n.d(t,"SFSessionHistoryManager",(function(){return tn})),n.d(t,"SFPrivilegesManager",(function(){return rn})),n.d(t,"SFSingletonManager",(function(){return an}))}])},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){n(37),e.exports=angular},function(e,t,n){(function(e,r){var i;
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/(function(){var o,a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",d=1,p=2,h=4,v=1,m=2,y=1,g=2,b=4,w=8,k=16,x=32,$=64,_=128,S=256,M=512,C=30,A="...",I=800,E=16,O=1,D=2,R=1/0,P=9007199254740991,T=17976931348623157e292,j=NaN,F=4294967295,N=F-1,L=F>>>1,U=[["ary",_],["bind",y],["bindKey",g],["curry",w],["curryRight",k],["flip",M],["partial",x],["partialRight",$],["rearg",S]],B="[object Arguments]",H="[object Array]",z="[object AsyncFunction]",V="[object Boolean]",W="[object Date]",K="[object DOMException]",q="[object Error]",J="[object Function]",G="[object GeneratorFunction]",Y="[object Map]",Z="[object Number]",X="[object Null]",Q="[object Object]",ee="[object Proxy]",te="[object RegExp]",ne="[object Set]",re="[object String]",ie="[object Symbol]",oe="[object Undefined]",ae="[object WeakMap]",se="[object WeakSet]",ce="[object ArrayBuffer]",ue="[object DataView]",le="[object Float32Array]",fe="[object Float64Array]",de="[object Int8Array]",pe="[object Int16Array]",he="[object Int32Array]",ve="[object Uint8Array]",me="[object Uint8ClampedArray]",ye="[object Uint16Array]",ge="[object Uint32Array]",be=/\b__p \+= '';/g,we=/\b(__p \+=) '' \+/g,ke=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xe=/&(?:amp|lt|gt|quot|#39);/g,$e=/[&<>"']/g,_e=RegExp(xe.source),Se=RegExp($e.source),Me=/<%-([\s\S]+?)%>/g,Ce=/<%([\s\S]+?)%>/g,Ae=/<%=([\s\S]+?)%>/g,Ie=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ee=/^\w*$/,Oe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,De=/[\\^$.*+?()[\]{}|]/g,Re=RegExp(De.source),Pe=/^\s+|\s+$/g,Te=/^\s+/,je=/\s+$/,Fe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ne=/\{\n\/\* \[wrapped with (.+)\] \*/,Le=/,? & /,Ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Be=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ze=/\w*$/,Ve=/^[-+]0x[0-9a-f]+$/i,We=/^0b[01]+$/i,Ke=/^\[object .+?Constructor\]$/,qe=/^0o[0-7]+$/i,Je=/^(?:0|[1-9]\d*)$/,Ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ye=/($^)/,Ze=/['\n\r\u2028\u2029\\]/g,Xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Qe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",et="[\\ud800-\\udfff]",tt="["+Qe+"]",nt="["+Xe+"]",rt="\\d+",it="[\\u2700-\\u27bf]",ot="[a-z\\xdf-\\xf6\\xf8-\\xff]",at="[^\\ud800-\\udfff"+Qe+rt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",st="\\ud83c[\\udffb-\\udfff]",ct="[^\\ud800-\\udfff]",ut="(?:\\ud83c[\\udde6-\\uddff]){2}",lt="[\\ud800-\\udbff][\\udc00-\\udfff]",ft="[A-Z\\xc0-\\xd6\\xd8-\\xde]",dt="(?:"+ot+"|"+at+")",pt="(?:"+ft+"|"+at+")",ht="(?:"+nt+"|"+st+")"+"?",vt="[\\ufe0e\\ufe0f]?"+ht+("(?:\\u200d(?:"+[ct,ut,lt].join("|")+")[\\ufe0e\\ufe0f]?"+ht+")*"),mt="(?:"+[it,ut,lt].join("|")+")"+vt,yt="(?:"+[ct+nt+"?",nt,ut,lt,et].join("|")+")",gt=RegExp("[']","g"),bt=RegExp(nt,"g"),wt=RegExp(st+"(?="+st+")|"+yt+vt,"g"),kt=RegExp([ft+"?"+ot+"+(?:['](?:d|ll|m|re|s|t|ve))?(?="+[tt,ft,"$"].join("|")+")",pt+"+(?:['](?:D|LL|M|RE|S|T|VE))?(?="+[tt,ft+dt,"$"].join("|")+")",ft+"?"+dt+"+(?:['](?:d|ll|m|re|s|t|ve))?",ft+"+(?:['](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rt,mt].join("|"),"g"),xt=RegExp("[\\u200d\\ud800-\\udfff"+Xe+"\\ufe0e\\ufe0f]"),$t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_t=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],St=-1,Mt={};Mt[le]=Mt[fe]=Mt[de]=Mt[pe]=Mt[he]=Mt[ve]=Mt[me]=Mt[ye]=Mt[ge]=!0,Mt[B]=Mt[H]=Mt[ce]=Mt[V]=Mt[ue]=Mt[W]=Mt[q]=Mt[J]=Mt[Y]=Mt[Z]=Mt[Q]=Mt[te]=Mt[ne]=Mt[re]=Mt[ae]=!1;var Ct={};Ct[B]=Ct[H]=Ct[ce]=Ct[ue]=Ct[V]=Ct[W]=Ct[le]=Ct[fe]=Ct[de]=Ct[pe]=Ct[he]=Ct[Y]=Ct[Z]=Ct[Q]=Ct[te]=Ct[ne]=Ct[re]=Ct[ie]=Ct[ve]=Ct[me]=Ct[ye]=Ct[ge]=!0,Ct[q]=Ct[J]=Ct[ae]=!1;var At={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},It=parseFloat,Et=parseInt,Ot="object"==typeof e&&e&&e.Object===Object&&e,Dt="object"==typeof self&&self&&self.Object===Object&&self,Rt=Ot||Dt||Function("return this")(),Pt=t&&!t.nodeType&&t,Tt=Pt&&"object"==typeof r&&r&&!r.nodeType&&r,jt=Tt&&Tt.exports===Pt,Ft=jt&&Ot.process,Nt=function(){try{var e=Tt&&Tt.require&&Tt.require("util").types;return e||Ft&&Ft.binding&&Ft.binding("util")}catch(e){}}(),Lt=Nt&&Nt.isArrayBuffer,Ut=Nt&&Nt.isDate,Bt=Nt&&Nt.isMap,Ht=Nt&&Nt.isRegExp,zt=Nt&&Nt.isSet,Vt=Nt&&Nt.isTypedArray;function Wt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Kt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function qt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Jt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Gt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Yt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Zt(e,t){return!!(null==e?0:e.length)&&cn(e,t,0)>-1}function Xt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Qt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function en(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function tn(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function nn(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function rn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var on=dn("length");function an(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function sn(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function cn(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):sn(e,ln,n)}function un(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function ln(e){return e!=e}function fn(e,t){var n=null==e?0:e.length;return n?vn(e,t)/n:j}function dn(e){return function(t){return null==t?o:t[e]}}function pn(e){return function(t){return null==e?o:e[t]}}function hn(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function vn(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==o&&(n=n===o?a:n+a)}return n}function mn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function yn(e){return function(t){return e(t)}}function gn(e,t){return Qt(t,(function(t){return e[t]}))}function bn(e,t){return e.has(t)}function wn(e,t){for(var n=-1,r=e.length;++n<r&&cn(t,e[n],0)>-1;);return n}function kn(e,t){for(var n=e.length;n--&&cn(t,e[n],0)>-1;);return n}var xn=pn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),$n=pn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function _n(e){return"\\"+At[e]}function Sn(e){return xt.test(e)}function Mn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Cn(e,t){return function(n){return e(t(n))}}function An(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==f||(e[n]=f,o[i++]=n)}return o}function In(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function En(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function On(e){return Sn(e)?function(e){var t=wt.lastIndex=0;for(;wt.test(e);)++t;return t}(e):on(e)}function Dn(e){return Sn(e)?function(e){return e.match(wt)||[]}(e):function(e){return e.split("")}(e)}var Rn=pn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Pn=function e(t){var n,r=(t=null==t?Rt:Pn.defaults(Rt.Object(),t,Pn.pick(Rt,_t))).Array,i=t.Date,Xe=t.Error,Qe=t.Function,et=t.Math,tt=t.Object,nt=t.RegExp,rt=t.String,it=t.TypeError,ot=r.prototype,at=Qe.prototype,st=tt.prototype,ct=t["__core-js_shared__"],ut=at.toString,lt=st.hasOwnProperty,ft=0,dt=(n=/[^.]+$/.exec(ct&&ct.keys&&ct.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",pt=st.toString,ht=ut.call(tt),vt=Rt._,mt=nt("^"+ut.call(lt).replace(De,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yt=jt?t.Buffer:o,wt=t.Symbol,xt=t.Uint8Array,At=yt?yt.allocUnsafe:o,Ot=Cn(tt.getPrototypeOf,tt),Dt=tt.create,Pt=st.propertyIsEnumerable,Tt=ot.splice,Ft=wt?wt.isConcatSpreadable:o,Nt=wt?wt.iterator:o,on=wt?wt.toStringTag:o,pn=function(){try{var e=Lo(tt,"defineProperty");return e({},"",{}),e}catch(e){}}(),Tn=t.clearTimeout!==Rt.clearTimeout&&t.clearTimeout,jn=i&&i.now!==Rt.Date.now&&i.now,Fn=t.setTimeout!==Rt.setTimeout&&t.setTimeout,Nn=et.ceil,Ln=et.floor,Un=tt.getOwnPropertySymbols,Bn=yt?yt.isBuffer:o,Hn=t.isFinite,zn=ot.join,Vn=Cn(tt.keys,tt),Wn=et.max,Kn=et.min,qn=i.now,Jn=t.parseInt,Gn=et.random,Yn=ot.reverse,Zn=Lo(t,"DataView"),Xn=Lo(t,"Map"),Qn=Lo(t,"Promise"),er=Lo(t,"Set"),tr=Lo(t,"WeakMap"),nr=Lo(tt,"create"),rr=tr&&new tr,ir={},or=fa(Zn),ar=fa(Xn),sr=fa(Qn),cr=fa(er),ur=fa(tr),lr=wt?wt.prototype:o,fr=lr?lr.valueOf:o,dr=lr?lr.toString:o;function pr(e){if(As(e)&&!ys(e)&&!(e instanceof yr)){if(e instanceof mr)return e;if(lt.call(e,"__wrapped__"))return da(e)}return new mr(e)}var hr=function(){function e(){}return function(t){if(!Cs(t))return{};if(Dt)return Dt(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function vr(){}function mr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function yr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=F,this.__views__=[]}function gr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function br(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function wr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function kr(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new wr;++t<n;)this.add(e[t])}function xr(e){var t=this.__data__=new br(e);this.size=t.size}function $r(e,t){var n=ys(e),r=!n&&ms(e),i=!n&&!r&&ks(e),o=!n&&!r&&!i&&js(e),a=n||r||i||o,s=a?mn(e.length,rt):[],c=s.length;for(var u in e)!t&&!lt.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Ko(u,c))||s.push(u);return s}function _r(e){var t=e.length;return t?e[ki(0,t-1)]:o}function Sr(e,t){return ca(no(e),Pr(t,0,e.length))}function Mr(e){return ca(no(e))}function Cr(e,t,n){(n===o||ps(e[t],n))&&(n!==o||t in e)||Dr(e,t,n)}function Ar(e,t,n){var r=e[t];lt.call(e,t)&&ps(r,n)&&(n!==o||t in e)||Dr(e,t,n)}function Ir(e,t){for(var n=e.length;n--;)if(ps(e[n][0],t))return n;return-1}function Er(e,t,n,r){return Lr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function Or(e,t){return e&&ro(t,ic(t),e)}function Dr(e,t,n){"__proto__"==t&&pn?pn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Rr(e,t){for(var n=-1,i=t.length,a=r(i),s=null==e;++n<i;)a[n]=s?o:Qs(e,t[n]);return a}function Pr(e,t,n){return e==e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function Tr(e,t,n,r,i,a){var s,c=t&d,u=t&p,l=t&h;if(n&&(s=i?n(e,r,i,a):n(e)),s!==o)return s;if(!Cs(e))return e;var f=ys(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&lt.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!c)return no(e,s)}else{var v=Ho(e),m=v==J||v==G;if(ks(e))return Yi(e,c);if(v==Q||v==B||m&&!i){if(s=u||m?{}:Vo(e),!c)return u?function(e,t){return ro(e,Bo(e),t)}(e,function(e,t){return e&&ro(t,oc(t),e)}(s,e)):function(e,t){return ro(e,Uo(e),t)}(e,Or(s,e))}else{if(!Ct[v])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case ce:return Zi(e);case V:case W:return new r(+e);case ue:return function(e,t){var n=t?Zi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case le:case fe:case de:case pe:case he:case ve:case me:case ye:case ge:return Xi(e,n);case Y:return new r;case Z:case re:return new r(e);case te:return function(e){var t=new e.constructor(e.source,ze.exec(e));return t.lastIndex=e.lastIndex,t}(e);case ne:return new r;case ie:return i=e,fr?tt(fr.call(i)):{}}var i}(e,v,c)}}a||(a=new xr);var y=a.get(e);if(y)return y;a.set(e,s),Rs(e)?e.forEach((function(r){s.add(Tr(r,t,n,r,e,a))})):Is(e)&&e.forEach((function(r,i){s.set(i,Tr(r,t,n,i,e,a))}));var g=f?o:(l?u?Do:Oo:u?oc:ic)(e);return qt(g||e,(function(r,i){g&&(r=e[i=r]),Ar(s,i,Tr(r,t,n,i,e,a))})),s}function jr(e,t,n){var r=n.length;if(null==e)return!r;for(e=tt(e);r--;){var i=n[r],a=t[i],s=e[i];if(s===o&&!(i in e)||!a(s))return!1}return!0}function Fr(e,t,n){if("function"!=typeof e)throw new it(c);return ia((function(){e.apply(o,n)}),t)}function Nr(e,t,n,r){var i=-1,o=Zt,s=!0,c=e.length,u=[],l=t.length;if(!c)return u;n&&(t=Qt(t,yn(n))),r?(o=Xt,s=!1):t.length>=a&&(o=bn,s=!1,t=new kr(t));e:for(;++i<c;){var f=e[i],d=null==n?f:n(f);if(f=r||0!==f?f:0,s&&d==d){for(var p=l;p--;)if(t[p]===d)continue e;u.push(f)}else o(t,d,r)||u.push(f)}return u}pr.templateSettings={escape:Me,evaluate:Ce,interpolate:Ae,variable:"",imports:{_:pr}},pr.prototype=vr.prototype,pr.prototype.constructor=pr,mr.prototype=hr(vr.prototype),mr.prototype.constructor=mr,yr.prototype=hr(vr.prototype),yr.prototype.constructor=yr,gr.prototype.clear=function(){this.__data__=nr?nr(null):{},this.size=0},gr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},gr.prototype.get=function(e){var t=this.__data__;if(nr){var n=t[e];return n===u?o:n}return lt.call(t,e)?t[e]:o},gr.prototype.has=function(e){var t=this.__data__;return nr?t[e]!==o:lt.call(t,e)},gr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=nr&&t===o?u:t,this},br.prototype.clear=function(){this.__data__=[],this.size=0},br.prototype.delete=function(e){var t=this.__data__,n=Ir(t,e);return!(n<0)&&(n==t.length-1?t.pop():Tt.call(t,n,1),--this.size,!0)},br.prototype.get=function(e){var t=this.__data__,n=Ir(t,e);return n<0?o:t[n][1]},br.prototype.has=function(e){return Ir(this.__data__,e)>-1},br.prototype.set=function(e,t){var n=this.__data__,r=Ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},wr.prototype.clear=function(){this.size=0,this.__data__={hash:new gr,map:new(Xn||br),string:new gr}},wr.prototype.delete=function(e){var t=Fo(this,e).delete(e);return this.size-=t?1:0,t},wr.prototype.get=function(e){return Fo(this,e).get(e)},wr.prototype.has=function(e){return Fo(this,e).has(e)},wr.prototype.set=function(e,t){var n=Fo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},kr.prototype.add=kr.prototype.push=function(e){return this.__data__.set(e,u),this},kr.prototype.has=function(e){return this.__data__.has(e)},xr.prototype.clear=function(){this.__data__=new br,this.size=0},xr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},xr.prototype.get=function(e){return this.__data__.get(e)},xr.prototype.has=function(e){return this.__data__.has(e)},xr.prototype.set=function(e,t){var n=this.__data__;if(n instanceof br){var r=n.__data__;if(!Xn||r.length<a-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new wr(r)}return n.set(e,t),this.size=n.size,this};var Lr=ao(qr),Ur=ao(Jr,!0);function Br(e,t){var n=!0;return Lr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function Hr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],s=t(a);if(null!=s&&(c===o?s==s&&!Ts(s):n(s,c)))var c=s,u=a}return u}function zr(e,t){var n=[];return Lr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function Vr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=Wo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?Vr(s,t-1,n,r,i):en(i,s):r||(i[i.length]=s)}return i}var Wr=so(),Kr=so(!0);function qr(e,t){return e&&Wr(e,t,ic)}function Jr(e,t){return e&&Kr(e,t,ic)}function Gr(e,t){return Yt(t,(function(t){return _s(e[t])}))}function Yr(e,t){for(var n=0,r=(t=Ki(t,e)).length;null!=e&&n<r;)e=e[la(t[n++])];return n&&n==r?e:o}function Zr(e,t,n){var r=t(e);return ys(e)?r:en(r,n(e))}function Xr(e){return null==e?e===o?oe:X:on&&on in tt(e)?function(e){var t=lt.call(e,on),n=e[on];try{e[on]=o;var r=!0}catch(e){}var i=pt.call(e);r&&(t?e[on]=n:delete e[on]);return i}(e):function(e){return pt.call(e)}(e)}function Qr(e,t){return e>t}function ei(e,t){return null!=e&&lt.call(e,t)}function ti(e,t){return null!=e&&t in tt(e)}function ni(e,t,n){for(var i=n?Xt:Zt,a=e[0].length,s=e.length,c=s,u=r(s),l=1/0,f=[];c--;){var d=e[c];c&&t&&(d=Qt(d,yn(t))),l=Kn(d.length,l),u[c]=!n&&(t||a>=120&&d.length>=120)?new kr(c&&d):o}d=e[0];var p=-1,h=u[0];e:for(;++p<a&&f.length<l;){var v=d[p],m=t?t(v):v;if(v=n||0!==v?v:0,!(h?bn(h,m):i(f,m,n))){for(c=s;--c;){var y=u[c];if(!(y?bn(y,m):i(e[c],m,n)))continue e}h&&h.push(m),f.push(v)}}return f}function ri(e,t,n){var r=null==(e=ta(e,t=Ki(t,e)))?e:e[la($a(t))];return null==r?o:Wt(r,e,n)}function ii(e){return As(e)&&Xr(e)==B}function oi(e,t,n,r,i){return e===t||(null==e||null==t||!As(e)&&!As(t)?e!=e&&t!=t:function(e,t,n,r,i,a){var s=ys(e),c=ys(t),u=s?H:Ho(e),l=c?H:Ho(t),f=(u=u==B?Q:u)==Q,d=(l=l==B?Q:l)==Q,p=u==l;if(p&&ks(e)){if(!ks(t))return!1;s=!0,f=!1}if(p&&!f)return a||(a=new xr),s||js(e)?Io(e,t,n,r,i,a):function(e,t,n,r,i,o,a){switch(n){case ue:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ce:return!(e.byteLength!=t.byteLength||!o(new xt(e),new xt(t)));case V:case W:case Z:return ps(+e,+t);case q:return e.name==t.name&&e.message==t.message;case te:case re:return e==t+"";case Y:var s=Mn;case ne:var c=r&v;if(s||(s=In),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=m,a.set(e,t);var l=Io(s(e),s(t),r,i,o,a);return a.delete(e),l;case ie:if(fr)return fr.call(e)==fr.call(t)}return!1}(e,t,u,n,r,i,a);if(!(n&v)){var h=f&&lt.call(e,"__wrapped__"),y=d&&lt.call(t,"__wrapped__");if(h||y){var g=h?e.value():e,b=y?t.value():t;return a||(a=new xr),i(g,b,n,r,a)}}if(!p)return!1;return a||(a=new xr),function(e,t,n,r,i,a){var s=n&v,c=Oo(e),u=c.length,l=Oo(t).length;if(u!=l&&!s)return!1;var f=u;for(;f--;){var d=c[f];if(!(s?d in t:lt.call(t,d)))return!1}var p=a.get(e);if(p&&a.get(t))return p==t;var h=!0;a.set(e,t),a.set(t,e);var m=s;for(;++f<u;){d=c[f];var y=e[d],g=t[d];if(r)var b=s?r(g,y,d,t,e,a):r(y,g,d,e,t,a);if(!(b===o?y===g||i(y,g,n,r,a):b)){h=!1;break}m||(m="constructor"==d)}if(h&&!m){var w=e.constructor,k=t.constructor;w!=k&&"constructor"in e&&"constructor"in t&&!("function"==typeof w&&w instanceof w&&"function"==typeof k&&k instanceof k)&&(h=!1)}return a.delete(e),a.delete(t),h}(e,t,n,r,i,a)}(e,t,n,r,oi,i))}function ai(e,t,n,r){var i=n.length,a=i,s=!r;if(null==e)return!a;for(e=tt(e);i--;){var c=n[i];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<a;){var u=(c=n[i])[0],l=e[u],f=c[1];if(s&&c[2]){if(l===o&&!(u in e))return!1}else{var d=new xr;if(r)var p=r(l,f,u,e,t,d);if(!(p===o?oi(f,l,v|m,r,d):p))return!1}}return!0}function si(e){return!(!Cs(e)||(t=e,dt&&dt in t))&&(_s(e)?mt:Ke).test(fa(e));var t}function ci(e){return"function"==typeof e?e:null==e?Ec:"object"==typeof e?ys(e)?hi(e[0],e[1]):pi(e):Lc(e)}function ui(e){if(!Zo(e))return Vn(e);var t=[];for(var n in tt(e))lt.call(e,n)&&"constructor"!=n&&t.push(n);return t}function li(e){if(!Cs(e))return function(e){var t=[];if(null!=e)for(var n in tt(e))t.push(n);return t}(e);var t=Zo(e),n=[];for(var r in e)("constructor"!=r||!t&&lt.call(e,r))&&n.push(r);return n}function fi(e,t){return e<t}function di(e,t){var n=-1,i=bs(e)?r(e.length):[];return Lr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function pi(e){var t=No(e);return 1==t.length&&t[0][2]?Qo(t[0][0],t[0][1]):function(n){return n===e||ai(n,e,t)}}function hi(e,t){return Jo(e)&&Xo(t)?Qo(la(e),t):function(n){var r=Qs(n,e);return r===o&&r===t?ec(n,e):oi(t,r,v|m)}}function vi(e,t,n,r,i){e!==t&&Wr(t,(function(a,s){if(i||(i=new xr),Cs(a))!function(e,t,n,r,i,a,s){var c=na(e,n),u=na(t,n),l=s.get(u);if(l)return void Cr(e,n,l);var f=a?a(c,u,n+"",e,t,s):o,d=f===o;if(d){var p=ys(u),h=!p&&ks(u),v=!p&&!h&&js(u);f=u,p||h||v?ys(c)?f=c:ws(c)?f=no(c):h?(d=!1,f=Yi(u,!0)):v?(d=!1,f=Xi(u,!0)):f=[]:Os(u)||ms(u)?(f=c,ms(c)?f=Vs(c):Cs(c)&&!_s(c)||(f=Vo(u))):d=!1}d&&(s.set(u,f),i(f,u,r,a,s),s.delete(u));Cr(e,n,f)}(e,t,s,n,vi,r,i);else{var c=r?r(na(e,s),a,s+"",e,t,i):o;c===o&&(c=a),Cr(e,s,c)}}),oc)}function mi(e,t){var n=e.length;if(n)return Ko(t+=t<0?n:0,n)?e[t]:o}function yi(e,t,n){var r=-1;return t=Qt(t.length?t:[Ec],yn(jo())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(di(e,(function(e,n,i){return{criteria:Qt(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;for(;++r<a;){var c=Qi(i[r],o[r]);if(c){if(r>=s)return c;var u=n[r];return c*("desc"==u?-1:1)}}return e.index-t.index}(e,t,n)}))}function gi(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Yr(e,a);n(s,a)&&Mi(o,Ki(a,e),s)}return o}function bi(e,t,n,r){var i=r?un:cn,o=-1,a=t.length,s=e;for(e===t&&(t=no(t)),n&&(s=Qt(e,yn(n)));++o<a;)for(var c=0,u=t[o],l=n?n(u):u;(c=i(s,l,c,r))>-1;)s!==e&&Tt.call(s,c,1),Tt.call(e,c,1);return e}function wi(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;Ko(i)?Tt.call(e,i,1):Ni(e,i)}}return e}function ki(e,t){return e+Ln(Gn()*(t-e+1))}function xi(e,t){var n="";if(!e||t<1||t>P)return n;do{t%2&&(n+=e),(t=Ln(t/2))&&(e+=e)}while(t);return n}function $i(e,t){return oa(ea(e,t,Ec),e+"")}function _i(e){return _r(pc(e))}function Si(e,t){var n=pc(e);return ca(n,Pr(t,0,n.length))}function Mi(e,t,n,r){if(!Cs(e))return e;for(var i=-1,a=(t=Ki(t,e)).length,s=a-1,c=e;null!=c&&++i<a;){var u=la(t[i]),l=n;if(i!=s){var f=c[u];(l=r?r(f,u,c):o)===o&&(l=Cs(f)?f:Ko(t[i+1])?[]:{})}Ar(c,u,l),c=c[u]}return e}var Ci=rr?function(e,t){return rr.set(e,t),e}:Ec,Ai=pn?function(e,t){return pn(e,"toString",{configurable:!0,enumerable:!1,value:Cc(t),writable:!0})}:Ec;function Ii(e){return ca(pc(e))}function Ei(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function Oi(e,t){var n;return Lr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function Di(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=L){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!Ts(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return Ri(e,t,Ec,n)}function Ri(e,t,n,r){t=n(t);for(var i=0,a=null==e?0:e.length,s=t!=t,c=null===t,u=Ts(t),l=t===o;i<a;){var f=Ln((i+a)/2),d=n(e[f]),p=d!==o,h=null===d,v=d==d,m=Ts(d);if(s)var y=r||v;else y=l?v&&(r||p):c?v&&p&&(r||!h):u?v&&p&&!h&&(r||!m):!h&&!m&&(r?d<=t:d<t);y?i=f+1:a=f}return Kn(a,N)}function Pi(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!ps(s,c)){var c=s;o[i++]=0===a?0:a}}return o}function Ti(e){return"number"==typeof e?e:Ts(e)?j:+e}function ji(e){if("string"==typeof e)return e;if(ys(e))return Qt(e,ji)+"";if(Ts(e))return dr?dr.call(e):"";var t=e+"";return"0"==t&&1/e==-R?"-0":t}function Fi(e,t,n){var r=-1,i=Zt,o=e.length,s=!0,c=[],u=c;if(n)s=!1,i=Xt;else if(o>=a){var l=t?null:$o(e);if(l)return In(l);s=!1,i=bn,u=new kr}else u=t?[]:c;e:for(;++r<o;){var f=e[r],d=t?t(f):f;if(f=n||0!==f?f:0,s&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),c.push(f)}else i(u,d,n)||(u!==c&&u.push(d),c.push(f))}return c}function Ni(e,t){return null==(e=ta(e,t=Ki(t,e)))||delete e[la($a(t))]}function Li(e,t,n,r){return Mi(e,t,n(Yr(e,t)),r)}function Ui(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Ei(e,r?0:o,r?o+1:i):Ei(e,r?o+1:0,r?i:o)}function Bi(e,t){var n=e;return n instanceof yr&&(n=n.value()),tn(t,(function(e,t){return t.func.apply(t.thisArg,en([e],t.args))}),n)}function Hi(e,t,n){var i=e.length;if(i<2)return i?Fi(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],c=-1;++c<i;)c!=o&&(a[o]=Nr(a[o]||s,e[c],t,n));return Fi(Vr(a,1),t,n)}function zi(e,t,n){for(var r=-1,i=e.length,a=t.length,s={};++r<i;){var c=r<a?t[r]:o;n(s,e[r],c)}return s}function Vi(e){return ws(e)?e:[]}function Wi(e){return"function"==typeof e?e:Ec}function Ki(e,t){return ys(e)?e:Jo(e,t)?[e]:ua(Ws(e))}var qi=$i;function Ji(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:Ei(e,t,n)}var Gi=Tn||function(e){return Rt.clearTimeout(e)};function Yi(e,t){if(t)return e.slice();var n=e.length,r=At?At(n):new e.constructor(n);return e.copy(r),r}function Zi(e){var t=new e.constructor(e.byteLength);return new xt(t).set(new xt(e)),t}function Xi(e,t){var n=t?Zi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Qi(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,a=Ts(e),s=t!==o,c=null===t,u=t==t,l=Ts(t);if(!c&&!l&&!a&&e>t||a&&s&&u&&!c&&!l||r&&s&&u||!n&&u||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||c&&n&&i||!s&&i||!u)return-1}return 0}function eo(e,t,n,i){for(var o=-1,a=e.length,s=n.length,c=-1,u=t.length,l=Wn(a-s,0),f=r(u+l),d=!i;++c<u;)f[c]=t[c];for(;++o<s;)(d||o<a)&&(f[n[o]]=e[o]);for(;l--;)f[c++]=e[o++];return f}function to(e,t,n,i){for(var o=-1,a=e.length,s=-1,c=n.length,u=-1,l=t.length,f=Wn(a-c,0),d=r(f+l),p=!i;++o<f;)d[o]=e[o];for(var h=o;++u<l;)d[h+u]=t[u];for(;++s<c;)(p||o<a)&&(d[h+n[s]]=e[o++]);return d}function no(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function ro(e,t,n,r){var i=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var c=t[a],u=r?r(n[c],e[c],c,n,e):o;u===o&&(u=e[c]),i?Dr(n,c,u):Ar(n,c,u)}return n}function io(e,t){return function(n,r){var i=ys(n)?Kt:Er,o=t?t():{};return i(n,e,jo(r,2),o)}}function oo(e){return $i((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,s=i>2?n[2]:o;for(a=e.length>3&&"function"==typeof a?(i--,a):o,s&&qo(n[0],n[1],s)&&(a=i<3?o:a,i=1),t=tt(t);++r<i;){var c=n[r];c&&e(t,c,r,a)}return t}))}function ao(e,t){return function(n,r){if(null==n)return n;if(!bs(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=tt(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function so(e){return function(t,n,r){for(var i=-1,o=tt(t),a=r(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===n(o[c],c,o))break}return t}}function co(e){return function(t){var n=Sn(t=Ws(t))?Dn(t):o,r=n?n[0]:t.charAt(0),i=n?Ji(n,1).join(""):t.slice(1);return r[e]()+i}}function uo(e){return function(t){return tn(_c(mc(t).replace(gt,"")),e,"")}}function lo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=hr(e.prototype),r=e.apply(n,t);return Cs(r)?r:n}}function fo(e){return function(t,n,r){var i=tt(t);if(!bs(t)){var a=jo(n,3);t=ic(t),n=function(e){return a(i[e],e,i)}}var s=e(t,n,r);return s>-1?i[a?t[s]:s]:o}}function po(e){return Eo((function(t){var n=t.length,r=n,i=mr.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new it(c);if(i&&!s&&"wrapper"==Po(a))var s=new mr([],!0)}for(r=s?r:n;++r<n;){var u=Po(a=t[r]),l="wrapper"==u?Ro(a):o;s=l&&Go(l[0])&&l[1]==(_|w|x|S)&&!l[4].length&&1==l[9]?s[Po(l[0])].apply(s,l[3]):1==a.length&&Go(a)?s[u]():s.thru(a)}return function(){var e=arguments,r=e[0];if(s&&1==e.length&&ys(r))return s.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function ho(e,t,n,i,a,s,c,u,l,f){var d=t&_,p=t&y,h=t&g,v=t&(w|k),m=t&M,b=h?o:lo(e);return function y(){for(var g=arguments.length,w=r(g),k=g;k--;)w[k]=arguments[k];if(v)var x=To(y),$=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(w,x);if(i&&(w=eo(w,i,a,v)),s&&(w=to(w,s,c,v)),g-=$,v&&g<f){var _=An(w,x);return ko(e,t,ho,y.placeholder,n,w,_,u,l,f-g)}var S=p?n:this,M=h?S[e]:e;return g=w.length,u?w=function(e,t){var n=e.length,r=Kn(t.length,n),i=no(e);for(;r--;){var a=t[r];e[r]=Ko(a,n)?i[a]:o}return e}(w,u):m&&g>1&&w.reverse(),d&&l<g&&(w.length=l),this&&this!==Rt&&this instanceof y&&(M=b||lo(M)),M.apply(S,w)}}function vo(e,t){return function(n,r){return function(e,t,n,r){return qr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function mo(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=ji(n),r=ji(r)):(n=Ti(n),r=Ti(r)),i=e(n,r)}return i}}function yo(e){return Eo((function(t){return t=Qt(t,yn(jo())),$i((function(n){var r=this;return e(t,(function(e){return Wt(e,r,n)}))}))}))}function go(e,t){var n=(t=t===o?" ":ji(t)).length;if(n<2)return n?xi(t,e):t;var r=xi(t,Nn(e/On(t)));return Sn(t)?Ji(Dn(r),0,e).join(""):r.slice(0,e)}function bo(e){return function(t,n,i){return i&&"number"!=typeof i&&qo(t,n,i)&&(n=i=o),t=Us(t),n===o?(n=t,t=0):n=Us(n),function(e,t,n,i){for(var o=-1,a=Wn(Nn((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,i=i===o?t<n?1:-1:Us(i),e)}}function wo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=zs(t),n=zs(n)),e(t,n)}}function ko(e,t,n,r,i,a,s,c,u,l){var f=t&w;t|=f?x:$,(t&=~(f?$:x))&b||(t&=~(y|g));var d=[e,t,i,f?a:o,f?s:o,f?o:a,f?o:s,c,u,l],p=n.apply(o,d);return Go(e)&&ra(p,d),p.placeholder=r,aa(p,e,t)}function xo(e){var t=et[e];return function(e,n){if(e=zs(e),(n=null==n?0:Kn(Bs(n),292))&&Hn(e)){var r=(Ws(e)+"e").split("e");return+((r=(Ws(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var $o=er&&1/In(new er([,-0]))[1]==R?function(e){return new er(e)}:Tc;function _o(e){return function(t){var n=Ho(t);return n==Y?Mn(t):n==ne?En(t):function(e,t){return Qt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function So(e,t,n,i,a,s,u,l){var d=t&g;if(!d&&"function"!=typeof e)throw new it(c);var p=i?i.length:0;if(p||(t&=~(x|$),i=a=o),u=u===o?u:Wn(Bs(u),0),l=l===o?l:Bs(l),p-=a?a.length:0,t&$){var h=i,v=a;i=a=o}var m=d?o:Ro(e),M=[e,t,n,i,a,h,v,s,u,l];if(m&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<(y|g|_),a=r==_&&n==w||r==_&&n==S&&e[7].length<=t[8]||r==(_|S)&&t[7].length<=t[8]&&n==w;if(!o&&!a)return e;r&y&&(e[2]=t[2],i|=n&y?0:b);var s=t[3];if(s){var c=e[3];e[3]=c?eo(c,s,t[4]):s,e[4]=c?An(e[3],f):t[4]}(s=t[5])&&(c=e[5],e[5]=c?to(c,s,t[6]):s,e[6]=c?An(e[5],f):t[6]);(s=t[7])&&(e[7]=s);r&_&&(e[8]=null==e[8]?t[8]:Kn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(M,m),e=M[0],t=M[1],n=M[2],i=M[3],a=M[4],!(l=M[9]=M[9]===o?d?0:e.length:Wn(M[9]-p,0))&&t&(w|k)&&(t&=~(w|k)),t&&t!=y)C=t==w||t==k?function(e,t,n){var i=lo(e);return function a(){for(var s=arguments.length,c=r(s),u=s,l=To(a);u--;)c[u]=arguments[u];var f=s<3&&c[0]!==l&&c[s-1]!==l?[]:An(c,l);return(s-=f.length)<n?ko(e,t,ho,a.placeholder,o,c,f,o,o,n-s):Wt(this&&this!==Rt&&this instanceof a?i:e,this,c)}}(e,t,l):t!=x&&t!=(y|x)||a.length?ho.apply(o,M):function(e,t,n,i){var o=t&y,a=lo(e);return function t(){for(var s=-1,c=arguments.length,u=-1,l=i.length,f=r(l+c),d=this&&this!==Rt&&this instanceof t?a:e;++u<l;)f[u]=i[u];for(;c--;)f[u++]=arguments[++s];return Wt(d,o?n:this,f)}}(e,t,n,i);else var C=function(e,t,n){var r=t&y,i=lo(e);return function t(){return(this&&this!==Rt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return aa((m?Ci:ra)(C,M),e,t)}function Mo(e,t,n,r){return e===o||ps(e,st[n])&&!lt.call(r,n)?t:e}function Co(e,t,n,r,i,a){return Cs(e)&&Cs(t)&&(a.set(t,e),vi(e,t,o,Co,a),a.delete(t)),e}function Ao(e){return Os(e)?o:e}function Io(e,t,n,r,i,a){var s=n&v,c=e.length,u=t.length;if(c!=u&&!(s&&u>c))return!1;var l=a.get(e);if(l&&a.get(t))return l==t;var f=-1,d=!0,p=n&m?new kr:o;for(a.set(e,t),a.set(t,e);++f<c;){var h=e[f],y=t[f];if(r)var g=s?r(y,h,f,t,e,a):r(h,y,f,e,t,a);if(g!==o){if(g)continue;d=!1;break}if(p){if(!rn(t,(function(e,t){if(!bn(p,t)&&(h===e||i(h,e,n,r,a)))return p.push(t)}))){d=!1;break}}else if(h!==y&&!i(h,y,n,r,a)){d=!1;break}}return a.delete(e),a.delete(t),d}function Eo(e){return oa(ea(e,o,ga),e+"")}function Oo(e){return Zr(e,ic,Uo)}function Do(e){return Zr(e,oc,Bo)}var Ro=rr?function(e){return rr.get(e)}:Tc;function Po(e){for(var t=e.name+"",n=ir[t],r=lt.call(ir,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function To(e){return(lt.call(pr,"placeholder")?pr:e).placeholder}function jo(){var e=pr.iteratee||Oc;return e=e===Oc?ci:e,arguments.length?e(arguments[0],arguments[1]):e}function Fo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function No(e){for(var t=ic(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Xo(i)]}return t}function Lo(e,t){var n=function(e,t){return null==e?o:e[t]}(e,t);return si(n)?n:o}var Uo=Un?function(e){return null==e?[]:(e=tt(e),Yt(Un(e),(function(t){return Pt.call(e,t)})))}:Hc,Bo=Un?function(e){for(var t=[];e;)en(t,Uo(e)),e=Ot(e);return t}:Hc,Ho=Xr;function zo(e,t,n){for(var r=-1,i=(t=Ki(t,e)).length,o=!1;++r<i;){var a=la(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Ms(i)&&Ko(a,i)&&(ys(e)||ms(e))}function Vo(e){return"function"!=typeof e.constructor||Zo(e)?{}:hr(Ot(e))}function Wo(e){return ys(e)||ms(e)||!!(Ft&&e&&e[Ft])}function Ko(e,t){var n=typeof e;return!!(t=null==t?P:t)&&("number"==n||"symbol"!=n&&Je.test(e))&&e>-1&&e%1==0&&e<t}function qo(e,t,n){if(!Cs(n))return!1;var r=typeof t;return!!("number"==r?bs(n)&&Ko(t,n.length):"string"==r&&t in n)&&ps(n[t],e)}function Jo(e,t){if(ys(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ts(e))||(Ee.test(e)||!Ie.test(e)||null!=t&&e in tt(t))}function Go(e){var t=Po(e),n=pr[t];if("function"!=typeof n||!(t in yr.prototype))return!1;if(e===n)return!0;var r=Ro(n);return!!r&&e===r[0]}(Zn&&Ho(new Zn(new ArrayBuffer(1)))!=ue||Xn&&Ho(new Xn)!=Y||Qn&&"[object Promise]"!=Ho(Qn.resolve())||er&&Ho(new er)!=ne||tr&&Ho(new tr)!=ae)&&(Ho=function(e){var t=Xr(e),n=t==Q?e.constructor:o,r=n?fa(n):"";if(r)switch(r){case or:return ue;case ar:return Y;case sr:return"[object Promise]";case cr:return ne;case ur:return ae}return t});var Yo=ct?_s:zc;function Zo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||st)}function Xo(e){return e==e&&!Cs(e)}function Qo(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==o||e in tt(n)))}}function ea(e,t,n){return t=Wn(t===o?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=Wn(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var c=r(t+1);++o<t;)c[o]=i[o];return c[t]=n(s),Wt(e,this,c)}}function ta(e,t){return t.length<2?e:Yr(e,Ei(t,0,-1))}function na(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ra=sa(Ci),ia=Fn||function(e,t){return Rt.setTimeout(e,t)},oa=sa(Ai);function aa(e,t,n){var r=t+"";return oa(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Fe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return qt(U,(function(n){var r="_."+n[0];t&n[1]&&!Zt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(Ne);return t?t[1].split(Le):[]}(r),n)))}function sa(e){var t=0,n=0;return function(){var r=qn(),i=E-(r-n);if(n=r,i>0){if(++t>=I)return arguments[0]}else t=0;return e.apply(o,arguments)}}function ca(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var a=ki(n,i),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var ua=function(e){var t=ss(e,(function(e){return n.size===l&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Oe,(function(e,n,r,i){t.push(r?i.replace(Be,"$1"):n||e)})),t}));function la(e){if("string"==typeof e||Ts(e))return e;var t=e+"";return"0"==t&&1/e==-R?"-0":t}function fa(e){if(null!=e){try{return ut.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function da(e){if(e instanceof yr)return e.clone();var t=new mr(e.__wrapped__,e.__chain__);return t.__actions__=no(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var pa=$i((function(e,t){return ws(e)?Nr(e,Vr(t,1,ws,!0)):[]})),ha=$i((function(e,t){var n=$a(t);return ws(n)&&(n=o),ws(e)?Nr(e,Vr(t,1,ws,!0),jo(n,2)):[]})),va=$i((function(e,t){var n=$a(t);return ws(n)&&(n=o),ws(e)?Nr(e,Vr(t,1,ws,!0),o,n):[]}));function ma(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Bs(n);return i<0&&(i=Wn(r+i,0)),sn(e,jo(t,3),i)}function ya(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=Bs(n),i=n<0?Wn(r+i,0):Kn(i,r-1)),sn(e,jo(t,3),i,!0)}function ga(e){return(null==e?0:e.length)?Vr(e,1):[]}function ba(e){return e&&e.length?e[0]:o}var wa=$i((function(e){var t=Qt(e,Vi);return t.length&&t[0]===e[0]?ni(t):[]})),ka=$i((function(e){var t=$a(e),n=Qt(e,Vi);return t===$a(n)?t=o:n.pop(),n.length&&n[0]===e[0]?ni(n,jo(t,2)):[]})),xa=$i((function(e){var t=$a(e),n=Qt(e,Vi);return(t="function"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?ni(n,o,t):[]}));function $a(e){var t=null==e?0:e.length;return t?e[t-1]:o}var _a=$i(Sa);function Sa(e,t){return e&&e.length&&t&&t.length?bi(e,t):e}var Ma=Eo((function(e,t){var n=null==e?0:e.length,r=Rr(e,t);return wi(e,Qt(t,(function(e){return Ko(e,n)?+e:e})).sort(Qi)),r}));function Ca(e){return null==e?e:Yn.call(e)}var Aa=$i((function(e){return Fi(Vr(e,1,ws,!0))})),Ia=$i((function(e){var t=$a(e);return ws(t)&&(t=o),Fi(Vr(e,1,ws,!0),jo(t,2))})),Ea=$i((function(e){var t=$a(e);return t="function"==typeof t?t:o,Fi(Vr(e,1,ws,!0),o,t)}));function Oa(e){if(!e||!e.length)return[];var t=0;return e=Yt(e,(function(e){if(ws(e))return t=Wn(e.length,t),!0})),mn(t,(function(t){return Qt(e,dn(t))}))}function Da(e,t){if(!e||!e.length)return[];var n=Oa(e);return null==t?n:Qt(n,(function(e){return Wt(t,o,e)}))}var Ra=$i((function(e,t){return ws(e)?Nr(e,t):[]})),Pa=$i((function(e){return Hi(Yt(e,ws))})),Ta=$i((function(e){var t=$a(e);return ws(t)&&(t=o),Hi(Yt(e,ws),jo(t,2))})),ja=$i((function(e){var t=$a(e);return t="function"==typeof t?t:o,Hi(Yt(e,ws),o,t)})),Fa=$i(Oa);var Na=$i((function(e){var t=e.length,n=t>1?e[t-1]:o;return n="function"==typeof n?(e.pop(),n):o,Da(e,n)}));function La(e){var t=pr(e);return t.__chain__=!0,t}function Ua(e,t){return t(e)}var Ba=Eo((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Rr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof yr&&Ko(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:Ua,args:[i],thisArg:o}),new mr(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(i)}));var Ha=io((function(e,t,n){lt.call(e,n)?++e[n]:Dr(e,n,1)}));var za=fo(ma),Va=fo(ya);function Wa(e,t){return(ys(e)?qt:Lr)(e,jo(t,3))}function Ka(e,t){return(ys(e)?Jt:Ur)(e,jo(t,3))}var qa=io((function(e,t,n){lt.call(e,n)?e[n].push(t):Dr(e,n,[t])}));var Ja=$i((function(e,t,n){var i=-1,o="function"==typeof t,a=bs(e)?r(e.length):[];return Lr(e,(function(e){a[++i]=o?Wt(t,e,n):ri(e,t,n)})),a})),Ga=io((function(e,t,n){Dr(e,n,t)}));function Ya(e,t){return(ys(e)?Qt:di)(e,jo(t,3))}var Za=io((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Xa=$i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&qo(e,t[0],t[1])?t=[]:n>2&&qo(t[0],t[1],t[2])&&(t=[t[0]]),yi(e,Vr(t,1),[])})),Qa=jn||function(){return Rt.Date.now()};function es(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,So(e,_,o,o,o,o,t)}function ts(e,t){var n;if("function"!=typeof t)throw new it(c);return e=Bs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var ns=$i((function(e,t,n){var r=y;if(n.length){var i=An(n,To(ns));r|=x}return So(e,r,t,n,i)})),rs=$i((function(e,t,n){var r=y|g;if(n.length){var i=An(n,To(rs));r|=x}return So(t,r,e,n,i)}));function is(e,t,n){var r,i,a,s,u,l,f=0,d=!1,p=!1,h=!0;if("function"!=typeof e)throw new it(c);function v(t){var n=r,a=i;return r=i=o,f=t,s=e.apply(a,n)}function m(e){var n=e-l;return l===o||n>=t||n<0||p&&e-f>=a}function y(){var e=Qa();if(m(e))return g(e);u=ia(y,function(e){var n=t-(e-l);return p?Kn(n,a-(e-f)):n}(e))}function g(e){return u=o,h&&r?v(e):(r=i=o,s)}function b(){var e=Qa(),n=m(e);if(r=arguments,i=this,l=e,n){if(u===o)return function(e){return f=e,u=ia(y,t),d?v(e):s}(l);if(p)return Gi(u),u=ia(y,t),v(l)}return u===o&&(u=ia(y,t)),s}return t=zs(t)||0,Cs(n)&&(d=!!n.leading,a=(p="maxWait"in n)?Wn(zs(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),b.cancel=function(){u!==o&&Gi(u),f=0,r=l=i=u=o},b.flush=function(){return u===o?s:g(Qa())},b}var os=$i((function(e,t){return Fr(e,1,t)})),as=$i((function(e,t,n){return Fr(e,zs(t)||0,n)}));function ss(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new it(c);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ss.Cache||wr),n}function cs(e){if("function"!=typeof e)throw new it(c);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ss.Cache=wr;var us=qi((function(e,t){var n=(t=1==t.length&&ys(t[0])?Qt(t[0],yn(jo())):Qt(Vr(t,1),yn(jo()))).length;return $i((function(r){for(var i=-1,o=Kn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Wt(e,this,r)}))})),ls=$i((function(e,t){var n=An(t,To(ls));return So(e,x,o,t,n)})),fs=$i((function(e,t){var n=An(t,To(fs));return So(e,$,o,t,n)})),ds=Eo((function(e,t){return So(e,S,o,o,o,t)}));function ps(e,t){return e===t||e!=e&&t!=t}var hs=wo(Qr),vs=wo((function(e,t){return e>=t})),ms=ii(function(){return arguments}())?ii:function(e){return As(e)&&lt.call(e,"callee")&&!Pt.call(e,"callee")},ys=r.isArray,gs=Lt?yn(Lt):function(e){return As(e)&&Xr(e)==ce};function bs(e){return null!=e&&Ms(e.length)&&!_s(e)}function ws(e){return As(e)&&bs(e)}var ks=Bn||zc,xs=Ut?yn(Ut):function(e){return As(e)&&Xr(e)==W};function $s(e){if(!As(e))return!1;var t=Xr(e);return t==q||t==K||"string"==typeof e.message&&"string"==typeof e.name&&!Os(e)}function _s(e){if(!Cs(e))return!1;var t=Xr(e);return t==J||t==G||t==z||t==ee}function Ss(e){return"number"==typeof e&&e==Bs(e)}function Ms(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=P}function Cs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function As(e){return null!=e&&"object"==typeof e}var Is=Bt?yn(Bt):function(e){return As(e)&&Ho(e)==Y};function Es(e){return"number"==typeof e||As(e)&&Xr(e)==Z}function Os(e){if(!As(e)||Xr(e)!=Q)return!1;var t=Ot(e);if(null===t)return!0;var n=lt.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ut.call(n)==ht}var Ds=Ht?yn(Ht):function(e){return As(e)&&Xr(e)==te};var Rs=zt?yn(zt):function(e){return As(e)&&Ho(e)==ne};function Ps(e){return"string"==typeof e||!ys(e)&&As(e)&&Xr(e)==re}function Ts(e){return"symbol"==typeof e||As(e)&&Xr(e)==ie}var js=Vt?yn(Vt):function(e){return As(e)&&Ms(e.length)&&!!Mt[Xr(e)]};var Fs=wo(fi),Ns=wo((function(e,t){return e<=t}));function Ls(e){if(!e)return[];if(bs(e))return Ps(e)?Dn(e):no(e);if(Nt&&e[Nt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Nt]());var t=Ho(e);return(t==Y?Mn:t==ne?In:pc)(e)}function Us(e){return e?(e=zs(e))===R||e===-R?(e<0?-1:1)*T:e==e?e:0:0===e?e:0}function Bs(e){var t=Us(e),n=t%1;return t==t?n?t-n:t:0}function Hs(e){return e?Pr(Bs(e),0,F):0}function zs(e){if("number"==typeof e)return e;if(Ts(e))return j;if(Cs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Cs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Pe,"");var n=We.test(e);return n||qe.test(e)?Et(e.slice(2),n?2:8):Ve.test(e)?j:+e}function Vs(e){return ro(e,oc(e))}function Ws(e){return null==e?"":ji(e)}var Ks=oo((function(e,t){if(Zo(t)||bs(t))ro(t,ic(t),e);else for(var n in t)lt.call(t,n)&&Ar(e,n,t[n])})),qs=oo((function(e,t){ro(t,oc(t),e)})),Js=oo((function(e,t,n,r){ro(t,oc(t),e,r)})),Gs=oo((function(e,t,n,r){ro(t,ic(t),e,r)})),Ys=Eo(Rr);var Zs=$i((function(e,t){e=tt(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&qo(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],s=oc(a),c=-1,u=s.length;++c<u;){var l=s[c],f=e[l];(f===o||ps(f,st[l])&&!lt.call(e,l))&&(e[l]=a[l])}return e})),Xs=$i((function(e){return e.push(o,Co),Wt(sc,o,e)}));function Qs(e,t,n){var r=null==e?o:Yr(e,t);return r===o?n:r}function ec(e,t){return null!=e&&zo(e,t,ti)}var tc=vo((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=pt.call(t)),e[t]=n}),Cc(Ec)),nc=vo((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=pt.call(t)),lt.call(e,t)?e[t].push(n):e[t]=[n]}),jo),rc=$i(ri);function ic(e){return bs(e)?$r(e):ui(e)}function oc(e){return bs(e)?$r(e,!0):li(e)}var ac=oo((function(e,t,n){vi(e,t,n)})),sc=oo((function(e,t,n,r){vi(e,t,n,r)})),cc=Eo((function(e,t){var n={};if(null==e)return n;var r=!1;t=Qt(t,(function(t){return t=Ki(t,e),r||(r=t.length>1),t})),ro(e,Do(e),n),r&&(n=Tr(n,d|p|h,Ao));for(var i=t.length;i--;)Ni(n,t[i]);return n}));var uc=Eo((function(e,t){return null==e?{}:function(e,t){return gi(e,t,(function(t,n){return ec(e,n)}))}(e,t)}));function lc(e,t){if(null==e)return{};var n=Qt(Do(e),(function(e){return[e]}));return t=jo(t),gi(e,n,(function(e,n){return t(e,n[0])}))}var fc=_o(ic),dc=_o(oc);function pc(e){return null==e?[]:gn(e,ic(e))}var hc=uo((function(e,t,n){return t=t.toLowerCase(),e+(n?vc(t):t)}));function vc(e){return $c(Ws(e).toLowerCase())}function mc(e){return(e=Ws(e))&&e.replace(Ge,xn).replace(bt,"")}var yc=uo((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),gc=uo((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),bc=co("toLowerCase");var wc=uo((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var kc=uo((function(e,t,n){return e+(n?" ":"")+$c(t)}));var xc=uo((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),$c=co("toUpperCase");function _c(e,t,n){return e=Ws(e),(t=n?o:t)===o?function(e){return $t.test(e)}(e)?function(e){return e.match(kt)||[]}(e):function(e){return e.match(Ue)||[]}(e):e.match(t)||[]}var Sc=$i((function(e,t){try{return Wt(e,o,t)}catch(e){return $s(e)?e:new Xe(e)}})),Mc=Eo((function(e,t){return qt(t,(function(t){t=la(t),Dr(e,t,ns(e[t],e))})),e}));function Cc(e){return function(){return e}}var Ac=po(),Ic=po(!0);function Ec(e){return e}function Oc(e){return ci("function"==typeof e?e:Tr(e,d))}var Dc=$i((function(e,t){return function(n){return ri(n,e,t)}})),Rc=$i((function(e,t){return function(n){return ri(e,n,t)}}));function Pc(e,t,n){var r=ic(t),i=Gr(t,r);null!=n||Cs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Gr(t,ic(t)));var o=!(Cs(n)&&"chain"in n&&!n.chain),a=_s(e);return qt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=no(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,en([this.value()],arguments))})})),e}function Tc(){}var jc=yo(Qt),Fc=yo(Gt),Nc=yo(rn);function Lc(e){return Jo(e)?dn(la(e)):function(e){return function(t){return Yr(t,e)}}(e)}var Uc=bo(),Bc=bo(!0);function Hc(){return[]}function zc(){return!1}var Vc=mo((function(e,t){return e+t}),0),Wc=xo("ceil"),Kc=mo((function(e,t){return e/t}),1),qc=xo("floor");var Jc,Gc=mo((function(e,t){return e*t}),1),Yc=xo("round"),Zc=mo((function(e,t){return e-t}),0);return pr.after=function(e,t){if("function"!=typeof t)throw new it(c);return e=Bs(e),function(){if(--e<1)return t.apply(this,arguments)}},pr.ary=es,pr.assign=Ks,pr.assignIn=qs,pr.assignInWith=Js,pr.assignWith=Gs,pr.at=Ys,pr.before=ts,pr.bind=ns,pr.bindAll=Mc,pr.bindKey=rs,pr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return ys(e)?e:[e]},pr.chain=La,pr.chunk=function(e,t,n){t=(n?qo(e,t,n):t===o)?1:Wn(Bs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,c=r(Nn(i/t));a<i;)c[s++]=Ei(e,a,a+=t);return c},pr.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},pr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return en(ys(n)?no(n):[n],Vr(t,1))},pr.cond=function(e){var t=null==e?0:e.length,n=jo();return e=t?Qt(e,(function(e){if("function"!=typeof e[1])throw new it(c);return[n(e[0]),e[1]]})):[],$i((function(n){for(var r=-1;++r<t;){var i=e[r];if(Wt(i[0],this,n))return Wt(i[1],this,n)}}))},pr.conforms=function(e){return function(e){var t=ic(e);return function(n){return jr(n,e,t)}}(Tr(e,d))},pr.constant=Cc,pr.countBy=Ha,pr.create=function(e,t){var n=hr(e);return null==t?n:Or(n,t)},pr.curry=function e(t,n,r){var i=So(t,w,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},pr.curryRight=function e(t,n,r){var i=So(t,k,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},pr.debounce=is,pr.defaults=Zs,pr.defaultsDeep=Xs,pr.defer=os,pr.delay=as,pr.difference=pa,pr.differenceBy=ha,pr.differenceWith=va,pr.drop=function(e,t,n){var r=null==e?0:e.length;return r?Ei(e,(t=n||t===o?1:Bs(t))<0?0:t,r):[]},pr.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?Ei(e,0,(t=r-(t=n||t===o?1:Bs(t)))<0?0:t):[]},pr.dropRightWhile=function(e,t){return e&&e.length?Ui(e,jo(t,3),!0,!0):[]},pr.dropWhile=function(e,t){return e&&e.length?Ui(e,jo(t,3),!0):[]},pr.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&qo(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=Bs(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:Bs(r))<0&&(r+=i),r=n>r?0:Hs(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},pr.filter=function(e,t){return(ys(e)?Yt:zr)(e,jo(t,3))},pr.flatMap=function(e,t){return Vr(Ya(e,t),1)},pr.flatMapDeep=function(e,t){return Vr(Ya(e,t),R)},pr.flatMapDepth=function(e,t,n){return n=n===o?1:Bs(n),Vr(Ya(e,t),n)},pr.flatten=ga,pr.flattenDeep=function(e){return(null==e?0:e.length)?Vr(e,R):[]},pr.flattenDepth=function(e,t){return(null==e?0:e.length)?Vr(e,t=t===o?1:Bs(t)):[]},pr.flip=function(e){return So(e,M)},pr.flow=Ac,pr.flowRight=Ic,pr.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},pr.functions=function(e){return null==e?[]:Gr(e,ic(e))},pr.functionsIn=function(e){return null==e?[]:Gr(e,oc(e))},pr.groupBy=qa,pr.initial=function(e){return(null==e?0:e.length)?Ei(e,0,-1):[]},pr.intersection=wa,pr.intersectionBy=ka,pr.intersectionWith=xa,pr.invert=tc,pr.invertBy=nc,pr.invokeMap=Ja,pr.iteratee=Oc,pr.keyBy=Ga,pr.keys=ic,pr.keysIn=oc,pr.map=Ya,pr.mapKeys=function(e,t){var n={};return t=jo(t,3),qr(e,(function(e,r,i){Dr(n,t(e,r,i),e)})),n},pr.mapValues=function(e,t){var n={};return t=jo(t,3),qr(e,(function(e,r,i){Dr(n,r,t(e,r,i))})),n},pr.matches=function(e){return pi(Tr(e,d))},pr.matchesProperty=function(e,t){return hi(e,Tr(t,d))},pr.memoize=ss,pr.merge=ac,pr.mergeWith=sc,pr.method=Dc,pr.methodOf=Rc,pr.mixin=Pc,pr.negate=cs,pr.nthArg=function(e){return e=Bs(e),$i((function(t){return mi(t,e)}))},pr.omit=cc,pr.omitBy=function(e,t){return lc(e,cs(jo(t)))},pr.once=function(e){return ts(2,e)},pr.orderBy=function(e,t,n,r){return null==e?[]:(ys(t)||(t=null==t?[]:[t]),ys(n=r?o:n)||(n=null==n?[]:[n]),yi(e,t,n))},pr.over=jc,pr.overArgs=us,pr.overEvery=Fc,pr.overSome=Nc,pr.partial=ls,pr.partialRight=fs,pr.partition=Za,pr.pick=uc,pr.pickBy=lc,pr.property=Lc,pr.propertyOf=function(e){return function(t){return null==e?o:Yr(e,t)}},pr.pull=_a,pr.pullAll=Sa,pr.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?bi(e,t,jo(n,2)):e},pr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?bi(e,t,o,n):e},pr.pullAt=Ma,pr.range=Uc,pr.rangeRight=Bc,pr.rearg=ds,pr.reject=function(e,t){return(ys(e)?Yt:zr)(e,cs(jo(t,3)))},pr.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=jo(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return wi(e,i),n},pr.rest=function(e,t){if("function"!=typeof e)throw new it(c);return $i(e,t=t===o?t:Bs(t))},pr.reverse=Ca,pr.sampleSize=function(e,t,n){return t=(n?qo(e,t,n):t===o)?1:Bs(t),(ys(e)?Sr:Si)(e,t)},pr.set=function(e,t,n){return null==e?e:Mi(e,t,n)},pr.setWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:Mi(e,t,n,r)},pr.shuffle=function(e){return(ys(e)?Mr:Ii)(e)},pr.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&qo(e,t,n)?(t=0,n=r):(t=null==t?0:Bs(t),n=n===o?r:Bs(n)),Ei(e,t,n)):[]},pr.sortBy=Xa,pr.sortedUniq=function(e){return e&&e.length?Pi(e):[]},pr.sortedUniqBy=function(e,t){return e&&e.length?Pi(e,jo(t,2)):[]},pr.split=function(e,t,n){return n&&"number"!=typeof n&&qo(e,t,n)&&(t=n=o),(n=n===o?F:n>>>0)?(e=Ws(e))&&("string"==typeof t||null!=t&&!Ds(t))&&!(t=ji(t))&&Sn(e)?Ji(Dn(e),0,n):e.split(t,n):[]},pr.spread=function(e,t){if("function"!=typeof e)throw new it(c);return t=null==t?0:Wn(Bs(t),0),$i((function(n){var r=n[t],i=Ji(n,0,t);return r&&en(i,r),Wt(e,this,i)}))},pr.tail=function(e){var t=null==e?0:e.length;return t?Ei(e,1,t):[]},pr.take=function(e,t,n){return e&&e.length?Ei(e,0,(t=n||t===o?1:Bs(t))<0?0:t):[]},pr.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Ei(e,(t=r-(t=n||t===o?1:Bs(t)))<0?0:t,r):[]},pr.takeRightWhile=function(e,t){return e&&e.length?Ui(e,jo(t,3),!1,!0):[]},pr.takeWhile=function(e,t){return e&&e.length?Ui(e,jo(t,3)):[]},pr.tap=function(e,t){return t(e),e},pr.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new it(c);return Cs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),is(e,t,{leading:r,maxWait:t,trailing:i})},pr.thru=Ua,pr.toArray=Ls,pr.toPairs=fc,pr.toPairsIn=dc,pr.toPath=function(e){return ys(e)?Qt(e,la):Ts(e)?[e]:no(ua(Ws(e)))},pr.toPlainObject=Vs,pr.transform=function(e,t,n){var r=ys(e),i=r||ks(e)||js(e);if(t=jo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Cs(e)&&_s(o)?hr(Ot(e)):{}}return(i?qt:qr)(e,(function(e,r,i){return t(n,e,r,i)})),n},pr.unary=function(e){return es(e,1)},pr.union=Aa,pr.unionBy=Ia,pr.unionWith=Ea,pr.uniq=function(e){return e&&e.length?Fi(e):[]},pr.uniqBy=function(e,t){return e&&e.length?Fi(e,jo(t,2)):[]},pr.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?Fi(e,o,t):[]},pr.unset=function(e,t){return null==e||Ni(e,t)},pr.unzip=Oa,pr.unzipWith=Da,pr.update=function(e,t,n){return null==e?e:Li(e,t,Wi(n))},pr.updateWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:Li(e,t,Wi(n),r)},pr.values=pc,pr.valuesIn=function(e){return null==e?[]:gn(e,oc(e))},pr.without=Ra,pr.words=_c,pr.wrap=function(e,t){return ls(Wi(t),e)},pr.xor=Pa,pr.xorBy=Ta,pr.xorWith=ja,pr.zip=Fa,pr.zipObject=function(e,t){return zi(e||[],t||[],Ar)},pr.zipObjectDeep=function(e,t){return zi(e||[],t||[],Mi)},pr.zipWith=Na,pr.entries=fc,pr.entriesIn=dc,pr.extend=qs,pr.extendWith=Js,Pc(pr,pr),pr.add=Vc,pr.attempt=Sc,pr.camelCase=hc,pr.capitalize=vc,pr.ceil=Wc,pr.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=zs(n))==n?n:0),t!==o&&(t=(t=zs(t))==t?t:0),Pr(zs(e),t,n)},pr.clone=function(e){return Tr(e,h)},pr.cloneDeep=function(e){return Tr(e,d|h)},pr.cloneDeepWith=function(e,t){return Tr(e,d|h,t="function"==typeof t?t:o)},pr.cloneWith=function(e,t){return Tr(e,h,t="function"==typeof t?t:o)},pr.conformsTo=function(e,t){return null==t||jr(e,t,ic(t))},pr.deburr=mc,pr.defaultTo=function(e,t){return null==e||e!=e?t:e},pr.divide=Kc,pr.endsWith=function(e,t,n){e=Ws(e),t=ji(t);var r=e.length,i=n=n===o?r:Pr(Bs(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},pr.eq=ps,pr.escape=function(e){return(e=Ws(e))&&Se.test(e)?e.replace($e,$n):e},pr.escapeRegExp=function(e){return(e=Ws(e))&&Re.test(e)?e.replace(De,"\\$&"):e},pr.every=function(e,t,n){var r=ys(e)?Gt:Br;return n&&qo(e,t,n)&&(t=o),r(e,jo(t,3))},pr.find=za,pr.findIndex=ma,pr.findKey=function(e,t){return an(e,jo(t,3),qr)},pr.findLast=Va,pr.findLastIndex=ya,pr.findLastKey=function(e,t){return an(e,jo(t,3),Jr)},pr.floor=qc,pr.forEach=Wa,pr.forEachRight=Ka,pr.forIn=function(e,t){return null==e?e:Wr(e,jo(t,3),oc)},pr.forInRight=function(e,t){return null==e?e:Kr(e,jo(t,3),oc)},pr.forOwn=function(e,t){return e&&qr(e,jo(t,3))},pr.forOwnRight=function(e,t){return e&&Jr(e,jo(t,3))},pr.get=Qs,pr.gt=hs,pr.gte=vs,pr.has=function(e,t){return null!=e&&zo(e,t,ei)},pr.hasIn=ec,pr.head=ba,pr.identity=Ec,pr.includes=function(e,t,n,r){e=bs(e)?e:pc(e),n=n&&!r?Bs(n):0;var i=e.length;return n<0&&(n=Wn(i+n,0)),Ps(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&cn(e,t,n)>-1},pr.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Bs(n);return i<0&&(i=Wn(r+i,0)),cn(e,t,i)},pr.inRange=function(e,t,n){return t=Us(t),n===o?(n=t,t=0):n=Us(n),function(e,t,n){return e>=Kn(t,n)&&e<Wn(t,n)}(e=zs(e),t,n)},pr.invoke=rc,pr.isArguments=ms,pr.isArray=ys,pr.isArrayBuffer=gs,pr.isArrayLike=bs,pr.isArrayLikeObject=ws,pr.isBoolean=function(e){return!0===e||!1===e||As(e)&&Xr(e)==V},pr.isBuffer=ks,pr.isDate=xs,pr.isElement=function(e){return As(e)&&1===e.nodeType&&!Os(e)},pr.isEmpty=function(e){if(null==e)return!0;if(bs(e)&&(ys(e)||"string"==typeof e||"function"==typeof e.splice||ks(e)||js(e)||ms(e)))return!e.length;var t=Ho(e);if(t==Y||t==ne)return!e.size;if(Zo(e))return!ui(e).length;for(var n in e)if(lt.call(e,n))return!1;return!0},pr.isEqual=function(e,t){return oi(e,t)},pr.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:o)?n(e,t):o;return r===o?oi(e,t,o,n):!!r},pr.isError=$s,pr.isFinite=function(e){return"number"==typeof e&&Hn(e)},pr.isFunction=_s,pr.isInteger=Ss,pr.isLength=Ms,pr.isMap=Is,pr.isMatch=function(e,t){return e===t||ai(e,t,No(t))},pr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:o,ai(e,t,No(t),n)},pr.isNaN=function(e){return Es(e)&&e!=+e},pr.isNative=function(e){if(Yo(e))throw new Xe(s);return si(e)},pr.isNil=function(e){return null==e},pr.isNull=function(e){return null===e},pr.isNumber=Es,pr.isObject=Cs,pr.isObjectLike=As,pr.isPlainObject=Os,pr.isRegExp=Ds,pr.isSafeInteger=function(e){return Ss(e)&&e>=-P&&e<=P},pr.isSet=Rs,pr.isString=Ps,pr.isSymbol=Ts,pr.isTypedArray=js,pr.isUndefined=function(e){return e===o},pr.isWeakMap=function(e){return As(e)&&Ho(e)==ae},pr.isWeakSet=function(e){return As(e)&&Xr(e)==se},pr.join=function(e,t){return null==e?"":zn.call(e,t)},pr.kebabCase=yc,pr.last=$a,pr.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=Bs(n))<0?Wn(r+i,0):Kn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):sn(e,ln,i,!0)},pr.lowerCase=gc,pr.lowerFirst=bc,pr.lt=Fs,pr.lte=Ns,pr.max=function(e){return e&&e.length?Hr(e,Ec,Qr):o},pr.maxBy=function(e,t){return e&&e.length?Hr(e,jo(t,2),Qr):o},pr.mean=function(e){return fn(e,Ec)},pr.meanBy=function(e,t){return fn(e,jo(t,2))},pr.min=function(e){return e&&e.length?Hr(e,Ec,fi):o},pr.minBy=function(e,t){return e&&e.length?Hr(e,jo(t,2),fi):o},pr.stubArray=Hc,pr.stubFalse=zc,pr.stubObject=function(){return{}},pr.stubString=function(){return""},pr.stubTrue=function(){return!0},pr.multiply=Gc,pr.nth=function(e,t){return e&&e.length?mi(e,Bs(t)):o},pr.noConflict=function(){return Rt._===this&&(Rt._=vt),this},pr.noop=Tc,pr.now=Qa,pr.pad=function(e,t,n){e=Ws(e);var r=(t=Bs(t))?On(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return go(Ln(i),n)+e+go(Nn(i),n)},pr.padEnd=function(e,t,n){e=Ws(e);var r=(t=Bs(t))?On(e):0;return t&&r<t?e+go(t-r,n):e},pr.padStart=function(e,t,n){e=Ws(e);var r=(t=Bs(t))?On(e):0;return t&&r<t?go(t-r,n)+e:e},pr.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),Jn(Ws(e).replace(Te,""),t||0)},pr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&qo(e,t,n)&&(t=n=o),n===o&&("boolean"==typeof t?(n=t,t=o):"boolean"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=Us(e),t===o?(t=e,e=0):t=Us(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=Gn();return Kn(e+i*(t-e+It("1e-"+((i+"").length-1))),t)}return ki(e,t)},pr.reduce=function(e,t,n){var r=ys(e)?tn:hn,i=arguments.length<3;return r(e,jo(t,4),n,i,Lr)},pr.reduceRight=function(e,t,n){var r=ys(e)?nn:hn,i=arguments.length<3;return r(e,jo(t,4),n,i,Ur)},pr.repeat=function(e,t,n){return t=(n?qo(e,t,n):t===o)?1:Bs(t),xi(Ws(e),t)},pr.replace=function(){var e=arguments,t=Ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},pr.result=function(e,t,n){var r=-1,i=(t=Ki(t,e)).length;for(i||(i=1,e=o);++r<i;){var a=null==e?o:e[la(t[r])];a===o&&(r=i,a=n),e=_s(a)?a.call(e):a}return e},pr.round=Yc,pr.runInContext=e,pr.sample=function(e){return(ys(e)?_r:_i)(e)},pr.size=function(e){if(null==e)return 0;if(bs(e))return Ps(e)?On(e):e.length;var t=Ho(e);return t==Y||t==ne?e.size:ui(e).length},pr.snakeCase=wc,pr.some=function(e,t,n){var r=ys(e)?rn:Oi;return n&&qo(e,t,n)&&(t=o),r(e,jo(t,3))},pr.sortedIndex=function(e,t){return Di(e,t)},pr.sortedIndexBy=function(e,t,n){return Ri(e,t,jo(n,2))},pr.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Di(e,t);if(r<n&&ps(e[r],t))return r}return-1},pr.sortedLastIndex=function(e,t){return Di(e,t,!0)},pr.sortedLastIndexBy=function(e,t,n){return Ri(e,t,jo(n,2),!0)},pr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=Di(e,t,!0)-1;if(ps(e[n],t))return n}return-1},pr.startCase=kc,pr.startsWith=function(e,t,n){return e=Ws(e),n=null==n?0:Pr(Bs(n),0,e.length),t=ji(t),e.slice(n,n+t.length)==t},pr.subtract=Zc,pr.sum=function(e){return e&&e.length?vn(e,Ec):0},pr.sumBy=function(e,t){return e&&e.length?vn(e,jo(t,2)):0},pr.template=function(e,t,n){var r=pr.templateSettings;n&&qo(e,t,n)&&(t=o),e=Ws(e),t=Js({},t,r,Mo);var i,a,s=Js({},t.imports,r.imports,Mo),c=ic(s),u=gn(s,c),l=0,f=t.interpolate||Ye,d="__p += '",p=nt((t.escape||Ye).source+"|"+f.source+"|"+(f===Ae?He:Ye).source+"|"+(t.evaluate||Ye).source+"|$","g"),h="//# sourceURL="+(lt.call(t,"sourceURL")?(t.sourceURL+"").replace(/[\r\n]/g," "):"lodash.templateSources["+ ++St+"]")+"\n";e.replace(p,(function(t,n,r,o,s,c){return r||(r=o),d+=e.slice(l,c).replace(Ze,_n),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=c+t.length,t})),d+="';\n";var v=lt.call(t,"variable")&&t.variable;v||(d="with (obj) {\n"+d+"\n}\n"),d=(a?d.replace(be,""):d).replace(we,"$1").replace(ke,"$1;"),d="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Sc((function(){return Qe(c,h+"return "+d).apply(o,u)}));if(m.source=d,$s(m))throw m;return m},pr.times=function(e,t){if((e=Bs(e))<1||e>P)return[];var n=F,r=Kn(e,F);t=jo(t),e-=F;for(var i=mn(r,t);++n<e;)t(n);return i},pr.toFinite=Us,pr.toInteger=Bs,pr.toLength=Hs,pr.toLower=function(e){return Ws(e).toLowerCase()},pr.toNumber=zs,pr.toSafeInteger=function(e){return e?Pr(Bs(e),-P,P):0===e?e:0},pr.toString=Ws,pr.toUpper=function(e){return Ws(e).toUpperCase()},pr.trim=function(e,t,n){if((e=Ws(e))&&(n||t===o))return e.replace(Pe,"");if(!e||!(t=ji(t)))return e;var r=Dn(e),i=Dn(t);return Ji(r,wn(r,i),kn(r,i)+1).join("")},pr.trimEnd=function(e,t,n){if((e=Ws(e))&&(n||t===o))return e.replace(je,"");if(!e||!(t=ji(t)))return e;var r=Dn(e);return Ji(r,0,kn(r,Dn(t))+1).join("")},pr.trimStart=function(e,t,n){if((e=Ws(e))&&(n||t===o))return e.replace(Te,"");if(!e||!(t=ji(t)))return e;var r=Dn(e);return Ji(r,wn(r,Dn(t))).join("")},pr.truncate=function(e,t){var n=C,r=A;if(Cs(t)){var i="separator"in t?t.separator:i;n="length"in t?Bs(t.length):n,r="omission"in t?ji(t.omission):r}var a=(e=Ws(e)).length;if(Sn(e)){var s=Dn(e);a=s.length}if(n>=a)return e;var c=n-On(r);if(c<1)return r;var u=s?Ji(s,0,c).join(""):e.slice(0,c);if(i===o)return u+r;if(s&&(c+=u.length-c),Ds(i)){if(e.slice(c).search(i)){var l,f=u;for(i.global||(i=nt(i.source,Ws(ze.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var d=l.index;u=u.slice(0,d===o?c:d)}}else if(e.indexOf(ji(i),c)!=c){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+r},pr.unescape=function(e){return(e=Ws(e))&&_e.test(e)?e.replace(xe,Rn):e},pr.uniqueId=function(e){var t=++ft;return Ws(e)+t},pr.upperCase=xc,pr.upperFirst=$c,pr.each=Wa,pr.eachRight=Ka,pr.first=ba,Pc(pr,(Jc={},qr(pr,(function(e,t){lt.call(pr.prototype,t)||(Jc[t]=e)})),Jc),{chain:!1}),pr.VERSION="4.17.15",qt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){pr[e].placeholder=pr})),qt(["drop","take"],(function(e,t){yr.prototype[e]=function(n){n=n===o?1:Wn(Bs(n),0);var r=this.__filtered__&&!t?new yr(this):this.clone();return r.__filtered__?r.__takeCount__=Kn(n,r.__takeCount__):r.__views__.push({size:Kn(n,F),type:e+(r.__dir__<0?"Right":"")}),r},yr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),qt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=n==O||3==n;yr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:jo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),qt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");yr.prototype[e]=function(){return this[n](1).value()[0]}})),qt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");yr.prototype[e]=function(){return this.__filtered__?new yr(this):this[n](1)}})),yr.prototype.compact=function(){return this.filter(Ec)},yr.prototype.find=function(e){return this.filter(e).head()},yr.prototype.findLast=function(e){return this.reverse().find(e)},yr.prototype.invokeMap=$i((function(e,t){return"function"==typeof e?new yr(this):this.map((function(n){return ri(n,e,t)}))})),yr.prototype.reject=function(e){return this.filter(cs(jo(e)))},yr.prototype.slice=function(e,t){e=Bs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new yr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=Bs(t))<0?n.dropRight(-t):n.take(t-e)),n)},yr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},yr.prototype.toArray=function(){return this.take(F)},qr(yr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=pr[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);i&&(pr.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,c=t instanceof yr,u=s[0],l=c||ys(t),f=function(e){var t=i.apply(pr,en([e],s));return r&&d?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var d=this.__chain__,p=!!this.__actions__.length,h=a&&!d,v=c&&!p;if(!a&&l){t=v?t:new yr(this);var m=e.apply(t,s);return m.__actions__.push({func:Ua,args:[f],thisArg:o}),new mr(m,d)}return h&&v?e.apply(this,s):(m=this.thru(f),h?r?m.value()[0]:m.value():m)})})),qt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ot[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);pr.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(ys(i)?i:[],e)}return this[n]((function(n){return t.apply(ys(n)?n:[],e)}))}})),qr(yr.prototype,(function(e,t){var n=pr[t];if(n){var r=n.name+"";lt.call(ir,r)||(ir[r]=[]),ir[r].push({name:t,func:n})}})),ir[ho(o,g).name]=[{name:"wrapper",func:o}],yr.prototype.clone=function(){var e=new yr(this.__wrapped__);return e.__actions__=no(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=no(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=no(this.__views__),e},yr.prototype.reverse=function(){if(this.__filtered__){var e=new yr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},yr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=ys(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=Kn(t,e+a);break;case"takeRight":e=Wn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,c=s-a,u=r?s:a-1,l=this.__iteratees__,f=l.length,d=0,p=Kn(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return Bi(e,this.__actions__);var h=[];e:for(;c--&&d<p;){for(var v=-1,m=e[u+=t];++v<f;){var y=l[v],g=y.iteratee,b=y.type,w=g(m);if(b==D)m=w;else if(!w){if(b==O)continue e;break e}}h[d++]=m}return h},pr.prototype.at=Ba,pr.prototype.chain=function(){return La(this)},pr.prototype.commit=function(){return new mr(this.value(),this.__chain__)},pr.prototype.next=function(){this.__values__===o&&(this.__values__=Ls(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},pr.prototype.plant=function(e){for(var t,n=this;n instanceof vr;){var r=da(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},pr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof yr){var t=e;return this.__actions__.length&&(t=new yr(this)),(t=t.reverse()).__actions__.push({func:Ua,args:[Ca],thisArg:o}),new mr(t,this.__chain__)}return this.thru(Ca)},pr.prototype.toJSON=pr.prototype.valueOf=pr.prototype.value=function(){return Bi(this.__wrapped__,this.__actions__)},pr.prototype.first=pr.prototype.head,Nt&&(pr.prototype[Nt]=function(){return this}),pr}();Rt._=Pn,(i=function(){return Pn}.call(t,n,t,r))===o||(r.exports=i)}).call(this)}).call(this,n(49),n(50)(e))},function(e,t,n){var r=n(11),i=n(44);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},function(e,t,n){var r=n(45);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function i(e,t){return Array.isArray(e)?function(e,t){for(var n,r="",o="",a=Array.isArray(t),s=0;s<e.length;s++)(n=i(e[s]))&&(a&&t[s]&&(n=c(n)),r=r+o+n,o=" ");return r}(e,t):e&&"object"==typeof e?function(e){var t="",n="";for(var i in e)i&&e[i]&&r.call(e,i)&&(t=t+n+i,n=" ");return t}(e):e||""}function o(e){if(!e)return"";if("object"==typeof e){var t="";for(var n in e)r.call(e,n)&&(t=t+n+":"+e[n]+";");return t}return e+""}function a(e,t,n,r){if(!1===t||null==t||!t&&("class"===e||"style"===e))return"";if(!0===t)return" "+(r?e:e+'="'+e+'"');var i=typeof t;return"object"!==i&&"function"!==i||"function"!=typeof t.toJSON||(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=c(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"&#39;")+"'"}t.merge=function e(t,n){if(1===arguments.length){for(var r=t[0],i=1;i<t.length;i++)r=e(r,t[i]);return r}for(var a in n)if("class"===a){var s=t[a]||[];t[a]=(Array.isArray(s)?s:[s]).concat(n[a]||[])}else if("style"===a){s=(s=o(t[a]))&&";"!==s[s.length-1]?s+";":s;var c=o(n[a]);c=c&&";"!==c[c.length-1]?c+";":c,t[a]=s+c}else t[a]=n[a];return t},t.classes=i,t.style=o,t.attr=a,t.attrs=function(e,t){var n="";for(var s in e)if(r.call(e,s)){var c=e[s];if("class"===s){c=i(c),n=a(s,c,!1,t)+n;continue}"style"===s&&(c=o(c)),n+=a(s,c,!1,t)}return n};var s=/["&<>]/;function c(e){var t=""+e,n=s.exec(t);if(!n)return e;var r,i,o,a="";for(r=n.index,i=0;r<t.length;r++){switch(t.charCodeAt(r)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}i!==r&&(a+=t.substring(i,r)),i=r+1,a+=o}return i!==r?a+t.substring(i,r):a}t.escape=c,t.rethrow=function e(t,r,i,o){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&r||o))throw t.message+=" on line "+i,t;try{o=o||n(47).readFileSync(r,"utf8")}catch(n){e(t,null,i)}var a=3,s=o.split("\n"),c=Math.max(i-a,0),u=Math.min(s.length,i+a);a=s.slice(c,u).map((function(e,t){var n=t+c+1;return(n==i?" > ":" ")+n+"| "+e})).join("\n");throw t.path=r,t.message=(r||"Pug")+":"+i+"\n"+a+"\n\n"+t.message,t}},function(e,t,n){var r=n(71);function i(t,n,o){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,n){var i=r(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}},i(t,n,o||t)}e.exports=i},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r;window,r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t){var n,r,i,o=this,a=t.title,s=t.text,c=t.buttons;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i=function(e){if("Enter"===e.key){var t=o.primaryButton();t.action&&t.action(),o.dismiss()}},(r="keyupListener")in(n=this)?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,this.title=a,this.text=s,this.buttons=c}var t,n,i;return t=e,(n=[{key:"buttonsString",value:function(){var e=this.buttons.map((function(e,t){return function(e,t){return"\n <div id='button-".concat(t,"' class='sk-button ").concat(e.style,"'>\n <div class='sk-label'>").concat(e.text,"</div>\n </div>\n ")}(e,t)})).join("");return"\n <div class='sk-button-group'>\n ".concat(e,"\n </div>\n ")}},{key:"templateString",value:function(){var e=this.buttonsString(),t=this.title?"<div class='sk-h3 sk-panel-section-title'>".concat(this.title,"</div>"):"",n=this.text?"<p class='sk-p'>".concat(this.text,"</p>"):"";return'\n <div class="sk-modal">\n <div class="sk-modal-background"></div>\n <div class="sk-modal-content">\n <div class="sn-component">\n <div class="sk-panel" style=\'max-width: 500px;\'>\n <div class="sk-panel-content">\n <div class="sk-panel-section">\n '.concat(t,'\n\n <div class="sk-panel-row">\n ').concat(n,"\n </div>\n\n <div class=\"sk-panel-row\" style='margin-top: 8px;'>\n ").concat(e,"\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n ")}},{key:"dismiss",value:function(){this.onElement.removeChild(this.element),document.removeEventListener("keyup",this.keyupListener)}},{key:"primaryButton",value:function(){var e=this.buttons.find((function(e){return!0===e.primary}));return e||(e=this.buttons[this.buttons.length-1]),e}},{key:"present",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onElement;n||(n=document.body),this.onElement=n,this.element=document.createElement("div"),this.element.className="sn-component",this.element.innerHTML=this.templateString().trim(),document.addEventListener("keyup",this.keyupListener),this.buttons.forEach((function(t,n){e.element.querySelector("#button-".concat(n)).onclick=function(){t.action&&t.action(),e.dismiss()}})),n.appendChild(this.element)}}])&&r(t.prototype,n),i&&r(t,i),e}();n.d(t,"SKAlert",(function(){return i}))}])},e.exports=r()},function(e,t,n){var r=n(46);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(48);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(51);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(52);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(53);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(54);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(55);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(56);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(57);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(58);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(59);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(60);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(61);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(62);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(63);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(64);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(65);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(66);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(67);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(68);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(69);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(70);e.exports=(r.default||r).apply(r,[])},function(e,t,n){},function(e,t,n){},function(e,t){
/**
* @license AngularJS v1.7.9
* (c) 2010-2018 Google, Inc. http://angularjs.org
* License: MIT
*/
!function(e){"use strict";var t={objectMaxDepth:5,urlErrorParamsEnabled:!0};function n(e){if(!U(e))return t;L(e.objectMaxDepth)&&(t.objectMaxDepth=r(e.objectMaxDepth)?e.objectMaxDepth:NaN),L(e.urlErrorParamsEnabled)&&Z(e.urlErrorParamsEnabled)&&(t.urlErrorParamsEnabled=e.urlErrorParamsEnabled)}function r(e){return z(e)&&e>0}function i(e,n){n=n||Error;var r="https://errors.angularjs.org/1.7.9/",i=r.replace(".","\\.")+"[\\s\\S]*",o=new RegExp(i,"g");return function(){var i,a,s=arguments[0],c=arguments[1],u="["+(e?e+":":"")+s+"] ",l=de(arguments,2).map((function(e){return qe(e,t.objectMaxDepth)}));if(u+=c.replace(/\{\d+\}/g,(function(e){var t=+e.slice(1,-1);return t<l.length?l[t].replace(o,""):e})),u+="\n"+r+(e?e+"/":"")+s,t.urlErrorParamsEnabled)for(a=0,i="?";a<l.length;a++,i="&")u+=i+"p"+a+"="+encodeURIComponent(l[a]);return new n(u)}}var o,a,s,c,u=/^\/(.+)\/([a-z]*)$/,l="validity",f=Object.prototype.hasOwnProperty,d=function(e){return H(e)?e.toLowerCase():e},p=function(e){return H(e)?e.toUpperCase():e},h=[].slice,v=[].splice,m=[].push,y=Object.prototype.toString,g=Object.getPrototypeOf,b=i("ng"),w=e.angular||(e.angular={}),k=0;function x(e){if(null==e||G(e))return!1;if(W(e)||H(e)||a&&e instanceof a)return!0;var t="length"in Object(e)&&e.length;return z(t)&&(t>=0&&t-1 in e||"function"==typeof e.item)}function $(e,t,n){var r,i;if(e)if(q(e))for(r in e)"prototype"!==r&&"length"!==r&&"name"!==r&&e.hasOwnProperty(r)&&t.call(n,e[r],r,e);else if(W(e)||x(e)){var o="object"!=typeof e;for(r=0,i=e.length;r<i;r++)(o||r in e)&&t.call(n,e[r],r,e)}else if(e.forEach&&e.forEach!==$)e.forEach(t,n,e);else if(B(e))for(r in e)t.call(n,e[r],r,e);else if("function"==typeof e.hasOwnProperty)for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e);else for(r in e)f.call(e,r)&&t.call(n,e[r],r,e);return e}function _(e,t,n){for(var r=Object.keys(e).sort(),i=0;i<r.length;i++)t.call(n,e[r[i]],r[i]);return r}function S(e){return function(t,n){e(n,t)}}function M(){return++k}function C(e,t){t?e.$$hashKey=t:delete e.$$hashKey}function A(e,t,n){for(var r=e.$$hashKey,i=0,o=t.length;i<o;++i){var a=t[i];if(U(a)||q(a))for(var s=Object.keys(a),c=0,u=s.length;c<u;c++){var l=s[c],f=a[l];n&&U(f)?V(f)?e[l]=new Date(f.valueOf()):J(f)?e[l]=new RegExp(f):f.nodeName?e[l]=f.cloneNode(!0):ne(f)?e[l]=f.clone():"__proto__"!==l&&(U(e[l])||(e[l]=W(f)?[]:{}),A(e[l],[f],!0)):e[l]=f}}return C(e,r),e}function I(e){return A(e,h.call(arguments,1),!1)}function E(e){return A(e,h.call(arguments,1),!0)}function O(e){return parseInt(e,10)}o=e.document.documentMode;var D=Number.isNaN||function(e){return e!=e};function R(e,t){return I(Object.create(e),t)}function P(){}function T(e){return e}function j(e){return function(){return e}}function F(e){return q(e.toString)&&e.toString!==y}function N(e){return void 0===e}function L(e){return void 0!==e}function U(e){return null!==e&&"object"==typeof e}function B(e){return null!==e&&"object"==typeof e&&!g(e)}function H(e){return"string"==typeof e}function z(e){return"number"==typeof e}function V(e){return"[object Date]"===y.call(e)}function W(e){return Array.isArray(e)||e instanceof Array}function K(e){switch(y.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}}function q(e){return"function"==typeof e}function J(e){return"[object RegExp]"===y.call(e)}function G(e){return e&&e.window===e}function Y(e){return e&&e.$evalAsync&&e.$watch}function Z(e){return"boolean"==typeof e}function X(e){return e&&q(e.then)}P.$inject=[],T.$inject=[];var Q=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/;var ee=function(e){return H(e)?e.trim():e},te=function(e){return e.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};function ne(e){return!(!e||!(e.nodeName||e.prop&&e.attr&&e.find))}function re(e){return d(e.nodeName||e[0]&&e[0].nodeName)}function ie(e,t){return-1!==Array.prototype.indexOf.call(e,t)}function oe(e,t){var n=e.indexOf(t);return n>=0&&e.splice(n,1),n}function ae(e,t,n){var i,o,a=[],s=[];if(n=r(n)?n:NaN,t){if((o=t)&&z(o.length)&&Q.test(y.call(o))||(i=t,"[object ArrayBuffer]"===y.call(i)))throw b("cpta","Can't copy! TypedArray destination cannot be mutated.");if(e===t)throw b("cpi","Can't copy! Source and destination are identical.");return W(t)?t.length=0:$(t,(function(e,n){"$$hashKey"!==n&&delete t[n]})),a.push(e),s.push(t),c(e,t,n)}return u(e,n);function c(e,t,n){if(--n<0)return"...";var r,i=t.$$hashKey;if(W(e))for(var o=0,a=e.length;o<a;o++)t.push(u(e[o],n));else if(B(e))for(r in e)t[r]=u(e[r],n);else if(e&&"function"==typeof e.hasOwnProperty)for(r in e)e.hasOwnProperty(r)&&(t[r]=u(e[r],n));else for(r in e)f.call(e,r)&&(t[r]=u(e[r],n));return C(t,i),t}function u(e,t){if(!U(e))return e;var n=a.indexOf(e);if(-1!==n)return s[n];if(G(e)||Y(e))throw b("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");var r=!1,i=function(e){switch(y.call(e)){case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return new e.constructor(u(e.buffer),e.byteOffset,e.length);case"[object ArrayBuffer]":if(!e.slice){var t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}return e.slice(0);case"[object Boolean]":case"[object Number]":case"[object String]":case"[object Date]":return new e.constructor(e.valueOf());case"[object RegExp]":var n=new RegExp(e.source,e.toString().match(/[^/]*$/)[0]);return n.lastIndex=e.lastIndex,n;case"[object Blob]":return new e.constructor([e],{type:e.type})}if(q(e.cloneNode))return e.cloneNode(!0)}(e);return void 0===i&&(i=W(e)?[]:Object.create(g(e)),r=!0),a.push(e),s.push(i),r?c(e,i,t):i}}function se(e,t){return e===t||e!=e&&t!=t}function ce(e,t){if(e===t)return!0;if(null===e||null===t)return!1;if(e!=e&&t!=t)return!0;var n,r,i,o=typeof e;if(o===typeof t&&"object"===o){if(!W(e)){if(V(e))return!!V(t)&&se(e.getTime(),t.getTime());if(J(e))return!!J(t)&&e.toString()===t.toString();if(Y(e)||Y(t)||G(e)||G(t)||W(t)||V(t)||J(t))return!1;for(r in i=Le(),e)if("$"!==r.charAt(0)&&!q(e[r])){if(!ce(e[r],t[r]))return!1;i[r]=!0}for(r in t)if(!(r in i)&&"$"!==r.charAt(0)&&L(t[r])&&!q(t[r]))return!1;return!0}if(!W(t))return!1;if((n=e.length)===t.length){for(r=0;r<n;r++)if(!ce(e[r],t[r]))return!1;return!0}}return!1}var ue=function(){if(!L(ue.rules)){var t=e.document.querySelector("[ng-csp]")||e.document.querySelector("[data-ng-csp]");if(t){var n=t.getAttribute("ng-csp")||t.getAttribute("data-ng-csp");ue.rules={noUnsafeEval:!n||-1!==n.indexOf("no-unsafe-eval"),noInlineStyle:!n||-1!==n.indexOf("no-inline-style")}}else ue.rules={noUnsafeEval:function(){try{return new Function(""),!1}catch(e){return!0}}(),noInlineStyle:!1}}return ue.rules},le=function(){if(L(le.name_))return le.name_;var t,n,r,i,o=Me.length;for(n=0;n<o;++n)if(r=Me[n],t=e.document.querySelector("["+r.replace(":","\\:")+"jq]")){i=t.getAttribute(r+"jq");break}return le.name_=i};function fe(e,t,n){return e.concat(h.call(t,n))}function de(e,t){return h.call(e,t||0)}function pe(e,t){var n=arguments.length>2?de(arguments,2):[];return!q(t)||t instanceof RegExp?t:n.length?function(){return arguments.length?t.apply(e,fe(n,arguments,0)):t.apply(e,n)}:function(){return arguments.length?t.apply(e,arguments):t.call(e)}}function he(t,n){var r=n;return"string"==typeof t&&"$"===t.charAt(0)&&"$"===t.charAt(1)?r=void 0:G(n)?r="$WINDOW":n&&e.document===n?r="$DOCUMENT":Y(n)&&(r="$SCOPE"),r}function ve(e,t){if(!N(e))return z(t)||(t=t?2:null),JSON.stringify(e,he,t)}function me(e){return H(e)?JSON.parse(e):e}var ye=/:/g;function ge(e,t){e=e.replace(ye,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return D(n)?t:n}function be(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}function we(e,t,n){n=n?-1:1;var r=e.getTimezoneOffset();return be(e,n*(ge(t,r)-r))}function ke(e){e=a(e).clone().empty();var t=a("<div></div>").append(e).html();try{return e[0].nodeType===He?d(t):t.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,(function(e,t){return"<"+d(t)}))}catch(e){return d(t)}}function xe(e){try{return decodeURIComponent(e)}catch(e){}}function $e(e){var t={};return $((e||"").split("&"),(function(e){var n,r,i;e&&(r=e=e.replace(/\+/g,"%20"),-1!==(n=e.indexOf("="))&&(r=e.substring(0,n),i=e.substring(n+1)),L(r=xe(r))&&(i=!L(i)||xe(i),f.call(t,r)?W(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i))})),t}function _e(e){return Se(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Se(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,t?"%20":"+")}var Me=["ng-","data-ng-","ng:","x-ng-"];var Ce=function(t){var n=t.currentScript;if(!n)return!0;if(!(n instanceof e.HTMLScriptElement||n instanceof e.SVGScriptElement))return!1;var r=n.attributes;return[r.getNamedItem("src"),r.getNamedItem("href"),r.getNamedItem("xlink:href")].every((function(e){if(!e)return!0;if(!e.value)return!1;var n=t.createElement("a");if(n.href=e.value,t.location.origin===n.origin)return!0;switch(n.protocol){case"http:":case"https:":case"ftp:":case"blob:":case"file:":case"data:":return!0;default:return!1}}))}(e.document);function Ae(t,n){var r,i,o={};if($(Me,(function(e){var n=e+"app";!r&&t.hasAttribute&&t.hasAttribute(n)&&(r=t,i=t.getAttribute(n))})),$(Me,(function(e){var n,o=e+"app";!r&&(n=t.querySelector("["+o.replace(":","\\:")+"]"))&&(r=n,i=n.getAttribute(o))})),r){if(!Ce)return void e.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match.");o.strictDi=null!==function(e,t){var n,r,i=Me.length;for(r=0;r<i;++r)if(n=Me[r]+t,H(n=e.getAttribute(n)))return n;return null}(r,"strict-di"),n(r,i?[i]:[],o)}}function Ie(t,n,r){U(r)||(r={});r=I({strictDi:!1},r);var i=function(){if((t=a(t)).injector()){var i=t[0]===e.document?"document":ke(t);throw b("btstrpd","App already bootstrapped with this element '{0}'",i.replace(/</,"&lt;").replace(/>/,"&gt;"))}(n=n||[]).unshift(["$provide",function(e){e.value("$rootElement",t)}]),r.debugInfoEnabled&&n.push(["$compileProvider",function(e){e.debugInfoEnabled(!0)}]),n.unshift("ng");var o=Zt(n,r.strictDi);return o.invoke(["$rootScope","$rootElement","$compile","$injector",function(e,t,n,r){e.$apply((function(){t.data("$injector",r),n(t)(e)}))}]),o},o=/^NG_ENABLE_DEBUG_INFO!/,s=/^NG_DEFER_BOOTSTRAP!/;if(e&&o.test(e.name)&&(r.debugInfoEnabled=!0,e.name=e.name.replace(o,"")),e&&!s.test(e.name))return i();e.name=e.name.replace(s,""),w.resumeBootstrap=function(e){return $(e,(function(e){n.push(e)})),i()},q(w.resumeDeferredBootstrap)&&w.resumeDeferredBootstrap()}function Ee(){e.name="NG_ENABLE_DEBUG_INFO!"+e.name,e.location.reload()}function Oe(e){var t=w.element(e).injector();if(!t)throw b("test","no injector found for element argument to getTestability");return t.get("$$testability")}var De=/[A-Z]/g;function Re(e,t){return t=t||"_",e.replace(De,(function(e,n){return(n?t:"")+e.toLowerCase()}))}var Pe=!1;function Te(e,t,n){if(!e)throw b("areq","Argument '{0}' is {1}",t||"?",n||"required");return e}function je(e,t,n){return n&&W(e)&&(e=e[e.length-1]),Te(q(e),t,"not a function, got "+(e&&"object"==typeof e?e.constructor.name||"Object":typeof e)),e}function Fe(e,t){if("hasOwnProperty"===e)throw b("badname","hasOwnProperty is not a valid {0} name",t)}function Ne(e){for(var t,n=e[0],r=e[e.length-1],i=1;n!==r&&(n=n.nextSibling);i++)(t||e[i]!==n)&&(t||(t=a(h.call(e,0,i))),t.push(n));return t||e}function Le(){return Object.create(null)}function Ue(e){if(null==e)return"";switch(typeof e){case"string":break;case"number":e=""+e;break;default:e=!F(e)||W(e)||V(e)?ve(e):e.toString()}return e}var Be=1,He=3,ze=8,Ve=9,We=11;function Ke(e,t){if(W(e)){t=t||[];for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}else if(U(e))for(var i in t=t||{},e)"$"===i.charAt(0)&&"$"===i.charAt(1)||(t[i]=e[i]);return t||e}function qe(e,t){return"function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):N(e)?"undefined":"string"!=typeof e?function(e,t){var n=[];return r(t)&&(e=w.copy(e,null,t)),JSON.stringify(e,(function(e,t){if(U(t=he(e,t))){if(n.indexOf(t)>=0)return"...";n.push(t)}return t}))}(e,t):e}var Je={full:"1.7.9",major:1,minor:7,dot:9,codeName:"pollution-eradication"};dt.expando="ng339";var Ge=dt.cache={},Ye=1;dt._data=function(e){return this.cache[e[this.expando]]||{}};var Ze=/-([a-z])/g,Xe=/^-ms-/,Qe={mouseleave:"mouseout",mouseenter:"mouseover"},et=i("jqLite");function tt(e,t){return t.toUpperCase()}function nt(e){return e.replace(Ze,tt)}var rt=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,it=/<|&#?\w+;/,ot=/<([\w:-]+)/,at=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,st={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ct(e){return!it.test(e)}function ut(e){var t=e.nodeType;return t===Be||!t||t===Ve}function lt(e,t){var n,r,i,o,a=t.createDocumentFragment(),s=[];if(ct(e))s.push(t.createTextNode(e));else{for(n=a.appendChild(t.createElement("div")),r=(ot.exec(e)||["",""])[1].toLowerCase(),i=st[r]||st._default,n.innerHTML=i[1]+e.replace(at,"<$1></$2>")+i[2],o=i[0];o--;)n=n.lastChild;s=fe(s,n.childNodes),(n=a.firstChild).textContent=""}return a.textContent="",a.innerHTML="",$(s,(function(e){a.appendChild(e)})),a}st.optgroup=st.option,st.tbody=st.tfoot=st.colgroup=st.caption=st.thead,st.th=st.td;var ft=e.Node.prototype.contains||function(e){return!!(16&this.compareDocumentPosition(e))};function dt(t){if(t instanceof dt)return t;var n,r,i,o;if(H(t)&&(t=ee(t),n=!0),!(this instanceof dt)){if(n&&"<"!==t.charAt(0))throw et("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new dt(t)}n?_t(this,(r=t,i=i||e.document,(o=rt.exec(r))?[i.createElement(o[1])]:(o=lt(r,i))?o.childNodes:[])):q(t)?It(t):_t(this,t)}function pt(e){return e.cloneNode(!0)}function ht(e,t){!t&&ut(e)&&a.cleanData([e]),e.querySelectorAll&&a.cleanData(e.querySelectorAll("*"))}function vt(e){var t;for(t in e)return!1;return!0}function mt(e){var t=e.ng339,n=t&&Ge[t],r=n&&n.events,i=n&&n.data;i&&!vt(i)||r&&!vt(r)||(delete Ge[t],e.ng339=void 0)}function yt(e,t,n,r){if(L(r))throw et("offargs","jqLite#off() does not support the `selector` argument");var i=bt(e),o=i&&i.events,a=i&&i.handle;if(a){if(t){var s=function(t){var r=o[t];L(n)&&oe(r||[],n),L(n)&&r&&r.length>0||(e.removeEventListener(t,a),delete o[t])};$(t.split(" "),(function(e){s(e),Qe[e]&&s(Qe[e])}))}else for(t in o)"$destroy"!==t&&e.removeEventListener(t,a),delete o[t];mt(e)}}function gt(e,t){var n=e.ng339,r=n&&Ge[n];r&&(t?delete r.data[t]:r.data={},mt(e))}function bt(e,t){var n=e.ng339,r=n&&Ge[n];return t&&!r&&(e.ng339=n=++Ye,r=Ge[n]={events:{},data:{},handle:void 0}),r}function wt(e,t,n){if(ut(e)){var r,i=L(n),o=!i&&t&&!U(t),a=!t,s=bt(e,!o),c=s&&s.data;if(i)c[nt(t)]=n;else{if(a)return c;if(o)return c&&c[nt(t)];for(r in t)c[nt(r)]=t[r]}}}function kt(e,t){return!!e.getAttribute&&(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+t+" ")>-1}function xt(e,t){if(t&&e.setAttribute){var n=(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),r=n;$(t.split(" "),(function(e){e=ee(e),r=r.replace(" "+e+" "," ")})),r!==n&&e.setAttribute("class",ee(r))}}function $t(e,t){if(t&&e.setAttribute){var n=(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),r=n;$(t.split(" "),(function(e){e=ee(e),-1===r.indexOf(" "+e+" ")&&(r+=e+" ")})),r!==n&&e.setAttribute("class",ee(r))}}function _t(e,t){if(t)if(t.nodeType)e[e.length++]=t;else{var n=t.length;if("number"==typeof n&&t.window!==t){if(n)for(var r=0;r<n;r++)e[e.length++]=t[r]}else e[e.length++]=t}}function St(e,t){return Mt(e,"$"+(t||"ngController")+"Controller")}function Mt(e,t,n){e.nodeType===Ve&&(e=e.documentElement);for(var r=W(t)?t:[t];e;){for(var i=0,o=r.length;i<o;i++)if(L(n=a.data(e,r[i])))return n;e=e.parentNode||e.nodeType===We&&e.host}}function Ct(e){for(ht(e,!0);e.firstChild;)e.removeChild(e.firstChild)}function At(e,t){t||ht(e);var n=e.parentNode;n&&n.removeChild(e)}function It(t){function n(){e.document.removeEventListener("DOMContentLoaded",n),e.removeEventListener("load",n),t()}"complete"===e.document.readyState?e.setTimeout(t):(e.document.addEventListener("DOMContentLoaded",n),e.addEventListener("load",n))}var Et=dt.prototype={ready:It,toString:function(){var e=[];return $(this,(function(t){e.push(""+t)})),"["+e.join(", ")+"]"},eq:function(e){return a(e>=0?this[e]:this[this.length+e])},length:0,push:m,sort:[].sort,splice:[].splice},Ot={};$("multiple,selected,checked,disabled,readOnly,required,open".split(","),(function(e){Ot[d(e)]=e}));var Dt={};$("input,select,option,textarea,button,form,details".split(","),(function(e){Dt[e]=!0}));var Rt={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};function Pt(e,t){var n=Ot[t.toLowerCase()];return n&&Dt[re(e)]&&n}function Tt(e,t,n){n.call(e,t)}function jt(e,t,n){var r=t.relatedTarget;r&&(r===e||ft.call(e,r))||n.call(e,t)}function Ft(){this.$get=function(){return I(dt,{hasClass:function(e,t){return e.attr&&(e=e[0]),kt(e,t)},addClass:function(e,t){return e.attr&&(e=e[0]),$t(e,t)},removeClass:function(e,t){return e.attr&&(e=e[0]),xt(e,t)}})}}function Nt(e,t){var n=e&&e.$$hashKey;if(n)return"function"==typeof n&&(n=e.$$hashKey()),n;var r=typeof e;return n="function"===r||"object"===r&&null!==e?e.$$hashKey=r+":"+(t||M)():r+":"+e}$({data:wt,removeData:gt,hasData:function(e){for(var t in Ge[e.ng339])return!0;return!1},cleanData:function(e){for(var t=0,n=e.length;t<n;t++)gt(e[t]),yt(e[t])}},(function(e,t){dt[t]=e})),$({data:wt,inheritedData:Mt,scope:function(e){return a.data(e,"$scope")||Mt(e.parentNode||e,["$isolateScope","$scope"])},isolateScope:function(e){return a.data(e,"$isolateScope")||a.data(e,"$isolateScopeNoTemplate")},controller:St,injector:function(e){return Mt(e,"$injector")},removeAttr:function(e,t){e.removeAttribute(t)},hasClass:kt,css:function(e,t,n){if(t=function(e){return nt(e.replace(Xe,"ms-"))}(t),!L(n))return e.style[t];e.style[t]=n},attr:function(e,t,n){var r,i=e.nodeType;if(i!==He&&2!==i&&i!==ze&&e.getAttribute){var o=d(t),a=Ot[o];if(!L(n))return r=e.getAttribute(t),a&&null!==r&&(r=o),null===r?void 0:r;null===n||!1===n&&a?e.removeAttribute(t):e.setAttribute(t,a?o:n)}},prop:function(e,t,n){if(!L(n))return e[t];e[t]=n},text:function(){return e.$dv="",e;function e(e,t){if(N(t)){var n=e.nodeType;return n===Be||n===He?e.textContent:""}e.textContent=t}}(),val:function(e,t){if(N(t)){if(e.multiple&&"select"===re(e)){var n=[];return $(e.options,(function(e){e.selected&&n.push(e.value||e.text)})),n}return e.value}e.value=t},html:function(e,t){if(N(t))return e.innerHTML;ht(e,!0),e.innerHTML=t},empty:Ct},(function(e,t){dt.prototype[t]=function(t,n){var r,i,o=this.length;if(e!==Ct&&N(2===e.length&&e!==kt&&e!==St?t:n)){if(U(t)){for(r=0;r<o;r++)if(e===wt)e(this[r],t);else for(i in t)e(this[r],i,t[i]);return this}for(var a=e.$dv,s=N(a)?Math.min(o,1):o,c=0;c<s;c++){var u=e(this[c],t,n);a=a?a+u:u}return a}for(r=0;r<o;r++)e(this[r],t,n);return this}})),$({removeData:gt,on:function(e,t,n,r){if(L(r))throw et("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(ut(e)){var i=bt(e,!0),o=i.events,a=i.handle;a||(a=i.handle=function(e,t){var n=function(n,r){n.isDefaultPrevented=function(){return n.defaultPrevented};var i=t[r||n.type],o=i?i.length:0;if(o){if(N(n.immediatePropagationStopped)){var a=n.stopImmediatePropagation;n.stopImmediatePropagation=function(){n.immediatePropagationStopped=!0,n.stopPropagation&&n.stopPropagation(),a&&a.call(n)}}n.isImmediatePropagationStopped=function(){return!0===n.immediatePropagationStopped};var s=i.specialHandlerWrapper||Tt;o>1&&(i=Ke(i));for(var c=0;c<o;c++)n.isImmediatePropagationStopped()||s(e,n,i[c])}};return n.elem=e,n}(e,o));for(var s=t.indexOf(" ")>=0?t.split(" "):[t],c=s.length,u=function(t,r,i){var s=o[t];s||((s=o[t]=[]).specialHandlerWrapper=r,"$destroy"===t||i||e.addEventListener(t,a)),s.push(n)};c--;)t=s[c],Qe[t]?(u(Qe[t],jt),u(t,void 0,!0)):u(t)}},off:yt,one:function(e,t,n){(e=a(e)).on(t,(function r(){e.off(t,n),e.off(t,r)})),e.on(t,n)},replaceWith:function(e,t){var n,r=e.parentNode;ht(e),$(new dt(t),(function(t){n?r.insertBefore(t,n.nextSibling):r.replaceChild(t,e),n=t}))},children:function(e){var t=[];return $(e.childNodes,(function(e){e.nodeType===Be&&t.push(e)})),t},contents:function(e){return e.contentDocument||e.childNodes||[]},append:function(e,t){var n=e.nodeType;if(n===Be||n===We)for(var r=0,i=(t=new dt(t)).length;r<i;r++){var o=t[r];e.appendChild(o)}},prepend:function(e,t){if(e.nodeType===Be){var n=e.firstChild;$(new dt(t),(function(t){e.insertBefore(t,n)}))}},wrap:function(e,t){var n,r,i;n=e,r=a(t).eq(0).clone()[0],(i=n.parentNode)&&i.replaceChild(r,n),r.appendChild(n)},remove:At,detach:function(e){At(e,!0)},after:function(e,t){var n=e,r=e.parentNode;if(r)for(var i=0,o=(t=new dt(t)).length;i<o;i++){var a=t[i];r.insertBefore(a,n.nextSibling),n=a}},addClass:$t,removeClass:xt,toggleClass:function(e,t,n){t&&$(t.split(" "),(function(t){var r=n;N(r)&&(r=!kt(e,t)),(r?$t:xt)(e,t)}))},parent:function(e){var t=e.parentNode;return t&&t.nodeType!==We?t:null},next:function(e){return e.nextElementSibling},find:function(e,t){return e.getElementsByTagName?e.getElementsByTagName(t):[]},clone:pt,triggerHandler:function(e,t,n){var r,i,o,a=t.type||t,s=bt(e),c=s&&s.events,u=c&&c[a];u&&(r={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:P,type:a,target:e},t.type&&(r=I(r,t)),i=Ke(u),o=n?[r].concat(n):[r],$(i,(function(t){r.isImmediatePropagationStopped()||t.apply(e,o)})))}},(function(e,t){dt.prototype[t]=function(t,n,r){for(var i,o=0,s=this.length;o<s;o++)N(i)?L(i=e(this[o],t,n,r))&&(i=a(i)):_t(i,e(this[o],t,n,r));return L(i)?i:this}})),dt.prototype.bind=dt.prototype.on,dt.prototype.unbind=dt.prototype.off;var Lt=Object.create(null);function Ut(){this._keys=[],this._values=[],this._lastKey=NaN,this._lastIndex=-1}Ut.prototype={_idx:function(e){return e!==this._lastKey&&(this._lastKey=e,this._lastIndex=this._keys.indexOf(e)),this._lastIndex},_transformKey:function(e){return D(e)?Lt:e},get:function(e){e=this._transformKey(e);var t=this._idx(e);if(-1!==t)return this._values[t]},has:function(e){return e=this._transformKey(e),-1!==this._idx(e)},set:function(e,t){e=this._transformKey(e);var n=this._idx(e);-1===n&&(n=this._lastIndex=this._keys.length),this._keys[n]=e,this._values[n]=t},delete:function(e){e=this._transformKey(e);var t=this._idx(e);return-1!==t&&(this._keys.splice(t,1),this._values.splice(t,1),this._lastKey=NaN,this._lastIndex=-1,!0)}};var Bt=Ut,Ht=[function(){this.$get=[function(){return Bt}]}],zt=/^([^(]+?)=>/,Vt=/^[^(]*\(\s*([^)]*)\)/m,Wt=/,/,Kt=/^\s*(_?)(\S+?)\1\s*$/,qt=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Jt=i("$injector");function Gt(e){return Function.prototype.toString.call(e)}function Yt(e){var t=Gt(e).replace(qt,"");return t.match(zt)||t.match(Vt)}function Zt(e,t){t=!0===t;var n={},r="Provider",i=[],a=new Bt,s={$provide:{provider:h(v),factory:h(y),service:h((function(e,t){return y(e,["$injector",function(e){return e.instantiate(t)}])})),value:h((function(e,t){return y(e,j(t),!1)})),constant:h((function(e,t){Fe(e,"constant"),s[e]=t,l[e]=t})),decorator:function(e,t){var n=u.get(e+r),i=n.$get;n.$get=function(){var e=d.invoke(i,n);return d.invoke(t,null,{$delegate:e})}}}},u=s.$injector=b(s,(function(e,t){throw w.isString(t)&&i.push(t),Jt("unpr","Unknown provider: {0}",i.join(" <- "))})),l={},f=b(l,(function(e,t){var n=u.get(e+r,t);return d.invoke(n.$get,n,void 0,e)})),d=f;s["$injector"+r]={$get:j(f)},d.modules=u.modules=Le();var p=g(e);return(d=f.get("$injector")).strictDi=t,$(p,(function(e){e&&d.invoke(e)})),d.loadNewModules=function(e){$(g(e),(function(e){e&&d.invoke(e)}))},d;function h(e){return function(t,n){if(!U(t))return e(t,n);$(t,S(e))}}function v(e,t){if(Fe(e,"service"),(q(t)||W(t))&&(t=u.instantiate(t)),!t.$get)throw Jt("pget","Provider '{0}' must define $get factory method.",e);return s[e+r]=t}function m(e,t){return function(){var n=d.invoke(t,this);if(N(n))throw Jt("undef","Provider '{0}' must return a value from $get factory method.",e);return n}}function y(e,t,n){return v(e,{$get:!1!==n?m(e,t):t})}function g(e){Te(N(e)||W(e),"modulesToLoad","not an array");var t,n=[];return $(e,(function(e){if(!a.get(e)){a.set(e,!0);try{H(e)?(t=c(e),d.modules[e]=t,n=n.concat(g(t.requires)).concat(t._runBlocks),r(t._invokeQueue),r(t._configBlocks)):q(e)?n.push(u.invoke(e)):W(e)?n.push(u.invoke(e)):je(e,"module")}catch(t){throw W(e)&&(e=e[e.length-1]),t.message&&t.stack&&-1===t.stack.indexOf(t.message)&&(t=t.message+"\n"+t.stack),Jt("modulerr","Failed to instantiate module {0} due to:\n{1}",e,t.stack||t.message||t)}}function r(e){var t,n;for(t=0,n=e.length;t<n;t++){var r=e[t],i=u.get(r[0]);i[r[1]].apply(i,r[2])}}})),n}function b(e,a){function c(t,r){if(e.hasOwnProperty(t)){if(e[t]===n)throw Jt("cdep","Circular dependency found: {0}",t+" <- "+i.join(" <- "));return e[t]}try{return i.unshift(t),e[t]=n,e[t]=a(t,r),e[t]}catch(r){throw e[t]===n&&delete e[t],r}finally{i.shift()}}function u(e,n,r){for(var i=[],o=Zt.$$annotate(e,t,r),a=0,s=o.length;a<s;a++){var u=o[a];if("string"!=typeof u)throw Jt("itkn","Incorrect injection token! Expected service name as string, got {0}",u);i.push(n&&n.hasOwnProperty(u)?n[u]:c(u,r))}return i}return{invoke:function(e,t,n,r){"string"==typeof n&&(r=n,n=null);var i=u(e,n,r);return W(e)&&(e=e[e.length-1]),function(e){if(o||"function"!=typeof e)return!1;var t=e.$$ngIsClass;return Z(t)||(t=e.$$ngIsClass=/^class\b/.test(Gt(e))),t}(e)?(i.unshift(null),new(Function.prototype.bind.apply(e,i))):e.apply(t,i)},instantiate:function(e,t,n){var r=W(e)?e[e.length-1]:e,i=u(e,t,n);return i.unshift(null),new(Function.prototype.bind.apply(r,i))},get:c,annotate:Zt.$$annotate,has:function(t){return s.hasOwnProperty(t+r)||e.hasOwnProperty(t)}}}}function Xt(){var t=!0;this.disableAutoScrolling=function(){t=!1},this.$get=["$window","$location","$rootScope",function(n,r,i){var o=n.document;function s(e){if(e){e.scrollIntoView();var t=function(){var e=c.yOffset;if(q(e))e=e();else if(ne(e)){var t=e[0];e="fixed"!==n.getComputedStyle(t).position?0:t.getBoundingClientRect().bottom}else z(e)||(e=0);return e}();if(t){var r=e.getBoundingClientRect().top;n.scrollBy(0,r-t)}}else n.scrollTo(0,0)}function c(e){var t,n,i;(e=H(e)?e:z(e)?e.toString():r.hash())?(t=o.getElementById(e))?s(t):(n=o.getElementsByName(e),i=null,Array.prototype.some.call(n,(function(e){if("a"===re(e))return i=e,!0})),(t=i)?s(t):"top"===e&&s(null)):s(null)}return t&&i.$watch((function(){return r.hash()}),(function(t,n){var r,o;t===n&&""===t||(r=function(){i.$evalAsync(c)},"complete"===(o=o||e).document.readyState?o.setTimeout(r):a(o).on("load",r))})),c}]}Zt.$$annotate=function(e,t,n){var r,i;if("function"==typeof e){if(!(r=e.$inject)){if(r=[],e.length){if(t)throw H(n)&&n||(n=e.name||function(e){var t=Yt(e);return t?"function("+(t[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}(e)),Jt("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",n);$(Yt(e)[1].split(Wt),(function(e){e.replace(Kt,(function(e,t,n){r.push(n)}))}))}e.$inject=r}}else W(e)?(je(e[i=e.length-1],"fn"),r=e.slice(0,i)):je(e,"fn",!0);return r};var Qt=i("$animate"),en=1;function tn(e,t){return e||t?e?t?(W(e)&&(e=e.join(" ")),W(t)&&(t=t.join(" ")),e+" "+t):e:t:""}function nn(e){return U(e)?e:{}}var rn=function(){this.$get=P},on=function(){var e=new Bt,t=[];this.$get=["$$AnimateRunner","$rootScope",function(n,r){return{enabled:P,on:P,off:P,pin:P,push:function(a,s,c,u){u&&u(),(c=c||{}).from&&a.css(c.from),c.to&&a.css(c.to),(c.addClass||c.removeClass)&&function(n,a,s){var c=e.get(n)||{},u=i(c,a,!0),l=i(c,s,!1);(u||l)&&(e.set(n,c),t.push(n),1===t.length&&r.$$postDigest(o))}(a,c.addClass,c.removeClass);var l=new n;return l.complete(),l}};function i(e,t,n){var r=!1;return t&&$(t=H(t)?t.split(" "):W(t)?t:[],(function(t){t&&(r=!0,e[t]=n)})),r}function o(){$(t,(function(t){var n=e.get(t);if(n){var r=function(e){H(e)&&(e=e.split(" "));var t=Le();return $(e,(function(e){e.length&&(t[e]=!0)})),t}(t.attr("class")),i="",o="";$(n,(function(e,t){e!==!!r[t]&&(e?i+=(i.length?" ":"")+t:o+=(o.length?" ":"")+t)})),$(t,(function(e){i&&$t(e,i),o&&xt(e,o)})),e.delete(t)}})),t.length=0}}]},an=["$provide",function(e){var t=this,n=null,r=null;this.$$registeredAnimations=Object.create(null),this.register=function(n,r){if(n&&"."!==n.charAt(0))throw Qt("notcsel","Expecting class selector starting with '.' got '{0}'.",n);var i=n+"-animation";t.$$registeredAnimations[n.substr(1)]=i,e.factory(i,r)},this.customFilter=function(e){return 1===arguments.length&&(r=q(e)?e:null),r},this.classNameFilter=function(e){if(1===arguments.length&&(n=e instanceof RegExp?e:null)){var t=new RegExp("[(\\s|\\/)]ng-animate[(\\s|\\/)]");if(t.test(n.toString()))throw n=null,Qt("nongcls",'$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.',"ng-animate")}return n},this.$get=["$$animateQueue",function(e){function t(e,t,n){if(n){var r=function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.nodeType===en)return n}}(n);!r||r.parentNode||r.previousElementSibling||(n=null)}n?n.after(e):t.prepend(e)}return{on:e.on,off:e.off,pin:e.pin,enabled:e.enabled,cancel:function(e){e.cancel&&e.cancel()},enter:function(n,r,i,o){return r=r&&a(r),i=i&&a(i),t(n,r=r||i.parent(),i),e.push(n,"enter",nn(o))},move:function(n,r,i,o){return r=r&&a(r),i=i&&a(i),t(n,r=r||i.parent(),i),e.push(n,"move",nn(o))},leave:function(t,n){return e.push(t,"leave",nn(n),(function(){t.remove()}))},addClass:function(t,n,r){return(r=nn(r)).addClass=tn(r.addclass,n),e.push(t,"addClass",r)},removeClass:function(t,n,r){return(r=nn(r)).removeClass=tn(r.removeClass,n),e.push(t,"removeClass",r)},setClass:function(t,n,r,i){return(i=nn(i)).addClass=tn(i.addClass,n),i.removeClass=tn(i.removeClass,r),e.push(t,"setClass",i)},animate:function(t,n,r,i,o){return(o=nn(o)).from=o.from?I(o.from,n):n,o.to=o.to?I(o.to,r):r,i=i||"ng-inline-animate",o.tempClasses=tn(o.tempClasses,i),e.push(t,"animate",o)}}}]}],sn=function(){this.$get=["$$rAF",function(e){var t=[];function n(n){t.push(n),t.length>1||e((function(){for(var e=0;e<t.length;e++)t[e]();t=[]}))}return function(){var e=!1;return n((function(){e=!0})),function(t){e?t():n(t)}}}]},cn=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout",function(e,t,n,r,i){function o(e){this.setHost(e);var t=n();this._doneCallbacks=[],this._tick=function(e){r()?function(e){i(e,0,!1)}(e):t(e)},this._state=0}return o.chain=function(e,t){var n=0;!function r(){if(n===e.length)return void t(!0);e[n]((function(e){!1!==e?(n++,r()):t(!1)}))}()},o.all=function(e,t){var n=0,r=!0;function i(i){r=r&&i,++n===e.length&&t(r)}$(e,(function(e){e.done(i)}))},o.prototype={setHost:function(e){this.host=e||{}},done:function(e){2===this._state?e():this._doneCallbacks.push(e)},progress:P,getPromise:function(){if(!this.promise){var t=this;this.promise=e((function(e,n){t.done((function(t){!1===t?n():e()}))}))}return this.promise},then:function(e,t){return this.getPromise().then(e,t)},catch:function(e){return this.getPromise().catch(e)},finally:function(e){return this.getPromise().finally(e)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end(),this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel(),this._resolve(!1)},complete:function(e){var t=this;0===t._state&&(t._state=1,t._tick((function(){t._resolve(e)})))},_resolve:function(e){2!==this._state&&($(this._doneCallbacks,(function(t){t(e)})),this._doneCallbacks.length=0,this._state=2)}},o}]},un=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(e,t,n){return function(t,r){var i=r||{};i.$$prepared||(i=ae(i)),i.cleanupStyles&&(i.from=i.to=null),i.from&&(t.css(i.from),i.from=null);var o,a=new n;return{start:s,end:s};function s(){return e((function(){!function(){i.addClass&&(t.addClass(i.addClass),i.addClass=null);i.removeClass&&(t.removeClass(i.removeClass),i.removeClass=null);i.to&&(t.css(i.to),i.to=null)}(),o||a.complete(),o=!0})),a}}}]};function ln(e,t,n,r,i){var o=this,s=e.location,c=e.history,u=e.setTimeout,l=e.clearTimeout,f={},d=i(n);o.isMock=!1,o.$$completeOutstandingRequest=d.completeTask,o.$$incOutstandingRequestCount=d.incTaskCount,o.notifyWhenNoOutstandingRequests=d.notifyWhenNoPendingTasks;var p,h,v=s.href,m=t.find("base"),y=null,g=r.history?function(){try{return c.state}catch(e){}}:P;_(),o.url=function(t,n,i){if(N(i)&&(i=null),s!==e.location&&(s=e.location),c!==e.history&&(c=e.history),t){var a=h===i;if(t=di(t).href,v===t&&(!r.history||a))return o;var u=v&&ur(v)===ur(t);return v=t,h=i,!r.history||u&&a?(u||(y=t),n?s.replace(t):u?s.hash=function(e){var t=e.indexOf("#");return-1===t?"":e.substr(t)}(t):s.href=t,s.href!==t&&(y=t)):(c[n?"replaceState":"pushState"](i,"",t),_()),y&&(y=t),o}return function(e){return e.replace(/#$/,"")}(y||s.href)},o.state=function(){return p};var b=[],w=!1;function k(){y=null,S()}var x=null;function _(){ce(p=N(p=g())?null:p,x)&&(p=x),x=p,h=p}function S(){var e=h;_(),v===o.url()&&e===p||(v=o.url(),h=p,$(b,(function(e){e(o.url(),p)})))}o.onUrlChange=function(t){return w||(r.history&&a(e).on("popstate",k),a(e).on("hashchange",k),w=!0),b.push(t),t},o.$$applicationDestroyed=function(){a(e).off("hashchange popstate",k)},o.$$checkUrlChange=S,o.baseHref=function(){var e=m.attr("href");return e?e.replace(/^(https?:)?\/\/[^/]*/,""):""},o.defer=function(e,t,n){var r;return t=t||0,n=n||d.DEFAULT_TASK_TYPE,d.incTaskCount(n),r=u((function(){delete f[r],d.completeTask(e,n)}),t),f[r]=n,r},o.defer.cancel=function(e){if(f.hasOwnProperty(e)){var t=f[e];return delete f[e],l(e),d.completeTask(P,t),!0}return!1}}function fn(){this.$get=["$window","$log","$sniffer","$document","$$taskTrackerFactory",function(e,t,n,r,i){return new ln(e,r,t,n,i)}]}function dn(){this.$get=function(){var e={};function t(t,n){if(t in e)throw i("$cacheFactory")("iid","CacheId '{0}' is already taken!",t);var r=0,o=I({},n,{id:t}),a=Le(),s=n&&n.capacity||Number.MAX_VALUE,c=Le(),u=null,l=null;return e[t]={put:function(e,t){if(!N(t)){if(s<Number.MAX_VALUE)f(c[e]||(c[e]={key:e}));return e in a||r++,a[e]=t,r>s&&this.remove(l.key),t}},get:function(e){if(s<Number.MAX_VALUE){var t=c[e];if(!t)return;f(t)}return a[e]},remove:function(e){if(s<Number.MAX_VALUE){var t=c[e];if(!t)return;t===u&&(u=t.p),t===l&&(l=t.n),d(t.n,t.p),delete c[e]}e in a&&(delete a[e],r--)},removeAll:function(){a=Le(),r=0,c=Le(),u=l=null},destroy:function(){a=null,o=null,c=null,delete e[t]},info:function(){return I({},o,{size:r})}};function f(e){e!==u&&(l?l===e&&(l=e.n):l=e,d(e.n,e.p),d(e,u),(u=e).n=null)}function d(e,t){e!==t&&(e&&(e.p=t),t&&(t.n=e))}}return t.info=function(){var t={};return $(e,(function(e,n){t[n]=e.info()})),t},t.get=function(t){return e[t]},t}}function pn(){this.$get=["$cacheFactory",function(e){return e("templates")}]}var hn=i("$compile");var vn=new function(){};function mn(t,n){var r={},i="Directive",s=/^\s*directive:\s*([\w-]+)\s+(.*)$/,c=/(([\w-]+)(?::([^;]+))?;?)/,u=function(e){var t,n={},r=e.split(",");for(t=0;t<r.length;t++)n[r[t]]=!0;return n}("ngSrc,ngSrcset,src,srcset"),l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,p=/^(on[a-z]+|formaction)$/,h=Le();function v(e,t,n){var r=/^([@&]|[=<](\*?))(\??)\s*([\w$]*)$/,i=Le();return $(e,(function(e,o){if((e=e.trim())in h)i[o]=h[e];else{var a=e.match(r);if(!a)throw hn("iscp","Invalid {3} for directive '{0}'. Definition: {... {1}: '{2}' ...}",t,o,e,n?"controller bindings definition":"isolate scope definition");i[o]={mode:a[1][0],collection:"*"===a[2],optional:"?"===a[3],attrName:a[4]||o},a[4]&&(h[e]=i[o])}})),i}function m(e,t){var n={isolateScope:null,bindToController:null};if(U(e.scope)&&(!0===e.bindToController?(n.bindToController=v(e.scope,t,!0),n.isolateScope={}):n.isolateScope=v(e.scope,t,!1)),U(e.bindToController)&&(n.bindToController=v(e.bindToController,t,!0)),n.bindToController&&!e.controller)throw hn("noctrl","Cannot bind to controller without directive '{0}'s controller.",t);return n}this.directive=function e(n,o){return Te(n,"name"),Fe(n,"directive"),H(n)?(!function(e){var t=e.charAt(0);if(!t||t!==d(t))throw hn("baddir","Directive/Component name '{0}' is invalid. The first character must be a lowercase letter",e);if(e!==e.trim())throw hn("baddir","Directive/Component name '{0}' is invalid. The name should not contain leading or trailing whitespaces",e)}(n),Te(o,"directiveFactory"),r.hasOwnProperty(n)||(r[n]=[],t.factory(n+i,["$injector","$exceptionHandler",function(e,t){var i=[];return $(r[n],(function(r,o){try{var a=e.invoke(r);q(a)?a={compile:j(a)}:!a.compile&&a.link&&(a.compile=j(a.link)),a.priority=a.priority||0,a.index=o,a.name=a.name||n,a.require=function(e){var t=e.require||e.controller&&e.name;return!W(t)&&U(t)&&$(t,(function(e,n){var r=e.match(l);e.substring(r[0].length)||(t[n]=r[0]+n)})),t}(a),a.restrict=function(e,t){if(e&&(!H(e)||!/[EACM]/.test(e)))throw hn("badrestrict","Restrict property '{0}' of directive '{1}' is invalid",e,t);return e||"EA"}(a.restrict,n),a.$$moduleName=r.$$moduleName,i.push(a)}catch(e){t(e)}})),i}])),r[n].push(o)):$(n,S(e)),this},this.component=function e(t,n){if(!H(t))return $(t,S(pe(this,e))),this;var r=n.controller||function(){};function i(e){function t(t){return q(t)||W(t)?function(n,r){return e.invoke(t,this,{$element:n,$attrs:r})}:t}var i=n.template||n.templateUrl?n.template:"",o={controller:r,controllerAs:Sn(n.controller)||n.controllerAs||"$ctrl",template:t(i),templateUrl:t(n.templateUrl),transclude:n.transclude,scope:{},bindToController:n.bindings||{},restrict:"E",require:n.require};return $(n,(function(e,t){"$"===t.charAt(0)&&(o[t]=e)})),o}return $(n,(function(e,t){"$"===t.charAt(0)&&(i[t]=e,q(r)&&(r[t]=e))})),i.$inject=["$injector"],this.directive(t,i)},this.aHrefSanitizationWhitelist=function(e){return L(e)?(n.aHrefSanitizationWhitelist(e),this):n.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(e){return L(e)?(n.imgSrcSanitizationWhitelist(e),this):n.imgSrcSanitizationWhitelist()};var g=!0;this.debugInfoEnabled=function(e){return L(e)?(g=e,this):g};var b=!1;this.strictComponentBindingsEnabled=function(e){return L(e)?(b=e,this):b};var w=10;this.onChangesTtl=function(e){return arguments.length?(w=e,this):w};var k=!0;this.commentDirectivesEnabled=function(e){return arguments.length?(k=e,this):k};var x=!0;this.cssClassDirectivesEnabled=function(e){return arguments.length?(x=e,this):x};var _=Le();this.addPropertySecurityContext=function(e,t,n){var r=e.toLowerCase()+"|"+t.toLowerCase();if(r in _&&_[r]!==n)throw hn("ctxoverride","Property context '{0}.{1}' already set to '{2}', cannot override to '{3}'.",e,t,_[r],n);return _[r]=n,this},function(){function e(e,t){$(t,(function(t){_[t.toLowerCase()]=e}))}e(Jr.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),e(Jr.CSS,["*|style"]),e(Jr.URL,["area|href","area|ping","a|href","a|ping","blockquote|cite","body|background","del|cite","input|src","ins|cite","q|cite"]),e(Jr.MEDIA_URL,["audio|src","img|src","img|srcset","source|src","source|srcset","track|src","video|src","video|poster"]),e(Jr.RESOURCE_URL,["*|formAction","applet|code","applet|codebase","base|href","embed|src","frame|src","form|action","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])}(),this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate",function(t,n,h,v,S,M,C,A,E){var O,D=/^\w/,j=e.document.createElement("div"),F=k,L=x,B=w;function z(){try{if(!--B)throw O=void 0,hn("infchng","{0} $onChanges() iterations reached. Aborting!\n",w);C.$apply((function(){for(var e=0,t=O.length;e<t;++e)try{O[e]()}catch(e){h(e)}O=void 0}))}finally{B++}}function V(e,t){if(!e)return e;if(!H(e))throw hn("srcset",'Can\'t pass trusted values to `{0}`: "{1}"',t,e.toString());for(var n="",r=ee(e),i=/\s/.test(r)?/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/:/(,)/,o=r.split(i),a=Math.floor(o.length/2),s=0;s<a;s++){var c=2*s;n+=A.getTrustedMediaUrl(ee(o[c])),n+=" "+ee(o[c+1])}var u=ee(o[2*s]).split(/\s/);return n+=A.getTrustedMediaUrl(ee(u[0])),2===u.length&&(n+=" "+ee(u[1])),n}function J(e,t){if(t){var n,r,i,o=Object.keys(t);for(n=0,r=o.length;n<r;n++)this[i=o[n]]=t[i]}else this.$attr={};this.$$element=e}function G(e,t){try{e.addClass(t)}catch(e){}}J.prototype={$normalize:wn,$addClass:function(e){e&&e.length>0&&E.addClass(this.$$element,e)},$removeClass:function(e){e&&e.length>0&&E.removeClass(this.$$element,e)},$updateClass:function(e,t){var n=kn(e,t);n&&n.length&&E.addClass(this.$$element,n);var r=kn(t,e);r&&r.length&&E.removeClass(this.$$element,r)},$set:function(e,t,n,r){var i=Pt(this.$$element[0],e),o=Rt[e],a=e;i?(this.$$element.prop(e,t),r=i):o&&(this[o]=t,a=o),this[e]=t,r?this.$attr[e]=r:(r=this.$attr[e])||(this.$attr[e]=r=Re(e,"-")),"img"===re(this.$$element)&&"srcset"===e&&(this[e]=t=V(t,"$set('srcset', value)")),!1!==n&&(null===t||N(t)?this.$$element.removeAttr(r):D.test(r)?i&&!1===t?this.$$element.removeAttr(r):this.$$element.attr(r,t):function(e,t,n){j.innerHTML="<span "+t+">";var r=j.firstChild.attributes,i=r[0];r.removeNamedItem(i.name),i.value=n,e.attributes.setNamedItem(i)}(this.$$element[0],r,t));var s=this.$$observers;s&&$(s[a],(function(e){try{e(t)}catch(e){h(e)}}))},$observe:function(e,t){var n=this,r=n.$$observers||(n.$$observers=Le()),i=r[e]||(r[e]=[]);return i.push(t),C.$evalAsync((function(){i.$$inter||!n.hasOwnProperty(e)||N(n[e])||t(n[e])})),function(){oe(i,t)}}};var X=n.startSymbol(),Q=n.endSymbol(),te="{{"===X&&"}}"===Q?T:function(e){return e.replace(/\{\{/g,X).replace(/}}/g,Q)},ne=/^ng(Attr|Prop|On)([A-Z].*)$/,ie=/^(.+)Start$/;return ae.$$addBindingInfo=g?function(e,t){var n=e.data("$binding")||[];W(t)?n=n.concat(t):n.push(t),e.data("$binding",n)}:P,ae.$$addBindingClass=g?function(e){G(e,"ng-binding")}:P,ae.$$addScopeInfo=g?function(e,t,n,r){var i=n?r?"$isolateScopeNoTemplate":"$isolateScope":"$scope";e.data(i,t)}:P,ae.$$addScopeClass=g?function(e,t){G(e,t?"ng-isolate-scope":"ng-scope")}:P,ae.$$createComment=function(t,n){var r="";return g&&(r=" "+(t||"")+": ",n&&(r+=n+" ")),e.document.createComment(r)},ae;function ae(e,t,n,r,i){e instanceof a||(e=a(e));var o=ue(e,t,e,n,r,i);ae.$$addScopeClass(e);var s=null;return function(t,n,r){if(!e)throw hn("multilink","This element has already been linked.");Te(t,"scope"),i&&i.needsNewScope&&(t=t.$parent.$new());var c,u,l,f=(r=r||{}).parentBoundTranscludeFn,d=r.transcludeControllers,p=r.futureParentElement;if(f&&f.$$boundTransclude&&(f=f.$$boundTransclude),s||(u=(c=p)&&c[0],s=u&&"foreignobject"!==re(u)&&y.call(u).match(/SVG/)?"svg":"html"),l="html"!==s?a(Ae(s,a("<div></div>").append(e).html())):n?Et.clone.call(e):e,d)for(var h in d)l.data("$"+h+"Controller",d[h].instance);return ae.$$addScopeInfo(l,t),n&&n(l,t),o&&o(t,l,l,f),n||(e=o=null),l}}function ue(e,t,n,r,i,s){for(var c,u,l,f,d,p,h,v=[],m=W(e)||e instanceof a,y=0;y<e.length;y++)c=new J,11===o&&le(e,y,m),(l=(u=he(e[y],[],c,0===y?r:void 0,i)).length?ge(u,e[y],c,t,n,null,[],[],s):null)&&l.scope&&ae.$$addScopeClass(c.$$element),d=l&&l.terminal||!(f=e[y].childNodes)||!f.length?null:ue(f,l?(l.transcludeOnThisElement||!l.templateOnThisElement)&&l.transclude:t),(l||d)&&(v.push(y,l,d),p=!0,h=h||l),s=null;return p?function(e,n,r,i){var o,s,c,u,l,f,d,p,m;if(h){var y=n.length;for(m=new Array(y),l=0;l<v.length;l+=3)d=v[l],m[d]=n[d]}else m=n;for(l=0,f=v.length;l<f;)c=m[v[l++]],o=v[l++],s=v[l++],o?(o.scope?(u=e.$new(),ae.$$addScopeInfo(a(c),u)):u=e,p=o.transcludeOnThisElement?fe(e,o.transclude,i):!o.templateOnThisElement&&i?i:!i&&t?fe(e,t):null,o(s,u,c,r,p)):s&&s(e,c.childNodes,void 0,i)}:null}function le(e,t,n){var r,i=e[t],o=i.parentNode;if(i.nodeType===He)for(;(r=o?i.nextSibling:e[t+1])&&r.nodeType===He;)i.nodeValue=i.nodeValue+r.nodeValue,r.parentNode&&r.parentNode.removeChild(r),n&&r===e[t+1]&&e.splice(t+1,1)}function fe(e,t,n){function r(r,i,o,a,s){return r||((r=e.$new(!1,s)).$$transcluded=!0),t(r,i,{parentBoundTranscludeFn:n,transcludeControllers:o,futureParentElement:a})}var i=r.$$slots=Le();for(var o in t.$$slots)t.$$slots[o]?i[o]=fe(e,t.$$slots[o],n):i[o]=null;return r}function he(e,t,r,i,o){var a,u,l,f=e.nodeType,d=r.$attr;switch(f){case Be:xe(t,wn(u=re(e)),"E",i,o);for(var p,h,v,m,y,g=e.attributes,b=0,w=g&&g.length;b<w;b++){var k,x=!1,$=!1,_=!1,S=!1,M=!1;h=(p=g[b]).name,m=p.value,(y=(v=wn(h.toLowerCase())).match(ne))?(_="Attr"===y[1],S="Prop"===y[1],M="On"===y[1],h=h.replace(gn,"").toLowerCase().substr(4+y[1].length).replace(/_(.)/g,(function(e,t){return t.toUpperCase()}))):(k=v.match(ie))&&$e(k[1])&&(x=h,$=h.substr(0,h.length-5)+"end",h=h.substr(0,h.length-6)),S||M?(r[v]=m,d[v]=p.name,S?Ee(e,t,v,h):Oe(t,v,h)):(d[v=wn(h.toLowerCase())]=h,!_&&r.hasOwnProperty(v)||(r[v]=m,Pt(e,v)&&(r[v]=!0)),De(e,t,m,v,_),xe(t,v,"A",i,o,x,$))}if("input"===u&&"hidden"===e.getAttribute("type")&&e.setAttribute("autocomplete","off"),!L)break;if(U(l=e.className)&&(l=l.animVal),H(l)&&""!==l)for(;a=c.exec(l);)xe(t,v=wn(a[2]),"C",i,o)&&(r[v]=ee(a[3])),l=l.substr(a.index+a[0].length);break;case He:!function(e,t){var r=n(t,!0);r&&e.push({priority:0,compile:function(e){var t=e.parent(),n=!!t.length;return n&&ae.$$addBindingClass(t),function(e,t){var i=t.parent();n||ae.$$addBindingClass(i),ae.$$addBindingInfo(i,r.expressions),e.$watch(r,(function(e){t[0].nodeValue=e}))}}})}(t,e.nodeValue);break;case ze:if(!F)break;!function(e,t,n,r,i){try{var o=s.exec(e.nodeValue);if(o){var a=wn(o[1]);xe(t,a,"M",r,i)&&(n[a]=ee(o[2]))}}catch(e){}}(e,t,r,i,o)}return t.sort(Me),t}function ve(e,t,n){var r=[],i=0;if(t&&e.hasAttribute&&e.hasAttribute(t))do{if(!e)throw hn("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",t,n);e.nodeType===Be&&(e.hasAttribute(t)&&i++,e.hasAttribute(n)&&i--),r.push(e),e=e.nextSibling}while(i>0);else r.push(e);return a(r)}function me(e,t,n){return function(r,i,o,a,s){return i=ve(i[0],t,n),e(r,i,o,a,s)}}function ye(e,t,n,r,i,o){var a;return e?ae(t,n,r,i,o):function(){return a||(a=ae(t,n,r,i,o),t=n=o=null),a.apply(this,arguments)}}function ge(t,n,r,i,o,s,c,u,l){l=l||{};for(var f,d,p,v,m,y=-Number.MAX_VALUE,g=l.newScopeDirective,b=l.controllerDirectives,w=l.newIsolateScopeDirective,k=l.templateDirective,x=l.nonTlbTranscludeDirective,_=!1,S=!1,C=l.hasElementTranscludeDirective,A=r.$$element=a(n),E=s,O=i,D=!1,R=!1,P=0,T=t.length;P<T;P++){var j=(f=t[P]).$$start,F=f.$$end;if(j&&(A=ve(n,j,F)),p=void 0,y>f.priority)break;if((m=f.scope)&&(f.templateUrl||(U(m)?(Ce("new/isolated scope",w||g,f,A),w=f):Ce("new/isolated scope",w,f,A)),g=g||f),d=f.name,!D&&(f.replace&&(f.templateUrl||f.template)||f.transclude&&!f.$$tlb)){for(var L,B=P+1;L=t[B++];)if(L.transclude&&!L.$$tlb||L.replace&&(L.templateUrl||L.template)){R=!0;break}D=!0}if(!f.templateUrl&&f.controller&&(b=b||Le(),Ce("'"+d+"' controller",b[d],f,A),b[d]=f),m=f.transclude)if(_=!0,f.$$tlb||(Ce("transclusion",x,f,A),x=f),"element"===m)C=!0,y=f.priority,p=A,A=r.$$element=a(ae.$$createComment(d,r[d])),n=A[0],Pe(o,de(p),n),O=ye(R,p,i,y,E&&E.name,{nonTlbTranscludeDirective:x});else{var H=Le();if(U(m)){p=e.document.createDocumentFragment();var z=Le(),V=Le();for(var K in $(m,(function(e,t){var n="?"===e.charAt(0);e=n?e.substring(1):e,z[e]=t,H[t]=null,V[t]=n})),$(A.contents(),(function(t){var n=z[wn(re(t))];n?(V[n]=!0,H[n]=H[n]||e.document.createDocumentFragment(),H[n].appendChild(t)):p.appendChild(t)})),$(V,(function(e,t){if(!e)throw hn("reqslot","Required transclusion slot `{0}` was not filled.",t)})),H)if(H[K]){var G=a(H[K].childNodes);H[K]=ye(R,G,i)}p=a(p.childNodes)}else p=a(pt(n)).contents();A.empty(),(O=ye(R,p,i,void 0,void 0,{needsNewScope:f.$$isolateScope||f.$$newScope})).$$slots=H}if(f.template)if(S=!0,Ce("template",k,f,A),k=f,m=q(f.template)?f.template(A,r):f.template,m=te(m),f.replace){if(E=f,p=ct(m)?[]:xn(Ae(f.templateNamespace,ee(m))),n=p[0],1!==p.length||n.nodeType!==Be)throw hn("tplrt","Template for directive '{0}' must have exactly one root element. {1}",d,"");Pe(o,A,n);var Z={$attr:{}},X=he(n,[],Z),Q=t.splice(P+1,t.length-(P+1));(w||g)&&we(X,w,g),t=t.concat(X).concat(Q),_e(r,Z),T=t.length}else A.html(m);if(f.templateUrl)S=!0,Ce("template",k,f,A),k=f,f.replace&&(E=f),oe=Se(t.splice(P,t.length-P),A,r,o,_&&O,c,u,{controllerDirectives:b,newScopeDirective:g!==f&&g,newIsolateScopeDirective:w,templateDirective:k,nonTlbTranscludeDirective:x}),T=t.length;else if(f.compile)try{v=f.compile(A,r,O);var ne=f.$$originalDirective||f;q(v)?ie(null,pe(ne,v),j,F):v&&ie(pe(ne,v.pre),pe(ne,v.post),j,F)}catch(e){h(e,ke(A))}f.terminal&&(oe.terminal=!0,y=Math.max(y,f.priority))}return oe.scope=g&&!0===g.scope,oe.transcludeOnThisElement=_,oe.templateOnThisElement=S,oe.transclude=O,l.hasElementTranscludeDirective=C,oe;function ie(e,t,n,r){e&&(n&&(e=me(e,n,r)),e.require=f.require,e.directiveName=d,(w===f||f.$$isolateScope)&&(e=je(e,{isolateScope:!0})),c.push(e)),t&&(n&&(t=me(t,n,r)),t.require=f.require,t.directiveName=d,(w===f||f.$$isolateScope)&&(t=je(t,{isolateScope:!0})),u.push(t))}function oe(e,t,i,o,s){var l,f,d,p,v,m,y,x,_,S;for(var A in n===i?(_=r,x=r.$$element):_=new J(x=a(i),r),v=t,w?p=t.$new(!0):g&&(v=t.$parent),s&&((y=function(e,t,n,r){var i;Y(e)||(r=n,n=t,t=e,e=void 0);C&&(i=m);n||(n=C?x.parent():x);if(!r)return s(e,t,i,n,R);var o=s.$$slots[r];if(o)return o(e,t,i,n,R);if(N(o))throw hn("noslot",'No parent directive that requires a transclusion with slot name "{0}". Element: {1}',r,ke(x))}).$$boundTransclude=s,y.isSlotFilled=function(e){return!!s.$$slots[e]}),b&&(m=function(e,t,n,r,i,o,a){var s=Le();for(var c in r){var u=r[c],l={$scope:u===a||u.$$isolateScope?i:o,$element:e,$attrs:t,$transclude:n},f=u.controller;"@"===f&&(f=t[u.name]);var d=M(f,l,!0,u.controllerAs);s[u.name]=d,e.data("$"+u.name+"Controller",d.instance)}return s}(x,_,y,b,p,t,w)),w&&(ae.$$addScopeInfo(x,p,!0,!(k&&(k===w||k===w.$$originalDirective))),ae.$$addScopeClass(x,!0),p.$$isolateBindings=w.$$isolateBindings,(S=Ue(t,_,p,p.$$isolateBindings,w)).removeWatches&&p.$on("$destroy",S.removeWatches)),m){var E=b[A],O=m[A],D=E.$$bindings.bindToController;O.instance=O(),x.data("$"+E.name+"Controller",O.instance),O.bindingInfo=Ue(v,_,O.instance,D,E)}for($(b,(function(e,t){var n=e.require;e.bindToController&&!W(n)&&U(n)&&I(m[t].instance,be(t,n,x,m))})),$(m,(function(e){var t=e.instance;if(q(t.$onChanges))try{t.$onChanges(e.bindingInfo.initialChanges)}catch(e){h(e)}if(q(t.$onInit))try{t.$onInit()}catch(e){h(e)}q(t.$doCheck)&&(v.$watch((function(){t.$doCheck()})),t.$doCheck()),q(t.$onDestroy)&&v.$on("$destroy",(function(){t.$onDestroy()}))})),l=0,f=c.length;l<f;l++)Fe(d=c[l],d.isolateScope?p:t,x,_,d.require&&be(d.directiveName,d.require,x,m),y);var R=t;for(w&&(w.template||null===w.templateUrl)&&(R=p),e&&e(R,i.childNodes,void 0,s),l=u.length-1;l>=0;l--)Fe(d=u[l],d.isolateScope?p:t,x,_,d.require&&be(d.directiveName,d.require,x,m),y);$(m,(function(e){var t=e.instance;q(t.$postLink)&&t.$postLink()}))}}function be(e,t,n,r){var i;if(H(t)){var o=t.match(l),a=t.substring(o[0].length),s=o[1]||o[3],c="?"===o[2];if("^^"===s?n=n.parent():i=(i=r&&r[a])&&i.instance,!i){var u="$"+a+"Controller";i="^^"===s&&n[0]&&n[0].nodeType===Ve?null:s?n.inheritedData(u):n.data(u)}if(!i&&!c)throw hn("ctreq","Controller '{0}', required by directive '{1}', can't be found!",a,e)}else if(W(t)){i=[];for(var f=0,d=t.length;f<d;f++)i[f]=be(e,t[f],n,r)}else U(t)&&(i={},$(t,(function(t,o){i[o]=be(e,t,n,r)})));return i||null}function we(e,t,n){for(var r=0,i=e.length;r<i;r++)e[r]=R(e[r],{$$isolateScope:t,$$newScope:n})}function xe(e,n,o,a,s,c,u){if(n===s)return null;var l=null;if(r.hasOwnProperty(n))for(var f,d=t.get(n+i),p=0,h=d.length;p<h;p++)if(f=d[p],(N(a)||a>f.priority)&&-1!==f.restrict.indexOf(o)){if(c&&(f=R(f,{$$start:c,$$end:u})),!f.$$bindings){var v=f.$$bindings=m(f,f.name);U(v.isolateScope)&&(f.$$isolateBindings=v.isolateScope)}e.push(f),l=f}return l}function $e(e){if(r.hasOwnProperty(e))for(var n=t.get(e+i),o=0,a=n.length;o<a;o++)if(n[o].multiElement)return!0;return!1}function _e(e,t){var n=t.$attr,r=e.$attr;$(e,(function(r,i){"$"!==i.charAt(0)&&(t[i]&&t[i]!==r&&(r.length?r+=("style"===i?";":" ")+t[i]:r=t[i]),e.$set(i,r,!0,n[i]))})),$(t,(function(t,i){e.hasOwnProperty(i)||"$"===i.charAt(0)||(e[i]=t,"class"!==i&&"style"!==i&&(r[i]=n[i]))}))}function Se(e,t,n,r,i,o,s,c){var u,l,f=[],d=t[0],p=e.shift(),m=R(p,{templateUrl:null,transclude:null,replace:null,$$originalDirective:p}),y=q(p.templateUrl)?p.templateUrl(t,n):p.templateUrl,g=p.templateNamespace;return t.empty(),v(y).then((function(h){var v,b,w,k;if(h=te(h),p.replace){if(w=ct(h)?[]:xn(Ae(g,ee(h))),v=w[0],1!==w.length||v.nodeType!==Be)throw hn("tplrt","Template for directive '{0}' must have exactly one root element. {1}",p.name,y);b={$attr:{}},Pe(r,t,v);var x=he(v,[],b);U(p.scope)&&we(x,!0),e=x.concat(e),_e(n,b)}else v=d,t.html(h);for(e.unshift(m),u=ge(e,v,n,i,t,p,o,s,c),$(r,(function(e,n){e===v&&(r[n]=t[0])})),l=ue(t[0].childNodes,i);f.length;){var _=f.shift(),S=f.shift(),M=f.shift(),C=f.shift(),A=t[0];if(!_.$$destroyed){if(S!==d){var I=S.className;c.hasElementTranscludeDirective&&p.replace||(A=pt(v)),Pe(M,a(S),A),G(a(A),I)}k=u.transcludeOnThisElement?fe(_,u.transclude,C):C,u(l,_,A,r,k)}}f=null})).catch((function(e){K(e)&&h(e)})),function(e,t,n,r,i){var o=i;t.$$destroyed||(f?f.push(t,n,r,o):(u.transcludeOnThisElement&&(o=fe(t,u.transclude,i)),u(l,t,n,r,o)))}}function Me(e,t){var n=t.priority-e.priority;return 0!==n?n:e.name!==t.name?e.name<t.name?-1:1:e.index-t.index}function Ce(e,t,n,r){function i(e){return e?" (module: "+e+")":""}if(t)throw hn("multidir","Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}",t.name,i(t.$$moduleName),n.name,i(n.$$moduleName),e,ke(r))}function Ae(t,n){switch(t=d(t||"html")){case"svg":case"math":var r=e.document.createElement("div");return r.innerHTML="<"+t+">"+n+"</"+t+">",r.childNodes[0].childNodes;default:return n}}function Ie(e){return V(A.valueOf(e),"ng-prop-srcset")}function Ee(e,t,n,r){if(p.test(r))throw hn("nodomevents","Property bindings for HTML DOM event properties are disallowed");var i=re(e),o=function(e,t){var n=t.toLowerCase();return _[e+"|"+n]||_["*|"+n]}(i,r),a=T;"srcset"!==r||"img"!==i&&"source"!==i?o&&(a=A.getTrusted.bind(A,o)):a=Ie,t.push({priority:100,compile:function(e,t){var i=S(t[n]),o=S(t[n],(function(e){return A.valueOf(e)}));return{pre:function(e,t){function n(){var n=i(e);t[0][r]=a(n)}n(),e.$watch(o,n)}}}})}function Oe(e,t,n){e.push(Bo(S,C,h,t,n,!1))}function De(e,t,r,i,o){var a=re(e),s=function(e,t){return"srcdoc"===t?A.HTML:"src"===t||"ngSrc"===t?-1===["img","video","audio","source","track"].indexOf(e)?A.RESOURCE_URL:A.MEDIA_URL:"xlinkHref"===t?"image"===e?A.MEDIA_URL:"a"===e?A.URL:A.RESOURCE_URL:"form"===e&&"action"===t||"base"===e&&"href"===t||"link"===e&&"href"===t?A.RESOURCE_URL:"a"!==e||"href"!==t&&"ngHref"!==t?void 0:A.URL}(a,i),c=!o,l=u[i]||o,f=n(r,c,s,l);if(f){if("multiple"===i&&"select"===a)throw hn("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",ke(e));if(p.test(i))throw hn("nodomevents","Interpolations for HTML DOM event attributes are disallowed");t.push({priority:100,compile:function(){return{pre:function(e,t,o){var a=o.$$observers||(o.$$observers=Le()),c=o[i];c!==r&&(f=c&&n(c,!0,s,l),r=c),f&&(o[i]=f(e),(a[i]||(a[i]=[])).$$inter=!0,(o.$$observers&&o.$$observers[i].$$scope||e).$watch(f,(function(e,t){"class"===i&&e!==t?o.$updateClass(e,t):o.$set(i,e)})))}}}})}}function Pe(t,n,r){var i,o,s=n[0],c=n.length,u=s.parentNode;if(t)for(i=0,o=t.length;i<o;i++)if(t[i]===s){t[i++]=r;for(var l=i,f=l+c-1,d=t.length;l<d;l++,f++)f<d?t[l]=t[f]:delete t[l];t.length-=c-1,t.context===s&&(t.context=r);break}u&&u.replaceChild(r,s);var p=e.document.createDocumentFragment();for(i=0;i<c;i++)p.appendChild(n[i]);for(a.hasData(s)&&(a.data(r,a.data(s)),a(s).off("$destroy")),a.cleanData(p.querySelectorAll("*")),i=1;i<c;i++)delete n[i];n[0]=r,n.length=1}function je(e,t){return I((function(){return e.apply(null,arguments)}),e,t)}function Fe(e,t,n,r,i,o){try{e(t,n,r,i,o)}catch(e){h(e,ke(n))}}function Ne(e,t){if(b)throw hn("missingattr","Attribute '{0}' of '{1}' is non-optional and must be set!",e,t)}function Ue(e,t,r,i,o){var a,s=[],c={};function u(t,n,i){q(r.$onChanges)&&!se(n,i)&&(O||(e.$$postDigest(z),O=[]),a||(a={},O.push(l)),a[t]&&(i=a[t].previousValue),a[t]=new yn(i,n))}function l(){r.$onChanges(a),a=void 0}return $(i,(function(i,a){var l,d,p,h,v,m=i.attrName,y=i.optional;switch(i.mode){case"@":y||f.call(t,m)||(Ne(m,o.name),r[a]=t[m]=void 0),v=t.$observe(m,(function(e){if(H(e)||Z(e)){var t=r[a];u(a,e,t),r[a]=e}})),t.$$observers[m].$$scope=e,H(l=t[m])?r[a]=n(l)(e):Z(l)&&(r[a]=l),c[a]=new yn(vn,r[a]),s.push(v);break;case"=":if(!f.call(t,m)){if(y)break;Ne(m,o.name),t[m]=void 0}if(y&&!t[m])break;d=S(t[m]),h=d.literal?ce:se,p=d.assign||function(){throw l=r[a]=d(e),hn("nonassign","Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!",t[m],m,o.name)},l=r[a]=d(e);var g=function(t){return h(t,r[a])||(h(t,l)?p(e,t=r[a]):r[a]=t),l=t};g.$stateful=!0,v=i.collection?e.$watchCollection(t[m],g):e.$watch(S(t[m],g),null,d.literal),s.push(v);break;case"<":if(!f.call(t,m)){if(y)break;Ne(m,o.name),t[m]=void 0}if(y&&!t[m])break;var b=(d=S(t[m])).literal,w=r[a]=d(e);c[a]=new yn(vn,r[a]),v=e[i.collection?"$watchCollection":"$watch"](d,(function(e,t){if(t===e){if(t===w||b&&ce(t,w))return;t=w}u(a,e,t),r[a]=e})),s.push(v);break;case"&":if(y||f.call(t,m)||Ne(m,o.name),(d=t.hasOwnProperty(m)?S(t[m]):P)===P&&y)break;r[a]=function(t){return d(e,t)}}})),{initialChanges:c,removeWatches:s.length&&function(){for(var e=0,t=s.length;e<t;++e)s[e]()}}}}]}function yn(e,t){this.previousValue=e,this.currentValue=t}mn.$inject=["$provide","$$sanitizeUriProvider"],yn.prototype.isFirstChange=function(){return this.previousValue===vn};var gn=/^((?:x|data)[:\-_])/i,bn=/[:\-_]+(.)/g;function wn(e){return e.replace(gn,"").replace(bn,(function(e,t,n){return n?t.toUpperCase():t}))}function kn(e,t){var n="",r=e.split(/\s+/),i=t.split(/\s+/);e:for(var o=0;o<r.length;o++){for(var a=r[o],s=0;s<i.length;s++)if(a===i[s])continue e;n+=(n.length>0?" ":"")+a}return n}function xn(e){var t=(e=a(e)).length;if(t<=1)return e;for(;t--;){var n=e[t];(n.nodeType===ze||n.nodeType===He&&""===n.nodeValue.trim())&&v.call(e,t,1)}return e}var $n=i("$controller"),_n=/^(\S+)(\s+as\s+([\w$]+))?$/;function Sn(e,t){if(t&&H(t))return t;if(H(e)){var n=_n.exec(e);if(n)return n[3]}}function Mn(){var e={};this.has=function(t){return e.hasOwnProperty(t)},this.register=function(t,n){Fe(t,"controller"),U(t)?I(e,t):e[t]=n},this.$get=["$injector",function(t){return function(r,i,o,a){var s,c,u,l;if(o=!0===o,a&&H(a)&&(l=a),H(r)){if(!(c=r.match(_n)))throw $n("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",r);if(u=c[1],l=l||c[3],!(r=e.hasOwnProperty(u)?e[u]:function(e,t,n){if(!t)return e;for(var r,i=t.split("."),o=e,a=i.length,s=0;s<a;s++)r=i[s],e&&(e=(o=e)[r]);return!n&&q(e)?pe(o,e):e}(i.$scope,u,!0)))throw $n("ctrlreg","The controller with the name '{0}' is not registered.",u);je(r,u,!0)}if(o){var f=(W(r)?r[r.length-1]:r).prototype;return s=Object.create(f||null),l&&n(i,l,s,u||r.name),I((function(){var e=t.invoke(r,s,i,u);return e!==s&&(U(e)||q(e))&&(s=e,l&&n(i,l,s,u||r.name)),s}),{instance:s,identifier:l})}return s=t.instantiate(r,i,u),l&&n(i,l,s,u||r.name),s};function n(e,t,n,r){if(!e||!U(e.$scope))throw i("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",r,t);e.$scope[t]=n}}]}function Cn(){this.$get=["$window",function(e){return a(e.document)}]}function An(){this.$get=["$document","$rootScope",function(e,t){var n=e[0],r=n&&n.hidden;function i(){r=n.hidden}return e.on("visibilitychange",i),t.$on("$destroy",(function(){e.off("visibilitychange",i)})),function(){return r}}]}function In(){this.$get=["$log",function(e){return function(t,n){e.error.apply(e,arguments)}}]}var En=function(){this.$get=["$document",function(e){return function(t){return t?!t.nodeType&&t instanceof a&&(t=t[0]):t=e[0].body,t.offsetWidth+1}}]},On="application/json",Dn={"Content-Type":On+";charset=utf-8"},Rn=/^\[|^\{(?!\{)/,Pn={"[":/]$/,"{":/}$/},Tn=/^\)]\}',?\n/,jn=i("$http");function Fn(e){return U(e)?V(e)?e.toISOString():ve(e):e}function Nn(){this.$get=function(){return function(e){if(!e)return"";var t=[];return _(e,(function(e,n){null===e||N(e)||q(e)||(W(e)?$(e,(function(e){t.push(Se(n)+"="+Se(Fn(e)))})):t.push(Se(n)+"="+Se(Fn(e))))})),t.join("&")}}}function Ln(){this.$get=function(){return function(e){if(!e)return"";var t=[];return function e(n,r,i){W(n)?$(n,(function(t,n){e(t,r+"["+(U(t)?n:"")+"]")})):U(n)&&!V(n)?_(n,(function(t,n){e(t,r+(i?"":"[")+n+(i?"":"]"))})):(q(n)&&(n=n()),t.push(Se(r)+"="+(null==n?"":Se(Fn(n)))))}(e,"",!0),t.join("&")}}}function Un(e,t){if(H(e)){var n=e.replace(Tn,"").trim();if(n){var r=t("Content-Type"),i=r&&0===r.indexOf(On);if(i||(a=(o=n).match(Rn))&&Pn[a[0]].test(o))try{e=me(n)}catch(t){if(!i)return e;throw jn("baddata",'Data must be a valid JSON object. Received: "{0}". Parse error: "{1}"',e,t)}}}var o,a;return e}function Bn(e){var t,n=Le();function r(e,t){e&&(n[e]=n[e]?n[e]+", "+t:t)}return H(e)?$(e.split("\n"),(function(e){t=e.indexOf(":"),r(d(ee(e.substr(0,t))),ee(e.substr(t+1)))})):U(e)&&$(e,(function(e,t){r(d(t),ee(e))})),n}function Hn(e){var t;return function(n){if(t||(t=Bn(e)),n){var r=t[d(n)];return void 0===r&&(r=null),r}return t}}function zn(e,t,n,r){return q(r)?r(e,t,n):($(r,(function(r){e=r(e,t,n)})),e)}function Vn(e){return 200<=e&&e<300}function Wn(){var e=this.defaults={transformResponse:[Un],transformRequest:[function(e){return!U(e)||(t=e,"[object File]"===y.call(t))||function(e){return"[object Blob]"===y.call(e)}(e)||function(e){return"[object FormData]"===y.call(e)}(e)?e:ve(e);var t}],headers:{common:{Accept:"application/json, text/plain, */*"},post:Ke(Dn),put:Ke(Dn),patch:Ke(Dn)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},t=!1;this.useApplyAsync=function(e){return L(e)?(t=!!e,this):t};var n=this.interceptors=[],r=this.xsrfWhitelistedOrigins=[];this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(o,a,s,c,u,l,f,h){var v=c("$http");e.paramSerializer=H(e.paramSerializer)?f.get(e.paramSerializer):e.paramSerializer;var m=[];$(n,(function(e){m.unshift(H(e)?f.get(e):f.invoke(e))}));var y,g=(y=[li].concat(r.map(di)),function(e){var t=di(e);return y.some(pi.bind(null,t))});function b(n){if(!U(n))throw i("$http")("badreq","Http request configuration must be an object. Received: {0}",n);if(!H(h.valueOf(n.url)))throw i("$http")("badreq","Http request configuration url must be a string or a $sce trusted object. Received: {0}",n.url);var r=I({method:"get",transformRequest:e.transformRequest,transformResponse:e.transformResponse,paramSerializer:e.paramSerializer,jsonpCallbackParam:e.jsonpCallbackParam},n);r.headers=function(t){var n,r,i,o=e.headers,a=I({},t.headers);o=I({},o.common,o[d(t.method)]);e:for(n in o){for(i in r=d(n),a)if(d(i)===r)continue e;a[n]=o[n]}return function(e,t){var n,r={};return $(e,(function(e,i){q(e)?null!=(n=e(t))&&(r[i]=n):r[i]=e})),r}(a,Ke(t))}(n),r.method=p(r.method),r.paramSerializer=H(r.paramSerializer)?f.get(r.paramSerializer):r.paramSerializer,o.$$incOutstandingRequestCount("$http");var c=[],y=[],w=l.resolve(r);return $(m,(function(e){(e.request||e.requestError)&&c.unshift(e.request,e.requestError),(e.response||e.responseError)&&y.push(e.response,e.responseError)})),w=k(w,c),w=(w=k(w=w.then((function(n){var r=n.headers,i=zn(n.data,Hn(r),void 0,n.transformRequest);N(i)&&$(r,(function(e,t){"content-type"===d(t)&&delete r[t]}));N(n.withCredentials)&&!N(e.withCredentials)&&(n.withCredentials=e.withCredentials);return function(n,r){var i,o,c=l.defer(),f=c.promise,p=n.headers,m="jsonp"===d(n.method),y=n.url;m?y=h.getTrustedResourceUrl(y):H(y)||(y=h.valueOf(y));y=function(e,t){t.length>0&&(e+=(-1===e.indexOf("?")?"?":"&")+t);return e}(y,n.paramSerializer(n.params)),m&&(y=function(e,t){var n=e.split("?");if(n.length>2)throw jn("badjsonp",'Illegal use more than one "?", in url, "{1}"',e);return $($e(n[1]),(function(n,r){if("JSON_CALLBACK"===n)throw jn("badjsonp",'Illegal use of JSON_CALLBACK in url, "{0}"',e);if(r===t)throw jn("badjsonp",'Illegal use of callback param, "{0}", in url, "{1}"',t,e)})),e+=(-1===e.indexOf("?")?"?":"&")+t+"=JSON_CALLBACK"}(y,n.jsonpCallbackParam));b.pendingRequests.push(n),f.then(S,S),!n.cache&&!e.cache||!1===n.cache||"GET"!==n.method&&"JSONP"!==n.method||(i=U(n.cache)?n.cache:U(e.cache)?e.cache:v);i&&(L(o=i.get(y))?X(o)?o.then(_,_):W(o)?x(o[1],o[0],Ke(o[2]),o[3],o[4]):x(o,200,{},"OK","complete"):i.put(y,f));if(N(o)){var w=g(n.url)?s()[n.xsrfCookieName||e.xsrfCookieName]:void 0;w&&(p[n.xsrfHeaderName||e.xsrfHeaderName]=w),a(n.method,y,r,(function(e,n,r,o,a){i&&(Vn(e)?i.put(y,[e,n,Bn(r),o,a]):i.remove(y));function s(){x(n,e,r,o,a)}t?u.$applyAsync(s):(s(),u.$$phase||u.$apply())}),p,n.timeout,n.withCredentials,n.responseType,k(n.eventHandlers),k(n.uploadEventHandlers))}return f;function k(e){if(e){var n={};return $(e,(function(e,r){n[r]=function(n){function r(){e(n)}t?u.$applyAsync(r):u.$$phase?r():u.$apply(r)}})),n}}function x(e,t,r,i,o){(Vn(t=t>=-1?t:0)?c.resolve:c.reject)({data:e,status:t,headers:Hn(r),config:n,statusText:i,xhrStatus:o})}function _(e){x(e.data,e.status,Ke(e.headers()),e.statusText,e.xhrStatus)}function S(){var e=b.pendingRequests.indexOf(n);-1!==e&&b.pendingRequests.splice(e,1)}}(n,i).then(x,x)})),y)).finally((function(){o.$$completeOutstandingRequest(P,"$http")}));function k(e,t){for(var n=0,r=t.length;n<r;){var i=t[n++],o=t[n++];e=e.then(i,o)}return t.length=0,e}function x(e){var t=I({},e);return t.data=zn(e.data,e.headers,e.status,r.transformResponse),Vn(e.status)?t:l.reject(t)}}return b.pendingRequests=[],function(e){$(arguments,(function(e){b[e]=function(t,n){return b(I({},n||{},{method:e,url:t}))}}))}("get","delete","head","jsonp"),function(e){$(arguments,(function(e){b[e]=function(t,n,r){return b(I({},r||{},{method:e,url:t,data:n}))}}))}("post","put","patch"),b.defaults=e,b}]}function Kn(){this.$get=function(){return function(){return new e.XMLHttpRequest}}}function qn(){this.$get=["$browser","$jsonpCallbacks","$document","$xhrFactory",function(e,t,n,r){return function(e,t,n,r,i){return function(o,a,s,c,u,l,f,p,h,v){if(a=a||e.url(),"jsonp"===d(o))var m=r.createCallback(a),y=function(e,t,n){e=e.replace("JSON_CALLBACK",t);var o=i.createElement("script"),a=null;return o.type="text/javascript",o.src=e,o.async=!0,a=function(e){o.removeEventListener("load",a),o.removeEventListener("error",a),i.body.removeChild(o),o=null;var s=-1,c="unknown";e&&("load"!==e.type||r.wasCalled(t)||(e={type:"error"}),c=e.type,s="error"===e.type?404:200),n&&n(s,c)},o.addEventListener("load",a),o.addEventListener("error",a),i.body.appendChild(o),a}(a,m,(function(e,t){var n=200===e&&r.getResponse(m);x(c,e,n,"",t,"complete"),r.removeCallback(m)}));else{var g=t(o,a),b=!1;g.open(o,a,!0),$(u,(function(e,t){L(e)&&g.setRequestHeader(t,e)})),g.onload=function(){var e=g.statusText||"",t="response"in g?g.response:g.responseText,n=1223===g.status?204:g.status;0===n&&(n=t?200:"file"===di(a).protocol?404:0),x(c,n,t,g.getAllResponseHeaders(),e,"complete")};if(g.onerror=function(){x(c,-1,null,null,"","error")},g.ontimeout=function(){x(c,-1,null,null,"","timeout")},g.onabort=function(){x(c,-1,null,null,"",b?"timeout":"abort")},$(h,(function(e,t){g.addEventListener(t,e)})),$(v,(function(e,t){g.upload.addEventListener(t,e)})),f&&(g.withCredentials=!0),p)try{g.responseType=p}catch(e){if("json"!==p)throw e}g.send(N(s)?null:s)}if(l>0)var w=n((function(){k("timeout")}),l);else X(l)&&l.then((function(){k(L(l.$$timeoutId)?"timeout":"abort")}));function k(e){b="timeout"===e,y&&y(),g&&g.abort()}function x(e,t,r,i,o,a){L(w)&&n.cancel(w),y=g=null,e(t,r,i,o,a)}}}(e,r,e.defer,t,n[0])}]}var Jn=w.$interpolateMinErr=i("$interpolate");function Gn(){var e="{{",t="}}";this.startSymbol=function(t){return t?(e=t,this):e},this.endSymbol=function(e){return e?(t=e,this):t},this.$get=["$parse","$exceptionHandler","$sce",function(n,r,i){var o=e.length,a=t.length,s=new RegExp(e.replace(/./g,u),"g"),c=new RegExp(t.replace(/./g,u),"g");function u(e){return"\\\\\\"+e}function l(n){return n.replace(s,e).replace(c,t)}function f(e,t,n,r){var i=e.$watch((function(e){return i(),r(e)}),t,n);return i}function d(s,c,u,d){var p=u===i.URL||u===i.MEDIA_URL;if(!s.length||-1===s.indexOf(e)){if(c)return;var h=l(s);p&&(h=i.getTrusted(u,h));var v=j(h);return v.exp=s,v.expressions=[],v.$$watchDelegate=f,v}d=!!d;for(var m,y,g,b,w,k=0,x=[],$=s.length,_=[],S=[];k<$;){if(-1===(m=s.indexOf(e,k))||-1===(y=s.indexOf(t,m+o))){k!==$&&_.push(l(s.substring(k)));break}k!==m&&_.push(l(s.substring(k,m))),b=s.substring(m+o,y),x.push(b),k=y+a,S.push(_.length),_.push("")}w=1===_.length&&1===S.length;var M=p&&w?void 0:function(e){try{return e=u&&!p?i.getTrusted(u,e):i.valueOf(e),d&&!L(e)?e:Ue(e)}catch(e){r(Jn.interr(s,e))}};if(g=x.map((function(e){return n(e,M)})),!c||x.length){var C=function(e){for(var t=0,n=x.length;t<n;t++){if(d&&N(e[t]))return;_[S[t]]=e[t]}return p?i.getTrusted(u,w?_[0]:_.join("")):(u&&_.length>1&&Jn.throwNoconcat(s),_.join(""))};return I((function(e){var t=0,n=x.length,i=new Array(n);try{for(;t<n;t++)i[t]=g[t](e);return C(i)}catch(e){r(Jn.interr(s,e))}}),{exp:s,expressions:x,$$watchDelegate:function(e,t){var n;return e.$watchGroup(g,(function(r,i){var o=C(r);t.call(this,o,r!==i?n:o,e),n=o}))}})}}return d.startSymbol=function(){return e},d.endSymbol=function(){return t},d}]}Jn.throwNoconcat=function(e){throw Jn("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce",e)},Jn.interr=function(e,t){return Jn("interr","Can't interpolate: {0}\n{1}",e,t.toString())};var Yn=i("$interval");function Zn(){this.$get=["$$intervalFactory","$window",function(e,t){var n={},r=function(e){t.clearInterval(e),delete n[e]},i=e((function(e,r,i){var o=t.setInterval(e,r);return n[o]=i,o}),r);return i.cancel=function(e){if(!e)return!1;if(!e.hasOwnProperty("$$intervalId"))throw Yn("badprom","`$interval.cancel()` called with a promise that was not generated by `$interval()`.");if(!n.hasOwnProperty(e.$$intervalId))return!1;var t=e.$$intervalId,i=n[t];return zr(i.promise),i.reject("canceled"),r(t),!0},i}]}function Xn(){this.$get=["$browser","$q","$$q","$rootScope",function(e,t,n,r){return function(i,o){return function(a,s,c,u){var l=arguments.length>4,f=l?de(arguments,4):[],d=0,p=L(u)&&!u,h=(p?n:t).defer(),v=h.promise;function m(){l?a.apply(null,f):a(d)}function y(){p?e.defer(m):r.$evalAsync(m),h.notify(d++),c>0&&d>=c&&(h.resolve(d),o(v.$$intervalId)),p||r.$apply()}return c=L(c)?c:0,v.$$intervalId=i(y,s,h,p),v}}}]}var Qn=function(){this.$get=function(){var e=w.callbacks,t={};return{createCallback:function(n){var r="_"+(e.$$counter++).toString(36),i="angular.callbacks."+r,o=function(e){var t=function(e){t.data=e,t.called=!0};return t.id=e,t}(r);return t[i]=e[r]=o,i},wasCalled:function(e){return t[e].called},getResponse:function(e){return t[e].data},removeCallback:function(n){var r=t[n];delete e[r.id],delete t[n]}}}},er=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,tr={http:80,https:443,ftp:21},nr=i("$location");function rr(e,t,n){var r,i=(r=[],$(t,(function(e,t){W(e)?$(e,(function(e){r.push(Se(t,!0)+(!0===e?"":"="+Se(e,!0)))})):r.push(Se(t,!0)+(!0===e?"":"="+Se(e,!0)))})),r.length?r.join("&"):""),o=n?"#"+_e(n):"";return function(e){for(var t=e.split("/"),n=t.length;n--;)t[n]=_e(t[n].replace(/%2F/g,"/"));return t.join("/")}(e)+(i?"?"+i:"")+o}function ir(e,t){var n=di(e);t.$$protocol=n.protocol,t.$$host=n.hostname,t.$$port=O(n.port)||tr[n.protocol]||null}var or=/^\s*[\\/]{2,}/;function ar(e,t,n){if(or.test(e))throw nr("badpath",'Invalid url "{0}".',e);var r="/"!==e.charAt(0);r&&(e="/"+e);var i=di(e),o=r&&"/"===i.pathname.charAt(0)?i.pathname.substring(1):i.pathname;t.$$path=function(e,t){for(var n=e.split("/"),r=n.length;r--;)n[r]=decodeURIComponent(n[r]),t&&(n[r]=n[r].replace(/\//g,"%2F"));return n.join("/")}(o,n),t.$$search=$e(i.search),t.$$hash=decodeURIComponent(i.hash),t.$$path&&"/"!==t.$$path.charAt(0)&&(t.$$path="/"+t.$$path)}function sr(e,t){return e.slice(0,t.length)===t}function cr(e,t){if(sr(t,e))return t.substr(e.length)}function ur(e){var t=e.indexOf("#");return-1===t?e:e.substr(0,t)}function lr(e,t,n){this.$$html5=!0,n=n||"",ir(e,this),this.$$parse=function(e){var n=cr(t,e);if(!H(n))throw nr("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',e,t);ar(n,this,!0),this.$$path||(this.$$path="/"),this.$$compose()},this.$$normalizeUrl=function(e){return t+e.substr(1)},this.$$parseLinkUrl=function(r,i){return i&&"#"===i[0]?(this.hash(i.slice(1)),!0):(L(o=cr(e,r))?(a=o,s=n&&L(o=cr(n,o))?t+(cr("/",o)||o):e+a):L(o=cr(t,r))?s=t+o:t===r+"/"&&(s=t),s&&this.$$parse(s),!!s);var o,a,s}}function fr(e,t,n){ir(e,this),this.$$parse=function(r){var i,o=cr(e,r)||cr(t,r);N(o)||"#"!==o.charAt(0)?this.$$html5?i=o:(i="",N(o)&&(e=r,this.replace())):N(i=cr(n,o))&&(i=o),ar(i,this,!1),this.$$path=function(e,t,n){var r,i=/^\/[A-Z]:(\/.*)/;sr(t,n)&&(t=t.replace(n,""));if(i.exec(t))return e;return(r=i.exec(e))?r[1]:e}(this.$$path,i,e),this.$$compose()},this.$$normalizeUrl=function(t){return e+(t?n+t:"")},this.$$parseLinkUrl=function(t,n){return ur(e)===ur(t)&&(this.$$parse(t),!0)}}function dr(e,t,n){this.$$html5=!0,fr.apply(this,arguments),this.$$parseLinkUrl=function(r,i){return i&&"#"===i[0]?(this.hash(i.slice(1)),!0):(e===ur(r)?o=r:(a=cr(t,r))?o=e+n+a:t===r+"/"&&(o=t),o&&this.$$parse(o),!!o);var o,a},this.$$normalizeUrl=function(t){return e+n+t}}var pr={$$absUrl:"",$$html5:!1,$$replace:!1,$$compose:function(){this.$$url=rr(this.$$path,this.$$search,this.$$hash),this.$$absUrl=this.$$normalizeUrl(this.$$url),this.$$urlUpdatedByLocation=!0},absUrl:hr("$$absUrl"),url:function(e){if(N(e))return this.$$url;var t=er.exec(e);return(t[1]||""===e)&&this.path(decodeURIComponent(t[1])),(t[2]||t[1]||""===e)&&this.search(t[3]||""),this.hash(t[5]||""),this},protocol:hr("$$protocol"),host:hr("$$host"),port:hr("$$port"),path:vr("$$path",(function(e){return"/"===(e=null!==e?e.toString():"").charAt(0)?e:"/"+e})),search:function(e,t){switch(arguments.length){case 0:return this.$$search;case 1:if(H(e)||z(e))e=e.toString(),this.$$search=$e(e);else{if(!U(e))throw nr("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");$(e=ae(e,{}),(function(t,n){null==t&&delete e[n]})),this.$$search=e}break;default:N(t)||null===t?delete this.$$search[e]:this.$$search[e]=t}return this.$$compose(),this},hash:vr("$$hash",(function(e){return null!==e?e.toString():""})),replace:function(){return this.$$replace=!0,this}};function hr(e){return function(){return this[e]}}function vr(e,t){return function(n){return N(n)?this[e]:(this[e]=t(n),this.$$compose(),this)}}function mr(){var e="!",t={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(t){return L(t)?(e=t,this):e},this.html5Mode=function(e){return Z(e)?(t.enabled=e,this):U(e)?(Z(e.enabled)&&(t.enabled=e.enabled),Z(e.requireBase)&&(t.requireBase=e.requireBase),(Z(e.rewriteLinks)||H(e.rewriteLinks))&&(t.rewriteLinks=e.rewriteLinks),this):t},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(n,r,i,o,s){var c,u,l,f,d=r.baseHref(),p=r.url();if(t.enabled){if(!d&&t.requireBase)throw nr("nobase","$location in HTML5 mode requires a <base> tag to be present!");l=(f=p).substring(0,f.indexOf("/",f.indexOf("//")+2))+(d||"/"),u=i.history?lr:dr}else l=ur(p),u=fr;var h=function(e){return e.substr(0,ur(e).lastIndexOf("/")+1)}(l);(c=new u(l,h,"#"+e)).$$parseLinkUrl(p,p),c.$$state=r.state();var v=/^\s*(javascript|mailto):/i;function m(e,t,n){var i=c.url(),o=c.$$state;try{r.url(e,t,n),c.$$state=r.state()}catch(e){throw c.url(i),c.$$state=o,e}}o.on("click",(function(e){var i=t.rewriteLinks;if(i&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&2!==e.which&&2!==e.button){for(var s=a(e.target);"a"!==re(s[0]);)if(s[0]===o[0]||!(s=s.parent())[0])return;if(!H(i)||!N(s.attr(i))){var u=s.prop("href"),l=s.attr("href")||s.attr("xlink:href");U(u)&&"[object SVGAnimatedString]"===u.toString()&&(u=di(u.animVal).href),v.test(u)||!u||s.attr("target")||e.isDefaultPrevented()||c.$$parseLinkUrl(u,l)&&(e.preventDefault(),c.absUrl()!==r.url()&&n.$apply())}}})),c.absUrl()!==p&&r.url(c.absUrl(),!0);var y=!0;return r.onUrlChange((function(e,t){sr(e,h)?(n.$evalAsync((function(){var r,i=c.absUrl(),o=c.$$state;c.$$parse(e),c.$$state=t,r=n.$broadcast("$locationChangeStart",e,i,t,o).defaultPrevented,c.absUrl()===e&&(r?(c.$$parse(i),c.$$state=o,m(i,!1,o)):(y=!1,g(i,o)))})),n.$$phase||n.$digest()):s.location.href=e})),n.$watch((function(){if(y||c.$$urlUpdatedByLocation){c.$$urlUpdatedByLocation=!1;var e=r.url(),t=c.absUrl(),o=r.state(),a=c.$$replace,s=!((u=e)===(l=t)||di(u).href===di(l).href)||c.$$html5&&i.history&&o!==c.$$state;(y||s)&&(y=!1,n.$evalAsync((function(){var t=c.absUrl(),r=n.$broadcast("$locationChangeStart",t,e,c.$$state,o).defaultPrevented;c.absUrl()===t&&(r?(c.$$parse(e),c.$$state=o):(s&&m(t,a,o===c.$$state?null:c.$$state),g(e,o)))})))}var u,l;c.$$replace=!1})),c;function g(e,t){n.$broadcast("$locationChangeSuccess",c.absUrl(),e,c.$$state,t)}}]}function yr(){var e=!0,t=this;this.debugEnabled=function(t){return L(t)?(e=t,this):e},this.$get=["$window",function(n){var r,i=o||/\bEdge\//.test(n.navigator&&n.navigator.userAgent);return{log:s("log"),info:s("info"),warn:s("warn"),error:s("error"),debug:(r=s("debug"),function(){e&&r.apply(t,arguments)})};function a(e){return K(e)&&(e.stack&&i?e=e.message&&-1===e.stack.indexOf(e.message)?"Error: "+e.message+"\n"+e.stack:e.stack:e.sourceURL&&(e=e.message+"\n"+e.sourceURL+":"+e.line)),e}function s(e){var t=n.console||{},r=t[e]||t.log||P;return function(){var e=[];return $(arguments,(function(t){e.push(a(t))})),Function.prototype.apply.call(r,t,e)}}}]}$([dr,fr,lr],(function(e){e.prototype=Object.create(pr),e.prototype.state=function(t){if(!arguments.length)return this.$$state;if(e!==lr||!this.$$html5)throw nr("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=N(t)?null:t,this.$$urlUpdatedByLocation=!0,this}}));var gr=i("$parse"),br={}.constructor.prototype.valueOf;function wr(e){return e+""}var kr=Le();$("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),(function(e){kr[e]=!0}));var xr={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},$r=function(e){this.options=e};$r.prototype={constructor:$r,lex:function(e){for(this.text=e,this.index=0,this.tokens=[];this.index<this.text.length;){var t=this.text.charAt(this.index);if('"'===t||"'"===t)this.readString(t);else if(this.isNumber(t)||"."===t&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(t,"(){}[].,;:?"))this.tokens.push({index:this.index,text:t}),this.index++;else if(this.isWhitespace(t))this.index++;else{var n=t+this.peek(),r=n+this.peek(2),i=kr[t],o=kr[n],a=kr[r];if(i||o||a){var s=a?r:o?n:t;this.tokens.push({index:this.index,text:s,operator:!0}),this.index+=s.length}else this.throwError("Unexpected next character ",this.index,this.index+1)}}return this.tokens},is:function(e,t){return-1!==t.indexOf(e)},peek:function(e){var t=e||1;return this.index+t<this.text.length&&this.text.charAt(this.index+t)},isNumber:function(e){return"0"<=e&&e<="9"&&"string"==typeof e},isWhitespace:function(e){return" "===e||"\r"===e||"\t"===e||"\n"===e||"\v"===e||" "===e},isIdentifierStart:function(e){return this.options.isIdentifierStart?this.options.isIdentifierStart(e,this.codePointAt(e)):this.isValidIdentifierStart(e)},isValidIdentifierStart:function(e){return"a"<=e&&e<="z"||"A"<=e&&e<="Z"||"_"===e||"$"===e},isIdentifierContinue:function(e){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(e,this.codePointAt(e)):this.isValidIdentifierContinue(e)},isValidIdentifierContinue:function(e,t){return this.isValidIdentifierStart(e,t)||this.isNumber(e)},codePointAt:function(e){return 1===e.length?e.charCodeAt(0):(e.charCodeAt(0)<<10)+e.charCodeAt(1)-56613888},peekMultichar:function(){var e=this.text.charAt(this.index),t=this.peek();if(!t)return e;var n=e.charCodeAt(0),r=t.charCodeAt(0);return n>=55296&&n<=56319&&r>=56320&&r<=57343?e+t:e},isExpOperator:function(e){return"-"===e||"+"===e||this.isNumber(e)},throwError:function(e,t,n){n=n||this.index;var r=L(t)?"s "+t+"-"+this.index+" ["+this.text.substring(t,n)+"]":" "+n;throw gr("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",e,r,this.text)},readNumber:function(){for(var e="",t=this.index;this.index<this.text.length;){var n=d(this.text.charAt(this.index));if("."===n||this.isNumber(n))e+=n;else{var r=this.peek();if("e"===n&&this.isExpOperator(r))e+=n;else if(this.isExpOperator(n)&&r&&this.isNumber(r)&&"e"===e.charAt(e.length-1))e+=n;else{if(!this.isExpOperator(n)||r&&this.isNumber(r)||"e"!==e.charAt(e.length-1))break;this.throwError("Invalid exponent")}}this.index++}this.tokens.push({index:t,text:e,constant:!0,value:Number(e)})},readIdent:function(){var e=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var t=this.peekMultichar();if(!this.isIdentifierContinue(t))break;this.index+=t.length}this.tokens.push({index:e,text:this.text.slice(e,this.index),identifier:!0})},readString:function(e){var t=this.index;this.index++;for(var n="",r=e,i=!1;this.index<this.text.length;){var o=this.text.charAt(this.index);if(r+=o,i){if("u"===o){var a=this.text.substring(this.index+1,this.index+5);a.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+a+"]"),this.index+=4,n+=String.fromCharCode(parseInt(a,16))}else{n+=xr[o]||o}i=!1}else if("\\"===o)i=!0;else{if(o===e)return this.index++,void this.tokens.push({index:t,text:r,constant:!0,value:n});n+=o}this.index++}this.throwError("Unterminated quote",t)}};var _r=function(e,t){this.lexer=e,this.options=t};function Sr(e,t){return void 0!==e?e:t}function Mr(e,t){return void 0===e?t:void 0===t?e:e+t}_r.Program="Program",_r.ExpressionStatement="ExpressionStatement",_r.AssignmentExpression="AssignmentExpression",_r.ConditionalExpression="ConditionalExpression",_r.LogicalExpression="LogicalExpression",_r.BinaryExpression="BinaryExpression",_r.UnaryExpression="UnaryExpression",_r.CallExpression="CallExpression",_r.MemberExpression="MemberExpression",_r.Identifier="Identifier",_r.Literal="Literal",_r.ArrayExpression="ArrayExpression",_r.Property="Property",_r.ObjectExpression="ObjectExpression",_r.ThisExpression="ThisExpression",_r.LocalsExpression="LocalsExpression",_r.NGValueParameter="NGValueParameter",_r.prototype={ast:function(e){this.text=e,this.tokens=this.lexer.lex(e);var t=this.program();return 0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),t},program:function(){for(var e=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&e.push(this.expressionStatement()),!this.expect(";"))return{type:_r.Program,body:e}},expressionStatement:function(){return{type:_r.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var e=this.expression();this.expect("|");)e=this.filter(e);return e},expression:function(){return this.assignment()},assignment:function(){var e=this.ternary();if(this.expect("=")){if(!Or(e))throw gr("lval","Trying to assign a value to a non l-value");e={type:_r.AssignmentExpression,left:e,right:this.assignment(),operator:"="}}return e},ternary:function(){var e,t,n=this.logicalOR();return this.expect("?")&&(e=this.expression(),this.consume(":"))?(t=this.expression(),{type:_r.ConditionalExpression,test:n,alternate:e,consequent:t}):n},logicalOR:function(){for(var e=this.logicalAND();this.expect("||");)e={type:_r.LogicalExpression,operator:"||",left:e,right:this.logicalAND()};return e},logicalAND:function(){for(var e=this.equality();this.expect("&&");)e={type:_r.LogicalExpression,operator:"&&",left:e,right:this.equality()};return e},equality:function(){for(var e,t=this.relational();e=this.expect("==","!=","===","!==");)t={type:_r.BinaryExpression,operator:e.text,left:t,right:this.relational()};return t},relational:function(){for(var e,t=this.additive();e=this.expect("<",">","<=",">=");)t={type:_r.BinaryExpression,operator:e.text,left:t,right:this.additive()};return t},additive:function(){for(var e,t=this.multiplicative();e=this.expect("+","-");)t={type:_r.BinaryExpression,operator:e.text,left:t,right:this.multiplicative()};return t},multiplicative:function(){for(var e,t=this.unary();e=this.expect("*","/","%");)t={type:_r.BinaryExpression,operator:e.text,left:t,right:this.unary()};return t},unary:function(){var e;return(e=this.expect("+","-","!"))?{type:_r.UnaryExpression,operator:e.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var e,t;for(this.expect("(")?(e=this.filterChain(),this.consume(")")):this.expect("[")?e=this.arrayDeclaration():this.expect("{")?e=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?e=ae(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?e={type:_r.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?e=this.identifier():this.peek().constant?e=this.constant():this.throwError("not a primary expression",this.peek());t=this.expect("(","[",".");)"("===t.text?(e={type:_r.CallExpression,callee:e,arguments:this.parseArguments()},this.consume(")")):"["===t.text?(e={type:_r.MemberExpression,object:e,property:this.expression(),computed:!0},this.consume("]")):"."===t.text?e={type:_r.MemberExpression,object:e,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return e},filter:function(e){for(var t=[e],n={type:_r.CallExpression,callee:this.identifier(),arguments:t,filter:!0};this.expect(":");)t.push(this.expression());return n},parseArguments:function(){var e=[];if(")"!==this.peekToken().text)do{e.push(this.filterChain())}while(this.expect(","));return e},identifier:function(){var e=this.consume();return e.identifier||this.throwError("is not a valid identifier",e),{type:_r.Identifier,name:e.text}},constant:function(){return{type:_r.Literal,value:this.consume().value}},arrayDeclaration:function(){var e=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;e.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:_r.ArrayExpression,elements:e}},object:function(){var e,t=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;e={type:_r.Property,kind:"init"},this.peek().constant?(e.key=this.constant(),e.computed=!1,this.consume(":"),e.value=this.expression()):this.peek().identifier?(e.key=this.identifier(),e.computed=!1,this.peek(":")?(this.consume(":"),e.value=this.expression()):e.value=e.key):this.peek("[")?(this.consume("["),e.key=this.expression(),this.consume("]"),e.computed=!0,this.consume(":"),e.value=this.expression()):this.throwError("invalid key",this.peek()),t.push(e)}while(this.expect(","));return this.consume("}"),{type:_r.ObjectExpression,properties:t}},throwError:function(e,t){throw gr("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",t.text,e,t.index+1,this.text,this.text.substring(t.index))},consume:function(e){if(0===this.tokens.length)throw gr("ueoe","Unexpected end of expression: {0}",this.text);var t=this.expect(e);return t||this.throwError("is unexpected, expecting ["+e+"]",this.peek()),t},peekToken:function(){if(0===this.tokens.length)throw gr("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(e,t,n,r){return this.peekAhead(0,e,t,n,r)},peekAhead:function(e,t,n,r,i){if(this.tokens.length>e){var o=this.tokens[e],a=o.text;if(a===t||a===n||a===r||a===i||!t&&!n&&!r&&!i)return o}return!1},expect:function(e,t,n,r){var i=this.peek(e,t,n,r);return!!i&&(this.tokens.shift(),i)},selfReferential:{this:{type:_r.ThisExpression},$locals:{type:_r.LocalsExpression}}};var Cr=1,Ar=2;function Ir(e,t,n){var r,i,o,a=e.isPure=function(e,t){switch(e.type){case _r.MemberExpression:if(e.computed)return!1;break;case _r.UnaryExpression:return Cr;case _r.BinaryExpression:return"+"!==e.operator&&Cr;case _r.CallExpression:return!1}return void 0===t?Ar:t}(e,n);switch(e.type){case _r.Program:r=!0,$(e.body,(function(e){Ir(e.expression,t,a),r=r&&e.expression.constant})),e.constant=r;break;case _r.Literal:e.constant=!0,e.toWatch=[];break;case _r.UnaryExpression:Ir(e.argument,t,a),e.constant=e.argument.constant,e.toWatch=e.argument.toWatch;break;case _r.BinaryExpression:Ir(e.left,t,a),Ir(e.right,t,a),e.constant=e.left.constant&&e.right.constant,e.toWatch=e.left.toWatch.concat(e.right.toWatch);break;case _r.LogicalExpression:Ir(e.left,t,a),Ir(e.right,t,a),e.constant=e.left.constant&&e.right.constant,e.toWatch=e.constant?[]:[e];break;case _r.ConditionalExpression:Ir(e.test,t,a),Ir(e.alternate,t,a),Ir(e.consequent,t,a),e.constant=e.test.constant&&e.alternate.constant&&e.consequent.constant,e.toWatch=e.constant?[]:[e];break;case _r.Identifier:e.constant=!1,e.toWatch=[e];break;case _r.MemberExpression:Ir(e.object,t,a),e.computed&&Ir(e.property,t,a),e.constant=e.object.constant&&(!e.computed||e.property.constant),e.toWatch=e.constant?[]:[e];break;case _r.CallExpression:o=!!e.filter&&function(e,t){return!e(t).$stateful}(t,e.callee.name),r=o,i=[],$(e.arguments,(function(e){Ir(e,t,a),r=r&&e.constant,i.push.apply(i,e.toWatch)})),e.constant=r,e.toWatch=o?i:[e];break;case _r.AssignmentExpression:Ir(e.left,t,a),Ir(e.right,t,a),e.constant=e.left.constant&&e.right.constant,e.toWatch=[e];break;case _r.ArrayExpression:r=!0,i=[],$(e.elements,(function(e){Ir(e,t,a),r=r&&e.constant,i.push.apply(i,e.toWatch)})),e.constant=r,e.toWatch=i;break;case _r.ObjectExpression:r=!0,i=[],$(e.properties,(function(e){Ir(e.value,t,a),r=r&&e.value.constant,i.push.apply(i,e.value.toWatch),e.computed&&(Ir(e.key,t,!1),r=r&&e.key.constant,i.push.apply(i,e.key.toWatch))})),e.constant=r,e.toWatch=i;break;case _r.ThisExpression:case _r.LocalsExpression:e.constant=!1,e.toWatch=[]}}function Er(e){if(1===e.length){var t=e[0].expression,n=t.toWatch;return 1!==n.length?n:n[0]!==t?n:void 0}}function Or(e){return e.type===_r.Identifier||e.type===_r.MemberExpression}function Dr(e){if(1===e.body.length&&Or(e.body[0].expression))return{type:_r.AssignmentExpression,left:e.body[0].expression,right:{type:_r.NGValueParameter},operator:"="}}function Rr(e){this.$filter=e}function Pr(e){this.$filter=e}function Tr(e,t,n){this.ast=new _r(e,n),this.astCompiler=n.csp?new Pr(t):new Rr(t)}function jr(e){return q(e.valueOf)?e.valueOf():br.call(e)}function Fr(){var e,t,n=Le(),r={true:!0,false:!1,null:null,undefined:void 0};this.addLiteral=function(e,t){r[e]=t},this.setIdentifierFns=function(n,r){return e=n,t=r,this},this.$get=["$filter",function(i){var o={csp:ue().noUnsafeEval,literals:ae(r),isIdentifierStart:q(e)&&e,isIdentifierContinue:q(t)&&t};return a.$$getAst=function(e){return new Tr(new $r(o),i,o).getAst(e).ast},a;function a(e,t){var r,a;switch(typeof e){case"string":if(e=e.trim(),!(r=n[a=e]))r=new Tr(new $r(o),i,o).parse(e),n[a]=d(r);return p(r,t);case"function":return p(e,t);default:return p(P,t)}}function s(e,t,n){return null==e||null==t?e===t:!("object"==typeof e&&"object"==typeof(e=jr(e))&&!n)&&(e===t||e!=e&&t!=t)}function c(e,t,n,r,i){var o,a=r.inputs;if(1===a.length){var c=s;return a=a[0],e.$watch((function(e){var t=a(e);return s(t,c,a.isPure)||(o=r(e,void 0,void 0,[t]),c=t&&jr(t)),o}),t,n,i)}for(var u=[],l=[],f=0,d=a.length;f<d;f++)u[f]=s,l[f]=null;return e.$watch((function(e){for(var t=!1,n=0,i=a.length;n<i;n++){var c=a[n](e);(t||(t=!s(c,u[n],a[n].isPure)))&&(l[n]=c,u[n]=c&&jr(c))}return t&&(o=r(e,void 0,void 0,l)),o}),t,n,i)}function u(e,t,n,r,i){var o,a,s=r.literal?l:L,c=r.$$intercepted||r,u=r.$$interceptor||T,f=r.inputs&&!c.inputs;return h.literal=r.literal,h.constant=r.constant,h.inputs=r.inputs,d(h),o=e.$watch(h,t,n,i);function p(){s(a)&&o()}function h(e,t,n,r){return a=f&&r?r[0]:c(e,t,n,r),s(a)&&e.$$postDigest(p),u(a)}}function l(e){var t=!0;return $(e,(function(e){L(e)||(t=!1)})),t}function f(e,t,n,r){var i=e.$watch((function(e){return i(),r(e)}),t,n);return i}function d(e){return e.constant?e.$$watchDelegate=f:e.oneTime?e.$$watchDelegate=u:e.inputs&&(e.$$watchDelegate=c),e}function p(e,t){if(!t)return e;e.$$interceptor&&(t=function(e,t){function n(n){return t(e(n))}return n.$stateful=e.$stateful||t.$stateful,n.$$pure=e.$$pure&&t.$$pure,n}(e.$$interceptor,t),e=e.$$intercepted);var n=!1,r=function(r,i,o,a){var s=n&&a?a[0]:e(r,i,o,a);return t(s)};return r.$$intercepted=e,r.$$interceptor=t,r.literal=e.literal,r.oneTime=e.oneTime,r.constant=e.constant,t.$stateful||(n=!e.inputs,r.inputs=e.inputs?e.inputs:[e],t.$$pure||(r.inputs=r.inputs.map((function(e){return e.isPure===Ar?function(t){return e(t)}:e})))),d(r)}}]}function Nr(){var e=!0;this.$get=["$rootScope","$exceptionHandler",function(t,n){return Ur((function(e){t.$evalAsync(e)}),n,e)}],this.errorOnUnhandledRejections=function(t){return L(t)?(e=t,this):e}}function Lr(){var e=!0;this.$get=["$browser","$exceptionHandler",function(t,n){return Ur((function(e){t.defer(e)}),n,e)}],this.errorOnUnhandledRejections=function(t){return L(t)?(e=t,this):e}}function Ur(e,t,n){var r=i("$q",TypeError),o=0,a=[];function s(){return new c}function c(){var e=this.promise=new u;this.resolve=function(t){d(e,t)},this.reject=function(t){p(e,t)},this.notify=function(t){v(e,t)}}function u(){this.$$state={status:0}}function l(){for(;!o&&a.length;){var e=a.shift();if(!Br(e)){Hr(e);var n="Possibly unhandled rejection: "+qe(e.value);K(e.value)?t(e.value,n):t(n)}}}function f(r){!n||r.pending||2!==r.status||Br(r)||(0===o&&0===a.length&&e(l),a.push(r)),!r.processScheduled&&r.pending&&(r.processScheduled=!0,++o,e((function(){!function(r){var i,a,s;s=r.pending,r.processScheduled=!1,r.pending=void 0;try{for(var c=0,u=s.length;c<u;++c){Hr(r),a=s[c][0],i=s[c][r.status];try{q(i)?d(a,i(r.value)):1===r.status?d(a,r.value):p(a,r.value)}catch(e){p(a,e),e&&!0===e.$$passToExceptionHandler&&t(e)}}}finally{--o,n&&0===o&&e(l)}}(r)})))}function d(e,t){e.$$state.status||(t===e?h(e,r("qcycle","Expected promise to be resolved with value other than itself '{0}'",t)):function e(t,n){var r,i=!1;try{(U(n)||q(n))&&(r=n.then),q(r)?(t.$$state.status=-1,r.call(n,(function(n){if(i)return;i=!0,e(t,n)}),o,(function(e){v(t,e)}))):(t.$$state.value=n,t.$$state.status=1,f(t.$$state))}catch(e){o(e)}function o(e){i||(i=!0,h(t,e))}}(e,t))}function p(e,t){e.$$state.status||h(e,t)}function h(e,t){e.$$state.value=t,e.$$state.status=2,f(e.$$state)}function v(n,r){var i=n.$$state.pending;n.$$state.status<=0&&i&&i.length&&e((function(){for(var e,n,o=0,a=i.length;o<a;o++){n=i[o][0],e=i[o][3];try{v(n,q(e)?e(r):r)}catch(e){t(e)}}}))}function m(e){var t=new u;return p(t,e),t}function y(e,t,n){var r=null;try{q(n)&&(r=n())}catch(e){return m(e)}return X(r)?r.then((function(){return t(e)}),m):t(e)}function g(e,t,n,r){var i=new u;return d(i,e),i.then(t,n,r)}I(u.prototype,{then:function(e,t,n){if(N(e)&&N(t)&&N(n))return this;var r=new u;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([r,e,t,n]),this.$$state.status>0&&f(this.$$state),r},catch:function(e){return this.then(null,e)},finally:function(e,t){return this.then((function(t){return y(t,b,e)}),(function(t){return y(t,m,e)}),t)}});var b=g;function w(e){if(!q(e))throw r("norslvr","Expected resolverFn, got '{0}'",e);var t=new u;return e((function(e){d(t,e)}),(function(e){p(t,e)})),t}return w.prototype=u.prototype,w.defer=s,w.reject=m,w.when=g,w.resolve=b,w.all=function(e){var t=new u,n=0,r=W(e)?[]:{};return $(e,(function(e,i){n++,g(e).then((function(e){r[i]=e,--n||d(t,r)}),(function(e){p(t,e)}))})),0===n&&d(t,r),t},w.race=function(e){var t=s();return $(e,(function(e){g(e).then(t.resolve,t.reject)})),t.promise},w}function Br(e){return!!e.pur}function Hr(e){e.pur=!0}function zr(e){e.$$state&&Hr(e.$$state)}function Vr(){this.$get=["$window","$timeout",function(e,t){var n=e.requestAnimationFrame||e.webkitRequestAnimationFrame,r=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.webkitCancelRequestAnimationFrame,i=!!n,o=i?function(e){var t=n(e);return function(){r(t)}}:function(e){var n=t(e,16.66,!1);return function(){t.cancel(n)}};return o.supported=i,o}]}function Wr(){var e=10,t=i("$rootScope"),n=null,r=null;this.digestTtl=function(t){return arguments.length&&(e=t),e},this.$get=["$exceptionHandler","$parse","$browser",function(i,a,s){function c(e){e.currentScope.$$destroyed=!0}function u(){this.$id=M(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.$root=this,this.$$destroyed=!1,this.$$suspended=!1,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$$isolateBindings=null}u.prototype={constructor:u,$new:function(e,t){var n;return t=t||this,e?(n=new u).$root=this.$root:(this.$$ChildScope||(this.$$ChildScope=function(e){function t(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$id=M(),this.$$ChildScope=null,this.$$suspended=!1}return t.prototype=e,t}(this)),n=new this.$$ChildScope),n.$parent=t,n.$$prevSibling=t.$$childTail,t.$$childHead?(t.$$childTail.$$nextSibling=n,t.$$childTail=n):t.$$childHead=t.$$childTail=n,(e||t!==this)&&n.$on("$destroy",c),n},$watch:function(e,t,r,i){var o=a(e),s=q(t)?t:P;if(o.$$watchDelegate)return o.$$watchDelegate(this,s,r,o,e);var c=this,u=c.$$watchers,l={fn:s,last:w,get:o,exp:i||e,eq:!!r};return n=null,u||((u=c.$$watchers=[]).$$digestWatchIndex=-1),u.unshift(l),u.$$digestWatchIndex++,g(this,1),function(){var e=oe(u,l);e>=0&&(g(c,-1),e<u.$$digestWatchIndex&&u.$$digestWatchIndex--),n=null}},$watchGroup:function(e,t){var n=new Array(e.length),r=new Array(e.length),i=[],o=this,a=!1,s=!0;if(!e.length){var c=!0;return o.$evalAsync((function(){c&&t(r,r,o)})),function(){c=!1}}if(1===e.length)return this.$watch(e[0],(function(e,i,o){r[0]=e,n[0]=i,t(r,e===i?r:n,o)}));function u(){a=!1;try{s?(s=!1,t(r,r,o)):t(r,n,o)}finally{for(var i=0;i<e.length;i++)n[i]=r[i]}}return $(e,(function(e,t){var n=o.$watch(e,(function(e){r[t]=e,a||(a=!0,o.$evalAsync(u))}));i.push(n)})),function(){for(;i.length;)i.shift()()}},$watchCollection:function(e,t){v.$$pure=a(e).literal,v.$stateful=!v.$$pure;var n,r,i,o=this,s=t.length>1,c=0,u=a(e,v),l=[],d={},p=!0,h=0;function v(e){var t,i,o,a;if(!N(n=e)){if(U(n))if(x(n)){r!==l&&(h=(r=l).length=0,c++),t=n.length,h!==t&&(c++,r.length=h=t);for(var s=0;s<t;s++)a=r[s],o=n[s],a!=a&&o!=o||a===o||(c++,r[s]=o)}else{for(i in r!==d&&(r=d={},h=0,c++),t=0,n)f.call(n,i)&&(t++,o=n[i],a=r[i],i in r?a!=a&&o!=o||a===o||(c++,r[i]=o):(h++,r[i]=o,c++));if(h>t)for(i in c++,r)f.call(n,i)||(h--,delete r[i])}else r!==n&&(r=n,c++);return c}}return this.$watch(u,(function(){if(p?(p=!1,t(n,n,o)):t(n,i,o),s)if(U(n))if(x(n)){i=new Array(n.length);for(var e=0;e<n.length;e++)i[e]=n[e]}else for(var r in i={},n)f.call(n,r)&&(i[r]=n[r]);else i=n}))},$digest:function(){var o,a,c,u,f,h,g,b,x,$=e,_=d.length?l:this,S=[];m("$digest"),s.$$checkUrlChange(),this===l&&null!==r&&(s.defer.cancel(r),k()),n=null;do{f=!1,g=_;for(var M=0;M<d.length;M++){try{(0,(x=d[M]).fn)(x.scope,x.locals)}catch(e){i(e)}n=null}d.length=0;e:do{if(u=!g.$$suspended&&g.$$watchers)for(u.$$digestWatchIndex=u.length;u.$$digestWatchIndex--;)try{if(o=u[u.$$digestWatchIndex])if((a=(0,o.get)(g))===(c=o.last)||(o.eq?ce(a,c):D(a)&&D(c))){if(o===n){f=!1;break e}}else f=!0,n=o,o.last=o.eq?ae(a,null):a,(0,o.fn)(a,c===w?a:c,g),$<5&&(S[b=4-$]||(S[b]=[]),S[b].push({msg:q(o.exp)?"fn: "+(o.exp.name||o.exp.toString()):o.exp,newVal:a,oldVal:c}))}catch(e){i(e)}if(!(h=!g.$$suspended&&g.$$watchersCount&&g.$$childHead||g!==_&&g.$$nextSibling))for(;g!==_&&!(h=g.$$nextSibling);)g=g.$parent}while(g=h);if((f||d.length)&&!$--)throw y(),t("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",e,S)}while(f||d.length);for(y();v<p.length;)try{p[v++]()}catch(e){i(e)}p.length=v=0,s.$$checkUrlChange()},$suspend:function(){this.$$suspended=!0},$isSuspended:function(){return this.$$suspended},$resume:function(){this.$$suspended=!1},$destroy:function(){if(!this.$$destroyed){var e=this.$parent;for(var t in this.$broadcast("$destroy"),this.$$destroyed=!0,this===l&&s.$$applicationDestroyed(),g(this,-this.$$watchersCount),this.$$listenerCount)b(this,this.$$listenerCount[t],t);e&&e.$$childHead===this&&(e.$$childHead=this.$$nextSibling),e&&e.$$childTail===this&&(e.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=P,this.$on=this.$watch=this.$watchGroup=function(){return P},this.$$listeners={},this.$$nextSibling=null,function e(t){9===o&&(t.$$childHead&&e(t.$$childHead),t.$$nextSibling&&e(t.$$nextSibling)),t.$parent=t.$$nextSibling=t.$$prevSibling=t.$$childHead=t.$$childTail=t.$root=t.$$watchers=null}(this)}},$eval:function(e,t){return a(e)(this,t)},$evalAsync:function(e,t){l.$$phase||d.length||s.defer((function(){d.length&&l.$digest()}),null,"$evalAsync"),d.push({scope:this,fn:a(e),locals:t})},$$postDigest:function(e){p.push(e)},$apply:function(e){try{m("$apply");try{return this.$eval(e)}finally{y()}}catch(e){i(e)}finally{try{l.$digest()}catch(e){throw i(e),e}}},$applyAsync:function(e){var t=this;e&&h.push((function(){t.$eval(e)})),e=a(e),null===r&&(r=s.defer((function(){l.$apply(k)}),null,"$applyAsync"))},$on:function(e,t){var n=this.$$listeners[e];n||(this.$$listeners[e]=n=[]),n.push(t);var r=this;do{r.$$listenerCount[e]||(r.$$listenerCount[e]=0),r.$$listenerCount[e]++}while(r=r.$parent);var i=this;return function(){var r=n.indexOf(t);-1!==r&&(delete n[r],b(i,1,e))}},$emit:function(e,t){var n,r,o,a=[],s=this,c=!1,u={name:e,targetScope:s,stopPropagation:function(){c=!0},preventDefault:function(){u.defaultPrevented=!0},defaultPrevented:!1},l=fe([u],arguments,1);do{for(n=s.$$listeners[e]||a,u.currentScope=s,r=0,o=n.length;r<o;r++)if(n[r])try{n[r].apply(null,l)}catch(e){i(e)}else n.splice(r,1),r--,o--;if(c)break;s=s.$parent}while(s);return u.currentScope=null,u},$broadcast:function(e,t){var n=this,r=n,o=n,a={name:e,targetScope:n,preventDefault:function(){a.defaultPrevented=!0},defaultPrevented:!1};if(!n.$$listenerCount[e])return a;for(var s,c,u,l=fe([a],arguments,1);r=o;){for(a.currentScope=r,c=0,u=(s=r.$$listeners[e]||[]).length;c<u;c++)if(s[c])try{s[c].apply(null,l)}catch(e){i(e)}else s.splice(c,1),c--,u--;if(!(o=r.$$listenerCount[e]&&r.$$childHead||r!==n&&r.$$nextSibling))for(;r!==n&&!(o=r.$$nextSibling);)r=r.$parent}return a.currentScope=null,a}};var l=new u,d=l.$$asyncQueue=[],p=l.$$postDigestQueue=[],h=l.$$applyAsyncQueue=[],v=0;return l;function m(e){if(l.$$phase)throw t("inprog","{0} already in progress",l.$$phase);l.$$phase=e}function y(){l.$$phase=null}function g(e,t){do{e.$$watchersCount+=t}while(e=e.$parent)}function b(e,t,n){do{e.$$listenerCount[n]-=t,0===e.$$listenerCount[n]&&delete e.$$listenerCount[n]}while(e=e.$parent)}function w(){}function k(){for(;h.length;)try{h.shift()()}catch(e){i(e)}r=null}}]}function Kr(){var e=/^\s*(https?|s?ftp|mailto|tel|file):/,t=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(t){return L(t)?(e=t,this):e},this.imgSrcSanitizationWhitelist=function(e){return L(e)?(t=e,this):t},this.$get=function(){return function(n,r){var i=r?t:e,o=di(n&&n.trim()).href;return""===o||o.match(i)?n:"unsafe:"+o}}}Rr.prototype={compile:function(e){var t=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},Ir(e,t.$filter);var n,r="";if(this.stage="assign",n=Dr(e)){this.state.computing="assign";var i=this.nextId();this.recurse(n,i),this.return_(i),r="fn.assign="+this.generateFunction("assign","s,v,l")}var o=Er(e.body);t.stage="inputs",$(o,(function(e,n){var r="fn"+n;t.state[r]={vars:[],body:[],own:{}},t.state.computing=r;var i=t.nextId();t.recurse(e,i),t.return_(i),t.state.inputs.push({name:r,isPure:e.isPure}),e.watchId=n})),this.state.computing="fn",this.stage="main",this.recurse(e);var a='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+r+this.watchFns()+"return fn;",s=new Function("$filter","getStringValue","ifDefined","plus",a)(this.$filter,wr,Sr,Mr);return this.state=this.stage=void 0,s},USE:"use",STRICT:"strict",watchFns:function(){var e=[],t=this.state.inputs,n=this;return $(t,(function(t){e.push("var "+t.name+"="+n.generateFunction(t.name,"s")),t.isPure&&e.push(t.name,".isPure="+JSON.stringify(t.isPure)+";")})),t.length&&e.push("fn.inputs=["+t.map((function(e){return e.name})).join(",")+"];"),e.join("")},generateFunction:function(e,t){return"function("+t+"){"+this.varsPrefix(e)+this.body(e)+"};"},filterPrefix:function(){var e=[],t=this;return $(this.state.filters,(function(n,r){e.push(n+"=$filter("+t.escape(r)+")")})),e.length?"var "+e.join(",")+";":""},varsPrefix:function(e){return this.state[e].vars.length?"var "+this.state[e].vars.join(",")+";":""},body:function(e){return this.state[e].body.join("")},recurse:function(e,t,n,r,i,o){var a,s,c,u,l,f=this;if(r=r||P,!o&&L(e.watchId))return t=t||this.nextId(),void this.if_("i",this.lazyAssign(t,this.computedMember("i",e.watchId)),this.lazyRecurse(e,t,n,r,i,!0));switch(e.type){case _r.Program:$(e.body,(function(t,n){f.recurse(t.expression,void 0,void 0,(function(e){s=e})),n!==e.body.length-1?f.current().body.push(s,";"):f.return_(s)}));break;case _r.Literal:u=this.escape(e.value),this.assign(t,u),r(t||u);break;case _r.UnaryExpression:this.recurse(e.argument,void 0,void 0,(function(e){s=e})),u=e.operator+"("+this.ifDefined(s,0)+")",this.assign(t,u),r(u);break;case _r.BinaryExpression:this.recurse(e.left,void 0,void 0,(function(e){a=e})),this.recurse(e.right,void 0,void 0,(function(e){s=e})),u="+"===e.operator?this.plus(a,s):"-"===e.operator?this.ifDefined(a,0)+e.operator+this.ifDefined(s,0):"("+a+")"+e.operator+"("+s+")",this.assign(t,u),r(u);break;case _r.LogicalExpression:t=t||this.nextId(),f.recurse(e.left,t),f.if_("&&"===e.operator?t:f.not(t),f.lazyRecurse(e.right,t)),r(t);break;case _r.ConditionalExpression:t=t||this.nextId(),f.recurse(e.test,t),f.if_(t,f.lazyRecurse(e.alternate,t),f.lazyRecurse(e.consequent,t)),r(t);break;case _r.Identifier:t=t||this.nextId(),n&&(n.context="inputs"===f.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",e.name)+"?l:s"),n.computed=!1,n.name=e.name),f.if_("inputs"===f.stage||f.not(f.getHasOwnProperty("l",e.name)),(function(){f.if_("inputs"===f.stage||"s",(function(){i&&1!==i&&f.if_(f.isNull(f.nonComputedMember("s",e.name)),f.lazyAssign(f.nonComputedMember("s",e.name),"{}")),f.assign(t,f.nonComputedMember("s",e.name))}))}),t&&f.lazyAssign(t,f.nonComputedMember("l",e.name))),r(t);break;case _r.MemberExpression:a=n&&(n.context=this.nextId())||this.nextId(),t=t||this.nextId(),f.recurse(e.object,a,void 0,(function(){f.if_(f.notNull(a),(function(){e.computed?(s=f.nextId(),f.recurse(e.property,s),f.getStringValue(s),i&&1!==i&&f.if_(f.not(f.computedMember(a,s)),f.lazyAssign(f.computedMember(a,s),"{}")),u=f.computedMember(a,s),f.assign(t,u),n&&(n.computed=!0,n.name=s)):(i&&1!==i&&f.if_(f.isNull(f.nonComputedMember(a,e.property.name)),f.lazyAssign(f.nonComputedMember(a,e.property.name),"{}")),u=f.nonComputedMember(a,e.property.name),f.assign(t,u),n&&(n.computed=!1,n.name=e.property.name))}),(function(){f.assign(t,"undefined")})),r(t)}),!!i);break;case _r.CallExpression:t=t||this.nextId(),e.filter?(s=f.filter(e.callee.name),c=[],$(e.arguments,(function(e){var t=f.nextId();f.recurse(e,t),c.push(t)})),u=s+"("+c.join(",")+")",f.assign(t,u),r(t)):(s=f.nextId(),a={},c=[],f.recurse(e.callee,s,a,(function(){f.if_(f.notNull(s),(function(){$(e.arguments,(function(t){f.recurse(t,e.constant?void 0:f.nextId(),void 0,(function(e){c.push(e)}))})),u=a.name?f.member(a.context,a.name,a.computed)+"("+c.join(",")+")":s+"("+c.join(",")+")",f.assign(t,u)}),(function(){f.assign(t,"undefined")})),r(t)})));break;case _r.AssignmentExpression:s=this.nextId(),a={},this.recurse(e.left,void 0,a,(function(){f.if_(f.notNull(a.context),(function(){f.recurse(e.right,s),u=f.member(a.context,a.name,a.computed)+e.operator+s,f.assign(t,u),r(t||u)}))}),1);break;case _r.ArrayExpression:c=[],$(e.elements,(function(t){f.recurse(t,e.constant?void 0:f.nextId(),void 0,(function(e){c.push(e)}))})),u="["+c.join(",")+"]",this.assign(t,u),r(t||u);break;case _r.ObjectExpression:c=[],l=!1,$(e.properties,(function(e){e.computed&&(l=!0)})),l?(t=t||this.nextId(),this.assign(t,"{}"),$(e.properties,(function(e){e.computed?(a=f.nextId(),f.recurse(e.key,a)):a=e.key.type===_r.Identifier?e.key.name:""+e.key.value,s=f.nextId(),f.recurse(e.value,s),f.assign(f.member(t,a,e.computed),s)}))):($(e.properties,(function(t){f.recurse(t.value,e.constant?void 0:f.nextId(),void 0,(function(e){c.push(f.escape(t.key.type===_r.Identifier?t.key.name:""+t.key.value)+":"+e)}))})),u="{"+c.join(",")+"}",this.assign(t,u)),r(t||u);break;case _r.ThisExpression:this.assign(t,"s"),r(t||"s");break;case _r.LocalsExpression:this.assign(t,"l"),r(t||"l");break;case _r.NGValueParameter:this.assign(t,"v"),r(t||"v")}},getHasOwnProperty:function(e,t){var n=e+"."+t,r=this.current().own;return r.hasOwnProperty(n)||(r[n]=this.nextId(!1,e+"&&("+this.escape(t)+" in "+e+")")),r[n]},assign:function(e,t){if(e)return this.current().body.push(e,"=",t,";"),e},filter:function(e){return this.state.filters.hasOwnProperty(e)||(this.state.filters[e]=this.nextId(!0)),this.state.filters[e]},ifDefined:function(e,t){return"ifDefined("+e+","+this.escape(t)+")"},plus:function(e,t){return"plus("+e+","+t+")"},return_:function(e){this.current().body.push("return ",e,";")},if_:function(e,t,n){if(!0===e)t();else{var r=this.current().body;r.push("if(",e,"){"),t(),r.push("}"),n&&(r.push("else{"),n(),r.push("}"))}},not:function(e){return"!("+e+")"},isNull:function(e){return e+"==null"},notNull:function(e){return e+"!=null"},nonComputedMember:function(e,t){return/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(t)?e+"."+t:e+'["'+t.replace(/[^$_a-zA-Z0-9]/g,this.stringEscapeFn)+'"]'},computedMember:function(e,t){return e+"["+t+"]"},member:function(e,t,n){return n?this.computedMember(e,t):this.nonComputedMember(e,t)},getStringValue:function(e){this.assign(e,"getStringValue("+e+")")},lazyRecurse:function(e,t,n,r,i,o){var a=this;return function(){a.recurse(e,t,n,r,i,o)}},lazyAssign:function(e,t){var n=this;return function(){n.assign(e,t)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)},escape:function(e){if(H(e))return"'"+e.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(z(e))return e.toString();if(!0===e)return"true";if(!1===e)return"false";if(null===e)return"null";if(void 0===e)return"undefined";throw gr("esc","IMPOSSIBLE")},nextId:function(e,t){var n="v"+this.state.nextId++;return e||this.current().vars.push(n+(t?"="+t:"")),n},current:function(){return this.state[this.state.computing]}},Pr.prototype={compile:function(e){var t,n,r=this;Ir(e,r.$filter),(t=Dr(e))&&(n=this.recurse(t));var i,o=Er(e.body);o&&(i=[],$(o,(function(e,t){var n=r.recurse(e);n.isPure=e.isPure,e.input=n,i.push(n),e.watchId=t})));var a=[];$(e.body,(function(e){a.push(r.recurse(e.expression))}));var s=0===e.body.length?P:1===e.body.length?a[0]:function(e,t){var n;return $(a,(function(r){n=r(e,t)})),n};return n&&(s.assign=function(e,t,r){return n(e,r,t)}),i&&(s.inputs=i),s},recurse:function(e,t,n){var r,i,o,a=this;if(e.input)return this.inputs(e.input,e.watchId);switch(e.type){case _r.Literal:return this.value(e.value,t);case _r.UnaryExpression:return i=this.recurse(e.argument),this["unary"+e.operator](i,t);case _r.BinaryExpression:case _r.LogicalExpression:return r=this.recurse(e.left),i=this.recurse(e.right),this["binary"+e.operator](r,i,t);case _r.ConditionalExpression:return this["ternary?:"](this.recurse(e.test),this.recurse(e.alternate),this.recurse(e.consequent),t);case _r.Identifier:return a.identifier(e.name,t,n);case _r.MemberExpression:return r=this.recurse(e.object,!1,!!n),e.computed||(i=e.property.name),e.computed&&(i=this.recurse(e.property)),e.computed?this.computedMember(r,i,t,n):this.nonComputedMember(r,i,t,n);case _r.CallExpression:return o=[],$(e.arguments,(function(e){o.push(a.recurse(e))})),e.filter&&(i=this.$filter(e.callee.name)),e.filter||(i=this.recurse(e.callee,!0)),e.filter?function(e,n,r,a){for(var s=[],c=0;c<o.length;++c)s.push(o[c](e,n,r,a));var u=i.apply(void 0,s,a);return t?{context:void 0,name:void 0,value:u}:u}:function(e,n,r,a){var s,c=i(e,n,r,a);if(null!=c.value){for(var u=[],l=0;l<o.length;++l)u.push(o[l](e,n,r,a));s=c.value.apply(c.context,u)}return t?{value:s}:s};case _r.AssignmentExpression:return r=this.recurse(e.left,!0,1),i=this.recurse(e.right),function(e,n,o,a){var s=r(e,n,o,a),c=i(e,n,o,a);return s.context[s.name]=c,t?{value:c}:c};case _r.ArrayExpression:return o=[],$(e.elements,(function(e){o.push(a.recurse(e))})),function(e,n,r,i){for(var a=[],s=0;s<o.length;++s)a.push(o[s](e,n,r,i));return t?{value:a}:a};case _r.ObjectExpression:return o=[],$(e.properties,(function(e){e.computed?o.push({key:a.recurse(e.key),computed:!0,value:a.recurse(e.value)}):o.push({key:e.key.type===_r.Identifier?e.key.name:""+e.key.value,computed:!1,value:a.recurse(e.value)})})),function(e,n,r,i){for(var a={},s=0;s<o.length;++s)o[s].computed?a[o[s].key(e,n,r,i)]=o[s].value(e,n,r,i):a[o[s].key]=o[s].value(e,n,r,i);return t?{value:a}:a};case _r.ThisExpression:return function(e){return t?{value:e}:e};case _r.LocalsExpression:return function(e,n){return t?{value:n}:n};case _r.NGValueParameter:return function(e,n,r){return t?{value:r}:r}}},"unary+":function(e,t){return function(n,r,i,o){var a=e(n,r,i,o);return a=L(a)?+a:0,t?{value:a}:a}},"unary-":function(e,t){return function(n,r,i,o){var a=e(n,r,i,o);return a=L(a)?-a:-0,t?{value:a}:a}},"unary!":function(e,t){return function(n,r,i,o){var a=!e(n,r,i,o);return t?{value:a}:a}},"binary+":function(e,t,n){return function(r,i,o,a){var s=Mr(e(r,i,o,a),t(r,i,o,a));return n?{value:s}:s}},"binary-":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a),c=t(r,i,o,a),u=(L(s)?s:0)-(L(c)?c:0);return n?{value:u}:u}},"binary*":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)*t(r,i,o,a);return n?{value:s}:s}},"binary/":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)/t(r,i,o,a);return n?{value:s}:s}},"binary%":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)%t(r,i,o,a);return n?{value:s}:s}},"binary===":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)===t(r,i,o,a);return n?{value:s}:s}},"binary!==":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)!==t(r,i,o,a);return n?{value:s}:s}},"binary==":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)==t(r,i,o,a);return n?{value:s}:s}},"binary!=":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)!=t(r,i,o,a);return n?{value:s}:s}},"binary<":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)<t(r,i,o,a);return n?{value:s}:s}},"binary>":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)>t(r,i,o,a);return n?{value:s}:s}},"binary<=":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)<=t(r,i,o,a);return n?{value:s}:s}},"binary>=":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)>=t(r,i,o,a);return n?{value:s}:s}},"binary&&":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)&&t(r,i,o,a);return n?{value:s}:s}},"binary||":function(e,t,n){return function(r,i,o,a){var s=e(r,i,o,a)||t(r,i,o,a);return n?{value:s}:s}},"ternary?:":function(e,t,n,r){return function(i,o,a,s){var c=e(i,o,a,s)?t(i,o,a,s):n(i,o,a,s);return r?{value:c}:c}},value:function(e,t){return function(){return t?{context:void 0,name:void 0,value:e}:e}},identifier:function(e,t,n){return function(r,i,o,a){var s=i&&e in i?i:r;n&&1!==n&&s&&null==s[e]&&(s[e]={});var c=s?s[e]:void 0;return t?{context:s,name:e,value:c}:c}},computedMember:function(e,t,n,r){return function(i,o,a,s){var c,u,l=e(i,o,a,s);return null!=l&&(c=wr(c=t(i,o,a,s)),r&&1!==r&&l&&!l[c]&&(l[c]={}),u=l[c]),n?{context:l,name:c,value:u}:u}},nonComputedMember:function(e,t,n,r){return function(i,o,a,s){var c=e(i,o,a,s);r&&1!==r&&c&&null==c[t]&&(c[t]={});var u=null!=c?c[t]:void 0;return n?{context:c,name:t,value:u}:u}},inputs:function(e,t){return function(n,r,i,o){return o?o[t]:e(n,r,i)}}},Tr.prototype={constructor:Tr,parse:function(e){var t=this.getAst(e),n=this.astCompiler.compile(t.ast);return n.literal=function(e){return 0===e.body.length||1===e.body.length&&(e.body[0].expression.type===_r.Literal||e.body[0].expression.type===_r.ArrayExpression||e.body[0].expression.type===_r.ObjectExpression)}(t.ast),n.constant=function(e){return e.constant}(t.ast),n.oneTime=t.oneTime,n},getAst:function(e){var t=!1;return":"===(e=e.trim()).charAt(0)&&":"===e.charAt(1)&&(t=!0,e=e.substring(2)),{ast:this.ast.ast(e),oneTime:t}}};var qr=i("$sce"),Jr={HTML:"html",CSS:"css",MEDIA_URL:"mediaUrl",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Gr=/_([a-z])/g;function Yr(e){return e.replace(Gr,tt)}function Zr(e){var t=[];return L(e)&&$(e,(function(e){t.push(function(e){if("self"===e)return e;if(H(e)){if(e.indexOf("***")>-1)throw qr("iwcard","Illegal sequence *** in string matcher. String: {0}",e);return e=te(e).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*"),new RegExp("^"+e+"$")}if(J(e))return new RegExp("^"+e.source+"$");throw qr("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}(e))})),t}function Xr(){this.SCE_CONTEXTS=Jr;var t=["self"],n=[];this.resourceUrlWhitelist=function(e){return arguments.length&&(t=Zr(e)),t},this.resourceUrlBlacklist=function(e){return arguments.length&&(n=Zr(e)),n},this.$get=["$injector","$$sanitizeUri",function(r,i){var o=function(e){throw qr("unsafe","Attempting to use an unsafe value in a safe context.")};function a(t,n){return"self"===t?pi(n,li)||function(t){return pi(t,function(){if(e.document.baseURI)return e.document.baseURI;ci||((ci=e.document.createElement("a")).href=".",ci=ci.cloneNode(!1));return ci.href}())}(n):!!t.exec(n.href)}function s(e){var t=function(e){this.$$unwrapTrustedValue=function(){return e}};return e&&(t.prototype=new e),t.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},t.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},t}r.has("$sanitize")&&(o=r.get("$sanitize"));var c=s(),u={};return u[Jr.HTML]=s(c),u[Jr.CSS]=s(c),u[Jr.MEDIA_URL]=s(c),u[Jr.URL]=s(u[Jr.MEDIA_URL]),u[Jr.JS]=s(c),u[Jr.RESOURCE_URL]=s(u[Jr.URL]),{trustAs:function(e,t){var n=u.hasOwnProperty(e)?u[e]:null;if(!n)throw qr("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",e,t);if(null===t||N(t)||""===t)return t;if("string"!=typeof t)throw qr("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",e);return new n(t)},getTrusted:function(e,r){if(null===r||N(r)||""===r)return r;var s=u.hasOwnProperty(e)?u[e]:null;if(s&&r instanceof s)return r.$$unwrapTrustedValue();if(q(r.$$unwrapTrustedValue)&&(r=r.$$unwrapTrustedValue()),e===Jr.MEDIA_URL||e===Jr.URL)return i(r.toString(),e===Jr.MEDIA_URL);if(e===Jr.RESOURCE_URL){if(function(e){var r,i,o=di(e.toString()),s=!1;for(r=0,i=t.length;r<i;r++)if(a(t[r],o)){s=!0;break}if(s)for(r=0,i=n.length;r<i;r++)if(a(n[r],o)){s=!1;break}return s}(r))return r;throw qr("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",r.toString())}if(e===Jr.HTML)return o(r);throw qr("unsafe","Attempting to use an unsafe value in a safe context.")},valueOf:function(e){return e instanceof c?e.$$unwrapTrustedValue():e}}}]}function Qr(){var e=!0;this.enabled=function(t){return arguments.length&&(e=!!t),e},this.$get=["$parse","$sceDelegate",function(t,n){if(e&&o<8)throw qr("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode. You can fix this by adding the text <!doctype html> to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var r=Ke(Jr);r.isEnabled=function(){return e},r.trustAs=n.trustAs,r.getTrusted=n.getTrusted,r.valueOf=n.valueOf,e||(r.trustAs=r.getTrusted=function(e,t){return t},r.valueOf=T),r.parseAs=function(e,n){var i=t(n);return i.literal&&i.constant?i:t(n,(function(t){return r.getTrusted(e,t)}))};var i=r.parseAs,a=r.getTrusted,s=r.trustAs;return $(Jr,(function(e,t){var n=d(t);r[Yr("parse_as_"+n)]=function(t){return i(e,t)},r[Yr("get_trusted_"+n)]=function(t){return a(e,t)},r[Yr("trust_as_"+n)]=function(t){return s(e,t)}})),r}]}function ei(){this.$get=["$window","$document",function(e,t){var n={},r=!(!(e.nw&&e.nw.process)&&e.chrome&&(e.chrome.app&&e.chrome.app.runtime||!e.chrome.app&&e.chrome.runtime&&e.chrome.runtime.id))&&e.history&&e.history.pushState,i=O((/android (\d+)/.exec(d((e.navigator||{}).userAgent))||[])[1]),a=/Boxee/i.test((e.navigator||{}).userAgent),s=t[0]||{},c=s.body&&s.body.style,u=!1,l=!1;return c&&(u=!!("transition"in c||"webkitTransition"in c),l=!!("animation"in c||"webkitAnimation"in c)),{history:!(!r||i<4||a),hasEvent:function(e){if("input"===e&&o)return!1;if(N(n[e])){var t=s.createElement("div");n[e]="on"+e in t}return n[e]},csp:ue(),transitions:u,animations:l,android:i}}]}function ti(){this.$get=j((function(e){return new ni(e)}))}function ni(e){var t={},n=[],r=this.ALL_TASKS_TYPE="$$all$$",i=this.DEFAULT_TASK_TYPE="$$default$$";function o(){var e=n.pop();return e&&e.cb}function a(e){for(var t=n.length-1;t>=0;--t){var r=n[t];if(r.type===e)return n.splice(t,1),r.cb}}this.completeTask=function(n,s){s=s||i;try{n()}finally{!function(e){t[e=e||i]&&(t[e]--,t[r]--)}(s);var c=t[s],u=t[r];if(!u||!c)for(var l,f=u?a:o;l=f(s);)try{l()}catch(t){e.error(t)}}},this.incTaskCount=function(e){t[e=e||i]=(t[e]||0)+1,t[r]=(t[r]||0)+1},this.notifyWhenNoPendingTasks=function(e,i){t[i=i||r]?n.push({type:i,cb:e}):e()}}var ri=i("$templateRequest");function ii(){var e;this.httpOptions=function(t){return t?(e=t,this):e},this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(t,n,r,i,o){function a(s,c){a.totalPendingRequests++,H(s)&&!N(n.get(s))||(s=o.getTrustedResourceUrl(s));var u=r.defaults&&r.defaults.transformResponse;return W(u)?u=u.filter((function(e){return e!==Un})):u===Un&&(u=null),r.get(s,I({cache:n,transformResponse:u},e)).finally((function(){a.totalPendingRequests--})).then((function(e){return n.put(s,e.data)}),(function(e){c||(e=ri("tpload","Failed to load template: {0} (HTTP status: {1} {2})",s,e.status,e.statusText),t(e));return i.reject(e)}))}return a.totalPendingRequests=0,a}]}function oi(){this.$get=["$rootScope","$browser","$location",function(e,t,n){var r={findBindings:function(e,t,n){var r=e.getElementsByClassName("ng-binding"),i=[];return $(r,(function(e){var r=w.element(e).data("$binding");r&&$(r,(function(r){n?new RegExp("(^|\\s)"+te(t)+"(\\s|\\||$)").test(r)&&i.push(e):-1!==r.indexOf(t)&&i.push(e)}))})),i},findModels:function(e,t,n){for(var r=["ng-","data-ng-","ng\\:"],i=0;i<r.length;++i){var o="["+r[i]+"model"+(n?"=":"*=")+'"'+t+'"]',a=e.querySelectorAll(o);if(a.length)return a}},getLocation:function(){return n.url()},setLocation:function(t){t!==n.url()&&(n.url(t),e.$digest())},whenStable:function(e){t.notifyWhenNoOutstandingRequests(e)}};return r}]}var ai=i("$timeout");function si(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(e,t,n,r,i){var o={};function a(a,s,c){q(a)||(c=s,s=a,a=P);var u,l=de(arguments,3),f=L(c)&&!c,d=(f?r:n).defer(),p=d.promise;return u=t.defer((function(){try{d.resolve(a.apply(null,l))}catch(e){d.reject(e),i(e)}finally{delete o[p.$$timeoutId]}f||e.$apply()}),s,"$timeout"),p.$$timeoutId=u,o[u]=d,p}return a.cancel=function(e){if(!e)return!1;if(!e.hasOwnProperty("$$timeoutId"))throw ai("badprom","`$timeout.cancel()` called with a promise that was not generated by `$timeout()`.");if(!o.hasOwnProperty(e.$$timeoutId))return!1;var n=e.$$timeoutId,r=o[n];return zr(r.promise),r.reject("canceled"),delete o[n],t.defer.cancel(n)},a}]}var ci,ui=e.document.createElement("a"),li=di(e.location.href);ui.href="http://[::1]";var fi="[::1]"===ui.hostname;function di(e){if(!H(e))return e;var t=e;o&&(ui.setAttribute("href",t),t=ui.href),ui.setAttribute("href",t);var n=ui.hostname;return!fi&&n.indexOf(":")>-1&&(n="["+n+"]"),{href:ui.href,protocol:ui.protocol?ui.protocol.replace(/:$/,""):"",host:ui.host,search:ui.search?ui.search.replace(/^\?/,""):"",hash:ui.hash?ui.hash.replace(/^#/,""):"",hostname:n,port:ui.port,pathname:"/"===ui.pathname.charAt(0)?ui.pathname:"/"+ui.pathname}}function pi(e,t){return e=di(e),t=di(t),e.protocol===t.protocol&&e.host===t.host}function hi(){this.$get=j(e)}function vi(e){var t=e[0]||{},n={},r="";function i(e){try{return decodeURIComponent(e)}catch(t){return e}}return function(){var e,o,a,s,c,u=function(e){try{return e.cookie||""}catch(e){return""}}(t);if(u!==r)for(e=(r=u).split("; "),n={},a=0;a<e.length;a++)(s=(o=e[a]).indexOf("="))>0&&(c=i(o.substring(0,s)),N(n[c])&&(n[c]=i(o.substring(s+1))));return n}}function mi(){this.$get=vi}function yi(e){var t="Filter";function n(r,i){if(U(r)){var o={};return $(r,(function(e,t){o[t]=n(t,e)})),o}return e.factory(r+t,i)}this.register=n,this.$get=["$injector",function(e){return function(n){return e.get(n+t)}}],n("currency",_i),n("date",ji),n("filter",gi),n("json",Fi),n("limitTo",Ui),n("lowercase",Ni),n("number",Si),n("orderBy",Hi),n("uppercase",Li)}function gi(){return function(e,t,n,r){if(!x(e)){if(null==e)return e;throw i("filter")("notarray","Expected array but received: {0}",e)}var o,a;switch(r=r||"$",wi(t)){case"function":o=t;break;case"boolean":case"null":case"number":case"string":a=!0;case"object":o=function(e,t,n,r){var i=U(e)&&n in e;!0===t?t=ce:q(t)||(t=function(e,t){return!N(e)&&(null===e||null===t?e===t:!(U(t)||U(e)&&!F(e))&&(e=d(""+e),t=d(""+t),-1!==e.indexOf(t)))});return function(o){return i&&!U(o)?bi(o,e[n],t,n,!1):bi(o,e,t,n,r)}}(t,n,r,a);break;default:return e}return Array.prototype.filter.call(e,o)}}function bi(e,t,n,r,i,o){var a=wi(e),s=wi(t);if("string"===s&&"!"===t.charAt(0))return!bi(e,t.substring(1),n,r,i);if(W(e))return e.some((function(e){return bi(e,t,n,r,i)}));switch(a){case"object":var c;if(i){for(c in e)if(c.charAt&&"$"!==c.charAt(0)&&bi(e[c],t,n,r,!0))return!0;return!o&&bi(e,t,n,r,!1)}if("object"===s){for(c in t){var u=t[c];if(!q(u)&&!N(u)){var l=c===r;if(!bi(l?e:e[c],u,n,r,l,l))return!1}}return!0}return n(e,t);case"function":return!1;default:return n(e,t)}}function wi(e){return null===e?"null":typeof e}vi.$inject=["$document"],yi.$inject=["$provide"];var ki=22,xi=".",$i="0";function _i(e){var t=e.NUMBER_FORMATS;return function(e,n,r){N(n)&&(n=t.CURRENCY_SYM),N(r)&&(r=t.PATTERNS[1].maxFrac);var i=n?/\u00A4/g:/\s*\u00A4\s*/g;return null==e?e:Mi(e,t.PATTERNS[1],t.GROUP_SEP,t.DECIMAL_SEP,r).replace(i,n)}}function Si(e){var t=e.NUMBER_FORMATS;return function(e,n){return null==e?e:Mi(e,t.PATTERNS[0],t.GROUP_SEP,t.DECIMAL_SEP,n)}}function Mi(e,t,n,r,i){if(!H(e)&&!z(e)||isNaN(e))return"";var o,a=!isFinite(e),s=!1,c=Math.abs(e)+"",u="";if(a)u="∞";else{(function(e,t,n,r){var i=e.d,o=i.length-e.i,a=(t=N(t)?Math.min(Math.max(n,o),r):+t)+e.i,s=i[a];if(a>0){i.splice(Math.max(e.i,a));for(var c=a;c<i.length;c++)i[c]=0}else{o=Math.max(0,o),e.i=1,i.length=Math.max(1,a=t+1),i[0]=0;for(var u=1;u<a;u++)i[u]=0}if(s>=5)if(a-1<0){for(var l=0;l>a;l--)i.unshift(0),e.i++;i.unshift(1),e.i++}else i[a-1]++;for(;o<Math.max(0,t);o++)i.push(0);var f=i.reduceRight((function(e,t,n,r){return t+=e,r[n]=t%10,Math.floor(t/10)}),0);f&&(i.unshift(f),e.i++)})(o=function(e){var t,n,r,i,o,a=0;for((n=e.indexOf(xi))>-1&&(e=e.replace(xi,"")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charAt(r)===$i;r++);if(r===(o=e.length))t=[0],n=1;else{for(o--;e.charAt(o)===$i;)o--;for(n-=r,t=[],i=0;r<=o;r++,i++)t[i]=+e.charAt(r)}return n>ki&&(t=t.splice(0,ki-1),a=n-1,n=1),{d:t,e:a,i:n}}(c),i,t.minFrac,t.maxFrac);var l=o.d,f=o.i,d=o.e,p=[];for(s=l.reduce((function(e,t){return e&&!t}),!0);f<0;)l.unshift(0),f++;f>0?p=l.splice(f,l.length):(p=l,l=[0]);var h=[];for(l.length>=t.lgSize&&h.unshift(l.splice(-t.lgSize,l.length).join(""));l.length>t.gSize;)h.unshift(l.splice(-t.gSize,l.length).join(""));l.length&&h.unshift(l.join("")),u=h.join(n),p.length&&(u+=r+p.join("")),d&&(u+="e+"+d)}return e<0&&!s?t.negPre+u+t.negSuf:t.posPre+u+t.posSuf}function Ci(e,t,n,r){var i="";for((e<0||r&&e<=0)&&(r?e=1-e:(e=-e,i="-")),e=""+e;e.length<t;)e=$i+e;return n&&(e=e.substr(e.length-t)),i+e}function Ai(e,t,n,r,i){return n=n||0,function(o){var a=o["get"+e]();return(n>0||a>-n)&&(a+=n),0===a&&-12===n&&(a=12),Ci(a,t,r,i)}}function Ii(e,t,n){return function(r,i){var o=r["get"+e]();return i[p((n?"STANDALONE":"")+(t?"SHORT":"")+e)][o]}}function Ei(e){var t=new Date(e,0,1).getDay();return new Date(e,0,(t<=4?5:12)-t)}function Oi(e){return function(t){var n,r=Ei(t.getFullYear()),i=+(n=t,new Date(n.getFullYear(),n.getMonth(),n.getDate()+(4-n.getDay())))-+r;return Ci(1+Math.round(i/6048e5),e)}}function Di(e,t){return e.getFullYear()<=0?t.ERAS[0]:t.ERAS[1]}_i.$inject=["$locale"],Si.$inject=["$locale"];var Ri={yyyy:Ai("FullYear",4,0,!1,!0),yy:Ai("FullYear",2,0,!0,!0),y:Ai("FullYear",1,0,!1,!0),MMMM:Ii("Month"),MMM:Ii("Month",!0),MM:Ai("Month",2,1),M:Ai("Month",1,1),LLLL:Ii("Month",!1,!0),dd:Ai("Date",2),d:Ai("Date",1),HH:Ai("Hours",2),H:Ai("Hours",1),hh:Ai("Hours",2,-12),h:Ai("Hours",1,-12),mm:Ai("Minutes",2),m:Ai("Minutes",1),ss:Ai("Seconds",2),s:Ai("Seconds",1),sss:Ai("Milliseconds",3),EEEE:Ii("Day"),EEE:Ii("Day",!0),a:function(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]},Z:function(e,t,n){var r=-1*n,i=r>=0?"+":"";return i+=Ci(Math[r>0?"floor":"ceil"](r/60),2)+Ci(Math.abs(r%60),2)},ww:Oi(2),w:Oi(1),G:Di,GG:Di,GGG:Di,GGGG:function(e,t){return e.getFullYear()<=0?t.ERANAMES[0]:t.ERANAMES[1]}},Pi=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,Ti=/^-?\d+$/;function ji(e){var t=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(n,r,i){var o,a,s="",c=[];if(r=r||"mediumDate",r=e.DATETIME_FORMATS[r]||r,H(n)&&(n=Ti.test(n)?O(n):function(e){var n;if(n=e.match(t)){var r=new Date(0),i=0,o=0,a=n[8]?r.setUTCFullYear:r.setFullYear,s=n[8]?r.setUTCHours:r.setHours;n[9]&&(i=O(n[9]+n[10]),o=O(n[9]+n[11])),a.call(r,O(n[1]),O(n[2])-1,O(n[3]));var c=O(n[4]||0)-i,u=O(n[5]||0)-o,l=O(n[6]||0),f=Math.round(1e3*parseFloat("0."+(n[7]||0)));return s.call(r,c,u,l,f),r}return e}(n)),z(n)&&(n=new Date(n)),!V(n)||!isFinite(n.getTime()))return n;for(;r;)(a=Pi.exec(r))?r=(c=fe(c,a,1)).pop():(c.push(r),r=null);var u=n.getTimezoneOffset();return i&&(u=ge(i,u),n=we(n,i,!0)),$(c,(function(t){o=Ri[t],s+=o?o(n,e.DATETIME_FORMATS,u):"''"===t?"'":t.replace(/(^'|'$)/g,"").replace(/''/g,"'")})),s}}function Fi(){return function(e,t){return N(t)&&(t=2),ve(e,t)}}ji.$inject=["$locale"];var Ni=j(d),Li=j(p);function Ui(){return function(e,t,n){return t=Math.abs(Number(t))===1/0?Number(t):O(t),D(t)?e:(z(e)&&(e=e.toString()),x(e)?(n=(n=!n||isNaN(n)?0:O(n))<0?Math.max(0,e.length+n):n,t>=0?Bi(e,n,n+t):0===n?Bi(e,t,e.length):Bi(e,Math.max(0,n+t),n)):e)}}function Bi(e,t,n){return H(e)?e.slice(t,n):h.call(e,t,n)}function Hi(e){return function(r,o,a,s){if(null==r)return r;if(!x(r))throw i("orderBy")("notarray","Expected array but received: {0}",r);W(o)||(o=[o]),0===o.length&&(o=["+"]);var c=o.map((function(t){var n=1,r=T;if(q(t))r=t;else if(H(t)&&("+"!==t.charAt(0)&&"-"!==t.charAt(0)||(n="-"===t.charAt(0)?-1:1,t=t.substring(1)),""!==t&&(r=e(t)).constant)){var i=r();r=function(e){return e[i]}}return{get:r,descending:n}})),u=a?-1:1,l=q(s)?s:n,f=Array.prototype.map.call(r,(function(e,n){return{value:e,tieBreaker:{value:n,type:"number",index:n},predicateValues:c.map((function(r){return function(e,n){var r=typeof e;null===e?r="null":"object"===r&&(e=function(e){if(q(e.valueOf)&&t(e=e.valueOf()))return e;if(F(e)&&t(e=e.toString()))return e;return e}(e));return{value:e,type:r,index:n}}(r.get(e),n)}))}}));return f.sort((function(e,t){for(var r=0,i=c.length;r<i;r++){var o=l(e.predicateValues[r],t.predicateValues[r]);if(o)return o*c[r].descending*u}return(l(e.tieBreaker,t.tieBreaker)||n(e.tieBreaker,t.tieBreaker))*u})),r=f.map((function(e){return e.value}))};function t(e){switch(typeof e){case"number":case"boolean":case"string":return!0;default:return!1}}function n(e,t){var n=0,r=e.type,i=t.type;if(r===i){var o=e.value,a=t.value;"string"===r?(o=o.toLowerCase(),a=a.toLowerCase()):"object"===r&&(U(o)&&(o=e.index),U(a)&&(a=t.index)),o!==a&&(n=o<a?-1:1)}else n="undefined"===r?1:"undefined"===i?-1:"null"===r?1:"null"===i?-1:r<i?-1:1;return n}}function zi(e){return q(e)&&(e={link:e}),e.restrict=e.restrict||"AC",j(e)}Hi.$inject=["$parse"];var Vi=j({restrict:"E",compile:function(e,t){if(!t.href&&!t.xlinkHref)return function(e,t){if("a"===t[0].nodeName.toLowerCase()){var n="[object SVGAnimatedString]"===y.call(t.prop("href"))?"xlink:href":"href";t.on("click",(function(e){t.attr(n)||e.preventDefault()}))}}}}),Wi={};$(Ot,(function(e,t){if("multiple"!==e){var n=wn("ng-"+t),r=i;"checked"===e&&(r=function(e,t,r){r.ngModel!==r[n]&&i(e,0,r)}),Wi[n]=function(){return{restrict:"A",priority:100,link:r}}}function i(e,r,i){e.$watch(i[n],(function(e){i.$set(t,!!e)}))}})),$(Rt,(function(e,t){Wi[t]=function(){return{priority:100,link:function(e,n,r){if("ngPattern"===t&&"/"===r.ngPattern.charAt(0)){var i=r.ngPattern.match(u);if(i)return void r.$set("ngPattern",new RegExp(i[1],i[2]))}e.$watch(r[t],(function(e){r.$set(t,e)}))}}}})),$(["src","srcset","href"],(function(e){var t=wn("ng-"+e);Wi[t]=["$sce",function(n){return{priority:99,link:function(r,i,a){var s=e,c=e;"href"===e&&"[object SVGAnimatedString]"===y.call(i.prop("href"))&&(c="xlinkHref",a.$attr[c]="xlink:href",s=null),a.$set(t,n.getTrustedMediaUrl(a[t])),a.$observe(t,(function(t){t?(a.$set(c,t),o&&s&&i.prop(s,a[c])):"href"===e&&a.$set(c,null)}))}}}]}));var Ki={$addControl:P,$getControls:j([]),$$renameControl:function(e,t){e.$name=t},$removeControl:P,$setValidity:P,$setDirty:P,$setPristine:P,$setSubmitted:P,$$setSubmitted:P},qi="ng-pending";function Ji(e,t,n,r,i){this.$$controls=[],this.$error={},this.$$success={},this.$pending=void 0,this.$name=i(t.name||t.ngForm||"")(n),this.$dirty=!1,this.$pristine=!0,this.$valid=!0,this.$invalid=!1,this.$submitted=!1,this.$$parentForm=Ki,this.$$element=e,this.$$animate=r,Xi(this)}Ji.$inject=["$element","$attrs","$scope","$animate","$interpolate"],Ji.prototype={$rollbackViewValue:function(){$(this.$$controls,(function(e){e.$rollbackViewValue()}))},$commitViewValue:function(){$(this.$$controls,(function(e){e.$commitViewValue()}))},$addControl:function(e){Fe(e.$name,"input"),this.$$controls.push(e),e.$name&&(this[e.$name]=e),e.$$parentForm=this},$getControls:function(){return Ke(this.$$controls)},$$renameControl:function(e,t){var n=e.$name;this[n]===e&&delete this[n],this[t]=e,e.$name=t},$removeControl:function(e){e.$name&&this[e.$name]===e&&delete this[e.$name],$(this.$pending,(function(t,n){this.$setValidity(n,null,e)}),this),$(this.$error,(function(t,n){this.$setValidity(n,null,e)}),this),$(this.$$success,(function(t,n){this.$setValidity(n,null,e)}),this),oe(this.$$controls,e),e.$$parentForm=Ki},$setDirty:function(){this.$$animate.removeClass(this.$$element,Go),this.$$animate.addClass(this.$$element,Yo),this.$dirty=!0,this.$pristine=!1,this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,Go,Yo+" ng-submitted"),this.$dirty=!1,this.$pristine=!0,this.$submitted=!1,$(this.$$controls,(function(e){e.$setPristine()}))},$setUntouched:function(){$(this.$$controls,(function(e){e.$setUntouched()}))},$setSubmitted:function(){for(var e=this;e.$$parentForm&&e.$$parentForm!==Ki;)e=e.$$parentForm;e.$$setSubmitted()},$$setSubmitted:function(){this.$$animate.addClass(this.$$element,"ng-submitted"),this.$submitted=!0,$(this.$$controls,(function(e){e.$$setSubmitted&&e.$$setSubmitted()}))}},Qi({clazz:Ji,set:function(e,t,n){var r=e[t];r?-1===r.indexOf(n)&&r.push(n):e[t]=[n]},unset:function(e,t,n){var r=e[t];r&&(oe(r,n),0===r.length&&delete e[t])}});var Gi=function(e){return["$timeout","$parse",function(t,n){return{name:"form",restrict:e?"EAC":"E",require:["form","^^?form"],controller:Ji,compile:function(n,i){n.addClass(Go).addClass(qo);var o=i.name?"name":!(!e||!i.ngForm)&&"ngForm";return{pre:function(e,n,i,a){var s=a[0];if(!("action"in i)){var c=function(t){e.$apply((function(){s.$commitViewValue(),s.$setSubmitted()})),t.preventDefault()};n[0].addEventListener("submit",c),n.on("$destroy",(function(){t((function(){n[0].removeEventListener("submit",c)}),0,!1)}))}(a[1]||s.$$parentForm).$addControl(s);var u=o?r(s.$name):P;o&&(u(e,s),i.$observe(o,(function(t){s.$name!==t&&(u(e,void 0),s.$$parentForm.$$renameControl(s,t),(u=r(s.$name))(e,s))}))),n.on("$destroy",(function(){s.$$parentForm.$removeControl(s),u(e,void 0),I(s,Ki)}))}}}};function r(e){return""===e?n('this[""]').assign:n(e).assign||P}}]},Yi=Gi(),Zi=Gi(!0);function Xi(e){e.$$classCache={},e.$$classCache[Jo]=!(e.$$classCache[qo]=e.$$element.hasClass(qo))}function Qi(e){var t=e.clazz,n=e.set,r=e.unset;function i(e,t,n){n&&!e.$$classCache[t]?(e.$$animate.addClass(e.$$element,t),e.$$classCache[t]=!0):!n&&e.$$classCache[t]&&(e.$$animate.removeClass(e.$$element,t),e.$$classCache[t]=!1)}function o(e,t,n){t=t?"-"+Re(t,"-"):"",i(e,qo+t,!0===n),i(e,Jo+t,!1===n)}t.prototype.$setValidity=function(e,t,a){var s;N(t)?function(e,t,r,i){e[t]||(e[t]={});n(e[t],r,i)}(this,"$pending",e,a):function(e,t,n,i){e[t]&&r(e[t],n,i);eo(e[t])&&(e[t]=void 0)}(this,"$pending",e,a),Z(t)?t?(r(this.$error,e,a),n(this.$$success,e,a)):(n(this.$error,e,a),r(this.$$success,e,a)):(r(this.$error,e,a),r(this.$$success,e,a)),this.$pending?(i(this,qi,!0),this.$valid=this.$invalid=void 0,o(this,"",null)):(i(this,qi,!1),this.$valid=eo(this.$error),this.$invalid=!this.$valid,o(this,"",this.$valid)),o(this,e,s=this.$pending&&this.$pending[e]?void 0:!this.$error[e]&&(!!this.$$success[e]||null)),this.$$parentForm.$setValidity(e,s,this)}}function eo(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}var to=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,no=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,ro=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,io=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,oo=/^(\d{4,})-(\d{2})-(\d{2})$/,ao=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,so=/^(\d{4,})-W(\d\d)$/,co=/^(\d{4,})-(\d\d)$/,uo=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,lo="keydown wheel mousedown",fo=Le();$("date,datetime-local,month,time,week".split(","),(function(e){fo[e]=!0}));var po={text:function(e,t,n,r,i,o){vo(e,t,n,r,i,o),ho(r)},date:yo("date",oo,mo(oo,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":yo("datetimelocal",ao,mo(ao,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:yo("time",uo,mo(uo,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:yo("week",so,(function(e,t){if(V(e))return e;if(H(e)){so.lastIndex=0;var n=so.exec(e);if(n){var r=+n[1],i=+n[2],o=0,a=0,s=0,c=0,u=Ei(r),l=7*(i-1);return t&&(o=t.getHours(),a=t.getMinutes(),s=t.getSeconds(),c=t.getMilliseconds()),new Date(r,0,u.getDate()+l,o,a,s,c)}}return NaN}),"yyyy-Www"),month:yo("month",co,mo(co,["yyyy","MM"]),"yyyy-MM"),number:function(e,t,n,r,i,o,a,s){var c;if(go(e,t,n,r,"number"),bo(r),vo(e,t,n,r,i,o),L(n.min)||n.ngMin){var u=n.min||s(n.ngMin)(e);c=wo(u),r.$validators.min=function(e,t){return r.$isEmpty(t)||N(c)||t>=c},n.$observe("min",(function(e){e!==u&&(c=wo(e),u=e,r.$validate())}))}if(L(n.max)||n.ngMax){var l=n.max||s(n.ngMax)(e),f=wo(l);r.$validators.max=function(e,t){return r.$isEmpty(t)||N(f)||t<=f},n.$observe("max",(function(e){e!==l&&(f=wo(e),l=e,r.$validate())}))}if(L(n.step)||n.ngStep){var d=n.step||s(n.ngStep)(e),p=wo(d);r.$validators.step=function(e,t){return r.$isEmpty(t)||N(p)||$o(t,c||0,p)},n.$observe("step",(function(e){e!==d&&(p=wo(e),d=e,r.$validate())}))}},url:function(e,t,n,r,i,o){vo(e,t,n,r,i,o),ho(r),r.$validators.url=function(e,t){var n=e||t;return r.$isEmpty(n)||no.test(n)}},email:function(e,t,n,r,i,o){vo(e,t,n,r,i,o),ho(r),r.$validators.email=function(e,t){var n=e||t;return r.$isEmpty(n)||ro.test(n)}},radio:function(e,t,n,r){var i=!n.ngTrim||"false"!==ee(n.ngTrim);N(n.name)&&t.attr("name",M());t.on("change",(function(e){var o;t[0].checked&&(o=n.value,i&&(o=ee(o)),r.$setViewValue(o,e&&e.type))})),r.$render=function(){var e=n.value;i&&(e=ee(e)),t[0].checked=e===r.$viewValue},n.$observe("value",r.$render)},range:function(e,t,n,r,i,o){go(e,t,n,r,"range"),bo(r),vo(e,t,n,r,i,o);var a=r.$$hasNativeValidators&&"range"===t[0].type,s=a?0:void 0,c=a?100:void 0,u=a?1:void 0,l=t[0].validity,f=L(n.min),d=L(n.max),p=L(n.step),h=r.$render;r.$render=a&&L(l.rangeUnderflow)&&L(l.rangeOverflow)?function(){h(),r.$setViewValue(t.val())}:h,f&&(s=wo(n.min),r.$validators.min=a?function(){return!0}:function(e,t){return r.$isEmpty(t)||N(s)||t>=s},v("min",(function(e){if(s=wo(e),D(r.$modelValue))return;if(a){var n=t.val();s>n&&(n=s,t.val(n)),r.$setViewValue(n)}else r.$validate()})));d&&(c=wo(n.max),r.$validators.max=a?function(){return!0}:function(e,t){return r.$isEmpty(t)||N(c)||t<=c},v("max",(function(e){if(c=wo(e),D(r.$modelValue))return;if(a){var n=t.val();c<n&&(t.val(c),n=c<s?s:c),r.$setViewValue(n)}else r.$validate()})));p&&(u=wo(n.step),r.$validators.step=a?function(){return!l.stepMismatch}:function(e,t){return r.$isEmpty(t)||N(u)||$o(t,s||0,u)},v("step",(function(e){if(u=wo(e),D(r.$modelValue))return;a?r.$viewValue!==t.val()&&r.$setViewValue(t.val()):r.$validate()})));function v(e,r){t.attr(e,n[e]);var i=n[e];n.$observe(e,(function(e){e!==i&&(i=e,r(e))}))}},checkbox:function(e,t,n,r,i,o,a,s){var c=_o(s,e,"ngTrueValue",n.ngTrueValue,!0),u=_o(s,e,"ngFalseValue",n.ngFalseValue,!1);t.on("change",(function(e){r.$setViewValue(t[0].checked,e&&e.type)})),r.$render=function(){t[0].checked=r.$viewValue},r.$isEmpty=function(e){return!1===e},r.$formatters.push((function(e){return ce(e,c)})),r.$parsers.push((function(e){return e?c:u}))},hidden:P,button:P,submit:P,reset:P,file:P};function ho(e){e.$formatters.push((function(t){return e.$isEmpty(t)?t:t.toString()}))}function vo(e,t,n,r,i,o){var a,s=d(t[0].type);if(!i.android){var c=!1;t.on("compositionstart",(function(){c=!0})),t.on("compositionupdate",(function(e){(N(e.data)||""===e.data)&&(c=!1)})),t.on("compositionend",(function(){c=!1,u()}))}var u=function(e){if(a&&(o.defer.cancel(a),a=null),!c){var i=t.val(),u=e&&e.type;"password"===s||n.ngTrim&&"false"===n.ngTrim||(i=ee(i)),(r.$viewValue!==i||""===i&&r.$$hasNativeValidators)&&r.$setViewValue(i,u)}};if(i.hasEvent("input"))t.on("input",u);else{var f=function(e,t,n){a||(a=o.defer((function(){a=null,t&&t.value===n||u(e)})))};t.on("keydown",(function(e){var t=e.keyCode;91===t||15<t&&t<19||37<=t&&t<=40||f(e,this,this.value)})),i.hasEvent("paste")&&t.on("paste cut drop",f)}t.on("change",u),fo[s]&&r.$$hasNativeValidators&&s===n.type&&t.on(lo,(function(e){if(!a){var t=this[l],n=t.badInput,r=t.typeMismatch;a=o.defer((function(){a=null,t.badInput===n&&t.typeMismatch===r||u(e)}))}})),r.$render=function(){var e=r.$isEmpty(r.$viewValue)?"":r.$viewValue;t.val()!==e&&t.val(e)}}function mo(e,t){return function(n,r){var i,o;if(V(n))return n;if(H(n)){if('"'===n.charAt(0)&&'"'===n.charAt(n.length-1)&&(n=n.substring(1,n.length-1)),to.test(n))return new Date(n);if(e.lastIndex=0,i=e.exec(n)){i.shift(),o=r?{yyyy:r.getFullYear(),MM:r.getMonth()+1,dd:r.getDate(),HH:r.getHours(),mm:r.getMinutes(),ss:r.getSeconds(),sss:r.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},$(i,(function(e,n){n<t.length&&(o[t[n]]=+e)}));var a=new Date(o.yyyy,o.MM-1,o.dd,o.HH,o.mm,o.ss||0,1e3*o.sss||0);return o.yyyy<100&&a.setFullYear(o.yyyy),a}}return NaN}}function yo(e,t,n,r){return function(i,o,a,s,c,u,l,f){go(i,o,a,s,e),vo(0,o,a,s,c,u);var d,p,h="time"===e||"datetimelocal"===e;if(s.$parsers.push((function(n){return s.$isEmpty(n)?null:t.test(n)?k(n,d):void(s.$$parserName=e)})),s.$formatters.push((function(e){if(e&&!V(e))throw Zo("datefmt","Expected `{0}` to be a date",e);if(b(e)){d=e;var t=s.$options.getOption("timezone");return t&&(p=t,d=we(d,t,!0)),function(e,t){var n=r;h&&H(s.$options.getOption("timeSecondsFormat"))&&(n=r.replace("ss.sss",s.$options.getOption("timeSecondsFormat")).replace(/:$/,""));var i=l("date")(e,n,t);h&&s.$options.getOption("timeStripZeroSeconds")&&(i=i.replace(/(?::00)?(?:\.000)?$/,""));return i}(e,t)}return d=null,p=null,""})),L(a.min)||a.ngMin){var v=a.min||f(a.ngMin)(i),m=w(v);s.$validators.min=function(e){return!b(e)||N(m)||n(e)>=m},a.$observe("min",(function(e){e!==v&&(m=w(e),v=e,s.$validate())}))}if(L(a.max)||a.ngMax){var y=a.max||f(a.ngMax)(i),g=w(y);s.$validators.max=function(e){return!b(e)||N(g)||n(e)<=g},a.$observe("max",(function(e){e!==y&&(g=w(e),y=e,s.$validate())}))}function b(e){return e&&!(e.getTime&&e.getTime()!=e.getTime())}function w(e){return L(e)&&!V(e)?k(e)||void 0:e}function k(e,t){var r=s.$options.getOption("timezone");p&&p!==r&&(t=be(t,ge(p)));var i=n(e,t);return!isNaN(i)&&r&&(i=we(i,r)),i}}}function go(e,t,n,r,i){var o=t[0];(r.$$hasNativeValidators=U(o.validity))&&r.$parsers.push((function(e){var n=t.prop(l)||{};if(!n.badInput&&!n.typeMismatch)return e;r.$$parserName=i}))}function bo(e){e.$parsers.push((function(t){return e.$isEmpty(t)?null:io.test(t)?parseFloat(t):void(e.$$parserName="number")})),e.$formatters.push((function(t){if(!e.$isEmpty(t)){if(!z(t))throw Zo("numfmt","Expected `{0}` to be a number",t);t=t.toString()}return t}))}function wo(e){return L(e)&&!z(e)&&(e=parseFloat(e)),D(e)?void 0:e}function ko(e){return(0|e)===e}function xo(e){var t=e.toString(),n=t.indexOf(".");if(-1===n){if(-1<e&&e<1){var r=/e-(\d+)$/.exec(t);if(r)return Number(r[1])}return 0}return t.length-n-1}function $o(e,t,n){var r=Number(e),i=!ko(r),o=!ko(t),a=!ko(n);if(i||o||a){var s=i?xo(r):0,c=o?xo(t):0,u=a?xo(n):0,l=Math.max(s,c,u),f=Math.pow(10,l);r*=f,t*=f,n*=f,i&&(r=Math.round(r)),o&&(t=Math.round(t)),a&&(n=Math.round(n))}return(r-t)%n==0}function _o(e,t,n,r,i){var o;if(L(r)){if(!(o=e(r)).constant)throw Zo("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,r);return o(t)}return i}var So=["$browser","$sniffer","$filter","$parse",function(e,t,n,r){return{restrict:"E",require:["?ngModel"],link:{pre:function(i,o,a,s){s[0]&&(po[d(a.type)]||po.text)(i,o,a,s[0],t,e,n,r)}}}}],Mo=function(){var e={configurable:!0,enumerable:!1,get:function(){return this.getAttribute("value")||""},set:function(e){this.setAttribute("value",e)}};return{restrict:"E",priority:200,compile:function(t,n){if("hidden"===d(n.type))return{pre:function(t,n,r,i){var o=n[0];o.parentNode&&o.parentNode.insertBefore(o,o.nextSibling),Object.defineProperty&&Object.defineProperty(o,"value",e)}}}}},Co=/^(true|false|\d+)$/,Ao=function(){function e(e,t,n){var r=L(n)?n:9===o?"":null;e.prop("value",r),t.$set("value",n)}return{restrict:"A",priority:100,compile:function(t,n){return Co.test(n.ngValue)?function(t,n,r){e(n,r,t.$eval(r.ngValue))}:function(t,n,r){t.$watch(r.ngValue,(function(t){e(n,r,t)}))}}}},Io=["$compile",function(e){return{restrict:"AC",compile:function(t){return e.$$addBindingClass(t),function(t,n,r){e.$$addBindingInfo(n,r.ngBind),n=n[0],t.$watch(r.ngBind,(function(e){n.textContent=Ue(e)}))}}}}],Eo=["$interpolate","$compile",function(e,t){return{compile:function(n){return t.$$addBindingClass(n),function(n,r,i){var o=e(r.attr(i.$attr.ngBindTemplate));t.$$addBindingInfo(r,o.expressions),r=r[0],i.$observe("ngBindTemplate",(function(e){r.textContent=N(e)?"":e}))}}}}],Oo=["$sce","$parse","$compile",function(e,t,n){return{restrict:"A",compile:function(r,i){var o=t(i.ngBindHtml),a=t(i.ngBindHtml,(function(t){return e.valueOf(t)}));return n.$$addBindingClass(r),function(t,r,i){n.$$addBindingInfo(r,i.ngBindHtml),t.$watch(a,(function(){var n=o(t);r.html(e.getTrustedHtml(n)||"")}))}}}}],Do=j({restrict:"A",require:"ngModel",link:function(e,t,n,r){r.$viewChangeListeners.push((function(){e.$eval(n.ngChange)}))}});function Ro(e,t){var n;return e="ngClass"+e,["$parse",function(a){return{restrict:"AC",link:function(s,c,u){var l,f=c.data("$classCounts"),d=!0;function p(e,t){var n=[];return $(e,(function(e){(t>0||f[e])&&(f[e]=(f[e]||0)+t,f[e]===+(t>0)&&n.push(e))})),n.join(" ")}f||(f=Le(),c.data("$classCounts",f)),"ngClass"!==e&&(n||(n=a("$index",(function(e){return 1&e}))),s.$watch(n,(function(e){e===t?(n=p(i(n=l),1),u.$addClass(n)):function(e){e=p(i(e),-1),u.$removeClass(e)}(l);var n;d=e}))),s.$watch(a(u[e],o),(function(e){d===t&&function(e,t){var n=i(e),o=i(t),a=r(n,o),s=r(o,n),c=p(a,-1),l=p(s,1);u.$addClass(l),u.$removeClass(c)}(l,e);l=e}))}}}];function r(e,t){if(!e||!e.length)return[];if(!t||!t.length)return e;var n=[];e:for(var r=0;r<e.length;r++){for(var i=e[r],o=0;o<t.length;o++)if(i===t[o])continue e;n.push(i)}return n}function i(e){return e&&e.split(" ")}function o(e){if(!e)return e;var t=e;return W(e)?t=e.map(o).join(" "):U(e)?t=Object.keys(e).filter((function(t){return e[t]})).join(" "):H(e)||(t=e+""),t}}var Po=Ro("",!0),To=Ro("Odd",0),jo=Ro("Even",1),Fo=zi({compile:function(e,t){t.$set("ngCloak",void 0),e.removeClass("ng-cloak")}}),No=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Lo={},Uo={blur:!0,focus:!0};function Bo(e,t,n,r,i,o){return{restrict:"A",compile:function(a,s){var c=e(s[r]);return function(e,r){r.on(i,(function(r){var i=function(){c(e,{$event:r})};if(t.$$phase)if(o)e.$evalAsync(i);else try{i()}catch(e){n(e)}else e.$apply(i)}))}}}}$("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),(function(e){var t=wn("ng-"+e);Lo[t]=["$parse","$rootScope","$exceptionHandler",function(n,r,i){return Bo(n,r,i,t,e,Uo[e])}]}));var Ho=["$animate","$compile",function(e,t){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(n,r,i,o,a){var s,c,u;n.$watch(i.ngIf,(function(n){n?c||a((function(n,o){c=o,n[n.length++]=t.$$createComment("end ngIf",i.ngIf),s={clone:n},e.enter(n,r.parent(),r)})):(u&&(u.remove(),u=null),c&&(c.$destroy(),c=null),s&&(u=Ne(s.clone),e.leave(u).done((function(e){!1!==e&&(u=null)})),s=null))}))}}}],zo=["$templateRequest","$anchorScroll","$animate",function(e,t,n){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:w.noop,compile:function(r,i){var o=i.ngInclude||i.src,a=i.onload||"",s=i.autoscroll;return function(r,i,c,u,l){var f,d,p,h=0,v=function(){d&&(d.remove(),d=null),f&&(f.$destroy(),f=null),p&&(n.leave(p).done((function(e){!1!==e&&(d=null)})),d=p,p=null)};r.$watch(o,(function(o){var c=function(e){!1===e||!L(s)||s&&!r.$eval(s)||t()},d=++h;o?(e(o,!0).then((function(e){if(!r.$$destroyed&&d===h){var t=r.$new();u.template=e;var s=l(t,(function(e){v(),n.enter(e,null,i).done(c)}));p=s,(f=t).$emit("$includeContentLoaded",o),r.$eval(a)}}),(function(){r.$$destroyed||d===h&&(v(),r.$emit("$includeContentError",o))})),r.$emit("$includeContentRequested",o)):(v(),u.template=null)}))}}}}],Vo=["$compile",function(t){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(n,r,i,o){if(y.call(r[0]).match(/SVG/))return r.empty(),void t(lt(o.template,e.document).childNodes)(n,(function(e){r.append(e)}),{futureParentElement:r});r.html(o.template),t(r.contents())(n)}}}],Wo=zi({priority:450,compile:function(){return{pre:function(e,t,n){e.$eval(n.ngInit)}}}}),Ko=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(e,t,n,r){var i=n.ngList||", ",o="false"!==n.ngTrim,a=o?ee(i):i;r.$parsers.push((function(e){if(!N(e)){var t=[];return e&&$(e.split(a),(function(e){e&&t.push(o?ee(e):e)})),t}})),r.$formatters.push((function(e){if(W(e))return e.join(i)})),r.$isEmpty=function(e){return!e||!e.length}}}},qo="ng-valid",Jo="ng-invalid",Go="ng-pristine",Yo="ng-dirty",Zo=i("ngModel");function Xo(e,t,n,r,i,o,a,s,c){var u;this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=void 0,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=void 0,this.$name=c(n.name||"",!1)(e),this.$$parentForm=Ki,this.$options=Qo,this.$$updateEvents="",this.$$updateEventHandler=this.$$updateEventHandler.bind(this),this.$$parsedNgModel=i(n.ngModel),this.$$parsedNgModelAssign=this.$$parsedNgModel.assign,this.$$ngModelGet=this.$$parsedNgModel,this.$$ngModelSet=this.$$parsedNgModelAssign,this.$$pendingDebounce=null,this.$$parserValid=void 0,this.$$parserName="parse",this.$$currentValidationRunId=0,this.$$scope=e,this.$$rootScope=e.$root,this.$$attr=n,this.$$element=r,this.$$animate=o,this.$$timeout=a,this.$$parse=i,this.$$q=s,this.$$exceptionHandler=t,Xi(this),(u=this).$$scope.$watch((function(e){var t=u.$$ngModelGet(e);return t===u.$modelValue||u.$modelValue!=u.$modelValue&&t!=t||u.$$setModelValue(t),t}))}Xo.$inject=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$q","$interpolate"],Xo.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var e=this.$$parse(this.$$attr.ngModel+"()"),t=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(t){var n=this.$$parsedNgModel(t);return q(n)&&(n=e(t)),n},this.$$ngModelSet=function(e,n){q(this.$$parsedNgModel(e))?t(e,{$$$p:n}):this.$$parsedNgModelAssign(e,n)}}else if(!this.$$parsedNgModel.assign)throw Zo("nonassign","Expression '{0}' is non-assignable. Element: {1}",this.$$attr.ngModel,ke(this.$$element))},$render:P,$isEmpty:function(e){return N(e)||""===e||null===e||e!=e},$$updateEmptyClasses:function(e){this.$isEmpty(e)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element,"ng-not-empty"))},$setPristine:function(){this.$dirty=!1,this.$pristine=!0,this.$$animate.removeClass(this.$$element,Yo),this.$$animate.addClass(this.$$element,Go)},$setDirty:function(){this.$dirty=!0,this.$pristine=!1,this.$$animate.removeClass(this.$$element,Go),this.$$animate.addClass(this.$$element,Yo),this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1,this.$untouched=!0,this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched=!0,this.$untouched=!1,this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce),this.$viewValue=this.$$lastCommittedViewValue,this.$render()},$validate:function(){if(!D(this.$modelValue)){var e=this.$$lastCommittedViewValue,t=this.$$rawModelValue,n=this.$valid,r=this.$modelValue,i=this.$options.getOption("allowInvalid"),o=this;this.$$runValidators(t,e,(function(e){i||n===e||(o.$modelValue=e?t:void 0,o.$modelValue!==r&&o.$$writeModelToScope())}))}},$$runValidators:function(e,t,n){this.$$currentValidationRunId++;var r,i,o=this.$$currentValidationRunId,a=this;(function(){var e=a.$$parserName;if(!N(a.$$parserValid))return a.$$parserValid||($(a.$validators,(function(e,t){s(t,null)})),$(a.$asyncValidators,(function(e,t){s(t,null)}))),s(e,a.$$parserValid),a.$$parserValid;s(e,null);return!0})()?!function(){var n=!0;if($(a.$validators,(function(r,i){var o=Boolean(r(e,t));n=n&&o,s(i,o)})),!n)return $(a.$asyncValidators,(function(e,t){s(t,null)})),!1;return!0}()?c(!1):(r=[],i=!0,$(a.$asyncValidators,(function(n,o){var a=n(e,t);if(!X(a))throw Zo("nopromise","Expected asynchronous validator to return a promise but got '{0}' instead.",a);s(o,void 0),r.push(a.then((function(){s(o,!0)}),(function(){i=!1,s(o,!1)})))})),r.length?a.$$q.all(r).then((function(){c(i)}),P):c(!0)):c(!1);function s(e,t){o===a.$$currentValidationRunId&&a.$setValidity(e,t)}function c(e){o===a.$$currentValidationRunId&&n(e)}},$commitViewValue:function(){var e=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce),(this.$$lastCommittedViewValue!==e||""===e&&this.$$hasNativeValidators)&&(this.$$updateEmptyClasses(e),this.$$lastCommittedViewValue=e,this.$pristine&&this.$setDirty(),this.$$parseAndValidate())},$$parseAndValidate:function(){var e=this.$$lastCommittedViewValue,t=this;if(this.$$parserValid=!N(e)||void 0,this.$setValidity(this.$$parserName,null),this.$$parserName="parse",this.$$parserValid)for(var n=0;n<this.$parsers.length;n++)if(N(e=this.$parsers[n](e))){this.$$parserValid=!1;break}D(this.$modelValue)&&(this.$modelValue=this.$$ngModelGet(this.$$scope));var r=this.$modelValue,i=this.$options.getOption("allowInvalid");function o(){t.$modelValue!==r&&t.$$writeModelToScope()}this.$$rawModelValue=e,i&&(this.$modelValue=e,o()),this.$$runValidators(e,this.$$lastCommittedViewValue,(function(n){i||(t.$modelValue=n?e:void 0,o())}))},$$writeModelToScope:function(){this.$$ngModelSet(this.$$scope,this.$modelValue),$(this.$viewChangeListeners,(function(e){try{e()}catch(e){this.$$exceptionHandler(e)}}),this)},$setViewValue:function(e,t){this.$viewValue=e,this.$options.getOption("updateOnDefault")&&this.$$debounceViewValueCommit(t)},$$debounceViewValueCommit:function(e){var t=this.$options.getOption("debounce");z(t[e])?t=t[e]:z(t.default)&&-1===this.$options.getOption("updateOn").indexOf(e)?t=t.default:z(t["*"])&&(t=t["*"]),this.$$timeout.cancel(this.$$pendingDebounce);var n=this;t>0?this.$$pendingDebounce=this.$$timeout((function(){n.$commitViewValue()}),t):this.$$rootScope.$$phase?this.$commitViewValue():this.$$scope.$apply((function(){n.$commitViewValue()}))},$overrideModelOptions:function(e){this.$options=this.$options.createChild(e),this.$$setUpdateOnEvents()},$processModelValue:function(){var e=this.$$format();this.$viewValue!==e&&(this.$$updateEmptyClasses(e),this.$viewValue=this.$$lastCommittedViewValue=e,this.$render(),this.$$runValidators(this.$modelValue,this.$viewValue,P))},$$format:function(){for(var e=this.$formatters,t=e.length,n=this.$modelValue;t--;)n=e[t](n);return n},$$setModelValue:function(e){this.$modelValue=this.$$rawModelValue=e,this.$$parserValid=void 0,this.$processModelValue()},$$setUpdateOnEvents:function(){this.$$updateEvents&&this.$$element.off(this.$$updateEvents,this.$$updateEventHandler),this.$$updateEvents=this.$options.getOption("updateOn"),this.$$updateEvents&&this.$$element.on(this.$$updateEvents,this.$$updateEventHandler)},$$updateEventHandler:function(e){this.$$debounceViewValueCommit(e&&e.type)}},Qi({clazz:Xo,set:function(e,t){e[t]=!0},unset:function(e,t){delete e[t]}});var Qo,ea=["$rootScope",function(e){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Xo,priority:1,compile:function(t){return t.addClass(Go).addClass("ng-untouched").addClass(qo),{pre:function(e,t,n,r){var i=r[0],o=r[1]||i.$$parentForm,a=r[2];a&&(i.$options=a.$options),i.$$initGetterSetters(),o.$addControl(i),n.$observe("name",(function(e){i.$name!==e&&i.$$parentForm.$$renameControl(i,e)})),e.$on("$destroy",(function(){i.$$parentForm.$removeControl(i)}))},post:function(t,n,r,i){var o=i[0];function a(){o.$setTouched()}o.$$setUpdateOnEvents(),n.on("blur",(function(){o.$touched||(e.$$phase?t.$evalAsync(a):t.$apply(a))}))}}}}}],ta=/(\s+|^)default(\s+|$)/;function na(e){this.$$options=e}na.prototype={getOption:function(e){return this.$$options[e]},createChild:function(e){var t=!1;return $(e=I({},e),(function(n,r){"$inherit"===n?"*"===r?t=!0:(e[r]=this.$$options[r],"updateOn"===r&&(e.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===r&&(e.updateOnDefault=!1,e[r]=ee(n.replace(ta,(function(){return e.updateOnDefault=!0," "}))))}),this),t&&(delete e["*"],ia(e,this.$$options)),ia(e,Qo.$$options),new na(e)}},Qo=new na({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var ra=function(){function e(e,t){this.$$attrs=e,this.$$scope=t}return e.$inject=["$attrs","$scope"],e.prototype={$onInit:function(){var e=this.parentCtrl?this.parentCtrl.$options:Qo,t=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=e.createChild(t)}},{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:e}};function ia(e,t){$(t,(function(t,n){L(e[n])||(e[n]=t)}))}var oa=zi({terminal:!0,priority:1e3}),aa=i("ngOptions"),sa=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,ca=["$compile","$document","$parse",function(t,n,r){var i=e.document.createElement("option"),o=e.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(e,t,n,r){r[0].registerOption=P},post:function(e,s,c,u){for(var l=u[0],f=u[1],d=c.multiple,p=0,h=s.children(),v=h.length;p<v;p++)if(""===h[p].value){l.hasEmptyOption=!0,l.emptyOption=h.eq(p);break}s.empty();var m,y=!!l.emptyOption;a(i.cloneNode(!1)).val("?");var g=function(e,t,n){var i=e.match(sa);if(!i)throw aa("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",e,ke(t));var o=i[5]||i[7],a=i[6],s=/ as /.test(i[0])&&i[1],c=i[9],u=r(i[2]?i[1]:o),l=s&&r(s)||u,f=c&&r(c),d=c?function(e,t){return f(n,t)}:function(e){return Nt(e)},p=function(e,t){return d(e,b(e,t))},h=r(i[2]||i[1]),v=r(i[3]||""),m=r(i[4]||""),y=r(i[8]),g={},b=a?function(e,t){return g[a]=t,g[o]=e,g}:function(e){return g[o]=e,g};function w(e,t,n,r,i){this.selectValue=e,this.viewValue=t,this.label=n,this.group=r,this.disabled=i}function k(e){var t;if(!a&&x(e))t=e;else for(var n in t=[],e)e.hasOwnProperty(n)&&"$"!==n.charAt(0)&&t.push(n);return t}return{trackBy:c,getTrackByValue:p,getWatchables:r(y,(function(e){for(var t=[],r=k(e=e||[]),o=r.length,a=0;a<o;a++){var s=e===r?a:r[a],c=e[s],u=b(c,s),l=d(c,u);if(t.push(l),i[2]||i[1]){var f=h(n,u);t.push(f)}if(i[4]){var p=m(n,u);t.push(p)}}return t})),getOptions:function(){for(var e=[],t={},r=y(n)||[],i=k(r),o=i.length,a=0;a<o;a++){var s=r===i?a:i[a],u=r[s],f=b(u,s),g=l(n,f),x=d(g,f),$=new w(x,g,h(n,f),v(n,f),m(n,f));e.push($),t[x]=$}return{items:e,selectValueMap:t,getOptionFromViewValue:function(e){return t[p(e)]},getViewValueFromOption:function(e){return c?ae(e.viewValue):e.viewValue}}}}}(c.ngOptions,s,e),b=n[0].createDocumentFragment();function w(e,t){var n=i.cloneNode(!1);t.appendChild(n),function(e,t){e.element=t,t.disabled=e.disabled,e.label!==t.label&&(t.label=e.label,t.textContent=e.label);t.value=e.selectValue}(e,n)}function k(e){var t=m.getOptionFromViewValue(e),n=t&&t.element;return n&&!n.selected&&(n.selected=!0),t}l.generateUnknownOptionValue=function(e){return"?"},d?(l.writeValue=function(e){if(m){var t=e&&e.map(k)||[];m.items.forEach((function(e){e.element.selected&&!ie(t,e)&&(e.element.selected=!1)}))}},l.readValue=function(){var e=s.val()||[],t=[];return $(e,(function(e){var n=m.selectValueMap[e];n&&!n.disabled&&t.push(m.getViewValueFromOption(n))})),t},g.trackBy&&e.$watchCollection((function(){if(W(f.$viewValue))return f.$viewValue.map((function(e){return g.getTrackByValue(e)}))}),(function(){f.$render()}))):(l.writeValue=function(e){if(m){var t=s[0].options[s[0].selectedIndex],n=m.getOptionFromViewValue(e);t&&t.removeAttribute("selected"),n?(s[0].value!==n.selectValue&&(l.removeUnknownOption(),s[0].value=n.selectValue,n.element.selected=!0),n.element.setAttribute("selected","selected")):l.selectUnknownOrEmptyOption(e)}},l.readValue=function(){var e=m.selectValueMap[s.val()];return e&&!e.disabled?(l.unselectEmptyOption(),l.removeUnknownOption(),m.getViewValueFromOption(e)):null},g.trackBy&&e.$watch((function(){return g.getTrackByValue(f.$viewValue)}),(function(){f.$render()}))),y&&(t(l.emptyOption)(e),s.prepend(l.emptyOption),l.emptyOption[0].nodeType===ze?(l.hasEmptyOption=!1,l.registerOption=function(e,t){""===t.val()&&(l.hasEmptyOption=!0,l.emptyOption=t,l.emptyOption.removeClass("ng-scope"),f.$render(),t.on("$destroy",(function(){var e=l.$isEmptyOptionSelected();l.hasEmptyOption=!1,l.emptyOption=void 0,e&&f.$render()})))}):l.emptyOption.removeClass("ng-scope")),e.$watchCollection(g.getWatchables,(function(){var e=m&&l.readValue();if(m)for(var t=m.items.length-1;t>=0;t--){var n=m.items[t];L(n.group)?At(n.element.parentNode):At(n.element)}m=g.getOptions();var r={};if(m.items.forEach((function(e){var t;L(e.group)?((t=r[e.group])||(t=o.cloneNode(!1),b.appendChild(t),t.label=null===e.group?"null":e.group,r[e.group]=t),w(e,t)):w(e,b)})),s[0].appendChild(b),f.$render(),!f.$isEmpty(e)){var i=l.readValue();(g.trackBy||d?ce(e,i):e===i)||(f.$setViewValue(i),f.$render())}}))}}}}],ua=["$locale","$interpolate","$log",function(e,t,n){var r=/{}/g,i=/^when(Minus)?(.+)$/;return{link:function(o,a,s){var c,u=s.count,l=s.$attr.when&&a.attr(s.$attr.when),f=s.offset||0,p=o.$eval(l)||{},h={},v=t.startSymbol(),m=t.endSymbol(),y=v+u+"-"+f+m,g=w.noop;function b(e){a.text(e||"")}$(s,(function(e,t){var n=i.exec(t);if(n){var r=(n[1]?"-":"")+d(n[2]);p[r]=a.attr(s.$attr[t])}})),$(p,(function(e,n){h[n]=t(e.replace(r,y))})),o.$watch(u,(function(t){var r=parseFloat(t),i=D(r);if(i||r in p||(r=e.pluralCat(r-f)),!(r===c||i&&D(c))){g();var a=h[r];N(a)?(null!=t&&n.debug("ngPluralize: no rule defined for '"+r+"' in "+l),g=P,b()):g=o.$watch(a,b),c=r}}))}}}],la=i("ngRef"),fa=["$parse",function(e){return{priority:-1,restrict:"A",compile:function(t,n){var r=wn(re(t)),i=e(n.ngRef),o=i.assign||function(){throw la("nonassign",'Expression in ngRef="{0}" is non-assignable!',n.ngRef)};return function(e,t,a){var s;if(a.hasOwnProperty("ngRefRead")){if("$element"===a.ngRefRead)s=t;else if(!(s=t.data("$"+a.ngRefRead+"Controller")))throw la("noctrl",'The controller for ngRefRead="{0}" could not be found on ngRef="{1}"',a.ngRefRead,n.ngRef)}else s=t.data("$"+r+"Controller");o(e,s=s||t),t.on("$destroy",(function(){i(e)===s&&o(e,null)}))}}}}],da=["$parse","$animate","$compile",function(e,t,n){var r=i("ngRepeat"),o=function(e,t,n,r,i,o,a){e[n]=r,i&&(e[i]=o),e.$index=t,e.$first=0===t,e.$last=t===a-1,e.$middle=!(e.$first||e.$last),e.$odd=!(e.$even=0==(1&t))},a=function(e){return e.clone[0]},s=function(e){return e.clone[e.clone.length-1]},c=function(e,t,n){return Nt(n)},u=function(e,t){return t};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(i,l){var d=l.ngRepeat,p=n.$$createComment("end ngRepeat",d),h=d.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!h)throw r("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",d);var v=h[1],m=h[2],y=h[3],g=h[4];if(!(h=v.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/)))throw r("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",v);var b,w=h[3]||h[1],k=h[2];if(y&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(y)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(y)))throw r("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",y);if(g){var _={$id:Nt},S=e(g);b=function(e,t,n,r){return k&&(_[k]=t),_[w]=n,_.$index=r,S(e,_)}}return function(e,n,i,l,h){var v=Le();e.$watchCollection(m,(function(i){var l,m,g,S,M,C,A,I,E,O,D,R,P=n[0],T=Le();if(y&&(e[y]=i),x(i))E=i,I=b||c;else for(var j in I=b||u,E=[],i)f.call(i,j)&&"$"!==j.charAt(0)&&E.push(j);for(S=E.length,D=new Array(S),l=0;l<S;l++)if(M=i===E?l:E[l],C=i[M],A=I(e,M,C,l),v[A])O=v[A],delete v[A],T[A]=O,D[l]=O;else{if(T[A])throw $(D,(function(e){e&&e.scope&&(v[e.id]=e)})),r("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",d,A,C);D[l]={id:A,scope:void 0,clone:void 0},T[A]=!0}for(var F in _&&(_[w]=void 0),v){if(R=Ne((O=v[F]).clone),t.leave(R),R[0].parentNode)for(l=0,m=R.length;l<m;l++)R[l].$$NG_REMOVED=!0;O.scope.$destroy()}for(l=0;l<S;l++)if(M=i===E?l:E[l],C=i[M],(O=D[l]).scope){g=P;do{g=g.nextSibling}while(g&&g.$$NG_REMOVED);a(O)!==g&&t.move(Ne(O.clone),null,P),P=s(O),o(O.scope,l,w,C,k,M,S)}else h((function(e,n){O.scope=n;var r=p.cloneNode(!1);e[e.length++]=r,t.enter(e,null,P),P=r,O.clone=e,T[O.id]=O,o(O.scope,l,w,C,k,M,S)}));v=T}))}}}}],pa=["$animate",function(e){return{restrict:"A",multiElement:!0,link:function(t,n,r){t.$watch(r.ngShow,(function(t){e[t?"removeClass":"addClass"](n,"ng-hide",{tempClasses:"ng-hide-animate"})}))}}}],ha=["$animate",function(e){return{restrict:"A",multiElement:!0,link:function(t,n,r){t.$watch(r.ngHide,(function(t){e[t?"addClass":"removeClass"](n,"ng-hide",{tempClasses:"ng-hide-animate"})}))}}}],va=zi((function(e,t,n){e.$watchCollection(n.ngStyle,(function(e,n){n&&e!==n&&$(n,(function(e,n){t.css(n,"")})),e&&t.css(e)}))})),ma=["$animate","$compile",function(e,t){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(n,r,i,o){var a=i.ngSwitch||i.on,s=[],c=[],u=[],l=[],f=function(e,t){return function(n){!1!==n&&e.splice(t,1)}};n.$watch(a,(function(n){for(var r,i;u.length;)e.cancel(u.pop());for(r=0,i=l.length;r<i;++r){var a=Ne(c[r].clone);l[r].$destroy(),(u[r]=e.leave(a)).done(f(u,r))}c.length=0,l.length=0,(s=o.cases["!"+n]||o.cases["?"])&&$(s,(function(n){n.transclude((function(r,i){l.push(i);var o=n.element;r[r.length++]=t.$$createComment("end ngSwitchWhen");var a={clone:r};c.push(a),e.enter(r,o.parent(),o)}))}))}))}}}],ya=zi({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,n,r,i){$(n.ngSwitchWhen.split(n.ngSwitchWhenSeparator).sort().filter((function(e,t,n){return n[t-1]!==e})),(function(e){r.cases["!"+e]=r.cases["!"+e]||[],r.cases["!"+e].push({transclude:i,element:t})}))}}),ga=zi({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,n,r,i){r.cases["?"]=r.cases["?"]||[],r.cases["?"].push({transclude:i,element:t})}}),ba=i("ngTransclude"),wa=["$compile",function(e){return{restrict:"EAC",compile:function(t){var n=e(t.contents());return t.empty(),function(e,t,r,i,o){if(!o)throw ba("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",ke(t));r.ngTransclude===r.$attr.ngTransclude&&(r.ngTransclude="");var a=r.ngTransclude||r.ngTranscludeSlot;function s(){n(e,(function(e){t.append(e)}))}o((function(e,n){e.length&&function(e){for(var t=0,n=e.length;t<n;t++){var r=e[t];if(r.nodeType!==He||r.nodeValue.trim())return!0}}(e)?t.append(e):(s(),n.$destroy())}),null,a),a&&!o.isSlotFilled(a)&&s()}}}}],ka=["$templateCache",function(e){return{restrict:"E",terminal:!0,compile:function(t,n){if("text/ng-template"===n.type){var r=n.id,i=t[0].text;e.put(r,i)}}}}],xa={$setViewValue:P,$render:P};function $a(e,t){e.prop("selected",t),e.attr("selected",t)}var _a=["$element","$scope",function(t,n){var r=this,i=new Bt;r.selectValueMap={},r.ngModelCtrl=xa,r.multiple=!1,r.unknownOption=a(e.document.createElement("option")),r.hasEmptyOption=!1,r.emptyOption=void 0,r.renderUnknownOption=function(e){var n=r.generateUnknownOptionValue(e);r.unknownOption.val(n),t.prepend(r.unknownOption),$a(r.unknownOption,!0),t.val(n)},r.updateUnknownOption=function(e){var n=r.generateUnknownOptionValue(e);r.unknownOption.val(n),$a(r.unknownOption,!0),t.val(n)},r.generateUnknownOptionValue=function(e){return"? "+Nt(e)+" ?"},r.removeUnknownOption=function(){r.unknownOption.parent()&&r.unknownOption.remove()},r.selectEmptyOption=function(){r.emptyOption&&(t.val(""),$a(r.emptyOption,!0))},r.unselectEmptyOption=function(){r.hasEmptyOption&&$a(r.emptyOption,!1)},n.$on("$destroy",(function(){r.renderUnknownOption=P})),r.readValue=function(){var e=t.val(),n=e in r.selectValueMap?r.selectValueMap[e]:e;return r.hasOption(n)?n:null},r.writeValue=function(e){var n=t[0].options[t[0].selectedIndex];if(n&&$a(a(n),!1),r.hasOption(e)){r.removeUnknownOption();var i=Nt(e);t.val(i in r.selectValueMap?i:e);var o=t[0].options[t[0].selectedIndex];$a(a(o),!0)}else r.selectUnknownOrEmptyOption(e)},r.addOption=function(e,t){if(t[0].nodeType!==ze){Fe(e,'"option value"'),""===e&&(r.hasEmptyOption=!0,r.emptyOption=t);var n=i.get(e)||0;i.set(e,n+1),s()}},r.removeOption=function(e){var t=i.get(e);t&&(1===t?(i.delete(e),""===e&&(r.hasEmptyOption=!1,r.emptyOption=void 0)):i.set(e,t-1))},r.hasOption=function(e){return!!i.get(e)},r.$hasEmptyOption=function(){return r.hasEmptyOption},r.$isUnknownOptionSelected=function(){return t[0].options[0]===r.unknownOption[0]},r.$isEmptyOptionSelected=function(){return r.hasEmptyOption&&t[0].options[t[0].selectedIndex]===r.emptyOption[0]},r.selectUnknownOrEmptyOption=function(e){null==e&&r.emptyOption?(r.removeUnknownOption(),r.selectEmptyOption()):r.unknownOption.parent().length?r.updateUnknownOption(e):r.renderUnknownOption(e)};var o=!1;function s(){o||(o=!0,n.$$postDigest((function(){o=!1,r.ngModelCtrl.$render()})))}var c=!1;function u(e){c||(c=!0,n.$$postDigest((function(){n.$$destroyed||(c=!1,r.ngModelCtrl.$setViewValue(r.readValue()),e&&r.ngModelCtrl.$render())})))}r.registerOption=function(e,t,n,i,o){var a,c;n.$attr.ngValue?n.$observe("value",(function(e){var n,i=t.prop("selected");L(c)&&(r.removeOption(a),delete r.selectValueMap[c],n=!0),c=Nt(e),a=e,r.selectValueMap[c]=e,r.addOption(e,t),t.attr("value",c),n&&i&&u()})):i?n.$observe("value",(function(e){var n;r.readValue();var i=t.prop("selected");L(a)&&(r.removeOption(a),n=!0),a=e,r.addOption(e,t),n&&i&&u()})):o?e.$watch(o,(function(e,i){n.$set("value",e);var o=t.prop("selected");i!==e&&r.removeOption(i),r.addOption(e,t),i&&o&&u()})):r.addOption(n.value,t);n.$observe("disabled",(function(e){("true"===e||e&&t.prop("selected"))&&(r.multiple?u(!0):(r.ngModelCtrl.$setViewValue(null),r.ngModelCtrl.$render()))})),t.on("$destroy",(function(){var e=r.readValue(),t=n.value;r.removeOption(t),s(),(r.multiple&&e&&-1!==e.indexOf(t)||e===t)&&u(!0)}))}}],Sa=function(){return{restrict:"E",require:["select","?ngModel"],controller:_a,priority:1,link:{pre:function(e,t,n,r){var i=r[0],o=r[1];if(!o)return void(i.registerOption=P);if(i.ngModelCtrl=o,t.on("change",(function(){i.removeUnknownOption(),e.$apply((function(){o.$setViewValue(i.readValue())}))})),n.multiple){i.multiple=!0,i.readValue=function(){var e=[];return $(t.find("option"),(function(t){if(t.selected&&!t.disabled){var n=t.value;e.push(n in i.selectValueMap?i.selectValueMap[n]:n)}})),e},i.writeValue=function(e){$(t.find("option"),(function(t){var n=!!e&&(ie(e,t.value)||ie(e,i.selectValueMap[t.value]));n!==t.selected&&$a(a(t),n)}))};var s,c=NaN;e.$watch((function(){c!==o.$viewValue||ce(s,o.$viewValue)||(s=Ke(o.$viewValue),o.$render()),c=o.$viewValue})),o.$isEmpty=function(e){return!e||0===e.length}}},post:function(e,t,n,r){var i=r[1];if(!i)return;var o=r[0];i.$render=function(){o.writeValue(i.$viewValue)}}}}},Ma=["$interpolate",function(e){return{restrict:"E",priority:100,compile:function(t,n){var r,i;return L(n.ngValue)||(L(n.value)?r=e(n.value,!0):(i=e(t.text(),!0))||n.$set("value",t.text())),function(e,t,n){var o=t.parent(),a=o.data("$selectController")||o.parent().data("$selectController");a&&a.registerOption(e,t,n,r,i)}}}}],Ca=["$parse",function(e){return{restrict:"A",require:"?ngModel",link:function(t,n,r,i){if(i){var o=r.hasOwnProperty("required")||e(r.ngRequired)(t);r.ngRequired||(r.required=!0),i.$validators.required=function(e,t){return!o||!i.$isEmpty(t)},r.$observe("required",(function(e){o!==e&&(o=e,i.$validate())}))}}}}],Aa=["$parse",function(e){return{restrict:"A",require:"?ngModel",compile:function(t,n){var r,i;return n.ngPattern&&(r=n.ngPattern,i="/"===n.ngPattern.charAt(0)&&u.test(n.ngPattern)?function(){return n.ngPattern}:e(n.ngPattern)),function(e,t,n,o){if(o){var a=n.pattern;n.ngPattern?a=i(e):r=n.pattern;var s=Oa(a,r,t);n.$observe("pattern",(function(e){var n=s;s=Oa(e,r,t),(n&&n.toString())!==(s&&s.toString())&&o.$validate()})),o.$validators.pattern=function(e,t){return o.$isEmpty(t)||N(s)||s.test(t)}}}}}}],Ia=["$parse",function(e){return{restrict:"A",require:"?ngModel",link:function(t,n,r,i){if(i){var o=r.maxlength||e(r.ngMaxlength)(t),a=Da(o);r.$observe("maxlength",(function(e){o!==e&&(a=Da(e),o=e,i.$validate())})),i.$validators.maxlength=function(e,t){return a<0||i.$isEmpty(t)||t.length<=a}}}}}],Ea=["$parse",function(e){return{restrict:"A",require:"?ngModel",link:function(t,n,r,i){if(i){var o=r.minlength||e(r.ngMinlength)(t),a=Da(o)||-1;r.$observe("minlength",(function(e){o!==e&&(a=Da(e)||-1,o=e,i.$validate())})),i.$validators.minlength=function(e,t){return i.$isEmpty(t)||t.length>=a}}}}}];function Oa(e,t,n){if(e){if(H(e)&&(e=new RegExp("^"+e+"$")),!e.test)throw i("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",t,e,ke(n));return e}}function Da(e){var t=O(e);return D(t)?-1:t}e.angular.bootstrap?e.console&&console.log("WARNING: Tried to load AngularJS more than once."):(!function(){var t;if(!Pe){var n=le();(s=N(n)?e.jQuery:n?e[n]:void 0)&&s.fn.on?(a=s,I(s.fn,{scope:Et.scope,isolateScope:Et.isolateScope,controller:Et.controller,injector:Et.injector,inheritedData:Et.inheritedData})):a=dt,t=a.cleanData,a.cleanData=function(e){for(var n,r,i=0;null!=(r=e[i]);i++)(n=(a._data(r)||{}).events)&&n.$destroy&&a(r).triggerHandler("$destroy");t(e)},w.element=a,Pe=!0}}(),function(t){I(t,{errorHandlingConfig:n,bootstrap:Ie,copy:ae,extend:I,merge:E,equals:ce,element:a,forEach:$,injector:Zt,noop:P,bind:pe,toJson:ve,fromJson:me,identity:T,isUndefined:N,isDefined:L,isString:H,isFunction:q,isObject:U,isNumber:z,isElement:ne,isArray:W,version:Je,isDate:V,callbacks:{$$counter:0},getTestability:Oe,reloadWithDebugInfo:Ee,$$minErr:i,$$csp:ue,$$encodeUriSegment:_e,$$encodeUriQuery:Se,$$lowercase:d,$$stringify:Ue,$$uppercase:p}),(c=function(e){var t=i("$injector"),n=i("ng");function r(e,t,n){return e[t]||(e[t]=n())}var o=r(e,"angular",Object);return o.$$minErr=o.$$minErr||i,r(o,"module",(function(){var e={};return function(i,o,a){var s={};return function(e,t){if("hasOwnProperty"===e)throw n("badname","hasOwnProperty is not a valid {0} name",t)}(i,"module"),o&&e.hasOwnProperty(i)&&(e[i]=null),r(e,i,(function(){if(!o)throw t("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",i);var e=[],r=[],c=[],u=f("$injector","invoke","push",r),l={_invokeQueue:e,_configBlocks:r,_runBlocks:c,info:function(e){if(L(e)){if(!U(e))throw n("aobj","Argument '{0}' must be an object","value");return s=e,this}return s},requires:o,name:i,provider:d("$provide","provider"),factory:d("$provide","factory"),service:d("$provide","service"),value:f("$provide","value"),constant:f("$provide","constant","unshift"),decorator:d("$provide","decorator",r),animation:d("$animateProvider","register"),filter:d("$filterProvider","register"),controller:d("$controllerProvider","register"),directive:d("$compileProvider","directive"),component:d("$compileProvider","component"),config:u,run:function(e){return c.push(e),this}};return a&&u(a),l;function f(t,n,r,i){return i||(i=e),function(){return i[r||"push"]([t,n,arguments]),l}}function d(t,n,r){return r||(r=e),function(e,o){return o&&q(o)&&(o.$$moduleName=i),r.push([t,n,arguments]),l}}}))}}))}(e))("ng",["ngLocale"],["$provide",function(e){e.provider({$$sanitizeUri:Kr}),e.provider("$compile",mn).directive({a:Vi,input:So,textarea:So,form:Yi,script:ka,select:Sa,option:Ma,ngBind:Io,ngBindHtml:Oo,ngBindTemplate:Eo,ngClass:Po,ngClassEven:jo,ngClassOdd:To,ngCloak:Fo,ngController:No,ngForm:Zi,ngHide:ha,ngIf:Ho,ngInclude:zo,ngInit:Wo,ngNonBindable:oa,ngPluralize:ua,ngRef:fa,ngRepeat:da,ngShow:pa,ngStyle:va,ngSwitch:ma,ngSwitchWhen:ya,ngSwitchDefault:ga,ngOptions:ca,ngTransclude:wa,ngModel:ea,ngList:Ko,ngChange:Do,pattern:Aa,ngPattern:Aa,required:Ca,ngRequired:Ca,minlength:Ea,ngMinlength:Ea,maxlength:Ia,ngMaxlength:Ia,ngValue:Ao,ngModelOptions:ra}).directive({ngInclude:Vo,input:Mo}).directive(Wi).directive(Lo),e.provider({$anchorScroll:Xt,$animate:an,$animateCss:un,$$animateJs:rn,$$animateQueue:on,$$AnimateRunner:cn,$$animateAsyncRun:sn,$browser:fn,$cacheFactory:dn,$controller:Mn,$document:Cn,$$isDocumentHidden:An,$exceptionHandler:In,$filter:yi,$$forceReflow:En,$interpolate:Gn,$interval:Zn,$$intervalFactory:Xn,$http:Wn,$httpParamSerializer:Nn,$httpParamSerializerJQLike:Ln,$httpBackend:qn,$xhrFactory:Kn,$jsonpCallbacks:Qn,$location:mr,$log:yr,$parse:Fr,$rootScope:Wr,$q:Nr,$$q:Lr,$sce:Qr,$sceDelegate:Xr,$sniffer:ei,$$taskTrackerFactory:ti,$templateCache:pn,$templateRequest:ii,$$testability:oi,$timeout:si,$window:hi,$$rAF:Vr,$$jqLite:Ft,$$Map:Ht,$$cookieReader:mi})}]).info({angularVersion:"1.7.9"})}(w),w.module("ngLocale",[],["$provide",function(e){var t="one",n="other";e.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORTDAY:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SHORTMONTH:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],STANDALONEMONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a",short:"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(e,r){var i=0|e,o=function(e,t){var n=t;void 0===n&&(n=Math.min(function(e){var t=(e+="").indexOf(".");return-1==t?0:e.length-t-1}(e),3));var r=Math.pow(10,n);return{v:n,f:(e*r|0)%r}}(e,r);return 1==i&&0==o.v?t:n}})}]),a((function(){Ae(e.document,Ie)})))}(window),!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>')},function(e,t,n){"use strict";var r,i,o,a,s,c,u,l,f,d=angular.$$minErr("$sanitize");angular.module("ngSanitize",[]).provider("$sanitize",(function(){var e=!1,t=!1;this.$get=["$$sanitizeUri",function(n){return e=!0,t&&i(x,w),function(e){var t=[];return l(e,f(t,(function(e,t){return!/^unsafe:/.test(n(e,t))}))),t.join("")}}],this.enableSvg=function(e){return s(e)?(t=e,this):t},this.addValidElements=function(t){return e||(a(t)&&(t={htmlElements:t}),I(w,t.svgElements),I(h,t.htmlVoidElements),I(x,t.htmlVoidElements),I(x,t.htmlElements)),this},this.addValidAttrs=function(t){return e||i(M,A(t,!0)),this},r=angular.bind,i=angular.extend,o=angular.forEach,a=angular.isArray,s=angular.isDefined,c=angular.$$lowercase,angular.noop,l=function(e,t){null==e?e="":"string"!=typeof e&&(e=""+e);var n=E(e);if(!n)return"";var r=5;do{if(0===r)throw d("uinput","Failed to sanitize html because the input is unstable");r--,e=n.innerHTML,n=E(e)}while(e!==n.innerHTML);var i=n.firstChild;for(;i;){switch(i.nodeType){case 1:t.start(i.nodeName.toLowerCase(),O(i.attributes));break;case 3:t.chars(i.textContent)}var o;if(!((o=i.firstChild)||(1===i.nodeType&&t.end(i.nodeName.toLowerCase()),o=P("nextSibling",i))))for(;null==o&&(i=P("parentNode",i))!==n;)o=P("nextSibling",i),1===i.nodeType&&t.end(i.nodeName.toLowerCase());i=o}for(;i=n.firstChild;)n.removeChild(i)},f=function(e,t){var n=!1,i=r(e,e.push);return{start:function(e,r){e=c(e),!n&&k[e]&&(n=e),n||!0!==x[e]||(i("<"),i(e),o(r,(function(n,r){var o=c(r),a="img"===e&&"src"===o||"background"===o;!0!==M[o]||!0===$[o]&&!t(n,a)||(i(" "),i(r),i('="'),i(D(n)),i('"'))})),i(">"))},end:function(e){e=c(e),n||!0!==x[e]||!0===h[e]||(i("</"),i(e),i(">")),e==n&&(n=!1)},chars:function(e){n||i(D(e))}}},u=window.Node.prototype.contains||function(e){return!!(16&this.compareDocumentPosition(e))};var n=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,p=/([^#-~ |!])/g,h=C("area,br,col,hr,img,wbr"),v=C("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),m=C("rp,rt"),y=i({},m,v),g=i({},v,C("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul,progress")),b=i({},m,C("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),w=C("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),k=C("script,style"),x=i({},h,g,b,y),$=C("background,cite,href,longdesc,src,xlink:href,xml:base"),_=C("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width,style"),S=C("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),M=i({},$,S,_);function C(e,t){return A(e.split(","),t)}function A(e,t){var n,r={};for(n=0;n<e.length;n++)r[t?c(e[n]):e[n]]=!0;return r}function I(e,t){t&&t.length&&i(e,A(t))}var E=function(e,t){var n;if(!t||!t.implementation)throw d("noinert","Can't create an inert html document");var r=((n=t.implementation.createHTMLDocument("inert")).documentElement||n.getDocumentElement()).querySelector("body");return r.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>',r.querySelector("svg")?(r.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',r.querySelector("svg img")?function(t){t="<remove></remove>"+t;try{var n=(new e.DOMParser).parseFromString(t,"text/html").body;return n.firstChild.remove(),n}catch(e){return}}:function(e){r.innerHTML=e,t.documentMode&&R(r);return r}):function(t){t="<remove></remove>"+t;try{t=encodeURI(t)}catch(e){return}var n=new e.XMLHttpRequest;n.responseType="document",n.open("GET","data:text/html;charset=utf-8,"+t,!1),n.send(null);var r=n.response.body;return r.firstChild.remove(),r}}(window,window.document);function O(e){for(var t={},n=0,r=e.length;n<r;n++){var i=e[n];t[i.name]=i.value}return t}function D(e){return e.replace(/&/g,"&amp;").replace(n,(function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"})).replace(p,(function(e){return"&#"+e.charCodeAt(0)+";"})).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function R(e){for(;e;){if(e.nodeType===window.Node.ELEMENT_NODE)for(var t=e.attributes,n=0,r=t.length;n<r;n++){var i=t[n],o=i.name.toLowerCase();"xmlns:ns1"!==o&&0!==o.lastIndexOf("ns1:",0)||(e.removeAttributeNode(i),n--,r--)}var a=e.firstChild;a&&R(a),e=P("nextSibling",e)}}function P(e,t){var n=t[e];if(n&&u.call(t,n))throw d("elclob","Failed to sanitize html because the element is clobbered: {0}",t.outerHTML||t.outerText);return n}})).info({angularVersion:'"NG_VERSION_FULL"'})},function(e,t){!function(e){"use strict";var t=15,n=30,r=19,i=256,o=i+1+29,a=2*o+1,s=256,c=16,u=17,l=18,f=16,d=-1,p=1,h=2,v=0,m=0,y=1,g=3,b=4,w=0,k=1,x=2,$=-2,_=-3,S=-5,M=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function C(){var e=this;function n(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.build_tree=function(r){var i,o,s,c=e.dyn_tree,u=e.stat_desc.static_tree,l=e.stat_desc.elems,f=-1;for(r.heap_len=0,r.heap_max=a,i=0;i<l;i++)0!==c[2*i]?(r.heap[++r.heap_len]=f=i,r.depth[i]=0):c[2*i+1]=0;for(;r.heap_len<2;)c[2*(s=r.heap[++r.heap_len]=f<2?++f:0)]=1,r.depth[s]=0,r.opt_len--,u&&(r.static_len-=u[2*s+1]);for(e.max_code=f,i=Math.floor(r.heap_len/2);i>=1;i--)r.pqdownheap(c,i);s=l;do{i=r.heap[1],r.heap[1]=r.heap[r.heap_len--],r.pqdownheap(c,1),o=r.heap[1],r.heap[--r.heap_max]=i,r.heap[--r.heap_max]=o,c[2*s]=c[2*i]+c[2*o],r.depth[s]=Math.max(r.depth[i],r.depth[o])+1,c[2*i+1]=c[2*o+1]=s,r.heap[1]=s++,r.pqdownheap(c,1)}while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],function(n){var r,i,o,s,c,u,l=e.dyn_tree,f=e.stat_desc.static_tree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,h=e.stat_desc.max_length,v=0;for(s=0;s<=t;s++)n.bl_count[s]=0;for(l[2*n.heap[n.heap_max]+1]=0,r=n.heap_max+1;r<a;r++)(s=l[2*l[2*(i=n.heap[r])+1]+1]+1)>h&&(s=h,v++),l[2*i+1]=s,i>e.max_code||(n.bl_count[s]++,c=0,i>=p&&(c=d[i-p]),u=l[2*i],n.opt_len+=u*(s+c),f&&(n.static_len+=u*(f[2*i+1]+c)));if(0!==v){do{for(s=h-1;0===n.bl_count[s];)s--;n.bl_count[s]--,n.bl_count[s+1]+=2,n.bl_count[h]--,v-=2}while(v>0);for(s=h;0!==s;s--)for(i=n.bl_count[s];0!==i;)(o=n.heap[--r])>e.max_code||(l[2*o+1]!=s&&(n.opt_len+=(s-l[2*o+1])*l[2*o],l[2*o+1]=s),i--)}}(r),function(e,r,i){var o,a,s,c=[],u=0;for(o=1;o<=t;o++)c[o]=u=u+i[o-1]<<1;for(a=0;a<=r;a++)0!==(s=e[2*a+1])&&(e[2*a]=n(c[s]++,s))}(c,e.max_code,r.bl_count)}}function A(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i}C._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],C.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],C.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],C.d_code=function(e){return e<256?M[e]:M[256+(e>>>7)]},C.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],C.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],A.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],A.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],A.static_l_desc=new A(A.static_ltree,C.extra_lbits,i+1,o,t),A.static_d_desc=new A(A.static_dtree,C.extra_dbits,0,n,t),A.static_bl_desc=new A(null,C.extra_blbits,0,r,7);var I=9,E=8;function O(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var D=0,R=1,P=2,T=[new O(0,0,0,0,D),new O(4,4,8,4,R),new O(4,5,16,8,R),new O(4,6,32,32,R),new O(4,4,16,16,P),new O(8,16,32,32,P),new O(8,16,128,128,P),new O(8,32,128,256,P),new O(32,128,258,1024,P),new O(32,258,258,4096,P)],j=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],F=0,N=1,L=2,U=3,B=32,H=42,z=113,V=666,W=8,K=0,q=1,J=2,G=3,Y=258,Z=Y+G+1;function X(e,t,n,r){var i=e[2*t],o=e[2*n];return i<o||i==o&&r[t]<=r[n]}function Q(){var e,t,a,M,O,Q,ee,te,ne,re,ie,oe,ae,se,ce,ue,le,fe,de,pe,he,ve,me,ye,ge,be,we,ke,xe,$e,_e,Se,Me,Ce,Ae,Ie,Ee,Oe,De,Re,Pe,Te=this,je=new C,Fe=new C,Ne=new C;function Le(){var e;for(e=0;e<o;e++)_e[2*e]=0;for(e=0;e<n;e++)Se[2*e]=0;for(e=0;e<r;e++)Me[2*e]=0;_e[2*s]=1,Te.opt_len=Te.static_len=0,Ie=Oe=0}function Ue(e,t){var n,r,i=-1,o=e[1],a=0,s=7,f=4;for(0===o&&(s=138,f=3),e[2*(t+1)+1]=65535,n=0;n<=t;n++)r=o,o=e[2*(n+1)+1],++a<s&&r==o||(a<f?Me[2*r]+=a:0!==r?(r!=i&&Me[2*r]++,Me[2*c]++):a<=10?Me[2*u]++:Me[2*l]++,a=0,i=r,0===o?(s=138,f=3):r==o?(s=6,f=3):(s=7,f=4))}function Be(e){Te.pending_buf[Te.pending++]=e}function He(e){Be(255&e),Be(e>>>8&255)}function ze(e,t){var n,r=t;Pe>f-r?(He(Re|=(n=e)<<Pe&65535),Re=n>>>f-Pe,Pe+=r-f):(Re|=e<<Pe&65535,Pe+=r)}function Ve(e,t){var n=2*e;ze(65535&t[n],65535&t[n+1])}function We(e,t){var n,r,i=-1,o=e[1],a=0,s=7,f=4;for(0===o&&(s=138,f=3),n=0;n<=t;n++)if(r=o,o=e[2*(n+1)+1],!(++a<s&&r==o)){if(a<f)do{Ve(r,Me)}while(0!=--a);else 0!==r?(r!=i&&(Ve(r,Me),a--),Ve(c,Me),ze(a-3,2)):a<=10?(Ve(u,Me),ze(a-3,3)):(Ve(l,Me),ze(a-11,7));a=0,i=r,0===o?(s=138,f=3):r==o?(s=6,f=3):(s=7,f=4)}}function Ke(){16==Pe?(He(Re),Re=0,Pe=0):Pe>=8&&(Be(255&Re),Re>>>=8,Pe-=8)}function qe(e,t){var r,o,a;if(Te.pending_buf[Ee+2*Ie]=e>>>8&255,Te.pending_buf[Ee+2*Ie+1]=255&e,Te.pending_buf[Ce+Ie]=255&t,Ie++,0===e?_e[2*t]++:(Oe++,e--,_e[2*(C._length_code[t]+i+1)]++,Se[2*C.d_code(e)]++),0==(8191&Ie)&&we>2){for(r=8*Ie,o=he-le,a=0;a<n;a++)r+=Se[2*a]*(5+C.extra_dbits[a]);if(r>>>=3,Oe<Math.floor(Ie/2)&&r<Math.floor(o/2))return!0}return Ie==Ae-1}function Je(e,t){var n,r,o,a,c=0;if(0!==Ie)do{n=Te.pending_buf[Ee+2*c]<<8&65280|255&Te.pending_buf[Ee+2*c+1],r=255&Te.pending_buf[Ce+c],c++,0===n?Ve(r,e):(Ve((o=C._length_code[r])+i+1,e),0!==(a=C.extra_lbits[o])&&ze(r-=C.base_length[o],a),n--,Ve(o=C.d_code(n),t),0!==(a=C.extra_dbits[o])&&ze(n-=C.base_dist[o],a))}while(c<Ie);Ve(s,e),De=e[2*s+1]}function Ge(){Pe>8?He(Re):Pe>0&&Be(255&Re),Re=0,Pe=0}function Ye(e,t,n){ze((K<<1)+(n?1:0),3),function(e,t,n){Ge(),De=8,n&&(He(t),He(~t)),Te.pending_buf.set(te.subarray(e,e+t),Te.pending),Te.pending+=t}(e,t,!0)}function Ze(e,t,n){var i,o,a=0;we>0?(je.build_tree(Te),Fe.build_tree(Te),a=function(){var e;for(Ue(_e,je.max_code),Ue(Se,Fe.max_code),Ne.build_tree(Te),e=r-1;e>=3&&0===Me[2*C.bl_order[e]+1];e--);return Te.opt_len+=3*(e+1)+5+5+4,e}(),i=Te.opt_len+3+7>>>3,(o=Te.static_len+3+7>>>3)<=i&&(i=o)):i=o=t+5,t+4<=i&&-1!=e?Ye(e,t,n):o==i?(ze((q<<1)+(n?1:0),3),Je(A.static_ltree,A.static_dtree)):(ze((J<<1)+(n?1:0),3),function(e,t,n){var r;for(ze(e-257,5),ze(t-1,5),ze(n-4,4),r=0;r<n;r++)ze(Me[2*C.bl_order[r]+1],3);We(_e,e-1),We(Se,t-1)}(je.max_code+1,Fe.max_code+1,a+1),Je(_e,Se)),Le(),n&&Ge()}function Xe(t){Ze(le>=0?le:-1,he-le,t),le=he,e.flush_pending()}function Qe(){var t,n,r,i;do{if(0===(i=ne-me-he)&&0===he&&0===me)i=O;else if(-1==i)i--;else if(he>=O+O-Z){te.set(te.subarray(O,O+O),0),ve-=O,he-=O,le-=O,r=t=ae;do{n=65535&ie[--r],ie[r]=n>=O?n-O:0}while(0!=--t);r=t=O;do{n=65535&re[--r],re[r]=n>=O?n-O:0}while(0!=--t);i+=O}if(0===e.avail_in)return;t=e.read_buf(te,he+me,i),(me+=t)>=G&&(oe=((oe=255&te[he])<<ue^255&te[he+1])&ce)}while(me<Z&&0!==e.avail_in)}function et(e){var t,n,r=ge,i=he,o=ye,a=he>O-Z?he-(O-Z):0,s=$e,c=ee,u=he+Y,l=te[i+o-1],f=te[i+o];ye>=xe&&(r>>=2),s>me&&(s=me);do{if(te[(t=e)+o]==f&&te[t+o-1]==l&&te[t]==te[i]&&te[++t]==te[i+1]){i+=2,t++;do{}while(te[++i]==te[++t]&&te[++i]==te[++t]&&te[++i]==te[++t]&&te[++i]==te[++t]&&te[++i]==te[++t]&&te[++i]==te[++t]&&te[++i]==te[++t]&&te[++i]==te[++t]&&i<u);if(n=Y-(u-i),i=u-Y,n>o){if(ve=e,o=n,n>=s)break;l=te[i+o-1],f=te[i+o]}}}while((e=65535&re[e&c])>a&&0!=--r);return o<=me?o:me}function tt(e){return e.total_in=e.total_out=0,e.msg=null,Te.pending=0,Te.pending_out=0,t=z,M=m,je.dyn_tree=_e,je.stat_desc=A.static_l_desc,Fe.dyn_tree=Se,Fe.stat_desc=A.static_d_desc,Ne.dyn_tree=Me,Ne.stat_desc=A.static_bl_desc,Re=0,Pe=0,De=8,Le(),function(){var e;for(ne=2*O,ie[ae-1]=0,e=0;e<ae-1;e++)ie[e]=0;be=T[we].max_lazy,xe=T[we].good_length,$e=T[we].nice_length,ge=T[we].max_chain,he=0,le=0,me=0,fe=ye=G-1,pe=0,oe=0}(),w}Te.depth=[],Te.bl_count=[],Te.heap=[],_e=[],Se=[],Me=[],Te.pqdownheap=function(e,t){for(var n=Te.heap,r=n[t],i=t<<1;i<=Te.heap_len&&(i<Te.heap_len&&X(e,n[i+1],n[i],Te.depth)&&i++,!X(e,r,n[i],Te.depth));)n[t]=n[i],t=i,i<<=1;n[t]=r},Te.deflateInit=function(e,t,n,r,i,o){return r||(r=W),i||(i=E),o||(o=v),e.msg=null,t==d&&(t=6),i<1||i>I||r!=W||n<9||n>15||t<0||t>9||o<0||o>h?$:(e.dstate=Te,ee=(O=1<<(Q=n))-1,ce=(ae=1<<(se=i+7))-1,ue=Math.floor((se+G-1)/G),te=new Uint8Array(2*O),re=[],ie=[],Ae=1<<i+6,Te.pending_buf=new Uint8Array(4*Ae),a=4*Ae,Ee=Math.floor(Ae/2),Ce=3*Ae,we=t,ke=o,255&r,tt(e))},Te.deflateEnd=function(){return t!=H&&t!=z&&t!=V?$:(Te.pending_buf=null,ie=null,re=null,te=null,Te.dstate=null,t==z?_:w)},Te.deflateParams=function(e,t,n){var r=w;return t==d&&(t=6),t<0||t>9||n<0||n>h?$:(T[we].func!=T[t].func&&0!==e.total_in&&(r=e.deflate(y)),we!=t&&(be=T[we=t].max_lazy,xe=T[we].good_length,$e=T[we].nice_length,ge=T[we].max_chain),ke=n,r)},Te.deflateSetDictionary=function(e,n,r){var i,o=r,a=0;if(!n||t!=H)return $;if(o<G)return w;for(o>O-Z&&(a=r-(o=O-Z)),te.set(n.subarray(a,a+o),0),he=o,le=o,oe=((oe=255&te[0])<<ue^255&te[1])&ce,i=0;i<=o-G;i++)oe=(oe<<ue^255&te[i+(G-1)])&ce,re[i&ee]=ie[oe],ie[oe]=i;return w},Te.deflate=function(n,r){var i,o,c,u,l,f;if(r>b||r<0)return $;if(!n.next_out||!n.next_in&&0!==n.avail_in||t==V&&r!=b)return n.msg=j[x-$],$;if(0===n.avail_out)return n.msg=j[x-S],S;if(e=n,u=M,M=r,t==H&&(o=W+(Q-8<<4)<<8,(c=(we-1&255)>>1)>3&&(c=3),o|=c<<6,0!==he&&(o|=B),t=z,Be((f=o+=31-o%31)>>8&255),Be(255&f)),0!==Te.pending){if(e.flush_pending(),0===e.avail_out)return M=-1,w}else if(0===e.avail_in&&r<=u&&r!=b)return e.msg=j[x-S],S;if(t==V&&0!==e.avail_in)return n.msg=j[x-S],S;if(0!==e.avail_in||0!==me||r!=m&&t!=V){switch(l=-1,T[we].func){case D:l=function(t){var n,r=65535;for(r>a-5&&(r=a-5);;){if(me<=1){if(Qe(),0===me&&t==m)return F;if(0===me)break}if(he+=me,me=0,n=le+r,(0===he||he>=n)&&(me=he-n,he=n,Xe(!1),0===e.avail_out))return F;if(he-le>=O-Z&&(Xe(!1),0===e.avail_out))return F}return Xe(t==b),0===e.avail_out?t==b?L:F:t==b?U:N}(r);break;case R:l=function(t){for(var n,r=0;;){if(me<Z){if(Qe(),me<Z&&t==m)return F;if(0===me)break}if(me>=G&&(oe=(oe<<ue^255&te[he+(G-1)])&ce,r=65535&ie[oe],re[he&ee]=ie[oe],ie[oe]=he),0!==r&&(he-r&65535)<=O-Z&&ke!=h&&(fe=et(r)),fe>=G)if(n=qe(he-ve,fe-G),me-=fe,fe<=be&&me>=G){fe--;do{he++,oe=(oe<<ue^255&te[he+(G-1)])&ce,r=65535&ie[oe],re[he&ee]=ie[oe],ie[oe]=he}while(0!=--fe);he++}else he+=fe,fe=0,oe=((oe=255&te[he])<<ue^255&te[he+1])&ce;else n=qe(0,255&te[he]),me--,he++;if(n&&(Xe(!1),0===e.avail_out))return F}return Xe(t==b),0===e.avail_out?t==b?L:F:t==b?U:N}(r);break;case P:l=function(t){for(var n,r,i=0;;){if(me<Z){if(Qe(),me<Z&&t==m)return F;if(0===me)break}if(me>=G&&(oe=(oe<<ue^255&te[he+(G-1)])&ce,i=65535&ie[oe],re[he&ee]=ie[oe],ie[oe]=he),ye=fe,de=ve,fe=G-1,0!==i&&ye<be&&(he-i&65535)<=O-Z&&(ke!=h&&(fe=et(i)),fe<=5&&(ke==p||fe==G&&he-ve>4096)&&(fe=G-1)),ye>=G&&fe<=ye){r=he+me-G,n=qe(he-1-de,ye-G),me-=ye-1,ye-=2;do{++he<=r&&(oe=(oe<<ue^255&te[he+(G-1)])&ce,i=65535&ie[oe],re[he&ee]=ie[oe],ie[oe]=he)}while(0!=--ye);if(pe=0,fe=G-1,he++,n&&(Xe(!1),0===e.avail_out))return F}else if(0!==pe){if((n=qe(0,255&te[he-1]))&&Xe(!1),he++,me--,0===e.avail_out)return F}else pe=1,he++,me--}return 0!==pe&&(n=qe(0,255&te[he-1]),pe=0),Xe(t==b),0===e.avail_out?t==b?L:F:t==b?U:N}(r)}if(l!=L&&l!=U||(t=V),l==F||l==L)return 0===e.avail_out&&(M=-1),w;if(l==N){if(r==y)ze(q<<1,3),Ve(s,A.static_ltree),Ke(),1+De+10-Pe<9&&(ze(q<<1,3),Ve(s,A.static_ltree),Ke()),De=7;else if(Ye(0,0,!1),r==g)for(i=0;i<ae;i++)ie[i]=0;if(e.flush_pending(),0===e.avail_out)return M=-1,w}}return r!=b?w:k}}function ee(){this.next_in_index=0,this.next_out_index=0,this.avail_in=0,this.total_in=0,this.avail_out=0,this.total_out=0}ee.prototype={deflateInit:function(e,n){return this.dstate=new Q,n||(n=t),this.dstate.deflateInit(this,e,n)},deflate:function(e){return this.dstate?this.dstate.deflate(this,e):$},deflateEnd:function(){if(!this.dstate)return $;var e=this.dstate.deflateEnd();return this.dstate=null,e},deflateParams:function(e,t){return this.dstate?this.dstate.deflateParams(this,e,t):$},deflateSetDictionary:function(e,t){return this.dstate?this.dstate.deflateSetDictionary(this,e,t):$},read_buf:function(e,t,n){var r=this.avail_in;return r>n&&(r=n),0===r?0:(this.avail_in-=r,e.set(this.next_in.subarray(this.next_in_index,this.next_in_index+r),t),this.next_in_index+=r,this.total_in+=r,r)},flush_pending:function(){var e=this.dstate.pending;e>this.avail_out&&(e=this.avail_out),0!==e&&(this.next_out.set(this.dstate.pending_buf.subarray(this.dstate.pending_out,this.dstate.pending_out+e),this.next_out_index),this.next_out_index+=e,this.dstate.pending_out+=e,this.total_out+=e,this.avail_out-=e,this.dstate.pending-=e,0===this.dstate.pending&&(this.dstate.pending_out=0))}};var te=e.zip||e;te.Deflater=te._jzlib_Deflater=function(e){var t=new ee,n=m,r=new Uint8Array(512),i=e?e.level:d;void 0===i&&(i=d),t.deflateInit(i),t.next_out=r,this.append=function(e,i){var o,a=[],s=0,c=0,u=0;if(e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=512,t.deflate(n)!=w)throw new Error("deflating: "+t.msg);t.next_out_index&&(512==t.next_out_index?a.push(new Uint8Array(r)):a.push(new Uint8Array(r.subarray(0,t.next_out_index)))),u+=t.next_out_index,i&&t.next_in_index>0&&t.next_in_index!=s&&(i(t.next_in_index),s=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return o=new Uint8Array(u),a.forEach((function(e){o.set(e,c),c+=e.length})),o}},this.flush=function(){var e,n,i=[],o=0,a=0;do{if(t.next_out_index=0,t.avail_out=512,(e=t.deflate(b))!=k&&e!=w)throw new Error("deflating: "+t.msg);512-t.avail_out>0&&i.push(new Uint8Array(r.subarray(0,t.next_out_index))),a+=t.next_out_index}while(t.avail_in>0||0===t.avail_out);return t.deflateEnd(),n=new Uint8Array(a),i.forEach((function(e){n.set(e,o),o+=e.length})),n}}}(this)},function(e,t){!function(e){"use strict";var t=0,n=1,r=2,i=-2,o=-3,a=-4,s=-5,c=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],u=1440,l=0,f=4,d=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],p=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],h=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],v=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],m=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],y=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],g=15;function b(){var e,n,r,i,c,l;function f(e,n,a,f,d,p,h,v,m,y,b){var w,k,x,$,_,S,M,C,A,I,E,O,D,R,P;I=0,_=a;do{r[e[n+I]]++,I++,_--}while(0!==_);if(r[0]==a)return h[0]=-1,v[0]=0,t;for(C=v[0],S=1;S<=g&&0===r[S];S++);for(M=S,C<S&&(C=S),_=g;0!==_&&0===r[_];_--);for(x=_,C>_&&(C=_),v[0]=C,R=1<<S;S<_;S++,R<<=1)if((R-=r[S])<0)return o;if((R-=r[_])<0)return o;for(r[_]+=R,l[1]=S=0,I=1,D=2;0!=--_;)l[D]=S+=r[I],D++,I++;_=0,I=0;do{0!==(S=e[n+I])&&(b[l[S]++]=_),I++}while(++_<a);for(a=l[x],l[0]=_=0,I=0,$=-1,O=-C,c[0]=0,E=0,P=0;M<=x;M++)for(w=r[M];0!=w--;){for(;M>O+C;){if($++,P=(P=x-(O+=C))>C?C:P,(k=1<<(S=M-O))>w+1&&(k-=w+1,D=M,S<P))for(;++S<P&&!((k<<=1)<=r[++D]);)k-=r[D];if(P=1<<S,y[0]+P>u)return o;c[$]=E=y[0],y[0]+=P,0!==$?(l[$]=_,i[0]=S,i[1]=C,S=_>>>O-C,i[2]=E-c[$-1]-S,m.set(i,3*(c[$-1]+S))):h[0]=E}for(i[1]=M-O,I>=a?i[0]=192:b[I]<f?(i[0]=b[I]<256?0:96,i[2]=b[I++]):(i[0]=p[b[I]-f]+16+64,i[2]=d[b[I++]-f]),k=1<<M-O,S=_>>>O;S<P;S+=k)m.set(i,3*(E+S));for(S=1<<M-1;0!=(_&S);S>>>=1)_^=S;for(_^=S,A=(1<<O)-1;(_&A)!=l[$];)$--,A=(1<<(O-=C))-1}return 0!==R&&1!=x?s:t}function d(t){var o;for(e||(e=[],n=[],r=new Int32Array(g+1),i=[],c=new Int32Array(g),l=new Int32Array(g+1)),n.length<t&&(n=[]),o=0;o<t;o++)n[o]=0;for(o=0;o<g+1;o++)r[o]=0;for(o=0;o<3;o++)i[o]=0;c.set(r.subarray(0,g),0),l.set(r.subarray(0,g+1),0)}this.inflate_trees_bits=function(t,r,i,a,c){var u;return d(19),e[0]=0,(u=f(t,0,19,19,null,null,i,r,a,e,n))==o?c.msg="oversubscribed dynamic bit lengths tree":u!=s&&0!==r[0]||(c.msg="incomplete dynamic bit lengths tree",u=o),u},this.inflate_trees_dynamic=function(r,i,c,u,l,p,g,b,w){var k;return d(288),e[0]=0,(k=f(c,0,r,257,h,v,p,u,b,e,n))!=t||0===u[0]?(k==o?w.msg="oversubscribed literal/length tree":k!=a&&(w.msg="incomplete literal/length tree",k=o),k):(d(288),(k=f(c,r,i,0,m,y,g,l,b,e,n))!=t||0===l[0]&&r>257?(k==o?w.msg="oversubscribed distance tree":k==s?(w.msg="incomplete distance tree",k=o):k!=a&&(w.msg="empty distance tree with lengths",k=o),k):t)}}b.inflate_trees_fixed=function(e,n,r,i){return e[0]=9,n[0]=5,r[0]=d,i[0]=p,t};var w=0,k=1,x=2,$=3,_=4,S=5,M=6,C=7,A=8,I=9;function E(){var e,r,a,s,u=0,l=0,f=0,d=0,p=0,h=0,v=0,m=0,y=0,g=0;function b(e,r,i,a,s,u,l,f){var d,p,h,v,m,y,g,b,w,k,x,$,_,S,M,C;g=f.next_in_index,b=f.avail_in,m=l.bitb,y=l.bitk,k=(w=l.write)<l.read?l.read-w-1:l.end-w,x=c[e],$=c[r];do{for(;y<20;)b--,m|=(255&f.read_byte(g++))<<y,y+=8;if(0!==(v=(p=i)[C=3*((h=a)+(d=m&x))]))for(;;){if(m>>=p[C+1],y-=p[C+1],0!=(16&v)){for(v&=15,_=p[C+2]+(m&c[v]),m>>=v,y-=v;y<15;)b--,m|=(255&f.read_byte(g++))<<y,y+=8;for(v=(p=s)[C=3*((h=u)+(d=m&$))];;){if(m>>=p[C+1],y-=p[C+1],0!=(16&v)){for(v&=15;y<v;)b--,m|=(255&f.read_byte(g++))<<y,y+=8;if(S=p[C+2]+(m&c[v]),m>>=v,y-=v,k-=_,w>=S)w-(M=w-S)>0&&2>w-M?(l.window[w++]=l.window[M++],l.window[w++]=l.window[M++],_-=2):(l.window.set(l.window.subarray(M,M+2),w),w+=2,M+=2,_-=2);else{M=w-S;do{M+=l.end}while(M<0);if(_>(v=l.end-M)){if(_-=v,w-M>0&&v>w-M)do{l.window[w++]=l.window[M++]}while(0!=--v);else l.window.set(l.window.subarray(M,M+v),w),w+=v,M+=v,v=0;M=0}}if(w-M>0&&_>w-M)do{l.window[w++]=l.window[M++]}while(0!=--_);else l.window.set(l.window.subarray(M,M+_),w),w+=_,M+=_,_=0;break}if(0!=(64&v))return f.msg="invalid distance code",b+=_=y>>3<(_=f.avail_in-b)?y>>3:_,g-=_,y-=_<<3,l.bitb=m,l.bitk=y,f.avail_in=b,f.total_in+=g-f.next_in_index,f.next_in_index=g,l.write=w,o;d+=p[C+2],v=p[C=3*(h+(d+=m&c[v]))]}break}if(0!=(64&v))return 0!=(32&v)?(b+=_=y>>3<(_=f.avail_in-b)?y>>3:_,g-=_,y-=_<<3,l.bitb=m,l.bitk=y,f.avail_in=b,f.total_in+=g-f.next_in_index,f.next_in_index=g,l.write=w,n):(f.msg="invalid literal/length code",b+=_=y>>3<(_=f.avail_in-b)?y>>3:_,g-=_,y-=_<<3,l.bitb=m,l.bitk=y,f.avail_in=b,f.total_in+=g-f.next_in_index,f.next_in_index=g,l.write=w,o);if(d+=p[C+2],0===(v=p[C=3*(h+(d+=m&c[v]))])){m>>=p[C+1],y-=p[C+1],l.window[w++]=p[C+2],k--;break}}else m>>=p[C+1],y-=p[C+1],l.window[w++]=p[C+2],k--}while(k>=258&&b>=10);return b+=_=y>>3<(_=f.avail_in-b)?y>>3:_,g-=_,y-=_<<3,l.bitb=m,l.bitk=y,f.avail_in=b,f.total_in+=g-f.next_in_index,f.next_in_index=g,l.write=w,t}this.init=function(t,n,i,o,c,u){e=w,v=t,m=n,a=i,y=o,s=c,g=u,r=null},this.proc=function(E,O,D){var R,P,T,j,F,N,L,U=0,B=0,H=0;for(H=O.next_in_index,j=O.avail_in,U=E.bitb,B=E.bitk,N=(F=E.write)<E.read?E.read-F-1:E.end-F;;)switch(e){case w:if(N>=258&&j>=10&&(E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,D=b(v,m,a,y,s,g,E,O),H=O.next_in_index,j=O.avail_in,U=E.bitb,B=E.bitk,N=(F=E.write)<E.read?E.read-F-1:E.end-F,D!=t)){e=D==n?C:I;break}f=v,r=a,l=y,e=k;case k:for(R=f;B<R;){if(0===j)return E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);D=t,j--,U|=(255&O.read_byte(H++))<<B,B+=8}if(P=3*(l+(U&c[R])),U>>>=r[P+1],B-=r[P+1],0===(T=r[P])){d=r[P+2],e=M;break}if(0!=(16&T)){p=15&T,u=r[P+2],e=x;break}if(0==(64&T)){f=T,l=P/3+r[P+2];break}if(0!=(32&T)){e=C;break}return e=I,O.msg="invalid literal/length code",D=o,E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);case x:for(R=p;B<R;){if(0===j)return E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);D=t,j--,U|=(255&O.read_byte(H++))<<B,B+=8}u+=U&c[R],U>>=R,B-=R,f=m,r=s,l=g,e=$;case $:for(R=f;B<R;){if(0===j)return E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);D=t,j--,U|=(255&O.read_byte(H++))<<B,B+=8}if(P=3*(l+(U&c[R])),U>>=r[P+1],B-=r[P+1],0!=(16&(T=r[P]))){p=15&T,h=r[P+2],e=_;break}if(0==(64&T)){f=T,l=P/3+r[P+2];break}return e=I,O.msg="invalid distance code",D=o,E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);case _:for(R=p;B<R;){if(0===j)return E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);D=t,j--,U|=(255&O.read_byte(H++))<<B,B+=8}h+=U&c[R],U>>=R,B-=R,e=S;case S:for(L=F-h;L<0;)L+=E.end;for(;0!==u;){if(0===N&&(F==E.end&&0!==E.read&&(N=(F=0)<E.read?E.read-F-1:E.end-F),0===N&&(E.write=F,D=E.inflate_flush(O,D),N=(F=E.write)<E.read?E.read-F-1:E.end-F,F==E.end&&0!==E.read&&(N=(F=0)<E.read?E.read-F-1:E.end-F),0===N)))return E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);E.window[F++]=E.window[L++],N--,L==E.end&&(L=0),u--}e=w;break;case M:if(0===N&&(F==E.end&&0!==E.read&&(N=(F=0)<E.read?E.read-F-1:E.end-F),0===N&&(E.write=F,D=E.inflate_flush(O,D),N=(F=E.write)<E.read?E.read-F-1:E.end-F,F==E.end&&0!==E.read&&(N=(F=0)<E.read?E.read-F-1:E.end-F),0===N)))return E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);D=t,E.window[F++]=d,N--,e=w;break;case C:if(B>7&&(B-=8,j++,H--),E.write=F,D=E.inflate_flush(O,D),N=(F=E.write)<E.read?E.read-F-1:E.end-F,E.read!=E.write)return E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);e=A;case A:return D=n,E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);case I:return D=o,E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D);default:return D=i,E.bitb=U,E.bitk=B,O.avail_in=j,O.total_in+=H-O.next_in_index,O.next_in_index=H,E.write=F,E.inflate_flush(O,D)}},this.free=function(){}}var O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],D=0,R=1,P=2,T=3,j=4,F=5,N=6,L=7,U=8,B=9;function H(e,r){var a,l=this,f=D,d=0,p=0,h=0,v=[0],m=[0],y=new E,g=0,w=new Int32Array(3*u),k=new b;l.bitk=0,l.bitb=0,l.window=new Uint8Array(r),l.end=r,l.read=0,l.write=0,l.reset=function(e,t){t&&(t[0]=0),f==N&&y.free(e),f=D,l.bitk=0,l.bitb=0,l.read=l.write=0},l.reset(e,null),l.inflate_flush=function(e,n){var r,i,o;return i=e.next_out_index,(r=((o=l.read)<=l.write?l.write:l.end)-o)>e.avail_out&&(r=e.avail_out),0!==r&&n==s&&(n=t),e.avail_out-=r,e.total_out+=r,e.next_out.set(l.window.subarray(o,o+r),i),i+=r,(o+=r)==l.end&&(o=0,l.write==l.end&&(l.write=0),(r=l.write-o)>e.avail_out&&(r=e.avail_out),0!==r&&n==s&&(n=t),e.avail_out-=r,e.total_out+=r,e.next_out.set(l.window.subarray(o,o+r),i),i+=r,o+=r),e.next_out_index=i,l.read=o,n},l.proc=function(e,r){var s,u,x,$,_,S,M,C;for($=e.next_in_index,_=e.avail_in,u=l.bitb,x=l.bitk,M=(S=l.write)<l.read?l.read-S-1:l.end-S;;)switch(f){case D:for(;x<3;){if(0===_)return l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);r=t,_--,u|=(255&e.read_byte($++))<<x,x+=8}switch(g=1&(s=7&u),s>>>1){case 0:u>>>=3,u>>>=s=7&(x-=3),x-=s,f=R;break;case 1:var A=[],I=[],E=[[]],H=[[]];b.inflate_trees_fixed(A,I,E,H),y.init(A[0],I[0],E[0],0,H[0],0),u>>>=3,x-=3,f=N;break;case 2:u>>>=3,x-=3,f=T;break;case 3:return u>>>=3,x-=3,f=B,e.msg="invalid block type",r=o,l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r)}break;case R:for(;x<32;){if(0===_)return l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);r=t,_--,u|=(255&e.read_byte($++))<<x,x+=8}if((~u>>>16&65535)!=(65535&u))return f=B,e.msg="invalid stored block lengths",r=o,l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);d=65535&u,u=x=0,f=0!==d?P:0!==g?L:D;break;case P:if(0===_)return l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);if(0===M&&(S==l.end&&0!==l.read&&(M=(S=0)<l.read?l.read-S-1:l.end-S),0===M&&(l.write=S,r=l.inflate_flush(e,r),M=(S=l.write)<l.read?l.read-S-1:l.end-S,S==l.end&&0!==l.read&&(M=(S=0)<l.read?l.read-S-1:l.end-S),0===M)))return l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);if(r=t,(s=d)>_&&(s=_),s>M&&(s=M),l.window.set(e.read_buf($,s),S),$+=s,_-=s,S+=s,M-=s,0!=(d-=s))break;f=0!==g?L:D;break;case T:for(;x<14;){if(0===_)return l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);r=t,_--,u|=(255&e.read_byte($++))<<x,x+=8}if(p=s=16383&u,(31&s)>29||(s>>5&31)>29)return f=B,e.msg="too many length or distance symbols",r=o,l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);if(s=258+(31&s)+(s>>5&31),!a||a.length<s)a=[];else for(C=0;C<s;C++)a[C]=0;u>>>=14,x-=14,h=0,f=j;case j:for(;h<4+(p>>>10);){for(;x<3;){if(0===_)return l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);r=t,_--,u|=(255&e.read_byte($++))<<x,x+=8}a[O[h++]]=7&u,u>>>=3,x-=3}for(;h<19;)a[O[h++]]=0;if(v[0]=7,(s=k.inflate_trees_bits(a,v,m,w,e))!=t)return(r=s)==o&&(a=null,f=B),l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);h=0,f=F;case F:for(;!(h>=258+(31&(s=p))+(s>>5&31));){var z,V;for(s=v[0];x<s;){if(0===_)return l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);r=t,_--,u|=(255&e.read_byte($++))<<x,x+=8}if(s=w[3*(m[0]+(u&c[s]))+1],(V=w[3*(m[0]+(u&c[s]))+2])<16)u>>>=s,x-=s,a[h++]=V;else{for(C=18==V?7:V-14,z=18==V?11:3;x<s+C;){if(0===_)return l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);r=t,_--,u|=(255&e.read_byte($++))<<x,x+=8}if(x-=s,z+=(u>>>=s)&c[C],u>>>=C,x-=C,(C=h)+z>258+(31&(s=p))+(s>>5&31)||16==V&&C<1)return a=null,f=B,e.msg="invalid bit length repeat",r=o,l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);V=16==V?a[C-1]:0;do{a[C++]=V}while(0!=--z);h=C}}m[0]=-1;var W=[],K=[],q=[],J=[];if(W[0]=9,K[0]=6,s=p,(s=k.inflate_trees_dynamic(257+(31&s),1+(s>>5&31),a,W,K,q,J,w,e))!=t)return s==o&&(a=null,f=B),r=s,l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);y.init(W[0],K[0],w,q[0],w,J[0]),f=N;case N:if(l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,(r=y.proc(l,e,r))!=n)return l.inflate_flush(e,r);if(r=t,y.free(e),$=e.next_in_index,_=e.avail_in,u=l.bitb,x=l.bitk,M=(S=l.write)<l.read?l.read-S-1:l.end-S,0===g){f=D;break}f=L;case L:if(l.write=S,r=l.inflate_flush(e,r),M=(S=l.write)<l.read?l.read-S-1:l.end-S,l.read!=l.write)return l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);f=U;case U:return r=n,l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);case B:return r=o,l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r);default:return r=i,l.bitb=u,l.bitk=x,e.avail_in=_,e.total_in+=$-e.next_in_index,e.next_in_index=$,l.write=S,l.inflate_flush(e,r)}},l.free=function(e){l.reset(e,null),l.window=null,w=null},l.set_dictionary=function(e,t,n){l.window.set(e.subarray(t,t+n),0),l.read=l.write=n},l.sync_point=function(){return f==R?1:0}}var z=32,V=8,W=0,K=1,q=2,J=3,G=4,Y=5,Z=6,X=7,Q=12,ee=13,te=[0,0,255,255];function ne(){var e=this;function a(e){return e&&e.istate?(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=X,e.istate.blocks.reset(e,null),t):i}e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0,e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,t},e.inflateInit=function(n,r){return n.msg=null,e.blocks=null,r<8||r>15?(e.inflateEnd(n),i):(e.wbits=r,n.istate.blocks=new H(n,1<<r),a(n),t)},e.inflate=function(e,a){var c,u;if(!e||!e.istate||!e.next_in)return i;for(a=a==f?s:t,c=s;;)switch(e.istate.mode){case W:if(0===e.avail_in)return c;if(c=a,e.avail_in--,e.total_in++,(15&(e.istate.method=e.read_byte(e.next_in_index++)))!=V){e.istate.mode=ee,e.msg="unknown compression method",e.istate.marker=5;break}if(8+(e.istate.method>>4)>e.istate.wbits){e.istate.mode=ee,e.msg="invalid window size",e.istate.marker=5;break}e.istate.mode=K;case K:if(0===e.avail_in)return c;if(c=a,e.avail_in--,e.total_in++,u=255&e.read_byte(e.next_in_index++),((e.istate.method<<8)+u)%31!=0){e.istate.mode=ee,e.msg="incorrect header check",e.istate.marker=5;break}if(0==(u&z)){e.istate.mode=X;break}e.istate.mode=q;case q:if(0===e.avail_in)return c;c=a,e.avail_in--,e.total_in++,e.istate.need=(255&e.read_byte(e.next_in_index++))<<24&4278190080,e.istate.mode=J;case J:if(0===e.avail_in)return c;c=a,e.avail_in--,e.total_in++,e.istate.need+=(255&e.read_byte(e.next_in_index++))<<16&16711680,e.istate.mode=G;case G:if(0===e.avail_in)return c;c=a,e.avail_in--,e.total_in++,e.istate.need+=(255&e.read_byte(e.next_in_index++))<<8&65280,e.istate.mode=Y;case Y:return 0===e.avail_in?c:(c=a,e.avail_in--,e.total_in++,e.istate.need+=255&e.read_byte(e.next_in_index++),e.istate.mode=Z,r);case Z:return e.istate.mode=ee,e.msg="need dictionary",e.istate.marker=0,i;case X:if((c=e.istate.blocks.proc(e,c))==o){e.istate.mode=ee,e.istate.marker=0;break}if(c==t&&(c=a),c!=n)return c;c=a,e.istate.blocks.reset(e,e.istate.was),e.istate.mode=Q;case Q:return n;case ee:return o;default:return i}},e.inflateSetDictionary=function(e,n,r){var o=0,a=r;return e&&e.istate&&e.istate.mode==Z?(a>=1<<e.istate.wbits&&(o=r-(a=(1<<e.istate.wbits)-1)),e.istate.blocks.set_dictionary(n,o,a),e.istate.mode=X,t):i},e.inflateSync=function(e){var n,r,c,u,l;if(!e||!e.istate)return i;if(e.istate.mode!=ee&&(e.istate.mode=ee,e.istate.marker=0),0===(n=e.avail_in))return s;for(r=e.next_in_index,c=e.istate.marker;0!==n&&c<4;)e.read_byte(r)==te[c]?c++:c=0!==e.read_byte(r)?0:4-c,r++,n--;return e.total_in+=r-e.next_in_index,e.next_in_index=r,e.avail_in=n,e.istate.marker=c,4!=c?o:(u=e.total_in,l=e.total_out,a(e),e.total_in=u,e.total_out=l,e.istate.mode=X,t)},e.inflateSyncPoint=function(e){return e&&e.istate&&e.istate.blocks?e.istate.blocks.sync_point():i}}function re(){}re.prototype={inflateInit:function(e){return this.istate=new ne,e||(e=15),this.istate.inflateInit(this,e)},inflate:function(e){return this.istate?this.istate.inflate(this,e):i},inflateEnd:function(){if(!this.istate)return i;var e=this.istate.inflateEnd(this);return this.istate=null,e},inflateSync:function(){return this.istate?this.istate.inflateSync(this):i},inflateSetDictionary:function(e,t){return this.istate?this.istate.inflateSetDictionary(this,e,t):i},read_byte:function(e){return this.next_in.subarray(e,e+1)[0]},read_buf:function(e,t){return this.next_in.subarray(e,e+t)}};var ie=e.zip||e;ie.Inflater=ie._jzlib_Inflater=function(){var e=new re,r=l,i=new Uint8Array(512),o=!1;e.inflateInit(),e.next_out=i,this.append=function(a,c){var u,l,f=[],d=0,p=0,h=0;if(0!==a.length){e.next_in_index=0,e.next_in=a,e.avail_in=a.length;do{if(e.next_out_index=0,e.avail_out=512,0!==e.avail_in||o||(e.next_in_index=0,o=!0),u=e.inflate(r),o&&u===s){if(0!==e.avail_in)throw new Error("inflating: bad input")}else if(u!==t&&u!==n)throw new Error("inflating: "+e.msg);if((o||u===n)&&e.avail_in===a.length)throw new Error("inflating: bad input");e.next_out_index&&(512===e.next_out_index?f.push(new Uint8Array(i)):f.push(new Uint8Array(i.subarray(0,e.next_out_index)))),h+=e.next_out_index,c&&e.next_in_index>0&&e.next_in_index!=d&&(c(e.next_in_index),d=e.next_in_index)}while(e.avail_in>0||0===e.avail_out);return l=new Uint8Array(h),f.forEach((function(e){l.set(e,p),p+=e.length})),l}},this.flush=function(){e.inflateEnd()}}}(this)},function(e,t){!function(e){"use strict";var t,n="File format is not recognized.",r="CRC failed.",i="File contains encrypted entry.",o="File is using Zip64 (4gb+ file size).",a="Error while reading zip file.",s="Error while writing zip file.",c="Error while writing file data.",u="Error while reading file data.",l="File already exists.",f=524288,d="text/plain";try{t=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}function p(){this.crc=-1}function h(){}function v(e,t){var n,r;return n=new ArrayBuffer(e),r=new Uint8Array(n),t&&r.set(t,0),{buffer:n,array:r,view:new DataView(n)}}function m(){}function y(e){var t,n=this;n.size=0,n.init=function(r,i){var o=new Blob([e],{type:d});(t=new b(o)).init((function(){n.size=t.size,r()}),i)},n.readUint8Array=function(e,n,r,i){t.readUint8Array(e,n,r,i)}}function g(t){var n,r=this;r.size=0,r.init=function(e){for(var i=t.length;"="==t.charAt(i-1);)i--;n=t.indexOf(",")+1,r.size=Math.floor(.75*(i-n)),e()},r.readUint8Array=function(r,i,o){var a,s=v(i),c=4*Math.floor(r/3),u=4*Math.ceil((r+i)/3),l=e.atob(t.substring(c+n,u+n)),f=r-3*Math.floor(c/4);for(a=f;a<f+i;a++)s.array[a-f]=l.charCodeAt(a);o(s.array)}}function b(e){var t=this;t.size=0,t.init=function(n){t.size=e.size,n()},t.readUint8Array=function(t,n,r,i){var o=new FileReader;o.onload=function(e){r(new Uint8Array(e.target.result))},o.onerror=i;try{o.readAsArrayBuffer(function(e,t,n){if(t<0||n<0||t+n>e.size)throw new RangeError("offset:"+t+", length:"+n+", size:"+e.size);return e.slice?e.slice(t,t+n):e.webkitSlice?e.webkitSlice(t,t+n):e.mozSlice?e.mozSlice(t,t+n):e.msSlice?e.msSlice(t,t+n):void 0}(e,t,n))}catch(e){i(e)}}}function w(){}function k(e){var n;this.init=function(e){n=new Blob([],{type:d}),e()},this.writeUint8Array=function(e,r){n=new Blob([n,t?e:e.buffer],{type:d}),r()},this.getData=function(t,r){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=r,i.readAsText(n,e)}}function x(t){var n="",r="";this.init=function(e){n+="data:"+(t||"")+";base64,",e()},this.writeUint8Array=function(t,i){var o,a=r.length,s=r;for(r="",o=0;o<3*Math.floor((a+t.length)/3)-a;o++)s+=String.fromCharCode(t[o]);for(;o<t.length;o++)r+=String.fromCharCode(t[o]);s.length>2?n+=e.btoa(s):r=s,i()},this.getData=function(t){t(n+e.btoa(r))}}function $(e){var n;this.init=function(t){n=new Blob([],{type:e}),t()},this.writeUint8Array=function(r,i){n=new Blob([n,t?r:r.buffer],{type:e}),i()},this.getData=function(e){e(n)}}function _(e,t,n,r,i,o,a,s,c,u){var l,d,p,h=0,v=t.sn;function m(){e.removeEventListener("message",y,!1),s(d,p)}function y(t){var n=t.data,i=n.data,s=n.error;if(s)return s.toString=function(){return"Error: "+this.message},void c(s);if(n.sn===v)switch("number"==typeof n.codecTime&&(e.codecTime+=n.codecTime),"number"==typeof n.crcTime&&(e.crcTime+=n.crcTime),n.type){case"append":i?(d+=i.length,r.writeUint8Array(i,(function(){g()}),u)):g();break;case"flush":p=n.crc,i?(d+=i.length,r.writeUint8Array(i,(function(){m()}),u)):m();break;case"progress":a&&a(l+n.loaded,o);break;case"importScripts":case"newTask":case"echo":break;default:console.warn("zip.js:launchWorkerProcess: unknown message: ",n)}}function g(){(l=h*f)<=o?n.readUint8Array(i+l,Math.min(f,o-l),(function(n){a&&a(l,o);var r=0===l?t:{sn:v};r.type="append",r.data=n;try{e.postMessage(r,[n.buffer])}catch(t){e.postMessage(r)}h++}),c):e.postMessage({sn:v,type:"flush"})}d=0,e.addEventListener("message",y,!1),g()}function S(e,t,n,r,i,o,a,s,c,u){var l,d=0,h=0,v="input"===o,m="output"===o,y=new p;!function o(){var p;if((l=d*f)<i)t.readUint8Array(r+l,Math.min(f,i-l),(function(t){var r;try{r=e.append(t,(function(e){a&&a(l+e,i)}))}catch(e){return void c(e)}r?(h+=r.length,n.writeUint8Array(r,(function(){d++,setTimeout(o,1)}),u),m&&y.append(r)):(d++,setTimeout(o,1)),v&&y.append(t),a&&a(l,i)}),c);else{try{p=e.flush()}catch(e){return void c(e)}p?(m&&y.append(p),h+=p.length,n.writeUint8Array(p,(function(){s(h,y.get())}),u)):s(h,y.get())}}()}function M(t,n,r,i,o,a,s,c,u,l,f){e.zip.useWebWorkers&&s?_(t,{sn:n,codecClass:"NOOP",crcType:"input"},r,i,o,a,u,c,l,f):S(new h,r,i,o,a,"input",u,c,l,f)}function C(e){var t,n,r="",i=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)r+=(n=255&e.charCodeAt(t))>127?i[n-128]:String.fromCharCode(n);return r}function A(e){return decodeURIComponent(escape(e))}function I(e){var t,n="";for(t=0;t<e.length;t++)n+=String.fromCharCode(e[t]);return n}function E(e,t,n,r,a){e.version=t.view.getUint16(n,!0),e.bitFlag=t.view.getUint16(n+2,!0),e.compressionMethod=t.view.getUint16(n+4,!0),e.lastModDateRaw=t.view.getUint32(n+6,!0),e.lastModDate=function(e){var t=(4294901760&e)>>16,n=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}catch(e){}}(e.lastModDateRaw),1!=(1&e.bitFlag)?((r||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(n+10,!0),e.compressedSize=t.view.getUint32(n+14,!0),e.uncompressedSize=t.view.getUint32(n+18,!0)),4294967295!==e.compressedSize&&4294967295!==e.uncompressedSize?(e.filenameLength=t.view.getUint16(n+22,!0),e.extraFieldLength=t.view.getUint16(n+24,!0)):a(o)):a(i)}function O(t,i,o){var s=0;function l(){}l.prototype.getData=function(i,a,l,f){var d=this;function p(e,t){f&&!function(e){var t=v(4);return t.view.setUint32(0,e),d.crc32==t.view.getUint32(0)}(t)?o(r):i.getData((function(e){a(e)}))}function h(e){o(e||u)}function m(e){o(e||c)}t.readUint8Array(d.offset,30,(function(r){var a,c=v(r.length,r);1347093252==c.view.getUint32(0)?(E(d,c,4,!1,o),a=d.offset+30+d.filenameLength+d.extraFieldLength,i.init((function(){0===d.compressionMethod?M(d._worker,s++,t,i,a,d.compressedSize,f,p,l,h,m):function(t,n,r,i,o,a,s,c,u,l,f){var d=s?"output":"none";e.zip.useWebWorkers?_(t,{sn:n,codecClass:"Inflater",crcType:d},r,i,o,a,u,c,l,f):S(new e.zip.Inflater,r,i,o,a,d,u,c,l,f)}(d._worker,s++,t,i,a,d.compressedSize,f,p,l,h,m)}),m)):o(n)}),h)};var f={getEntries:function(e){var r=this._worker;!function(e){var r=22;if(t.size<r)o(n);else{var i=r+65536;s(r,(function(){s(Math.min(i,t.size),(function(){o(n)}))}))}function s(n,i){t.readUint8Array(t.size-n,n,(function(t){for(var n=t.length-r;n>=0;n--)if(80===t[n]&&75===t[n+1]&&5===t[n+2]&&6===t[n+3])return void e(new DataView(t.buffer,n,r));i()}),(function(){o(a)}))}}((function(i){var s,c;s=i.getUint32(16,!0),c=i.getUint16(8,!0),s<0||s>=t.size?o(n):t.readUint8Array(s,t.size-s,(function(t){var i,a,s,u,f=0,d=[],p=v(t.length,t);for(i=0;i<c;i++){if((a=new l)._worker=r,1347092738!=p.view.getUint32(f))return void o(n);E(a,p,f+6,!0,o),a.commentLength=p.view.getUint16(f+32,!0),a.directory=16==(16&p.view.getUint8(f+38)),a.offset=p.view.getUint32(f+42,!0),s=I(p.array.subarray(f+46,f+46+a.filenameLength)),a.filename=2048==(2048&a.bitFlag)?A(s):C(s),a.directory||"/"!=a.filename.charAt(a.filename.length-1)||(a.directory=!0),u=I(p.array.subarray(f+46+a.filenameLength+a.extraFieldLength,f+46+a.filenameLength+a.extraFieldLength+a.commentLength)),a.comment=2048==(2048&a.bitFlag)?A(u):C(u),d.push(a),f+=46+a.filenameLength+a.extraFieldLength+a.commentLength}e(d)}),(function(){o(a)}))}))},close:function(e){this._worker&&(this._worker.terminate(),this._worker=null),e&&e()},_worker:null};e.zip.useWebWorkers?j("inflater",(function(e){f._worker=e,i(f)}),(function(e){o(e)})):i(f)}function D(e){return unescape(encodeURIComponent(e))}function R(e){var t,n=[];for(t=0;t<e.length;t++)n.push(e.charCodeAt(t));return n}function P(t,n,r,i){var o={},a=[],c=0,f=0;function d(e){r(e||s)}function p(e){r(e||u)}var h={add:function(n,s,u,h,m){var y,g,b,w=this._worker;function k(e,n){var r=v(16);c+=e||0,r.view.setUint32(0,1347094280),void 0!==n&&(y.view.setUint32(10,n,!0),r.view.setUint32(4,n,!0)),s&&(r.view.setUint32(8,e,!0),y.view.setUint32(14,e,!0),r.view.setUint32(12,s.size,!0),y.view.setUint32(18,s.size,!0)),t.writeUint8Array(r.array,(function(){c+=16,u()}),d)}function x(){m=m||{},n=n.trim(),m.directory&&"/"!=n.charAt(n.length-1)&&(n+="/"),o.hasOwnProperty(n)?r(l):(g=R(D(n)),a.push(n),function(e){var r;b=m.lastModDate||new Date,y=v(26),o[n]={headerArray:y.array,directory:m.directory,filename:g,offset:c,comment:R(D(m.comment||""))},y.view.setUint32(0,335546376),m.version&&y.view.setUint8(0,m.version),i||0===m.level||m.directory||y.view.setUint16(4,2048),y.view.setUint16(6,(b.getHours()<<6|b.getMinutes())<<5|b.getSeconds()/2,!0),y.view.setUint16(8,(b.getFullYear()-1980<<4|b.getMonth()+1)<<5|b.getDate(),!0),y.view.setUint16(22,g.length,!0),(r=v(30+g.length)).view.setUint32(0,1347093252),r.array.set(y.array,4),r.array.set(g,30),c+=r.array.length,t.writeUint8Array(r.array,e,d)}((function(){s?i||0===m.level?M(w,f++,s,t,0,s.size,!0,k,h,p,d):function(t,n,r,i,o,a,s,c,u){e.zip.useWebWorkers?_(t,{sn:n,options:{level:o},codecClass:"Deflater",crcType:"input"},r,i,0,r.size,s,a,c,u):S(new e.zip.Deflater,r,i,0,r.size,"input",s,a,c,u)}(w,f++,s,t,m.level,k,h,p,d):k()})))}s?s.init(x,p):x()},close:function(e){this._worker&&(this._worker.terminate(),this._worker=null);var n,r,i,s=0,u=0;for(r=0;r<a.length;r++)s+=46+(i=o[a[r]]).filename.length+i.comment.length;for(n=v(s+22),r=0;r<a.length;r++)i=o[a[r]],n.view.setUint32(u,1347092738),n.view.setUint16(u+4,5120),n.array.set(i.headerArray,u+6),n.view.setUint16(u+32,i.comment.length,!0),i.directory&&n.view.setUint8(u+38,16),n.view.setUint32(u+42,i.offset,!0),n.array.set(i.filename,u+46),n.array.set(i.comment,u+46+i.filename.length),u+=46+i.filename.length+i.comment.length;n.view.setUint32(u,1347093766),n.view.setUint16(u+8,a.length,!0),n.view.setUint16(u+10,a.length,!0),n.view.setUint32(u+12,s,!0),n.view.setUint32(u+16,c,!0),t.writeUint8Array(n.array,(function(){t.getData(e)}),d)},_worker:null};e.zip.useWebWorkers?j("deflater",(function(e){h._worker=e,n(h)}),(function(e){r(e)})):n(h)}p.prototype.append=function(e){for(var t=0|this.crc,n=this.table,r=0,i=0|e.length;r<i;r++)t=t>>>8^n[255&(t^e[r])];this.crc=t},p.prototype.get=function(){return~this.crc},p.prototype.table=function(){var e,t,n,r=[];for(e=0;e<256;e++){for(n=e,t=0;t<8;t++)1&n?n=n>>>1^3988292384:n>>>=1;r[e]=n}return r}(),h.prototype.append=function(e,t){return e},h.prototype.flush=function(){},y.prototype=new m,y.prototype.constructor=y,g.prototype=new m,g.prototype.constructor=g,b.prototype=new m,b.prototype.constructor=b,w.prototype.getData=function(e){e(this.data)},k.prototype=new w,k.prototype.constructor=k,x.prototype=new w,x.prototype.constructor=x,$.prototype=new w,$.prototype.constructor=$;var T={deflater:["z-worker.js","deflate.js"],inflater:["z-worker.js","inflate.js"]};function j(t,n,r){if(null===e.zip.workerScripts||null===e.zip.workerScriptsPath){var i,o,a;if(e.zip.workerScripts){if(i=e.zip.workerScripts[t],!Array.isArray(i))return void r(new Error("zip.workerScripts."+t+" is not an array!"));o=i,a=document.createElement("a"),i=o.map((function(e){return a.href=e,a.href}))}else(i=T[t].slice(0))[0]=(e.zip.workerScriptsPath||"")+i[0];var s=new Worker(i[0]);s.codecTime=s.crcTime=0,s.postMessage({type:"importScripts",scripts:i.slice(1)}),s.addEventListener("message",(function e(t){var i=t.data;if(i.error)return s.terminate(),void r(i.error);"importScripts"===i.type&&(s.removeEventListener("message",e),s.removeEventListener("error",c),n(s))})),s.addEventListener("error",c)}else r(new Error("Either zip.workerScripts or zip.workerScriptsPath may be set, not both."));function c(e){s.terminate(),r(e)}}function F(e){console.error(e)}e.zip={Reader:m,Writer:w,BlobReader:b,Data64URIReader:g,TextReader:y,BlobWriter:$,Data64URIWriter:x,TextWriter:k,createReader:function(e,t,n){n=n||F,e.init((function(){O(e,t,n)}),n)},createWriter:function(e,t,n,r){n=n||F,r=!!r,e.init((function(){P(e,t,n,r)}),n)},useWebWorkers:!0,workerScriptsPath:null,workerScripts:null}}(this)},function(e,t){!function(e){"use strict";if(e.zWorkerInitialized)throw new Error("z-worker.js should be run only once");e.zWorkerInitialized=!0,addEventListener("message",(function(e){var n=e.data,r=n.type,i=n.sn,o=t[r];if(o)try{o(n)}catch(e){!function(e,t,n){var r={type:e,sn:t,error:a(n)};postMessage(r)}(r,i,e)}}));var t={importScripts:function(e){e.scripts&&e.scripts.length>0&&importScripts.apply(void 0,e.scripts);postMessage({type:"importScripts"})},newTask:r,append:o,flush:o},n={};function r(t){var r=e[t.codecClass],i=t.sn;if(n[i])throw Error("duplicated sn");n[i]={codec:new r(t.options),crcInput:"input"===t.crcType,crcOutput:"output"===t.crcType,crc:new s},postMessage({type:"newTask",sn:i})}var i=e.performance?e.performance.now.bind(e.performance):Date.now;function o(e){var t=e.sn,o=e.type,a=e.data,s=n[t];!s&&e.codecClass&&(r(e),s=n[t]);var c,u="append"===o,l=i();if(u)try{c=s.codec.append(a,(function(e){postMessage({type:"progress",sn:t,loaded:e})}))}catch(e){throw delete n[t],e}else delete n[t],c=s.codec.flush();var f=i()-l;l=i(),a&&s.crcInput&&s.crc.append(a),c&&s.crcOutput&&s.crc.append(c);var d=i()-l,p={type:o,sn:t,codecTime:f,crcTime:d},h=[];c&&(p.data=c,h.push(c.buffer)),u||!s.crcInput&&!s.crcOutput||(p.crc=s.crc.get());try{postMessage(p,h)}catch(e){postMessage(p)}}function a(e){return{message:e.message,stack:e.stack}}function s(){this.crc=-1}function c(){}s.prototype.append=function(e){for(var t=0|this.crc,n=this.table,r=0,i=0|e.length;r<i;r++)t=t>>>8^n[255&(t^e[r])];this.crc=t},s.prototype.get=function(){return~this.crc},s.prototype.table=function(){var e,t,n,r=[];for(e=0;e<256;e++){for(n=e,t=0;t<8;t++)1&n?n=n>>>1^3988292384:n>>>=1;r[e]=n}return r}(),e.NOOP=c,c.prototype.append=function(e,t){return e},c.prototype.flush=function(){}}(this)},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r=l;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return I()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=u(e,t,n);if("normal"===c.type){if(r=n.done?p:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=p,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l="suspendedStart",f="suspendedYield",d="executing",p="completed",h={};function v(){}function m(){}function y(){}var g={};g[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(A([])));w&&w!==n&&r.call(w,o)&&(g=w);var k=y.prototype=v.prototype=Object.create(g);function x(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function $(e){var t;this._invoke=function(n,i){function o(){return new Promise((function(t,o){!function t(n,i,o,a){var s=u(e[n],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then((function(e){t("next",e,o,a)}),(function(e){t("throw",e,o,a)})):Promise.resolve(l).then((function(e){c.value=e,o(c)}),(function(e){return t("throw",e,o,a)}))}a(s.arg)}(n,i,t,o)}))}return t=t?t.then(o,o):o()}}function _(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,_(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function A(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:I}}function I(){return{value:t,done:!0}}return m.prototype=k.constructor=y,y.constructor=m,y[s]=m.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},x($.prototype),$.prototype[a]=function(){return this},e.AsyncIterator=$,e.async=function(t,n,r,i){var o=new $(c(t,n,r,i));return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},x(k),k[s]="Generator",k[o]=function(){return this},k.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(M),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;M(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="section editor sn-component" id="editor-column" aria-label="Note"><div class="sn-component"><div class="sk-app-bar no-edges" ng-if="ctrl.note.locked" ng-init="ctrl.lockText = \'Note Locked\'" ng-mouseleave="ctrl.lockText = \'Note Locked\'" ng-mouseover="ctrl.lockText = \'Unlock\'"><div class="left"><div class="sk-app-bar-item" ng-click="ctrl.toggleLockNote()"><div class="sk-label warning"><i class="icon ion-locked"></i> {{ctrl.lockText}}</div></div></div></div></div><div class="section-title-bar" id="editor-title-bar" ng-class="{\'locked\' : ctrl.note.locked}" ng-show="ctrl.note &amp;&amp; !ctrl.note.errorDecrypting"><div class="title"><input class="input" id="note-title-editor" ng-blur="ctrl.onNameBlur()" ng-change="ctrl.onTitleChange()" ng-disabled="ctrl.note.locked" ng-focus="ctrl.onNameFocus()" ng-keyup="$event.keyCode == 13 &amp;&amp; ctrl.onTitleEnter($event)" ng-model="ctrl.note.title" select-on-click="true" spellcheck="false"></div><div id="save-status"><div class="message" ng-class="{\'warning sk-bold\': ctrl.syncTakingTooLong, \'danger sk-bold\': ctrl.saveError}">{{ctrl.noteStatus.message}}</div><div class="desc" ng-show="ctrl.noteStatus.desc">{{ctrl.noteStatus.desc}}</div></div><div class="editor-tags"><div id="note-tags-component-container" ng-if="ctrl.tagsComponent"><component-view class="component-view" component="ctrl.tagsComponent" ng-class="{\'locked\' : ctrl.note.locked}" ng-style="ctrl.note.locked &amp;&amp; {\'pointer-events\' : \'none\'}"></component-view></div><input class="tags-input" ng-blur="ctrl.updateTagsFromTagsString($event, ctrl.tagsString)" ng-disabled="ctrl.note.locked" ng-if="!(ctrl.tagsComponent &amp;&amp; ctrl.tagsComponent.active)" ng-keyup="$event.keyCode == 13 &amp;&amp; $event.target.blur();" ng-model="ctrl.tagsString" placeholder="#tags" spellcheck="false" type="text"></div></div><div class="sn-component" ng-if="ctrl.note"><div class="sk-app-bar no-edges" id="editor-menu-bar"><div class="left"><div class="sk-app-bar-item" click-outside="ctrl.showMenu = false;" is-open="ctrl.showMenu" ng-class="{\'selected\' : ctrl.showMenu}" ng-click="ctrl.toggleMenu(\'showMenu\')"><div class="sk-label">Options</div><div class="sk-menu-panel dropdown-menu" ng-if="ctrl.showMenu"><div class="sk-menu-panel-section"><div class="sk-menu-panel-header"><div class="sk-menu-panel-header-title">Note Options</div></div><menu-row action="ctrl.selectedMenuItem(true); ctrl.togglePin()" desc="\'Pin or unpin a note from the top of your list\'" label="ctrl.note.pinned ? \'Unpin\' : \'Pin\'"></menu-row><menu-row action="ctrl.selectedMenuItem(true); ctrl.toggleArchiveNote()" desc="\'Archive or unarchive a note from your Archived system tag\'" label="ctrl.note.archived ? \'Unarchive\' : \'Archive\'"></menu-row><menu-row action="ctrl.selectedMenuItem(true); ctrl.toggleLockNote()" desc="\'Locking notes prevents unintentional editing\'" label="ctrl.note.locked ? \'Unlock\' : \'Lock\'"></menu-row><menu-row action="ctrl.selectedMenuItem(true); ctrl.toggleProtectNote()" desc="\'Protecting a note will require credentials to view it (Manage Privileges via Account menu)\'" label="ctrl.note.content.protected ? \'Unprotect\' : \'Protect\'"></menu-row><menu-row action="ctrl.selectedMenuItem(true); ctrl.toggleNotePreview()" circle="ctrl.note.content.hidePreview ? \'danger\' : \'success\'" circle-align="\'right\'" desc="\'Hide or unhide the note preview from the list of notes\'" label="\'Preview\'"></menu-row><menu-row action="ctrl.selectedMenuItem(); ctrl.deleteNote()" desc="\'Send this note to the trash\'" label="\'Move to Trash\'" ng-show="!ctrl.altKeyDown &amp;&amp; !ctrl.note.content.trashed &amp;&amp; !ctrl.note.errorDecrypting" stylekit-class="\'warning\'"></menu-row><menu-row action="ctrl.selectedMenuItem(); ctrl.deleteNotePermanantely()" desc="\'Delete this note permanently from all your devices\'" label="\'Delete Permanently\'" ng-show="!ctrl.note.content.trashed &amp;&amp; ctrl.note.errorDecrypting" stylekit-class="\'danger\'"></menu-row></div><div ng-if="ctrl.note.content.trashed || ctrl.altKeyDown"><menu-row action="ctrl.selectedMenuItem(true); ctrl.restoreTrashedNote()" desc="\'Undelete this note and restore it back into your notes\'" label="\'Restore\'" ng-show="ctrl.note.content.trashed" stylekit-class="\'info\'"></menu-row><menu-row action="ctrl.selectedMenuItem(true); ctrl.deleteNotePermanantely()" desc="\'Delete this note permanently from all your devices\'" label="\'Delete Permanently\'" stylekit-class="\'danger\'"></menu-row><menu-row action="ctrl.selectedMenuItem(true); ctrl.emptyTrash()" desc="\'Permanently delete all notes in the trash\'" label="\'Empty Trash\'" ng-show="ctrl.note.content.trashed || !ctrl.altKeyDown" stylekit-class="\'danger\'" subtitle="ctrl.getTrashCount() + \' notes in trash\'"></menu-row></div><div class="sk-menu-panel-section"><div class="sk-menu-panel-header"><div class="sk-menu-panel-header-title">Global Display</div></div><menu-row action="ctrl.selectedMenuItem(true); ctrl.toggleKey(\'monospaceFont\')" circle="ctrl.monospaceFont ? \'success\' : \'neutral\'" desc="\'Toggles the font style for the default editor\'" disabled="ctrl.selectedEditor" label="\'Monospace Font\'" subtitle="ctrl.selectedEditor ? \'Not available with editor extensions\' : null"></menu-row><menu-row action="ctrl.selectedMenuItem(true); ctrl.toggleKey(\'spellcheck\')" circle="ctrl.spellcheck ? \'success\' : \'neutral\'" desc="\'Toggles spellcheck for the default editor\'" disabled="ctrl.selectedEditor" label="\'Spellcheck\'" subtitle="ctrl.selectedEditor ? \'Not available with editor extensions\' : (ctrl.isDesktop ? \'May degrade editor performance\' : null)"></menu-row><menu-row action="ctrl.selectedMenuItem(true); ctrl.toggleKey(\'marginResizersEnabled\')" circle="ctrl.marginResizersEnabled ? \'success\' : \'neutral\'" desc="\'Allows for editor left and right margins to be resized\'" faded="!ctrl.marginResizersEnabled" label="\'Margin Resizers\'"></menu-row></div></div></div><div class="sk-app-bar-item" click-outside="ctrl.showEditorMenu = false;" is-open="ctrl.showEditorMenu" ng-class="{\'selected\' : ctrl.showEditorMenu}" ng-click="ctrl.toggleMenu(\'showEditorMenu\')"><div class="sk-label">Editor</div><editor-menu callback="ctrl.editorMenuOnSelect" current-item="ctrl.note" ng-if="ctrl.showEditorMenu" selected-editor="ctrl.selectedEditor"></editor-menu></div><div class="sk-app-bar-item" click-outside="ctrl.showExtensions = false;" is-open="ctrl.showExtensions" ng-class="{\'selected\' : ctrl.showExtensions}" ng-click="ctrl.toggleMenu(\'showExtensions\')"><div class="sk-label">Actions</div><actions-menu item="ctrl.note" ng-if="ctrl.showExtensions"></actions-menu></div><div class="sk-app-bar-item" click-outside="ctrl.showSessionHistory = false;" is-open="ctrl.showSessionHistory" ng-click="ctrl.toggleMenu(\'showSessionHistory\')"><div class="sk-label">Session History</div><session-history-menu item="ctrl.note" ng-if="ctrl.showSessionHistory"></session-history-menu></div></div></div></div><div class="editor-content" id="editor-content" ng-if="ctrl.noteReady &amp;&amp; !ctrl.note.errorDecrypting"><panel-resizer class="left" control="ctrl.leftResizeControl" hoverable="true" min-width="300" ng-if="ctrl.marginResizersEnabled" on-resize-finish="ctrl.onPanelResizeFinish" panel-id="\'editor-content\'" property="\'left\'"></panel-resizer><component-view class="component-view" component="ctrl.selectedEditor" ng-if="ctrl.selectedEditor" on-load="ctrl.onEditorLoad"></component-view><textarea class="editable" id="note-text-editor" dir="auto" ng-attr-spellcheck="{{ctrl.spellcheck}}" ng-change="ctrl.contentChanged()" ng-click="ctrl.clickedTextArea()" ng-focus="ctrl.onContentFocus()" ng-if="!ctrl.selectedEditor" ng-model="ctrl.note.text" ng-model-options="{ debounce: ctrl.EditorNgDebounce}" ng-readonly="ctrl.note.locked" ng-trim="false">{{ctrl.onSystemEditorLoad()}}</textarea><panel-resizer control="ctrl.rightResizeControl" hoverable="true" min-width="300" ng-if="ctrl.marginResizersEnabled" on-resize-finish="ctrl.onPanelResizeFinish" panel-id="\'editor-content\'" property="\'right\'"></panel-resizer></div><div class="section" ng-show="ctrl.note.errorDecrypting"><p class="medium-padding" style="padding-top: 0 !important;">There was an error decrypting this item. Ensure you are running the latest version of this app, then sign out and sign back in to try again.</p></div><div id="editor-pane-component-stack" ng-show="ctrl.note"><div class="sk-app-bar no-edges" id="component-stack-menu-bar" ng-if="ctrl.componentStack.length"><div class="left"><div class="sk-app-bar-item" ng-click="ctrl.toggleStackComponentForCurrentItem(component)" ng-repeat="component in ctrl.componentStack"><div class="sk-app-bar-item-column"><div class="sk-circle small" ng-class="{\'info\' : !component.hidden &amp;&amp; component.active, \'neutral\' : component.hidden || !component.active}"></div></div><div class="sk-app-bar-item-column"><div class="sk-label">{{component.name}}</div></div></div></div></div><div class="sn-component"><component-view class="component-view component-stack-item" component="component" manual-dealloc="true" ng-if="component.active" ng-repeat="component in ctrl.componentStack" ng-show="!component.hidden"></component-view></div></div></div>'}},function(e,t){},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component"><div class="sk-app-bar no-edges no-bottom-edge" id="footer-bar"><div class="left"><div class="sk-app-bar-item" click-outside="ctrl.clickOutsideAccountMenu()" is-open="ctrl.showAccountMenu" ng-click="ctrl.accountMenuPressed()"><div class="sk-app-bar-item-column"><div class="sk-circle small" ng-class="ctrl.error ? \'danger\' : (ctrl.getUser() ? \'info\' : \'neutral\')"></div></div><div class="sk-app-bar-item-column"><div class="sk-label title" ng-class="{red: ctrl.error}">Account</div></div><account-menu close-function="ctrl.closeAccountMenu" ng-click="$event.stopPropagation()" ng-if="ctrl.showAccountMenu" on-successful-auth="ctrl.onAuthSuccess"></account-menu></div><div class="sk-app-bar-item"><a class="no-decoration sk-label title" href="https://standardnotes.org/help" rel="noopener" target="_blank">Help</a></div><div class="sk-app-bar-item border"></div><div class="sk-app-bar-item" ng-repeat="room in ctrl.rooms track by room.uuid"><div class="sk-app-bar-item-column" ng-click="ctrl.selectRoom(room)"><div class="sk-label">{{room.name}}</div></div><component-modal component="room" ng-if="room.showRoom" on-dismiss="ctrl.onRoomDismiss"></component-modal></div></div><div class="center"><div class="sk-app-bar-item" ng-show="ctrl.arbitraryStatusMessage"><div class="sk-app-bar-item-column"><span class="neutral sk-label">{{ctrl.arbitraryStatusMessage}}</span></div></div></div><div class="right"><div class="sk-app-bar-item" ng-click="ctrl.openSecurityUpdate()" ng-show="ctrl.securityUpdateAvailable"><span class="success sk-label">Security update available.</span></div><div class="sk-app-bar-item" ng-click="ctrl.clickedNewUpdateAnnouncement()" ng-show="ctrl.newUpdateAvailable == true"><span class="info sk-label">New update available.</span></div><div class="sk-app-bar-item no-pointer" ng-if="ctrl.lastSyncDate &amp;&amp; !ctrl.isRefreshing"><div class="sk-label subtle">Last refreshed {{ctrl.lastSyncDate | appDateTime}}</div></div><div class="sk-app-bar-item" ng-click="ctrl.toggleSyncResolutionMenu()" ng-if="(ctrl.outOfSync &amp;&amp; !ctrl.isRefreshing) || ctrl.showSyncResolution"><div class="sk-label warning" ng-if="ctrl.outOfSync">Potentially Out of Sync</div><sync-resolution-menu close-function="ctrl.toggleSyncResolutionMenu" ng-click="$event.stopPropagation();" ng-if="ctrl.showSyncResolution"></sync-resolution-menu></div><div class="sk-app-bar-item" ng-if="ctrl.lastSyncDate &amp;&amp; ctrl.isRefreshing"><div class="sk-spinner small"></div></div><div class="sk-app-bar-item" ng-if="ctrl.offline"><div class="sk-label">Offline</div></div><div class="sk-app-bar-item" ng-click="ctrl.refreshData()" ng-if="!ctrl.offline"><div class="sk-label">Refresh</div></div><div class="sk-app-bar-item border" ng-if="ctrl.dockShortcuts.length &gt; 0"></div><div class="sk-app-bar-item dock-shortcut" ng-repeat="shortcut in ctrl.dockShortcuts"><div class="sk-app-bar-item-column" ng-class="{\'underline\': shortcut.component.active}" ng-click="ctrl.selectShortcut(shortcut)"><div class="div" ng-if="shortcut.icon.type == \'circle\'" title="{{shortcut.name}}"><div class="sk-circle small" ng-style="{\'background-color\': shortcut.icon.background_color, \'border-color\': shortcut.icon.border_color}"></div></div><div class="div" ng-if="shortcut.icon.type == \'svg\'" title="{{shortcut.name}}"><div class="svg-item" elem-ready="ctrl.initSvgForShortcut(shortcut)" ng-attr-id="dock-svg-{{shortcut.component.uuid}}"></div></div></div></div><div class="sk-app-bar-item border" ng-if="ctrl.hasPasscode()"></div><div class="sk-app-bar-item" id="lock-item" ng-click="ctrl.lockApp()" ng-if="ctrl.hasPasscode()" title="Locks application and wipes unencrypted data from memory."><div class="sk-label"><i class="icon ion-locked" id="footer-lock-icon"></i></div></div></div></div></div>'}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component section notes" id="notes-column" aria-label="Notes"><div class="content"><div class="section-title-bar" id="notes-title-bar"><div class="padded"><div class="section-title-bar-header"><div class="title">{{ctrl.panelTitle}}</div><div class="sk-button contrast wide" ng-click="ctrl.createNewNote()" title="Create a new note in the selected tag"><div class="sk-label"><i class="icon ion-plus add-button"></i></div></div></div><div class="filter-section" role="search"><input class="filter-bar" id="search-bar" lowercase="true" ng-blur="ctrl.onFilterEnter()" ng-change="ctrl.filterTextChanged()" ng-keyup="$event.keyCode == 13 &amp;&amp; ctrl.onFilterEnter();" ng-model="ctrl.noteFilter.text" placeholder="Search" select-on-click="true" title="Searches notes in the currently selected tag"><div id="search-clear-button" ng-click="ctrl.clearFilterText();" ng-show="ctrl.noteFilter.text">✕</div></div></div><div class="sn-component" id="notes-menu-bar"><div class="sk-app-bar no-edges"><div class="left"><div class="sk-app-bar-item" ng-class="{\'selected\' : ctrl.showMenu}" ng-click="ctrl.showMenu = !ctrl.showMenu"><div class="sk-app-bar-item-column"><div class="sk-label">Options</div></div><div class="sk-app-bar-item-column"><div class="sk-sublabel">{{ctrl.optionsSubtitle()}}</div></div></div><div class="sk-menu-panel dropdown-menu" id="notes-options-menu" ng-show="ctrl.showMenu"><div class="sk-menu-panel-header"><div class="sk-menu-panel-header-title">Sort By</div><a class="info sk-h5" ng-click="ctrl.toggleReverseSort()">{{ctrl.sortReverse === true ? \'Disable Reverse Sort\' : \'Enable Reverse Sort\'}}</a></div><menu-row action="ctrl.selectedMenuItem(); ctrl.selectedSortByCreated()" circle="ctrl.sortBy == \'created_at\' &amp;&amp; \'success\'" desc="\'Sort notes by newest first\'" label="\'Date Added\'"></menu-row><menu-row action="ctrl.selectedMenuItem(); ctrl.selectedSortByUpdated()" circle="ctrl.sortBy == \'client_updated_at\' &amp;&amp; \'success\'" desc="\'Sort notes with the most recently updated first\'" label="\'Date Modified\'"></menu-row><menu-row action="ctrl.selectedMenuItem(); ctrl.selectedSortByTitle()" circle="ctrl.sortBy == \'title\' &amp;&amp; \'success\'" desc="\'Sort notes alphabetically by their title\'" label="\'Title\'"></menu-row><div class="sk-menu-panel-section"><div class="sk-menu-panel-header"><div class="sk-menu-panel-header-title">Display</div></div><menu-row action="ctrl.selectedMenuItem(); ctrl.togglePrefKey(\'showArchived\')" circle="ctrl.showArchived ? \'success\' : \'danger\'" desc="\'Archived notes are usually hidden. You can explicitly show them with this option.\'" faded="!ctrl.showArchived" label="\'Archived Notes\'"></menu-row><menu-row action="ctrl.selectedMenuItem(); ctrl.togglePrefKey(\'hidePinned\')" circle="ctrl.hidePinned ? \'danger\' : \'success\'" desc="\'Pinned notes always appear on top. You can hide them temporarily with this option so you can focus on other notes in the list.\'" faded="ctrl.hidePinned" label="\'Pinned Notes\'"></menu-row><menu-row action="ctrl.selectedMenuItem(); ctrl.togglePrefKey(\'hideNotePreview\')" circle="ctrl.hideNotePreview ? \'danger\' : \'success\'" desc="\'Hide the note preview for a more condensed list of notes\'" faded="ctrl.hideNotePreview" label="\'Note Preview\'"></menu-row><menu-row action="ctrl.selectedMenuItem(); ctrl.togglePrefKey(\'hideDate\')" circle="ctrl.hideDate ? \'danger\' : \'success\'" desc="\'Hide the date displayed in each row\'" faded="ctrl.hideDate" label="\'Date\'"></menu-row><menu-row action="ctrl.selectedMenuItem(); ctrl.togglePrefKey(\'hideTags\')" circle="ctrl.hideTags ? \'danger\' : \'success\'" desc="\'Hide the list of tags associated with each note\'" faded="ctrl.hideTags" label="\'Tags\'"></menu-row></div></div></div></div></div></div><div class="scrollable"><div class="infinite-scroll" id="notes-scrollable" can-load="true" infinite-scroll="ctrl.paginate()" threshold="200"><div class="note" ng-class="{\'selected\' : ctrl.selectedNote == note}" ng-click="ctrl.selectNote(note, true)" ng-repeat="note in (ctrl.renderedNotes = (ctrl.notes | limitTo:ctrl.notesToDisplay)) track by note.uuid"><div class="note-flags" ng-show="note.flags.length &gt; 0"><div class="flag" ng-class="flag.class" ng-repeat="flag in note.flags"><div class="label">{{flag.text}}</div></div></div><div class="name" ng-show="note.title">{{note.title}}</div><div class="note-preview" ng-if="!ctrl.hideNotePreview &amp;&amp; !note.content.hidePreview &amp;&amp; !note.content.protected"><div class="html-preview" ng-bind-html="note.content.preview_html" ng-show="note.content.preview_html"></div><div class="plain-preview" ng-show="!note.content.preview_html &amp;&amp; note.content.preview_plain">{{note.content.preview_plain}}</div><div class="default-preview" ng-show="!note.content.preview_html &amp;&amp; !note.content.preview_plain">{{note.text}}</div></div><div class="date faded" ng-show="!ctrl.hideDate"><span ng-show="ctrl.sortBy == \'client_updated_at\'">Modified {{note.cachedUpdatedAtString || \'Now\'}}</span><span ng-show="ctrl.sortBy != \'client_updated_at\'">{{note.cachedCreatedAtString || \'Now\'}}</span></div><div class="tags-string" ng-show="note.shouldShowTags"><div class="faded">{{note.savedTagsString || note.tagsString()}}</div></div></div></div></div></div><panel-resizer collapsable="true" control="ctrl.panelController" default-width="300" hoverable="true" on-resize-finish="ctrl.onPanelResize" panel-id="\'notes-column\'"></panel-resizer></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component section tags" id="tags-column" aria-label="Tags"><div class="component-view-container" ng-if="ctrl.component.active"><component-view class="component-view" component="ctrl.component"></component-view></div><div class="content" id="tags-content" ng-if="!(ctrl.component &amp;&amp; ctrl.component.active)"><div class="tags-title-section section-title-bar"><div class="section-title-bar-header"><div class="sk-h3 title"><span class="sk-bold">Views</span></div><div class="sk-button sk-secondary-contrast wide" ng-click="ctrl.clickedAddNewTag()" title="Create a new tag"><div class="sk-label"><i class="icon ion-plus add-button"></i></div></div></div></div><div class="scrollable"><div class="infinite-scroll"><div class="tag" ng-class="{\'selected\' : ctrl.selectedTag == tag, \'faded\' : !tag.content.isAllTag}" ng-click="ctrl.selectTag(tag)" ng-repeat="tag in ctrl.smartTags"><div class="tag-info"><input class="title" ng-disabled="true" ng-model="tag.title"><div class="count" ng-show="tag.content.isAllTag">{{tag.cachedNoteCount}}</div></div></div><div class="tags-title-section section-title-bar"><div class="section-title-bar-header"><div class="sk-h3 title"><span class="sk-bold">Tags</span></div></div></div><div class="tag" ng-class="{\'selected\' : ctrl.selectedTag == tag}" ng-click="ctrl.selectTag(tag)" ng-repeat="tag in ctrl.tags track by tag.uuid"><div class="tag-info"><div class="tag-icon">#</div><input class="title" ng-attr-id="tag-{{tag.uuid}}" ng-blur="ctrl.saveTag($event, tag)" ng-change="ctrl.tagTitleDidChange(tag)" ng-class="{\'editing\' : ctrl.editingTag == tag}" ng-click="ctrl.selectTag(tag)" ng-keyup="$event.keyCode == 13 &amp;&amp; $event.target.blur()" ng-model="tag.title" should-focus="ctrl.newTag || ctrl.editingTag == tag" sn-autofocus="true" spellcheck="false"><div class="count">{{tag.cachedNoteCount}}</div></div><div class="danger small-text bold" ng-show="tag.content.conflict_of">Conflicted Copy</div><div class="danger small-text bold" ng-show="tag.errorDecrypting">Missing Keys</div><div class="menu" ng-show="ctrl.selectedTag == tag"><a class="item" ng-click="ctrl.selectedRenameTag($event, tag)" ng-show="!ctrl.editingTag">Rename</a><a class="item" ng-click="ctrl.saveTag($event, tag)" ng-show="ctrl.editingTag">Save</a><a class="item" ng-click="ctrl.selectedDeleteTag(tag)">Delete</a></div></div><div class="no-tags-placeholder" ng-show="ctrl.tags.length == 0">No tags. Create one using the add button above.</div></div></div></div><panel-resizer collapsable="true" control="ctrl.panelController" default-width="150" hoverable="true" on-resize-finish="ctrl.onPanelResize" panel-id="\'tags-column\'"></panel-resizer></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="main-ui-view" ng-class="platform"><lock-screen ng-if="needsUnlock" on-success="onSuccessfulUnlock"></lock-screen><div class="app" id="app" ng-class="appClass" ng-if="!needsUnlock"><tags-panel add-new="tagsAddNew" remove-tag="removeTag" save="tagsSave" selection-made="tagsSelectionMade"></tags-panel><notes-panel add-new="notesAddNew" selection-made="notesSelectionMade" tag="selectedTag"></notes-panel><editor-panel note="selectedNote" remove="deleteNote" update-tags="updateTagsForNote"></editor-panel></div><footer ng-if="!needsUnlock"></footer></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component" id="lock-screen"><div class="sk-panel"><div class="sk-panel-header"><div class="sk-panel-header-title">Passcode Required</div></div><div class="sk-panel-content"><div class="sk-panel-section"><form class="sk-panel-form sk-panel-row" ng-submit="submitPasscodeForm()"><div class="sk-panel-column stretch"><input class="center-text sk-input contrast" id="passcode-input" autocomplete="new-password" autofocus="true" ng-model="formData.passcode" placeholder="Enter Passcode" should-focus="true" sn-autofocus="true" type="password"><div class="sk-button-group stretch sk-panel-row form-submit"><button class="sk-button info" type="submit"><div class="sk-label">Unlock</div></button></div></div></form></div></div><div class="sk-panel-footer"><div id="passcode-reset"><a class="sk-a neutral" ng-click="forgotPasscode()" ng-if="!formData.showRecovery">Forgot?</a><div ng-if="formData.showRecovery"><div class="sk-p">If you forgot your local passcode, your only option is to clear your local data from this device\nand sign back in to your account.</div><div class="sk-panel-row"></div><a class="sk-a danger center-text" ng-click="beginDeleteData()">Delete Local Data</a></div></div></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component"><div class="sk-panel" id="account-panel"><div class="sk-panel-header"><div class="sk-panel-header-title">Account</div><a class="sk-a info close-button" ng-click="close()">Close</a></div><div class="sk-panel-content"><div class="sk-panel-section sk-panel-hero" ng-if="!user &amp;&amp; !formData.showLogin &amp;&amp; !formData.showRegister &amp;&amp; !formData.mfa"><div class="sk-panel-row"><div class="sk-h1">Sign in or register to enable sync and end-to-end encryption.</div></div><div class="sk-panel-row"><div class="sk-button-group stretch"><div class="sk-button info featured" ng-click="formData.showLogin = true"><div class="sk-label">Sign In</div></div><div class="sk-button info featured" ng-click="formData.showRegister = true"><div class="sk-label">Register</div></div></div></div><div class="sk-panel-row sk-p">Standard Notes is free on every platform, and comes standard with sync and encryption.</div></div><div class="sk-panel-section" ng-if="formData.showLogin || formData.showRegister"><div class="sk-panel-section-title">{{formData.showLogin ? "Sign In" : "Register"}}</div><form class="sk-panel-form" ng-submit="submitAuthForm()"><div class="sk-panel-section"><input class="sk-input contrast" name="email" ng-model="formData.email" ng-model-options="{allowInvalid: true}" placeholder="Email" required="" should-focus="true" sn-autofocus="true" spellcheck="false" type="email"><input class="sk-input contrast" name="password" ng-model="formData.user_password" placeholder="Password" required="" sn-enter="submitAuthForm()" type="password"><input class="sk-input contrast" name="password" ng-if="formData.showRegister" ng-model="formData.password_conf" placeholder="Confirm Password" required="" sn-enter="submitAuthForm()" type="password"><div class="sk-panel-row"></div><a class="sk-panel-row sk-bold" ng-click="formData.showAdvanced = !formData.showAdvanced">Advanced Options</a></div><div class="sk-notification unpadded contrast advanced-options sk-panel-row" ng-if="formData.showAdvanced"><div class="sk-panel-column stretch"><div class="sk-notification-title sk-panel-row padded-row">Advanced Options</div><div class="bordered-row padded-row"><label class="sk-label">Sync Server Domain</label><input class="sk-input mt-5 sk-base" name="server" ng-model="formData.url" placeholder="Server URL" required="" type="text"></div><label class="sk-label padded-row" ng-if="formData.showLogin"><input class="sk-input" ng-model="formData.strictSignin" type="checkbox">Use strict sign in<span><a class="info" href="https://standardnotes.org/help/security" rel="noopener" target="_blank">(Learn more)</a></span></label></div></div><div class="sk-panel-section form-submit" ng-if="!formData.authenticating"><div class="sk-button-group stretch"><div class="sk-button info featured" ng-click="submitAuthForm()" ng-disabled="formData.authenticating"><div class="sk-label">{{formData.showLogin ? "Sign In" : "Register"}}</div></div></div></div><div class="sk-notification neutral" ng-if="formData.showRegister"><div class="sk-notification-title">No Password Reset.</div><div class="sk-notification-text">Because your notes are encrypted using your password, Standard Notes does not have a password reset option. You cannot forget your password.</div></div><div class="sk-panel-section no-bottom-pad" ng-if="formData.status"><div class="sk-horizontal-group"><div class="sk-spinner small neutral"></div><div class="sk-label">{{formData.status}}</div></div></div><div class="sk-panel-section no-bottom-pad" ng-if="!formData.authenticating"><label class="sk-panel-row justify-left"><div class="sk-horizontal-group"><input ng-false-value="true" ng-model="formData.ephemeral" ng-true-value="false" type="checkbox">Stay signed in</div></label><label class="sk-panel-row justify-left" ng-if="notesAndTagsCount() &gt; 0"><div class="sk-panel-row"></div><input ng-bind="true" ng-change="mergeLocalChanged()" ng-model="formData.mergeLocal" type="checkbox">Merge local data ({{notesAndTagsCount()}} notes and tags)</label></div></form></div><div class="sk-panel-section" ng-if="formData.mfa"><form class="sk-panel-form" ng-submit="submitMfaForm()"><div class="sk-p sk-panel-row">{{formData.mfa.message}}</div><div class="sk-panel-row"><input class="sk-input contrast" autofocus="true" name="mfa" ng-model="formData.userMfaCode" placeholder="Enter Code" required="" should-focus="true" sn-autofocus="true"></div><div class="sk-button-group stretch sk-panel-row form-submit" ng-if="!formData.status"><button class="sk-button info featured" type="submit"><div class="sk-label">Sign In</div></button></div></form><div class="sk-panel-section no-bottom-pad" ng-if="formData.status"><div class="sk-panel-row"></div><div class="sk-panel-row"></div><div class="sk-horizontal-group"><div class="sk-spinner small neutral"></div><div class="sk-label">{{formData.status}}</div></div></div></div><div ng-if="!formData.showLogin &amp;&amp; !formData.showRegister &amp;&amp; !formData.mfa"><div class="sk-panel-section" ng-if="user"><div class="sk-notification danger" ng-if="syncStatus.error"><div class="sk-notification-title">Sync Unreachable</div><div class="sk-notification-text">Hmm...we can\'t seem to sync your account. The reason: {{syncStatus.error.message}}</div><a class="sk-a info-contrast sk-bold sk-panel-row" href="https://standardnotes.org/help" rel="noopener" target="_blank">Need help?</a></div><div class="sk-panel-row"><div class="sk-panel-column"><div class="sk-h1 sk-bold wrap">{{user.email}}</div><div class="sk-subtitle subtle normal">{{server}}</div></div><div class="sk-horizontal-group" delay="1000" delay-hide="true" show="syncStatus.syncOpInProgress || syncStatus.needsMoreSync"><div class="sk-spinner small info"></div><div class="sk-sublabel">{{"Syncing" + (syncStatus.total > 0 ? ":" : "")}}<span ng-if="syncStatus.total &gt; 0">{{syncStatus.current}}/{{syncStatus.total}}</span></div></div></div><div class="sk-panel-row"></div><a class="sk-a info sk-panel-row condensed" ng-click="openPasswordWizard(\'change-pw\')">Change Password</a><a class="sk-a info sk-panel-row condensed" ng-click="openPrivilegesModal(\'\')" ng-show="user">Manage Privileges</a><a class="sk-panel-row justify-left condensed success" ng-click="openPasswordWizard(\'upgrade-security\')" ng-if="securityUpdateAvailable"><div class="inline sk-circle small success mr-8"></div><div class="inline">Security Update Available</div></a></div><div class="sk-panel-section"><div class="sk-panel-section-title">Encryption</div><div class="sk-panel-section-subtitle info" ng-if="encryptionEnabled()">{{encryptionStatusForNotes()}}</div><p class="sk-p">{{encryptionStatusString()}}</p></div><div class="sk-panel-section"><div class="sk-panel-section-title">Passcode Lock</div><div ng-if="!hasPasscode()"><div ng-if="canAddPasscode"><div class="sk-panel-row" ng-if="!formData.showPasscodeForm"><div class="sk-button info" ng-click="addPasscodeClicked(); $event.stopPropagation();"><div class="sk-label">Add Passcode</div></div></div><p class="sk-p">Add a passcode to lock the application and encrypt on-device key storage.</p></div><div ng-if="!canAddPasscode"><p class="sk-p">Adding a passcode is not supported in temporary sessions. Please sign out, then sign back in with the "Stay signed in" option checked.</p></div></div><form class="sk-panel-form" ng-if="formData.showPasscodeForm" ng-submit="submitPasscodeForm()"><div class="sk-panel-row"></div><input class="sk-input contrast" ng-model="formData.passcode" placeholder="Passcode" should-focus="true" sn-autofocus="true" type="password"><input class="sk-input contrast" ng-model="formData.confirmPasscode" placeholder="Confirm Passcode" type="password"><div class="sk-button-group stretch sk-panel-row form-submit"><button class="sk-button info" type="submit"><div class="sk-label">Set Passcode</div></button></div><a class="neutral sk-a sk-panel-row" ng-click="formData.showPasscodeForm = false">Cancel</a></form><div ng-if="hasPasscode() &amp;&amp; !formData.showPasscodeForm"><div class="sk-p">Passcode lock is enabled.</div><div class="sk-notification contrast"><div class="sk-notification-title">Options</div><div class="sk-notification-text"><div class="sk-panel-row"><div class="sk-horizontal-group"><div class="sk-h4 sk-bold">Autolock</div><a class="sk-a info" ng-class="{\'boxed\' : option.value == selectedAutoLockInterval}" ng-click="selectAutoLockInterval(option.value)" ng-repeat="option in passcodeAutoLockOptions">{{option.label}}</a></div></div><div class="sk-p">The autolock timer begins when the window or tab loses focus.</div><div class="sk-panel-row"></div><a class="sk-a info sk-panel-row condensed" ng-click="openPrivilegesModal(\'\')" ng-show="!user">Manage Privileges</a><a class="sk-a info sk-panel-row condensed" ng-click="changePasscodePressed()">Change Passcode</a><a class="sk-a danger sk-panel-row condensed" ng-click="removePasscodePressed()">Remove Passcode</a></div></div></div></div><div class="sk-panel-section" ng-if="!importData.loading"><div class="sk-panel-section-title">Data Backups</div><div class="sk-p">Download a backup of all your data.</div><div class="sk-panel-row"></div><form class="sk-panel-form sk-panel-row" ng-if="encryptedBackupsAvailable()"><div class="sk-input-group"><label><input ng-change="archiveFormData.encrypted = true" ng-model="archiveFormData.encrypted" ng-value="true" type="radio">Encrypted</label><label><input ng-change="archiveFormData.encrypted = false" ng-model="archiveFormData.encrypted" ng-value="false" type="radio">Decrypted</label></div></form><div class="sk-button-group sk-panel-row justify-left"><div class="sk-button info" ng-click="downloadDataArchive()"><div class="sk-label">Download Backup</div></div><label class="sk-button info"><input file-change="-&gt;" handler="importFileSelected(files)" style="display: none;" type="file"><div class="sk-label">Import Backup</div></label></div><span ng-if="isDesktopApplication()">Backups are automatically created on desktop and can be managed via the "Backups" top-level menu.</span><div id="import-password-request" ng-if="importData.requestPassword"><form class="sk-panel-form stretch" ng-submit="submitImportPassword()"><p>Enter the account password associated with the import file.</p><input class="sk-input contrast mt-5" autofocus="true" ng-model="importData.password" placeholder="Enter File Account Password" type="password"><div class="sk-button-group stretch sk-panel-row form-submit"><button class="sk-button info" type="submit"><div class="sk-label">Decrypt & Import</div></button></div><p>Importing from backup will not overwrite existing data, but instead create a duplicate of any differing data.</p><p>If you\'d like to import only a selection of items instead of the whole file, please use the Batch Manager extension.</p></form></div><div class="sk-panel-row"><div class="sk-spinner small info" ng-if="importData.loading"></div></div></div></div></div><div class="sk-panel-footer"><div class="sk-panel-row"><div class="sk-p left neutral faded">{{appVersion}}</div><a class="sk-a right" ng-click="formData.showLogin = false; formData.showRegister = false;" ng-if="formData.showLogin || formData.showRegister">Cancel</a><a class="sk-a right danger" ng-click="destroyLocalData()" ng-if="!formData.showLogin &amp;&amp; !formData.showRegister">{{ user ? "Sign out and clear local data" : "Clear all local data" }}</a></div></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component"><div class="sk-menu-panel dropdown-menu"><a class="no-decoration" href="https://standardnotes.org/extensions" ng-if="extensions.length == 0" rel="noopener" target="blank"><menu-row label="\'Download Actions\'"></menu-row></a><div ng-repeat="extension in extensions"><div class="sk-menu-panel-header" ng-click="extension.hide = !extension.hide; $event.stopPropagation();"><div class="sk-menu-panel-column"><div class="sk-menu-panel-header-title">{{extension.name}}</div><div class="sk-spinner small loading" ng-if="extension.loading"></div><div ng-if="extension.hide">…</div></div></div><menu-row action="executeAction(action, extension);" label="action.label" ng-if="!extension.hide" ng-repeat="action in extension.actionsWithContextForItem(item)" spinner-class="action.running ? \'info\' : null" sub-rows="action.subrows" subtitle="action.desc"><div class="sk-sublabel" ng-if="action.access_type">Uses <strong>{{action.access_type}}</strong> access to this note.</div></menu-row><menu-row faded="true" label="\'No Actions Available\'" ng-if="extension.actionsWithContextForItem(item).length == 0"></menu-row></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sk-modal-background" ng-click="dismiss()"></div><div class="sk-modal-content" ng-attr-id="component-content-outer-{{component.uuid}}"><div class="sn-component"><div class="sk-panel" ng-attr-id="component-content-inner-{{component.uuid}}"><div class="sk-panel-header"><div class="sk-panel-header-title">{{component.name}}</div><a class="sk-a info close-button" ng-click="dismiss()">Close</a></div><component-view class="component-view" component="component"></component-view></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component" ng-if="issueLoading"><div class="sk-app-bar no-edges no-top-edge dynamic-height"><div class="left"><div class="sk-app-bar-item"><div class="sk-label warning">There was an issue loading {{component.name}}.</div></div></div><div class="right"><div class="sk-app-bar-item" ng-click="reloadComponent()"><div class="sk-button info"><div class="sk-label">Reload</div></div></div></div></div></div><div class="sn-component" ng-if="showNoThemesMessage"><div class="sk-app-bar no-edges no-top-edge dynamic-height"><div class="left"><div class="sk-app-bar-item"><div class="sk-label warning">This extension does not support themes.</div></div></div><div class="right"><div class="sk-app-bar-item" ng-click="noThemesMessageDismiss()"><div class="sk-label">Dismiss</div></div><div class="sk-app-bar-item" ng-click="disableActiveTheme()"><div class="sk-label">Disable Active Theme</div></div></div></div></div><div class="sn-component" ng-if="expired"><div class="sk-app-bar no-edges no-top-edge dynamic-height"><div class="left"><div class="sk-app-bar-item"><div class="sk-app-bar-item-column"><div class="sk-circle danger small"></div></div><div class="sk-app-bar-item-column"><div><a class="sk-label sk-base" href="https://dashboard.standardnotes.org" rel="noopener" target="_blank">Your Extended subscription expired on {{component.dateToLocalizedString(component.valid_until)}}.</a><div class="sk-p">Extensions are in a read-only state.</div></div></div></div></div><div class="right"><div class="sk-app-bar-item" ng-click="reloadComponent()"><div class="sk-button info"><div class="sk-label">Reload</div></div></div><div class="sk-app-bar-item"><div class="sk-app-bar-item-column"><div class="sk-button warning"><a class="sk-label" href="https://standardnotes.org/help/41/expired" rel="noopener" target="_blank">Help</a></div></div></div></div></div></div><div class="sn-component" ng-if="error == \'offline-restricted\'"><div class="sk-panel static"><div class="sk-panel-content"><div class="sk-panel-section stretch"><div class="sk-panel-column"></div><div class="sk-h1 sk-bold">You have restricted this extension to be used offline only.</div><div class="sk-subtitle">Offline extensions are not available in the Web app.</div><div class="sk-panel-row"></div><div class="sk-panel-row"><div class="sk-panel-column"><div class="sk-p">You can either:</div><ul><li class="sk-p"><strong>Enable the Hosted option</strong> for this extension by opening the \'Extensions\' menu and toggling \'Use hosted when local is unavailable\' under this extension\'s options. Then press Reload below.</li><li class="sk-p"><strong>Use the Desktop application.</strong></li></ul></div></div><div class="sk-panel-row"><div class="sk-button info" ng-click="reloadStatus()" ng-if="!reloading"><div class="sk-label">Reload</div></div><div class="sk-spinner info small" ng-if="reloading"></div></div></div></div></div></div><div class="sn-component" ng-if="error == \'url-missing\'"><div class="sk-panel static"><div class="sk-panel-content"><div class="sk-panel-section stretch"><div class="sk-panel-section-title">This extension is not installed correctly.</div><p>Please uninstall {{component.name}}, then re-install it.</p><p>This issue can occur if you access Standard Notes using an older version of the app.\nEnsure you are running at least version 2.1 on all platforms.</p></div></div></div></div><iframe data-component-id="{{component.uuid}}" frameborder="0" ng-attr-id="component-iframe-{{component.uuid}}" ng-if="component &amp;&amp; componentValid" ng-src="{{getUrl() | trusted}}" sandbox="allow-scripts allow-top-navigation-by-user-activation allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-modals allow-forms">Loading</iframe><div class="loading-overlay" ng-if="loading"></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component"><div class="sk-modal large" id="conflict-resolution-modal"><div class="sk-modal-background"></div><div class="sk-modal-content"><div class="sk-panel"><div class="sk-panel-header"><h1 class="sk-panel-header-title">Conflicted items — choose which version to keep</h1><div class="sk-horizontal-group"><a class="sk-a info close-button" ng-click="keepItem1()">Keep left</a><a class="sk-a info close-button" ng-click="keepItem2()">Keep right</a><a class="sk-a info close-button" ng-click="keepBoth()">Keep both</a><a class="sk-a info close-button" ng-click="export()">Export</a><a class="sk-a info close-button" ng-click="dismiss(); $event.stopPropagation()">Close</a></div></div><div class="sk-panel-content selectable"><div class="sk-panel-section"><h3><strong>Content type:</strong>{{contentType}}</h3><p>You may wish to look at the "created_at" and "updated_at" fields of the items to gain better context in deciding which to keep.</p></div><div id="items"><div class="sk-panel static item" id="item1"><p class="normal" style="white-space: pre-wrap; font-size: 16px;">{{item1Content}}</p></div><div class="border"></div><div class="sk-panel static item" id="item2"><p class="normal" style="white-space: pre-wrap; font-size: 16px;">{{item2Content}}</p></div></div></div></div></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component"><div class="sk-menu-panel dropdown-menu"><div class="sk-menu-panel-section"><div class="sk-menu-panel-header"><div class="sk-menu-panel-header-title">Note Editor</div></div><menu-row action="selectComponent(null)" circle="selectedEditor == null &amp;&amp; \'success\'" label="\'Plain Editor\'"></menu-row><menu-row action="selectComponent(editor)" button-action="toggleDefaultForEditor(editor)" button-class="defaultEditor == editor ? \'warning\' : \'info\'" button-text="defaultEditor == editor ? \'Undefault\' : \'Set Default\'" circle="selectedEditor === editor &amp;&amp; \'success\'" has-button="selectedEditor == editor || defaultEditor == editor" label="editor.name" ng-repeat="editor in editors"><div class="sk-menu-panel-column" ng-if="component.content.conflict_of || shouldDisplayRunningLocallyLabel(editor)"><strong class="danger medium-text" ng-if="editor.content.conflict_of">Conflicted copy</strong><div class="sk-sublabel" ng-if="shouldDisplayRunningLocallyLabel(editor)">Running Locally</div></div></menu-row><a class="no-decoration" href="https://standardnotes.org/extensions" ng-if="editors.length == 0" rel="noopener" target="blank"><menu-row label="\'Download More Editors\'"></menu-row></a></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component"><div class="sk-modal small auto-height"><div class="sk-modal-background"></div><div class="sk-modal-content"><div class="sn-component"><div class="sk-panel"><div class="sk-panel-header"><div class="sk-h1 sk-panel-header-title">{{title}}</div><a class="sk-a info close-button" ng-click="dismiss()">Close</a></div><div class="sk-panel-content"><div class="sk-panel-section"><div class="sk-p sk-panel-row">{{message}}</div><div class="sk-panel-row"><div class="sk-panel-column stretch"><form ng-submit="submit()"><input class="sk-input contrast" ng-model="formData.input" placeholder="{{placeholder}}" should-focus="true" sn-autofocus="true" type="{{type}}"></form></div></div></div></div><div class="sk-panel-footer"><a class="sk-a info right" ng-click="submit()">Submit</a></div></div></div></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sk-menu-panel-row row" ng-attr-title="{{desc}}" ng-click="onClick($event)"><div class="sk-menu-panel-column"><div class="left"><div class="sk-menu-panel-column" ng-if="circle &amp;&amp; (!circleAlign || circleAlign == \'left\')"><div class="sk-circle small" ng-class="circle"></div></div><div class="sk-menu-panel-column" ng-class="{\'faded\' : faded || disabled}"><div class="sk-label" ng-class="stylekitClass">{{label}}</div><div class="sk-sublabel" ng-if="subtitle">{{subtitle}}</div><ng-transclude></ng-transclude></div></div><div class="sk-menu-panel-subrows" ng-if="subRows &amp;&amp; subRows.length &gt; 0"><menu-row action="row.onClick()" label="row.label" ng-repeat="row in subRows" spinner-class="row.spinnerClass" subtitle="row.subtitle"></menu-row></div></div><div class="sk-menu-panel-column" ng-if="circle &amp;&amp; circleAlign == \'right\'"><div class="sk-circle small" ng-class="circle"></div></div><div class="sk-menu-panel-column" ng-if="hasButton"><div class="sk-button" ng-class="buttonClass" ng-click="clickButton($event)"><div class="sk-label">{{buttonText}}</div></div></div><div class="sk-menu-panel-column" ng-if="spinnerClass"><div class="sk-spinner small" ng-class="spinnerClass"></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="panel-resizer-column"></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component"><div class="sk-modal small auto-height" id="password-wizard"><div class="sk-modal-background"></div><div class="sk-modal-content"><div class="sn-component"><div class="sk-panel"><div class="sk-panel-header"><div class="sk-panel-header-title">{{title}}</div><a class="sk-a info close-button" ng-click="dismiss()">Close</a></div><div class="sk-panel-content"><div ng-if="step == 0"><div ng-if="changePassword"><p class="sk-p sk-panel-row">Changing your password involves changing your encryption key, which requires your data to be re-encrypted and synced.\nIf you have many items, syncing your data can take several minutes.</p><p class="sk-p sk-panel-row">You must keep the application window open during this process.</p></div><div ng-if="securityUpdate"><p class="sk-p sk-panel-row">A new update is available for your account. Updates address improvements and enhancements to our security specification.\nThis process will guide you through the update, and perform the steps necessary with your supervision.</p><div class="sk-panel-row"><div class="sk-panel-column"><p class="sk-p">For more information about security updates, please visit</p><a class="sk-a info" href="https://standardnotes.org/help/security" rel="noopener" target="_blank">standardnotes.org/help/security.</a></div></div></div><p class="sk-panel-row sk-p"></p><div class="info">Press Continue to proceed.</div><p></p></div><div class="sk-panel-section" ng-if="step &gt; 0"><div class="sk-panel-section-title">Step {{step}} — {{titleForStep(step)}}</div><div ng-if="step == 1"><p class="sk-panel-row sk-p">As a result of this process, the entirety of your data will be re-encrypted and synced to your account. This is a generally safe process,\nbut unforeseen factors like poor network connectivity or a sudden shutdown of your computer may cause this process to fail.\nIt\'s best to be on the safe side before large operations such as this one.</p><div class="sk-panel-row"></div><div class="sk-panel-row"><div class="sk-button-group"><div class="sk-button info" ng-click="downloadBackup(true)"><div class="sk-label">Download Encrypted Backup</div></div><div class="sk-button info" ng-click="downloadBackup(false)"><div class="sk-label">Download Decrypted Backup</div></div></div></div></div><div ng-if="step == 2"><p class="sk-p sk-panel-row">As a result of this process, your encryption keys will change.\nAny device on which you use Standard Notes will need to end its session. After this process completes, you will be asked to sign back in.</p><p class="sk-p bold sk-panel-row info-i">Please sign out of all applications (excluding this one), including:</p><ul><li class="sk-p">Desktop</li><li class="sk-p">Web (Chrome, Firefox, Safari)</li><li class="sk-p">Mobile (iOS and Android)</li></ul><p class="sk-p sk-panel-row">If you do not currently have access to a device you\'re signed in on, you may proceed,\nbut must make signing out and back in the first step upon gaining access to that device.</p><p class="sk-p sk-panel-row">Press Continue only when you have completed signing out of all your devices.</p></div><div ng-if="step == 3"><div ng-if="changePassword"></div><div ng-if="securityUpdate"><p class="sk-panel-row">Enter your current password. We\'ll run this through our encryption scheme to generate strong new encryption keys.</p></div><div class="sk-panel-row"></div><div class="sk-panel-row"><div class="sk-panel-column stretch"><form class="sk-panel-form"><input class="sk-input contrast" ng-model="formData.currentPassword" placeholder="Current Password" should-focus="true" sn-autofocus="true" type="password"><input class="sk-input contrast" ng-if="changePassword" ng-model="formData.newPassword" placeholder="New Password" type="password"><input class="sk-input contrast" ng-if="changePassword" ng-model="formData.newPasswordConfirmation" placeholder="Confirm New Password" type="password"></form></div></div></div><div ng-if="step == 4"><p class="sk-panel-row">Your data is being re-encrypted with your new keys and synced to your account.</p><p class="sk-panel-row danger" ng-if="lockContinue">Do not close this window until this process completes.</p><div class="sk-panel-row"><div class="sk-panel-column"><div class="sk-spinner small inline info mr-5" ng-if="formData.processing"></div><div class="inline bold" ng-class="{\'info\' : !formData.statusError, \'error\' : formData.statusError}">{{formData.status}}</div></div><div class="sk-panel-column" delay="1000" delay-hide="true" show="syncStatus.syncOpInProgress || syncStatus.needsMoreSync"><p class="info">Syncing {{syncStatus.current}}/{{syncStatus.total}}</p></div></div></div><div ng-if="step == 5"><div ng-if="changePassword"><p class="sk-p sk-panel-row info-i">Your password has been successfully changed.</p></div><div ng-if="securityUpdate"><p class="sk-p sk-panel-row info-i">The security update has been successfully applied to your account.</p></div><p class="sk-p sk-panel-row">Please ensure you are running the latest version of Standard Notes on all platforms to ensure maximum compatibility.</p><p class="sk-p sk-panel-row">You may now sign back in on all your devices and close this window.</p></div></div></div><div class="sk-panel-footer"><div class="empty"></div><a class="sk-a info right" ng-class="{\'disabled\' : lockContinue}" ng-click="continue()" ng-disabled="lockContinue"><div class="sk-spinner small inline info mr-5" ng-if="showSpinner"></div>{{continueTitle}}</a></div></div></div></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sk-modal-background" ng-click="deny()"></div><div class="sk-modal-content" id="permissions-modal"><div class="sn-component"><div class="sk-panel"><div class="sk-panel-header"><div class="sk-panel-header-title">Activate Extension</div><a class="sk-a info close-button" ng-click="deny()">Cancel</a></div><div class="sk-panel-content"><div class="sk-panel-section"><div class="sk-panel-row"><div class="sk-h2"><strong>{{component.name}}</strong> would like to interact with your\n {{permissionsString}}</div></div><div class="sk-panel-row"><p class="sk-p">Extensions use an offline messaging system to communicate. Learn more at<a class="sk-a info" href="https://standardnotes.org/permissions" rel="noopener" target="_blank">https://standardnotes.org/permissions.</a></p></div></div></div><div class="sk-panel-footer"><div class="sk-button info big block bold" ng-click="accept()"><div class="sk-label">Continue</div></div></div></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sk-modal-background" ng-click="cancel()"></div><div class="sk-modal-content" id="privileges-modal"><div class="sn-component"><div class="sk-panel"><div class="sk-panel-header"><div class="sk-panel-header-title">Authentication Required</div><a class="close-button info" ng-click="cancel()">Cancel</a></div><div class="sk-panel-content"><div class="sk-panel-section"><div ng-repeat="credential in requiredCredentials"><div class="sk-p sk-bold sk-panel-row"><strong>{{promptForCredential(credential)}}</strong></div><div class="sk-panel-row"><input class="sk-input contrast" ng-model="authenticationParameters[credential]" should-focus="$index == 0" sn-autofocus="true" sn-enter="submit()" type="password"></div><div class="sk-panel-row"><label class="sk-label danger" ng-if="isCredentialInFailureState(credential)">Invalid authentication. Please try again.</label></div></div><div class="sk-panel-row"></div><div class="sk-panel-row"><div class="sk-horizontal-group"><div class="sk-p sk-bold">Remember For</div><a class="sk-a info" ng-class="{\'boxed\' : option.value == selectedSessionLength}" ng-click="selectSessionLength(option.value)" ng-repeat="option in sessionLengthOptions">{{option.label}}</a></div></div></div></div><div class="sk-panel-footer extra-padding"><div class="sk-button info big block bold" ng-click="submit()"><div class="sk-label">Submit</div></div></div></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sk-modal-background" ng-click="cancel()"></div><div class="sk-modal-content" id="privileges-modal"><div class="sn-component"><div class="sk-panel"><div class="sk-panel-header"><div class="sk-panel-header-title">Manage Privileges</div><a class="sk-a close-button info" ng-click="cancel()">Done</a></div><div class="sk-panel-content"><div class="sk-panel-section"><table class="sk-table"><thead><tr><th></th><th ng-repeat="cred in availableCredentials"><div class="priv-header"><strong>{{credentialDisplayInfo[cred].label}}</strong><div class="sk-p font-small" ng-show="!credentialDisplayInfo[cred].availability" style="margin-top: 2px">Not Configured</div></div></th></tr></thead><tbody><tr ng-repeat="action in availableActions"><td><div class="sk-p">{{displayInfoForAction(action)}}</div></td><th ng-repeat="credential in availableCredentials"><input ng-checked="isCredentialRequiredForAction(action, credential)" ng-click="checkboxValueChanged(action, credential)" ng-disabled="!credentialDisplayInfo[credential].availability" type="checkbox"></th></tr></tbody></table></div><div class="sk-panel-section" ng-if="sessionExpirey &amp;&amp; !sessionExpired"><div class="sk-p sk-panel-row">You will not be asked to authenticate until {{sessionExpirey}}.</div><a class="sk-a sk-panel-row info" ng-click="clearSession()">Clear Session</a></div></div><div class="sk-panel-footer"><div class="sk-h2 sk-bold">About Privileges</div><div class="sk-panel-section no-bottom-pad"><div class="sk-panel-row"><div class="text-content"><div class="sk-p">Privileges represent interface level authentication for accessing certain items and features.\nNote that when your application is unlocked, your data exists in temporary memory in an unencrypted state.\nPrivileges are meant to protect against unwanted access in the event of an unlocked application, but do not affect data encryption state.</div><p class="sk-p">Privileges sync across your other devices; however, note that if you require\na "Local Passcode" privilege, and another device does not have a local passcode set up, the local passcode\nrequirement will be ignored on that device.</p></div></div></div></div></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component"><div class="sk-modal medium" id="item-preview-modal"><div class="sk-modal-background"></div><div class="sk-modal-content"><div class="sn-component"><div class="sk-panel"><div class="sk-panel-header"><div class="sk-panel-header-title">Preview</div><div class="sk-horizontal-group"><a class="sk-a info close-button" ng-click="restore(false)">Restore</a><a class="sk-a info close-button" ng-click="restore(true)">Restore as copy</a><a class="sk-a info close-button" ng-click="dismiss(); $event.stopPropagation()">Close</a></div></div><div class="sk-panel-content selectable" ng-if="!editor"><div class="sk-h2">{{content.title}}</div><p class="normal sk-p" style="white-space: pre-wrap; font-size: 16px;">{{content.text}}</p></div><component-view class="component-view" component="editor" ng-if="editor"></component-view></div></div></div></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component" id="session-history-menu"><div class="sk-menu-panel dropdown-menu"><div class="sk-menu-panel-header"><div class="sk-menu-panel-header-title">{{history.entries.length || \'No\'}} revisions</div><a class="sk-a info sk-h5" ng-click="showOptions = !showOptions; $event.stopPropagation();">Options</a></div><div ng-if="showOptions"><menu-row action="clearItemHistory()" label="\'Clear note local history\'"></menu-row><menu-row action="clearAllHistory()" label="\'Clear all local history\'"></menu-row><menu-row action="toggleAutoOptimize()" label="(autoOptimize ? \'Disable\' : \'Enable\') + \' auto cleanup\'"><div class="sk-sublabel">Automatically cleans up small revisions to conserve space.</div></menu-row><menu-row action="toggleDiskSaving()" label="(diskEnabled ? \'Disable\' : \'Enable\') + \' saving history to disk\'"><div class="sk-sublabel">Saving to disk is not recommended. Decreases performance and increases app loading time and memory footprint.</div></menu-row></div><menu-row action="openRevision(revision);" label="revision.previewTitle()" ng-repeat="revision in entries"><div class="sk-sublabel opaque" ng-class="classForRevision(revision)">{{revision.previewSubTitle()}}</div></menu-row></div></div>'}},function(e,t,n){n(9);e.exports=function(e){var t="";return t+='<div class="sn-component"><div class="sk-panel sk-panel-right" id="sync-resolution-menu"><div class="sk-panel-header"><div class="sk-panel-header-title">Out of Sync</div><a class="sk-a info close-button" ng-click="close()">Close</a></div><div class="sk-panel-content"><div class="sk-panel-section"><div class="sk-panel-row sk-p">We\'ve detected that the data on the server may not match the data in the current application session.</div><div class="sk-p sk-panel-row"><div class="sk-panel-column"><strong class="sk-panel-row">Option 1 — Restart App:</strong><div class="sk-p">Quit the application and re-open it. Sometimes, this may resolve the issue.</div></div></div><div class="sk-p sk-panel-row"><div class="sk-panel-column"><strong class="sk-panel-row">Option 2 (recommended) — Sign Out:</strong><div class="sk-p">Sign out of your account, then sign back in. This will ensure your data is consistent with the server.</div>Be sure to download a backup of your data before doing so.</div></div><div class="sk-p sk-panel-row"><div class="sk-panel-column"><strong class="sk-panel-row">Option 3 — Sync Resolution:</strong><div class="sk-p">We can attempt to reconcile changes by downloading all data from the server.</div>No existing data will be overwritten. If the local contents of an item differ from what the server has,\na conflicted copy will be created.</div></div><div ng-if="!status.backupFinished"><div class="sk-p sk-panel-row">Please download a backup before we attempt to perform a full account sync resolution.</div><div class="sk-panel-row"><div class="sk-button-group"><div class="sk-button info" ng-click="downloadBackup(true)"><div class="sk-label">Encrypted</div></div><div class="sk-button info" ng-click="downloadBackup(false)"><div class="sk-label">Decrypted</div></div><div class="sk-button danger" ng-click="skipBackup()"><div class="sk-label">Skip</div></div></div></div></div><div ng-if="status.backupFinished"><div class="sk-panel-row" ng-if="!status.resolving &amp;&amp; !status.attemptedResolution"><div class="sk-button info" ng-click="performSyncResolution()"><div class="sk-label">Perform Sync Resolution</div></div></div><div class="sk-panel-row justify-left" ng-if="status.resolving"><div class="sk-horizontal-group"><div class="sk-spinner small info"></div><div class="sk-label">Attempting sync resolution...</div></div></div><div class="sk-panel-column" ng-if="status.fail"><div class="sk-panel-row sk-label danger">Sync Resolution Failed</div><div class="sk-p sk-panel-row">We attempted to reconcile local content and server content, but were unable to do so.\nAt this point, we recommend signing out of your account and signing back in. You may\nwish to download a data backup before doing so.</div></div><div class="sk-panel-column" ng-if="status.success"><div class="sk-panel-row sk-label success">Sync Resolution Success</div><div class="sk-p sk-panel-row">Your local data is now in sync with the server. You may close this window.</div></div></div></div></div></div></div>'}},function(e,t,n){var r=n(4);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},function(e,t,n){"use strict";n.r(t);n(35),n(36);var r=n(5),i=n.n(r),o=(n(38),n(39),n(40),n(41),n(42),n(1));function a(){try{var e=navigator.platform.toLowerCase(),t="";return-1!==e.indexOf("mac")?t="mac":-1!==e.indexOf("win")&&(t="windows"),-1!==e.indexOf("linux")&&(t="linux"),t+(s()?"-desktop":"-web")}catch(e){return null}}function s(){return window.isElectron}function c(e){s()?e.html5Mode(!1):window.history&&window.history.pushState&&e.html5Mode({enabled:!0,requireBase:!1})}Array.prototype.containsPrimitiveSubset=function(e){var t=this;return!e.some((function(e){return-1===t.indexOf(e)}))},Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),r=n.length>>>0;if(0===r)return!1;var i,o,a=0|t,s=Math.max(a>=0?a:r-Math.abs(a),0);for(;s<r;){if((i=n[s])===(o=e)||"number"==typeof i&&"number"==typeof o&&isNaN(i)&&isNaN(o))return!0;s++}return!1}}),c.$inject=["$locationProvider"];var u=n(0),l=n.n(u),f=n(2),d=n.n(f),p=n(3),h=n.n(p),v=function(){function e(){d()(this,e),this.observers=[],e.KeyTab="Tab",e.KeyBackspace="Backspace",e.KeyUp="ArrowUp",e.KeyDown="ArrowDown",e.KeyModifierShift="Shift",e.KeyModifierCtrl="Control",e.KeyModifierMeta="Meta",e.KeyModifierAlt="Alt",e.KeyEventDown="KeyEventDown",e.KeyEventUp="KeyEventUp",e.AllModifiers=[e.KeyModifierShift,e.KeyModifierCtrl,e.KeyModifierMeta,e.KeyModifierAlt],window.addEventListener("keydown",this.handleKeyDown.bind(this)),window.addEventListener("keyup",this.handleKeyUp.bind(this))}return h()(e,[{key:"modifiersForEvent",value:function(t){return e.AllModifiers.filter((function(n){return(t.ctrlKey||t.key==e.KeyModifierCtrl)&&n===e.KeyModifierCtrl||(t.metaKey||t.key==e.KeyModifierMeta)&&n===e.KeyModifierMeta||(t.altKey||t.key==e.KeyModifierAlt)&&n===e.KeyModifierAlt||(t.shiftKey||t.key==e.KeyModifierShift)&&n===e.KeyModifierShift}))}},{key:"eventMatchesKeyAndModifiers",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.modifiersForEvent(e);if(r.length!=n.length)return!1;var i=!0,o=!1,a=void 0;try{for(var s,c=n[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value;if(!r.includes(u))return!1}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}return!t||t.toLowerCase()==e.key.toLowerCase()}},{key:"notifyObserver",value:function(t,n){var r=!0,i=!1,o=void 0;try{for(var a,s=this.observers[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value;if((!c.element||t.target==c.element)&&((!c.elements||c.elements.includes(t.target))&&(!c.notElement||c.notElement!=t.target)&&(!c.notElementIds||!c.notElementIds.includes(t.target.id))&&this.eventMatchesKeyAndModifiers(t,c.key,c.modifiers))){var u=n==e.KeyEventDown?c.onKeyDown:c.onKeyUp;u&&u(t)}}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}},{key:"handleKeyDown",value:function(t){this.notifyObserver(t,e.KeyEventDown)}},{key:"handleKeyUp",value:function(t){this.notifyObserver(t,e.KeyEventUp)}},{key:"addKeyObserver",value:function(e){var t={key:e.key,modifiers:e.modifiers,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,element:e.element,elements:e.elements,notElement:e.notElement,notElementIds:e.notElementIds};return this.observers.push(t),t}},{key:"removeKeyObserver",value:function(e){this.observers.splice(this.observers.indexOf(e),1)}}]),e}(),m=n(7),y=n.n(m),g=n(4),b=n.n(g),w=n(8),k=n.n(w),x=function(e){function t(e,n,r,i,o,a,s,c){var u;return d()(this,t),(u=y()(this,b()(t).call(this,o,r,i))).$rootScope=s,u.$compile=c,u.setDelegate({isOffline:function(){return l.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.offline());case 1:case"end":return e.stop()}}))},hasLocalPasscode:function(){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.hasPasscode());case 1:case"end":return t.stop()}}))},saveToStorage:function(e,t){return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",a.setItem(e,t,a.bestStorageMode()));case 1:case"end":return n.stop()}}))},getFromStorage:function(e){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",a.getItem(e,a.bestStorageMode()));case 1:case"end":return t.stop()}}))},verifyAccountPassword:function(e){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n.verifyAccountPassword(e));case 1:case"end":return t.stop()}}))},verifyLocalPasscode:function(t){return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",e.verifyPasscode(t));case 1:case"end":return n.stop()}}))}}),u}return t.$inject=["passcodeManager","authManager","syncManager","singletonManager","modelManager","storageManager","$rootScope","$compile"],k()(t,e),h()(t,[{key:"presentPrivilegesModal",value:function(e,t,n){var r=this;if(this.authenticationInProgress())n&&n();else{var o=this.$rootScope.$new(!0);o.action=e,o.onSuccess=function(){t&&t(),r.currentAuthenticationElement=null},o.onCancel=function(){n&&n(),r.currentAuthenticationElement=null};var a=this.$compile("<privileges-auth-modal action='action' on-success='onSuccess' on-cancel='onCancel' class='sk-modal'></privileges-auth-modal>")(o);i.a.element(document.body).append(a),this.currentAuthenticationElement=a}}},{key:"presentPrivilegesManagementModal",value:function(){var e=this.$rootScope.$new(!0),t=this.$compile("<privileges-management-modal class='sk-modal'></privileges-management-modal>")(e);i.a.element(document.body).append(t)}},{key:"authenticationInProgress",value:function(){return null!=this.currentAuthenticationElement}}]),t}(o.SFPrivilegesManager),$=n(13),_=n.n($),S=function(){function e(){d()(this,e),this.restrict="E",this.scope={remove:"&",note:"=",updateTags:"&"},this.template=_.a,this.replace=!0,this.controllerAs="ctrl",this.bindToController=!0}return h()(e,[{key:"link",value:function(e,t,n,r){e.$watch("ctrl.note",(function(e,t){e&&r.noteDidChange(e,t)}))}},{key:"controller",value:["$timeout","authManager","$rootScope","actionsManager","syncManager","modelManager","themeManager","componentManager","storageManager","sessionHistory","privilegesManager","keyboardManager","desktopManager","alertManager",function(e,t,n,r,a,c,u,f,d,p,h,m,y,g){var b=this;this.spellcheck=!0,this.componentManager=f,this.componentStack=[],this.isDesktop=s();a.addEventHandler((function(e,t){if(b.note)if("sync:taking-too-long"==e)b.syncTakingTooLong=!0;else if("sync:completed"==e)if(b.syncTakingTooLong=!1,b.note.dirty);else{var n=t.savedItems.find((function(e){return e.uuid==b.note.uuid}));(b.saveError||n)&&b.showAllChangesSavedStatus()}else"sync:error"==e&&b.note.dirty&&b.showErrorStatus()})),this.syncStatusObserver=a.registerSyncStatusObserver((function(t){t.localError&&e((function(){b.showErrorStatus({message:"Offline Saving Issue",desc:"Changes not saved"})}),500)})),c.addItemSyncObserver("editor-note-observer","Note",(function(e,t,r,i){b.note&&(b.note.deleted||b.note.content.trashed?n.notifyDelete():o.SFModelManager.isMappingSourceRetrieved(i)&&e.find((function(e){return e.uuid==b.note.uuid}))&&b.loadTagsString())})),c.addItemSyncObserver("editor-tag-observer","Tag",(function(e,t,n,r){if(b.note){var i=!0,o=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value;if(null==b.note.savedTagsString||u.deleted||u.hasRelationshipWithItem(b.note))return void b.loadTagsString()}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}}})),c.addItemSyncObserver("editor-component-observer","SN|Component",(function(e,t,n,r){if(b.note&&(b.reloadComponentStackArray(),0!=e.filter((function(e){return e.isEditor()})).length)){var i=b.editorForNote(b.note);b.selectedEditor=i,i||b.reloadFont()}})),this.noteDidChange=function(e,t){this.setNote(e,t),this.reloadComponentContext()},this.setNote=function(t,n){var r=this;this.showExtensions=!1,this.showMenu=!1,this.noteStatus=null,this.altKeyDown=!1,this.loadTagsString();var i=function(){r.noteReady=!0,e((function(){r.loadPreferences()}))},o=this.editorForNote(t);o&&o!=this.selectedEditor?(this.noteReady=!1,e((function(){r.selectedEditor=o,i()}))):o?i():(this.selectedEditor=null,i()),0==t.safeText().length&&t.dummy&&this.focusTitle(100),n&&n!=t&&n.dummy&&this.remove()(n)},this.editorForNote=function(e){return f.editorForNote(e)},this.closeAllMenus=function(){this.showEditorMenu=!1,this.showMenu=!1,this.showExtensions=!1},this.toggleMenu=function(e){this[e]=!this[e];for(var t=0,n=["showMenu","showEditorMenu","showExtensions","showSessionHistory"];t<n.length;t++){var r=n[t];r!=e&&(this[r]=!1)}},this.editorMenuOnSelect=function(t){var n=this;if(t&&"editor-editor"!=t.area)"editor-stack"==t.area&&this.toggleStackComponentForCurrentItem(t);else{this.showEditorMenu=!1;var r=t;this.selectedEditor&&r!==this.selectedEditor&&this.disassociateComponentWithCurrentNote(this.selectedEditor),r?(1==this.note.getAppDataItem("prefersPlainEditor")&&(this.note.setAppDataItem("prefersPlainEditor",!1),c.setItemDirty(this.note,!0)),this.associateComponentWithCurrentNote(r)):(this.note.getAppDataItem("prefersPlainEditor")||(this.note.setAppDataItem("prefersPlainEditor",!0),c.setItemDirty(this.note,!0)),e((function(){n.reloadFont()}))),this.selectedEditor=r}a.sync()}.bind(this),this.hasAvailableExtensions=function(){return r.extensionsInContextOfItem(this.note).length>0},this.focusEditor=function(e){setTimeout((function(){var e=document.getElementById("note-text-editor");e&&e.focus()}),e)},this.focusTitle=function(e){setTimeout((function(){document.getElementById("note-title-editor").focus()}),e)},this.clickedTextArea=function(){this.showMenu=!1},this.EditorNgDebounce=200;this.saveNote=function(n){var r=this,i=n.bypassDebouncer,o=n.updateClientModified,s=n.dontUpdatePreviews,u=this.note;if(u.dummy=!1,u.deleted)g.alert({text:"The note you are attempting to edit has been deleted, and is awaiting sync. Changes you make will be disregarded."});else if(c.findItem(u.uuid)){if(this.showSavingStatus(),!s){var l=u.text||"",f=l.length>80;u.content.preview_plain=l.substring(0,80)+(f?"...":""),u.content.preview_html=null}var d;c.setItemDirty(u,!0,o),this.saveTimeout&&e.cancel(this.saveTimeout),d=t.offline()||i?100:350,this.saveTimeout=e((function(){a.sync().then((function(e){e&&e.error&&!r.didShowErrorAlert&&(r.didShowErrorAlert=!0,g.alert({text:"There was an error saving your note. Please try again."}))}))}),d)}else g.alert({text:"The note you are attempting to save can not be found or has been deleted. Changes you make will not be synced. Please copy this note's text and start a new note."})},this.showSavingStatus=function(){this.setStatus({message:"Saving..."},!1)},this.showAllChangesSavedStatus=function(){this.saveError=!1,this.syncTakingTooLong=!1;var e="All changes saved";t.offline()&&(e+=" (offline)"),this.setStatus({message:e})},this.showErrorStatus=function(e){e||(e={message:"Sync Unreachable",desc:"Changes saved offline"}),this.saveError=!0,this.syncTakingTooLong=!1,this.setStatus(e)},this.setStatus=function(t){var n,r=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n=this.noteStatus&&this.noteStatus.date?400-(new Date-this.noteStatus.date):0,(!i||n<0)&&(n=0),this.statusTimeout&&e.cancel(this.statusTimeout),this.statusTimeout=e((function(){t.date=new Date,r.noteStatus=t}),n)},this.contentChanged=function(){this.saveNote({updateClientModified:!0})},this.onTitleEnter=function(e){e.target.blur(),this.onTitleChange(),this.focusEditor()},this.onTitleChange=function(){this.saveNote({dontUpdatePreviews:!0,updateClientModified:!0})},this.onNameFocus=function(){this.editingName=!0},this.onContentFocus=function(){n.$broadcast("editorFocused")},this.onNameBlur=function(){this.editingName=!1},this.selectedMenuItem=function(e){e&&(this.showMenu=!1)},this.deleteNote=function(t){var n,r=this;return l.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(!this.note.dummy){i.next=3;break}return g.alert({text:"This note is a placeholder and cannot be deleted. To remove from your list, simply navigate to a different note."}),i.abrupt("return");case 3:return n=function(){e((function(){if(r.note.locked)g.alert("This note is locked. If you'd like to delete it, unlock it, and try again.");else{var e=r.note.safeTitle().length?"'".concat(r.note.title,"'"):"this note",n=t?"Are you sure you want to permanently delete ".concat(e,"?"):"Are you sure you want to move ".concat(e," to the trash?");g.confirm({text:n,destructive:!0,onConfirm:function(){t?r.remove()(r.note):(r.note.content.trashed=!0,r.saveNote({bypassDebouncer:!0,dontUpdatePreviews:!0})),r.showMenu=!1}})}}))},i.next=6,l.a.awrap(h.actionRequiresPrivilege(x.ActionDeleteNote));case 6:if(!i.sent){i.next=10;break}h.presentPrivilegesModal(x.ActionDeleteNote,(function(){n()})),i.next=11;break;case 10:n();case 11:case"end":return i.stop()}}),null,this)},this.restoreTrashedNote=function(){this.note.content.trashed=!1,this.saveNote({bypassDebouncer:!0,dontUpdatePreviews:!0})},this.deleteNotePermanantely=function(){this.deleteNote(!0)},this.getTrashCount=function(){return c.trashedItems().length},this.emptyTrash=function(){var e=this.getTrashCount();g.confirm({text:"Are you sure you want to permanently delete ".concat(e," note(s)?"),destructive:!0,onConfirm:function(){c.emptyTrash(),a.sync()}})},this.togglePin=function(){this.note.setAppDataItem("pinned",!this.note.pinned),this.saveNote({bypassDebouncer:!0,dontUpdatePreviews:!0})},this.toggleLockNote=function(){this.note.setAppDataItem("locked",!this.note.locked),this.saveNote({bypassDebouncer:!0,dontUpdatePreviews:!0})},this.toggleProtectNote=function(){this.note.content.protected=!this.note.content.protected,this.saveNote({bypassDebouncer:!0,dontUpdatePreviews:!0}),h.actionHasPrivilegesConfigured(x.ActionViewProtectedNotes).then((function(e){e||h.presentPrivilegesManagementModal()}))},this.toggleNotePreview=function(){this.note.content.hidePreview=!this.note.content.hidePreview,this.saveNote({bypassDebouncer:!0,dontUpdatePreviews:!0})},this.toggleArchiveNote=function(){this.note.setAppDataItem("archived",!this.note.archived),this.saveNote({bypassDebouncer:!0,dontUpdatePreviews:!0}),n.$broadcast("noteArchived")},this.clickedEditNote=function(){this.focusEditor(100)},this.loadTagsString=function(){this.tagsString=this.note.tagsString()},this.addTag=function(e){var t=this.note.tags.map((function(e){return e.title}));t.push(e.title),this.updateTags()(this.note,t),this.loadTagsString()},this.removeTag=function(e){var t=this.note.tags.map((function(e){return e.title})).filter((function(t){return t!==e.title}));this.updateTags()(this.note,t),this.loadTagsString()},this.updateTagsFromTagsString=function(){if(this.tagsString!=this.note.tagsString()){var e=this.tagsString.split("#").filter((function(e){return e.length>0})).map((function(e){return e.trim()}));this.note.dummy=!1,this.updateTags()(this.note,e)}},this.leftResizeControl={},this.rightResizeControl={},this.onPanelResizeFinish=function(e,n,r){r?t.setUserPrefValue("editorWidth",null):null!=e&&(t.setUserPrefValue("editorWidth",e),b.leftResizeControl.setWidth(e)),null!=n&&(t.setUserPrefValue("editorLeft",n),b.rightResizeControl.setLeft(n)),t.syncUserPreferences()},n.$on("user-preferences-changed",(function(){b.loadPreferences()})),this.loadPreferences=function(){this.monospaceFont=t.getUserPrefValue("monospaceFont","monospace");var e=!s();if(this.spellcheck=t.getUserPrefValue("spellcheck",e),this.marginResizersEnabled=t.getUserPrefValue("marginResizersEnabled",!0),document.getElementById("editor-content")&&(this.reloadFont(),this.marginResizersEnabled)){var n=t.getUserPrefValue("editorWidth",null);null!==n&&(this.leftResizeControl.setWidth(n),this.rightResizeControl.setWidth(n));var r=t.getUserPrefValue("editorLeft",null);null!==r&&(this.leftResizeControl.setLeft(r),this.rightResizeControl.setLeft(r))}},this.reloadFont=function(){var e=document.getElementById("note-text-editor");e&&(this.monospaceFont?s()?e.style.fontFamily="Menlo, Consolas, 'DejaVu Sans Mono', monospace":e.style.fontFamily="monospace":e.style.fontFamily="inherit")},this.toggleKey=function(n){var r=this;this[n]=!this[n],t.setUserPrefValue(n,this[n],!0),this.reloadFont(),"spellcheck"==n?(this.noteReady=!1,e((function(){r.noteReady=!0,e((function(){r.reloadFont()}))}),0)):"marginResizersEnabled"==n&&1==this[n]&&e((function(){r.leftResizeControl.flash(),r.rightResizeControl.flash()}))},this.onEditorLoad=function(e){y.redoSearch()},f.registerHandler({identifier:"editor",areas:["note-tags","editor-stack","editor-editor"],activationHandler:function(e){"note-tags"===e.area?b.tagsComponent=e.active?e:null:"editor-editor"==e.area?b.selectedEditor&&b.selectedEditor==e&&0==e.active?b.selectedEditor=null:b.selectedEditor?b.selectedEditor.active&&e.isExplicitlyEnabledForItem(b.note)&&!b.selectedEditor.isExplicitlyEnabledForItem(b.note)&&(b.selectedEditor=e):e.active&&b.note&&(e.isExplicitlyEnabledForItem(b.note)||e.isDefaultEditor())?b.selectedEditor=e:b.selectedEditor=null:"editor-stack"==e.area&&b.reloadComponentContext()},contextRequestHandler:function(e){if(e==b.selectedEditor||e==b.tagsComponent||b.componentStack.includes(e))return b.note},focusHandler:function(e,t){e.isEditor()&&t&&b.closeAllMenus()},actionHandler:function(e,t,n){if("set-size"===t){if("container"==n.type&&"note-tags"==e.area){var r=document.getElementById("note-tags-component-container");o=r,s="string"==typeof(a=n).width?a.width:"".concat(n.width,"px"),u="string"==typeof a.height?a.height:"".concat(n.height,"px"),o.setAttribute("style","width:".concat(s,"; height:").concat(u,"; "))}}else if("associate-item"===t){if("Tag"==n.item.content_type){var i=c.findItem(n.item.uuid);b.addTag(i)}}else if("deassociate-item"===t){i=c.findItem(n.item.uuid);b.removeTag(i)}else"save-items"===t&&n.items.map((function(e){return e.uuid})).includes(b.note.uuid)&&b.showSavingStatus();var o,a,s,u}}),this.reloadComponentStackArray=function(){this.componentStack=f.componentsForArea("editor-stack").sort((function(e,t){return e.name.toLowerCase()<t.name.toLowerCase()?-1:1}))},this.reloadComponentContext=function(){if(this.reloadComponentStackArray(),this.note){var e=!0,t=!1,n=void 0;try{for(var r,i=this.componentStack[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;o.active&&f.setComponentHidden(o,!o.isExplicitlyEnabledForItem(this.note))}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}f.contextItemDidChangeInArea("note-tags"),f.contextItemDidChangeInArea("editor-stack"),f.contextItemDidChangeInArea("editor-editor")},this.toggleStackComponentForCurrentItem=function(e){e.hidden||!e.active?(f.setComponentHidden(e,!1),this.associateComponentWithCurrentNote(e),e.active||f.activateComponent(e),f.contextItemDidChangeInArea("editor-stack")):(f.setComponentHidden(e,!0),this.disassociateComponentWithCurrentNote(e))},this.disassociateComponentWithCurrentNote=function(e){var t=this;e.associatedItemIds=e.associatedItemIds.filter((function(e){return e!==t.note.uuid})),e.disassociatedItemIds.includes(this.note.uuid)||e.disassociatedItemIds.push(this.note.uuid),c.setItemDirty(e,!0),a.sync()},this.associateComponentWithCurrentNote=function(e){var t=this;e.disassociatedItemIds=e.disassociatedItemIds.filter((function(e){return e!==t.note.uuid})),e.associatedItemIds.includes(this.note.uuid)||e.associatedItemIds.push(this.note.uuid),c.setItemDirty(e,!0),a.sync()},this.altKeyObserver=m.addKeyObserver({modifiers:[v.KeyModifierAlt],onKeyDown:function(){e((function(){b.altKeyDown=!0}))},onKeyUp:function(){e((function(){b.altKeyDown=!1}))}}),this.trashKeyObserver=m.addKeyObserver({key:v.KeyBackspace,notElementIds:["note-text-editor","note-title-editor"],modifiers:[v.KeyModifierMeta],onKeyDown:function(){e((function(){b.deleteNote()}))}}),this.deleteKeyObserver=m.addKeyObserver({key:v.KeyBackspace,modifiers:[v.KeyModifierMeta,v.KeyModifierShift,v.KeyModifierAlt],onKeyDown:function(t){t.preventDefault(),e((function(){b.deleteNote(!0)}))}}),this.onSystemEditorLoad=function(){var t=this;if(!this.loadedTabListener){this.loadedTabListener=!0;var n=document.getElementById("note-text-editor");this.tabObserver=m.addKeyObserver({element:n,key:v.KeyTab,onKeyDown:function(r){if(!r.shiftKey&&!t.note.locked){if(r.preventDefault(),!document.execCommand("insertText",!1,"\t")){var i=n.selectionStart,o=n.selectionEnd;n.value=n.value.substring(0,i)+" "+n.value.substring(o),n.selectionStart=n.selectionEnd=i+4}e((function(){t.note.text=n.value,t.saveNote({bypassDebouncer:!0})}))}}}),i.a.element(n).on("$destroy",(function(){t.tabObserver&&(m.removeKeyObserver(t.tabObserver),t.loadedTabListener=!1)}))}}}]}]),e}(),M=n(14),C=n.n(M),A=function(){function e(){d()(this,e),this.restrict="E",this.scope={},this.template=C.a,this.replace=!0,this.controllerAs="ctrl",this.bindToController=!0}return h()(e,[{key:"link",value:function(e,t,n,r){e.$on("sync:completed",(function(){r.syncUpdated(),r.findErrors(),r.updateOfflineStatus()})),e.$on("sync:error",(function(){r.findErrors(),r.updateOfflineStatus()}))}},{key:"controller",value:["$rootScope","authManager","modelManager","$timeout","dbManager","syncManager","storageManager","passcodeManager","componentManager","singletonManager","nativeExtManager","privilegesManager","statusManager","alertManager",function(e,t,n,r,i,o,a,s,c,u,f,d,p,h){var v=this;t.checkForSecurityUpdate().then((function(e){v.securityUpdateAvailable=e})),e.$on("security-update-status-changed",(function(){v.securityUpdateAvailable=t.securityUpdateAvailable})),p.addStatusObserver((function(e){r((function(){v.arbitraryStatusMessage=e}))})),e.$on("did-begin-local-backup",(function(){r((function(){v.backupStatus=p.addStatusFromString("Saving local backup...")}))})),e.$on("did-finish-local-backup",(function(e,t){r((function(){t.success?v.backupStatus=p.replaceStatusWithString(v.backupStatus,"Successfully saved backup."):v.backupStatus=p.replaceStatusWithString(v.backupStatus,"Unable to save local backup."),r((function(){v.backupStatus=p.removeStatus(v.backupStatus)}),2e3)}))})),this.openSecurityUpdate=function(){t.presentPasswordWizard("upgrade-security")},e.$on("reload-ext-data",(function(){v.reloadExtendedData()})),this.reloadExtendedData=function(){if(!v.reloadInProgress){v.reloadInProgress=!0;var t=v.rooms.find((function(e){return e.package_info.identifier==f.extensionsManagerIdentifier}));if(!t)return v.queueExtReload=!0,void(v.reloadInProgress=!1);v.selectRoom(t),r((function(){v.selectRoom(t),v.reloadInProgress=!1,e.$broadcast("ext-reload-complete")}),2e3)}},this.getUser=function(){return t.user},this.updateOfflineStatus=function(){this.offline=t.offline()},this.updateOfflineStatus(),o.addEventHandler((function(e,t){r((function(){"local-data-loaded"==e?v.offline&&0==n.noteCount()&&(v.showAccountMenu=!0):"enter-out-of-sync"==e?v.outOfSync=!0:"exit-out-of-sync"==e&&(v.outOfSync=!1)}))})),this.findErrors=function(){this.error=o.syncStatus.error},this.findErrors(),this.onAuthSuccess=function(){this.showAccountMenu=!1}.bind(this),this.accountMenuPressed=function(){this.showAccountMenu=!this.showAccountMenu,this.closeAllRooms()},this.toggleSyncResolutionMenu=function(){this.showSyncResolution=!this.showSyncResolution}.bind(this),this.closeAccountMenu=function(){v.showAccountMenu=!1},this.hasPasscode=function(){return s.hasPasscode()},this.lockApp=function(){e.lockApplication()},this.refreshData=function(){var e=this;this.isRefreshing=!0,o.sync({force:!0,performIntegrityCheck:!0}).then((function(t){r(function(){this.isRefreshing=!1}.bind(e),200),t&&t.error?h.alert({text:"There was an error syncing. Please try again. If all else fails, try signing out and signing back in."}):e.syncUpdated()}))},this.syncUpdated=function(){this.lastSyncDate=new Date},e.$on("new-update-available",(function(){r((function(){v.onNewUpdateAvailable()}))})),this.onNewUpdateAvailable=function(){this.newUpdateAvailable=!0},this.clickedNewUpdateAnnouncement=function(){this.newUpdateAvailable=!1,h.alert({text:"A new update is ready to install. Please use the top-level 'Updates' menu to manage installation."})},this.componentManager=c,this.rooms=[],this.themesWithIcons=[],n.addItemSyncObserver("room-bar","SN|Component",(function(e,t,r,i){v.rooms=n.components.filter((function(e){return"rooms"==e.area&&!e.deleted})),v.queueExtReload&&(v.queueExtReload=!1,v.reloadExtendedData())})),n.addItemSyncObserver("footer-bar-themes","SN|Theme",(function(e,t,r,i){var o=n.validItemsForContentType("SN|Theme").filter((function(e){return!e.deleted&&e.content.package_info&&e.content.package_info.dock_icon})).sort((function(e,t){return e.name.toLowerCase()<t.name.toLowerCase()?-1:1})),a=o.length!=v.themesWithIcons.length;v.themesWithIcons=o,a&&v.reloadDockShortcuts()})),this.reloadDockShortcuts=function(){var e=[],t=!0,n=!1,r=void 0;try{for(var i,o=this.themesWithIcons[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=a.content.package_info.name,c=a.content.package_info.dock_icon;c&&e.push({name:s,component:a,icon:c})}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this.dockShortcuts=e.sort((function(e,t){var n=e.icon.type,r=t.icon.type;return n==r?0:"circle"==n&&"svg"==r?-1:"circle"==r&&"svg"==n?1:void 0}))},this.initSvgForShortcut=function(e){var t="dock-svg-"+e.component.uuid,n=document.getElementById(t),r=new DOMParser,i=e.component.content.package_info.dock_icon.source,o=r.parseFromString(i,"image/svg+xml");n.appendChild(o.documentElement)},this.selectShortcut=function(e){c.toggleComponent(e.component)},c.registerHandler({identifier:"roomBar",areas:["rooms","modal"],activationHandler:function(e){},actionHandler:function(e,t,n){"set-size"==t&&e.setLastSize(n)},focusHandler:function(e,t){e.isEditor()&&t&&(v.closeAllRooms(),v.closeAccountMenu())}}),e.$on("editorFocused",(function(){v.closeAllRooms(),v.closeAccountMenu()})),this.onRoomDismiss=function(e){e.showRoom=!1},this.closeAllRooms=function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.rooms[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){r.value.showRoom=!1}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}},this.selectRoom=function(e){var t;return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=function(){r((function(){e.showRoom=!e.showRoom}))},e.showRoom){n.next=11;break}return n.next=4,l.a.awrap(d.actionRequiresPrivilege(x.ActionManageExtensions));case 4:if(!n.sent){n.next=8;break}d.presentPrivilegesModal(x.ActionManageExtensions,(function(){t()})),n.next=9;break;case 8:t();case 9:n.next=12;break;case 11:t();case 12:case"end":return n.stop()}}))},this.clickOutsideAccountMenu=function(){d.authenticationInProgress()||(this.showAccountMenu=!1)}}]}]),e}(),I=n(6),E=n.n(I),O=n(15),D=n.n(O),R=function(){function e(){d()(this,e),this.scope={addNew:"&",selectionMade:"&",tag:"="},this.template=D.a,this.replace=!0,this.controllerAs="ctrl",this.bindToController=!0}return h()(e,[{key:"link",value:function(e,t,n,r){e.$watch("ctrl.tag",(function(e,t){e&&r.tagDidChange(e,t)}))}},{key:"controller",value:["authManager","$timeout","$rootScope","modelManager","syncManager","storageManager","desktopManager","privilegesManager","keyboardManager",function(e,t,n,r,a,s,c,u,f){var d=this;this.panelController={},this.searchSubmitted=!1,n.$on("user-preferences-changed",(function(){d.loadPreferences(),d.reloadNotes()})),e.addEventHandler((function(e){e==o.SFAuthManager.DidSignInEvent&&d.selectedNote&&d.selectedNote.dummy&&(r.removeItemLocally(d.selectedNote),E.a.pull(d.notes,d.selectedNote),d.selectedNote=null,d.selectNote(null),d.createDummyOnSynCompletionIfNoNotes=!0)})),a.addEventHandler((function(e,n){"local-data-loaded"==e?0==d.notes.length&&d.createNewNote():"sync:completed"==e&&t((function(){d.createDummyOnSynCompletionIfNoNotes&&0==d.notes.length&&(d.createDummyOnSynCompletionIfNoNotes=!1,d.createNewNote())}),100)})),r.addItemSyncObserver("note-list","*",(function(e,n,r,i,o){d.reloadNotes();var a=e.filter((function(e){return"Note"==e.content_type})),s=!0,c=!1,u=void 0;try{for(var l,f=a[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var p=l.value;d.loadFlagsForNote(p),p.cachedCreatedAtString=p.createdAtString(),p.cachedUpdatedAtString=p.updatedAtString()}}catch(e){c=!0,u=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw u}}d.selectedNote||t((function(){d.selectFirstNote()}))})),this.setNotes=function(e){e=this.filterNotes(e),e=this.sortNotes(e,this.sortBy,this.sortReverse);var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;a.shouldShowTags=this.shouldShowTagsForNote(a)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this.notes=e,this.reloadPanelTitle()},this.reloadNotes=function(){var e=this.tag.notes,t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;a.errorDecrypting&&this.loadFlagsForNote(a)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this.setNotes(e)},this.reorderNotes=function(){this.setNotes(this.notes)},this.loadPreferences=function(){var r=this,i=this.sortBy;this.sortBy=e.getUserPrefValue("sortBy","created_at"),this.sortReverse=e.getUserPrefValue("sortReverse",!1),"updated_at"==this.sortBy&&(this.sortBy="client_updated_at"),i&&i!=this.sortBy&&t((function(){r.selectFirstNote()})),this.showArchived=e.getUserPrefValue("showArchived",!1),this.hidePinned=e.getUserPrefValue("hidePinned",!1),this.hideNotePreview=e.getUserPrefValue("hideNotePreview",!1),this.hideDate=e.getUserPrefValue("hideDate",!1),this.hideTags=e.getUserPrefValue("hideTags",!1);var o=e.getUserPrefValue("notesPanelWidth");o&&(this.panelController.setWidth(o),this.panelController.isCollapsed()&&n.$broadcast("panel-resized",{panel:"notes",collapsed:this.panelController.isCollapsed()}))},this.loadPreferences(),this.onPanelResize=function(t,r,i,o){e.setUserPrefValue("notesPanelWidth",t),e.syncUserPreferences(),n.$broadcast("panel-resized",{panel:"notes",collapsed:o})},i.a.element(document).ready((function(){d.loadPreferences()})),n.$on("editorFocused",function(){this.showMenu=!1}.bind(this)),n.$on("noteDeleted",function(){t(this.onNoteRemoval.bind(this))}.bind(this)),n.$on("noteArchived",function(){t(this.onNoteRemoval.bind(this))}.bind(this)),this.onNoteRemoval=function(){var e=this.visibleNotes(),t=e[this.selectedIndex<e.length?Math.max(this.selectedIndex,0):e.length-1];t?this.selectNote(t):this.createNewNote()},window.onresize=function(e){d.resetPagination({keepCurrentIfLarger:!0})},this.paginate=function(){this.notesToDisplay+=this.DefaultNotesToDisplayValue,this.searchSubmitted&&c.searchText(this.noteFilter.text)},this.resetPagination=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.keepCurrentIfLarger,n=51;this.DefaultNotesToDisplayValue=document.documentElement.clientHeight/n||20,t&&this.notesToDisplay>this.DefaultNotesToDisplayValue||(this.notesToDisplay=this.DefaultNotesToDisplayValue)},this.resetPagination(),this.reloadPanelTitle=function(){this.isFiltering()?this.panelTitle="".concat(this.notes.filter((function(e){return e.visible})).length," search results"):this.tag&&(this.panelTitle="".concat(this.tag.title))},this.optionsSubtitle=function(){var e="";return"created_at"==this.sortBy?e+=" Date Added":"client_updated_at"==this.sortBy?e+=" Date Modified":"title"==this.sortBy&&(e+=" Title"),this.showArchived&&(e+=" | + Archived"),this.hidePinned&&(e+=" | Pinned"),this.sortReverse&&(e+=" | Reversed"),e},this.loadFlagsForNote=function(e){var t=[];return e.pinned&&t.push({text:"Pinned",class:"info"}),e.archived&&t.push({text:"Archived",class:"warning"}),e.content.protected&&t.push({text:"Protected",class:"success"}),e.locked&&t.push({text:"Locked",class:"neutral"}),e.content.trashed&&t.push({text:"Deleted",class:"danger"}),e.content.conflict_of&&t.push({text:"Conflicted Copy",class:"danger"}),e.errorDecrypting&&t.push({text:"Missing Keys",class:"danger"}),e.deleted&&t.push({text:"Deletion Pending Sync",class:"danger"}),e.flags=t,t},this.tagDidChange=function(e,n){var r=this,i=document.getElementById("notes-scrollable");i&&(i.scrollTop=0,i.scrollLeft=0),this.resetPagination(),this.showMenu=!1,this.selectedNote&&this.selectedNote.dummy&&n&&E.a.remove(n.notes,this.selectedNote),this.noteFilter.text="",c.searchText(),this.setNotes(e.notes),t((function(){r.notes.length>0?(r.notes.forEach((function(e){e.visible=!0})),r.selectFirstNote()):a.initialDataLoaded()&&(e.isSmartTag()?r.selectedNote&&!r.notes.includes(r.selectedNote)&&r.selectNote(null):r.createNewNote())}))},this.visibleNotes=function(){return this.renderedNotes.filter((function(e){return e.visible}))},this.selectFirstNote=function(){var e=this.visibleNotes();e.length>0&&this.selectNote(e[0])},this.selectNextNote=function(){var e=this.visibleNotes(),t=e.indexOf(this.selectedNote);t+1<e.length&&this.selectNote(e[t+1])},this.selectPreviousNote=function(){var e=this.visibleNotes(),t=e.indexOf(this.selectedNote);return t-1>=0&&(this.selectNote(e[t-1]),!0)},this.selectNote=function(e){var n,i,o=this,s=arguments;return l.a.async((function(f){for(;;)switch(f.prev=f.next){case 0:if(n=s.length>1&&void 0!==s[1]&&s[1],this.selectedNote!==e){f.next=3;break}return f.abrupt("return");case 3:if(e){f.next=6;break}return this.selectionMade()(null),f.abrupt("return");case 6:if(i=function(){t((function(){var i;o.selectedNote&&o.selectedNote!=e&&1==o.selectedNote.dummy&&(i=o.selectedNote),o.selectedNote=e,e.content.conflict_of&&(e.content.conflict_of=null,r.setItemDirty(e,!0),a.sync()),o.selectionMade()(e),o.selectedIndex=Math.max(o.visibleNotes().indexOf(e),0),i&&1==i.dummy&&t((function(){r.removeItemLocally(i),E.a.pull(o.notes,i)}),250),n&&o.isFiltering()&&c.searchText(o.noteFilter.text)}))},f.t0=e.content.protected,!f.t0){f.next=12;break}return f.next=11,l.a.awrap(u.actionRequiresPrivilege(x.ActionViewProtectedNotes));case 11:f.t0=f.sent;case 12:if(!f.t0){f.next=16;break}u.presentPrivilegesModal(x.ActionViewProtectedNotes,(function(){i()})),f.next=17;break;case 16:i();case 17:case"end":return f.stop()}}),null,this)},this.isFiltering=function(){return this.noteFilter.text&&this.noteFilter.text.length>0},this.createNewNote=function(){if(!this.selectedNote||!this.selectedNote.dummy){var e="Note"+(this.notes?" "+(this.notes.length+1):""),t=r.createItem({content_type:"Note",content:{text:"",title:e}});t.client_updated_at=new Date,t.dummy=!0,this.selectNote(t),this.addNew()(t)}},this.noteFilter={text:""},this.onFilterEnter=function(){this.searchSubmitted=!0,c.searchText(this.noteFilter.text)},this.clearFilterText=function(){this.noteFilter.text="",this.onFilterEnter(),this.filterTextChanged(),this.resetPagination()},this.filterTextChanged=function(){var e=this;this.searchSubmitted&&(this.searchSubmitted=!1),this.reloadNotes(),t((function(){e.selectedNote.visible||e.selectFirstNote()}),100)},this.selectedMenuItem=function(){this.showMenu=!1},this.togglePrefKey=function(t){this[t]=!this[t],e.setUserPrefValue(t,this[t]),e.syncUserPreferences(),this.reloadNotes()},this.selectedSortByCreated=function(){this.setSortBy("created_at")},this.selectedSortByUpdated=function(){this.setSortBy("client_updated_at")},this.selectedSortByTitle=function(){this.setSortBy("title")},this.toggleReverseSort=function(){this.selectedMenuItem(),this.sortReverse=!this.sortReverse,this.reorderNotes(),e.setUserPrefValue("sortReverse",this.sortReverse),e.syncUserPreferences()},this.setSortBy=function(t){this.sortBy=t,this.reorderNotes(),e.setUserPrefValue("sortBy",this.sortBy),e.syncUserPreferences()},this.shouldShowTagsForNote=function(e){return!this.hideTags&&!e.content.protected&&(this.tag.content.isAllTag?e.tags&&e.tags.length>0:!!this.tag.isSmartTag()||e.tags&&e.tags.length>1)},this.filterNotes=function(e){var t=this;return e.filter((function(e){var n=t.showArchived,r=!t.hidePinned,i=t.tag.content.isTrashTag;if(!i&&e.content.trashed)return e.visible=!1,e.visible;if(t.tag.isSmartTag()&&(n=n||t.tag.content.isArchiveTag||i),e.archived&&!n||e.pinned&&!r)return e.visible=!1,e.visible;var o=t.noteFilter.text.toLowerCase();if(0==o.length)e.visible=!0;else{var a=o.split(" "),s=a.every((function(t){return e.safeTitle().toLowerCase().indexOf(t)>=0})),c=a.every((function(t){return e.safeText().toLowerCase().indexOf(t)>=0}));e.visible=s||c}return e.visible}))},this.sortNotes=function(e,t,n){return(e=e||[]).sort((function(e,r){return function e(r,i){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(r.dummy)return-1;if(i.dummy)return 1;if(!o){if(r.pinned&&i.pinned)return e(r,i,!0);if(r.pinned)return-1;if(i.pinned)return 1}var a=r[t]||"",s=i[t]||"",c=1;if(n&&(c*=-1),"title"==t){if(a=a.toLowerCase(),s=s.toLowerCase(),0==a.length&&0==s.length)return 0;if(0==a.length&&0!=s.length)return 1*c;if(0!=a.length&&0==s.length)return-1*c;c*=-1}return a>s?-1*c:a<s?1*c:0}(e,r)}))},this.newNoteKeyObserver=f.addKeyObserver({key:"n",modifiers:[v.KeyModifierMeta,v.KeyModifierCtrl],onKeyDown:function(e){e.preventDefault(),t((function(){d.createNewNote()}))}}),this.getSearchBar=function(){return document.getElementById("search-bar")},this.nextNoteKeyObserver=f.addKeyObserver({key:v.KeyDown,elements:[document.body,this.getSearchBar()],onKeyDown:function(e){var n=d.getSearchBar();n==document.activeElement&&n.blur(),t((function(){d.selectNextNote()}))}}),this.nextNoteKeyObserver=f.addKeyObserver({key:v.KeyUp,element:document.body,onKeyDown:function(e){t((function(){d.selectPreviousNote()}))}}),this.searchKeyObserver=f.addKeyObserver({key:"f",modifiers:[v.KeyModifierMeta,v.KeyModifierShift],onKeyDown:function(e){var t=d.getSearchBar();t&&t.focus()}})}]}]),e}(),P=n(16),T=n.n(P),j=function(){function e(){d()(this,e),this.restrict="E",this.scope={addNew:"&",selectionMade:"&",save:"&",removeTag:"&"},this.template=T.a,this.replace=!0,this.controllerAs="ctrl",this.bindToController=!0}return h()(e,[{key:"controller",value:["$rootScope","modelManager","syncManager","$timeout","componentManager","authManager",function(e,t,n,r,i,a){var s=this;r((function(){s.smartTags=t.getSmartTags(),s.selectTag(s.smartTags[0])})),n.addEventHandler((function(e,n){"local-data-loaded"!=e&&"sync:completed"!=e&&"local-data-incremental-load"!=e||(s.tags=t.tags,s.smartTags=t.getSmartTags())})),t.addItemSyncObserver("tags-list","*",(function(e,t,n,r,i){s.reloadNoteCounts()})),this.reloadNoteCounts=function(){var e=[];this.tags&&(e=e.concat(this.tags)),this.smartTags&&(e=e.concat(this.smartTags));var t=!0,n=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var s=i.value,c=o.SNNote.filterDummyNotes(s.notes).filter((function(e){return!e.archived&&!e.content.trashed}));s.cachedNoteCount=c.length}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}},this.panelController={},e.$on("user-preferences-changed",(function(){s.loadPreferences()})),this.loadPreferences=function(){var t=a.getUserPrefValue("tagsPanelWidth");t&&(this.panelController.setWidth(t),this.panelController.isCollapsed()&&e.$broadcast("panel-resized",{panel:"tags",collapsed:this.panelController.isCollapsed()}))},this.loadPreferences(),this.onPanelResize=function(t,n,r,i){a.setUserPrefValue("tagsPanelWidth",t,!0),e.$broadcast("panel-resized",{panel:"tags",collapsed:i})},this.componentManager=i,i.registerHandler({identifier:"tags",areas:["tags-list"],activationHandler:function(e){this.component=e}.bind(this),contextRequestHandler:function(e){return null}.bind(this),actionHandler:function(e,n,r){if("select-item"===n){if("Tag"==r.item.content_type){var i=t.findItem(r.item.uuid);i&&this.selectTag(i)}else if("SN|SmartTag"==r.item.content_type){var a=new o.SNSmartTag(r.item);this.selectTag(a)}}else"clear-selection"===n&&this.selectTag(this.smartTags[0])}.bind(this)}),this.selectTag=function(e){e.isSmartTag()&&Object.defineProperty(e,"notes",{get:function(){return t.notesMatchingSmartTag(e)}}),this.selectedTag=e,e.content.conflict_of&&(e.content.conflict_of=null,t.setItemDirty(e,!0),n.sync()),this.selectionMade()(e)},this.clickedAddNewTag=function(){this.editingTag||(this.newTag=t.createItem({content_type:"Tag"}),this.selectedTag=this.newTag,this.editingTag=this.newTag,this.addNew()(this.newTag))},this.tagTitleDidChange=function(e){this.editingTag=e},this.saveTag=function(e,n){var i=this;this.editingTag=null,e.target.blur(),n.title&&0!=n.title.length?this.save()(n,(function(e){r((function(){i.selectTag(n),i.newTag=null}))})):c?(n.title=c,c=null):t.removeItemLocally(n)};var c="";this.selectedRenameTag=function(e,t){c=t.title,this.editingTag=t,r((function(){(function(e){return document.getElementById("tag-"+e.uuid)})(t).focus()}))},this.selectedDeleteTag=function(e){this.removeTag()(e),this.selectTag(this.smartTags[0])}}]}]),e}(),F=n(17),N=n.n(F),L=function(){function e(){d()(this,e),this.template=N.a}return h()(e,[{key:"controller",value:["$scope","$location","$rootScope","$timeout","modelManager","dbManager","syncManager","authManager","themeManager","passcodeManager","storageManager","migrationManager","privilegesManager","statusManager","alertManager",function(e,t,n,r,i,s,c,u,f,d,p,h,v,m,y){var g=this;p.initialize(d.hasPasscode(),u.isEphemeralSession()),e.platform=a(),e.onUpdateAvailable=function(){n.$broadcast("new-update-available")},n.$on("panel-resized",(function(t,n){"notes"==n.panel&&(g.notesCollapsed=n.collapsed),"tags"==n.panel&&(g.tagsCollapsed=n.collapsed);var r="";g.notesCollapsed&&(r+="collapsed-notes"),g.tagsCollapsed&&(r+=" collapsed-tags"),e.appClass=r})),n.sync=function(e){c.sync()},n.lockApplication=function(){window.location.reload()};var b,w,k,x=function(){var e;u.loadInitialData(),g.syncStatusObserver=c.registerSyncStatusObserver((function(e){if(e.retrievedCount>20){var t="Downloading ".concat(e.retrievedCount," items. Keep app open.");g.syncStatus=m.replaceStatusWithString(g.syncStatus,t),g.showingDownloadStatus=!0}else if(g.showingDownloadStatus){g.showingDownloadStatus=!1;t="Download Complete.";g.syncStatus=m.replaceStatusWithString(g.syncStatus,t),setTimeout((function(){g.syncStatus=m.removeStatus(g.syncStatus)}),2e3)}else e.total>20?g.uploadSyncStatus=m.replaceStatusWithString(g.uploadSyncStatus,"Syncing ".concat(e.current,"/").concat(e.total," items...")):g.uploadSyncStatus&&(g.uploadSyncStatus=m.removeStatus(g.uploadSyncStatus))})),c.setKeyRequestHandler((function(){var e,t,n;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(e=u.offline())){r.next=5;break}r.t0=d.passcodeAuthParams(),r.next=8;break;case 5:return r.next=7,l.a.awrap(u.getAuthParams());case 7:r.t0=r.sent;case 8:if(t=r.t0,!e){r.next=13;break}r.t1=d.keys(),r.next=16;break;case 13:return r.next=15,l.a.awrap(u.keys());case 15:r.t1=r.sent;case 16:return n=r.t1,r.abrupt("return",{keys:n,offline:e,auth_params:t});case 18:case"end":return r.stop()}}))})),c.addEventHandler((function(t,r){if(n.$broadcast(t,r||{}),"sync-session-invalid"==t){(!e||(new Date-e)/1e3>30)&&(e=new Date,setTimeout((function(){y.alert({text:"Your session has expired. New changes will not be pulled in. Please sign out and sign back in to refresh your session."})}),500))}else"sync-exception"==t&&y.alert({text:"There was an error while trying to save your items. Please contact support and share this message: ".concat(r)})}));var t=u.user||d.hasPasscode();g.syncStatus=m.addStatusFromString(t?"Decrypting items...":"Loading items...");c.loadLocalItems({incrementalCallback:function(e,n){var r="".concat(e,"/").concat(n," items...");g.syncStatus=m.replaceStatusWithString(g.syncStatus,t?"Decrypting ".concat(r):"Loading ".concat(r))}}).then((function(){r((function(){n.$broadcast("initial-data-loaded"),g.syncStatus=m.replaceStatusWithString(g.syncStatus,"Syncing..."),c.sync({performIntegrityCheck:!0}).then((function(){g.syncStatus=m.removeStatus(g.syncStatus)})),setInterval((function(){c.sync()}),3e4)}))})),u.addEventHandler((function(e){e==o.SFAuthManager.DidSignOutEvent&&(i.handleSignout(),c.handleSignout())}))};function $(){s.setLocked(!1),s.openDatabase(null,(function(){c.clearSyncToken(),c.sync()})),x()}function _(e){return t.search()[e]}d.isLocked()?e.needsUnlock=!0:$(),e.onSuccessfulUnlock=function(){r((function(){e.needsUnlock=!1,$()}))},e.updateTagsForNote=function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var s,u=e.tags[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var l=s.value;-1===t.indexOf(l.title)&&n.push(l)}}catch(e){o=!0,a=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw a}}for(var f=0,d=n;f<d.length;f++){d[f].removeItemAsRelationship(e)}i.setItemsDirty(n,!0);var p=[],h=!0,v=!1,m=void 0;try{for(var y,g=t[Symbol.iterator]();!(h=(y=g.next()).done);h=!0){var b=y.value;E.a.find(e.tags,{title:b})||p.push(i.findOrCreateTagByTitle(b))}}catch(e){v=!0,m=e}finally{try{h||null==g.return||g.return()}finally{if(v)throw m}}for(var w=0,k=p;w<k.length;w++){(l=k[w]).addItemAsRelationship(e)}i.setItemsDirty(p,!0),c.sync()},e.tagsSelectionMade=function(t){e.selectedTag&&t&&e.selectedTag.uuid==t.uuid||(e.selectedNote&&e.selectedNote.dummy&&(i.removeItemLocally(e.selectedNote),e.selectedNote=null),e.selectedTag=t)},e.tagsAddNew=function(e){i.addItem(e)},e.tagsSave=function(t,n){t.title&&0!=t.title.length?(i.setItemDirty(t,!0),c.sync().then(n),i.resortTag(t)):e.removeTag(t)},e.removeTag=function(e){y.confirm({text:"Are you sure you want to delete this tag? Note: deleting a tag will not delete its notes.",destructive:!0,onConfirm:function(){i.setItemToBeDeleted(e),c.sync().then((function(){n.safeApply()}))}})},e.notesSelectionMade=function(t){e.selectedNote=t},e.notesAddNew=function(t){i.addItem(t),i.setItemDirty(t),e.selectedTag.isSmartTag()||(e.selectedTag.addItemAsRelationship(t),i.setItemDirty(e.selectedTag,!0))},n.safeApply=function(e){var t=this.$root.$$phase;"$apply"==t||"$digest"==t?this.$eval(e):this.$apply(e)},n.notifyDelete=function(){r(function(){n.$broadcast("noteDeleted")}.bind(this),0)},e.deleteNote=function(t){if(i.setItemToBeDeleted(t),t==e.selectedNote&&(e.selectedNote=null),t.dummy)return i.removeItemLocally(t),void n.notifyDelete();c.sync().then((function(){u.offline()?setTimeout((function(){n.notifyDelete(),n.safeApply()}),50):r((function(){n.notifyDelete()}))}))},window.addEventListener("dragover",(function(e){e.preventDefault()}),!1),window.addEventListener("drop",(function(e){e.preventDefault(),y.alert({text:"Please use FileSafe or the Bold Editor to attach images and files. Learn more at standardnotes.org/filesafe."})}),!1),_("server")&&l.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(b=_("server"),w=_("email"),k=_("pw"),u.offline()){e.next=18;break}return e.next=6,l.a.awrap(c.getServerURL());case 6:if(e.t1=e.sent,e.t2=b,e.t0=e.t1===e.t2,!e.t0){e.next=11;break}e.t0=u.user.email===w;case 11:if(!e.t0){e.next=15;break}return e.abrupt("return");case 15:u.signout(!0).then((function(){window.location.reload()}));case 16:e.next=19;break;case 18:u.login(b,w,k,!1,!1,{}).then((function(e){window.location.reload()}));case 19:case"end":return e.stop()}}))}]}]),e}(),U=n(18),B=n.n(U),H=function(){function e(){d()(this,e),this.restrict="E",this.template=B.a,this.scope={onSuccess:"&"}}return h()(e,[{key:"controller",value:["$scope","passcodeManager","authManager","syncManager","storageManager","alertManager",function(e,t,n,r,i,o){var a=this;e.formData={},this.visibilityObserver=t.addVisibilityObserver((function(e){if(e){var t=document.getElementById("passcode-input");t&&t.focus()}})),e.$on("$destroy",(function(){t.removeVisibilityObserver(a.visibilityObserver)})),e.submitPasscodeForm=function(){e.formData.passcode&&0!=e.formData.passcode.length&&t.unlock(e.formData.passcode,(function(t){t?e.onSuccess()():o.alert({text:"Invalid passcode. Please try again."})}))},e.forgotPasscode=function(){e.formData.showRecovery=!0},e.beginDeleteData=function(){o.confirm({text:"Are you sure you want to clear all local data?",destructive:!0,onConfirm:function(){n.signout(!0).then((function(){window.location.reload()}))}})}}]}]),e}();function z(e){return{restrict:"A",scope:{shouldFocus:"="},link:function(t,n){e((function(){t.shouldFocus&&n[0].focus()}))}}}function V(e){return{restrict:"A",replace:!1,link:function(t,n,r){var i=!1;n.bind("click",(function(e){i=!1,r.isOpen&&e.stopPropagation()})),e.bind("click",(function(){event.target.closest(".sk-modal")||i||(t.$apply(r.clickOutside),i=!0)}))}}}function W(e){return{restrict:"A",scope:{show:"=",delay:"@"},link:function(t,n,r){function o(e){e?n.css({display:""}):n.css({display:"none"})}o(!1),t.$watch("show",(function(n){n?function(){t.hidePromise&&(e.cancel(t.hidePromise),t.hidePromise=null);o(!0)}():function(){t.hidePromise=e(o.bind(this,!1),(n=parseInt(t.delay),i.a.isNumber(n)?n:200));var n}()}))}}}function K(e){return{restrict:"A",link:function(t,n,r){n.ready((function(){t.$apply((function(){e(r.elemReady)(t)}))}))}}}function q(e,t,n){return{link:function(e,t,n){var r=parseInt(n.threshold)||0,i=t[0];t.on("scroll",(function(){e.$eval(n.canLoad)&&i.scrollTop+i.offsetHeight>=i.scrollHeight-r&&e.$apply(n.infiniteScroll)}))}}}function J(e){return{restrict:"A",link:function(t,n,r){n.on("focus",(function(){e.getSelection().toString()||this.setSelectionRange(0,this.value.length)}))}}}z.$inject=["$timeout"],V.$inject=["$document"],W.$inject=["$timeout"],K.$inject=["$parse"],q.$inject=["$rootScope","$window","$timeout"],J.$inject=["$window"];var G=n(19),Y=n.n(G),Z=function(){function e(){d()(this,e),this.restrict="E",this.template=Y.a,this.scope={onSuccessfulAuth:"&",closeFunction:"&"}}return h()(e,[{key:"controller",value:["$scope","$rootScope","authManager","modelManager","syncManager","storageManager","dbManager","passcodeManager","$timeout","$compile","archiveManager","privilegesManager","appVersion","alertManager",function(e,t,n,r,i,a,c,u,f,d,p,h,v,m){e.appVersion="v"+(window.electronAppVersion||v),e.formData={mergeLocal:!0,ephemeral:!1},e.user=n.user,i.getServerURL().then((function(t){f((function(){e.server=t,e.formData.url=t}))})),n.checkForSecurityUpdate().then((function(t){e.securityUpdateAvailable=t})),e.close=function(){f((function(){e.closeFunction()()}))},e.encryptedBackupsAvailable=function(){return n.user||u.hasPasscode()},e.canAddPasscode=!n.isEphemeralSession(),e.syncStatus=i.syncStatus,e.submitMfaForm=function(){var t={};t[e.formData.mfa.payload.mfa_key]=e.formData.userMfaCode,e.login(t)},e.submitAuthForm=function(){e.formData.email&&e.formData.user_password&&(e.formData.showLogin?e.login():e.register())},e.login=function(t){i.lockSyncing(),e.formData.status="Generating Login Keys...",e.formData.authenticating=!0,f((function(){n.login(e.formData.url,e.formData.email,e.formData.user_password,e.formData.ephemeral,e.formData.strictSignin,t).then((function(t){f((function(){if(!t||t.error){i.unlockSyncing(),e.formData.status=null;var n=t?t.error:{message:"An unknown error occured."};"mfa-required"==n.tag||"mfa-invalid"==n.tag?(e.formData.showLogin=!1,e.formData.mfa=n):(e.formData.showLogin=!0,e.formData.mfa=null,n.message&&m.alert({text:n.message})),e.formData.authenticating=!1}else e.onAuthSuccess((function(){i.unlockSyncing(),i.sync({performIntegrityCheck:!0})}))}))}))}))},e.register=function(){e.formData.password_conf===e.formData.user_password?(e.formData.confirmPassword=!1,e.formData.status="Generating Account Keys...",e.formData.authenticating=!0,f((function(){n.register(e.formData.url,e.formData.email,e.formData.user_password,e.formData.ephemeral).then((function(t){f((function(){if(!t||t.error){e.formData.status=null;var n=t?t.error:{message:"An unknown error occured."};e.formData.authenticating=!1,m.alert({text:n.message})}else e.onAuthSuccess((function(){i.sync()}))}))}))}))):m.alert({text:"The two passwords you entered do not match. Please try again."})},e.mergeLocalChanged=function(){e.formData.mergeLocal||m.confirm({text:"Unchecking this option means any of the notes you have written while you were signed out will be deleted. Are you sure you want to discard these notes?",destructive:!0,onCancel:function(){e.formData.mergeLocal=!0}})},e.onAuthSuccess=function(n){var o=function(){f((function(){e.formData.authenticating=!1,e.onSuccessfulAuth()(),i.refreshErroredItems(),n&&n()}))};e.formData.mergeLocal?(t.$broadcast("major-data-change"),e.clearDatabaseAndRewriteAllItems(!0,o)):(r.removeAllItemsFromMemory(),a.clearAllModels().then((function(){o()})))},e.openPasswordWizard=function(t){e.close(),n.presentPasswordWizard(t)},e.openPrivilegesModal=function(){var t;return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return e.close(),t=function(){f((function(){h.presentPrivilegesManagementModal()}))},n.next=4,l.a.awrap(h.actionRequiresPrivilege(x.ActionManagePrivileges));case 4:if(!n.sent){n.next=8;break}h.presentPrivilegesModal(x.ActionManagePrivileges,(function(){t()})),n.next=9;break;case 8:t();case 9:case"end":return n.stop()}}))},e.clearDatabaseAndRewriteAllItems=function(e,t){a.clearAllModels().then((function(){i.markAllItemsDirtyAndSaveOffline(e).then((function(){t&&t()}))}))},e.destroyLocalData=function(){m.confirm({text:"Are you sure you want to end your session? This will delete all local items and extensions.",destructive:!0,onConfirm:function(){n.signout(!0).then((function(){window.location.reload()}))}})},e.archiveFormData={encrypted:!!e.encryptedBackupsAvailable()},e.user=n.user,e.submitImportPassword=function(){e.performImport(e.importData.data,e.importData.password)},e.performImport=function(t,n){e.importData.loading=!0,f((function(){e.importJSONData(t,n,(function(t,n){f((function(){e.importData.loading=!1,e.importData=null,setTimeout((function(){if(t&&t.error)m.alert({text:"There was an error importing your data. Please try again."});else if(n>0){var e="Import complete. ".concat(n," items were not imported because there was an error decrypting them. Make sure the password is correct and try again.");m.alert({text:e})}else m.alert({text:"Your data has been successfully imported."})}),10)}))}))}))},e.importFileSelected=function(t){var n;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=function(){f((function(){e.importData={};var n=t[0],r=new FileReader;r.onload=function(t){try{var n=JSON.parse(t.target.result);f((function(){n.auth_params?(e.importData.requestPassword=!0,e.importData.data=n,f((function(){var e=document.getElementById("import-password-request");e&&e.scrollIntoView(!1)}))):e.performImport(n,null)}))}catch(t){m.alert({text:"Unable to open file. Ensure it is a proper JSON file and try again."})}},r.readAsText(n)}))},r.next=3,l.a.awrap(h.actionRequiresPrivilege(x.ActionManageBackups));case 3:if(!r.sent){r.next=7;break}h.presentPrivilegesModal(x.ActionManageBackups,(function(){n()})),r.next=8;break;case 7:n();case 8:case"end":return r.stop()}}))},e.importJSONData=function(e,t,n){var a=function(t){var o,a,s,c,u,f,d;return l.a.async((function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,l.a.awrap(r.importItems(e.items));case 2:for(o=p.sent,a=!0,s=!1,c=void 0,p.prev=6,u=o[Symbol.iterator]();!(a=(f=u.next()).done);a=!0)"SN|Component"==(d=f.value).content_type&&(d.active=!1);p.next=14;break;case 10:p.prev=10,p.t0=p.catch(6),s=!0,c=p.t0;case 14:p.prev=14,p.prev=15,a||null==u.return||u.return();case 17:if(p.prev=17,!s){p.next=20;break}throw c;case 20:return p.finish(17);case 21:return p.finish(14);case 22:i.sync().then((function(e){n(e,t)}));case 23:case"end":return p.stop()}}),null,null,[[6,10,14,22],[15,,17,21]])};e.auth_params?o.cryptoManager.computeEncryptionKeysForUser(t,e.auth_params).then((function(t){try{o.cryptoManager.decryptMultipleItems(e.items,t,!1).then((function(){e.items.forEach((function(e){e.enc_item_key=null,e.auth_hash=null}));var t=0;e.items=e.items.filter((function(e){return!e.errorDecrypting||(t++,!1)})),a(t)}))}catch(e){return console.log("Error decrypting",e),m.alert({text:"There was an error decrypting your items. Make sure the password you entered is correct and try again."}),void n(null)}})):a()},e.downloadDataArchive=function(){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:p.downloadBackup(e.archiveFormData.encrypted);case 1:case"end":return t.stop()}}))},e.notesAndTagsCount=function(){return r.allItemsMatchingTypes(["Note","Tag"]).length},e.encryptionStatusForNotes=function(){var t=e.notesAndTagsCount();return t+"/"+t+" notes and tags encrypted"},e.encryptionEnabled=function(){return u.hasPasscode()||!n.offline()},e.encryptionSource=function(){return n.offline()?u.hasPasscode()?"Local Passcode":null:"Account keys"},e.encryptionStatusString=function(){return n.offline()?u.hasPasscode()?"Encryption is enabled. Your data is encrypted using your passcode before it is saved to your device storage.":"Encryption is not enabled. Sign in, register, or add a passcode lock to enable encryption.":"End-to-end encryption is enabled. Your data is encrypted on your device first, then synced to your private cloud."},e.passcodeAutoLockOptions=u.getAutoLockIntervalOptions(),e.reloadAutoLockInterval=function(){u.getAutoLockInterval().then((function(t){f((function(){e.selectedAutoLockInterval=t}))}))},e.reloadAutoLockInterval(),e.selectAutoLockInterval=function(t){var n;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=function(){return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l.a.awrap(u.setAutoLockInterval(t));case 2:f((function(){e.reloadAutoLockInterval()}));case 3:case"end":return n.stop()}}))},r.next=3,l.a.awrap(h.actionRequiresPrivilege(x.ActionManagePasscode));case 3:if(!r.sent){r.next=7;break}h.presentPrivilegesModal(x.ActionManagePasscode,(function(){n()})),r.next=8;break;case 7:n();case 8:case"end":return r.stop()}}))},e.hasPasscode=function(){return u.hasPasscode()},e.addPasscodeClicked=function(){e.formData.showPasscodeForm=!0},e.submitPasscodeForm=function(){var r=e.formData.passcode;r===e.formData.confirmPasscode?(e.formData.changingPasscode?u.changePasscode.bind(u):u.setPasscode.bind(u))(r,(function(){f((function(){e.formData.passcode=null,e.formData.confirmPasscode=null,e.formData.showPasscodeForm=!1,n.offline()&&(t.$broadcast("major-data-change"),e.clearDatabaseAndRewriteAllItems(!1))}))})):m.alert({text:"The two passcodes you entered do not match. Please try again."})},e.changePasscodePressed=function(){var t;return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t=function(){f((function(){e.formData.changingPasscode=!0,e.addPasscodeClicked()}))},n.next=3,l.a.awrap(h.actionRequiresPrivilege(x.ActionManagePasscode));case 3:if(!n.sent){n.next=7;break}h.presentPrivilegesModal(x.ActionManagePasscode,(function(){t()})),n.next=8;break;case 7:t();case 8:case"end":return n.stop()}}))},e.removePasscodePressed=function(){var e;return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return e=function(){f((function(){var e="Are you sure you want to remove your local passcode?";!n.offline()||(e+=" This will remove encryption from your local data."),m.confirm({text:e,destructive:!0,onConfirm:function(){u.clearPasscode(),n.offline()&&i.markAllItemsDirtyAndSaveOffline()}})}))},t.next=3,l.a.awrap(h.actionRequiresPrivilege(x.ActionManagePasscode));case 3:if(!t.sent){t.next=7;break}h.presentPrivilegesModal(x.ActionManagePasscode,(function(){e()})),t.next=8;break;case 7:e();case 8:case"end":return t.stop()}}))},e.isDesktopApplication=function(){return s()}}]}]),e}(),X=n(20),Q=n.n(X),ee=function(){function e(){d()(this,e),this.restrict="E",this.template=Q.a,this.scope={item:"="}}return h()(e,[{key:"controller",value:["$scope","modelManager","actionsManager",function(e,t,n){e.extensions=n.extensions.sort((function(e,t){return e.name.toLowerCase()<t.name.toLowerCase()?-1:1}));var r=!0,i=!1,o=void 0;try{for(var a,s=function(){var t=a.value;t.loading=!0,n.loadExtensionInContextOfItem(t,e.item,(function(e){t.loading=!1}))},c=e.extensions[Symbol.iterator]();!(r=(a=c.next()).done);r=!0)s()}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}e.executeAction=function(t,r,i){"nested"!=t.verb?(t.running=!0,n.executeAction(t,r,e.item,(function(i,o){o||(t.running=!1,e.handleActionResponse(t,i),n.loadExtensionInContextOfItem(r,e.item,(function(e){})))}))):t.subrows?t.subrows=null:t.subrows=e.subRowsForAction(t,r)},e.handleActionResponse=function(e,t){switch(e.verb){case"render":var r=t.item;n.presentRevisionPreviewModal(r.uuid,r.content)}},e.subRowsForAction=function(e,t){var n=this;return e.subactions?e.subactions.map((function(r){return{onClick:function(){n.executeAction(r,t,e)},label:r.label,subtitle:r.desc,spinnerClass:r.running?"info":null}})):null}}]}]),e}(),te=n(21),ne=n.n(te),re=function(){function e(){d()(this,e),this.restrict="E",this.template=ne.a,this.scope={show:"=",component:"=",callback:"=",onDismiss:"&"}}return h()(e,[{key:"link",value:function(e,t,n){e.el=t}},{key:"controller",value:["$scope","$timeout","componentManager",function(e,t,n){e.dismiss=function(t){e.el.remove(),e.$destroy(),e.onDismiss&&e.onDismiss()&&e.onDismiss()(e.component),t&&t()}}]}]),e}(),ie=n(22),oe=n.n(ie),ae=function(){function e(t,n,r,i,o){d()(this,e),this.restrict="E",this.template=oe.a,this.scope={component:"=",onLoad:"=?",manualDealloc:"=?"},this.desktopManager=r}return h()(e,[{key:"link",value:function(e,t,n,r){e.el=t,e.componentValid=!0,e.updateObserver=this.desktopManager.registerUpdateObserver((function(t){t==e.component&&t.active&&e.reloadComponent()})),e.$watch("component",(function(e,t){r.componentValueChanging(e,t)}))}},{key:"controller",value:["$scope","$rootScope","$timeout","componentManager","desktopManager","themeManager",function(e,t,n,r,i,o){e.onVisibilityChange=function(){"hidden"!=document.visibilityState&&e.issueLoading&&e.reloadComponent()},e.themeHandlerIdentifier="component-view-"+Math.random(),r.registerHandler({identifier:e.themeHandlerIdentifier,areas:["themes"],activationHandler:function(t){e.reloadThemeStatus()}}),e.identifier="component-view-"+Math.random(),r.registerHandler({identifier:e.identifier,areas:[e.component.area],activationHandler:function(t){t===e.component&&n((function(){e.handleActivation()}))},actionHandler:function(e,t,n){"set-size"==t&&r.handleSetSizeEvent(e,n)}}),e.handleActivation=function(){var t=e.component;if(t.active){var i=r.iframeForComponent(t);i&&(e.loading=!0,e.loadTimeout&&n.cancel(e.loadTimeout),e.loadTimeout=n((function(){e.loading&&(e.loading=!1,e.issueLoading=!0,e.didAttemptReload?document.addEventListener("visibilitychange",e.onVisibilityChange):(e.didAttemptReload=!0,e.reloadComponent()))}),3500),i.onload=function(o){var a=!1;try{!s()||null!=i.contentWindow.origin&&"null"!=i.contentWindow.origin||(a=!0)}catch(e){}n.cancel(e.loadTimeout),r.registerComponentWindow(t,i.contentWindow).then((function(){n((function(){e.loading=!1,e.issueLoading=a,e.onLoad&&e.onLoad(e.component)}),7)}))})}},this.componentValueChanging=function(t,n){n&&t!==n&&r.deactivateComponent(n,!0),t&&(r.activateComponent(t,!0),e.reloadStatus())},e.$on("ext-reload-complete",(function(){e.reloadStatus(!1)})),e.reloadComponent=function(){e.componentValid=!1,r.reloadComponent(e.component).then((function(){e.reloadStatus()}))},e.reloadStatus=function(){var i=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=e.component;e.reloading=!0;var a=e.componentValid,c=o.offlineOnly&&!s(),u=!s()&&!o.hasValidHostedUrl()||s()&&!o.local_url&&!o.hasValidHostedUrl();e.expired=o.valid_until&&o.valid_until<=new Date,o.lockReadonly||(o.readonly=e.expired),e.componentValid=!c&&!u,e.componentValid||(e.loading=!1),e.error=c?"offline-restricted":u?"url-missing":null,e.componentValid!==a&&e.componentValid&&r.reloadComponent(o,!0),e.expired&&i&&t.$broadcast("reload-ext-data"),e.reloadThemeStatus(),n((function(){e.reloading=!1}),500)},e.reloadThemeStatus=function(){e.component.acceptsThemes()||(o.hasActiveTheme()?e.dismissedNoThemesMessage||(e.showNoThemesMessage=!0):e.showNoThemesMessage=!1)},e.noThemesMessageDismiss=function(){e.showNoThemesMessage=!1,e.dismissedNoThemesMessage=!0},e.disableActiveTheme=function(){o.deactivateAllThemes(),e.noThemesMessageDismiss()},e.getUrl=function(){var t=r.urlForComponent(e.component);return e.component.runningLocally=t==e.component.local_url,t},e.destroy=function(){r.deregisterHandler(e.themeHandlerIdentifier),r.deregisterHandler(e.identifier),e.component&&!e.manualDealloc&&r.deactivateComponent(e.component,!0),i.deregisterUpdateObserver(e.updateObserver),document.removeEventListener("visibilitychange",e.onVisibilityChange)},e.$on("$destroy",(function(){e.destroy()}))}]}]),e}(),se=n(23),ce=n.n(se),ue=function(){function e(){d()(this,e),this.restrict="E",this.template=ce.a,this.scope={item1:"=",item2:"=",callback:"="}}return h()(e,[{key:"link",value:function(e,t,n){e.dismiss=function(){t.remove()}}},{key:"controller",value:["$scope","modelManager","syncManager","archiveManager","alertManager",function(e,t,n,r,i){e.createContentString=function(e){return JSON.stringify(Object.assign({created_at:e.created_at,updated_at:e.updated_at},e.content),null,2)},e.contentType=e.item1.content_type,e.item1Content=e.createContentString(e.item1),e.item2Content=e.createContentString(e.item2),e.keepItem1=function(){i.confirm({text:"Are you sure you want to delete the item on the right?",destructive:!0,onConfirm:function(){t.setItemToBeDeleted(e.item2),n.sync().then((function(){e.applyCallback()})),e.dismiss()}})},e.keepItem2=function(){i.confirm({text:"Are you sure you want to delete the item on the left?",destructive:!0,onConfirm:function(){t.setItemToBeDeleted(e.item1),n.sync().then((function(){e.applyCallback()})),e.dismiss()}})},e.keepBoth=function(){e.applyCallback(),e.dismiss()},e.export=function(){r.downloadBackupOfItems([e.item1,e.item2],!0)},e.applyCallback=function(){e.callback&&e.callback()}}]}]),e}(),le=n(24),fe=n.n(le),de=function(){function e(){d()(this,e),this.restrict="E",this.template=fe.a,this.scope={callback:"&",selectedEditor:"=",currentItem:"="}}return h()(e,[{key:"controller",value:["$scope","componentManager","syncManager","modelManager","$timeout",function(e,t,n,r,i){e.formData={},e.editors=t.componentsForArea("editor-editor").sort((function(e,t){return e.name.toLowerCase()<t.name.toLowerCase()?-1:1})),e.isDesktop=s(),e.defaultEditor=e.editors.filter((function(e){return e.isDefaultEditor()}))[0],e.selectComponent=function(t){t&&t.content.conflict_of&&(t.content.conflict_of=null,r.setItemDirty(t,!0),n.sync()),i((function(){e.callback()(t)}))},e.toggleDefaultForEditor=function(t){e.defaultEditor==t?e.removeEditorDefault(t):e.makeEditorDefault(t)},e.offlineAvailableForComponent=function(e){return e.local_url&&s()},e.makeEditorDefault=function(i){var o=t.componentsForArea("editor-editor").filter((function(e){return e.isDefaultEditor()}))[0];o&&(o.setAppDataItem("defaultEditor",!1),r.setItemDirty(o,!0)),i.setAppDataItem("defaultEditor",!0),r.setItemDirty(i,!0),n.sync(),e.defaultEditor=i},e.removeEditorDefault=function(t){t.setAppDataItem("defaultEditor",!1),r.setItemDirty(t,!0),n.sync(),e.defaultEditor=null},e.shouldDisplayRunningLocallyLabel=function(t){return!!t.runningLocally&&t==e.selectedEditor}}]}]),e}(),pe=n(25),he=n.n(pe),ve=function(){function e(){d()(this,e),this.restrict="E",this.template=he.a,this.scope={type:"=",title:"=",message:"=",placeholder:"=",callback:"&"}}return h()(e,[{key:"link",value:function(e,t,n){e.el=t}},{key:"controller",value:["$scope","modelManager","archiveManager","authManager","syncManager","$timeout",function(e,t,n,r,i,o){e.formData={},e.dismiss=function(){e.el.remove(),e.$destroy()},e.submit=function(){e.callback()(e.formData.input),e.dismiss()}}]}]),e}(),me=n(26),ye=n.n(me),ge=function(){function e(){d()(this,e),this.restrict="E",this.transclude=!0,this.template=ye.a,this.scope={action:"&",circle:"=",circleAlign:"=",label:"=",subtitle:"=",hasButton:"=",buttonText:"=",buttonClass:"=",buttonAction:"&",spinnerClass:"=",subRows:"=",faded:"=",desc:"=",disabled:"=",stylekitClass:"="}}return h()(e,[{key:"controller",value:["$scope","componentManager",function(e,t){e.onClick=function(t){e.disabled||(t.stopPropagation(),e.action())},e.clickButton=function(t){e.disabled||(t.stopPropagation(),e.buttonAction())}}]}]),e}(),be=n(27),we=n.n(be),ke=function(){function e(){d()(this,e),this.restrict="E",this.template=we.a,this.scope={index:"=",panelId:"=",onResize:"&",defaultWidth:"=",onResizeFinish:"&",control:"=",alwaysVisible:"=",minWidth:"=",property:"=",hoverable:"=",collapsable:"="}}return h()(e,[{key:"link",value:function(e,t,n,r){e.elem=t,e.control.setWidth=function(t){e.setWidth(t,!0)},e.control.setLeft=function(t){e.setLeft(t)},e.control.flash=function(){e.flash()},e.control.isCollapsed=function(){return e.isCollapsed()}}},{key:"controller",value:["$scope","$element","modelManager","actionsManager","$timeout","$compile",function(e,t,n,r,o,a){var s=document.getElementById(e.panelId);s||console.log("Panel not found for",e.panelId);var c,u=t[0],l=u.offsetWidth,f=e.minWidth||l,d=!1,p=s.scrollWidth,h=0,v=p,m=s.offsetLeft,y=m;e.isAtMaxWidth=function(){return Math.round(v+y)==Math.round($().width)},e.isCollapsed=function(){return v<=f};var g,b,w,k,x=0;function $(){return s.parentNode.getBoundingClientRect()}if(u.ondblclick=function(){o((function(){var t=e.isCollapsed();t?e.setWidth(x||e.defaultWidth):(x=v,e.setWidth(f)),e.finishSettingWidth();var n=!t;e.onResizeFinish()(v,y,e.isAtMaxWidth(),n)}))},"right"==e.property){var _=(g=function(t){S(),M(),o((function(){e.finishSettingWidth()}))},b=250,function(){var e=this,t=arguments,n=function(){k=null,w||g.apply(e,t)},r=w&&!k;clearTimeout(k),k=setTimeout(n,b),r&&g.apply(e,t)});window.addEventListener("resize",_),e.$on("$destroy",(function(){window.removeEventListener("resize",_)}))}function S(){p=e.isAtMaxWidth()?$().width:s.scrollWidth,v=p,c=document.getElementById("app").getBoundingClientRect()}function M(t){var n;t?n=t.clientX:(n=0,h=0);var r=p+(n-h);e.setWidth(r,!1),e.onResize()&&e.onResize()(v,s)}S(),e.alwaysVisible&&u.classList.add("always-visible"),e.hoverable&&u.classList.add("hoverable"),e.setWidth=function(t,n){t<f&&(t=f);var r=$();t>r.width&&(t=r.width);var i=c.width-s.getBoundingClientRect().x;t>i&&(t=i),Math.round(t+y)==Math.round(r.width)?(s.style.width="calc(100% - ".concat(y,"px)"),s.style.flexBasis="calc(100% - ".concat(y,"px)")):(s.style.flexBasis=t+"px",s.style.width=t+"px"),v=t,n&&e.finishSettingWidth()},e.setLeft=function(e){s.style.left=e+"px",y=e},e.finishSettingWidth=function(){e.collapsable&&(e.isCollapsed()?u.classList.add("collapsed"):u.classList.remove("collapsed"))},e.addInvisibleOverlay=function(){e.overlay||(e.overlay=a("<div id='resizer-overlay'></div>")(e),i.a.element(document.body).prepend(e.overlay))},e.removeInvisibleOverlay=function(){e.overlay&&(e.overlay.remove(),e.overlay=null)},e.flash=function(){u.classList.add("animate-opacity"),o((function(){u.classList.remove("animate-opacity")}),3e3)},u.addEventListener("mousedown",(function(t){e.addInvisibleOverlay(),d=!0,h=t.clientX,p=s.scrollWidth,m=s.offsetLeft,s.classList.add("no-selection"),e.hoverable&&u.classList.add("dragging")})),document.addEventListener("mousemove",(function(t){d&&(t.preventDefault(),e.property&&"left"==e.property?function(t){var n=s.getBoundingClientRect(),r=(t.clientX||n.x)-h,i=m+r;i<0&&(i=0,r=-m);var o=$(),a=p-r;a<f&&(a=f);a>o.width&&(a=o.width);i+a>o.width&&(i=o.width-a);e.setLeft(i,!1),e.setWidth(a,!1)}(t):M(t))})),document.addEventListener("mouseup",(function(t){if(e.removeInvisibleOverlay(),d){d=!1,u.classList.remove("dragging"),s.classList.remove("no-selection");var n=e.isAtMaxWidth();e.onResizeFinish&&e.onResizeFinish()(v,y,n,e.isCollapsed()),e.finishSettingWidth()}}))}]}]),e}();var xe,$e,_e=n(28),Se=n.n(_e),Me=function(){function e(){d()(this,e),this.restrict="E",this.template=Se.a,this.scope={type:"="}}return h()(e,[{key:"link",value:function(e,t,n){e.el=t}},{key:"controller",value:["$scope","modelManager","archiveManager","authManager","syncManager","$timeout","alertManager",function(e,t,n,r,i,a,s){window.onbeforeunload=function(e){return!0},e.$on("$destroy",(function(){window.onbeforeunload=null})),e.dismiss=function(){e.lockContinue?s.alert({text:"Cannot close window until pending tasks are complete."}):(e.el.remove(),e.$destroy())},e.syncStatus=i.syncStatus,e.formData={};e.continueTitle="Continue",e.step=0,e.titleForStep=function(t){switch(t){case 1:return"Download a backup of your data";case 2:return"Sign out of all your devices";case 3:return e.changePassword?"Password information":"Enter your current password";case 4:return"Encrypt and sync data with new keys";case 5:return"Sign back in to your devices";default:return null}},e.configure=void("change-pw"==e.type?(e.title="Change Password",e.changePassword=!0):"upgrade-security"==e.type&&(e.title="Security Update",e.securityUpdate=!0)),e.continue=function(){if(!e.lockContinue&&!e.isContinuing)if(e.isContinuing=!0,5!=e.step){var t=function(){e.step+=1,e.initializeStep(e.step),e.isContinuing=!1},n=e.preprocessorForStep(e.step);n?n((function(){t()}),(function(){e.isContinuing=!1})):t()}else e.dismiss()},e.downloadBackup=function(e){n.downloadBackup(e)},e.preprocessorForStep=function(t){if(3==t)return function(t,n){e.showSpinner=!0,e.continueTitle="Generating Keys...",a((function(){e.validateCurrentPassword((function(r){e.showSpinner=!1,e.continueTitle="Continue",r?t():n&&n()}))}))}};var c="There was an error re-encrypting your items. Your password was changed, but not all your items were properly re-encrypted and synced. You should try syncing again. If all else fails, you should restore your notes from backup.";e.initializeStep=function(t){4==t?(e.lockContinue=!0,e.formData.status="Processing encryption keys...",e.formData.processing=!0,e.processPasswordChange((function(t){e.formData.statusError=!t,e.formData.processing=t,t?(e.formData.status="Encrypting and syncing data with new keys...",e.resyncData((function(t){e.formData.statusError=!t,e.formData.processing=!t,t?(e.lockContinue=!1,e.changePassword?e.formData.status="Successfully changed password and synced all items.":e.securityUpdate&&(e.formData.status="Successfully performed security update and synced all items.")):e.formData.status=c}))):e.formData.status="Unable to process your password. Please try again."}))):5==t&&(e.continueTitle="Finish")},e.validateCurrentPassword=function(t){var n,i,c,u,f=this;return l.a.async((function(d){for(;;)switch(d.prev=d.next){case 0:if(n=e.formData.currentPassword,i=e.securityUpdate?n:e.formData.newPassword,n&&0!=n.length){d.next=6;break}return s.alert({text:"Please enter your current password."}),t(!1),d.abrupt("return");case 6:if(!e.changePassword){d.next=16;break}if(i&&0!=i.length){d.next=11;break}return s.alert({text:"Please enter a new password."}),t(!1),d.abrupt("return");case 11:if(i==e.formData.newPasswordConfirmation){d.next=16;break}return s.alert({text:"Your new password does not match its confirmation."}),e.formData.status=null,t(!1),d.abrupt("return");case 16:if(r.user.email){d.next=21;break}return s.alert({text:"We don't have your email stored. Please log out then log back in to fix this issue."}),e.formData.status=null,t(!1),d.abrupt("return");case 21:return d.next=23,l.a.awrap(r.getAuthParams());case 23:c=d.sent,u=e.formData.currentPassword,o.cryptoManager.computeEncryptionKeysForUser(u,c).then((function(e){var n;return l.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.t0=e.mk,i.next=3,l.a.awrap(r.keys());case 3:i.t1=i.sent.mk,(n=i.t0===i.t1)?f.currentServerPw=e.pw:s.alert({text:"The current password you entered is not correct. Please try again."}),a((function(){return t(n)}));case 7:case"end":return i.stop()}}))}));case 26:case"end":return d.stop()}}))},e.resyncData=function(e){t.setAllItemsDirty(),i.sync().then((function(t){!t||t.error?(s.alert({text:c}),a((function(){return e(!1)}))):a((function(){return e(!0)}))}))},e.processPasswordChange=function(t){var n,c,u,f,d;return l.a.async((function(p){for(;;)switch(p.prev=p.next){case 0:return n=e.securityUpdate?e.formData.currentPassword:e.formData.newPassword,c=this.currentServerPw,p.next=4,l.a.awrap(o.cryptoManager.generateInitialKeysAndAuthParamsForUser(r.user.email,n));case 4:return u=p.sent,f=u.keys,d=u.authParams,p.next=9,l.a.awrap(i.sync());case 9:return p.sent,p.t0=r,p.next=13,l.a.awrap(i.getServerURL());case 13:p.t1=p.sent,p.t2=r.user.email,p.t3=c,p.t4=f,p.t5=d,p.t6=function(e){e.error?(s.alert({text:e.error.message?e.error.message:"There was an error changing your password. Please try again."}),a((function(){return t(!1)}))):a((function(){return t(!0)}))},p.t0.changePassword.call(p.t0,p.t1,p.t2,p.t3,p.t4,p.t5).then(p.t6);case 20:case"end":return p.stop()}}),null,this)}}]}]),e}(),Ce=n(29),Ae=n.n(Ce),Ie=function(){function e(){d()(this,e),this.restrict="E",this.template=Ae.a,this.scope={show:"=",component:"=",permissionsString:"=",callback:"="}}return h()(e,[{key:"link",value:function(e,t,n){e.dismiss=function(){t.remove()},e.accept=function(){e.callback(!0),e.dismiss()},e.deny=function(){e.callback(!1),e.dismiss()}}},{key:"controller",value:["$scope","modelManager",function(e,t){}]}]),e}(),Ee=n(30),Oe=n.n(Ee),De=function(){function e(){d()(this,e),this.restrict="E",this.template=Oe.a,this.scope={action:"=",onSuccess:"=",onCancel:"="}}return h()(e,[{key:"link",value:function(e,t,n){e.dismiss=function(){t.remove()}}},{key:"controller",value:["$scope","privilegesManager","passcodeManager","authManager","$timeout",function(e,t,n,r,i){e.authenticationParameters={},e.sessionLengthOptions=t.getSessionLengthOptions(),t.getSelectedSessionLength().then((function(t){i((function(){e.selectedSessionLength=t}))})),e.selectSessionLength=function(t){e.selectedSessionLength=t},t.netCredentialsForAction(e.action).then((function(t){i((function(){e.requiredCredentials=t.sort()}))})),e.promptForCredential=function(e){return t.displayInfoForCredential(e).prompt},e.cancel=function(){e.dismiss(),e.onCancel&&e.onCancel()},e.isCredentialInFailureState=function(t){return!!e.failedCredentials&&null!=e.failedCredentials.find((function(e){return e==t}))},e.validate=function(){var t=[],n=!0,r=!1,i=void 0;try{for(var o,a=e.requiredCredentials[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,c=e.authenticationParameters[s];c&&0!=c.length||t.push(s)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return e.failedCredentials=t,0==t.length},e.submit=function(){e.validate()&&t.authenticateAction(e.action,e.authenticationParameters).then((function(n){i((function(){n.success?(t.setSessionLength(e.selectedSessionLength),e.onSuccess(),e.dismiss()):e.failedCredentials=n.failedCredentials}))}))}}]}]),e}(),Re=n(31),Pe=n.n(Re),Te=function(){function e(){d()(this,e),this.restrict="E",this.template=Pe.a,this.scope={}}return h()(e,[{key:"link",value:function(e,t,n){e.dismiss=function(){t.remove()}}},{key:"controller",value:["$scope","privilegesManager","passcodeManager","authManager","$timeout",function(e,t,n,r,i){e.dummy={},e.hasPasscode=n.hasPasscode(),e.hasAccount=!r.offline(),e.displayInfoForCredential=function(n){var r=t.displayInfoForCredential(n);return n==x.CredentialLocalPasscode?r.availability=e.hasPasscode:n==x.CredentialAccountPassword?r.availability=e.hasAccount:r.availability=!0,r},e.displayInfoForAction=function(e){return t.displayInfoForAction(e).label},e.isCredentialRequiredForAction=function(t,n){return!!e.privileges&&e.privileges.isCredentialRequiredForAction(t,n)},e.clearSession=function(){t.clearSession().then((function(){e.reloadPrivileges()}))},e.reloadPrivileges=function(){var n,r,o,a,s,c,u;return l.a.async((function(f){for(;;)switch(f.prev=f.next){case 0:return e.availableActions=t.getAvailableActions(),e.availableCredentials=t.getAvailableCredentials(),f.next=4,l.a.awrap(t.getSessionExpirey());case 4:for(n=f.sent,e.sessionExpirey=n.toLocaleString(),e.sessionExpired=new Date>=n,e.credentialDisplayInfo={},r=!0,o=!1,a=void 0,f.prev=11,s=e.availableCredentials[Symbol.iterator]();!(r=(c=s.next()).done);r=!0)u=c.value,e.credentialDisplayInfo[u]=e.displayInfoForCredential(u);f.next=19;break;case 15:f.prev=15,f.t0=f.catch(11),o=!0,a=f.t0;case 19:f.prev=19,f.prev=20,r||null==s.return||s.return();case 22:if(f.prev=22,!o){f.next=25;break}throw a;case 25:return f.finish(22);case 26:return f.finish(19);case 27:t.getPrivileges().then((function(t){i((function(){e.privileges=t}))}));case 28:case"end":return f.stop()}}),null,null,[[11,15,19,27],[20,,22,26]])},e.checkboxValueChanged=function(n,r){e.privileges.toggleCredentialForAction(n,r),t.savePrivileges()},e.reloadPrivileges(),e.cancel=function(){e.dismiss(),e.onCancel&&e.onCancel()}}]}]),e}(),je=n(32),Fe=n.n(je),Ne=function(){function e(){d()(this,e),this.restrict="E",this.template=Fe.a,this.scope={uuid:"=",content:"="}}return h()(e,[{key:"link",value:function(e,t,n){e.el=t}},{key:"controller",value:["$scope","modelManager","syncManager","componentManager","$timeout","alertManager",function(e,t,n,r,i,a){e.dismiss=function(){e.el.remove(),e.$destroy()},e.$on("$destroy",(function(){e.identifier&&r.deregisterHandler(e.identifier)})),e.note=new o.SFItem({content:e.content,content_type:"Note"}),e.note.uuid=e.uuid;var s=r.editorForNote(e.note);if(e.note.uuid=o.cryptoManager.crypto.generateUUIDSync(),s){var c=new o.SNComponent({content:s.content});c.readonly=!0,c.lockReadonly=!0,e.identifier=c.uuid,r.registerHandler({identifier:e.identifier,areas:["editor-editor"],contextRequestHandler:function(t){if(t==e.editor)return e.note},componentForSessionKeyHandler:function(t){if(t==e.editor.sessionKey)return e.editor}}),e.editor=c}e.restore=function(r){var i=function(){var i;if(r){var a=Object.assign({},e.content);a.title&&(a.title+=" (copy)"),i=t.createItem({content_type:"Note",content:a}),t.addItem(i)}else{var s=e.uuid;(i=t.findItem(s)).content=Object.assign({},e.content),t.mapResponseItemsToLocalModels([i],o.SFModelManager.MappingSourceRemoteActionRetrieved)}t.setItemDirty(i,!0),n.sync(),e.dismiss()};r?i():a.confirm({text:"Are you sure you want to replace the current note's contents with what you see in this preview?",destructive:!0,onConfirm:function(){i()}})}}]}]),e}(),Le=n(33),Ue=n.n(Le),Be=function(){function e(){d()(this,e),this.restrict="E",this.template=Ue.a,this.scope={item:"="}}return h()(e,[{key:"controller",value:["$scope","modelManager","sessionHistory","actionsManager","$timeout","alertManager",function(e,t,n,r,i,o){e.diskEnabled=n.diskEnabled,e.autoOptimize=n.autoOptimize,e.reloadHistory=function(){var t=n.historyForItem(e.item);e.entries=t.entries.slice(0).sort((function(e,t){return e.item.updated_at<t.item.updated_at?1:-1})),e.history=t},e.reloadHistory(),e.openRevision=function(e){r.presentRevisionPreviewModal(e.item.uuid,e.item.content)},e.classForRevision=function(e){var t=e.operationVector();return 0==t?"default":1==t?"success":-1==t?"danger":void 0},e.clearItemHistory=function(){o.confirm({text:"Are you sure you want to delete the local session history for this note?",destructive:!0,onConfirm:function(){n.clearHistoryForItem(e.item).then((function(){i((function(){e.reloadHistory()}))}))}})},e.clearAllHistory=function(){o.confirm({text:"Are you sure you want to delete the local session history for all notes?",destructive:!0,onConfirm:function(){n.clearAllHistory().then((function(){i((function(){e.reloadHistory()}))}))}})},e.toggleDiskSaving=function(){var t=function(){n.toggleDiskSaving().then((function(){i((function(){e.diskEnabled=n.diskEnabled}))}))};n.diskEnabled?t():o.confirm({text:"Are you sure you want to save history to disk? This will decrease general performance, especially as you type. You are advised to disable this feature if you experience any lagging.",destructive:!0,onConfirm:function(){t()}})},e.toggleAutoOptimize=function(){n.toggleAutoOptimize().then((function(){i((function(){e.autoOptimize=n.autoOptimize}))}))}}]}]),e}(),He=n(34),ze=n.n(He),Ve=function(){function e(){d()(this,e),this.restrict="E",this.template=ze.a,this.scope={closeFunction:"&"}}return h()(e,[{key:"controller",value:["$scope","modelManager","syncManager","archiveManager","$timeout",function(e,t,n,r,i){e.status={},e.close=function(){i((function(){e.closeFunction()()}))},e.downloadBackup=function(t){r.downloadBackup(t),e.status.backupFinished=!0},e.skipBackup=function(){e.status.backupFinished=!0},e.performSyncResolution=function(){e.status.resolving=!0,n.resolveOutOfSync().then((function(){e.status.resolving=!1,e.status.attemptedResolution=!0,n.isOutOfSync()?e.status.fail=!0:e.status.success=!0}))}}]}]),e}();function We(e){return function(t){return t?e("date")(new Date(t),"MM/dd/yyyy","UTC"):""}}function Ke(e){return function(t){return"undefined"!=typeof Intl&&Intl.DateTimeFormat?($e||(xe=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language,$e=new Intl.DateTimeFormat(xe,{year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit"})),$e.format(t)):t?e("date")(new Date(t),"MM/dd/yyyy h:mm a"):""}}function qe(e){return function(t){return e.trustAsResourceUrl(t)}}Ke.$inject=["$filter"],We.$inject=["$filter"],qe.$inject=["$sce"];var Je=function(){function e(t,n,r,i,o,a,s,c){d()(this,e),this.httpManager=t,this.modelManager=n,this.authManager=r,this.syncManager=i,this.alertManager=c,this.$rootScope=o,this.$compile=a,this.$timeout=s,this.previousPasswords=[]}return e.$inject=["httpManager","modelManager","authManager","syncManager","$rootScope","$compile","$timeout","alertManager"],h()(e,[{key:"extensionsInContextOfItem",value:function(e){return this.extensions.filter((function(t){return E.a.includes(t.supported_types,e.content_type)||t.actionsWithContextForItem(e).length>0}))}},{key:"loadExtensionInContextOfItem",value:function(e,t,n){this.httpManager.getAbsolute(e.url,{content_type:t.content_type,item_uuid:t.uuid},function(t){this.updateExtensionFromRemoteResponse(e,t),n&&n(e)}.bind(this),function(e){console.log("Error loading extension",e),n&&n(null)}.bind(this))}},{key:"updateExtensionFromRemoteResponse",value:function(e,t){t.description&&(e.description=t.description),t.supported_types&&(e.supported_types=t.supported_types),t.actions?e.actions=t.actions.map((function(e){return new o.Action(e)})):e.actions=[]}},{key:"executeAction",value:function(e,t,n,r){var i,a,s,c,u,f=this;return l.a.async((function(d){for(;;)switch(d.prev=d.next){case 0:i=function(t,n){e.running=!1,f.$timeout((function(){r(t,n)}))},e.running=!0,a="decrypted"==e.access_type,s=[],c=function e(t,n,r){var a,c,u,d,p,h,v,m,y,g,b,w,k,x,$;return l.a.async((function(_){for(;;)switch(_.prev=_.next){case 0:return a=t.item,_.next=3,l.a.awrap(o.cryptoManager.decryptItem(a,n));case 3:if(a.errorDecrypting){_.next=36;break}if(!r){_.next=31;break}return _.next=7,l.a.awrap(f.modelManager.mapResponseItemsToLocalModels([a],o.SFModelManager.MappingSourceRemoteActionRetrieved));case 7:for(c=_.sent,u=!0,d=!1,p=void 0,_.prev=11,h=c[Symbol.iterator]();!(u=(v=h.next()).done);u=!0)m=v.value,f.modelManager.setItemDirty(m,!0);_.next=19;break;case 15:_.prev=15,_.t0=_.catch(11),d=!0,p=_.t0;case 19:_.prev=19,_.prev=20,u||null==h.return||h.return();case 22:if(_.prev=22,!d){_.next=25;break}throw p;case 25:return _.finish(22);case 26:return _.finish(19);case 27:f.syncManager.sync(),i({item:a}),_.next=33;break;case 31:a=f.modelManager.createItem(a),i({item:a});case 33:return _.abrupt("return",!0);case 36:if(t.auth_params){_.next=39;break}return f.alertManager.alert({text:"We were unable to decrypt this revision using your current keys, and this revision is missing metadata that would allow us to try different keys to decrypt it. This can likely be fixed with some manual intervention. Please email hello@standardnotes.org for assistance."}),_.abrupt("return");case 39:y=!0,g=!1,b=void 0,_.prev=42,w=f.previousPasswords[Symbol.iterator]();case 44:if(y=(k=w.next()).done){_.next=62;break}if(x=k.value,!s.includes(x)){_.next=48;break}return _.abrupt("continue",59);case 48:return s.push(x),_.next=51,l.a.awrap(o.cryptoManager.computeEncryptionKeysForUser(x,t.auth_params));case 51:if($=_.sent){_.next=54;break}return _.abrupt("continue",59);case 54:return _.next=56,l.a.awrap(e(t,$,r));case 56:if(!_.sent){_.next=59;break}return _.abrupt("return",!0);case 59:y=!0,_.next=44;break;case 62:_.next=68;break;case 64:_.prev=64,_.t1=_.catch(42),g=!0,b=_.t1;case 68:_.prev=68,_.prev=69,y||null==w.return||w.return();case 71:if(_.prev=71,!g){_.next=74;break}throw b;case 74:return _.finish(71);case 75:return _.finish(68);case 76:return f.presentPasswordModal((function(i){f.previousPasswords.push(i),e(t,n,r)})),_.abrupt("return",!1);case 78:case"end":return _.stop()}}),null,null,[[11,15,19,27],[20,,22,26],[42,64,68,76],[69,,71,75]])},d.t0=e.verb,d.next="get"===d.t0?8:"render"===d.t0?10:"show"===d.t0?12:"post"===d.t0?16:18;break;case 8:return this.alertManager.confirm({text:"Are you sure you want to replace the current note contents with this action's results?",onConfirm:function(){f.httpManager.getAbsolute(e.url,{},(function(t){return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return e.error=!1,n.t0=c,n.t1=t,n.next=5,l.a.awrap(f.authManager.keys());case 5:n.t2=n.sent,(0,n.t0)(n.t1,n.t2,!0);case 7:case"end":return n.stop()}}))}),(function(t){var n=t&&t.error||{message:"An issue occurred while processing this action. Please try again."};f.alertManager.alert({text:n.message}),e.error=!0,i(null,n)}))}}),d.abrupt("break",18);case 10:return this.httpManager.getAbsolute(e.url,{},(function(t){return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return e.error=!1,n.t0=c,n.t1=t,n.next=5,l.a.awrap(f.authManager.keys());case 5:n.t2=n.sent,(0,n.t0)(n.t1,n.t2,!1);case 7:case"end":return n.stop()}}))}),(function(t){var n=t&&t.error||{message:"An issue occurred while processing this action. Please try again."};f.alertManager.alert({text:n.message}),e.error=!0,i(null,n)})),d.abrupt("break",18);case 12:return(u=window.open(e.url,"_blank"))&&u.focus(),i(),d.abrupt("break",18);case 16:return this.outgoingParamsForItem(n,t,a).then((function(n){var r={items:[n]};f.performPost(e,t,r,(function(e){e&&e.error&&f.alertManager.alert({text:"An issue occurred while processing this action. Please try again."}),i(e)}))})),d.abrupt("break",18);case 18:e.lastExecuted=new Date;case 19:case"end":return d.stop()}}),null,this)}},{key:"outgoingParamsForItem",value:function(e,t){var n,r,i,a=arguments;return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>2&&void 0!==a[2]&&a[2],t.next=3,l.a.awrap(this.authManager.keys());case 3:return r=t.sent,n&&(r=null),t.t0=o.SFItemParams,t.t1=e,t.t2=r,t.next=10,l.a.awrap(this.authManager.getAuthParams());case 10:return t.t3=t.sent,i=new t.t0(t.t1,t.t2,t.t3),t.abrupt("return",i.paramsForExtension());case 13:case"end":return t.stop()}}),null,this)}},{key:"performPost",value:function(e,t,n,r){this.httpManager.postAbsolute(e.url,n,function(t){e.error=!1,r&&r(t)}.bind(this),(function(t){e.error=!0,console.log("Action error response:",t),r&&r({error:"Request error"})}))}},{key:"presentRevisionPreviewModal",value:function(e,t){var n=this.$rootScope.$new(!0);n.uuid=e,n.content=t;var r=this.$compile("<revision-preview-modal uuid='uuid' content='content' class='sk-modal'></revision-preview-modal>")(n);i.a.element(document.body).append(r)}},{key:"presentPasswordModal",value:function(e){var t=this.$rootScope.$new(!0);t.type="password",t.title="Decryption Assistance",t.message="Unable to decrypt this item with your current keys. Please enter your account password at the time of this revision.",t.callback=e;var n=this.$compile("<input-modal type='type' message='message' title='title' callback='callback'></input-modal>")(t);i.a.element(document.body).append(n)}},{key:"extensions",get:function(){return this.modelManager.validItemsForContentType("Extension")}}]),e}(),Ge=function(){function e(t,n,r,i){d()(this,e),this.passcodeManager=t,this.authManager=n,this.modelManager=r,this.privilegesManager=i}return e.$inject=["passcodeManager","authManager","modelManager","privilegesManager"],h()(e,[{key:"downloadBackup",value:function(e){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.downloadBackupOfItems(this.modelManager.allItems,e));case 1:case"end":return t.stop()}}),null,this)}},{key:"downloadBackupOfItems",value:function(e,t){var n,r=this;return l.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return n=function(){var n,i;return l.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(!t){o.next=12;break}if(!r.authManager.offline()||!r.passcodeManager.hasPasscode()){o.next=6;break}n=r.passcodeManager.keys(),i=r.passcodeManager.passcodeAuthParams(),o.next=12;break;case 6:return o.next=8,l.a.awrap(r.authManager.keys());case 8:return n=o.sent,o.next=11,l.a.awrap(r.authManager.getAuthParams());case 11:i=o.sent;case 12:r.__itemsData(e,n,i).then((function(i){var o=t?"Encrypted":"Decrypted";r.__downloadData(i,"Standard Notes ".concat(o," Backup - ").concat(r.__formattedDate(),".txt")),n||r.__downloadZippedItems(e)}));case 13:case"end":return o.stop()}}))},i.next=3,l.a.awrap(this.privilegesManager.actionRequiresPrivilege(x.ActionManageBackups));case 3:if(!i.sent){i.next=7;break}this.privilegesManager.presentPrivilegesModal(x.ActionManageBackups,(function(){n()})),i.next=8;break;case 7:n();case 8:case"end":return i.stop()}}),null,this)}},{key:"__formattedDate",value:function(){var e="".concat(new Date),t=e.match(/^(.*?) \(/);return t.length>=2?t[1]:e}},{key:"__itemsData",value:function(e,t,n){var r,i;return l.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,l.a.awrap(this.modelManager.getJSONDataForItems(e,t,n));case 2:return r=o.sent,i=new Blob([r],{type:"text/json"}),o.abrupt("return",i);case 5:case"end":return o.stop()}}),null,this)}},{key:"__loadZip",value:function(e){if(window.zip)e();else{var t=document.createElement("script");t.src="/assets/zip/zip.js",t.async=!1,document.getElementsByTagName("head")[0].appendChild(t),t.onload=function(){zip.workerScriptsPath="assets/zip/",e()}}}},{key:"__downloadZippedItems",value:function(e){var t=this;this.__loadZip((function(){zip.createWriter(new zip.BlobWriter("application/zip"),(function(n){var r=0;!function i(){var o,a,s=e[r];"Note"==s.content_type?(o=s.content.title,a=s.content.text):(o=s.content_type,a=JSON.stringify(s.content,null,2)),o||(o="");var c=new Blob([a],{type:"text/plain"}),u=o.replace(/\//g,"").replace(/\\+/g,""),l="-".concat(s.uuid.split("-")[0],".txt");u=u.slice(0,255-l.length);var f="".concat(s.content_type,"/").concat(u).concat(l);n.add(f,new zip.BlobReader(c),(function(){++r<e.length?i():n.close((function(e){t.__downloadData(e,"Standard Notes Backup - ".concat(t.__formattedDate(),".zip")),n=null}))}))}()}),onerror)}))}},{key:"__hrefForData",value:function(e){return null!==this.textFile&&window.URL.revokeObjectURL(this.textFile),this.textFile=window.URL.createObjectURL(e),this.textFile}},{key:"__downloadData",value:function(e,t){var n=document.createElement("a");n.setAttribute("download",t),n.href=this.__hrefForData(e),document.body.appendChild(n),n.click(),n.remove()}}]),e}(),Ye=n(10),Ze=n.n(Ye),Xe=function(){function e(){d()(this,e),this.memory={}}return h()(e,[{key:"getItem",value:function(e){return this.memory[e]||null}},{key:"getItemSync",value:function(e){return this.getItem(e)}},{key:"setItem",value:function(e,t){this.memory[e]=t}},{key:"removeItem",value:function(e){delete this.memory[e]}},{key:"clear",value:function(){this.memory={}}},{key:"keys",value:function(){return Object.keys(this.memory)}},{key:"key",value:function(e){return Object.keys(this.memory)[e]}},{key:"length",get:function(){return Object.keys(this.memory).length}}]),e}(),Qe=function(e){function t(e,n){var r;return d()(this,t),(r=y()(this,b()(t).call(this))).dbManager=e,r.alertManager=n,r}return t.$inject=["dbManager","alertManager"],k()(t,e),h()(t,[{key:"initialize",value:function(e,n){e?(this.storage=this.memoryStorage,this.itemsStorageMode=t.FixedEncrypted):n?(this.storage=this.memoryStorage,this.itemsStorageMode=t.Ephemeral):(this.storage=localStorage,this.itemsStorageMode=t.Fixed),this.modelStorageMode=n?t.Ephemeral:t.Fixed}},{key:"setItemsMode",value:function(e,n){var r=this.getVault(e);if(r!==this.storage||e!==this.itemsStorageMode||n){for(var i=this.storage.length,o=0;o<i;o++){var a=this.storage.key(o);r.setItem(a,this.storage.getItem(a))}this.itemsStorageMode=e,r!==this.storage&&this.storage.clear(),this.storage=r,e==t.FixedEncrypted?this.writeEncryptedStorageToDisk():e==t.Fixed&&this.removeItem("encryptedStorage",t.Fixed)}}},{key:"getVault",value:function(e){return e?e==t.Ephemeral||e==t.FixedEncrypted?this.memoryStorage:localStorage:this.storage}},{key:"setItem",value:function(e,n,r){var i;return l.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:i=this.getVault(r);try{i.setItem(e,n)}catch(e){console.error("Exception while trying to setItem in StorageManager:",e),this.alertManager.alert({text:"The application's local storage is out of space. If you have Session History save-to-disk enabled, please disable it, and try again."})}if(r!==t.FixedEncrypted&&(r||this.itemsStorageMode!==t.FixedEncrypted)){o.next=4;break}return o.abrupt("return",this.writeEncryptedStorageToDisk());case 4:case"end":return o.stop()}}),null,this)}},{key:"getItem",value:function(e,t){return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.getItemSync(e,t));case 1:case"end":return n.stop()}}),null,this)}},{key:"getItemSync",value:function(e,t){return this.getVault(t).getItem(e)}},{key:"removeItem",value:function(e,t){var n;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=this.getVault(t),r.abrupt("return",n.removeItem(e));case 2:case"end":return r.stop()}}),null,this)}},{key:"clear",value:function(){return l.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.memoryStorage.clear(),localStorage.clear();case 2:case"end":return e.stop()}}),null,this)}},{key:"storageAsHash",value:function(){for(var e={},t=this.storage.length,n=0;n<t;n++){var r=this.storage.key(n);e[r]=this.storage.getItem(r)}return e}},{key:"setKeys",value:function(e,t){this.encryptedStorageKeys=e,this.encryptedStorageAuthParams=t}},{key:"writeEncryptedStorageToDisk",value:function(){var e,n,r;return l.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return(e=new o.SNEncryptedStorage).content.storage=this.storageAsHash(),n=new o.SFItemParams(e,this.encryptedStorageKeys,this.encryptedStorageAuthParams),i.next=5,l.a.awrap(n.paramsForSync());case 5:r=i.sent,this.setItem("encryptedStorage",JSON.stringify(r),t.Fixed);case 7:case"end":return i.stop()}}),null,this)}},{key:"decryptStorage",value:function(){var e,n,r,i,a;return l.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return e=JSON.parse(this.getItemSync("encryptedStorage",t.Fixed)),s.next=3,l.a.awrap(o.cryptoManager.decryptItem(e,this.encryptedStorageKeys));case 3:for(n=new o.SNEncryptedStorage(e),r=0,i=Object.keys(n.content.storage);r<i.length;r++)a=i[r],this.setItem(a,n.storage[a]);case 5:case"end":return s.stop()}}),null,this)}},{key:"hasPasscode",value:function(){return null!==this.getItemSync("encryptedStorage",t.Fixed)}},{key:"bestStorageMode",value:function(){return this.hasPasscode()?t.FixedEncrypted:t.Fixed}},{key:"setModelStorageMode",value:function(e){e!=this.modelStorageMode&&(e==t.Ephemeral&&this.dbManager.clearAllModels(null),this.modelStorageMode=e)}},{key:"getAllModels",value:function(){var e=this;return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(n,r){e.modelStorageMode==t.Fixed?e.dbManager.getAllModels(n):n()})));case 1:case"end":return n.stop()}}))}},{key:"saveModel",value:function(e){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.saveModels([e]));case 1:case"end":return t.stop()}}),null,this)}},{key:"saveModels",value:function(e,n,r){var i=this;return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(n,r){i.modelStorageMode==t.Fixed?i.dbManager.saveModels(e,n,r):n()})));case 1:case"end":return n.stop()}}))}},{key:"deleteModel",value:function(e){var n=this;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(r,i){n.modelStorageMode==t.Fixed?n.dbManager.deleteModel(e,r):r()})));case 1:case"end":return r.stop()}}))}},{key:"clearAllModels",value:function(){var e=this;return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){e.dbManager.clearAllModels(t)})));case 1:case"end":return t.stop()}}))}},{key:"memoryStorage",get:function(){return this._memoryStorage||(this._memoryStorage=new Xe),this._memoryStorage}}]),t}(o.SFStorageManager);Qe.FixedEncrypted="FixedEncrypted",Qe.Ephemeral="Ephemeral",Qe.Fixed="Fixed";var et=function(e){function t(e,n,r,i,o,a,s,c){var u;return d()(this,t),(u=y()(this,b()(t).call(this,r,o,null,s))).$rootScope=a,u.$compile=c,u.modelManager=e,u.singletonManager=n,u.storageManager=r,u.dbManager=i,u}return t.$inject=["modelManager","singletonManager","storageManager","dbManager","httpManager","$rootScope","$timeout","$compile"],k()(t,e),h()(t,[{key:"loadInitialData",value:function(){var e=this,t=this.storageManager.getItemSync("user");if(t)this.user=JSON.parse(t);else{var n=this.storageManager.getItemSync("uuid");n&&(this.user={uuid:n})}this.configureUserPrefs(),this.checkForSecurityUpdate(),this.modelManager.addItemSyncObserver("user-prefs","SN|UserPreferences",(function(t,n,r,i,o){e.userPreferencesDidChange()}))}},{key:"offline",value:function(){return!this.user}},{key:"isEphemeralSession",value:function(){return null!=this.ephemeral&&null!=this.ephemeral||(this.ephemeral=JSON.parse(this.storageManager.getItemSync("ephemeral",Qe.Fixed))),this.ephemeral}},{key:"setEphemeral",value:function(e){this.ephemeral=e,e?(this.storageManager.setModelStorageMode(Qe.Ephemeral),this.storageManager.setItemsMode(Qe.Ephemeral)):(this.storageManager.setModelStorageMode(Qe.Fixed),this.storageManager.setItemsMode(this.storageManager.bestStorageMode()),this.storageManager.setItem("ephemeral",JSON.stringify(!1),Qe.Fixed))}},{key:"getAuthParamsForEmail",value:function(e,n,r){return l.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Ze()(b()(t.prototype),"getAuthParamsForEmail",this).call(this,e,n,r));case 1:case"end":return i.stop()}}),null,this)}},{key:"login",value:function(e,n,r,i,o,a){var s=this;return l.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",Ze()(b()(t.prototype),"login",this).call(this,e,n,r,o,a).then((function(e){return e.error||(s.setEphemeral(i),s.checkForSecurityUpdate()),e})));case 1:case"end":return c.stop()}}),null,this)}},{key:"register",value:function(e,n,r,i){var o=this;return l.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",Ze()(b()(t.prototype),"register",this).call(this,e,n,r).then((function(e){return e.error||o.setEphemeral(i),e})));case 1:case"end":return a.stop()}}),null,this)}},{key:"changePassword",value:function(e,n,r,i,o){var a=this;return l.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",Ze()(b()(t.prototype),"changePassword",this).call(this,e,n,r,i,o).then((function(e){return e.error||a.checkForSecurityUpdate(),e})));case 1:case"end":return s.stop()}}),null,this)}},{key:"handleAuthResponse",value:function(e,n,r,i,o){return l.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,l.a.awrap(Ze()(b()(t.prototype),"handleAuthResponse",this).call(this,e,n,r,i,o));case 3:this.user=e.user,this.storageManager.setItem("user",JSON.stringify(e.user)),a.next=10;break;case 7:a.prev=7,a.t0=a.catch(0),this.dbManager.displayOfflineAlert();case 10:case"end":return a.stop()}}),null,this,[[0,7]])}},{key:"verifyAccountPassword",value:function(e){var t,n,r;return l.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,l.a.awrap(this.getAuthParams());case 2:return t=i.sent,i.next=5,l.a.awrap(o.cryptoManager.computeEncryptionKeysForUser(e,t));case 5:return n=i.sent,i.t0=n.mk,i.next=9,l.a.awrap(this.keys());case 9:return i.t1=i.sent.mk,r=i.t0===i.t1,i.abrupt("return",r);case 12:case"end":return i.stop()}}),null,this)}},{key:"checkForSecurityUpdate",value:function(){var e,t;return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.offline()){n.next=2;break}return n.abrupt("return",!1);case 2:return e=o.cryptoManager.version(),n.next=5,l.a.awrap(this.protocolVersion());case 5:return n.t0=n.sent,n.t1=e,(t=n.t0!==n.t1)!==this.securityUpdateAvailable&&(this.securityUpdateAvailable=t,this.$rootScope.$broadcast("security-update-status-changed")),n.abrupt("return",this.securityUpdateAvailable);case 10:case"end":return n.stop()}}),null,this)}},{key:"presentPasswordWizard",value:function(e){var t=this.$rootScope.$new(!0);t.type=e;var n=this.$compile("<password-wizard type='type'></password-wizard>")(t);i.a.element(document.body).append(n)}},{key:"signOut",value:function(){Ze()(b()(t.prototype),"signout",this).call(this),this.user=null,this._authParams=null}},{key:"configureUserPrefs",value:function(){var e=this,t=new o.SFPredicate("content_type","=","SN|UserPreferences");this.singletonManager.registerSingleton([t],(function(t){e.userPreferences=t}),(function(t){var n=new o.SFItem({content_type:"SN|UserPreferences"});e.modelManager.addItem(n),e.modelManager.setItemDirty(n,!0),e.$rootScope.sync(),t(n)}))}},{key:"userPreferencesDidChange",value:function(){this.$rootScope.$broadcast("user-preferences-changed")}},{key:"syncUserPreferences",value:function(){this.userPreferences&&(this.modelManager.setItemDirty(this.userPreferences,!0),this.$rootScope.sync())}},{key:"getUserPrefValue",value:function(e,t){if(!this.userPreferences)return t;var n=this.userPreferences.getAppDataItem(e);return void 0!==n&&null!=n?n:t}},{key:"setUserPrefValue",value:function(e,t,n){this.userPreferences?(this.userPreferences.setAppDataItem(e,t),n&&this.syncUserPreferences()):console.log("Prefs are null, not setting value",e)}}]),t}(o.SFAuthManager),tt=function(e){function t(e,n,r,i,c,u,l){var f;return d()(this,t),(f=y()(this,b()(t).call(this,{modelManager:e,syncManager:n,desktopManager:r,nativeExtManager:i,alertManager:new o.SFAlertManager,$uiRunner:c.safeApply,$timeout:u,environment:s()?"desktop":"web",platform:a()}))).$compile=l,f.$rootScope=c,f}return t.$inject=["modelManager","syncManager","desktopManager","nativeExtManager","$rootScope","$timeout","$compile"],k()(t,e),h()(t,[{key:"openModalComponent",value:function(e){var t=this.$rootScope.$new(!0);t.component=e;var n=this.$compile("<component-modal component='component' class='sk-modal'></component-modal>")(t);i.a.element(document.body).append(n)}},{key:"presentPermissionsDialog",value:function(e){var t=this.$rootScope.$new(!0);t.permissionsString=e.permissionsString,t.component=e.component,t.callback=e.callback;var n=this.$compile("<permissions-modal component='component' permissions-string='permissionsString' callback='callback' class='sk-modal'></permissions-modal>")(t);i.a.element(document.body).append(n)}}]),t}(o.SNComponentManager),nt=function(){function e(t){d()(this,e),this.locked=!0,this.alertManager=t}return e.$inject=["alertManager"],h()(e,[{key:"displayOfflineAlert",value:function(){this.alertManager.alert({text:"There was an issue loading your offline database. This could happen for two reasons:\n\n1. You're in a private window in your browser. We can't save your data without access to the local database. Please use a non-private window.\n\n2. You have two windows of the app open at the same time. Please close any other app instances and reload the page."})}},{key:"setLocked",value:function(e){this.locked=e}},{key:"openDatabase",value:function(e,t){if(!this.locked){var n=window.indexedDB.open("standardnotes",1);n.onerror=function(t){t.target.errorCode?this.alertManager.alert({text:"Offline database issue: "+t.target.errorCode}):this.displayOfflineAlert(),console.error("Offline database issue:",t),e&&e(null)}.bind(this),n.onsuccess=function(t){var n=t.target.result;n.onversionchange=function(e){n.close()},n.onerror=function(e){console.log("Database error: "+e.target.errorCode)},e&&e(n)},n.onblocked=function(e){console.error("Request blocked error:",e.target.errorCode)},n.onupgradeneeded=function(e){var n=e.target.result;n.onversionchange=function(e){n.close()};var r=n.createObjectStore("items",{keyPath:"uuid"});r.createIndex("title","title",{unique:!1}),r.createIndex("uuid","uuid",{unique:!0}),r.transaction.oncomplete=function(e){1===n.version&&t&&t()}}}}},{key:"getAllModels",value:function(e){this.openDatabase((function(t){var n=t.transaction("items").objectStore("items"),r=[];n.openCursor().onsuccess=function(t){var n=t.target.result;n?(r.push(n.value),n.continue()):e(r)}}),null)}},{key:"saveModel",value:function(e){this.saveModels([e])}},{key:"saveModels",value:function(e,t,n){0!=e.length?this.openDatabase((function(r){var i=r.transaction("items","readwrite");i.oncomplete=function(e){},i.onerror=function(e){console.error("Transaction error:",e.target.errorCode)},i.onblocked=function(e){console.error("Transaction blocked error:",e.target.errorCode)},i.onabort=function(e){console.log("Offline saving aborted:",e);var t=e.target.error;"QuotaExceededError"==t.name?this.alertManager.alert({text:"Unable to save changes locally because your device is out of space. Please free up some disk space and try again, otherwise, your data may end up in an inconsistent state."}):this.alertManager.alert({text:"Unable to save changes locally due to an unknown system issue. Issue Code: ".concat(t.code," Issue Name: ").concat(t.name,".")}),n&&n(t)};var o=i.objectStore("items"),a=0;!function n(){if(a<e.length){var r=e[a],i=o.put(r);i.onerror=function(e){console.error("DB put error:",e.target.error)},i.onsuccess=n,++a}else t&&t()}()}),null):t&&t()}},{key:"deleteModel",value:function(e,t){this.openDatabase((function(n){n.transaction("items","readwrite").objectStore("items").delete(e.uuid).onsuccess=function(e){t&&t(!0)}}),null)}},{key:"clearAllModels",value:function(e){var t=window.indexedDB.deleteDatabase("standardnotes");t.onerror=function(t){console.log("Error deleting database."),e&&e()},t.onsuccess=function(t){console.log("Database deleted successfully"),e&&e()},t.onblocked=function(e){console.error("Delete request blocked"),this.alertManager.alert({text:"Your browser is blocking Standard Notes from deleting the local database. Make sure there are no other open windows of this app and try again. If the issue persists, please manually delete app data to sign out."})}}}]),e}(),rt=function(){function e(t,n,r,i,o,a){var c=this;d()(this,e),this.passcodeManager=a,this.modelManager=r,this.authManager=o,this.syncManager=i,this.$rootScope=t,this.timeout=n,this.updateObservers=[],this.componentActivationObservers=[],this.isDesktop=s(),t.$on("initial-data-loaded",(function(){c.dataLoaded=!0,c.dataLoadHandler&&c.dataLoadHandler()})),t.$on("major-data-change",(function(){c.majorDataChangeHandler&&c.majorDataChangeHandler()}))}return e.$inject=["$rootScope","$timeout","modelManager","syncManager","authManager","passcodeManager"],h()(e,[{key:"saveBackup",value:function(){this.majorDataChangeHandler&&this.majorDataChangeHandler()}},{key:"getExtServerHost",value:function(){return console.assert(this.extServerHost,"extServerHost is null"),this.extServerHost}},{key:"convertComponentForTransmission",value:function(e){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new o.SFItemParams(e).paramsForExportFile(!0));case 1:case"end":return t.stop()}}))}},{key:"syncComponentsInstallation",value:function(e){var t=this;this.isDesktop&&Promise.all(e.map((function(e){return t.convertComponentForTransmission(e)}))).then((function(e){t.installationSyncHandler(e)}))}},{key:"installComponent",value:function(e){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=this,t.next=3,l.a.awrap(this.convertComponentForTransmission(e));case 3:t.t1=t.sent,t.t0.installComponentHandler.call(t.t0,t.t1);case 5:case"end":return t.stop()}}),null,this)}},{key:"registerUpdateObserver",value:function(e){var t={id:Math.random,callback:e};return this.updateObservers.push(t),t}},{key:"searchText",value:function(e){this.isDesktop&&(this.lastSearchedText=e,this.searchHandler&&this.searchHandler(e))}},{key:"redoSearch",value:function(){this.lastSearchedText&&this.searchText(this.lastSearchedText)}},{key:"deregisterUpdateObserver",value:function(e){E.a.pull(this.updateObservers,e)}},{key:"desktop_setSearchHandler",value:function(e){this.searchHandler=e}},{key:"desktop_windowGainedFocus",value:function(){this.$rootScope.$broadcast("window-gained-focus")}},{key:"desktop_windowLostFocus",value:function(){this.$rootScope.$broadcast("window-lost-focus")}},{key:"desktop_onComponentInstallationComplete",value:function(e,t){var n=this,r=this.modelManager.findItem(e.uuid);if(r){if(t)r.setAppDataItem("installError",t);else{var i=!0,a=!1,s=void 0;try{for(var c,u=["package_info","local_url"][Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var l=c.value;r[l]=e.content[l]}}catch(e){a=!0,s=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}this.modelManager.notifySyncObserversOfModels([r],o.SFModelManager.MappingSourceDesktopInstalled),r.setAppDataItem("installError",null)}this.modelManager.setItemDirty(r,!0),this.syncManager.sync(),this.timeout((function(){var e=!0,t=!1,i=void 0;try{for(var o,a=n.updateObservers[Symbol.iterator]();!(e=(o=a.next()).done);e=!0){o.value.callback(r)}}catch(e){t=!0,i=e}finally{try{e||null==a.return||a.return()}finally{if(t)throw i}}}))}else console.error("desktop_onComponentInstallationComplete component is null for uuid",e.uuid)}},{key:"desktop_registerComponentActivationObserver",value:function(e){var t={id:Math.random,callback:e};return this.componentActivationObservers.push(t),t}},{key:"desktop_deregisterComponentActivationObserver",value:function(e){E.a.pull(this.componentActivationObservers,e)}},{key:"notifyComponentActivation",value:function(e){var t,n=this;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.a.awrap(this.convertComponentForTransmission(e));case 2:t=r.sent,this.timeout((function(){var e=!0,r=!1,i=void 0;try{for(var o,a=n.componentActivationObservers[Symbol.iterator]();!(e=(o=a.next()).done);e=!0){o.value.callback(t)}}catch(e){r=!0,i=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw i}}}));case 4:case"end":return r.stop()}}),null,this)}},{key:"desktop_setExtServerHost",value:function(e){this.extServerHost=e,this.$rootScope.$broadcast("desktop-did-set-ext-server-host")}},{key:"desktop_setComponentInstallationSyncHandler",value:function(e){this.installationSyncHandler=e}},{key:"desktop_setInstallComponentHandler",value:function(e){this.installComponentHandler=e}},{key:"desktop_setInitialDataLoadHandler",value:function(e){this.dataLoadHandler=e,this.dataLoaded&&this.dataLoadHandler()}},{key:"desktop_requestBackupFile",value:function(e){var t,n;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.authManager.offline()||!this.passcodeManager.hasPasscode()){r.next=5;break}t=this.passcodeManager.keys(),n=this.passcodeManager.passcodeAuthParams(),r.next=11;break;case 5:return r.next=7,l.a.awrap(this.authManager.keys());case 7:return t=r.sent,r.next=10,l.a.awrap(this.authManager.getAuthParams());case 10:n=r.sent;case 11:this.modelManager.getAllItemsJSONData(t,n,!0).then((function(t){e(t)}));case 12:case"end":return r.stop()}}),null,this)}},{key:"desktop_setMajorDataChangeHandler",value:function(e){this.majorDataChangeHandler=e}},{key:"desktop_didBeginBackup",value:function(){this.$rootScope.$broadcast("did-begin-local-backup")}},{key:"desktop_didFinishBackup",value:function(e){this.$rootScope.$broadcast("did-finish-local-backup",{success:e})}}]),e}(),it=function(e){function t(e,n){var r;return d()(this,t),(r=y()(this,b()(t).call(this,n))).setJWTRequestHandler((function(){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getItem("jwt"));case 1:case"end":return t.stop()}}))})),r}return t.$inject=["storageManager","$timeout"],k()(t,e),t}(o.SFHttpManager),ot=function(e){function t(e,n,r,i,o,a,s){var c;return d()(this,t),(c=y()(this,b()(t).call(this,e,n,i,a))).componentManager=r,c.statusManager=o,c.desktopManager=s,c}return t.$inject=["modelManager","syncManager","componentManager","storageManager","statusManager","authManager","desktopManager"],k()(t,e),h()(t,[{key:"registeredMigrations",value:function(){return[this.editorToComponentMigration(),this.componentUrlToHostedUrl(),this.removeTagReferencesFromNotes()]}},{key:"editorToComponentMigration",value:function(){var e=this;return{name:"editor-to-component",content_type:"SN|Editor",handler:function(t){var n,r,i,o,a,s,c,u,f,d,p,h,v;return l.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:for(n=!0,r=!1,i=void 0,l.prev=3,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0)(s=a.value).url&&!e.componentManager.componentForUrl(s.url)&&((c=e.modelManager.createItem({content_type:"SN|Component",content:{url:s.url,name:s.name,area:"editor-editor"}})).setAppDataItem("data",s.data),e.modelManager.addItem(c),e.modelManager.setItemDirty(c,!0));l.next=11;break;case 7:l.prev=7,l.t0=l.catch(3),r=!0,i=l.t0;case 11:l.prev=11,l.prev=12,n||null==o.return||o.return();case 14:if(l.prev=14,!r){l.next=17;break}throw i;case 17:return l.finish(14);case 18:return l.finish(11);case 19:for(u=!0,f=!1,d=void 0,l.prev=22,p=t[Symbol.iterator]();!(u=(h=p.next()).done);u=!0)v=h.value,e.modelManager.setItemToBeDeleted(v);l.next=30;break;case 26:l.prev=26,l.t1=l.catch(22),f=!0,d=l.t1;case 30:l.prev=30,l.prev=31,u||null==p.return||p.return();case 33:if(l.prev=33,!f){l.next=36;break}throw d;case 36:return l.finish(33);case 37:return l.finish(30);case 38:e.syncManager.sync();case 39:case"end":return l.stop()}}),null,null,[[3,7,11,19],[12,,14,18],[22,26,30,38],[31,,33,37]])}}}},{key:"componentUrlToHostedUrl",value:function(){var e=this;return{name:"component-url-to-hosted-url",content_type:"SN|Component",handler:function(t){var n,r,i,o,a,s,c,u,f,d,p,h,v,m,y;return l.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:n=!1,r=e.modelManager.validItemsForContentType("Note"),i=!0,o=!1,a=void 0,l.prev=5,s=r[Symbol.iterator]();case 7:if(i=(c=s.next()).done){l.next=31;break}for(u=c.value,f=!0,d=!1,p=void 0,l.prev=12,h=t[Symbol.iterator]();!(f=(v=h.next()).done);f=!0)m=v.value,(y=u.getDomainDataItem(m.hosted_url,tt.ClientDataDomain))&&(u.setDomainDataItem(m.uuid,y,tt.ClientDataDomain),u.setDomainDataItem(m.hosted_url,null,tt.ClientDataDomain),e.modelManager.setItemDirty(u,!0),n=!0);l.next=20;break;case 16:l.prev=16,l.t0=l.catch(12),d=!0,p=l.t0;case 20:l.prev=20,l.prev=21,f||null==h.return||h.return();case 23:if(l.prev=23,!d){l.next=26;break}throw p;case 26:return l.finish(23);case 27:return l.finish(20);case 28:i=!0,l.next=7;break;case 31:l.next=37;break;case 33:l.prev=33,l.t1=l.catch(5),o=!0,a=l.t1;case 37:l.prev=37,l.prev=38,i||null==s.return||s.return();case 40:if(l.prev=40,!o){l.next=43;break}throw a;case 43:return l.finish(40);case 44:return l.finish(37);case 45:n&&e.syncManager.sync();case 46:case"end":return l.stop()}}),null,null,[[5,33,37,45],[12,16,20,28],[21,,23,27],[38,,40,44]])}}}},{key:"removeTagReferencesFromNotes",value:function(){var e=this;return{name:"remove-tag-references-from-notes",content_type:"Note",handler:function(t){var n,r,i,o,a,c,u,f,d,p,h,v,m,y,g,b,w;return l.a.async((function(k){for(;;)switch(k.prev=k.next){case 0:!1,n=e.statusManager.addStatusFromString("Optimizing data..."),r=0,i=!0,o=!1,a=void 0,k.prev=6,c=t[Symbol.iterator]();case 8:if(i=(u=c.next()).done){k.next=47;break}if((f=u.value).content){k.next=12;break}return k.abrupt("continue",44);case 12:d=f.content.references,p=[],h=!0,v=!1,m=void 0,k.prev=17,y=d[Symbol.iterator]();case 19:if(h=(g=y.next()).done){k.next=29;break}if("Tag"==(b=g.value).content_type){k.next=24;break}return p.push(b),k.abrupt("continue",26);case 24:(w=e.modelManager.findItem(b.uuid))&&!w.hasRelationshipWithItem(f)&&(w.addItemAsRelationship(f),e.modelManager.setItemDirty(w,!0),r++);case 26:h=!0,k.next=19;break;case 29:k.next=35;break;case 31:k.prev=31,k.t0=k.catch(17),v=!0,m=k.t0;case 35:k.prev=35,k.prev=36,h||null==y.return||y.return();case 38:if(k.prev=38,!v){k.next=41;break}throw m;case 41:return k.finish(38);case 42:return k.finish(35);case 43:p.length!=d.length&&(f.content.references=p,e.modelManager.setItemDirty(f,!0),r++);case 44:i=!0,k.next=8;break;case 47:k.next=53;break;case 49:k.prev=49,k.t1=k.catch(6),o=!0,a=k.t1;case 53:k.prev=53,k.prev=54,i||null==c.return||c.return();case 56:if(k.prev=56,!o){k.next=59;break}throw a;case 59:return k.finish(56);case 60:return k.finish(53);case 61:if(!(r>0)){k.next=70;break}return s()&&e.desktopManager.saveBackup(),n=e.statusManager.replaceStatusWithString(n,"".concat(r," items optimized.")),k.next=66,l.a.awrap(e.syncManager.sync());case 66:n=e.statusManager.replaceStatusWithString(n,"Optimization complete."),setTimeout((function(){e.statusManager.removeStatus(n)}),2e3),k.next=71;break;case 70:e.statusManager.removeStatus(n);case 71:case"end":return k.stop()}}),null,null,[[6,49,53,61],[17,31,35,43],[36,,38,42],[54,,56,60]])}}}}]),t}(o.SFMigrationManager);o.SFModelManager.ContentTypeClassMapping={Note:o.SNNote,Tag:o.SNTag,"SN|SmartTag":o.SNSmartTag,Extension:o.SNExtension,"SN|Editor":o.SNEditor,"SN|Theme":o.SNTheme,"SN|Component":o.SNComponent,"SF|Extension":o.SNServerExtension,"SF|MFA":o.SNMfa,"SN|Privileges":o.SFPrivileges};var at=function(e){function t(e,n){var r;return d()(this,t),(r=y()(this,b()(t).call(this,n))).notes=[],r.tags=[],r.components=[],r.storageManager=e,r.buildSystemSmartTags(),r}return t.$inject=["storageManager","$timeout"],k()(t,e),h()(t,[{key:"handleSignout",value:function(){Ze()(b()(t.prototype),"handleSignout",this).call(this),this.notes.length=0,this.tags.length=0,this.components.length=0}},{key:"noteCount",value:function(){return this.notes.filter((function(e){return!e.dummy})).length}},{key:"removeAllItemsFromMemory",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.items[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){r.value.deleted=!0}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}this.notifySyncObserversOfModels(this.items),this.handleSignout()}},{key:"findOrCreateTagByTitle",value:function(e){var t=E.a.find(this.tags,{title:e});return t||(t=this.createItem({content_type:"Tag",content:{title:e}}),this.addItem(t),this.setItemDirty(t,!0)),t}},{key:"addItems",value:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Ze()(b()(t.prototype),"addItems",this).call(this,e,r),e.forEach((function(e){r||("Tag"==e.content_type?E.a.find(n.tags,{uuid:e.uuid})||n.tags.splice(E.a.sortedIndexBy(n.tags,e,(function(e){return e.title?e.title.toLowerCase():""})),0,e):"Note"==e.content_type?E.a.find(n.notes,{uuid:e.uuid})||n.notes.unshift(e):"SN|Component"==e.content_type&&(E.a.find(n.components,{uuid:e.uuid})||n.components.unshift(e)))}))}},{key:"resortTag",value:function(e){E.a.pull(this.tags,e),this.tags.splice(E.a.sortedIndexBy(this.tags,e,(function(e){return e.title?e.title.toLowerCase():""})),0,e)}},{key:"setItemToBeDeleted",value:function(e){Ze()(b()(t.prototype),"setItemToBeDeleted",this).call(this,e),this.removeItemFromRespectiveArray(e)}},{key:"removeItemLocally",value:function(e,n){Ze()(b()(t.prototype),"removeItemLocally",this).call(this,e,n),this.removeItemFromRespectiveArray(e),this.storageManager.deleteModel(e).then(n)}},{key:"removeItemFromRespectiveArray",value:function(e){"Tag"==e.content_type?E.a.remove(this.tags,{uuid:e.uuid}):"Note"==e.content_type?E.a.remove(this.notes,{uuid:e.uuid}):"SN|Component"==e.content_type&&E.a.remove(this.components,{uuid:e.uuid})}},{key:"notesMatchingSmartTag",value:function(e){var t=[new o.SFPredicate("content_type","=","Note"),e.content.predicate];if(!e.content.isTrashTag){var n=new o.SFPredicate("content.trashed","=",!1);t.push(n)}return this.itemsMatchingPredicates(t)}},{key:"trashSmartTag",value:function(){return this.systemSmartTags.find((function(e){return e.content.isTrashTag}))}},{key:"trashedItems",value:function(){return this.notesMatchingSmartTag(this.trashSmartTag())}},{key:"emptyTrash",value:function(){var e=this.trashedItems(),t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;this.setItemToBeDeleted(a)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"buildSystemSmartTags",value:function(){this.systemSmartTags=o.SNSmartTag.systemSmartTags()}},{key:"getSmartTagWithId",value:function(e){return this.getSmartTags().find((function(t){return t.uuid==e}))}},{key:"getSmartTags",value:function(){var e=this.validItemsForContentType("SN|SmartTag").sort((function(e,t){return e.content.title<t.content.title?-1:1}));return this.systemSmartTags.concat(e)}},{key:"humanReadableDisplayForContentType",value:function(e){return{Note:"note",Tag:"tag","SN|SmartTag":"smart tag",Extension:"action-based extension","SN|Component":"component","SN|Editor":"editor","SN|Theme":"theme","SF|Extension":"server extension","SF|MFA":"two-factor authentication setting","SN|FileSafe|Credentials":"FileSafe credential","SN|FileSafe|FileMetadata":"FileSafe file","SN|FileSafe|Integration":"FileSafe integration"}[e]}}]),t}(o.SFModelManager),st=function(){function e(t,n,r){d()(this,e),this.modelManager=t,this.syncManager=n,this.singletonManager=r,this.extensionsManagerIdentifier="org.standardnotes.extensions-manager",this.batchManagerIdentifier="org.standardnotes.batch-manager",this.systemExtensions=[],this.resolveExtensionsManager(),this.resolveBatchManager()}return e.$inject=["modelManager","syncManager","singletonManager"],h()(e,[{key:"isSystemExtension",value:function(e){return this.systemExtensions.includes(e.uuid)}},{key:"resolveExtensionsManager",value:function(){var e=this,t=new o.SFPredicate("content_type","=","SN|Component"),n=new o.SFPredicate("package_info.identifier","=",this.extensionsManagerIdentifier);this.singletonManager.registerSingleton([t,n],(function(t){e.systemExtensions.push(t.uuid);var n=!1;s()?t.local_url||(t.local_url=window._extensions_manager_location,n=!0):t.hosted_url||(t.hosted_url=window._extensions_manager_location,n=!0);var r=t.content.permissions.find((function(e){return"stream-items"==e.name}));r.content_types.includes("SN|ExtensionRepo")||(r.content_types.push("SN|ExtensionRepo"),n=!0),n&&(e.modelManager.setItemDirty(t,!0),e.syncManager.sync())}),(function(t){if(window._extensions_manager_location){var n={name:"Extensions",identifier:e.extensionsManagerIdentifier},r={content_type:"SN|Component",content:{name:n.name,area:"rooms",package_info:n,permissions:[{name:"stream-items",content_types:["SN|Component","SN|Theme","SF|Extension","Extension","SF|MFA","SN|Editor","SN|ExtensionRepo"]}]}};s()?r.content.local_url=window._extensions_manager_location:r.content.hosted_url=window._extensions_manager_location;var i=e.modelManager.createItem(r);e.modelManager.addItem(i),e.modelManager.setItemDirty(i,!0),e.syncManager.sync(),e.systemExtensions.push(i.uuid),t(i)}else console.error("window._extensions_manager_location must be set.")}))}},{key:"resolveBatchManager",value:function(){var e=this,t=new o.SFPredicate("content_type","=","SN|Component"),n=new o.SFPredicate("package_info.identifier","=",this.batchManagerIdentifier);this.singletonManager.registerSingleton([t,n],(function(t){e.systemExtensions.push(t.uuid);var n=!1;s()?t.local_url||(t.local_url=window._batch_manager_location,n=!0):t.hosted_url||(t.hosted_url=window._batch_manager_location,n=!0),n&&(e.modelManager.setItemDirty(t,!0),e.syncManager.sync())}),(function(t){if(window._batch_manager_location){var n={name:"Batch Manager",identifier:e.batchManagerIdentifier},r={content_type:"SN|Component",content:{name:n.name,area:"modal",package_info:n,permissions:[{name:"stream-items",content_types:["Note","Tag","SN|SmartTag","SN|Component","SN|Theme","SN|UserPreferences","SF|Extension","Extension","SF|MFA","SN|Editor","SN|FileSafe|Credentials","SN|FileSafe|FileMetadata","SN|FileSafe|Integration"]}]}};s()?r.content.local_url=window._batch_manager_location:r.content.hosted_url=window._batch_manager_location;var i=e.modelManager.createItem(r);e.modelManager.addItem(i),e.modelManager.setItemDirty(i,!0),e.syncManager.sync(),e.systemExtensions.push(i.uuid),t(i)}else console.error("window._batch_manager_location must be set.")}))}}]),e}(),ct=function(){function e(t,n,r,i){d()(this,e),this.authManager=n,this.storageManager=r,this.syncManager=i,this.$rootScope=t,this._hasPasscode=null!=this.storageManager.getItemSync("offlineParams",Qe.Fixed),this._locked=this._hasPasscode,this.visibilityObservers=[],this.passcodeChangeObservers=[],this.configureAutoLock()}return e.$inject=["$rootScope","authManager","storageManager","syncManager"],h()(e,[{key:"addPasscodeChangeObserver",value:function(e){this.passcodeChangeObservers.push(e)}},{key:"lockApplication",value:function(){window.location.reload(),this.cancelAutoLockTimer()}},{key:"isLocked",value:function(){return this._locked}},{key:"hasPasscode",value:function(){return this._hasPasscode}},{key:"keys",value:function(){return this._keys}},{key:"addVisibilityObserver",value:function(e){return this.visibilityObservers.push(e),e}},{key:"removeVisibilityObserver",value:function(e){E.a.pull(this.visibilityObservers,e)}},{key:"notifiyVisibilityObservers",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this.visibilityObservers[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){(0,i.value)(e)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"setAutoLockInterval",value:function(t){return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.storageManager.setItem(e.AutoLockIntervalKey,JSON.stringify(t),Qe.FixedEncrypted));case 1:case"end":return n.stop()}}),null,this)}},{key:"getAutoLockInterval",value:function(){var t;return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l.a.awrap(this.storageManager.getItem(e.AutoLockIntervalKey,Qe.FixedEncrypted));case 2:if(!(t=n.sent)){n.next=7;break}return n.abrupt("return",JSON.parse(t));case 7:return n.abrupt("return",e.AutoLockIntervalNone);case 8:case"end":return n.stop()}}),null,this)}},{key:"passcodeAuthParams",value:function(){var e=JSON.parse(this.storageManager.getItemSync("offlineParams",Qe.Fixed));if(e&&!e.version){var t=this.keys();t&&t.ak?e.version="002":e.version="001"}return e}},{key:"verifyPasscode",value:function(e){var t=this;return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(n,r){var i;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return i=t.passcodeAuthParams(),r.next=3,l.a.awrap(o.cryptoManager.computeEncryptionKeysForUser(e,i));case 3:r.sent.pw!==i.hash?n(!1):n(!0);case 5:case"end":return r.stop()}}))})));case 1:case"end":return n.stop()}}))}},{key:"unlock",value:function(e,t){var n=this,r=this.passcodeAuthParams();o.cryptoManager.computeEncryptionKeysForUser(e,r).then((function(e){e.pw===r.hash?(n._keys=e,n._authParams=r,n.decryptLocalStorage(e,r).then((function(){n._locked=!1,t(!0)}))):t(!1)}))}},{key:"setPasscode",value:function(e,t){var n=this,r=o.cryptoManager.crypto.generateUUIDSync();o.cryptoManager.generateInitialKeysAndAuthParamsForUser(r,e).then((function(e){var r=e.keys,i=e.authParams;i.hash=r.pw,n._keys=r,n._hasPasscode=!0,n._authParams=i,n.encryptLocalStorage(r,i),n.storageManager.setItem("offlineParams",JSON.stringify(i),Qe.Fixed),t(!0),n.notifyObserversOfPasscodeChange()}))}},{key:"changePasscode",value:function(e,t){this.setPasscode(e,t)}},{key:"clearPasscode",value:function(){this.storageManager.setItemsMode(this.authManager.isEphemeralSession()?Qe.Ephemeral:Qe.Fixed),this.storageManager.removeItem("offlineParams",Qe.Fixed),this._keys=null,this._hasPasscode=!1,this.notifyObserversOfPasscodeChange()}},{key:"notifyObserversOfPasscodeChange",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.passcodeChangeObservers[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){(0,r.value)()}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}},{key:"encryptLocalStorage",value:function(e,t){this.storageManager.setKeys(e,t),this.storageManager.setItemsMode(this.authManager.isEphemeralSession()?Qe.Ephemeral:Qe.FixedEncrypted,!0)}},{key:"decryptLocalStorage",value:function(e,t){return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return this.storageManager.setKeys(e,t),n.abrupt("return",this.storageManager.decryptStorage());case 2:case"end":return n.stop()}}),null,this)}},{key:"configureAutoLock",value:function(){var t=this;e.AutoLockPollFocusInterval=1e3,e.AutoLockIntervalNone=0,e.AutoLockIntervalImmediate=1,e.AutoLockIntervalOneMinute=6e4,e.AutoLockIntervalFiveMinutes=3e5,e.AutoLockIntervalOneHour=36e5,e.AutoLockIntervalKey="AutoLockIntervalKey",s()?(this.$rootScope.$on("window-lost-focus",(function(){t.documentVisibilityChanged(!1)})),this.$rootScope.$on("window-gained-focus",(function(){t.documentVisibilityChanged(!0)}))):(document.addEventListener("visibilitychange",(function(e){var n="visible"==document.visibilityState;t.documentVisibilityChanged(n)})),this.pollFocusTimeout=setInterval((function(){var e=document.hasFocus();e&&"hidden"==t.lastFocusState?t.documentVisibilityChanged(!0):e||"visible"!=t.lastFocusState||t.documentVisibilityChanged(!1),t.lastFocusState=e?"visible":"hidden"}),e.AutoLockPollFocusInterval))}},{key:"getAutoLockIntervalOptions",value:function(){return[{value:e.AutoLockIntervalNone,label:"Off"},{value:e.AutoLockIntervalImmediate,label:"Immediately"},{value:e.AutoLockIntervalOneMinute,label:"1m"},{value:e.AutoLockIntervalFiveMinutes,label:"5m"},{value:e.AutoLockIntervalOneHour,label:"1h"}]}},{key:"documentVisibilityChanged",value:function(e){e?(this.lockAfterDate&&new Date>this.lockAfterDate&&!this.isLocked()?this.lockApplication():this.isLocked()||this.syncManager.sync(),this.cancelAutoLockTimer()):this.beginAutoLockTimer(),this.notifiyVisibilityObservers(e)}},{key:"beginAutoLockTimer",value:function(){var t,n,r=this;return l.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,l.a.awrap(this.getAutoLockInterval());case 2:if((t=i.sent)!=e.AutoLockIntervalNone){i.next=5;break}return i.abrupt("return");case 5:n=function(e){var t=new Date;return t.setSeconds(t.getSeconds()+e),t},this.lockAfterDate=n(t/1e3),this.lockTimeout=setTimeout((function(){r.lockApplication(),r.lockAfterDate=null}),t);case 8:case"end":return i.stop()}}),null,this)}},{key:"cancelAutoLockTimer",value:function(){clearTimeout(this.lockTimeout),this.lockAfterDate=null}}]),e}(),ut=function(e){function t(){return d()(this,t),y()(this,b()(t).apply(this,arguments))}return k()(t,e),h()(t,[{key:"previewTitle",value:function(){return this.item.updated_at.toLocaleString()}},{key:"previewSubTitle",value:function(){return this.hasPreviousEntry?this.textCharDiffLength<0?"".concat(-1*this.textCharDiffLength," characters removed"):this.textCharDiffLength>0?"".concat(this.textCharDiffLength," characters added"):"Title or metadata changed":"".concat(this.textCharDiffLength," characters loaded")}}]),t}(o.SFItemHistoryEntry),lt=function(e){function t(e,n,r,i,a){var s;d()(this,t),o.SFItemHistory.HistoryEntryClassMapping={Note:ut},i.addPasscodeChangeObserver((function(){s.saveToDisk()}));return s=y()(this,b()(t).call(this,e,n,(function(){var e,t,n;return l.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(!(e=r.offline())){o.next=5;break}o.t0=i.passcodeAuthParams(),o.next=8;break;case 5:return o.next=7,l.a.awrap(r.getAuthParams());case 7:o.t0=o.sent;case 8:if(t=o.t0,!e){o.next=13;break}o.t1=i.keys(),o.next=16;break;case 13:return o.next=15,l.a.awrap(r.keys());case 15:o.t1=o.sent;case 16:return n=o.t1,o.abrupt("return",{keys:n,offline:e,auth_params:t});case 18:case"end":return o.stop()}}))}),["Note"],a))}return t.$inject=["modelManager","storageManager","authManager","passcodeManager","$timeout"],k()(t,e),t}(o.SFSessionHistoryManager),ft=function(e){function t(e,n){return d()(this,t),y()(this,b()(t).call(this,e,n))}return t.$inject=["modelManager","syncManager"],k()(t,e),t}(o.SFSingletonManager),dt=n(11),pt=n.n(dt),ht=function(){function e(){d()(this,e),this.statuses=[],this.observers=[]}return h()(e,[{key:"statusFromString",value:function(e){return{string:e}}},{key:"replaceStatusWithString",value:function(e,t){return this.removeStatus(e),this.addStatusFromString(t)}},{key:"addStatusFromString",value:function(e){return this.addStatus(this.statusFromString(e))}},{key:"addStatus",value:function(e){if("object"===pt()(e))return this.statuses.push(e),this.notifyObservers(),e;console.error("Attempting to set non-object status",e)}},{key:"removeStatus",value:function(e){return E.a.pull(this.statuses,e),this.notifyObservers(),null}},{key:"getStatusString",value:function(){var e="";return this.statuses.forEach((function(t,n){n>0&&(e+=" "),e+=t.string})),e}},{key:"notifyObservers",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.observers[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){(0,r.value)(this.getStatusString())}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}},{key:"addStatusObserver",value:function(e){this.observers.push(e)}},{key:"removeStatusObserver",value:function(e){E.a.pull(this.statuses,e)}}]),e}(),vt=function(e){function t(e,n,r,i,o,a,s){var c;return d()(this,t),(c=y()(this,b()(t).call(this,e,n,r,i,o))).$rootScope=s,c.$compile=a,c.contentTypeLoadPriority=["SN|UserPreferences","SN|Privileges","SN|Component","SN|Theme"],c}return t.$inject=["modelManager","storageManager","httpManager","$timeout","$interval","$compile","$rootScope"],k()(t,e),h()(t,[{key:"presentConflictResolutionModal",value:function(e,t){var n=this.$rootScope.$new(!0);n.item1=e[0],n.item2=e[1],n.callback=t;var r=this.$compile("<conflict-resolution-modal item1='item1' item2='item2' callback='callback' class='sk-modal'></conflict-resolution-modal>")(n);i.a.element(document.body).append(r)}}]),t}(o.SFSyncManager),mt=function(){function e(t,n,r,i,o){var a=this;d()(this,e),this.componentManager=t,this.storageManager=r,this.desktopManager=n,this.activeThemes=[],e.CachedThemesKey="cachedThemes",this.registerObservers(),i.addPasscodeChangeObserver((function(){a.cacheThemes()})),n.isDesktop?o.$on("desktop-did-set-ext-server-host",(function(){a.activateCachedThemes()})):this.activateCachedThemes()}return e.$inject=["componentManager","desktopManager","storageManager","passcodeManager","$rootScope"],h()(e,[{key:"activateCachedThemes",value:function(){var e=this.getCachedThemes(),t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;this.activateTheme(a,!1)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"registerObservers",value:function(){var e=this;this.desktopManager.registerUpdateObserver((function(t){t.active&&t.isTheme()&&(e.deactivateTheme(t),setTimeout((function(){e.activateTheme(t)}),10))})),this.componentManager.registerHandler({identifier:"themeManager",areas:["themes"],activationHandler:function(t){t.active?e.activateTheme(t):e.deactivateTheme(t)}})}},{key:"hasActiveTheme",value:function(){return this.componentManager.getActiveThemes().length>0}},{key:"deactivateAllThemes",value:function(){var e=this.componentManager.getActiveThemes(),t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;a&&this.componentManager.deactivateComponent(a)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this.decacheThemes()}},{key:"activateTheme",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!E.a.find(this.activeThemes,{uuid:e.uuid})){this.activeThemes.push(e);var n=this.componentManager.urlForComponent(e),r=document.createElement("link");r.href=n,r.type="text/css",r.rel="stylesheet",r.media="screen,print",r.id=e.uuid,document.getElementsByTagName("head")[0].appendChild(r),t&&this.cacheThemes()}}},{key:"deactivateTheme",value:function(e){var t=document.getElementById(e.uuid);t&&(t.disabled=!0,t.parentNode.removeChild(t)),E.a.remove(this.activeThemes,{uuid:e.uuid}),this.cacheThemes()}},{key:"cacheThemes",value:function(){var t,n;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.a.awrap(Promise.all(this.activeThemes.map((function(e){var t,n;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=new o.SFItemParams(e),r.next=3,l.a.awrap(t.paramsForLocalStorage());case 3:return n=r.sent,r.abrupt("return",n);case 5:case"end":return r.stop()}}))}))));case 2:return t=r.sent,n=JSON.stringify(t),r.abrupt("return",this.storageManager.setItem(e.CachedThemesKey,n,Qe.Fixed));case 5:case"end":return r.stop()}}),null,this)}},{key:"decacheThemes",value:function(){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.storageManager.removeItem(e.CachedThemesKey,Qe.Fixed));case 1:case"end":return t.stop()}}),null,this)}},{key:"getCachedThemes",value:function(){var t=this.storageManager.getItemSync(e.CachedThemesKey,Qe.Fixed);return t?JSON.parse(t).map((function(e){return new o.SNTheme(e)})):[]}}]),e}(),yt=n(12),gt=function(e){function t(e){var n;return d()(this,t),(n=y()(this,b()(t).call(this))).$timeout=e,n}return t.$inject=["$timeout"],k()(t,e),h()(t,[{key:"alert",value:function(){var e,t,n,r,i,o,a=this,s=arguments;return l.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return e=s.length>0&&void 0!==s[0]?s[0]:{},t=e.title,n=e.text,r=e.closeButtonText,i=void 0===r?"OK":r,o=e.onClose,c.abrupt("return",new Promise((function(e,r){var s=[{text:i,style:"neutral",action:function(){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:o&&a.$timeout(o),e(!0);case 2:case"end":return t.stop()}}))}}];new yt.SKAlert({title:t,text:n,buttons:s}).present()})));case 2:case"end":return c.stop()}}))}},{key:"confirm",value:function(){var e,t,n,r,i,o,a,s,c,u,f,d=this,p=arguments;return l.a.async((function(h){for(;;)switch(h.prev=h.next){case 0:return e=p.length>0&&void 0!==p[0]?p[0]:{},t=e.title,n=e.text,r=e.confirmButtonText,i=void 0===r?"Confirm":r,o=e.cancelButtonText,a=void 0===o?"Cancel":o,s=e.onConfirm,c=e.onCancel,u=e.destructive,f=void 0!==u&&u,h.abrupt("return",new Promise((function(e,r){var o=[{text:a,style:"neutral",action:function(){return l.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:c&&d.$timeout(c),r(!1);case 2:case"end":return e.stop()}}))}},{text:i,style:f?"danger":"info",action:function(){return l.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:s&&d.$timeout(s),e(!0);case 2:case"end":return t.stop()}}))}}];new yt.SKAlert({title:t,text:n,buttons:o}).present()})));case 2:case"end":return h.stop()}}))}}]),t}(o.SFAlertManager);i.a.module("app",["ngSanitize"]),i.a.module("app").config(c).constant("appVersion","3.0.22"),i.a.module("app").directive("home",(function(){return new L})).directive("tagsPanel",(function(){return new j})).directive("notesPanel",(function(){return new R})).directive("editorPanel",(function(){return new S})).directive("footer",(function(){return new A})).directive("lockScreen",(function(){return new H})),i.a.module("app").directive("snAutofocus",["$timeout",z]).directive("clickOutside",["$document",V]).directive("delayHide",W).directive("elemReady",K).directive("fileChange",(function(){return{restrict:"A",scope:{handler:"&"},link:function(e,t){t.on("change",(function(t){e.$apply((function(){e.handler({files:t.target.files})}))}))}}})).directive("infiniteScroll",["$rootScope","$window","$timeout",q]).directive("lowercase",(function(){return{require:"ngModel",link:function(e,t,n,r){var i=function(e){void 0===e&&(e="");var t=e.toLowerCase();return t!==e&&(r.$setViewValue(t),r.$render()),t};r.$parsers.push(i),i(e[n.ngModel])}}})).directive("selectOnClick",["$window",J]).directive("snEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.snEnter,{event:t})})),t.preventDefault())}))}})),i.a.module("app").directive("accountMenu",(function(){return new Z})).directive("actionsMenu",(function(){return new ee})).directive("componentModal",(function(){return new re})).directive("componentView",["$rootScope","componentManager","desktopManager","$timeout",function(e,t,n,r){return new ae(e,t,n,r)}]).directive("conflictResolutionModal",(function(){return new ue})).directive("editorMenu",(function(){return new de})).directive("inputModal",(function(){return new ve})).directive("menuRow",(function(){return new ge})).directive("panelResizer",(function(){return new ke})).directive("passwordWizard",(function(){return new Me})).directive("permissionsModal",(function(){return new Ie})).directive("privilegesAuthModal",(function(){return new De})).directive("privilegesManagementModal",(function(){return new Te})).directive("revisionPreviewModal",(function(){return new Ne})).directive("sessionHistoryMenu",(function(){return new Be})).directive("syncResolutionMenu",(function(){return new Ve})),i.a.module("app").filter("appDate",We).filter("appDateTime",Ke).filter("trusted",["$sce",qe]),i.a.module("app").service("actionsManager",Je).service("archiveManager",Ge).service("authManager",et).service("componentManager",tt).service("dbManager",nt).service("desktopManager",rt).service("httpManager",it).service("keyboardManager",v).service("migrationManager",ot).service("modelManager",at).service("nativeExtManager",st).service("passcodeManager",ct).service("privilegesManager",x).service("sessionHistory",lt).service("singletonManager",ft).service("statusManager",ht).service("storageManager",Qe).service("syncManager",vt).service("alertManager",gt).service("themeManager",mt),o.SFItem.AppDomain="org.standardnotes.sn"}]);
//# sourceMappingURL=app.js.map